From 85eed0dc5683b9d83f4461c5cbb85f6ceca5f377 Mon Sep 17 00:00:00 2001 From: qiwei Date: Fri, 1 Sep 2023 14:18:54 +0800 Subject: [PATCH] Revert "update mapbox-gl-enhance review by qiwei" This reverts commit f0cbf1fa50c08a198ef983c94d79b210de739293. --- static/libs/mapboxgl/mapbox-gl-enhance.js | 90 +++++++++++------------ 1 file changed, 45 insertions(+), 45 deletions(-) diff --git a/static/libs/mapboxgl/mapbox-gl-enhance.js b/static/libs/mapboxgl/mapbox-gl-enhance.js index 3606a3cb..1a1f40f8 100644 --- a/static/libs/mapboxgl/mapbox-gl-enhance.js +++ b/static/libs/mapboxgl/mapbox-gl-enhance.js @@ -1,50 +1,50 @@ -/* Mapbox GL JS is licensed under the 3-Clause BSD License. Full text of license: https://github.com/mapbox/mapbox-gl-js/blob/v1.12.1-3/LICENSE.txt +/* Mapbox GL JS is licensed under the 3-Clause BSD License. Full text of license: https://github.com/mapbox/mapbox-gl-js/blob/v1.12.1/LICENSE.txt * Copyright (c) 2016, Mapbox * Copyright© 2000 - 2023 SuperMap Software Co. Ltd -* 20230831 +* 20230811 */ (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); - if (typeof window !== 'undefined') { - mapboxgl.workerUrl = window.URL.createObjectURL(new Blob([workerBundleString], { type: 'text/javascript' })); + 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); + if (typeof window !== 'undefined') { + 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=i;function i(t,e,r,i){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*(i-e)-this.cy,this.ay=1-this.cy-this.by,this.p1x=t,this.p1y=i,this.p2x=r,this.p2y=i;}i.prototype.sampleCurveX=function(t){return ((this.ax*t+this.bx)*t+this.cx)*t},i.prototype.sampleCurveY=function(t){return ((this.ay*t+this.by)*t+this.cy)*t},i.prototype.sampleCurveDerivativeX=function(t){return (3*this.ax*t+2*this.bx)*t+this.cx},i.prototype.solveCurveX=function(t,e){var r,i,n,a,s;for(void 0===e&&(e=1e-6),n=t,s=0;s<8;s++){if(a=this.sampleCurveX(n)-t,Math.abs(a)(i=1))return i;for(;ra?r=n:i=n,n=.5*(i-r)+r;}return n},i.prototype.solve=function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))};var n=a;function a(t,e){this.x=t,this.y=e;}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[2]*this.x+t[3]*this.y;return this.x=t[0]*this.x+t[1]*this.y,this.y=e,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),i=r*this.x+e*this.y;return this.x=e*this.x-r*this.y,this.y=i,this},_rotateAround:function(t,e){var r=Math.cos(t),i=Math.sin(t),n=e.y+i*(this.x-e.x)+r*(this.y-e.y);return this.x=e.x+r*(this.x-e.x)-i*(this.y-e.y),this.y=n,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 s="undefined"!=typeof self?self:{},o=Math.pow(2,53)-1;function u(t,e,i,n){var a=new r(t,e,i,n);return function(t){return a.solve(t)}}var h=u(.25,.1,.25,1);function l(t,e,r){return Math.min(r,Math.max(e,t))}function p(t,e,r){var i=r-e,n=((t-e)%i+i)%i+e;return n===e?r:n}function c(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];for(var i=0,n=e;i>e/4).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,t)}()}function m(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 v(t,e){t.forEach((function(t){e[t]&&(e[t]=e[t].bind(e));}));}function g(t,e){return -1!==t.indexOf(e,t.length-e.length)}function x(t,e,r){var i={};for(var n in t)i[n]=e.call(r||this,t[n],n,t);return i}function b(t,e,r){var i={};for(var n in t)e.call(r||this,t[n],n,t)&&(i[n]=t[n]);return i}function _(t){return Array.isArray(t)?t.map(_):"object"==typeof t&&t?x(t,_):t}var w={};function M(t){w[t]||("undefined"!=typeof console&&console.warn(t),w[t]=!0);}function S(t,e,r){return (r.y-t.y)*(e.x-t.x)>(e.y-t.y)*(r.x-t.x)}function A(t){for(var e=0,r=0,i=t.length,n=i-1,a=void 0,s=void 0;r@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(function(t,r,i,n){var a=i||n;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}var z=null;function C(t){if(null==z){var e=t.navigator?t.navigator.userAgent:null;z=!!t.safari||!(!e||!(/\b(iPad|iPhone|iPod)\b/.test(e)||e.match("Safari")&&!e.match("Chrome")));}return z}function E(t){try{var e=s[t];return e.setItem("_mapbox_test_",1),e.removeItem("_mapbox_test_"),!0}catch(t){return !1}}var P,B,T,V,L=s.performance&&s.performance.now?s.performance.now.bind(s.performance):Date.now.bind(Date),F=s.requestAnimationFrame||s.mozRequestAnimationFrame||s.webkitRequestAnimationFrame||s.msRequestAnimationFrame,O=s.cancelAnimationFrame||s.mozCancelAnimationFrame||s.webkitCancelAnimationFrame||s.msCancelAnimationFrame,D={now:L,frame:function(t){var e=F(t);return {cancel:function(){return O(e)}}},getImageData:function(t,e){void 0===e&&(e=0);var r=s.document.createElement("canvas"),i=r.getContext("2d");if(!i)throw new Error("failed to create canvas 2d context");return r.width=t.width,r.height=t.height,i.drawImage(t,0,0,t.width,t.height),i.getImageData(-e,-e,t.width+2*e,t.height+2*e)},resolveURL:function(t){return P||(P=s.document.createElement("a")),P.href=t,P.href},hardwareConcurrency:s.navigator&&s.navigator.hardwareConcurrency||4,get devicePixelRatio(){return s.devicePixelRatio},get prefersReducedMotion(){return !!s.matchMedia&&(null==B&&(B=s.matchMedia("(prefers-reduced-motion: reduce)")),B.matches)}},N={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},R={supported:!1,testSupport:function(t){!q&&V&&(j?U(t):T=t);}},q=!1,j=!1;function U(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,V),t.isContextLost())return;R.supported=!0;}catch(t){}t.deleteTexture(e),q=!0;}s.document&&((V=s.document.createElement("img")).onload=function(){T&&U(T),T=null,j=!0;},V.onerror=function(){q=!0,T=null;},V.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");var G="01",K=484813681109536e-20,X=Math.PI/2,H=.017453292519943295,J=57.29577951308232,Z=Math.PI/4,Y=2*Math.PI,W=3.14159265359,Q={greenwich:0,lisbon:-9.131906111111,paris:2.337229166667,bogota:-74.080916666667,madrid:-3.687938888889,rome:12.452333333333,bern:7.439583333333,jakarta:106.807719444444,ferro:-17.666666666667,brussels:4.367975,stockholm:18.058277777778,athens:23.7163375,oslo:10.722916666667},$={ft:{to_meter:.3048},"us-ft":{to_meter:1200/3937}},tt=/[\s_\-\/\(\)]/g;function et(t,e){if(t[e])return t[e];for(var r,i=Object.keys(t),n=e.toLowerCase().replace(tt,""),a=-1;++a0?90:-90),t.lat_ts=t.lat1);}(n),n}function ft(t){var e=this;if(2===arguments.length){var r=arguments[1];ft[t]="string"==typeof r?"+"===r.charAt(0)?rt(arguments[1]):ct(arguments[1]):r;}else if(1===arguments.length){if(Array.isArray(t))return t.map((function(t){Array.isArray(t)?ft.apply(e,t):ft(t);}));if("string"==typeof t){if(t in ft)return ft[t]}else "EPSG"in t?ft["EPSG:"+t.EPSG]=t:"ESRI"in t?ft["ESRI:"+t.ESRI]=t:"IAU2000"in t?ft["IAU2000:"+t.IAU2000]=t:console.log(t);return}}ut.prototype.readCharicter=function(){var t=this.text[this.place++];if(4!==this.state)for(;it.test(t);){if(this.place>=this.text.length)return;t=this.text[this.place++];}switch(this.state){case 1:return this.neutral(t);case 2:return this.keyword(t);case 4:return this.quoted(t);case 5:return this.afterquote(t);case 3:return this.number(t);case-1:return}},ut.prototype.afterquote=function(t){if('"'===t)return this.word+='"',void(this.state=4);if(st.test(t))return this.word=this.word.trim(),void this.afterItem(t);throw new Error("havn't handled \""+t+'" in afterquote yet, index '+this.place)},ut.prototype.afterItem=function(t){return ","===t?(null!==this.word&&this.currentObject.push(this.word),this.word=null,void(this.state=1)):"]"===t?(this.level--,null!==this.word&&(this.currentObject.push(this.word),this.word=null),this.state=1,this.currentObject=this.stack.pop(),void(this.currentObject||(this.state=-1))):void 0},ut.prototype.number=function(t){if(!ot.test(t)){if(st.test(t))return this.word=parseFloat(this.word),void this.afterItem(t);throw new Error("havn't handled \""+t+'" in number yet, index '+this.place)}this.word+=t;},ut.prototype.quoted=function(t){'"'!==t?this.word+=t:this.state=5;},ut.prototype.keyword=function(t){if(at.test(t))this.word+=t;else {if("["===t){var e=[];return e.push(this.word),this.level++,null===this.root?this.root=e:this.currentObject.push(e),this.stack.push(this.currentObject),this.currentObject=e,void(this.state=1)}if(!st.test(t))throw new Error("havn't handled \""+t+'" in keyword yet, index '+this.place);this.afterItem(t);}},ut.prototype.neutral=function(t){if(nt.test(t))return this.word=t,void(this.state=2);if('"'===t)return this.word="",void(this.state=4);if(ot.test(t))return this.word=t,void(this.state=3);if(!st.test(t))throw new Error("havn't handled \""+t+'" in neutral yet, index '+this.place);this.afterItem(t);},ut.prototype.output=function(){for(;this.place-1}))}(t)){var e=ct(t);if(function(t){var e=et(t,"authority");if(e){var r=et(e,"epsg");return r&&dt.indexOf(r)>-1}}(e))return ft["EPSG:3857"];var r=function(t){var e=et(t,"extension");if(e)return et(e,"proj4")}(e);return r?rt(r):e}return function(t){return "+"===t[0]}(t)?rt(t):void 0}function vt(t,e){var r,i;if(t=t||{},!e)return t;for(i in e)void 0!==(r=e[i])&&(t[i]=r);return t}function gt(t,e,r){var i=t*e;return r/Math.sqrt(1-i*i)}function xt(t){return t<0?-1:1}function bt(t){return Math.abs(t)<=W?t:t-xt(t)*Y}function _t(t,e,r){var i=t*r;return i=Math.pow((1-i)/(1+i),.5*t),Math.tan(.5*(X-e))/i}function wt(t,e){for(var r,i,n=.5*t,a=X-2*Math.atan(e),s=0;s<=15;s++)if(r=t*Math.sin(a),a+=i=X-2*Math.atan(e*Math.pow((1-r)/(1+r),n))-a,Math.abs(i)<=1e-10)return a;return -9999}function Mt(t){return t}var St=[{init:function(){var t=this.b/this.a;this.es=1-t*t,"x0"in this||(this.x0=0),"y0"in this||(this.y0=0),this.e=Math.sqrt(this.es),this.lat_ts?this.k0=this.sphere?Math.cos(this.lat_ts):gt(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)):this.k0||(this.k0=this.k?this.k:1);},forward:function(t){var e,r,i=t.x,n=t.y;if(n*J>90&&n*J<-90&&i*J>180&&i*J<-180)return null;if(Math.abs(Math.abs(n)-X)<=1e-10)return null;if(this.sphere)e=this.x0+this.a*this.k0*bt(i-this.long0),r=this.y0+this.a*this.k0*Math.log(Math.tan(Z+.5*n));else {var a=Math.sin(n),s=_t(this.e,n,a);e=this.x0+this.a*this.k0*bt(i-this.long0),r=this.y0-this.a*this.k0*Math.log(s);}return t.x=e,t.y=r,t},inverse:function(t){var e,r,i=t.x-this.x0,n=t.y-this.y0;if(this.sphere)r=X-2*Math.atan(Math.exp(-n/(this.a*this.k0)));else {var a=Math.exp(-n/(this.a*this.k0));if(-9999===(r=wt(this.e,a)))return null}return e=bt(this.long0+i/(this.a*this.k0)),t.x=e,t.y=r,t},names:["Mercator","Popular Visualisation Pseudo Mercator","Mercator_1SP","Mercator_Auxiliary_Sphere","merc"]},{init:function(){},forward:Mt,inverse:Mt,names:["longlat","identity"]}],At={},kt=[];function It(t,e){var r=kt.length;return t.names?(kt[r]=t,t.names.forEach((function(t){At[t.toLowerCase()]=r;})),this):(console.log(e),!0)}var zt={start:function(){St.forEach(It);},add:It,get:function(t){if(!t)return !1;var e=t.toLowerCase();return void 0!==At[e]&&kt[At[e]]?kt[At[e]]:void 0}},Ct={MERIT:{a:6378137,rf:298.257,ellipseName:"MERIT 1983"},SGS85:{a:6378136,rf:298.257,ellipseName:"Soviet Geodetic System 85"},GRS80:{a:6378137,rf:298.257222101,ellipseName:"GRS 1980(IUGG, 1980)"},IAU76:{a:6378140,rf:298.257,ellipseName:"IAU 1976"},airy:{a:6377563.396,b:6356256.91,ellipseName:"Airy 1830"},APL4:{a:6378137,rf:298.25,ellipseName:"Appl. Physics. 1965"},NWL9D:{a:6378145,rf:298.25,ellipseName:"Naval Weapons Lab., 1965"},mod_airy:{a:6377340.189,b:6356034.446,ellipseName:"Modified Airy"},andrae:{a:6377104.43,rf:300,ellipseName:"Andrae 1876 (Den., Iclnd.)"},aust_SA:{a:6378160,rf:298.25,ellipseName:"Australian Natl & S. Amer. 1969"},GRS67:{a:6378160,rf:298.247167427,ellipseName:"GRS 67(IUGG 1967)"},bessel:{a:6377397.155,rf:299.1528128,ellipseName:"Bessel 1841"},bess_nam:{a:6377483.865,rf:299.1528128,ellipseName:"Bessel 1841 (Namibia)"},clrk66:{a:6378206.4,b:6356583.8,ellipseName:"Clarke 1866"},clrk80:{a:6378249.145,rf:293.4663,ellipseName:"Clarke 1880 mod."},clrk80ign:{a:6378249.2,b:6356515,rf:293.4660213,ellipseName:"Clarke 1880 (IGN)"},clrk58:{a:6378293.645208759,rf:294.2606763692654,ellipseName:"Clarke 1858"},CPM:{a:6375738.7,rf:334.29,ellipseName:"Comm. des Poids et Mesures 1799"},delmbr:{a:6376428,rf:311.5,ellipseName:"Delambre 1810 (Belgium)"},engelis:{a:6378136.05,rf:298.2566,ellipseName:"Engelis 1985"},evrst30:{a:6377276.345,rf:300.8017,ellipseName:"Everest 1830"},evrst48:{a:6377304.063,rf:300.8017,ellipseName:"Everest 1948"},evrst56:{a:6377301.243,rf:300.8017,ellipseName:"Everest 1956"},evrst69:{a:6377295.664,rf:300.8017,ellipseName:"Everest 1969"},evrstSS:{a:6377298.556,rf:300.8017,ellipseName:"Everest (Sabah & Sarawak)"},fschr60:{a:6378166,rf:298.3,ellipseName:"Fischer (Mercury Datum) 1960"},fschr60m:{a:6378155,rf:298.3,ellipseName:"Fischer 1960"},fschr68:{a:6378150,rf:298.3,ellipseName:"Fischer 1968"},helmert:{a:6378200,rf:298.3,ellipseName:"Helmert 1906"},hough:{a:6378270,rf:297,ellipseName:"Hough"},intl:{a:6378388,rf:297,ellipseName:"International 1909 (Hayford)"},kaula:{a:6378163,rf:298.24,ellipseName:"Kaula 1961"},lerch:{a:6378139,rf:298.257,ellipseName:"Lerch 1979"},mprts:{a:6397300,rf:191,ellipseName:"Maupertius 1738"},new_intl:{a:6378157.5,b:6356772.2,ellipseName:"New International 1967"},plessis:{a:6376523,rf:6355863,ellipseName:"Plessis 1817 (France)"},krass:{a:6378245,rf:298.3,ellipseName:"Krassovsky, 1942"},SEasia:{a:6378155,b:6356773.3205,ellipseName:"Southeast Asia"},walbeck:{a:6376896,b:6355834.8467,ellipseName:"Walbeck"},WGS60:{a:6378165,rf:298.3,ellipseName:"WGS 60"},WGS66:{a:6378145,rf:298.25,ellipseName:"WGS 66"},WGS7:{a:6378135,rf:298.26,ellipseName:"WGS 72"}},Et=Ct.WGS84={a:6378137,rf:298.257223563,ellipseName:"WGS 84"};Ct.sphere={a:6370997,b:6370997,ellipseName:"Normal Sphere (r=6370997)"};var Pt={wgs84:{towgs84:"0,0,0",ellipse:"WGS84",datumName:"WGS84"},ch1903:{towgs84:"674.374,15.056,405.346",ellipse:"bessel",datumName:"swiss"},ggrs87:{towgs84:"-199.87,74.79,246.62",ellipse:"GRS80",datumName:"Greek_Geodetic_Reference_System_1987"},nad83:{towgs84:"0,0,0",ellipse:"GRS80",datumName:"North_American_Datum_1983"},nad27:{nadgrids:"@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat",ellipse:"clrk66",datumName:"North_American_Datum_1927"},potsdam:{towgs84:"598.1,73.7,418.2,0.202,0.045,-2.455,6.7",ellipse:"bessel",datumName:"Potsdam Rauenberg 1950 DHDN"},carthage:{towgs84:"-263.0,6.0,431.0",ellipse:"clark80",datumName:"Carthage 1934 Tunisia"},hermannskogel:{towgs84:"577.326,90.129,463.919,5.137,1.474,5.297,2.4232",ellipse:"bessel",datumName:"Hermannskogel"},osni52:{towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"airy",datumName:"Irish National"},ire65:{towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"mod_airy",datumName:"Ireland 1965"},rassadiran:{towgs84:"-133.63,-157.5,-158.62",ellipse:"intl",datumName:"Rassadiran"},nzgd49:{towgs84:"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993",ellipse:"intl",datumName:"New Zealand Geodetic Datum 1949"},osgb36:{towgs84:"446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894",ellipse:"airy",datumName:"Airy 1830"},s_jtsk:{towgs84:"589,76,480",ellipse:"bessel",datumName:"S-JTSK (Ferro)"},beduaram:{towgs84:"-106,-87,188",ellipse:"clrk80",datumName:"Beduaram"},gunung_segara:{towgs84:"-403,684,41",ellipse:"bessel",datumName:"Gunung Segara Jakarta"},rnb72:{towgs84:"106.869,-52.2978,103.724,-0.33657,0.456955,-1.84218,1",ellipse:"intl",datumName:"Reseau National Belge 1972"}},Bt={};function Tt(t){if(0===t.length)return null;var e="@"===t[0];return e&&(t=t.slice(1)),"null"===t?{name:"null",mandatory:!e,grid:null,isNull:!0}:{name:t,mandatory:!e,grid:Bt[t]||null,isNull:!1}}function Vt(t){return t/3600*Math.PI/180}function Lt(t,e,r){return String.fromCharCode.apply(null,new Uint8Array(t.buffer.slice(e,r)))}function Ft(t){return t.map((function(t){return [Vt(t.longitudeShift),Vt(t.latitudeShift)]}))}function Ot(t,e,r){return {name:Lt(t,e+8,e+16).trim(),parent:Lt(t,e+24,e+24+8).trim(),lowerLatitude:t.getFloat64(e+72,r),upperLatitude:t.getFloat64(e+88,r),lowerLongitude:t.getFloat64(e+104,r),upperLongitude:t.getFloat64(e+120,r),latitudeInterval:t.getFloat64(e+136,r),longitudeInterval:t.getFloat64(e+152,r),gridNodeCount:t.getInt32(e+168,r)}}function Dt(t,e,r,i){for(var n=e+176,a=[],s=0;s3&&(0===o.datum_params[3]&&0===o.datum_params[4]&&0===o.datum_params[5]&&0===o.datum_params[6]||(o.datum_type=2,o.datum_params[3]*=K,o.datum_params[4]*=K,o.datum_params[5]*=K,o.datum_params[6]=o.datum_params[6]/1e6+1))),s&&(o.datum_type=3,o.grids=s),o.a=r,o.b=i,o.es=n,o.ep2=a,o}(r.datumCode,r.datum_params,p.a,p.b,c.es,c.ep2,f);vt(this,r),vt(this,i),this.a=p.a,this.b=p.b,this.rf=p.rf,this.sphere=p.sphere,this.es=c.es,this.e=c.e,this.ep2=c.ep2,this.datum=y,this.init(),e(null,this);}else e(t);}else e(t);}function Rt(t,e,r){var i,n,a,s=t.x,o=t.y,u=t.z?t.z:0;if(o<-X&&o>-1.001*X)o=-X;else if(o>X&&o<1.001*X)o=X;else {if(o<-X)return {x:-1/0,y:-1/0,z:t.z};if(o>X)return {x:1/0,y:1/0,z:t.z}}return s>Math.PI&&(s-=2*Math.PI),n=Math.sin(o),a=Math.cos(o),{x:((i=r/Math.sqrt(1-e*(n*n)))+u)*a*Math.cos(s),y:(i+u)*a*Math.sin(s),z:(i*(1-e)+u)*n}}function qt(t,e,r,i){var n,a,s,o,u,h,l,p,c,f,y,d,m,v,g,x=t.x,b=t.y,_=t.z?t.z:0;if(n=Math.sqrt(x*x+b*b),a=Math.sqrt(x*x+b*b+_*_),n/r<1e-12){if(v=0,a/r<1e-12)return g=-i,{x:t.x,y:t.y,z:t.z}}else v=Math.atan2(b,x);s=_/a,p=(o=n/a)*(1-e)*(u=1/Math.sqrt(1-e*(2-e)*o*o)),c=s*u,m=0;do{m++,h=e*(l=r/Math.sqrt(1-e*c*c))/(l+(g=n*p+_*c-l*(1-e*c*c))),d=(y=s*(u=1/Math.sqrt(1-h*(2-h)*o*o)))*p-(f=o*(1-h)*u)*c,p=f,c=y;}while(d*d>1e-24&&m<30);return {x:v,y:Math.atan(y/Math.abs(f)),z:g}}function jt(t){return 1===t||2===t}function Ut(t,e,r){if(null===t.grids||0===t.grids.length)return console.log("Grid shift grids not found"),-1;for(var i={x:-r.x,y:r.y},n={x:Number.NaN,y:Number.NaN},a=[],s=0;si.y||u.ll[0]-h>i.x||u.ll[1]+(u.lim[1]-1)*u.del[1]+h1e-12&&Math.abs(s.y)>1e-12);if(u<0)return console.log("Inverse grid shift iterator failed to converge."),i;i.x=bt(a.x+r.ll[0]),i.y=a.y+r.ll[1];}else isNaN(a.x)||(i.x=t.x+a.x,i.y=t.y+a.y);return i}function Kt(t,e){var r,i={x:t.x/e.del[0],y:t.y/e.del[1]},n=Math.floor(i.x),a=Math.floor(i.y),s=i.x-1*n,o=i.y-1*a,u={x:Number.NaN,y:Number.NaN};if(n<0||n>=e.lim[0])return u;if(a<0||a>=e.lim[1])return u;var h=e.cvs[r=a*e.lim[0]+n][0],l=e.cvs[r][1];r++;var p=e.cvs[r][0],c=e.cvs[r][1],f=e.cvs[r+=e.lim[0]][0],y=e.cvs[r][1];r--;var d=e.cvs[r][1],m=s*o,v=s*(1-o),g=(1-s)*(1-o),x=(1-s)*o;return u.x=g*h+v*p+x*e.cvs[r][0]+m*f,u.y=g*l+v*c+x*d+m*y,u}function Xt(t,e,r){var i,n,a,s=r.x,o=r.y,u=r.z||0,h={};for(a=0;a<3;a++)if(!e||2!==a||void 0!==r.z)switch(0===a?(i=s,n=-1!=="ew".indexOf(t.axis[a])?"x":"y"):1===a?(i=o,n=-1!=="ns".indexOf(t.axis[a])?"y":"x"):(i=u,n="z"),t.axis[a]){case"e":h[n]=i;break;case"w":h[n]=-i;break;case"n":h[n]=i;break;case"s":h[n]=-i;break;case"u":void 0!==r[n]&&(h.z=i);break;case"d":void 0!==r[n]&&(h.z=-i);break;default:return null}return h}function Ht(t){var e={x:t[0],y:t[1]};return t.length>2&&(e.z=t[2]),t.length>3&&(e.m=t[3]),e}function Jt(t){if("function"==typeof Number.isFinite){if(Number.isFinite(t))return;throw new TypeError("coordinates must be finite numbers")}if("number"!=typeof t||t!=t||!isFinite(t))throw new TypeError("coordinates must be finite numbers")}function Zt(t,e,r,i){var n,a=void 0!==(r=Array.isArray(r)?Ht(r):{x:r.x,y:r.y,z:r.z,m:r.m}).z;if(function(t){Jt(t.x),Jt(t.y);}(r),t.datum&&e.datum&&function(t,e){return (1===t.datum.datum_type||2===t.datum.datum_type||3===t.datum.datum_type)&&"WGS84"!==e.datumCode||(1===e.datum.datum_type||2===e.datum.datum_type||3===e.datum.datum_type)&&"WGS84"!==t.datumCode}(t,e)&&(r=Zt(t,n=new Nt("WGS84"),r,i),t=n),i&&"enu"!==t.axis&&(r=Xt(t,!1,r)),"longlat"===t.projName)r={x:r.x*H,y:r.y*H,z:r.z||0};else if(t.to_meter&&(r={x:r.x*t.to_meter,y:r.y*t.to_meter,z:r.z||0}),!(r=t.inverse(r)))return;if(t.from_greenwich&&(r.x+=t.from_greenwich),r=function(t,e,r){if(function(t,e){return t.datum_type===e.datum_type&&!(t.a!==e.a||Math.abs(t.es-e.es)>5e-11)&&(1===t.datum_type?t.datum_params[0]===e.datum_params[0]&&t.datum_params[1]===e.datum_params[1]&&t.datum_params[2]===e.datum_params[2]:2!==t.datum_type||t.datum_params[0]===e.datum_params[0]&&t.datum_params[1]===e.datum_params[1]&&t.datum_params[2]===e.datum_params[2]&&t.datum_params[3]===e.datum_params[3]&&t.datum_params[4]===e.datum_params[4]&&t.datum_params[5]===e.datum_params[5]&&t.datum_params[6]===e.datum_params[6])}(t,e))return r;if(5===t.datum_type||5===e.datum_type)return r;var i=t.a,n=t.es;if(3===t.datum_type){if(0!==Ut(t,!1,r))return;i=6378137,n=.0066943799901413165;}var a=e.a,s=e.b,o=e.es;return 3===e.datum_type&&(a=6378137,s=6356752.314,o=.0066943799901413165),n!==o||i!==a||jt(t.datum_type)||jt(e.datum_type)?(r=Rt(r,n,i),jt(t.datum_type)&&(r=function(t,e,r){if(1===e)return {x:t.x+r[0],y:t.y+r[1],z:t.z+r[2]};if(2===e){var i=r[3],n=r[4],a=r[5],s=r[6];return {x:s*(t.x-a*t.y+n*t.z)+r[0],y:s*(a*t.x+t.y-i*t.z)+r[1],z:s*(-n*t.x+i*t.y+t.z)+r[2]}}}(r,t.datum_type,t.datum_params)),jt(e.datum_type)&&(r=function(t,e,r){if(1===e)return {x:t.x-r[0],y:t.y-r[1],z:t.z-r[2]};if(2===e){var i=r[3],n=r[4],a=r[5],s=r[6],o=(t.x-r[0])/s,u=(t.y-r[1])/s,h=(t.z-r[2])/s;return {x:o+a*u-n*h,y:-a*o+u+i*h,z:n*o-i*u+h}}}(r,e.datum_type,e.datum_params)),r=qt(r,o,a,s),3!==e.datum_type||0===Ut(e,!0,r)?r:void 0):r}(t.datum,e.datum,r))return e.from_greenwich&&(r={x:r.x-e.from_greenwich,y:r.y,z:r.z||0}),"longlat"===e.projName?r={x:r.x*J,y:r.y*J,z:r.z||0}:(r=e.forward(r),e.to_meter&&(r={x:r.x/e.to_meter,y:r.y/e.to_meter,z:r.z||0})),i&&"enu"!==e.axis?Xt(e,!0,r):(a||delete r.z,r)}(Nt.projections=zt).start();var Yt=Nt("WGS84");function Wt(t,e,r,i){var n,a,s;return Array.isArray(r)?(n=Zt(t,e,r,i)||{x:NaN,y:NaN},r.length>2?void 0!==t.name&&"geocent"===t.name||void 0!==e.name&&"geocent"===e.name?"number"==typeof n.z?[n.x,n.y,n.z].concat(r.splice(3)):[n.x,n.y,r[2]].concat(r.splice(3)):[n.x,n.y].concat(r.splice(2)):[n.x,n.y]):(a=Zt(t,e,r,i),2===(s=Object.keys(r)).length||s.forEach((function(i){if(void 0!==t.name&&"geocent"===t.name||void 0!==e.name&&"geocent"===e.name){if("x"===i||"y"===i||"z"===i)return}else if("x"===i||"y"===i)return;a[i]=r[i];})),a)}function Qt(t){return t instanceof Nt?t:t.oProj?t.oProj:Nt(t)}function $t(t,e,r){t=Qt(t);var i,n=!1;return void 0===e?(e=t,t=Yt,n=!0):(void 0!==e.x||Array.isArray(e))&&(r=e,e=t,t=Yt,n=!0),e=Qt(e),r?Wt(t,e,r):(i={forward:function(r,i){return Wt(t,e,r,i)},inverse:function(r,i){return Wt(e,t,r,i)}},n&&(i.oProj=e),i)}var te=65,ee=73,re=79,ie={forward:ne,inverse:function(t){var e=ue(le(t.toUpperCase()));return e.lat&&e.lon?[e.lon,e.lat,e.lon,e.lat]:[e.left,e.bottom,e.right,e.top]},toPoint:ae};function ne(t,e){return e=e||5,function(t,e){var r,i,n,a,s,o,u,h,l,p,c,f="00000"+t.easting,y="00000"+t.northing;return t.zoneNumber+t.zoneLetter+(l=t.easting,p=t.northing,c=he(t.zoneNumber),r=Math.floor(l/1e5),i=Math.floor(p/1e5)%20,a="AJSAJS".charCodeAt(n=c-1),s="AFAFAF".charCodeAt(n),h=!1,(o=a+r-1)>90&&(o=o-90+te-1,h=!0),(o===ee||aee||(o>ee||are||(o>re||a90&&(o=o-90+te-1),(u=s+i)>86?(u=u-86+te-1,h=!0):h=!1,(u===ee||see||(u>ee||sre||(u>re||s86&&(u=u-86+te-1),String.fromCharCode(o)+String.fromCharCode(u))+f.substr(f.length-5,e)+y.substr(y.length-5,e)}(function(t){var e,r,i,n,a,s,o=t.lat,u=t.lon,h=6378137,l=se(o),p=se(u);s=Math.floor((u+180)/6)+1,180===u&&(s=60),o>=56&&o<64&&u>=3&&u<12&&(s=32),o>=72&&o<84&&(u>=0&&u<9?s=31:u>=9&&u<21?s=33:u>=21&&u<33?s=35:u>=33&&u<42&&(s=37)),a=se(6*(s-1)-180+3),e=h/Math.sqrt(1-.00669438*Math.sin(l)*Math.sin(l)),r=Math.tan(l)*Math.tan(l),i=.006739496752268451*Math.cos(l)*Math.cos(l);var c,f,y=.9996*e*((n=Math.cos(l)*(p-a))+(1-r+i)*n*n*n/6+(5-18*r+r*r+72*i-.39089081163157013)*n*n*n*n*n/120)+5e5,d=.9996*(h*(.9983242984503243*l-.002514607064228144*Math.sin(2*l)+2639046602129982e-21*Math.sin(4*l)-3.418046101696858e-9*Math.sin(6*l))+e*Math.tan(l)*(n*n/2+(5-r+9*i+4*i*i)*n*n*n*n/24+(61-58*r+r*r+600*i-2.2240339282485886)*n*n*n*n*n*n/720));return o<0&&(d+=1e7),{northing:Math.round(d),easting:Math.round(y),zoneNumber:s,zoneLetter:(c=o,f="Z",84>=c&&c>=72?f="X":72>c&&c>=64?f="W":64>c&&c>=56?f="V":56>c&&c>=48?f="U":48>c&&c>=40?f="T":40>c&&c>=32?f="S":32>c&&c>=24?f="R":24>c&&c>=16?f="Q":16>c&&c>=8?f="P":8>c&&c>=0?f="N":0>c&&c>=-8?f="M":-8>c&&c>=-16?f="L":-16>c&&c>=-24?f="K":-24>c&&c>=-32?f="J":-32>c&&c>=-40?f="H":-40>c&&c>=-48?f="G":-48>c&&c>=-56?f="F":-56>c&&c>=-64?f="E":-64>c&&c>=-72?f="D":-72>c&&c>=-80&&(f="C"),f)}}({lat:t[1],lon:t[0]}),e)}function ae(t){var e=ue(le(t.toUpperCase()));return e.lat&&e.lon?[e.lon,e.lat]:[(e.left+e.right)/2,(e.top+e.bottom)/2]}function se(t){return t*(Math.PI/180)}function oe(t){return t/Math.PI*180}function ue(t){var e=t.northing,r=t.easting,i=t.zoneLetter,n=t.zoneNumber;if(n<0||n>60)return null;var a,s,o,u,h,l,p,c,f=6378137,y=(1-Math.sqrt(.99330562))/(1+Math.sqrt(.99330562)),d=r-5e5,m=e;i<"N"&&(m-=1e7),l=6*(n-1)-180+3,c=(p=m/.9996/6367449.145945056)+(3*y/2-27*y*y*y/32)*Math.sin(2*p)+(21*y*y/16-55*y*y*y*y/32)*Math.sin(4*p)+151*y*y*y/96*Math.sin(6*p),a=f/Math.sqrt(1-.00669438*Math.sin(c)*Math.sin(c)),s=Math.tan(c)*Math.tan(c),o=.006739496752268451*Math.cos(c)*Math.cos(c),u=.99330562*f/Math.pow(1-.00669438*Math.sin(c)*Math.sin(c),1.5),h=d/(.9996*a);var v=c-a*Math.tan(c)/u*(h*h/2-(5+3*s+10*o-4*o*o-.06065547077041606)*h*h*h*h/24+(61+90*s+298*o+45*s*s-1.6983531815716497-3*o*o)*h*h*h*h*h*h/720);v=oe(v);var g,x=(h-(1+2*s+o)*h*h*h/6+(5-2*o+28*s-3*o*o+.05391597401814761+24*s*s)*h*h*h*h*h/120)/Math.cos(c);if(x=l+oe(x),t.accuracy){var b=ue({northing:t.northing+t.accuracy,easting:t.easting+t.accuracy,zoneLetter:t.zoneLetter,zoneNumber:t.zoneNumber});g={top:b.lat,right:b.lon,bottom:v,left:x};}else g={lat:v,lon:x};return g}function he(t){var e=t%6;return 0===e&&(e=6),e}function le(t){if(t&&0===t.length)throw "MGRSPoint coverting from nothing";for(var e,r=t.length,i=null,n="",a=0;!/[A-Z]/.test(e=t.charAt(a));){if(a>=2)throw "MGRSPoint bad conversion from: "+t;n+=e,a++;}var s=parseInt(n,10);if(0===a||a+3>r)throw "MGRSPoint bad conversion from: "+t;var o=t.charAt(a++);if(o<="A"||"B"===o||"Y"===o||o>="Z"||"I"===o||"O"===o)throw "MGRSPoint zone letter "+o+" not handled: "+t;i=t.substring(a,a+=2);for(var u=he(s),h=function(t,e){for(var r="AJSAJS".charCodeAt(e-1),i=1e5,n=!1;r!==t.charCodeAt(0);){if(++r===ee&&r++,r===re&&r++,r>90){if(n)throw "Bad character: "+t;r=te,n=!0;}i+=1e5;}return i}(i.charAt(0),u),l=function(t,e){if(t>"V")throw "MGRSPoint given invalid Northing "+t;for(var r="AFAFAF".charCodeAt(e-1),i=0,n=!1;r!==t.charCodeAt(0);){if(++r===ee&&r++,r===re&&r++,r>86){if(n)throw "Bad character: "+t;r=te,n=!0;}i+=1e5;}return i}(i.charAt(1),u);l0&&(c=1e5/Math.pow(10,d),f=t.substring(a,a+d),m=parseFloat(f)*c,y=t.substring(a+d),v=parseFloat(y)*c),{easting:m+h,northing:v+l,zoneLetter:o,zoneNumber:s,accuracy:c}}function pe(t){var e;switch(t){case"C":e=11e5;break;case"D":e=2e6;break;case"E":e=28e5;break;case"F":e=37e5;break;case"G":e=46e5;break;case"H":e=55e5;break;case"J":e=64e5;break;case"K":e=73e5;break;case"L":e=82e5;break;case"M":e=91e5;break;case"N":e=0;break;case"P":e=8e5;break;case"Q":e=17e5;break;case"R":e=26e5;break;case"S":e=35e5;break;case"T":e=44e5;break;case"U":e=53e5;break;case"V":e=62e5;break;case"W":e=7e6;break;case"X":e=79e5;break;default:e=-1;}if(e>=0)return e;throw "Invalid zone letter: "+t}function ce(t,e,r){if(!(this instanceof ce))return new ce(t,e,r);if(Array.isArray(t))this.x=t[0],this.y=t[1],this.z=t[2]||0;else if("object"==typeof t)this.x=t.x,this.y=t.y,this.z=t.z||0;else if("string"==typeof t&&void 0===e){var i=t.split(",");this.x=parseFloat(i[0],10),this.y=parseFloat(i[1],10),this.z=parseFloat(i[2],10)||0;}else this.x=t,this.y=e,this.z=r||0;console.warn("proj4.Point will be removed in version 3, use proj4.toPoint");}ce.fromMGRS=function(t){return new ce(ae(t))},ce.prototype.toMGRS=function(t){return ne([this.x,this.y],t)};var fe=.01068115234375;function ye(t){var e=[];e[0]=1-t*(.25+t*(.046875+t*(.01953125+t*fe))),e[1]=t*(.75-t*(.046875+t*(.01953125+t*fe)));var r=t*t;return e[2]=r*(.46875-t*(.013020833333333334+.007120768229166667*t)),e[3]=(r*=t)*(.3645833333333333-.005696614583333333*t),e[4]=r*t*.3076171875,e}function de(t,e,r,i){return i[0]*t-(r*=e)*(i[1]+(e*=e)*(i[2]+e*(i[3]+e*i[4])))}function me(t,e,r){for(var i=1/(1-e),n=t,a=20;a;--a){var s=Math.sin(n),o=1-e*s*s;if(n-=o=(de(n,s,Math.cos(n),r)-t)*(o*Math.sqrt(o))*i,Math.abs(o)<1e-10)return n}return n}var ve={init:function(){this.x0=void 0!==this.x0?this.x0:0,this.y0=void 0!==this.y0?this.y0:0,this.long0=void 0!==this.long0?this.long0:0,this.lat0=void 0!==this.lat0?this.lat0:0,this.es&&(this.en=ye(this.es),this.ml0=de(this.lat0,Math.sin(this.lat0),Math.cos(this.lat0),this.en));},forward:function(t){var e,r,i,n=t.y,a=bt(t.x-this.long0),s=Math.sin(n),o=Math.cos(n);if(this.es){var u=o*a,h=Math.pow(u,2),l=this.ep2*Math.pow(o,2),p=Math.pow(l,2),c=Math.abs(o)>1e-10?Math.tan(n):0,f=Math.pow(c,2),y=Math.pow(f,2);e=1-this.es*Math.pow(s,2),u/=Math.sqrt(e);var d=de(n,s,o,this.en);r=this.a*(this.k0*u*(1+h/6*(1-f+l+h/20*(5-18*f+y+14*l-58*f*l+h/42*(61+179*y-y*f-479*f)))))+this.x0,i=this.a*(this.k0*(d-this.ml0+s*a*u/2*(1+h/12*(5-f+9*l+4*p+h/30*(61+y-58*f+270*l-330*f*l+h/56*(1385+543*y-y*f-3111*f))))))+this.y0;}else {var m=o*Math.sin(a);if(Math.abs(Math.abs(m)-1)<1e-10)return 93;if(r=.5*this.a*this.k0*Math.log((1+m)/(1-m))+this.x0,i=o*Math.cos(a)/Math.sqrt(1-Math.pow(m,2)),(m=Math.abs(i))>=1){if(m-1>1e-10)return 93;i=0;}else i=Math.acos(i);n<0&&(i=-i),i=this.a*this.k0*(i-this.lat0)+this.y0;}return t.x=r,t.y=i,t},inverse:function(t){var e,r,i,n,a=1/this.a*(t.x-this.x0),s=1/this.a*(t.y-this.y0);if(this.es)if(r=me(e=this.ml0+s/this.k0,this.es,this.en),Math.abs(r)1e-10?Math.tan(r):0,l=this.ep2*Math.pow(u,2),p=Math.pow(l,2),c=Math.pow(h,2),f=Math.pow(c,2);e=1-this.es*Math.pow(o,2);var y=a*Math.sqrt(e)/this.k0,d=Math.pow(y,2);i=r-(e*=h)*d/(1-this.es)*.5*(1-d/12*(5+3*c-9*l*c+l-4*p-d/30*(61+90*c-252*l*c+45*f+46*l-d/56*(1385+3633*c+4095*f+1574*f*c)))),n=bt(this.long0+y*(1-d/6*(1+2*c+l-d/20*(5+28*c+24*f+8*l*c+6*l-d/42*(61+662*c+1320*f+720*f*c))))/u);}else i=X*xt(s),n=0;else {var m=Math.exp(a/this.k0),v=.5*(m-1/m),g=Math.cos(this.lat0+s/this.k0);e=Math.sqrt((1-Math.pow(g,2))/(1+Math.pow(v,2))),i=Math.asin(e),s<0&&(i=-i),n=0===v&&0===g?0:bt(Math.atan2(v,g)+this.long0);}return t.x=n,t.y=i,t},names:["Fast_Transverse_Mercator","Fast Transverse Mercator"]};function ge(t){var e=Math.exp(t);return (e-1/e)/2}function xe(t,e){t=Math.abs(t),e=Math.abs(e);var r=Math.max(t,e),i=Math.min(t,e)/(r||1);return r*Math.sqrt(1+Math.pow(i,2))}function be(t,e){for(var r,i=2*Math.cos(2*e),n=t.length-1,a=t[n],s=0;--n>=0;)r=i*a-s+t[n],s=a,a=r;return e+r*Math.sin(2*e)}function _e(t,e,r){for(var i,n,a=Math.sin(e),s=Math.cos(e),o=ge(r),u=function(t){var e=Math.exp(t);return (e+1/e)/2}(r),h=2*s*u,l=-2*a*o,p=t.length-1,c=t[p],f=0,y=0,d=0;--p>=0;)i=y,n=f,c=h*(y=c)-i-l*(f=d)+t[p],d=l*y-n+h*f;return [(h=a*u)*c-(l=s*o)*d,h*d+l*c]}var we={init:function(){if(!this.approx&&(isNaN(this.es)||this.es<=0))throw new Error('Incorrect elliptical usage. Try using the +approx option in the proj string, or PROJECTION["Fast_Transverse_Mercator"] in the WKT.');this.approx&&(ve.init.apply(this),this.forward=ve.forward,this.inverse=ve.inverse),this.x0=void 0!==this.x0?this.x0:0,this.y0=void 0!==this.y0?this.y0:0,this.long0=void 0!==this.long0?this.long0:0,this.lat0=void 0!==this.lat0?this.lat0:0,this.cgb=[],this.cbg=[],this.utg=[],this.gtu=[];var t=this.es/(1+Math.sqrt(1-this.es)),e=t/(2-t),r=e;this.cgb[0]=e*(2+e*(-2/3+e*(e*(116/45+e*(26/45+e*(-2854/675)))-2))),this.cbg[0]=e*(e*(2/3+e*(4/3+e*(-82/45+e*(32/45+e*(4642/4725)))))-2),this.cgb[1]=(r*=e)*(7/3+e*(e*(-227/45+e*(2704/315+e*(2323/945)))-1.6)),this.cbg[1]=r*(5/3+e*(-16/15+e*(-13/9+e*(904/315+e*(-1522/945))))),this.cgb[2]=(r*=e)*(56/15+e*(-136/35+e*(-1262/105+e*(73814/2835)))),this.cbg[2]=r*(-26/15+e*(34/21+e*(1.6+e*(-12686/2835)))),this.cgb[3]=(r*=e)*(4279/630+e*(-332/35+e*(-399572/14175))),this.cbg[3]=r*(1237/630+e*(e*(-24832/14175)-2.4)),this.cgb[4]=(r*=e)*(4174/315+e*(-144838/6237)),this.cbg[4]=r*(-734/315+e*(109598/31185)),this.cgb[5]=(r*=e)*(601676/22275),this.cbg[5]=r*(444337/155925),r=Math.pow(e,2),this.Qn=this.k0/(1+e)*(1+r*(1/4+r*(1/64+r/256))),this.utg[0]=e*(e*(2/3+e*(-37/96+e*(1/360+e*(81/512+e*(-96199/604800)))))-.5),this.gtu[0]=e*(.5+e*(-2/3+e*(5/16+e*(41/180+e*(-127/288+e*(7891/37800)))))),this.utg[1]=r*(-1/48+e*(-1/15+e*(437/1440+e*(-46/105+e*(1118711/3870720))))),this.gtu[1]=r*(13/48+e*(e*(557/1440+e*(281/630+e*(-1983433/1935360)))-.6)),this.utg[2]=(r*=e)*(-17/480+e*(37/840+e*(209/4480+e*(-5569/90720)))),this.gtu[2]=r*(61/240+e*(-103/140+e*(15061/26880+e*(167603/181440)))),this.utg[3]=(r*=e)*(-4397/161280+e*(11/504+e*(830251/7257600))),this.gtu[3]=r*(49561/161280+e*(-179/168+e*(6601661/7257600))),this.utg[4]=(r*=e)*(-4583/161280+e*(108847/3991680)),this.gtu[4]=r*(34729/80640+e*(-3418889/1995840)),this.utg[5]=(r*=e)*(-20648693/638668800),this.gtu[5]=.6650675310896665*r;var i=be(this.cbg,this.lat0);this.Zb=-this.Qn*(i+function(t,e){for(var r,i=2*Math.cos(e),n=t.length-1,a=t[n],s=0;--n>=0;)r=i*a-s+t[n],s=a,a=r;return Math.sin(e)*r}(this.gtu,2*i));},forward:function(t){var e=bt(t.x-this.long0),r=t.y;r=be(this.cbg,r);var i=Math.sin(r),n=Math.cos(r),a=Math.sin(e),s=Math.cos(e);r=Math.atan2(i,s*n),e=Math.atan2(a*n,xe(i,n*s)),e=function(t){var e=Math.abs(t);return e=function(t){var e=1+t,r=e-1;return 0===r?t:t*Math.log(e)/r}(e*(1+e/(xe(1,e)+1))),t<0?-e:e}(Math.tan(e));var o,u,h=_e(this.gtu,2*r,2*e);return r+=h[0],e+=h[1],Math.abs(e)<=2.623395162778?(o=this.a*(this.Qn*e)+this.x0,u=this.a*(this.Qn*r+this.Zb)+this.y0):(o=1/0,u=1/0),t.x=o,t.y=u,t},inverse:function(t){var e,r,i=1/this.a*(t.x-this.x0),n=1/this.a*(t.y-this.y0);if(n=(n-this.Zb)/this.Qn,i/=this.Qn,Math.abs(i)<=2.623395162778){var a=_e(this.utg,2*n,2*i);n+=a[0],i+=a[1],i=Math.atan(ge(i));var s=Math.sin(n),o=Math.cos(n),u=Math.sin(i),h=Math.cos(i);n=Math.atan2(s*h,xe(u,h*o)),e=bt((i=Math.atan2(u,h*o))+this.long0),r=be(this.cgb,n);}else e=1/0,r=1/0;return t.x=e,t.y=r,t},names:["Extended_Transverse_Mercator","Extended Transverse Mercator","etmerc","Transverse_Mercator","Transverse Mercator","tmerc"]},Me={init:function(){var t=function(t,e){if(void 0===t){if((t=Math.floor(30*(bt(e)+Math.PI)/Math.PI)+1)<0)return 0;if(t>60)return 60}return t}(this.zone,this.long0);if(void 0===t)throw new Error("unknown utm zone");this.lat0=0,this.long0=(6*Math.abs(t)-183)*H,this.x0=5e5,this.y0=this.utmSouth?1e7:0,this.k0=.9996,we.init.apply(this),this.forward=we.forward,this.inverse=we.inverse;},names:["Universal Transverse Mercator System","utm"],dependsOn:"etmerc"};function Se(t,e){return Math.pow((1-t)/(1+t),e)}var Ae={init:function(){var t=Math.sin(this.lat0),e=Math.cos(this.lat0);e*=e,this.rc=Math.sqrt(1-this.es)/(1-this.es*t*t),this.C=Math.sqrt(1+this.es*e*e/(1-this.es)),this.phic0=Math.asin(t/this.C),this.ratexp=.5*this.C*this.e,this.K=Math.tan(.5*this.phic0+Z)/(Math.pow(Math.tan(.5*this.lat0+Z),this.C)*Se(this.e*t,this.ratexp));},forward:function(t){var e=t.x,r=t.y;return t.y=2*Math.atan(this.K*Math.pow(Math.tan(.5*r+Z),this.C)*Se(this.e*Math.sin(r),this.ratexp))-X,t.x=this.C*e,t},inverse:function(t){for(var e=t.x/this.C,r=t.y,i=Math.pow(Math.tan(.5*r+Z)/this.K,1/this.C),n=20;n>0&&(r=2*Math.atan(i*Se(this.e*Math.sin(t.y),-.5*this.e))-X,!(Math.abs(r-t.y)<1e-14));--n)t.y=r;return n?(t.x=e,t.y=r,t):null},names:["gauss"]},ke={init:function(){Ae.init.apply(this),this.rc&&(this.sinc0=Math.sin(this.phic0),this.cosc0=Math.cos(this.phic0),this.R2=2*this.rc,this.title||(this.title="Oblique Stereographic Alternative"));},forward:function(t){var e,r,i,n;return t.x=bt(t.x-this.long0),Ae.forward.apply(this,[t]),e=Math.sin(t.y),r=Math.cos(t.y),i=Math.cos(t.x),t.x=(n=this.k0*this.R2/(1+this.sinc0*e+this.cosc0*r*i))*r*Math.sin(t.x),t.y=n*(this.cosc0*e-this.sinc0*r*i),t.x=this.a*t.x+this.x0,t.y=this.a*t.y+this.y0,t},inverse:function(t){var e,r,i,n,a;if(t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,t.x/=this.k0,t.y/=this.k0,a=Math.sqrt(t.x*t.x+t.y*t.y)){var s=2*Math.atan2(a,this.R2);e=Math.sin(s),r=Math.cos(s),n=Math.asin(r*this.sinc0+t.y*e*this.cosc0/a),i=Math.atan2(t.x*e,a*this.cosc0*r-t.y*this.sinc0*e);}else n=this.phic0,i=0;return t.x=i,t.y=n,Ae.inverse.apply(this,[t]),t.x=bt(t.x+this.long0),t},names:["Stereographic_North_Pole","Oblique_Stereographic","Polar_Stereographic","sterea","Oblique Stereographic Alternative","Double_Stereographic"]},Ie={init:function(){this.coslat0=Math.cos(this.lat0),this.sinlat0=Math.sin(this.lat0),this.sphere?1===this.k0&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=1e-10&&(this.k0=.5*(1+xt(this.lat0)*Math.sin(this.lat_ts))):(Math.abs(this.coslat0)<=1e-10&&(this.con=this.lat0>0?1:-1),this.cons=Math.sqrt(Math.pow(1+this.e,1+this.e)*Math.pow(1-this.e,1-this.e)),1===this.k0&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=1e-10&&(this.k0=.5*this.cons*gt(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts))/_t(this.e,this.con*this.lat_ts,this.con*Math.sin(this.lat_ts))),this.ms1=gt(this.e,this.sinlat0,this.coslat0),this.X0=2*Math.atan(this.ssfn_(this.lat0,this.sinlat0,this.e))-X,this.cosX0=Math.cos(this.X0),this.sinX0=Math.sin(this.X0));},forward:function(t){var e,r,i,n,a,s,o=t.x,u=t.y,h=Math.sin(u),l=Math.cos(u),p=bt(o-this.long0);return Math.abs(Math.abs(o-this.long0)-Math.PI)<=1e-10&&Math.abs(u+this.lat0)<=1e-10?(t.x=NaN,t.y=NaN,t):this.sphere?(e=2*this.k0/(1+this.sinlat0*h+this.coslat0*l*Math.cos(p)),t.x=this.a*e*l*Math.sin(p)+this.x0,t.y=this.a*e*(this.coslat0*h-this.sinlat0*l*Math.cos(p))+this.y0,t):(r=2*Math.atan(this.ssfn_(u,h,this.e))-X,n=Math.cos(r),i=Math.sin(r),Math.abs(this.coslat0)<=1e-10?(a=_t(this.e,u*this.con,this.con*h),t.x=this.x0+(s=2*this.a*this.k0*a/this.cons)*Math.sin(o-this.long0),t.y=this.y0-this.con*s*Math.cos(o-this.long0),t):(Math.abs(this.sinlat0)<1e-10?(e=2*this.a*this.k0/(1+n*Math.cos(p)),t.y=e*i):(e=2*this.a*this.k0*this.ms1/(this.cosX0*(1+this.sinX0*i+this.cosX0*n*Math.cos(p))),t.y=e*(this.cosX0*i-this.sinX0*n*Math.cos(p))+this.y0),t.x=e*n*Math.sin(p)+this.x0,t))},inverse:function(t){var e,r,i,n;t.x-=this.x0,t.y-=this.y0;var a=Math.sqrt(t.x*t.x+t.y*t.y);if(this.sphere){var s=2*Math.atan(a/(2*this.a*this.k0));return e=this.long0,r=this.lat0,a<=1e-10?(t.x=e,t.y=r,t):(r=Math.asin(Math.cos(s)*this.sinlat0+t.y*Math.sin(s)*this.coslat0/a),e=Math.abs(this.coslat0)<1e-10?bt(this.lat0>0?this.long0+Math.atan2(t.x,-1*t.y):this.long0+Math.atan2(t.x,t.y)):bt(this.long0+Math.atan2(t.x*Math.sin(s),a*this.coslat0*Math.cos(s)-t.y*this.sinlat0*Math.sin(s))),t.x=e,t.y=r,t)}if(Math.abs(this.coslat0)<=1e-10){if(a<=1e-10)return r=this.lat0,t.x=e=this.long0,t.y=r,t;t.x*=this.con,t.y*=this.con,r=this.con*wt(this.e,a*this.cons/(2*this.a*this.k0)),e=this.con*bt(this.con*this.long0+Math.atan2(t.x,-1*t.y));}else i=2*Math.atan(a*this.cosX0/(2*this.a*this.k0*this.ms1)),e=this.long0,a<=1e-10?n=this.X0:(n=Math.asin(Math.cos(i)*this.sinX0+t.y*Math.sin(i)*this.cosX0/a),e=bt(this.long0+Math.atan2(t.x*Math.sin(i),a*this.cosX0*Math.cos(i)-t.y*this.sinX0*Math.sin(i)))),r=-1*wt(this.e,Math.tan(.5*(X+n)));return t.x=e,t.y=r,t},names:["stere","Stereographic_South_Pole","Polar Stereographic (variant B)"],ssfn_:function(t,e,r){return e*=r,Math.tan(.5*(X+t))*Math.pow((1-e)/(1+e),.5*r)}},ze={init:function(){var t=this.lat0;this.lambda0=this.long0;var e=Math.sin(t),r=this.a,i=1/this.rf,n=2*i-Math.pow(i,2),a=this.e=Math.sqrt(n);this.R=this.k0*r*Math.sqrt(1-n)/(1-n*Math.pow(e,2)),this.alpha=Math.sqrt(1+n/(1-n)*Math.pow(Math.cos(t),4)),this.b0=Math.asin(e/this.alpha);var s=Math.log(Math.tan(Math.PI/4+this.b0/2)),o=Math.log(Math.tan(Math.PI/4+t/2)),u=Math.log((1+a*e)/(1-a*e));this.K=s-this.alpha*o+this.alpha*a/2*u;},forward:function(t){var e=Math.log(Math.tan(Math.PI/4-t.y/2)),r=this.e/2*Math.log((1+this.e*Math.sin(t.y))/(1-this.e*Math.sin(t.y))),i=2*(Math.atan(Math.exp(-this.alpha*(e+r)+this.K))-Math.PI/4),n=this.alpha*(t.x-this.lambda0),a=Math.atan(Math.sin(n)/(Math.sin(this.b0)*Math.tan(i)+Math.cos(this.b0)*Math.cos(n))),s=Math.asin(Math.cos(this.b0)*Math.sin(i)-Math.sin(this.b0)*Math.cos(i)*Math.cos(n));return t.y=this.R/2*Math.log((1+Math.sin(s))/(1-Math.sin(s)))+this.y0,t.x=this.R*a+this.x0,t},inverse:function(t){for(var e=(t.x-this.x0)/this.R,r=2*(Math.atan(Math.exp((t.y-this.y0)/this.R))-Math.PI/4),i=Math.asin(Math.cos(this.b0)*Math.sin(r)+Math.sin(this.b0)*Math.cos(r)*Math.cos(e)),n=Math.atan(Math.sin(e)/(Math.cos(this.b0)*Math.cos(e)-Math.sin(this.b0)*Math.tan(r))),a=this.lambda0+n/this.alpha,s=0,o=i,u=-1e3,h=0;Math.abs(o-u)>1e-7;){if(++h>20)return;s=1/this.alpha*(Math.log(Math.tan(Math.PI/4+i/2))-this.K)+this.e*Math.log(Math.tan(Math.PI/4+Math.asin(this.e*Math.sin(o))/2)),u=o,o=2*Math.atan(Math.exp(s))-Math.PI/2;}return t.x=a,t.y=o,t},names:["somerc"]},Ce={init:function(){var t,e,r,i,n,a,s,o,u,h,l,p,c,f=0,y=0,d=0,m=0,v=0,g=0,x=0;this.no_off=(c="object"==typeof(p=this).PROJECTION?Object.keys(p.PROJECTION)[0]:p.PROJECTION,"no_uoff"in p||"no_off"in p||-1!==["Hotine_Oblique_Mercator","Hotine_Oblique_Mercator_Azimuth_Natural_Origin"].indexOf(c)),this.no_rot="no_rot"in this;var b=!1;"alpha"in this&&(b=!0);var _=!1;if("rectified_grid_angle"in this&&(_=!0),b&&(x=this.alpha),_&&(f=this.rectified_grid_angle*H),b||_)y=this.longc;else if(d=this.long1,v=this.lat1,m=this.long2,g=this.lat2,Math.abs(v-g)<=1e-7||(t=Math.abs(v))<=1e-7||Math.abs(t-X)<=1e-7||Math.abs(Math.abs(this.lat0)-X)<=1e-7||Math.abs(Math.abs(g)-X)<=1e-7)throw new Error;var w=1-this.es;e=Math.sqrt(w),Math.abs(this.lat0)>1e-10?(o=Math.sin(this.lat0),r=Math.cos(this.lat0),t=1-this.es*o*o,this.B=r*r,this.B=Math.sqrt(1+this.es*this.B*this.B/w),this.A=this.B*this.k0*e/t,(n=(i=this.B*e/(r*Math.sqrt(t)))*i-1)<=0?n=0:(n=Math.sqrt(n),this.lat0<0&&(n=-n)),this.E=n+=i,this.E*=Math.pow(_t(this.e,this.lat0,o),this.B)):(this.B=1/e,this.A=this.k0,this.E=i=n=1),b||_?(b?(l=Math.asin(Math.sin(x)/i),_||(f=x)):(l=f,x=Math.asin(i*Math.sin(l))),this.lam0=y-Math.asin(.5*(n-1/n)*Math.tan(l))/this.B):(a=Math.pow(_t(this.e,v,Math.sin(v)),this.B),s=Math.pow(_t(this.e,g,Math.sin(g)),this.B),n=this.E/a,u=(s-a)/(s+a),h=((h=this.E*this.E)-s*a)/(h+s*a),(t=d-m)<-Math.pi?m-=Y:t>Math.pi&&(m+=Y),this.lam0=bt(.5*(d+m)-Math.atan(h*Math.tan(.5*this.B*(d-m))/u)/this.B),l=Math.atan(2*Math.sin(this.B*bt(d-this.lam0))/(n-1/n)),f=x=Math.asin(i*Math.sin(l))),this.singam=Math.sin(l),this.cosgam=Math.cos(l),this.sinrot=Math.sin(f),this.cosrot=Math.cos(f),this.rB=1/this.B,this.ArB=this.A*this.rB,this.BrA=1/this.ArB,this.no_off?this.u_0=0:(this.u_0=Math.abs(this.ArB*Math.atan(Math.sqrt(i*i-1)/Math.cos(x))),this.lat0<0&&(this.u_0=-this.u_0)),n=.5*l,this.v_pole_n=this.ArB*Math.log(Math.tan(Z-n)),this.v_pole_s=this.ArB*Math.log(Math.tan(Z+n));},forward:function(t){var e,r,i,n,a,s,o,u,h={};if(t.x=t.x-this.lam0,Math.abs(Math.abs(t.y)-X)>1e-10){if(e=.5*((a=this.E/Math.pow(_t(this.e,t.y,Math.sin(t.y)),this.B))-(s=1/a)),r=.5*(a+s),n=Math.sin(this.B*t.x),i=(e*this.singam-n*this.cosgam)/r,Math.abs(Math.abs(i)-1)<1e-10)throw new Error;u=.5*this.ArB*Math.log((1-i)/(1+i)),s=Math.cos(this.B*t.x),o=Math.abs(s)<1e-7?this.A*t.x:this.ArB*Math.atan2(e*this.cosgam+n*this.singam,s);}else u=t.y>0?this.v_pole_n:this.v_pole_s,o=this.ArB*t.y;return this.no_rot?(h.x=o,h.y=u):(h.x=u*this.cosrot+(o-=this.u_0)*this.sinrot,h.y=o*this.cosrot-u*this.sinrot),h.x=this.a*h.x+this.x0,h.y=this.a*h.y+this.y0,h},inverse:function(t){var e,r,i,n,a,s,o,u={};if(t.x=1/this.a*(t.x-this.x0),t.y=1/this.a*(t.y-this.y0),this.no_rot?(r=t.y,e=t.x):(r=t.x*this.cosrot-t.y*this.sinrot,e=t.y*this.cosrot+t.x*this.sinrot+this.u_0),n=.5*((i=Math.exp(-this.BrA*r))-1/i),a=.5*(i+1/i),o=((s=Math.sin(this.BrA*e))*this.cosgam+n*this.singam)/a,Math.abs(Math.abs(o)-1)<1e-10)u.x=0,u.y=o<0?-X:X;else {if(u.y=this.E/Math.sqrt((1+o)/(1-o)),u.y=wt(this.e,Math.pow(u.y,1/this.B)),u.y===1/0)throw new Error;u.x=-this.rB*Math.atan2(n*this.cosgam-s*this.singam,Math.cos(this.BrA*e));}return u.x+=this.lam0,u},names:["Hotine_Oblique_Mercator","Hotine Oblique Mercator","Hotine_Oblique_Mercator_Azimuth_Natural_Origin","Hotine_Oblique_Mercator_Two_Point_Natural_Origin","Hotine_Oblique_Mercator_Azimuth_Center","Oblique_Mercator","omerc"]},Ee={init:function(){if(this.lat2||(this.lat2=this.lat1),this.k0||(this.k0=1),this.x0=this.x0||0,this.y0=this.y0||0,!(Math.abs(this.lat1+this.lat2)<1e-10)){var t=this.b/this.a;this.e=Math.sqrt(1-t*t);var e=Math.sin(this.lat1),r=Math.cos(this.lat1),i=gt(this.e,e,r),n=_t(this.e,this.lat1,e),a=Math.sin(this.lat2),s=Math.cos(this.lat2),o=gt(this.e,a,s),u=_t(this.e,this.lat2,a),h=_t(this.e,this.lat0,Math.sin(this.lat0));this.ns=Math.abs(this.lat1-this.lat2)>1e-10?Math.log(i/o)/Math.log(n/u):e,isNaN(this.ns)&&(this.ns=e),this.f0=i/(this.ns*Math.pow(n,this.ns)),this.rh=this.a*this.f0*Math.pow(h,this.ns),this.title||(this.title="Lambert Conformal Conic");}},forward:function(t){var e=t.x,r=t.y;Math.abs(2*Math.abs(r)-Math.PI)<=1e-10&&(r=xt(r)*(X-2e-10));var i,n,a=Math.abs(Math.abs(r)-X);if(a>1e-10)i=_t(this.e,r,Math.sin(r)),n=this.a*this.f0*Math.pow(i,this.ns);else {if((a=r*this.ns)<=0)return null;n=0;}var s=this.ns*bt(e-this.long0);return t.x=this.k0*(n*Math.sin(s))+this.x0,t.y=this.k0*(this.rh-n*Math.cos(s))+this.y0,t},inverse:function(t){var e,r,i,n,a,s=(t.x-this.x0)/this.k0,o=this.rh-(t.y-this.y0)/this.k0;this.ns>0?(e=Math.sqrt(s*s+o*o),r=1):(e=-Math.sqrt(s*s+o*o),r=-1);var u=0;if(0!==e&&(u=Math.atan2(r*s,r*o)),0!==e||this.ns>0){if(r=1/this.ns,i=Math.pow(e/(this.a*this.f0),r),-9999===(n=wt(this.e,i)))return null}else n=-X;return a=bt(u/this.ns+this.long0),t.x=a,t.y=n,t},names:["Lambert Tangential Conformal Conic Projection","Lambert_Conformal_Conic","Lambert_Conformal_Conic_1SP","Lambert_Conformal_Conic_2SP","lcc","Lambert Conic Conformal (1SP)","Lambert Conic Conformal (2SP)"]},Pe={init:function(){this.a=6377397.155,this.es=.006674372230614,this.e=Math.sqrt(this.es),this.lat0||(this.lat0=.863937979737193),this.long0||(this.long0=.4334234309119251),this.k0||(this.k0=.9999),this.s45=.785398163397448,this.s90=2*this.s45,this.fi0=this.lat0,this.e2=this.es,this.e=Math.sqrt(this.e2),this.alfa=Math.sqrt(1+this.e2*Math.pow(Math.cos(this.fi0),4)/(1-this.e2)),this.uq=1.04216856380474,this.u0=Math.asin(Math.sin(this.fi0)/this.alfa),this.g=Math.pow((1+this.e*Math.sin(this.fi0))/(1-this.e*Math.sin(this.fi0)),this.alfa*this.e/2),this.k=Math.tan(this.u0/2+this.s45)/Math.pow(Math.tan(this.fi0/2+this.s45),this.alfa)*this.g,this.k1=this.k0,this.n0=this.a*Math.sqrt(1-this.e2)/(1-this.e2*Math.pow(Math.sin(this.fi0),2)),this.s0=1.37008346281555,this.n=Math.sin(this.s0),this.ro0=this.k1*this.n0/Math.tan(this.s0),this.ad=this.s90-this.uq;},forward:function(t){var e,r,i,n,a,s,o,u=t.y,h=bt(t.x-this.long0);return e=Math.pow((1+this.e*Math.sin(u))/(1-this.e*Math.sin(u)),this.alfa*this.e/2),r=2*(Math.atan(this.k*Math.pow(Math.tan(u/2+this.s45),this.alfa)/e)-this.s45),i=-h*this.alfa,n=Math.asin(Math.cos(this.ad)*Math.sin(r)+Math.sin(this.ad)*Math.cos(r)*Math.cos(i)),a=Math.asin(Math.cos(r)*Math.sin(i)/Math.cos(n)),s=this.n*a,o=this.ro0*Math.pow(Math.tan(this.s0/2+this.s45),this.n)/Math.pow(Math.tan(n/2+this.s45),this.n),t.y=o*Math.cos(s)/1,t.x=o*Math.sin(s)/1,this.czech||(t.y*=-1,t.x*=-1),t},inverse:function(t){var e,r,i,n,a,s,o,u=t.x;t.x=t.y,t.y=u,this.czech||(t.y*=-1,t.x*=-1),a=Math.sqrt(t.x*t.x+t.y*t.y),n=Math.atan2(t.y,t.x)/Math.sin(this.s0),i=2*(Math.atan(Math.pow(this.ro0/a,1/this.n)*Math.tan(this.s0/2+this.s45))-this.s45),e=Math.asin(Math.cos(this.ad)*Math.sin(i)-Math.sin(this.ad)*Math.cos(i)*Math.cos(n)),r=Math.asin(Math.cos(i)*Math.sin(n)/Math.cos(e)),t.x=this.long0-r/this.alfa,s=e,o=0;var h=0;do{t.y=2*(Math.atan(Math.pow(this.k,-1/this.alfa)*Math.pow(Math.tan(e/2+this.s45),1/this.alfa)*Math.pow((1+this.e*Math.sin(s))/(1-this.e*Math.sin(s)),this.e/2))-this.s45),Math.abs(s-t.y)<1e-10&&(o=1),s=t.y,h+=1;}while(0===o&&h<15);return h>=15?null:t},names:["Krovak","krovak"]};function Be(t,e,r,i,n){return t*n-e*Math.sin(2*n)+r*Math.sin(4*n)-i*Math.sin(6*n)}function Te(t){return 1-.25*t*(1+t/16*(3+1.25*t))}function Ve(t){return .375*t*(1+.25*t*(1+.46875*t))}function Le(t){return .05859375*t*t*(1+.75*t)}function Fe(t){return t*t*t*(35/3072)}function Oe(t,e,r){var i=e*r;return t/Math.sqrt(1-i*i)}function De(t){return Math.abs(t)1e-7?(1-t*t)*(e/(1-(r=t*e)*r)-.5/t*Math.log((1-r)/(1+r))):2*e}var je={init:function(){var t,e=Math.abs(this.lat0);if(this.mode=Math.abs(e-X)<1e-10?this.lat0<0?this.S_POLE:this.N_POLE:Math.abs(e)<1e-10?this.EQUIT:this.OBLIQ,this.es>0)switch(this.qp=qe(this.e,1),this.mmf=.5/(1-this.es),this.apa=function(t){var e,r=[];return r[0]=.3333333333333333*t,r[0]+=.17222222222222222*(e=t*t),r[1]=.06388888888888888*e,r[0]+=.10257936507936508*(e*=t),r[1]+=.0664021164021164*e,r[2]=.016415012942191543*e,r}(this.es),this.mode){case this.N_POLE:case this.S_POLE:this.dd=1;break;case this.EQUIT:this.rq=Math.sqrt(.5*this.qp),this.dd=1/this.rq,this.xmf=1,this.ymf=.5*this.qp;break;case this.OBLIQ:this.rq=Math.sqrt(.5*this.qp),t=Math.sin(this.lat0),this.sinb1=qe(this.e,t)/this.qp,this.cosb1=Math.sqrt(1-this.sinb1*this.sinb1),this.dd=Math.cos(this.lat0)/(Math.sqrt(1-this.es*t*t)*this.rq*this.cosb1),this.ymf=(this.xmf=this.rq)/this.dd,this.xmf*=this.dd;}else this.mode===this.OBLIQ&&(this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0));},forward:function(t){var e,r,i,n,a,s,o,u,h,l,p=t.x,c=t.y;if(p=bt(p-this.long0),this.sphere){if(a=Math.sin(c),l=Math.cos(c),i=Math.cos(p),this.mode===this.OBLIQ||this.mode===this.EQUIT){if((r=this.mode===this.EQUIT?1+l*i:1+this.sinph0*a+this.cosph0*l*i)<=1e-10)return null;e=(r=Math.sqrt(2/r))*l*Math.sin(p),r*=this.mode===this.EQUIT?a:this.cosph0*a-this.sinph0*l*i;}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(i=-i),Math.abs(c+this.lat0)<1e-10)return null;r=Z-.5*c,e=(r=2*(this.mode===this.S_POLE?Math.cos(r):Math.sin(r)))*Math.sin(p),r*=i;}}else {switch(o=0,u=0,h=0,i=Math.cos(p),n=Math.sin(p),a=Math.sin(c),s=qe(this.e,a),this.mode!==this.OBLIQ&&this.mode!==this.EQUIT||(o=s/this.qp,u=Math.sqrt(1-o*o)),this.mode){case this.OBLIQ:h=1+this.sinb1*o+this.cosb1*u*i;break;case this.EQUIT:h=1+u*i;break;case this.N_POLE:h=X+c,s=this.qp-s;break;case this.S_POLE:h=c-X,s=this.qp+s;}if(Math.abs(h)<1e-10)return null;switch(this.mode){case this.OBLIQ:case this.EQUIT:h=Math.sqrt(2/h),r=this.mode===this.OBLIQ?this.ymf*h*(this.cosb1*o-this.sinb1*u*i):(h=Math.sqrt(2/(1+u*i)))*o*this.ymf,e=this.xmf*h*u*n;break;case this.N_POLE:case this.S_POLE:s>=0?(e=(h=Math.sqrt(s))*n,r=i*(this.mode===this.S_POLE?h:-h)):e=r=0;}}return t.x=this.a*e+this.x0,t.y=this.a*r+this.y0,t},inverse:function(t){t.x-=this.x0,t.y-=this.y0;var e,r,i,n,a,s,o,u,h,l,p=t.x/this.a,c=t.y/this.a;if(this.sphere){var f,y=0,d=0;if((r=.5*(f=Math.sqrt(p*p+c*c)))>1)return null;switch(r=2*Math.asin(r),this.mode!==this.OBLIQ&&this.mode!==this.EQUIT||(d=Math.sin(r),y=Math.cos(r)),this.mode){case this.EQUIT:r=Math.abs(f)<=1e-10?0:Math.asin(c*d/f),p*=d,c=y*f;break;case this.OBLIQ:r=Math.abs(f)<=1e-10?this.lat0:Math.asin(y*this.sinph0+c*d*this.cosph0/f),p*=d*this.cosph0,c=(y-Math.sin(r)*this.sinph0)*f;break;case this.N_POLE:c=-c,r=X-r;break;case this.S_POLE:r-=X;}e=0!==c||this.mode!==this.EQUIT&&this.mode!==this.OBLIQ?Math.atan2(p,c):0;}else {if(o=0,this.mode===this.OBLIQ||this.mode===this.EQUIT){if(p/=this.dd,c*=this.dd,(s=Math.sqrt(p*p+c*c))<1e-10)return t.x=this.long0,t.y=this.lat0,t;n=2*Math.asin(.5*s/this.rq),i=Math.cos(n),p*=n=Math.sin(n),this.mode===this.OBLIQ?(a=this.qp*(o=i*this.sinb1+c*n*this.cosb1/s),c=s*this.cosb1*i-c*this.sinb1*n):(a=this.qp*(o=c*n/s),c=s*i);}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(c=-c),!(a=p*p+c*c))return t.x=this.long0,t.y=this.lat0,t;o=1-a/this.qp,this.mode===this.S_POLE&&(o=-o);}e=Math.atan2(p,c),l=(u=Math.asin(o))+u,r=u+(h=this.apa)[0]*Math.sin(l)+h[1]*Math.sin(l+l)+h[2]*Math.sin(l+l+l);}return t.x=bt(this.long0+e),t.y=r,t},names:["Lambert Azimuthal Equal Area","Lambert_Azimuthal_Equal_Area","laea"],S_POLE:1,N_POLE:2,EQUIT:3,OBLIQ:4};function Ue(t){return Math.abs(t)>1&&(t=t>1?1:-1),Math.asin(t)}var Ge={init:function(){Math.abs(this.lat1+this.lat2)<1e-10||(this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e3=Math.sqrt(this.es),this.sin_po=Math.sin(this.lat1),this.cos_po=Math.cos(this.lat1),this.t1=this.sin_po,this.con=this.sin_po,this.ms1=gt(this.e3,this.sin_po,this.cos_po),this.qs1=qe(this.e3,this.sin_po),this.sin_po=Math.sin(this.lat2),this.cos_po=Math.cos(this.lat2),this.t2=this.sin_po,this.ms2=gt(this.e3,this.sin_po,this.cos_po),this.qs2=qe(this.e3,this.sin_po),this.sin_po=Math.sin(this.lat0),this.cos_po=Math.cos(this.lat0),this.t3=this.sin_po,this.qs0=qe(this.e3,this.sin_po),this.ns0=Math.abs(this.lat1-this.lat2)>1e-10?(this.ms1*this.ms1-this.ms2*this.ms2)/(this.qs2-this.qs1):this.con,this.c=this.ms1*this.ms1+this.ns0*this.qs1,this.rh=this.a*Math.sqrt(this.c-this.ns0*this.qs0)/this.ns0);},forward:function(t){var e=t.x,r=t.y;this.sin_phi=Math.sin(r),this.cos_phi=Math.cos(r);var i=qe(this.e3,this.sin_phi),n=this.a*Math.sqrt(this.c-this.ns0*i)/this.ns0,a=this.ns0*bt(e-this.long0),s=n*Math.sin(a)+this.x0,o=this.rh-n*Math.cos(a)+this.y0;return t.x=s,t.y=o,t},inverse:function(t){var e,r,i,n,a;return t.x-=this.x0,t.y=this.rh-t.y+this.y0,this.ns0>=0?(e=Math.sqrt(t.x*t.x+t.y*t.y),r=1):(e=-Math.sqrt(t.x*t.x+t.y*t.y),r=-1),i=0,0!==e&&(i=Math.atan2(r*t.x,r*t.y)),r=e*this.ns0/this.a,a=this.sphere?Math.asin((this.c-r*r)/(2*this.ns0)):this.phi1z(this.e3,(this.c-r*r)/this.ns0),n=bt(i/this.ns0+this.long0),t.x=n,t.y=a,t},names:["Albers_Conic_Equal_Area","Albers","aea"],phi1z:function(t,e){var r,i,n,a,s=Ue(.5*e);if(t<1e-10)return s;for(var o=t*t,u=1;u<=25;u++)if(s+=a=.5*(n=1-(i=t*(r=Math.sin(s)))*i)*n/Math.cos(s)*(e/(1-o)-r/n+.5/t*Math.log((1-i)/(1+i))),Math.abs(a)<=1e-7)return s;return null}},Ke={init:function(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0),this.infinity_dist=1e3*this.a,this.rc=1;},forward:function(t){var e,r,i,n,a,s,o,u=t.y;return i=bt(t.x-this.long0),e=Math.sin(u),r=Math.cos(u),n=Math.cos(i),(a=this.sin_p14*e+this.cos_p14*r*n)>0||Math.abs(a)<=1e-10?(s=this.x0+1*this.a*r*Math.sin(i)/a,o=this.y0+1*this.a*(this.cos_p14*e-this.sin_p14*r*n)/a):(s=this.x0+this.infinity_dist*r*Math.sin(i),o=this.y0+this.infinity_dist*(this.cos_p14*e-this.sin_p14*r*n)),t.x=s,t.y=o,t},inverse:function(t){var e,r,i,n,a,s;return t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,t.x/=this.k0,t.y/=this.k0,(e=Math.sqrt(t.x*t.x+t.y*t.y))?(n=Math.atan2(e,this.rc),r=Math.sin(n),s=Ue((i=Math.cos(n))*this.sin_p14+t.y*r*this.cos_p14/e),a=Math.atan2(t.x*r,e*this.cos_p14*i-t.y*this.sin_p14*r),a=bt(this.long0+a)):(s=this.phic0,a=0),t.x=a,t.y=s,t},names:["gnom"]},Xe={init:function(){this.sphere||(this.k0=gt(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)));},forward:function(t){var e,r,i=t.y,n=bt(t.x-this.long0);if(this.sphere)e=this.x0+this.a*n*Math.cos(this.lat_ts),r=this.y0+this.a*Math.sin(i)/Math.cos(this.lat_ts);else {var a=qe(this.e,Math.sin(i));e=this.x0+this.a*this.k0*n,r=this.y0+this.a*a*.5/this.k0;}return t.x=e,t.y=r,t},inverse:function(t){var e,r;return t.x-=this.x0,t.y-=this.y0,this.sphere?(e=bt(this.long0+t.x/this.a/Math.cos(this.lat_ts)),r=Math.asin(t.y/this.a*Math.cos(this.lat_ts))):(r=function(t,e){var r=1-(1-t*t)/(2*t)*Math.log((1-t)/(1+t));if(Math.abs(Math.abs(e)-r)<1e-6)return e<0?-1*X:X;for(var i,n,a,s,o=Math.asin(.5*e),u=0;u<30;u++)if(n=Math.sin(o),a=Math.cos(o),s=t*n,o+=i=Math.pow(1-s*s,2)/(2*a)*(e/(1-t*t)-n/(1-s*s)+.5/t*Math.log((1-s)/(1+s))),Math.abs(i)<=1e-10)return o;return NaN}(this.e,2*t.y*this.k0/this.a),e=bt(this.long0+t.x/(this.a*this.k0))),t.x=e,t.y=r,t},names:["cea"]},He={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Equidistant Cylindrical (Plate Carre)",this.rc=Math.cos(this.lat_ts);},forward:function(t){var e=t.y,r=bt(t.x-this.long0),i=De(e-this.lat0);return t.x=this.x0+this.a*r*this.rc,t.y=this.y0+this.a*i,t},inverse:function(t){var e=t.y;return t.x=bt(this.long0+(t.x-this.x0)/(this.a*this.rc)),t.y=De(this.lat0+(e-this.y0)/this.a),t},names:["Equirectangular","Equidistant_Cylindrical","eqc"]},Je={init:function(){this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=Te(this.es),this.e1=Ve(this.es),this.e2=Le(this.es),this.e3=Fe(this.es),this.ml0=this.a*Be(this.e0,this.e1,this.e2,this.e3,this.lat0);},forward:function(t){var e,r,i,n=t.y,a=bt(t.x-this.long0);if(i=a*Math.sin(n),this.sphere)Math.abs(n)<=1e-10?(e=this.a*a,r=-1*this.a*this.lat0):(e=this.a*Math.sin(i)/Math.tan(n),r=this.a*(De(n-this.lat0)+(1-Math.cos(i))/Math.tan(n)));else if(Math.abs(n)<=1e-10)e=this.a*a,r=-1*this.ml0;else {var s=Oe(this.a,this.e,Math.sin(n))/Math.tan(n);e=s*Math.sin(i),r=this.a*Be(this.e0,this.e1,this.e2,this.e3,n)-this.ml0+s*(1-Math.cos(i));}return t.x=e+this.x0,t.y=r+this.y0,t},inverse:function(t){var e,r,i,n,a,s,o,u,h;if(i=t.x-this.x0,n=t.y-this.y0,this.sphere)if(Math.abs(n+this.a*this.lat0)<=1e-10)e=bt(i/this.a+this.long0),r=0;else {var l;for(o=i*i/this.a/this.a+(s=this.lat0+n/this.a)*s,u=s,a=20;a;--a)if(u+=h=-1*(s*(u*(l=Math.tan(u))+1)-u-.5*(u*u+o)*l)/((u-s)/l-1),Math.abs(h)<=1e-10){r=u;break}e=bt(this.long0+Math.asin(i*Math.tan(u)/this.a)/Math.sin(r));}else if(Math.abs(n+this.ml0)<=1e-10)r=0,e=bt(this.long0+i/this.a);else {var p,c,f,y,d;for(o=i*i/this.a/this.a+(s=(this.ml0+n)/this.a)*s,u=s,a=20;a;--a)if(d=this.e*Math.sin(u),p=Math.sqrt(1-d*d)*Math.tan(u),c=this.a*Be(this.e0,this.e1,this.e2,this.e3,u),f=this.e0-2*this.e1*Math.cos(2*u)+4*this.e2*Math.cos(4*u)-6*this.e3*Math.cos(6*u),u-=h=(s*(p*(y=c/this.a)+1)-y-.5*p*(y*y+o))/(this.es*Math.sin(2*u)*(y*y+o-2*s*y)/(4*p)+(s-y)*(p*f-2/Math.sin(2*u))-f),Math.abs(h)<=1e-10){r=u;break}p=Math.sqrt(1-this.es*Math.pow(Math.sin(r),2))*Math.tan(r),e=bt(this.long0+Math.asin(i*p/this.a)/Math.sin(r));}return t.x=e,t.y=r,t},names:["Polyconic","poly"]},Ze={init:function(){this.A=[],this.A[1]=.6399175073,this.A[2]=-.1358797613,this.A[3]=.063294409,this.A[4]=-.02526853,this.A[5]=.0117879,this.A[6]=-.0055161,this.A[7]=.0026906,this.A[8]=-.001333,this.A[9]=67e-5,this.A[10]=-34e-5,this.B_re=[],this.B_im=[],this.B_re[1]=.7557853228,this.B_im[1]=0,this.B_re[2]=.249204646,this.B_im[2]=.003371507,this.B_re[3]=-.001541739,this.B_im[3]=.04105856,this.B_re[4]=-.10162907,this.B_im[4]=.01727609,this.B_re[5]=-.26623489,this.B_im[5]=-.36249218,this.B_re[6]=-.6870983,this.B_im[6]=-1.1651967,this.C_re=[],this.C_im=[],this.C_re[1]=1.3231270439,this.C_im[1]=0,this.C_re[2]=-.577245789,this.C_im[2]=-.007809598,this.C_re[3]=.508307513,this.C_im[3]=-.112208952,this.C_re[4]=-.15094762,this.C_im[4]=.18200602,this.C_re[5]=1.01418179,this.C_im[5]=1.64497696,this.C_re[6]=1.9660549,this.C_im[6]=2.5127645,this.D=[],this.D[1]=1.5627014243,this.D[2]=.5185406398,this.D[3]=-.03333098,this.D[4]=-.1052906,this.D[5]=-.0368594,this.D[6]=.007317,this.D[7]=.0122,this.D[8]=.00394,this.D[9]=-.0013;},forward:function(t){var e,r=(t.y-this.lat0)/K*1e-5,i=t.x-this.long0,n=1,a=0;for(e=1;e<=10;e++)a+=this.A[e]*(n*=r);var s,o=a,u=i,h=1,l=0,p=0,c=0;for(e=1;e<=6;e++)s=l*o+h*u,p=p+this.B_re[e]*(h=h*o-l*u)-this.B_im[e]*(l=s),c=c+this.B_im[e]*h+this.B_re[e]*l;return t.x=c*this.a+this.x0,t.y=p*this.a+this.y0,t},inverse:function(t){var e,r,i=(t.y-this.y0)/this.a,n=(t.x-this.x0)/this.a,a=1,s=0,o=0,u=0;for(e=1;e<=6;e++)r=s*i+a*n,o=o+this.C_re[e]*(a=a*i-s*n)-this.C_im[e]*(s=r),u=u+this.C_im[e]*a+this.C_re[e]*s;for(var h=0;h.999999999999&&(r=.999999999999),e=Math.asin(r);var i=bt(this.long0+t.x/(.900316316158*this.a*Math.cos(e)));i<-Math.PI&&(i=-Math.PI),i>Math.PI&&(i=Math.PI),r=(2*e+Math.sin(2*e))/Math.PI,Math.abs(r)>1&&(r=1);var n=Math.asin(r);return t.x=i,t.y=n,t},names:["Mollweide","moll"]},$e={init:function(){Math.abs(this.lat1+this.lat2)<1e-10||(this.lat2=this.lat2||this.lat1,this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=Te(this.es),this.e1=Ve(this.es),this.e2=Le(this.es),this.e3=Fe(this.es),this.sinphi=Math.sin(this.lat1),this.cosphi=Math.cos(this.lat1),this.ms1=gt(this.e,this.sinphi,this.cosphi),this.ml1=Be(this.e0,this.e1,this.e2,this.e3,this.lat1),Math.abs(this.lat1-this.lat2)<1e-10?this.ns=this.sinphi:(this.sinphi=Math.sin(this.lat2),this.cosphi=Math.cos(this.lat2),this.ms2=gt(this.e,this.sinphi,this.cosphi),this.ml2=Be(this.e0,this.e1,this.e2,this.e3,this.lat2),this.ns=(this.ms1-this.ms2)/(this.ml2-this.ml1)),this.g=this.ml1+this.ms1/this.ns,this.ml0=Be(this.e0,this.e1,this.e2,this.e3,this.lat0),this.rh=this.a*(this.g-this.ml0));},forward:function(t){var e,r=t.x,i=t.y;if(this.sphere)e=this.a*(this.g-i);else {var n=Be(this.e0,this.e1,this.e2,this.e3,i);e=this.a*(this.g-n);}var a=this.ns*bt(r-this.long0),s=this.x0+e*Math.sin(a),o=this.y0+this.rh-e*Math.cos(a);return t.x=s,t.y=o,t},inverse:function(t){var e,r,i,n;t.x-=this.x0,t.y=this.rh-t.y+this.y0,this.ns>=0?(r=Math.sqrt(t.x*t.x+t.y*t.y),e=1):(r=-Math.sqrt(t.x*t.x+t.y*t.y),e=-1);var a=0;return 0!==r&&(a=Math.atan2(e*t.x,e*t.y)),this.sphere?(n=bt(this.long0+a/this.ns),i=De(this.g-r/this.a),t.x=n,t.y=i,t):(i=Ne(this.g-r/this.a,this.e0,this.e1,this.e2,this.e3),n=bt(this.long0+a/this.ns),t.x=n,t.y=i,t)},names:["Equidistant_Conic","eqdc"]},tr={init:function(){this.R=this.a;},forward:function(t){var e,r,i=t.y,n=bt(t.x-this.long0);Math.abs(i)<=1e-10&&(e=this.x0+this.R*n,r=this.y0);var a=Ue(2*Math.abs(i/Math.PI));(Math.abs(n)<=1e-10||Math.abs(Math.abs(i)-X)<=1e-10)&&(e=this.x0,r=i>=0?this.y0+Math.PI*this.R*Math.tan(.5*a):this.y0+Math.PI*this.R*-Math.tan(.5*a));var s=.5*Math.abs(Math.PI/n-n/Math.PI),o=s*s,u=Math.sin(a),h=Math.cos(a),l=h/(u+h-1),p=l*(2/u-1),c=p*p,f=Math.PI*this.R*(s*(l-c)+Math.sqrt(o*(l-c)*(l-c)-(c+o)*(l*l-c)))/(c+o);n<0&&(f=-f),e=this.x0+f;var y=o+l;return f=Math.PI*this.R*(p*y-s*Math.sqrt((c+o)*(o+1)-y*y))/(c+o),r=i>=0?this.y0+f:this.y0-f,t.x=e,t.y=r,t},inverse:function(t){var e,r,i,n,a,s,o,u,h,l,p,c;return t.x-=this.x0,t.y-=this.y0,p=Math.PI*this.R,a=(i=t.x/p)*i+(n=t.y/p)*n,p=3*(n*n/(u=-2*(s=-Math.abs(n)*(1+a))+1+2*n*n+a*a)+(2*(o=s-2*n*n+i*i)*o*o/u/u/u-9*s*o/u/u)/27)/(h=(s-o*o/3/u)/u)/(l=2*Math.sqrt(-h/3)),Math.abs(p)>1&&(p=p>=0?1:-1),c=Math.acos(p)/3,r=t.y>=0?(-l*Math.cos(c+Math.PI/3)-o/3/u)*Math.PI:-(-l*Math.cos(c+Math.PI/3)-o/3/u)*Math.PI,e=Math.abs(i)<1e-10?this.long0:bt(this.long0+Math.PI*(a-1+Math.sqrt(1+2*(i*i-n*n)+a*a))/2/i),t.x=e,t.y=r,t},names:["Van_der_Grinten_I","VanDerGrinten","vandg"]},er={init:function(){this.sin_p12=Math.sin(this.lat0),this.cos_p12=Math.cos(this.lat0);},forward:function(t){var e,r,i,n,a,s,o,u,h,l,p,c,f,y,d,m,v,g,x,b,_,w,M=t.x,S=t.y,A=Math.sin(t.y),k=Math.cos(t.y),I=bt(M-this.long0);return this.sphere?Math.abs(this.sin_p12-1)<=1e-10?(t.x=this.x0+this.a*(X-S)*Math.sin(I),t.y=this.y0-this.a*(X-S)*Math.cos(I),t):Math.abs(this.sin_p12+1)<=1e-10?(t.x=this.x0+this.a*(X+S)*Math.sin(I),t.y=this.y0+this.a*(X+S)*Math.cos(I),t):(g=this.sin_p12*A+this.cos_p12*k*Math.cos(I),v=(m=Math.acos(g))?m/Math.sin(m):1,t.x=this.x0+this.a*v*k*Math.sin(I),t.y=this.y0+this.a*v*(this.cos_p12*A-this.sin_p12*k*Math.cos(I)),t):(e=Te(this.es),r=Ve(this.es),i=Le(this.es),n=Fe(this.es),Math.abs(this.sin_p12-1)<=1e-10?(a=this.a*Be(e,r,i,n,X),s=this.a*Be(e,r,i,n,S),t.x=this.x0+(a-s)*Math.sin(I),t.y=this.y0-(a-s)*Math.cos(I),t):Math.abs(this.sin_p12+1)<=1e-10?(a=this.a*Be(e,r,i,n,X),s=this.a*Be(e,r,i,n,S),t.x=this.x0+(a+s)*Math.sin(I),t.y=this.y0+(a+s)*Math.cos(I),t):(o=A/k,u=Oe(this.a,this.e,this.sin_p12),h=Oe(this.a,this.e,A),l=Math.atan((1-this.es)*o+this.es*u*this.sin_p12/(h*k)),x=0===(p=Math.atan2(Math.sin(I),this.cos_p12*Math.tan(l)-this.sin_p12*Math.cos(I)))?Math.asin(this.cos_p12*Math.sin(l)-this.sin_p12*Math.cos(l)):Math.abs(Math.abs(p)-Math.PI)<=1e-10?-Math.asin(this.cos_p12*Math.sin(l)-this.sin_p12*Math.cos(l)):Math.asin(Math.sin(I)*Math.cos(l)/Math.sin(p)),c=this.e*this.sin_p12/Math.sqrt(1-this.es),f=this.e*this.cos_p12*Math.cos(p)/Math.sqrt(1-this.es),t.x=this.x0+(m=u*x*(1-(b=x*x)*(d=f*f)*(1-d)/6+(_=b*x)/8*(y=c*f)*(1-2*d)+(w=_*x)/120*(d*(4-7*d)-3*c*c*(1-7*d))-w*x/48*y))*Math.sin(p),t.y=this.y0+m*Math.cos(p),t))},inverse:function(t){var e,r,i,n,a,s,o,u,h,l,p,c,f,y,d,m,v,g,x,b,_,w,M;if(t.x-=this.x0,t.y-=this.y0,this.sphere){if((e=Math.sqrt(t.x*t.x+t.y*t.y))>2*X*this.a)return;return r=e/this.a,i=Math.sin(r),n=Math.cos(r),a=this.long0,Math.abs(e)<=1e-10?s=this.lat0:(s=Ue(n*this.sin_p12+t.y*i*this.cos_p12/e),o=Math.abs(this.lat0)-X,a=Math.abs(o)<=1e-10?bt(this.lat0>=0?this.long0+Math.atan2(t.x,-t.y):this.long0-Math.atan2(-t.x,t.y)):bt(this.long0+Math.atan2(t.x*i,e*this.cos_p12*n-t.y*this.sin_p12*i))),t.x=a,t.y=s,t}return u=Te(this.es),h=Ve(this.es),l=Le(this.es),p=Fe(this.es),Math.abs(this.sin_p12-1)<=1e-10?(s=Ne(((c=this.a*Be(u,h,l,p,X))-(e=Math.sqrt(t.x*t.x+t.y*t.y)))/this.a,u,h,l,p),a=bt(this.long0+Math.atan2(t.x,-1*t.y)),t.x=a,t.y=s,t):Math.abs(this.sin_p12+1)<=1e-10?(c=this.a*Be(u,h,l,p,X),s=Ne(((e=Math.sqrt(t.x*t.x+t.y*t.y))-c)/this.a,u,h,l,p),a=bt(this.long0+Math.atan2(t.x,t.y)),t.x=a,t.y=s,t):(e=Math.sqrt(t.x*t.x+t.y*t.y),d=Math.atan2(t.x,t.y),f=Oe(this.a,this.e,this.sin_p12),m=Math.cos(d),x=3*this.es*(1-(g=-(v=this.e*this.cos_p12*m)*v/(1-this.es)))*this.sin_p12*this.cos_p12*m/(1-this.es),w=1-g*(_=(b=e/f)-g*(1+g)*Math.pow(b,3)/6-x*(1+3*g)*Math.pow(b,4)/24)*_/2-b*_*_*_/6,y=Math.asin(this.sin_p12*Math.cos(_)+this.cos_p12*Math.sin(_)*m),a=bt(this.long0+Math.asin(Math.sin(d)*Math.sin(_)/Math.cos(y))),M=Math.sin(y),s=Math.atan2((M-this.es*w*this.sin_p12)*Math.tan(y),M*(1-this.es)),t.x=a,t.y=s,t)},names:["Azimuthal_Equidistant","aeqd"]},rr={init:function(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0);},forward:function(t){var e,r,i,n,a,s,o,u=t.y;return i=bt(t.x-this.long0),e=Math.sin(u),r=Math.cos(u),n=Math.cos(i),((a=this.sin_p14*e+this.cos_p14*r*n)>0||Math.abs(a)<=1e-10)&&(s=1*this.a*r*Math.sin(i),o=this.y0+1*this.a*(this.cos_p14*e-this.sin_p14*r*n)),t.x=s,t.y=o,t},inverse:function(t){var e,r,i,n,a,s,o;return t.x-=this.x0,t.y-=this.y0,r=Ue((e=Math.sqrt(t.x*t.x+t.y*t.y))/this.a),i=Math.sin(r),n=Math.cos(r),s=this.long0,Math.abs(e)<=1e-10?(o=this.lat0,t.x=s,t.y=o,t):(o=Ue(n*this.sin_p14+t.y*i*this.cos_p14/e),a=Math.abs(this.lat0)-X,Math.abs(a)<=1e-10?(s=bt(this.lat0>=0?this.long0+Math.atan2(t.x,-t.y):this.long0-Math.atan2(-t.x,t.y)),t.x=s,t.y=o,t):(s=bt(this.long0+Math.atan2(t.x*i,e*this.cos_p14*n-t.y*this.sin_p14*i)),t.x=s,t.y=o,t))},names:["ortho"]};function ir(t,e,r,i){var n;return t<1e-10?(i.value=1,n=0):(n=Math.atan2(e,r),Math.abs(n)<=Z?i.value=1:n>Z&&n<=X+Z?(i.value=2,n-=X):n>X+Z||n<=-(X+Z)?(i.value=3,n=n>=0?n-W:n+W):(i.value=4,n+=X)),n}function nr(t,e){var r=t+e;return r<-W?r+=Y:r>+W&&(r-=Y),r}var ar={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Quadrilateralized Spherical Cube",this.face=this.lat0>=X-Z/2?5:this.lat0<=-(X-Z/2)?6:Math.abs(this.long0)<=Z?1:Math.abs(this.long0)<=X+Z?this.long0>0?2:4:3,0!==this.es&&(this.one_minus_f=1-(this.a-this.b)/this.a,this.one_minus_f_squared=this.one_minus_f*this.one_minus_f);},forward:function(t){var e,r,i,n,a,s,o={x:0,y:0},u={value:0};if(t.x-=this.long0,e=0!==this.es?Math.atan(this.one_minus_f_squared*Math.tan(t.y)):t.y,r=t.x,5===this.face)n=X-e,r>=Z&&r<=X+Z?(u.value=1,i=r-X):r>X+Z||r<=-(X+Z)?(u.value=2,i=r>0?r-W:r+W):r>-(X+Z)&&r<=-Z?(u.value=3,i=r+X):(u.value=4,i=r);else if(6===this.face)n=X+e,r>=Z&&r<=X+Z?(u.value=1,i=-r+X):r=-Z?(u.value=2,i=-r):r<-Z&&r>=-(X+Z)?(u.value=3,i=-r-X):(u.value=4,i=r>0?-r+W:-r-W);else {var h,l,p,c,f,y;2===this.face?r=nr(r,+X):3===this.face?r=nr(r,+W):4===this.face&&(r=nr(r,-X)),c=Math.sin(e),f=Math.cos(e),y=Math.sin(r),h=f*Math.cos(r),l=f*y,p=c,1===this.face?i=ir(n=Math.acos(h),p,l,u):2===this.face?i=ir(n=Math.acos(l),p,-h,u):3===this.face?i=ir(n=Math.acos(-h),p,-l,u):4===this.face?i=ir(n=Math.acos(-l),p,h,u):(n=i=0,u.value=1);}return s=Math.atan(12/W*(i+Math.acos(Math.sin(i)*Math.cos(Z))-X)),a=Math.sqrt((1-Math.cos(n))/(Math.cos(s)*Math.cos(s))/(1-Math.cos(Math.atan(1/Math.cos(i))))),2===u.value?s+=X:3===u.value?s+=W:4===u.value&&(s+=1.5*W),o.x=a*Math.cos(s),o.y=a*Math.sin(s),o.x=o.x*this.a+this.x0,o.y=o.y*this.a+this.y0,t.x=o.x,t.y=o.y,t},inverse:function(t){var e,r,i,n,a,s,o,u,h,l,p,c,f={lam:0,phi:0},y={value:0};if(t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,r=Math.atan(Math.sqrt(t.x*t.x+t.y*t.y)),e=Math.atan2(t.y,t.x),t.x>=0&&t.x>=Math.abs(t.y)?y.value=1:t.y>=0&&t.y>=Math.abs(t.x)?(y.value=2,e-=X):t.x<0&&-t.x>=Math.abs(t.y)?(y.value=3,e=e<0?e+W:e-W):(y.value=4,e+=X),h=W/12*Math.tan(e),a=Math.sin(h)/(Math.cos(h)-1/Math.sqrt(2)),s=Math.atan(a),(o=1-(i=Math.cos(e))*i*(n=Math.tan(r))*n*(1-Math.cos(Math.atan(1/Math.cos(s)))))<-1?o=-1:o>1&&(o=1),5===this.face)u=Math.acos(o),f.phi=X-u,f.lam=1===y.value?s+X:2===y.value?s<0?s+W:s-W:3===y.value?s-X:s;else if(6===this.face)u=Math.acos(o),f.phi=u-X,f.lam=1===y.value?-s+X:2===y.value?-s:3===y.value?-s-X:s<0?-s-W:-s+W;else {var d,m,v;h=(d=o)*d,m=(h+=(v=h>=1?0:Math.sqrt(1-h)*Math.sin(s))*v)>=1?0:Math.sqrt(1-h),2===y.value?(h=m,m=-v,v=h):3===y.value?(m=-m,v=-v):4===y.value&&(h=m,m=v,v=-h),2===this.face?(h=d,d=-m,m=h):3===this.face?(d=-d,m=-m):4===this.face&&(h=d,d=m,m=-h),f.phi=Math.acos(-v)-X,f.lam=Math.atan2(m,d),2===this.face?f.lam=nr(f.lam,-X):3===this.face?f.lam=nr(f.lam,-W):4===this.face&&(f.lam=nr(f.lam,+X));}return 0!==this.es&&(l=f.phi<0?1:0,p=Math.tan(f.phi),c=this.b/Math.sqrt(p*p+this.one_minus_f_squared),f.phi=Math.atan(Math.sqrt(this.a*this.a-c*c)/(this.one_minus_f*c)),l&&(f.phi=-f.phi)),f.lam+=this.long0,t.x=f.lam,t.y=f.phi,t},names:["Quadrilateralized Spherical Cube","Quadrilateralized_Spherical_Cube","qsc"]},sr=[[1,22199e-21,-715515e-10,31103e-10],[.9986,-482243e-9,-24897e-9,-13309e-10],[.9954,-83103e-8,-448605e-10,-9.86701e-7],[.99,-.00135364,-59661e-9,36777e-10],[.9822,-.00167442,-449547e-11,-572411e-11],[.973,-.00214868,-903571e-10,1.8736e-8],[.96,-.00305085,-900761e-10,164917e-11],[.9427,-.00382792,-653386e-10,-26154e-10],[.9216,-.00467746,-10457e-8,481243e-11],[.8962,-.00536223,-323831e-10,-543432e-11],[.8679,-.00609363,-113898e-9,332484e-11],[.835,-.00698325,-640253e-10,9.34959e-7],[.7986,-.00755338,-500009e-10,9.35324e-7],[.7597,-.00798324,-35971e-9,-227626e-11],[.7186,-.00851367,-701149e-10,-86303e-10],[.6732,-.00986209,-199569e-9,191974e-10],[.6213,-.010418,883923e-10,624051e-11],[.5722,-.00906601,182e-6,624051e-11],[.5322,-.00677797,275608e-9,624051e-11]],or=[[-520417e-23,.0124,121431e-23,-845284e-16],[.062,.0124,-1.26793e-9,4.22642e-10],[.124,.0124,5.07171e-9,-1.60604e-9],[.186,.0123999,-1.90189e-8,6.00152e-9],[.248,.0124002,7.10039e-8,-2.24e-8],[.31,.0123992,-2.64997e-7,8.35986e-8],[.372,.0124029,9.88983e-7,-3.11994e-7],[.434,.0123893,-369093e-11,-4.35621e-7],[.4958,.0123198,-102252e-10,-3.45523e-7],[.5571,.0121916,-154081e-10,-5.82288e-7],[.6176,.0119938,-241424e-10,-5.25327e-7],[.6769,.011713,-320223e-10,-5.16405e-7],[.7346,.0113541,-397684e-10,-6.09052e-7],[.7903,.0109107,-489042e-10,-104739e-11],[.8435,.0103431,-64615e-9,-1.40374e-9],[.8936,.00969686,-64636e-9,-8547e-9],[.9394,.00840947,-192841e-9,-42106e-10],[.9761,.00616527,-256e-6,-42106e-10],[1,.00328947,-319159e-9,-42106e-10]],ur=function(t,e){return t[0]+e*(t[1]+e*(t[2]+e*t[3]))},hr={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.long0=this.long0||0,this.es=0,this.title=this.title||"Robinson";},forward:function(t){var e=bt(t.x-this.long0),r=Math.abs(t.y),i=Math.floor(11.459155902616464*r);i<0?i=0:i>=18&&(i=17);var n={x:ur(sr[i],r=J*(r-.08726646259971647*i))*e,y:ur(or[i],r)};return t.y<0&&(n.y=-n.y),n.x=n.x*this.a*.8487+this.x0,n.y=n.y*this.a*1.3523+this.y0,n},inverse:function(t){var e={x:(t.x-this.x0)/(.8487*this.a),y:Math.abs(t.y-this.y0)/(1.3523*this.a)};if(e.y>=1)e.x/=sr[18][0],e.y=t.y<0?-X:X;else {var r=Math.floor(18*e.y);for(r<0?r=0:r>=18&&(r=17);;)if(or[r][0]>e.y)--r;else {if(!(or[r+1][0]<=e.y))break;++r;}var i=or[r],n=5*(e.y-i[0])/(or[r+1][0]-i[0]);n=function(t,e,r,i){for(var n=e;i;--i){var a=t(n);if(n-=a,Math.abs(a)<1e-10)break}return n}((function(t){return (ur(i,t)-e.y)/function(t,e){return t[1]+e*(2*t[2]+3*e*t[3])}(i,t)}),n,0,100),e.x/=ur(sr[r],n),e.y=(5*r+n)*H,t.y<0&&(e.y=-e.y);}return e.x=bt(e.x+this.long0),e},names:["Robinson","robin"]},lr={init:function(){this.name="geocent";},forward:function(t){return Rt(t,this.es,this.a)},inverse:function(t){return qt(t,this.es,this.a,this.b)},names:["Geocentric","geocentric","geocent","Geocent"]},pr={h:{def:1e5,num:!0},azi:{def:0,num:!0,degrees:!0},tilt:{def:0,num:!0,degrees:!0},long0:{def:0,num:!0},lat0:{def:0,num:!0}},cr={init:function(){if(Object.keys(pr).forEach(function(t){if(void 0===this[t])this[t]=pr[t].def;else {if(pr[t].num&&isNaN(this[t]))throw new Error("Invalid parameter value, must be numeric "+t+" = "+this[t]);pr[t].num&&(this[t]=parseFloat(this[t]));}pr[t].degrees&&(this[t]=this[t]*H);}.bind(this)),Math.abs(Math.abs(this.lat0)-X)<1e-10?this.mode=this.lat0<0?1:0:Math.abs(this.lat0)<1e-10?this.mode=2:(this.mode=3,this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0)),this.pn1=this.h/this.a,this.pn1<=0||this.pn1>1e10)throw new Error("Invalid height");this.p=1+this.pn1,this.rp=1/this.p,this.h1=1/this.pn1,this.pfact=(this.p+1)*this.h1,this.es=0;var t=this.tilt,e=this.azi;this.cg=Math.cos(e),this.sg=Math.sin(e),this.cw=Math.cos(t),this.sw=Math.sin(t);},forward:function(t){t.x-=this.long0;var e,r,i,n,a=Math.sin(t.y),s=Math.cos(t.y),o=Math.cos(t.x);switch(this.mode){case 3:r=this.sinph0*a+this.cosph0*s*o;break;case 2:r=s*o;break;case 1:r=-a;break;case 0:r=a;}switch(e=(r=this.pn1/(this.p-r))*s*Math.sin(t.x),this.mode){case 3:r*=this.cosph0*a-this.sinph0*s*o;break;case 2:r*=a;break;case 0:r*=-s*o;break;case 1:r*=s*o;}return e=(e*this.cg-r*this.sg)*this.cw*(n=1/((i=r*this.cg+e*this.sg)*this.sw*this.h1+this.cw)),r=i*n,t.x=e*this.a,t.y=r*this.a,t},inverse:function(t){t.x/=this.a,t.y/=this.a;var e,r,i,n={x:t.x,y:t.y};t.x=(e=this.pn1*t.x*(i=1/(this.pn1-t.y*this.sw)))*this.cg+(r=this.pn1*t.y*this.cw*i)*this.sg,t.y=r*this.cg-e*this.sg;var a=xe(t.x,t.y);if(Math.abs(a)<1e-10)n.x=0,n.y=t.y;else {var s,o;switch(o=1-a*a*this.pfact,o=(this.p-Math.sqrt(o))/(this.pn1/a+a/this.pn1),s=Math.sqrt(1-o*o),this.mode){case 3:n.y=Math.asin(s*this.sinph0+t.y*o*this.cosph0/a),t.y=(s-this.sinph0*Math.sin(n.y))*a,t.x*=o*this.cosph0;break;case 2:n.y=Math.asin(t.y*o/a),t.y=s*a,t.x*=o;break;case 0:n.y=Math.asin(s),t.y=-t.y;break;case 1:n.y=-Math.asin(s);}n.x=Math.atan2(t.x,t.y);}return t.x=n.x+this.long0,t.y=n.y,t},names:["Tilted_Perspective","tpers"]},fr={init:function(){if(this.flip_axis="x"===this.sweep?1:0,this.h=Number(this.h),this.radius_g_1=this.h/this.a,this.radius_g_1<=0||this.radius_g_1>1e10)throw new Error;if(this.radius_g=1+this.radius_g_1,this.C=this.radius_g*this.radius_g-1,0!==this.es){var t=1-this.es,e=1/t;this.radius_p=Math.sqrt(t),this.radius_p2=t,this.radius_p_inv2=e,this.shape="ellipse";}else this.radius_p=1,this.radius_p2=1,this.radius_p_inv2=1,this.shape="sphere";this.title||(this.title="Geostationary Satellite View");},forward:function(t){var e,r,i,n,a=t.x,s=t.y;if(a-=this.long0,"ellipse"===this.shape){s=Math.atan(this.radius_p2*Math.tan(s));var o=this.radius_p/xe(this.radius_p*Math.cos(s),Math.sin(s));if(r=o*Math.cos(a)*Math.cos(s),i=o*Math.sin(a)*Math.cos(s),n=o*Math.sin(s),(this.radius_g-r)*r-i*i-n*n*this.radius_p_inv2<0)return t.x=Number.NaN,t.y=Number.NaN,t;e=this.radius_g-r,this.flip_axis?(t.x=this.radius_g_1*Math.atan(i/xe(n,e)),t.y=this.radius_g_1*Math.atan(n/e)):(t.x=this.radius_g_1*Math.atan(i/e),t.y=this.radius_g_1*Math.atan(n/xe(i,e)));}else "sphere"===this.shape&&(e=Math.cos(s),r=Math.cos(a)*e,i=Math.sin(a)*e,n=Math.sin(s),e=this.radius_g-r,this.flip_axis?(t.x=this.radius_g_1*Math.atan(i/xe(n,e)),t.y=this.radius_g_1*Math.atan(n/e)):(t.x=this.radius_g_1*Math.atan(i/e),t.y=this.radius_g_1*Math.atan(n/xe(i,e))));return t.x=t.x*this.a,t.y=t.y*this.a,t},inverse:function(t){var e,r,i,n,a=-1,s=0,o=0;if(t.x=t.x/this.a,t.y=t.y/this.a,"ellipse"===this.shape){this.flip_axis?(o=Math.tan(t.y/this.radius_g_1),s=Math.tan(t.x/this.radius_g_1)*xe(1,o)):(s=Math.tan(t.x/this.radius_g_1),o=Math.tan(t.y/this.radius_g_1)*xe(1,s));var u=o/this.radius_p;if((i=(r=2*this.radius_g*a)*r-4*(e=s*s+u*u+a*a)*this.C)<0)return t.x=Number.NaN,t.y=Number.NaN,t;n=(-r-Math.sqrt(i))/(2*e),a=this.radius_g+n*a,s*=n,o*=n,t.x=Math.atan2(s,a),t.y=Math.atan(o*Math.cos(t.x)/a),t.y=Math.atan(this.radius_p_inv2*Math.tan(t.y));}else if("sphere"===this.shape){if(this.flip_axis?(o=Math.tan(t.y/this.radius_g_1),s=Math.tan(t.x/this.radius_g_1)*Math.sqrt(1+o*o)):(s=Math.tan(t.x/this.radius_g_1),o=Math.tan(t.y/this.radius_g_1)*Math.sqrt(1+s*s)),(i=(r=2*this.radius_g*a)*r-4*(e=s*s+o*o+a*a)*this.C)<0)return t.x=Number.NaN,t.y=Number.NaN,t;n=(-r-Math.sqrt(i))/(2*e),a=this.radius_g+n*a,s*=n,o*=n,t.x=Math.atan2(s,a),t.y=Math.atan(o*Math.cos(t.x)/a);}return t.x=t.x+this.long0,t},names:["Geostationary Satellite View","Geostationary_Satellite","geos"]};$t.defaultDatum="WGS84",$t.Proj=Nt,$t.WGS84=new $t.Proj("WGS84"),$t.Point=ce,$t.toPoint=Ht,$t.defs=ft,$t.nadgrid=function(t,e){var r=new DataView(e),i=function(t){var e=t.getInt32(8,!1);return 11!==e&&(11!==(e=t.getInt32(8,!0))&&console.warn("Failed to detect nadgrid endian-ness, defaulting to little-endian"),!0)}(r),n=function(t,e){return {nFields:t.getInt32(8,e),nSubgridFields:t.getInt32(24,e),nSubgrids:t.getInt32(40,e),shiftType:Lt(t,56,64).trim(),fromSemiMajorAxis:t.getFloat64(120,e),fromSemiMinorAxis:t.getFloat64(136,e),toSemiMajorAxis:t.getFloat64(152,e),toSemiMinorAxis:t.getFloat64(168,e)}}(r,i);n.nSubgrids>1&&console.log("Only single NTv2 subgrids are currently supported, subsequent sub grids are ignored");var a={header:n,subgrids:function(t,e,r){for(var i=[],n=0;nthis._skuTokenExpiresAt},yr.prototype.transformRequest=function(t,e){return this._transformRequestFn&&this._transformRequestFn(t,e)||{url:t}},yr.prototype.normalizeStyleURL=function(t,e){if(!dr(t))return t;var r=xr(t);return r.path="/styles/v1"+r.path,this._makeAPIURL(r,this._customAccessToken||e)},yr.prototype.normalizeGlyphsURL=function(t,e){if(!dr(t))return t;var r=xr(t);return r.path="/fonts/v1"+r.path,this._makeAPIURL(r,this._customAccessToken||e)},yr.prototype.normalizeSourceURL=function(t,e){if(!dr(t))return t;var r=xr(t);return r.path="/v4/"+r.authority+".json",r.params.push("secure"),this._makeAPIURL(r,this._customAccessToken||e)},yr.prototype.normalizeSpriteURL=function(t,e,r,i){var n=xr(t);return n&&!n.protocol&&n.path?(n.path+=""+e+r,n.path):dr(t)?(n.path="/styles/v1"+n.path+"/sprite"+e+r,this._makeAPIURL(n,this._customAccessToken||i)):(n.path+=""+e+r,br(n))},yr.prototype.normalizeTileURL=function(t,e){if(this._isSkuTokenExpired()&&this._createSkuToken(),t&&!dr(t))return t;var r=xr(t);r.path=r.path.replace(/(\.(png|jpg)\d*)(?=$)/,(D.devicePixelRatio>=2||512===e?"@2x":"")+(R.supported?".webp":"$1")),r.path=r.path.replace(/^.+\/v4\//,"/"),r.path="/v4"+r.path;var i=this._customAccessToken||function(t){for(var e=0,r=t;e=1&&s.localStorage.setItem(e,JSON.stringify(this.eventData));}catch(t){M("Unable to write to LocalStorage");}},wr.prototype.processRequests=function(t){},wr.prototype.postEvent=function(t,e,r,i){var n=this;if(N.EVENTS_URL){var a=xr(N.EVENTS_URL);a.params.push("access_token="+(i||N.ACCESS_TOKEN||""));var s={event:this.type,created:new Date(t).toISOString(),sdkIdentifier:"mapbox-gl-js",sdkVersion:"1.12.1-3",skuId:G,userId:this.anonId},o=e?c(s,e):s,u={url:br(a),headers:{"Content-Type":"text/plain"},body:JSON.stringify([o])};this.pendingRequest=Gr(u,(function(t){n.pendingRequest=null,r(t),n.saveEventData(),n.processRequests(i);}));}},wr.prototype.queueRequest=function(t,e){this.queue.push(t),this.processRequests(e);};var Mr,Sr,Ar=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)).constructor=e,e.prototype.postMapLoadEvent=function(t,e,r,i){this.skuToken=r,(N.EVENTS_URL&&i||N.ACCESS_TOKEN&&Array.isArray(t)&&t.some((function(t){return dr(t)||vr(t)})))&&this.queueRequest({id:e,timestamp:Date.now()},i);},e.prototype.processRequests=function(t){var e=this;if(!this.pendingRequest&&0!==this.queue.length){var r=this.queue.shift(),i=r.id,n=r.timestamp;i&&this.success[i]||(this.anonId||this.fetchEventData(),m(this.anonId)||(this.anonId=d()),this.postEvent(n,{skuToken:this.skuToken},(function(t){t||i&&(e.success[i]=!0);}),t));}},e}(wr),kr=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)).constructor=e,e.prototype.postTurnstileEvent=function(t,e){N.EVENTS_URL&&N.ACCESS_TOKEN&&Array.isArray(t)&&t.some((function(t){return dr(t)||vr(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=_r(N.ACCESS_TOKEN),i=r?r.u:N.ACCESS_TOKEN,n=i!==this.eventData.tokenU;m(this.anonId)||(this.anonId=d(),n=!0);var a=this.queue.shift();if(this.eventData.lastSuccess){var s=new Date(this.eventData.lastSuccess),o=new Date(a),u=(a-this.eventData.lastSuccess)/864e5;n=n||u>=1||u<-1||s.getDate()!==o.getDate();}else n=!0;if(!n)return this.processRequests();this.postEvent(a,{"enabled.telemetry":!1},(function(t){t||(e.eventData.lastSuccess=a,e.eventData.tokenU=i);}),t);}},e}(wr)),Ir=kr.postTurnstileEvent.bind(kr),zr=new Ar,Cr=zr.postMapLoadEvent.bind(zr),Er=500,Pr=50;function Br(){s.caches&&!Mr&&(Mr=s.caches.open("mapbox-tiles"));}function Tr(t){var e=t.indexOf("?");return e<0?t:t.slice(0,e)}var Vr,Lr=1/0;function Fr(){return null==Vr&&(Vr=s.OffscreenCanvas&&new s.OffscreenCanvas(1,1).getContext("2d")&&"function"==typeof s.createImageBitmap),Vr}var Or={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image"};"function"==typeof Object.freeze&&Object.freeze(Or);var Dr=function(t){function e(e,r,i){401===r&&vr(i)&&(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=i,this.name=this.constructor.name,this.message=e;}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.toString=function(){return this.name+": "+this.message+" ("+this.status+"): "+this.url},e}(Error),Nr=k()?function(){return self.worker&&self.worker.referrer}:function(){return ("blob:"===s.location.protocol?s.parent:s).location.href};var Rr,qr,jr=function(t,e){if(!(/^file:/.test(r=t.url)||/^file:/.test(Nr())&&!/^\w+:/.test(r))){if(s.fetch&&s.Request&&s.AbortController&&s.Request.prototype.hasOwnProperty("signal"))return function(t,e){var r,i=new s.AbortController,n=new s.Request(t.url,{method:t.method||"GET",body:t.body,credentials:t.credentials,headers:t.headers,referrer:Nr(),signal:i.signal}),a=!1,o=!1,u=(r=n.url).indexOf("sku=")>0&&vr(r);"json"===t.type&&n.headers.set("Accept","application/json");var h=function(r,i,a){if(!o){if(r&&"SecurityError"!==r.message&&M(r),i&&a)return l(i);var h=Date.now();s.fetch(n).then((function(r){if(r.ok){var i=u?r.clone():null;return l(r,i,h)}return e(new Dr(r.statusText,r.status,t.url))})).catch((function(t){20!==t.code&&e(new Error(t.message));}));}},l=function(r,i,u){("arrayBuffer"===t.type?r.arrayBuffer():"json"===t.type?r.json():r.text()).then((function(t){o||(i&&u&&function(t,e,r){if(Br(),Mr){var i={status:e.status,statusText:e.statusText,headers:new s.Headers};e.headers.forEach((function(t,e){return i.headers.set(e,t)}));var n=I(e.headers.get("Cache-Control")||"");n["no-store"]||(n["max-age"]&&i.headers.set("Expires",new Date(r+1e3*n["max-age"]).toUTCString()),new Date(i.headers.get("Expires")).getTime()-r<42e4||function(t,e){if(void 0===Sr)try{new Response(new ReadableStream),Sr=!0;}catch(t){Sr=!1;}Sr?e(t.body):t.blob().then(e);}(e,(function(e){var r=new s.Response(e,i);Br(),Mr&&Mr.then((function(e){return e.put(Tr(t.url),r)})).catch((function(t){return M(t.message)}));})));}}(n,i,u),a=!0,e(null,t,r.headers.get("Cache-Control"),r.headers.get("Expires")));})).catch((function(t){o||e(new Error(t.message));}));};return u?function(t,e){if(Br(),!Mr)return e(null);var r=Tr(t.url);Mr.then((function(t){t.match(r).then((function(i){var n=function(t){if(!t)return !1;var e=new Date(t.headers.get("Expires")||0),r=I(t.headers.get("Cache-Control")||"");return e>Date.now()&&!r["no-cache"]}(i);t.delete(r),n&&t.put(r,i.clone()),e(null,i,n);})).catch(e);})).catch(e);}(n,h):h(null,null),{cancel:function(){o=!0,a||i.abort();}}}(t,e);if(k()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",t,e,void 0,!0)}var r;return function(t,e){var r=new s.XMLHttpRequest;for(var i in r.open(t.method||"GET",t.url,!0),"arrayBuffer"===t.type&&(r.responseType="arraybuffer"),t.headers)r.setRequestHeader(i,t.headers[i]);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 i=r.response;if("json"===t.type)try{i=JSON.parse(r.response);}catch(t){return e(t)}e(null,i,r.getResponseHeader("Cache-Control"),r.getResponseHeader("Expires"));}else e(new Dr(r.statusText,r.status,t.url));},r.send(t.body),{cancel:function(){return r.abort()}}}(t,e)},Ur=function(t,e){return jr(c(t,{type:"arrayBuffer"}),e)},Gr=function(t,e){return jr(c(t,{method:"POST"}),e)};Rr=[],qr=0;var Kr=function(t,e){if(R.supported&&(t.headers||(t.headers={}),t.headers.accept="image/webp,*/*"),qr>=N.MAX_PARALLEL_IMAGE_REQUESTS){var r={requestParameters:t,callback:e,cancelled:!1,cancel:function(){this.cancelled=!0;}};return Rr.push(r),r}qr++;var i=!1,n=function(){if(!i)for(i=!0,qr--;Rr.length&&qr=l[f+0]&&i>=l[f+1])?(s[c]=!0,a.push(h[c])):s[c]=!1;}}},Hr.prototype._forEachCell=function(t,e,r,i,n,a,s,o){for(var u=this._convertToCellCoord(t),h=this._convertToCellCoord(e),l=this._convertToCellCoord(r),p=this._convertToCellCoord(i),c=u;c<=l;c++)for(var f=h;f<=p;f++){var y=this.d*f+c;if((!o||o(this._convertFromCellCoord(c),this._convertFromCellCoord(f),this._convertFromCellCoord(c+1),this._convertFromCellCoord(f+1)))&&n.call(this,t,e,r,i,y,a,s,o))return}},Hr.prototype._convertFromCellCoord=function(t){return (t-this.padding)/this.scale},Hr.prototype._convertToCellCoord=function(t){return Math.max(0,Math.min(this.d-1,Math.floor(t*this.scale)+this.padding))},Hr.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var t=this.cells,e=3+this.cells.length+1+1,r=0,i=0;i255?255:t}function n(t){return i("%"===t[t.length-1]?parseFloat(t)/100*255:parseInt(t))}function a(t){return (e="%"===t[t.length-1]?parseFloat(t)/100:parseFloat(t))<0?0:e>1?1:e;var e;}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,o=t.replace(/ /g,"").toLowerCase();if(o in r)return r[o].slice();if("#"===o[0])return 4===o.length?(e=parseInt(o.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===o.length&&(e=parseInt(o.substr(1),16))>=0&&e<=16777215?[(16711680&e)>>16,(65280&e)>>8,255&e,1]:null;var u=o.indexOf("("),h=o.indexOf(")");if(-1!==u&&h+1===o.length){var l=o.substr(0,u),p=o.substr(u+1,h-(u+1)).split(","),c=1;switch(l){case"rgba":if(4!==p.length)return null;c=a(p.pop());case"rgb":return 3!==p.length?null:[n(p[0]),n(p[1]),n(p[2]),c];case"hsla":if(4!==p.length)return null;c=a(p.pop());case"hsl":if(3!==p.length)return null;var f=(parseFloat(p[0])%360+360)%360/360,y=a(p[1]),d=a(p[2]),m=d<=.5?d*(y+1):d+y-d*y,v=2*d-m;return [i(255*s(v,m,f+1/3)),i(255*s(v,m,f)),i(255*s(v,m,f-1/3)),c];default:return null}}return null};}catch(t){}})).parseCSSColor,Zr=function(t,e,r,i){void 0===i&&(i=1),this.r=t,this.g=e,this.b=r,this.a=i;};function Yr(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];for(var i=0,n=e;i":"value"===t.itemType.kind?"array":"array<"+e+">"}return t.kind}var pi=[$r,ti,ei,ri,ii,oi,ni,hi(ai),ui];function ci(t,e){if("error"===e.kind)return null;if("array"===t.kind){if("array"===e.kind&&(0===e.N&&"value"===e.itemType.kind||!ci(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,i=pi;r=0&&t<=255&&"number"==typeof e&&e>=0&&e<=255&&"number"==typeof r&&r>=0&&r<=255?void 0===i||"number"==typeof i&&i>=0&&i<=1?null:"Invalid rgba value ["+[t,e,r,i].join(", ")+"]: 'a' must be between 0 and 1.":"Invalid rgba value ["+("number"==typeof i?[t,e,r,i]:[t,e,r]).join(", ")+"]: 'r', 'g', and 'b' must be between 0 and 255."}function bi(t){if(null===t)return !0;if("string"==typeof t)return !0;if("boolean"==typeof t)return !0;if("number"==typeof t)return !0;if(t instanceof Zr)return !0;if(t instanceof di)return !0;if(t instanceof vi)return !0;if(t instanceof gi)return !0;if(Array.isArray(t)){for(var e=0,r=t;e2){var o=t[1];if("string"!=typeof o||!(o in Ai)||"object"===o)return e.error('The item type argument of "array" must be one of string, number, boolean',1);a=Ai[o],i++;}else a=ai;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);s=t[2],i++;}r=hi(a,s);}else r=Ai[n];for(var u=[];i1)&&e.push(i);}}return e.concat(this.args.map((function(t){return t.serialize()})))};var Ii=function(t){this.type=oi,this.sections=t;};Ii.parse=function(t,e){if(t.length<2)return e.error("Expected at least one argument.");var r=t[1];if(!Array.isArray(r)&&"object"==typeof r)return e.error("First argument must be an image or text section.");for(var i=[],n=!1,a=1;a<=t.length-1;++a){var s=t[a];if(n&&"object"==typeof s&&!Array.isArray(s)){n=!1;var o=null;if(s["font-scale"]&&!(o=e.parse(s["font-scale"],1,ti)))return null;var u=null;if(s["text-font"]&&!(u=e.parse(s["text-font"],1,hi(ei))))return null;var h=null;if(s["text-color"]&&!(h=e.parse(s["text-color"],1,ii)))return null;var l=i[i.length-1];l.scale=o,l.font=u,l.textColor=h;}else {var p=e.parse(t[a],1,ai);if(!p)return null;var c=p.type.kind;if("string"!==c&&"value"!==c&&"null"!==c&&"resolvedImage"!==c)return e.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");n=!0,i.push({content:p,scale:null,font:null,textColor:null});}}return new Ii(i)},Ii.prototype.evaluate=function(t){return new vi(this.sections.map((function(e){var r=e.content.evaluate(t);return _i(r)===ui?new mi("",r,null,null,null):new mi(wi(r),null,e.scale?e.scale.evaluate(t):null,e.font?e.font.evaluate(t).join(","):null,e.textColor?e.textColor.evaluate(t):null)})))},Ii.prototype.eachChild=function(t){for(var e=0,r=this.sections;e-1),r},zi.prototype.eachChild=function(t){t(this.input);},zi.prototype.outputDefined=function(){return !1},zi.prototype.serialize=function(){return ["image",this.input.serialize()]};var Ci={"to-boolean":ri,"to-color":ii,"to-number":ti,"to-string":ei},Ei=function(t,e){this.type=t,this.args=e;};Ei.parse=function(t,e){if(t.length<2)return e.error("Expected at least one argument.");var r=t[0];if(("to-boolean"===r||"to-string"===r)&&2!==t.length)return e.error("Expected one argument.");for(var i=Ci[r],n=[],a=1;a4?"Invalid rbga value "+JSON.stringify(e)+": expected an array containing either three or four numeric values.":xi(e[0],e[1],e[2],e[3])))return new Zr(e[0]/255,e[1]/255,e[2]/255,e[3])}throw new Si(r||"Could not parse color from value '"+("string"==typeof e?e:String(JSON.stringify(e)))+"'")}if("number"===this.type.kind){for(var s=null,o=0,u=this.args;o=e[2]||t[1]<=e[1]||t[3]>=e[3])}function Oi(t,e){var r=(180+t[0])/360,i=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t[1]*Math.PI/360)))/360,n=Math.pow(2,e.z);return [Math.round(r*n*8192),Math.round(i*n*8192)]}function Di(t,e,r){return e[1]>t[1]!=r[1]>t[1]&&t[0]<(r[0]-e[0])*(t[1]-e[1])/(r[1]-e[1])+e[0]}function Ni(t,e){for(var r,i,n,a,s,o,u,h=!1,l=0,p=e.length;l0&&o<0||s<0&&o>0}function ji(t,e,r){for(var i=0,n=r;ir[2]){var n=.5*i,a=t[0]-r[0]>n?-i:r[0]-t[0]>n?i:0;0===a&&(a=t[0]-r[2]>n?-i:r[2]-t[0]>n?i:0),t[0]+=a;}Li(e,t);}function Ji(t,e,r,i){for(var n=8192*Math.pow(2,i.z),a=[8192*i.x,8192*i.y],s=[],o=0,u=t;o=0)return !1;var r=!0;return t.eachChild((function(t){r&&!$i(t,e)&&(r=!1);})),r}Yi.parse=function(t,e){if(2!==t.length)return e.error("'within' expression requires exactly one argument, but found "+(t.length-1)+" instead.");if(bi(t[1])){var r=t[1];if("FeatureCollection"===r.type)for(var i=0;ie))throw new Si("Input is not a number.");a=s-1;}return 0}en.prototype.parse=function(t,e,r,i,n){return void 0===n&&(n={}),e?this.concat(e,r,i)._parse(t,n):this._parse(t,n)},en.prototype._parse=function(t,e){function r(t,e,r){return "assert"===r?new ki(e,[t]):"coerce"===r?new Ei(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 i=t[0];if("string"!=typeof i)return this.error("Expression name must be a string, but found "+typeof i+' instead. If you wanted a literal array, use ["literal", [...]].',0),null;var n=this.registry[i];if(n){var a=n.parse(t,this);if(!a)return null;if(this.expectedType){var s=this.expectedType,o=a.type;if("string"!==s.kind&&"number"!==s.kind&&"boolean"!==s.kind&&"object"!==s.kind&&"array"!==s.kind||"value"!==o.kind)if("color"!==s.kind&&"formatted"!==s.kind&&"resolvedImage"!==s.kind||"value"!==o.kind&&"string"!==o.kind){if(this.checkSubtype(s,o))return null}else a=r(a,s,e.typeAnnotation||"coerce");else a=r(a,s,e.typeAnnotation||"assert");}if(!(a instanceof Mi)&&"resolvedImage"!==a.type.kind&&function t(e){if(e instanceof tn)return t(e.boundExpression);if(e instanceof Ti&&"error"===e.name)return !1;if(e instanceof Vi)return !1;if(e instanceof Yi)return !1;var r=e instanceof Ei||e instanceof ki,i=!0;return e.eachChild((function(e){i=r?i&&t(e):i&&e instanceof Mi;})),!!i&&Wi(e)&&$i(e,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}(a)){var u=new Bi;try{a=new Mi(a.type,a.evaluate(u));}catch(t){return this.error(t.message),null}}return a}return this.error('Unknown expression "'+i+'". If you wanted a literal array, use ["literal", [...]].',0)}return this.error(void 0===t?"'undefined' value invalid. Use null instead.":"object"==typeof t?'Bare objects invalid. Use ["literal", {...}] instead.':"Expected an array, but found "+typeof t+" instead.")},en.prototype.concat=function(t,e,r){var i="number"==typeof t?this.path.concat(t):this.path,n=r?this.scope.concat(r):this.scope;return new en(this.registry,i,e||null,n,this.errors)},en.prototype.error=function(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];var i=""+this.key+e.map((function(t){return "["+t+"]"})).join("");this.errors.push(new Wr(i,t));},en.prototype.checkSubtype=function(t,e){var r=ci(t,e);return r&&this.error(r),r};var nn=function(t,e,r){this.type=t,this.input=e,this.labels=[],this.outputs=[];for(var i=0,n=r;i=s)return e.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',u);var l=e.parse(o,h,n);if(!l)return null;n=n||l.type,i.push([s,l]);}return new nn(n,r,i)},nn.prototype.evaluate=function(t){var e=this.labels,r=this.outputs;if(1===e.length)return r[0].evaluate(t);var i=this.input.evaluate(t);if(i<=e[0])return r[0].evaluate(t);var n=e.length;return i>=e[n-1]?r[n-1].evaluate(t):r[rn(e,i)].evaluate(t)},nn.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 sn=Object.freeze({__proto__:null,number:an,color:function(t,e,r){return new Zr(an(t.r,e.r,r),an(t.g,e.g,r),an(t.b,e.b,r),an(t.a,e.a,r))},array:function(t,e,r){return t.map((function(t,i){return an(t,e[i],r)}))}}),on=6/29*3*(6/29),un=Math.PI/180,hn=180/Math.PI;function ln(t){return t>.008856451679035631?Math.pow(t,1/3):t/on+4/29}function pn(t){return t>6/29?t*t*t:on*(t-4/29)}function cn(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function fn(t){return (t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function yn(t){var e=fn(t.r),r=fn(t.g),i=fn(t.b),n=ln((.4124564*e+.3575761*r+.1804375*i)/.95047),a=ln((.2126729*e+.7151522*r+.072175*i)/1);return {l:116*a-16,a:500*(n-a),b:200*(a-ln((.0193339*e+.119192*r+.9503041*i)/1.08883)),alpha:t.a}}function dn(t){var e=(t.l+16)/116,r=isNaN(t.a)?e:e+t.a/500,i=isNaN(t.b)?e:e-t.b/200;return e=1*pn(e),r=.95047*pn(r),i=1.08883*pn(i),new Zr(cn(3.2404542*r-1.5371385*e-.4985314*i),cn(-.969266*r+1.8760108*e+.041556*i),cn(.0556434*r-.2040259*e+1.0572252*i),t.alpha)}function mn(t,e,r){var i=e-t;return t+r*(i>180||i<-180?i-360*Math.round(i/360):i)}var vn={forward:yn,reverse:dn,interpolate:function(t,e,r){return {l:an(t.l,e.l,r),a:an(t.a,e.a,r),b:an(t.b,e.b,r),alpha:an(t.alpha,e.alpha,r)}}},gn={forward:function(t){var e=yn(t),r=e.l,i=e.a,n=e.b,a=Math.atan2(n,i)*hn;return {h:a<0?a+360:a,c:Math.sqrt(i*i+n*n),l:r,alpha:t.a}},reverse:function(t){var e=t.h*un,r=t.c;return dn({l:t.l,a:Math.cos(e)*r,b:Math.sin(e)*r,alpha:t.alpha})},interpolate:function(t,e,r){return {h:mn(t.h,e.h,r),c:an(t.c,e.c,r),l:an(t.l,e.l,r),alpha:an(t.alpha,e.alpha,r)}}},xn=Object.freeze({__proto__:null,lab:vn,hcl:gn}),bn=function(t,e,r,i,n){this.type=t,this.operator=e,this.interpolation=r,this.input=i,this.labels=[],this.outputs=[];for(var a=0,s=n;a1})))return e.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);i={name:"cubic-bezier",controlPoints:o};}if(t.length-1<4)return e.error("Expected at least 4 arguments, but found only "+(t.length-1)+".");if((t.length-1)%2!=0)return e.error("Expected an even number of arguments.");if(!(n=e.parse(n,2,ti)))return null;var u=[],h=null;"interpolate-hcl"===r||"interpolate-lab"===r?h=ii:e.expectedType&&"value"!==e.expectedType.kind&&(h=e.expectedType);for(var l=0;l=p)return e.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',f);var d=e.parse(c,y,h);if(!d)return null;h=h||d.type,u.push([p,d]);}return "number"===h.kind||"color"===h.kind||"array"===h.kind&&"number"===h.itemType.kind&&"number"==typeof h.N?new bn(h,r,i,n,u):e.error("Type "+li(h)+" is not interpolatable.")},bn.prototype.evaluate=function(t){var e=this.labels,r=this.outputs;if(1===e.length)return r[0].evaluate(t);var i=this.input.evaluate(t);if(i<=e[0])return r[0].evaluate(t);var n=e.length;if(i>=e[n-1])return r[n-1].evaluate(t);var a=rn(e,i),s=bn.interpolationFactor(this.interpolation,i,e[a],e[a+1]),o=r[a].evaluate(t),u=r[a+1].evaluate(t);return "interpolate"===this.operator?sn[this.type.kind.toLowerCase()](o,u,s):"interpolate-hcl"===this.operator?gn.reverse(gn.interpolate(gn.forward(o),gn.forward(u),s)):vn.reverse(vn.interpolate(vn.forward(o),vn.forward(u),s))},bn.prototype.eachChild=function(t){t(this.input);for(var e=0,r=this.outputs;e=r.length)throw new Si("Array index out of bounds: "+e+" > "+(r.length-1)+".");if(e!==Math.floor(e))throw new Si("Array index must be an integer, but found "+e+" instead.");return r[e]},Sn.prototype.eachChild=function(t){t(this.index),t(this.input);},Sn.prototype.outputDefined=function(){return !1},Sn.prototype.serialize=function(){return ["at",this.index.serialize(),this.input.serialize()]};var An=function(t,e){this.type=ri,this.needle=t,this.haystack=e;};An.parse=function(t,e){if(3!==t.length)return e.error("Expected 2 arguments, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1,ai),i=e.parse(t[2],2,ai);return r&&i?fi(r.type,[ri,ei,ti,$r,ai])?new An(r,i):e.error("Expected first argument to be of type boolean, string, number or null, but found "+li(r.type)+" instead"):null},An.prototype.evaluate=function(t){var e=this.needle.evaluate(t),r=this.haystack.evaluate(t);if(!r)return !1;if(!yi(e,["boolean","string","number","null"]))throw new Si("Expected first argument to be of type boolean, string, number or null, but found "+li(_i(e))+" instead.");if(!yi(r,["string","array"]))throw new Si("Expected second argument to be of type array or string, but found "+li(_i(r))+" instead.");return r.indexOf(e)>=0},An.prototype.eachChild=function(t){t(this.needle),t(this.haystack);},An.prototype.outputDefined=function(){return !0},An.prototype.serialize=function(){return ["in",this.needle.serialize(),this.haystack.serialize()]};var kn=function(t,e,r){this.type=ti,this.needle=t,this.haystack=e,this.fromIndex=r;};kn.parse=function(t,e){if(t.length<=2||t.length>=5)return e.error("Expected 3 or 4 arguments, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1,ai),i=e.parse(t[2],2,ai);if(!r||!i)return null;if(!fi(r.type,[ri,ei,ti,$r,ai]))return e.error("Expected first argument to be of type boolean, string, number or null, but found "+li(r.type)+" instead");if(4===t.length){var n=e.parse(t[3],3,ti);return n?new kn(r,i,n):null}return new kn(r,i)},kn.prototype.evaluate=function(t){var e=this.needle.evaluate(t),r=this.haystack.evaluate(t);if(!yi(e,["boolean","string","number","null"]))throw new Si("Expected first argument to be of type boolean, string, number or null, but found "+li(_i(e))+" instead.");if(!yi(r,["string","array"]))throw new Si("Expected second argument to be of type array or string, but found "+li(_i(r))+" instead.");if(this.fromIndex){var i=this.fromIndex.evaluate(t);return r.indexOf(e,i)}return r.indexOf(e)},kn.prototype.eachChild=function(t){t(this.needle),t(this.haystack),this.fromIndex&&t(this.fromIndex);},kn.prototype.outputDefined=function(){return !1},kn.prototype.serialize=function(){if(null!=this.fromIndex&&void 0!==this.fromIndex){var t=this.fromIndex.serialize();return ["index-of",this.needle.serialize(),this.haystack.serialize(),t]}return ["index-of",this.needle.serialize(),this.haystack.serialize()]};var In=function(t,e,r,i,n,a){this.inputType=t,this.type=e,this.input=r,this.cases=i,this.outputs=n,this.otherwise=a;};In.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,i;e.expectedType&&"value"!==e.expectedType.kind&&(i=e.expectedType);for(var n={},a=[],s=2;sNumber.MAX_SAFE_INTEGER)return h.error("Branch labels must be integers no larger than "+Number.MAX_SAFE_INTEGER+".");if("number"==typeof c&&Math.floor(c)!==c)return h.error("Numeric branch labels must be integer values.");if(r){if(h.checkSubtype(r,_i(c)))return null}else r=_i(c);if(void 0!==n[String(c)])return h.error("Branch labels must be unique.");n[String(c)]=a.length;}var f=e.parse(u,s,i);if(!f)return null;i=i||f.type,a.push(f);}var y=e.parse(t[1],1,ai);if(!y)return null;var d=e.parse(t[t.length-1],t.length-1,i);return d?"value"!==y.type.kind&&e.concat(1).checkSubtype(r,y.type)?null:new In(r,i,y,n,a,d):null},In.prototype.evaluate=function(t){var e=this.input.evaluate(t);return (_i(e)===this.inputType&&this.outputs[this.cases[e]]||this.otherwise).evaluate(t)},In.prototype.eachChild=function(t){t(this.input),this.outputs.forEach(t),t(this.otherwise);},In.prototype.outputDefined=function(){return this.outputs.every((function(t){return t.outputDefined()}))&&this.otherwise.outputDefined()},In.prototype.serialize=function(){for(var t=this,e=["match",this.input.serialize()],r=[],i={},n=0,a=Object.keys(this.cases).sort();n=5)return e.error("Expected 3 or 4 arguments, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1,ai),i=e.parse(t[2],2,ti);if(!r||!i)return null;if(!fi(r.type,[hi(ai),ei,ai]))return e.error("Expected first argument to be of type array or string, but found "+li(r.type)+" instead");if(4===t.length){var n=e.parse(t[3],3,ti);return n?new Cn(r.type,r,i,n):null}return new Cn(r.type,r,i)},Cn.prototype.evaluate=function(t){var e=this.input.evaluate(t),r=this.beginIndex.evaluate(t);if(!yi(e,["string","array"]))throw new Si("Expected first argument to be of type array or string, but found "+li(_i(e))+" instead.");if(this.endIndex){var i=this.endIndex.evaluate(t);return e.slice(r,i)}return e.slice(r)},Cn.prototype.eachChild=function(t){t(this.input),t(this.beginIndex),this.endIndex&&t(this.endIndex);},Cn.prototype.outputDefined=function(){return !1},Cn.prototype.serialize=function(){if(null!=this.endIndex&&void 0!==this.endIndex){var t=this.endIndex.serialize();return ["slice",this.input.serialize(),this.beginIndex.serialize(),t]}return ["slice",this.input.serialize(),this.beginIndex.serialize()]};var Tn=Bn("==",(function(t,e,r){return e===r}),Pn),Vn=Bn("!=",(function(t,e,r){return e!==r}),(function(t,e,r,i){return !Pn(0,e,r,i)})),Ln=Bn("<",(function(t,e,r){return e",(function(t,e,r){return e>r}),(function(t,e,r,i){return i.compare(e,r)>0})),On=Bn("<=",(function(t,e,r){return e<=r}),(function(t,e,r,i){return i.compare(e,r)<=0})),Dn=Bn(">=",(function(t,e,r){return e>=r}),(function(t,e,r,i){return i.compare(e,r)>=0})),Nn=function(t,e,r,i,n){this.type=ei,this.number=t,this.locale=e,this.currency=r,this.minFractionDigits=i,this.maxFractionDigits=n;};Nn.parse=function(t,e){if(3!==t.length)return e.error("Expected two arguments.");var r=e.parse(t[1],1,ti);if(!r)return null;var i=t[2];if("object"!=typeof i||Array.isArray(i))return e.error("NumberFormat options argument must be an object.");var n=null;if(i.locale&&!(n=e.parse(i.locale,1,ei)))return null;var a=null;if(i.currency&&!(a=e.parse(i.currency,1,ei)))return null;var s=null;if(i["min-fraction-digits"]&&!(s=e.parse(i["min-fraction-digits"],1,ti)))return null;var o=null;return i["max-fraction-digits"]&&!(o=e.parse(i["max-fraction-digits"],1,ti))?null:new Nn(r,n,a,s,o)},Nn.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))},Nn.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);},Nn.prototype.outputDefined=function(){return !1},Nn.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 Rn=function(t){this.type=ti,this.input=t;};Rn.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 "+li(r.type)+" instead."):new Rn(r):null},Rn.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 Si("Expected value to be of type string or array, but found "+li(_i(e))+" instead.")},Rn.prototype.eachChild=function(t){t(this.input);},Rn.prototype.outputDefined=function(){return !1},Rn.prototype.serialize=function(){var t=["length"];return this.eachChild((function(e){t.push(e.serialize());})),t};var qn={"==":Tn,"!=":Vn,">":Fn,"<":Ln,">=":Dn,"<=":On,array:ki,at:Sn,boolean:ki,case:zn,coalesce:wn,collator:Vi,format:Ii,image:zi,in:An,"index-of":kn,interpolate:bn,"interpolate-hcl":bn,"interpolate-lab":bn,length:Rn,let:Mn,literal:Mi,match:In,number:ki,"number-format":Nn,object:ki,slice:Cn,step:nn,string:ki,"to-boolean":Ei,"to-color":Ei,"to-number":Ei,"to-string":Ei,var:tn,within:Yi};function jn(t,e){var r=e[0],i=e[1],n=e[2],a=e[3];r=r.evaluate(t),i=i.evaluate(t),n=n.evaluate(t);var s=a?a.evaluate(t):1,o=xi(r,i,n,s);if(o)throw new Si(o);return new Zr(r/255*s,i/255*s,n/255*s,s)}function Un(t,e){return t in e}function Gn(t,e){var r=e[t];return void 0===r?null:r}function Kn(t){return {type:t}}function Xn(t){return {result:"success",value:t}}function Hn(t){return {result:"error",value:t}}function Jn(t){return "data-driven"===t["property-type"]||"cross-faded-data-driven"===t["property-type"]}function Zn(t){return !!t.expression&&t.expression.parameters.indexOf("zoom")>-1}function Yn(t){return !!t.expression&&t.expression.interpolated}function Wn(t){return t instanceof Number?"number":t instanceof String?"string":t instanceof Boolean?"boolean":Array.isArray(t)?"array":null===t?"null":typeof t}function Qn(t){return "object"==typeof t&&null!==t&&!Array.isArray(t)}function $n(t){return t}function ta(t,e,r){return void 0!==t?t:void 0!==e?e:void 0!==r?r:void 0}function ea(t,e,r,i,n){return ta(typeof r===n?i[r]:void 0,t.default,e.default)}function ra(t,e,r){if("number"!==Wn(r))return ta(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 n=rn(t.stops.map((function(t){return t[0]})),r);return t.stops[n][1]}function ia(t,e,r){var i=void 0!==t.base?t.base:1;if("number"!==Wn(r))return ta(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 a=rn(t.stops.map((function(t){return t[0]})),r),s=function(t,e,r,i){var n=i-r,a=t-r;return 0===n?0:1===e?a/n:(Math.pow(e,a)-1)/(Math.pow(e,n)-1)}(r,i,t.stops[a][0],t.stops[a+1][0]),o=t.stops[a][1],u=t.stops[a+1][1],h=sn[e.type]||$n;if(t.colorSpace&&"rgb"!==t.colorSpace){var l=xn[t.colorSpace];h=function(t,e){return l.reverse(l.interpolate(l.forward(t),l.forward(e),s))};}return "function"==typeof o.evaluate?{evaluate:function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];var r=o.evaluate.apply(void 0,t),i=u.evaluate.apply(void 0,t);if(void 0!==r&&void 0!==i)return h(r,i,s)}}:h(o,u,s)}function na(t,e,r){return "color"===e.type?r=Zr.parse(r):"formatted"===e.type?r=vi.fromString(r.toString()):"resolvedImage"===e.type?r=gi.fromString(r.toString()):Wn(r)===e.type||"enum"===e.type&&e.values[r]||(r=void 0),ta(r,t.default,e.default)}Ti.register(qn,{error:[{kind:"error"},[ei],function(t,e){throw new Si(e[0].evaluate(t))}],typeof:[ei,[ai],function(t,e){return li(_i(e[0].evaluate(t)))}],"to-rgba":[hi(ti,4),[ii],function(t,e){return e[0].evaluate(t).toArray()}],rgb:[ii,[ti,ti,ti],jn],rgba:[ii,[ti,ti,ti,ti],jn],has:{type:ri,overloads:[[[ei],function(t,e){return Un(e[0].evaluate(t),t.properties())}],[[ei,ni],function(t,e){var r=e[1];return Un(e[0].evaluate(t),r.evaluate(t))}]]},get:{type:ai,overloads:[[[ei],function(t,e){return Gn(e[0].evaluate(t),t.properties())}],[[ei,ni],function(t,e){var r=e[1];return Gn(e[0].evaluate(t),r.evaluate(t))}]]},"feature-state":[ai,[ei],function(t,e){return Gn(e[0].evaluate(t),t.featureState||{})}],properties:[ni,[],function(t){return t.properties()}],"geometry-type":[ei,[],function(t){return t.geometryType()}],id:[ai,[],function(t){return t.id()}],zoom:[ti,[],function(t){return t.globals.zoom}],"heatmap-density":[ti,[],function(t){return t.globals.heatmapDensity||0}],"line-progress":[ti,[],function(t){return t.globals.lineProgress||0}],accumulated:[ai,[],function(t){return void 0===t.globals.accumulated?null:t.globals.accumulated}],"+":[ti,Kn(ti),function(t,e){for(var r=0,i=0,n=e;i":[ri,[ei,ai],function(t,e){var r=e[0],i=e[1],n=t.properties()[r.value],a=i.value;return typeof n==typeof a&&n>a}],"filter-id->":[ri,[ai],function(t,e){var r=e[0],i=t.id(),n=r.value;return typeof i==typeof n&&i>n}],"filter-<=":[ri,[ei,ai],function(t,e){var r=e[0],i=e[1],n=t.properties()[r.value],a=i.value;return typeof n==typeof a&&n<=a}],"filter-id-<=":[ri,[ai],function(t,e){var r=e[0],i=t.id(),n=r.value;return typeof i==typeof n&&i<=n}],"filter->=":[ri,[ei,ai],function(t,e){var r=e[0],i=e[1],n=t.properties()[r.value],a=i.value;return typeof n==typeof a&&n>=a}],"filter-id->=":[ri,[ai],function(t,e){var r=e[0],i=t.id(),n=r.value;return typeof i==typeof n&&i>=n}],"filter-has":[ri,[ai],function(t,e){return e[0].value in t.properties()}],"filter-has-id":[ri,[],function(t){return null!==t.id()&&void 0!==t.id()}],"filter-type-in":[ri,[hi(ei)],function(t,e){return e[0].value.indexOf(t.geometryType())>=0}],"filter-id-in":[ri,[hi(ai)],function(t,e){return e[0].value.indexOf(t.id())>=0}],"filter-in-small":[ri,[ei,hi(ai)],function(t,e){var r=e[0];return e[1].value.indexOf(t.properties()[r.value])>=0}],"filter-in-large":[ri,[ei,hi(ai)],function(t,e){var r=e[0],i=e[1];return function(t,e,r,i){for(;r<=i;){var n=r+i>>1;if(e[n]===t)return !0;e[n]>t?i=n-1:r=n+1;}return !1}(t.properties()[r.value],i.value,0,i.value.length-1)}],all:{type:ri,overloads:[[[ri,ri],function(t,e){var r=e[1];return e[0].evaluate(t)&&r.evaluate(t)}],[Kn(ri),function(t,e){for(var r=0,i=e;r0&&"string"==typeof t[0]&&t[0]in qn}function oa(t,e){var r=new en(qn,[],e?function(t){var e={color:ii,string:ei,number:ti,enum:ei,boolean:ri,formatted:oi,resolvedImage:ui};return "array"===t.type?hi(e[t.value]||ai,t.length):e[t.type]}(e):void 0),i=r.parse(t,void 0,void 0,void 0,e&&"string"===e.type?{typeAnnotation:"coerce"}:void 0);return i?Xn(new aa(i,e)):Hn(r.errors)}aa.prototype.evaluateWithoutErrorHandling=function(t,e,r,i,n,a){return this._evaluator.globals=t,this._evaluator.feature=e,this._evaluator.featureState=r,this._evaluator.canonical=i,this._evaluator.availableImages=n||null,this._evaluator.formattedSection=a,this.expression.evaluate(this._evaluator)},aa.prototype.evaluate=function(t,e,r,i,n,a){this._evaluator.globals=t,this._evaluator.feature=e||null,this._evaluator.featureState=r||null,this._evaluator.canonical=i,this._evaluator.availableImages=n||null,this._evaluator.formattedSection=a||null;try{var s=this.expression.evaluate(this._evaluator);if(null==s||"number"==typeof s&&s!=s)return this._defaultValue;if(this._enumValues&&!(s in this._enumValues))throw new Si("Expected value to be one of "+Object.keys(this._enumValues).map((function(t){return JSON.stringify(t)})).join(", ")+", but found "+JSON.stringify(s)+" instead.");return s}catch(t){return this._warningHistory[t.message]||(this._warningHistory[t.message]=!0,"undefined"!=typeof console&&console.warn(t.message)),this._defaultValue}};var ua=function(t,e){this.kind=t,this._styleExpression=e,this.isStateDependent="constant"!==t&&!Qi(e.expression);};ua.prototype.evaluateWithoutErrorHandling=function(t,e,r,i,n,a){return this._styleExpression.evaluateWithoutErrorHandling(t,e,r,i,n,a)},ua.prototype.evaluate=function(t,e,r,i,n,a){return this._styleExpression.evaluate(t,e,r,i,n,a)};var ha=function(t,e,r,i){this.kind=t,this.zoomStops=r,this._styleExpression=e,this.isStateDependent="camera"!==t&&!Qi(e.expression),this.interpolationType=i;};function la(t,e){if("error"===(t=oa(t,e)).result)return t;var r=t.value.expression,i=Wi(r);if(!i&&!Jn(e))return Hn([new Wr("","data expressions not supported")]);var n=$i(r,["zoom"]);if(!n&&!Zn(e))return Hn([new Wr("","zoom expressions not supported")]);var a=function t(e){var r=null;if(e instanceof Mn)r=t(e.result);else if(e instanceof wn)for(var i=0,n=e.args;i=0)){var l=t[h];u[h]=ya[o].shallow.indexOf(h)>=0?l:xa(l,e);}t instanceof Error&&(u.message=t.message);}if(u.$name)throw new Error("$name property is reserved for worker serialization logic.");return "Object"!==o&&(u.$name=o),u}throw new Error("can't serialize object of type "+typeof t)}function ba(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||va(t)||ga(t)||ArrayBuffer.isView(t)||t instanceof ca)return t;if(Array.isArray(t))return t.map(ba);if("object"==typeof t){var e=t.$name||"Object",r=ya[e].klass;if(!r)throw new Error("can't deserialize unregistered class "+e);if(r.deserialize)return r.deserialize(t);for(var i=Object.create(r.prototype),n=0,a=Object.keys(t);n=0?o:ba(o);}}return i}throw new Error("can't deserialize object of type "+typeof t)}function _a(t,e,r,i){var n=e.width,a=e.height;if(i){if(i instanceof Uint8ClampedArray)i=new Uint8Array(i.buffer);else if(i.length!==n*a*r)throw new RangeError("mismatched image size")}else i=new Uint8Array(n*a*r);return t.width=n,t.height=a,t.data=i,t}function wa(t,e,r){var i=e.width,n=e.height;if(i!==t.width||n!==t.height){var a=_a({},{width:i,height:n},r);Ma(t,a,{x:0,y:0},{x:0,y:0},{width:Math.min(t.width,i),height:Math.min(t.height,n)},r),t.width=i,t.height=n,t.data=a.data;}}function Ma(t,e,r,i,n,a){if(0===n.width||0===n.height)return e;if(n.width>t.width||n.height>t.height||r.x>t.width-n.width||r.y>t.height-n.height)throw new RangeError("out of range source coordinates for image copy");if(n.width>e.width||n.height>e.height||i.x>e.width-n.width||i.y>e.height-n.height)throw new RangeError("out of range destination coordinates for image copy");for(var s=t.data,o=e.data,u=0;u0||this._oneTimeListeners&&this._oneTimeListeners[t]&&this._oneTimeListeners[t].length>0||this._eventedParent&&this._eventedParent.listens(t)},Ea.prototype.setEventedParent=function(t,e){return this._eventedParent=t,this._eventedParentData=e,this};var Pa={$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:"stringobject"},glyphs:{type:"stringobject"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{}},default:"mapbox"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},customprj:{type:"*"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"*"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_fill:{"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_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:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"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"}],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":{},within:{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"*",minimum:1},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"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:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}}},Ba=function(t,e,r,i){this.message=(t?t+": ":"")+r,i&&(this.identifier=i),null!=e&&e.__line__&&(this.line=e.__line__);};function Ta(t){var e=t.value;return e?[new Ba(t.key,e,"constants have been deprecated as of v8")]:[]}function Va(t){return t instanceof Number||t instanceof String||t instanceof Boolean?t.valueOf():t}function La(t){if(Array.isArray(t))return t.map(La);if(t instanceof Object&&!(t instanceof Number||t instanceof String||t instanceof Boolean)){var e={};for(var r in t)e[r]=La(t[r]);return e}return Va(t)}function Fa(t){var e=t.key,r=t.value,i=t.valueSpec||{},n=t.objectElementValidators||{},a=t.style,s=t.styleSpec,o=[],u=Wn(r);if("object"!==u)return [new Ba(e,r,"object expected, "+u+" found")];for(var h in r){var l=h.split(".")[0],p=i[l]||i["*"],c=void 0;if(n[l])c=n[l];else if(i[l])c=os;else if(n["*"])c=n["*"];else {if(!i["*"]){o.push(new Ba(e,r[h],'unknown property "'+h+'"'));continue}c=os;}o=o.concat(c({key:(e?e+".":e)+h,value:r[h],valueSpec:p,style:a,styleSpec:s,object:r,objectKey:h},r));}for(var f in i)n[f]||i[f].required&&void 0===i[f].default&&void 0===r[f]&&o.push(new Ba(e,r,'missing required property "'+f+'"'));return o}function Oa(t){var e=t.value,r=t.valueSpec,i=t.style,n=t.styleSpec,a=t.key,s=t.arrayElementValidator||os;if("array"!==Wn(e))return [new Ba(a,e,"array expected, "+Wn(e)+" found")];if(r.length&&e.length!==r.length)return [new Ba(a,e,"array length "+r.length+" expected, length "+e.length+" found")];if(r["min-length"]&&e.lengthi.maximum?[new Ba(e,r,r+" is greater than the maximum value "+i.maximum)]:[]}function Na(t){var e,r,i,n=t.valueSpec,a=Va(t.value.type),s={},o="categorical"!==a&&void 0===t.value.property,u=!o,h="array"===Wn(t.value.stops)&&"array"===Wn(t.value.stops[0])&&"object"===Wn(t.value.stops[0][0]),l=Fa({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 Ba(t.key,t.value,'identity function may not have a "stops" property')];var e=[],r=t.value;return e=e.concat(Oa({key:t.key,value:r,valueSpec:t.valueSpec,style:t.style,styleSpec:t.styleSpec,arrayElementValidator:p})),"array"===Wn(r)&&0===r.length&&e.push(new Ba(t.key,r,"array must have at least one stop")),e},default:function(t){return os({key:t.key,value:t.value,valueSpec:n,style:t.style,styleSpec:t.styleSpec})}}});return "identity"===a&&o&&l.push(new Ba(t.key,t.value,'missing required property "property"')),"identity"===a||t.value.stops||l.push(new Ba(t.key,t.value,'missing required property "stops"')),"exponential"===a&&t.valueSpec.expression&&!Yn(t.valueSpec)&&l.push(new Ba(t.key,t.value,"exponential functions not supported")),t.styleSpec.$version>=8&&(u&&!Jn(t.valueSpec)?l.push(new Ba(t.key,t.value,"property functions not supported")):o&&!Zn(t.valueSpec)&&l.push(new Ba(t.key,t.value,"zoom functions not supported"))),"categorical"!==a&&!h||void 0!==t.value.property||l.push(new Ba(t.key,t.value,'"property" property is required')),l;function p(t){var e=[],a=t.value,o=t.key;if("array"!==Wn(a))return [new Ba(o,a,"array expected, "+Wn(a)+" found")];if(2!==a.length)return [new Ba(o,a,"array length 2 expected, length "+a.length+" found")];if(h){if("object"!==Wn(a[0]))return [new Ba(o,a,"object expected, "+Wn(a[0])+" found")];if(void 0===a[0].zoom)return [new Ba(o,a,"object stop key must have zoom")];if(void 0===a[0].value)return [new Ba(o,a,"object stop key must have value")];if(i&&i>Va(a[0].zoom))return [new Ba(o,a[0].zoom,"stop zoom values must appear in ascending order")];Va(a[0].zoom)!==i&&(i=Va(a[0].zoom),r=void 0,s={}),e=e.concat(Fa({key:o+"[0]",value:a[0],valueSpec:{zoom:{}},style:t.style,styleSpec:t.styleSpec,objectElementValidators:{zoom:Da,value:c}}));}else e=e.concat(c({key:o+"[0]",value:a[0],valueSpec:{},style:t.style,styleSpec:t.styleSpec},a));return sa(La(a[1]))?e.concat([new Ba(o+"[1]",a[1],"expressions are not allowed in function stops.")]):e.concat(os({key:o+"[1]",value:a[1],valueSpec:n,style:t.style,styleSpec:t.styleSpec}))}function c(t,i){var o=Wn(t.value),u=Va(t.value),h=null!==t.value?t.value:i;if(e){if(o!==e)return [new Ba(t.key,h,o+" stop domain type must match previous stop domain type "+e)]}else e=o;if("number"!==o&&"string"!==o&&"boolean"!==o)return [new Ba(t.key,h,"stop domain value must be a number, string, or boolean")];if("number"!==o&&"categorical"!==a){var l="number expected, "+o+" found";return Jn(n)&&void 0===a&&(l+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new Ba(t.key,h,l)]}return "categorical"!==a||"number"!==o||isFinite(u)&&Math.floor(u)===u?"categorical"!==a&&"number"===o&&void 0!==r&&u=2&&"$id"!==t[1]&&"$type"!==t[1];case"in":return t.length>=3&&("string"!=typeof t[1]||Array.isArray(t[2]));case"!in":case"!has":case"none":return !1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==t.length||Array.isArray(t[1])||Array.isArray(t[2]);case"any":case"all":for(var e=0,r=t.slice(1);ee?1:0}function Xa(t){if(!t)return !0;var e,r=t[0];return t.length<=1?"any"!==r:"=="===r?Ha(t[1],t[2],"=="):"!="===r?Ya(Ha(t[1],t[2],"==")):"<"===r||">"===r||"<="===r||">="===r?Ha(t[1],t[2],r):"any"===r?(e=t.slice(1),["any"].concat(e.map(Xa))):"all"===r?["all"].concat(t.slice(1).map(Xa)):"none"===r?["all"].concat(t.slice(1).map(Xa).map(Ya)):"in"===r?Ja(t[1],t.slice(2)):"!in"===r?Ya(Ja(t[1],t.slice(2))):"has"===r?Za(t[1]):"!has"===r?Ya(Za(t[1])):"within"!==r||t}function Ha(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 Ja(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(Ka)]]:["filter-in-small",t,["literal",e]]}}function Za(t){switch(t){case"$type":return !0;case"$id":return ["filter-has-id"];default:return ["filter-has",t]}}function Ya(t){return ["!",t]}function Wa(t){return ja(La(t.value))?Ra(Yr({},t,{expressionContext:"filter",valueSpec:{value:"boolean"}})):function t(e){var r=e.value,i=e.key;if("array"!==Wn(r))return [new Ba(i,r,"array expected, "+Wn(r)+" found")];var n,a=e.styleSpec,s=[];if(r.length<1)return [new Ba(i,r,"filter array must have at least 1 element")];switch(s=s.concat(qa({key:i+"[0]",value:r[0],valueSpec:a.filter_operator,style:e.style,styleSpec:e.styleSpec})),Va(r[0])){case"<":case"<=":case">":case">=":r.length>=2&&"$type"===Va(r[1])&&s.push(new Ba(i,r,'"$type" cannot be use with operator "'+r[0]+'"'));case"==":case"!=":3!==r.length&&s.push(new Ba(i,r,'filter array for operator "'+r[0]+'" must have 3 elements'));case"in":case"!in":r.length>=2&&"string"!==(n=Wn(r[1]))&&s.push(new Ba(i+"[1]",r[1],"string expected, "+n+" found"));for(var o=2;or?(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 gs(t){for(var e=0,r=t;e=65097&&t<=65103)||vs["CJK Compatibility Ideographs"](t)||vs["CJK Compatibility"](t)||vs["CJK Radicals Supplement"](t)||vs["CJK Strokes"](t)||!(!vs["CJK Symbols and Punctuation"](t)||t>=12296&&t<=12305||t>=12308&&t<=12319||12336===t)||vs["CJK Unified Ideographs Extension A"](t)||vs["CJK Unified Ideographs"](t)||vs["Enclosed CJK Letters and Months"](t)||vs["Hangul Compatibility Jamo"](t)||vs["Hangul Jamo Extended-A"](t)||vs["Hangul Jamo Extended-B"](t)||vs["Hangul Jamo"](t)||vs["Hangul Syllables"](t)||vs.Hiragana(t)||vs["Ideographic Description Characters"](t)||vs.Kanbun(t)||vs["Kangxi Radicals"](t)||vs["Katakana Phonetic Extensions"](t)||vs.Katakana(t)&&12540!==t||!(!vs["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)||!(!vs["Small Form Variants"](t)||t>=65112&&t<=65118||t>=65123&&t<=65126)||vs["Unified Canadian Aboriginal Syllabics"](t)||vs["Unified Canadian Aboriginal Syllabics Extended"](t)||vs["Vertical Forms"](t)||vs["Yijing Hexagram Symbols"](t)||vs["Yi Syllables"](t)||vs["Yi Radicals"](t))))}function bs(t){return !(xs(t)||function(t){return !!(vs["Latin-1 Supplement"](t)&&(167===t||169===t||174===t||177===t||188===t||189===t||190===t||215===t||247===t)||vs["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)||vs["Letterlike Symbols"](t)||vs["Number Forms"](t)||vs["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)||vs["Control Pictures"](t)&&9251!==t||vs["Optical Character Recognition"](t)||vs["Enclosed Alphanumerics"](t)||vs["Geometric Shapes"](t)||vs["Miscellaneous Symbols"](t)&&!(t>=9754&&t<=9759)||vs["Miscellaneous Symbols and Arrows"](t)&&(t>=11026&&t<=11055||t>=11088&&t<=11097||t>=11192&&t<=11243)||vs["CJK Symbols and Punctuation"](t)||vs.Katakana(t)||vs["Private Use Area"](t)||vs["CJK Compatibility Forms"](t)||vs["Small Form Variants"](t)||vs["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 _s(t){return t>=1424&&t<=2303||vs["Arabic Presentation Forms-A"](t)||vs["Arabic Presentation Forms-B"](t)}function ws(t,e){return !(!e&&_s(t)||t>=2304&&t<=3583||t>=3840&&t<=4255||vs.Khmer(t))}function Ms(t){for(var e=0,r=t;e-1&&(As="error"),Ss&&Ss(t);};function zs(){Cs.fire(new za("pluginStateChange",{pluginStatus:As,pluginURL:ks}));}var Cs=new Ea,Es=function(){return As},Ps=function(){if("deferred"!==As||!ks)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");As="loading",zs(),ks&&Ur({url:ks},(function(t){t?Is(t):(As="loaded",zs());}));},Bs={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:function(){return "loaded"===As||null!=Bs.applyArabicShaping},isLoading:function(){return "loading"===As},setState:function(t){As=t.pluginStatus,ks=t.pluginURL;},isParsed:function(){return null!=Bs.applyArabicShaping&&null!=Bs.processBidirectionalText&&null!=Bs.processStyledBidirectionalText},getPluginURL:function(){return ks}},Ts=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 ms,this.transition={});};Ts.prototype.isSupportedScript=function(t){return function(t,e){for(var r=0,i=t;rthis.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:e+(1-e)*r}:{fromScale:.5,toScale:1,t:1-(1-r)*e}};var Vs=function(t,e){this.property=t,this.value=e,this.expression=function(t,e){if(Qn(t))return new pa(t,e);if(sa(t)){var r=la(t,e);if("error"===r.result)throw new Error(r.value.map((function(t){return t.key+": "+t.message})).join(", "));return r.value}var i=t;return "string"==typeof t&&"color"===e.type&&(i=Zr.parse(t)),{kind:"constant",evaluate:function(){return i}}}(void 0===e?t.specification.default:e,t.specification);};Vs.prototype.isDataDriven=function(){return "source"===this.expression.kind||"composite"===this.expression.kind},Vs.prototype.possiblyEvaluate=function(t,e,r){return this.property.possiblyEvaluate(this,t,e,r)};var Ls=function(t){this.property=t,this.value=new Vs(t,void 0);};Ls.prototype.transitioned=function(t,e){return new Os(this.property,this.value,e,c({},t.transition,this.transition),t.now)},Ls.prototype.untransitioned=function(){return new Os(this.property,this.value,null,{},0)};var Fs=function(t){this._properties=t,this._values=Object.create(t.defaultTransitionablePropertyValues);};Fs.prototype.getValue=function(t){return _(this._values[t].value.value)},Fs.prototype.setValue=function(t,e){this._values.hasOwnProperty(t)||(this._values[t]=new Ls(this._values[t].property)),this._values[t].value=new Vs(this._values[t].property,null===e?void 0:_(e));},Fs.prototype.getTransition=function(t){return _(this._values[t].transition)},Fs.prototype.setTransition=function(t,e){this._values.hasOwnProperty(t)||(this._values[t]=new Ls(this._values[t].property)),this._values[t].transition=_(e)||void 0;},Fs.prototype.serialize=function(){for(var t={},e=0,r=Object.keys(this._values);ethis.end)return this.prior=null,n;if(this.value.isDataDriven())return this.prior=null,n;if(i=1)return 1;var e=t*t,r=e*t;return 4*(t<.5?r:3*(t-e)+r-.75)}(s))}return n};var Ds=function(t){this._properties=t,this._values=Object.create(t.defaultTransitioningPropertyValues);};Ds.prototype.possiblyEvaluate=function(t,e,r){for(var i=new qs(this._properties),n=0,a=Object.keys(this._values);ni.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:r,to:e}},e.prototype.interpolate=function(t){return t},e}(Us),Ks=function(t){this.specification=t;};Ks.prototype.possiblyEvaluate=function(t,e,r,i){if(void 0!==t.value){if("constant"===t.expression.kind){var n=t.expression.evaluate(e,null,{},r,i);return this._calculate(n,n,n,e)}return this._calculate(t.expression.evaluate(new Ts(Math.floor(e.zoom-1),e)),t.expression.evaluate(new Ts(Math.floor(e.zoom),e)),t.expression.evaluate(new Ts(Math.floor(e.zoom+1),e)),e)}},Ks.prototype._calculate=function(t,e,r,i){return i.zoom>i.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:r,to:e}},Ks.prototype.interpolate=function(t){return t};var Xs=function(t){this.specification=t;};Xs.prototype.possiblyEvaluate=function(t,e,r,i){return !!t.expression.evaluate(e,null,{},r,i)},Xs.prototype.interpolate=function(){return !1};var Hs=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 i=this.defaultPropertyValues[e]=new Vs(r,void 0),n=this.defaultTransitionablePropertyValues[e]=new Ls(r);this.defaultTransitioningPropertyValues[e]=n.untransitioned(),this.defaultPossiblyEvaluatedValues[e]=i.possiblyEvaluate({});}};da("DataDrivenProperty",Us),da("DataConstantProperty",js),da("CrossFadedDataDrivenProperty",Gs),da("CrossFadedProperty",Ks),da("ColorRampProperty",Xs);var Js=function(t){function e(e,r){if(t.call(this),this.id=e.id,this.type=e.type,this._featureFilter={filter:function(){return !0},needGeometry:!1},"custom"!==e.type&&(this.metadata=(e=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 Ns(r.layout)),r.paint)){for(var i in this._transitionablePaint=new Fs(r.paint),e.paint)this.setPaintProperty(i,e.paint[i],{validate:!1});for(var n in e.layout)this.setLayoutProperty(n,e.layout[n],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new qs(r.paint);}}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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){void 0===r&&(r={}),null!=e&&this._validate(ys,"layers."+this.id+".layout."+t,t,e,r)||("visibility"!==t?this._unevaluatedLayout.setValue(t,e):this.visibility=e);},e.prototype.getPaintProperty=function(t){return g(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&&this._validate(fs,"layers."+this.id+".paint."+t,t,e,r))return !1;if(g(t,"-transition"))return this._transitionablePaint.setTransition(t.slice(0,-"-transition".length),e||void 0),!1;var i=this._transitionablePaint._values[t],n="cross-faded-data-driven"===i.property.specification["property-type"],a=i.value.isDataDriven(),s=i.value;this._transitionablePaint.setValue(t,e),this._handleSpecialPaintPropertyUpdate(t);var o=this._transitionablePaint._values[t].value;return o.isDataDriven()||a||n||this._handleOverridablePaintPropertyUpdate(t,s,o)},e.prototype._handleSpecialPaintPropertyUpdate=function(t){},e.prototype._handleOverridablePaintPropertyUpdate=function(t,e,r){return !1},e.prototype.isHidden=function(t){return !!(this.minzoom&&t=this.maxzoom)||"none"===this.visibility},e.prototype.updateTransitions=function(t){this._transitioningPaint=this._transitionablePaint.transitioned(t,this._transitioningPaint);},e.prototype.hasTransition=function(){return this._transitioningPaint.hasTransition()},e.prototype.recalculate=function(t,e){t.getCrossfadeParameters&&(this._crossfadeParameters=t.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(t,void 0,e)),this.paint=this._transitioningPaint.possiblyEvaluate(t,void 0,e);},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),b(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,i,n){return void 0===n&&(n={}),(!n||!1!==n.validate)&&ds(this,t.call(ps,{key:e,layerType:this.type,objectKey:r,value:i,styleSpec:Pa,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 Rs&&Jn(e.property.specification)&&("source"===e.value.kind||"composite"===e.value.kind)&&e.value.isStateDependent)return !0}return !1},e}(Ea),Zs={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array},Ys=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;},Ws=function(){this.isTransferred=!1,this.capacity=-1,this.resize(0);};function Qs(t,e){void 0===e&&(e=1);var r=0,i=0;return {members:t.map((function(t){var n=Zs[t.type].BYTES_PER_ELEMENT,a=r=$s(r,Math.max(e,n)),s=t.components||1;return i=Math.max(i,n),r+=n*s,{name:t.name,type:t.type,components:s,offset:a}})),size:$s(r,Math.max(i,e)),alignment:e}}function $s(t,e){return Math.ceil(t/e)*e}Ws.serialize=function(t,e){return t._trim(),e&&(t.isTransferred=!0,e.push(t.arrayBuffer)),{length:t.length,arrayBuffer:t.arrayBuffer}},Ws.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},Ws.prototype._trim=function(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews());},Ws.prototype.clear=function(){this.length=0;},Ws.prototype.resize=function(t){this.reserve(t),this.length=t;},Ws.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);}},Ws.prototype._refreshViews=function(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")};var to=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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 i=2*t;return this.int16[i+0]=e,this.int16[i+1]=r,t},e}(Ws);to.prototype.bytesPerElement=4,da("StructArrayLayout2i4",to);var eo=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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,i){var n=this.length;return this.resize(n+1),this.emplace(n,t,e,r,i)},e.prototype.emplace=function(t,e,r,i,n){var a=4*t;return this.int16[a+0]=e,this.int16[a+1]=r,this.int16[a+2]=i,this.int16[a+3]=n,t},e}(Ws);eo.prototype.bytesPerElement=8,da("StructArrayLayout4i8",eo);var ro=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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,i,n,a){var s=this.length;return this.resize(s+1),this.emplace(s,t,e,r,i,n,a)},e.prototype.emplace=function(t,e,r,i,n,a,s){var o=6*t;return this.int16[o+0]=e,this.int16[o+1]=r,this.int16[o+2]=i,this.int16[o+3]=n,this.int16[o+4]=a,this.int16[o+5]=s,t},e}(Ws);ro.prototype.bytesPerElement=12,da("StructArrayLayout2i4i12",ro);var io=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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,i,n,a){var s=this.length;return this.resize(s+1),this.emplace(s,t,e,r,i,n,a)},e.prototype.emplace=function(t,e,r,i,n,a,s){var o=4*t,u=8*t;return this.int16[o+0]=e,this.int16[o+1]=r,this.uint8[u+4]=i,this.uint8[u+5]=n,this.uint8[u+6]=a,this.uint8[u+7]=s,t},e}(Ws);io.prototype.bytesPerElement=8,da("StructArrayLayout2i4ub8",io);var no=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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 i=2*t;return this.float32[i+0]=e,this.float32[i+1]=r,t},e}(Ws);no.prototype.bytesPerElement=8,da("StructArrayLayout2f8",no);var ao=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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,i,n,a,s,o,u,h){var l=this.length;return this.resize(l+1),this.emplace(l,t,e,r,i,n,a,s,o,u,h)},e.prototype.emplace=function(t,e,r,i,n,a,s,o,u,h,l){var p=10*t;return this.uint16[p+0]=e,this.uint16[p+1]=r,this.uint16[p+2]=i,this.uint16[p+3]=n,this.uint16[p+4]=a,this.uint16[p+5]=s,this.uint16[p+6]=o,this.uint16[p+7]=u,this.uint16[p+8]=h,this.uint16[p+9]=l,t},e}(Ws);ao.prototype.bytesPerElement=20,da("StructArrayLayout10ui20",ao);var so=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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,i,n,a,s,o,u,h,l,p){var c=this.length;return this.resize(c+1),this.emplace(c,t,e,r,i,n,a,s,o,u,h,l,p)},e.prototype.emplace=function(t,e,r,i,n,a,s,o,u,h,l,p,c){var f=12*t;return this.int16[f+0]=e,this.int16[f+1]=r,this.int16[f+2]=i,this.int16[f+3]=n,this.uint16[f+4]=a,this.uint16[f+5]=s,this.uint16[f+6]=o,this.uint16[f+7]=u,this.int16[f+8]=h,this.int16[f+9]=l,this.int16[f+10]=p,this.int16[f+11]=c,t},e}(Ws);so.prototype.bytesPerElement=24,da("StructArrayLayout4i4ui4i24",so);var oo=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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 i=this.length;return this.resize(i+1),this.emplace(i,t,e,r)},e.prototype.emplace=function(t,e,r,i){var n=3*t;return this.float32[n+0]=e,this.float32[n+1]=r,this.float32[n+2]=i,t},e}(Ws);oo.prototype.bytesPerElement=12,da("StructArrayLayout3f12",oo);var uo=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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){return this.uint32[1*t+0]=e,t},e}(Ws);uo.prototype.bytesPerElement=4,da("StructArrayLayout1ul4",uo);var ho=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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,i,n,a,s,o,u){var h=this.length;return this.resize(h+1),this.emplace(h,t,e,r,i,n,a,s,o,u)},e.prototype.emplace=function(t,e,r,i,n,a,s,o,u,h){var l=10*t,p=5*t;return this.int16[l+0]=e,this.int16[l+1]=r,this.int16[l+2]=i,this.int16[l+3]=n,this.int16[l+4]=a,this.int16[l+5]=s,this.uint32[p+3]=o,this.uint16[l+8]=u,this.uint16[l+9]=h,t},e}(Ws);ho.prototype.bytesPerElement=20,da("StructArrayLayout6i1ul2ui20",ho);var lo=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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,i,n,a){var s=this.length;return this.resize(s+1),this.emplace(s,t,e,r,i,n,a)},e.prototype.emplace=function(t,e,r,i,n,a,s){var o=6*t;return this.int16[o+0]=e,this.int16[o+1]=r,this.int16[o+2]=i,this.int16[o+3]=n,this.int16[o+4]=a,this.int16[o+5]=s,t},e}(Ws);lo.prototype.bytesPerElement=12,da("StructArrayLayout2i2i2i12",lo);var po=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer);},e.prototype.emplaceBack=function(t,e,r,i,n){var a=this.length;return this.resize(a+1),this.emplace(a,t,e,r,i,n)},e.prototype.emplace=function(t,e,r,i,n,a){var s=4*t,o=8*t;return this.float32[s+0]=e,this.float32[s+1]=r,this.float32[s+2]=i,this.int16[o+6]=n,this.int16[o+7]=a,t},e}(Ws);po.prototype.bytesPerElement=16,da("StructArrayLayout2f1f2i16",po);var co=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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,i){var n=this.length;return this.resize(n+1),this.emplace(n,t,e,r,i)},e.prototype.emplace=function(t,e,r,i,n){var a=12*t,s=3*t;return this.uint8[a+0]=e,this.uint8[a+1]=r,this.float32[s+1]=i,this.float32[s+2]=n,t},e}(Ws);co.prototype.bytesPerElement=12,da("StructArrayLayout2ub2f12",co);var fo=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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 i=this.length;return this.resize(i+1),this.emplace(i,t,e,r)},e.prototype.emplace=function(t,e,r,i){var n=3*t;return this.uint16[n+0]=e,this.uint16[n+1]=r,this.uint16[n+2]=i,t},e}(Ws);fo.prototype.bytesPerElement=6,da("StructArrayLayout3ui6",fo);var yo=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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,i,n,a,s,o,u,h,l,p,c,f,y,d,m){var v=this.length;return this.resize(v+1),this.emplace(v,t,e,r,i,n,a,s,o,u,h,l,p,c,f,y,d,m)},e.prototype.emplace=function(t,e,r,i,n,a,s,o,u,h,l,p,c,f,y,d,m,v){var g=24*t,x=12*t,b=48*t;return this.int16[g+0]=e,this.int16[g+1]=r,this.uint16[g+2]=i,this.uint16[g+3]=n,this.uint32[x+2]=a,this.uint32[x+3]=s,this.uint32[x+4]=o,this.uint16[g+10]=u,this.uint16[g+11]=h,this.uint16[g+12]=l,this.float32[x+7]=p,this.float32[x+8]=c,this.uint8[b+36]=f,this.uint8[b+37]=y,this.uint8[b+38]=d,this.uint32[x+10]=m,this.int16[g+22]=v,t},e}(Ws);yo.prototype.bytesPerElement=48,da("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",yo);var mo=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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,i,n,a,s,o,u,h,l,p,c,f,y,d,m,v,g,x,b,_,w,M,S,A,k,I){var z=this.length;return this.resize(z+1),this.emplace(z,t,e,r,i,n,a,s,o,u,h,l,p,c,f,y,d,m,v,g,x,b,_,w,M,S,A,k,I)},e.prototype.emplace=function(t,e,r,i,n,a,s,o,u,h,l,p,c,f,y,d,m,v,g,x,b,_,w,M,S,A,k,I,z){var C=34*t,E=17*t;return this.int16[C+0]=e,this.int16[C+1]=r,this.int16[C+2]=i,this.int16[C+3]=n,this.int16[C+4]=a,this.int16[C+5]=s,this.int16[C+6]=o,this.int16[C+7]=u,this.uint16[C+8]=h,this.uint16[C+9]=l,this.uint16[C+10]=p,this.uint16[C+11]=c,this.uint16[C+12]=f,this.uint16[C+13]=y,this.uint16[C+14]=d,this.uint16[C+15]=m,this.uint16[C+16]=v,this.uint16[C+17]=g,this.uint16[C+18]=x,this.uint16[C+19]=b,this.uint16[C+20]=_,this.uint16[C+21]=w,this.uint16[C+22]=M,this.uint32[E+12]=S,this.float32[E+13]=A,this.float32[E+14]=k,this.float32[E+15]=I,this.float32[E+16]=z,t},e}(Ws);mo.prototype.bytesPerElement=68,da("StructArrayLayout8i15ui1ul4f68",mo);var vo=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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){return this.float32[1*t+0]=e,t},e}(Ws);vo.prototype.bytesPerElement=4,da("StructArrayLayout1f4",vo);var go=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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 i=this.length;return this.resize(i+1),this.emplace(i,t,e,r)},e.prototype.emplace=function(t,e,r,i){var n=3*t;return this.int16[n+0]=e,this.int16[n+1]=r,this.int16[n+2]=i,t},e}(Ws);go.prototype.bytesPerElement=6,da("StructArrayLayout3i6",go);var xo=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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 i=this.length;return this.resize(i+1),this.emplace(i,t,e,r)},e.prototype.emplace=function(t,e,r,i){var n=4*t;return this.uint32[2*t+0]=e,this.uint16[n+2]=r,this.uint16[n+3]=i,t},e}(Ws);xo.prototype.bytesPerElement=8,da("StructArrayLayout1ul2ui8",xo);var bo=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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 i=2*t;return this.uint16[i+0]=e,this.uint16[i+1]=r,t},e}(Ws);bo.prototype.bytesPerElement=4,da("StructArrayLayout2ui4",bo);var _o=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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){return this.uint16[1*t+0]=e,t},e}(Ws);_o.prototype.bytesPerElement=2,da("StructArrayLayout1ui2",_o);var wo=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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,i){var n=this.length;return this.resize(n+1),this.emplace(n,t,e,r,i)},e.prototype.emplace=function(t,e,r,i,n){var a=4*t;return this.float32[a+0]=e,this.float32[a+1]=r,this.float32[a+2]=i,this.float32[a+3]=n,t},e}(Ws);wo.prototype.bytesPerElement=16,da("StructArrayLayout4f16",wo);var Mo=function(t){function e(){t.apply(this,arguments);}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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},anchorPoint:{configurable:!0}};return r.anchorPointX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorPointY.get=function(){return this._structArray.int16[this._pos2+1]},r.x1.get=function(){return this._structArray.int16[this._pos2+2]},r.y1.get=function(){return this._structArray.int16[this._pos2+3]},r.x2.get=function(){return this._structArray.int16[this._pos2+4]},r.y2.get=function(){return this._structArray.int16[this._pos2+5]},r.featureIndex.get=function(){return this._structArray.uint32[this._pos4+3]},r.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+8]},r.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+9]},r.anchorPoint.get=function(){return new n(this.anchorPointX,this.anchorPointY)},Object.defineProperties(e.prototype,r),e}(Ys);Mo.prototype.size=20;var So=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.get=function(t){return new Mo(this,t)},e}(ho);da("CollisionBoxArray",So);var Ao=function(t){function e(){t.apply(this,arguments);}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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},associatedIconIndex:{configurable:!0}};return r.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},r.glyphStartIndex.get=function(){return this._structArray.uint16[this._pos2+2]},r.numGlyphs.get=function(){return this._structArray.uint16[this._pos2+3]},r.vertexStartIndex.get=function(){return this._structArray.uint32[this._pos4+2]},r.lineStartIndex.get=function(){return this._structArray.uint32[this._pos4+3]},r.lineLength.get=function(){return this._structArray.uint32[this._pos4+4]},r.segment.get=function(){return this._structArray.uint16[this._pos2+10]},r.lowerSize.get=function(){return this._structArray.uint16[this._pos2+11]},r.upperSize.get=function(){return this._structArray.uint16[this._pos2+12]},r.lineOffsetX.get=function(){return this._structArray.float32[this._pos4+7]},r.lineOffsetY.get=function(){return this._structArray.float32[this._pos4+8]},r.writingMode.get=function(){return this._structArray.uint8[this._pos1+36]},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;},r.associatedIconIndex.get=function(){return this._structArray.int16[this._pos2+22]},Object.defineProperties(e.prototype,r),e}(Ys);Ao.prototype.size=48;var ko=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.get=function(t){return new Ao(this,t)},e}(yo);da("PlacedSymbolArray",ko);var Io=function(t){function e(){t.apply(this,arguments);}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var r={anchorX:{configurable:!0},anchorY:{configurable:!0},rightJustifiedTextSymbolIndex:{configurable:!0},centerJustifiedTextSymbolIndex:{configurable:!0},leftJustifiedTextSymbolIndex:{configurable:!0},verticalPlacedTextSymbolIndex:{configurable:!0},placedIconSymbolIndex:{configurable:!0},verticalPlacedIconSymbolIndex:{configurable:!0},key:{configurable:!0},textBoxStartIndex:{configurable:!0},textBoxEndIndex:{configurable:!0},verticalTextBoxStartIndex:{configurable:!0},verticalTextBoxEndIndex:{configurable:!0},iconBoxStartIndex:{configurable:!0},iconBoxEndIndex:{configurable:!0},verticalIconBoxStartIndex:{configurable:!0},verticalIconBoxEndIndex:{configurable:!0},featureIndex:{configurable:!0},numHorizontalGlyphVertices:{configurable:!0},numVerticalGlyphVertices:{configurable:!0},numIconVertices:{configurable:!0},numVerticalIconVertices:{configurable:!0},useRuntimeCollisionCircles:{configurable:!0},crossTileID:{configurable:!0},textBoxScale:{configurable:!0},textOffset0:{configurable:!0},textOffset1:{configurable:!0},collisionCircleDiameter:{configurable:!0}};return r.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},r.rightJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+2]},r.centerJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+3]},r.leftJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+4]},r.verticalPlacedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+5]},r.placedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+6]},r.verticalPlacedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+7]},r.key.get=function(){return this._structArray.uint16[this._pos2+8]},r.textBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+9]},r.textBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+10]},r.verticalTextBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+11]},r.verticalTextBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+12]},r.iconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+13]},r.iconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+14]},r.verticalIconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+15]},r.verticalIconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+16]},r.featureIndex.get=function(){return this._structArray.uint16[this._pos2+17]},r.numHorizontalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+18]},r.numVerticalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+19]},r.numIconVertices.get=function(){return this._structArray.uint16[this._pos2+20]},r.numVerticalIconVertices.get=function(){return this._structArray.uint16[this._pos2+21]},r.useRuntimeCollisionCircles.get=function(){return this._structArray.uint16[this._pos2+22]},r.crossTileID.get=function(){return this._structArray.uint32[this._pos4+12]},r.crossTileID.set=function(t){this._structArray.uint32[this._pos4+12]=t;},r.textBoxScale.get=function(){return this._structArray.float32[this._pos4+13]},r.textOffset0.get=function(){return this._structArray.float32[this._pos4+14]},r.textOffset1.get=function(){return this._structArray.float32[this._pos4+15]},r.collisionCircleDiameter.get=function(){return this._structArray.float32[this._pos4+16]},Object.defineProperties(e.prototype,r),e}(Ys);Io.prototype.size=68;var zo=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.get=function(t){return new Io(this,t)},e}(mo);da("SymbolInstanceArray",zo);var Co=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getoffsetX=function(t){return this.float32[1*t+0]},e}(vo);da("GlyphOffsetArray",Co);var Eo=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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}(go);da("SymbolLineVertexArray",Eo);var Po=function(t){function e(){t.apply(this,arguments);}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+2]},r.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+3]},Object.defineProperties(e.prototype,r),e}(Ys);Po.prototype.size=8;var Bo=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.get=function(t){return new Po(this,t)},e}(xo);da("FeatureIndexArray",Bo);var To=Qs([{name:"a_pos",components:2,type:"Int16"}],4).members,Vo=function(t){void 0===t&&(t=[]),this.segments=t;};function Lo(t,e){return 256*(t=l(Math.floor(t),0,255))+l(Math.floor(e),0,255)}Vo.prototype.prepareSegment=function(t,e,r,i){var n=this.segments[this.segments.length-1];return t>Vo.MAX_VERTEX_ARRAY_LENGTH&&M("Max vertices per segment is "+Vo.MAX_VERTEX_ARRAY_LENGTH+": bucket requested "+t),(!n||n.vertexLength+t>Vo.MAX_VERTEX_ARRAY_LENGTH||n.sortKey!==i)&&(n={vertexOffset:e.length,primitiveOffset:r.length,vertexLength:0,primitiveLength:0},void 0!==i&&(n.sortKey=i),this.segments.push(n)),n},Vo.prototype.get=function(){return this.segments},Vo.prototype.destroy=function(){for(var t=0,e=this.segments;t>>16)*s&65535)<<16)&4294967295)<<15|u>>>17))*o+(((u>>>16)*o&65535)<<16)&4294967295)<<13|n>>>19))+((5*(n>>>16)&65535)<<16)&4294967295))+((58964+(a>>>16)&65535)<<16);switch(u=0,r){case 3:u^=(255&t.charCodeAt(h+2))<<16;case 2:u^=(255&t.charCodeAt(h+1))<<8;case 1:n^=u=(65535&(u=(u=(65535&(u^=255&t.charCodeAt(h)))*s+(((u>>>16)*s&65535)<<16)&4294967295)<<15|u>>>17))*o+(((u>>>16)*o&65535)<<16)&4294967295;}return n^=t.length,n=2246822507*(65535&(n^=n>>>16))+((2246822507*(n>>>16)&65535)<<16)&4294967295,n=3266489909*(65535&(n^=n>>>13))+((3266489909*(n>>>16)&65535)<<16)&4294967295,(n^=n>>>16)>>>0};})),Do=e((function(t){t.exports=function(t,e){for(var r,i=t.length,n=e^i,a=0;i>=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),n=1540483477*(65535&n)+((1540483477*(n>>>16)&65535)<<16)^(r=1540483477*(65535&(r^=r>>>24))+((1540483477*(r>>>16)&65535)<<16)),i-=4,++a;switch(i){case 3:n^=(255&t.charCodeAt(a+2))<<16;case 2:n^=(255&t.charCodeAt(a+1))<<8;case 1:n=1540483477*(65535&(n^=255&t.charCodeAt(a)))+((1540483477*(n>>>16)&65535)<<16);}return n=1540483477*(65535&(n^=n>>>13))+((1540483477*(n>>>16)&65535)<<16),(n^=n>>>15)>>>0};})),No=Oo,Ro=Do;No.murmur3=Oo,No.murmur2=Ro;var qo=function(){this.ids=[],this.positions=[],this.indexed=!1;};qo.prototype.add=function(t,e,r,i){this.ids.push(Uo(t)),this.positions.push(e,r,i);},qo.prototype.getPositions=function(t){for(var e=Uo(t),r=0,i=this.ids.length-1;r>1;this.ids[n]>=e?i=n:r=n+1;}for(var a=[];this.ids[r]===e;)a.push({index:this.positions[3*r],start:this.positions[3*r+1],end:this.positions[3*r+2]}),r++;return a},qo.serialize=function(t,e){var r=new Float64Array(t.ids),i=new Uint32Array(t.positions);return function t(e,r,i,n){for(;i>1],s=i-1,o=n+1;;){do{s++;}while(e[s]a);if(s>=o)break;Go(e,s,o),Go(r,3*s,3*o),Go(r,3*s+1,3*o+1),Go(r,3*s+2,3*o+2);}o-is.x+1||us.y+1)&&M("Geometry exceeds allowed extent, reduce your vector tile buffer size");}return r}function fu(t,e,r,i,n){t.emplaceBack(2*e+(i+1)/2,2*r+(n+1)/2);}var yu=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 to,this.indexArray=new fo,this.segments=new Vo,this.programConfigurations=new ou(t.layers,t.zoom),this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}));};function du(t,e){for(var r=0;r1){if(xu(t,e))return !0;for(var i=0;i1?r:r.sub(e)._mult(n)._add(e))}function Mu(t,e){for(var r,i,n,a=!1,s=0;se.y!=(n=r[u]).y>e.y&&e.x<(n.x-i.x)*(e.y-i.y)/(n.y-i.y)+i.x&&(a=!a);return a}function Su(t,e){for(var r=!1,i=0,n=t.length-1;ie.y!=s.y>e.y&&e.x<(s.x-a.x)*(e.y-a.y)/(s.y-a.y)+a.x&&(r=!r);}return r}function Au(t,e,r){var i=r[0],n=r[2];if(t.xn.x&&e.x>n.x||t.yn.y&&e.y>n.y)return !1;var a=S(t,e,r[0]);return a!==S(t,e,r[1])||a!==S(t,e,r[2])||a!==S(t,e,r[3])}function ku(t,e,r){var i=e.paint.get(t).value;return "constant"===i.kind?i.value:r.programConfigurations.get(e.id).getMaxValue(t)}function Iu(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function zu(t,e,r,i,a){if(!e[0]&&!e[1])return t;var s=n.convert(e)._mult(a);"viewport"===r&&s._rotate(-i);for(var o=[],u=0;u=8192||l<0||l>=8192)){var p=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,t.sortKey),c=p.vertexLength;fu(this.layoutVertexArray,h,l,-1,-1),fu(this.layoutVertexArray,h,l,1,-1),fu(this.layoutVertexArray,h,l,1,1),fu(this.layoutVertexArray,h,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,{},i);},da("CircleBucket",yu,{omit:["layers"]});var Cu=new Hs({"circle-sort-key":new Us(Pa.layout_circle["circle-sort-key"])}),Eu={paint:new Hs({"circle-radius":new Us(Pa.paint_circle["circle-radius"]),"circle-color":new Us(Pa.paint_circle["circle-color"]),"circle-blur":new Us(Pa.paint_circle["circle-blur"]),"circle-opacity":new Us(Pa.paint_circle["circle-opacity"]),"circle-translate":new js(Pa.paint_circle["circle-translate"]),"circle-translate-anchor":new js(Pa.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new js(Pa.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new js(Pa.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new Us(Pa.paint_circle["circle-stroke-width"]),"circle-stroke-color":new Us(Pa.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new Us(Pa.paint_circle["circle-stroke-opacity"])}),layout:Cu},Pu="undefined"!=typeof Float32Array?Float32Array:Array;function Bu(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function Tu(t,e,r){var i=e[0],n=e[1],a=e[2],s=e[3],o=e[4],u=e[5],h=e[6],l=e[7],p=e[8],c=e[9],f=e[10],y=e[11],d=e[12],m=e[13],v=e[14],g=e[15],x=r[0],b=r[1],_=r[2],w=r[3];return t[0]=x*i+b*o+_*p+w*d,t[1]=x*n+b*u+_*c+w*m,t[2]=x*a+b*h+_*f+w*v,t[3]=x*s+b*l+_*y+w*g,t[4]=(x=r[4])*i+(b=r[5])*o+(_=r[6])*p+(w=r[7])*d,t[5]=x*n+b*u+_*c+w*m,t[6]=x*a+b*h+_*f+w*v,t[7]=x*s+b*l+_*y+w*g,t[8]=(x=r[8])*i+(b=r[9])*o+(_=r[10])*p+(w=r[11])*d,t[9]=x*n+b*u+_*c+w*m,t[10]=x*a+b*h+_*f+w*v,t[11]=x*s+b*l+_*y+w*g,t[12]=(x=r[12])*i+(b=r[13])*o+(_=r[14])*p+(w=r[15])*d,t[13]=x*n+b*u+_*c+w*m,t[14]=x*a+b*h+_*f+w*v,t[15]=x*s+b*l+_*y+w*g,t}Math.hypot||(Math.hypot=function(){for(var t=arguments,e=0,r=arguments.length;r--;)e+=t[r]*t[r];return Math.sqrt(e)});var Vu,Lu=Tu;function Fu(t,e,r){var i=e[0],n=e[1],a=e[2],s=e[3];return t[0]=r[0]*i+r[4]*n+r[8]*a+r[12]*s,t[1]=r[1]*i+r[5]*n+r[9]*a+r[13]*s,t[2]=r[2]*i+r[6]*n+r[10]*a+r[14]*s,t[3]=r[3]*i+r[7]*n+r[11]*a+r[15]*s,t}Vu=new Pu(3),Pu!=Float32Array&&(Vu[0]=0,Vu[1]=0,Vu[2]=0),function(){var t=new Pu(4);Pu!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0);}();var Ou=(function(){var t=new Pu(2);Pu!=Float32Array&&(t[0]=0,t[1]=0);}(),function(t){function e(e){t.call(this,e,Eu);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.createBucket=function(t){return new yu(t)},e.prototype.queryRadius=function(t){var e=t;return ku("circle-radius",this,e)+ku("circle-stroke-width",this,e)+Iu(this.paint.get("circle-translate"))},e.prototype.queryIntersectsFeature=function(t,e,r,i,n,a,s,o){for(var u=zu(t,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),a.angle,s),h=this.paint.get("circle-radius").evaluate(e,r)+this.paint.get("circle-stroke-width").evaluate(e,r),l="map"===this.paint.get("circle-pitch-alignment"),p=l?u:function(t,e){return t.map((function(t){return Du(t,e)}))}(u,o),c=l?h*s:h,f=0,y=i;f80*r){i=a=t[0],n=s=t[1];for(var y=r;ya&&(a=o),u>s&&(s=u);h=0!==(h=Math.max(a-i,s-n))?1/h:0;}return Wu(c,f,r,i,n,h),f}function Zu(t,e,r,i,n){var a,s;if(n===xh(t,e,r,i)>0)for(a=e;a=e;a-=i)s=mh(a,t[a],t[a+1],s);return s&&lh(s,s.next)&&(vh(s),s=s.next),s}function Yu(t,e){if(!t)return t;e||(e=t);var r,i=t;do{if(r=!1,i.steiner||!lh(i,i.next)&&0!==hh(i.prev,i,i.next))i=i.next;else {if(vh(i),(i=e=i.prev)===i.next)break;r=!0;}}while(r||i!==e);return e}function Wu(t,e,r,i,n,a,s){if(t){!s&&a&&function(t,e,r,i){var n=t;do{null===n.z&&(n.z=ah(n.x,n.y,e,r,i)),n.prevZ=n.prev,n.nextZ=n.next,n=n.next;}while(n!==t);n.prevZ.nextZ=null,n.prevZ=null,function(t){var e,r,i,n,a,s,o,u,h=1;do{for(r=t,t=null,a=null,s=0;r;){for(s++,i=r,o=0,e=0;e0||u>0&&i;)0!==o&&(0===u||!i||r.z<=i.z)?(n=r,r=r.nextZ,o--):(n=i,i=i.nextZ,u--),a?a.nextZ=n:t=n,n.prevZ=a,a=n;r=i;}a.nextZ=null,h*=2;}while(s>1)}(n);}(t,i,n,a);for(var o,u,h=t;t.prev!==t.next;)if(o=t.prev,u=t.next,a?$u(t,i,n,a):Qu(t))e.push(o.i/r),e.push(t.i/r),e.push(u.i/r),vh(t),t=u.next,h=u.next;else if((t=u)===h){s?1===s?Wu(t=th(Yu(t),e,r),e,r,i,n,a,2):2===s&&eh(t,e,r,i,n,a):Wu(Yu(t),e,r,i,n,a,1);break}}}function Qu(t){var e=t.prev,r=t,i=t.next;if(hh(e,r,i)>=0)return !1;for(var n=t.next.next;n!==t.prev;){if(oh(e.x,e.y,r.x,r.y,i.x,i.y,n.x,n.y)&&hh(n.prev,n,n.next)>=0)return !1;n=n.next;}return !0}function $u(t,e,r,i){var n=t.prev,a=t,s=t.next;if(hh(n,a,s)>=0)return !1;for(var o=n.x>a.x?n.x>s.x?n.x:s.x:a.x>s.x?a.x:s.x,u=n.y>a.y?n.y>s.y?n.y:s.y:a.y>s.y?a.y:s.y,h=ah(n.x=h&&c&&c.z<=l;){if(p!==t.prev&&p!==t.next&&oh(n.x,n.y,a.x,a.y,s.x,s.y,p.x,p.y)&&hh(p.prev,p,p.next)>=0)return !1;if(p=p.prevZ,c!==t.prev&&c!==t.next&&oh(n.x,n.y,a.x,a.y,s.x,s.y,c.x,c.y)&&hh(c.prev,c,c.next)>=0)return !1;c=c.nextZ;}for(;p&&p.z>=h;){if(p!==t.prev&&p!==t.next&&oh(n.x,n.y,a.x,a.y,s.x,s.y,p.x,p.y)&&hh(p.prev,p,p.next)>=0)return !1;p=p.prevZ;}for(;c&&c.z<=l;){if(c!==t.prev&&c!==t.next&&oh(n.x,n.y,a.x,a.y,s.x,s.y,c.x,c.y)&&hh(c.prev,c,c.next)>=0)return !1;c=c.nextZ;}return !0}function th(t,e,r){var i=t;do{var n=i.prev,a=i.next.next;!lh(n,a)&&ph(n,i,i.next,a)&&yh(n,a)&&yh(a,n)&&(e.push(n.i/r),e.push(i.i/r),e.push(a.i/r),vh(i),vh(i.next),i=t=a),i=i.next;}while(i!==t);return Yu(i)}function eh(t,e,r,i,n,a){var s=t;do{for(var o=s.next.next;o!==s.prev;){if(s.i!==o.i&&uh(s,o)){var u=dh(s,o);return s=Yu(s,s.next),u=Yu(u,u.next),Wu(s,e,r,i,n,a),void Wu(u,e,r,i,n,a)}o=o.next;}s=s.next;}while(s!==t)}function rh(t,e){return t.x-e.x}function ih(t,e){if(e=function(t,e){var r,i=e,n=t.x,a=t.y,s=-1/0;do{if(a<=i.y&&a>=i.next.y&&i.next.y!==i.y){var o=i.x+(a-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(o<=n&&o>s){if(s=o,o===n){if(a===i.y)return i;if(a===i.next.y)return i.next}r=i.x=i.x&&i.x>=l&&n!==i.x&&oh(ar.x||i.x===r.x&&nh(r,i)))&&(r=i,c=u)),i=i.next;}while(i!==h);return r}(t,e)){var r=dh(e,t);Yu(e,e.next),Yu(r,r.next);}}function nh(t,e){return hh(t.prev,t,e.prev)<0&&hh(e.next,t,t.next)<0}function ah(t,e,r,i,n){return (t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-r)*n)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-i)*n)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function sh(t){var e=t,r=t;do{(e.x=0&&(t-s)*(i-o)-(r-s)*(e-o)>=0&&(r-s)*(a-o)-(n-s)*(i-o)>=0}function uh(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&&ph(r,r.next,t,e))return !0;r=r.next;}while(r!==t);return !1}(t,e)&&(yh(t,e)&&yh(e,t)&&function(t,e){var r=t,i=!1,n=(t.x+e.x)/2,a=(t.y+e.y)/2;do{r.y>a!=r.next.y>a&&r.next.y!==r.y&&n<(r.next.x-r.x)*(a-r.y)/(r.next.y-r.y)+r.x&&(i=!i),r=r.next;}while(r!==t);return i}(t,e)&&(hh(t.prev,t,e.prev)||hh(t,e.prev,e))||lh(t,e)&&hh(t.prev,t,t.next)>0&&hh(e.prev,e,e.next)>0)}function hh(t,e,r){return (e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function lh(t,e){return t.x===e.x&&t.y===e.y}function ph(t,e,r,i){var n=fh(hh(t,e,r)),a=fh(hh(t,e,i)),s=fh(hh(r,i,t)),o=fh(hh(r,i,e));return n!==a&&s!==o||!(0!==n||!ch(t,r,e))||!(0!==a||!ch(t,i,e))||!(0!==s||!ch(r,t,i))||!(0!==o||!ch(r,e,i))}function ch(t,e,r){return e.x<=Math.max(t.x,r.x)&&e.x>=Math.min(t.x,r.x)&&e.y<=Math.max(t.y,r.y)&&e.y>=Math.min(t.y,r.y)}function fh(t){return t>0?1:t<0?-1:0}function yh(t,e){return hh(t.prev,t,t.next)<0?hh(t,e,t.next)>=0&&hh(t,t.prev,e)>=0:hh(t,e,t.prev)<0||hh(t,t.next,e)<0}function dh(t,e){var r=new gh(t.i,t.x,t.y),i=new gh(e.i,e.x,e.y),n=t.next,a=e.prev;return t.next=e,e.prev=t,r.next=n,n.prev=r,i.next=r,r.prev=i,a.next=i,i.prev=a,i}function mh(t,e,r,i){var n=new gh(t,e,r);return i?(n.next=i.next,n.prev=i,i.next.prev=n,i.next=n):(n.prev=n,n.next=n),n}function vh(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 gh(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 xh(t,e,r,i){for(var n=0,a=e,s=r-i;ai;){if(n-i>600){var s=n-i+1,o=r-i+1,u=Math.log(s),h=.5*Math.exp(2*u/3),l=.5*Math.sqrt(u*h*(s-h)/s)*(o-s/2<0?-1:1);t(e,r,Math.max(i,Math.floor(r-o*h/s+l)),Math.min(n,Math.floor(r+(s-o)*h/s+l)),a);}var p=e[r],c=i,f=n;for(_h(e,i,r),a(e[n],p)>0&&_h(e,i,n);c0;)f--;}0===a(e[i],p)?_h(e,i,f):_h(e,++f,n),f<=r&&(i=f+1),r<=f&&(n=f-1);}}(t,e,r||0,i||t.length-1,n||wh);}function _h(t,e,r){var i=t[e];t[e]=t[r],t[r]=i;}function wh(t,e){return te?1:0}function Mh(t,e){var r=t.length;if(r<=1)return [t];for(var i,n,a=[],s=0;s1)for(var u=0;u0&&r.holes.push(i+=t[n-1].length);}return r},Xu.default=Hu;var Ih=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 to,this.indexArray=new fo,this.indexArray2=new bo,this.programConfigurations=new ou(t.layers,t.zoom),this.segments=new Vo,this.segments2=new Vo,this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}));};Ih.prototype.populate=function(t,e,r){this.hasPattern=Ah("fill",this.layers,e);for(var i=this.layers[0].layout.get("fill-sort-key"),n=[],a=0,s=t;a>3;}if(a--,1===i||2===i)s+=t.readSVarint(),o+=t.readSVarint(),1===i&&(e&&u.push(e),e=[]),e.push(new n(s,o));else {if(7!==i)throw new Error("unknown command "+i);e&&e.push(e[0].clone());}}return e&&u.push(e),u},Th.prototype.bbox=function(){var t=this._pbf;t.pos=this._geometry;for(var e=t.readVarint()+t.pos,r=1,i=0,n=0,a=0,s=1/0,o=-1/0,u=1/0,h=-1/0;t.pos>3;}if(i--,1===r||2===r)(n+=t.readSVarint())o&&(o=n),(a+=t.readSVarint())h&&(h=a);else if(7!==r)throw new Error("unknown command "+r)}return [s,u,o,h]},Th.prototype.toGeoJSON=function(t,e,r,i){var n,a,s=this.extent*Math.pow(2,r),o=this.extent*t,u=this.extent*e,h=this.loadGeometry(),l=Th.types[this.type];function p(t){for(var e=0;e>3;e=1===i?t.readString():2===i?t.readFloat():3===i?t.readDouble():4===i?t.readVarint64():5===i?t.readVarint():6===i?t.readSVarint():7===i?t.readBoolean():null;}return e}(r));}function Nh(t,e,r){if(3===t){var i=new Fh(r,r.readVarint()+r.pos);i.length&&(e[i.name]=i);}}Oh.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 Bh(this._pbf,e,this.extent,this._keys,this._values)};var Rh={VectorTile:function(t,e){this.layers=t.readFields(Nh,{},e);},VectorTileFeature:Bh,VectorTileLayer:Fh},qh=Rh.VectorTileFeature.types,jh=Math.pow(2,13);function Uh(t,e,r,i,n,a,s,o){t.emplaceBack(e,r,2*Math.floor(i*jh)+s,n*jh*2,a*jh*2,Math.round(o));}var Gh=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 ro,this.indexArray=new fo,this.programConfigurations=new ou(t.layers,t.zoom),this.segments=new Vo,this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}));};function Kh(t,e){return t.x===e.x&&(t.x<0||t.x>8192)||t.y===e.y&&(t.y<0||t.y>8192)}Gh.prototype.populate=function(t,e,r){this.features=[],this.hasPattern=Ah("fill-extrusion",this.layers,e);for(var i=0,n=t;i8192}))||B.every((function(t){return t.y<0}))||B.every((function(t){return t.y>8192}))))for(var d=0,m=0;m=1){var g=y[m-1];if(!Kh(v,g)){p.vertexLength+4>Vo.MAX_VERTEX_ARRAY_LENGTH&&(p=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));var x=v.sub(g)._perp()._unit(),b=g.dist(v);d+b>32768&&(d=0),Uh(this.layoutVertexArray,v.x,v.y,x.x,x.y,0,0,d),Uh(this.layoutVertexArray,v.x,v.y,x.x,x.y,0,1,d),Uh(this.layoutVertexArray,g.x,g.y,x.x,x.y,0,0,d+=b),Uh(this.layoutVertexArray,g.x,g.y,x.x,x.y,0,1,d);var _=p.vertexLength;this.indexArray.emplaceBack(_,_+2,_+1),this.indexArray.emplaceBack(_+1,_+2,_+3),p.vertexLength+=4,p.primitiveLength+=2;}}}}if(p.vertexLength+u>Vo.MAX_VERTEX_ARRAY_LENGTH&&(p=this.segments.prepareSegment(u,this.layoutVertexArray,this.indexArray)),"Polygon"===qh[t.type]){for(var w=[],M=[],S=p.vertexLength,A=0,k=o;A=2&&t[u-1].equals(t[u-2]);)u--;for(var h=0;h0;if(M&&v>h){var A=l.dist(f);if(A>2*p){var k=l.sub(l.sub(f)._mult(p/A)._round());this.updateDistance(f,k),this.addCurrentVertex(k,d,0,0,c),f=k;}}var I=f&&y,z=I?r:o?"butt":i;if(I&&"round"===z&&(_n&&(z="bevel"),"bevel"===z&&(_>2&&(z="flipbevel"),_100)g=m.mult(-1);else {var C=_*d.add(m).mag()/d.sub(m).mag();g._perp()._mult(C*(S?-1:1));}this.addCurrentVertex(l,g,0,0,c),this.addCurrentVertex(l,g.mult(-1),0,0,c);}else if("bevel"===z||"fakeround"===z){var E=-Math.sqrt(_*_-1),P=S?E:0,B=S?0:E;if(f&&this.addCurrentVertex(l,d,P,B,c),"fakeround"===z)for(var T=Math.round(180*w/Math.PI/20),V=1;V2*p){var R=l.add(y.sub(l)._mult(p/N)._round());this.updateDistance(l,R),this.addCurrentVertex(R,m,0,0,c),l=R;}}}}},el.prototype.addCurrentVertex=function(t,e,r,i,n,a){void 0===a&&(a=!1);var s=e.y*i-e.x,o=-e.y-e.x*i;this.addHalfVertex(t,e.x+e.y*r,e.y-e.x*r,a,!1,r,n),this.addHalfVertex(t,s,o,a,!0,-i,n),this.distance>tl/2&&0===this.totalDistance&&(this.distance=0,this.addCurrentVertex(t,e,r,i,n,a));},el.prototype.addHalfVertex=function(t,e,r,i,n,a,s){var o=.5*(this.lineClips?this.scaledDistance*(tl-1):this.scaledDistance);this.layoutVertexArray.emplaceBack((t.x<<1)+(i?1:0),(t.y<<1)+(n?1:0),Math.round(63*e)+128,Math.round(63*r)+128,1+(0===a?0:a<0?-1:1)|(63&o)<<2,o>>6),this.lineClips&&this.layoutVertexArray2.emplaceBack((this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start),this.lineClipsArray.length);var u=s.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,u),s.primitiveLength++),n?this.e2=u:this.e1=u;},el.prototype.updateScaledDistance=function(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance;},el.prototype.updateDistance=function(t,e){this.distance+=t.dist(e),this.updateScaledDistance();},da("LineBucket",el,{omit:["layers","patternFeatures"]});var rl=new Hs({"line-cap":new js(Pa.layout_line["line-cap"]),"line-join":new Us(Pa.layout_line["line-join"]),"line-miter-limit":new js(Pa.layout_line["line-miter-limit"]),"line-round-limit":new js(Pa.layout_line["line-round-limit"]),"line-sort-key":new Us(Pa.layout_line["line-sort-key"])}),il={paint:new Hs({"line-opacity":new Us(Pa.paint_line["line-opacity"]),"line-color":new Us(Pa.paint_line["line-color"]),"line-translate":new js(Pa.paint_line["line-translate"]),"line-translate-anchor":new js(Pa.paint_line["line-translate-anchor"]),"line-width":new Us(Pa.paint_line["line-width"]),"line-gap-width":new Us(Pa.paint_line["line-gap-width"]),"line-offset":new Us(Pa.paint_line["line-offset"]),"line-blur":new Us(Pa.paint_line["line-blur"]),"line-dasharray":new Ks(Pa.paint_line["line-dasharray"]),"line-pattern":new Gs(Pa.paint_line["line-pattern"]),"line-gradient":new Xs(Pa.paint_line["line-gradient"])}),layout:rl},nl=new(function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.possiblyEvaluate=function(e,r){return r=new Ts(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,i,n){return r=c({},r,{zoom:Math.floor(r.zoom)}),t.prototype.evaluate.call(this,e,r,i,n)},e}(Us))(il.paint.properties["line-width"].specification);nl.useIntegerZoom=!0;var al=function(t){function e(e){t.call(this,e,il),this.gradientVersion=0;}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._handleSpecialPaintPropertyUpdate=function(t){"line-gradient"===t&&(this.stepInterpolant=this._transitionablePaint._values["line-gradient"].value.expression._styleExpression.expression instanceof nn,this.gradientVersion=(this.gradientVersion+1)%o);},e.prototype.gradientExpression=function(){return this._transitionablePaint._values["line-gradient"].value.expression},e.prototype.recalculate=function(e,r){t.prototype.recalculate.call(this,e,r),this.paint._values["line-floorwidth"]=nl.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,e);},e.prototype.createBucket=function(t){return new el(t)},e.prototype.queryRadius=function(t){var e=t,r=sl(ku("line-width",this,e),ku("line-gap-width",this,e)),i=ku("line-offset",this,e);return r/2+Math.abs(i)+Iu(this.paint.get("line-translate"))},e.prototype.queryIntersectsFeature=function(t,e,r,i,a,s,o){var u=zu(t,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),s.angle,o),h=o/2*sl(this.paint.get("line-width").evaluate(e,r),this.paint.get("line-gap-width").evaluate(e,r)),l=this.paint.get("line-offset").evaluate(e,r);return l&&(i=function(t,e){for(var r=[],i=new n(0,0),a=0;a=3)for(var a=0;a0?e+2*t:t}var ol=Qs([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),ul=Qs([{name:"a_projected_pos",components:3,type:"Float32"}],4),hl=(Qs([{name:"a_fade_opacity",components:1,type:"Uint32"}],4),Qs([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}])),ll=(Qs([{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"}]),Qs([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4)),pl=Qs([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function cl(t,e,r){return t.sections.forEach((function(t){t.text=function(t,e,r){var i=e.layout.get("text-transform").evaluate(r,{});return "uppercase"===i?t=t.toLocaleUpperCase():"lowercase"===i&&(t=t.toLocaleLowerCase()),Bs.applyArabicShaping&&(t=Bs.applyArabicShaping(t)),t}(t.text,e,r);})),t}Qs([{name:"triangle",components:3,type:"Uint16"}]),Qs([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Uint16",name:"glyphStartIndex"},{type:"Uint16",name:"numGlyphs"},{type:"Uint32",name:"vertexStartIndex"},{type:"Uint32",name:"lineStartIndex"},{type:"Uint32",name:"lineLength"},{type:"Uint16",name:"segment"},{type:"Uint16",name:"lowerSize"},{type:"Uint16",name:"upperSize"},{type:"Float32",name:"lineOffsetX"},{type:"Float32",name:"lineOffsetY"},{type:"Uint8",name:"writingMode"},{type:"Uint8",name:"placedOrientation"},{type:"Uint8",name:"hidden"},{type:"Uint32",name:"crossTileID"},{type:"Int16",name:"associatedIconIndex"}]),Qs([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Int16",name:"rightJustifiedTextSymbolIndex"},{type:"Int16",name:"centerJustifiedTextSymbolIndex"},{type:"Int16",name:"leftJustifiedTextSymbolIndex"},{type:"Int16",name:"verticalPlacedTextSymbolIndex"},{type:"Int16",name:"placedIconSymbolIndex"},{type:"Int16",name:"verticalPlacedIconSymbolIndex"},{type:"Uint16",name:"key"},{type:"Uint16",name:"textBoxStartIndex"},{type:"Uint16",name:"textBoxEndIndex"},{type:"Uint16",name:"verticalTextBoxStartIndex"},{type:"Uint16",name:"verticalTextBoxEndIndex"},{type:"Uint16",name:"iconBoxStartIndex"},{type:"Uint16",name:"iconBoxEndIndex"},{type:"Uint16",name:"verticalIconBoxStartIndex"},{type:"Uint16",name:"verticalIconBoxEndIndex"},{type:"Uint16",name:"featureIndex"},{type:"Uint16",name:"numHorizontalGlyphVertices"},{type:"Uint16",name:"numVerticalGlyphVertices"},{type:"Uint16",name:"numIconVertices"},{type:"Uint16",name:"numVerticalIconVertices"},{type:"Uint16",name:"useRuntimeCollisionCircles"},{type:"Uint32",name:"crossTileID"},{type:"Float32",name:"textBoxScale"},{type:"Float32",components:2,name:"textOffset"},{type:"Float32",name:"collisionCircleDiameter"}]),Qs([{type:"Float32",name:"offsetX"}]),Qs([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]);var fl={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"},yl=function(t,e,r,i,n){var a,s,o=8*n-i-1,u=(1<>1,l=-7,p=r?n-1:0,c=r?-1:1,f=t[e+p];for(p+=c,a=f&(1<<-l)-1,f>>=-l,l+=o;l>0;a=256*a+t[e+p],p+=c,l-=8);for(s=a&(1<<-l)-1,a>>=-l,l+=i;l>0;s=256*s+t[e+p],p+=c,l-=8);if(0===a)a=1-h;else {if(a===u)return s?NaN:1/0*(f?-1:1);s+=Math.pow(2,i),a-=h;}return (f?-1:1)*s*Math.pow(2,a-i)},dl=function(t,e,r,i,n,a){var s,o,u,h=8*a-n-1,l=(1<>1,c=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,f=i?0:a-1,y=i?1:-1,d=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(o=isNaN(e)?1:0,s=l):(s=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-s))<1&&(s--,u*=2),(e+=s+p>=1?c/u:c*Math.pow(2,1-p))*u>=2&&(s++,u/=2),s+p>=l?(o=0,s=l):s+p>=1?(o=(e*u-1)*Math.pow(2,n),s+=p):(o=e*Math.pow(2,p-1)*Math.pow(2,n),s=0));n>=8;t[r+f]=255&o,f+=y,o/=256,n-=8);for(s=s<0;t[r+f]=255&s,f+=y,s/=256,h-=8);t[r+f-y]|=128*d;},ml=vl;function vl(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length;}vl.Varint=0,vl.Fixed64=1,vl.Bytes=2,vl.Fixed32=5;var gl="undefined"==typeof TextDecoder?null:new TextDecoder("utf8");function xl(t){return t.type===vl.Bytes?t.readVarint()+t.pos:t.pos+1}function bl(t,e,r){return r?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function _l(t,e,r){var i=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));r.realloc(i);for(var n=r.pos-1;n>=t;n--)r.buf[n+i]=r.buf[n];}function wl(t,e){for(var r=0;r>>8,t[r+2]=e>>>16,t[r+3]=e>>>24;}function Tl(t,e){return (t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}function Vl(t,e,r){1===t&&r.readMessage(Ll,e);}function Ll(t,e,r){if(3===t){var i=r.readMessage(Fl,{}),n=i.width,a=i.height,s=i.left,o=i.top,u=i.advance;e.push({id:i.id,bitmap:new Sa({width:n+6,height:a+6},i.bitmap),metrics:{width:n,height:a,left:s,top:o,advance:u}});}}function Fl(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());}function Ol(t){for(var e=0,r=0,i=0,n=t;i=0;c--){var f=s[c];if(!(p.w>f.w||p.h>f.h)){if(p.x=f.x,p.y=f.y,u=Math.max(u,p.y+p.h),o=Math.max(o,p.x+p.w),p.w===f.w&&p.h===f.h){var y=s.pop();c>3,a=this.pos;this.type=7&i,t(n,e,this),this.pos===a&&this.skip(i);}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=Pl(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=Tl(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=Pl(this.buf,this.pos)+4294967296*Pl(this.buf,this.pos+4);return this.pos+=8,t},readSFixed64:function(){var t=Pl(this.buf,this.pos)+4294967296*Tl(this.buf,this.pos+4);return this.pos+=8,t},readFloat:function(){var t=yl(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=yl(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var e,r,i=this.buf;return e=127&(r=i[this.pos++]),r<128?e:(e|=(127&(r=i[this.pos++]))<<7,r<128?e:(e|=(127&(r=i[this.pos++]))<<14,r<128?e:(e|=(127&(r=i[this.pos++]))<<21,r<128?e:function(t,e,r){var i,n,a=r.buf;if(i=(112&(n=a[r.pos++]))>>4,n<128)return bl(t,i,e);if(i|=(127&(n=a[r.pos++]))<<3,n<128)return bl(t,i,e);if(i|=(127&(n=a[r.pos++]))<<10,n<128)return bl(t,i,e);if(i|=(127&(n=a[r.pos++]))<<17,n<128)return bl(t,i,e);if(i|=(127&(n=a[r.pos++]))<<24,n<128)return bl(t,i,e);if(i|=(1&(n=a[r.pos++]))<<31,n<128)return bl(t,i,e);throw new Error("Expected varint not more than 10 bytes")}(e|=(15&(r=i[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=this.pos;return this.pos=t,t-e>=12&&gl?function(t,e,r){return gl.decode(t.subarray(e,r))}(this.buf,e,t):function(t,e,r){for(var i="",n=e;n239?4:u>223?3:u>191?2:1;if(n+l>r)break;1===l?u<128&&(h=u):2===l?128==(192&(a=t[n+1]))&&(h=(31&u)<<6|63&a)<=127&&(h=null):3===l?(s=t[n+2],128==(192&(a=t[n+1]))&&128==(192&s)&&((h=(15&u)<<12|(63&a)<<6|63&s)<=2047||h>=55296&&h<=57343)&&(h=null)):4===l&&(s=t[n+2],o=t[n+3],128==(192&(a=t[n+1]))&&128==(192&s)&&128==(192&o)&&((h=(15&u)<<18|(63&a)<<12|(63&s)<<6|63&o)<=65535||h>=1114112)&&(h=null)),null===h?(h=65533,l=1):h>65535&&(h-=65536,i+=String.fromCharCode(h>>>10&1023|55296),h=56320|1023&h),i+=String.fromCharCode(h),n+=l;}return i}(this.buf,e,t)},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!==vl.Bytes)return t.push(this.readVarint(e));var r=xl(this);for(t=t||[];this.pos127;);else if(e===vl.Bytes)this.pos=this.readVarint()+this.pos;else if(e===vl.Fixed32)this.pos+=4;else {if(e!==vl.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,i;if(t>=0?(r=t%4294967296|0,i=t/4294967296|0):(i=~(-t/4294967296),4294967295^(r=~(-t%4294967296))?r=r+1|0:(r=0,i=i+1|0)),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,r.buf[r.pos]=127&(t>>>=7);}(r,0,e),function(t,e){var r=(7&t)<<4;e.buf[e.pos++]|=r|((t>>>=3)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t)))));}(i,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 i,n,a=0;a55295&&i<57344){if(!n){i>56319||a+1===e.length?(t[r++]=239,t[r++]=191,t[r++]=189):n=i;continue}if(i<56320){t[r++]=239,t[r++]=191,t[r++]=189,n=i;continue}i=n-55296<<10|i-56320|65536,n=null;}else n&&(t[r++]=239,t[r++]=191,t[r++]=189,n=null);i<128?t[r++]=i:(i<2048?t[r++]=i>>6|192:(i<65536?t[r++]=i>>12|224:(t[r++]=i>>18|240,t[r++]=i>>12&63|128),t[r++]=i>>6&63|128),t[r++]=63&i|128);}return r}(this.buf,t,this.pos);var r=this.pos-e;r>=128&&_l(e,r,this),this.pos=e-1,this.writeVarint(r),this.pos+=r;},writeFloat:function(t){this.realloc(4),dl(this.buf,t,this.pos,!0,23,4),this.pos+=4;},writeDouble:function(t){this.realloc(8),dl(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&&_l(r,i,this),this.pos=r-1,this.writeVarint(i),this.pos+=i;},writeMessage:function(t,e,r){this.writeTag(t,vl.Bytes),this.writeRawMessage(e,r);},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,wl,e);},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,Ml,e);},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,kl,e);},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,Sl,e);},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,Al,e);},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,Il,e);},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,zl,e);},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,Cl,e);},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,El,e);},writeBytesField:function(t,e){this.writeTag(t,vl.Bytes),this.writeBytes(e);},writeFixed32Field:function(t,e){this.writeTag(t,vl.Fixed32),this.writeFixed32(e);},writeSFixed32Field:function(t,e){this.writeTag(t,vl.Fixed32),this.writeSFixed32(e);},writeFixed64Field:function(t,e){this.writeTag(t,vl.Fixed64),this.writeFixed64(e);},writeSFixed64Field:function(t,e){this.writeTag(t,vl.Fixed64),this.writeSFixed64(e);},writeVarintField:function(t,e){this.writeTag(t,vl.Varint),this.writeVarint(e);},writeSVarintField:function(t,e){this.writeTag(t,vl.Varint),this.writeSVarint(e);},writeStringField:function(t,e){this.writeTag(t,vl.Bytes),this.writeString(e);},writeFloatField:function(t,e){this.writeTag(t,vl.Fixed32),this.writeFloat(e);},writeDoubleField:function(t,e){this.writeTag(t,vl.Fixed64),this.writeDouble(e);},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e));}};var Dl=function(t,e){var r=e.pixelRatio,i=e.version,n=e.stretchX,a=e.stretchY,s=e.content;this.paddedRect=t,this.pixelRatio=r,this.stretchX=n,this.stretchY=a,this.content=s,this.version=i;},Nl={tl:{configurable:!0},br:{configurable:!0},tlbr:{configurable:!0},displaySize:{configurable:!0}};Nl.tl.get=function(){return [this.paddedRect.x+1,this.paddedRect.y+1]},Nl.br.get=function(){return [this.paddedRect.x+this.paddedRect.w-1,this.paddedRect.y+this.paddedRect.h-1]},Nl.tlbr.get=function(){return this.tl.concat(this.br)},Nl.displaySize.get=function(){return [(this.paddedRect.w-2)/this.pixelRatio,(this.paddedRect.h-2)/this.pixelRatio]},Object.defineProperties(Dl.prototype,Nl);var Rl=function(t,e){var r={},i={};this.haveRenderCallbacks=[];var n=[];this.addImages(t,r,n),this.addImages(e,i,n);var a=Ol(n),s=new Aa({width:a.w||1,height:a.h||1});for(var o in t){var u=t[o],h=r[o].paddedRect;Aa.copy(u.data,s,{x:0,y:0},{x:h.x+1,y:h.y+1},u.data);}for(var l in e){var p=e[l],c=i[l].paddedRect,f=c.x+1,y=c.y+1,d=p.data.width,m=p.data.height;Aa.copy(p.data,s,{x:0,y:0},{x:f,y:y},p.data),Aa.copy(p.data,s,{x:0,y:m-1},{x:f,y:y+m},{width:d,height:1}),Aa.copy(p.data,s,{x:0,y:0},{x:f,y:y-1},{width:d,height:1}),Aa.copy(p.data,s,{x:d-1,y:0},{x:f+d,y:y},{width:1,height:m}),Aa.copy(p.data,s,{x:0,y:0},{x:f-1,y:y},{width:1,height:m}),Aa.copy(p.data,s,{x:0,y:0},{x:0,y:y-1},{width:1,height:1}),Aa.copy(p.data,s,{x:d-1,y:0},{x:f+d,y:y-1},{width:1,height:1}),Aa.copy(p.data,s,{x:d-1,y:m-1},{x:f+d,y:y+m},{width:1,height:1}),Aa.copy(p.data,s,{x:0,y:m-1},{x:0,y:y+m},{width:1,height:1});}this.image=s,this.iconPositions=r,this.patternPositions=i;};Rl.prototype.addImages=function(t,e,r){for(var i in t){var n=t[i],a={x:0,y:0,w:n.data.width+2,h:n.data.height+2};r.push(a),e[i]=new Dl(a,n),n.hasRenderCallback&&this.haveRenderCallbacks.push(i);}},Rl.prototype.patchUpdatedImages=function(t,e){for(var r in t.dispatchRenderCallbacks(this.haveRenderCallbacks),t.updatedImages)this.patchUpdatedImage(this.iconPositions[r],t.getImage(r),e),this.patchUpdatedImage(this.patternPositions[r],t.getImage(r),e);},Rl.prototype.patchUpdatedImage=function(t,e,r){if(t&&e&&t.version!==e.version){t.version=e.version;var i=t.tl;r.update(e.data,void 0,{x:i[0],y:i[1]});}},da("ImagePosition",Dl),da("ImageAtlas",Rl);var ql={horizontal:1,vertical:2,horizontalOnly:3},jl=function(){this.scale=1,this.fontStack="",this.imageName=null;};jl.forText=function(t,e){var r=new jl;return r.scale=t||1,r.fontStack=e,r},jl.forImage=function(t){var e=new jl;return e.imageName=t,e};var Ul=function(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null;};function Gl(t,e,r,i,n,a,s,o,u,h,l,p,c,f,y,d){var m,v=Ul.fromFeature(t,n);p===ql.vertical&&v.verticalizePunctuation();var g=Bs.processBidirectionalText,x=Bs.processStyledBidirectionalText;if(g&&1===v.sections.length){m=[];for(var b=0,_=g(v.toString(),Wl(v,h,a,e,i,f,y));b<_.length;b+=1){var w=_[b],M=new Ul;M.text=w,M.sections=v.sections;for(var S=0;S0&&D>A&&(A=D);}else {var N=r[I.fontStack],R=N&&N[C];if(R&&R.rect)B=R.rect,P=R.metrics;else {var q=e[I.fontStack],j=q&&q[C];if(!j)continue;P=j.metrics;}E=24*(_-I.scale);}L?(t.verticalizable=!0,S.push({glyph:C,imageName:T,x:c,y:f+E,vertical:L,scale:I.scale,fontStack:I.fontStack,sectionIndex:z,metrics:P,rect:B}),c+=V*I.scale+h):(S.push({glyph:C,imageName:T,x:c,y:f+E,vertical:L,scale:I.scale,fontStack:I.fontStack,sectionIndex:z,metrics:P,rect:B}),c+=P.advance*I.scale+h);}0!==S.length&&(y=Math.max(c-h,y),$l(S,0,S.length-1,m,A)),c=0;var U=a*_+A;M.lineOffset=Math.max(A,w),f+=U,d=Math.max(U,d),++v;}else f+=a,++v;}var G,K=f- -17,X=Ql(s),H=X.horizontalAlign,J=X.verticalAlign;(function(t,e,r,i,n,a,s,o,u){var h,l=(e-r)*n;h=a!==s?-o*i- -17:(-i*u+.5)*s;for(var p=0,c=t;p=0&&i>=t&&Kl[this.text.charCodeAt(i)];i--)r--;this.text=this.text.substring(t,r),this.sectionIndex=this.sectionIndex.slice(t,r);},Ul.prototype.substring=function(t,e){var r=new Ul;return r.text=this.text.substring(t,e),r.sectionIndex=this.sectionIndex.slice(t,e),r.sections=this.sections,r},Ul.prototype.toString=function(){return this.text},Ul.prototype.getMaxScale=function(){var t=this;return this.sectionIndex.reduce((function(e,r){return Math.max(e,t.sections[r].scale)}),0)},Ul.prototype.addTextSection=function(t,e){this.text+=t.text,this.sections.push(jl.forText(t.scale,t.fontStack||e));for(var r=this.sections.length-1,i=0;i=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)};var Kl={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},Xl={};function Hl(t,e,r,i,n,a){if(e.imageName){var s=i[e.imageName];return s?s.displaySize[0]*e.scale*24/a+n:0}var o=r[e.fontStack],u=o&&o[t];return u?u.metrics.advance*e.scale+n:0}function Jl(t,e,r,i){var n=Math.pow(t-e,2);return i?t=0,p=0,c=0;c-r/2;){if(--s<0)return !1;o-=t[s].dist(a),a=t[s];}o+=t[s].dist(t[s+1]),s++;for(var u=[],h=0;oi;)h-=u.shift().angleDelta;if(h>n)return !1;s++,o+=l.dist(p);}return !0}function op(t){for(var e=0,r=0;rh){var y=(h-u)/f,d=an(p.x,c.x,y),m=an(p.y,c.y,y),v=new ep(d,m,c.angleTo(p),l);return v._round(),!s||sp(t,v,o,s,e)?v:void 0}u+=f;}}function pp(t,e,r,i,n,a,s,o,u){var h=up(i,a,s),l=hp(i,n),p=l*s,c=0===t[0].x||t[0].x===u||0===t[0].y||t[0].y===u;return e-p=0&&_=0&&w=0&&f+l<=p){var M=new ep(_,w,x,d);M._round(),n&&!sp(e,M,s,n,a)||y.push(M);}}c+=g;}return u||y.length||o||(y=t(e,c/2,i,n,a,s,o,!0,h)),y}(t,c?e/2*o%e:(l/2+2*a)*s*o%e,e,h,r,p,c,!1,u)}function cp(t,e,r,i,a){for(var s=[],o=0;o=i&&c.x>=i||(p.x>=i?p=new n(i,p.y+(i-p.x)/(c.x-p.x)*(c.y-p.y))._round():c.x>=i&&(c=new n(i,p.y+(i-p.x)/(c.x-p.x)*(c.y-p.y))._round()),p.y>=a&&c.y>=a||(p.y>=a?p=new n(p.x+(a-p.y)/(c.y-p.y)*(c.x-p.x),a)._round():c.y>=a&&(c=new n(p.x+(a-p.y)/(c.y-p.y)*(c.x-p.x),a)._round()),h&&p.equals(h[h.length-1])||s.push(h=[p]),h.push(c)))));}return s}function fp(t,e,r,i){var a=[],s=t.image,o=s.pixelRatio,u=s.paddedRect.w-2,h=s.paddedRect.h-2,l=t.right-t.left,p=t.bottom-t.top,c=s.stretchX||[[0,u]],f=s.stretchY||[[0,h]],y=function(t,e){return t+e[1]-e[0]},d=c.reduce(y,0),m=f.reduce(y,0),v=u-d,g=h-m,x=0,b=d,_=0,w=m,M=0,S=v,A=0,k=g;if(s.content&&i){var I=s.content;x=yp(c,0,I[0]),_=yp(f,0,I[1]),b=yp(c,I[0],I[2]),w=yp(f,I[1],I[3]),M=I[0]-x,A=I[1]-_,S=I[2]-I[0]-b,k=I[3]-I[1]-w;}var z=function(i,a,u,h){var c=mp(i.stretch-x,b,l,t.left),f=vp(i.fixed-M,S,i.stretch,d),y=mp(a.stretch-_,w,p,t.top),v=vp(a.fixed-A,k,a.stretch,m),g=mp(u.stretch-x,b,l,t.left),I=vp(u.fixed-M,S,u.stretch,d),z=mp(h.stretch-_,w,p,t.top),C=vp(h.fixed-A,k,h.stretch,m),E=new n(c,y),P=new n(g,y),B=new n(g,z),T=new n(c,z),V=new n(f/o,v/o),L=new n(I/o,C/o),F=e*Math.PI/180;if(F){var O=Math.sin(F),D=Math.cos(F),N=[D,-O,O,D];E._matMult(N),P._matMult(N),T._matMult(N),B._matMult(N);}var R=i.stretch+i.fixed,q=a.stretch+a.fixed;return {tl:E,tr:P,bl:T,br:B,tex:{x:s.paddedRect.x+1+R,y:s.paddedRect.y+1+q,w:u.stretch+u.fixed-R,h:h.stretch+h.fixed-q},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:V,pixelOffsetBR:L,minFontScaleX:S/o/l,minFontScaleY:k/o/p,isSDF:r}};if(i&&(s.stretchX||s.stretchY))for(var C=dp(c,v,d),E=dp(f,g,m),P=0;P0&&(y=Math.max(10,y),this.circleDiameter=y);}else {var d=s.top*o-u,m=s.bottom*o+u,v=s.left*o-u,g=s.right*o+u,x=s.collisionPadding;if(x&&(v-=x[0]*o,d-=x[1]*o,g+=x[2]*o,m+=x[3]*o),l){var b=new n(v,d),_=new n(g,d),w=new n(v,m),M=new n(g,m),S=l*Math.PI/180;b._rotate(S),_._rotate(S),w._rotate(S),M._rotate(S),v=Math.min(b.x,_.x,w.x,M.x),g=Math.max(b.x,_.x,w.x,M.x),d=Math.min(b.y,_.y,w.y,M.y),m=Math.max(b.y,_.y,w.y,M.y);}t.emplaceBack(e.x,e.y,v,d,g,m,r,i,a);}this.boxEndIndex=t.length;},xp=function(t,e){if(void 0===t&&(t=[]),void 0===e&&(e=bp),this.data=t,this.length=this.data.length,this.compare=e,this.length>0)for(var r=(this.length>>1)-1;r>=0;r--)this._down(r);};function bp(t,e){return te?1:0}function _p(t,e,r){void 0===e&&(e=1),void 0===r&&(r=!1);for(var i=1/0,a=1/0,s=-1/0,o=-1/0,u=t[0],h=0;hs)&&(s=l.x),(!h||l.y>o)&&(o=l.y);}var p=Math.min(s-i,o-a),c=p/2,f=new xp([],wp);if(0===p)return new n(i,a);for(var y=i;ym.d||!m.d)&&(m=g,r&&console.log("found best %d after %d probes",Math.round(1e4*g.d)/1e4,v)),g.max-m.d<=e||(f.push(new Mp(g.p.x-(c=g.h/2),g.p.y-c,c,t)),f.push(new Mp(g.p.x+c,g.p.y-c,c,t)),f.push(new Mp(g.p.x-c,g.p.y+c,c,t)),f.push(new Mp(g.p.x+c,g.p.y+c,c,t)),v+=4);}return r&&(console.log("num probes: "+v),console.log("best distance: "+m.d)),m.p}function wp(t,e){return e.max-t.max}function Mp(t,e,r,i){this.p=new n(t,e),this.h=r,this.d=function(t,e){for(var r=!1,i=1/0,n=0;nt.y!=l.y>t.y&&t.x<(l.x-h.x)*(t.y-h.y)/(l.y-h.y)+h.x&&(r=!r),i=Math.min(i,wu(t,h,l));}return (r?1:-1)*Math.sqrt(i)}(this.p,i),this.max=this.d+this.h*Math.SQRT2;}xp.prototype.push=function(t){this.data.push(t),this.length++,this._up(this.length-1);},xp.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}},xp.prototype.peek=function(){return this.data[0]},xp.prototype._up=function(t){for(var e=this.data,r=this.compare,i=e[t];t>0;){var n=t-1>>1,a=e[n];if(r(i,a)>=0)break;e[t]=a,t=n;}e[t]=i;},xp.prototype._down=function(t){for(var e=this.data,r=this.compare,i=this.length>>1,n=e[t];t=0)break;e[t]=s,t=a;}e[t]=n;};var Sp=Number.POSITIVE_INFINITY;function Ap(t,e){return e[1]!==Sp?function(t,e,r){var i=0,n=0;switch(e=Math.abs(e),r=Math.abs(r),t){case"top-right":case"top-left":case"top":n=r-7;break;case"bottom-right":case"bottom-left":case"bottom":n=7-r;}switch(t){case"top-right":case"bottom-right":case"right":i=-e;break;case"top-left":case"bottom-left":case"left":i=e;}return [i,n]}(t,e[0],e[1]):function(t,e){var r=0,i=0;e<0&&(e=0);var n=e/Math.sqrt(2);switch(t){case"top-right":case"top-left":i=n-7;break;case"bottom-right":case"bottom-left":i=7-n;break;case"bottom":i=7-e;break;case"top":i=e-7;}switch(t){case"top-right":case"bottom-right":r=-n;break;case"top-left":case"bottom-left":r=n;break;case"left":r=e;break;case"right":r=-e;}return [r,i]}(t,e[0])}function kp(t){switch(t){case"right":case"top-right":case"bottom-right":return "right";case"left":case"top-left":case"bottom-left":return "left"}return "center"}function Ip(t,e,r,i,a,s,o,u,h,l,p,c,f,y,d){var m=function(t,e,r,i,a,s,o,u){for(var h=i.layout.get("text-rotate").evaluate(s,{})*Math.PI/180,l=[],p=0,c=e.positionedLines;p32640&&M(t.layerIds[0]+': Value for "text-size" is >= 255. Reduce your "text-size".'):"composite"===v.kind&&((g=[128*y.compositeTextSizes[0].evaluate(o,{},d),128*y.compositeTextSizes[1].evaluate(o,{},d)])[0]>32640||g[1]>32640)&&M(t.layerIds[0]+': Value for "text-size" is >= 255. Reduce your "text-size".'),t.addSymbols(t.text,m,g,u,s,o,l,e,h.lineStartIndex,h.lineLength,f,d);for(var x=0,b=p;x=0;s--)if(i.dist(a[s])0)&&("constant"!==a.value.kind||a.value.value.length>0),h="constant"!==o.value.kind||!!o.value.value||Object.keys(o.parameters).length>0,l=n.get("symbol-sort-key");if(this.features=[],u||h){for(var p=e.iconDependencies,c=e.glyphDependencies,f=e.availableImages,y=new Ts(this.zoom),d=0,m=t;d=0;for(var T=0,V=S.sections;T=0;o--)a[o]={x:e[o].x,y:e[o].y,tileUnitDistanceFromAnchor:n},o>0&&(n+=e[o-1].dist(e[o]));for(var u=0;u0},Op.prototype.hasIconData=function(){return this.icon.segments.get().length>0},Op.prototype.hasDebugData=function(){return this.textCollisionBox&&this.iconCollisionBox},Op.prototype.hasTextCollisionBoxData=function(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0},Op.prototype.hasIconCollisionBoxData=function(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0},Op.prototype.addIndicesForPlacedSymbol=function(t,e){for(var r=t.placedSymbolArray.get(e),i=r.vertexStartIndex+4*r.numGlyphs,n=r.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,i=this.symbolInstanceIndexes;r=0&&i.indexOf(t)===r&&e.addIndicesForPlacedSymbol(e.text,t);})),n.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,n.verticalPlacedTextSymbolIndex),n.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,n.placedIconSymbolIndex),n.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,n.verticalPlacedIconSymbolIndex);}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray);}},da("SymbolBucket",Op,{omit:["layers","collisionBoxArray","features","compareText"]}),Op.MAX_GLYPHS=65535,Op.addDynamicAttributes=Tp;var Dp=new Hs({"symbol-placement":new js(Pa.layout_symbol["symbol-placement"]),"symbol-spacing":new js(Pa.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new js(Pa.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new Us(Pa.layout_symbol["symbol-sort-key"]),"symbol-z-order":new js(Pa.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new js(Pa.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new js(Pa.layout_symbol["icon-ignore-placement"]),"icon-optional":new js(Pa.layout_symbol["icon-optional"]),"icon-rotation-alignment":new js(Pa.layout_symbol["icon-rotation-alignment"]),"icon-size":new Us(Pa.layout_symbol["icon-size"]),"icon-text-fit":new js(Pa.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new js(Pa.layout_symbol["icon-text-fit-padding"]),"icon-image":new Us(Pa.layout_symbol["icon-image"]),"icon-rotate":new Us(Pa.layout_symbol["icon-rotate"]),"icon-padding":new js(Pa.layout_symbol["icon-padding"]),"icon-keep-upright":new js(Pa.layout_symbol["icon-keep-upright"]),"icon-offset":new Us(Pa.layout_symbol["icon-offset"]),"icon-anchor":new Us(Pa.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new js(Pa.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new js(Pa.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new js(Pa.layout_symbol["text-rotation-alignment"]),"text-field":new Us(Pa.layout_symbol["text-field"]),"text-font":new Us(Pa.layout_symbol["text-font"]),"text-size":new Us(Pa.layout_symbol["text-size"]),"text-max-width":new Us(Pa.layout_symbol["text-max-width"]),"text-line-height":new js(Pa.layout_symbol["text-line-height"]),"text-letter-spacing":new Us(Pa.layout_symbol["text-letter-spacing"]),"text-justify":new Us(Pa.layout_symbol["text-justify"]),"text-radial-offset":new Us(Pa.layout_symbol["text-radial-offset"]),"text-variable-anchor":new js(Pa.layout_symbol["text-variable-anchor"]),"text-anchor":new Us(Pa.layout_symbol["text-anchor"]),"text-max-angle":new js(Pa.layout_symbol["text-max-angle"]),"text-writing-mode":new js(Pa.layout_symbol["text-writing-mode"]),"text-rotate":new Us(Pa.layout_symbol["text-rotate"]),"text-padding":new js(Pa.layout_symbol["text-padding"]),"text-keep-upright":new js(Pa.layout_symbol["text-keep-upright"]),"text-transform":new Us(Pa.layout_symbol["text-transform"]),"text-offset":new Us(Pa.layout_symbol["text-offset"]),"text-allow-overlap":new js(Pa.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new js(Pa.layout_symbol["text-ignore-placement"]),"text-optional":new js(Pa.layout_symbol["text-optional"])}),Np={paint:new Hs({"icon-opacity":new Us(Pa.paint_symbol["icon-opacity"]),"icon-color":new Us(Pa.paint_symbol["icon-color"]),"icon-halo-color":new Us(Pa.paint_symbol["icon-halo-color"]),"icon-halo-width":new Us(Pa.paint_symbol["icon-halo-width"]),"icon-halo-blur":new Us(Pa.paint_symbol["icon-halo-blur"]),"icon-translate":new js(Pa.paint_symbol["icon-translate"]),"icon-translate-anchor":new js(Pa.paint_symbol["icon-translate-anchor"]),"text-opacity":new Us(Pa.paint_symbol["text-opacity"]),"text-color":new Us(Pa.paint_symbol["text-color"],{runtimeType:ii,getOverride:function(t){return t.textColor},hasOverride:function(t){return !!t.textColor}}),"text-halo-color":new Us(Pa.paint_symbol["text-halo-color"]),"text-halo-width":new Us(Pa.paint_symbol["text-halo-width"]),"text-halo-blur":new Us(Pa.paint_symbol["text-halo-blur"]),"text-translate":new js(Pa.paint_symbol["text-translate"]),"text-translate-anchor":new js(Pa.paint_symbol["text-translate-anchor"])}),layout:Dp},Rp=function(t){this.type=t.property.overrides?t.property.overrides.runtimeType:$r,this.defaultValue=t;};Rp.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},Rp.prototype.eachChild=function(t){this.defaultValue.isConstant()||t(this.defaultValue.value._styleExpression.expression);},Rp.prototype.outputDefined=function(){return !1},Rp.prototype.serialize=function(){return null},da("FormatSectionOverride",Rp,{omit:["defaultValue"]});var qp=function(t){function e(e){t.call(this,e,Np);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.recalculate=function(e,r){if(t.prototype.recalculate.call(this,e,r),"auto"===this.layout.get("icon-rotation-alignment")&&(this.layout._values["icon-rotation-alignment"]="point"!==this.layout.get("symbol-placement")?"map":"viewport"),"auto"===this.layout.get("text-rotation-alignment")&&(this.layout._values["text-rotation-alignment"]="point"!==this.layout.get("symbol-placement")?"map":"viewport"),"auto"===this.layout.get("text-pitch-alignment")&&(this.layout._values["text-pitch-alignment"]=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 i=this.layout.get("text-writing-mode");if(i){for(var n=[],a=0,s=i;a",targetMapId:i,sourceMapId:s.mapId});}}},ec.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 i=this.cancelCallbacks[r];delete this.cancelCallbacks[r],i&&i();}else k()||e.mustQueue?(this.tasks[r]=e,this.taskQueue.push(r),this.invoker.trigger()):this.processTask(r,e);},ec.prototype.process=function(){if(this.taskQueue.length){var t=this.taskQueue.shift(),e=this.tasks[t];delete this.tasks[t],this.taskQueue.length&&this.invoker.trigger(),e&&this.processTask(t,e);}},ec.prototype.processTask=function(t,e){var r=this;if(""===e.type){var i=this.callbacks[t];delete this.callbacks[t],i&&(e.error?i(ba(e.error)):i(null,ba(e.data)));}else {var n=!1,a=C(this.globalScope)?void 0:[],s=e.hasCallback?function(e,i){n=!0,delete r.cancelCallbacks[t],r.target.postMessage({id:t,type:"",sourceMapId:r.mapId,error:e?xa(e):null,data:xa(i,a)},a);}:function(t){n=!0;},o=null,u=ba(e.data);if(this.parent[e.type])o=this.parent[e.type](e.sourceMapId,u,s,e.sourceId);else if(this.parent.getWorkerSource){var h=e.type.split(".");o=this.parent.getWorkerSource(e.sourceMapId,h[0],u.source,u.crs)[h[1]](u,s);}else s(new Error("Could not find function "+e.type));!n&&o&&o.cancel&&(this.cancelCallbacks[t]=o.cancel);}},ec.prototype.remove=function(){this.invoker.remove(),this.target.removeEventListener("message",this.receive,!1);};var rc=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]));};rc.prototype.setNorthEast=function(t){return this._ne=t instanceof ic?new ic(t.lng,t.lat):ic.convert(t),this},rc.prototype.setSouthWest=function(t){return this._sw=t instanceof ic?new ic(t.lng,t.lat):ic.convert(t),this},rc.prototype.extend=function(t){var e,r,i=this._sw,n=this._ne;if(t instanceof ic)e=t,r=t;else {if(!(t instanceof rc))return Array.isArray(t)?4===t.length||t.every(Array.isArray)?this.extend(rc.convert(t)):this.extend(ic.convert(t)):this;if(r=t._ne,!(e=t._sw)||!r)return this}return i||n?(i.lng=Math.min(e.lng,i.lng),i.lat=Math.min(e.lat,i.lat),n.lng=Math.max(r.lng,n.lng),n.lat=Math.max(r.lat,n.lat)):(this._sw=new ic(e.lng,e.lat),this._ne=new ic(r.lng,r.lat)),this},rc.prototype.getCenter=function(){return new ic((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)},rc.prototype.getSouthWest=function(){return this._sw},rc.prototype.getNorthEast=function(){return this._ne},rc.prototype.getNorthWest=function(){return new ic(this.getWest(),this.getNorth())},rc.prototype.getSouthEast=function(){return new ic(this.getEast(),this.getSouth())},rc.prototype.getWest=function(){return this._sw.lng},rc.prototype.getSouth=function(){return this._sw.lat},rc.prototype.getEast=function(){return this._ne.lng},rc.prototype.getNorth=function(){return this._ne.lat},rc.prototype.toArray=function(){return [this._sw.toArray(),this._ne.toArray()]},rc.prototype.toString=function(){return "LngLatBounds("+this._sw.toString()+", "+this._ne.toString()+")"},rc.prototype.isEmpty=function(){return !(this._sw&&this._ne)},rc.prototype.contains=function(t){var e=ic.convert(t),r=e.lng,i=e.lat,n=this._sw.lng<=r&&r<=this._ne.lng;return this._sw.lng>this._ne.lng&&(n=this._sw.lng>=r&&r>=this._ne.lng),this._sw.lat<=i&&i<=this._ne.lat&&n},rc.convert=function(t){return !t||t instanceof rc?t:new rc(t)};var ic=function(t,e){if(isNaN(t)||isNaN(e))throw new Error("Invalid LngLat object: ("+t+", "+e+")");this.lng=+t,this.lat=+e;};ic.prototype.wrap=function(){return new ic(p(this.lng,-180,180),this.lat)},ic.prototype.toArray=function(){return [this.lng,this.lat]},ic.prototype.toString=function(){return "LngLat("+this.lng+", "+this.lat+")"},ic.prototype.distanceTo=function(t){var e=Math.PI/180,r=this.lat*e,i=t.lat*e,n=Math.sin(r)*Math.sin(i)+Math.cos(r)*Math.cos(i)*Math.cos((t.lng-this.lng)*e);return 6371008.8*Math.acos(Math.min(n,1))},ic.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 rc(new ic(this.lng-r,this.lat-e),new ic(this.lng+r,this.lat+e))},ic.convert=function(t){if(t instanceof ic)return t;if(Array.isArray(t)&&(2===t.length||3===t.length))return new ic(Number(t[0]),Number(t[1]));if(!Array.isArray(t)&&"object"==typeof t&&null!==t)return new ic(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 nc=2*Math.PI*6371008.8;function ac(t){return nc*Math.cos(t*Math.PI/180)}function sc(t,e){return t/ac(e)}function oc(t){return 360/Math.PI*Math.atan(Math.exp((180-360*t)*Math.PI/180))-90}var uc=function(t,e,r){void 0===r&&(r=0),this.x=+t,this.y=+e,this.z=+r;};uc.fromLngLat=function(t,e){void 0===e&&(e=0);var r=ic.convert(t);return new uc((180+r.lng)/360,(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+r.lat*Math.PI/360)))/360,sc(e,r.lat))},uc.prototype.toLngLat=function(){return new ic(360*this.x-180,oc(this.y))},uc.prototype.toAltitude=function(){return this.z*ac(oc(this.y))},uc.prototype.meterInMercatorCoordinateUnits=function(){return 1/nc*(t=oc(this.y),1/Math.cos(t*Math.PI/180));var t;};var hc=function(t,e,r,i){this.z=t,this.x=e,this.y=r,this.key=cc(0,t,t,e,r),i&&(this.indexExtent=i,this.worldWidth=i[2]-i[0],this.worldHeight=i[3]-i[1]);};hc.prototype.equals=function(t){return this.z===t.z&&this.x===t.x&&this.y===t.y},hc.prototype.getTileBBox=function(){var t=Math.pow(2,this.z);return this.indexExtent[0]+this.worldWidth*this.x/t+","+(this.indexExtent[3]-this.worldHeight*(this.y+1)/t)+","+(this.indexExtent[0]+this.worldWidth*(this.x+1)/t)+","+(this.indexExtent[3]-this.worldHeight*this.y/t)},hc.prototype.url=function(t,e,r,i,n){var a=this.getTileBBox(),s=function(t,e,r){for(var i,n="",a=t;a>0;a--)n+=(e&(i=1<this.canonical.z?new pc(t,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y,this.canonical.indexExtent):new pc(t,this.wrap,t,this.canonical.x>>e,this.canonical.y>>e,this.canonical.indexExtent)},pc.prototype.calculateScaledKey=function(t,e){var r=this.canonical.z-t;return t>this.canonical.z?cc(this.wrap*+e,t,this.canonical.z,this.canonical.x,this.canonical.y):cc(this.wrap*+e,t,t,this.canonical.x>>r,this.canonical.y>>r)},pc.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},pc.prototype.children=function(t){if(this.overscaledZ>=t)return [new pc(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y,this.canonical.indexExtent)];var e=this.canonical.z+1,r=2*this.canonical.x,i=2*this.canonical.y;return [new pc(e,this.wrap,e,r,i,this.canonical.indexExtent),new pc(e,this.wrap,e,r+1,i,this.canonical.indexExtent),new pc(e,this.wrap,e,r,i+1,this.canonical.indexExtent),new pc(e,this.wrap,e,r+1,i+1,this.canonical.indexExtent)]},pc.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)},fc.prototype._unpackMapbox=function(t,e,r){return (256*t*256+256*e+r)/10-1e4},fc.prototype._unpackTerrarium=function(t,e,r){return 256*t+e+r/256-32768},fc.prototype.getPixels=function(){return new Aa({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))},fc.prototype.backfillBorder=function(t,e,r){if(this.dim!==t.dim)throw new Error("dem dimension mismatch");var i=e*this.dim,n=e*this.dim+this.dim,a=r*this.dim,s=r*this.dim+this.dim;switch(e){case-1:i=n-1;break;case 1:n=i+1;}switch(r){case-1:a=s-1;break;case 1:s=a+1;}for(var o=-e*this.dim,u=-r*this.dim,h=a;h=0&&l[3]>=0&&o.insert(s,l[0],l[1],l[2],l[3]);}},gc.prototype.loadVTLayers=function(){return this.vtLayers||(this.vtLayers=new Rh.VectorTile(new ml(this.rawTileData)).layers,this.sourceLayerCoder=new yc(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers},gc.prototype.query=function(t,e,r,i){var a=this;this.loadVTLayers();for(var s=t.params||{},o=8192/t.tileSize/t.scale,u=Ga(s.filter),h=t.queryGeometry,l=t.queryPadding*o,p=bc(h),c=this.grid.query(p.minX-l,p.minY-l,p.maxX+l,p.maxY+l),f=bc(t.cameraQueryGeometry),y=this.grid3D.query(f.minX-l,f.minY-l,f.maxX+l,f.maxY+l,(function(e,r,i,a){return function(t,e,r,i,a){for(var s=0,o=t;s=u.x&&a>=u.y)return !0}var h=[new n(e,r),new n(e,a),new n(i,a),new n(i,r)];if(t.length>2)for(var l=0,p=h;l=0)return !0;return !1}(a,p)){var c=this.sourceLayerCoder.decode(r),f=this.vtLayers[c].feature(i);if(n.filter(new Ts(this.tileID.overscaledZ),f))for(var y=this.getId(f,c),d=0;di)n=!1;else if(e)if(this.expirationTimePr&&(t.getActor().send("enforceCacheSizeLimit",Er),Lr=0);},t.cass=Re,t.cea=Xe,t.clamp=l,t.clearTileCache=function(t){var e=s.caches.delete("mapbox-tiles");t&&e.catch(t).then((function(){return t()}));},t.clipLine=cp,t.clone=function(t){var e=new Pu(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=_,t.clone$2=function(t){var e=new Pu(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e},t.collisionCircleLayout=pl,t.config=N,t.create=function(){var t=new Pu(16);return Pu!=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 Pu(9);return Pu!=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 Pu(4);return Pu!=Float32Array&&(t[1]=0,t[2]=0),t[0]=1,t[3]=1,t},t.createCommonjsModule=e,t.createExpression=oa,t.createLayout=Qs,t.createStyleLayer=function(t){return "custom"===t.type?new Xp(t):new Hp[t.type](t)},t.cross=function(t,e,r){var i=e[0],n=e[1],a=e[2],s=r[0],o=r[1],u=r[2];return t[0]=n*u-a*o,t[1]=a*s-i*u,t[2]=i*o-n*s,t},t.deepEqual=function t(e,r){if(Array.isArray(e)){if(!Array.isArray(r)||e.length!==r.length)return !1;for(var i=0;i0&&(a=1/Math.sqrt(a)),t[0]=e[0]*a,t[1]=e[1]*a,t[2]=e[2]*a,t},t.number=an,t.nzmg=Ze,t.offscreenCanvasSupported=Fr,t.omerc=Ce,t.ortho=function(t,e,r,i,n,a,s){var o=1/(e-r),u=1/(i-n),h=1/(a-s);return t[0]=-2*o,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*u,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*h,t[11]=0,t[12]=(e+r)*o,t[13]=(n+i)*u,t[14]=(s+a)*h,t[15]=1,t},t.ortho$1=rr,t.parseCode=mt,t.parseGlyphPBF=function(t){return new ml(t).readFields(Vl,[])},t.pbf=ml,t.performSymbolLayout=function(t,e,r,i,n,a,s){t.createArrays(),t.tilePixelRatio=8192/(512*t.overscaling),t.compareText={},t.iconsNeedLinear=!1;var o=t.layers[0].layout,u=t.layers[0]._unevaluatedLayout._values,h={};if("composite"===t.textSizeData.kind){var l=t.textSizeData,p=l.maxZoom;h.compositeTextSizes=[u["text-size"].possiblyEvaluate(new Ts(l.minZoom),s),u["text-size"].possiblyEvaluate(new Ts(p),s)];}if("composite"===t.iconSizeData.kind){var c=t.iconSizeData,f=c.maxZoom;h.compositeIconSizes=[u["icon-size"].possiblyEvaluate(new Ts(c.minZoom),s),u["icon-size"].possiblyEvaluate(new Ts(f),s)];}h.layoutTextSize=u["text-size"].possiblyEvaluate(new Ts(t.zoom+1),s),h.layoutIconSize=u["icon-size"].possiblyEvaluate(new Ts(t.zoom+1),s),h.textMaxSize=u["text-size"].possiblyEvaluate(new Ts(18));for(var y=24*o.get("text-line-height"),d="map"===o.get("text-rotation-alignment")&&"point"!==o.get("symbol-placement"),m=o.get("text-keep-upright"),v=o.get("text-size"),g=function(){var a=b[x],u=o.get("text-font").evaluate(a,{},s).join(","),l=v.evaluate(a,{},s),p=h.layoutTextSize.evaluate(a,{},s),c=h.layoutIconSize.evaluate(a,{},s),f={horizontal:{},vertical:void 0},g=a.text,_=[0,0];if(g){var w=g.toString(),S=24*o.get("text-letter-spacing").evaluate(a,{},s),A=function(t){for(var e=0,r=t;e=8192||p.y<0||p.y>=8192||function(t,e,r,i,n,a,s,o,u,h,l,p,c,f,y,d,m,v,g,x,b,_,w,S,A){var k,I,z,C,E,P=t.addToLineVertexArray(e,r),B=0,T=0,V=0,L=0,F=-1,O=-1,D={},N=No(""),R=0,q=0;if(void 0===o._unevaluatedLayout.getValue("text-radial-offset")?(R=(k=o.layout.get("text-offset").evaluate(b,{},S).map((function(t){return 24*t})))[0],q=k[1]):(R=24*o.layout.get("text-radial-offset").evaluate(b,{},S),q=Sp),t.allowVerticalPlacement&&i.vertical){var j=o.layout.get("text-rotate").evaluate(b,{},S)+90;C=new gp(u,e,h,l,p,i.vertical,c,f,y,j),s&&(E=new gp(u,e,h,l,p,s,m,v,y,j));}if(n){var U=o.layout.get("icon-rotate").evaluate(b,{}),G="none"!==o.layout.get("icon-text-fit"),K=fp(n,U,w,G),X=s?fp(s,U,w,G):void 0;z=new gp(u,e,h,l,p,n,m,v,!1,U),B=4*K.length;var H=t.iconSizeData,J=null;"source"===H.kind?(J=[128*o.layout.get("icon-size").evaluate(b,{})])[0]>32640&&M(t.layerIds[0]+': Value for "icon-size" is >= 255. Reduce your "icon-size".'):"composite"===H.kind&&((J=[128*_.compositeIconSizes[0].evaluate(b,{},S),128*_.compositeIconSizes[1].evaluate(b,{},S)])[0]>32640||J[1]>32640)&&M(t.layerIds[0]+': Value for "icon-size" is >= 255. Reduce your "icon-size".'),t.addSymbols(t.icon,K,J,x,g,b,!1,e,P.lineStartIndex,P.lineLength,-1,S),F=t.icon.placedSymbolArray.length-1,X&&(T=4*X.length,t.addSymbols(t.icon,X,J,x,g,b,ql.vertical,e,P.lineStartIndex,P.lineLength,-1,S),O=t.icon.placedSymbolArray.length-1);}for(var Z in i.horizontal){var Y=i.horizontal[Z];if(!I){N=No(Y.text);var W=o.layout.get("text-rotate").evaluate(b,{},S);I=new gp(u,e,h,l,p,Y,c,f,y,W);}var Q=1===Y.positionedLines.length;if(V+=Ip(t,e,Y,a,o,y,b,d,P,i.vertical?ql.horizontal:ql.horizontalOnly,Q?Object.keys(i.horizontal):[Z],D,F,_,S),Q)break}i.vertical&&(L+=Ip(t,e,i.vertical,a,o,y,b,d,P,ql.vertical,["vertical"],D,O,_,S));var $=I?I.boxStartIndex:t.collisionBoxArray.length,tt=I?I.boxEndIndex:t.collisionBoxArray.length,et=C?C.boxStartIndex:t.collisionBoxArray.length,rt=C?C.boxEndIndex:t.collisionBoxArray.length,it=z?z.boxStartIndex:t.collisionBoxArray.length,nt=z?z.boxEndIndex:t.collisionBoxArray.length,at=E?E.boxStartIndex:t.collisionBoxArray.length,st=E?E.boxEndIndex:t.collisionBoxArray.length,ot=-1,ut=function(t,e){return t&&t.circleDiameter?Math.max(t.circleDiameter,e):e};ot=ut(I,ot),ot=ut(C,ot),ot=ut(z,ot);var ht=(ot=ut(E,ot))>-1?1:0;ht&&(ot*=A/24),t.glyphOffsetArray.length>=Op.MAX_GLYPHS&&M("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),void 0!==b.sortKey&&t.addToSortKeyRanges(t.symbolInstances.length,b.sortKey),t.symbolInstances.emplaceBack(e.x,e.y,D.right>=0?D.right:-1,D.center>=0?D.center:-1,D.left>=0?D.left:-1,D.vertical||-1,F,O,N,$,tt,et,rt,it,nt,at,st,h,V,L,B,T,ht,0,c,R,q,ot);}(t,p,o,r,i,n,c,t.layers[0],t.collisionBoxArray,e.index,e.sourceLayerIndex,t.index,v,_,A,u,x,w,k,y,e,a,h,l,s);};if("line"===I)for(var P=0,B=cp(e.geometry,0,0,8192,8192);P1){var R=lp(N,S,r.vertical||d,i,24,g);R&&E(N,R);}}else if("Polygon"===e.type)for(var q=0,j=Mh(e.geometry,0);q=C.maxzoom||"none"!==C.visibility&&(s(k,this.zoom,o),(g[C.id]=C.createBucket({index:h.bucketLayerIDs.length,layers:k,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:w,sourceID:this.source})).populate(S,v,this.tileID.canonical),h.bucketLayerIDs.push(k.map((function(e){return e.id}))));}}}var T=e.mapObject(v.glyphDependencies,(function(e){return Object.keys(e).map(Number)}));Object.keys(T).length?n.send("getGlyphs",{uid:this.uid,stacks:T},(function(e,t){p||(p=e,c=t,j.call(l));}),!1,this.source):c={};var L=Object.keys(v.iconDependencies);L.length?n.send("getImages",{icons:L,source:this.source,tileID:this.tileID,type:"icons"},(function(e,t){p||(p=e,f=t,j.call(l));}),!1,this.source):f={};var D=Object.keys(v.patternDependencies);function j(){if(p)return a(p);if(c&&f&&d){var t=new i(c),r=new e.ImageAtlas(f,d);for(var n in g){var l=g[n];l instanceof e.SymbolBucket?(s(l.layers,this.zoom,o),e.performSymbolLayout(l,c,t.positions,f,r.iconPositions,this.showCollisionBoxes,this.tileID.canonical)):l.hasPattern&&(l instanceof e.LineBucket||l instanceof e.FillBucket||l instanceof e.FillExtrusionBucket)&&(s(l.layers,this.zoom,o),l.addFeatures(v,this.tileID.canonical,r.patternPositions));}this.status="done",a(null,{buckets:e.values(g).filter((function(e){return !e.isEmpty()})),featureIndex:h,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:t.image,imageAtlas:r,glyphMap:this.returnDependencies?c:null,iconMap:this.returnDependencies?f:null,glyphPositions:this.returnDependencies?t.positions:null});}}D.length?n.send("getImages",{icons:D,source:this.source,tileID:this.tileID,type:"patterns"},(function(e,t){p||(p=e,d=t,j.call(l));}),!1,this.source):d={},j.call(this);};var l=function(e,t,r,o){this.actor=e,this.layerIndex=t,this.availableImages=r,this.loadVectorData=o||a,this.loading={},this.loaded={};};l.prototype.loadTile=function(t,r){var o=this,i=t.uid;this.loading||(this.loading={});var s=!!(t&&t.request&&t.request.collectResourceTiming)&&new e.RequestPerformance(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 h={};if(s){var p=s.finish();p&&(h.resourceTiming=JSON.parse(JSON.stringify(p)));}a.vectorTile=n.vectorTile,a.parse(n.vectorTile,o.layerIndex,o.availableImages,o.actor,(function(t,o){if(t||!o)return r(t);r(null,e.extend({rawTileData:l.slice(0)},o,u,h));})),o.loaded=o.loaded||{},o.loaded[i]=a;}));},l.prototype.reloadTile=function(e,t){var r=this,o=this.loaded,i=e.uid,n=this;if(o&&o[i]){var s=o[i];s.showCollisionBoxes=e.showCollisionBoxes;var a=function(e,o){var i=s.reloadCallback;i&&(delete s.reloadCallback,s.parse(s.vectorTile,n.layerIndex,r.availableImages,n.actor,i)),t(e,o);};"parsing"===s.status?s.reloadCallback=a:"done"===s.status&&(s.vectorTile?s.parse(s.vectorTile,this.layerIndex,this.availableImages,this.actor,a):a());}},l.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();},l.prototype.removeTile=function(e,t){var r=this.loaded,o=e.uid;r&&r[o]&&delete r[o],t();};var u=e.window.ImageBitmap,h=function(){this.loaded={};};function p(e,t){if(0!==e.length){c(e[0],t);for(var r=1;r=0!=!!t&&e.reverse();}h.prototype.loadTile=function(t,r){var o=t.uid,i=t.encoding,n=t.rawImageData,s=u&&n instanceof u?this.getImageData(n):n,a=new e.DEMData(o,s,i);this.loaded=this.loaded||{},this.loaded[o]=a,r(null,a);},h.prototype.getImageData=function(t){this.offscreenCanvas&&this.offscreenCanvasContext||(this.offscreenCanvas=new OffscreenCanvas(t.width,t.height),this.offscreenCanvasContext=this.offscreenCanvas.getContext("2d")),this.offscreenCanvas.width=t.width,this.offscreenCanvas.height=t.height,this.offscreenCanvasContext.drawImage(t,0,0,t.width,t.height);var r=this.offscreenCanvasContext.getImageData(-1,-1,t.width+2,t.height+2);return this.offscreenCanvasContext.clearRect(0,0,this.offscreenCanvas.width,this.offscreenCanvas.height),new e.RGBAImage({width:r.width,height:r.height},r.data)},h.prototype.removeTile=function(e){var t=this.loaded,r=e.uid;t&&t[r]&&delete t[r];};var f=e.mvt.VectorTileFeature.prototype.toGeoJSON,d=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));};d.prototype.loadGeometry=function(){if(1===this._feature.type){for(var t=[],r=0,o=this._feature.geometry;r>3;}if(n--,1===i||2===i)s+=t.readSVarint(),a+=t.readSVarint(),1===i&&(r&&l.push(r),r=[]),r.push(new e.Point$1(s,a));else {if(7!==i)throw new Error("unknown command "+i);r&&r.push(r[0].clone());}}return r&&l.push(r),l},m.prototype.bbox=function(){var e=this._pbf;e.pos=this._geometry;for(var t=e.readVarint()+e.pos,r=1,o=0,i=0,n=0,s=1/0,a=-1/0,l=1/0,u=-1/0;e.pos>3;}if(o--,1===r||2===r)(i+=e.readSVarint())a&&(a=i),(n+=e.readSVarint())u&&(u=n);else if(7!==r)throw new Error("unknown command "+r)}return [s,l,a,u]},m.prototype.toGeoJSON=function(e,t,r){var o,i,n=this.extent*Math.pow(2,r),s=this.extent*e,a=this.extent*t,l=this.loadGeometry(),u=m.types[this.type];function h(e){for(var t=0;t>3;t=1===o?e.readString():2===o?e.readFloat():3===o?e.readDouble():4===o?e.readVarint64():5===o?e.readVarint():6===o?e.readSVarint():7===o?e.readBoolean():null;}return t}(r));}function M(e,t,r){if(3===e){var o=new b(r,r.readVarint()+r.pos);o.length&&(t[o.name]=o);}}_.prototype.feature=function(e){if(e<0||e>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[e];var t=this._pbf.readVarint()+this._pbf.pos;return new v(this._pbf,t,this.extent,this._keys,this._values)};var P={VectorTile:function(e,t){this.layers=e.readFields(M,{},t);},VectorTileFeature:v,VectorTileLayer:b}.VectorTileFeature,k=C;function C(e,t){this.options=t||{},this.features=e,this.length=e.length;}function T(e,t){this.id="number"==typeof e.id?e.id:void 0,this.type=e.type,this.rawGeometry=1===e.type?[e.geometry]:e.geometry,this.properties=e.tags,this.extent=t||4096;}C.prototype.feature=function(e){return new T(this.features[e],this.options.extent)},T.prototype.loadGeometry=function(){var t=this.rawGeometry;this.geometry=[];for(var r=0;r>31}function N(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),h=.5*Math.exp(2*u/3),p=.5*Math.sqrt(u*h*(a-h)/a)*(l-a/2<0?-1:1);e(t,r,o,Math.max(i,Math.floor(o-l*h/a+p)),Math.min(n,Math.floor(o+(a-l)*h/a+p)),s);}var c=r[2*o+s],f=i,d=n;for(B(t,r,i,o),r[2*n+s]>c&&B(t,r,i,n);fc;)d--;}r[2*i+s]===c?B(t,r,i,d):B(t,r,++d,n),d<=o&&(i=d+1),o<=d&&(n=d-1);}}(t,r,a,i,n,s%2),e(t,r,o,i,a-1,s+1),e(t,r,o,a+1,n,s+1);}}(s,a,o,0,s.length-1,0);};X.prototype.range=function(e,t,r,o){return function(e,t,r,o,i,n,s){for(var a,l,u=[0,e.length-1,0],h=[];u.length;){var p=u.pop(),c=u.pop(),f=u.pop();if(c-f<=s)for(var d=f;d<=c;d++)l=t[2*d+1],(a=t[2*d])>=r&&a<=i&&l>=o&&l<=n&&h.push(e[d]);else {var g=Math.floor((f+c)/2);l=t[2*g+1],(a=t[2*g])>=r&&a<=i&&l>=o&&l<=n&&h.push(e[g]);var v=(p+1)%2;(0===p?r<=a:o<=l)&&(u.push(f),u.push(g-1),u.push(v)),(0===p?i>=a:n>=l)&&(u.push(g+1),u.push(c),u.push(v));}}return h}(this.ids,this.coords,e,t,r,o,this.nodeSize)},X.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(),h=s.pop(),p=s.pop();if(h-p<=n)for(var c=p;c<=h;c++)Z(t[2*c],t[2*c+1],r,o)<=l&&a.push(e[c]);else {var f=Math.floor((p+h)/2),d=t[2*f],g=t[2*f+1];Z(d,g,r,o)<=l&&a.push(e[f]);var v=(u+1)%2;(0===u?r-i<=d:o-i<=g)&&(s.push(p),s.push(f-1),s.push(v)),(0===u?r+i>=d:o+i>=g)&&(s.push(f+1),s.push(h),s.push(v));}}return a}(this.ids,this.coords,e,t,r,this.nodeSize)};var W={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:function(e){return e}},R=function(e){this.options=te(Object.create(W),e),this.trees=new Array(this.options.maxZoom+1);};function q(e,t,r,o,i){return {x:e,y:t,zoom:1/0,id:r,parentId:-1,numPoints:o,properties:i}}function U(e,t,r){var o,i,n=e.geometry.coordinates,s=n[0],a=n[1];return {x:(i="object"==typeof customConvertPoint?customConvertPoint.projectXY(s,a,r):[(o=s,o/360+.5),H(a)])[0],y:i[1],zoom:1/0,index:t,parentId:-1}}function $(e,t){var r;return r="object"==typeof customConvertPoint?customConvertPoint.toLngLat(e.x,e.y,t):[Q(x),ee(y)],{type:"Feature",id:e.id,properties:K(e),geometry:{type:"Point",coordinates:r}}}function K(e){var t=e.numPoints,r=t>=1e4?Math.round(t/1e3)+"k":t>=1e3?Math.round(t/100)/10+"k":t;return te(te({},e.properties),{cluster:!0,cluster_id:e.id,point_count:t,point_count_abbreviated:r})}function H(e){var t=Math.sin(e*Math.PI/180),r=.5-.25*Math.log((1+t)/(1-t))/Math.PI;return r<0?0:r>1?1:r}function Q(e){return 360*(e-.5)}function ee(e){var t=(180-360*e)*Math.PI/180;return 360*Math.atan(Math.exp(t))/Math.PI-90}function te(e,t){for(var r in t)e[r]=t[r];return e}function re(e){return e.x}function oe(e){return e.y}function ie(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 ne(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)se(e,t);else if("Polygon"===r||"MultiLineString"===r)for(var o=0;o0&&(a+=o?(n*p-h*s)/2:Math.sqrt(Math.pow(h-n,2)+Math.pow(p-s,2))),n=h,s=p;}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],h=t[r+1],p=t[o],c=t[o+1],f=r+3;fs)n=f,s=d;else if(d===s){var g=Math.abs(f-a);gi&&(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(a),t.start=0,t.end=t.size;}function he(e,t,r,o,i){for(var n=0;n=(r/=t)&&s=o)return null;for(var l=[],u=0;u=r&&d=o)){var g=[];if("Point"===c||"MultiPoint"===c)ce(p,g,r,o,i);else if("LineString"===c)fe(p,g,r,o,i,!1,a.lineMetrics);else if("MultiLineString"===c)ge(p,g,r,o,i,!1);else if("Polygon"===c)ge(p,g,r,o,i,!0);else if("MultiPolygon"===c)for(var v=0;v=r&&s<=o&&(t.push(e[n]),t.push(e[n+1]),t.push(e[n+2]));}}function fe(e,t,r,o,i,n,s){for(var a,l,u=de(e),h=0===i?me:ye,p=e.start,c=0;cr&&(l=h(u,f,d,v,m,r),s&&(u.start=p+a*l)):y>o?x=r&&(l=h(u,f,d,v,m,r),w=!0),x>o&&y<=o&&(l=h(u,f,d,v,m,o),w=!0),!n&&w&&(s&&(u.end=p+a*l),t.push(u),u=de(e)),s&&(p+=a);}var S=e.length-3;f=e[S],d=e[S+1],g=e[S+2],(y=0===i?f:d)>=r&&y<=o&&ve(u,f,d,g),S=u.length-3,n&&S>=3&&(u[S]!==u[0]||u[S+1]!==u[1])&&ve(u,u[0],u[1],u[2]),u.length&&t.push(u);}function de(e){var t=[];return t.size=e.size,t.start=e.start,t.end=e.end,t}function ge(e,t,r,o,i,n){for(var s=0;ss.maxX&&(s.maxX=h),p>s.maxY&&(s.maxY=p);}return s}function Ie(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;o24)throw new Error("maxZoom should be in the 0-24 range");if(t.promoteId&&t.generateId)throw new Error("promoteId and generateId cannot be used together.");var o=function(e,t){if(t.customprj&&"undefined"==typeof customConvertPoint)try{importScripts(t.customprj);}catch(e){console.log(e);}if(!t.customprj&&"undefined"!=typeof customConvertPoint)try{customConvertPoint=void 0;}catch(e){console.log(e);}var r=[];if("FeatureCollection"===e.type)for(var o=0;o=o;u--){var h=+Date.now();a=this._cluster(a,u),this.trees[u]=new X(a,re,oe,n,Float32Array),r&&console.log("z%d: %d clusters in %dms",u,a.length,+Date.now()-h);}return r&&console.timeEnd("total time"),this},R.prototype.getClusters=function(e,t){var r=((e[0]+180)%360+360)%360-180,o=Math.max(-90,Math.min(90,e[1])),i=180===e[2]?180:((e[2]+180)%360+360)%360-180,n=Math.max(-90,Math.min(90,e[3]));if(e[2]-e[0]>=360)r=-180,i=180;else if(r>i){var s=this.getClusters([r,o,180,n],t),a=this.getClusters([-180,o,i,n],t);return s.concat(a)}for(var l=this.trees[this._limitZoom(t)],u=lngLatXY(r,o),h=lngLatXY(r,i),p=[],c=0,f=l.range(u[0],h[1],h[0],u[1]);ct&&(c+=g.numPoints||1);}if(c>=n){for(var v=l.x*p,m=l.y*p,y=i&&p>1?this._map(l,!0):null,x=(a<<5)+(t+1)+this.points.length,w=0,S=h;w1)for(var I=0,M=h;I>5},R.prototype._getOriginZoom=function(e){return (e-this.points.length)%32},R.prototype._map=function(e,t){if(e.numPoints)return t?te({},e.properties):e.properties;var r=this.points[e.index].properties,o=this.options.map(r);return t&&o===r?te({},o):o},Pe.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},Pe.prototype.splitTile=function(e,t,r,o,i,n,s){for(var a=[e,t,r,o],l=this.options,u=l.debug;a.length;){o=a.pop(),r=a.pop(),t=a.pop(),e=a.pop();var h=1<1&&console.time("creation"),c=this.tiles[p]=_e(e,t,r,o,l),this.tileCoords.push({z:t,x:r,y:o}),u)){u>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",t,r,o,c.numFeatures,c.numPoints,c.numSimplified),console.timeEnd("creation"));var f="z"+t;this.stats[f]=(this.stats[f]||0)+1,this.total++;}if(c.source=e,i){if(t===l.maxZoom||t===i)continue;var d=1<1&&console.time("clipping");var g,v,m,y,x,w,S=.5*l.buffer/l.extent,b=.5-S,_=.5+S,I=1+S;g=v=m=y=null,x=pe(e,h,r-S,r+_,0,c.minX,c.maxX,l),w=pe(e,h,r+b,r+I,0,c.minX,c.maxX,l),e=null,x&&(g=pe(x,h,o-S,o+_,1,c.minY,c.maxY,l),v=pe(x,h,o+b,o+I,1,c.minY,c.maxY,l),x=null),w&&(m=pe(w,h,o-S,o+_,1,c.minY,c.maxY,l),y=pe(w,h,o+b,o+I,1,c.minY,c.maxY,l),w=null),u>1&&console.timeEnd("clipping"),a.push(g||[],t+1,2*r,2*o),a.push(v||[],t+1,2*r,2*o+1),a.push(m||[],t+1,2*r+1,2*o),a.push(y||[],t+1,2*r+1,2*o+1);}}},Pe.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=1<1&&console.log("drilling down to z%d-%d-%d",e,t,r);for(var l,u=e,h=t,p=r;!l&&u>0;)u--,h=Math.floor(h/2),p=Math.floor(p/2),l=this.tiles[ke(u,h,p)];return l&&l.source?(n>1&&console.log("found parent tile z%d-%d-%d",u,h,p),n>1&&console.time("drilling down"),this.splitTile(l.source,u,h,p,e,t,r),n>1&&console.timeEnd("drilling down"),this.tiles[a]?Se(this.tiles[a],i):null):null};var Te=function(t){function r(e,r,o,i,n){t.call(this,e,r,o,Ce),i&&(this.loadGeoJSON=i),this.projction=n;}return t&&(r.__proto__=t),(r.prototype=Object.create(t&&t.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 e.RequestPerformance(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."));!function e(t,r){var o,i=t&&t.type;if("FeatureCollection"===i)for(o=0;o1?"@2x":"",l=t.getJSON(i.transformRequest(i.normalizeSpriteURL(e,s,".json"),t.ResourceType.SpriteJSON),(function(t,e){l=null,n||(n=t,r=e,h());})),c=t.getImage(i.transformRequest(i.normalizeSpriteURL(e,s,".png"),t.ResourceType.SpriteImage),(function(t,e){c=null,n||(n=t,a=e,h());}));function h(){if(n)o(n);else if(r&&a){var e=t.browser.getImageData(a),i={};for(var s in r){var l=r[s],c=l.width,h=l.height,u=l.x,p=l.y,d=l.sdf,_=l.pixelRatio,f=l.stretchX,m=l.stretchY,g=l.content,v=new t.RGBAImage({width:c,height:h});t.RGBAImage.copy(e,v,{x:u,y:p},{x:0,y:0},{width:c,height:h}),i[s]={data:v,pixelRatio:_,sdf:d,stretchX:f,stretchY:m,content:g};}o(null,i);}}return {cancel:function(){l&&(l.cancel(),l=null),c&&(c.cancel(),c=null);}}}function p(t){var e=t.userImage;return !!(e&&e.render&&e.render())&&(t.data.replace(new Uint8Array(e.data.buffer)),!0)}i.suppressClick=function(){t.window.addEventListener("click",h,!0),t.window.setTimeout((function(){t.window.removeEventListener("click",h,!0);}),0);},i.mousePos=function(e,i){var o=e.getBoundingClientRect();return new t.Point(i.clientX-o.left-e.clientLeft,i.clientY-o.top-e.clientTop)},i.touchPos=function(e,i){for(var o=e.getBoundingClientRect(),r=[],a=0;a=0?0:e.button},i.remove=function(t){t.parentNode&&t.parentNode.removeChild(t);};var d=function(e){function i(){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&&(i.__proto__=e),(i.prototype=Object.create(e&&e.prototype)).constructor=i,i.prototype.isLoaded=function(){return this.loaded},i.prototype.setLoaded=function(t){if(this.loaded!==t&&(this.loaded=t,t)){for(var e=0,i=this.requestors;e=0?1.2:1));}function y(t,e,i,o,r,a,n){for(var s=0;s65535)e(new Error("glyphs > 65535 not supported"));else if(a.ranges[s])e(null,{stack:i,id:r,glyph:n});else {var l=a.requests[s];l||(l=a.requests[s]=[],b.loadGlyphRange(i,s,o.url,o.requestManager,(function(t,e){if(e){for(var i in e)o._doesCharSupportLocalGlyph(+i)||(a.glyphs[+i]=e[+i]);a.ranges[s]=!0;}for(var r=0,n=l;r1&&(s=t[++n]);var c=Math.abs(l-s.left),h=Math.abs(l-s.right),u=Math.min(c,h),p=void 0,d=r/i*(o+1);if(s.isDash){var _=o-Math.abs(d);p=Math.sqrt(u*u+_*_);}else p=o-Math.sqrt(u*u+d*d);this.data[a+l]=Math.max(0,Math.min(255,p+128));}},I.prototype.addRegularDash=function(t){for(var e=t.length-1;e>=0;--e){var i=t[e],o=t[e+1];i.zeroLength?t.splice(e,1):o&&o.isDash===i.isDash&&(o.left=i.left,t.splice(e,1));}var r=t[0],a=t[t.length-1];r.isDash===a.isDash&&(r.left=a.left-this.width,a.right=r.right+this.width);for(var n=this.width*this.nextRow,s=0,l=t[s],c=0;c1&&(l=t[++s]);var h=Math.abs(c-l.left),u=Math.abs(c-l.right),p=Math.min(h,u);this.data[n+c]=Math.max(0,Math.min(255,(l.isDash?p:-p)+128));}},I.prototype.addDash=function(e,i){var o=i?7:0,r=2*o+1;if(this.nextRow+r>this.height)return t.warnOnce("LineAtlas out of space"),null;for(var a=0,n=0;n=m&&t.x=g&&t.y0&&(l[new t.OverscaledTileID(e.overscaledZ,a,i.z,r,i.y-1).key]={backfilled:!1},l[new t.OverscaledTileID(e.overscaledZ,e.wrap,i.z,i.x,i.y-1).key]={backfilled:!1},l[new t.OverscaledTileID(e.overscaledZ,s,i.z,n,i.y-1).key]={backfilled:!1}),i.y+10&&(o.resourceTiming=e._resourceTiming,e._resourceTiming=[]),e.fire(new t.Event("data",o));}}));},i.prototype.onAdd=function(t){this.map=t,this.workerOptions.crs={epsgCode:this.map.getCRS().epsgCode,WKT:this.map.getCRS().getWKT(),_id:this.map.getCRS()._id},this.load();},i.prototype.setCustomprj=function(t){this._options.customprj=t,this.workerOptions.superclusterOptions.customprj=t,this.workerOptions.geojsonVtOptions.customprj=t,this.workerOptions.crs={epsgCode:this.map.getCRS().epsgCode,WKT:this.map.getCRS().getWKT(),_id:this.map.getCRS()._id},this.load();},i.prototype.setData=function(e){var i=this;return this._data=e,this.fire(new t.Event("dataloading",{dataType:"source"})),this._updateWorkerData((function(e){if(e)i.fire(new t.ErrorEvent(e));else {var o={dataType:"source",sourceDataType:"content"};i._collectResourceTiming&&i._resourceTiming&&i._resourceTiming.length>0&&(o.resourceTiming=i._resourceTiming,i._resourceTiming=[]),i.fire(new t.Event("data",o));}})),this},i.prototype.getData=function(){return this._originData?this._originData:"string"!=typeof this._data?this._data:void 0},i.prototype.getClusterExpansionZoom=function(t,e){return this.actor.send("geojson.getClusterExpansionZoom",{clusterId:t,source:this.id},e),this},i.prototype.getClusterChildren=function(t,e){return this.actor.send("geojson.getClusterChildren",{clusterId:t,source:this.id},e),this},i.prototype.getClusterLeaves=function(t,e,i,o){return this.actor.send("geojson.getClusterLeaves",{source:this.id,clusterId:t,limit:e,offset:i},o),this},i.prototype._updateWorkerData=function(e){var i=this;this._loaded=!1;var o=t.extend({},this.workerOptions),r=this._data;"string"==typeof r?(o.request=this.map._requestManager.transformRequest(t.browser.resolveURL(r),t.ResourceType.Source),o.request.collectResourceTiming=this._collectResourceTiming):o.data=JSON.stringify(r),this.actor.send(this.type+".loadData",o,(function(t,r){i._originData=r.data||null,i._removed||r&&r.abandoned||(i._loaded=!0,r&&r.resourceTiming&&r.resourceTiming[i.id]&&(i._resourceTiming=r.resourceTiming[i.id].slice(0)),i.actor.send(i.type+".coalesce",{source:o.source},null),e(t));}));},i.prototype.loaded=function(){return this._loaded},i.prototype.loadTile=function(e,i){var o=this,r=e.actor?"reloadTile":"loadTile";e.actor=this.actor,e.request=this.actor.send(r,{type:this.type,uid:e.uid,tileID:e.tileID,zoom:e.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:t.browser.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId},(function(t,a){return delete e.request,e.unloadVectorData(),e.aborted?i(null):t?i(t):(e.loadVectorData(a,o.map.painter,"reloadTile"===r),i(null))}));},i.prototype.abortTile=function(t){t.request&&(t.request.cancel(),delete t.request),t.aborted=!0;},i.prototype.unloadTile=function(t){t.unloadVectorData(),this.actor.send("removeTile",{uid:t.uid,type:this.type,source:this.id});},i.prototype.onRemove=function(){this._removed=!0,this.actor.send("removeSource",{type:this.type,source:this.id});},i.prototype.serialize=function(){return t.extend({},this._options,{type:this.type,data:this._data})},i.prototype.hasTransition=function(){return !1},i}(t.Evented),A=t.createLayout([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]),k=function(e){function i(t,i,o,r){e.call(this),this.id=t,this.dispatcher=o,this.coordinates=i.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(r),this.options=i;}return e&&(i.__proto__=e),(i.prototype=Object.create(e&&e.prototype)).constructor=i,i.prototype.load=function(e,i){var o=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(r,a){o._loaded=!0,r?o.fire(new t.ErrorEvent(r)):a&&(o.image=a,e&&(o.coordinates=e),i&&i(),o._finishLoading());}));},i.prototype.loaded=function(){return this._loaded},i.prototype.updateImage=function(t){var e=this;return this.image&&t.url?(this.options.url=t.url,this.load(t.coordinates,(function(){e.texture=null;})),this):this},i.prototype._finishLoading=function(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new t.Event("data",{dataType:"source",sourceDataType:"metadata"})));},i.prototype.onAdd=function(t){this.map=t,this.load();},i.prototype.setCoordinates=function(e){var i=this;this.coordinates=e;var o=e.map((function(t){return i.map.getCRS().fromLngLat(t)}));this.tileID=function(e,i){for(var o=1/0,r=1/0,a=-1/0,n=-1/0,s=0,l=e;si.end(0)?this.fire(new t.ErrorEvent(new t.ValidationError("sources."+this.id,null,"Playback for this video can be set only between the "+i.start(0)+" and "+i.end(0)+"-second mark."))):this.video.currentTime=e;}},i.prototype.getVideo=function(){return this.video},i.prototype.onAdd=function(t){this.map||(this.map=t,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)));},i.prototype.prepare=function(){if(!(0===Object.keys(this.tiles).length||this.video.readyState<2)){var e=this.map.painter.context,i=e.gl;for(var o in this.boundsBuffer||(this.boundsBuffer=e.createVertexBuffer(this._boundsArray,A.members)),this.boundsSegments||(this.boundsSegments=t.SegmentVector.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(i.LINEAR,i.CLAMP_TO_EDGE),i.texSubImage2D(i.TEXTURE_2D,0,0,0,i.RGBA,i.UNSIGNED_BYTE,this.video),this._firstFrameRendered=!0):(this.texture=new t.Texture(e,this.video,i.RGBA),this.texture.bind(i.LINEAR,i.CLAMP_TO_EDGE)),this.tiles){var r=this.tiles[o];"loaded"!==r.state&&(r.state="loaded",r.texture=this.texture);}}},i.prototype.serialize=function(){return {type:"video",urls:this.urls,coordinates:this.coordinates}},i.prototype.hasTransition=function(){return this.video&&!this.video.paused},i}(k),B=function(e){function i(i,o,r,a){e.call(this,i,o,r,a),o.coordinates?Array.isArray(o.coordinates)&&4===o.coordinates.length&&!o.coordinates.some((function(t){return !Array.isArray(t)||2!==t.length||t.some((function(t){return "number"!=typeof t}))}))||this.fire(new t.ErrorEvent(new t.ValidationError("sources."+i,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new t.ErrorEvent(new t.ValidationError("sources."+i,null,'missing required property "coordinates"'))),o.animate&&"boolean"!=typeof o.animate&&this.fire(new t.ErrorEvent(new t.ValidationError("sources."+i,null,'optional "animate" property must be a boolean value'))),o.canvas?"string"==typeof o.canvas||o.canvas instanceof t.window.HTMLCanvasElement||this.fire(new t.ErrorEvent(new t.ValidationError("sources."+i,null,'"canvas" must be either a string representing the ID of the canvas element from which to read, or an HTMLCanvasElement instance'))):this.fire(new t.ErrorEvent(new t.ValidationError("sources."+i,null,'missing required property "canvas"'))),this.options=o,this.animate=void 0===o.animate||o.animate;}return e&&(i.__proto__=e),(i.prototype=Object.create(e&&e.prototype)).constructor=i,i.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());},i.prototype.getCanvas=function(){return this.canvas},i.prototype.onAdd=function(t){this.map=t,this.load(),this.canvas&&this.animate&&this.play();},i.prototype.onRemove=function(){this.pause();},i.prototype.prepare=function(){var e=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,e=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,e=!0),!this._hasInvalidDimensions()&&0!==Object.keys(this.tiles).length){var i=this.map.painter.context,o=i.gl;for(var r in this.boundsBuffer||(this.boundsBuffer=i.createVertexBuffer(this._boundsArray,A.members)),this.boundsSegments||(this.boundsSegments=t.SegmentVector.simpleSegment(0,0,4,2)),this.texture?(e||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new t.Texture(i,this.canvas,o.RGBA,{premultiply:!0}),this.tiles){var a=this.tiles[r];"loaded"!==a.state&&(a.state="loaded",a.texture=this.texture);}}},i.prototype.serialize=function(){return {type:"canvas",coordinates:this.coordinates}},i.prototype.hasTransition=function(){return this._playing},i.prototype._hasInvalidDimensions=function(){for(var t=0,e=[this.canvas.width,this.canvas.height];tthis.max){var n=this._getAndRemoveByKey(this.order[0]);n&&this.onRemove(n);}return this},Z.prototype.has=function(t){return t.wrapped().key in this.data},Z.prototype.getAndRemove=function(t){return this.has(t)?this._getAndRemoveByKey(t.wrapped().key):null},Z.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},Z.prototype.getByKey=function(t){var e=this.data[t];return e?e[0].value:null},Z.prototype.get=function(t){return this.has(t)?this.data[t.wrapped().key][0].value:null},Z.prototype.remove=function(t,e){if(!this.has(t))return this;var i=t.wrapped().key,o=void 0===e?0:this.data[i].indexOf(e),r=this.data[i][o];return this.data[i].splice(o,1),r.timeout&&clearTimeout(r.timeout),0===this.data[i].length&&delete this.data[i],this.onRemove(r.value),this.order.splice(this.order.indexOf(i),1),this},Z.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},Z.prototype.filter=function(t){var e=[];for(var i in this.data)for(var o=0,r=this.data[i];o1||(Math.abs(i)>1&&(1===Math.abs(i+r)?i+=r:1===Math.abs(i-r)&&(i-=r)),e.dem&&t.dem&&(t.dem.backfillBorder(e.dem,i,o),t.neighboringTiles&&t.neighboringTiles[a]&&(t.neighboringTiles[a].backfilled=!0)));}},i.prototype.getTile=function(t){return this.getTileByID(t.key)},i.prototype.getTileByID=function(t){return this._tiles[t]},i.prototype._retainLoadedChildren=function(t,e,i,o){for(var r in this._tiles){var a=this._tiles[r];if(!(o[r]||!a.hasData()||a.tileID.overscaledZ<=e||a.tileID.overscaledZ>i)){for(var n=a.tileID;a&&a.tileID.overscaledZ>e+1;){var s=a.tileID.scaledTo(a.tileID.overscaledZ-1);(a=this._tiles[s.key])&&a.hasData()&&(n=s);}for(var l=n;l.overscaledZ>e;)if(t[(l=l.scaledTo(l.overscaledZ-1)).key]){o[n.key]=n;break}}}},i.prototype.findLoadedParent=function(t,e){if(t.key in this._loadedParentTiles){var i=this._loadedParentTiles[t.key];return i&&i.tileID.overscaledZ>=e?i:null}for(var o=t.overscaledZ-1;o>=e;o--){var r=t.scaledTo(o),a=this._getLoadedTile(r);if(a)return a}},i.prototype._getLoadedTile=function(t){var e=this._tiles[t.key];return e&&e.hasData()?e:this._cache.getByKey(t.wrapped().key)},i.prototype.updateCacheSize=function(t){var e=Math.ceil(t.width/this._source.tileSize)+1,i=Math.ceil(t.height/this._source.tileSize)+1,o=Math.floor(e*i*5),r="number"==typeof this._maxTileCacheSize?Math.min(this._maxTileCacheSize,o):o;this._cache.setMaxSize(r);},i.prototype.handleWrapJump=function(t){var e=Math.round((t-(void 0===this._prevLng?t:this._prevLng))/360);if(this._prevLng=t,e){var i={};for(var o in this._tiles){var r=this._tiles[o];r.tileID=r.tileID.unwrapTo(r.tileID.wrap+e),i[r.tileID.key]=r;}for(var a in this._tiles=i,this._timers)clearTimeout(this._timers[a]),delete this._timers[a];for(var n in this._tiles)this._setTileReloadTimer(n,this._tiles[n]);}},i.prototype.update=function(e){var o=this;if(this.transform=e,this._sourceLoaded&&!this._paused){var r;this.updateCacheSize(e),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used?this._source.tileID?r=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.indexExtent)})):(r=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&&(r=r.filter((function(t){return o._source.hasTile(t)})))):r=[];var a=e.coveringZoomLevel(this._source),n=Math.max(a-i.maxOverzooming,this._source.minzoom),s=Math.max(a+i.maxUnderzooming,this._source.minzoom),l=this._updateRetainedTiles(r,a);if(kt(this._source.type)){for(var c={},h={},u=0,p=Object.keys(l);uthis._source.maxzoom){var m=_.children(this._source.maxzoom)[0],g=this.getTile(m);if(g&&g.hasData()){o[m.key]=m;continue}}else {var v=_.children(this._source.maxzoom);if(o[v[0].key]&&o[v[1].key]&&o[v[2].key]&&o[v[3].key])continue}for(var y=f.wasRequested(),x=_.overscaledZ-1;x>=a;--x){var b=_.scaledTo(x);if(r[b.key])break;if(r[b.key]=!0,!(f=this.getTile(b))&&y&&(f=this._addTile(b)),f&&(o[b.key]=b,y=f.wasRequested(),f.hasData()))break}}}return o},i.prototype._updateLoadedParentTileCache=function(){for(var t in this._loadedParentTiles={},this._tiles){for(var e=[],i=void 0,o=this._tiles[t].tileID;o.overscaledZ>0;){if(o.key in this._loadedParentTiles){i=this._loadedParentTiles[o.key];break}e.push(o.key);var r=o.scaledTo(o.overscaledZ-1);if(i=this._getLoadedTile(r))break;o=r;}for(var a=0,n=e;a0||(e.hasData()&&"reloading"!==e.state?this._cache.add(e.tileID,e,e.getExpiryTimeout()):(e.aborted=!0,this._abortTile(e),this._unloadTile(e))));},i.prototype.clearTiles=function(){for(var t in this._shouldReloadOnResume=!1,this._paused=!1,this._tiles)this._removeTile(t);this._cache.reset();},i.prototype.tilesIn=function(e,i,o){var r=this,a=[],n=this.transform;if(!n)return a;for(var s=o?n.getCameraQueryGeometry(e):e,l=e.map((function(t){return n.pointCoordinate(t)})),c=s.map((function(t){return n.pointCoordinate(t)})),h=this.getIds(),u=1/0,p=1/0,d=-1/0,_=-1/0,f=0,m=c;f=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)}));a.push({tile:o,tileID:s,queryGeometry:v,cameraQueryGeometry:y,scale:f});}}},y=0;y=t.browser.now())return !0}return !1},i.prototype.setFeatureState=function(t,e,i){this._state.updateState(t=t||"_geojsonTileLayer",e,i);},i.prototype.removeFeatureState=function(t,e,i){this._state.removeFeatureState(t=t||"_geojsonTileLayer",e,i);},i.prototype.getFeatureState=function(t,e){return this._state.getState(t=t||"_geojsonTileLayer",e)},i.prototype.setDependencies=function(t,e,i){var o=this._tiles[t];o&&o.setDependencies(e,i);},i.prototype.reloadTilesForDependencies=function(t,e){for(var i in this._tiles)this._tiles[i].hasDependency(t,e)&&this._reloadTile(i,"reloading");this._cache.filter((function(i){return !i.hasDependency(t,e)}));},i}(t.Evented);function At(t,e){var i=Math.abs(2*t.wrap)-+(t.wrap<0),o=Math.abs(2*e.wrap)-+(e.wrap<0);return t.overscaledZ-e.overscaledZ||o-i||e.canonical.y-t.canonical.y||e.canonical.x-t.canonical.x}function kt(t){return "raster"===t||"image"===t||"video"===t}function Ot(){return new t.window.Worker(ta.workerUrl)}Rt.maxOverzooming=10,Rt.maxUnderzooming=3;var Bt="mapboxgl_preloaded_worker_pool",Ft=function(){this.active={};};Ft.prototype.acquire=function(t){if(!this.workers)for(this.workers=[];this.workers.length0?(r-n)/s:0;return this.points[a].mult(1-l).add(this.points[i].mult(l))};var $t=function(t,e,i){var o=this.boxCells=[],r=this.circleCells=[];this.xCellCount=Math.ceil(t/i),this.yCellCount=Math.ceil(e/i);for(var a=0;a=-e[0]&&i<=e[0]&&o>=-e[1]&&o<=e[1]}function ae(e,i,o,r,a,n,s,l){var c=r?e.textSizeData:e.iconSizeData,h=t.evaluateSizeForZoom(c,o.transform.zoom),u=[256/o.width*2+1,256/o.height*2+1],p=r?e.text.dynamicLayoutVertexArray:e.icon.dynamicLayoutVertexArray;p.clear();for(var d=e.lineVertexArray,_=r?e.text.placedSymbolArray:e.icon.placedSymbolArray,f=o.transform.width/o.transform.height,m=!1,g=0;g<_.length;g++){var v=_.get(g);if(v.hidden||v.writingMode===t.WritingMode.vertical&&!m)pe(v.numGlyphs,p);else {m=!1;var y=[v.anchorX,v.anchorY,0,1];if(t.transformMat4(y,y,i),re(y,u)){var x=oe(o.transform.cameraToCenterDistance,y[3]),b=t.evaluateSizeForFeature(c,h,v),w=s?b/x:b*x,E=new t.Point(v.anchorX,v.anchorY),T=ie(E,a).point,S={},I=le(v,w,!1,l,i,a,n,e.glyphOffsetArray,d,p,T,E,S,f);m=I.useVertical,(I.notEnoughRoom||m||I.needsFlipping&&le(v,w,!0,l,i,a,n,e.glyphOffsetArray,d,p,T,E,S,f).notEnoughRoom)&&pe(v.numGlyphs,p);}else pe(v.numGlyphs,p);}}r?e.text.dynamicLayoutVertexBuffer.updateData(p):e.icon.dynamicLayoutVertexBuffer.updateData(p);}function ne(t,e,i,o,r,a,n,s,l,c,h){var u=s.glyphStartIndex+s.numGlyphs,p=s.lineStartIndex,d=s.lineStartIndex+s.lineLength,_=e.getoffsetX(s.glyphStartIndex),f=e.getoffsetX(u-1),m=he(t*_,i,o,r,a,n,s.segment,p,d,l,c,h);if(!m)return null;var g=he(t*f,i,o,r,a,n,s.segment,p,d,l,c,h);return g?{first:m,last:g}:null}function se(e,i,o,r){return e===t.WritingMode.horizontal&&Math.abs(o.y-i.y)>Math.abs(o.x-i.x)*r?{useVertical:!0}:(e===t.WritingMode.vertical?i.yo.x)?{needsFlipping:!0}:null}function le(e,i,o,r,a,n,s,l,c,h,u,p,d,_){var f,m=i/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=ne(m,l,g,v,o,u,p,e,c,n,d);if(!w)return {notEnoughRoom:!0};var E=ie(w.first.point,s).point,T=ie(w.last.point,s).point;if(r&&!o){var S=se(e.writingMode,E,T,_);if(S)return S}f=[w.first];for(var I=e.glyphStartIndex+1;I0?M.point:ce(p,z,P,1,a),D=se(e.writingMode,P,L,_);if(D)return D}var R=he(m*l.getoffsetX(e.glyphStartIndex),g,v,o,u,p,e.segment,e.lineStartIndex,e.lineStartIndex+e.lineLength,c,n,d);if(!R)return {notEnoughRoom:!0};f=[R];}for(var A=0,k=f;A0?1:-1,f=0;r&&(_*=-1,f=Math.PI),_<0&&(f+=Math.PI);for(var m=_>0?l+s:l+s+1,g=a,v=a,y=0,x=0,b=Math.abs(d),w=[];y+x<=b;){if((m+=_)=c)return null;if(v=g,w.push(g),void 0===(g=p[m])){var E=new t.Point(h.getx(m),h.gety(m)),T=ie(E,u);if(T.signedDistanceFromCamera>0)g=p[m]=T.point;else {var S=m-_;g=ce(0===y?n:new t.Point(h.getx(S),h.gety(S)),E,v,b-y+1,u);}}y+=x,x=v.dist(g);}var I=(b-y)/x,P=g.sub(v),C=P.mult(I)._add(v);C._add(P._unit()._perp()._mult(o*_));var z=f+Math.atan2(g.y-v.y,g.x-v.x);return w.push(C),{point:C,angle:z,path:w}}$t.prototype.keysLength=function(){return this.boxKeys.length+this.circleKeys.length},$t.prototype.insert=function(t,e,i,o,r){this._forEachCell(e,i,o,r,this._insertBoxCell,this.boxUid++),this.boxKeys.push(t),this.bboxes.push(e),this.bboxes.push(i),this.bboxes.push(o),this.bboxes.push(r);},$t.prototype.insertCircle=function(t,e,i,o){this._forEachCell(e-o,i-o,e+o,i+o,this._insertCircleCell,this.circleUid++),this.circleKeys.push(t),this.circles.push(e),this.circles.push(i),this.circles.push(o);},$t.prototype._insertBoxCell=function(t,e,i,o,r,a){this.boxCells[r].push(a);},$t.prototype._insertCircleCell=function(t,e,i,o,r,a){this.circleCells[r].push(a);},$t.prototype._query=function(t,e,i,o,r,a){if(i<0||t>this.width||o<0||e>this.height)return !r&&[];var n=[];if(t<=0&&e<=0&&this.width<=i&&this.height<=o){if(r)return !0;for(var s=0;s0:n},$t.prototype._queryCircle=function(t,e,i,o,r){var a=t-i,n=t+i,s=e-i,l=e+i;if(n<0||a>this.width||l<0||s>this.height)return !o&&[];var c=[];return this._forEachCell(a,s,n,l,this._queryCellCircle,c,{hitTest:o,circle:{x:t,y:e,radius:i},seenUids:{box:{},circle:{}}},r),o?c.length>0:c},$t.prototype.query=function(t,e,i,o,r){return this._query(t,e,i,o,!1,r)},$t.prototype.hitTest=function(t,e,i,o,r){return this._query(t,e,i,o,!0,r)},$t.prototype.hitTestCircle=function(t,e,i,o){return this._queryCircle(t,e,i,!0,o)},$t.prototype._queryCell=function(t,e,i,o,r,a,n,s){var l=n.seenUids,c=this.boxCells[r];if(null!==c)for(var h=this.bboxes,u=0,p=c;u=h[_+0]&&o>=h[_+1]&&(!s||s(this.boxKeys[d]))){if(n.hitTest)return a.push(!0),!0;a.push({key:this.boxKeys[d],x1:h[_],y1:h[_+1],x2:h[_+2],y2:h[_+3]});}}}var f=this.circleCells[r];if(null!==f)for(var m=this.circles,g=0,v=f;gn*n+s*s},$t.prototype._circleAndRectCollide=function(t,e,i,o,r,a,n){var s=(a-o)/2,l=Math.abs(t-(o+s));if(l>s+i)return !1;var c=(n-r)/2,h=Math.abs(e-(r+c));if(h>c+i)return !1;if(l<=s||h<=c)return !0;var u=l-s,p=h-c;return u*u+p*p<=i*i};var ue=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function pe(t,e){for(var i=0;i=1;L--)M.push(C.path[L]);for(var D=1;D0){for(var O=M[0].clone(),B=M[0].clone(),F=1;F=S.x&&B.x<=I.x&&O.y>=S.y&&B.y<=I.y?[M]:B.xI.x||B.yI.y?[]:t.clipLine([M],S.x,S.y,I.x,I.y);}for(var U=0,N=k;U=this.screenRightBoundary||o<100||e>this.screenBottomBoundary},_e.prototype.isInsideGrid=function(t,e,i,o){return i>=0&&t=0&&e0?(this.prevPlacement&&this.prevPlacement.variableOffsets[u.crossTileID]&&this.prevPlacement.placements[u.crossTileID]&&this.prevPlacement.placements[u.crossTileID].text&&(f=this.prevPlacement.variableOffsets[u.crossTileID].anchor),this.variableOffsets[u.crossTileID]={textOffset:m,width:i,height:o,anchor:t,textBoxScale:r,prevAnchor:f},this.markUsedJustification(p,t,u,d),p.allowVerticalPlacement&&(this.markUsedOrientation(p,d,u),this.placedOrientations[u.crossTileID]=d),{shift:g,placedGlyphBoxes:v}):void 0},Te.prototype.placeLayerBucketPart=function(e,i,o){var r=this,a=e.parameters,n=a.bucket,s=a.layout,l=a.posMatrix,c=a.textLabelPlaneMatrix,h=a.labelToScreenMatrix,u=a.textPixelRatio,p=a.holdingForFade,d=a.collisionBoxArray,_=a.partiallyEvaluatedTextSize,f=a.collisionGroup,m=s.get("text-optional"),g=s.get("icon-optional"),v=s.get("text-allow-overlap"),y=s.get("icon-allow-overlap"),x="map"===s.get("text-rotation-alignment"),b="map"===s.get("text-pitch-alignment"),w="none"!==s.get("icon-text-fit"),E="viewport-y"===s.get("symbol-z-order"),T=v&&(y||!n.hasIconData()||g),S=y&&(v||!n.hasTextData()||m);!n.collisionArrays&&d&&n.deserializeCollisionBoxes(d);var I=function(e,a){if(!i[e.crossTileID])if(p)r.placements[e.crossTileID]=new ve(!1,!1,!1);else {var d,E=!1,I=!1,P=!0,C=null,z={box:null,offscreen:null},M={box:null,offscreen:null},L=null,D=null,R=0,A=0,k=0;a.textFeatureIndex?R=a.textFeatureIndex:e.useRuntimeCollisionCircles&&(R=e.featureIndex),a.verticalTextFeatureIndex&&(A=a.verticalTextFeatureIndex);var O=a.textBox;if(O){var B=function(i){var o=t.WritingMode.horizontal;if(n.allowVerticalPlacement&&!i&&r.prevPlacement){var a=r.prevPlacement.placedOrientations[e.crossTileID];a&&(r.placedOrientations[e.crossTileID]=a,r.markUsedOrientation(n,o=a,e));}return o},F=function(i,o){if(n.allowVerticalPlacement&&e.numVerticalGlyphVertices>0&&a.verticalTextBox)for(var r=0,s=n.writingModes;r0&&(U=U.filter((function(t){return t!==N.anchor}))).unshift(N.anchor);}var j=function(t,i,o){for(var a=t.x2-t.x1,s=t.y2-t.y1,c=e.textBoxScale,h=w&&!y?i:null,p={box:[],offscreen:!1},d=v?2*U.length:U.length,_=0;_=U.length,e,n,o,h);if(m&&(p=m.placedGlyphBoxes)&&p.box&&p.box.length){E=!0,C=m.shift;break}}return p};F((function(){return j(O,a.iconBox,t.WritingMode.horizontal)}),(function(){var i=a.verticalTextBox;return n.allowVerticalPlacement&&!(z&&z.box&&z.box.length)&&e.numVerticalGlyphVertices>0&&i?j(i,a.verticalIconBox,t.WritingMode.vertical):{box:null,offscreen:null}})),z&&(E=z.box,P=z.offscreen);var Z=B(z&&z.box);if(!E&&r.prevPlacement){var q=r.prevPlacement.variableOffsets[e.crossTileID];q&&(r.variableOffsets[e.crossTileID]=q,r.markUsedJustification(n,q.anchor,e,Z));}}else {var G=function(t,i){var o=r.collisionIndex.placeCollisionBox(t,v,u,l,f.predicate);return o&&o.box&&o.box.length&&(r.markUsedOrientation(n,i,e),r.placedOrientations[e.crossTileID]=i),o};F((function(){return G(O,t.WritingMode.horizontal)}),(function(){var i=a.verticalTextBox;return n.allowVerticalPlacement&&e.numVerticalGlyphVertices>0&&i?G(i,t.WritingMode.vertical):{box:null,offscreen:null}})),B(z&&z.box&&z.box.length);}}if(E=(d=z)&&d.box&&d.box.length>0,P=d&&d.offscreen,e.useRuntimeCollisionCircles){var V=n.text.placedSymbolArray.get(e.centerJustifiedTextSymbolIndex),W=t.evaluateSizeForFeature(n.textSizeData,_,V),X=s.get("text-padding");L=r.collisionIndex.placeCollisionCircles(v,V,n.lineVertexArray,n.glyphOffsetArray,W,l,c,h,o,b,f.predicate,e.collisionCircleDiameter,X),E=v||L.circles.length>0&&!L.collisionDetected,P=P&&L.offscreen;}if(a.iconFeatureIndex&&(k=a.iconFeatureIndex),a.iconBox){var H=function(t){var e=w&&C?Ee(t,C.x,C.y,x,b,r.transform.angle):t;return r.collisionIndex.placeCollisionBox(e,y,u,l,f.predicate)};I=M&&M.box&&M.box.length&&a.verticalIconBox?(D=H(a.verticalIconBox)).box.length>0:(D=H(a.iconBox)).box.length>0,P=P&&D.offscreen;}var K=m||0===e.numHorizontalGlyphVertices&&0===e.numVerticalGlyphVertices,Y=g||0===e.numIconVertices;if(K||Y?Y?K||(I=I&&E):E=I&&E:I=E=I&&E,E&&d&&d.box&&r.collisionIndex.insertCollisionBox(d.box,s.get("text-ignore-placement"),n.bucketInstanceId,M&&M.box&&A?A:R,f.ID),I&&D&&r.collisionIndex.insertCollisionBox(D.box,s.get("icon-ignore-placement"),n.bucketInstanceId,k,f.ID),L&&(E&&r.collisionIndex.insertCollisionCircles(L.circles,s.get("text-ignore-placement"),n.bucketInstanceId,R,f.ID),o)){var J=n.bucketInstanceId,Q=r.collisionCircleArrays[J];void 0===Q&&(Q=r.collisionCircleArrays[J]=new ye);for(var $=0;$=0;--C){var z=P[C];I(n.symbolInstances.get(z),n.collisionArrays[z]);}else for(var M=e.symbolInstanceStart;M=0&&(e.text.placedSymbolArray.get(l).crossTileID=a>=0&&l!==a?0:o.crossTileID);}},Te.prototype.markUsedOrientation=function(e,i,o){for(var r=i===t.WritingMode.horizontal||i===t.WritingMode.horizontalOnly?i:0,a=i===t.WritingMode.vertical?i:0,n=0,s=[o.leftJustifiedTextSymbolIndex,o.centerJustifiedTextSymbolIndex,o.rightJustifiedTextSymbolIndex];n0,v=r.placedOrientations[a.crossTileID],y=v===t.WritingMode.vertical,x=v===t.WritingMode.horizontal||v===t.WritingMode.horizontalOnly;if(s>0||l>0){var b=Re(m.text);_(e.text,s,y?Ae:b),_(e.text,l,x?Ae:b);var w=m.text.isHidden();[a.rightJustifiedTextSymbolIndex,a.centerJustifiedTextSymbolIndex,a.leftJustifiedTextSymbolIndex].forEach((function(t){t>=0&&(e.text.placedSymbolArray.get(t).hidden=w||y?1:0);})),a.verticalPlacedTextSymbolIndex>=0&&(e.text.placedSymbolArray.get(a.verticalPlacedTextSymbolIndex).hidden=w||x?1:0);var E=r.variableOffsets[a.crossTileID];E&&r.markUsedJustification(e,E.anchor,a,v);var T=r.placedOrientations[a.crossTileID];T&&(r.markUsedJustification(e,"left",a,T),r.markUsedOrientation(e,T,a));}if(g){var S=Re(m.icon),I=!(p&&a.verticalPlacedIconSymbolIndex&&y);a.placedIconSymbolIndex>=0&&(_(e.icon,a.numIconVertices,I?S:Ae),e.icon.placedSymbolArray.get(a.placedIconSymbolIndex).hidden=m.icon.isHidden()),a.verticalPlacedIconSymbolIndex>=0&&(_(e.icon,a.numVerticalIconVertices,I?Ae:S),e.icon.placedSymbolArray.get(a.verticalPlacedIconSymbolIndex).hidden=m.icon.isHidden());}if(e.hasIconCollisionBoxData()||e.hasTextCollisionBoxData()){var P=e.collisionArrays[o];if(P){var C=new t.Point(0,0);if(P.textBox||P.verticalTextBox){var z=!0;if(c){var M=r.variableOffsets[f];M?(C=we(M.anchor,M.width,M.height,M.textOffset,M.textBoxScale),h&&C._rotate(u?r.transform.angle:-r.transform.angle)):z=!1;}P.textBox&&Se(e.textCollisionBox.collisionVertexArray,m.text.placed,!z||y,C.x,C.y),P.verticalTextBox&&Se(e.textCollisionBox.collisionVertexArray,m.text.placed,!z||x,C.x,C.y);}var L=Boolean(!x&&P.verticalIconBox);P.iconBox&&Se(e.iconCollisionBox.collisionVertexArray,m.icon.placed,L,p?C.x:0,p?C.y:0),P.verticalIconBox&&Se(e.iconCollisionBox.collisionVertexArray,m.icon.placed,!L,p?C.x:0,p?C.y:0);}}},m=0;mt},Te.prototype.setStale=function(){this.stale=!0;};var Ie=Math.pow(2,25),Pe=Math.pow(2,24),Ce=Math.pow(2,17),ze=Math.pow(2,16),Me=Math.pow(2,9),Le=Math.pow(2,8),De=Math.pow(2,1);function Re(t){if(0===t.opacity&&!t.placed)return 0;if(1===t.opacity&&t.placed)return 4294967295;var e=t.placed?1:0,i=Math.floor(127*t.opacity);return i*Ie+e*Pe+i*Ce+e*ze+i*Me+e*Le+i*De+e}var Ae=0,ke=function(t){this._sortAcrossTiles="viewport-y"!==t.layout.get("symbol-z-order")&&void 0!==t.layout.get("symbol-sort-key").constantOr(1),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[];};ke.prototype.continuePlacement=function(t,e,i,o,r){for(var a=this._bucketParts;this._currentTileIndex2};this._currentPlacementIndex>=0;){var s=i[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 ke(s)),this._inProgressLayer.continuePlacement(o[s.source],this.placement,this._showCollisionBoxes,s,n))return;delete this._inProgressLayer;}this._currentPlacementIndex--;}this._done=!0;},Oe.prototype.commit=function(t){return this.placement.commit(t),this.placement};var Be=512/t.EXTENT/2,Fe=function(t,e,i){this.tileID=t,this.indexedSymbolInstances={},this.bucketInstanceId=i;for(var o=0;ot.overscaledZ)for(var s in n){var l=n[s];l.tileID.isChildOf(t)&&l.findMatches(e.symbolInstances,t,r);}else {var c=n[t.scaledTo(Number(a)).key];c&&c.findMatches(e.symbolInstances,t,r);}}for(var h=0;h0)throw new Error("Unimplemented: "+r.map((function(t){return t.command})).join(", ")+".");return o.forEach((function(t){"setTransition"!==t.command&&i[t.command].apply(i,t.args);})),this.stylesheet=e,!0},i.prototype.addImage=function(e,i,o){if(this.getImage(e))return this.fire(new t.ErrorEvent(new Error("An image with this name already exists.")));this.imageManagerFactory.addImage(e,i,o),this._afterImageUpdated(e);},i.prototype.updateImage=function(t,e,i){this.imageManagerFactory.updateImage(t,e,i);},i.prototype.getImage=function(t,e){return this.imageManagerFactory.getImage(t,e)},i.prototype.removeImage=function(e,i){if(!this.getImage(e))return this.fire(new t.ErrorEvent(new Error("No image with this name exists.")));this.imageManagerFactory.removeImage(e,i),this._afterImageUpdated(e);},i.prototype._afterImageUpdated=function(e){this._availableImages=this.imageManagerFactory.listImages(),this._changedImages[e]=!0,this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new t.Event("data",{dataType:"style"}));},i.prototype.listImages=function(t){return this._checkLoaded(),this.imageManagerFactory.listImages(t)},i.prototype.addSource=function(e,i,o){var r=this;if(void 0===o&&(o={}),this._checkLoaded(),void 0!==this.sourceCaches[e])throw new Error("There is already a source with this ID");if(!i.type)throw new Error("The type property must be defined, but only the following properties were given: "+Object.keys(i).join(", ")+".");if(this.map._mapCRS&&"geojson"===i.type&&i.data&&!i.data.customprj&&!i.customprj&&(i.customprj=this.map.customConvertPoint),!(["vector","raster","geojson","video","image"].indexOf(i.type)>=0&&this._validate(t.validateStyle.source,"sources."+e,i,null,o))){this.map&&this.map._collectResourceTiming&&(i.collectResourceTiming=!0);var a=this.sourceCaches[e]=new Rt(e,i,this.dispatcher);a.style=this,a.setEventedParent(this,(function(){return {isSourceLoaded:r.loaded(),source:a.serialize(),sourceId:e}})),a.onAdd(this.map),this._changed=!0;}},i.prototype.removeSource=function(e){if(this._checkLoaded(),void 0===this.sourceCaches[e])throw new Error("There is no source with this ID");for(var i in this._layers)if(this._layers[i].source===e)return this.fire(new t.ErrorEvent(new Error('Source "'+e+'" cannot be removed while layer "'+i+'" is using it.')));var o=this.sourceCaches[e];delete this.sourceCaches[e],delete this._updatedSources[e],o.fire(new t.Event("data",{sourceDataType:"metadata",dataType:"source",sourceId:e})),o.setEventedParent(null),o.clearTiles(),o.onRemove&&o.onRemove(this.map),this._changed=!0;},i.prototype.setGeoJSONSourceData=function(t,e){this._checkLoaded(),this.sourceCaches[t].getSource().setData(e),this._changed=!0;},i.prototype.getSource=function(t){return this.sourceCaches[t]&&this.sourceCaches[t].getSource()},i.prototype.addLayer=function(e,i,o){void 0===o&&(o={}),this._checkLoaded();var r=e.id;if(this.getLayer(r))this.fire(new t.ErrorEvent(new Error('Layer with id "'+r+'" already exists on this map')));else {var a;if("custom"===e.type){if(Ze(this,t.validateCustomStyleLayer(e)))return;a=t.createStyleLayer(e);}else {if("object"==typeof e.source&&(this.addSource(r,e.source),e=t.clone$1(e),e=t.extend(e,{source:r})),this._validate(t.validateStyle.layer,"layers."+r,e,{arrayIndex:-1},o))return;a=t.createStyleLayer(e),this._validateLayer(a),a.setEventedParent(this,{layer:{id:r}}),this._serializedLayers[a.id]=a.serialize();}var n=i?this._order.indexOf(i):this._order.length;if(i&&-1===n)this.fire(new t.ErrorEvent(new Error('Layer with id "'+i+'" does not exist on this map.')));else {if(this._order.splice(n,0,r),this._layerOrderChanged=!0,this._layers[r]=a,this._removedLayers[r]&&a.source&&"custom"!==a.type){var s=this._removedLayers[r];delete this._removedLayers[r],s.type!==a.type?this._updatedSources[a.source]="clear":(this._updatedSources[a.source]="reload",this.sourceCaches[a.source].pause());}this._updateLayer(a),a.onAdd&&a.onAdd(this.map);}}},i.prototype.moveLayer=function(e,i){if(this._checkLoaded(),this._changed=!0,this._layers[e]){if(e!==i){var o=this._order.indexOf(e);this._order.splice(o,1);var r=i?this._order.indexOf(i):this._order.length;i&&-1===r?this.fire(new t.ErrorEvent(new Error('Layer with id "'+i+'" does not exist on this map.'))):(this._order.splice(r,0,e),this._layerOrderChanged=!0);}}else this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be moved.")));},i.prototype.removeLayer=function(e){this._checkLoaded();var i=this._layers[e];if(i){i.setEventedParent(null);var o=this._order.indexOf(e);this._order.splice(o,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[e]=i,delete this._layers[e],delete this._serializedLayers[e],delete this._updatedLayers[e],delete this._updatedPaintProps[e],i.onRemove&&i.onRemove(this.map);}else this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be removed.")));},i.prototype.getLayer=function(t){return this._layers[t]},i.prototype.hasLayer=function(t){return t in this._layers},i.prototype.setLayerZoomRange=function(e,i,o){this._checkLoaded();var r=this.getLayer(e);r?r.minzoom===i&&r.maxzoom===o||(null!=i&&(r.minzoom=i),null!=o&&(r.maxzoom=o),this._updateLayer(r)):this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot have zoom extent.")));},i.prototype.setFilter=function(e,i,o){void 0===o&&(o={}),this._checkLoaded();var r=this.getLayer(e);if(r){if(!t.deepEqual(r.filter,i))return null==i?(r.filter=void 0,void this._updateLayer(r)):void(this._validate(t.validateStyle.filter,"layers."+r.id+".filter",i,null,o)||(r.filter=t.clone$1(i),this._updateLayer(r)))}else this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be filtered.")));},i.prototype.getFilter=function(e){return t.clone$1(this.getLayer(e).filter)},i.prototype.setLayoutProperty=function(e,i,o,r){void 0===r&&(r={}),this._checkLoaded();var a=this.getLayer(e);a?t.deepEqual(a.getLayoutProperty(i),o)||(a.setLayoutProperty(i,o,r),this._updateLayer(a)):this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be styled.")));},i.prototype.getLayoutProperty=function(e,i){var o=this.getLayer(e);if(o)return o.getLayoutProperty(i);this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style.")));},i.prototype.setPaintProperty=function(e,i,o,r){void 0===r&&(r={}),this._checkLoaded();var a=this.getLayer(e);a?t.deepEqual(a.getPaintProperty(i),o)||(a.setPaintProperty(i,o,r)&&this._updateLayer(a),this._changed=!0,this._updatedPaintProps[e]=!0):this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be styled.")));},i.prototype.getPaintProperty=function(t,e){return this.getLayer(t).getPaintProperty(e)},i.prototype.setFeatureState=function(e,i){this._checkLoaded();var o=e.source,r=e.sourceLayer,a=this.sourceCaches[o];if(void 0!==a){var n=a.getSource().type;"geojson"===n&&r?this.fire(new t.ErrorEvent(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):"vector"!==n||r?(void 0===e.id&&this.fire(new t.ErrorEvent(new Error("The feature id parameter must be provided."))),a.setFeatureState(r,e.id,i)):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 '"+o+"' does not exist in the map's style.")));},i.prototype.removeFeatureState=function(e,i){this._checkLoaded();var o=e.source,r=this.sourceCaches[o];if(void 0!==r){var a=r.getSource().type,n="vector"===a?e.sourceLayer:void 0;"vector"!==a||n?i&&"string"!=typeof e.id&&"number"!=typeof e.id?this.fire(new t.ErrorEvent(new Error("A feature id is required to remove its specific state property."))):r.removeFeatureState(n,e.id,i):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 '"+o+"' does not exist in the map's style.")));},i.prototype.getFeatureState=function(e){this._checkLoaded();var i=e.source,o=e.sourceLayer,r=this.sourceCaches[i];if(void 0!==r){if("vector"!==r.getSource().type||o)return void 0===e.id&&this.fire(new t.ErrorEvent(new Error("The feature id parameter must be provided."))),r.getFeatureState(o,e.id);this.fire(new t.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));}else this.fire(new t.ErrorEvent(new Error("The source '"+i+"' does not exist in the map's style.")));},i.prototype.getTransition=function(){return t.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)},i.prototype.serialize=function(){return t.filterObject({version:this.stylesheet.version,name:this.stylesheet.name,metadata:this.stylesheet.metadata,light:this.stylesheet.light,center:this.stylesheet.center,zoom:this.stylesheet.zoom,bearing:this.stylesheet.bearing,pitch:this.stylesheet.pitch,sprite:this._sprites,glyphs:this._glyphs,transition:this.stylesheet.transition,sources:t.mapObject(this.sourceCaches,(function(t){return t.serialize()})),layers:this._serializeLayers(this._order)},(function(t){return void 0!==t}))},i.prototype._updateLayer=function(t){this._updatedLayers[t.id]=!0,t.source&&!this._updatedSources[t.source]&&"raster"!==this.sourceCaches[t.source].getSource().type&&(this._updatedSources[t.source]="reload",this.sourceCaches[t.source].pause()),this._changed=!0;},i.prototype._flattenAndSortRenderedFeatures=function(t){for(var e=this,i=function(t){return "fill-extrusion"===e._layers[t].type},o={},r=[],a=this._order.length-1;a>=0;a--){var n=this._order[a];if(i(n)){o[n]=a;for(var s=0,l=t;s=0;d--){var _=this._order[d];if(i(_))for(var f=r.length-1;f>=0;f--){var m=r[f].feature;if(o[m.layer.id] 0.5) {gl_FragColor=vec4(0.0,0.0,1.0,0.5)*alpha;}if (v_notUsed > 0.5) {gl_FragColor*=.1;}}","attribute vec2 a_pos;attribute vec2 a_anchor_pos;attribute vec2 a_extrude;attribute vec2 a_placed;attribute vec2 a_shift;uniform mat4 u_matrix;uniform vec2 u_extrude_scale;uniform float u_camera_to_center_distance;varying float v_placed;varying float v_notUsed;void main() {vec4 projectedPoint=u_matrix*vec4(a_anchor_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);gl_Position=u_matrix*vec4(a_pos,0.0,1.0);gl_Position.xy+=(a_extrude+a_shift)*u_extrude_scale*gl_Position.w*collision_perspective_ratio;v_placed=a_placed.x;v_notUsed=a_placed.y;}"),ii=xi("varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;void main() {float alpha=0.5*min(v_perspective_ratio,1.0);float stroke_radius=0.9*max(v_perspective_ratio,1.0);float distance_to_center=length(v_extrude);float distance_to_edge=abs(distance_to_center-v_radius);float opacity_t=smoothstep(-stroke_radius,0.0,-distance_to_edge);vec4 color=mix(vec4(0.0,0.0,1.0,0.5),vec4(1.0,0.0,0.0,1.0),v_collision);gl_FragColor=color*alpha*opacity_t;}","attribute vec2 a_pos;attribute float a_radius;attribute vec2 a_flags;uniform mat4 u_matrix;uniform mat4 u_inv_matrix;uniform vec2 u_viewport_size;uniform float u_camera_to_center_distance;varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;vec3 toTilePosition(vec2 screenPos) {vec4 rayStart=u_inv_matrix*vec4(screenPos,-1.0,1.0);vec4 rayEnd =u_inv_matrix*vec4(screenPos, 1.0,1.0);rayStart.xyz/=rayStart.w;rayEnd.xyz /=rayEnd.w;highp float t=(0.0-rayStart.z)/(rayEnd.z-rayStart.z);return mix(rayStart.xyz,rayEnd.xyz,t);}void main() {vec2 quadCenterPos=a_pos;float radius=a_radius;float collision=a_flags.x;float vertexIdx=a_flags.y;vec2 quadVertexOffset=vec2(mix(-1.0,1.0,float(vertexIdx >=2.0)),mix(-1.0,1.0,float(vertexIdx >=1.0 && vertexIdx <=2.0)));vec2 quadVertexExtent=quadVertexOffset*radius;vec3 tilePos=toTilePosition(quadCenterPos);vec4 clipPos=u_matrix*vec4(tilePos,1.0);highp float camera_to_anchor_distance=clipPos.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);float padding_factor=1.2;v_radius=radius;v_extrude=quadVertexExtent*padding_factor;v_perspective_ratio=collision_perspective_ratio;v_collision=collision;gl_Position=vec4(clipPos.xyz/clipPos.w,1.0)+vec4(quadVertexExtent*padding_factor/u_viewport_size*2.0,0.0,0.0);}"),oi=xi("uniform highp vec4 u_color;uniform sampler2D u_overlay;varying vec2 v_uv;void main() {vec4 overlay_color=texture2D(u_overlay,v_uv);gl_FragColor=mix(u_color,overlay_color,overlay_color.a);}","attribute vec2 a_pos;varying vec2 v_uv;uniform mat4 u_matrix;uniform float u_overlay_scale;void main() {v_uv=a_pos/8192.0;gl_Position=u_matrix*vec4(a_pos*u_overlay_scale,0,1);}"),ri=xi("#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\ngl_FragColor=color*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=u_matrix*vec4(a_pos,0,1);}"),ai=xi("varying vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=outline_color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;uniform vec2 u_world;varying vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=u_matrix*vec4(a_pos,0,1);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}"),ni=xi("uniform vec2 u_texsize;uniform sampler2D u_image;uniform float u_fade;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=mix(color1,color2,u_fade)*alpha*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_world;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;gl_Position=u_matrix*vec4(a_pos,0,1);vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,a_pos);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}"),si=xi("uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_fade)*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileZoomRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileZoomRatio,a_pos);}"),li=xi("varying vec4 v_color;void main() {gl_FragColor=v_color;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;uniform float u_vertical_gradient;uniform lowp float u_opacity;attribute vec2 a_pos;attribute vec4 a_normal_ed;varying vec4 v_color;\n#pragma mapbox: define highp float base\n#pragma mapbox: define highp float height\n#pragma mapbox: define highp vec4 color\nvoid main() {\n#pragma mapbox: initialize highp float base\n#pragma mapbox: initialize highp float height\n#pragma mapbox: initialize highp vec4 color\nvec3 normal=a_normal_ed.xyz;base=max(0.0,base);height=max(0.0,height);float t=mod(normal.x,2.0);gl_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;v_color=vec4(0.0,0.0,0.0,1.0);vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=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*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_color.r+=clamp(color.r*directional*u_lightcolor.r,mix(0.0,0.3,1.0-u_lightcolor.r),1.0);v_color.g+=clamp(color.g*directional*u_lightcolor.g,mix(0.0,0.3,1.0-u_lightcolor.g),1.0);v_color.b+=clamp(color.b*directional*u_lightcolor.b,mix(0.0,0.3,1.0-u_lightcolor.b),1.0);v_color*=u_opacity;}"),ci=xi("uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);vec4 mixedColor=mix(color1,color2,u_fade);gl_FragColor=mixedColor*v_lighting;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_height_factor;uniform vec3 u_scale;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;attribute vec2 a_pos;attribute vec4 a_normal_ed;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec3 normal=a_normal_ed.xyz;float edgedistance=a_normal_ed.w;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;base=max(0.0,base);height=max(0.0,height);float t=mod(normal.x,2.0);float z=t > 0.0 ? height : base;gl_Position=u_matrix*vec4(a_pos,z,1);vec2 pos=normal.x==1.0 && normal.y==0.0 && normal.z==16384.0\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);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,pos);v_lighting=vec4(0.0,0.0,0.0,1.0);float directional=clamp(dot(normal/16383.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_lighting.rgb+=clamp(directional*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_lighting*=u_opacity;}"),hi=xi("#ifdef GL_ES\nprecision highp float;\n#endif\nuniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;uniform vec4 u_unpack;float getElevation(vec2 coord,float bias) {vec4 data=texture2D(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack)/4.0;}void main() {vec2 epsilon=1.0/u_dimension;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y),0.0);float b=getElevation(v_pos+vec2(0,-epsilon.y),0.0);float c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y),0.0);float d=getElevation(v_pos+vec2(-epsilon.x,0),0.0);float e=getElevation(v_pos,0.0);float f=getElevation(v_pos+vec2(epsilon.x,0),0.0);float g=getElevation(v_pos+vec2(-epsilon.x,epsilon.y),0.0);float h=getElevation(v_pos+vec2(0,epsilon.y),0.0);float i=getElevation(v_pos+vec2(epsilon.x,epsilon.y),0.0);float exaggerationFactor=u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;float exaggeration=u_zoom < 15.0 ? (u_zoom-15.0)*exaggerationFactor : 0.0;vec2 deriv=vec2((c+f+f+i)-(a+d+d+g),(g+h+h+i)-(a+b+b+c))/pow(2.0,exaggeration+(19.2562-u_zoom));gl_FragColor=clamp(vec4(deriv.x/2.0+0.5,deriv.y/2.0+0.5,1.0,1.0),0.0,1.0);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_dimension;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);highp vec2 epsilon=1.0/u_dimension;float scale=(u_dimension.x-2.0)/u_dimension.x;v_pos=(a_texture_pos/8192.0)*scale+epsilon;}"),ui=xi("uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_latrange;uniform vec2 u_light;uniform vec4 u_shadow;uniform vec4 u_highlight;uniform vec4 u_accent;\n#define PI 3.141592653589793\nvoid main() {vec4 pixel=texture2D(u_image,v_pos);vec2 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);float aspect=deriv.x !=0.0 ? atan(deriv.y,-deriv.x) : PI/2.0*(deriv.y > 0.0 ? 1.0 :-1.0);float intensity=u_light.x;float azimuth=u_light.y+PI;float base=1.875-intensity*1.75;float maxValue=0.5*PI;float scaledSlope=intensity !=0.5 ? ((pow(base,slope)-1.0)/(pow(base,maxValue)-1.0))*maxValue : slope;float accent=cos(scaledSlope);vec4 accent_color=(1.0-accent)*u_accent*clamp(intensity*2.0,0.0,1.0);float shade=abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);vec4 shade_color=mix(u_shadow,u_highlight,shade)*sin(scaledSlope)*clamp(intensity*2.0,0.0,1.0);gl_FragColor=accent_color*(1.0-shade_color.a)+shade_color;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=a_texture_pos/8192.0;}"),pi=xi("uniform lowp float u_device_pixel_ratio;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform vec2 u_units_to_pixels;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp float v_linesofar;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;v_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*2.0;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_width2=vec2(outset,inset);}"),di=xi("uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;varying highp vec2 v_uv;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);vec4 color=texture2D(u_image,v_uv);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\nattribute vec2 a_pos_normal;attribute vec4 a_data;attribute float a_uv_x;attribute float a_split_index;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;uniform float u_image_height;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp vec2 v_uv;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;highp float texel_height=1.0/u_image_height;highp float half_texel_height=0.5*texel_height;v_uv=vec2(a_uv_x,a_split_index*texel_height-half_texel_height);vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_width2=vec2(outset,inset);}"),_i=xi("uniform lowp float u_device_pixel_ratio;\r\nuniform vec2 u_texsize;\r\nuniform float u_fade;\r\nuniform mediump vec3 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\nvarying float v_width;\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 pixel_ratio_from\r\n#pragma mapbox: define lowp float pixel_ratio_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 pixel_ratio_from\r\n#pragma mapbox: initialize lowp float pixel_ratio_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 tileZoomRatio=u_scale.x;\r\nfloat fromScale=u_scale.y;\r\nfloat toScale=u_scale.z;\r\nvec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;\r\nvec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;\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);\r\nfloat aspect_a=display_size_a.y/v_width;\r\nfloat aspect_b=display_size_b.y/v_width;float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;\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*aspect_a,1.0);\r\nfloat x_b=mod(v_linesofar/pattern_size_b.x*aspect_b,1.0);\r\nfloat y=0.5*v_normal.y+0.5;\r\nvec2 texel_size=1.0/u_texsize;\r\nvec2 pos_a=mix(pattern_tl_a*texel_size-texel_size,pattern_br_a*texel_size+texel_size,vec2(x_a,y));\r\nvec2 pos_b=mix(pattern_tl_b*texel_size-texel_size,pattern_br_b*texel_size+texel_size,vec2(x_b,y));\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\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform vec2 u_units_to_pixels;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;}"),fi=xi("uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;uniform float u_sdfgamma;uniform float u_mix;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float sdfdist_a=texture2D(u_image,v_tex_a).a;float sdfdist_b=texture2D(u_image,v_tex_b).a;float sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);alpha*=smoothstep(0.5-u_sdfgamma/floorwidth,0.5+u_sdfgamma/floorwidth,sdfdist);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_patternscale_a;uniform float u_tex_y_a;uniform vec2 u_patternscale_b;uniform float u_tex_y_b;uniform vec2 u_units_to_pixels;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_tex_a=vec2(a_linesofar*u_patternscale_a.x/floorwidth,normal.y*u_patternscale_a.y+u_tex_y_a);v_tex_b=vec2(a_linesofar*u_patternscale_b.x/floorwidth,normal.y*u_patternscale_b.y+u_tex_y_b);v_width2=vec2(outset,inset);}"),mi=xi("uniform float u_fade_t;uniform float u_opacity;uniform sampler2D u_image0;uniform sampler2D u_image1;varying vec2 v_pos0;varying vec2 v_pos1;uniform float u_brightness_low;uniform float u_brightness_high;uniform float u_saturation_factor;uniform float u_contrast_factor;uniform vec3 u_spin_weights;void main() {vec4 color0=texture2D(u_image0,v_pos0);vec4 color1=texture2D(u_image1,v_pos1);if (color0.a > 0.0) {color0.rgb=color0.rgb/color0.a;}if (color1.a > 0.0) {color1.rgb=color1.rgb/color1.a;}vec4 color=mix(color0,color1,u_fade_t);color.a*=u_opacity;vec3 rgb=color.rgb;rgb=vec3(dot(rgb,u_spin_weights.xyz),dot(rgb,u_spin_weights.zxy),dot(rgb,u_spin_weights.yzx));float average=(color.r+color.g+color.b)/3.0;rgb+=(average-rgb)*u_saturation_factor;rgb=(rgb-0.5)*u_contrast_factor+0.5;vec3 u_high_vec=vec3(u_brightness_low,u_brightness_low,u_brightness_low);vec3 u_low_vec=vec3(u_brightness_high,u_brightness_high,u_brightness_high);gl_FragColor=vec4(mix(u_high_vec,u_low_vec,rgb)*color.a,color.a);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform float u_buffer_scale;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos0;varying vec2 v_pos1;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos0=(((a_texture_pos/8192.0)-0.5)/u_buffer_scale )+0.5;v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;}"),gi=xi("uniform sampler2D u_texture;varying vec2 v_tex;varying float v_fade_opacity;\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nlowp float alpha=opacity*v_fade_opacity;gl_FragColor=texture2D(u_texture,v_tex)*alpha;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform highp float u_camera_to_center_distance;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform float u_fade_change;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform vec2 u_texsize;varying vec2 v_tex;varying float v_fade_opacity;\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;vec2 a_minFontScale=a_pixeloffset.zw/256.0;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*max(a_minFontScale,fontScale)+a_pxoffset/16.0),0.0,1.0);v_tex=a_tex/u_texsize;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;v_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));}"),vi=xi("#define SDF_PX 8.0\nuniform bool u_is_halo;uniform sampler2D u_texture;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;uniform bool u_is_text;varying vec2 v_data0;varying vec3 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nfloat EDGE_GAMMA=0.105/u_device_pixel_ratio;vec2 tex=v_data0.xy;float gamma_scale=v_data1.x;float size=v_data1.y;float fade_opacity=v_data1[2];float fontScale=u_is_text ? size/24.0 : size;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;varying vec2 v_data0;varying vec3 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset),0.0,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,interpolated_fade_opacity);}"),yi=xi("#define SDF_PX 8.0\n#define SDF 1.0\n#define ICON 0.0\nuniform bool u_is_halo;uniform sampler2D u_texture;uniform sampler2D u_texture_icon;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;varying vec4 v_data0;varying vec4 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nfloat fade_opacity=v_data1[2];if (v_data1.w==ICON) {vec2 tex_icon=v_data0.zw;lowp float alpha=opacity*fade_opacity;gl_FragColor=texture2D(u_texture_icon,tex_icon)*alpha;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\nreturn;}vec2 tex=v_data0.xy;float EDGE_GAMMA=0.105/u_device_pixel_ratio;float gamma_scale=v_data1.x;float size=v_data1.y;float fontScale=size/24.0;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec2 u_texsize_icon;varying vec4 v_data0;varying vec4 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);float is_sdf=a_size[0]-2.0*a_size_min;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale),0.0,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));v_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec4(gamma_scale,size,interpolated_fade_opacity,is_sdf);}");function xi(t,e){var i=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,o=e.match(/attribute ([\w]+) ([\w]+)/g),r=t.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),a=e.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),n=a?a.concat(r):r,s={};return {fragmentSource:t=t.replace(i,(function(t,e,i,o,r){return s[r]=!0,"define"===e?"\n#ifndef HAS_UNIFORM_u_"+r+"\nvarying "+i+" "+o+" "+r+";\n#else\nuniform "+i+" "+o+" u_"+r+";\n#endif\n":"\n#ifdef HAS_UNIFORM_u_"+r+"\n "+i+" "+o+" "+r+" = u_"+r+";\n#endif\n"})),vertexSource:e=e.replace(i,(function(t,e,i,o,r){var a="float"===o?"vec2":"vec4",n=r.match(/color/)?"color":a;return s[r]?"define"===e?"\n#ifndef HAS_UNIFORM_u_"+r+"\nuniform lowp float u_"+r+"_t;\nattribute "+i+" "+a+" a_"+r+";\nvarying "+i+" "+o+" "+r+";\n#else\nuniform "+i+" "+o+" u_"+r+";\n#endif\n":"vec4"===n?"\n#ifndef HAS_UNIFORM_u_"+r+"\n "+r+" = a_"+r+";\n#else\n "+i+" "+o+" "+r+" = u_"+r+";\n#endif\n":"\n#ifndef HAS_UNIFORM_u_"+r+"\n "+r+" = unpack_mix_"+n+"(a_"+r+", u_"+r+"_t);\n#else\n "+i+" "+o+" "+r+" = u_"+r+";\n#endif\n":"define"===e?"\n#ifndef HAS_UNIFORM_u_"+r+"\nuniform lowp float u_"+r+"_t;\nattribute "+i+" "+a+" a_"+r+";\n#else\nuniform "+i+" "+o+" u_"+r+";\n#endif\n":"vec4"===n?"\n#ifndef HAS_UNIFORM_u_"+r+"\n "+i+" "+o+" "+r+" = a_"+r+";\n#else\n "+i+" "+o+" "+r+" = u_"+r+";\n#endif\n":"\n#ifndef HAS_UNIFORM_u_"+r+"\n "+i+" "+o+" "+r+" = unpack_mix_"+n+"(a_"+r+", u_"+r+"_t);\n#else\n "+i+" "+o+" "+r+" = u_"+r+";\n#endif\n"})),staticAttributes:o,staticUniforms:n}}var bi=Object.freeze({__proto__:null,prelude:He,background:Ke,backgroundPattern:Ye,circle:Je,clippingMask:Qe,heatmap:$e,heatmapTexture:ti,collisionBox:ei,collisionCircle:ii,debug:oi,fill:ri,fillOutline:ai,fillOutlinePattern:ni,fillPattern:si,fillExtrusion:li,fillExtrusionPattern:ci,hillshadePrepare:hi,hillshade:ui,line:pi,lineGradient:di,linePattern:_i,lineSDF:fi,raster:mi,symbolIcon:gi,symbolSDF:vi,symbolTextAndIcon:yi}),wi=function(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null;};function Ei(t){for(var e=[],i=0;i>16,s>>16],u_pixel_coord_lower:[65535&n,65535&s]}}Ti.prototype.draw=function(t,e,i,o,r,a,n,s,l,c,h,u,p,d,_,f){var m,g=t.gl;if(!this.failedToCreate){for(var v in t.program.set(this.program),t.setDepthMode(i),t.setStencilMode(o),t.setColorMode(r),t.setCullFace(a),this.fixedUniforms)this.fixedUniforms[v].set(n[v]);d&&d.setUniforms(t,this.binderUniforms,u,{zoom:p});for(var y=(m={},m[g.LINES]=2,m[g.TRIANGLES]=3,m[g.LINE_STRIP]=1,m)[e],x=0,b=h.get();x0?1-1/(1.001-n):-n),u_contrast_factor:(a=r.paint.get("raster-contrast"),a>0?1/(1-a):1+a),u_spin_weights:Vi(r.paint.get("raster-hue-rotate"))};var a,n;};function Vi(t){t*=Math.PI/180;var e=Math.sin(t),i=Math.cos(t);return [(2*i+1)/3,(-Math.sqrt(3)*e-i+1)/3,(Math.sqrt(3)*e-i+1)/3]}var Wi,Xi=function(t,e,i,o,r,a,n,s,l,c){var h=r.transform;return {u_is_size_zoom_constant:+("constant"===t||"source"===t),u_is_size_feature_constant:+("constant"===t||"camera"===t),u_size_t:e?e.uSizeT:0,u_size:e?e.uSize:0,u_camera_to_center_distance:h.cameraToCenterDistance,u_pitch:h.pitch/360*2*Math.PI,u_rotate_symbol:+i,u_aspect_ratio:h.width/h.height,u_fade_change:r.options.fadeDuration?r.symbolFadeChange:1,u_matrix:a,u_label_plane_matrix:n,u_coord_matrix:s,u_is_text:+l,u_pitch_with_map:+o,u_texsize:c,u_texture:0}},Hi=function(e,i,o,r,a,n,s,l,c,h,u){var p=a.transform;return t.extend(Xi(e,i,o,r,a,n,s,l,c,h),{u_gamma_scale:r?Math.cos(p._pitch)*p.cameraToCenterDistance:1,u_device_pixel_ratio:t.browser.devicePixelRatio,u_is_halo:+u})},Ki=function(e,i,o,r,a,n,s,l,c,h){return t.extend(Hi(e,i,o,r,a,n,s,l,!0,c,!0),{u_texsize_icon:h,u_texture_icon:1})},Yi=function(t,e,i){return {u_matrix:t,u_opacity:e,u_color:i}},Ji=function(e,i,o,r,a,n){return t.extend(function(t,e,i,o){var r=i.imageManagerFactory.getPattern(t.from.toString()),a=i.imageManagerFactory.getPattern(t.to.toString()),n=i.imageManagerFactory.getPixelSize(),s=n.width,l=n.height,c=Math.pow(2,o.tileID.overscaledZ),h=o.tileSize*Math.pow(2,i.transform.tileZoom)/c,u=h*(o.tileID.canonical.x+o.tileID.wrap*c),p=h*o.tileID.canonical.y;return {u_image:0,u_pattern_tl_a:r.tl,u_pattern_br_a:r.br,u_pattern_tl_b:a.tl,u_pattern_br_b:a.br,u_texsize:[s,l],u_mix:e.t,u_pattern_size_a:r.displaySize,u_pattern_size_b:a.displaySize,u_scale_a:e.fromScale,u_scale_b:e.toScale,u_tile_units_to_pixels:1/fe(o,1,i.transform.tileZoom),u_pixel_coord_upper:[u>>16,p>>16],u_pixel_coord_lower:[65535&u,65535&p]}}(r,n,o,a),{u_matrix:e,u_opacity:i})},Qi={fillExtrusion:function(e,i){return {u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_lightpos:new t.Uniform3f(e,i.u_lightpos),u_lightintensity:new t.Uniform1f(e,i.u_lightintensity),u_lightcolor:new t.Uniform3f(e,i.u_lightcolor),u_vertical_gradient:new t.Uniform1f(e,i.u_vertical_gradient),u_opacity:new t.Uniform1f(e,i.u_opacity)}},fillExtrusionPattern:function(e,i){return {u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_lightpos:new t.Uniform3f(e,i.u_lightpos),u_lightintensity:new t.Uniform1f(e,i.u_lightintensity),u_lightcolor:new t.Uniform3f(e,i.u_lightcolor),u_vertical_gradient:new t.Uniform1f(e,i.u_vertical_gradient),u_height_factor:new t.Uniform1f(e,i.u_height_factor),u_image:new t.Uniform1i(e,i.u_image),u_texsize:new t.Uniform2f(e,i.u_texsize),u_pixel_coord_upper:new t.Uniform2f(e,i.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,i.u_pixel_coord_lower),u_scale:new t.Uniform3f(e,i.u_scale),u_fade:new t.Uniform1f(e,i.u_fade),u_opacity:new t.Uniform1f(e,i.u_opacity)}},fill:function(e,i){return {u_matrix:new t.UniformMatrix4f(e,i.u_matrix)}},fillPattern:function(e,i){return {u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_image:new t.Uniform1i(e,i.u_image),u_texsize:new t.Uniform2f(e,i.u_texsize),u_pixel_coord_upper:new t.Uniform2f(e,i.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,i.u_pixel_coord_lower),u_scale:new t.Uniform3f(e,i.u_scale),u_fade:new t.Uniform1f(e,i.u_fade)}},fillOutline:function(e,i){return {u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_world:new t.Uniform2f(e,i.u_world)}},fillOutlinePattern:function(e,i){return {u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_world:new t.Uniform2f(e,i.u_world),u_image:new t.Uniform1i(e,i.u_image),u_texsize:new t.Uniform2f(e,i.u_texsize),u_pixel_coord_upper:new t.Uniform2f(e,i.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,i.u_pixel_coord_lower),u_scale:new t.Uniform3f(e,i.u_scale),u_fade:new t.Uniform1f(e,i.u_fade)}},circle:function(e,i){return {u_camera_to_center_distance:new t.Uniform1f(e,i.u_camera_to_center_distance),u_scale_with_map:new t.Uniform1i(e,i.u_scale_with_map),u_pitch_with_map:new t.Uniform1i(e,i.u_pitch_with_map),u_extrude_scale:new t.Uniform2f(e,i.u_extrude_scale),u_device_pixel_ratio:new t.Uniform1f(e,i.u_device_pixel_ratio),u_matrix:new t.UniformMatrix4f(e,i.u_matrix)}},collisionBox:function(e,i){return {u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_camera_to_center_distance:new t.Uniform1f(e,i.u_camera_to_center_distance),u_pixels_to_tile_units:new t.Uniform1f(e,i.u_pixels_to_tile_units),u_extrude_scale:new t.Uniform2f(e,i.u_extrude_scale),u_overscale_factor:new t.Uniform1f(e,i.u_overscale_factor)}},collisionCircle:function(e,i){return {u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_inv_matrix:new t.UniformMatrix4f(e,i.u_inv_matrix),u_camera_to_center_distance:new t.Uniform1f(e,i.u_camera_to_center_distance),u_viewport_size:new t.Uniform2f(e,i.u_viewport_size)}},debug:function(e,i){return {u_color:new t.UniformColor(e,i.u_color),u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_overlay:new t.Uniform1i(e,i.u_overlay),u_overlay_scale:new t.Uniform1f(e,i.u_overlay_scale)}},clippingMask:function(e,i){return {u_matrix:new t.UniformMatrix4f(e,i.u_matrix)}},heatmap:function(e,i){return {u_extrude_scale:new t.Uniform1f(e,i.u_extrude_scale),u_intensity:new t.Uniform1f(e,i.u_intensity),u_matrix:new t.UniformMatrix4f(e,i.u_matrix)}},heatmapTexture:function(e,i){return {u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_world:new t.Uniform2f(e,i.u_world),u_image:new t.Uniform1i(e,i.u_image),u_color_ramp:new t.Uniform1i(e,i.u_color_ramp),u_opacity:new t.Uniform1f(e,i.u_opacity)}},hillshade:function(e,i){return {u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_image:new t.Uniform1i(e,i.u_image),u_latrange:new t.Uniform2f(e,i.u_latrange),u_light:new t.Uniform2f(e,i.u_light),u_shadow:new t.UniformColor(e,i.u_shadow),u_highlight:new t.UniformColor(e,i.u_highlight),u_accent:new t.UniformColor(e,i.u_accent)}},hillshadePrepare:function(e,i){return {u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_image:new t.Uniform1i(e,i.u_image),u_dimension:new t.Uniform2f(e,i.u_dimension),u_zoom:new t.Uniform1f(e,i.u_zoom),u_unpack:new t.Uniform4f(e,i.u_unpack)}},line:function(e,i){return {u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_ratio:new t.Uniform1f(e,i.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,i.u_device_pixel_ratio),u_units_to_pixels:new t.Uniform2f(e,i.u_units_to_pixels)}},lineGradient:function(e,i){return {u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_ratio:new t.Uniform1f(e,i.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,i.u_device_pixel_ratio),u_units_to_pixels:new t.Uniform2f(e,i.u_units_to_pixels),u_image:new t.Uniform1i(e,i.u_image),u_image_height:new t.Uniform1f(e,i.u_image_height)}},linePattern:function(e,i){return {u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_texsize:new t.Uniform2f(e,i.u_texsize),u_ratio:new t.Uniform1f(e,i.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,i.u_device_pixel_ratio),u_image:new t.Uniform1i(e,i.u_image),u_units_to_pixels:new t.Uniform2f(e,i.u_units_to_pixels),u_scale:new t.Uniform3f(e,i.u_scale),u_fade:new t.Uniform1f(e,i.u_fade)}},lineSDF:function(e,i){return {u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_ratio:new t.Uniform1f(e,i.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,i.u_device_pixel_ratio),u_units_to_pixels:new t.Uniform2f(e,i.u_units_to_pixels),u_patternscale_a:new t.Uniform2f(e,i.u_patternscale_a),u_patternscale_b:new t.Uniform2f(e,i.u_patternscale_b),u_sdfgamma:new t.Uniform1f(e,i.u_sdfgamma),u_image:new t.Uniform1i(e,i.u_image),u_tex_y_a:new t.Uniform1f(e,i.u_tex_y_a),u_tex_y_b:new t.Uniform1f(e,i.u_tex_y_b),u_mix:new t.Uniform1f(e,i.u_mix)}},raster:function(e,i){return {u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_tl_parent:new t.Uniform2f(e,i.u_tl_parent),u_scale_parent:new t.Uniform1f(e,i.u_scale_parent),u_buffer_scale:new t.Uniform1f(e,i.u_buffer_scale),u_fade_t:new t.Uniform1f(e,i.u_fade_t),u_opacity:new t.Uniform1f(e,i.u_opacity),u_image0:new t.Uniform1i(e,i.u_image0),u_image1:new t.Uniform1i(e,i.u_image1),u_brightness_low:new t.Uniform1f(e,i.u_brightness_low),u_brightness_high:new t.Uniform1f(e,i.u_brightness_high),u_saturation_factor:new t.Uniform1f(e,i.u_saturation_factor),u_contrast_factor:new t.Uniform1f(e,i.u_contrast_factor),u_spin_weights:new t.Uniform3f(e,i.u_spin_weights)}},symbolIcon:function(e,i){return {u_is_size_zoom_constant:new t.Uniform1i(e,i.u_is_size_zoom_constant),u_is_size_feature_constant:new t.Uniform1i(e,i.u_is_size_feature_constant),u_size_t:new t.Uniform1f(e,i.u_size_t),u_size:new t.Uniform1f(e,i.u_size),u_camera_to_center_distance:new t.Uniform1f(e,i.u_camera_to_center_distance),u_pitch:new t.Uniform1f(e,i.u_pitch),u_rotate_symbol:new t.Uniform1i(e,i.u_rotate_symbol),u_aspect_ratio:new t.Uniform1f(e,i.u_aspect_ratio),u_fade_change:new t.Uniform1f(e,i.u_fade_change),u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_label_plane_matrix:new t.UniformMatrix4f(e,i.u_label_plane_matrix),u_coord_matrix:new t.UniformMatrix4f(e,i.u_coord_matrix),u_is_text:new t.Uniform1i(e,i.u_is_text),u_pitch_with_map:new t.Uniform1i(e,i.u_pitch_with_map),u_texsize:new t.Uniform2f(e,i.u_texsize),u_texture:new t.Uniform1i(e,i.u_texture)}},symbolSDF:function(e,i){return {u_is_size_zoom_constant:new t.Uniform1i(e,i.u_is_size_zoom_constant),u_is_size_feature_constant:new t.Uniform1i(e,i.u_is_size_feature_constant),u_size_t:new t.Uniform1f(e,i.u_size_t),u_size:new t.Uniform1f(e,i.u_size),u_camera_to_center_distance:new t.Uniform1f(e,i.u_camera_to_center_distance),u_pitch:new t.Uniform1f(e,i.u_pitch),u_rotate_symbol:new t.Uniform1i(e,i.u_rotate_symbol),u_aspect_ratio:new t.Uniform1f(e,i.u_aspect_ratio),u_fade_change:new t.Uniform1f(e,i.u_fade_change),u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_label_plane_matrix:new t.UniformMatrix4f(e,i.u_label_plane_matrix),u_coord_matrix:new t.UniformMatrix4f(e,i.u_coord_matrix),u_is_text:new t.Uniform1i(e,i.u_is_text),u_pitch_with_map:new t.Uniform1i(e,i.u_pitch_with_map),u_texsize:new t.Uniform2f(e,i.u_texsize),u_texture:new t.Uniform1i(e,i.u_texture),u_gamma_scale:new t.Uniform1f(e,i.u_gamma_scale),u_device_pixel_ratio:new t.Uniform1f(e,i.u_device_pixel_ratio),u_is_halo:new t.Uniform1i(e,i.u_is_halo)}},symbolTextAndIcon:function(e,i){return {u_is_size_zoom_constant:new t.Uniform1i(e,i.u_is_size_zoom_constant),u_is_size_feature_constant:new t.Uniform1i(e,i.u_is_size_feature_constant),u_size_t:new t.Uniform1f(e,i.u_size_t),u_size:new t.Uniform1f(e,i.u_size),u_camera_to_center_distance:new t.Uniform1f(e,i.u_camera_to_center_distance),u_pitch:new t.Uniform1f(e,i.u_pitch),u_rotate_symbol:new t.Uniform1i(e,i.u_rotate_symbol),u_aspect_ratio:new t.Uniform1f(e,i.u_aspect_ratio),u_fade_change:new t.Uniform1f(e,i.u_fade_change),u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_label_plane_matrix:new t.UniformMatrix4f(e,i.u_label_plane_matrix),u_coord_matrix:new t.UniformMatrix4f(e,i.u_coord_matrix),u_is_text:new t.Uniform1i(e,i.u_is_text),u_pitch_with_map:new t.Uniform1i(e,i.u_pitch_with_map),u_texsize:new t.Uniform2f(e,i.u_texsize),u_texsize_icon:new t.Uniform2f(e,i.u_texsize_icon),u_texture:new t.Uniform1i(e,i.u_texture),u_texture_icon:new t.Uniform1i(e,i.u_texture_icon),u_gamma_scale:new t.Uniform1f(e,i.u_gamma_scale),u_device_pixel_ratio:new t.Uniform1f(e,i.u_device_pixel_ratio),u_is_halo:new t.Uniform1i(e,i.u_is_halo)}},background:function(e,i){return {u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_opacity:new t.Uniform1f(e,i.u_opacity),u_color:new t.UniformColor(e,i.u_color)}},backgroundPattern:function(e,i){return {u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_opacity:new t.Uniform1f(e,i.u_opacity),u_image:new t.Uniform1i(e,i.u_image),u_pattern_tl_a:new t.Uniform2f(e,i.u_pattern_tl_a),u_pattern_br_a:new t.Uniform2f(e,i.u_pattern_br_a),u_pattern_tl_b:new t.Uniform2f(e,i.u_pattern_tl_b),u_pattern_br_b:new t.Uniform2f(e,i.u_pattern_br_b),u_texsize:new t.Uniform2f(e,i.u_texsize),u_mix:new t.Uniform1f(e,i.u_mix),u_pattern_size_a:new t.Uniform2f(e,i.u_pattern_size_a),u_pattern_size_b:new t.Uniform2f(e,i.u_pattern_size_b),u_scale_a:new t.Uniform1f(e,i.u_scale_a),u_scale_b:new t.Uniform1f(e,i.u_scale_b),u_pixel_coord_upper:new t.Uniform2f(e,i.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,i.u_pixel_coord_lower),u_tile_units_to_pixels:new t.Uniform1f(e,i.u_tile_units_to_pixels)}}};function $i(e,i,o,r,a,n,s){for(var l=e.context,c=l.gl,h=e.useProgram("collisionBox"),u=[],p=0,d=0,_=0;_0){var b=t.create(),w=v;t.mul(b,g.placementInvProjMatrix,e.transform.glCoordMatrix),t.mul(b,b,g.placementViewportMatrix),u.push({circleArray:x,circleOffset:d,transform:w,invTransform:b}),d=p+=x.length/4;}y&&h.draw(l,c.LINES,Ct.disabled,zt.disabled,e.colorModeForRenderPass(),Lt.disabled,Ri(v,e.transform,m),o.id,y.layoutVertexBuffer,y.indexBuffer,y.segments,null,e.transform.zoom,null,null,y.collisionVertexBuffer);}}if(s&&u.length){var E=e.useProgram("collisionCircle"),T=new t.StructArrayLayout2f1f2i16;T.resize(4*p),T._trim();for(var S=0,I=0,P=u;I=0&&(f[g.associatedIconIndex]={shiftedAnchor:T,angle:S});}else pe(g.numGlyphs,d);}if(u){_.clear();for(var P=e.icon.placedSymbolArray,C=0;C0){var s=t.browser.now(),l=(s-e.timeAdded)/n,c=i?(s-i.timeAdded)/n:-1,h=o.getSource(),u=a.coveringZoomLevel({tileSize:h.tileSize,roundZoom:h.roundZoom}),p=!i||Math.abs(i.tileID.overscaledZ-u)>Math.abs(e.tileID.overscaledZ-u),d=p&&e.refreshedUponExpiration?1:t.clamp(p?l:1-c,0,1);return e.refreshedUponExpiration&&l>=1&&(e.refreshedUponExpiration=!1),i?{opacity:1,mix:1-d}:{opacity:d,mix:0}}return {opacity:1,mix:0}}var uo=new t.Color(1,0,0,1),po=new t.Color(0,1,0,1),_o=new t.Color(0,0,1,1),fo=new t.Color(1,0,1,1),mo=new t.Color(0,1,1,1);function go(t,e,i,o){yo(t,0,e+i/2,t.transform.width,i,o);}function vo(t,e,i,o){yo(t,e-i/2,0,i,t.transform.height,o);}function yo(e,i,o,r,a,n){var s=e.context,l=s.gl;l.enable(l.SCISSOR_TEST),l.scissor(i*t.browser.devicePixelRatio,o*t.browser.devicePixelRatio,r*t.browser.devicePixelRatio,a*t.browser.devicePixelRatio),s.clear({color:n}),l.disable(l.SCISSOR_TEST);}function xo(e,i,o){var r=e.context,a=r.gl,n=o.posMatrix,s=e.useProgram("debug"),l=Ct.disabled,c=zt.disabled,h=e.colorModeForRenderPass();r.activeTexture.set(a.TEXTURE0),e.emptyTexture.bind(a.LINEAR,a.CLAMP_TO_EDGE),s.draw(r,a.LINE_STRIP,l,c,h,Lt.disabled,ki(n,t.Color.red),"$debug",e.debugBuffer,e.tileBorderIndexBuffer,e.debugSegments);var u=i.getTileByID(o.key).latestRawTileData,p=Math.floor((u&&u.byteLength||0)/1024),d=i.getTile(o).tileSize,_=512/Math.min(d,512)*(o.overscaledZ/e.transform.zoom)*.5,f=o.canonical.toString();o.overscaledZ!==o.canonical.z&&(f+=" => "+o.overscaledZ),function(t,e){t.initDebugOverlayCanvas();var i=t.debugOverlayCanvas,o=t.context.gl,r=t.debugOverlayCanvas.getContext("2d");r.clearRect(0,0,i.width,i.height),r.shadowColor="white",r.shadowBlur=2,r.lineWidth=1.5,r.strokeStyle="white",r.textBaseline="top",r.font="bold 36px Open Sans, sans-serif",r.fillText(e,5,5),r.strokeText(e,5,5),t.debugOverlayTexture.update(i),t.debugOverlayTexture.bind(o.LINEAR,o.CLAMP_TO_EDGE);}(e,f+" "+p+"kb"),s.draw(r,a.TRIANGLES,l,c,Mt.alphaBlended,Lt.disabled,ki(n,t.Color.transparent,_),"$debug",e.debugBuffer,e.quadTriangleIndexBuffer,e.debugSegments);}var bo={symbol:function(e,i,o,r,a){if("translucent"===e.renderPass){var n=zt.disabled,s=e.colorModeForRenderPass();o.layout.get("text-variable-anchor")&&function(e,i,o,r,a,n,s){for(var l=i.transform,c="map"===a,h="map"===n,u=0,p=e;u256&&this.clearStencil(),i.setColorMode(Mt.disabled),i.setDepthMode(Ct.disabled);var r=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(var a=0,n=e;a256&&this.clearStencil();var t=this.nextStencilID++,e=this.context.gl;return new zt({func:e.NOTEQUAL,mask:255},t,255,e.KEEP,e.KEEP,e.REPLACE)},wo.prototype.stencilModeForClipping=function(t){var e=this.context.gl;return new zt({func:e.EQUAL,mask:255},this._tileClippingMaskIDs[t.key],0,e.KEEP,e.KEEP,e.REPLACE)},wo.prototype.stencilConfigForOverlap=function(t){var e,i=this.context.gl,o=t.sort((function(t,e){return e.overscaledZ-t.overscaledZ})),r=o[o.length-1].overscaledZ,a=o[0].overscaledZ-r+1;if(a>1){this.currentStencilSource=void 0,this.nextStencilID+a>256&&this.clearStencil();for(var n={},s=0;s=0;this.currentLayer--){var x=this.style._layers[r[this.currentLayer]],b=a[x.source],w=h[x.source];this._renderTileClippingMasks(x,w),this.renderLayer(this,b,x,w);}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayer0?e.pop():null},wo.prototype.isPatternMissing=function(t){if(!t)return !1;if(!t.from||!t.to)return !0;var e=this.imageManagerFactory.getPattern(t.from.toString()),i=this.imageManagerFactory.getPattern(t.to.toString());return !e||!i},wo.prototype.useProgram=function(t,e){this.cache=this.cache||{};var i=""+t+(e?e.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"");return this.cache[i]||(this.cache[i]=new Ti(this.context,t,bi[t],e,Qi[t],this._showOverdrawInspector)),this.cache[i]},wo.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();},wo.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);},wo.prototype.initDebugOverlayCanvas=function(){null==this.debugOverlayCanvas&&(this.debugOverlayCanvas=t.window.document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new t.Texture(this.context,this.debugOverlayCanvas,this.context.gl.RGBA));},wo.prototype.destroy=function(){this.emptyTexture.destroy(),this.debugOverlayTexture&&this.debugOverlayTexture.destroy();};var Eo=function(t,e){this.points=t,this.planes=e;};Eo.fromInvProjectionMatrix=function(e,i,o){var r=Math.pow(2,o),a=[[-1,1,-1,1],[1,1,-1,1],[1,-1,-1,1],[-1,-1,-1,1],[-1,1,1,1],[1,1,1,1],[1,-1,1,1],[-1,-1,1,1]].map((function(i){return t.transformMat4([],i,e)})).map((function(e){return t.scale$1([],e,1/e[3]/i*r)})),n=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map((function(e){var i=t.sub([],a[e[0]],a[e[1]]),o=t.sub([],a[e[2]],a[e[1]]),r=t.normalize([],t.cross([],i,o)),n=-t.dot(r,a[e[1]]);return r.concat(n)}));return new Eo(a,n)};var To=function(e,i){this.min=e,this.max=i,this.center=t.scale$2([],t.add([],this.min,this.max),.5);};To.prototype.quadrant=function(e){for(var i=[e%2==0,e<2],o=t.clone$2(this.min),r=t.clone$2(this.max),a=0;a=0;if(0===n)return 0;n!==i.length&&(o=!1);}if(o)return 2;for(var l=0;l<3;l++){for(var c=Number.MAX_VALUE,h=-Number.MAX_VALUE,u=0;uthis.max[l]-this.min[l])return 0}return 1};var So=function(t,e,i,o){if(void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===o&&(o=0),isNaN(t)||t<0||isNaN(e)||e<0||isNaN(i)||i<0||isNaN(o)||o<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=t,this.bottom=e,this.left=i,this.right=o;};So.prototype.interpolate=function(e,i,o){return null!=i.top&&null!=e.top&&(this.top=t.number(e.top,i.top,o)),null!=i.bottom&&null!=e.bottom&&(this.bottom=t.number(e.bottom,i.bottom,o)),null!=i.left&&null!=e.left&&(this.left=t.number(e.left,i.left,o)),null!=i.right&&null!=e.right&&(this.right=t.number(e.right,i.right,o)),this},So.prototype.getCenter=function(e,i){var o=t.clamp((this.left+e-this.right)/2,0,e),r=t.clamp((this.top+i-this.bottom)/2,0,i);return new t.Point(o,r)},So.prototype.equals=function(t){return this.top===t.top&&this.bottom===t.bottom&&this.left===t.left&&this.right===t.right},So.prototype.clone=function(){return new So(this.top,this.bottom,this.left,this.right)},So.prototype.toJSON=function(){return {top:this.top,bottom:this.bottom,left:this.left,right:this.right}};var Io=function(e,i,o,r,a,n,s){this.tileSize=512,this.maxValidLatitude=85.051129,this._renderWorldCopies=void 0===a||a,this._minZoom=e||0,this._maxZoom=i||22,this._minPitch=null==o?0:o,this._maxPitch=null==r?60:r,this.setMaxBounds(),s&&this.setCRS(s),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._edgeInsets=new So,this._posMatrixCache={},this._alignedPosMatrixCache={};},Po={minZoom:{configurable:!0},maxZoom:{configurable:!0},minPitch:{configurable:!0},maxPitch:{configurable:!0},renderWorldCopies:{configurable:!0},worldSize:{configurable:!0},centerOffset:{configurable:!0},size:{configurable:!0},bearing:{configurable:!0},pitch:{configurable:!0},fov:{configurable:!0},zoom:{configurable:!0},center:{configurable:!0},padding:{configurable:!0},centerPoint:{configurable:!0},unmodified:{configurable:!0},point:{configurable:!0}};Io.prototype.clone=function(){var t=new Io(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies,null,this.crs);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._edgeInsets=this._edgeInsets.clone(),t._calcMatrices(),t},Io.prototype.getCRS=function(){return this.crs},Io.prototype.setCRS=function(t){this.crs=t,this.indexExtent=t.getExtent(),this.worldWidth=this.indexExtent[2]-this.indexExtent[0],this.worldHeight=this.indexExtent[3]-this.indexExtent[1],this.centerX=(this.indexExtent[2]+this.indexExtent[0])/2,this.centerY=(this.indexExtent[3]+this.indexExtent[1])/2,this.originX=this.indexExtent[0],this.originY=this.indexExtent[3];},Po.minZoom.get=function(){return this._minZoom},Po.minZoom.set=function(t){this._minZoom!==t&&(this._minZoom=t,this.zoom=Math.max(this.zoom,t));},Po.maxZoom.get=function(){return this._maxZoom},Po.maxZoom.set=function(t){this._maxZoom!==t&&(this._maxZoom=t,this.zoom=Math.min(this.zoom,t));},Po.minPitch.get=function(){return this._minPitch},Po.minPitch.set=function(t){this._minPitch!==t&&(this._minPitch=t,this.pitch=Math.max(this.pitch,t));},Po.maxPitch.get=function(){return this._maxPitch},Po.maxPitch.set=function(t){this._maxPitch!==t&&(this._maxPitch=t,this.pitch=Math.min(this.pitch,t));},Po.renderWorldCopies.get=function(){return this._renderWorldCopies},Po.renderWorldCopies.set=function(t){void 0===t?t=!0:null===t&&(t=!1),this._renderWorldCopies=t;},Po.worldSize.get=function(){return this.tileSize*this.scale},Po.centerOffset.get=function(){return this.centerPoint._sub(this.size._div(2))},Po.size.get=function(){return new t.Point(this.width,this.height)},Po.bearing.get=function(){return -this.angle/Math.PI*180},Po.bearing.set=function(e){var i=-t.wrap(e,-180,180)*Math.PI/180;this.angle!==i&&(this._unmodified=!1,this.angle=i,this._calcMatrices(),this.rotationMatrix=t.create$2(),t.rotate(this.rotationMatrix,this.rotationMatrix,this.angle));},Po.pitch.get=function(){return this._pitch/Math.PI*180},Po.pitch.set=function(e){var i=t.clamp(e,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==i&&(this._unmodified=!1,this._pitch=i,this._calcMatrices());},Po.fov.get=function(){return this._fov/Math.PI*180},Po.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());},Po.zoom.get=function(){return this._zoom},Po.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());},Po.center.get=function(){return this._center},Po.center.set=function(t){t.lat===this._center.lat&&t.lng===this._center.lng||(this._unmodified=!1,this._center=t,this._constrain(),this._calcMatrices());},Po.padding.get=function(){return this._edgeInsets.toJSON()},Po.padding.set=function(t){this._edgeInsets.equals(t)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,t,1),this._calcMatrices());},Po.centerPoint.get=function(){return this._edgeInsets.getCenter(this.width,this.height)},Io.prototype.isPaddingEqual=function(t){return this._edgeInsets.equals(t)},Io.prototype.interpolatePadding=function(t,e,i){this._unmodified=!1,this._edgeInsets.interpolate(t,e,i),this._constrain(),this._calcMatrices();},Io.prototype.coveringZoomLevel=function(t){var e=(t.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/t.tileSize));return Math.max(0,e)},Io.prototype.getVisibleUnwrappedCoordinates=function(e){var i=[new t.UnwrappedTileID(0,e)];if(this._renderWorldCopies)for(var o=this.pointCoordinate(new t.Point(0,0)),r=this.pointCoordinate(new t.Point(this.width,0)),a=this.pointCoordinate(new t.Point(this.width,this.height)),n=this.pointCoordinate(new t.Point(0,this.height)),s=Math.floor(Math.min(o.x,r.x,a.x,n.x)),l=Math.floor(Math.max(o.x,r.x,a.x,n.x)),c=s-1;c<=l+1;c++)0!==c&&i.push(new t.UnwrappedTileID(c,e));return i},Io.prototype.coveringTiles=function(e){var i=this.coveringZoomLevel(e),o=i;if(void 0!==e.minzoom&&ie.maxzoom&&(i=e.maxzoom);var r=this.crs.fromLngLat(this.center),a=Math.pow(2,i),n=[a*r.x,a*r.y,0],s=Eo.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,i),l=e.minzoom||0;this.pitch<=60&&this._edgeInsets.top<.1&&(l=i);var c=function(t){return {aabb:new To([t*a,0,0],[(t+1)*a,a,0]),zoom:0,x:0,y:0,wrap:t,fullyVisible:!1}},h=[],u=[],p=i,d=e.reparseOverscaled?o:i;if(this._renderWorldCopies)for(var _=1;_<=3;_++)h.push(c(-_)),h.push(c(_));for(h.push(c(0));h.length>0;){var f=h.pop(),m=f.x,g=f.y,v=f.fullyVisible;if(!v){var y=f.aabb.intersects(s);if(0===y)continue;v=2===y;}var x=f.aabb.distanceX(n),b=f.aabb.distanceY(n),w=Math.max(Math.abs(x),Math.abs(b));if(f.zoom===p||w>3+(1<=l)u.push({tileID:new t.OverscaledTileID(f.zoom===p?d:f.zoom,f.wrap,f.zoom,m,g,this.indexExtent),distanceSq:t.sqrLen([n[0]-.5-m,n[1]-.5-g])});else for(var E=0;E<4;E++){var T=(m<<1)+E%2,S=(g<<1)+(E>>1);h.push({aabb:f.aabb.quadrant(E),zoom:f.zoom+1,x:T,y:S,wrap:f.wrap,fullyVisible:v});}}return u.sort((function(t,e){return t.distanceSq-e.distanceSq})).map((function(t){return t.tileID}))},Io.prototype.resize=function(t,e){this.width=t,this.height=e,this.pixelsToGLUnits=[2/t,-2/e],this._constrain(),this._calcMatrices();},Po.unmodified.get=function(){return this._unmodified},Io.prototype.zoomScale=function(t){return Math.pow(2,t)},Io.prototype.scaleZoom=function(t){return Math.log(t)/Math.LN2},Io.prototype.project=function(e){var i=this.latRange?t.clamp(e.lat,-this.maxValidLatitude,this.maxValidLatitude):e.lat,o=this.lngLatXY(e.lng,i);return new t.Point(o[0],o[1])},Io.prototype.unproject=function(e){var i=this.xYLngLat(e.x,e.y);return new t.LngLat(i[0],i[1])},Po.point.get=function(){return this.project(this.center)},Io.prototype.lngLatXY=function(t,e){var i=this.crs.fromWGS84([t,e]);return [(i[0]-this.originX)*this.worldSize/this.worldWidth,(this.originY-i[1])*this.worldSize/this.worldHeight]},Io.prototype.lngX=function(t){return this.lngLatXY(t,this.center.lat)[0]},Io.prototype.latY=function(t){return this.lngLatXY(this.center.lng,t)[1]},Io.prototype.xYLngLat=function(t,e){return this.crs.toWGS84([t*this.worldWidth/this.worldSize+this.originX,this.originY-e*this.worldHeight/this.worldSize])},Io.prototype.xLng=function(t){var e=this.center,i=this.lngLatXY(e.lng,e.lat);return this.xYLngLat(t,i[1])[0]},Io.prototype.yLat=function(t){var e=this.center,i=this.lngLatXY(e.lng,e.lat);return this.xYLngLat(i[0],t)[1]},Io.prototype.setLocationAtPoint=function(e,i){var o=this.pointCoordinate(i),r=this.pointCoordinate(this.centerPoint),a=this.locationCoordinate(e),n=new t.MercatorCoordinate(a.x-(o.x-r.x),a.y-(o.y-r.y));this.center=this.coordinateLocation(n),this._renderWorldCopies&&(this.center=this.center.wrap());},Io.prototype.locationPoint=function(t){return this.coordinatePoint(this.locationCoordinate(t))},Io.prototype.pointLocation=function(t){return this.coordinateLocation(this.pointCoordinate(t))},Io.prototype.locationCoordinate=function(t){return this.crs.fromLngLat(t)},Io.prototype.coordinateLocation=function(t){return this.crs.toLngLat(t.x,t.y)},Io.prototype.pointCoordinate=function(e){var i=[e.x,e.y,0,1],o=[e.x,e.y,1,1];t.transformMat4(i,i,this.pixelMatrixInverse),t.transformMat4(o,o,this.pixelMatrixInverse);var r=i[3],a=o[3],n=i[1]/r,s=o[1]/a,l=i[2]/r,c=o[2]/a,h=l===c?0:(0-l)/(c-l);return new t.MercatorCoordinate(t.number(i[0]/r,o[0]/a,h)/this.worldSize,t.number(n,s,h)/this.worldSize)},Io.prototype.coordinatePoint=function(e){var i=[e.x*this.worldSize,e.y*this.worldSize,0,1];return t.transformMat4(i,i,this.pixelMatrix),new t.Point(i[0]/i[3],i[1]/i[3])},Io.prototype.getBounds=function(){return (new t.LngLatBounds).extend(this.pointLocation(new t.Point(0,0))).extend(this.pointLocation(new t.Point(this.width,0))).extend(this.pointLocation(new t.Point(this.width,this.height))).extend(this.pointLocation(new t.Point(0,this.height)))},Io.prototype.getMaxBounds=function(){return this.latRange&&2===this.latRange.length&&this.lngRange&&2===this.lngRange.length?new t.LngLatBounds([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]]):null},Io.prototype.setMaxBounds=function(t){t?(this.lngRange=[t.getWest(),t.getEast()],this.latRange=[t.getSouth(),t.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-this.maxValidLatitude,this.maxValidLatitude]);},Io.prototype.calculatePosMatrix=function(e,i){void 0===i&&(i=!1);var o=e.key,r=i?this._alignedPosMatrixCache:this._posMatrixCache;if(r[o])return r[o];var a=e.canonical,n=this.worldSize/this.zoomScale(a.z),s=a.x+Math.pow(2,a.z)*e.wrap,l=t.identity(new Float64Array(16));return t.translate(l,l,[s*n,a.y*n,0]),t.scale(l,l,[n/t.EXTENT,n/t.EXTENT,1]),t.multiply(l,i?this.alignedProjMatrix:this.projMatrix,l),r[o]=new Float32Array(l),r[o]},Io.prototype.customLayerMatrix=function(){return this.mercatorMatrix.slice()},Io.prototype._constrain=function(){if(this.center&&this.width&&this.height&&!this._constraining){this._constraining=!0;var e,i,o,r,a=-90,n=90,s=-180,l=180,c=this.size,h=this._unmodified;if(this.latRange){var u=this.latRange;a=this.latY(u[1]),e=(n=this.latY(u[0]))-an&&(r=n-m);}if(this.lngRange){var g=d.x,v=c.x/2;g-vl&&(o=l-v);}void 0===o&&void 0===r||(this.center=this.unproject(new t.Point(void 0!==o?o:d.x,void 0!==r?r:d.y))),this._unmodified=h,this._constraining=!1;}},Io.prototype._calcMatrices=function(){if(this.height){var e=this.centerOffset;this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height;var i=Math.PI/2+this._pitch,o=this._fov*(.5+e.y/this.height),r=Math.sin(o)*this.cameraToCenterDistance/Math.sin(t.clamp(Math.PI-i-o,.01,Math.PI-.01)),a=this.point,n=a.x,s=a.y,l=1.01*(Math.cos(Math.PI/2-this._pitch)*r+this.cameraToCenterDistance),c=this.height/50,h=new Float64Array(16);t.perspective(h,this._fov,this.width/this.height,c,l),h[8]=2*-e.x/this.width,h[9]=2*e.y/this.height,t.scale(h,h,[1,-1,1]),t.translate(h,h,[0,0,-this.cameraToCenterDistance]),t.rotateX(h,h,this._pitch),t.rotateZ(h,h,this.angle),t.translate(h,h,[-n,-s,0]),this.mercatorMatrix=t.scale([],h,[this.worldSize,this.worldSize,this.worldSize]);var u=this.worldSize/(2*Math.PI*6378137*Math.abs(Math.cos(this.center.lat*(Math.PI/180))));"m"!==this.units&&"meter"!==this.units||(u=this.crs?this.worldSize/(this.crs.extent[3]-this.crs.extent[1]):this.worldSize/(this.latRange[1]-this.latRange[0])),t.scale(h,h,[1,1,u,1]),this.projMatrix=h,this.invProjMatrix=t.invert([],this.projMatrix);var p=this.width%2/2,d=this.height%2/2,_=Math.cos(this.angle),f=Math.sin(this.angle),m=n-Math.round(n)+_*p+f*d,g=s-Math.round(s)+_*d+f*p,v=new Float64Array(h);if(t.translate(v,v,[m>.5?m-1:m,g>.5?g-1:g,0]),this.alignedProjMatrix=v,h=t.create(),t.scale(h,h,[this.width/2,-this.height/2,1]),t.translate(h,h,[1,-1,0]),this.labelPlaneMatrix=h,h=t.create(),t.scale(h,h,[1,-1,1]),t.translate(h,h,[-1,-1,0]),t.scale(h,h,[2/this.width,2/this.height,1]),this.glCoordMatrix=h,this.pixelMatrix=t.multiply(new Float64Array(16),this.labelPlaneMatrix,this.projMatrix),!(h=t.invert(new Float64Array(16),this.pixelMatrix)))throw new Error("failed to invert matrix");this.pixelMatrixInverse=h,this._posMatrixCache={},this._alignedPosMatrixCache={};}},Io.prototype.maxPitchScaleFactor=function(){if(!this.pixelMatrixInverse)return 1;var e=this.pointCoordinate(new t.Point(0,0)),i=[e.x*this.worldSize,e.y*this.worldSize,0,1];return t.transformMat4(i,i,this.pixelMatrix)[3]/this.cameraToCenterDistance},Io.prototype.getCameraPoint=function(){var e=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new t.Point(0,e))},Io.prototype.getCameraQueryGeometry=function(e){var i=this.getCameraPoint();if(1===e.length)return [e[0],i];for(var o=i.x,r=i.y,a=i.x,n=i.y,s=0,l=e;s=3&&!t.some((function(t){return isNaN(t)}))){var e=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(t[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+t[2],+t[1]],zoom:+t[0],bearing:e,pitch:+(t[4]||0)}),!0}return !1},Co.prototype._updateHashUnthrottled=function(){var e=this.getHashString();try{t.window.history.replaceState(t.window.history.state,"",e);}catch(t){}};var zo={linearity:.3,easing:t.bezier(0,0,.3,1)},Mo=t.extend({deceleration:2500,maxSpeed:1400},zo),Lo=t.extend({deceleration:20,maxSpeed:1400},zo),Do=t.extend({deceleration:1e3,maxSpeed:360},zo),Ro=t.extend({deceleration:1e3,maxSpeed:90},zo),Ao=function(t){this._map=t,this.clear();};function ko(t,e){(!t.duration||t.duration0&&i-e[0].time>160;)e.shift();},Ao.prototype._onMoveEnd=function(e){if(this._drainInertiaBuffer(),!(this._inertiaBuffer.length<2)){for(var i={zoom:0,bearing:0,pitch:0,pan:new t.Point(0,0),pinchAround:void 0,around:void 0},o=0,r=this._inertiaBuffer;o=this._clickTolerance||this._map.fire(new Bo(t.type,this._map,t));},No.prototype.dblclick=function(t){return this._firePreventable(new Bo(t.type,this._map,t))},No.prototype.mouseover=function(t){this._map.fire(new Bo(t.type,this._map,t));},No.prototype.mouseout=function(t){this._map.fire(new Bo(t.type,this._map,t));},No.prototype.touchstart=function(t){return this._firePreventable(new Fo(t.type,this._map,t))},No.prototype.touchmove=function(t){this._map.fire(new Fo(t.type,this._map,t));},No.prototype.touchend=function(t){this._map.fire(new Fo(t.type,this._map,t));},No.prototype.touchcancel=function(t){this._map.fire(new Fo(t.type,this._map,t));},No.prototype._firePreventable=function(t){if(this._map.fire(t),t.defaultPrevented)return {}},No.prototype.isEnabled=function(){return !0},No.prototype.isActive=function(){return !1},No.prototype.enable=function(){},No.prototype.disable=function(){};var jo=function(t){this._map=t;};jo.prototype.reset=function(){this._delayContextMenu=!1,delete this._contextMenuEvent;},jo.prototype.mousemove=function(t){this._map.fire(new Bo(t.type,this._map,t));},jo.prototype.mousedown=function(){this._delayContextMenu=!0;},jo.prototype.mouseup=function(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new Bo("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent);},jo.prototype.contextmenu=function(t){this._delayContextMenu?this._contextMenuEvent=t:this._map.fire(new Bo(t.type,this._map,t)),this._map.listens("contextmenu")&&t.preventDefault();},jo.prototype.isEnabled=function(){return !0},jo.prototype.isActive=function(){return !1},jo.prototype.enable=function(){},jo.prototype.disable=function(){};var Zo=function(t,e){this._map=t,this._el=t.getCanvasContainer(),this._container=t.getContainer(),this._clickTolerance=e.clickTolerance||1;};function qo(t,e){for(var i={},o=0;othis.numTouches)&&(this.aborted=!0),this.aborted||(void 0===this.startTime&&(this.startTime=e.timeStamp),o.length===this.numTouches&&(this.centroid=function(e){for(var i=new t.Point(0,0),o=0,r=e;o30)&&(this.aborted=!0);}}},Go.prototype.touchend=function(t,e,i){if((!this.centroid||t.timeStamp-this.startTime>500)&&(this.aborted=!0),0===i.length){var o=!this.aborted&&this.centroid;if(this.reset(),o)return o}};var Vo=function(t){this.singleTap=new Go(t),this.numTaps=t.numTaps,this.reset();};Vo.prototype.reset=function(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset();},Vo.prototype.touchstart=function(t,e,i){this.singleTap.touchstart(t,e,i);},Vo.prototype.touchmove=function(t,e,i){this.singleTap.touchmove(t,e,i);},Vo.prototype.touchend=function(t,e,i){var o=this.singleTap.touchend(t,e,i);if(o){var r=t.timeStamp-this.lastTime<500,a=!this.lastTap||this.lastTap.dist(o)<30;if(r&&a||this.reset(),this.count++,this.lastTime=t.timeStamp,this.lastTap=o,this.count===this.numTaps)return this.reset(),o}};var Wo=function(){this._zoomIn=new Vo({numTouches:1,numTaps:2}),this._zoomOut=new Vo({numTouches:2,numTaps:1}),this.reset();};Wo.prototype.reset=function(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset();},Wo.prototype.touchstart=function(t,e,i){this._zoomIn.touchstart(t,e,i),this._zoomOut.touchstart(t,e,i);},Wo.prototype.touchmove=function(t,e,i){this._zoomIn.touchmove(t,e,i),this._zoomOut.touchmove(t,e,i);},Wo.prototype.touchend=function(t,e,i){var o=this,r=this._zoomIn.touchend(t,e,i),a=this._zoomOut.touchend(t,e,i);return r?(this._active=!0,t.preventDefault(),setTimeout((function(){return o.reset()}),0),{cameraAnimation:function(e){return e.easeTo({duration:300,zoom:e.getZoom()+1,around:e.unproject(r)},{originalEvent:t})}}):a?(this._active=!0,t.preventDefault(),setTimeout((function(){return o.reset()}),0),{cameraAnimation:function(e){return e.easeTo({duration:300,zoom:e.getZoom()-1,around:e.unproject(a)},{originalEvent:t})}}):void 0},Wo.prototype.touchcancel=function(){this.reset();},Wo.prototype.enable=function(){this._enabled=!0;},Wo.prototype.disable=function(){this._enabled=!1,this.reset();},Wo.prototype.isEnabled=function(){return this._enabled},Wo.prototype.isActive=function(){return this._active};var Xo={0:1,2:2},Ho=function(t){this.reset(),this._clickTolerance=t.clickTolerance||1;};Ho.prototype.reset=function(){this._active=!1,this._moved=!1,delete this._lastPoint,delete this._eventButton;},Ho.prototype._correctButton=function(t,e){return !1},Ho.prototype._move=function(t,e){return {}},Ho.prototype.mousedown=function(t,e){if(!this._lastPoint){var o=i.mouseButton(t);this._correctButton(t,o)&&(this._lastPoint=e,this._eventButton=o);}},Ho.prototype.mousemoveWindow=function(t,e){var i=this._lastPoint;if(i)if(t.preventDefault(),function(t,e){var i=Xo[e];return void 0===t.buttons||(t.buttons&i)!==i}(t,this._eventButton))this.reset();else if(this._moved||!(e.dist(i)0&&(this._active=!0);var r=qo(o,i),a=new t.Point(0,0),n=new t.Point(0,0),s=0;for(var l in r){var c=r[l],h=this._touches[l];h&&(a._add(c),n._add(c.sub(h)),s++,r[l]=c);}if(this._touches=r,!(sMath.abs(t.x)}var nr=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.reset=function(){t.prototype.reset.call(this),this._valid=void 0,delete this._firstMove,delete this._lastPoints;},e.prototype._start=function(t){this._lastPoints=t,ar(t[0].sub(t[1]))&&(this._valid=!1);},e.prototype._move=function(t,e,i){var o=t[0].sub(this._lastPoints[0]),r=t[1].sub(this._lastPoints[1]);if(this._valid=this.gestureBeginsVertically(o,r,i.timeStamp),this._valid)return this._lastPoints=t,this._active=!0,{pitchDelta:(o.y+r.y)/2*-.5}},e.prototype.gestureBeginsVertically=function(t,e,i){if(void 0!==this._valid)return this._valid;var o=t.mag()>=2,r=e.mag()>=2;if(o||r){if(!o||!r)return void 0===this._firstMove&&(this._firstMove=i),i-this._firstMove<100&&void 0;var a=t.y>0==e.y>0;return ar(t)&&ar(e)&&a}},e}($o),sr={panStep:100,bearingStep:15,pitchStep:10},lr=function(){var t=sr;this._panStep=t.panStep,this._bearingStep=t.bearingStep,this._pitchStep=t.pitchStep;};function cr(t){return t*(2-t)}lr.prototype.reset=function(){this._active=!1;},lr.prototype.keydown=function(t){var e=this;if(!(t.altKey||t.ctrlKey||t.metaKey)){var i=0,o=0,r=0,a=0,n=0;switch(t.keyCode){case 61:case 107:case 171:case 187:i=1;break;case 189:case 109:case 173:i=-1;break;case 37:t.shiftKey?o=-1:(t.preventDefault(),a=-1);break;case 39:t.shiftKey?o=1:(t.preventDefault(),a=1);break;case 38:t.shiftKey?r=1:(t.preventDefault(),n=-1);break;case 40:t.shiftKey?r=-1:(t.preventDefault(),n=1);break;default:return}return {cameraAnimation:function(s){var l=s.getZoom();s.easeTo({duration:300,easeId:"keyboardHandler",easing:cr,zoom:i?Math.round(l)+i*(t.shiftKey?2:1):l,bearing:s.getBearing()+o*e._bearingStep,pitch:s.getPitch()+r*e._pitchStep,offset:[-a*e._panStep,-n*e._panStep],center:s.getCenter()},{originalEvent:t});}}}},lr.prototype.enable=function(){this._enabled=!0;},lr.prototype.disable=function(){this._enabled=!1,this.reset();},lr.prototype.isEnabled=function(){return this._enabled},lr.prototype.isActive=function(){return this._active};var hr=function(e,i){this._map=e,this._el=e.getCanvasContainer(),this._handler=i,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=1/450,t.bindAll(["_onTimeout"],this);};hr.prototype.setZoomRate=function(t){this._defaultZoomRate=t;},hr.prototype.setWheelZoomRate=function(t){this._wheelZoomRate=t;},hr.prototype.isEnabled=function(){return !!this._enabled},hr.prototype.isActive=function(){return !!this._active||void 0!==this._finishTimeout},hr.prototype.isZooming=function(){return !!this._zooming},hr.prototype.enable=function(t){this.isEnabled()||(this._enabled=!0,this._aroundCenter=t&&"center"===t.around);},hr.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1);},hr.prototype.wheel=function(e){if(this.isEnabled()){var i=e.deltaMode===t.window.WheelEvent.DOM_DELTA_LINE?40*e.deltaY:e.deltaY,o=t.browser.now(),r=o-(this._lastWheelEventTime||0);this._lastWheelEventTime=o,0!==i&&i%4.000244140625==0?this._type="wheel":0!==i&&Math.abs(i)<4?this._type="trackpad":r>400?(this._type=null,this._lastValue=i,this._timeout=setTimeout(this._onTimeout,40,e)):this._type||(this._type=Math.abs(r*i)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,i+=this._lastValue)),e.shiftKey&&i&&(i/=4),this._type&&(this._lastWheelEvent=e,this._delta-=i,this._active||this._start(e)),e.preventDefault();}},hr.prototype._onTimeout=function(t){this._type="wheel",this._delta-=this._lastValue,this._active||this._start(t);},hr.prototype._start=function(e){if(this._delta){this._frameId&&(this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);var o=i.mousePos(this._el,e);this._around=t.LngLat.convert(this._aroundCenter?this._map.getCenter():this._map.unproject(o)),this._aroundPoint=this._map.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._handler._triggerRenderFrame());}},hr.prototype.renderFrame=function(){var e=this;if(this._frameId&&(this._frameId=null,this.isActive())){var i=this._map.transform;if(0!==this._delta){var o="wheel"===this._type&&Math.abs(this._delta)>4.000244140625?this._wheelZoomRate:this._defaultZoomRate,r=2/(1+Math.exp(-Math.abs(this._delta*o)));this._delta<0&&0!==r&&(r=1/r);var a="number"==typeof this._targetZoom?i.zoomScale(this._targetZoom):i.scale;this._targetZoom=Math.min(i.maxZoom,Math.max(i.minZoom,i.scaleZoom(a*r))),"wheel"===this._type&&(this._startZoom=i.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0;}var n,s="number"==typeof this._targetZoom?this._targetZoom:i.zoom,l=this._startZoom,c=this._easing,h=!1;if("wheel"===this._type&&l&&c){var u=Math.min((t.browser.now()-this._lastWheelEventTime)/200,1),p=c(u);n=t.number(l,s,p),u<1?this._frameId||(this._frameId=!0):h=!0;}else n=s,h=!0;return this._active=!0,h&&(this._active=!1,this._finishTimeout=setTimeout((function(){e._zooming=!1,e._handler._triggerRenderFrame(),delete e._targetZoom,delete e._finishTimeout;}),200)),{noInertia:!0,needsRenderFrame:!h,zoomDelta:n-i.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}},hr.prototype._smoothOutEasing=function(e){var i=t.ease;if(this._prevEase){var o=this._prevEase,r=(t.browser.now()-o.start)/o.duration,a=o.easing(r+.01)-o.easing(r),n=.27/Math.sqrt(a*a+1e-4)*.01,s=Math.sqrt(.0729-n*n);i=t.bezier(n,s,.25,1);}return this._prevEase={start:t.browser.now(),duration:e,easing:i},i},hr.prototype.reset=function(){this._active=!1;};var ur=function(t,e){this._clickZoom=t,this._tapZoom=e;};ur.prototype.enable=function(){this._clickZoom.enable(),this._tapZoom.enable();},ur.prototype.disable=function(){this._clickZoom.disable(),this._tapZoom.disable();},ur.prototype.isEnabled=function(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()},ur.prototype.isActive=function(){return this._clickZoom.isActive()||this._tapZoom.isActive()};var pr=function(){this.reset();};pr.prototype.reset=function(){this._active=!1;},pr.prototype.dblclick=function(t,e){return t.preventDefault(),{cameraAnimation:function(i){i.easeTo({duration:300,zoom:i.getZoom()+(t.shiftKey?-1:1),around:i.unproject(e)},{originalEvent:t});}}},pr.prototype.enable=function(){this._enabled=!0;},pr.prototype.disable=function(){this._enabled=!1,this.reset();},pr.prototype.isEnabled=function(){return this._enabled},pr.prototype.isActive=function(){return this._active};var dr=function(){this._tap=new Vo({numTouches:1,numTaps:1}),this.reset();};dr.prototype.reset=function(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,this._tap.reset();},dr.prototype.touchstart=function(t,e,i){this._swipePoint||(this._tapTime&&t.timeStamp-this._tapTime>500&&this.reset(),this._tapTime?i.length>0&&(this._swipePoint=e[0],this._swipeTouch=i[0].identifier):this._tap.touchstart(t,e,i));},dr.prototype.touchmove=function(t,e,i){if(this._tapTime){if(this._swipePoint){if(i[0].identifier!==this._swipeTouch)return;var o=e[0],r=o.y-this._swipePoint.y;return this._swipePoint=o,t.preventDefault(),this._active=!0,{zoomDelta:r/128}}}else this._tap.touchmove(t,e,i);},dr.prototype.touchend=function(t,e,i){this._tapTime?this._swipePoint&&0===i.length&&this.reset():this._tap.touchend(t,e,i)&&(this._tapTime=t.timeStamp);},dr.prototype.touchcancel=function(){this.reset();},dr.prototype.enable=function(){this._enabled=!0;},dr.prototype.disable=function(){this._enabled=!1,this.reset();},dr.prototype.isEnabled=function(){return this._enabled},dr.prototype.isActive=function(){return this._active};var _r=function(t,e,i){this._el=t,this._mousePan=e,this._touchPan=i;};_r.prototype.enable=function(t){this._inertiaOptions=t||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("mapboxgl-touch-drag-pan");},_r.prototype.disable=function(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("mapboxgl-touch-drag-pan");},_r.prototype.isEnabled=function(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()},_r.prototype.isActive=function(){return this._mousePan.isActive()||this._touchPan.isActive()};var fr=function(t,e,i){this._pitchWithRotate=t.pitchWithRotate,this._mouseRotate=e,this._mousePitch=i;};fr.prototype.enable=function(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable();},fr.prototype.disable=function(){this._mouseRotate.disable(),this._mousePitch.disable();},fr.prototype.isEnabled=function(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())},fr.prototype.isActive=function(){return this._mouseRotate.isActive()||this._mousePitch.isActive()};var mr=function(t,e,i,o){this._el=t,this._touchZoom=e,this._touchRotate=i,this._tapDragZoom=o,this._rotationDisabled=!1,this._enabled=!0;};mr.prototype.enable=function(t){this._touchZoom.enable(t),this._rotationDisabled||this._touchRotate.enable(t),this._tapDragZoom.enable(),this._el.classList.add("mapboxgl-touch-zoom-rotate");},mr.prototype.disable=function(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("mapboxgl-touch-zoom-rotate");},mr.prototype.isEnabled=function(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()},mr.prototype.isActive=function(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()},mr.prototype.disableRotation=function(){this._rotationDisabled=!0,this._touchRotate.disable();},mr.prototype.enableRotation=function(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable();};var gr=function(t){return t.zoom||t.drag||t.pitch||t.rotate},vr=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(t.Event);function yr(t){return t.panDelta&&t.panDelta.mag()||t.zoomDelta||t.bearingDelta||t.pitchDelta}var xr=function(e,o){this._map=e,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new Ao(e),this._bearingSnap=o.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(o),t.bindAll(["handleEvent","handleWindowEvent"],this);var r=this._el;this._listeners=[[r,"touchstart",{passive:!0}],[r,"touchmove",{passive:!1}],[r,"touchend",void 0],[r,"touchcancel",void 0],[r,"mousedown",void 0],[r,"mousemove",void 0],[r,"mouseup",void 0],[t.window.document,"mousemove",{capture:!0}],[t.window.document,"mouseup",void 0],[r,"mouseover",void 0],[r,"mouseout",void 0],[r,"dblclick",void 0],[r,"click",void 0],[r,"keydown",{capture:!1}],[r,"keyup",void 0],[r,"wheel",{passive:!1}],[r,"contextmenu",void 0],[t.window,"blur",void 0]];for(var a=0,n=this._listeners;aa?Math.min(2,b):Math.max(.5,b),w=Math.pow(m,1-e),E=r.unproject(y.add(x.mult(e*w)).mult(f));r.setLocationAtPoint(r.renderWorldCopies?E.wrap():E,_);}o._fireMoveEvents(i);}),(function(t){o._afterEase(i,t);}),e),this},i.prototype._prepareEase=function(e,i,o){void 0===o&&(o={}),this._moving=!0,i||o.moving||this.fire(new t.Event("movestart",e)),this._zooming&&!o.zooming&&this.fire(new t.Event("zoomstart",e)),this._rotating&&!o.rotating&&this.fire(new t.Event("rotatestart",e)),this._pitching&&!o.pitching&&this.fire(new t.Event("pitchstart",e));},i.prototype._fireMoveEvents=function(e){this.fire(new t.Event("move",e)),this._zooming&&this.fire(new t.Event("zoom",e)),this._rotating&&this.fire(new t.Event("rotate",e)),this._pitching&&this.fire(new t.Event("pitch",e));},i.prototype._afterEase=function(e,i){if(!this._easeId||!i||this._easeId!==i){delete this._easeId;var o=this._zooming,r=this._rotating,a=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,o&&this.fire(new t.Event("zoomend",e)),r&&this.fire(new t.Event("rotateend",e)),a&&this.fire(new t.Event("pitchend",e)),this.fire(new t.Event("moveend",e));}},i.prototype.flyTo=function(e,i){var o=this;if(!e.essential&&t.browser.prefersReducedMotion){var r=t.pick(e,["center","zoom","bearing","pitch","around"]);return this.jumpTo(r,i)}this.stop(),e=t.extend({offset:[0,0],speed:1.2,curve:1.42,easing:t.ease},e);var a=this.transform,n=this.getZoom(),s=this.getBearing(),l=this.getPitch(),c=this.getPadding(),h="zoom"in e?t.clamp(+e.zoom,a.minZoom,a.maxZoom):n,u="bearing"in e?this._normalizeBearing(e.bearing,s):s,p="pitch"in e?+e.pitch:l,d="padding"in e?e.padding:a.padding,_=a.zoomScale(h-n),f=t.Point.convert(e.offset),m=a.centerPoint.add(f),g=a.pointLocation(m),v=t.LngLat.convert(e.center||g);this._normalizeCenter(v);var y=a.project(g),x=a.project(v).sub(y),b=e.curve,w=Math.max(a.width,a.height),E=w/_,T=x.mag();if("minZoom"in e){var S=t.clamp(Math.min(e.minZoom,n,h),a.minZoom,a.maxZoom),I=w/a.zoomScale(S-n);b=Math.sqrt(I/T*2);}var P=b*b;function C(t){var e=(E*E-w*w+(t?-1:1)*P*P*T*T)/(2*(t?E:w)*P*T);return Math.log(Math.sqrt(e*e+1)-e)}function z(t){return (Math.exp(t)-Math.exp(-t))/2}function M(t){return (Math.exp(t)+Math.exp(-t))/2}var L=C(0),D=function(t){return M(L)/M(L+b*t)},R=function(t){return w*((M(L)*(z(e=L+b*t)/M(e))-z(L))/P)/T;var e;},A=(C(1)-L)/b;if(Math.abs(T)<1e-6||!isFinite(A)){if(Math.abs(w-E)<1e-6)return this.easeTo(e,i);var k=Ee.maxDuration&&(e.duration=0),this._zooming=!0,this._rotating=s!==u,this._pitching=p!==l,this._padding=!a.isPaddingEqual(d),this._prepareEase(i,!1),this._ease((function(e){var r=e*A,_=1/D(r);a.zoom=1===e?h:n+a.scaleZoom(_),o._rotating&&(a.bearing=t.number(s,u,e)),o._pitching&&(a.pitch=t.number(l,p,e)),o._padding&&(a.interpolatePadding(c,d,e),m=a.centerPoint.add(f));var g=1===e?v:a.unproject(y.add(x.mult(R(r))).mult(_));a.setLocationAtPoint(a.renderWorldCopies?g.wrap():g,m),o._fireMoveEvents(i);}),(function(){return o._afterEase(i)}),e),this},i.prototype.isEasing=function(){return !!this._easeFrameId},i.prototype.stop=function(){return this._stop()},i.prototype._stop=function(t,e){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){var i=this._onEaseEnd;delete this._onEaseEnd,i.call(this,e);}if(!t){var o=this.handlers;o&&o.stop(!1);}return this},i.prototype._ease=function(e,i,o){!1===o.animate||0===o.duration?(e(1),i()):(this._easeStart=t.browser.now(),this._easeOptions=o,this._onEaseFrame=e,this._onEaseEnd=i,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback));},i.prototype._renderFrameCallback=function(){var e=Math.min((t.browser.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(e)),e<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop();},i.prototype._normalizeBearing=function(e,i){e=t.wrap(e,-180,180);var o=Math.abs(e-i);return Math.abs(e-360-i)180?-360:i<-180?360:0;}},i}(t.Evented),wr=function(e){void 0===e&&(e={}),this.options=e,t.bindAll(["_updateEditLink","_updateData","_updateCompact"],this);};wr.prototype.getDefaultPosition=function(){return "bottom-right"},wr.prototype.onAdd=function(t){var e=this.options&&this.options.compact;return this._map=t,this._container=i.create("div","mapboxgl-ctrl mapboxgl-ctrl-attrib"),this._innerContainer=i.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},wr.prototype.onRemove=function(){i.remove(this._container),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("moveend",this._updateEditLink),this._map.off("resize",this._updateCompact),this._map=void 0,this._attribHTML=void 0;},wr.prototype._updateEditLink=function(){var e=this._editLink;e||(e=this._editLink=this._container.querySelector(".mapbox-improve-map"));var i=[{key:"owner",value:this.styleOwner},{key:"id",value:this.styleId},{key:"access_token",value:this._map._requestManager._customAccessToken||t.config.ACCESS_TOKEN}];if(e){var o=i.reduce((function(t,e,o){return e.value&&(t+=e.key+"="+e.value+(o=0)return !1;return !0}))).join(" | ");n!==this._attribHTML&&(this._attribHTML=n,t.length?(this._innerContainer.innerHTML=n,this._container.classList.remove("mapboxgl-attrib-empty")):this._container.classList.add("mapboxgl-attrib-empty"),this._editLink=null);}},wr.prototype._updateCompact=function(){this._map.getCanvasContainer().offsetWidth<=640?this._container.classList.add("mapboxgl-compact"):this._container.classList.remove("mapboxgl-compact");};var Er=function(){t.bindAll(["_updateLogo"],this),t.bindAll(["_updateCompact"],this);};Er.prototype.onAdd=function(t){this._map=t,this._container=i.create("div","mapboxgl-ctrl");var e=i.create("a","mapboxgl-ctrl-logo");return e.target="_blank",e.rel="noopener nofollow",e.href="https://www.mapbox.com/",e.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),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},Er.prototype.onRemove=function(){i.remove(this._container),this._map.off("sourcedata",this._updateLogo),this._map.off("resize",this._updateCompact);},Er.prototype.getDefaultPosition=function(){return "bottom-left"},Er.prototype._updateLogo=function(t){t&&"metadata"!==t.sourceDataType||(this._container.style.display=this._logoRequired()?"block":"none");},Er.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}},Er.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 Tr=function(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1;};Tr.prototype.add=function(t){var e=++this._id;return this._queue.push({callback:t,id:e,cancelled:!1}),e},Tr.prototype.remove=function(t){for(var e=this._currentlyRunning,i=0,o=e?this._queue.concat(e):this._queue;i=0&&i.add(r);return i.size>0?Array.from(i):Sr}(a.projName).join(",")),t.proj4.defs(i,this.WKT));var n=t.proj4.defs(i);if(!n)throw new Error(i+" was not defined,make sure the WKT param was not null");this.unit=n.units||"degree",this.proj4Projection=t.proj4(i);var s=this.proj4Projection.inverse([this.extent[0],this.extent[1]]),l=this.proj4Projection.inverse([this.extent[2],this.extent[3]]);this.lngLatExtent=s.concat(l),this._id=t.uniqueId(),e.set(this);};Pr.prototype.getExtent=function(){if(!this._rectifyExtent){var t=this.extent[2]-this.extent[0],e=this.extent[3]-this.extent[1];if(t===e)this._rectifyExtent=[this.extent[0],this.extent[1],this.extent[2],this.extent[3]];else {var i=Math.max(t,e);this._rectifyExtent=[this.extent[0],this.extent[3]-i,this.extent[0]+i,this.extent[3]];}}return this._rectifyExtent},Pr.prototype.getLngLatCenter=function(){return this._rectifyLngLatExtent||this.getLngLatExtent(),[this._rectifyLngLatExtent[2]+(this._rectifyLngLatExtent[2]-this._rectifyLngLatExtent[0])/2,this._rectifyLngLatExtent[3]-(this._rectifyLngLatExtent[3]-this._rectifyLngLatExtent[1])/2]},Pr.prototype.getLngLatExtent=function(){if(!this._rectifyLngLatExtent){var t=this.proj4Projection.inverse([this.extent[0],this.extent[1]]),e=this.proj4Projection.inverse([this.extent[2],this.extent[3]]),i=e[0]-t[0],o=e[1]-t[1];if(i===o)this._rectifyLngLatExtent=[t[0],t[1],e[0],e[0]];else {var r=Math.max(i,o);this._rectifyLngLatExtent=[t[0],e[1]-r,t[0]+r,e[1]];}}return this._rectifyLngLatExtent},Pr.prototype.getOrigin=function(){return [this.extent[0],this.extent[3]]},Pr.prototype.getEpsgCode=function(){return this.epsgCode},Pr.prototype.getUnit=function(){return this.unit},Pr.prototype.getWKT=function(){return this.WKT},Pr.prototype.getWidth=function(){return this._rectifyExtent[2]-this._rectifyExtent[0]},Pr.prototype.getHeight=function(){return this._rectifyExtent[3]-this._rectifyExtent[1]},Pr.prototype.getOriginX=function(){return this._rectifyExtent[0]},Pr.prototype.getOriginY=function(){return this._rectifyExtent[3]},Pr.prototype.toWGS84=function(t){var e=this.proj4Projection.inverse(t);this.getLngLatExtent(),this.getExtent();var i=e[0];return t[0]>this._rectifyExtent[2]&&ithis._rectifyLngLatExtent[0]&&(i=this._rectifyLngLatExtent[0]-(this._rectifyLngLatExtent[2]-i)),[i,e[1]]},Pr.prototype.fromWGS84=function(t){var e=this.proj4Projection.forward(t);return this.getLngLatExtent(),this.getExtent(),t[0]>this._rectifyLngLatExtent[2]&&e[0]this._rectifyExtent[0]&&(e[0]=this._rectifyExtent[0]-(this._rectifyExtent[2]-e[0])),e},Pr.prototype.fromLngLat=function(e){var i=t.LngLat.convert(e),o=this.fromWGS84([i.lng,i.lat]);return {x:(o[0]-this.getOriginX())/this.getWidth(),y:(this.getOriginY()-o[1])/this.getHeight(),z:0}},Pr.prototype.toLngLat=function(e,i){var o=this.toWGS84([e*this.getWidth()+this.getOriginX(),this.getOriginY()-i*this.getHeight()]);return new t.LngLat(o[0],o[1])},Pr.get=function(t){for(var e in Pr)if(Pr.hasOwnProperty(e)&&Pr[e].getEpsgCode&&Pr[e].getEpsgCode()===t)return Pr[e];return null},Pr.set=function(t){var e=t.getEpsgCode().replace(":","").toUpperCase();Pr[e]=t;},Pr.defaultWKTs={"EPSG:4490":'GEOGCS["China Geodetic Coordinate System 2000",DATUM["China_2000",SPHEROID["CGCS2000",6378137,298.257222101,AUTHORITY["EPSG","1024"]],AUTHORITY["EPSG","1043"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4490"]]',"EPSG:4214":'GEOGCS["Beijing 1954",DATUM["Beijing_1954",SPHEROID["Krassowsky 1940",6378245,298.3],TOWGS84[15.8,-154.4,-82.3,0,0,0,0]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4214"]]',"EPSG:4610":'GEOGCS["Xian 1980",DATUM["Xian_1980",SPHEROID["IAG 1975",6378140,298.257,AUTHORITY["EPSG","7049"]],AUTHORITY["EPSG","6610"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4610"]]'},Pr.EPSG4326=new Pr("EPSG:4326",[-180,-90,180,90]),Pr.EPSG4490=new Pr("EPSG:4490",[-180,-90,180,90]),Pr.EPSG4214=new Pr("EPSG:4214",[-180,-90,180,90]),Pr.EPSG4610=new Pr("EPSG:4610",[-180,-90,180,90]),Pr.EPSG3857=new Pr("EPSG:3857",[-20037508.3427892,-20037508.3427892,20037508.3427892,20037508.3427892]);var Cr={"FullscreenControl.Enter":"Enter fullscreen","FullscreenControl.Exit":"Exit fullscreen","GeolocateControl.FindMyLocation":"Find my location","GeolocateControl.LocationNotAvailable":"Location not available","LogoControl.Title":"Mapbox logo","NavigationControl.ResetBearing":"Reset bearing to north","NavigationControl.ZoomIn":"Zoom in","NavigationControl.ZoomOut":"Zoom out","ScaleControl.Feet":"ft","ScaleControl.Meters":"m","ScaleControl.Kilometers":"km","ScaleControl.Miles":"mi","ScaleControl.NauticalMiles":"nm"},zr=t.window.HTMLImageElement,Mr=t.window.HTMLElement,Lr=t.window.ImageBitmap,Dr={center:[0,0],zoom:0,bearing:0,pitch:0,minZoom:-2,maxZoom:22,minPitch:0,maxPitch:60,interactive:!0,scrollZoom:!0,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,touchPitch:!0,bearingSnap:7,clickTolerance:3,pitchWithRotate:!0,hash:!1,attributionControl:!0,failIfMajorPerformanceCaveat:!1,preserveDrawingBuffer:!1,trackResize:!0,renderWorldCopies:!0,refreshExpiredTiles:!0,maxTileCacheSize:null,localIdeographFontFamily:"sans-serif",transformRequest:null,accessToken:null,fadeDuration:300,crossSourceCollisions:!0},Rr=function(o){function r(e){var i=this;if(null!=(e=t.extend({},Dr,e)).minZoom&&null!=e.maxZoom&&e.minZoom>e.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(null!=e.minPitch&&null!=e.maxPitch&&e.minPitch>e.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(null!=e.minPitch&&e.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(null!=e.maxPitch&&e.maxPitch>60)throw new Error("maxPitch must be less than or equal to 60");var r=new Io(e.minZoom,e.maxZoom,e.minPitch,e.maxPitch,e.renderWorldCopies);if(o.call(this,r,e),this.transform=r,this.crs=this.toCRS(e.crs),this.initCRS(this.crs),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 Tr,this._controls=[],this._markersCache=[],this._mapId=t.uniqueId(),this._locale=t.extend({},Cr,e.locale),this._requestManager=new t.RequestManager(e.transformRequest,e.accessToken),"string"==typeof e.container){if(this._container=t.window.document.getElementById(e.container),!this._container)throw new Error("Container '"+e.container+"' not found.")}else {if(!(e.container instanceof Mr))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=e.container;}if(e.maxBounds&&this.setMaxBounds(e.maxBounds),t.bindAll(["_onWindowOnline","_onWindowResize","_contextLost","_contextRestored"],this),this._setupContainer(),this._setupPainter(),void 0===this.painter)throw new Error("Failed to initialize WebGL.");this.on("move",(function(){return i._update(!1)})),this.on("moveend",(function(){return i._update(!1)})),this.on("zoom",(function(){return i._update(!0)})),void 0!==t.window&&(t.window.addEventListener("online",this._onWindowOnline,!1),t.window.addEventListener("resize",this._onWindowResize,!1),t.window.addEventListener("orientationchange",this._onWindowResize,!1)),this.handlers=new xr(this,e),this._hash=e.hash&&new Co("string"==typeof e.hash&&e.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:e.center,zoom:e.zoom,bearing:e.bearing,pitch:e.pitch}),e.bounds&&(this.resize(),this.fitBounds(e.bounds,t.extend({},e.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=e.localIdeographFontFamily,e.style&&this.setStyle(e.style,{localIdeographFontFamily:e.localIdeographFontFamily}),e.attributionControl&&this.addControl(new wr({customAttribution:e.customAttribution})),this.addControl(new Er,e.logoPosition),this.on("style.load",(function(){i.transform.unmodified&&i.jumpTo(i.style.stylesheet);})),this.on("data",(function(e){i._update("style"===e.dataType),i.fire(new t.Event(e.dataType+"data",e));})),this.on("dataloading",(function(e){i.fire(new t.Event(e.dataType+"dataloading",e));}));}o&&(r.__proto__=o),(r.prototype=Object.create(o&&o.prototype)).constructor=r;var a={showTileBoundaries:{configurable:!0},showPadding:{configurable:!0},showCollisionBoxes:{configurable:!0},showOverdrawInspector:{configurable:!0},repaint:{configurable:!0},vertices:{configurable:!0},version:{configurable:!0}};return r.prototype.toCRS=function(t){if(t&&"string"==typeof t&&!(t=Pr.get(t)))throw new Error("crs "+t+" is not define");return t||Pr.EPSG3857},r.prototype.getCRS=function(){return this.crs},r.prototype._getMapId=function(){return this._mapId},r.prototype.addControl=function(e,i){if(void 0===i&&e.getDefaultPosition&&(i=e.getDefaultPosition()),void 0===i&&(i="top-right"),!e||!e.onAdd)return this.fire(new t.ErrorEvent(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));var o=e.onAdd(this);this._controls.push(e);var r=this._controlPositions[i];return -1!==i.indexOf("bottom")?r.insertBefore(o,r.firstChild):r.appendChild(o),this},r.prototype.removeControl=function(e){if(!e||!e.onRemove)return this.fire(new t.ErrorEvent(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));var i=this._controls.indexOf(e);return i>-1&&this._controls.splice(i,1),e.onRemove(this),this},r.prototype.resize=function(e){var i=this._containerDimensions(),o=i[0],r=i[1];this._resizeCanvas(o,r),this.transform.resize(o,r),this.painter.resize(o,r);var a=!this._moving;return a&&(this.stop(),this.fire(new t.Event("movestart",e)).fire(new t.Event("move",e))),this.fire(new t.Event("resize",e)),a&&this.fire(new t.Event("moveend",e)),this},r.prototype.getBounds=function(){return this.transform.getBounds()},r.prototype.getMaxBounds=function(){return this.transform.getMaxBounds()},r.prototype.setMaxBounds=function(e){return this.transform.setMaxBounds(t.LngLatBounds.convert(e)),this._update()},r.prototype.setMinZoom=function(t){if((t=null==t?-2:t)>=-2&&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")},r.prototype.getMaxZoom=function(){return this.transform.maxZoom},r.prototype.setMinPitch=function(t){if((t=null==t?0:t)<0)throw new Error("minPitch must be greater than or equal to 0");if(t>=0&&t<=this.transform.maxPitch)return this.transform.minPitch=t,this._update(),this.getPitch()60)throw new Error("maxPitch must be less than or equal to 60");if(t>=this.transform.minPitch)return this.transform.maxPitch=t,this._update(),this.getPitch()>t&&this.setPitch(t),this;throw new Error("maxPitch must be greater than the current minPitch")},r.prototype.getMaxPitch=function(){return this.transform.maxPitch},r.prototype.getRenderWorldCopies=function(){return this.transform.renderWorldCopies},r.prototype.setRenderWorldCopies=function(t){return this.transform.renderWorldCopies=t,this._update()},r.prototype.project=function(e){return this.transform.locationPoint(t.LngLat.convert(e))},r.prototype.unproject=function(e){return this.transform.pointLocation(t.Point.convert(e))},r.prototype.isMoving=function(){return this._moving||this.handlers.isMoving()},r.prototype.isZooming=function(){return this._zooming||this.handlers.isZooming()},r.prototype.isRotating=function(){return this._rotating||this.handlers.isRotating()},r.prototype._createDelegatedListener=function(t,e,i){var o,r=this;if("mouseenter"===t||"mouseover"===t){var a=!1;return {layer:e,listener:i,delegates:{mousemove:function(o){var n=r.getLayer(e)?r.queryRenderedFeatures(o.point,{layers:[e]}):[];n.length?a||(a=!0,i.call(r,new Bo(t,r,o.originalEvent,{features:n}))):a=!1;},mouseout:function(){a=!1;}}}}if("mouseleave"===t||"mouseout"===t){var n=!1;return {layer:e,listener:i,delegates:{mousemove:function(o){(r.getLayer(e)?r.queryRenderedFeatures(o.point,{layers:[e]}):[]).length?n=!0:n&&(n=!1,i.call(r,new Bo(t,r,o.originalEvent)));},mouseout:function(e){n&&(n=!1,i.call(r,new Bo(t,r,e.originalEvent)));}}}}return {layer:e,listener:i,delegates:(o={},o[t]=function(t){var o=r.getLayer(e)?r.queryRenderedFeatures(t.point,{layers:[e]}):[];o.length&&(t.features=o,i.call(r,t),delete t.features);},o)}},r.prototype.on=function(t,e,i){if(void 0===i)return o.prototype.on.call(this,t,e);var r=this._createDelegatedListener(t,e,i);for(var a in this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[t]=this._delegatedListeners[t]||[],this._delegatedListeners[t].push(r),r.delegates)this.on(a,r.delegates[a]);return this},r.prototype.once=function(t,e,i){if(void 0===i)return o.prototype.once.call(this,t,e);var r=this._createDelegatedListener(t,e,i);for(var a in r.delegates)this.once(a,r.delegates[a]);return this},r.prototype.off=function(t,e,i){var r=this;return void 0===i?o.prototype.off.call(this,t,e):(this._delegatedListeners&&this._delegatedListeners[t]&&function(o){for(var a=o[t],n=0;n1?1:t},toY:function(t){return "__height"*(.5-t)+"__centerY"}},0,{__width:n,__height:s,__centerX:r,__centerY:a,__originY:o,__originX:i});this.customConvertPoint=t.window.URL.createObjectURL(new Blob([l],{type:"text/javascript"}));},a.version.get=function(){return t.version},Object.defineProperties(r.prototype,a),r}(br);function Ar(t){t.parentNode&&t.parentNode.removeChild(t);}var kr={showCompass:!0,showZoom:!0,visualizePitch:!1},Or=function(e){var o=this;this.options=t.extend({},kr,e),this._container=i.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._container.addEventListener("contextmenu",(function(t){return t.preventDefault()})),this.options.showZoom&&(t.bindAll(["_setButtonTitle","_updateZoomButtons"],this),this._zoomInButton=this._createButton("mapboxgl-ctrl-zoom-in",(function(t){return o._map.zoomIn({},{originalEvent:t})})),i.create("span","mapboxgl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden",!0),this._zoomOutButton=this._createButton("mapboxgl-ctrl-zoom-out",(function(t){return o._map.zoomOut({},{originalEvent:t})})),i.create("span","mapboxgl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden",!0)),this.options.showCompass&&(t.bindAll(["_rotateCompassArrow"],this),this._compass=this._createButton("mapboxgl-ctrl-compass",(function(t){o.options.visualizePitch?o._map.resetNorthPitch({},{originalEvent:t}):o._map.resetNorth({},{originalEvent:t});})),this._compassIcon=i.create("span","mapboxgl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden",!0));};Or.prototype._updateZoomButtons=function(){var t=this._map.getZoom();this._zoomInButton.disabled=t===this._map.getMaxZoom(),this._zoomOutButton.disabled=t===this._map.getMinZoom();},Or.prototype._rotateCompassArrow=function(){var t=this.options.visualizePitch?"rotateX("+this._map.transform.pitch+"deg) rotateZ("+this._map.transform.angle*(180/Math.PI)+"deg)":"rotate("+this._map.transform.angle+"deg)";this._compassIcon.style.transform=t;},Or.prototype.onAdd=function(t){return this._map=t,this.options.showZoom&&(this._setButtonTitle(this._zoomInButton,"ZoomIn"),this._setButtonTitle(this._zoomOutButton,"ZoomOut"),this._map.on("zoom",this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this._setButtonTitle(this._compass,"ResetBearing"),this.options.visualizePitch&&this._map.on("pitch",this._rotateCompassArrow),this._map.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new Br(this._map,this._compass,this.options.visualizePitch)),this._container},Or.prototype.onRemove=function(){i.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),this._handler.off(),delete this._handler),delete this._map;},Or.prototype._createButton=function(t,e){var o=i.create("button",t,this._container);return o.type="button",o.addEventListener("click",e),o},Or.prototype._setButtonTitle=function(t,e){var i=this._map._getUIString("NavigationControl."+e);t.title=i,t.setAttribute("aria-label",i);};var Br=function(e,o,r){void 0===r&&(r=!1),this._clickTolerance=10,this.element=o,this.mouseRotate=new Yo({clickTolerance:e.dragRotate._mouseRotate._clickTolerance}),this.map=e,r&&(this.mousePitch=new Jo({clickTolerance:e.dragRotate._mousePitch._clickTolerance})),t.bindAll(["mousedown","mousemove","mouseup","touchstart","touchmove","touchend","reset"],this),i.addEventListener(o,"mousedown",this.mousedown),i.addEventListener(o,"touchstart",this.touchstart,{passive:!1}),i.addEventListener(o,"touchmove",this.touchmove),i.addEventListener(o,"touchend",this.touchend),i.addEventListener(o,"touchcancel",this.reset);};function Fr(e,i,o){if(e=new t.LngLat(e.lng,e.lat),i){var r=new t.LngLat(e.lng-360,e.lat),a=new t.LngLat(e.lng+360,e.lat),n=o.locationPoint(e).distSqr(i);o.locationPoint(r).distSqr(i)180;){var s=o.locationPoint(e);if(s.x>=0&&s.y>=0&&s.x<=o.width&&s.y<=o.height)break;e.lng>o.center.lng?e.lng-=360:e.lng+=360;}return e}Br.prototype.down=function(t,e){this.mouseRotate.mousedown(t,e),this.mousePitch&&this.mousePitch.mousedown(t,e),i.disableDrag();},Br.prototype.move=function(t,e){var i=this.map,o=this.mouseRotate.mousemoveWindow(t,e);if(o&&o.bearingDelta&&i.setBearing(i.getBearing()+o.bearingDelta),this.mousePitch){var r=this.mousePitch.mousemoveWindow(t,e);r&&r.pitchDelta&&i.setPitch(i.getPitch()+r.pitchDelta);}},Br.prototype.off=function(){var t=this.element;i.removeEventListener(t,"mousedown",this.mousedown),i.removeEventListener(t,"touchstart",this.touchstart,{passive:!1}),i.removeEventListener(t,"touchmove",this.touchmove),i.removeEventListener(t,"touchend",this.touchend),i.removeEventListener(t,"touchcancel",this.reset),this.offTemp();},Br.prototype.offTemp=function(){i.enableDrag(),i.removeEventListener(t.window,"mousemove",this.mousemove),i.removeEventListener(t.window,"mouseup",this.mouseup);},Br.prototype.mousedown=function(e){this.down(t.extend({},e,{ctrlKey:!0,preventDefault:function(){return e.preventDefault()}}),i.mousePos(this.element,e)),i.addEventListener(t.window,"mousemove",this.mousemove),i.addEventListener(t.window,"mouseup",this.mouseup);},Br.prototype.mousemove=function(t){this.move(t,i.mousePos(this.element,t));},Br.prototype.mouseup=function(t){this.mouseRotate.mouseupWindow(t),this.mousePitch&&this.mousePitch.mouseupWindow(t),this.offTemp();},Br.prototype.touchstart=function(t){1!==t.targetTouches.length?this.reset():(this._startPos=this._lastPos=i.touchPos(this.element,t.targetTouches)[0],this.down({type:"mousedown",button:0,ctrlKey:!0,preventDefault:function(){return t.preventDefault()}},this._startPos));},Br.prototype.touchmove=function(t){1!==t.targetTouches.length?this.reset():(this._lastPos=i.touchPos(this.element,t.targetTouches)[0],this.move({preventDefault:function(){return t.preventDefault()}},this._lastPos));},Br.prototype.touchend=function(t){0===t.targetTouches.length&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)-1&&this._map._markersCache.splice(t,1),delete this._map;}return i.remove(this._element),this._popup&&this._popup.remove(),this},o.prototype.getLngLat=function(){return this._lngLat},o.prototype.setLngLat=function(e){return this._lngLat=t.LngLat.convert(e),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this},o.prototype.getElement=function(){return this._element},o.prototype.setPopup=function(t){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),t){if(!("offset"in t.options)){var e=Math.sqrt(Math.pow(13.5,2)/2);t.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[e,-1*(24.6+e)],"bottom-right":[-e,-1*(24.6+e)],left:[13.5,-24.6],right:[-13.5,-24.6]}:this._offset;}this._popup=t,this._lngLat&&this._popup.setLngLat(this._lngLat),this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress);}return this},o.prototype._onKeyPress=function(t){var e=t.code,i=t.charCode||t.keyCode;"Space"!==e&&"Enter"!==e&&32!==i&&13!==i||this.togglePopup();},o.prototype._onMapClick=function(t){var e=t.originalEvent.target,i=this._element;this._popup&&(e===i||i.contains(e))&&this.togglePopup();},o.prototype.getPopup=function(){return this._popup},o.prototype.togglePopup=function(){var t=this._popup;return t?(t.isOpen()?t.remove():t.addTo(this._map),this):this},o.prototype._update=function(t){if(this._map){this._map.transform.renderWorldCopies&&(this._lngLat=Fr(this._lngLat,this._pos,this._map.transform)),this._pos=this._map.project(this._lngLat)._add(this._offset);var e="";"viewport"===this._rotationAlignment||"auto"===this._rotationAlignment?e="rotateZ("+this._rotation+"deg)":"map"===this._rotationAlignment&&(e="rotateZ("+(this._rotation-this._map.getBearing())+"deg)");var o="";"viewport"===this._pitchAlignment||"auto"===this._pitchAlignment?o="rotateX(0deg)":"map"===this._pitchAlignment&&(o="rotateX("+this._map.getPitch()+"deg)"),t&&"moveend"!==t.type||(this._pos=this._pos.round()),i.setTransform(this._element,Ur[this._anchor]+" translate("+this._pos.x+"px, "+this._pos.y+"px) "+o+" "+e);}},o.prototype.getOffset=function(){return this._offset},o.prototype.setOffset=function(e){return this._offset=t.Point.convert(e),this._update(),this},o.prototype._onMove=function(e){this._pos=e.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none","pending"===this._state&&(this._state="active",this.fire(new t.Event("dragstart"))),this.fire(new t.Event("drag"));},o.prototype._onUp=function(){this._element.style.pointerEvents="auto",this._positionDelta=null,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),"active"===this._state&&this.fire(new t.Event("dragend")),this._state="inactive";},o.prototype._addDragHandler=function(t){this._element.contains(t.originalEvent.target)&&(t.preventDefault(),this._positionDelta=t.point.sub(this._pos).add(this._offset),this._state="pending",this._map.on("mousemove",this._onMove),this._map.on("touchmove",this._onMove),this._map.once("mouseup",this._onUp),this._map.once("touchend",this._onUp));},o.prototype.setDraggable=function(t){return this._draggable=!!t,this._map&&(t?(this._map.on("mousedown",this._addDragHandler),this._map.on("touchstart",this._addDragHandler)):(this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler))),this},o.prototype.isDraggable=function(){return this._draggable},o.prototype.setRotation=function(t){return this._rotation=t||0,this._update(),this},o.prototype.getRotation=function(){return this._rotation},o.prototype.setRotationAlignment=function(t){return this._rotationAlignment=t||"auto",this._update(),this},o.prototype.getRotationAlignment=function(){return this._rotationAlignment},o.prototype.setPitchAlignment=function(t){return this._pitchAlignment=t&&"auto"!==t?t:this._rotationAlignment,this._update(),this},o.prototype.getPitchAlignment=function(){return this._pitchAlignment},o}(t.Evented),qr={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0},Gr=0,Vr=!1,Wr=function(e){function o(i){e.call(this),this.options=t.extend({},qr,i),t.bindAll(["_onSuccess","_onError","_onZoom","_finish","_setupUI","_updateCamera","_updateMarker"],this);}return e&&(o.__proto__=e),(o.prototype=Object.create(e&&e.prototype)).constructor=o,o.prototype.onAdd=function(e){var o;return this._map=e,this._container=i.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),o=this._setupUI,void 0!==jr?o(jr):void 0!==t.window.navigator.permissions?t.window.navigator.permissions.query({name:"geolocation"}).then((function(t){o(jr="denied"!==t.state);})):o(jr=!!t.window.navigator.geolocation),this._container},o.prototype.onRemove=function(){void 0!==this._geolocationWatchID&&(t.window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),i.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,Gr=0,Vr=!1;},o.prototype._isOutOfMapMaxBounds=function(t){var e=this._map.getMaxBounds(),i=t.coords;return e&&(i.longitudee.getEast()||i.latitudee.getNorth())},o.prototype._setErrorState=function(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting");}},o.prototype._onSuccess=function(e){if(this._map){if(this._isOutOfMapMaxBounds(e))return this._setErrorState(),this.fire(new t.Event("outofmaxbounds",e)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=e,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background");}this.options.showUserLocation&&"OFF"!==this._watchState&&this._updateMarker(e),this.options.trackUserLocation&&"ACTIVE_LOCK"!==this._watchState||this._updateCamera(e),this.options.showUserLocation&&this._dotElement.classList.remove("mapboxgl-user-location-dot-stale"),this.fire(new t.Event("geolocate",e)),this._finish();}},o.prototype._updateCamera=function(e){var i=new t.LngLat(e.coords.longitude,e.coords.latitude),o=e.coords.accuracy,r=this._map.getBearing(),a=t.extend({bearing:r},this.options.fitBoundsOptions);this._map.fitBounds(i.toBounds(o),a,{geolocateSource:!0});},o.prototype._updateMarker=function(e){if(e){var i=new t.LngLat(e.coords.longitude,e.coords.latitude);this._accuracyCircleMarker.setLngLat(i).addTo(this._map),this._userLocationDotMarker.setLngLat(i).addTo(this._map),this._accuracy=e.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius();}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove();},o.prototype._updateCircleRadius=function(){var t=this._map._container.clientHeight/2,e=this._map.unproject([0,t]),i=this._map.unproject([1,t]),o=e.distanceTo(i),r=Math.ceil(2*this._accuracy/o);this._circleElement.style.width=r+"px",this._circleElement.style.height=r+"px";},o.prototype._onZoom=function(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius();},o.prototype._onError=function(e){if(this._map){if(this.options.trackUserLocation)if(1===e.code){this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;var i=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=i,this._geolocateButton.setAttribute("aria-label",i),void 0!==this._geolocationWatchID&&this._clearWatch();}else {if(3===e.code&&Vr)return;this._setErrorState();}"OFF"!==this._watchState&&this.options.showUserLocation&&this._dotElement.classList.add("mapboxgl-user-location-dot-stale"),this.fire(new t.Event("error",e)),this._finish();}},o.prototype._finish=function(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0;},o.prototype._setupUI=function(e){var o=this;if(this._container.addEventListener("contextmenu",(function(t){return t.preventDefault()})),this._geolocateButton=i.create("button","mapboxgl-ctrl-geolocate",this._container),i.create("span","mapboxgl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden",!0),this._geolocateButton.type="button",!1===e){t.warnOnce("Geolocation support is not available so the GeolocateControl will be disabled.");var r=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=r,this._geolocateButton.setAttribute("aria-label",r);}else {var a=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.title=a,this._geolocateButton.setAttribute("aria-label",a);}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=i.create("div","mapboxgl-user-location-dot"),this._userLocationDotMarker=new Zr(this._dotElement),this._circleElement=i.create("div","mapboxgl-user-location-accuracy-circle"),this._accuracyCircleMarker=new Zr({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onZoom)),this._geolocateButton.addEventListener("click",this.trigger.bind(this)),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",(function(e){e.geolocateSource||"ACTIVE_LOCK"!==o._watchState||e.originalEvent&&"resize"===e.originalEvent.type||(o._watchState="BACKGROUND",o._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background"),o._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),o.fire(new t.Event("trackuserlocationend")));}));},o.prototype.trigger=function(){if(!this._setup)return t.warnOnce("Geolocate control triggered before added to a map"),!1;if(this.options.trackUserLocation){switch(this._watchState){case"OFF":this._watchState="WAITING_ACTIVE",this.fire(new t.Event("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":Gr--,Vr=!1,this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this.fire(new t.Event("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new t.Event("trackuserlocationstart"));}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"BACKGROUND":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background");break;case"BACKGROUND_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error");}if("OFF"===this._watchState&&void 0!==this._geolocationWatchID)this._clearWatch();else if(void 0===this._geolocationWatchID){var e;this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),++Gr>1?(e={maximumAge:6e5,timeout:0},Vr=!0):(e=this.options.positionOptions,Vr=!1),this._geolocationWatchID=t.window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,e);}}else t.window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return !0},o.prototype._clearWatch=function(){t.window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null);},o}(t.Evented),Xr={maxWidth:100,unit:"metric"},Hr=function(e){this.options=t.extend({},Xr,e),t.bindAll(["_onMove","setUnit"],this);};function Kr(t,e,i){var o=i&&i.maxWidth||100,r=t._container.clientHeight/2,a=t.unproject([0,r]),n=t.unproject([o,r]),s=a.distanceTo(n);if(i&&"imperial"===i.unit){var l=3.2808*s;l>5280?Yr(e,o,l/5280,t._getUIString("ScaleControl.Miles")):Yr(e,o,l,t._getUIString("ScaleControl.Feet"));}else i&&"nautical"===i.unit?Yr(e,o,s/1852,t._getUIString("ScaleControl.NauticalMiles")):s>=1e3?Yr(e,o,s/1e3,t._getUIString("ScaleControl.Kilometers")):Yr(e,o,s,t._getUIString("ScaleControl.Meters"));}function Yr(t,e,i,o){var r,a,n,s=(r=i,(a=Math.pow(10,(""+Math.floor(r)).length-1))*(n=(n=r/a)>=10?10:n>=5?5:n>=3?3:n>=2?2:n>=1?1:function(t){var e=Math.pow(10,Math.ceil(-Math.log(t)/Math.LN10));return Math.round(t*e)/e}(n)));t.style.width=e*(s/i)+"px",t.innerHTML=s+" "+o;}Hr.prototype.getDefaultPosition=function(){return "bottom-left"},Hr.prototype._onMove=function(){Kr(this._map,this._container,this.options);},Hr.prototype.onAdd=function(t){return this._map=t,this._container=i.create("div","mapboxgl-ctrl mapboxgl-ctrl-scale",t.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container},Hr.prototype.onRemove=function(){i.remove(this._container),this._map.off("move",this._onMove),this._map=void 0;},Hr.prototype.setUnit=function(t){this.options.unit=t,Kr(this._map,this._container,this.options);};var Jr=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");};Jr.prototype.onAdd=function(e){return this._map=e,this._container||(this._container=this._map.getContainer()),this._controlContainer=i.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkFullscreenSupport()?this._setupUI():(this._controlContainer.style.display="none",t.warnOnce("This device does not support fullscreen mode.")),this._controlContainer},Jr.prototype.onRemove=function(){i.remove(this._controlContainer),this._map=null,t.window.document.removeEventListener(this._fullscreenchange,this._changeIcon);},Jr.prototype._checkFullscreenSupport=function(){return !!(t.window.document.fullscreenEnabled||t.window.document.mozFullScreenEnabled||t.window.document.msFullscreenEnabled||t.window.document.webkitFullscreenEnabled)},Jr.prototype._setupUI=function(){var e=this._fullscreenButton=i.create("button","mapboxgl-ctrl-fullscreen",this._controlContainer);i.create("span","mapboxgl-ctrl-icon",e).setAttribute("aria-hidden",!0),e.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),t.window.document.addEventListener(this._fullscreenchange,this._changeIcon);},Jr.prototype._updateTitle=function(){var t=this._getTitle();this._fullscreenButton.setAttribute("aria-label",t),this._fullscreenButton.title=t;},Jr.prototype._getTitle=function(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")},Jr.prototype._isFullscreen=function(){return this._fullscreen},Jr.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("mapboxgl-ctrl-shrink"),this._fullscreenButton.classList.toggle("mapboxgl-ctrl-fullscreen"),this._updateTitle());},Jr.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 Qr={closeButton:!0,closeOnClick:!0,className:"",maxWidth:"240px",showArrow:!0,contentClass:null},$r=function(e){function o(i){e.call(this),this.options=t.extend(Object.create(Qr),i),t.bindAll(["_update","_onClose","remove","_onMouseMove","_onMouseUp","_onDrag"],this);}return e&&(o.__proto__=e),(o.prototype=Object.create(e&&e.prototype)).constructor=o,o.prototype.addTo=function(e){return this._map&&this.remove(),this._map=e,this.options.closeOnClick&&this._map.on("click",this._onClose),this.options.closeOnMove&&this._map.on("move",this._onClose),this._map.on("remove",this.remove),this._update(),this._trackPointer?(this._map.on("mousemove",this._onMouseMove),this._map.on("mouseup",this._onMouseUp),this._container&&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},o.prototype.isOpen=function(){return !!this._map},o.prototype.remove=function(){return this._content&&i.remove(this._content),this._container&&(i.remove(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("move",this._onClose),this._map.off("click",this._onClose),this._map.off("remove",this.remove),this._map.off("mousemove",this._onMouseMove),this._map.off("mouseup",this._onMouseUp),this._map.off("drag",this._onDrag),delete this._map),this.fire(new t.Event("close")),this},o.prototype.getLngLat=function(){return this._lngLat},o.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._onMouseMove),this._container&&this._container.classList.remove("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.remove("mapboxgl-track-pointer")),this},o.prototype.trackPointer=function(){return this._trackPointer=!0,this._pos=null,this._update(),this._map&&(this._map.off("move",this._update),this._map.on("mousemove",this._onMouseMove),this._map.on("drag",this._onDrag),this._container&&this._container.classList.add("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("mapboxgl-track-pointer")),this},o.prototype.getElement=function(){return this._container},o.prototype.setText=function(e){return this.setDOMContent(t.window.document.createTextNode(e))},o.prototype.setHTML=function(e){var i,o=t.window.document.createDocumentFragment(),r=t.window.document.createElement("body");for(r.innerHTML=e;i=r.firstChild;)o.appendChild(i);return this.setDOMContent(o)},o.prototype.getMaxWidth=function(){return this._container&&this._container.style.maxWidth},o.prototype.setMaxWidth=function(t){return this.options.maxWidth=t,this._update(),this},o.prototype.setDOMContent=function(t){return this._createContent(),this._content.appendChild(t),this._update(),this},o.prototype.addClassName=function(t){this._container&&this._container.classList.add(t);},o.prototype.removeClassName=function(t){this._container&&this._container.classList.remove(t);},o.prototype.toggleClassName=function(t){if(this._container)return this._container.classList.toggle(t)},o.prototype._createContent=function(){this._content&&i.remove(this._content),this._content=i.create("div","mapboxgl-popup-content"+(this.options.contentClass?" "+this.options.contentClass:""),this._container),this.options.closeButton&&(this._closeButton=i.create("button","mapboxgl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.setAttribute("aria-label","Close popup"),this._closeButton.innerHTML="×",this._closeButton.addEventListener("click",this._onClose));},o.prototype._onMouseUp=function(t){this._update(t.point);},o.prototype._onMouseMove=function(t){this._update(t.point);},o.prototype._onDrag=function(t){this._update(t.point);},o.prototype._update=function(e){var o=this;if(this._map&&(this._lngLat||this._trackPointer)&&this._content&&(this._container||(this._container=i.create("div","mapboxgl-popup",this._map.getContainer()),this._tip=i.create("div","mapboxgl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className&&this.options.className.split(" ").forEach((function(t){return o._container.classList.add(t)})),this._trackPointer&&this._container.classList.add("mapboxgl-popup-track-pointer")),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=Fr(this._lngLat,this._pos,this._map.transform)),!this._trackPointer||e)){var r=this._pos=this._trackPointer&&e?e:this._map.project(this._lngLat),a=this.options.anchor,n=function e(i){if(i){if("number"==typeof i){var o=Math.round(Math.sqrt(.5*Math.pow(i,2)));return {center:new t.Point(0,0),top:new t.Point(0,i),"top-left":new t.Point(o,o),"top-right":new t.Point(-o,o),bottom:new t.Point(0,-i),"bottom-left":new t.Point(o,-o),"bottom-right":new t.Point(-o,-o),left:new t.Point(i,0),right:new t.Point(-i,0)}}if(i instanceof t.Point||Array.isArray(i)){var r=t.Point.convert(i);return {center:r,top:r,"top-left":r,"top-right":r,bottom:r,"bottom-left":r,"bottom-right":r,left:r,right:r}}return {center:t.Point.convert(i.center||[0,0]),top:t.Point.convert(i.top||[0,0]),"top-left":t.Point.convert(i["top-left"]||[0,0]),"top-right":t.Point.convert(i["top-right"]||[0,0]),bottom:t.Point.convert(i.bottom||[0,0]),"bottom-left":t.Point.convert(i["bottom-left"]||[0,0]),"bottom-right":t.Point.convert(i["bottom-right"]||[0,0]),left:t.Point.convert(i.left||[0,0]),right:t.Point.convert(i.right||[0,0])}}return e(new t.Point(0,0))}(this.options.offset);if(!a){var s,l=this._container.offsetWidth,c=this._container.offsetHeight;s=r.y+n.bottom.ythis._map.transform.height-c?["bottom"]:[],r.xthis._map.transform.width-l/2&&s.push("right"),a=0===s.length?"bottom":s.join("-");}var h=r.add(n[a]).round();i.setTransform(this._container,Ur[a]+" translate("+h.x+"px,"+h.y+"px)"),Nr(this._container,a,"popup");}},o.prototype._onClose=function(){this.remove();},o}(t.Evented),ta={proj4:t.proj4,version:t.version,supported:e,setRTLTextPlugin:t.setRTLTextPlugin,getRTLTextPluginStatus:t.getRTLTextPluginStatus,Map:Rr,NavigationControl:Or,GeolocateControl:Wr,AttributionControl:wr,ScaleControl:Hr,FullscreenControl:Jr,Popup:$r,Marker:Zr,Style:We,CRS:Pr,LngLat:t.LngLat,LngLatBounds:t.LngLatBounds,Point:t.Point,MercatorCoordinate:t.MercatorCoordinate,Evented:t.Evented,config:t.config,prewarm:function(){jt().acquire(Bt);},clearPrewarmedResources:function(){var t=Ut;t&&(t.isPreloaded()&&1===t.numActive()?(t.release(Bt),Ut=null):console.warn("Could not clear WebWorkers since there are active Map instances that still reference it. The pre-warmed WebWorker pool can only be cleared when all map instances have been removed with map.remove()"));},get accessToken(){return t.config.ACCESS_TOKEN},set accessToken(e){t.config.ACCESS_TOKEN=e;},get baseApiUrl(){return t.config.API_URL},set baseApiUrl(e){t.config.API_URL=e;},get workerCount(){return Ft.workerCount},set workerCount(t){Ft.workerCount=t;},get maxParallelImageRequests(){return t.config.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(e){t.config.MAX_PARALLEL_IMAGE_REQUESTS=e;},clearStorage:function(e){t.clearTileCache(e);},workerUrl:""};return ta})); - -// - -if (window) { - window.mapboxgl =mapboxgl; -} - -return mapboxgl; - -}))); -//# sourceMappingURL=mapbox-gl-enhance.js.map + } + + + define(["exports"],(function(t){"use strict";function e(t,e){return t(e={exports:{}},e.exports),e.exports}var r=i;function i(t,e,r,i){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*(i-e)-this.cy,this.ay=1-this.cy-this.by,this.p1x=t,this.p1y=i,this.p2x=r,this.p2y=i;}i.prototype.sampleCurveX=function(t){return ((this.ax*t+this.bx)*t+this.cx)*t},i.prototype.sampleCurveY=function(t){return ((this.ay*t+this.by)*t+this.cy)*t},i.prototype.sampleCurveDerivativeX=function(t){return (3*this.ax*t+2*this.bx)*t+this.cx},i.prototype.solveCurveX=function(t,e){var r,i,n,a,s;for(void 0===e&&(e=1e-6),n=t,s=0;s<8;s++){if(a=this.sampleCurveX(n)-t,Math.abs(a)(i=1))return i;for(;ra?r=n:i=n,n=.5*(i-r)+r;}return n},i.prototype.solve=function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))};var n=a;function a(t,e){this.x=t,this.y=e;}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[2]*this.x+t[3]*this.y;return this.x=t[0]*this.x+t[1]*this.y,this.y=e,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),i=r*this.x+e*this.y;return this.x=e*this.x-r*this.y,this.y=i,this},_rotateAround:function(t,e){var r=Math.cos(t),i=Math.sin(t),n=e.y+i*(this.x-e.x)+r*(this.y-e.y);return this.x=e.x+r*(this.x-e.x)-i*(this.y-e.y),this.y=n,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 s="undefined"!=typeof self?self:{},o=Math.pow(2,53)-1;function u(t,e,i,n){var a=new r(t,e,i,n);return function(t){return a.solve(t)}}var h=u(.25,.1,.25,1);function l(t,e,r){return Math.min(r,Math.max(e,t))}function p(t,e,r){var i=r-e,n=((t-e)%i+i)%i+e;return n===e?r:n}function c(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];for(var i=0,n=e;i>e/4).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,t)}()}function m(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 v(t,e){t.forEach((function(t){e[t]&&(e[t]=e[t].bind(e));}));}function g(t,e){return -1!==t.indexOf(e,t.length-e.length)}function x(t,e,r){var i={};for(var n in t)i[n]=e.call(r||this,t[n],n,t);return i}function b(t,e,r){var i={};for(var n in t)e.call(r||this,t[n],n,t)&&(i[n]=t[n]);return i}function _(t){return Array.isArray(t)?t.map(_):"object"==typeof t&&t?x(t,_):t}var w={};function M(t){w[t]||("undefined"!=typeof console&&console.warn(t),w[t]=!0);}function S(t,e,r){return (r.y-t.y)*(e.x-t.x)>(e.y-t.y)*(r.x-t.x)}function A(t){for(var e=0,r=0,i=t.length,n=i-1,a=void 0,s=void 0;r@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(function(t,r,i,n){var a=i||n;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}var z=null;function C(t){if(null==z){var e=t.navigator?t.navigator.userAgent:null;z=!!t.safari||!(!e||!(/\b(iPad|iPhone|iPod)\b/.test(e)||e.match("Safari")&&!e.match("Chrome")));}return z}function E(t){try{var e=s[t];return e.setItem("_mapbox_test_",1),e.removeItem("_mapbox_test_"),!0}catch(t){return !1}}var P,B,T,V,L=s.performance&&s.performance.now?s.performance.now.bind(s.performance):Date.now.bind(Date),F=s.requestAnimationFrame||s.mozRequestAnimationFrame||s.webkitRequestAnimationFrame||s.msRequestAnimationFrame,O=s.cancelAnimationFrame||s.mozCancelAnimationFrame||s.webkitCancelAnimationFrame||s.msCancelAnimationFrame,D={now:L,frame:function(t){var e=F(t);return {cancel:function(){return O(e)}}},getImageData:function(t,e){void 0===e&&(e=0);var r=s.document.createElement("canvas"),i=r.getContext("2d");if(!i)throw new Error("failed to create canvas 2d context");return r.width=t.width,r.height=t.height,i.drawImage(t,0,0,t.width,t.height),i.getImageData(-e,-e,t.width+2*e,t.height+2*e)},resolveURL:function(t){return P||(P=s.document.createElement("a")),P.href=t,P.href},hardwareConcurrency:s.navigator&&s.navigator.hardwareConcurrency||4,get devicePixelRatio(){return s.devicePixelRatio},get prefersReducedMotion(){return !!s.matchMedia&&(null==B&&(B=s.matchMedia("(prefers-reduced-motion: reduce)")),B.matches)}},N={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},R={supported:!1,testSupport:function(t){!q&&V&&(j?U(t):T=t);}},q=!1,j=!1;function U(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,V),t.isContextLost())return;R.supported=!0;}catch(t){}t.deleteTexture(e),q=!0;}s.document&&((V=s.document.createElement("img")).onload=function(){T&&U(T),T=null,j=!0;},V.onerror=function(){q=!0,T=null;},V.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");var G="01",K=484813681109536e-20,X=Math.PI/2,H=.017453292519943295,J=57.29577951308232,Z=Math.PI/4,Y=2*Math.PI,W=3.14159265359,Q={greenwich:0,lisbon:-9.131906111111,paris:2.337229166667,bogota:-74.080916666667,madrid:-3.687938888889,rome:12.452333333333,bern:7.439583333333,jakarta:106.807719444444,ferro:-17.666666666667,brussels:4.367975,stockholm:18.058277777778,athens:23.7163375,oslo:10.722916666667},$={ft:{to_meter:.3048},"us-ft":{to_meter:1200/3937}},tt=/[\s_\-\/\(\)]/g;function et(t,e){if(t[e])return t[e];for(var r,i=Object.keys(t),n=e.toLowerCase().replace(tt,""),a=-1;++a0?90:-90),t.lat_ts=t.lat1);}(n),n}function ft(t){var e=this;if(2===arguments.length){var r=arguments[1];ft[t]="string"==typeof r?"+"===r.charAt(0)?rt(arguments[1]):ct(arguments[1]):r;}else if(1===arguments.length){if(Array.isArray(t))return t.map((function(t){Array.isArray(t)?ft.apply(e,t):ft(t);}));if("string"==typeof t){if(t in ft)return ft[t]}else "EPSG"in t?ft["EPSG:"+t.EPSG]=t:"ESRI"in t?ft["ESRI:"+t.ESRI]=t:"IAU2000"in t?ft["IAU2000:"+t.IAU2000]=t:console.log(t);return}}ut.prototype.readCharicter=function(){var t=this.text[this.place++];if(4!==this.state)for(;it.test(t);){if(this.place>=this.text.length)return;t=this.text[this.place++];}switch(this.state){case 1:return this.neutral(t);case 2:return this.keyword(t);case 4:return this.quoted(t);case 5:return this.afterquote(t);case 3:return this.number(t);case-1:return}},ut.prototype.afterquote=function(t){if('"'===t)return this.word+='"',void(this.state=4);if(st.test(t))return this.word=this.word.trim(),void this.afterItem(t);throw new Error("havn't handled \""+t+'" in afterquote yet, index '+this.place)},ut.prototype.afterItem=function(t){return ","===t?(null!==this.word&&this.currentObject.push(this.word),this.word=null,void(this.state=1)):"]"===t?(this.level--,null!==this.word&&(this.currentObject.push(this.word),this.word=null),this.state=1,this.currentObject=this.stack.pop(),void(this.currentObject||(this.state=-1))):void 0},ut.prototype.number=function(t){if(!ot.test(t)){if(st.test(t))return this.word=parseFloat(this.word),void this.afterItem(t);throw new Error("havn't handled \""+t+'" in number yet, index '+this.place)}this.word+=t;},ut.prototype.quoted=function(t){'"'!==t?this.word+=t:this.state=5;},ut.prototype.keyword=function(t){if(at.test(t))this.word+=t;else {if("["===t){var e=[];return e.push(this.word),this.level++,null===this.root?this.root=e:this.currentObject.push(e),this.stack.push(this.currentObject),this.currentObject=e,void(this.state=1)}if(!st.test(t))throw new Error("havn't handled \""+t+'" in keyword yet, index '+this.place);this.afterItem(t);}},ut.prototype.neutral=function(t){if(nt.test(t))return this.word=t,void(this.state=2);if('"'===t)return this.word="",void(this.state=4);if(ot.test(t))return this.word=t,void(this.state=3);if(!st.test(t))throw new Error("havn't handled \""+t+'" in neutral yet, index '+this.place);this.afterItem(t);},ut.prototype.output=function(){for(;this.place-1}))}(t)){var e=ct(t);if(function(t){var e=et(t,"authority");if(e){var r=et(e,"epsg");return r&&dt.indexOf(r)>-1}}(e))return ft["EPSG:3857"];var r=function(t){var e=et(t,"extension");if(e)return et(e,"proj4")}(e);return r?rt(r):e}return function(t){return "+"===t[0]}(t)?rt(t):void 0}function vt(t,e){var r,i;if(t=t||{},!e)return t;for(i in e)void 0!==(r=e[i])&&(t[i]=r);return t}function gt(t,e,r){var i=t*e;return r/Math.sqrt(1-i*i)}function xt(t){return t<0?-1:1}function bt(t){return Math.abs(t)<=W?t:t-xt(t)*Y}function _t(t,e,r){var i=t*r;return i=Math.pow((1-i)/(1+i),.5*t),Math.tan(.5*(X-e))/i}function wt(t,e){for(var r,i,n=.5*t,a=X-2*Math.atan(e),s=0;s<=15;s++)if(r=t*Math.sin(a),a+=i=X-2*Math.atan(e*Math.pow((1-r)/(1+r),n))-a,Math.abs(i)<=1e-10)return a;return -9999}function Mt(t){return t}var St=[{init:function(){var t=this.b/this.a;this.es=1-t*t,"x0"in this||(this.x0=0),"y0"in this||(this.y0=0),this.e=Math.sqrt(this.es),this.lat_ts?this.k0=this.sphere?Math.cos(this.lat_ts):gt(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)):this.k0||(this.k0=this.k?this.k:1);},forward:function(t){var e,r,i=t.x,n=t.y;if(n*J>90&&n*J<-90&&i*J>180&&i*J<-180)return null;if(Math.abs(Math.abs(n)-X)<=1e-10)return null;if(this.sphere)e=this.x0+this.a*this.k0*bt(i-this.long0),r=this.y0+this.a*this.k0*Math.log(Math.tan(Z+.5*n));else {var a=Math.sin(n),s=_t(this.e,n,a);e=this.x0+this.a*this.k0*bt(i-this.long0),r=this.y0-this.a*this.k0*Math.log(s);}return t.x=e,t.y=r,t},inverse:function(t){var e,r,i=t.x-this.x0,n=t.y-this.y0;if(this.sphere)r=X-2*Math.atan(Math.exp(-n/(this.a*this.k0)));else {var a=Math.exp(-n/(this.a*this.k0));if(-9999===(r=wt(this.e,a)))return null}return e=bt(this.long0+i/(this.a*this.k0)),t.x=e,t.y=r,t},names:["Mercator","Popular Visualisation Pseudo Mercator","Mercator_1SP","Mercator_Auxiliary_Sphere","merc"]},{init:function(){},forward:Mt,inverse:Mt,names:["longlat","identity"]}],At={},kt=[];function It(t,e){var r=kt.length;return t.names?(kt[r]=t,t.names.forEach((function(t){At[t.toLowerCase()]=r;})),this):(console.log(e),!0)}var zt={start:function(){St.forEach(It);},add:It,get:function(t){if(!t)return !1;var e=t.toLowerCase();return void 0!==At[e]&&kt[At[e]]?kt[At[e]]:void 0}},Ct={MERIT:{a:6378137,rf:298.257,ellipseName:"MERIT 1983"},SGS85:{a:6378136,rf:298.257,ellipseName:"Soviet Geodetic System 85"},GRS80:{a:6378137,rf:298.257222101,ellipseName:"GRS 1980(IUGG, 1980)"},IAU76:{a:6378140,rf:298.257,ellipseName:"IAU 1976"},airy:{a:6377563.396,b:6356256.91,ellipseName:"Airy 1830"},APL4:{a:6378137,rf:298.25,ellipseName:"Appl. Physics. 1965"},NWL9D:{a:6378145,rf:298.25,ellipseName:"Naval Weapons Lab., 1965"},mod_airy:{a:6377340.189,b:6356034.446,ellipseName:"Modified Airy"},andrae:{a:6377104.43,rf:300,ellipseName:"Andrae 1876 (Den., Iclnd.)"},aust_SA:{a:6378160,rf:298.25,ellipseName:"Australian Natl & S. Amer. 1969"},GRS67:{a:6378160,rf:298.247167427,ellipseName:"GRS 67(IUGG 1967)"},bessel:{a:6377397.155,rf:299.1528128,ellipseName:"Bessel 1841"},bess_nam:{a:6377483.865,rf:299.1528128,ellipseName:"Bessel 1841 (Namibia)"},clrk66:{a:6378206.4,b:6356583.8,ellipseName:"Clarke 1866"},clrk80:{a:6378249.145,rf:293.4663,ellipseName:"Clarke 1880 mod."},clrk80ign:{a:6378249.2,b:6356515,rf:293.4660213,ellipseName:"Clarke 1880 (IGN)"},clrk58:{a:6378293.645208759,rf:294.2606763692654,ellipseName:"Clarke 1858"},CPM:{a:6375738.7,rf:334.29,ellipseName:"Comm. des Poids et Mesures 1799"},delmbr:{a:6376428,rf:311.5,ellipseName:"Delambre 1810 (Belgium)"},engelis:{a:6378136.05,rf:298.2566,ellipseName:"Engelis 1985"},evrst30:{a:6377276.345,rf:300.8017,ellipseName:"Everest 1830"},evrst48:{a:6377304.063,rf:300.8017,ellipseName:"Everest 1948"},evrst56:{a:6377301.243,rf:300.8017,ellipseName:"Everest 1956"},evrst69:{a:6377295.664,rf:300.8017,ellipseName:"Everest 1969"},evrstSS:{a:6377298.556,rf:300.8017,ellipseName:"Everest (Sabah & Sarawak)"},fschr60:{a:6378166,rf:298.3,ellipseName:"Fischer (Mercury Datum) 1960"},fschr60m:{a:6378155,rf:298.3,ellipseName:"Fischer 1960"},fschr68:{a:6378150,rf:298.3,ellipseName:"Fischer 1968"},helmert:{a:6378200,rf:298.3,ellipseName:"Helmert 1906"},hough:{a:6378270,rf:297,ellipseName:"Hough"},intl:{a:6378388,rf:297,ellipseName:"International 1909 (Hayford)"},kaula:{a:6378163,rf:298.24,ellipseName:"Kaula 1961"},lerch:{a:6378139,rf:298.257,ellipseName:"Lerch 1979"},mprts:{a:6397300,rf:191,ellipseName:"Maupertius 1738"},new_intl:{a:6378157.5,b:6356772.2,ellipseName:"New International 1967"},plessis:{a:6376523,rf:6355863,ellipseName:"Plessis 1817 (France)"},krass:{a:6378245,rf:298.3,ellipseName:"Krassovsky, 1942"},SEasia:{a:6378155,b:6356773.3205,ellipseName:"Southeast Asia"},walbeck:{a:6376896,b:6355834.8467,ellipseName:"Walbeck"},WGS60:{a:6378165,rf:298.3,ellipseName:"WGS 60"},WGS66:{a:6378145,rf:298.25,ellipseName:"WGS 66"},WGS7:{a:6378135,rf:298.26,ellipseName:"WGS 72"}},Et=Ct.WGS84={a:6378137,rf:298.257223563,ellipseName:"WGS 84"};Ct.sphere={a:6370997,b:6370997,ellipseName:"Normal Sphere (r=6370997)"};var Pt={wgs84:{towgs84:"0,0,0",ellipse:"WGS84",datumName:"WGS84"},ch1903:{towgs84:"674.374,15.056,405.346",ellipse:"bessel",datumName:"swiss"},ggrs87:{towgs84:"-199.87,74.79,246.62",ellipse:"GRS80",datumName:"Greek_Geodetic_Reference_System_1987"},nad83:{towgs84:"0,0,0",ellipse:"GRS80",datumName:"North_American_Datum_1983"},nad27:{nadgrids:"@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat",ellipse:"clrk66",datumName:"North_American_Datum_1927"},potsdam:{towgs84:"598.1,73.7,418.2,0.202,0.045,-2.455,6.7",ellipse:"bessel",datumName:"Potsdam Rauenberg 1950 DHDN"},carthage:{towgs84:"-263.0,6.0,431.0",ellipse:"clark80",datumName:"Carthage 1934 Tunisia"},hermannskogel:{towgs84:"577.326,90.129,463.919,5.137,1.474,5.297,2.4232",ellipse:"bessel",datumName:"Hermannskogel"},osni52:{towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"airy",datumName:"Irish National"},ire65:{towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"mod_airy",datumName:"Ireland 1965"},rassadiran:{towgs84:"-133.63,-157.5,-158.62",ellipse:"intl",datumName:"Rassadiran"},nzgd49:{towgs84:"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993",ellipse:"intl",datumName:"New Zealand Geodetic Datum 1949"},osgb36:{towgs84:"446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894",ellipse:"airy",datumName:"Airy 1830"},s_jtsk:{towgs84:"589,76,480",ellipse:"bessel",datumName:"S-JTSK (Ferro)"},beduaram:{towgs84:"-106,-87,188",ellipse:"clrk80",datumName:"Beduaram"},gunung_segara:{towgs84:"-403,684,41",ellipse:"bessel",datumName:"Gunung Segara Jakarta"},rnb72:{towgs84:"106.869,-52.2978,103.724,-0.33657,0.456955,-1.84218,1",ellipse:"intl",datumName:"Reseau National Belge 1972"}},Bt={};function Tt(t){if(0===t.length)return null;var e="@"===t[0];return e&&(t=t.slice(1)),"null"===t?{name:"null",mandatory:!e,grid:null,isNull:!0}:{name:t,mandatory:!e,grid:Bt[t]||null,isNull:!1}}function Vt(t){return t/3600*Math.PI/180}function Lt(t,e,r){return String.fromCharCode.apply(null,new Uint8Array(t.buffer.slice(e,r)))}function Ft(t){return t.map((function(t){return [Vt(t.longitudeShift),Vt(t.latitudeShift)]}))}function Ot(t,e,r){return {name:Lt(t,e+8,e+16).trim(),parent:Lt(t,e+24,e+24+8).trim(),lowerLatitude:t.getFloat64(e+72,r),upperLatitude:t.getFloat64(e+88,r),lowerLongitude:t.getFloat64(e+104,r),upperLongitude:t.getFloat64(e+120,r),latitudeInterval:t.getFloat64(e+136,r),longitudeInterval:t.getFloat64(e+152,r),gridNodeCount:t.getInt32(e+168,r)}}function Dt(t,e,r,i){for(var n=e+176,a=[],s=0;s3&&(0===o.datum_params[3]&&0===o.datum_params[4]&&0===o.datum_params[5]&&0===o.datum_params[6]||(o.datum_type=2,o.datum_params[3]*=K,o.datum_params[4]*=K,o.datum_params[5]*=K,o.datum_params[6]=o.datum_params[6]/1e6+1))),s&&(o.datum_type=3,o.grids=s),o.a=r,o.b=i,o.es=n,o.ep2=a,o}(r.datumCode,r.datum_params,p.a,p.b,c.es,c.ep2,f);vt(this,r),vt(this,i),this.a=p.a,this.b=p.b,this.rf=p.rf,this.sphere=p.sphere,this.es=c.es,this.e=c.e,this.ep2=c.ep2,this.datum=y,this.init(),e(null,this);}else e(t);}else e(t);}function Rt(t,e,r){var i,n,a,s=t.x,o=t.y,u=t.z?t.z:0;if(o<-X&&o>-1.001*X)o=-X;else if(o>X&&o<1.001*X)o=X;else {if(o<-X)return {x:-1/0,y:-1/0,z:t.z};if(o>X)return {x:1/0,y:1/0,z:t.z}}return s>Math.PI&&(s-=2*Math.PI),n=Math.sin(o),a=Math.cos(o),{x:((i=r/Math.sqrt(1-e*(n*n)))+u)*a*Math.cos(s),y:(i+u)*a*Math.sin(s),z:(i*(1-e)+u)*n}}function qt(t,e,r,i){var n,a,s,o,u,h,l,p,c,f,y,d,m,v,g,x=t.x,b=t.y,_=t.z?t.z:0;if(n=Math.sqrt(x*x+b*b),a=Math.sqrt(x*x+b*b+_*_),n/r<1e-12){if(v=0,a/r<1e-12)return g=-i,{x:t.x,y:t.y,z:t.z}}else v=Math.atan2(b,x);s=_/a,p=(o=n/a)*(1-e)*(u=1/Math.sqrt(1-e*(2-e)*o*o)),c=s*u,m=0;do{m++,h=e*(l=r/Math.sqrt(1-e*c*c))/(l+(g=n*p+_*c-l*(1-e*c*c))),d=(y=s*(u=1/Math.sqrt(1-h*(2-h)*o*o)))*p-(f=o*(1-h)*u)*c,p=f,c=y;}while(d*d>1e-24&&m<30);return {x:v,y:Math.atan(y/Math.abs(f)),z:g}}function jt(t){return 1===t||2===t}function Ut(t,e,r){if(null===t.grids||0===t.grids.length)return console.log("Grid shift grids not found"),-1;for(var i={x:-r.x,y:r.y},n={x:Number.NaN,y:Number.NaN},a=[],s=0;si.y||u.ll[0]-h>i.x||u.ll[1]+(u.lim[1]-1)*u.del[1]+h1e-12&&Math.abs(s.y)>1e-12);if(u<0)return console.log("Inverse grid shift iterator failed to converge."),i;i.x=bt(a.x+r.ll[0]),i.y=a.y+r.ll[1];}else isNaN(a.x)||(i.x=t.x+a.x,i.y=t.y+a.y);return i}function Kt(t,e){var r,i={x:t.x/e.del[0],y:t.y/e.del[1]},n=Math.floor(i.x),a=Math.floor(i.y),s=i.x-1*n,o=i.y-1*a,u={x:Number.NaN,y:Number.NaN};if(n<0||n>=e.lim[0])return u;if(a<0||a>=e.lim[1])return u;var h=e.cvs[r=a*e.lim[0]+n][0],l=e.cvs[r][1];r++;var p=e.cvs[r][0],c=e.cvs[r][1],f=e.cvs[r+=e.lim[0]][0],y=e.cvs[r][1];r--;var d=e.cvs[r][1],m=s*o,v=s*(1-o),g=(1-s)*(1-o),x=(1-s)*o;return u.x=g*h+v*p+x*e.cvs[r][0]+m*f,u.y=g*l+v*c+x*d+m*y,u}function Xt(t,e,r){var i,n,a,s=r.x,o=r.y,u=r.z||0,h={};for(a=0;a<3;a++)if(!e||2!==a||void 0!==r.z)switch(0===a?(i=s,n=-1!=="ew".indexOf(t.axis[a])?"x":"y"):1===a?(i=o,n=-1!=="ns".indexOf(t.axis[a])?"y":"x"):(i=u,n="z"),t.axis[a]){case"e":h[n]=i;break;case"w":h[n]=-i;break;case"n":h[n]=i;break;case"s":h[n]=-i;break;case"u":void 0!==r[n]&&(h.z=i);break;case"d":void 0!==r[n]&&(h.z=-i);break;default:return null}return h}function Ht(t){var e={x:t[0],y:t[1]};return t.length>2&&(e.z=t[2]),t.length>3&&(e.m=t[3]),e}function Jt(t){if("function"==typeof Number.isFinite){if(Number.isFinite(t))return;throw new TypeError("coordinates must be finite numbers")}if("number"!=typeof t||t!=t||!isFinite(t))throw new TypeError("coordinates must be finite numbers")}function Zt(t,e,r,i){var n,a=void 0!==(r=Array.isArray(r)?Ht(r):{x:r.x,y:r.y,z:r.z,m:r.m}).z;if(function(t){Jt(t.x),Jt(t.y);}(r),t.datum&&e.datum&&function(t,e){return (1===t.datum.datum_type||2===t.datum.datum_type||3===t.datum.datum_type)&&"WGS84"!==e.datumCode||(1===e.datum.datum_type||2===e.datum.datum_type||3===e.datum.datum_type)&&"WGS84"!==t.datumCode}(t,e)&&(r=Zt(t,n=new Nt("WGS84"),r,i),t=n),i&&"enu"!==t.axis&&(r=Xt(t,!1,r)),"longlat"===t.projName)r={x:r.x*H,y:r.y*H,z:r.z||0};else if(t.to_meter&&(r={x:r.x*t.to_meter,y:r.y*t.to_meter,z:r.z||0}),!(r=t.inverse(r)))return;if(t.from_greenwich&&(r.x+=t.from_greenwich),r=function(t,e,r){if(function(t,e){return t.datum_type===e.datum_type&&!(t.a!==e.a||Math.abs(t.es-e.es)>5e-11)&&(1===t.datum_type?t.datum_params[0]===e.datum_params[0]&&t.datum_params[1]===e.datum_params[1]&&t.datum_params[2]===e.datum_params[2]:2!==t.datum_type||t.datum_params[0]===e.datum_params[0]&&t.datum_params[1]===e.datum_params[1]&&t.datum_params[2]===e.datum_params[2]&&t.datum_params[3]===e.datum_params[3]&&t.datum_params[4]===e.datum_params[4]&&t.datum_params[5]===e.datum_params[5]&&t.datum_params[6]===e.datum_params[6])}(t,e))return r;if(5===t.datum_type||5===e.datum_type)return r;var i=t.a,n=t.es;if(3===t.datum_type){if(0!==Ut(t,!1,r))return;i=6378137,n=.0066943799901413165;}var a=e.a,s=e.b,o=e.es;return 3===e.datum_type&&(a=6378137,s=6356752.314,o=.0066943799901413165),n!==o||i!==a||jt(t.datum_type)||jt(e.datum_type)?(r=Rt(r,n,i),jt(t.datum_type)&&(r=function(t,e,r){if(1===e)return {x:t.x+r[0],y:t.y+r[1],z:t.z+r[2]};if(2===e){var i=r[3],n=r[4],a=r[5],s=r[6];return {x:s*(t.x-a*t.y+n*t.z)+r[0],y:s*(a*t.x+t.y-i*t.z)+r[1],z:s*(-n*t.x+i*t.y+t.z)+r[2]}}}(r,t.datum_type,t.datum_params)),jt(e.datum_type)&&(r=function(t,e,r){if(1===e)return {x:t.x-r[0],y:t.y-r[1],z:t.z-r[2]};if(2===e){var i=r[3],n=r[4],a=r[5],s=r[6],o=(t.x-r[0])/s,u=(t.y-r[1])/s,h=(t.z-r[2])/s;return {x:o+a*u-n*h,y:-a*o+u+i*h,z:n*o-i*u+h}}}(r,e.datum_type,e.datum_params)),r=qt(r,o,a,s),3!==e.datum_type||0===Ut(e,!0,r)?r:void 0):r}(t.datum,e.datum,r))return e.from_greenwich&&(r={x:r.x-e.from_greenwich,y:r.y,z:r.z||0}),"longlat"===e.projName?r={x:r.x*J,y:r.y*J,z:r.z||0}:(r=e.forward(r),e.to_meter&&(r={x:r.x/e.to_meter,y:r.y/e.to_meter,z:r.z||0})),i&&"enu"!==e.axis?Xt(e,!0,r):(a||delete r.z,r)}(Nt.projections=zt).start();var Yt=Nt("WGS84");function Wt(t,e,r,i){var n,a,s;return Array.isArray(r)?(n=Zt(t,e,r,i)||{x:NaN,y:NaN},r.length>2?void 0!==t.name&&"geocent"===t.name||void 0!==e.name&&"geocent"===e.name?"number"==typeof n.z?[n.x,n.y,n.z].concat(r.splice(3)):[n.x,n.y,r[2]].concat(r.splice(3)):[n.x,n.y].concat(r.splice(2)):[n.x,n.y]):(a=Zt(t,e,r,i),2===(s=Object.keys(r)).length||s.forEach((function(i){if(void 0!==t.name&&"geocent"===t.name||void 0!==e.name&&"geocent"===e.name){if("x"===i||"y"===i||"z"===i)return}else if("x"===i||"y"===i)return;a[i]=r[i];})),a)}function Qt(t){return t instanceof Nt?t:t.oProj?t.oProj:Nt(t)}function $t(t,e,r){t=Qt(t);var i,n=!1;return void 0===e?(e=t,t=Yt,n=!0):(void 0!==e.x||Array.isArray(e))&&(r=e,e=t,t=Yt,n=!0),e=Qt(e),r?Wt(t,e,r):(i={forward:function(r,i){return Wt(t,e,r,i)},inverse:function(r,i){return Wt(e,t,r,i)}},n&&(i.oProj=e),i)}var te=65,ee=73,re=79,ie={forward:ne,inverse:function(t){var e=ue(le(t.toUpperCase()));return e.lat&&e.lon?[e.lon,e.lat,e.lon,e.lat]:[e.left,e.bottom,e.right,e.top]},toPoint:ae};function ne(t,e){return e=e||5,function(t,e){var r,i,n,a,s,o,u,h,l,p,c,f="00000"+t.easting,y="00000"+t.northing;return t.zoneNumber+t.zoneLetter+(l=t.easting,p=t.northing,c=he(t.zoneNumber),r=Math.floor(l/1e5),i=Math.floor(p/1e5)%20,a="AJSAJS".charCodeAt(n=c-1),s="AFAFAF".charCodeAt(n),h=!1,(o=a+r-1)>90&&(o=o-90+te-1,h=!0),(o===ee||aee||(o>ee||are||(o>re||a90&&(o=o-90+te-1),(u=s+i)>86?(u=u-86+te-1,h=!0):h=!1,(u===ee||see||(u>ee||sre||(u>re||s86&&(u=u-86+te-1),String.fromCharCode(o)+String.fromCharCode(u))+f.substr(f.length-5,e)+y.substr(y.length-5,e)}(function(t){var e,r,i,n,a,s,o=t.lat,u=t.lon,h=6378137,l=se(o),p=se(u);s=Math.floor((u+180)/6)+1,180===u&&(s=60),o>=56&&o<64&&u>=3&&u<12&&(s=32),o>=72&&o<84&&(u>=0&&u<9?s=31:u>=9&&u<21?s=33:u>=21&&u<33?s=35:u>=33&&u<42&&(s=37)),a=se(6*(s-1)-180+3),e=h/Math.sqrt(1-.00669438*Math.sin(l)*Math.sin(l)),r=Math.tan(l)*Math.tan(l),i=.006739496752268451*Math.cos(l)*Math.cos(l);var c,f,y=.9996*e*((n=Math.cos(l)*(p-a))+(1-r+i)*n*n*n/6+(5-18*r+r*r+72*i-.39089081163157013)*n*n*n*n*n/120)+5e5,d=.9996*(h*(.9983242984503243*l-.002514607064228144*Math.sin(2*l)+2639046602129982e-21*Math.sin(4*l)-3.418046101696858e-9*Math.sin(6*l))+e*Math.tan(l)*(n*n/2+(5-r+9*i+4*i*i)*n*n*n*n/24+(61-58*r+r*r+600*i-2.2240339282485886)*n*n*n*n*n*n/720));return o<0&&(d+=1e7),{northing:Math.round(d),easting:Math.round(y),zoneNumber:s,zoneLetter:(c=o,f="Z",84>=c&&c>=72?f="X":72>c&&c>=64?f="W":64>c&&c>=56?f="V":56>c&&c>=48?f="U":48>c&&c>=40?f="T":40>c&&c>=32?f="S":32>c&&c>=24?f="R":24>c&&c>=16?f="Q":16>c&&c>=8?f="P":8>c&&c>=0?f="N":0>c&&c>=-8?f="M":-8>c&&c>=-16?f="L":-16>c&&c>=-24?f="K":-24>c&&c>=-32?f="J":-32>c&&c>=-40?f="H":-40>c&&c>=-48?f="G":-48>c&&c>=-56?f="F":-56>c&&c>=-64?f="E":-64>c&&c>=-72?f="D":-72>c&&c>=-80&&(f="C"),f)}}({lat:t[1],lon:t[0]}),e)}function ae(t){var e=ue(le(t.toUpperCase()));return e.lat&&e.lon?[e.lon,e.lat]:[(e.left+e.right)/2,(e.top+e.bottom)/2]}function se(t){return t*(Math.PI/180)}function oe(t){return t/Math.PI*180}function ue(t){var e=t.northing,r=t.easting,i=t.zoneLetter,n=t.zoneNumber;if(n<0||n>60)return null;var a,s,o,u,h,l,p,c,f=6378137,y=(1-Math.sqrt(.99330562))/(1+Math.sqrt(.99330562)),d=r-5e5,m=e;i<"N"&&(m-=1e7),l=6*(n-1)-180+3,c=(p=m/.9996/6367449.145945056)+(3*y/2-27*y*y*y/32)*Math.sin(2*p)+(21*y*y/16-55*y*y*y*y/32)*Math.sin(4*p)+151*y*y*y/96*Math.sin(6*p),a=f/Math.sqrt(1-.00669438*Math.sin(c)*Math.sin(c)),s=Math.tan(c)*Math.tan(c),o=.006739496752268451*Math.cos(c)*Math.cos(c),u=.99330562*f/Math.pow(1-.00669438*Math.sin(c)*Math.sin(c),1.5),h=d/(.9996*a);var v=c-a*Math.tan(c)/u*(h*h/2-(5+3*s+10*o-4*o*o-.06065547077041606)*h*h*h*h/24+(61+90*s+298*o+45*s*s-1.6983531815716497-3*o*o)*h*h*h*h*h*h/720);v=oe(v);var g,x=(h-(1+2*s+o)*h*h*h/6+(5-2*o+28*s-3*o*o+.05391597401814761+24*s*s)*h*h*h*h*h/120)/Math.cos(c);if(x=l+oe(x),t.accuracy){var b=ue({northing:t.northing+t.accuracy,easting:t.easting+t.accuracy,zoneLetter:t.zoneLetter,zoneNumber:t.zoneNumber});g={top:b.lat,right:b.lon,bottom:v,left:x};}else g={lat:v,lon:x};return g}function he(t){var e=t%6;return 0===e&&(e=6),e}function le(t){if(t&&0===t.length)throw "MGRSPoint coverting from nothing";for(var e,r=t.length,i=null,n="",a=0;!/[A-Z]/.test(e=t.charAt(a));){if(a>=2)throw "MGRSPoint bad conversion from: "+t;n+=e,a++;}var s=parseInt(n,10);if(0===a||a+3>r)throw "MGRSPoint bad conversion from: "+t;var o=t.charAt(a++);if(o<="A"||"B"===o||"Y"===o||o>="Z"||"I"===o||"O"===o)throw "MGRSPoint zone letter "+o+" not handled: "+t;i=t.substring(a,a+=2);for(var u=he(s),h=function(t,e){for(var r="AJSAJS".charCodeAt(e-1),i=1e5,n=!1;r!==t.charCodeAt(0);){if(++r===ee&&r++,r===re&&r++,r>90){if(n)throw "Bad character: "+t;r=te,n=!0;}i+=1e5;}return i}(i.charAt(0),u),l=function(t,e){if(t>"V")throw "MGRSPoint given invalid Northing "+t;for(var r="AFAFAF".charCodeAt(e-1),i=0,n=!1;r!==t.charCodeAt(0);){if(++r===ee&&r++,r===re&&r++,r>86){if(n)throw "Bad character: "+t;r=te,n=!0;}i+=1e5;}return i}(i.charAt(1),u);l0&&(c=1e5/Math.pow(10,d),f=t.substring(a,a+d),m=parseFloat(f)*c,y=t.substring(a+d),v=parseFloat(y)*c),{easting:m+h,northing:v+l,zoneLetter:o,zoneNumber:s,accuracy:c}}function pe(t){var e;switch(t){case"C":e=11e5;break;case"D":e=2e6;break;case"E":e=28e5;break;case"F":e=37e5;break;case"G":e=46e5;break;case"H":e=55e5;break;case"J":e=64e5;break;case"K":e=73e5;break;case"L":e=82e5;break;case"M":e=91e5;break;case"N":e=0;break;case"P":e=8e5;break;case"Q":e=17e5;break;case"R":e=26e5;break;case"S":e=35e5;break;case"T":e=44e5;break;case"U":e=53e5;break;case"V":e=62e5;break;case"W":e=7e6;break;case"X":e=79e5;break;default:e=-1;}if(e>=0)return e;throw "Invalid zone letter: "+t}function ce(t,e,r){if(!(this instanceof ce))return new ce(t,e,r);if(Array.isArray(t))this.x=t[0],this.y=t[1],this.z=t[2]||0;else if("object"==typeof t)this.x=t.x,this.y=t.y,this.z=t.z||0;else if("string"==typeof t&&void 0===e){var i=t.split(",");this.x=parseFloat(i[0],10),this.y=parseFloat(i[1],10),this.z=parseFloat(i[2],10)||0;}else this.x=t,this.y=e,this.z=r||0;console.warn("proj4.Point will be removed in version 3, use proj4.toPoint");}ce.fromMGRS=function(t){return new ce(ae(t))},ce.prototype.toMGRS=function(t){return ne([this.x,this.y],t)};var fe=.01068115234375;function ye(t){var e=[];e[0]=1-t*(.25+t*(.046875+t*(.01953125+t*fe))),e[1]=t*(.75-t*(.046875+t*(.01953125+t*fe)));var r=t*t;return e[2]=r*(.46875-t*(.013020833333333334+.007120768229166667*t)),e[3]=(r*=t)*(.3645833333333333-.005696614583333333*t),e[4]=r*t*.3076171875,e}function de(t,e,r,i){return i[0]*t-(r*=e)*(i[1]+(e*=e)*(i[2]+e*(i[3]+e*i[4])))}function me(t,e,r){for(var i=1/(1-e),n=t,a=20;a;--a){var s=Math.sin(n),o=1-e*s*s;if(n-=o=(de(n,s,Math.cos(n),r)-t)*(o*Math.sqrt(o))*i,Math.abs(o)<1e-10)return n}return n}var ve={init:function(){this.x0=void 0!==this.x0?this.x0:0,this.y0=void 0!==this.y0?this.y0:0,this.long0=void 0!==this.long0?this.long0:0,this.lat0=void 0!==this.lat0?this.lat0:0,this.es&&(this.en=ye(this.es),this.ml0=de(this.lat0,Math.sin(this.lat0),Math.cos(this.lat0),this.en));},forward:function(t){var e,r,i,n=t.y,a=bt(t.x-this.long0),s=Math.sin(n),o=Math.cos(n);if(this.es){var u=o*a,h=Math.pow(u,2),l=this.ep2*Math.pow(o,2),p=Math.pow(l,2),c=Math.abs(o)>1e-10?Math.tan(n):0,f=Math.pow(c,2),y=Math.pow(f,2);e=1-this.es*Math.pow(s,2),u/=Math.sqrt(e);var d=de(n,s,o,this.en);r=this.a*(this.k0*u*(1+h/6*(1-f+l+h/20*(5-18*f+y+14*l-58*f*l+h/42*(61+179*y-y*f-479*f)))))+this.x0,i=this.a*(this.k0*(d-this.ml0+s*a*u/2*(1+h/12*(5-f+9*l+4*p+h/30*(61+y-58*f+270*l-330*f*l+h/56*(1385+543*y-y*f-3111*f))))))+this.y0;}else {var m=o*Math.sin(a);if(Math.abs(Math.abs(m)-1)<1e-10)return 93;if(r=.5*this.a*this.k0*Math.log((1+m)/(1-m))+this.x0,i=o*Math.cos(a)/Math.sqrt(1-Math.pow(m,2)),(m=Math.abs(i))>=1){if(m-1>1e-10)return 93;i=0;}else i=Math.acos(i);n<0&&(i=-i),i=this.a*this.k0*(i-this.lat0)+this.y0;}return t.x=r,t.y=i,t},inverse:function(t){var e,r,i,n,a=1/this.a*(t.x-this.x0),s=1/this.a*(t.y-this.y0);if(this.es)if(r=me(e=this.ml0+s/this.k0,this.es,this.en),Math.abs(r)1e-10?Math.tan(r):0,l=this.ep2*Math.pow(u,2),p=Math.pow(l,2),c=Math.pow(h,2),f=Math.pow(c,2);e=1-this.es*Math.pow(o,2);var y=a*Math.sqrt(e)/this.k0,d=Math.pow(y,2);i=r-(e*=h)*d/(1-this.es)*.5*(1-d/12*(5+3*c-9*l*c+l-4*p-d/30*(61+90*c-252*l*c+45*f+46*l-d/56*(1385+3633*c+4095*f+1574*f*c)))),n=bt(this.long0+y*(1-d/6*(1+2*c+l-d/20*(5+28*c+24*f+8*l*c+6*l-d/42*(61+662*c+1320*f+720*f*c))))/u);}else i=X*xt(s),n=0;else {var m=Math.exp(a/this.k0),v=.5*(m-1/m),g=Math.cos(this.lat0+s/this.k0);e=Math.sqrt((1-Math.pow(g,2))/(1+Math.pow(v,2))),i=Math.asin(e),s<0&&(i=-i),n=0===v&&0===g?0:bt(Math.atan2(v,g)+this.long0);}return t.x=n,t.y=i,t},names:["Fast_Transverse_Mercator","Fast Transverse Mercator"]};function ge(t){var e=Math.exp(t);return (e-1/e)/2}function xe(t,e){t=Math.abs(t),e=Math.abs(e);var r=Math.max(t,e),i=Math.min(t,e)/(r||1);return r*Math.sqrt(1+Math.pow(i,2))}function be(t,e){for(var r,i=2*Math.cos(2*e),n=t.length-1,a=t[n],s=0;--n>=0;)r=i*a-s+t[n],s=a,a=r;return e+r*Math.sin(2*e)}function _e(t,e,r){for(var i,n,a=Math.sin(e),s=Math.cos(e),o=ge(r),u=function(t){var e=Math.exp(t);return (e+1/e)/2}(r),h=2*s*u,l=-2*a*o,p=t.length-1,c=t[p],f=0,y=0,d=0;--p>=0;)i=y,n=f,c=h*(y=c)-i-l*(f=d)+t[p],d=l*y-n+h*f;return [(h=a*u)*c-(l=s*o)*d,h*d+l*c]}var we={init:function(){if(!this.approx&&(isNaN(this.es)||this.es<=0))throw new Error('Incorrect elliptical usage. Try using the +approx option in the proj string, or PROJECTION["Fast_Transverse_Mercator"] in the WKT.');this.approx&&(ve.init.apply(this),this.forward=ve.forward,this.inverse=ve.inverse),this.x0=void 0!==this.x0?this.x0:0,this.y0=void 0!==this.y0?this.y0:0,this.long0=void 0!==this.long0?this.long0:0,this.lat0=void 0!==this.lat0?this.lat0:0,this.cgb=[],this.cbg=[],this.utg=[],this.gtu=[];var t=this.es/(1+Math.sqrt(1-this.es)),e=t/(2-t),r=e;this.cgb[0]=e*(2+e*(-2/3+e*(e*(116/45+e*(26/45+e*(-2854/675)))-2))),this.cbg[0]=e*(e*(2/3+e*(4/3+e*(-82/45+e*(32/45+e*(4642/4725)))))-2),this.cgb[1]=(r*=e)*(7/3+e*(e*(-227/45+e*(2704/315+e*(2323/945)))-1.6)),this.cbg[1]=r*(5/3+e*(-16/15+e*(-13/9+e*(904/315+e*(-1522/945))))),this.cgb[2]=(r*=e)*(56/15+e*(-136/35+e*(-1262/105+e*(73814/2835)))),this.cbg[2]=r*(-26/15+e*(34/21+e*(1.6+e*(-12686/2835)))),this.cgb[3]=(r*=e)*(4279/630+e*(-332/35+e*(-399572/14175))),this.cbg[3]=r*(1237/630+e*(e*(-24832/14175)-2.4)),this.cgb[4]=(r*=e)*(4174/315+e*(-144838/6237)),this.cbg[4]=r*(-734/315+e*(109598/31185)),this.cgb[5]=(r*=e)*(601676/22275),this.cbg[5]=r*(444337/155925),r=Math.pow(e,2),this.Qn=this.k0/(1+e)*(1+r*(1/4+r*(1/64+r/256))),this.utg[0]=e*(e*(2/3+e*(-37/96+e*(1/360+e*(81/512+e*(-96199/604800)))))-.5),this.gtu[0]=e*(.5+e*(-2/3+e*(5/16+e*(41/180+e*(-127/288+e*(7891/37800)))))),this.utg[1]=r*(-1/48+e*(-1/15+e*(437/1440+e*(-46/105+e*(1118711/3870720))))),this.gtu[1]=r*(13/48+e*(e*(557/1440+e*(281/630+e*(-1983433/1935360)))-.6)),this.utg[2]=(r*=e)*(-17/480+e*(37/840+e*(209/4480+e*(-5569/90720)))),this.gtu[2]=r*(61/240+e*(-103/140+e*(15061/26880+e*(167603/181440)))),this.utg[3]=(r*=e)*(-4397/161280+e*(11/504+e*(830251/7257600))),this.gtu[3]=r*(49561/161280+e*(-179/168+e*(6601661/7257600))),this.utg[4]=(r*=e)*(-4583/161280+e*(108847/3991680)),this.gtu[4]=r*(34729/80640+e*(-3418889/1995840)),this.utg[5]=(r*=e)*(-20648693/638668800),this.gtu[5]=.6650675310896665*r;var i=be(this.cbg,this.lat0);this.Zb=-this.Qn*(i+function(t,e){for(var r,i=2*Math.cos(e),n=t.length-1,a=t[n],s=0;--n>=0;)r=i*a-s+t[n],s=a,a=r;return Math.sin(e)*r}(this.gtu,2*i));},forward:function(t){var e=bt(t.x-this.long0),r=t.y;r=be(this.cbg,r);var i=Math.sin(r),n=Math.cos(r),a=Math.sin(e),s=Math.cos(e);r=Math.atan2(i,s*n),e=Math.atan2(a*n,xe(i,n*s)),e=function(t){var e=Math.abs(t);return e=function(t){var e=1+t,r=e-1;return 0===r?t:t*Math.log(e)/r}(e*(1+e/(xe(1,e)+1))),t<0?-e:e}(Math.tan(e));var o,u,h=_e(this.gtu,2*r,2*e);return r+=h[0],e+=h[1],Math.abs(e)<=2.623395162778?(o=this.a*(this.Qn*e)+this.x0,u=this.a*(this.Qn*r+this.Zb)+this.y0):(o=1/0,u=1/0),t.x=o,t.y=u,t},inverse:function(t){var e,r,i=1/this.a*(t.x-this.x0),n=1/this.a*(t.y-this.y0);if(n=(n-this.Zb)/this.Qn,i/=this.Qn,Math.abs(i)<=2.623395162778){var a=_e(this.utg,2*n,2*i);n+=a[0],i+=a[1],i=Math.atan(ge(i));var s=Math.sin(n),o=Math.cos(n),u=Math.sin(i),h=Math.cos(i);n=Math.atan2(s*h,xe(u,h*o)),e=bt((i=Math.atan2(u,h*o))+this.long0),r=be(this.cgb,n);}else e=1/0,r=1/0;return t.x=e,t.y=r,t},names:["Extended_Transverse_Mercator","Extended Transverse Mercator","etmerc","Transverse_Mercator","Transverse Mercator","tmerc"]},Me={init:function(){var t=function(t,e){if(void 0===t){if((t=Math.floor(30*(bt(e)+Math.PI)/Math.PI)+1)<0)return 0;if(t>60)return 60}return t}(this.zone,this.long0);if(void 0===t)throw new Error("unknown utm zone");this.lat0=0,this.long0=(6*Math.abs(t)-183)*H,this.x0=5e5,this.y0=this.utmSouth?1e7:0,this.k0=.9996,we.init.apply(this),this.forward=we.forward,this.inverse=we.inverse;},names:["Universal Transverse Mercator System","utm"],dependsOn:"etmerc"};function Se(t,e){return Math.pow((1-t)/(1+t),e)}var Ae={init:function(){var t=Math.sin(this.lat0),e=Math.cos(this.lat0);e*=e,this.rc=Math.sqrt(1-this.es)/(1-this.es*t*t),this.C=Math.sqrt(1+this.es*e*e/(1-this.es)),this.phic0=Math.asin(t/this.C),this.ratexp=.5*this.C*this.e,this.K=Math.tan(.5*this.phic0+Z)/(Math.pow(Math.tan(.5*this.lat0+Z),this.C)*Se(this.e*t,this.ratexp));},forward:function(t){var e=t.x,r=t.y;return t.y=2*Math.atan(this.K*Math.pow(Math.tan(.5*r+Z),this.C)*Se(this.e*Math.sin(r),this.ratexp))-X,t.x=this.C*e,t},inverse:function(t){for(var e=t.x/this.C,r=t.y,i=Math.pow(Math.tan(.5*r+Z)/this.K,1/this.C),n=20;n>0&&(r=2*Math.atan(i*Se(this.e*Math.sin(t.y),-.5*this.e))-X,!(Math.abs(r-t.y)<1e-14));--n)t.y=r;return n?(t.x=e,t.y=r,t):null},names:["gauss"]},ke={init:function(){Ae.init.apply(this),this.rc&&(this.sinc0=Math.sin(this.phic0),this.cosc0=Math.cos(this.phic0),this.R2=2*this.rc,this.title||(this.title="Oblique Stereographic Alternative"));},forward:function(t){var e,r,i,n;return t.x=bt(t.x-this.long0),Ae.forward.apply(this,[t]),e=Math.sin(t.y),r=Math.cos(t.y),i=Math.cos(t.x),t.x=(n=this.k0*this.R2/(1+this.sinc0*e+this.cosc0*r*i))*r*Math.sin(t.x),t.y=n*(this.cosc0*e-this.sinc0*r*i),t.x=this.a*t.x+this.x0,t.y=this.a*t.y+this.y0,t},inverse:function(t){var e,r,i,n,a;if(t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,t.x/=this.k0,t.y/=this.k0,a=Math.sqrt(t.x*t.x+t.y*t.y)){var s=2*Math.atan2(a,this.R2);e=Math.sin(s),r=Math.cos(s),n=Math.asin(r*this.sinc0+t.y*e*this.cosc0/a),i=Math.atan2(t.x*e,a*this.cosc0*r-t.y*this.sinc0*e);}else n=this.phic0,i=0;return t.x=i,t.y=n,Ae.inverse.apply(this,[t]),t.x=bt(t.x+this.long0),t},names:["Stereographic_North_Pole","Oblique_Stereographic","Polar_Stereographic","sterea","Oblique Stereographic Alternative","Double_Stereographic"]},Ie={init:function(){this.coslat0=Math.cos(this.lat0),this.sinlat0=Math.sin(this.lat0),this.sphere?1===this.k0&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=1e-10&&(this.k0=.5*(1+xt(this.lat0)*Math.sin(this.lat_ts))):(Math.abs(this.coslat0)<=1e-10&&(this.con=this.lat0>0?1:-1),this.cons=Math.sqrt(Math.pow(1+this.e,1+this.e)*Math.pow(1-this.e,1-this.e)),1===this.k0&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=1e-10&&(this.k0=.5*this.cons*gt(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts))/_t(this.e,this.con*this.lat_ts,this.con*Math.sin(this.lat_ts))),this.ms1=gt(this.e,this.sinlat0,this.coslat0),this.X0=2*Math.atan(this.ssfn_(this.lat0,this.sinlat0,this.e))-X,this.cosX0=Math.cos(this.X0),this.sinX0=Math.sin(this.X0));},forward:function(t){var e,r,i,n,a,s,o=t.x,u=t.y,h=Math.sin(u),l=Math.cos(u),p=bt(o-this.long0);return Math.abs(Math.abs(o-this.long0)-Math.PI)<=1e-10&&Math.abs(u+this.lat0)<=1e-10?(t.x=NaN,t.y=NaN,t):this.sphere?(e=2*this.k0/(1+this.sinlat0*h+this.coslat0*l*Math.cos(p)),t.x=this.a*e*l*Math.sin(p)+this.x0,t.y=this.a*e*(this.coslat0*h-this.sinlat0*l*Math.cos(p))+this.y0,t):(r=2*Math.atan(this.ssfn_(u,h,this.e))-X,n=Math.cos(r),i=Math.sin(r),Math.abs(this.coslat0)<=1e-10?(a=_t(this.e,u*this.con,this.con*h),t.x=this.x0+(s=2*this.a*this.k0*a/this.cons)*Math.sin(o-this.long0),t.y=this.y0-this.con*s*Math.cos(o-this.long0),t):(Math.abs(this.sinlat0)<1e-10?(e=2*this.a*this.k0/(1+n*Math.cos(p)),t.y=e*i):(e=2*this.a*this.k0*this.ms1/(this.cosX0*(1+this.sinX0*i+this.cosX0*n*Math.cos(p))),t.y=e*(this.cosX0*i-this.sinX0*n*Math.cos(p))+this.y0),t.x=e*n*Math.sin(p)+this.x0,t))},inverse:function(t){var e,r,i,n;t.x-=this.x0,t.y-=this.y0;var a=Math.sqrt(t.x*t.x+t.y*t.y);if(this.sphere){var s=2*Math.atan(a/(2*this.a*this.k0));return e=this.long0,r=this.lat0,a<=1e-10?(t.x=e,t.y=r,t):(r=Math.asin(Math.cos(s)*this.sinlat0+t.y*Math.sin(s)*this.coslat0/a),e=Math.abs(this.coslat0)<1e-10?bt(this.lat0>0?this.long0+Math.atan2(t.x,-1*t.y):this.long0+Math.atan2(t.x,t.y)):bt(this.long0+Math.atan2(t.x*Math.sin(s),a*this.coslat0*Math.cos(s)-t.y*this.sinlat0*Math.sin(s))),t.x=e,t.y=r,t)}if(Math.abs(this.coslat0)<=1e-10){if(a<=1e-10)return r=this.lat0,t.x=e=this.long0,t.y=r,t;t.x*=this.con,t.y*=this.con,r=this.con*wt(this.e,a*this.cons/(2*this.a*this.k0)),e=this.con*bt(this.con*this.long0+Math.atan2(t.x,-1*t.y));}else i=2*Math.atan(a*this.cosX0/(2*this.a*this.k0*this.ms1)),e=this.long0,a<=1e-10?n=this.X0:(n=Math.asin(Math.cos(i)*this.sinX0+t.y*Math.sin(i)*this.cosX0/a),e=bt(this.long0+Math.atan2(t.x*Math.sin(i),a*this.cosX0*Math.cos(i)-t.y*this.sinX0*Math.sin(i)))),r=-1*wt(this.e,Math.tan(.5*(X+n)));return t.x=e,t.y=r,t},names:["stere","Stereographic_South_Pole","Polar Stereographic (variant B)"],ssfn_:function(t,e,r){return e*=r,Math.tan(.5*(X+t))*Math.pow((1-e)/(1+e),.5*r)}},ze={init:function(){var t=this.lat0;this.lambda0=this.long0;var e=Math.sin(t),r=this.a,i=1/this.rf,n=2*i-Math.pow(i,2),a=this.e=Math.sqrt(n);this.R=this.k0*r*Math.sqrt(1-n)/(1-n*Math.pow(e,2)),this.alpha=Math.sqrt(1+n/(1-n)*Math.pow(Math.cos(t),4)),this.b0=Math.asin(e/this.alpha);var s=Math.log(Math.tan(Math.PI/4+this.b0/2)),o=Math.log(Math.tan(Math.PI/4+t/2)),u=Math.log((1+a*e)/(1-a*e));this.K=s-this.alpha*o+this.alpha*a/2*u;},forward:function(t){var e=Math.log(Math.tan(Math.PI/4-t.y/2)),r=this.e/2*Math.log((1+this.e*Math.sin(t.y))/(1-this.e*Math.sin(t.y))),i=2*(Math.atan(Math.exp(-this.alpha*(e+r)+this.K))-Math.PI/4),n=this.alpha*(t.x-this.lambda0),a=Math.atan(Math.sin(n)/(Math.sin(this.b0)*Math.tan(i)+Math.cos(this.b0)*Math.cos(n))),s=Math.asin(Math.cos(this.b0)*Math.sin(i)-Math.sin(this.b0)*Math.cos(i)*Math.cos(n));return t.y=this.R/2*Math.log((1+Math.sin(s))/(1-Math.sin(s)))+this.y0,t.x=this.R*a+this.x0,t},inverse:function(t){for(var e=(t.x-this.x0)/this.R,r=2*(Math.atan(Math.exp((t.y-this.y0)/this.R))-Math.PI/4),i=Math.asin(Math.cos(this.b0)*Math.sin(r)+Math.sin(this.b0)*Math.cos(r)*Math.cos(e)),n=Math.atan(Math.sin(e)/(Math.cos(this.b0)*Math.cos(e)-Math.sin(this.b0)*Math.tan(r))),a=this.lambda0+n/this.alpha,s=0,o=i,u=-1e3,h=0;Math.abs(o-u)>1e-7;){if(++h>20)return;s=1/this.alpha*(Math.log(Math.tan(Math.PI/4+i/2))-this.K)+this.e*Math.log(Math.tan(Math.PI/4+Math.asin(this.e*Math.sin(o))/2)),u=o,o=2*Math.atan(Math.exp(s))-Math.PI/2;}return t.x=a,t.y=o,t},names:["somerc"]},Ce={init:function(){var t,e,r,i,n,a,s,o,u,h,l,p,c,f=0,y=0,d=0,m=0,v=0,g=0,x=0;this.no_off=(c="object"==typeof(p=this).PROJECTION?Object.keys(p.PROJECTION)[0]:p.PROJECTION,"no_uoff"in p||"no_off"in p||-1!==["Hotine_Oblique_Mercator","Hotine_Oblique_Mercator_Azimuth_Natural_Origin"].indexOf(c)),this.no_rot="no_rot"in this;var b=!1;"alpha"in this&&(b=!0);var _=!1;if("rectified_grid_angle"in this&&(_=!0),b&&(x=this.alpha),_&&(f=this.rectified_grid_angle*H),b||_)y=this.longc;else if(d=this.long1,v=this.lat1,m=this.long2,g=this.lat2,Math.abs(v-g)<=1e-7||(t=Math.abs(v))<=1e-7||Math.abs(t-X)<=1e-7||Math.abs(Math.abs(this.lat0)-X)<=1e-7||Math.abs(Math.abs(g)-X)<=1e-7)throw new Error;var w=1-this.es;e=Math.sqrt(w),Math.abs(this.lat0)>1e-10?(o=Math.sin(this.lat0),r=Math.cos(this.lat0),t=1-this.es*o*o,this.B=r*r,this.B=Math.sqrt(1+this.es*this.B*this.B/w),this.A=this.B*this.k0*e/t,(n=(i=this.B*e/(r*Math.sqrt(t)))*i-1)<=0?n=0:(n=Math.sqrt(n),this.lat0<0&&(n=-n)),this.E=n+=i,this.E*=Math.pow(_t(this.e,this.lat0,o),this.B)):(this.B=1/e,this.A=this.k0,this.E=i=n=1),b||_?(b?(l=Math.asin(Math.sin(x)/i),_||(f=x)):(l=f,x=Math.asin(i*Math.sin(l))),this.lam0=y-Math.asin(.5*(n-1/n)*Math.tan(l))/this.B):(a=Math.pow(_t(this.e,v,Math.sin(v)),this.B),s=Math.pow(_t(this.e,g,Math.sin(g)),this.B),n=this.E/a,u=(s-a)/(s+a),h=((h=this.E*this.E)-s*a)/(h+s*a),(t=d-m)<-Math.pi?m-=Y:t>Math.pi&&(m+=Y),this.lam0=bt(.5*(d+m)-Math.atan(h*Math.tan(.5*this.B*(d-m))/u)/this.B),l=Math.atan(2*Math.sin(this.B*bt(d-this.lam0))/(n-1/n)),f=x=Math.asin(i*Math.sin(l))),this.singam=Math.sin(l),this.cosgam=Math.cos(l),this.sinrot=Math.sin(f),this.cosrot=Math.cos(f),this.rB=1/this.B,this.ArB=this.A*this.rB,this.BrA=1/this.ArB,this.no_off?this.u_0=0:(this.u_0=Math.abs(this.ArB*Math.atan(Math.sqrt(i*i-1)/Math.cos(x))),this.lat0<0&&(this.u_0=-this.u_0)),n=.5*l,this.v_pole_n=this.ArB*Math.log(Math.tan(Z-n)),this.v_pole_s=this.ArB*Math.log(Math.tan(Z+n));},forward:function(t){var e,r,i,n,a,s,o,u,h={};if(t.x=t.x-this.lam0,Math.abs(Math.abs(t.y)-X)>1e-10){if(e=.5*((a=this.E/Math.pow(_t(this.e,t.y,Math.sin(t.y)),this.B))-(s=1/a)),r=.5*(a+s),n=Math.sin(this.B*t.x),i=(e*this.singam-n*this.cosgam)/r,Math.abs(Math.abs(i)-1)<1e-10)throw new Error;u=.5*this.ArB*Math.log((1-i)/(1+i)),s=Math.cos(this.B*t.x),o=Math.abs(s)<1e-7?this.A*t.x:this.ArB*Math.atan2(e*this.cosgam+n*this.singam,s);}else u=t.y>0?this.v_pole_n:this.v_pole_s,o=this.ArB*t.y;return this.no_rot?(h.x=o,h.y=u):(h.x=u*this.cosrot+(o-=this.u_0)*this.sinrot,h.y=o*this.cosrot-u*this.sinrot),h.x=this.a*h.x+this.x0,h.y=this.a*h.y+this.y0,h},inverse:function(t){var e,r,i,n,a,s,o,u={};if(t.x=1/this.a*(t.x-this.x0),t.y=1/this.a*(t.y-this.y0),this.no_rot?(r=t.y,e=t.x):(r=t.x*this.cosrot-t.y*this.sinrot,e=t.y*this.cosrot+t.x*this.sinrot+this.u_0),n=.5*((i=Math.exp(-this.BrA*r))-1/i),a=.5*(i+1/i),o=((s=Math.sin(this.BrA*e))*this.cosgam+n*this.singam)/a,Math.abs(Math.abs(o)-1)<1e-10)u.x=0,u.y=o<0?-X:X;else {if(u.y=this.E/Math.sqrt((1+o)/(1-o)),u.y=wt(this.e,Math.pow(u.y,1/this.B)),u.y===1/0)throw new Error;u.x=-this.rB*Math.atan2(n*this.cosgam-s*this.singam,Math.cos(this.BrA*e));}return u.x+=this.lam0,u},names:["Hotine_Oblique_Mercator","Hotine Oblique Mercator","Hotine_Oblique_Mercator_Azimuth_Natural_Origin","Hotine_Oblique_Mercator_Two_Point_Natural_Origin","Hotine_Oblique_Mercator_Azimuth_Center","Oblique_Mercator","omerc"]},Ee={init:function(){if(this.lat2||(this.lat2=this.lat1),this.k0||(this.k0=1),this.x0=this.x0||0,this.y0=this.y0||0,!(Math.abs(this.lat1+this.lat2)<1e-10)){var t=this.b/this.a;this.e=Math.sqrt(1-t*t);var e=Math.sin(this.lat1),r=Math.cos(this.lat1),i=gt(this.e,e,r),n=_t(this.e,this.lat1,e),a=Math.sin(this.lat2),s=Math.cos(this.lat2),o=gt(this.e,a,s),u=_t(this.e,this.lat2,a),h=_t(this.e,this.lat0,Math.sin(this.lat0));this.ns=Math.abs(this.lat1-this.lat2)>1e-10?Math.log(i/o)/Math.log(n/u):e,isNaN(this.ns)&&(this.ns=e),this.f0=i/(this.ns*Math.pow(n,this.ns)),this.rh=this.a*this.f0*Math.pow(h,this.ns),this.title||(this.title="Lambert Conformal Conic");}},forward:function(t){var e=t.x,r=t.y;Math.abs(2*Math.abs(r)-Math.PI)<=1e-10&&(r=xt(r)*(X-2e-10));var i,n,a=Math.abs(Math.abs(r)-X);if(a>1e-10)i=_t(this.e,r,Math.sin(r)),n=this.a*this.f0*Math.pow(i,this.ns);else {if((a=r*this.ns)<=0)return null;n=0;}var s=this.ns*bt(e-this.long0);return t.x=this.k0*(n*Math.sin(s))+this.x0,t.y=this.k0*(this.rh-n*Math.cos(s))+this.y0,t},inverse:function(t){var e,r,i,n,a,s=(t.x-this.x0)/this.k0,o=this.rh-(t.y-this.y0)/this.k0;this.ns>0?(e=Math.sqrt(s*s+o*o),r=1):(e=-Math.sqrt(s*s+o*o),r=-1);var u=0;if(0!==e&&(u=Math.atan2(r*s,r*o)),0!==e||this.ns>0){if(r=1/this.ns,i=Math.pow(e/(this.a*this.f0),r),-9999===(n=wt(this.e,i)))return null}else n=-X;return a=bt(u/this.ns+this.long0),t.x=a,t.y=n,t},names:["Lambert Tangential Conformal Conic Projection","Lambert_Conformal_Conic","Lambert_Conformal_Conic_1SP","Lambert_Conformal_Conic_2SP","lcc","Lambert Conic Conformal (1SP)","Lambert Conic Conformal (2SP)"]},Pe={init:function(){this.a=6377397.155,this.es=.006674372230614,this.e=Math.sqrt(this.es),this.lat0||(this.lat0=.863937979737193),this.long0||(this.long0=.4334234309119251),this.k0||(this.k0=.9999),this.s45=.785398163397448,this.s90=2*this.s45,this.fi0=this.lat0,this.e2=this.es,this.e=Math.sqrt(this.e2),this.alfa=Math.sqrt(1+this.e2*Math.pow(Math.cos(this.fi0),4)/(1-this.e2)),this.uq=1.04216856380474,this.u0=Math.asin(Math.sin(this.fi0)/this.alfa),this.g=Math.pow((1+this.e*Math.sin(this.fi0))/(1-this.e*Math.sin(this.fi0)),this.alfa*this.e/2),this.k=Math.tan(this.u0/2+this.s45)/Math.pow(Math.tan(this.fi0/2+this.s45),this.alfa)*this.g,this.k1=this.k0,this.n0=this.a*Math.sqrt(1-this.e2)/(1-this.e2*Math.pow(Math.sin(this.fi0),2)),this.s0=1.37008346281555,this.n=Math.sin(this.s0),this.ro0=this.k1*this.n0/Math.tan(this.s0),this.ad=this.s90-this.uq;},forward:function(t){var e,r,i,n,a,s,o,u=t.y,h=bt(t.x-this.long0);return e=Math.pow((1+this.e*Math.sin(u))/(1-this.e*Math.sin(u)),this.alfa*this.e/2),r=2*(Math.atan(this.k*Math.pow(Math.tan(u/2+this.s45),this.alfa)/e)-this.s45),i=-h*this.alfa,n=Math.asin(Math.cos(this.ad)*Math.sin(r)+Math.sin(this.ad)*Math.cos(r)*Math.cos(i)),a=Math.asin(Math.cos(r)*Math.sin(i)/Math.cos(n)),s=this.n*a,o=this.ro0*Math.pow(Math.tan(this.s0/2+this.s45),this.n)/Math.pow(Math.tan(n/2+this.s45),this.n),t.y=o*Math.cos(s)/1,t.x=o*Math.sin(s)/1,this.czech||(t.y*=-1,t.x*=-1),t},inverse:function(t){var e,r,i,n,a,s,o,u=t.x;t.x=t.y,t.y=u,this.czech||(t.y*=-1,t.x*=-1),a=Math.sqrt(t.x*t.x+t.y*t.y),n=Math.atan2(t.y,t.x)/Math.sin(this.s0),i=2*(Math.atan(Math.pow(this.ro0/a,1/this.n)*Math.tan(this.s0/2+this.s45))-this.s45),e=Math.asin(Math.cos(this.ad)*Math.sin(i)-Math.sin(this.ad)*Math.cos(i)*Math.cos(n)),r=Math.asin(Math.cos(i)*Math.sin(n)/Math.cos(e)),t.x=this.long0-r/this.alfa,s=e,o=0;var h=0;do{t.y=2*(Math.atan(Math.pow(this.k,-1/this.alfa)*Math.pow(Math.tan(e/2+this.s45),1/this.alfa)*Math.pow((1+this.e*Math.sin(s))/(1-this.e*Math.sin(s)),this.e/2))-this.s45),Math.abs(s-t.y)<1e-10&&(o=1),s=t.y,h+=1;}while(0===o&&h<15);return h>=15?null:t},names:["Krovak","krovak"]};function Be(t,e,r,i,n){return t*n-e*Math.sin(2*n)+r*Math.sin(4*n)-i*Math.sin(6*n)}function Te(t){return 1-.25*t*(1+t/16*(3+1.25*t))}function Ve(t){return .375*t*(1+.25*t*(1+.46875*t))}function Le(t){return .05859375*t*t*(1+.75*t)}function Fe(t){return t*t*t*(35/3072)}function Oe(t,e,r){var i=e*r;return t/Math.sqrt(1-i*i)}function De(t){return Math.abs(t)1e-7?(1-t*t)*(e/(1-(r=t*e)*r)-.5/t*Math.log((1-r)/(1+r))):2*e}var je={init:function(){var t,e=Math.abs(this.lat0);if(this.mode=Math.abs(e-X)<1e-10?this.lat0<0?this.S_POLE:this.N_POLE:Math.abs(e)<1e-10?this.EQUIT:this.OBLIQ,this.es>0)switch(this.qp=qe(this.e,1),this.mmf=.5/(1-this.es),this.apa=function(t){var e,r=[];return r[0]=.3333333333333333*t,r[0]+=.17222222222222222*(e=t*t),r[1]=.06388888888888888*e,r[0]+=.10257936507936508*(e*=t),r[1]+=.0664021164021164*e,r[2]=.016415012942191543*e,r}(this.es),this.mode){case this.N_POLE:case this.S_POLE:this.dd=1;break;case this.EQUIT:this.rq=Math.sqrt(.5*this.qp),this.dd=1/this.rq,this.xmf=1,this.ymf=.5*this.qp;break;case this.OBLIQ:this.rq=Math.sqrt(.5*this.qp),t=Math.sin(this.lat0),this.sinb1=qe(this.e,t)/this.qp,this.cosb1=Math.sqrt(1-this.sinb1*this.sinb1),this.dd=Math.cos(this.lat0)/(Math.sqrt(1-this.es*t*t)*this.rq*this.cosb1),this.ymf=(this.xmf=this.rq)/this.dd,this.xmf*=this.dd;}else this.mode===this.OBLIQ&&(this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0));},forward:function(t){var e,r,i,n,a,s,o,u,h,l,p=t.x,c=t.y;if(p=bt(p-this.long0),this.sphere){if(a=Math.sin(c),l=Math.cos(c),i=Math.cos(p),this.mode===this.OBLIQ||this.mode===this.EQUIT){if((r=this.mode===this.EQUIT?1+l*i:1+this.sinph0*a+this.cosph0*l*i)<=1e-10)return null;e=(r=Math.sqrt(2/r))*l*Math.sin(p),r*=this.mode===this.EQUIT?a:this.cosph0*a-this.sinph0*l*i;}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(i=-i),Math.abs(c+this.lat0)<1e-10)return null;r=Z-.5*c,e=(r=2*(this.mode===this.S_POLE?Math.cos(r):Math.sin(r)))*Math.sin(p),r*=i;}}else {switch(o=0,u=0,h=0,i=Math.cos(p),n=Math.sin(p),a=Math.sin(c),s=qe(this.e,a),this.mode!==this.OBLIQ&&this.mode!==this.EQUIT||(o=s/this.qp,u=Math.sqrt(1-o*o)),this.mode){case this.OBLIQ:h=1+this.sinb1*o+this.cosb1*u*i;break;case this.EQUIT:h=1+u*i;break;case this.N_POLE:h=X+c,s=this.qp-s;break;case this.S_POLE:h=c-X,s=this.qp+s;}if(Math.abs(h)<1e-10)return null;switch(this.mode){case this.OBLIQ:case this.EQUIT:h=Math.sqrt(2/h),r=this.mode===this.OBLIQ?this.ymf*h*(this.cosb1*o-this.sinb1*u*i):(h=Math.sqrt(2/(1+u*i)))*o*this.ymf,e=this.xmf*h*u*n;break;case this.N_POLE:case this.S_POLE:s>=0?(e=(h=Math.sqrt(s))*n,r=i*(this.mode===this.S_POLE?h:-h)):e=r=0;}}return t.x=this.a*e+this.x0,t.y=this.a*r+this.y0,t},inverse:function(t){t.x-=this.x0,t.y-=this.y0;var e,r,i,n,a,s,o,u,h,l,p=t.x/this.a,c=t.y/this.a;if(this.sphere){var f,y=0,d=0;if((r=.5*(f=Math.sqrt(p*p+c*c)))>1)return null;switch(r=2*Math.asin(r),this.mode!==this.OBLIQ&&this.mode!==this.EQUIT||(d=Math.sin(r),y=Math.cos(r)),this.mode){case this.EQUIT:r=Math.abs(f)<=1e-10?0:Math.asin(c*d/f),p*=d,c=y*f;break;case this.OBLIQ:r=Math.abs(f)<=1e-10?this.lat0:Math.asin(y*this.sinph0+c*d*this.cosph0/f),p*=d*this.cosph0,c=(y-Math.sin(r)*this.sinph0)*f;break;case this.N_POLE:c=-c,r=X-r;break;case this.S_POLE:r-=X;}e=0!==c||this.mode!==this.EQUIT&&this.mode!==this.OBLIQ?Math.atan2(p,c):0;}else {if(o=0,this.mode===this.OBLIQ||this.mode===this.EQUIT){if(p/=this.dd,c*=this.dd,(s=Math.sqrt(p*p+c*c))<1e-10)return t.x=this.long0,t.y=this.lat0,t;n=2*Math.asin(.5*s/this.rq),i=Math.cos(n),p*=n=Math.sin(n),this.mode===this.OBLIQ?(a=this.qp*(o=i*this.sinb1+c*n*this.cosb1/s),c=s*this.cosb1*i-c*this.sinb1*n):(a=this.qp*(o=c*n/s),c=s*i);}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(c=-c),!(a=p*p+c*c))return t.x=this.long0,t.y=this.lat0,t;o=1-a/this.qp,this.mode===this.S_POLE&&(o=-o);}e=Math.atan2(p,c),l=(u=Math.asin(o))+u,r=u+(h=this.apa)[0]*Math.sin(l)+h[1]*Math.sin(l+l)+h[2]*Math.sin(l+l+l);}return t.x=bt(this.long0+e),t.y=r,t},names:["Lambert Azimuthal Equal Area","Lambert_Azimuthal_Equal_Area","laea"],S_POLE:1,N_POLE:2,EQUIT:3,OBLIQ:4};function Ue(t){return Math.abs(t)>1&&(t=t>1?1:-1),Math.asin(t)}var Ge={init:function(){Math.abs(this.lat1+this.lat2)<1e-10||(this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e3=Math.sqrt(this.es),this.sin_po=Math.sin(this.lat1),this.cos_po=Math.cos(this.lat1),this.t1=this.sin_po,this.con=this.sin_po,this.ms1=gt(this.e3,this.sin_po,this.cos_po),this.qs1=qe(this.e3,this.sin_po),this.sin_po=Math.sin(this.lat2),this.cos_po=Math.cos(this.lat2),this.t2=this.sin_po,this.ms2=gt(this.e3,this.sin_po,this.cos_po),this.qs2=qe(this.e3,this.sin_po),this.sin_po=Math.sin(this.lat0),this.cos_po=Math.cos(this.lat0),this.t3=this.sin_po,this.qs0=qe(this.e3,this.sin_po),this.ns0=Math.abs(this.lat1-this.lat2)>1e-10?(this.ms1*this.ms1-this.ms2*this.ms2)/(this.qs2-this.qs1):this.con,this.c=this.ms1*this.ms1+this.ns0*this.qs1,this.rh=this.a*Math.sqrt(this.c-this.ns0*this.qs0)/this.ns0);},forward:function(t){var e=t.x,r=t.y;this.sin_phi=Math.sin(r),this.cos_phi=Math.cos(r);var i=qe(this.e3,this.sin_phi),n=this.a*Math.sqrt(this.c-this.ns0*i)/this.ns0,a=this.ns0*bt(e-this.long0),s=n*Math.sin(a)+this.x0,o=this.rh-n*Math.cos(a)+this.y0;return t.x=s,t.y=o,t},inverse:function(t){var e,r,i,n,a;return t.x-=this.x0,t.y=this.rh-t.y+this.y0,this.ns0>=0?(e=Math.sqrt(t.x*t.x+t.y*t.y),r=1):(e=-Math.sqrt(t.x*t.x+t.y*t.y),r=-1),i=0,0!==e&&(i=Math.atan2(r*t.x,r*t.y)),r=e*this.ns0/this.a,a=this.sphere?Math.asin((this.c-r*r)/(2*this.ns0)):this.phi1z(this.e3,(this.c-r*r)/this.ns0),n=bt(i/this.ns0+this.long0),t.x=n,t.y=a,t},names:["Albers_Conic_Equal_Area","Albers","aea"],phi1z:function(t,e){var r,i,n,a,s=Ue(.5*e);if(t<1e-10)return s;for(var o=t*t,u=1;u<=25;u++)if(s+=a=.5*(n=1-(i=t*(r=Math.sin(s)))*i)*n/Math.cos(s)*(e/(1-o)-r/n+.5/t*Math.log((1-i)/(1+i))),Math.abs(a)<=1e-7)return s;return null}},Ke={init:function(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0),this.infinity_dist=1e3*this.a,this.rc=1;},forward:function(t){var e,r,i,n,a,s,o,u=t.y;return i=bt(t.x-this.long0),e=Math.sin(u),r=Math.cos(u),n=Math.cos(i),(a=this.sin_p14*e+this.cos_p14*r*n)>0||Math.abs(a)<=1e-10?(s=this.x0+1*this.a*r*Math.sin(i)/a,o=this.y0+1*this.a*(this.cos_p14*e-this.sin_p14*r*n)/a):(s=this.x0+this.infinity_dist*r*Math.sin(i),o=this.y0+this.infinity_dist*(this.cos_p14*e-this.sin_p14*r*n)),t.x=s,t.y=o,t},inverse:function(t){var e,r,i,n,a,s;return t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,t.x/=this.k0,t.y/=this.k0,(e=Math.sqrt(t.x*t.x+t.y*t.y))?(n=Math.atan2(e,this.rc),r=Math.sin(n),s=Ue((i=Math.cos(n))*this.sin_p14+t.y*r*this.cos_p14/e),a=Math.atan2(t.x*r,e*this.cos_p14*i-t.y*this.sin_p14*r),a=bt(this.long0+a)):(s=this.phic0,a=0),t.x=a,t.y=s,t},names:["gnom"]},Xe={init:function(){this.sphere||(this.k0=gt(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)));},forward:function(t){var e,r,i=t.y,n=bt(t.x-this.long0);if(this.sphere)e=this.x0+this.a*n*Math.cos(this.lat_ts),r=this.y0+this.a*Math.sin(i)/Math.cos(this.lat_ts);else {var a=qe(this.e,Math.sin(i));e=this.x0+this.a*this.k0*n,r=this.y0+this.a*a*.5/this.k0;}return t.x=e,t.y=r,t},inverse:function(t){var e,r;return t.x-=this.x0,t.y-=this.y0,this.sphere?(e=bt(this.long0+t.x/this.a/Math.cos(this.lat_ts)),r=Math.asin(t.y/this.a*Math.cos(this.lat_ts))):(r=function(t,e){var r=1-(1-t*t)/(2*t)*Math.log((1-t)/(1+t));if(Math.abs(Math.abs(e)-r)<1e-6)return e<0?-1*X:X;for(var i,n,a,s,o=Math.asin(.5*e),u=0;u<30;u++)if(n=Math.sin(o),a=Math.cos(o),s=t*n,o+=i=Math.pow(1-s*s,2)/(2*a)*(e/(1-t*t)-n/(1-s*s)+.5/t*Math.log((1-s)/(1+s))),Math.abs(i)<=1e-10)return o;return NaN}(this.e,2*t.y*this.k0/this.a),e=bt(this.long0+t.x/(this.a*this.k0))),t.x=e,t.y=r,t},names:["cea"]},He={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Equidistant Cylindrical (Plate Carre)",this.rc=Math.cos(this.lat_ts);},forward:function(t){var e=t.y,r=bt(t.x-this.long0),i=De(e-this.lat0);return t.x=this.x0+this.a*r*this.rc,t.y=this.y0+this.a*i,t},inverse:function(t){var e=t.y;return t.x=bt(this.long0+(t.x-this.x0)/(this.a*this.rc)),t.y=De(this.lat0+(e-this.y0)/this.a),t},names:["Equirectangular","Equidistant_Cylindrical","eqc"]},Je={init:function(){this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=Te(this.es),this.e1=Ve(this.es),this.e2=Le(this.es),this.e3=Fe(this.es),this.ml0=this.a*Be(this.e0,this.e1,this.e2,this.e3,this.lat0);},forward:function(t){var e,r,i,n=t.y,a=bt(t.x-this.long0);if(i=a*Math.sin(n),this.sphere)Math.abs(n)<=1e-10?(e=this.a*a,r=-1*this.a*this.lat0):(e=this.a*Math.sin(i)/Math.tan(n),r=this.a*(De(n-this.lat0)+(1-Math.cos(i))/Math.tan(n)));else if(Math.abs(n)<=1e-10)e=this.a*a,r=-1*this.ml0;else {var s=Oe(this.a,this.e,Math.sin(n))/Math.tan(n);e=s*Math.sin(i),r=this.a*Be(this.e0,this.e1,this.e2,this.e3,n)-this.ml0+s*(1-Math.cos(i));}return t.x=e+this.x0,t.y=r+this.y0,t},inverse:function(t){var e,r,i,n,a,s,o,u,h;if(i=t.x-this.x0,n=t.y-this.y0,this.sphere)if(Math.abs(n+this.a*this.lat0)<=1e-10)e=bt(i/this.a+this.long0),r=0;else {var l;for(o=i*i/this.a/this.a+(s=this.lat0+n/this.a)*s,u=s,a=20;a;--a)if(u+=h=-1*(s*(u*(l=Math.tan(u))+1)-u-.5*(u*u+o)*l)/((u-s)/l-1),Math.abs(h)<=1e-10){r=u;break}e=bt(this.long0+Math.asin(i*Math.tan(u)/this.a)/Math.sin(r));}else if(Math.abs(n+this.ml0)<=1e-10)r=0,e=bt(this.long0+i/this.a);else {var p,c,f,y,d;for(o=i*i/this.a/this.a+(s=(this.ml0+n)/this.a)*s,u=s,a=20;a;--a)if(d=this.e*Math.sin(u),p=Math.sqrt(1-d*d)*Math.tan(u),c=this.a*Be(this.e0,this.e1,this.e2,this.e3,u),f=this.e0-2*this.e1*Math.cos(2*u)+4*this.e2*Math.cos(4*u)-6*this.e3*Math.cos(6*u),u-=h=(s*(p*(y=c/this.a)+1)-y-.5*p*(y*y+o))/(this.es*Math.sin(2*u)*(y*y+o-2*s*y)/(4*p)+(s-y)*(p*f-2/Math.sin(2*u))-f),Math.abs(h)<=1e-10){r=u;break}p=Math.sqrt(1-this.es*Math.pow(Math.sin(r),2))*Math.tan(r),e=bt(this.long0+Math.asin(i*p/this.a)/Math.sin(r));}return t.x=e,t.y=r,t},names:["Polyconic","poly"]},Ze={init:function(){this.A=[],this.A[1]=.6399175073,this.A[2]=-.1358797613,this.A[3]=.063294409,this.A[4]=-.02526853,this.A[5]=.0117879,this.A[6]=-.0055161,this.A[7]=.0026906,this.A[8]=-.001333,this.A[9]=67e-5,this.A[10]=-34e-5,this.B_re=[],this.B_im=[],this.B_re[1]=.7557853228,this.B_im[1]=0,this.B_re[2]=.249204646,this.B_im[2]=.003371507,this.B_re[3]=-.001541739,this.B_im[3]=.04105856,this.B_re[4]=-.10162907,this.B_im[4]=.01727609,this.B_re[5]=-.26623489,this.B_im[5]=-.36249218,this.B_re[6]=-.6870983,this.B_im[6]=-1.1651967,this.C_re=[],this.C_im=[],this.C_re[1]=1.3231270439,this.C_im[1]=0,this.C_re[2]=-.577245789,this.C_im[2]=-.007809598,this.C_re[3]=.508307513,this.C_im[3]=-.112208952,this.C_re[4]=-.15094762,this.C_im[4]=.18200602,this.C_re[5]=1.01418179,this.C_im[5]=1.64497696,this.C_re[6]=1.9660549,this.C_im[6]=2.5127645,this.D=[],this.D[1]=1.5627014243,this.D[2]=.5185406398,this.D[3]=-.03333098,this.D[4]=-.1052906,this.D[5]=-.0368594,this.D[6]=.007317,this.D[7]=.0122,this.D[8]=.00394,this.D[9]=-.0013;},forward:function(t){var e,r=(t.y-this.lat0)/K*1e-5,i=t.x-this.long0,n=1,a=0;for(e=1;e<=10;e++)a+=this.A[e]*(n*=r);var s,o=a,u=i,h=1,l=0,p=0,c=0;for(e=1;e<=6;e++)s=l*o+h*u,p=p+this.B_re[e]*(h=h*o-l*u)-this.B_im[e]*(l=s),c=c+this.B_im[e]*h+this.B_re[e]*l;return t.x=c*this.a+this.x0,t.y=p*this.a+this.y0,t},inverse:function(t){var e,r,i=(t.y-this.y0)/this.a,n=(t.x-this.x0)/this.a,a=1,s=0,o=0,u=0;for(e=1;e<=6;e++)r=s*i+a*n,o=o+this.C_re[e]*(a=a*i-s*n)-this.C_im[e]*(s=r),u=u+this.C_im[e]*a+this.C_re[e]*s;for(var h=0;h.999999999999&&(r=.999999999999),e=Math.asin(r);var i=bt(this.long0+t.x/(.900316316158*this.a*Math.cos(e)));i<-Math.PI&&(i=-Math.PI),i>Math.PI&&(i=Math.PI),r=(2*e+Math.sin(2*e))/Math.PI,Math.abs(r)>1&&(r=1);var n=Math.asin(r);return t.x=i,t.y=n,t},names:["Mollweide","moll"]},$e={init:function(){Math.abs(this.lat1+this.lat2)<1e-10||(this.lat2=this.lat2||this.lat1,this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=Te(this.es),this.e1=Ve(this.es),this.e2=Le(this.es),this.e3=Fe(this.es),this.sinphi=Math.sin(this.lat1),this.cosphi=Math.cos(this.lat1),this.ms1=gt(this.e,this.sinphi,this.cosphi),this.ml1=Be(this.e0,this.e1,this.e2,this.e3,this.lat1),Math.abs(this.lat1-this.lat2)<1e-10?this.ns=this.sinphi:(this.sinphi=Math.sin(this.lat2),this.cosphi=Math.cos(this.lat2),this.ms2=gt(this.e,this.sinphi,this.cosphi),this.ml2=Be(this.e0,this.e1,this.e2,this.e3,this.lat2),this.ns=(this.ms1-this.ms2)/(this.ml2-this.ml1)),this.g=this.ml1+this.ms1/this.ns,this.ml0=Be(this.e0,this.e1,this.e2,this.e3,this.lat0),this.rh=this.a*(this.g-this.ml0));},forward:function(t){var e,r=t.x,i=t.y;if(this.sphere)e=this.a*(this.g-i);else {var n=Be(this.e0,this.e1,this.e2,this.e3,i);e=this.a*(this.g-n);}var a=this.ns*bt(r-this.long0),s=this.x0+e*Math.sin(a),o=this.y0+this.rh-e*Math.cos(a);return t.x=s,t.y=o,t},inverse:function(t){var e,r,i,n;t.x-=this.x0,t.y=this.rh-t.y+this.y0,this.ns>=0?(r=Math.sqrt(t.x*t.x+t.y*t.y),e=1):(r=-Math.sqrt(t.x*t.x+t.y*t.y),e=-1);var a=0;return 0!==r&&(a=Math.atan2(e*t.x,e*t.y)),this.sphere?(n=bt(this.long0+a/this.ns),i=De(this.g-r/this.a),t.x=n,t.y=i,t):(i=Ne(this.g-r/this.a,this.e0,this.e1,this.e2,this.e3),n=bt(this.long0+a/this.ns),t.x=n,t.y=i,t)},names:["Equidistant_Conic","eqdc"]},tr={init:function(){this.R=this.a;},forward:function(t){var e,r,i=t.y,n=bt(t.x-this.long0);Math.abs(i)<=1e-10&&(e=this.x0+this.R*n,r=this.y0);var a=Ue(2*Math.abs(i/Math.PI));(Math.abs(n)<=1e-10||Math.abs(Math.abs(i)-X)<=1e-10)&&(e=this.x0,r=i>=0?this.y0+Math.PI*this.R*Math.tan(.5*a):this.y0+Math.PI*this.R*-Math.tan(.5*a));var s=.5*Math.abs(Math.PI/n-n/Math.PI),o=s*s,u=Math.sin(a),h=Math.cos(a),l=h/(u+h-1),p=l*(2/u-1),c=p*p,f=Math.PI*this.R*(s*(l-c)+Math.sqrt(o*(l-c)*(l-c)-(c+o)*(l*l-c)))/(c+o);n<0&&(f=-f),e=this.x0+f;var y=o+l;return f=Math.PI*this.R*(p*y-s*Math.sqrt((c+o)*(o+1)-y*y))/(c+o),r=i>=0?this.y0+f:this.y0-f,t.x=e,t.y=r,t},inverse:function(t){var e,r,i,n,a,s,o,u,h,l,p,c;return t.x-=this.x0,t.y-=this.y0,p=Math.PI*this.R,a=(i=t.x/p)*i+(n=t.y/p)*n,p=3*(n*n/(u=-2*(s=-Math.abs(n)*(1+a))+1+2*n*n+a*a)+(2*(o=s-2*n*n+i*i)*o*o/u/u/u-9*s*o/u/u)/27)/(h=(s-o*o/3/u)/u)/(l=2*Math.sqrt(-h/3)),Math.abs(p)>1&&(p=p>=0?1:-1),c=Math.acos(p)/3,r=t.y>=0?(-l*Math.cos(c+Math.PI/3)-o/3/u)*Math.PI:-(-l*Math.cos(c+Math.PI/3)-o/3/u)*Math.PI,e=Math.abs(i)<1e-10?this.long0:bt(this.long0+Math.PI*(a-1+Math.sqrt(1+2*(i*i-n*n)+a*a))/2/i),t.x=e,t.y=r,t},names:["Van_der_Grinten_I","VanDerGrinten","vandg"]},er={init:function(){this.sin_p12=Math.sin(this.lat0),this.cos_p12=Math.cos(this.lat0);},forward:function(t){var e,r,i,n,a,s,o,u,h,l,p,c,f,y,d,m,v,g,x,b,_,w,M=t.x,S=t.y,A=Math.sin(t.y),k=Math.cos(t.y),I=bt(M-this.long0);return this.sphere?Math.abs(this.sin_p12-1)<=1e-10?(t.x=this.x0+this.a*(X-S)*Math.sin(I),t.y=this.y0-this.a*(X-S)*Math.cos(I),t):Math.abs(this.sin_p12+1)<=1e-10?(t.x=this.x0+this.a*(X+S)*Math.sin(I),t.y=this.y0+this.a*(X+S)*Math.cos(I),t):(g=this.sin_p12*A+this.cos_p12*k*Math.cos(I),v=(m=Math.acos(g))?m/Math.sin(m):1,t.x=this.x0+this.a*v*k*Math.sin(I),t.y=this.y0+this.a*v*(this.cos_p12*A-this.sin_p12*k*Math.cos(I)),t):(e=Te(this.es),r=Ve(this.es),i=Le(this.es),n=Fe(this.es),Math.abs(this.sin_p12-1)<=1e-10?(a=this.a*Be(e,r,i,n,X),s=this.a*Be(e,r,i,n,S),t.x=this.x0+(a-s)*Math.sin(I),t.y=this.y0-(a-s)*Math.cos(I),t):Math.abs(this.sin_p12+1)<=1e-10?(a=this.a*Be(e,r,i,n,X),s=this.a*Be(e,r,i,n,S),t.x=this.x0+(a+s)*Math.sin(I),t.y=this.y0+(a+s)*Math.cos(I),t):(o=A/k,u=Oe(this.a,this.e,this.sin_p12),h=Oe(this.a,this.e,A),l=Math.atan((1-this.es)*o+this.es*u*this.sin_p12/(h*k)),x=0===(p=Math.atan2(Math.sin(I),this.cos_p12*Math.tan(l)-this.sin_p12*Math.cos(I)))?Math.asin(this.cos_p12*Math.sin(l)-this.sin_p12*Math.cos(l)):Math.abs(Math.abs(p)-Math.PI)<=1e-10?-Math.asin(this.cos_p12*Math.sin(l)-this.sin_p12*Math.cos(l)):Math.asin(Math.sin(I)*Math.cos(l)/Math.sin(p)),c=this.e*this.sin_p12/Math.sqrt(1-this.es),f=this.e*this.cos_p12*Math.cos(p)/Math.sqrt(1-this.es),t.x=this.x0+(m=u*x*(1-(b=x*x)*(d=f*f)*(1-d)/6+(_=b*x)/8*(y=c*f)*(1-2*d)+(w=_*x)/120*(d*(4-7*d)-3*c*c*(1-7*d))-w*x/48*y))*Math.sin(p),t.y=this.y0+m*Math.cos(p),t))},inverse:function(t){var e,r,i,n,a,s,o,u,h,l,p,c,f,y,d,m,v,g,x,b,_,w,M;if(t.x-=this.x0,t.y-=this.y0,this.sphere){if((e=Math.sqrt(t.x*t.x+t.y*t.y))>2*X*this.a)return;return r=e/this.a,i=Math.sin(r),n=Math.cos(r),a=this.long0,Math.abs(e)<=1e-10?s=this.lat0:(s=Ue(n*this.sin_p12+t.y*i*this.cos_p12/e),o=Math.abs(this.lat0)-X,a=Math.abs(o)<=1e-10?bt(this.lat0>=0?this.long0+Math.atan2(t.x,-t.y):this.long0-Math.atan2(-t.x,t.y)):bt(this.long0+Math.atan2(t.x*i,e*this.cos_p12*n-t.y*this.sin_p12*i))),t.x=a,t.y=s,t}return u=Te(this.es),h=Ve(this.es),l=Le(this.es),p=Fe(this.es),Math.abs(this.sin_p12-1)<=1e-10?(s=Ne(((c=this.a*Be(u,h,l,p,X))-(e=Math.sqrt(t.x*t.x+t.y*t.y)))/this.a,u,h,l,p),a=bt(this.long0+Math.atan2(t.x,-1*t.y)),t.x=a,t.y=s,t):Math.abs(this.sin_p12+1)<=1e-10?(c=this.a*Be(u,h,l,p,X),s=Ne(((e=Math.sqrt(t.x*t.x+t.y*t.y))-c)/this.a,u,h,l,p),a=bt(this.long0+Math.atan2(t.x,t.y)),t.x=a,t.y=s,t):(e=Math.sqrt(t.x*t.x+t.y*t.y),d=Math.atan2(t.x,t.y),f=Oe(this.a,this.e,this.sin_p12),m=Math.cos(d),x=3*this.es*(1-(g=-(v=this.e*this.cos_p12*m)*v/(1-this.es)))*this.sin_p12*this.cos_p12*m/(1-this.es),w=1-g*(_=(b=e/f)-g*(1+g)*Math.pow(b,3)/6-x*(1+3*g)*Math.pow(b,4)/24)*_/2-b*_*_*_/6,y=Math.asin(this.sin_p12*Math.cos(_)+this.cos_p12*Math.sin(_)*m),a=bt(this.long0+Math.asin(Math.sin(d)*Math.sin(_)/Math.cos(y))),M=Math.sin(y),s=Math.atan2((M-this.es*w*this.sin_p12)*Math.tan(y),M*(1-this.es)),t.x=a,t.y=s,t)},names:["Azimuthal_Equidistant","aeqd"]},rr={init:function(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0);},forward:function(t){var e,r,i,n,a,s,o,u=t.y;return i=bt(t.x-this.long0),e=Math.sin(u),r=Math.cos(u),n=Math.cos(i),((a=this.sin_p14*e+this.cos_p14*r*n)>0||Math.abs(a)<=1e-10)&&(s=1*this.a*r*Math.sin(i),o=this.y0+1*this.a*(this.cos_p14*e-this.sin_p14*r*n)),t.x=s,t.y=o,t},inverse:function(t){var e,r,i,n,a,s,o;return t.x-=this.x0,t.y-=this.y0,r=Ue((e=Math.sqrt(t.x*t.x+t.y*t.y))/this.a),i=Math.sin(r),n=Math.cos(r),s=this.long0,Math.abs(e)<=1e-10?(o=this.lat0,t.x=s,t.y=o,t):(o=Ue(n*this.sin_p14+t.y*i*this.cos_p14/e),a=Math.abs(this.lat0)-X,Math.abs(a)<=1e-10?(s=bt(this.lat0>=0?this.long0+Math.atan2(t.x,-t.y):this.long0-Math.atan2(-t.x,t.y)),t.x=s,t.y=o,t):(s=bt(this.long0+Math.atan2(t.x*i,e*this.cos_p14*n-t.y*this.sin_p14*i)),t.x=s,t.y=o,t))},names:["ortho"]};function ir(t,e,r,i){var n;return t<1e-10?(i.value=1,n=0):(n=Math.atan2(e,r),Math.abs(n)<=Z?i.value=1:n>Z&&n<=X+Z?(i.value=2,n-=X):n>X+Z||n<=-(X+Z)?(i.value=3,n=n>=0?n-W:n+W):(i.value=4,n+=X)),n}function nr(t,e){var r=t+e;return r<-W?r+=Y:r>+W&&(r-=Y),r}var ar={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Quadrilateralized Spherical Cube",this.face=this.lat0>=X-Z/2?5:this.lat0<=-(X-Z/2)?6:Math.abs(this.long0)<=Z?1:Math.abs(this.long0)<=X+Z?this.long0>0?2:4:3,0!==this.es&&(this.one_minus_f=1-(this.a-this.b)/this.a,this.one_minus_f_squared=this.one_minus_f*this.one_minus_f);},forward:function(t){var e,r,i,n,a,s,o={x:0,y:0},u={value:0};if(t.x-=this.long0,e=0!==this.es?Math.atan(this.one_minus_f_squared*Math.tan(t.y)):t.y,r=t.x,5===this.face)n=X-e,r>=Z&&r<=X+Z?(u.value=1,i=r-X):r>X+Z||r<=-(X+Z)?(u.value=2,i=r>0?r-W:r+W):r>-(X+Z)&&r<=-Z?(u.value=3,i=r+X):(u.value=4,i=r);else if(6===this.face)n=X+e,r>=Z&&r<=X+Z?(u.value=1,i=-r+X):r=-Z?(u.value=2,i=-r):r<-Z&&r>=-(X+Z)?(u.value=3,i=-r-X):(u.value=4,i=r>0?-r+W:-r-W);else {var h,l,p,c,f,y;2===this.face?r=nr(r,+X):3===this.face?r=nr(r,+W):4===this.face&&(r=nr(r,-X)),c=Math.sin(e),f=Math.cos(e),y=Math.sin(r),h=f*Math.cos(r),l=f*y,p=c,1===this.face?i=ir(n=Math.acos(h),p,l,u):2===this.face?i=ir(n=Math.acos(l),p,-h,u):3===this.face?i=ir(n=Math.acos(-h),p,-l,u):4===this.face?i=ir(n=Math.acos(-l),p,h,u):(n=i=0,u.value=1);}return s=Math.atan(12/W*(i+Math.acos(Math.sin(i)*Math.cos(Z))-X)),a=Math.sqrt((1-Math.cos(n))/(Math.cos(s)*Math.cos(s))/(1-Math.cos(Math.atan(1/Math.cos(i))))),2===u.value?s+=X:3===u.value?s+=W:4===u.value&&(s+=1.5*W),o.x=a*Math.cos(s),o.y=a*Math.sin(s),o.x=o.x*this.a+this.x0,o.y=o.y*this.a+this.y0,t.x=o.x,t.y=o.y,t},inverse:function(t){var e,r,i,n,a,s,o,u,h,l,p,c,f={lam:0,phi:0},y={value:0};if(t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,r=Math.atan(Math.sqrt(t.x*t.x+t.y*t.y)),e=Math.atan2(t.y,t.x),t.x>=0&&t.x>=Math.abs(t.y)?y.value=1:t.y>=0&&t.y>=Math.abs(t.x)?(y.value=2,e-=X):t.x<0&&-t.x>=Math.abs(t.y)?(y.value=3,e=e<0?e+W:e-W):(y.value=4,e+=X),h=W/12*Math.tan(e),a=Math.sin(h)/(Math.cos(h)-1/Math.sqrt(2)),s=Math.atan(a),(o=1-(i=Math.cos(e))*i*(n=Math.tan(r))*n*(1-Math.cos(Math.atan(1/Math.cos(s)))))<-1?o=-1:o>1&&(o=1),5===this.face)u=Math.acos(o),f.phi=X-u,f.lam=1===y.value?s+X:2===y.value?s<0?s+W:s-W:3===y.value?s-X:s;else if(6===this.face)u=Math.acos(o),f.phi=u-X,f.lam=1===y.value?-s+X:2===y.value?-s:3===y.value?-s-X:s<0?-s-W:-s+W;else {var d,m,v;h=(d=o)*d,m=(h+=(v=h>=1?0:Math.sqrt(1-h)*Math.sin(s))*v)>=1?0:Math.sqrt(1-h),2===y.value?(h=m,m=-v,v=h):3===y.value?(m=-m,v=-v):4===y.value&&(h=m,m=v,v=-h),2===this.face?(h=d,d=-m,m=h):3===this.face?(d=-d,m=-m):4===this.face&&(h=d,d=m,m=-h),f.phi=Math.acos(-v)-X,f.lam=Math.atan2(m,d),2===this.face?f.lam=nr(f.lam,-X):3===this.face?f.lam=nr(f.lam,-W):4===this.face&&(f.lam=nr(f.lam,+X));}return 0!==this.es&&(l=f.phi<0?1:0,p=Math.tan(f.phi),c=this.b/Math.sqrt(p*p+this.one_minus_f_squared),f.phi=Math.atan(Math.sqrt(this.a*this.a-c*c)/(this.one_minus_f*c)),l&&(f.phi=-f.phi)),f.lam+=this.long0,t.x=f.lam,t.y=f.phi,t},names:["Quadrilateralized Spherical Cube","Quadrilateralized_Spherical_Cube","qsc"]},sr=[[1,22199e-21,-715515e-10,31103e-10],[.9986,-482243e-9,-24897e-9,-13309e-10],[.9954,-83103e-8,-448605e-10,-9.86701e-7],[.99,-.00135364,-59661e-9,36777e-10],[.9822,-.00167442,-449547e-11,-572411e-11],[.973,-.00214868,-903571e-10,1.8736e-8],[.96,-.00305085,-900761e-10,164917e-11],[.9427,-.00382792,-653386e-10,-26154e-10],[.9216,-.00467746,-10457e-8,481243e-11],[.8962,-.00536223,-323831e-10,-543432e-11],[.8679,-.00609363,-113898e-9,332484e-11],[.835,-.00698325,-640253e-10,9.34959e-7],[.7986,-.00755338,-500009e-10,9.35324e-7],[.7597,-.00798324,-35971e-9,-227626e-11],[.7186,-.00851367,-701149e-10,-86303e-10],[.6732,-.00986209,-199569e-9,191974e-10],[.6213,-.010418,883923e-10,624051e-11],[.5722,-.00906601,182e-6,624051e-11],[.5322,-.00677797,275608e-9,624051e-11]],or=[[-520417e-23,.0124,121431e-23,-845284e-16],[.062,.0124,-1.26793e-9,4.22642e-10],[.124,.0124,5.07171e-9,-1.60604e-9],[.186,.0123999,-1.90189e-8,6.00152e-9],[.248,.0124002,7.10039e-8,-2.24e-8],[.31,.0123992,-2.64997e-7,8.35986e-8],[.372,.0124029,9.88983e-7,-3.11994e-7],[.434,.0123893,-369093e-11,-4.35621e-7],[.4958,.0123198,-102252e-10,-3.45523e-7],[.5571,.0121916,-154081e-10,-5.82288e-7],[.6176,.0119938,-241424e-10,-5.25327e-7],[.6769,.011713,-320223e-10,-5.16405e-7],[.7346,.0113541,-397684e-10,-6.09052e-7],[.7903,.0109107,-489042e-10,-104739e-11],[.8435,.0103431,-64615e-9,-1.40374e-9],[.8936,.00969686,-64636e-9,-8547e-9],[.9394,.00840947,-192841e-9,-42106e-10],[.9761,.00616527,-256e-6,-42106e-10],[1,.00328947,-319159e-9,-42106e-10]],ur=function(t,e){return t[0]+e*(t[1]+e*(t[2]+e*t[3]))},hr={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.long0=this.long0||0,this.es=0,this.title=this.title||"Robinson";},forward:function(t){var e=bt(t.x-this.long0),r=Math.abs(t.y),i=Math.floor(11.459155902616464*r);i<0?i=0:i>=18&&(i=17);var n={x:ur(sr[i],r=J*(r-.08726646259971647*i))*e,y:ur(or[i],r)};return t.y<0&&(n.y=-n.y),n.x=n.x*this.a*.8487+this.x0,n.y=n.y*this.a*1.3523+this.y0,n},inverse:function(t){var e={x:(t.x-this.x0)/(.8487*this.a),y:Math.abs(t.y-this.y0)/(1.3523*this.a)};if(e.y>=1)e.x/=sr[18][0],e.y=t.y<0?-X:X;else {var r=Math.floor(18*e.y);for(r<0?r=0:r>=18&&(r=17);;)if(or[r][0]>e.y)--r;else {if(!(or[r+1][0]<=e.y))break;++r;}var i=or[r],n=5*(e.y-i[0])/(or[r+1][0]-i[0]);n=function(t,e,r,i){for(var n=e;i;--i){var a=t(n);if(n-=a,Math.abs(a)<1e-10)break}return n}((function(t){return (ur(i,t)-e.y)/function(t,e){return t[1]+e*(2*t[2]+3*e*t[3])}(i,t)}),n,0,100),e.x/=ur(sr[r],n),e.y=(5*r+n)*H,t.y<0&&(e.y=-e.y);}return e.x=bt(e.x+this.long0),e},names:["Robinson","robin"]},lr={init:function(){this.name="geocent";},forward:function(t){return Rt(t,this.es,this.a)},inverse:function(t){return qt(t,this.es,this.a,this.b)},names:["Geocentric","geocentric","geocent","Geocent"]},pr={h:{def:1e5,num:!0},azi:{def:0,num:!0,degrees:!0},tilt:{def:0,num:!0,degrees:!0},long0:{def:0,num:!0},lat0:{def:0,num:!0}},cr={init:function(){if(Object.keys(pr).forEach(function(t){if(void 0===this[t])this[t]=pr[t].def;else {if(pr[t].num&&isNaN(this[t]))throw new Error("Invalid parameter value, must be numeric "+t+" = "+this[t]);pr[t].num&&(this[t]=parseFloat(this[t]));}pr[t].degrees&&(this[t]=this[t]*H);}.bind(this)),Math.abs(Math.abs(this.lat0)-X)<1e-10?this.mode=this.lat0<0?1:0:Math.abs(this.lat0)<1e-10?this.mode=2:(this.mode=3,this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0)),this.pn1=this.h/this.a,this.pn1<=0||this.pn1>1e10)throw new Error("Invalid height");this.p=1+this.pn1,this.rp=1/this.p,this.h1=1/this.pn1,this.pfact=(this.p+1)*this.h1,this.es=0;var t=this.tilt,e=this.azi;this.cg=Math.cos(e),this.sg=Math.sin(e),this.cw=Math.cos(t),this.sw=Math.sin(t);},forward:function(t){t.x-=this.long0;var e,r,i,n,a=Math.sin(t.y),s=Math.cos(t.y),o=Math.cos(t.x);switch(this.mode){case 3:r=this.sinph0*a+this.cosph0*s*o;break;case 2:r=s*o;break;case 1:r=-a;break;case 0:r=a;}switch(e=(r=this.pn1/(this.p-r))*s*Math.sin(t.x),this.mode){case 3:r*=this.cosph0*a-this.sinph0*s*o;break;case 2:r*=a;break;case 0:r*=-s*o;break;case 1:r*=s*o;}return e=(e*this.cg-r*this.sg)*this.cw*(n=1/((i=r*this.cg+e*this.sg)*this.sw*this.h1+this.cw)),r=i*n,t.x=e*this.a,t.y=r*this.a,t},inverse:function(t){t.x/=this.a,t.y/=this.a;var e,r,i,n={x:t.x,y:t.y};t.x=(e=this.pn1*t.x*(i=1/(this.pn1-t.y*this.sw)))*this.cg+(r=this.pn1*t.y*this.cw*i)*this.sg,t.y=r*this.cg-e*this.sg;var a=xe(t.x,t.y);if(Math.abs(a)<1e-10)n.x=0,n.y=t.y;else {var s,o;switch(o=1-a*a*this.pfact,o=(this.p-Math.sqrt(o))/(this.pn1/a+a/this.pn1),s=Math.sqrt(1-o*o),this.mode){case 3:n.y=Math.asin(s*this.sinph0+t.y*o*this.cosph0/a),t.y=(s-this.sinph0*Math.sin(n.y))*a,t.x*=o*this.cosph0;break;case 2:n.y=Math.asin(t.y*o/a),t.y=s*a,t.x*=o;break;case 0:n.y=Math.asin(s),t.y=-t.y;break;case 1:n.y=-Math.asin(s);}n.x=Math.atan2(t.x,t.y);}return t.x=n.x+this.long0,t.y=n.y,t},names:["Tilted_Perspective","tpers"]},fr={init:function(){if(this.flip_axis="x"===this.sweep?1:0,this.h=Number(this.h),this.radius_g_1=this.h/this.a,this.radius_g_1<=0||this.radius_g_1>1e10)throw new Error;if(this.radius_g=1+this.radius_g_1,this.C=this.radius_g*this.radius_g-1,0!==this.es){var t=1-this.es,e=1/t;this.radius_p=Math.sqrt(t),this.radius_p2=t,this.radius_p_inv2=e,this.shape="ellipse";}else this.radius_p=1,this.radius_p2=1,this.radius_p_inv2=1,this.shape="sphere";this.title||(this.title="Geostationary Satellite View");},forward:function(t){var e,r,i,n,a=t.x,s=t.y;if(a-=this.long0,"ellipse"===this.shape){s=Math.atan(this.radius_p2*Math.tan(s));var o=this.radius_p/xe(this.radius_p*Math.cos(s),Math.sin(s));if(r=o*Math.cos(a)*Math.cos(s),i=o*Math.sin(a)*Math.cos(s),n=o*Math.sin(s),(this.radius_g-r)*r-i*i-n*n*this.radius_p_inv2<0)return t.x=Number.NaN,t.y=Number.NaN,t;e=this.radius_g-r,this.flip_axis?(t.x=this.radius_g_1*Math.atan(i/xe(n,e)),t.y=this.radius_g_1*Math.atan(n/e)):(t.x=this.radius_g_1*Math.atan(i/e),t.y=this.radius_g_1*Math.atan(n/xe(i,e)));}else "sphere"===this.shape&&(e=Math.cos(s),r=Math.cos(a)*e,i=Math.sin(a)*e,n=Math.sin(s),e=this.radius_g-r,this.flip_axis?(t.x=this.radius_g_1*Math.atan(i/xe(n,e)),t.y=this.radius_g_1*Math.atan(n/e)):(t.x=this.radius_g_1*Math.atan(i/e),t.y=this.radius_g_1*Math.atan(n/xe(i,e))));return t.x=t.x*this.a,t.y=t.y*this.a,t},inverse:function(t){var e,r,i,n,a=-1,s=0,o=0;if(t.x=t.x/this.a,t.y=t.y/this.a,"ellipse"===this.shape){this.flip_axis?(o=Math.tan(t.y/this.radius_g_1),s=Math.tan(t.x/this.radius_g_1)*xe(1,o)):(s=Math.tan(t.x/this.radius_g_1),o=Math.tan(t.y/this.radius_g_1)*xe(1,s));var u=o/this.radius_p;if((i=(r=2*this.radius_g*a)*r-4*(e=s*s+u*u+a*a)*this.C)<0)return t.x=Number.NaN,t.y=Number.NaN,t;n=(-r-Math.sqrt(i))/(2*e),a=this.radius_g+n*a,s*=n,o*=n,t.x=Math.atan2(s,a),t.y=Math.atan(o*Math.cos(t.x)/a),t.y=Math.atan(this.radius_p_inv2*Math.tan(t.y));}else if("sphere"===this.shape){if(this.flip_axis?(o=Math.tan(t.y/this.radius_g_1),s=Math.tan(t.x/this.radius_g_1)*Math.sqrt(1+o*o)):(s=Math.tan(t.x/this.radius_g_1),o=Math.tan(t.y/this.radius_g_1)*Math.sqrt(1+s*s)),(i=(r=2*this.radius_g*a)*r-4*(e=s*s+o*o+a*a)*this.C)<0)return t.x=Number.NaN,t.y=Number.NaN,t;n=(-r-Math.sqrt(i))/(2*e),a=this.radius_g+n*a,s*=n,o*=n,t.x=Math.atan2(s,a),t.y=Math.atan(o*Math.cos(t.x)/a);}return t.x=t.x+this.long0,t},names:["Geostationary Satellite View","Geostationary_Satellite","geos"]};$t.defaultDatum="WGS84",$t.Proj=Nt,$t.WGS84=new $t.Proj("WGS84"),$t.Point=ce,$t.toPoint=Ht,$t.defs=ft,$t.nadgrid=function(t,e){var r=new DataView(e),i=function(t){var e=t.getInt32(8,!1);return 11!==e&&(11!==(e=t.getInt32(8,!0))&&console.warn("Failed to detect nadgrid endian-ness, defaulting to little-endian"),!0)}(r),n=function(t,e){return {nFields:t.getInt32(8,e),nSubgridFields:t.getInt32(24,e),nSubgrids:t.getInt32(40,e),shiftType:Lt(t,56,64).trim(),fromSemiMajorAxis:t.getFloat64(120,e),fromSemiMinorAxis:t.getFloat64(136,e),toSemiMajorAxis:t.getFloat64(152,e),toSemiMinorAxis:t.getFloat64(168,e)}}(r,i);n.nSubgrids>1&&console.log("Only single NTv2 subgrids are currently supported, subsequent sub grids are ignored");var a={header:n,subgrids:function(t,e,r){for(var i=[],n=0;nthis._skuTokenExpiresAt},yr.prototype.transformRequest=function(t,e){return this._transformRequestFn&&this._transformRequestFn(t,e)||{url:t}},yr.prototype.normalizeStyleURL=function(t,e){if(!dr(t))return t;var r=xr(t);return r.path="/styles/v1"+r.path,this._makeAPIURL(r,this._customAccessToken||e)},yr.prototype.normalizeGlyphsURL=function(t,e){if(!dr(t))return t;var r=xr(t);return r.path="/fonts/v1"+r.path,this._makeAPIURL(r,this._customAccessToken||e)},yr.prototype.normalizeSourceURL=function(t,e){if(!dr(t))return t;var r=xr(t);return r.path="/v4/"+r.authority+".json",r.params.push("secure"),this._makeAPIURL(r,this._customAccessToken||e)},yr.prototype.normalizeSpriteURL=function(t,e,r,i){var n=xr(t);return n&&!n.protocol&&n.path?(n.path+=""+e+r,n.path):dr(t)?(n.path="/styles/v1"+n.path+"/sprite"+e+r,this._makeAPIURL(n,this._customAccessToken||i)):(n.path+=""+e+r,br(n))},yr.prototype.normalizeTileURL=function(t,e){if(this._isSkuTokenExpired()&&this._createSkuToken(),t&&!dr(t))return t;var r=xr(t);r.path=r.path.replace(/(\.(png|jpg)\d*)(?=$)/,(D.devicePixelRatio>=2||512===e?"@2x":"")+(R.supported?".webp":"$1")),r.path=r.path.replace(/^.+\/v4\//,"/"),r.path="/v4"+r.path;var i=this._customAccessToken||function(t){for(var e=0,r=t;e=1&&s.localStorage.setItem(e,JSON.stringify(this.eventData));}catch(t){M("Unable to write to LocalStorage");}},wr.prototype.processRequests=function(t){},wr.prototype.postEvent=function(t,e,r,i){var n=this;if(N.EVENTS_URL){var a=xr(N.EVENTS_URL);a.params.push("access_token="+(i||N.ACCESS_TOKEN||""));var s={event:this.type,created:new Date(t).toISOString(),sdkIdentifier:"mapbox-gl-js",sdkVersion:"1.12.1",skuId:G,userId:this.anonId},o=e?c(s,e):s,u={url:br(a),headers:{"Content-Type":"text/plain"},body:JSON.stringify([o])};this.pendingRequest=Gr(u,(function(t){n.pendingRequest=null,r(t),n.saveEventData(),n.processRequests(i);}));}},wr.prototype.queueRequest=function(t,e){this.queue.push(t),this.processRequests(e);};var Mr,Sr,Ar=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)).constructor=e,e.prototype.postMapLoadEvent=function(t,e,r,i){this.skuToken=r,(N.EVENTS_URL&&i||N.ACCESS_TOKEN&&Array.isArray(t)&&t.some((function(t){return dr(t)||vr(t)})))&&this.queueRequest({id:e,timestamp:Date.now()},i);},e.prototype.processRequests=function(t){var e=this;if(!this.pendingRequest&&0!==this.queue.length){var r=this.queue.shift(),i=r.id,n=r.timestamp;i&&this.success[i]||(this.anonId||this.fetchEventData(),m(this.anonId)||(this.anonId=d()),this.postEvent(n,{skuToken:this.skuToken},(function(t){t||i&&(e.success[i]=!0);}),t));}},e}(wr),kr=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)).constructor=e,e.prototype.postTurnstileEvent=function(t,e){N.EVENTS_URL&&N.ACCESS_TOKEN&&Array.isArray(t)&&t.some((function(t){return dr(t)||vr(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=_r(N.ACCESS_TOKEN),i=r?r.u:N.ACCESS_TOKEN,n=i!==this.eventData.tokenU;m(this.anonId)||(this.anonId=d(),n=!0);var a=this.queue.shift();if(this.eventData.lastSuccess){var s=new Date(this.eventData.lastSuccess),o=new Date(a),u=(a-this.eventData.lastSuccess)/864e5;n=n||u>=1||u<-1||s.getDate()!==o.getDate();}else n=!0;if(!n)return this.processRequests();this.postEvent(a,{"enabled.telemetry":!1},(function(t){t||(e.eventData.lastSuccess=a,e.eventData.tokenU=i);}),t);}},e}(wr)),Ir=kr.postTurnstileEvent.bind(kr),zr=new Ar,Cr=zr.postMapLoadEvent.bind(zr),Er=500,Pr=50;function Br(){s.caches&&!Mr&&(Mr=s.caches.open("mapbox-tiles"));}function Tr(t){var e=t.indexOf("?");return e<0?t:t.slice(0,e)}var Vr,Lr=1/0;function Fr(){return null==Vr&&(Vr=s.OffscreenCanvas&&new s.OffscreenCanvas(1,1).getContext("2d")&&"function"==typeof s.createImageBitmap),Vr}var Or={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image"};"function"==typeof Object.freeze&&Object.freeze(Or);var Dr=function(t){function e(e,r,i){401===r&&vr(i)&&(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=i,this.name=this.constructor.name,this.message=e;}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.toString=function(){return this.name+": "+this.message+" ("+this.status+"): "+this.url},e}(Error),Nr=k()?function(){return self.worker&&self.worker.referrer}:function(){return ("blob:"===s.location.protocol?s.parent:s).location.href};var Rr,qr,jr=function(t,e){if(!(/^file:/.test(r=t.url)||/^file:/.test(Nr())&&!/^\w+:/.test(r))){if(s.fetch&&s.Request&&s.AbortController&&s.Request.prototype.hasOwnProperty("signal"))return function(t,e){var r,i=new s.AbortController,n=new s.Request(t.url,{method:t.method||"GET",body:t.body,credentials:t.credentials,headers:t.headers,referrer:Nr(),signal:i.signal}),a=!1,o=!1,u=(r=n.url).indexOf("sku=")>0&&vr(r);"json"===t.type&&n.headers.set("Accept","application/json");var h=function(r,i,a){if(!o){if(r&&"SecurityError"!==r.message&&M(r),i&&a)return l(i);var h=Date.now();s.fetch(n).then((function(r){if(r.ok){var i=u?r.clone():null;return l(r,i,h)}return e(new Dr(r.statusText,r.status,t.url))})).catch((function(t){20!==t.code&&e(new Error(t.message));}));}},l=function(r,i,u){("arrayBuffer"===t.type?r.arrayBuffer():"json"===t.type?r.json():r.text()).then((function(t){o||(i&&u&&function(t,e,r){if(Br(),Mr){var i={status:e.status,statusText:e.statusText,headers:new s.Headers};e.headers.forEach((function(t,e){return i.headers.set(e,t)}));var n=I(e.headers.get("Cache-Control")||"");n["no-store"]||(n["max-age"]&&i.headers.set("Expires",new Date(r+1e3*n["max-age"]).toUTCString()),new Date(i.headers.get("Expires")).getTime()-r<42e4||function(t,e){if(void 0===Sr)try{new Response(new ReadableStream),Sr=!0;}catch(t){Sr=!1;}Sr?e(t.body):t.blob().then(e);}(e,(function(e){var r=new s.Response(e,i);Br(),Mr&&Mr.then((function(e){return e.put(Tr(t.url),r)})).catch((function(t){return M(t.message)}));})));}}(n,i,u),a=!0,e(null,t,r.headers.get("Cache-Control"),r.headers.get("Expires")));})).catch((function(t){o||e(new Error(t.message));}));};return u?function(t,e){if(Br(),!Mr)return e(null);var r=Tr(t.url);Mr.then((function(t){t.match(r).then((function(i){var n=function(t){if(!t)return !1;var e=new Date(t.headers.get("Expires")||0),r=I(t.headers.get("Cache-Control")||"");return e>Date.now()&&!r["no-cache"]}(i);t.delete(r),n&&t.put(r,i.clone()),e(null,i,n);})).catch(e);})).catch(e);}(n,h):h(null,null),{cancel:function(){o=!0,a||i.abort();}}}(t,e);if(k()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",t,e,void 0,!0)}var r;return function(t,e){var r=new s.XMLHttpRequest;for(var i in r.open(t.method||"GET",t.url,!0),"arrayBuffer"===t.type&&(r.responseType="arraybuffer"),t.headers)r.setRequestHeader(i,t.headers[i]);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 i=r.response;if("json"===t.type)try{i=JSON.parse(r.response);}catch(t){return e(t)}e(null,i,r.getResponseHeader("Cache-Control"),r.getResponseHeader("Expires"));}else e(new Dr(r.statusText,r.status,t.url));},r.send(t.body),{cancel:function(){return r.abort()}}}(t,e)},Ur=function(t,e){return jr(c(t,{type:"arrayBuffer"}),e)},Gr=function(t,e){return jr(c(t,{method:"POST"}),e)};Rr=[],qr=0;var Kr=function(t,e){if(R.supported&&(t.headers||(t.headers={}),t.headers.accept="image/webp,*/*"),qr>=N.MAX_PARALLEL_IMAGE_REQUESTS){var r={requestParameters:t,callback:e,cancelled:!1,cancel:function(){this.cancelled=!0;}};return Rr.push(r),r}qr++;var i=!1,n=function(){if(!i)for(i=!0,qr--;Rr.length&&qr=l[f+0]&&i>=l[f+1])?(s[c]=!0,a.push(h[c])):s[c]=!1;}}},Hr.prototype._forEachCell=function(t,e,r,i,n,a,s,o){for(var u=this._convertToCellCoord(t),h=this._convertToCellCoord(e),l=this._convertToCellCoord(r),p=this._convertToCellCoord(i),c=u;c<=l;c++)for(var f=h;f<=p;f++){var y=this.d*f+c;if((!o||o(this._convertFromCellCoord(c),this._convertFromCellCoord(f),this._convertFromCellCoord(c+1),this._convertFromCellCoord(f+1)))&&n.call(this,t,e,r,i,y,a,s,o))return}},Hr.prototype._convertFromCellCoord=function(t){return (t-this.padding)/this.scale},Hr.prototype._convertToCellCoord=function(t){return Math.max(0,Math.min(this.d-1,Math.floor(t*this.scale)+this.padding))},Hr.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var t=this.cells,e=3+this.cells.length+1+1,r=0,i=0;i255?255:t}function n(t){return i("%"===t[t.length-1]?parseFloat(t)/100*255:parseInt(t))}function a(t){return (e="%"===t[t.length-1]?parseFloat(t)/100:parseFloat(t))<0?0:e>1?1:e;var e;}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,o=t.replace(/ /g,"").toLowerCase();if(o in r)return r[o].slice();if("#"===o[0])return 4===o.length?(e=parseInt(o.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===o.length&&(e=parseInt(o.substr(1),16))>=0&&e<=16777215?[(16711680&e)>>16,(65280&e)>>8,255&e,1]:null;var u=o.indexOf("("),h=o.indexOf(")");if(-1!==u&&h+1===o.length){var l=o.substr(0,u),p=o.substr(u+1,h-(u+1)).split(","),c=1;switch(l){case"rgba":if(4!==p.length)return null;c=a(p.pop());case"rgb":return 3!==p.length?null:[n(p[0]),n(p[1]),n(p[2]),c];case"hsla":if(4!==p.length)return null;c=a(p.pop());case"hsl":if(3!==p.length)return null;var f=(parseFloat(p[0])%360+360)%360/360,y=a(p[1]),d=a(p[2]),m=d<=.5?d*(y+1):d+y-d*y,v=2*d-m;return [i(255*s(v,m,f+1/3)),i(255*s(v,m,f)),i(255*s(v,m,f-1/3)),c];default:return null}}return null};}catch(t){}})).parseCSSColor,Zr=function(t,e,r,i){void 0===i&&(i=1),this.r=t,this.g=e,this.b=r,this.a=i;};function Yr(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];for(var i=0,n=e;i":"value"===t.itemType.kind?"array":"array<"+e+">"}return t.kind}var pi=[$r,ti,ei,ri,ii,oi,ni,hi(ai),ui];function ci(t,e){if("error"===e.kind)return null;if("array"===t.kind){if("array"===e.kind&&(0===e.N&&"value"===e.itemType.kind||!ci(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,i=pi;r=0&&t<=255&&"number"==typeof e&&e>=0&&e<=255&&"number"==typeof r&&r>=0&&r<=255?void 0===i||"number"==typeof i&&i>=0&&i<=1?null:"Invalid rgba value ["+[t,e,r,i].join(", ")+"]: 'a' must be between 0 and 1.":"Invalid rgba value ["+("number"==typeof i?[t,e,r,i]:[t,e,r]).join(", ")+"]: 'r', 'g', and 'b' must be between 0 and 255."}function bi(t){if(null===t)return !0;if("string"==typeof t)return !0;if("boolean"==typeof t)return !0;if("number"==typeof t)return !0;if(t instanceof Zr)return !0;if(t instanceof di)return !0;if(t instanceof vi)return !0;if(t instanceof gi)return !0;if(Array.isArray(t)){for(var e=0,r=t;e2){var o=t[1];if("string"!=typeof o||!(o in Ai)||"object"===o)return e.error('The item type argument of "array" must be one of string, number, boolean',1);a=Ai[o],i++;}else a=ai;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);s=t[2],i++;}r=hi(a,s);}else r=Ai[n];for(var u=[];i1)&&e.push(i);}}return e.concat(this.args.map((function(t){return t.serialize()})))};var Ii=function(t){this.type=oi,this.sections=t;};Ii.parse=function(t,e){if(t.length<2)return e.error("Expected at least one argument.");var r=t[1];if(!Array.isArray(r)&&"object"==typeof r)return e.error("First argument must be an image or text section.");for(var i=[],n=!1,a=1;a<=t.length-1;++a){var s=t[a];if(n&&"object"==typeof s&&!Array.isArray(s)){n=!1;var o=null;if(s["font-scale"]&&!(o=e.parse(s["font-scale"],1,ti)))return null;var u=null;if(s["text-font"]&&!(u=e.parse(s["text-font"],1,hi(ei))))return null;var h=null;if(s["text-color"]&&!(h=e.parse(s["text-color"],1,ii)))return null;var l=i[i.length-1];l.scale=o,l.font=u,l.textColor=h;}else {var p=e.parse(t[a],1,ai);if(!p)return null;var c=p.type.kind;if("string"!==c&&"value"!==c&&"null"!==c&&"resolvedImage"!==c)return e.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");n=!0,i.push({content:p,scale:null,font:null,textColor:null});}}return new Ii(i)},Ii.prototype.evaluate=function(t){return new vi(this.sections.map((function(e){var r=e.content.evaluate(t);return _i(r)===ui?new mi("",r,null,null,null):new mi(wi(r),null,e.scale?e.scale.evaluate(t):null,e.font?e.font.evaluate(t).join(","):null,e.textColor?e.textColor.evaluate(t):null)})))},Ii.prototype.eachChild=function(t){for(var e=0,r=this.sections;e-1),r},zi.prototype.eachChild=function(t){t(this.input);},zi.prototype.outputDefined=function(){return !1},zi.prototype.serialize=function(){return ["image",this.input.serialize()]};var Ci={"to-boolean":ri,"to-color":ii,"to-number":ti,"to-string":ei},Ei=function(t,e){this.type=t,this.args=e;};Ei.parse=function(t,e){if(t.length<2)return e.error("Expected at least one argument.");var r=t[0];if(("to-boolean"===r||"to-string"===r)&&2!==t.length)return e.error("Expected one argument.");for(var i=Ci[r],n=[],a=1;a4?"Invalid rbga value "+JSON.stringify(e)+": expected an array containing either three or four numeric values.":xi(e[0],e[1],e[2],e[3])))return new Zr(e[0]/255,e[1]/255,e[2]/255,e[3])}throw new Si(r||"Could not parse color from value '"+("string"==typeof e?e:String(JSON.stringify(e)))+"'")}if("number"===this.type.kind){for(var s=null,o=0,u=this.args;o=e[2]||t[1]<=e[1]||t[3]>=e[3])}function Oi(t,e){var r=(180+t[0])/360,i=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t[1]*Math.PI/360)))/360,n=Math.pow(2,e.z);return [Math.round(r*n*8192),Math.round(i*n*8192)]}function Di(t,e,r){return e[1]>t[1]!=r[1]>t[1]&&t[0]<(r[0]-e[0])*(t[1]-e[1])/(r[1]-e[1])+e[0]}function Ni(t,e){for(var r,i,n,a,s,o,u,h=!1,l=0,p=e.length;l0&&o<0||s<0&&o>0}function ji(t,e,r){for(var i=0,n=r;ir[2]){var n=.5*i,a=t[0]-r[0]>n?-i:r[0]-t[0]>n?i:0;0===a&&(a=t[0]-r[2]>n?-i:r[2]-t[0]>n?i:0),t[0]+=a;}Li(e,t);}function Ji(t,e,r,i){for(var n=8192*Math.pow(2,i.z),a=[8192*i.x,8192*i.y],s=[],o=0,u=t;o=0)return !1;var r=!0;return t.eachChild((function(t){r&&!$i(t,e)&&(r=!1);})),r}Yi.parse=function(t,e){if(2!==t.length)return e.error("'within' expression requires exactly one argument, but found "+(t.length-1)+" instead.");if(bi(t[1])){var r=t[1];if("FeatureCollection"===r.type)for(var i=0;ie))throw new Si("Input is not a number.");a=s-1;}return 0}en.prototype.parse=function(t,e,r,i,n){return void 0===n&&(n={}),e?this.concat(e,r,i)._parse(t,n):this._parse(t,n)},en.prototype._parse=function(t,e){function r(t,e,r){return "assert"===r?new ki(e,[t]):"coerce"===r?new Ei(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 i=t[0];if("string"!=typeof i)return this.error("Expression name must be a string, but found "+typeof i+' instead. If you wanted a literal array, use ["literal", [...]].',0),null;var n=this.registry[i];if(n){var a=n.parse(t,this);if(!a)return null;if(this.expectedType){var s=this.expectedType,o=a.type;if("string"!==s.kind&&"number"!==s.kind&&"boolean"!==s.kind&&"object"!==s.kind&&"array"!==s.kind||"value"!==o.kind)if("color"!==s.kind&&"formatted"!==s.kind&&"resolvedImage"!==s.kind||"value"!==o.kind&&"string"!==o.kind){if(this.checkSubtype(s,o))return null}else a=r(a,s,e.typeAnnotation||"coerce");else a=r(a,s,e.typeAnnotation||"assert");}if(!(a instanceof Mi)&&"resolvedImage"!==a.type.kind&&function t(e){if(e instanceof tn)return t(e.boundExpression);if(e instanceof Ti&&"error"===e.name)return !1;if(e instanceof Vi)return !1;if(e instanceof Yi)return !1;var r=e instanceof Ei||e instanceof ki,i=!0;return e.eachChild((function(e){i=r?i&&t(e):i&&e instanceof Mi;})),!!i&&Wi(e)&&$i(e,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}(a)){var u=new Bi;try{a=new Mi(a.type,a.evaluate(u));}catch(t){return this.error(t.message),null}}return a}return this.error('Unknown expression "'+i+'". If you wanted a literal array, use ["literal", [...]].',0)}return this.error(void 0===t?"'undefined' value invalid. Use null instead.":"object"==typeof t?'Bare objects invalid. Use ["literal", {...}] instead.':"Expected an array, but found "+typeof t+" instead.")},en.prototype.concat=function(t,e,r){var i="number"==typeof t?this.path.concat(t):this.path,n=r?this.scope.concat(r):this.scope;return new en(this.registry,i,e||null,n,this.errors)},en.prototype.error=function(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];var i=""+this.key+e.map((function(t){return "["+t+"]"})).join("");this.errors.push(new Wr(i,t));},en.prototype.checkSubtype=function(t,e){var r=ci(t,e);return r&&this.error(r),r};var nn=function(t,e,r){this.type=t,this.input=e,this.labels=[],this.outputs=[];for(var i=0,n=r;i=s)return e.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',u);var l=e.parse(o,h,n);if(!l)return null;n=n||l.type,i.push([s,l]);}return new nn(n,r,i)},nn.prototype.evaluate=function(t){var e=this.labels,r=this.outputs;if(1===e.length)return r[0].evaluate(t);var i=this.input.evaluate(t);if(i<=e[0])return r[0].evaluate(t);var n=e.length;return i>=e[n-1]?r[n-1].evaluate(t):r[rn(e,i)].evaluate(t)},nn.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 sn=Object.freeze({__proto__:null,number:an,color:function(t,e,r){return new Zr(an(t.r,e.r,r),an(t.g,e.g,r),an(t.b,e.b,r),an(t.a,e.a,r))},array:function(t,e,r){return t.map((function(t,i){return an(t,e[i],r)}))}}),on=6/29*3*(6/29),un=Math.PI/180,hn=180/Math.PI;function ln(t){return t>.008856451679035631?Math.pow(t,1/3):t/on+4/29}function pn(t){return t>6/29?t*t*t:on*(t-4/29)}function cn(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function fn(t){return (t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function yn(t){var e=fn(t.r),r=fn(t.g),i=fn(t.b),n=ln((.4124564*e+.3575761*r+.1804375*i)/.95047),a=ln((.2126729*e+.7151522*r+.072175*i)/1);return {l:116*a-16,a:500*(n-a),b:200*(a-ln((.0193339*e+.119192*r+.9503041*i)/1.08883)),alpha:t.a}}function dn(t){var e=(t.l+16)/116,r=isNaN(t.a)?e:e+t.a/500,i=isNaN(t.b)?e:e-t.b/200;return e=1*pn(e),r=.95047*pn(r),i=1.08883*pn(i),new Zr(cn(3.2404542*r-1.5371385*e-.4985314*i),cn(-.969266*r+1.8760108*e+.041556*i),cn(.0556434*r-.2040259*e+1.0572252*i),t.alpha)}function mn(t,e,r){var i=e-t;return t+r*(i>180||i<-180?i-360*Math.round(i/360):i)}var vn={forward:yn,reverse:dn,interpolate:function(t,e,r){return {l:an(t.l,e.l,r),a:an(t.a,e.a,r),b:an(t.b,e.b,r),alpha:an(t.alpha,e.alpha,r)}}},gn={forward:function(t){var e=yn(t),r=e.l,i=e.a,n=e.b,a=Math.atan2(n,i)*hn;return {h:a<0?a+360:a,c:Math.sqrt(i*i+n*n),l:r,alpha:t.a}},reverse:function(t){var e=t.h*un,r=t.c;return dn({l:t.l,a:Math.cos(e)*r,b:Math.sin(e)*r,alpha:t.alpha})},interpolate:function(t,e,r){return {h:mn(t.h,e.h,r),c:an(t.c,e.c,r),l:an(t.l,e.l,r),alpha:an(t.alpha,e.alpha,r)}}},xn=Object.freeze({__proto__:null,lab:vn,hcl:gn}),bn=function(t,e,r,i,n){this.type=t,this.operator=e,this.interpolation=r,this.input=i,this.labels=[],this.outputs=[];for(var a=0,s=n;a1})))return e.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);i={name:"cubic-bezier",controlPoints:o};}if(t.length-1<4)return e.error("Expected at least 4 arguments, but found only "+(t.length-1)+".");if((t.length-1)%2!=0)return e.error("Expected an even number of arguments.");if(!(n=e.parse(n,2,ti)))return null;var u=[],h=null;"interpolate-hcl"===r||"interpolate-lab"===r?h=ii:e.expectedType&&"value"!==e.expectedType.kind&&(h=e.expectedType);for(var l=0;l=p)return e.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',f);var d=e.parse(c,y,h);if(!d)return null;h=h||d.type,u.push([p,d]);}return "number"===h.kind||"color"===h.kind||"array"===h.kind&&"number"===h.itemType.kind&&"number"==typeof h.N?new bn(h,r,i,n,u):e.error("Type "+li(h)+" is not interpolatable.")},bn.prototype.evaluate=function(t){var e=this.labels,r=this.outputs;if(1===e.length)return r[0].evaluate(t);var i=this.input.evaluate(t);if(i<=e[0])return r[0].evaluate(t);var n=e.length;if(i>=e[n-1])return r[n-1].evaluate(t);var a=rn(e,i),s=bn.interpolationFactor(this.interpolation,i,e[a],e[a+1]),o=r[a].evaluate(t),u=r[a+1].evaluate(t);return "interpolate"===this.operator?sn[this.type.kind.toLowerCase()](o,u,s):"interpolate-hcl"===this.operator?gn.reverse(gn.interpolate(gn.forward(o),gn.forward(u),s)):vn.reverse(vn.interpolate(vn.forward(o),vn.forward(u),s))},bn.prototype.eachChild=function(t){t(this.input);for(var e=0,r=this.outputs;e=r.length)throw new Si("Array index out of bounds: "+e+" > "+(r.length-1)+".");if(e!==Math.floor(e))throw new Si("Array index must be an integer, but found "+e+" instead.");return r[e]},Sn.prototype.eachChild=function(t){t(this.index),t(this.input);},Sn.prototype.outputDefined=function(){return !1},Sn.prototype.serialize=function(){return ["at",this.index.serialize(),this.input.serialize()]};var An=function(t,e){this.type=ri,this.needle=t,this.haystack=e;};An.parse=function(t,e){if(3!==t.length)return e.error("Expected 2 arguments, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1,ai),i=e.parse(t[2],2,ai);return r&&i?fi(r.type,[ri,ei,ti,$r,ai])?new An(r,i):e.error("Expected first argument to be of type boolean, string, number or null, but found "+li(r.type)+" instead"):null},An.prototype.evaluate=function(t){var e=this.needle.evaluate(t),r=this.haystack.evaluate(t);if(!r)return !1;if(!yi(e,["boolean","string","number","null"]))throw new Si("Expected first argument to be of type boolean, string, number or null, but found "+li(_i(e))+" instead.");if(!yi(r,["string","array"]))throw new Si("Expected second argument to be of type array or string, but found "+li(_i(r))+" instead.");return r.indexOf(e)>=0},An.prototype.eachChild=function(t){t(this.needle),t(this.haystack);},An.prototype.outputDefined=function(){return !0},An.prototype.serialize=function(){return ["in",this.needle.serialize(),this.haystack.serialize()]};var kn=function(t,e,r){this.type=ti,this.needle=t,this.haystack=e,this.fromIndex=r;};kn.parse=function(t,e){if(t.length<=2||t.length>=5)return e.error("Expected 3 or 4 arguments, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1,ai),i=e.parse(t[2],2,ai);if(!r||!i)return null;if(!fi(r.type,[ri,ei,ti,$r,ai]))return e.error("Expected first argument to be of type boolean, string, number or null, but found "+li(r.type)+" instead");if(4===t.length){var n=e.parse(t[3],3,ti);return n?new kn(r,i,n):null}return new kn(r,i)},kn.prototype.evaluate=function(t){var e=this.needle.evaluate(t),r=this.haystack.evaluate(t);if(!yi(e,["boolean","string","number","null"]))throw new Si("Expected first argument to be of type boolean, string, number or null, but found "+li(_i(e))+" instead.");if(!yi(r,["string","array"]))throw new Si("Expected second argument to be of type array or string, but found "+li(_i(r))+" instead.");if(this.fromIndex){var i=this.fromIndex.evaluate(t);return r.indexOf(e,i)}return r.indexOf(e)},kn.prototype.eachChild=function(t){t(this.needle),t(this.haystack),this.fromIndex&&t(this.fromIndex);},kn.prototype.outputDefined=function(){return !1},kn.prototype.serialize=function(){if(null!=this.fromIndex&&void 0!==this.fromIndex){var t=this.fromIndex.serialize();return ["index-of",this.needle.serialize(),this.haystack.serialize(),t]}return ["index-of",this.needle.serialize(),this.haystack.serialize()]};var In=function(t,e,r,i,n,a){this.inputType=t,this.type=e,this.input=r,this.cases=i,this.outputs=n,this.otherwise=a;};In.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,i;e.expectedType&&"value"!==e.expectedType.kind&&(i=e.expectedType);for(var n={},a=[],s=2;sNumber.MAX_SAFE_INTEGER)return h.error("Branch labels must be integers no larger than "+Number.MAX_SAFE_INTEGER+".");if("number"==typeof c&&Math.floor(c)!==c)return h.error("Numeric branch labels must be integer values.");if(r){if(h.checkSubtype(r,_i(c)))return null}else r=_i(c);if(void 0!==n[String(c)])return h.error("Branch labels must be unique.");n[String(c)]=a.length;}var f=e.parse(u,s,i);if(!f)return null;i=i||f.type,a.push(f);}var y=e.parse(t[1],1,ai);if(!y)return null;var d=e.parse(t[t.length-1],t.length-1,i);return d?"value"!==y.type.kind&&e.concat(1).checkSubtype(r,y.type)?null:new In(r,i,y,n,a,d):null},In.prototype.evaluate=function(t){var e=this.input.evaluate(t);return (_i(e)===this.inputType&&this.outputs[this.cases[e]]||this.otherwise).evaluate(t)},In.prototype.eachChild=function(t){t(this.input),this.outputs.forEach(t),t(this.otherwise);},In.prototype.outputDefined=function(){return this.outputs.every((function(t){return t.outputDefined()}))&&this.otherwise.outputDefined()},In.prototype.serialize=function(){for(var t=this,e=["match",this.input.serialize()],r=[],i={},n=0,a=Object.keys(this.cases).sort();n=5)return e.error("Expected 3 or 4 arguments, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1,ai),i=e.parse(t[2],2,ti);if(!r||!i)return null;if(!fi(r.type,[hi(ai),ei,ai]))return e.error("Expected first argument to be of type array or string, but found "+li(r.type)+" instead");if(4===t.length){var n=e.parse(t[3],3,ti);return n?new Cn(r.type,r,i,n):null}return new Cn(r.type,r,i)},Cn.prototype.evaluate=function(t){var e=this.input.evaluate(t),r=this.beginIndex.evaluate(t);if(!yi(e,["string","array"]))throw new Si("Expected first argument to be of type array or string, but found "+li(_i(e))+" instead.");if(this.endIndex){var i=this.endIndex.evaluate(t);return e.slice(r,i)}return e.slice(r)},Cn.prototype.eachChild=function(t){t(this.input),t(this.beginIndex),this.endIndex&&t(this.endIndex);},Cn.prototype.outputDefined=function(){return !1},Cn.prototype.serialize=function(){if(null!=this.endIndex&&void 0!==this.endIndex){var t=this.endIndex.serialize();return ["slice",this.input.serialize(),this.beginIndex.serialize(),t]}return ["slice",this.input.serialize(),this.beginIndex.serialize()]};var Tn=Bn("==",(function(t,e,r){return e===r}),Pn),Vn=Bn("!=",(function(t,e,r){return e!==r}),(function(t,e,r,i){return !Pn(0,e,r,i)})),Ln=Bn("<",(function(t,e,r){return e",(function(t,e,r){return e>r}),(function(t,e,r,i){return i.compare(e,r)>0})),On=Bn("<=",(function(t,e,r){return e<=r}),(function(t,e,r,i){return i.compare(e,r)<=0})),Dn=Bn(">=",(function(t,e,r){return e>=r}),(function(t,e,r,i){return i.compare(e,r)>=0})),Nn=function(t,e,r,i,n){this.type=ei,this.number=t,this.locale=e,this.currency=r,this.minFractionDigits=i,this.maxFractionDigits=n;};Nn.parse=function(t,e){if(3!==t.length)return e.error("Expected two arguments.");var r=e.parse(t[1],1,ti);if(!r)return null;var i=t[2];if("object"!=typeof i||Array.isArray(i))return e.error("NumberFormat options argument must be an object.");var n=null;if(i.locale&&!(n=e.parse(i.locale,1,ei)))return null;var a=null;if(i.currency&&!(a=e.parse(i.currency,1,ei)))return null;var s=null;if(i["min-fraction-digits"]&&!(s=e.parse(i["min-fraction-digits"],1,ti)))return null;var o=null;return i["max-fraction-digits"]&&!(o=e.parse(i["max-fraction-digits"],1,ti))?null:new Nn(r,n,a,s,o)},Nn.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))},Nn.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);},Nn.prototype.outputDefined=function(){return !1},Nn.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 Rn=function(t){this.type=ti,this.input=t;};Rn.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 "+li(r.type)+" instead."):new Rn(r):null},Rn.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 Si("Expected value to be of type string or array, but found "+li(_i(e))+" instead.")},Rn.prototype.eachChild=function(t){t(this.input);},Rn.prototype.outputDefined=function(){return !1},Rn.prototype.serialize=function(){var t=["length"];return this.eachChild((function(e){t.push(e.serialize());})),t};var qn={"==":Tn,"!=":Vn,">":Fn,"<":Ln,">=":Dn,"<=":On,array:ki,at:Sn,boolean:ki,case:zn,coalesce:wn,collator:Vi,format:Ii,image:zi,in:An,"index-of":kn,interpolate:bn,"interpolate-hcl":bn,"interpolate-lab":bn,length:Rn,let:Mn,literal:Mi,match:In,number:ki,"number-format":Nn,object:ki,slice:Cn,step:nn,string:ki,"to-boolean":Ei,"to-color":Ei,"to-number":Ei,"to-string":Ei,var:tn,within:Yi};function jn(t,e){var r=e[0],i=e[1],n=e[2],a=e[3];r=r.evaluate(t),i=i.evaluate(t),n=n.evaluate(t);var s=a?a.evaluate(t):1,o=xi(r,i,n,s);if(o)throw new Si(o);return new Zr(r/255*s,i/255*s,n/255*s,s)}function Un(t,e){return t in e}function Gn(t,e){var r=e[t];return void 0===r?null:r}function Kn(t){return {type:t}}function Xn(t){return {result:"success",value:t}}function Hn(t){return {result:"error",value:t}}function Jn(t){return "data-driven"===t["property-type"]||"cross-faded-data-driven"===t["property-type"]}function Zn(t){return !!t.expression&&t.expression.parameters.indexOf("zoom")>-1}function Yn(t){return !!t.expression&&t.expression.interpolated}function Wn(t){return t instanceof Number?"number":t instanceof String?"string":t instanceof Boolean?"boolean":Array.isArray(t)?"array":null===t?"null":typeof t}function Qn(t){return "object"==typeof t&&null!==t&&!Array.isArray(t)}function $n(t){return t}function ta(t,e,r){return void 0!==t?t:void 0!==e?e:void 0!==r?r:void 0}function ea(t,e,r,i,n){return ta(typeof r===n?i[r]:void 0,t.default,e.default)}function ra(t,e,r){if("number"!==Wn(r))return ta(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 n=rn(t.stops.map((function(t){return t[0]})),r);return t.stops[n][1]}function ia(t,e,r){var i=void 0!==t.base?t.base:1;if("number"!==Wn(r))return ta(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 a=rn(t.stops.map((function(t){return t[0]})),r),s=function(t,e,r,i){var n=i-r,a=t-r;return 0===n?0:1===e?a/n:(Math.pow(e,a)-1)/(Math.pow(e,n)-1)}(r,i,t.stops[a][0],t.stops[a+1][0]),o=t.stops[a][1],u=t.stops[a+1][1],h=sn[e.type]||$n;if(t.colorSpace&&"rgb"!==t.colorSpace){var l=xn[t.colorSpace];h=function(t,e){return l.reverse(l.interpolate(l.forward(t),l.forward(e),s))};}return "function"==typeof o.evaluate?{evaluate:function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];var r=o.evaluate.apply(void 0,t),i=u.evaluate.apply(void 0,t);if(void 0!==r&&void 0!==i)return h(r,i,s)}}:h(o,u,s)}function na(t,e,r){return "color"===e.type?r=Zr.parse(r):"formatted"===e.type?r=vi.fromString(r.toString()):"resolvedImage"===e.type?r=gi.fromString(r.toString()):Wn(r)===e.type||"enum"===e.type&&e.values[r]||(r=void 0),ta(r,t.default,e.default)}Ti.register(qn,{error:[{kind:"error"},[ei],function(t,e){throw new Si(e[0].evaluate(t))}],typeof:[ei,[ai],function(t,e){return li(_i(e[0].evaluate(t)))}],"to-rgba":[hi(ti,4),[ii],function(t,e){return e[0].evaluate(t).toArray()}],rgb:[ii,[ti,ti,ti],jn],rgba:[ii,[ti,ti,ti,ti],jn],has:{type:ri,overloads:[[[ei],function(t,e){return Un(e[0].evaluate(t),t.properties())}],[[ei,ni],function(t,e){var r=e[1];return Un(e[0].evaluate(t),r.evaluate(t))}]]},get:{type:ai,overloads:[[[ei],function(t,e){return Gn(e[0].evaluate(t),t.properties())}],[[ei,ni],function(t,e){var r=e[1];return Gn(e[0].evaluate(t),r.evaluate(t))}]]},"feature-state":[ai,[ei],function(t,e){return Gn(e[0].evaluate(t),t.featureState||{})}],properties:[ni,[],function(t){return t.properties()}],"geometry-type":[ei,[],function(t){return t.geometryType()}],id:[ai,[],function(t){return t.id()}],zoom:[ti,[],function(t){return t.globals.zoom}],"heatmap-density":[ti,[],function(t){return t.globals.heatmapDensity||0}],"line-progress":[ti,[],function(t){return t.globals.lineProgress||0}],accumulated:[ai,[],function(t){return void 0===t.globals.accumulated?null:t.globals.accumulated}],"+":[ti,Kn(ti),function(t,e){for(var r=0,i=0,n=e;i":[ri,[ei,ai],function(t,e){var r=e[0],i=e[1],n=t.properties()[r.value],a=i.value;return typeof n==typeof a&&n>a}],"filter-id->":[ri,[ai],function(t,e){var r=e[0],i=t.id(),n=r.value;return typeof i==typeof n&&i>n}],"filter-<=":[ri,[ei,ai],function(t,e){var r=e[0],i=e[1],n=t.properties()[r.value],a=i.value;return typeof n==typeof a&&n<=a}],"filter-id-<=":[ri,[ai],function(t,e){var r=e[0],i=t.id(),n=r.value;return typeof i==typeof n&&i<=n}],"filter->=":[ri,[ei,ai],function(t,e){var r=e[0],i=e[1],n=t.properties()[r.value],a=i.value;return typeof n==typeof a&&n>=a}],"filter-id->=":[ri,[ai],function(t,e){var r=e[0],i=t.id(),n=r.value;return typeof i==typeof n&&i>=n}],"filter-has":[ri,[ai],function(t,e){return e[0].value in t.properties()}],"filter-has-id":[ri,[],function(t){return null!==t.id()&&void 0!==t.id()}],"filter-type-in":[ri,[hi(ei)],function(t,e){return e[0].value.indexOf(t.geometryType())>=0}],"filter-id-in":[ri,[hi(ai)],function(t,e){return e[0].value.indexOf(t.id())>=0}],"filter-in-small":[ri,[ei,hi(ai)],function(t,e){var r=e[0];return e[1].value.indexOf(t.properties()[r.value])>=0}],"filter-in-large":[ri,[ei,hi(ai)],function(t,e){var r=e[0],i=e[1];return function(t,e,r,i){for(;r<=i;){var n=r+i>>1;if(e[n]===t)return !0;e[n]>t?i=n-1:r=n+1;}return !1}(t.properties()[r.value],i.value,0,i.value.length-1)}],all:{type:ri,overloads:[[[ri,ri],function(t,e){var r=e[1];return e[0].evaluate(t)&&r.evaluate(t)}],[Kn(ri),function(t,e){for(var r=0,i=e;r0&&"string"==typeof t[0]&&t[0]in qn}function oa(t,e){var r=new en(qn,[],e?function(t){var e={color:ii,string:ei,number:ti,enum:ei,boolean:ri,formatted:oi,resolvedImage:ui};return "array"===t.type?hi(e[t.value]||ai,t.length):e[t.type]}(e):void 0),i=r.parse(t,void 0,void 0,void 0,e&&"string"===e.type?{typeAnnotation:"coerce"}:void 0);return i?Xn(new aa(i,e)):Hn(r.errors)}aa.prototype.evaluateWithoutErrorHandling=function(t,e,r,i,n,a){return this._evaluator.globals=t,this._evaluator.feature=e,this._evaluator.featureState=r,this._evaluator.canonical=i,this._evaluator.availableImages=n||null,this._evaluator.formattedSection=a,this.expression.evaluate(this._evaluator)},aa.prototype.evaluate=function(t,e,r,i,n,a){this._evaluator.globals=t,this._evaluator.feature=e||null,this._evaluator.featureState=r||null,this._evaluator.canonical=i,this._evaluator.availableImages=n||null,this._evaluator.formattedSection=a||null;try{var s=this.expression.evaluate(this._evaluator);if(null==s||"number"==typeof s&&s!=s)return this._defaultValue;if(this._enumValues&&!(s in this._enumValues))throw new Si("Expected value to be one of "+Object.keys(this._enumValues).map((function(t){return JSON.stringify(t)})).join(", ")+", but found "+JSON.stringify(s)+" instead.");return s}catch(t){return this._warningHistory[t.message]||(this._warningHistory[t.message]=!0,"undefined"!=typeof console&&console.warn(t.message)),this._defaultValue}};var ua=function(t,e){this.kind=t,this._styleExpression=e,this.isStateDependent="constant"!==t&&!Qi(e.expression);};ua.prototype.evaluateWithoutErrorHandling=function(t,e,r,i,n,a){return this._styleExpression.evaluateWithoutErrorHandling(t,e,r,i,n,a)},ua.prototype.evaluate=function(t,e,r,i,n,a){return this._styleExpression.evaluate(t,e,r,i,n,a)};var ha=function(t,e,r,i){this.kind=t,this.zoomStops=r,this._styleExpression=e,this.isStateDependent="camera"!==t&&!Qi(e.expression),this.interpolationType=i;};function la(t,e){if("error"===(t=oa(t,e)).result)return t;var r=t.value.expression,i=Wi(r);if(!i&&!Jn(e))return Hn([new Wr("","data expressions not supported")]);var n=$i(r,["zoom"]);if(!n&&!Zn(e))return Hn([new Wr("","zoom expressions not supported")]);var a=function t(e){var r=null;if(e instanceof Mn)r=t(e.result);else if(e instanceof wn)for(var i=0,n=e.args;i=0)){var l=t[h];u[h]=ya[o].shallow.indexOf(h)>=0?l:xa(l,e);}t instanceof Error&&(u.message=t.message);}if(u.$name)throw new Error("$name property is reserved for worker serialization logic.");return "Object"!==o&&(u.$name=o),u}throw new Error("can't serialize object of type "+typeof t)}function ba(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||va(t)||ga(t)||ArrayBuffer.isView(t)||t instanceof ca)return t;if(Array.isArray(t))return t.map(ba);if("object"==typeof t){var e=t.$name||"Object",r=ya[e].klass;if(!r)throw new Error("can't deserialize unregistered class "+e);if(r.deserialize)return r.deserialize(t);for(var i=Object.create(r.prototype),n=0,a=Object.keys(t);n=0?o:ba(o);}}return i}throw new Error("can't deserialize object of type "+typeof t)}function _a(t,e,r,i){var n=e.width,a=e.height;if(i){if(i instanceof Uint8ClampedArray)i=new Uint8Array(i.buffer);else if(i.length!==n*a*r)throw new RangeError("mismatched image size")}else i=new Uint8Array(n*a*r);return t.width=n,t.height=a,t.data=i,t}function wa(t,e,r){var i=e.width,n=e.height;if(i!==t.width||n!==t.height){var a=_a({},{width:i,height:n},r);Ma(t,a,{x:0,y:0},{x:0,y:0},{width:Math.min(t.width,i),height:Math.min(t.height,n)},r),t.width=i,t.height=n,t.data=a.data;}}function Ma(t,e,r,i,n,a){if(0===n.width||0===n.height)return e;if(n.width>t.width||n.height>t.height||r.x>t.width-n.width||r.y>t.height-n.height)throw new RangeError("out of range source coordinates for image copy");if(n.width>e.width||n.height>e.height||i.x>e.width-n.width||i.y>e.height-n.height)throw new RangeError("out of range destination coordinates for image copy");for(var s=t.data,o=e.data,u=0;u0||this._oneTimeListeners&&this._oneTimeListeners[t]&&this._oneTimeListeners[t].length>0||this._eventedParent&&this._eventedParent.listens(t)},Ea.prototype.setEventedParent=function(t,e){return this._eventedParent=t,this._eventedParentData=e,this};var Pa={$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:"stringobject"},glyphs:{type:"stringobject"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{}},default:"mapbox"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},customprj:{type:"*"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"*"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_fill:{"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_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:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"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"}],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":{},within:{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"*",minimum:1},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"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:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}}},Ba=function(t,e,r,i){this.message=(t?t+": ":"")+r,i&&(this.identifier=i),null!=e&&e.__line__&&(this.line=e.__line__);};function Ta(t){var e=t.value;return e?[new Ba(t.key,e,"constants have been deprecated as of v8")]:[]}function Va(t){return t instanceof Number||t instanceof String||t instanceof Boolean?t.valueOf():t}function La(t){if(Array.isArray(t))return t.map(La);if(t instanceof Object&&!(t instanceof Number||t instanceof String||t instanceof Boolean)){var e={};for(var r in t)e[r]=La(t[r]);return e}return Va(t)}function Fa(t){var e=t.key,r=t.value,i=t.valueSpec||{},n=t.objectElementValidators||{},a=t.style,s=t.styleSpec,o=[],u=Wn(r);if("object"!==u)return [new Ba(e,r,"object expected, "+u+" found")];for(var h in r){var l=h.split(".")[0],p=i[l]||i["*"],c=void 0;if(n[l])c=n[l];else if(i[l])c=os;else if(n["*"])c=n["*"];else {if(!i["*"]){o.push(new Ba(e,r[h],'unknown property "'+h+'"'));continue}c=os;}o=o.concat(c({key:(e?e+".":e)+h,value:r[h],valueSpec:p,style:a,styleSpec:s,object:r,objectKey:h},r));}for(var f in i)n[f]||i[f].required&&void 0===i[f].default&&void 0===r[f]&&o.push(new Ba(e,r,'missing required property "'+f+'"'));return o}function Oa(t){var e=t.value,r=t.valueSpec,i=t.style,n=t.styleSpec,a=t.key,s=t.arrayElementValidator||os;if("array"!==Wn(e))return [new Ba(a,e,"array expected, "+Wn(e)+" found")];if(r.length&&e.length!==r.length)return [new Ba(a,e,"array length "+r.length+" expected, length "+e.length+" found")];if(r["min-length"]&&e.lengthi.maximum?[new Ba(e,r,r+" is greater than the maximum value "+i.maximum)]:[]}function Na(t){var e,r,i,n=t.valueSpec,a=Va(t.value.type),s={},o="categorical"!==a&&void 0===t.value.property,u=!o,h="array"===Wn(t.value.stops)&&"array"===Wn(t.value.stops[0])&&"object"===Wn(t.value.stops[0][0]),l=Fa({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 Ba(t.key,t.value,'identity function may not have a "stops" property')];var e=[],r=t.value;return e=e.concat(Oa({key:t.key,value:r,valueSpec:t.valueSpec,style:t.style,styleSpec:t.styleSpec,arrayElementValidator:p})),"array"===Wn(r)&&0===r.length&&e.push(new Ba(t.key,r,"array must have at least one stop")),e},default:function(t){return os({key:t.key,value:t.value,valueSpec:n,style:t.style,styleSpec:t.styleSpec})}}});return "identity"===a&&o&&l.push(new Ba(t.key,t.value,'missing required property "property"')),"identity"===a||t.value.stops||l.push(new Ba(t.key,t.value,'missing required property "stops"')),"exponential"===a&&t.valueSpec.expression&&!Yn(t.valueSpec)&&l.push(new Ba(t.key,t.value,"exponential functions not supported")),t.styleSpec.$version>=8&&(u&&!Jn(t.valueSpec)?l.push(new Ba(t.key,t.value,"property functions not supported")):o&&!Zn(t.valueSpec)&&l.push(new Ba(t.key,t.value,"zoom functions not supported"))),"categorical"!==a&&!h||void 0!==t.value.property||l.push(new Ba(t.key,t.value,'"property" property is required')),l;function p(t){var e=[],a=t.value,o=t.key;if("array"!==Wn(a))return [new Ba(o,a,"array expected, "+Wn(a)+" found")];if(2!==a.length)return [new Ba(o,a,"array length 2 expected, length "+a.length+" found")];if(h){if("object"!==Wn(a[0]))return [new Ba(o,a,"object expected, "+Wn(a[0])+" found")];if(void 0===a[0].zoom)return [new Ba(o,a,"object stop key must have zoom")];if(void 0===a[0].value)return [new Ba(o,a,"object stop key must have value")];if(i&&i>Va(a[0].zoom))return [new Ba(o,a[0].zoom,"stop zoom values must appear in ascending order")];Va(a[0].zoom)!==i&&(i=Va(a[0].zoom),r=void 0,s={}),e=e.concat(Fa({key:o+"[0]",value:a[0],valueSpec:{zoom:{}},style:t.style,styleSpec:t.styleSpec,objectElementValidators:{zoom:Da,value:c}}));}else e=e.concat(c({key:o+"[0]",value:a[0],valueSpec:{},style:t.style,styleSpec:t.styleSpec},a));return sa(La(a[1]))?e.concat([new Ba(o+"[1]",a[1],"expressions are not allowed in function stops.")]):e.concat(os({key:o+"[1]",value:a[1],valueSpec:n,style:t.style,styleSpec:t.styleSpec}))}function c(t,i){var o=Wn(t.value),u=Va(t.value),h=null!==t.value?t.value:i;if(e){if(o!==e)return [new Ba(t.key,h,o+" stop domain type must match previous stop domain type "+e)]}else e=o;if("number"!==o&&"string"!==o&&"boolean"!==o)return [new Ba(t.key,h,"stop domain value must be a number, string, or boolean")];if("number"!==o&&"categorical"!==a){var l="number expected, "+o+" found";return Jn(n)&&void 0===a&&(l+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new Ba(t.key,h,l)]}return "categorical"!==a||"number"!==o||isFinite(u)&&Math.floor(u)===u?"categorical"!==a&&"number"===o&&void 0!==r&&u=2&&"$id"!==t[1]&&"$type"!==t[1];case"in":return t.length>=3&&("string"!=typeof t[1]||Array.isArray(t[2]));case"!in":case"!has":case"none":return !1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==t.length||Array.isArray(t[1])||Array.isArray(t[2]);case"any":case"all":for(var e=0,r=t.slice(1);ee?1:0}function Xa(t){if(!t)return !0;var e,r=t[0];return t.length<=1?"any"!==r:"=="===r?Ha(t[1],t[2],"=="):"!="===r?Ya(Ha(t[1],t[2],"==")):"<"===r||">"===r||"<="===r||">="===r?Ha(t[1],t[2],r):"any"===r?(e=t.slice(1),["any"].concat(e.map(Xa))):"all"===r?["all"].concat(t.slice(1).map(Xa)):"none"===r?["all"].concat(t.slice(1).map(Xa).map(Ya)):"in"===r?Ja(t[1],t.slice(2)):"!in"===r?Ya(Ja(t[1],t.slice(2))):"has"===r?Za(t[1]):"!has"===r?Ya(Za(t[1])):"within"!==r||t}function Ha(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 Ja(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(Ka)]]:["filter-in-small",t,["literal",e]]}}function Za(t){switch(t){case"$type":return !0;case"$id":return ["filter-has-id"];default:return ["filter-has",t]}}function Ya(t){return ["!",t]}function Wa(t){return ja(La(t.value))?Ra(Yr({},t,{expressionContext:"filter",valueSpec:{value:"boolean"}})):function t(e){var r=e.value,i=e.key;if("array"!==Wn(r))return [new Ba(i,r,"array expected, "+Wn(r)+" found")];var n,a=e.styleSpec,s=[];if(r.length<1)return [new Ba(i,r,"filter array must have at least 1 element")];switch(s=s.concat(qa({key:i+"[0]",value:r[0],valueSpec:a.filter_operator,style:e.style,styleSpec:e.styleSpec})),Va(r[0])){case"<":case"<=":case">":case">=":r.length>=2&&"$type"===Va(r[1])&&s.push(new Ba(i,r,'"$type" cannot be use with operator "'+r[0]+'"'));case"==":case"!=":3!==r.length&&s.push(new Ba(i,r,'filter array for operator "'+r[0]+'" must have 3 elements'));case"in":case"!in":r.length>=2&&"string"!==(n=Wn(r[1]))&&s.push(new Ba(i+"[1]",r[1],"string expected, "+n+" found"));for(var o=2;or?(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 gs(t){for(var e=0,r=t;e=65097&&t<=65103)||vs["CJK Compatibility Ideographs"](t)||vs["CJK Compatibility"](t)||vs["CJK Radicals Supplement"](t)||vs["CJK Strokes"](t)||!(!vs["CJK Symbols and Punctuation"](t)||t>=12296&&t<=12305||t>=12308&&t<=12319||12336===t)||vs["CJK Unified Ideographs Extension A"](t)||vs["CJK Unified Ideographs"](t)||vs["Enclosed CJK Letters and Months"](t)||vs["Hangul Compatibility Jamo"](t)||vs["Hangul Jamo Extended-A"](t)||vs["Hangul Jamo Extended-B"](t)||vs["Hangul Jamo"](t)||vs["Hangul Syllables"](t)||vs.Hiragana(t)||vs["Ideographic Description Characters"](t)||vs.Kanbun(t)||vs["Kangxi Radicals"](t)||vs["Katakana Phonetic Extensions"](t)||vs.Katakana(t)&&12540!==t||!(!vs["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)||!(!vs["Small Form Variants"](t)||t>=65112&&t<=65118||t>=65123&&t<=65126)||vs["Unified Canadian Aboriginal Syllabics"](t)||vs["Unified Canadian Aboriginal Syllabics Extended"](t)||vs["Vertical Forms"](t)||vs["Yijing Hexagram Symbols"](t)||vs["Yi Syllables"](t)||vs["Yi Radicals"](t))))}function bs(t){return !(xs(t)||function(t){return !!(vs["Latin-1 Supplement"](t)&&(167===t||169===t||174===t||177===t||188===t||189===t||190===t||215===t||247===t)||vs["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)||vs["Letterlike Symbols"](t)||vs["Number Forms"](t)||vs["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)||vs["Control Pictures"](t)&&9251!==t||vs["Optical Character Recognition"](t)||vs["Enclosed Alphanumerics"](t)||vs["Geometric Shapes"](t)||vs["Miscellaneous Symbols"](t)&&!(t>=9754&&t<=9759)||vs["Miscellaneous Symbols and Arrows"](t)&&(t>=11026&&t<=11055||t>=11088&&t<=11097||t>=11192&&t<=11243)||vs["CJK Symbols and Punctuation"](t)||vs.Katakana(t)||vs["Private Use Area"](t)||vs["CJK Compatibility Forms"](t)||vs["Small Form Variants"](t)||vs["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 _s(t){return t>=1424&&t<=2303||vs["Arabic Presentation Forms-A"](t)||vs["Arabic Presentation Forms-B"](t)}function ws(t,e){return !(!e&&_s(t)||t>=2304&&t<=3583||t>=3840&&t<=4255||vs.Khmer(t))}function Ms(t){for(var e=0,r=t;e-1&&(As="error"),Ss&&Ss(t);};function zs(){Cs.fire(new za("pluginStateChange",{pluginStatus:As,pluginURL:ks}));}var Cs=new Ea,Es=function(){return As},Ps=function(){if("deferred"!==As||!ks)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");As="loading",zs(),ks&&Ur({url:ks},(function(t){t?Is(t):(As="loaded",zs());}));},Bs={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:function(){return "loaded"===As||null!=Bs.applyArabicShaping},isLoading:function(){return "loading"===As},setState:function(t){As=t.pluginStatus,ks=t.pluginURL;},isParsed:function(){return null!=Bs.applyArabicShaping&&null!=Bs.processBidirectionalText&&null!=Bs.processStyledBidirectionalText},getPluginURL:function(){return ks}},Ts=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 ms,this.transition={});};Ts.prototype.isSupportedScript=function(t){return function(t,e){for(var r=0,i=t;rthis.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:e+(1-e)*r}:{fromScale:.5,toScale:1,t:1-(1-r)*e}};var Vs=function(t,e){this.property=t,this.value=e,this.expression=function(t,e){if(Qn(t))return new pa(t,e);if(sa(t)){var r=la(t,e);if("error"===r.result)throw new Error(r.value.map((function(t){return t.key+": "+t.message})).join(", "));return r.value}var i=t;return "string"==typeof t&&"color"===e.type&&(i=Zr.parse(t)),{kind:"constant",evaluate:function(){return i}}}(void 0===e?t.specification.default:e,t.specification);};Vs.prototype.isDataDriven=function(){return "source"===this.expression.kind||"composite"===this.expression.kind},Vs.prototype.possiblyEvaluate=function(t,e,r){return this.property.possiblyEvaluate(this,t,e,r)};var Ls=function(t){this.property=t,this.value=new Vs(t,void 0);};Ls.prototype.transitioned=function(t,e){return new Os(this.property,this.value,e,c({},t.transition,this.transition),t.now)},Ls.prototype.untransitioned=function(){return new Os(this.property,this.value,null,{},0)};var Fs=function(t){this._properties=t,this._values=Object.create(t.defaultTransitionablePropertyValues);};Fs.prototype.getValue=function(t){return _(this._values[t].value.value)},Fs.prototype.setValue=function(t,e){this._values.hasOwnProperty(t)||(this._values[t]=new Ls(this._values[t].property)),this._values[t].value=new Vs(this._values[t].property,null===e?void 0:_(e));},Fs.prototype.getTransition=function(t){return _(this._values[t].transition)},Fs.prototype.setTransition=function(t,e){this._values.hasOwnProperty(t)||(this._values[t]=new Ls(this._values[t].property)),this._values[t].transition=_(e)||void 0;},Fs.prototype.serialize=function(){for(var t={},e=0,r=Object.keys(this._values);ethis.end)return this.prior=null,n;if(this.value.isDataDriven())return this.prior=null,n;if(i=1)return 1;var e=t*t,r=e*t;return 4*(t<.5?r:3*(t-e)+r-.75)}(s))}return n};var Ds=function(t){this._properties=t,this._values=Object.create(t.defaultTransitioningPropertyValues);};Ds.prototype.possiblyEvaluate=function(t,e,r){for(var i=new qs(this._properties),n=0,a=Object.keys(this._values);ni.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:r,to:e}},e.prototype.interpolate=function(t){return t},e}(Us),Ks=function(t){this.specification=t;};Ks.prototype.possiblyEvaluate=function(t,e,r,i){if(void 0!==t.value){if("constant"===t.expression.kind){var n=t.expression.evaluate(e,null,{},r,i);return this._calculate(n,n,n,e)}return this._calculate(t.expression.evaluate(new Ts(Math.floor(e.zoom-1),e)),t.expression.evaluate(new Ts(Math.floor(e.zoom),e)),t.expression.evaluate(new Ts(Math.floor(e.zoom+1),e)),e)}},Ks.prototype._calculate=function(t,e,r,i){return i.zoom>i.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:r,to:e}},Ks.prototype.interpolate=function(t){return t};var Xs=function(t){this.specification=t;};Xs.prototype.possiblyEvaluate=function(t,e,r,i){return !!t.expression.evaluate(e,null,{},r,i)},Xs.prototype.interpolate=function(){return !1};var Hs=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 i=this.defaultPropertyValues[e]=new Vs(r,void 0),n=this.defaultTransitionablePropertyValues[e]=new Ls(r);this.defaultTransitioningPropertyValues[e]=n.untransitioned(),this.defaultPossiblyEvaluatedValues[e]=i.possiblyEvaluate({});}};da("DataDrivenProperty",Us),da("DataConstantProperty",js),da("CrossFadedDataDrivenProperty",Gs),da("CrossFadedProperty",Ks),da("ColorRampProperty",Xs);var Js=function(t){function e(e,r){if(t.call(this),this.id=e.id,this.type=e.type,this._featureFilter={filter:function(){return !0},needGeometry:!1},"custom"!==e.type&&(this.metadata=(e=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 Ns(r.layout)),r.paint)){for(var i in this._transitionablePaint=new Fs(r.paint),e.paint)this.setPaintProperty(i,e.paint[i],{validate:!1});for(var n in e.layout)this.setLayoutProperty(n,e.layout[n],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new qs(r.paint);}}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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){void 0===r&&(r={}),null!=e&&this._validate(ys,"layers."+this.id+".layout."+t,t,e,r)||("visibility"!==t?this._unevaluatedLayout.setValue(t,e):this.visibility=e);},e.prototype.getPaintProperty=function(t){return g(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&&this._validate(fs,"layers."+this.id+".paint."+t,t,e,r))return !1;if(g(t,"-transition"))return this._transitionablePaint.setTransition(t.slice(0,-"-transition".length),e||void 0),!1;var i=this._transitionablePaint._values[t],n="cross-faded-data-driven"===i.property.specification["property-type"],a=i.value.isDataDriven(),s=i.value;this._transitionablePaint.setValue(t,e),this._handleSpecialPaintPropertyUpdate(t);var o=this._transitionablePaint._values[t].value;return o.isDataDriven()||a||n||this._handleOverridablePaintPropertyUpdate(t,s,o)},e.prototype._handleSpecialPaintPropertyUpdate=function(t){},e.prototype._handleOverridablePaintPropertyUpdate=function(t,e,r){return !1},e.prototype.isHidden=function(t){return !!(this.minzoom&&t=this.maxzoom)||"none"===this.visibility},e.prototype.updateTransitions=function(t){this._transitioningPaint=this._transitionablePaint.transitioned(t,this._transitioningPaint);},e.prototype.hasTransition=function(){return this._transitioningPaint.hasTransition()},e.prototype.recalculate=function(t,e){t.getCrossfadeParameters&&(this._crossfadeParameters=t.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(t,void 0,e)),this.paint=this._transitioningPaint.possiblyEvaluate(t,void 0,e);},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),b(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,i,n){return void 0===n&&(n={}),(!n||!1!==n.validate)&&ds(this,t.call(ps,{key:e,layerType:this.type,objectKey:r,value:i,styleSpec:Pa,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 Rs&&Jn(e.property.specification)&&("source"===e.value.kind||"composite"===e.value.kind)&&e.value.isStateDependent)return !0}return !1},e}(Ea),Zs={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array},Ys=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;},Ws=function(){this.isTransferred=!1,this.capacity=-1,this.resize(0);};function Qs(t,e){void 0===e&&(e=1);var r=0,i=0;return {members:t.map((function(t){var n=Zs[t.type].BYTES_PER_ELEMENT,a=r=$s(r,Math.max(e,n)),s=t.components||1;return i=Math.max(i,n),r+=n*s,{name:t.name,type:t.type,components:s,offset:a}})),size:$s(r,Math.max(i,e)),alignment:e}}function $s(t,e){return Math.ceil(t/e)*e}Ws.serialize=function(t,e){return t._trim(),e&&(t.isTransferred=!0,e.push(t.arrayBuffer)),{length:t.length,arrayBuffer:t.arrayBuffer}},Ws.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},Ws.prototype._trim=function(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews());},Ws.prototype.clear=function(){this.length=0;},Ws.prototype.resize=function(t){this.reserve(t),this.length=t;},Ws.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);}},Ws.prototype._refreshViews=function(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")};var to=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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 i=2*t;return this.int16[i+0]=e,this.int16[i+1]=r,t},e}(Ws);to.prototype.bytesPerElement=4,da("StructArrayLayout2i4",to);var eo=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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,i){var n=this.length;return this.resize(n+1),this.emplace(n,t,e,r,i)},e.prototype.emplace=function(t,e,r,i,n){var a=4*t;return this.int16[a+0]=e,this.int16[a+1]=r,this.int16[a+2]=i,this.int16[a+3]=n,t},e}(Ws);eo.prototype.bytesPerElement=8,da("StructArrayLayout4i8",eo);var ro=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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,i,n,a){var s=this.length;return this.resize(s+1),this.emplace(s,t,e,r,i,n,a)},e.prototype.emplace=function(t,e,r,i,n,a,s){var o=6*t;return this.int16[o+0]=e,this.int16[o+1]=r,this.int16[o+2]=i,this.int16[o+3]=n,this.int16[o+4]=a,this.int16[o+5]=s,t},e}(Ws);ro.prototype.bytesPerElement=12,da("StructArrayLayout2i4i12",ro);var io=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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,i,n,a){var s=this.length;return this.resize(s+1),this.emplace(s,t,e,r,i,n,a)},e.prototype.emplace=function(t,e,r,i,n,a,s){var o=4*t,u=8*t;return this.int16[o+0]=e,this.int16[o+1]=r,this.uint8[u+4]=i,this.uint8[u+5]=n,this.uint8[u+6]=a,this.uint8[u+7]=s,t},e}(Ws);io.prototype.bytesPerElement=8,da("StructArrayLayout2i4ub8",io);var no=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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 i=2*t;return this.float32[i+0]=e,this.float32[i+1]=r,t},e}(Ws);no.prototype.bytesPerElement=8,da("StructArrayLayout2f8",no);var ao=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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,i,n,a,s,o,u,h){var l=this.length;return this.resize(l+1),this.emplace(l,t,e,r,i,n,a,s,o,u,h)},e.prototype.emplace=function(t,e,r,i,n,a,s,o,u,h,l){var p=10*t;return this.uint16[p+0]=e,this.uint16[p+1]=r,this.uint16[p+2]=i,this.uint16[p+3]=n,this.uint16[p+4]=a,this.uint16[p+5]=s,this.uint16[p+6]=o,this.uint16[p+7]=u,this.uint16[p+8]=h,this.uint16[p+9]=l,t},e}(Ws);ao.prototype.bytesPerElement=20,da("StructArrayLayout10ui20",ao);var so=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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,i,n,a,s,o,u,h,l,p){var c=this.length;return this.resize(c+1),this.emplace(c,t,e,r,i,n,a,s,o,u,h,l,p)},e.prototype.emplace=function(t,e,r,i,n,a,s,o,u,h,l,p,c){var f=12*t;return this.int16[f+0]=e,this.int16[f+1]=r,this.int16[f+2]=i,this.int16[f+3]=n,this.uint16[f+4]=a,this.uint16[f+5]=s,this.uint16[f+6]=o,this.uint16[f+7]=u,this.int16[f+8]=h,this.int16[f+9]=l,this.int16[f+10]=p,this.int16[f+11]=c,t},e}(Ws);so.prototype.bytesPerElement=24,da("StructArrayLayout4i4ui4i24",so);var oo=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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 i=this.length;return this.resize(i+1),this.emplace(i,t,e,r)},e.prototype.emplace=function(t,e,r,i){var n=3*t;return this.float32[n+0]=e,this.float32[n+1]=r,this.float32[n+2]=i,t},e}(Ws);oo.prototype.bytesPerElement=12,da("StructArrayLayout3f12",oo);var uo=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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){return this.uint32[1*t+0]=e,t},e}(Ws);uo.prototype.bytesPerElement=4,da("StructArrayLayout1ul4",uo);var ho=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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,i,n,a,s,o,u){var h=this.length;return this.resize(h+1),this.emplace(h,t,e,r,i,n,a,s,o,u)},e.prototype.emplace=function(t,e,r,i,n,a,s,o,u,h){var l=10*t,p=5*t;return this.int16[l+0]=e,this.int16[l+1]=r,this.int16[l+2]=i,this.int16[l+3]=n,this.int16[l+4]=a,this.int16[l+5]=s,this.uint32[p+3]=o,this.uint16[l+8]=u,this.uint16[l+9]=h,t},e}(Ws);ho.prototype.bytesPerElement=20,da("StructArrayLayout6i1ul2ui20",ho);var lo=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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,i,n,a){var s=this.length;return this.resize(s+1),this.emplace(s,t,e,r,i,n,a)},e.prototype.emplace=function(t,e,r,i,n,a,s){var o=6*t;return this.int16[o+0]=e,this.int16[o+1]=r,this.int16[o+2]=i,this.int16[o+3]=n,this.int16[o+4]=a,this.int16[o+5]=s,t},e}(Ws);lo.prototype.bytesPerElement=12,da("StructArrayLayout2i2i2i12",lo);var po=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer);},e.prototype.emplaceBack=function(t,e,r,i,n){var a=this.length;return this.resize(a+1),this.emplace(a,t,e,r,i,n)},e.prototype.emplace=function(t,e,r,i,n,a){var s=4*t,o=8*t;return this.float32[s+0]=e,this.float32[s+1]=r,this.float32[s+2]=i,this.int16[o+6]=n,this.int16[o+7]=a,t},e}(Ws);po.prototype.bytesPerElement=16,da("StructArrayLayout2f1f2i16",po);var co=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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,i){var n=this.length;return this.resize(n+1),this.emplace(n,t,e,r,i)},e.prototype.emplace=function(t,e,r,i,n){var a=12*t,s=3*t;return this.uint8[a+0]=e,this.uint8[a+1]=r,this.float32[s+1]=i,this.float32[s+2]=n,t},e}(Ws);co.prototype.bytesPerElement=12,da("StructArrayLayout2ub2f12",co);var fo=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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 i=this.length;return this.resize(i+1),this.emplace(i,t,e,r)},e.prototype.emplace=function(t,e,r,i){var n=3*t;return this.uint16[n+0]=e,this.uint16[n+1]=r,this.uint16[n+2]=i,t},e}(Ws);fo.prototype.bytesPerElement=6,da("StructArrayLayout3ui6",fo);var yo=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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,i,n,a,s,o,u,h,l,p,c,f,y,d,m){var v=this.length;return this.resize(v+1),this.emplace(v,t,e,r,i,n,a,s,o,u,h,l,p,c,f,y,d,m)},e.prototype.emplace=function(t,e,r,i,n,a,s,o,u,h,l,p,c,f,y,d,m,v){var g=24*t,x=12*t,b=48*t;return this.int16[g+0]=e,this.int16[g+1]=r,this.uint16[g+2]=i,this.uint16[g+3]=n,this.uint32[x+2]=a,this.uint32[x+3]=s,this.uint32[x+4]=o,this.uint16[g+10]=u,this.uint16[g+11]=h,this.uint16[g+12]=l,this.float32[x+7]=p,this.float32[x+8]=c,this.uint8[b+36]=f,this.uint8[b+37]=y,this.uint8[b+38]=d,this.uint32[x+10]=m,this.int16[g+22]=v,t},e}(Ws);yo.prototype.bytesPerElement=48,da("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",yo);var mo=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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,i,n,a,s,o,u,h,l,p,c,f,y,d,m,v,g,x,b,_,w,M,S,A,k,I){var z=this.length;return this.resize(z+1),this.emplace(z,t,e,r,i,n,a,s,o,u,h,l,p,c,f,y,d,m,v,g,x,b,_,w,M,S,A,k,I)},e.prototype.emplace=function(t,e,r,i,n,a,s,o,u,h,l,p,c,f,y,d,m,v,g,x,b,_,w,M,S,A,k,I,z){var C=34*t,E=17*t;return this.int16[C+0]=e,this.int16[C+1]=r,this.int16[C+2]=i,this.int16[C+3]=n,this.int16[C+4]=a,this.int16[C+5]=s,this.int16[C+6]=o,this.int16[C+7]=u,this.uint16[C+8]=h,this.uint16[C+9]=l,this.uint16[C+10]=p,this.uint16[C+11]=c,this.uint16[C+12]=f,this.uint16[C+13]=y,this.uint16[C+14]=d,this.uint16[C+15]=m,this.uint16[C+16]=v,this.uint16[C+17]=g,this.uint16[C+18]=x,this.uint16[C+19]=b,this.uint16[C+20]=_,this.uint16[C+21]=w,this.uint16[C+22]=M,this.uint32[E+12]=S,this.float32[E+13]=A,this.float32[E+14]=k,this.float32[E+15]=I,this.float32[E+16]=z,t},e}(Ws);mo.prototype.bytesPerElement=68,da("StructArrayLayout8i15ui1ul4f68",mo);var vo=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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){return this.float32[1*t+0]=e,t},e}(Ws);vo.prototype.bytesPerElement=4,da("StructArrayLayout1f4",vo);var go=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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 i=this.length;return this.resize(i+1),this.emplace(i,t,e,r)},e.prototype.emplace=function(t,e,r,i){var n=3*t;return this.int16[n+0]=e,this.int16[n+1]=r,this.int16[n+2]=i,t},e}(Ws);go.prototype.bytesPerElement=6,da("StructArrayLayout3i6",go);var xo=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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 i=this.length;return this.resize(i+1),this.emplace(i,t,e,r)},e.prototype.emplace=function(t,e,r,i){var n=4*t;return this.uint32[2*t+0]=e,this.uint16[n+2]=r,this.uint16[n+3]=i,t},e}(Ws);xo.prototype.bytesPerElement=8,da("StructArrayLayout1ul2ui8",xo);var bo=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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 i=2*t;return this.uint16[i+0]=e,this.uint16[i+1]=r,t},e}(Ws);bo.prototype.bytesPerElement=4,da("StructArrayLayout2ui4",bo);var _o=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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){return this.uint16[1*t+0]=e,t},e}(Ws);_o.prototype.bytesPerElement=2,da("StructArrayLayout1ui2",_o);var wo=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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,i){var n=this.length;return this.resize(n+1),this.emplace(n,t,e,r,i)},e.prototype.emplace=function(t,e,r,i,n){var a=4*t;return this.float32[a+0]=e,this.float32[a+1]=r,this.float32[a+2]=i,this.float32[a+3]=n,t},e}(Ws);wo.prototype.bytesPerElement=16,da("StructArrayLayout4f16",wo);var Mo=function(t){function e(){t.apply(this,arguments);}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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},anchorPoint:{configurable:!0}};return r.anchorPointX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorPointY.get=function(){return this._structArray.int16[this._pos2+1]},r.x1.get=function(){return this._structArray.int16[this._pos2+2]},r.y1.get=function(){return this._structArray.int16[this._pos2+3]},r.x2.get=function(){return this._structArray.int16[this._pos2+4]},r.y2.get=function(){return this._structArray.int16[this._pos2+5]},r.featureIndex.get=function(){return this._structArray.uint32[this._pos4+3]},r.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+8]},r.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+9]},r.anchorPoint.get=function(){return new n(this.anchorPointX,this.anchorPointY)},Object.defineProperties(e.prototype,r),e}(Ys);Mo.prototype.size=20;var So=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.get=function(t){return new Mo(this,t)},e}(ho);da("CollisionBoxArray",So);var Ao=function(t){function e(){t.apply(this,arguments);}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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},associatedIconIndex:{configurable:!0}};return r.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},r.glyphStartIndex.get=function(){return this._structArray.uint16[this._pos2+2]},r.numGlyphs.get=function(){return this._structArray.uint16[this._pos2+3]},r.vertexStartIndex.get=function(){return this._structArray.uint32[this._pos4+2]},r.lineStartIndex.get=function(){return this._structArray.uint32[this._pos4+3]},r.lineLength.get=function(){return this._structArray.uint32[this._pos4+4]},r.segment.get=function(){return this._structArray.uint16[this._pos2+10]},r.lowerSize.get=function(){return this._structArray.uint16[this._pos2+11]},r.upperSize.get=function(){return this._structArray.uint16[this._pos2+12]},r.lineOffsetX.get=function(){return this._structArray.float32[this._pos4+7]},r.lineOffsetY.get=function(){return this._structArray.float32[this._pos4+8]},r.writingMode.get=function(){return this._structArray.uint8[this._pos1+36]},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;},r.associatedIconIndex.get=function(){return this._structArray.int16[this._pos2+22]},Object.defineProperties(e.prototype,r),e}(Ys);Ao.prototype.size=48;var ko=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.get=function(t){return new Ao(this,t)},e}(yo);da("PlacedSymbolArray",ko);var Io=function(t){function e(){t.apply(this,arguments);}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var r={anchorX:{configurable:!0},anchorY:{configurable:!0},rightJustifiedTextSymbolIndex:{configurable:!0},centerJustifiedTextSymbolIndex:{configurable:!0},leftJustifiedTextSymbolIndex:{configurable:!0},verticalPlacedTextSymbolIndex:{configurable:!0},placedIconSymbolIndex:{configurable:!0},verticalPlacedIconSymbolIndex:{configurable:!0},key:{configurable:!0},textBoxStartIndex:{configurable:!0},textBoxEndIndex:{configurable:!0},verticalTextBoxStartIndex:{configurable:!0},verticalTextBoxEndIndex:{configurable:!0},iconBoxStartIndex:{configurable:!0},iconBoxEndIndex:{configurable:!0},verticalIconBoxStartIndex:{configurable:!0},verticalIconBoxEndIndex:{configurable:!0},featureIndex:{configurable:!0},numHorizontalGlyphVertices:{configurable:!0},numVerticalGlyphVertices:{configurable:!0},numIconVertices:{configurable:!0},numVerticalIconVertices:{configurable:!0},useRuntimeCollisionCircles:{configurable:!0},crossTileID:{configurable:!0},textBoxScale:{configurable:!0},textOffset0:{configurable:!0},textOffset1:{configurable:!0},collisionCircleDiameter:{configurable:!0}};return r.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},r.rightJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+2]},r.centerJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+3]},r.leftJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+4]},r.verticalPlacedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+5]},r.placedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+6]},r.verticalPlacedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+7]},r.key.get=function(){return this._structArray.uint16[this._pos2+8]},r.textBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+9]},r.textBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+10]},r.verticalTextBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+11]},r.verticalTextBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+12]},r.iconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+13]},r.iconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+14]},r.verticalIconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+15]},r.verticalIconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+16]},r.featureIndex.get=function(){return this._structArray.uint16[this._pos2+17]},r.numHorizontalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+18]},r.numVerticalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+19]},r.numIconVertices.get=function(){return this._structArray.uint16[this._pos2+20]},r.numVerticalIconVertices.get=function(){return this._structArray.uint16[this._pos2+21]},r.useRuntimeCollisionCircles.get=function(){return this._structArray.uint16[this._pos2+22]},r.crossTileID.get=function(){return this._structArray.uint32[this._pos4+12]},r.crossTileID.set=function(t){this._structArray.uint32[this._pos4+12]=t;},r.textBoxScale.get=function(){return this._structArray.float32[this._pos4+13]},r.textOffset0.get=function(){return this._structArray.float32[this._pos4+14]},r.textOffset1.get=function(){return this._structArray.float32[this._pos4+15]},r.collisionCircleDiameter.get=function(){return this._structArray.float32[this._pos4+16]},Object.defineProperties(e.prototype,r),e}(Ys);Io.prototype.size=68;var zo=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.get=function(t){return new Io(this,t)},e}(mo);da("SymbolInstanceArray",zo);var Co=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getoffsetX=function(t){return this.float32[1*t+0]},e}(vo);da("GlyphOffsetArray",Co);var Eo=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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}(go);da("SymbolLineVertexArray",Eo);var Po=function(t){function e(){t.apply(this,arguments);}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.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.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+2]},r.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+3]},Object.defineProperties(e.prototype,r),e}(Ys);Po.prototype.size=8;var Bo=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.get=function(t){return new Po(this,t)},e}(xo);da("FeatureIndexArray",Bo);var To=Qs([{name:"a_pos",components:2,type:"Int16"}],4).members,Vo=function(t){void 0===t&&(t=[]),this.segments=t;};function Lo(t,e){return 256*(t=l(Math.floor(t),0,255))+l(Math.floor(e),0,255)}Vo.prototype.prepareSegment=function(t,e,r,i){var n=this.segments[this.segments.length-1];return t>Vo.MAX_VERTEX_ARRAY_LENGTH&&M("Max vertices per segment is "+Vo.MAX_VERTEX_ARRAY_LENGTH+": bucket requested "+t),(!n||n.vertexLength+t>Vo.MAX_VERTEX_ARRAY_LENGTH||n.sortKey!==i)&&(n={vertexOffset:e.length,primitiveOffset:r.length,vertexLength:0,primitiveLength:0},void 0!==i&&(n.sortKey=i),this.segments.push(n)),n},Vo.prototype.get=function(){return this.segments},Vo.prototype.destroy=function(){for(var t=0,e=this.segments;t>>16)*s&65535)<<16)&4294967295)<<15|u>>>17))*o+(((u>>>16)*o&65535)<<16)&4294967295)<<13|n>>>19))+((5*(n>>>16)&65535)<<16)&4294967295))+((58964+(a>>>16)&65535)<<16);switch(u=0,r){case 3:u^=(255&t.charCodeAt(h+2))<<16;case 2:u^=(255&t.charCodeAt(h+1))<<8;case 1:n^=u=(65535&(u=(u=(65535&(u^=255&t.charCodeAt(h)))*s+(((u>>>16)*s&65535)<<16)&4294967295)<<15|u>>>17))*o+(((u>>>16)*o&65535)<<16)&4294967295;}return n^=t.length,n=2246822507*(65535&(n^=n>>>16))+((2246822507*(n>>>16)&65535)<<16)&4294967295,n=3266489909*(65535&(n^=n>>>13))+((3266489909*(n>>>16)&65535)<<16)&4294967295,(n^=n>>>16)>>>0};})),Do=e((function(t){t.exports=function(t,e){for(var r,i=t.length,n=e^i,a=0;i>=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),n=1540483477*(65535&n)+((1540483477*(n>>>16)&65535)<<16)^(r=1540483477*(65535&(r^=r>>>24))+((1540483477*(r>>>16)&65535)<<16)),i-=4,++a;switch(i){case 3:n^=(255&t.charCodeAt(a+2))<<16;case 2:n^=(255&t.charCodeAt(a+1))<<8;case 1:n=1540483477*(65535&(n^=255&t.charCodeAt(a)))+((1540483477*(n>>>16)&65535)<<16);}return n=1540483477*(65535&(n^=n>>>13))+((1540483477*(n>>>16)&65535)<<16),(n^=n>>>15)>>>0};})),No=Oo,Ro=Do;No.murmur3=Oo,No.murmur2=Ro;var qo=function(){this.ids=[],this.positions=[],this.indexed=!1;};qo.prototype.add=function(t,e,r,i){this.ids.push(Uo(t)),this.positions.push(e,r,i);},qo.prototype.getPositions=function(t){for(var e=Uo(t),r=0,i=this.ids.length-1;r>1;this.ids[n]>=e?i=n:r=n+1;}for(var a=[];this.ids[r]===e;)a.push({index:this.positions[3*r],start:this.positions[3*r+1],end:this.positions[3*r+2]}),r++;return a},qo.serialize=function(t,e){var r=new Float64Array(t.ids),i=new Uint32Array(t.positions);return function t(e,r,i,n){for(;i>1],s=i-1,o=n+1;;){do{s++;}while(e[s]a);if(s>=o)break;Go(e,s,o),Go(r,3*s,3*o),Go(r,3*s+1,3*o+1),Go(r,3*s+2,3*o+2);}o-is.x+1||us.y+1)&&M("Geometry exceeds allowed extent, reduce your vector tile buffer size");}return r}function fu(t,e,r,i,n){t.emplaceBack(2*e+(i+1)/2,2*r+(n+1)/2);}var yu=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 to,this.indexArray=new fo,this.segments=new Vo,this.programConfigurations=new ou(t.layers,t.zoom),this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}));};function du(t,e){for(var r=0;r1){if(xu(t,e))return !0;for(var i=0;i1?r:r.sub(e)._mult(n)._add(e))}function Mu(t,e){for(var r,i,n,a=!1,s=0;se.y!=(n=r[u]).y>e.y&&e.x<(n.x-i.x)*(e.y-i.y)/(n.y-i.y)+i.x&&(a=!a);return a}function Su(t,e){for(var r=!1,i=0,n=t.length-1;ie.y!=s.y>e.y&&e.x<(s.x-a.x)*(e.y-a.y)/(s.y-a.y)+a.x&&(r=!r);}return r}function Au(t,e,r){var i=r[0],n=r[2];if(t.xn.x&&e.x>n.x||t.yn.y&&e.y>n.y)return !1;var a=S(t,e,r[0]);return a!==S(t,e,r[1])||a!==S(t,e,r[2])||a!==S(t,e,r[3])}function ku(t,e,r){var i=e.paint.get(t).value;return "constant"===i.kind?i.value:r.programConfigurations.get(e.id).getMaxValue(t)}function Iu(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function zu(t,e,r,i,a){if(!e[0]&&!e[1])return t;var s=n.convert(e)._mult(a);"viewport"===r&&s._rotate(-i);for(var o=[],u=0;u=8192||l<0||l>=8192)){var p=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,t.sortKey),c=p.vertexLength;fu(this.layoutVertexArray,h,l,-1,-1),fu(this.layoutVertexArray,h,l,1,-1),fu(this.layoutVertexArray,h,l,1,1),fu(this.layoutVertexArray,h,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,{},i);},da("CircleBucket",yu,{omit:["layers"]});var Cu=new Hs({"circle-sort-key":new Us(Pa.layout_circle["circle-sort-key"])}),Eu={paint:new Hs({"circle-radius":new Us(Pa.paint_circle["circle-radius"]),"circle-color":new Us(Pa.paint_circle["circle-color"]),"circle-blur":new Us(Pa.paint_circle["circle-blur"]),"circle-opacity":new Us(Pa.paint_circle["circle-opacity"]),"circle-translate":new js(Pa.paint_circle["circle-translate"]),"circle-translate-anchor":new js(Pa.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new js(Pa.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new js(Pa.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new Us(Pa.paint_circle["circle-stroke-width"]),"circle-stroke-color":new Us(Pa.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new Us(Pa.paint_circle["circle-stroke-opacity"])}),layout:Cu},Pu="undefined"!=typeof Float32Array?Float32Array:Array;function Bu(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function Tu(t,e,r){var i=e[0],n=e[1],a=e[2],s=e[3],o=e[4],u=e[5],h=e[6],l=e[7],p=e[8],c=e[9],f=e[10],y=e[11],d=e[12],m=e[13],v=e[14],g=e[15],x=r[0],b=r[1],_=r[2],w=r[3];return t[0]=x*i+b*o+_*p+w*d,t[1]=x*n+b*u+_*c+w*m,t[2]=x*a+b*h+_*f+w*v,t[3]=x*s+b*l+_*y+w*g,t[4]=(x=r[4])*i+(b=r[5])*o+(_=r[6])*p+(w=r[7])*d,t[5]=x*n+b*u+_*c+w*m,t[6]=x*a+b*h+_*f+w*v,t[7]=x*s+b*l+_*y+w*g,t[8]=(x=r[8])*i+(b=r[9])*o+(_=r[10])*p+(w=r[11])*d,t[9]=x*n+b*u+_*c+w*m,t[10]=x*a+b*h+_*f+w*v,t[11]=x*s+b*l+_*y+w*g,t[12]=(x=r[12])*i+(b=r[13])*o+(_=r[14])*p+(w=r[15])*d,t[13]=x*n+b*u+_*c+w*m,t[14]=x*a+b*h+_*f+w*v,t[15]=x*s+b*l+_*y+w*g,t}Math.hypot||(Math.hypot=function(){for(var t=arguments,e=0,r=arguments.length;r--;)e+=t[r]*t[r];return Math.sqrt(e)});var Vu,Lu=Tu;function Fu(t,e,r){var i=e[0],n=e[1],a=e[2],s=e[3];return t[0]=r[0]*i+r[4]*n+r[8]*a+r[12]*s,t[1]=r[1]*i+r[5]*n+r[9]*a+r[13]*s,t[2]=r[2]*i+r[6]*n+r[10]*a+r[14]*s,t[3]=r[3]*i+r[7]*n+r[11]*a+r[15]*s,t}Vu=new Pu(3),Pu!=Float32Array&&(Vu[0]=0,Vu[1]=0,Vu[2]=0),function(){var t=new Pu(4);Pu!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0);}();var Ou=(function(){var t=new Pu(2);Pu!=Float32Array&&(t[0]=0,t[1]=0);}(),function(t){function e(e){t.call(this,e,Eu);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.createBucket=function(t){return new yu(t)},e.prototype.queryRadius=function(t){var e=t;return ku("circle-radius",this,e)+ku("circle-stroke-width",this,e)+Iu(this.paint.get("circle-translate"))},e.prototype.queryIntersectsFeature=function(t,e,r,i,n,a,s,o){for(var u=zu(t,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),a.angle,s),h=this.paint.get("circle-radius").evaluate(e,r)+this.paint.get("circle-stroke-width").evaluate(e,r),l="map"===this.paint.get("circle-pitch-alignment"),p=l?u:function(t,e){return t.map((function(t){return Du(t,e)}))}(u,o),c=l?h*s:h,f=0,y=i;f80*r){i=a=t[0],n=s=t[1];for(var y=r;ya&&(a=o),u>s&&(s=u);h=0!==(h=Math.max(a-i,s-n))?1/h:0;}return Wu(c,f,r,i,n,h),f}function Zu(t,e,r,i,n){var a,s;if(n===xh(t,e,r,i)>0)for(a=e;a=e;a-=i)s=mh(a,t[a],t[a+1],s);return s&&lh(s,s.next)&&(vh(s),s=s.next),s}function Yu(t,e){if(!t)return t;e||(e=t);var r,i=t;do{if(r=!1,i.steiner||!lh(i,i.next)&&0!==hh(i.prev,i,i.next))i=i.next;else {if(vh(i),(i=e=i.prev)===i.next)break;r=!0;}}while(r||i!==e);return e}function Wu(t,e,r,i,n,a,s){if(t){!s&&a&&function(t,e,r,i){var n=t;do{null===n.z&&(n.z=ah(n.x,n.y,e,r,i)),n.prevZ=n.prev,n.nextZ=n.next,n=n.next;}while(n!==t);n.prevZ.nextZ=null,n.prevZ=null,function(t){var e,r,i,n,a,s,o,u,h=1;do{for(r=t,t=null,a=null,s=0;r;){for(s++,i=r,o=0,e=0;e0||u>0&&i;)0!==o&&(0===u||!i||r.z<=i.z)?(n=r,r=r.nextZ,o--):(n=i,i=i.nextZ,u--),a?a.nextZ=n:t=n,n.prevZ=a,a=n;r=i;}a.nextZ=null,h*=2;}while(s>1)}(n);}(t,i,n,a);for(var o,u,h=t;t.prev!==t.next;)if(o=t.prev,u=t.next,a?$u(t,i,n,a):Qu(t))e.push(o.i/r),e.push(t.i/r),e.push(u.i/r),vh(t),t=u.next,h=u.next;else if((t=u)===h){s?1===s?Wu(t=th(Yu(t),e,r),e,r,i,n,a,2):2===s&&eh(t,e,r,i,n,a):Wu(Yu(t),e,r,i,n,a,1);break}}}function Qu(t){var e=t.prev,r=t,i=t.next;if(hh(e,r,i)>=0)return !1;for(var n=t.next.next;n!==t.prev;){if(oh(e.x,e.y,r.x,r.y,i.x,i.y,n.x,n.y)&&hh(n.prev,n,n.next)>=0)return !1;n=n.next;}return !0}function $u(t,e,r,i){var n=t.prev,a=t,s=t.next;if(hh(n,a,s)>=0)return !1;for(var o=n.x>a.x?n.x>s.x?n.x:s.x:a.x>s.x?a.x:s.x,u=n.y>a.y?n.y>s.y?n.y:s.y:a.y>s.y?a.y:s.y,h=ah(n.x=h&&c&&c.z<=l;){if(p!==t.prev&&p!==t.next&&oh(n.x,n.y,a.x,a.y,s.x,s.y,p.x,p.y)&&hh(p.prev,p,p.next)>=0)return !1;if(p=p.prevZ,c!==t.prev&&c!==t.next&&oh(n.x,n.y,a.x,a.y,s.x,s.y,c.x,c.y)&&hh(c.prev,c,c.next)>=0)return !1;c=c.nextZ;}for(;p&&p.z>=h;){if(p!==t.prev&&p!==t.next&&oh(n.x,n.y,a.x,a.y,s.x,s.y,p.x,p.y)&&hh(p.prev,p,p.next)>=0)return !1;p=p.prevZ;}for(;c&&c.z<=l;){if(c!==t.prev&&c!==t.next&&oh(n.x,n.y,a.x,a.y,s.x,s.y,c.x,c.y)&&hh(c.prev,c,c.next)>=0)return !1;c=c.nextZ;}return !0}function th(t,e,r){var i=t;do{var n=i.prev,a=i.next.next;!lh(n,a)&&ph(n,i,i.next,a)&&yh(n,a)&&yh(a,n)&&(e.push(n.i/r),e.push(i.i/r),e.push(a.i/r),vh(i),vh(i.next),i=t=a),i=i.next;}while(i!==t);return Yu(i)}function eh(t,e,r,i,n,a){var s=t;do{for(var o=s.next.next;o!==s.prev;){if(s.i!==o.i&&uh(s,o)){var u=dh(s,o);return s=Yu(s,s.next),u=Yu(u,u.next),Wu(s,e,r,i,n,a),void Wu(u,e,r,i,n,a)}o=o.next;}s=s.next;}while(s!==t)}function rh(t,e){return t.x-e.x}function ih(t,e){if(e=function(t,e){var r,i=e,n=t.x,a=t.y,s=-1/0;do{if(a<=i.y&&a>=i.next.y&&i.next.y!==i.y){var o=i.x+(a-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(o<=n&&o>s){if(s=o,o===n){if(a===i.y)return i;if(a===i.next.y)return i.next}r=i.x=i.x&&i.x>=l&&n!==i.x&&oh(ar.x||i.x===r.x&&nh(r,i)))&&(r=i,c=u)),i=i.next;}while(i!==h);return r}(t,e)){var r=dh(e,t);Yu(e,e.next),Yu(r,r.next);}}function nh(t,e){return hh(t.prev,t,e.prev)<0&&hh(e.next,t,t.next)<0}function ah(t,e,r,i,n){return (t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-r)*n)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-i)*n)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function sh(t){var e=t,r=t;do{(e.x=0&&(t-s)*(i-o)-(r-s)*(e-o)>=0&&(r-s)*(a-o)-(n-s)*(i-o)>=0}function uh(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&&ph(r,r.next,t,e))return !0;r=r.next;}while(r!==t);return !1}(t,e)&&(yh(t,e)&&yh(e,t)&&function(t,e){var r=t,i=!1,n=(t.x+e.x)/2,a=(t.y+e.y)/2;do{r.y>a!=r.next.y>a&&r.next.y!==r.y&&n<(r.next.x-r.x)*(a-r.y)/(r.next.y-r.y)+r.x&&(i=!i),r=r.next;}while(r!==t);return i}(t,e)&&(hh(t.prev,t,e.prev)||hh(t,e.prev,e))||lh(t,e)&&hh(t.prev,t,t.next)>0&&hh(e.prev,e,e.next)>0)}function hh(t,e,r){return (e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function lh(t,e){return t.x===e.x&&t.y===e.y}function ph(t,e,r,i){var n=fh(hh(t,e,r)),a=fh(hh(t,e,i)),s=fh(hh(r,i,t)),o=fh(hh(r,i,e));return n!==a&&s!==o||!(0!==n||!ch(t,r,e))||!(0!==a||!ch(t,i,e))||!(0!==s||!ch(r,t,i))||!(0!==o||!ch(r,e,i))}function ch(t,e,r){return e.x<=Math.max(t.x,r.x)&&e.x>=Math.min(t.x,r.x)&&e.y<=Math.max(t.y,r.y)&&e.y>=Math.min(t.y,r.y)}function fh(t){return t>0?1:t<0?-1:0}function yh(t,e){return hh(t.prev,t,t.next)<0?hh(t,e,t.next)>=0&&hh(t,t.prev,e)>=0:hh(t,e,t.prev)<0||hh(t,t.next,e)<0}function dh(t,e){var r=new gh(t.i,t.x,t.y),i=new gh(e.i,e.x,e.y),n=t.next,a=e.prev;return t.next=e,e.prev=t,r.next=n,n.prev=r,i.next=r,r.prev=i,a.next=i,i.prev=a,i}function mh(t,e,r,i){var n=new gh(t,e,r);return i?(n.next=i.next,n.prev=i,i.next.prev=n,i.next=n):(n.prev=n,n.next=n),n}function vh(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 gh(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 xh(t,e,r,i){for(var n=0,a=e,s=r-i;ai;){if(n-i>600){var s=n-i+1,o=r-i+1,u=Math.log(s),h=.5*Math.exp(2*u/3),l=.5*Math.sqrt(u*h*(s-h)/s)*(o-s/2<0?-1:1);t(e,r,Math.max(i,Math.floor(r-o*h/s+l)),Math.min(n,Math.floor(r+(s-o)*h/s+l)),a);}var p=e[r],c=i,f=n;for(_h(e,i,r),a(e[n],p)>0&&_h(e,i,n);c0;)f--;}0===a(e[i],p)?_h(e,i,f):_h(e,++f,n),f<=r&&(i=f+1),r<=f&&(n=f-1);}}(t,e,r||0,i||t.length-1,n||wh);}function _h(t,e,r){var i=t[e];t[e]=t[r],t[r]=i;}function wh(t,e){return te?1:0}function Mh(t,e){var r=t.length;if(r<=1)return [t];for(var i,n,a=[],s=0;s1)for(var u=0;u0&&r.holes.push(i+=t[n-1].length);}return r},Xu.default=Hu;var Ih=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 to,this.indexArray=new fo,this.indexArray2=new bo,this.programConfigurations=new ou(t.layers,t.zoom),this.segments=new Vo,this.segments2=new Vo,this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}));};Ih.prototype.populate=function(t,e,r){this.hasPattern=Ah("fill",this.layers,e);for(var i=this.layers[0].layout.get("fill-sort-key"),n=[],a=0,s=t;a>3;}if(a--,1===i||2===i)s+=t.readSVarint(),o+=t.readSVarint(),1===i&&(e&&u.push(e),e=[]),e.push(new n(s,o));else {if(7!==i)throw new Error("unknown command "+i);e&&e.push(e[0].clone());}}return e&&u.push(e),u},Th.prototype.bbox=function(){var t=this._pbf;t.pos=this._geometry;for(var e=t.readVarint()+t.pos,r=1,i=0,n=0,a=0,s=1/0,o=-1/0,u=1/0,h=-1/0;t.pos>3;}if(i--,1===r||2===r)(n+=t.readSVarint())o&&(o=n),(a+=t.readSVarint())h&&(h=a);else if(7!==r)throw new Error("unknown command "+r)}return [s,u,o,h]},Th.prototype.toGeoJSON=function(t,e,r,i){var n,a,s=this.extent*Math.pow(2,r),o=this.extent*t,u=this.extent*e,h=this.loadGeometry(),l=Th.types[this.type];function p(t){for(var e=0;e>3;e=1===i?t.readString():2===i?t.readFloat():3===i?t.readDouble():4===i?t.readVarint64():5===i?t.readVarint():6===i?t.readSVarint():7===i?t.readBoolean():null;}return e}(r));}function Nh(t,e,r){if(3===t){var i=new Fh(r,r.readVarint()+r.pos);i.length&&(e[i.name]=i);}}Oh.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 Bh(this._pbf,e,this.extent,this._keys,this._values)};var Rh={VectorTile:function(t,e){this.layers=t.readFields(Nh,{},e);},VectorTileFeature:Bh,VectorTileLayer:Fh},qh=Rh.VectorTileFeature.types,jh=Math.pow(2,13);function Uh(t,e,r,i,n,a,s,o){t.emplaceBack(e,r,2*Math.floor(i*jh)+s,n*jh*2,a*jh*2,Math.round(o));}var Gh=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 ro,this.indexArray=new fo,this.programConfigurations=new ou(t.layers,t.zoom),this.segments=new Vo,this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}));};function Kh(t,e){return t.x===e.x&&(t.x<0||t.x>8192)||t.y===e.y&&(t.y<0||t.y>8192)}Gh.prototype.populate=function(t,e,r){this.features=[],this.hasPattern=Ah("fill-extrusion",this.layers,e);for(var i=0,n=t;i8192}))||B.every((function(t){return t.y<0}))||B.every((function(t){return t.y>8192}))))for(var d=0,m=0;m=1){var g=y[m-1];if(!Kh(v,g)){p.vertexLength+4>Vo.MAX_VERTEX_ARRAY_LENGTH&&(p=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));var x=v.sub(g)._perp()._unit(),b=g.dist(v);d+b>32768&&(d=0),Uh(this.layoutVertexArray,v.x,v.y,x.x,x.y,0,0,d),Uh(this.layoutVertexArray,v.x,v.y,x.x,x.y,0,1,d),Uh(this.layoutVertexArray,g.x,g.y,x.x,x.y,0,0,d+=b),Uh(this.layoutVertexArray,g.x,g.y,x.x,x.y,0,1,d);var _=p.vertexLength;this.indexArray.emplaceBack(_,_+2,_+1),this.indexArray.emplaceBack(_+1,_+2,_+3),p.vertexLength+=4,p.primitiveLength+=2;}}}}if(p.vertexLength+u>Vo.MAX_VERTEX_ARRAY_LENGTH&&(p=this.segments.prepareSegment(u,this.layoutVertexArray,this.indexArray)),"Polygon"===qh[t.type]){for(var w=[],M=[],S=p.vertexLength,A=0,k=o;A=2&&t[u-1].equals(t[u-2]);)u--;for(var h=0;h0;if(M&&v>h){var A=l.dist(f);if(A>2*p){var k=l.sub(l.sub(f)._mult(p/A)._round());this.updateDistance(f,k),this.addCurrentVertex(k,d,0,0,c),f=k;}}var I=f&&y,z=I?r:o?"butt":i;if(I&&"round"===z&&(_n&&(z="bevel"),"bevel"===z&&(_>2&&(z="flipbevel"),_100)g=m.mult(-1);else {var C=_*d.add(m).mag()/d.sub(m).mag();g._perp()._mult(C*(S?-1:1));}this.addCurrentVertex(l,g,0,0,c),this.addCurrentVertex(l,g.mult(-1),0,0,c);}else if("bevel"===z||"fakeround"===z){var E=-Math.sqrt(_*_-1),P=S?E:0,B=S?0:E;if(f&&this.addCurrentVertex(l,d,P,B,c),"fakeround"===z)for(var T=Math.round(180*w/Math.PI/20),V=1;V2*p){var R=l.add(y.sub(l)._mult(p/N)._round());this.updateDistance(l,R),this.addCurrentVertex(R,m,0,0,c),l=R;}}}}},el.prototype.addCurrentVertex=function(t,e,r,i,n,a){void 0===a&&(a=!1);var s=e.y*i-e.x,o=-e.y-e.x*i;this.addHalfVertex(t,e.x+e.y*r,e.y-e.x*r,a,!1,r,n),this.addHalfVertex(t,s,o,a,!0,-i,n),this.distance>tl/2&&0===this.totalDistance&&(this.distance=0,this.addCurrentVertex(t,e,r,i,n,a));},el.prototype.addHalfVertex=function(t,e,r,i,n,a,s){var o=.5*(this.lineClips?this.scaledDistance*(tl-1):this.scaledDistance);this.layoutVertexArray.emplaceBack((t.x<<1)+(i?1:0),(t.y<<1)+(n?1:0),Math.round(63*e)+128,Math.round(63*r)+128,1+(0===a?0:a<0?-1:1)|(63&o)<<2,o>>6),this.lineClips&&this.layoutVertexArray2.emplaceBack((this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start),this.lineClipsArray.length);var u=s.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,u),s.primitiveLength++),n?this.e2=u:this.e1=u;},el.prototype.updateScaledDistance=function(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance;},el.prototype.updateDistance=function(t,e){this.distance+=t.dist(e),this.updateScaledDistance();},da("LineBucket",el,{omit:["layers","patternFeatures"]});var rl=new Hs({"line-cap":new js(Pa.layout_line["line-cap"]),"line-join":new Us(Pa.layout_line["line-join"]),"line-miter-limit":new js(Pa.layout_line["line-miter-limit"]),"line-round-limit":new js(Pa.layout_line["line-round-limit"]),"line-sort-key":new Us(Pa.layout_line["line-sort-key"])}),il={paint:new Hs({"line-opacity":new Us(Pa.paint_line["line-opacity"]),"line-color":new Us(Pa.paint_line["line-color"]),"line-translate":new js(Pa.paint_line["line-translate"]),"line-translate-anchor":new js(Pa.paint_line["line-translate-anchor"]),"line-width":new Us(Pa.paint_line["line-width"]),"line-gap-width":new Us(Pa.paint_line["line-gap-width"]),"line-offset":new Us(Pa.paint_line["line-offset"]),"line-blur":new Us(Pa.paint_line["line-blur"]),"line-dasharray":new Ks(Pa.paint_line["line-dasharray"]),"line-pattern":new Gs(Pa.paint_line["line-pattern"]),"line-gradient":new Xs(Pa.paint_line["line-gradient"])}),layout:rl},nl=new(function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.possiblyEvaluate=function(e,r){return r=new Ts(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,i,n){return r=c({},r,{zoom:Math.floor(r.zoom)}),t.prototype.evaluate.call(this,e,r,i,n)},e}(Us))(il.paint.properties["line-width"].specification);nl.useIntegerZoom=!0;var al=function(t){function e(e){t.call(this,e,il),this.gradientVersion=0;}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._handleSpecialPaintPropertyUpdate=function(t){"line-gradient"===t&&(this.stepInterpolant=this._transitionablePaint._values["line-gradient"].value.expression._styleExpression.expression instanceof nn,this.gradientVersion=(this.gradientVersion+1)%o);},e.prototype.gradientExpression=function(){return this._transitionablePaint._values["line-gradient"].value.expression},e.prototype.recalculate=function(e,r){t.prototype.recalculate.call(this,e,r),this.paint._values["line-floorwidth"]=nl.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,e);},e.prototype.createBucket=function(t){return new el(t)},e.prototype.queryRadius=function(t){var e=t,r=sl(ku("line-width",this,e),ku("line-gap-width",this,e)),i=ku("line-offset",this,e);return r/2+Math.abs(i)+Iu(this.paint.get("line-translate"))},e.prototype.queryIntersectsFeature=function(t,e,r,i,a,s,o){var u=zu(t,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),s.angle,o),h=o/2*sl(this.paint.get("line-width").evaluate(e,r),this.paint.get("line-gap-width").evaluate(e,r)),l=this.paint.get("line-offset").evaluate(e,r);return l&&(i=function(t,e){for(var r=[],i=new n(0,0),a=0;a=3)for(var a=0;a0?e+2*t:t}var ol=Qs([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),ul=Qs([{name:"a_projected_pos",components:3,type:"Float32"}],4),hl=(Qs([{name:"a_fade_opacity",components:1,type:"Uint32"}],4),Qs([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}])),ll=(Qs([{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"}]),Qs([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4)),pl=Qs([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function cl(t,e,r){return t.sections.forEach((function(t){t.text=function(t,e,r){var i=e.layout.get("text-transform").evaluate(r,{});return "uppercase"===i?t=t.toLocaleUpperCase():"lowercase"===i&&(t=t.toLocaleLowerCase()),Bs.applyArabicShaping&&(t=Bs.applyArabicShaping(t)),t}(t.text,e,r);})),t}Qs([{name:"triangle",components:3,type:"Uint16"}]),Qs([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Uint16",name:"glyphStartIndex"},{type:"Uint16",name:"numGlyphs"},{type:"Uint32",name:"vertexStartIndex"},{type:"Uint32",name:"lineStartIndex"},{type:"Uint32",name:"lineLength"},{type:"Uint16",name:"segment"},{type:"Uint16",name:"lowerSize"},{type:"Uint16",name:"upperSize"},{type:"Float32",name:"lineOffsetX"},{type:"Float32",name:"lineOffsetY"},{type:"Uint8",name:"writingMode"},{type:"Uint8",name:"placedOrientation"},{type:"Uint8",name:"hidden"},{type:"Uint32",name:"crossTileID"},{type:"Int16",name:"associatedIconIndex"}]),Qs([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Int16",name:"rightJustifiedTextSymbolIndex"},{type:"Int16",name:"centerJustifiedTextSymbolIndex"},{type:"Int16",name:"leftJustifiedTextSymbolIndex"},{type:"Int16",name:"verticalPlacedTextSymbolIndex"},{type:"Int16",name:"placedIconSymbolIndex"},{type:"Int16",name:"verticalPlacedIconSymbolIndex"},{type:"Uint16",name:"key"},{type:"Uint16",name:"textBoxStartIndex"},{type:"Uint16",name:"textBoxEndIndex"},{type:"Uint16",name:"verticalTextBoxStartIndex"},{type:"Uint16",name:"verticalTextBoxEndIndex"},{type:"Uint16",name:"iconBoxStartIndex"},{type:"Uint16",name:"iconBoxEndIndex"},{type:"Uint16",name:"verticalIconBoxStartIndex"},{type:"Uint16",name:"verticalIconBoxEndIndex"},{type:"Uint16",name:"featureIndex"},{type:"Uint16",name:"numHorizontalGlyphVertices"},{type:"Uint16",name:"numVerticalGlyphVertices"},{type:"Uint16",name:"numIconVertices"},{type:"Uint16",name:"numVerticalIconVertices"},{type:"Uint16",name:"useRuntimeCollisionCircles"},{type:"Uint32",name:"crossTileID"},{type:"Float32",name:"textBoxScale"},{type:"Float32",components:2,name:"textOffset"},{type:"Float32",name:"collisionCircleDiameter"}]),Qs([{type:"Float32",name:"offsetX"}]),Qs([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]);var fl={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"},yl=function(t,e,r,i,n){var a,s,o=8*n-i-1,u=(1<>1,l=-7,p=r?n-1:0,c=r?-1:1,f=t[e+p];for(p+=c,a=f&(1<<-l)-1,f>>=-l,l+=o;l>0;a=256*a+t[e+p],p+=c,l-=8);for(s=a&(1<<-l)-1,a>>=-l,l+=i;l>0;s=256*s+t[e+p],p+=c,l-=8);if(0===a)a=1-h;else {if(a===u)return s?NaN:1/0*(f?-1:1);s+=Math.pow(2,i),a-=h;}return (f?-1:1)*s*Math.pow(2,a-i)},dl=function(t,e,r,i,n,a){var s,o,u,h=8*a-n-1,l=(1<>1,c=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,f=i?0:a-1,y=i?1:-1,d=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(o=isNaN(e)?1:0,s=l):(s=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-s))<1&&(s--,u*=2),(e+=s+p>=1?c/u:c*Math.pow(2,1-p))*u>=2&&(s++,u/=2),s+p>=l?(o=0,s=l):s+p>=1?(o=(e*u-1)*Math.pow(2,n),s+=p):(o=e*Math.pow(2,p-1)*Math.pow(2,n),s=0));n>=8;t[r+f]=255&o,f+=y,o/=256,n-=8);for(s=s<0;t[r+f]=255&s,f+=y,s/=256,h-=8);t[r+f-y]|=128*d;},ml=vl;function vl(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length;}vl.Varint=0,vl.Fixed64=1,vl.Bytes=2,vl.Fixed32=5;var gl="undefined"==typeof TextDecoder?null:new TextDecoder("utf8");function xl(t){return t.type===vl.Bytes?t.readVarint()+t.pos:t.pos+1}function bl(t,e,r){return r?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function _l(t,e,r){var i=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));r.realloc(i);for(var n=r.pos-1;n>=t;n--)r.buf[n+i]=r.buf[n];}function wl(t,e){for(var r=0;r>>8,t[r+2]=e>>>16,t[r+3]=e>>>24;}function Tl(t,e){return (t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}function Vl(t,e,r){1===t&&r.readMessage(Ll,e);}function Ll(t,e,r){if(3===t){var i=r.readMessage(Fl,{}),n=i.width,a=i.height,s=i.left,o=i.top,u=i.advance;e.push({id:i.id,bitmap:new Sa({width:n+6,height:a+6},i.bitmap),metrics:{width:n,height:a,left:s,top:o,advance:u}});}}function Fl(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());}function Ol(t){for(var e=0,r=0,i=0,n=t;i=0;c--){var f=s[c];if(!(p.w>f.w||p.h>f.h)){if(p.x=f.x,p.y=f.y,u=Math.max(u,p.y+p.h),o=Math.max(o,p.x+p.w),p.w===f.w&&p.h===f.h){var y=s.pop();c>3,a=this.pos;this.type=7&i,t(n,e,this),this.pos===a&&this.skip(i);}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=Pl(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=Tl(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=Pl(this.buf,this.pos)+4294967296*Pl(this.buf,this.pos+4);return this.pos+=8,t},readSFixed64:function(){var t=Pl(this.buf,this.pos)+4294967296*Tl(this.buf,this.pos+4);return this.pos+=8,t},readFloat:function(){var t=yl(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=yl(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var e,r,i=this.buf;return e=127&(r=i[this.pos++]),r<128?e:(e|=(127&(r=i[this.pos++]))<<7,r<128?e:(e|=(127&(r=i[this.pos++]))<<14,r<128?e:(e|=(127&(r=i[this.pos++]))<<21,r<128?e:function(t,e,r){var i,n,a=r.buf;if(i=(112&(n=a[r.pos++]))>>4,n<128)return bl(t,i,e);if(i|=(127&(n=a[r.pos++]))<<3,n<128)return bl(t,i,e);if(i|=(127&(n=a[r.pos++]))<<10,n<128)return bl(t,i,e);if(i|=(127&(n=a[r.pos++]))<<17,n<128)return bl(t,i,e);if(i|=(127&(n=a[r.pos++]))<<24,n<128)return bl(t,i,e);if(i|=(1&(n=a[r.pos++]))<<31,n<128)return bl(t,i,e);throw new Error("Expected varint not more than 10 bytes")}(e|=(15&(r=i[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=this.pos;return this.pos=t,t-e>=12&&gl?function(t,e,r){return gl.decode(t.subarray(e,r))}(this.buf,e,t):function(t,e,r){for(var i="",n=e;n239?4:u>223?3:u>191?2:1;if(n+l>r)break;1===l?u<128&&(h=u):2===l?128==(192&(a=t[n+1]))&&(h=(31&u)<<6|63&a)<=127&&(h=null):3===l?(s=t[n+2],128==(192&(a=t[n+1]))&&128==(192&s)&&((h=(15&u)<<12|(63&a)<<6|63&s)<=2047||h>=55296&&h<=57343)&&(h=null)):4===l&&(s=t[n+2],o=t[n+3],128==(192&(a=t[n+1]))&&128==(192&s)&&128==(192&o)&&((h=(15&u)<<18|(63&a)<<12|(63&s)<<6|63&o)<=65535||h>=1114112)&&(h=null)),null===h?(h=65533,l=1):h>65535&&(h-=65536,i+=String.fromCharCode(h>>>10&1023|55296),h=56320|1023&h),i+=String.fromCharCode(h),n+=l;}return i}(this.buf,e,t)},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!==vl.Bytes)return t.push(this.readVarint(e));var r=xl(this);for(t=t||[];this.pos127;);else if(e===vl.Bytes)this.pos=this.readVarint()+this.pos;else if(e===vl.Fixed32)this.pos+=4;else {if(e!==vl.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,i;if(t>=0?(r=t%4294967296|0,i=t/4294967296|0):(i=~(-t/4294967296),4294967295^(r=~(-t%4294967296))?r=r+1|0:(r=0,i=i+1|0)),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,r.buf[r.pos]=127&(t>>>=7);}(r,0,e),function(t,e){var r=(7&t)<<4;e.buf[e.pos++]|=r|((t>>>=3)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t)))));}(i,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 i,n,a=0;a55295&&i<57344){if(!n){i>56319||a+1===e.length?(t[r++]=239,t[r++]=191,t[r++]=189):n=i;continue}if(i<56320){t[r++]=239,t[r++]=191,t[r++]=189,n=i;continue}i=n-55296<<10|i-56320|65536,n=null;}else n&&(t[r++]=239,t[r++]=191,t[r++]=189,n=null);i<128?t[r++]=i:(i<2048?t[r++]=i>>6|192:(i<65536?t[r++]=i>>12|224:(t[r++]=i>>18|240,t[r++]=i>>12&63|128),t[r++]=i>>6&63|128),t[r++]=63&i|128);}return r}(this.buf,t,this.pos);var r=this.pos-e;r>=128&&_l(e,r,this),this.pos=e-1,this.writeVarint(r),this.pos+=r;},writeFloat:function(t){this.realloc(4),dl(this.buf,t,this.pos,!0,23,4),this.pos+=4;},writeDouble:function(t){this.realloc(8),dl(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&&_l(r,i,this),this.pos=r-1,this.writeVarint(i),this.pos+=i;},writeMessage:function(t,e,r){this.writeTag(t,vl.Bytes),this.writeRawMessage(e,r);},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,wl,e);},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,Ml,e);},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,kl,e);},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,Sl,e);},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,Al,e);},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,Il,e);},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,zl,e);},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,Cl,e);},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,El,e);},writeBytesField:function(t,e){this.writeTag(t,vl.Bytes),this.writeBytes(e);},writeFixed32Field:function(t,e){this.writeTag(t,vl.Fixed32),this.writeFixed32(e);},writeSFixed32Field:function(t,e){this.writeTag(t,vl.Fixed32),this.writeSFixed32(e);},writeFixed64Field:function(t,e){this.writeTag(t,vl.Fixed64),this.writeFixed64(e);},writeSFixed64Field:function(t,e){this.writeTag(t,vl.Fixed64),this.writeSFixed64(e);},writeVarintField:function(t,e){this.writeTag(t,vl.Varint),this.writeVarint(e);},writeSVarintField:function(t,e){this.writeTag(t,vl.Varint),this.writeSVarint(e);},writeStringField:function(t,e){this.writeTag(t,vl.Bytes),this.writeString(e);},writeFloatField:function(t,e){this.writeTag(t,vl.Fixed32),this.writeFloat(e);},writeDoubleField:function(t,e){this.writeTag(t,vl.Fixed64),this.writeDouble(e);},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e));}};var Dl=function(t,e){var r=e.pixelRatio,i=e.version,n=e.stretchX,a=e.stretchY,s=e.content;this.paddedRect=t,this.pixelRatio=r,this.stretchX=n,this.stretchY=a,this.content=s,this.version=i;},Nl={tl:{configurable:!0},br:{configurable:!0},tlbr:{configurable:!0},displaySize:{configurable:!0}};Nl.tl.get=function(){return [this.paddedRect.x+1,this.paddedRect.y+1]},Nl.br.get=function(){return [this.paddedRect.x+this.paddedRect.w-1,this.paddedRect.y+this.paddedRect.h-1]},Nl.tlbr.get=function(){return this.tl.concat(this.br)},Nl.displaySize.get=function(){return [(this.paddedRect.w-2)/this.pixelRatio,(this.paddedRect.h-2)/this.pixelRatio]},Object.defineProperties(Dl.prototype,Nl);var Rl=function(t,e){var r={},i={};this.haveRenderCallbacks=[];var n=[];this.addImages(t,r,n),this.addImages(e,i,n);var a=Ol(n),s=new Aa({width:a.w||1,height:a.h||1});for(var o in t){var u=t[o],h=r[o].paddedRect;Aa.copy(u.data,s,{x:0,y:0},{x:h.x+1,y:h.y+1},u.data);}for(var l in e){var p=e[l],c=i[l].paddedRect,f=c.x+1,y=c.y+1,d=p.data.width,m=p.data.height;Aa.copy(p.data,s,{x:0,y:0},{x:f,y:y},p.data),Aa.copy(p.data,s,{x:0,y:m-1},{x:f,y:y+m},{width:d,height:1}),Aa.copy(p.data,s,{x:0,y:0},{x:f,y:y-1},{width:d,height:1}),Aa.copy(p.data,s,{x:d-1,y:0},{x:f+d,y:y},{width:1,height:m}),Aa.copy(p.data,s,{x:0,y:0},{x:f-1,y:y},{width:1,height:m}),Aa.copy(p.data,s,{x:0,y:0},{x:0,y:y-1},{width:1,height:1}),Aa.copy(p.data,s,{x:d-1,y:0},{x:f+d,y:y-1},{width:1,height:1}),Aa.copy(p.data,s,{x:d-1,y:m-1},{x:f+d,y:y+m},{width:1,height:1}),Aa.copy(p.data,s,{x:0,y:m-1},{x:0,y:y+m},{width:1,height:1});}this.image=s,this.iconPositions=r,this.patternPositions=i;};Rl.prototype.addImages=function(t,e,r){for(var i in t){var n=t[i],a={x:0,y:0,w:n.data.width+2,h:n.data.height+2};r.push(a),e[i]=new Dl(a,n),n.hasRenderCallback&&this.haveRenderCallbacks.push(i);}},Rl.prototype.patchUpdatedImages=function(t,e){for(var r in t.dispatchRenderCallbacks(this.haveRenderCallbacks),t.updatedImages)this.patchUpdatedImage(this.iconPositions[r],t.getImage(r),e),this.patchUpdatedImage(this.patternPositions[r],t.getImage(r),e);},Rl.prototype.patchUpdatedImage=function(t,e,r){if(t&&e&&t.version!==e.version){t.version=e.version;var i=t.tl;r.update(e.data,void 0,{x:i[0],y:i[1]});}},da("ImagePosition",Dl),da("ImageAtlas",Rl);var ql={horizontal:1,vertical:2,horizontalOnly:3},jl=function(){this.scale=1,this.fontStack="",this.imageName=null;};jl.forText=function(t,e){var r=new jl;return r.scale=t||1,r.fontStack=e,r},jl.forImage=function(t){var e=new jl;return e.imageName=t,e};var Ul=function(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null;};function Gl(t,e,r,i,n,a,s,o,u,h,l,p,c,f,y,d){var m,v=Ul.fromFeature(t,n);p===ql.vertical&&v.verticalizePunctuation();var g=Bs.processBidirectionalText,x=Bs.processStyledBidirectionalText;if(g&&1===v.sections.length){m=[];for(var b=0,_=g(v.toString(),Wl(v,h,a,e,i,f,y));b<_.length;b+=1){var w=_[b],M=new Ul;M.text=w,M.sections=v.sections;for(var S=0;S0&&D>A&&(A=D);}else {var N=r[I.fontStack],R=N&&N[C];if(R&&R.rect)B=R.rect,P=R.metrics;else {var q=e[I.fontStack],j=q&&q[C];if(!j)continue;P=j.metrics;}E=24*(_-I.scale);}L?(t.verticalizable=!0,S.push({glyph:C,imageName:T,x:c,y:f+E,vertical:L,scale:I.scale,fontStack:I.fontStack,sectionIndex:z,metrics:P,rect:B}),c+=V*I.scale+h):(S.push({glyph:C,imageName:T,x:c,y:f+E,vertical:L,scale:I.scale,fontStack:I.fontStack,sectionIndex:z,metrics:P,rect:B}),c+=P.advance*I.scale+h);}0!==S.length&&(y=Math.max(c-h,y),$l(S,0,S.length-1,m,A)),c=0;var U=a*_+A;M.lineOffset=Math.max(A,w),f+=U,d=Math.max(U,d),++v;}else f+=a,++v;}var G,K=f- -17,X=Ql(s),H=X.horizontalAlign,J=X.verticalAlign;(function(t,e,r,i,n,a,s,o,u){var h,l=(e-r)*n;h=a!==s?-o*i- -17:(-i*u+.5)*s;for(var p=0,c=t;p=0&&i>=t&&Kl[this.text.charCodeAt(i)];i--)r--;this.text=this.text.substring(t,r),this.sectionIndex=this.sectionIndex.slice(t,r);},Ul.prototype.substring=function(t,e){var r=new Ul;return r.text=this.text.substring(t,e),r.sectionIndex=this.sectionIndex.slice(t,e),r.sections=this.sections,r},Ul.prototype.toString=function(){return this.text},Ul.prototype.getMaxScale=function(){var t=this;return this.sectionIndex.reduce((function(e,r){return Math.max(e,t.sections[r].scale)}),0)},Ul.prototype.addTextSection=function(t,e){this.text+=t.text,this.sections.push(jl.forText(t.scale,t.fontStack||e));for(var r=this.sections.length-1,i=0;i=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)};var Kl={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},Xl={};function Hl(t,e,r,i,n,a){if(e.imageName){var s=i[e.imageName];return s?s.displaySize[0]*e.scale*24/a+n:0}var o=r[e.fontStack],u=o&&o[t];return u?u.metrics.advance*e.scale+n:0}function Jl(t,e,r,i){var n=Math.pow(t-e,2);return i?t=0,p=0,c=0;c-r/2;){if(--s<0)return !1;o-=t[s].dist(a),a=t[s];}o+=t[s].dist(t[s+1]),s++;for(var u=[],h=0;oi;)h-=u.shift().angleDelta;if(h>n)return !1;s++,o+=l.dist(p);}return !0}function op(t){for(var e=0,r=0;rh){var y=(h-u)/f,d=an(p.x,c.x,y),m=an(p.y,c.y,y),v=new ep(d,m,c.angleTo(p),l);return v._round(),!s||sp(t,v,o,s,e)?v:void 0}u+=f;}}function pp(t,e,r,i,n,a,s,o,u){var h=up(i,a,s),l=hp(i,n),p=l*s,c=0===t[0].x||t[0].x===u||0===t[0].y||t[0].y===u;return e-p=0&&_=0&&w=0&&f+l<=p){var M=new ep(_,w,x,d);M._round(),n&&!sp(e,M,s,n,a)||y.push(M);}}c+=g;}return u||y.length||o||(y=t(e,c/2,i,n,a,s,o,!0,h)),y}(t,c?e/2*o%e:(l/2+2*a)*s*o%e,e,h,r,p,c,!1,u)}function cp(t,e,r,i,a){for(var s=[],o=0;o=i&&c.x>=i||(p.x>=i?p=new n(i,p.y+(i-p.x)/(c.x-p.x)*(c.y-p.y))._round():c.x>=i&&(c=new n(i,p.y+(i-p.x)/(c.x-p.x)*(c.y-p.y))._round()),p.y>=a&&c.y>=a||(p.y>=a?p=new n(p.x+(a-p.y)/(c.y-p.y)*(c.x-p.x),a)._round():c.y>=a&&(c=new n(p.x+(a-p.y)/(c.y-p.y)*(c.x-p.x),a)._round()),h&&p.equals(h[h.length-1])||s.push(h=[p]),h.push(c)))));}return s}function fp(t,e,r,i){var a=[],s=t.image,o=s.pixelRatio,u=s.paddedRect.w-2,h=s.paddedRect.h-2,l=t.right-t.left,p=t.bottom-t.top,c=s.stretchX||[[0,u]],f=s.stretchY||[[0,h]],y=function(t,e){return t+e[1]-e[0]},d=c.reduce(y,0),m=f.reduce(y,0),v=u-d,g=h-m,x=0,b=d,_=0,w=m,M=0,S=v,A=0,k=g;if(s.content&&i){var I=s.content;x=yp(c,0,I[0]),_=yp(f,0,I[1]),b=yp(c,I[0],I[2]),w=yp(f,I[1],I[3]),M=I[0]-x,A=I[1]-_,S=I[2]-I[0]-b,k=I[3]-I[1]-w;}var z=function(i,a,u,h){var c=mp(i.stretch-x,b,l,t.left),f=vp(i.fixed-M,S,i.stretch,d),y=mp(a.stretch-_,w,p,t.top),v=vp(a.fixed-A,k,a.stretch,m),g=mp(u.stretch-x,b,l,t.left),I=vp(u.fixed-M,S,u.stretch,d),z=mp(h.stretch-_,w,p,t.top),C=vp(h.fixed-A,k,h.stretch,m),E=new n(c,y),P=new n(g,y),B=new n(g,z),T=new n(c,z),V=new n(f/o,v/o),L=new n(I/o,C/o),F=e*Math.PI/180;if(F){var O=Math.sin(F),D=Math.cos(F),N=[D,-O,O,D];E._matMult(N),P._matMult(N),T._matMult(N),B._matMult(N);}var R=i.stretch+i.fixed,q=a.stretch+a.fixed;return {tl:E,tr:P,bl:T,br:B,tex:{x:s.paddedRect.x+1+R,y:s.paddedRect.y+1+q,w:u.stretch+u.fixed-R,h:h.stretch+h.fixed-q},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:V,pixelOffsetBR:L,minFontScaleX:S/o/l,minFontScaleY:k/o/p,isSDF:r}};if(i&&(s.stretchX||s.stretchY))for(var C=dp(c,v,d),E=dp(f,g,m),P=0;P0&&(y=Math.max(10,y),this.circleDiameter=y);}else {var d=s.top*o-u,m=s.bottom*o+u,v=s.left*o-u,g=s.right*o+u,x=s.collisionPadding;if(x&&(v-=x[0]*o,d-=x[1]*o,g+=x[2]*o,m+=x[3]*o),l){var b=new n(v,d),_=new n(g,d),w=new n(v,m),M=new n(g,m),S=l*Math.PI/180;b._rotate(S),_._rotate(S),w._rotate(S),M._rotate(S),v=Math.min(b.x,_.x,w.x,M.x),g=Math.max(b.x,_.x,w.x,M.x),d=Math.min(b.y,_.y,w.y,M.y),m=Math.max(b.y,_.y,w.y,M.y);}t.emplaceBack(e.x,e.y,v,d,g,m,r,i,a);}this.boxEndIndex=t.length;},xp=function(t,e){if(void 0===t&&(t=[]),void 0===e&&(e=bp),this.data=t,this.length=this.data.length,this.compare=e,this.length>0)for(var r=(this.length>>1)-1;r>=0;r--)this._down(r);};function bp(t,e){return te?1:0}function _p(t,e,r){void 0===e&&(e=1),void 0===r&&(r=!1);for(var i=1/0,a=1/0,s=-1/0,o=-1/0,u=t[0],h=0;hs)&&(s=l.x),(!h||l.y>o)&&(o=l.y);}var p=Math.min(s-i,o-a),c=p/2,f=new xp([],wp);if(0===p)return new n(i,a);for(var y=i;ym.d||!m.d)&&(m=g,r&&console.log("found best %d after %d probes",Math.round(1e4*g.d)/1e4,v)),g.max-m.d<=e||(f.push(new Mp(g.p.x-(c=g.h/2),g.p.y-c,c,t)),f.push(new Mp(g.p.x+c,g.p.y-c,c,t)),f.push(new Mp(g.p.x-c,g.p.y+c,c,t)),f.push(new Mp(g.p.x+c,g.p.y+c,c,t)),v+=4);}return r&&(console.log("num probes: "+v),console.log("best distance: "+m.d)),m.p}function wp(t,e){return e.max-t.max}function Mp(t,e,r,i){this.p=new n(t,e),this.h=r,this.d=function(t,e){for(var r=!1,i=1/0,n=0;nt.y!=l.y>t.y&&t.x<(l.x-h.x)*(t.y-h.y)/(l.y-h.y)+h.x&&(r=!r),i=Math.min(i,wu(t,h,l));}return (r?1:-1)*Math.sqrt(i)}(this.p,i),this.max=this.d+this.h*Math.SQRT2;}xp.prototype.push=function(t){this.data.push(t),this.length++,this._up(this.length-1);},xp.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}},xp.prototype.peek=function(){return this.data[0]},xp.prototype._up=function(t){for(var e=this.data,r=this.compare,i=e[t];t>0;){var n=t-1>>1,a=e[n];if(r(i,a)>=0)break;e[t]=a,t=n;}e[t]=i;},xp.prototype._down=function(t){for(var e=this.data,r=this.compare,i=this.length>>1,n=e[t];t=0)break;e[t]=s,t=a;}e[t]=n;};var Sp=Number.POSITIVE_INFINITY;function Ap(t,e){return e[1]!==Sp?function(t,e,r){var i=0,n=0;switch(e=Math.abs(e),r=Math.abs(r),t){case"top-right":case"top-left":case"top":n=r-7;break;case"bottom-right":case"bottom-left":case"bottom":n=7-r;}switch(t){case"top-right":case"bottom-right":case"right":i=-e;break;case"top-left":case"bottom-left":case"left":i=e;}return [i,n]}(t,e[0],e[1]):function(t,e){var r=0,i=0;e<0&&(e=0);var n=e/Math.sqrt(2);switch(t){case"top-right":case"top-left":i=n-7;break;case"bottom-right":case"bottom-left":i=7-n;break;case"bottom":i=7-e;break;case"top":i=e-7;}switch(t){case"top-right":case"bottom-right":r=-n;break;case"top-left":case"bottom-left":r=n;break;case"left":r=e;break;case"right":r=-e;}return [r,i]}(t,e[0])}function kp(t){switch(t){case"right":case"top-right":case"bottom-right":return "right";case"left":case"top-left":case"bottom-left":return "left"}return "center"}function Ip(t,e,r,i,a,s,o,u,h,l,p,c,f,y,d){var m=function(t,e,r,i,a,s,o,u){for(var h=i.layout.get("text-rotate").evaluate(s,{})*Math.PI/180,l=[],p=0,c=e.positionedLines;p32640&&M(t.layerIds[0]+': Value for "text-size" is >= 255. Reduce your "text-size".'):"composite"===v.kind&&((g=[128*y.compositeTextSizes[0].evaluate(o,{},d),128*y.compositeTextSizes[1].evaluate(o,{},d)])[0]>32640||g[1]>32640)&&M(t.layerIds[0]+': Value for "text-size" is >= 255. Reduce your "text-size".'),t.addSymbols(t.text,m,g,u,s,o,l,e,h.lineStartIndex,h.lineLength,f,d);for(var x=0,b=p;x=0;s--)if(i.dist(a[s])0)&&("constant"!==a.value.kind||a.value.value.length>0),h="constant"!==o.value.kind||!!o.value.value||Object.keys(o.parameters).length>0,l=n.get("symbol-sort-key");if(this.features=[],u||h){for(var p=e.iconDependencies,c=e.glyphDependencies,f=e.availableImages,y=new Ts(this.zoom),d=0,m=t;d=0;for(var T=0,V=S.sections;T=0;o--)a[o]={x:e[o].x,y:e[o].y,tileUnitDistanceFromAnchor:n},o>0&&(n+=e[o-1].dist(e[o]));for(var u=0;u0},Op.prototype.hasIconData=function(){return this.icon.segments.get().length>0},Op.prototype.hasDebugData=function(){return this.textCollisionBox&&this.iconCollisionBox},Op.prototype.hasTextCollisionBoxData=function(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0},Op.prototype.hasIconCollisionBoxData=function(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0},Op.prototype.addIndicesForPlacedSymbol=function(t,e){for(var r=t.placedSymbolArray.get(e),i=r.vertexStartIndex+4*r.numGlyphs,n=r.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,i=this.symbolInstanceIndexes;r=0&&i.indexOf(t)===r&&e.addIndicesForPlacedSymbol(e.text,t);})),n.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,n.verticalPlacedTextSymbolIndex),n.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,n.placedIconSymbolIndex),n.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,n.verticalPlacedIconSymbolIndex);}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray);}},da("SymbolBucket",Op,{omit:["layers","collisionBoxArray","features","compareText"]}),Op.MAX_GLYPHS=65535,Op.addDynamicAttributes=Tp;var Dp=new Hs({"symbol-placement":new js(Pa.layout_symbol["symbol-placement"]),"symbol-spacing":new js(Pa.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new js(Pa.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new Us(Pa.layout_symbol["symbol-sort-key"]),"symbol-z-order":new js(Pa.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new js(Pa.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new js(Pa.layout_symbol["icon-ignore-placement"]),"icon-optional":new js(Pa.layout_symbol["icon-optional"]),"icon-rotation-alignment":new js(Pa.layout_symbol["icon-rotation-alignment"]),"icon-size":new Us(Pa.layout_symbol["icon-size"]),"icon-text-fit":new js(Pa.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new js(Pa.layout_symbol["icon-text-fit-padding"]),"icon-image":new Us(Pa.layout_symbol["icon-image"]),"icon-rotate":new Us(Pa.layout_symbol["icon-rotate"]),"icon-padding":new js(Pa.layout_symbol["icon-padding"]),"icon-keep-upright":new js(Pa.layout_symbol["icon-keep-upright"]),"icon-offset":new Us(Pa.layout_symbol["icon-offset"]),"icon-anchor":new Us(Pa.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new js(Pa.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new js(Pa.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new js(Pa.layout_symbol["text-rotation-alignment"]),"text-field":new Us(Pa.layout_symbol["text-field"]),"text-font":new Us(Pa.layout_symbol["text-font"]),"text-size":new Us(Pa.layout_symbol["text-size"]),"text-max-width":new Us(Pa.layout_symbol["text-max-width"]),"text-line-height":new js(Pa.layout_symbol["text-line-height"]),"text-letter-spacing":new Us(Pa.layout_symbol["text-letter-spacing"]),"text-justify":new Us(Pa.layout_symbol["text-justify"]),"text-radial-offset":new Us(Pa.layout_symbol["text-radial-offset"]),"text-variable-anchor":new js(Pa.layout_symbol["text-variable-anchor"]),"text-anchor":new Us(Pa.layout_symbol["text-anchor"]),"text-max-angle":new js(Pa.layout_symbol["text-max-angle"]),"text-writing-mode":new js(Pa.layout_symbol["text-writing-mode"]),"text-rotate":new Us(Pa.layout_symbol["text-rotate"]),"text-padding":new js(Pa.layout_symbol["text-padding"]),"text-keep-upright":new js(Pa.layout_symbol["text-keep-upright"]),"text-transform":new Us(Pa.layout_symbol["text-transform"]),"text-offset":new Us(Pa.layout_symbol["text-offset"]),"text-allow-overlap":new js(Pa.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new js(Pa.layout_symbol["text-ignore-placement"]),"text-optional":new js(Pa.layout_symbol["text-optional"])}),Np={paint:new Hs({"icon-opacity":new Us(Pa.paint_symbol["icon-opacity"]),"icon-color":new Us(Pa.paint_symbol["icon-color"]),"icon-halo-color":new Us(Pa.paint_symbol["icon-halo-color"]),"icon-halo-width":new Us(Pa.paint_symbol["icon-halo-width"]),"icon-halo-blur":new Us(Pa.paint_symbol["icon-halo-blur"]),"icon-translate":new js(Pa.paint_symbol["icon-translate"]),"icon-translate-anchor":new js(Pa.paint_symbol["icon-translate-anchor"]),"text-opacity":new Us(Pa.paint_symbol["text-opacity"]),"text-color":new Us(Pa.paint_symbol["text-color"],{runtimeType:ii,getOverride:function(t){return t.textColor},hasOverride:function(t){return !!t.textColor}}),"text-halo-color":new Us(Pa.paint_symbol["text-halo-color"]),"text-halo-width":new Us(Pa.paint_symbol["text-halo-width"]),"text-halo-blur":new Us(Pa.paint_symbol["text-halo-blur"]),"text-translate":new js(Pa.paint_symbol["text-translate"]),"text-translate-anchor":new js(Pa.paint_symbol["text-translate-anchor"])}),layout:Dp},Rp=function(t){this.type=t.property.overrides?t.property.overrides.runtimeType:$r,this.defaultValue=t;};Rp.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},Rp.prototype.eachChild=function(t){this.defaultValue.isConstant()||t(this.defaultValue.value._styleExpression.expression);},Rp.prototype.outputDefined=function(){return !1},Rp.prototype.serialize=function(){return null},da("FormatSectionOverride",Rp,{omit:["defaultValue"]});var qp=function(t){function e(e){t.call(this,e,Np);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.recalculate=function(e,r){if(t.prototype.recalculate.call(this,e,r),"auto"===this.layout.get("icon-rotation-alignment")&&(this.layout._values["icon-rotation-alignment"]="point"!==this.layout.get("symbol-placement")?"map":"viewport"),"auto"===this.layout.get("text-rotation-alignment")&&(this.layout._values["text-rotation-alignment"]="point"!==this.layout.get("symbol-placement")?"map":"viewport"),"auto"===this.layout.get("text-pitch-alignment")&&(this.layout._values["text-pitch-alignment"]=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 i=this.layout.get("text-writing-mode");if(i){for(var n=[],a=0,s=i;a",targetMapId:i,sourceMapId:s.mapId});}}},ec.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 i=this.cancelCallbacks[r];delete this.cancelCallbacks[r],i&&i();}else k()||e.mustQueue?(this.tasks[r]=e,this.taskQueue.push(r),this.invoker.trigger()):this.processTask(r,e);},ec.prototype.process=function(){if(this.taskQueue.length){var t=this.taskQueue.shift(),e=this.tasks[t];delete this.tasks[t],this.taskQueue.length&&this.invoker.trigger(),e&&this.processTask(t,e);}},ec.prototype.processTask=function(t,e){var r=this;if(""===e.type){var i=this.callbacks[t];delete this.callbacks[t],i&&(e.error?i(ba(e.error)):i(null,ba(e.data)));}else {var n=!1,a=C(this.globalScope)?void 0:[],s=e.hasCallback?function(e,i){n=!0,delete r.cancelCallbacks[t],r.target.postMessage({id:t,type:"",sourceMapId:r.mapId,error:e?xa(e):null,data:xa(i,a)},a);}:function(t){n=!0;},o=null,u=ba(e.data);if(this.parent[e.type])o=this.parent[e.type](e.sourceMapId,u,s,e.sourceId);else if(this.parent.getWorkerSource){var h=e.type.split(".");o=this.parent.getWorkerSource(e.sourceMapId,h[0],u.source,u.crs)[h[1]](u,s);}else s(new Error("Could not find function "+e.type));!n&&o&&o.cancel&&(this.cancelCallbacks[t]=o.cancel);}},ec.prototype.remove=function(){this.invoker.remove(),this.target.removeEventListener("message",this.receive,!1);};var rc=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]));};rc.prototype.setNorthEast=function(t){return this._ne=t instanceof ic?new ic(t.lng,t.lat):ic.convert(t),this},rc.prototype.setSouthWest=function(t){return this._sw=t instanceof ic?new ic(t.lng,t.lat):ic.convert(t),this},rc.prototype.extend=function(t){var e,r,i=this._sw,n=this._ne;if(t instanceof ic)e=t,r=t;else {if(!(t instanceof rc))return Array.isArray(t)?4===t.length||t.every(Array.isArray)?this.extend(rc.convert(t)):this.extend(ic.convert(t)):this;if(r=t._ne,!(e=t._sw)||!r)return this}return i||n?(i.lng=Math.min(e.lng,i.lng),i.lat=Math.min(e.lat,i.lat),n.lng=Math.max(r.lng,n.lng),n.lat=Math.max(r.lat,n.lat)):(this._sw=new ic(e.lng,e.lat),this._ne=new ic(r.lng,r.lat)),this},rc.prototype.getCenter=function(){return new ic((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)},rc.prototype.getSouthWest=function(){return this._sw},rc.prototype.getNorthEast=function(){return this._ne},rc.prototype.getNorthWest=function(){return new ic(this.getWest(),this.getNorth())},rc.prototype.getSouthEast=function(){return new ic(this.getEast(),this.getSouth())},rc.prototype.getWest=function(){return this._sw.lng},rc.prototype.getSouth=function(){return this._sw.lat},rc.prototype.getEast=function(){return this._ne.lng},rc.prototype.getNorth=function(){return this._ne.lat},rc.prototype.toArray=function(){return [this._sw.toArray(),this._ne.toArray()]},rc.prototype.toString=function(){return "LngLatBounds("+this._sw.toString()+", "+this._ne.toString()+")"},rc.prototype.isEmpty=function(){return !(this._sw&&this._ne)},rc.prototype.contains=function(t){var e=ic.convert(t),r=e.lng,i=e.lat,n=this._sw.lng<=r&&r<=this._ne.lng;return this._sw.lng>this._ne.lng&&(n=this._sw.lng>=r&&r>=this._ne.lng),this._sw.lat<=i&&i<=this._ne.lat&&n},rc.convert=function(t){return !t||t instanceof rc?t:new rc(t)};var ic=function(t,e){if(isNaN(t)||isNaN(e))throw new Error("Invalid LngLat object: ("+t+", "+e+")");this.lng=+t,this.lat=+e;};ic.prototype.wrap=function(){return new ic(p(this.lng,-180,180),this.lat)},ic.prototype.toArray=function(){return [this.lng,this.lat]},ic.prototype.toString=function(){return "LngLat("+this.lng+", "+this.lat+")"},ic.prototype.distanceTo=function(t){var e=Math.PI/180,r=this.lat*e,i=t.lat*e,n=Math.sin(r)*Math.sin(i)+Math.cos(r)*Math.cos(i)*Math.cos((t.lng-this.lng)*e);return 6371008.8*Math.acos(Math.min(n,1))},ic.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 rc(new ic(this.lng-r,this.lat-e),new ic(this.lng+r,this.lat+e))},ic.convert=function(t){if(t instanceof ic)return t;if(Array.isArray(t)&&(2===t.length||3===t.length))return new ic(Number(t[0]),Number(t[1]));if(!Array.isArray(t)&&"object"==typeof t&&null!==t)return new ic(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 nc=2*Math.PI*6371008.8;function ac(t){return nc*Math.cos(t*Math.PI/180)}function sc(t,e){return t/ac(e)}function oc(t){return 360/Math.PI*Math.atan(Math.exp((180-360*t)*Math.PI/180))-90}var uc=function(t,e,r){void 0===r&&(r=0),this.x=+t,this.y=+e,this.z=+r;};uc.fromLngLat=function(t,e){void 0===e&&(e=0);var r=ic.convert(t);return new uc((180+r.lng)/360,(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+r.lat*Math.PI/360)))/360,sc(e,r.lat))},uc.prototype.toLngLat=function(){return new ic(360*this.x-180,oc(this.y))},uc.prototype.toAltitude=function(){return this.z*ac(oc(this.y))},uc.prototype.meterInMercatorCoordinateUnits=function(){return 1/nc*(t=oc(this.y),1/Math.cos(t*Math.PI/180));var t;};var hc=function(t,e,r,i){this.z=t,this.x=e,this.y=r,this.key=cc(0,t,t,e,r),i&&(this.indexExtent=i,this.worldWidth=i[2]-i[0],this.worldHeight=i[3]-i[1]);};hc.prototype.equals=function(t){return this.z===t.z&&this.x===t.x&&this.y===t.y},hc.prototype.getTileBBox=function(){var t=Math.pow(2,this.z);return this.indexExtent[0]+this.worldWidth*this.x/t+","+(this.indexExtent[3]-this.worldHeight*(this.y+1)/t)+","+(this.indexExtent[0]+this.worldWidth*(this.x+1)/t)+","+(this.indexExtent[3]-this.worldHeight*this.y/t)},hc.prototype.url=function(t,e,r,i,n){var a=this.getTileBBox(),s=function(t,e,r){for(var i,n="",a=t;a>0;a--)n+=(e&(i=1<this.canonical.z?new pc(t,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y,this.canonical.indexExtent):new pc(t,this.wrap,t,this.canonical.x>>e,this.canonical.y>>e,this.canonical.indexExtent)},pc.prototype.calculateScaledKey=function(t,e){var r=this.canonical.z-t;return t>this.canonical.z?cc(this.wrap*+e,t,this.canonical.z,this.canonical.x,this.canonical.y):cc(this.wrap*+e,t,t,this.canonical.x>>r,this.canonical.y>>r)},pc.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},pc.prototype.children=function(t){if(this.overscaledZ>=t)return [new pc(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y,this.canonical.indexExtent)];var e=this.canonical.z+1,r=2*this.canonical.x,i=2*this.canonical.y;return [new pc(e,this.wrap,e,r,i,this.canonical.indexExtent),new pc(e,this.wrap,e,r+1,i,this.canonical.indexExtent),new pc(e,this.wrap,e,r,i+1,this.canonical.indexExtent),new pc(e,this.wrap,e,r+1,i+1,this.canonical.indexExtent)]},pc.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)},fc.prototype._unpackMapbox=function(t,e,r){return (256*t*256+256*e+r)/10-1e4},fc.prototype._unpackTerrarium=function(t,e,r){return 256*t+e+r/256-32768},fc.prototype.getPixels=function(){return new Aa({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))},fc.prototype.backfillBorder=function(t,e,r){if(this.dim!==t.dim)throw new Error("dem dimension mismatch");var i=e*this.dim,n=e*this.dim+this.dim,a=r*this.dim,s=r*this.dim+this.dim;switch(e){case-1:i=n-1;break;case 1:n=i+1;}switch(r){case-1:a=s-1;break;case 1:s=a+1;}for(var o=-e*this.dim,u=-r*this.dim,h=a;h=0&&l[3]>=0&&o.insert(s,l[0],l[1],l[2],l[3]);}},gc.prototype.loadVTLayers=function(){return this.vtLayers||(this.vtLayers=new Rh.VectorTile(new ml(this.rawTileData)).layers,this.sourceLayerCoder=new yc(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers},gc.prototype.query=function(t,e,r,i){var a=this;this.loadVTLayers();for(var s=t.params||{},o=8192/t.tileSize/t.scale,u=Ga(s.filter),h=t.queryGeometry,l=t.queryPadding*o,p=bc(h),c=this.grid.query(p.minX-l,p.minY-l,p.maxX+l,p.maxY+l),f=bc(t.cameraQueryGeometry),y=this.grid3D.query(f.minX-l,f.minY-l,f.maxX+l,f.maxY+l,(function(e,r,i,a){return function(t,e,r,i,a){for(var s=0,o=t;s=u.x&&a>=u.y)return !0}var h=[new n(e,r),new n(e,a),new n(i,a),new n(i,r)];if(t.length>2)for(var l=0,p=h;l=0)return !0;return !1}(a,p)){var c=this.sourceLayerCoder.decode(r),f=this.vtLayers[c].feature(i);if(n.filter(new Ts(this.tileID.overscaledZ),f))for(var y=this.getId(f,c),d=0;di)n=!1;else if(e)if(this.expirationTimePr&&(t.getActor().send("enforceCacheSizeLimit",Er),Lr=0);},t.cass=Re,t.cea=Xe,t.clamp=l,t.clearTileCache=function(t){var e=s.caches.delete("mapbox-tiles");t&&e.catch(t).then((function(){return t()}));},t.clipLine=cp,t.clone=function(t){var e=new Pu(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=_,t.clone$2=function(t){var e=new Pu(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e},t.collisionCircleLayout=pl,t.config=N,t.create=function(){var t=new Pu(16);return Pu!=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 Pu(9);return Pu!=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 Pu(4);return Pu!=Float32Array&&(t[1]=0,t[2]=0),t[0]=1,t[3]=1,t},t.createCommonjsModule=e,t.createExpression=oa,t.createLayout=Qs,t.createStyleLayer=function(t){return "custom"===t.type?new Xp(t):new Hp[t.type](t)},t.cross=function(t,e,r){var i=e[0],n=e[1],a=e[2],s=r[0],o=r[1],u=r[2];return t[0]=n*u-a*o,t[1]=a*s-i*u,t[2]=i*o-n*s,t},t.deepEqual=function t(e,r){if(Array.isArray(e)){if(!Array.isArray(r)||e.length!==r.length)return !1;for(var i=0;i0&&(a=1/Math.sqrt(a)),t[0]=e[0]*a,t[1]=e[1]*a,t[2]=e[2]*a,t},t.number=an,t.nzmg=Ze,t.offscreenCanvasSupported=Fr,t.omerc=Ce,t.ortho=function(t,e,r,i,n,a,s){var o=1/(e-r),u=1/(i-n),h=1/(a-s);return t[0]=-2*o,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*u,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*h,t[11]=0,t[12]=(e+r)*o,t[13]=(n+i)*u,t[14]=(s+a)*h,t[15]=1,t},t.ortho$1=rr,t.parseCode=mt,t.parseGlyphPBF=function(t){return new ml(t).readFields(Vl,[])},t.pbf=ml,t.performSymbolLayout=function(t,e,r,i,n,a,s){t.createArrays(),t.tilePixelRatio=8192/(512*t.overscaling),t.compareText={},t.iconsNeedLinear=!1;var o=t.layers[0].layout,u=t.layers[0]._unevaluatedLayout._values,h={};if("composite"===t.textSizeData.kind){var l=t.textSizeData,p=l.maxZoom;h.compositeTextSizes=[u["text-size"].possiblyEvaluate(new Ts(l.minZoom),s),u["text-size"].possiblyEvaluate(new Ts(p),s)];}if("composite"===t.iconSizeData.kind){var c=t.iconSizeData,f=c.maxZoom;h.compositeIconSizes=[u["icon-size"].possiblyEvaluate(new Ts(c.minZoom),s),u["icon-size"].possiblyEvaluate(new Ts(f),s)];}h.layoutTextSize=u["text-size"].possiblyEvaluate(new Ts(t.zoom+1),s),h.layoutIconSize=u["icon-size"].possiblyEvaluate(new Ts(t.zoom+1),s),h.textMaxSize=u["text-size"].possiblyEvaluate(new Ts(18));for(var y=24*o.get("text-line-height"),d="map"===o.get("text-rotation-alignment")&&"point"!==o.get("symbol-placement"),m=o.get("text-keep-upright"),v=o.get("text-size"),g=function(){var a=b[x],u=o.get("text-font").evaluate(a,{},s).join(","),l=v.evaluate(a,{},s),p=h.layoutTextSize.evaluate(a,{},s),c=h.layoutIconSize.evaluate(a,{},s),f={horizontal:{},vertical:void 0},g=a.text,_=[0,0];if(g){var w=g.toString(),S=24*o.get("text-letter-spacing").evaluate(a,{},s),A=function(t){for(var e=0,r=t;e=8192||p.y<0||p.y>=8192||function(t,e,r,i,n,a,s,o,u,h,l,p,c,f,y,d,m,v,g,x,b,_,w,S,A){var k,I,z,C,E,P=t.addToLineVertexArray(e,r),B=0,T=0,V=0,L=0,F=-1,O=-1,D={},N=No(""),R=0,q=0;if(void 0===o._unevaluatedLayout.getValue("text-radial-offset")?(R=(k=o.layout.get("text-offset").evaluate(b,{},S).map((function(t){return 24*t})))[0],q=k[1]):(R=24*o.layout.get("text-radial-offset").evaluate(b,{},S),q=Sp),t.allowVerticalPlacement&&i.vertical){var j=o.layout.get("text-rotate").evaluate(b,{},S)+90;C=new gp(u,e,h,l,p,i.vertical,c,f,y,j),s&&(E=new gp(u,e,h,l,p,s,m,v,y,j));}if(n){var U=o.layout.get("icon-rotate").evaluate(b,{}),G="none"!==o.layout.get("icon-text-fit"),K=fp(n,U,w,G),X=s?fp(s,U,w,G):void 0;z=new gp(u,e,h,l,p,n,m,v,!1,U),B=4*K.length;var H=t.iconSizeData,J=null;"source"===H.kind?(J=[128*o.layout.get("icon-size").evaluate(b,{})])[0]>32640&&M(t.layerIds[0]+': Value for "icon-size" is >= 255. Reduce your "icon-size".'):"composite"===H.kind&&((J=[128*_.compositeIconSizes[0].evaluate(b,{},S),128*_.compositeIconSizes[1].evaluate(b,{},S)])[0]>32640||J[1]>32640)&&M(t.layerIds[0]+': Value for "icon-size" is >= 255. Reduce your "icon-size".'),t.addSymbols(t.icon,K,J,x,g,b,!1,e,P.lineStartIndex,P.lineLength,-1,S),F=t.icon.placedSymbolArray.length-1,X&&(T=4*X.length,t.addSymbols(t.icon,X,J,x,g,b,ql.vertical,e,P.lineStartIndex,P.lineLength,-1,S),O=t.icon.placedSymbolArray.length-1);}for(var Z in i.horizontal){var Y=i.horizontal[Z];if(!I){N=No(Y.text);var W=o.layout.get("text-rotate").evaluate(b,{},S);I=new gp(u,e,h,l,p,Y,c,f,y,W);}var Q=1===Y.positionedLines.length;if(V+=Ip(t,e,Y,a,o,y,b,d,P,i.vertical?ql.horizontal:ql.horizontalOnly,Q?Object.keys(i.horizontal):[Z],D,F,_,S),Q)break}i.vertical&&(L+=Ip(t,e,i.vertical,a,o,y,b,d,P,ql.vertical,["vertical"],D,O,_,S));var $=I?I.boxStartIndex:t.collisionBoxArray.length,tt=I?I.boxEndIndex:t.collisionBoxArray.length,et=C?C.boxStartIndex:t.collisionBoxArray.length,rt=C?C.boxEndIndex:t.collisionBoxArray.length,it=z?z.boxStartIndex:t.collisionBoxArray.length,nt=z?z.boxEndIndex:t.collisionBoxArray.length,at=E?E.boxStartIndex:t.collisionBoxArray.length,st=E?E.boxEndIndex:t.collisionBoxArray.length,ot=-1,ut=function(t,e){return t&&t.circleDiameter?Math.max(t.circleDiameter,e):e};ot=ut(I,ot),ot=ut(C,ot),ot=ut(z,ot);var ht=(ot=ut(E,ot))>-1?1:0;ht&&(ot*=A/24),t.glyphOffsetArray.length>=Op.MAX_GLYPHS&&M("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),void 0!==b.sortKey&&t.addToSortKeyRanges(t.symbolInstances.length,b.sortKey),t.symbolInstances.emplaceBack(e.x,e.y,D.right>=0?D.right:-1,D.center>=0?D.center:-1,D.left>=0?D.left:-1,D.vertical||-1,F,O,N,$,tt,et,rt,it,nt,at,st,h,V,L,B,T,ht,0,c,R,q,ot);}(t,p,o,r,i,n,c,t.layers[0],t.collisionBoxArray,e.index,e.sourceLayerIndex,t.index,v,_,A,u,x,w,k,y,e,a,h,l,s);};if("line"===I)for(var P=0,B=cp(e.geometry,0,0,8192,8192);P1){var R=lp(N,S,r.vertical||d,i,24,g);R&&E(N,R);}}else if("Polygon"===e.type)for(var q=0,j=Mh(e.geometry,0);q=C.maxzoom||"none"!==C.visibility&&(s(k,this.zoom,o),(g[C.id]=C.createBucket({index:h.bucketLayerIDs.length,layers:k,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:w,sourceID:this.source})).populate(S,v,this.tileID.canonical),h.bucketLayerIDs.push(k.map((function(e){return e.id}))));}}}var T=e.mapObject(v.glyphDependencies,(function(e){return Object.keys(e).map(Number)}));Object.keys(T).length?n.send("getGlyphs",{uid:this.uid,stacks:T},(function(e,t){p||(p=e,c=t,j.call(l));}),!1,this.source):c={};var L=Object.keys(v.iconDependencies);L.length?n.send("getImages",{icons:L,source:this.source,tileID:this.tileID,type:"icons"},(function(e,t){p||(p=e,f=t,j.call(l));}),!1,this.source):f={};var D=Object.keys(v.patternDependencies);function j(){if(p)return a(p);if(c&&f&&d){var t=new i(c),r=new e.ImageAtlas(f,d);for(var n in g){var l=g[n];l instanceof e.SymbolBucket?(s(l.layers,this.zoom,o),e.performSymbolLayout(l,c,t.positions,f,r.iconPositions,this.showCollisionBoxes,this.tileID.canonical)):l.hasPattern&&(l instanceof e.LineBucket||l instanceof e.FillBucket||l instanceof e.FillExtrusionBucket)&&(s(l.layers,this.zoom,o),l.addFeatures(v,this.tileID.canonical,r.patternPositions));}this.status="done",a(null,{buckets:e.values(g).filter((function(e){return !e.isEmpty()})),featureIndex:h,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:t.image,imageAtlas:r,glyphMap:this.returnDependencies?c:null,iconMap:this.returnDependencies?f:null,glyphPositions:this.returnDependencies?t.positions:null});}}D.length?n.send("getImages",{icons:D,source:this.source,tileID:this.tileID,type:"patterns"},(function(e,t){p||(p=e,d=t,j.call(l));}),!1,this.source):d={},j.call(this);};var l=function(e,t,r,o){this.actor=e,this.layerIndex=t,this.availableImages=r,this.loadVectorData=o||a,this.loading={},this.loaded={};};l.prototype.loadTile=function(t,r){var o=this,i=t.uid;this.loading||(this.loading={});var s=!!(t&&t.request&&t.request.collectResourceTiming)&&new e.RequestPerformance(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 h={};if(s){var p=s.finish();p&&(h.resourceTiming=JSON.parse(JSON.stringify(p)));}a.vectorTile=n.vectorTile,a.parse(n.vectorTile,o.layerIndex,o.availableImages,o.actor,(function(t,o){if(t||!o)return r(t);r(null,e.extend({rawTileData:l.slice(0)},o,u,h));})),o.loaded=o.loaded||{},o.loaded[i]=a;}));},l.prototype.reloadTile=function(e,t){var r=this,o=this.loaded,i=e.uid,n=this;if(o&&o[i]){var s=o[i];s.showCollisionBoxes=e.showCollisionBoxes;var a=function(e,o){var i=s.reloadCallback;i&&(delete s.reloadCallback,s.parse(s.vectorTile,n.layerIndex,r.availableImages,n.actor,i)),t(e,o);};"parsing"===s.status?s.reloadCallback=a:"done"===s.status&&(s.vectorTile?s.parse(s.vectorTile,this.layerIndex,this.availableImages,this.actor,a):a());}},l.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();},l.prototype.removeTile=function(e,t){var r=this.loaded,o=e.uid;r&&r[o]&&delete r[o],t();};var u=e.window.ImageBitmap,h=function(){this.loaded={};};function p(e,t){if(0!==e.length){c(e[0],t);for(var r=1;r=0!=!!t&&e.reverse();}h.prototype.loadTile=function(t,r){var o=t.uid,i=t.encoding,n=t.rawImageData,s=u&&n instanceof u?this.getImageData(n):n,a=new e.DEMData(o,s,i);this.loaded=this.loaded||{},this.loaded[o]=a,r(null,a);},h.prototype.getImageData=function(t){this.offscreenCanvas&&this.offscreenCanvasContext||(this.offscreenCanvas=new OffscreenCanvas(t.width,t.height),this.offscreenCanvasContext=this.offscreenCanvas.getContext("2d")),this.offscreenCanvas.width=t.width,this.offscreenCanvas.height=t.height,this.offscreenCanvasContext.drawImage(t,0,0,t.width,t.height);var r=this.offscreenCanvasContext.getImageData(-1,-1,t.width+2,t.height+2);return this.offscreenCanvasContext.clearRect(0,0,this.offscreenCanvas.width,this.offscreenCanvas.height),new e.RGBAImage({width:r.width,height:r.height},r.data)},h.prototype.removeTile=function(e){var t=this.loaded,r=e.uid;t&&t[r]&&delete t[r];};var f=e.mvt.VectorTileFeature.prototype.toGeoJSON,d=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));};d.prototype.loadGeometry=function(){if(1===this._feature.type){for(var t=[],r=0,o=this._feature.geometry;r>3;}if(n--,1===i||2===i)s+=t.readSVarint(),a+=t.readSVarint(),1===i&&(r&&l.push(r),r=[]),r.push(new e.Point$1(s,a));else {if(7!==i)throw new Error("unknown command "+i);r&&r.push(r[0].clone());}}return r&&l.push(r),l},m.prototype.bbox=function(){var e=this._pbf;e.pos=this._geometry;for(var t=e.readVarint()+e.pos,r=1,o=0,i=0,n=0,s=1/0,a=-1/0,l=1/0,u=-1/0;e.pos>3;}if(o--,1===r||2===r)(i+=e.readSVarint())a&&(a=i),(n+=e.readSVarint())u&&(u=n);else if(7!==r)throw new Error("unknown command "+r)}return [s,l,a,u]},m.prototype.toGeoJSON=function(e,t,r){var o,i,n=this.extent*Math.pow(2,r),s=this.extent*e,a=this.extent*t,l=this.loadGeometry(),u=m.types[this.type];function h(e){for(var t=0;t>3;t=1===o?e.readString():2===o?e.readFloat():3===o?e.readDouble():4===o?e.readVarint64():5===o?e.readVarint():6===o?e.readSVarint():7===o?e.readBoolean():null;}return t}(r));}function M(e,t,r){if(3===e){var o=new b(r,r.readVarint()+r.pos);o.length&&(t[o.name]=o);}}_.prototype.feature=function(e){if(e<0||e>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[e];var t=this._pbf.readVarint()+this._pbf.pos;return new v(this._pbf,t,this.extent,this._keys,this._values)};var P={VectorTile:function(e,t){this.layers=e.readFields(M,{},t);},VectorTileFeature:v,VectorTileLayer:b}.VectorTileFeature,k=C;function C(e,t){this.options=t||{},this.features=e,this.length=e.length;}function T(e,t){this.id="number"==typeof e.id?e.id:void 0,this.type=e.type,this.rawGeometry=1===e.type?[e.geometry]:e.geometry,this.properties=e.tags,this.extent=t||4096;}C.prototype.feature=function(e){return new T(this.features[e],this.options.extent)},T.prototype.loadGeometry=function(){var t=this.rawGeometry;this.geometry=[];for(var r=0;r>31}function N(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),h=.5*Math.exp(2*u/3),p=.5*Math.sqrt(u*h*(a-h)/a)*(l-a/2<0?-1:1);e(t,r,o,Math.max(i,Math.floor(o-l*h/a+p)),Math.min(n,Math.floor(o+(a-l)*h/a+p)),s);}var c=r[2*o+s],f=i,d=n;for(B(t,r,i,o),r[2*n+s]>c&&B(t,r,i,n);fc;)d--;}r[2*i+s]===c?B(t,r,i,d):B(t,r,++d,n),d<=o&&(i=d+1),o<=d&&(n=d-1);}}(t,r,a,i,n,s%2),e(t,r,o,i,a-1,s+1),e(t,r,o,a+1,n,s+1);}}(s,a,o,0,s.length-1,0);};X.prototype.range=function(e,t,r,o){return function(e,t,r,o,i,n,s){for(var a,l,u=[0,e.length-1,0],h=[];u.length;){var p=u.pop(),c=u.pop(),f=u.pop();if(c-f<=s)for(var d=f;d<=c;d++)l=t[2*d+1],(a=t[2*d])>=r&&a<=i&&l>=o&&l<=n&&h.push(e[d]);else {var g=Math.floor((f+c)/2);l=t[2*g+1],(a=t[2*g])>=r&&a<=i&&l>=o&&l<=n&&h.push(e[g]);var v=(p+1)%2;(0===p?r<=a:o<=l)&&(u.push(f),u.push(g-1),u.push(v)),(0===p?i>=a:n>=l)&&(u.push(g+1),u.push(c),u.push(v));}}return h}(this.ids,this.coords,e,t,r,o,this.nodeSize)},X.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(),h=s.pop(),p=s.pop();if(h-p<=n)for(var c=p;c<=h;c++)Z(t[2*c],t[2*c+1],r,o)<=l&&a.push(e[c]);else {var f=Math.floor((p+h)/2),d=t[2*f],g=t[2*f+1];Z(d,g,r,o)<=l&&a.push(e[f]);var v=(u+1)%2;(0===u?r-i<=d:o-i<=g)&&(s.push(p),s.push(f-1),s.push(v)),(0===u?r+i>=d:o+i>=g)&&(s.push(f+1),s.push(h),s.push(v));}}return a}(this.ids,this.coords,e,t,r,this.nodeSize)};var W={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:function(e){return e}},R=function(e){this.options=te(Object.create(W),e),this.trees=new Array(this.options.maxZoom+1);};function q(e,t,r,o,i){return {x:e,y:t,zoom:1/0,id:r,parentId:-1,numPoints:o,properties:i}}function U(e,t,r){var o,i,n=e.geometry.coordinates,s=n[0],a=n[1];return {x:(i="object"==typeof customConvertPoint?customConvertPoint.projectXY(s,a,r):[(o=s,o/360+.5),H(a)])[0],y:i[1],zoom:1/0,index:t,parentId:-1}}function $(e,t){var r;return r="object"==typeof customConvertPoint?customConvertPoint.toLngLat(e.x,e.y,t):[Q(x),ee(y)],{type:"Feature",id:e.id,properties:K(e),geometry:{type:"Point",coordinates:r}}}function K(e){var t=e.numPoints,r=t>=1e4?Math.round(t/1e3)+"k":t>=1e3?Math.round(t/100)/10+"k":t;return te(te({},e.properties),{cluster:!0,cluster_id:e.id,point_count:t,point_count_abbreviated:r})}function H(e){var t=Math.sin(e*Math.PI/180),r=.5-.25*Math.log((1+t)/(1-t))/Math.PI;return r<0?0:r>1?1:r}function Q(e){return 360*(e-.5)}function ee(e){var t=(180-360*e)*Math.PI/180;return 360*Math.atan(Math.exp(t))/Math.PI-90}function te(e,t){for(var r in t)e[r]=t[r];return e}function re(e){return e.x}function oe(e){return e.y}function ie(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 ne(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)se(e,t);else if("Polygon"===r||"MultiLineString"===r)for(var o=0;o0&&(a+=o?(n*p-h*s)/2:Math.sqrt(Math.pow(h-n,2)+Math.pow(p-s,2))),n=h,s=p;}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],h=t[r+1],p=t[o],c=t[o+1],f=r+3;fs)n=f,s=d;else if(d===s){var g=Math.abs(f-a);gi&&(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(a),t.start=0,t.end=t.size;}function he(e,t,r,o,i){for(var n=0;n=(r/=t)&&s=o)return null;for(var l=[],u=0;u=r&&d=o)){var g=[];if("Point"===c||"MultiPoint"===c)ce(p,g,r,o,i);else if("LineString"===c)fe(p,g,r,o,i,!1,a.lineMetrics);else if("MultiLineString"===c)ge(p,g,r,o,i,!1);else if("Polygon"===c)ge(p,g,r,o,i,!0);else if("MultiPolygon"===c)for(var v=0;v=r&&s<=o&&(t.push(e[n]),t.push(e[n+1]),t.push(e[n+2]));}}function fe(e,t,r,o,i,n,s){for(var a,l,u=de(e),h=0===i?me:ye,p=e.start,c=0;cr&&(l=h(u,f,d,v,m,r),s&&(u.start=p+a*l)):y>o?x=r&&(l=h(u,f,d,v,m,r),w=!0),x>o&&y<=o&&(l=h(u,f,d,v,m,o),w=!0),!n&&w&&(s&&(u.end=p+a*l),t.push(u),u=de(e)),s&&(p+=a);}var S=e.length-3;f=e[S],d=e[S+1],g=e[S+2],(y=0===i?f:d)>=r&&y<=o&&ve(u,f,d,g),S=u.length-3,n&&S>=3&&(u[S]!==u[0]||u[S+1]!==u[1])&&ve(u,u[0],u[1],u[2]),u.length&&t.push(u);}function de(e){var t=[];return t.size=e.size,t.start=e.start,t.end=e.end,t}function ge(e,t,r,o,i,n){for(var s=0;ss.maxX&&(s.maxX=h),p>s.maxY&&(s.maxY=p);}return s}function Ie(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;o24)throw new Error("maxZoom should be in the 0-24 range");if(t.promoteId&&t.generateId)throw new Error("promoteId and generateId cannot be used together.");var o=function(e,t){if(t.customprj&&"undefined"==typeof customConvertPoint)try{importScripts(t.customprj);}catch(e){console.log(e);}if(!t.customprj&&"undefined"!=typeof customConvertPoint)try{customConvertPoint=void 0;}catch(e){console.log(e);}var r=[];if("FeatureCollection"===e.type)for(var o=0;o=o;u--){var h=+Date.now();a=this._cluster(a,u),this.trees[u]=new X(a,re,oe,n,Float32Array),r&&console.log("z%d: %d clusters in %dms",u,a.length,+Date.now()-h);}return r&&console.timeEnd("total time"),this},R.prototype.getClusters=function(e,t){var r=((e[0]+180)%360+360)%360-180,o=Math.max(-90,Math.min(90,e[1])),i=180===e[2]?180:((e[2]+180)%360+360)%360-180,n=Math.max(-90,Math.min(90,e[3]));if(e[2]-e[0]>=360)r=-180,i=180;else if(r>i){var s=this.getClusters([r,o,180,n],t),a=this.getClusters([-180,o,i,n],t);return s.concat(a)}for(var l=this.trees[this._limitZoom(t)],u=lngLatXY(r,o),h=lngLatXY(r,i),p=[],c=0,f=l.range(u[0],h[1],h[0],u[1]);ct&&(c+=g.numPoints||1);}if(c>=n){for(var v=l.x*p,m=l.y*p,y=i&&p>1?this._map(l,!0):null,x=(a<<5)+(t+1)+this.points.length,w=0,S=h;w1)for(var I=0,M=h;I>5},R.prototype._getOriginZoom=function(e){return (e-this.points.length)%32},R.prototype._map=function(e,t){if(e.numPoints)return t?te({},e.properties):e.properties;var r=this.points[e.index].properties,o=this.options.map(r);return t&&o===r?te({},o):o},Pe.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},Pe.prototype.splitTile=function(e,t,r,o,i,n,s){for(var a=[e,t,r,o],l=this.options,u=l.debug;a.length;){o=a.pop(),r=a.pop(),t=a.pop(),e=a.pop();var h=1<1&&console.time("creation"),c=this.tiles[p]=_e(e,t,r,o,l),this.tileCoords.push({z:t,x:r,y:o}),u)){u>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",t,r,o,c.numFeatures,c.numPoints,c.numSimplified),console.timeEnd("creation"));var f="z"+t;this.stats[f]=(this.stats[f]||0)+1,this.total++;}if(c.source=e,i){if(t===l.maxZoom||t===i)continue;var d=1<1&&console.time("clipping");var g,v,m,y,x,w,S=.5*l.buffer/l.extent,b=.5-S,_=.5+S,I=1+S;g=v=m=y=null,x=pe(e,h,r-S,r+_,0,c.minX,c.maxX,l),w=pe(e,h,r+b,r+I,0,c.minX,c.maxX,l),e=null,x&&(g=pe(x,h,o-S,o+_,1,c.minY,c.maxY,l),v=pe(x,h,o+b,o+I,1,c.minY,c.maxY,l),x=null),w&&(m=pe(w,h,o-S,o+_,1,c.minY,c.maxY,l),y=pe(w,h,o+b,o+I,1,c.minY,c.maxY,l),w=null),u>1&&console.timeEnd("clipping"),a.push(g||[],t+1,2*r,2*o),a.push(v||[],t+1,2*r,2*o+1),a.push(m||[],t+1,2*r+1,2*o),a.push(y||[],t+1,2*r+1,2*o+1);}}},Pe.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=1<1&&console.log("drilling down to z%d-%d-%d",e,t,r);for(var l,u=e,h=t,p=r;!l&&u>0;)u--,h=Math.floor(h/2),p=Math.floor(p/2),l=this.tiles[ke(u,h,p)];return l&&l.source?(n>1&&console.log("found parent tile z%d-%d-%d",u,h,p),n>1&&console.time("drilling down"),this.splitTile(l.source,u,h,p,e,t,r),n>1&&console.timeEnd("drilling down"),this.tiles[a]?Se(this.tiles[a],i):null):null};var Te=function(t){function r(e,r,o,i,n){t.call(this,e,r,o,Ce),i&&(this.loadGeoJSON=i),this.projction=n;}return t&&(r.__proto__=t),(r.prototype=Object.create(t&&t.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 e.RequestPerformance(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."));!function e(t,r){var o,i=t&&t.type;if("FeatureCollection"===i)for(o=0;o1?"@2x":"",l=t.getJSON(i.transformRequest(i.normalizeSpriteURL(e,s,".json"),t.ResourceType.SpriteJSON),(function(t,e){l=null,n||(n=t,r=e,h());})),c=t.getImage(i.transformRequest(i.normalizeSpriteURL(e,s,".png"),t.ResourceType.SpriteImage),(function(t,e){c=null,n||(n=t,a=e,h());}));function h(){if(n)o(n);else if(r&&a){var e=t.browser.getImageData(a),i={};for(var s in r){var l=r[s],c=l.width,h=l.height,u=l.x,p=l.y,d=l.sdf,_=l.pixelRatio,f=l.stretchX,m=l.stretchY,g=l.content,v=new t.RGBAImage({width:c,height:h});t.RGBAImage.copy(e,v,{x:u,y:p},{x:0,y:0},{width:c,height:h}),i[s]={data:v,pixelRatio:_,sdf:d,stretchX:f,stretchY:m,content:g};}o(null,i);}}return {cancel:function(){l&&(l.cancel(),l=null),c&&(c.cancel(),c=null);}}}function p(t){var e=t.userImage;return !!(e&&e.render&&e.render())&&(t.data.replace(new Uint8Array(e.data.buffer)),!0)}i.suppressClick=function(){t.window.addEventListener("click",h,!0),t.window.setTimeout((function(){t.window.removeEventListener("click",h,!0);}),0);},i.mousePos=function(e,i){var o=e.getBoundingClientRect();return new t.Point(i.clientX-o.left-e.clientLeft,i.clientY-o.top-e.clientTop)},i.touchPos=function(e,i){for(var o=e.getBoundingClientRect(),r=[],a=0;a=0?0:e.button},i.remove=function(t){t.parentNode&&t.parentNode.removeChild(t);};var d=function(e){function i(){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&&(i.__proto__=e),(i.prototype=Object.create(e&&e.prototype)).constructor=i,i.prototype.isLoaded=function(){return this.loaded},i.prototype.setLoaded=function(t){if(this.loaded!==t&&(this.loaded=t,t)){for(var e=0,i=this.requestors;e=0?1.2:1));}function y(t,e,i,o,r,a,n){for(var s=0;s65535)e(new Error("glyphs > 65535 not supported"));else if(a.ranges[s])e(null,{stack:i,id:r,glyph:n});else {var l=a.requests[s];l||(l=a.requests[s]=[],b.loadGlyphRange(i,s,o.url,o.requestManager,(function(t,e){if(e){for(var i in e)o._doesCharSupportLocalGlyph(+i)||(a.glyphs[+i]=e[+i]);a.ranges[s]=!0;}for(var r=0,n=l;r1&&(s=t[++n]);var c=Math.abs(l-s.left),h=Math.abs(l-s.right),u=Math.min(c,h),p=void 0,d=r/i*(o+1);if(s.isDash){var _=o-Math.abs(d);p=Math.sqrt(u*u+_*_);}else p=o-Math.sqrt(u*u+d*d);this.data[a+l]=Math.max(0,Math.min(255,p+128));}},I.prototype.addRegularDash=function(t){for(var e=t.length-1;e>=0;--e){var i=t[e],o=t[e+1];i.zeroLength?t.splice(e,1):o&&o.isDash===i.isDash&&(o.left=i.left,t.splice(e,1));}var r=t[0],a=t[t.length-1];r.isDash===a.isDash&&(r.left=a.left-this.width,a.right=r.right+this.width);for(var n=this.width*this.nextRow,s=0,l=t[s],c=0;c1&&(l=t[++s]);var h=Math.abs(c-l.left),u=Math.abs(c-l.right),p=Math.min(h,u);this.data[n+c]=Math.max(0,Math.min(255,(l.isDash?p:-p)+128));}},I.prototype.addDash=function(e,i){var o=i?7:0,r=2*o+1;if(this.nextRow+r>this.height)return t.warnOnce("LineAtlas out of space"),null;for(var a=0,n=0;n=m&&t.x=g&&t.y0&&(l[new t.OverscaledTileID(e.overscaledZ,a,i.z,r,i.y-1).key]={backfilled:!1},l[new t.OverscaledTileID(e.overscaledZ,e.wrap,i.z,i.x,i.y-1).key]={backfilled:!1},l[new t.OverscaledTileID(e.overscaledZ,s,i.z,n,i.y-1).key]={backfilled:!1}),i.y+10&&(o.resourceTiming=e._resourceTiming,e._resourceTiming=[]),e.fire(new t.Event("data",o));}}));},i.prototype.onAdd=function(t){this.map=t,this.workerOptions.crs={epsgCode:this.map.getCRS().epsgCode,WKT:this.map.getCRS().getWKT(),_id:this.map.getCRS()._id},this.load();},i.prototype.setCustomprj=function(t){this._options.customprj=t,this.workerOptions.superclusterOptions.customprj=t,this.workerOptions.geojsonVtOptions.customprj=t,this.workerOptions.crs={epsgCode:this.map.getCRS().epsgCode,WKT:this.map.getCRS().getWKT(),_id:this.map.getCRS()._id},this.load();},i.prototype.setData=function(e){var i=this;return this._data=e,this.fire(new t.Event("dataloading",{dataType:"source"})),this._updateWorkerData((function(e){if(e)i.fire(new t.ErrorEvent(e));else {var o={dataType:"source",sourceDataType:"content"};i._collectResourceTiming&&i._resourceTiming&&i._resourceTiming.length>0&&(o.resourceTiming=i._resourceTiming,i._resourceTiming=[]),i.fire(new t.Event("data",o));}})),this},i.prototype.getData=function(){return this._originData?this._originData:"string"!=typeof this._data?this._data:void 0},i.prototype.getClusterExpansionZoom=function(t,e){return this.actor.send("geojson.getClusterExpansionZoom",{clusterId:t,source:this.id},e),this},i.prototype.getClusterChildren=function(t,e){return this.actor.send("geojson.getClusterChildren",{clusterId:t,source:this.id},e),this},i.prototype.getClusterLeaves=function(t,e,i,o){return this.actor.send("geojson.getClusterLeaves",{source:this.id,clusterId:t,limit:e,offset:i},o),this},i.prototype._updateWorkerData=function(e){var i=this;this._loaded=!1;var o=t.extend({},this.workerOptions),r=this._data;"string"==typeof r?(o.request=this.map._requestManager.transformRequest(t.browser.resolveURL(r),t.ResourceType.Source),o.request.collectResourceTiming=this._collectResourceTiming):o.data=JSON.stringify(r),this.actor.send(this.type+".loadData",o,(function(t,r){i._originData=r.data||null,i._removed||r&&r.abandoned||(i._loaded=!0,r&&r.resourceTiming&&r.resourceTiming[i.id]&&(i._resourceTiming=r.resourceTiming[i.id].slice(0)),i.actor.send(i.type+".coalesce",{source:o.source},null),e(t));}));},i.prototype.loaded=function(){return this._loaded},i.prototype.loadTile=function(e,i){var o=this,r=e.actor?"reloadTile":"loadTile";e.actor=this.actor,e.request=this.actor.send(r,{type:this.type,uid:e.uid,tileID:e.tileID,zoom:e.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:t.browser.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId},(function(t,a){return delete e.request,e.unloadVectorData(),e.aborted?i(null):t?i(t):(e.loadVectorData(a,o.map.painter,"reloadTile"===r),i(null))}));},i.prototype.abortTile=function(t){t.request&&(t.request.cancel(),delete t.request),t.aborted=!0;},i.prototype.unloadTile=function(t){t.unloadVectorData(),this.actor.send("removeTile",{uid:t.uid,type:this.type,source:this.id});},i.prototype.onRemove=function(){this._removed=!0,this.actor.send("removeSource",{type:this.type,source:this.id});},i.prototype.serialize=function(){return t.extend({},this._options,{type:this.type,data:this._data})},i.prototype.hasTransition=function(){return !1},i}(t.Evented),A=t.createLayout([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]),k=function(e){function i(t,i,o,r){e.call(this),this.id=t,this.dispatcher=o,this.coordinates=i.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(r),this.options=i;}return e&&(i.__proto__=e),(i.prototype=Object.create(e&&e.prototype)).constructor=i,i.prototype.load=function(e,i){var o=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(r,a){o._loaded=!0,r?o.fire(new t.ErrorEvent(r)):a&&(o.image=a,e&&(o.coordinates=e),i&&i(),o._finishLoading());}));},i.prototype.loaded=function(){return this._loaded},i.prototype.updateImage=function(t){var e=this;return this.image&&t.url?(this.options.url=t.url,this.load(t.coordinates,(function(){e.texture=null;})),this):this},i.prototype._finishLoading=function(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new t.Event("data",{dataType:"source",sourceDataType:"metadata"})));},i.prototype.onAdd=function(t){this.map=t,this.load();},i.prototype.setCoordinates=function(e){var i=this;this.coordinates=e;var o=e.map((function(t){return i.map.getCRS().fromLngLat(t)}));this.tileID=function(e,i){for(var o=1/0,r=1/0,a=-1/0,n=-1/0,s=0,l=e;si.end(0)?this.fire(new t.ErrorEvent(new t.ValidationError("sources."+this.id,null,"Playback for this video can be set only between the "+i.start(0)+" and "+i.end(0)+"-second mark."))):this.video.currentTime=e;}},i.prototype.getVideo=function(){return this.video},i.prototype.onAdd=function(t){this.map||(this.map=t,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)));},i.prototype.prepare=function(){if(!(0===Object.keys(this.tiles).length||this.video.readyState<2)){var e=this.map.painter.context,i=e.gl;for(var o in this.boundsBuffer||(this.boundsBuffer=e.createVertexBuffer(this._boundsArray,A.members)),this.boundsSegments||(this.boundsSegments=t.SegmentVector.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(i.LINEAR,i.CLAMP_TO_EDGE),i.texSubImage2D(i.TEXTURE_2D,0,0,0,i.RGBA,i.UNSIGNED_BYTE,this.video),this._firstFrameRendered=!0):(this.texture=new t.Texture(e,this.video,i.RGBA),this.texture.bind(i.LINEAR,i.CLAMP_TO_EDGE)),this.tiles){var r=this.tiles[o];"loaded"!==r.state&&(r.state="loaded",r.texture=this.texture);}}},i.prototype.serialize=function(){return {type:"video",urls:this.urls,coordinates:this.coordinates}},i.prototype.hasTransition=function(){return this.video&&!this.video.paused},i}(k),B=function(e){function i(i,o,r,a){e.call(this,i,o,r,a),o.coordinates?Array.isArray(o.coordinates)&&4===o.coordinates.length&&!o.coordinates.some((function(t){return !Array.isArray(t)||2!==t.length||t.some((function(t){return "number"!=typeof t}))}))||this.fire(new t.ErrorEvent(new t.ValidationError("sources."+i,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new t.ErrorEvent(new t.ValidationError("sources."+i,null,'missing required property "coordinates"'))),o.animate&&"boolean"!=typeof o.animate&&this.fire(new t.ErrorEvent(new t.ValidationError("sources."+i,null,'optional "animate" property must be a boolean value'))),o.canvas?"string"==typeof o.canvas||o.canvas instanceof t.window.HTMLCanvasElement||this.fire(new t.ErrorEvent(new t.ValidationError("sources."+i,null,'"canvas" must be either a string representing the ID of the canvas element from which to read, or an HTMLCanvasElement instance'))):this.fire(new t.ErrorEvent(new t.ValidationError("sources."+i,null,'missing required property "canvas"'))),this.options=o,this.animate=void 0===o.animate||o.animate;}return e&&(i.__proto__=e),(i.prototype=Object.create(e&&e.prototype)).constructor=i,i.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());},i.prototype.getCanvas=function(){return this.canvas},i.prototype.onAdd=function(t){this.map=t,this.load(),this.canvas&&this.animate&&this.play();},i.prototype.onRemove=function(){this.pause();},i.prototype.prepare=function(){var e=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,e=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,e=!0),!this._hasInvalidDimensions()&&0!==Object.keys(this.tiles).length){var i=this.map.painter.context,o=i.gl;for(var r in this.boundsBuffer||(this.boundsBuffer=i.createVertexBuffer(this._boundsArray,A.members)),this.boundsSegments||(this.boundsSegments=t.SegmentVector.simpleSegment(0,0,4,2)),this.texture?(e||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new t.Texture(i,this.canvas,o.RGBA,{premultiply:!0}),this.tiles){var a=this.tiles[r];"loaded"!==a.state&&(a.state="loaded",a.texture=this.texture);}}},i.prototype.serialize=function(){return {type:"canvas",coordinates:this.coordinates}},i.prototype.hasTransition=function(){return this._playing},i.prototype._hasInvalidDimensions=function(){for(var t=0,e=[this.canvas.width,this.canvas.height];tthis.max){var n=this._getAndRemoveByKey(this.order[0]);n&&this.onRemove(n);}return this},Z.prototype.has=function(t){return t.wrapped().key in this.data},Z.prototype.getAndRemove=function(t){return this.has(t)?this._getAndRemoveByKey(t.wrapped().key):null},Z.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},Z.prototype.getByKey=function(t){var e=this.data[t];return e?e[0].value:null},Z.prototype.get=function(t){return this.has(t)?this.data[t.wrapped().key][0].value:null},Z.prototype.remove=function(t,e){if(!this.has(t))return this;var i=t.wrapped().key,o=void 0===e?0:this.data[i].indexOf(e),r=this.data[i][o];return this.data[i].splice(o,1),r.timeout&&clearTimeout(r.timeout),0===this.data[i].length&&delete this.data[i],this.onRemove(r.value),this.order.splice(this.order.indexOf(i),1),this},Z.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},Z.prototype.filter=function(t){var e=[];for(var i in this.data)for(var o=0,r=this.data[i];o1||(Math.abs(i)>1&&(1===Math.abs(i+r)?i+=r:1===Math.abs(i-r)&&(i-=r)),e.dem&&t.dem&&(t.dem.backfillBorder(e.dem,i,o),t.neighboringTiles&&t.neighboringTiles[a]&&(t.neighboringTiles[a].backfilled=!0)));}},i.prototype.getTile=function(t){return this.getTileByID(t.key)},i.prototype.getTileByID=function(t){return this._tiles[t]},i.prototype._retainLoadedChildren=function(t,e,i,o){for(var r in this._tiles){var a=this._tiles[r];if(!(o[r]||!a.hasData()||a.tileID.overscaledZ<=e||a.tileID.overscaledZ>i)){for(var n=a.tileID;a&&a.tileID.overscaledZ>e+1;){var s=a.tileID.scaledTo(a.tileID.overscaledZ-1);(a=this._tiles[s.key])&&a.hasData()&&(n=s);}for(var l=n;l.overscaledZ>e;)if(t[(l=l.scaledTo(l.overscaledZ-1)).key]){o[n.key]=n;break}}}},i.prototype.findLoadedParent=function(t,e){if(t.key in this._loadedParentTiles){var i=this._loadedParentTiles[t.key];return i&&i.tileID.overscaledZ>=e?i:null}for(var o=t.overscaledZ-1;o>=e;o--){var r=t.scaledTo(o),a=this._getLoadedTile(r);if(a)return a}},i.prototype._getLoadedTile=function(t){var e=this._tiles[t.key];return e&&e.hasData()?e:this._cache.getByKey(t.wrapped().key)},i.prototype.updateCacheSize=function(t){var e=Math.ceil(t.width/this._source.tileSize)+1,i=Math.ceil(t.height/this._source.tileSize)+1,o=Math.floor(e*i*5),r="number"==typeof this._maxTileCacheSize?Math.min(this._maxTileCacheSize,o):o;this._cache.setMaxSize(r);},i.prototype.handleWrapJump=function(t){var e=Math.round((t-(void 0===this._prevLng?t:this._prevLng))/360);if(this._prevLng=t,e){var i={};for(var o in this._tiles){var r=this._tiles[o];r.tileID=r.tileID.unwrapTo(r.tileID.wrap+e),i[r.tileID.key]=r;}for(var a in this._tiles=i,this._timers)clearTimeout(this._timers[a]),delete this._timers[a];for(var n in this._tiles)this._setTileReloadTimer(n,this._tiles[n]);}},i.prototype.update=function(e){var o=this;if(this.transform=e,this._sourceLoaded&&!this._paused){var r;this.updateCacheSize(e),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used?this._source.tileID?r=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.indexExtent)})):(r=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&&(r=r.filter((function(t){return o._source.hasTile(t)})))):r=[];var a=e.coveringZoomLevel(this._source),n=Math.max(a-i.maxOverzooming,this._source.minzoom),s=Math.max(a+i.maxUnderzooming,this._source.minzoom),l=this._updateRetainedTiles(r,a);if(kt(this._source.type)){for(var c={},h={},u=0,p=Object.keys(l);uthis._source.maxzoom){var m=_.children(this._source.maxzoom)[0],g=this.getTile(m);if(g&&g.hasData()){o[m.key]=m;continue}}else {var v=_.children(this._source.maxzoom);if(o[v[0].key]&&o[v[1].key]&&o[v[2].key]&&o[v[3].key])continue}for(var y=f.wasRequested(),x=_.overscaledZ-1;x>=a;--x){var b=_.scaledTo(x);if(r[b.key])break;if(r[b.key]=!0,!(f=this.getTile(b))&&y&&(f=this._addTile(b)),f&&(o[b.key]=b,y=f.wasRequested(),f.hasData()))break}}}return o},i.prototype._updateLoadedParentTileCache=function(){for(var t in this._loadedParentTiles={},this._tiles){for(var e=[],i=void 0,o=this._tiles[t].tileID;o.overscaledZ>0;){if(o.key in this._loadedParentTiles){i=this._loadedParentTiles[o.key];break}e.push(o.key);var r=o.scaledTo(o.overscaledZ-1);if(i=this._getLoadedTile(r))break;o=r;}for(var a=0,n=e;a0||(e.hasData()&&"reloading"!==e.state?this._cache.add(e.tileID,e,e.getExpiryTimeout()):(e.aborted=!0,this._abortTile(e),this._unloadTile(e))));},i.prototype.clearTiles=function(){for(var t in this._shouldReloadOnResume=!1,this._paused=!1,this._tiles)this._removeTile(t);this._cache.reset();},i.prototype.tilesIn=function(e,i,o){var r=this,a=[],n=this.transform;if(!n)return a;for(var s=o?n.getCameraQueryGeometry(e):e,l=e.map((function(t){return n.pointCoordinate(t)})),c=s.map((function(t){return n.pointCoordinate(t)})),h=this.getIds(),u=1/0,p=1/0,d=-1/0,_=-1/0,f=0,m=c;f=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)}));a.push({tile:o,tileID:s,queryGeometry:v,cameraQueryGeometry:y,scale:f});}}},y=0;y=t.browser.now())return !0}return !1},i.prototype.setFeatureState=function(t,e,i){this._state.updateState(t=t||"_geojsonTileLayer",e,i);},i.prototype.removeFeatureState=function(t,e,i){this._state.removeFeatureState(t=t||"_geojsonTileLayer",e,i);},i.prototype.getFeatureState=function(t,e){return this._state.getState(t=t||"_geojsonTileLayer",e)},i.prototype.setDependencies=function(t,e,i){var o=this._tiles[t];o&&o.setDependencies(e,i);},i.prototype.reloadTilesForDependencies=function(t,e){for(var i in this._tiles)this._tiles[i].hasDependency(t,e)&&this._reloadTile(i,"reloading");this._cache.filter((function(i){return !i.hasDependency(t,e)}));},i}(t.Evented);function At(t,e){var i=Math.abs(2*t.wrap)-+(t.wrap<0),o=Math.abs(2*e.wrap)-+(e.wrap<0);return t.overscaledZ-e.overscaledZ||o-i||e.canonical.y-t.canonical.y||e.canonical.x-t.canonical.x}function kt(t){return "raster"===t||"image"===t||"video"===t}function Ot(){return new t.window.Worker(ta.workerUrl)}Rt.maxOverzooming=10,Rt.maxUnderzooming=3;var Bt="mapboxgl_preloaded_worker_pool",Ft=function(){this.active={};};Ft.prototype.acquire=function(t){if(!this.workers)for(this.workers=[];this.workers.length0?(r-n)/s:0;return this.points[a].mult(1-l).add(this.points[i].mult(l))};var $t=function(t,e,i){var o=this.boxCells=[],r=this.circleCells=[];this.xCellCount=Math.ceil(t/i),this.yCellCount=Math.ceil(e/i);for(var a=0;a=-e[0]&&i<=e[0]&&o>=-e[1]&&o<=e[1]}function ae(e,i,o,r,a,n,s,l){var c=r?e.textSizeData:e.iconSizeData,h=t.evaluateSizeForZoom(c,o.transform.zoom),u=[256/o.width*2+1,256/o.height*2+1],p=r?e.text.dynamicLayoutVertexArray:e.icon.dynamicLayoutVertexArray;p.clear();for(var d=e.lineVertexArray,_=r?e.text.placedSymbolArray:e.icon.placedSymbolArray,f=o.transform.width/o.transform.height,m=!1,g=0;g<_.length;g++){var v=_.get(g);if(v.hidden||v.writingMode===t.WritingMode.vertical&&!m)pe(v.numGlyphs,p);else {m=!1;var y=[v.anchorX,v.anchorY,0,1];if(t.transformMat4(y,y,i),re(y,u)){var x=oe(o.transform.cameraToCenterDistance,y[3]),b=t.evaluateSizeForFeature(c,h,v),w=s?b/x:b*x,E=new t.Point(v.anchorX,v.anchorY),T=ie(E,a).point,S={},I=le(v,w,!1,l,i,a,n,e.glyphOffsetArray,d,p,T,E,S,f);m=I.useVertical,(I.notEnoughRoom||m||I.needsFlipping&&le(v,w,!0,l,i,a,n,e.glyphOffsetArray,d,p,T,E,S,f).notEnoughRoom)&&pe(v.numGlyphs,p);}else pe(v.numGlyphs,p);}}r?e.text.dynamicLayoutVertexBuffer.updateData(p):e.icon.dynamicLayoutVertexBuffer.updateData(p);}function ne(t,e,i,o,r,a,n,s,l,c,h){var u=s.glyphStartIndex+s.numGlyphs,p=s.lineStartIndex,d=s.lineStartIndex+s.lineLength,_=e.getoffsetX(s.glyphStartIndex),f=e.getoffsetX(u-1),m=he(t*_,i,o,r,a,n,s.segment,p,d,l,c,h);if(!m)return null;var g=he(t*f,i,o,r,a,n,s.segment,p,d,l,c,h);return g?{first:m,last:g}:null}function se(e,i,o,r){return e===t.WritingMode.horizontal&&Math.abs(o.y-i.y)>Math.abs(o.x-i.x)*r?{useVertical:!0}:(e===t.WritingMode.vertical?i.yo.x)?{needsFlipping:!0}:null}function le(e,i,o,r,a,n,s,l,c,h,u,p,d,_){var f,m=i/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=ne(m,l,g,v,o,u,p,e,c,n,d);if(!w)return {notEnoughRoom:!0};var E=ie(w.first.point,s).point,T=ie(w.last.point,s).point;if(r&&!o){var S=se(e.writingMode,E,T,_);if(S)return S}f=[w.first];for(var I=e.glyphStartIndex+1;I0?M.point:ce(p,z,P,1,a),D=se(e.writingMode,P,L,_);if(D)return D}var R=he(m*l.getoffsetX(e.glyphStartIndex),g,v,o,u,p,e.segment,e.lineStartIndex,e.lineStartIndex+e.lineLength,c,n,d);if(!R)return {notEnoughRoom:!0};f=[R];}for(var A=0,k=f;A0?1:-1,f=0;r&&(_*=-1,f=Math.PI),_<0&&(f+=Math.PI);for(var m=_>0?l+s:l+s+1,g=a,v=a,y=0,x=0,b=Math.abs(d),w=[];y+x<=b;){if((m+=_)=c)return null;if(v=g,w.push(g),void 0===(g=p[m])){var E=new t.Point(h.getx(m),h.gety(m)),T=ie(E,u);if(T.signedDistanceFromCamera>0)g=p[m]=T.point;else {var S=m-_;g=ce(0===y?n:new t.Point(h.getx(S),h.gety(S)),E,v,b-y+1,u);}}y+=x,x=v.dist(g);}var I=(b-y)/x,P=g.sub(v),C=P.mult(I)._add(v);C._add(P._unit()._perp()._mult(o*_));var z=f+Math.atan2(g.y-v.y,g.x-v.x);return w.push(C),{point:C,angle:z,path:w}}$t.prototype.keysLength=function(){return this.boxKeys.length+this.circleKeys.length},$t.prototype.insert=function(t,e,i,o,r){this._forEachCell(e,i,o,r,this._insertBoxCell,this.boxUid++),this.boxKeys.push(t),this.bboxes.push(e),this.bboxes.push(i),this.bboxes.push(o),this.bboxes.push(r);},$t.prototype.insertCircle=function(t,e,i,o){this._forEachCell(e-o,i-o,e+o,i+o,this._insertCircleCell,this.circleUid++),this.circleKeys.push(t),this.circles.push(e),this.circles.push(i),this.circles.push(o);},$t.prototype._insertBoxCell=function(t,e,i,o,r,a){this.boxCells[r].push(a);},$t.prototype._insertCircleCell=function(t,e,i,o,r,a){this.circleCells[r].push(a);},$t.prototype._query=function(t,e,i,o,r,a){if(i<0||t>this.width||o<0||e>this.height)return !r&&[];var n=[];if(t<=0&&e<=0&&this.width<=i&&this.height<=o){if(r)return !0;for(var s=0;s0:n},$t.prototype._queryCircle=function(t,e,i,o,r){var a=t-i,n=t+i,s=e-i,l=e+i;if(n<0||a>this.width||l<0||s>this.height)return !o&&[];var c=[];return this._forEachCell(a,s,n,l,this._queryCellCircle,c,{hitTest:o,circle:{x:t,y:e,radius:i},seenUids:{box:{},circle:{}}},r),o?c.length>0:c},$t.prototype.query=function(t,e,i,o,r){return this._query(t,e,i,o,!1,r)},$t.prototype.hitTest=function(t,e,i,o,r){return this._query(t,e,i,o,!0,r)},$t.prototype.hitTestCircle=function(t,e,i,o){return this._queryCircle(t,e,i,!0,o)},$t.prototype._queryCell=function(t,e,i,o,r,a,n,s){var l=n.seenUids,c=this.boxCells[r];if(null!==c)for(var h=this.bboxes,u=0,p=c;u=h[_+0]&&o>=h[_+1]&&(!s||s(this.boxKeys[d]))){if(n.hitTest)return a.push(!0),!0;a.push({key:this.boxKeys[d],x1:h[_],y1:h[_+1],x2:h[_+2],y2:h[_+3]});}}}var f=this.circleCells[r];if(null!==f)for(var m=this.circles,g=0,v=f;gn*n+s*s},$t.prototype._circleAndRectCollide=function(t,e,i,o,r,a,n){var s=(a-o)/2,l=Math.abs(t-(o+s));if(l>s+i)return !1;var c=(n-r)/2,h=Math.abs(e-(r+c));if(h>c+i)return !1;if(l<=s||h<=c)return !0;var u=l-s,p=h-c;return u*u+p*p<=i*i};var ue=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function pe(t,e){for(var i=0;i=1;L--)M.push(C.path[L]);for(var D=1;D0){for(var O=M[0].clone(),B=M[0].clone(),F=1;F=S.x&&B.x<=I.x&&O.y>=S.y&&B.y<=I.y?[M]:B.xI.x||B.yI.y?[]:t.clipLine([M],S.x,S.y,I.x,I.y);}for(var U=0,N=k;U=this.screenRightBoundary||o<100||e>this.screenBottomBoundary},_e.prototype.isInsideGrid=function(t,e,i,o){return i>=0&&t=0&&e0?(this.prevPlacement&&this.prevPlacement.variableOffsets[u.crossTileID]&&this.prevPlacement.placements[u.crossTileID]&&this.prevPlacement.placements[u.crossTileID].text&&(f=this.prevPlacement.variableOffsets[u.crossTileID].anchor),this.variableOffsets[u.crossTileID]={textOffset:m,width:i,height:o,anchor:t,textBoxScale:r,prevAnchor:f},this.markUsedJustification(p,t,u,d),p.allowVerticalPlacement&&(this.markUsedOrientation(p,d,u),this.placedOrientations[u.crossTileID]=d),{shift:g,placedGlyphBoxes:v}):void 0},Te.prototype.placeLayerBucketPart=function(e,i,o){var r=this,a=e.parameters,n=a.bucket,s=a.layout,l=a.posMatrix,c=a.textLabelPlaneMatrix,h=a.labelToScreenMatrix,u=a.textPixelRatio,p=a.holdingForFade,d=a.collisionBoxArray,_=a.partiallyEvaluatedTextSize,f=a.collisionGroup,m=s.get("text-optional"),g=s.get("icon-optional"),v=s.get("text-allow-overlap"),y=s.get("icon-allow-overlap"),x="map"===s.get("text-rotation-alignment"),b="map"===s.get("text-pitch-alignment"),w="none"!==s.get("icon-text-fit"),E="viewport-y"===s.get("symbol-z-order"),T=v&&(y||!n.hasIconData()||g),S=y&&(v||!n.hasTextData()||m);!n.collisionArrays&&d&&n.deserializeCollisionBoxes(d);var I=function(e,a){if(!i[e.crossTileID])if(p)r.placements[e.crossTileID]=new ve(!1,!1,!1);else {var d,E=!1,I=!1,P=!0,C=null,z={box:null,offscreen:null},M={box:null,offscreen:null},L=null,D=null,R=0,A=0,k=0;a.textFeatureIndex?R=a.textFeatureIndex:e.useRuntimeCollisionCircles&&(R=e.featureIndex),a.verticalTextFeatureIndex&&(A=a.verticalTextFeatureIndex);var O=a.textBox;if(O){var B=function(i){var o=t.WritingMode.horizontal;if(n.allowVerticalPlacement&&!i&&r.prevPlacement){var a=r.prevPlacement.placedOrientations[e.crossTileID];a&&(r.placedOrientations[e.crossTileID]=a,r.markUsedOrientation(n,o=a,e));}return o},F=function(i,o){if(n.allowVerticalPlacement&&e.numVerticalGlyphVertices>0&&a.verticalTextBox)for(var r=0,s=n.writingModes;r0&&(U=U.filter((function(t){return t!==N.anchor}))).unshift(N.anchor);}var j=function(t,i,o){for(var a=t.x2-t.x1,s=t.y2-t.y1,c=e.textBoxScale,h=w&&!y?i:null,p={box:[],offscreen:!1},d=v?2*U.length:U.length,_=0;_=U.length,e,n,o,h);if(m&&(p=m.placedGlyphBoxes)&&p.box&&p.box.length){E=!0,C=m.shift;break}}return p};F((function(){return j(O,a.iconBox,t.WritingMode.horizontal)}),(function(){var i=a.verticalTextBox;return n.allowVerticalPlacement&&!(z&&z.box&&z.box.length)&&e.numVerticalGlyphVertices>0&&i?j(i,a.verticalIconBox,t.WritingMode.vertical):{box:null,offscreen:null}})),z&&(E=z.box,P=z.offscreen);var Z=B(z&&z.box);if(!E&&r.prevPlacement){var q=r.prevPlacement.variableOffsets[e.crossTileID];q&&(r.variableOffsets[e.crossTileID]=q,r.markUsedJustification(n,q.anchor,e,Z));}}else {var G=function(t,i){var o=r.collisionIndex.placeCollisionBox(t,v,u,l,f.predicate);return o&&o.box&&o.box.length&&(r.markUsedOrientation(n,i,e),r.placedOrientations[e.crossTileID]=i),o};F((function(){return G(O,t.WritingMode.horizontal)}),(function(){var i=a.verticalTextBox;return n.allowVerticalPlacement&&e.numVerticalGlyphVertices>0&&i?G(i,t.WritingMode.vertical):{box:null,offscreen:null}})),B(z&&z.box&&z.box.length);}}if(E=(d=z)&&d.box&&d.box.length>0,P=d&&d.offscreen,e.useRuntimeCollisionCircles){var V=n.text.placedSymbolArray.get(e.centerJustifiedTextSymbolIndex),W=t.evaluateSizeForFeature(n.textSizeData,_,V),X=s.get("text-padding");L=r.collisionIndex.placeCollisionCircles(v,V,n.lineVertexArray,n.glyphOffsetArray,W,l,c,h,o,b,f.predicate,e.collisionCircleDiameter,X),E=v||L.circles.length>0&&!L.collisionDetected,P=P&&L.offscreen;}if(a.iconFeatureIndex&&(k=a.iconFeatureIndex),a.iconBox){var H=function(t){var e=w&&C?Ee(t,C.x,C.y,x,b,r.transform.angle):t;return r.collisionIndex.placeCollisionBox(e,y,u,l,f.predicate)};I=M&&M.box&&M.box.length&&a.verticalIconBox?(D=H(a.verticalIconBox)).box.length>0:(D=H(a.iconBox)).box.length>0,P=P&&D.offscreen;}var K=m||0===e.numHorizontalGlyphVertices&&0===e.numVerticalGlyphVertices,Y=g||0===e.numIconVertices;if(K||Y?Y?K||(I=I&&E):E=I&&E:I=E=I&&E,E&&d&&d.box&&r.collisionIndex.insertCollisionBox(d.box,s.get("text-ignore-placement"),n.bucketInstanceId,M&&M.box&&A?A:R,f.ID),I&&D&&r.collisionIndex.insertCollisionBox(D.box,s.get("icon-ignore-placement"),n.bucketInstanceId,k,f.ID),L&&(E&&r.collisionIndex.insertCollisionCircles(L.circles,s.get("text-ignore-placement"),n.bucketInstanceId,R,f.ID),o)){var J=n.bucketInstanceId,Q=r.collisionCircleArrays[J];void 0===Q&&(Q=r.collisionCircleArrays[J]=new ye);for(var $=0;$=0;--C){var z=P[C];I(n.symbolInstances.get(z),n.collisionArrays[z]);}else for(var M=e.symbolInstanceStart;M=0&&(e.text.placedSymbolArray.get(l).crossTileID=a>=0&&l!==a?0:o.crossTileID);}},Te.prototype.markUsedOrientation=function(e,i,o){for(var r=i===t.WritingMode.horizontal||i===t.WritingMode.horizontalOnly?i:0,a=i===t.WritingMode.vertical?i:0,n=0,s=[o.leftJustifiedTextSymbolIndex,o.centerJustifiedTextSymbolIndex,o.rightJustifiedTextSymbolIndex];n0,v=r.placedOrientations[a.crossTileID],y=v===t.WritingMode.vertical,x=v===t.WritingMode.horizontal||v===t.WritingMode.horizontalOnly;if(s>0||l>0){var b=Re(m.text);_(e.text,s,y?Ae:b),_(e.text,l,x?Ae:b);var w=m.text.isHidden();[a.rightJustifiedTextSymbolIndex,a.centerJustifiedTextSymbolIndex,a.leftJustifiedTextSymbolIndex].forEach((function(t){t>=0&&(e.text.placedSymbolArray.get(t).hidden=w||y?1:0);})),a.verticalPlacedTextSymbolIndex>=0&&(e.text.placedSymbolArray.get(a.verticalPlacedTextSymbolIndex).hidden=w||x?1:0);var E=r.variableOffsets[a.crossTileID];E&&r.markUsedJustification(e,E.anchor,a,v);var T=r.placedOrientations[a.crossTileID];T&&(r.markUsedJustification(e,"left",a,T),r.markUsedOrientation(e,T,a));}if(g){var S=Re(m.icon),I=!(p&&a.verticalPlacedIconSymbolIndex&&y);a.placedIconSymbolIndex>=0&&(_(e.icon,a.numIconVertices,I?S:Ae),e.icon.placedSymbolArray.get(a.placedIconSymbolIndex).hidden=m.icon.isHidden()),a.verticalPlacedIconSymbolIndex>=0&&(_(e.icon,a.numVerticalIconVertices,I?Ae:S),e.icon.placedSymbolArray.get(a.verticalPlacedIconSymbolIndex).hidden=m.icon.isHidden());}if(e.hasIconCollisionBoxData()||e.hasTextCollisionBoxData()){var P=e.collisionArrays[o];if(P){var C=new t.Point(0,0);if(P.textBox||P.verticalTextBox){var z=!0;if(c){var M=r.variableOffsets[f];M?(C=we(M.anchor,M.width,M.height,M.textOffset,M.textBoxScale),h&&C._rotate(u?r.transform.angle:-r.transform.angle)):z=!1;}P.textBox&&Se(e.textCollisionBox.collisionVertexArray,m.text.placed,!z||y,C.x,C.y),P.verticalTextBox&&Se(e.textCollisionBox.collisionVertexArray,m.text.placed,!z||x,C.x,C.y);}var L=Boolean(!x&&P.verticalIconBox);P.iconBox&&Se(e.iconCollisionBox.collisionVertexArray,m.icon.placed,L,p?C.x:0,p?C.y:0),P.verticalIconBox&&Se(e.iconCollisionBox.collisionVertexArray,m.icon.placed,!L,p?C.x:0,p?C.y:0);}}},m=0;mt},Te.prototype.setStale=function(){this.stale=!0;};var Ie=Math.pow(2,25),Pe=Math.pow(2,24),Ce=Math.pow(2,17),ze=Math.pow(2,16),Me=Math.pow(2,9),Le=Math.pow(2,8),De=Math.pow(2,1);function Re(t){if(0===t.opacity&&!t.placed)return 0;if(1===t.opacity&&t.placed)return 4294967295;var e=t.placed?1:0,i=Math.floor(127*t.opacity);return i*Ie+e*Pe+i*Ce+e*ze+i*Me+e*Le+i*De+e}var Ae=0,ke=function(t){this._sortAcrossTiles="viewport-y"!==t.layout.get("symbol-z-order")&&void 0!==t.layout.get("symbol-sort-key").constantOr(1),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[];};ke.prototype.continuePlacement=function(t,e,i,o,r){for(var a=this._bucketParts;this._currentTileIndex2};this._currentPlacementIndex>=0;){var s=i[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 ke(s)),this._inProgressLayer.continuePlacement(o[s.source],this.placement,this._showCollisionBoxes,s,n))return;delete this._inProgressLayer;}this._currentPlacementIndex--;}this._done=!0;},Oe.prototype.commit=function(t){return this.placement.commit(t),this.placement};var Be=512/t.EXTENT/2,Fe=function(t,e,i){this.tileID=t,this.indexedSymbolInstances={},this.bucketInstanceId=i;for(var o=0;ot.overscaledZ)for(var s in n){var l=n[s];l.tileID.isChildOf(t)&&l.findMatches(e.symbolInstances,t,r);}else {var c=n[t.scaledTo(Number(a)).key];c&&c.findMatches(e.symbolInstances,t,r);}}for(var h=0;h0)throw new Error("Unimplemented: "+r.map((function(t){return t.command})).join(", ")+".");return o.forEach((function(t){"setTransition"!==t.command&&i[t.command].apply(i,t.args);})),this.stylesheet=e,!0},i.prototype.addImage=function(e,i,o){if(this.getImage(e))return this.fire(new t.ErrorEvent(new Error("An image with this name already exists.")));this.imageManagerFactory.addImage(e,i,o),this._afterImageUpdated(e);},i.prototype.updateImage=function(t,e,i){this.imageManagerFactory.updateImage(t,e,i);},i.prototype.getImage=function(t,e){return this.imageManagerFactory.getImage(t,e)},i.prototype.removeImage=function(e,i){if(!this.getImage(e))return this.fire(new t.ErrorEvent(new Error("No image with this name exists.")));this.imageManagerFactory.removeImage(e,i),this._afterImageUpdated(e);},i.prototype._afterImageUpdated=function(e){this._availableImages=this.imageManagerFactory.listImages(),this._changedImages[e]=!0,this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new t.Event("data",{dataType:"style"}));},i.prototype.listImages=function(t){return this._checkLoaded(),this.imageManagerFactory.listImages(t)},i.prototype.addSource=function(e,i,o){var r=this;if(void 0===o&&(o={}),this._checkLoaded(),void 0!==this.sourceCaches[e])throw new Error("There is already a source with this ID");if(!i.type)throw new Error("The type property must be defined, but only the following properties were given: "+Object.keys(i).join(", ")+".");if(this.map._mapCRS&&"geojson"===i.type&&i.data&&!i.data.customprj&&!i.customprj&&(i.customprj=this.map.customConvertPoint),!(["vector","raster","geojson","video","image"].indexOf(i.type)>=0&&this._validate(t.validateStyle.source,"sources."+e,i,null,o))){this.map&&this.map._collectResourceTiming&&(i.collectResourceTiming=!0);var a=this.sourceCaches[e]=new Rt(e,i,this.dispatcher);a.style=this,a.setEventedParent(this,(function(){return {isSourceLoaded:r.loaded(),source:a.serialize(),sourceId:e}})),a.onAdd(this.map),this._changed=!0;}},i.prototype.removeSource=function(e){if(this._checkLoaded(),void 0===this.sourceCaches[e])throw new Error("There is no source with this ID");for(var i in this._layers)if(this._layers[i].source===e)return this.fire(new t.ErrorEvent(new Error('Source "'+e+'" cannot be removed while layer "'+i+'" is using it.')));var o=this.sourceCaches[e];delete this.sourceCaches[e],delete this._updatedSources[e],o.fire(new t.Event("data",{sourceDataType:"metadata",dataType:"source",sourceId:e})),o.setEventedParent(null),o.clearTiles(),o.onRemove&&o.onRemove(this.map),this._changed=!0;},i.prototype.setGeoJSONSourceData=function(t,e){this._checkLoaded(),this.sourceCaches[t].getSource().setData(e),this._changed=!0;},i.prototype.getSource=function(t){return this.sourceCaches[t]&&this.sourceCaches[t].getSource()},i.prototype.addLayer=function(e,i,o){void 0===o&&(o={}),this._checkLoaded();var r=e.id;if(this.getLayer(r))this.fire(new t.ErrorEvent(new Error('Layer with id "'+r+'" already exists on this map')));else {var a;if("custom"===e.type){if(Ze(this,t.validateCustomStyleLayer(e)))return;a=t.createStyleLayer(e);}else {if("object"==typeof e.source&&(this.addSource(r,e.source),e=t.clone$1(e),e=t.extend(e,{source:r})),this._validate(t.validateStyle.layer,"layers."+r,e,{arrayIndex:-1},o))return;a=t.createStyleLayer(e),this._validateLayer(a),a.setEventedParent(this,{layer:{id:r}}),this._serializedLayers[a.id]=a.serialize();}var n=i?this._order.indexOf(i):this._order.length;if(i&&-1===n)this.fire(new t.ErrorEvent(new Error('Layer with id "'+i+'" does not exist on this map.')));else {if(this._order.splice(n,0,r),this._layerOrderChanged=!0,this._layers[r]=a,this._removedLayers[r]&&a.source&&"custom"!==a.type){var s=this._removedLayers[r];delete this._removedLayers[r],s.type!==a.type?this._updatedSources[a.source]="clear":(this._updatedSources[a.source]="reload",this.sourceCaches[a.source].pause());}this._updateLayer(a),a.onAdd&&a.onAdd(this.map);}}},i.prototype.moveLayer=function(e,i){if(this._checkLoaded(),this._changed=!0,this._layers[e]){if(e!==i){var o=this._order.indexOf(e);this._order.splice(o,1);var r=i?this._order.indexOf(i):this._order.length;i&&-1===r?this.fire(new t.ErrorEvent(new Error('Layer with id "'+i+'" does not exist on this map.'))):(this._order.splice(r,0,e),this._layerOrderChanged=!0);}}else this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be moved.")));},i.prototype.removeLayer=function(e){this._checkLoaded();var i=this._layers[e];if(i){i.setEventedParent(null);var o=this._order.indexOf(e);this._order.splice(o,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[e]=i,delete this._layers[e],delete this._serializedLayers[e],delete this._updatedLayers[e],delete this._updatedPaintProps[e],i.onRemove&&i.onRemove(this.map);}else this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be removed.")));},i.prototype.getLayer=function(t){return this._layers[t]},i.prototype.hasLayer=function(t){return t in this._layers},i.prototype.setLayerZoomRange=function(e,i,o){this._checkLoaded();var r=this.getLayer(e);r?r.minzoom===i&&r.maxzoom===o||(null!=i&&(r.minzoom=i),null!=o&&(r.maxzoom=o),this._updateLayer(r)):this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot have zoom extent.")));},i.prototype.setFilter=function(e,i,o){void 0===o&&(o={}),this._checkLoaded();var r=this.getLayer(e);if(r){if(!t.deepEqual(r.filter,i))return null==i?(r.filter=void 0,void this._updateLayer(r)):void(this._validate(t.validateStyle.filter,"layers."+r.id+".filter",i,null,o)||(r.filter=t.clone$1(i),this._updateLayer(r)))}else this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be filtered.")));},i.prototype.getFilter=function(e){return t.clone$1(this.getLayer(e).filter)},i.prototype.setLayoutProperty=function(e,i,o,r){void 0===r&&(r={}),this._checkLoaded();var a=this.getLayer(e);a?t.deepEqual(a.getLayoutProperty(i),o)||(a.setLayoutProperty(i,o,r),this._updateLayer(a)):this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be styled.")));},i.prototype.getLayoutProperty=function(e,i){var o=this.getLayer(e);if(o)return o.getLayoutProperty(i);this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style.")));},i.prototype.setPaintProperty=function(e,i,o,r){void 0===r&&(r={}),this._checkLoaded();var a=this.getLayer(e);a?t.deepEqual(a.getPaintProperty(i),o)||(a.setPaintProperty(i,o,r)&&this._updateLayer(a),this._changed=!0,this._updatedPaintProps[e]=!0):this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be styled.")));},i.prototype.getPaintProperty=function(t,e){return this.getLayer(t).getPaintProperty(e)},i.prototype.setFeatureState=function(e,i){this._checkLoaded();var o=e.source,r=e.sourceLayer,a=this.sourceCaches[o];if(void 0!==a){var n=a.getSource().type;"geojson"===n&&r?this.fire(new t.ErrorEvent(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):"vector"!==n||r?(void 0===e.id&&this.fire(new t.ErrorEvent(new Error("The feature id parameter must be provided."))),a.setFeatureState(r,e.id,i)):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 '"+o+"' does not exist in the map's style.")));},i.prototype.removeFeatureState=function(e,i){this._checkLoaded();var o=e.source,r=this.sourceCaches[o];if(void 0!==r){var a=r.getSource().type,n="vector"===a?e.sourceLayer:void 0;"vector"!==a||n?i&&"string"!=typeof e.id&&"number"!=typeof e.id?this.fire(new t.ErrorEvent(new Error("A feature id is required to remove its specific state property."))):r.removeFeatureState(n,e.id,i):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 '"+o+"' does not exist in the map's style.")));},i.prototype.getFeatureState=function(e){this._checkLoaded();var i=e.source,o=e.sourceLayer,r=this.sourceCaches[i];if(void 0!==r){if("vector"!==r.getSource().type||o)return void 0===e.id&&this.fire(new t.ErrorEvent(new Error("The feature id parameter must be provided."))),r.getFeatureState(o,e.id);this.fire(new t.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));}else this.fire(new t.ErrorEvent(new Error("The source '"+i+"' does not exist in the map's style.")));},i.prototype.getTransition=function(){return t.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)},i.prototype.serialize=function(){return t.filterObject({version:this.stylesheet.version,name:this.stylesheet.name,metadata:this.stylesheet.metadata,light:this.stylesheet.light,center:this.stylesheet.center,zoom:this.stylesheet.zoom,bearing:this.stylesheet.bearing,pitch:this.stylesheet.pitch,sprite:this._sprites,glyphs:this._glyphs,transition:this.stylesheet.transition,sources:t.mapObject(this.sourceCaches,(function(t){return t.serialize()})),layers:this._serializeLayers(this._order)},(function(t){return void 0!==t}))},i.prototype._updateLayer=function(t){this._updatedLayers[t.id]=!0,t.source&&!this._updatedSources[t.source]&&"raster"!==this.sourceCaches[t.source].getSource().type&&(this._updatedSources[t.source]="reload",this.sourceCaches[t.source].pause()),this._changed=!0;},i.prototype._flattenAndSortRenderedFeatures=function(t){for(var e=this,i=function(t){return "fill-extrusion"===e._layers[t].type},o={},r=[],a=this._order.length-1;a>=0;a--){var n=this._order[a];if(i(n)){o[n]=a;for(var s=0,l=t;s=0;d--){var _=this._order[d];if(i(_))for(var f=r.length-1;f>=0;f--){var m=r[f].feature;if(o[m.layer.id] 0.5) {gl_FragColor=vec4(0.0,0.0,1.0,0.5)*alpha;}if (v_notUsed > 0.5) {gl_FragColor*=.1;}}","attribute vec2 a_pos;attribute vec2 a_anchor_pos;attribute vec2 a_extrude;attribute vec2 a_placed;attribute vec2 a_shift;uniform mat4 u_matrix;uniform vec2 u_extrude_scale;uniform float u_camera_to_center_distance;varying float v_placed;varying float v_notUsed;void main() {vec4 projectedPoint=u_matrix*vec4(a_anchor_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);gl_Position=u_matrix*vec4(a_pos,0.0,1.0);gl_Position.xy+=(a_extrude+a_shift)*u_extrude_scale*gl_Position.w*collision_perspective_ratio;v_placed=a_placed.x;v_notUsed=a_placed.y;}"),ii=xi("varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;void main() {float alpha=0.5*min(v_perspective_ratio,1.0);float stroke_radius=0.9*max(v_perspective_ratio,1.0);float distance_to_center=length(v_extrude);float distance_to_edge=abs(distance_to_center-v_radius);float opacity_t=smoothstep(-stroke_radius,0.0,-distance_to_edge);vec4 color=mix(vec4(0.0,0.0,1.0,0.5),vec4(1.0,0.0,0.0,1.0),v_collision);gl_FragColor=color*alpha*opacity_t;}","attribute vec2 a_pos;attribute float a_radius;attribute vec2 a_flags;uniform mat4 u_matrix;uniform mat4 u_inv_matrix;uniform vec2 u_viewport_size;uniform float u_camera_to_center_distance;varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;vec3 toTilePosition(vec2 screenPos) {vec4 rayStart=u_inv_matrix*vec4(screenPos,-1.0,1.0);vec4 rayEnd =u_inv_matrix*vec4(screenPos, 1.0,1.0);rayStart.xyz/=rayStart.w;rayEnd.xyz /=rayEnd.w;highp float t=(0.0-rayStart.z)/(rayEnd.z-rayStart.z);return mix(rayStart.xyz,rayEnd.xyz,t);}void main() {vec2 quadCenterPos=a_pos;float radius=a_radius;float collision=a_flags.x;float vertexIdx=a_flags.y;vec2 quadVertexOffset=vec2(mix(-1.0,1.0,float(vertexIdx >=2.0)),mix(-1.0,1.0,float(vertexIdx >=1.0 && vertexIdx <=2.0)));vec2 quadVertexExtent=quadVertexOffset*radius;vec3 tilePos=toTilePosition(quadCenterPos);vec4 clipPos=u_matrix*vec4(tilePos,1.0);highp float camera_to_anchor_distance=clipPos.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);float padding_factor=1.2;v_radius=radius;v_extrude=quadVertexExtent*padding_factor;v_perspective_ratio=collision_perspective_ratio;v_collision=collision;gl_Position=vec4(clipPos.xyz/clipPos.w,1.0)+vec4(quadVertexExtent*padding_factor/u_viewport_size*2.0,0.0,0.0);}"),oi=xi("uniform highp vec4 u_color;uniform sampler2D u_overlay;varying vec2 v_uv;void main() {vec4 overlay_color=texture2D(u_overlay,v_uv);gl_FragColor=mix(u_color,overlay_color,overlay_color.a);}","attribute vec2 a_pos;varying vec2 v_uv;uniform mat4 u_matrix;uniform float u_overlay_scale;void main() {v_uv=a_pos/8192.0;gl_Position=u_matrix*vec4(a_pos*u_overlay_scale,0,1);}"),ri=xi("#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\ngl_FragColor=color*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=u_matrix*vec4(a_pos,0,1);}"),ai=xi("varying vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=outline_color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;uniform vec2 u_world;varying vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=u_matrix*vec4(a_pos,0,1);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}"),ni=xi("uniform vec2 u_texsize;uniform sampler2D u_image;uniform float u_fade;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=mix(color1,color2,u_fade)*alpha*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_world;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;gl_Position=u_matrix*vec4(a_pos,0,1);vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,a_pos);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}"),si=xi("uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_fade)*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileZoomRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileZoomRatio,a_pos);}"),li=xi("varying vec4 v_color;void main() {gl_FragColor=v_color;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;uniform float u_vertical_gradient;uniform lowp float u_opacity;attribute vec2 a_pos;attribute vec4 a_normal_ed;varying vec4 v_color;\n#pragma mapbox: define highp float base\n#pragma mapbox: define highp float height\n#pragma mapbox: define highp vec4 color\nvoid main() {\n#pragma mapbox: initialize highp float base\n#pragma mapbox: initialize highp float height\n#pragma mapbox: initialize highp vec4 color\nvec3 normal=a_normal_ed.xyz;base=max(0.0,base);height=max(0.0,height);float t=mod(normal.x,2.0);gl_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;v_color=vec4(0.0,0.0,0.0,1.0);vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=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*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_color.r+=clamp(color.r*directional*u_lightcolor.r,mix(0.0,0.3,1.0-u_lightcolor.r),1.0);v_color.g+=clamp(color.g*directional*u_lightcolor.g,mix(0.0,0.3,1.0-u_lightcolor.g),1.0);v_color.b+=clamp(color.b*directional*u_lightcolor.b,mix(0.0,0.3,1.0-u_lightcolor.b),1.0);v_color*=u_opacity;}"),ci=xi("uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);vec4 mixedColor=mix(color1,color2,u_fade);gl_FragColor=mixedColor*v_lighting;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_height_factor;uniform vec3 u_scale;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;attribute vec2 a_pos;attribute vec4 a_normal_ed;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec3 normal=a_normal_ed.xyz;float edgedistance=a_normal_ed.w;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;base=max(0.0,base);height=max(0.0,height);float t=mod(normal.x,2.0);float z=t > 0.0 ? height : base;gl_Position=u_matrix*vec4(a_pos,z,1);vec2 pos=normal.x==1.0 && normal.y==0.0 && normal.z==16384.0\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);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,pos);v_lighting=vec4(0.0,0.0,0.0,1.0);float directional=clamp(dot(normal/16383.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_lighting.rgb+=clamp(directional*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_lighting*=u_opacity;}"),hi=xi("#ifdef GL_ES\nprecision highp float;\n#endif\nuniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;uniform vec4 u_unpack;float getElevation(vec2 coord,float bias) {vec4 data=texture2D(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack)/4.0;}void main() {vec2 epsilon=1.0/u_dimension;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y),0.0);float b=getElevation(v_pos+vec2(0,-epsilon.y),0.0);float c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y),0.0);float d=getElevation(v_pos+vec2(-epsilon.x,0),0.0);float e=getElevation(v_pos,0.0);float f=getElevation(v_pos+vec2(epsilon.x,0),0.0);float g=getElevation(v_pos+vec2(-epsilon.x,epsilon.y),0.0);float h=getElevation(v_pos+vec2(0,epsilon.y),0.0);float i=getElevation(v_pos+vec2(epsilon.x,epsilon.y),0.0);float exaggerationFactor=u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;float exaggeration=u_zoom < 15.0 ? (u_zoom-15.0)*exaggerationFactor : 0.0;vec2 deriv=vec2((c+f+f+i)-(a+d+d+g),(g+h+h+i)-(a+b+b+c))/pow(2.0,exaggeration+(19.2562-u_zoom));gl_FragColor=clamp(vec4(deriv.x/2.0+0.5,deriv.y/2.0+0.5,1.0,1.0),0.0,1.0);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_dimension;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);highp vec2 epsilon=1.0/u_dimension;float scale=(u_dimension.x-2.0)/u_dimension.x;v_pos=(a_texture_pos/8192.0)*scale+epsilon;}"),ui=xi("uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_latrange;uniform vec2 u_light;uniform vec4 u_shadow;uniform vec4 u_highlight;uniform vec4 u_accent;\n#define PI 3.141592653589793\nvoid main() {vec4 pixel=texture2D(u_image,v_pos);vec2 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);float aspect=deriv.x !=0.0 ? atan(deriv.y,-deriv.x) : PI/2.0*(deriv.y > 0.0 ? 1.0 :-1.0);float intensity=u_light.x;float azimuth=u_light.y+PI;float base=1.875-intensity*1.75;float maxValue=0.5*PI;float scaledSlope=intensity !=0.5 ? ((pow(base,slope)-1.0)/(pow(base,maxValue)-1.0))*maxValue : slope;float accent=cos(scaledSlope);vec4 accent_color=(1.0-accent)*u_accent*clamp(intensity*2.0,0.0,1.0);float shade=abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);vec4 shade_color=mix(u_shadow,u_highlight,shade)*sin(scaledSlope)*clamp(intensity*2.0,0.0,1.0);gl_FragColor=accent_color*(1.0-shade_color.a)+shade_color;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=a_texture_pos/8192.0;}"),pi=xi("uniform lowp float u_device_pixel_ratio;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform vec2 u_units_to_pixels;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp float v_linesofar;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;v_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*2.0;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_width2=vec2(outset,inset);}"),di=xi("uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;varying highp vec2 v_uv;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);vec4 color=texture2D(u_image,v_uv);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\nattribute vec2 a_pos_normal;attribute vec4 a_data;attribute float a_uv_x;attribute float a_split_index;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;uniform float u_image_height;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp vec2 v_uv;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;highp float texel_height=1.0/u_image_height;highp float half_texel_height=0.5*texel_height;v_uv=vec2(a_uv_x,a_split_index*texel_height-half_texel_height);vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_width2=vec2(outset,inset);}"),_i=xi("uniform lowp float u_device_pixel_ratio;\r\nuniform vec2 u_texsize;\r\nuniform float u_fade;\r\nuniform mediump vec3 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\nvarying float v_width;\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 pixel_ratio_from\r\n#pragma mapbox: define lowp float pixel_ratio_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 pixel_ratio_from\r\n#pragma mapbox: initialize lowp float pixel_ratio_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 tileZoomRatio=u_scale.x;\r\nfloat fromScale=u_scale.y;\r\nfloat toScale=u_scale.z;\r\nvec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;\r\nvec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;\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);\r\nfloat aspect_a=display_size_a.y/v_width;\r\nfloat aspect_b=display_size_b.y/v_width;float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;\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*aspect_a,1.0);\r\nfloat x_b=mod(v_linesofar/pattern_size_b.x*aspect_b,1.0);\r\nfloat y=0.5*v_normal.y+0.5;\r\nvec2 texel_size=1.0/u_texsize;\r\nvec2 pos_a=mix(pattern_tl_a*texel_size-texel_size,pattern_br_a*texel_size+texel_size,vec2(x_a,y));\r\nvec2 pos_b=mix(pattern_tl_b*texel_size-texel_size,pattern_br_b*texel_size+texel_size,vec2(x_b,y));\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\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform vec2 u_units_to_pixels;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;}"),fi=xi("uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;uniform float u_sdfgamma;uniform float u_mix;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float sdfdist_a=texture2D(u_image,v_tex_a).a;float sdfdist_b=texture2D(u_image,v_tex_b).a;float sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);alpha*=smoothstep(0.5-u_sdfgamma/floorwidth,0.5+u_sdfgamma/floorwidth,sdfdist);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_patternscale_a;uniform float u_tex_y_a;uniform vec2 u_patternscale_b;uniform float u_tex_y_b;uniform vec2 u_units_to_pixels;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_tex_a=vec2(a_linesofar*u_patternscale_a.x/floorwidth,normal.y*u_patternscale_a.y+u_tex_y_a);v_tex_b=vec2(a_linesofar*u_patternscale_b.x/floorwidth,normal.y*u_patternscale_b.y+u_tex_y_b);v_width2=vec2(outset,inset);}"),mi=xi("uniform float u_fade_t;uniform float u_opacity;uniform sampler2D u_image0;uniform sampler2D u_image1;varying vec2 v_pos0;varying vec2 v_pos1;uniform float u_brightness_low;uniform float u_brightness_high;uniform float u_saturation_factor;uniform float u_contrast_factor;uniform vec3 u_spin_weights;void main() {vec4 color0=texture2D(u_image0,v_pos0);vec4 color1=texture2D(u_image1,v_pos1);if (color0.a > 0.0) {color0.rgb=color0.rgb/color0.a;}if (color1.a > 0.0) {color1.rgb=color1.rgb/color1.a;}vec4 color=mix(color0,color1,u_fade_t);color.a*=u_opacity;vec3 rgb=color.rgb;rgb=vec3(dot(rgb,u_spin_weights.xyz),dot(rgb,u_spin_weights.zxy),dot(rgb,u_spin_weights.yzx));float average=(color.r+color.g+color.b)/3.0;rgb+=(average-rgb)*u_saturation_factor;rgb=(rgb-0.5)*u_contrast_factor+0.5;vec3 u_high_vec=vec3(u_brightness_low,u_brightness_low,u_brightness_low);vec3 u_low_vec=vec3(u_brightness_high,u_brightness_high,u_brightness_high);gl_FragColor=vec4(mix(u_high_vec,u_low_vec,rgb)*color.a,color.a);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform float u_buffer_scale;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos0;varying vec2 v_pos1;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos0=(((a_texture_pos/8192.0)-0.5)/u_buffer_scale )+0.5;v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;}"),gi=xi("uniform sampler2D u_texture;varying vec2 v_tex;varying float v_fade_opacity;\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nlowp float alpha=opacity*v_fade_opacity;gl_FragColor=texture2D(u_texture,v_tex)*alpha;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform highp float u_camera_to_center_distance;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform float u_fade_change;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform vec2 u_texsize;varying vec2 v_tex;varying float v_fade_opacity;\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;vec2 a_minFontScale=a_pixeloffset.zw/256.0;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*max(a_minFontScale,fontScale)+a_pxoffset/16.0),0.0,1.0);v_tex=a_tex/u_texsize;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;v_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));}"),vi=xi("#define SDF_PX 8.0\nuniform bool u_is_halo;uniform sampler2D u_texture;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;uniform bool u_is_text;varying vec2 v_data0;varying vec3 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nfloat EDGE_GAMMA=0.105/u_device_pixel_ratio;vec2 tex=v_data0.xy;float gamma_scale=v_data1.x;float size=v_data1.y;float fade_opacity=v_data1[2];float fontScale=u_is_text ? size/24.0 : size;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;varying vec2 v_data0;varying vec3 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset),0.0,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,interpolated_fade_opacity);}"),yi=xi("#define SDF_PX 8.0\n#define SDF 1.0\n#define ICON 0.0\nuniform bool u_is_halo;uniform sampler2D u_texture;uniform sampler2D u_texture_icon;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;varying vec4 v_data0;varying vec4 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nfloat fade_opacity=v_data1[2];if (v_data1.w==ICON) {vec2 tex_icon=v_data0.zw;lowp float alpha=opacity*fade_opacity;gl_FragColor=texture2D(u_texture_icon,tex_icon)*alpha;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\nreturn;}vec2 tex=v_data0.xy;float EDGE_GAMMA=0.105/u_device_pixel_ratio;float gamma_scale=v_data1.x;float size=v_data1.y;float fontScale=size/24.0;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec2 u_texsize_icon;varying vec4 v_data0;varying vec4 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);float is_sdf=a_size[0]-2.0*a_size_min;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale),0.0,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));v_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec4(gamma_scale,size,interpolated_fade_opacity,is_sdf);}");function xi(t,e){var i=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,o=e.match(/attribute ([\w]+) ([\w]+)/g),r=t.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),a=e.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),n=a?a.concat(r):r,s={};return {fragmentSource:t=t.replace(i,(function(t,e,i,o,r){return s[r]=!0,"define"===e?"\n#ifndef HAS_UNIFORM_u_"+r+"\nvarying "+i+" "+o+" "+r+";\n#else\nuniform "+i+" "+o+" u_"+r+";\n#endif\n":"\n#ifdef HAS_UNIFORM_u_"+r+"\n "+i+" "+o+" "+r+" = u_"+r+";\n#endif\n"})),vertexSource:e=e.replace(i,(function(t,e,i,o,r){var a="float"===o?"vec2":"vec4",n=r.match(/color/)?"color":a;return s[r]?"define"===e?"\n#ifndef HAS_UNIFORM_u_"+r+"\nuniform lowp float u_"+r+"_t;\nattribute "+i+" "+a+" a_"+r+";\nvarying "+i+" "+o+" "+r+";\n#else\nuniform "+i+" "+o+" u_"+r+";\n#endif\n":"vec4"===n?"\n#ifndef HAS_UNIFORM_u_"+r+"\n "+r+" = a_"+r+";\n#else\n "+i+" "+o+" "+r+" = u_"+r+";\n#endif\n":"\n#ifndef HAS_UNIFORM_u_"+r+"\n "+r+" = unpack_mix_"+n+"(a_"+r+", u_"+r+"_t);\n#else\n "+i+" "+o+" "+r+" = u_"+r+";\n#endif\n":"define"===e?"\n#ifndef HAS_UNIFORM_u_"+r+"\nuniform lowp float u_"+r+"_t;\nattribute "+i+" "+a+" a_"+r+";\n#else\nuniform "+i+" "+o+" u_"+r+";\n#endif\n":"vec4"===n?"\n#ifndef HAS_UNIFORM_u_"+r+"\n "+i+" "+o+" "+r+" = a_"+r+";\n#else\n "+i+" "+o+" "+r+" = u_"+r+";\n#endif\n":"\n#ifndef HAS_UNIFORM_u_"+r+"\n "+i+" "+o+" "+r+" = unpack_mix_"+n+"(a_"+r+", u_"+r+"_t);\n#else\n "+i+" "+o+" "+r+" = u_"+r+";\n#endif\n"})),staticAttributes:o,staticUniforms:n}}var bi=Object.freeze({__proto__:null,prelude:He,background:Ke,backgroundPattern:Ye,circle:Je,clippingMask:Qe,heatmap:$e,heatmapTexture:ti,collisionBox:ei,collisionCircle:ii,debug:oi,fill:ri,fillOutline:ai,fillOutlinePattern:ni,fillPattern:si,fillExtrusion:li,fillExtrusionPattern:ci,hillshadePrepare:hi,hillshade:ui,line:pi,lineGradient:di,linePattern:_i,lineSDF:fi,raster:mi,symbolIcon:gi,symbolSDF:vi,symbolTextAndIcon:yi}),wi=function(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null;};function Ei(t){for(var e=[],i=0;i>16,s>>16],u_pixel_coord_lower:[65535&n,65535&s]}}Ti.prototype.draw=function(t,e,i,o,r,a,n,s,l,c,h,u,p,d,_,f){var m,g=t.gl;if(!this.failedToCreate){for(var v in t.program.set(this.program),t.setDepthMode(i),t.setStencilMode(o),t.setColorMode(r),t.setCullFace(a),this.fixedUniforms)this.fixedUniforms[v].set(n[v]);d&&d.setUniforms(t,this.binderUniforms,u,{zoom:p});for(var y=(m={},m[g.LINES]=2,m[g.TRIANGLES]=3,m[g.LINE_STRIP]=1,m)[e],x=0,b=h.get();x0?1-1/(1.001-n):-n),u_contrast_factor:(a=r.paint.get("raster-contrast"),a>0?1/(1-a):1+a),u_spin_weights:Vi(r.paint.get("raster-hue-rotate"))};var a,n;};function Vi(t){t*=Math.PI/180;var e=Math.sin(t),i=Math.cos(t);return [(2*i+1)/3,(-Math.sqrt(3)*e-i+1)/3,(Math.sqrt(3)*e-i+1)/3]}var Wi,Xi=function(t,e,i,o,r,a,n,s,l,c){var h=r.transform;return {u_is_size_zoom_constant:+("constant"===t||"source"===t),u_is_size_feature_constant:+("constant"===t||"camera"===t),u_size_t:e?e.uSizeT:0,u_size:e?e.uSize:0,u_camera_to_center_distance:h.cameraToCenterDistance,u_pitch:h.pitch/360*2*Math.PI,u_rotate_symbol:+i,u_aspect_ratio:h.width/h.height,u_fade_change:r.options.fadeDuration?r.symbolFadeChange:1,u_matrix:a,u_label_plane_matrix:n,u_coord_matrix:s,u_is_text:+l,u_pitch_with_map:+o,u_texsize:c,u_texture:0}},Hi=function(e,i,o,r,a,n,s,l,c,h,u){var p=a.transform;return t.extend(Xi(e,i,o,r,a,n,s,l,c,h),{u_gamma_scale:r?Math.cos(p._pitch)*p.cameraToCenterDistance:1,u_device_pixel_ratio:t.browser.devicePixelRatio,u_is_halo:+u})},Ki=function(e,i,o,r,a,n,s,l,c,h){return t.extend(Hi(e,i,o,r,a,n,s,l,!0,c,!0),{u_texsize_icon:h,u_texture_icon:1})},Yi=function(t,e,i){return {u_matrix:t,u_opacity:e,u_color:i}},Ji=function(e,i,o,r,a,n){return t.extend(function(t,e,i,o){var r=i.imageManagerFactory.getPattern(t.from.toString()),a=i.imageManagerFactory.getPattern(t.to.toString()),n=i.imageManagerFactory.getPixelSize(),s=n.width,l=n.height,c=Math.pow(2,o.tileID.overscaledZ),h=o.tileSize*Math.pow(2,i.transform.tileZoom)/c,u=h*(o.tileID.canonical.x+o.tileID.wrap*c),p=h*o.tileID.canonical.y;return {u_image:0,u_pattern_tl_a:r.tl,u_pattern_br_a:r.br,u_pattern_tl_b:a.tl,u_pattern_br_b:a.br,u_texsize:[s,l],u_mix:e.t,u_pattern_size_a:r.displaySize,u_pattern_size_b:a.displaySize,u_scale_a:e.fromScale,u_scale_b:e.toScale,u_tile_units_to_pixels:1/fe(o,1,i.transform.tileZoom),u_pixel_coord_upper:[u>>16,p>>16],u_pixel_coord_lower:[65535&u,65535&p]}}(r,n,o,a),{u_matrix:e,u_opacity:i})},Qi={fillExtrusion:function(e,i){return {u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_lightpos:new t.Uniform3f(e,i.u_lightpos),u_lightintensity:new t.Uniform1f(e,i.u_lightintensity),u_lightcolor:new t.Uniform3f(e,i.u_lightcolor),u_vertical_gradient:new t.Uniform1f(e,i.u_vertical_gradient),u_opacity:new t.Uniform1f(e,i.u_opacity)}},fillExtrusionPattern:function(e,i){return {u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_lightpos:new t.Uniform3f(e,i.u_lightpos),u_lightintensity:new t.Uniform1f(e,i.u_lightintensity),u_lightcolor:new t.Uniform3f(e,i.u_lightcolor),u_vertical_gradient:new t.Uniform1f(e,i.u_vertical_gradient),u_height_factor:new t.Uniform1f(e,i.u_height_factor),u_image:new t.Uniform1i(e,i.u_image),u_texsize:new t.Uniform2f(e,i.u_texsize),u_pixel_coord_upper:new t.Uniform2f(e,i.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,i.u_pixel_coord_lower),u_scale:new t.Uniform3f(e,i.u_scale),u_fade:new t.Uniform1f(e,i.u_fade),u_opacity:new t.Uniform1f(e,i.u_opacity)}},fill:function(e,i){return {u_matrix:new t.UniformMatrix4f(e,i.u_matrix)}},fillPattern:function(e,i){return {u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_image:new t.Uniform1i(e,i.u_image),u_texsize:new t.Uniform2f(e,i.u_texsize),u_pixel_coord_upper:new t.Uniform2f(e,i.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,i.u_pixel_coord_lower),u_scale:new t.Uniform3f(e,i.u_scale),u_fade:new t.Uniform1f(e,i.u_fade)}},fillOutline:function(e,i){return {u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_world:new t.Uniform2f(e,i.u_world)}},fillOutlinePattern:function(e,i){return {u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_world:new t.Uniform2f(e,i.u_world),u_image:new t.Uniform1i(e,i.u_image),u_texsize:new t.Uniform2f(e,i.u_texsize),u_pixel_coord_upper:new t.Uniform2f(e,i.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,i.u_pixel_coord_lower),u_scale:new t.Uniform3f(e,i.u_scale),u_fade:new t.Uniform1f(e,i.u_fade)}},circle:function(e,i){return {u_camera_to_center_distance:new t.Uniform1f(e,i.u_camera_to_center_distance),u_scale_with_map:new t.Uniform1i(e,i.u_scale_with_map),u_pitch_with_map:new t.Uniform1i(e,i.u_pitch_with_map),u_extrude_scale:new t.Uniform2f(e,i.u_extrude_scale),u_device_pixel_ratio:new t.Uniform1f(e,i.u_device_pixel_ratio),u_matrix:new t.UniformMatrix4f(e,i.u_matrix)}},collisionBox:function(e,i){return {u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_camera_to_center_distance:new t.Uniform1f(e,i.u_camera_to_center_distance),u_pixels_to_tile_units:new t.Uniform1f(e,i.u_pixels_to_tile_units),u_extrude_scale:new t.Uniform2f(e,i.u_extrude_scale),u_overscale_factor:new t.Uniform1f(e,i.u_overscale_factor)}},collisionCircle:function(e,i){return {u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_inv_matrix:new t.UniformMatrix4f(e,i.u_inv_matrix),u_camera_to_center_distance:new t.Uniform1f(e,i.u_camera_to_center_distance),u_viewport_size:new t.Uniform2f(e,i.u_viewport_size)}},debug:function(e,i){return {u_color:new t.UniformColor(e,i.u_color),u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_overlay:new t.Uniform1i(e,i.u_overlay),u_overlay_scale:new t.Uniform1f(e,i.u_overlay_scale)}},clippingMask:function(e,i){return {u_matrix:new t.UniformMatrix4f(e,i.u_matrix)}},heatmap:function(e,i){return {u_extrude_scale:new t.Uniform1f(e,i.u_extrude_scale),u_intensity:new t.Uniform1f(e,i.u_intensity),u_matrix:new t.UniformMatrix4f(e,i.u_matrix)}},heatmapTexture:function(e,i){return {u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_world:new t.Uniform2f(e,i.u_world),u_image:new t.Uniform1i(e,i.u_image),u_color_ramp:new t.Uniform1i(e,i.u_color_ramp),u_opacity:new t.Uniform1f(e,i.u_opacity)}},hillshade:function(e,i){return {u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_image:new t.Uniform1i(e,i.u_image),u_latrange:new t.Uniform2f(e,i.u_latrange),u_light:new t.Uniform2f(e,i.u_light),u_shadow:new t.UniformColor(e,i.u_shadow),u_highlight:new t.UniformColor(e,i.u_highlight),u_accent:new t.UniformColor(e,i.u_accent)}},hillshadePrepare:function(e,i){return {u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_image:new t.Uniform1i(e,i.u_image),u_dimension:new t.Uniform2f(e,i.u_dimension),u_zoom:new t.Uniform1f(e,i.u_zoom),u_unpack:new t.Uniform4f(e,i.u_unpack)}},line:function(e,i){return {u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_ratio:new t.Uniform1f(e,i.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,i.u_device_pixel_ratio),u_units_to_pixels:new t.Uniform2f(e,i.u_units_to_pixels)}},lineGradient:function(e,i){return {u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_ratio:new t.Uniform1f(e,i.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,i.u_device_pixel_ratio),u_units_to_pixels:new t.Uniform2f(e,i.u_units_to_pixels),u_image:new t.Uniform1i(e,i.u_image),u_image_height:new t.Uniform1f(e,i.u_image_height)}},linePattern:function(e,i){return {u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_texsize:new t.Uniform2f(e,i.u_texsize),u_ratio:new t.Uniform1f(e,i.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,i.u_device_pixel_ratio),u_image:new t.Uniform1i(e,i.u_image),u_units_to_pixels:new t.Uniform2f(e,i.u_units_to_pixels),u_scale:new t.Uniform3f(e,i.u_scale),u_fade:new t.Uniform1f(e,i.u_fade)}},lineSDF:function(e,i){return {u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_ratio:new t.Uniform1f(e,i.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,i.u_device_pixel_ratio),u_units_to_pixels:new t.Uniform2f(e,i.u_units_to_pixels),u_patternscale_a:new t.Uniform2f(e,i.u_patternscale_a),u_patternscale_b:new t.Uniform2f(e,i.u_patternscale_b),u_sdfgamma:new t.Uniform1f(e,i.u_sdfgamma),u_image:new t.Uniform1i(e,i.u_image),u_tex_y_a:new t.Uniform1f(e,i.u_tex_y_a),u_tex_y_b:new t.Uniform1f(e,i.u_tex_y_b),u_mix:new t.Uniform1f(e,i.u_mix)}},raster:function(e,i){return {u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_tl_parent:new t.Uniform2f(e,i.u_tl_parent),u_scale_parent:new t.Uniform1f(e,i.u_scale_parent),u_buffer_scale:new t.Uniform1f(e,i.u_buffer_scale),u_fade_t:new t.Uniform1f(e,i.u_fade_t),u_opacity:new t.Uniform1f(e,i.u_opacity),u_image0:new t.Uniform1i(e,i.u_image0),u_image1:new t.Uniform1i(e,i.u_image1),u_brightness_low:new t.Uniform1f(e,i.u_brightness_low),u_brightness_high:new t.Uniform1f(e,i.u_brightness_high),u_saturation_factor:new t.Uniform1f(e,i.u_saturation_factor),u_contrast_factor:new t.Uniform1f(e,i.u_contrast_factor),u_spin_weights:new t.Uniform3f(e,i.u_spin_weights)}},symbolIcon:function(e,i){return {u_is_size_zoom_constant:new t.Uniform1i(e,i.u_is_size_zoom_constant),u_is_size_feature_constant:new t.Uniform1i(e,i.u_is_size_feature_constant),u_size_t:new t.Uniform1f(e,i.u_size_t),u_size:new t.Uniform1f(e,i.u_size),u_camera_to_center_distance:new t.Uniform1f(e,i.u_camera_to_center_distance),u_pitch:new t.Uniform1f(e,i.u_pitch),u_rotate_symbol:new t.Uniform1i(e,i.u_rotate_symbol),u_aspect_ratio:new t.Uniform1f(e,i.u_aspect_ratio),u_fade_change:new t.Uniform1f(e,i.u_fade_change),u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_label_plane_matrix:new t.UniformMatrix4f(e,i.u_label_plane_matrix),u_coord_matrix:new t.UniformMatrix4f(e,i.u_coord_matrix),u_is_text:new t.Uniform1i(e,i.u_is_text),u_pitch_with_map:new t.Uniform1i(e,i.u_pitch_with_map),u_texsize:new t.Uniform2f(e,i.u_texsize),u_texture:new t.Uniform1i(e,i.u_texture)}},symbolSDF:function(e,i){return {u_is_size_zoom_constant:new t.Uniform1i(e,i.u_is_size_zoom_constant),u_is_size_feature_constant:new t.Uniform1i(e,i.u_is_size_feature_constant),u_size_t:new t.Uniform1f(e,i.u_size_t),u_size:new t.Uniform1f(e,i.u_size),u_camera_to_center_distance:new t.Uniform1f(e,i.u_camera_to_center_distance),u_pitch:new t.Uniform1f(e,i.u_pitch),u_rotate_symbol:new t.Uniform1i(e,i.u_rotate_symbol),u_aspect_ratio:new t.Uniform1f(e,i.u_aspect_ratio),u_fade_change:new t.Uniform1f(e,i.u_fade_change),u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_label_plane_matrix:new t.UniformMatrix4f(e,i.u_label_plane_matrix),u_coord_matrix:new t.UniformMatrix4f(e,i.u_coord_matrix),u_is_text:new t.Uniform1i(e,i.u_is_text),u_pitch_with_map:new t.Uniform1i(e,i.u_pitch_with_map),u_texsize:new t.Uniform2f(e,i.u_texsize),u_texture:new t.Uniform1i(e,i.u_texture),u_gamma_scale:new t.Uniform1f(e,i.u_gamma_scale),u_device_pixel_ratio:new t.Uniform1f(e,i.u_device_pixel_ratio),u_is_halo:new t.Uniform1i(e,i.u_is_halo)}},symbolTextAndIcon:function(e,i){return {u_is_size_zoom_constant:new t.Uniform1i(e,i.u_is_size_zoom_constant),u_is_size_feature_constant:new t.Uniform1i(e,i.u_is_size_feature_constant),u_size_t:new t.Uniform1f(e,i.u_size_t),u_size:new t.Uniform1f(e,i.u_size),u_camera_to_center_distance:new t.Uniform1f(e,i.u_camera_to_center_distance),u_pitch:new t.Uniform1f(e,i.u_pitch),u_rotate_symbol:new t.Uniform1i(e,i.u_rotate_symbol),u_aspect_ratio:new t.Uniform1f(e,i.u_aspect_ratio),u_fade_change:new t.Uniform1f(e,i.u_fade_change),u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_label_plane_matrix:new t.UniformMatrix4f(e,i.u_label_plane_matrix),u_coord_matrix:new t.UniformMatrix4f(e,i.u_coord_matrix),u_is_text:new t.Uniform1i(e,i.u_is_text),u_pitch_with_map:new t.Uniform1i(e,i.u_pitch_with_map),u_texsize:new t.Uniform2f(e,i.u_texsize),u_texsize_icon:new t.Uniform2f(e,i.u_texsize_icon),u_texture:new t.Uniform1i(e,i.u_texture),u_texture_icon:new t.Uniform1i(e,i.u_texture_icon),u_gamma_scale:new t.Uniform1f(e,i.u_gamma_scale),u_device_pixel_ratio:new t.Uniform1f(e,i.u_device_pixel_ratio),u_is_halo:new t.Uniform1i(e,i.u_is_halo)}},background:function(e,i){return {u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_opacity:new t.Uniform1f(e,i.u_opacity),u_color:new t.UniformColor(e,i.u_color)}},backgroundPattern:function(e,i){return {u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_opacity:new t.Uniform1f(e,i.u_opacity),u_image:new t.Uniform1i(e,i.u_image),u_pattern_tl_a:new t.Uniform2f(e,i.u_pattern_tl_a),u_pattern_br_a:new t.Uniform2f(e,i.u_pattern_br_a),u_pattern_tl_b:new t.Uniform2f(e,i.u_pattern_tl_b),u_pattern_br_b:new t.Uniform2f(e,i.u_pattern_br_b),u_texsize:new t.Uniform2f(e,i.u_texsize),u_mix:new t.Uniform1f(e,i.u_mix),u_pattern_size_a:new t.Uniform2f(e,i.u_pattern_size_a),u_pattern_size_b:new t.Uniform2f(e,i.u_pattern_size_b),u_scale_a:new t.Uniform1f(e,i.u_scale_a),u_scale_b:new t.Uniform1f(e,i.u_scale_b),u_pixel_coord_upper:new t.Uniform2f(e,i.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,i.u_pixel_coord_lower),u_tile_units_to_pixels:new t.Uniform1f(e,i.u_tile_units_to_pixels)}}};function $i(e,i,o,r,a,n,s){for(var l=e.context,c=l.gl,h=e.useProgram("collisionBox"),u=[],p=0,d=0,_=0;_0){var b=t.create(),w=v;t.mul(b,g.placementInvProjMatrix,e.transform.glCoordMatrix),t.mul(b,b,g.placementViewportMatrix),u.push({circleArray:x,circleOffset:d,transform:w,invTransform:b}),d=p+=x.length/4;}y&&h.draw(l,c.LINES,Ct.disabled,zt.disabled,e.colorModeForRenderPass(),Lt.disabled,Ri(v,e.transform,m),o.id,y.layoutVertexBuffer,y.indexBuffer,y.segments,null,e.transform.zoom,null,null,y.collisionVertexBuffer);}}if(s&&u.length){var E=e.useProgram("collisionCircle"),T=new t.StructArrayLayout2f1f2i16;T.resize(4*p),T._trim();for(var S=0,I=0,P=u;I=0&&(f[g.associatedIconIndex]={shiftedAnchor:T,angle:S});}else pe(g.numGlyphs,d);}if(u){_.clear();for(var P=e.icon.placedSymbolArray,C=0;C0){var s=t.browser.now(),l=(s-e.timeAdded)/n,c=i?(s-i.timeAdded)/n:-1,h=o.getSource(),u=a.coveringZoomLevel({tileSize:h.tileSize,roundZoom:h.roundZoom}),p=!i||Math.abs(i.tileID.overscaledZ-u)>Math.abs(e.tileID.overscaledZ-u),d=p&&e.refreshedUponExpiration?1:t.clamp(p?l:1-c,0,1);return e.refreshedUponExpiration&&l>=1&&(e.refreshedUponExpiration=!1),i?{opacity:1,mix:1-d}:{opacity:d,mix:0}}return {opacity:1,mix:0}}var uo=new t.Color(1,0,0,1),po=new t.Color(0,1,0,1),_o=new t.Color(0,0,1,1),fo=new t.Color(1,0,1,1),mo=new t.Color(0,1,1,1);function go(t,e,i,o){yo(t,0,e+i/2,t.transform.width,i,o);}function vo(t,e,i,o){yo(t,e-i/2,0,i,t.transform.height,o);}function yo(e,i,o,r,a,n){var s=e.context,l=s.gl;l.enable(l.SCISSOR_TEST),l.scissor(i*t.browser.devicePixelRatio,o*t.browser.devicePixelRatio,r*t.browser.devicePixelRatio,a*t.browser.devicePixelRatio),s.clear({color:n}),l.disable(l.SCISSOR_TEST);}function xo(e,i,o){var r=e.context,a=r.gl,n=o.posMatrix,s=e.useProgram("debug"),l=Ct.disabled,c=zt.disabled,h=e.colorModeForRenderPass();r.activeTexture.set(a.TEXTURE0),e.emptyTexture.bind(a.LINEAR,a.CLAMP_TO_EDGE),s.draw(r,a.LINE_STRIP,l,c,h,Lt.disabled,ki(n,t.Color.red),"$debug",e.debugBuffer,e.tileBorderIndexBuffer,e.debugSegments);var u=i.getTileByID(o.key).latestRawTileData,p=Math.floor((u&&u.byteLength||0)/1024),d=i.getTile(o).tileSize,_=512/Math.min(d,512)*(o.overscaledZ/e.transform.zoom)*.5,f=o.canonical.toString();o.overscaledZ!==o.canonical.z&&(f+=" => "+o.overscaledZ),function(t,e){t.initDebugOverlayCanvas();var i=t.debugOverlayCanvas,o=t.context.gl,r=t.debugOverlayCanvas.getContext("2d");r.clearRect(0,0,i.width,i.height),r.shadowColor="white",r.shadowBlur=2,r.lineWidth=1.5,r.strokeStyle="white",r.textBaseline="top",r.font="bold 36px Open Sans, sans-serif",r.fillText(e,5,5),r.strokeText(e,5,5),t.debugOverlayTexture.update(i),t.debugOverlayTexture.bind(o.LINEAR,o.CLAMP_TO_EDGE);}(e,f+" "+p+"kb"),s.draw(r,a.TRIANGLES,l,c,Mt.alphaBlended,Lt.disabled,ki(n,t.Color.transparent,_),"$debug",e.debugBuffer,e.quadTriangleIndexBuffer,e.debugSegments);}var bo={symbol:function(e,i,o,r,a){if("translucent"===e.renderPass){var n=zt.disabled,s=e.colorModeForRenderPass();o.layout.get("text-variable-anchor")&&function(e,i,o,r,a,n,s){for(var l=i.transform,c="map"===a,h="map"===n,u=0,p=e;u256&&this.clearStencil(),i.setColorMode(Mt.disabled),i.setDepthMode(Ct.disabled);var r=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(var a=0,n=e;a256&&this.clearStencil();var t=this.nextStencilID++,e=this.context.gl;return new zt({func:e.NOTEQUAL,mask:255},t,255,e.KEEP,e.KEEP,e.REPLACE)},wo.prototype.stencilModeForClipping=function(t){var e=this.context.gl;return new zt({func:e.EQUAL,mask:255},this._tileClippingMaskIDs[t.key],0,e.KEEP,e.KEEP,e.REPLACE)},wo.prototype.stencilConfigForOverlap=function(t){var e,i=this.context.gl,o=t.sort((function(t,e){return e.overscaledZ-t.overscaledZ})),r=o[o.length-1].overscaledZ,a=o[0].overscaledZ-r+1;if(a>1){this.currentStencilSource=void 0,this.nextStencilID+a>256&&this.clearStencil();for(var n={},s=0;s=0;this.currentLayer--){var x=this.style._layers[r[this.currentLayer]],b=a[x.source],w=h[x.source];this._renderTileClippingMasks(x,w),this.renderLayer(this,b,x,w);}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayer0?e.pop():null},wo.prototype.isPatternMissing=function(t){if(!t)return !1;if(!t.from||!t.to)return !0;var e=this.imageManagerFactory.getPattern(t.from.toString()),i=this.imageManagerFactory.getPattern(t.to.toString());return !e||!i},wo.prototype.useProgram=function(t,e){this.cache=this.cache||{};var i=""+t+(e?e.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"");return this.cache[i]||(this.cache[i]=new Ti(this.context,t,bi[t],e,Qi[t],this._showOverdrawInspector)),this.cache[i]},wo.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();},wo.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);},wo.prototype.initDebugOverlayCanvas=function(){null==this.debugOverlayCanvas&&(this.debugOverlayCanvas=t.window.document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new t.Texture(this.context,this.debugOverlayCanvas,this.context.gl.RGBA));},wo.prototype.destroy=function(){this.emptyTexture.destroy(),this.debugOverlayTexture&&this.debugOverlayTexture.destroy();};var Eo=function(t,e){this.points=t,this.planes=e;};Eo.fromInvProjectionMatrix=function(e,i,o){var r=Math.pow(2,o),a=[[-1,1,-1,1],[1,1,-1,1],[1,-1,-1,1],[-1,-1,-1,1],[-1,1,1,1],[1,1,1,1],[1,-1,1,1],[-1,-1,1,1]].map((function(i){return t.transformMat4([],i,e)})).map((function(e){return t.scale$1([],e,1/e[3]/i*r)})),n=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map((function(e){var i=t.sub([],a[e[0]],a[e[1]]),o=t.sub([],a[e[2]],a[e[1]]),r=t.normalize([],t.cross([],i,o)),n=-t.dot(r,a[e[1]]);return r.concat(n)}));return new Eo(a,n)};var To=function(e,i){this.min=e,this.max=i,this.center=t.scale$2([],t.add([],this.min,this.max),.5);};To.prototype.quadrant=function(e){for(var i=[e%2==0,e<2],o=t.clone$2(this.min),r=t.clone$2(this.max),a=0;a=0;if(0===n)return 0;n!==i.length&&(o=!1);}if(o)return 2;for(var l=0;l<3;l++){for(var c=Number.MAX_VALUE,h=-Number.MAX_VALUE,u=0;uthis.max[l]-this.min[l])return 0}return 1};var So=function(t,e,i,o){if(void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===o&&(o=0),isNaN(t)||t<0||isNaN(e)||e<0||isNaN(i)||i<0||isNaN(o)||o<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=t,this.bottom=e,this.left=i,this.right=o;};So.prototype.interpolate=function(e,i,o){return null!=i.top&&null!=e.top&&(this.top=t.number(e.top,i.top,o)),null!=i.bottom&&null!=e.bottom&&(this.bottom=t.number(e.bottom,i.bottom,o)),null!=i.left&&null!=e.left&&(this.left=t.number(e.left,i.left,o)),null!=i.right&&null!=e.right&&(this.right=t.number(e.right,i.right,o)),this},So.prototype.getCenter=function(e,i){var o=t.clamp((this.left+e-this.right)/2,0,e),r=t.clamp((this.top+i-this.bottom)/2,0,i);return new t.Point(o,r)},So.prototype.equals=function(t){return this.top===t.top&&this.bottom===t.bottom&&this.left===t.left&&this.right===t.right},So.prototype.clone=function(){return new So(this.top,this.bottom,this.left,this.right)},So.prototype.toJSON=function(){return {top:this.top,bottom:this.bottom,left:this.left,right:this.right}};var Io=function(e,i,o,r,a,n,s){this.tileSize=512,this.maxValidLatitude=85.051129,this._renderWorldCopies=void 0===a||a,this._minZoom=e||0,this._maxZoom=i||22,this._minPitch=null==o?0:o,this._maxPitch=null==r?60:r,this.setMaxBounds(),s&&this.setCRS(s),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._edgeInsets=new So,this._posMatrixCache={},this._alignedPosMatrixCache={};},Po={minZoom:{configurable:!0},maxZoom:{configurable:!0},minPitch:{configurable:!0},maxPitch:{configurable:!0},renderWorldCopies:{configurable:!0},worldSize:{configurable:!0},centerOffset:{configurable:!0},size:{configurable:!0},bearing:{configurable:!0},pitch:{configurable:!0},fov:{configurable:!0},zoom:{configurable:!0},center:{configurable:!0},padding:{configurable:!0},centerPoint:{configurable:!0},unmodified:{configurable:!0},point:{configurable:!0}};Io.prototype.clone=function(){var t=new Io(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies,null,this.crs);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._edgeInsets=this._edgeInsets.clone(),t._calcMatrices(),t},Io.prototype.getCRS=function(){return this.crs},Io.prototype.setCRS=function(t){this.crs=t,this.indexExtent=t.getExtent(),this.worldWidth=this.indexExtent[2]-this.indexExtent[0],this.worldHeight=this.indexExtent[3]-this.indexExtent[1],this.centerX=(this.indexExtent[2]+this.indexExtent[0])/2,this.centerY=(this.indexExtent[3]+this.indexExtent[1])/2,this.originX=this.indexExtent[0],this.originY=this.indexExtent[3];},Po.minZoom.get=function(){return this._minZoom},Po.minZoom.set=function(t){this._minZoom!==t&&(this._minZoom=t,this.zoom=Math.max(this.zoom,t));},Po.maxZoom.get=function(){return this._maxZoom},Po.maxZoom.set=function(t){this._maxZoom!==t&&(this._maxZoom=t,this.zoom=Math.min(this.zoom,t));},Po.minPitch.get=function(){return this._minPitch},Po.minPitch.set=function(t){this._minPitch!==t&&(this._minPitch=t,this.pitch=Math.max(this.pitch,t));},Po.maxPitch.get=function(){return this._maxPitch},Po.maxPitch.set=function(t){this._maxPitch!==t&&(this._maxPitch=t,this.pitch=Math.min(this.pitch,t));},Po.renderWorldCopies.get=function(){return this._renderWorldCopies},Po.renderWorldCopies.set=function(t){void 0===t?t=!0:null===t&&(t=!1),this._renderWorldCopies=t;},Po.worldSize.get=function(){return this.tileSize*this.scale},Po.centerOffset.get=function(){return this.centerPoint._sub(this.size._div(2))},Po.size.get=function(){return new t.Point(this.width,this.height)},Po.bearing.get=function(){return -this.angle/Math.PI*180},Po.bearing.set=function(e){var i=-t.wrap(e,-180,180)*Math.PI/180;this.angle!==i&&(this._unmodified=!1,this.angle=i,this._calcMatrices(),this.rotationMatrix=t.create$2(),t.rotate(this.rotationMatrix,this.rotationMatrix,this.angle));},Po.pitch.get=function(){return this._pitch/Math.PI*180},Po.pitch.set=function(e){var i=t.clamp(e,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==i&&(this._unmodified=!1,this._pitch=i,this._calcMatrices());},Po.fov.get=function(){return this._fov/Math.PI*180},Po.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());},Po.zoom.get=function(){return this._zoom},Po.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());},Po.center.get=function(){return this._center},Po.center.set=function(t){t.lat===this._center.lat&&t.lng===this._center.lng||(this._unmodified=!1,this._center=t,this._constrain(),this._calcMatrices());},Po.padding.get=function(){return this._edgeInsets.toJSON()},Po.padding.set=function(t){this._edgeInsets.equals(t)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,t,1),this._calcMatrices());},Po.centerPoint.get=function(){return this._edgeInsets.getCenter(this.width,this.height)},Io.prototype.isPaddingEqual=function(t){return this._edgeInsets.equals(t)},Io.prototype.interpolatePadding=function(t,e,i){this._unmodified=!1,this._edgeInsets.interpolate(t,e,i),this._constrain(),this._calcMatrices();},Io.prototype.coveringZoomLevel=function(t){var e=(t.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/t.tileSize));return Math.max(0,e)},Io.prototype.getVisibleUnwrappedCoordinates=function(e){var i=[new t.UnwrappedTileID(0,e)];if(this._renderWorldCopies)for(var o=this.pointCoordinate(new t.Point(0,0)),r=this.pointCoordinate(new t.Point(this.width,0)),a=this.pointCoordinate(new t.Point(this.width,this.height)),n=this.pointCoordinate(new t.Point(0,this.height)),s=Math.floor(Math.min(o.x,r.x,a.x,n.x)),l=Math.floor(Math.max(o.x,r.x,a.x,n.x)),c=s-1;c<=l+1;c++)0!==c&&i.push(new t.UnwrappedTileID(c,e));return i},Io.prototype.coveringTiles=function(e){var i=this.coveringZoomLevel(e),o=i;if(void 0!==e.minzoom&&ie.maxzoom&&(i=e.maxzoom);var r=this.crs.fromLngLat(this.center),a=Math.pow(2,i),n=[a*r.x,a*r.y,0],s=Eo.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,i),l=e.minzoom||0;this.pitch<=60&&this._edgeInsets.top<.1&&(l=i);var c=function(t){return {aabb:new To([t*a,0,0],[(t+1)*a,a,0]),zoom:0,x:0,y:0,wrap:t,fullyVisible:!1}},h=[],u=[],p=i,d=e.reparseOverscaled?o:i;if(this._renderWorldCopies)for(var _=1;_<=3;_++)h.push(c(-_)),h.push(c(_));for(h.push(c(0));h.length>0;){var f=h.pop(),m=f.x,g=f.y,v=f.fullyVisible;if(!v){var y=f.aabb.intersects(s);if(0===y)continue;v=2===y;}var x=f.aabb.distanceX(n),b=f.aabb.distanceY(n),w=Math.max(Math.abs(x),Math.abs(b));if(f.zoom===p||w>3+(1<=l)u.push({tileID:new t.OverscaledTileID(f.zoom===p?d:f.zoom,f.wrap,f.zoom,m,g,this.indexExtent),distanceSq:t.sqrLen([n[0]-.5-m,n[1]-.5-g])});else for(var E=0;E<4;E++){var T=(m<<1)+E%2,S=(g<<1)+(E>>1);h.push({aabb:f.aabb.quadrant(E),zoom:f.zoom+1,x:T,y:S,wrap:f.wrap,fullyVisible:v});}}return u.sort((function(t,e){return t.distanceSq-e.distanceSq})).map((function(t){return t.tileID}))},Io.prototype.resize=function(t,e){this.width=t,this.height=e,this.pixelsToGLUnits=[2/t,-2/e],this._constrain(),this._calcMatrices();},Po.unmodified.get=function(){return this._unmodified},Io.prototype.zoomScale=function(t){return Math.pow(2,t)},Io.prototype.scaleZoom=function(t){return Math.log(t)/Math.LN2},Io.prototype.project=function(e){var i=this.latRange?t.clamp(e.lat,-this.maxValidLatitude,this.maxValidLatitude):e.lat,o=this.lngLatXY(e.lng,i);return new t.Point(o[0],o[1])},Io.prototype.unproject=function(e){var i=this.xYLngLat(e.x,e.y);return new t.LngLat(i[0],i[1])},Po.point.get=function(){return this.project(this.center)},Io.prototype.lngLatXY=function(t,e){var i=this.crs.fromWGS84([t,e]);return [(i[0]-this.originX)*this.worldSize/this.worldWidth,(this.originY-i[1])*this.worldSize/this.worldHeight]},Io.prototype.lngX=function(t){return this.lngLatXY(t,this.center.lat)[0]},Io.prototype.latY=function(t){return this.lngLatXY(this.center.lng,t)[1]},Io.prototype.xYLngLat=function(t,e){return this.crs.toWGS84([t*this.worldWidth/this.worldSize+this.originX,this.originY-e*this.worldHeight/this.worldSize])},Io.prototype.xLng=function(t){var e=this.center,i=this.lngLatXY(e.lng,e.lat);return this.xYLngLat(t,i[1])[0]},Io.prototype.yLat=function(t){var e=this.center,i=this.lngLatXY(e.lng,e.lat);return this.xYLngLat(i[0],t)[1]},Io.prototype.setLocationAtPoint=function(e,i){var o=this.pointCoordinate(i),r=this.pointCoordinate(this.centerPoint),a=this.locationCoordinate(e),n=new t.MercatorCoordinate(a.x-(o.x-r.x),a.y-(o.y-r.y));this.center=this.coordinateLocation(n),this._renderWorldCopies&&(this.center=this.center.wrap());},Io.prototype.locationPoint=function(t){return this.coordinatePoint(this.locationCoordinate(t))},Io.prototype.pointLocation=function(t){return this.coordinateLocation(this.pointCoordinate(t))},Io.prototype.locationCoordinate=function(t){return this.crs.fromLngLat(t)},Io.prototype.coordinateLocation=function(t){return this.crs.toLngLat(t.x,t.y)},Io.prototype.pointCoordinate=function(e){var i=[e.x,e.y,0,1],o=[e.x,e.y,1,1];t.transformMat4(i,i,this.pixelMatrixInverse),t.transformMat4(o,o,this.pixelMatrixInverse);var r=i[3],a=o[3],n=i[1]/r,s=o[1]/a,l=i[2]/r,c=o[2]/a,h=l===c?0:(0-l)/(c-l);return new t.MercatorCoordinate(t.number(i[0]/r,o[0]/a,h)/this.worldSize,t.number(n,s,h)/this.worldSize)},Io.prototype.coordinatePoint=function(e){var i=[e.x*this.worldSize,e.y*this.worldSize,0,1];return t.transformMat4(i,i,this.pixelMatrix),new t.Point(i[0]/i[3],i[1]/i[3])},Io.prototype.getBounds=function(){return (new t.LngLatBounds).extend(this.pointLocation(new t.Point(0,0))).extend(this.pointLocation(new t.Point(this.width,0))).extend(this.pointLocation(new t.Point(this.width,this.height))).extend(this.pointLocation(new t.Point(0,this.height)))},Io.prototype.getMaxBounds=function(){return this.latRange&&2===this.latRange.length&&this.lngRange&&2===this.lngRange.length?new t.LngLatBounds([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]]):null},Io.prototype.setMaxBounds=function(t){t?(this.lngRange=[t.getWest(),t.getEast()],this.latRange=[t.getSouth(),t.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-this.maxValidLatitude,this.maxValidLatitude]);},Io.prototype.calculatePosMatrix=function(e,i){void 0===i&&(i=!1);var o=e.key,r=i?this._alignedPosMatrixCache:this._posMatrixCache;if(r[o])return r[o];var a=e.canonical,n=this.worldSize/this.zoomScale(a.z),s=a.x+Math.pow(2,a.z)*e.wrap,l=t.identity(new Float64Array(16));return t.translate(l,l,[s*n,a.y*n,0]),t.scale(l,l,[n/t.EXTENT,n/t.EXTENT,1]),t.multiply(l,i?this.alignedProjMatrix:this.projMatrix,l),r[o]=new Float32Array(l),r[o]},Io.prototype.customLayerMatrix=function(){return this.mercatorMatrix.slice()},Io.prototype._constrain=function(){if(this.center&&this.width&&this.height&&!this._constraining){this._constraining=!0;var e,i,o,r,a=-90,n=90,s=-180,l=180,c=this.size,h=this._unmodified;if(this.latRange){var u=this.latRange;a=this.latY(u[1]),e=(n=this.latY(u[0]))-an&&(r=n-m);}if(this.lngRange){var g=d.x,v=c.x/2;g-vl&&(o=l-v);}void 0===o&&void 0===r||(this.center=this.unproject(new t.Point(void 0!==o?o:d.x,void 0!==r?r:d.y))),this._unmodified=h,this._constraining=!1;}},Io.prototype._calcMatrices=function(){if(this.height){var e=this.centerOffset;this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height;var i=Math.PI/2+this._pitch,o=this._fov*(.5+e.y/this.height),r=Math.sin(o)*this.cameraToCenterDistance/Math.sin(t.clamp(Math.PI-i-o,.01,Math.PI-.01)),a=this.point,n=a.x,s=a.y,l=1.01*(Math.cos(Math.PI/2-this._pitch)*r+this.cameraToCenterDistance),c=this.height/50,h=new Float64Array(16);t.perspective(h,this._fov,this.width/this.height,c,l),h[8]=2*-e.x/this.width,h[9]=2*e.y/this.height,t.scale(h,h,[1,-1,1]),t.translate(h,h,[0,0,-this.cameraToCenterDistance]),t.rotateX(h,h,this._pitch),t.rotateZ(h,h,this.angle),t.translate(h,h,[-n,-s,0]),this.mercatorMatrix=t.scale([],h,[this.worldSize,this.worldSize,this.worldSize]);var u=this.worldSize/(2*Math.PI*6378137*Math.abs(Math.cos(this.center.lat*(Math.PI/180))));"m"!==this.units&&"meter"!==this.units||(u=this.crs?this.worldSize/(this.crs.extent[3]-this.crs.extent[1]):this.worldSize/(this.latRange[1]-this.latRange[0])),t.scale(h,h,[1,1,u,1]),this.projMatrix=h,this.invProjMatrix=t.invert([],this.projMatrix);var p=this.width%2/2,d=this.height%2/2,_=Math.cos(this.angle),f=Math.sin(this.angle),m=n-Math.round(n)+_*p+f*d,g=s-Math.round(s)+_*d+f*p,v=new Float64Array(h);if(t.translate(v,v,[m>.5?m-1:m,g>.5?g-1:g,0]),this.alignedProjMatrix=v,h=t.create(),t.scale(h,h,[this.width/2,-this.height/2,1]),t.translate(h,h,[1,-1,0]),this.labelPlaneMatrix=h,h=t.create(),t.scale(h,h,[1,-1,1]),t.translate(h,h,[-1,-1,0]),t.scale(h,h,[2/this.width,2/this.height,1]),this.glCoordMatrix=h,this.pixelMatrix=t.multiply(new Float64Array(16),this.labelPlaneMatrix,this.projMatrix),!(h=t.invert(new Float64Array(16),this.pixelMatrix)))throw new Error("failed to invert matrix");this.pixelMatrixInverse=h,this._posMatrixCache={},this._alignedPosMatrixCache={};}},Io.prototype.maxPitchScaleFactor=function(){if(!this.pixelMatrixInverse)return 1;var e=this.pointCoordinate(new t.Point(0,0)),i=[e.x*this.worldSize,e.y*this.worldSize,0,1];return t.transformMat4(i,i,this.pixelMatrix)[3]/this.cameraToCenterDistance},Io.prototype.getCameraPoint=function(){var e=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new t.Point(0,e))},Io.prototype.getCameraQueryGeometry=function(e){var i=this.getCameraPoint();if(1===e.length)return [e[0],i];for(var o=i.x,r=i.y,a=i.x,n=i.y,s=0,l=e;s=3&&!t.some((function(t){return isNaN(t)}))){var e=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(t[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+t[2],+t[1]],zoom:+t[0],bearing:e,pitch:+(t[4]||0)}),!0}return !1},Co.prototype._updateHashUnthrottled=function(){var e=this.getHashString();try{t.window.history.replaceState(t.window.history.state,"",e);}catch(t){}};var zo={linearity:.3,easing:t.bezier(0,0,.3,1)},Mo=t.extend({deceleration:2500,maxSpeed:1400},zo),Lo=t.extend({deceleration:20,maxSpeed:1400},zo),Do=t.extend({deceleration:1e3,maxSpeed:360},zo),Ro=t.extend({deceleration:1e3,maxSpeed:90},zo),Ao=function(t){this._map=t,this.clear();};function ko(t,e){(!t.duration||t.duration0&&i-e[0].time>160;)e.shift();},Ao.prototype._onMoveEnd=function(e){if(this._drainInertiaBuffer(),!(this._inertiaBuffer.length<2)){for(var i={zoom:0,bearing:0,pitch:0,pan:new t.Point(0,0),pinchAround:void 0,around:void 0},o=0,r=this._inertiaBuffer;o=this._clickTolerance||this._map.fire(new Bo(t.type,this._map,t));},No.prototype.dblclick=function(t){return this._firePreventable(new Bo(t.type,this._map,t))},No.prototype.mouseover=function(t){this._map.fire(new Bo(t.type,this._map,t));},No.prototype.mouseout=function(t){this._map.fire(new Bo(t.type,this._map,t));},No.prototype.touchstart=function(t){return this._firePreventable(new Fo(t.type,this._map,t))},No.prototype.touchmove=function(t){this._map.fire(new Fo(t.type,this._map,t));},No.prototype.touchend=function(t){this._map.fire(new Fo(t.type,this._map,t));},No.prototype.touchcancel=function(t){this._map.fire(new Fo(t.type,this._map,t));},No.prototype._firePreventable=function(t){if(this._map.fire(t),t.defaultPrevented)return {}},No.prototype.isEnabled=function(){return !0},No.prototype.isActive=function(){return !1},No.prototype.enable=function(){},No.prototype.disable=function(){};var jo=function(t){this._map=t;};jo.prototype.reset=function(){this._delayContextMenu=!1,delete this._contextMenuEvent;},jo.prototype.mousemove=function(t){this._map.fire(new Bo(t.type,this._map,t));},jo.prototype.mousedown=function(){this._delayContextMenu=!0;},jo.prototype.mouseup=function(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new Bo("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent);},jo.prototype.contextmenu=function(t){this._delayContextMenu?this._contextMenuEvent=t:this._map.fire(new Bo(t.type,this._map,t)),this._map.listens("contextmenu")&&t.preventDefault();},jo.prototype.isEnabled=function(){return !0},jo.prototype.isActive=function(){return !1},jo.prototype.enable=function(){},jo.prototype.disable=function(){};var Zo=function(t,e){this._map=t,this._el=t.getCanvasContainer(),this._container=t.getContainer(),this._clickTolerance=e.clickTolerance||1;};function qo(t,e){for(var i={},o=0;othis.numTouches)&&(this.aborted=!0),this.aborted||(void 0===this.startTime&&(this.startTime=e.timeStamp),o.length===this.numTouches&&(this.centroid=function(e){for(var i=new t.Point(0,0),o=0,r=e;o30)&&(this.aborted=!0);}}},Go.prototype.touchend=function(t,e,i){if((!this.centroid||t.timeStamp-this.startTime>500)&&(this.aborted=!0),0===i.length){var o=!this.aborted&&this.centroid;if(this.reset(),o)return o}};var Vo=function(t){this.singleTap=new Go(t),this.numTaps=t.numTaps,this.reset();};Vo.prototype.reset=function(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset();},Vo.prototype.touchstart=function(t,e,i){this.singleTap.touchstart(t,e,i);},Vo.prototype.touchmove=function(t,e,i){this.singleTap.touchmove(t,e,i);},Vo.prototype.touchend=function(t,e,i){var o=this.singleTap.touchend(t,e,i);if(o){var r=t.timeStamp-this.lastTime<500,a=!this.lastTap||this.lastTap.dist(o)<30;if(r&&a||this.reset(),this.count++,this.lastTime=t.timeStamp,this.lastTap=o,this.count===this.numTaps)return this.reset(),o}};var Wo=function(){this._zoomIn=new Vo({numTouches:1,numTaps:2}),this._zoomOut=new Vo({numTouches:2,numTaps:1}),this.reset();};Wo.prototype.reset=function(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset();},Wo.prototype.touchstart=function(t,e,i){this._zoomIn.touchstart(t,e,i),this._zoomOut.touchstart(t,e,i);},Wo.prototype.touchmove=function(t,e,i){this._zoomIn.touchmove(t,e,i),this._zoomOut.touchmove(t,e,i);},Wo.prototype.touchend=function(t,e,i){var o=this,r=this._zoomIn.touchend(t,e,i),a=this._zoomOut.touchend(t,e,i);return r?(this._active=!0,t.preventDefault(),setTimeout((function(){return o.reset()}),0),{cameraAnimation:function(e){return e.easeTo({duration:300,zoom:e.getZoom()+1,around:e.unproject(r)},{originalEvent:t})}}):a?(this._active=!0,t.preventDefault(),setTimeout((function(){return o.reset()}),0),{cameraAnimation:function(e){return e.easeTo({duration:300,zoom:e.getZoom()-1,around:e.unproject(a)},{originalEvent:t})}}):void 0},Wo.prototype.touchcancel=function(){this.reset();},Wo.prototype.enable=function(){this._enabled=!0;},Wo.prototype.disable=function(){this._enabled=!1,this.reset();},Wo.prototype.isEnabled=function(){return this._enabled},Wo.prototype.isActive=function(){return this._active};var Xo={0:1,2:2},Ho=function(t){this.reset(),this._clickTolerance=t.clickTolerance||1;};Ho.prototype.reset=function(){this._active=!1,this._moved=!1,delete this._lastPoint,delete this._eventButton;},Ho.prototype._correctButton=function(t,e){return !1},Ho.prototype._move=function(t,e){return {}},Ho.prototype.mousedown=function(t,e){if(!this._lastPoint){var o=i.mouseButton(t);this._correctButton(t,o)&&(this._lastPoint=e,this._eventButton=o);}},Ho.prototype.mousemoveWindow=function(t,e){var i=this._lastPoint;if(i)if(t.preventDefault(),function(t,e){var i=Xo[e];return void 0===t.buttons||(t.buttons&i)!==i}(t,this._eventButton))this.reset();else if(this._moved||!(e.dist(i)0&&(this._active=!0);var r=qo(o,i),a=new t.Point(0,0),n=new t.Point(0,0),s=0;for(var l in r){var c=r[l],h=this._touches[l];h&&(a._add(c),n._add(c.sub(h)),s++,r[l]=c);}if(this._touches=r,!(sMath.abs(t.x)}var nr=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.reset=function(){t.prototype.reset.call(this),this._valid=void 0,delete this._firstMove,delete this._lastPoints;},e.prototype._start=function(t){this._lastPoints=t,ar(t[0].sub(t[1]))&&(this._valid=!1);},e.prototype._move=function(t,e,i){var o=t[0].sub(this._lastPoints[0]),r=t[1].sub(this._lastPoints[1]);if(this._valid=this.gestureBeginsVertically(o,r,i.timeStamp),this._valid)return this._lastPoints=t,this._active=!0,{pitchDelta:(o.y+r.y)/2*-.5}},e.prototype.gestureBeginsVertically=function(t,e,i){if(void 0!==this._valid)return this._valid;var o=t.mag()>=2,r=e.mag()>=2;if(o||r){if(!o||!r)return void 0===this._firstMove&&(this._firstMove=i),i-this._firstMove<100&&void 0;var a=t.y>0==e.y>0;return ar(t)&&ar(e)&&a}},e}($o),sr={panStep:100,bearingStep:15,pitchStep:10},lr=function(){var t=sr;this._panStep=t.panStep,this._bearingStep=t.bearingStep,this._pitchStep=t.pitchStep;};function cr(t){return t*(2-t)}lr.prototype.reset=function(){this._active=!1;},lr.prototype.keydown=function(t){var e=this;if(!(t.altKey||t.ctrlKey||t.metaKey)){var i=0,o=0,r=0,a=0,n=0;switch(t.keyCode){case 61:case 107:case 171:case 187:i=1;break;case 189:case 109:case 173:i=-1;break;case 37:t.shiftKey?o=-1:(t.preventDefault(),a=-1);break;case 39:t.shiftKey?o=1:(t.preventDefault(),a=1);break;case 38:t.shiftKey?r=1:(t.preventDefault(),n=-1);break;case 40:t.shiftKey?r=-1:(t.preventDefault(),n=1);break;default:return}return {cameraAnimation:function(s){var l=s.getZoom();s.easeTo({duration:300,easeId:"keyboardHandler",easing:cr,zoom:i?Math.round(l)+i*(t.shiftKey?2:1):l,bearing:s.getBearing()+o*e._bearingStep,pitch:s.getPitch()+r*e._pitchStep,offset:[-a*e._panStep,-n*e._panStep],center:s.getCenter()},{originalEvent:t});}}}},lr.prototype.enable=function(){this._enabled=!0;},lr.prototype.disable=function(){this._enabled=!1,this.reset();},lr.prototype.isEnabled=function(){return this._enabled},lr.prototype.isActive=function(){return this._active};var hr=function(e,i){this._map=e,this._el=e.getCanvasContainer(),this._handler=i,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=1/450,t.bindAll(["_onTimeout"],this);};hr.prototype.setZoomRate=function(t){this._defaultZoomRate=t;},hr.prototype.setWheelZoomRate=function(t){this._wheelZoomRate=t;},hr.prototype.isEnabled=function(){return !!this._enabled},hr.prototype.isActive=function(){return !!this._active||void 0!==this._finishTimeout},hr.prototype.isZooming=function(){return !!this._zooming},hr.prototype.enable=function(t){this.isEnabled()||(this._enabled=!0,this._aroundCenter=t&&"center"===t.around);},hr.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1);},hr.prototype.wheel=function(e){if(this.isEnabled()){var i=e.deltaMode===t.window.WheelEvent.DOM_DELTA_LINE?40*e.deltaY:e.deltaY,o=t.browser.now(),r=o-(this._lastWheelEventTime||0);this._lastWheelEventTime=o,0!==i&&i%4.000244140625==0?this._type="wheel":0!==i&&Math.abs(i)<4?this._type="trackpad":r>400?(this._type=null,this._lastValue=i,this._timeout=setTimeout(this._onTimeout,40,e)):this._type||(this._type=Math.abs(r*i)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,i+=this._lastValue)),e.shiftKey&&i&&(i/=4),this._type&&(this._lastWheelEvent=e,this._delta-=i,this._active||this._start(e)),e.preventDefault();}},hr.prototype._onTimeout=function(t){this._type="wheel",this._delta-=this._lastValue,this._active||this._start(t);},hr.prototype._start=function(e){if(this._delta){this._frameId&&(this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);var o=i.mousePos(this._el,e);this._around=t.LngLat.convert(this._aroundCenter?this._map.getCenter():this._map.unproject(o)),this._aroundPoint=this._map.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._handler._triggerRenderFrame());}},hr.prototype.renderFrame=function(){var e=this;if(this._frameId&&(this._frameId=null,this.isActive())){var i=this._map.transform;if(0!==this._delta){var o="wheel"===this._type&&Math.abs(this._delta)>4.000244140625?this._wheelZoomRate:this._defaultZoomRate,r=2/(1+Math.exp(-Math.abs(this._delta*o)));this._delta<0&&0!==r&&(r=1/r);var a="number"==typeof this._targetZoom?i.zoomScale(this._targetZoom):i.scale;this._targetZoom=Math.min(i.maxZoom,Math.max(i.minZoom,i.scaleZoom(a*r))),"wheel"===this._type&&(this._startZoom=i.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0;}var n,s="number"==typeof this._targetZoom?this._targetZoom:i.zoom,l=this._startZoom,c=this._easing,h=!1;if("wheel"===this._type&&l&&c){var u=Math.min((t.browser.now()-this._lastWheelEventTime)/200,1),p=c(u);n=t.number(l,s,p),u<1?this._frameId||(this._frameId=!0):h=!0;}else n=s,h=!0;return this._active=!0,h&&(this._active=!1,this._finishTimeout=setTimeout((function(){e._zooming=!1,e._handler._triggerRenderFrame(),delete e._targetZoom,delete e._finishTimeout;}),200)),{noInertia:!0,needsRenderFrame:!h,zoomDelta:n-i.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}},hr.prototype._smoothOutEasing=function(e){var i=t.ease;if(this._prevEase){var o=this._prevEase,r=(t.browser.now()-o.start)/o.duration,a=o.easing(r+.01)-o.easing(r),n=.27/Math.sqrt(a*a+1e-4)*.01,s=Math.sqrt(.0729-n*n);i=t.bezier(n,s,.25,1);}return this._prevEase={start:t.browser.now(),duration:e,easing:i},i},hr.prototype.reset=function(){this._active=!1;};var ur=function(t,e){this._clickZoom=t,this._tapZoom=e;};ur.prototype.enable=function(){this._clickZoom.enable(),this._tapZoom.enable();},ur.prototype.disable=function(){this._clickZoom.disable(),this._tapZoom.disable();},ur.prototype.isEnabled=function(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()},ur.prototype.isActive=function(){return this._clickZoom.isActive()||this._tapZoom.isActive()};var pr=function(){this.reset();};pr.prototype.reset=function(){this._active=!1;},pr.prototype.dblclick=function(t,e){return t.preventDefault(),{cameraAnimation:function(i){i.easeTo({duration:300,zoom:i.getZoom()+(t.shiftKey?-1:1),around:i.unproject(e)},{originalEvent:t});}}},pr.prototype.enable=function(){this._enabled=!0;},pr.prototype.disable=function(){this._enabled=!1,this.reset();},pr.prototype.isEnabled=function(){return this._enabled},pr.prototype.isActive=function(){return this._active};var dr=function(){this._tap=new Vo({numTouches:1,numTaps:1}),this.reset();};dr.prototype.reset=function(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,this._tap.reset();},dr.prototype.touchstart=function(t,e,i){this._swipePoint||(this._tapTime&&t.timeStamp-this._tapTime>500&&this.reset(),this._tapTime?i.length>0&&(this._swipePoint=e[0],this._swipeTouch=i[0].identifier):this._tap.touchstart(t,e,i));},dr.prototype.touchmove=function(t,e,i){if(this._tapTime){if(this._swipePoint){if(i[0].identifier!==this._swipeTouch)return;var o=e[0],r=o.y-this._swipePoint.y;return this._swipePoint=o,t.preventDefault(),this._active=!0,{zoomDelta:r/128}}}else this._tap.touchmove(t,e,i);},dr.prototype.touchend=function(t,e,i){this._tapTime?this._swipePoint&&0===i.length&&this.reset():this._tap.touchend(t,e,i)&&(this._tapTime=t.timeStamp);},dr.prototype.touchcancel=function(){this.reset();},dr.prototype.enable=function(){this._enabled=!0;},dr.prototype.disable=function(){this._enabled=!1,this.reset();},dr.prototype.isEnabled=function(){return this._enabled},dr.prototype.isActive=function(){return this._active};var _r=function(t,e,i){this._el=t,this._mousePan=e,this._touchPan=i;};_r.prototype.enable=function(t){this._inertiaOptions=t||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("mapboxgl-touch-drag-pan");},_r.prototype.disable=function(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("mapboxgl-touch-drag-pan");},_r.prototype.isEnabled=function(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()},_r.prototype.isActive=function(){return this._mousePan.isActive()||this._touchPan.isActive()};var fr=function(t,e,i){this._pitchWithRotate=t.pitchWithRotate,this._mouseRotate=e,this._mousePitch=i;};fr.prototype.enable=function(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable();},fr.prototype.disable=function(){this._mouseRotate.disable(),this._mousePitch.disable();},fr.prototype.isEnabled=function(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())},fr.prototype.isActive=function(){return this._mouseRotate.isActive()||this._mousePitch.isActive()};var mr=function(t,e,i,o){this._el=t,this._touchZoom=e,this._touchRotate=i,this._tapDragZoom=o,this._rotationDisabled=!1,this._enabled=!0;};mr.prototype.enable=function(t){this._touchZoom.enable(t),this._rotationDisabled||this._touchRotate.enable(t),this._tapDragZoom.enable(),this._el.classList.add("mapboxgl-touch-zoom-rotate");},mr.prototype.disable=function(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("mapboxgl-touch-zoom-rotate");},mr.prototype.isEnabled=function(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()},mr.prototype.isActive=function(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()},mr.prototype.disableRotation=function(){this._rotationDisabled=!0,this._touchRotate.disable();},mr.prototype.enableRotation=function(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable();};var gr=function(t){return t.zoom||t.drag||t.pitch||t.rotate},vr=function(t){function e(){t.apply(this,arguments);}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(t.Event);function yr(t){return t.panDelta&&t.panDelta.mag()||t.zoomDelta||t.bearingDelta||t.pitchDelta}var xr=function(e,o){this._map=e,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new Ao(e),this._bearingSnap=o.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(o),t.bindAll(["handleEvent","handleWindowEvent"],this);var r=this._el;this._listeners=[[r,"touchstart",{passive:!0}],[r,"touchmove",{passive:!1}],[r,"touchend",void 0],[r,"touchcancel",void 0],[r,"mousedown",void 0],[r,"mousemove",void 0],[r,"mouseup",void 0],[t.window.document,"mousemove",{capture:!0}],[t.window.document,"mouseup",void 0],[r,"mouseover",void 0],[r,"mouseout",void 0],[r,"dblclick",void 0],[r,"click",void 0],[r,"keydown",{capture:!1}],[r,"keyup",void 0],[r,"wheel",{passive:!1}],[r,"contextmenu",void 0],[t.window,"blur",void 0]];for(var a=0,n=this._listeners;aa?Math.min(2,b):Math.max(.5,b),w=Math.pow(m,1-e),E=r.unproject(y.add(x.mult(e*w)).mult(f));r.setLocationAtPoint(r.renderWorldCopies?E.wrap():E,_);}o._fireMoveEvents(i);}),(function(t){o._afterEase(i,t);}),e),this},i.prototype._prepareEase=function(e,i,o){void 0===o&&(o={}),this._moving=!0,i||o.moving||this.fire(new t.Event("movestart",e)),this._zooming&&!o.zooming&&this.fire(new t.Event("zoomstart",e)),this._rotating&&!o.rotating&&this.fire(new t.Event("rotatestart",e)),this._pitching&&!o.pitching&&this.fire(new t.Event("pitchstart",e));},i.prototype._fireMoveEvents=function(e){this.fire(new t.Event("move",e)),this._zooming&&this.fire(new t.Event("zoom",e)),this._rotating&&this.fire(new t.Event("rotate",e)),this._pitching&&this.fire(new t.Event("pitch",e));},i.prototype._afterEase=function(e,i){if(!this._easeId||!i||this._easeId!==i){delete this._easeId;var o=this._zooming,r=this._rotating,a=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,o&&this.fire(new t.Event("zoomend",e)),r&&this.fire(new t.Event("rotateend",e)),a&&this.fire(new t.Event("pitchend",e)),this.fire(new t.Event("moveend",e));}},i.prototype.flyTo=function(e,i){var o=this;if(!e.essential&&t.browser.prefersReducedMotion){var r=t.pick(e,["center","zoom","bearing","pitch","around"]);return this.jumpTo(r,i)}this.stop(),e=t.extend({offset:[0,0],speed:1.2,curve:1.42,easing:t.ease},e);var a=this.transform,n=this.getZoom(),s=this.getBearing(),l=this.getPitch(),c=this.getPadding(),h="zoom"in e?t.clamp(+e.zoom,a.minZoom,a.maxZoom):n,u="bearing"in e?this._normalizeBearing(e.bearing,s):s,p="pitch"in e?+e.pitch:l,d="padding"in e?e.padding:a.padding,_=a.zoomScale(h-n),f=t.Point.convert(e.offset),m=a.centerPoint.add(f),g=a.pointLocation(m),v=t.LngLat.convert(e.center||g);this._normalizeCenter(v);var y=a.project(g),x=a.project(v).sub(y),b=e.curve,w=Math.max(a.width,a.height),E=w/_,T=x.mag();if("minZoom"in e){var S=t.clamp(Math.min(e.minZoom,n,h),a.minZoom,a.maxZoom),I=w/a.zoomScale(S-n);b=Math.sqrt(I/T*2);}var P=b*b;function C(t){var e=(E*E-w*w+(t?-1:1)*P*P*T*T)/(2*(t?E:w)*P*T);return Math.log(Math.sqrt(e*e+1)-e)}function z(t){return (Math.exp(t)-Math.exp(-t))/2}function M(t){return (Math.exp(t)+Math.exp(-t))/2}var L=C(0),D=function(t){return M(L)/M(L+b*t)},R=function(t){return w*((M(L)*(z(e=L+b*t)/M(e))-z(L))/P)/T;var e;},A=(C(1)-L)/b;if(Math.abs(T)<1e-6||!isFinite(A)){if(Math.abs(w-E)<1e-6)return this.easeTo(e,i);var k=Ee.maxDuration&&(e.duration=0),this._zooming=!0,this._rotating=s!==u,this._pitching=p!==l,this._padding=!a.isPaddingEqual(d),this._prepareEase(i,!1),this._ease((function(e){var r=e*A,_=1/D(r);a.zoom=1===e?h:n+a.scaleZoom(_),o._rotating&&(a.bearing=t.number(s,u,e)),o._pitching&&(a.pitch=t.number(l,p,e)),o._padding&&(a.interpolatePadding(c,d,e),m=a.centerPoint.add(f));var g=1===e?v:a.unproject(y.add(x.mult(R(r))).mult(_));a.setLocationAtPoint(a.renderWorldCopies?g.wrap():g,m),o._fireMoveEvents(i);}),(function(){return o._afterEase(i)}),e),this},i.prototype.isEasing=function(){return !!this._easeFrameId},i.prototype.stop=function(){return this._stop()},i.prototype._stop=function(t,e){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){var i=this._onEaseEnd;delete this._onEaseEnd,i.call(this,e);}if(!t){var o=this.handlers;o&&o.stop(!1);}return this},i.prototype._ease=function(e,i,o){!1===o.animate||0===o.duration?(e(1),i()):(this._easeStart=t.browser.now(),this._easeOptions=o,this._onEaseFrame=e,this._onEaseEnd=i,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback));},i.prototype._renderFrameCallback=function(){var e=Math.min((t.browser.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(e)),e<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop();},i.prototype._normalizeBearing=function(e,i){e=t.wrap(e,-180,180);var o=Math.abs(e-i);return Math.abs(e-360-i)180?-360:i<-180?360:0;}},i}(t.Evented),wr=function(e){void 0===e&&(e={}),this.options=e,t.bindAll(["_updateEditLink","_updateData","_updateCompact"],this);};wr.prototype.getDefaultPosition=function(){return "bottom-right"},wr.prototype.onAdd=function(t){var e=this.options&&this.options.compact;return this._map=t,this._container=i.create("div","mapboxgl-ctrl mapboxgl-ctrl-attrib"),this._innerContainer=i.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},wr.prototype.onRemove=function(){i.remove(this._container),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("moveend",this._updateEditLink),this._map.off("resize",this._updateCompact),this._map=void 0,this._attribHTML=void 0;},wr.prototype._updateEditLink=function(){var e=this._editLink;e||(e=this._editLink=this._container.querySelector(".mapbox-improve-map"));var i=[{key:"owner",value:this.styleOwner},{key:"id",value:this.styleId},{key:"access_token",value:this._map._requestManager._customAccessToken||t.config.ACCESS_TOKEN}];if(e){var o=i.reduce((function(t,e,o){return e.value&&(t+=e.key+"="+e.value+(o=0)return !1;return !0}))).join(" | ");n!==this._attribHTML&&(this._attribHTML=n,t.length?(this._innerContainer.innerHTML=n,this._container.classList.remove("mapboxgl-attrib-empty")):this._container.classList.add("mapboxgl-attrib-empty"),this._editLink=null);}},wr.prototype._updateCompact=function(){this._map.getCanvasContainer().offsetWidth<=640?this._container.classList.add("mapboxgl-compact"):this._container.classList.remove("mapboxgl-compact");};var Er=function(){t.bindAll(["_updateLogo"],this),t.bindAll(["_updateCompact"],this);};Er.prototype.onAdd=function(t){this._map=t,this._container=i.create("div","mapboxgl-ctrl");var e=i.create("a","mapboxgl-ctrl-logo");return e.target="_blank",e.rel="noopener nofollow",e.href="https://www.mapbox.com/",e.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),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},Er.prototype.onRemove=function(){i.remove(this._container),this._map.off("sourcedata",this._updateLogo),this._map.off("resize",this._updateCompact);},Er.prototype.getDefaultPosition=function(){return "bottom-left"},Er.prototype._updateLogo=function(t){t&&"metadata"!==t.sourceDataType||(this._container.style.display=this._logoRequired()?"block":"none");},Er.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}},Er.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 Tr=function(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1;};Tr.prototype.add=function(t){var e=++this._id;return this._queue.push({callback:t,id:e,cancelled:!1}),e},Tr.prototype.remove=function(t){for(var e=this._currentlyRunning,i=0,o=e?this._queue.concat(e):this._queue;i=0&&i.add(r);return i.size>0?Array.from(i):Sr}(a.projName).join(",")),t.proj4.defs(i,this.WKT));var n=t.proj4.defs(i);if(!n)throw new Error(i+" was not defined,make sure the WKT param was not null");this.unit=n.units||"degree",this.proj4Projection=t.proj4(i);var s=this.proj4Projection.inverse([this.extent[0],this.extent[1]]),l=this.proj4Projection.inverse([this.extent[2],this.extent[3]]);this.lngLatExtent=s.concat(l),this._id=t.uniqueId(),e.set(this);};Pr.prototype.getExtent=function(){if(!this._rectifyExtent){var t=this.extent[2]-this.extent[0],e=this.extent[3]-this.extent[1];if(t===e)this._rectifyExtent=[this.extent[0],this.extent[1],this.extent[2],this.extent[3]];else {var i=Math.max(t,e);this._rectifyExtent=[this.extent[0],this.extent[3]-i,this.extent[0]+i,this.extent[3]];}}return this._rectifyExtent},Pr.prototype.getLngLatCenter=function(){return this._rectifyLngLatExtent||this.getLngLatExtent(),[this._rectifyLngLatExtent[2]+(this._rectifyLngLatExtent[2]-this._rectifyLngLatExtent[0])/2,this._rectifyLngLatExtent[3]-(this._rectifyLngLatExtent[3]-this._rectifyLngLatExtent[1])/2]},Pr.prototype.getLngLatExtent=function(){if(!this._rectifyLngLatExtent){var t=this.proj4Projection.inverse([this.extent[0],this.extent[1]]),e=this.proj4Projection.inverse([this.extent[2],this.extent[3]]),i=e[0]-t[0],o=e[1]-t[1];if(i===o)this._rectifyLngLatExtent=[t[0],t[1],e[0],e[0]];else {var r=Math.max(i,o);this._rectifyLngLatExtent=[t[0],e[1]-r,t[0]+r,e[1]];}}return this._rectifyLngLatExtent},Pr.prototype.getOrigin=function(){return [this.extent[0],this.extent[3]]},Pr.prototype.getEpsgCode=function(){return this.epsgCode},Pr.prototype.getUnit=function(){return this.unit},Pr.prototype.getWKT=function(){return this.WKT},Pr.prototype.getWidth=function(){return this._rectifyExtent[2]-this._rectifyExtent[0]},Pr.prototype.getHeight=function(){return this._rectifyExtent[3]-this._rectifyExtent[1]},Pr.prototype.getOriginX=function(){return this._rectifyExtent[0]},Pr.prototype.getOriginY=function(){return this._rectifyExtent[3]},Pr.prototype.toWGS84=function(t){return this.proj4Projection.inverse(t)},Pr.prototype.fromWGS84=function(t){return this.proj4Projection.forward(t)},Pr.prototype.fromLngLat=function(e){var i=t.LngLat.convert(e),o=this.proj4Projection.forward([i.lng,i.lat]);return {x:(o[0]-this.getOriginX())/this.getWidth(),y:(this.getOriginY()-o[1])/this.getHeight(),z:0}},Pr.prototype.toLngLat=function(e,i){var o=this.proj4Projection.inverse([e*this.getWidth()+this.getOriginX(),this.getOriginY()-i*this.getHeight()]);return new t.LngLat(o[0],o[1])},Pr.get=function(t){for(var e in Pr)if(Pr.hasOwnProperty(e)&&Pr[e].getEpsgCode&&Pr[e].getEpsgCode()===t)return Pr[e];return null},Pr.set=function(t){var e=t.getEpsgCode().replace(":","").toUpperCase();Pr[e]=t;},Pr.defaultWKTs={"EPSG:4490":'GEOGCS["China Geodetic Coordinate System 2000",DATUM["China_2000",SPHEROID["CGCS2000",6378137,298.257222101,AUTHORITY["EPSG","1024"]],AUTHORITY["EPSG","1043"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4490"]]',"EPSG:4214":'GEOGCS["Beijing 1954",DATUM["Beijing_1954",SPHEROID["Krassowsky 1940",6378245,298.3],TOWGS84[15.8,-154.4,-82.3,0,0,0,0]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4214"]]',"EPSG:4610":'GEOGCS["Xian 1980",DATUM["Xian_1980",SPHEROID["IAG 1975",6378140,298.257,AUTHORITY["EPSG","7049"]],AUTHORITY["EPSG","6610"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4610"]]'},Pr.EPSG4326=new Pr("EPSG:4326",[-180,-90,180,90]),Pr.EPSG4490=new Pr("EPSG:4490",[-180,-90,180,90]),Pr.EPSG4214=new Pr("EPSG:4214",[-180,-90,180,90]),Pr.EPSG4610=new Pr("EPSG:4610",[-180,-90,180,90]),Pr.EPSG3857=new Pr("EPSG:3857",[-20037508.3427892,-20037508.3427892,20037508.3427892,20037508.3427892]);var Cr={"FullscreenControl.Enter":"Enter fullscreen","FullscreenControl.Exit":"Exit fullscreen","GeolocateControl.FindMyLocation":"Find my location","GeolocateControl.LocationNotAvailable":"Location not available","LogoControl.Title":"Mapbox logo","NavigationControl.ResetBearing":"Reset bearing to north","NavigationControl.ZoomIn":"Zoom in","NavigationControl.ZoomOut":"Zoom out","ScaleControl.Feet":"ft","ScaleControl.Meters":"m","ScaleControl.Kilometers":"km","ScaleControl.Miles":"mi","ScaleControl.NauticalMiles":"nm"},zr=t.window.HTMLImageElement,Mr=t.window.HTMLElement,Lr=t.window.ImageBitmap,Dr={center:[0,0],zoom:0,bearing:0,pitch:0,minZoom:-2,maxZoom:22,minPitch:0,maxPitch:60,interactive:!0,scrollZoom:!0,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,touchPitch:!0,bearingSnap:7,clickTolerance:3,pitchWithRotate:!0,hash:!1,attributionControl:!0,failIfMajorPerformanceCaveat:!1,preserveDrawingBuffer:!1,trackResize:!0,renderWorldCopies:!0,refreshExpiredTiles:!0,maxTileCacheSize:null,localIdeographFontFamily:"sans-serif",transformRequest:null,accessToken:null,fadeDuration:300,crossSourceCollisions:!0},Rr=function(o){function r(e){var i=this;if(null!=(e=t.extend({},Dr,e)).minZoom&&null!=e.maxZoom&&e.minZoom>e.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(null!=e.minPitch&&null!=e.maxPitch&&e.minPitch>e.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(null!=e.minPitch&&e.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(null!=e.maxPitch&&e.maxPitch>60)throw new Error("maxPitch must be less than or equal to 60");var r=new Io(e.minZoom,e.maxZoom,e.minPitch,e.maxPitch,e.renderWorldCopies);if(o.call(this,r,e),this.transform=r,this.crs=this.toCRS(e.crs),this.initCRS(this.crs),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 Tr,this._controls=[],this._markersCache=[],this._mapId=t.uniqueId(),this._locale=t.extend({},Cr,e.locale),this._requestManager=new t.RequestManager(e.transformRequest,e.accessToken),"string"==typeof e.container){if(this._container=t.window.document.getElementById(e.container),!this._container)throw new Error("Container '"+e.container+"' not found.")}else {if(!(e.container instanceof Mr))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=e.container;}if(e.maxBounds&&this.setMaxBounds(e.maxBounds),t.bindAll(["_onWindowOnline","_onWindowResize","_contextLost","_contextRestored"],this),this._setupContainer(),this._setupPainter(),void 0===this.painter)throw new Error("Failed to initialize WebGL.");this.on("move",(function(){return i._update(!1)})),this.on("moveend",(function(){return i._update(!1)})),this.on("zoom",(function(){return i._update(!0)})),void 0!==t.window&&(t.window.addEventListener("online",this._onWindowOnline,!1),t.window.addEventListener("resize",this._onWindowResize,!1),t.window.addEventListener("orientationchange",this._onWindowResize,!1)),this.handlers=new xr(this,e),this._hash=e.hash&&new Co("string"==typeof e.hash&&e.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:e.center,zoom:e.zoom,bearing:e.bearing,pitch:e.pitch}),e.bounds&&(this.resize(),this.fitBounds(e.bounds,t.extend({},e.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=e.localIdeographFontFamily,e.style&&this.setStyle(e.style,{localIdeographFontFamily:e.localIdeographFontFamily}),e.attributionControl&&this.addControl(new wr({customAttribution:e.customAttribution})),this.addControl(new Er,e.logoPosition),this.on("style.load",(function(){i.transform.unmodified&&i.jumpTo(i.style.stylesheet);})),this.on("data",(function(e){i._update("style"===e.dataType),i.fire(new t.Event(e.dataType+"data",e));})),this.on("dataloading",(function(e){i.fire(new t.Event(e.dataType+"dataloading",e));}));}o&&(r.__proto__=o),(r.prototype=Object.create(o&&o.prototype)).constructor=r;var a={showTileBoundaries:{configurable:!0},showPadding:{configurable:!0},showCollisionBoxes:{configurable:!0},showOverdrawInspector:{configurable:!0},repaint:{configurable:!0},vertices:{configurable:!0},version:{configurable:!0}};return r.prototype.toCRS=function(t){if(t&&"string"==typeof t&&!(t=Pr.get(t)))throw new Error("crs "+t+" is not define");return t||Pr.EPSG3857},r.prototype.getCRS=function(){return this.crs},r.prototype._getMapId=function(){return this._mapId},r.prototype.addControl=function(e,i){if(void 0===i&&e.getDefaultPosition&&(i=e.getDefaultPosition()),void 0===i&&(i="top-right"),!e||!e.onAdd)return this.fire(new t.ErrorEvent(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));var o=e.onAdd(this);this._controls.push(e);var r=this._controlPositions[i];return -1!==i.indexOf("bottom")?r.insertBefore(o,r.firstChild):r.appendChild(o),this},r.prototype.removeControl=function(e){if(!e||!e.onRemove)return this.fire(new t.ErrorEvent(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));var i=this._controls.indexOf(e);return i>-1&&this._controls.splice(i,1),e.onRemove(this),this},r.prototype.resize=function(e){var i=this._containerDimensions(),o=i[0],r=i[1];this._resizeCanvas(o,r),this.transform.resize(o,r),this.painter.resize(o,r);var a=!this._moving;return a&&(this.stop(),this.fire(new t.Event("movestart",e)).fire(new t.Event("move",e))),this.fire(new t.Event("resize",e)),a&&this.fire(new t.Event("moveend",e)),this},r.prototype.getBounds=function(){return this.transform.getBounds()},r.prototype.getMaxBounds=function(){return this.transform.getMaxBounds()},r.prototype.setMaxBounds=function(e){return this.transform.setMaxBounds(t.LngLatBounds.convert(e)),this._update()},r.prototype.setMinZoom=function(t){if((t=null==t?-2:t)>=-2&&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")},r.prototype.getMaxZoom=function(){return this.transform.maxZoom},r.prototype.setMinPitch=function(t){if((t=null==t?0:t)<0)throw new Error("minPitch must be greater than or equal to 0");if(t>=0&&t<=this.transform.maxPitch)return this.transform.minPitch=t,this._update(),this.getPitch()60)throw new Error("maxPitch must be less than or equal to 60");if(t>=this.transform.minPitch)return this.transform.maxPitch=t,this._update(),this.getPitch()>t&&this.setPitch(t),this;throw new Error("maxPitch must be greater than the current minPitch")},r.prototype.getMaxPitch=function(){return this.transform.maxPitch},r.prototype.getRenderWorldCopies=function(){return this.transform.renderWorldCopies},r.prototype.setRenderWorldCopies=function(t){return this.transform.renderWorldCopies=t,this._update()},r.prototype.project=function(e){return this.transform.locationPoint(t.LngLat.convert(e))},r.prototype.unproject=function(e){return this.transform.pointLocation(t.Point.convert(e))},r.prototype.isMoving=function(){return this._moving||this.handlers.isMoving()},r.prototype.isZooming=function(){return this._zooming||this.handlers.isZooming()},r.prototype.isRotating=function(){return this._rotating||this.handlers.isRotating()},r.prototype._createDelegatedListener=function(t,e,i){var o,r=this;if("mouseenter"===t||"mouseover"===t){var a=!1;return {layer:e,listener:i,delegates:{mousemove:function(o){var n=r.getLayer(e)?r.queryRenderedFeatures(o.point,{layers:[e]}):[];n.length?a||(a=!0,i.call(r,new Bo(t,r,o.originalEvent,{features:n}))):a=!1;},mouseout:function(){a=!1;}}}}if("mouseleave"===t||"mouseout"===t){var n=!1;return {layer:e,listener:i,delegates:{mousemove:function(o){(r.getLayer(e)?r.queryRenderedFeatures(o.point,{layers:[e]}):[]).length?n=!0:n&&(n=!1,i.call(r,new Bo(t,r,o.originalEvent)));},mouseout:function(e){n&&(n=!1,i.call(r,new Bo(t,r,e.originalEvent)));}}}}return {layer:e,listener:i,delegates:(o={},o[t]=function(t){var o=r.getLayer(e)?r.queryRenderedFeatures(t.point,{layers:[e]}):[];o.length&&(t.features=o,i.call(r,t),delete t.features);},o)}},r.prototype.on=function(t,e,i){if(void 0===i)return o.prototype.on.call(this,t,e);var r=this._createDelegatedListener(t,e,i);for(var a in this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[t]=this._delegatedListeners[t]||[],this._delegatedListeners[t].push(r),r.delegates)this.on(a,r.delegates[a]);return this},r.prototype.once=function(t,e,i){if(void 0===i)return o.prototype.once.call(this,t,e);var r=this._createDelegatedListener(t,e,i);for(var a in r.delegates)this.once(a,r.delegates[a]);return this},r.prototype.off=function(t,e,i){var r=this;return void 0===i?o.prototype.off.call(this,t,e):(this._delegatedListeners&&this._delegatedListeners[t]&&function(o){for(var a=o[t],n=0;n1?1:t},toY:function(t){return "__height"*(.5-t)+"__centerY"}},0,{__width:n,__height:s,__centerX:r,__centerY:a,__originY:o,__originX:i});this.customConvertPoint=t.window.URL.createObjectURL(new Blob([l],{type:"text/javascript"}));},a.version.get=function(){return t.version},Object.defineProperties(r.prototype,a),r}(br);function Ar(t){t.parentNode&&t.parentNode.removeChild(t);}var kr={showCompass:!0,showZoom:!0,visualizePitch:!1},Or=function(e){var o=this;this.options=t.extend({},kr,e),this._container=i.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._container.addEventListener("contextmenu",(function(t){return t.preventDefault()})),this.options.showZoom&&(t.bindAll(["_setButtonTitle","_updateZoomButtons"],this),this._zoomInButton=this._createButton("mapboxgl-ctrl-zoom-in",(function(t){return o._map.zoomIn({},{originalEvent:t})})),i.create("span","mapboxgl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden",!0),this._zoomOutButton=this._createButton("mapboxgl-ctrl-zoom-out",(function(t){return o._map.zoomOut({},{originalEvent:t})})),i.create("span","mapboxgl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden",!0)),this.options.showCompass&&(t.bindAll(["_rotateCompassArrow"],this),this._compass=this._createButton("mapboxgl-ctrl-compass",(function(t){o.options.visualizePitch?o._map.resetNorthPitch({},{originalEvent:t}):o._map.resetNorth({},{originalEvent:t});})),this._compassIcon=i.create("span","mapboxgl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden",!0));};Or.prototype._updateZoomButtons=function(){var t=this._map.getZoom();this._zoomInButton.disabled=t===this._map.getMaxZoom(),this._zoomOutButton.disabled=t===this._map.getMinZoom();},Or.prototype._rotateCompassArrow=function(){var t=this.options.visualizePitch?"rotateX("+this._map.transform.pitch+"deg) rotateZ("+this._map.transform.angle*(180/Math.PI)+"deg)":"rotate("+this._map.transform.angle+"deg)";this._compassIcon.style.transform=t;},Or.prototype.onAdd=function(t){return this._map=t,this.options.showZoom&&(this._setButtonTitle(this._zoomInButton,"ZoomIn"),this._setButtonTitle(this._zoomOutButton,"ZoomOut"),this._map.on("zoom",this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this._setButtonTitle(this._compass,"ResetBearing"),this.options.visualizePitch&&this._map.on("pitch",this._rotateCompassArrow),this._map.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new Br(this._map,this._compass,this.options.visualizePitch)),this._container},Or.prototype.onRemove=function(){i.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),this._handler.off(),delete this._handler),delete this._map;},Or.prototype._createButton=function(t,e){var o=i.create("button",t,this._container);return o.type="button",o.addEventListener("click",e),o},Or.prototype._setButtonTitle=function(t,e){var i=this._map._getUIString("NavigationControl."+e);t.title=i,t.setAttribute("aria-label",i);};var Br=function(e,o,r){void 0===r&&(r=!1),this._clickTolerance=10,this.element=o,this.mouseRotate=new Yo({clickTolerance:e.dragRotate._mouseRotate._clickTolerance}),this.map=e,r&&(this.mousePitch=new Jo({clickTolerance:e.dragRotate._mousePitch._clickTolerance})),t.bindAll(["mousedown","mousemove","mouseup","touchstart","touchmove","touchend","reset"],this),i.addEventListener(o,"mousedown",this.mousedown),i.addEventListener(o,"touchstart",this.touchstart,{passive:!1}),i.addEventListener(o,"touchmove",this.touchmove),i.addEventListener(o,"touchend",this.touchend),i.addEventListener(o,"touchcancel",this.reset);};function Fr(e,i,o){if(e=new t.LngLat(e.lng,e.lat),i){var r=new t.LngLat(e.lng-360,e.lat),a=new t.LngLat(e.lng+360,e.lat),n=o.locationPoint(e).distSqr(i);o.locationPoint(r).distSqr(i)180;){var s=o.locationPoint(e);if(s.x>=0&&s.y>=0&&s.x<=o.width&&s.y<=o.height)break;e.lng>o.center.lng?e.lng-=360:e.lng+=360;}return e}Br.prototype.down=function(t,e){this.mouseRotate.mousedown(t,e),this.mousePitch&&this.mousePitch.mousedown(t,e),i.disableDrag();},Br.prototype.move=function(t,e){var i=this.map,o=this.mouseRotate.mousemoveWindow(t,e);if(o&&o.bearingDelta&&i.setBearing(i.getBearing()+o.bearingDelta),this.mousePitch){var r=this.mousePitch.mousemoveWindow(t,e);r&&r.pitchDelta&&i.setPitch(i.getPitch()+r.pitchDelta);}},Br.prototype.off=function(){var t=this.element;i.removeEventListener(t,"mousedown",this.mousedown),i.removeEventListener(t,"touchstart",this.touchstart,{passive:!1}),i.removeEventListener(t,"touchmove",this.touchmove),i.removeEventListener(t,"touchend",this.touchend),i.removeEventListener(t,"touchcancel",this.reset),this.offTemp();},Br.prototype.offTemp=function(){i.enableDrag(),i.removeEventListener(t.window,"mousemove",this.mousemove),i.removeEventListener(t.window,"mouseup",this.mouseup);},Br.prototype.mousedown=function(e){this.down(t.extend({},e,{ctrlKey:!0,preventDefault:function(){return e.preventDefault()}}),i.mousePos(this.element,e)),i.addEventListener(t.window,"mousemove",this.mousemove),i.addEventListener(t.window,"mouseup",this.mouseup);},Br.prototype.mousemove=function(t){this.move(t,i.mousePos(this.element,t));},Br.prototype.mouseup=function(t){this.mouseRotate.mouseupWindow(t),this.mousePitch&&this.mousePitch.mouseupWindow(t),this.offTemp();},Br.prototype.touchstart=function(t){1!==t.targetTouches.length?this.reset():(this._startPos=this._lastPos=i.touchPos(this.element,t.targetTouches)[0],this.down({type:"mousedown",button:0,ctrlKey:!0,preventDefault:function(){return t.preventDefault()}},this._startPos));},Br.prototype.touchmove=function(t){1!==t.targetTouches.length?this.reset():(this._lastPos=i.touchPos(this.element,t.targetTouches)[0],this.move({preventDefault:function(){return t.preventDefault()}},this._lastPos));},Br.prototype.touchend=function(t){0===t.targetTouches.length&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)-1&&this._map._markersCache.splice(t,1),delete this._map;}return i.remove(this._element),this._popup&&this._popup.remove(),this},o.prototype.getLngLat=function(){return this._lngLat},o.prototype.setLngLat=function(e){return this._lngLat=t.LngLat.convert(e),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this},o.prototype.getElement=function(){return this._element},o.prototype.setPopup=function(t){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),t){if(!("offset"in t.options)){var e=Math.sqrt(Math.pow(13.5,2)/2);t.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[e,-1*(24.6+e)],"bottom-right":[-e,-1*(24.6+e)],left:[13.5,-24.6],right:[-13.5,-24.6]}:this._offset;}this._popup=t,this._lngLat&&this._popup.setLngLat(this._lngLat),this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress);}return this},o.prototype._onKeyPress=function(t){var e=t.code,i=t.charCode||t.keyCode;"Space"!==e&&"Enter"!==e&&32!==i&&13!==i||this.togglePopup();},o.prototype._onMapClick=function(t){var e=t.originalEvent.target,i=this._element;this._popup&&(e===i||i.contains(e))&&this.togglePopup();},o.prototype.getPopup=function(){return this._popup},o.prototype.togglePopup=function(){var t=this._popup;return t?(t.isOpen()?t.remove():t.addTo(this._map),this):this},o.prototype._update=function(t){if(this._map){this._map.transform.renderWorldCopies&&(this._lngLat=Fr(this._lngLat,this._pos,this._map.transform)),this._pos=this._map.project(this._lngLat)._add(this._offset);var e="";"viewport"===this._rotationAlignment||"auto"===this._rotationAlignment?e="rotateZ("+this._rotation+"deg)":"map"===this._rotationAlignment&&(e="rotateZ("+(this._rotation-this._map.getBearing())+"deg)");var o="";"viewport"===this._pitchAlignment||"auto"===this._pitchAlignment?o="rotateX(0deg)":"map"===this._pitchAlignment&&(o="rotateX("+this._map.getPitch()+"deg)"),t&&"moveend"!==t.type||(this._pos=this._pos.round()),i.setTransform(this._element,Ur[this._anchor]+" translate("+this._pos.x+"px, "+this._pos.y+"px) "+o+" "+e);}},o.prototype.getOffset=function(){return this._offset},o.prototype.setOffset=function(e){return this._offset=t.Point.convert(e),this._update(),this},o.prototype._onMove=function(e){this._pos=e.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none","pending"===this._state&&(this._state="active",this.fire(new t.Event("dragstart"))),this.fire(new t.Event("drag"));},o.prototype._onUp=function(){this._element.style.pointerEvents="auto",this._positionDelta=null,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),"active"===this._state&&this.fire(new t.Event("dragend")),this._state="inactive";},o.prototype._addDragHandler=function(t){this._element.contains(t.originalEvent.target)&&(t.preventDefault(),this._positionDelta=t.point.sub(this._pos).add(this._offset),this._state="pending",this._map.on("mousemove",this._onMove),this._map.on("touchmove",this._onMove),this._map.once("mouseup",this._onUp),this._map.once("touchend",this._onUp));},o.prototype.setDraggable=function(t){return this._draggable=!!t,this._map&&(t?(this._map.on("mousedown",this._addDragHandler),this._map.on("touchstart",this._addDragHandler)):(this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler))),this},o.prototype.isDraggable=function(){return this._draggable},o.prototype.setRotation=function(t){return this._rotation=t||0,this._update(),this},o.prototype.getRotation=function(){return this._rotation},o.prototype.setRotationAlignment=function(t){return this._rotationAlignment=t||"auto",this._update(),this},o.prototype.getRotationAlignment=function(){return this._rotationAlignment},o.prototype.setPitchAlignment=function(t){return this._pitchAlignment=t&&"auto"!==t?t:this._rotationAlignment,this._update(),this},o.prototype.getPitchAlignment=function(){return this._pitchAlignment},o}(t.Evented),qr={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0},Gr=0,Vr=!1,Wr=function(e){function o(i){e.call(this),this.options=t.extend({},qr,i),t.bindAll(["_onSuccess","_onError","_onZoom","_finish","_setupUI","_updateCamera","_updateMarker"],this);}return e&&(o.__proto__=e),(o.prototype=Object.create(e&&e.prototype)).constructor=o,o.prototype.onAdd=function(e){var o;return this._map=e,this._container=i.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),o=this._setupUI,void 0!==jr?o(jr):void 0!==t.window.navigator.permissions?t.window.navigator.permissions.query({name:"geolocation"}).then((function(t){o(jr="denied"!==t.state);})):o(jr=!!t.window.navigator.geolocation),this._container},o.prototype.onRemove=function(){void 0!==this._geolocationWatchID&&(t.window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),i.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,Gr=0,Vr=!1;},o.prototype._isOutOfMapMaxBounds=function(t){var e=this._map.getMaxBounds(),i=t.coords;return e&&(i.longitudee.getEast()||i.latitudee.getNorth())},o.prototype._setErrorState=function(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting");}},o.prototype._onSuccess=function(e){if(this._map){if(this._isOutOfMapMaxBounds(e))return this._setErrorState(),this.fire(new t.Event("outofmaxbounds",e)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=e,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background");}this.options.showUserLocation&&"OFF"!==this._watchState&&this._updateMarker(e),this.options.trackUserLocation&&"ACTIVE_LOCK"!==this._watchState||this._updateCamera(e),this.options.showUserLocation&&this._dotElement.classList.remove("mapboxgl-user-location-dot-stale"),this.fire(new t.Event("geolocate",e)),this._finish();}},o.prototype._updateCamera=function(e){var i=new t.LngLat(e.coords.longitude,e.coords.latitude),o=e.coords.accuracy,r=this._map.getBearing(),a=t.extend({bearing:r},this.options.fitBoundsOptions);this._map.fitBounds(i.toBounds(o),a,{geolocateSource:!0});},o.prototype._updateMarker=function(e){if(e){var i=new t.LngLat(e.coords.longitude,e.coords.latitude);this._accuracyCircleMarker.setLngLat(i).addTo(this._map),this._userLocationDotMarker.setLngLat(i).addTo(this._map),this._accuracy=e.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius();}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove();},o.prototype._updateCircleRadius=function(){var t=this._map._container.clientHeight/2,e=this._map.unproject([0,t]),i=this._map.unproject([1,t]),o=e.distanceTo(i),r=Math.ceil(2*this._accuracy/o);this._circleElement.style.width=r+"px",this._circleElement.style.height=r+"px";},o.prototype._onZoom=function(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius();},o.prototype._onError=function(e){if(this._map){if(this.options.trackUserLocation)if(1===e.code){this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;var i=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=i,this._geolocateButton.setAttribute("aria-label",i),void 0!==this._geolocationWatchID&&this._clearWatch();}else {if(3===e.code&&Vr)return;this._setErrorState();}"OFF"!==this._watchState&&this.options.showUserLocation&&this._dotElement.classList.add("mapboxgl-user-location-dot-stale"),this.fire(new t.Event("error",e)),this._finish();}},o.prototype._finish=function(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0;},o.prototype._setupUI=function(e){var o=this;if(this._container.addEventListener("contextmenu",(function(t){return t.preventDefault()})),this._geolocateButton=i.create("button","mapboxgl-ctrl-geolocate",this._container),i.create("span","mapboxgl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden",!0),this._geolocateButton.type="button",!1===e){t.warnOnce("Geolocation support is not available so the GeolocateControl will be disabled.");var r=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=r,this._geolocateButton.setAttribute("aria-label",r);}else {var a=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.title=a,this._geolocateButton.setAttribute("aria-label",a);}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=i.create("div","mapboxgl-user-location-dot"),this._userLocationDotMarker=new Zr(this._dotElement),this._circleElement=i.create("div","mapboxgl-user-location-accuracy-circle"),this._accuracyCircleMarker=new Zr({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onZoom)),this._geolocateButton.addEventListener("click",this.trigger.bind(this)),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",(function(e){e.geolocateSource||"ACTIVE_LOCK"!==o._watchState||e.originalEvent&&"resize"===e.originalEvent.type||(o._watchState="BACKGROUND",o._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background"),o._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),o.fire(new t.Event("trackuserlocationend")));}));},o.prototype.trigger=function(){if(!this._setup)return t.warnOnce("Geolocate control triggered before added to a map"),!1;if(this.options.trackUserLocation){switch(this._watchState){case"OFF":this._watchState="WAITING_ACTIVE",this.fire(new t.Event("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":Gr--,Vr=!1,this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this.fire(new t.Event("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new t.Event("trackuserlocationstart"));}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"BACKGROUND":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background");break;case"BACKGROUND_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error");}if("OFF"===this._watchState&&void 0!==this._geolocationWatchID)this._clearWatch();else if(void 0===this._geolocationWatchID){var e;this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),++Gr>1?(e={maximumAge:6e5,timeout:0},Vr=!0):(e=this.options.positionOptions,Vr=!1),this._geolocationWatchID=t.window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,e);}}else t.window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return !0},o.prototype._clearWatch=function(){t.window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null);},o}(t.Evented),Xr={maxWidth:100,unit:"metric"},Hr=function(e){this.options=t.extend({},Xr,e),t.bindAll(["_onMove","setUnit"],this);};function Kr(t,e,i){var o=i&&i.maxWidth||100,r=t._container.clientHeight/2,a=t.unproject([0,r]),n=t.unproject([o,r]),s=a.distanceTo(n);if(i&&"imperial"===i.unit){var l=3.2808*s;l>5280?Yr(e,o,l/5280,t._getUIString("ScaleControl.Miles")):Yr(e,o,l,t._getUIString("ScaleControl.Feet"));}else i&&"nautical"===i.unit?Yr(e,o,s/1852,t._getUIString("ScaleControl.NauticalMiles")):s>=1e3?Yr(e,o,s/1e3,t._getUIString("ScaleControl.Kilometers")):Yr(e,o,s,t._getUIString("ScaleControl.Meters"));}function Yr(t,e,i,o){var r,a,n,s=(r=i,(a=Math.pow(10,(""+Math.floor(r)).length-1))*(n=(n=r/a)>=10?10:n>=5?5:n>=3?3:n>=2?2:n>=1?1:function(t){var e=Math.pow(10,Math.ceil(-Math.log(t)/Math.LN10));return Math.round(t*e)/e}(n)));t.style.width=e*(s/i)+"px",t.innerHTML=s+" "+o;}Hr.prototype.getDefaultPosition=function(){return "bottom-left"},Hr.prototype._onMove=function(){Kr(this._map,this._container,this.options);},Hr.prototype.onAdd=function(t){return this._map=t,this._container=i.create("div","mapboxgl-ctrl mapboxgl-ctrl-scale",t.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container},Hr.prototype.onRemove=function(){i.remove(this._container),this._map.off("move",this._onMove),this._map=void 0;},Hr.prototype.setUnit=function(t){this.options.unit=t,Kr(this._map,this._container,this.options);};var Jr=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");};Jr.prototype.onAdd=function(e){return this._map=e,this._container||(this._container=this._map.getContainer()),this._controlContainer=i.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkFullscreenSupport()?this._setupUI():(this._controlContainer.style.display="none",t.warnOnce("This device does not support fullscreen mode.")),this._controlContainer},Jr.prototype.onRemove=function(){i.remove(this._controlContainer),this._map=null,t.window.document.removeEventListener(this._fullscreenchange,this._changeIcon);},Jr.prototype._checkFullscreenSupport=function(){return !!(t.window.document.fullscreenEnabled||t.window.document.mozFullScreenEnabled||t.window.document.msFullscreenEnabled||t.window.document.webkitFullscreenEnabled)},Jr.prototype._setupUI=function(){var e=this._fullscreenButton=i.create("button","mapboxgl-ctrl-fullscreen",this._controlContainer);i.create("span","mapboxgl-ctrl-icon",e).setAttribute("aria-hidden",!0),e.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),t.window.document.addEventListener(this._fullscreenchange,this._changeIcon);},Jr.prototype._updateTitle=function(){var t=this._getTitle();this._fullscreenButton.setAttribute("aria-label",t),this._fullscreenButton.title=t;},Jr.prototype._getTitle=function(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")},Jr.prototype._isFullscreen=function(){return this._fullscreen},Jr.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("mapboxgl-ctrl-shrink"),this._fullscreenButton.classList.toggle("mapboxgl-ctrl-fullscreen"),this._updateTitle());},Jr.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 Qr={closeButton:!0,closeOnClick:!0,className:"",maxWidth:"240px",showArrow:!0,contentClass:null},$r=function(e){function o(i){e.call(this),this.options=t.extend(Object.create(Qr),i),t.bindAll(["_update","_onClose","remove","_onMouseMove","_onMouseUp","_onDrag"],this);}return e&&(o.__proto__=e),(o.prototype=Object.create(e&&e.prototype)).constructor=o,o.prototype.addTo=function(e){return this._map&&this.remove(),this._map=e,this.options.closeOnClick&&this._map.on("click",this._onClose),this.options.closeOnMove&&this._map.on("move",this._onClose),this._map.on("remove",this.remove),this._update(),this._trackPointer?(this._map.on("mousemove",this._onMouseMove),this._map.on("mouseup",this._onMouseUp),this._container&&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},o.prototype.isOpen=function(){return !!this._map},o.prototype.remove=function(){return this._content&&i.remove(this._content),this._container&&(i.remove(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("move",this._onClose),this._map.off("click",this._onClose),this._map.off("remove",this.remove),this._map.off("mousemove",this._onMouseMove),this._map.off("mouseup",this._onMouseUp),this._map.off("drag",this._onDrag),delete this._map),this.fire(new t.Event("close")),this},o.prototype.getLngLat=function(){return this._lngLat},o.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._onMouseMove),this._container&&this._container.classList.remove("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.remove("mapboxgl-track-pointer")),this},o.prototype.trackPointer=function(){return this._trackPointer=!0,this._pos=null,this._update(),this._map&&(this._map.off("move",this._update),this._map.on("mousemove",this._onMouseMove),this._map.on("drag",this._onDrag),this._container&&this._container.classList.add("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("mapboxgl-track-pointer")),this},o.prototype.getElement=function(){return this._container},o.prototype.setText=function(e){return this.setDOMContent(t.window.document.createTextNode(e))},o.prototype.setHTML=function(e){var i,o=t.window.document.createDocumentFragment(),r=t.window.document.createElement("body");for(r.innerHTML=e;i=r.firstChild;)o.appendChild(i);return this.setDOMContent(o)},o.prototype.getMaxWidth=function(){return this._container&&this._container.style.maxWidth},o.prototype.setMaxWidth=function(t){return this.options.maxWidth=t,this._update(),this},o.prototype.setDOMContent=function(t){return this._createContent(),this._content.appendChild(t),this._update(),this},o.prototype.addClassName=function(t){this._container&&this._container.classList.add(t);},o.prototype.removeClassName=function(t){this._container&&this._container.classList.remove(t);},o.prototype.toggleClassName=function(t){if(this._container)return this._container.classList.toggle(t)},o.prototype._createContent=function(){this._content&&i.remove(this._content),this._content=i.create("div","mapboxgl-popup-content"+(this.options.contentClass?" "+this.options.contentClass:""),this._container),this.options.closeButton&&(this._closeButton=i.create("button","mapboxgl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.setAttribute("aria-label","Close popup"),this._closeButton.innerHTML="×",this._closeButton.addEventListener("click",this._onClose));},o.prototype._onMouseUp=function(t){this._update(t.point);},o.prototype._onMouseMove=function(t){this._update(t.point);},o.prototype._onDrag=function(t){this._update(t.point);},o.prototype._update=function(e){var o=this;if(this._map&&(this._lngLat||this._trackPointer)&&this._content&&(this._container||(this._container=i.create("div","mapboxgl-popup",this._map.getContainer()),this._tip=i.create("div","mapboxgl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className&&this.options.className.split(" ").forEach((function(t){return o._container.classList.add(t)})),this._trackPointer&&this._container.classList.add("mapboxgl-popup-track-pointer")),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=Fr(this._lngLat,this._pos,this._map.transform)),!this._trackPointer||e)){var r=this._pos=this._trackPointer&&e?e:this._map.project(this._lngLat),a=this.options.anchor,n=function e(i){if(i){if("number"==typeof i){var o=Math.round(Math.sqrt(.5*Math.pow(i,2)));return {center:new t.Point(0,0),top:new t.Point(0,i),"top-left":new t.Point(o,o),"top-right":new t.Point(-o,o),bottom:new t.Point(0,-i),"bottom-left":new t.Point(o,-o),"bottom-right":new t.Point(-o,-o),left:new t.Point(i,0),right:new t.Point(-i,0)}}if(i instanceof t.Point||Array.isArray(i)){var r=t.Point.convert(i);return {center:r,top:r,"top-left":r,"top-right":r,bottom:r,"bottom-left":r,"bottom-right":r,left:r,right:r}}return {center:t.Point.convert(i.center||[0,0]),top:t.Point.convert(i.top||[0,0]),"top-left":t.Point.convert(i["top-left"]||[0,0]),"top-right":t.Point.convert(i["top-right"]||[0,0]),bottom:t.Point.convert(i.bottom||[0,0]),"bottom-left":t.Point.convert(i["bottom-left"]||[0,0]),"bottom-right":t.Point.convert(i["bottom-right"]||[0,0]),left:t.Point.convert(i.left||[0,0]),right:t.Point.convert(i.right||[0,0])}}return e(new t.Point(0,0))}(this.options.offset);if(!a){var s,l=this._container.offsetWidth,c=this._container.offsetHeight;s=r.y+n.bottom.ythis._map.transform.height-c?["bottom"]:[],r.xthis._map.transform.width-l/2&&s.push("right"),a=0===s.length?"bottom":s.join("-");}var h=r.add(n[a]).round();i.setTransform(this._container,Ur[a]+" translate("+h.x+"px,"+h.y+"px)"),Nr(this._container,a,"popup");}},o.prototype._onClose=function(){this.remove();},o}(t.Evented),ta={proj4:t.proj4,version:t.version,supported:e,setRTLTextPlugin:t.setRTLTextPlugin,getRTLTextPluginStatus:t.getRTLTextPluginStatus,Map:Rr,NavigationControl:Or,GeolocateControl:Wr,AttributionControl:wr,ScaleControl:Hr,FullscreenControl:Jr,Popup:$r,Marker:Zr,Style:We,CRS:Pr,LngLat:t.LngLat,LngLatBounds:t.LngLatBounds,Point:t.Point,MercatorCoordinate:t.MercatorCoordinate,Evented:t.Evented,config:t.config,prewarm:function(){jt().acquire(Bt);},clearPrewarmedResources:function(){var t=Ut;t&&(t.isPreloaded()&&1===t.numActive()?(t.release(Bt),Ut=null):console.warn("Could not clear WebWorkers since there are active Map instances that still reference it. The pre-warmed WebWorker pool can only be cleared when all map instances have been removed with map.remove()"));},get accessToken(){return t.config.ACCESS_TOKEN},set accessToken(e){t.config.ACCESS_TOKEN=e;},get baseApiUrl(){return t.config.API_URL},set baseApiUrl(e){t.config.API_URL=e;},get workerCount(){return Ft.workerCount},set workerCount(t){Ft.workerCount=t;},get maxParallelImageRequests(){return t.config.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(e){t.config.MAX_PARALLEL_IMAGE_REQUESTS=e;},clearStorage:function(e){t.clearTileCache(e);},workerUrl:""};return ta})); + + // + + if (window) { + window.mapboxgl =mapboxgl; + } + + return mapboxgl; + + }))); + //# sourceMappingURL=mapbox-gl-enhance.js.map \ No newline at end of file