osmgl 0.1.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -5
- package/dist/osmgl.cjs +76 -64
- package/dist/osmgl.cjs.map +1 -1
- package/dist/osmgl.d.cts +138 -3
- package/dist/osmgl.d.ts +138 -3
- package/dist/osmgl.global.js +77 -64
- package/dist/osmgl.js +76 -64
- package/dist/osmgl.js.map +1 -1
- package/package.json +3 -3
package/dist/osmgl.cjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
'use strict';Object.defineProperty(exports,'__esModule',{value:true});var Un=require('earcut'),bl=require('pbf');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var Un__default=/*#__PURE__*/_interopDefault(Un);var bl__default=/*#__PURE__*/_interopDefault(bl);var H=Map,Q=Set;var Ve=class{constructor(){this.listeners=new H;}on(e,t){let o=this.listeners.get(e);return o||this.listeners.set(e,o=new Q),o.add(t),this}once(e,t){let o=r=>{this.off(e,o),t(r);};return this.on(e,o)}off(e,t){return this.listeners.get(e)?.delete(t),this}emit(e,t){let o=this.listeners.get(e);if(!o)return this;for(let r of [...o])try{r(t);}catch(n){console.error(`[osmgl] \u043E\u0431\u0440\u0430\u0431\u043E\u0442\u0447\u0438\u043A "${e}" \u0431\u0440\u043E\u0441\u0438\u043B \u0438\u0441\u043A\u043B\u044E\u0447\u0435\u043D\u0438\u0435:`,n);}return this}removeAllListeners(){this.listeners.clear();}};var we=(i,e,t)=>i<e?e:i>t?t:i;var Ye=i=>i*Math.PI/180,bn=i=>i*180/Math.PI;function et(i){let e=((i+180)%360+360)%360-180;return e===-180?180:e}var oo=i=>1-Math.pow(1-i,3);function le(i){let e=i.trim();if(e[0]==="#"){let o=e.slice(1);if(o.length===3||o.length===4){let r=o.split("").map(n=>parseInt(n+n,16)/255);return [r[0],r[1],r[2],r.length===4?r[3]:1]}if(o.length===6||o.length===8){let r=[];for(let n=0;n<o.length;n+=2)r.push(parseInt(o.slice(n,n+2),16)/255);return [r[0],r[1],r[2],r.length===4?r[3]:1]}}let t=e.match(/^rgba?\(([^)]+)\)$/i);if(t){let o=t[1].split(",").map(r=>parseFloat(r));if(o.length>=3)return [o[0]/255,o[1]/255,o[2]/255,o.length>3?o[3]:1]}return [1,0,1,1]}function _e(i){return [i[0]*i[3],i[1]*i[3],i[2]*i[3],i[3]]}var ro=class{constructor(e){this._program=null;this._vao=null;this._framebuffer=null;this._depthTest=false;this._depthMask=true;this._colorMask=true;this._depthFunc="lequal";this._blend="none";this._cull="none";this._viewport=[0,0,0,0];this._activeTexture=-1;this._boundTextures=new H;this._stencilTest=false;this.gl=e,this.caps=el(e),e.enable(e.DEPTH_TEST),this._depthTest=true,e.depthFunc(e.LEQUAL),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,false);}useProgram(e){return this._program===e?false:(this.gl.useProgram(e),this._program=e,true)}bindVAO(e){this._vao!==e&&(this.gl.bindVertexArray(e),this._vao=e);}bindFramebuffer(e){this._framebuffer!==e&&(this.gl.bindFramebuffer(this.gl.FRAMEBUFFER,e),this._framebuffer=e);}bindTexture(e,t,o=this.gl.TEXTURE_2D){this._activeTexture!==e&&(this.gl.activeTexture(this.gl.TEXTURE0+e),this._activeTexture=e),this._boundTextures.get(e)!==t&&(this.gl.bindTexture(o,t),this._boundTextures.set(e,t));}viewport(e,t,o,r){let n=this._viewport;n[0]===e&&n[1]===t&&n[2]===o&&n[3]===r||(this.gl.viewport(e,t,o,r),this._viewport=[e,t,o,r]);}setDepthTest(e){this._depthTest!==e&&(e?this.gl.enable(this.gl.DEPTH_TEST):this.gl.disable(this.gl.DEPTH_TEST),this._depthTest=e);}setDepthMask(e){this._depthMask!==e&&(this.gl.depthMask(e),this._depthMask=e);}setColorMask(e){this._colorMask!==e&&(this.gl.colorMask(e,e,e,e),this._colorMask=e);}setDepthFunc(e){if(this._depthFunc===e)return;let t=this.gl;this.gl.depthFunc(e==="less"?t.LESS:e==="always"?t.ALWAYS:e==="greater"?t.GREATER:t.LEQUAL),this._depthFunc=e;}setBlend(e){if(this._blend===e)return;let t=this.gl;e==="none"?t.disable(t.BLEND):(this._blend==="none"&&t.enable(t.BLEND),e==="alpha"?t.blendFuncSeparate(t.SRC_ALPHA,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA):e==="premultiplied"?t.blendFunc(t.ONE,t.ONE_MINUS_SRC_ALPHA):e==="multiply"?t.blendFunc(t.DST_COLOR,t.ZERO):t.blendFunc(t.ONE,t.ONE)),this._blend=e;}setCull(e){if(this._cull===e)return;let t=this.gl;e==="none"?t.disable(t.CULL_FACE):(this._cull==="none"&&t.enable(t.CULL_FACE),t.cullFace(e==="back"?t.BACK:t.FRONT)),this._cull=e;}setStencilTest(e){this._stencilTest!==e&&(e?this.gl.enable(this.gl.STENCIL_TEST):this.gl.disable(this.gl.STENCIL_TEST),this._stencilTest=e);}clear(e,t=true,o=false){let r=this.gl,n=0;e&&(r.clearColor(e[0],e[1],e[2],e[3]),n|=r.COLOR_BUFFER_BIT),t&&(this.setDepthMask(true),r.clearDepth(1),n|=r.DEPTH_BUFFER_BIT),o&&(r.clearStencil(0),n|=r.STENCIL_BUFFER_BIT),n&&r.clear(n);}invalidateState(){this._program=null,this._vao=null,this._framebuffer=null,this._activeTexture=-1,this._boundTextures.clear(),this._viewport=[-1,-1,-1,-1];}};function el(i){let e=i.getExtension("EXT_texture_filter_anisotropic")??i.getExtension("WEBKIT_EXT_texture_filter_anisotropic"),t=i.getExtension("WEBGL_debug_renderer_info");return {maxTextureSize:i.getParameter(i.MAX_TEXTURE_SIZE),maxVertexAttribs:i.getParameter(i.MAX_VERTEX_ATTRIBS),colorBufferFloat:!!i.getExtension("EXT_color_buffer_float"),anisotropic:e,maxAnisotropy:e?i.getParameter(e.MAX_TEXTURE_MAX_ANISOTROPY_EXT):1,timerQuery:!!i.getExtension("EXT_disjoint_timer_query_webgl2"),rendererName:t?String(i.getParameter(t.UNMASKED_RENDERER_WEBGL)):"unknown"}}var Ke=512,no=40075016686e-3,yn=85.051129;function q(i){return Array.isArray(i)?{lng:i[0],lat:i[1]}:i}var Be=i=>512*Math.pow(2,i),io=i=>Math.max(-yn,Math.min(yn,i));function ee(i){return (180+i)/360}function te(i){let e=io(i);return (180-180/Math.PI*Math.log(Math.tan(Math.PI/4+e*Math.PI/360)))/360}function Se(i){return i*360-180}function Ce(i){let e=180-i*360;return 360/Math.PI*Math.atan(Math.exp(e*Math.PI/180))-90}function Le(i){return no*Math.cos(i*Math.PI/180)}function Go(i,e){return i/Le(e)}function tu(i,e){return i*Le(e)}function ou(i,e){return Go(1,i)*Be(e)}function ru(i,e){return Le(i)/Be(e)}function gn(i,e){let t=Math.pow(2,i);return Le(Ce((e+.5)/t))/t}function No(i){return no/Math.pow(2,i)}function vn(i,e,t){let o=No(i),r=65536;return [(e*o%r+r)%r,(t*o%r+r)%r]}var _t=class i{constructor(e,t){this.west=1/0;this.south=1/0;this.east=-1/0;this.north=-1/0;e&&this.extend(e),t&&this.extend(t);}static from(e){let t=new i;for(let o of e)t.extend(o);return t}extend(e){if(e instanceof i)return e.isEmpty()?this:(this.west=Math.min(this.west,e.west),this.south=Math.min(this.south,e.south),this.east=Math.max(this.east,e.east),this.north=Math.max(this.north,e.north),this);let t=q(e);return this.west=Math.min(this.west,t.lng),this.south=Math.min(this.south,t.lat),this.east=Math.max(this.east,t.lng),this.north=Math.max(this.north,t.lat),this}isEmpty(){return !(this.west<=this.east&&this.south<=this.north)}getCenter(){return {lng:(this.west+this.east)/2,lat:(this.south+this.north)/2}}getSouthWest(){return {lng:this.west,lat:this.south}}getNorthEast(){return {lng:this.east,lat:this.north}}contains(e){let t=q(e);return t.lng>=this.west&&t.lng<=this.east&&t.lat>=this.south&&t.lat<=this.north}pad(e){if(this.isEmpty())return this;let t=(this.east-this.west)*e,o=(this.north-this.south)*e;return this.west-=t,this.east+=t,this.south-=o,this.north+=o,this}toMercator(){return {minX:ee(this.west),maxX:ee(this.east),minY:te(this.north),maxY:te(this.south)}}};function Uo(i,e){if(i.isEmpty())return null;let t={top:e.padding?.top??0,right:e.padding?.right??0,bottom:e.padding?.bottom??0,left:e.padding?.left??0},o=Math.max(e.width-t.left-t.right,wn),r=Math.max(e.height-t.top-t.bottom,wn),n=i.toMercator(),a=e.bearing??0,l=-a*Math.PI/180,s=Math.cos(l),c=Math.sin(l),f=(n.minX+n.maxX)/2,h=(n.minY+n.maxY)/2,u=0,d=0;for(let[v,w]of [[n.minX,n.minY],[n.maxX,n.minY],[n.maxX,n.maxY],[n.minX,n.maxY]]){let S=(v-f)*s-(w-h)*c,_=(v-f)*c+(w-h)*s;u=Math.max(u,Math.abs(S)*2),d=Math.max(d,Math.abs(_)*2);}let m=Math.min(o/Math.max(u,1e-12),r/Math.max(d,1e-12)),y=Math.min(Math.max(Math.log2(m/512),e.minZoom??0),e.maxZoom??22),p=Be(y),b=(t.left-t.right)/2/p,g=(t.top-t.bottom)/2/p;return {center:{lng:Se(f-(b*s+g*c)),lat:Ce(h-(-b*c+g*s))},zoom:y,bearing:a}}var wn=32;function G(){let i=new Float64Array(16);return i[0]=i[5]=i[10]=i[15]=1,i}function Re(i){return i.fill(0),i[0]=i[5]=i[10]=i[15]=1,i}function xe(i,e,t){let o=e[0],r=e[1],n=e[2],a=e[3],l=e[4],s=e[5],c=e[6],f=e[7],h=e[8],u=e[9],d=e[10],m=e[11],y=e[12],p=e[13],b=e[14],g=e[15];for(let v=0;v<4;v++){let w=t[v*4],S=t[v*4+1],_=t[v*4+2],M=t[v*4+3];i[v*4]=w*o+S*l+_*h+M*y,i[v*4+1]=w*r+S*s+_*u+M*p,i[v*4+2]=w*n+S*c+_*d+M*b,i[v*4+3]=w*a+S*f+_*m+M*g;}return i}function Ee(i,e,t,o,r){return i!==e&&i.set(e),i[12]=e[0]*t+e[4]*o+e[8]*r+e[12],i[13]=e[1]*t+e[5]*o+e[9]*r+e[13],i[14]=e[2]*t+e[6]*o+e[10]*r+e[14],i[15]=e[3]*t+e[7]*o+e[11]*r+e[15],i}function Ie(i,e,t,o,r){for(let n=0;n<4;n++)i[n]=e[n]*t,i[4+n]=e[4+n]*o,i[8+n]=e[8+n]*r,i[12+n]=e[12+n];return i}function Xo(i,e,t){let o=Math.sin(t),r=Math.cos(t),n=e[4],a=e[5],l=e[6],s=e[7],c=e[8],f=e[9],h=e[10],u=e[11];return i!==e&&(i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[3],i[12]=e[12],i[13]=e[13],i[14]=e[14],i[15]=e[15]),i[4]=n*r+c*o,i[5]=a*r+f*o,i[6]=l*r+h*o,i[7]=s*r+u*o,i[8]=c*r-n*o,i[9]=f*r-a*o,i[10]=h*r-l*o,i[11]=u*r-s*o,i}function Yo(i,e,t){let o=Math.sin(t),r=Math.cos(t),n=e[0],a=e[1],l=e[2],s=e[3],c=e[4],f=e[5],h=e[6],u=e[7];return i!==e&&(i[8]=e[8],i[9]=e[9],i[10]=e[10],i[11]=e[11],i[12]=e[12],i[13]=e[13],i[14]=e[14],i[15]=e[15]),i[0]=n*r+c*o,i[1]=a*r+f*o,i[2]=l*r+h*o,i[3]=s*r+u*o,i[4]=c*r-n*o,i[5]=f*r-a*o,i[6]=h*r-l*o,i[7]=u*r-s*o,i}function _n(i,e,t,o,r){let n=1/Math.tan(e/2);return i.fill(0),i[0]=n/t,i[5]=n,i[11]=-1,i[10]=(r+o)/(o-r),i[14]=2*r*o/(o-r),i}function Cn(i,e,t,o,r,n,a){let l=1/(e-t),s=1/(o-r),c=1/(n-a);return i.fill(0),i[0]=-2*l,i[5]=-2*s,i[10]=2*c,i[12]=(e+t)*l,i[13]=(r+o)*s,i[14]=(a+n)*c,i[15]=1,i}function Fe(i,e){let t=e[0],o=e[1],r=e[2],n=e[3],a=e[4],l=e[5],s=e[6],c=e[7],f=e[8],h=e[9],u=e[10],d=e[11],m=e[12],y=e[13],p=e[14],b=e[15],g=t*l-o*a,v=t*s-r*a,w=t*c-n*a,S=o*s-r*l,_=o*c-n*l,M=r*c-n*s,x=f*y-h*m,C=f*p-u*m,T=f*b-d*m,E=h*p-u*y,k=h*b-d*y,F=u*b-d*p,L=g*F-v*k+w*E+S*T-_*C+M*x;return L?(L=1/L,i[0]=(l*F-s*k+c*E)*L,i[1]=(r*k-o*F-n*E)*L,i[2]=(y*M-p*_+b*S)*L,i[3]=(u*_-h*M-d*S)*L,i[4]=(s*T-a*F-c*C)*L,i[5]=(t*F-r*T+n*C)*L,i[6]=(p*w-m*M-b*v)*L,i[7]=(f*M-u*w+d*v)*L,i[8]=(a*k-l*T+c*x)*L,i[9]=(o*T-t*k-n*x)*L,i[10]=(m*_-y*w+b*g)*L,i[11]=(h*w-f*_-d*g)*L,i[12]=(l*C-a*E-s*x)*L,i[13]=(t*E-o*C+r*x)*L,i[14]=(y*v-m*S-p*g)*L,i[15]=(f*S-h*v+u*g)*L,i):null}function ie(i,e,t){let[o,r,n,a]=t;return i[0]=e[0]*o+e[4]*r+e[8]*n+e[12]*a,i[1]=e[1]*o+e[5]*r+e[9]*n+e[13]*a,i[2]=e[2]*o+e[6]*r+e[10]*n+e[14]*a,i[3]=e[3]*o+e[7]*r+e[11]*n+e[15]*a,i}function He(i,e){for(let t=0;t<16;t++)i[t]=e[t];return i}function ao(i){let e=Math.hypot(i[0],i[1],i[2])||1;return [i[0]/e,i[1]/e,i[2]/e]}function xn(i,e){return [i[1]*e[2]-i[2]*e[1],i[2]*e[0]-i[0]*e[2],i[0]*e[1]-i[1]*e[0]]}function tl(i,e){return [i[0]-e[0],i[1]-e[1],i[2]-e[2]]}function jo(i,e){return i[0]*e[0]+i[1]*e[1]+i[2]*e[2]}function Sn(i,e,t,o){let r=ao(tl(t,e)),n=ao(xn(r,o)),a=xn(n,r);return i[0]=n[0],i[1]=a[0],i[2]=-r[0],i[3]=0,i[4]=n[1],i[5]=a[1],i[6]=-r[1],i[7]=0,i[8]=n[2],i[9]=a[2],i[10]=-r[2],i[11]=0,i[12]=-jo(n,e),i[13]=-jo(a,e),i[14]=jo(r,e),i[15]=1,i}var Ct=60,lo=4.5,$e=6,so=i=>i/(2*Math.PI);function co(i){if(i<=lo)return 0;if(i>=$e)return 1;let e=(i-lo)/($e-lo);return e*e*(3-2*e)}function fo(i,e){let t=i*Math.PI/180,o=io(e)*Math.PI/180,r=Math.cos(o);return [r*Math.sin(t),-Math.sin(o),r*Math.cos(t)]}function Ko(i){let e=Math.hypot(i[0],i[1],i[2])||1,t=i[0]/e,o=i[1]/e,r=i[2]/e;return {lng:Math.atan2(t,r)*180/Math.PI,lat:Math.asin(-o)*180/Math.PI}}function ol(i,e){return fo(Se(i),Ce(e))}function $o(i,e){let t=i*Math.PI/180,o=io(e)*Math.PI/180,r=Math.cos(o),n=Math.sin(o);return {east:[Math.cos(t),0,-Math.sin(t)],south:[n*Math.sin(t),r,n*Math.cos(t)],up:[r*Math.sin(t),-n,r*Math.cos(t)]}}function Mn(i,e,t){let o=i[0]*e,r=i[1]*e,n=i[2]*e;return [o*t.east[0]+r*t.east[1]+n*t.east[2],o*t.south[0]+r*t.south[1]+n*t.south[2],o*t.up[0]+r*t.up[1]+n*t.up[2]-e]}function rl(i,e,t,o,r){let n=i-t;return n>.5&&(n-=1),n<-0.5&&(n+=1),[n*r,(e-o)*r,0]}function Tn(i,e,t,o,r,n,a,l){let s=Mn(ol(i,e),r,a);if(l<=0)return s;let c=rl(i,e,t,o,n);return [s[0]+(c[0]-s[0])*l,s[1]+(c[1]-s[1])*l,s[2]+(c[2]-s[2])*l]}function qo(i,e,t){let o=i[0]*e[0]+i[1]*e[1]+i[2]*e[2],r=i[0]**2+i[1]**2+i[2]**2-t*t,n=o*o-r;if(n<0)return null;let a=-o-Math.sqrt(n);return a<0?null:[i[0]+e[0]*a,i[1]+e[1]*a,i[2]+e[2]*a]}var An=1e3,nl=2,kn=84,il=.42,St=class i{constructor(){this.width=0;this.height=0;this.minZoom=0;this.maxZoom=22;this.minPitch=0;this.maxPitch=75;this._center={lng:0,lat:0};this._zoom=0;this._bearing=0;this._pitch=0;this._fov=Ye(36.87);this._worldSize=512;this._pixelsPerMeter=1;this._cameraToCenterDistance=0;this._centerX=0;this._centerY=0;this._projMatrix=G();this._viewProjPx=G();this._viewMatrix=G();this._pixelMatrix=G();this._pixelMatrixInverse=G();this._cameraPosPx=[0,0,0];this._frustumPlanes=[];this._dirty=true;this.projection="mercator";this._f32=new Float32Array(16);this._tileMatrix=G();this._localView=G();this._localProj=G();this._localPixel=G();this._localPixelInverse=G();this._localF32=new Float32Array(16);this._globeBasis={east:[1,0,0],south:[0,1,0],up:[0,0,1]};this._objectF32=new Float32Array(16);this._objectMatrix=G();this._shadowView=G();this._shadowProj=G();this._shadowVP=G();this._shadowVPm=G();this._shadowTile=G();this._shadowObject=G();this._shadowTile32=new Float32Array(16);this._shadowObject32=new Float32Array(16);this._shadowValid=false;this._calc();}get center(){return {...this._center}}set center(e){this._center={lng:e.lng,lat:e.lat},this._dirty=true;}globeMinZoom(){let e=Math.max(Math.min(this.width,this.height),1),t=il*e*2*Math.PI/512;return Math.log2(Math.max(t,1e-6))}effectiveMinZoom(){return this.projection==="globe"?Math.max(this.minZoom,this.globeMinZoom()):this.minZoom}get zoom(){return this._zoom}set zoom(e){let t=we(e,this.effectiveMinZoom(),this.maxZoom);t!==this._zoom&&(this._zoom=t,this._dirty=true);}get bearing(){return this._bearing}set bearing(e){let t=et(e);t!==this._bearing&&(this._bearing=t,this._dirty=true);}get pitch(){return this._pitch}set pitch(e){let t=this.projection==="globe"&&this._zoom<$e?Math.min(this.maxPitch,Ct):this.maxPitch,o=we(e,this.minPitch,t);o!==this._pitch&&(this._pitch=o,this._dirty=true);}get fov(){return bn(this._fov)}set fov(e){let t=Ye(we(e,1,89));t!==this._fov&&(this._fov=t,this._dirty=true);}resize(e,t){this.width===e&&this.height===t||(this.width=e,this.height=t,this._dirty=true);}get worldSize(){return this._ensure(),this._worldSize}get pixelsPerMeter(){return this._ensure(),this._pixelsPerMeter}get cameraToCenterDistance(){return this._ensure(),this._cameraToCenterDistance}get cameraPositionPx(){return this._ensure(),this._cameraPosPx}get projMatrix(){return this._ensure(),this._projMatrix}get viewMatrix(){return this._ensure(),this._viewMatrix}get centerPointPx(){return this._ensure(),{x:this._centerX,y:this._centerY}}clone(){let e=new i;return e.width=this.width,e.height=this.height,e.minZoom=this.minZoom,e.maxZoom=this.maxZoom,e.minPitch=this.minPitch,e.maxPitch=this.maxPitch,e._center={...this._center},e._zoom=this._zoom,e._bearing=this._bearing,e._pitch=this._pitch,e._fov=this._fov,e._dirty=true,e}project(e,t=0){this._ensure();let o=[ee(e.lng)*this._worldSize,te(e.lat)*this._worldSize,t,1],r=[0,0,0,0];ie(r,this._pixelMatrix,o);let n=r[3]||1e-9;return {x:r[0]/n,y:r[1]/n}}worldPxToPoint(e,t,o=0){if(this._ensure(),this.globeActive){let n=this.globeLocal(e/this._worldSize,t/this._worldSize),a={lng:Se(e/this._worldSize),lat:Ce(t/this._worldSize)};return this.isOnGlobeFront(a.lng,a.lat,0)?(n[2]+=o*this._pixelsPerMeter,this.localToPoint(n)):null}let r=[0,0,0,0];return ie(r,this._pixelMatrix,[e,t,o,1]),r[3]<=1e-6?null:{x:r[0]/r[3],y:r[1]/r[3]}}unproject(e){if(this.globeActive){let o=this.globeUnproject(e);if(o)return o}let t=this.pointToWorldPx(e);return {lng:Se(t.x/this._worldSize),lat:Ce(t.y/this._worldSize)}}pointToWorldPx(e){this._ensure();let t=[0,0,0,0],o=[0,0,0,0];ie(t,this._pixelMatrixInverse,[e.x,e.y,0,1]),ie(o,this._pixelMatrixInverse,[e.x,e.y,1,1]);let r=t[3]||1e-9,n=o[3]||1e-9,a={x:t[0]/r,y:t[1]/r,z:t[2]/r},l={x:o[0]/n,y:o[1]/n,z:o[2]/n},s=l.z-a.z,c=Math.abs(s)<1e-9?1:(0-a.z)/s,f=we(c,-1e6,1e6);return {x:a.x+(l.x-a.x)*f,y:a.y+(l.y-a.y)*f}}setLocationAtPoint(e,t){if(this._ensure(),this.globeActive){let l=this.globeUnproject(t);if(!l)return;let s=et(this._center.lng+(e.lng-l.lng)),c=we(this._center.lat+(e.lat-l.lat),-kn,kn);this._center={lng:s,lat:c},this._dirty=true;return}let o=this.pointToWorldPx(t),r={x:ee(e.lng)*this._worldSize,y:te(e.lat)*this._worldSize},n=r.x-o.x,a=r.y-o.y;this._center={lng:Se((this._centerX+n)/this._worldSize),lat:Ce((this._centerY+a)/this._worldSize)},this._dirty=true;}tileMatrix(e,t){this._ensure();let o=e.bounds(),r=(o.maxX-o.minX)*this._worldSize/t,n=this._tileMatrix;return Ee(n,this._projMatrix,o.minX*this._worldSize,o.minY*this._worldSize,0),Ie(n,n,r,r,1),He(this._f32,n)}tileMatrix64(e,t,o=G()){this._ensure();let r=e.bounds(),n=(r.maxX-r.minX)*this._worldSize/t;return Ee(o,this._projMatrix,r.minX*this._worldSize,r.minY*this._worldSize,0),Ie(o,o,n,n,1),o}objectMatrix(e,t,o=0){this._ensure();let r=this._objectMatrix;return Ee(r,this._projMatrix,e*this._worldSize,t*this._worldSize,o),Ie(r,r,this._worldSize,this._worldSize,1),He(this._objectF32,r)}horizonScreenY(){this._ensure();let e=Math.PI/2-Ye(this._pitch),o=this.height/2/Math.tan(this._fov/2)*Math.tan(Math.min(e,Ye(89.5)));return this.height/2-Math.min(o,this.height*50)}get globeActive(){return this._ensure(),this.projection==="globe"&&this._zoom<$e}get globeFlatMix(){return this._ensure(),co(this._zoom)}get globeRadiusPx(){return this._ensure(),so(this._worldSize)}get globeBasis(){return this._ensure(),this._globeBasis}get localProjMatrix(){return this._ensure(),this._localProj}globeCamera(){this._ensure();let e=this.globeRadiusPx,t=G();if(!Fe(t,this._localView))return {dir:[0,0,1],horizonCos:1};let o=t[12],r=t[13],n=t[14]+e,a=Math.hypot(o,r,n)||1;return {dir:[o/a,r/a,n/a],horizonCos:e/Math.max(a,e+1e-6)}}localRayCorners(){this._ensure();let e=this.width,t=this.height;return [[0,0],[e,0],[0,t],[e,t]].map(([r,n])=>{let a=[0,0,0,0],l=[0,0,0,0];ie(a,this._localPixelInverse,[r,n,0,1]),ie(l,this._localPixelInverse,[r,n,1,1]);let s=a[3]||1e-9,c=l[3]||1e-9,f=l[0]/c-a[0]/s,h=l[1]/c-a[1]/s,u=l[2]/c-a[2]/s,d=Math.hypot(f,h,u)||1;return [f/d,h/d,u/d]})}globeDisc(){this._ensure();let e=this.globeCamera();return {dir:[-e.dir[0],-e.dir[1],-e.dir[2]],angle:Math.asin(Math.min(e.horizonCos,1))}}localMatrix(){return this._ensure(),He(this._localF32,this._localProj)}globeLocal(e,t){return this._ensure(),Tn(e,t,this._centerX/this._worldSize,this._centerY/this._worldSize,this.globeRadiusPx,this._worldSize,this._globeBasis,co(this._zoom))}localToPoint(e){this._ensure();let t=[0,0,0,0];return ie(t,this._localPixel,[e[0],e[1],e[2],1]),t[3]<=1e-6?null:{x:t[0]/t[3],y:t[1]/t[3]}}globeUnproject(e){this._ensure();let t=[0,0,0,0],o=[0,0,0,0];ie(t,this._localPixelInverse,[e.x,e.y,0,1]),ie(o,this._localPixelInverse,[e.x,e.y,1,1]);let r=t[3]||1e-9,n=o[3]||1e-9,a=this.globeRadiusPx,l=[t[0]/r,t[1]/r,t[2]/r+a],s=[o[0]/n-l[0],o[1]/n-l[1],o[2]/n+a-l[2]],c=Math.hypot(s[0],s[1],s[2])||1,f=[s[0]/c,s[1]/c,s[2]/c],h=qo(l,f,a);if(!h)return null;let u=this._globeBasis,d=[h[0]/a,h[1]/a,h[2]/a],m=[d[0]*u.east[0]+d[1]*u.south[0]+d[2]*u.up[0],d[0]*u.east[1]+d[1]*u.south[1]+d[2]*u.up[1],d[0]*u.east[2]+d[1]*u.south[2]+d[2]*u.up[2]];return Ko(m)}isOnGlobeFront(e,t,o=.06){this._ensure();let r=this.globeCamera(),n=this._globeBasis,a=fo(e,t),l=[a[0]*n.east[0]+a[1]*n.east[1]+a[2]*n.east[2],a[0]*n.south[0]+a[1]*n.south[1]+a[2]*n.south[2],a[0]*n.up[0]+a[1]*n.up[1]+a[2]*n.up[2]];return l[0]*r.dir[0]+l[1]*r.dir[1]+l[2]*r.dir[2]>=r.horizonCos-o}updateShadow(e,t){this._ensure();let o=Math.max(this.width,this.height)*nl,r=G();if(!Fe(r,this._viewProjPx))return;let n=this._cameraPosPx,a=[],l=[0,0,0,0];for(let S of [-1,1])for(let _ of [-1,1])for(let M of [-1,1]){if(ie(l,r,[S,_,M,1]),l[3]===0)continue;let x=l[0]/l[3],C=l[1]/l[3],T=x-n[0],E=C-n[1],k=Math.hypot(T,E);if(k>o){let F=o/k;x=n[0]+T*F,C=n[1]+E*F;}a.push({x,y:C,z:0});}if(!a.length)return;let s=ao(e),c=Math.abs(s[2])>.999?[0,1,0]:[0,0,1],f=this._shadowView;Sn(f,[this._centerX,this._centerY,0],[this._centerX+s[0],this._centerY+s[1],s[2]],c);let h=Math.min(t*this._pixelsPerMeter,o),u=1/0,d=1/0,m=1/0,y=-1/0,p=-1/0,b=-1/0,g=[0,0,0,0];for(let S of a)for(let _ of [0,h])ie(g,f,[S.x,S.y,_,1]),g[0]<u&&(u=g[0]),g[0]>y&&(y=g[0]),g[1]<d&&(d=g[1]),g[1]>p&&(p=g[1]),g[2]<m&&(m=g[2]),g[2]>b&&(b=g[2]);let v=h+1,w=this._shadowProj;Cn(w,u,y,d,p,-b-v,-m+v),xe(this._shadowVP,w,f),Ie(this._shadowVPm,this._shadowVP,1,1,this._pixelsPerMeter),this._shadowValid=true;}get shadowReady(){return this._shadowValid}shadowObjectMatrix(e,t,o=0){this._ensure();let r=this._shadowObject;return Ee(r,this._shadowVPm,e*this._worldSize,t*this._worldSize,o),Ie(r,r,this._worldSize,this._worldSize,1),He(this._shadowObject32,r)}shadowTileMatrix(e,t){this._ensure();let o=e.bounds(),r=(o.maxX-o.minX)*this._worldSize/t,n=this._shadowTile;return Ee(n,this._shadowVPm,o.minX*this._worldSize,o.minY*this._worldSize,0),Ie(n,n,r,r,1),He(this._shadowTile32,n)}shadowDepthPerMeter(){return this._ensure(),Math.abs(this._shadowVPm[10])}shadowTexelWorldSize(e){return 2/(this._shadowVP[0]*e||1)}isTileVisible(e){this._ensure();let t=e.bounds(),o=t.minX*this._worldSize,r=t.maxX*this._worldSize,n=t.minY*this._worldSize,a=t.maxY*this._worldSize,l=An*this._pixelsPerMeter;for(let s of this._frustumPlanes){let c=s[0]>0?r:o,f=s[1]>0?a:n,h=s[2]>0?l:0;if(s[0]*c+s[1]*f+s[2]*h+s[3]<0)return false}return true}isSphereVisible(e,t,o,r){this._ensure();let n=e*this._worldSize,a=t*this._worldSize,l=o*this._pixelsPerMeter,s=r*this._pixelsPerMeter;for(let c of this._frustumPlanes)if(c[0]*n+c[1]*a+c[2]*l+c[3]<-s)return false;return true}distanceToTile(e){this._ensure();let t=e.bounds(),[o,r,n]=this._cameraPosPx,a=Math.max(t.minX*this._worldSize-o,0,o-t.maxX*this._worldSize),l=Math.max(t.minY*this._worldSize-r,0,r-t.maxY*this._worldSize),s=Math.max(0-n,0,n-An*this._pixelsPerMeter);return Math.hypot(a,l,s)}get flatFarDistance(){return this._ensure(),Math.hypot(this._cameraToCenterDistance,this.width/2,this.height/2)}detailZoom(e){return this._ensure(),this._zoom-Math.max(0,Math.log2(Math.max(e,1)/this.flatFarDistance))}_ensure(){this._dirty&&this._calc();}_calc(){this._dirty=false;let e=Be(this._zoom);this._worldSize=e,this._pixelsPerMeter=Go(1,this._center.lat)*e,this._centerX=ee(this._center.lng)*e,this._centerY=te(this._center.lat)*e;let t=Math.max(this.width,1),o=Math.max(this.height,1),r=Ye(this._pitch),n=-Ye(this._bearing),a=.5/Math.tan(this._fov/2)*o;this._cameraToCenterDistance=a;let l=Math.PI/2+r,s=this._fov/2,c=Math.sin(s)*a/Math.sin(we(Math.PI-l-s,.01,Math.PI-.01)),f=Math.cos(Math.PI/2-r)*c+a,h=Math.min(f*1.01,a*30),u=o/50;if(this.projection==="globe"&&this._zoom<$e){let g=so(e);u=Math.max(a-g*1.6,a*.02),h=a+g*2.4;}let d=this._viewMatrix;Ie(d,G(),1,-1,1),Ee(d,d,0,0,-a),Xo(d,d,r),Yo(d,d,n),Ee(d,d,-this._centerX,-this._centerY,0);let m=G();_n(m,this._fov,t/o,u,h),xe(this._viewProjPx,m,d);let y=G();Ie(y,d,1,1,this._pixelsPerMeter),xe(this._projMatrix,m,y);let p=this._localView;Ie(p,G(),1,-1,1),Ee(p,p,0,0,-a),Xo(p,p,r),Yo(p,p,n),xe(this._localProj,m,p),this._globeBasis=$o(this._center.lng,this._center.lat);let b=G();Ie(b,G(),t/2,-o/2,1),Ee(b,b,1,-1,0),xe(this._pixelMatrix,b,this._projMatrix),Fe(this._pixelMatrixInverse,this._pixelMatrix)||console.warn("[osmgl] \u043C\u0430\u0442\u0440\u0438\u0446\u0430 \u043A\u0430\u043C\u0435\u0440\u044B \u0432\u044B\u0440\u043E\u0436\u0434\u0435\u043D\u0430, unproject \u0434\u0430\u0441\u0442 \u043C\u0443\u0441\u043E\u0440"),xe(this._localPixel,b,this._localProj),Fe(this._localPixelInverse,this._localPixel),this._calcCameraPosition(),this._calcFrustum();}_calcCameraPosition(){let e=G();if(!Fe(e,this._viewMatrix)){this._cameraPosPx=[this._centerX,this._centerY,this._cameraToCenterDistance];return}this._cameraPosPx=[e[12],e[13],e[14]];}_calcFrustum(){let e=G();if(!Fe(e,this._viewProjPx)){this._frustumPlanes=[];return}let t=[];for(let l of [-1,1])for(let s of [-1,1])for(let c of [-1,1]){let f=[0,0,0,0];ie(f,e,[c,s,l,1]);let h=f[3]||1e-9;t.push([f[0]/h,f[1]/h,f[2]/h]);}let o=[[0,1,2],[6,5,4],[0,2,4],[5,3,1],[0,4,1],[3,6,2]];this._frustumPlanes=o.map(([l,s,c])=>{let f=t[l],h=t[s],u=t[c],d=h[0]-f[0],m=h[1]-f[1],y=h[2]-f[2],p=u[0]-f[0],b=u[1]-f[1],g=u[2]-f[2],v=m*g-y*b,w=y*p-d*g,S=d*b-m*p,_=Math.hypot(v,w,S)||1;v/=_,w/=_,S/=_;let M=new Float64Array(4);return M[0]=v,M[1]=w,M[2]=S,M[3]=-(v*f[0]+w*f[1]+S*f[2]),M});let r=0,n=0,a=0;for(let l of t)r+=l[0]/8,n+=l[1]/8,a+=l[2]/8;for(let l of this._frustumPlanes)l[0]*r+l[1]*n+l[2]*a+l[3]<0&&(l[0]=-l[0],l[1]=-l[1],l[2]=-l[2],l[3]=-l[3]);}tileScreenSize(e,t){return this._ensure(),this._worldSize/Math.pow(2,e)*this._cameraToCenterDistance/Math.max(t,1e-6)}visibleWrapRange(){this._ensure();let e=[this.pointToWorldPx({x:0,y:this.height}),this.pointToWorldPx({x:this.width,y:this.height}),this.pointToWorldPx({x:0,y:0}),this.pointToWorldPx({x:this.width,y:0})],t=1/0,o=-1/0;for(let r of e){let n=Math.floor(r.x/this._worldSize);n<t&&(t=n),n>o&&(o=n);}return !isFinite(t)||!isFinite(o)?{min:0,max:0}:{min:we(t,-3,3),max:we(o,-3,3)}}};var al={dragPan:true,scrollZoom:true,dragRotate:true,touchZoomRotate:true,touchPitch:true,doubleClickZoom:true,keyboard:true,inertia:1},Ln=2,ll=100,sl=.5,cl=.1,fl=25,In=i=>Math.abs(i.y)>Math.abs(i.x);function Fn(i,e,t){let o=Math.hypot(i.x,i.y)>=Ln,r=Math.hypot(e.x,e.y)>=Ln;return !o&&!r?void 0:!o||!r?t<ll?void 0:false:i.y>0==e.y>0&&In(i)&&In(e)}function En(i,e){let t=(i-e)*(180/Math.PI);for(;t>180;)t-=360;for(;t<=-180;)t+=360;return t}var ul=160,Zo=4,uo=class{constructor(e,t,o,r,n={}){this.canvas=e;this.tr=t;this.onChange=o;this.onInteractionEnd=r;this.pointers=new H;this.dragMode="none";this.lastPoint={x:0,y:0};this.panAnchor=null;this.samples=[];this.inertiaRaf=0;this.touch=null;this.lastTapTime=0;this.disposed=false;this.onContextMenu=e=>{this.opts.dragRotate&&e.preventDefault();};this.onPointerDown=e=>{this.stopInertia(),this.canvas.setPointerCapture(e.pointerId),this.pointers.set(e.pointerId,this.point(e));let t=this.point(e);if(this.pointers.size===2){this.beginTouchGesture();return}if(this.pointers.size>2)return;(e.button===2||e.ctrlKey||e.metaKey)&&this.opts.dragRotate?this.dragMode="rotate":this.opts.dragPan&&(this.dragMode="pan",this.panAnchor=this.tr.unproject(t)),this.lastPoint=t,this.samples=[{t:performance.now(),x:t.x,y:t.y}],this.opts.keyboard&&this.canvas.focus({preventScroll:true});};this.onPointerMove=e=>{if(!this.pointers.has(e.pointerId))return;let t=this.point(e);if(this.pointers.set(e.pointerId,t),this.pointers.size>=2){this.updateTouchGesture();return}let o=t.x-this.lastPoint.x,r=t.y-this.lastPoint.y;this.lastPoint=t,this.pushSample(t),this.dragMode==="pan"&&this.panAnchor?(this.tr.setLocationAtPoint(this.panAnchor,t),this.onChange("pan")):this.dragMode==="rotate"&&(this.tr.bearing=this.tr.bearing-o*.4,this.tr.pitch=this.tr.pitch-r*.4,this.onChange("rotate"));};this.onPointerUp=e=>{if(this.pointers.has(e.pointerId)){if(this.pointers.delete(e.pointerId),this.canvas.hasPointerCapture(e.pointerId)&&this.canvas.releasePointerCapture(e.pointerId),this.pointers.size===1){let t=[...this.pointers.values()][0];this.touch=null,this.lastPoint=t,this.samples=[{t:performance.now(),x:t.x,y:t.y}],this.dragMode=this.opts.dragPan?"pan":"none",this.panAnchor=this.opts.dragPan?this.tr.unproject(t):null;return}if(this.pointers.size>0){this.pointers.size>=2&&this.beginTouchGesture();return}if(this.touch=null,this.dragMode==="pan"&&this.opts.inertia>0&&this.startInertia(),this.dragMode="none",this.panAnchor=null,this.opts.doubleClickZoom&&e.pointerType!=="touch"){let t=performance.now();t-this.lastTapTime<300?(this.zoomAround(this.point(e),e.shiftKey?-1:1),this.lastTapTime=0):this.lastTapTime=t;}this.onInteractionEnd();}};this.onWheel=e=>{if(!this.opts.scrollZoom)return;e.preventDefault(),this.stopInertia();let t=e.deltaY;e.deltaMode===1?t*=40:e.deltaMode===2&&(t*=800);let o=we(-t/200,-2,2);this.zoomAround(this.point(e),o),this.onInteractionEnd();};this.onKeyDown=e=>{if(!this.opts.keyboard)return;let t=e.shiftKey?200:80,o={x:this.tr.width/2,y:this.tr.height/2},r=true;switch(e.key){case "ArrowLeft":e.shiftKey?this.rotateBy(-15,0):this.panBy(-t,0,o);break;case "ArrowRight":e.shiftKey?this.rotateBy(15,0):this.panBy(t,0,o);break;case "ArrowUp":e.shiftKey?this.rotateBy(0,10):this.panBy(0,-t,o);break;case "ArrowDown":e.shiftKey?this.rotateBy(0,-10):this.panBy(0,t,o);break;case "=":case "+":this.zoomAround(o,1);break;case "-":case "_":this.zoomAround(o,-1);break;default:r=false;}r&&(e.preventDefault(),this.onInteractionEnd());};this.opts={...al,...n},this.bind();}setOptions(e){this.opts={...this.opts,...e};}bind(){let e=this.canvas;e.addEventListener("pointerdown",this.onPointerDown),e.addEventListener("pointermove",this.onPointerMove),e.addEventListener("pointerup",this.onPointerUp),e.addEventListener("pointercancel",this.onPointerUp),e.addEventListener("wheel",this.onWheel,{passive:false}),e.addEventListener("contextmenu",this.onContextMenu),e.addEventListener("keydown",this.onKeyDown),e.hasAttribute("tabindex")||e.setAttribute("tabindex","0"),e.style.touchAction="none";}point(e){let t=this.canvas.getBoundingClientRect();return {x:e.clientX-t.left,y:e.clientY-t.top}}beginTouchGesture(){let[e,t]=[...this.pointers.values()],o=t.x-e.x,r=t.y-e.y,n=Math.hypot(o,r);this.touch={mode:void 0,lastA:e,lastB:t,startA:e,startB:t,startDist:n,startAngle:Math.atan2(r,o),minDist:n,zoomActive:false,rotateActive:false,firstMoveAt:0,pitchPossible:Math.abs(o)>=Math.abs(r)},this.dragMode="none",this.panAnchor=null;}updateTouchGesture(){let e=this.touch;if(!e)return;let[t,o]=[...this.pointers.values()],r={x:t.x-e.lastA.x,y:t.y-e.lastA.y},n={x:o.x-e.lastB.x,y:o.y-e.lastB.y};if(e.mode===void 0){!e.firstMoveAt&&(Math.hypot(r.x,r.y)>0||Math.hypot(n.x,n.y)>0)&&(e.firstMoveAt=performance.now());let a=e.pitchPossible&&this.opts.touchPitch?Fn(r,n,e.firstMoveAt?performance.now()-e.firstMoveAt:0):false;if(a===void 0)return;e.mode=a?"pitch":"zoomRotate";}if(e.mode==="pitch"){let a=(r.y+n.y)/2;a!==0&&(this.tr.pitch=this.tr.pitch-a*sl,this.onChange("pitch"));}else this.opts.touchZoomRotate&&this.applyZoomRotate(e,t,o);e.lastA=t,e.lastB=o;}applyZoomRotate(e,t,o){let r=Math.hypot(o.x-t.x,o.y-t.y),n=Math.atan2(o.y-t.y,o.x-t.x),a={x:(e.lastA.x+e.lastB.x)/2,y:(e.lastA.y+e.lastB.y)/2},l={x:(t.x+o.x)/2,y:(t.y+o.y)/2},s=this.tr.unproject(a),c="pan",f=Math.hypot(e.lastB.x-e.lastA.x,e.lastB.y-e.lastA.y);if(r>0&&f>0&&e.startDist>0&&(!e.zoomActive&&Math.abs(Math.log2(r/e.startDist))>=cl&&(e.zoomActive=true),e.zoomActive)){let h=Math.log2(r/f);h!==0&&(this.tr.zoom=this.tr.zoom+h,c="zoom");}if(this.opts.dragRotate){e.minDist=Math.min(e.minDist,r);let h=fl/Math.max(Math.PI*e.minDist,1)*360;if(!e.rotateActive&&Math.abs(En(n,e.startAngle))>=h&&(e.rotateActive=true),e.rotateActive){let u=Math.atan2(e.lastB.y-e.lastA.y,e.lastB.x-e.lastA.x),d=En(n,u);d!==0&&(this.tr.bearing=this.tr.bearing-d,c==="pan"&&(c="rotate"));}}this.tr.setLocationAtPoint(s,l),this.onChange(c);}zoomAround(e,t){let o=this.tr.unproject(e);this.tr.zoom=this.tr.zoom+t,this.tr.setLocationAtPoint(o,e),this.onChange("zoom");}panBy(e,t,o){let r=this.tr.unproject(o);this.tr.setLocationAtPoint(r,{x:o.x-e,y:o.y-t}),this.onChange("pan");}rotateBy(e,t){e&&(this.tr.bearing=this.tr.bearing+e),t&&(this.tr.pitch=this.tr.pitch+t),this.onChange("rotate");}pushSample(e){let t=performance.now();for(this.samples.push({t,x:e.x,y:e.y});this.samples.length>2&&t-this.samples[0].t>ul;)this.samples.shift();}startInertia(){if(this.samples.length<2)return;let e=this.samples[0],t=this.samples[this.samples.length-1],o=t.t-e.t;if(o<8||performance.now()-t.t>60)return;let r=(t.x-e.x)/o*this.opts.inertia,n=(t.y-e.y)/o*this.opts.inertia,a=Math.hypot(r,n);if(a<.05)return;a>Zo&&(r=r/a*Zo,n=n/a*Zo);let l=performance.now(),s=()=>{if(this.disposed)return;let c=performance.now(),f=Math.min(c-l,34);l=c;let h=Math.exp(-25e-4*f*10);if(r*=h,n*=h,Math.hypot(r,n)<.01){this.inertiaRaf=0,this.onInteractionEnd();return}let u={x:this.tr.width/2,y:this.tr.height/2};this.panBy(-r*f,-n*f,u),this.inertiaRaf=requestAnimationFrame(s);};this.inertiaRaf=requestAnimationFrame(s);}stopInertia(){this.inertiaRaf&&cancelAnimationFrame(this.inertiaRaf),this.inertiaRaf=0;}destroy(){this.disposed=true,this.stopInertia();let e=this.canvas;e.removeEventListener("pointerdown",this.onPointerDown),e.removeEventListener("pointermove",this.onPointerMove),e.removeEventListener("pointerup",this.onPointerUp),e.removeEventListener("pointercancel",this.onPointerUp),e.removeEventListener("wheel",this.onWheel),e.removeEventListener("contextmenu",this.onContextMenu),e.removeEventListener("keydown",this.onKeyDown),this.pointers.clear();}};var be=class{constructor(e,t,o,r=false){this.ctx=e;this.layout=o;let n=e.gl,a=n.createBuffer();if(!a)throw new Error("[osmgl] createBuffer \u0432\u0435\u0440\u043D\u0443\u043B null");this.buffer=a,e.bindVAO(null),n.bindBuffer(n.ARRAY_BUFFER,a),n.bufferData(n.ARRAY_BUFFER,t,r?n.DYNAMIC_DRAW:n.STATIC_DRAW),this.byteLength=t.byteLength;}update(e,t=0){let o=this.ctx.gl;o.bindBuffer(o.ARRAY_BUFFER,this.buffer),o.bufferSubData(o.ARRAY_BUFFER,t,e);}destroy(){this.ctx.gl.deleteBuffer(this.buffer);}},se=class{constructor(e,t){this.ctx=e;let o=e.gl,r=o.createBuffer();if(!r)throw new Error("[osmgl] createBuffer \u0432\u0435\u0440\u043D\u0443\u043B null");this.buffer=r,e.bindVAO(null),o.bindBuffer(o.ELEMENT_ARRAY_BUFFER,r),o.bufferData(o.ELEMENT_ARRAY_BUFFER,t,o.STATIC_DRAW),this.count=t.length,this.type=t instanceof Uint32Array?o.UNSIGNED_INT:o.UNSIGNED_SHORT;}destroy(){this.ctx.gl.deleteBuffer(this.buffer);}},ae=class{constructor(e,t,o){this.ctx=e;let r=e.gl,n=r.createVertexArray();if(!n)throw new Error("[osmgl] createVertexArray \u0432\u0435\u0440\u043D\u0443\u043B null");this.vao=n,e.bindVAO(n);for(let{buffer:a,locations:l}of t){r.bindBuffer(r.ARRAY_BUFFER,a.buffer);for(let s of a.layout.attribs){let c=l.get(s.name);c===void 0||c<0||(r.enableVertexAttribArray(c),s.integer?r.vertexAttribIPointer(c,s.size,s.type,a.layout.stride,s.offset):r.vertexAttribPointer(c,s.size,s.type,s.normalized??false,a.layout.stride,s.offset),s.divisor&&r.vertexAttribDivisor(c,s.divisor));}}o&&r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,o.buffer),e.bindVAO(null);}bind(){this.ctx.bindVAO(this.vao);}destroy(){this.ctx.gl.deleteVertexArray(this.vao);}};var hl=["a_pos","a_height","a_tint","a_ao","a_normal","a_kind","a_level","a_wall","a_p0","a_p1","a_corner","a_width","a_dist","a_tex"],ce=class{constructor(e,t,o,r,n={}){this.ctx=e;this.name=t;this.uniforms=new H;this.attribs=new H;let a=e.gl,l=ml(n),s=Rn(a,a.VERTEX_SHADER,zn(o,l),`${t}.vert`),c=Rn(a,a.FRAGMENT_SHADER,zn(r,l),`${t}.frag`),f=a.createProgram();if(!f)throw new Error(`[osmgl] \u043D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u0441\u043E\u0437\u0434\u0430\u0442\u044C \u043F\u0440\u043E\u0433\u0440\u0430\u043C\u043C\u0443 ${t}`);if(a.attachShader(f,s),a.attachShader(f,c),hl.forEach((h,u)=>a.bindAttribLocation(f,u,h)),a.linkProgram(f),a.detachShader(f,s),a.detachShader(f,c),a.deleteShader(s),a.deleteShader(c),!a.getProgramParameter(f,a.LINK_STATUS)){let h=a.getProgramInfoLog(f);throw a.deleteProgram(f),new Error(`[osmgl] \u043B\u0438\u043D\u043A\u043E\u0432\u043A\u0430 ${t} \u043D\u0435 \u043F\u0440\u043E\u0448\u043B\u0430: ${h}`)}this.program=f,this.cacheLocations();}cacheLocations(){let e=this.ctx.gl,t=e.getProgramParameter(this.program,e.ACTIVE_UNIFORMS);for(let r=0;r<t;r++){let n=e.getActiveUniform(this.program,r);if(!n)continue;let a=n.name.replace(/\[0\]$/,"");this.uniforms.set(a,e.getUniformLocation(this.program,n.name));}let o=e.getProgramParameter(this.program,e.ACTIVE_ATTRIBUTES);for(let r=0;r<o;r++){let n=e.getActiveAttrib(this.program,r);n&&this.attribs.set(n.name,e.getAttribLocation(this.program,n.name));}}use(){this.ctx.useProgram(this.program);}attribLocation(e){return this.attribs.get(e)??-1}loc(e){return this.uniforms.get(e)??null}setMat4(e,t){let o=this.loc(e);o&&this.ctx.gl.uniformMatrix4fv(o,false,t);}setMat3(e,t){let o=this.loc(e);o&&this.ctx.gl.uniformMatrix3fv(o,false,t);}setFloat(e,t){let o=this.loc(e);o&&this.ctx.gl.uniform1f(o,t);}setInt(e,t){let o=this.loc(e);o&&this.ctx.gl.uniform1i(o,t);}setVec2(e,t,o){let r=this.loc(e);r&&this.ctx.gl.uniform2f(r,t,o);}setVec3(e,t,o,r){let n=this.loc(e);n&&this.ctx.gl.uniform3f(n,t,o,r);}setVec4(e,t,o,r,n){let a=this.loc(e);a&&this.ctx.gl.uniform4f(a,t,o,r,n);}setVec4v(e,t){let o=this.loc(e);o&&this.ctx.gl.uniform4f(o,t[0],t[1],t[2],t[3]);}setVec4Array(e,t){let o=this.loc(e)??this.loc(`${e}[0]`);o&&this.ctx.gl.uniform4fv(o,t);}destroy(){this.ctx.gl.deleteProgram(this.program),this.uniforms.clear(),this.attribs.clear();}};function ml(i){let e=[];for(let[t,o]of Object.entries(i))o!==false&&e.push(o===true?`#define ${t}`:`#define ${t} ${o}`);return e.join(`
|
|
2
|
-
`)}function
|
|
1
|
+
'use strict';Object.defineProperty(exports,'__esModule',{value:true});var $n=require('earcut'),Tl=require('pbf'),ei=require('polygon-clipping');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}function _interopNamespace(e){if(e&&e.__esModule)return e;var n=Object.create(null);if(e){Object.keys(e).forEach(function(k){if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})}n.default=e;return Object.freeze(n)}var $n__default=/*#__PURE__*/_interopDefault($n);var Tl__default=/*#__PURE__*/_interopDefault(Tl);var ei__namespace=/*#__PURE__*/_interopNamespace(ei);var B=Map,ee=Set;var De=class{constructor(){this.listeners=new B;}on(e,t){let o=this.listeners.get(e);return o||this.listeners.set(e,o=new ee),o.add(t),this}once(e,t){let o=r=>{this.off(e,o),t(r);};return this.on(e,o)}off(e,t){return this.listeners.get(e)?.delete(t),this}emit(e,t){let o=this.listeners.get(e);if(!o)return this;for(let r of [...o])try{r(t);}catch(n){console.error(`[osmgl] \u043E\u0431\u0440\u0430\u0431\u043E\u0442\u0447\u0438\u043A "${e}" \u0431\u0440\u043E\u0441\u0438\u043B \u0438\u0441\u043A\u043B\u044E\u0447\u0435\u043D\u0438\u0435:`,n);}return this}removeAllListeners(){this.listeners.clear();}};var we=(i,e,t)=>i<e?e:i>t?t:i;var $e=i=>i*Math.PI/180,xn=i=>i*180/Math.PI;function rt(i){let e=((i+180)%360+360)%360-180;return e===-180?180:e}var no=i=>1-Math.pow(1-i,3);function he(i){let e=i.trim();if(e[0]==="#"){let o=e.slice(1);if(o.length===3||o.length===4){let r=o.split("").map(n=>parseInt(n+n,16)/255);return [r[0],r[1],r[2],r.length===4?r[3]:1]}if(o.length===6||o.length===8){let r=[];for(let n=0;n<o.length;n+=2)r.push(parseInt(o.slice(n,n+2),16)/255);return [r[0],r[1],r[2],r.length===4?r[3]:1]}}let t=e.match(/^rgba?\(([^)]+)\)$/i);if(t){let o=t[1].split(",").map(r=>parseFloat(r));if(o.length>=3)return [o[0]/255,o[1]/255,o[2]/255,o.length>3?o[3]:1]}return [1,0,1,1]}function _e(i){return [i[0]*i[3],i[1]*i[3],i[2]*i[3],i[3]]}var io=class{constructor(e){this._program=null;this._vao=null;this._framebuffer=null;this._depthTest=false;this._depthMask=true;this._colorMask=true;this._depthFunc="lequal";this._blend="none";this._cull="none";this._viewport=[0,0,0,0];this._activeTexture=-1;this._boundTextures=new B;this._stencilTest=false;this.gl=e,this.caps=fl(e),e.enable(e.DEPTH_TEST),this._depthTest=true,e.depthFunc(e.LEQUAL),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,false);}useProgram(e){return this._program===e?false:(this.gl.useProgram(e),this._program=e,true)}bindVAO(e){this._vao!==e&&(this.gl.bindVertexArray(e),this._vao=e);}bindFramebuffer(e){this._framebuffer!==e&&(this.gl.bindFramebuffer(this.gl.FRAMEBUFFER,e),this._framebuffer=e);}bindTexture(e,t,o=this.gl.TEXTURE_2D){this._activeTexture!==e&&(this.gl.activeTexture(this.gl.TEXTURE0+e),this._activeTexture=e),this._boundTextures.get(e)!==t&&(this.gl.bindTexture(o,t),this._boundTextures.set(e,t));}viewport(e,t,o,r){let n=this._viewport;n[0]===e&&n[1]===t&&n[2]===o&&n[3]===r||(this.gl.viewport(e,t,o,r),this._viewport=[e,t,o,r]);}setDepthTest(e){this._depthTest!==e&&(e?this.gl.enable(this.gl.DEPTH_TEST):this.gl.disable(this.gl.DEPTH_TEST),this._depthTest=e);}setDepthMask(e){this._depthMask!==e&&(this.gl.depthMask(e),this._depthMask=e);}setColorMask(e){this._colorMask!==e&&(this.gl.colorMask(e,e,e,e),this._colorMask=e);}setDepthFunc(e){if(this._depthFunc===e)return;let t=this.gl;this.gl.depthFunc(e==="less"?t.LESS:e==="always"?t.ALWAYS:e==="greater"?t.GREATER:t.LEQUAL),this._depthFunc=e;}setBlend(e){if(this._blend===e)return;let t=this.gl;e==="none"?t.disable(t.BLEND):(this._blend==="none"&&t.enable(t.BLEND),e==="alpha"?t.blendFuncSeparate(t.SRC_ALPHA,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA):e==="premultiplied"?t.blendFunc(t.ONE,t.ONE_MINUS_SRC_ALPHA):e==="multiply"?t.blendFunc(t.DST_COLOR,t.ZERO):t.blendFunc(t.ONE,t.ONE)),this._blend=e;}setCull(e){if(this._cull===e)return;let t=this.gl;e==="none"?t.disable(t.CULL_FACE):(this._cull==="none"&&t.enable(t.CULL_FACE),t.cullFace(e==="back"?t.BACK:t.FRONT)),this._cull=e;}setStencilTest(e){this._stencilTest!==e&&(e?this.gl.enable(this.gl.STENCIL_TEST):this.gl.disable(this.gl.STENCIL_TEST),this._stencilTest=e);}clear(e,t=true,o=false){let r=this.gl,n=0;e&&(r.clearColor(e[0],e[1],e[2],e[3]),n|=r.COLOR_BUFFER_BIT),t&&(this.setDepthMask(true),r.clearDepth(1),n|=r.DEPTH_BUFFER_BIT),o&&(r.clearStencil(0),n|=r.STENCIL_BUFFER_BIT),n&&r.clear(n);}invalidateState(){this._program=null,this._vao=null,this._framebuffer=null,this._activeTexture=-1,this._boundTextures.clear(),this._viewport=[-1,-1,-1,-1];}};function fl(i){let e=i.getExtension("EXT_texture_filter_anisotropic")??i.getExtension("WEBKIT_EXT_texture_filter_anisotropic"),t=i.getExtension("WEBGL_debug_renderer_info");return {maxTextureSize:i.getParameter(i.MAX_TEXTURE_SIZE),maxVertexAttribs:i.getParameter(i.MAX_VERTEX_ATTRIBS),colorBufferFloat:!!i.getExtension("EXT_color_buffer_float"),anisotropic:e,maxAnisotropy:e?i.getParameter(e.MAX_TEXTURE_MAX_ANISOTROPY_EXT):1,timerQuery:!!i.getExtension("EXT_disjoint_timer_query_webgl2"),rendererName:t?String(i.getParameter(t.UNMASKED_RENDERER_WEBGL)):"unknown"}}var qe=512,ao=40075016686e-3,_n=85.051129;function Z(i){return Array.isArray(i)?{lng:i[0],lat:i[1]}:i}var Ge=i=>512*Math.pow(2,i),lo=i=>Math.max(-_n,Math.min(_n,i));function re(i){return (180+i)/360}function ne(i){let e=lo(i);return (180-180/Math.PI*Math.log(Math.tan(Math.PI/4+e*Math.PI/360)))/360}function Se(i){return i*360-180}function Ce(i){let e=180-i*360;return 360/Math.PI*Math.atan(Math.exp(e*Math.PI/180))-90}function Ae(i){return ao*Math.cos(i*Math.PI/180)}function jo(i,e){return i/Ae(e)}function bu(i,e){return i*Ae(e)}function yu(i,e){return jo(1,i)*Ge(e)}function gu(i,e){return Ae(i)/Ge(e)}function Cn(i,e){let t=Math.pow(2,i);return Ae(Ce((e+.5)/t))/t}function Xo(i){return ao/Math.pow(2,i)}function Sn(i,e,t){let o=Xo(i),r=65536;return [(e*o%r+r)%r,(t*o%r+r)%r]}var St=class i{constructor(e,t){this.west=1/0;this.south=1/0;this.east=-1/0;this.north=-1/0;e&&this.extend(e),t&&this.extend(t);}static from(e){let t=new i;for(let o of e)t.extend(o);return t}extend(e){if(e instanceof i)return e.isEmpty()?this:(this.west=Math.min(this.west,e.west),this.south=Math.min(this.south,e.south),this.east=Math.max(this.east,e.east),this.north=Math.max(this.north,e.north),this);let t=Z(e);return this.west=Math.min(this.west,t.lng),this.south=Math.min(this.south,t.lat),this.east=Math.max(this.east,t.lng),this.north=Math.max(this.north,t.lat),this}isEmpty(){return !(this.west<=this.east&&this.south<=this.north)}getCenter(){return {lng:(this.west+this.east)/2,lat:(this.south+this.north)/2}}getSouthWest(){return {lng:this.west,lat:this.south}}getNorthEast(){return {lng:this.east,lat:this.north}}contains(e){let t=Z(e);return t.lng>=this.west&&t.lng<=this.east&&t.lat>=this.south&&t.lat<=this.north}pad(e){if(this.isEmpty())return this;let t=(this.east-this.west)*e,o=(this.north-this.south)*e;return this.west-=t,this.east+=t,this.south-=o,this.north+=o,this}toMercator(){return {minX:re(this.west),maxX:re(this.east),minY:ne(this.north),maxY:ne(this.south)}}};function Yo(i,e){if(i.isEmpty())return null;let t={top:e.padding?.top??0,right:e.padding?.right??0,bottom:e.padding?.bottom??0,left:e.padding?.left??0},o=Math.max(e.width-t.left-t.right,Mn),r=Math.max(e.height-t.top-t.bottom,Mn),n=i.toMercator(),a=e.bearing??0,l=-a*Math.PI/180,s=Math.cos(l),c=Math.sin(l),f=(n.minX+n.maxX)/2,u=(n.minY+n.maxY)/2,h=0,m=0;for(let[v,x]of [[n.minX,n.minY],[n.maxX,n.minY],[n.maxX,n.maxY],[n.minX,n.maxY]]){let C=(v-f)*s-(x-u)*c,S=(v-f)*c+(x-u)*s;h=Math.max(h,Math.abs(C)*2),m=Math.max(m,Math.abs(S)*2);}let d=Math.min(o/Math.max(h,1e-12),r/Math.max(m,1e-12)),p=Math.min(Math.max(Math.log2(d/512),e.minZoom??0),e.maxZoom??22),y=Ge(p),b=(t.left-t.right)/2/y,g=(t.top-t.bottom)/2/y;return {center:{lng:Se(f-(b*s+g*c)),lat:Ce(u-(-b*c+g*s))},zoom:p,bearing:a}}var Mn=32;function N(){let i=new Float64Array(16);return i[0]=i[5]=i[10]=i[15]=1,i}function Pe(i){return i.fill(0),i[0]=i[5]=i[10]=i[15]=1,i}function xe(i,e,t){let o=e[0],r=e[1],n=e[2],a=e[3],l=e[4],s=e[5],c=e[6],f=e[7],u=e[8],h=e[9],m=e[10],d=e[11],p=e[12],y=e[13],b=e[14],g=e[15];for(let v=0;v<4;v++){let x=t[v*4],C=t[v*4+1],S=t[v*4+2],M=t[v*4+3];i[v*4]=x*o+C*l+S*u+M*p,i[v*4+1]=x*r+C*s+S*h+M*y,i[v*4+2]=x*n+C*c+S*m+M*b,i[v*4+3]=x*a+C*f+S*d+M*g;}return i}function Ie(i,e,t,o,r){return i!==e&&i.set(e),i[12]=e[0]*t+e[4]*o+e[8]*r+e[12],i[13]=e[1]*t+e[5]*o+e[9]*r+e[13],i[14]=e[2]*t+e[6]*o+e[10]*r+e[14],i[15]=e[3]*t+e[7]*o+e[11]*r+e[15],i}function Le(i,e,t,o,r){for(let n=0;n<4;n++)i[n]=e[n]*t,i[4+n]=e[4+n]*o,i[8+n]=e[8+n]*r,i[12+n]=e[12+n];return i}function $o(i,e,t){let o=Math.sin(t),r=Math.cos(t),n=e[4],a=e[5],l=e[6],s=e[7],c=e[8],f=e[9],u=e[10],h=e[11];return i!==e&&(i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[3],i[12]=e[12],i[13]=e[13],i[14]=e[14],i[15]=e[15]),i[4]=n*r+c*o,i[5]=a*r+f*o,i[6]=l*r+u*o,i[7]=s*r+h*o,i[8]=c*r-n*o,i[9]=f*r-a*o,i[10]=u*r-l*o,i[11]=h*r-s*o,i}function qo(i,e,t){let o=Math.sin(t),r=Math.cos(t),n=e[0],a=e[1],l=e[2],s=e[3],c=e[4],f=e[5],u=e[6],h=e[7];return i!==e&&(i[8]=e[8],i[9]=e[9],i[10]=e[10],i[11]=e[11],i[12]=e[12],i[13]=e[13],i[14]=e[14],i[15]=e[15]),i[0]=n*r+c*o,i[1]=a*r+f*o,i[2]=l*r+u*o,i[3]=s*r+h*o,i[4]=c*r-n*o,i[5]=f*r-a*o,i[6]=u*r-l*o,i[7]=h*r-s*o,i}function kn(i,e,t,o,r){let n=1/Math.tan(e/2);return i.fill(0),i[0]=n/t,i[5]=n,i[11]=-1,i[10]=(r+o)/(o-r),i[14]=2*r*o/(o-r),i}function En(i,e,t,o,r,n,a){let l=1/(e-t),s=1/(o-r),c=1/(n-a);return i.fill(0),i[0]=-2*l,i[5]=-2*s,i[10]=2*c,i[12]=(e+t)*l,i[13]=(r+o)*s,i[14]=(a+n)*c,i[15]=1,i}function Fe(i,e){let t=e[0],o=e[1],r=e[2],n=e[3],a=e[4],l=e[5],s=e[6],c=e[7],f=e[8],u=e[9],h=e[10],m=e[11],d=e[12],p=e[13],y=e[14],b=e[15],g=t*l-o*a,v=t*s-r*a,x=t*c-n*a,C=o*s-r*l,S=o*c-n*l,M=r*c-n*s,w=f*p-u*d,_=f*y-h*d,T=f*b-m*d,L=u*y-h*p,E=u*b-m*p,z=h*b-m*y,A=g*z-v*E+x*L+C*T-S*_+M*w;return A?(A=1/A,i[0]=(l*z-s*E+c*L)*A,i[1]=(r*E-o*z-n*L)*A,i[2]=(p*M-y*S+b*C)*A,i[3]=(h*S-u*M-m*C)*A,i[4]=(s*T-a*z-c*_)*A,i[5]=(t*z-r*T+n*_)*A,i[6]=(y*x-d*M-b*v)*A,i[7]=(f*M-h*x+m*v)*A,i[8]=(a*E-l*T+c*w)*A,i[9]=(o*T-t*E-n*w)*A,i[10]=(d*S-p*x+b*g)*A,i[11]=(u*x-f*S-m*g)*A,i[12]=(l*_-a*L-s*w)*A,i[13]=(t*L-o*_+r*w)*A,i[14]=(p*v-d*C-y*g)*A,i[15]=(f*C-u*v+h*g)*A,i):null}function ce(i,e,t){let[o,r,n,a]=t;return i[0]=e[0]*o+e[4]*r+e[8]*n+e[12]*a,i[1]=e[1]*o+e[5]*r+e[9]*n+e[13]*a,i[2]=e[2]*o+e[6]*r+e[10]*n+e[14]*a,i[3]=e[3]*o+e[7]*r+e[11]*n+e[15]*a,i}function He(i,e){for(let t=0;t<16;t++)i[t]=e[t];return i}function so(i){let e=Math.hypot(i[0],i[1],i[2])||1;return [i[0]/e,i[1]/e,i[2]/e]}function Tn(i,e){return [i[1]*e[2]-i[2]*e[1],i[2]*e[0]-i[0]*e[2],i[0]*e[1]-i[1]*e[0]]}function ul(i,e){return [i[0]-e[0],i[1]-e[1],i[2]-e[2]]}function Ko(i,e){return i[0]*e[0]+i[1]*e[1]+i[2]*e[2]}function An(i,e,t,o){let r=so(ul(t,e)),n=so(Tn(r,o)),a=Tn(n,r);return i[0]=n[0],i[1]=a[0],i[2]=-r[0],i[3]=0,i[4]=n[1],i[5]=a[1],i[6]=-r[1],i[7]=0,i[8]=n[2],i[9]=a[2],i[10]=-r[2],i[11]=0,i[12]=-Ko(n,e),i[13]=-Ko(a,e),i[14]=Ko(r,e),i[15]=1,i}var Mt=60,co=4.5,Ze=6,fo=i=>i/(2*Math.PI);function uo(i){if(i<=co)return 0;if(i>=Ze)return 1;let e=(i-co)/(Ze-co);return e*e*(3-2*e)}function ho(i,e){let t=i*Math.PI/180,o=lo(e)*Math.PI/180,r=Math.cos(o);return [r*Math.sin(t),-Math.sin(o),r*Math.cos(t)]}function Zo(i){let e=Math.hypot(i[0],i[1],i[2])||1,t=i[0]/e,o=i[1]/e,r=i[2]/e;return {lng:Math.atan2(t,r)*180/Math.PI,lat:Math.asin(-o)*180/Math.PI}}function hl(i,e){return ho(Se(i),Ce(e))}function Qo(i,e){let t=i*Math.PI/180,o=lo(e)*Math.PI/180,r=Math.cos(o),n=Math.sin(o);return {east:[Math.cos(t),0,-Math.sin(t)],south:[n*Math.sin(t),r,n*Math.cos(t)],up:[r*Math.sin(t),-n,r*Math.cos(t)]}}function Ln(i,e,t){let o=i[0]*e,r=i[1]*e,n=i[2]*e;return [o*t.east[0]+r*t.east[1]+n*t.east[2],o*t.south[0]+r*t.south[1]+n*t.south[2],o*t.up[0]+r*t.up[1]+n*t.up[2]-e]}function dl(i,e,t,o,r){let n=i-t;return n>.5&&(n-=1),n<-0.5&&(n+=1),[n*r,(e-o)*r,0]}function In(i,e,t,o,r,n,a,l){let s=Ln(hl(i,e),r,a);if(l<=0)return s;let c=dl(i,e,t,o,n);return [s[0]+(c[0]-s[0])*l,s[1]+(c[1]-s[1])*l,s[2]+(c[2]-s[2])*l]}function Jo(i,e,t){let o=i[0]*e[0]+i[1]*e[1]+i[2]*e[2],r=i[0]**2+i[1]**2+i[2]**2-t*t,n=o*o-r;if(n<0)return null;let a=-o-Math.sqrt(n);return a<0?null:[i[0]+e[0]*a,i[1]+e[1]*a,i[2]+e[2]*a]}var Fn=1e3,ml=2,Rn=84,pl=.42,Tt=class i{constructor(){this.width=0;this.height=0;this.minZoom=0;this.maxZoom=22;this.minPitch=0;this.maxPitch=75;this._center={lng:0,lat:0};this._zoom=0;this._bearing=0;this._pitch=0;this._fov=$e(36.87);this._worldSize=512;this._pixelsPerMeter=1;this._cameraToCenterDistance=0;this._centerX=0;this._centerY=0;this._projMatrix=N();this._viewProjPx=N();this._viewMatrix=N();this._pixelMatrix=N();this._pixelMatrixInverse=N();this._cameraPosPx=[0,0,0];this._frustumPlanes=[];this._dirty=true;this.projection="mercator";this._f32=new Float32Array(16);this._tileMatrix=N();this._localView=N();this._localProj=N();this._localPixel=N();this._localPixelInverse=N();this._localF32=new Float32Array(16);this._globeBasis={east:[1,0,0],south:[0,1,0],up:[0,0,1]};this._objectF32=new Float32Array(16);this._objectMatrix=N();this._shadowView=N();this._shadowProj=N();this._shadowVP=N();this._shadowVPm=N();this._shadowTile=N();this._shadowObject=N();this._shadowTile32=new Float32Array(16);this._shadowObject32=new Float32Array(16);this._shadowValid=false;this._calc();}get center(){return {...this._center}}set center(e){this._center={lng:e.lng,lat:e.lat},this._dirty=true;}globeMinZoom(){let e=Math.max(Math.min(this.width,this.height),1),t=pl*e*2*Math.PI/512;return Math.log2(Math.max(t,1e-6))}effectiveMinZoom(){return this.projection==="globe"?Math.max(this.minZoom,this.globeMinZoom()):this.minZoom}get zoom(){return this._zoom}set zoom(e){let t=we(e,this.effectiveMinZoom(),this.maxZoom);t!==this._zoom&&(this._zoom=t,this._dirty=true);}get bearing(){return this._bearing}set bearing(e){let t=rt(e);t!==this._bearing&&(this._bearing=t,this._dirty=true);}get pitch(){return this._pitch}set pitch(e){let t=this.projection==="globe"&&this._zoom<Ze?Math.min(this.maxPitch,Mt):this.maxPitch,o=we(e,this.minPitch,t);o!==this._pitch&&(this._pitch=o,this._dirty=true);}get fov(){return xn(this._fov)}set fov(e){let t=$e(we(e,1,89));t!==this._fov&&(this._fov=t,this._dirty=true);}resize(e,t){this.width===e&&this.height===t||(this.width=e,this.height=t,this._dirty=true);}get worldSize(){return this._ensure(),this._worldSize}get pixelsPerMeter(){return this._ensure(),this._pixelsPerMeter}get cameraToCenterDistance(){return this._ensure(),this._cameraToCenterDistance}get cameraPositionPx(){return this._ensure(),this._cameraPosPx}get projMatrix(){return this._ensure(),this._projMatrix}get viewMatrix(){return this._ensure(),this._viewMatrix}get centerPointPx(){return this._ensure(),{x:this._centerX,y:this._centerY}}clone(){let e=new i;return e.width=this.width,e.height=this.height,e.minZoom=this.minZoom,e.maxZoom=this.maxZoom,e.minPitch=this.minPitch,e.maxPitch=this.maxPitch,e._center={...this._center},e._zoom=this._zoom,e._bearing=this._bearing,e._pitch=this._pitch,e._fov=this._fov,e._dirty=true,e}project(e,t=0){this._ensure();let o=[re(e.lng)*this._worldSize,ne(e.lat)*this._worldSize,t,1],r=[0,0,0,0];ce(r,this._pixelMatrix,o);let n=r[3]||1e-9;return {x:r[0]/n,y:r[1]/n}}worldPxToPoint(e,t,o=0){if(this._ensure(),this.globeActive){let n=this.globeLocal(e/this._worldSize,t/this._worldSize),a={lng:Se(e/this._worldSize),lat:Ce(t/this._worldSize)};return this.isOnGlobeFront(a.lng,a.lat,0)?(n[2]+=o*this._pixelsPerMeter,this.localToPoint(n)):null}let r=[0,0,0,0];return ce(r,this._pixelMatrix,[e,t,o,1]),r[3]<=1e-6?null:{x:r[0]/r[3],y:r[1]/r[3]}}unproject(e){if(this.globeActive){let o=this.globeUnproject(e);if(o)return o}let t=this.pointToWorldPx(e);return {lng:Se(t.x/this._worldSize),lat:Ce(t.y/this._worldSize)}}pointToWorldPx(e){this._ensure();let t=[0,0,0,0],o=[0,0,0,0];ce(t,this._pixelMatrixInverse,[e.x,e.y,0,1]),ce(o,this._pixelMatrixInverse,[e.x,e.y,1,1]);let r=t[3]||1e-9,n=o[3]||1e-9,a={x:t[0]/r,y:t[1]/r,z:t[2]/r},l={x:o[0]/n,y:o[1]/n,z:o[2]/n},s=l.z-a.z,c=Math.abs(s)<1e-9?1:(0-a.z)/s,f=we(c,-1e6,1e6);return {x:a.x+(l.x-a.x)*f,y:a.y+(l.y-a.y)*f}}setLocationAtPoint(e,t){if(this._ensure(),this.globeActive){let l=this.globeUnproject(t);if(!l)return;let s=rt(this._center.lng+(e.lng-l.lng)),c=we(this._center.lat+(e.lat-l.lat),-Rn,Rn);this._center={lng:s,lat:c},this._dirty=true;return}let o=this.pointToWorldPx(t),r={x:re(e.lng)*this._worldSize,y:ne(e.lat)*this._worldSize},n=r.x-o.x,a=r.y-o.y;this._center={lng:Se((this._centerX+n)/this._worldSize),lat:Ce((this._centerY+a)/this._worldSize)},this._dirty=true;}tileMatrix(e,t){this._ensure();let o=e.bounds(),r=(o.maxX-o.minX)*this._worldSize/t,n=this._tileMatrix;return Ie(n,this._projMatrix,o.minX*this._worldSize,o.minY*this._worldSize,0),Le(n,n,r,r,1),He(this._f32,n)}tileMatrix64(e,t,o=N()){this._ensure();let r=e.bounds(),n=(r.maxX-r.minX)*this._worldSize/t;return Ie(o,this._projMatrix,r.minX*this._worldSize,r.minY*this._worldSize,0),Le(o,o,n,n,1),o}objectMatrix(e,t,o=0){this._ensure();let r=this._objectMatrix;return Ie(r,this._projMatrix,e*this._worldSize,t*this._worldSize,o),Le(r,r,this._worldSize,this._worldSize,1),He(this._objectF32,r)}horizonScreenY(){this._ensure();let e=Math.PI/2-$e(this._pitch),o=this.height/2/Math.tan(this._fov/2)*Math.tan(Math.min(e,$e(89.5)));return this.height/2-Math.min(o,this.height*50)}get globeActive(){return this._ensure(),this.projection==="globe"&&this._zoom<Ze}get globeFlatMix(){return this._ensure(),uo(this._zoom)}get globeRadiusPx(){return this._ensure(),fo(this._worldSize)}get globeBasis(){return this._ensure(),this._globeBasis}get localProjMatrix(){return this._ensure(),this._localProj}globeCamera(){this._ensure();let e=this.globeRadiusPx,t=N();if(!Fe(t,this._localView))return {dir:[0,0,1],horizonCos:1};let o=t[12],r=t[13],n=t[14]+e,a=Math.hypot(o,r,n)||1;return {dir:[o/a,r/a,n/a],horizonCos:e/Math.max(a,e+1e-6)}}localRayCorners(){this._ensure();let e=this.width,t=this.height;return [[0,0],[e,0],[0,t],[e,t]].map(([r,n])=>{let a=[0,0,0,0],l=[0,0,0,0];ce(a,this._localPixelInverse,[r,n,0,1]),ce(l,this._localPixelInverse,[r,n,1,1]);let s=a[3]||1e-9,c=l[3]||1e-9,f=l[0]/c-a[0]/s,u=l[1]/c-a[1]/s,h=l[2]/c-a[2]/s,m=Math.hypot(f,u,h)||1;return [f/m,u/m,h/m]})}globeDisc(){this._ensure();let e=this.globeCamera();return {dir:[-e.dir[0],-e.dir[1],-e.dir[2]],angle:Math.asin(Math.min(e.horizonCos,1))}}localMatrix(){return this._ensure(),He(this._localF32,this._localProj)}globeLocal(e,t){return this._ensure(),In(e,t,this._centerX/this._worldSize,this._centerY/this._worldSize,this.globeRadiusPx,this._worldSize,this._globeBasis,uo(this._zoom))}localToPoint(e){this._ensure();let t=[0,0,0,0];return ce(t,this._localPixel,[e[0],e[1],e[2],1]),t[3]<=1e-6?null:{x:t[0]/t[3],y:t[1]/t[3]}}globeUnproject(e){this._ensure();let t=[0,0,0,0],o=[0,0,0,0];ce(t,this._localPixelInverse,[e.x,e.y,0,1]),ce(o,this._localPixelInverse,[e.x,e.y,1,1]);let r=t[3]||1e-9,n=o[3]||1e-9,a=this.globeRadiusPx,l=[t[0]/r,t[1]/r,t[2]/r+a],s=[o[0]/n-l[0],o[1]/n-l[1],o[2]/n+a-l[2]],c=Math.hypot(s[0],s[1],s[2])||1,f=[s[0]/c,s[1]/c,s[2]/c],u=Jo(l,f,a);if(!u)return null;let h=this._globeBasis,m=[u[0]/a,u[1]/a,u[2]/a],d=[m[0]*h.east[0]+m[1]*h.south[0]+m[2]*h.up[0],m[0]*h.east[1]+m[1]*h.south[1]+m[2]*h.up[1],m[0]*h.east[2]+m[1]*h.south[2]+m[2]*h.up[2]];return Zo(d)}isOnGlobeFront(e,t,o=.06){this._ensure();let r=this.globeCamera(),n=this._globeBasis,a=ho(e,t),l=[a[0]*n.east[0]+a[1]*n.east[1]+a[2]*n.east[2],a[0]*n.south[0]+a[1]*n.south[1]+a[2]*n.south[2],a[0]*n.up[0]+a[1]*n.up[1]+a[2]*n.up[2]];return l[0]*r.dir[0]+l[1]*r.dir[1]+l[2]*r.dir[2]>=r.horizonCos-o}updateShadow(e,t){this._ensure();let o=Math.max(this.width,this.height)*ml,r=N();if(!Fe(r,this._viewProjPx))return;let n=this._cameraPosPx,a=[],l=[0,0,0,0];for(let C of [-1,1])for(let S of [-1,1])for(let M of [-1,1]){if(ce(l,r,[C,S,M,1]),l[3]===0)continue;let w=l[0]/l[3],_=l[1]/l[3],T=w-n[0],L=_-n[1],E=Math.hypot(T,L);if(E>o){let z=o/E;w=n[0]+T*z,_=n[1]+L*z;}a.push({x:w,y:_,z:0});}if(!a.length)return;let s=so(e),c=Math.abs(s[2])>.999?[0,1,0]:[0,0,1],f=this._shadowView;An(f,[this._centerX,this._centerY,0],[this._centerX+s[0],this._centerY+s[1],s[2]],c);let u=Math.min(t*this._pixelsPerMeter,o),h=1/0,m=1/0,d=1/0,p=-1/0,y=-1/0,b=-1/0,g=[0,0,0,0];for(let C of a)for(let S of [0,u])ce(g,f,[C.x,C.y,S,1]),g[0]<h&&(h=g[0]),g[0]>p&&(p=g[0]),g[1]<m&&(m=g[1]),g[1]>y&&(y=g[1]),g[2]<d&&(d=g[2]),g[2]>b&&(b=g[2]);let v=u+1,x=this._shadowProj;En(x,h,p,m,y,-b-v,-d+v),xe(this._shadowVP,x,f),Le(this._shadowVPm,this._shadowVP,1,1,this._pixelsPerMeter),this._shadowValid=true;}get shadowReady(){return this._shadowValid}shadowObjectMatrix(e,t,o=0){this._ensure();let r=this._shadowObject;return Ie(r,this._shadowVPm,e*this._worldSize,t*this._worldSize,o),Le(r,r,this._worldSize,this._worldSize,1),He(this._shadowObject32,r)}shadowTileMatrix(e,t){this._ensure();let o=e.bounds(),r=(o.maxX-o.minX)*this._worldSize/t,n=this._shadowTile;return Ie(n,this._shadowVPm,o.minX*this._worldSize,o.minY*this._worldSize,0),Le(n,n,r,r,1),He(this._shadowTile32,n)}shadowDepthPerMeter(){return this._ensure(),Math.abs(this._shadowVPm[10])}shadowTexelWorldSize(e){return 2/(this._shadowVP[0]*e||1)}isTileVisible(e){this._ensure();let t=e.bounds(),o=t.minX*this._worldSize,r=t.maxX*this._worldSize,n=t.minY*this._worldSize,a=t.maxY*this._worldSize,l=Fn*this._pixelsPerMeter;for(let s of this._frustumPlanes){let c=s[0]>0?r:o,f=s[1]>0?a:n,u=s[2]>0?l:0;if(s[0]*c+s[1]*f+s[2]*u+s[3]<0)return false}return true}isSphereVisible(e,t,o,r){this._ensure();let n=e*this._worldSize,a=t*this._worldSize,l=o*this._pixelsPerMeter,s=r*this._pixelsPerMeter;for(let c of this._frustumPlanes)if(c[0]*n+c[1]*a+c[2]*l+c[3]<-s)return false;return true}distanceToTile(e){this._ensure();let t=e.bounds(),[o,r,n]=this._cameraPosPx,a=Math.max(t.minX*this._worldSize-o,0,o-t.maxX*this._worldSize),l=Math.max(t.minY*this._worldSize-r,0,r-t.maxY*this._worldSize),s=Math.max(0-n,0,n-Fn*this._pixelsPerMeter);return Math.hypot(a,l,s)}get flatFarDistance(){return this._ensure(),Math.hypot(this._cameraToCenterDistance,this.width/2,this.height/2)}detailZoom(e){return this._ensure(),this._zoom-Math.max(0,Math.log2(Math.max(e,1)/this.flatFarDistance))}_ensure(){this._dirty&&this._calc();}_calc(){this._dirty=false;let e=Ge(this._zoom);this._worldSize=e,this._pixelsPerMeter=jo(1,this._center.lat)*e,this._centerX=re(this._center.lng)*e,this._centerY=ne(this._center.lat)*e;let t=Math.max(this.width,1),o=Math.max(this.height,1),r=$e(this._pitch),n=-$e(this._bearing),a=.5/Math.tan(this._fov/2)*o;this._cameraToCenterDistance=a;let l=Math.PI/2+r,s=this._fov/2,c=Math.sin(s)*a/Math.sin(we(Math.PI-l-s,.01,Math.PI-.01)),f=Math.cos(Math.PI/2-r)*c+a,u=Math.min(f*1.01,a*30),h=o/50;if(this.projection==="globe"&&this._zoom<Ze){let g=fo(e);h=Math.max(a-g*1.6,a*.02),u=a+g*2.4;}let m=this._viewMatrix;Le(m,N(),1,-1,1),Ie(m,m,0,0,-a),$o(m,m,r),qo(m,m,n),Ie(m,m,-this._centerX,-this._centerY,0);let d=N();kn(d,this._fov,t/o,h,u),xe(this._viewProjPx,d,m);let p=N();Le(p,m,1,1,this._pixelsPerMeter),xe(this._projMatrix,d,p);let y=this._localView;Le(y,N(),1,-1,1),Ie(y,y,0,0,-a),$o(y,y,r),qo(y,y,n),xe(this._localProj,d,y),this._globeBasis=Qo(this._center.lng,this._center.lat);let b=N();Le(b,N(),t/2,-o/2,1),Ie(b,b,1,-1,0),xe(this._pixelMatrix,b,this._projMatrix),Fe(this._pixelMatrixInverse,this._pixelMatrix)||console.warn("[osmgl] \u043C\u0430\u0442\u0440\u0438\u0446\u0430 \u043A\u0430\u043C\u0435\u0440\u044B \u0432\u044B\u0440\u043E\u0436\u0434\u0435\u043D\u0430, unproject \u0434\u0430\u0441\u0442 \u043C\u0443\u0441\u043E\u0440"),xe(this._localPixel,b,this._localProj),Fe(this._localPixelInverse,this._localPixel),this._calcCameraPosition(),this._calcFrustum();}_calcCameraPosition(){let e=N();if(!Fe(e,this._viewMatrix)){this._cameraPosPx=[this._centerX,this._centerY,this._cameraToCenterDistance];return}this._cameraPosPx=[e[12],e[13],e[14]];}_calcFrustum(){let e=N();if(!Fe(e,this._viewProjPx)){this._frustumPlanes=[];return}let t=[];for(let l of [-1,1])for(let s of [-1,1])for(let c of [-1,1]){let f=[0,0,0,0];ce(f,e,[c,s,l,1]);let u=f[3]||1e-9;t.push([f[0]/u,f[1]/u,f[2]/u]);}let o=[[0,1,2],[6,5,4],[0,2,4],[5,3,1],[0,4,1],[3,6,2]];this._frustumPlanes=o.map(([l,s,c])=>{let f=t[l],u=t[s],h=t[c],m=u[0]-f[0],d=u[1]-f[1],p=u[2]-f[2],y=h[0]-f[0],b=h[1]-f[1],g=h[2]-f[2],v=d*g-p*b,x=p*y-m*g,C=m*b-d*y,S=Math.hypot(v,x,C)||1;v/=S,x/=S,C/=S;let M=new Float64Array(4);return M[0]=v,M[1]=x,M[2]=C,M[3]=-(v*f[0]+x*f[1]+C*f[2]),M});let r=0,n=0,a=0;for(let l of t)r+=l[0]/8,n+=l[1]/8,a+=l[2]/8;for(let l of this._frustumPlanes)l[0]*r+l[1]*n+l[2]*a+l[3]<0&&(l[0]=-l[0],l[1]=-l[1],l[2]=-l[2],l[3]=-l[3]);}tileScreenSize(e,t){return this._ensure(),this._worldSize/Math.pow(2,e)*this._cameraToCenterDistance/Math.max(t,1e-6)}visibleWrapRange(){this._ensure();let e=[this.pointToWorldPx({x:0,y:this.height}),this.pointToWorldPx({x:this.width,y:this.height}),this.pointToWorldPx({x:0,y:0}),this.pointToWorldPx({x:this.width,y:0})],t=1/0,o=-1/0;for(let r of e){let n=Math.floor(r.x/this._worldSize);n<t&&(t=n),n>o&&(o=n);}return !isFinite(t)||!isFinite(o)?{min:0,max:0}:{min:we(t,-3,3),max:we(o,-3,3)}}};var bl={dragPan:true,scrollZoom:true,dragRotate:true,touchZoomRotate:true,touchPitch:true,doubleClickZoom:true,keyboard:true,inertia:1},zn=2,yl=100,gl=.5,vl=.1,wl=25,Pn=i=>Math.abs(i.y)>Math.abs(i.x);function On(i,e,t){let o=Math.hypot(i.x,i.y)>=zn,r=Math.hypot(e.x,e.y)>=zn;return !o&&!r?void 0:!o||!r?t<yl?void 0:false:i.y>0==e.y>0&&Pn(i)&&Pn(e)}function Hn(i,e){let t=(i-e)*(180/Math.PI);for(;t>180;)t-=360;for(;t<=-180;)t+=360;return t}var xl=160,er=4,mo=class{constructor(e,t,o,r,n={}){this.canvas=e;this.tr=t;this.onChange=o;this.onInteractionEnd=r;this.pointers=new B;this.dragMode="none";this.lastPoint={x:0,y:0};this.panAnchor=null;this.samples=[];this.inertiaRaf=0;this.touch=null;this.lastTapTime=0;this.disposed=false;this.onContextMenu=e=>{this.opts.dragRotate&&e.preventDefault();};this.onPointerDown=e=>{this.stopInertia(),this.canvas.setPointerCapture(e.pointerId),this.pointers.set(e.pointerId,this.point(e));let t=this.point(e);if(this.pointers.size===2){this.beginTouchGesture();return}if(this.pointers.size>2)return;(e.button===2||e.ctrlKey||e.metaKey)&&this.opts.dragRotate?this.dragMode="rotate":this.opts.dragPan&&(this.dragMode="pan",this.panAnchor=this.tr.unproject(t)),this.lastPoint=t,this.samples=[{t:performance.now(),x:t.x,y:t.y}],this.opts.keyboard&&this.canvas.focus({preventScroll:true});};this.onPointerMove=e=>{if(!this.pointers.has(e.pointerId))return;let t=this.point(e);if(this.pointers.set(e.pointerId,t),this.pointers.size>=2){this.updateTouchGesture();return}let o=t.x-this.lastPoint.x,r=t.y-this.lastPoint.y;this.lastPoint=t,this.pushSample(t),this.dragMode==="pan"&&this.panAnchor?(this.tr.setLocationAtPoint(this.panAnchor,t),this.onChange("pan")):this.dragMode==="rotate"&&(this.tr.bearing=this.tr.bearing-o*.4,this.tr.pitch=this.tr.pitch-r*.4,this.onChange("rotate"));};this.onPointerUp=e=>{if(this.pointers.has(e.pointerId)){if(this.pointers.delete(e.pointerId),this.canvas.hasPointerCapture(e.pointerId)&&this.canvas.releasePointerCapture(e.pointerId),this.pointers.size===1){let t=[...this.pointers.values()][0];this.touch=null,this.lastPoint=t,this.samples=[{t:performance.now(),x:t.x,y:t.y}],this.dragMode=this.opts.dragPan?"pan":"none",this.panAnchor=this.opts.dragPan?this.tr.unproject(t):null;return}if(this.pointers.size>0){this.pointers.size>=2&&this.beginTouchGesture();return}if(this.touch=null,this.dragMode==="pan"&&this.opts.inertia>0&&this.startInertia(),this.dragMode="none",this.panAnchor=null,this.opts.doubleClickZoom&&e.pointerType!=="touch"){let t=performance.now();t-this.lastTapTime<300?(this.zoomAround(this.point(e),e.shiftKey?-1:1),this.lastTapTime=0):this.lastTapTime=t;}this.onInteractionEnd();}};this.onWheel=e=>{if(!this.opts.scrollZoom)return;e.preventDefault(),this.stopInertia();let t=e.deltaY;e.deltaMode===1?t*=40:e.deltaMode===2&&(t*=800);let o=we(-t/200,-2,2);this.zoomAround(this.point(e),o),this.onInteractionEnd();};this.onKeyDown=e=>{if(!this.opts.keyboard)return;let t=e.shiftKey?200:80,o={x:this.tr.width/2,y:this.tr.height/2},r=true;switch(e.key){case "ArrowLeft":e.shiftKey?this.rotateBy(-15,0):this.panBy(-t,0,o);break;case "ArrowRight":e.shiftKey?this.rotateBy(15,0):this.panBy(t,0,o);break;case "ArrowUp":e.shiftKey?this.rotateBy(0,10):this.panBy(0,-t,o);break;case "ArrowDown":e.shiftKey?this.rotateBy(0,-10):this.panBy(0,t,o);break;case "=":case "+":this.zoomAround(o,1);break;case "-":case "_":this.zoomAround(o,-1);break;default:r=false;}r&&(e.preventDefault(),this.onInteractionEnd());};this.opts={...bl,...n},this.bind();}setOptions(e){this.opts={...this.opts,...e};}bind(){let e=this.canvas;e.addEventListener("pointerdown",this.onPointerDown),e.addEventListener("pointermove",this.onPointerMove),e.addEventListener("pointerup",this.onPointerUp),e.addEventListener("pointercancel",this.onPointerUp),e.addEventListener("wheel",this.onWheel,{passive:false}),e.addEventListener("contextmenu",this.onContextMenu),e.addEventListener("keydown",this.onKeyDown),e.hasAttribute("tabindex")||e.setAttribute("tabindex","0"),e.style.touchAction="none";}point(e){let t=this.canvas.getBoundingClientRect();return {x:e.clientX-t.left,y:e.clientY-t.top}}beginTouchGesture(){let[e,t]=[...this.pointers.values()],o=t.x-e.x,r=t.y-e.y,n=Math.hypot(o,r);this.touch={mode:void 0,lastA:e,lastB:t,startA:e,startB:t,startDist:n,startAngle:Math.atan2(r,o),minDist:n,zoomActive:false,rotateActive:false,firstMoveAt:0,pitchPossible:Math.abs(o)>=Math.abs(r)},this.dragMode="none",this.panAnchor=null;}updateTouchGesture(){let e=this.touch;if(!e)return;let[t,o]=[...this.pointers.values()],r={x:t.x-e.lastA.x,y:t.y-e.lastA.y},n={x:o.x-e.lastB.x,y:o.y-e.lastB.y};if(e.mode===void 0){!e.firstMoveAt&&(Math.hypot(r.x,r.y)>0||Math.hypot(n.x,n.y)>0)&&(e.firstMoveAt=performance.now());let a=e.pitchPossible&&this.opts.touchPitch?On(r,n,e.firstMoveAt?performance.now()-e.firstMoveAt:0):false;if(a===void 0)return;e.mode=a?"pitch":"zoomRotate";}if(e.mode==="pitch"){let a=(r.y+n.y)/2;a!==0&&(this.tr.pitch=this.tr.pitch-a*gl,this.onChange("pitch"));}else this.opts.touchZoomRotate&&this.applyZoomRotate(e,t,o);e.lastA=t,e.lastB=o;}applyZoomRotate(e,t,o){let r=Math.hypot(o.x-t.x,o.y-t.y),n=Math.atan2(o.y-t.y,o.x-t.x),a={x:(e.lastA.x+e.lastB.x)/2,y:(e.lastA.y+e.lastB.y)/2},l={x:(t.x+o.x)/2,y:(t.y+o.y)/2},s=this.tr.unproject(a),c="pan",f=Math.hypot(e.lastB.x-e.lastA.x,e.lastB.y-e.lastA.y);if(r>0&&f>0&&e.startDist>0&&(!e.zoomActive&&Math.abs(Math.log2(r/e.startDist))>=vl&&(e.zoomActive=true),e.zoomActive)){let u=Math.log2(r/f);u!==0&&(this.tr.zoom=this.tr.zoom+u,c="zoom");}if(this.opts.dragRotate){e.minDist=Math.min(e.minDist,r);let u=wl/Math.max(Math.PI*e.minDist,1)*360;if(!e.rotateActive&&Math.abs(Hn(n,e.startAngle))>=u&&(e.rotateActive=true),e.rotateActive){let h=Math.atan2(e.lastB.y-e.lastA.y,e.lastB.x-e.lastA.x),m=Hn(n,h);m!==0&&(this.tr.bearing=this.tr.bearing-m,c==="pan"&&(c="rotate"));}}this.tr.setLocationAtPoint(s,l),this.onChange(c);}zoomAround(e,t){let o=this.tr.unproject(e);this.tr.zoom=this.tr.zoom+t,this.tr.setLocationAtPoint(o,e),this.onChange("zoom");}panBy(e,t,o){let r=this.tr.unproject(o);this.tr.setLocationAtPoint(r,{x:o.x-e,y:o.y-t}),this.onChange("pan");}rotateBy(e,t){e&&(this.tr.bearing=this.tr.bearing+e),t&&(this.tr.pitch=this.tr.pitch+t),this.onChange("rotate");}pushSample(e){let t=performance.now();for(this.samples.push({t,x:e.x,y:e.y});this.samples.length>2&&t-this.samples[0].t>xl;)this.samples.shift();}startInertia(){if(this.samples.length<2)return;let e=this.samples[0],t=this.samples[this.samples.length-1],o=t.t-e.t;if(o<8||performance.now()-t.t>60)return;let r=(t.x-e.x)/o*this.opts.inertia,n=(t.y-e.y)/o*this.opts.inertia,a=Math.hypot(r,n);if(a<.05)return;a>er&&(r=r/a*er,n=n/a*er);let l=performance.now(),s=()=>{if(this.disposed)return;let c=performance.now(),f=Math.min(c-l,34);l=c;let u=Math.exp(-25e-4*f*10);if(r*=u,n*=u,Math.hypot(r,n)<.01){this.inertiaRaf=0,this.onInteractionEnd();return}let h={x:this.tr.width/2,y:this.tr.height/2};this.panBy(-r*f,-n*f,h),this.inertiaRaf=requestAnimationFrame(s);};this.inertiaRaf=requestAnimationFrame(s);}stopInertia(){this.inertiaRaf&&cancelAnimationFrame(this.inertiaRaf),this.inertiaRaf=0;}destroy(){this.disposed=true,this.stopInertia();let e=this.canvas;e.removeEventListener("pointerdown",this.onPointerDown),e.removeEventListener("pointermove",this.onPointerMove),e.removeEventListener("pointerup",this.onPointerUp),e.removeEventListener("pointercancel",this.onPointerUp),e.removeEventListener("wheel",this.onWheel),e.removeEventListener("contextmenu",this.onContextMenu),e.removeEventListener("keydown",this.onKeyDown),this.pointers.clear();}};var ye=class{constructor(e,t,o,r=false){this.ctx=e;this.layout=o;let n=e.gl,a=n.createBuffer();if(!a)throw new Error("[osmgl] createBuffer \u0432\u0435\u0440\u043D\u0443\u043B null");this.buffer=a,e.bindVAO(null),n.bindBuffer(n.ARRAY_BUFFER,a),n.bufferData(n.ARRAY_BUFFER,t,r?n.DYNAMIC_DRAW:n.STATIC_DRAW),this.byteLength=t.byteLength;}update(e,t=0){let o=this.ctx.gl;o.bindBuffer(o.ARRAY_BUFFER,this.buffer),o.bufferSubData(o.ARRAY_BUFFER,t,e);}destroy(){this.ctx.gl.deleteBuffer(this.buffer);}},de=class{constructor(e,t){this.ctx=e;let o=e.gl,r=o.createBuffer();if(!r)throw new Error("[osmgl] createBuffer \u0432\u0435\u0440\u043D\u0443\u043B null");this.buffer=r,e.bindVAO(null),o.bindBuffer(o.ELEMENT_ARRAY_BUFFER,r),o.bufferData(o.ELEMENT_ARRAY_BUFFER,t,o.STATIC_DRAW),this.count=t.length,this.type=t instanceof Uint32Array?o.UNSIGNED_INT:o.UNSIGNED_SHORT;}destroy(){this.ctx.gl.deleteBuffer(this.buffer);}},fe=class{constructor(e,t,o){this.ctx=e;let r=e.gl,n=r.createVertexArray();if(!n)throw new Error("[osmgl] createVertexArray \u0432\u0435\u0440\u043D\u0443\u043B null");this.vao=n,e.bindVAO(n);for(let{buffer:a,locations:l}of t){r.bindBuffer(r.ARRAY_BUFFER,a.buffer);for(let s of a.layout.attribs){let c=l.get(s.name);c===void 0||c<0||(r.enableVertexAttribArray(c),s.integer?r.vertexAttribIPointer(c,s.size,s.type,a.layout.stride,s.offset):r.vertexAttribPointer(c,s.size,s.type,s.normalized??false,a.layout.stride,s.offset),s.divisor&&r.vertexAttribDivisor(c,s.divisor));}}o&&r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,o.buffer),e.bindVAO(null);}bind(){this.ctx.bindVAO(this.vao);}destroy(){this.ctx.gl.deleteVertexArray(this.vao);}};var Cl=["a_pos","a_height","a_tint","a_ao","a_normal","a_kind","a_level","a_wall","a_p0","a_p1","a_corner","a_width","a_dist","a_tex"],me=class{constructor(e,t,o,r,n={}){this.ctx=e;this.name=t;this.uniforms=new B;this.attribs=new B;let a=e.gl,l=Sl(n),s=Bn(a,a.VERTEX_SHADER,Wn(o,l),`${t}.vert`),c=Bn(a,a.FRAGMENT_SHADER,Wn(r,l),`${t}.frag`),f=a.createProgram();if(!f)throw new Error(`[osmgl] \u043D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u0441\u043E\u0437\u0434\u0430\u0442\u044C \u043F\u0440\u043E\u0433\u0440\u0430\u043C\u043C\u0443 ${t}`);if(a.attachShader(f,s),a.attachShader(f,c),Cl.forEach((u,h)=>a.bindAttribLocation(f,h,u)),a.linkProgram(f),a.detachShader(f,s),a.detachShader(f,c),a.deleteShader(s),a.deleteShader(c),!a.getProgramParameter(f,a.LINK_STATUS)){let u=a.getProgramInfoLog(f);throw a.deleteProgram(f),new Error(`[osmgl] \u043B\u0438\u043D\u043A\u043E\u0432\u043A\u0430 ${t} \u043D\u0435 \u043F\u0440\u043E\u0448\u043B\u0430: ${u}`)}this.program=f,this.cacheLocations();}cacheLocations(){let e=this.ctx.gl,t=e.getProgramParameter(this.program,e.ACTIVE_UNIFORMS);for(let r=0;r<t;r++){let n=e.getActiveUniform(this.program,r);if(!n)continue;let a=n.name.replace(/\[0\]$/,"");this.uniforms.set(a,e.getUniformLocation(this.program,n.name));}let o=e.getProgramParameter(this.program,e.ACTIVE_ATTRIBUTES);for(let r=0;r<o;r++){let n=e.getActiveAttrib(this.program,r);n&&this.attribs.set(n.name,e.getAttribLocation(this.program,n.name));}}use(){this.ctx.useProgram(this.program);}attribLocation(e){return this.attribs.get(e)??-1}loc(e){return this.uniforms.get(e)??null}setMat4(e,t){let o=this.loc(e);o&&this.ctx.gl.uniformMatrix4fv(o,false,t);}setMat3(e,t){let o=this.loc(e);o&&this.ctx.gl.uniformMatrix3fv(o,false,t);}setFloat(e,t){let o=this.loc(e);o&&this.ctx.gl.uniform1f(o,t);}setInt(e,t){let o=this.loc(e);o&&this.ctx.gl.uniform1i(o,t);}setVec2(e,t,o){let r=this.loc(e);r&&this.ctx.gl.uniform2f(r,t,o);}setVec3(e,t,o,r){let n=this.loc(e);n&&this.ctx.gl.uniform3f(n,t,o,r);}setVec4(e,t,o,r,n){let a=this.loc(e);a&&this.ctx.gl.uniform4f(a,t,o,r,n);}setVec4v(e,t){let o=this.loc(e);o&&this.ctx.gl.uniform4f(o,t[0],t[1],t[2],t[3]);}setVec4Array(e,t){let o=this.loc(e)??this.loc(`${e}[0]`);o&&this.ctx.gl.uniform4fv(o,t);}destroy(){this.ctx.gl.deleteProgram(this.program),this.uniforms.clear(),this.attribs.clear();}};function Sl(i){let e=[];for(let[t,o]of Object.entries(i))o!==false&&e.push(o===true?`#define ${t}`:`#define ${t} ${o}`);return e.join(`
|
|
2
|
+
`)}function Wn(i,e){if(!e)return i;let t=i.match(/^\s*#version[^\n]*\n/);return t?i.slice(0,t[0].length)+e+`
|
|
3
3
|
`+i.slice(t[0].length):`${e}
|
|
4
|
-
${i}`}function
|
|
4
|
+
${i}`}function Bn(i,e,t,o){let r=i.createShader(e);if(!r)throw new Error(`[osmgl] \u043D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u0441\u043E\u0437\u0434\u0430\u0442\u044C \u0448\u0435\u0439\u0434\u0435\u0440 ${o}`);if(i.shaderSource(r,t),i.compileShader(r),!i.getShaderParameter(r,i.COMPILE_STATUS)){let n=i.getShaderInfoLog(r)??"";throw i.deleteShader(r),new Error(`[osmgl] \u043A\u043E\u043C\u043F\u0438\u043B\u044F\u0446\u0438\u044F ${o} \u043D\u0435 \u043F\u0440\u043E\u0448\u043B\u0430:
|
|
5
5
|
${n}
|
|
6
|
-
${
|
|
6
|
+
${Ml(t)}`)}return r}function Ml(i){return i.split(`
|
|
7
7
|
`).map((e,t)=>`${String(t+1).padStart(4)} | ${e}`).join(`
|
|
8
|
-
`)}var Tt=(r=>(r[r.Unknown=0]="Unknown",r[r.Point=1]="Point",r[r.LineString=2]="LineString",r[r.Polygon=3]="Polygon",r))(Tt||{}),ho=class i{constructor(e,t,o,r){this.pbf=e;this.keys=t;this.values=o;this.extent=r;this.type=0;this.properties={};this.geomOffset=-1;}static read(e,t,o,r,n){let a=new i(e,o,r,n);return e.readFields(yl,a,t),a}loadGeometry(){if(this.geomOffset<0)return [];let e=this.pbf,t=e.pos;e.pos=this.geomOffset;let o=e.readVarint()+e.pos,r=1,n=0,a=0,l=0,s=[],c=[];for(;e.pos<o;){if(n<=0){let f=e.readVarint();r=f&7,n=f>>3;}if(n--,r===1||r===2)a+=e.readSVarint(),l+=e.readSVarint(),r===1&&(c.length&&s.push(c),c=[]),c.push(a,l);else if(r===7)c.length>=2&&c.push(c[0],c[1]);else throw new Error(`[osmgl] \u043D\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043D\u0430\u044F \u043A\u043E\u043C\u0430\u043D\u0434\u0430 \u0433\u0435\u043E\u043C\u0435\u0442\u0440\u0438\u0438 MVT: ${r}`)}return c.length&&s.push(c),e.pos=t,s}bbox(){let e=this.loadGeometry(),t=1/0,o=1/0,r=-1/0,n=-1/0;for(let a of e)for(let l=0;l<a.length;l+=2)a[l]<t&&(t=a[l]),a[l]>r&&(r=a[l]),a[l+1]<o&&(o=a[l+1]),a[l+1]>n&&(n=a[l+1]);return [t,o,r,n]}};function yl(i,e,t){t&&(i===1?e.id=t.readVarint():i===2?gl(t,e):i===3?e.type=t.readVarint():i===4&&(e.geomOffset=t.pos,t.skip(2)));}function gl(i,e){let t=i.readVarint()+i.pos;for(;i.pos<t;){let o=e.keys[i.readVarint()],r=e.values[i.readVarint()];o!==void 0&&(e.properties[o]=r);}}var mo=class i{constructor(e){this.pbf=e;this.version=1;this.name="";this.extent=4096;this.featureOffsets=[];this.keys=[];this.values=[];}static read(e,t){let o=new i(e);return e.readFields(vl,o,t),o}get length(){return this.featureOffsets.length}feature(e){let t=this.pbf;t.pos=this.featureOffsets[e];let o=t.readVarint()+t.pos;return ho.read(t,o,this.keys,this.values,this.extent)}*features(){for(let e=0;e<this.featureOffsets.length;e++)yield this.feature(e);}};function vl(i,e,t){t&&(i===15?e.version=t.readVarint():i===1?e.name=t.readString():i===5?e.extent=t.readVarint():i===2?e.featureOffsets.push(t.pos):i===3?e.keys.push(t.readString()):i===4&&e.values.push(wl(t)));}function wl(i){let e=i.readVarint()+i.pos,t=null;for(;i.pos<e;){let o=i.readVarint()>>3;o===1?t=i.readString():o===2?t=i.readFloat():o===3?t=i.readDouble():o===4?t=i.readVarint64():o===5?t=i.readVarint():o===6?t=i.readSVarint():o===7?t=i.readBoolean():i.skip(o);}return t}var Mt=class{constructor(e){this.layers={};new bl__default.default(e instanceof Uint8Array?e:new Uint8Array(e)).readFields((o,r,n)=>{if(o===3&&n){let a=mo.read(n,n.readVarint()+n.pos);a.length&&(this.layers[a.name]=a);}},null);}};function qe(i){let e=[],t=null;for(let o of i){if(o.length<6)continue;let r=xl(o);r!==0&&(r>0?(t&&e.push(t),t={outer:o,holes:[]}):t&&t.holes.push(o));}return t&&e.push(t),e}function xl(i){let e=0;for(let t=0,o=i.length-2;t<i.length;o=t,t+=2)e+=(i[o]-i[t])*(i[t+1]+i[o+1]);return e/2}function V(i,e,t){return i===void 0?t:typeof i=="number"?i:Hn(i.stops,e,(o,r,n)=>o+(r-o)*n,t)}function ke(i,e,t){return i===void 0?t:typeof i=="string"?le(i):Hn(i.stops,e,(o,r,n)=>{let a=le(o),l=le(r);return [a[0]+(l[0]-a[0])*n,a[1]+(l[1]-a[1])*n,a[2]+(l[2]-a[2])*n,a[3]+(l[3]-a[3])*n]},t)}function Hn(i,e,t,o){if(!i.length)return o;if(e<=i[0][0])return t(i[0][1],i[0][1],0);let r=i[i.length-1];if(e>=r[0])return t(r[1],r[1],0);for(let n=1;n<i.length;n++){let[a,l]=i[n];if(e>a)continue;let[s,c]=i[n-1],f=a-s,h=f===0?0:(e-s)/f;return t(c,l,h)}return o}function de(i,e){if(!i)return true;let t=i[0];switch(t){case "all":return i.slice(1).every(o=>de(o,e));case "any":return i.slice(1).some(o=>de(o,e));case "!":return !de(i[1],e);case "has":return e[i[1]]!=null;case "!has":return e[i[1]]==null;case "in":{let o=e[i[1]];return o==null?false:i.slice(2).includes(o)}case "!in":{let o=e[i[1]];return o==null?true:!i.slice(2).includes(o)}default:{let o=e[i[1]],r=i[2];if(o==null)return t==="!=";switch(t){case "==":return o===r;case "!=":return o!==r;case ">":return o>r;case ">=":return o>=r;case "<":return o<r;case "<=":return o<=r;default:return true}}}}var _l=Math.PI/8,Cl=.35,Sl=32,Pn=.25,On=.07;function ze(i,e){let t=e.radius;if(!(t>0))return i;let o=i.length/2-1;if(o<3)return i;let r=Math.max(2,Math.round(e.segments??4)),n=Math.max(e.minCutRatio??Cl,0),a=e.extent,l=[];for(let s=0;s<o;s++){let c=i[s*2],f=i[s*2+1],h=i[(s+o-1)%o*2],u=i[(s+o-1)%o*2+1],d=i[(s+1)%o*2],m=i[(s+1)%o*2+1],y=c-h,p=f-u,b=d-c,g=m-f,v=Math.hypot(y,p),w=Math.hypot(b,g);if(v<1e-6||w<1e-6){l.push(c,f);continue}let S=y/v,_=p/v,M=b/w,x=g/w;if(e.keep?.[s]){l.push(c,f);continue}let C=S*M+_*x;if(C>.985){l.push(c,f);continue}if(a!==void 0&&(Qo(c,f,a)||Qo(h,u,a)||Qo(d,m,a))){l.push(c,f);continue}let T=Math.min(t,v*.4,w*.4);if(T<t*n){l.push(c,f);continue}let E=c-S*T,k=f-_*T,F=c+M*T,L=f+x*T,I=Math.acos(Math.max(-1,Math.min(1,C))),A=Math.min(_l,Math.PI/2/r),R=Math.ceil(I/A-1e-6),P=e.maxChord&&e.maxChord>0?Math.ceil(T/Math.tan(I/2)*I/e.maxChord):0,z=Math.max(1,Math.min(Sl,Math.max(Math.min(r,R),P)));l.push(E,k);for(let O=1;O<z;O++){let N=O/z,W=1-N;l.push(W*W*E+2*W*N*c+N*N*F,W*W*k+2*W*N*f+N*N*L);}l.push(F,L);}return l.length<6?i:(l.push(l[0],l[1]),l)}var Qo=(i,e,t)=>i<=0||e<=0||i>=t||e>=t;function tt(i,e){let t=Wn(i.outer,e);if(!t)return null;let o=[];for(let r of i.holes){let n=Wn(r,e);n&&o.push(n);}return {outer:t,holes:o}}function Wn(i,e){let t=[];for(let o=0;o<i.length-2;o+=2)t.push(i[o],i[o+1]);if(t.length<6)return null;for(let o=0;o<4;o++){let r=t;t=[];let n=r.length/2;if(n===0)return null;for(let a=0;a<n;a++){let l=r[a*2],s=r[a*2+1],c=r[(a+n-1)%n*2],f=r[(a+n-1)%n*2+1],h=Vn(l,s,o,e),u=Vn(c,f,o,e);if(h!==u){let d=Ml(c,f,l,s,o,e);t.push(c+(l-c)*d,f+(s-f)*d);}h&&t.push(l,s);}}return t.length<6?null:(t.push(t[0],t[1]),t)}function Vn(i,e,t,o){return t===0?i>=0:t===1?i<=o:t===2?e>=0:e<=o}function Ml(i,e,t,o,r,n){return r===0?(0-i)/(t-i):r===1?(n-i)/(t-i):r===2?(0-e)/(o-e):(n-e)/(o-e)}function po(i,e,t,o,r){return i===0&&t===0||i===r&&t===r||e===0&&o===0||e===r&&o===r}function Bn(i,e){for(let t=0;t<i.length;t+=2)if(i[t]<=0||i[t]>=e||i[t+1]<=0||i[t+1]>=e)return true;return false}var Me=18,nt=4,jn=65535/nt,Tl=9,Al=1,kl=0,Ll=1,Il=2;var Dn=0,El=1,Gn=2,Fl=3,zl=.47;function tr(i,e,t,o={}){let r=o.metersPerUnit&&o.metersPerUnit>0?o.metersPerUnit:zl,n=Math.max(1024,i.length*48),a=new ArrayBuffer(n*Me),l={verts:new DataView(a),vertsU8:new Uint8Array(a),vertOffset:0,vertexCount:0,indices:[],featureIds:[],ensure:()=>{}};l.ensure=u=>s(u);let s=u=>{if(l.vertexCount+u<=n)return;n=Math.max(n*2,l.vertexCount+u);let d=new ArrayBuffer(n*Me);new Uint8Array(d).set(l.vertsU8.subarray(0,l.vertOffset)),a=d,l.verts=new DataView(d),l.vertsU8=new Uint8Array(d);};for(let u of i.features()){if(u.type!==3||!de(t,u.properties))continue;let d=es(u.properties),m=ts(u.properties,d);if(d<=m)continue;let y=rs(u.properties)??Number(u.id??0),p=Jl(y>>>0),b=Ql(p,u.properties),g=Zl(u.properties,d),v=qe(u.loadGeometry());for(let w of v){let S=tt(w,e);if(!S)continue;let _=Bn(S.outer,e),M=(o.cornerRadius??0)/r,x={radius:M,segments:o.cornerSegments,extent:e,minCutRatio:0},C=M>0?{outer:ze(S.outer,x),holes:S.holes.map(I=>ze(I,x))}:S,T=C.outer.length/2+C.holes.reduce((I,A)=>I+A.length/2,0);s(T*5+32);let E=C.holes.length||_?null:Ol(C.outer),k=E?Nl(u.properties,E,d,p,r):null,F=null,L=[];if(k&&E){let I=Xn(Xl(C.outer,r),E,k.shape);L=Yl(I,C.outer);let A=Kl(I,L);if(A>1e-6){let R=Math.min(Math.max(A*r*Bl,Gl),Dl);F=$l(I,R/A,d);}}Nn(l,C.outer,m,d,y,b,g,r,e,F);for(let I of C.holes)Nn(l,I,m,d,y,b,g,r,e,null);F?ql(l,L,F,d,y,b,g,r):Pl(l,C.outer,C.holes,d,y,b,g);}}if(!l.indices.length)return null;let c=new Uint32Array(l.indices),f=new Float64Array(l.featureIds);return {vertices:a.slice(0,l.vertOffset),indices:c.buffer,featureIds:f.buffer,vertexCount:l.vertexCount,indexCount:c.length,extent:e}}var or=(i,e)=>i|e<<2,Jo=i=>Math.max(0,Math.min(65535,Math.round(Math.min(i,jn)*nt)));function ot(i,e,t,o,r,n,a,l,s,c,f=0,h=0,u=0){let d=i.vertOffset;return i.verts.setInt16(d,Math.round(e),true),i.verts.setInt16(d+2,Math.round(t),true),i.verts.setUint16(d+4,Math.round(Math.min(o,jn)*nt),true),i.vertsU8[d+6]=s,i.vertsU8[d+7]=l,i.verts.setInt8(d+8,er(Math.round(r*127))),i.verts.setInt8(d+9,er(Math.round(n*127))),i.verts.setInt8(d+10,er(Math.round(a*127))),i.vertsU8[d+11]=c,i.verts.setUint16(d+12,Jo(f),true),i.verts.setUint16(d+14,Jo(h),true),i.verts.setUint16(d+16,Jo(u),true),i.vertOffset+=Me,i.vertexCount++}function Nn(i,e,t,o,r,n,a,l,s,c=null){let f=e.length/2;if(f<3)return;let h=or(kl,a),u=Hl(e,l),d=o-t,m=new Float64Array(f*2),y=new Uint8Array(f);{let p=new Float64Array(f*2);for(let b=0;b<f-1;b++){let g=e[b*2+2]-e[b*2],v=e[b*2+3]-e[b*2+1],w=Math.hypot(g,v)||1;p[b*2]=v/w,p[b*2+1]=-g/w;}for(let b=0;b<f-1;b++){let g=(b+f-2)%(f-1),v=p[g*2]*p[b*2]+p[g*2+1]*p[b*2+1],w=p[g*2]+p[b*2],S=p[g*2+1]+p[b*2+1],_=Math.hypot(w,S);v>.5&&_>1e-6&&(m[b*2]=w/_,m[b*2+1]=S/_,y[b]=1);}}for(let p=0;p<f-1;p++){let b=e[p*2],g=e[p*2+1],v=e[p*2+2],w=e[p*2+3];if(b===v&&g===w||po(b,g,v,w,s))continue;let S=v-b,_=w-g,M=Math.hypot(S,_)||1,x=_/M,C=-S/M,T=u.offset[p],E=u.width[p],k=[0,1];if(c){for(let L=0;L<c.length;L++)for(let I=L+1;I<c.length;I++){let A=Ze(c[L],b,g)-Ze(c[I],b,g),R=Ze(c[L],v,w)-Ze(c[I],v,w);if(A===R)continue;let P=A/(A-R);P>1e-4&&P<1-1e-4&&k.push(P);}k.sort((L,I)=>L-I);}let F=(L,I)=>{if(!c)return o;let A=1/0;for(let R of c)A=Math.min(A,Ze(R,L,I));return Math.max(o,A)};for(let L=0;L+1<k.length;L++){let I=k[L],A=k[L+1];if(A-I<1e-6)continue;let R=b+S*I,P=g+_*I,z=b+S*A,O=g+_*A,N=T+M*I*l,W=T+M*A*l,B=(p+1)%(f-1),D=y[p]?m[p*2]:x,K=y[p]?m[p*2+1]:C,$=y[B]?m[B*2]:x,oe=y[B]?m[B*2+1]:C,ye=x+(D-x)*(1-I),J=C+(K-C)*(1-I),X=x+($-x)*A,me=C+(oe-C)*A,pe=Math.hypot(ye,J)||1,Z=Math.hypot(X,me)||1,U=ye/pe,j=J/pe,fe=X/Z,ne=me/Z;i.ensure(4);let ue=ot(i,R,P,t,U,j,0,0,n,h,N,E,d),re=ot(i,z,O,t,fe,ne,0,0,n,h,W,E,d),ge=ot(i,R,P,F(R,P),U,j,0,255,n,h,N,E,d),Ae=ot(i,z,O,F(z,O),fe,ne,0,255,n,h,W,E,d);i.indices.push(ue,Ae,re,ue,ge,Ae),i.featureIds.push(r,r);}}}var Rl=.9976;function Hl(i,e){let t=i.length/2-1,o=[];for(let s=0;s<t;s++){let c=i[s*2+2]-i[s*2],f=i[s*2+3]-i[s*2+1],h=Math.hypot(c,f);o.push(h>0?{x:c/h,y:f/h,len:h*e}:{x:0,y:0,len:0});}let r=(s,c)=>o[s].len>0&&o[c].len>0&&o[s].x*o[c].x+o[s].y*o[c].y>=Rl,n=0;for(;n<t&&r((n-1+t)%t,n);)n++;n>=t&&(n=0);let a=new Array(t).fill(0),l=new Array(t).fill(0);for(let s=0;s<t;){let c=(n+s)%t,f=[c],h=o[c].len,u=s+1;for(;u<t;){let m=(n+u)%t;if(!r((n+u-1)%t,m))break;f.push(m),h+=o[m].len,u++;}let d=0;for(let m of f)a[m]=d,l[m]=h,d+=o[m].len;s=u;}return {offset:a,width:l}}function Pl(i,e,t,o,r,n,a){let l=[],s=[];for(let u=0;u<e.length;u++)l.push(e[u]);for(let u of t){s.push(l.length/2);for(let d=0;d<u.length;d++)l.push(u[d]);}let c=Un__default.default(l,s.length?s:void 0,2);if(!c.length)return;let f=or(Ll,a),h=i.vertexCount;for(let u=0;u<l.length;u+=2)ot(i,l[u],l[u+1],o,0,0,1,255,n,f);for(let u=0;u<c.length;u+=3)i.indices.push(h+c[u],h+c[u+2],h+c[u+1]),i.featureIds.push(r);}function Ol(i){let e=Wl(i);if(e.length<3)return null;let t=Math.abs(Vl(i));if(t<=0)return null;let o=null,r=1/0;for(let n=0;n<e.length;n++){let a=(n+1)%e.length,l=e[a].x-e[n].x,s=e[a].y-e[n].y,c=Math.hypot(l,s);if(c<1e-6)continue;l/=c,s/=c;let f=1/0,h=-1/0,u=1/0,d=-1/0;for(let w of e){let S=w.x*l+w.y*s,_=-w.x*s+w.y*l;S<f&&(f=S),S>h&&(h=S),_<u&&(u=_),_>d&&(d=_);}let m=h-f,y=d-u,p=m*y;if(p<=0||p>=r)continue;r=p;let b=(f+h)/2,g=(u+d)/2,v=m>=y;o={cx:b*l-g*s,cy:b*s+g*l,ax:v?l:-s,ay:v?s:l,halfLong:(v?m:y)/2,halfShort:(v?y:m)/2,fill:t/p};}return o}function Wl(i){let e=[];for(let n=0;n<i.length-2;n+=2)e.push({x:i[n],y:i[n+1]});if(e.length<3)return e;e.sort((n,a)=>n.x===a.x?n.y-a.y:n.x-a.x);let t=(n,a,l)=>(a.x-n.x)*(l.y-n.y)-(a.y-n.y)*(l.x-n.x),o=[];for(let n of e){for(;o.length>=2&&t(o[o.length-2],o[o.length-1],n)<=0;)o.pop();o.push(n);}let r=[];for(let n=e.length-1;n>=0;n--){let a=e[n];for(;r.length>=2&&t(r[r.length-2],r[r.length-1],a)<=0;)r.pop();r.push(a);}return o.pop(),r.pop(),o.concat(r)}function Vl(i){let e=0;for(let t=0;t<i.length-2;t+=2)e+=i[t]*i[t+3]-i[t+2]*i[t+1];return e/2}var Bl=Math.tan(30*Math.PI/180),Dl=3.5,Gl=.9;function Nl(i,e,t,o,r){if(e.fill<.86)return null;let n=e.halfShort*2*r,a=e.halfLong*2*r,l=n*a,s=e.halfShort>0?e.halfLong/e.halfShort:99,c=Ul(i);if(!c){if(t>15||l>600||n<3)return null;let f=o%1e3/1e3;l<30?c=f<.5?"skillion":"gabled":s<1.25?c=f<.35?"pyramidal":"hipped":c=f<.8?"gabled":"hipped";}return c==="flat"?null:{shape:c}}function Ul(i){let e=String(i.roof_shape??i["roof:shape"]??"").toLowerCase();return e?e==="flat"?"flat":e==="skillion"||e==="lean_to"||e==="shed"?"skillion":e==="hipped"||e==="half-hipped"||e==="gambrel"?"hipped":e==="pyramidal"||e==="dome"||e==="conical"||e==="onion"?"pyramidal":e==="gabled"||e==="mansard"||e==="round"?"gabled":null:null}var Ze=(i,e,t)=>i.a*e+i.b*t+i.c;function jl(i,e,t,o){let r=i.length/2;if(r<3)return [];let n=[],a=l=>[i[l*2],i[l*2+1]];for(let l=0;l<r;l++){let[s,c]=a(l),[f,h]=a((l+r-1)%r),u=e*s+t*c+o,d=e*f+t*h+o;if(u<=0!=d<=0){let m=d/(d-u);n.push(f+(s-f)*m,h+(c-h)*m);}u<=0&&n.push(s,c);}return n}function Xl(i,e){let t=.5/Math.max(e,1e-6),o=i.length/2-1;if(o<5)return i;let r=[],n=0;r.push(i[0],i[1]);for(let a=1;a<o;a++){let l=i[n*2],s=i[n*2+1],c=i[a*2],f=i[a*2+1],h=c-l,u=f-s,d=Math.hypot(h,u),m=d>1e-6;if(m){for(let y=n+1;y<a;y++)if(Math.abs((i[y*2]-l)*u-(i[y*2+1]-s)*h)/d>=t){m=false;break}}m||(r.push(i[(a-1)*2],i[(a-1)*2+1]),n=a-1);}return r.length/2<3?i:(r.push(r[0],r[1]),r)}function Xn(i,e,t){let{ax:o,ay:r,halfLong:n}=e;if(t==="skillion"){let s=-r,c=o;return [{a:s,b:c,c:-(s*e.cx+c*e.cy)+e.halfShort}]}let a=[],l=i.length/2-1;for(let s=0;s<l;s++){let c=i[s*2],f=i[s*2+1],h=i[(s+1)%l*2],u=i[(s+1)%l*2+1],d=h-c,m=u-f,y=Math.hypot(d,m);if(y<1e-6||t==="gabled"&&Math.abs((d*o+m*r)/y)<.86)continue;let p=-m/y,b=d/y;a.push({a:p,b,c:-(p*c+b*f)});}return !a.length&&n>0?Xn(i,e,"hipped"):a}function Yl(i,e){let t=[];for(let r=0;r<e.length-2;r+=2)t.push(e[r],e[r+1]);if(t.length<6)return [];let o=[];for(let r=0;r<i.length;r++){let n=t;for(let a=0;a<i.length&&n.length>=6;a++)a!==r&&(n=jl(n,i[r].a-i[a].a,i[r].b-i[a].b,i[r].c-i[a].c));o.push(n.length>=6?n:[]);}return o}function Kl(i,e){let t=0;for(let o=0;o<e.length;o++){let r=e[o];for(let n=0;n<r.length;n+=2){let a=Ze(i[o],r[n],r[n+1]);a>t&&(t=a);}}return t}function $l(i,e,t){return i.map(o=>({a:o.a*e,b:o.b*e,c:o.c*e+t}))}function ql(i,e,t,o,r,n,a,l){let s=or(Il,a);for(let c=0;c<t.length;c++){let f=e[c];if(!f||f.length<6)continue;let h=Un__default.default(f,void 0,2);if(!h.length)continue;let u=-t[c].a/l,d=-t[c].b/l,m=Math.hypot(u,d,1),y={x:u/m,y:d/m,z:1/m};i.ensure(f.length/2);let p=i.vertexCount;for(let b=0;b<f.length;b+=2){let g=Math.max(o,Ze(t[c],f[b],f[b+1]));ot(i,f[b],f[b+1],g,y.x,y.y,y.z,255,n,s);}for(let b=0;b<h.length;b+=3)i.indices.push(p+h[b],p+h[b+2],p+h[b+1]),i.featureIds.push(r);}}function Zl(i,e){let t=String(i.class??"").toLowerCase();return t==="industrial"||t==="warehouse"||t==="hangar"||t==="construction"?Fl:t==="commercial"||t==="office"||t==="retail"||t==="supermarket"?Gn:t==="house"||t==="detached"||t==="garage"||t==="hut"||t==="shed"||e<=7?Dn:e>=40?Gn:El}function Ql(i,e){let t=String(e.class??""),o=128;return t==="industrial"||t==="warehouse"||t==="construction"?o=96:t==="commercial"||t==="office"||t==="retail"?o=150:(t==="apartments"||t==="residential"||t==="house")&&(o=134),Math.max(0,Math.min(255,o+(i%121-60)))}function Jl(i){let e=i>>>0;return e=(e>>>16^e)*73244475,e=(e>>>16^e)*73244475,e=e>>>16^e,e>>>0}function es(i){let e=rt(i.render_height)??rt(i.height)??os(i.levels??i.building_levels??i["building:levels"]);return e&&e>0?Math.max(e,Al):Tl}function ts(i,e){let t=rt(i.render_min_height)??rt(i.min_height)??rt(i.base)??0;return t>0&&t<e?t:0}function os(i){let e=rt(i);return e&&e>0?e*3:null}function rt(i){if(typeof i=="number"&&isFinite(i))return i;if(typeof i=="string"){let e=parseFloat(i);if(isFinite(e))return e}return null}var er=i=>i>127?127:i<-127?-127:i;function rs(i){let e=i.osm_id;if(typeof e=="number"&&Number.isFinite(e))return e;if(typeof e=="string"){let t=Number(e);if(Number.isFinite(t))return t}return null}var it=16,Qn=64,is=0,as=1,Yn=2,ls=3,At=1;function ar(i,e,t,o){let r=o.metersPerUnit>0?o.metersPerUnit:.5,n=o.elevation,a=o.base??0,l=Math.max(o.bevel??0,0)/r,s=Math.max(o.bevelDrop??0,0),c=Math.max(o.cornerRadius??0,0)/r,f=Math.max(512,i.length*24),h=new ArrayBuffer(f*it),u={view:new DataView(h),bytes:new Uint8Array(h),offset:0,count:0,indices:[],extent:e,ensure(w){if(u.count+w<=f)return;f=Math.max(f*2,u.count+w);let S=new ArrayBuffer(f*it);new Uint8Array(S).set(u.bytes.subarray(0,u.offset)),h=S,u.view=new DataView(S),u.bytes=new Uint8Array(S);}},d=[],m=new Map;for(let w of i.features()){if(w.type!==3||!de(t,w.properties))continue;let S=o.liftBy?.(w.properties)??0;for(let _ of qe(w.loadGeometry())){let M=tt(_,e);if(M){d.push(S?{...M,lift:S}:M),Kn(M.outer,m);for(let x of M.holes)Kn(x,m);}}}o.onShapes?.(d);let y=new Set;for(let[w,S]of m)S>1&&y.add(w);let p=[],b={radius:c,segments:o.cornerSegments,extent:e,minCutRatio:0,maxChord:Pn/r};for(let w of d){let S=c>0?{outer:ze(w.outer,{...b,keep:$n(w.outer,y)}),holes:w.holes.map(F=>ze(F,{...b,keep:$n(F,y)}))}:w,_=l>0?Zn(S.outer,l,e,y):S.outer,M=S.holes.map(F=>l>0?Zn(F,-l,e,y):F),x=w.lift??0,C=n+x,T=a+x;qn(u,_??S.outer,M.map((F,L)=>F??S.holes[L]),C);let E=C,k=C-s;_&&l>0&&s>0&&rr(u,_,S.outer,E,k,as,e,y),k!==T&&rr(u,S.outer,S.outer,k,T,Yn,e,y);for(let F of S.holes)if(k!==T&&rr(u,F,F,k,T,Yn,e,y),C<T){let L=u.indices.length;qn(u,F,[],T,ls);for(let I=L;I<u.indices.length;I++)p.push(u.indices[I]);u.indices.length=L;}}if(!u.indices.length&&!p.length)return null;let g=u.indices.length,v=new Uint32Array(g+p.length);return v.set(u.indices,0),v.set(p,g),{vertices:h.slice(0,u.offset),indices:v.buffer,vertexCount:u.count,indexCount:v.length,extent:e,capIndexOffset:g}}function at(i,e,t,o){let r=`${Math.round(i*100)},${Math.round(e*100)}`,n=`${Math.round(t*100)},${Math.round(o*100)}`;return r<n?`${r}|${n}`:`${n}|${r}`}function Kn(i,e){for(let t=0;t+3<i.length;t+=2){let o=at(i[t],i[t+1],i[t+2],i[t+3]);e.set(o,(e.get(o)??0)+1);}}function $n(i,e){if(!e.size)return;let t=i.length/2-1,o=new Array(t).fill(false);for(let r=0;r<t;r++){let n=at(i[(r+t-1)%t*2],i[(r+t-1)%t*2+1],i[r*2],i[r*2+1]),a=at(i[r*2],i[r*2+1],i[(r+1)%t*2],i[(r+1)%t*2+1]);(e.has(n)||e.has(a))&&(o[r]=true);}return o}function kt(i,e,t,o,r,n,a,l){let s=i.offset;return i.view.setFloat32(s,e,true),i.view.setFloat32(s+4,t,true),i.view.setInt16(s+8,ss(Math.round(o*Qn)),true),i.view.setInt8(s+10,ir(Math.round(r*127))),i.view.setInt8(s+11,ir(Math.round(n*127))),i.view.setInt8(s+12,ir(Math.round(a*127))),i.bytes[s+13]=l,i.view.setInt8(s+14,e<=0?-At:e>=i.extent?At:0),i.view.setInt8(s+15,t<=0?-At:t>=i.extent?At:0),i.offset+=it,i.count++}function qn(i,e,t,o,r=is){let n=[],a=[];for(let c=0;c<e.length;c++)n.push(e[c]);for(let c of t){a.push(n.length/2);for(let f=0;f<c.length;f++)n.push(c[f]);}let l=Un__default.default(n,a.length?a:void 0,2);if(!l.length)return;i.ensure(n.length/2);let s=i.count;for(let c=0;c<n.length;c+=2)kt(i,n[c],n[c+1],o,0,0,1,r);for(let c=0;c<l.length;c+=3)i.indices.push(s+l[c],s+l[c+2],s+l[c+1]);}function rr(i,e,t,o,r,n,a,l){let s=Math.min(e.length,t.length)/2;if(!(s<3)){i.ensure((s-1)*4);for(let c=0;c<s-1;c++){let f=t[c*2],h=t[c*2+1],u=t[c*2+2],d=t[c*2+3];if(f===u&&h===d||po(f,h,u,d,a)||l.has(at(f,h,u,d)))continue;let m=u-f,y=d-h,p=Math.hypot(m,y)||1,b=y/p,g=-m/p,v=o-r,w=Math.hypot(e[c*2]-f,e[c*2+1]-h)||0,S=0;if(w>1e-6&&v!==0){let T=1/Math.hypot(1,v/w);S=w/Math.hypot(w,v)*Math.sign(v),b*=T,g*=T;}let _=kt(i,e[c*2],e[c*2+1],o,b,g,S,n),M=kt(i,e[c*2+2],e[c*2+3],o,b,g,S,n),x=kt(i,f,h,r,b,g,S,n),C=kt(i,u,d,r,b,g,S,n);i.indices.push(x,M,C,x,_,M);}}}function Zn(i,e,t,o){let r=i.length/2-1;if(r<3)return null;let n=[];for(let s=0;s<r;s++){let c=i[s*2],f=i[s*2+1],h=i[(s+r-1)%r*2],u=i[(s+r-1)%r*2+1],d=i[(s+1)%r*2],m=i[(s+1)%r*2+1],y=Math.hypot(c-h,f-u)||1,p=Math.hypot(d-c,m-f)||1,b=(f-u)/y,g=-(c-h)/y,v=(m-f)/p,w=-(d-c)/p,S=b+v,_=g+w,M=Math.hypot(S,_);if(M<1e-6){n.push(c,f);continue}S/=M,_/=M;let x=Math.min(1/Math.max(S*b+_*g,.35),3),C=c-S*e*x,T=f-_*e*x,E=at(h,u,c,f),k=at(c,f,d,m);if(o.has(E)||o.has(k)){n.push(c,f);continue}(c<=0||c>=t)&&(C=c),(f<=0||f>=t)&&(T=f),n.push(C,T);}n.push(n[0],n[1]);let a=Math.abs(nr(i)),l=nr(n);if(Math.sign(l)!==Math.sign(nr(i))||Math.abs(l)<a*.25)return null;for(let s=0;s<n.length;s+=2)n[s]=Math.max(0,Math.min(t,n[s])),n[s+1]=Math.max(0,Math.min(t,n[s+1]));return n}function nr(i){let e=0;for(let t=0;t<i.length-2;t+=2)e+=i[t]*i[t+3]-i[t+2]*i[t+1];return e/2}var ir=i=>i>127?127:i<-127?-127:i,ss=i=>i>32767?32767:i<-32768?-32768:i;var De=4;function fs(i,e,t,o,r){let n=o*o,a=[],l=f=>i[f*2],s=f=>i[f*2+1],c=(f,h)=>{let u=i.length/2;return i.push((l(f)+l(h))/2,(s(f)+s(h))/2),u};for(let f=0;f<e.length;f+=3){a.push([t+e[f],t+e[f+1],t+e[f+2]]);let h=0;for(;a.length&&!(++h>2e4);){let[u,d,m]=a.pop(),y=(l(u)-l(d))**2+(s(u)-s(d))**2,p=(l(d)-l(m))**2+(s(d)-s(m))**2,b=(l(m)-l(u))**2+(s(m)-s(u))**2,g=Math.max(y,p,b);if(g<=n){r.push(u,d,m);continue}if(g===y){let v=c(u,d);a.push([u,v,m],[v,d,m]);}else if(g===p){let v=c(d,m);a.push([d,v,u],[v,m,u]);}else {let v=c(m,u);a.push([m,v,d],[v,u,d]);}}}}function lr(i,e,t=0,o,r=false,n=4096){let a=[],l=[],s=[];for(let d of i.features()){if(d.type!==3||!de(e,d.properties))continue;let m=d.properties.osm_id,y=typeof m=="number"?m:typeof m=="string"?Number(m):NaN,p=Number.isFinite(y)?y:Number(d.id??0);for(let b of qe(d.loadGeometry())){let g=r?tt(b,n):b;if(!g)continue;let v=[],w=[],S=o?ze(g.outer,o):g.outer;for(let x=0;x<S.length;x++)v.push(S[x]);for(let x of g.holes){let C=o?ze(x,o):x;w.push(v.length/2);for(let T=0;T<C.length;T++)v.push(C[T]);}let _=Un__default.default(v,w.length?w:void 0,2);if(!_.length)continue;let M=a.length/2;for(let x=0;x<v.length;x++)a.push(v[x]);if(t>0){let x=[];fs(a,_,M,t,x);for(let C=0;C<x.length;C+=3)l.push(x[C],x[C+2],x[C+1]),s.push(p);continue}for(let x=0;x<_.length;x+=3)l.push(M+_[x],M+_[x+2],M+_[x+1]),s.push(p);}}if(!l.length)return null;let c=a.length/2,f=new Int16Array(a),h=new Uint32Array(l);return {featureIds:new Float64Array(s).buffer,vertices:f.buffer,indices:h.buffer,vertexCount:c,indexCount:h.length}}var us=100;function sr(i){return {shapes:[],cells:[],extent:0,metersPerTile:i}}function cr(i,e,t,o){if(!(t<=0)){i.extent=o;for(let r of e){let n=r.outer;if(n.length<6)continue;let a=1/0,l=1/0,s=-1/0,c=-1/0;for(let f=0;f<n.length;f+=2)n[f]<a&&(a=n[f]),n[f]>s&&(s=n[f]),n[f+1]<l&&(l=n[f+1]),n[f+1]>c&&(c=n[f+1]);i.shapes.push({outer:n,holes:r.holes,level:t,minX:a,minY:l,maxX:s,maxY:c});}i.cells=[];}}function ds(i){i.cells=Array.from({length:1024},()=>[]);let e=i.extent/32;for(let t=0;t<i.shapes.length;t++){let o=i.shapes[t],r=lt(Math.floor(o.minX/e)),n=lt(Math.floor(o.maxX/e)),a=lt(Math.floor(o.minY/e)),l=lt(Math.floor(o.maxY/e));for(let s=a;s<=l;s++)for(let c=r;c<=n;c++)i.cells[s*32+c].push(t);}}var ei=i=>i.shapes.length===0;function bo(i,e,t){!i.cells.length&&i.shapes.length&&ds(i);let o=i.extent/32,r=i.cells[lt(Math.floor(t/o))*32+lt(Math.floor(e/o))];if(!r||!r.length)return 0;let n=0;for(let a of r){let l=i.shapes[a];if(l.level<=n||e<l.minX||e>l.maxX||t<l.minY||t>l.maxY||!Jn(l.outer,e,t))continue;let s=false;for(let c of l.holes)if(Jn(c,e,t)){s=true;break}s||(n=l.level);}return Math.min(Math.round(n*100),127)}function fr(i,e){let t=[],o=[],r=i.extent>0?i.metersPerTile/i.extent:0,n=r>0?2/r:0,a=bo(i,e[0],e[1]);t.push(e[0],e[1]),o.push(a);for(let l=0;l+3<e.length;l+=2){let s=e[l],c=e[l+1],f=e[l+2],h=e[l+3],u=bo(i,f,h);if(u!==a&&n>0){let d=Math.hypot(f-s,h-c),m=Math.min(Math.ceil(d/n),64),y=a;for(let p=1;p<m;p++){let b=p/m,g=s+(f-s)*b,v=c+(h-c)*b,w=bo(i,g,v);w!==y&&(t.push(g,v),o.push(w),y=w);}}t.push(f,h),o.push(u),a=u;}return {pts:t,levels:o}}var lt=i=>i<0?0:i>31?31:i;function Jn(i,e,t){let o=false,r=i.length/2;for(let n=0,a=r-1;n<r;a=n++){let l=i[n*2],s=i[n*2+1],c=i[a*2],f=i[a*2+1];s>t!=f>t&&e<(c-l)*(t-s)/(f-s)+l&&(o=!o);}return o}var Ge=20;function ur(i,e,t=0,o){let r=Math.max(256,i.length*24),n=new ArrayBuffer(r*Ge),a=new DataView(n),l=0,s=[],c=d=>{if(l+d<=r)return;r=Math.max(r*2,l+d);let m=new ArrayBuffer(r*Ge);new Uint8Array(m).set(new Uint8Array(n,0,l*Ge)),n=m,a=new DataView(m);},f=(d,m,y,p,b,g,v,w=0,S=0)=>{let _=l*Ge;return a.setInt16(_,d,true),a.setInt16(_+2,m,true),a.setInt16(_+4,y,true),a.setInt16(_+6,p,true),a.setInt8(_+8,b),a.setInt8(_+9,g),a.setInt8(_+10,w),a.setInt8(_+11,S),a.setFloat32(_+12,v,true),a.setFloat32(_+16,h,true),l++},h=0;for(let d of i.features()){if(d.type!==2&&d.type!==3||!de(e,d.properties))continue;let m=d.properties.width;h=typeof m=="number"&&m>.5&&m<100?m:0;let y=d.type===3;for(let p of d.loadGeometry()){let b=t>0?hs(ti(p),t):ti(p);if(b.length<4)continue;let g=o&&!ei(o)?fr(o,b):null,v=g?g.pts:b,w=g?.levels,S=v.length/2;if(S<2)continue;c((S-1)*4);let _=0;for(let M=0;M<S-1;M++){let x=v[M*2],C=v[M*2+1],T=v[M*2+2],E=v[M*2+3],k=Math.hypot(T-x,E-C);if(y&&ps(x,C,T,E,i.extent)){_+=k;continue}let F=ms(x,C,T,E,i.extent);if(!F){_+=k;continue}let[L,I,A,R]=F,P=Math.hypot(L-x,I-C),z=Math.hypot(A-L,R-I),O=Math.hypot(T-A,E-R),N=_+P,W=w?w[M]:0,B=w?w[M+1]:0,D=f(L,I,A,R,0,-1,N,W,B),K=f(L,I,A,R,0,1,N,W,B),$=f(L,I,A,R,1,1,N,W,B),oe=f(L,I,A,R,1,-1,N,W,B);_+=P+z+O,s.push(D,K,$,D,$,oe);}}}if(!s.length)return null;let u=new Uint32Array(s);return {vertices:n.slice(0,l*Ge),indices:u.buffer,vertexCount:l,indexCount:u.length}}function hs(i,e){let t=[];for(let o=0;o+3<i.length;o+=2){let r=i[o],n=i[o+1],a=i[o+2],l=i[o+3];t.push(r,n);let s=Math.min(64,Math.floor(Math.hypot(a-r,l-n)/e));for(let c=1;c<s;c++){let f=c/s;t.push(r+(a-r)*f,n+(l-n)*f);}}return t.push(i[i.length-2],i[i.length-1]),t}function ti(i){let e=[];for(let t=0;t<i.length;t+=2){let o=i[t],r=i[t+1],n=e.length;n>=2&&e[n-2]===o&&e[n-1]===r||e.push(o,r);}return e}function ms(i,e,t,o,r){let n=t-i,a=o-e,l=0,s=1,c=[[-n,i],[n,r-i],[-a,e],[a,r-e]];for(let[f,h]of c){if(f===0){if(h<0)return null;continue}let u=h/f;if(f<0){if(u>s)return null;u>l&&(l=u);}else {if(u<l)return null;u<s&&(s=u);}}return s-l<1e-6?null:[Math.round(i+n*l),Math.round(e+a*l),Math.round(i+n*s),Math.round(e+a*s)]}function ps(i,e,t,o,r){return i===t&&(i<=0||i>=r)?true:e===o&&(e<=0||e>=r)}var dr={enabled:true,skyColor:"#7fb2e5",horizonColor:"#dfe6ee",fogRange:[1.35,7.5],fogIntensity:.92,spaceColor:"#05070f",atmosphereColor:"#79b8f5",starIntensity:.55,horizonBlend:.75},hr={ambientColor:"#ffffff",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#fff4e2",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#dce6f2",fillIntensity:.18};var oi={version:1,name:"OSM 3D \u2014 \u0434\u043D\u0435\u0432\u043D\u043E\u0439",background:"#eceae4",light:{ambientColor:"#ffffff",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#fff4e2",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#dce6f2",fillIntensity:.18},layers:[{id:"landcover-wood",type:"fill","source-layer":"landcover",filter:["in","class","wood","forest"],paint:{color:"#c6dcb4",opacity:{stops:[[8,.5],[12,.85]]},material:"foliage",materialScale:16}},{id:"landcover-grass",type:"fill","source-layer":"landcover",filter:["in","class","grass","farmland","meadow"],paint:{color:"#d9e6c6",opacity:{stops:[[8,.45],[12,.8]]},material:"foliage",materialScale:11}},{id:"landcover-sand",type:"fill","source-layer":"landcover",filter:["in","class","sand","beach"],paint:{color:"#f2e7c8",material:"sand",materialScale:26}},{id:"landcover-ice",type:"fill","source-layer":"landcover",filter:["in","class","ice","glacier"],paint:{color:"#e6f2f7"}},{id:"landcover-wetland",type:"fill","source-layer":"landcover",filter:["in","class","wetland","swamp"],paint:{color:"#cfe0d4",material:"foliage",materialScale:9}},{id:"landuse-residential",type:"fill","source-layer":"landuse",filter:["in","class","residential","suburb","neighbourhood","quarter"],paint:{color:"#e6e2da",opacity:{stops:[[10,.4],[14,.7]]}}},{id:"landuse-industrial",type:"fill","source-layer":"landuse",filter:["in","class","industrial","quarry","railway","substation"],paint:{color:"#e7e0dd"}},{id:"landuse-civic",type:"fill","source-layer":"landuse",filter:["in","class","school","university","college","hospital","clinic","police","kindergarten","bus_station"],paint:{color:"#ece3d8"}},{id:"landuse-sport",type:"fill","source-layer":"landuse",filter:["in","class","pitch","stadium","playground","track","swimming_pool"],paint:{color:"#cfe3c4",material:"foliage",materialScale:10}},{id:"landuse-cemetery",type:"fill","source-layer":"landuse",filter:["in","class","cemetery","grave_yard"],paint:{color:"#d6dfc8",material:"foliage",materialScale:12}},{id:"landuse-parking",type:"fill","source-layer":"landuse",filter:["in","class","parking","fuel"],paint:{color:"#e8e4dc"}},{id:"park",type:"fill","source-layer":"park",paint:{color:"#cfe5bd",opacity:.75,material:"foliage",materialScale:15}},{id:"aeroway-area",type:"fill","source-layer":"aeroway",filter:["in","class","aerodrome","apron","helipad"],paint:{color:"#e4e2e6"}},{id:"water",type:"fill","source-layer":"water",filter:["!in","class","swimming_pool"],paint:{color:"#a5cbe3",material:"water",materialScale:14,materialSpeed:1}},{id:"water-pool",type:"fill","source-layer":"water",filter:["==","class","swimming_pool"],paint:{color:"#9fd3e8",material:"water",materialScale:8,materialSpeed:1}},{id:"waterway",type:"line","source-layer":"waterway",paint:{color:"#a5cbe3",width:{stops:[[8,.6],[12,1.4],[16,4],[19,11.5],[20,23],[21,46],[22,92]]},material:"water",materialScale:10,materialSpeed:1}},{id:"aeroway-line",type:"line","source-layer":"aeroway",filter:["in","class","runway","taxiway"],paint:{color:"#d8d5da",width:{stops:[[10,1],[14,5],[18,24],[19,24],[20,48],[21,96],[22,192]]},material:"asphalt",materialScale:4}},{id:"road-casing-major",type:"line","source-layer":"transportation",filter:["in","class","motorway","trunk","primary"],minzoom:5,paint:{color:"#d4ab68",width:{stops:[[6,1.6],[10,3.4],[14,8],[16,14],[18,30],[19,45],[20,90],[21,180],[22,360]]},widthFromData:true,widthExtra:2.5}},{id:"road-casing-secondary",type:"line","source-layer":"transportation",filter:["in","class","secondary","tertiary"],minzoom:9,paint:{color:"#c6bca6",width:{stops:[[10,1.6],[14,5.5],[16,10],[18,22],[19,33],[20,66],[21,132],[22,264]]},widthFromData:true,widthExtra:2}},{id:"road-casing-minor",type:"line","source-layer":"transportation",filter:["in","class","minor","service","track"],minzoom:12,paint:{color:"#cdc4b2",width:{stops:[[13,1.4],[16,6],[18,14],[19,22],[20,44],[21,88],[22,176]]},widthFromData:true,widthExtra:1.5}},{id:"road-rail",type:"line","source-layer":"transportation",filter:["in","class","rail","transit"],minzoom:10,paint:{color:"#b2a99e",width:{stops:[[10,.8],[14,1.8],[18,4],[19,5.5],[20,11],[21,22],[22,44]]}}},{id:"road-path",type:"line","source-layer":"transportation",filter:["in","class","path","pedestrian","footway","steps"],minzoom:14,paint:{color:"#bdb2a0",width:{stops:[[14,.8],[17,2],[19,4],[20,8],[21,16],[22,32]]},dashArray:[4,3],material:"asphalt",materialScale:2}},{id:"road-minor",type:"line","source-layer":"transportation",filter:["in","class","minor","service","track"],minzoom:12,paint:{color:"#ffffff",width:{stops:[[13,.6],[16,4],[18,11],[19,18],[20,36],[21,72],[22,144]]},material:"asphalt",materialScale:3,widthFromData:true}},{id:"road-secondary",type:"line","source-layer":"transportation",filter:["in","class","secondary","tertiary"],minzoom:9,paint:{color:"#ffffff",width:{stops:[[10,.8],[14,3.6],[16,7.5],[18,18],[19,28],[20,56],[21,112],[22,224]]},material:"asphalt",materialScale:3,widthFromData:true}},{id:"road-major",type:"line","source-layer":"transportation",filter:["in","class","motorway","trunk","primary"],minzoom:5,paint:{color:"#ffdfa3",width:{stops:[[6,.8],[10,2.2],[14,6],[16,11],[18,25],[19,38.5],[20,77],[21,154],[22,308]]},material:"asphalt",materialScale:3,widthFromData:true}},{id:"road-lane-divider-major",type:"line","source-layer":"transportation",filter:["all",["!has","oneway"],["in","class","motorway","trunk","primary"]],minzoom:16.5,paint:{color:"#e3bd7f",width:{stops:[[16.5,.54],[17,.78],[18,1.4],[19,2.17],[20,4.34],[21,8.68],[22,17.36]]},dashArray:[7,18],material:"flat"}},{id:"road-lane-divider-secondary",type:"line","source-layer":"transportation",filter:["all",["!has","oneway"],["in","class","secondary","tertiary"]],minzoom:16.5,paint:{color:"#d8cfbc",width:{stops:[[16.5,.46],[17,.67],[18,1.2],[19,1.86],[20,3.72],[21,7.44],[22,14.88]]},dashArray:[7,18],material:"flat"}},{id:"boundary",type:"line","source-layer":"boundary",filter:["<=","admin_level",4],paint:{color:"#b3a6b8",opacity:.7,width:{stops:[[4,.7],[10,1.4],[16,2.4]]},dashArray:[6,4]}},{id:"building",type:"fill-extrusion","source-layer":"building",minzoom:15,paint:{color:"#d8d3c8",roofColor:"#d9d3c7",opacity:1,heightScale:{stops:[[15,0],[15.8,1]]},aoStrength:.18,tintVariation:.06,windowColor:"#7f9ab5",windowFrameColor:"#e9e5dc",windowGlow:0,facadeDetail:1,floorHeight:3.2,roofVariation:.35}},{id:"indoor-venue",type:"fill-extrusion",source:"indoor","source-layer":"area",filter:["all",["==","class","level"],["==","base",1]],minzoom:15,maxzoom:16,paint:{color:"#d8d3c8",roofColor:"#d9d3c7",opacity:1,aoStrength:.18,tintVariation:.06,windowColor:"#7f9ab5",windowFrameColor:"#e9e5dc",windowGlow:0,facadeDetail:1,floorHeight:3.2,roofVariation:.35}},{id:"road-closed-casing",type:"line",source:"closures","source-layer":"closures",minzoom:11,paint:{color:"#ffffff",width:{stops:[[11,4],[14,6],[17,10],[19,16],[20,32],[21,64],[22,128]]},opacity:.9},overlay:true},{id:"road-closed",type:"line",source:"closures","source-layer":"closures",minzoom:11,paint:{color:"#d92b2b",width:{stops:[[11,2.5],[14,4],[17,7],[19,11],[20,22],[21,44],[22,88]]},dashArray:[5,4]},overlay:true},{id:"crossing",type:"fill",source:"points","source-layer":"crossings",minzoom:16.5,overlay:true,paint:{color:"#ffffff",opacity:.9}},{id:"housenumber",type:"symbol","source-layer":"housenumber",minzoom:17,layout:{textField:"{housenumber}",textSize:{stops:[[17,9],[19,11]]},maxLineChars:6,priority:-60},paint:{color:"#8c8478",haloColor:"#f5f3ee",haloWidth:1}},{id:"poi-food",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#c2681c",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#c2681c",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","cafe","restaurant","fast_food","bar","pub","beer","bakery","ice_cream"]},{id:"poi-shop",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#2f77c4",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#2f77c4",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","shop","clothing_store","grocery","alcohol_shop","music","laundry","hairdresser","car","bicycle"]},{id:"poi-transport",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#3b82a6",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#3b82a6",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","bus","railway","parking","fuel","bicycle_parking","bicycle_rental","taxi","airport"]},{id:"poi-health",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#c24444",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#c24444",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","pharmacy","hospital","doctors","dentist","veterinary"]},{id:"poi-education",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#3f7f7a",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#3f7f7a",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","school","college","university","library","kindergarten"]},{id:"poi-culture",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#8b5aa5",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#8b5aa5",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","museum","theatre","cinema","art_gallery","attraction","monument","zoo","theme_park","castle","place_of_worship","information"]},{id:"poi-sport",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#4f8b45",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#4f8b45",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","pitch","park","garden","playground","stadium","sports_centre","swimming_pool","athletics","running"]},{id:"poi-lodging",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#7a5fbf",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#7a5fbf",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","lodging"]},{id:"poi-service",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#59636e",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#59636e",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","bank","atm","post","office","town_hall","police","fire_station","toilets"]},{id:"poi",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#4a4a4a",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#4a4a4a",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["!in","class","cafe","restaurant","fast_food","bar","pub","beer","bakery","ice_cream","shop","clothing_store","grocery","alcohol_shop","music","laundry","hairdresser","car","bicycle","bus","railway","parking","fuel","bicycle_parking","bicycle_rental","taxi","airport","pharmacy","hospital","doctors","dentist","veterinary","school","college","university","library","kindergarten","museum","theatre","cinema","art_gallery","attraction","monument","zoo","theme_park","castle","place_of_worship","information","pitch","park","garden","playground","stadium","sports_centre","swimming_pool","athletics","running","lodging","bank","atm","post","office","town_hall","police","fire_station","toilets"]},{id:"traffic-signal",type:"symbol",source:"points","source-layer":"roadpoints",minzoom:16,filter:["==","kind","traffic_signals"],layout:{iconImage:"traffic_signals",priority:3},paint:{color:"#5c6470",haloColor:"#ffffff",haloWidth:1.4,iconSize:15}},{id:"road-shield",type:"symbol","source-layer":"transportation_name",filter:["has","ref"],minzoom:11,layout:{textField:"{ref}",iconImage:"shield-{ref_length}",iconPlacement:"behind",textSize:{stops:[[11,9.5],[16,11]]},iconTextGap:4,maxLineChars:10,collisionPadding:70,priority:3},paint:{color:"#3a4048",haloColor:"#f7f3e8",haloWidth:.5,iconColor:"#f7f3e8",iconHaloColor:"#8a8172",iconHaloWidth:1.4}},{id:"road-label",type:"symbol","source-layer":"transportation_name",minzoom:14,layout:{textField:["{name:ru}","{name}"],textPlacement:"line",textSize:{stops:[[14,10],[18,13]]},priority:20,abbreviate:true},paint:{color:"#5c5646",haloColor:"#ffffff",haloWidth:1.6}},{id:"water-label",type:"symbol","source-layer":"water_name",minzoom:10,layout:{textField:["{name:ru}","{name}"],textSize:{stops:[[10,11],[16,14]]},priority:30},paint:{color:"#3d7ea6",haloColor:"#ffffff",haloWidth:1.4}},{id:"place-label",type:"symbol","source-layer":"place",minzoom:4,layout:{textField:["{name:ru}","{name}"],textSize:{stops:[[6,12],[12,17],[16,22]]},maxLineChars:16,priority:90},paint:{color:"#3a3a3a",haloColor:"#ffffff",haloWidth:1.8}},{id:"indoor-shell",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","level"],minzoom:16,paint:{color:"#f6f3ec",opacity:.97},clipToTile:true},{id:"indoor-corridor",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","corridor"],minzoom:16,paint:{color:"#ffffff"},clipToTile:true},{id:"indoor-room",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["in","class","room","area"],minzoom:16,paint:{color:"#efeae0"},clipToTile:true},{id:"indoor-service",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","service"],minzoom:16,paint:{color:"#e6e1d6"},clipToTile:true},{id:"indoor-shop",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","shop"],minzoom:16,paint:{color:"#e8e0f0"},clipToTile:true},{id:"indoor-food",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","food"],minzoom:16,paint:{color:"#f7e3cd"},clipToTile:true},{id:"indoor-wc",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","wc"],minzoom:16,paint:{color:"#d8e8f2"},clipToTile:true},{id:"indoor-wall",type:"fill-extrusion",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","wall"],minzoom:16,paint:{color:"#cbc4b8",roofColor:"#e4ded2",facadeDetail:0,tintVariation:0,roofVariation:0,aoStrength:0}},{id:"indoor-transportation",type:"fill",source:"indoor","source-layer":"transportation",splitBy:"level",minzoom:16,paint:{color:"#d9d2e8",opacity:.95},clipToTile:true},{id:"indoor-door",type:"symbol",source:"indoor","source-layer":"poi",filter:["==","class","door"],splitBy:"level",minzoom:18,layout:{iconImage:"door",iconSize:{stops:[[18,9],[20,13]]},allowOverlap:true,priority:-10},paint:{color:"#8a8172",haloColor:"#ffffff",haloWidth:1.2}},{id:"indoor-poi",type:"symbol",source:"indoor","source-layer":"poi",splitBy:"level",minzoom:17,layout:{textField:["{name}"],iconImage:"{class}",textSize:{stops:[[17,10],[19,12]]},iconSize:{stops:[[17,12],[19,15]]},iconTextGap:2,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#4a4a4a",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:.32}},{id:"indoor-name",type:"symbol",source:"indoor","source-layer":"area_name",splitBy:"level",minzoom:17,layout:{textField:["{name}"],textSize:{stops:[[17,10.5],[19,12.5]]},maxLineChars:8},paint:{color:"#3c3830",haloColor:"#ffffff",haloWidth:1.4}},{id:"building-entrance",type:"symbol",source:"points","source-layer":"entrances",minzoom:17,layout:{iconImage:"entrance",showFor:"highlight",textField:["{ref}"],textSize:{stops:[[17,10],[19,12.5]]},allowOverlap:true,priority:40,iconRotate:"angle",placement:"map",arrowLength:{stops:[[17,22],[18,32],[19,40],[20,48],[22,56]]},arrowWidth:{stops:[[17,6],[18,8.5],[19,10.5],[20,12.5],[22,15]]},arrowOutline:{stops:[[17,1.4],[18,2],[19,2.5],[20,3],[22,3.5]]},arrowGap:{stops:[[17,14],[18,19],[19,23],[20,27],[22,31]]},arrowUnits:"pixels",iconTextGap:3,arrowDotRadius:{stops:[[17,2.2],[18,3.2],[19,4],[20,4.8],[22,5.6]]},arrowDotGap:{stops:[[17,5],[18,7],[19,9],[20,11],[22,12.5]]}},paint:{color:"#2d6ecb",haloColor:"#ffffff",haloWidth:1.6}}],sources:{indoor:{url:"/tileserver/data/indoor/{z}/{x}/{y}.pbf",minzoom:15,maxzoom:18},points:{url:"/tileserver/data/points/{z}/{x}/{y}.pbf",minzoom:13,maxzoom:16},closures:{url:"/closures/tiles/{z}/{x}/{y}.mvt",minzoom:10,maxzoom:16}}};var ri={version:1,name:"\u041C\u044F\u0433\u043A\u0430\u044F \u0433\u0435\u043E\u043C\u0435\u0442\u0440\u0438\u044F",background:"#eceae4",light:{ambientColor:"#ffffff",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#fff4e2",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#dce6f2",fillIntensity:.18},layers:[{id:"landcover-wood",type:"fill","source-layer":"landcover",filter:["in","class","wood","forest"],paint:{color:"#c6dcb4",opacity:{stops:[[8,.5],[12,.85]]},material:"foliage",materialScale:16},cornerRadius:10,cornerSegments:4},{id:"landcover-grass",type:"fill","source-layer":"landcover",filter:["in","class","grass","farmland","meadow"],paint:{color:"#d9e6c6",opacity:{stops:[[8,.45],[12,.8]]},material:"foliage",materialScale:11},cornerRadius:8,cornerSegments:4},{id:"landcover-sand",type:"fill","source-layer":"landcover",filter:["in","class","sand","beach"],paint:{color:"#f2e7c8",material:"sand",materialScale:26},cornerRadius:10,cornerSegments:4},{id:"landcover-ice",type:"fill","source-layer":"landcover",filter:["in","class","ice","glacier"],paint:{color:"#e6f2f7"}},{id:"landcover-wetland",type:"fill","source-layer":"landcover",filter:["in","class","wetland","swamp"],paint:{color:"#cfe0d4",material:"foliage",materialScale:9},cornerRadius:8,cornerSegments:4},{id:"landuse-residential",type:"fill","source-layer":"landuse",filter:["in","class","residential","suburb","neighbourhood","quarter"],paint:{color:"#e6e2da",opacity:{stops:[[10,.4],[14,.7]]}},cornerRadius:4,cornerSegments:3},{id:"landuse-industrial",type:"fill","source-layer":"landuse",filter:["in","class","industrial","quarry","railway","substation"],paint:{color:"#e7e0dd"},cornerRadius:4,cornerSegments:3},{id:"landuse-civic",type:"fill","source-layer":"landuse",filter:["in","class","school","university","college","hospital","clinic","police","kindergarten","bus_station"],paint:{color:"#ece3d8"},cornerRadius:4,cornerSegments:3},{id:"landuse-sport",type:"fill","source-layer":"landuse",filter:["in","class","pitch","stadium","playground","track","swimming_pool"],paint:{color:"#cfe3c4",material:"foliage",materialScale:10},cornerRadius:5,cornerSegments:3},{id:"landuse-cemetery",type:"fill","source-layer":"landuse",filter:["in","class","cemetery","grave_yard"],paint:{color:"#d6dfc8",material:"foliage",materialScale:12},cornerRadius:5,cornerSegments:3},{id:"landuse-parking",type:"fill","source-layer":"landuse",filter:["in","class","parking","fuel"],paint:{color:"#e8e4dc"},cornerRadius:3,cornerSegments:3},{id:"park",type:"fill","source-layer":"park",paint:{color:"#cfe5bd",opacity:.75,material:"foliage",materialScale:15},cornerRadius:9,cornerSegments:4},{id:"aeroway-area",type:"fill","source-layer":"aeroway",filter:["in","class","aerodrome","apron","helipad"],paint:{color:"#e4e2e6"},cornerRadius:5,cornerSegments:3},{id:"water",type:"fill","source-layer":"water",filter:["!in","class","swimming_pool"],paint:{color:"#a5cbe3",material:"water",materialScale:14,materialSpeed:1},cornerRadius:7,cornerSegments:4},{id:"water-pool",type:"fill","source-layer":"water",filter:["==","class","swimming_pool"],paint:{color:"#9fd3e8",material:"water",materialScale:8,materialSpeed:1},cornerRadius:4,cornerSegments:4},{id:"waterway",type:"line","source-layer":"waterway",paint:{color:"#a5cbe3",width:{stops:[[8,.6],[12,1.4],[16,4],[19,11.5],[20,23],[21,46],[22,92]]},material:"water",materialScale:10,materialSpeed:1}},{id:"aeroway-line",type:"line","source-layer":"aeroway",filter:["in","class","runway","taxiway"],paint:{color:"#d8d5da",width:{stops:[[10,1],[14,5],[18,24],[19,24],[20,48],[21,96],[22,192]]},material:"asphalt",materialScale:4}},{id:"road-casing-major",type:"line","source-layer":"transportation",filter:["in","class","motorway","trunk","primary"],minzoom:5,paint:{color:"#d4ab68",width:{stops:[[6,1.6],[10,3.4],[14,8],[16,14],[18,30],[19,45],[20,90],[21,180],[22,360]]},widthFromData:true,widthExtra:2.5}},{id:"road-casing-secondary",type:"line","source-layer":"transportation",filter:["in","class","secondary","tertiary"],minzoom:9,paint:{color:"#c6bca6",width:{stops:[[10,1.6],[14,5.5],[16,10],[18,22],[19,33],[20,66],[21,132],[22,264]]},widthFromData:true,widthExtra:2}},{id:"road-casing-minor",type:"line","source-layer":"transportation",filter:["in","class","minor","service","track"],minzoom:12,paint:{color:"#cdc4b2",width:{stops:[[13,1.4],[16,6],[18,14],[19,22],[20,44],[21,88],[22,176]]},widthFromData:true,widthExtra:1.5}},{id:"road-rail",type:"line","source-layer":"transportation",filter:["in","class","rail","transit"],minzoom:10,paint:{color:"#b2a99e",width:{stops:[[10,.8],[14,1.8],[18,4],[19,5.5],[20,11],[21,22],[22,44]]}}},{id:"road-path",type:"line","source-layer":"transportation",filter:["in","class","path","pedestrian","footway","steps"],minzoom:14,paint:{color:"#bdb2a0",width:{stops:[[14,.8],[17,2],[19,4],[20,8],[21,16],[22,32]]},dashArray:[4,3],material:"asphalt",materialScale:2}},{id:"road-minor",type:"line","source-layer":"transportation",filter:["in","class","minor","service","track"],minzoom:12,paint:{color:"#ffffff",width:{stops:[[13,.6],[16,4],[18,11],[19,18],[20,36],[21,72],[22,144]]},material:"asphalt",materialScale:3,widthFromData:true}},{id:"road-secondary",type:"line","source-layer":"transportation",filter:["in","class","secondary","tertiary"],minzoom:9,paint:{color:"#ffffff",width:{stops:[[10,.8],[14,3.6],[16,7.5],[18,18],[19,28],[20,56],[21,112],[22,224]]},material:"asphalt",materialScale:3,widthFromData:true}},{id:"road-major",type:"line","source-layer":"transportation",filter:["in","class","motorway","trunk","primary"],minzoom:5,paint:{color:"#ffdfa3",width:{stops:[[6,.8],[10,2.2],[14,6],[16,11],[18,25],[19,38.5],[20,77],[21,154],[22,308]]},material:"asphalt",materialScale:3,widthFromData:true}},{id:"road-lane-divider-major",type:"line","source-layer":"transportation",filter:["all",["!has","oneway"],["in","class","motorway","trunk","primary"]],minzoom:16.5,paint:{color:"#e3bd7f",width:{stops:[[16.5,.54],[17,.78],[18,1.4],[19,2.17],[20,4.34],[21,8.68],[22,17.36]]},dashArray:[7,18],material:"flat"}},{id:"road-lane-divider-secondary",type:"line","source-layer":"transportation",filter:["all",["!has","oneway"],["in","class","secondary","tertiary"]],minzoom:16.5,paint:{color:"#d8cfbc",width:{stops:[[16.5,.46],[17,.67],[18,1.2],[19,1.86],[20,3.72],[21,7.44],[22,14.88]]},dashArray:[7,18],material:"flat"}},{id:"boundary",type:"line","source-layer":"boundary",filter:["<=","admin_level",4],paint:{color:"#b3a6b8",opacity:.7,width:{stops:[[4,.7],[10,1.4],[16,2.4]]},dashArray:[6,4]}},{id:"building",type:"fill-extrusion","source-layer":"building",minzoom:15,paint:{color:"#d8d3c8",roofColor:"#d9d3c7",opacity:1,heightScale:{stops:[[15,0],[15.8,1]]},aoStrength:.18,tintVariation:.06,windowColor:"#7f9ab5",windowFrameColor:"#e9e5dc",windowGlow:0,facadeDetail:1,floorHeight:3.2,roofVariation:.35},cornerRadius:1.6,cornerSegments:2},{id:"indoor-venue",type:"fill-extrusion",source:"indoor","source-layer":"area",filter:["all",["==","class","level"],["==","base",1]],minzoom:15,maxzoom:16,paint:{color:"#d8d3c8",roofColor:"#d9d3c7",opacity:1,aoStrength:.18,tintVariation:.06,windowColor:"#7f9ab5",windowFrameColor:"#e9e5dc",windowGlow:0,facadeDetail:1,floorHeight:3.2,roofVariation:.35}},{id:"road-closed-casing",type:"line",source:"closures","source-layer":"closures",minzoom:11,paint:{color:"#ffffff",width:{stops:[[11,4],[14,6],[17,10],[19,16],[20,32],[21,64],[22,128]]},opacity:.9},overlay:true},{id:"road-closed",type:"line",source:"closures","source-layer":"closures",minzoom:11,paint:{color:"#d92b2b",width:{stops:[[11,2.5],[14,4],[17,7],[19,11],[20,22],[21,44],[22,88]]},dashArray:[5,4]},overlay:true},{id:"crossing",type:"fill",source:"points","source-layer":"crossings",minzoom:16.5,overlay:true,paint:{color:"#ffffff",opacity:.9}},{id:"housenumber",type:"symbol","source-layer":"housenumber",minzoom:17,layout:{textField:"{housenumber}",textSize:{stops:[[17,9],[19,11]]},maxLineChars:6,priority:-60},paint:{color:"#8c8478",haloColor:"#f5f3ee",haloWidth:1}},{id:"poi-food",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#c2681c",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#c2681c",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","cafe","restaurant","fast_food","bar","pub","beer","bakery","ice_cream"]},{id:"poi-shop",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#2f77c4",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#2f77c4",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","shop","clothing_store","grocery","alcohol_shop","music","laundry","hairdresser","car","bicycle"]},{id:"poi-transport",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#3b82a6",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#3b82a6",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","bus","railway","parking","fuel","bicycle_parking","bicycle_rental","taxi","airport"]},{id:"poi-health",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#c24444",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#c24444",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","pharmacy","hospital","doctors","dentist","veterinary"]},{id:"poi-education",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#3f7f7a",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#3f7f7a",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","school","college","university","library","kindergarten"]},{id:"poi-culture",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#8b5aa5",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#8b5aa5",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","museum","theatre","cinema","art_gallery","attraction","monument","zoo","theme_park","castle","place_of_worship","information"]},{id:"poi-sport",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#4f8b45",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#4f8b45",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","pitch","park","garden","playground","stadium","sports_centre","swimming_pool","athletics","running"]},{id:"poi-lodging",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#7a5fbf",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#7a5fbf",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","lodging"]},{id:"poi-service",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#59636e",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#59636e",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","bank","atm","post","office","town_hall","police","fire_station","toilets"]},{id:"poi",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#4a4a4a",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#4a4a4a",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["!in","class","cafe","restaurant","fast_food","bar","pub","beer","bakery","ice_cream","shop","clothing_store","grocery","alcohol_shop","music","laundry","hairdresser","car","bicycle","bus","railway","parking","fuel","bicycle_parking","bicycle_rental","taxi","airport","pharmacy","hospital","doctors","dentist","veterinary","school","college","university","library","kindergarten","museum","theatre","cinema","art_gallery","attraction","monument","zoo","theme_park","castle","place_of_worship","information","pitch","park","garden","playground","stadium","sports_centre","swimming_pool","athletics","running","lodging","bank","atm","post","office","town_hall","police","fire_station","toilets"]},{id:"traffic-signal",type:"symbol",source:"points","source-layer":"roadpoints",minzoom:16,filter:["==","kind","traffic_signals"],layout:{iconImage:"traffic_signals",priority:3},paint:{color:"#5c6470",haloColor:"#ffffff",haloWidth:1.4,iconSize:15}},{id:"road-shield",type:"symbol","source-layer":"transportation_name",filter:["has","ref"],minzoom:11,layout:{textField:"{ref}",iconImage:"shield-{ref_length}",iconPlacement:"behind",textSize:{stops:[[11,9.5],[16,11]]},iconTextGap:4,maxLineChars:10,collisionPadding:70,priority:3},paint:{color:"#3a4048",haloColor:"#f7f3e8",haloWidth:.5,iconColor:"#f7f3e8",iconHaloColor:"#8a8172",iconHaloWidth:1.4}},{id:"road-label",type:"symbol","source-layer":"transportation_name",minzoom:14,layout:{textField:["{name:ru}","{name}"],textPlacement:"line",textSize:{stops:[[14,10],[18,13]]},priority:20,abbreviate:true},paint:{color:"#5c5646",haloColor:"#ffffff",haloWidth:1.6}},{id:"water-label",type:"symbol","source-layer":"water_name",minzoom:10,layout:{textField:["{name:ru}","{name}"],textSize:{stops:[[10,11],[16,14]]},priority:30},paint:{color:"#3d7ea6",haloColor:"#ffffff",haloWidth:1.4}},{id:"place-label",type:"symbol","source-layer":"place",minzoom:4,layout:{textField:["{name:ru}","{name}"],textSize:{stops:[[6,12],[12,17],[16,22]]},maxLineChars:16,priority:90},paint:{color:"#3a3a3a",haloColor:"#ffffff",haloWidth:1.8}},{id:"indoor-shell",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","level"],minzoom:16,paint:{color:"#f6f3ec",opacity:.97},clipToTile:true},{id:"indoor-corridor",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","corridor"],minzoom:16,paint:{color:"#ffffff"},clipToTile:true},{id:"indoor-room",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["in","class","room","area"],minzoom:16,paint:{color:"#efeae0"},clipToTile:true},{id:"indoor-service",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","service"],minzoom:16,paint:{color:"#e6e1d6"},clipToTile:true},{id:"indoor-shop",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","shop"],minzoom:16,paint:{color:"#e8e0f0"},clipToTile:true},{id:"indoor-food",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","food"],minzoom:16,paint:{color:"#f7e3cd"},clipToTile:true},{id:"indoor-wc",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","wc"],minzoom:16,paint:{color:"#d8e8f2"},clipToTile:true},{id:"indoor-wall",type:"fill-extrusion",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","wall"],minzoom:16,paint:{color:"#cbc4b8",roofColor:"#e4ded2",facadeDetail:0,tintVariation:0,roofVariation:0,aoStrength:0}},{id:"indoor-transportation",type:"fill",source:"indoor","source-layer":"transportation",splitBy:"level",minzoom:16,paint:{color:"#d9d2e8",opacity:.95},clipToTile:true},{id:"indoor-door",type:"symbol",source:"indoor","source-layer":"poi",filter:["==","class","door"],splitBy:"level",minzoom:18,layout:{iconImage:"door",iconSize:{stops:[[18,9],[20,13]]},allowOverlap:true,priority:-10},paint:{color:"#8a8172",haloColor:"#ffffff",haloWidth:1.2}},{id:"indoor-poi",type:"symbol",source:"indoor","source-layer":"poi",splitBy:"level",minzoom:17,layout:{textField:["{name}"],iconImage:"{class}",textSize:{stops:[[17,10],[19,12]]},iconSize:{stops:[[17,12],[19,15]]},iconTextGap:2,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#4a4a4a",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:.32}},{id:"indoor-name",type:"symbol",source:"indoor","source-layer":"area_name",splitBy:"level",minzoom:17,layout:{textField:["{name}"],textSize:{stops:[[17,10.5],[19,12.5]]},maxLineChars:8},paint:{color:"#3c3830",haloColor:"#ffffff",haloWidth:1.4}},{id:"building-entrance",type:"symbol",source:"points","source-layer":"entrances",minzoom:17,layout:{iconImage:"entrance",showFor:"highlight",textField:["{ref}"],textSize:{stops:[[17,10],[19,12.5]]},allowOverlap:true,priority:40,iconRotate:"angle",placement:"map",arrowLength:{stops:[[17,22],[18,32],[19,40],[20,48],[22,56]]},arrowWidth:{stops:[[17,6],[18,8.5],[19,10.5],[20,12.5],[22,15]]},arrowOutline:{stops:[[17,1.4],[18,2],[19,2.5],[20,3],[22,3.5]]},arrowGap:{stops:[[17,14],[18,19],[19,23],[20,27],[22,31]]},arrowUnits:"pixels",iconTextGap:3,arrowDotRadius:{stops:[[17,2.2],[18,3.2],[19,4],[20,4.8],[22,5.6]]},arrowDotGap:{stops:[[17,5],[18,7],[19,9],[20,11],[22,12.5]]}},paint:{color:"#2d6ecb",haloColor:"#ffffff",haloWidth:1.6}}],sources:{indoor:{url:"/tileserver/data/indoor/{z}/{x}/{y}.pbf",minzoom:15,maxzoom:18},points:{url:"/tileserver/data/points/{z}/{x}/{y}.pbf",minzoom:13,maxzoom:16},closures:{url:"/closures/tiles/{z}/{x}/{y}.mvt",minzoom:10,maxzoom:16}}};var ni={version:1,name:"\u0420\u0435\u043B\u044C\u0435\u0444",background:"#eceae4",light:{ambientColor:"#ffffff",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#fff4e2",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#dce6f2",fillIntensity:.18},layers:[{id:"landcover-wood",type:"surface","source-layer":"landcover",filter:["in","class","wood","forest"],paint:{color:"#c6dcb4",opacity:{stops:[[8,.5],[12,.85]]},material:"foliage",materialScale:16,sideShade:.16},elevation:.7,bevel:.5,bevelDrop:.15,cornerRadius:10,cornerSegments:4},{id:"landcover-grass",type:"surface","source-layer":"landcover",filter:["in","class","grass","farmland","meadow"],paint:{color:"#d9e6c6",opacity:{stops:[[8,.45],[12,.8]]},material:"foliage",materialScale:11,sideShade:.16},elevation:.5,bevel:.45,bevelDrop:.12,cornerRadius:8,cornerSegments:4},{id:"landcover-sand",type:"surface","source-layer":"landcover",filter:["in","class","sand","beach"],paint:{color:"#f2e7c8",material:"sand",materialScale:26,sideShade:.16},elevation:.12,bevel:.6,bevelDrop:.08,cornerRadius:10,cornerSegments:4},{id:"landcover-ice",type:"fill","source-layer":"landcover",filter:["in","class","ice","glacier"],paint:{color:"#e6f2f7"}},{id:"landcover-wetland",type:"surface","source-layer":"landcover",filter:["in","class","wetland","swamp"],paint:{color:"#cfe0d4",material:"foliage",materialScale:9,sideShade:.16},elevation:.15,bevel:.5,bevelDrop:.08,cornerRadius:8,cornerSegments:4},{id:"landuse-residential",type:"fill","source-layer":"landuse",filter:["in","class","residential","suburb","neighbourhood","quarter"],paint:{color:"#e6e2da",opacity:{stops:[[10,.4],[14,.7]]}}},{id:"landuse-industrial",type:"fill","source-layer":"landuse",filter:["in","class","industrial","quarry","railway","substation"],paint:{color:"#e7e0dd"}},{id:"landuse-civic",type:"fill","source-layer":"landuse",filter:["in","class","school","university","college","hospital","clinic","police","kindergarten","bus_station"],paint:{color:"#ece3d8"}},{id:"landuse-sport",type:"surface","source-layer":"landuse",filter:["in","class","pitch","stadium","playground","track","swimming_pool"],paint:{color:"#cfe3c4",material:"foliage",materialScale:10,sideShade:.16},elevation:.35,bevel:.4,bevelDrop:.1,cornerRadius:5,cornerSegments:4},{id:"landuse-cemetery",type:"surface","source-layer":"landuse",filter:["in","class","cemetery","grave_yard"],paint:{color:"#d6dfc8",material:"foliage",materialScale:12,sideShade:.16},elevation:.3,bevel:.4,bevelDrop:.1,cornerRadius:5,cornerSegments:4},{id:"landuse-parking",type:"fill","source-layer":"landuse",filter:["in","class","parking","fuel"],paint:{color:"#e8e4dc"}},{id:"park",type:"surface","source-layer":"park",paint:{color:"#cfe5bd",opacity:.75,material:"foliage",materialScale:15,sideShade:.16},elevation:.6,bevel:.5,bevelDrop:.15,cornerRadius:9,cornerSegments:4},{id:"aeroway-area",type:"fill","source-layer":"aeroway",filter:["in","class","aerodrome","apron","helipad"],paint:{color:"#e4e2e6"}},{id:"water",type:"surface","source-layer":"water",filter:["!in","class","swimming_pool"],paint:{color:"#a5cbe3",material:"water",materialScale:14,materialSpeed:1,sideShade:0},elevation:-0.35,bevel:.8,bevelDrop:.12,cornerRadius:7,cornerSegments:4},{id:"water-pool",type:"surface","source-layer":"water",filter:["==","class","swimming_pool"],paint:{color:"#9fd3e8",material:"water",materialScale:8,materialSpeed:1,sideShade:0},elevation:-0.2,bevel:.4,bevelDrop:.08,cornerRadius:4,cornerSegments:4},{id:"waterway",type:"line","source-layer":"waterway",paint:{color:"#a5cbe3",width:{stops:[[8,.6],[12,1.4],[16,4],[19,11.5],[20,23],[21,46],[22,92]]},material:"water",materialScale:10,materialSpeed:1,elevation:-0.3}},{id:"aeroway-line",type:"line","source-layer":"aeroway",filter:["in","class","runway","taxiway"],paint:{color:"#d8d5da",width:{stops:[[10,1],[14,5],[18,24],[19,24],[20,48],[21,96],[22,192]]},material:"asphalt",materialScale:4,elevation:.08}},{id:"road-casing-major",type:"line","source-layer":"transportation",filter:["in","class","motorway","trunk","primary"],minzoom:5,paint:{color:"#d4ab68",width:{stops:[[6,1.6],[10,3.4],[14,8],[16,14],[18,30],[19,45],[20,90],[21,180],[22,360]]},elevation:.15,widthFromData:true,widthExtra:2.5}},{id:"road-casing-secondary",type:"line","source-layer":"transportation",filter:["in","class","secondary","tertiary"],minzoom:9,paint:{color:"#c6bca6",width:{stops:[[10,1.6],[14,5.5],[16,10],[18,22],[19,33],[20,66],[21,132],[22,264]]},elevation:.13,widthFromData:true,widthExtra:2}},{id:"road-casing-minor",type:"line","source-layer":"transportation",filter:["in","class","minor","service","track"],minzoom:12,paint:{color:"#cdc4b2",width:{stops:[[13,1.4],[16,6],[18,14],[19,22],[20,44],[21,88],[22,176]]},elevation:.11,widthFromData:true,widthExtra:1.5}},{id:"road-rail",type:"line","source-layer":"transportation",filter:["in","class","rail","transit"],minzoom:10,paint:{color:"#b2a99e",width:{stops:[[10,.8],[14,1.8],[18,4],[19,5.5],[20,11],[21,22],[22,44]]},elevation:.12}},{id:"road-path",type:"line","source-layer":"transportation",filter:["in","class","path","pedestrian","footway","steps"],minzoom:14,paint:{color:"#bdb2a0",width:{stops:[[14,.8],[17,2],[19,4],[20,8],[21,16],[22,32]]},dashArray:[4,3],material:"asphalt",materialScale:2,elevation:.05}},{id:"road-minor",type:"line","source-layer":"transportation",filter:["in","class","minor","service","track"],minzoom:12,paint:{color:"#ffffff",width:{stops:[[13,.6],[16,4],[18,11],[19,18],[20,36],[21,72],[22,144]]},material:"asphalt",materialScale:3,elevation:.14,widthFromData:true}},{id:"road-secondary",type:"line","source-layer":"transportation",filter:["in","class","secondary","tertiary"],minzoom:9,paint:{color:"#ffffff",width:{stops:[[10,.8],[14,3.6],[16,7.5],[18,18],[19,28],[20,56],[21,112],[22,224]]},material:"asphalt",materialScale:3,elevation:.16,widthFromData:true}},{id:"road-major",type:"line","source-layer":"transportation",filter:["in","class","motorway","trunk","primary"],minzoom:5,paint:{color:"#ffdfa3",width:{stops:[[6,.8],[10,2.2],[14,6],[16,11],[18,25],[19,38.5],[20,77],[21,154],[22,308]]},material:"asphalt",materialScale:3,elevation:.18,widthFromData:true}},{id:"road-lane-divider-major",type:"line","source-layer":"transportation",filter:["all",["!has","oneway"],["in","class","motorway","trunk","primary"]],minzoom:16.5,paint:{color:"#e3bd7f",width:{stops:[[16.5,.54],[17,.78],[18,1.4],[19,2.17],[20,4.34],[21,8.68],[22,17.36]]},dashArray:[7,18],material:"flat",elevation:.182}},{id:"road-lane-divider-secondary",type:"line","source-layer":"transportation",filter:["all",["!has","oneway"],["in","class","secondary","tertiary"]],minzoom:16.5,paint:{color:"#d8cfbc",width:{stops:[[16.5,.46],[17,.67],[18,1.2],[19,1.86],[20,3.72],[21,7.44],[22,14.88]]},dashArray:[7,18],material:"flat",elevation:.162}},{id:"boundary",type:"line","source-layer":"boundary",filter:["<=","admin_level",4],paint:{color:"#b3a6b8",opacity:.7,width:{stops:[[4,.7],[10,1.4],[16,2.4]]},dashArray:[6,4]}},{id:"building",type:"fill-extrusion","source-layer":"building",minzoom:15,paint:{color:"#d8d3c8",roofColor:"#d9d3c7",opacity:1,heightScale:{stops:[[15,0],[15.8,1]]},aoStrength:.18,tintVariation:.06,windowColor:"#7f9ab5",windowFrameColor:"#e9e5dc",windowGlow:0,facadeDetail:1,floorHeight:3.2,roofVariation:.35}},{id:"indoor-venue",type:"fill-extrusion",source:"indoor","source-layer":"area",filter:["all",["==","class","level"],["==","base",1]],minzoom:15,maxzoom:16,paint:{color:"#d8d3c8",roofColor:"#d9d3c7",opacity:1,aoStrength:.18,tintVariation:.06,windowColor:"#7f9ab5",windowFrameColor:"#e9e5dc",windowGlow:0,facadeDetail:1,floorHeight:3.2,roofVariation:.35}},{id:"road-closed-casing",type:"line",source:"closures","source-layer":"closures",minzoom:11,paint:{color:"#ffffff",width:{stops:[[11,4],[14,6],[17,10],[19,16],[20,32],[21,64],[22,128]]},opacity:.9},overlay:true},{id:"road-closed",type:"line",source:"closures","source-layer":"closures",minzoom:11,paint:{color:"#d92b2b",width:{stops:[[11,2.5],[14,4],[17,7],[19,11],[20,22],[21,44],[22,88]]},dashArray:[5,4]},overlay:true},{id:"crossing",type:"surface",source:"points","source-layer":"crossings",minzoom:16.5,overlay:true,paint:{color:"#ffffff",opacity:.9,sideShade:.16},elevation:.09,bevel:.05,bevelDrop:.02,groundBy:{"landcover:wood":.7,"landcover:forest":.7,"landcover:grass":.5,"landcover:farmland":.5,"landcover:meadow":.5,"landcover:sand":.12,"landcover:beach":.12,"landcover:wetland":.15,"landcover:swamp":.15,"landuse:pitch":.35,"landuse:stadium":.35,"landuse:playground":.35,"landuse:track":.35,"landuse:swimming_pool":.35,"landuse:cemetery":.3,"landuse:grave_yard":.3,"park:park":.6}},{id:"housenumber",type:"symbol","source-layer":"housenumber",minzoom:17,layout:{textField:"{housenumber}",textSize:{stops:[[17,9],[19,11]]},maxLineChars:6,priority:-60},paint:{color:"#8c8478",haloColor:"#f5f3ee",haloWidth:1}},{id:"poi-food",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#c2681c",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#c2681c",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","cafe","restaurant","fast_food","bar","pub","beer","bakery","ice_cream"]},{id:"poi-shop",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#2f77c4",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#2f77c4",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","shop","clothing_store","grocery","alcohol_shop","music","laundry","hairdresser","car","bicycle"]},{id:"poi-transport",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#3b82a6",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#3b82a6",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","bus","railway","parking","fuel","bicycle_parking","bicycle_rental","taxi","airport"]},{id:"poi-health",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#c24444",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#c24444",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","pharmacy","hospital","doctors","dentist","veterinary"]},{id:"poi-education",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#3f7f7a",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#3f7f7a",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","school","college","university","library","kindergarten"]},{id:"poi-culture",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#8b5aa5",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#8b5aa5",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","museum","theatre","cinema","art_gallery","attraction","monument","zoo","theme_park","castle","place_of_worship","information"]},{id:"poi-sport",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#4f8b45",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#4f8b45",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","pitch","park","garden","playground","stadium","sports_centre","swimming_pool","athletics","running"]},{id:"poi-lodging",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#7a5fbf",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#7a5fbf",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","lodging"]},{id:"poi-service",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#59636e",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#59636e",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","bank","atm","post","office","town_hall","police","fire_station","toilets"]},{id:"poi",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#4a4a4a",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#4a4a4a",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["!in","class","cafe","restaurant","fast_food","bar","pub","beer","bakery","ice_cream","shop","clothing_store","grocery","alcohol_shop","music","laundry","hairdresser","car","bicycle","bus","railway","parking","fuel","bicycle_parking","bicycle_rental","taxi","airport","pharmacy","hospital","doctors","dentist","veterinary","school","college","university","library","kindergarten","museum","theatre","cinema","art_gallery","attraction","monument","zoo","theme_park","castle","place_of_worship","information","pitch","park","garden","playground","stadium","sports_centre","swimming_pool","athletics","running","lodging","bank","atm","post","office","town_hall","police","fire_station","toilets"]},{id:"traffic-signal",type:"symbol",source:"points","source-layer":"roadpoints",minzoom:16,filter:["==","kind","traffic_signals"],layout:{iconImage:"traffic_signals",priority:3},paint:{color:"#5c6470",haloColor:"#ffffff",haloWidth:1.4,iconSize:15}},{id:"road-shield",type:"symbol","source-layer":"transportation_name",filter:["has","ref"],minzoom:11,layout:{textField:"{ref}",iconImage:"shield-{ref_length}",iconPlacement:"behind",textSize:{stops:[[11,9.5],[16,11]]},iconTextGap:4,maxLineChars:10,collisionPadding:70,priority:3},paint:{color:"#3a4048",haloColor:"#f7f3e8",haloWidth:.5,iconColor:"#f7f3e8",iconHaloColor:"#8a8172",iconHaloWidth:1.4}},{id:"road-label",type:"symbol","source-layer":"transportation_name",minzoom:14,layout:{textField:["{name:ru}","{name}"],textPlacement:"line",textSize:{stops:[[14,10],[18,13]]},priority:20,abbreviate:true},paint:{color:"#5c5646",haloColor:"#ffffff",haloWidth:1.6}},{id:"water-label",type:"symbol","source-layer":"water_name",minzoom:10,layout:{textField:["{name:ru}","{name}"],textSize:{stops:[[10,11],[16,14]]},priority:30},paint:{color:"#3d7ea6",haloColor:"#ffffff",haloWidth:1.4}},{id:"place-label",type:"symbol","source-layer":"place",minzoom:4,layout:{textField:["{name:ru}","{name}"],textSize:{stops:[[6,12],[12,17],[16,22]]},maxLineChars:16,priority:90},paint:{color:"#3a3a3a",haloColor:"#ffffff",haloWidth:1.8}},{id:"indoor-shell",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","level"],minzoom:16,paint:{color:"#f6f3ec",opacity:.97},clipToTile:true},{id:"indoor-corridor",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","corridor"],minzoom:16,paint:{color:"#ffffff"},clipToTile:true},{id:"indoor-room",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["in","class","room","area"],minzoom:16,paint:{color:"#efeae0"},clipToTile:true},{id:"indoor-service",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","service"],minzoom:16,paint:{color:"#e6e1d6"},clipToTile:true},{id:"indoor-shop",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","shop"],minzoom:16,paint:{color:"#e8e0f0"},clipToTile:true},{id:"indoor-food",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","food"],minzoom:16,paint:{color:"#f7e3cd"},clipToTile:true},{id:"indoor-wc",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","wc"],minzoom:16,paint:{color:"#d8e8f2"},clipToTile:true},{id:"indoor-wall",type:"fill-extrusion",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","wall"],minzoom:16,paint:{color:"#cbc4b8",roofColor:"#e4ded2",facadeDetail:0,tintVariation:0,roofVariation:0,aoStrength:0}},{id:"indoor-transportation",type:"fill",source:"indoor","source-layer":"transportation",splitBy:"level",minzoom:16,paint:{color:"#d9d2e8",opacity:.95},clipToTile:true},{id:"indoor-door",type:"symbol",source:"indoor","source-layer":"poi",filter:["==","class","door"],splitBy:"level",minzoom:18,layout:{iconImage:"door",iconSize:{stops:[[18,9],[20,13]]},allowOverlap:true,priority:-10},paint:{color:"#8a8172",haloColor:"#ffffff",haloWidth:1.2}},{id:"indoor-poi",type:"symbol",source:"indoor","source-layer":"poi",splitBy:"level",minzoom:17,layout:{textField:["{name}"],iconImage:"{class}",textSize:{stops:[[17,10],[19,12]]},iconSize:{stops:[[17,12],[19,15]]},iconTextGap:2,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#4a4a4a",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:.32}},{id:"indoor-name",type:"symbol",source:"indoor","source-layer":"area_name",splitBy:"level",minzoom:17,layout:{textField:["{name}"],textSize:{stops:[[17,10.5],[19,12.5]]},maxLineChars:8},paint:{color:"#3c3830",haloColor:"#ffffff",haloWidth:1.4}},{id:"building-entrance",type:"symbol",source:"points","source-layer":"entrances",minzoom:17,layout:{iconImage:"entrance",showFor:"highlight",textField:["{ref}"],textSize:{stops:[[17,10],[19,12.5]]},allowOverlap:true,priority:40,iconRotate:"angle",placement:"map",arrowLength:{stops:[[17,22],[18,32],[19,40],[20,48],[22,56]]},arrowWidth:{stops:[[17,6],[18,8.5],[19,10.5],[20,12.5],[22,15]]},arrowOutline:{stops:[[17,1.4],[18,2],[19,2.5],[20,3],[22,3.5]]},arrowGap:{stops:[[17,14],[18,19],[19,23],[20,27],[22,31]]},arrowUnits:"pixels",iconTextGap:3,arrowDotRadius:{stops:[[17,2.2],[18,3.2],[19,4],[20,4.8],[22,5.6]]},arrowDotGap:{stops:[[17,5],[18,7],[19,9],[20,11],[22,12.5]]}},paint:{color:"#2d6ecb",haloColor:"#ffffff",haloWidth:1.6}}],sources:{indoor:{url:"/tileserver/data/indoor/{z}/{x}/{y}.pbf",minzoom:15,maxzoom:18},points:{url:"/tileserver/data/points/{z}/{x}/{y}.pbf",minzoom:13,maxzoom:16},closures:{url:"/closures/tiles/{z}/{x}/{y}.mvt",minzoom:10,maxzoom:16}}};var ii={version:1,name:"\u041E\u0431\u044A\u0451\u043C\u043D\u044B\u0439 \u0433\u043E\u0440\u043E\u0434",background:"#eceae4",light:{ambientColor:"#ffffff",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#fff4e2",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#dce6f2",fillIntensity:.18},layers:[{id:"landcover-wood",type:"surface","source-layer":"landcover",filter:["in","class","wood","forest"],paint:{color:"#c6dcb4",opacity:{stops:[[8,.5],[12,.85]]},material:"flat",sideShade:.16},elevation:.175,bevel:.125,bevelDrop:.038,cornerRadius:10,cornerSegments:4},{id:"landcover-grass",type:"surface","source-layer":"landcover",filter:["in","class","grass","farmland","meadow"],paint:{color:"#d9e6c6",opacity:{stops:[[8,.45],[12,.8]]},material:"flat",sideShade:.16},elevation:.125,bevel:.113,bevelDrop:.03,cornerRadius:8,cornerSegments:4},{id:"landcover-sand",type:"surface","source-layer":"landcover",filter:["in","class","sand","beach"],paint:{color:"#f2e7c8",material:"flat",sideShade:.16},elevation:.035,bevel:.15,bevelDrop:.02,cornerRadius:10,cornerSegments:4},{id:"landcover-ice",type:"fill","source-layer":"landcover",filter:["in","class","ice","glacier"],paint:{color:"#e6f2f7"}},{id:"landcover-wetland",type:"surface","source-layer":"landcover",filter:["in","class","wetland","swamp"],paint:{color:"#cfe0d4",material:"flat",sideShade:.16},elevation:.045,bevel:.125,bevelDrop:.02,cornerRadius:8,cornerSegments:4},{id:"landuse-residential",type:"surface","source-layer":"landuse",filter:["in","class","residential","suburb","neighbourhood","quarter"],paint:{color:"#e6e2da",opacity:{stops:[[10,.4],[14,.7]]},material:"flat",sideShade:.16},cornerRadius:4,cornerSegments:3,elevation:.02,bevel:.1,bevelDrop:.02},{id:"landuse-industrial",type:"surface","source-layer":"landuse",filter:["in","class","industrial","quarry","railway","substation"],paint:{color:"#e7e0dd",material:"flat",sideShade:.16},cornerRadius:4,cornerSegments:3,elevation:.03,bevel:.1,bevelDrop:.02},{id:"landuse-civic",type:"surface","source-layer":"landuse",filter:["in","class","school","university","college","hospital","clinic","police","kindergarten","bus_station"],paint:{color:"#ece3d8",material:"flat",sideShade:.16},cornerRadius:4,cornerSegments:3,elevation:.055,bevel:.1,bevelDrop:.02},{id:"landuse-sport",type:"surface","source-layer":"landuse",filter:["in","class","pitch","stadium","playground","track","swimming_pool"],paint:{color:"#cfe3c4",material:"flat",sideShade:.16},elevation:.088,bevel:.1,bevelDrop:.025,cornerRadius:5,cornerSegments:3},{id:"landuse-cemetery",type:"surface","source-layer":"landuse",filter:["in","class","cemetery","grave_yard"],paint:{color:"#d6dfc8",material:"flat",sideShade:.16},elevation:.075,bevel:.1,bevelDrop:.025,cornerRadius:5,cornerSegments:3},{id:"landuse-parking",type:"surface","source-layer":"landuse",filter:["in","class","parking","fuel"],paint:{color:"#e8e4dc",material:"flat",sideShade:.16},cornerRadius:3,cornerSegments:3,elevation:.19,bevel:.1,bevelDrop:.02},{id:"park",type:"surface","source-layer":"park",paint:{color:"#cfe5bd",opacity:.75,material:"flat",sideShade:.16},elevation:.15,bevel:.125,bevelDrop:.038,cornerRadius:9,cornerSegments:4},{id:"aeroway-area",type:"surface","source-layer":"aeroway",filter:["in","class","aerodrome","apron","helipad"],paint:{color:"#e4e2e6",material:"flat",sideShade:.16},cornerRadius:5,cornerSegments:3,elevation:.065,bevel:.1,bevelDrop:.02},{id:"water",type:"surface","source-layer":"water",filter:["!in","class","swimming_pool"],paint:{color:"#a5cbe3",material:"water",materialScale:14,materialSpeed:1,sideShade:0},elevation:-0.087,bevel:.2,bevelDrop:.03,cornerRadius:7,cornerSegments:4},{id:"water-pool",type:"surface","source-layer":"water",filter:["==","class","swimming_pool"],paint:{color:"#9fd3e8",material:"water",materialScale:8,materialSpeed:1,sideShade:0},elevation:-0.05,bevel:.1,bevelDrop:.02,cornerRadius:4,cornerSegments:3},{id:"waterway",type:"line","source-layer":"waterway",paint:{color:"#a5cbe3",width:{stops:[[8,.6],[12,1.4],[16,4],[19,11.5],[20,23],[21,46],[22,92]]},material:"water",materialScale:10,materialSpeed:1,elevation:-0.075}},{id:"aeroway-line",type:"line","source-layer":"aeroway",filter:["in","class","runway","taxiway"],paint:{color:"#d8d5da",width:{stops:[[10,1],[14,5],[18,24],[19,24],[20,48],[21,96],[22,192]]},material:"flat",elevation:.02}},{id:"road-casing-major",type:"line","source-layer":"transportation",filter:["in","class","motorway","trunk","primary"],minzoom:5,paint:{color:"#d4ab68",width:{stops:[[6,1.6],[10,3.4],[14,8],[16,14],[18,30],[19,45],[20,90],[21,180],[22,360]]},elevation:.037,widthFromData:true,widthExtra:2.5}},{id:"road-casing-secondary",type:"line","source-layer":"transportation",filter:["in","class","secondary","tertiary"],minzoom:9,paint:{color:"#c6bca6",width:{stops:[[10,1.6],[14,5.5],[16,10],[18,22],[19,33],[20,66],[21,132],[22,264]]},elevation:.033,widthFromData:true,widthExtra:2}},{id:"road-casing-minor",type:"line","source-layer":"transportation",filter:["in","class","minor","service","track"],minzoom:12,paint:{color:"#cdc4b2",width:{stops:[[13,1.4],[16,6],[18,14],[19,22],[20,44],[21,88],[22,176]]},elevation:.028,widthFromData:true,widthExtra:1.5}},{id:"road-rail",type:"line","source-layer":"transportation",filter:["in","class","rail","transit"],minzoom:10,paint:{color:"#b2a99e",width:{stops:[[10,.8],[14,1.8],[18,4],[19,5.5],[20,11],[21,22],[22,44]]},elevation:.03}},{id:"road-path",type:"line","source-layer":"transportation",filter:["in","class","path","pedestrian","footway","steps"],minzoom:14,paint:{color:"#bdb2a0",width:{stops:[[14,.8],[17,2],[19,4],[20,8],[21,16],[22,32]]},dashArray:[4,3],material:"flat",elevation:.013}},{id:"road-minor",type:"line","source-layer":"transportation",filter:["in","class","minor","service","track"],minzoom:12,paint:{color:"#ffffff",width:{stops:[[13,.6],[16,4],[18,11],[19,18],[20,36],[21,72],[22,144]]},material:"flat",elevation:.035,widthFromData:true}},{id:"road-secondary",type:"line","source-layer":"transportation",filter:["in","class","secondary","tertiary"],minzoom:9,paint:{color:"#ffffff",width:{stops:[[10,.8],[14,3.6],[16,7.5],[18,18],[19,28],[20,56],[21,112],[22,224]]},material:"flat",elevation:.04,widthFromData:true}},{id:"road-major",type:"line","source-layer":"transportation",filter:["in","class","motorway","trunk","primary"],minzoom:5,paint:{color:"#ffdfa3",width:{stops:[[6,.8],[10,2.2],[14,6],[16,11],[18,25],[19,38.5],[20,77],[21,154],[22,308]]},material:"flat",elevation:.045,widthFromData:true}},{id:"road-lane-divider-major",type:"line","source-layer":"transportation",filter:["all",["!has","oneway"],["in","class","motorway","trunk","primary"]],minzoom:16.5,paint:{color:"#e3bd7f",width:{stops:[[16.5,.54],[17,.78],[18,1.4],[19,2.17],[20,4.34],[21,8.68],[22,17.36]]},dashArray:[7,18],material:"flat",elevation:.047}},{id:"road-lane-divider-secondary",type:"line","source-layer":"transportation",filter:["all",["!has","oneway"],["in","class","secondary","tertiary"]],minzoom:16.5,paint:{color:"#d8cfbc",width:{stops:[[16.5,.46],[17,.67],[18,1.2],[19,1.86],[20,3.72],[21,7.44],[22,14.88]]},dashArray:[7,18],material:"flat",elevation:.042}},{id:"boundary",type:"line","source-layer":"boundary",filter:["<=","admin_level",4],paint:{color:"#b3a6b8",opacity:.7,width:{stops:[[4,.7],[10,1.4],[16,2.4]]},dashArray:[6,4]}},{id:"building",type:"fill-extrusion","source-layer":"building",minzoom:15,paint:{color:"#d8d3c8",roofColor:"#d9d3c7",opacity:1,heightScale:{stops:[[15,0],[15.8,1]]},aoStrength:.18,tintVariation:.06,windowColor:"#7f9ab5",windowFrameColor:"#e9e5dc",windowGlow:0,facadeDetail:1,floorHeight:3.2,roofVariation:.35},cornerRadius:1.6,cornerSegments:2},{id:"indoor-venue",type:"fill-extrusion",source:"indoor","source-layer":"area",filter:["all",["==","class","level"],["==","base",1]],minzoom:15,maxzoom:16,paint:{color:"#d8d3c8",roofColor:"#d9d3c7",opacity:1,aoStrength:.18,tintVariation:.06,windowColor:"#7f9ab5",windowFrameColor:"#e9e5dc",windowGlow:0,facadeDetail:1,floorHeight:3.2,roofVariation:.35}},{id:"road-closed-casing",type:"line",source:"closures","source-layer":"closures",minzoom:11,paint:{color:"#ffffff",width:{stops:[[11,4],[14,6],[17,10],[19,16],[20,32],[21,64],[22,128]]},opacity:.9},overlay:true},{id:"road-closed",type:"line",source:"closures","source-layer":"closures",minzoom:11,paint:{color:"#d92b2b",width:{stops:[[11,2.5],[14,4],[17,7],[19,11],[20,22],[21,44],[22,88]]},dashArray:[5,4]},overlay:true},{id:"crossing",type:"surface",source:"points","source-layer":"crossings",minzoom:16.5,overlay:true,paint:{color:"#ffffff",opacity:.9,sideShade:.16,material:"flat"},elevation:.023,bevel:.013,bevelDrop:.005,groundBy:{"landcover:wood":.175,"landcover:forest":.175,"landcover:grass":.125,"landcover:farmland":.125,"landcover:meadow":.125,"landcover:sand":.035,"landcover:beach":.035,"landcover:wetland":.045,"landcover:swamp":.045,"landuse:residential":.02,"landuse:suburb":.02,"landuse:neighbourhood":.02,"landuse:quarter":.02,"landuse:industrial":.03,"landuse:quarry":.03,"landuse:railway":.03,"landuse:substation":.03,"landuse:school":.055,"landuse:university":.055,"landuse:college":.055,"landuse:hospital":.055,"landuse:clinic":.055,"landuse:police":.055,"landuse:kindergarten":.055,"landuse:bus_station":.055,"landuse:pitch":.088,"landuse:stadium":.088,"landuse:playground":.088,"landuse:track":.088,"landuse:swimming_pool":.088,"landuse:cemetery":.075,"landuse:grave_yard":.075,"landuse:parking":.19,"landuse:fuel":.19,"park:park":.15,"aeroway:aerodrome":.065,"aeroway:apron":.065,"aeroway:helipad":.065}},{id:"housenumber",type:"symbol","source-layer":"housenumber",minzoom:17,layout:{textField:"{housenumber}",textSize:{stops:[[17,9],[19,11]]},maxLineChars:6,priority:-60},paint:{color:"#8c8478",haloColor:"#f5f3ee",haloWidth:1}},{id:"poi-food",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#c2681c",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#c2681c",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","cafe","restaurant","fast_food","bar","pub","beer","bakery","ice_cream"]},{id:"poi-shop",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#2f77c4",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#2f77c4",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","shop","clothing_store","grocery","alcohol_shop","music","laundry","hairdresser","car","bicycle"]},{id:"poi-transport",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#3b82a6",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#3b82a6",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","bus","railway","parking","fuel","bicycle_parking","bicycle_rental","taxi","airport"]},{id:"poi-health",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#c24444",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#c24444",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","pharmacy","hospital","doctors","dentist","veterinary"]},{id:"poi-education",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#3f7f7a",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#3f7f7a",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","school","college","university","library","kindergarten"]},{id:"poi-culture",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#8b5aa5",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#8b5aa5",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","museum","theatre","cinema","art_gallery","attraction","monument","zoo","theme_park","castle","place_of_worship","information"]},{id:"poi-sport",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#4f8b45",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#4f8b45",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","pitch","park","garden","playground","stadium","sports_centre","swimming_pool","athletics","running"]},{id:"poi-lodging",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#7a5fbf",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#7a5fbf",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","lodging"]},{id:"poi-service",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#59636e",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#59636e",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","bank","atm","post","office","town_hall","police","fire_station","toilets"]},{id:"poi",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#4a4a4a",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#4a4a4a",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["!in","class","cafe","restaurant","fast_food","bar","pub","beer","bakery","ice_cream","shop","clothing_store","grocery","alcohol_shop","music","laundry","hairdresser","car","bicycle","bus","railway","parking","fuel","bicycle_parking","bicycle_rental","taxi","airport","pharmacy","hospital","doctors","dentist","veterinary","school","college","university","library","kindergarten","museum","theatre","cinema","art_gallery","attraction","monument","zoo","theme_park","castle","place_of_worship","information","pitch","park","garden","playground","stadium","sports_centre","swimming_pool","athletics","running","lodging","bank","atm","post","office","town_hall","police","fire_station","toilets"]},{id:"traffic-signal",type:"symbol",source:"points","source-layer":"roadpoints",minzoom:16,filter:["==","kind","traffic_signals"],layout:{iconImage:"traffic_signals",priority:3},paint:{color:"#5c6470",haloColor:"#ffffff",haloWidth:1.4,iconSize:15}},{id:"road-shield",type:"symbol","source-layer":"transportation_name",filter:["has","ref"],minzoom:11,layout:{textField:"{ref}",iconImage:"shield-{ref_length}",iconPlacement:"behind",textSize:{stops:[[11,9.5],[16,11]]},iconTextGap:4,maxLineChars:10,collisionPadding:70,priority:3},paint:{color:"#3a4048",haloColor:"#f7f3e8",haloWidth:.5,iconColor:"#f7f3e8",iconHaloColor:"#8a8172",iconHaloWidth:1.4}},{id:"road-label",type:"symbol","source-layer":"transportation_name",minzoom:14,layout:{textField:["{name:ru}","{name}"],textPlacement:"line",textSize:{stops:[[14,10],[18,13]]},priority:20,abbreviate:true},paint:{color:"#5c5646",haloColor:"#ffffff",haloWidth:1.6}},{id:"water-label",type:"symbol","source-layer":"water_name",minzoom:10,layout:{textField:["{name:ru}","{name}"],textSize:{stops:[[10,11],[16,14]]},priority:30},paint:{color:"#3d7ea6",haloColor:"#ffffff",haloWidth:1.4}},{id:"place-label",type:"symbol","source-layer":"place",minzoom:4,layout:{textField:["{name:ru}","{name}"],textSize:{stops:[[6,12],[12,17],[16,22]]},maxLineChars:16,priority:90},paint:{color:"#3a3a3a",haloColor:"#ffffff",haloWidth:1.8}},{id:"indoor-shell",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","level"],minzoom:16,paint:{color:"#f6f3ec",opacity:.97},clipToTile:true},{id:"indoor-corridor",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","corridor"],minzoom:16,paint:{color:"#ffffff"},clipToTile:true},{id:"indoor-room",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["in","class","room","area"],minzoom:16,paint:{color:"#efeae0"},clipToTile:true},{id:"indoor-service",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","service"],minzoom:16,paint:{color:"#e6e1d6"},clipToTile:true},{id:"indoor-shop",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","shop"],minzoom:16,paint:{color:"#e8e0f0"},clipToTile:true},{id:"indoor-food",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","food"],minzoom:16,paint:{color:"#f7e3cd"},clipToTile:true},{id:"indoor-wc",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","wc"],minzoom:16,paint:{color:"#d8e8f2"},clipToTile:true},{id:"indoor-wall",type:"fill-extrusion",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","wall"],minzoom:16,paint:{color:"#cbc4b8",roofColor:"#e4ded2",facadeDetail:0,tintVariation:0,roofVariation:0,aoStrength:0}},{id:"indoor-transportation",type:"fill",source:"indoor","source-layer":"transportation",splitBy:"level",minzoom:16,paint:{color:"#d9d2e8",opacity:.95},clipToTile:true},{id:"indoor-door",type:"symbol",source:"indoor","source-layer":"poi",filter:["==","class","door"],splitBy:"level",minzoom:18,layout:{iconImage:"door",iconSize:{stops:[[18,9],[20,13]]},allowOverlap:true,priority:-10},paint:{color:"#8a8172",haloColor:"#ffffff",haloWidth:1.2}},{id:"indoor-poi",type:"symbol",source:"indoor","source-layer":"poi",splitBy:"level",minzoom:17,layout:{textField:["{name}"],iconImage:"{class}",textSize:{stops:[[17,10],[19,12]]},iconSize:{stops:[[17,12],[19,15]]},iconTextGap:2,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#4a4a4a",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:.32}},{id:"indoor-name",type:"symbol",source:"indoor","source-layer":"area_name",splitBy:"level",minzoom:17,layout:{textField:["{name}"],textSize:{stops:[[17,10.5],[19,12.5]]},maxLineChars:8},paint:{color:"#3c3830",haloColor:"#ffffff",haloWidth:1.4}},{id:"building-entrance",type:"symbol",source:"points","source-layer":"entrances",minzoom:17,layout:{iconImage:"entrance",showFor:"highlight",textField:["{ref}"],textSize:{stops:[[17,10],[19,12.5]]},allowOverlap:true,priority:40,iconRotate:"angle",placement:"map",arrowLength:{stops:[[17,22],[18,32],[19,40],[20,48],[22,56]]},arrowWidth:{stops:[[17,6],[18,8.5],[19,10.5],[20,12.5],[22,15]]},arrowOutline:{stops:[[17,1.4],[18,2],[19,2.5],[20,3],[22,3.5]]},arrowGap:{stops:[[17,14],[18,19],[19,23],[20,27],[22,31]]},arrowUnits:"pixels",iconTextGap:3,arrowDotRadius:{stops:[[17,2.2],[18,3.2],[19,4],[20,4.8],[22,5.6]]},arrowDotGap:{stops:[[17,5],[18,7],[19,9],[20,11],[22,12.5]]}},paint:{color:"#2d6ecb",haloColor:"#ffffff",haloWidth:1.6}}],sources:{indoor:{url:"/tileserver/data/indoor/{z}/{x}/{y}.pbf",minzoom:15,maxzoom:18},points:{url:"/tileserver/data/points/{z}/{x}/{y}.pbf",minzoom:13,maxzoom:16},closures:{url:"/closures/tiles/{z}/{x}/{y}.mvt",minzoom:10,maxzoom:16}}};var ai={name:"\u041D\u043E\u0447\u043D\u0430\u044F",background:"#11151c",model3dKey:"night",light:{ambientColor:"#8fa3c4",ambientIntensity:.34,keyAzimuth:120,keyAltitude:55,keyColor:"#cfd8ea",keyIntensity:.3,fillAzimuth:300,fillAltitude:20,fillColor:"#4a5f86",fillIntensity:.22},paint:{"landcover-wood":{color:"#16261a"},"landcover-grass":{color:"#182619"},"landcover-sand":{color:"#2a2417"},"landcover-ice":{color:"#1b2730"},"landcover-wetland":{color:"#16242a"},"landuse-residential":{color:"#171b23"},"landuse-industrial":{color:"#1b1c20"},"landuse-civic":{color:"#1c1f28"},"landuse-sport":{color:"#16261c"},"landuse-cemetery":{color:"#182018"},"landuse-parking":{color:"#191d24"},park:{color:"#15271a"},"aeroway-area":{color:"#1b1e26"},water:{color:"#0f2438"},"water-pool":{color:"#123048"},waterway:{color:"#14304a"},"aeroway-line":{color:"#242833"},"road-casing-major":{color:"#2a2519"},"road-casing-secondary":{color:"#22262f"},"road-casing-minor":{color:"#1e222a"},"road-rail":{color:"#333842"},"road-path":{color:"#2a2e36"},"road-minor":{color:"#2f343d"},"road-secondary":{color:"#3c424d"},"road-major":{color:"#6b5c3c"},boundary:{color:"#4a3f52"},building:{color:"#232833",roofColor:"#2b313d",aoStrength:.3,tintVariation:.1,windowColor:"#8fb8e8",windowFrameColor:"#39424f",windowGlow:.35},housenumber:{color:"#5f6672",haloColor:"#12161d"},poi:{color:"#c3ccd9",haloColor:"#12161d",haloWidth:1.3},"road-label":{color:"#a8b0bd",haloColor:"#12161d",haloWidth:1.5},"water-label":{color:"#6ea2c7",haloColor:"#0e1b28"},"place-label":{color:"#e2e7ee",haloColor:"#10141b",haloWidth:2},"poi-food":{color:"#d89964",haloColor:"#12161d",haloWidth:1.3,frameColor:"#d89964",frameOpacity:1,frameHaloColor:"#12161d",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-shop":{color:"#699cd4",haloColor:"#12161d",haloWidth:1.3,frameColor:"#699cd4",frameOpacity:1,frameHaloColor:"#12161d",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-transport":{color:"#75acc8",haloColor:"#12161d",haloWidth:1.3,frameColor:"#75acc8",frameOpacity:1,frameHaloColor:"#12161d",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-health":{color:"#ca7272",haloColor:"#12161d",haloWidth:1.3,frameColor:"#ca7272",frameOpacity:1,frameHaloColor:"#12161d",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-education":{color:"#81bbb7",haloColor:"#12161d",haloWidth:1.3,frameColor:"#81bbb7",frameOpacity:1,frameHaloColor:"#12161d",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-culture":{color:"#a684b8",haloColor:"#12161d",haloWidth:1.3,frameColor:"#a684b8",frameOpacity:1,frameHaloColor:"#12161d",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-sport":{color:"#89bb81",haloColor:"#12161d",haloWidth:1.3,frameColor:"#89bb81",frameOpacity:1,frameHaloColor:"#12161d",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-lodging":{color:"#8e79c3",haloColor:"#12161d",haloWidth:1.3,frameColor:"#8e79c3",frameOpacity:1,frameHaloColor:"#12161d",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-service":{color:"#959ea7",haloColor:"#12161d",haloWidth:1.3,frameColor:"#959ea7",frameOpacity:1,frameHaloColor:"#12161d",iconColor:"#1b1b1b",iconHaloWidth:0},"building-entrance":{color:"#79a0d7",haloColor:"#12161d"},"indoor-shell":{color:"#3a4254",opacity:.97},"indoor-corridor":{color:"#363d4e"},"indoor-room":{color:"#414a5f"},"indoor-service":{color:"#535f79"},"indoor-shop":{color:"#5c4672"},"indoor-food":{color:"#725d46"},"indoor-wc":{color:"#466172"},"indoor-wall":{color:"#697183",roofColor:"#868c99",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#65548a",opacity:.95},"indoor-door":{color:"#c3ccd9",haloColor:"#12161d",haloWidth:1.3},"indoor-poi":{color:"#c3ccd9",haloColor:"#12161d",haloWidth:1.3},"indoor-name":{color:"#e2e7ee",haloColor:"#10141b",haloWidth:2}},sky:{skyColor:"#080d18",horizonColor:"#1b2436",fogRange:[1.3,6.5],fogIntensity:.9,spaceColor:"#02030a",atmosphereColor:"#3f6fa8",starIntensity:.8}};var li={name:"\u0413\u0440\u0430\u0444\u0438\u0442",background:"#eeeeee",light:{ambientColor:"#ffffff",ambientIntensity:.55,keyAzimuth:120,keyAltitude:60,keyColor:"#ffffff",keyIntensity:.5,fillAzimuth:300,fillAltitude:25,fillColor:"#ffffff",fillIntensity:.16},paint:{"landcover-wood":{color:"#e2e2e2"},"landcover-grass":{color:"#e7e7e7"},"landcover-sand":{color:"#eaeaea"},"landcover-ice":{color:"#f0f0f0"},"landcover-wetland":{color:"#e4e4e4"},"landuse-residential":{color:"#e9e9e9"},"landuse-industrial":{color:"#e5e5e5"},"landuse-civic":{color:"#ebebeb"},"landuse-sport":{color:"#e4e4e4"},"landuse-cemetery":{color:"#e6e6e6"},"landuse-parking":{color:"#ececec"},park:{color:"#e3e3e3"},"aeroway-area":{color:"#e8e8e8"},water:{color:"#d4d4d4"},"water-pool":{color:"#d8d8d8"},waterway:{color:"#d4d4d4"},"aeroway-line":{color:"#dedede"},"road-casing-major":{color:"#c9c9c9"},"road-casing-secondary":{color:"#d2d2d2"},"road-casing-minor":{color:"#d8d8d8"},"road-rail":{color:"#c2c2c2"},"road-path":{color:"#d0d0d0"},"road-minor":{color:"#f7f7f7"},"road-secondary":{color:"#fbfbfb"},"road-major":{color:"#ffffff"},boundary:{color:"#b0b0b0"},building:{color:"#dcdcdc",roofColor:"#e0e0e0",aoStrength:.22,tintVariation:.05,windowColor:"#b7bcc2",windowFrameColor:"#f2f2f2",windowGlow:0},housenumber:{color:"#9a9a9a",haloColor:"#f4f4f4"},poi:{color:"#3c3c3c",haloColor:"#ffffff"},"road-label":{color:"#585858",haloColor:"#ffffff"},"water-label":{color:"#6e6e6e",haloColor:"#ffffff"},"place-label":{color:"#2a2a2a",haloColor:"#ffffff"},"poi-food":{color:"#3c3c3c",haloColor:"#ffffff",frameColor:"#3c3c3c",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{color:"#3c3c3c",haloColor:"#ffffff",frameColor:"#3c3c3c",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{color:"#3c3c3c",haloColor:"#ffffff",frameColor:"#3c3c3c",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{color:"#3c3c3c",haloColor:"#ffffff",frameColor:"#3c3c3c",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{color:"#3c3c3c",haloColor:"#ffffff",frameColor:"#3c3c3c",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{color:"#3c3c3c",haloColor:"#ffffff",frameColor:"#3c3c3c",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{color:"#3c3c3c",haloColor:"#ffffff",frameColor:"#3c3c3c",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{color:"#3c3c3c",haloColor:"#ffffff",frameColor:"#3c3c3c",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{color:"#3c3c3c",haloColor:"#ffffff",frameColor:"#3c3c3c",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"building-entrance":{color:"#564e4e",haloColor:"#ffffff"},"indoor-shell":{color:"#e9e9e9",opacity:.97},"indoor-corridor":{color:"#eeeeee"},"indoor-room":{color:"#e2e2e2"},"indoor-service":{color:"#cecece"},"indoor-shop":{color:"#d7cfdf"},"indoor-food":{color:"#dfd7cf"},"indoor-wc":{color:"#cfd9df"},"indoor-wall":{color:"#c0c0c0",roofColor:"#d4d4d4",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#c2bbd1",opacity:.95},"indoor-door":{color:"#3c3c3c",haloColor:"#ffffff"},"indoor-poi":{color:"#3c3c3c",haloColor:"#ffffff"},"indoor-name":{color:"#2a2a2a",haloColor:"#ffffff"}},sky:{skyColor:"#8f96a0",horizonColor:"#d7dade",fogRange:[1.35,7.5],fogIntensity:.9,spaceColor:"#07080b",atmosphereColor:"#9aa3ad",starIntensity:.5}};var si={name:"\u0411\u043B\u0435\u0434\u043D\u0430\u044F",background:"#f7f6f3",light:{ambientColor:"#ffffff",ambientIntensity:.62,keyAzimuth:120,keyAltitude:65,keyColor:"#fffaf0",keyIntensity:.38,fillAzimuth:300,fillAltitude:25,fillColor:"#eef2f8",fillIntensity:.14},paint:{"landcover-wood":{color:"#e8efe2"},"landcover-grass":{color:"#edf2e6"},"landcover-sand":{color:"#f4eede"},"landcover-ice":{color:"#f0f5f7"},"landcover-wetland":{color:"#e8f0ec"},"landuse-residential":{color:"#f2f0ec"},"landuse-industrial":{color:"#f0edeb"},"landuse-civic":{color:"#f4efe9"},"landuse-sport":{color:"#e9f1e4"},"landuse-cemetery":{color:"#ecefe6"},"landuse-parking":{color:"#f3f1ed"},park:{color:"#e7f0df"},"aeroway-area":{color:"#f0f0f2"},water:{color:"#dce9f2"},"water-pool":{color:"#dcecf5"},waterway:{color:"#dce9f2"},"aeroway-line":{color:"#ebebee"},"road-casing-major":{color:"#efe4d2"},"road-casing-secondary":{color:"#eceae2"},"road-casing-minor":{color:"#efedE6"},"road-rail":{color:"#e0dcd6"},"road-path":{color:"#e6e2da"},"road-minor":{color:"#fdfcfa"},"road-secondary":{color:"#ffffff"},"road-major":{color:"#fff8e8"},boundary:{color:"#cfc3d2"},building:{color:"#eae7e0",roofColor:"#ecE9e2",aoStrength:.14,tintVariation:.04,windowColor:"#c7d6e4",windowFrameColor:"#f6f7f9",windowGlow:0},housenumber:{color:"#a9a296",haloColor:"#fbfaf7"},poi:{color:"#6b6b6b",haloColor:"#ffffff"},"road-label":{color:"#8a8474",haloColor:"#ffffff"},"water-label":{color:"#7ea8c4",haloColor:"#ffffff"},"place-label":{color:"#55524c",haloColor:"#ffffff"},"poi-food":{color:"#6b6b6b",haloColor:"#ffffff",frameColor:"#6b6b6b",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{color:"#6b6b6b",haloColor:"#ffffff",frameColor:"#6b6b6b",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{color:"#6b6b6b",haloColor:"#ffffff",frameColor:"#6b6b6b",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{color:"#6b6b6b",haloColor:"#ffffff",frameColor:"#6b6b6b",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{color:"#6b6b6b",haloColor:"#ffffff",frameColor:"#6b6b6b",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{color:"#6b6b6b",haloColor:"#ffffff",frameColor:"#6b6b6b",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{color:"#6b6b6b",haloColor:"#ffffff",frameColor:"#6b6b6b",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{color:"#6b6b6b",haloColor:"#ffffff",frameColor:"#6b6b6b",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{color:"#6b6b6b",haloColor:"#ffffff",frameColor:"#6b6b6b",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"building-entrance":{color:"#564e4e",haloColor:"#ffffff"},"indoor-shell":{color:"#f4f3f0",opacity:.97},"indoor-corridor":{color:"#f8f7f6"},"indoor-room":{color:"#edece8"},"indoor-service":{color:"#dcd9d1"},"indoor-shop":{color:"#e0dae6"},"indoor-food":{color:"#e6e0da"},"indoor-wc":{color:"#dae1e6"},"indoor-wall":{color:"#cdcbc4",roofColor:"#e0dedb",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#ccc5d9",opacity:.95},"indoor-door":{color:"#6b6b6b",haloColor:"#ffffff"},"indoor-poi":{color:"#6b6b6b",haloColor:"#ffffff"},"indoor-name":{color:"#55524c",haloColor:"#ffffff"}},sky:{skyColor:"#c8dbee",horizonColor:"#eef2f6",fogRange:[1.4,9],fogIntensity:.85,spaceColor:"#0a1018",atmosphereColor:"#9fd0ff",starIntensity:.45}};var ci={name:"\u041E\u0431\u044A\u0451\u043C\u043D\u0430\u044F",background:"#f0ecea",light:{ambientColor:"#f8f8f8",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#ffffff",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#dee8ed",fillIntensity:.18},paint:{"landcover-wood":{color:"#9bda95"},"landcover-grass":{color:"#b2e6a8"},"landcover-sand":{color:"#efeac8"},"landcover-ice":{color:"#d5e8f1"},"landcover-wetland":{color:"#badbde"},"landuse-residential":{color:"#f4f2f1"},"landuse-industrial":{color:"#dadce7"},"landuse-civic":{color:"#ecdae0"},"landuse-sport":{color:"#bbeba2"},"landuse-cemetery":{color:"#c2e2bb"},"landuse-parking":{color:"#e0dddc"},park:{color:"#b2e6a8"},"aeroway-area":{color:"#d6dbeb"},water:{color:"#94d8f9"},waterway:{color:"#94d8f9"},"aeroway-line":{color:"#f0ede9"},"road-casing-major":{color:"#8997b3"},"road-casing-secondary":{color:"#9da7be"},"road-casing-minor":{color:"#9da7be"},"road-rail":{color:"#9e9e9e"},"road-path":{color:"#bbc1d3"},"road-minor":{color:"#bbc1d3"},"road-secondary":{color:"#bbc1d3"},"road-major":{color:"#99abc2"},boundary:{color:"#f66f91"},building:{color:"#ede7de",roofColor:"#ede7de",aoStrength:.19,tintVariation:.06,windowColor:"#6b9ed1",windowFrameColor:"#eef0f4",windowGlow:0},housenumber:{color:"#2e2e2e",haloColor:"#ffffff",haloWidth:1.4},poi:{color:"#586e84",haloColor:"#ffffff",haloWidth:1.4},"road-label":{color:"#2e2e2e",haloColor:"#ffffff",haloWidth:1.4},"water-label":{color:"#35688d",haloColor:"#f7f7f7",haloWidth:1.4},"place-label":{color:"#2e2e2e",haloColor:"#ffffff",haloWidth:1.4},"poi-food":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#c2681c",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#2f77c4",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#3b82a6",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#c24444",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#3f7f7a",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#8b5aa5",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#4f8b45",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#7a5fbf",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#59636e",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"water-pool":{color:"#a7e1fd"},"indoor-shell":{color:"#f4f3f1",opacity:.97},"indoor-corridor":{color:"#f8f8f6"},"indoor-room":{color:"#eeece8"},"indoor-service":{color:"#ddd8d2"},"indoor-shop":{color:"#e0dae7"},"indoor-food":{color:"#e7e1da"},"indoor-wc":{color:"#dae2e7"},"indoor-wall":{color:"#cecac5",roofColor:"#e0dedc",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#ccc6d9",opacity:.95},"indoor-door":{color:"#586e84",haloColor:"#ffffff",haloWidth:1.4},"indoor-poi":{color:"#586e84",haloColor:"#ffffff",haloWidth:1.4},"indoor-name":{color:"#2e2e2e",haloColor:"#ffffff",haloWidth:1.4},"building-entrance":{color:"#225aaa",haloColor:"#ffffff"}},sky:{skyColor:"#91b8cb",horizonColor:"#dfd9d6",fogRange:[1.34,7.36],fogIntensity:.86,spaceColor:"#0e0b0a",atmosphereColor:"#5daad0",starIntensity:.38}};var fi={name:"\u041C\u0443\u043B\u044C\u0442\u044F\u0448\u043D\u0430\u044F",background:"#f7f3de",light:{ambientColor:"#f8f7f7",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#ffffff",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#dee8ed",fillIntensity:.18},paint:{"landcover-wood":{color:"#61d161"},"landcover-grass":{color:"#91e481"},"landcover-sand":{color:"#efeac8"},"landcover-ice":{color:"#c7dfeb"},"landcover-wetland":{color:"#9fccd1"},"landuse-residential":{color:"#f2ecd9"},"landuse-industrial":{color:"#d7d9e4"},"landuse-civic":{color:"#ead7dd"},"landuse-sport":{color:"#9fec79"},"landuse-cemetery":{color:"#a8d69f"},"landuse-parking":{color:"#dddcda"},park:{color:"#91e481"},"aeroway-area":{color:"#d6dbeb"},water:{color:"#71c8f4"},waterway:{color:"#71c8f4"},"aeroway-line":{color:"#f0ede9"},"road-casing-major":{color:"#ca6a16"},"road-casing-secondary":{color:"#5a6faf"},"road-casing-minor":{color:"#5a6faf"},"road-rail":{color:"#737373"},"road-path":{color:"#ffffff"},"road-minor":{color:"#ffffff"},"road-secondary":{color:"#ffffff"},"road-major":{color:"#f8c662"},boundary:{color:"#f6517a"},building:{color:"#f4dfc2",roofColor:"#f4dfc2",aoStrength:.19,tintVariation:.06,windowColor:"#5b9ee0",windowFrameColor:"#ffffff",windowGlow:0},housenumber:{color:"#222b59",haloColor:"#ffffff",haloWidth:1.4},poi:{color:"#f05a0f",haloColor:"#ffffff",haloWidth:1.4},"road-label":{color:"#222b59",haloColor:"#ffffff",haloWidth:1.4},"water-label":{color:"#35688d",haloColor:"#f7f7f7",haloWidth:1.4},"place-label":{color:"#222b59",haloColor:"#ffffff",haloWidth:1.4},"poi-food":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#c2681c",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#2f77c4",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#3b82a6",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#c24444",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#3f7f7a",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#8b5aa5",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#4f8b45",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#7a5fbf",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#59636e",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"water-pool":{color:"#80d1fa"},"indoor-shell":{color:"#ebe9e5",opacity:.97},"indoor-corridor":{color:"#efedea"},"indoor-room":{color:"#e5e1dc"},"indoor-service":{color:"#d4cec6"},"indoor-shop":{color:"#d6cede"},"indoor-food":{color:"#ded6ce"},"indoor-wc":{color:"#ced8de"},"indoor-wall":{color:"#c4c0ba",roofColor:"#d6d4d0",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#c1b9d1",opacity:.95},"indoor-door":{color:"#f05a0f",haloColor:"#ffffff",haloWidth:1.4},"indoor-poi":{color:"#f05a0f",haloColor:"#ffffff",haloWidth:1.4},"indoor-name":{color:"#222b59",haloColor:"#ffffff",haloWidth:1.4},"building-entrance":{color:"#225aaa",haloColor:"#ffffff"}},sky:{skyColor:"#8cb5c9",horizonColor:"#e8e2c7",fogRange:[1.34,7.35],fogIntensity:.86,spaceColor:"#131105",atmosphereColor:"#5ca9d0",starIntensity:.39}};var ui={name:"\u041A\u0438\u0431\u0435\u0440\u043F\u0430\u043D\u043A",background:"#120817",model3dKey:"night",light:{ambientColor:"#b279cf",ambientIntensity:.34,keyAzimuth:120,keyAltitude:55,keyColor:"#ff70d0",keyIntensity:.28,fillAzimuth:300,fillAltitude:25,fillColor:"#854770",fillIntensity:.22},paint:{"landcover-wood":{color:"#0c3728"},"landcover-grass":{color:"#104131"},"landcover-sand":{color:"#262417"},"landcover-ice":{color:"#74345f"},"landcover-wetland":{color:"#152223"},"landuse-residential":{color:"#170b1e"},"landuse-industrial":{color:"#171921"},"landuse-civic":{color:"#21171a"},"landuse-sport":{color:"#0c4529"},"landuse-cemetery":{color:"#151e1b"},"landuse-parking":{color:"#272428"},park:{color:"#104131"},"aeroway-area":{color:"#1a1c23"},water:{color:"#5f1145"},waterway:{color:"#711452"},"aeroway-line":{color:"#55493a"},"road-casing-major":{color:"#981662"},"road-casing-secondary":{color:"#6a1b6a"},"road-casing-minor":{color:"#6a1b6a"},"road-rail":{color:"#39acac"},"road-path":{color:"#12e2e2"},"road-minor":{color:"#12e2e2"},"road-secondary":{color:"#12e2e2"},"road-major":{color:"#f631a4"},boundary:{color:"#f53da8"},building:{color:"#311839",roofColor:"#9d2575",aoStrength:.29,tintVariation:.1,windowColor:"#84dcff",windowFrameColor:"#84dcff",windowGlow:.5},housenumber:{color:"#acf6f6",haloColor:"#110514",haloWidth:1.4},poi:{color:"#f6e95a",haloColor:"#110514",haloWidth:1.4},"road-label":{color:"#acf6f6",haloColor:"#110514",haloWidth:1.4},"water-label":{color:"#9fbcd1",haloColor:"#131b20",haloWidth:1.4},"place-label":{color:"#acf6f6",haloColor:"#110514",haloWidth:1.4},"poi-food":{color:"#d89964",haloColor:"#110514",haloWidth:1.4,frameColor:"#d89964",frameOpacity:1,frameHaloColor:"#110514",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-shop":{color:"#699cd4",haloColor:"#110514",haloWidth:1.4,frameColor:"#699cd4",frameOpacity:1,frameHaloColor:"#110514",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-transport":{color:"#75acc8",haloColor:"#110514",haloWidth:1.4,frameColor:"#75acc8",frameOpacity:1,frameHaloColor:"#110514",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-health":{color:"#ca7272",haloColor:"#110514",haloWidth:1.4,frameColor:"#ca7272",frameOpacity:1,frameHaloColor:"#110514",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-education":{color:"#81bbb7",haloColor:"#110514",haloWidth:1.4,frameColor:"#81bbb7",frameOpacity:1,frameHaloColor:"#110514",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-culture":{color:"#a684b8",haloColor:"#110514",haloWidth:1.4,frameColor:"#a684b8",frameOpacity:1,frameHaloColor:"#110514",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-sport":{color:"#89bb81",haloColor:"#110514",haloWidth:1.4,frameColor:"#89bb81",frameOpacity:1,frameHaloColor:"#110514",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-lodging":{color:"#8e79c3",haloColor:"#110514",haloWidth:1.4,frameColor:"#8e79c3",frameOpacity:1,frameHaloColor:"#110514",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-service":{color:"#959ea7",haloColor:"#110514",haloWidth:1.4,frameColor:"#959ea7",frameOpacity:1,frameHaloColor:"#110514",iconColor:"#1b1b1b",iconHaloWidth:0},"water-pool":{color:"#84135f"},"indoor-shell":{color:"#4c3752",opacity:.97},"indoor-corridor":{color:"#46334c"},"indoor-room":{color:"#553e5d"},"indoor-service":{color:"#6e5078"},"indoor-shop":{color:"#59446f"},"indoor-food":{color:"#6f5a44"},"indoor-wc":{color:"#445e6f"},"indoor-wall":{color:"#7b6681",roofColor:"#938298",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#635287",opacity:.95},"indoor-door":{color:"#f6e95a",haloColor:"#110514",haloWidth:1.4},"indoor-poi":{color:"#f6e95a",haloColor:"#110514",haloWidth:1.4},"indoor-name":{color:"#acf6f6",haloColor:"#110514",haloWidth:1.4},"building-entrance":{color:"#79a0d7",haloColor:"#110514"}},sky:{skyColor:"#180813",horizonColor:"#281831",fogRange:[1.3,6.5],fogIntensity:.9,spaceColor:"#060308",atmosphereColor:"#b5358b",starIntensity:.82}};var di={name:"\u0420\u0430\u0441\u0441\u0432\u0435\u0442",background:"#f4ebe1",light:{ambientColor:"#f8f7f7",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#ffe0c0",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#dee7ed",fillIntensity:.18},paint:{"landcover-wood":{color:"#a4db9f"},"landcover-grass":{color:"#bae7b1"},"landcover-sand":{color:"#efeac8"},"landcover-ice":{color:"#dbe7f0"},"landcover-wetland":{color:"#c1dee1"},"landuse-residential":{color:"#f5efeb"},"landuse-industrial":{color:"#d7d9e4"},"landuse-civic":{color:"#ead7dd"},"landuse-sport":{color:"#c1ecac"},"landuse-cemetery":{color:"#c8e5c2"},"landuse-parking":{color:"#dddbda"},park:{color:"#bae7b1"},"aeroway-area":{color:"#d6dbeb"},water:{color:"#a6d2f2"},waterway:{color:"#a6d2f2"},"aeroway-line":{color:"#f0ede9"},"road-casing-major":{color:"#92a1bf"},"road-casing-secondary":{color:"#a6afc9"},"road-casing-minor":{color:"#a6afc9"},"road-rail":{color:"#b5a49b"},"road-path":{color:"#c3c9df"},"road-minor":{color:"#c3c9df"},"road-secondary":{color:"#c3c9df"},"road-major":{color:"#a9b9d1"},boundary:{color:"#f584a1"},building:{color:"#f6ebdf",roofColor:"#fdede7",aoStrength:.19,tintVariation:.06,windowColor:"#6b9ed1",windowFrameColor:"#f0ece8",windowGlow:0},housenumber:{color:"#46332a",haloColor:"#fdfaf7",haloWidth:1.4},poi:{color:"#56738f",haloColor:"#fdfaf7",haloWidth:1.4},"road-label":{color:"#46332a",haloColor:"#fdfaf7",haloWidth:1.4},"water-label":{color:"#35688d",haloColor:"#f7f7f7",haloWidth:1.4},"place-label":{color:"#46332a",haloColor:"#fdfaf7",haloWidth:1.4},"poi-food":{haloColor:"#fdfaf7",haloWidth:1.4,frameColor:"#c2681c",frameOpacity:1,frameHaloColor:"#fdfaf7",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{haloColor:"#fdfaf7",haloWidth:1.4,frameColor:"#2f77c4",frameOpacity:1,frameHaloColor:"#fdfaf7",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{haloColor:"#fdfaf7",haloWidth:1.4,frameColor:"#3b82a6",frameOpacity:1,frameHaloColor:"#fdfaf7",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{haloColor:"#fdfaf7",haloWidth:1.4,frameColor:"#c24444",frameOpacity:1,frameHaloColor:"#fdfaf7",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{haloColor:"#fdfaf7",haloWidth:1.4,frameColor:"#3f7f7a",frameOpacity:1,frameHaloColor:"#fdfaf7",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{haloColor:"#fdfaf7",haloWidth:1.4,frameColor:"#8b5aa5",frameOpacity:1,frameHaloColor:"#fdfaf7",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{haloColor:"#fdfaf7",haloWidth:1.4,frameColor:"#4f8b45",frameOpacity:1,frameHaloColor:"#fdfaf7",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{haloColor:"#fdfaf7",haloWidth:1.4,frameColor:"#7a5fbf",frameOpacity:1,frameHaloColor:"#fdfaf7",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{haloColor:"#fdfaf7",haloWidth:1.4,frameColor:"#59636e",frameOpacity:1,frameHaloColor:"#fdfaf7",iconColor:"#ffffff",iconHaloWidth:0},"water-pool":{color:"#b9ddf7"},"indoor-shell":{color:"#f8f7f5",opacity:.97},"indoor-corridor":{color:"#fcfbfb"},"indoor-room":{color:"#f1efed"},"indoor-service":{color:"#e0dbd6"},"indoor-shop":{color:"#e4dfea"},"indoor-food":{color:"#eae4df"},"indoor-wc":{color:"#dfe5ea"},"indoor-wall":{color:"#d1cdc9",roofColor:"#e4e2e0",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#d0cbdc",opacity:.95},"indoor-door":{color:"#56738f",haloColor:"#fdfaf7",haloWidth:1.4},"indoor-poi":{color:"#56738f",haloColor:"#fdfaf7",haloWidth:1.4},"indoor-name":{color:"#46332a",haloColor:"#fdfaf7",haloWidth:1.4},"building-entrance":{color:"#225aaa",haloColor:"#fdfaf7"}},sky:{skyColor:"#8cb0c9",horizonColor:"#e4d7cb",fogRange:[1.34,7.35],fogIntensity:.86,spaceColor:"#120c07",atmosphereColor:"#5c9fd0",starIntensity:.39}};var hi={name:"\u0421\u0443\u043C\u0435\u0440\u043A\u0438",background:"#d7cbc1",light:{ambientColor:"#ececeb",ambientIntensity:.46,keyAzimuth:120,keyAltitude:59,keyColor:"#ffcaa0",keyIntensity:.56,fillAzimuth:300,fillAltitude:25,fillColor:"#c7d0e1",fillIntensity:.19},paint:{"landcover-wood":{color:"#75af6a"},"landcover-grass":{color:"#94bd7f"},"landcover-sand":{color:"#efeac8"},"landcover-ice":{color:"#c1c8d7"},"landcover-wetland":{color:"#83bec3"},"landuse-residential":{color:"#d5cac3"},"landuse-industrial":{color:"#b3b7cc"},"landuse-civic":{color:"#d5aebb"},"landuse-sport":{color:"#91c775"},"landuse-cemetery":{color:"#9ac982"},"landuse-parking":{color:"#c0bcb9"},park:{color:"#94bd7f"},"aeroway-area":{color:"#d6dbeb"},water:{color:"#708bc2"},waterway:{color:"#708bc2"},"aeroway-line":{color:"#f0ede9"},"road-casing-major":{color:"#6a5b9a"},"road-casing-secondary":{color:"#7078a4"},"road-casing-minor":{color:"#7078a4"},"road-rail":{color:"#93796c"},"road-path":{color:"#8f94b7"},"road-minor":{color:"#8f94b7"},"road-secondary":{color:"#8f94b7"},"road-major":{color:"#8576b2"},boundary:{color:"#e05275"},building:{color:"#e0d1c2",roofColor:"#f1d6cb",aoStrength:.2,tintVariation:.07,windowColor:"#6b9ed1",windowFrameColor:"#efe6df",windowGlow:0},housenumber:{color:"#2c283e",haloColor:"#f5ebe0",haloWidth:1.4},poi:{color:"#64568f",haloColor:"#f5ebe0",haloWidth:1.4},"road-label":{color:"#2c283e",haloColor:"#f5ebe0",haloWidth:1.4},"water-label":{color:"#35688d",haloColor:"#f7f7f7",haloWidth:1.4},"place-label":{color:"#2c283e",haloColor:"#f5ebe0",haloWidth:1.4},"poi-food":{haloColor:"#f5ebe0",haloWidth:1.4,frameColor:"#c2681c",frameOpacity:1,frameHaloColor:"#f5ebe0",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{haloColor:"#f5ebe0",haloWidth:1.4,frameColor:"#2f77c4",frameOpacity:1,frameHaloColor:"#f5ebe0",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{haloColor:"#f5ebe0",haloWidth:1.4,frameColor:"#3b82a6",frameOpacity:1,frameHaloColor:"#f5ebe0",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{haloColor:"#f5ebe0",haloWidth:1.4,frameColor:"#c24444",frameOpacity:1,frameHaloColor:"#f5ebe0",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{haloColor:"#f5ebe0",haloWidth:1.4,frameColor:"#3f7f7a",frameOpacity:1,frameHaloColor:"#f5ebe0",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{haloColor:"#f5ebe0",haloWidth:1.4,frameColor:"#8b5aa5",frameOpacity:1,frameHaloColor:"#f5ebe0",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{haloColor:"#f5ebe0",haloWidth:1.4,frameColor:"#4f8b45",frameOpacity:1,frameHaloColor:"#f5ebe0",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{haloColor:"#f5ebe0",haloWidth:1.4,frameColor:"#7a5fbf",frameOpacity:1,frameHaloColor:"#f5ebe0",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{haloColor:"#f5ebe0",haloWidth:1.4,frameColor:"#59636e",frameOpacity:1,frameHaloColor:"#f5ebe0",iconColor:"#ffffff",iconHaloWidth:0},"water-pool":{color:"#7a94ca"},"indoor-shell":{color:"#e3deda",opacity:.97},"indoor-corridor":{color:"#e7e3df"},"indoor-room":{color:"#dcd7d1"},"indoor-service":{color:"#cbc3ba"},"indoor-shop":{color:"#ccc2d6"},"indoor-food":{color:"#d6ccc2"},"indoor-wc":{color:"#c2ced6"},"indoor-wall":{color:"#bbb5af",roofColor:"#cdc9c6",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#b6adc9",opacity:.95},"indoor-door":{color:"#64568f",haloColor:"#f5ebe0",haloWidth:1.4},"indoor-poi":{color:"#64568f",haloColor:"#f5ebe0",haloWidth:1.4},"indoor-name":{color:"#2c283e",haloColor:"#f5ebe0",haloWidth:1.4},"building-entrance":{haloColor:"#f5ebe0"}},sky:{skyColor:"#5675b3",horizonColor:"#c0b4aa",fogRange:[1.33,7.14],fogIntensity:.87,spaceColor:"#0e0b09",atmosphereColor:"#557dce",starIntensity:.45}};var mi={name:"\u0417\u0435\u043C\u043B\u044F",background:"#dbd1bd",light:{ambientColor:"#edecea",ambientIntensity:.46,keyAzimuth:120,keyAltitude:59,keyColor:"#fff2dc",keyIntensity:.56,fillAzimuth:300,fillAltitude:25,fillColor:"#c7d6e1",fillIntensity:.19},paint:{"landcover-wood":{color:"#50a136"},"landcover-grass":{color:"#8ac76b"},"landcover-sand":{color:"#efeac8"},"landcover-ice":{color:"#aec5d6"},"landcover-wetland":{color:"#7cbac0"},"landuse-residential":{color:"#ded5c4"},"landuse-industrial":{color:"#b3b7cc"},"landuse-civic":{color:"#d5aebb"},"landuse-sport":{color:"#86d161"},"landuse-cemetery":{color:"#94c67b"},"landuse-parking":{color:"#c0beb9"},park:{color:"#8ac76b"},"aeroway-area":{color:"#d6dbeb"},water:{color:"#3b91ce"},waterway:{color:"#4798d1"},"aeroway-line":{color:"#f0ede9"},"road-casing-major":{color:"#a47546"},"road-casing-secondary":{color:"#a79376"},"road-casing-minor":{color:"#a79376"},"road-rail":{color:"#877564"},"road-path":{color:"#c6bba9"},"road-minor":{color:"#c6bba9"},"road-secondary":{color:"#c6bba9"},"road-major":{color:"#cdaa7a"},boundary:{color:"#bf6a40"},building:{color:"#d4c5af",roofColor:"#d4c5af",aoStrength:.2,tintVariation:.07,windowColor:"#9fb0c0",windowFrameColor:"#eceae4",windowGlow:0},housenumber:{color:"#46382a",haloColor:"#f7f4ee",haloWidth:1.4},poi:{color:"#7c5c3c",haloColor:"#f7f4ee",haloWidth:1.4},"road-label":{color:"#46382a",haloColor:"#f7f4ee",haloWidth:1.4},"water-label":{color:"#35688d",haloColor:"#f7f7f7",haloWidth:1.4},"place-label":{color:"#46382a",haloColor:"#f7f4ee",haloWidth:1.4},"poi-food":{haloColor:"#f7f4ee",haloWidth:1.4,frameColor:"#c2681c",frameOpacity:1,frameHaloColor:"#f7f4ee",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{haloColor:"#f7f4ee",haloWidth:1.4,frameColor:"#2f77c4",frameOpacity:1,frameHaloColor:"#f7f4ee",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{haloColor:"#f7f4ee",haloWidth:1.4,frameColor:"#3b82a6",frameOpacity:1,frameHaloColor:"#f7f4ee",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{haloColor:"#f7f4ee",haloWidth:1.4,frameColor:"#c24444",frameOpacity:1,frameHaloColor:"#f7f4ee",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{haloColor:"#f7f4ee",haloWidth:1.4,frameColor:"#3f7f7a",frameOpacity:1,frameHaloColor:"#f7f4ee",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{haloColor:"#f7f4ee",haloWidth:1.4,frameColor:"#8b5aa5",frameOpacity:1,frameHaloColor:"#f7f4ee",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{haloColor:"#f7f4ee",haloWidth:1.4,frameColor:"#4f8b45",frameOpacity:1,frameHaloColor:"#f7f4ee",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{haloColor:"#f7f4ee",haloWidth:1.4,frameColor:"#7a5fbf",frameOpacity:1,frameHaloColor:"#f7f4ee",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{haloColor:"#f7f4ee",haloWidth:1.4,frameColor:"#59636e",frameOpacity:1,frameHaloColor:"#f7f4ee",iconColor:"#ffffff",iconHaloWidth:0},"water-pool":{color:"#4299d7"},"indoor-shell":{color:"#d6d0c8",opacity:.97},"indoor-corridor":{color:"#d9d5cd"},"indoor-room":{color:"#cfc9bf"},"indoor-service":{color:"#beb5a9"},"indoor-shop":{color:"#bcafca"},"indoor-food":{color:"#cabdaf"},"indoor-wc":{color:"#afbfca"},"indoor-wall":{color:"#ada79e",roofColor:"#bebbb5",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#a69bbc",opacity:.95},"indoor-door":{color:"#7c5c3c",haloColor:"#f7f4ee",haloWidth:1.4},"indoor-poi":{color:"#7c5c3c",haloColor:"#f7f4ee",haloWidth:1.4},"indoor-name":{color:"#46382a",haloColor:"#f7f4ee",haloWidth:1.4},"building-entrance":{haloColor:"#f7f4ee"}},sky:{skyColor:"#568db3",horizonColor:"#c4baa5",fogRange:[1.33,7.14],fogIntensity:.87,spaceColor:"#0f0c08",atmosphereColor:"#559cce",starIntensity:.45}};var pi={name:"\u0424\u0443\u0442\u0443\u0440\u0438\u0437\u043C",background:"#0c0f1d",model3dKey:"night",light:{ambientColor:"#8590c7",ambientIntensity:.34,keyAzimuth:120,keyAltitude:55,keyColor:"#8ff0ff",keyIntensity:.28,fillAzimuth:300,fillAltitude:25,fillColor:"#477b85",fillIntensity:.22},paint:{"landcover-wood":{color:"#123026"},"landcover-grass":{color:"#18392e"},"landcover-sand":{color:"#2d2a1b"},"landcover-ice":{color:"#276672"},"landcover-wetland":{color:"#192829"},"landuse-residential":{color:"#111422"},"landuse-industrial":{color:"#1b1d27"},"landuse-civic":{color:"#271b1f"},"landuse-sport":{color:"#143d29"},"landuse-cemetery":{color:"#192420"},"landuse-parking":{color:"#292a2e"},park:{color:"#18392e"},"aeroway-area":{color:"#1e2129"},water:{color:"#055261"},waterway:{color:"#076a7e"},"aeroway-line":{color:"#55493a"},"road-casing-major":{color:"#8b238b"},"road-casing-secondary":{color:"#185662"},"road-casing-minor":{color:"#185662"},"road-rail":{color:"#8546a4"},"road-path":{color:"#22b6c3"},"road-minor":{color:"#22b6c3"},"road-secondary":{color:"#22b6c3"},"road-major":{color:"#e03ee0"},boundary:{color:"#eb47eb"},building:{color:"#1e2b3e",roofColor:"#277686",aoStrength:.29,tintVariation:.1,windowColor:"#84dcff",windowFrameColor:"#bfe6ff",windowGlow:.5},housenumber:{color:"#c6edf1",haloColor:"#080a17",haloWidth:1.4},poi:{color:"#eb84eb",haloColor:"#080a17",haloWidth:1.4},"road-label":{color:"#c6edf1",haloColor:"#080a17",haloWidth:1.4},"water-label":{color:"#9fbcd1",haloColor:"#131b20",haloWidth:1.4},"place-label":{color:"#c6edf1",haloColor:"#080a17",haloWidth:1.4},"poi-food":{color:"#d89964",haloColor:"#080a17",haloWidth:1.4,frameColor:"#d89964",frameOpacity:1,frameHaloColor:"#080a17",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-shop":{color:"#699cd4",haloColor:"#080a17",haloWidth:1.4,frameColor:"#699cd4",frameOpacity:1,frameHaloColor:"#080a17",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-transport":{color:"#75acc8",haloColor:"#080a17",haloWidth:1.4,frameColor:"#75acc8",frameOpacity:1,frameHaloColor:"#080a17",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-health":{color:"#ca7272",haloColor:"#080a17",haloWidth:1.4,frameColor:"#ca7272",frameOpacity:1,frameHaloColor:"#080a17",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-education":{color:"#81bbb7",haloColor:"#080a17",haloWidth:1.4,frameColor:"#81bbb7",frameOpacity:1,frameHaloColor:"#080a17",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-culture":{color:"#a684b8",haloColor:"#080a17",haloWidth:1.4,frameColor:"#a684b8",frameOpacity:1,frameHaloColor:"#080a17",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-sport":{color:"#89bb81",haloColor:"#080a17",haloWidth:1.4,frameColor:"#89bb81",frameOpacity:1,frameHaloColor:"#080a17",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-lodging":{color:"#8e79c3",haloColor:"#080a17",haloWidth:1.4,frameColor:"#8e79c3",frameOpacity:1,frameHaloColor:"#080a17",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-service":{color:"#959ea7",haloColor:"#080a17",haloWidth:1.4,frameColor:"#959ea7",frameOpacity:1,frameHaloColor:"#080a17",iconColor:"#1b1b1b",iconHaloWidth:0},"water-pool":{color:"#027288"},"indoor-shell":{color:"#394556",opacity:.97},"indoor-corridor":{color:"#354050"},"indoor-room":{color:"#404d60"},"indoor-service":{color:"#52637b"},"indoor-shop":{color:"#5c4672"},"indoor-food":{color:"#725d46"},"indoor-wc":{color:"#466172"},"indoor-wall":{color:"#687485",roofColor:"#858e9a",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#66558a",opacity:.95},"indoor-door":{color:"#eb84eb",haloColor:"#080a17",haloWidth:1.4},"indoor-poi":{color:"#eb84eb",haloColor:"#080a17",haloWidth:1.4},"indoor-name":{color:"#c6edf1",haloColor:"#080a17",haloWidth:1.4},"building-entrance":{color:"#79a0d7",haloColor:"#080a17"}},sky:{skyColor:"#081619",horizonColor:"#1b1f30",fogRange:[1.3,6.51],fogIntensity:.9,spaceColor:"#030408",atmosphereColor:"#35a1b7",starIntensity:.81}};var bi={name:"\u0421\u0442\u0435\u043A\u043B\u043E \u043C\u044F\u0433\u043A\u043E\u0435",background:"#f2f5f7",light:{ambientColor:"#fbfbfb",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#ffffff",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#dee9ed",fillIntensity:.18},paint:{"landcover-wood":{color:"#bddbc3"},"landcover-grass":{color:"#d0ecda"},"landcover-sand":{color:"#efeac8"},"landcover-ice":{color:"#cbebdb"},"landcover-wetland":{color:"#d9ebed"},"landuse-residential":{color:"#f6f7f9"},"landuse-industrial":{color:"#e3e5ed"},"landuse-civic":{color:"#f1e4e8"},"landuse-sport":{color:"#cdefd4"},"landuse-cemetery":{color:"#dbf0e3"},"landuse-parking":{color:"#e4e6e7"},park:{color:"#ccead9"},"aeroway-area":{color:"#d6dbeb"},water:{color:"#b9e5f4"},waterway:{color:"#81c6e4"},"aeroway-line":{color:"#f0ede9"},"road-casing-major":{color:"#dabc95"},"road-casing-secondary":{color:"#d5cdb8"},"road-casing-minor":{color:"#cad1d8"},"road-rail":{color:"#a5a0b1"},"road-path":{color:"#9fbcad"},"road-minor":{color:"#ffffff"},"road-secondary":{color:"#fbf6ea"},"road-major":{color:"#f8e5c3"},boundary:{color:"#ce97c0"},building:{color:"#e5ebf0",roofColor:"#f7fbfd",aoStrength:.18,tintVariation:.06,windowColor:"#bcd4e8",windowFrameColor:"#dfe8f2",windowGlow:0},housenumber:{color:"#4e6779",haloColor:"#fbfdfe",haloWidth:1.4},poi:{color:"#4e6779",haloColor:"#fbfdfe",haloWidth:1.4},"road-label":{color:"#2f3f50",haloColor:"#fbfdfe",haloWidth:1.4},"water-label":{color:"#35688d",haloColor:"#f7f7f7",haloWidth:1.4},"place-label":{color:"#2f3f50",haloColor:"#fbfdfe",haloWidth:1.4},"poi-food":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#c2681c",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#2f77c4",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#3b82a6",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#c24444",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#3f7f7a",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#8b5aa5",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#4f8b45",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#7a5fbf",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#59636e",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"water-pool":{color:"#ceeef9"},"indoor-shell":{color:"#f5f7f8",opacity:.97},"indoor-corridor":{color:"#fbfbfc"},"indoor-room":{color:"#edeff1"},"indoor-service":{color:"#d6dce0"},"indoor-shop":{color:"#e4dfea"},"indoor-food":{color:"#eae4df"},"indoor-wc":{color:"#dfe5ea"},"indoor-wall":{color:"#c9ced1",roofColor:"#e0e2e4",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#d0cbdc",opacity:.95},"indoor-door":{color:"#4e6779",haloColor:"#fbfdfe",haloWidth:1.4},"indoor-poi":{color:"#4e6779",haloColor:"#fbfdfe",haloWidth:1.4},"indoor-name":{color:"#2f3f50",haloColor:"#fbfdfe",haloWidth:1.4},"building-entrance":{color:"#225aaa",haloColor:"#fbfdfe"}},sky:{skyColor:"#9fc5d2",horizonColor:"#dfe3e8",fogRange:[1.35,7.42],fogIntensity:.85,spaceColor:"#090c0f",atmosphereColor:"#5fb3d0",starIntensity:.37}};var yi={name:"\u0421\u0442\u0435\u043A\u043B\u043E",background:"#f2f5f7",light:{ambientColor:"#fbfbfb",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#ffffff",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#dee9ed",fillIntensity:.18},paint:{"landcover-wood":{color:"#b8e0cf"},"landcover-grass":{color:"#cbebdb"},"landcover-sand":{color:"#efeac8"},"landcover-ice":{color:"#e5f0f3"},"landcover-wetland":{color:"#d6e9eb"},"landuse-residential":{color:"#f6f7f9"},"landuse-industrial":{color:"#e3e5ed"},"landuse-civic":{color:"#f1e4e8"},"landuse-sport":{color:"#c8efd5"},"landuse-cemetery":{color:"#d8eee3"},"landuse-parking":{color:"#e4e6e7"},park:{color:"#cbebdb"},"aeroway-area":{color:"#d6dbeb"},water:{color:"#bee6f4"},waterway:{color:"#bee6f4"},"aeroway-line":{color:"#f0ede9"},"road-casing-major":{color:"#9dc7dd"},"road-casing-secondary":{color:"#bdcfdb"},"road-casing-minor":{color:"#bdcfdb"},"road-rail":{color:"#adb9c2"},"road-path":{color:"#d6e2eb"},"road-minor":{color:"#d6e2eb"},"road-secondary":{color:"#d6e2eb"},"road-major":{color:"#b8daea"},boundary:{color:"#e28dc6"},building:{color:"#e8eef3",roofColor:"#f4f8fb",aoStrength:.18,tintVariation:.06,windowColor:"#bcd4e8",windowFrameColor:"#dfe8f2",windowGlow:0},housenumber:{color:"#2d4053",haloColor:"#fbfdfe",haloWidth:1.4},poi:{color:"#457aa1",haloColor:"#fbfdfe",haloWidth:1.4},"road-label":{color:"#2d4053",haloColor:"#fbfdfe",haloWidth:1.4},"water-label":{color:"#35688d",haloColor:"#f7f7f7",haloWidth:1.4},"place-label":{color:"#2d4053",haloColor:"#fbfdfe",haloWidth:1.4},"poi-food":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#c2681c",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#2f77c4",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#3b82a6",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#c24444",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#3f7f7a",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#8b5aa5",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#4f8b45",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#7a5fbf",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#59636e",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"water-pool":{color:"#d3eff9"},"indoor-shell":{color:"#f5f7f8",opacity:.97},"indoor-corridor":{color:"#fbfbfc"},"indoor-room":{color:"#edeff1"},"indoor-service":{color:"#d6dce0"},"indoor-shop":{color:"#e4dfea"},"indoor-food":{color:"#eae4df"},"indoor-wc":{color:"#dfe5ea"},"indoor-wall":{color:"#c9ced1",roofColor:"#e0e2e4",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#d0cbdc",opacity:.95},"indoor-door":{color:"#457aa1",haloColor:"#fbfdfe",haloWidth:1.4},"indoor-poi":{color:"#457aa1",haloColor:"#fbfdfe",haloWidth:1.4},"indoor-name":{color:"#2d4053",haloColor:"#fbfdfe",haloWidth:1.4},"building-entrance":{color:"#225aaa",haloColor:"#fbfdfe"}},sky:{skyColor:"#9fc5d2",horizonColor:"#dfe3e8",fogRange:[1.35,7.42],fogIntensity:.85,spaceColor:"#090c10",atmosphereColor:"#5fb3d0",starIntensity:.37}};var gi={name:"\u0413\u0430\u0440\u043C\u043E\u043D\u0438\u044F \u0447\u0451\u0440\u043D\u0430\u044F",background:"#1a1a1a",model3dKey:"night",light:{ambientColor:"#a8a8a8",ambientIntensity:.34,keyAzimuth:120,keyAltitude:55,keyColor:"#cccccc",keyIntensity:.29,fillAzimuth:300,fillAltitude:25,fillColor:"#854747",fillIntensity:.22},paint:{"landcover-wood":{color:"#212121"},"landcover-grass":{color:"#292929"},"landcover-sand":{color:"#33301f"},"landcover-ice":{color:"#545454"},"landcover-wetland":{color:"#1d2e30"},"landuse-residential":{color:"#1f1f1f"},"landuse-industrial":{color:"#1f222d"},"landuse-civic":{color:"#2d1f24"},"landuse-sport":{color:"#2d2525"},"landuse-cemetery":{color:"#2a1d1d"},"landuse-parking":{color:"#332e2e"},park:{color:"#292929"},"aeroway-area":{color:"#23262f"},water:{color:"#383838"},waterway:{color:"#3d3d3d"},"aeroway-line":{color:"#55493a"},"road-casing-major":{color:"#525252"},"road-casing-secondary":{color:"#383838"},"road-casing-minor":{color:"#383838"},"road-rail":{color:"#595959"},"road-path":{color:"#525252"},"road-minor":{color:"#525252"},"road-secondary":{color:"#525252"},"road-major":{color:"#757575"},boundary:{color:"#808080"},building:{color:"#2e2e2e",roofColor:"#4f4f4f",aoStrength:.29,tintVariation:.1,windowColor:"#8fb8e8",windowFrameColor:"#c8ccd4",windowGlow:.36},housenumber:{color:"#d9d9d9",haloColor:"#0a0a0a",haloWidth:1.4},poi:{color:"#a3a3a3",haloColor:"#0a0a0a",haloWidth:1.4},"road-label":{color:"#d9d9d9",haloColor:"#0a0a0a",haloWidth:1.4},"water-label":{color:"#9fbcd1",haloColor:"#131b20",haloWidth:1.4},"place-label":{color:"#d9d9d9",haloColor:"#0a0a0a",haloWidth:1.4},"poi-food":{color:"#a3a3a3",haloColor:"#0a0a0a",haloWidth:1.4,frameColor:"#a3a3a3",frameOpacity:1,frameHaloColor:"#0a0a0a",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-shop":{color:"#a3a3a3",haloColor:"#0a0a0a",haloWidth:1.4,frameColor:"#a3a3a3",frameOpacity:1,frameHaloColor:"#0a0a0a",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-transport":{color:"#a3a3a3",haloColor:"#0a0a0a",haloWidth:1.4,frameColor:"#a3a3a3",frameOpacity:1,frameHaloColor:"#0a0a0a",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-health":{color:"#a3a3a3",haloColor:"#0a0a0a",haloWidth:1.4,frameColor:"#a3a3a3",frameOpacity:1,frameHaloColor:"#0a0a0a",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-education":{color:"#a3a3a3",haloColor:"#0a0a0a",haloWidth:1.4,frameColor:"#a3a3a3",frameOpacity:1,frameHaloColor:"#0a0a0a",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-culture":{color:"#a3a3a3",haloColor:"#0a0a0a",haloWidth:1.4,frameColor:"#a3a3a3",frameOpacity:1,frameHaloColor:"#0a0a0a",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-sport":{color:"#a3a3a3",haloColor:"#0a0a0a",haloWidth:1.4,frameColor:"#a3a3a3",frameOpacity:1,frameHaloColor:"#0a0a0a",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-lodging":{color:"#a3a3a3",haloColor:"#0a0a0a",haloWidth:1.4,frameColor:"#a3a3a3",frameOpacity:1,frameHaloColor:"#0a0a0a",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-service":{color:"#a3a3a3",haloColor:"#0a0a0a",haloWidth:1.4,frameColor:"#a3a3a3",frameOpacity:1,frameHaloColor:"#0a0a0a",iconColor:"#1b1b1b",iconHaloWidth:0},"water-pool":{color:"#4c4c4c"},"indoor-shell":{color:"#484848",opacity:.97},"indoor-corridor":{color:"#424242"},"indoor-room":{color:"#505050"},"indoor-service":{color:"#676767"},"indoor-shop":{color:"#5c4672"},"indoor-food":{color:"#725d46"},"indoor-wc":{color:"#466172"},"indoor-wall":{color:"#767676",roofColor:"#909090",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#66558a",opacity:.95},"indoor-door":{color:"#a3a3a3",haloColor:"#0a0a0a",haloWidth:1.4},"indoor-poi":{color:"#a3a3a3",haloColor:"#0a0a0a",haloWidth:1.4},"indoor-name":{color:"#d9d9d9",haloColor:"#0a0a0a",haloWidth:1.4},"building-entrance":{color:"#cac4c4",haloColor:"#0a0a0a"}},sky:{skyColor:"#190909",horizonColor:"#282828",fogRange:[1.3,6.51],fogIntensity:.9,spaceColor:"#060606",atmosphereColor:"#b83535",starIntensity:.8}};var vi={name:"\u0413\u0430\u0440\u043C\u043E\u043D\u0438\u044F \u0441\u0438\u043D\u044F\u044F",background:"#e3e9f2",light:{ambientColor:"#f7f7f7",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#eef4ff",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#dee5ed",fillIntensity:.18},paint:{"landcover-wood":{color:"#a1b8ce"},"landcover-grass":{color:"#bdccdb"},"landcover-sand":{color:"#efeac8"},"landcover-ice":{color:"#baccde"},"landcover-wetland":{color:"#c1dee1"},"landuse-residential":{color:"#ebeff4"},"landuse-industrial":{color:"#d7d9e4"},"landuse-civic":{color:"#ead7dd"},"landuse-sport":{color:"#b8d3e0"},"landuse-cemetery":{color:"#c2d4e5"},"landuse-parking":{color:"#dadbdd"},park:{color:"#bdccdb"},"aeroway-area":{color:"#d6dbeb"},water:{color:"#5799db"},waterway:{color:"#5f9edd"},"aeroway-line":{color:"#f0ede9"},"road-casing-major":{color:"#407fbf"},"road-casing-secondary":{color:"#80a1c6"},"road-casing-minor":{color:"#80a1c6"},"road-rail":{color:"#738dab"},"road-path":{color:"#b0c5dd"},"road-minor":{color:"#b0c5dd"},"road-secondary":{color:"#b0c5dd"},"road-major":{color:"#71a3d6"},boundary:{color:"#478cd1"},building:{color:"#cfdae8",roofColor:"#e5edf6",aoStrength:.19,tintVariation:.06,windowColor:"#6b9ed1",windowFrameColor:"#e8eef6",windowGlow:0},housenumber:{color:"#1f395c",haloColor:"#fbfcfe",haloWidth:1.4},poi:{color:"#3e6da3",haloColor:"#fbfcfe",haloWidth:1.4},"road-label":{color:"#1f395c",haloColor:"#fbfcfe",haloWidth:1.4},"water-label":{color:"#35688d",haloColor:"#f7f7f7",haloWidth:1.4},"place-label":{color:"#1f395c",haloColor:"#fbfcfe",haloWidth:1.4},"poi-food":{haloColor:"#fbfcfe",haloWidth:1.4,frameColor:"#c2681c",frameOpacity:1,frameHaloColor:"#fbfcfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{haloColor:"#fbfcfe",haloWidth:1.4,frameColor:"#2f77c4",frameOpacity:1,frameHaloColor:"#fbfcfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{haloColor:"#fbfcfe",haloWidth:1.4,frameColor:"#3b82a6",frameOpacity:1,frameHaloColor:"#fbfcfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{haloColor:"#fbfcfe",haloWidth:1.4,frameColor:"#c24444",frameOpacity:1,frameHaloColor:"#fbfcfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{haloColor:"#fbfcfe",haloWidth:1.4,frameColor:"#3f7f7a",frameOpacity:1,frameHaloColor:"#fbfcfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{haloColor:"#fbfcfe",haloWidth:1.4,frameColor:"#8b5aa5",frameOpacity:1,frameHaloColor:"#fbfcfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{haloColor:"#fbfcfe",haloWidth:1.4,frameColor:"#4f8b45",frameOpacity:1,frameHaloColor:"#fbfcfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{haloColor:"#fbfcfe",haloWidth:1.4,frameColor:"#7a5fbf",frameOpacity:1,frameHaloColor:"#fbfcfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{haloColor:"#fbfcfe",haloWidth:1.4,frameColor:"#59636e",frameOpacity:1,frameHaloColor:"#fbfcfe",iconColor:"#ffffff",iconHaloWidth:0},"water-pool":{color:"#61a2e3"},"indoor-shell":{color:"#e6e8ec",opacity:.97},"indoor-corridor":{color:"#ebedf0"},"indoor-room":{color:"#dde1e5"},"indoor-service":{color:"#c6ccd4"},"indoor-shop":{color:"#d6cedf"},"indoor-food":{color:"#dfd7ce"},"indoor-wc":{color:"#ced8df"},"indoor-wall":{color:"#babfc5",roofColor:"#d1d4d7",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#c1bad1",opacity:.95},"indoor-door":{color:"#3e6da3",haloColor:"#fbfcfe",haloWidth:1.4},"indoor-poi":{color:"#3e6da3",haloColor:"#fbfcfe",haloWidth:1.4},"indoor-name":{color:"#1f395c",haloColor:"#fbfcfe",haloWidth:1.4},"building-entrance":{color:"#225aaa",haloColor:"#fbfcfe"}},sky:{skyColor:"#8cabc9",horizonColor:"#ced6e1",fogRange:[1.34,7.35],fogIntensity:.86,spaceColor:"#080b10",atmosphereColor:"#5c96d0",starIntensity:.39}};var wi={name:"\u0413\u0430\u0440\u043C\u043E\u043D\u0438\u044F \u0437\u0435\u043B\u0451\u043D\u0430\u044F",background:"#dfecdf",light:{ambientColor:"#f5f6f5",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#f0fff0",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#dcece7",fillIntensity:.18},paint:{"landcover-wood":{color:"#5ccc65"},"landcover-grass":{color:"#8cd98c"},"landcover-sand":{color:"#efeac8"},"landcover-ice":{color:"#bbd8ce"},"landcover-wetland":{color:"#9fccd1"},"landuse-residential":{color:"#e6efe6"},"landuse-industrial":{color:"#d1d4e0"},"landuse-civic":{color:"#e7d0d7"},"landuse-sport":{color:"#94e085"},"landuse-cemetery":{color:"#9fd69f"},"landuse-parking":{color:"#d4d8d4"},park:{color:"#8cd98c"},"aeroway-area":{color:"#d6dbeb"},water:{color:"#5ec9a6"},waterway:{color:"#66ccaa"},"aeroway-line":{color:"#f0ede9"},"road-casing-major":{color:"#44a754"},"road-casing-secondary":{color:"#7fbd7f"},"road-casing-minor":{color:"#7fbd7f"},"road-rail":{color:"#72a172"},"road-path":{color:"#afd4af"},"road-minor":{color:"#afd4af"},"road-secondary":{color:"#afd4af"},"road-major":{color:"#64c474"},boundary:{color:"#39c668"},building:{color:"#cfe2cb",roofColor:"#dff1df",aoStrength:.19,tintVariation:.06,windowColor:"#6b9ed1",windowFrameColor:"#e8f0e8",windowGlow:0},housenumber:{color:"#1c4a24",haloColor:"#f8fcf8",haloWidth:1.4},poi:{color:"#358d44",haloColor:"#f8fcf8",haloWidth:1.4},"road-label":{color:"#1c4a24",haloColor:"#f8fcf8",haloWidth:1.4},"water-label":{color:"#35688d",haloColor:"#f7f7f7",haloWidth:1.4},"place-label":{color:"#1c4a24",haloColor:"#f8fcf8",haloWidth:1.4},"poi-food":{haloColor:"#f8fcf8",haloWidth:1.4,frameColor:"#c2681c",frameOpacity:1,frameHaloColor:"#f8fcf8",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{haloColor:"#f8fcf8",haloWidth:1.4,frameColor:"#2f77c4",frameOpacity:1,frameHaloColor:"#f8fcf8",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{haloColor:"#f8fcf8",haloWidth:1.4,frameColor:"#3b82a6",frameOpacity:1,frameHaloColor:"#f8fcf8",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{haloColor:"#f8fcf8",haloWidth:1.4,frameColor:"#c24444",frameOpacity:1,frameHaloColor:"#f8fcf8",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{haloColor:"#f8fcf8",haloWidth:1.4,frameColor:"#3f7f7a",frameOpacity:1,frameHaloColor:"#f8fcf8",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{haloColor:"#f8fcf8",haloWidth:1.4,frameColor:"#8b5aa5",frameOpacity:1,frameHaloColor:"#f8fcf8",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{haloColor:"#f8fcf8",haloWidth:1.4,frameColor:"#4f8b45",frameOpacity:1,frameHaloColor:"#f8fcf8",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{haloColor:"#f8fcf8",haloWidth:1.4,frameColor:"#7a5fbf",frameOpacity:1,frameHaloColor:"#f8fcf8",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{haloColor:"#f8fcf8",haloWidth:1.4,frameColor:"#59636e",frameOpacity:1,frameHaloColor:"#f8fcf8",iconColor:"#ffffff",iconHaloWidth:0},"water-pool":{color:"#67d1af"},"indoor-shell":{color:"#e1e8e0",opacity:.97},"indoor-corridor":{color:"#e6ece5"},"indoor-room":{color:"#d9e1d7"},"indoor-service":{color:"#c3d0c1"},"indoor-shop":{color:"#d1c8db"},"indoor-food":{color:"#dbd2c8"},"indoor-wc":{color:"#c8d4db"},"indoor-wall":{color:"#b7c0b5",roofColor:"#cdd2cc",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#bcb4cd",opacity:.95},"indoor-door":{color:"#358d44",haloColor:"#f8fcf8",haloWidth:1.4},"indoor-poi":{color:"#358d44",haloColor:"#f8fcf8",haloWidth:1.4},"indoor-name":{color:"#1c4a24",haloColor:"#f8fcf8",haloWidth:1.4},"building-entrance":{color:"#225aaa",haloColor:"#f8fcf8"}},sky:{skyColor:"#83c5af",horizonColor:"#cad9ca",fogRange:[1.34,7.31],fogIntensity:.86,spaceColor:"#090f09",atmosphereColor:"#5bcfa9",starIntensity:.4}};var xi={name:"\u041B\u0443\u043D\u043D\u0430\u044F",background:"#c8cbd0",light:{ambientColor:"#ebecec",ambientIntensity:.46,keyAzimuth:120,keyAltitude:59,keyColor:"#e8ecf2",keyIntensity:.56,fillAzimuth:300,fillAltitude:25,fillColor:"#c7d0e1",fillIntensity:.19},paint:{"landcover-wood":{color:"#a8abb3"},"landcover-grass":{color:"#b9bbc1"},"landcover-sand":{color:"#efeac8"},"landcover-ice":{color:"#cbcdd2"},"landcover-wetland":{color:"#acd4d7"},"landuse-residential":{color:"#ced0d4"},"landuse-industrial":{color:"#b3b7cc"},"landuse-civic":{color:"#d5aebb"},"landuse-sport":{color:"#b2bdc7"},"landuse-cemetery":{color:"#adbddc"},"landuse-parking":{color:"#b9bcc0"},park:{color:"#b9bbc1"},"aeroway-area":{color:"#d6dbeb"},water:{color:"#929aaa"},waterway:{color:"#929aaa"},"aeroway-line":{color:"#f0ede9"},"road-casing-major":{color:"#6c7689"},"road-casing-secondary":{color:"#848b9a"},"road-casing-minor":{color:"#848b9a"},"road-rail":{color:"#7e838b"},"road-path":{color:"#acb0b9"},"road-minor":{color:"#acb0b9"},"road-secondary":{color:"#acb0b9"},"road-major":{color:"#949ba8"},boundary:{color:"#6a7181"},building:{color:"#c8cbd0",roofColor:"#d9dbdd",aoStrength:.2,tintVariation:.07,windowColor:"#9fb0c0",windowFrameColor:"#cfd6e0",windowGlow:0},housenumber:{color:"#31363f",haloColor:"#f1f2f4",haloWidth:1.4},poi:{color:"#606876",haloColor:"#f1f2f4",haloWidth:1.4},"road-label":{color:"#31363f",haloColor:"#f1f2f4",haloWidth:1.4},"water-label":{color:"#35688d",haloColor:"#f7f7f7",haloWidth:1.4},"place-label":{color:"#31363f",haloColor:"#f1f2f4",haloWidth:1.4},"poi-food":{haloColor:"#f1f2f4",haloWidth:1.4,frameColor:"#c2681c",frameOpacity:1,frameHaloColor:"#f1f2f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{haloColor:"#f1f2f4",haloWidth:1.4,frameColor:"#2f77c4",frameOpacity:1,frameHaloColor:"#f1f2f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{haloColor:"#f1f2f4",haloWidth:1.4,frameColor:"#3b82a6",frameOpacity:1,frameHaloColor:"#f1f2f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{haloColor:"#f1f2f4",haloWidth:1.4,frameColor:"#c24444",frameOpacity:1,frameHaloColor:"#f1f2f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{haloColor:"#f1f2f4",haloWidth:1.4,frameColor:"#3f7f7a",frameOpacity:1,frameHaloColor:"#f1f2f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{haloColor:"#f1f2f4",haloWidth:1.4,frameColor:"#8b5aa5",frameOpacity:1,frameHaloColor:"#f1f2f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{haloColor:"#f1f2f4",haloWidth:1.4,frameColor:"#4f8b45",frameOpacity:1,frameHaloColor:"#f1f2f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{haloColor:"#f1f2f4",haloWidth:1.4,frameColor:"#7a5fbf",frameOpacity:1,frameHaloColor:"#f1f2f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{haloColor:"#f1f2f4",haloWidth:1.4,frameColor:"#59636e",frameOpacity:1,frameHaloColor:"#f1f2f4",iconColor:"#ffffff",iconHaloWidth:0},"water-pool":{color:"#9ca4b3"},"indoor-shell":{color:"#d6d9dc",opacity:.97},"indoor-corridor":{color:"#dbdde0"},"indoor-room":{color:"#ced1d5"},"indoor-service":{color:"#b9bcc3"},"indoor-shop":{color:"#c7bcd2"},"indoor-food":{color:"#d2c7bc"},"indoor-wc":{color:"#bcc9d2"},"indoor-wall":{color:"#acafb4",roofColor:"#c2c4c7",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#b1a7c5",opacity:.95},"indoor-door":{color:"#606876",haloColor:"#f1f2f4",haloWidth:1.4},"indoor-poi":{color:"#606876",haloColor:"#f1f2f4",haloWidth:1.4},"indoor-name":{color:"#31363f",haloColor:"#f1f2f4",haloWidth:1.4},"building-entrance":{haloColor:"#f1f2f4"}},sky:{skyColor:"#5675b3",horizonColor:"#b1b4b9",fogRange:[1.33,7.14],fogIntensity:.87,spaceColor:"#0a0b0c",atmosphereColor:"#557dce",starIntensity:.45}};var _i={name:"\u041C\u0430\u0442\u043E\u0432\u0430\u044F",background:"#e7e6e4",light:{ambientColor:"#f5f5f5",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#ffffff",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#dce6ec",fillIntensity:.18},paint:{"landcover-wood":{color:"#a3be9d"},"landcover-grass":{color:"#b3cbae"},"landcover-sand":{color:"#efeac8"},"landcover-ice":{color:"#d6dce0"},"landcover-wetland":{color:"#acd4d7"},"landuse-residential":{color:"#ecebe9"},"landuse-industrial":{color:"#d1d4e0"},"landuse-civic":{color:"#e7d0d7"},"landuse-sport":{color:"#b6d2a7"},"landuse-cemetery":{color:"#b5dcad"},"landuse-parking":{color:"#d8d6d4"},park:{color:"#b3cbae"},"aeroway-area":{color:"#d6dbeb"},water:{color:"#a6bbc9"},waterway:{color:"#a6bbc9"},"aeroway-line":{color:"#f0ede9"},"road-casing-major":{color:"#969fb0"},"road-casing-secondary":{color:"#abb0ba"},"road-casing-minor":{color:"#abb0ba"},"road-rail":{color:"#adadad"},"road-path":{color:"#c7cad1"},"road-minor":{color:"#c7cad1"},"road-secondary":{color:"#c7cad1"},"road-major":{color:"#aeb4c2"},boundary:{color:"#ca919f"},building:{color:"#dad6d2",roofColor:"#e3e0dd",aoStrength:.19,tintVariation:.06,windowColor:"#9fb0c0",windowFrameColor:"#f0f0f2",windowGlow:0},housenumber:{color:"#4d4742",haloColor:"#f6f5f4",haloWidth:1.4},poi:{color:"#707a8f",haloColor:"#f6f5f4",haloWidth:1.4},"road-label":{color:"#4d4742",haloColor:"#f6f5f4",haloWidth:1.4},"water-label":{color:"#35688d",haloColor:"#f7f7f7",haloWidth:1.4},"place-label":{color:"#4d4742",haloColor:"#f6f5f4",haloWidth:1.4},"poi-food":{haloColor:"#f6f5f4",haloWidth:1.4,frameColor:"#c2681c",frameOpacity:1,frameHaloColor:"#f6f5f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{haloColor:"#f6f5f4",haloWidth:1.4,frameColor:"#2f77c4",frameOpacity:1,frameHaloColor:"#f6f5f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{haloColor:"#f6f5f4",haloWidth:1.4,frameColor:"#3b82a6",frameOpacity:1,frameHaloColor:"#f6f5f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{haloColor:"#f6f5f4",haloWidth:1.4,frameColor:"#c24444",frameOpacity:1,frameHaloColor:"#f6f5f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{haloColor:"#f6f5f4",haloWidth:1.4,frameColor:"#3f7f7a",frameOpacity:1,frameHaloColor:"#f6f5f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{haloColor:"#f6f5f4",haloWidth:1.4,frameColor:"#8b5aa5",frameOpacity:1,frameHaloColor:"#f6f5f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{haloColor:"#f6f5f4",haloWidth:1.4,frameColor:"#4f8b45",frameOpacity:1,frameHaloColor:"#f6f5f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{haloColor:"#f6f5f4",haloWidth:1.4,frameColor:"#7a5fbf",frameOpacity:1,frameHaloColor:"#f6f5f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{haloColor:"#f6f5f4",haloWidth:1.4,frameColor:"#59636e",frameOpacity:1,frameHaloColor:"#f6f5f4",iconColor:"#ffffff",iconHaloWidth:0},"water-pool":{color:"#b3c6d2"},"indoor-shell":{color:"#e6e3e1",opacity:.97},"indoor-corridor":{color:"#eae8e6"},"indoor-room":{color:"#dfdcd8"},"indoor-service":{color:"#cdc8c2"},"indoor-shop":{color:"#d1c8da"},"indoor-food":{color:"#dad1c8"},"indoor-wc":{color:"#c8d3da"},"indoor-wall":{color:"#bebab6",roofColor:"#d1cecc",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#bbb3cd",opacity:.95},"indoor-door":{color:"#707a8f",haloColor:"#f6f5f4",haloWidth:1.4},"indoor-poi":{color:"#707a8f",haloColor:"#f6f5f4",haloWidth:1.4},"indoor-name":{color:"#4d4742",haloColor:"#f6f5f4",haloWidth:1.4},"building-entrance":{color:"#225aaa",haloColor:"#f6f5f4"}},sky:{skyColor:"#83abc5",horizonColor:"#d3d2d0",fogRange:[1.34,7.31],fogIntensity:.86,spaceColor:"#0d0c0b",atmosphereColor:"#5ba1cf",starIntensity:.4}};var Ci={name:"\u041C\u0438\u043D\u0438\u043C\u0430\u043B\u0438\u0437\u043C",background:"#f7f7f7",light:{ambientColor:"#fcfcfc",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#ffffff",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#dee7ed",fillIntensity:.18},paint:{"landcover-wood":{color:"#d6e1d6"},"landcover-grass":{color:"#e1eae1"},"landcover-sand":{color:"#efeac8"},"landcover-ice":{color:"#edf0f2"},"landcover-wetland":{color:"#e3f1f2"},"landuse-residential":{color:"#fafafa"},"landuse-industrial":{color:"#e7e8ef"},"landuse-civic":{color:"#f3e7eb"},"landuse-sport":{color:"#e1edde"},"landuse-cemetery":{color:"#e6f4e6"},"landuse-parking":{color:"#e9e7e7"},park:{color:"#e1eae1"},"aeroway-area":{color:"#d6dbeb"},water:{color:"#d7e2ea"},waterway:{color:"#d7e2ea"},"aeroway-line":{color:"#f0ede9"},"road-casing-major":{color:"#a3a3a3"},"road-casing-secondary":{color:"#b8b8b8"},"road-casing-minor":{color:"#b8b8b8"},"road-rail":{color:"#b3b3b3"},"road-path":{color:"#d1d1d1"},"road-minor":{color:"#d1d1d1"},"road-secondary":{color:"#d1d1d1"},"road-major":{color:"#bdbdbd"},boundary:{color:"#999999"},building:{color:"#ebebeb",roofColor:"#f2f2f2",aoStrength:.18,tintVariation:.06,windowColor:"#9fb0c0",windowFrameColor:"#f4f4f6",windowGlow:0},housenumber:{color:"#404040",haloColor:"#ffffff",haloWidth:1.4},poi:{color:"#737373",haloColor:"#ffffff",haloWidth:1.4},"road-label":{color:"#404040",haloColor:"#ffffff",haloWidth:1.4},"water-label":{color:"#35688d",haloColor:"#f7f7f7",haloWidth:1.4},"place-label":{color:"#404040",haloColor:"#ffffff",haloWidth:1.4},"poi-food":{color:"#737373",haloColor:"#ffffff",haloWidth:1.4,frameColor:"#737373",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{color:"#737373",haloColor:"#ffffff",haloWidth:1.4,frameColor:"#737373",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{color:"#737373",haloColor:"#ffffff",haloWidth:1.4,frameColor:"#737373",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{color:"#737373",haloColor:"#ffffff",haloWidth:1.4,frameColor:"#737373",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{color:"#737373",haloColor:"#ffffff",haloWidth:1.4,frameColor:"#737373",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{color:"#737373",haloColor:"#ffffff",haloWidth:1.4,frameColor:"#737373",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{color:"#737373",haloColor:"#ffffff",haloWidth:1.4,frameColor:"#737373",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{color:"#737373",haloColor:"#ffffff",haloWidth:1.4,frameColor:"#737373",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{color:"#737373",haloColor:"#ffffff",haloWidth:1.4,frameColor:"#737373",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"water-pool":{color:"#e8eff4"},"indoor-shell":{color:"#f7f7f7",opacity:.97},"indoor-corridor":{color:"#fbfbfb"},"indoor-room":{color:"#efefef"},"indoor-service":{color:"#dbdbdb"},"indoor-shop":{color:"#e4dfea"},"indoor-food":{color:"#eae4df"},"indoor-wc":{color:"#dfe5ea"},"indoor-wall":{color:"#cdcdcd",roofColor:"#e2e2e2",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#d0cbdc",opacity:.95},"indoor-door":{color:"#737373",haloColor:"#ffffff",haloWidth:1.4},"indoor-poi":{color:"#737373",haloColor:"#ffffff",haloWidth:1.4},"indoor-name":{color:"#404040",haloColor:"#ffffff",haloWidth:1.4},"building-entrance":{color:"#564e4e",haloColor:"#ffffff"}},sky:{skyColor:"#a4c0d4",horizonColor:"#e6e6e6",fogRange:[1.35,7.44],fogIntensity:.85,spaceColor:"#0d0d0d",atmosphereColor:"#5fa1d1",starIntensity:.37}};var Si={name:"\u041E\u043A\u0435\u0430\u043D",background:"#d7e3ea",light:{ambientColor:"#f3f4f4",ambientIntensity:.47,keyAzimuth:120,keyAltitude:60,keyColor:"#e8f6ff",keyIntensity:.59,fillAzimuth:300,fillAltitude:25,fillColor:"#d8e4ea",fillIntensity:.18},paint:{"landcover-wood":{color:"#75c7c7"},"landcover-grass":{color:"#97d8d2"},"landcover-sand":{color:"#efeac8"},"landcover-ice":{color:"#accedf"},"landcover-wetland":{color:"#a5d0d4"},"landuse-residential":{color:"#dfe8ec"},"landuse-industrial":{color:"#cbcedc"},"landuse-civic":{color:"#e3c9d2"},"landuse-sport":{color:"#90dfcb"},"landuse-cemetery":{color:"#a6d9d4"},"landuse-parking":{color:"#cfd2d3"},park:{color:"#97d8d2"},"aeroway-area":{color:"#d6dbeb"},water:{color:"#30abe8"},waterway:{color:"#3eb0ea"},"aeroway-line":{color:"#f0ede9"},"road-casing-major":{color:"#47a3c2"},"road-casing-secondary":{color:"#8ab2c7"},"road-casing-minor":{color:"#8ab2c7"},"road-rail":{color:"#8a9ea8"},"road-path":{color:"#b8d3e0"},"road-minor":{color:"#b8d3e0"},"road-secondary":{color:"#b8d3e0"},"road-major":{color:"#79c0d8"},boundary:{color:"#47bad1"},building:{color:"#d2dee4",roofColor:"#e7f0f3",aoStrength:.19,tintVariation:.06,windowColor:"#6b9ed1",windowFrameColor:"#e6f0f6",windowGlow:0},housenumber:{color:"#1f3c51",haloColor:"#f8fbfc",haloWidth:1.4},poi:{color:"#3b7b9b",haloColor:"#f8fbfc",haloWidth:1.4},"road-label":{color:"#1f3c51",haloColor:"#f8fbfc",haloWidth:1.4},"water-label":{color:"#35688d",haloColor:"#f7f7f7",haloWidth:1.4},"place-label":{color:"#1f3c51",haloColor:"#f8fbfc",haloWidth:1.4},"poi-food":{haloColor:"#f8fbfc",haloWidth:1.4,frameColor:"#c2681c",frameOpacity:1,frameHaloColor:"#f8fbfc",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{haloColor:"#f8fbfc",haloWidth:1.4,frameColor:"#2f77c4",frameOpacity:1,frameHaloColor:"#f8fbfc",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{haloColor:"#f8fbfc",haloWidth:1.4,frameColor:"#3b82a6",frameOpacity:1,frameHaloColor:"#f8fbfc",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{haloColor:"#f8fbfc",haloWidth:1.4,frameColor:"#c24444",frameOpacity:1,frameHaloColor:"#f8fbfc",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{haloColor:"#f8fbfc",haloWidth:1.4,frameColor:"#3f7f7a",frameOpacity:1,frameHaloColor:"#f8fbfc",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{haloColor:"#f8fbfc",haloWidth:1.4,frameColor:"#8b5aa5",frameOpacity:1,frameHaloColor:"#f8fbfc",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{haloColor:"#f8fbfc",haloWidth:1.4,frameColor:"#4f8b45",frameOpacity:1,frameHaloColor:"#f8fbfc",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{haloColor:"#f8fbfc",haloWidth:1.4,frameColor:"#7a5fbf",frameOpacity:1,frameHaloColor:"#f8fbfc",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{haloColor:"#f8fbfc",haloWidth:1.4,frameColor:"#59636e",frameOpacity:1,frameHaloColor:"#f8fbfc",iconColor:"#ffffff",iconHaloWidth:0},"water-pool":{color:"#38b3f1"},"indoor-shell":{color:"#e5e9eb",opacity:.97},"indoor-corridor":{color:"#eaeeef"},"indoor-room":{color:"#dce2e5"},"indoor-service":{color:"#c6cfd4"},"indoor-shop":{color:"#d6cede"},"indoor-food":{color:"#ded6ce"},"indoor-wc":{color:"#ced8de"},"indoor-wall":{color:"#bac1c4",roofColor:"#d0d4d6",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#c1b9d1",opacity:.95},"indoor-door":{color:"#3b7b9b",haloColor:"#f8fbfc",haloWidth:1.4},"indoor-poi":{color:"#3b7b9b",haloColor:"#f8fbfc",haloWidth:1.4},"indoor-name":{color:"#1f3c51",haloColor:"#f8fbfc",haloWidth:1.4},"building-entrance":{color:"#225aaa",haloColor:"#f8fbfc"}},sky:{skyColor:"#7aaac1",horizonColor:"#c1cfd6",fogRange:[1.34,7.27],fogIntensity:.86,spaceColor:"#080d0f",atmosphereColor:"#5aa8cf",starIntensity:.41}};var Mi={name:"\u041F\u0440\u0435\u043C\u0438\u0443\u043C",background:"#211f1c",model3dKey:"night",light:{ambientColor:"#b0aaa4",ambientIntensity:.34,keyAzimuth:120,keyAltitude:55,keyColor:"#c8b48a",keyIntensity:.3,fillAzimuth:300,fillAltitude:25,fillColor:"#496887",fillIntensity:.22},paint:{"landcover-wood":{color:"#1b271b"},"landcover-grass":{color:"#232f23"},"landcover-sand":{color:"#393622"},"landcover-ice":{color:"#2d3d4c"},"landcover-wetland":{color:"#213436"},"landuse-residential":{color:"#272421"},"landuse-industrial":{color:"#242633"},"landuse-civic":{color:"#332429"},"landuse-sport":{color:"#22331f"},"landuse-cemetery":{color:"#213021"},"landuse-parking":{color:"#383633"},park:{color:"#232f23"},"aeroway-area":{color:"#272a35"},water:{color:"#16293b"},waterway:{color:"#1c334a"},"aeroway-line":{color:"#55493a"},"road-casing-major":{color:"#856e32"},"road-casing-secondary":{color:"#423b2e"},"road-casing-minor":{color:"#423b2e"},"road-rail":{color:"#6b6457"},"road-path":{color:"#5e5645"},"road-minor":{color:"#5e5645"},"road-secondary":{color:"#5e5645"},"road-major":{color:"#bf9e4a"},boundary:{color:"#d1aa47"},building:{color:"#443b2c",roofColor:"#726037",aoStrength:.29,tintVariation:.1,windowColor:"#8fb8e8",windowFrameColor:"#eef0f4",windowGlow:.36},housenumber:{color:"#eae3d7",haloColor:"#181410",haloWidth:1.4},poi:{color:"#d4bb7d",haloColor:"#181410",haloWidth:1.4},"road-label":{color:"#eae3d7",haloColor:"#181410",haloWidth:1.4},"water-label":{color:"#9fbcd1",haloColor:"#131b20",haloWidth:1.4},"place-label":{color:"#eae3d7",haloColor:"#181410",haloWidth:1.4},"poi-food":{color:"#d89964",haloColor:"#181410",haloWidth:1.4,frameColor:"#d89964",frameOpacity:1,frameHaloColor:"#181410",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-shop":{color:"#699cd4",haloColor:"#181410",haloWidth:1.4,frameColor:"#699cd4",frameOpacity:1,frameHaloColor:"#181410",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-transport":{color:"#75acc8",haloColor:"#181410",haloWidth:1.4,frameColor:"#75acc8",frameOpacity:1,frameHaloColor:"#181410",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-health":{color:"#ca7272",haloColor:"#181410",haloWidth:1.4,frameColor:"#ca7272",frameOpacity:1,frameHaloColor:"#181410",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-education":{color:"#81bbb7",haloColor:"#181410",haloWidth:1.4,frameColor:"#81bbb7",frameOpacity:1,frameHaloColor:"#181410",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-culture":{color:"#a684b8",haloColor:"#181410",haloWidth:1.4,frameColor:"#a684b8",frameOpacity:1,frameHaloColor:"#181410",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-sport":{color:"#89bb81",haloColor:"#181410",haloWidth:1.4,frameColor:"#89bb81",frameOpacity:1,frameHaloColor:"#181410",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-lodging":{color:"#8e79c3",haloColor:"#181410",haloWidth:1.4,frameColor:"#8e79c3",frameOpacity:1,frameHaloColor:"#181410",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-service":{color:"#959ea7",haloColor:"#181410",haloWidth:1.4,frameColor:"#959ea7",frameOpacity:1,frameHaloColor:"#181410",iconColor:"#1b1b1b",iconHaloWidth:0},"water-pool":{color:"#1c3752"},"indoor-shell":{color:"#564b39",opacity:.97},"indoor-corridor":{color:"#504635"},"indoor-room":{color:"#605440"},"indoor-service":{color:"#7b6c52"},"indoor-shop":{color:"#5c4672"},"indoor-food":{color:"#725d46"},"indoor-wc":{color:"#466172"},"indoor-wall":{color:"#857a68",roofColor:"#9a9285",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#66558a",opacity:.95},"indoor-door":{color:"#d4bb7d",haloColor:"#181410",haloWidth:1.4},"indoor-poi":{color:"#d4bb7d",haloColor:"#181410",haloWidth:1.4},"indoor-name":{color:"#eae3d7",haloColor:"#181410",haloWidth:1.4},"building-entrance":{color:"#79a0d7",haloColor:"#181410"}},sky:{skyColor:"#09121b",horizonColor:"#2c2a27",fogRange:[1.3,6.51],fogIntensity:.9,spaceColor:"#060606",atmosphereColor:"#3679b9",starIntensity:.79}};var Ti={name:"\u0420\u0435\u0430\u043B\u0438\u0441\u0442\u0438\u0447\u043D\u0430\u044F",background:"#d6dac8",light:{ambientColor:"#eeeeed",ambientIntensity:.46,keyAzimuth:120,keyAltitude:59,keyColor:"#fff0d8",keyIntensity:.57,fillAzimuth:300,fillAltitude:25,fillColor:"#cbd9e3",fillIntensity:.18},paint:{"landcover-wood":{color:"#62a63f"},"landcover-grass":{color:"#8dbf69"},"landcover-sand":{color:"#efeac8"},"landcover-ice":{color:"#b4c9d7"},"landcover-wetland":{color:"#75b7bd"},"landuse-residential":{color:"#d6d1c2"},"landuse-industrial":{color:"#b9bdd0"},"landuse-civic":{color:"#d9b5c1"},"landuse-sport":{color:"#8bc95e"},"landuse-cemetery":{color:"#95c374"},"landuse-parking":{color:"#c3c5bf"},park:{color:"#8dbf69"},"aeroway-area":{color:"#d6dbeb"},water:{color:"#4d97cb"},waterway:{color:"#599ecf"},"aeroway-line":{color:"#f0ede9"},"road-casing-major":{color:"#856b47"},"road-casing-secondary":{color:"#766b60"},"road-casing-minor":{color:"#766b60"},"road-rail":{color:"#666666"},"road-path":{color:"#9c948b"},"road-minor":{color:"#9c948b"},"road-secondary":{color:"#9c948b"},"road-major":{color:"#ccaa66"},boundary:{color:"#8a735c"},building:{color:"#cdc4b7",roofColor:"#cdc4b7",aoStrength:.2,tintVariation:.07,windowColor:"#9fb0c0",windowFrameColor:"#eceef2",windowGlow:0},housenumber:{color:"#3b332b",haloColor:"#f5f5f0",haloWidth:1.4},poi:{color:"#735c45",haloColor:"#f5f5f0",haloWidth:1.4},"road-label":{color:"#3b332b",haloColor:"#f5f5f0",haloWidth:1.4},"water-label":{color:"#35688d",haloColor:"#f7f7f7",haloWidth:1.4},"place-label":{color:"#3b332b",haloColor:"#f5f5f0",haloWidth:1.4},"poi-food":{haloColor:"#f5f5f0",haloWidth:1.4,frameColor:"#c2681c",frameOpacity:1,frameHaloColor:"#f5f5f0",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{haloColor:"#f5f5f0",haloWidth:1.4,frameColor:"#2f77c4",frameOpacity:1,frameHaloColor:"#f5f5f0",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{haloColor:"#f5f5f0",haloWidth:1.4,frameColor:"#3b82a6",frameOpacity:1,frameHaloColor:"#f5f5f0",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{haloColor:"#f5f5f0",haloWidth:1.4,frameColor:"#c24444",frameOpacity:1,frameHaloColor:"#f5f5f0",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{haloColor:"#f5f5f0",haloWidth:1.4,frameColor:"#3f7f7a",frameOpacity:1,frameHaloColor:"#f5f5f0",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{haloColor:"#f5f5f0",haloWidth:1.4,frameColor:"#8b5aa5",frameOpacity:1,frameHaloColor:"#f5f5f0",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{haloColor:"#f5f5f0",haloWidth:1.4,frameColor:"#4f8b45",frameOpacity:1,frameHaloColor:"#f5f5f0",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{haloColor:"#f5f5f0",haloWidth:1.4,frameColor:"#7a5fbf",frameOpacity:1,frameHaloColor:"#f5f5f0",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{haloColor:"#f5f5f0",haloWidth:1.4,frameColor:"#59636e",frameOpacity:1,frameHaloColor:"#f5f5f0",iconColor:"#ffffff",iconHaloWidth:0},"water-pool":{color:"#559fd3"},"indoor-shell":{color:"#d6d0c9",opacity:.97},"indoor-corridor":{color:"#dad5ce"},"indoor-room":{color:"#cfc9c0"},"indoor-service":{color:"#beb6a9"},"indoor-shop":{color:"#bdb0ca"},"indoor-food":{color:"#cabeb0"},"indoor-wc":{color:"#b0c0ca"},"indoor-wall":{color:"#ada79e",roofColor:"#bfbbb6",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#a69bbd",opacity:.95},"indoor-door":{color:"#735c45",haloColor:"#f5f5f0",haloWidth:1.4},"indoor-poi":{color:"#735c45",haloColor:"#f5f5f0",haloWidth:1.4},"indoor-name":{color:"#3b332b",haloColor:"#f5f5f0",haloWidth:1.4},"building-entrance":{haloColor:"#f5f5f0"}},sky:{skyColor:"#5f92b7",horizonColor:"#bfc4b1",fogRange:[1.33,7.17],fogIntensity:.87,spaceColor:"#0d0e09",atmosphereColor:"#569dce",starIntensity:.44}};var Ai={name:"\u041A\u043E\u0441\u043C\u043E\u0441",background:"#0c0a1a",model3dKey:"night",light:{ambientColor:"#8c7fcb",ambientIntensity:.34,keyAzimuth:120,keyAltitude:55,keyColor:"#c0a8ff",keyIntensity:.28,fillAzimuth:300,fillAltitude:25,fillColor:"#475385",fillIntensity:.22},paint:{"landcover-wood":{color:"#241730"},"landcover-grass":{color:"#2e203c"},"landcover-sand":{color:"#292719"},"landcover-ice":{color:"#2e365b"},"landcover-wetland":{color:"#172526"},"landuse-residential":{color:"#110e20"},"landuse-industrial":{color:"#191b24"},"landuse-civic":{color:"#24191d"},"landuse-sport":{color:"#281c40"},"landuse-cemetery":{color:"#1c1721"},"landuse-parking":{color:"#27272b"},park:{color:"#2e203c"},"aeroway-area":{color:"#1c1f26"},water:{color:"#121c49"},waterway:{color:"#16225a"},"aeroway-line":{color:"#55493a"},"road-casing-major":{color:"#7e279b"},"road-casing-secondary":{color:"#3a2060"},"road-casing-minor":{color:"#3a2060"},"road-rail":{color:"#985298"},"road-path":{color:"#6b35b6"},"road-minor":{color:"#6b35b6"},"road-secondary":{color:"#6b35b6"},"road-major":{color:"#bf4ce6"},boundary:{color:"#ec51b8"},building:{color:"#2a2145",roofColor:"#7f30a6",aoStrength:.29,tintVariation:.1,windowColor:"#84dcff",windowFrameColor:"#9fb0d8",windowGlow:.5},housenumber:{color:"#dbd1f0",haloColor:"#080614",haloWidth:1.4},poi:{color:"#d186ea",haloColor:"#080614",haloWidth:1.4},"road-label":{color:"#dbd1f0",haloColor:"#080614",haloWidth:1.4},"water-label":{color:"#9fbcd1",haloColor:"#131b20",haloWidth:1.4},"place-label":{color:"#dbd1f0",haloColor:"#080614",haloWidth:1.4},"poi-food":{color:"#d89964",haloColor:"#080614",haloWidth:1.4,frameColor:"#d89964",frameOpacity:1,frameHaloColor:"#080614",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-shop":{color:"#699cd4",haloColor:"#080614",haloWidth:1.4,frameColor:"#699cd4",frameOpacity:1,frameHaloColor:"#080614",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-transport":{color:"#75acc8",haloColor:"#080614",haloWidth:1.4,frameColor:"#75acc8",frameOpacity:1,frameHaloColor:"#080614",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-health":{color:"#ca7272",haloColor:"#080614",haloWidth:1.4,frameColor:"#ca7272",frameOpacity:1,frameHaloColor:"#080614",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-education":{color:"#81bbb7",haloColor:"#080614",haloWidth:1.4,frameColor:"#81bbb7",frameOpacity:1,frameHaloColor:"#080614",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-culture":{color:"#a684b8",haloColor:"#080614",haloWidth:1.4,frameColor:"#a684b8",frameOpacity:1,frameHaloColor:"#080614",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-sport":{color:"#89bb81",haloColor:"#080614",haloWidth:1.4,frameColor:"#89bb81",frameOpacity:1,frameHaloColor:"#080614",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-lodging":{color:"#8e79c3",haloColor:"#080614",haloWidth:1.4,frameColor:"#8e79c3",frameOpacity:1,frameHaloColor:"#080614",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-service":{color:"#959ea7",haloColor:"#080614",haloWidth:1.4,frameColor:"#959ea7",frameOpacity:1,frameHaloColor:"#080614",iconColor:"#1b1b1b",iconHaloWidth:0},"water-pool":{color:"#152466"},"indoor-shell":{color:"#403956",opacity:.97},"indoor-corridor":{color:"#3c3550"},"indoor-room":{color:"#484060"},"indoor-service":{color:"#5c527b"},"indoor-shop":{color:"#5c4672"},"indoor-food":{color:"#725d46"},"indoor-wc":{color:"#466172"},"indoor-wall":{color:"#6f6885",roofColor:"#8a859a",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#66558a",opacity:.95},"indoor-door":{color:"#d186ea",haloColor:"#080614",haloWidth:1.4},"indoor-poi":{color:"#d186ea",haloColor:"#080614",haloWidth:1.4},"indoor-name":{color:"#dbd1f0",haloColor:"#080614",haloWidth:1.4},"building-entrance":{color:"#79a0d7",haloColor:"#080614"}},sky:{skyColor:"#080b18",horizonColor:"#1d1931",fogRange:[1.3,6.5],fogIntensity:.9,spaceColor:"#040308",atmosphereColor:"#354cb6",starIntensity:.82}};var ki={name:"\u0412\u0443\u043B\u043A\u0430\u043D",background:"#29211e",model3dKey:"night",light:{ambientColor:"#b6a6a1",ambientIntensity:.35,keyAzimuth:120,keyAltitude:55,keyColor:"#ffb070",keyIntensity:.29,fillAzimuth:300,fillAltitude:25,fillColor:"#8b604b",fillIntensity:.22},paint:{"landcover-wood":{color:"#31241c"},"landcover-grass":{color:"#392e22"},"landcover-sand":{color:"#403c26"},"landcover-ice":{color:"#aa6b4b"},"landcover-wetland":{color:"#243b3d"},"landuse-residential":{color:"#2f2623"},"landuse-industrial":{color:"#282b39"},"landuse-civic":{color:"#39282e"},"landuse-sport":{color:"#3e2e1e"},"landuse-cemetery":{color:"#362e26"},"landuse-parking":{color:"#3e3938"},park:{color:"#392e22"},"aeroway-area":{color:"#2b2f3b"},water:{color:"#8b3f18"},waterway:{color:"#9c461c"},"aeroway-line":{color:"#55493a"},"road-casing-major":{color:"#aa350e"},"road-casing-secondary":{color:"#712b14"},"road-casing-minor":{color:"#712b14"},"road-rail":{color:"#8f583d"},"road-path":{color:"#e65e19"},"road-minor":{color:"#e65e19"},"road-secondary":{color:"#e65e19"},"road-major":{color:"#f98c1f"},boundary:{color:"#f48c25"},building:{color:"#422b24",roofColor:"#c1551f",aoStrength:.28,tintVariation:.09,windowColor:"#84dcff",windowFrameColor:"#d8b0a0",windowGlow:.5},housenumber:{color:"#f3e0ce",haloColor:"#150b09",haloWidth:1.4},poi:{color:"#f09e4c",haloColor:"#150b09",haloWidth:1.4},"road-label":{color:"#f3e0ce",haloColor:"#150b09",haloWidth:1.4},"water-label":{color:"#9fbcd1",haloColor:"#131b20",haloWidth:1.4},"place-label":{color:"#f3e0ce",haloColor:"#150b09",haloWidth:1.4},"poi-food":{color:"#d89964",haloColor:"#150b09",haloWidth:1.4,frameColor:"#d89964",frameOpacity:1,frameHaloColor:"#150b09",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-shop":{color:"#699cd4",haloColor:"#150b09",haloWidth:1.4,frameColor:"#699cd4",frameOpacity:1,frameHaloColor:"#150b09",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-transport":{color:"#75acc8",haloColor:"#150b09",haloWidth:1.4,frameColor:"#75acc8",frameOpacity:1,frameHaloColor:"#150b09",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-health":{color:"#ca7272",haloColor:"#150b09",haloWidth:1.4,frameColor:"#ca7272",frameOpacity:1,frameHaloColor:"#150b09",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-education":{color:"#81bbb7",haloColor:"#150b09",haloWidth:1.4,frameColor:"#81bbb7",frameOpacity:1,frameHaloColor:"#150b09",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-culture":{color:"#a684b8",haloColor:"#150b09",haloWidth:1.4,frameColor:"#a684b8",frameOpacity:1,frameHaloColor:"#150b09",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-sport":{color:"#89bb81",haloColor:"#150b09",haloWidth:1.4,frameColor:"#89bb81",frameOpacity:1,frameHaloColor:"#150b09",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-lodging":{color:"#8e79c3",haloColor:"#150b09",haloWidth:1.4,frameColor:"#8e79c3",frameOpacity:1,frameHaloColor:"#150b09",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-service":{color:"#959ea7",haloColor:"#150b09",haloWidth:1.4,frameColor:"#959ea7",frameOpacity:1,frameHaloColor:"#150b09",iconColor:"#1b1b1b",iconHaloWidth:0},"water-pool":{color:"#c2531a"},"indoor-shell":{color:"#564039",opacity:.97},"indoor-corridor":{color:"#503b35"},"indoor-room":{color:"#604840"},"indoor-service":{color:"#7b5c52"},"indoor-shop":{color:"#5c4672"},"indoor-food":{color:"#725d46"},"indoor-wc":{color:"#466172"},"indoor-wall":{color:"#856f68",roofColor:"#9a8a85",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#66558a",opacity:.95},"indoor-door":{color:"#f09e4c",haloColor:"#150b09",haloWidth:1.4},"indoor-poi":{color:"#f09e4c",haloColor:"#150b09",haloWidth:1.4},"indoor-name":{color:"#f3e0ce",haloColor:"#150b09",haloWidth:1.4},"building-entrance":{color:"#79a0d7",haloColor:"#150b09"}},sky:{skyColor:"#1c100a",horizonColor:"#312a27",fogRange:[1.3,6.52],fogIntensity:.9,spaceColor:"#070605",atmosphereColor:"#ba6336",starIntensity:.78}};var Li={name:"\u0411\u0435\u043B\u0430\u044F",background:"#f5f1f0",light:{ambientColor:"#fafafa",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#ffffff",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#dee8ed",fillIntensity:.18},paint:{"landcover-wood":{color:"#a7e2a2"},"landcover-grass":{color:"#b8ebad"},"landcover-sand":{color:"#efeac8"},"landcover-ice":{color:"#d7eaf4"},"landcover-wetland":{color:"#c1dee1"},"landuse-residential":{color:"#f6f4f4"},"landuse-industrial":{color:"#e0e2eb"},"landuse-civic":{color:"#efe1e6"},"landuse-sport":{color:"#c0f0a8"},"landuse-cemetery":{color:"#c8e5c2"},"landuse-parking":{color:"#e4e2e2"},park:{color:"#b8ebad"},"aeroway-area":{color:"#d6dbeb"},water:{color:"#99ddff"},waterway:{color:"#99ddff"},"aeroway-line":{color:"#f0ede9"},"road-casing-major":{color:"#94a0b8"},"road-casing-secondary":{color:"#a3adc2"},"road-casing-minor":{color:"#a3adc2"},"road-rail":{color:"#a6a6a6"},"road-path":{color:"#bfc6d9"},"road-minor":{color:"#bfc6d9"},"road-secondary":{color:"#bfc6d9"},"road-major":{color:"#a1b0c4"},boundary:{color:"#f87797"},building:{color:"#ffffff",roofColor:"#ffffff",aoStrength:.19,tintVariation:.06,windowColor:"#6b9ed1",windowFrameColor:"#ffffff",windowGlow:0},housenumber:{color:"#262626",haloColor:"#ffffff",haloWidth:1.4},poi:{color:"#586e84",haloColor:"#ffffff",haloWidth:1.4},"road-label":{color:"#262626",haloColor:"#ffffff",haloWidth:1.4},"water-label":{color:"#35688d",haloColor:"#f7f7f7",haloWidth:1.4},"place-label":{color:"#262626",haloColor:"#ffffff",haloWidth:1.4},"poi-food":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#c2681c",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#2f77c4",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#3b82a6",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#c24444",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#3f7f7a",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#8b5aa5",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#4f8b45",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#7a5fbf",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#59636e",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"water-pool":{color:"#b1e5ff"},"indoor-shell":{color:"#f7f7f7",opacity:.97},"indoor-corridor":{color:"#fbfbfb"},"indoor-room":{color:"#efefef"},"indoor-service":{color:"#dbdbdb"},"indoor-shop":{color:"#e4dfea"},"indoor-food":{color:"#eae4df"},"indoor-wc":{color:"#dfe5ea"},"indoor-wall":{color:"#cdcdcd",roofColor:"#e2e2e2",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#d0cbdc",opacity:.95},"indoor-door":{color:"#586e84",haloColor:"#ffffff",haloWidth:1.4},"indoor-poi":{color:"#586e84",haloColor:"#ffffff",haloWidth:1.4},"indoor-name":{color:"#262626",haloColor:"#ffffff",haloWidth:1.4},"building-entrance":{color:"#225aaa",haloColor:"#ffffff"}},sky:{skyColor:"#9bbecf",horizonColor:"#e5dfdc",fogRange:[1.35,7.4],fogIntensity:.85,spaceColor:"#0f0c0a",atmosphereColor:"#5eaad0",starIntensity:.38}};var Ii={"3d":ci,cartoon:fi,cyberpunk:ui,dawn:di,dusk:hi,earth:mi,future:pi,"glass-refined":bi,glass:yi,"harmony-black":gi,"harmony-blue":vi,"harmony-green":wi,lunar:xi,matte:_i,minimal:Ci,ocean:Si,premium:Mi,realistic:Ti,space:Ai,volcano:ki,white:Li};function yo(i,e){let t=new Set(e.hidden??[]),o=i.layers.map(r=>{let n=e.paint?.[r.id],a={...r,paint:n?{...r.paint,...n}:{...r.paint}};return t.has(r.id)&&(a.visible=false),a});if(e.paint)for(let r of Object.keys(e.paint))i.layers.some(n=>n.id===r)||console.warn(`[osmgl] \u0442\u0435\u043C\u0430 \xAB${e.name}\xBB: \u0432 \u0431\u0430\u0437\u043E\u0432\u043E\u043C \u0441\u0442\u0438\u043B\u0435 \u043D\u0435\u0442 \u0441\u043B\u043E\u044F \xAB${r}\xBB`);return {...i,name:e.name,background:e.background??i.background,light:{...i.light,...e.light},sky:{...i.sky,...e.sky},model3dKey:e.model3dKey??i.model3dKey,layers:o}}var Y="base",Ei="\u241F",st=(i,e)=>i+"\u241F"+String(e);var ct=class{constructor(e=mr){this.splitValues={};this.spec=e,this.light={...hr,...e.light??{}},this.sky={...dr,...e.sky??{}},this.layers=e.layers.map(t=>({...t,paint:{...t.paint}}));}get background(){return le(this.spec.background??"#eceae4")}colorAt(e,t,o=[1,0,1,1]){let r=e.paint;return ke(r?.color,t,o)}layerVisibleAt(e,t){return !(e.visible===false||e.minzoom!==void 0&&t<e.minzoom||e.maxzoom!==void 0&&t>=e.maxzoom)}workerPlan(e=Y){return this.layers.filter(t=>t.type!=="raster").filter(t=>(t.source??Y)===e).map(t=>({id:t.id,type:t.type,sourceLayer:t["source-layer"],filter:t.filter,minzoom:t.minzoom??0,maxzoom:t.maxzoom??24,...t.splitBy?{splitBy:t.splitBy}:{},...t.cornerRadius?{cornerRadius:t.cornerRadius,cornerSegments:t.cornerSegments}:{},...t.clipToTile?{clipToTile:true}:{},...t.groundBy?{groundBy:t.groundBy}:{},...t.type==="surface"?{elevation:t.elevation,base:t.base,bevel:t.bevel,bevelDrop:t.bevelDrop}:{},...t.type==="line"&&typeof t.paint?.elevation=="number"&&t.paint.elevation>0?{ground:true}:{},...t.type==="symbol"?{textField:t.layout?.textField,iconImage:t.layout?.iconImage,iconRotate:t.layout?.iconRotate,textPlacement:t.layout?.textPlacement,abbreviate:t.layout?.abbreviate}:{}}))}usedSources(){return [...new Set(this.layers.map(e=>e.source??Y))]}bucketKeyFor(e){if(e.type==="raster"||!e.splitBy)return e.id;let t=this.splitValues[e.splitBy];return t===void 0?null:st(e.id,t)}sourceLayers(){return [...new Set(this.layers.flatMap(e=>e.type==="raster"?[]:[e["source-layer"]]))]}},mr=oi,Us=ri,js=ni,Xs=ii,ft={day:{name:"\u0414\u043D\u0435\u0432\u043D\u0430\u044F"},night:ai,mono:li,pale:si,...Ii};function go(i,e=mr){if(typeof i!="string")return yo(e,i);if(i==="day")return e;let t=ft[i];return t?yo(e,t):(console.warn(`[osmgl] \u043D\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043D\u0430\u044F \u0442\u0435\u043C\u0430 \xAB${i}\xBB; \u0434\u043E\u0441\u0442\u0443\u043F\u043D\u044B: ${Object.keys(ft).join(", ")}`),e)}var Lt=class{constructor(e,t){this.ctx=e;let o=e.gl;this._size=t;let r=o.createTexture(),n=o.createFramebuffer();if(!r||!n)throw new Error("[osmgl] \u043D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u0441\u043E\u0437\u0434\u0430\u0442\u044C \u0446\u0435\u043B\u044C \u0433\u043B\u0443\u0431\u0438\u043D\u044B");this.texture=r,this.framebuffer=n,e.bindTexture(7,r),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_MIN_FILTER,o.LINEAR),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_MAG_FILTER,o.LINEAR),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_WRAP_S,o.CLAMP_TO_EDGE),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_WRAP_T,o.CLAMP_TO_EDGE),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_COMPARE_MODE,o.COMPARE_REF_TO_TEXTURE),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_COMPARE_FUNC,o.LEQUAL),this.allocate(t),o.bindFramebuffer(o.FRAMEBUFFER,n),o.framebufferTexture2D(o.FRAMEBUFFER,o.DEPTH_ATTACHMENT,o.TEXTURE_2D,r,0),o.drawBuffers([o.NONE]),o.readBuffer(o.NONE);let a=o.checkFramebufferStatus(o.FRAMEBUFFER);if(o.bindFramebuffer(o.FRAMEBUFFER,null),e.bindTexture(7,null),a!==o.FRAMEBUFFER_COMPLETE)throw new Error(`[osmgl] \u0446\u0435\u043B\u044C \u0433\u043B\u0443\u0431\u0438\u043D\u044B \u043D\u0435 \u0441\u043E\u0431\u0440\u0430\u043B\u0430\u0441\u044C: 0x${a.toString(16)}`)}get size(){return this._size}resize(e){e!==this._size&&(this._size=e,this.ctx.bindTexture(7,this.texture),this.allocate(e),this.ctx.bindTexture(7,null));}bind(){let e=this.ctx.gl;this.ctx.bindFramebuffer(this.framebuffer),this.ctx.viewport(0,0,this._size,this._size),this.ctx.setDepthTest(true),this.ctx.setDepthMask(true),e.clear(e.DEPTH_BUFFER_BIT);}bindTexture(e){this.ctx.bindTexture(e,this.texture);}allocate(e){let t=this.ctx.gl;t.texImage2D(t.TEXTURE_2D,0,t.DEPTH_COMPONENT24,e,e,0,t.DEPTH_COMPONENT,t.UNSIGNED_INT,null);}destroy(){this.ctx.gl.deleteFramebuffer(this.framebuffer),this.ctx.gl.deleteTexture(this.texture);}};function Fi(i){let e=i.gl,t=e.createTexture();if(!t)throw new Error("[osmgl] \u043D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u0441\u043E\u0437\u0434\u0430\u0442\u044C \u0437\u0430\u0433\u043B\u0443\u0448\u043A\u0443 \u043A\u0430\u0440\u0442\u044B \u0442\u0435\u043D\u0435\u0439");return i.bindTexture(7,t),e.texImage2D(e.TEXTURE_2D,0,e.DEPTH_COMPONENT24,1,1,0,e.DEPTH_COMPONENT,e.UNSIGNED_INT,new Uint32Array([4294967295])),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.NEAREST),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.NEAREST),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_COMPARE_MODE,e.COMPARE_REF_TO_TEXTURE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_COMPARE_FUNC,e.LEQUAL),i.bindTexture(7,null),t}var It=`
|
|
8
|
+
`)}var Et=(r=>(r[r.Unknown=0]="Unknown",r[r.Point=1]="Point",r[r.LineString=2]="LineString",r[r.Polygon=3]="Polygon",r))(Et||{}),po=class i{constructor(e,t,o,r){this.pbf=e;this.keys=t;this.values=o;this.extent=r;this.type=0;this.properties={};this.geomOffset=-1;}static read(e,t,o,r,n){let a=new i(e,o,r,n);return e.readFields(kl,a,t),a}loadGeometry(){if(this.geomOffset<0)return [];let e=this.pbf,t=e.pos;e.pos=this.geomOffset;let o=e.readVarint()+e.pos,r=1,n=0,a=0,l=0,s=[],c=[];for(;e.pos<o;){if(n<=0){let f=e.readVarint();r=f&7,n=f>>3;}if(n--,r===1||r===2)a+=e.readSVarint(),l+=e.readSVarint(),r===1&&(c.length&&s.push(c),c=[]),c.push(a,l);else if(r===7)c.length>=2&&c.push(c[0],c[1]);else throw new Error(`[osmgl] \u043D\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043D\u0430\u044F \u043A\u043E\u043C\u0430\u043D\u0434\u0430 \u0433\u0435\u043E\u043C\u0435\u0442\u0440\u0438\u0438 MVT: ${r}`)}return c.length&&s.push(c),e.pos=t,s}bbox(){let e=this.loadGeometry(),t=1/0,o=1/0,r=-1/0,n=-1/0;for(let a of e)for(let l=0;l<a.length;l+=2)a[l]<t&&(t=a[l]),a[l]>r&&(r=a[l]),a[l+1]<o&&(o=a[l+1]),a[l+1]>n&&(n=a[l+1]);return [t,o,r,n]}};function kl(i,e,t){t&&(i===1?e.id=t.readVarint():i===2?El(t,e):i===3?e.type=t.readVarint():i===4&&(e.geomOffset=t.pos,t.skip(2)));}function El(i,e){let t=i.readVarint()+i.pos;for(;i.pos<t;){let o=e.keys[i.readVarint()],r=e.values[i.readVarint()];o!==void 0&&(e.properties[o]=r);}}var bo=class i{constructor(e){this.pbf=e;this.version=1;this.name="";this.extent=4096;this.featureOffsets=[];this.keys=[];this.values=[];}static read(e,t){let o=new i(e);return e.readFields(Al,o,t),o}get length(){return this.featureOffsets.length}feature(e){let t=this.pbf;t.pos=this.featureOffsets[e];let o=t.readVarint()+t.pos;return po.read(t,o,this.keys,this.values,this.extent)}*features(){for(let e=0;e<this.featureOffsets.length;e++)yield this.feature(e);}};function Al(i,e,t){t&&(i===15?e.version=t.readVarint():i===1?e.name=t.readString():i===5?e.extent=t.readVarint():i===2?e.featureOffsets.push(t.pos):i===3?e.keys.push(t.readString()):i===4&&e.values.push(Ll(t)));}function Ll(i){let e=i.readVarint()+i.pos,t=null;for(;i.pos<e;){let o=i.readVarint()>>3;o===1?t=i.readString():o===2?t=i.readFloat():o===3?t=i.readDouble():o===4?t=i.readVarint64():o===5?t=i.readVarint():o===6?t=i.readSVarint():o===7?t=i.readBoolean():i.skip(o);}return t}var kt=class{constructor(e){this.layers={};new Tl__default.default(e instanceof Uint8Array?e:new Uint8Array(e)).readFields((o,r,n)=>{if(o===3&&n){let a=bo.read(n,n.readVarint()+n.pos);a.length&&(this.layers[a.name]=a);}},null);}};function Qe(i){let e=[],t=null;for(let o of i){if(o.length<6)continue;let r=Il(o);r!==0&&(r>0?(t&&e.push(t),t={outer:o,holes:[]}):t&&t.holes.push(o));}return t&&e.push(t),e}function Il(i){let e=0;for(let t=0,o=i.length-2;t<i.length;o=t,t+=2)e+=(i[o]-i[t])*(i[t+1]+i[o+1]);return e/2}function D(i,e,t){return i===void 0?t:typeof i=="number"?i:Vn(i.stops,e,(o,r,n)=>o+(r-o)*n,t)}function Ee(i,e,t){return i===void 0?t:typeof i=="string"?he(i):Vn(i.stops,e,(o,r,n)=>{let a=he(o),l=he(r);return [a[0]+(l[0]-a[0])*n,a[1]+(l[1]-a[1])*n,a[2]+(l[2]-a[2])*n,a[3]+(l[3]-a[3])*n]},t)}function Vn(i,e,t,o){if(!i.length)return o;if(e<=i[0][0])return t(i[0][1],i[0][1],0);let r=i[i.length-1];if(e>=r[0])return t(r[1],r[1],0);for(let n=1;n<i.length;n++){let[a,l]=i[n];if(e>a)continue;let[s,c]=i[n-1],f=a-s,u=f===0?0:(e-s)/f;return t(c,l,u)}return o}function pe(i,e){if(!i)return true;let t=i[0];switch(t){case "all":return i.slice(1).every(o=>pe(o,e));case "any":return i.slice(1).some(o=>pe(o,e));case "!":return !pe(i[1],e);case "has":return e[i[1]]!=null;case "!has":return e[i[1]]==null;case "in":{let o=e[i[1]];return o==null?false:i.slice(2).includes(o)}case "!in":{let o=e[i[1]];return o==null?true:!i.slice(2).includes(o)}default:{let o=e[i[1]],r=i[2];if(o==null)return t==="!=";switch(t){case "==":return o===r;case "!=":return o!==r;case ">":return o>r;case ">=":return o>=r;case "<":return o<r;case "<=":return o<=r;default:return true}}}}var Fl=Math.PI/8,Rl=.35,zl=32,Dn=.25,Gn=.07;function Re(i,e){let t=e.radius;if(!(t>0))return i;let o=i.length/2-1;if(o<3)return i;let r=Math.max(2,Math.round(e.segments??4)),n=Math.max(e.minCutRatio??Rl,0),a=e.extent,l=e.margin??0,s=[];for(let c=0;c<o;c++){let f=i[c*2],u=i[c*2+1],h=i[(c+o-1)%o*2],m=i[(c+o-1)%o*2+1],d=i[(c+1)%o*2],p=i[(c+1)%o*2+1],y=f-h,b=u-m,g=d-f,v=p-u,x=Math.hypot(y,b),C=Math.hypot(g,v);if(x<1e-6||C<1e-6){s.push(f,u);continue}let S=y/x,M=b/x,w=g/C,_=v/C;if(e.keep?.[c]){s.push(f,u);continue}let T=S*w+M*_;if(T>.985){s.push(f,u);continue}if(a!==void 0&&(tr(f,u,a,l)||tr(h,m,a,l)||tr(d,p,a,l))){s.push(f,u);continue}let L=Math.min(t,x*.4,C*.4);if(L<t*n){s.push(f,u);continue}let E=f-S*L,z=u-M*L,A=f+w*L,I=u+_*L,k=Math.acos(Math.max(-1,Math.min(1,T))),F=Math.min(Fl,Math.PI/2/r),P=Math.ceil(k/F-1e-6),R=e.maxChord&&e.maxChord>0?Math.ceil(L/Math.tan(k/2)*k/e.maxChord):0,W=Math.max(1,Math.min(zl,Math.max(Math.min(r,P),R)));s.push(E,z);for(let G=1;G<W;G++){let O=G/W,H=1-O;s.push(H*H*E+2*H*O*f+O*O*A,H*H*z+2*H*O*u+O*O*I);}s.push(A,I);}return s.length<6?i:(s.push(s[0],s[1]),s)}var tr=(i,e,t,o)=>i<=-o||e<=-o||i>=t+o||e>=t+o;var Oe=i=>i/64;function nt(i,e,t=0){let o=Nn(i.outer,e,t);if(!o)return null;let r=[];for(let n of i.holes){let a=Nn(n,e,t);a&&r.push(a);}return {outer:o,holes:r}}function Nn(i,e,t){let o=[];for(let r=0;r<i.length-2;r+=2)o.push(i[r],i[r+1]);if(o.length<6)return null;for(let r=0;r<4;r++){let n=o;o=[];let a=n.length/2;if(a===0)return null;for(let l=0;l<a;l++){let s=n[l*2],c=n[l*2+1],f=n[(l+a-1)%a*2],u=n[(l+a-1)%a*2+1],h=Un(s,c,r,e,t),m=Un(f,u,r,e,t);if(h!==m){let d=Pl(f,u,s,c,r,e,t);o.push(f+(s-f)*d,u+(c-u)*d);}h&&o.push(s,c);}}return o.length<6?null:(o.push(o[0],o[1]),o)}function Un(i,e,t,o,r){return t===0?i>=-r:t===1?i<=o+r:t===2?e>=-r:e<=o+r}function Pl(i,e,t,o,r,n,a){return r===0?(-a-i)/(t-i):r===1?(n+a-i)/(t-i):r===2?(-a-e)/(o-e):(n+a-e)/(o-e)}function yo(i,e,t,o,r,n=0){let a=-n,l=r+n;return i===a&&t===a||i===l&&t===l||e===a&&o===a||e===l&&o===l}function jn(i,e){for(let t=0;t<i.length;t+=2)if(i[t]<=0||i[t]>=e||i[t+1]<=0||i[t+1]>=e)return true;return false}var Me=18,lt=4,qn=65535/lt,Hl=9,Ol=1,Wl=0,Bl=1,Vl=2;var Xn=0,Dl=1,Yn=2,Gl=3,Nl=.47;function nr(i,e,t,o={}){let r=o.metersPerUnit&&o.metersPerUnit>0?o.metersPerUnit:Nl,n=Math.max(1024,i.length*48),a=new ArrayBuffer(n*Me),l={verts:new DataView(a),vertsU8:new Uint8Array(a),vertOffset:0,vertexCount:0,indices:[],featureIds:[],ensure:()=>{}};l.ensure=h=>s(h);let s=h=>{if(l.vertexCount+h<=n)return;n=Math.max(n*2,l.vertexCount+h);let m=new ArrayBuffer(n*Me);new Uint8Array(m).set(l.vertsU8.subarray(0,l.vertOffset)),a=m,l.verts=new DataView(m),l.vertsU8=new Uint8Array(m);};for(let h of i.features()){if(h.type!==3||!pe(t,h.properties))continue;let m=fs(h.properties),d=us(h.properties,m);if(m<=d)continue;let p=ds(h.properties)??Number(h.id??0),y=cs(p>>>0),b=ss(y,h.properties),g=ls(h.properties,m),v=Qe(h.loadGeometry());for(let x of v){let C=nt(x,e);if(!C)continue;let S=jn(C.outer,e),M=(o.cornerRadius??0)/r,w={radius:M,segments:o.cornerSegments,extent:e,minCutRatio:0},_=M>0?{outer:Re(C.outer,w),holes:C.holes.map(I=>Re(I,w))}:C,T=_.outer.length/2+_.holes.reduce((I,k)=>I+k.length/2,0);s(T*5+32);let L=_.holes.length||S?null:Yl(_.outer),E=L?Jl(h.properties,L,m,y,r):null,z=null,A=[];if(E&&L){let I=Zn(os(_.outer,r),L,E.shape);A=rs(I,_.outer);let k=ns(I,A);if(k>1e-6){let F=Math.min(Math.max(k*r*ql,Ql),Zl);z=is(I,F/k,m);}}Kn(l,_.outer,d,m,p,b,g,r,e,z);for(let I of _.holes)Kn(l,I,d,m,p,b,g,r,e,null);z?as(l,A,z,m,p,b,g,r):Xl(l,_.outer,_.holes,m,p,b,g);}}if(!l.indices.length)return null;let c=new Uint32Array(l.indices),f=new Float64Array(l.featureIds);return {vertices:a.slice(0,l.vertOffset),indices:c.buffer,featureIds:f.buffer,vertexCount:l.vertexCount,indexCount:c.length,extent:e}}var ir=(i,e)=>i|e<<2,or=i=>Math.max(0,Math.min(65535,Math.round(Math.min(i,qn)*lt)));function it(i,e,t,o,r,n,a,l,s,c,f=0,u=0,h=0){let m=i.vertOffset;return i.verts.setInt16(m,Math.round(e),true),i.verts.setInt16(m+2,Math.round(t),true),i.verts.setUint16(m+4,Math.round(Math.min(o,qn)*lt),true),i.vertsU8[m+6]=s,i.vertsU8[m+7]=l,i.verts.setInt8(m+8,rr(Math.round(r*127))),i.verts.setInt8(m+9,rr(Math.round(n*127))),i.verts.setInt8(m+10,rr(Math.round(a*127))),i.vertsU8[m+11]=c,i.verts.setUint16(m+12,or(f),true),i.verts.setUint16(m+14,or(u),true),i.verts.setUint16(m+16,or(h),true),i.vertOffset+=Me,i.vertexCount++}function Kn(i,e,t,o,r,n,a,l,s,c=null){let f=e.length/2;if(f<3)return;let u=ir(Wl,a),h=jl(e,l),m=o-t,d=new Float64Array(f*2),p=new Uint8Array(f);{let y=new Float64Array(f*2);for(let b=0;b<f-1;b++){let g=e[b*2+2]-e[b*2],v=e[b*2+3]-e[b*2+1],x=Math.hypot(g,v)||1;y[b*2]=v/x,y[b*2+1]=-g/x;}for(let b=0;b<f-1;b++){let g=(b+f-2)%(f-1),v=y[g*2]*y[b*2]+y[g*2+1]*y[b*2+1],x=y[g*2]+y[b*2],C=y[g*2+1]+y[b*2+1],S=Math.hypot(x,C);v>.5&&S>1e-6&&(d[b*2]=x/S,d[b*2+1]=C/S,p[b]=1);}}for(let y=0;y<f-1;y++){let b=e[y*2],g=e[y*2+1],v=e[y*2+2],x=e[y*2+3];if(b===v&&g===x||yo(b,g,v,x,s))continue;let C=v-b,S=x-g,M=Math.hypot(C,S)||1,w=S/M,_=-C/M,T=h.offset[y],L=h.width[y],E=[0,1];if(c){for(let A=0;A<c.length;A++)for(let I=A+1;I<c.length;I++){let k=Je(c[A],b,g)-Je(c[I],b,g),F=Je(c[A],v,x)-Je(c[I],v,x);if(k===F)continue;let P=k/(k-F);P>1e-4&&P<1-1e-4&&E.push(P);}E.sort((A,I)=>A-I);}let z=(A,I)=>{if(!c)return o;let k=1/0;for(let F of c)k=Math.min(k,Je(F,A,I));return Math.max(o,k)};for(let A=0;A+1<E.length;A++){let I=E[A],k=E[A+1];if(k-I<1e-6)continue;let F=b+C*I,P=g+S*I,R=b+C*k,W=g+S*k,G=T+M*I*l,O=T+M*k*l,H=(y+1)%(f-1),V=p[y]?d[y*2]:w,Y=p[y]?d[y*2+1]:_,$=p[H]?d[H*2]:w,Q=p[H]?d[H*2+1]:_,ue=w+(V-w)*(1-I),J=_+(Y-_)*(1-I),X=w+($-w)*k,te=_+(Q-_)*k,ie=Math.hypot(ue,J)||1,q=Math.hypot(X,te)||1,U=ue/ie,j=J/ie,le=X/q,ae=te/q;i.ensure(4);let se=it(i,F,P,t,U,j,0,0,n,u,G,L,m),oe=it(i,R,W,t,le,ae,0,0,n,u,O,L,m),ge=it(i,F,P,z(F,P),U,j,0,255,n,u,G,L,m),ke=it(i,R,W,z(R,W),le,ae,0,255,n,u,O,L,m);i.indices.push(se,ke,oe,se,ge,ke),i.featureIds.push(r,r);}}}var Ul=.9976;function jl(i,e){let t=i.length/2-1,o=[];for(let s=0;s<t;s++){let c=i[s*2+2]-i[s*2],f=i[s*2+3]-i[s*2+1],u=Math.hypot(c,f);o.push(u>0?{x:c/u,y:f/u,len:u*e}:{x:0,y:0,len:0});}let r=(s,c)=>o[s].len>0&&o[c].len>0&&o[s].x*o[c].x+o[s].y*o[c].y>=Ul,n=0;for(;n<t&&r((n-1+t)%t,n);)n++;n>=t&&(n=0);let a=new Array(t).fill(0),l=new Array(t).fill(0);for(let s=0;s<t;){let c=(n+s)%t,f=[c],u=o[c].len,h=s+1;for(;h<t;){let d=(n+h)%t;if(!r((n+h-1)%t,d))break;f.push(d),u+=o[d].len,h++;}let m=0;for(let d of f)a[d]=m,l[d]=u,m+=o[d].len;s=h;}return {offset:a,width:l}}function Xl(i,e,t,o,r,n,a){let l=[],s=[];for(let h=0;h<e.length;h++)l.push(e[h]);for(let h of t){s.push(l.length/2);for(let m=0;m<h.length;m++)l.push(h[m]);}let c=$n__default.default(l,s.length?s:void 0,2);if(!c.length)return;let f=ir(Bl,a),u=i.vertexCount;for(let h=0;h<l.length;h+=2)it(i,l[h],l[h+1],o,0,0,1,255,n,f);for(let h=0;h<c.length;h+=3)i.indices.push(u+c[h],u+c[h+2],u+c[h+1]),i.featureIds.push(r);}function Yl(i){let e=Kl(i);if(e.length<3)return null;let t=Math.abs($l(i));if(t<=0)return null;let o=null,r=1/0;for(let n=0;n<e.length;n++){let a=(n+1)%e.length,l=e[a].x-e[n].x,s=e[a].y-e[n].y,c=Math.hypot(l,s);if(c<1e-6)continue;l/=c,s/=c;let f=1/0,u=-1/0,h=1/0,m=-1/0;for(let x of e){let C=x.x*l+x.y*s,S=-x.x*s+x.y*l;C<f&&(f=C),C>u&&(u=C),S<h&&(h=S),S>m&&(m=S);}let d=u-f,p=m-h,y=d*p;if(y<=0||y>=r)continue;r=y;let b=(f+u)/2,g=(h+m)/2,v=d>=p;o={cx:b*l-g*s,cy:b*s+g*l,ax:v?l:-s,ay:v?s:l,halfLong:(v?d:p)/2,halfShort:(v?p:d)/2,fill:t/y};}return o}function Kl(i){let e=[];for(let n=0;n<i.length-2;n+=2)e.push({x:i[n],y:i[n+1]});if(e.length<3)return e;e.sort((n,a)=>n.x===a.x?n.y-a.y:n.x-a.x);let t=(n,a,l)=>(a.x-n.x)*(l.y-n.y)-(a.y-n.y)*(l.x-n.x),o=[];for(let n of e){for(;o.length>=2&&t(o[o.length-2],o[o.length-1],n)<=0;)o.pop();o.push(n);}let r=[];for(let n=e.length-1;n>=0;n--){let a=e[n];for(;r.length>=2&&t(r[r.length-2],r[r.length-1],a)<=0;)r.pop();r.push(a);}return o.pop(),r.pop(),o.concat(r)}function $l(i){let e=0;for(let t=0;t<i.length-2;t+=2)e+=i[t]*i[t+3]-i[t+2]*i[t+1];return e/2}var ql=Math.tan(30*Math.PI/180),Zl=3.5,Ql=.9;function Jl(i,e,t,o,r){if(e.fill<.86)return null;let n=e.halfShort*2*r,a=e.halfLong*2*r,l=n*a,s=e.halfShort>0?e.halfLong/e.halfShort:99,c=es(i);if(!c){if(t>15||l>600||n<3)return null;let f=o%1e3/1e3;l<30?c=f<.5?"skillion":"gabled":s<1.25?c=f<.35?"pyramidal":"hipped":c=f<.8?"gabled":"hipped";}return c==="flat"?null:{shape:c}}function es(i){let e=String(i.roof_shape??i["roof:shape"]??"").toLowerCase();return e?e==="flat"?"flat":e==="skillion"||e==="lean_to"||e==="shed"?"skillion":e==="hipped"||e==="half-hipped"||e==="gambrel"?"hipped":e==="pyramidal"||e==="dome"||e==="conical"||e==="onion"?"pyramidal":e==="gabled"||e==="mansard"||e==="round"?"gabled":null:null}var Je=(i,e,t)=>i.a*e+i.b*t+i.c;function ts(i,e,t,o){let r=i.length/2;if(r<3)return [];let n=[],a=l=>[i[l*2],i[l*2+1]];for(let l=0;l<r;l++){let[s,c]=a(l),[f,u]=a((l+r-1)%r),h=e*s+t*c+o,m=e*f+t*u+o;if(h<=0!=m<=0){let d=m/(m-h);n.push(f+(s-f)*d,u+(c-u)*d);}h<=0&&n.push(s,c);}return n}function os(i,e){let t=.5/Math.max(e,1e-6),o=i.length/2-1;if(o<5)return i;let r=[],n=0;r.push(i[0],i[1]);for(let a=1;a<o;a++){let l=i[n*2],s=i[n*2+1],c=i[a*2],f=i[a*2+1],u=c-l,h=f-s,m=Math.hypot(u,h),d=m>1e-6;if(d){for(let p=n+1;p<a;p++)if(Math.abs((i[p*2]-l)*h-(i[p*2+1]-s)*u)/m>=t){d=false;break}}d||(r.push(i[(a-1)*2],i[(a-1)*2+1]),n=a-1);}return r.length/2<3?i:(r.push(r[0],r[1]),r)}function Zn(i,e,t){let{ax:o,ay:r,halfLong:n}=e;if(t==="skillion"){let s=-r,c=o;return [{a:s,b:c,c:-(s*e.cx+c*e.cy)+e.halfShort}]}let a=[],l=i.length/2-1;for(let s=0;s<l;s++){let c=i[s*2],f=i[s*2+1],u=i[(s+1)%l*2],h=i[(s+1)%l*2+1],m=u-c,d=h-f,p=Math.hypot(m,d);if(p<1e-6||t==="gabled"&&Math.abs((m*o+d*r)/p)<.86)continue;let y=-d/p,b=m/p;a.push({a:y,b,c:-(y*c+b*f)});}return !a.length&&n>0?Zn(i,e,"hipped"):a}function rs(i,e){let t=[];for(let r=0;r<e.length-2;r+=2)t.push(e[r],e[r+1]);if(t.length<6)return [];let o=[];for(let r=0;r<i.length;r++){let n=t;for(let a=0;a<i.length&&n.length>=6;a++)a!==r&&(n=ts(n,i[r].a-i[a].a,i[r].b-i[a].b,i[r].c-i[a].c));o.push(n.length>=6?n:[]);}return o}function ns(i,e){let t=0;for(let o=0;o<e.length;o++){let r=e[o];for(let n=0;n<r.length;n+=2){let a=Je(i[o],r[n],r[n+1]);a>t&&(t=a);}}return t}function is(i,e,t){return i.map(o=>({a:o.a*e,b:o.b*e,c:o.c*e+t}))}function as(i,e,t,o,r,n,a,l){let s=ir(Vl,a);for(let c=0;c<t.length;c++){let f=e[c];if(!f||f.length<6)continue;let u=$n__default.default(f,void 0,2);if(!u.length)continue;let h=-t[c].a/l,m=-t[c].b/l,d=Math.hypot(h,m,1),p={x:h/d,y:m/d,z:1/d};i.ensure(f.length/2);let y=i.vertexCount;for(let b=0;b<f.length;b+=2){let g=Math.max(o,Je(t[c],f[b],f[b+1]));it(i,f[b],f[b+1],g,p.x,p.y,p.z,255,n,s);}for(let b=0;b<u.length;b+=3)i.indices.push(y+u[b],y+u[b+2],y+u[b+1]),i.featureIds.push(r);}}function ls(i,e){let t=String(i.class??"").toLowerCase();return t==="industrial"||t==="warehouse"||t==="hangar"||t==="construction"?Gl:t==="commercial"||t==="office"||t==="retail"||t==="supermarket"?Yn:t==="house"||t==="detached"||t==="garage"||t==="hut"||t==="shed"||e<=7?Xn:e>=40?Yn:Dl}function ss(i,e){let t=String(e.class??""),o=128;return t==="industrial"||t==="warehouse"||t==="construction"?o=96:t==="commercial"||t==="office"||t==="retail"?o=150:(t==="apartments"||t==="residential"||t==="house")&&(o=134),Math.max(0,Math.min(255,o+(i%121-60)))}function cs(i){let e=i>>>0;return e=(e>>>16^e)*73244475,e=(e>>>16^e)*73244475,e=e>>>16^e,e>>>0}function fs(i){let e=at(i.render_height)??at(i.height)??hs(i.levels??i.building_levels??i["building:levels"]);return e&&e>0?Math.max(e,Ol):Hl}function us(i,e){let t=at(i.render_min_height)??at(i.min_height)??at(i.base)??0;return t>0&&t<e?t:0}function hs(i){let e=at(i);return e&&e>0?e*3:null}function at(i){if(typeof i=="number"&&isFinite(i))return i;if(typeof i=="string"){let e=parseFloat(i);if(isFinite(e))return e}return null}var rr=i=>i>127?127:i<-127?-127:i;function ds(i){let e=i.osm_id;if(typeof e=="number"&&Number.isFinite(e))return e;if(typeof e=="string"){let t=Number(e);if(Number.isFinite(t))return t}return null}function Qn(i){let e=[];for(let t=0;t+1<i.length;t+=2)e.push([i[t],i[t+1]]);return e}function Jn(i){let e=[];for(let o of i)e.push(o[0],o[1]);let t=e.length;return t>=4&&(e[0]!==e[t-2]||e[1]!==e[t-1])&&e.push(e[0],e[1]),e}function ti(i,e,t=0){if(i.length<2)return i;let o=new Map;for(let n of i){let a=n.lift??0,l=o.get(a);l?l.push(n):o.set(a,[n]);}let r=[];for(let[n,a]of o){if(a.length<2){r.push(...a);continue}let s=(t>0&&e?a.map(u=>({outer:e(u.outer,-t)??u.outer,holes:u.holes.map(h=>e(h,t)??h)})):a).map(u=>[Qn(u.outer),...u.holes.map(Qn)]),c;try{c=ei__namespace.union(s[0],...s.slice(1));}catch{r.push(...a);continue}let f=c;if(!Array.isArray(f)||f.length===0){r.push(...a);continue}for(let u of f){if(!u.length)continue;let h=Jn(u[0]);if(h.length<8)continue;let m=[];for(let d=1;d<u.length;d++){let p=Jn(u[d]);p.length>=8&&m.push(p);}r.push(n?{outer:h,holes:m,lift:n}:{outer:h,holes:m});}}return r}var st=16,li=64,ps=0,bs=1,oi=2,ys=3,At=1,gs=.6;function fr(i,e,t,o){let r=o.metersPerUnit>0?o.metersPerUnit:.5,n=o.elevation,a=o.base??0,l=Math.max(o.bevel??0,0)/r,s=Math.max(o.bevelDrop??0,0),c=Math.max(o.cornerRadius??0,0)/r,f=Math.max(512,i.length*24),u=new ArrayBuffer(f*st),h={view:new DataView(u),bytes:new Uint8Array(u),offset:0,count:0,indices:[],extent:e,ensure(w){if(h.count+w<=f)return;f=Math.max(f*2,h.count+w);let _=new ArrayBuffer(f*st);new Uint8Array(_).set(h.bytes.subarray(0,h.offset)),u=_,h.view=new DataView(_),h.bytes=new Uint8Array(_);}},m=[],d=new Map;for(let w of i.features()){if(w.type!==3||!pe(t,w.properties))continue;let _=o.liftBy?.(w.properties)??0;for(let T of Qe(w.loadGeometry())){let L=nt(T,e,Oe(e));L&&m.push(_?{...L,lift:_}:L);}}let p=new Set,y=Math.max(o.weld??gs,0),b=ti(m,(w,_)=>lr(w,_,e,p),y/r),g=y>0?b.map(w=>({...w,outer:ai(w.outer,y/r,e),holes:w.holes.map(_=>ai(_,y/r,e))})):b;for(let w of g){ri(w.outer,d);for(let _ of w.holes)ri(_,d);}o.onShapes?.(g);let v=new Set;for(let[w,_]of d)_>1&&v.add(w);let x=[],C={radius:c,segments:o.cornerSegments,extent:e,margin:Oe(e),minCutRatio:0,maxChord:Dn/r};for(let w of g){let _=c>0?{outer:Re(w.outer,{...C,keep:ni(w.outer,v)}),holes:w.holes.map(F=>Re(F,{...C,keep:ni(F,v)}))}:w,T=l>0?lr(_.outer,l,e,v):_.outer,L=_.holes.map(F=>l>0?lr(F,-l,e,v):F),E=w.lift??0,z=n+E,A=a+E;ii(h,T??_.outer,L.map((F,P)=>F??_.holes[P]),z);let I=z,k=z-s;T&&l>0&&s>0&&ar(h,T,_.outer,I,k,bs,e,v),k!==A&&ar(h,_.outer,_.outer,k,A,oi,e,v);for(let F of _.holes)if(k!==A&&ar(h,F,F,k,A,oi,e,v),z<A){let P=h.indices.length;ii(h,F,[],A,ys);for(let R=P;R<h.indices.length;R++)x.push(h.indices[R]);h.indices.length=P;}}if(!h.indices.length&&!x.length)return null;let S=h.indices.length,M=new Uint32Array(S+x.length);return M.set(h.indices,0),M.set(x,S),{vertices:u.slice(0,h.offset),indices:M.buffer,vertexCount:h.count,indexCount:M.length,extent:e,capIndexOffset:S}}function ct(i,e,t,o){let r=`${Math.round(i*100)},${Math.round(e*100)}`,n=`${Math.round(t*100)},${Math.round(o*100)}`;return r<n?`${r}|${n}`:`${n}|${r}`}function ri(i,e){for(let t=0;t+3<i.length;t+=2){let o=ct(i[t],i[t+1],i[t+2],i[t+3]);e.set(o,(e.get(o)??0)+1);}}function ni(i,e){if(!e.size)return;let t=i.length/2-1,o=new Array(t).fill(false);for(let r=0;r<t;r++){let n=ct(i[(r+t-1)%t*2],i[(r+t-1)%t*2+1],i[r*2],i[r*2+1]),a=ct(i[r*2],i[r*2+1],i[(r+1)%t*2],i[(r+1)%t*2+1]);(e.has(n)||e.has(a))&&(o[r]=true);}return o}function Lt(i,e,t,o,r,n,a,l){let s=i.offset;return i.view.setFloat32(s,e,true),i.view.setFloat32(s+4,t,true),i.view.setInt16(s+8,vs(Math.round(o*li)),true),i.view.setInt8(s+10,cr(Math.round(r*127))),i.view.setInt8(s+11,cr(Math.round(n*127))),i.view.setInt8(s+12,cr(Math.round(a*127))),i.bytes[s+13]=l,i.view.setInt8(s+14,e<=0?-At:e>=i.extent?At:0),i.view.setInt8(s+15,t<=0?-At:t>=i.extent?At:0),i.offset+=st,i.count++}function ii(i,e,t,o,r=ps){let n=[],a=[];for(let c=0;c<e.length;c++)n.push(e[c]);for(let c of t){a.push(n.length/2);for(let f=0;f<c.length;f++)n.push(c[f]);}let l=$n__default.default(n,a.length?a:void 0,2);if(!l.length)return;i.ensure(n.length/2);let s=i.count;for(let c=0;c<n.length;c+=2)Lt(i,n[c],n[c+1],o,0,0,1,r);for(let c=0;c<l.length;c+=3)i.indices.push(s+l[c],s+l[c+2],s+l[c+1]);}function ar(i,e,t,o,r,n,a,l){let s=Math.min(e.length,t.length)/2;if(!(s<3)){i.ensure((s-1)*4);for(let c=0;c<s-1;c++){let f=t[c*2],u=t[c*2+1],h=t[c*2+2],m=t[c*2+3];if(f===h&&u===m||yo(f,u,h,m,a,Oe(a))||l.has(ct(f,u,h,m)))continue;let d=h-f,p=m-u,y=Math.hypot(d,p)||1,b=p/y,g=-d/y,v=o-r,x=Math.hypot(e[c*2]-f,e[c*2+1]-u)||0,C=0;if(x>1e-6&&v!==0){let T=1/Math.hypot(1,v/x);C=x/Math.hypot(x,v)*Math.sign(v),b*=T,g*=T;}let S=Lt(i,e[c*2],e[c*2+1],o,b,g,C,n),M=Lt(i,e[c*2+2],e[c*2+3],o,b,g,C,n),w=Lt(i,f,u,r,b,g,C,n),_=Lt(i,h,m,r,b,g,C,n);i.indices.push(w,M,_,w,S,M);}}}function lr(i,e,t,o){let r=i.length/2-1;if(r<3)return null;let n=[];for(let f=0;f<r;f++){let u=i[f*2],h=i[f*2+1],m=i[(f+r-1)%r*2],d=i[(f+r-1)%r*2+1],p=i[(f+1)%r*2],y=i[(f+1)%r*2+1],b=Math.hypot(u-m,h-d)||1,g=Math.hypot(p-u,y-h)||1,v=(h-d)/b,x=-(u-m)/b,C=(y-h)/g,S=-(p-u)/g,M=v+C,w=x+S,_=Math.hypot(M,w);if(_<1e-6){n.push(u,h);continue}M/=_,w/=_;let T=Math.min(1/Math.max(M*v+w*x,.35),3),L=u-M*e*T,E=h-w*e*T,z=ct(m,d,u,h),A=ct(u,h,p,y);if(o.has(z)||o.has(A)){n.push(u,h);continue}let I=-Oe(t),k=t+Oe(t),F=(P,R)=>P<=I||P>=k||R<=I||R>=k;(F(u,h)||F(m,d)||F(p,y))&&(L=u,E=h),n.push(L,E);}n.push(n[0],n[1]);let a=Math.abs(sr(i)),l=sr(n);if(Math.sign(l)!==Math.sign(sr(i))||Math.abs(l)<a*.25)return null;let s=-Oe(t),c=t+Oe(t);for(let f=0;f<n.length;f+=2)n[f]=Math.max(s,Math.min(c,n[f])),n[f+1]=Math.max(s,Math.min(c,n[f+1]));return n}function sr(i){let e=0;for(let t=0;t<i.length-2;t+=2)e+=i[t]*i[t+3]-i[t+2]*i[t+1];return e/2}var cr=i=>i>127?127:i<-127?-127:i,vs=i=>i>32767?32767:i<-32768?-32768:i;function ai(i,e,t){if(!(e>0))return i;let o=Oe(t),r=-o,n=t+o,a=i;for(let l=0;l<3;l++){let s=a.length/2-1;if(s<6)break;let c=new Array(s).fill(true),f=s;for(let h=0;h<s&&!(f<=5);h++){let m=a[h*2],d=a[h*2+1];if(m<=r||m>=n||d<=r||d>=n)continue;let p=(h+s-1)%s;for(;!c[p]&&p!==h;)p=(p+s-1)%s;let y=(h+1)%s;for(;!c[y]&&y!==h;)y=(y+1)%s;if(p===h||y===h)break;let b=a[p*2],g=a[p*2+1],v=a[y*2]-b,x=a[y*2+1]-g,C=Math.hypot(v,x);C<1e-6||Math.abs((m-b)*x-(d-g)*v)/C<e&&(c[h]=false,f--);}if(f===s)break;let u=[];for(let h=0;h<s;h++)c[h]&&u.push(a[h*2],a[h*2+1]);u.push(u[0],u[1]),a=u;}return a}var Ne=4;function xs(i,e,t,o,r){let n=o*o,a=[],l=f=>i[f*2],s=f=>i[f*2+1],c=(f,u)=>{let h=i.length/2;return i.push((l(f)+l(u))/2,(s(f)+s(u))/2),h};for(let f=0;f<e.length;f+=3){a.push([t+e[f],t+e[f+1],t+e[f+2]]);let u=0;for(;a.length&&!(++u>2e4);){let[h,m,d]=a.pop(),p=(l(h)-l(m))**2+(s(h)-s(m))**2,y=(l(m)-l(d))**2+(s(m)-s(d))**2,b=(l(d)-l(h))**2+(s(d)-s(h))**2,g=Math.max(p,y,b);if(g<=n){r.push(h,m,d);continue}if(g===p){let v=c(h,m);a.push([h,v,d],[v,m,d]);}else if(g===y){let v=c(m,d);a.push([m,v,h],[v,d,h]);}else {let v=c(d,h);a.push([d,v,m],[v,h,m]);}}}}function ur(i,e,t=0,o,r=false,n=4096){let a=[],l=[],s=[];for(let m of i.features()){if(m.type!==3||!pe(e,m.properties))continue;let d=m.properties.osm_id,p=typeof d=="number"?d:typeof d=="string"?Number(d):NaN,y=Number.isFinite(p)?p:Number(m.id??0);for(let b of Qe(m.loadGeometry())){let g=r?nt(b,n):b;if(!g)continue;let v=[],x=[],C=o?Re(g.outer,o):g.outer;for(let w=0;w<C.length;w++)v.push(C[w]);for(let w of g.holes){let _=o?Re(w,o):w;x.push(v.length/2);for(let T=0;T<_.length;T++)v.push(_[T]);}let S=$n__default.default(v,x.length?x:void 0,2);if(!S.length)continue;let M=a.length/2;for(let w=0;w<v.length;w++)a.push(v[w]);if(t>0){let w=[];xs(a,S,M,t,w);for(let _=0;_<w.length;_+=3)l.push(w[_],w[_+2],w[_+1]),s.push(y);continue}for(let w=0;w<S.length;w+=3)l.push(M+S[w],M+S[w+2],M+S[w+1]),s.push(y);}}if(!l.length)return null;let c=a.length/2,f=new Int16Array(a),u=new Uint32Array(l);return {featureIds:new Float64Array(s).buffer,vertices:f.buffer,indices:u.buffer,vertexCount:c,indexCount:u.length}}var _s=100;function hr(i){return {shapes:[],cells:[],extent:0,metersPerTile:i}}function dr(i,e,t,o){if(!(t<=0)){i.extent=o;for(let r of e){let n=r.outer;if(n.length<6)continue;let a=1/0,l=1/0,s=-1/0,c=-1/0;for(let f=0;f<n.length;f+=2)n[f]<a&&(a=n[f]),n[f]>s&&(s=n[f]),n[f+1]<l&&(l=n[f+1]),n[f+1]>c&&(c=n[f+1]);i.shapes.push({outer:n,holes:r.holes,level:t,minX:a,minY:l,maxX:s,maxY:c});}i.cells=[];}}function Cs(i){i.cells=Array.from({length:1024},()=>[]);let e=i.extent/32;for(let t=0;t<i.shapes.length;t++){let o=i.shapes[t],r=ft(Math.floor(o.minX/e)),n=ft(Math.floor(o.maxX/e)),a=ft(Math.floor(o.minY/e)),l=ft(Math.floor(o.maxY/e));for(let s=a;s<=l;s++)for(let c=r;c<=n;c++)i.cells[s*32+c].push(t);}}var ci=i=>i.shapes.length===0;function go(i,e,t){!i.cells.length&&i.shapes.length&&Cs(i);let o=i.extent/32,r=i.cells[ft(Math.floor(t/o))*32+ft(Math.floor(e/o))];if(!r||!r.length)return 0;let n=0;for(let a of r){let l=i.shapes[a];if(l.level<=n||e<l.minX||e>l.maxX||t<l.minY||t>l.maxY||!si(l.outer,e,t))continue;let s=false;for(let c of l.holes)if(si(c,e,t)){s=true;break}s||(n=l.level);}return Math.min(Math.round(n*100),127)}function mr(i,e){let t=[],o=[],r=i.extent>0?i.metersPerTile/i.extent:0,n=r>0?2/r:0,a=go(i,e[0],e[1]);t.push(e[0],e[1]),o.push(a);for(let l=0;l+3<e.length;l+=2){let s=e[l],c=e[l+1],f=e[l+2],u=e[l+3],h=go(i,f,u);if(h!==a&&n>0){let m=Math.hypot(f-s,u-c),d=Math.min(Math.ceil(m/n),64),p=a;for(let y=1;y<d;y++){let b=y/d,g=s+(f-s)*b,v=c+(u-c)*b,x=go(i,g,v);x!==p&&(t.push(g,v),o.push(x),p=x);}}t.push(f,u),o.push(h),a=h;}return {pts:t,levels:o}}var ft=i=>i<0?0:i>31?31:i;function si(i,e,t){let o=false,r=i.length/2;for(let n=0,a=r-1;n<r;a=n++){let l=i[n*2],s=i[n*2+1],c=i[a*2],f=i[a*2+1];s>t!=f>t&&e<(c-l)*(t-s)/(f-s)+l&&(o=!o);}return o}var Ss=5;function et(i){let e=i.layer,t=typeof e=="number"?e:typeof e=="string"?Number(e):NaN;if(Number.isFinite(t)&&t!==0)return Math.max(-5,Math.min(5,Math.trunc(t)));let o=i.brunnel;return o==="bridge"?1:o==="tunnel"?-1:0}var Ue=20;function pr(i,e,t=0,o,r=0,n={}){let{level:a}=n,l=Math.max(256,i.length*24),s=new ArrayBuffer(l*Ue),c=new DataView(s),f=0,u=[],h=g=>{if(f+g<=l)return;l=Math.max(l*2,f+g);let v=new ArrayBuffer(l*Ue);new Uint8Array(v).set(new Uint8Array(s,0,f*Ue)),s=v,c=new DataView(v);},m=(g,v,x,C,S,M,w,_=0,T=0,L=0)=>{let E=f*Ue;return c.setInt16(E,g,true),c.setInt16(E+2,v,true),c.setInt16(E+4,x,true),c.setInt16(E+6,C,true),c.setInt8(E+8,S),c.setInt8(E+9,M),c.setInt8(E+10,_),c.setInt8(E+11,T),c.setFloat32(E+12,w,true),c.setFloat32(E+16,L,true),f++},d=0,p=r>0?12/r:0,y=p>0?As(i):null;for(let g of i.features()){if(g.type!==2&&g.type!==3||!pe(e,g.properties)||a!==void 0&&et(g.properties)!==a)continue;let v=g.properties.width;d=typeof v=="number"&&v>.5&&v<100?v:0;let x=g.type===3;for(let C of g.loadGeometry()){let S=t>0?Ts(fi(C),t):fi(C);if(S.length<4)continue;let M=o&&!ci(o)?mr(o,S):null,w=M?M.pts:S,_=M?.levels,T=w.length/2;if(T<2)continue;let L=et(g.properties),E=vo(Math.round(w[0]),Math.round(w[1])),z=vo(Math.round(w[T*2-2]),Math.round(w[T*2-1])),A=null,I=d;if(y&&d>0&&!x){let F=0;for(let O=0;O<T-1;O++)F+=Math.hypot(w[O*2+2]-w[O*2],w[O*2+3]-w[O*2+1]);I=hi(L,d,E,z,y);let P=O=>Math.min(y.width.get(O)??0,I*2),R=P(E)-I,W=P(z)-I,G=Math.min(p,F/2);if(G>0&&(R>0||W>0)){A=H=>{let V=0;return R>0&&H<G&&(V=R*(1-H/G)),W>0&&F-H<G&&(V=Math.max(V,W*(1-(F-H)/G))),I+V};let O=[];for(let H of [G,F-G])H>.01&&H<F-.01&&O.push(H);if(O.length){let H=Ms(w,_,O);w=H.pts,_=H.levels,T=w.length/2;}}}h((T-1)*4);let k=0;for(let F=0;F<T-1;F++){let P=w[F*2],R=w[F*2+1],W=w[F*2+2],G=w[F*2+3],O=Math.hypot(W-P,G-R);if(x&&Es(P,R,W,G,i.extent)){k+=O;continue}let H=ks(P,R,W,G,i.extent);if(!H){k+=O;continue}let[V,Y,$,Q]=H,ue=Math.hypot(V-P,Y-R),J=Math.hypot($-V,Q-Y),X=Math.hypot(W-$,G-Q),te=k+ue,ie=_?_[F]:0,q=_?_[F+1]:0,U=A?A(te):I,j=A?A(te+J):I,le=m(V,Y,$,Q,0,-1,te,ie,q,U),ae=m(V,Y,$,Q,0,1,te,ie,q,U),se=m(V,Y,$,Q,1,1,te,ie,q,j),oe=m(V,Y,$,Q,1,-1,te,ie,q,j);k+=ue+J+X,u.push(le,ae,se,le,se,oe);}}}if(!u.length)return null;let b=new Uint32Array(u);return {vertices:s.slice(0,f*Ue),indices:b.buffer,vertexCount:f,indexCount:b.length}}function Ms(i,e,t){let o=[...t].sort((s,c)=>s-c),r=[i[0],i[1]],n=e?[e[0]]:void 0,a=0,l=0;for(let s=0;s+3<i.length;s+=2){let c=i[s],f=i[s+1],u=i[s+2],h=i[s+3],m=Math.hypot(u-c,h-f);for(;l<o.length&&o[l]<=a+.01;)l++;for(;l<o.length&&o[l]<a+m-.01;){let d=(o[l]-a)/m;r.push(c+(u-c)*d,f+(h-f)*d),n&&e&&n.push(Math.round(e[s/2]+(e[s/2+1]-e[s/2])*d)),l++;}a+=m,r.push(u,h),n&&e&&n.push(e[s/2+1]);}return {pts:r,levels:n}}function Ts(i,e){let t=[];for(let o=0;o+3<i.length;o+=2){let r=i[o],n=i[o+1],a=i[o+2],l=i[o+3];t.push(r,n);let s=Math.min(64,Math.floor(Math.hypot(a-r,l-n)/e));for(let c=1;c<s;c++){let f=c/s;t.push(r+(a-r)*f,n+(l-n)*f);}}return t.push(i[i.length-2],i[i.length-1]),t}function fi(i){let e=[];for(let t=0;t<i.length;t+=2){let o=i[t],r=i[t+1],n=e.length;n>=2&&e[n-2]===o&&e[n-1]===r||e.push(o,r);}return e}function ks(i,e,t,o,r){let n=t-i,a=o-e,l=0,s=1,c=[[-n,i],[n,r-i],[-a,e],[a,r-e]];for(let[f,u]of c){if(f===0){if(u<0)return null;continue}let h=u/f;if(f<0){if(h>s)return null;h>l&&(l=h);}else {if(h<l)return null;h<s&&(s=h);}}return s-l<1e-6?null:[Math.round(i+n*l),Math.round(e+a*l),Math.round(i+n*s),Math.round(e+a*s)]}function Es(i,e,t,o,r){return i===t&&(i<=0||i>=r)?true:e===o&&(e<=0||e>=r)}var ui=new WeakMap,vo=(i,e)=>(i+512)*65536+(e+512);function hi(i,e,t,o,r){if(i===0||e<=0)return e;let n=8*4294967296,a=Math.max(r.raw.get(t+n)??0,r.raw.get(o+n)??0);return a>0&&e>a?a:e}function As(i){let e=ui.get(i);if(e)return e;let t={width:new Map,ends:new Map,raw:new Map},o=[];for(let r of i.features()){if(r.type!==2)continue;let n=r.properties.width,a=typeof n=="number"&&n>.5&&n<100?n:0,l=et(r.properties);for(let s of r.loadGeometry()){if(s.length<4)continue;let c=vo(Math.round(s[0]),Math.round(s[1])),f=vo(Math.round(s[s.length-2]),Math.round(s[s.length-1]));for(let u of [c,f]){let h=u+(l+8)*4294967296;t.ends.set(h,(t.ends.get(h)??0)+1),a>0&&t.raw.set(h,Math.max(t.raw.get(h)??0,a));}o.push({h:c,t:f,lv:l,w:a});}}for(let r of o){let n=hi(r.lv,r.w,r.h,r.t,t);if(!(n<=0))for(let a of [r.h,r.t]){let l=t.width.get(a);(l===void 0||n>l)&&t.width.set(a,n);}}return ui.set(i,t),t}var br={enabled:true,skyColor:"#7fb2e5",horizonColor:"#dfe6ee",fogRange:[1.35,7.5],fogIntensity:.92,spaceColor:"#05070f",atmosphereColor:"#79b8f5",starIntensity:.55,horizonBlend:.75},yr={ambientColor:"#ffffff",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#fff4e2",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#dce6f2",fillIntensity:.18};var di={version:1,name:"OSM 3D \u2014 \u0434\u043D\u0435\u0432\u043D\u043E\u0439",background:"#eceae4",light:{ambientColor:"#ffffff",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#fff4e2",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#dce6f2",fillIntensity:.18},layers:[{id:"landcover-wood",type:"fill","source-layer":"landcover",filter:["in","class","wood","forest"],paint:{color:"#c6dcb4",opacity:{stops:[[8,.5],[12,.85]]},material:"foliage",materialScale:16}},{id:"landcover-grass",type:"fill","source-layer":"landcover",filter:["in","class","grass","farmland","meadow"],paint:{color:"#d9e6c6",opacity:{stops:[[8,.45],[12,.8]]},material:"foliage",materialScale:11}},{id:"landcover-sand",type:"fill","source-layer":"landcover",filter:["in","class","sand","beach"],paint:{color:"#f2e7c8",material:"sand",materialScale:26}},{id:"landcover-ice",type:"fill","source-layer":"landcover",filter:["in","class","ice","glacier"],paint:{color:"#e6f2f7"}},{id:"landcover-wetland",type:"fill","source-layer":"landcover",filter:["in","class","wetland","swamp"],paint:{color:"#cfe0d4",material:"foliage",materialScale:9}},{id:"landuse-residential",type:"fill","source-layer":"landuse",filter:["in","class","residential","suburb","neighbourhood","quarter"],paint:{color:"#e6e2da",opacity:{stops:[[10,.4],[14,.7]]}}},{id:"landuse-industrial",type:"fill","source-layer":"landuse",filter:["in","class","industrial","quarry","railway","substation"],paint:{color:"#e7e0dd"}},{id:"landuse-civic",type:"fill","source-layer":"landuse",filter:["in","class","school","university","college","hospital","clinic","police","kindergarten","bus_station"],paint:{color:"#ece3d8"}},{id:"landuse-sport",type:"fill","source-layer":"landuse",filter:["in","class","pitch","stadium","playground","track","swimming_pool"],paint:{color:"#cfe3c4",material:"foliage",materialScale:10}},{id:"landuse-cemetery",type:"fill","source-layer":"landuse",filter:["in","class","cemetery","grave_yard"],paint:{color:"#d6dfc8",material:"foliage",materialScale:12}},{id:"landuse-parking",type:"fill","source-layer":"landuse",filter:["in","class","parking","fuel"],paint:{color:"#e8e4dc"}},{id:"park",type:"fill","source-layer":"park",paint:{color:"#cfe5bd",opacity:.75,material:"foliage",materialScale:15}},{id:"aeroway-area",type:"fill","source-layer":"aeroway",filter:["in","class","aerodrome","apron","helipad"],paint:{color:"#e4e2e6"}},{id:"water",type:"fill","source-layer":"water",filter:["!in","class","swimming_pool"],paint:{color:"#a5cbe3",material:"water",materialScale:14,materialSpeed:1}},{id:"water-pool",type:"fill","source-layer":"water",filter:["==","class","swimming_pool"],paint:{color:"#9fd3e8",material:"water",materialScale:8,materialSpeed:1}},{id:"waterway",type:"line","source-layer":"waterway",paint:{color:"#a5cbe3",width:{stops:[[8,.6],[12,1.4],[16,4],[19,11.5],[20,23],[21,46],[22,92]]},material:"water",materialScale:10,materialSpeed:1}},{id:"aeroway-line",type:"line","source-layer":"aeroway",filter:["in","class","runway","taxiway"],paint:{color:"#d8d5da",width:{stops:[[10,1],[14,5],[18,24],[19,24],[20,48],[21,96],[22,192]]},material:"asphalt",materialScale:4}},{id:"road-bridge-outline",type:"line",network:"roads","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","motorway","trunk","primary","secondary","tertiary","minor","service","track"]],minzoom:14,paint:{color:{from:"road-casing-major",darken:.2},width:{stops:[[6,1.6],[10,3.4],[14,8],[16,14],[18,30],[19,45],[20,90],[21,180],[22,360]]},widthFromData:true,widthExtra:5.5}},{id:"road-bridge-outline-thin",type:"line",network:"roads","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","path","pedestrian","footway","steps","rail","transit"]],minzoom:14,paint:{color:{from:"road-casing-major",darken:.2},width:{stops:[[14,2.5],[17,5],[19,9],[20,15],[21,28]]}}},{id:"road-casing-major",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","motorway","trunk","primary"],minzoom:5,paint:{color:"#d4ab68",width:{stops:[[6,1.6],[10,3.4],[14,8],[16,14],[18,30],[19,45],[20,90],[21,180],[22,360]]},widthFromData:true,widthExtra:2.5}},{id:"road-casing-secondary",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","secondary","tertiary"],minzoom:9,paint:{color:{stops:[[16,"#c6bca6"],[18.5,"#d4ab68"]]},width:{stops:[[10,1.6],[14,5.5],[16,10],[18,22],[19,33],[20,66],[21,132],[22,264]]},widthFromData:true,widthExtra:2}},{id:"road-casing-minor",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","minor","service","track"],minzoom:12,paint:{color:{stops:[[16,"#cdc4b2"],[18.5,"#d4ab68"]]},width:{stops:[[13,1.4],[16,6],[18,14],[19,22],[20,44],[21,88],[22,176]]},widthFromData:true,widthExtra:1.5}},{id:"road-rail",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","rail","transit"],minzoom:10,paint:{color:"#b2a99e",width:{stops:[[10,.8],[14,1.8],[18,4],[19,5.5],[20,11],[21,22],[22,44]]}}},{id:"road-path",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","path","pedestrian","footway","steps"],minzoom:14,paint:{color:"#bdb2a0",width:{stops:[[14,.8],[17,2],[19,4],[20,8],[21,16],[22,32]]},dashArray:[4,3],material:"asphalt",materialScale:2}},{id:"road-minor",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","minor","service","track"],minzoom:12,paint:{color:{stops:[[16,"#ffffff"],[18.5,"#ffdfa3"]]},width:{stops:[[13,.6],[16,4],[18,11],[19,18],[20,36],[21,72],[22,144]]},material:"asphalt",materialScale:3,widthFromData:true}},{id:"road-ramp",network:"roads",type:"line","source-layer":"transportation",filter:["all",["in","class","motorway","trunk","primary"],["has","ramp"]],minzoom:5,paint:{color:"#ffdfa3",width:{stops:[[6,.8],[10,2.2],[14,6],[16,11],[18,25],[19,38.5],[20,77],[21,154],[22,308]]},material:"asphalt",materialScale:3,widthFromData:true}},{id:"road-secondary",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","secondary","tertiary"],minzoom:9,paint:{color:{stops:[[16,"#ffffff"],[18.5,"#ffdfa3"]]},width:{stops:[[10,.8],[14,3.6],[16,7.5],[18,18],[19,28],[20,56],[21,112],[22,224]]},material:"asphalt",materialScale:3,widthFromData:true}},{id:"road-major",network:"roads",type:"line","source-layer":"transportation",filter:["all",["in","class","motorway","trunk","primary"],["!has","ramp"]],minzoom:5,paint:{color:"#ffdfa3",width:{stops:[[6,.8],[10,2.2],[14,6],[16,11],[18,25],[19,38.5],[20,77],[21,154],[22,308]]},material:"asphalt",materialScale:3,widthFromData:true}},{id:"road-lane-divider-major",network:"roads",type:"line","source-layer":"transportation",filter:["all",["!has","oneway"],["in","class","motorway","trunk","primary"]],minzoom:16.5,paint:{color:"#e3bd7f",width:{stops:[[16.5,.54],[17,.78],[18,1.4],[19,2.17],[20,4.34],[21,8.68],[22,17.36]]},dashArray:[7,18],material:"flat"}},{id:"road-lane-divider-secondary",network:"roads",type:"line","source-layer":"transportation",filter:["all",["!has","oneway"],["in","class","secondary","tertiary"]],minzoom:16.5,paint:{color:"#d8cfbc",width:{stops:[[16.5,.46],[17,.67],[18,1.2],[19,1.86],[20,3.72],[21,7.44],[22,14.88]]},dashArray:[7,18],material:"flat"}},{id:"boundary",type:"line","source-layer":"boundary",filter:["<=","admin_level",4],paint:{color:"#b3a6b8",opacity:.7,width:{stops:[[4,.7],[10,1.4],[16,2.4]]},dashArray:[6,4]}},{id:"building",type:"fill-extrusion","source-layer":"building",minzoom:15,paint:{color:"#d8d3c8",roofColor:"#d9d3c7",opacity:1,heightScale:{stops:[[15,0],[15.8,1]]},aoStrength:.18,tintVariation:.06,windowColor:"#7f9ab5",windowFrameColor:"#e9e5dc",windowGlow:0,facadeDetail:1,floorHeight:3.2,roofVariation:.35}},{id:"indoor-venue",type:"fill-extrusion",source:"indoor","source-layer":"area",filter:["all",["==","class","level"],["==","base",1]],minzoom:15,maxzoom:16,paint:{color:"#d8d3c8",roofColor:"#d9d3c7",opacity:1,aoStrength:.18,tintVariation:.06,windowColor:"#7f9ab5",windowFrameColor:"#e9e5dc",windowGlow:0,facadeDetail:1,floorHeight:3.2,roofVariation:.35}},{id:"road-closed-casing",type:"line",source:"closures","source-layer":"closures",minzoom:11,paint:{color:"#ffffff",width:{stops:[[11,4],[14,6],[17,10],[19,16],[20,32],[21,64],[22,128]]},opacity:.9},overlay:true},{id:"road-closed",type:"line",source:"closures","source-layer":"closures",minzoom:11,paint:{color:"#d92b2b",width:{stops:[[11,2.5],[14,4],[17,7],[19,11],[20,22],[21,44],[22,88]]},dashArray:[5,4]},overlay:true},{id:"road-closed-end",type:"symbol",source:"closures","source-layer":"closure_ends",minzoom:13,layout:{iconImage:"road_closed",iconFrame:"circle",iconFrameScale:1.6,allowOverlap:true,priority:6},paint:{color:"#d92b2b",frameColor:"#d92b2b",frameOpacity:1,frameHaloColor:"#ffffff",frameHaloWidth:1.4,iconColor:"#ffffff",iconHaloWidth:0,iconSize:13}},{id:"crossing",type:"fill",source:"points","source-layer":"crossings",minzoom:16.5,overlay:true,paint:{color:"#ffffff",opacity:.9}},{id:"housenumber",type:"symbol","source-layer":"housenumber",minzoom:17,layout:{textField:"{housenumber}",textSize:{stops:[[17,9],[19,11]]},maxLineChars:6,priority:-60},paint:{color:"#8c8478",haloColor:"#f5f3ee",haloWidth:1}},{id:"poi-food",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#c2681c",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#c2681c",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","cafe","restaurant","fast_food","bar","pub","beer","bakery","ice_cream"]},{id:"poi-shop",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#2f77c4",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#2f77c4",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","shop","clothing_store","grocery","alcohol_shop","music","laundry","hairdresser","car","bicycle"]},{id:"poi-transport",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#3b82a6",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#3b82a6",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","bus","railway","parking","fuel","bicycle_parking","bicycle_rental","taxi","airport"]},{id:"poi-health",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#c24444",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#c24444",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","pharmacy","hospital","doctors","dentist","veterinary"]},{id:"poi-education",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#3f7f7a",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#3f7f7a",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","school","college","university","library","kindergarten"]},{id:"poi-culture",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#8b5aa5",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#8b5aa5",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","museum","theatre","cinema","art_gallery","attraction","monument","zoo","theme_park","castle","place_of_worship","information"]},{id:"poi-sport",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#4f8b45",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#4f8b45",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","pitch","park","garden","playground","stadium","sports_centre","swimming_pool","athletics","running"]},{id:"poi-lodging",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#7a5fbf",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#7a5fbf",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","lodging"]},{id:"poi-service",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#59636e",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#59636e",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","bank","atm","post","office","town_hall","police","fire_station","toilets"]},{id:"poi",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#4a4a4a",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#4a4a4a",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["!in","class","cafe","restaurant","fast_food","bar","pub","beer","bakery","ice_cream","shop","clothing_store","grocery","alcohol_shop","music","laundry","hairdresser","car","bicycle","bus","railway","parking","fuel","bicycle_parking","bicycle_rental","taxi","airport","pharmacy","hospital","doctors","dentist","veterinary","school","college","university","library","kindergarten","museum","theatre","cinema","art_gallery","attraction","monument","zoo","theme_park","castle","place_of_worship","information","pitch","park","garden","playground","stadium","sports_centre","swimming_pool","athletics","running","lodging","bank","atm","post","office","town_hall","police","fire_station","toilets"]},{id:"traffic-signal",type:"symbol",source:"points","source-layer":"roadpoints",minzoom:16,filter:["==","kind","traffic_signals"],layout:{iconImage:"traffic_signals",priority:3},paint:{color:"#5c6470",haloColor:"#ffffff",haloWidth:1.4,iconSize:15}},{id:"road-shield",type:"symbol","source-layer":"transportation_name",filter:["has","ref"],minzoom:11,layout:{textField:"{ref}",iconImage:"shield-{ref_length}",iconPlacement:"behind",textSize:{stops:[[11,9.5],[16,11]]},iconTextGap:4,maxLineChars:10,collisionPadding:70,priority:3},paint:{color:"#3a4048",haloColor:"#f7f3e8",haloWidth:.5,iconColor:"#f7f3e8",iconHaloColor:"#8a8172",iconHaloWidth:1.4}},{id:"road-label",type:"symbol","source-layer":"transportation_name",minzoom:14,layout:{textField:["{name:ru}","{name}"],textPlacement:"line",textSize:{stops:[[14,10],[18,13]]},priority:20,abbreviate:true},paint:{color:"#5c5646",haloColor:"#ffffff",haloWidth:1.6}},{id:"water-label",type:"symbol","source-layer":"water_name",minzoom:10,layout:{textField:["{name:ru}","{name}"],textSize:{stops:[[10,11],[16,14]]},priority:30},paint:{color:"#3d7ea6",haloColor:"#ffffff",haloWidth:1.4}},{id:"place-label",type:"symbol","source-layer":"place",minzoom:4,layout:{textField:["{name:ru}","{name}"],textSize:{stops:[[6,12],[12,17],[16,22]]},maxLineChars:16,priority:90},paint:{color:"#3a3a3a",haloColor:"#ffffff",haloWidth:1.8}},{id:"indoor-shell",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","level"],minzoom:16,paint:{color:"#f6f3ec",opacity:.97},clipToTile:true},{id:"indoor-corridor",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","corridor"],minzoom:16,paint:{color:"#ffffff"},clipToTile:true},{id:"indoor-room",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["in","class","room","area"],minzoom:16,paint:{color:"#efeae0"},clipToTile:true},{id:"indoor-service",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","service"],minzoom:16,paint:{color:"#e6e1d6"},clipToTile:true},{id:"indoor-shop",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","shop"],minzoom:16,paint:{color:"#e8e0f0"},clipToTile:true},{id:"indoor-food",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","food"],minzoom:16,paint:{color:"#f7e3cd"},clipToTile:true},{id:"indoor-wc",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","wc"],minzoom:16,paint:{color:"#d8e8f2"},clipToTile:true},{id:"indoor-wall",type:"fill-extrusion",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","wall"],minzoom:16,paint:{color:"#cbc4b8",roofColor:"#e4ded2",facadeDetail:0,tintVariation:0,roofVariation:0,aoStrength:0}},{id:"indoor-transportation",type:"fill",source:"indoor","source-layer":"transportation",splitBy:"level",minzoom:16,paint:{color:"#d9d2e8",opacity:.95},clipToTile:true},{id:"indoor-door",type:"symbol",source:"indoor","source-layer":"poi",filter:["==","class","door"],splitBy:"level",minzoom:18,layout:{iconImage:"door",iconSize:{stops:[[18,9],[20,13]]},allowOverlap:true,priority:-10},paint:{color:"#8a8172",haloColor:"#ffffff",haloWidth:1.2}},{id:"indoor-poi",type:"symbol",source:"indoor","source-layer":"poi",splitBy:"level",minzoom:17,layout:{textField:["{name}"],iconImage:"{class}",textSize:{stops:[[17,10],[19,12]]},iconSize:{stops:[[17,12],[19,15]]},iconTextGap:2,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#4a4a4a",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:.32}},{id:"indoor-name",type:"symbol",source:"indoor","source-layer":"area_name",splitBy:"level",minzoom:17,layout:{textField:["{name}"],textSize:{stops:[[17,10.5],[19,12.5]]},maxLineChars:8},paint:{color:"#3c3830",haloColor:"#ffffff",haloWidth:1.4}},{id:"building-entrance",type:"symbol",source:"points","source-layer":"entrances",minzoom:17,layout:{iconImage:"entrance",showFor:"highlight",textField:["{ref}"],textSize:{stops:[[17,10],[19,12.5]]},allowOverlap:true,priority:40,iconRotate:"angle",placement:"map",arrowLength:{stops:[[17,22],[18,32],[19,40],[20,48],[22,56]]},arrowWidth:{stops:[[17,6],[18,8.5],[19,10.5],[20,12.5],[22,15]]},arrowOutline:{stops:[[17,1.4],[18,2],[19,2.5],[20,3],[22,3.5]]},arrowGap:{stops:[[17,14],[18,19],[19,23],[20,27],[22,31]]},arrowUnits:"pixels",iconTextGap:3,arrowDotRadius:{stops:[[17,2.2],[18,3.2],[19,4],[20,4.8],[22,5.6]]},arrowDotGap:{stops:[[17,5],[18,7],[19,9],[20,11],[22,12.5]]}},paint:{color:"#2d6ecb",haloColor:"#ffffff",haloWidth:1.6}}],sources:{indoor:{url:"/tileserver/data/indoor/{z}/{x}/{y}.pbf",minzoom:15,maxzoom:18},points:{url:"/tileserver/data/points/{z}/{x}/{y}.pbf",minzoom:13,maxzoom:16},closures:{url:"/tileserver/data/closures/{z}/{x}/{y}.pbf",minzoom:10,maxzoom:16}}};var mi={version:1,name:"\u041C\u044F\u0433\u043A\u0430\u044F \u0433\u0435\u043E\u043C\u0435\u0442\u0440\u0438\u044F",background:"#eceae4",light:{ambientColor:"#ffffff",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#fff4e2",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#dce6f2",fillIntensity:.18},layers:[{id:"landcover-wood",type:"fill","source-layer":"landcover",filter:["in","class","wood","forest"],paint:{color:"#c6dcb4",opacity:{stops:[[8,.5],[12,.85]]},material:"foliage",materialScale:16},cornerRadius:10,cornerSegments:4},{id:"landcover-grass",type:"fill","source-layer":"landcover",filter:["in","class","grass","farmland","meadow"],paint:{color:"#d9e6c6",opacity:{stops:[[8,.45],[12,.8]]},material:"foliage",materialScale:11},cornerRadius:8,cornerSegments:4},{id:"landcover-sand",type:"fill","source-layer":"landcover",filter:["in","class","sand","beach"],paint:{color:"#f2e7c8",material:"sand",materialScale:26},cornerRadius:10,cornerSegments:4},{id:"landcover-ice",type:"fill","source-layer":"landcover",filter:["in","class","ice","glacier"],paint:{color:"#e6f2f7"}},{id:"landcover-wetland",type:"fill","source-layer":"landcover",filter:["in","class","wetland","swamp"],paint:{color:"#cfe0d4",material:"foliage",materialScale:9},cornerRadius:8,cornerSegments:4},{id:"landuse-residential",type:"fill","source-layer":"landuse",filter:["in","class","residential","suburb","neighbourhood","quarter"],paint:{color:"#e6e2da",opacity:{stops:[[10,.4],[14,.7]]}},cornerRadius:4,cornerSegments:3},{id:"landuse-industrial",type:"fill","source-layer":"landuse",filter:["in","class","industrial","quarry","railway","substation"],paint:{color:"#e7e0dd"},cornerRadius:4,cornerSegments:3},{id:"landuse-civic",type:"fill","source-layer":"landuse",filter:["in","class","school","university","college","hospital","clinic","police","kindergarten","bus_station"],paint:{color:"#ece3d8"},cornerRadius:4,cornerSegments:3},{id:"landuse-sport",type:"fill","source-layer":"landuse",filter:["in","class","pitch","stadium","playground","track","swimming_pool"],paint:{color:"#cfe3c4",material:"foliage",materialScale:10},cornerRadius:5,cornerSegments:3},{id:"landuse-cemetery",type:"fill","source-layer":"landuse",filter:["in","class","cemetery","grave_yard"],paint:{color:"#d6dfc8",material:"foliage",materialScale:12},cornerRadius:5,cornerSegments:3},{id:"landuse-parking",type:"fill","source-layer":"landuse",filter:["in","class","parking","fuel"],paint:{color:"#e8e4dc"},cornerRadius:3,cornerSegments:3},{id:"park",type:"fill","source-layer":"park",paint:{color:"#cfe5bd",opacity:.75,material:"foliage",materialScale:15},cornerRadius:9,cornerSegments:4},{id:"aeroway-area",type:"fill","source-layer":"aeroway",filter:["in","class","aerodrome","apron","helipad"],paint:{color:"#e4e2e6"},cornerRadius:5,cornerSegments:3},{id:"water",type:"fill","source-layer":"water",filter:["!in","class","swimming_pool"],paint:{color:"#a5cbe3",material:"water",materialScale:14,materialSpeed:1},cornerRadius:7,cornerSegments:4},{id:"water-pool",type:"fill","source-layer":"water",filter:["==","class","swimming_pool"],paint:{color:"#9fd3e8",material:"water",materialScale:8,materialSpeed:1},cornerRadius:4,cornerSegments:4},{id:"waterway",type:"line","source-layer":"waterway",paint:{color:"#a5cbe3",width:{stops:[[8,.6],[12,1.4],[16,4],[19,11.5],[20,23],[21,46],[22,92]]},material:"water",materialScale:10,materialSpeed:1}},{id:"aeroway-line",type:"line","source-layer":"aeroway",filter:["in","class","runway","taxiway"],paint:{color:"#d8d5da",width:{stops:[[10,1],[14,5],[18,24],[19,24],[20,48],[21,96],[22,192]]},material:"asphalt",materialScale:4}},{id:"road-bridge-outline",type:"line",network:"roads","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","motorway","trunk","primary","secondary","tertiary","minor","service","track"]],minzoom:14,paint:{color:{from:"road-casing-major",darken:.2},width:{stops:[[6,1.6],[10,3.4],[14,8],[16,14],[18,30],[19,45],[20,90],[21,180],[22,360]]},widthFromData:true,widthExtra:5.5}},{id:"road-bridge-outline-thin",type:"line",network:"roads","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","path","pedestrian","footway","steps","rail","transit"]],minzoom:14,paint:{color:{from:"road-casing-major",darken:.2},width:{stops:[[14,2.5],[17,5],[19,9],[20,15],[21,28]]}}},{id:"road-casing-major",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","motorway","trunk","primary"],minzoom:5,paint:{color:"#d4ab68",width:{stops:[[6,1.6],[10,3.4],[14,8],[16,14],[18,30],[19,45],[20,90],[21,180],[22,360]]},widthFromData:true,widthExtra:2.5}},{id:"road-casing-secondary",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","secondary","tertiary"],minzoom:9,paint:{color:{stops:[[16,"#c6bca6"],[18.5,"#d4ab68"]]},width:{stops:[[10,1.6],[14,5.5],[16,10],[18,22],[19,33],[20,66],[21,132],[22,264]]},widthFromData:true,widthExtra:2}},{id:"road-casing-minor",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","minor","service","track"],minzoom:12,paint:{color:{stops:[[16,"#cdc4b2"],[18.5,"#d4ab68"]]},width:{stops:[[13,1.4],[16,6],[18,14],[19,22],[20,44],[21,88],[22,176]]},widthFromData:true,widthExtra:1.5}},{id:"road-rail",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","rail","transit"],minzoom:10,paint:{color:"#b2a99e",width:{stops:[[10,.8],[14,1.8],[18,4],[19,5.5],[20,11],[21,22],[22,44]]}}},{id:"road-path",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","path","pedestrian","footway","steps"],minzoom:14,paint:{color:"#bdb2a0",width:{stops:[[14,.8],[17,2],[19,4],[20,8],[21,16],[22,32]]},dashArray:[4,3],material:"asphalt",materialScale:2}},{id:"road-minor",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","minor","service","track"],minzoom:12,paint:{color:{stops:[[16,"#ffffff"],[18.5,"#ffdfa3"]]},width:{stops:[[13,.6],[16,4],[18,11],[19,18],[20,36],[21,72],[22,144]]},material:"asphalt",materialScale:3,widthFromData:true}},{id:"road-ramp",network:"roads",type:"line","source-layer":"transportation",filter:["all",["in","class","motorway","trunk","primary"],["has","ramp"]],minzoom:5,paint:{color:"#ffdfa3",width:{stops:[[6,.8],[10,2.2],[14,6],[16,11],[18,25],[19,38.5],[20,77],[21,154],[22,308]]},material:"asphalt",materialScale:3,widthFromData:true}},{id:"road-secondary",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","secondary","tertiary"],minzoom:9,paint:{color:{stops:[[16,"#ffffff"],[18.5,"#ffdfa3"]]},width:{stops:[[10,.8],[14,3.6],[16,7.5],[18,18],[19,28],[20,56],[21,112],[22,224]]},material:"asphalt",materialScale:3,widthFromData:true}},{id:"road-major",network:"roads",type:"line","source-layer":"transportation",filter:["all",["in","class","motorway","trunk","primary"],["!has","ramp"]],minzoom:5,paint:{color:"#ffdfa3",width:{stops:[[6,.8],[10,2.2],[14,6],[16,11],[18,25],[19,38.5],[20,77],[21,154],[22,308]]},material:"asphalt",materialScale:3,widthFromData:true}},{id:"road-lane-divider-major",network:"roads",type:"line","source-layer":"transportation",filter:["all",["!has","oneway"],["in","class","motorway","trunk","primary"]],minzoom:16.5,paint:{color:"#e3bd7f",width:{stops:[[16.5,.54],[17,.78],[18,1.4],[19,2.17],[20,4.34],[21,8.68],[22,17.36]]},dashArray:[7,18],material:"flat"}},{id:"road-lane-divider-secondary",network:"roads",type:"line","source-layer":"transportation",filter:["all",["!has","oneway"],["in","class","secondary","tertiary"]],minzoom:16.5,paint:{color:"#d8cfbc",width:{stops:[[16.5,.46],[17,.67],[18,1.2],[19,1.86],[20,3.72],[21,7.44],[22,14.88]]},dashArray:[7,18],material:"flat"}},{id:"boundary",type:"line","source-layer":"boundary",filter:["<=","admin_level",4],paint:{color:"#b3a6b8",opacity:.7,width:{stops:[[4,.7],[10,1.4],[16,2.4]]},dashArray:[6,4]}},{id:"building",type:"fill-extrusion","source-layer":"building",minzoom:15,paint:{color:"#d8d3c8",roofColor:"#d9d3c7",opacity:1,heightScale:{stops:[[15,0],[15.8,1]]},aoStrength:.18,tintVariation:.06,windowColor:"#7f9ab5",windowFrameColor:"#e9e5dc",windowGlow:0,facadeDetail:1,floorHeight:3.2,roofVariation:.35},cornerRadius:1.6,cornerSegments:2},{id:"indoor-venue",type:"fill-extrusion",source:"indoor","source-layer":"area",filter:["all",["==","class","level"],["==","base",1]],minzoom:15,maxzoom:16,paint:{color:"#d8d3c8",roofColor:"#d9d3c7",opacity:1,aoStrength:.18,tintVariation:.06,windowColor:"#7f9ab5",windowFrameColor:"#e9e5dc",windowGlow:0,facadeDetail:1,floorHeight:3.2,roofVariation:.35}},{id:"road-closed-casing",type:"line",source:"closures","source-layer":"closures",minzoom:11,paint:{color:"#ffffff",width:{stops:[[11,4],[14,6],[17,10],[19,16],[20,32],[21,64],[22,128]]},opacity:.9},overlay:true},{id:"road-closed",type:"line",source:"closures","source-layer":"closures",minzoom:11,paint:{color:"#d92b2b",width:{stops:[[11,2.5],[14,4],[17,7],[19,11],[20,22],[21,44],[22,88]]},dashArray:[5,4]},overlay:true},{id:"road-closed-end",type:"symbol",source:"closures","source-layer":"closure_ends",minzoom:13,layout:{iconImage:"road_closed",iconFrame:"circle",iconFrameScale:1.6,allowOverlap:true,priority:6},paint:{color:"#d92b2b",frameColor:"#d92b2b",frameOpacity:1,frameHaloColor:"#ffffff",frameHaloWidth:1.4,iconColor:"#ffffff",iconHaloWidth:0,iconSize:13}},{id:"crossing",type:"fill",source:"points","source-layer":"crossings",minzoom:16.5,overlay:true,paint:{color:"#ffffff",opacity:.9}},{id:"housenumber",type:"symbol","source-layer":"housenumber",minzoom:17,layout:{textField:"{housenumber}",textSize:{stops:[[17,9],[19,11]]},maxLineChars:6,priority:-60},paint:{color:"#8c8478",haloColor:"#f5f3ee",haloWidth:1}},{id:"poi-food",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#c2681c",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#c2681c",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","cafe","restaurant","fast_food","bar","pub","beer","bakery","ice_cream"]},{id:"poi-shop",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#2f77c4",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#2f77c4",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","shop","clothing_store","grocery","alcohol_shop","music","laundry","hairdresser","car","bicycle"]},{id:"poi-transport",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#3b82a6",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#3b82a6",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","bus","railway","parking","fuel","bicycle_parking","bicycle_rental","taxi","airport"]},{id:"poi-health",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#c24444",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#c24444",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","pharmacy","hospital","doctors","dentist","veterinary"]},{id:"poi-education",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#3f7f7a",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#3f7f7a",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","school","college","university","library","kindergarten"]},{id:"poi-culture",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#8b5aa5",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#8b5aa5",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","museum","theatre","cinema","art_gallery","attraction","monument","zoo","theme_park","castle","place_of_worship","information"]},{id:"poi-sport",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#4f8b45",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#4f8b45",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","pitch","park","garden","playground","stadium","sports_centre","swimming_pool","athletics","running"]},{id:"poi-lodging",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#7a5fbf",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#7a5fbf",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","lodging"]},{id:"poi-service",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#59636e",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#59636e",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","bank","atm","post","office","town_hall","police","fire_station","toilets"]},{id:"poi",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#4a4a4a",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#4a4a4a",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["!in","class","cafe","restaurant","fast_food","bar","pub","beer","bakery","ice_cream","shop","clothing_store","grocery","alcohol_shop","music","laundry","hairdresser","car","bicycle","bus","railway","parking","fuel","bicycle_parking","bicycle_rental","taxi","airport","pharmacy","hospital","doctors","dentist","veterinary","school","college","university","library","kindergarten","museum","theatre","cinema","art_gallery","attraction","monument","zoo","theme_park","castle","place_of_worship","information","pitch","park","garden","playground","stadium","sports_centre","swimming_pool","athletics","running","lodging","bank","atm","post","office","town_hall","police","fire_station","toilets"]},{id:"traffic-signal",type:"symbol",source:"points","source-layer":"roadpoints",minzoom:16,filter:["==","kind","traffic_signals"],layout:{iconImage:"traffic_signals",priority:3},paint:{color:"#5c6470",haloColor:"#ffffff",haloWidth:1.4,iconSize:15}},{id:"road-shield",type:"symbol","source-layer":"transportation_name",filter:["has","ref"],minzoom:11,layout:{textField:"{ref}",iconImage:"shield-{ref_length}",iconPlacement:"behind",textSize:{stops:[[11,9.5],[16,11]]},iconTextGap:4,maxLineChars:10,collisionPadding:70,priority:3},paint:{color:"#3a4048",haloColor:"#f7f3e8",haloWidth:.5,iconColor:"#f7f3e8",iconHaloColor:"#8a8172",iconHaloWidth:1.4}},{id:"road-label",type:"symbol","source-layer":"transportation_name",minzoom:14,layout:{textField:["{name:ru}","{name}"],textPlacement:"line",textSize:{stops:[[14,10],[18,13]]},priority:20,abbreviate:true},paint:{color:"#5c5646",haloColor:"#ffffff",haloWidth:1.6}},{id:"water-label",type:"symbol","source-layer":"water_name",minzoom:10,layout:{textField:["{name:ru}","{name}"],textSize:{stops:[[10,11],[16,14]]},priority:30},paint:{color:"#3d7ea6",haloColor:"#ffffff",haloWidth:1.4}},{id:"place-label",type:"symbol","source-layer":"place",minzoom:4,layout:{textField:["{name:ru}","{name}"],textSize:{stops:[[6,12],[12,17],[16,22]]},maxLineChars:16,priority:90},paint:{color:"#3a3a3a",haloColor:"#ffffff",haloWidth:1.8}},{id:"indoor-shell",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","level"],minzoom:16,paint:{color:"#f6f3ec",opacity:.97},clipToTile:true},{id:"indoor-corridor",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","corridor"],minzoom:16,paint:{color:"#ffffff"},clipToTile:true},{id:"indoor-room",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["in","class","room","area"],minzoom:16,paint:{color:"#efeae0"},clipToTile:true},{id:"indoor-service",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","service"],minzoom:16,paint:{color:"#e6e1d6"},clipToTile:true},{id:"indoor-shop",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","shop"],minzoom:16,paint:{color:"#e8e0f0"},clipToTile:true},{id:"indoor-food",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","food"],minzoom:16,paint:{color:"#f7e3cd"},clipToTile:true},{id:"indoor-wc",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","wc"],minzoom:16,paint:{color:"#d8e8f2"},clipToTile:true},{id:"indoor-wall",type:"fill-extrusion",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","wall"],minzoom:16,paint:{color:"#cbc4b8",roofColor:"#e4ded2",facadeDetail:0,tintVariation:0,roofVariation:0,aoStrength:0}},{id:"indoor-transportation",type:"fill",source:"indoor","source-layer":"transportation",splitBy:"level",minzoom:16,paint:{color:"#d9d2e8",opacity:.95},clipToTile:true},{id:"indoor-door",type:"symbol",source:"indoor","source-layer":"poi",filter:["==","class","door"],splitBy:"level",minzoom:18,layout:{iconImage:"door",iconSize:{stops:[[18,9],[20,13]]},allowOverlap:true,priority:-10},paint:{color:"#8a8172",haloColor:"#ffffff",haloWidth:1.2}},{id:"indoor-poi",type:"symbol",source:"indoor","source-layer":"poi",splitBy:"level",minzoom:17,layout:{textField:["{name}"],iconImage:"{class}",textSize:{stops:[[17,10],[19,12]]},iconSize:{stops:[[17,12],[19,15]]},iconTextGap:2,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#4a4a4a",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:.32}},{id:"indoor-name",type:"symbol",source:"indoor","source-layer":"area_name",splitBy:"level",minzoom:17,layout:{textField:["{name}"],textSize:{stops:[[17,10.5],[19,12.5]]},maxLineChars:8},paint:{color:"#3c3830",haloColor:"#ffffff",haloWidth:1.4}},{id:"building-entrance",type:"symbol",source:"points","source-layer":"entrances",minzoom:17,layout:{iconImage:"entrance",showFor:"highlight",textField:["{ref}"],textSize:{stops:[[17,10],[19,12.5]]},allowOverlap:true,priority:40,iconRotate:"angle",placement:"map",arrowLength:{stops:[[17,22],[18,32],[19,40],[20,48],[22,56]]},arrowWidth:{stops:[[17,6],[18,8.5],[19,10.5],[20,12.5],[22,15]]},arrowOutline:{stops:[[17,1.4],[18,2],[19,2.5],[20,3],[22,3.5]]},arrowGap:{stops:[[17,14],[18,19],[19,23],[20,27],[22,31]]},arrowUnits:"pixels",iconTextGap:3,arrowDotRadius:{stops:[[17,2.2],[18,3.2],[19,4],[20,4.8],[22,5.6]]},arrowDotGap:{stops:[[17,5],[18,7],[19,9],[20,11],[22,12.5]]}},paint:{color:"#2d6ecb",haloColor:"#ffffff",haloWidth:1.6}}],sources:{indoor:{url:"/tileserver/data/indoor/{z}/{x}/{y}.pbf",minzoom:15,maxzoom:18},points:{url:"/tileserver/data/points/{z}/{x}/{y}.pbf",minzoom:13,maxzoom:16},closures:{url:"/tileserver/data/closures/{z}/{x}/{y}.pbf",minzoom:10,maxzoom:16}}};var pi={version:1,name:"\u0420\u0435\u043B\u044C\u0435\u0444",background:"#eceae4",light:{ambientColor:"#ffffff",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#fff4e2",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#dce6f2",fillIntensity:.18},layers:[{id:"landcover-wood",type:"surface","source-layer":"landcover",filter:["in","class","wood","forest"],paint:{color:"#c6dcb4",opacity:{stops:[[8,.5],[12,.85]]},material:"foliage",materialScale:16,sideShade:.16},elevation:.7,bevel:.5,bevelDrop:.15,cornerRadius:10,cornerSegments:4},{id:"landcover-grass",type:"surface","source-layer":"landcover",filter:["in","class","grass","farmland","meadow"],paint:{color:"#d9e6c6",opacity:{stops:[[8,.45],[12,.8]]},material:"foliage",materialScale:11,sideShade:.16},elevation:.5,bevel:.45,bevelDrop:.12,cornerRadius:8,cornerSegments:4},{id:"landcover-sand",type:"surface","source-layer":"landcover",filter:["in","class","sand","beach"],paint:{color:"#f2e7c8",material:"sand",materialScale:26,sideShade:.16},elevation:.12,bevel:.6,bevelDrop:.08,cornerRadius:10,cornerSegments:4},{id:"landcover-ice",type:"fill","source-layer":"landcover",filter:["in","class","ice","glacier"],paint:{color:"#e6f2f7"}},{id:"landcover-wetland",type:"surface","source-layer":"landcover",filter:["in","class","wetland","swamp"],paint:{color:"#cfe0d4",material:"foliage",materialScale:9,sideShade:.16},elevation:.15,bevel:.5,bevelDrop:.08,cornerRadius:8,cornerSegments:4},{id:"landuse-residential",type:"fill","source-layer":"landuse",filter:["in","class","residential","suburb","neighbourhood","quarter"],paint:{color:"#e6e2da",opacity:{stops:[[10,.4],[14,.7]]}}},{id:"landuse-industrial",type:"fill","source-layer":"landuse",filter:["in","class","industrial","quarry","railway","substation"],paint:{color:"#e7e0dd"}},{id:"landuse-civic",type:"fill","source-layer":"landuse",filter:["in","class","school","university","college","hospital","clinic","police","kindergarten","bus_station"],paint:{color:"#ece3d8"}},{id:"landuse-sport",type:"surface","source-layer":"landuse",filter:["in","class","pitch","stadium","playground","track","swimming_pool"],paint:{color:"#cfe3c4",material:"foliage",materialScale:10,sideShade:.16},elevation:.35,bevel:.4,bevelDrop:.1,cornerRadius:5,cornerSegments:4},{id:"landuse-cemetery",type:"surface","source-layer":"landuse",filter:["in","class","cemetery","grave_yard"],paint:{color:"#d6dfc8",material:"foliage",materialScale:12,sideShade:.16},elevation:.3,bevel:.4,bevelDrop:.1,cornerRadius:5,cornerSegments:4},{id:"landuse-parking",type:"fill","source-layer":"landuse",filter:["in","class","parking","fuel"],paint:{color:"#e8e4dc"}},{id:"park",type:"surface","source-layer":"park",paint:{color:"#cfe5bd",opacity:.75,material:"foliage",materialScale:15,sideShade:.16},elevation:.6,bevel:.5,bevelDrop:.15,cornerRadius:9,cornerSegments:4},{id:"aeroway-area",type:"fill","source-layer":"aeroway",filter:["in","class","aerodrome","apron","helipad"],paint:{color:"#e4e2e6"}},{id:"water",type:"surface","source-layer":"water",filter:["!in","class","swimming_pool"],paint:{color:"#a5cbe3",material:"water",materialScale:14,materialSpeed:1,sideShade:0},elevation:-0.35,bevel:.8,bevelDrop:.12,cornerRadius:7,cornerSegments:4},{id:"water-pool",type:"surface","source-layer":"water",filter:["==","class","swimming_pool"],paint:{color:"#9fd3e8",material:"water",materialScale:8,materialSpeed:1,sideShade:0},elevation:-0.2,bevel:.4,bevelDrop:.08,cornerRadius:4,cornerSegments:4},{id:"waterway",type:"line","source-layer":"waterway",paint:{color:"#a5cbe3",width:{stops:[[8,.6],[12,1.4],[16,4],[19,11.5],[20,23],[21,46],[22,92]]},material:"water",materialScale:10,materialSpeed:1,elevation:-0.3}},{id:"aeroway-line",type:"line","source-layer":"aeroway",filter:["in","class","runway","taxiway"],paint:{color:"#d8d5da",width:{stops:[[10,1],[14,5],[18,24],[19,24],[20,48],[21,96],[22,192]]},material:"asphalt",materialScale:4,elevation:.08}},{id:"road-bridge-outline",type:"line",network:"roads","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","motorway","trunk","primary","secondary","tertiary","minor","service","track"]],minzoom:14,paint:{elevation:.1,color:{from:"road-casing-major",darken:.2},width:{stops:[[6,1.6],[10,3.4],[14,8],[16,14],[18,30],[19,45],[20,90],[21,180],[22,360]]},widthFromData:true,widthExtra:5.5}},{id:"road-bridge-outline-thin",type:"line",network:"roads","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","path","pedestrian","footway","steps","rail","transit"]],minzoom:14,paint:{elevation:.1,color:{from:"road-casing-major",darken:.2},width:{stops:[[14,2.5],[17,5],[19,9],[20,15],[21,28]]}}},{id:"road-casing-major",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","motorway","trunk","primary"],minzoom:5,paint:{color:"#d4ab68",width:{stops:[[6,1.6],[10,3.4],[14,8],[16,14],[18,30],[19,45],[20,90],[21,180],[22,360]]},elevation:.15,widthFromData:true,widthExtra:2.5}},{id:"road-casing-secondary",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","secondary","tertiary"],minzoom:9,paint:{color:{stops:[[16,"#c6bca6"],[18.5,"#d4ab68"]]},width:{stops:[[10,1.6],[14,5.5],[16,10],[18,22],[19,33],[20,66],[21,132],[22,264]]},elevation:.13,widthFromData:true,widthExtra:2}},{id:"road-casing-minor",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","minor","service","track"],minzoom:12,paint:{color:{stops:[[16,"#cdc4b2"],[18.5,"#d4ab68"]]},width:{stops:[[13,1.4],[16,6],[18,14],[19,22],[20,44],[21,88],[22,176]]},elevation:.11,widthFromData:true,widthExtra:1.5}},{id:"road-rail",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","rail","transit"],minzoom:10,paint:{color:"#b2a99e",width:{stops:[[10,.8],[14,1.8],[18,4],[19,5.5],[20,11],[21,22],[22,44]]},elevation:.12}},{id:"road-path",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","path","pedestrian","footway","steps"],minzoom:14,paint:{color:"#bdb2a0",width:{stops:[[14,.8],[17,2],[19,4],[20,8],[21,16],[22,32]]},dashArray:[4,3],material:"asphalt",materialScale:2,elevation:.05}},{id:"road-minor",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","minor","service","track"],minzoom:12,paint:{color:{stops:[[16,"#ffffff"],[18.5,"#ffdfa3"]]},width:{stops:[[13,.6],[16,4],[18,11],[19,18],[20,36],[21,72],[22,144]]},material:"asphalt",materialScale:3,elevation:.14,widthFromData:true}},{id:"road-ramp",network:"roads",type:"line","source-layer":"transportation",filter:["all",["in","class","motorway","trunk","primary"],["has","ramp"]],minzoom:5,paint:{color:"#ffdfa3",width:{stops:[[6,.8],[10,2.2],[14,6],[16,11],[18,25],[19,38.5],[20,77],[21,154],[22,308]]},material:"asphalt",materialScale:3,elevation:.18,widthFromData:true}},{id:"road-secondary",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","secondary","tertiary"],minzoom:9,paint:{color:{stops:[[16,"#ffffff"],[18.5,"#ffdfa3"]]},width:{stops:[[10,.8],[14,3.6],[16,7.5],[18,18],[19,28],[20,56],[21,112],[22,224]]},material:"asphalt",materialScale:3,elevation:.16,widthFromData:true}},{id:"road-major",network:"roads",type:"line","source-layer":"transportation",filter:["all",["in","class","motorway","trunk","primary"],["!has","ramp"]],minzoom:5,paint:{color:"#ffdfa3",width:{stops:[[6,.8],[10,2.2],[14,6],[16,11],[18,25],[19,38.5],[20,77],[21,154],[22,308]]},material:"asphalt",materialScale:3,elevation:.18,widthFromData:true}},{id:"road-lane-divider-major",network:"roads",type:"line","source-layer":"transportation",filter:["all",["!has","oneway"],["in","class","motorway","trunk","primary"]],minzoom:16.5,paint:{color:"#e3bd7f",width:{stops:[[16.5,.54],[17,.78],[18,1.4],[19,2.17],[20,4.34],[21,8.68],[22,17.36]]},dashArray:[7,18],material:"flat",elevation:.182}},{id:"road-lane-divider-secondary",network:"roads",type:"line","source-layer":"transportation",filter:["all",["!has","oneway"],["in","class","secondary","tertiary"]],minzoom:16.5,paint:{color:"#d8cfbc",width:{stops:[[16.5,.46],[17,.67],[18,1.2],[19,1.86],[20,3.72],[21,7.44],[22,14.88]]},dashArray:[7,18],material:"flat",elevation:.162}},{id:"boundary",type:"line","source-layer":"boundary",filter:["<=","admin_level",4],paint:{color:"#b3a6b8",opacity:.7,width:{stops:[[4,.7],[10,1.4],[16,2.4]]},dashArray:[6,4]}},{id:"building",type:"fill-extrusion","source-layer":"building",minzoom:15,paint:{color:"#d8d3c8",roofColor:"#d9d3c7",opacity:1,heightScale:{stops:[[15,0],[15.8,1]]},aoStrength:.18,tintVariation:.06,windowColor:"#7f9ab5",windowFrameColor:"#e9e5dc",windowGlow:0,facadeDetail:1,floorHeight:3.2,roofVariation:.35}},{id:"indoor-venue",type:"fill-extrusion",source:"indoor","source-layer":"area",filter:["all",["==","class","level"],["==","base",1]],minzoom:15,maxzoom:16,paint:{color:"#d8d3c8",roofColor:"#d9d3c7",opacity:1,aoStrength:.18,tintVariation:.06,windowColor:"#7f9ab5",windowFrameColor:"#e9e5dc",windowGlow:0,facadeDetail:1,floorHeight:3.2,roofVariation:.35}},{id:"road-closed-casing",type:"line",source:"closures","source-layer":"closures",minzoom:11,paint:{color:"#ffffff",width:{stops:[[11,4],[14,6],[17,10],[19,16],[20,32],[21,64],[22,128]]},opacity:.9},overlay:true},{id:"road-closed",type:"line",source:"closures","source-layer":"closures",minzoom:11,paint:{color:"#d92b2b",width:{stops:[[11,2.5],[14,4],[17,7],[19,11],[20,22],[21,44],[22,88]]},dashArray:[5,4]},overlay:true},{id:"road-closed-end",type:"symbol",source:"closures","source-layer":"closure_ends",minzoom:13,layout:{iconImage:"road_closed",iconFrame:"circle",iconFrameScale:1.6,allowOverlap:true,priority:6},paint:{color:"#d92b2b",frameColor:"#d92b2b",frameOpacity:1,frameHaloColor:"#ffffff",frameHaloWidth:1.4,iconColor:"#ffffff",iconHaloWidth:0,iconSize:13}},{id:"crossing",type:"surface",weld:0,source:"points","source-layer":"crossings",minzoom:16.5,overlay:true,paint:{color:"#ffffff",opacity:.9,sideShade:.16},elevation:.09,bevel:.05,bevelDrop:.02,groundBy:{"landcover:wood":.7,"landcover:forest":.7,"landcover:grass":.5,"landcover:farmland":.5,"landcover:meadow":.5,"landcover:sand":.12,"landcover:beach":.12,"landcover:wetland":.15,"landcover:swamp":.15,"landuse:pitch":.35,"landuse:stadium":.35,"landuse:playground":.35,"landuse:track":.35,"landuse:swimming_pool":.35,"landuse:cemetery":.3,"landuse:grave_yard":.3,"park:park":.6}},{id:"housenumber",type:"symbol","source-layer":"housenumber",minzoom:17,layout:{textField:"{housenumber}",textSize:{stops:[[17,9],[19,11]]},maxLineChars:6,priority:-60},paint:{color:"#8c8478",haloColor:"#f5f3ee",haloWidth:1}},{id:"poi-food",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#c2681c",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#c2681c",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","cafe","restaurant","fast_food","bar","pub","beer","bakery","ice_cream"]},{id:"poi-shop",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#2f77c4",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#2f77c4",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","shop","clothing_store","grocery","alcohol_shop","music","laundry","hairdresser","car","bicycle"]},{id:"poi-transport",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#3b82a6",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#3b82a6",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","bus","railway","parking","fuel","bicycle_parking","bicycle_rental","taxi","airport"]},{id:"poi-health",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#c24444",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#c24444",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","pharmacy","hospital","doctors","dentist","veterinary"]},{id:"poi-education",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#3f7f7a",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#3f7f7a",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","school","college","university","library","kindergarten"]},{id:"poi-culture",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#8b5aa5",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#8b5aa5",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","museum","theatre","cinema","art_gallery","attraction","monument","zoo","theme_park","castle","place_of_worship","information"]},{id:"poi-sport",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#4f8b45",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#4f8b45",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","pitch","park","garden","playground","stadium","sports_centre","swimming_pool","athletics","running"]},{id:"poi-lodging",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#7a5fbf",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#7a5fbf",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","lodging"]},{id:"poi-service",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#59636e",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#59636e",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","bank","atm","post","office","town_hall","police","fire_station","toilets"]},{id:"poi",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#4a4a4a",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#4a4a4a",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["!in","class","cafe","restaurant","fast_food","bar","pub","beer","bakery","ice_cream","shop","clothing_store","grocery","alcohol_shop","music","laundry","hairdresser","car","bicycle","bus","railway","parking","fuel","bicycle_parking","bicycle_rental","taxi","airport","pharmacy","hospital","doctors","dentist","veterinary","school","college","university","library","kindergarten","museum","theatre","cinema","art_gallery","attraction","monument","zoo","theme_park","castle","place_of_worship","information","pitch","park","garden","playground","stadium","sports_centre","swimming_pool","athletics","running","lodging","bank","atm","post","office","town_hall","police","fire_station","toilets"]},{id:"traffic-signal",type:"symbol",source:"points","source-layer":"roadpoints",minzoom:16,filter:["==","kind","traffic_signals"],layout:{iconImage:"traffic_signals",priority:3},paint:{color:"#5c6470",haloColor:"#ffffff",haloWidth:1.4,iconSize:15}},{id:"road-shield",type:"symbol","source-layer":"transportation_name",filter:["has","ref"],minzoom:11,layout:{textField:"{ref}",iconImage:"shield-{ref_length}",iconPlacement:"behind",textSize:{stops:[[11,9.5],[16,11]]},iconTextGap:4,maxLineChars:10,collisionPadding:70,priority:3},paint:{color:"#3a4048",haloColor:"#f7f3e8",haloWidth:.5,iconColor:"#f7f3e8",iconHaloColor:"#8a8172",iconHaloWidth:1.4}},{id:"road-label",type:"symbol","source-layer":"transportation_name",minzoom:14,layout:{textField:["{name:ru}","{name}"],textPlacement:"line",textSize:{stops:[[14,10],[18,13]]},priority:20,abbreviate:true},paint:{color:"#5c5646",haloColor:"#ffffff",haloWidth:1.6}},{id:"water-label",type:"symbol","source-layer":"water_name",minzoom:10,layout:{textField:["{name:ru}","{name}"],textSize:{stops:[[10,11],[16,14]]},priority:30},paint:{color:"#3d7ea6",haloColor:"#ffffff",haloWidth:1.4}},{id:"place-label",type:"symbol","source-layer":"place",minzoom:4,layout:{textField:["{name:ru}","{name}"],textSize:{stops:[[6,12],[12,17],[16,22]]},maxLineChars:16,priority:90},paint:{color:"#3a3a3a",haloColor:"#ffffff",haloWidth:1.8}},{id:"indoor-shell",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","level"],minzoom:16,paint:{color:"#f6f3ec",opacity:.97},clipToTile:true},{id:"indoor-corridor",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","corridor"],minzoom:16,paint:{color:"#ffffff"},clipToTile:true},{id:"indoor-room",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["in","class","room","area"],minzoom:16,paint:{color:"#efeae0"},clipToTile:true},{id:"indoor-service",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","service"],minzoom:16,paint:{color:"#e6e1d6"},clipToTile:true},{id:"indoor-shop",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","shop"],minzoom:16,paint:{color:"#e8e0f0"},clipToTile:true},{id:"indoor-food",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","food"],minzoom:16,paint:{color:"#f7e3cd"},clipToTile:true},{id:"indoor-wc",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","wc"],minzoom:16,paint:{color:"#d8e8f2"},clipToTile:true},{id:"indoor-wall",type:"fill-extrusion",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","wall"],minzoom:16,paint:{color:"#cbc4b8",roofColor:"#e4ded2",facadeDetail:0,tintVariation:0,roofVariation:0,aoStrength:0}},{id:"indoor-transportation",type:"fill",source:"indoor","source-layer":"transportation",splitBy:"level",minzoom:16,paint:{color:"#d9d2e8",opacity:.95},clipToTile:true},{id:"indoor-door",type:"symbol",source:"indoor","source-layer":"poi",filter:["==","class","door"],splitBy:"level",minzoom:18,layout:{iconImage:"door",iconSize:{stops:[[18,9],[20,13]]},allowOverlap:true,priority:-10},paint:{color:"#8a8172",haloColor:"#ffffff",haloWidth:1.2}},{id:"indoor-poi",type:"symbol",source:"indoor","source-layer":"poi",splitBy:"level",minzoom:17,layout:{textField:["{name}"],iconImage:"{class}",textSize:{stops:[[17,10],[19,12]]},iconSize:{stops:[[17,12],[19,15]]},iconTextGap:2,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#4a4a4a",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:.32}},{id:"indoor-name",type:"symbol",source:"indoor","source-layer":"area_name",splitBy:"level",minzoom:17,layout:{textField:["{name}"],textSize:{stops:[[17,10.5],[19,12.5]]},maxLineChars:8},paint:{color:"#3c3830",haloColor:"#ffffff",haloWidth:1.4}},{id:"building-entrance",type:"symbol",source:"points","source-layer":"entrances",minzoom:17,layout:{iconImage:"entrance",showFor:"highlight",textField:["{ref}"],textSize:{stops:[[17,10],[19,12.5]]},allowOverlap:true,priority:40,iconRotate:"angle",placement:"map",arrowLength:{stops:[[17,22],[18,32],[19,40],[20,48],[22,56]]},arrowWidth:{stops:[[17,6],[18,8.5],[19,10.5],[20,12.5],[22,15]]},arrowOutline:{stops:[[17,1.4],[18,2],[19,2.5],[20,3],[22,3.5]]},arrowGap:{stops:[[17,14],[18,19],[19,23],[20,27],[22,31]]},arrowUnits:"pixels",iconTextGap:3,arrowDotRadius:{stops:[[17,2.2],[18,3.2],[19,4],[20,4.8],[22,5.6]]},arrowDotGap:{stops:[[17,5],[18,7],[19,9],[20,11],[22,12.5]]}},paint:{color:"#2d6ecb",haloColor:"#ffffff",haloWidth:1.6}}],sources:{indoor:{url:"/tileserver/data/indoor/{z}/{x}/{y}.pbf",minzoom:15,maxzoom:18},points:{url:"/tileserver/data/points/{z}/{x}/{y}.pbf",minzoom:13,maxzoom:16},closures:{url:"/tileserver/data/closures/{z}/{x}/{y}.pbf",minzoom:10,maxzoom:16}}};var bi={version:1,name:"\u041E\u0431\u044A\u0451\u043C\u043D\u044B\u0439 \u0433\u043E\u0440\u043E\u0434",background:"#eceae4",light:{ambientColor:"#ffffff",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#fff4e2",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#dce6f2",fillIntensity:.18},layers:[{id:"landcover-wood",type:"surface","source-layer":"landcover",filter:["in","class","wood","forest"],paint:{color:"#c6dcb4",opacity:{stops:[[8,.5],[12,.85]]},material:"flat",sideShade:.16},elevation:.175,bevel:.125,bevelDrop:.038,cornerRadius:10,cornerSegments:4},{id:"landcover-grass",type:"surface","source-layer":"landcover",filter:["in","class","grass","farmland","meadow"],paint:{color:"#d9e6c6",opacity:{stops:[[8,.45],[12,.8]]},material:"flat",sideShade:.16},elevation:.125,bevel:.113,bevelDrop:.03,cornerRadius:8,cornerSegments:4},{id:"landcover-sand",type:"surface","source-layer":"landcover",filter:["in","class","sand","beach"],paint:{color:"#f2e7c8",material:"flat",sideShade:.16},elevation:.035,bevel:.15,bevelDrop:.02,cornerRadius:10,cornerSegments:4},{id:"landcover-ice",type:"fill","source-layer":"landcover",filter:["in","class","ice","glacier"],paint:{color:"#e6f2f7"}},{id:"landcover-wetland",type:"surface","source-layer":"landcover",filter:["in","class","wetland","swamp"],paint:{color:"#cfe0d4",material:"flat",sideShade:.16},elevation:.045,bevel:.125,bevelDrop:.02,cornerRadius:8,cornerSegments:4},{id:"landuse-residential",type:"surface","source-layer":"landuse",filter:["in","class","residential","suburb","neighbourhood","quarter"],paint:{color:"#e6e2da",opacity:{stops:[[10,.4],[14,.7]]},material:"flat",sideShade:.16},cornerRadius:4,cornerSegments:3,elevation:.02,bevel:.1,bevelDrop:.02},{id:"landuse-industrial",type:"surface","source-layer":"landuse",filter:["in","class","industrial","quarry","railway","substation"],paint:{color:"#e7e0dd",material:"flat",sideShade:.16},cornerRadius:4,cornerSegments:3,elevation:.03,bevel:.1,bevelDrop:.02},{id:"landuse-civic",type:"surface","source-layer":"landuse",filter:["in","class","school","university","college","hospital","clinic","police","kindergarten","bus_station"],paint:{color:"#ece3d8",material:"flat",sideShade:.16},cornerRadius:4,cornerSegments:3,elevation:.055,bevel:.1,bevelDrop:.02},{id:"landuse-sport",type:"surface","source-layer":"landuse",filter:["in","class","pitch","stadium","playground","track","swimming_pool"],paint:{color:"#cfe3c4",material:"flat",sideShade:.16},elevation:.088,bevel:.1,bevelDrop:.025,cornerRadius:5,cornerSegments:3},{id:"landuse-cemetery",type:"surface","source-layer":"landuse",filter:["in","class","cemetery","grave_yard"],paint:{color:"#d6dfc8",material:"flat",sideShade:.16},elevation:.075,bevel:.1,bevelDrop:.025,cornerRadius:5,cornerSegments:3},{id:"landuse-parking",type:"surface","source-layer":"landuse",filter:["in","class","parking","fuel"],paint:{color:"#e8e4dc",material:"flat",sideShade:.16},cornerRadius:3,cornerSegments:3,elevation:.19,bevel:.1,bevelDrop:.02},{id:"park",type:"surface","source-layer":"park",paint:{color:"#cfe5bd",opacity:.75,material:"flat",sideShade:.16},elevation:.15,bevel:.125,bevelDrop:.038,cornerRadius:9,cornerSegments:4},{id:"aeroway-area",type:"surface","source-layer":"aeroway",filter:["in","class","aerodrome","apron","helipad"],paint:{color:"#e4e2e6",material:"flat",sideShade:.16},cornerRadius:5,cornerSegments:3,elevation:.065,bevel:.1,bevelDrop:.02},{id:"water",type:"surface","source-layer":"water",filter:["!in","class","swimming_pool"],paint:{color:"#a5cbe3",material:"water",materialScale:14,materialSpeed:1,sideShade:0},elevation:-0.087,bevel:.2,bevelDrop:.03,cornerRadius:7,cornerSegments:4},{id:"water-pool",type:"surface","source-layer":"water",filter:["==","class","swimming_pool"],paint:{color:"#9fd3e8",material:"water",materialScale:8,materialSpeed:1,sideShade:0},elevation:-0.05,bevel:.1,bevelDrop:.02,cornerRadius:4,cornerSegments:3},{id:"waterway",type:"line","source-layer":"waterway",paint:{color:"#a5cbe3",width:{stops:[[8,.6],[12,1.4],[16,4],[19,11.5],[20,23],[21,46],[22,92]]},material:"water",materialScale:10,materialSpeed:1,elevation:-0.075}},{id:"aeroway-line",type:"line","source-layer":"aeroway",filter:["in","class","runway","taxiway"],paint:{color:"#d8d5da",width:{stops:[[10,1],[14,5],[18,24],[19,24],[20,48],[21,96],[22,192]]},material:"flat",elevation:.02}},{id:"road-bridge-outline",type:"line",network:"roads","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","motorway","trunk","primary","secondary","tertiary","minor","service","track"]],minzoom:14,paint:{elevation:.025,color:{from:"road-casing-major",darken:.2},width:{stops:[[6,1.6],[10,3.4],[14,8],[16,14],[18,30],[19,45],[20,90],[21,180],[22,360]]},widthFromData:true,widthExtra:5.5}},{id:"road-bridge-outline-thin",type:"line",network:"roads","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","path","pedestrian","footway","steps","rail","transit"]],minzoom:14,paint:{elevation:.025,color:{from:"road-casing-major",darken:.2},width:{stops:[[14,2.5],[17,5],[19,9],[20,15],[21,28]]}}},{id:"road-casing-major",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","motorway","trunk","primary"],minzoom:5,paint:{color:"#d4ab68",width:{stops:[[6,1.6],[10,3.4],[14,8],[16,14],[18,30],[19,45],[20,90],[21,180],[22,360]]},elevation:.037,widthFromData:true,widthExtra:2.5}},{id:"road-casing-secondary",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","secondary","tertiary"],minzoom:9,paint:{color:{stops:[[16,"#c6bca6"],[18.5,"#d4ab68"]]},width:{stops:[[10,1.6],[14,5.5],[16,10],[18,22],[19,33],[20,66],[21,132],[22,264]]},elevation:.033,widthFromData:true,widthExtra:2}},{id:"road-casing-minor",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","minor","service","track"],minzoom:12,paint:{color:{stops:[[16,"#cdc4b2"],[18.5,"#d4ab68"]]},width:{stops:[[13,1.4],[16,6],[18,14],[19,22],[20,44],[21,88],[22,176]]},elevation:.028,widthFromData:true,widthExtra:1.5}},{id:"road-rail",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","rail","transit"],minzoom:10,paint:{color:"#b2a99e",width:{stops:[[10,.8],[14,1.8],[18,4],[19,5.5],[20,11],[21,22],[22,44]]},elevation:.03}},{id:"road-path",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","path","pedestrian","footway","steps"],minzoom:14,paint:{color:"#bdb2a0",width:{stops:[[14,.8],[17,2],[19,4],[20,8],[21,16],[22,32]]},dashArray:[4,3],material:"flat",elevation:.013}},{id:"road-minor",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","minor","service","track"],minzoom:12,paint:{color:{stops:[[16,"#ffffff"],[18.5,"#ffdfa3"]]},width:{stops:[[13,.6],[16,4],[18,11],[19,18],[20,36],[21,72],[22,144]]},material:"flat",elevation:.035,widthFromData:true}},{id:"road-ramp",network:"roads",type:"line","source-layer":"transportation",filter:["all",["in","class","motorway","trunk","primary"],["has","ramp"]],minzoom:5,paint:{color:"#ffdfa3",width:{stops:[[6,.8],[10,2.2],[14,6],[16,11],[18,25],[19,38.5],[20,77],[21,154],[22,308]]},material:"flat",elevation:.045,widthFromData:true}},{id:"road-secondary",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","secondary","tertiary"],minzoom:9,paint:{color:{stops:[[16,"#ffffff"],[18.5,"#ffdfa3"]]},width:{stops:[[10,.8],[14,3.6],[16,7.5],[18,18],[19,28],[20,56],[21,112],[22,224]]},material:"flat",elevation:.04,widthFromData:true}},{id:"road-major",network:"roads",type:"line","source-layer":"transportation",filter:["all",["in","class","motorway","trunk","primary"],["!has","ramp"]],minzoom:5,paint:{color:"#ffdfa3",width:{stops:[[6,.8],[10,2.2],[14,6],[16,11],[18,25],[19,38.5],[20,77],[21,154],[22,308]]},material:"flat",elevation:.045,widthFromData:true}},{id:"road-lane-divider-major",network:"roads",type:"line","source-layer":"transportation",filter:["all",["!has","oneway"],["in","class","motorway","trunk","primary"]],minzoom:16.5,paint:{color:"#e3bd7f",width:{stops:[[16.5,.54],[17,.78],[18,1.4],[19,2.17],[20,4.34],[21,8.68],[22,17.36]]},dashArray:[7,18],material:"flat",elevation:.047}},{id:"road-lane-divider-secondary",network:"roads",type:"line","source-layer":"transportation",filter:["all",["!has","oneway"],["in","class","secondary","tertiary"]],minzoom:16.5,paint:{color:"#d8cfbc",width:{stops:[[16.5,.46],[17,.67],[18,1.2],[19,1.86],[20,3.72],[21,7.44],[22,14.88]]},dashArray:[7,18],material:"flat",elevation:.042}},{id:"boundary",type:"line","source-layer":"boundary",filter:["<=","admin_level",4],paint:{color:"#b3a6b8",opacity:.7,width:{stops:[[4,.7],[10,1.4],[16,2.4]]},dashArray:[6,4]}},{id:"building",type:"fill-extrusion","source-layer":"building",minzoom:15,paint:{color:"#d8d3c8",roofColor:"#d9d3c7",opacity:1,heightScale:{stops:[[15,0],[15.8,1]]},aoStrength:.18,tintVariation:.06,windowColor:"#7f9ab5",windowFrameColor:"#e9e5dc",windowGlow:0,facadeDetail:1,floorHeight:3.2,roofVariation:.35},cornerRadius:1.6,cornerSegments:2},{id:"indoor-venue",type:"fill-extrusion",source:"indoor","source-layer":"area",filter:["all",["==","class","level"],["==","base",1]],minzoom:15,maxzoom:16,paint:{color:"#d8d3c8",roofColor:"#d9d3c7",opacity:1,aoStrength:.18,tintVariation:.06,windowColor:"#7f9ab5",windowFrameColor:"#e9e5dc",windowGlow:0,facadeDetail:1,floorHeight:3.2,roofVariation:.35}},{id:"road-closed-casing",type:"line",source:"closures","source-layer":"closures",minzoom:11,paint:{color:"#ffffff",width:{stops:[[11,4],[14,6],[17,10],[19,16],[20,32],[21,64],[22,128]]},opacity:.9},overlay:true},{id:"road-closed",type:"line",source:"closures","source-layer":"closures",minzoom:11,paint:{color:"#d92b2b",width:{stops:[[11,2.5],[14,4],[17,7],[19,11],[20,22],[21,44],[22,88]]},dashArray:[5,4]},overlay:true},{id:"road-closed-end",type:"symbol",source:"closures","source-layer":"closure_ends",minzoom:13,layout:{iconImage:"road_closed",iconFrame:"circle",iconFrameScale:1.6,allowOverlap:true,priority:6},paint:{color:"#d92b2b",frameColor:"#d92b2b",frameOpacity:1,frameHaloColor:"#ffffff",frameHaloWidth:1.4,iconColor:"#ffffff",iconHaloWidth:0,iconSize:13}},{id:"crossing",type:"surface",weld:0,source:"points","source-layer":"crossings",minzoom:16.5,overlay:true,paint:{color:"#ffffff",opacity:.9,sideShade:.16,material:"flat"},elevation:.023,bevel:.013,bevelDrop:.005,groundBy:{"landcover:wood":.175,"landcover:forest":.175,"landcover:grass":.125,"landcover:farmland":.125,"landcover:meadow":.125,"landcover:sand":.035,"landcover:beach":.035,"landcover:wetland":.045,"landcover:swamp":.045,"landuse:residential":.02,"landuse:suburb":.02,"landuse:neighbourhood":.02,"landuse:quarter":.02,"landuse:industrial":.03,"landuse:quarry":.03,"landuse:railway":.03,"landuse:substation":.03,"landuse:school":.055,"landuse:university":.055,"landuse:college":.055,"landuse:hospital":.055,"landuse:clinic":.055,"landuse:police":.055,"landuse:kindergarten":.055,"landuse:bus_station":.055,"landuse:pitch":.088,"landuse:stadium":.088,"landuse:playground":.088,"landuse:track":.088,"landuse:swimming_pool":.088,"landuse:cemetery":.075,"landuse:grave_yard":.075,"landuse:parking":.19,"landuse:fuel":.19,"park:park":.15,"aeroway:aerodrome":.065,"aeroway:apron":.065,"aeroway:helipad":.065}},{id:"housenumber",type:"symbol","source-layer":"housenumber",minzoom:17,layout:{textField:"{housenumber}",textSize:{stops:[[17,9],[19,11]]},maxLineChars:6,priority:-60},paint:{color:"#8c8478",haloColor:"#f5f3ee",haloWidth:1}},{id:"poi-food",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#c2681c",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#c2681c",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","cafe","restaurant","fast_food","bar","pub","beer","bakery","ice_cream"]},{id:"poi-shop",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#2f77c4",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#2f77c4",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","shop","clothing_store","grocery","alcohol_shop","music","laundry","hairdresser","car","bicycle"]},{id:"poi-transport",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#3b82a6",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#3b82a6",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","bus","railway","parking","fuel","bicycle_parking","bicycle_rental","taxi","airport"]},{id:"poi-health",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#c24444",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#c24444",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","pharmacy","hospital","doctors","dentist","veterinary"]},{id:"poi-education",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#3f7f7a",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#3f7f7a",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","school","college","university","library","kindergarten"]},{id:"poi-culture",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#8b5aa5",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#8b5aa5",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","museum","theatre","cinema","art_gallery","attraction","monument","zoo","theme_park","castle","place_of_worship","information"]},{id:"poi-sport",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#4f8b45",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#4f8b45",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","pitch","park","garden","playground","stadium","sports_centre","swimming_pool","athletics","running"]},{id:"poi-lodging",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#7a5fbf",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#7a5fbf",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","lodging"]},{id:"poi-service",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#59636e",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#59636e",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","bank","atm","post","office","town_hall","police","fire_station","toilets"]},{id:"poi",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#4a4a4a",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#4a4a4a",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["!in","class","cafe","restaurant","fast_food","bar","pub","beer","bakery","ice_cream","shop","clothing_store","grocery","alcohol_shop","music","laundry","hairdresser","car","bicycle","bus","railway","parking","fuel","bicycle_parking","bicycle_rental","taxi","airport","pharmacy","hospital","doctors","dentist","veterinary","school","college","university","library","kindergarten","museum","theatre","cinema","art_gallery","attraction","monument","zoo","theme_park","castle","place_of_worship","information","pitch","park","garden","playground","stadium","sports_centre","swimming_pool","athletics","running","lodging","bank","atm","post","office","town_hall","police","fire_station","toilets"]},{id:"traffic-signal",type:"symbol",source:"points","source-layer":"roadpoints",minzoom:16,filter:["==","kind","traffic_signals"],layout:{iconImage:"traffic_signals",priority:3},paint:{color:"#5c6470",haloColor:"#ffffff",haloWidth:1.4,iconSize:15}},{id:"road-shield",type:"symbol","source-layer":"transportation_name",filter:["has","ref"],minzoom:11,layout:{textField:"{ref}",iconImage:"shield-{ref_length}",iconPlacement:"behind",textSize:{stops:[[11,9.5],[16,11]]},iconTextGap:4,maxLineChars:10,collisionPadding:70,priority:3},paint:{color:"#3a4048",haloColor:"#f7f3e8",haloWidth:.5,iconColor:"#f7f3e8",iconHaloColor:"#8a8172",iconHaloWidth:1.4}},{id:"road-label",type:"symbol","source-layer":"transportation_name",minzoom:14,layout:{textField:["{name:ru}","{name}"],textPlacement:"line",textSize:{stops:[[14,10],[18,13]]},priority:20,abbreviate:true},paint:{color:"#5c5646",haloColor:"#ffffff",haloWidth:1.6}},{id:"water-label",type:"symbol","source-layer":"water_name",minzoom:10,layout:{textField:["{name:ru}","{name}"],textSize:{stops:[[10,11],[16,14]]},priority:30},paint:{color:"#3d7ea6",haloColor:"#ffffff",haloWidth:1.4}},{id:"place-label",type:"symbol","source-layer":"place",minzoom:4,layout:{textField:["{name:ru}","{name}"],textSize:{stops:[[6,12],[12,17],[16,22]]},maxLineChars:16,priority:90},paint:{color:"#3a3a3a",haloColor:"#ffffff",haloWidth:1.8}},{id:"indoor-shell",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","level"],minzoom:16,paint:{color:"#f6f3ec",opacity:.97},clipToTile:true},{id:"indoor-corridor",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","corridor"],minzoom:16,paint:{color:"#ffffff"},clipToTile:true},{id:"indoor-room",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["in","class","room","area"],minzoom:16,paint:{color:"#efeae0"},clipToTile:true},{id:"indoor-service",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","service"],minzoom:16,paint:{color:"#e6e1d6"},clipToTile:true},{id:"indoor-shop",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","shop"],minzoom:16,paint:{color:"#e8e0f0"},clipToTile:true},{id:"indoor-food",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","food"],minzoom:16,paint:{color:"#f7e3cd"},clipToTile:true},{id:"indoor-wc",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","wc"],minzoom:16,paint:{color:"#d8e8f2"},clipToTile:true},{id:"indoor-wall",type:"fill-extrusion",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","wall"],minzoom:16,paint:{color:"#cbc4b8",roofColor:"#e4ded2",facadeDetail:0,tintVariation:0,roofVariation:0,aoStrength:0}},{id:"indoor-transportation",type:"fill",source:"indoor","source-layer":"transportation",splitBy:"level",minzoom:16,paint:{color:"#d9d2e8",opacity:.95},clipToTile:true},{id:"indoor-door",type:"symbol",source:"indoor","source-layer":"poi",filter:["==","class","door"],splitBy:"level",minzoom:18,layout:{iconImage:"door",iconSize:{stops:[[18,9],[20,13]]},allowOverlap:true,priority:-10},paint:{color:"#8a8172",haloColor:"#ffffff",haloWidth:1.2}},{id:"indoor-poi",type:"symbol",source:"indoor","source-layer":"poi",splitBy:"level",minzoom:17,layout:{textField:["{name}"],iconImage:"{class}",textSize:{stops:[[17,10],[19,12]]},iconSize:{stops:[[17,12],[19,15]]},iconTextGap:2,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#4a4a4a",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:.32}},{id:"indoor-name",type:"symbol",source:"indoor","source-layer":"area_name",splitBy:"level",minzoom:17,layout:{textField:["{name}"],textSize:{stops:[[17,10.5],[19,12.5]]},maxLineChars:8},paint:{color:"#3c3830",haloColor:"#ffffff",haloWidth:1.4}},{id:"building-entrance",type:"symbol",source:"points","source-layer":"entrances",minzoom:17,layout:{iconImage:"entrance",showFor:"highlight",textField:["{ref}"],textSize:{stops:[[17,10],[19,12.5]]},allowOverlap:true,priority:40,iconRotate:"angle",placement:"map",arrowLength:{stops:[[17,22],[18,32],[19,40],[20,48],[22,56]]},arrowWidth:{stops:[[17,6],[18,8.5],[19,10.5],[20,12.5],[22,15]]},arrowOutline:{stops:[[17,1.4],[18,2],[19,2.5],[20,3],[22,3.5]]},arrowGap:{stops:[[17,14],[18,19],[19,23],[20,27],[22,31]]},arrowUnits:"pixels",iconTextGap:3,arrowDotRadius:{stops:[[17,2.2],[18,3.2],[19,4],[20,4.8],[22,5.6]]},arrowDotGap:{stops:[[17,5],[18,7],[19,9],[20,11],[22,12.5]]}},paint:{color:"#2d6ecb",haloColor:"#ffffff",haloWidth:1.6}}],sources:{indoor:{url:"/tileserver/data/indoor/{z}/{x}/{y}.pbf",minzoom:15,maxzoom:18},points:{url:"/tileserver/data/points/{z}/{x}/{y}.pbf",minzoom:13,maxzoom:16},closures:{url:"/tileserver/data/closures/{z}/{x}/{y}.pbf",minzoom:10,maxzoom:16}}};var yi={name:"\u041D\u043E\u0447\u043D\u0430\u044F",background:"#11151c",model3dKey:"night",light:{ambientColor:"#8fa3c4",ambientIntensity:.34,keyAzimuth:120,keyAltitude:55,keyColor:"#cfd8ea",keyIntensity:.3,fillAzimuth:300,fillAltitude:20,fillColor:"#4a5f86",fillIntensity:.22},paint:{"landcover-wood":{color:"#16261a"},"landcover-grass":{color:"#182619"},"landcover-sand":{color:"#2a2417"},"landcover-ice":{color:"#1b2730"},"landcover-wetland":{color:"#16242a"},"landuse-residential":{color:"#171b23"},"landuse-industrial":{color:"#1b1c20"},"landuse-civic":{color:"#1c1f28"},"landuse-sport":{color:"#16261c"},"landuse-cemetery":{color:"#182018"},"landuse-parking":{color:"#191d24"},park:{color:"#15271a"},"aeroway-area":{color:"#1b1e26"},water:{color:"#0f2438"},"water-pool":{color:"#123048"},waterway:{color:"#14304a"},"aeroway-line":{color:"#242833"},"road-casing-major":{color:"#2a2519"},"road-casing-secondary":{color:{stops:[[16,"#22262f"],[18.5,"#2a2519"]]}},"road-casing-minor":{color:{stops:[[16,"#1e222a"],[18.5,"#2a2519"]]}},"road-rail":{color:"#333842"},"road-path":{color:"#2a2e36"},"road-minor":{color:{stops:[[16,"#2f343d"],[18.5,"#6b5c3c"]]}},"road-secondary":{color:{stops:[[16,"#3c424d"],[18.5,"#6b5c3c"]]}},"road-ramp":{color:"#6b5c3c"},"road-major":{color:"#6b5c3c"},boundary:{color:"#4a3f52"},building:{color:"#232833",roofColor:"#2b313d",aoStrength:.3,tintVariation:.1,windowColor:"#8fb8e8",windowFrameColor:"#39424f",windowGlow:.35},housenumber:{color:"#5f6672",haloColor:"#12161d"},poi:{color:"#c3ccd9",haloColor:"#12161d",haloWidth:1.3},"road-label":{color:"#a8b0bd",haloColor:"#12161d",haloWidth:1.5},"water-label":{color:"#6ea2c7",haloColor:"#0e1b28"},"place-label":{color:"#e2e7ee",haloColor:"#10141b",haloWidth:2},"poi-food":{color:"#d89964",haloColor:"#12161d",haloWidth:1.3,frameColor:"#d89964",frameOpacity:1,frameHaloColor:"#12161d",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-shop":{color:"#699cd4",haloColor:"#12161d",haloWidth:1.3,frameColor:"#699cd4",frameOpacity:1,frameHaloColor:"#12161d",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-transport":{color:"#75acc8",haloColor:"#12161d",haloWidth:1.3,frameColor:"#75acc8",frameOpacity:1,frameHaloColor:"#12161d",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-health":{color:"#ca7272",haloColor:"#12161d",haloWidth:1.3,frameColor:"#ca7272",frameOpacity:1,frameHaloColor:"#12161d",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-education":{color:"#81bbb7",haloColor:"#12161d",haloWidth:1.3,frameColor:"#81bbb7",frameOpacity:1,frameHaloColor:"#12161d",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-culture":{color:"#a684b8",haloColor:"#12161d",haloWidth:1.3,frameColor:"#a684b8",frameOpacity:1,frameHaloColor:"#12161d",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-sport":{color:"#89bb81",haloColor:"#12161d",haloWidth:1.3,frameColor:"#89bb81",frameOpacity:1,frameHaloColor:"#12161d",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-lodging":{color:"#8e79c3",haloColor:"#12161d",haloWidth:1.3,frameColor:"#8e79c3",frameOpacity:1,frameHaloColor:"#12161d",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-service":{color:"#959ea7",haloColor:"#12161d",haloWidth:1.3,frameColor:"#959ea7",frameOpacity:1,frameHaloColor:"#12161d",iconColor:"#1b1b1b",iconHaloWidth:0},"building-entrance":{color:"#79a0d7",haloColor:"#12161d"},"indoor-shell":{color:"#3a4254",opacity:.97},"indoor-corridor":{color:"#363d4e"},"indoor-room":{color:"#414a5f"},"indoor-service":{color:"#535f79"},"indoor-shop":{color:"#5c4672"},"indoor-food":{color:"#725d46"},"indoor-wc":{color:"#466172"},"indoor-wall":{color:"#697183",roofColor:"#868c99",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#65548a",opacity:.95},"indoor-door":{color:"#c3ccd9",haloColor:"#12161d",haloWidth:1.3},"indoor-poi":{color:"#c3ccd9",haloColor:"#12161d",haloWidth:1.3},"indoor-name":{color:"#e2e7ee",haloColor:"#10141b",haloWidth:2}},sky:{skyColor:"#080d18",horizonColor:"#1b2436",fogRange:[1.3,6.5],fogIntensity:.9,spaceColor:"#02030a",atmosphereColor:"#3f6fa8",starIntensity:.8}};var gi={name:"\u0413\u0440\u0430\u0444\u0438\u0442",background:"#eeeeee",light:{ambientColor:"#ffffff",ambientIntensity:.55,keyAzimuth:120,keyAltitude:60,keyColor:"#ffffff",keyIntensity:.5,fillAzimuth:300,fillAltitude:25,fillColor:"#ffffff",fillIntensity:.16},paint:{"landcover-wood":{color:"#e2e2e2"},"landcover-grass":{color:"#e7e7e7"},"landcover-sand":{color:"#eaeaea"},"landcover-ice":{color:"#f0f0f0"},"landcover-wetland":{color:"#e4e4e4"},"landuse-residential":{color:"#e9e9e9"},"landuse-industrial":{color:"#e5e5e5"},"landuse-civic":{color:"#ebebeb"},"landuse-sport":{color:"#e4e4e4"},"landuse-cemetery":{color:"#e6e6e6"},"landuse-parking":{color:"#ececec"},park:{color:"#e3e3e3"},"aeroway-area":{color:"#e8e8e8"},water:{color:"#d4d4d4"},"water-pool":{color:"#d8d8d8"},waterway:{color:"#d4d4d4"},"aeroway-line":{color:"#dedede"},"road-casing-major":{color:"#c9c9c9"},"road-casing-secondary":{color:{stops:[[16,"#d2d2d2"],[18.5,"#c9c9c9"]]}},"road-casing-minor":{color:{stops:[[16,"#d8d8d8"],[18.5,"#c9c9c9"]]}},"road-rail":{color:"#c2c2c2"},"road-path":{color:"#d0d0d0"},"road-minor":{color:{stops:[[16,"#f7f7f7"],[18.5,"#ffffff"]]}},"road-secondary":{color:{stops:[[16,"#fbfbfb"],[18.5,"#ffffff"]]}},"road-ramp":{color:"#ffffff"},"road-major":{color:"#ffffff"},boundary:{color:"#b0b0b0"},building:{color:"#dcdcdc",roofColor:"#e0e0e0",aoStrength:.22,tintVariation:.05,windowColor:"#b7bcc2",windowFrameColor:"#f2f2f2",windowGlow:0},housenumber:{color:"#9a9a9a",haloColor:"#f4f4f4"},poi:{color:"#3c3c3c",haloColor:"#ffffff"},"road-label":{color:"#585858",haloColor:"#ffffff"},"water-label":{color:"#6e6e6e",haloColor:"#ffffff"},"place-label":{color:"#2a2a2a",haloColor:"#ffffff"},"poi-food":{color:"#3c3c3c",haloColor:"#ffffff",frameColor:"#3c3c3c",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{color:"#3c3c3c",haloColor:"#ffffff",frameColor:"#3c3c3c",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{color:"#3c3c3c",haloColor:"#ffffff",frameColor:"#3c3c3c",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{color:"#3c3c3c",haloColor:"#ffffff",frameColor:"#3c3c3c",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{color:"#3c3c3c",haloColor:"#ffffff",frameColor:"#3c3c3c",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{color:"#3c3c3c",haloColor:"#ffffff",frameColor:"#3c3c3c",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{color:"#3c3c3c",haloColor:"#ffffff",frameColor:"#3c3c3c",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{color:"#3c3c3c",haloColor:"#ffffff",frameColor:"#3c3c3c",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{color:"#3c3c3c",haloColor:"#ffffff",frameColor:"#3c3c3c",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"building-entrance":{color:"#564e4e",haloColor:"#ffffff"},"indoor-shell":{color:"#e9e9e9",opacity:.97},"indoor-corridor":{color:"#eeeeee"},"indoor-room":{color:"#e2e2e2"},"indoor-service":{color:"#cecece"},"indoor-shop":{color:"#d7cfdf"},"indoor-food":{color:"#dfd7cf"},"indoor-wc":{color:"#cfd9df"},"indoor-wall":{color:"#c0c0c0",roofColor:"#d4d4d4",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#c2bbd1",opacity:.95},"indoor-door":{color:"#3c3c3c",haloColor:"#ffffff"},"indoor-poi":{color:"#3c3c3c",haloColor:"#ffffff"},"indoor-name":{color:"#2a2a2a",haloColor:"#ffffff"}},sky:{skyColor:"#8f96a0",horizonColor:"#d7dade",fogRange:[1.35,7.5],fogIntensity:.9,spaceColor:"#07080b",atmosphereColor:"#9aa3ad",starIntensity:.5}};var vi={name:"\u0411\u043B\u0435\u0434\u043D\u0430\u044F",background:"#f7f6f3",light:{ambientColor:"#ffffff",ambientIntensity:.62,keyAzimuth:120,keyAltitude:65,keyColor:"#fffaf0",keyIntensity:.38,fillAzimuth:300,fillAltitude:25,fillColor:"#eef2f8",fillIntensity:.14},paint:{"landcover-wood":{color:"#e8efe2"},"landcover-grass":{color:"#edf2e6"},"landcover-sand":{color:"#f4eede"},"landcover-ice":{color:"#f0f5f7"},"landcover-wetland":{color:"#e8f0ec"},"landuse-residential":{color:"#f2f0ec"},"landuse-industrial":{color:"#f0edeb"},"landuse-civic":{color:"#f4efe9"},"landuse-sport":{color:"#e9f1e4"},"landuse-cemetery":{color:"#ecefe6"},"landuse-parking":{color:"#f3f1ed"},park:{color:"#e7f0df"},"aeroway-area":{color:"#f0f0f2"},water:{color:"#dce9f2"},"water-pool":{color:"#dcecf5"},waterway:{color:"#dce9f2"},"aeroway-line":{color:"#ebebee"},"road-casing-major":{color:"#efe4d2"},"road-casing-secondary":{color:{stops:[[16,"#eceae2"],[18.5,"#efe4d2"]]}},"road-casing-minor":{color:{stops:[[16,"#efedE6"],[18.5,"#efe4d2"]]}},"road-rail":{color:"#e0dcd6"},"road-path":{color:"#e6e2da"},"road-minor":{color:{stops:[[16,"#fdfcfa"],[18.5,"#fff8e8"]]}},"road-secondary":{color:{stops:[[16,"#ffffff"],[18.5,"#fff8e8"]]}},"road-ramp":{color:"#fff8e8"},"road-major":{color:"#fff8e8"},boundary:{color:"#cfc3d2"},building:{color:"#eae7e0",roofColor:"#ecE9e2",aoStrength:.14,tintVariation:.04,windowColor:"#c7d6e4",windowFrameColor:"#f6f7f9",windowGlow:0},housenumber:{color:"#a9a296",haloColor:"#fbfaf7"},poi:{color:"#6b6b6b",haloColor:"#ffffff"},"road-label":{color:"#8a8474",haloColor:"#ffffff"},"water-label":{color:"#7ea8c4",haloColor:"#ffffff"},"place-label":{color:"#55524c",haloColor:"#ffffff"},"poi-food":{color:"#6b6b6b",haloColor:"#ffffff",frameColor:"#6b6b6b",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{color:"#6b6b6b",haloColor:"#ffffff",frameColor:"#6b6b6b",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{color:"#6b6b6b",haloColor:"#ffffff",frameColor:"#6b6b6b",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{color:"#6b6b6b",haloColor:"#ffffff",frameColor:"#6b6b6b",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{color:"#6b6b6b",haloColor:"#ffffff",frameColor:"#6b6b6b",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{color:"#6b6b6b",haloColor:"#ffffff",frameColor:"#6b6b6b",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{color:"#6b6b6b",haloColor:"#ffffff",frameColor:"#6b6b6b",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{color:"#6b6b6b",haloColor:"#ffffff",frameColor:"#6b6b6b",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{color:"#6b6b6b",haloColor:"#ffffff",frameColor:"#6b6b6b",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"building-entrance":{color:"#564e4e",haloColor:"#ffffff"},"indoor-shell":{color:"#f4f3f0",opacity:.97},"indoor-corridor":{color:"#f8f7f6"},"indoor-room":{color:"#edece8"},"indoor-service":{color:"#dcd9d1"},"indoor-shop":{color:"#e0dae6"},"indoor-food":{color:"#e6e0da"},"indoor-wc":{color:"#dae1e6"},"indoor-wall":{color:"#cdcbc4",roofColor:"#e0dedb",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#ccc5d9",opacity:.95},"indoor-door":{color:"#6b6b6b",haloColor:"#ffffff"},"indoor-poi":{color:"#6b6b6b",haloColor:"#ffffff"},"indoor-name":{color:"#55524c",haloColor:"#ffffff"}},sky:{skyColor:"#c8dbee",horizonColor:"#eef2f6",fogRange:[1.4,9],fogIntensity:.85,spaceColor:"#0a1018",atmosphereColor:"#9fd0ff",starIntensity:.45}};var wi={name:"\u041E\u0431\u044A\u0451\u043C\u043D\u0430\u044F",background:"#f0ecea",light:{ambientColor:"#f8f8f8",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#ffffff",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#dee8ed",fillIntensity:.18},paint:{"landcover-wood":{color:"#9bda95"},"landcover-grass":{color:"#b2e6a8"},"landcover-sand":{color:"#efeac8"},"landcover-ice":{color:"#d5e8f1"},"landcover-wetland":{color:"#badbde"},"landuse-residential":{color:"#f4f2f1"},"landuse-industrial":{color:"#dadce7"},"landuse-civic":{color:"#ecdae0"},"landuse-sport":{color:"#bbeba2"},"landuse-cemetery":{color:"#c2e2bb"},"landuse-parking":{color:"#e0dddc"},park:{color:"#b2e6a8"},"aeroway-area":{color:"#d6dbeb"},water:{color:"#94d8f9"},waterway:{color:"#94d8f9"},"aeroway-line":{color:"#f0ede9"},"road-casing-major":{color:"#8997b3"},"road-casing-secondary":{color:{stops:[[16,"#9da7be"],[18.5,"#8997b3"]]}},"road-casing-minor":{color:{stops:[[16,"#9da7be"],[18.5,"#8997b3"]]}},"road-rail":{color:"#9e9e9e"},"road-path":{color:"#bbc1d3"},"road-minor":{color:{stops:[[16,"#bbc1d3"],[18.5,"#99abc2"]]}},"road-secondary":{color:{stops:[[16,"#bbc1d3"],[18.5,"#99abc2"]]}},"road-ramp":{color:"#99abc2"},"road-major":{color:"#99abc2"},boundary:{color:"#f66f91"},building:{color:"#ede7de",roofColor:"#ede7de",aoStrength:.19,tintVariation:.06,windowColor:"#6b9ed1",windowFrameColor:"#eef0f4",windowGlow:0},housenumber:{color:"#2e2e2e",haloColor:"#ffffff",haloWidth:1.4},poi:{color:"#586e84",haloColor:"#ffffff",haloWidth:1.4},"road-label":{color:"#2e2e2e",haloColor:"#ffffff",haloWidth:1.4},"water-label":{color:"#35688d",haloColor:"#f7f7f7",haloWidth:1.4},"place-label":{color:"#2e2e2e",haloColor:"#ffffff",haloWidth:1.4},"poi-food":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#c2681c",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#2f77c4",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#3b82a6",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#c24444",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#3f7f7a",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#8b5aa5",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#4f8b45",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#7a5fbf",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#59636e",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"water-pool":{color:"#a7e1fd"},"indoor-shell":{color:"#f4f3f1",opacity:.97},"indoor-corridor":{color:"#f8f8f6"},"indoor-room":{color:"#eeece8"},"indoor-service":{color:"#ddd8d2"},"indoor-shop":{color:"#e0dae7"},"indoor-food":{color:"#e7e1da"},"indoor-wc":{color:"#dae2e7"},"indoor-wall":{color:"#cecac5",roofColor:"#e0dedc",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#ccc6d9",opacity:.95},"indoor-door":{color:"#586e84",haloColor:"#ffffff",haloWidth:1.4},"indoor-poi":{color:"#586e84",haloColor:"#ffffff",haloWidth:1.4},"indoor-name":{color:"#2e2e2e",haloColor:"#ffffff",haloWidth:1.4},"building-entrance":{color:"#225aaa",haloColor:"#ffffff"}},sky:{skyColor:"#91b8cb",horizonColor:"#dfd9d6",fogRange:[1.34,7.36],fogIntensity:.86,spaceColor:"#0e0b0a",atmosphereColor:"#5daad0",starIntensity:.38}};var xi={name:"\u041C\u0443\u043B\u044C\u0442\u044F\u0448\u043D\u0430\u044F",background:"#f7f3de",light:{ambientColor:"#f8f7f7",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#ffffff",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#dee8ed",fillIntensity:.18},paint:{"landcover-wood":{color:"#61d161"},"landcover-grass":{color:"#91e481"},"landcover-sand":{color:"#efeac8"},"landcover-ice":{color:"#c7dfeb"},"landcover-wetland":{color:"#9fccd1"},"landuse-residential":{color:"#f2ecd9"},"landuse-industrial":{color:"#d7d9e4"},"landuse-civic":{color:"#ead7dd"},"landuse-sport":{color:"#9fec79"},"landuse-cemetery":{color:"#a8d69f"},"landuse-parking":{color:"#dddcda"},park:{color:"#91e481"},"aeroway-area":{color:"#d6dbeb"},water:{color:"#71c8f4"},waterway:{color:"#71c8f4"},"aeroway-line":{color:"#f0ede9"},"road-casing-major":{color:"#ca6a16"},"road-casing-secondary":{color:{stops:[[16,"#5a6faf"],[18.5,"#ca6a16"]]}},"road-casing-minor":{color:{stops:[[16,"#5a6faf"],[18.5,"#ca6a16"]]}},"road-rail":{color:"#737373"},"road-path":{color:"#ffffff"},"road-minor":{color:{stops:[[16,"#ffffff"],[18.5,"#f8c662"]]}},"road-secondary":{color:{stops:[[16,"#ffffff"],[18.5,"#f8c662"]]}},"road-ramp":{color:"#f8c662"},"road-major":{color:"#f8c662"},boundary:{color:"#f6517a"},building:{color:"#f4dfc2",roofColor:"#f4dfc2",aoStrength:.19,tintVariation:.06,windowColor:"#5b9ee0",windowFrameColor:"#ffffff",windowGlow:0},housenumber:{color:"#222b59",haloColor:"#ffffff",haloWidth:1.4},poi:{color:"#f05a0f",haloColor:"#ffffff",haloWidth:1.4},"road-label":{color:"#222b59",haloColor:"#ffffff",haloWidth:1.4},"water-label":{color:"#35688d",haloColor:"#f7f7f7",haloWidth:1.4},"place-label":{color:"#222b59",haloColor:"#ffffff",haloWidth:1.4},"poi-food":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#c2681c",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#2f77c4",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#3b82a6",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#c24444",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#3f7f7a",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#8b5aa5",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#4f8b45",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#7a5fbf",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#59636e",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"water-pool":{color:"#80d1fa"},"indoor-shell":{color:"#ebe9e5",opacity:.97},"indoor-corridor":{color:"#efedea"},"indoor-room":{color:"#e5e1dc"},"indoor-service":{color:"#d4cec6"},"indoor-shop":{color:"#d6cede"},"indoor-food":{color:"#ded6ce"},"indoor-wc":{color:"#ced8de"},"indoor-wall":{color:"#c4c0ba",roofColor:"#d6d4d0",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#c1b9d1",opacity:.95},"indoor-door":{color:"#f05a0f",haloColor:"#ffffff",haloWidth:1.4},"indoor-poi":{color:"#f05a0f",haloColor:"#ffffff",haloWidth:1.4},"indoor-name":{color:"#222b59",haloColor:"#ffffff",haloWidth:1.4},"building-entrance":{color:"#225aaa",haloColor:"#ffffff"}},sky:{skyColor:"#8cb5c9",horizonColor:"#e8e2c7",fogRange:[1.34,7.35],fogIntensity:.86,spaceColor:"#131105",atmosphereColor:"#5ca9d0",starIntensity:.39}};var _i={name:"\u041A\u0438\u0431\u0435\u0440\u043F\u0430\u043D\u043A",background:"#120817",model3dKey:"night",light:{ambientColor:"#b279cf",ambientIntensity:.34,keyAzimuth:120,keyAltitude:55,keyColor:"#ff70d0",keyIntensity:.28,fillAzimuth:300,fillAltitude:25,fillColor:"#854770",fillIntensity:.22},paint:{"landcover-wood":{color:"#0c3728"},"landcover-grass":{color:"#104131"},"landcover-sand":{color:"#262417"},"landcover-ice":{color:"#74345f"},"landcover-wetland":{color:"#152223"},"landuse-residential":{color:"#170b1e"},"landuse-industrial":{color:"#171921"},"landuse-civic":{color:"#21171a"},"landuse-sport":{color:"#0c4529"},"landuse-cemetery":{color:"#151e1b"},"landuse-parking":{color:"#272428"},park:{color:"#104131"},"aeroway-area":{color:"#1a1c23"},water:{color:"#5f1145"},waterway:{color:"#711452"},"aeroway-line":{color:"#55493a"},"road-casing-major":{color:"#981662"},"road-casing-secondary":{color:{stops:[[16,"#6a1b6a"],[18.5,"#981662"]]}},"road-casing-minor":{color:{stops:[[16,"#6a1b6a"],[18.5,"#981662"]]}},"road-rail":{color:"#39acac"},"road-path":{color:"#12e2e2"},"road-minor":{color:{stops:[[16,"#12e2e2"],[18.5,"#f631a4"]]}},"road-secondary":{color:{stops:[[16,"#12e2e2"],[18.5,"#f631a4"]]}},"road-ramp":{color:"#f631a4"},"road-major":{color:"#f631a4"},boundary:{color:"#f53da8"},building:{color:"#311839",roofColor:"#9d2575",aoStrength:.29,tintVariation:.1,windowColor:"#84dcff",windowFrameColor:"#84dcff",windowGlow:.5},housenumber:{color:"#acf6f6",haloColor:"#110514",haloWidth:1.4},poi:{color:"#f6e95a",haloColor:"#110514",haloWidth:1.4},"road-label":{color:"#acf6f6",haloColor:"#110514",haloWidth:1.4},"water-label":{color:"#9fbcd1",haloColor:"#131b20",haloWidth:1.4},"place-label":{color:"#acf6f6",haloColor:"#110514",haloWidth:1.4},"poi-food":{color:"#d89964",haloColor:"#110514",haloWidth:1.4,frameColor:"#d89964",frameOpacity:1,frameHaloColor:"#110514",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-shop":{color:"#699cd4",haloColor:"#110514",haloWidth:1.4,frameColor:"#699cd4",frameOpacity:1,frameHaloColor:"#110514",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-transport":{color:"#75acc8",haloColor:"#110514",haloWidth:1.4,frameColor:"#75acc8",frameOpacity:1,frameHaloColor:"#110514",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-health":{color:"#ca7272",haloColor:"#110514",haloWidth:1.4,frameColor:"#ca7272",frameOpacity:1,frameHaloColor:"#110514",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-education":{color:"#81bbb7",haloColor:"#110514",haloWidth:1.4,frameColor:"#81bbb7",frameOpacity:1,frameHaloColor:"#110514",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-culture":{color:"#a684b8",haloColor:"#110514",haloWidth:1.4,frameColor:"#a684b8",frameOpacity:1,frameHaloColor:"#110514",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-sport":{color:"#89bb81",haloColor:"#110514",haloWidth:1.4,frameColor:"#89bb81",frameOpacity:1,frameHaloColor:"#110514",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-lodging":{color:"#8e79c3",haloColor:"#110514",haloWidth:1.4,frameColor:"#8e79c3",frameOpacity:1,frameHaloColor:"#110514",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-service":{color:"#959ea7",haloColor:"#110514",haloWidth:1.4,frameColor:"#959ea7",frameOpacity:1,frameHaloColor:"#110514",iconColor:"#1b1b1b",iconHaloWidth:0},"water-pool":{color:"#84135f"},"indoor-shell":{color:"#4c3752",opacity:.97},"indoor-corridor":{color:"#46334c"},"indoor-room":{color:"#553e5d"},"indoor-service":{color:"#6e5078"},"indoor-shop":{color:"#59446f"},"indoor-food":{color:"#6f5a44"},"indoor-wc":{color:"#445e6f"},"indoor-wall":{color:"#7b6681",roofColor:"#938298",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#635287",opacity:.95},"indoor-door":{color:"#f6e95a",haloColor:"#110514",haloWidth:1.4},"indoor-poi":{color:"#f6e95a",haloColor:"#110514",haloWidth:1.4},"indoor-name":{color:"#acf6f6",haloColor:"#110514",haloWidth:1.4},"building-entrance":{color:"#79a0d7",haloColor:"#110514"}},sky:{skyColor:"#180813",horizonColor:"#281831",fogRange:[1.3,6.5],fogIntensity:.9,spaceColor:"#060308",atmosphereColor:"#b5358b",starIntensity:.82}};var Ci={name:"\u0420\u0430\u0441\u0441\u0432\u0435\u0442",background:"#f4ebe1",light:{ambientColor:"#f8f7f7",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#ffe0c0",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#dee7ed",fillIntensity:.18},paint:{"landcover-wood":{color:"#a4db9f"},"landcover-grass":{color:"#bae7b1"},"landcover-sand":{color:"#efeac8"},"landcover-ice":{color:"#dbe7f0"},"landcover-wetland":{color:"#c1dee1"},"landuse-residential":{color:"#f5efeb"},"landuse-industrial":{color:"#d7d9e4"},"landuse-civic":{color:"#ead7dd"},"landuse-sport":{color:"#c1ecac"},"landuse-cemetery":{color:"#c8e5c2"},"landuse-parking":{color:"#dddbda"},park:{color:"#bae7b1"},"aeroway-area":{color:"#d6dbeb"},water:{color:"#a6d2f2"},waterway:{color:"#a6d2f2"},"aeroway-line":{color:"#f0ede9"},"road-casing-major":{color:"#92a1bf"},"road-casing-secondary":{color:{stops:[[16,"#a6afc9"],[18.5,"#92a1bf"]]}},"road-casing-minor":{color:{stops:[[16,"#a6afc9"],[18.5,"#92a1bf"]]}},"road-rail":{color:"#b5a49b"},"road-path":{color:"#c3c9df"},"road-minor":{color:{stops:[[16,"#c3c9df"],[18.5,"#a9b9d1"]]}},"road-secondary":{color:{stops:[[16,"#c3c9df"],[18.5,"#a9b9d1"]]}},"road-ramp":{color:"#a9b9d1"},"road-major":{color:"#a9b9d1"},boundary:{color:"#f584a1"},building:{color:"#f6ebdf",roofColor:"#fdede7",aoStrength:.19,tintVariation:.06,windowColor:"#6b9ed1",windowFrameColor:"#f0ece8",windowGlow:0},housenumber:{color:"#46332a",haloColor:"#fdfaf7",haloWidth:1.4},poi:{color:"#56738f",haloColor:"#fdfaf7",haloWidth:1.4},"road-label":{color:"#46332a",haloColor:"#fdfaf7",haloWidth:1.4},"water-label":{color:"#35688d",haloColor:"#f7f7f7",haloWidth:1.4},"place-label":{color:"#46332a",haloColor:"#fdfaf7",haloWidth:1.4},"poi-food":{haloColor:"#fdfaf7",haloWidth:1.4,frameColor:"#c2681c",frameOpacity:1,frameHaloColor:"#fdfaf7",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{haloColor:"#fdfaf7",haloWidth:1.4,frameColor:"#2f77c4",frameOpacity:1,frameHaloColor:"#fdfaf7",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{haloColor:"#fdfaf7",haloWidth:1.4,frameColor:"#3b82a6",frameOpacity:1,frameHaloColor:"#fdfaf7",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{haloColor:"#fdfaf7",haloWidth:1.4,frameColor:"#c24444",frameOpacity:1,frameHaloColor:"#fdfaf7",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{haloColor:"#fdfaf7",haloWidth:1.4,frameColor:"#3f7f7a",frameOpacity:1,frameHaloColor:"#fdfaf7",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{haloColor:"#fdfaf7",haloWidth:1.4,frameColor:"#8b5aa5",frameOpacity:1,frameHaloColor:"#fdfaf7",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{haloColor:"#fdfaf7",haloWidth:1.4,frameColor:"#4f8b45",frameOpacity:1,frameHaloColor:"#fdfaf7",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{haloColor:"#fdfaf7",haloWidth:1.4,frameColor:"#7a5fbf",frameOpacity:1,frameHaloColor:"#fdfaf7",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{haloColor:"#fdfaf7",haloWidth:1.4,frameColor:"#59636e",frameOpacity:1,frameHaloColor:"#fdfaf7",iconColor:"#ffffff",iconHaloWidth:0},"water-pool":{color:"#b9ddf7"},"indoor-shell":{color:"#f8f7f5",opacity:.97},"indoor-corridor":{color:"#fcfbfb"},"indoor-room":{color:"#f1efed"},"indoor-service":{color:"#e0dbd6"},"indoor-shop":{color:"#e4dfea"},"indoor-food":{color:"#eae4df"},"indoor-wc":{color:"#dfe5ea"},"indoor-wall":{color:"#d1cdc9",roofColor:"#e4e2e0",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#d0cbdc",opacity:.95},"indoor-door":{color:"#56738f",haloColor:"#fdfaf7",haloWidth:1.4},"indoor-poi":{color:"#56738f",haloColor:"#fdfaf7",haloWidth:1.4},"indoor-name":{color:"#46332a",haloColor:"#fdfaf7",haloWidth:1.4},"building-entrance":{color:"#225aaa",haloColor:"#fdfaf7"}},sky:{skyColor:"#8cb0c9",horizonColor:"#e4d7cb",fogRange:[1.34,7.35],fogIntensity:.86,spaceColor:"#120c07",atmosphereColor:"#5c9fd0",starIntensity:.39}};var Si={name:"\u0421\u0443\u043C\u0435\u0440\u043A\u0438",background:"#d7cbc1",light:{ambientColor:"#ececeb",ambientIntensity:.46,keyAzimuth:120,keyAltitude:59,keyColor:"#ffcaa0",keyIntensity:.56,fillAzimuth:300,fillAltitude:25,fillColor:"#c7d0e1",fillIntensity:.19},paint:{"landcover-wood":{color:"#75af6a"},"landcover-grass":{color:"#94bd7f"},"landcover-sand":{color:"#efeac8"},"landcover-ice":{color:"#c1c8d7"},"landcover-wetland":{color:"#83bec3"},"landuse-residential":{color:"#d5cac3"},"landuse-industrial":{color:"#b3b7cc"},"landuse-civic":{color:"#d5aebb"},"landuse-sport":{color:"#91c775"},"landuse-cemetery":{color:"#9ac982"},"landuse-parking":{color:"#c0bcb9"},park:{color:"#94bd7f"},"aeroway-area":{color:"#d6dbeb"},water:{color:"#708bc2"},waterway:{color:"#708bc2"},"aeroway-line":{color:"#f0ede9"},"road-casing-major":{color:"#6a5b9a"},"road-casing-secondary":{color:{stops:[[16,"#7078a4"],[18.5,"#6a5b9a"]]}},"road-casing-minor":{color:{stops:[[16,"#7078a4"],[18.5,"#6a5b9a"]]}},"road-rail":{color:"#93796c"},"road-path":{color:"#8f94b7"},"road-minor":{color:{stops:[[16,"#8f94b7"],[18.5,"#8576b2"]]}},"road-secondary":{color:{stops:[[16,"#8f94b7"],[18.5,"#8576b2"]]}},"road-ramp":{color:"#8576b2"},"road-major":{color:"#8576b2"},boundary:{color:"#e05275"},building:{color:"#e0d1c2",roofColor:"#f1d6cb",aoStrength:.2,tintVariation:.07,windowColor:"#6b9ed1",windowFrameColor:"#efe6df",windowGlow:0},housenumber:{color:"#2c283e",haloColor:"#f5ebe0",haloWidth:1.4},poi:{color:"#64568f",haloColor:"#f5ebe0",haloWidth:1.4},"road-label":{color:"#2c283e",haloColor:"#f5ebe0",haloWidth:1.4},"water-label":{color:"#35688d",haloColor:"#f7f7f7",haloWidth:1.4},"place-label":{color:"#2c283e",haloColor:"#f5ebe0",haloWidth:1.4},"poi-food":{haloColor:"#f5ebe0",haloWidth:1.4,frameColor:"#c2681c",frameOpacity:1,frameHaloColor:"#f5ebe0",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{haloColor:"#f5ebe0",haloWidth:1.4,frameColor:"#2f77c4",frameOpacity:1,frameHaloColor:"#f5ebe0",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{haloColor:"#f5ebe0",haloWidth:1.4,frameColor:"#3b82a6",frameOpacity:1,frameHaloColor:"#f5ebe0",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{haloColor:"#f5ebe0",haloWidth:1.4,frameColor:"#c24444",frameOpacity:1,frameHaloColor:"#f5ebe0",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{haloColor:"#f5ebe0",haloWidth:1.4,frameColor:"#3f7f7a",frameOpacity:1,frameHaloColor:"#f5ebe0",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{haloColor:"#f5ebe0",haloWidth:1.4,frameColor:"#8b5aa5",frameOpacity:1,frameHaloColor:"#f5ebe0",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{haloColor:"#f5ebe0",haloWidth:1.4,frameColor:"#4f8b45",frameOpacity:1,frameHaloColor:"#f5ebe0",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{haloColor:"#f5ebe0",haloWidth:1.4,frameColor:"#7a5fbf",frameOpacity:1,frameHaloColor:"#f5ebe0",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{haloColor:"#f5ebe0",haloWidth:1.4,frameColor:"#59636e",frameOpacity:1,frameHaloColor:"#f5ebe0",iconColor:"#ffffff",iconHaloWidth:0},"water-pool":{color:"#7a94ca"},"indoor-shell":{color:"#e3deda",opacity:.97},"indoor-corridor":{color:"#e7e3df"},"indoor-room":{color:"#dcd7d1"},"indoor-service":{color:"#cbc3ba"},"indoor-shop":{color:"#ccc2d6"},"indoor-food":{color:"#d6ccc2"},"indoor-wc":{color:"#c2ced6"},"indoor-wall":{color:"#bbb5af",roofColor:"#cdc9c6",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#b6adc9",opacity:.95},"indoor-door":{color:"#64568f",haloColor:"#f5ebe0",haloWidth:1.4},"indoor-poi":{color:"#64568f",haloColor:"#f5ebe0",haloWidth:1.4},"indoor-name":{color:"#2c283e",haloColor:"#f5ebe0",haloWidth:1.4},"building-entrance":{haloColor:"#f5ebe0"}},sky:{skyColor:"#5675b3",horizonColor:"#c0b4aa",fogRange:[1.33,7.14],fogIntensity:.87,spaceColor:"#0e0b09",atmosphereColor:"#557dce",starIntensity:.45}};var Mi={name:"\u0417\u0435\u043C\u043B\u044F",background:"#dbd1bd",light:{ambientColor:"#edecea",ambientIntensity:.46,keyAzimuth:120,keyAltitude:59,keyColor:"#fff2dc",keyIntensity:.56,fillAzimuth:300,fillAltitude:25,fillColor:"#c7d6e1",fillIntensity:.19},paint:{"landcover-wood":{color:"#50a136"},"landcover-grass":{color:"#8ac76b"},"landcover-sand":{color:"#efeac8"},"landcover-ice":{color:"#aec5d6"},"landcover-wetland":{color:"#7cbac0"},"landuse-residential":{color:"#ded5c4"},"landuse-industrial":{color:"#b3b7cc"},"landuse-civic":{color:"#d5aebb"},"landuse-sport":{color:"#86d161"},"landuse-cemetery":{color:"#94c67b"},"landuse-parking":{color:"#c0beb9"},park:{color:"#8ac76b"},"aeroway-area":{color:"#d6dbeb"},water:{color:"#3b91ce"},waterway:{color:"#4798d1"},"aeroway-line":{color:"#f0ede9"},"road-casing-major":{color:"#a47546"},"road-casing-secondary":{color:{stops:[[16,"#a79376"],[18.5,"#a47546"]]}},"road-casing-minor":{color:{stops:[[16,"#a79376"],[18.5,"#a47546"]]}},"road-rail":{color:"#877564"},"road-path":{color:"#c6bba9"},"road-minor":{color:{stops:[[16,"#c6bba9"],[18.5,"#cdaa7a"]]}},"road-secondary":{color:{stops:[[16,"#c6bba9"],[18.5,"#cdaa7a"]]}},"road-ramp":{color:"#cdaa7a"},"road-major":{color:"#cdaa7a"},boundary:{color:"#bf6a40"},building:{color:"#d4c5af",roofColor:"#d4c5af",aoStrength:.2,tintVariation:.07,windowColor:"#9fb0c0",windowFrameColor:"#eceae4",windowGlow:0},housenumber:{color:"#46382a",haloColor:"#f7f4ee",haloWidth:1.4},poi:{color:"#7c5c3c",haloColor:"#f7f4ee",haloWidth:1.4},"road-label":{color:"#46382a",haloColor:"#f7f4ee",haloWidth:1.4},"water-label":{color:"#35688d",haloColor:"#f7f7f7",haloWidth:1.4},"place-label":{color:"#46382a",haloColor:"#f7f4ee",haloWidth:1.4},"poi-food":{haloColor:"#f7f4ee",haloWidth:1.4,frameColor:"#c2681c",frameOpacity:1,frameHaloColor:"#f7f4ee",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{haloColor:"#f7f4ee",haloWidth:1.4,frameColor:"#2f77c4",frameOpacity:1,frameHaloColor:"#f7f4ee",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{haloColor:"#f7f4ee",haloWidth:1.4,frameColor:"#3b82a6",frameOpacity:1,frameHaloColor:"#f7f4ee",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{haloColor:"#f7f4ee",haloWidth:1.4,frameColor:"#c24444",frameOpacity:1,frameHaloColor:"#f7f4ee",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{haloColor:"#f7f4ee",haloWidth:1.4,frameColor:"#3f7f7a",frameOpacity:1,frameHaloColor:"#f7f4ee",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{haloColor:"#f7f4ee",haloWidth:1.4,frameColor:"#8b5aa5",frameOpacity:1,frameHaloColor:"#f7f4ee",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{haloColor:"#f7f4ee",haloWidth:1.4,frameColor:"#4f8b45",frameOpacity:1,frameHaloColor:"#f7f4ee",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{haloColor:"#f7f4ee",haloWidth:1.4,frameColor:"#7a5fbf",frameOpacity:1,frameHaloColor:"#f7f4ee",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{haloColor:"#f7f4ee",haloWidth:1.4,frameColor:"#59636e",frameOpacity:1,frameHaloColor:"#f7f4ee",iconColor:"#ffffff",iconHaloWidth:0},"water-pool":{color:"#4299d7"},"indoor-shell":{color:"#d6d0c8",opacity:.97},"indoor-corridor":{color:"#d9d5cd"},"indoor-room":{color:"#cfc9bf"},"indoor-service":{color:"#beb5a9"},"indoor-shop":{color:"#bcafca"},"indoor-food":{color:"#cabdaf"},"indoor-wc":{color:"#afbfca"},"indoor-wall":{color:"#ada79e",roofColor:"#bebbb5",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#a69bbc",opacity:.95},"indoor-door":{color:"#7c5c3c",haloColor:"#f7f4ee",haloWidth:1.4},"indoor-poi":{color:"#7c5c3c",haloColor:"#f7f4ee",haloWidth:1.4},"indoor-name":{color:"#46382a",haloColor:"#f7f4ee",haloWidth:1.4},"building-entrance":{haloColor:"#f7f4ee"}},sky:{skyColor:"#568db3",horizonColor:"#c4baa5",fogRange:[1.33,7.14],fogIntensity:.87,spaceColor:"#0f0c08",atmosphereColor:"#559cce",starIntensity:.45}};var Ti={name:"\u0424\u0443\u0442\u0443\u0440\u0438\u0437\u043C",background:"#0c0f1d",model3dKey:"night",light:{ambientColor:"#8590c7",ambientIntensity:.34,keyAzimuth:120,keyAltitude:55,keyColor:"#8ff0ff",keyIntensity:.28,fillAzimuth:300,fillAltitude:25,fillColor:"#477b85",fillIntensity:.22},paint:{"landcover-wood":{color:"#123026"},"landcover-grass":{color:"#18392e"},"landcover-sand":{color:"#2d2a1b"},"landcover-ice":{color:"#276672"},"landcover-wetland":{color:"#192829"},"landuse-residential":{color:"#111422"},"landuse-industrial":{color:"#1b1d27"},"landuse-civic":{color:"#271b1f"},"landuse-sport":{color:"#143d29"},"landuse-cemetery":{color:"#192420"},"landuse-parking":{color:"#292a2e"},park:{color:"#18392e"},"aeroway-area":{color:"#1e2129"},water:{color:"#055261"},waterway:{color:"#076a7e"},"aeroway-line":{color:"#55493a"},"road-casing-major":{color:"#8b238b"},"road-casing-secondary":{color:{stops:[[16,"#185662"],[18.5,"#8b238b"]]}},"road-casing-minor":{color:{stops:[[16,"#185662"],[18.5,"#8b238b"]]}},"road-rail":{color:"#8546a4"},"road-path":{color:"#22b6c3"},"road-minor":{color:{stops:[[16,"#22b6c3"],[18.5,"#e03ee0"]]}},"road-secondary":{color:{stops:[[16,"#22b6c3"],[18.5,"#e03ee0"]]}},"road-ramp":{color:"#e03ee0"},"road-major":{color:"#e03ee0"},boundary:{color:"#eb47eb"},building:{color:"#1e2b3e",roofColor:"#277686",aoStrength:.29,tintVariation:.1,windowColor:"#84dcff",windowFrameColor:"#bfe6ff",windowGlow:.5},housenumber:{color:"#c6edf1",haloColor:"#080a17",haloWidth:1.4},poi:{color:"#eb84eb",haloColor:"#080a17",haloWidth:1.4},"road-label":{color:"#c6edf1",haloColor:"#080a17",haloWidth:1.4},"water-label":{color:"#9fbcd1",haloColor:"#131b20",haloWidth:1.4},"place-label":{color:"#c6edf1",haloColor:"#080a17",haloWidth:1.4},"poi-food":{color:"#d89964",haloColor:"#080a17",haloWidth:1.4,frameColor:"#d89964",frameOpacity:1,frameHaloColor:"#080a17",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-shop":{color:"#699cd4",haloColor:"#080a17",haloWidth:1.4,frameColor:"#699cd4",frameOpacity:1,frameHaloColor:"#080a17",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-transport":{color:"#75acc8",haloColor:"#080a17",haloWidth:1.4,frameColor:"#75acc8",frameOpacity:1,frameHaloColor:"#080a17",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-health":{color:"#ca7272",haloColor:"#080a17",haloWidth:1.4,frameColor:"#ca7272",frameOpacity:1,frameHaloColor:"#080a17",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-education":{color:"#81bbb7",haloColor:"#080a17",haloWidth:1.4,frameColor:"#81bbb7",frameOpacity:1,frameHaloColor:"#080a17",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-culture":{color:"#a684b8",haloColor:"#080a17",haloWidth:1.4,frameColor:"#a684b8",frameOpacity:1,frameHaloColor:"#080a17",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-sport":{color:"#89bb81",haloColor:"#080a17",haloWidth:1.4,frameColor:"#89bb81",frameOpacity:1,frameHaloColor:"#080a17",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-lodging":{color:"#8e79c3",haloColor:"#080a17",haloWidth:1.4,frameColor:"#8e79c3",frameOpacity:1,frameHaloColor:"#080a17",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-service":{color:"#959ea7",haloColor:"#080a17",haloWidth:1.4,frameColor:"#959ea7",frameOpacity:1,frameHaloColor:"#080a17",iconColor:"#1b1b1b",iconHaloWidth:0},"water-pool":{color:"#027288"},"indoor-shell":{color:"#394556",opacity:.97},"indoor-corridor":{color:"#354050"},"indoor-room":{color:"#404d60"},"indoor-service":{color:"#52637b"},"indoor-shop":{color:"#5c4672"},"indoor-food":{color:"#725d46"},"indoor-wc":{color:"#466172"},"indoor-wall":{color:"#687485",roofColor:"#858e9a",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#66558a",opacity:.95},"indoor-door":{color:"#eb84eb",haloColor:"#080a17",haloWidth:1.4},"indoor-poi":{color:"#eb84eb",haloColor:"#080a17",haloWidth:1.4},"indoor-name":{color:"#c6edf1",haloColor:"#080a17",haloWidth:1.4},"building-entrance":{color:"#79a0d7",haloColor:"#080a17"}},sky:{skyColor:"#081619",horizonColor:"#1b1f30",fogRange:[1.3,6.51],fogIntensity:.9,spaceColor:"#030408",atmosphereColor:"#35a1b7",starIntensity:.81}};var ki={name:"\u0421\u0442\u0435\u043A\u043B\u043E \u043C\u044F\u0433\u043A\u043E\u0435",background:"#f2f5f7",light:{ambientColor:"#fbfbfb",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#ffffff",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#dee9ed",fillIntensity:.18},paint:{"landcover-wood":{color:"#bddbc3"},"landcover-grass":{color:"#d0ecda"},"landcover-sand":{color:"#efeac8"},"landcover-ice":{color:"#cbebdb"},"landcover-wetland":{color:"#d9ebed"},"landuse-residential":{color:"#f6f7f9"},"landuse-industrial":{color:"#e3e5ed"},"landuse-civic":{color:"#f1e4e8"},"landuse-sport":{color:"#cdefd4"},"landuse-cemetery":{color:"#dbf0e3"},"landuse-parking":{color:"#e4e6e7"},park:{color:"#ccead9"},"aeroway-area":{color:"#d6dbeb"},water:{color:"#b9e5f4"},waterway:{color:"#81c6e4"},"aeroway-line":{color:"#f0ede9"},"road-casing-major":{color:"#dabc95"},"road-casing-secondary":{color:{stops:[[16,"#d5cdb8"],[18.5,"#dabc95"]]}},"road-casing-minor":{color:{stops:[[16,"#cad1d8"],[18.5,"#dabc95"]]}},"road-rail":{color:"#a5a0b1"},"road-path":{color:"#9fbcad"},"road-minor":{color:{stops:[[16,"#ffffff"],[18.5,"#f8e5c3"]]}},"road-secondary":{color:{stops:[[16,"#fbf6ea"],[18.5,"#f8e5c3"]]}},"road-ramp":{color:"#f8e5c3"},"road-major":{color:"#f8e5c3"},boundary:{color:"#ce97c0"},building:{color:"#e5ebf0",roofColor:"#f7fbfd",aoStrength:.18,tintVariation:.06,windowColor:"#bcd4e8",windowFrameColor:"#dfe8f2",windowGlow:0},housenumber:{color:"#4e6779",haloColor:"#fbfdfe",haloWidth:1.4},poi:{color:"#4e6779",haloColor:"#fbfdfe",haloWidth:1.4},"road-label":{color:"#2f3f50",haloColor:"#fbfdfe",haloWidth:1.4},"water-label":{color:"#35688d",haloColor:"#f7f7f7",haloWidth:1.4},"place-label":{color:"#2f3f50",haloColor:"#fbfdfe",haloWidth:1.4},"poi-food":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#c2681c",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#2f77c4",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#3b82a6",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#c24444",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#3f7f7a",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#8b5aa5",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#4f8b45",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#7a5fbf",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#59636e",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"water-pool":{color:"#ceeef9"},"indoor-shell":{color:"#f5f7f8",opacity:.97},"indoor-corridor":{color:"#fbfbfc"},"indoor-room":{color:"#edeff1"},"indoor-service":{color:"#d6dce0"},"indoor-shop":{color:"#e4dfea"},"indoor-food":{color:"#eae4df"},"indoor-wc":{color:"#dfe5ea"},"indoor-wall":{color:"#c9ced1",roofColor:"#e0e2e4",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#d0cbdc",opacity:.95},"indoor-door":{color:"#4e6779",haloColor:"#fbfdfe",haloWidth:1.4},"indoor-poi":{color:"#4e6779",haloColor:"#fbfdfe",haloWidth:1.4},"indoor-name":{color:"#2f3f50",haloColor:"#fbfdfe",haloWidth:1.4},"building-entrance":{color:"#225aaa",haloColor:"#fbfdfe"}},sky:{skyColor:"#9fc5d2",horizonColor:"#dfe3e8",fogRange:[1.35,7.42],fogIntensity:.85,spaceColor:"#090c0f",atmosphereColor:"#5fb3d0",starIntensity:.37}};var Ei={name:"\u0421\u0442\u0435\u043A\u043B\u043E",background:"#f2f5f7",light:{ambientColor:"#fbfbfb",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#ffffff",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#dee9ed",fillIntensity:.18},paint:{"landcover-wood":{color:"#b8e0cf"},"landcover-grass":{color:"#cbebdb"},"landcover-sand":{color:"#efeac8"},"landcover-ice":{color:"#e5f0f3"},"landcover-wetland":{color:"#d6e9eb"},"landuse-residential":{color:"#f6f7f9"},"landuse-industrial":{color:"#e3e5ed"},"landuse-civic":{color:"#f1e4e8"},"landuse-sport":{color:"#c8efd5"},"landuse-cemetery":{color:"#d8eee3"},"landuse-parking":{color:"#e4e6e7"},park:{color:"#cbebdb"},"aeroway-area":{color:"#d6dbeb"},water:{color:"#bee6f4"},waterway:{color:"#bee6f4"},"aeroway-line":{color:"#f0ede9"},"road-casing-major":{color:"#9dc7dd"},"road-casing-secondary":{color:{stops:[[16,"#bdcfdb"],[18.5,"#9dc7dd"]]}},"road-casing-minor":{color:{stops:[[16,"#bdcfdb"],[18.5,"#9dc7dd"]]}},"road-rail":{color:"#adb9c2"},"road-path":{color:"#d6e2eb"},"road-minor":{color:{stops:[[16,"#d6e2eb"],[18.5,"#b8daea"]]}},"road-secondary":{color:{stops:[[16,"#d6e2eb"],[18.5,"#b8daea"]]}},"road-ramp":{color:"#b8daea"},"road-major":{color:"#b8daea"},boundary:{color:"#e28dc6"},building:{color:"#e8eef3",roofColor:"#f4f8fb",aoStrength:.18,tintVariation:.06,windowColor:"#bcd4e8",windowFrameColor:"#dfe8f2",windowGlow:0},housenumber:{color:"#2d4053",haloColor:"#fbfdfe",haloWidth:1.4},poi:{color:"#457aa1",haloColor:"#fbfdfe",haloWidth:1.4},"road-label":{color:"#2d4053",haloColor:"#fbfdfe",haloWidth:1.4},"water-label":{color:"#35688d",haloColor:"#f7f7f7",haloWidth:1.4},"place-label":{color:"#2d4053",haloColor:"#fbfdfe",haloWidth:1.4},"poi-food":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#c2681c",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#2f77c4",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#3b82a6",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#c24444",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#3f7f7a",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#8b5aa5",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#4f8b45",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#7a5fbf",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#59636e",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"water-pool":{color:"#d3eff9"},"indoor-shell":{color:"#f5f7f8",opacity:.97},"indoor-corridor":{color:"#fbfbfc"},"indoor-room":{color:"#edeff1"},"indoor-service":{color:"#d6dce0"},"indoor-shop":{color:"#e4dfea"},"indoor-food":{color:"#eae4df"},"indoor-wc":{color:"#dfe5ea"},"indoor-wall":{color:"#c9ced1",roofColor:"#e0e2e4",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#d0cbdc",opacity:.95},"indoor-door":{color:"#457aa1",haloColor:"#fbfdfe",haloWidth:1.4},"indoor-poi":{color:"#457aa1",haloColor:"#fbfdfe",haloWidth:1.4},"indoor-name":{color:"#2d4053",haloColor:"#fbfdfe",haloWidth:1.4},"building-entrance":{color:"#225aaa",haloColor:"#fbfdfe"}},sky:{skyColor:"#9fc5d2",horizonColor:"#dfe3e8",fogRange:[1.35,7.42],fogIntensity:.85,spaceColor:"#090c10",atmosphereColor:"#5fb3d0",starIntensity:.37}};var Ai={name:"\u0413\u0430\u0440\u043C\u043E\u043D\u0438\u044F \u0447\u0451\u0440\u043D\u0430\u044F",background:"#1a1a1a",model3dKey:"night",light:{ambientColor:"#a8a8a8",ambientIntensity:.34,keyAzimuth:120,keyAltitude:55,keyColor:"#cccccc",keyIntensity:.29,fillAzimuth:300,fillAltitude:25,fillColor:"#854747",fillIntensity:.22},paint:{"landcover-wood":{color:"#212121"},"landcover-grass":{color:"#292929"},"landcover-sand":{color:"#33301f"},"landcover-ice":{color:"#545454"},"landcover-wetland":{color:"#1d2e30"},"landuse-residential":{color:"#1f1f1f"},"landuse-industrial":{color:"#1f222d"},"landuse-civic":{color:"#2d1f24"},"landuse-sport":{color:"#2d2525"},"landuse-cemetery":{color:"#2a1d1d"},"landuse-parking":{color:"#332e2e"},park:{color:"#292929"},"aeroway-area":{color:"#23262f"},water:{color:"#383838"},waterway:{color:"#3d3d3d"},"aeroway-line":{color:"#55493a"},"road-casing-major":{color:"#525252"},"road-casing-secondary":{color:{stops:[[16,"#383838"],[18.5,"#525252"]]}},"road-casing-minor":{color:{stops:[[16,"#383838"],[18.5,"#525252"]]}},"road-rail":{color:"#595959"},"road-path":{color:"#525252"},"road-minor":{color:{stops:[[16,"#525252"],[18.5,"#757575"]]}},"road-secondary":{color:{stops:[[16,"#525252"],[18.5,"#757575"]]}},"road-ramp":{color:"#757575"},"road-major":{color:"#757575"},boundary:{color:"#808080"},building:{color:"#2e2e2e",roofColor:"#4f4f4f",aoStrength:.29,tintVariation:.1,windowColor:"#8fb8e8",windowFrameColor:"#c8ccd4",windowGlow:.36},housenumber:{color:"#d9d9d9",haloColor:"#0a0a0a",haloWidth:1.4},poi:{color:"#a3a3a3",haloColor:"#0a0a0a",haloWidth:1.4},"road-label":{color:"#d9d9d9",haloColor:"#0a0a0a",haloWidth:1.4},"water-label":{color:"#9fbcd1",haloColor:"#131b20",haloWidth:1.4},"place-label":{color:"#d9d9d9",haloColor:"#0a0a0a",haloWidth:1.4},"poi-food":{color:"#a3a3a3",haloColor:"#0a0a0a",haloWidth:1.4,frameColor:"#a3a3a3",frameOpacity:1,frameHaloColor:"#0a0a0a",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-shop":{color:"#a3a3a3",haloColor:"#0a0a0a",haloWidth:1.4,frameColor:"#a3a3a3",frameOpacity:1,frameHaloColor:"#0a0a0a",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-transport":{color:"#a3a3a3",haloColor:"#0a0a0a",haloWidth:1.4,frameColor:"#a3a3a3",frameOpacity:1,frameHaloColor:"#0a0a0a",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-health":{color:"#a3a3a3",haloColor:"#0a0a0a",haloWidth:1.4,frameColor:"#a3a3a3",frameOpacity:1,frameHaloColor:"#0a0a0a",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-education":{color:"#a3a3a3",haloColor:"#0a0a0a",haloWidth:1.4,frameColor:"#a3a3a3",frameOpacity:1,frameHaloColor:"#0a0a0a",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-culture":{color:"#a3a3a3",haloColor:"#0a0a0a",haloWidth:1.4,frameColor:"#a3a3a3",frameOpacity:1,frameHaloColor:"#0a0a0a",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-sport":{color:"#a3a3a3",haloColor:"#0a0a0a",haloWidth:1.4,frameColor:"#a3a3a3",frameOpacity:1,frameHaloColor:"#0a0a0a",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-lodging":{color:"#a3a3a3",haloColor:"#0a0a0a",haloWidth:1.4,frameColor:"#a3a3a3",frameOpacity:1,frameHaloColor:"#0a0a0a",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-service":{color:"#a3a3a3",haloColor:"#0a0a0a",haloWidth:1.4,frameColor:"#a3a3a3",frameOpacity:1,frameHaloColor:"#0a0a0a",iconColor:"#1b1b1b",iconHaloWidth:0},"water-pool":{color:"#4c4c4c"},"indoor-shell":{color:"#484848",opacity:.97},"indoor-corridor":{color:"#424242"},"indoor-room":{color:"#505050"},"indoor-service":{color:"#676767"},"indoor-shop":{color:"#5c4672"},"indoor-food":{color:"#725d46"},"indoor-wc":{color:"#466172"},"indoor-wall":{color:"#767676",roofColor:"#909090",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#66558a",opacity:.95},"indoor-door":{color:"#a3a3a3",haloColor:"#0a0a0a",haloWidth:1.4},"indoor-poi":{color:"#a3a3a3",haloColor:"#0a0a0a",haloWidth:1.4},"indoor-name":{color:"#d9d9d9",haloColor:"#0a0a0a",haloWidth:1.4},"building-entrance":{color:"#cac4c4",haloColor:"#0a0a0a"}},sky:{skyColor:"#190909",horizonColor:"#282828",fogRange:[1.3,6.51],fogIntensity:.9,spaceColor:"#060606",atmosphereColor:"#b83535",starIntensity:.8}};var Li={name:"\u0413\u0430\u0440\u043C\u043E\u043D\u0438\u044F \u0441\u0438\u043D\u044F\u044F",background:"#e3e9f2",light:{ambientColor:"#f7f7f7",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#eef4ff",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#dee5ed",fillIntensity:.18},paint:{"landcover-wood":{color:"#a1b8ce"},"landcover-grass":{color:"#bdccdb"},"landcover-sand":{color:"#efeac8"},"landcover-ice":{color:"#baccde"},"landcover-wetland":{color:"#c1dee1"},"landuse-residential":{color:"#ebeff4"},"landuse-industrial":{color:"#d7d9e4"},"landuse-civic":{color:"#ead7dd"},"landuse-sport":{color:"#b8d3e0"},"landuse-cemetery":{color:"#c2d4e5"},"landuse-parking":{color:"#dadbdd"},park:{color:"#bdccdb"},"aeroway-area":{color:"#d6dbeb"},water:{color:"#5799db"},waterway:{color:"#5f9edd"},"aeroway-line":{color:"#f0ede9"},"road-casing-major":{color:"#407fbf"},"road-casing-secondary":{color:{stops:[[16,"#80a1c6"],[18.5,"#407fbf"]]}},"road-casing-minor":{color:{stops:[[16,"#80a1c6"],[18.5,"#407fbf"]]}},"road-rail":{color:"#738dab"},"road-path":{color:"#b0c5dd"},"road-minor":{color:{stops:[[16,"#b0c5dd"],[18.5,"#71a3d6"]]}},"road-secondary":{color:{stops:[[16,"#b0c5dd"],[18.5,"#71a3d6"]]}},"road-ramp":{color:"#71a3d6"},"road-major":{color:"#71a3d6"},boundary:{color:"#478cd1"},building:{color:"#cfdae8",roofColor:"#e5edf6",aoStrength:.19,tintVariation:.06,windowColor:"#6b9ed1",windowFrameColor:"#e8eef6",windowGlow:0},housenumber:{color:"#1f395c",haloColor:"#fbfcfe",haloWidth:1.4},poi:{color:"#3e6da3",haloColor:"#fbfcfe",haloWidth:1.4},"road-label":{color:"#1f395c",haloColor:"#fbfcfe",haloWidth:1.4},"water-label":{color:"#35688d",haloColor:"#f7f7f7",haloWidth:1.4},"place-label":{color:"#1f395c",haloColor:"#fbfcfe",haloWidth:1.4},"poi-food":{haloColor:"#fbfcfe",haloWidth:1.4,frameColor:"#c2681c",frameOpacity:1,frameHaloColor:"#fbfcfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{haloColor:"#fbfcfe",haloWidth:1.4,frameColor:"#2f77c4",frameOpacity:1,frameHaloColor:"#fbfcfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{haloColor:"#fbfcfe",haloWidth:1.4,frameColor:"#3b82a6",frameOpacity:1,frameHaloColor:"#fbfcfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{haloColor:"#fbfcfe",haloWidth:1.4,frameColor:"#c24444",frameOpacity:1,frameHaloColor:"#fbfcfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{haloColor:"#fbfcfe",haloWidth:1.4,frameColor:"#3f7f7a",frameOpacity:1,frameHaloColor:"#fbfcfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{haloColor:"#fbfcfe",haloWidth:1.4,frameColor:"#8b5aa5",frameOpacity:1,frameHaloColor:"#fbfcfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{haloColor:"#fbfcfe",haloWidth:1.4,frameColor:"#4f8b45",frameOpacity:1,frameHaloColor:"#fbfcfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{haloColor:"#fbfcfe",haloWidth:1.4,frameColor:"#7a5fbf",frameOpacity:1,frameHaloColor:"#fbfcfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{haloColor:"#fbfcfe",haloWidth:1.4,frameColor:"#59636e",frameOpacity:1,frameHaloColor:"#fbfcfe",iconColor:"#ffffff",iconHaloWidth:0},"water-pool":{color:"#61a2e3"},"indoor-shell":{color:"#e6e8ec",opacity:.97},"indoor-corridor":{color:"#ebedf0"},"indoor-room":{color:"#dde1e5"},"indoor-service":{color:"#c6ccd4"},"indoor-shop":{color:"#d6cedf"},"indoor-food":{color:"#dfd7ce"},"indoor-wc":{color:"#ced8df"},"indoor-wall":{color:"#babfc5",roofColor:"#d1d4d7",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#c1bad1",opacity:.95},"indoor-door":{color:"#3e6da3",haloColor:"#fbfcfe",haloWidth:1.4},"indoor-poi":{color:"#3e6da3",haloColor:"#fbfcfe",haloWidth:1.4},"indoor-name":{color:"#1f395c",haloColor:"#fbfcfe",haloWidth:1.4},"building-entrance":{color:"#225aaa",haloColor:"#fbfcfe"}},sky:{skyColor:"#8cabc9",horizonColor:"#ced6e1",fogRange:[1.34,7.35],fogIntensity:.86,spaceColor:"#080b10",atmosphereColor:"#5c96d0",starIntensity:.39}};var Ii={name:"\u0413\u0430\u0440\u043C\u043E\u043D\u0438\u044F \u0437\u0435\u043B\u0451\u043D\u0430\u044F",background:"#dfecdf",light:{ambientColor:"#f5f6f5",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#f0fff0",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#dcece7",fillIntensity:.18},paint:{"landcover-wood":{color:"#5ccc65"},"landcover-grass":{color:"#8cd98c"},"landcover-sand":{color:"#efeac8"},"landcover-ice":{color:"#bbd8ce"},"landcover-wetland":{color:"#9fccd1"},"landuse-residential":{color:"#e6efe6"},"landuse-industrial":{color:"#d1d4e0"},"landuse-civic":{color:"#e7d0d7"},"landuse-sport":{color:"#94e085"},"landuse-cemetery":{color:"#9fd69f"},"landuse-parking":{color:"#d4d8d4"},park:{color:"#8cd98c"},"aeroway-area":{color:"#d6dbeb"},water:{color:"#5ec9a6"},waterway:{color:"#66ccaa"},"aeroway-line":{color:"#f0ede9"},"road-casing-major":{color:"#44a754"},"road-casing-secondary":{color:{stops:[[16,"#7fbd7f"],[18.5,"#44a754"]]}},"road-casing-minor":{color:{stops:[[16,"#7fbd7f"],[18.5,"#44a754"]]}},"road-rail":{color:"#72a172"},"road-path":{color:"#afd4af"},"road-minor":{color:{stops:[[16,"#afd4af"],[18.5,"#64c474"]]}},"road-secondary":{color:{stops:[[16,"#afd4af"],[18.5,"#64c474"]]}},"road-ramp":{color:"#64c474"},"road-major":{color:"#64c474"},boundary:{color:"#39c668"},building:{color:"#cfe2cb",roofColor:"#dff1df",aoStrength:.19,tintVariation:.06,windowColor:"#6b9ed1",windowFrameColor:"#e8f0e8",windowGlow:0},housenumber:{color:"#1c4a24",haloColor:"#f8fcf8",haloWidth:1.4},poi:{color:"#358d44",haloColor:"#f8fcf8",haloWidth:1.4},"road-label":{color:"#1c4a24",haloColor:"#f8fcf8",haloWidth:1.4},"water-label":{color:"#35688d",haloColor:"#f7f7f7",haloWidth:1.4},"place-label":{color:"#1c4a24",haloColor:"#f8fcf8",haloWidth:1.4},"poi-food":{haloColor:"#f8fcf8",haloWidth:1.4,frameColor:"#c2681c",frameOpacity:1,frameHaloColor:"#f8fcf8",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{haloColor:"#f8fcf8",haloWidth:1.4,frameColor:"#2f77c4",frameOpacity:1,frameHaloColor:"#f8fcf8",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{haloColor:"#f8fcf8",haloWidth:1.4,frameColor:"#3b82a6",frameOpacity:1,frameHaloColor:"#f8fcf8",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{haloColor:"#f8fcf8",haloWidth:1.4,frameColor:"#c24444",frameOpacity:1,frameHaloColor:"#f8fcf8",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{haloColor:"#f8fcf8",haloWidth:1.4,frameColor:"#3f7f7a",frameOpacity:1,frameHaloColor:"#f8fcf8",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{haloColor:"#f8fcf8",haloWidth:1.4,frameColor:"#8b5aa5",frameOpacity:1,frameHaloColor:"#f8fcf8",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{haloColor:"#f8fcf8",haloWidth:1.4,frameColor:"#4f8b45",frameOpacity:1,frameHaloColor:"#f8fcf8",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{haloColor:"#f8fcf8",haloWidth:1.4,frameColor:"#7a5fbf",frameOpacity:1,frameHaloColor:"#f8fcf8",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{haloColor:"#f8fcf8",haloWidth:1.4,frameColor:"#59636e",frameOpacity:1,frameHaloColor:"#f8fcf8",iconColor:"#ffffff",iconHaloWidth:0},"water-pool":{color:"#67d1af"},"indoor-shell":{color:"#e1e8e0",opacity:.97},"indoor-corridor":{color:"#e6ece5"},"indoor-room":{color:"#d9e1d7"},"indoor-service":{color:"#c3d0c1"},"indoor-shop":{color:"#d1c8db"},"indoor-food":{color:"#dbd2c8"},"indoor-wc":{color:"#c8d4db"},"indoor-wall":{color:"#b7c0b5",roofColor:"#cdd2cc",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#bcb4cd",opacity:.95},"indoor-door":{color:"#358d44",haloColor:"#f8fcf8",haloWidth:1.4},"indoor-poi":{color:"#358d44",haloColor:"#f8fcf8",haloWidth:1.4},"indoor-name":{color:"#1c4a24",haloColor:"#f8fcf8",haloWidth:1.4},"building-entrance":{color:"#225aaa",haloColor:"#f8fcf8"}},sky:{skyColor:"#83c5af",horizonColor:"#cad9ca",fogRange:[1.34,7.31],fogIntensity:.86,spaceColor:"#090f09",atmosphereColor:"#5bcfa9",starIntensity:.4}};var Fi={name:"\u041B\u0443\u043D\u043D\u0430\u044F",background:"#c8cbd0",light:{ambientColor:"#ebecec",ambientIntensity:.46,keyAzimuth:120,keyAltitude:59,keyColor:"#e8ecf2",keyIntensity:.56,fillAzimuth:300,fillAltitude:25,fillColor:"#c7d0e1",fillIntensity:.19},paint:{"landcover-wood":{color:"#a8abb3"},"landcover-grass":{color:"#b9bbc1"},"landcover-sand":{color:"#efeac8"},"landcover-ice":{color:"#cbcdd2"},"landcover-wetland":{color:"#acd4d7"},"landuse-residential":{color:"#ced0d4"},"landuse-industrial":{color:"#b3b7cc"},"landuse-civic":{color:"#d5aebb"},"landuse-sport":{color:"#b2bdc7"},"landuse-cemetery":{color:"#adbddc"},"landuse-parking":{color:"#b9bcc0"},park:{color:"#b9bbc1"},"aeroway-area":{color:"#d6dbeb"},water:{color:"#929aaa"},waterway:{color:"#929aaa"},"aeroway-line":{color:"#f0ede9"},"road-casing-major":{color:"#6c7689"},"road-casing-secondary":{color:{stops:[[16,"#848b9a"],[18.5,"#6c7689"]]}},"road-casing-minor":{color:{stops:[[16,"#848b9a"],[18.5,"#6c7689"]]}},"road-rail":{color:"#7e838b"},"road-path":{color:"#acb0b9"},"road-minor":{color:{stops:[[16,"#acb0b9"],[18.5,"#949ba8"]]}},"road-secondary":{color:{stops:[[16,"#acb0b9"],[18.5,"#949ba8"]]}},"road-ramp":{color:"#949ba8"},"road-major":{color:"#949ba8"},boundary:{color:"#6a7181"},building:{color:"#c8cbd0",roofColor:"#d9dbdd",aoStrength:.2,tintVariation:.07,windowColor:"#9fb0c0",windowFrameColor:"#cfd6e0",windowGlow:0},housenumber:{color:"#31363f",haloColor:"#f1f2f4",haloWidth:1.4},poi:{color:"#606876",haloColor:"#f1f2f4",haloWidth:1.4},"road-label":{color:"#31363f",haloColor:"#f1f2f4",haloWidth:1.4},"water-label":{color:"#35688d",haloColor:"#f7f7f7",haloWidth:1.4},"place-label":{color:"#31363f",haloColor:"#f1f2f4",haloWidth:1.4},"poi-food":{haloColor:"#f1f2f4",haloWidth:1.4,frameColor:"#c2681c",frameOpacity:1,frameHaloColor:"#f1f2f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{haloColor:"#f1f2f4",haloWidth:1.4,frameColor:"#2f77c4",frameOpacity:1,frameHaloColor:"#f1f2f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{haloColor:"#f1f2f4",haloWidth:1.4,frameColor:"#3b82a6",frameOpacity:1,frameHaloColor:"#f1f2f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{haloColor:"#f1f2f4",haloWidth:1.4,frameColor:"#c24444",frameOpacity:1,frameHaloColor:"#f1f2f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{haloColor:"#f1f2f4",haloWidth:1.4,frameColor:"#3f7f7a",frameOpacity:1,frameHaloColor:"#f1f2f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{haloColor:"#f1f2f4",haloWidth:1.4,frameColor:"#8b5aa5",frameOpacity:1,frameHaloColor:"#f1f2f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{haloColor:"#f1f2f4",haloWidth:1.4,frameColor:"#4f8b45",frameOpacity:1,frameHaloColor:"#f1f2f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{haloColor:"#f1f2f4",haloWidth:1.4,frameColor:"#7a5fbf",frameOpacity:1,frameHaloColor:"#f1f2f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{haloColor:"#f1f2f4",haloWidth:1.4,frameColor:"#59636e",frameOpacity:1,frameHaloColor:"#f1f2f4",iconColor:"#ffffff",iconHaloWidth:0},"water-pool":{color:"#9ca4b3"},"indoor-shell":{color:"#d6d9dc",opacity:.97},"indoor-corridor":{color:"#dbdde0"},"indoor-room":{color:"#ced1d5"},"indoor-service":{color:"#b9bcc3"},"indoor-shop":{color:"#c7bcd2"},"indoor-food":{color:"#d2c7bc"},"indoor-wc":{color:"#bcc9d2"},"indoor-wall":{color:"#acafb4",roofColor:"#c2c4c7",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#b1a7c5",opacity:.95},"indoor-door":{color:"#606876",haloColor:"#f1f2f4",haloWidth:1.4},"indoor-poi":{color:"#606876",haloColor:"#f1f2f4",haloWidth:1.4},"indoor-name":{color:"#31363f",haloColor:"#f1f2f4",haloWidth:1.4},"building-entrance":{haloColor:"#f1f2f4"}},sky:{skyColor:"#5675b3",horizonColor:"#b1b4b9",fogRange:[1.33,7.14],fogIntensity:.87,spaceColor:"#0a0b0c",atmosphereColor:"#557dce",starIntensity:.45}};var Ri={name:"\u041C\u0430\u0442\u043E\u0432\u0430\u044F",background:"#e7e6e4",light:{ambientColor:"#f5f5f5",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#ffffff",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#dce6ec",fillIntensity:.18},paint:{"landcover-wood":{color:"#a3be9d"},"landcover-grass":{color:"#b3cbae"},"landcover-sand":{color:"#efeac8"},"landcover-ice":{color:"#d6dce0"},"landcover-wetland":{color:"#acd4d7"},"landuse-residential":{color:"#ecebe9"},"landuse-industrial":{color:"#d1d4e0"},"landuse-civic":{color:"#e7d0d7"},"landuse-sport":{color:"#b6d2a7"},"landuse-cemetery":{color:"#b5dcad"},"landuse-parking":{color:"#d8d6d4"},park:{color:"#b3cbae"},"aeroway-area":{color:"#d6dbeb"},water:{color:"#a6bbc9"},waterway:{color:"#a6bbc9"},"aeroway-line":{color:"#f0ede9"},"road-casing-major":{color:"#969fb0"},"road-casing-secondary":{color:{stops:[[16,"#abb0ba"],[18.5,"#969fb0"]]}},"road-casing-minor":{color:{stops:[[16,"#abb0ba"],[18.5,"#969fb0"]]}},"road-rail":{color:"#adadad"},"road-path":{color:"#c7cad1"},"road-minor":{color:{stops:[[16,"#c7cad1"],[18.5,"#aeb4c2"]]}},"road-secondary":{color:{stops:[[16,"#c7cad1"],[18.5,"#aeb4c2"]]}},"road-ramp":{color:"#aeb4c2"},"road-major":{color:"#aeb4c2"},boundary:{color:"#ca919f"},building:{color:"#dad6d2",roofColor:"#e3e0dd",aoStrength:.19,tintVariation:.06,windowColor:"#9fb0c0",windowFrameColor:"#f0f0f2",windowGlow:0},housenumber:{color:"#4d4742",haloColor:"#f6f5f4",haloWidth:1.4},poi:{color:"#707a8f",haloColor:"#f6f5f4",haloWidth:1.4},"road-label":{color:"#4d4742",haloColor:"#f6f5f4",haloWidth:1.4},"water-label":{color:"#35688d",haloColor:"#f7f7f7",haloWidth:1.4},"place-label":{color:"#4d4742",haloColor:"#f6f5f4",haloWidth:1.4},"poi-food":{haloColor:"#f6f5f4",haloWidth:1.4,frameColor:"#c2681c",frameOpacity:1,frameHaloColor:"#f6f5f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{haloColor:"#f6f5f4",haloWidth:1.4,frameColor:"#2f77c4",frameOpacity:1,frameHaloColor:"#f6f5f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{haloColor:"#f6f5f4",haloWidth:1.4,frameColor:"#3b82a6",frameOpacity:1,frameHaloColor:"#f6f5f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{haloColor:"#f6f5f4",haloWidth:1.4,frameColor:"#c24444",frameOpacity:1,frameHaloColor:"#f6f5f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{haloColor:"#f6f5f4",haloWidth:1.4,frameColor:"#3f7f7a",frameOpacity:1,frameHaloColor:"#f6f5f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{haloColor:"#f6f5f4",haloWidth:1.4,frameColor:"#8b5aa5",frameOpacity:1,frameHaloColor:"#f6f5f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{haloColor:"#f6f5f4",haloWidth:1.4,frameColor:"#4f8b45",frameOpacity:1,frameHaloColor:"#f6f5f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{haloColor:"#f6f5f4",haloWidth:1.4,frameColor:"#7a5fbf",frameOpacity:1,frameHaloColor:"#f6f5f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{haloColor:"#f6f5f4",haloWidth:1.4,frameColor:"#59636e",frameOpacity:1,frameHaloColor:"#f6f5f4",iconColor:"#ffffff",iconHaloWidth:0},"water-pool":{color:"#b3c6d2"},"indoor-shell":{color:"#e6e3e1",opacity:.97},"indoor-corridor":{color:"#eae8e6"},"indoor-room":{color:"#dfdcd8"},"indoor-service":{color:"#cdc8c2"},"indoor-shop":{color:"#d1c8da"},"indoor-food":{color:"#dad1c8"},"indoor-wc":{color:"#c8d3da"},"indoor-wall":{color:"#bebab6",roofColor:"#d1cecc",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#bbb3cd",opacity:.95},"indoor-door":{color:"#707a8f",haloColor:"#f6f5f4",haloWidth:1.4},"indoor-poi":{color:"#707a8f",haloColor:"#f6f5f4",haloWidth:1.4},"indoor-name":{color:"#4d4742",haloColor:"#f6f5f4",haloWidth:1.4},"building-entrance":{color:"#225aaa",haloColor:"#f6f5f4"}},sky:{skyColor:"#83abc5",horizonColor:"#d3d2d0",fogRange:[1.34,7.31],fogIntensity:.86,spaceColor:"#0d0c0b",atmosphereColor:"#5ba1cf",starIntensity:.4}};var zi={name:"\u041C\u0438\u043D\u0438\u043C\u0430\u043B\u0438\u0437\u043C",background:"#f7f7f7",light:{ambientColor:"#fcfcfc",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#ffffff",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#dee7ed",fillIntensity:.18},paint:{"landcover-wood":{color:"#d6e1d6"},"landcover-grass":{color:"#e1eae1"},"landcover-sand":{color:"#efeac8"},"landcover-ice":{color:"#edf0f2"},"landcover-wetland":{color:"#e3f1f2"},"landuse-residential":{color:"#fafafa"},"landuse-industrial":{color:"#e7e8ef"},"landuse-civic":{color:"#f3e7eb"},"landuse-sport":{color:"#e1edde"},"landuse-cemetery":{color:"#e6f4e6"},"landuse-parking":{color:"#e9e7e7"},park:{color:"#e1eae1"},"aeroway-area":{color:"#d6dbeb"},water:{color:"#d7e2ea"},waterway:{color:"#d7e2ea"},"aeroway-line":{color:"#f0ede9"},"road-casing-major":{color:"#a3a3a3"},"road-casing-secondary":{color:{stops:[[16,"#b8b8b8"],[18.5,"#a3a3a3"]]}},"road-casing-minor":{color:{stops:[[16,"#b8b8b8"],[18.5,"#a3a3a3"]]}},"road-rail":{color:"#b3b3b3"},"road-path":{color:"#d1d1d1"},"road-minor":{color:{stops:[[16,"#d1d1d1"],[18.5,"#bdbdbd"]]}},"road-secondary":{color:{stops:[[16,"#d1d1d1"],[18.5,"#bdbdbd"]]}},"road-ramp":{color:"#bdbdbd"},"road-major":{color:"#bdbdbd"},boundary:{color:"#999999"},building:{color:"#ebebeb",roofColor:"#f2f2f2",aoStrength:.18,tintVariation:.06,windowColor:"#9fb0c0",windowFrameColor:"#f4f4f6",windowGlow:0},housenumber:{color:"#404040",haloColor:"#ffffff",haloWidth:1.4},poi:{color:"#737373",haloColor:"#ffffff",haloWidth:1.4},"road-label":{color:"#404040",haloColor:"#ffffff",haloWidth:1.4},"water-label":{color:"#35688d",haloColor:"#f7f7f7",haloWidth:1.4},"place-label":{color:"#404040",haloColor:"#ffffff",haloWidth:1.4},"poi-food":{color:"#737373",haloColor:"#ffffff",haloWidth:1.4,frameColor:"#737373",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{color:"#737373",haloColor:"#ffffff",haloWidth:1.4,frameColor:"#737373",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{color:"#737373",haloColor:"#ffffff",haloWidth:1.4,frameColor:"#737373",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{color:"#737373",haloColor:"#ffffff",haloWidth:1.4,frameColor:"#737373",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{color:"#737373",haloColor:"#ffffff",haloWidth:1.4,frameColor:"#737373",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{color:"#737373",haloColor:"#ffffff",haloWidth:1.4,frameColor:"#737373",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{color:"#737373",haloColor:"#ffffff",haloWidth:1.4,frameColor:"#737373",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{color:"#737373",haloColor:"#ffffff",haloWidth:1.4,frameColor:"#737373",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{color:"#737373",haloColor:"#ffffff",haloWidth:1.4,frameColor:"#737373",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"water-pool":{color:"#e8eff4"},"indoor-shell":{color:"#f7f7f7",opacity:.97},"indoor-corridor":{color:"#fbfbfb"},"indoor-room":{color:"#efefef"},"indoor-service":{color:"#dbdbdb"},"indoor-shop":{color:"#e4dfea"},"indoor-food":{color:"#eae4df"},"indoor-wc":{color:"#dfe5ea"},"indoor-wall":{color:"#cdcdcd",roofColor:"#e2e2e2",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#d0cbdc",opacity:.95},"indoor-door":{color:"#737373",haloColor:"#ffffff",haloWidth:1.4},"indoor-poi":{color:"#737373",haloColor:"#ffffff",haloWidth:1.4},"indoor-name":{color:"#404040",haloColor:"#ffffff",haloWidth:1.4},"building-entrance":{color:"#564e4e",haloColor:"#ffffff"}},sky:{skyColor:"#a4c0d4",horizonColor:"#e6e6e6",fogRange:[1.35,7.44],fogIntensity:.85,spaceColor:"#0d0d0d",atmosphereColor:"#5fa1d1",starIntensity:.37}};var Pi={name:"\u041E\u043A\u0435\u0430\u043D",background:"#d7e3ea",light:{ambientColor:"#f3f4f4",ambientIntensity:.47,keyAzimuth:120,keyAltitude:60,keyColor:"#e8f6ff",keyIntensity:.59,fillAzimuth:300,fillAltitude:25,fillColor:"#d8e4ea",fillIntensity:.18},paint:{"landcover-wood":{color:"#75c7c7"},"landcover-grass":{color:"#97d8d2"},"landcover-sand":{color:"#efeac8"},"landcover-ice":{color:"#accedf"},"landcover-wetland":{color:"#a5d0d4"},"landuse-residential":{color:"#dfe8ec"},"landuse-industrial":{color:"#cbcedc"},"landuse-civic":{color:"#e3c9d2"},"landuse-sport":{color:"#90dfcb"},"landuse-cemetery":{color:"#a6d9d4"},"landuse-parking":{color:"#cfd2d3"},park:{color:"#97d8d2"},"aeroway-area":{color:"#d6dbeb"},water:{color:"#30abe8"},waterway:{color:"#3eb0ea"},"aeroway-line":{color:"#f0ede9"},"road-casing-major":{color:"#47a3c2"},"road-casing-secondary":{color:{stops:[[16,"#8ab2c7"],[18.5,"#47a3c2"]]}},"road-casing-minor":{color:{stops:[[16,"#8ab2c7"],[18.5,"#47a3c2"]]}},"road-rail":{color:"#8a9ea8"},"road-path":{color:"#b8d3e0"},"road-minor":{color:{stops:[[16,"#b8d3e0"],[18.5,"#79c0d8"]]}},"road-secondary":{color:{stops:[[16,"#b8d3e0"],[18.5,"#79c0d8"]]}},"road-ramp":{color:"#79c0d8"},"road-major":{color:"#79c0d8"},boundary:{color:"#47bad1"},building:{color:"#d2dee4",roofColor:"#e7f0f3",aoStrength:.19,tintVariation:.06,windowColor:"#6b9ed1",windowFrameColor:"#e6f0f6",windowGlow:0},housenumber:{color:"#1f3c51",haloColor:"#f8fbfc",haloWidth:1.4},poi:{color:"#3b7b9b",haloColor:"#f8fbfc",haloWidth:1.4},"road-label":{color:"#1f3c51",haloColor:"#f8fbfc",haloWidth:1.4},"water-label":{color:"#35688d",haloColor:"#f7f7f7",haloWidth:1.4},"place-label":{color:"#1f3c51",haloColor:"#f8fbfc",haloWidth:1.4},"poi-food":{haloColor:"#f8fbfc",haloWidth:1.4,frameColor:"#c2681c",frameOpacity:1,frameHaloColor:"#f8fbfc",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{haloColor:"#f8fbfc",haloWidth:1.4,frameColor:"#2f77c4",frameOpacity:1,frameHaloColor:"#f8fbfc",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{haloColor:"#f8fbfc",haloWidth:1.4,frameColor:"#3b82a6",frameOpacity:1,frameHaloColor:"#f8fbfc",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{haloColor:"#f8fbfc",haloWidth:1.4,frameColor:"#c24444",frameOpacity:1,frameHaloColor:"#f8fbfc",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{haloColor:"#f8fbfc",haloWidth:1.4,frameColor:"#3f7f7a",frameOpacity:1,frameHaloColor:"#f8fbfc",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{haloColor:"#f8fbfc",haloWidth:1.4,frameColor:"#8b5aa5",frameOpacity:1,frameHaloColor:"#f8fbfc",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{haloColor:"#f8fbfc",haloWidth:1.4,frameColor:"#4f8b45",frameOpacity:1,frameHaloColor:"#f8fbfc",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{haloColor:"#f8fbfc",haloWidth:1.4,frameColor:"#7a5fbf",frameOpacity:1,frameHaloColor:"#f8fbfc",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{haloColor:"#f8fbfc",haloWidth:1.4,frameColor:"#59636e",frameOpacity:1,frameHaloColor:"#f8fbfc",iconColor:"#ffffff",iconHaloWidth:0},"water-pool":{color:"#38b3f1"},"indoor-shell":{color:"#e5e9eb",opacity:.97},"indoor-corridor":{color:"#eaeeef"},"indoor-room":{color:"#dce2e5"},"indoor-service":{color:"#c6cfd4"},"indoor-shop":{color:"#d6cede"},"indoor-food":{color:"#ded6ce"},"indoor-wc":{color:"#ced8de"},"indoor-wall":{color:"#bac1c4",roofColor:"#d0d4d6",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#c1b9d1",opacity:.95},"indoor-door":{color:"#3b7b9b",haloColor:"#f8fbfc",haloWidth:1.4},"indoor-poi":{color:"#3b7b9b",haloColor:"#f8fbfc",haloWidth:1.4},"indoor-name":{color:"#1f3c51",haloColor:"#f8fbfc",haloWidth:1.4},"building-entrance":{color:"#225aaa",haloColor:"#f8fbfc"}},sky:{skyColor:"#7aaac1",horizonColor:"#c1cfd6",fogRange:[1.34,7.27],fogIntensity:.86,spaceColor:"#080d0f",atmosphereColor:"#5aa8cf",starIntensity:.41}};var Hi={name:"\u041F\u0440\u0435\u043C\u0438\u0443\u043C",background:"#211f1c",model3dKey:"night",light:{ambientColor:"#b0aaa4",ambientIntensity:.34,keyAzimuth:120,keyAltitude:55,keyColor:"#c8b48a",keyIntensity:.3,fillAzimuth:300,fillAltitude:25,fillColor:"#496887",fillIntensity:.22},paint:{"landcover-wood":{color:"#1b271b"},"landcover-grass":{color:"#232f23"},"landcover-sand":{color:"#393622"},"landcover-ice":{color:"#2d3d4c"},"landcover-wetland":{color:"#213436"},"landuse-residential":{color:"#272421"},"landuse-industrial":{color:"#242633"},"landuse-civic":{color:"#332429"},"landuse-sport":{color:"#22331f"},"landuse-cemetery":{color:"#213021"},"landuse-parking":{color:"#383633"},park:{color:"#232f23"},"aeroway-area":{color:"#272a35"},water:{color:"#16293b"},waterway:{color:"#1c334a"},"aeroway-line":{color:"#55493a"},"road-casing-major":{color:"#856e32"},"road-casing-secondary":{color:{stops:[[16,"#423b2e"],[18.5,"#856e32"]]}},"road-casing-minor":{color:{stops:[[16,"#423b2e"],[18.5,"#856e32"]]}},"road-rail":{color:"#6b6457"},"road-path":{color:"#5e5645"},"road-minor":{color:{stops:[[16,"#5e5645"],[18.5,"#bf9e4a"]]}},"road-secondary":{color:{stops:[[16,"#5e5645"],[18.5,"#bf9e4a"]]}},"road-ramp":{color:"#bf9e4a"},"road-major":{color:"#bf9e4a"},boundary:{color:"#d1aa47"},building:{color:"#443b2c",roofColor:"#726037",aoStrength:.29,tintVariation:.1,windowColor:"#8fb8e8",windowFrameColor:"#eef0f4",windowGlow:.36},housenumber:{color:"#eae3d7",haloColor:"#181410",haloWidth:1.4},poi:{color:"#d4bb7d",haloColor:"#181410",haloWidth:1.4},"road-label":{color:"#eae3d7",haloColor:"#181410",haloWidth:1.4},"water-label":{color:"#9fbcd1",haloColor:"#131b20",haloWidth:1.4},"place-label":{color:"#eae3d7",haloColor:"#181410",haloWidth:1.4},"poi-food":{color:"#d89964",haloColor:"#181410",haloWidth:1.4,frameColor:"#d89964",frameOpacity:1,frameHaloColor:"#181410",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-shop":{color:"#699cd4",haloColor:"#181410",haloWidth:1.4,frameColor:"#699cd4",frameOpacity:1,frameHaloColor:"#181410",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-transport":{color:"#75acc8",haloColor:"#181410",haloWidth:1.4,frameColor:"#75acc8",frameOpacity:1,frameHaloColor:"#181410",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-health":{color:"#ca7272",haloColor:"#181410",haloWidth:1.4,frameColor:"#ca7272",frameOpacity:1,frameHaloColor:"#181410",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-education":{color:"#81bbb7",haloColor:"#181410",haloWidth:1.4,frameColor:"#81bbb7",frameOpacity:1,frameHaloColor:"#181410",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-culture":{color:"#a684b8",haloColor:"#181410",haloWidth:1.4,frameColor:"#a684b8",frameOpacity:1,frameHaloColor:"#181410",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-sport":{color:"#89bb81",haloColor:"#181410",haloWidth:1.4,frameColor:"#89bb81",frameOpacity:1,frameHaloColor:"#181410",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-lodging":{color:"#8e79c3",haloColor:"#181410",haloWidth:1.4,frameColor:"#8e79c3",frameOpacity:1,frameHaloColor:"#181410",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-service":{color:"#959ea7",haloColor:"#181410",haloWidth:1.4,frameColor:"#959ea7",frameOpacity:1,frameHaloColor:"#181410",iconColor:"#1b1b1b",iconHaloWidth:0},"water-pool":{color:"#1c3752"},"indoor-shell":{color:"#564b39",opacity:.97},"indoor-corridor":{color:"#504635"},"indoor-room":{color:"#605440"},"indoor-service":{color:"#7b6c52"},"indoor-shop":{color:"#5c4672"},"indoor-food":{color:"#725d46"},"indoor-wc":{color:"#466172"},"indoor-wall":{color:"#857a68",roofColor:"#9a9285",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#66558a",opacity:.95},"indoor-door":{color:"#d4bb7d",haloColor:"#181410",haloWidth:1.4},"indoor-poi":{color:"#d4bb7d",haloColor:"#181410",haloWidth:1.4},"indoor-name":{color:"#eae3d7",haloColor:"#181410",haloWidth:1.4},"building-entrance":{color:"#79a0d7",haloColor:"#181410"}},sky:{skyColor:"#09121b",horizonColor:"#2c2a27",fogRange:[1.3,6.51],fogIntensity:.9,spaceColor:"#060606",atmosphereColor:"#3679b9",starIntensity:.79}};var Oi={name:"\u0420\u0435\u0430\u043B\u0438\u0441\u0442\u0438\u0447\u043D\u0430\u044F",background:"#d6dac8",light:{ambientColor:"#eeeeed",ambientIntensity:.46,keyAzimuth:120,keyAltitude:59,keyColor:"#fff0d8",keyIntensity:.57,fillAzimuth:300,fillAltitude:25,fillColor:"#cbd9e3",fillIntensity:.18},paint:{"landcover-wood":{color:"#62a63f"},"landcover-grass":{color:"#8dbf69"},"landcover-sand":{color:"#efeac8"},"landcover-ice":{color:"#b4c9d7"},"landcover-wetland":{color:"#75b7bd"},"landuse-residential":{color:"#d6d1c2"},"landuse-industrial":{color:"#b9bdd0"},"landuse-civic":{color:"#d9b5c1"},"landuse-sport":{color:"#8bc95e"},"landuse-cemetery":{color:"#95c374"},"landuse-parking":{color:"#c3c5bf"},park:{color:"#8dbf69"},"aeroway-area":{color:"#d6dbeb"},water:{color:"#4d97cb"},waterway:{color:"#599ecf"},"aeroway-line":{color:"#f0ede9"},"road-casing-major":{color:"#856b47"},"road-casing-secondary":{color:{stops:[[16,"#766b60"],[18.5,"#856b47"]]}},"road-casing-minor":{color:{stops:[[16,"#766b60"],[18.5,"#856b47"]]}},"road-rail":{color:"#666666"},"road-path":{color:"#9c948b"},"road-minor":{color:{stops:[[16,"#9c948b"],[18.5,"#ccaa66"]]}},"road-secondary":{color:{stops:[[16,"#9c948b"],[18.5,"#ccaa66"]]}},"road-ramp":{color:"#ccaa66"},"road-major":{color:"#ccaa66"},boundary:{color:"#8a735c"},building:{color:"#cdc4b7",roofColor:"#cdc4b7",aoStrength:.2,tintVariation:.07,windowColor:"#9fb0c0",windowFrameColor:"#eceef2",windowGlow:0},housenumber:{color:"#3b332b",haloColor:"#f5f5f0",haloWidth:1.4},poi:{color:"#735c45",haloColor:"#f5f5f0",haloWidth:1.4},"road-label":{color:"#3b332b",haloColor:"#f5f5f0",haloWidth:1.4},"water-label":{color:"#35688d",haloColor:"#f7f7f7",haloWidth:1.4},"place-label":{color:"#3b332b",haloColor:"#f5f5f0",haloWidth:1.4},"poi-food":{haloColor:"#f5f5f0",haloWidth:1.4,frameColor:"#c2681c",frameOpacity:1,frameHaloColor:"#f5f5f0",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{haloColor:"#f5f5f0",haloWidth:1.4,frameColor:"#2f77c4",frameOpacity:1,frameHaloColor:"#f5f5f0",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{haloColor:"#f5f5f0",haloWidth:1.4,frameColor:"#3b82a6",frameOpacity:1,frameHaloColor:"#f5f5f0",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{haloColor:"#f5f5f0",haloWidth:1.4,frameColor:"#c24444",frameOpacity:1,frameHaloColor:"#f5f5f0",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{haloColor:"#f5f5f0",haloWidth:1.4,frameColor:"#3f7f7a",frameOpacity:1,frameHaloColor:"#f5f5f0",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{haloColor:"#f5f5f0",haloWidth:1.4,frameColor:"#8b5aa5",frameOpacity:1,frameHaloColor:"#f5f5f0",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{haloColor:"#f5f5f0",haloWidth:1.4,frameColor:"#4f8b45",frameOpacity:1,frameHaloColor:"#f5f5f0",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{haloColor:"#f5f5f0",haloWidth:1.4,frameColor:"#7a5fbf",frameOpacity:1,frameHaloColor:"#f5f5f0",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{haloColor:"#f5f5f0",haloWidth:1.4,frameColor:"#59636e",frameOpacity:1,frameHaloColor:"#f5f5f0",iconColor:"#ffffff",iconHaloWidth:0},"water-pool":{color:"#559fd3"},"indoor-shell":{color:"#d6d0c9",opacity:.97},"indoor-corridor":{color:"#dad5ce"},"indoor-room":{color:"#cfc9c0"},"indoor-service":{color:"#beb6a9"},"indoor-shop":{color:"#bdb0ca"},"indoor-food":{color:"#cabeb0"},"indoor-wc":{color:"#b0c0ca"},"indoor-wall":{color:"#ada79e",roofColor:"#bfbbb6",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#a69bbd",opacity:.95},"indoor-door":{color:"#735c45",haloColor:"#f5f5f0",haloWidth:1.4},"indoor-poi":{color:"#735c45",haloColor:"#f5f5f0",haloWidth:1.4},"indoor-name":{color:"#3b332b",haloColor:"#f5f5f0",haloWidth:1.4},"building-entrance":{haloColor:"#f5f5f0"}},sky:{skyColor:"#5f92b7",horizonColor:"#bfc4b1",fogRange:[1.33,7.17],fogIntensity:.87,spaceColor:"#0d0e09",atmosphereColor:"#569dce",starIntensity:.44}};var Wi={name:"\u041A\u043E\u0441\u043C\u043E\u0441",background:"#0c0a1a",model3dKey:"night",light:{ambientColor:"#8c7fcb",ambientIntensity:.34,keyAzimuth:120,keyAltitude:55,keyColor:"#c0a8ff",keyIntensity:.28,fillAzimuth:300,fillAltitude:25,fillColor:"#475385",fillIntensity:.22},paint:{"landcover-wood":{color:"#241730"},"landcover-grass":{color:"#2e203c"},"landcover-sand":{color:"#292719"},"landcover-ice":{color:"#2e365b"},"landcover-wetland":{color:"#172526"},"landuse-residential":{color:"#110e20"},"landuse-industrial":{color:"#191b24"},"landuse-civic":{color:"#24191d"},"landuse-sport":{color:"#281c40"},"landuse-cemetery":{color:"#1c1721"},"landuse-parking":{color:"#27272b"},park:{color:"#2e203c"},"aeroway-area":{color:"#1c1f26"},water:{color:"#121c49"},waterway:{color:"#16225a"},"aeroway-line":{color:"#55493a"},"road-casing-major":{color:"#7e279b"},"road-casing-secondary":{color:{stops:[[16,"#3a2060"],[18.5,"#7e279b"]]}},"road-casing-minor":{color:{stops:[[16,"#3a2060"],[18.5,"#7e279b"]]}},"road-rail":{color:"#985298"},"road-path":{color:"#6b35b6"},"road-minor":{color:{stops:[[16,"#6b35b6"],[18.5,"#bf4ce6"]]}},"road-secondary":{color:{stops:[[16,"#6b35b6"],[18.5,"#bf4ce6"]]}},"road-ramp":{color:"#bf4ce6"},"road-major":{color:"#bf4ce6"},boundary:{color:"#ec51b8"},building:{color:"#2a2145",roofColor:"#7f30a6",aoStrength:.29,tintVariation:.1,windowColor:"#84dcff",windowFrameColor:"#9fb0d8",windowGlow:.5},housenumber:{color:"#dbd1f0",haloColor:"#080614",haloWidth:1.4},poi:{color:"#d186ea",haloColor:"#080614",haloWidth:1.4},"road-label":{color:"#dbd1f0",haloColor:"#080614",haloWidth:1.4},"water-label":{color:"#9fbcd1",haloColor:"#131b20",haloWidth:1.4},"place-label":{color:"#dbd1f0",haloColor:"#080614",haloWidth:1.4},"poi-food":{color:"#d89964",haloColor:"#080614",haloWidth:1.4,frameColor:"#d89964",frameOpacity:1,frameHaloColor:"#080614",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-shop":{color:"#699cd4",haloColor:"#080614",haloWidth:1.4,frameColor:"#699cd4",frameOpacity:1,frameHaloColor:"#080614",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-transport":{color:"#75acc8",haloColor:"#080614",haloWidth:1.4,frameColor:"#75acc8",frameOpacity:1,frameHaloColor:"#080614",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-health":{color:"#ca7272",haloColor:"#080614",haloWidth:1.4,frameColor:"#ca7272",frameOpacity:1,frameHaloColor:"#080614",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-education":{color:"#81bbb7",haloColor:"#080614",haloWidth:1.4,frameColor:"#81bbb7",frameOpacity:1,frameHaloColor:"#080614",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-culture":{color:"#a684b8",haloColor:"#080614",haloWidth:1.4,frameColor:"#a684b8",frameOpacity:1,frameHaloColor:"#080614",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-sport":{color:"#89bb81",haloColor:"#080614",haloWidth:1.4,frameColor:"#89bb81",frameOpacity:1,frameHaloColor:"#080614",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-lodging":{color:"#8e79c3",haloColor:"#080614",haloWidth:1.4,frameColor:"#8e79c3",frameOpacity:1,frameHaloColor:"#080614",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-service":{color:"#959ea7",haloColor:"#080614",haloWidth:1.4,frameColor:"#959ea7",frameOpacity:1,frameHaloColor:"#080614",iconColor:"#1b1b1b",iconHaloWidth:0},"water-pool":{color:"#152466"},"indoor-shell":{color:"#403956",opacity:.97},"indoor-corridor":{color:"#3c3550"},"indoor-room":{color:"#484060"},"indoor-service":{color:"#5c527b"},"indoor-shop":{color:"#5c4672"},"indoor-food":{color:"#725d46"},"indoor-wc":{color:"#466172"},"indoor-wall":{color:"#6f6885",roofColor:"#8a859a",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#66558a",opacity:.95},"indoor-door":{color:"#d186ea",haloColor:"#080614",haloWidth:1.4},"indoor-poi":{color:"#d186ea",haloColor:"#080614",haloWidth:1.4},"indoor-name":{color:"#dbd1f0",haloColor:"#080614",haloWidth:1.4},"building-entrance":{color:"#79a0d7",haloColor:"#080614"}},sky:{skyColor:"#080b18",horizonColor:"#1d1931",fogRange:[1.3,6.5],fogIntensity:.9,spaceColor:"#040308",atmosphereColor:"#354cb6",starIntensity:.82}};var Bi={name:"\u0412\u0443\u043B\u043A\u0430\u043D",background:"#29211e",model3dKey:"night",light:{ambientColor:"#b6a6a1",ambientIntensity:.35,keyAzimuth:120,keyAltitude:55,keyColor:"#ffb070",keyIntensity:.29,fillAzimuth:300,fillAltitude:25,fillColor:"#8b604b",fillIntensity:.22},paint:{"landcover-wood":{color:"#31241c"},"landcover-grass":{color:"#392e22"},"landcover-sand":{color:"#403c26"},"landcover-ice":{color:"#aa6b4b"},"landcover-wetland":{color:"#243b3d"},"landuse-residential":{color:"#2f2623"},"landuse-industrial":{color:"#282b39"},"landuse-civic":{color:"#39282e"},"landuse-sport":{color:"#3e2e1e"},"landuse-cemetery":{color:"#362e26"},"landuse-parking":{color:"#3e3938"},park:{color:"#392e22"},"aeroway-area":{color:"#2b2f3b"},water:{color:"#8b3f18"},waterway:{color:"#9c461c"},"aeroway-line":{color:"#55493a"},"road-casing-major":{color:"#aa350e"},"road-casing-secondary":{color:{stops:[[16,"#712b14"],[18.5,"#aa350e"]]}},"road-casing-minor":{color:{stops:[[16,"#712b14"],[18.5,"#aa350e"]]}},"road-rail":{color:"#8f583d"},"road-path":{color:"#e65e19"},"road-minor":{color:{stops:[[16,"#e65e19"],[18.5,"#f98c1f"]]}},"road-secondary":{color:{stops:[[16,"#e65e19"],[18.5,"#f98c1f"]]}},"road-ramp":{color:"#f98c1f"},"road-major":{color:"#f98c1f"},boundary:{color:"#f48c25"},building:{color:"#422b24",roofColor:"#c1551f",aoStrength:.28,tintVariation:.09,windowColor:"#84dcff",windowFrameColor:"#d8b0a0",windowGlow:.5},housenumber:{color:"#f3e0ce",haloColor:"#150b09",haloWidth:1.4},poi:{color:"#f09e4c",haloColor:"#150b09",haloWidth:1.4},"road-label":{color:"#f3e0ce",haloColor:"#150b09",haloWidth:1.4},"water-label":{color:"#9fbcd1",haloColor:"#131b20",haloWidth:1.4},"place-label":{color:"#f3e0ce",haloColor:"#150b09",haloWidth:1.4},"poi-food":{color:"#d89964",haloColor:"#150b09",haloWidth:1.4,frameColor:"#d89964",frameOpacity:1,frameHaloColor:"#150b09",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-shop":{color:"#699cd4",haloColor:"#150b09",haloWidth:1.4,frameColor:"#699cd4",frameOpacity:1,frameHaloColor:"#150b09",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-transport":{color:"#75acc8",haloColor:"#150b09",haloWidth:1.4,frameColor:"#75acc8",frameOpacity:1,frameHaloColor:"#150b09",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-health":{color:"#ca7272",haloColor:"#150b09",haloWidth:1.4,frameColor:"#ca7272",frameOpacity:1,frameHaloColor:"#150b09",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-education":{color:"#81bbb7",haloColor:"#150b09",haloWidth:1.4,frameColor:"#81bbb7",frameOpacity:1,frameHaloColor:"#150b09",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-culture":{color:"#a684b8",haloColor:"#150b09",haloWidth:1.4,frameColor:"#a684b8",frameOpacity:1,frameHaloColor:"#150b09",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-sport":{color:"#89bb81",haloColor:"#150b09",haloWidth:1.4,frameColor:"#89bb81",frameOpacity:1,frameHaloColor:"#150b09",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-lodging":{color:"#8e79c3",haloColor:"#150b09",haloWidth:1.4,frameColor:"#8e79c3",frameOpacity:1,frameHaloColor:"#150b09",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-service":{color:"#959ea7",haloColor:"#150b09",haloWidth:1.4,frameColor:"#959ea7",frameOpacity:1,frameHaloColor:"#150b09",iconColor:"#1b1b1b",iconHaloWidth:0},"water-pool":{color:"#c2531a"},"indoor-shell":{color:"#564039",opacity:.97},"indoor-corridor":{color:"#503b35"},"indoor-room":{color:"#604840"},"indoor-service":{color:"#7b5c52"},"indoor-shop":{color:"#5c4672"},"indoor-food":{color:"#725d46"},"indoor-wc":{color:"#466172"},"indoor-wall":{color:"#856f68",roofColor:"#9a8a85",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#66558a",opacity:.95},"indoor-door":{color:"#f09e4c",haloColor:"#150b09",haloWidth:1.4},"indoor-poi":{color:"#f09e4c",haloColor:"#150b09",haloWidth:1.4},"indoor-name":{color:"#f3e0ce",haloColor:"#150b09",haloWidth:1.4},"building-entrance":{color:"#79a0d7",haloColor:"#150b09"}},sky:{skyColor:"#1c100a",horizonColor:"#312a27",fogRange:[1.3,6.52],fogIntensity:.9,spaceColor:"#070605",atmosphereColor:"#ba6336",starIntensity:.78}};var Vi={name:"\u0411\u0435\u043B\u0430\u044F",background:"#f5f1f0",light:{ambientColor:"#fafafa",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#ffffff",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#dee8ed",fillIntensity:.18},paint:{"landcover-wood":{color:"#a7e2a2"},"landcover-grass":{color:"#b8ebad"},"landcover-sand":{color:"#efeac8"},"landcover-ice":{color:"#d7eaf4"},"landcover-wetland":{color:"#c1dee1"},"landuse-residential":{color:"#f6f4f4"},"landuse-industrial":{color:"#e0e2eb"},"landuse-civic":{color:"#efe1e6"},"landuse-sport":{color:"#c0f0a8"},"landuse-cemetery":{color:"#c8e5c2"},"landuse-parking":{color:"#e4e2e2"},park:{color:"#b8ebad"},"aeroway-area":{color:"#d6dbeb"},water:{color:"#99ddff"},waterway:{color:"#99ddff"},"aeroway-line":{color:"#f0ede9"},"road-casing-major":{color:"#94a0b8"},"road-casing-secondary":{color:{stops:[[16,"#a3adc2"],[18.5,"#94a0b8"]]}},"road-casing-minor":{color:{stops:[[16,"#a3adc2"],[18.5,"#94a0b8"]]}},"road-rail":{color:"#a6a6a6"},"road-path":{color:"#bfc6d9"},"road-minor":{color:{stops:[[16,"#bfc6d9"],[18.5,"#a1b0c4"]]}},"road-secondary":{color:{stops:[[16,"#bfc6d9"],[18.5,"#a1b0c4"]]}},"road-ramp":{color:"#a1b0c4"},"road-major":{color:"#a1b0c4"},boundary:{color:"#f87797"},building:{color:"#ffffff",roofColor:"#ffffff",aoStrength:.19,tintVariation:.06,windowColor:"#6b9ed1",windowFrameColor:"#ffffff",windowGlow:0},housenumber:{color:"#262626",haloColor:"#ffffff",haloWidth:1.4},poi:{color:"#586e84",haloColor:"#ffffff",haloWidth:1.4},"road-label":{color:"#262626",haloColor:"#ffffff",haloWidth:1.4},"water-label":{color:"#35688d",haloColor:"#f7f7f7",haloWidth:1.4},"place-label":{color:"#262626",haloColor:"#ffffff",haloWidth:1.4},"poi-food":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#c2681c",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#2f77c4",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#3b82a6",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#c24444",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#3f7f7a",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#8b5aa5",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#4f8b45",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#7a5fbf",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#59636e",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"water-pool":{color:"#b1e5ff"},"indoor-shell":{color:"#f7f7f7",opacity:.97},"indoor-corridor":{color:"#fbfbfb"},"indoor-room":{color:"#efefef"},"indoor-service":{color:"#dbdbdb"},"indoor-shop":{color:"#e4dfea"},"indoor-food":{color:"#eae4df"},"indoor-wc":{color:"#dfe5ea"},"indoor-wall":{color:"#cdcdcd",roofColor:"#e2e2e2",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#d0cbdc",opacity:.95},"indoor-door":{color:"#586e84",haloColor:"#ffffff",haloWidth:1.4},"indoor-poi":{color:"#586e84",haloColor:"#ffffff",haloWidth:1.4},"indoor-name":{color:"#262626",haloColor:"#ffffff",haloWidth:1.4},"building-entrance":{color:"#225aaa",haloColor:"#ffffff"}},sky:{skyColor:"#9bbecf",horizonColor:"#e5dfdc",fogRange:[1.35,7.4],fogIntensity:.85,spaceColor:"#0f0c0a",atmosphereColor:"#5eaad0",starIntensity:.38}};var Di={"3d":wi,cartoon:xi,cyberpunk:_i,dawn:Ci,dusk:Si,earth:Mi,future:Ti,"glass-refined":ki,glass:Ei,"harmony-black":Ai,"harmony-blue":Li,"harmony-green":Ii,lunar:Fi,matte:Ri,minimal:zi,ocean:Pi,premium:Hi,realistic:Oi,space:Wi,volcano:Bi,white:Vi};function wo(i,e){let t=new Set(e.hidden??[]),o=i.layers.map(r=>{let n=e.paint?.[r.id],a={...r,paint:n?{...r.paint,...n}:{...r.paint}};return t.has(r.id)&&(a.visible=false),a});if(e.paint)for(let r of Object.keys(e.paint))i.layers.some(n=>n.id===r)||console.warn(`[osmgl] \u0442\u0435\u043C\u0430 \xAB${e.name}\xBB: \u0432 \u0431\u0430\u0437\u043E\u0432\u043E\u043C \u0441\u0442\u0438\u043B\u0435 \u043D\u0435\u0442 \u0441\u043B\u043E\u044F \xAB${r}\xBB`);return {...i,name:e.name,background:e.background??i.background,light:{...i.light,...e.light},sky:{...i.sky,...e.sky},model3dKey:e.model3dKey??i.model3dKey,layers:o}}var K="base",Gi="\u241F",ze=(i,e)=>i+"\u241F"+String(e);var ut=class{constructor(e=gr){this.splitValues={};this.spec=e,this.light={...yr,...e.light??{}},this.sky={...br,...e.sky??{}},this.layers=e.layers.map(t=>({...t,paint:{...t.paint}}));}get background(){return he(this.spec.background??"#eceae4")}colorAt(e,t,o=[1,0,1,1]){let n=e.paint?.color;if(n&&typeof n=="object"&&"from"in n){let l=this.layers.find(f=>f.id===n.from)?.paint?.color,s=Ee(l,t,o),c=1-Math.min(Math.max(n.darken??0,0),1);return [s[0]*c,s[1]*c,s[2]*c,s[3]]}return Ee(n,t,o)}layerVisibleAt(e,t){return !(e.visible===false||e.minzoom!==void 0&&t<e.minzoom||e.maxzoom!==void 0&&t>=e.maxzoom)}workerPlan(e=K){return this.layers.filter(t=>t.type!=="raster").filter(t=>(t.source??K)===e).map(t=>({id:t.id,type:t.type,sourceLayer:t["source-layer"],filter:t.filter,minzoom:t.minzoom??0,maxzoom:t.maxzoom??24,...t.splitBy?{splitBy:t.splitBy}:{},...t.type==="line"&&t.network?{network:t.network}:{},...t.cornerRadius?{cornerRadius:t.cornerRadius,cornerSegments:t.cornerSegments}:{},...t.clipToTile?{clipToTile:true}:{},...t.groundBy?{groundBy:t.groundBy}:{},...t.type==="surface"?{elevation:t.elevation,base:t.base,bevel:t.bevel,bevelDrop:t.bevelDrop,weld:t.weld}:{},...t.type==="line"&&typeof t.paint?.elevation=="number"&&t.paint.elevation>0?{ground:true}:{},...t.type==="symbol"?{textField:t.layout?.textField,iconImage:t.layout?.iconImage,iconRotate:t.layout?.iconRotate,textPlacement:t.layout?.textPlacement,abbreviate:t.layout?.abbreviate}:{}}))}usedSources(){return [...new Set(this.layers.map(e=>e.source??K))]}bucketKeyFor(e){if(e.type==="raster"||!e.splitBy)return e.id;let t=this.splitValues[e.splitBy];return t===void 0?null:ze(e.id,t)}sourceLayers(){return [...new Set(this.layers.flatMap(e=>e.type==="raster"?[]:[e["source-layer"]]))]}},gr=di,nc=mi,ic=pi,ac=bi,ht={day:{name:"\u0414\u043D\u0435\u0432\u043D\u0430\u044F"},night:yi,mono:gi,pale:vi,...Di};function xo(i,e=gr){if(typeof i!="string")return wo(e,i);if(i==="day")return e;let t=ht[i];return t?wo(e,t):(console.warn(`[osmgl] \u043D\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043D\u0430\u044F \u0442\u0435\u043C\u0430 \xAB${i}\xBB; \u0434\u043E\u0441\u0442\u0443\u043F\u043D\u044B: ${Object.keys(ht).join(", ")}`),e)}var It=class{constructor(e,t){this.ctx=e;let o=e.gl;this._size=t;let r=o.createTexture(),n=o.createFramebuffer();if(!r||!n)throw new Error("[osmgl] \u043D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u0441\u043E\u0437\u0434\u0430\u0442\u044C \u0446\u0435\u043B\u044C \u0433\u043B\u0443\u0431\u0438\u043D\u044B");this.texture=r,this.framebuffer=n,e.bindTexture(7,r),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_MIN_FILTER,o.LINEAR),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_MAG_FILTER,o.LINEAR),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_WRAP_S,o.CLAMP_TO_EDGE),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_WRAP_T,o.CLAMP_TO_EDGE),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_COMPARE_MODE,o.COMPARE_REF_TO_TEXTURE),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_COMPARE_FUNC,o.LEQUAL),this.allocate(t),o.bindFramebuffer(o.FRAMEBUFFER,n),o.framebufferTexture2D(o.FRAMEBUFFER,o.DEPTH_ATTACHMENT,o.TEXTURE_2D,r,0),o.drawBuffers([o.NONE]),o.readBuffer(o.NONE);let a=o.checkFramebufferStatus(o.FRAMEBUFFER);if(o.bindFramebuffer(o.FRAMEBUFFER,null),e.bindTexture(7,null),a!==o.FRAMEBUFFER_COMPLETE)throw new Error(`[osmgl] \u0446\u0435\u043B\u044C \u0433\u043B\u0443\u0431\u0438\u043D\u044B \u043D\u0435 \u0441\u043E\u0431\u0440\u0430\u043B\u0430\u0441\u044C: 0x${a.toString(16)}`)}get size(){return this._size}resize(e){e!==this._size&&(this._size=e,this.ctx.bindTexture(7,this.texture),this.allocate(e),this.ctx.bindTexture(7,null));}bind(){let e=this.ctx.gl;this.ctx.bindFramebuffer(this.framebuffer),this.ctx.viewport(0,0,this._size,this._size),this.ctx.setDepthTest(true),this.ctx.setDepthMask(true),e.clear(e.DEPTH_BUFFER_BIT);}bindTexture(e){this.ctx.bindTexture(e,this.texture);}allocate(e){let t=this.ctx.gl;t.texImage2D(t.TEXTURE_2D,0,t.DEPTH_COMPONENT24,e,e,0,t.DEPTH_COMPONENT,t.UNSIGNED_INT,null);}destroy(){this.ctx.gl.deleteFramebuffer(this.framebuffer),this.ctx.gl.deleteTexture(this.texture);}};function Ni(i){let e=i.gl,t=e.createTexture();if(!t)throw new Error("[osmgl] \u043D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u0441\u043E\u0437\u0434\u0430\u0442\u044C \u0437\u0430\u0433\u043B\u0443\u0448\u043A\u0443 \u043A\u0430\u0440\u0442\u044B \u0442\u0435\u043D\u0435\u0439");return i.bindTexture(7,t),e.texImage2D(e.TEXTURE_2D,0,e.DEPTH_COMPONENT24,1,1,0,e.DEPTH_COMPONENT,e.UNSIGNED_INT,new Uint32Array([4294967295])),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.NEAREST),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.NEAREST),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_COMPARE_MODE,e.COMPARE_REF_TO_TEXTURE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_COMPARE_FUNC,e.LEQUAL),i.bindTexture(7,null),t}var Ft=`
|
|
9
9
|
uniform vec3 u_ambient_color;
|
|
10
10
|
uniform float u_ambient_intensity;
|
|
11
11
|
uniform vec3 u_key_dir; // \u043A\u0443\u0434\u0430 \u043B\u0435\u0442\u0438\u0442 \u0441\u0432\u0435\u0442 \u043A\u043B\u044E\u0447\u0435\u0432\u043E\u0433\u043E \u0438\u0441\u0442\u043E\u0447\u043D\u0438\u043A\u0430
|
|
@@ -68,7 +68,7 @@ vec3 applyLightWithFactor(vec3 albedo, vec3 normal, float keyFactor) {
|
|
|
68
68
|
vec3 applyLight(vec3 albedo, vec3 normal) {
|
|
69
69
|
return applyLightWithFactor(albedo, normal, max(dot(normal, -u_key_dir), 0.0));
|
|
70
70
|
}
|
|
71
|
-
`,
|
|
71
|
+
`,_o=`
|
|
72
72
|
// \u0423 \u0441\u0440\u0430\u0432\u043D\u0438\u0432\u0430\u044E\u0449\u0435\u0433\u043E \u0441\u044D\u043C\u043F\u043B\u0435\u0440\u0430 \u0432 GLSL ES 3.00 \u041D\u0415\u0422 \u0442\u043E\u0447\u043D\u043E\u0441\u0442\u0438 \u043F\u043E \u0443\u043C\u043E\u043B\u0447\u0430\u043D\u0438\u044E (\u0432 \u043E\u0442\u043B\u0438\u0447\u0438\u0435
|
|
73
73
|
// \u043E\u0442 \u043E\u0431\u044B\u0447\u043D\u043E\u0433\u043E sampler2D \u0432\u043E \u0444\u0440\u0430\u0433\u043C\u0435\u043D\u0442\u0435) \u2014 \u0431\u0435\u0437 \u044D\u0442\u043E\u0439 \u0441\u0442\u0440\u043E\u043A\u0438 \u0448\u0435\u0439\u0434\u0435\u0440 \u043D\u0435 \u043A\u043E\u043C\u043F\u0438\u043B\u0438\u0440\u0443\u0435\u0442\u0441\u044F.
|
|
74
74
|
precision highp sampler2DShadow;
|
|
@@ -129,7 +129,7 @@ float shadowOcclusion(float ndotl) {
|
|
|
129
129
|
|
|
130
130
|
return (1.0 - lit * 0.25) * u_shadow_params.x;
|
|
131
131
|
}
|
|
132
|
-
`,
|
|
132
|
+
`,vr=`
|
|
133
133
|
uniform int u_material; // 0 \u2014 \u043D\u0435\u0442, 1 \u0432\u043E\u0434\u0430, 2 \u0437\u0435\u043B\u0435\u043D\u044C, 3 \u043F\u0435\u0441\u043E\u043A, 4 \u0430\u0441\u0444\u0430\u043B\u044C\u0442
|
|
134
134
|
uniform vec4 u_material_params; // x: \u0441\u0438\u043B\u0430, y: \u043C\u0430\u0441\u0448\u0442\u0430\u0431 (\u043C), z: \u0441\u043A\u043E\u0440\u043E\u0441\u0442\u044C, w: \u0432\u0440\u0435\u043C\u044F (\u0441)
|
|
135
135
|
|
|
@@ -238,7 +238,7 @@ vec3 applyMaterial(vec3 color, vec2 world) {
|
|
|
238
238
|
|
|
239
239
|
return mix(color, shaded, strength);
|
|
240
240
|
}
|
|
241
|
-
`,
|
|
241
|
+
`,Ui=`
|
|
242
242
|
uniform vec4 u_globe; // x: \u0432\u043A\u043B, y: \u0434\u043E\u043B\u044F \u043F\u043B\u043E\u0441\u043A\u043E\u0439 \u043A\u0430\u0440\u0442\u044B, z: \u0440\u0430\u0434\u0438\u0443\u0441, w: worldSize
|
|
243
243
|
uniform vec2 u_globe_center; // \u0446\u0435\u043D\u0442\u0440 \u043A\u0430\u0440\u0442\u044B \u0432 \u043D\u043E\u0440\u043C\u0430\u043B\u0438\u0437\u043E\u0432\u0430\u043D\u043D\u043E\u043C \u043C\u0435\u0440\u043A\u0430\u0442\u043E\u0440\u0435
|
|
244
244
|
uniform vec4 u_globe_cam; // xyz: \u043D\u0430\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u0435 \u043D\u0430 \u043A\u0430\u043C\u0435\u0440\u0443 \u043E\u0442 \u0446\u0435\u043D\u0442\u0440\u0430 \u0448\u0430\u0440\u0430, w: \u043A\u043E\u0441\u0438\u043D\u0443\u0441 \u0443\u0433\u043B\u0430 \u0434\u043E \u0433\u043E\u0440\u0438\u0437\u043E\u043D\u0442\u0430
|
|
@@ -291,7 +291,7 @@ vec3 globeLocal(vec2 tilePos) {
|
|
|
291
291
|
|
|
292
292
|
return mix(sphere, flat_pos, u_globe.y);
|
|
293
293
|
}
|
|
294
|
-
`,
|
|
294
|
+
`,ji=`#version 300 es
|
|
295
295
|
precision highp float;
|
|
296
296
|
|
|
297
297
|
in vec2 a_lnglat; // \u0440\u0430\u0434\u0438\u0430\u043D\u044B: \u0434\u043E\u043B\u0433\u043E\u0442\u0430, \u0448\u0438\u0440\u043E\u0442\u0430
|
|
@@ -315,7 +315,7 @@ void main() {
|
|
|
315
315
|
vec3 n = u_globe_basis * unit;
|
|
316
316
|
v_rim = 1.0 - clamp(n.z, 0.0, 1.0);
|
|
317
317
|
}
|
|
318
|
-
`,
|
|
318
|
+
`,Xi=`#version 300 es
|
|
319
319
|
precision highp float;
|
|
320
320
|
|
|
321
321
|
in float v_rim;
|
|
@@ -331,17 +331,17 @@ void main() {
|
|
|
331
331
|
float rim = pow(v_rim, 6.0) * u_atmo_strength;
|
|
332
332
|
fragColor = vec4(mix(u_body_color, u_atmo_color, clamp(rim, 0.0, 1.0)), 1.0);
|
|
333
333
|
}
|
|
334
|
-
`,
|
|
334
|
+
`,Yi=`#version 300 es
|
|
335
335
|
precision highp float;
|
|
336
336
|
in vec2 a_pos; // 0..1, \u043E\u0431\u0449\u0438\u0439 \u043A\u0432\u0430\u0434\u0440\u0430\u0442
|
|
337
337
|
uniform float u_center_depth; // NDC-\u0433\u043B\u0443\u0431\u0438\u043D\u0430 \u0446\u0435\u043D\u0442\u0440\u0430 \u0448\u0430\u0440\u0430
|
|
338
338
|
void main() {
|
|
339
339
|
gl_Position = vec4(a_pos * 2.0 - 1.0, u_center_depth, 1.0);
|
|
340
340
|
}
|
|
341
|
-
`,
|
|
341
|
+
`,Ki=`#version 300 es
|
|
342
342
|
precision highp float;
|
|
343
343
|
void main() {}
|
|
344
|
-
|
|
344
|
+
`,$i=`#version 300 es
|
|
345
345
|
precision highp float;
|
|
346
346
|
in vec2 a_pos;
|
|
347
347
|
in float a_height; // \u043C\u0435\u0442\u0440\u044B \xD7 4, \u043A\u0430\u043A \u0443 \u0437\u0434\u0430\u043D\u0438\u0439
|
|
@@ -350,10 +350,10 @@ uniform float u_height_scale;
|
|
|
350
350
|
void main() {
|
|
351
351
|
gl_Position = u_matrix * vec4(a_pos, (a_height / 4.0) * u_height_scale, 1.0);
|
|
352
352
|
}
|
|
353
|
-
`,
|
|
353
|
+
`,wr=`#version 300 es
|
|
354
354
|
precision highp float;
|
|
355
355
|
void main() {}
|
|
356
|
-
`,
|
|
356
|
+
`,je=`
|
|
357
357
|
uniform vec3 u_fog_color;
|
|
358
358
|
uniform vec3 u_fog_range; // x: \u043D\u0430\u0447\u0430\u043B\u043E, y: \u043A\u043E\u043D\u0435\u0446 (\u043C\u0438\u0440\u043E\u0432\u044B\u0435 \u043F\u0438\u043A\u0441\u0435\u043B\u0438), z: \u043F\u0440\u0435\u0434\u0435\u043B \u0441\u0438\u043B\u044B
|
|
359
359
|
|
|
@@ -376,7 +376,7 @@ vec4 applyFogPremultiplied(vec4 color) {
|
|
|
376
376
|
vec3 applyFog(vec3 color) {
|
|
377
377
|
return mix(color, u_fog_color, fogAmount());
|
|
378
378
|
}
|
|
379
|
-
`,
|
|
379
|
+
`,qi=`#version 300 es
|
|
380
380
|
precision highp float;
|
|
381
381
|
|
|
382
382
|
in vec3 a_pos;
|
|
@@ -449,7 +449,7 @@ void main() {
|
|
|
449
449
|
// \u043F\u043E\u044D\u0442\u043E\u043C\u0443 \u043E\u043D\u0430 \u0436\u0435 \u0433\u043E\u0434\u0438\u0442\u0441\u044F \u0438 \u0434\u043B\u044F \u0432\u0435\u043A\u0442\u043E\u0440\u0430 \u0432\u0437\u0433\u043B\u044F\u0434\u0430.
|
|
450
450
|
v_view = u_normal_matrix * (u_camera_model - a_pos);
|
|
451
451
|
}
|
|
452
|
-
`,
|
|
452
|
+
`,Zi=`#version 300 es
|
|
453
453
|
precision highp float;
|
|
454
454
|
|
|
455
455
|
in vec3 a_pos;
|
|
@@ -513,12 +513,12 @@ void main() {
|
|
|
513
513
|
v_nmodel = a_normal;
|
|
514
514
|
v_view = n * (u_camera_model - a_pos);
|
|
515
515
|
}
|
|
516
|
-
`,
|
|
516
|
+
`,xr=`#version 300 es
|
|
517
517
|
precision highp float;
|
|
518
518
|
|
|
519
|
-
${
|
|
520
|
-
${
|
|
521
|
-
${
|
|
519
|
+
${Ft}
|
|
520
|
+
${_o}
|
|
521
|
+
${je}
|
|
522
522
|
|
|
523
523
|
in vec3 v_normal;
|
|
524
524
|
in vec2 v_tex;
|
|
@@ -797,14 +797,14 @@ void main() {
|
|
|
797
797
|
float alpha = albedo.a * u_opacity;
|
|
798
798
|
fragColor = vec4(applyFog(color) * alpha, alpha);
|
|
799
799
|
}
|
|
800
|
-
`,
|
|
800
|
+
`,Qi=`#version 300 es
|
|
801
801
|
precision highp float;
|
|
802
802
|
in vec3 a_pos;
|
|
803
803
|
uniform mat4 u_matrix;
|
|
804
804
|
void main() {
|
|
805
805
|
gl_Position = u_matrix * vec4(a_pos, 1.0);
|
|
806
806
|
}
|
|
807
|
-
`,
|
|
807
|
+
`,Ji=`#version 300 es
|
|
808
808
|
precision highp float;
|
|
809
809
|
in vec2 a_pos; // 0..1, \u0442\u043E\u0442 \u0436\u0435 \u043A\u0432\u0430\u0434\u0440\u0430\u0442, \u0447\u0442\u043E \u0443 \u0442\u0435\u043D\u0438 \u043D\u0430 \u0437\u0435\u043C\u043B\u0435
|
|
810
810
|
|
|
@@ -823,7 +823,7 @@ void main() {
|
|
|
823
823
|
v_ray = mix(mix(u_ray_bl, u_ray_br, a_pos.x), mix(u_ray_tl, u_ray_tr, a_pos.x), a_pos.y);
|
|
824
824
|
gl_Position = vec4(a_pos * 2.0 - 1.0, 0.999, 1.0);
|
|
825
825
|
}
|
|
826
|
-
`,
|
|
826
|
+
`,ea=`#version 300 es
|
|
827
827
|
precision highp float;
|
|
828
828
|
|
|
829
829
|
in vec2 v_uv;
|
|
@@ -912,7 +912,7 @@ void main() {
|
|
|
912
912
|
|
|
913
913
|
fragColor = vec4(sky * alpha, alpha);
|
|
914
914
|
}
|
|
915
|
-
`,
|
|
915
|
+
`,ta=`#version 300 es
|
|
916
916
|
precision highp float;
|
|
917
917
|
|
|
918
918
|
in vec2 a_pos; // \u0443\u0433\u043E\u043B \u043A\u0432\u0430\u0434\u0440\u0430\u0442\u0430 \u0442\u0430\u0439\u043B\u0430, 0..1
|
|
@@ -930,10 +930,10 @@ void main() {
|
|
|
930
930
|
v_uv = u_uv_transform.xy + a_pos * u_uv_transform.z;
|
|
931
931
|
gl_Position = u_matrix * vec4(a_pos, 0.0, 1.0);
|
|
932
932
|
}
|
|
933
|
-
`,
|
|
933
|
+
`,oa=`#version 300 es
|
|
934
934
|
precision highp float;
|
|
935
935
|
|
|
936
|
-
${
|
|
936
|
+
${je}
|
|
937
937
|
|
|
938
938
|
in vec2 v_uv;
|
|
939
939
|
|
|
@@ -948,7 +948,7 @@ void main() {
|
|
|
948
948
|
// \u043A\u0430\u043C\u0435\u0440\u0435 \u0434\u0430\u043B\u0451\u043A\u0438\u0439 \u0440\u0430\u0441\u0442\u0440 \u043E\u0441\u0442\u0430\u0451\u0442\u0441\u044F \u0447\u0451\u0442\u043A\u0438\u043C \u0442\u0430\u043C, \u0433\u0434\u0435 \u0432\u0441\u0451 \u043E\u0441\u0442\u0430\u043B\u044C\u043D\u043E\u0435 \u0443\u0436\u0435 \u0437\u0430\u0442\u044F\u043D\u0443\u0442\u043E.
|
|
949
949
|
fragColor = applyFogPremultiplied(vec4(color.rgb * color.a, color.a)) * u_opacity;
|
|
950
950
|
}
|
|
951
|
-
`,
|
|
951
|
+
`,ra=`#version 300 es
|
|
952
952
|
precision highp float;
|
|
953
953
|
in vec2 a_pos; // \u0443\u0433\u043E\u043B \u043A\u0432\u0430\u0434\u0440\u0430\u0442\u0430 \u0442\u0430\u0439\u043B\u0430, 0..1
|
|
954
954
|
uniform mat4 u_matrix;
|
|
@@ -959,11 +959,11 @@ void main() {
|
|
|
959
959
|
gl_Position = u_matrix * local;
|
|
960
960
|
v_shadow = u_shadow_matrix * local;
|
|
961
961
|
}
|
|
962
|
-
`,
|
|
962
|
+
`,na=`#version 300 es
|
|
963
963
|
precision highp float;
|
|
964
964
|
|
|
965
|
-
${
|
|
966
|
-
${
|
|
965
|
+
${_o}
|
|
966
|
+
${je}
|
|
967
967
|
|
|
968
968
|
uniform vec3 u_shadow_ground; // \u0432\u043E \u0447\u0442\u043E \u043F\u0440\u0435\u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044F \u043E\u0441\u0432\u0435\u0449\u0451\u043D\u043D\u044B\u0439 \u0446\u0432\u0435\u0442 \u0432 \u0442\u0435\u043D\u0438
|
|
969
969
|
uniform float u_ground_ndotl; // \u0441\u0438\u043D\u0443\u0441 \u0432\u044B\u0441\u043E\u0442\u044B \u0441\u043E\u043B\u043D\u0446\u0430: \u0437\u0435\u043C\u043B\u044F \u0433\u043E\u0440\u0438\u0437\u043E\u043D\u0442\u0430\u043B\u044C\u043D\u0430
|
|
@@ -975,10 +975,10 @@ void main() {
|
|
|
975
975
|
float occlusion = shadowOcclusion(u_ground_ndotl) * (1.0 - fogAmount());
|
|
976
976
|
fragColor = vec4(mix(vec3(1.0), u_shadow_ground, occlusion), 1.0);
|
|
977
977
|
}
|
|
978
|
-
`,
|
|
978
|
+
`,ia=`#version 300 es
|
|
979
979
|
precision highp float;
|
|
980
980
|
|
|
981
|
-
${
|
|
981
|
+
${Ui}
|
|
982
982
|
|
|
983
983
|
in vec2 a_pos;
|
|
984
984
|
uniform mat4 u_matrix;
|
|
@@ -1000,12 +1000,12 @@ void main() {
|
|
|
1000
1000
|
// \u043D\u0435 \u043F\u043E\u043F\u0430\u0434\u0430\u043B \u2014 \u0443 \u043B\u0438\u043D\u0438\u0439 \u0438 \u043F\u043E\u0432\u0435\u0440\u0445\u043D\u043E\u0441\u0442\u0435\u0439 \u044D\u0442\u043E \u0441\u0434\u0435\u043B\u0430\u043D\u043E, \u0443 \u0437\u0430\u043B\u0438\u0432\u043A\u0438 \u0437\u0430\u0431\u044B\u043B\u043E\u0441\u044C.
|
|
1001
1001
|
v_world = u_world_origin + a_pos * u_meters_per_unit;
|
|
1002
1002
|
}
|
|
1003
|
-
|
|
1003
|
+
`,aa=`#version 300 es
|
|
1004
1004
|
precision highp float;
|
|
1005
1005
|
|
|
1006
|
-
${
|
|
1007
|
-
${
|
|
1008
|
-
${
|
|
1006
|
+
${je}
|
|
1007
|
+
${Ft}
|
|
1008
|
+
${vr}
|
|
1009
1009
|
|
|
1010
1010
|
in vec2 v_world;
|
|
1011
1011
|
|
|
@@ -1022,10 +1022,10 @@ void main() {
|
|
|
1022
1022
|
if (u_material != 0) c.rgb = applyMaterial(c.rgb, v_world);
|
|
1023
1023
|
fragColor = applyFogPremultiplied(c);
|
|
1024
1024
|
}
|
|
1025
|
-
`,
|
|
1025
|
+
`,la=`#version 300 es
|
|
1026
1026
|
precision highp float;
|
|
1027
1027
|
|
|
1028
|
-
${
|
|
1028
|
+
${Ui}
|
|
1029
1029
|
|
|
1030
1030
|
in vec2 a_p0; // \u043D\u0430\u0447\u0430\u043B\u043E \u043E\u0442\u0440\u0435\u0437\u043A\u0430 (\u043E\u0434\u0438\u043D\u0430\u043A\u043E\u0432\u043E \u0443 \u0432\u0441\u0435\u0445 \u0432\u0435\u0440\u0448\u0438\u043D \u043A\u0430\u043F\u0441\u0443\u043B\u044B)
|
|
1031
1031
|
in vec2 a_p1; // \u043A\u043E\u043D\u0435\u0446 \u043E\u0442\u0440\u0435\u0437\u043A\u0430
|
|
@@ -1143,12 +1143,12 @@ void main() {
|
|
|
1143
1143
|
v_dist0 = a_dist * u_tile_to_px;
|
|
1144
1144
|
v_seg_len = len * u_tile_to_px;
|
|
1145
1145
|
}
|
|
1146
|
-
`,
|
|
1146
|
+
`,sa=`#version 300 es
|
|
1147
1147
|
precision highp float;
|
|
1148
1148
|
|
|
1149
|
-
${
|
|
1150
|
-
${
|
|
1151
|
-
${
|
|
1149
|
+
${je}
|
|
1150
|
+
${Ft}
|
|
1151
|
+
${vr}
|
|
1152
1152
|
|
|
1153
1153
|
in vec2 v_pos;
|
|
1154
1154
|
in vec2 v_p0;
|
|
@@ -1166,6 +1166,13 @@ uniform float u_half_width;
|
|
|
1166
1166
|
in float v_half_width;
|
|
1167
1167
|
/** \u0415\u0434\u0438\u043D\u0438\u0446\u044B \u0442\u0430\u0439\u043B\u0430 \u2192 \u043F\u0438\u043A\u0441\u0435\u043B\u0438 \u0446\u0435\u043D\u0442\u0440\u0430 \u043A\u0430\u0440\u0442\u044B: \u0432 \u043D\u0438\u0445 \u0437\u0430\u0434\u0430\u043D \u0440\u0438\u0441\u0443\u043D\u043E\u043A \u0432\u0434\u043E\u043B\u044C \u043B\u0438\u043D\u0438\u0438. */
|
|
1168
1168
|
uniform float u_tile_to_px;
|
|
1169
|
+
/**
|
|
1170
|
+
* \u0420\u0430\u0437\u043C\u044B\u0442\u0438\u0435 \u043A\u0440\u0430\u044F \u0432 \u0415\u0414\u0418\u041D\u0418\u0426\u0410\u0425 \u0422\u0410\u0419\u041B\u0410 (0 \u2014 \u043E\u0431\u044B\u0447\u043D\u044B\u0439 \u0447\u0451\u0442\u043A\u0438\u0439 \u043A\u0440\u0430\u0439).
|
|
1171
|
+
*
|
|
1172
|
+
* \u0422\u0435\u043D\u044C \u043C\u043E\u0441\u0442\u0430: \u0441\u043F\u043B\u043E\u0448\u043D\u0430\u044F \u043F\u043E\u043B\u043E\u0441\u0430 \u043F\u043E\u0434 \u043F\u043E\u043B\u043E\u0442\u043D\u043E\u043C, \u0440\u0430\u0441\u0442\u0432\u043E\u0440\u044F\u044E\u0449\u0430\u044F\u0441\u044F \u043A \u043A\u0440\u0430\u044F\u043C. \u0420\u0430\u0441\u0442\u044F\u043D\u0443\u0442\u044B\u0439 \u043F\u0435\u0440\u0435\u0445\u043E\u0434 \u2014 \u044D\u0442\u043E \u0440\u043E\u0432\u043D\u043E
|
|
1173
|
+
* \u0442\u043E, \u0447\u0435\u043C \u042F\u043D\u0434\u0435\u043A\u0441 \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0430\u0435\u0442 \u0442\u0435\u043D\u044C \u0432\u043E\u0441\u0435\u043C\u044C\u044E \u0432\u043B\u043E\u0436\u0435\u043D\u043D\u044B\u043C\u0438 \u043A\u043E\u043D\u0442\u0443\u0440\u0430\u043C\u0438 \u0441 \u043F\u0440\u043E\u0437\u0440\u0430\u0447\u043D\u043E\u0441\u0442\u044C\u044E \u043F\u043E 0.03\u20130.08.
|
|
1174
|
+
*/
|
|
1175
|
+
uniform float u_blur;
|
|
1169
1176
|
|
|
1170
1177
|
// \u0420\u0438\u0441\u0443\u043D\u043E\u043A \u0432\u0434\u043E\u043B\u044C \u043B\u0438\u043D\u0438\u0438: 0 \u2014 \u0441\u043F\u043B\u043E\u0448\u043D\u0430\u044F, 1 \u2014 \u043F\u0443\u043D\u043A\u0442\u0438\u0440, 2 \u2014 \u0448\u0435\u0432\u0440\u043E\u043D,
|
|
1171
1178
|
// 3 \u2014 \u043C\u0435\u0442\u043A\u0430-\u043E\u0441\u0442\u0440\u0438\u0451 \u043F\u043E\u0432\u0435\u0440\u0445 \u043F\u043E\u043B\u043E\u0442\u043D\u0430, 4 \u2014 \u0442\u043E\u043B\u044C\u043A\u043E \u043E\u0441\u0442\u0440\u0438\u0451,
|
|
@@ -1357,7 +1364,12 @@ void main() {
|
|
|
1357
1364
|
|
|
1358
1365
|
// \u0421\u0433\u043B\u0430\u0436\u0438\u0432\u0430\u043D\u0438\u0435 \u0440\u043E\u0432\u043D\u043E \u0432 \u043F\u043E\u043B\u043F\u0438\u043A\u0441\u0435\u043B\u044F \u0441 \u043A\u0430\u0436\u0434\u043E\u0439 \u0441\u0442\u043E\u0440\u043E\u043D\u044B \u043A\u0440\u0430\u044F. \u0428\u0438\u0440\u0435 \u2014 \u043B\u0438\u043D\u0438\u044F
|
|
1359
1366
|
// \xAB\u043C\u044B\u043B\u0438\u0442\u0441\u044F\xBB, \u0443\u0436\u0435 \u2014 \u043D\u0430 \u0434\u0438\u0430\u0433\u043E\u043D\u0430\u043B\u044F\u0445 \u043B\u0435\u0437\u0443\u0442 \u0441\u0442\u0443\u043F\u0435\u043D\u044C\u043A\u0438.
|
|
1360
|
-
|
|
1367
|
+
//
|
|
1368
|
+
// \u0421\u043B\u043E\u044E \u0442\u0435\u043D\u0438 \u043A\u0440\u0430\u0439 \u0440\u0430\u0441\u0442\u044F\u0433\u0438\u0432\u0430\u0435\u0442\u0441\u044F \u043D\u0430 u_blur (\u0435\u0434\u0438\u043D\u0438\u0446\u044B \u0442\u0430\u0439\u043B\u0430): \u043F\u043E\u043B\u043E\u0441\u0430 \u043F\u043E\u0434 \u043C\u043E\u0441\u0442\u043E\u043C \u0433\u0430\u0441\u043D\u0435\u0442 \u043F\u043B\u0430\u0432\u043D\u043E, \u0430 \u043D\u0435
|
|
1369
|
+
// \u043E\u0431\u0440\u044B\u0432\u0430\u0435\u0442\u0441\u044F \u043A\u0440\u043E\u043C\u043A\u043E\u0439. \u041F\u043E\u043B\u0443\u043F\u0438\u043A\u0441\u0435\u043B\u044C \u043E\u0441\u0442\u0430\u0451\u0442\u0441\u044F \u043D\u0438\u0436\u043D\u0435\u0439 \u0433\u0440\u0430\u043D\u0438\u0446\u0435\u0439 \u2014 \u0438\u043D\u0430\u0447\u0435 \u043D\u0430 \u0434\u0430\u043B\u044C\u043D\u0435\u043C \u043F\u043B\u0430\u043D\u0435, \u0433\u0434\u0435 \u043F\u0438\u043A\u0441\u0435\u043B\u044C
|
|
1370
|
+
// \u043A\u0440\u0443\u043F\u043D\u0435\u0435 \u0440\u0430\u0437\u043C\u044B\u0442\u0438\u044F, \u0432\u0435\u0440\u043D\u0443\u043B\u0438\u0441\u044C \u0431\u044B \u0441\u0442\u0443\u043F\u0435\u043D\u044C\u043A\u0438.
|
|
1371
|
+
float feather = max(px * 0.5, u_blur);
|
|
1372
|
+
float alpha = 1.0 - smoothstep(hw - feather, hw + feather, dist);
|
|
1361
1373
|
alpha *= min(widthPx, 1.0);
|
|
1362
1374
|
|
|
1363
1375
|
// \u0420\u0438\u0441\u0443\u043D\u043E\u043A \u0432\u0434\u043E\u043B\u044C \u043B\u0438\u043D\u0438\u0438 \u0441\u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044F \u0432 \u043F\u0438\u043A\u0441\u0435\u043B\u044F\u0445 \u0446\u0435\u043D\u0442\u0440\u0430 \u043A\u0430\u0440\u0442\u044B \u2014 \u0442\u0430\u043C \u0436\u0435, \u0433\u0434\u0435 \u0437\u0430\u0434\u0430\u043D
|
|
@@ -1399,7 +1411,7 @@ void main() {
|
|
|
1399
1411
|
if (alpha <= 0.003) discard;
|
|
1400
1412
|
fragColor = applyFogPremultiplied(color) * alpha;
|
|
1401
1413
|
}
|
|
1402
|
-
`,
|
|
1414
|
+
`,ca=`#version 300 es
|
|
1403
1415
|
precision highp float;
|
|
1404
1416
|
|
|
1405
1417
|
in vec2 a_pos; // \u0442\u043E\u0447\u043A\u0430 \u043E\u0441\u0438, \u043B\u043E\u043A\u0430\u043B\u044C\u043D\u044B\u0439 \u043C\u0435\u0440\u043A\u0430\u0442\u043E\u0440
|
|
@@ -1433,10 +1445,10 @@ void main() {
|
|
|
1433
1445
|
v_half = u_half_width;
|
|
1434
1446
|
v_dist = a_dist * u_units_to_px;
|
|
1435
1447
|
}
|
|
1436
|
-
`,
|
|
1448
|
+
`,fa=`#version 300 es
|
|
1437
1449
|
precision highp float;
|
|
1438
1450
|
|
|
1439
|
-
${
|
|
1451
|
+
${je}
|
|
1440
1452
|
|
|
1441
1453
|
in float v_side;
|
|
1442
1454
|
in float v_outset;
|
|
@@ -1482,7 +1494,7 @@ void main() {
|
|
|
1482
1494
|
if (alpha <= 0.003) discard;
|
|
1483
1495
|
fragColor = applyFogPremultiplied(color) * alpha;
|
|
1484
1496
|
}
|
|
1485
|
-
`,
|
|
1497
|
+
`,ua=`#version 300 es
|
|
1486
1498
|
precision highp float;
|
|
1487
1499
|
|
|
1488
1500
|
in vec2 a_pos;
|
|
@@ -1524,7 +1536,7 @@ void main() {
|
|
|
1524
1536
|
v_up = h;
|
|
1525
1537
|
v_wall = a_wall / 4.0;
|
|
1526
1538
|
}
|
|
1527
|
-
`,
|
|
1539
|
+
`,lc=`
|
|
1528
1540
|
uniform float u_facade_detail; // 0 \u2014 \u0433\u043B\u0430\u0434\u043A\u0438\u0435 \u0441\u0442\u0435\u043D\u044B, 1 \u2014 \u043F\u043E\u043B\u043D\u044B\u0439 \u0440\u0438\u0441\u0443\u043D\u043E\u043A
|
|
1529
1541
|
uniform vec3 u_window_color;
|
|
1530
1542
|
uniform vec3 u_window_frame;
|
|
@@ -1689,13 +1701,13 @@ vec3 roofHue(vec3 base, float seed) {
|
|
|
1689
1701
|
float hueLum = max(dot(hue, vec3(0.2126, 0.7152, 0.0722)), 1e-3);
|
|
1690
1702
|
return hue * (baseLum / hueLum);
|
|
1691
1703
|
}
|
|
1692
|
-
`,
|
|
1704
|
+
`,ha=`#version 300 es
|
|
1693
1705
|
precision highp float;
|
|
1694
1706
|
|
|
1695
|
-
${
|
|
1696
|
-
${
|
|
1697
|
-
${
|
|
1698
|
-
${
|
|
1707
|
+
${Ft}
|
|
1708
|
+
${_o}
|
|
1709
|
+
${je}
|
|
1710
|
+
${lc}
|
|
1699
1711
|
|
|
1700
1712
|
in vec3 v_normal;
|
|
1701
1713
|
in float v_ao;
|
|
@@ -1774,7 +1786,7 @@ void main() {
|
|
|
1774
1786
|
float alpha = u_opacity * u_wall_color.a;
|
|
1775
1787
|
fragColor = vec4(applyFog(color) * alpha, alpha);
|
|
1776
1788
|
}
|
|
1777
|
-
`,
|
|
1789
|
+
`,da=`#version 300 es
|
|
1778
1790
|
precision highp float;
|
|
1779
1791
|
|
|
1780
1792
|
in vec2 a_pos; // \u0435\u0434\u0438\u043D\u0438\u0446\u044B \u0442\u0430\u0439\u043B\u0430, \u0414\u0420\u041E\u0411\u041D\u042B\u0415 (\u0441\u043C. generators/surface.ts)
|
|
@@ -1814,13 +1826,13 @@ void main() {
|
|
|
1814
1826
|
v_world = u_world_origin + pos * u_meters_per_unit;
|
|
1815
1827
|
v_shadow = u_shadow_matrix * local;
|
|
1816
1828
|
}
|
|
1817
|
-
`,
|
|
1829
|
+
`,ma=`#version 300 es
|
|
1818
1830
|
precision highp float;
|
|
1819
1831
|
|
|
1820
|
-
${
|
|
1821
|
-
${
|
|
1822
|
-
${
|
|
1823
|
-
${
|
|
1832
|
+
${Ft}
|
|
1833
|
+
${_o}
|
|
1834
|
+
${je}
|
|
1835
|
+
${vr}
|
|
1824
1836
|
|
|
1825
1837
|
in vec3 v_normal;
|
|
1826
1838
|
in float v_kind; // 0 \u0432\u0435\u0440\u0445, 1 \u0431\u043E\u0440\u0442, 2 \u044E\u0431\u043A\u0430, 3 \u043A\u0440\u044B\u0448\u043A\u0430 \u043E\u0441\u0442\u0440\u043E\u0432\u0430
|
|
@@ -1869,7 +1881,7 @@ void main() {
|
|
|
1869
1881
|
|
|
1870
1882
|
fragColor = vec4(applyFog(color) * alpha, alpha);
|
|
1871
1883
|
}
|
|
1872
|
-
`,
|
|
1884
|
+
`,pa=`#version 300 es
|
|
1873
1885
|
precision highp float;
|
|
1874
1886
|
|
|
1875
1887
|
in vec2 a_pos; // \u044D\u043A\u0440\u0430\u043D\u043D\u044B\u0435 \u043F\u0438\u043A\u0441\u0435\u043B\u0438 (CSS)
|
|
@@ -1899,7 +1911,7 @@ void main() {
|
|
|
1899
1911
|
v_scale = a_scale;
|
|
1900
1912
|
v_fade = a_fade;
|
|
1901
1913
|
}
|
|
1902
|
-
`,
|
|
1914
|
+
`,ba=`#version 300 es
|
|
1903
1915
|
precision highp float;
|
|
1904
1916
|
|
|
1905
1917
|
in vec2 v_tex;
|
|
@@ -1949,6 +1961,6 @@ void main() {
|
|
|
1949
1961
|
if (color.a <= 0.001) discard;
|
|
1950
1962
|
fragColor = color;
|
|
1951
1963
|
}
|
|
1952
|
-
`;var wo=i=>i.kind==="symbol",aa=i=>i.kind==="placement";function Pe(i,e,t,o){for(let r of i)for(let n=0;n+5<r.length;n+=6){let a=r[n],l=r[n+1],s=r[n+2],c=r[n+3],f=r[n+4],h=r[n+5];if(Ks(e,t,a,l,s,c,f,h)||o>0&&(gr(e,t,a,l,s,c)<=o||gr(e,t,s,c,f,h)<=o||gr(e,t,f,h,a,l)<=o))return true}return false}function Ks(i,e,t,o,r,n,a,l){let s=(i-r)*(o-n)-(t-r)*(e-n),c=(i-a)*(n-l)-(r-a)*(e-l),f=(i-t)*(l-o)-(a-t)*(e-o),h=s<0||c<0||f<0,u=s>0||c>0||f>0;return !(h&&u)}function gr(i,e,t,o,r,n){let a=r-t,l=n-o,s=a*a+l*l,c=s>0?Math.max(0,Math.min(1,((i-t)*a+(e-o)*l)/s)):0;return Math.hypot(i-(t+a*c),e-(o+l*c))}function vr(i,e){let t=new DataView(i.vertices),o=new Uint32Array(i.indices),r=e.bounds(),n=(r.maxX-r.minX)/i.extent,a=new Float64Array(o.length*2);for(let l=0;l<o.length;l++){let s=o[l]*De;a[l*2]=r.minX+t.getInt16(s,true)*n,a[l*2+1]=r.minY+t.getInt16(s+2,true)*n;}return a}function wr(i,e,t){let o=new DataView(i.vertices),r=t.bounds(),n=(r.maxX-r.minX)/e,a=r.minX,l=r.minY,s=new Float64Array(i.indices.length*2);for(let c=0;c<i.indices.length;c++){let f=i.indices[c]*Me;s[c*2]=a+o.getInt16(f,true)*n,s[c*2+1]=l+o.getInt16(f+2,true)*n;}return s}var qs={stride:8,attribs:[{name:"a_pos",size:2,type:5126,offset:0}]},Zs=40,Qs=10.5,la=2.5,Js=16,ec=4,tc=7,Et=class{constructor(){this.vbo=null;this.ibo=null;this.vao=null;this.capacity=0;this.perArrow=0;this.indicesPerArrow=0;this.highlightFootprint=null;this.count=0;}render(e,t,o,r,n,a,l,s=false){this.count=0;let c=t.zoom,f=r.layers.filter(w=>w.type==="symbol"&&w.layout?.placement==="map"&&r.layerVisibleAt(w,c));if(!f.length)return;let h=t.center,u=ee(h.lng),d=te(h.lat),m=t.worldSize>0?t.pixelsPerMeter/t.worldSize:0;if(!(m>0))return;let y=[];for(let w of f){let S=o.get(w.source??Y);if(!S)continue;let _=r.bucketKeyFor(w);if(_===null)continue;let M=w.layout?.showFor==="highlight";if(M&&!this.highlightFootprint)continue;let x=m*1.5,T=w.layout?.arrowUnits==="meters"?m:1/t.worldSize,E=V(w.layout?.arrowLength,c,Zs)*T,k=V(w.layout?.arrowWidth,c,Qs)*T,F=V(w.layout?.arrowOutline,c,la)*T,L=V(w.layout?.arrowGap,c,Js)*T,I=V(w.layout?.arrowDotRadius,c,ec)*T,A=V(w.layout?.arrowDotGap,c,tc)*T,R=_r(E,k,I,L-A),P=F>0?_r(E,k,I,L-A,F).outline:null,z={layer:w,verts:[],shape:R};for(let O of S.visibleTiles){let W=S.getTile(O)?.data?.buckets?.[_];if(!W||!wo(W))continue;let B=new Int16Array(W.anchors),D=W.rotations?new Int16Array(W.rotations):null,K=O.bounds(),$=(K.maxX-K.minX)/W.extent,oe=K.minX,ye=K.minY;for(let J=0;J<B.length/2;J++){let X=oe+B[J*2]*$,me=ye+B[J*2+1]*$;if(M&&!Pe(this.highlightFootprint,X,me,x))continue;let pe=(D?D[J]:0)*Math.PI/180,Z=Math.sin(pe),U=-Math.cos(pe),j=X-u-Z*L,fe=me-d-U*L;P&&Cr(z,P,j,fe,Z,U),Cr(z,R.outline,j,fe,Z,U),this.count++;}}z.verts.length&&y.push(z);}if(!y.length)return;let p=y[0].shape,b=p.outline.length/2,g=[],v=[];for(let w of y){let S=g.length/2/b;for(let _ of w.verts)g.push(_);v.push({layer:w.layer,first:S,count:w.verts.length/2/b});}if(this.ensureBuffers(e,g.length/2/b,p,a),!(!this.vao||!this.vbo)){this.vbo.update(new Uint8Array(new Float32Array(g).buffer)),n.use(),l?.(n),s&&n.setMat4("u_shadow_matrix",t.shadowObjectMatrix(u,d,0)),n.setMat4("u_matrix",t.objectMatrix(u,d,0)),e.setDepthTest(false),e.setDepthMask(false),e.setBlend("premultiplied"),e.setCull("none"),this.vao.bind();for(let w of v){let S=w.layer.paint,_=V(S.opacity,c,1),M=ke(S.color,c,[.18,.45,.76,1]),x=ke(S.haloColor,c,[1,1,1,1]),C=V(w.layer.layout?.arrowOutline,c,la)>0;oc(e,n,w,x,M,_,C,this.indicesPerArrow);}e.bindVAO(null),e.setDepthTest(true);}}ensureBuffers(e,t,o,r){let n=o.outline.length/2;if(this.vao&&t<=this.capacity&&n===this.perArrow)return;this.vao?.destroy(),this.vbo?.destroy(),this.ibo?.destroy(),this.capacity=Math.max(256,Math.ceil(t*1.5)),this.perArrow=n,this.indicesPerArrow=o.indices.length,this.vbo=new be(e,new Uint8Array(this.capacity*n*8),qs,true);let a=new Uint32Array(this.capacity*o.indices.length);for(let l=0;l<this.capacity;l++){let s=l*n;for(let c=0;c<o.indices.length;c++)a[l*o.indices.length+c]=s+o.indices[c];}this.ibo=new se(e,a),this.vao=new ae(e,[{buffer:this.vbo,locations:r}],this.ibo);}destroy(){this.vao?.destroy(),this.vbo?.destroy(),this.ibo?.destroy(),this.vao=null,this.vbo=null,this.ibo=null,this.capacity=0;}};function oc(i,e,t,o,r,n,a,l){let s=a?2:1;if(a){e.setVec4v("u_color",_e([o[0],o[1],o[2],o[3]*n]));for(let c=0;c<t.count;c+=s)sa(i,t.first+c,l);}e.setVec4v("u_color",_e([r[0],r[1],r[2],r[3]*n]));for(let c=a?1:0;c<t.count;c+=s)sa(i,t.first+c,l);}function sa(i,e,t){i.gl.drawElements(i.gl.TRIANGLES,t,i.gl.UNSIGNED_INT,e*t*4);}var ca=4,xr=12;function _r(i,e,t,o,r=0){let n=i*.38,a=e*1.35,l=n*.3,s=e*.32,c=e/2,f=-i+s,h=[],u=(b,g)=>h.push(b,g);u(0,0),u(-n,a),u(-n+l,c),u(f,s);for(let b=1;b<ca;b++){let g=b/ca*Math.PI;u(f-Math.sin(g)*s,Math.cos(g)*s);}u(f,-s),u(-n+l,-c),u(-n,-a);let d=r>0?rc(h,r):h,m=Un__default.default(h,void 0,2);if(t<=0)return {outline:d,indices:m};let y=d.length/2,p=t+r;for(let b=0;b<xr;b++){let g=b/xr*Math.PI*2;d.push(o+Math.cos(g)*p,Math.sin(g)*p);}for(let b=1;b<xr-1;b++)m.push(y,y+b,y+b+1);return {outline:d,indices:m}}function rc(i,e){let t=i.length/2,o=0;for(let a=0;a<t;a++){let l=(a+1)%t;o+=i[a*2]*i[l*2+1]-i[l*2]*i[a*2+1];}let r=o<0?-1:1,n=[];for(let a=0;a<t;a++){let l=i[(a+t-1)%t*2],s=i[(a+t-1)%t*2+1],c=i[a*2],f=i[a*2+1],h=i[(a+1)%t*2],u=i[(a+1)%t*2+1],d=Math.hypot(c-l,f-s)||1,m=Math.hypot(h-c,u-f)||1,y=r*(f-s)/d,p=-r*(c-l)/d,b=r*(u-f)/m,g=-r*(h-c)/m,v=y+b,w=p+g,S=Math.hypot(v,w);if(S<1e-9){n.push(c,f);continue}v/=S,w/=S;let _=Math.min(1/Math.max(v*y+w*p,.35),3);n.push(c+v*e*_,f+w*e*_);}return n}function Cr(i,e,t,o,r,n){let a=-n,l=r;for(let s=0;s<e.length;s+=2){let c=e[s],f=e[s+1];i.verts.push(t+r*c+a*f,o+n*c+l*f);}}function nc(i,e,t,o,r,n=0,a=0){let l=t*Math.PI/180,s={verts:[]};return Cr(s,_r(o,r,n,a).outline,i,e,Math.sin(l),-Math.cos(l)),s.verts}var ic=5;function fa(i,e){let t=1/(1<<e),o=(1<<e)-1;return [(i.x&o)*t,(i.y&o)*t,t]}var xo=class{constructor(){this.anisotropy=0;this.anisotropyPname=0;this.anisotropyChecked=false;}render(e,t,o,r,n,a,l,s=false){if(!a.size)return;let c=n.layers.filter(f=>f.type==="raster"&&!!f.overlay===s&&n.layerVisibleAt(f,l));if(c.length){r.use(),e.setDepthTest(false),e.setDepthMask(false),e.setBlend("premultiplied"),e.setCull("none"),r.setInt("u_image",0);for(let f of c){let h=a.get(f.source);if(!h)continue;let u=V(f.paint?.opacity,l,1);if(!(u<=.001)){r.setFloat("u_opacity",u),o.bind();for(let d of h.visibleTiles){let m=this.patchFor(e,h,d);m&&(e.bindTexture(0,m.texture),r.setVec3("u_uv_transform",m.uv[0],m.uv[1],m.uv[2]),r.setMat4("u_matrix",t.tileMatrix(d,1)),e.gl.drawElements(e.gl.TRIANGLES,6,e.gl.UNSIGNED_SHORT,0));}}}e.bindVAO(null);}}patchFor(e,t,o){let r=t.getTile(o),n=r&&r.state==="loaded"?this.textureFor(e,r):null;if(n)return {texture:n,uv:[0,0,1]};for(let a=1;a<=ic&&a<=o.z;a++){let l=o.scaledTo(o.z-a),s=t.getTile(l);if(!s||s.state!=="loaded")continue;let c=this.textureFor(e,s);if(c)return {texture:c,uv:fa(o,a)}}return null}textureFor(e,t){let o=t.texture;if(o)return o.handle;if(!t.image)return null;let r=e.gl,n=r.createTexture();if(!n)return null;e.bindTexture(0,n),r.texImage2D(r.TEXTURE_2D,0,r.RGBA,r.RGBA,r.UNSIGNED_BYTE,t.image),r.generateMipmap(r.TEXTURE_2D),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.LINEAR_MIPMAP_LINEAR),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,r.LINEAR),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE),this.applyAnisotropy(r);let a={handle:n,destroy:()=>r.deleteTexture(n)};return t.texture=a,t.image.close(),t.image=null,n}applyAnisotropy(e){if(!this.anisotropyChecked){this.anisotropyChecked=true;let t=e.getExtension("EXT_texture_filter_anisotropic");t&&(this.anisotropyPname=t.TEXTURE_MAX_ANISOTROPY_EXT,this.anisotropy=Math.min(4,e.getParameter(t.MAX_TEXTURE_MAX_ANISOTROPY_EXT)));}this.anisotropy>0&&e.texParameterf(e.TEXTURE_2D,this.anisotropyPname,this.anisotropy);}};var ac="indoor-",Ft=class{constructor(){this.parts=null;this.stamp="";this.cache=new H;this.box=null;this.hidden=new Q;this.collected=new Q;}get active(){return this.parts!==null}footprint(){return this.parts}get hiddenCount(){return this.hidden.size}sync(e,t,o){let r=[],n;for(let u of t.layers){if(!u.id.startsWith(ac)||u.type!=="fill"||!t.layerVisibleAt(u,o))continue;let d=t.bucketKeyFor(u);d&&(r.push(d),n??(n=e.get(u.source??Y)));}if(!r.length||!n){this.parts&&this.destroy();return}let a=r.join(",")+"|"+n.visibleTiles.map(u=>u.dataKey+(n.getTile(u)?.data?"+":"-")).join(",");if(a===this.stamp)return;this.stamp=a,this.free();let l=[],s=1/0,c=1/0,f=-1/0,h=-1/0;for(let u of n.visibleTiles){let d=n.getTile(u)?.data?.buckets;if(d)for(let m of r){let y=d[m];if(!y||y.kind!=="fill")continue;let p=vr(y,u);l.push(p);for(let b=0;b<p.length;b+=2)p[b]<s&&(s=p[b]),p[b]>f&&(f=p[b]),p[b+1]<c&&(c=p[b+1]),p[b+1]>h&&(h=p[b+1]);}}this.parts=l.length?l:null,this.box=l.length?[s,c,f,h]:null,this.hidden.clear(),this.collected.clear();}collectHidden(e,t){let o=this.parts;if(!o||!e.featureIds)return;let r=new Uint32Array(e.indices),n=new Float64Array(e.featureIds),a=new DataView(e.vertices),l=t.bounds(),s=(l.maxX-l.minX)/e.extent,c=this.box,f=new H;for(let h=0;h*3<r.length;h++){let u=n[h];if(this.hidden.has(u))continue;let d=f.get(u);d||f.set(u,d=[1/0,1/0,-1/0,-1/0]);for(let m=0;m<3;m++){let y=r[h*3+m]*Me,p=a.getInt16(y,true),b=a.getInt16(y+2,true);p<d[0]&&(d[0]=p),b<d[1]&&(d[1]=b),p>d[2]&&(d[2]=p),b>d[3]&&(d[3]=b);}}for(let[h,u]of f){let d=l.minX+(u[0]+u[2])/2*s,m=l.minY+(u[1]+u[3])/2*s;c&&(d<c[0]||d>c[2]||m<c[1]||m>c[3])||Pe(o,d,m,0)&&this.hidden.add(h);}}destroy(){this.parts=null,this.hidden.clear(),this.collected.clear(),this.box=null,this.stamp="",this.free();}free(){this.cache.forEach(e=>{e?.vao.destroy(),e?.ibo.destroy();}),this.cache.clear();}prepare(e,t){if(!this.parts)return;let o=this.hidden.size;for(let r of e.visibleTiles){if(this.collected.has(r.dataKey))continue;let n=e.getTile(r)?.data?.buckets?.[t];!n||n.kind!=="fill-extrusion"||(this.collected.add(r.dataKey),this.collectHidden(n,r));}this.hidden.size!==o&&this.free();}indicesFor(e,t,o,r,n,a){if(!this.parts)return null;let l=this.cache.get(r.dataKey);if(l!==void 0)return l;let s=t.data?.buckets?.[o];if(!s)return null;let c=null;if(s.kind==="fill-extrusion"&&s.featureIds&&this.hidden.size){let f=new Uint32Array(s.indices),h=new Float64Array(s.featureIds),u=[];for(let d=0;d*3<f.length;d++)this.hidden.has(h[d])||u.push(f[d*3],f[d*3+1],f[d*3+2]);if(u.length<f.length){let d=new se(e,new Uint32Array(u));c={vao:new ae(e,[{buffer:n,locations:a}],d),ibo:d,count:u.length};}}return this.cache.set(r.dataKey,c),c}};var ua=35,lc=70,sc=.35,cc=.5,fc=1.1;function ut(i,e){let t=e.sky;if(!t.enabled||t.fogIntensity<=0)return {near:0,far:1/0,intensity:0,cutoff:1/0};let o=i.cameraToCenterDistance,r=we((i.pitch-ua)/(lc-ua),0,1),n=t.fogRange[0]*(1-sc*r)*o,a=t.fogRange[1]*(1-cc*r)*o,l=Math.min(1,t.fogIntensity+(1-t.fogIntensity)*Math.min(1,r*2)),s=l>=.995?a*fc:1/0;return {near:n,far:a,intensity:l,cutoff:s}}function Sr(i,e,t,o){let r=o.x/Math.max(i.width,1)*2-1,n=1-o.y/Math.max(i.height,1)*2,a=null,l=new Float64Array(16),s=[0,0,0,0],c=[0,0,0,0];for(let f of e.visibleTiles){let h=e.getTile(f),u=h&&da(h,t);if(!u||!Fe(l,i.tileMatrix64(f,u.extent))||(ie(s,l,[r,n,-1,1]),ie(c,l,[r,n,1,1]),s[3]===0||c[3]===0))continue;let d=s[0]/s[3],m=s[1]/s[3],y=s[2]/s[3],p=c[0]/c[3]-d,b=c[1]/c[3]-m,g=c[2]/c[3]-y,v=dc(u,d,m,y,p,b,g);v&&(!a||v.t<a.distance)&&(a={featureId:v.featureId,tile:f,layerId:t,distance:v.t});}return a}function Mr(i,e,t,o){let r=o.x/Math.max(i.width,1)*2-1,n=1-o.y/Math.max(i.height,1)*2,a=null,l=new Float64Array(16),s=[0,0,0,0],c=[0,0,0,0];for(let f of e.visibleTiles){let h=e.getTile(f);if(h)for(let u of t){let d=h.data?.buckets?.[u];if(!d||d.kind!=="fill"||!d.featureIds||!Fe(l,i.tileMatrix64(f,d.extent))||(ie(s,l,[r,n,-1,1]),ie(c,l,[r,n,1,1]),s[3]===0||c[3]===0))continue;let m=s[0]/s[3],y=s[1]/s[3],p=s[2]/s[3],b=c[2]/c[3]-p;if(Math.abs(b)<1e-9)continue;let g=-p/b;if(g<0||g>1)continue;let v=m+(c[0]/c[3]-m)*g,w=y+(c[1]/c[3]-y)*g,S=uc(d,v,w);S!==null&&(!a||g<a.distance)&&(a={featureId:S,tile:f,layerId:u,distance:g});}}return a}function uc(i,e,t){let o=new DataView(i.vertices),r=new Uint32Array(i.indices),n=new Float64Array(i.featureIds),a=s=>o.getInt16(s*De,true),l=s=>o.getInt16(s*De+2,true);for(let s=0;s*3<r.length;s++){let c=r[s*3],f=r[s*3+1],h=r[s*3+2],u=a(c),d=l(c),m=a(f),y=l(f),p=a(h),b=l(h),g=(e-m)*(d-y)-(u-m)*(t-y),v=(e-p)*(y-b)-(m-p)*(t-b),w=(e-u)*(b-d)-(p-u)*(t-d),S=g<0||v<0||w<0,_=g>0||v>0||w>0;if(!(S&&_))return n[s]}return null}function da(i,e){let t=i.data?.buckets?.[e];return !t||t.kind!=="fill-extrusion"||!t.featureIds?null:t}function dc(i,e,t,o,r,n,a){let l=new DataView(i.vertices),s=new Uint32Array(i.indices),c=new Float64Array(i.featureIds),f=y=>l.getInt16(y*Me,true),h=y=>l.getInt16(y*Me+2,true),u=y=>l.getUint16(y*Me+4,true)/nt,d=1/0,m=-1;for(let y=0;y+2<s.length;y+=3){let p=s[y],b=s[y+1],g=s[y+2],v=f(p),w=h(p),S=u(p),_=f(b)-v,M=h(b)-w,x=u(b)-S,C=f(g)-v,T=h(g)-w,E=u(g)-S,k=n*E-a*T,F=a*C-r*E,L=r*T-n*C,I=_*k+M*F+x*L;if(I>-1e-9&&I<1e-9)continue;let A=1/I,R=e-v,P=t-w,z=o-S,O=(R*k+P*F+z*L)*A;if(O<0||O>1)continue;let N=P*x-z*M,W=z*_-R*x,B=R*M-P*_,D=(r*N+n*W+a*B)*A;if(D<0||O+D>1)continue;let K=(C*N+T*W+E*B)*A;K<0||K>1||K>=d||(d=K,m=c[y/3]??0);}return m>=0?{featureId:m,t:d}:null}function _o(i,e,t){let o=da(i,e);if(!o)return null;let r=new Uint32Array(o.indices),n=new Float64Array(o.featureIds),a=[];for(let l=0;l+2<r.length;l+=3)n[l/3]===t&&a.push(r[l],r[l+1],r[l+2]);return a.length?{vertices:o.vertices,indices:new Uint32Array(a)}:null}var dt=24,Tr=8,mc=2,pc=12,Co=8,So=8;function zt(i){let e=0;for(let d of i)e+=d.length/2;if(e<2)return null;let t=(Co+2)*2,o=e*t+i.length*(So+2)*2+8,r=e*(Co+2)*6+i.length*So*6+24,n=new ArrayBuffer(o*dt),a=new DataView(n),l=new Uint32Array(r),s=0,c=0,f=(d,m,y,p,b,g)=>{let v=s*dt;return a.setFloat32(v,d,true),a.setFloat32(v+4,m,true),a.setFloat32(v+8,y,true),a.setFloat32(v+12,p,true),a.setFloat32(v+16,b,true),a.setFloat32(v+20,g,true),s++},h=(d,m,y,p)=>{l[c++]=d,l[c++]=m,l[c++]=p,l[c++]=d,l[c++]=p,l[c++]=y;},u=(d,m,y,p,b,g,v)=>{let w=f(d,m,0,0,0,v),S=f(d,m,y,p,1,v);for(let _=1;_<=So;_++){let M=Math.PI*_/So,x=y*Math.cos(M)+b*Math.sin(M),C=p*Math.cos(M)+g*Math.sin(M),T=f(d,m,x,C,1,v);l[c++]=w,l[c++]=S,l[c++]=T,S=T;}};for(let d of i){let m=bc(d),y=m.length/2;if(y<2)continue;let p=new Float64Array(y-1),b=new Float64Array(y-1);for(let _=0;_<y-1;_++){let M=m[_*2+2]-m[_*2],x=m[_*2+3]-m[_*2+1],C=Math.hypot(M,x)||1;p[_]=M/C,b[_]=x/C;}let g=0,v=-1,w=-1;for(let _=0;_<y;_++){let M=m[_*2],x=m[_*2+1];_>0&&(g+=Math.hypot(M-m[_*2-2],x-m[_*2-1]));let C=_>0?_-1:0,T=_<y-1?_:y-2,E=-b[C],k=p[C],F=-b[T],L=p[T],I=E+F,A=k+L,R=Math.hypot(I,A);R>1e-9?(I/=R,A/=R):(I=E,A=k);let P=I*F+A*L,z=P>1e-6?1/P:1/0,O=Math.acos(Math.min(1,Math.max(-1,p[C]*p[T]+b[C]*b[T])));if(!(O>pc*Math.PI/180)&&z<=mc){let W=f(M,x,I*z,A*z,1,g),B=f(M,x,-I*z,-A*z,-1,g);v>=0&&h(v,w,W,B),v=W,w=B;}else {let W=Math.max(1,Math.min(Co,Math.ceil(O/(Math.PI/Co)))),D=p[C]*b[T]-b[C]*p[T]>=0?1:-1,K=f(M,x,E,k,1,g),$=f(M,x,-E,-k,-1,g);v>=0&&h(v,w,K,$);for(let oe=1;oe<=W;oe++){let ye=D*O*(oe/W),J=Math.cos(ye),X=Math.sin(ye),me=E*J-k*X,pe=E*X+k*J,Z=f(M,x,me,pe,1,g),U=f(M,x,-me,-pe,-1,g);h(K,$,Z,U),K=Z,$=U;}v=K,w=$;}}let S=y-2;u(m[0],m[1],-b[0],p[0],-p[0],-b[0],0),u(m[(y-1)*2],m[(y-1)*2+1],-b[S],p[S],p[S],b[S],g);}return c?{vertices:n.slice(0,s*dt),indices:l.slice(0,c),vertexCount:s}:null}function Ar(i){if(!i.length||i[0].length<6)return null;let e=[],t=[];for(let n=0;n<i[0].length;n++)e.push(i[0][n]);for(let n=1;n<i.length;n++)if(!(i[n].length<6)){t.push(e.length/2);for(let a=0;a<i[n].length;a++)e.push(i[n][a]);}let o=Un__default.default(e,t.length?t:void 0,2);if(!o.length)return null;let r=new Uint32Array(o.length);for(let n=0;n<o.length;n+=3)r[n]=o[n],r[n+1]=o[n+2],r[n+2]=o[n+1];return {vertices:new Float32Array(e).buffer,indices:r,vertexCount:e.length/2}}function bc(i){let e=[];for(let t=0;t<i.length;t+=2){let o=i[t],r=i[t+1],n=e.length;n>=2&&e[n-2]===o&&e[n-1]===r||e.push(o,r);}return e}var Rt=5126,yc={stride:Tr,attribs:[{name:"a_pos",size:2,type:Rt,offset:0}]},Lr={stride:dt,attribs:[{name:"a_pos",size:2,type:Rt,offset:0},{name:"a_extrude",size:2,type:Rt,offset:8},{name:"a_side",size:1,type:Rt,offset:16},{name:"a_dist",size:1,type:Rt,offset:20}]},kr=class{constructor(e,t){this.revision=e;this.parts=t;}destroy(){for(let e of this.parts)e.vao.destroy(),e.vbo.destroy(),e.ibo.destroy();}},gc=(i,e)=>[i[0],i[1],i[2],i[3]*e],Ht=class{constructor(){this.objects=[];this.markers=[];this.gpu=new H;this.markerHost=null;}setMarkerHost(e){this.markerHost=e;for(let t of this.markers)t.attach(e);}add(e){this.objects.includes(e)||this.objects.push(e);}remove(e){let t=this.objects.indexOf(e);t<0||(this.objects.splice(t,1),this.gpu.get(e.id)?.destroy(),this.gpu.delete(e.id));}addMarker(e){this.markers.includes(e)||(this.markers.push(e),this.markerHost&&e.attach(this.markerHost));}removeMarker(e){let t=this.markers.indexOf(e);t<0||(this.markers.splice(t,1),e.detach());}get all(){return this.objects}get allMarkers(){return this.markers}get isEmpty(){return this.objects.length===0}updateMarkers(e){for(let t of this.markers)t.update(e);}render(e,t,o,r,n,a,l,s=false,c=false){if(!this.objects.length||c&&!this.objects.some(m=>m.ghostOpacity>0))return;this.objects.length>1&&this.objects.sort((m,y)=>m.zIndex-y.zIndex);let f=e.gl.drawingBufferWidth,h=t.width>0?f/t.width:1,u=t.worldSize*h,d=null;for(let m of this.objects){if(!m.visible)continue;let y=m.ghostOpacity;if(c&&y<=0)continue;let p=this.gpuFor(e,m,r,a);if(!p)continue;let b=s?t.shadowObjectMatrix(m.originX,m.originY,m.altitude):null,g=t.objectMatrix(m.originX,m.originY,m.altitude);for(let{part:v,vao:w,ibo:S}of p.parts){if(c&&(v.kind!=="line"||v.arrow))continue;let _=c?gc(v.color,y):v.color;if(v.kind==="fill")d!==o&&(o.use(),l?.(o),d=o),o.setVec4v("u_color",_e(_)),b&&o.setMat4("u_shadow_matrix",b),o.setMat4("u_matrix",g);else {d!==n&&(n.use(),l?.(n),d=n);let M=v.width/2*h,x=u>1e-9?1/u:1;if(n.setVec4v("u_color",_e(_)),n.setFloat("u_half_width",M),n.setFloat("u_offset",(v.offset??0)*h),n.setFloat("u_aa",1),n.setFloat("u_units_per_px",x),n.setFloat("u_units_to_px",u),n.setInt("u_pattern",c?0:v.dashArray?1:v.arrow?2:0),v.dashArray){let[C,T]=v.dashArray;n.setVec2("u_dash",C*h,(C+T)*h);}if(v.arrow){n.setVec4v("u_arrow_color",_e(v.arrowColor??[1,1,1,1]));let C=(v.arrowSize??5)*h;n.setVec3("u_arrow",(v.arrowPeriod??46)*h,Math.max(C*.4,1),Math.min(C,M*.72));}b&&n.setMat4("u_shadow_matrix",b),n.setMat4("u_matrix",g);}w.bind(),e.gl.drawElements(e.gl.TRIANGLES,S.count,S.type,0);}}e.bindVAO(null);}hitTest(e,t,o=4){let r=e.worldSize,n=(a,l,s)=>e.worldPxToPoint(ee(a)*r,te(l)*r,s);for(let a=this.objects.length-1;a>=0;a--){let l=this.objects[a];if(l.visible&&l.hitTest(t,n,o))return l}return null}boundsOf(e){let t=1/0,o=1/0,r=-1/0,n=-1/0;for(let a of e.rings())for(let l of a){let s=q(l);s.lng<t&&(t=s.lng),s.lng>r&&(r=s.lng),s.lat<o&&(o=s.lat),s.lat>n&&(n=s.lat);}return isFinite(t)?{west:t,south:o,east:r,north:n}:null}gpuFor(e,t,o,r){let n=this.gpu.get(t.id);if(n&&n.revision===t.revision)return n;n?.destroy();let a=[];for(let s of t.build()){let c=s.kind==="fill"?yc:Lr,f=s.kind==="fill"?o:r,h=new be(e,new Uint8Array(s.mesh.vertices),c),u=new se(e,s.mesh.indices),d=new ae(e,[{buffer:h,locations:f}],u);a.push({part:s,vao:d,vbo:h,ibo:u});}let l=new kr(t.revision,a);return this.gpu.set(t.id,l),a.length?l:null}destroy(){for(let e of this.gpu.values())e.destroy();this.gpu.clear();for(let e of this.markers)e.detach();this.markers=[],this.objects=[];}};var Mo=32,vc=1179937895,wc=1313821514,xc=5130562,_c={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},Cc={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT4:16};async function Ir(i){let{json:e,bin:t}=ha(i),o=await Mc(e,t);return pa(e,t,o)}function Sc(i){let{json:e,bin:t}=ha(i);for(let o of e.bufferViews??[])if(o.extensions?.EXT_meshopt_compression)throw new Error("[osmgl] GLB \u0441\u0436\u0430\u0442 meshopt \u2014 \u043D\u0443\u0436\u0435\u043D parseGlbAsync");return pa(e,t,null)}function ha(i){let e=new DataView(i);if(e.getUint32(0,true)!==vc)throw new Error("[osmgl] \u044D\u0442\u043E \u043D\u0435 GLB: \u043D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0438\u0433\u043D\u0430\u0442\u0443\u0440\u0430");if(e.getUint32(4,true)!==2)throw new Error("[osmgl] \u043F\u043E\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044F \u0442\u043E\u043B\u044C\u043A\u043E glTF 2.0");let t=null,o=null,r=12;for(;r+8<=i.byteLength;){let n=e.getUint32(r,true),a=e.getUint32(r+4,true),l=r+8;a===wc?t=JSON.parse(new TextDecoder().decode(new Uint8Array(i,l,n))):a===xc&&(o=new Uint8Array(i,l,n)),r=l+n+(4-n%4)%4;}if(!t)throw new Error("[osmgl] \u0432 GLB \u043D\u0435\u0442 JSON-\u043A\u0443\u0441\u043A\u0430");return {json:t,bin:o??new Uint8Array(0)}}async function Mc(i,e){let t=i.bufferViews??[],o=[];for(let a=0;a<t.length;a++)t[a].extensions?.EXT_meshopt_compression&&o.push(a);if(!o.length)return null;let{MeshoptDecoder:r}=await import('meshoptimizer');await r.ready;let n=new Map;for(let a of o){let l=t[a].extensions.EXT_meshopt_compression,s=l.byteOffset??0,c=e.subarray(s,s+l.byteLength),f=new Uint8Array(l.count*l.byteStride);r.decodeGltfBuffer(f,l.count,l.byteStride,c,l.mode,l.filter??"NONE"),n.set(a,f);}return n}function ma(i){let e=G();if(i.matrix){for(let x=0;x<16;x++)e[x]=i.matrix[x];return e}Re(e);let[t,o,r]=i.translation??[0,0,0],[n,a,l,s]=i.rotation??[0,0,0,1],[c,f,h]=i.scale??[1,1,1],u=n+n,d=a+a,m=l+l,y=n*u,p=n*d,b=n*m,g=a*d,v=a*m,w=l*m,S=s*u,_=s*d,M=s*m;return e[0]=(1-(g+w))*c,e[1]=(p+M)*c,e[2]=(b-_)*c,e[4]=(p-M)*f,e[5]=(1-(y+w))*f,e[6]=(v+S)*f,e[8]=(b+_)*h,e[9]=(v-S)*h,e[10]=(1-(y+g))*h,e[12]=t,e[13]=o,e[14]=r,e}var Tc={5120:127,5121:255,5122:32767,5123:65535};function Ac(i){let e=i[0],t=i[1],o=i[2],r=i[4],n=i[5],a=i[6],l=i[8],s=i[9],c=i[10],f=e*(n*c-a*s)-r*(t*c-o*s)+l*(t*a-o*n);if(Math.abs(f)<1e-20)return [1,0,0,0,1,0,0,0,1];let h=1/f;return [(n*c-a*s)*h,(a*l-r*c)*h,(r*s-n*l)*h,(o*s-t*c)*h,(e*c-o*l)*h,(t*l-e*s)*h,(t*a-o*n)*h,(o*r-e*a)*h,(e*n-t*r)*h]}function pa(i,e,t){let o=x=>{let C=t?.get(x);if(C)return C;let T=i.bufferViews?.[x];if(!T)return null;let E=T.byteOffset??0;return e.subarray(E,E+T.byteLength)},r=[],n=[],a=[],l=[],s=[],c=[1/0,1/0,1/0],f=[-1/0,-1/0,-1/0],h=x=>{if(x===void 0)return null;let C=i.accessors?.[x];if(!C)return null;let T=Cc[C.type]??1,E=new Float64Array(C.count*T),k=C.bufferView!==void 0?i.bufferViews?.[C.bufferView]:void 0;if(!k||C.bufferView===void 0)return {data:E,components:T};let F=o(C.bufferView);if(!F)return {data:E,components:T};let L=_c[C.componentType]??4,I=k.extensions?.EXT_meshopt_compression,A=I?I.byteStride:k.byteStride,R=A&&A>0?A:L*T,P=C.byteOffset??0,z=new DataView(F.buffer,F.byteOffset,F.byteLength),O=C.normalized?Tc[C.componentType]??1:1;for(let N=0;N<C.count;N++)for(let W=0;W<T;W++){let B=P+N*R+W*L,D;switch(C.componentType){case 5120:D=z.getInt8(B);break;case 5121:D=z.getUint8(B);break;case 5122:D=z.getInt16(B,true);break;case 5123:D=z.getUint16(B,true);break;case 5125:D=z.getUint32(B,true);break;default:D=z.getFloat32(B,true);}E[N*T+W]=O===1?D:Math.max(D/O,-1);}return {data:E,components:T}},u=(x,C,T=-1)=>{if(x.mode!==void 0&&x.mode!==4)return;let E=h(x.attributes.POSITION);if(!E)return;let k=h(x.attributes.NORMAL),F=h(x.attributes.TEXCOORD_0),L=h(x.indices),I=r.length/3,A=E.data.length/3,R=Ac(C),z=(x.material!==void 0?i.materials?.[x.material]:void 0)?.pbrMetallicRoughness?.baseColorTexture?.extensions?.KHR_texture_transform,O=z?{ox:z.offset?.[0]??0,oy:z.offset?.[1]??0,sx:z.scale?.[0]??1,sy:z.scale?.[1]??1,rot:z.rotation??0}:null;for(let X=0;X<A;X++){let me=E.data[X*3],pe=E.data[X*3+1],Z=E.data[X*3+2],U=C[0]*me+C[4]*pe+C[8]*Z+C[12],j=C[1]*me+C[5]*pe+C[9]*Z+C[13],fe=C[2]*me+C[6]*pe+C[10]*Z+C[14];if(r.push(U,j,fe),U<c[0]&&(c[0]=U),j<c[1]&&(c[1]=j),fe<c[2]&&(c[2]=fe),U>f[0]&&(f[0]=U),j>f[1]&&(f[1]=j),fe>f[2]&&(f[2]=fe),k){let re=k.data[X*3],ge=k.data[X*3+1],Ae=k.data[X*3+2],ve=R[0]*re+R[3]*ge+R[6]*Ae,Jt=R[1]*re+R[4]*ge+R[7]*Ae,eo=R[2]*re+R[5]*ge+R[8]*Ae,to=Math.hypot(ve,Jt,eo);to>1e-12?(ve/=to,Jt/=to,eo/=to):(ve=0,Jt=1,eo=0),n.push(ve,Jt,eo);}else n.push(0,1,0);let ne=F?F.data[X*2]:0,ue=F?F.data[X*2+1]:0;if(O){if(O.rot!==0){let re=Math.cos(O.rot),ge=Math.sin(O.rot),Ae=re*ne+ge*ue,ve=-ge*ne+re*ue;ne=Ae,ue=ve;}ne=ne*O.sx+O.ox,ue=ue*O.sy+O.oy;}a.push(ne,ue);}let N=l.length;if(L)for(let X=0;X<L.data.length;X++)l.push(I+L.data[X]);else for(let X=0;X<A;X++)l.push(I+X);let W=x.material!==void 0?i.materials?.[x.material]:void 0,B=W?.pbrMetallicRoughness,D=B?.metallicFactor!==void 0||B?.roughnessFactor!==void 0,K=B?.baseColorFactor??[1,1,1,1],$=B?.baseColorTexture?.index,oe=$!==void 0?i.textures?.[$]?.source:void 0,ye=W?.emissiveFactor??[0,0,0],J=W?.extensions?.KHR_materials_emissive_strength?.emissiveStrength??1;s.push({indexOffset:N,indexCount:l.length-N,baseColor:[K[0],K[1],K[2],K[3]??1],metallic:D?B?.metallicFactor??1:0,roughness:D?B?.roughnessFactor??1:1,emissive:[ye[0]*J,ye[1]*J,ye[2]*J],texture:oe??-1,doubleSided:W?.doubleSided===true,blend:W?.alphaMode==="BLEND",alphaCutoff:W?.alphaMode==="MASK"?W.alphaCutoff??.5:.02,node:T});},d=i.skins?.length?null:kc(i,h),m=d?d.nodes:null,y=(x,C,T,E)=>{let k=i.nodes?.[x];if(!k)return;let F=ma(k),L=G();xe(L,C,F);let I=G(),A=E,R=m?.get(x);if(R?(R.parentNode=E,R.parent=T.slice(),Re(I),A=x):xe(I,T,F),k.mesh!==void 0)for(let z of i.meshes?.[k.mesh]?.primitives??[])u(z,I,A);let P=k.extensions?.KHR_lights_punctual?.light;if(P!==void 0){let z=i.extensions?.KHR_lights_punctual?.lights?.[P],O=z?.type;if(z&&(O==="point"||O==="spot"||O==="directional")){let N=-L[8],W=-L[9],B=-L[10],D=Math.hypot(N,W,B)||1,K=z.spot?.innerConeAngle??0,$=z.spot?.outerConeAngle??Math.PI/4;p.push({type:O,color:[z.color?.[0]??1,z.color?.[1]??1,z.color?.[2]??1],intensity:z.intensity??1,range:z.range??0,position:[L[12],L[13],L[14]],direction:[N/D,W/D,B/D],cosInner:Math.cos(K),cosOuter:Math.cos($)});}}for(let z of k.children??[])y(z,L,I,A);},p=[],b=G();Re(b);let g=G();Re(g);let v=i.scenes?.[i.scene??0]?.nodes??i.nodes?.map((x,C)=>C)??[];for(let x of v)y(x,b,g,-1);let w=[];for(let x of i.images??[]){if(x.bufferView===void 0){w.push(new Uint8Array(0));continue}let C=o(x.bufferView);w.push(C?C.slice():new Uint8Array(0));}let S=r.length/3,_=new ArrayBuffer(S*Mo),M=new Float32Array(_);for(let x=0;x<S;x++){let C=x*8;M[C]=r[x*3],M[C+1]=r[x*3+1],M[C+2]=r[x*3+2],M[C+3]=n[x*3],M[C+4]=n[x*3+1],M[C+5]=n[x*3+2],M[C+6]=a[x*2],M[C+7]=a[x*2+1];}return isFinite(c[0])||(c[0]=c[1]=c[2]=0,f[0]=f[1]=f[2]=0),{vertices:_,indices:new Uint32Array(l),primitives:s,images:w,min:c,max:f,animation:d,lights:p}}function kc(i,e){let t=i.animations?.[0];if(!t||!t.channels.length)return null;let o=new Map,r=0;for(let n of t.channels){let a=n.target.node,l=n.target.path;if(a===void 0||l!=="translation"&&l!=="rotation"&&l!=="scale")continue;let s=t.samplers[n.sampler];if(!s)continue;let c=e(s.input),f=e(s.output);if(!c||!f||!c.data.length)continue;let h=l==="rotation"?4:3,u=s.interpolation==="CUBICSPLINE",d=c.data.length,m=new Float32Array(d*h);for(let p=0;p<d;p++){let b=u?(p*3+1)*h:p*h;for(let g=0;g<h;g++)m[p*h+g]=f.data[b+g];}let y=o.get(a)??{parentNode:-1,parent:Re(G()),base:Lc(i.nodes?.[a]),channels:[]};y.channels.push({path:l,times:Float32Array.from(c.data),values:m,step:s.interpolation==="STEP"}),o.set(a,y),r=Math.max(r,c.data[d-1]);}return o.size?{duration:r||1,nodes:o}:null}function Lc(i){let e=i?.translation,t=i?.rotation,o=i?.scale;return {t:[e?.[0]??0,e?.[1]??0,e?.[2]??0],r:[t?.[0]??0,t?.[1]??0,t?.[2]??0,t?.[3]??1],s:[o?.[0]??1,o?.[1]??1,o?.[2]??1]}}function Er(i,e,t,o){let r=i.nodes.get(e);if(!r)return Re(o);let n=G();Ic(r,t,n);let a=G();if(xe(a,r.parent,n),r.parentNode<0)return ba(o,a);let l=G();return Er(i,r.parentNode,t,l),xe(o,l,a)}var ba=(i,e)=>{for(let t=0;t<16;t++)i[t]=e[t];return i};function Ic(i,e,t){let o=[...i.base.t],r=[...i.base.r],n=[...i.base.s];for(let a of i.channels){let l=a.times.length,s=a.path==="rotation"?4:3,c=0;for(;c<l-1&&a.times[c+1]<e;)c++;let f=Math.min(c+1,l-1),h=a.times[f]-a.times[c],u=a.step||h<=0?0:Math.min(Math.max((e-a.times[c])/h,0),1),d=c*s,m=f*s;if(a.path==="rotation"){let y=0;for(let g=0;g<4;g++)y+=a.values[d+g]*a.values[m+g];let p=y<0?-1:1,b=0;for(let g=0;g<4;g++)r[g]=a.values[d+g]*(1-u)+a.values[m+g]*p*u,b+=r[g]*r[g];b=Math.sqrt(b)||1;for(let g=0;g<4;g++)r[g]/=b;}else {let y=a.path==="translation"?o:n;for(let p=0;p<3;p++)y[p]=a.values[d+p]*(1-u)+a.values[m+p]*u;}}return ba(t,ma({translation:o,rotation:r,scale:n}))}var Te=5126,Ec=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),ya={stride:Mo,attribs:[{name:"a_pos",size:3,type:Te,offset:0},{name:"a_normal",size:3,type:Te,offset:12},{name:"a_tex",size:2,type:Te,offset:24}]},zr=class{constructor(e,t,o,r){this.vao=e;this.vbo=t;this.ibo=o;this.textures=r;this.users=0;this.instVao=null;}destroy(e){this.vao.destroy(),this.instVao?.destroy(),this.vbo.destroy(),this.ibo.destroy();for(let t of this.textures)t&&e.deleteTexture(t);}},Fr=256,To=41,ga={stride:To*4,attribs:[{name:"a_i_m0",size:4,type:Te,offset:0,divisor:1},{name:"a_i_m1",size:4,type:Te,offset:16,divisor:1},{name:"a_i_m2",size:4,type:Te,offset:32,divisor:1},{name:"a_i_m3",size:4,type:Te,offset:48,divisor:1},{name:"a_i_s0",size:4,type:Te,offset:64,divisor:1},{name:"a_i_s1",size:4,type:Te,offset:80,divisor:1},{name:"a_i_s2",size:4,type:Te,offset:96,divisor:1},{name:"a_i_s3",size:4,type:Te,offset:112,divisor:1},{name:"a_i_n0",size:3,type:Te,offset:128,divisor:1},{name:"a_i_n1",size:3,type:Te,offset:140,divisor:1},{name:"a_i_n2",size:3,type:Te,offset:152,divisor:1}]},Pt=2,ht=16,Ue=class{constructor(){this.models=[];this.gpu=new H;this.counted=new Set;this.instBuffer=null;this.instScratch=new Float32Array(Fr*To);this.drawnInstanced=new Set;this.onLoaded=null;this.growDurationSec=.45;this.fadeDurationSec=.6;this.transitioning=false;this.depthTimeSec=0;this.lightPacks=new WeakMap;this.shadow32=new Float32Array(16);this.shadowNode32=new Float32Array(16);this.shadowNodeColor32=new Float32Array(16);}add(e){this.models.includes(e)||(this.models.push(e),e.isLoaded||e.load(()=>this.onLoaded?.()));}remove(e,t){let o=this.models.indexOf(e);if(o<0)return;this.models.splice(o,1);let r=this.gpu.get(e.url);r&&(this.counted.delete(e)&&r.users--,!(r.users>0)&&(t&&r.destroy(t),this.gpu.delete(e.url)));}get all(){return this.models}get hasTransitions(){return this.transitioning}get hasAnimated(){return this.models.some(e=>e.isAnimated)}get isEmpty(){return this.models.length===0}get readyCount(){return this.models.filter(e=>e.visible&&e.isLoaded).length}render(e,t,o,r,n,a,l=0,s){if(this.models.length){this.drawnInstanced.clear(),s&&this.renderInstanced(e,t,s.shader,s.locations,n,a),o.use(),n(o),o.setInt("u_base_texture",Pt);for(let c of this.models){if(this.drawnInstanced.has(c)||!this.inView(t,c))continue;let f=c.visible&&c.fade>0?this.gpuFor(e,c,r):null;if(!f||!c.mesh)continue;let h=c.fade<1;o.setFloat("u_opacity",c.fade);let u=c.matrixFor(t);o.setMat4("u_matrix",u),o.setMat3("u_normal_matrix",c.normalMatrix());let d=a?this.shadowMatrix(t,c):null;this.uploadLights(o,c.mesh);let m=c.cameraInModelSpace(t);o.setVec3("u_camera_model",m[0],m[1],m[2]),o.setFloat("u_reflect",1),f.vao.bind();for(let y of [false,true])if(!(h&&!y))for(let p of c.mesh.primitives){if(!h&&p.blend!==y)continue;o.setMat4("u_matrix",p.node>=0?c.matrixForNode(t,p.node,l):u),d&&o.setMat4("u_shadow_matrix",p.node>=0?this.shadowMatrixForNodeAt(t,c,p.node,l):d);let b=p.texture>=0?f.textures[p.texture]:null;o.setFloat("u_has_texture",b?1:0),o.setFloat("u_alpha_cutoff",p.alphaCutoff),b&&e.bindTexture(Pt,b),o.setVec4v("u_base_color",p.baseColor),o.setVec3("u_emissive",p.emissive[0],p.emissive[1],p.emissive[2]),o.setFloat("u_metallic",p.metallic),o.setFloat("u_roughness",p.roughness),e.setCull(p.doubleSided?"none":"back"),e.setBlend(y?"premultiplied":"none"),e.setDepthMask(!y),e.gl.drawElements(e.gl.TRIANGLES,p.indexCount,e.gl.UNSIGNED_INT,p.indexOffset*4);}}e.bindVAO(null),e.setCull("back"),e.setBlend("premultiplied"),e.setDepthMask(true);}}renderInstanced(e,t,o,r,n,a){let l=new H;for(let c of this.models){if(!c.visible||c.fade<1||!c.mesh||!c.isLoaded||!this.inView(t,c)||c.mesh.primitives.some(h=>h.blend||h.node>=0))continue;let f=l.get(c.url);f?f.push(c):l.set(c.url,[c]);}let s=false;o.setFloat("u_reflect",0);for(let[,c]of l){if(c.length<2)continue;let f=this.gpuFor(e,c[0],r);if(!f||!c[0].mesh)continue;this.instBuffer||(this.instBuffer=new be(e,this.instScratch,ga,true)),f.instVao||(f.instVao=new ae(e,[{buffer:f.vbo,locations:r},{buffer:this.instBuffer,locations:r}],f.ibo)),s||(o.use(),n(o),o.setInt("u_base_texture",Pt),o.setFloat("u_opacity",1),s=true);let h=c[0].mesh;for(let u=0;u<c.length;u+=Fr){let d=Math.min(Fr,c.length-u);for(let m=0;m<d;m++){let y=c[u+m],p=m*To;this.instScratch.set(y.matrixFor(t),p);let b=a?this.shadowMatrix(t,y):Ec;this.instScratch.set(b,p+16),this.instScratch.set(y.normalMatrix(),p+32),this.drawnInstanced.add(y);}this.instBuffer.update(this.instScratch.subarray(0,d*To)),e.bindVAO(f.instVao.vao);for(let m of h.primitives){let y=m.texture>=0?f.textures[m.texture]:null;o.setFloat("u_has_texture",y?1:0),o.setFloat("u_alpha_cutoff",m.alphaCutoff),y&&e.bindTexture(Pt,y),o.setVec4v("u_base_color",m.baseColor),o.setVec3("u_emissive",m.emissive[0],m.emissive[1],m.emissive[2]),o.setFloat("u_metallic",m.metallic),o.setFloat("u_roughness",m.roughness),e.setCull(m.doubleSided?"none":"back"),e.setBlend("none"),e.setDepthMask(true),e.gl.drawElementsInstanced(e.gl.TRIANGLES,m.indexCount,e.gl.UNSIGNED_INT,m.indexOffset*4,d);}}}s&&e.bindVAO(null);}uploadLights(e,t){let o=this.lightPacks.get(t);if(!o){let r=t.lights.filter(f=>f.type!=="directional"),n=r.length<=ht?r:[...r].sort((f,h)=>h.intensity-f.intensity).slice(0,ht),a=new Float32Array(ht*4),l=new Float32Array(ht*4),s=new Float32Array(ht*4),c=new Float32Array(ht*4);n.forEach((f,h)=>{let u=h*4;a[u]=f.position[0],a[u+1]=f.position[1],a[u+2]=f.position[2],a[u+3]=f.range,l[u]=f.color[0]*f.intensity,l[u+1]=f.color[1]*f.intensity,l[u+2]=f.color[2]*f.intensity,l[u+3]=f.type==="spot"?1:0,s[u]=f.direction[0],s[u+1]=f.direction[1],s[u+2]=f.direction[2],c[u]=f.cosInner,c[u+1]=f.cosOuter;}),o={count:n.length,pos:a,color:l,dir:s,cone:c},this.lightPacks.set(t,o);}e.setInt("u_light_count",o.count),o.count!==0&&(e.setVec4Array("u_light_pos",o.pos),e.setVec4Array("u_light_color",o.color),e.setVec4Array("u_light_dir",o.dir),e.setVec4Array("u_light_cone",o.cone));}inView(e,t){if(!t.mesh)return false;let r=t.origin(),n=t.boundingRadiusM();return e.isSphereVisible(r.x,r.y,t.altitude+n*.5,n)}advanceTransitions(){this.transitioning=false;for(let e of this.models)e.advanceGrow(this.growDurationSec)&&(this.transitioning=true),e.advanceFade(this.fadeDurationSec)&&(this.transitioning=true);}renderDepth(e,t,o,r){if(this.models.length){o.use();for(let n of this.models){let a=n.visible&&n.fade>.5?this.gpuFor(e,n,r):null;if(!a||!n.mesh)continue;let l=this.shadowMatrix(t,n);o.setMat4("u_matrix",l),a.vao.bind();for(let s of n.mesh.primitives)s.blend||(o.setMat4("u_matrix",s.node>=0?this.shadowMatrixForNode(t,n,s.node):l),e.gl.drawElements(e.gl.TRIANGLES,s.indexCount,e.gl.UNSIGNED_INT,s.indexOffset*4));}e.bindVAO(null);}}shadowMatrix(e,t){let o=t.origin();return t.matrixInSpace(e.shadowObjectMatrix(o.x,o.y,t.altitude),this.shadow32)}shadowMatrixForNode(e,t,o){return this.shadowMatrixForNodeInto(e,t,o,this.depthTimeSec,this.shadowNode32)}shadowMatrixForNodeAt(e,t,o,r){return this.shadowMatrixForNodeInto(e,t,o,r,this.shadowNodeColor32)}shadowMatrixForNodeInto(e,t,o,r,n){let a=t.origin();return t.matrixInSpaceForNode(e.shadowObjectMatrix(a.x,a.y,t.altitude),o,r,n)}gpuFor(e,t,o){let r=this.gpu.get(t.url);if(r)return this.counted.has(t)||(this.counted.add(t),r.users++),r;if(!t.mesh)return null;let n=e.gl,a=new be(e,new Uint8Array(t.mesh.vertices),ya),l=new se(e,t.mesh.indices),s=new ae(e,[{buffer:a,locations:o}],l),c=t.bitmaps.map(h=>{if(!h)return null;let u=n.createTexture();return u?(e.bindTexture(Pt,u),n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,h),n.generateMipmap(n.TEXTURE_2D),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,n.LINEAR_MIPMAP_LINEAR),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,n.LINEAR),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,n.REPEAT),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,n.REPEAT),u):null}),f=new zr(s,a,l,c);return f.users=1,this.counted.add(t),this.gpu.set(t.url,f),f}static get layout(){return ya}static get instanceLayout(){return ga}destroy(e){for(let t of this.gpu.values())t.destroy(e);this.gpu.clear(),this.models=[];}};var Rr=4,va=new Q;function Fc(i){va.has(i)||(va.add(i),console.warn(`[osmgl] ${i}`));}var zc=.5,Rc=.01,Hc=300,Hr=127,Pr=128,Ot=5120,Lo=5121,Wt=5122,wa=5123,Vt=5126,Pc={stride:8,attribs:[{name:"a_pos",size:2,type:Vt,offset:0}]},Or={stride:De,attribs:[{name:"a_pos",size:2,type:Wt,offset:0}]},xa={stride:Ge,attribs:[{name:"a_p0",size:2,type:Wt,offset:0},{name:"a_p1",size:2,type:Wt,offset:4},{name:"a_corner",size:2,type:Ot,offset:8},{name:"a_ground",size:2,type:Ot,offset:10},{name:"a_dist",size:1,type:Vt,offset:12},{name:"a_width",size:1,type:Vt,offset:16}]},Ao={stride:Me,attribs:[{name:"a_pos",size:2,type:Wt,offset:0},{name:"a_height",size:1,type:wa,offset:4},{name:"a_tint",size:1,type:Lo,normalized:true,offset:6},{name:"a_ao",size:1,type:Lo,normalized:true,offset:7},{name:"a_normal",size:3,type:Ot,normalized:true,offset:8},{name:"a_kind",size:1,type:Lo,offset:11},{name:"a_wall",size:3,type:wa,offset:12}]},Oc={flat:0,water:1,foliage:2,sand:3,asphalt:4},Wc=[1,9,14,26,3],_a={stride:it,attribs:[{name:"a_pos",size:2,type:Vt,offset:0},{name:"a_level",size:1,type:Wt,offset:8},{name:"a_normal",size:3,type:Ot,normalized:true,offset:10},{name:"a_kind",size:1,type:Lo,offset:13},{name:"a_bleed",size:2,type:Ot,offset:14}]},Wr=class{constructor(e,t,o,r,n,a,l=r){this.vao=e;this.buffer=t;this.ibo=o;this.indexCount=r;this.indexType=n;this.extent=a;this.capIndexOffset=l;this.firstDrawTime=0;}destroy(){this.vao.destroy(),this.buffer.destroy(),this.ibo.destroy();}},Sa={enabled:false,resolution:1024,strength:.75,color:"#5a6b86",bias:.25},Bt=class{constructor(){this.fill=null;this.surface=null;this.surfaceLocs=new H;this.line=null;this.building=null;this.depth=null;this.groundShadow=null;this.sky=null;this.raster=null;this.rasterLayer=new xo;this.globeBody=null;this.globeClip=null;this.globeMesh=null;this.quad=null;this.fillLocs=new H;this.lineLocs=new H;this.objectLine=null;this.objectLineLocs=new H;this.buildingLocs=new H;this.shadows={...Sa};this.shadowTarget=null;this.shadowPlaceholder=null;this.fog=null;this.shadowActive=false;this.materialTime=0;this.materialAnimating=false;this.stencilIds=new H;this.patternScale=1;this.detailScale=1;this.reliefScale=1;this.allowShadows=true;this.highlight=null;this.highlightGpu=new H;this.highlightKey="";this.groundArrows=new Et;this.highlightTris=new H;this.fillHighlightGpu=new H;this.fillHighlightKey="";this.footprintKey="";this.highlightFill=null;this.indoorMask=new Ft;this.hiddenBuildings=new Set;this.hiddenVenues=new Set;this.hiddenVenueLayer=null;this.hiddenCut=new H;this.hiddenStamp="";this.shadowDepthPerMeter=1;this.shadowTexelMeters=0;this.growDurationMs=350;this.symbols=null;this.objects=null;this.models=new Ue;this.model=null;this.modelInstanced=null;this.modelDepth=null;this.modelLocs=new H;this.modelInstLocs=new H;}get indoorOpen(){return this.indoorMask.active}syncHiddenStamp(){let e=o=>[...o].sort((r,n)=>r-n).join(","),t=e(this.hiddenBuildings)+"#"+e(this.hiddenVenues);if(t!==this.hiddenStamp){this.hiddenStamp=t;for(let o of this.hiddenCut.values())o?.vao.destroy(),o?.ibo.destroy();this.hiddenCut.clear();}}hiddenFor(e,t){return t?this.hiddenBuildings:e===this.hiddenVenueLayer?this.hiddenVenues:null}cutHidden(e,t,o,r,n,a){if(!a||!a.size)return null;let l=r+"|"+o,s=this.hiddenCut.get(l);if(s!==void 0&&(s===null||s.vbo===n))return s;s&&(s.vao.destroy(),s.ibo.destroy());let c=t.data?.buckets?.[o];if(!c||c.kind!=="fill-extrusion"||!c.featureIds)return null;let f=new Uint32Array(c.indices),h=new Float64Array(c.featureIds),u=[];for(let m=0;m*3<f.length;m++)a.has(h[m])||u.push(f[m*3],f[m*3+1],f[m*3+2]);let d=null;if(u.length<f.length){let m=new se(e,new Uint32Array(u));d={vao:new ae(e,[{buffer:n,locations:this.buildingLocs}],m),ibo:m,count:u.length,vbo:n};}return this.hiddenCut.set(l,d),d}init(e){this.symbols?.init(e),this.fill=new ce(e,"fill",Ki,$i),this.surface=new ce(e,"surface",oa,ra),this.line=new ce(e,"line",qi,Zi),this.objectLine=new ce(e,"objectLine",Qi,Ji),this.building=new ce(e,"buildings",ea,ta),this.depth=new ce(e,"depth",Wi,br),this.groundShadow=new ce(e,"groundShadow",Xi,Yi),this.sky=new ce(e,"sky",Gi,Ni),this.raster=new ce(e,"raster",Ui,ji),this.globeBody=new ce(e,"globeBody",Ri,Hi),this.globeClip=new ce(e,"globeClip",Pi,Oi),this.globeMesh=Vc(e,this.globeBody),this.model=new ce(e,"model",Vi,yr),this.modelInstanced=new ce(e,"model-instanced",Bi,yr),this.modelDepth=new ce(e,"modelDepth",Di,br);for(let n of Ue.layout.attribs)this.modelLocs.set(n.name,this.model.attribLocation(n.name));for(let n of [...Ue.layout.attribs,...Ue.instanceLayout.attribs])this.modelInstLocs.set(n.name,this.modelInstanced.attribLocation(n.name));this.shadowPlaceholder=Fi(e);let t=new H([["a_pos",this.groundShadow.attribLocation("a_pos")]]),o=new be(e,new Float32Array([0,0,1,0,1,1,0,1]),Pc),r=new se(e,new Uint16Array([0,1,2,0,2,3]));this.quad={vao:new ae(e,[{buffer:o,locations:t}],r),vbo:o,ibo:r};for(let n of Or.attribs)this.fillLocs.set(n.name,this.fill.attribLocation(n.name));for(let n of _a.attribs)this.surfaceLocs.set(n.name,this.surface.attribLocation(n.name));for(let n of xa.attribs)this.lineLocs.set(n.name,this.line.attribLocation(n.name));for(let n of Lr.attribs)this.objectLineLocs.set(n.name,this.objectLine.attribLocation(n.name));for(let n of Ao.attribs)this.buildingLocs.set(n.name,this.building.attribLocation(n.name));}render(e,t,o,r,n,a=new H){if(!this.fill||!this.line||!this.building)return false;let l=t.zoom,s=false;this.materialTime=n/1e3,this.materialAnimating=false,this.fog=ut(t,r),this.patternScale=no/Math.max(Le(t.center.lat),1);let c=u=>o.get(u.source??Y);this.syncHighlightFootprint(o,r),this.indoorMask.sync(o,r,l),this.syncHiddenStamp(),this.models.advanceTransitions(),this.renderShadowMap(e,t,o,r,n),this.drawSky(e,t,r),this.drawGlobeBody(e,t,r),this.raster&&this.quad&&this.rasterLayer.render(e,t,this.quad.vao,this.raster,r,a,l),this.drawTileStencil(e,t,o),e.setDepthTest(t.globeActive),e.setDepthFunc("lequal"),e.setDepthMask(false),e.setBlend("premultiplied"),e.setCull("none");let f=u=>u.type==="line"&&V(u.paint.elevation,l,0)!==0;for(let u of r.layers){if(u.type==="raster"||u.type==="fill-extrusion"||u.type==="symbol"||u.overlay||f(u)||!r.layerVisibleAt(u,l))continue;let d=c(u);if(d){if(u.type==="surface"){if(!this.flattened(d,r,u))continue;this.drawFill(e,t,d,r,u,l);continue}u.type==="fill"?this.drawFill(e,t,d,r,u,l):this.drawLine(e,t,d,r,u,l);}}this.drawFillHighlight(e,t,o,r),this.groundArrows&&(this.groundArrows.highlightFootprint=this.highlightFootprint(),this.groundArrows.render(e,t,o,r,this.fill,this.fillLocs,u=>{this.applyFogUniforms(u,t,r),u.setVec4("u_globe",0,0,0,0),u.setInt("u_material",0),u.setFloat("u_elevation",0),u.setVec2("u_world_origin",0,0);},this.shadowActive)),this.drawGroundShadow(e,t,o,r),this.drawEarthDepth(e,t,o,r),e.setDepthTest(true),e.setDepthMask(true),e.setDepthFunc("lequal"),e.setCull("back");for(let u of r.layers){if(u.type!=="surface"||u.overlay||!r.layerVisibleAt(u,l))continue;let d=c(u);d&&(this.flattened(d,r,u)||this.drawSurface(e,t,d,r,u,l));}e.setStencilTest(false),e.setDepthMask(false),e.setBlend("premultiplied"),e.setCull("none"),e.setDepthTest(false);for(let u of r.layers){if(u.type==="raster"||!f(u)||u.overlay||!r.layerVisibleAt(u,l))continue;let d=c(u);d&&this.drawLine(e,t,d,r,u,l);}e.setDepthTest(true),e.setDepthMask(true),e.setCull("back");for(let u of r.layers){if(u.type!=="fill-extrusion"||!r.layerVisibleAt(u,l))continue;let d=c(u);d&&(this.drawBuildings(e,t,d,r,u,l,n)&&(s=true),this.drawHighlight(e,t,d,r,u,l));}this.model&&!this.models.isEmpty&&(this.models.render(e,t,this.model,this.modelLocs,u=>{this.applyShadowUniforms(u),this.applyFogUniforms(u,t,r),this.applyLight(u,r);},this.shadowActive,n/1e3,this.modelInstanced?{shader:this.modelInstanced,locations:this.modelInstLocs}:void 0),(this.models.hasAnimated||this.models.hasTransitions)&&(s=true)),e.setDepthTest(false),e.setDepthMask(false),e.setCull("none");for(let u of r.layers){if(u.type==="raster"||!u.overlay||u.type==="symbol"||u.type==="fill-extrusion"||!r.layerVisibleAt(u,l))continue;let d=c(u);if(d){if(u.type==="surface"){this.flattened(d,r,u)?this.drawFill(e,t,d,r,u,l):this.drawSurface(e,t,d,r,u,l),e.setDepthTest(false),e.setDepthMask(false),e.setCull("none");continue}u.type==="fill"?this.drawFill(e,t,d,r,u,l):this.drawLine(e,t,d,r,u,l);}}this.objects&&!this.objects.isEmpty&&(e.setDepthTest(true),e.setDepthFunc("lequal"),e.setDepthMask(false),e.setBlend("premultiplied"),e.setCull("none"),this.objects.render(e,t,this.fill,this.fillLocs,this.objectLine,this.objectLineLocs,u=>{this.applyFogUniforms(u,t,r),u.setVec4("u_globe",0,0,0,0),u.setInt("u_material",0),u.setFloat("u_elevation",0),u.setVec2("u_world_origin",0,0);},this.shadowActive),e.setDepthTest(false)),this.raster&&this.quad&&this.rasterLayer.render(e,t,this.quad.vao,this.raster,r,a,l,true);let h=r.layers.filter(u=>u.type==="line"&&V(u.paint.ghostOpacity,l,0)>.001&&r.layerVisibleAt(u,l));if(h.length){e.setDepthTest(true),e.setDepthFunc("greater"),e.setDepthMask(false),e.setBlend("premultiplied"),e.setCull("none");for(let u of h){let d=c(u);d&&this.drawLine(e,t,d,r,u,l,V(u.paint.ghostOpacity,l,0));}e.setDepthFunc("lequal"),e.setDepthTest(false);}return this.objects&&!this.objects.isEmpty&&(e.setDepthTest(true),e.setDepthFunc("greater"),e.setDepthMask(false),e.setBlend("premultiplied"),e.setCull("none"),this.objects.render(e,t,this.fill,this.fillLocs,this.objectLine,this.objectLineLocs,u=>{this.applyFogUniforms(u,t,r),u.setVec4("u_globe",0,0,0,0),u.setInt("u_material",0),u.setFloat("u_elevation",0),u.setVec2("u_world_origin",0,0);},this.shadowActive,true),e.setDepthFunc("lequal"),e.setDepthTest(false)),this.symbols&&(this.symbols.highlightFootprint=this.highlightFootprint()),this.symbols?.render(e,t,o,r),e.bindVAO(null),s||this.materialAnimating}renderShadowMap(e,t,o,r,n){if(this.shadowPlaceholder&&e.bindTexture(Rr,this.shadowPlaceholder),this.shadowActive=false,!this.shadows.enabled||!this.allowShadows||!this.depth)return;let a=r.layers.filter(h=>h.type==="fill-extrusion"&&!h.overlay&&r.layerVisibleAt(h,t.zoom));if(!a.length&&this.models.isEmpty)return;this.shadowTarget?this.shadowTarget.resize(this.shadows.resolution):this.shadowTarget=new Lt(e,this.shadows.resolution);let l=r.light;if(t.updateShadow(ko(l.keyAzimuth,l.keyAltitude),Hc),!t.shadowReady)return;let s=this.shadowTarget;s.bind(),e.setDepthFunc("lequal"),e.setBlend("none"),e.setCull("none");let c=e.gl;c.enable(c.POLYGON_OFFSET_FILL),c.polygonOffset(2,4);let f=this.depth;f.use();for(let h of a){let u=o.get(h.source??Y);if(!u)continue;let d=r.bucketKeyFor(h);if(d===null)continue;let m=V(h.paint.heightScale,t.zoom,1);(h.source??Y)===Y&&this.indoorMask.prepare(u,d);for(let y of u.visibleTiles){if(!this.drawsTile(t,r,h,y))continue;let p=u.getTile(y),b=p&&this.bucketFor(e,p,d,Ao,this.buildingLocs,"fill-extrusion");if(!b)continue;f.setFloat("u_height_scale",this.growScale(b,n,!u.warm)*m),f.setMat4("u_matrix",t.shadowTileMatrix(y,b.extent));let g=(h.source??Y)===Y,v=this.cutHidden(e,p,d,y.dataKey,b.buffer,this.hiddenFor(d,g)),w=g?v??this.indoorMask.indicesFor(e,p,d,y,b.buffer,this.buildingLocs):v;w?(w.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,w.count,e.gl.UNSIGNED_INT,0)):(b.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,b.indexCount,b.indexType,0));}}this.modelDepth&&(this.models.depthTimeSec=n/1e3,e.gl.polygonOffset(6,96),this.models.renderDepth(e,t,this.modelDepth,this.modelLocs),e.gl.polygonOffset(2,4)),c.disable(c.POLYGON_OFFSET_FILL),e.bindFramebuffer(null),e.viewport(0,0,e.gl.drawingBufferWidth,e.gl.drawingBufferHeight),s.bindTexture(Rr),this.shadowDepthPerMeter=t.shadowDepthPerMeter(),this.shadowTexelMeters=Math.abs(t.shadowTexelWorldSize(s.size))/(t.pixelsPerMeter||1),this.shadowActive=true;}drawGlobeBody(e,t,o){if(!t.globeActive||!this.globeBody||!this.globeMesh)return;let r=this.globeBody;r.use(),this.applyGlobeUniforms(r,t),r.setMat4("u_matrix",t.localMatrix());let n=o.background;r.setVec3("u_body_color",n[0],n[1],n[2]),Oe(r,"u_atmo_color",o.sky.horizonColor),r.setFloat("u_atmo_strength",o.sky.enabled?1-t.globeFlatMix:0),e.setBlend("none"),e.setDepthTest(true),e.setDepthMask(true),e.setDepthFunc("less"),e.setCull("none"),this.globeMesh.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,this.globeMesh.count,e.gl.UNSIGNED_SHORT,0),e.bindVAO(null),this.drawGlobeClip(e,t),e.setBlend("premultiplied"),e.setDepthTest(false),e.setDepthMask(false);}drawGlobeClip(e,t){if(!this.globeClip||!this.quad)return;let o=e.gl,r=[0,0,-t.globeRadiusPx,1],n=[0,0,0,0];if(ie(n,t.localProjMatrix,r),n[3]<=1e-6)return;let a=this.globeClip;a.use(),a.setFloat("u_center_depth",n[2]/n[3]),o.colorMask(false,false,false,false),e.setDepthTest(true),e.setDepthMask(true),e.setDepthFunc("always"),this.quad.vao.bind(),o.drawElements(o.TRIANGLES,6,o.UNSIGNED_SHORT,0),o.colorMask(true,true,true,true),e.bindVAO(null);}drawSky(e,t,o){if(!this.sky||!this.quad||!o.sky.enabled)return;let r=this.sky;r.use(),Oe(r,"u_sky_color",o.sky.skyColor),Oe(r,"u_horizon_color",o.sky.horizonColor);let n=t.width>0?e.gl.drawingBufferWidth/t.width:1,a=t.horizonScreenY(),l=(t.height-a)*n,s=Math.max(a,1)*n,c=Math.min(s*.5,t.height*n*.1);r.setVec3("u_sky_params",l,o.sky.horizonBlend*s,c);let f=t.globeActive?1-t.globeFlatMix:0;if(r.setVec2("u_space",f,o.sky.starIntensity),f>.001){Oe(r,"u_space_color",o.sky.spaceColor),Oe(r,"u_atmo_color",o.sky.atmosphereColor);let h=t.globeDisc();r.setVec4("u_globe_disc",h.dir[0],h.dir[1],h.dir[2],h.angle);let[u,d,m,y]=t.localRayCorners();r.setVec3("u_ray_tl",u[0],u[1],u[2]),r.setVec3("u_ray_tr",d[0],d[1],d[2]),r.setVec3("u_ray_bl",m[0],m[1],m[2]),r.setVec3("u_ray_br",y[0],y[1],y[2]);}e.setDepthTest(false),e.setDepthMask(false),e.setBlend("premultiplied"),e.setCull("none"),this.quad.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,6,e.gl.UNSIGNED_SHORT,0),e.bindVAO(null);}applyGlobeUniforms(e,t){if(!t.globeActive){e.setVec4("u_globe",0,0,0,0);return}let o=t.globeBasis,r=t.worldSize;e.setVec4("u_globe",1,t.globeFlatMix,t.globeRadiusPx,r),e.setVec2("u_globe_center",t.centerPointPx.x/r,t.centerPointPx.y/r);let n=t.globeCamera();e.setVec4("u_globe_cam",n.dir[0],n.dir[1],n.dir[2],n.horizonCos),e.setMat3("u_globe_basis",[o.east[0],o.south[0],o.up[0],o.east[1],o.south[1],o.up[1],o.east[2],o.south[2],o.up[2]]);}applyTileMatrix(e,t,o,r){if(t.globeActive){let n=o.bounds();e.setVec3("u_tile_merc",n.minX,n.minY,(n.maxX-n.minX)/r),e.setMat4("u_matrix",t.localMatrix());return}e.setMat4("u_matrix",t.tileMatrix(o,r));}applyFogUniforms(e,t,o){let r=this.fog??ut(t,o);if(r.intensity<=0){e.setVec3("u_fog_range",0,1,0);return}Oe(e,"u_fog_color",o.sky.horizonColor),e.setVec3("u_fog_range",r.near,r.far,r.intensity);}drawsTile(e,t,o,r){let n=this.fog;if(!n)return true;let a=e.distanceToTile(r);return a>n.cutoff?false:t.layerVisibleAt(o,e.detailZoom(a))}earthDepthLevel(e,t){let o=0;for(let n of e.layers)n.type==="surface"?o=Math.min(o,(n.elevation-(n.bevelDrop??0))*this.reliefScale):n.type==="line"&&(o=Math.min(o,V(n.paint.elevation,t.zoom,0)*this.reliefScale));let r=Math.max(zc/Math.max(t.pixelsPerMeter,1e-9),Rc);return o-r}clipToTile(e,t){let o=this.stencilIds.get(t.dataKey);e.setStencilTest(o!==void 0),o!==void 0&&e.gl.stencilFunc(e.gl.EQUAL,o,Hr);}drawTileStencil(e,t,o){this.stencilIds.clear();let r=o.get(Y);if(!r||!this.fill||!this.quad)return;let n=r.visibleTiles;if(!n.length||n.length>Hr)return;let a=e.gl;a.stencilMask(255),e.clear(null,false,true),e.setStencilTest(true),a.stencilOp(a.KEEP,a.KEEP,a.REPLACE),e.setColorMask(false),e.setDepthTest(false),e.setDepthMask(false),e.setCull("none");let l=this.fill;l.use(),l.setVec4("u_globe",0,0,0,0),l.setInt("u_material",0),l.setVec2("u_world_origin",0,0),l.setVec4("u_color",0,0,0,1),l.setFloat("u_elevation",0),this.quad.vao.bind();let s=0;for(let c of n)s++,this.stencilIds.set(c.dataKey,s),a.stencilFunc(a.ALWAYS,s,Hr),l.setMat4("u_matrix",t.tileMatrix(c,1)),a.drawElements(a.TRIANGLES,6,a.UNSIGNED_SHORT,0);e.bindVAO(null),e.setColorMask(true),a.stencilOp(a.KEEP,a.KEEP,a.KEEP),e.setStencilTest(false);}drawEarthDepth(e,t,o,r){if(!this.fill||!this.quad)return;let n=o.get(Y);if(!n)return;let a=this.fill;a.use(),this.applyFogUniforms(a,t,r),a.setVec4("u_globe",0,0,0,0),a.setInt("u_material",0),a.setVec2("u_world_origin",0,0),a.setVec4("u_color",0,0,0,1),a.setFloat("u_elevation",0);let l=this.earthDepthLevel(r,t);e.gl.colorMask(false,false,false,false),e.setDepthTest(true),e.setDepthFunc("lequal"),e.setDepthMask(true),e.setCull("none"),e.gl.enable(e.gl.POLYGON_OFFSET_FILL),e.gl.polygonOffset(1,8),this.quad.vao.bind();let s=new Float32Array(16);for(let c of n.visibleTiles){let f=t.tileMatrix(c,1);s.set(f);for(let h=0;h<4;h++)s[12+h]+=l*f[8+h];a.setMat4("u_matrix",s),e.gl.drawElements(e.gl.TRIANGLES,6,e.gl.UNSIGNED_SHORT,0);}e.bindVAO(null),e.gl.disable(e.gl.POLYGON_OFFSET_FILL),e.gl.colorMask(true,true,true,true);}drawGroundShadow(e,t,o,r){if(!this.shadowActive||!this.groundShadow||!this.quad)return;let n=o.get(Y);if(!n)return;let a=this.groundShadow;a.use(),this.applyShadowUniforms(a),this.applyFogUniforms(a,t,r);let l=r.light,[,,s]=ko(l.keyAzimuth,l.keyAltitude),c=Math.max(-s,0),f=le(l.ambientColor),h=le(l.keyColor),u=[0,0,0];for(let d=0;d<3;d++){let m=f[d]*l.ambientIntensity,y=h[d]*l.keyIntensity*c;u[d]=m>0?m/(m+y):1;}a.setVec3("u_shadow_ground",u[0],u[1],u[2]),a.setFloat("u_ground_ndotl",c),e.setBlend("multiply"),e.setDepthTest(false),e.setDepthMask(false),e.setCull("none"),this.quad.vao.bind();for(let d of n.visibleTiles)a.setMat4("u_shadow_matrix",t.shadowTileMatrix(d,1)),a.setMat4("u_matrix",t.tileMatrix(d,1)),e.gl.drawElements(e.gl.TRIANGLES,6,e.gl.UNSIGNED_SHORT,0);e.setBlend("premultiplied");}applyShadowUniforms(e){if(e.setInt("u_shadow_map",Rr),!this.shadowActive){e.setVec4("u_shadow_params",0,0,0,0);return}let t=this.shadowTarget?.size??1,r=Math.max(this.shadows.bias,1.5*this.shadowTexelMeters)*(this.shadowDepthPerMeter||1);e.setVec4("u_shadow_params",this.shadows.strength,1/t,r,1),e.setFloat("u_shadow_normal_offset",1.5*2/t);let n=le(this.shadows.color);e.setVec3("u_shadow_color",n[0],n[1],n[2]);}get shadowsActive(){return this.shadowActive}applyTileScale(e,t,o){let r=No(t.z)/this.patternScale;e.setFloat("u_meters_per_unit",r/o);let[n,a]=vn(t.z,t.x,t.y);e.setVec2("u_world_origin",n/this.patternScale,a/this.patternScale);}applyMaterial(e,t,o){let r=t.paint&&"material"in t.paint?t.paint.material:void 0,n=this.detailScale<=0?0:Oc[r??"flat"]??0;if(e.setInt("u_material",n),n===0)return;let a=t.paint,l=V(a.materialStrength,o,1)*this.detailScale,s=V(a.materialScale,o,Wc[n]),c=V(a.materialSpeed,o,n===1?1:0);e.setVec4("u_material_params",l,s,c,this.materialTime),c>0&&l>.004&&(this.materialAnimating=true);}drawFill(e,t,o,r,n,a){let l=this.fill,s=r.colorAt(n,a),c=V(n.paint?.opacity,a,1);if(c<=.001)return;l.use(),this.applyFogUniforms(l,t,r),this.applyGlobeUniforms(l,t),this.applyLight(l,r),this.applyMaterial(l,n,a),l.setVec4v("u_color",_e([s[0],s[1],s[2],s[3]*c]));let f=r.bucketKeyFor(n);if(f!==null){for(let h of o.visibleTiles){if(!this.drawsTile(t,r,n,h))continue;let u=o.getTile(h),d=u&&this.bucketFor(e,u,f,Or,this.fillLocs,"fill");d&&(this.clipToTile(e,h),this.shadowActive&&l.setMat4("u_shadow_matrix",t.shadowTileMatrix(h,d.extent)),this.applyTileScale(l,h,d.extent),this.applyTileMatrix(l,t,h,d.extent),d.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,d.indexCount,d.indexType,0));}e.setStencilTest(false);}}drawLine(e,t,o,r,n,a,l=0){let s=this.line,c=r.colorAt(n,a),f=V(n.paint.opacity,a,1)*(l||1),h=V(n.paint.width,a,1);if(f<=.001||h<=.01)return;let u=e.gl.drawingBufferWidth,d=e.gl.drawingBufferHeight,m=t.width>0?u/t.width:1,y=h/2*m;s.use(),this.applyFogUniforms(s,t,r),this.applyGlobeUniforms(s,t),this.applyLight(s,r),this.applyMaterial(s,n,a),s.setVec4v("u_color",_e([c[0],c[1],c[2],c[3]*f])),s.setFloat("u_center_w",t.cameraToCenterDistance);let p=V(n.paint.offset,a,0)*m;s.setFloat("u_elevation",V(n.paint.elevation,a,0)*this.reliefScale),s.setFloat("u_relief",this.reliefScale),s.setVec2("u_viewport",u,d);let b=n.paint.dashArray,g=n.paint.arrow===true,v=n.paint.arrowStyle,w=g&&(v==="head"||v==="headOnly"),S=g&&v==="dash";if(s.setInt("u_pattern",S?5:b?1:v==="headOnly"&&g?4:w?3:g?2:0),b){let[M,x]=b;s.setVec2("u_dash",M*m,(M+x)*m);}if(g){let M=ke(n.paint.arrowColor,a,[1,1,1,1]);s.setVec4v("u_arrow_color",_e(M));let x=V(n.paint.arrowPeriod,a,46)*m,C=V(n.paint.arrowSize,a,5)*m;if(S){let T=V(n.paint.arrowGap,a,24)*m,E=Math.max(x-T,1),k=Math.min(C,E),F=V(n.paint.arrowShaft,a,2)*m,L=V(n.paint.arrowHead,a,4)*m,I=V(n.paint.arrowOutline,a,0)*m;s.setVec4("u_arrow",F,k,L,E),s.setVec2("u_dash",I,x);}else w?s.setVec4("u_arrow",x,C,y,0):s.setVec4("u_arrow",x,Math.max(C*.4,1),Math.min(C,y*.72),0);}let _=r.bucketKeyFor(n);if(_!==null)for(let M of o.visibleTiles){if(!this.drawsTile(t,r,n,M))continue;let x=o.getTile(M),C=x&&this.bucketFor(e,x,_,xa,this.lineLocs,"line");if(!C)continue;let T=M.bounds(),E=(T.maxX-T.minX)*t.worldSize/C.extent*m;s.setFloat("u_tile_to_px",E);let k=E>1e-6?1/E:1;s.setFloat("u_half_width",y*k),s.setFloat("u_meters_to_units",t.pixelsPerMeter*k),s.setFloat("u_width_from_data",n.paint.widthFromData===true?1:0),s.setFloat("u_width_extra",V(n.paint.widthExtra,a,0)*k),s.setFloat("u_offset",p*k),s.setFloat("u_tile_per_px",k),this.applyTileScale(s,M,C.extent),this.shadowActive&&s.setMat4("u_shadow_matrix",t.shadowTileMatrix(M,C.extent)),this.applyTileMatrix(s,t,M,C.extent),C.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,C.indexCount,C.indexType,0);}}drawHighlight(e,t,o,r,n,a){let l=this.highlight;if(!l||!this.building||l.layerId!==n.id)return;let s=`${n.id}/${l.featureId}`;this.highlightKey!==s&&(this.disposeHighlight(),this.highlightKey=s);let c=le(l.color)??[.31,.79,.5,1],f=this.building;f.use(),this.applyShadowUniforms(f),this.applyFogUniforms(f,t,r),this.applyLight(f,r),f.setVec4v("u_wall_color",[c[0],c[1],c[2],1]),f.setVec4v("u_roof_color",[c[0],c[1],c[2],1]),f.setFloat("u_opacity",l.opacity),f.setFloat("u_ao_strength",V(n.paint.aoStrength,a,.4)),f.setFloat("u_tint_variation",0),f.setFloat("u_facade_detail",0),f.setFloat("u_window_glow",0),f.setFloat("u_roof_variation",0),f.setFloat("u_height_scale",V(n.paint.heightScale,a,1)),e.setDepthFunc("lequal"),e.setDepthMask(false),e.setBlend("alpha");for(let h of o.visibleTiles){let u=o.getTile(h);if(!u)continue;let d=u.data?.buckets?.[n.id];if(!d)continue;let m=h.dataKey,y=this.highlightGpu.get(m);if(y===void 0){let p=_o(u,n.id,l.featureId);if(p){let b=new be(e,new Uint8Array(p.vertices),Ao),g=new se(e,p.indices);y={vao:new ae(e,[{buffer:b,locations:this.buildingLocs}],g),vbo:b,ibo:g,count:p.indices.length};}else y=null;this.highlightGpu.set(m,y);}y&&(this.applyTileScale(f,h,d.extent),this.shadowActive&&f.setMat4("u_shadow_matrix",t.shadowTileMatrix(h,d.extent)),f.setMat4("u_matrix",t.tileMatrix(h,d.extent)),y.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,y.count,e.gl.UNSIGNED_INT,0));}e.setBlend("none"),e.setDepthMask(true);}refreshHighlight(){this.disposeHighlight();}disposeHighlight(){for(let e of this.highlightGpu.values())e&&(e.vao.destroy(),e.vbo.destroy(),e.ibo.destroy());this.highlightGpu.clear(),this.highlightTris.clear(),this.highlightKey="";}syncHighlightFootprint(e,t){let o=this.highlight;if(!o){this.highlightTris.size&&this.highlightTris.clear();return}let r=`${o.layerId}/${o.featureId}`;this.footprintKey!==r&&(this.highlightTris.clear(),this.footprintKey=r);let n=t.layers.find(s=>s.id===o.layerId),a=e.get(n?.source??Y);if(!a)return;let l=new Q;for(let s of a.visibleTiles){if(l.add(s.dataKey),this.highlightTris.has(s.dataKey))continue;let c=a.getTile(s),f=c?.data?.buckets?.[o.layerId];if(!c||!f)continue;let h=_o(c,o.layerId,o.featureId);h&&this.highlightTris.set(s.dataKey,wr(h,f.extent,s));}for(let s of [...this.highlightTris.keys()])l.has(s)||this.highlightTris.delete(s);}drawFillHighlight(e,t,o,r){let n=this.highlightFill,a=this.fill;if(!n||!a)return;let l=r.layers.find(u=>u.id===n.layerId),s=l?o.get(l.source??Y):void 0;if(!l||!s)return;let c=n.bucketKey,f=le(n.color)??[.31,.79,.5,1];a.use(),this.applyFogUniforms(a,t,r),a.setVec4("u_globe",0,0,0,0),a.setInt("u_material",0),a.setFloat("u_elevation",0),a.setVec2("u_world_origin",0,0),a.setVec4v("u_color",_e([f[0],f[1],f[2],n.opacity])),e.setDepthTest(false),e.setDepthMask(false),e.setBlend("premultiplied"),e.setCull("none");let h=e.gl;e.setStencilTest(true),h.stencilFunc(h.NOTEQUAL,Pr,Pr),h.stencilOp(h.KEEP,h.KEEP,h.REPLACE),h.stencilMask(Pr);for(let u of s.visibleTiles){let d=s.getTile(u),m=d?.data?.buckets?.[c];if(!d||!m||m.kind!=="fill"||!m.featureIds)continue;let y=this.fillHighlightFor(e,m,u,n.featureId,c);y&&(a.setMat4("u_matrix",t.tileMatrix(u,m.extent)),y.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,y.count,e.gl.UNSIGNED_INT,0));}e.setStencilTest(false),h.stencilOp(h.KEEP,h.KEEP,h.KEEP),h.stencilMask(255),e.bindVAO(null);}fillHighlightFor(e,t,o,r,n){let a=`${n}/${r}/${o.dataKey}`;this.fillHighlightKey!==`${n}/${r}`&&(this.fillHighlightGpu.forEach(u=>{u?.vao.destroy(),u?.ibo.destroy(),u?.vbo.destroy();}),this.fillHighlightGpu.clear(),this.fillHighlightKey=`${n}/${r}`);let l=this.fillHighlightGpu.get(a);if(l!==void 0)return l;let s=new Uint32Array(t.indices),c=new Float64Array(t.featureIds),f=[];for(let u=0;u*3<s.length;u++)c[u]===r&&f.push(s[u*3],s[u*3+1],s[u*3+2]);let h=null;if(f.length){let u=new be(e,new Uint8Array(t.vertices),Or),d=new se(e,new Uint32Array(f));h={vao:new ae(e,[{buffer:u,locations:this.fillLocs}],d),vbo:u,ibo:d,count:f.length};}return this.fillHighlightGpu.set(a,h),h}highlightFootprint(){return this.highlight&&this.highlightTris.size?[...this.highlightTris.values()]:this.indoorMask.footprint()}drawSurface(e,t,o,r,n,a){let l=this.surface,s=r.colorAt(n,a,[.7,.8,.7,1]),c=V(n.paint.opacity,a,1);if(c<=.001)return;l.use(),this.applyShadowUniforms(l),this.applyFogUniforms(l,t,r),this.applyLight(l,r),this.applyMaterial(l,n,a),l.setVec4v("u_color",s),l.setFloat("u_opacity",c),l.setFloat("u_side_shade",V(n.paint.sideShade,a,.12));let f=n.elevation<(n.base??0),h=n.paint.sideColor?ke(n.paint.sideColor,a,s):s;l.setVec3("u_side_color",h[0],h[1],h[2]),l.setFloat("u_side_light",V(n.paint.sideLight,a,f?1:0)),l.setFloat("u_relief",this.reliefScale);let u=r.bucketKeyFor(n);if(u===null)return;let d=c>=1&&!n.overlay;e.setDepthMask(d),e.setBlend(d?"none":"premultiplied"),e.setCull("none");let m=[];for(let b of o.visibleTiles){if(!this.drawsTile(t,r,n,b))continue;let g=o.getTile(b),v=g&&this.bucketFor(e,g,u,_a,this.surfaceLocs,"surface");v&&m.push({id:b,bucket:v});}let y=(b,g)=>{this.clipToTile(e,b),this.applyTileScale(l,b,g.extent),this.shadowActive&&l.setMat4("u_shadow_matrix",t.shadowTileMatrix(b,g.extent)),l.setMat4("u_matrix",t.tileMatrix(b,g.extent)),g.vao.bind();},p=m.filter(({bucket:b})=>b.capIndexOffset<b.indexCount);if(p.length){e.setColorMask(false),e.setDepthMask(true);for(let{id:b,bucket:g}of p){y(b,g);let v=g.indexType===e.gl.UNSIGNED_INT?4:2;e.gl.drawElements(e.gl.TRIANGLES,g.indexCount-g.capIndexOffset,g.indexType,g.capIndexOffset*v);}e.setColorMask(true),e.setDepthMask(d);}for(let{id:b,bucket:g}of m)y(b,g),e.gl.drawElements(e.gl.TRIANGLES,g.capIndexOffset,g.indexType,0);e.setCull("back"),e.setDepthMask(true),e.setBlend("none");}drawBuildings(e,t,o,r,n,a,l){let s=this.building,c=r.colorAt(n,a,[.86,.84,.8,1]),f=n.paint.roofColor?r.colorAt({...n,paint:{...n.paint,color:n.paint.roofColor}},a,c):c,h=V(n.paint.opacity,a,1);if(h<=.001)return false;s.use(),this.applyShadowUniforms(s),this.applyFogUniforms(s,t,r),s.setVec4v("u_wall_color",c),s.setVec4v("u_roof_color",f),s.setFloat("u_opacity",h),s.setFloat("u_ao_strength",V(n.paint.aoStrength,a,.4)),s.setFloat("u_tint_variation",V(n.paint.tintVariation,a,.07));let u=(w,S)=>n.paint[w]?r.colorAt({...n,paint:{...n.paint,color:n.paint[w]}},a,S):S,d=u("windowColor",[.62,.71,.8,1]),m=u("windowFrameColor",[c[0]*1.1,c[1]*1.1,c[2]*1.1,1]);s.setVec3("u_window_color",d[0],d[1],d[2]),s.setVec3("u_window_frame",m[0],m[1],m[2]),s.setFloat("u_facade_detail",V(n.paint.facadeDetail,a,1)*this.detailScale),s.setFloat("u_window_glow",V(n.paint.windowGlow,a,0)),s.setFloat("u_floor_height",V(n.paint.floorHeight,a,3.2)),s.setFloat("u_roof_variation",V(n.paint.roofVariation,a,.3)),this.applyLight(s,r);let y=h>=1;e.setDepthMask(y),e.setBlend(y?"none":"premultiplied");let p=V(n.paint.heightScale,a,1),b=false,g=r.bucketKeyFor(n);if(g===null)return b;let v=(n.source??Y)===Y;v&&this.indoorMask.prepare(o,g);for(let w of o.visibleTiles){if(!this.drawsTile(t,r,n,w))continue;let S=o.getTile(w),_=S&&this.bucketFor(e,S,g,Ao,this.buildingLocs,"fill-extrusion");if(!_)continue;let M=this.growScale(_,l,!o.warm);M<1&&(b=true),s.setFloat("u_height_scale",M*p),this.applyTileScale(s,w,_.extent),this.shadowActive&&s.setMat4("u_shadow_matrix",t.shadowTileMatrix(w,_.extent)),s.setMat4("u_matrix",t.tileMatrix(w,_.extent));let C=this.cutHidden(e,S,g,w.dataKey,_.buffer,this.hiddenFor(g,v))??(S&&v?this.indoorMask.indicesFor(e,S,g,w,_.buffer,this.buildingLocs):null);C?(C.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,C.count,e.gl.UNSIGNED_INT,0)):(_.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,_.indexCount,_.indexType,0));}return b}growScale(e,t,o=true){if(e.firstDrawTime===0&&(e.firstDrawTime=t),!o||this.growDurationMs<=0)return 1;let r=(t-e.firstDrawTime)/this.growDurationMs;return r<1?Bc(Math.max(r,0)):1}applyLight(e,t){let o=t.light;Oe(e,"u_ambient_color",o.ambientColor),e.setFloat("u_ambient_intensity",o.ambientIntensity);let[r,n,a]=ko(o.keyAzimuth,o.keyAltitude);e.setVec3("u_key_dir",r,n,a),Oe(e,"u_key_color",o.keyColor),e.setFloat("u_key_intensity",o.keyIntensity);let[l,s,c]=ko(o.fillAzimuth,o.fillAltitude);e.setVec3("u_fill_dir",l,s,c),Oe(e,"u_fill_color",o.fillColor),e.setFloat("u_fill_intensity",o.fillIntensity);}flattened(e,t,o){let r=t.bucketKeyFor(o);if(r===null)return false;for(let n of e.visibleTiles){let a=e.getTile(n)?.data?.buckets?.[r];if(a)return a.kind==="fill"}return false}bucketFor(e,t,o,r,n,a){let l=t.buckets.get(o);if(l)return l;let s=t.data?.buckets?.[o];if(!s||s.kind==="symbol"||s.kind==="placement")return null;if(s.kind!==a)return Fc(`\u0441\u043B\u043E\u0439 ${o}: \u0432 \u0442\u0430\u0439\u043B\u0435 \u043C\u0435\u0448 \xAB${s.kind}\xBB, \u0430 \u0440\u0438\u0441\u0443\u044E\u0442 \u043A\u0430\u043A \xAB${a}\xBB \u2014 \u043F\u0440\u043E\u043F\u0443\u0449\u0435\u043D`),null;let c=new be(e,new Uint8Array(s.vertices),r),f=new se(e,new Uint32Array(s.indices)),h=new ae(e,[{buffer:c,locations:n}],f),u=new Wr(h,c,f,f.count,f.type,s.extent,s.capIndexOffset??f.count);return t.buckets.set(o,u),u}destroy(e){this.disposeHighlight(),this.fill?.destroy(),this.surface?.destroy(),this.line?.destroy(),this.objectLine?.destroy(),this.building?.destroy(),this.symbols?.destroy(e),this.models.destroy(e.gl),this.shadowTarget?.destroy(),this.shadowTarget=null,this.shadowPlaceholder&&e.gl.deleteTexture(this.shadowPlaceholder),this.shadowPlaceholder=null,this.quad&&(this.quad.vao.destroy(),this.quad.vbo.destroy(),this.quad.ibo.destroy(),this.quad=null),this.globeMesh&&(this.globeMesh.vao.destroy(),this.globeMesh.vbo.destroy(),this.globeMesh.ibo.destroy(),this.globeMesh=null),this.fill=this.line=this.building=null,this.objectLine=null;}},Ca=new H;function Vc(i,e){let r=new Float32Array(4290),n=0;for(let u=0;u<=32;u++){let d=(u/32-.5)*Math.PI;for(let m=0;m<=64;m++)r[n++]=m/64*2*Math.PI-Math.PI,r[n++]=d;}let a=new Uint16Array(2048*6),l=0;for(let u=0;u<32;u++)for(let d=0;d<64;d++){let m=u*65+d,y=m+64+1;a[l++]=m,a[l++]=m+1,a[l++]=y,a[l++]=m+1,a[l++]=y+1,a[l++]=y;}let s={stride:8,attribs:[{name:"a_lnglat",size:2,type:Vt,offset:0}]},c=new H([["a_lnglat",e.attribLocation("a_lnglat")]]),f=new be(i,r,s),h=new se(i,a);return {vao:new ae(i,[{buffer:f,locations:c}],h),vbo:f,ibo:h,count:a.length}}function Oe(i,e,t){let o=Ca.get(t);o||(o=le(t),Ca.set(t,o)),i.setVec3(e,o[0],o[1],o[2]);}function ko(i,e){let t=i*Math.PI/180,o=e*Math.PI/180,r=Math.cos(o);return [-Math.sin(t)*r,Math.cos(t)*r,-Math.sin(o)]}function Bc(i){let o=i-1;return 1+2.20158*o*o*o+1.20158*o*o}var Io=1,Dt=class{constructor(e=1024){this.entries=new H;this.shelfY=0;this.shelfX=0;this.shelfHeight=0;this.texture=null;this.dirty=true;this.full=false;this.size=e,this.data=new Uint8Array(e*e);}get(e){return this.entries.get(e)}add(e,t,o,r){let n=this.entries.get(e);if(n)return n;if(this.full||o>this.size)return null;if(this.shelfX+o+Io>this.size&&(this.shelfY+=this.shelfHeight+Io,this.shelfX=0,this.shelfHeight=0),this.shelfY+r+Io>this.size)return this.full||console.warn("[osmgl] \u0430\u0442\u043B\u0430\u0441 SDF \u0437\u0430\u043F\u043E\u043B\u043D\u0435\u043D, \u043D\u043E\u0432\u044B\u0435 \u0441\u0438\u043C\u0432\u043E\u043B\u044B \u043D\u0435 \u0434\u043E\u0431\u0430\u0432\u043B\u044F\u044E\u0442\u0441\u044F"),this.full=true,null;let a={x:this.shelfX,y:this.shelfY,width:o,height:r};for(let l=0;l<r;l++){let s=l*o,c=(a.y+l)*this.size+a.x;this.data.set(t.subarray(s,s+o),c);}return this.shelfX+=o+Io,r>this.shelfHeight&&(this.shelfHeight=r),this.entries.set(e,a),this.dirty=true,a}bind(e,t){let o=e.gl;this.texture?e.bindTexture(t,this.texture):(this.texture=o.createTexture(),e.bindTexture(t,this.texture),o.texStorage2D(o.TEXTURE_2D,1,o.R8,this.size,this.size),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_MIN_FILTER,o.LINEAR),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_MAG_FILTER,o.LINEAR),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_WRAP_S,o.CLAMP_TO_EDGE),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_WRAP_T,o.CLAMP_TO_EDGE),this.dirty=true),this.dirty&&(o.pixelStorei(o.UNPACK_ALIGNMENT,1),o.texSubImage2D(o.TEXTURE_2D,0,0,0,this.size,this.size,o.RED,o.UNSIGNED_BYTE,this.data),this.dirty=false);}destroy(e){this.texture&&e.gl.deleteTexture(this.texture),this.texture=null,this.entries.clear(),this.data=new Uint8Array(0);}};var Vr=.75,Nt=8,he=3,We=24,mt=256,Ma=255,Gt=class{constructor(e,t="Noto Sans Regular"){this.urlTemplate=e;this.fontstack=t;this.glyphs=new H;this.loaded=new Q;this.inflight=new H;}get(e){return this.glyphs.get(e)}hasRange(e){return this.loaded.has(Math.floor(e/mt))}needsLoad(e){for(let t of e){let o=t.codePointAt(0);if(o===void 0)continue;let r=Math.floor(o/mt);if(r<=Ma&&!this.loaded.has(r))return true}return false}async ensure(e){let t=new Q;for(let o of e){let r=o.codePointAt(0);if(r===void 0)continue;let n=Math.floor(r/mt);n>Ma||this.loaded.has(n)||t.add(n);}return t.size?(await Promise.all([...t].map(o=>this.loadRange(o))),true):false}loadRange(e){let t=this.inflight.get(e);if(t)return t;let o=this.urlTemplate.replace("{fontstack}",encodeURIComponent(this.fontstack)).replace("{range}",`${e*mt}-${e*mt+mt-1}`),r=fetch(o,{credentials:"same-origin"}).then(n=>{if(!n.ok)throw new Error(`HTTP ${n.status}`);return n.arrayBuffer()}).then(n=>{for(let a of Ta(n))this.glyphs.set(a.id,a);this.loaded.add(e);}).catch(n=>{this.loaded.add(e),console.warn(`[osmgl] \u0433\u043B\u0438\u0444\u044B ${o} \u043D\u0435 \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u043B\u0438\u0441\u044C:`,n instanceof Error?n.message:n);}).finally(()=>{this.inflight.delete(e);});return this.inflight.set(e,r),r}};function Ta(i){let e=new bl__default.default(i instanceof Uint8Array?i:new Uint8Array(i)),t=[];return e.readFields((o,r,n)=>{if(o!==1||!n)return;let a=n.readVarint()+n.pos;n.readFields((l,s,c)=>{if(l!==3||!c)return;let f=c.readVarint()+c.pos,h={id:0,bitmap:null,width:0,height:0,left:0,top:0,advance:0};c.readFields((u,d,m)=>{m&&(u===1?h.id=m.readVarint():u===2?h.bitmap=m.readBytes():u===3?h.width=m.readVarint():u===4?h.height=m.readVarint():u===5?h.left=m.readSVarint():u===6?h.top=m.readSVarint():u===7&&(h.advance=m.readVarint()));},null,f),t.push(h);},null,a);},null),t}var Gc=.25,pt=1e20;function Br(i,e,t){let o=e+he*2,r=t+he*2,n=o*r,a=new Float64Array(n),l=new Float64Array(n);a.fill(pt),l.fill(0);for(let c=0;c<t;c++)for(let f=0;f<e;f++){let h=i[c*e+f]/255,u=(c+he)*o+(f+he);if(h>=1)a[u]=0,l[u]=pt;else if(h>0){let d=.5-h;a[u]=d>0?d*d:0,l[u]=d<0?d*d:0;}else a[u]=pt,l[u]=0;}Aa(a,o,r),Aa(l,o,r);let s=new Uint8Array(n);for(let c=0;c<n;c++){let f=Math.sqrt(a[c])-Math.sqrt(l[c]);s[c]=Nc(Math.round(255-255*(f/Nt+Gc)));}return {data:s,width:o,height:r}}function Aa(i,e,t){let o=Math.max(e,t),r=new Float64Array(o),n=new Float64Array(o),a=new Int32Array(o),l=new Float64Array(o+1);for(let s=0;s<e;s++){for(let c=0;c<t;c++)r[c]=i[c*e+s];ka(r,n,a,l,t);for(let c=0;c<t;c++)i[c*e+s]=n[c];}for(let s=0;s<t;s++){for(let c=0;c<e;c++)r[c]=i[s*e+c];ka(r,n,a,l,e);for(let c=0;c<e;c++)i[s*e+c]=n[c];}}function ka(i,e,t,o,r){t[0]=0,o[0]=-pt,o[1]=pt;for(let n=1,a=0;n<r;n++){let l=0;do{let s=t[a];l=(i[n]-i[s]+n*n-s*s)/(n-s)/2;}while(l<=o[a]&&--a>-1);a++,t[a]=n,o[a]=l,o[a+1]=pt;}for(let n=0,a=0;n<r;n++){for(;o[a+1]<n;)a++;let l=t[a];e[n]=(n-l)*(n-l)+i[l];}}var Nc=i=>i<0?0:i>255?255:i;var La=48,Ut=class{constructor(e={}){this.defs=e;this.sdfs=new H;this.pending=new Q;this.failed=new Q;}setIcons(e){this.defs=e,this.sdfs.clear(),this.failed.clear();}has(e){return this.sdfs.has(e)}get(e){return this.sdfs.get(e)}isDefined(e){return this.defs[e]!==void 0}async ensure(e){if(this.sdfs.has(e)||this.pending.has(e)||this.failed.has(e))return false;let t=this.defs[e];if(t===void 0)return this.failed.add(e),false;this.pending.add(e);try{let o=typeof t=="string"?t:t.svg,r=/viewBox="0 0 ([\d.]+) ([\d.]+)"/.exec(o),n=r?Number(r[1])/Number(r[2]):1,a=Math.max(8,Math.round(La*(n>1?n:1))),l=Math.max(8,Math.round(La/(n<1?n:1))),s=await Uc(o,a,l);return this.sdfs.set(e,Br(s,a,l)),!0}catch(o){return this.failed.add(e),console.warn(`[osmgl] \u0438\u043A\u043E\u043D\u043A\u0430 \xAB${e}\xBB \u043D\u0435 \u0440\u0430\u0441\u0442\u0435\u0440\u0438\u0437\u043E\u0432\u0430\u043B\u0430\u0441\u044C:`,o instanceof Error?o.message:o),false}finally{this.pending.delete(e);}}};async function Uc(i,e,t){let o=i.includes("width=")?i:i.replace("<svg",`<svg width="${e}" height="${t}"`),r=new Blob([o],{type:"image/svg+xml;charset=utf-8"}),n=URL.createObjectURL(r);try{let a=new Image;a.width=e,a.height=t,await new Promise((h,u)=>{a.onload=()=>h(),a.onerror=()=>u(new Error("\u043D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u0434\u0435\u043A\u043E\u0434\u0438\u0440\u043E\u0432\u0430\u0442\u044C SVG")),a.src=n;});let l=document.createElement("canvas");l.width=e,l.height=t;let s=l.getContext("2d",{willReadFrequently:!0});if(!s)throw new Error("\u043D\u0435\u0442 2D-\u043A\u043E\u043D\u0442\u0435\u043A\u0441\u0442\u0430");s.clearRect(0,0,e,t),s.drawImage(a,0,0,e,t);let c=s.getImageData(0,0,e,t).data,f=new Uint8ClampedArray(e*t);for(let h=0;h<f.length;h++)f[h]=c[h*4+3];return f}finally{URL.revokeObjectURL(n);}}var Qe={dot:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><circle cx="12" cy="12" r="5"/></svg>',entrance:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2.5 19.5 10l-2.1 2.1-3.9-3.9V21h-3V8.2l-3.9 3.9L4.5 10 12 2.5z"/></svg>',door:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M5 2h11a3 3 0 0 1 3 3v17H5V2zm9 9.2a1.2 1.2 0 1 0 0 2.4 1.2 1.2 0 0 0 0-2.4z"/></svg>',elevator:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M5 3h14v18H5V3zm7 2.2L9.2 9h5.6L12 5.2zM9.2 15h5.6L12 18.8 9.2 15z"/></svg>',"frame-circle":'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><circle cx="12" cy="12" r="11"/></svg>',cafe:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M4 6h12v6a6 6 0 0 1-12 0V6zm12 1h2.5a2.5 2.5 0 0 1 0 5H16V7zM3 20h14v2H3z"/></svg>',restaurant:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M6 2h2v8a2 2 0 0 1-4 0V2h2zM5 2v6h2V2zm7 0h2v20h-2V13a4 4 0 0 1 0-8V2zM6 12h2v10H6z"/></svg>',shop:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M4 8h16l-1.5 12h-13L4 8zm4-3a4 4 0 0 1 8 0v2h-2V5a2 2 0 0 0-4 0v2H8V5z"/></svg>',grocery:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M3 4h3l3 11h9l2-8H8m1 15a2 2 0 1 0 4 0 2 2 0 0 0-4 0zm8 0a2 2 0 1 0 4 0 2 2 0 0 0-4 0z"/></svg>',fuel:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M4 3h9v18H4V3zm2 2v5h5V5H6zm10 2 3 3v8a2 2 0 0 1-4 0V9h1V7z"/></svg>',parking:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M6 3h6a5 5 0 0 1 0 10H9v8H6V3zm3 3v4h3a2 2 0 0 0 0-4H9z"/></svg>',hospital:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M10 3h4v7h7v4h-7v7h-4v-7H3v-4h7V3z"/></svg>',pharmacy:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M11 4h2v5h5v2h-5v5h-2v-5H6V9h5V4zM5 18h14v3H5z"/></svg>',school:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 3 2 8l10 5 10-5-10-5zM5 12v5c0 2 3 4 7 4s7-2 7-4v-5l-7 3.5L5 12z"/></svg>',bank:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2 2 8h20L12 2zM4 10h3v8H4v-8zm6.5 0h3v8h-3v-8zM17 10h3v8h-3v-8zM2 20h20v2H2z"/></svg>',bus:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M4 5a3 3 0 0 1 3-3h10a3 3 0 0 1 3 3v10a2 2 0 0 1-2 2v2h-3v-2H9v2H6v-2a2 2 0 0 1-2-2V5zm2 2v5h12V7H6zm1 8a1.5 1.5 0 1 0 3 0 1.5 1.5 0 0 0-3 0zm7 0a1.5 1.5 0 1 0 3 0 1.5 1.5 0 0 0-3 0z"/></svg>',railway:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M6 3h12v11a3 3 0 0 1-3 3H9a3 3 0 0 1-3-3V3zm2 3v4h8V6H8zm-2 15 3-3h6l3 3H6z"/></svg>',park:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2a6 6 0 0 1 5.2 9 4.5 4.5 0 0 1-2.4 8.3H13V22h-2v-2.7H9.2A4.5 4.5 0 0 1 6.8 11 6 6 0 0 1 12 2z"/></svg>',hotel:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M2 6h3v7h10a4 4 0 0 1 4 4v3h-3v-3H5v3H2V6zm5 2a2.5 2.5 0 1 1 0 5 2.5 2.5 0 0 1 0-5z"/></svg>',place_of_worship:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2c3 3 5 5 5 8v12h-4v-5a1 1 0 0 0-2 0v5H7V10c0-3 2-5 5-8z"/></svg>',police:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2l8 3v7c0 5-3.5 8.5-8 10-4.5-1.5-8-5-8-10V5l8-3z"/></svg>',stadium:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 4c5.5 0 10 1.8 10 4v4c0 2.2-4.5 4-10 4S2 14.2 2 12V8c0-2.2 4.5-4 10-4zm0 2C7.6 6 4 7.1 4 8s3.6 2 8 2 8-1.1 8-2-3.6-2-8-2z"/></svg>',fast_food:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M3 9a9 9 0 0 1 18 0H3zm-1 3h20v2H2v-2zm2 4h16a3 3 0 0 1-3 3H7a3 3 0 0 1-3-3z"/></svg>',bakery:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M4 9c0-2 1.5-3 3-3h10c1.5 0 3 1 3 3l-1 9H5L4 9zm4-1v9h2V8H8zm4 0v9h2V8h-2z"/></svg>',ice_cream:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2a5 5 0 0 1 5 5H7a5 5 0 0 1 5-5zM7 9h10l-5 13L7 9z"/></svg>',bar:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M3 4h18l-8 9v6h4v2H7v-2h4v-6L3 4zm3.5 2 2 2h7l2-2h-11z"/></svg>',butcher:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M5 3h6l2 5-3 3-5-3V3zm8 7 6 6-2 2-6-6 2-2zM3 17h8v4H3v-4z"/></svg>',alcohol_shop:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M10 2h4v4l3 5v11H7V11l3-5V2zm-1 11h6v7H9v-7z"/></svg>',clothing_store:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M9 3h6l5 3-2 4-2-1v12H8V9L6 10 4 6l5-3zm1 1.5L12 6l2-1.5h-4z"/></svg>',hairdresser:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M5 3l9 9-2 2-2-2-2 2 2 2-1 1a3 3 0 1 1-2-2l1-1-1-1a3 3 0 1 1 2-2L5 3zm14 0l-6 6 2 2 5-6V3zM6 17a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3zm0-11a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3z"/></svg>',laundry:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M5 2h14v20H5V2zm2 2v2h10V4H7zm5 4a6 6 0 1 0 0 12 6 6 0 0 0 0-12zm0 3a3 3 0 1 1 0 6 3 3 0 0 1 0-6z"/></svg>',music:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M9 4l11-2v13a3.5 3.5 0 1 1-2-3.2V6L11 7.4v10.1A3.5 3.5 0 1 1 9 14.3V4z"/></svg>',car:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M5 11l2-5a2 2 0 0 1 2-1h6a2 2 0 0 1 2 1l2 5v7h-3v-2H8v2H5v-7zm2.5-1h9l-1.2-3H8.7L7.5 10zM7 13a1.3 1.3 0 1 0 0 2.6A1.3 1.3 0 0 0 7 13zm10 0a1.3 1.3 0 1 0 0 2.6 1.3 1.3 0 0 0 0-2.6z"/></svg>',bicycle:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M6 12a5 5 0 1 0 0 10 5 5 0 0 0 0-10zm12 0a5 5 0 1 0 0 10 5 5 0 0 0 0-10zM6 15a2 2 0 1 1 0 4 2 2 0 0 1 0-4zm12 0a2 2 0 1 1 0 4 2 2 0 0 1 0-4zM9 4h4l4 8-2 1-3-6H9V4z"/></svg>',atm:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M2 5h20v14H2V5zm2 2v3h16V7H4zm0 5v5h16v-5H4zm2 2h5v2H6v-2z"/></svg>',post:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M2 5h20v14H2V5zm2.5 2 7.5 6 7.5-6h-15z"/></svg>',telephone:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M7 2c1 0 2 3 2 4s-2 2-2 3 4 6 5 6 2-2 3-2 4 1 4 2-1 4-3 4C9 19 5 15 3 5c0-2 3-3 4-3z"/></svg>',office:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M4 2h11v20H4V2zm2 3v3h3V5H6zm5 0v3h3V5h-3zM6 10v3h3v-3H6zm5 0v3h3v-3h-3zM6 15v3h3v-3H6zm5 0v7h3v-7h-3zM17 8h4v14h-4V8z"/></svg>',town_hall:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2l9 5v2H3V7l9-5zM5 11h3v7H5v-7zm5.5 0h3v7h-3v-7zM16 11h3v7h-3v-7zM3 20h18v2H3v-2z"/></svg>',doctors:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M7 2v6a5 5 0 0 0 4 4.9V16a3 3 0 1 0 6 0v-1.2a2.5 2.5 0 1 0-2 0V16a1 1 0 1 1-2 0v-3.1A5 5 0 0 0 17 8V2h-3v6a2 2 0 0 1-4 0V2H7z"/></svg>',dentist:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2c3 0 4-1 6 0 2 1 2 4 1 8l-1 5c-1 4-3 4-3.5 1L14 12c-.4-2-1.6-2-2 0l-.5 4c-.5 3-2.5 3-3.5-1l-1-5C6 6 6 3 8 2c2-1 3 0 4 0z"/></svg>',veterinary:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 11c3 0 6 3 6 6a3 3 0 0 1-3 3H9a3 3 0 0 1-3-3c0-3 3-6 6-6zM6 5a2.5 2.5 0 1 1 0 5 2.5 2.5 0 0 1 0-5zm12 0a2.5 2.5 0 1 1 0 5 2.5 2.5 0 0 1 0-5zM10 2a2.5 2.5 0 1 1 0 5 2.5 2.5 0 0 1 0-5zm4 0a2.5 2.5 0 1 1 0 5 2.5 2.5 0 0 1 0-5z"/></svg>',library:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M4 3h5c1.5 0 2.5.5 3 1.2.5-.7 1.5-1.2 3-1.2h5v16h-5c-1.5 0-2.5.6-3 1.5-.5-.9-1.5-1.5-3-1.5H4V3zm2 2v12h3c1 0 2 .2 2.5.5V5.8C11 5.3 10 5 9 5H6z"/></svg>',college:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 3 2 8l10 5 10-5-10-5zM5 12v5c0 2 3 4 7 4s7-2 7-4v-5l-7 3.5L5 12zm15-2v7h2v-7h-2z"/></svg>',museum:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2l10 5v2H2V7l10-5zM5 11h2.5v7H5v-7zm5 0h2.5v7H10v-7zm5 0h2.5v7H15v-7zM3 20h18v2H3v-2z"/></svg>',art_gallery:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2a10 10 0 0 0 0 20c1.7 0 2-1 1.4-2-.7-1.2 0-2.5 1.6-2.5H18a4 4 0 0 0 4-4c0-6-4.5-11.5-10-11.5zM7 9a1.7 1.7 0 1 1 0 3.4A1.7 1.7 0 0 1 7 9zm3-4a1.7 1.7 0 1 1 0 3.4A1.7 1.7 0 0 1 10 5zm5 0a1.7 1.7 0 1 1 0 3.4A1.7 1.7 0 0 1 15 5zm3 4a1.7 1.7 0 1 1 0 3.4A1.7 1.7 0 0 1 18 9z"/></svg>',theatre:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M3 5h8v9a4 4 0 0 1-8 0V5zm2.5 3a1 1 0 1 0 0 2 1 1 0 0 0 0-2zm3 0a1 1 0 1 0 0 2 1 1 0 0 0 0-2zM13 5h8v9a4 4 0 0 1-8 0V5zm2.5 3a1 1 0 1 0 0 2 1 1 0 0 0 0-2zm3 0a1 1 0 1 0 0 2 1 1 0 0 0 0-2z"/></svg>',cinema:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M2 4h20v16H2V4zm3 2v2h2V6H5zm0 5v2h2v-2H5zm0 5v2h2v-2H5zm12-10v2h2V6h-2zm0 5v2h2v-2h-2zm0 5v2h2v-2h-2zM9 6v12h6V6H9z"/></svg>',monument:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M10 2h4l1 13H9l1-13zM7 17h10v2H7v-2zm-2 3h14v2H5v-2z"/></svg>',castle:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M2 6h3V3h2v3h3V3h2v3h3V3h2v3h3v16H2V6zm7 8h6v8H9v-8z"/></svg>',attraction:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2l2.9 6.3 6.9.8-5.1 4.7 1.4 6.8L12 17.2 5.9 20.6l1.4-6.8L2.2 9.1l6.9-.8L12 2z"/></svg>',zoo:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 12c3.3 0 6 2.7 6 5.5S15.3 21 12 21s-6-.7-6-3.5S8.7 12 12 12zM5 6a2.7 2.7 0 1 1 0 5.4A2.7 2.7 0 0 1 5 6zm14 0a2.7 2.7 0 1 1 0 5.4A2.7 2.7 0 0 1 19 6zM9.5 2a2.7 2.7 0 1 1 0 5.4 2.7 2.7 0 0 1 0-5.4zm5 0a2.7 2.7 0 1 1 0 5.4 2.7 2.7 0 0 1 0-5.4z"/></svg>',theme_park:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M11 2h2v6h-2V2zM4 20a8 8 0 0 1 16 0v2H4v-2zm3.5-2h9A6 6 0 0 0 12 14a6 6 0 0 0-4.5 4zM3 9l3-2 3 2-3 2-3-2zm12 0l3-2 3 2-3 2-3-2z"/></svg>',information:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zm-1.5 4h3v3h-3V6zm0 5h3v8h-3v-8z"/></svg>',garden:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2c2 2 3 4 3 6a3 3 0 0 1-6 0c0-2 1-4 3-6zM4 9c2.5 0 5 1.5 6 4H8c-2.5 0-4-1.5-4-4zm16 0c0 2.5-1.5 4-4 4h-2c1-2.5 3.5-4 6-4zm-9 5h2v8h-2v-8z"/></svg>',pitch:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M2 5h20v14H2V5zm2 2v10h7V7H4zm9 0v10h7V7h-7zm-1 3a2 2 0 1 1 0 4 2 2 0 0 1 0-4z"/></svg>',playground:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M3 4h2v16H3V4zm16 0h2v16h-2V4zM5 6h14v2H5V6zm2 3 3 11H8L5 9h2zm10 0-3 11h2l3-11h-2z"/></svg>',swimming_pool:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M6 3a3 3 0 0 1 6 0v3h4a3 3 0 0 1 3 3h-3a1 1 0 0 0-1 1v3H12V6a1 1 0 0 0-2 0v8H6V3zm-4 14c2 0 2 2 5 2s3-2 5-2 3 2 5 2 3-2 5-2v3c-2 0-2 2-5 2s-3-2-5-2-3 2-5 2-3-2-5-2v-3z"/></svg>',sports_centre:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M4 8h3v8H4V8zM2 10h2v4H2v-4zm15-2h3v8h-3V8zm3 2h2v4h-2v-4zM8 11h8v2H8v-2z"/></svg>',bicycle_parking:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M4 2h5a4 4 0 0 1 0 8H7v5H4V2zm3 3v2h2a1 1 0 0 0 0-2H7zm-2 13a4 4 0 1 1 8 0 4 4 0 0 1-8 0zm10 0a4 4 0 1 1 8 0 4 4 0 0 1-8 0z"/></svg>',aerialway:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M2 4l20-2v2L13 5v2h1l4 3v6a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2v-6l4-3h1V5.3L2 6V4zm7 8v3h6v-3H9z"/></svg>',ferry_terminal:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M11 2h2v3h4v4h-4v5l7 2-2 6c-2 0-2-1-4-1s-2 1-4 1-2-1-4-1-2 1-4 1l-2-6 7-2V9H3V5h4V2h4zM9 7v2h6V7H9z"/></svg>',traffic_signals:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M8 2h8a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2h-3v3h4v2H7v-2h4v-3H8a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2zm4 1.6a1.6 1.6 0 1 0 0 3.2 1.6 1.6 0 0 0 0-3.2zm0 4.3a1.6 1.6 0 1 0 0 3.2 1.6 1.6 0 0 0 0-3.2zm0 4.3a1.4 1.4 0 1 0 0 2.8 1.4 1.4 0 0 0 0-2.8z"/></svg>',gate:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M2 4h3v16H2V4zm17 0h3v16h-3V4zM6 8h12v2H6V8zm0 5h12v2H6v-2z"/></svg>',toilets:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M6 2a2 2 0 1 1 0 4 2 2 0 0 1 0-4zM4 7h4l2 7H8v8H4v-8H2l2-7zm12-5a2 2 0 1 1 0 4 2 2 0 0 1 0-4zm-3 5h6l1 8h-2v7h-4v-7h-2l1-8z"/></svg>',drinking_water:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2c4 5 6 8 6 11a6 6 0 0 1-12 0c0-3 2-6 6-11zm0 5c-2 3-3 4.6-3 6a3 3 0 0 0 6 0c0-1.4-1-3-3-6z"/></svg>',waste_basket:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M9 2h6l1 2h4v3H4V4h4l1-2zM5 8h14l-1 14H6L5 8zm4 3v8h2v-8H9zm4 0v8h2v-8h-2z"/></svg>',recycling:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2l4 7h-3v4h-2V9H8l4-7zM3 18l3-6 2 1-1.4 2.5H10v2H6.6L8 20l-2 1-3-3zm18 0-3 3-2-1 1.4-2.5H14v-2h3.4L16 13l2-1 3 6z"/></svg>',campsite:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2l9 18h-4l-5-10-5 10H3L12 2zm0 9 5 9H7l5-9z"/></svg>',shelter:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2l10 8-1.5 2L19 11v9H5v-9l-1.5 1L2 10l10-8zm0 3.5L7 9.5V18h10V9.5l-5-4z"/></svg>',fire_station:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M13 2c0 3-4 4-4 8 0 1 .4 2 1 2.6C9.4 11 10 9.5 11 9c0 2 3 3 3 6a3.5 3.5 0 0 1-1 2.5c2.5-.6 4-2.8 4-5.5 0-5-4-7-4-10zM7 15c0 4 2.5 7 5 7s5-3 5-7c0 2-1 3-2 3.5.3-.6.5-1.2.5-2 0-2.5-2-3.5-2.5-5.5-1 1-2 2.5-2 4 0 .8.2 1.5.6 2C10.2 17.5 9 16.5 9 15H7z"/></svg>',prison:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M3 3h2v18H3V3zm4 0h2v18H7V3zm4 0h2v18h-2V3zm4 0h2v18h-2V3zm4 0h2v18h-2V3zM2 10h20v2H2v-2z"/></svg>',cemetery:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2c3 0 5 2 5 5v13H7V7c0-3 2-5 5-5zm-1 3v2H9v2h2v7h2v-7h2V7h-2V5h-2zM5 21h14v2H5v-2z"/></svg>',basin:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M2 8c2 0 2 2 5 2s3-2 5-2 3 2 5 2 3-2 5-2v3c-2 0-2 2-5 2s-3-2-5-2-3 2-5 2-3-2-5-2V8zm0 7c2 0 2 2 5 2s3-2 5-2 3 2 5 2 3-2 5-2v3c-2 0-2 2-5 2s-3-2-5-2-3 2-5 2-3-2-5-2v-3z"/></svg>',"shield-2":'<svg viewBox="0 0 32 24" xmlns="http://www.w3.org/2000/svg"><rect x="1" y="3" width="30" height="18" rx="4"/></svg>',"shield-3":'<svg viewBox="0 0 41 24" xmlns="http://www.w3.org/2000/svg"><rect x="1" y="3" width="39" height="18" rx="4"/></svg>',"shield-4":'<svg viewBox="0 0 50 24" xmlns="http://www.w3.org/2000/svg"><rect x="1" y="3" width="48" height="18" rx="4"/></svg>',"shield-5":'<svg viewBox="0 0 59 24" xmlns="http://www.w3.org/2000/svg"><rect x="1" y="3" width="57" height="18" rx="4"/></svg>',"shield-6":'<svg viewBox="0 0 68 24" xmlns="http://www.w3.org/2000/svg"><rect x="1" y="3" width="66" height="18" rx="4"/></svg>',"shield-7":'<svg viewBox="0 0 77 24" xmlns="http://www.w3.org/2000/svg"><rect x="1" y="3" width="75" height="18" rx="4"/></svg>',"shield-8":'<svg viewBox="0 0 86 24" xmlns="http://www.w3.org/2000/svg"><rect x="1" y="3" width="84" height="18" rx="4"/></svg>'},jc={lodging:"hotel",beer:"bar",pub:"bar",kindergarten:"school",university:"college",lift_gate:"gate",toll_booth:"gate",border_control:"gate",bollard:"gate",picnic_site:"campsite",motorcycle_parking:"parking",bicycle_rental:"bicycle",harbor:"ferry_terminal",reservoir:"basin",water_park:"swimming_pool",volleyball:"pitch",basketball:"pitch",tennis:"pitch",horse_racing:"pitch",athletics:"sports_centre",running:"sports_centre",cycling:"bicycle",climbing:"sports_centre",climbing_adventure:"sports_centre",winter_sports:"sports_centre",ice_rink:"sports_centre",karting:"car",motor:"car",escape_game:"attraction"};for(let[i,e]of Object.entries(jc)){let t=Qe[e];t?Qe[i]=t:console.warn(`[osmgl] \u043F\u0441\u0435\u0432\u0434\u043E\u043D\u0438\u043C \u0438\u043A\u043E\u043D\u043A\u0438 \xAB${i}\xBB \u0441\u0441\u044B\u043B\u0430\u0435\u0442\u0441\u044F \u043D\u0430 \u043D\u0435\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044E\u0449\u0443\u044E \xAB${e}\xBB`);}var Xc=1.2;function Dr(i,e,t=16,o=0){let r=Yc(i,t),n=[],a=[],l=0;for(let f of r){let h=0,u=0;for(let d of f){let m=d.codePointAt(0);if(m===void 0)continue;let y=e.get(m);y&&(h+=y.advance,u++);}u>1&&(h+=o*(u-1)),a.push(h),h>l&&(l=h);}if(l===0)return null;let s=We*Xc,c=r.length*s;for(let f=0;f<r.length;f++){let h=-a[f]/2,u=-c/2+f*s+s/2;for(let d of r[f]){let m=d.codePointAt(0);if(m===void 0)continue;let y=e.get(m);y&&(y.width>0&&y.height>0&&y.bitmap&&n.push({glyph:y,x:h,y:u}),h+=y.advance+o);}}return n.length?{glyphs:n,width:l,height:c}:null}function Yc(i,e){let t=i.replace(/\s+/g," ").trim();if(t.length<=e)return [t];let o=t.split(" "),r=[],n="";for(let a of o)n?n.length+1+a.length<=e?n+=" "+a:(r.push(n),n=a):n=a;return n&&r.push(n),r.slice(0,3)}function Gr(i,e,t,o){if(i.length<2)return [];let r=-o,n=-o,a=e+o,l=t+o,s=u=>u.x>=r&&u.x<=a&&u.y>=n&&u.y<=l,c=[],f=[],h=()=>{f.length>=2&&c.push(f),f=[];};for(let u=0;u+1<i.length;u++){let d=i[u],m=i[u+1],y=s(d),p=s(m);if(y&&p){f.length||f.push(d),f.push(m);continue}let b=Kc(d,m,r,n,a,l);if(!b){h();continue}f.length||f.push(b[0]),f.push(b[1]),p||h();}return h(),c}function Kc(i,e,t,o,r,n){let a=e.x-i.x,l=e.y-i.y,s=0,c=1,f=[[-a,i.x-t],[a,r-i.x],[-l,i.y-o],[l,n-i.y]];for(let[h,u]of f){if(h===0){if(u<0)return null;continue}let d=u/h;if(h<0){if(d>c)return null;d>s&&(s=d);}else {if(d<s)return null;d<c&&(c=d);}}return [{x:i.x+a*s,y:i.y+l*s},{x:i.x+a*c,y:i.y+l*c}]}var $c=[0,.25,-0.25,.5,-0.5,.75,-0.75,1,-1];function Ur(i,e,t,o={}){if(i.length<2||!e.length||t<=0)return [];let r=Jc(i),n=r[r.length-1];if(n<t)return [];let a=o.maxAngle??25,l=o.stableScale&&o.stableScale>0?o.stableScale:1,s=n*l,c=o.fontSize?o.fontSize*.6:t/e.length,f=(o.fontSize??0)*.85,h=[],u=o.spacing??250,d=u>0&&u-t<u*.25?t+u*.25:u;if(o.accept)return qc(i,r,e,t,d,c,a,f,o.accept);if(d>0&&s>=t+d){let y=Math.min(Math.floor((s-t)/d)+1,24),p=t+d*(y-1),b=(s-p)/2;for(let g=0;g<y;g++,b+=d){let v=b/l,w=Nr(i,r,e,t,v,c,a,f);w&&h.push({glyphs:w,path:w.map(S=>({x:S.x,y:S.y})),at:v});}if(h.length)return h}let m=(n-t)/2;for(let y of $c){let p=m+m*y,b=Nr(i,r,e,t,p,c,a,f);if(b)return [{glyphs:b,path:b.map(g=>({x:g.x,y:g.y})),at:p}];if(m===0)break}return []}function qc(i,e,t,o,r,n,a,l,s){let c=e[e.length-1],f=Math.max(o/3,r/8,12),h=[],u=-1/0;for(let d=0;d+o<=c;d+=f){if(d-u<r)continue;let m=Nr(i,e,t,o,d,n,a,l);if(!m)continue;let y={glyphs:m,path:m.map(p=>({x:p.x,y:p.y})),at:d};if(s(y)&&(h.push(y),u=d,h.length>=24))break}return h}function Nr(i,e,t,o,r,n,a,l){if(r<0||r+o>e[e.length-1]||!Zc(i,e,r,r+o,n,a))return null;let s=jt(i,e,r),c=jt(i,e,r+o);if(!s||!c)return null;if(c.x>=s.x)return Ia(i,e,t,r,l);let f=e[e.length-1];return Ia([...i].reverse(),ef(e),t,f-(r+o),l)}function Zc(i,e,t,o,r,n){if(r<=0)return true;let a=[],l=0;for(let s=1;s+1<i.length;s++){let c=e[s];if(c<=t)continue;if(c>=o)break;let f=Math.atan2(i[s].y-i[s-1].y,i[s].x-i[s-1].x),h=Math.atan2(i[s+1].y-i[s].y,i[s+1].x-i[s].x),u=Math.abs((h-f)*180/Math.PI+540)%360-180,d=Math.abs(u);for(a.push({at:c,delta:d}),l+=d;a.length&&c-a[0].at>r;)l-=a.shift().delta;if(l>n)return false}return true}function Ia(i,e,t,o,r){let n=[];for(let c of t){let f=Ea(i,e,o+c.offset,c.width);if(!f)return null;n.push(f);}if(!n.length)return null;if(r<=0)return n;let a=[],l=o,s=0;for(let c=0;c<t.length;c++){if(c>0){let h=Math.abs(Qc(n[c].angle,n[c-1].angle))*(Math.PI/180);s+=r*2*Math.tan(Math.min(h,Math.PI/3)/2);}l=o+t[c].offset+s;let f=Ea(i,e,l,t[c].width);if(!f)return null;a.push(f);}return a}function Ea(i,e,t,o){let r=jt(i,e,t+o/2);if(!r)return null;let n=jt(i,e,t),a=jt(i,e,t+o);if(!n||!a)return r;let l=a.x-n.x,s=a.y-n.y;return l===0&&s===0?r:{x:r.x,y:r.y,angle:Math.atan2(s,l)*180/Math.PI}}function Qc(i,e){let t=i-e;for(;t>180;)t-=360;for(;t<=-180;)t+=360;return t}function Jc(i){let e=new Array(i.length);e[0]=0;for(let t=1;t<i.length;t++)e[t]=e[t-1]+Math.hypot(i[t].x-i[t-1].x,i[t].y-i[t-1].y);return e}function ef(i){let e=i[i.length-1];return i.map(t=>e-t).reverse()}function jt(i,e,t){if(t<0||t>e[e.length-1])return null;let o=1;for(;o<e.length-1&&e[o]<t;)o++;let r=e[o]-e[o-1];if(r<=0)return null;let n=(t-e[o-1])/r,a=i[o-1],l=i[o],s=l.x-a.x,c=l.y-a.y;return {x:a.x+s*n,y:a.y+c*n,angle:Math.atan2(c,s)*180/Math.PI}}var Xr=20,Fa={stride:Xr,attribs:[{name:"a_pos",size:2,type:5126,offset:0},{name:"a_tex",size:2,type:5123,offset:8},{name:"a_scale",size:1,type:5126,offset:12},{name:"a_fade",size:1,type:5126,offset:16}]},tf=220,je=64,za=2,of=1.22,rf=128,nf=.7;function af(i,e,t){let o=i.layout?.letterSpacing;if(o!==void 0)return V(o,e,0)*We;let r=V(i.paint?.haloWidth,e,0);return r<=0||t<=0?0:r*nf/(t/We)}var lf=256,sf=200,jr="frame-circle",bt=class i{constructor(e,t){this.shader=null;this.locations=new H;this.atlas=new Dt(1024);this.vbo=null;this.ibo=null;this.vao=null;this.capacityQuads=0;this.onAssetsReady=null;this.pendingText=new Set;this.pendingIcons=new Set;this.highlightFootprint=null;this.placedCount=0;this.placed=[];this.hoverKey=null;this.hiddenKey=null;this.padding={top:0,right:0,bottom:0,left:0};this.viewport={width:0,height:0};this.stickyKeys=new Set;this.now=0;this.shownAt=new H;this.fading=false;this.styleOrder=new H;this.glyphs=new Gt(e,t),this.icons=new Ut(Qe);}init(e){this.shader=new ce(e,"symbol",na,ia);for(let t of Fa.attribs)this.locations.set(t.name,this.shader.attribLocation(t.name));}static keyOf(e){return `${e.layerId}|${e.mercX.toFixed(9)}|${e.mercY.toFixed(9)}`}setHover(e){return this.hoverKey===e?false:(this.hoverKey=e,true)}setHidden(e){return this.hiddenKey===e?false:(this.hiddenKey=e,true)}querySymbol(e,t=2){let o=null;for(let r of this.placed)e.x<r.box.x1-t||e.x>r.box.x2+t||e.y<r.box.y1-t||e.y>r.box.y2+t||(!o||r.order>=o.order)&&(o=r);return o}fadeOf(e,t){let o=this.shownAt.get(e);if(o===void 0)return this.shownAt.set(e,t),this.fading=true,0;let r=(t-o)/tf;return r<1?(this.fading=true,r):1}order(e){let t=o=>o.priority+(this.stickyKeys.has(i.keyOf({layerId:o.layer.id,mercX:o.mercX,mercY:o.mercY}))?sf:0);e.sort((o,r)=>t(r)-t(o));}rememberPlaced(){this.stickyKeys=new Set(this.placed.map(e=>i.keyOf(e)));for(let e of [...this.shownAt.keys()])this.stickyKeys.has(e)||this.shownAt.delete(e);}render(e,t,o,r){let n=this.shader;if(this.placedCount=0,this.placed=[],this.viewport={width:t.width,height:t.height},!n)return;let a=t.zoom,l=r.layers.filter(d=>d.type==="symbol"&&r.layerVisibleAt(d,a));if(!l.length)return;let s=this.collect(t,o,r,l);if(!s.length)return;this.now=performance.now(),this.fading=false,this.order(s);let c=new H,f=new H,h=new H;l.forEach((d,m)=>h.set(d.id,m));let u=0;for(let d of s){let m=this.place(d,a,c);if(!m)continue;this.placed.push({layerId:d.layer.id,text:d.text,icon:d.icon,mercX:d.mercX,mercY:d.mercY,box:m.box,order:h.get(d.layer.id)??0});let y=f.get(d.layer.id);y||f.set(d.layer.id,y={layer:d.layer,verts:[],texs:[],iconVerts:[],iconTexs:[],frameVerts:[],frameTexs:[]}),y.verts.push(...m.verts),y.texs.push(...m.texs),y.iconVerts.push(...m.iconVerts),y.iconTexs.push(...m.iconTexs),y.frameVerts.push(...m.frameVerts),y.frameTexs.push(...m.frameTexs),u+=m.quads,this.placedCount++;}this.rememberPlaced(),this.fading&&this.onAssetsReady?.(),this.requestMissing(),u&&(this.styleOrder=h,this.draw(e,t,f,u,a));}collect(e,t,o,r){let n=[],l=this.padding,s=ut(e,o).far,[c,f,h]=e.cameraPositionPx;for(let u of r){let d=(u.layout?.priority??0)*lf,m=t.get(u.source??Y);if(!m)continue;let y=u.layout?.showFor==="highlight",p=u.layout?.placement==="map",{shift:b,drop:g}=p?Oa(u,e.zoom,e.pixelsPerMeter):{shift:0,drop:0};if(y&&!this.highlightFootprint)continue;let v=e.worldSize>0?e.pixelsPerMeter/e.worldSize*1.5:0,w=o.bucketKeyFor(u);if(w!==null)for(let S of m.visibleTiles){if(!o.layerVisibleAt(u,e.detailZoom(e.distanceToTile(S))))continue;let M=m.getTile(S)?.data?.buckets?.[w];if(!M||!wo(M))continue;let x=new Int16Array(M.anchors),C=new Uint8Array(M.priorities),T=M.rotations?new Int16Array(M.rotations):null,E=M.lines?new Int16Array(M.lines):null,k=M.lineStarts?new Uint32Array(M.lineStarts):null,F=S.bounds(),L=e.worldSize,I=(F.maxX-F.minX)*L/M.extent,A=F.minX*L,R=F.minY*L;for(let P=0;P<C.length;P++){let z=A+x[P*2]*I,O=R+x[P*2+1]*I;if(s!==1/0&&Math.hypot(z-c,O-f,h)>s||y&&!Pe(this.highlightFootprint,z/L,O/L,v))continue;let N=z,W=O;if(p&&T){let $=T[P]*Math.PI/180,oe=b;N-=Math.sin($)*oe,W+=Math.cos($)*oe;}let B=e.worldPxToPoint(N,W),D=E&&k?cf(e,E,k,P,A,R,I):void 0;if(u.layout?.textPlacement==="line"){if(!D)continue}else if(!B||B.x<l.left-64||B.y<l.top-64||B.x>e.width-l.right+64||B.y>e.height-l.bottom+64)continue;n.push({layer:u,screenX:B?B.x:D[0].x,screenY:(B?B.y:D[0].y)+g,text:M.texts[P]??"",icon:M.icons[P]??"",priority:C[P]+d,rotate:Wa(u,T,P,e.bearing),mercX:z/L,mercY:O/L,line:D});}}}return n}place(e,t,o){let r=e.layer.layout??{},n=i.keyOf({layerId:e.layer.id,mercX:e.mercX,mercY:e.mercY});if(this.hiddenKey!==null&&this.hiddenKey===n)return null;let a=this.fadeOf(n,this.now),l=this.hoverKey!==null&&this.hoverKey===n,s=V(r.textSize,t,13),c=V(r.iconSize,t,16),f=r.iconTextGap??5,[h,u]=r.offset??[0,0],d=r.placement==="map",m=null;if(e.icon&&!d){this.icons.isDefined(e.icon)||(e.icon="dot");let Z=`icon:${e.icon}`,U=this.atlas.get(Z);if(!U){let j=this.icons.get(e.icon);j?U=this.atlas.add(Z,j.data,j.width,j.height)??void 0:this.pendingIcons.add(e.icon);}U&&(m=U);}let y=null;if(m&&r.iconFrame==="circle"){let Z=`icon:${jr}`,U=this.atlas.get(Z);if(!U){let j=this.icons.get(jr);j?U=this.atlas.add(Z,j.data,j.width,j.height)??void 0:this.pendingIcons.add(jr);}U&&(y=U);}let p=y?Math.max(r.iconFrameScale??1.6,1):1,b=null;if(e.text&&(this.glyphs.needsLoad(e.text)&&this.pendingText.add(e.text),b=Dr(e.text,this.glyphs,r.textPlacement==="line"?Number.MAX_SAFE_INTEGER:r.maxLineChars??15,af(e.layer,t,s)),!b&&!m)||!b&&!m)return null;let g=s/We,v=b?b.width*g:0,w=b?b.height*g:0;if(e.layer.layout?.textPlacement==="line")return b&&e.line?this.placeOnLine(e,b,g,w,o,t,a):null;let S=r.iconPlacement??"top",_=S==="behind"&&!!m&&!!b,M=S==="top"&&!!m&&!!b,x=m?m.width/Math.max(m.height,1):1,C=_?w+f*2:c,T=m?C*x:0,E=Math.max(T,m?c*p:0),k=Math.max(C,m?c*p:0),F=_?Math.max(T,v+f*2):M?Math.max(E,v):E+(m&&b?f:0)+v,L=_?Math.max(C,w):M?k+f+w:Math.max(m?k:0,w),I=e.screenX+h,A=e.screenY+u,R=za+(r.collisionPadding??0),P={x1:I-F/2-R,y1:A-L/2-R,x2:I+F/2+R,y2:A+L/2+R},z=this.padding;if(P.x1<z.left||P.y1<z.top||P.x2>this.viewport.width-z.right||P.y2>this.viewport.height-z.bottom)return null;if(!r.allowOverlap){if(Ra(o,P))return null;Ha(o,P);}let O=[],N=[],W=[],B=[],D=[],K=[],$=0,oe=I-F/2,ye=M?(k+f)/2:0,J=1/0,X=1/0,me=-1/0,pe=-1/0;if(b){let Z=M||_?I:oe+(m?E+f:0)+v/2;for(let U of b.glyphs){let j=U.glyph,fe=`g:${j.id}`,ne=this.atlas.get(fe);if(!ne&&(!j.bitmap||(ne=this.atlas.add(fe,j.bitmap,j.width+he*2,j.height+he*2)??void 0,!ne)))continue;let ue=Z+(U.x+j.left-he)*g,re=A+ye+(U.y-j.top-he)*g,ge=ne.width*g,Ae=ne.height*g;Eo(O,N,ue,re,ge,Ae,ne,0,a),$++;let ve=he*g;J=Math.min(J,ue+ve),X=Math.min(X,re+ve),me=Math.max(me,ue+ge-ve),pe=Math.max(pe,re+Ae-ve);}if(M&&m&&X<1/0){let U=A-L/2+k+f-X;if(U!==0){for(let j=1;j<O.length;j+=4)O[j]+=U;X+=U,pe+=U;}}}if(m){let Z=l?of:1,U=T*Z,j=C*Z,fe=(M?I-T/2:oe+(E-T)/2)-(U-T)/2,ne=(M?A-L/2+(k-C)/2:A-C/2)-(j-C)/2;if(y){let re=c*p*Z,ge=fe+U/2-re/2,Ae=ne+j/2-re/2,ve=he/Math.max(y.height-he*2,1)*re;Eo(D,K,ge-ve,Ae-ve,re+ve*2,re+ve*2,y,0,a),$++;}if(_&&me>J){let re=f*1.6,ge=f;U=(me-J+re*2)*Z,j=(pe-X+ge*2)*Z,fe=J-re,ne=X-ge;}let ue=he/Math.max(m.height-he*2,1)*j;Eo(W,B,fe-ue,ne-ue,U+ue*2,j+ue*2,m,e.rotate,a),$++;}return $?{verts:O,texs:N,iconVerts:W,iconTexs:B,frameVerts:D,frameTexs:K,quads:$,box:P}:null}placeOnLine(e,t,o,r,n,a,l){let s=e.line,c=t.glyphs.map(T=>({offset:(T.x+t.width/2)*o,width:Math.max(T.glyph.advance,1)*o})),f=c.length?c[c.length-1].offset+c[c.length-1].width:0,h=e.layer.layout??{},u=[],d=[],m=[],y=0,p=r/2+za,b=this.padding,g=T=>{let E=T.path.map(k=>({x1:k.x-p,y1:k.y-p,x2:k.x+p,y2:k.y+p}));for(let k of E)if(k.x1<b.left||k.y1<b.top||k.x2>this.viewport.width-b.right||k.y2>this.viewport.height-b.bottom||!h.allowOverlap&&Ra(n,k))return false;if(!h.allowOverlap)for(let k of E)Ha(n,k);return m.push(...E),true},v=-1/0,w=1/0;for(let T of t.glyphs)T.glyph.height<=0||(v=Math.max(v,T.glyph.top),w=Math.min(w,T.glyph.top-T.glyph.height));let S=Number.isFinite(v)?(v+w)/2*o:0,M=Gr(s,this.viewport.width,this.viewport.height,rf).flatMap(T=>Ur(T,c,f,{spacing:h.symbolSpacing,fontSize:We*o,stableScale:Math.pow(2,Math.round(a)-a),accept:g}));if(!M.length)return null;for(let T of M)for(let E=0;E<t.glyphs.length;E++){let k=t.glyphs[E].glyph,F=T.glyphs[E],L=`g:${k.id}`,I=this.atlas.get(L);if(!I&&(!k.bitmap||(I=this.atlas.add(L,k.bitmap,k.width+he*2,k.height+he*2)??void 0,!I)))continue;let A=I.width*o,R=I.height*o,P=(k.height/2-k.top)*o+S,z=F.angle*Math.PI/180;Eo(u,d,F.x-A/2-Math.sin(z)*P,F.y-R/2+Math.cos(z)*P,A,R,I,F.angle,l),y++;}if(!y)return null;let x=m.map(T=>(T.x1+T.x2)/2),C=m.map(T=>(T.y1+T.y2)/2);return {verts:u,texs:d,iconVerts:[],iconTexs:[],frameVerts:[],frameTexs:[],quads:y,box:{x1:Math.min(...x)-p,y1:Math.min(...C)-p,x2:Math.max(...x)+p,y2:Math.max(...C)+p}}}inStyleOrder(e){return [...e.values()].sort((t,o)=>(this.styleOrder.get(t.layer.id)??0)-(this.styleOrder.get(o.layer.id)??0))}draw(e,t,o,r,n){let a=this.shader,l=e.gl;this.ensureBuffers(e,r);let s=this.vbo,c=this.vao;if(!s||!c||!this.ibo)return;let f=new ArrayBuffer(r*4*Xr),h=new Float32Array(f),u=new Uint16Array(f),d=[],m=0,y=(p,b,g,v)=>{let w=p.length/16;if(w){d.push({layer:g,role:v,first:m/4*6,count:w*6});for(let S=0;S<w*4;S++){let _=m*5;h[_]=p[S*4],h[_+1]=p[S*4+1],u[_*2+4]=b[S*2],u[_*2+5]=b[S*2+1],h[_+3]=p[S*4+2],h[_+4]=p[S*4+3],m++;}}};for(let p of this.inStyleOrder(o))y(p.frameVerts,p.frameTexs,p.layer,"frame"),y(p.iconVerts,p.iconTexs,p.layer,"icon"),y(p.verts,p.texs,p.layer,"text");s.update(new Uint8Array(f)),a.use(),this.atlas.bind(e,0),a.setInt("u_atlas",0),a.setVec2("u_viewport",t.width,t.height),a.setFloat("u_atlas_size",this.atlas.size),a.setFloat("u_edge",Vr),a.setFloat("u_dpr",t.width>0?l.drawingBufferWidth/t.width:1),e.setDepthTest(false),e.setDepthMask(false),e.setBlend("premultiplied"),e.setCull("none"),c.bind();for(let p of d){let b=p.layer.paint,g=V(b.opacity,n,1),v=p.role==="icon",w=p.role==="frame",S=(E,k,F)=>w?k??E??F:v?E??F:F,_=ke(w?b.frameColor??b.haloColor??b.color:S(b.iconColor,void 0,b.color),n,[.15,.15,.15,1]),M=w?b.frameHaloColor:S(b.iconHaloColor,void 0,b.haloColor),x=ke(M??(w?b.iconColor??b.color:b.haloColor),n,[1,1,1,1]);w&&b.frameHaloColor===void 0&&(x[3]*=.35),w&&(_[3]*=V(b.frameOpacity,n,1));let C=V(w?b.frameHaloWidth??1.1:S(b.iconHaloWidth,void 0,b.haloWidth),n,1.2),T=V(p.layer.layout?.textSize,n,13);a.setVec4v("u_color",_e([_[0],_[1],_[2],_[3]*g])),a.setVec4v("u_halo_color",_e([x[0],x[1],x[2],x[3]*g])),a.setFloat("u_halo",C/(Nt*(T/We))),l.drawElements(l.TRIANGLES,p.count,l.UNSIGNED_INT,p.first*4);}e.bindVAO(null);}ensureBuffers(e,t){if(this.vao&&t<=this.capacityQuads)return;this.vao?.destroy(),this.vbo?.destroy(),this.ibo?.destroy(),this.capacityQuads=Math.max(1024,Math.ceil(t*1.5)),this.vbo=new be(e,new Uint8Array(this.capacityQuads*4*Xr),Fa,true);let o=new Uint32Array(this.capacityQuads*6);for(let r=0;r<this.capacityQuads;r++){let n=r*4;o.set([n,n+1,n+2,n,n+2,n+3],r*6);}this.ibo=new se(e,o),this.vao=new ae(e,[{buffer:this.vbo,locations:this.locations}],this.ibo);}requestMissing(){if(this.pendingText.size){let e=[...this.pendingText].join("");this.pendingText.clear(),this.glyphs.ensure(e).then(t=>{t&&this.onAssetsReady?.();});}if(this.pendingIcons.size){let e=[...this.pendingIcons];this.pendingIcons.clear(),Promise.all(e.map(t=>this.icons.ensure(t))).then(t=>{t.some(Boolean)&&this.onAssetsReady?.();});}}destroy(e){this.shader?.destroy(),this.vao?.destroy(),this.vbo?.destroy(),this.ibo?.destroy(),this.atlas.destroy(e),this.shader=null,this.vao=null;}};function Eo(i,e,t,o,r,n,a,l=0,s=1){let c=n/Math.max(a.height,1);if(l){let f=l*Math.PI/180,h=Math.cos(f),u=Math.sin(f),d=t+r/2,m=o+n/2;for(let[y,p]of [[t,o],[t+r,o],[t+r,o+n],[t,o+n]]){let b=y-d,g=p-m;i.push(d+b*h-g*u,m+b*u+g*h,c,s);}}else i.push(t,o,c,s,t+r,o,c,s,t+r,o+n,c,s,t,o+n,c,s);e.push(a.x,a.y,a.x+a.width,a.y,a.x+a.width,a.y+a.height,a.x,a.y+a.height);}function cf(i,e,t,o,r,n,a){if(o+1>=t.length)return;let l=t[o],s=t[o+1],c=[];for(let f=l;f<s;f++){let h=i.worldPxToPoint(r+e[f*2]*a,n+e[f*2+1]*a);if(!h)break;c.push(h);}return c.length>=2?c:void 0}var Pa=(i,e)=>i*4096+e;function Ra(i,e){let t=Math.floor(e.x1/je),o=Math.floor(e.y1/je),r=Math.floor(e.x2/je),n=Math.floor(e.y2/je);for(let a=t;a<=r;a++)for(let l=o;l<=n;l++){let s=i.get(Pa(a,l));if(s){for(let c of s)if(e.x1<c.x2&&e.x2>c.x1&&e.y1<c.y2&&e.y2>c.y1)return true}}return false}function Ha(i,e){let t=Math.floor(e.x1/je),o=Math.floor(e.y1/je),r=Math.floor(e.x2/je),n=Math.floor(e.y2/je);for(let a=t;a<=r;a++)for(let l=o;l<=n;l++){let s=Pa(a,l),c=i.get(s);c||i.set(s,c=[]),c.push(e);}}function Oa(i,e,t){let r=i.layout?.arrowUnits!=="meters"?1:t,n=V(i.layout?.arrowLength,e,50)*r;return {shift:V(i.layout?.arrowGap,e,20)*r+n/2,drop:n/2+(i.layout?.iconTextGap??4)}}function Wa(i,e,t,o){return !i.layout?.iconRotate||!e?0:e[t]-o}var yt=class{constructor(e,t){this.capacity=e;this.onEvict=t;this.map=new H;}get size(){return this.map.size}has(e){return this.map.has(e)}get(e){let t=this.map.get(e);if(t!==void 0)return this.map.delete(e),this.map.set(e,t),t}peek(e){return this.map.get(e)}set(e,t){let o=this.map.get(e);o!==void 0&&(this.map.delete(e),o!==t&&this.onEvict?.(e,o)),this.map.set(e,t),this.trim();}delete(e){let t=this.map.get(e);return t===void 0?false:(this.map.delete(e),this.onEvict?.(e,t),true)}setCapacity(e){this.capacity=e,this.trim();}keys(){return this.map.keys()}values(){return this.map.values()}entries(){return this.map.entries()}clear(){for(let[e,t]of this.map)this.onEvict?.(e,t);this.map.clear();}trim(){for(;this.map.size>this.capacity;){let e=this.map.keys().next();if(e.done)break;let t=e.value,o=this.map.get(t);this.map.delete(t),this.onEvict?.(t,o);}}};var gt=class i{constructor(e,t,o,r=0){this.z=e;this.x=t;this.y=o;this.wrap=r;this.dataKey=`${e}/${t}/${o}`,this.key=r===0?this.dataKey:`${this.dataKey}@${r}`;}parent(){return this.z===0?null:new i(this.z-1,this.x>>1,this.y>>1,this.wrap)}children(){let e=this.z+1,t=this.x*2,o=this.y*2;return [new i(e,t,o,this.wrap),new i(e,t+1,o,this.wrap),new i(e,t,o+1,this.wrap),new i(e,t+1,o+1,this.wrap)]}scaledTo(e){if(e>=this.z)return this;let t=this.z-e;return new i(e,this.x>>t,this.y>>t,this.wrap)}isAncestorOf(e){if(e.z<=this.z||e.wrap!==this.wrap)return false;let t=e.z-this.z;return e.x>>t===this.x&&e.y>>t===this.y}bounds(){let t=1/Math.pow(2,this.z);return {minX:this.x*t+this.wrap,minY:this.y*t,maxX:(this.x+1)*t+this.wrap,maxY:(this.y+1)*t}}toString(){return this.key}};function ff(i,e,t){let o=Math.pow(2,t),r=e.maxTiles??512,n=[],a=128;for(let l=0;l<o;l++)for(let s=0;s<o;s++){let c=new gt(t,s,l),f=c.bounds(),h=(f.minX+f.maxX)/2,u=(f.minY+f.maxY)/2,d=[[h,u],[f.minX,f.minY],[f.maxX,f.minY],[f.minX,f.maxY],[f.maxX,f.maxY]],m=false;for(let[p,b]of d)if(i.isOnGlobeFront(Se(p),Ce(b))){m=true;break}if(!m)continue;let y=false;for(let[p,b]of d){let g=i.localToPoint(i.globeLocal(p,b));if(g&&g.x>-a&&g.y>-a&&g.x<i.width+a&&g.y<i.height+a){y=true;break}}if(y&&(n.push(c),n.length>=r))return n}return n}function Xt(i,e){let t=Math.min(e.maxzoom,24),o=Math.max(0,Math.min(e.minzoom,t)),r=e.detailBias??1,n=e.maxTiles??512,a=512*r,l=Math.min(Math.round(i.zoom),t);if(l<o)return [];if(i.globeActive)return ff(i,e,l);let{min:s,max:c}=i.visibleWrapRange(),f=[],h=[];for(let d=s;d<=c;d++)h.push(new gt(0,0,0,d));let u=0;for(;h.length&&!(++u>2e4||f.length>=n);){let d=h.pop();if(!i.isTileVisible(d))continue;if(d.z>=l){d.z>=o&&f.push(d);continue}if(i.tileScreenSize(d.z,i.distanceToTile(d))<=a&&d.z>=o){f.push(d);continue}for(let y of d.children())h.push(y);}return f.sort((d,m)=>i.distanceToTile(d)-i.distanceToTile(m)),f}var Yr=class{constructor(e){this.id=e;this.state="loading";this.data=null;this.error=null;this.requestId=0;this.buckets=new H;}get hasGeometry(){return this.state==="loaded"&&!!this.data&&Object.keys(this.data.buckets).length>0}destroy(){for(let e of this.buckets.values())e.destroy();this.buckets.clear(),this.data=null;}},uf=1500,Fo=class extends Ve{constructor(t,o){super();this.pool=t;this.visible=[];this.holdSince=0;this.warmed=false;this.version=0;this.opts={cacheSize:160,detailBias:1,maxTiles:512,...o},this.cache=new yt(this.opts.cacheSize,(r,n)=>{n.state==="loading"&&this.pool.abort(n.requestId),n.destroy();});}get visibleTiles(){return this.visible}get dataVersion(){return this.version+this.visible.length*1e6}get warm(){return this.warmed}getTile(t){return this.cache.peek(t.dataKey)}splitValues(t){let o=[];for(let r of this.visible){let n=this.getTile(r)?.data?.splits?.[t];if(n)for(let a of n)o.includes(a)||o.push(a);}return o.sort((r,n)=>typeof r=="number"&&typeof n=="number"?r-n:String(r).localeCompare(String(n))),o}get pendingCount(){let t=0;for(let o of this.cache.values())o.state==="loading"&&t++;return t}update(t){let o=Xt(t,this.opts),r=new Q;for(let s of o)r.add(s.dataKey);for(let[s,c]of this.cache.entries())c.state==="loading"&&!r.has(s)&&(this.pool.abort(c.requestId),this.cache.delete(s));let n=Math.max(this.opts.cacheSize,r.size*2);this.cache.setCapacity(n);for(let s of o)this.cache.get(s.dataKey)||this.loadTile(s);let a=this.visible.length>0&&this.covers(o),l=performance.now();this.readyFor(o)||!a||this.holdSince&&l-this.holdSince>uf?(this.visible=o,this.holdSince=0,this.readyFor(o)&&o.length&&(this.warmed=true)):this.holdSince||(this.holdSince=l);}readyFor(t){for(let o of t){let r=this.cache.peek(o.dataKey);if(!r||r.state==="loading")return false}return true}covers(t){let o=new Q;for(let r of this.visible)o.add(r.dataKey);for(let r of t){if(o.has(r.dataKey))continue;let n=r.parent(),a=false;for(let l=0;n&&l<4;l++){if(o.has(n.dataKey)){a=true;break}n=n.parent();}if(!a)for(let l of this.visible){let s=l.parent();for(let c=0;s&&c<4;c++){if(s.dataKey===r.dataKey){a=true;break}s=s.parent();}if(a)break}if(!a)return false}return true}loadTile(t){let o=new Yr(t);this.cache.set(t.dataKey,o);let r=df(this.opts.url.replace("{z}",String(t.z)).replace("{x}",String(t.x)).replace("{y}",String(t.y)));o.requestId=this.pool.load({url:r,zoom:t.z,metersPerTile:gn(t.z,t.y),sourceMaxZoom:this.opts.maxzoom,plan:this.opts.plan},n=>{if(this.cache.peek(t.dataKey)===o){if(n.type==="error"){if(n.aborted)return;o.state="error",o.error=n.message,this.emit("error",{tile:t,message:n.message});}else o.data=n,o.state=Object.keys(n.buckets).length?"loaded":"empty",this.version++,n.diag?.failed?.length&&console.warn(`[osmgl] \u0442\u0430\u0439\u043B ${t.z}/${t.x}/${t.y}: \u0441\u043B\u043E\u0438 \u043D\u0435 \u0441\u043E\u0431\u0440\u0430\u043B\u0438\u0441\u044C \u2014 ${n.diag.failed.join("; ")}`),this.emit("data",{tile:o});this.pendingCount===0&&this.emit("idle",void 0);}});}findReadyAncestor(t,o=5){let r=t.parent();for(let n=0;r&&n<o;n++){let a=this.cache.peek(r.dataKey);if(a&&a.hasGeometry)return a;r=r.parent();}return null}setCoverOptions(t){t.detailBias!==void 0&&(this.opts.detailBias=t.detailBias),t.maxTiles!==void 0&&(this.opts.maxTiles=t.maxTiles);}setPlan(t){this.opts.plan=t,this.cache.clear();}reload(){this.cache.clear();}destroy(){this.cache.clear(),this.removeAllListeners();}};function df(i){if(typeof location>"u")return i;try{return new URL(i,location.href).href}catch{return i}}var zo=class{constructor(e){this.id=e;this.state="loading";this.image=null;this.error=null;this.texture=null;}destroy(){this.texture?.destroy(),this.texture=null,this.image?.close(),this.image=null;}},Yt=class extends Ve{constructor(t){super();this.visible=[];this.aborts=new Map;this.opts={cacheSize:128,detailBias:1,maxTiles:256,...t},this.cache=new yt(this.opts.cacheSize,(o,r)=>{this.aborts.get(o)?.abort(),this.aborts.delete(o),r.destroy();});}get visibleTiles(){return this.visible}getTile(t){return this.cache.peek(t.dataKey)}update(t){this.visible=Xt(t,this.opts);let o=new Q;for(let r of this.visible)o.add(r.dataKey);for(let[r,n]of this.cache.entries())n.state==="loading"&&!o.has(r)&&(this.aborts.get(r)?.abort(),this.aborts.delete(r),this.cache.delete(r));this.cache.setCapacity(Math.max(this.opts.cacheSize,o.size*2));for(let r of this.visible)this.cache.get(r.dataKey)||this.loadTile(r);}reload(){for(let t of this.aborts.values())t.abort();this.aborts.clear(),this.cache.clear();}destroy(){this.reload(),this.removeAllListeners();}loadTile(t){let o=new zo(t);this.cache.set(t.dataKey,o);let r=new AbortController;this.aborts.set(t.dataKey,r),this.fetchImage(Va(this.opts.url,t),r.signal).then(n=>{if(this.aborts.delete(t.dataKey),this.cache.peek(t.dataKey)!==o){n.close();return}o.image=n,o.state="loaded",this.emit("data",{tile:o});}).catch(n=>{this.aborts.delete(t.dataKey),!r.signal.aborted&&this.cache.peek(t.dataKey)===o&&(o.state="error",o.error=n instanceof Error?n.message:String(n),this.emit("error",{tile:t,message:o.error}));});}async fetchImage(t,o){let r=await fetch(t,{signal:o});if(!r.ok)throw new Error(`\u0442\u0430\u0439\u043B \u043F\u043E\u0434\u043B\u043E\u0436\u043A\u0438 ${r.status} ${r.statusText}`);return createImageBitmap(await r.blob())}};function Va(i,e){let t=i.replace("{z}",String(e.z)).replace("{x}",String(e.x)).replace("{y}",String(e.y));if(typeof location>"u")return t;try{return new URL(t,location.href).href}catch{return t}}var hf="osmgl-assets",vt="assets";var Ro=null;function Da(){return Ro||(Ro=new Promise(i=>{if(typeof indexedDB>"u")return i(null);try{let e=indexedDB.open(hf,1);e.onupgradeneeded=()=>{let t=e.result;t.objectStoreNames.contains(vt)||t.createObjectStore(vt,{keyPath:"key"});},e.onsuccess=()=>i(e.result),e.onerror=()=>i(null);}catch{i(null);}}),Ro)}function mf(i){return Da().then(e=>new Promise(t=>{if(!e)return t(null);try{let o=e.transaction(vt,"readonly").objectStore(vt).get(i);o.onsuccess=()=>t(o.result??null),o.onerror=()=>t(null);}catch{t(null);}}))}function pf(i){Da().then(e=>{if(e)try{e.transaction(vt,"readwrite").objectStore(vt).put(i);}catch{}});}var Ba=i=>{let e=atob(i),t=new Uint8Array(e.length);for(let o=0;o<e.length;o++)t[o]=e.charCodeAt(o);return t};async function bf(i,e,t){let o=await crypto.subtle.importKey("raw",Ba(e),"AES-GCM",false,["decrypt"]);return crypto.subtle.decrypt({name:"AES-GCM",iv:Ba(t),tagLength:128},o,i)}var Kt=class{constructor(e){this.keys=new Map;this.variants=null;this.inflight=new Map;this.endpoint=e.endpoint.replace(/\/+$/,""),this.apiKey=e.apiKey??null;}withKey(e){return this.apiKey?e+(e.includes("?")?"&":"?")+"key="+encodeURIComponent(this.apiKey):e}loadVariants(){return this.variants??(this.variants=fetch(this.withKey(`${this.endpoint}/variants`),{credentials:"same-origin"}).then(e=>e.ok?e.json():{}).catch(()=>({}))),this.variants}async resolve(e,t){return t?(await this.loadVariants())[String(e)]?.[t]??e:e}async load(e,t,o="",r){let n=await this.resolve(e,o),a=`${n}:${t}`,l=this.inflight.get(a);if(l)return l;let s=this.fetchAsset(a,n,t,r).finally(()=>this.inflight.delete(a));return this.inflight.set(a,s),s}async fetchAsset(e,t,o,r){let n,a,l=await mf(e);if(l)n=l.bytes,a=l.encrypted;else {let c=await fetch(this.withKey(`${this.endpoint}/files/${t}/data?lod=${o}`),{signal:r,credentials:"same-origin"});if(!c.ok)throw new Error(`data ${c.status}`);a=(c.headers.get("X-Enc")??"none")!=="none",n=await c.arrayBuffer(),pf({key:e,bytes:n,encrypted:a,savedAt:Date.now()});}if(!a)return n;let s=await this.getKey(t,r);if(!s)throw new Error("\u043D\u0435\u0442 \u043A\u043B\u044E\u0447\u0430 \u0440\u0430\u0441\u0448\u0438\u0444\u0440\u043E\u0432\u043A\u0438");return bf(n,s.key,s.iv)}getKey(e,t){let o=this.keys.get(e);if(o)return o;let r=(async()=>{let n=await fetch(this.withKey(`${this.endpoint}/files/${e}/key`),{signal:t,credentials:"same-origin"});if(!n.ok)return null;let a=await n.json();return a.encrypted&&a.key&&a.iv?{key:a.key,iv:a.iv}:null})();return r.catch(()=>this.keys.delete(e)),this.keys.set(e,r),r}};var yf=1,$t=class{constructor(e){this.mesh=null;this.bitmaps=[];this.error=null;this.loading=null;this.matrix=G();this.grow=1;this.growTarget=1;this.animateIn=false;this.shrinkFrom=1;this.growStart=-1;this.fade=1;this.fadeTarget=1;this.fadeFrom=1;this.fadeStart=-1;this.matrix32=new Float32Array(16);this.nodeMatrix32=new Float32Array(16);this.normal32=new Float32Array(9);this.id=e.id??`model-${yf++}`,this.url=e.url,this.fetchBytes=e.fetchBytes,this.coordinates=e.coordinates,this.altitude=e.altitude??0,this.rotation=e.rotation??0,this.rotationTiltX=e.rotationTiltX??0,this.rotationTiltZ=e.rotationTiltZ??0,e.growIn&&(this.animateIn=true,this.grow=0),this.scale=e.scale??1,this.fitHeight=e.fitHeight,this.visible=e.visible!==false,this.userData=e.userData??{};}get isLoaded(){return this.mesh!==null}load(e){return this.loading?(e&&this.loading.then(e),this.loading):(this.loading=(async()=>{try{let t=this.fetchBytes?await this.fetchBytes():await(async()=>{let r=await fetch(this.url);if(!r.ok)throw new Error(`HTTP ${r.status}`);return r.arrayBuffer()})(),o=await Ir(t);this.bitmaps=await Promise.all(o.images.map(async r=>{if(!r.length)return null;try{return await createImageBitmap(new Blob([r]))}catch{return null}})),this.mesh=o;}catch(t){this.error=t instanceof Error?t.message:String(t),console.warn(`[osmgl] \u043C\u043E\u0434\u0435\u043B\u044C ${this.url} \u043D\u0435 \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u043B\u0430\u0441\u044C: ${this.error}`);}e?.();})(),this.loading)}advanceGrow(e){if(!this.mesh)return false;if(!this.animateIn&&this.growTarget===1)return this.grow=1,false;if(e<=0)return this.grow=1,false;let t=performance.now()/1e3;this.growStart<0&&(this.growStart=t);let o=(t-this.growStart)/e;if(this.growTarget===0){if(o>=1)return this.grow=0,false;let n=Math.max(o,0);return this.grow=this.shrinkFrom*(1-n*n*(3-2*n)),true}if(o>=1)return this.grow=1,false;let r=Math.max(o,0)-1;return this.grow=1+r*r*(2.70158*r+1.70158),true}retire(){this.growTarget!==0&&(this.growTarget=0,this.shrinkFrom=this.grow,this.growStart=performance.now()/1e3);}setHidden(e){let t=e?0:1;this.fadeTarget!==t&&(this.fadeTarget=t,this.fadeFrom=this.fade,this.fadeStart=performance.now()/1e3);}advanceFade(e){if(this.fadeStart<0)return false;if(e<=0)return this.fade=this.fadeTarget,this.fadeStart=-1,false;let t=(performance.now()/1e3-this.fadeStart)/e;if(t>=1)return this.fade=this.fadeTarget,this.fadeStart=-1,false;let o=Math.max(t,0),r=o*o*(3-2*o);return this.fade=this.fadeFrom+(this.fadeTarget-this.fadeFrom)*r,true}markGrown(){this.grow=1,this.growTarget=1,this.growStart=-1/0;}revive(){this.growTarget!==1&&(this.growTarget=1,this.growStart=performance.now()/1e3-(this.animateIn?0:1e9));}effectiveScale(){if(!this.mesh||this.fitHeight===void 0)return this.scale;let e=this.mesh.max[1]-this.mesh.min[1];return e>1e-6?this.fitHeight/e:this.scale}boundingRadiusM(){let e=this.mesh;if(!e)return 0;let t=this.effectiveScale(),o=Math.max(Math.abs(e.min[0]),Math.abs(e.max[0])),r=Math.max(Math.abs(e.min[1]),Math.abs(e.max[1])),n=Math.max(Math.abs(e.min[2]),Math.abs(e.max[2]));return Math.hypot(o,r,n)*t}origin(){let e=q(this.coordinates);return {x:ee(e.lng),y:te(e.lat)}}localMatrix(e){let t=this.effectiveScale(),o=t/Le(e),r=[o,0,0,0,0,t*this.grow,0,o,0],n=c=>c*Math.PI/180,a=$r(n(-this.rotation));this.rotationTiltX&&(a=Xe(Kr(n(this.rotationTiltX)),a)),this.rotationTiltZ&&(a=Xe(qr(n(this.rotationTiltZ)),a));let l=Xe(r,a),s=this.matrix;return Re(s),s[0]=l[0],s[1]=l[1],s[2]=l[2],s[4]=l[3],s[5]=l[4],s[6]=l[5],s[8]=l[6],s[9]=l[7],s[10]=l[8],s[15]=1,s}matrixInSpace(e,t){let o=q(this.coordinates),r=G();for(let a=0;a<16;a++)r[a]=e[a];let n=G();return xe(n,r,this.localMatrix(o.lat)),He(t??this.matrix32,n)}cameraInModelSpace(e){let t=this.effectiveScale();if(!(t>0))return [0,0,0];let o=this.origin(),r=q(this.coordinates),n=Le(r.lat),a=e.worldSize,l=e.cameraPositionPx,s=(l[0]/a-o.x)*n,c=(l[1]/a-o.y)*n,f=l[2]/e.pixelsPerMeter-this.altitude,h=s,u=f,d=c,m=p=>p*Math.PI/180,y=$r(m(-this.rotation));return this.rotationTiltX&&(y=Xe(Kr(m(this.rotationTiltX)),y)),this.rotationTiltZ&&(y=Xe(qr(m(this.rotationTiltZ)),y)),[(y[0]*h+y[1]*u+y[2]*d)/t,(y[3]*h+y[4]*u+y[5]*d)/t,(y[6]*h+y[7]*u+y[8]*d)/t]}matrixFor(e){let t=this.origin();return this.matrixInSpace(e.objectMatrix(t.x,t.y,this.altitude))}coversPoint(e,t){let o=this.mesh;if(!o)return false;let r=this.origin(),n=e-r.x,a=t-r.y,l=q(this.coordinates),s=this.localMatrix(l.lat),c=s[0],f=s[1],h=s[8],u=s[9],d=c*u-f*h;if(Math.abs(d)<1e-30)return false;let m=(n*u-a*h)/d,y=(c*a-f*n)/d,p=1.05,b=(o.min[0]+o.max[0])/2,g=(o.min[2]+o.max[2])/2,v=(o.max[0]-o.min[0])/2*p,w=(o.max[2]-o.min[2])/2*p;return Math.abs(m-b)<=v&&Math.abs(y-g)<=w}get isAnimated(){return this.mesh?.animation!=null}matrixForNode(e,t,o){let r=this.origin();return this.matrixInSpaceForNode(e.objectMatrix(r.x,r.y,this.altitude),t,o,this.nodeMatrix32)}matrixInSpaceForNode(e,t,o,r){let n=this.mesh?.animation;if(!n||!n.nodes.has(t))return this.matrixInSpace(e,r);let a=G();for(let h=0;h<16;h++)a[h]=e[h];let l=q(this.coordinates),s=G();xe(s,a,this.localMatrix(l.lat));let c=G();Er(n,t,n.duration>0?o%n.duration:0,c);let f=G();return xe(f,s,c),He(r,f)}normalMatrix(){let e=n=>n*Math.PI/180,t=$r(e(-this.rotation));this.rotationTiltX&&(t=Xe(Kr(e(this.rotationTiltX)),t)),this.rotationTiltZ&&(t=Xe(qr(e(this.rotationTiltZ)),t));let o=Xe([1,0,0,0,0,1,0,1,0],t),r=this.normal32;for(let n=0;n<9;n++)r[n]=o[n];return r}};function Xe(i,e){let t=new Array(9);for(let o=0;o<3;o++)for(let r=0;r<3;r++)t[o*3+r]=i[r]*e[o*3]+i[3+r]*e[o*3+1]+i[6+r]*e[o*3+2];return t}var Kr=i=>{let e=Math.cos(i),t=Math.sin(i);return [1,0,0,0,e,t,0,-t,e]},$r=i=>{let e=Math.cos(i),t=Math.sin(i);return [e,0,-t,0,1,0,t,0,e]},qr=i=>{let e=Math.cos(i),t=Math.sin(i);return [e,t,0,-t,e,0,0,0,1]};var Po=class{constructor(){this.hit=new H;this.miss=new Q;this.stamp="";}find(e,t){if(!t)return null;let o=this.hit.get(e.id);if(o!==void 0)return o;let r=t.source.visibleTiles.map(n=>n.dataKey).join(",");if(r!==this.stamp&&(this.stamp=r,this.miss.clear()),this.miss.has(e.id))return null;for(let n of t.source.visibleTiles){let a=t.source.getTile(n)?.data?.buckets?.[t.key];if(!a||a.kind!=="fill-extrusion"||!a.featureIds)continue;let l=n.bounds();if(e.mercX<l.minX||e.mercX>l.maxX||e.mercY<l.minY||e.mercY>l.maxY)continue;let s=(e.mercX-l.minX)/(l.maxX-l.minX)*a.extent,c=(e.mercY-l.minY)/(l.maxY-l.minY)*a.extent,f=new Int16Array(a.vertices),h=new Uint32Array(a.indices),u=new Float64Array(a.featureIds),d=f.length/a.vertexCount;for(let m=0;m*3+2<h.length;m++){let y=h[m*3]*d,p=h[m*3+1]*d,b=h[m*3+2]*d;if(!Sf(s,c,f[y],f[y+1],f[p],f[p+1],f[b],f[b+1]))continue;let g=u[m];return this.hit.set(e.id,g),g}}return this.miss.add(e.id),null}clear(){this.hit.clear(),this.miss.clear(),this.stamp="";}},gf=14,vf=2e3,wf=4e3,Ga=160,xf=50,_f=4e3,Zr=6,Oo=class{constructor(e){this.wantKey="";this.modelKey="";this.entries=new H;this.loading=0;this.pending=[];this.known=new H;this.underBuilding=new Po;this.underVenue=new Po;this.tilesStamp="";this.rulesInScan=0;this.found=[];this.foundStamp="";this.sortedAt=null;this.budgetScale=1;this.addModel=null;this.lod=0;this.budget=Ga;this.replacedBuildings=new Q;this.replacedVenues=new Q;this.onReady=null;this.stats={found:0,kept:0,live:0,tooFar:0,overBudget:0,queued:0,rules:0,loadingNow:0,pendingNow:0,replaced:0};this.loader=new Kt(e);}get models(){let e=[];for(let t of this.entries.values())e.push(t.model);return e}update(e,t,o,r,n,a,l){this.wantKey!==this.modelKey&&(this.modelKey=this.wantKey,this.clear(n));let s=e.layout??{},c=s.minZoom??gf,f=s.loadRadius??vf,h=Math.max(s.keepRadius??wf,f),u=Math.min(1,Math.max(.25,(o.zoom-c)/3)),d=Math.max(8,Math.round((s.budget??Ga)*this.budgetScale*u));this.budget=d,this.addModel=r;let m=s.maskReplaced!==false,y=performance.now();if(o.zoom<c){for(let A of [...this.entries.values()])A.model.retire(),A.model.grow<=0&&this.release(A,n);this.replacedBuildings.clear(),this.replacedVenues.clear();return}let p=o.center,b=this.lodFor(o.zoom,c);this.lod=b;let g="";for(let A of t.visibleTiles)g+=A.dataKey+(t.getTile(A)?.data?"+":"-");let v=this.rulesInScan;if(g!==this.tilesStamp){this.tilesStamp=g;let A=new Q;v=0;for(let R of t.visibleTiles){let P=t.getTile(R)?.data?.buckets?.[e.id];if(!P||!aa(P))continue;let z=new Int16Array(P.anchors),O=R.bounds(),N=O.maxX-O.minX,W=O.maxY-O.minY;for(let B=0;B<P.props.length;B++){let D=P.props[B],K=Je(D.file,NaN);if(!Number.isFinite(K))continue;let $=String(D.kind??"model"),oe=$==="rule"?`t-${D.rid}-${D.oid}`:`m-${D.mid}`;if(A.has(oe))continue;A.add(oe),$==="rule"&&v++;let ye=O.minX+z[B*2]/P.extent*N,J=O.minY+z[B*2+1]/P.extent*W,X=Cf(ye,J);this.known.set(oe,{id:oe,fileId:K,lng:X.lng,lat:X.lat,mercX:ye,mercY:J,altitude:Je(D.alt,0),scale:Je(D.scale,1),rotation:Je(D.rx,0),tiltX:Je(D.rz,0),tiltZ:Je(D.ry,0),kind:$==="rule"?"rule":"model",target:Ho($==="rule"?D.oid:D.replaces),replaces:m?$==="rule"?Ho(D.oid):String(D.anchor??"replace")==="replace"?Ho(D.replaces):null:null});}}this.rulesInScan=v;}g!==this.foundStamp&&(this.foundStamp=g,this.found=[...this.known.values()],this.sortedAt=null);let w=this.found,S=new Q;for(let A of w)A.kind==="model"&&A.target!==null&&S.add(A.target);let _=111320,M=Math.cos(p.lat*Math.PI/180),x=A=>Math.hypot((A.lng-p.lng)*_*M,(A.lat-p.lat)*_);this.replacedBuildings.clear(),this.replacedVenues.clear();let C=new Q,T=[],E=0,k=0;(this.sortedAt===null||Math.hypot((p.lng-this.sortedAt.lng)*_*M,(p.lat-this.sortedAt.lat)*_)>xf)&&(w.sort((A,R)=>x(A)-x(R)),this.sortedAt={lng:p.lng,lat:p.lat});let L=0;for(let A of w){let R=x(A);if(R>h){E++;continue}if(A.kind==="rule"&&A.target!==null&&S.has(A.target)){let N=this.entries.get(A.id);N&&N.model.retire();continue}let P=this.entries.get(A.id);if(L>=d){k++,P&&P.model.retire();continue}L++,C.add(A.id);let z=()=>{if(A.replaces===null)return;this.replacedBuildings.add(A.replaces);let N=this.underBuilding.find(A,a);N!==null&&this.replacedBuildings.add(N);let W=this.underVenue.find(A,l);W!==null&&this.replacedVenues.add(W);},O=P;if(O){z(),O.distance=R,O.leftAt=0,O.model.revive(),b<O.lod&&!O.upgrading&&this.loading<Zr&&this.upgrade(O,b,r,n);continue}if(R>f){E++;continue}if(this.loading>=Zr){T.push(A),z();continue}z(),this.spawn(A,R,b,r);}for(let A of [...this.entries.values()])if(!C.has(A.placement.id)){if(A.leftAt===0){A.leftAt=y;continue}y-A.leftAt>_f&&A.model.retire();}for(let A of [...this.entries.values()])A.model.growTarget===0&&A.model.grow<=0&&this.release(A,n);if(this.known.size>4e3)for(let[A,R]of [...this.known.entries()])x(R)>h*3&&this.known.delete(A);let I=this.stats;I.found=w.length,I.kept=C.size,I.live=this.entries.size,I.tooFar=E,I.overBudget=k,I.queued=T.length,I.rules=v,I.loadingNow=this.loading,I.pendingNow=T.length,I.replaced=this.replacedBuildings.size,this.pending=T;}pump(){let e=this.addModel;if(this.stats.loadingNow=this.loading,this.stats.pendingNow=this.pending.length,!!e)for(;this.pending.length&&this.loading<Zr&&this.entries.size<this.budget;){let t=this.pending.shift();this.entries.has(t.id)||this.spawn(t,0,this.lod,e);}}lodFor(e,t){return e>=t+2?0:1}upgrade(e,t,o,r){let n=this.makeModel(e.placement,t,true);e.upgrading=n,this.loading++,n.load(()=>{this.loading--,this.pump(),this.entries.get(e.placement.id)===e&&(e.upgrading=null,n.isLoaded&&(r(e.model),e.model=n,e.lod=t,o(n),this.onReady?.()));});}makeModel(e,t,o){let r=new $t({id:`objects3d-${e.id}`,url:`objects3d:${e.fileId}/${this.modelKey}/lod${t}`,fetchBytes:()=>this.loader.load(e.fileId,t,this.modelKey),coordinates:[e.lng,e.lat],altitude:e.altitude,scale:e.scale,rotation:e.rotation,rotationTiltX:e.tiltX,rotationTiltZ:e.tiltZ,growIn:!o});return o&&r.markGrown(),r}spawn(e,t,o,r,n=false){let a=this.makeModel(e,o,n);this.entries.set(e.id,{placement:e,model:a,distance:t,leftAt:0,lod:o,upgrading:null}),this.loading++,r(a),a.load(()=>{this.loading--,this.pump(),this.onReady?.();});}release(e,t){this.entries.delete(e.placement.id),e.upgrading=null,t(e.model);}setModelKey(e){this.wantKey=e??"";}clear(e){for(let t of [...this.entries.values()])this.release(t,e);this.replacedBuildings.clear(),this.replacedVenues.clear(),this.underBuilding.clear(),this.underVenue.clear();for(let t of Object.keys(this.stats))this.stats[t]=0;}},Je=(i,e)=>{let t=typeof i=="number"?i:Number(i);return Number.isFinite(t)?t:e},Ho=i=>{let e=Je(i,NaN);return Number.isFinite(e)?e:null};function Cf(i,e){let t=i*360-180,o=Math.PI*(1-2*e),r=Math.atan(Math.sinh(o))*180/Math.PI;return {lng:t,lat:r}}function Sf(i,e,t,o,r,n,a,l){let s=(i-r)*(o-n)-(t-r)*(e-n),c=(i-a)*(n-l)-(r-a)*(e-l),f=(i-t)*(l-o)-(a-t)*(e-o),h=s<0||c<0||f<0,u=s>0||c>0||f>0;return !(h&&u)}var Mf=200,Tf={center:"translate(-50%, -50%)",top:"translate(-50%, 0)",bottom:"translate(-50%, -100%)",left:"translate(0, -50%)",right:"translate(-100%, -50%)"},qt=class{constructor(e){this.attachedTo=null;this.culled=false;this._visible=true;this._coordinates=e.coordinates,this.altitude=e.altitude??0,this.offset=e.offset??[0,0],this.anchorTransform=Tf[e.anchor??"bottom"],this.userData=e.userData??{};let t=e.element??document.createElement("div");e.element||(t.className="osmgl-marker-default",t.innerHTML=e.html??Af),t.classList.add("osmgl-marker"),e.className&&t.classList.add(e.className),t.style.position="absolute",t.style.top="0",t.style.left="0",t.style.willChange="transform",e.zIndex!==void 0&&(t.style.zIndex=String(e.zIndex)),this.element=t;}get coordinates(){return this._coordinates}setCoordinates(e){return this._coordinates=e,this}setVisible(e){return this._visible=e,this.applyVisibility(),this}get visible(){return this._visible}attach(e){this.attachedTo!==e&&(e.appendChild(this.element),this.attachedTo=e);}detach(){this.element.remove(),this.attachedTo=null;}update(e){let t=q(this._coordinates),o=e.worldSize,r=e.worldPxToPoint(ee(t.lng)*o,te(t.lat)*o,this.altitude);if(!r){this.culled=true,this.applyVisibility();return}let n=Mf;if(r.x<-n||r.y<-n||r.x>e.width+n||r.y>e.height+n){this.culled=true,this.applyVisibility();return}this.culled=false,this.applyVisibility(),this.element.style.transform=`translate(${Math.round(r.x+this.offset[0])}px, ${Math.round(r.y+this.offset[1])}px) ${this.anchorTransform}`;}applyVisibility(){this.element.style.display=this._visible&&!this.culled?"":"none";}},Af='<svg width="24" height="32" viewBox="0 0 24 32" xmlns="http://www.w3.org/2000/svg"><path d="M12 0C5.4 0 0 5.4 0 12c0 9 12 20 12 20s12-11 12-20c0-6.6-5.4-12-12-12z" fill="#2f6df6"/><circle cx="12" cy="12" r="4.5" fill="#fff"/></svg>';var Zt=class extends qt{constructor(t){let o=document.createElement("div");o.className="osmgl-popup",o.style.pointerEvents="auto";let r=document.createElement("div");if(r.className="osmgl-popup-content",t.element?r.appendChild(t.element):r.innerHTML=t.html??"",o.appendChild(r),t.closeButton!==false){let a=document.createElement("button");a.className="osmgl-popup-close",a.type="button",a.setAttribute("aria-label","\u0417\u0430\u043A\u0440\u044B\u0442\u044C"),a.textContent="\xD7",o.appendChild(a);}let n=document.createElement("div");n.className="osmgl-popup-tip",o.appendChild(n);super({coordinates:t.coordinates,element:o,anchor:t.anchor??"bottom",offset:t.offset??[0,-12],altitude:t.altitude,zIndex:t.zIndex??10,className:t.className,userData:t.userData});this.onClose=null;this.content=r,this.closeOnClick=t.closeOnClick!==false,o.querySelector(".osmgl-popup-close")?.addEventListener("click",()=>this.onClose?.());}onCloseRequest(t){return this.onClose=t,this}setHtml(t){return this.content.innerHTML=t,this}setContent(t){return this.content.replaceChildren(t),this}};var kf=[["\u0443\u043B\u0438\u0446\u0430","\u0443\u043B."],["\u0443\u043B\u0438\u0446\u044B","\u0443\u043B."],["\u0443\u043B\u0438\u0446\u0435","\u0443\u043B."],["\u043F\u0440\u043E\u0441\u043F\u0435\u043A\u0442","\u043F\u0440\u043E\u0441\u043F."],["\u043F\u0440\u043E\u0441\u043F\u0435\u043A\u0442\u0430","\u043F\u0440\u043E\u0441\u043F."],["\u043F\u0435\u0440\u0435\u0443\u043B\u043E\u043A","\u043F\u0435\u0440."],["\u043F\u0435\u0440\u0435\u0443\u043B\u043A\u0430","\u043F\u0435\u0440."],["\u043F\u0440\u043E\u0435\u0437\u0434","\u043F\u0440-\u0434"],["\u043F\u0440\u043E\u0435\u0437\u0434\u0430","\u043F\u0440-\u0434"],["\u043F\u043B\u043E\u0449\u0430\u0434\u044C","\u043F\u043B."],["\u043F\u043B\u043E\u0449\u0430\u0434\u0438","\u043F\u043B."],["\u0431\u0443\u043B\u044C\u0432\u0430\u0440","\u0431\u0443\u043B."],["\u0431\u0443\u043B\u044C\u0432\u0430\u0440\u0430","\u0431\u0443\u043B."],["\u043D\u0430\u0431\u0435\u0440\u0435\u0436\u043D\u0430\u044F","\u043D\u0430\u0431."],["\u043D\u0430\u0431\u0435\u0440\u0435\u0436\u043D\u043E\u0439","\u043D\u0430\u0431."],["\u0448\u043E\u0441\u0441\u0435","\u0448."],["\u0442\u0443\u043F\u0438\u043A","\u0442\u0443\u043F."],["\u0442\u0443\u043F\u0438\u043A\u0430","\u0442\u0443\u043F."],["\u043C\u0438\u043A\u0440\u043E\u0440\u0430\u0439\u043E\u043D","\u043C\u043A\u0440."],["\u043C\u0438\u043A\u0440\u043E\u0440\u0430\u0439\u043E\u043D\u0430","\u043C\u043A\u0440."],["\u043A\u04EF\u0447\u0430\u0438","\u043A."],["\u043A\u0443\u0447\u0430\u0438","\u043A."],["\u0445\u0438\u0451\u0431\u043E\u043D\u0438","\u0445\u0438\u0451\u0431."],["\u0448\u043E\u04B3\u0440\u043E\u04B3\u0438","\u0448\u043E\u04B3."],["\u0433\u0443\u0437\u0430\u0440\u0433\u043E\u04B3\u0438","\u0433\u0443\u0437."],["\u043C\u0430\u0439\u0434\u043E\u043D\u0438","\u043C\u0430\u0439\u0434."]],Na=new Map(kf);function Qr(i){let e=i.split(" ");if(e.length<2)return i;let t=false,o=e.map(n=>{let a=Na.get(n.toLowerCase());return a?(t=true,n[0]===n[0].toUpperCase()?a[0].toUpperCase()+a.slice(1):a):n});return !t||!e.filter(n=>Na.get(n.toLowerCase())===void 0).length?i:o.join(" ")}function en(i,e){let t=[],o=[],r=[],n=[],a=[],l=e.textPlacement==="line",s=[],c=[],f=[];for(let h of i.features()){if(!de(e.filter,h.properties))continue;let u=h.loadGeometry(),d=Ef(h.type,u);if(!d)continue;let m=e.textField?Jr(e.textField,h.properties):"",y=m&&e.abbreviate?Qr(m):m,p=e.iconImage?Jr(e.iconImage,h.properties):"";if(!(!y&&!p)){if(l){let b=If(h.type,u);if(!b)continue;f.push({text:y,line:b});continue}t.push(d[0],d[1]),o.push(y),r.push(p),n.push(Ff(h.properties)),a.push(e.iconRotate&&Math.round(Number(h.properties[e.iconRotate]??0))||0);}}if(l){for(let{text:h,line:u}of Lf(f)){c.push(s.length/2);for(let d of u)s.push(d);t.push(Math.round(u[0]),Math.round(u[1])),o.push(h),r.push(""),n.push(128),a.push(0);}c.push(s.length/2);}return o.length?{anchors:new Int16Array(t).buffer,texts:o,icons:r,priorities:new Uint8Array(n).buffer,rotations:new Int16Array(a).buffer,...l?{lines:new Int16Array(s).buffer,lineStarts:new Uint32Array(c).buffer}:{}}:null}function Lf(i){let e=[],t=new Map,o=new Map,r=(n,a,l)=>`${n}\u241F${a}\u241F${l}`;for(let{text:n,line:a}of i){let l=r(n,a[0],a[1]),s=r(n,a[a.length-2],a[a.length-1]),c=t.get(s),f=o.get(l);if(f!==void 0){let h=e[f];if(h.line.push(...a.slice(2)),o.delete(l),o.set(r(n,h.line[h.line.length-2],h.line[h.line.length-1]),f),c!==void 0&&c!==f){let u=e[c];h.line.push(...u.line.slice(2)),u.line=[],t.delete(s),o.set(r(n,h.line[h.line.length-2],h.line[h.line.length-1]),f);}continue}if(c!==void 0){let h=e[c];h.line.unshift(...a.slice(0,a.length-2)),t.delete(s),t.set(r(n,h.line[0],h.line[1]),c);continue}t.set(l,e.length),o.set(s,e.length),e.push({text:n,line:a});}return e.filter(n=>n.line.length>=4)}function If(i,e){if(i!==2)return null;let t=null,o=0;for(let r of e){if(r.length<4)continue;let n=0;for(let a=0;a+3<r.length;a+=2)n+=Math.hypot(r[a+2]-r[a],r[a+3]-r[a+1]);n>o&&(o=n,t=r);}return t}function Ef(i,e){if(!e.length)return null;if(i===1){let a=e[0];return a.length>=2?[a[0],a[1]]:null}if(i===2){let a=-1,l=0,s=0;for(let c of e)for(let f=0;f+3<c.length;f+=2){let h=c[f+2]-c[f],u=c[f+3]-c[f+1],d=h*h+u*u;d>a&&(a=d,l=c[f]+h/2,s=c[f+1]+u/2);}return a>0?[Math.round(l),Math.round(s)]:null}let t=1/0,o=1/0,r=-1/0,n=-1/0;for(let a of e)for(let l=0;l<a.length;l+=2)a[l]<t&&(t=a[l]),a[l]>r&&(r=a[l]),a[l+1]<o&&(o=a[l+1]),a[l+1]>n&&(n=a[l+1]);return isFinite(t)?[Math.round((t+r)/2),Math.round((o+n)/2)]:null}function Ff(i){let e=i.rank;return typeof e=="number"&&isFinite(e)?Math.max(0,255-Math.min(e,255)):128}function Jr(i,e){let t=Array.isArray(i)?i:[i];for(let o of t){let r=true,a=o.replace(/\{([^}]+)\}/g,(l,s)=>{let c=e[s];return c==null||c===""?(r=false,""):String(c)}).trim();if(r&&a)return a}return ""}function Ua(i,e){let t=[],o=[];for(let r=0;r<i.length;r++){let n=i.feature(r);if(n.type===1&&de(e,n.properties))for(let a of n.loadGeometry())for(let l=0;l+1<a.length;l+=2)t.push(a[l],a[l+1]),o.push(n.properties);}return o.length?{anchors:Int16Array.from(t).buffer,props:o}:null}function zf(){let i=typeof self<"u"?self.origin:void 0;return i&&i!=="null"&&!i.startsWith("blob:")?i+"/":void 0}async function Xa(i,e){let t=performance.now(),o=zf(),r=await fetch(i.url,{signal:e,credentials:"same-origin",...o?{referrer:o}:{}}),n=(p,b,g,v,w=0)=>({type:"loaded",id:i.id,buckets:{},timing:{fetchMs:v,parseMs:w},diag:{status:p,bytes:b,layers:g,built:0}});if(!r.ok){if(r.status===404||r.status===204)return n(r.status,0,[],performance.now()-t);throw new Error(`HTTP ${r.status} \u0434\u043B\u044F ${i.url}`)}let a=await r.arrayBuffer(),l=performance.now()-t;if(a.byteLength===0)return n(r.status,0,[],l);let s=performance.now(),c=new Mt(a),f=Object.keys(c.layers),h={},u={},d=[],y=i.plan.some(p=>p.type==="surface"&&(p.elevation??0)>0)&&i.plan.some(p=>p.type==="line"&&p.ground)?sr(i.metersPerTile):void 0;for(let p of i.plan){if(!Hf(p,i.zoom,i.sourceMaxZoom))continue;let b=c.layers[p.sourceLayer];if(!b)continue;let g=Pf(i.zoom,b.extent);try{if(p.splitBy){let w=Of(b,p.splitBy,p.filter);if(!w.length)continue;let S=u[p.splitBy]??(u[p.splitBy]=[]);for(let _ of w){S.includes(_)||S.push(_);let M={...p,splitBy:void 0,filter:Wf(p.filter,p.splitBy,_)},x=ja(M,b,g,i.metersPerTile,y);x&&(h[st(p.id,_)]=x);}continue}let v=ja(p,b,g,i.metersPerTile,y);v&&(h[p.id]=v);}catch(v){d.push(`${p.id}: ${v instanceof Error?v.message:String(v)}`);}}return {type:"loaded",id:i.id,buckets:h,...Object.keys(u).length?{splits:u}:{},timing:{fetchMs:l,parseMs:performance.now()-s},diag:{status:r.status,bytes:a.byteLength,layers:f,built:Object.keys(h).length,...d.length?{failed:d}:{}}}}function Rf(i){return e=>{let t=e.on;if(typeof t!="string"||!t)return 0;let o=0;for(let r of t.split(",")){let n=i[r];typeof n=="number"&&n>o&&(o=n);}return o}}function Hf(i,e,t){let o=e-1,r=e<t?e+1:24;return !(i.maxzoom<o||i.minzoom>r)}function Pf(i,e){return i<=6?Math.max(64,e/24):0}function ja(i,e,t,o,r){{if(i.type==="fill"){let a=o>0?o/e.extent:0,l=i.cornerRadius&&a>0?{radius:i.cornerRadius/a,segments:i.cornerSegments,extent:e.extent,minCutRatio:0,maxChord:On/a}:void 0,s=lr(e,i.filter,t,l,i.clipToTile===true,e.extent);return s?{kind:"fill",...s,extent:e.extent}:null}if(i.type==="surface"){let a=ar(e,e.extent,i.filter,{metersPerUnit:o>0?o/e.extent:0,elevation:i.elevation??0,base:i.base,bevel:i.bevel,bevelDrop:i.bevelDrop,cornerRadius:i.cornerRadius,cornerSegments:i.cornerSegments,...r?{onShapes:l=>cr(r,l,i.elevation??0,e.extent)}:{},...i.groundBy?{liftBy:Rf(i.groundBy)}:{}});return a?{kind:"surface",...a}:null}if(i.type==="line"){let a=ur(e,i.filter,t,i.ground?r:void 0);return a?{kind:"line",...a,extent:e.extent}:null}if(i.type==="model"){let a=Ua(e,i.filter);return a?{kind:"placement",...a,extent:e.extent}:null}if(i.type==="symbol"){let a=en(e,{filter:i.filter,textField:i.textField,iconImage:i.iconImage,iconRotate:i.iconRotate,textPlacement:i.textPlacement,abbreviate:i.abbreviate});return a?{kind:"symbol",...a,extent:e.extent}:null}let n=tr(e,e.extent,i.filter,{metersPerUnit:o>0?o/e.extent:0,cornerRadius:i.cornerRadius,cornerSegments:i.cornerSegments});return n?{kind:"fill-extrusion",vertices:n.vertices,indices:n.indices,featureIds:n.featureIds,vertexCount:n.vertexCount,indexCount:n.indexCount,extent:n.extent}:null}}function Of(i,e,t){let o=[];for(let r of i.features()){if(!de(t,r.properties))continue;let n=r.properties[e];typeof n!="string"&&typeof n!="number"||o.includes(n)||o.push(n);}return o.sort((r,n)=>typeof r=="number"&&typeof n=="number"?r-n:String(r).localeCompare(String(n))),o}function Wf(i,e,t){let o=["==",e,t];return i?["all",i,o]:o}var tn='"use strict";(()=>{var se=new Set,Pe=!1;function Y(t,e,n=2){let r=e&&e.length,o=r?e[0]*n:t.length;se.size&&se.clear();let i=ft(t,0,o,n,!0),s=[];if(!i||i.next===i.prev)return s;let u=0,c=0,l=0;if(r&&(i=un(t,e,i,n)),t.length>80*n){u=t[0],c=t[1];let f=u,m=c;for(let a=n;a<o;a+=n){let h=t[a],d=t[a+1];h<u&&(u=h),d<c&&(c=d),h>f&&(f=h),d>m&&(m=d)}l=Math.max(f-u,m-c),l=l!==0?32767/l:0}return Ae(i,s,u,c,l),s}function ft(t,e,n,r,o){let i=null;if(o===wn(t,e,n,r)>0)for(let s=e;s<n;s+=r)i=lt(s/r|0,t[s],t[s+1],i);else for(let s=n-r;s>=e;s-=r)i=lt(s/r|0,t[s],t[s+1],i);return i&&ue(i,i.next)&&(le(i),i=i.next),i}function $(t,e=t){let n=e===t,r=t,o;do o=!1,r!==r.next&&(se.size===0||!se.has(r))&&(ue(r,r.next)||L(r.prev,r,r.next)===0)?((n||r===e)&&(e=r.prev),Pe=!0,le(r),r=r.prev,o=!0):(n||r!==e)&&(r=r.next,o=!n);while(o||r!==e);return e}function Ae(t,e,n,r,o){o&&dn(t,n,r,o);let i=t,s=!1;for(;t.prev!==t.next;){let u=t.prev,c=t.next;if(L(u,t,c)<0&&(o?rn(t,n,r,o):nn(t))){e.push(u.i,t.i,c.i),le(t),t=c,i=c;continue}if(t=c,t===i){if(Pe=!1,t=$(t),Pe){i=t;continue}if(!s){t=on(t,e),i=t,s=!0;continue}sn(t,e,n,r,o);break}}}function nn(t){let e=t.prev,n=t,r=t.next,o=e.x,i=n.x,s=r.x,u=e.y,c=n.y,l=r.y,f=Math.min(o,i,s),m=Math.min(u,c,l),a=Math.max(o,i,s),h=Math.max(u,c,l),d=r.next;for(;d!==e;){if(d.x>=f&&d.x<=a&&d.y>=m&&d.y<=h&&!(o===d.x&&u===d.y)&&ge(o,u,i,c,s,l,d.x,d.y)&&L(d.prev,d,d.next)>=0)return!1;d=d.next}return!0}function rn(t,e,n,r){let o=t.prev,i=t,s=t.next,u=o.x,c=i.x,l=s.x,f=o.y,m=i.y,a=s.y,h=Math.min(u,c,l),d=Math.min(f,m,a),g=Math.max(u,c,l),x=Math.max(f,m,a),p=Te(h,d,e,n,r),w=Te(g,x,e,n,r),b=t.prevZ;for(;b&&b.z>=p;){if(b.x>=h&&b.x<=g&&b.y>=d&&b.y<=x&&b!==s&&!(u===b.x&&f===b.y)&&ge(u,f,c,m,l,a,b.x,b.y)&&L(b.prev,b,b.next)>=0)return!1;b=b.prevZ}let y=t.nextZ;for(;y&&y.z<=w;){if(y.x>=h&&y.x<=g&&y.y>=d&&y.y<=x&&y!==s&&!(u===y.x&&f===y.y)&&ge(u,f,c,m,l,a,y.x,y.y)&&L(y.prev,y,y.next)>=0)return!1;y=y.nextZ}return!0}function on(t,e){let n=t,r=!1;do{let o=n.prev,i=n.next.next;mt(o,n,n.next,i,!1)&&ce(o,i)&&ce(i,o)&&(e.push(o.i,n.i,i.i),le(n),le(n.next),n=t=i,r=!0),n=n.next}while(n!==t);return r?$(n):n}function sn(t,e,n,r,o){let i=t;do{let s=i.next.next;for(;s!==i.prev;){if(i.i!==s.i&&bn(i,s)){let u=dt(i,s);i=$(i,i.next),u=$(u,u.next),Ae(i,e,n,r,o),Ae(u,e,n,r,o);return}s=s.next}i=i.next}while(i!==t)}var Be=!1;function un(t,e,n,r){let o=[];for(let i=0,s=e.length;i<s;i++){let u=e[i]*r,c=i<s-1?e[i+1]*r:t.length,l=ft(t,u,c,r,!1);l===l.next&&se.add(l),o.push(pn(l))}o.sort(cn),fn(t.length/r,e.length),ht(n,n),Be=!0;for(let i=0;i<o.length;i++)n=ln(o[i],n);return Be=!1,$(n)}function cn(t,e){return t.x-e.x||t.y-e.y||(t.next.y-t.y)/(t.next.x-t.x)-(e.next.y-e.y)/(e.next.x-e.x)}function ln(t,e){let n=hn(t,e);if(!n)return e;let r=dt(n,t),o=r.next;return ht(n,o.next),$(r,r.next),$(n,n.next)}var at=16,T=new Float64Array(0),ye=0,Ie=[],Ee=[];function fn(t,e){let n=Math.ceil((t+2*e)/at)+e+2;T.length<n*4&&(T=new Float64Array(n*4)),ye=0}function ht(t,e){let n=t;do{let r=ye++;Ie[r]=n;let o=1/0,i=1/0,s=-1/0,u=-1/0,c=0;do{let f=n.next;n.z=r,n.x<o&&(o=n.x),n.x>s&&(s=n.x),n.y<i&&(i=n.y),n.y>u&&(u=n.y),f.x<o&&(o=f.x),f.x>s&&(s=f.x),f.y<i&&(i=f.y),f.y>u&&(u=f.y),n=f}while(++c<at&&n!==e);Ee[r]=n;let l=r*4;T[l]=o,T[l+1]=i,T[l+2]=s,T[l+3]=u}while(n!==e)}function an(t,e){let n=t.z*4;e.x<T[n]&&(T[n]=e.x),e.y<T[n+1]&&(T[n+1]=e.y),e.x>T[n+2]&&(T[n+2]=e.x),e.y>T[n+3]&&(T[n+3]=e.y)}function ut(t){let e=Ee[t];for(;e.prev.next!==e;)e=e.next;return Ee[t]=e,e}function ct(t){let e=Ie[t];for(;e.prev.next!==e;)e=e.next;return Ie[t]=e,e}function hn(t,e){let n=e,r=t.x,o=t.y,i=-1/0,s;if(ue(t,n))return n;for(let a=0,h=0;a<ye;a++,h+=4){if(o<T[h+1]||o>T[h+3]||T[h]>r||T[h+2]<=i)continue;let d=ut(a);n=ct(a);do{if(n.prev.next===n){if(ue(t,n.next))return n.next;if(o<=n.y&&o>=n.next.y&&n.next.y!==n.y){let g=n.x+(o-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(g<=r&&g>i&&(i=g,s=n.x<n.next.x?n:n.next,g===r))return s}}n=n.next}while(n!==d)}if(!s)return null;let u=s.x,c=s.y,l=Math.min(o,c),f=Math.max(o,c),m=1/0;for(let a=0,h=0;a<ye;a++,h+=4){if(T[h+2]<u||T[h]>r||T[h+3]<l||T[h+1]>f)continue;let d=ut(a);n=ct(a);do{if(n.prev.next===n&&r>=n.x&&n.x>=u&&r!==n.x&&ge(o<c?r:i,o,u,c,o<c?i:r,o,n.x,n.y)){let g=Math.abs(o-n.y)/(r-n.x);(ce(n,t)||n.y===o&&n.next.y===o&&n.next.x>r)&&(g<m||g===m&&(n.x>s.x||n.x===s.x&&mn(s,n)))&&(s=n,m=g)}n=n.next}while(n!==d)}return s}function mn(t,e){return L(t.prev,t,e.prev)<0&&L(e.next,t,t.next)<0}var G=[],re=[],Z=new Uint32Array(0),oe=new Uint32Array(0),ie=new Uint32Array(256);function dn(t,e,n,r){let o=t,i=0;do o.z=Te(o.x,o.y,e,n,r),G[i++]=o,o=o.next;while(o!==t);xn(i);let s=null;for(let u=0;u<i;u++){let c=G[u];c.prevZ=s,s&&(s.nextZ=c),s=c}s.nextZ=null}function xn(t){if(t<=32){for(let e=1;e<t;e++){let n=G[e],r=n.z,o=e-1;for(;o>=0&&G[o].z>r;)G[o+1]=G[o],o--;G[o+1]=n}return}Z.length<t&&(Z=new Uint32Array(t),oe=new Uint32Array(t),re=new Array(t));for(let e=0;e<t;e++)Z[e]=G[e].z;pe(t,G,Z,re,oe,0),pe(t,re,oe,G,Z,8),pe(t,G,Z,re,oe,16),pe(t,re,oe,G,Z,24)}function pe(t,e,n,r,o,i){ie.fill(0);for(let u=0;u<t;u++)ie[n[u]>>>i&255]++;let s=0;for(let u=0;u<256;u++){let c=ie[u];ie[u]=s,s+=c}for(let u=0;u<t;u++){let c=n[u],l=ie[c>>>i&255]++;r[l]=e[u],o[l]=c}}function Te(t,e,n,r,o){return t=(t-n)*o|0,e=(e-r)*o|0,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,t|e<<1}function pn(t){let e=t,n=t;do(e.x<n.x||e.x===n.x&&e.y<n.y)&&(n=e),e=e.next;while(e!==t);return n}function ge(t,e,n,r,o,i,s,u){return(o-s)*(e-u)>=(t-s)*(i-u)&&(t-s)*(r-u)>=(n-s)*(e-u)&&(n-s)*(i-u)>=(o-s)*(r-u)}function bn(t,e){let n=ue(t,e)&&L(t.prev,t,t.next)>0&&L(e.prev,e,e.next)>0;return t.next.i!==e.i&&(n||ce(t,e)&&ce(e,t)&&(L(t.prev,t,e.prev)!==0||L(t,e.prev,e)!==0))&&!yn(t,e)&&(n||gn(t,e))}function L(t,e,n){return(e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y)}function ue(t,e){return t.x===e.x&&t.y===e.y}function mt(t,e,n,r,o=!0){let i=L(t,e,n),s=L(t,e,r),u=L(n,r,t),c=L(n,r,e);return(i>0&&s<0||i<0&&s>0)&&(u>0&&c<0||u<0&&c>0)?!0:o?!!(i===0&&be(t,n,e)||s===0&&be(t,r,e)||u===0&&be(n,t,r)||c===0&&be(n,e,r)):!1}function be(t,e,n){return e.x<=Math.max(t.x,n.x)&&e.x>=Math.min(t.x,n.x)&&e.y<=Math.max(t.y,n.y)&&e.y>=Math.min(t.y,n.y)}function yn(t,e){let n=Math.min(t.x,e.x),r=Math.max(t.x,e.x),o=Math.min(t.y,e.y),i=Math.max(t.y,e.y),s=t;do{let u=s.next;if(s.x>r&&u.x>r||s.x<n&&u.x<n||s.y>i&&u.y>i||s.y<o&&u.y<o){s=u;continue}if(s.i!==t.i&&u.i!==t.i&&s.i!==e.i&&u.i!==e.i&&mt(s,u,t,e))return!0;s=u}while(s!==t);return!1}function ce(t,e){return L(t.prev,t,t.next)<0?L(t,e,t.next)>=0&&L(t,t.prev,e)>=0:L(t,e,t.prev)<0||L(t,t.next,e)<0}function gn(t,e){let n=t,r=!1,o=(t.x+e.x)/2,i=(t.y+e.y)/2;do{let s=n.next;n.y>i!=s.y>i&&o<(s.x-n.x)*(i-n.y)/(s.y-n.y)+n.x&&(r=!r),n=s}while(n!==t);return r}function dt(t,e){let n=Ve(t.i,t.x,t.y),r=Ve(e.i,e.x,e.y),o=t.next,i=e.prev;return t.next=e,e.prev=t,n.next=o,o.prev=n,r.next=n,n.prev=r,i.next=r,r.prev=i,r}function lt(t,e,n,r){let o=Ve(t,e,n);return r?(o.next=r.next,o.prev=r,r.next.prev=o,r.next=o):(o.prev=o,o.next=o),o}function le(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),Be&&an(t.prev,t.next)}function Ve(t,e,n){return{i:t,x:e,y:n,prev:null,next:null,z:0,prevZ:null,nextZ:null}}function wn(t,e,n,r){let o=0;for(let i=e,s=n-r;i<n;i+=r)o+=(t[s]-t[i])*(t[i+1]+t[s+1]),s=i;return o}var xt=23283064365386963e-26,Fn=12,pt=typeof TextDecoder>"u"?null:new TextDecoder("utf-8"),Le=0,we=1,fe=2,Fe=5,ae=class{constructor(e=new Uint8Array(16)){this.buf=ArrayBuffer.isView(e)?e:new Uint8Array(e),this.dataView=new DataView(this.buf.buffer),this.pos=0,this.type=0,this.length=this.buf.length}readFields(e,n,r=this.length){for(;this.pos<r;){let o=this.readVarint(),i=o>>3,s=this.pos;this.type=o&7,e(i,n,this),this.pos===s&&this.skip(o)}return n}readMessage(e,n){return this.readFields(e,n,this.readVarint()+this.pos)}readFixed32(){let e=this.dataView.getUint32(this.pos,!0);return this.pos+=4,e}readSFixed32(){let e=this.dataView.getInt32(this.pos,!0);return this.pos+=4,e}readFixed64(){let e=this.dataView.getUint32(this.pos,!0)+this.dataView.getUint32(this.pos+4,!0)*4294967296;return this.pos+=8,e}readSFixed64(){let e=this.dataView.getUint32(this.pos,!0)+this.dataView.getInt32(this.pos+4,!0)*4294967296;return this.pos+=8,e}readFloat(){let e=this.dataView.getFloat32(this.pos,!0);return this.pos+=4,e}readDouble(){let e=this.dataView.getFloat64(this.pos,!0);return this.pos+=8,e}readVarint(e){let n=this.buf,r,o;return o=n[this.pos++],r=o&127,o<128||(o=n[this.pos++],r|=(o&127)<<7,o<128)||(o=n[this.pos++],r|=(o&127)<<14,o<128)||(o=n[this.pos++],r|=(o&127)<<21,o<128)?r:(o=n[this.pos],r|=(o&15)<<28,Mn(r,e,this))}readVarint64(){return this.readVarint(!0)}readSVarint(){let e=this.readVarint();return e%2===1?(e+1)/-2:e/2}readBoolean(){return!!this.readVarint()}readString(){let e=this.readVarint()+this.pos,n=this.pos;return this.pos=e,e-n>=Fn&&pt?pt.decode(this.buf.subarray(n,e)):Cn(this.buf,n,e)}readBytes(){let e=this.readVarint()+this.pos,n=this.buf.subarray(this.pos,e);return this.pos=e,n}readPackedVarint(e=[],n){let r=this.readPackedEnd();for(;this.pos<r;)e.push(this.readVarint(n));return e}readPackedSVarint(e=[]){let n=this.readPackedEnd();for(;this.pos<n;)e.push(this.readSVarint());return e}readPackedBoolean(e=[]){let n=this.readPackedEnd();for(;this.pos<n;)e.push(this.readBoolean());return e}readPackedFloat(e=[]){let n=this.readPackedEnd();for(;this.pos<n;)e.push(this.readFloat());return e}readPackedDouble(e=[]){let n=this.readPackedEnd();for(;this.pos<n;)e.push(this.readDouble());return e}readPackedFixed32(e=[]){let n=this.readPackedEnd();for(;this.pos<n;)e.push(this.readFixed32());return e}readPackedSFixed32(e=[]){let n=this.readPackedEnd();for(;this.pos<n;)e.push(this.readSFixed32());return e}readPackedFixed64(e=[]){let n=this.readPackedEnd();for(;this.pos<n;)e.push(this.readFixed64());return e}readPackedSFixed64(e=[]){let n=this.readPackedEnd();for(;this.pos<n;)e.push(this.readSFixed64());return e}readPackedEnd(){return this.type===fe?this.readVarint()+this.pos:this.pos+1}skip(e){let n=e&7;if(n===Le)for(;this.buf[this.pos++]>127;);else if(n===fe)this.pos=this.readVarint()+this.pos;else if(n===Fe)this.pos+=4;else if(n===we)this.pos+=8;else throw new Error(`Unimplemented type: ${n}`)}writeTag(e,n){this.writeVarint(e<<3|n)}realloc(e){let n=this.length||16;for(;n<this.pos+e;)n*=2;if(n!==this.length){let r=new Uint8Array(n);r.set(this.buf),this.buf=r,this.dataView=new DataView(r.buffer),this.length=n}}finish(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)}writeFixed32(e){this.realloc(4),this.dataView.setInt32(this.pos,e,!0),this.pos+=4}writeSFixed32(e){this.realloc(4),this.dataView.setInt32(this.pos,e,!0),this.pos+=4}writeFixed64(e){this.realloc(8),this.dataView.setInt32(this.pos,e&-1,!0),this.dataView.setInt32(this.pos+4,Math.floor(e*xt),!0),this.pos+=8}writeSFixed64(e){this.realloc(8),this.dataView.setInt32(this.pos,e&-1,!0),this.dataView.setInt32(this.pos+4,Math.floor(e*xt),!0),this.pos+=8}writeVarint(e){if(e=+e||0,e>268435455||e<0){Rn(e,this);return}this.realloc(4),this.buf[this.pos++]=e&127|(e>127?128:0),!(e<=127)&&(this.buf[this.pos++]=(e>>>=7)&127|(e>127?128:0),!(e<=127)&&(this.buf[this.pos++]=(e>>>=7)&127|(e>127?128:0),!(e<=127)&&(this.buf[this.pos++]=e>>>7&127)))}writeSVarint(e){this.writeVarint(e<0?-e*2-1:e*2)}writeBoolean(e){this.writeVarint(+e)}writeString(e){e=String(e),this.realloc(e.length*4),this.pos++;let n=this.pos;this.pos=_n(this.buf,e,this.pos);let r=this.pos-n;r>=128&&bt(n,r,this),this.pos=n-1,this.writeVarint(r),this.pos+=r}writeFloat(e){this.realloc(4),this.dataView.setFloat32(this.pos,e,!0),this.pos+=4}writeDouble(e){this.realloc(8),this.dataView.setFloat64(this.pos,e,!0),this.pos+=8}writeBytes(e){let n=e.length;this.writeVarint(n),this.realloc(n);for(let r=0;r<n;r++)this.buf[this.pos++]=e[r]}writeRawMessage(e,n){this.pos++;let r=this.pos;e(n,this);let o=this.pos-r;o>=128&&bt(r,o,this),this.pos=r-1,this.writeVarint(o),this.pos+=o}writeMessage(e,n,r){this.writeTag(e,fe),this.writeRawMessage(n,r)}writePackedVarint(e,n){n.length&&this.writeMessage(e,kn,n)}writePackedSVarint(e,n){n.length&&this.writeMessage(e,Pn,n)}writePackedBoolean(e,n){n.length&&this.writeMessage(e,In,n)}writePackedFloat(e,n){n.length&&this.writeMessage(e,An,n)}writePackedDouble(e,n){n.length&&this.writeMessage(e,Bn,n)}writePackedFixed32(e,n){n.length&&this.writeMessage(e,En,n)}writePackedSFixed32(e,n){n.length&&this.writeMessage(e,Tn,n)}writePackedFixed64(e,n){n.length&&this.writeMessage(e,Vn,n)}writePackedSFixed64(e,n){n.length&&this.writeMessage(e,Ln,n)}writeBytesField(e,n){this.writeTag(e,fe),this.writeBytes(n)}writeFixed32Field(e,n){this.writeTag(e,Fe),this.writeFixed32(n)}writeSFixed32Field(e,n){this.writeTag(e,Fe),this.writeSFixed32(n)}writeFixed64Field(e,n){this.writeTag(e,we),this.writeFixed64(n)}writeSFixed64Field(e,n){this.writeTag(e,we),this.writeSFixed64(n)}writeVarintField(e,n){this.writeTag(e,Le),this.writeVarint(n)}writeSVarintField(e,n){this.writeTag(e,Le),this.writeSVarint(n)}writeStringField(e,n){this.writeTag(e,fe),this.writeString(n)}writeFloatField(e,n){this.writeTag(e,Fe),this.writeFloat(n)}writeDoubleField(e,n){this.writeTag(e,we),this.writeDouble(n)}writeBooleanField(e,n){this.writeVarintField(e,+n)}};function Mn(t,e,n){let r=n.buf,o,i;if(i=r[n.pos++],o=(i&112)>>4,i<128||(i=r[n.pos++],o|=(i&127)<<3,i<128)||(i=r[n.pos++],o|=(i&127)<<10,i<128)||(i=r[n.pos++],o|=(i&127)<<17,i<128)||(i=r[n.pos++],o|=(i&127)<<24,i<128)||(i=r[n.pos++],o|=(i&1)<<31,i<128))return W(t,o,e);throw new Error("Expected varint not more than 10 bytes")}function W(t,e,n){return n?e*4294967296+(t>>>0):(e>>>0)*4294967296+(t>>>0)}function Rn(t,e){let n,r;if(t>=0?(n=t%4294967296|0,r=t/4294967296|0):(n=~(-t%4294967296),r=~(-t/4294967296),n^4294967295?n=n+1|0:(n=0,r=r+1|0)),t>=18446744073709552e3||t<-18446744073709552e3)throw new Error("Given varint doesn\'t fit into 10 bytes");e.realloc(10),Sn(n,r,e),vn(r,e)}function Sn(t,e,n){n.buf[n.pos++]=t&127|128,t>>>=7,n.buf[n.pos++]=t&127|128,t>>>=7,n.buf[n.pos++]=t&127|128,t>>>=7,n.buf[n.pos++]=t&127|128,t>>>=7,n.buf[n.pos]=t&127}function vn(t,e){let n=(t&7)<<4;e.buf[e.pos++]|=n|((t>>>=3)?128:0),t&&(e.buf[e.pos++]=t&127|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=t&127|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=t&127|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=t&127|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=t&127)))))}function bt(t,e,n){let r=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(Math.LN2*7));n.realloc(r);for(let o=n.pos-1;o>=t;o--)n.buf[o+r]=n.buf[o]}function kn(t,e){for(let n=0;n<t.length;n++)e.writeVarint(t[n])}function Pn(t,e){for(let n=0;n<t.length;n++)e.writeSVarint(t[n])}function An(t,e){for(let n=0;n<t.length;n++)e.writeFloat(t[n])}function Bn(t,e){for(let n=0;n<t.length;n++)e.writeDouble(t[n])}function In(t,e){for(let n=0;n<t.length;n++)e.writeBoolean(t[n])}function En(t,e){for(let n=0;n<t.length;n++)e.writeFixed32(t[n])}function Tn(t,e){for(let n=0;n<t.length;n++)e.writeSFixed32(t[n])}function Vn(t,e){for(let n=0;n<t.length;n++)e.writeFixed64(t[n])}function Ln(t,e){for(let n=0;n<t.length;n++)e.writeSFixed64(t[n])}function Cn(t,e,n){let r="",o=e;for(;o<n;){let i=t[o],s=null,u=i>239?4:i>223?3:i>191?2:1;if(o+u>n)break;let c,l,f;u===1?i<128&&(s=i):u===2?(c=t[o+1],(c&192)===128&&(s=(i&31)<<6|c&63,s<=127&&(s=null))):u===3?(c=t[o+1],l=t[o+2],(c&192)===128&&(l&192)===128&&(s=(i&15)<<12|(c&63)<<6|l&63,(s<=2047||s>=55296&&s<=57343)&&(s=null))):u===4&&(c=t[o+1],l=t[o+2],f=t[o+3],(c&192)===128&&(l&192)===128&&(f&192)===128&&(s=(i&15)<<18|(c&63)<<12|(l&63)<<6|f&63,(s<=65535||s>=1114112)&&(s=null))),s===null?(s=65533,u=1):s>65535&&(s-=65536,r+=String.fromCharCode(s>>>10&1023|55296),s=56320|s&1023),r+=String.fromCharCode(s),o+=u}return r}function _n(t,e,n){for(let r=0,o,i;r<e.length;r++){if(o=e.charCodeAt(r),o>55295&&o<57344)if(i)if(o<56320){t[n++]=239,t[n++]=191,t[n++]=189,i=o;continue}else o=i-55296<<10|o-56320|65536,i=null;else{o>56319||r+1===e.length?(t[n++]=239,t[n++]=191,t[n++]=189):i=o;continue}else i&&(t[n++]=239,t[n++]=191,t[n++]=189,i=null);o<128?t[n++]=o:(o<2048?t[n++]=o>>6|192:(o<65536?t[n++]=o>>12|224:(t[n++]=o>>18|240,t[n++]=o>>12&63|128),t[n++]=o>>6&63|128),t[n++]=o&63|128)}return n}var Ce=class t{constructor(e,n,r,o){this.pbf=e;this.keys=n;this.values=r;this.extent=o;this.type=0;this.properties={};this.geomOffset=-1}static read(e,n,r,o,i){let s=new t(e,r,o,i);return e.readFields(Dn,s,n),s}loadGeometry(){if(this.geomOffset<0)return[];let e=this.pbf,n=e.pos;e.pos=this.geomOffset;let r=e.readVarint()+e.pos,o=1,i=0,s=0,u=0,c=[],l=[];for(;e.pos<r;){if(i<=0){let f=e.readVarint();o=f&7,i=f>>3}if(i--,o===1||o===2)s+=e.readSVarint(),u+=e.readSVarint(),o===1&&(l.length&&c.push(l),l=[]),l.push(s,u);else if(o===7)l.length>=2&&l.push(l[0],l[1]);else throw new Error(`[osmgl] \\u043D\\u0435\\u0438\\u0437\\u0432\\u0435\\u0441\\u0442\\u043D\\u0430\\u044F \\u043A\\u043E\\u043C\\u0430\\u043D\\u0434\\u0430 \\u0433\\u0435\\u043E\\u043C\\u0435\\u0442\\u0440\\u0438\\u0438 MVT: ${o}`)}return l.length&&c.push(l),e.pos=n,c}bbox(){let e=this.loadGeometry(),n=1/0,r=1/0,o=-1/0,i=-1/0;for(let s of e)for(let u=0;u<s.length;u+=2)s[u]<n&&(n=s[u]),s[u]>o&&(o=s[u]),s[u+1]<r&&(r=s[u+1]),s[u+1]>i&&(i=s[u+1]);return[n,r,o,i]}};function Dn(t,e,n){n&&(t===1?e.id=n.readVarint():t===2?Un(n,e):t===3?e.type=n.readVarint():t===4&&(e.geomOffset=n.pos,n.skip(2)))}function Un(t,e){let n=t.readVarint()+t.pos;for(;t.pos<n;){let r=e.keys[t.readVarint()],o=e.values[t.readVarint()];r!==void 0&&(e.properties[r]=o)}}var _e=class t{constructor(e){this.pbf=e;this.version=1;this.name="";this.extent=4096;this.featureOffsets=[];this.keys=[];this.values=[]}static read(e,n){let r=new t(e);return e.readFields(On,r,n),r}get length(){return this.featureOffsets.length}feature(e){let n=this.pbf;n.pos=this.featureOffsets[e];let r=n.readVarint()+n.pos;return Ce.read(n,r,this.keys,this.values,this.extent)}*features(){for(let e=0;e<this.featureOffsets.length;e++)yield this.feature(e)}};function On(t,e,n){n&&(t===15?e.version=n.readVarint():t===1?e.name=n.readString():t===5?e.extent=n.readVarint():t===2?e.featureOffsets.push(n.pos):t===3?e.keys.push(n.readString()):t===4&&e.values.push(Gn(n)))}function Gn(t){let e=t.readVarint()+t.pos,n=null;for(;t.pos<e;){let r=t.readVarint()>>3;r===1?n=t.readString():r===2?n=t.readFloat():r===3?n=t.readDouble():r===4?n=t.readVarint64():r===5?n=t.readVarint():r===6?n=t.readSVarint():r===7?n=t.readBoolean():t.skip(r)}return n}var Me=class{constructor(e){this.layers={};new ae(e instanceof Uint8Array?e:new Uint8Array(e)).readFields((r,o,i)=>{if(r===3&&i){let s=_e.read(i,i.readVarint()+i.pos);s.length&&(this.layers[s.name]=s)}},null)}};function K(t){let e=[],n=null;for(let r of t){if(r.length<6)continue;let o=Hn(r);o!==0&&(o>0?(n&&e.push(n),n={outer:r,holes:[]}):n&&n.holes.push(r))}return n&&e.push(n),e}function Hn(t){let e=0;for(let n=0,r=t.length-2;n<t.length;r=n,n+=2)e+=(t[r]-t[n])*(t[n+1]+t[r+1]);return e/2}function _(t,e){if(!t)return!0;let n=t[0];switch(n){case"all":return t.slice(1).every(r=>_(r,e));case"any":return t.slice(1).some(r=>_(r,e));case"!":return!_(t[1],e);case"has":return e[t[1]]!=null;case"!has":return e[t[1]]==null;case"in":{let r=e[t[1]];return r==null?!1:t.slice(2).includes(r)}case"!in":{let r=e[t[1]];return r==null?!0:!t.slice(2).includes(r)}default:{let r=e[t[1]],o=t[2];if(r==null)return n==="!=";switch(n){case"==":return r===o;case"!=":return r!==o;case">":return r>o;case">=":return r>=o;case"<":return r<o;case"<=":return r<=o;default:return!0}}}}var Nn=Math.PI/8,Xn=.35,zn=32,yt=.25,gt=.07;function X(t,e){let n=e.radius;if(!(n>0))return t;let r=t.length/2-1;if(r<3)return t;let o=Math.max(2,Math.round(e.segments??4)),i=Math.max(e.minCutRatio??Xn,0),s=e.extent,u=[];for(let c=0;c<r;c++){let l=t[c*2],f=t[c*2+1],m=t[(c+r-1)%r*2],a=t[(c+r-1)%r*2+1],h=t[(c+1)%r*2],d=t[(c+1)%r*2+1],g=l-m,x=f-a,p=h-l,w=d-f,b=Math.hypot(g,x),y=Math.hypot(p,w);if(b<1e-6||y<1e-6){u.push(l,f);continue}let F=g/b,M=x/b,v=p/y,R=w/y;if(e.keep?.[c]){u.push(l,f);continue}let S=F*v+M*R;if(S>.985){u.push(l,f);continue}if(s!==void 0&&(De(l,f,s)||De(m,a,s)||De(h,d,s))){u.push(l,f);continue}let P=Math.min(n,b*.4,y*.4);if(P<n*i){u.push(l,f);continue}let V=l-F*P,E=f-M*P,I=l+v*P,A=f+R*P,k=Math.acos(Math.max(-1,Math.min(1,S))),B=Math.min(Nn,Math.PI/2/o),C=Math.ceil(k/B-1e-6),O=e.maxChord&&e.maxChord>0?Math.ceil(P/Math.tan(k/2)*k/e.maxChord):0,z=Math.max(1,Math.min(zn,Math.max(Math.min(o,C),O)));u.push(V,E);for(let H=1;H<z;H++){let D=H/z,U=1-D;u.push(U*U*V+2*U*D*l+D*D*I,U*U*E+2*U*D*f+D*D*A)}u.push(I,A)}return u.length<6?t:(u.push(u[0],u[1]),u)}var De=(t,e,n)=>t<=0||e<=0||t>=n||e>=n;function J(t,e){let n=wt(t.outer,e);if(!n)return null;let r=[];for(let o of t.holes){let i=wt(o,e);i&&r.push(i)}return{outer:n,holes:r}}function wt(t,e){let n=[];for(let r=0;r<t.length-2;r+=2)n.push(t[r],t[r+1]);if(n.length<6)return null;for(let r=0;r<4;r++){let o=n;n=[];let i=o.length/2;if(i===0)return null;for(let s=0;s<i;s++){let u=o[s*2],c=o[s*2+1],l=o[(s+i-1)%i*2],f=o[(s+i-1)%i*2+1],m=Ft(u,c,r,e),a=Ft(l,f,r,e);if(m!==a){let h=Yn(l,f,u,c,r,e);n.push(l+(u-l)*h,f+(c-f)*h)}m&&n.push(u,c)}}return n.length<6?null:(n.push(n[0],n[1]),n)}function Ft(t,e,n,r){return n===0?t>=0:n===1?t<=r:n===2?e>=0:e<=r}function Yn(t,e,n,r,o,i){return o===0?(0-t)/(n-t):o===1?(i-t)/(n-t):o===2?(0-e)/(r-e):(i-e)/(r-e)}function Re(t,e,n,r,o){return t===0&&n===0||t===o&&n===o||e===0&&r===0||e===o&&r===o}function Mt(t,e){for(let n=0;n<t.length;n+=2)if(t[n]<=0||t[n]>=e||t[n+1]<=0||t[n+1]>=e)return!0;return!1}var Ge=18,He=4,Pt=65535/He,Zn=9,$n=1,jn=0,Wn=1,Kn=2;var Rt=0,Jn=1,St=2,Qn=3,qn=.47;function At(t,e,n,r={}){let o=r.metersPerUnit&&r.metersPerUnit>0?r.metersPerUnit:qn,i=Math.max(1024,t.length*48),s=new ArrayBuffer(i*Ge),u={verts:new DataView(s),vertsU8:new Uint8Array(s),vertOffset:0,vertexCount:0,indices:[],featureIds:[],ensure:()=>{}};u.ensure=a=>c(a);let c=a=>{if(u.vertexCount+a<=i)return;i=Math.max(i*2,u.vertexCount+a);let h=new ArrayBuffer(i*Ge);new Uint8Array(h).set(u.vertsU8.subarray(0,u.vertOffset)),s=h,u.verts=new DataView(h),u.vertsU8=new Uint8Array(h)};for(let a of t.features()){if(a.type!==3||!_(n,a.properties))continue;let h=wr(a.properties),d=Fr(a.properties,h);if(h<=d)continue;let g=Rr(a.properties)??Number(a.id??0),x=gr(g>>>0),p=yr(x,a.properties),w=br(a.properties,h),b=K(a.loadGeometry());for(let y of b){let F=J(y,e);if(!F)continue;let M=Mt(F.outer,e),v=(r.cornerRadius??0)/o,R={radius:v,segments:r.cornerSegments,extent:e,minCutRatio:0},S=v>0?{outer:X(F.outer,R),holes:F.holes.map(k=>X(k,R))}:F,P=S.outer.length/2+S.holes.reduce((k,B)=>k+B.length/2,0);c(P*5+32);let V=S.holes.length||M?null:rr(S.outer),E=V?lr(a.properties,V,h,x,o):null,I=null,A=[];if(E&&V){let k=Bt(hr(S.outer,o),V,E.shape);A=mr(k,S.outer);let B=dr(k,A);if(B>1e-6){let C=Math.min(Math.max(B*o*sr,cr),ur);I=xr(k,C/B,h)}}vt(u,S.outer,d,h,g,p,w,o,e,I);for(let k of S.holes)vt(u,k,d,h,g,p,w,o,e,null);I?pr(u,A,I,h,g,p,w,o):nr(u,S.outer,S.holes,h,g,p,w)}}if(!u.indices.length)return null;let l=new Uint32Array(u.indices),f=new Float64Array(u.featureIds);return{vertices:s.slice(0,u.vertOffset),indices:l.buffer,featureIds:f.buffer,vertexCount:u.vertexCount,indexCount:l.length,extent:e}}var Ne=(t,e)=>t|e<<2,Ue=t=>Math.max(0,Math.min(65535,Math.round(Math.min(t,Pt)*He)));function Q(t,e,n,r,o,i,s,u,c,l,f=0,m=0,a=0){let h=t.vertOffset;return t.verts.setInt16(h,Math.round(e),!0),t.verts.setInt16(h+2,Math.round(n),!0),t.verts.setUint16(h+4,Math.round(Math.min(r,Pt)*He),!0),t.vertsU8[h+6]=c,t.vertsU8[h+7]=u,t.verts.setInt8(h+8,Oe(Math.round(o*127))),t.verts.setInt8(h+9,Oe(Math.round(i*127))),t.verts.setInt8(h+10,Oe(Math.round(s*127))),t.vertsU8[h+11]=l,t.verts.setUint16(h+12,Ue(f),!0),t.verts.setUint16(h+14,Ue(m),!0),t.verts.setUint16(h+16,Ue(a),!0),t.vertOffset+=Ge,t.vertexCount++}function vt(t,e,n,r,o,i,s,u,c,l=null){let f=e.length/2;if(f<3)return;let m=Ne(jn,s),a=tr(e,u),h=r-n,d=new Float64Array(f*2),g=new Uint8Array(f);{let x=new Float64Array(f*2);for(let p=0;p<f-1;p++){let w=e[p*2+2]-e[p*2],b=e[p*2+3]-e[p*2+1],y=Math.hypot(w,b)||1;x[p*2]=b/y,x[p*2+1]=-w/y}for(let p=0;p<f-1;p++){let w=(p+f-2)%(f-1),b=x[w*2]*x[p*2]+x[w*2+1]*x[p*2+1],y=x[w*2]+x[p*2],F=x[w*2+1]+x[p*2+1],M=Math.hypot(y,F);b>.5&&M>1e-6&&(d[p*2]=y/M,d[p*2+1]=F/M,g[p]=1)}}for(let x=0;x<f-1;x++){let p=e[x*2],w=e[x*2+1],b=e[x*2+2],y=e[x*2+3];if(p===b&&w===y||Re(p,w,b,y,c))continue;let F=b-p,M=y-w,v=Math.hypot(F,M)||1,R=M/v,S=-F/v,P=a.offset[x],V=a.width[x],E=[0,1];if(l){for(let A=0;A<l.length;A++)for(let k=A+1;k<l.length;k++){let B=j(l[A],p,w)-j(l[k],p,w),C=j(l[A],b,y)-j(l[k],b,y);if(B===C)continue;let O=B/(B-C);O>1e-4&&O<1-1e-4&&E.push(O)}E.sort((A,k)=>A-k)}let I=(A,k)=>{if(!l)return r;let B=1/0;for(let C of l)B=Math.min(B,j(C,A,k));return Math.max(r,B)};for(let A=0;A+1<E.length;A++){let k=E[A],B=E[A+1];if(B-k<1e-6)continue;let C=p+F*k,O=w+M*k,z=p+F*B,H=w+M*B,D=P+v*k*u,U=P+v*B*u,N=(x+1)%(f-1),de=g[x]?d[x*2]:R,ve=g[x]?d[x*2+1]:S,xe=g[N]?d[N*2]:R,ke=g[N]?d[N*2+1]:S,We=R+(de-R)*(1-k),Ke=S+(ve-S)*(1-k),Je=R+(xe-R)*B,Qe=S+(ke-S)*B,qe=Math.hypot(We,Ke)||1,et=Math.hypot(Je,Qe)||1,tt=We/qe,nt=Ke/qe,rt=Je/et,ot=Qe/et;t.ensure(4);let it=Q(t,C,O,n,tt,nt,0,0,i,m,D,V,h),en=Q(t,z,H,n,rt,ot,0,0,i,m,U,V,h),tn=Q(t,C,O,I(C,O),tt,nt,0,255,i,m,D,V,h),st=Q(t,z,H,I(z,H),rt,ot,0,255,i,m,U,V,h);t.indices.push(it,st,en,it,tn,st),t.featureIds.push(o,o)}}}var er=.9976;function tr(t,e){let n=t.length/2-1,r=[];for(let c=0;c<n;c++){let l=t[c*2+2]-t[c*2],f=t[c*2+3]-t[c*2+1],m=Math.hypot(l,f);r.push(m>0?{x:l/m,y:f/m,len:m*e}:{x:0,y:0,len:0})}let o=(c,l)=>r[c].len>0&&r[l].len>0&&r[c].x*r[l].x+r[c].y*r[l].y>=er,i=0;for(;i<n&&o((i-1+n)%n,i);)i++;i>=n&&(i=0);let s=new Array(n).fill(0),u=new Array(n).fill(0);for(let c=0;c<n;){let l=(i+c)%n,f=[l],m=r[l].len,a=c+1;for(;a<n;){let d=(i+a)%n;if(!o((i+a-1)%n,d))break;f.push(d),m+=r[d].len,a++}let h=0;for(let d of f)s[d]=h,u[d]=m,h+=r[d].len;c=a}return{offset:s,width:u}}function nr(t,e,n,r,o,i,s){let u=[],c=[];for(let a=0;a<e.length;a++)u.push(e[a]);for(let a of n){c.push(u.length/2);for(let h=0;h<a.length;h++)u.push(a[h])}let l=Y(u,c.length?c:void 0,2);if(!l.length)return;let f=Ne(Wn,s),m=t.vertexCount;for(let a=0;a<u.length;a+=2)Q(t,u[a],u[a+1],r,0,0,1,255,i,f);for(let a=0;a<l.length;a+=3)t.indices.push(m+l[a],m+l[a+2],m+l[a+1]),t.featureIds.push(o)}function rr(t){let e=or(t);if(e.length<3)return null;let n=Math.abs(ir(t));if(n<=0)return null;let r=null,o=1/0;for(let i=0;i<e.length;i++){let s=(i+1)%e.length,u=e[s].x-e[i].x,c=e[s].y-e[i].y,l=Math.hypot(u,c);if(l<1e-6)continue;u/=l,c/=l;let f=1/0,m=-1/0,a=1/0,h=-1/0;for(let y of e){let F=y.x*u+y.y*c,M=-y.x*c+y.y*u;F<f&&(f=F),F>m&&(m=F),M<a&&(a=M),M>h&&(h=M)}let d=m-f,g=h-a,x=d*g;if(x<=0||x>=o)continue;o=x;let p=(f+m)/2,w=(a+h)/2,b=d>=g;r={cx:p*u-w*c,cy:p*c+w*u,ax:b?u:-c,ay:b?c:u,halfLong:(b?d:g)/2,halfShort:(b?g:d)/2,fill:n/x}}return r}function or(t){let e=[];for(let i=0;i<t.length-2;i+=2)e.push({x:t[i],y:t[i+1]});if(e.length<3)return e;e.sort((i,s)=>i.x===s.x?i.y-s.y:i.x-s.x);let n=(i,s,u)=>(s.x-i.x)*(u.y-i.y)-(s.y-i.y)*(u.x-i.x),r=[];for(let i of e){for(;r.length>=2&&n(r[r.length-2],r[r.length-1],i)<=0;)r.pop();r.push(i)}let o=[];for(let i=e.length-1;i>=0;i--){let s=e[i];for(;o.length>=2&&n(o[o.length-2],o[o.length-1],s)<=0;)o.pop();o.push(s)}return r.pop(),o.pop(),r.concat(o)}function ir(t){let e=0;for(let n=0;n<t.length-2;n+=2)e+=t[n]*t[n+3]-t[n+2]*t[n+1];return e/2}var sr=Math.tan(30*Math.PI/180),ur=3.5,cr=.9;function lr(t,e,n,r,o){if(e.fill<.86)return null;let i=e.halfShort*2*o,s=e.halfLong*2*o,u=i*s,c=e.halfShort>0?e.halfLong/e.halfShort:99,l=fr(t);if(!l){if(n>15||u>600||i<3)return null;let f=r%1e3/1e3;u<30?l=f<.5?"skillion":"gabled":c<1.25?l=f<.35?"pyramidal":"hipped":l=f<.8?"gabled":"hipped"}return l==="flat"?null:{shape:l}}function fr(t){let e=String(t.roof_shape??t["roof:shape"]??"").toLowerCase();return e?e==="flat"?"flat":e==="skillion"||e==="lean_to"||e==="shed"?"skillion":e==="hipped"||e==="half-hipped"||e==="gambrel"?"hipped":e==="pyramidal"||e==="dome"||e==="conical"||e==="onion"?"pyramidal":e==="gabled"||e==="mansard"||e==="round"?"gabled":null:null}var j=(t,e,n)=>t.a*e+t.b*n+t.c;function ar(t,e,n,r){let o=t.length/2;if(o<3)return[];let i=[],s=u=>[t[u*2],t[u*2+1]];for(let u=0;u<o;u++){let[c,l]=s(u),[f,m]=s((u+o-1)%o),a=e*c+n*l+r,h=e*f+n*m+r;if(a<=0!=h<=0){let d=h/(h-a);i.push(f+(c-f)*d,m+(l-m)*d)}a<=0&&i.push(c,l)}return i}function hr(t,e){let n=.5/Math.max(e,1e-6),r=t.length/2-1;if(r<5)return t;let o=[],i=0;o.push(t[0],t[1]);for(let s=1;s<r;s++){let u=t[i*2],c=t[i*2+1],l=t[s*2],f=t[s*2+1],m=l-u,a=f-c,h=Math.hypot(m,a),d=h>1e-6;if(d){for(let g=i+1;g<s;g++)if(Math.abs((t[g*2]-u)*a-(t[g*2+1]-c)*m)/h>=n){d=!1;break}}d||(o.push(t[(s-1)*2],t[(s-1)*2+1]),i=s-1)}return o.length/2<3?t:(o.push(o[0],o[1]),o)}function Bt(t,e,n){let{ax:r,ay:o,halfLong:i}=e;if(n==="skillion"){let c=-o,l=r;return[{a:c,b:l,c:-(c*e.cx+l*e.cy)+e.halfShort}]}let s=[],u=t.length/2-1;for(let c=0;c<u;c++){let l=t[c*2],f=t[c*2+1],m=t[(c+1)%u*2],a=t[(c+1)%u*2+1],h=m-l,d=a-f,g=Math.hypot(h,d);if(g<1e-6||n==="gabled"&&Math.abs((h*r+d*o)/g)<.86)continue;let x=-d/g,p=h/g;s.push({a:x,b:p,c:-(x*l+p*f)})}return!s.length&&i>0?Bt(t,e,"hipped"):s}function mr(t,e){let n=[];for(let o=0;o<e.length-2;o+=2)n.push(e[o],e[o+1]);if(n.length<6)return[];let r=[];for(let o=0;o<t.length;o++){let i=n;for(let s=0;s<t.length&&i.length>=6;s++)s!==o&&(i=ar(i,t[o].a-t[s].a,t[o].b-t[s].b,t[o].c-t[s].c));r.push(i.length>=6?i:[])}return r}function dr(t,e){let n=0;for(let r=0;r<e.length;r++){let o=e[r];for(let i=0;i<o.length;i+=2){let s=j(t[r],o[i],o[i+1]);s>n&&(n=s)}}return n}function xr(t,e,n){return t.map(r=>({a:r.a*e,b:r.b*e,c:r.c*e+n}))}function pr(t,e,n,r,o,i,s,u){let c=Ne(Kn,s);for(let l=0;l<n.length;l++){let f=e[l];if(!f||f.length<6)continue;let m=Y(f,void 0,2);if(!m.length)continue;let a=-n[l].a/u,h=-n[l].b/u,d=Math.hypot(a,h,1),g={x:a/d,y:h/d,z:1/d};t.ensure(f.length/2);let x=t.vertexCount;for(let p=0;p<f.length;p+=2){let w=Math.max(r,j(n[l],f[p],f[p+1]));Q(t,f[p],f[p+1],w,g.x,g.y,g.z,255,i,c)}for(let p=0;p<m.length;p+=3)t.indices.push(x+m[p],x+m[p+2],x+m[p+1]),t.featureIds.push(o)}}function br(t,e){let n=String(t.class??"").toLowerCase();return n==="industrial"||n==="warehouse"||n==="hangar"||n==="construction"?Qn:n==="commercial"||n==="office"||n==="retail"||n==="supermarket"?St:n==="house"||n==="detached"||n==="garage"||n==="hut"||n==="shed"||e<=7?Rt:e>=40?St:Jn}function yr(t,e){let n=String(e.class??""),r=128;return n==="industrial"||n==="warehouse"||n==="construction"?r=96:n==="commercial"||n==="office"||n==="retail"?r=150:(n==="apartments"||n==="residential"||n==="house")&&(r=134),Math.max(0,Math.min(255,r+(t%121-60)))}function gr(t){let e=t>>>0;return e=(e>>>16^e)*73244475,e=(e>>>16^e)*73244475,e=e>>>16^e,e>>>0}function wr(t){let e=q(t.render_height)??q(t.height)??Mr(t.levels??t.building_levels??t["building:levels"]);return e&&e>0?Math.max(e,$n):Zn}function Fr(t,e){let n=q(t.render_min_height)??q(t.min_height)??q(t.base)??0;return n>0&&n<e?n:0}function Mr(t){let e=q(t);return e&&e>0?e*3:null}function q(t){if(typeof t=="number"&&isFinite(t))return t;if(typeof t=="string"){let e=parseFloat(t);if(isFinite(e))return e}return null}var Oe=t=>t>127?127:t<-127?-127:t;function Rr(t){let e=t.osm_id;if(typeof e=="number"&&Number.isFinite(e))return e;if(typeof e=="string"){let n=Number(e);if(Number.isFinite(n))return n}return null}function Sr(t,e,n,r,o){let i=r*r,s=[],u=f=>t[f*2],c=f=>t[f*2+1],l=(f,m)=>{let a=t.length/2;return t.push((u(f)+u(m))/2,(c(f)+c(m))/2),a};for(let f=0;f<e.length;f+=3){s.push([n+e[f],n+e[f+1],n+e[f+2]]);let m=0;for(;s.length&&!(++m>2e4);){let[a,h,d]=s.pop(),g=(u(a)-u(h))**2+(c(a)-c(h))**2,x=(u(h)-u(d))**2+(c(h)-c(d))**2,p=(u(d)-u(a))**2+(c(d)-c(a))**2,w=Math.max(g,x,p);if(w<=i){o.push(a,h,d);continue}if(w===g){let b=l(a,h);s.push([a,b,d],[b,h,d])}else if(w===x){let b=l(h,d);s.push([h,b,a],[b,d,a])}else{let b=l(d,a);s.push([d,b,h],[b,a,h])}}}}function It(t,e,n=0,r,o=!1,i=4096){let s=[],u=[],c=[];for(let h of t.features()){if(h.type!==3||!_(e,h.properties))continue;let d=h.properties.osm_id,g=typeof d=="number"?d:typeof d=="string"?Number(d):NaN,x=Number.isFinite(g)?g:Number(h.id??0);for(let p of K(h.loadGeometry())){let w=o?J(p,i):p;if(!w)continue;let b=[],y=[],F=r?X(w.outer,r):w.outer;for(let R=0;R<F.length;R++)b.push(F[R]);for(let R of w.holes){let S=r?X(R,r):R;y.push(b.length/2);for(let P=0;P<S.length;P++)b.push(S[P])}let M=Y(b,y.length?y:void 0,2);if(!M.length)continue;let v=s.length/2;for(let R=0;R<b.length;R++)s.push(b[R]);if(n>0){let R=[];Sr(s,M,v,n,R);for(let S=0;S<R.length;S+=3)u.push(R[S],R[S+2],R[S+1]),c.push(x);continue}for(let R=0;R<M.length;R+=3)u.push(v+M[R],v+M[R+2],v+M[R+1]),c.push(x)}}if(!u.length)return null;let l=s.length/2,f=new Int16Array(s),m=new Uint32Array(u);return{featureIds:new Float64Array(c).buffer,vertices:f.buffer,indices:m.buffer,vertexCount:l,indexCount:m.length}}function Tt(t){return{shapes:[],cells:[],extent:0,metersPerTile:t}}function Vt(t,e,n,r){if(!(n<=0)){t.extent=r;for(let o of e){let i=o.outer;if(i.length<6)continue;let s=1/0,u=1/0,c=-1/0,l=-1/0;for(let f=0;f<i.length;f+=2)i[f]<s&&(s=i[f]),i[f]>c&&(c=i[f]),i[f+1]<u&&(u=i[f+1]),i[f+1]>l&&(l=i[f+1]);t.shapes.push({outer:i,holes:o.holes,level:n,minX:s,minY:u,maxX:c,maxY:l})}t.cells=[]}}function vr(t){t.cells=Array.from({length:32*32},()=>[]);let e=t.extent/32;for(let n=0;n<t.shapes.length;n++){let r=t.shapes[n],o=ee(Math.floor(r.minX/e)),i=ee(Math.floor(r.maxX/e)),s=ee(Math.floor(r.minY/e)),u=ee(Math.floor(r.maxY/e));for(let c=s;c<=u;c++)for(let l=o;l<=i;l++)t.cells[c*32+l].push(n)}}var Lt=t=>t.shapes.length===0;function Xe(t,e,n){!t.cells.length&&t.shapes.length&&vr(t);let r=t.extent/32,o=t.cells[ee(Math.floor(n/r))*32+ee(Math.floor(e/r))];if(!o||!o.length)return 0;let i=0;for(let s of o){let u=t.shapes[s];if(u.level<=i||e<u.minX||e>u.maxX||n<u.minY||n>u.maxY||!Et(u.outer,e,n))continue;let c=!1;for(let l of u.holes)if(Et(l,e,n)){c=!0;break}c||(i=u.level)}return Math.min(Math.round(i*100),127)}function Ct(t,e){let n=[],r=[],o=t.extent>0?t.metersPerTile/t.extent:0,i=o>0?2/o:0,s=Xe(t,e[0],e[1]);n.push(e[0],e[1]),r.push(s);for(let u=0;u+3<e.length;u+=2){let c=e[u],l=e[u+1],f=e[u+2],m=e[u+3],a=Xe(t,f,m);if(a!==s&&i>0){let h=Math.hypot(f-c,m-l),d=Math.min(Math.ceil(h/i),64),g=s;for(let x=1;x<d;x++){let p=x/d,w=c+(f-c)*p,b=l+(m-l)*p,y=Xe(t,w,b);y!==g&&(n.push(w,b),r.push(y),g=y)}}n.push(f,m),r.push(a),s=a}return{pts:n,levels:r}}var ee=t=>t<0?0:t>31?31:t;function Et(t,e,n){let r=!1,o=t.length/2;for(let i=0,s=o-1;i<o;s=i++){let u=t[i*2],c=t[i*2+1],l=t[s*2],f=t[s*2+1];c>n!=f>n&&e<(l-u)*(n-c)/(f-c)+u&&(r=!r)}return r}var $e=16,kr=64,Pr=0,Ar=1,_t=2,Br=3,Se=1;function Ht(t,e,n,r){let o=r.metersPerUnit>0?r.metersPerUnit:.5,i=r.elevation,s=r.base??0,u=Math.max(r.bevel??0,0)/o,c=Math.max(r.bevelDrop??0,0),l=Math.max(r.cornerRadius??0,0)/o,f=Math.max(512,t.length*24),m=new ArrayBuffer(f*$e),a={view:new DataView(m),bytes:new Uint8Array(m),offset:0,count:0,indices:[],extent:e,ensure(y){if(a.count+y<=f)return;f=Math.max(f*2,a.count+y);let F=new ArrayBuffer(f*$e);new Uint8Array(F).set(a.bytes.subarray(0,a.offset)),m=F,a.view=new DataView(F),a.bytes=new Uint8Array(F)}},h=[],d=new Map;for(let y of t.features()){if(y.type!==3||!_(n,y.properties))continue;let F=r.liftBy?.(y.properties)??0;for(let M of K(y.loadGeometry())){let v=J(M,e);if(v){h.push(F?{...v,lift:F}:v),Dt(v.outer,d);for(let R of v.holes)Dt(R,d)}}}r.onShapes?.(h);let g=new Set;for(let[y,F]of d)F>1&&g.add(y);let x=[],p={radius:l,segments:r.cornerSegments,extent:e,minCutRatio:0,maxChord:yt/o};for(let y of h){let F=l>0?{outer:X(y.outer,{...p,keep:Ut(y.outer,g)}),holes:y.holes.map(I=>X(I,{...p,keep:Ut(I,g)}))}:y,M=u>0?Gt(F.outer,u,e,g):F.outer,v=F.holes.map(I=>u>0?Gt(I,-u,e,g):I),R=y.lift??0,S=i+R,P=s+R;Ot(a,M??F.outer,v.map((I,A)=>I??F.holes[A]),S);let V=S,E=S-c;M&&u>0&&c>0&&ze(a,M,F.outer,V,E,Ar,e,g),E!==P&&ze(a,F.outer,F.outer,E,P,_t,e,g);for(let I of F.holes)if(E!==P&&ze(a,I,I,E,P,_t,e,g),S<P){let A=a.indices.length;Ot(a,I,[],P,Br);for(let k=A;k<a.indices.length;k++)x.push(a.indices[k]);a.indices.length=A}}if(!a.indices.length&&!x.length)return null;let w=a.indices.length,b=new Uint32Array(w+x.length);return b.set(a.indices,0),b.set(x,w),{vertices:m.slice(0,a.offset),indices:b.buffer,vertexCount:a.count,indexCount:b.length,extent:e,capIndexOffset:w}}function te(t,e,n,r){let o=`${Math.round(t*100)},${Math.round(e*100)}`,i=`${Math.round(n*100)},${Math.round(r*100)}`;return o<i?`${o}|${i}`:`${i}|${o}`}function Dt(t,e){for(let n=0;n+3<t.length;n+=2){let r=te(t[n],t[n+1],t[n+2],t[n+3]);e.set(r,(e.get(r)??0)+1)}}function Ut(t,e){if(!e.size)return;let n=t.length/2-1,r=new Array(n).fill(!1);for(let o=0;o<n;o++){let i=te(t[(o+n-1)%n*2],t[(o+n-1)%n*2+1],t[o*2],t[o*2+1]),s=te(t[o*2],t[o*2+1],t[(o+1)%n*2],t[(o+1)%n*2+1]);(e.has(i)||e.has(s))&&(r[o]=!0)}return r}function he(t,e,n,r,o,i,s,u){let c=t.offset;return t.view.setFloat32(c,e,!0),t.view.setFloat32(c+4,n,!0),t.view.setInt16(c+8,Ir(Math.round(r*kr)),!0),t.view.setInt8(c+10,Ze(Math.round(o*127))),t.view.setInt8(c+11,Ze(Math.round(i*127))),t.view.setInt8(c+12,Ze(Math.round(s*127))),t.bytes[c+13]=u,t.view.setInt8(c+14,e<=0?-Se:e>=t.extent?Se:0),t.view.setInt8(c+15,n<=0?-Se:n>=t.extent?Se:0),t.offset+=$e,t.count++}function Ot(t,e,n,r,o=Pr){let i=[],s=[];for(let l=0;l<e.length;l++)i.push(e[l]);for(let l of n){s.push(i.length/2);for(let f=0;f<l.length;f++)i.push(l[f])}let u=Y(i,s.length?s:void 0,2);if(!u.length)return;t.ensure(i.length/2);let c=t.count;for(let l=0;l<i.length;l+=2)he(t,i[l],i[l+1],r,0,0,1,o);for(let l=0;l<u.length;l+=3)t.indices.push(c+u[l],c+u[l+2],c+u[l+1])}function ze(t,e,n,r,o,i,s,u){let c=Math.min(e.length,n.length)/2;if(!(c<3)){t.ensure((c-1)*4);for(let l=0;l<c-1;l++){let f=n[l*2],m=n[l*2+1],a=n[l*2+2],h=n[l*2+3];if(f===a&&m===h||Re(f,m,a,h,s)||u.has(te(f,m,a,h)))continue;let d=a-f,g=h-m,x=Math.hypot(d,g)||1,p=g/x,w=-d/x,b=r-o,y=Math.hypot(e[l*2]-f,e[l*2+1]-m)||0,F=0;if(y>1e-6&&b!==0){let P=1/Math.hypot(1,b/y);F=y/Math.hypot(y,b)*Math.sign(b),p*=P,w*=P}let M=he(t,e[l*2],e[l*2+1],r,p,w,F,i),v=he(t,e[l*2+2],e[l*2+3],r,p,w,F,i),R=he(t,f,m,o,p,w,F,i),S=he(t,a,h,o,p,w,F,i);t.indices.push(R,v,S,R,M,v)}}}function Gt(t,e,n,r){let o=t.length/2-1;if(o<3)return null;let i=[];for(let c=0;c<o;c++){let l=t[c*2],f=t[c*2+1],m=t[(c+o-1)%o*2],a=t[(c+o-1)%o*2+1],h=t[(c+1)%o*2],d=t[(c+1)%o*2+1],g=Math.hypot(l-m,f-a)||1,x=Math.hypot(h-l,d-f)||1,p=(f-a)/g,w=-(l-m)/g,b=(d-f)/x,y=-(h-l)/x,F=p+b,M=w+y,v=Math.hypot(F,M);if(v<1e-6){i.push(l,f);continue}F/=v,M/=v;let R=Math.min(1/Math.max(F*p+M*w,.35),3),S=l-F*e*R,P=f-M*e*R,V=te(m,a,l,f),E=te(l,f,h,d);if(r.has(V)||r.has(E)){i.push(l,f);continue}(l<=0||l>=n)&&(S=l),(f<=0||f>=n)&&(P=f),i.push(S,P)}i.push(i[0],i[1]);let s=Math.abs(Ye(t)),u=Ye(i);if(Math.sign(u)!==Math.sign(Ye(t))||Math.abs(u)<s*.25)return null;for(let c=0;c<i.length;c+=2)i[c]=Math.max(0,Math.min(n,i[c])),i[c+1]=Math.max(0,Math.min(n,i[c+1]));return i}function Ye(t){let e=0;for(let n=0;n<t.length-2;n+=2)e+=t[n]*t[n+3]-t[n+2]*t[n+1];return e/2}var Ze=t=>t>127?127:t<-127?-127:t,Ir=t=>t>32767?32767:t<-32768?-32768:t;var me=20;function Xt(t,e,n=0,r){let o=Math.max(256,t.length*24),i=new ArrayBuffer(o*me),s=new DataView(i),u=0,c=[],l=h=>{if(u+h<=o)return;o=Math.max(o*2,u+h);let d=new ArrayBuffer(o*me);new Uint8Array(d).set(new Uint8Array(i,0,u*me)),i=d,s=new DataView(d)},f=(h,d,g,x,p,w,b,y=0,F=0)=>{let M=u*me;return s.setInt16(M,h,!0),s.setInt16(M+2,d,!0),s.setInt16(M+4,g,!0),s.setInt16(M+6,x,!0),s.setInt8(M+8,p),s.setInt8(M+9,w),s.setInt8(M+10,y),s.setInt8(M+11,F),s.setFloat32(M+12,b,!0),s.setFloat32(M+16,m,!0),u++},m=0;for(let h of t.features()){if(h.type!==2&&h.type!==3||!_(e,h.properties))continue;let d=h.properties.width;m=typeof d=="number"&&d>.5&&d<100?d:0;let g=h.type===3;for(let x of h.loadGeometry()){let p=n>0?Er(Nt(x),n):Nt(x);if(p.length<4)continue;let w=r&&!Lt(r)?Ct(r,p):null,b=w?w.pts:p,y=w?.levels,F=b.length/2;if(F<2)continue;l((F-1)*4);let M=0;for(let v=0;v<F-1;v++){let R=b[v*2],S=b[v*2+1],P=b[v*2+2],V=b[v*2+3],E=Math.hypot(P-R,V-S);if(g&&Vr(R,S,P,V,t.extent)){M+=E;continue}let I=Tr(R,S,P,V,t.extent);if(!I){M+=E;continue}let[A,k,B,C]=I,O=Math.hypot(A-R,k-S),z=Math.hypot(B-A,C-k),H=Math.hypot(P-B,V-C),D=M+O,U=y?y[v]:0,N=y?y[v+1]:0,de=f(A,k,B,C,0,-1,D,U,N),ve=f(A,k,B,C,0,1,D,U,N),xe=f(A,k,B,C,1,1,D,U,N),ke=f(A,k,B,C,1,-1,D,U,N);M+=O+z+H,c.push(de,ve,xe,de,xe,ke)}}}if(!c.length)return null;let a=new Uint32Array(c);return{vertices:i.slice(0,u*me),indices:a.buffer,vertexCount:u,indexCount:a.length}}function Er(t,e){let n=[];for(let r=0;r+3<t.length;r+=2){let o=t[r],i=t[r+1],s=t[r+2],u=t[r+3];n.push(o,i);let c=Math.min(64,Math.floor(Math.hypot(s-o,u-i)/e));for(let l=1;l<c;l++){let f=l/c;n.push(o+(s-o)*f,i+(u-i)*f)}}return n.push(t[t.length-2],t[t.length-1]),n}function Nt(t){let e=[];for(let n=0;n<t.length;n+=2){let r=t[n],o=t[n+1],i=e.length;i>=2&&e[i-2]===r&&e[i-1]===o||e.push(r,o)}return e}function Tr(t,e,n,r,o){let i=n-t,s=r-e,u=0,c=1,l=[[-i,t],[i,o-t],[-s,e],[s,o-e]];for(let[f,m]of l){if(f===0){if(m<0)return null;continue}let a=m/f;if(f<0){if(a>c)return null;a>u&&(u=a)}else{if(a<u)return null;a<c&&(c=a)}}return c-u<1e-6?null:[Math.round(t+i*u),Math.round(e+s*u),Math.round(t+i*c),Math.round(e+s*c)]}function Vr(t,e,n,r,o){return t===n&&(t<=0||t>=o)?!0:e===r&&(e<=0||e>=o)}var Lr=[["\\u0443\\u043B\\u0438\\u0446\\u0430","\\u0443\\u043B."],["\\u0443\\u043B\\u0438\\u0446\\u044B","\\u0443\\u043B."],["\\u0443\\u043B\\u0438\\u0446\\u0435","\\u0443\\u043B."],["\\u043F\\u0440\\u043E\\u0441\\u043F\\u0435\\u043A\\u0442","\\u043F\\u0440\\u043E\\u0441\\u043F."],["\\u043F\\u0440\\u043E\\u0441\\u043F\\u0435\\u043A\\u0442\\u0430","\\u043F\\u0440\\u043E\\u0441\\u043F."],["\\u043F\\u0435\\u0440\\u0435\\u0443\\u043B\\u043E\\u043A","\\u043F\\u0435\\u0440."],["\\u043F\\u0435\\u0440\\u0435\\u0443\\u043B\\u043A\\u0430","\\u043F\\u0435\\u0440."],["\\u043F\\u0440\\u043E\\u0435\\u0437\\u0434","\\u043F\\u0440-\\u0434"],["\\u043F\\u0440\\u043E\\u0435\\u0437\\u0434\\u0430","\\u043F\\u0440-\\u0434"],["\\u043F\\u043B\\u043E\\u0449\\u0430\\u0434\\u044C","\\u043F\\u043B."],["\\u043F\\u043B\\u043E\\u0449\\u0430\\u0434\\u0438","\\u043F\\u043B."],["\\u0431\\u0443\\u043B\\u044C\\u0432\\u0430\\u0440","\\u0431\\u0443\\u043B."],["\\u0431\\u0443\\u043B\\u044C\\u0432\\u0430\\u0440\\u0430","\\u0431\\u0443\\u043B."],["\\u043D\\u0430\\u0431\\u0435\\u0440\\u0435\\u0436\\u043D\\u0430\\u044F","\\u043D\\u0430\\u0431."],["\\u043D\\u0430\\u0431\\u0435\\u0440\\u0435\\u0436\\u043D\\u043E\\u0439","\\u043D\\u0430\\u0431."],["\\u0448\\u043E\\u0441\\u0441\\u0435","\\u0448."],["\\u0442\\u0443\\u043F\\u0438\\u043A","\\u0442\\u0443\\u043F."],["\\u0442\\u0443\\u043F\\u0438\\u043A\\u0430","\\u0442\\u0443\\u043F."],["\\u043C\\u0438\\u043A\\u0440\\u043E\\u0440\\u0430\\u0439\\u043E\\u043D","\\u043C\\u043A\\u0440."],["\\u043C\\u0438\\u043A\\u0440\\u043E\\u0440\\u0430\\u0439\\u043E\\u043D\\u0430","\\u043C\\u043A\\u0440."],["\\u043A\\u04EF\\u0447\\u0430\\u0438","\\u043A."],["\\u043A\\u0443\\u0447\\u0430\\u0438","\\u043A."],["\\u0445\\u0438\\u0451\\u0431\\u043E\\u043D\\u0438","\\u0445\\u0438\\u0451\\u0431."],["\\u0448\\u043E\\u04B3\\u0440\\u043E\\u04B3\\u0438","\\u0448\\u043E\\u04B3."],["\\u0433\\u0443\\u0437\\u0430\\u0440\\u0433\\u043E\\u04B3\\u0438","\\u0433\\u0443\\u0437."],["\\u043C\\u0430\\u0439\\u0434\\u043E\\u043D\\u0438","\\u043C\\u0430\\u0439\\u0434."]],zt=new Map(Lr);function Yt(t){let e=t.split(" ");if(e.length<2)return t;let n=!1,r=e.map(i=>{let s=zt.get(i.toLowerCase());return s?(n=!0,i[0]===i[0].toUpperCase()?s[0].toUpperCase()+s.slice(1):s):i});return!n||!e.filter(i=>zt.get(i.toLowerCase())===void 0).length?t:r.join(" ")}function $t(t,e){let n=[],r=[],o=[],i=[],s=[],u=e.textPlacement==="line",c=[],l=[],f=[];for(let m of t.features()){if(!_(e.filter,m.properties))continue;let a=m.loadGeometry(),h=Dr(m.type,a);if(!h)continue;let d=e.textField?Zt(e.textField,m.properties):"",g=d&&e.abbreviate?Yt(d):d,x=e.iconImage?Zt(e.iconImage,m.properties):"";if(!(!g&&!x)){if(u){let p=_r(m.type,a);if(!p)continue;f.push({text:g,line:p});continue}n.push(h[0],h[1]),r.push(g),o.push(x),i.push(Ur(m.properties)),s.push(e.iconRotate&&Math.round(Number(m.properties[e.iconRotate]??0))||0)}}if(u){for(let{text:m,line:a}of Cr(f)){l.push(c.length/2);for(let h of a)c.push(h);n.push(Math.round(a[0]),Math.round(a[1])),r.push(m),o.push(""),i.push(128),s.push(0)}l.push(c.length/2)}return r.length?{anchors:new Int16Array(n).buffer,texts:r,icons:o,priorities:new Uint8Array(i).buffer,rotations:new Int16Array(s).buffer,...u?{lines:new Int16Array(c).buffer,lineStarts:new Uint32Array(l).buffer}:{}}:null}function Cr(t){let e=[],n=new Map,r=new Map,o=(i,s,u)=>`${i}\\u241F${s}\\u241F${u}`;for(let{text:i,line:s}of t){let u=o(i,s[0],s[1]),c=o(i,s[s.length-2],s[s.length-1]),l=n.get(c),f=r.get(u);if(f!==void 0){let m=e[f];if(m.line.push(...s.slice(2)),r.delete(u),r.set(o(i,m.line[m.line.length-2],m.line[m.line.length-1]),f),l!==void 0&&l!==f){let a=e[l];m.line.push(...a.line.slice(2)),a.line=[],n.delete(c),r.set(o(i,m.line[m.line.length-2],m.line[m.line.length-1]),f)}continue}if(l!==void 0){let m=e[l];m.line.unshift(...s.slice(0,s.length-2)),n.delete(c),n.set(o(i,m.line[0],m.line[1]),l);continue}n.set(u,e.length),r.set(c,e.length),e.push({text:i,line:s})}return e.filter(i=>i.line.length>=4)}function _r(t,e){if(t!==2)return null;let n=null,r=0;for(let o of e){if(o.length<4)continue;let i=0;for(let s=0;s+3<o.length;s+=2)i+=Math.hypot(o[s+2]-o[s],o[s+3]-o[s+1]);i>r&&(r=i,n=o)}return n}function Dr(t,e){if(!e.length)return null;if(t===1){let s=e[0];return s.length>=2?[s[0],s[1]]:null}if(t===2){let s=-1,u=0,c=0;for(let l of e)for(let f=0;f+3<l.length;f+=2){let m=l[f+2]-l[f],a=l[f+3]-l[f+1],h=m*m+a*a;h>s&&(s=h,u=l[f]+m/2,c=l[f+1]+a/2)}return s>0?[Math.round(u),Math.round(c)]:null}let n=1/0,r=1/0,o=-1/0,i=-1/0;for(let s of e)for(let u=0;u<s.length;u+=2)s[u]<n&&(n=s[u]),s[u]>o&&(o=s[u]),s[u+1]<r&&(r=s[u+1]),s[u+1]>i&&(i=s[u+1]);return isFinite(n)?[Math.round((n+o)/2),Math.round((r+i)/2)]:null}function Ur(t){let e=t.rank;return typeof e=="number"&&isFinite(e)?Math.max(0,255-Math.min(e,255)):128}function Zt(t,e){let n=Array.isArray(t)?t:[t];for(let r of n){let o=!0,s=r.replace(/\\{([^}]+)\\}/g,(u,c)=>{let l=e[c];return l==null||l===""?(o=!1,""):String(l)}).trim();if(o&&s)return s}return""}function jt(t,e){let n=[],r=[];for(let o=0;o<t.length;o++){let i=t.feature(o);if(i.type===1&&_(e,i.properties))for(let s of i.loadGeometry())for(let u=0;u+1<s.length;u+=2)n.push(s[u],s[u+1]),r.push(i.properties)}return r.length?{anchors:Int16Array.from(n).buffer,props:r}:null}var Or="\\u241F",Wt=(t,e)=>t+Or+String(e);function Gr(){let t=typeof self<"u"?self.origin:void 0;return t&&t!=="null"&&!t.startsWith("blob:")?t+"/":void 0}async function Jt(t,e){let n=performance.now(),r=Gr(),o=await fetch(t.url,{signal:e,credentials:"same-origin",...r?{referrer:r}:{}}),i=(x,p,w,b,y=0)=>({type:"loaded",id:t.id,buckets:{},timing:{fetchMs:b,parseMs:y},diag:{status:x,bytes:p,layers:w,built:0}});if(!o.ok){if(o.status===404||o.status===204)return i(o.status,0,[],performance.now()-n);throw new Error(`HTTP ${o.status} \\u0434\\u043B\\u044F ${t.url}`)}let s=await o.arrayBuffer(),u=performance.now()-n;if(s.byteLength===0)return i(o.status,0,[],u);let c=performance.now(),l=new Me(s),f=Object.keys(l.layers),m={},a={},h=[],g=t.plan.some(x=>x.type==="surface"&&(x.elevation??0)>0)&&t.plan.some(x=>x.type==="line"&&x.ground)?Tt(t.metersPerTile):void 0;for(let x of t.plan){if(!Nr(x,t.zoom,t.sourceMaxZoom))continue;let p=l.layers[x.sourceLayer];if(!p)continue;let w=Xr(t.zoom,p.extent);try{if(x.splitBy){let y=zr(p,x.splitBy,x.filter);if(!y.length)continue;let F=a[x.splitBy]??(a[x.splitBy]=[]);for(let M of y){F.includes(M)||F.push(M);let v={...x,splitBy:void 0,filter:Yr(x.filter,x.splitBy,M)},R=Kt(v,p,w,t.metersPerTile,g);R&&(m[Wt(x.id,M)]=R)}continue}let b=Kt(x,p,w,t.metersPerTile,g);b&&(m[x.id]=b)}catch(b){h.push(`${x.id}: ${b instanceof Error?b.message:String(b)}`)}}return{type:"loaded",id:t.id,buckets:m,...Object.keys(a).length?{splits:a}:{},timing:{fetchMs:u,parseMs:performance.now()-c},diag:{status:o.status,bytes:s.byteLength,layers:f,built:Object.keys(m).length,...h.length?{failed:h}:{}}}}function Hr(t){return e=>{let n=e.on;if(typeof n!="string"||!n)return 0;let r=0;for(let o of n.split(",")){let i=t[o];typeof i=="number"&&i>r&&(r=i)}return r}}function Nr(t,e,n){let r=e-1,o=e<n?e+1:24;return!(t.maxzoom<r||t.minzoom>o)}function Xr(t,e){return t<=6?Math.max(64,e/24):0}function Kt(t,e,n,r,o){{if(t.type==="fill"){let s=r>0?r/e.extent:0,u=t.cornerRadius&&s>0?{radius:t.cornerRadius/s,segments:t.cornerSegments,extent:e.extent,minCutRatio:0,maxChord:gt/s}:void 0,c=It(e,t.filter,n,u,t.clipToTile===!0,e.extent);return c?{kind:"fill",...c,extent:e.extent}:null}if(t.type==="surface"){let s=Ht(e,e.extent,t.filter,{metersPerUnit:r>0?r/e.extent:0,elevation:t.elevation??0,base:t.base,bevel:t.bevel,bevelDrop:t.bevelDrop,cornerRadius:t.cornerRadius,cornerSegments:t.cornerSegments,...o?{onShapes:u=>Vt(o,u,t.elevation??0,e.extent)}:{},...t.groundBy?{liftBy:Hr(t.groundBy)}:{}});return s?{kind:"surface",...s}:null}if(t.type==="line"){let s=Xt(e,t.filter,n,t.ground?o:void 0);return s?{kind:"line",...s,extent:e.extent}:null}if(t.type==="model"){let s=jt(e,t.filter);return s?{kind:"placement",...s,extent:e.extent}:null}if(t.type==="symbol"){let s=$t(e,{filter:t.filter,textField:t.textField,iconImage:t.iconImage,iconRotate:t.iconRotate,textPlacement:t.textPlacement,abbreviate:t.abbreviate});return s?{kind:"symbol",...s,extent:e.extent}:null}let i=At(e,e.extent,t.filter,{metersPerUnit:r>0?r/e.extent:0,cornerRadius:t.cornerRadius,cornerSegments:t.cornerSegments});return i?{kind:"fill-extrusion",vertices:i.vertices,indices:i.indices,featureIds:i.featureIds,vertexCount:i.vertexCount,indexCount:i.indexCount,extent:i.extent}:null}}function zr(t,e,n){let r=[];for(let o of t.features()){if(!_(n,o.properties))continue;let i=o.properties[e];typeof i!="string"&&typeof i!="number"||r.includes(i)||r.push(i)}return r.sort((o,i)=>typeof o=="number"&&typeof i=="number"?o-i:String(o).localeCompare(String(i))),r}function Yr(t,e,n){let r=["==",e,n];return t?["all",t,r]:r}var Zr=t=>t.kind==="symbol",$r=t=>t.kind==="placement";function Qt(t){let e=[];for(let n of Object.values(t.buckets)){if($r(n)){e.push(n.anchors);continue}if(Zr(n)){e.push(n.anchors,n.priorities),n.lines&&e.push(n.lines),n.lineStarts&&e.push(n.lineStarts);continue}e.push(n.vertices,n.indices),n.featureIds&&e.push(n.featureIds)}return e}var qt=Map;var ne=new qt,je=self;je.onmessage=t=>{let e=t.data;if(e.type==="abort"){ne.get(e.id)?.abort(),ne.delete(e.id);return}let n=new AbortController;ne.set(e.id,n),Jt(e,n.signal).then(r=>{ne.has(e.id)&&(ne.delete(e.id),je.postMessage(r,Qt(r)))}).catch(r=>{let o=n.signal.aborted;ne.delete(e.id);let i={type:"error",id:e.id,message:r instanceof Error?r.message:String(r),aborted:o};je.postMessage(i)})};})();\n';var Wo=class{constructor(e=on()){this.workers=[];this.blobUrl=null;this.pending=new H;this.nextId=1;this.cursor=0;this.mainThreadAborts=new H;this.destroyed=false;try{let t=new Blob([tn],{type:"text/javascript"});this.blobUrl=URL.createObjectURL(t);for(let o=0;o<e;o++){let r=new Worker(this.blobUrl);r.onmessage=n=>this.onMessage(n.data),r.onerror=n=>console.error("[osmgl] \u0432\u043E\u0440\u043A\u0435\u0440 \u0443\u043F\u0430\u043B:",n.message),this.workers.push(r);}}catch(t){console.warn("[osmgl] \u0432\u043E\u0440\u043A\u0435\u0440\u044B \u043D\u0435\u0434\u043E\u0441\u0442\u0443\u043F\u043D\u044B, \u0440\u0430\u0437\u0431\u043E\u0440 \u0442\u0430\u0439\u043B\u043E\u0432 \u043F\u043E\u0439\u0434\u0451\u0442 \u0432 \u0433\u043B\u0430\u0432\u043D\u043E\u043C \u043F\u043E\u0442\u043E\u043A\u0435:",t),this.disposeWorkers();}this.usingWorkers=this.workers.length>0;}get size(){return this.workers.length}load(e,t){let o=this.nextId++,r={type:"load",id:o,...e};if(!this.usingWorkers){let a=new AbortController;return this.mainThreadAborts.set(o,a),Xa(r,a.signal).then(l=>{this.mainThreadAborts.has(o)&&(this.mainThreadAborts.delete(o),t(l));}).catch(l=>{let s=a.signal.aborted;this.mainThreadAborts.delete(o),t({type:"error",id:o,message:l instanceof Error?l.message:String(l),aborted:s});}),o}let n=this.cursor++%this.workers.length;return this.pending.set(o,{resolve:t,workerIndex:n}),this.workers[n].postMessage(r),o}abort(e){if(!this.usingWorkers){this.mainThreadAborts.get(e)?.abort(),this.mainThreadAborts.delete(e);return}let t=this.pending.get(e);if(!t)return;this.pending.delete(e);let o={type:"abort",id:e};this.workers[t.workerIndex].postMessage(o);}onMessage(e){if(this.destroyed)return;let t=this.pending.get(e.id);t&&(this.pending.delete(e.id),t.resolve(e));}disposeWorkers(){for(let e of this.workers)e.terminate();this.workers=[],this.blobUrl&&URL.revokeObjectURL(this.blobUrl),this.blobUrl=null;}destroy(){this.destroyed=true;for(let e of this.mainThreadAborts.values())e.abort();this.mainThreadAborts.clear(),this.pending.clear(),this.disposeWorkers();}};function on(){let i=typeof navigator<"u"&&navigator.hardwareConcurrency||4;return Math.max(1,Math.min(i-1,6))}function Ya(i){return Math.max(0,Math.ceil((i*Math.LN2+Math.log(512/360/.5))/Math.LN10))}function rn(i,e){let t=Ya(i.zoom),o=[Math.round(i.zoom*100)/100,i.center.lat.toFixed(t),i.center.lng.toFixed(t)],r=Math.round(i.bearing*10)/10,n=Math.round(i.pitch*10)/10;(r!==0||n!==0)&&(o.push(r),n!==0&&o.push(n));let a=o.join("/");return e?`${e}=${a}`:a}function nn(i,e){let t=i.replace(/^#/,"");if(!t)return null;if(e){let s=t.split("&").map(c=>c.split("=")).find(([c])=>c===e);if(!s||s.length<2)return null;t=s[1];}let o=t.split("/");if(o.length<3)return null;let r=Number(o[0]),n=Number(o[1]),a=Number(o[2]);if(!isFinite(r)||!isFinite(n)||!isFinite(a)||Math.abs(n)>90||Math.abs(a)>180)return null;let l={center:{lng:a,lat:n},zoom:r};return o.length>3&&isFinite(Number(o[3]))&&(l.bearing=Number(o[3])),o.length>4&&isFinite(Number(o[4]))&&(l.pitch=Number(o[4])),l}function Ka(i){if(typeof window>"u"||!window.history?.replaceState)return;let e=new URL(window.location.href);e.hash=i,window.history.replaceState(window.history.state,"",e.toString());}var $a={high:{name:"high",maxPixelRatio:2,maxCanvasPixels:16777216,antialias:true,maxWorkers:6,shadowMapSize:1024,detail:1,tileCacheSize:64,allowShadows:true,detailBias:1,maxTiles:512,modelBudget:1,simpleGeometry:false},balanced:{name:"balanced",maxPixelRatio:1.75,maxCanvasPixels:5529600,antialias:true,maxWorkers:4,shadowMapSize:1024,detail:.85,tileCacheSize:40,allowShadows:true,detailBias:1.1,maxTiles:192,modelBudget:.7,simpleGeometry:false},low:{name:"low",maxPixelRatio:1.25,maxCanvasPixels:2592e3,antialias:true,maxWorkers:2,shadowMapSize:512,detail:.5,tileCacheSize:24,allowShadows:false,detailBias:1.25,maxTiles:96,modelBudget:.4,simpleGeometry:true},minimal:{name:"minimal",maxPixelRatio:1,maxCanvasPixels:1152e3,antialias:false,maxWorkers:2,shadowMapSize:512,detail:0,tileCacheSize:16,allowShadows:false,detailBias:1.7,maxTiles:48,modelBudget:.2,simpleGeometry:true}},wt=i=>$a[i]??$a.high;function Vo(i){let{cores:e,memory:t,mobile:o,devicePixelRatio:r}=i;return e<=2||t!==void 0&&t<=2?"minimal":o?e<=4||t!==void 0&&t<=3?"minimal":e<=6||t!==void 0&&t<=4||r>=3?"low":"balanced":e<=4||t!==void 0&&t<=4?"balanced":"high"}function Bo(){if(typeof navigator>"u")return {cores:4,mobile:false,devicePixelRatio:1};let i=navigator,e=typeof matchMedia=="function"&&matchMedia("(pointer: coarse)").matches&&typeof screen<"u"&&Math.min(screen.width,screen.height)<=820,t=i.userAgentData?.mobile===true||e;return {cores:i.hardwareConcurrency||4,memory:i.deviceMemory,mobile:t,devicePixelRatio:typeof devicePixelRatio=="number"?devicePixelRatio:1}}function an(i,e,t,o){let r=Math.min(t||1,o.maxPixelRatio),n=Math.max(i*e,1),a=Math.sqrt(o.maxCanvasPixels/n);return Math.max(Math.min(r,a),1)}function ln(i){return i==="high"?3:i==="balanced"?2:i==="low"?1:0}function qa(i){return i==="minimal"?"low":i==="low"?"balanced":i==="balanced"?"high":null}function sn(i){return i==="high"?"balanced":i==="balanced"?"low":i==="low"?"minimal":null}var Vf=1,Qt=class{constructor(e){this.originX=0;this.originY=0;this._revision=0;this.id=e.id??`obj-${Vf++}`,this.zIndex=e.zIndex??0,this.altitude=e.altitude??0,this.visible=e.visible!==false,this.userData=e.userData??{},this.paint=e;}get ghostOpacity(){return this.paint.ghostOpacity??0}get revision(){return this._revision}invalidate(){this._revision++;}setPaint(e){return Object.assign(this.paint,e),this.invalidate(),this}setOriginFromCoords(e){let t=1/0,o=1/0,r=-1/0,n=-1/0;for(let a of e)for(let l of a){let s=q(l),c=ee(s.lng),f=te(s.lat);c<t&&(t=c),c>r&&(r=c),f<o&&(o=f),f>n&&(n=f);}if(!isFinite(t)){this.originX=0,this.originY=0;return}this.originX=(t+r)/2,this.originY=(o+n)/2;}toLocal(e){let t=[];for(let o of e){let r=q(o);t.push(ee(r.lng)-this.originX,te(r.lat)-this.originY);}return t}color(e,t){let o=le(this.paint[e]??t),r=this.paint.opacity??1;return [o[0],o[1],o[2],o[3]*r]}linePaint(e){return e.dashArray=this.paint.dashArray,e.offset=this.paint.offset,this.paint.arrow&&(e.arrow=true,e.arrowColor=this.color("arrowColor","#ffffff"),e.arrowPeriod=this.paint.arrowPeriod??46,e.arrowSize=this.paint.arrowSize??5),e}},fn=class extends Qt{constructor(e){super(e),this.coordinates=e.coordinates,this.segments=e.segments??[],this.setOriginFromCoords([this.coordinates]);}setCoordinates(e){return this.coordinates=e,this.setOriginFromCoords([e]),this.invalidate(),this}setSegments(e){return this.segments=e,this.invalidate(),this}getCoordinates(){return this.coordinates}rings(){return [this.coordinates]}build(){let e=zt([this.toLocal(this.coordinates)]);if(!e)return [];let t=this.paint.width??6,o=[],r=this.paint.strokeWidth??0;r>0&&o.push({kind:"line",mesh:e,color:this.color("strokeColor","#ffffff"),width:t+r*2,offset:this.paint.offset});let n=this.colorRuns();if(!n.length)return o.push(this.linePaint({kind:"line",mesh:e,color:this.color("color","#2f6df6"),width:t})),o;let a=this.paint.opacity??1;for(let l of n){let s=zt([this.toLocal(this.coordinates.slice(l.from,l.to+1))]);if(!s)continue;let c=le(l.color);o.push(this.linePaint({kind:"line",mesh:s,color:[c[0],c[1],c[2],c[3]*a],width:t}));}return o}colorRuns(){if(this.segments.length===0||this.coordinates.length<2)return [];let e=this.coordinates.length-1,t=this.segments.filter(r=>Number.isInteger(r.at)&&r.at>=0&&r.at<e).sort((r,n)=>r.at-n.at);if(!t.length)return [];let o=[];for(let r=0;r<t.length;r++){let n=r===0?0:t[r].at,a=r+1<t.length?t[r+1].at:e;a>n&&o.push({from:n,to:a,color:t[r].color});}return o}hitTest(e,t,o){let r=(this.paint.width??6)/2+(this.paint.strokeWidth??0)+o,n=dn(this.coordinates,this.altitude,t);for(let a=0;a+1<n.length;a++)if(Za(e,n[a],n[a+1])<=r)return true;return false}},Do=class extends Qt{constructor(e){super(e),this.coordinates=e.coordinates,this.setOriginFromCoords(this.coordinates);}setCoordinates(e){return this.coordinates=e,this.setOriginFromCoords(e),this.invalidate(),this}rings(){return this.coordinates}build(){let e=[],t=Ar(this.coordinates.map(r=>this.toLocal(r)));t&&e.push({kind:"fill",mesh:t,color:this.color("color","#2f6df6"),width:0});let o=this.paint.strokeWidth??this.paint.width??0;if(o>0){let r=this.coordinates.map(a=>this.toLocal(cn(a))),n=zt(r);n&&e.push(this.linePaint({kind:"line",mesh:n,color:this.color("strokeColor","#2f6df6"),width:o}));}return e}hitTest(e,t){let o=dn(cn(this.coordinates[0]??[]),this.altitude,t);if(!hn(e,o))return false;for(let r=1;r<this.coordinates.length;r++)if(hn(e,dn(cn(this.coordinates[r]),this.altitude,t)))return false;return true}},un=class extends Do{constructor(e){super({...e,coordinates:[Bf(e.center,e.radius,e.segments)]});}};function Bf(i,e,t){let o=q(i),r=e/Le(o.lat),n=ee(o.lng),a=te(o.lat),l=Math.max(12,t??Math.min(128,Math.round(24+e/20))),s=[];for(let c=0;c<l;c++){let f=c/l*Math.PI*2;s.push([Se(n+Math.cos(f)*r),Ce(a+Math.sin(f)*r)]);}return s}function dn(i,e,t){let o=[];for(let r of i){let n=q(r),a=t(n.lng,n.lat,e);a&&o.push(a);}return o}function cn(i){if(i.length<2)return i;let e=q(i[0]),t=q(i[i.length-1]);return e.lng===t.lng&&e.lat===t.lat?i:[...i,i[0]]}function Za(i,e,t){let o=t.x-e.x,r=t.y-e.y,n=o*o+r*r;if(n<1e-12)return Math.hypot(i.x-e.x,i.y-e.y);let a=((i.x-e.x)*o+(i.y-e.y)*r)/n;return a=a<0?0:a>1?1:a,Math.hypot(i.x-(e.x+a*o),i.y-(e.y+a*r))}function hn(i,e){let t=false;for(let o=0,r=e.length-1;o<e.length;r=o++){let n=e[o].x,a=e[o].y,l=e[r].x,s=e[r].y;a>i.y!=s>i.y&&i.x<(l-n)*(i.y-a)/(s-a)+n&&(t=!t);}return t}var Qa="objects3d",xt="level",Df=32,Gf=100,mn=120,Nf=40,Uf=.35,jf=.02,Xf=150,Yf=250;function Ja(i){return typeof i=="number"?{top:i,right:i,bottom:i,left:i}:{top:i?.top??0,right:i?.right??0,bottom:i?.bottom??0,left:i?.left??0}}function Kf(i){let e={...i};return delete e.cornerRadius,delete e.cornerSegments,e.type==="surface"&&(e.type="fill",delete e.elevation,delete e.base,delete e.bevel,delete e.bevelDrop),e}var pn=class extends Ve{constructor(t){super();this.options=t;this.transform=new St;this.ctx=null;this.sources=new H;this.rasterSources=new H;this.renderer=new Bt;this.objects=new Ht;this.markerHost=null;this.gestures=null;this.resizeObserver=null;this.frameHandle=0;this.needsRepaint=true;this.padding={top:0,right:0,bottom:0,left:0};this.animation=null;this.loaded=false;this.destroyed=false;this.objects3d=null;this.objects3dEnabled=true;this.frameRing=new Uint8Array(mn);this.ringAt=0;this.ringSum=0;this.ringFilled=0;this.steadyFrames=0;this.lastFrameAt=0;this.continuousFrames=0;this.onHashChange=null;this.lastMoveEmit=0;this.lastIndoorKey="";this.writingHash=false;this.hashTimer=0;this.layerOverrides=new H;this.autoIndoorLevel=true;let o=typeof t.container=="string"?document.getElementById(t.container):t.container;if(!o)throw new Error(`[osmgl] \u043A\u043E\u043D\u0442\u0435\u0439\u043D\u0435\u0440 \u043D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D: ${String(t.container)}`);this.container=o,this.qualityAuto=(t.quality??"auto")==="auto";let r=this.qualityAuto?Vo(Bo()):t.quality;this.qualityCeiling=r,this.quality=wt(r),this.densityQuality=this.quality,this.maxPixelRatio=t.maxPixelRatio??this.quality.maxPixelRatio,this._style=new ct(t.theme?go(t.theme,t.style):t.style),this.background=t.background?le(t.background):null,this.canvas=document.createElement("canvas"),this.canvas.style.width="100%",this.canvas.style.height="100%",this.canvas.style.display="block",this.canvas.style.outline="none",getComputedStyle(this.container).position==="static"&&(this.container.style.position="relative"),this.container.appendChild(this.canvas);let n=document.createElement("div");n.className="osmgl-markers",n.style.cssText="position:absolute;inset:0;overflow:hidden;pointer-events:none",this.container.appendChild(n),this.markerHost=n,this.objects.setMarkerHost(n);let a=this.transform;a.minZoom=t.minZoom??0,a.maxZoom=t.maxZoom??22,a.maxPitch=t.maxPitch??75,a.projection=t.projection??"mercator",a.center=q(t.center??[0,0]),a.zoom=t.zoom??2,a.bearing=t.bearing??0,a.pitch=t.pitch??0,this.hashName=typeof t.hash=="string"?t.hash:void 0,t.hash&&this.applyHash(false),this.pool=new Wo(t.workerCount??Math.min(on(),this.quality.maxWorkers)),this.initGL(),this.initSource(),this.initInput(),this.initResize(),queueMicrotask(()=>{this.destroyed||(this.loaded=true,this.emit("load",void 0),this.triggerRepaint());});}initGL(){let t=this.canvas.getContext("webgl2",{alpha:false,antialias:this.quality.antialias,depth:true,stencil:true,preserveDrawingBuffer:false,powerPreference:"high-performance",failIfMajorPerformanceCaveat:false});if(!t)throw new Error("[osmgl] WebGL2 \u043D\u0435\u0434\u043E\u0441\u0442\u0443\u043F\u0435\u043D \u0432 \u044D\u0442\u043E\u043C \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435");this.ctx=new ro(t);let o=new bt(this.options.fonts??"/tileserver/fonts/{fontstack}/{range}.pbf",this.options.fontstack);this.options.icons&&o.icons.setIcons({...Qe,...this.options.icons}),o.onAssetsReady=()=>this.triggerRepaint(),this.renderer.symbols=o,this.renderer.objects=this.objects,this.renderer.models.onLoaded=()=>this.triggerRepaint(),this.renderer.init(this.ctx),this.canvas.addEventListener("webglcontextlost",r=>{r.preventDefault(),this.stopFrameLoop(),this.emit("contextlost",void 0),this.emit("error",{message:"\u043A\u043E\u043D\u0442\u0435\u043A\u0441\u0442 WebGL \u043F\u043E\u0442\u0435\u0440\u044F\u043D"});});}initSource(){this.options.tiles&&this.addSource(Y,{url:this.options.tiles,minzoom:this.options.sourceMinZoom??0,maxzoom:this.options.sourceMaxZoom??14});for(let[o,r]of Object.entries({...this._style.spec.sources??{},...this.options.sources??{}}))this.addSource(o,r);let t=this.options.objects3d;if(t){this.objects3d=new Oo({endpoint:t.endpoint??"/objects3d",apiKey:t.apiKey??null}),this.objects3d.onReady=()=>this.triggerRepaint(),this.objects3d.setModelKey(this._style.spec.model3dKey??"");let o=t.sourceMaxZoom??14;this.addSource(this.objects3dSource,{url:t.tiles,minzoom:o,maxzoom:o});}}get objects3dSource(){return this.options.objects3d?this.options.objects3d.source??"model3d":null}objects3dPlan(){let t=this.options.objects3d;return {id:Qa,type:"model",sourceLayer:t.sourceLayer??"model3d",minzoom:0,maxzoom:24}}planFor(t,o=this._style){let r=o.workerPlan(t),n=t===this.objects3dSource?[...r,this.objects3dPlan()]:r;return this.quality.simpleGeometry?n.map(Kf):n}updateObjects3D(){let t=this.objects3d,o=this.objects3dSource;if(!t||!o)return;let r=this.sources.get(o);if(!r)return;if(!this.objects3dEnabled){t.models.length&&t.clear(l=>this.renderer.models.remove(l,this.ctx?.gl)),this.renderer.hiddenBuildings=t.replacedBuildings,this.renderer.hiddenVenues=t.replacedVenues,this.renderer.hiddenVenueLayer=null;return}let n=this.venuesForMask();t.update({id:Qa,"source-layer":this.options.objects3d.sourceLayer??"model3d",layout:this.options.objects3d.layout},r,this.transform,l=>this.renderer.models.add(l),l=>this.renderer.models.remove(l,this.ctx?.gl),this.buildingsForMask(),n),this.renderer.hiddenBuildings=t.replacedBuildings,this.renderer.hiddenVenues=t.replacedVenues,this.renderer.hiddenVenueLayer=n?.key??null;let a=this.renderer.indoorMask.footprint();if(a){let l=this.transform.worldSize>0?this.transform.pixelsPerMeter/this.transform.worldSize*1.5:0;for(let s of t.models){let c=s.origin();s.setHidden(Pe(a,c.x,c.y,l));}}else for(let l of t.models)l.setHidden(false);}buildingsForMask(){let t=this.sources.get(Y);if(!t)return null;for(let o of this._style.layers){if(o.type!=="fill-extrusion"||(o.source??Y)!==Y)continue;let r=this._style.bucketKeyFor(o);if(r!==null)return {source:t,key:r}}return null}venuesForMask(){let t=new Set;for(let o of this._style.layers)"splitBy"in o&&o.splitBy===xt&&t.add(o.source??Y);for(let o of this._style.layers){if(o.type!=="fill-extrusion"||"splitBy"in o&&o.splitBy)continue;let r=o.source??Y;if(!t.has(r))continue;let n=this.sources.get(r),a=this._style.bucketKeyFor(o);if(n&&a!==null)return {source:n,key:a}}return null}addSource(t,o){if(this.sources.get(t)?.destroy(),this.sources.delete(t),this.rasterSources.get(t)?.destroy(),this.rasterSources.delete(t),o.type==="raster"){let n=new Yt({url:o.url,minzoom:o.minzoom??0,maxzoom:o.maxzoom??19,cacheSize:this.quality.tileCacheSize*2});return n.on("data",()=>this.triggerRepaint()),n.on("error",({message:a})=>this.emit("error",{message:a})),this.rasterSources.set(t,n),this.triggerRepaint(),this}let r=new Fo(this.pool,{url:o.url,minzoom:o.minzoom??0,maxzoom:o.maxzoom??14,cacheSize:this.quality.tileCacheSize*2,plan:this.planFor(t)});return r.on("data",()=>this.triggerRepaint()),r.on("error",({message:n})=>this.emit("error",{message:n})),t===Y&&r.on("idle",()=>this.emit("idle",void 0)),this.sources.set(t,r),this.triggerRepaint(),this}initInput(){this.gestures=new uo(this.canvas,this.transform,t=>{this.animation=null,t==="zoom"&&this.emit("zoom",void 0),this.emitMove(),this.triggerRepaint();},()=>this.emit("moveend",void 0),this.options.gestures),this.initClicks(),this.initHash();}initClicks(){let t=null;this.canvas.addEventListener("pointerdown",r=>{r.button===0&&(t={x:r.clientX,y:r.clientY,t:performance.now()});}),this.canvas.addEventListener("pointerup",r=>{let n=t;if(t=null,r.button!==0||!n||Math.hypot(r.clientX-n.x,r.clientY-n.y)>4||performance.now()-n.t>500)return;let a=this.canvas.getBoundingClientRect(),l={x:r.clientX-a.left,y:r.clientY-a.top},s=this.objects.hitTest(this.transform,l),c=s?null:this.queryRoom(l),f=s||c?null:this.queryBuilding(l);this.options.highlightBuildings!==false&&(this.setHighlight(f),this.setRoomHighlight(c));for(let h of this.getPopups())h.closeOnClick&&this.removePopup(h);this.emit("click",{point:l,lngLat:this.transform.unproject(l),object:s,building:f,symbol:this.querySymbol(l,4)});}),this.canvas.addEventListener("dblclick",r=>{let n=this.pointOf(r);this.emit("dblclick",{point:n,lngLat:this.transform.unproject(n)});}),this.canvas.addEventListener("contextmenu",r=>{r.preventDefault();let n=this.pointOf(r);this.emit("contextmenu",{point:n,lngLat:this.transform.unproject(n)});});let o=0;this.canvas.addEventListener("pointermove",r=>{if(r.pointerType==="touch")return;let n=performance.now();if(n-o<16)return;o=n;let a=this.pointOf(r),l=this.querySymbol(a);this.setSymbolHover(l),this.emit("mousemove",{point:a,lngLat:this.transform.unproject(a),object:this.objects.hitTest(this.transform,a),symbol:l});});}pointOf(t){let o=this.canvas.getBoundingClientRect();return {x:t.clientX-o.left,y:t.clientY-o.top}}initResize(){this.resizeObserver=new ResizeObserver(()=>this.resize()),this.resizeObserver.observe(this.container),this.resize();}resize(){if(this.destroyed)return;let t=this.container.clientWidth||1,o=this.container.clientHeight||1,r=an(t,o,Math.min(window.devicePixelRatio||1,this.maxPixelRatio),this.densityQuality);this.canvas.width=Math.round(t*r),this.canvas.height=Math.round(o*r),this.transform.resize(t,o),this.triggerRepaint();}getCenter(){return this.transform.center}getZoom(){return this.transform.zoom}getBearing(){return this.transform.bearing}getPitch(){return this.transform.pitch}setCenter(t){return this.transform.center=q(t),this.afterCameraChange()}setZoom(t){return this.transform.zoom=t,this.emit("zoom",void 0),this.afterCameraChange()}setBearing(t){return this.transform.bearing=t,this.afterCameraChange()}setPitch(t){return this.transform.pitch=t,this.afterCameraChange()}jumpTo(t){let o=this.transform;return t.center!==void 0&&(o.center=q(t.center)),t.zoom!==void 0&&(o.zoom=t.zoom),t.bearing!==void 0&&(o.bearing=t.bearing),t.pitch!==void 0&&(o.pitch=t.pitch),this.animation=null,this.afterCameraChange()}easeTo(t){let o=t.duration??0;if(o<=0)return this.jumpTo(t);let r=this.transform,n={center:r.center,zoom:r.zoom,bearing:r.bearing,pitch:r.pitch},l={center:t.center!==void 0?q(t.center):r.center,zoom:t.zoom??r.zoom,bearing:n.bearing+et((t.bearing??r.bearing)-n.bearing),pitch:t.pitch??r.pitch};return this.animation={start:performance.now(),duration:o,from:n,to:l},this.triggerRepaint(),this}flyTo(t){let o=this.transform,r={center:o.center,zoom:o.zoom,bearing:o.bearing,pitch:o.pitch},a={center:t.center!==void 0?q(t.center):o.center,zoom:t.zoom??o.zoom,bearing:r.bearing+et((t.bearing??o.bearing)-r.bearing),pitch:t.pitch??o.pitch},l=Be(r.zoom),s=(ee(a.center.lng)-ee(r.center.lng))*l,c=(te(a.center.lat)-te(r.center.lat))*l,f=Math.hypot(s,c),h=Math.max(o.width,o.height),u=h*Math.pow(2,r.zoom-a.zoom),d=1.42,m=d*d,y,p=null;if(f<1e-6){let g=Math.log(u/h);y=Math.abs(g)/d,p=v=>({u:0,w:h*Math.exp(d*Math.sign(g)*v)});}else {let g=x=>{let C=x===0?h:u,T=x===0?u:h;return (T*T-C*C+(x===0?1:-1)*m*m*f*f)/(2*C*m*f)},v=x=>Math.log(-g(x)+Math.sqrt(g(x)*g(x)+1)),w=v(0);y=(v(1)-w)/d;let _=x=>(Math.exp(x)+Math.exp(-x))/2,M=x=>(Math.exp(2*x)-1)/(Math.exp(2*x)+1);p=x=>{let C=d*x+w;return {u:h*_(w)*M(C)/m-h*Math.sinh(w)/m,w:h*_(w)/_(C)}};}if(!Number.isFinite(y)||y<=0)return this.jumpTo(t);let b=t.duration??Math.min(3e3,y/1.2*1e3);return this.animation={start:performance.now(),duration:b,from:r,to:a,fly:{S:y,u1:f,curve:p,w0:h}},this.triggerRepaint(),this}setPadding(t){return this.padding=Ja(t),this.renderer.symbols&&(this.renderer.symbols.padding=this.padding),this.triggerRepaint(),this}getPadding(){return {...this.padding}}getBounds(){let t=this.transform,o=new _t;for(let[r,n]of [[0,0],[t.width,0],[t.width,t.height],[0,t.height]])o.extend(t.unproject({x:r,y:n}));return o}cameraForBounds(t,o={}){let r=this.transform,n=Uo(t,{width:r.width,height:r.height,bearing:o.bearing??r.bearing,padding:o.padding!==void 0?Ja(o.padding):this.padding,maxZoom:Math.min(o.maxZoom??r.maxZoom,r.maxZoom),minZoom:r.minZoom});return n?{...n,pitch:o.pitch??r.pitch}:null}fitBounds(t,o={}){let r=this.cameraForBounds(t,o);if(!r)return this;let n={...r,duration:o.duration??600};return o.fly?this.flyTo(n):this.easeTo(n)}stepAnimation(t){let o=this.animation;if(!o)return false;let r=we((t-o.start)/o.duration,0,1),n=o.fly?r:oo(r),a=this.transform,l=q(o.from.center),s=q(o.to.center);if(o.fly){let{u:c,w:f}=o.fly.curve(o.fly.S*r),h=o.fly.u1>1e-6?we(c/o.fly.u1,0,1):r;return a.center={lng:l.lng+(s.lng-l.lng)*h,lat:l.lat+(s.lat-l.lat)*h},a.zoom=o.from.zoom+Math.log2(o.fly.w0/f),a.bearing=o.from.bearing+(o.to.bearing-o.from.bearing)*oo(r),a.pitch=o.from.pitch+(o.to.pitch-o.from.pitch)*oo(r),r>=1&&(a.center=s,a.zoom=o.to.zoom),this.emitMove(),r>=1?(this.animation=null,this.emit("moveend",void 0),false):true}return a.center={lng:l.lng+(s.lng-l.lng)*n,lat:l.lat+(s.lat-l.lat)*n},a.zoom=o.from.zoom+(o.to.zoom-o.from.zoom)*n,a.bearing=o.from.bearing+(o.to.bearing-o.from.bearing)*n,a.pitch=o.from.pitch+(o.to.pitch-o.from.pitch)*n,this.emitMove(),r>=1?(this.animation=null,this.emit("moveend",void 0),false):true}afterCameraChange(){return this.emitMove(),this.triggerRepaint(),this}emitMove(){let t=performance.now();t-this.lastMoveEmit<8||(this.lastMoveEmit=t,this.emit("move",void 0));}project(t,o=0){return this.transform.project(q(t),o)}unproject(t){return this.transform.unproject(t)}get style(){return this._style}setStyle(t){let o=this._style,r=new ct(t);Object.assign(r.splitValues,o.splitValues),this._style=r,this.applyLayerOverrides();for(let[n,a]of this.sources.entries()){let l=JSON.stringify(o.workerPlan(n)),s=JSON.stringify(r.workerPlan(n));l!==s&&a.setPlan(this.planFor(n,r));}return this.objects3d?.setModelKey(t.model3dKey??""),this.triggerRepaint(),this}setTheme(t){return this.setStyle(go(t,this.options.style))}static get themes(){return Object.keys(ft)}static get themeList(){return Object.entries(ft).map(([t,o])=>({id:t,name:o.name||t}))}setLayoutProperty(t,o,r){let n=this._style.layers.find(l=>l.id===t);if(!n)return console.warn(`[osmgl] \u0441\u043B\u043E\u0439 \u0441\u0442\u0438\u043B\u044F "${t}" \u043D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D`),this;let a=n.layout??(n.layout={});if(a[o]=r,this.rememberOverride(t,{layout:{[o]:r}}),o==="textField"||o==="iconImage"||o==="splitBy")for(let[l,s]of this.sources)s.setPlan(this.planFor(l));return this.triggerRepaint(),this}setPaintProperty(t,o,r){let n=this._style.layers.find(a=>a.id===t);return n?(n.paint[o]=r,this.rememberOverride(t,{paint:{[o]:r}}),this.triggerRepaint(),this):(console.warn(`[osmgl] \u0441\u043B\u043E\u0439 \u0441\u0442\u0438\u043B\u044F "${t}" \u043D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D`),this)}setShadows(t){let o=typeof t=="boolean"?{enabled:t}:t;return Object.assign(this.renderer.shadows,o),this.triggerRepaint(),this}querySymbol(t,o=2){let r=this.renderer.symbols?.querySymbol(t,o);return r?{layerId:r.layerId,text:r.text,icon:r.icon,lngLat:{lng:Se(r.mercX),lat:Ce(r.mercY)},key:bt.keyOf(r)}:null}setSymbolHover(t){return this.renderer.symbols?.setHover(t?.key??null)&&this.triggerRepaint(),this}setSymbolHidden(t){return this.renderer.symbols?.setHidden(t?.key??null)&&this.triggerRepaint(),this}queryBuilding(t){let o=null;for(let r of this._style.layers){if(r.type!=="fill-extrusion"||r.overlay||!this._style.layerVisibleAt(r,this.transform.zoom))continue;let n=this.sources.get(r.source??Y);if(!n)continue;let a=Sr(this.transform,n,r.id,t);a&&(!o||a.distance<o.distance)&&(o=a);}return o}setHighlight(t,o={}){return this.renderer.highlight=t?{layerId:t.layerId,featureId:t.featureId,color:o.color??this.options.highlightColor??"#4ec97f",opacity:o.opacity??.45}:null,this.triggerRepaint(),this}queryRoom(t){if(!this.renderer.indoorOpen)return null;let o=[],r=new H,n;for(let l of this._style.layers){if(l.type!=="fill"||!l.id.startsWith("indoor-")||l.id==="indoor-shell"||!this._style.layerVisibleAt(l,this.transform.zoom))continue;let s=this._style.bucketKeyFor(l);s&&(o.push(s),r.set(s,l.id),n??(n=this.sources.get(l.source??Y)));}if(!n||!o.length)return null;let a=Mr(this.transform,n,o,t);return a?{...a,layerId:r.get(a.layerId)??a.layerId,bucketKey:a.layerId}:null}setRoomHighlight(t,o={}){return this.renderer.highlightFill=t?{layerId:t.layerId,bucketKey:t.bucketKey??t.layerId,featureId:t.featureId,color:o.color??this.options.highlightColor??"#4ec97f",opacity:o.opacity??.5}:null,this.triggerRepaint(),this}getHighlight(){let t=this.renderer.highlight;return t?{featureId:t.featureId,layerId:t.layerId}:null}initHash(){this.options.hash&&(this.on("move",()=>this.scheduleHash()),this.on("moveend",()=>this.scheduleHash(true)),this.onHashChange=()=>{this.writingHash||this.applyHash(true);},window.addEventListener("hashchange",this.onHashChange),this.scheduleHash(true));}scheduleHash(t=false){if(!(!this.options.hash||this.destroyed)){if(this.hashTimer){if(!t)return;clearTimeout(this.hashTimer);}this.hashTimer=setTimeout(()=>{this.hashTimer=0,this.writeHash();},t?0:300);}}writeHash(){if(!this.options.hash||this.destroyed)return;let t=this.transform,o=rn({center:t.center,zoom:t.zoom,bearing:t.bearing,pitch:t.pitch},this.hashName);this.writingHash=true,Ka("#"+o),setTimeout(()=>this.writingHash=false,0);}applyHash(t){if(typeof window>"u")return;let o=nn(window.location.hash,this.hashName);if(!o)return;let r=this.transform;o.center&&(r.center=o.center),o.zoom!==void 0&&(r.zoom=o.zoom),o.bearing!==void 0&&(r.bearing=o.bearing),o.pitch!==void 0&&(r.pitch=o.pitch),t&&(this.emitMove(),this.triggerRepaint());}setQuality(t){this.qualityAuto=t==="auto";let o=t==="auto"?Vo(Bo()):t;return this.qualityCeiling=o,this.resetFrameWindow(),this.applyQuality(wt(o)),this}getQuality(){return {auto:this.qualityAuto,profile:{...this.quality},pixelRatio:this.transform.width>0?this.canvas.width/this.transform.width:1}}applyQuality(t,o=false){let r=this.quality.simpleGeometry,n=o?r:t.simpleGeometry;if(this.quality={...t,simpleGeometry:n},this.resetFrameWindow(),this.objects3d&&(this.objects3d.budgetScale=t.modelBudget),r!==n)for(let[a,l]of this.sources.entries())l.setPlan(this.planFor(a));o||(this.densityQuality=t,this.options.maxPixelRatio===void 0&&(this.maxPixelRatio=t.maxPixelRatio)),this.renderer.detailScale=t.detail,this.renderer.allowShadows=t.allowShadows,this.renderer.shadows.resolution!==t.shadowMapSize&&this.setShadows({resolution:t.shadowMapSize});for(let a of this.sources.values())a.setCoverOptions({detailBias:t.detailBias,maxTiles:t.maxTiles});this.resize();}resetFrameWindow(){this.frameRing.fill(0),this.ringAt=0,this.ringSum=0,this.ringFilled=0,this.steadyFrames=0;}checkFrameBudget(t){if(!this.qualityAuto||this.sum(a=>a.pendingCount)>0)return;let o=t>Gf?3:t>Df?1:0;if(this.ringSum+=o-this.frameRing[this.ringAt],this.frameRing[this.ringAt]=o,this.ringAt=(this.ringAt+1)%mn,this.ringFilled<mn&&this.ringFilled++,this.steadyFrames++,this.ringFilled<Nf)return;let r=this.ringSum/this.ringFilled;if(r>=Uf){let a=sn(this.quality.name);if(!a)return;console.info(`[osmgl] \u0442\u044F\u0436\u0451\u043B\u044B\u0445 \u043A\u0430\u0434\u0440\u043E\u0432 ${(r*100).toFixed(0)}% \u2014 \u043A\u0430\u0447\u0435\u0441\u0442\u0432\u043E \u043F\u043E\u043D\u0438\u0436\u0435\u043D\u043E \u0434\u043E \xAB${a}\xBB (\u043F\u043B\u043E\u0442\u043D\u043E\u0441\u0442\u044C \u0431\u0443\u0444\u0435\u0440\u0430 \u043F\u0440\u0435\u0436\u043D\u044F\u044F)`),this.applyQuality(wt(a),true);return}if(r>jf||this.steadyFrames<Xf)return;let n=qa(this.quality.name);!n||ln(n)>ln(this.qualityCeiling)||(console.info(`[osmgl] \u043A\u0430\u0434\u0440\u044B \u0443\u043A\u043B\u0430\u0434\u044B\u0432\u0430\u044E\u0442\u0441\u044F \u0432 \u0431\u044E\u0434\u0436\u0435\u0442 \u2014 \u043A\u0430\u0447\u0435\u0441\u0442\u0432\u043E \u043F\u043E\u0434\u043D\u044F\u0442\u043E \u0434\u043E \xAB${n}\xBB`),this.applyQuality(wt(n),true));}getShadows(){return {...this.renderer.shadows}}setSky(t){let o=typeof t=="boolean"?{enabled:t}:t;return Object.assign(this._style.sky,o),this.triggerRepaint(),this}getSky(){return {...this._style.sky}}setLight(t){return Object.assign(this._style.light,t),this.triggerRepaint(),this}setLayerVisible(t,o){let r=this._style.layers.find(n=>n.id===t);return r&&(r.visible=o,this.rememberOverride(t,{visible:o}),this.triggerRepaint()),this}setObjects3DEnabled(t){return this.objects3dEnabled===t?this:(this.objects3dEnabled=t,this.triggerRepaint(),this)}get objects3DEnabled(){return this.objects3dEnabled}rasterLayerVisible(t){let o=this.transform.zoom;return this._style.layers.some(r=>r.type==="raster"&&r.source===t&&this._style.layerVisibleAt(r,o))}rememberOverride(t,o){let r=this.layerOverrides.get(t)??{};this.layerOverrides.set(t,{...r,...o,paint:{...r.paint??{},...o.paint??{}},layout:{...r.layout??{},...o.layout??{}}});}applyLayerOverrides(){if(this.layerOverrides.size)for(let t of this._style.layers){let o=this.layerOverrides.get(t.id);if(o&&(o.visible!==void 0&&(t.visible=o.visible),o.paint&&Object.assign(t.paint??(t.paint={}),o.paint),o.layout)){let r=t;Object.assign(r.layout??(r.layout={}),o.layout);}}}setBackground(t){return this.background=le(t),this.triggerRepaint(),this}getIndoorLevels(){let t=[];for(let[o,r]of this.sources.entries())if(this._style.layers.some(n=>(n.source??Y)===o&&"splitBy"in n&&n.splitBy===xt))for(let n of r.splitValues(xt)){let a=Number(n);Number.isFinite(a)&&!t.includes(a)&&t.push(a);}return t.sort((o,r)=>o-r)}getIndoorLevel(){let t=this._style.splitValues[xt];return typeof t=="number"?t:null}setIndoorLevel(t){return t===null?delete this._style.splitValues[xt]:this._style.splitValues[xt]=t,this.triggerRepaint(),this}syncIndoor(){let t=this.getIndoorLevels(),o=t.join(",");if(o!==this.lastIndoorKey){if(this.lastIndoorKey=o,this.autoIndoorLevel){let r=this.getIndoorLevel();t.length?(r===null||!t.includes(r))&&this.setIndoorLevel(t.includes(0)?0:t.find(n=>n>=0)??t[0]):r!==null&&this.setIndoorLevel(null);}this.emit("indoor",{levels:t,level:this.getIndoorLevel()});}}addObject(t){return this.objects.add(t),this.triggerRepaint(),this}removeObject(t){return this.objects.remove(t),this.triggerRepaint(),this}getObjects(){return this.objects.all}updateObject(){return this.triggerRepaint(),this}addModel(t){return this.renderer.models.add(t),this.triggerRepaint(),this}removeModel(t){return this.renderer.models.remove(t,this.ctx?.gl),this.triggerRepaint(),this}getObjects3DStats(){return this.objects3d?.stats??null}getModels(){return this.renderer.models.all}addMarker(t){return this.objects.addMarker(t),t.update(this.transform),this}removeMarker(t){return this.objects.removeMarker(t),this}getMarkers(){return this.objects.allMarkers}addPopup(t){return t.onCloseRequest(()=>this.removePopup(t)),this.objects.addMarker(t),t.update(this.transform),this}removePopup(t){return this.objects.removeMarker(t),this}getPopups(){return this.objects.allMarkers.filter(t=>t instanceof Zt)}objectAt(t,o=4){return this.objects.hitTest(this.transform,t,o)}setProjection(t){let o=this.transform;if(o.projection===t)return this;o.projection=t;let r=o.effectiveMinZoom(),n=t==="globe"?Math.min(o.maxPitch,Ct):o.maxPitch,a=o.zoom<r,l=o.pitch>n;return a||l?this.easeTo({zoom:a?r:o.zoom,pitch:l?n:o.pitch,duration:600}):(this.emit("move",void 0),this.triggerRepaint()),this}getProjection(){return this.transform.projection}refreshSource(t){return this.sources.get(t)?.reload(),this.rasterSources.get(t)?.reload(),this.triggerRepaint(),this}refresh(){for(let t of this.sources.values())t.reload();for(let t of this.rasterSources.values())t.reload();return this.renderer.refreshHighlight(),this.triggerRepaint(),this}sum(t){let o=0;for(let r of this.sources.values())o+=t(r);return o}getStats(){return {pendingTiles:this.sum(t=>t.pendingCount),visibleTiles:this.sum(t=>t.visibleTiles.length),labels:this.renderer.symbols?.placedCount??0,models:this.renderer.models.readyCount,workers:this.pool.usingWorkers?this.pool.size:0,renderer:this.ctx?.caps.rendererName??"\u043D\u0435\u0442 \u043A\u043E\u043D\u0442\u0435\u043A\u0441\u0442\u0430"}}triggerRepaint(){this.destroyed||(this.needsRepaint=true,!this.frameHandle&&(this.frameHandle=requestAnimationFrame(t=>{this.frameHandle=0,this.renderFrame(t);})));}renderFrame(t){if(this.destroyed||!this.ctx)return;let o=performance.now();this.needsRepaint=false;let r=this.stepAnimation(t),n=this.ctx;n.bindFramebuffer(null),n.viewport(0,0,this.canvas.width,this.canvas.height),n.setDepthMask(true),n.clear(this.background??this._style.background,true,true);for(let d of this.sources.values())d.update(this.transform);this.updateObjects3D();for(let[d,m]of this.rasterSources)this.rasterLayerVisible(d)&&m.update(this.transform);this.syncIndoor(),this.objects.updateMarkers(this.transform);let a=(this.sources.size>0||this.rasterSources.size>0)&&this.renderer.render(n,this.transform,this.sources,this._style,t,this.rasterSources),l=performance.now()-o,s=r||a||this.needsRepaint,c=this.lastFrameAt>0?t-this.lastFrameAt:0,f=c>0&&c<Yf,h=f?c:0;this.continuousFrames=f?this.continuousFrames+1:0;let u=this.continuousFrames>1?c:l;this.lastFrameAt=t,this.checkFrameBudget(u),this.emit("render",{frameMs:l,intervalMs:h}),s&&this.triggerRepaint();}stopFrameLoop(){this.frameHandle&&cancelAnimationFrame(this.frameHandle),this.frameHandle=0;}get isLoaded(){return this.loaded}destroy(){if(this.onHashChange&&(window.removeEventListener("hashchange",this.onHashChange),this.onHashChange=null),this.hashTimer&&clearTimeout(this.hashTimer),!this.destroyed){this.destroyed=true,this.stopFrameLoop(),this.resizeObserver?.disconnect(),this.gestures?.destroy();for(let t of this.sources.values())t.destroy();this.sources.clear();for(let t of this.rasterSources.values())t.destroy();this.rasterSources.clear(),this.objects.destroy(),this.markerHost?.remove(),this.pool.destroy(),this.ctx&&this.renderer.destroy(this.ctx),this.removeAllListeners(),this.canvas.remove();}}},I0=pn;
|
|
1953
|
-
exports.AssetLoader=
|
|
1964
|
+
`;var Co=i=>i.kind==="symbol",ya=i=>i.kind==="placement";function We(i,e,t,o){for(let r of i)for(let n=0;n+5<r.length;n+=6){let a=r[n],l=r[n+1],s=r[n+2],c=r[n+3],f=r[n+4],u=r[n+5];if(sc(e,t,a,l,s,c,f,u)||o>0&&(_r(e,t,a,l,s,c)<=o||_r(e,t,s,c,f,u)<=o||_r(e,t,f,u,a,l)<=o))return true}return false}function sc(i,e,t,o,r,n,a,l){let s=(i-r)*(o-n)-(t-r)*(e-n),c=(i-a)*(n-l)-(r-a)*(e-l),f=(i-t)*(l-o)-(a-t)*(e-o),u=s<0||c<0||f<0,h=s>0||c>0||f>0;return !(u&&h)}function _r(i,e,t,o,r,n){let a=r-t,l=n-o,s=a*a+l*l,c=s>0?Math.max(0,Math.min(1,((i-t)*a+(e-o)*l)/s)):0;return Math.hypot(i-(t+a*c),e-(o+l*c))}function Cr(i,e){let t=new DataView(i.vertices),o=new Uint32Array(i.indices),r=e.bounds(),n=(r.maxX-r.minX)/i.extent,a=new Float64Array(o.length*2);for(let l=0;l<o.length;l++){let s=o[l]*Ne;a[l*2]=r.minX+t.getInt16(s,true)*n,a[l*2+1]=r.minY+t.getInt16(s+2,true)*n;}return a}function Sr(i,e,t){let o=new DataView(i.vertices),r=t.bounds(),n=(r.maxX-r.minX)/e,a=r.minX,l=r.minY,s=new Float64Array(i.indices.length*2);for(let c=0;c<i.indices.length;c++){let f=i.indices[c]*Me;s[c*2]=a+o.getInt16(f,true)*n,s[c*2+1]=l+o.getInt16(f+2,true)*n;}return s}var fc={stride:8,attribs:[{name:"a_pos",size:2,type:5126,offset:0}]},uc=40,hc=10.5,ga=2.5,dc=16,mc=4,pc=7,Rt=class{constructor(){this.vbo=null;this.ibo=null;this.vao=null;this.capacity=0;this.perArrow=0;this.indicesPerArrow=0;this.highlightFootprint=null;this.count=0;}render(e,t,o,r,n,a,l,s=false){this.count=0;let c=t.zoom,f=r.layers.filter(x=>x.type==="symbol"&&x.layout?.placement==="map"&&r.layerVisibleAt(x,c));if(!f.length)return;let u=t.center,h=re(u.lng),m=ne(u.lat),d=t.worldSize>0?t.pixelsPerMeter/t.worldSize:0;if(!(d>0))return;let p=[];for(let x of f){let C=o.get(x.source??K);if(!C)continue;let S=r.bucketKeyFor(x);if(S===null)continue;let M=x.layout?.showFor==="highlight";if(M&&!this.highlightFootprint)continue;let w=d*1.5,T=x.layout?.arrowUnits==="meters"?d:1/t.worldSize,L=D(x.layout?.arrowLength,c,uc)*T,E=D(x.layout?.arrowWidth,c,hc)*T,z=D(x.layout?.arrowOutline,c,ga)*T,A=D(x.layout?.arrowGap,c,dc)*T,I=D(x.layout?.arrowDotRadius,c,mc)*T,k=D(x.layout?.arrowDotGap,c,pc)*T,F=Tr(L,E,I,A-k),P=z>0?Tr(L,E,I,A-k,z).outline:null,R={layer:x,verts:[],shape:F};for(let W of C.visibleTiles){let O=C.getTile(W)?.data?.buckets?.[S];if(!O||!Co(O))continue;let H=new Int16Array(O.anchors),V=O.rotations?new Int16Array(O.rotations):null,Y=W.bounds(),$=(Y.maxX-Y.minX)/O.extent,Q=Y.minX,ue=Y.minY;for(let J=0;J<H.length/2;J++){let X=Q+H[J*2]*$,te=ue+H[J*2+1]*$;if(M&&!We(this.highlightFootprint,X,te,w))continue;let ie=(V?V[J]:0)*Math.PI/180,q=Math.sin(ie),U=-Math.cos(ie),j=X-h-q*A,le=te-m-U*A;P&&kr(R,P,j,le,q,U),kr(R,F.outline,j,le,q,U),this.count++;}}R.verts.length&&p.push(R);}if(!p.length)return;let y=p[0].shape,b=y.outline.length/2,g=[],v=[];for(let x of p){let C=g.length/2/b;for(let S of x.verts)g.push(S);v.push({layer:x.layer,first:C,count:x.verts.length/2/b});}if(this.ensureBuffers(e,g.length/2/b,y,a),!(!this.vao||!this.vbo)){this.vbo.update(new Uint8Array(new Float32Array(g).buffer)),n.use(),l?.(n),s&&n.setMat4("u_shadow_matrix",t.shadowObjectMatrix(h,m,0)),n.setMat4("u_matrix",t.objectMatrix(h,m,0)),e.setDepthTest(false),e.setDepthMask(false),e.setBlend("premultiplied"),e.setCull("none"),this.vao.bind();for(let x of v){let C=x.layer.paint,S=D(C.opacity,c,1),M=Ee(C.color,c,[.18,.45,.76,1]),w=Ee(C.haloColor,c,[1,1,1,1]),_=D(x.layer.layout?.arrowOutline,c,ga)>0;bc(e,n,x,w,M,S,_,this.indicesPerArrow);}e.bindVAO(null),e.setDepthTest(true);}}ensureBuffers(e,t,o,r){let n=o.outline.length/2;if(this.vao&&t<=this.capacity&&n===this.perArrow)return;this.vao?.destroy(),this.vbo?.destroy(),this.ibo?.destroy(),this.capacity=Math.max(256,Math.ceil(t*1.5)),this.perArrow=n,this.indicesPerArrow=o.indices.length,this.vbo=new ye(e,new Uint8Array(this.capacity*n*8),fc,true);let a=new Uint32Array(this.capacity*o.indices.length);for(let l=0;l<this.capacity;l++){let s=l*n;for(let c=0;c<o.indices.length;c++)a[l*o.indices.length+c]=s+o.indices[c];}this.ibo=new de(e,a),this.vao=new fe(e,[{buffer:this.vbo,locations:r}],this.ibo);}destroy(){this.vao?.destroy(),this.vbo?.destroy(),this.ibo?.destroy(),this.vao=null,this.vbo=null,this.ibo=null,this.capacity=0;}};function bc(i,e,t,o,r,n,a,l){let s=a?2:1;if(a){e.setVec4v("u_color",_e([o[0],o[1],o[2],o[3]*n]));for(let c=0;c<t.count;c+=s)va(i,t.first+c,l);}e.setVec4v("u_color",_e([r[0],r[1],r[2],r[3]*n]));for(let c=a?1:0;c<t.count;c+=s)va(i,t.first+c,l);}function va(i,e,t){i.gl.drawElements(i.gl.TRIANGLES,t,i.gl.UNSIGNED_INT,e*t*4);}var wa=4,Mr=12;function Tr(i,e,t,o,r=0){let n=i*.38,a=e*1.35,l=n*.3,s=e*.32,c=e/2,f=-i+s,u=[],h=(b,g)=>u.push(b,g);h(0,0),h(-n,a),h(-n+l,c),h(f,s);for(let b=1;b<wa;b++){let g=b/wa*Math.PI;h(f-Math.sin(g)*s,Math.cos(g)*s);}h(f,-s),h(-n+l,-c),h(-n,-a);let m=r>0?yc(u,r):u,d=$n__default.default(u,void 0,2);if(t<=0)return {outline:m,indices:d};let p=m.length/2,y=t+r;for(let b=0;b<Mr;b++){let g=b/Mr*Math.PI*2;m.push(o+Math.cos(g)*y,Math.sin(g)*y);}for(let b=1;b<Mr-1;b++)d.push(p,p+b,p+b+1);return {outline:m,indices:d}}function yc(i,e){let t=i.length/2,o=0;for(let a=0;a<t;a++){let l=(a+1)%t;o+=i[a*2]*i[l*2+1]-i[l*2]*i[a*2+1];}let r=o<0?-1:1,n=[];for(let a=0;a<t;a++){let l=i[(a+t-1)%t*2],s=i[(a+t-1)%t*2+1],c=i[a*2],f=i[a*2+1],u=i[(a+1)%t*2],h=i[(a+1)%t*2+1],m=Math.hypot(c-l,f-s)||1,d=Math.hypot(u-c,h-f)||1,p=r*(f-s)/m,y=-r*(c-l)/m,b=r*(h-f)/d,g=-r*(u-c)/d,v=p+b,x=y+g,C=Math.hypot(v,x);if(C<1e-9){n.push(c,f);continue}v/=C,x/=C;let S=Math.min(1/Math.max(v*p+x*y,.35),3);n.push(c+v*e*S,f+x*e*S);}return n}function kr(i,e,t,o,r,n){let a=-n,l=r;for(let s=0;s<e.length;s+=2){let c=e[s],f=e[s+1];i.verts.push(t+r*c+a*f,o+n*c+l*f);}}function gc(i,e,t,o,r,n=0,a=0){let l=t*Math.PI/180,s={verts:[]};return kr(s,Tr(o,r,n,a).outline,i,e,Math.sin(l),-Math.cos(l)),s.verts}var vc=5;function xa(i,e){let t=1/(1<<e),o=(1<<e)-1;return [(i.x&o)*t,(i.y&o)*t,t]}var So=class{constructor(){this.anisotropy=0;this.anisotropyPname=0;this.anisotropyChecked=false;}render(e,t,o,r,n,a,l,s=false){if(!a.size)return;let c=n.layers.filter(f=>f.type==="raster"&&!!f.overlay===s&&n.layerVisibleAt(f,l));if(c.length){r.use(),e.setDepthTest(false),e.setDepthMask(false),e.setBlend("premultiplied"),e.setCull("none"),r.setInt("u_image",0);for(let f of c){let u=a.get(f.source);if(!u)continue;let h=D(f.paint?.opacity,l,1);if(!(h<=.001)){r.setFloat("u_opacity",h),o.bind();for(let m of u.visibleTiles){let d=this.patchFor(e,u,m);d&&(e.bindTexture(0,d.texture),r.setVec3("u_uv_transform",d.uv[0],d.uv[1],d.uv[2]),r.setMat4("u_matrix",t.tileMatrix(m,1)),e.gl.drawElements(e.gl.TRIANGLES,6,e.gl.UNSIGNED_SHORT,0));}}}e.bindVAO(null);}}patchFor(e,t,o){let r=t.getTile(o),n=r&&r.state==="loaded"?this.textureFor(e,r):null;if(n)return {texture:n,uv:[0,0,1]};for(let a=1;a<=vc&&a<=o.z;a++){let l=o.scaledTo(o.z-a),s=t.getTile(l);if(!s||s.state!=="loaded")continue;let c=this.textureFor(e,s);if(c)return {texture:c,uv:xa(o,a)}}return null}textureFor(e,t){let o=t.texture;if(o)return o.handle;if(!t.image)return null;let r=e.gl,n=r.createTexture();if(!n)return null;e.bindTexture(0,n),r.texImage2D(r.TEXTURE_2D,0,r.RGBA,r.RGBA,r.UNSIGNED_BYTE,t.image),r.generateMipmap(r.TEXTURE_2D),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.LINEAR_MIPMAP_LINEAR),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,r.LINEAR),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE),this.applyAnisotropy(r);let a={handle:n,destroy:()=>r.deleteTexture(n)};return t.texture=a,t.image.close(),t.image=null,n}applyAnisotropy(e){if(!this.anisotropyChecked){this.anisotropyChecked=true;let t=e.getExtension("EXT_texture_filter_anisotropic");t&&(this.anisotropyPname=t.TEXTURE_MAX_ANISOTROPY_EXT,this.anisotropy=Math.min(4,e.getParameter(t.MAX_TEXTURE_MAX_ANISOTROPY_EXT)));}this.anisotropy>0&&e.texParameterf(e.TEXTURE_2D,this.anisotropyPname,this.anisotropy);}};var wc="indoor-",zt=class{constructor(){this.parts=null;this.stamp="";this.cache=new B;this.box=null;this.hidden=new ee;this.collected=new ee;}get active(){return this.parts!==null}footprint(){return this.parts}get hiddenCount(){return this.hidden.size}sync(e,t,o){let r=[],n;for(let h of t.layers){if(!h.id.startsWith(wc)||h.type!=="fill"||!t.layerVisibleAt(h,o))continue;let m=t.bucketKeyFor(h);m&&(r.push(m),n??(n=e.get(h.source??K)));}if(!r.length||!n){this.parts&&this.destroy();return}let a=r.join(",")+"|"+n.visibleTiles.map(h=>h.dataKey+(n.getTile(h)?.data?"+":"-")).join(",");if(a===this.stamp)return;this.stamp=a,this.free();let l=[],s=1/0,c=1/0,f=-1/0,u=-1/0;for(let h of n.visibleTiles){let m=n.getTile(h)?.data?.buckets;if(m)for(let d of r){let p=m[d];if(!p||p.kind!=="fill")continue;let y=Cr(p,h);l.push(y);for(let b=0;b<y.length;b+=2)y[b]<s&&(s=y[b]),y[b]>f&&(f=y[b]),y[b+1]<c&&(c=y[b+1]),y[b+1]>u&&(u=y[b+1]);}}this.parts=l.length?l:null,this.box=l.length?[s,c,f,u]:null,this.hidden.clear(),this.collected.clear();}collectHidden(e,t){let o=this.parts;if(!o||!e.featureIds)return;let r=new Uint32Array(e.indices),n=new Float64Array(e.featureIds),a=new DataView(e.vertices),l=t.bounds(),s=(l.maxX-l.minX)/e.extent,c=this.box,f=new B;for(let u=0;u*3<r.length;u++){let h=n[u];if(this.hidden.has(h))continue;let m=f.get(h);m||f.set(h,m=[1/0,1/0,-1/0,-1/0]);for(let d=0;d<3;d++){let p=r[u*3+d]*Me,y=a.getInt16(p,true),b=a.getInt16(p+2,true);y<m[0]&&(m[0]=y),b<m[1]&&(m[1]=b),y>m[2]&&(m[2]=y),b>m[3]&&(m[3]=b);}}for(let[u,h]of f){let m=l.minX+(h[0]+h[2])/2*s,d=l.minY+(h[1]+h[3])/2*s;c&&(m<c[0]||m>c[2]||d<c[1]||d>c[3])||We(o,m,d,0)&&this.hidden.add(u);}}destroy(){this.parts=null,this.hidden.clear(),this.collected.clear(),this.box=null,this.stamp="",this.free();}free(){this.cache.forEach(e=>{e?.vao.destroy(),e?.ibo.destroy();}),this.cache.clear();}prepare(e,t){if(!this.parts)return;let o=this.hidden.size;for(let r of e.visibleTiles){if(this.collected.has(r.dataKey))continue;let n=e.getTile(r)?.data?.buckets?.[t];!n||n.kind!=="fill-extrusion"||(this.collected.add(r.dataKey),this.collectHidden(n,r));}this.hidden.size!==o&&this.free();}indicesFor(e,t,o,r,n,a){if(!this.parts)return null;let l=this.cache.get(r.dataKey);if(l!==void 0)return l;let s=t.data?.buckets?.[o];if(!s)return null;let c=null;if(s.kind==="fill-extrusion"&&s.featureIds&&this.hidden.size){let f=new Uint32Array(s.indices),u=new Float64Array(s.featureIds),h=[];for(let m=0;m*3<f.length;m++)this.hidden.has(u[m])||h.push(f[m*3],f[m*3+1],f[m*3+2]);if(h.length<f.length){let m=new de(e,new Uint32Array(h));c={vao:new fe(e,[{buffer:n,locations:a}],m),ibo:m,count:h.length};}}return this.cache.set(r.dataKey,c),c}};var _a=35,xc=70,_c=.35,Cc=.5,Sc=1.1;function dt(i,e){let t=e.sky;if(!t.enabled||t.fogIntensity<=0)return {near:0,far:1/0,intensity:0,cutoff:1/0};let o=i.cameraToCenterDistance,r=we((i.pitch-_a)/(xc-_a),0,1),n=t.fogRange[0]*(1-_c*r)*o,a=t.fogRange[1]*(1-Cc*r)*o,l=Math.min(1,t.fogIntensity+(1-t.fogIntensity)*Math.min(1,r*2)),s=l>=.995?a*Sc:1/0;return {near:n,far:a,intensity:l,cutoff:s}}function Er(i,e,t,o){let r=o.x/Math.max(i.width,1)*2-1,n=1-o.y/Math.max(i.height,1)*2,a=null,l=new Float64Array(16),s=[0,0,0,0],c=[0,0,0,0];for(let f of e.visibleTiles){let u=e.getTile(f),h=u&&Ca(u,t);if(!h||!Fe(l,i.tileMatrix64(f,h.extent))||(ce(s,l,[r,n,-1,1]),ce(c,l,[r,n,1,1]),s[3]===0||c[3]===0))continue;let m=s[0]/s[3],d=s[1]/s[3],p=s[2]/s[3],y=c[0]/c[3]-m,b=c[1]/c[3]-d,g=c[2]/c[3]-p,v=Tc(h,m,d,p,y,b,g);v&&(!a||v.t<a.distance)&&(a={featureId:v.featureId,tile:f,layerId:t,distance:v.t});}return a}function Ar(i,e,t,o){let r=o.x/Math.max(i.width,1)*2-1,n=1-o.y/Math.max(i.height,1)*2,a=null,l=new Float64Array(16),s=[0,0,0,0],c=[0,0,0,0];for(let f of e.visibleTiles){let u=e.getTile(f);if(u)for(let h of t){let m=u.data?.buckets?.[h];if(!m||m.kind!=="fill"||!m.featureIds||!Fe(l,i.tileMatrix64(f,m.extent))||(ce(s,l,[r,n,-1,1]),ce(c,l,[r,n,1,1]),s[3]===0||c[3]===0))continue;let d=s[0]/s[3],p=s[1]/s[3],y=s[2]/s[3],b=c[2]/c[3]-y;if(Math.abs(b)<1e-9)continue;let g=-y/b;if(g<0||g>1)continue;let v=d+(c[0]/c[3]-d)*g,x=p+(c[1]/c[3]-p)*g,C=Mc(m,v,x);C!==null&&(!a||g<a.distance)&&(a={featureId:C,tile:f,layerId:h,distance:g});}}return a}function Mc(i,e,t){let o=new DataView(i.vertices),r=new Uint32Array(i.indices),n=new Float64Array(i.featureIds),a=s=>o.getInt16(s*Ne,true),l=s=>o.getInt16(s*Ne+2,true);for(let s=0;s*3<r.length;s++){let c=r[s*3],f=r[s*3+1],u=r[s*3+2],h=a(c),m=l(c),d=a(f),p=l(f),y=a(u),b=l(u),g=(e-d)*(m-p)-(h-d)*(t-p),v=(e-y)*(p-b)-(d-y)*(t-b),x=(e-h)*(b-m)-(y-h)*(t-m),C=g<0||v<0||x<0,S=g>0||v>0||x>0;if(!(C&&S))return n[s]}return null}function Ca(i,e){let t=i.data?.buckets?.[e];return !t||t.kind!=="fill-extrusion"||!t.featureIds?null:t}function Tc(i,e,t,o,r,n,a){let l=new DataView(i.vertices),s=new Uint32Array(i.indices),c=new Float64Array(i.featureIds),f=p=>l.getInt16(p*Me,true),u=p=>l.getInt16(p*Me+2,true),h=p=>l.getUint16(p*Me+4,true)/lt,m=1/0,d=-1;for(let p=0;p+2<s.length;p+=3){let y=s[p],b=s[p+1],g=s[p+2],v=f(y),x=u(y),C=h(y),S=f(b)-v,M=u(b)-x,w=h(b)-C,_=f(g)-v,T=u(g)-x,L=h(g)-C,E=n*L-a*T,z=a*_-r*L,A=r*T-n*_,I=S*E+M*z+w*A;if(I>-1e-9&&I<1e-9)continue;let k=1/I,F=e-v,P=t-x,R=o-C,W=(F*E+P*z+R*A)*k;if(W<0||W>1)continue;let G=P*w-R*M,O=R*S-F*w,H=F*M-P*S,V=(r*G+n*O+a*H)*k;if(V<0||W+V>1)continue;let Y=(_*G+T*O+L*H)*k;Y<0||Y>1||Y>=m||(m=Y,d=c[p/3]??0);}return d>=0?{featureId:d,t:m}:null}function Mo(i,e,t){let o=Ca(i,e);if(!o)return null;let r=new Uint32Array(o.indices),n=new Float64Array(o.featureIds),a=[];for(let l=0;l+2<r.length;l+=3)n[l/3]===t&&a.push(r[l],r[l+1],r[l+2]);return a.length?{vertices:o.vertices,indices:new Uint32Array(a)}:null}var mt=24,Lr=8,Ec=2,Ac=12,To=8,ko=8;function Pt(i){let e=0;for(let m of i)e+=m.length/2;if(e<2)return null;let t=(To+2)*2,o=e*t+i.length*(ko+2)*2+8,r=e*(To+2)*6+i.length*ko*6+24,n=new ArrayBuffer(o*mt),a=new DataView(n),l=new Uint32Array(r),s=0,c=0,f=(m,d,p,y,b,g)=>{let v=s*mt;return a.setFloat32(v,m,true),a.setFloat32(v+4,d,true),a.setFloat32(v+8,p,true),a.setFloat32(v+12,y,true),a.setFloat32(v+16,b,true),a.setFloat32(v+20,g,true),s++},u=(m,d,p,y)=>{l[c++]=m,l[c++]=d,l[c++]=y,l[c++]=m,l[c++]=y,l[c++]=p;},h=(m,d,p,y,b,g,v)=>{let x=f(m,d,0,0,0,v),C=f(m,d,p,y,1,v);for(let S=1;S<=ko;S++){let M=Math.PI*S/ko,w=p*Math.cos(M)+b*Math.sin(M),_=y*Math.cos(M)+g*Math.sin(M),T=f(m,d,w,_,1,v);l[c++]=x,l[c++]=C,l[c++]=T,C=T;}};for(let m of i){let d=Lc(m),p=d.length/2;if(p<2)continue;let y=new Float64Array(p-1),b=new Float64Array(p-1);for(let S=0;S<p-1;S++){let M=d[S*2+2]-d[S*2],w=d[S*2+3]-d[S*2+1],_=Math.hypot(M,w)||1;y[S]=M/_,b[S]=w/_;}let g=0,v=-1,x=-1;for(let S=0;S<p;S++){let M=d[S*2],w=d[S*2+1];S>0&&(g+=Math.hypot(M-d[S*2-2],w-d[S*2-1]));let _=S>0?S-1:0,T=S<p-1?S:p-2,L=-b[_],E=y[_],z=-b[T],A=y[T],I=L+z,k=E+A,F=Math.hypot(I,k);F>1e-9?(I/=F,k/=F):(I=L,k=E);let P=I*z+k*A,R=P>1e-6?1/P:1/0,W=Math.acos(Math.min(1,Math.max(-1,y[_]*y[T]+b[_]*b[T])));if(!(W>Ac*Math.PI/180)&&R<=Ec){let O=f(M,w,I*R,k*R,1,g),H=f(M,w,-I*R,-k*R,-1,g);v>=0&&u(v,x,O,H),v=O,x=H;}else {let O=Math.max(1,Math.min(To,Math.ceil(W/(Math.PI/To)))),V=y[_]*b[T]-b[_]*y[T]>=0?1:-1,Y=f(M,w,L,E,1,g),$=f(M,w,-L,-E,-1,g);v>=0&&u(v,x,Y,$);for(let Q=1;Q<=O;Q++){let ue=V*W*(Q/O),J=Math.cos(ue),X=Math.sin(ue),te=L*J-E*X,ie=L*X+E*J,q=f(M,w,te,ie,1,g),U=f(M,w,-te,-ie,-1,g);u(Y,$,q,U),Y=q,$=U;}v=Y,x=$;}}let C=p-2;h(d[0],d[1],-b[0],y[0],-y[0],-b[0],0),h(d[(p-1)*2],d[(p-1)*2+1],-b[C],y[C],y[C],b[C],g);}return c?{vertices:n.slice(0,s*mt),indices:l.slice(0,c),vertexCount:s}:null}function Ir(i){if(!i.length||i[0].length<6)return null;let e=[],t=[];for(let n=0;n<i[0].length;n++)e.push(i[0][n]);for(let n=1;n<i.length;n++)if(!(i[n].length<6)){t.push(e.length/2);for(let a=0;a<i[n].length;a++)e.push(i[n][a]);}let o=$n__default.default(e,t.length?t:void 0,2);if(!o.length)return null;let r=new Uint32Array(o.length);for(let n=0;n<o.length;n+=3)r[n]=o[n],r[n+1]=o[n+2],r[n+2]=o[n+1];return {vertices:new Float32Array(e).buffer,indices:r,vertexCount:e.length/2}}function Lc(i){let e=[];for(let t=0;t<i.length;t+=2){let o=i[t],r=i[t+1],n=e.length;n>=2&&e[n-2]===o&&e[n-1]===r||e.push(o,r);}return e}var Ht=5126,Ic={stride:Lr,attribs:[{name:"a_pos",size:2,type:Ht,offset:0}]},Rr={stride:mt,attribs:[{name:"a_pos",size:2,type:Ht,offset:0},{name:"a_extrude",size:2,type:Ht,offset:8},{name:"a_side",size:1,type:Ht,offset:16},{name:"a_dist",size:1,type:Ht,offset:20}]},Fr=class{constructor(e,t){this.revision=e;this.parts=t;}destroy(){for(let e of this.parts)e.vao.destroy(),e.vbo.destroy(),e.ibo.destroy();}},Fc=(i,e)=>[i[0],i[1],i[2],i[3]*e],Ot=class{constructor(){this.objects=[];this.markers=[];this.gpu=new B;this.markerHost=null;}setMarkerHost(e){this.markerHost=e;for(let t of this.markers)t.attach(e);}add(e){this.objects.includes(e)||this.objects.push(e);}remove(e){let t=this.objects.indexOf(e);t<0||(this.objects.splice(t,1),this.gpu.get(e.id)?.destroy(),this.gpu.delete(e.id));}addMarker(e){this.markers.includes(e)||(this.markers.push(e),this.markerHost&&e.attach(this.markerHost));}removeMarker(e){let t=this.markers.indexOf(e);t<0||(this.markers.splice(t,1),e.detach());}get all(){return this.objects}get allMarkers(){return this.markers}get isEmpty(){return this.objects.length===0}updateMarkers(e){for(let t of this.markers)t.update(e);}render(e,t,o,r,n,a,l,s=false,c=false){if(!this.objects.length||c&&!this.objects.some(d=>d.ghostOpacity>0))return;this.objects.length>1&&this.objects.sort((d,p)=>d.zIndex-p.zIndex);let f=e.gl.drawingBufferWidth,u=t.width>0?f/t.width:1,h=t.worldSize*u,m=null;for(let d of this.objects){if(!d.visible)continue;let p=d.ghostOpacity;if(c&&p<=0)continue;let y=this.gpuFor(e,d,r,a);if(!y)continue;let b=s?t.shadowObjectMatrix(d.originX,d.originY,d.altitude):null,g=t.objectMatrix(d.originX,d.originY,d.altitude);for(let{part:v,vao:x,ibo:C}of y.parts){if(c&&(v.kind!=="line"||v.arrow))continue;let S=c?Fc(v.color,p):v.color;if(v.kind==="fill")m!==o&&(o.use(),l?.(o),m=o),o.setVec4v("u_color",_e(S)),b&&o.setMat4("u_shadow_matrix",b),o.setMat4("u_matrix",g);else {m!==n&&(n.use(),l?.(n),m=n);let M=v.width/2*u,w=h>1e-9?1/h:1;if(n.setVec4v("u_color",_e(S)),n.setFloat("u_half_width",M),n.setFloat("u_offset",(v.offset??0)*u),n.setFloat("u_aa",1),n.setFloat("u_units_per_px",w),n.setFloat("u_units_to_px",h),n.setInt("u_pattern",c?0:v.dashArray?1:v.arrow?2:0),v.dashArray){let[_,T]=v.dashArray;n.setVec2("u_dash",_*u,(_+T)*u);}if(v.arrow){n.setVec4v("u_arrow_color",_e(v.arrowColor??[1,1,1,1]));let _=(v.arrowSize??5)*u;n.setVec3("u_arrow",(v.arrowPeriod??46)*u,Math.max(_*.4,1),Math.min(_,M*.72));}b&&n.setMat4("u_shadow_matrix",b),n.setMat4("u_matrix",g);}x.bind(),e.gl.drawElements(e.gl.TRIANGLES,C.count,C.type,0);}}e.bindVAO(null);}hitTest(e,t,o=4){let r=e.worldSize,n=(a,l,s)=>e.worldPxToPoint(re(a)*r,ne(l)*r,s);for(let a=this.objects.length-1;a>=0;a--){let l=this.objects[a];if(l.visible&&l.hitTest(t,n,o))return l}return null}boundsOf(e){let t=1/0,o=1/0,r=-1/0,n=-1/0;for(let a of e.rings())for(let l of a){let s=Z(l);s.lng<t&&(t=s.lng),s.lng>r&&(r=s.lng),s.lat<o&&(o=s.lat),s.lat>n&&(n=s.lat);}return isFinite(t)?{west:t,south:o,east:r,north:n}:null}gpuFor(e,t,o,r){let n=this.gpu.get(t.id);if(n&&n.revision===t.revision)return n;n?.destroy();let a=[];for(let s of t.build()){let c=s.kind==="fill"?Ic:Rr,f=s.kind==="fill"?o:r,u=new ye(e,new Uint8Array(s.mesh.vertices),c),h=new de(e,s.mesh.indices),m=new fe(e,[{buffer:u,locations:f}],h);a.push({part:s,vao:m,vbo:u,ibo:h});}let l=new Fr(t.revision,a);return this.gpu.set(t.id,l),a.length?l:null}destroy(){for(let e of this.gpu.values())e.destroy();this.gpu.clear();for(let e of this.markers)e.detach();this.markers=[],this.objects=[];}};var Eo=32,Rc=1179937895,zc=1313821514,Pc=5130562,Hc={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},Oc={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT4:16};async function zr(i){let{json:e,bin:t}=Sa(i),o=await Bc(e,t);return Ta(e,t,o)}function Wc(i){let{json:e,bin:t}=Sa(i);for(let o of e.bufferViews??[])if(o.extensions?.EXT_meshopt_compression)throw new Error("[osmgl] GLB \u0441\u0436\u0430\u0442 meshopt \u2014 \u043D\u0443\u0436\u0435\u043D parseGlbAsync");return Ta(e,t,null)}function Sa(i){let e=new DataView(i);if(e.getUint32(0,true)!==Rc)throw new Error("[osmgl] \u044D\u0442\u043E \u043D\u0435 GLB: \u043D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0438\u0433\u043D\u0430\u0442\u0443\u0440\u0430");if(e.getUint32(4,true)!==2)throw new Error("[osmgl] \u043F\u043E\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044F \u0442\u043E\u043B\u044C\u043A\u043E glTF 2.0");let t=null,o=null,r=12;for(;r+8<=i.byteLength;){let n=e.getUint32(r,true),a=e.getUint32(r+4,true),l=r+8;a===zc?t=JSON.parse(new TextDecoder().decode(new Uint8Array(i,l,n))):a===Pc&&(o=new Uint8Array(i,l,n)),r=l+n+(4-n%4)%4;}if(!t)throw new Error("[osmgl] \u0432 GLB \u043D\u0435\u0442 JSON-\u043A\u0443\u0441\u043A\u0430");return {json:t,bin:o??new Uint8Array(0)}}async function Bc(i,e){let t=i.bufferViews??[],o=[];for(let a=0;a<t.length;a++)t[a].extensions?.EXT_meshopt_compression&&o.push(a);if(!o.length)return null;let{MeshoptDecoder:r}=await import('meshoptimizer');await r.ready;let n=new Map;for(let a of o){let l=t[a].extensions.EXT_meshopt_compression,s=l.byteOffset??0,c=e.subarray(s,s+l.byteLength),f=new Uint8Array(l.count*l.byteStride);r.decodeGltfBuffer(f,l.count,l.byteStride,c,l.mode,l.filter??"NONE"),n.set(a,f);}return n}function Ma(i){let e=N();if(i.matrix){for(let w=0;w<16;w++)e[w]=i.matrix[w];return e}Pe(e);let[t,o,r]=i.translation??[0,0,0],[n,a,l,s]=i.rotation??[0,0,0,1],[c,f,u]=i.scale??[1,1,1],h=n+n,m=a+a,d=l+l,p=n*h,y=n*m,b=n*d,g=a*m,v=a*d,x=l*d,C=s*h,S=s*m,M=s*d;return e[0]=(1-(g+x))*c,e[1]=(y+M)*c,e[2]=(b-S)*c,e[4]=(y-M)*f,e[5]=(1-(p+x))*f,e[6]=(v+C)*f,e[8]=(b+S)*u,e[9]=(v-C)*u,e[10]=(1-(p+g))*u,e[12]=t,e[13]=o,e[14]=r,e}var Vc={5120:127,5121:255,5122:32767,5123:65535};function Dc(i){let e=i[0],t=i[1],o=i[2],r=i[4],n=i[5],a=i[6],l=i[8],s=i[9],c=i[10],f=e*(n*c-a*s)-r*(t*c-o*s)+l*(t*a-o*n);if(Math.abs(f)<1e-20)return [1,0,0,0,1,0,0,0,1];let u=1/f;return [(n*c-a*s)*u,(a*l-r*c)*u,(r*s-n*l)*u,(o*s-t*c)*u,(e*c-o*l)*u,(t*l-e*s)*u,(t*a-o*n)*u,(o*r-e*a)*u,(e*n-t*r)*u]}function Ta(i,e,t){let o=w=>{let _=t?.get(w);if(_)return _;let T=i.bufferViews?.[w];if(!T)return null;let L=T.byteOffset??0;return e.subarray(L,L+T.byteLength)},r=[],n=[],a=[],l=[],s=[],c=[1/0,1/0,1/0],f=[-1/0,-1/0,-1/0],u=w=>{if(w===void 0)return null;let _=i.accessors?.[w];if(!_)return null;let T=Oc[_.type]??1,L=new Float64Array(_.count*T),E=_.bufferView!==void 0?i.bufferViews?.[_.bufferView]:void 0;if(!E||_.bufferView===void 0)return {data:L,components:T};let z=o(_.bufferView);if(!z)return {data:L,components:T};let A=Hc[_.componentType]??4,I=E.extensions?.EXT_meshopt_compression,k=I?I.byteStride:E.byteStride,F=k&&k>0?k:A*T,P=_.byteOffset??0,R=new DataView(z.buffer,z.byteOffset,z.byteLength),W=_.normalized?Vc[_.componentType]??1:1;for(let G=0;G<_.count;G++)for(let O=0;O<T;O++){let H=P+G*F+O*A,V;switch(_.componentType){case 5120:V=R.getInt8(H);break;case 5121:V=R.getUint8(H);break;case 5122:V=R.getInt16(H,true);break;case 5123:V=R.getUint16(H,true);break;case 5125:V=R.getUint32(H,true);break;default:V=R.getFloat32(H,true);}L[G*T+O]=W===1?V:Math.max(V/W,-1);}return {data:L,components:T}},h=(w,_,T=-1)=>{if(w.mode!==void 0&&w.mode!==4)return;let L=u(w.attributes.POSITION);if(!L)return;let E=u(w.attributes.NORMAL),z=u(w.attributes.TEXCOORD_0),A=u(w.indices),I=r.length/3,k=L.data.length/3,F=Dc(_),R=(w.material!==void 0?i.materials?.[w.material]:void 0)?.pbrMetallicRoughness?.baseColorTexture?.extensions?.KHR_texture_transform,W=R?{ox:R.offset?.[0]??0,oy:R.offset?.[1]??0,sx:R.scale?.[0]??1,sy:R.scale?.[1]??1,rot:R.rotation??0}:null;for(let X=0;X<k;X++){let te=L.data[X*3],ie=L.data[X*3+1],q=L.data[X*3+2],U=_[0]*te+_[4]*ie+_[8]*q+_[12],j=_[1]*te+_[5]*ie+_[9]*q+_[13],le=_[2]*te+_[6]*ie+_[10]*q+_[14];if(r.push(U,j,le),U<c[0]&&(c[0]=U),j<c[1]&&(c[1]=j),le<c[2]&&(c[2]=le),U>f[0]&&(f[0]=U),j>f[1]&&(f[1]=j),le>f[2]&&(f[2]=le),E){let oe=E.data[X*3],ge=E.data[X*3+1],ke=E.data[X*3+2],ve=F[0]*oe+F[3]*ge+F[6]*ke,to=F[1]*oe+F[4]*ge+F[7]*ke,oo=F[2]*oe+F[5]*ge+F[8]*ke,ro=Math.hypot(ve,to,oo);ro>1e-12?(ve/=ro,to/=ro,oo/=ro):(ve=0,to=1,oo=0),n.push(ve,to,oo);}else n.push(0,1,0);let ae=z?z.data[X*2]:0,se=z?z.data[X*2+1]:0;if(W){if(W.rot!==0){let oe=Math.cos(W.rot),ge=Math.sin(W.rot),ke=oe*ae+ge*se,ve=-ge*ae+oe*se;ae=ke,se=ve;}ae=ae*W.sx+W.ox,se=se*W.sy+W.oy;}a.push(ae,se);}let G=l.length;if(A)for(let X=0;X<A.data.length;X++)l.push(I+A.data[X]);else for(let X=0;X<k;X++)l.push(I+X);let O=w.material!==void 0?i.materials?.[w.material]:void 0,H=O?.pbrMetallicRoughness,V=H?.metallicFactor!==void 0||H?.roughnessFactor!==void 0,Y=H?.baseColorFactor??[1,1,1,1],$=H?.baseColorTexture?.index,Q=$!==void 0?i.textures?.[$]?.source:void 0,ue=O?.emissiveFactor??[0,0,0],J=O?.extensions?.KHR_materials_emissive_strength?.emissiveStrength??1;s.push({indexOffset:G,indexCount:l.length-G,baseColor:[Y[0],Y[1],Y[2],Y[3]??1],metallic:V?H?.metallicFactor??1:0,roughness:V?H?.roughnessFactor??1:1,emissive:[ue[0]*J,ue[1]*J,ue[2]*J],texture:Q??-1,doubleSided:O?.doubleSided===true,blend:O?.alphaMode==="BLEND",alphaCutoff:O?.alphaMode==="MASK"?O.alphaCutoff??.5:.02,node:T});},m=i.skins?.length?null:Gc(i,u),d=m?m.nodes:null,p=(w,_,T,L)=>{let E=i.nodes?.[w];if(!E)return;let z=Ma(E),A=N();xe(A,_,z);let I=N(),k=L,F=d?.get(w);if(F?(F.parentNode=L,F.parent=T.slice(),Pe(I),k=w):xe(I,T,z),E.mesh!==void 0)for(let R of i.meshes?.[E.mesh]?.primitives??[])h(R,I,k);let P=E.extensions?.KHR_lights_punctual?.light;if(P!==void 0){let R=i.extensions?.KHR_lights_punctual?.lights?.[P],W=R?.type;if(R&&(W==="point"||W==="spot"||W==="directional")){let G=-A[8],O=-A[9],H=-A[10],V=Math.hypot(G,O,H)||1,Y=R.spot?.innerConeAngle??0,$=R.spot?.outerConeAngle??Math.PI/4;y.push({type:W,color:[R.color?.[0]??1,R.color?.[1]??1,R.color?.[2]??1],intensity:R.intensity??1,range:R.range??0,position:[A[12],A[13],A[14]],direction:[G/V,O/V,H/V],cosInner:Math.cos(Y),cosOuter:Math.cos($)});}}for(let R of E.children??[])p(R,A,I,k);},y=[],b=N();Pe(b);let g=N();Pe(g);let v=i.scenes?.[i.scene??0]?.nodes??i.nodes?.map((w,_)=>_)??[];for(let w of v)p(w,b,g,-1);let x=[];for(let w of i.images??[]){if(w.bufferView===void 0){x.push(new Uint8Array(0));continue}let _=o(w.bufferView);x.push(_?_.slice():new Uint8Array(0));}let C=r.length/3,S=new ArrayBuffer(C*Eo),M=new Float32Array(S);for(let w=0;w<C;w++){let _=w*8;M[_]=r[w*3],M[_+1]=r[w*3+1],M[_+2]=r[w*3+2],M[_+3]=n[w*3],M[_+4]=n[w*3+1],M[_+5]=n[w*3+2],M[_+6]=a[w*2],M[_+7]=a[w*2+1];}return isFinite(c[0])||(c[0]=c[1]=c[2]=0,f[0]=f[1]=f[2]=0),{vertices:S,indices:new Uint32Array(l),primitives:s,images:x,min:c,max:f,animation:m,lights:y}}function Gc(i,e){let t=i.animations?.[0];if(!t||!t.channels.length)return null;let o=new Map,r=0;for(let n of t.channels){let a=n.target.node,l=n.target.path;if(a===void 0||l!=="translation"&&l!=="rotation"&&l!=="scale")continue;let s=t.samplers[n.sampler];if(!s)continue;let c=e(s.input),f=e(s.output);if(!c||!f||!c.data.length)continue;let u=l==="rotation"?4:3,h=s.interpolation==="CUBICSPLINE",m=c.data.length,d=new Float32Array(m*u);for(let y=0;y<m;y++){let b=h?(y*3+1)*u:y*u;for(let g=0;g<u;g++)d[y*u+g]=f.data[b+g];}let p=o.get(a)??{parentNode:-1,parent:Pe(N()),base:Nc(i.nodes?.[a]),channels:[]};p.channels.push({path:l,times:Float32Array.from(c.data),values:d,step:s.interpolation==="STEP"}),o.set(a,p),r=Math.max(r,c.data[m-1]);}return o.size?{duration:r||1,nodes:o}:null}function Nc(i){let e=i?.translation,t=i?.rotation,o=i?.scale;return {t:[e?.[0]??0,e?.[1]??0,e?.[2]??0],r:[t?.[0]??0,t?.[1]??0,t?.[2]??0,t?.[3]??1],s:[o?.[0]??1,o?.[1]??1,o?.[2]??1]}}function Pr(i,e,t,o){let r=i.nodes.get(e);if(!r)return Pe(o);let n=N();Uc(r,t,n);let a=N();if(xe(a,r.parent,n),r.parentNode<0)return ka(o,a);let l=N();return Pr(i,r.parentNode,t,l),xe(o,l,a)}var ka=(i,e)=>{for(let t=0;t<16;t++)i[t]=e[t];return i};function Uc(i,e,t){let o=[...i.base.t],r=[...i.base.r],n=[...i.base.s];for(let a of i.channels){let l=a.times.length,s=a.path==="rotation"?4:3,c=0;for(;c<l-1&&a.times[c+1]<e;)c++;let f=Math.min(c+1,l-1),u=a.times[f]-a.times[c],h=a.step||u<=0?0:Math.min(Math.max((e-a.times[c])/u,0),1),m=c*s,d=f*s;if(a.path==="rotation"){let p=0;for(let g=0;g<4;g++)p+=a.values[m+g]*a.values[d+g];let y=p<0?-1:1,b=0;for(let g=0;g<4;g++)r[g]=a.values[m+g]*(1-h)+a.values[d+g]*y*h,b+=r[g]*r[g];b=Math.sqrt(b)||1;for(let g=0;g<4;g++)r[g]/=b;}else {let p=a.path==="translation"?o:n;for(let y=0;y<3;y++)p[y]=a.values[m+y]*(1-h)+a.values[d+y]*h;}}return ka(t,Ma({translation:o,rotation:r,scale:n}))}var Te=5126,jc=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),Ea={stride:Eo,attribs:[{name:"a_pos",size:3,type:Te,offset:0},{name:"a_normal",size:3,type:Te,offset:12},{name:"a_tex",size:2,type:Te,offset:24}]},Or=class{constructor(e,t,o,r){this.vao=e;this.vbo=t;this.ibo=o;this.textures=r;this.users=0;this.instVao=null;}destroy(e){this.vao.destroy(),this.instVao?.destroy(),this.vbo.destroy(),this.ibo.destroy();for(let t of this.textures)t&&e.deleteTexture(t);}},Hr=256,Ao=41,Aa={stride:Ao*4,attribs:[{name:"a_i_m0",size:4,type:Te,offset:0,divisor:1},{name:"a_i_m1",size:4,type:Te,offset:16,divisor:1},{name:"a_i_m2",size:4,type:Te,offset:32,divisor:1},{name:"a_i_m3",size:4,type:Te,offset:48,divisor:1},{name:"a_i_s0",size:4,type:Te,offset:64,divisor:1},{name:"a_i_s1",size:4,type:Te,offset:80,divisor:1},{name:"a_i_s2",size:4,type:Te,offset:96,divisor:1},{name:"a_i_s3",size:4,type:Te,offset:112,divisor:1},{name:"a_i_n0",size:3,type:Te,offset:128,divisor:1},{name:"a_i_n1",size:3,type:Te,offset:140,divisor:1},{name:"a_i_n2",size:3,type:Te,offset:152,divisor:1}]},Wt=2,pt=16,Xe=class{constructor(){this.models=[];this.gpu=new B;this.counted=new Set;this.instBuffer=null;this.instScratch=new Float32Array(Hr*Ao);this.drawnInstanced=new Set;this.onLoaded=null;this.growDurationSec=.45;this.fadeDurationSec=.6;this.transitioning=false;this.depthTimeSec=0;this.lightPacks=new WeakMap;this.shadow32=new Float32Array(16);this.shadowNode32=new Float32Array(16);this.shadowNodeColor32=new Float32Array(16);}add(e){this.models.includes(e)||(this.models.push(e),e.isLoaded||e.load(()=>this.onLoaded?.()));}remove(e,t){let o=this.models.indexOf(e);if(o<0)return;this.models.splice(o,1);let r=this.gpu.get(e.url);r&&(this.counted.delete(e)&&r.users--,!(r.users>0)&&(t&&r.destroy(t),this.gpu.delete(e.url)));}get all(){return this.models}get hasTransitions(){return this.transitioning}get hasAnimated(){return this.models.some(e=>e.isAnimated)}get isEmpty(){return this.models.length===0}get readyCount(){return this.models.filter(e=>e.visible&&e.isLoaded).length}render(e,t,o,r,n,a,l=0,s){if(this.models.length){this.drawnInstanced.clear(),s&&this.renderInstanced(e,t,s.shader,s.locations,n,a),o.use(),n(o),o.setInt("u_base_texture",Wt);for(let c of this.models){if(this.drawnInstanced.has(c)||!this.inView(t,c))continue;let f=c.visible&&c.fade>0?this.gpuFor(e,c,r):null;if(!f||!c.mesh)continue;let u=c.fade<1;o.setFloat("u_opacity",c.fade);let h=c.matrixFor(t);o.setMat4("u_matrix",h),o.setMat3("u_normal_matrix",c.normalMatrix());let m=a?this.shadowMatrix(t,c):null;this.uploadLights(o,c.mesh);let d=c.cameraInModelSpace(t);o.setVec3("u_camera_model",d[0],d[1],d[2]),o.setFloat("u_reflect",1),f.vao.bind();for(let p of [false,true])if(!(u&&!p))for(let y of c.mesh.primitives){if(!u&&y.blend!==p)continue;o.setMat4("u_matrix",y.node>=0?c.matrixForNode(t,y.node,l):h),m&&o.setMat4("u_shadow_matrix",y.node>=0?this.shadowMatrixForNodeAt(t,c,y.node,l):m);let b=y.texture>=0?f.textures[y.texture]:null;o.setFloat("u_has_texture",b?1:0),o.setFloat("u_alpha_cutoff",y.alphaCutoff),b&&e.bindTexture(Wt,b),o.setVec4v("u_base_color",y.baseColor),o.setVec3("u_emissive",y.emissive[0],y.emissive[1],y.emissive[2]),o.setFloat("u_metallic",y.metallic),o.setFloat("u_roughness",y.roughness),e.setCull(y.doubleSided?"none":"back"),e.setBlend(p?"premultiplied":"none"),e.setDepthMask(!p),e.gl.drawElements(e.gl.TRIANGLES,y.indexCount,e.gl.UNSIGNED_INT,y.indexOffset*4);}}e.bindVAO(null),e.setCull("back"),e.setBlend("premultiplied"),e.setDepthMask(true);}}renderInstanced(e,t,o,r,n,a){let l=new B;for(let c of this.models){if(!c.visible||c.fade<1||!c.mesh||!c.isLoaded||!this.inView(t,c)||c.mesh.primitives.some(u=>u.blend||u.node>=0))continue;let f=l.get(c.url);f?f.push(c):l.set(c.url,[c]);}let s=false;o.setFloat("u_reflect",0);for(let[,c]of l){if(c.length<2)continue;let f=this.gpuFor(e,c[0],r);if(!f||!c[0].mesh)continue;this.instBuffer||(this.instBuffer=new ye(e,this.instScratch,Aa,true)),f.instVao||(f.instVao=new fe(e,[{buffer:f.vbo,locations:r},{buffer:this.instBuffer,locations:r}],f.ibo)),s||(o.use(),n(o),o.setInt("u_base_texture",Wt),o.setFloat("u_opacity",1),s=true);let u=c[0].mesh;for(let h=0;h<c.length;h+=Hr){let m=Math.min(Hr,c.length-h);for(let d=0;d<m;d++){let p=c[h+d],y=d*Ao;this.instScratch.set(p.matrixFor(t),y);let b=a?this.shadowMatrix(t,p):jc;this.instScratch.set(b,y+16),this.instScratch.set(p.normalMatrix(),y+32),this.drawnInstanced.add(p);}this.instBuffer.update(this.instScratch.subarray(0,m*Ao)),e.bindVAO(f.instVao.vao);for(let d of u.primitives){let p=d.texture>=0?f.textures[d.texture]:null;o.setFloat("u_has_texture",p?1:0),o.setFloat("u_alpha_cutoff",d.alphaCutoff),p&&e.bindTexture(Wt,p),o.setVec4v("u_base_color",d.baseColor),o.setVec3("u_emissive",d.emissive[0],d.emissive[1],d.emissive[2]),o.setFloat("u_metallic",d.metallic),o.setFloat("u_roughness",d.roughness),e.setCull(d.doubleSided?"none":"back"),e.setBlend("none"),e.setDepthMask(true),e.gl.drawElementsInstanced(e.gl.TRIANGLES,d.indexCount,e.gl.UNSIGNED_INT,d.indexOffset*4,m);}}}s&&e.bindVAO(null);}uploadLights(e,t){let o=this.lightPacks.get(t);if(!o){let r=t.lights.filter(f=>f.type!=="directional"),n=r.length<=pt?r:[...r].sort((f,u)=>u.intensity-f.intensity).slice(0,pt),a=new Float32Array(pt*4),l=new Float32Array(pt*4),s=new Float32Array(pt*4),c=new Float32Array(pt*4);n.forEach((f,u)=>{let h=u*4;a[h]=f.position[0],a[h+1]=f.position[1],a[h+2]=f.position[2],a[h+3]=f.range,l[h]=f.color[0]*f.intensity,l[h+1]=f.color[1]*f.intensity,l[h+2]=f.color[2]*f.intensity,l[h+3]=f.type==="spot"?1:0,s[h]=f.direction[0],s[h+1]=f.direction[1],s[h+2]=f.direction[2],c[h]=f.cosInner,c[h+1]=f.cosOuter;}),o={count:n.length,pos:a,color:l,dir:s,cone:c},this.lightPacks.set(t,o);}e.setInt("u_light_count",o.count),o.count!==0&&(e.setVec4Array("u_light_pos",o.pos),e.setVec4Array("u_light_color",o.color),e.setVec4Array("u_light_dir",o.dir),e.setVec4Array("u_light_cone",o.cone));}inView(e,t){if(!t.mesh)return false;let r=t.origin(),n=t.boundingRadiusM();return e.isSphereVisible(r.x,r.y,t.altitude+n*.5,n)}advanceTransitions(){this.transitioning=false;for(let e of this.models)e.advanceGrow(this.growDurationSec)&&(this.transitioning=true),e.advanceFade(this.fadeDurationSec)&&(this.transitioning=true);}renderDepth(e,t,o,r){if(this.models.length){o.use();for(let n of this.models){let a=n.visible&&n.fade>.5?this.gpuFor(e,n,r):null;if(!a||!n.mesh)continue;let l=this.shadowMatrix(t,n);o.setMat4("u_matrix",l),a.vao.bind();for(let s of n.mesh.primitives)s.blend||(o.setMat4("u_matrix",s.node>=0?this.shadowMatrixForNode(t,n,s.node):l),e.gl.drawElements(e.gl.TRIANGLES,s.indexCount,e.gl.UNSIGNED_INT,s.indexOffset*4));}e.bindVAO(null);}}shadowMatrix(e,t){let o=t.origin();return t.matrixInSpace(e.shadowObjectMatrix(o.x,o.y,t.altitude),this.shadow32)}shadowMatrixForNode(e,t,o){return this.shadowMatrixForNodeInto(e,t,o,this.depthTimeSec,this.shadowNode32)}shadowMatrixForNodeAt(e,t,o,r){return this.shadowMatrixForNodeInto(e,t,o,r,this.shadowNodeColor32)}shadowMatrixForNodeInto(e,t,o,r,n){let a=t.origin();return t.matrixInSpaceForNode(e.shadowObjectMatrix(a.x,a.y,t.altitude),o,r,n)}gpuFor(e,t,o){let r=this.gpu.get(t.url);if(r)return this.counted.has(t)||(this.counted.add(t),r.users++),r;if(!t.mesh)return null;let n=e.gl,a=new ye(e,new Uint8Array(t.mesh.vertices),Ea),l=new de(e,t.mesh.indices),s=new fe(e,[{buffer:a,locations:o}],l),c=t.bitmaps.map(u=>{if(!u)return null;let h=n.createTexture();return h?(e.bindTexture(Wt,h),n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,u),n.generateMipmap(n.TEXTURE_2D),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,n.LINEAR_MIPMAP_LINEAR),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,n.LINEAR),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,n.REPEAT),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,n.REPEAT),h):null}),f=new Or(s,a,l,c);return f.users=1,this.counted.add(t),this.gpu.set(t.url,f),f}static get layout(){return Ea}static get instanceLayout(){return Aa}destroy(e){for(let t of this.gpu.values())t.destroy(e);this.gpu.clear(),this.models=[];}};var Wr=4,La=new ee;function Xc(i){La.has(i)||(La.add(i),console.warn(`[osmgl] ${i}`));}var Yc=.5,Kc=.01,$c=300,Br=127,Vr=128,Bt=5120,Fo=5121,Vt=5122,Ia=5123,Dt=5126,qc={stride:8,attribs:[{name:"a_pos",size:2,type:Dt,offset:0}]},Dr={stride:Ne,attribs:[{name:"a_pos",size:2,type:Vt,offset:0}]},Fa={stride:Ue,attribs:[{name:"a_p0",size:2,type:Vt,offset:0},{name:"a_p1",size:2,type:Vt,offset:4},{name:"a_corner",size:2,type:Bt,offset:8},{name:"a_ground",size:2,type:Bt,offset:10},{name:"a_dist",size:1,type:Dt,offset:12},{name:"a_width",size:1,type:Dt,offset:16}]},Lo={stride:Me,attribs:[{name:"a_pos",size:2,type:Vt,offset:0},{name:"a_height",size:1,type:Ia,offset:4},{name:"a_tint",size:1,type:Fo,normalized:true,offset:6},{name:"a_ao",size:1,type:Fo,normalized:true,offset:7},{name:"a_normal",size:3,type:Bt,normalized:true,offset:8},{name:"a_kind",size:1,type:Fo,offset:11},{name:"a_wall",size:3,type:Ia,offset:12}]},Zc={flat:0,water:1,foliage:2,sand:3,asphalt:4},Qc=[1,9,14,26,3],Ra={stride:st,attribs:[{name:"a_pos",size:2,type:Dt,offset:0},{name:"a_level",size:1,type:Vt,offset:8},{name:"a_normal",size:3,type:Bt,normalized:true,offset:10},{name:"a_kind",size:1,type:Fo,offset:13},{name:"a_bleed",size:2,type:Bt,offset:14}]},Gr=class{constructor(e,t,o,r,n,a,l=r){this.vao=e;this.buffer=t;this.ibo=o;this.indexCount=r;this.indexType=n;this.extent=a;this.capIndexOffset=l;this.firstDrawTime=0;}destroy(){this.vao.destroy(),this.buffer.destroy(),this.ibo.destroy();}},Pa={enabled:false,resolution:1024,strength:.75,color:"#5a6b86",bias:.25},Gt=class{constructor(){this.fill=null;this.surface=null;this.surfaceLocs=new B;this.line=null;this.building=null;this.depth=null;this.groundShadow=null;this.sky=null;this.raster=null;this.rasterLayer=new So;this.globeBody=null;this.globeClip=null;this.globeMesh=null;this.quad=null;this.fillLocs=new B;this.lineLocs=new B;this.objectLine=null;this.objectLineLocs=new B;this.buildingLocs=new B;this.shadows={...Pa};this.shadowTarget=null;this.shadowPlaceholder=null;this.fog=null;this.shadowActive=false;this.materialTime=0;this.materialAnimating=false;this.stencilIds=new B;this.patternScale=1;this.detailScale=1;this.reliefScale=1;this.allowShadows=true;this.highlight=null;this.highlightGpu=new B;this.highlightKey="";this.groundArrows=new Rt;this.highlightTris=new B;this.fillHighlightGpu=new B;this.fillHighlightKey="";this.footprintKey="";this.highlightFill=null;this.indoorMask=new zt;this.hiddenBuildings=new Set;this.hiddenVenues=new Set;this.hiddenVenueLayer=null;this.hiddenCut=new B;this.hiddenStamp="";this.shadowDepthPerMeter=1;this.shadowTexelMeters=0;this.growDurationMs=350;this.symbols=null;this.objects=null;this.models=new Xe;this.model=null;this.modelInstanced=null;this.modelDepth=null;this.modelLocs=new B;this.modelInstLocs=new B;}get indoorOpen(){return this.indoorMask.active}syncHiddenStamp(){let e=o=>[...o].sort((r,n)=>r-n).join(","),t=e(this.hiddenBuildings)+"#"+e(this.hiddenVenues);if(t!==this.hiddenStamp){this.hiddenStamp=t;for(let o of this.hiddenCut.values())o?.vao.destroy(),o?.ibo.destroy();this.hiddenCut.clear();}}hiddenFor(e,t){return t?this.hiddenBuildings:e===this.hiddenVenueLayer?this.hiddenVenues:null}cutHidden(e,t,o,r,n,a){if(!a||!a.size)return null;let l=r+"|"+o,s=this.hiddenCut.get(l);if(s!==void 0&&(s===null||s.vbo===n))return s;s&&(s.vao.destroy(),s.ibo.destroy());let c=t.data?.buckets?.[o];if(!c||c.kind!=="fill-extrusion"||!c.featureIds)return null;let f=new Uint32Array(c.indices),u=new Float64Array(c.featureIds),h=[];for(let d=0;d*3<f.length;d++)a.has(u[d])||h.push(f[d*3],f[d*3+1],f[d*3+2]);let m=null;if(h.length<f.length){let d=new de(e,new Uint32Array(h));m={vao:new fe(e,[{buffer:n,locations:this.buildingLocs}],d),ibo:d,count:h.length,vbo:n};}return this.hiddenCut.set(l,m),m}init(e){this.symbols?.init(e),this.fill=new me(e,"fill",ia,aa),this.surface=new me(e,"surface",da,ma),this.line=new me(e,"line",la,sa),this.objectLine=new me(e,"objectLine",ca,fa),this.building=new me(e,"buildings",ua,ha),this.depth=new me(e,"depth",$i,wr),this.groundShadow=new me(e,"groundShadow",ra,na),this.sky=new me(e,"sky",Ji,ea),this.raster=new me(e,"raster",ta,oa),this.globeBody=new me(e,"globeBody",ji,Xi),this.globeClip=new me(e,"globeClip",Yi,Ki),this.globeMesh=Jc(e,this.globeBody),this.model=new me(e,"model",qi,xr),this.modelInstanced=new me(e,"model-instanced",Zi,xr),this.modelDepth=new me(e,"modelDepth",Qi,wr);for(let n of Xe.layout.attribs)this.modelLocs.set(n.name,this.model.attribLocation(n.name));for(let n of [...Xe.layout.attribs,...Xe.instanceLayout.attribs])this.modelInstLocs.set(n.name,this.modelInstanced.attribLocation(n.name));this.shadowPlaceholder=Ni(e);let t=new B([["a_pos",this.groundShadow.attribLocation("a_pos")]]),o=new ye(e,new Float32Array([0,0,1,0,1,1,0,1]),qc),r=new de(e,new Uint16Array([0,1,2,0,2,3]));this.quad={vao:new fe(e,[{buffer:o,locations:t}],r),vbo:o,ibo:r};for(let n of Dr.attribs)this.fillLocs.set(n.name,this.fill.attribLocation(n.name));for(let n of Ra.attribs)this.surfaceLocs.set(n.name,this.surface.attribLocation(n.name));for(let n of Fa.attribs)this.lineLocs.set(n.name,this.line.attribLocation(n.name));for(let n of Rr.attribs)this.objectLineLocs.set(n.name,this.objectLine.attribLocation(n.name));for(let n of Lo.attribs)this.buildingLocs.set(n.name,this.building.attribLocation(n.name));}render(e,t,o,r,n,a=new B){if(!this.fill||!this.line||!this.building)return false;let l=t.zoom,s=false;this.materialTime=n/1e3,this.materialAnimating=false,this.fog=dt(t,r),this.patternScale=ao/Math.max(Ae(t.center.lat),1);let c=d=>o.get(d.source??K);this.syncHighlightFootprint(o,r),this.indoorMask.sync(o,r,l),this.syncHiddenStamp(),this.models.advanceTransitions(),this.renderShadowMap(e,t,o,r,n),this.drawSky(e,t,r),this.drawGlobeBody(e,t,r),this.raster&&this.quad&&this.rasterLayer.render(e,t,this.quad.vao,this.raster,r,a,l),this.drawTileStencil(e,t,o),e.setDepthTest(t.globeActive),e.setDepthFunc("lequal"),e.setDepthMask(false),e.setBlend("premultiplied"),e.setCull("none");let f=d=>d.type==="line"&&D(d.paint.elevation,l,0)!==0,u=new Set;for(let d of r.layers){if(d.type==="raster"||d.type==="fill-extrusion"||d.type==="symbol"||d.overlay||f(d)||!r.layerVisibleAt(d,l))continue;let p=c(d);if(p){if(d.type==="line"&&d.network){if(u.has(d.network))continue;u.add(d.network),this.drawNetwork(e,t,r,c,d.network,l,y=>!y.overlay&&!f(y)&&r.layerVisibleAt(y,l));continue}if(d.type==="surface"){if(!this.flattened(p,r,d))continue;this.drawFill(e,t,p,r,d,l);continue}d.type==="fill"?this.drawFill(e,t,p,r,d,l):this.drawLine(e,t,p,r,d,l);}}this.drawFillHighlight(e,t,o,r),this.groundArrows&&(this.groundArrows.highlightFootprint=this.highlightFootprint(),this.groundArrows.render(e,t,o,r,this.fill,this.fillLocs,d=>{this.applyFogUniforms(d,t,r),d.setVec4("u_globe",0,0,0,0),d.setInt("u_material",0),d.setFloat("u_elevation",0),d.setVec2("u_world_origin",0,0);},this.shadowActive)),this.drawGroundShadow(e,t,o,r),this.drawEarthDepth(e,t,o,r),e.setDepthTest(true),e.setDepthMask(true),e.setDepthFunc("lequal"),e.setCull("back");for(let d of r.layers){if(d.type!=="surface"||d.overlay||!r.layerVisibleAt(d,l))continue;let p=c(d);p&&(this.flattened(p,r,d)||this.drawSurface(e,t,p,r,d,l));}e.setStencilTest(false),e.setDepthMask(false),e.setBlend("premultiplied"),e.setCull("none"),e.setDepthTest(false);let h=new Set;for(let d of r.layers){if(d.type==="raster"||!f(d)||d.overlay||!r.layerVisibleAt(d,l))continue;let p=c(d);if(p){if(d.type==="line"&&d.network){if(h.has(d.network))continue;h.add(d.network),this.drawNetwork(e,t,r,c,d.network,l,y=>!y.overlay&&f(y)&&r.layerVisibleAt(y,l));continue}this.drawLine(e,t,p,r,d,l);}}e.setDepthTest(true),e.setDepthMask(true),e.setCull("back");for(let d of r.layers){if(d.type!=="fill-extrusion"||!r.layerVisibleAt(d,l))continue;let p=c(d);p&&(this.drawBuildings(e,t,p,r,d,l,n)&&(s=true),this.drawHighlight(e,t,p,r,d,l));}this.model&&!this.models.isEmpty&&(this.models.render(e,t,this.model,this.modelLocs,d=>{this.applyShadowUniforms(d),this.applyFogUniforms(d,t,r),this.applyLight(d,r);},this.shadowActive,n/1e3,this.modelInstanced?{shader:this.modelInstanced,locations:this.modelInstLocs}:void 0),(this.models.hasAnimated||this.models.hasTransitions)&&(s=true)),e.setDepthTest(false),e.setDepthMask(false),e.setCull("none");for(let d of r.layers){if(d.type==="raster"||!d.overlay||d.type==="symbol"||d.type==="fill-extrusion"||!r.layerVisibleAt(d,l))continue;let p=c(d);if(p){if(d.type==="surface"){this.flattened(p,r,d)?this.drawFill(e,t,p,r,d,l):this.drawSurface(e,t,p,r,d,l),e.setDepthTest(false),e.setDepthMask(false),e.setCull("none");continue}d.type==="fill"?this.drawFill(e,t,p,r,d,l):this.drawLine(e,t,p,r,d,l);}}this.objects&&!this.objects.isEmpty&&(e.setDepthTest(true),e.setDepthFunc("lequal"),e.setDepthMask(false),e.setBlend("premultiplied"),e.setCull("none"),this.objects.render(e,t,this.fill,this.fillLocs,this.objectLine,this.objectLineLocs,d=>{this.applyFogUniforms(d,t,r),d.setVec4("u_globe",0,0,0,0),d.setInt("u_material",0),d.setFloat("u_elevation",0),d.setVec2("u_world_origin",0,0);},this.shadowActive),e.setDepthTest(false)),this.raster&&this.quad&&this.rasterLayer.render(e,t,this.quad.vao,this.raster,r,a,l,true);let m=r.layers.filter(d=>d.type==="line"&&D(d.paint.ghostOpacity,l,0)>.001&&r.layerVisibleAt(d,l));if(m.length){e.setDepthTest(true),e.setDepthFunc("greater"),e.setDepthMask(false),e.setBlend("premultiplied"),e.setCull("none");for(let d of m){let p=c(d);p&&this.drawLine(e,t,p,r,d,l,D(d.paint.ghostOpacity,l,0));}e.setDepthFunc("lequal"),e.setDepthTest(false);}return this.objects&&!this.objects.isEmpty&&(e.setDepthTest(true),e.setDepthFunc("greater"),e.setDepthMask(false),e.setBlend("premultiplied"),e.setCull("none"),this.objects.render(e,t,this.fill,this.fillLocs,this.objectLine,this.objectLineLocs,d=>{this.applyFogUniforms(d,t,r),d.setVec4("u_globe",0,0,0,0),d.setInt("u_material",0),d.setFloat("u_elevation",0),d.setVec2("u_world_origin",0,0);},this.shadowActive,true),e.setDepthFunc("lequal"),e.setDepthTest(false)),this.symbols&&(this.symbols.highlightFootprint=this.highlightFootprint()),this.symbols?.render(e,t,o,r),e.bindVAO(null),s||this.materialAnimating}renderShadowMap(e,t,o,r,n){if(this.shadowPlaceholder&&e.bindTexture(Wr,this.shadowPlaceholder),this.shadowActive=false,!this.shadows.enabled||!this.allowShadows||!this.depth)return;let a=r.layers.filter(u=>u.type==="fill-extrusion"&&!u.overlay&&r.layerVisibleAt(u,t.zoom));if(!a.length&&this.models.isEmpty)return;this.shadowTarget?this.shadowTarget.resize(this.shadows.resolution):this.shadowTarget=new It(e,this.shadows.resolution);let l=r.light;if(t.updateShadow(Io(l.keyAzimuth,l.keyAltitude),$c),!t.shadowReady)return;let s=this.shadowTarget;s.bind(),e.setDepthFunc("lequal"),e.setBlend("none"),e.setCull("none");let c=e.gl;c.enable(c.POLYGON_OFFSET_FILL),c.polygonOffset(2,4);let f=this.depth;f.use();for(let u of a){let h=o.get(u.source??K);if(!h)continue;let m=r.bucketKeyFor(u);if(m===null)continue;let d=D(u.paint.heightScale,t.zoom,1);(u.source??K)===K&&this.indoorMask.prepare(h,m);for(let p of h.visibleTiles){if(!this.drawsTile(t,r,u,p))continue;let y=h.getTile(p),b=y&&this.bucketFor(e,y,m,Lo,this.buildingLocs,"fill-extrusion");if(!b)continue;f.setFloat("u_height_scale",this.growScale(b,n,!h.warm)*d),f.setMat4("u_matrix",t.shadowTileMatrix(p,b.extent));let g=(u.source??K)===K,v=this.cutHidden(e,y,m,p.dataKey,b.buffer,this.hiddenFor(m,g)),x=g?v??this.indoorMask.indicesFor(e,y,m,p,b.buffer,this.buildingLocs):v;x?(x.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,x.count,e.gl.UNSIGNED_INT,0)):(b.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,b.indexCount,b.indexType,0));}}this.modelDepth&&(this.models.depthTimeSec=n/1e3,e.gl.polygonOffset(6,96),this.models.renderDepth(e,t,this.modelDepth,this.modelLocs),e.gl.polygonOffset(2,4)),c.disable(c.POLYGON_OFFSET_FILL),e.bindFramebuffer(null),e.viewport(0,0,e.gl.drawingBufferWidth,e.gl.drawingBufferHeight),s.bindTexture(Wr),this.shadowDepthPerMeter=t.shadowDepthPerMeter(),this.shadowTexelMeters=Math.abs(t.shadowTexelWorldSize(s.size))/(t.pixelsPerMeter||1),this.shadowActive=true;}drawGlobeBody(e,t,o){if(!t.globeActive||!this.globeBody||!this.globeMesh)return;let r=this.globeBody;r.use(),this.applyGlobeUniforms(r,t),r.setMat4("u_matrix",t.localMatrix());let n=o.background;r.setVec3("u_body_color",n[0],n[1],n[2]),Be(r,"u_atmo_color",o.sky.horizonColor),r.setFloat("u_atmo_strength",o.sky.enabled?1-t.globeFlatMix:0),e.setBlend("none"),e.setDepthTest(true),e.setDepthMask(true),e.setDepthFunc("less"),e.setCull("none"),this.globeMesh.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,this.globeMesh.count,e.gl.UNSIGNED_SHORT,0),e.bindVAO(null),this.drawGlobeClip(e,t),e.setBlend("premultiplied"),e.setDepthTest(false),e.setDepthMask(false);}drawGlobeClip(e,t){if(!this.globeClip||!this.quad)return;let o=e.gl,r=[0,0,-t.globeRadiusPx,1],n=[0,0,0,0];if(ce(n,t.localProjMatrix,r),n[3]<=1e-6)return;let a=this.globeClip;a.use(),a.setFloat("u_center_depth",n[2]/n[3]),o.colorMask(false,false,false,false),e.setDepthTest(true),e.setDepthMask(true),e.setDepthFunc("always"),this.quad.vao.bind(),o.drawElements(o.TRIANGLES,6,o.UNSIGNED_SHORT,0),o.colorMask(true,true,true,true),e.bindVAO(null);}drawSky(e,t,o){if(!this.sky||!this.quad||!o.sky.enabled)return;let r=this.sky;r.use(),Be(r,"u_sky_color",o.sky.skyColor),Be(r,"u_horizon_color",o.sky.horizonColor);let n=t.width>0?e.gl.drawingBufferWidth/t.width:1,a=t.horizonScreenY(),l=(t.height-a)*n,s=Math.max(a,1)*n,c=Math.min(s*.5,t.height*n*.1);r.setVec3("u_sky_params",l,o.sky.horizonBlend*s,c);let f=t.globeActive?1-t.globeFlatMix:0;if(r.setVec2("u_space",f,o.sky.starIntensity),f>.001){Be(r,"u_space_color",o.sky.spaceColor),Be(r,"u_atmo_color",o.sky.atmosphereColor);let u=t.globeDisc();r.setVec4("u_globe_disc",u.dir[0],u.dir[1],u.dir[2],u.angle);let[h,m,d,p]=t.localRayCorners();r.setVec3("u_ray_tl",h[0],h[1],h[2]),r.setVec3("u_ray_tr",m[0],m[1],m[2]),r.setVec3("u_ray_bl",d[0],d[1],d[2]),r.setVec3("u_ray_br",p[0],p[1],p[2]);}e.setDepthTest(false),e.setDepthMask(false),e.setBlend("premultiplied"),e.setCull("none"),this.quad.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,6,e.gl.UNSIGNED_SHORT,0),e.bindVAO(null);}applyGlobeUniforms(e,t){if(!t.globeActive){e.setVec4("u_globe",0,0,0,0);return}let o=t.globeBasis,r=t.worldSize;e.setVec4("u_globe",1,t.globeFlatMix,t.globeRadiusPx,r),e.setVec2("u_globe_center",t.centerPointPx.x/r,t.centerPointPx.y/r);let n=t.globeCamera();e.setVec4("u_globe_cam",n.dir[0],n.dir[1],n.dir[2],n.horizonCos),e.setMat3("u_globe_basis",[o.east[0],o.south[0],o.up[0],o.east[1],o.south[1],o.up[1],o.east[2],o.south[2],o.up[2]]);}applyTileMatrix(e,t,o,r){if(t.globeActive){let n=o.bounds();e.setVec3("u_tile_merc",n.minX,n.minY,(n.maxX-n.minX)/r),e.setMat4("u_matrix",t.localMatrix());return}e.setMat4("u_matrix",t.tileMatrix(o,r));}applyFogUniforms(e,t,o){let r=this.fog??dt(t,o);if(r.intensity<=0){e.setVec3("u_fog_range",0,1,0);return}Be(e,"u_fog_color",o.sky.horizonColor),e.setVec3("u_fog_range",r.near,r.far,r.intensity);}drawsTile(e,t,o,r){let n=this.fog;if(!n)return true;let a=e.distanceToTile(r);return a>n.cutoff?false:t.layerVisibleAt(o,e.detailZoom(a))}earthDepthLevel(e,t){let o=0;for(let n of e.layers)n.type==="surface"?o=Math.min(o,(n.elevation-(n.bevelDrop??0))*this.reliefScale):n.type==="line"&&(o=Math.min(o,D(n.paint.elevation,t.zoom,0)*this.reliefScale));let r=Math.max(Yc/Math.max(t.pixelsPerMeter,1e-9),Kc);return o-r}clipToTile(e,t){let o=this.stencilIds.get(t.dataKey);e.setStencilTest(o!==void 0),o!==void 0&&e.gl.stencilFunc(e.gl.EQUAL,o,Br);}drawTileStencil(e,t,o){this.stencilIds.clear();let r=o.get(K);if(!r||!this.fill||!this.quad)return;let n=r.visibleTiles;if(!n.length||n.length>Br)return;let a=e.gl;a.stencilMask(255),e.clear(null,false,true),e.setStencilTest(true),a.stencilOp(a.KEEP,a.KEEP,a.REPLACE),e.setColorMask(false),e.setDepthTest(false),e.setDepthMask(false),e.setCull("none");let l=this.fill;l.use(),l.setVec4("u_globe",0,0,0,0),l.setInt("u_material",0),l.setVec2("u_world_origin",0,0),l.setVec4("u_color",0,0,0,1),l.setFloat("u_elevation",0),this.quad.vao.bind();let s=0;for(let c of n)s++,this.stencilIds.set(c.dataKey,s),a.stencilFunc(a.ALWAYS,s,Br),l.setMat4("u_matrix",t.tileMatrix(c,1)),a.drawElements(a.TRIANGLES,6,a.UNSIGNED_SHORT,0);e.bindVAO(null),e.setColorMask(true),a.stencilOp(a.KEEP,a.KEEP,a.KEEP),e.setStencilTest(false);}drawEarthDepth(e,t,o,r){if(!this.fill||!this.quad)return;let n=o.get(K);if(!n)return;let a=this.fill;a.use(),this.applyFogUniforms(a,t,r),a.setVec4("u_globe",0,0,0,0),a.setInt("u_material",0),a.setVec2("u_world_origin",0,0),a.setVec4("u_color",0,0,0,1),a.setFloat("u_elevation",0);let l=this.earthDepthLevel(r,t);e.gl.colorMask(false,false,false,false),e.setDepthTest(true),e.setDepthFunc("lequal"),e.setDepthMask(true),e.setCull("none"),e.gl.enable(e.gl.POLYGON_OFFSET_FILL),e.gl.polygonOffset(1,8),this.quad.vao.bind();let s=new Float32Array(16);for(let c of n.visibleTiles){let f=t.tileMatrix(c,1);s.set(f);for(let u=0;u<4;u++)s[12+u]+=l*f[8+u];a.setMat4("u_matrix",s),e.gl.drawElements(e.gl.TRIANGLES,6,e.gl.UNSIGNED_SHORT,0);}e.bindVAO(null),e.gl.disable(e.gl.POLYGON_OFFSET_FILL),e.gl.colorMask(true,true,true,true);}drawGroundShadow(e,t,o,r){if(!this.shadowActive||!this.groundShadow||!this.quad)return;let n=o.get(K);if(!n)return;let a=this.groundShadow;a.use(),this.applyShadowUniforms(a),this.applyFogUniforms(a,t,r);let l=r.light,[,,s]=Io(l.keyAzimuth,l.keyAltitude),c=Math.max(-s,0),f=he(l.ambientColor),u=he(l.keyColor),h=[0,0,0];for(let m=0;m<3;m++){let d=f[m]*l.ambientIntensity,p=u[m]*l.keyIntensity*c;h[m]=d>0?d/(d+p):1;}a.setVec3("u_shadow_ground",h[0],h[1],h[2]),a.setFloat("u_ground_ndotl",c),e.setBlend("multiply"),e.setDepthTest(false),e.setDepthMask(false),e.setCull("none"),this.quad.vao.bind();for(let m of n.visibleTiles)a.setMat4("u_shadow_matrix",t.shadowTileMatrix(m,1)),a.setMat4("u_matrix",t.tileMatrix(m,1)),e.gl.drawElements(e.gl.TRIANGLES,6,e.gl.UNSIGNED_SHORT,0);e.setBlend("premultiplied");}applyShadowUniforms(e){if(e.setInt("u_shadow_map",Wr),!this.shadowActive){e.setVec4("u_shadow_params",0,0,0,0);return}let t=this.shadowTarget?.size??1,r=Math.max(this.shadows.bias,1.5*this.shadowTexelMeters)*(this.shadowDepthPerMeter||1);e.setVec4("u_shadow_params",this.shadows.strength,1/t,r,1),e.setFloat("u_shadow_normal_offset",1.5*2/t);let n=he(this.shadows.color);e.setVec3("u_shadow_color",n[0],n[1],n[2]);}get shadowsActive(){return this.shadowActive}applyTileScale(e,t,o){let r=Xo(t.z)/this.patternScale;e.setFloat("u_meters_per_unit",r/o);let[n,a]=Sn(t.z,t.x,t.y);e.setVec2("u_world_origin",n/this.patternScale,a/this.patternScale);}applyMaterial(e,t,o){let r=t.paint&&"material"in t.paint?t.paint.material:void 0,n=this.detailScale<=0?0:Zc[r??"flat"]??0;if(e.setInt("u_material",n),n===0)return;let a=t.paint,l=D(a.materialStrength,o,1)*this.detailScale,s=D(a.materialScale,o,Qc[n]),c=D(a.materialSpeed,o,n===1?1:0);e.setVec4("u_material_params",l,s,c,this.materialTime),c>0&&l>.004&&(this.materialAnimating=true);}drawFill(e,t,o,r,n,a){let l=this.fill,s=r.colorAt(n,a),c=D(n.paint?.opacity,a,1);if(c<=.001)return;l.use(),this.applyFogUniforms(l,t,r),this.applyGlobeUniforms(l,t),this.applyLight(l,r),this.applyMaterial(l,n,a),l.setVec4v("u_color",_e([s[0],s[1],s[2],s[3]*c]));let f=r.bucketKeyFor(n);if(f!==null){for(let u of o.visibleTiles){if(!this.drawsTile(t,r,n,u))continue;let h=o.getTile(u),m=h&&this.bucketFor(e,h,f,Dr,this.fillLocs,"fill");m&&(this.clipToTile(e,u),this.shadowActive&&l.setMat4("u_shadow_matrix",t.shadowTileMatrix(u,m.extent)),this.applyTileScale(l,u,m.extent),this.applyTileMatrix(l,t,u,m.extent),m.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,m.indexCount,m.indexType,0));}e.setStencilTest(false);}}drawLine(e,t,o,r,n,a,l=0,s){let c=this.line,f=r.colorAt(n,a),u=D(n.paint.opacity,a,1)*(l||1),h=D(n.paint.width,a,1);if(u<=.001||h<=.01)return;let m=e.gl.drawingBufferWidth,d=e.gl.drawingBufferHeight,p=t.width>0?m/t.width:1,y=h/2*p;c.use(),this.applyFogUniforms(c,t,r),this.applyGlobeUniforms(c,t),this.applyLight(c,r),this.applyMaterial(c,n,a),c.setVec4v("u_color",_e([f[0],f[1],f[2],f[3]*u])),c.setFloat("u_center_w",t.cameraToCenterDistance);let b=D(n.paint.offset,a,0)*p,g=Math.max(D(n.paint.blur,a,0),0)*p;c.setFloat("u_elevation",D(n.paint.elevation,a,0)*this.reliefScale),c.setFloat("u_relief",this.reliefScale),c.setVec2("u_viewport",m,d);let v=n.paint.dashArray,x=n.paint.arrow===true,C=n.paint.arrowStyle,S=x&&(C==="head"||C==="headOnly"),M=x&&C==="dash";if(c.setInt("u_pattern",M?5:v?1:C==="headOnly"&&x?4:S?3:x?2:0),v){let[_,T]=v;c.setVec2("u_dash",_*p,(_+T)*p);}if(x){let _=Ee(n.paint.arrowColor,a,[1,1,1,1]);c.setVec4v("u_arrow_color",_e(_));let T=D(n.paint.arrowPeriod,a,46)*p,L=D(n.paint.arrowSize,a,5)*p;if(M){let E=D(n.paint.arrowGap,a,24)*p,z=Math.max(T-E,1),A=Math.min(L,z),I=D(n.paint.arrowShaft,a,2)*p,k=D(n.paint.arrowHead,a,4)*p,F=D(n.paint.arrowOutline,a,0)*p;c.setVec4("u_arrow",I,A,k,z),c.setVec2("u_dash",F,T);}else S?c.setVec4("u_arrow",T,L,y,0):c.setVec4("u_arrow",T,Math.max(L*.4,1),Math.min(L,y*.72),0);}let w=r.bucketKeyFor(n);if(w!==null)for(let _ of o.visibleTiles){if(!this.drawsTile(t,r,n,_))continue;let T=o.getTile(_);if(!T)continue;let L=n.network?s!==void 0?[ze(n.id,s)]:(T.data?.levels??[]).map(E=>ze(n.id,E)):[w];for(let E of L){let z=this.bucketFor(e,T,E,Fa,this.lineLocs,"line");if(!z)continue;let A=_.bounds(),I=(A.maxX-A.minX)*t.worldSize/z.extent*p;c.setFloat("u_tile_to_px",I);let k=I>1e-6?1/I:1;c.setFloat("u_half_width",y*k),c.setFloat("u_blur",g*k),c.setFloat("u_meters_to_units",t.pixelsPerMeter*k),c.setFloat("u_width_from_data",n.paint.widthFromData===true?1:0),c.setFloat("u_width_extra",D(n.paint.widthExtra,a,0)*k),c.setFloat("u_offset",b*k),c.setFloat("u_tile_per_px",k),this.applyTileScale(c,_,z.extent),this.shadowActive&&c.setMat4("u_shadow_matrix",t.shadowTileMatrix(_,z.extent)),this.applyTileMatrix(c,t,_,z.extent),z.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,z.indexCount,z.indexType,0);}}}drawNetwork(e,t,o,r,n,a,l){let s=o.layers.filter(f=>f.type==="line"&&f.network===n&&l(f));if(!s.length)return;let c=new Set;for(let f of s){let u=r(f);if(u)for(let h of u.visibleTiles){let m=u.getTile(h);for(let d of m?.data?.levels??[])c.add(d);}}if(c.size)for(let f of [...c].sort((u,h)=>u-h))for(let u of s){let h=r(u);h&&this.drawLine(e,t,h,o,u,a,0,f);}}drawHighlight(e,t,o,r,n,a){let l=this.highlight;if(!l||!this.building||l.layerId!==n.id)return;let s=`${n.id}/${l.featureId}`;this.highlightKey!==s&&(this.disposeHighlight(),this.highlightKey=s);let c=he(l.color)??[.31,.79,.5,1],f=this.building;f.use(),this.applyShadowUniforms(f),this.applyFogUniforms(f,t,r),this.applyLight(f,r),f.setVec4v("u_wall_color",[c[0],c[1],c[2],1]),f.setVec4v("u_roof_color",[c[0],c[1],c[2],1]),f.setFloat("u_opacity",l.opacity),f.setFloat("u_ao_strength",D(n.paint.aoStrength,a,.4)),f.setFloat("u_tint_variation",0),f.setFloat("u_facade_detail",0),f.setFloat("u_window_glow",0),f.setFloat("u_roof_variation",0),f.setFloat("u_height_scale",D(n.paint.heightScale,a,1)),e.setDepthFunc("lequal"),e.setDepthMask(false),e.setBlend("alpha");for(let u of o.visibleTiles){let h=o.getTile(u);if(!h)continue;let m=h.data?.buckets?.[n.id];if(!m)continue;let d=u.dataKey,p=this.highlightGpu.get(d);if(p===void 0){let y=Mo(h,n.id,l.featureId);if(y){let b=new ye(e,new Uint8Array(y.vertices),Lo),g=new de(e,y.indices);p={vao:new fe(e,[{buffer:b,locations:this.buildingLocs}],g),vbo:b,ibo:g,count:y.indices.length};}else p=null;this.highlightGpu.set(d,p);}p&&(this.applyTileScale(f,u,m.extent),this.shadowActive&&f.setMat4("u_shadow_matrix",t.shadowTileMatrix(u,m.extent)),f.setMat4("u_matrix",t.tileMatrix(u,m.extent)),p.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,p.count,e.gl.UNSIGNED_INT,0));}e.setBlend("none"),e.setDepthMask(true);}refreshHighlight(){this.disposeHighlight();}disposeHighlight(){for(let e of this.highlightGpu.values())e&&(e.vao.destroy(),e.vbo.destroy(),e.ibo.destroy());this.highlightGpu.clear(),this.highlightTris.clear(),this.highlightKey="";}syncHighlightFootprint(e,t){let o=this.highlight;if(!o){this.highlightTris.size&&this.highlightTris.clear();return}let r=`${o.layerId}/${o.featureId}`;this.footprintKey!==r&&(this.highlightTris.clear(),this.footprintKey=r);let n=t.layers.find(s=>s.id===o.layerId),a=e.get(n?.source??K);if(!a)return;let l=new ee;for(let s of a.visibleTiles){if(l.add(s.dataKey),this.highlightTris.has(s.dataKey))continue;let c=a.getTile(s),f=c?.data?.buckets?.[o.layerId];if(!c||!f)continue;let u=Mo(c,o.layerId,o.featureId);u&&this.highlightTris.set(s.dataKey,Sr(u,f.extent,s));}for(let s of [...this.highlightTris.keys()])l.has(s)||this.highlightTris.delete(s);}drawFillHighlight(e,t,o,r){let n=this.highlightFill,a=this.fill;if(!n||!a)return;let l=r.layers.find(h=>h.id===n.layerId),s=l?o.get(l.source??K):void 0;if(!l||!s)return;let c=n.bucketKey,f=he(n.color)??[.31,.79,.5,1];a.use(),this.applyFogUniforms(a,t,r),a.setVec4("u_globe",0,0,0,0),a.setInt("u_material",0),a.setFloat("u_elevation",0),a.setVec2("u_world_origin",0,0),a.setVec4v("u_color",_e([f[0],f[1],f[2],n.opacity])),e.setDepthTest(false),e.setDepthMask(false),e.setBlend("premultiplied"),e.setCull("none");let u=e.gl;e.setStencilTest(true),u.stencilFunc(u.NOTEQUAL,Vr,Vr),u.stencilOp(u.KEEP,u.KEEP,u.REPLACE),u.stencilMask(Vr);for(let h of s.visibleTiles){let m=s.getTile(h),d=m?.data?.buckets?.[c];if(!m||!d||d.kind!=="fill"||!d.featureIds)continue;let p=this.fillHighlightFor(e,d,h,n.featureId,c);p&&(a.setMat4("u_matrix",t.tileMatrix(h,d.extent)),p.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,p.count,e.gl.UNSIGNED_INT,0));}e.setStencilTest(false),u.stencilOp(u.KEEP,u.KEEP,u.KEEP),u.stencilMask(255),e.bindVAO(null);}fillHighlightFor(e,t,o,r,n){let a=`${n}/${r}/${o.dataKey}`;this.fillHighlightKey!==`${n}/${r}`&&(this.fillHighlightGpu.forEach(h=>{h?.vao.destroy(),h?.ibo.destroy(),h?.vbo.destroy();}),this.fillHighlightGpu.clear(),this.fillHighlightKey=`${n}/${r}`);let l=this.fillHighlightGpu.get(a);if(l!==void 0)return l;let s=new Uint32Array(t.indices),c=new Float64Array(t.featureIds),f=[];for(let h=0;h*3<s.length;h++)c[h]===r&&f.push(s[h*3],s[h*3+1],s[h*3+2]);let u=null;if(f.length){let h=new ye(e,new Uint8Array(t.vertices),Dr),m=new de(e,new Uint32Array(f));u={vao:new fe(e,[{buffer:h,locations:this.fillLocs}],m),vbo:h,ibo:m,count:f.length};}return this.fillHighlightGpu.set(a,u),u}highlightFootprint(){return this.highlight&&this.highlightTris.size?[...this.highlightTris.values()]:this.indoorMask.footprint()}drawSurface(e,t,o,r,n,a){let l=this.surface,s=r.colorAt(n,a,[.7,.8,.7,1]),c=D(n.paint.opacity,a,1);if(c<=.001)return;l.use(),this.applyShadowUniforms(l),this.applyFogUniforms(l,t,r),this.applyLight(l,r),this.applyMaterial(l,n,a),l.setVec4v("u_color",s),l.setFloat("u_opacity",c),l.setFloat("u_side_shade",D(n.paint.sideShade,a,.12));let f=n.elevation<(n.base??0),u=n.paint.sideColor?Ee(n.paint.sideColor,a,s):s;l.setVec3("u_side_color",u[0],u[1],u[2]),l.setFloat("u_side_light",D(n.paint.sideLight,a,f?1:0)),l.setFloat("u_relief",this.reliefScale);let h=r.bucketKeyFor(n);if(h===null)return;let m=c>=1&&!n.overlay;e.setDepthMask(m),e.setBlend(m?"none":"premultiplied"),e.setCull("none");let d=[];for(let b of o.visibleTiles){if(!this.drawsTile(t,r,n,b))continue;let g=o.getTile(b),v=g&&this.bucketFor(e,g,h,Ra,this.surfaceLocs,"surface");v&&d.push({id:b,bucket:v});}let p=(b,g)=>{this.clipToTile(e,b),this.applyTileScale(l,b,g.extent),this.shadowActive&&l.setMat4("u_shadow_matrix",t.shadowTileMatrix(b,g.extent)),l.setMat4("u_matrix",t.tileMatrix(b,g.extent)),g.vao.bind();},y=d.filter(({bucket:b})=>b.capIndexOffset<b.indexCount);if(y.length){e.setColorMask(false),e.setDepthMask(true);for(let{id:b,bucket:g}of y){p(b,g);let v=g.indexType===e.gl.UNSIGNED_INT?4:2;e.gl.drawElements(e.gl.TRIANGLES,g.indexCount-g.capIndexOffset,g.indexType,g.capIndexOffset*v);}e.setColorMask(true),e.setDepthMask(m);}for(let{id:b,bucket:g}of d)p(b,g),e.gl.drawElements(e.gl.TRIANGLES,g.capIndexOffset,g.indexType,0);e.setCull("back"),e.setDepthMask(true),e.setBlend("none");}drawBuildings(e,t,o,r,n,a,l){let s=this.building,c=r.colorAt(n,a,[.86,.84,.8,1]),f=n.paint.roofColor?r.colorAt({...n,paint:{...n.paint,color:n.paint.roofColor}},a,c):c,u=D(n.paint.opacity,a,1);if(u<=.001)return false;s.use(),this.applyShadowUniforms(s),this.applyFogUniforms(s,t,r),s.setVec4v("u_wall_color",c),s.setVec4v("u_roof_color",f),s.setFloat("u_opacity",u),s.setFloat("u_ao_strength",D(n.paint.aoStrength,a,.4)),s.setFloat("u_tint_variation",D(n.paint.tintVariation,a,.07));let h=(x,C)=>n.paint[x]?r.colorAt({...n,paint:{...n.paint,color:n.paint[x]}},a,C):C,m=h("windowColor",[.62,.71,.8,1]),d=h("windowFrameColor",[c[0]*1.1,c[1]*1.1,c[2]*1.1,1]);s.setVec3("u_window_color",m[0],m[1],m[2]),s.setVec3("u_window_frame",d[0],d[1],d[2]),s.setFloat("u_facade_detail",D(n.paint.facadeDetail,a,1)*this.detailScale),s.setFloat("u_window_glow",D(n.paint.windowGlow,a,0)),s.setFloat("u_floor_height",D(n.paint.floorHeight,a,3.2)),s.setFloat("u_roof_variation",D(n.paint.roofVariation,a,.3)),this.applyLight(s,r);let p=u>=1;e.setDepthMask(p),e.setBlend(p?"none":"premultiplied");let y=D(n.paint.heightScale,a,1),b=false,g=r.bucketKeyFor(n);if(g===null)return b;let v=(n.source??K)===K;v&&this.indoorMask.prepare(o,g);for(let x of o.visibleTiles){if(!this.drawsTile(t,r,n,x))continue;let C=o.getTile(x),S=C&&this.bucketFor(e,C,g,Lo,this.buildingLocs,"fill-extrusion");if(!S)continue;let M=this.growScale(S,l,!o.warm);M<1&&(b=true),s.setFloat("u_height_scale",M*y),this.applyTileScale(s,x,S.extent),this.shadowActive&&s.setMat4("u_shadow_matrix",t.shadowTileMatrix(x,S.extent)),s.setMat4("u_matrix",t.tileMatrix(x,S.extent));let _=this.cutHidden(e,C,g,x.dataKey,S.buffer,this.hiddenFor(g,v))??(C&&v?this.indoorMask.indicesFor(e,C,g,x,S.buffer,this.buildingLocs):null);_?(_.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,_.count,e.gl.UNSIGNED_INT,0)):(S.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,S.indexCount,S.indexType,0));}return b}growScale(e,t,o=true){if(e.firstDrawTime===0&&(e.firstDrawTime=t),!o||this.growDurationMs<=0)return 1;let r=(t-e.firstDrawTime)/this.growDurationMs;return r<1?ef(Math.max(r,0)):1}applyLight(e,t){let o=t.light;Be(e,"u_ambient_color",o.ambientColor),e.setFloat("u_ambient_intensity",o.ambientIntensity);let[r,n,a]=Io(o.keyAzimuth,o.keyAltitude);e.setVec3("u_key_dir",r,n,a),Be(e,"u_key_color",o.keyColor),e.setFloat("u_key_intensity",o.keyIntensity);let[l,s,c]=Io(o.fillAzimuth,o.fillAltitude);e.setVec3("u_fill_dir",l,s,c),Be(e,"u_fill_color",o.fillColor),e.setFloat("u_fill_intensity",o.fillIntensity);}flattened(e,t,o){let r=t.bucketKeyFor(o);if(r===null)return false;for(let n of e.visibleTiles){let a=e.getTile(n)?.data?.buckets?.[r];if(a)return a.kind==="fill"}return false}bucketFor(e,t,o,r,n,a){let l=t.buckets.get(o);if(l)return l;let s=t.data?.buckets?.[o];if(!s||s.kind==="symbol"||s.kind==="placement")return null;if(s.kind!==a)return Xc(`\u0441\u043B\u043E\u0439 ${o}: \u0432 \u0442\u0430\u0439\u043B\u0435 \u043C\u0435\u0448 \xAB${s.kind}\xBB, \u0430 \u0440\u0438\u0441\u0443\u044E\u0442 \u043A\u0430\u043A \xAB${a}\xBB \u2014 \u043F\u0440\u043E\u043F\u0443\u0449\u0435\u043D`),null;let c=new ye(e,new Uint8Array(s.vertices),r),f=new de(e,new Uint32Array(s.indices)),u=new fe(e,[{buffer:c,locations:n}],f),h=new Gr(u,c,f,f.count,f.type,s.extent,s.capIndexOffset??f.count);return t.buckets.set(o,h),h}destroy(e){this.disposeHighlight(),this.fill?.destroy(),this.surface?.destroy(),this.line?.destroy(),this.objectLine?.destroy(),this.building?.destroy(),this.symbols?.destroy(e),this.models.destroy(e.gl),this.shadowTarget?.destroy(),this.shadowTarget=null,this.shadowPlaceholder&&e.gl.deleteTexture(this.shadowPlaceholder),this.shadowPlaceholder=null,this.quad&&(this.quad.vao.destroy(),this.quad.vbo.destroy(),this.quad.ibo.destroy(),this.quad=null),this.globeMesh&&(this.globeMesh.vao.destroy(),this.globeMesh.vbo.destroy(),this.globeMesh.ibo.destroy(),this.globeMesh=null),this.fill=this.line=this.building=null,this.objectLine=null;}},za=new B;function Jc(i,e){let r=new Float32Array(4290),n=0;for(let h=0;h<=32;h++){let m=(h/32-.5)*Math.PI;for(let d=0;d<=64;d++)r[n++]=d/64*2*Math.PI-Math.PI,r[n++]=m;}let a=new Uint16Array(2048*6),l=0;for(let h=0;h<32;h++)for(let m=0;m<64;m++){let d=h*65+m,p=d+64+1;a[l++]=d,a[l++]=d+1,a[l++]=p,a[l++]=d+1,a[l++]=p+1,a[l++]=p;}let s={stride:8,attribs:[{name:"a_lnglat",size:2,type:Dt,offset:0}]},c=new B([["a_lnglat",e.attribLocation("a_lnglat")]]),f=new ye(i,r,s),u=new de(i,a);return {vao:new fe(i,[{buffer:f,locations:c}],u),vbo:f,ibo:u,count:a.length}}function Be(i,e,t){let o=za.get(t);o||(o=he(t),za.set(t,o)),i.setVec3(e,o[0],o[1],o[2]);}function Io(i,e){let t=i*Math.PI/180,o=e*Math.PI/180,r=Math.cos(o);return [-Math.sin(t)*r,Math.cos(t)*r,-Math.sin(o)]}function ef(i){let o=i-1;return 1+2.20158*o*o*o+1.20158*o*o}var Ro=1,Nt=class{constructor(e=1024){this.entries=new B;this.shelfY=0;this.shelfX=0;this.shelfHeight=0;this.texture=null;this.dirty=true;this.full=false;this.size=e,this.data=new Uint8Array(e*e);}get(e){return this.entries.get(e)}add(e,t,o,r){let n=this.entries.get(e);if(n)return n;if(this.full||o>this.size)return null;if(this.shelfX+o+Ro>this.size&&(this.shelfY+=this.shelfHeight+Ro,this.shelfX=0,this.shelfHeight=0),this.shelfY+r+Ro>this.size)return this.full||console.warn("[osmgl] \u0430\u0442\u043B\u0430\u0441 SDF \u0437\u0430\u043F\u043E\u043B\u043D\u0435\u043D, \u043D\u043E\u0432\u044B\u0435 \u0441\u0438\u043C\u0432\u043E\u043B\u044B \u043D\u0435 \u0434\u043E\u0431\u0430\u0432\u043B\u044F\u044E\u0442\u0441\u044F"),this.full=true,null;let a={x:this.shelfX,y:this.shelfY,width:o,height:r};for(let l=0;l<r;l++){let s=l*o,c=(a.y+l)*this.size+a.x;this.data.set(t.subarray(s,s+o),c);}return this.shelfX+=o+Ro,r>this.shelfHeight&&(this.shelfHeight=r),this.entries.set(e,a),this.dirty=true,a}bind(e,t){let o=e.gl;this.texture?e.bindTexture(t,this.texture):(this.texture=o.createTexture(),e.bindTexture(t,this.texture),o.texStorage2D(o.TEXTURE_2D,1,o.R8,this.size,this.size),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_MIN_FILTER,o.LINEAR),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_MAG_FILTER,o.LINEAR),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_WRAP_S,o.CLAMP_TO_EDGE),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_WRAP_T,o.CLAMP_TO_EDGE),this.dirty=true),this.dirty&&(o.pixelStorei(o.UNPACK_ALIGNMENT,1),o.texSubImage2D(o.TEXTURE_2D,0,0,0,this.size,this.size,o.RED,o.UNSIGNED_BYTE,this.data),this.dirty=false);}destroy(e){this.texture&&e.gl.deleteTexture(this.texture),this.texture=null,this.entries.clear(),this.data=new Uint8Array(0);}};var Nr=.75,jt=8,be=3,Ve=24,bt=256,Ha=255,Ut=class{constructor(e,t="Noto Sans Regular"){this.urlTemplate=e;this.fontstack=t;this.glyphs=new B;this.loaded=new ee;this.inflight=new B;}get(e){return this.glyphs.get(e)}hasRange(e){return this.loaded.has(Math.floor(e/bt))}needsLoad(e){for(let t of e){let o=t.codePointAt(0);if(o===void 0)continue;let r=Math.floor(o/bt);if(r<=Ha&&!this.loaded.has(r))return true}return false}async ensure(e){let t=new ee;for(let o of e){let r=o.codePointAt(0);if(r===void 0)continue;let n=Math.floor(r/bt);n>Ha||this.loaded.has(n)||t.add(n);}return t.size?(await Promise.all([...t].map(o=>this.loadRange(o))),true):false}loadRange(e){let t=this.inflight.get(e);if(t)return t;let o=this.urlTemplate.replace("{fontstack}",encodeURIComponent(this.fontstack)).replace("{range}",`${e*bt}-${e*bt+bt-1}`),r=fetch(o,{credentials:"same-origin"}).then(n=>{if(!n.ok)throw new Error(`HTTP ${n.status}`);return n.arrayBuffer()}).then(n=>{for(let a of Oa(n))this.glyphs.set(a.id,a);this.loaded.add(e);}).catch(n=>{this.loaded.add(e),console.warn(`[osmgl] \u0433\u043B\u0438\u0444\u044B ${o} \u043D\u0435 \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u043B\u0438\u0441\u044C:`,n instanceof Error?n.message:n);}).finally(()=>{this.inflight.delete(e);});return this.inflight.set(e,r),r}};function Oa(i){let e=new Tl__default.default(i instanceof Uint8Array?i:new Uint8Array(i)),t=[];return e.readFields((o,r,n)=>{if(o!==1||!n)return;let a=n.readVarint()+n.pos;n.readFields((l,s,c)=>{if(l!==3||!c)return;let f=c.readVarint()+c.pos,u={id:0,bitmap:null,width:0,height:0,left:0,top:0,advance:0};c.readFields((h,m,d)=>{d&&(h===1?u.id=d.readVarint():h===2?u.bitmap=d.readBytes():h===3?u.width=d.readVarint():h===4?u.height=d.readVarint():h===5?u.left=d.readSVarint():h===6?u.top=d.readSVarint():h===7&&(u.advance=d.readVarint()));},null,f),t.push(u);},null,a);},null),t}var of=.25,yt=1e20;function Ur(i,e,t){let o=e+be*2,r=t+be*2,n=o*r,a=new Float64Array(n),l=new Float64Array(n);a.fill(yt),l.fill(0);for(let c=0;c<t;c++)for(let f=0;f<e;f++){let u=i[c*e+f]/255,h=(c+be)*o+(f+be);if(u>=1)a[h]=0,l[h]=yt;else if(u>0){let m=.5-u;a[h]=m>0?m*m:0,l[h]=m<0?m*m:0;}else a[h]=yt,l[h]=0;}Wa(a,o,r),Wa(l,o,r);let s=new Uint8Array(n);for(let c=0;c<n;c++){let f=Math.sqrt(a[c])-Math.sqrt(l[c]);s[c]=rf(Math.round(255-255*(f/jt+of)));}return {data:s,width:o,height:r}}function Wa(i,e,t){let o=Math.max(e,t),r=new Float64Array(o),n=new Float64Array(o),a=new Int32Array(o),l=new Float64Array(o+1);for(let s=0;s<e;s++){for(let c=0;c<t;c++)r[c]=i[c*e+s];Ba(r,n,a,l,t);for(let c=0;c<t;c++)i[c*e+s]=n[c];}for(let s=0;s<t;s++){for(let c=0;c<e;c++)r[c]=i[s*e+c];Ba(r,n,a,l,e);for(let c=0;c<e;c++)i[s*e+c]=n[c];}}function Ba(i,e,t,o,r){t[0]=0,o[0]=-yt,o[1]=yt;for(let n=1,a=0;n<r;n++){let l=0;do{let s=t[a];l=(i[n]-i[s]+n*n-s*s)/(n-s)/2;}while(l<=o[a]&&--a>-1);a++,t[a]=n,o[a]=l,o[a+1]=yt;}for(let n=0,a=0;n<r;n++){for(;o[a+1]<n;)a++;let l=t[a];e[n]=(n-l)*(n-l)+i[l];}}var rf=i=>i<0?0:i>255?255:i;var Va=48,Xt=class{constructor(e={}){this.defs=e;this.sdfs=new B;this.pending=new ee;this.failed=new ee;}setIcons(e){this.defs=e,this.sdfs.clear(),this.failed.clear();}has(e){return this.sdfs.has(e)}get(e){return this.sdfs.get(e)}isDefined(e){return this.defs[e]!==void 0}async ensure(e){if(this.sdfs.has(e)||this.pending.has(e)||this.failed.has(e))return false;let t=this.defs[e];if(t===void 0)return this.failed.add(e),false;this.pending.add(e);try{let o=typeof t=="string"?t:t.svg,r=/viewBox="0 0 ([\d.]+) ([\d.]+)"/.exec(o),n=r?Number(r[1])/Number(r[2]):1,a=Math.max(8,Math.round(Va*(n>1?n:1))),l=Math.max(8,Math.round(Va/(n<1?n:1))),s=await nf(o,a,l);return this.sdfs.set(e,Ur(s,a,l)),!0}catch(o){return this.failed.add(e),console.warn(`[osmgl] \u0438\u043A\u043E\u043D\u043A\u0430 \xAB${e}\xBB \u043D\u0435 \u0440\u0430\u0441\u0442\u0435\u0440\u0438\u0437\u043E\u0432\u0430\u043B\u0430\u0441\u044C:`,o instanceof Error?o.message:o),false}finally{this.pending.delete(e);}}};async function nf(i,e,t){let o=i.includes("width=")?i:i.replace("<svg",`<svg width="${e}" height="${t}"`),r=new Blob([o],{type:"image/svg+xml;charset=utf-8"}),n=URL.createObjectURL(r);try{let a=new Image;a.width=e,a.height=t,await new Promise((u,h)=>{a.onload=()=>u(),a.onerror=()=>h(new Error("\u043D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u0434\u0435\u043A\u043E\u0434\u0438\u0440\u043E\u0432\u0430\u0442\u044C SVG")),a.src=n;});let l=document.createElement("canvas");l.width=e,l.height=t;let s=l.getContext("2d",{willReadFrequently:!0});if(!s)throw new Error("\u043D\u0435\u0442 2D-\u043A\u043E\u043D\u0442\u0435\u043A\u0441\u0442\u0430");s.clearRect(0,0,e,t),s.drawImage(a,0,0,e,t);let c=s.getImageData(0,0,e,t).data,f=new Uint8ClampedArray(e*t);for(let u=0;u<f.length;u++)f[u]=c[u*4+3];return f}finally{URL.revokeObjectURL(n);}}var tt={dot:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><circle cx="12" cy="12" r="5"/></svg>',entrance:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2.5 19.5 10l-2.1 2.1-3.9-3.9V21h-3V8.2l-3.9 3.9L4.5 10 12 2.5z"/></svg>',door:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M5 2h11a3 3 0 0 1 3 3v17H5V2zm9 9.2a1.2 1.2 0 1 0 0 2.4 1.2 1.2 0 0 0 0-2.4z"/></svg>',elevator:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M5 3h14v18H5V3zm7 2.2L9.2 9h5.6L12 5.2zM9.2 15h5.6L12 18.8 9.2 15z"/></svg>',"frame-circle":'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><circle cx="12" cy="12" r="11"/></svg>',cafe:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M4 6h12v6a6 6 0 0 1-12 0V6zm12 1h2.5a2.5 2.5 0 0 1 0 5H16V7zM3 20h14v2H3z"/></svg>',restaurant:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M6 2h2v8a2 2 0 0 1-4 0V2h2zM5 2v6h2V2zm7 0h2v20h-2V13a4 4 0 0 1 0-8V2zM6 12h2v10H6z"/></svg>',shop:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M4 8h16l-1.5 12h-13L4 8zm4-3a4 4 0 0 1 8 0v2h-2V5a2 2 0 0 0-4 0v2H8V5z"/></svg>',grocery:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M3 4h3l3 11h9l2-8H8m1 15a2 2 0 1 0 4 0 2 2 0 0 0-4 0zm8 0a2 2 0 1 0 4 0 2 2 0 0 0-4 0z"/></svg>',fuel:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M4 3h9v18H4V3zm2 2v5h5V5H6zm10 2 3 3v8a2 2 0 0 1-4 0V9h1V7z"/></svg>',parking:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M6 3h6a5 5 0 0 1 0 10H9v8H6V3zm3 3v4h3a2 2 0 0 0 0-4H9z"/></svg>',hospital:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M10 3h4v7h7v4h-7v7h-4v-7H3v-4h7V3z"/></svg>',pharmacy:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M11 4h2v5h5v2h-5v5h-2v-5H6V9h5V4zM5 18h14v3H5z"/></svg>',school:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 3 2 8l10 5 10-5-10-5zM5 12v5c0 2 3 4 7 4s7-2 7-4v-5l-7 3.5L5 12z"/></svg>',bank:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2 2 8h20L12 2zM4 10h3v8H4v-8zm6.5 0h3v8h-3v-8zM17 10h3v8h-3v-8zM2 20h20v2H2z"/></svg>',bus:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M4 5a3 3 0 0 1 3-3h10a3 3 0 0 1 3 3v10a2 2 0 0 1-2 2v2h-3v-2H9v2H6v-2a2 2 0 0 1-2-2V5zm2 2v5h12V7H6zm1 8a1.5 1.5 0 1 0 3 0 1.5 1.5 0 0 0-3 0zm7 0a1.5 1.5 0 1 0 3 0 1.5 1.5 0 0 0-3 0z"/></svg>',railway:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M6 3h12v11a3 3 0 0 1-3 3H9a3 3 0 0 1-3-3V3zm2 3v4h8V6H8zm-2 15 3-3h6l3 3H6z"/></svg>',park:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2a6 6 0 0 1 5.2 9 4.5 4.5 0 0 1-2.4 8.3H13V22h-2v-2.7H9.2A4.5 4.5 0 0 1 6.8 11 6 6 0 0 1 12 2z"/></svg>',hotel:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M2 6h3v7h10a4 4 0 0 1 4 4v3h-3v-3H5v3H2V6zm5 2a2.5 2.5 0 1 1 0 5 2.5 2.5 0 0 1 0-5z"/></svg>',place_of_worship:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2c3 3 5 5 5 8v12h-4v-5a1 1 0 0 0-2 0v5H7V10c0-3 2-5 5-8z"/></svg>',police:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2l8 3v7c0 5-3.5 8.5-8 10-4.5-1.5-8-5-8-10V5l8-3z"/></svg>',stadium:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 4c5.5 0 10 1.8 10 4v4c0 2.2-4.5 4-10 4S2 14.2 2 12V8c0-2.2 4.5-4 10-4zm0 2C7.6 6 4 7.1 4 8s3.6 2 8 2 8-1.1 8-2-3.6-2-8-2z"/></svg>',fast_food:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M3 9a9 9 0 0 1 18 0H3zm-1 3h20v2H2v-2zm2 4h16a3 3 0 0 1-3 3H7a3 3 0 0 1-3-3z"/></svg>',bakery:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M4 9c0-2 1.5-3 3-3h10c1.5 0 3 1 3 3l-1 9H5L4 9zm4-1v9h2V8H8zm4 0v9h2V8h-2z"/></svg>',ice_cream:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2a5 5 0 0 1 5 5H7a5 5 0 0 1 5-5zM7 9h10l-5 13L7 9z"/></svg>',bar:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M3 4h18l-8 9v6h4v2H7v-2h4v-6L3 4zm3.5 2 2 2h7l2-2h-11z"/></svg>',butcher:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M5 3h6l2 5-3 3-5-3V3zm8 7 6 6-2 2-6-6 2-2zM3 17h8v4H3v-4z"/></svg>',alcohol_shop:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M10 2h4v4l3 5v11H7V11l3-5V2zm-1 11h6v7H9v-7z"/></svg>',clothing_store:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M9 3h6l5 3-2 4-2-1v12H8V9L6 10 4 6l5-3zm1 1.5L12 6l2-1.5h-4z"/></svg>',hairdresser:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M5 3l9 9-2 2-2-2-2 2 2 2-1 1a3 3 0 1 1-2-2l1-1-1-1a3 3 0 1 1 2-2L5 3zm14 0l-6 6 2 2 5-6V3zM6 17a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3zm0-11a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3z"/></svg>',laundry:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M5 2h14v20H5V2zm2 2v2h10V4H7zm5 4a6 6 0 1 0 0 12 6 6 0 0 0 0-12zm0 3a3 3 0 1 1 0 6 3 3 0 0 1 0-6z"/></svg>',music:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M9 4l11-2v13a3.5 3.5 0 1 1-2-3.2V6L11 7.4v10.1A3.5 3.5 0 1 1 9 14.3V4z"/></svg>',car:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M5 11l2-5a2 2 0 0 1 2-1h6a2 2 0 0 1 2 1l2 5v7h-3v-2H8v2H5v-7zm2.5-1h9l-1.2-3H8.7L7.5 10zM7 13a1.3 1.3 0 1 0 0 2.6A1.3 1.3 0 0 0 7 13zm10 0a1.3 1.3 0 1 0 0 2.6 1.3 1.3 0 0 0 0-2.6z"/></svg>',bicycle:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M6 12a5 5 0 1 0 0 10 5 5 0 0 0 0-10zm12 0a5 5 0 1 0 0 10 5 5 0 0 0 0-10zM6 15a2 2 0 1 1 0 4 2 2 0 0 1 0-4zm12 0a2 2 0 1 1 0 4 2 2 0 0 1 0-4zM9 4h4l4 8-2 1-3-6H9V4z"/></svg>',atm:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M2 5h20v14H2V5zm2 2v3h16V7H4zm0 5v5h16v-5H4zm2 2h5v2H6v-2z"/></svg>',post:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M2 5h20v14H2V5zm2.5 2 7.5 6 7.5-6h-15z"/></svg>',telephone:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M7 2c1 0 2 3 2 4s-2 2-2 3 4 6 5 6 2-2 3-2 4 1 4 2-1 4-3 4C9 19 5 15 3 5c0-2 3-3 4-3z"/></svg>',office:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M4 2h11v20H4V2zm2 3v3h3V5H6zm5 0v3h3V5h-3zM6 10v3h3v-3H6zm5 0v3h3v-3h-3zM6 15v3h3v-3H6zm5 0v7h3v-7h-3zM17 8h4v14h-4V8z"/></svg>',town_hall:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2l9 5v2H3V7l9-5zM5 11h3v7H5v-7zm5.5 0h3v7h-3v-7zM16 11h3v7h-3v-7zM3 20h18v2H3v-2z"/></svg>',doctors:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M7 2v6a5 5 0 0 0 4 4.9V16a3 3 0 1 0 6 0v-1.2a2.5 2.5 0 1 0-2 0V16a1 1 0 1 1-2 0v-3.1A5 5 0 0 0 17 8V2h-3v6a2 2 0 0 1-4 0V2H7z"/></svg>',dentist:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2c3 0 4-1 6 0 2 1 2 4 1 8l-1 5c-1 4-3 4-3.5 1L14 12c-.4-2-1.6-2-2 0l-.5 4c-.5 3-2.5 3-3.5-1l-1-5C6 6 6 3 8 2c2-1 3 0 4 0z"/></svg>',veterinary:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 11c3 0 6 3 6 6a3 3 0 0 1-3 3H9a3 3 0 0 1-3-3c0-3 3-6 6-6zM6 5a2.5 2.5 0 1 1 0 5 2.5 2.5 0 0 1 0-5zm12 0a2.5 2.5 0 1 1 0 5 2.5 2.5 0 0 1 0-5zM10 2a2.5 2.5 0 1 1 0 5 2.5 2.5 0 0 1 0-5zm4 0a2.5 2.5 0 1 1 0 5 2.5 2.5 0 0 1 0-5z"/></svg>',library:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M4 3h5c1.5 0 2.5.5 3 1.2.5-.7 1.5-1.2 3-1.2h5v16h-5c-1.5 0-2.5.6-3 1.5-.5-.9-1.5-1.5-3-1.5H4V3zm2 2v12h3c1 0 2 .2 2.5.5V5.8C11 5.3 10 5 9 5H6z"/></svg>',college:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 3 2 8l10 5 10-5-10-5zM5 12v5c0 2 3 4 7 4s7-2 7-4v-5l-7 3.5L5 12zm15-2v7h2v-7h-2z"/></svg>',museum:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2l10 5v2H2V7l10-5zM5 11h2.5v7H5v-7zm5 0h2.5v7H10v-7zm5 0h2.5v7H15v-7zM3 20h18v2H3v-2z"/></svg>',art_gallery:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2a10 10 0 0 0 0 20c1.7 0 2-1 1.4-2-.7-1.2 0-2.5 1.6-2.5H18a4 4 0 0 0 4-4c0-6-4.5-11.5-10-11.5zM7 9a1.7 1.7 0 1 1 0 3.4A1.7 1.7 0 0 1 7 9zm3-4a1.7 1.7 0 1 1 0 3.4A1.7 1.7 0 0 1 10 5zm5 0a1.7 1.7 0 1 1 0 3.4A1.7 1.7 0 0 1 15 5zm3 4a1.7 1.7 0 1 1 0 3.4A1.7 1.7 0 0 1 18 9z"/></svg>',theatre:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M3 5h8v9a4 4 0 0 1-8 0V5zm2.5 3a1 1 0 1 0 0 2 1 1 0 0 0 0-2zm3 0a1 1 0 1 0 0 2 1 1 0 0 0 0-2zM13 5h8v9a4 4 0 0 1-8 0V5zm2.5 3a1 1 0 1 0 0 2 1 1 0 0 0 0-2zm3 0a1 1 0 1 0 0 2 1 1 0 0 0 0-2z"/></svg>',cinema:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M2 4h20v16H2V4zm3 2v2h2V6H5zm0 5v2h2v-2H5zm0 5v2h2v-2H5zm12-10v2h2V6h-2zm0 5v2h2v-2h-2zm0 5v2h2v-2h-2zM9 6v12h6V6H9z"/></svg>',monument:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M10 2h4l1 13H9l1-13zM7 17h10v2H7v-2zm-2 3h14v2H5v-2z"/></svg>',castle:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M2 6h3V3h2v3h3V3h2v3h3V3h2v3h3v16H2V6zm7 8h6v8H9v-8z"/></svg>',attraction:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2l2.9 6.3 6.9.8-5.1 4.7 1.4 6.8L12 17.2 5.9 20.6l1.4-6.8L2.2 9.1l6.9-.8L12 2z"/></svg>',zoo:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 12c3.3 0 6 2.7 6 5.5S15.3 21 12 21s-6-.7-6-3.5S8.7 12 12 12zM5 6a2.7 2.7 0 1 1 0 5.4A2.7 2.7 0 0 1 5 6zm14 0a2.7 2.7 0 1 1 0 5.4A2.7 2.7 0 0 1 19 6zM9.5 2a2.7 2.7 0 1 1 0 5.4 2.7 2.7 0 0 1 0-5.4zm5 0a2.7 2.7 0 1 1 0 5.4 2.7 2.7 0 0 1 0-5.4z"/></svg>',theme_park:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M11 2h2v6h-2V2zM4 20a8 8 0 0 1 16 0v2H4v-2zm3.5-2h9A6 6 0 0 0 12 14a6 6 0 0 0-4.5 4zM3 9l3-2 3 2-3 2-3-2zm12 0l3-2 3 2-3 2-3-2z"/></svg>',information:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zm-1.5 4h3v3h-3V6zm0 5h3v8h-3v-8z"/></svg>',garden:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2c2 2 3 4 3 6a3 3 0 0 1-6 0c0-2 1-4 3-6zM4 9c2.5 0 5 1.5 6 4H8c-2.5 0-4-1.5-4-4zm16 0c0 2.5-1.5 4-4 4h-2c1-2.5 3.5-4 6-4zm-9 5h2v8h-2v-8z"/></svg>',pitch:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M2 5h20v14H2V5zm2 2v10h7V7H4zm9 0v10h7V7h-7zm-1 3a2 2 0 1 1 0 4 2 2 0 0 1 0-4z"/></svg>',playground:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M3 4h2v16H3V4zm16 0h2v16h-2V4zM5 6h14v2H5V6zm2 3 3 11H8L5 9h2zm10 0-3 11h2l3-11h-2z"/></svg>',swimming_pool:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M6 3a3 3 0 0 1 6 0v3h4a3 3 0 0 1 3 3h-3a1 1 0 0 0-1 1v3H12V6a1 1 0 0 0-2 0v8H6V3zm-4 14c2 0 2 2 5 2s3-2 5-2 3 2 5 2 3-2 5-2v3c-2 0-2 2-5 2s-3-2-5-2-3 2-5 2-3-2-5-2v-3z"/></svg>',sports_centre:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M4 8h3v8H4V8zM2 10h2v4H2v-4zm15-2h3v8h-3V8zm3 2h2v4h-2v-4zM8 11h8v2H8v-2z"/></svg>',bicycle_parking:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M4 2h5a4 4 0 0 1 0 8H7v5H4V2zm3 3v2h2a1 1 0 0 0 0-2H7zm-2 13a4 4 0 1 1 8 0 4 4 0 0 1-8 0zm10 0a4 4 0 1 1 8 0 4 4 0 0 1-8 0z"/></svg>',aerialway:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M2 4l20-2v2L13 5v2h1l4 3v6a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2v-6l4-3h1V5.3L2 6V4zm7 8v3h6v-3H9z"/></svg>',ferry_terminal:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M11 2h2v3h4v4h-4v5l7 2-2 6c-2 0-2-1-4-1s-2 1-4 1-2-1-4-1-2 1-4 1l-2-6 7-2V9H3V5h4V2h4zM9 7v2h6V7H9z"/></svg>',traffic_signals:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M8 2h8a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2h-3v3h4v2H7v-2h4v-3H8a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2zm4 1.6a1.6 1.6 0 1 0 0 3.2 1.6 1.6 0 0 0 0-3.2zm0 4.3a1.6 1.6 0 1 0 0 3.2 1.6 1.6 0 0 0 0-3.2zm0 4.3a1.4 1.4 0 1 0 0 2.8 1.4 1.4 0 0 0 0-2.8z"/></svg>',road_closed:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M4 10.1h16v3.8H4z"/></svg>',gate:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M2 4h3v16H2V4zm17 0h3v16h-3V4zM6 8h12v2H6V8zm0 5h12v2H6v-2z"/></svg>',toilets:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M6 2a2 2 0 1 1 0 4 2 2 0 0 1 0-4zM4 7h4l2 7H8v8H4v-8H2l2-7zm12-5a2 2 0 1 1 0 4 2 2 0 0 1 0-4zm-3 5h6l1 8h-2v7h-4v-7h-2l1-8z"/></svg>',drinking_water:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2c4 5 6 8 6 11a6 6 0 0 1-12 0c0-3 2-6 6-11zm0 5c-2 3-3 4.6-3 6a3 3 0 0 0 6 0c0-1.4-1-3-3-6z"/></svg>',waste_basket:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M9 2h6l1 2h4v3H4V4h4l1-2zM5 8h14l-1 14H6L5 8zm4 3v8h2v-8H9zm4 0v8h2v-8h-2z"/></svg>',recycling:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2l4 7h-3v4h-2V9H8l4-7zM3 18l3-6 2 1-1.4 2.5H10v2H6.6L8 20l-2 1-3-3zm18 0-3 3-2-1 1.4-2.5H14v-2h3.4L16 13l2-1 3 6z"/></svg>',campsite:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2l9 18h-4l-5-10-5 10H3L12 2zm0 9 5 9H7l5-9z"/></svg>',shelter:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2l10 8-1.5 2L19 11v9H5v-9l-1.5 1L2 10l10-8zm0 3.5L7 9.5V18h10V9.5l-5-4z"/></svg>',fire_station:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M13 2c0 3-4 4-4 8 0 1 .4 2 1 2.6C9.4 11 10 9.5 11 9c0 2 3 3 3 6a3.5 3.5 0 0 1-1 2.5c2.5-.6 4-2.8 4-5.5 0-5-4-7-4-10zM7 15c0 4 2.5 7 5 7s5-3 5-7c0 2-1 3-2 3.5.3-.6.5-1.2.5-2 0-2.5-2-3.5-2.5-5.5-1 1-2 2.5-2 4 0 .8.2 1.5.6 2C10.2 17.5 9 16.5 9 15H7z"/></svg>',prison:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M3 3h2v18H3V3zm4 0h2v18H7V3zm4 0h2v18h-2V3zm4 0h2v18h-2V3zm4 0h2v18h-2V3zM2 10h20v2H2v-2z"/></svg>',cemetery:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2c3 0 5 2 5 5v13H7V7c0-3 2-5 5-5zm-1 3v2H9v2h2v7h2v-7h2V7h-2V5h-2zM5 21h14v2H5v-2z"/></svg>',basin:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M2 8c2 0 2 2 5 2s3-2 5-2 3 2 5 2 3-2 5-2v3c-2 0-2 2-5 2s-3-2-5-2-3 2-5 2-3-2-5-2V8zm0 7c2 0 2 2 5 2s3-2 5-2 3 2 5 2 3-2 5-2v3c-2 0-2 2-5 2s-3-2-5-2-3 2-5 2-3-2-5-2v-3z"/></svg>',"shield-2":'<svg viewBox="0 0 32 24" xmlns="http://www.w3.org/2000/svg"><rect x="1" y="3" width="30" height="18" rx="4"/></svg>',"shield-3":'<svg viewBox="0 0 41 24" xmlns="http://www.w3.org/2000/svg"><rect x="1" y="3" width="39" height="18" rx="4"/></svg>',"shield-4":'<svg viewBox="0 0 50 24" xmlns="http://www.w3.org/2000/svg"><rect x="1" y="3" width="48" height="18" rx="4"/></svg>',"shield-5":'<svg viewBox="0 0 59 24" xmlns="http://www.w3.org/2000/svg"><rect x="1" y="3" width="57" height="18" rx="4"/></svg>',"shield-6":'<svg viewBox="0 0 68 24" xmlns="http://www.w3.org/2000/svg"><rect x="1" y="3" width="66" height="18" rx="4"/></svg>',"shield-7":'<svg viewBox="0 0 77 24" xmlns="http://www.w3.org/2000/svg"><rect x="1" y="3" width="75" height="18" rx="4"/></svg>',"shield-8":'<svg viewBox="0 0 86 24" xmlns="http://www.w3.org/2000/svg"><rect x="1" y="3" width="84" height="18" rx="4"/></svg>'},af={lodging:"hotel",beer:"bar",pub:"bar",kindergarten:"school",university:"college",lift_gate:"gate",toll_booth:"gate",border_control:"gate",bollard:"gate",picnic_site:"campsite",motorcycle_parking:"parking",bicycle_rental:"bicycle",harbor:"ferry_terminal",reservoir:"basin",water_park:"swimming_pool",volleyball:"pitch",basketball:"pitch",tennis:"pitch",horse_racing:"pitch",athletics:"sports_centre",running:"sports_centre",cycling:"bicycle",climbing:"sports_centre",climbing_adventure:"sports_centre",winter_sports:"sports_centre",ice_rink:"sports_centre",karting:"car",motor:"car",escape_game:"attraction"};for(let[i,e]of Object.entries(af)){let t=tt[e];t?tt[i]=t:console.warn(`[osmgl] \u043F\u0441\u0435\u0432\u0434\u043E\u043D\u0438\u043C \u0438\u043A\u043E\u043D\u043A\u0438 \xAB${i}\xBB \u0441\u0441\u044B\u043B\u0430\u0435\u0442\u0441\u044F \u043D\u0430 \u043D\u0435\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044E\u0449\u0443\u044E \xAB${e}\xBB`);}var lf=1.2;function jr(i,e,t=16,o=0){let r=sf(i,t),n=[],a=[],l=0;for(let f of r){let u=0,h=0;for(let m of f){let d=m.codePointAt(0);if(d===void 0)continue;let p=e.get(d);p&&(u+=p.advance,h++);}h>1&&(u+=o*(h-1)),a.push(u),u>l&&(l=u);}if(l===0)return null;let s=Ve*lf,c=r.length*s;for(let f=0;f<r.length;f++){let u=-a[f]/2,h=-c/2+f*s+s/2;for(let m of r[f]){let d=m.codePointAt(0);if(d===void 0)continue;let p=e.get(d);p&&(p.width>0&&p.height>0&&p.bitmap&&n.push({glyph:p,x:u,y:h}),u+=p.advance+o);}}return n.length?{glyphs:n,width:l,height:c}:null}function sf(i,e){let t=i.replace(/\s+/g," ").trim();if(t.length<=e)return [t];let o=t.split(" "),r=[],n="";for(let a of o)n?n.length+1+a.length<=e?n+=" "+a:(r.push(n),n=a):n=a;return n&&r.push(n),r.slice(0,3)}function Xr(i,e,t,o){if(i.length<2)return [];let r=-o,n=-o,a=e+o,l=t+o,s=h=>h.x>=r&&h.x<=a&&h.y>=n&&h.y<=l,c=[],f=[],u=()=>{f.length>=2&&c.push(f),f=[];};for(let h=0;h+1<i.length;h++){let m=i[h],d=i[h+1],p=s(m),y=s(d);if(p&&y){f.length||f.push(m),f.push(d);continue}let b=cf(m,d,r,n,a,l);if(!b){u();continue}f.length||f.push(b[0]),f.push(b[1]),y||u();}return u(),c}function cf(i,e,t,o,r,n){let a=e.x-i.x,l=e.y-i.y,s=0,c=1,f=[[-a,i.x-t],[a,r-i.x],[-l,i.y-o],[l,n-i.y]];for(let[u,h]of f){if(u===0){if(h<0)return null;continue}let m=h/u;if(u<0){if(m>c)return null;m>s&&(s=m);}else {if(m<s)return null;m<c&&(c=m);}}return [{x:i.x+a*s,y:i.y+l*s},{x:i.x+a*c,y:i.y+l*c}]}var ff=[0,.25,-0.25,.5,-0.5,.75,-0.75,1,-1];function Kr(i,e,t,o={}){if(i.length<2||!e.length||t<=0)return [];let r=mf(i),n=r[r.length-1];if(n<t)return [];let a=o.maxAngle??25,l=o.stableScale&&o.stableScale>0?o.stableScale:1,s=n*l,c=o.fontSize?o.fontSize*.6:t/e.length,f=(o.fontSize??0)*.85,u=[],h=o.spacing??250,m=h>0&&h-t<h*.25?t+h*.25:h;if(o.accept)return uf(i,r,e,t,m,c,a,f,o.accept);if(m>0&&s>=t+m){let p=Math.min(Math.floor((s-t)/m)+1,24),y=t+m*(p-1),b=(s-y)/2;for(let g=0;g<p;g++,b+=m){let v=b/l,x=Yr(i,r,e,t,v,c,a,f);x&&u.push({glyphs:x,path:x.map(C=>({x:C.x,y:C.y})),at:v});}if(u.length)return u}let d=(n-t)/2;for(let p of ff){let y=d+d*p,b=Yr(i,r,e,t,y,c,a,f);if(b)return [{glyphs:b,path:b.map(g=>({x:g.x,y:g.y})),at:y}];if(d===0)break}return []}function uf(i,e,t,o,r,n,a,l,s){let c=e[e.length-1],f=Math.max(o/3,r/8,12),u=[],h=-1/0;for(let m=0;m+o<=c;m+=f){if(m-h<r)continue;let d=Yr(i,e,t,o,m,n,a,l);if(!d)continue;let p={glyphs:d,path:d.map(y=>({x:y.x,y:y.y})),at:m};if(s(p)&&(u.push(p),h=m,u.length>=24))break}return u}function Yr(i,e,t,o,r,n,a,l){if(r<0||r+o>e[e.length-1]||!hf(i,e,r,r+o,n,a))return null;let s=Yt(i,e,r),c=Yt(i,e,r+o);if(!s||!c)return null;if(c.x>=s.x)return Da(i,e,t,r,l);let f=e[e.length-1];return Da([...i].reverse(),pf(e),t,f-(r+o),l)}function hf(i,e,t,o,r,n){if(r<=0)return true;let a=[],l=0;for(let s=1;s+1<i.length;s++){let c=e[s];if(c<=t)continue;if(c>=o)break;let f=Math.atan2(i[s].y-i[s-1].y,i[s].x-i[s-1].x),u=Math.atan2(i[s+1].y-i[s].y,i[s+1].x-i[s].x),h=Math.abs((u-f)*180/Math.PI+540)%360-180,m=Math.abs(h);for(a.push({at:c,delta:m}),l+=m;a.length&&c-a[0].at>r;)l-=a.shift().delta;if(l>n)return false}return true}function Da(i,e,t,o,r){let n=[];for(let c of t){let f=Ga(i,e,o+c.offset,c.width);if(!f)return null;n.push(f);}if(!n.length)return null;if(r<=0)return n;let a=[],l=o,s=0;for(let c=0;c<t.length;c++){if(c>0){let u=Math.abs(df(n[c].angle,n[c-1].angle))*(Math.PI/180);s+=r*2*Math.tan(Math.min(u,Math.PI/3)/2);}l=o+t[c].offset+s;let f=Ga(i,e,l,t[c].width);if(!f)return null;a.push(f);}return a}function Ga(i,e,t,o){let r=Yt(i,e,t+o/2);if(!r)return null;let n=Yt(i,e,t),a=Yt(i,e,t+o);if(!n||!a)return r;let l=a.x-n.x,s=a.y-n.y;return l===0&&s===0?r:{x:r.x,y:r.y,angle:Math.atan2(s,l)*180/Math.PI}}function df(i,e){let t=i-e;for(;t>180;)t-=360;for(;t<=-180;)t+=360;return t}function mf(i){let e=new Array(i.length);e[0]=0;for(let t=1;t<i.length;t++)e[t]=e[t-1]+Math.hypot(i[t].x-i[t-1].x,i[t].y-i[t-1].y);return e}function pf(i){let e=i[i.length-1];return i.map(t=>e-t).reverse()}function Yt(i,e,t){if(t<0||t>e[e.length-1])return null;let o=1;for(;o<e.length-1&&e[o]<t;)o++;let r=e[o]-e[o-1];if(r<=0)return null;let n=(t-e[o-1])/r,a=i[o-1],l=i[o],s=l.x-a.x,c=l.y-a.y;return {x:a.x+s*n,y:a.y+c*n,angle:Math.atan2(c,s)*180/Math.PI}}var qr=20,Na={stride:qr,attribs:[{name:"a_pos",size:2,type:5126,offset:0},{name:"a_tex",size:2,type:5123,offset:8},{name:"a_scale",size:1,type:5126,offset:12},{name:"a_fade",size:1,type:5126,offset:16}]},bf=220,Ye=64,Ua=2,yf=1.22,gf=128,vf=.7;function wf(i,e,t){let o=i.layout?.letterSpacing;if(o!==void 0)return D(o,e,0)*Ve;let r=D(i.paint?.haloWidth,e,0);return r<=0||t<=0?0:r*vf/(t/Ve)}var xf=256,_f=200,$r="frame-circle",gt=class i{constructor(e,t){this.shader=null;this.locations=new B;this.atlas=new Nt(1024);this.vbo=null;this.ibo=null;this.vao=null;this.capacityQuads=0;this.onAssetsReady=null;this.pendingText=new Set;this.pendingIcons=new Set;this.highlightFootprint=null;this.placedCount=0;this.placed=[];this.hoverKey=null;this.hiddenKey=null;this.padding={top:0,right:0,bottom:0,left:0};this.viewport={width:0,height:0};this.stickyKeys=new Set;this.now=0;this.shownAt=new B;this.fading=false;this.styleOrder=new B;this.glyphs=new Ut(e,t),this.icons=new Xt(tt);}init(e){this.shader=new me(e,"symbol",pa,ba);for(let t of Na.attribs)this.locations.set(t.name,this.shader.attribLocation(t.name));}static keyOf(e){return `${e.layerId}|${e.mercX.toFixed(9)}|${e.mercY.toFixed(9)}`}setHover(e){return this.hoverKey===e?false:(this.hoverKey=e,true)}setHidden(e){return this.hiddenKey===e?false:(this.hiddenKey=e,true)}querySymbol(e,t=2){let o=null;for(let r of this.placed)e.x<r.box.x1-t||e.x>r.box.x2+t||e.y<r.box.y1-t||e.y>r.box.y2+t||(!o||r.order>=o.order)&&(o=r);return o}fadeOf(e,t){let o=this.shownAt.get(e);if(o===void 0)return this.shownAt.set(e,t),this.fading=true,0;let r=(t-o)/bf;return r<1?(this.fading=true,r):1}order(e){let t=o=>o.priority+(this.stickyKeys.has(i.keyOf({layerId:o.layer.id,mercX:o.mercX,mercY:o.mercY}))?_f:0);e.sort((o,r)=>t(r)-t(o));}rememberPlaced(){this.stickyKeys=new Set(this.placed.map(e=>i.keyOf(e)));for(let e of [...this.shownAt.keys()])this.stickyKeys.has(e)||this.shownAt.delete(e);}render(e,t,o,r){let n=this.shader;if(this.placedCount=0,this.placed=[],this.viewport={width:t.width,height:t.height},!n)return;let a=t.zoom,l=r.layers.filter(m=>m.type==="symbol"&&r.layerVisibleAt(m,a));if(!l.length)return;let s=this.collect(t,o,r,l);if(!s.length)return;this.now=performance.now(),this.fading=false,this.order(s);let c=new B,f=new B,u=new B;l.forEach((m,d)=>u.set(m.id,d));let h=0;for(let m of s){let d=this.place(m,a,c);if(!d)continue;this.placed.push({layerId:m.layer.id,text:m.text,icon:m.icon,mercX:m.mercX,mercY:m.mercY,box:d.box,order:u.get(m.layer.id)??0});let p=f.get(m.layer.id);p||f.set(m.layer.id,p={layer:m.layer,verts:[],texs:[],iconVerts:[],iconTexs:[],frameVerts:[],frameTexs:[]}),p.verts.push(...d.verts),p.texs.push(...d.texs),p.iconVerts.push(...d.iconVerts),p.iconTexs.push(...d.iconTexs),p.frameVerts.push(...d.frameVerts),p.frameTexs.push(...d.frameTexs),h+=d.quads,this.placedCount++;}this.rememberPlaced(),this.fading&&this.onAssetsReady?.(),this.requestMissing(),h&&(this.styleOrder=u,this.draw(e,t,f,h,a));}collect(e,t,o,r){let n=[],l=this.padding,s=dt(e,o).far,[c,f,u]=e.cameraPositionPx;for(let h of r){let m=(h.layout?.priority??0)*xf,d=t.get(h.source??K);if(!d)continue;let p=h.layout?.showFor==="highlight",y=h.layout?.placement==="map",{shift:b,drop:g}=y?Ka(h,e.zoom,e.pixelsPerMeter):{shift:0,drop:0};if(p&&!this.highlightFootprint)continue;let v=e.worldSize>0?e.pixelsPerMeter/e.worldSize*1.5:0,x=o.bucketKeyFor(h);if(x!==null)for(let C of d.visibleTiles){if(!o.layerVisibleAt(h,e.detailZoom(e.distanceToTile(C))))continue;let M=d.getTile(C)?.data?.buckets?.[x];if(!M||!Co(M))continue;let w=new Int16Array(M.anchors),_=new Uint8Array(M.priorities),T=M.rotations?new Int16Array(M.rotations):null,L=M.lines?new Int16Array(M.lines):null,E=M.lineStarts?new Uint32Array(M.lineStarts):null,z=C.bounds(),A=e.worldSize,I=(z.maxX-z.minX)*A/M.extent,k=z.minX*A,F=z.minY*A;for(let P=0;P<_.length;P++){let R=k+w[P*2]*I,W=F+w[P*2+1]*I;if(s!==1/0&&Math.hypot(R-c,W-f,u)>s||p&&!We(this.highlightFootprint,R/A,W/A,v))continue;let G=R,O=W;if(y&&T){let $=T[P]*Math.PI/180,Q=b;G-=Math.sin($)*Q,O+=Math.cos($)*Q;}let H=e.worldPxToPoint(G,O),V=L&&E?Cf(e,L,E,P,k,F,I):void 0;if(h.layout?.textPlacement==="line"){if(!V)continue}else if(!H||H.x<l.left-64||H.y<l.top-64||H.x>e.width-l.right+64||H.y>e.height-l.bottom+64)continue;n.push({layer:h,screenX:H?H.x:V[0].x,screenY:(H?H.y:V[0].y)+g,text:M.texts[P]??"",icon:M.icons[P]??"",priority:_[P]+m,rotate:$a(h,T,P,e.bearing),mercX:R/A,mercY:W/A,line:V});}}}return n}place(e,t,o){let r=e.layer.layout??{},n=i.keyOf({layerId:e.layer.id,mercX:e.mercX,mercY:e.mercY});if(this.hiddenKey!==null&&this.hiddenKey===n)return null;let a=this.fadeOf(n,this.now),l=this.hoverKey!==null&&this.hoverKey===n,s=D(r.textSize,t,13),c=D(r.iconSize,t,16),f=r.iconTextGap??5,[u,h]=r.offset??[0,0],m=r.placement==="map",d=null;if(e.icon&&!m){this.icons.isDefined(e.icon)||(e.icon="dot");let q=`icon:${e.icon}`,U=this.atlas.get(q);if(!U){let j=this.icons.get(e.icon);j?U=this.atlas.add(q,j.data,j.width,j.height)??void 0:this.pendingIcons.add(e.icon);}U&&(d=U);}let p=null;if(d&&r.iconFrame==="circle"){let q=`icon:${$r}`,U=this.atlas.get(q);if(!U){let j=this.icons.get($r);j?U=this.atlas.add(q,j.data,j.width,j.height)??void 0:this.pendingIcons.add($r);}U&&(p=U);}let y=p?Math.max(r.iconFrameScale??1.6,1):1,b=null;if(e.text&&(this.glyphs.needsLoad(e.text)&&this.pendingText.add(e.text),b=jr(e.text,this.glyphs,r.textPlacement==="line"?Number.MAX_SAFE_INTEGER:r.maxLineChars??15,wf(e.layer,t,s)),!b&&!d)||!b&&!d)return null;let g=s/Ve,v=b?b.width*g:0,x=b?b.height*g:0;if(e.layer.layout?.textPlacement==="line")return b&&e.line?this.placeOnLine(e,b,g,x,o,t,a):null;let C=r.iconPlacement??"top",S=C==="behind"&&!!d&&!!b,M=C==="top"&&!!d&&!!b,w=d?d.width/Math.max(d.height,1):1,_=S?x+f*2:c,T=d?_*w:0,L=Math.max(T,d?c*y:0),E=Math.max(_,d?c*y:0),z=S?Math.max(T,v+f*2):M?Math.max(L,v):L+(d&&b?f:0)+v,A=S?Math.max(_,x):M?E+f+x:Math.max(d?E:0,x),I=e.screenX+u,k=e.screenY+h,F=Ua+(r.collisionPadding??0),P={x1:I-z/2-F,y1:k-A/2-F,x2:I+z/2+F,y2:k+A/2+F},R=this.padding;if(P.x1<R.left||P.y1<R.top||P.x2>this.viewport.width-R.right||P.y2>this.viewport.height-R.bottom)return null;if(!r.allowOverlap){if(ja(o,P))return null;Xa(o,P);}let W=[],G=[],O=[],H=[],V=[],Y=[],$=0,Q=I-z/2,ue=M?(E+f)/2:0,J=1/0,X=1/0,te=-1/0,ie=-1/0;if(b){let q=M||S?I:Q+(d?L+f:0)+v/2;for(let U of b.glyphs){let j=U.glyph,le=`g:${j.id}`,ae=this.atlas.get(le);if(!ae&&(!j.bitmap||(ae=this.atlas.add(le,j.bitmap,j.width+be*2,j.height+be*2)??void 0,!ae)))continue;let se=q+(U.x+j.left-be)*g,oe=k+ue+(U.y-j.top-be)*g,ge=ae.width*g,ke=ae.height*g;zo(W,G,se,oe,ge,ke,ae,0,a),$++;let ve=be*g;J=Math.min(J,se+ve),X=Math.min(X,oe+ve),te=Math.max(te,se+ge-ve),ie=Math.max(ie,oe+ke-ve);}if(M&&d&&X<1/0){let U=k-A/2+E+f-X;if(U!==0){for(let j=1;j<W.length;j+=4)W[j]+=U;X+=U,ie+=U;}}}if(d){let q=l?yf:1,U=T*q,j=_*q,le=(M?I-T/2:Q+(L-T)/2)-(U-T)/2,ae=(M?k-A/2+(E-_)/2:k-_/2)-(j-_)/2;if(p){let oe=c*y*q,ge=le+U/2-oe/2,ke=ae+j/2-oe/2,ve=be/Math.max(p.height-be*2,1)*oe;zo(V,Y,ge-ve,ke-ve,oe+ve*2,oe+ve*2,p,0,a),$++;}if(S&&te>J){let oe=f*1.6,ge=f;U=(te-J+oe*2)*q,j=(ie-X+ge*2)*q,le=J-oe,ae=X-ge;}let se=be/Math.max(d.height-be*2,1)*j;zo(O,H,le-se,ae-se,U+se*2,j+se*2,d,e.rotate,a),$++;}return $?{verts:W,texs:G,iconVerts:O,iconTexs:H,frameVerts:V,frameTexs:Y,quads:$,box:P}:null}placeOnLine(e,t,o,r,n,a,l){let s=e.line,c=t.glyphs.map(T=>({offset:(T.x+t.width/2)*o,width:Math.max(T.glyph.advance,1)*o})),f=c.length?c[c.length-1].offset+c[c.length-1].width:0,u=e.layer.layout??{},h=[],m=[],d=[],p=0,y=r/2+Ua,b=this.padding,g=T=>{let L=T.path.map(E=>({x1:E.x-y,y1:E.y-y,x2:E.x+y,y2:E.y+y}));for(let E of L)if(E.x1<b.left||E.y1<b.top||E.x2>this.viewport.width-b.right||E.y2>this.viewport.height-b.bottom||!u.allowOverlap&&ja(n,E))return false;if(!u.allowOverlap)for(let E of L)Xa(n,E);return d.push(...L),true},v=-1/0,x=1/0;for(let T of t.glyphs)T.glyph.height<=0||(v=Math.max(v,T.glyph.top),x=Math.min(x,T.glyph.top-T.glyph.height));let C=Number.isFinite(v)?(v+x)/2*o:0,M=Xr(s,this.viewport.width,this.viewport.height,gf).flatMap(T=>Kr(T,c,f,{spacing:u.symbolSpacing,fontSize:Ve*o,stableScale:Math.pow(2,Math.round(a)-a),accept:g}));if(!M.length)return null;for(let T of M)for(let L=0;L<t.glyphs.length;L++){let E=t.glyphs[L].glyph,z=T.glyphs[L],A=`g:${E.id}`,I=this.atlas.get(A);if(!I&&(!E.bitmap||(I=this.atlas.add(A,E.bitmap,E.width+be*2,E.height+be*2)??void 0,!I)))continue;let k=I.width*o,F=I.height*o,P=(E.height/2-E.top)*o+C,R=z.angle*Math.PI/180;zo(h,m,z.x-k/2-Math.sin(R)*P,z.y-F/2+Math.cos(R)*P,k,F,I,z.angle,l),p++;}if(!p)return null;let w=d.map(T=>(T.x1+T.x2)/2),_=d.map(T=>(T.y1+T.y2)/2);return {verts:h,texs:m,iconVerts:[],iconTexs:[],frameVerts:[],frameTexs:[],quads:p,box:{x1:Math.min(...w)-y,y1:Math.min(..._)-y,x2:Math.max(...w)+y,y2:Math.max(..._)+y}}}inStyleOrder(e){return [...e.values()].sort((t,o)=>(this.styleOrder.get(t.layer.id)??0)-(this.styleOrder.get(o.layer.id)??0))}draw(e,t,o,r,n){let a=this.shader,l=e.gl;this.ensureBuffers(e,r);let s=this.vbo,c=this.vao;if(!s||!c||!this.ibo)return;let f=new ArrayBuffer(r*4*qr),u=new Float32Array(f),h=new Uint16Array(f),m=[],d=0,p=(y,b,g,v)=>{let x=y.length/16;if(x){m.push({layer:g,role:v,first:d/4*6,count:x*6});for(let C=0;C<x*4;C++){let S=d*5;u[S]=y[C*4],u[S+1]=y[C*4+1],h[S*2+4]=b[C*2],h[S*2+5]=b[C*2+1],u[S+3]=y[C*4+2],u[S+4]=y[C*4+3],d++;}}};for(let y of this.inStyleOrder(o))p(y.frameVerts,y.frameTexs,y.layer,"frame"),p(y.iconVerts,y.iconTexs,y.layer,"icon"),p(y.verts,y.texs,y.layer,"text");s.update(new Uint8Array(f)),a.use(),this.atlas.bind(e,0),a.setInt("u_atlas",0),a.setVec2("u_viewport",t.width,t.height),a.setFloat("u_atlas_size",this.atlas.size),a.setFloat("u_edge",Nr),a.setFloat("u_dpr",t.width>0?l.drawingBufferWidth/t.width:1),e.setDepthTest(false),e.setDepthMask(false),e.setBlend("premultiplied"),e.setCull("none"),c.bind();for(let y of m){let b=y.layer.paint,g=D(b.opacity,n,1),v=y.role==="icon",x=y.role==="frame",C=(L,E,z)=>x?E??L??z:v?L??z:z,S=Ee(x?b.frameColor??b.haloColor??b.color:C(b.iconColor,void 0,b.color),n,[.15,.15,.15,1]),M=x?b.frameHaloColor:C(b.iconHaloColor,void 0,b.haloColor),w=Ee(M??(x?b.iconColor??b.color:b.haloColor),n,[1,1,1,1]);x&&b.frameHaloColor===void 0&&(w[3]*=.35),x&&(S[3]*=D(b.frameOpacity,n,1));let _=D(x?b.frameHaloWidth??1.1:C(b.iconHaloWidth,void 0,b.haloWidth),n,1.2),T=D(y.layer.layout?.textSize,n,13);a.setVec4v("u_color",_e([S[0],S[1],S[2],S[3]*g])),a.setVec4v("u_halo_color",_e([w[0],w[1],w[2],w[3]*g])),a.setFloat("u_halo",_/(jt*(T/Ve))),l.drawElements(l.TRIANGLES,y.count,l.UNSIGNED_INT,y.first*4);}e.bindVAO(null);}ensureBuffers(e,t){if(this.vao&&t<=this.capacityQuads)return;this.vao?.destroy(),this.vbo?.destroy(),this.ibo?.destroy(),this.capacityQuads=Math.max(1024,Math.ceil(t*1.5)),this.vbo=new ye(e,new Uint8Array(this.capacityQuads*4*qr),Na,true);let o=new Uint32Array(this.capacityQuads*6);for(let r=0;r<this.capacityQuads;r++){let n=r*4;o.set([n,n+1,n+2,n,n+2,n+3],r*6);}this.ibo=new de(e,o),this.vao=new fe(e,[{buffer:this.vbo,locations:this.locations}],this.ibo);}requestMissing(){if(this.pendingText.size){let e=[...this.pendingText].join("");this.pendingText.clear(),this.glyphs.ensure(e).then(t=>{t&&this.onAssetsReady?.();});}if(this.pendingIcons.size){let e=[...this.pendingIcons];this.pendingIcons.clear(),Promise.all(e.map(t=>this.icons.ensure(t))).then(t=>{t.some(Boolean)&&this.onAssetsReady?.();});}}destroy(e){this.shader?.destroy(),this.vao?.destroy(),this.vbo?.destroy(),this.ibo?.destroy(),this.atlas.destroy(e),this.shader=null,this.vao=null;}};function zo(i,e,t,o,r,n,a,l=0,s=1){let c=n/Math.max(a.height,1);if(l){let f=l*Math.PI/180,u=Math.cos(f),h=Math.sin(f),m=t+r/2,d=o+n/2;for(let[p,y]of [[t,o],[t+r,o],[t+r,o+n],[t,o+n]]){let b=p-m,g=y-d;i.push(m+b*u-g*h,d+b*h+g*u,c,s);}}else i.push(t,o,c,s,t+r,o,c,s,t+r,o+n,c,s,t,o+n,c,s);e.push(a.x,a.y,a.x+a.width,a.y,a.x+a.width,a.y+a.height,a.x,a.y+a.height);}function Cf(i,e,t,o,r,n,a){if(o+1>=t.length)return;let l=t[o],s=t[o+1],c=[];for(let f=l;f<s;f++){let u=i.worldPxToPoint(r+e[f*2]*a,n+e[f*2+1]*a);if(!u)break;c.push(u);}return c.length>=2?c:void 0}var Ya=(i,e)=>i*4096+e;function ja(i,e){let t=Math.floor(e.x1/Ye),o=Math.floor(e.y1/Ye),r=Math.floor(e.x2/Ye),n=Math.floor(e.y2/Ye);for(let a=t;a<=r;a++)for(let l=o;l<=n;l++){let s=i.get(Ya(a,l));if(s){for(let c of s)if(e.x1<c.x2&&e.x2>c.x1&&e.y1<c.y2&&e.y2>c.y1)return true}}return false}function Xa(i,e){let t=Math.floor(e.x1/Ye),o=Math.floor(e.y1/Ye),r=Math.floor(e.x2/Ye),n=Math.floor(e.y2/Ye);for(let a=t;a<=r;a++)for(let l=o;l<=n;l++){let s=Ya(a,l),c=i.get(s);c||i.set(s,c=[]),c.push(e);}}function Ka(i,e,t){let r=i.layout?.arrowUnits!=="meters"?1:t,n=D(i.layout?.arrowLength,e,50)*r;return {shift:D(i.layout?.arrowGap,e,20)*r+n/2,drop:n/2+(i.layout?.iconTextGap??4)}}function $a(i,e,t,o){return !i.layout?.iconRotate||!e?0:e[t]-o}var vt=class{constructor(e,t){this.capacity=e;this.onEvict=t;this.map=new B;}get size(){return this.map.size}has(e){return this.map.has(e)}get(e){let t=this.map.get(e);if(t!==void 0)return this.map.delete(e),this.map.set(e,t),t}peek(e){return this.map.get(e)}set(e,t){let o=this.map.get(e);o!==void 0&&(this.map.delete(e),o!==t&&this.onEvict?.(e,o)),this.map.set(e,t),this.trim();}delete(e){let t=this.map.get(e);return t===void 0?false:(this.map.delete(e),this.onEvict?.(e,t),true)}setCapacity(e){this.capacity=e,this.trim();}keys(){return this.map.keys()}values(){return this.map.values()}entries(){return this.map.entries()}clear(){for(let[e,t]of this.map)this.onEvict?.(e,t);this.map.clear();}trim(){for(;this.map.size>this.capacity;){let e=this.map.keys().next();if(e.done)break;let t=e.value,o=this.map.get(t);this.map.delete(t),this.onEvict?.(t,o);}}};var wt=class i{constructor(e,t,o,r=0){this.z=e;this.x=t;this.y=o;this.wrap=r;this.dataKey=`${e}/${t}/${o}`,this.key=r===0?this.dataKey:`${this.dataKey}@${r}`;}parent(){return this.z===0?null:new i(this.z-1,this.x>>1,this.y>>1,this.wrap)}children(){let e=this.z+1,t=this.x*2,o=this.y*2;return [new i(e,t,o,this.wrap),new i(e,t+1,o,this.wrap),new i(e,t,o+1,this.wrap),new i(e,t+1,o+1,this.wrap)]}scaledTo(e){if(e>=this.z)return this;let t=this.z-e;return new i(e,this.x>>t,this.y>>t,this.wrap)}isAncestorOf(e){if(e.z<=this.z||e.wrap!==this.wrap)return false;let t=e.z-this.z;return e.x>>t===this.x&&e.y>>t===this.y}bounds(){let t=1/Math.pow(2,this.z);return {minX:this.x*t+this.wrap,minY:this.y*t,maxX:(this.x+1)*t+this.wrap,maxY:(this.y+1)*t}}toString(){return this.key}};function Sf(i,e,t){let o=Math.pow(2,t),r=e.maxTiles??512,n=[],a=128;for(let l=0;l<o;l++)for(let s=0;s<o;s++){let c=new wt(t,s,l),f=c.bounds(),u=(f.minX+f.maxX)/2,h=(f.minY+f.maxY)/2,m=[[u,h],[f.minX,f.minY],[f.maxX,f.minY],[f.minX,f.maxY],[f.maxX,f.maxY]],d=false;for(let[y,b]of m)if(i.isOnGlobeFront(Se(y),Ce(b))){d=true;break}if(!d)continue;let p=false;for(let[y,b]of m){let g=i.localToPoint(i.globeLocal(y,b));if(g&&g.x>-a&&g.y>-a&&g.x<i.width+a&&g.y<i.height+a){p=true;break}}if(p&&(n.push(c),n.length>=r))return n}return n}function Kt(i,e){let t=Math.min(e.maxzoom,24),o=Math.max(0,Math.min(e.minzoom,t)),r=e.detailBias??1,n=e.maxTiles??512,a=512*r,l=Math.min(Math.round(i.zoom),t);if(l<o)return [];if(i.globeActive)return Sf(i,e,l);let{min:s,max:c}=i.visibleWrapRange(),f=[],u=[];for(let m=s;m<=c;m++)u.push(new wt(0,0,0,m));let h=0;for(;u.length&&!(++h>2e4||f.length>=n);){let m=u.pop();if(!i.isTileVisible(m))continue;if(m.z>=l){m.z>=o&&f.push(m);continue}if(i.tileScreenSize(m.z,i.distanceToTile(m))<=a&&m.z>=o){f.push(m);continue}for(let p of m.children())u.push(p);}return f.sort((m,d)=>i.distanceToTile(m)-i.distanceToTile(d)),f}var Zr=class{constructor(e){this.id=e;this.state="loading";this.data=null;this.error=null;this.requestId=0;this.buckets=new B;}get hasGeometry(){return this.state==="loaded"&&!!this.data&&Object.keys(this.data.buckets).length>0}destroy(){for(let e of this.buckets.values())e.destroy();this.buckets.clear(),this.data=null;}},Mf=1500,Po=class extends De{constructor(t,o){super();this.pool=t;this.visible=[];this.holdSince=0;this.warmed=false;this.version=0;this.opts={cacheSize:160,detailBias:1,maxTiles:512,...o},this.cache=new vt(this.opts.cacheSize,(r,n)=>{n.state==="loading"&&this.pool.abort(n.requestId),n.destroy();});}get visibleTiles(){return this.visible}get dataVersion(){return this.version+this.visible.length*1e6}get warm(){return this.warmed}getTile(t){return this.cache.peek(t.dataKey)}splitValues(t){let o=[];for(let r of this.visible){let n=this.getTile(r)?.data?.splits?.[t];if(n)for(let a of n)o.includes(a)||o.push(a);}return o.sort((r,n)=>typeof r=="number"&&typeof n=="number"?r-n:String(r).localeCompare(String(n))),o}get pendingCount(){let t=0;for(let o of this.cache.values())o.state==="loading"&&t++;return t}update(t){let o=Kt(t,this.opts),r=new ee;for(let s of o)r.add(s.dataKey);for(let[s,c]of this.cache.entries())c.state==="loading"&&!r.has(s)&&(this.pool.abort(c.requestId),this.cache.delete(s));let n=Math.max(this.opts.cacheSize,r.size*2);this.cache.setCapacity(n);for(let s of o)this.cache.get(s.dataKey)||this.loadTile(s);let a=this.visible.length>0&&this.covers(o),l=performance.now();this.readyFor(o)||!a||this.holdSince&&l-this.holdSince>Mf?(this.visible=o,this.holdSince=0,this.readyFor(o)&&o.length&&(this.warmed=true)):this.holdSince||(this.holdSince=l);}readyFor(t){for(let o of t){let r=this.cache.peek(o.dataKey);if(!r||r.state==="loading")return false}return true}covers(t){let o=new ee;for(let r of this.visible)o.add(r.dataKey);for(let r of t){if(o.has(r.dataKey))continue;let n=r.parent(),a=false;for(let l=0;n&&l<4;l++){if(o.has(n.dataKey)){a=true;break}n=n.parent();}if(!a)for(let l of this.visible){let s=l.parent();for(let c=0;s&&c<4;c++){if(s.dataKey===r.dataKey){a=true;break}s=s.parent();}if(a)break}if(!a)return false}return true}loadTile(t){let o=new Zr(t);this.cache.set(t.dataKey,o);let r=Tf(this.opts.url.replace("{z}",String(t.z)).replace("{x}",String(t.x)).replace("{y}",String(t.y)));o.requestId=this.pool.load({url:r,zoom:t.z,metersPerTile:Cn(t.z,t.y),sourceMaxZoom:this.opts.maxzoom,plan:this.opts.plan},n=>{if(this.cache.peek(t.dataKey)===o){if(n.type==="error"){if(n.aborted)return;o.state="error",o.error=n.message,this.emit("error",{tile:t,message:n.message});}else o.data=n,o.state=Object.keys(n.buckets).length?"loaded":"empty",this.version++,n.diag?.failed?.length&&console.warn(`[osmgl] \u0442\u0430\u0439\u043B ${t.z}/${t.x}/${t.y}: \u0441\u043B\u043E\u0438 \u043D\u0435 \u0441\u043E\u0431\u0440\u0430\u043B\u0438\u0441\u044C \u2014 ${n.diag.failed.join("; ")}`),this.emit("data",{tile:o});this.pendingCount===0&&this.emit("idle",void 0);}});}findReadyAncestor(t,o=5){let r=t.parent();for(let n=0;r&&n<o;n++){let a=this.cache.peek(r.dataKey);if(a&&a.hasGeometry)return a;r=r.parent();}return null}setCoverOptions(t){t.detailBias!==void 0&&(this.opts.detailBias=t.detailBias),t.maxTiles!==void 0&&(this.opts.maxTiles=t.maxTiles);}setPlan(t){this.opts.plan=t,this.cache.clear();}reload(){this.cache.clear();}destroy(){this.cache.clear(),this.removeAllListeners();}};function Tf(i){if(typeof location>"u")return i;try{return new URL(i,location.href).href}catch{return i}}var Ho=class{constructor(e){this.id=e;this.state="loading";this.image=null;this.error=null;this.texture=null;}destroy(){this.texture?.destroy(),this.texture=null,this.image?.close(),this.image=null;}},$t=class extends De{constructor(t){super();this.visible=[];this.aborts=new Map;this.opts={cacheSize:128,detailBias:1,maxTiles:256,...t},this.cache=new vt(this.opts.cacheSize,(o,r)=>{this.aborts.get(o)?.abort(),this.aborts.delete(o),r.destroy();});}get visibleTiles(){return this.visible}getTile(t){return this.cache.peek(t.dataKey)}update(t){this.visible=Kt(t,this.opts);let o=new ee;for(let r of this.visible)o.add(r.dataKey);for(let[r,n]of this.cache.entries())n.state==="loading"&&!o.has(r)&&(this.aborts.get(r)?.abort(),this.aborts.delete(r),this.cache.delete(r));this.cache.setCapacity(Math.max(this.opts.cacheSize,o.size*2));for(let r of this.visible)this.cache.get(r.dataKey)||this.loadTile(r);}reload(){for(let t of this.aborts.values())t.abort();this.aborts.clear(),this.cache.clear();}destroy(){this.reload(),this.removeAllListeners();}loadTile(t){let o=new Ho(t);this.cache.set(t.dataKey,o);let r=new AbortController;this.aborts.set(t.dataKey,r),this.fetchImage(qa(this.opts.url,t),r.signal).then(n=>{if(this.aborts.delete(t.dataKey),this.cache.peek(t.dataKey)!==o){n.close();return}o.image=n,o.state="loaded",this.emit("data",{tile:o});}).catch(n=>{this.aborts.delete(t.dataKey),!r.signal.aborted&&this.cache.peek(t.dataKey)===o&&(o.state="error",o.error=n instanceof Error?n.message:String(n),this.emit("error",{tile:t,message:o.error}));});}async fetchImage(t,o){let r=await fetch(t,{signal:o});if(!r.ok)throw new Error(`\u0442\u0430\u0439\u043B \u043F\u043E\u0434\u043B\u043E\u0436\u043A\u0438 ${r.status} ${r.statusText}`);return createImageBitmap(await r.blob())}};function qa(i,e){let t=i.replace("{z}",String(e.z)).replace("{x}",String(e.x)).replace("{y}",String(e.y));if(typeof location>"u")return t;try{return new URL(t,location.href).href}catch{return t}}var kf="osmgl-assets",xt="assets";var Oo=null;function Qa(){return Oo||(Oo=new Promise(i=>{if(typeof indexedDB>"u")return i(null);try{let e=indexedDB.open(kf,1);e.onupgradeneeded=()=>{let t=e.result;t.objectStoreNames.contains(xt)||t.createObjectStore(xt,{keyPath:"key"});},e.onsuccess=()=>i(e.result),e.onerror=()=>i(null);}catch{i(null);}}),Oo)}function Ef(i){return Qa().then(e=>new Promise(t=>{if(!e)return t(null);try{let o=e.transaction(xt,"readonly").objectStore(xt).get(i);o.onsuccess=()=>t(o.result??null),o.onerror=()=>t(null);}catch{t(null);}}))}function Af(i){Qa().then(e=>{if(e)try{e.transaction(xt,"readwrite").objectStore(xt).put(i);}catch{}});}var Za=i=>{let e=atob(i),t=new Uint8Array(e.length);for(let o=0;o<e.length;o++)t[o]=e.charCodeAt(o);return t};async function Lf(i,e,t){let o=await crypto.subtle.importKey("raw",Za(e),"AES-GCM",false,["decrypt"]);return crypto.subtle.decrypt({name:"AES-GCM",iv:Za(t),tagLength:128},o,i)}var qt=class{constructor(e){this.keys=new Map;this.variants=null;this.inflight=new Map;this.endpoint=e.endpoint.replace(/\/+$/,""),this.apiKey=e.apiKey??null;}withKey(e){return this.apiKey?e+(e.includes("?")?"&":"?")+"key="+encodeURIComponent(this.apiKey):e}loadVariants(){return this.variants??(this.variants=fetch(this.withKey(`${this.endpoint}/variants`),{credentials:"same-origin"}).then(e=>e.ok?e.json():{}).catch(()=>({}))),this.variants}async resolve(e,t){return t?(await this.loadVariants())[String(e)]?.[t]??e:e}async load(e,t,o="",r){let n=await this.resolve(e,o),a=`${n}:${t}`,l=this.inflight.get(a);if(l)return l;let s=this.fetchAsset(a,n,t,r).finally(()=>this.inflight.delete(a));return this.inflight.set(a,s),s}async fetchAsset(e,t,o,r){let n,a,l=await Ef(e);if(l)n=l.bytes,a=l.encrypted;else {let c=await fetch(this.withKey(`${this.endpoint}/files/${t}/data?lod=${o}`),{signal:r,credentials:"same-origin"});if(!c.ok)throw new Error(`data ${c.status}`);a=(c.headers.get("X-Enc")??"none")!=="none",n=await c.arrayBuffer(),Af({key:e,bytes:n,encrypted:a,savedAt:Date.now()});}if(!a)return n;let s=await this.getKey(t,r);if(!s)throw new Error("\u043D\u0435\u0442 \u043A\u043B\u044E\u0447\u0430 \u0440\u0430\u0441\u0448\u0438\u0444\u0440\u043E\u0432\u043A\u0438");return Lf(n,s.key,s.iv)}getKey(e,t){let o=this.keys.get(e);if(o)return o;let r=(async()=>{let n=await fetch(this.withKey(`${this.endpoint}/files/${e}/key`),{signal:t,credentials:"same-origin"});if(!n.ok)return null;let a=await n.json();return a.encrypted&&a.key&&a.iv?{key:a.key,iv:a.iv}:null})();return r.catch(()=>this.keys.delete(e)),this.keys.set(e,r),r}};var If=1,Zt=class{constructor(e){this.mesh=null;this.bitmaps=[];this.error=null;this.loading=null;this.matrix=N();this.grow=1;this.growTarget=1;this.animateIn=false;this.shrinkFrom=1;this.growStart=-1;this.fade=1;this.fadeTarget=1;this.fadeFrom=1;this.fadeStart=-1;this.matrix32=new Float32Array(16);this.nodeMatrix32=new Float32Array(16);this.normal32=new Float32Array(9);this.id=e.id??`model-${If++}`,this.url=e.url,this.fetchBytes=e.fetchBytes,this.coordinates=e.coordinates,this.altitude=e.altitude??0,this.rotation=e.rotation??0,this.rotationTiltX=e.rotationTiltX??0,this.rotationTiltZ=e.rotationTiltZ??0,e.growIn&&(this.animateIn=true,this.grow=0),this.scale=e.scale??1,this.fitHeight=e.fitHeight,this.visible=e.visible!==false,this.userData=e.userData??{};}get isLoaded(){return this.mesh!==null}load(e){return this.loading?(e&&this.loading.then(e),this.loading):(this.loading=(async()=>{try{let t=this.fetchBytes?await this.fetchBytes():await(async()=>{let r=await fetch(this.url);if(!r.ok)throw new Error(`HTTP ${r.status}`);return r.arrayBuffer()})(),o=await zr(t);this.bitmaps=await Promise.all(o.images.map(async r=>{if(!r.length)return null;try{return await createImageBitmap(new Blob([r]))}catch{return null}})),this.mesh=o;}catch(t){this.error=t instanceof Error?t.message:String(t),console.warn(`[osmgl] \u043C\u043E\u0434\u0435\u043B\u044C ${this.url} \u043D\u0435 \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u043B\u0430\u0441\u044C: ${this.error}`);}e?.();})(),this.loading)}advanceGrow(e){if(!this.mesh)return false;if(!this.animateIn&&this.growTarget===1)return this.grow=1,false;if(e<=0)return this.grow=1,false;let t=performance.now()/1e3;this.growStart<0&&(this.growStart=t);let o=(t-this.growStart)/e;if(this.growTarget===0){if(o>=1)return this.grow=0,false;let n=Math.max(o,0);return this.grow=this.shrinkFrom*(1-n*n*(3-2*n)),true}if(o>=1)return this.grow=1,false;let r=Math.max(o,0)-1;return this.grow=1+r*r*(2.70158*r+1.70158),true}retire(){this.growTarget!==0&&(this.growTarget=0,this.shrinkFrom=this.grow,this.growStart=performance.now()/1e3);}setHidden(e){let t=e?0:1;this.fadeTarget!==t&&(this.fadeTarget=t,this.fadeFrom=this.fade,this.fadeStart=performance.now()/1e3);}advanceFade(e){if(this.fadeStart<0)return false;if(e<=0)return this.fade=this.fadeTarget,this.fadeStart=-1,false;let t=(performance.now()/1e3-this.fadeStart)/e;if(t>=1)return this.fade=this.fadeTarget,this.fadeStart=-1,false;let o=Math.max(t,0),r=o*o*(3-2*o);return this.fade=this.fadeFrom+(this.fadeTarget-this.fadeFrom)*r,true}markGrown(){this.grow=1,this.growTarget=1,this.growStart=-1/0;}revive(){this.growTarget!==1&&(this.growTarget=1,this.growStart=performance.now()/1e3-(this.animateIn?0:1e9));}effectiveScale(){if(!this.mesh||this.fitHeight===void 0)return this.scale;let e=this.mesh.max[1]-this.mesh.min[1];return e>1e-6?this.fitHeight/e:this.scale}boundingRadiusM(){let e=this.mesh;if(!e)return 0;let t=this.effectiveScale(),o=Math.max(Math.abs(e.min[0]),Math.abs(e.max[0])),r=Math.max(Math.abs(e.min[1]),Math.abs(e.max[1])),n=Math.max(Math.abs(e.min[2]),Math.abs(e.max[2]));return Math.hypot(o,r,n)*t}origin(){let e=Z(this.coordinates);return {x:re(e.lng),y:ne(e.lat)}}localMatrix(e){let t=this.effectiveScale(),o=t/Ae(e),r=[o,0,0,0,0,t*this.grow,0,o,0],n=c=>c*Math.PI/180,a=Jr(n(-this.rotation));this.rotationTiltX&&(a=Ke(Qr(n(this.rotationTiltX)),a)),this.rotationTiltZ&&(a=Ke(en(n(this.rotationTiltZ)),a));let l=Ke(r,a),s=this.matrix;return Pe(s),s[0]=l[0],s[1]=l[1],s[2]=l[2],s[4]=l[3],s[5]=l[4],s[6]=l[5],s[8]=l[6],s[9]=l[7],s[10]=l[8],s[15]=1,s}matrixInSpace(e,t){let o=Z(this.coordinates),r=N();for(let a=0;a<16;a++)r[a]=e[a];let n=N();return xe(n,r,this.localMatrix(o.lat)),He(t??this.matrix32,n)}cameraInModelSpace(e){let t=this.effectiveScale();if(!(t>0))return [0,0,0];let o=this.origin(),r=Z(this.coordinates),n=Ae(r.lat),a=e.worldSize,l=e.cameraPositionPx,s=(l[0]/a-o.x)*n,c=(l[1]/a-o.y)*n,f=l[2]/e.pixelsPerMeter-this.altitude,u=s,h=f,m=c,d=y=>y*Math.PI/180,p=Jr(d(-this.rotation));return this.rotationTiltX&&(p=Ke(Qr(d(this.rotationTiltX)),p)),this.rotationTiltZ&&(p=Ke(en(d(this.rotationTiltZ)),p)),[(p[0]*u+p[1]*h+p[2]*m)/t,(p[3]*u+p[4]*h+p[5]*m)/t,(p[6]*u+p[7]*h+p[8]*m)/t]}matrixFor(e){let t=this.origin();return this.matrixInSpace(e.objectMatrix(t.x,t.y,this.altitude))}coversPoint(e,t){let o=this.mesh;if(!o)return false;let r=this.origin(),n=e-r.x,a=t-r.y,l=Z(this.coordinates),s=this.localMatrix(l.lat),c=s[0],f=s[1],u=s[8],h=s[9],m=c*h-f*u;if(Math.abs(m)<1e-30)return false;let d=(n*h-a*u)/m,p=(c*a-f*n)/m,y=1.05,b=(o.min[0]+o.max[0])/2,g=(o.min[2]+o.max[2])/2,v=(o.max[0]-o.min[0])/2*y,x=(o.max[2]-o.min[2])/2*y;return Math.abs(d-b)<=v&&Math.abs(p-g)<=x}get isAnimated(){return this.mesh?.animation!=null}matrixForNode(e,t,o){let r=this.origin();return this.matrixInSpaceForNode(e.objectMatrix(r.x,r.y,this.altitude),t,o,this.nodeMatrix32)}matrixInSpaceForNode(e,t,o,r){let n=this.mesh?.animation;if(!n||!n.nodes.has(t))return this.matrixInSpace(e,r);let a=N();for(let u=0;u<16;u++)a[u]=e[u];let l=Z(this.coordinates),s=N();xe(s,a,this.localMatrix(l.lat));let c=N();Pr(n,t,n.duration>0?o%n.duration:0,c);let f=N();return xe(f,s,c),He(r,f)}normalMatrix(){let e=n=>n*Math.PI/180,t=Jr(e(-this.rotation));this.rotationTiltX&&(t=Ke(Qr(e(this.rotationTiltX)),t)),this.rotationTiltZ&&(t=Ke(en(e(this.rotationTiltZ)),t));let o=Ke([1,0,0,0,0,1,0,1,0],t),r=this.normal32;for(let n=0;n<9;n++)r[n]=o[n];return r}};function Ke(i,e){let t=new Array(9);for(let o=0;o<3;o++)for(let r=0;r<3;r++)t[o*3+r]=i[r]*e[o*3]+i[3+r]*e[o*3+1]+i[6+r]*e[o*3+2];return t}var Qr=i=>{let e=Math.cos(i),t=Math.sin(i);return [1,0,0,0,e,t,0,-t,e]},Jr=i=>{let e=Math.cos(i),t=Math.sin(i);return [e,0,-t,0,1,0,t,0,e]},en=i=>{let e=Math.cos(i),t=Math.sin(i);return [e,t,0,-t,e,0,0,0,1]};var Bo=class{constructor(){this.hit=new B;this.miss=new ee;this.stamp="";}find(e,t){if(!t)return null;let o=this.hit.get(e.id);if(o!==void 0)return o;let r=t.source.visibleTiles.map(n=>n.dataKey).join(",");if(r!==this.stamp&&(this.stamp=r,this.miss.clear()),this.miss.has(e.id))return null;for(let n of t.source.visibleTiles){let a=t.source.getTile(n)?.data?.buckets?.[t.key];if(!a||a.kind!=="fill-extrusion"||!a.featureIds)continue;let l=n.bounds();if(e.mercX<l.minX||e.mercX>l.maxX||e.mercY<l.minY||e.mercY>l.maxY)continue;let s=(e.mercX-l.minX)/(l.maxX-l.minX)*a.extent,c=(e.mercY-l.minY)/(l.maxY-l.minY)*a.extent,f=new Int16Array(a.vertices),u=new Uint32Array(a.indices),h=new Float64Array(a.featureIds),m=f.length/a.vertexCount;for(let d=0;d*3+2<u.length;d++){let p=u[d*3]*m,y=u[d*3+1]*m,b=u[d*3+2]*m;if(!Wf(s,c,f[p],f[p+1],f[y],f[y+1],f[b],f[b+1]))continue;let g=h[d];return this.hit.set(e.id,g),g}}return this.miss.add(e.id),null}clear(){this.hit.clear(),this.miss.clear(),this.stamp="";}},Ff=14,Rf=2e3,zf=4e3,Ja=160,Pf=50,Hf=4e3,tn=6,Vo=class{constructor(e){this.wantKey="";this.modelKey="";this.entries=new B;this.loading=0;this.pending=[];this.known=new B;this.underBuilding=new Bo;this.underVenue=new Bo;this.tilesStamp="";this.rulesInScan=0;this.found=[];this.foundStamp="";this.sortedAt=null;this.budgetScale=1;this.addModel=null;this.lod=0;this.budget=Ja;this.replacedBuildings=new ee;this.replacedVenues=new ee;this.onReady=null;this.stats={found:0,kept:0,live:0,tooFar:0,overBudget:0,queued:0,rules:0,loadingNow:0,pendingNow:0,replaced:0};this.loader=new qt(e);}get models(){let e=[];for(let t of this.entries.values())e.push(t.model);return e}update(e,t,o,r,n,a,l){this.wantKey!==this.modelKey&&(this.modelKey=this.wantKey,this.clear(n));let s=e.layout??{},c=s.minZoom??Ff,f=s.loadRadius??Rf,u=Math.max(s.keepRadius??zf,f),h=Math.min(1,Math.max(.25,(o.zoom-c)/3)),m=Math.max(8,Math.round((s.budget??Ja)*this.budgetScale*h));this.budget=m,this.addModel=r;let d=s.maskReplaced!==false,p=performance.now();if(o.zoom<c){for(let k of [...this.entries.values()])k.model.retire(),k.model.grow<=0&&this.release(k,n);this.replacedBuildings.clear(),this.replacedVenues.clear();return}let y=o.center,b=this.lodFor(o.zoom,c);this.lod=b;let g="";for(let k of t.visibleTiles)g+=k.dataKey+(t.getTile(k)?.data?"+":"-");let v=this.rulesInScan;if(g!==this.tilesStamp){this.tilesStamp=g;let k=new ee;v=0;for(let F of t.visibleTiles){let P=t.getTile(F)?.data?.buckets?.[e.id];if(!P||!ya(P))continue;let R=new Int16Array(P.anchors),W=F.bounds(),G=W.maxX-W.minX,O=W.maxY-W.minY;for(let H=0;H<P.props.length;H++){let V=P.props[H],Y=ot(V.file,NaN);if(!Number.isFinite(Y))continue;let $=String(V.kind??"model"),Q=$==="rule"?`t-${V.rid}-${V.oid}`:`m-${V.mid}`;if(k.has(Q))continue;k.add(Q),$==="rule"&&v++;let ue=W.minX+R[H*2]/P.extent*G,J=W.minY+R[H*2+1]/P.extent*O,X=Of(ue,J);this.known.set(Q,{id:Q,fileId:Y,lng:X.lng,lat:X.lat,mercX:ue,mercY:J,altitude:ot(V.alt,0),scale:ot(V.scale,1),rotation:ot(V.rx,0),tiltX:ot(V.rz,0),tiltZ:ot(V.ry,0),kind:$==="rule"?"rule":"model",target:Wo($==="rule"?V.oid:V.replaces),replaces:d?$==="rule"?Wo(V.oid):String(V.anchor??"replace")==="replace"?Wo(V.replaces):null:null});}}this.rulesInScan=v;}g!==this.foundStamp&&(this.foundStamp=g,this.found=[...this.known.values()],this.sortedAt=null);let x=this.found,C=new ee;for(let k of x)k.kind==="model"&&k.target!==null&&C.add(k.target);let S=111320,M=Math.cos(y.lat*Math.PI/180),w=k=>Math.hypot((k.lng-y.lng)*S*M,(k.lat-y.lat)*S);this.replacedBuildings.clear(),this.replacedVenues.clear();let _=new ee,T=[],L=0,E=0;(this.sortedAt===null||Math.hypot((y.lng-this.sortedAt.lng)*S*M,(y.lat-this.sortedAt.lat)*S)>Pf)&&(x.sort((k,F)=>w(k)-w(F)),this.sortedAt={lng:y.lng,lat:y.lat});let A=0;for(let k of x){let F=w(k);if(F>u){L++;continue}if(k.kind==="rule"&&k.target!==null&&C.has(k.target)){let G=this.entries.get(k.id);G&&G.model.retire();continue}let P=this.entries.get(k.id);if(A>=m){E++,P&&P.model.retire();continue}A++,_.add(k.id);let R=()=>{if(k.replaces===null)return;this.replacedBuildings.add(k.replaces);let G=this.underBuilding.find(k,a);G!==null&&this.replacedBuildings.add(G);let O=this.underVenue.find(k,l);O!==null&&this.replacedVenues.add(O);},W=P;if(W){R(),W.distance=F,W.leftAt=0,W.model.revive(),b<W.lod&&!W.upgrading&&this.loading<tn&&this.upgrade(W,b,r,n);continue}if(F>f){L++;continue}if(this.loading>=tn){T.push(k),R();continue}R(),this.spawn(k,F,b,r);}for(let k of [...this.entries.values()])if(!_.has(k.placement.id)){if(k.leftAt===0){k.leftAt=p;continue}p-k.leftAt>Hf&&k.model.retire();}for(let k of [...this.entries.values()])k.model.growTarget===0&&k.model.grow<=0&&this.release(k,n);if(this.known.size>4e3)for(let[k,F]of [...this.known.entries()])w(F)>u*3&&this.known.delete(k);let I=this.stats;I.found=x.length,I.kept=_.size,I.live=this.entries.size,I.tooFar=L,I.overBudget=E,I.queued=T.length,I.rules=v,I.loadingNow=this.loading,I.pendingNow=T.length,I.replaced=this.replacedBuildings.size,this.pending=T;}pump(){let e=this.addModel;if(this.stats.loadingNow=this.loading,this.stats.pendingNow=this.pending.length,!!e)for(;this.pending.length&&this.loading<tn&&this.entries.size<this.budget;){let t=this.pending.shift();this.entries.has(t.id)||this.spawn(t,0,this.lod,e);}}lodFor(e,t){return e>=t+2?0:1}upgrade(e,t,o,r){let n=this.makeModel(e.placement,t,true);e.upgrading=n,this.loading++,n.load(()=>{this.loading--,this.pump(),this.entries.get(e.placement.id)===e&&(e.upgrading=null,n.isLoaded&&(r(e.model),e.model=n,e.lod=t,o(n),this.onReady?.()));});}makeModel(e,t,o){let r=new Zt({id:`objects3d-${e.id}`,url:`objects3d:${e.fileId}/${this.modelKey}/lod${t}`,fetchBytes:()=>this.loader.load(e.fileId,t,this.modelKey),coordinates:[e.lng,e.lat],altitude:e.altitude,scale:e.scale,rotation:e.rotation,rotationTiltX:e.tiltX,rotationTiltZ:e.tiltZ,growIn:!o});return o&&r.markGrown(),r}spawn(e,t,o,r,n=false){let a=this.makeModel(e,o,n);this.entries.set(e.id,{placement:e,model:a,distance:t,leftAt:0,lod:o,upgrading:null}),this.loading++,r(a),a.load(()=>{this.loading--,this.pump(),this.onReady?.();});}release(e,t){this.entries.delete(e.placement.id),e.upgrading=null,t(e.model);}setModelKey(e){this.wantKey=e??"";}clear(e){for(let t of [...this.entries.values()])this.release(t,e);this.replacedBuildings.clear(),this.replacedVenues.clear(),this.underBuilding.clear(),this.underVenue.clear();for(let t of Object.keys(this.stats))this.stats[t]=0;}},ot=(i,e)=>{let t=typeof i=="number"?i:Number(i);return Number.isFinite(t)?t:e},Wo=i=>{let e=ot(i,NaN);return Number.isFinite(e)?e:null};function Of(i,e){let t=i*360-180,o=Math.PI*(1-2*e),r=Math.atan(Math.sinh(o))*180/Math.PI;return {lng:t,lat:r}}function Wf(i,e,t,o,r,n,a,l){let s=(i-r)*(o-n)-(t-r)*(e-n),c=(i-a)*(n-l)-(r-a)*(e-l),f=(i-t)*(l-o)-(a-t)*(e-o),u=s<0||c<0||f<0,h=s>0||c>0||f>0;return !(u&&h)}var Bf=200,Vf={center:"translate(-50%, -50%)",top:"translate(-50%, 0)",bottom:"translate(-50%, -100%)",left:"translate(0, -50%)",right:"translate(-100%, -50%)"},Qt=class{constructor(e){this.attachedTo=null;this.culled=false;this._visible=true;this._coordinates=e.coordinates,this.altitude=e.altitude??0,this.offset=e.offset??[0,0],this.anchorTransform=Vf[e.anchor??"bottom"],this.userData=e.userData??{};let t=e.element??document.createElement("div");e.element||(t.className="osmgl-marker-default",t.innerHTML=e.html??Df),t.classList.add("osmgl-marker"),e.className&&t.classList.add(e.className),t.style.position="absolute",t.style.top="0",t.style.left="0",t.style.willChange="transform",e.zIndex!==void 0&&(t.style.zIndex=String(e.zIndex)),this.element=t;}get coordinates(){return this._coordinates}setCoordinates(e){return this._coordinates=e,this}setVisible(e){return this._visible=e,this.applyVisibility(),this}get visible(){return this._visible}attach(e){this.attachedTo!==e&&(e.appendChild(this.element),this.attachedTo=e);}detach(){this.element.remove(),this.attachedTo=null;}update(e){let t=Z(this._coordinates),o=e.worldSize,r=e.worldPxToPoint(re(t.lng)*o,ne(t.lat)*o,this.altitude);if(!r){this.culled=true,this.applyVisibility();return}let n=Bf;if(r.x<-n||r.y<-n||r.x>e.width+n||r.y>e.height+n){this.culled=true,this.applyVisibility();return}this.culled=false,this.applyVisibility(),this.element.style.transform=`translate(${Math.round(r.x+this.offset[0])}px, ${Math.round(r.y+this.offset[1])}px) ${this.anchorTransform}`;}applyVisibility(){this.element.style.display=this._visible&&!this.culled?"":"none";}},Df='<svg width="24" height="32" viewBox="0 0 24 32" xmlns="http://www.w3.org/2000/svg"><path d="M12 0C5.4 0 0 5.4 0 12c0 9 12 20 12 20s12-11 12-20c0-6.6-5.4-12-12-12z" fill="#2f6df6"/><circle cx="12" cy="12" r="4.5" fill="#fff"/></svg>';var Jt=class extends Qt{constructor(t){let o=document.createElement("div");o.className="osmgl-popup",o.style.pointerEvents="auto";let r=document.createElement("div");if(r.className="osmgl-popup-content",t.element?r.appendChild(t.element):r.innerHTML=t.html??"",o.appendChild(r),t.closeButton!==false){let a=document.createElement("button");a.className="osmgl-popup-close",a.type="button",a.setAttribute("aria-label","\u0417\u0430\u043A\u0440\u044B\u0442\u044C"),a.textContent="\xD7",o.appendChild(a);}let n=document.createElement("div");n.className="osmgl-popup-tip",o.appendChild(n);super({coordinates:t.coordinates,element:o,anchor:t.anchor??"bottom",offset:t.offset??[0,-12],altitude:t.altitude,zIndex:t.zIndex??10,className:t.className,userData:t.userData});this.onClose=null;this.content=r,this.closeOnClick=t.closeOnClick!==false,o.querySelector(".osmgl-popup-close")?.addEventListener("click",()=>this.onClose?.());}onCloseRequest(t){return this.onClose=t,this}setHtml(t){return this.content.innerHTML=t,this}setContent(t){return this.content.replaceChildren(t),this}};var Gf=[["\u0443\u043B\u0438\u0446\u0430","\u0443\u043B."],["\u0443\u043B\u0438\u0446\u044B","\u0443\u043B."],["\u0443\u043B\u0438\u0446\u0435","\u0443\u043B."],["\u043F\u0440\u043E\u0441\u043F\u0435\u043A\u0442","\u043F\u0440\u043E\u0441\u043F."],["\u043F\u0440\u043E\u0441\u043F\u0435\u043A\u0442\u0430","\u043F\u0440\u043E\u0441\u043F."],["\u043F\u0435\u0440\u0435\u0443\u043B\u043E\u043A","\u043F\u0435\u0440."],["\u043F\u0435\u0440\u0435\u0443\u043B\u043A\u0430","\u043F\u0435\u0440."],["\u043F\u0440\u043E\u0435\u0437\u0434","\u043F\u0440-\u0434"],["\u043F\u0440\u043E\u0435\u0437\u0434\u0430","\u043F\u0440-\u0434"],["\u043F\u043B\u043E\u0449\u0430\u0434\u044C","\u043F\u043B."],["\u043F\u043B\u043E\u0449\u0430\u0434\u0438","\u043F\u043B."],["\u0431\u0443\u043B\u044C\u0432\u0430\u0440","\u0431\u0443\u043B."],["\u0431\u0443\u043B\u044C\u0432\u0430\u0440\u0430","\u0431\u0443\u043B."],["\u043D\u0430\u0431\u0435\u0440\u0435\u0436\u043D\u0430\u044F","\u043D\u0430\u0431."],["\u043D\u0430\u0431\u0435\u0440\u0435\u0436\u043D\u043E\u0439","\u043D\u0430\u0431."],["\u0448\u043E\u0441\u0441\u0435","\u0448."],["\u0442\u0443\u043F\u0438\u043A","\u0442\u0443\u043F."],["\u0442\u0443\u043F\u0438\u043A\u0430","\u0442\u0443\u043F."],["\u043C\u0438\u043A\u0440\u043E\u0440\u0430\u0439\u043E\u043D","\u043C\u043A\u0440."],["\u043C\u0438\u043A\u0440\u043E\u0440\u0430\u0439\u043E\u043D\u0430","\u043C\u043A\u0440."],["\u043A\u04EF\u0447\u0430\u0438","\u043A."],["\u043A\u0443\u0447\u0430\u0438","\u043A."],["\u0445\u0438\u0451\u0431\u043E\u043D\u0438","\u0445\u0438\u0451\u0431."],["\u0448\u043E\u04B3\u0440\u043E\u04B3\u0438","\u0448\u043E\u04B3."],["\u0433\u0443\u0437\u0430\u0440\u0433\u043E\u04B3\u0438","\u0433\u0443\u0437."],["\u043C\u0430\u0439\u0434\u043E\u043D\u0438","\u043C\u0430\u0439\u0434."]],el=new Map(Gf);function on(i){let e=i.split(" ");if(e.length<2)return i;let t=false,o=e.map(n=>{let a=el.get(n.toLowerCase());return a?(t=true,n[0]===n[0].toUpperCase()?a[0].toUpperCase()+a.slice(1):a):n});return !t||!e.filter(n=>el.get(n.toLowerCase())===void 0).length?i:o.join(" ")}function nn(i,e){let t=[],o=[],r=[],n=[],a=[],l=e.textPlacement==="line",s=[],c=[],f=[];for(let u of i.features()){if(!pe(e.filter,u.properties))continue;let h=u.loadGeometry(),m=jf(u.type,h);if(!m)continue;let d=e.textField?rn(e.textField,u.properties):"",p=d&&e.abbreviate?on(d):d,y=e.iconImage?rn(e.iconImage,u.properties):"";if(!(!p&&!y)){if(l){let b=Uf(u.type,h);if(!b)continue;f.push({text:p,line:b});continue}t.push(m[0],m[1]),o.push(p),r.push(y),n.push(Xf(u.properties)),a.push(e.iconRotate&&Math.round(Number(u.properties[e.iconRotate]??0))||0);}}if(l){for(let{text:u,line:h}of Nf(f)){c.push(s.length/2);for(let m of h)s.push(m);t.push(Math.round(h[0]),Math.round(h[1])),o.push(u),r.push(""),n.push(128),a.push(0);}c.push(s.length/2);}return o.length?{anchors:new Int16Array(t).buffer,texts:o,icons:r,priorities:new Uint8Array(n).buffer,rotations:new Int16Array(a).buffer,...l?{lines:new Int16Array(s).buffer,lineStarts:new Uint32Array(c).buffer}:{}}:null}function Nf(i){let e=[],t=new Map,o=new Map,r=(n,a,l)=>`${n}\u241F${a}\u241F${l}`;for(let{text:n,line:a}of i){let l=r(n,a[0],a[1]),s=r(n,a[a.length-2],a[a.length-1]),c=t.get(s),f=o.get(l);if(f!==void 0){let u=e[f];if(u.line.push(...a.slice(2)),o.delete(l),o.set(r(n,u.line[u.line.length-2],u.line[u.line.length-1]),f),c!==void 0&&c!==f){let h=e[c];u.line.push(...h.line.slice(2)),h.line=[],t.delete(s),o.set(r(n,u.line[u.line.length-2],u.line[u.line.length-1]),f);}continue}if(c!==void 0){let u=e[c];u.line.unshift(...a.slice(0,a.length-2)),t.delete(s),t.set(r(n,u.line[0],u.line[1]),c);continue}t.set(l,e.length),o.set(s,e.length),e.push({text:n,line:a});}return e.filter(n=>n.line.length>=4)}function Uf(i,e){if(i!==2)return null;let t=null,o=0;for(let r of e){if(r.length<4)continue;let n=0;for(let a=0;a+3<r.length;a+=2)n+=Math.hypot(r[a+2]-r[a],r[a+3]-r[a+1]);n>o&&(o=n,t=r);}return t}function jf(i,e){if(!e.length)return null;if(i===1){let a=e[0];return a.length>=2?[a[0],a[1]]:null}if(i===2){let a=-1,l=0,s=0;for(let c of e)for(let f=0;f+3<c.length;f+=2){let u=c[f+2]-c[f],h=c[f+3]-c[f+1],m=u*u+h*h;m>a&&(a=m,l=c[f]+u/2,s=c[f+1]+h/2);}return a>0?[Math.round(l),Math.round(s)]:null}let t=1/0,o=1/0,r=-1/0,n=-1/0;for(let a of e)for(let l=0;l<a.length;l+=2)a[l]<t&&(t=a[l]),a[l]>r&&(r=a[l]),a[l+1]<o&&(o=a[l+1]),a[l+1]>n&&(n=a[l+1]);return isFinite(t)?[Math.round((t+r)/2),Math.round((o+n)/2)]:null}function Xf(i){let e=i.rank;return typeof e=="number"&&isFinite(e)?Math.max(0,255-Math.min(e,255)):128}function rn(i,e){let t=Array.isArray(i)?i:[i];for(let o of t){let r=true,a=o.replace(/\{([^}]+)\}/g,(l,s)=>{let c=e[s];return c==null||c===""?(r=false,""):String(c)}).trim();if(r&&a)return a}return ""}function tl(i,e){let t=[],o=[];for(let r=0;r<i.length;r++){let n=i.feature(r);if(n.type===1&&pe(e,n.properties))for(let a of n.loadGeometry())for(let l=0;l+1<a.length;l+=2)t.push(a[l],a[l+1]),o.push(n.properties);}return o.length?{anchors:Int16Array.from(t).buffer,props:o}:null}function Yf(){let i=typeof self<"u"?self.origin:void 0;return i&&i!=="null"&&!i.startsWith("blob:")?i+"/":void 0}async function ol(i,e){let t=performance.now(),o=Yf(),r=await fetch(i.url,{signal:e,credentials:"same-origin",...o?{referrer:o}:{}}),n=(b,g,v,x,C=0)=>({type:"loaded",id:i.id,buckets:{},timing:{fetchMs:x,parseMs:C},diag:{status:b,bytes:g,layers:v,built:0}});if(!r.ok){if(r.status===404||r.status===204)return n(r.status,0,[],performance.now()-t);throw new Error(`HTTP ${r.status} \u0434\u043B\u044F ${i.url}`)}let a=await r.arrayBuffer(),l=performance.now()-t;if(a.byteLength===0)return n(r.status,0,[],l);let s=performance.now(),c=new kt(a),f=Object.keys(c.layers),u={},h={},m=new Set,d=[],y=i.plan.some(b=>b.type==="surface"&&(b.elevation??0)>0)&&i.plan.some(b=>b.type==="line"&&b.ground)?hr(i.metersPerTile):void 0;for(let b of i.plan){if(!$f(b,i.zoom,i.sourceMaxZoom))continue;let g=c.layers[b.sourceLayer];if(!g)continue;let v=qf(i.zoom,g.extent);try{if(b.splitBy){let C=Zf(g,b.splitBy,b.filter);if(!C.length)continue;let S=h[b.splitBy]??(h[b.splitBy]=[]);for(let M of C){S.includes(M)||S.push(M);let w={...b,splitBy:void 0,filter:Jf(b.filter,b.splitBy,M)},_=an(w,g,v,i.metersPerTile,y);_&&(u[ze(b.id,M)]=_);}continue}if(b.network&&b.type==="line"){for(let C of Qf(g,b.filter)){let S=an(b,g,v,i.metersPerTile,y,C);S&&(u[ze(b.id,C)]=S,m.add(C));}continue}let x=an(b,g,v,i.metersPerTile,y);x&&(u[b.id]=x);}catch(x){d.push(`${b.id}: ${x instanceof Error?x.message:String(x)}`);}}return {type:"loaded",id:i.id,buckets:u,...Object.keys(h).length?{splits:h}:{},...m.size?{levels:[...m].sort((b,g)=>b-g)}:{},timing:{fetchMs:l,parseMs:performance.now()-s},diag:{status:r.status,bytes:a.byteLength,layers:f,built:Object.keys(u).length,...d.length?{failed:d}:{}}}}function Kf(i){return e=>{let t=e.on;if(typeof t!="string"||!t)return 0;let o=0;for(let r of t.split(",")){let n=i[r];typeof n=="number"&&n>o&&(o=n);}return o}}function $f(i,e,t){let o=e-1,r=e<t?e+1:24;return !(i.maxzoom<o||i.minzoom>r)}function qf(i,e){return i<=6?Math.max(64,e/24):0}function an(i,e,t,o,r,n){{if(i.type==="fill"){let l=o>0?o/e.extent:0,s=i.cornerRadius&&l>0?{radius:i.cornerRadius/l,segments:i.cornerSegments,extent:e.extent,minCutRatio:0,maxChord:Gn/l}:void 0,c=ur(e,i.filter,t,s,i.clipToTile===true,e.extent);return c?{kind:"fill",...c,extent:e.extent}:null}if(i.type==="surface"){let l=fr(e,e.extent,i.filter,{metersPerUnit:o>0?o/e.extent:0,elevation:i.elevation??0,base:i.base,bevel:i.bevel,weld:i.weld,bevelDrop:i.bevelDrop,cornerRadius:i.cornerRadius,cornerSegments:i.cornerSegments,...r?{onShapes:s=>dr(r,s,i.elevation??0,e.extent)}:{},...i.groundBy?{liftBy:Kf(i.groundBy)}:{}});return l?{kind:"surface",...l}:null}if(i.type==="line"){let l=pr(e,i.filter,t,i.ground?r:void 0,o>0?o/e.extent:0,{level:n});return l?{kind:"line",...l,extent:e.extent}:null}if(i.type==="model"){let l=tl(e,i.filter);return l?{kind:"placement",...l,extent:e.extent}:null}if(i.type==="symbol"){let l=nn(e,{filter:i.filter,textField:i.textField,iconImage:i.iconImage,iconRotate:i.iconRotate,textPlacement:i.textPlacement,abbreviate:i.abbreviate});return l?{kind:"symbol",...l,extent:e.extent}:null}let a=nr(e,e.extent,i.filter,{metersPerUnit:o>0?o/e.extent:0,cornerRadius:i.cornerRadius,cornerSegments:i.cornerSegments});return a?{kind:"fill-extrusion",vertices:a.vertices,indices:a.indices,featureIds:a.featureIds,vertexCount:a.vertexCount,indexCount:a.indexCount,extent:a.extent}:null}}function Zf(i,e,t){let o=[];for(let r of i.features()){if(!pe(t,r.properties))continue;let n=r.properties[e];typeof n!="string"&&typeof n!="number"||o.includes(n)||o.push(n);}return o.sort((r,n)=>typeof r=="number"&&typeof n=="number"?r-n:String(r).localeCompare(String(n))),o}function Qf(i,e){let t=[];for(let o of i.features()){if(!pe(e,o.properties))continue;let r=et(o.properties);t.includes(r)||t.push(r);}return t.sort((o,r)=>o-r)}function Jf(i,e,t){let o=["==",e,t];return i?["all",i,o]:o}var ln='"use strict";(()=>{var nr=Object.create;var Qt=Object.defineProperty;var rr=Object.getOwnPropertyDescriptor;var ir=Object.getOwnPropertyNames;var or=Object.getPrototypeOf,sr=Object.prototype.hasOwnProperty;var ur=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var lr=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of ir(e))!sr.call(t,i)&&i!==n&&Qt(t,i,{get:()=>e[i],enumerable:!(r=rr(e,i))||r.enumerable});return t};var cr=(t,e,n)=>(n=t!=null?nr(or(t)):{},lr(e||!t||!t.__esModule?Qt(n,"default",{value:t,enumerable:!0}):n,t));var In=ur((Ut,Gt)=>{(function(t,e){typeof Ut=="object"&&typeof Gt<"u"?Gt.exports=e():typeof define=="function"&&define.amd?define(e):(t=typeof globalThis<"u"?globalThis:t||self,t.polygonClipping=e())})(Ut,function(){"use strict";function t(g,o){var u={label:0,sent:function(){if(h[0]&1)throw h[1];return h[1]},trys:[],ops:[]},f,m,h,S;return S={next:v(0),throw:v(1),return:v(2)},typeof Symbol=="function"&&(S[Symbol.iterator]=function(){return this}),S;function v(M){return function(V){return F([M,V])}}function F(M){if(f)throw new TypeError("Generator is already executing.");for(;u;)try{if(f=1,m&&(h=M[0]&2?m.return:M[0]?m.throw||((h=m.return)&&h.call(m),0):m.next)&&!(h=h.call(m,M[1])).done)return h;switch(m=0,h&&(M=[M[0]&2,h.value]),M[0]){case 0:case 1:h=M;break;case 4:return u.label++,{value:M[1],done:!1};case 5:u.label++,m=M[1],M=[0];continue;case 7:M=u.ops.pop(),u.trys.pop();continue;default:if(h=u.trys,!(h=h.length>0&&h[h.length-1])&&(M[0]===6||M[0]===2)){u=0;continue}if(M[0]===3&&(!h||M[1]>h[0]&&M[1]<h[3])){u.label=M[1];break}if(M[0]===6&&u.label<h[1]){u.label=h[1],h=M;break}if(h&&u.label<h[2]){u.label=h[2],u.ops.push(M);break}h[2]&&u.ops.pop(),u.trys.pop();continue}M=o.call(g,u)}catch(V){M=[6,V],m=0}finally{f=h=0}if(M[0]&5)throw M[1];return{value:M[0]?M[1]:void 0,done:!0}}}var e=function(){function g(o,u){this.next=null,this.key=o,this.data=u,this.left=null,this.right=null}return g}();function n(g,o){return g>o?1:g<o?-1:0}function r(g,o,u){for(var f=new e(null,null),m=f,h=f;;){var S=u(g,o.key);if(S<0){if(o.left===null)break;if(u(g,o.left.key)<0){var v=o.left;if(o.left=v.right,v.right=o,o=v,o.left===null)break}h.left=o,h=o,o=o.left}else if(S>0){if(o.right===null)break;if(u(g,o.right.key)>0){var v=o.right;if(o.right=v.left,v.left=o,o=v,o.right===null)break}m.right=o,m=o,o=o.right}else break}return m.right=o.left,h.left=o.right,o.left=f.right,o.right=f.left,o}function i(g,o,u,f){var m=new e(g,o);if(u===null)return m.left=m.right=null,m;u=r(g,u,f);var h=f(g,u.key);return h<0?(m.left=u.left,m.right=u,u.left=null):h>=0&&(m.right=u.right,m.left=u,u.right=null),m}function s(g,o,u){var f=null,m=null;if(o){o=r(g,o,u);var h=u(o.key,g);h===0?(f=o.left,m=o.right):h<0?(m=o.right,o.right=null,f=o):(f=o.left,o.left=null,m=o)}return{left:f,right:m}}function l(g,o,u){return o===null?g:(g===null||(o=r(g.key,o,u),o.left=g),o)}function c(g,o,u,f,m){if(g){f(""+o+(u?"\\u2514\\u2500\\u2500 ":"\\u251C\\u2500\\u2500 ")+m(g)+`\n`);var h=o+(u?" ":"\\u2502 ");g.left&&c(g.left,h,!1,f,m),g.right&&c(g.right,h,!0,f,m)}}var a=function(){function g(o){o===void 0&&(o=n),this._root=null,this._size=0,this._comparator=o}return g.prototype.insert=function(o,u){return this._size++,this._root=i(o,u,this._root,this._comparator)},g.prototype.add=function(o,u){var f=new e(o,u);this._root===null&&(f.left=f.right=null,this._size++,this._root=f);var m=this._comparator,h=r(o,this._root,m),S=m(o,h.key);return S===0?this._root=h:(S<0?(f.left=h.left,f.right=h,h.left=null):S>0&&(f.right=h.right,f.left=h,h.right=null),this._size++,this._root=f),this._root},g.prototype.remove=function(o){this._root=this._remove(o,this._root,this._comparator)},g.prototype._remove=function(o,u,f){var m;if(u===null)return null;u=r(o,u,f);var h=f(o,u.key);return h===0?(u.left===null?m=u.right:(m=r(o,u.left,f),m.right=u.right),this._size--,m):u},g.prototype.pop=function(){var o=this._root;if(o){for(;o.left;)o=o.left;return this._root=r(o.key,this._root,this._comparator),this._root=this._remove(o.key,this._root,this._comparator),{key:o.key,data:o.data}}return null},g.prototype.findStatic=function(o){for(var u=this._root,f=this._comparator;u;){var m=f(o,u.key);if(m===0)return u;m<0?u=u.left:u=u.right}return null},g.prototype.find=function(o){return this._root&&(this._root=r(o,this._root,this._comparator),this._comparator(o,this._root.key)!==0)?null:this._root},g.prototype.contains=function(o){for(var u=this._root,f=this._comparator;u;){var m=f(o,u.key);if(m===0)return!0;m<0?u=u.left:u=u.right}return!1},g.prototype.forEach=function(o,u){for(var f=this._root,m=[],h=!1;!h;)f!==null?(m.push(f),f=f.left):m.length!==0?(f=m.pop(),o.call(u,f),f=f.right):h=!0;return this},g.prototype.range=function(o,u,f,m){for(var h=[],S=this._comparator,v=this._root,F;h.length!==0||v;)if(v)h.push(v),v=v.left;else{if(v=h.pop(),F=S(v.key,u),F>0)break;if(S(v.key,o)>=0&&f.call(m,v))return this;v=v.right}return this},g.prototype.keys=function(){var o=[];return this.forEach(function(u){var f=u.key;return o.push(f)}),o},g.prototype.values=function(){var o=[];return this.forEach(function(u){var f=u.data;return o.push(f)}),o},g.prototype.min=function(){return this._root?this.minNode(this._root).key:null},g.prototype.max=function(){return this._root?this.maxNode(this._root).key:null},g.prototype.minNode=function(o){if(o===void 0&&(o=this._root),o)for(;o.left;)o=o.left;return o},g.prototype.maxNode=function(o){if(o===void 0&&(o=this._root),o)for(;o.right;)o=o.right;return o},g.prototype.at=function(o){for(var u=this._root,f=!1,m=0,h=[];!f;)if(u)h.push(u),u=u.left;else if(h.length>0){if(u=h.pop(),m===o)return u;m++,u=u.right}else f=!0;return null},g.prototype.next=function(o){var u=this._root,f=null;if(o.right){for(f=o.right;f.left;)f=f.left;return f}for(var m=this._comparator;u;){var h=m(o.key,u.key);if(h===0)break;h<0?(f=u,u=u.left):u=u.right}return f},g.prototype.prev=function(o){var u=this._root,f=null;if(o.left!==null){for(f=o.left;f.right;)f=f.right;return f}for(var m=this._comparator;u;){var h=m(o.key,u.key);if(h===0)break;h<0?u=u.left:(f=u,u=u.right)}return f},g.prototype.clear=function(){return this._root=null,this._size=0,this},g.prototype.toList=function(){return y(this._root)},g.prototype.load=function(o,u,f){u===void 0&&(u=[]),f===void 0&&(f=!1);var m=o.length,h=this._comparator;if(f&&E(o,u,0,m-1,h),this._root===null)this._root=p(o,u,0,m),this._size=m;else{var S=b(this.toList(),x(o,u),h);m=this._size+m,this._root=d({head:S},0,m)}return this},g.prototype.isEmpty=function(){return this._root===null},Object.defineProperty(g.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(g.prototype,"root",{get:function(){return this._root},enumerable:!0,configurable:!0}),g.prototype.toString=function(o){o===void 0&&(o=function(f){return String(f.key)});var u=[];return c(this._root,"",!0,function(f){return u.push(f)},o),u.join("")},g.prototype.update=function(o,u,f){var m=this._comparator,h=s(o,this._root,m),S=h.left,v=h.right;m(o,u)<0?v=i(u,f,v,m):S=i(u,f,S,m),this._root=l(S,v,m)},g.prototype.split=function(o){return s(o,this._root,this._comparator)},g.prototype[Symbol.iterator]=function(){var o,u,f;return t(this,function(m){switch(m.label){case 0:o=this._root,u=[],f=!1,m.label=1;case 1:return f?[3,6]:o===null?[3,2]:(u.push(o),o=o.left,[3,5]);case 2:return u.length===0?[3,4]:(o=u.pop(),[4,o]);case 3:return m.sent(),o=o.right,[3,5];case 4:f=!0,m.label=5;case 5:return[3,1];case 6:return[2]}})},g}();function p(g,o,u,f){var m=f-u;if(m>0){var h=u+Math.floor(m/2),S=g[h],v=o[h],F=new e(S,v);return F.left=p(g,o,u,h),F.right=p(g,o,h+1,f),F}return null}function x(g,o){for(var u=new e(null,null),f=u,m=0;m<g.length;m++)f=f.next=new e(g[m],o[m]);return f.next=null,u.next}function y(g){for(var o=g,u=[],f=!1,m=new e(null,null),h=m;!f;)o?(u.push(o),o=o.left):u.length>0?(o=h=h.next=u.pop(),o=o.right):f=!0;return h.next=null,m.next}function d(g,o,u){var f=u-o;if(f>0){var m=o+Math.floor(f/2),h=d(g,o,m),S=g.head;return S.left=h,g.head=g.head.next,S.right=d(g,m+1,u),S}return null}function b(g,o,u){for(var f=new e(null,null),m=f,h=g,S=o;h!==null&&S!==null;)u(h.key,S.key)<0?(m.next=h,h=h.next):(m.next=S,S=S.next),m=m.next;return h!==null?m.next=h:S!==null&&(m.next=S),f.next}function E(g,o,u,f,m){if(!(u>=f)){for(var h=g[u+f>>1],S=u-1,v=f+1;;){do S++;while(m(g[S],h)<0);do v--;while(m(g[v],h)>0);if(S>=v)break;var F=g[S];g[S]=g[v],g[v]=F,F=o[S],o[S]=o[v],o[v]=F}E(g,o,u,v,m),E(g,o,v+1,f,m)}}let A=(g,o)=>g.ll.x<=o.x&&o.x<=g.ur.x&&g.ll.y<=o.y&&o.y<=g.ur.y,_=(g,o)=>{if(o.ur.x<g.ll.x||g.ur.x<o.ll.x||o.ur.y<g.ll.y||g.ur.y<o.ll.y)return null;let u=g.ll.x<o.ll.x?o.ll.x:g.ll.x,f=g.ur.x<o.ur.x?g.ur.x:o.ur.x,m=g.ll.y<o.ll.y?o.ll.y:g.ll.y,h=g.ur.y<o.ur.y?g.ur.y:o.ur.y;return{ll:{x:u,y:m},ur:{x:f,y:h}}},R=Number.EPSILON;R===void 0&&(R=Math.pow(2,-52));let L=R*R,k=(g,o)=>{if(-R<g&&g<R&&-R<o&&o<R)return 0;let u=g-o;return u*u<L*g*o?0:g<o?-1:1};class T{constructor(){this.reset()}reset(){this.xRounder=new O,this.yRounder=new O}round(o,u){return{x:this.xRounder.round(o),y:this.yRounder.round(u)}}}class O{constructor(){this.tree=new a,this.round(0)}round(o){let u=this.tree.add(o),f=this.tree.prev(u);if(f!==null&&k(u.key,f.key)===0)return this.tree.remove(o),f.key;let m=this.tree.next(u);return m!==null&&k(u.key,m.key)===0?(this.tree.remove(o),m.key):o}}let D=new T,U=11102230246251565e-32,P=134217729,C=(3+8*U)*U;function Y(g,o,u,f,m){let h,S,v,F,M=o[0],V=f[0],w=0,I=0;V>M==V>-M?(h=M,M=o[++w]):(h=V,V=f[++I]);let B=0;if(w<g&&I<u)for(V>M==V>-M?(S=M+h,v=h-(S-M),M=o[++w]):(S=V+h,v=h-(S-V),V=f[++I]),h=S,v!==0&&(m[B++]=v);w<g&&I<u;)V>M==V>-M?(S=h+M,F=S-h,v=h-(S-F)+(M-F),M=o[++w]):(S=h+V,F=S-h,v=h-(S-F)+(V-F),V=f[++I]),h=S,v!==0&&(m[B++]=v);for(;w<g;)S=h+M,F=S-h,v=h-(S-F)+(M-F),M=o[++w],h=S,v!==0&&(m[B++]=v);for(;I<u;)S=h+V,F=S-h,v=h-(S-F)+(V-F),V=f[++I],h=S,v!==0&&(m[B++]=v);return(h!==0||B===0)&&(m[B++]=h),B}function Q(g,o){let u=o[0];for(let f=1;f<g;f++)u+=o[f];return u}function Z(g){return new Float64Array(g)}let re=(3+16*U)*U,X=(2+12*U)*U,$=(9+64*U)*U*U,z=Z(4),N=Z(8),q=Z(12),te=Z(16),K=Z(4);function oe(g,o,u,f,m,h,S){let v,F,M,V,w,I,B,H,G,W,j,ne,ae,ue,he,pe,ge,me,Se=g-m,Ee=u-m,Me=o-h,Re=f-h;ue=Se*Re,I=P*Se,B=I-(I-Se),H=Se-B,I=P*Re,G=I-(I-Re),W=Re-G,he=H*W-(ue-B*G-H*G-B*W),pe=Me*Ee,I=P*Me,B=I-(I-Me),H=Me-B,I=P*Ee,G=I-(I-Ee),W=Ee-G,ge=H*W-(pe-B*G-H*G-B*W),j=he-ge,w=he-j,z[0]=he-(j+w)+(w-ge),ne=ue+j,w=ne-ue,ae=ue-(ne-w)+(j-w),j=ae-pe,w=ae-j,z[1]=ae-(j+w)+(w-pe),me=ne+j,w=me-ne,z[2]=ne-(me-w)+(j-w),z[3]=me;let ke=Q(4,z),Je=X*S;if(ke>=Je||-ke>=Je||(w=g-Se,v=g-(Se+w)+(w-m),w=u-Ee,M=u-(Ee+w)+(w-m),w=o-Me,F=o-(Me+w)+(w-h),w=f-Re,V=f-(Re+w)+(w-h),v===0&&F===0&&M===0&&V===0)||(Je=$*S+C*Math.abs(ke),ke+=Se*V+Re*v-(Me*M+Ee*F),ke>=Je||-ke>=Je))return ke;ue=v*Re,I=P*v,B=I-(I-v),H=v-B,I=P*Re,G=I-(I-Re),W=Re-G,he=H*W-(ue-B*G-H*G-B*W),pe=F*Ee,I=P*F,B=I-(I-F),H=F-B,I=P*Ee,G=I-(I-Ee),W=Ee-G,ge=H*W-(pe-B*G-H*G-B*W),j=he-ge,w=he-j,K[0]=he-(j+w)+(w-ge),ne=ue+j,w=ne-ue,ae=ue-(ne-w)+(j-w),j=ae-pe,w=ae-j,K[1]=ae-(j+w)+(w-pe),me=ne+j,w=me-ne,K[2]=ne-(me-w)+(j-w),K[3]=me;let qn=Y(4,z,4,K,N);ue=Se*V,I=P*Se,B=I-(I-Se),H=Se-B,I=P*V,G=I-(I-V),W=V-G,he=H*W-(ue-B*G-H*G-B*W),pe=Me*M,I=P*Me,B=I-(I-Me),H=Me-B,I=P*M,G=I-(I-M),W=M-G,ge=H*W-(pe-B*G-H*G-B*W),j=he-ge,w=he-j,K[0]=he-(j+w)+(w-ge),ne=ue+j,w=ne-ue,ae=ue-(ne-w)+(j-w),j=ae-pe,w=ae-j,K[1]=ae-(j+w)+(w-pe),me=ne+j,w=me-ne,K[2]=ne-(me-w)+(j-w),K[3]=me;let er=Y(qn,N,4,K,q);ue=v*V,I=P*v,B=I-(I-v),H=v-B,I=P*V,G=I-(I-V),W=V-G,he=H*W-(ue-B*G-H*G-B*W),pe=F*M,I=P*F,B=I-(I-F),H=F-B,I=P*M,G=I-(I-M),W=M-G,ge=H*W-(pe-B*G-H*G-B*W),j=he-ge,w=he-j,K[0]=he-(j+w)+(w-ge),ne=ue+j,w=ne-ue,ae=ue-(ne-w)+(j-w),j=ae-pe,w=ae-j,K[1]=ae-(j+w)+(w-pe),me=ne+j,w=me-ne,K[2]=ne-(me-w)+(j-w),K[3]=me;let tr=Y(er,q,4,K,te);return te[tr-1]}function ee(g,o,u,f,m,h){let S=(o-h)*(u-m),v=(g-m)*(f-h),F=S-v,M=Math.abs(S+v);return Math.abs(F)>=re*M?F:-oe(g,o,u,f,m,h,M)}let J=(g,o)=>g.x*o.y-g.y*o.x,fe=(g,o)=>g.x*o.x+g.y*o.y,be=(g,o,u)=>{let f=ee(g.x,g.y,o.x,o.y,u.x,u.y);return f>0?-1:f<0?1:0},de=g=>Math.sqrt(fe(g,g)),Fe=(g,o,u)=>{let f={x:o.x-g.x,y:o.y-g.y},m={x:u.x-g.x,y:u.y-g.y};return J(m,f)/de(m)/de(f)},Ce=(g,o,u)=>{let f={x:o.x-g.x,y:o.y-g.y},m={x:u.x-g.x,y:u.y-g.y};return fe(m,f)/de(m)/de(f)},Le=(g,o,u)=>o.y===0?null:{x:g.x+o.x/o.y*(u-g.y),y:u},Ve=(g,o,u)=>o.x===0?null:{x:u,y:g.y+o.y/o.x*(u-g.x)},we=(g,o,u,f)=>{if(o.x===0)return Ve(u,f,g.x);if(f.x===0)return Ve(g,o,u.x);if(o.y===0)return Le(u,f,g.y);if(f.y===0)return Le(g,o,u.y);let m=J(o,f);if(m==0)return null;let h={x:u.x-g.x,y:u.y-g.y},S=J(h,o)/m,v=J(h,f)/m,F=g.x+v*o.x,M=u.x+S*f.x,V=g.y+v*o.y,w=u.y+S*f.y,I=(F+M)/2,B=(V+w)/2;return{x:I,y:B}};class se{static compare(o,u){let f=se.comparePoints(o.point,u.point);return f!==0?f:(o.point!==u.point&&o.link(u),o.isLeft!==u.isLeft?o.isLeft?1:-1:xe.compare(o.segment,u.segment))}static comparePoints(o,u){return o.x<u.x?-1:o.x>u.x?1:o.y<u.y?-1:o.y>u.y?1:0}constructor(o,u){o.events===void 0?o.events=[this]:o.events.push(this),this.point=o,this.isLeft=u}link(o){if(o.point===this.point)throw new Error("Tried to link already linked events");let u=o.point.events;for(let f=0,m=u.length;f<m;f++){let h=u[f];this.point.events.push(h),h.point=this.point}this.checkForConsuming()}checkForConsuming(){let o=this.point.events.length;for(let u=0;u<o;u++){let f=this.point.events[u];if(f.segment.consumedBy===void 0)for(let m=u+1;m<o;m++){let h=this.point.events[m];h.consumedBy===void 0&&f.otherSE.point.events===h.otherSE.point.events&&f.segment.consume(h.segment)}}}getAvailableLinkedEvents(){let o=[];for(let u=0,f=this.point.events.length;u<f;u++){let m=this.point.events[u];m!==this&&!m.segment.ringOut&&m.segment.isInResult()&&o.push(m)}return o}getLeftmostComparator(o){let u=new Map,f=m=>{let h=m.otherSE;u.set(m,{sine:Fe(this.point,o.point,h.point),cosine:Ce(this.point,o.point,h.point)})};return(m,h)=>{u.has(m)||f(m),u.has(h)||f(h);let{sine:S,cosine:v}=u.get(m),{sine:F,cosine:M}=u.get(h);return S>=0&&F>=0?v<M?1:v>M?-1:0:S<0&&F<0?v<M?-1:v>M?1:0:F<S?-1:F>S?1:0}}}let Pe=0;class xe{static compare(o,u){let f=o.leftSE.point.x,m=u.leftSE.point.x,h=o.rightSE.point.x,S=u.rightSE.point.x;if(S<f)return 1;if(h<m)return-1;let v=o.leftSE.point.y,F=u.leftSE.point.y,M=o.rightSE.point.y,V=u.rightSE.point.y;if(f<m){if(F<v&&F<M)return 1;if(F>v&&F>M)return-1;let w=o.comparePoint(u.leftSE.point);if(w<0)return 1;if(w>0)return-1;let I=u.comparePoint(o.rightSE.point);return I!==0?I:-1}if(f>m){if(v<F&&v<V)return-1;if(v>F&&v>V)return 1;let w=u.comparePoint(o.leftSE.point);if(w!==0)return w;let I=o.comparePoint(u.rightSE.point);return I<0?1:I>0?-1:1}if(v<F)return-1;if(v>F)return 1;if(h<S){let w=u.comparePoint(o.rightSE.point);if(w!==0)return w}if(h>S){let w=o.comparePoint(u.rightSE.point);if(w<0)return 1;if(w>0)return-1}if(h!==S){let w=M-v,I=h-f,B=V-F,H=S-m;if(w>I&&B<H)return 1;if(w<I&&B>H)return-1}return h>S?1:h<S||M<V?-1:M>V?1:o.id<u.id?-1:o.id>u.id?1:0}constructor(o,u,f,m){this.id=++Pe,this.leftSE=o,o.segment=this,o.otherSE=u,this.rightSE=u,u.segment=this,u.otherSE=o,this.rings=f,this.windings=m}static fromRing(o,u,f){let m,h,S,v=se.comparePoints(o,u);if(v<0)m=o,h=u,S=1;else if(v>0)m=u,h=o,S=-1;else throw new Error(`Tried to create degenerate segment at [${o.x}, ${o.y}]`);let F=new se(m,!0),M=new se(h,!1);return new xe(F,M,[f],[S])}replaceRightSE(o){this.rightSE=o,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}bbox(){let o=this.leftSE.point.y,u=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:o<u?o:u},ur:{x:this.rightSE.point.x,y:o>u?o:u}}}vector(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}isAnEndpoint(o){return o.x===this.leftSE.point.x&&o.y===this.leftSE.point.y||o.x===this.rightSE.point.x&&o.y===this.rightSE.point.y}comparePoint(o){if(this.isAnEndpoint(o))return 0;let u=this.leftSE.point,f=this.rightSE.point,m=this.vector();if(u.x===f.x)return o.x===u.x?0:o.x<u.x?1:-1;let h=(o.y-u.y)/m.y,S=u.x+h*m.x;if(o.x===S)return 0;let v=(o.x-u.x)/m.x,F=u.y+v*m.y;return o.y===F?0:o.y<F?-1:1}getIntersection(o){let u=this.bbox(),f=o.bbox(),m=_(u,f);if(m===null)return null;let h=this.leftSE.point,S=this.rightSE.point,v=o.leftSE.point,F=o.rightSE.point,M=A(u,v)&&this.comparePoint(v)===0,V=A(f,h)&&o.comparePoint(h)===0,w=A(u,F)&&this.comparePoint(F)===0,I=A(f,S)&&o.comparePoint(S)===0;if(V&&M)return I&&!w?S:!I&&w?F:null;if(V)return w&&h.x===F.x&&h.y===F.y?null:h;if(M)return I&&S.x===v.x&&S.y===v.y?null:v;if(I&&w)return null;if(I)return S;if(w)return F;let B=we(h,this.vector(),v,o.vector());return B===null||!A(m,B)?null:D.round(B.x,B.y)}split(o){let u=[],f=o.events!==void 0,m=new se(o,!0),h=new se(o,!1),S=this.rightSE;this.replaceRightSE(h),u.push(h),u.push(m);let v=new xe(m,S,this.rings.slice(),this.windings.slice());return se.comparePoints(v.leftSE.point,v.rightSE.point)>0&&v.swapEvents(),se.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),f&&(m.checkForConsuming(),h.checkForConsuming()),u}swapEvents(){let o=this.rightSE;this.rightSE=this.leftSE,this.leftSE=o,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(let u=0,f=this.windings.length;u<f;u++)this.windings[u]*=-1}consume(o){let u=this,f=o;for(;u.consumedBy;)u=u.consumedBy;for(;f.consumedBy;)f=f.consumedBy;let m=xe.compare(u,f);if(m!==0){if(m>0){let h=u;u=f,f=h}if(u.prev===f){let h=u;u=f,f=h}for(let h=0,S=f.rings.length;h<S;h++){let v=f.rings[h],F=f.windings[h],M=u.rings.indexOf(v);M===-1?(u.rings.push(v),u.windings.push(F)):u.windings[M]+=F}f.rings=null,f.windings=null,f.consumedBy=u,f.leftSE.consumedBy=u.leftSE,f.rightSE.consumedBy=u.rightSE}}prevInResult(){return this._prevInResult!==void 0?this._prevInResult:(this.prev?this.prev.isInResult()?this._prevInResult=this.prev:this._prevInResult=this.prev.prevInResult():this._prevInResult=null,this._prevInResult)}beforeState(){if(this._beforeState!==void 0)return this._beforeState;if(!this.prev)this._beforeState={rings:[],windings:[],multiPolys:[]};else{let o=this.prev.consumedBy||this.prev;this._beforeState=o.afterState()}return this._beforeState}afterState(){if(this._afterState!==void 0)return this._afterState;let o=this.beforeState();this._afterState={rings:o.rings.slice(0),windings:o.windings.slice(0),multiPolys:[]};let u=this._afterState.rings,f=this._afterState.windings,m=this._afterState.multiPolys;for(let v=0,F=this.rings.length;v<F;v++){let M=this.rings[v],V=this.windings[v],w=u.indexOf(M);w===-1?(u.push(M),f.push(V)):f[w]+=V}let h=[],S=[];for(let v=0,F=u.length;v<F;v++){if(f[v]===0)continue;let M=u[v],V=M.poly;if(S.indexOf(V)===-1)if(M.isExterior)h.push(V);else{S.indexOf(V)===-1&&S.push(V);let w=h.indexOf(M.poly);w!==-1&&h.splice(w,1)}}for(let v=0,F=h.length;v<F;v++){let M=h[v].multiPoly;m.indexOf(M)===-1&&m.push(M)}return this._afterState}isInResult(){if(this.consumedBy)return!1;if(this._isInResult!==void 0)return this._isInResult;let o=this.beforeState().multiPolys,u=this.afterState().multiPolys;switch(ve.type){case"union":{let f=o.length===0,m=u.length===0;this._isInResult=f!==m;break}case"intersection":{let f,m;o.length<u.length?(f=o.length,m=u.length):(f=u.length,m=o.length),this._isInResult=m===ve.numMultiPolys&&f<m;break}case"xor":{let f=Math.abs(o.length-u.length);this._isInResult=f%2===1;break}case"difference":{let f=m=>m.length===1&&m[0].isSubject;this._isInResult=f(o)!==f(u);break}default:throw new Error(`Unrecognized operation type found ${ve.type}`)}return this._isInResult}}class Be{constructor(o,u,f){if(!Array.isArray(o)||o.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=u,this.isExterior=f,this.segments=[],typeof o[0][0]!="number"||typeof o[0][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let m=D.round(o[0][0],o[0][1]);this.bbox={ll:{x:m.x,y:m.y},ur:{x:m.x,y:m.y}};let h=m;for(let S=1,v=o.length;S<v;S++){if(typeof o[S][0]!="number"||typeof o[S][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let F=D.round(o[S][0],o[S][1]);F.x===h.x&&F.y===h.y||(this.segments.push(xe.fromRing(h,F,this)),F.x<this.bbox.ll.x&&(this.bbox.ll.x=F.x),F.y<this.bbox.ll.y&&(this.bbox.ll.y=F.y),F.x>this.bbox.ur.x&&(this.bbox.ur.x=F.x),F.y>this.bbox.ur.y&&(this.bbox.ur.y=F.y),h=F)}(m.x!==h.x||m.y!==h.y)&&this.segments.push(xe.fromRing(h,m,this))}getSweepEvents(){let o=[];for(let u=0,f=this.segments.length;u<f;u++){let m=this.segments[u];o.push(m.leftSE),o.push(m.rightSE)}return o}}class Oe{constructor(o,u){if(!Array.isArray(o))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new Be(o[0],this,!0),this.bbox={ll:{x:this.exteriorRing.bbox.ll.x,y:this.exteriorRing.bbox.ll.y},ur:{x:this.exteriorRing.bbox.ur.x,y:this.exteriorRing.bbox.ur.y}},this.interiorRings=[];for(let f=1,m=o.length;f<m;f++){let h=new Be(o[f],this,!1);h.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=h.bbox.ll.x),h.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=h.bbox.ll.y),h.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=h.bbox.ur.x),h.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=h.bbox.ur.y),this.interiorRings.push(h)}this.multiPoly=u}getSweepEvents(){let o=this.exteriorRing.getSweepEvents();for(let u=0,f=this.interiorRings.length;u<f;u++){let m=this.interiorRings[u].getSweepEvents();for(let h=0,S=m.length;h<S;h++)o.push(m[h])}return o}}class De{constructor(o,u){if(!Array.isArray(o))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{typeof o[0][0][0]=="number"&&(o=[o])}catch{}this.polys=[],this.bbox={ll:{x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY},ur:{x:Number.NEGATIVE_INFINITY,y:Number.NEGATIVE_INFINITY}};for(let f=0,m=o.length;f<m;f++){let h=new Oe(o[f],this);h.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=h.bbox.ll.x),h.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=h.bbox.ll.y),h.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=h.bbox.ur.x),h.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=h.bbox.ur.y),this.polys.push(h)}this.isSubject=u}getSweepEvents(){let o=[];for(let u=0,f=this.polys.length;u<f;u++){let m=this.polys[u].getSweepEvents();for(let h=0,S=m.length;h<S;h++)o.push(m[h])}return o}}class Ie{static factory(o){let u=[];for(let f=0,m=o.length;f<m;f++){let h=o[f];if(!h.isInResult()||h.ringOut)continue;let S=null,v=h.leftSE,F=h.rightSE,M=[v],V=v.point,w=[];for(;S=v,v=F,M.push(v),v.point!==V;)for(;;){let I=v.getAvailableLinkedEvents();if(I.length===0){let G=M[0].point,W=M[M.length-1].point;throw new Error(`Unable to complete output ring starting at [${G.x}, ${G.y}]. Last matching segment found ends at [${W.x}, ${W.y}].`)}if(I.length===1){F=I[0].otherSE;break}let B=null;for(let G=0,W=w.length;G<W;G++)if(w[G].point===v.point){B=G;break}if(B!==null){let G=w.splice(B)[0],W=M.splice(G.index);W.unshift(W[0].otherSE),u.push(new Ie(W.reverse()));continue}w.push({index:M.length,point:v.point});let H=v.getLeftmostComparator(S);F=I.sort(H)[0].otherSE;break}u.push(new Ie(M))}return u}constructor(o){this.events=o;for(let u=0,f=o.length;u<f;u++)o[u].segment.ringOut=this;this.poly=null}getGeom(){let o=this.events[0].point,u=[o];for(let M=1,V=this.events.length-1;M<V;M++){let w=this.events[M].point,I=this.events[M+1].point;be(w,o,I)!==0&&(u.push(w),o=w)}if(u.length===1)return null;let f=u[0],m=u[1];be(f,o,m)===0&&u.shift(),u.push(u[0]);let h=this.isExteriorRing()?1:-1,S=this.isExteriorRing()?0:u.length-1,v=this.isExteriorRing()?u.length:-1,F=[];for(let M=S;M!=v;M+=h)F.push([u[M].x,u[M].y]);return F}isExteriorRing(){if(this._isExteriorRing===void 0){let o=this.enclosingRing();this._isExteriorRing=o?!o.isExteriorRing():!0}return this._isExteriorRing}enclosingRing(){return this._enclosingRing===void 0&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}_calcEnclosingRing(){let o=this.events[0];for(let m=1,h=this.events.length;m<h;m++){let S=this.events[m];se.compare(o,S)>0&&(o=S)}let u=o.segment.prevInResult(),f=u?u.prevInResult():null;for(;;){if(!u)return null;if(!f)return u.ringOut;if(f.ringOut!==u.ringOut)return f.ringOut.enclosingRing()!==u.ringOut?u.ringOut:u.ringOut.enclosingRing();u=f.prevInResult(),f=u?u.prevInResult():null}}}class ze{constructor(o){this.exteriorRing=o,o.poly=this,this.interiorRings=[]}addInterior(o){this.interiorRings.push(o),o.poly=this}getGeom(){let o=[this.exteriorRing.getGeom()];if(o[0]===null)return null;for(let u=0,f=this.interiorRings.length;u<f;u++){let m=this.interiorRings[u].getGeom();m!==null&&o.push(m)}return o}}class vt{constructor(o){this.rings=o,this.polys=this._composePolys(o)}getGeom(){let o=[];for(let u=0,f=this.polys.length;u<f;u++){let m=this.polys[u].getGeom();m!==null&&o.push(m)}return o}_composePolys(o){let u=[];for(let f=0,m=o.length;f<m;f++){let h=o[f];if(!h.poly)if(h.isExteriorRing())u.push(new ze(h));else{let S=h.enclosingRing();S.poly||u.push(new ze(S)),S.poly.addInterior(h)}}return u}}class ft{constructor(o){let u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:xe.compare;this.queue=o,this.tree=new a(u),this.segments=[]}process(o){let u=o.segment,f=[];if(o.consumedBy)return o.isLeft?this.queue.remove(o.otherSE):this.tree.remove(u),f;let m=o.isLeft?this.tree.add(u):this.tree.find(u);if(!m)throw new Error(`Unable to find segment #${u.id} [${u.leftSE.point.x}, ${u.leftSE.point.y}] -> [${u.rightSE.point.x}, ${u.rightSE.point.y}] in SweepLine tree.`);let h=m,S=m,v,F;for(;v===void 0;)h=this.tree.prev(h),h===null?v=null:h.key.consumedBy===void 0&&(v=h.key);for(;F===void 0;)S=this.tree.next(S),S===null?F=null:S.key.consumedBy===void 0&&(F=S.key);if(o.isLeft){let M=null;if(v){let w=v.getIntersection(u);if(w!==null&&(u.isAnEndpoint(w)||(M=w),!v.isAnEndpoint(w))){let I=this._splitSafely(v,w);for(let B=0,H=I.length;B<H;B++)f.push(I[B])}}let V=null;if(F){let w=F.getIntersection(u);if(w!==null&&(u.isAnEndpoint(w)||(V=w),!F.isAnEndpoint(w))){let I=this._splitSafely(F,w);for(let B=0,H=I.length;B<H;B++)f.push(I[B])}}if(M!==null||V!==null){let w=null;M===null?w=V:V===null?w=M:w=se.comparePoints(M,V)<=0?M:V,this.queue.remove(u.rightSE),f.push(u.rightSE);let I=u.split(w);for(let B=0,H=I.length;B<H;B++)f.push(I[B])}f.length>0?(this.tree.remove(u),f.push(o)):(this.segments.push(u),u.prev=v)}else{if(v&&F){let M=v.getIntersection(F);if(M!==null){if(!v.isAnEndpoint(M)){let V=this._splitSafely(v,M);for(let w=0,I=V.length;w<I;w++)f.push(V[w])}if(!F.isAnEndpoint(M)){let V=this._splitSafely(F,M);for(let w=0,I=V.length;w<I;w++)f.push(V[w])}}}this.tree.remove(u)}return f}_splitSafely(o,u){this.tree.remove(o);let f=o.rightSE;this.queue.remove(f);let m=o.split(u);return m.push(f),o.consumedBy===void 0&&this.tree.add(o),m}}let Wt=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,Qn=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6;class Kn{run(o,u,f){ve.type=o,D.reset();let m=[new De(u,!0)];for(let w=0,I=f.length;w<I;w++)m.push(new De(f[w],!1));if(ve.numMultiPolys=m.length,ve.type==="difference"){let w=m[0],I=1;for(;I<m.length;)_(m[I].bbox,w.bbox)!==null?I++:m.splice(I,1)}if(ve.type==="intersection")for(let w=0,I=m.length;w<I;w++){let B=m[w];for(let H=w+1,G=m.length;H<G;H++)if(_(B.bbox,m[H].bbox)===null)return[]}let h=new a(se.compare);for(let w=0,I=m.length;w<I;w++){let B=m[w].getSweepEvents();for(let H=0,G=B.length;H<G;H++)if(h.insert(B[H]),h.size>Wt)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big).")}let S=new ft(h),v=h.size,F=h.pop();for(;F;){let w=F.key;if(h.size===v){let B=w.segment;throw new Error(`Unable to pop() ${w.isLeft?"left":"right"} SweepEvent [${w.point.x}, ${w.point.y}] from segment #${B.id} [${B.leftSE.point.x}, ${B.leftSE.point.y}] -> [${B.rightSE.point.x}, ${B.rightSE.point.y}] from queue.`)}if(h.size>Wt)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big).");if(S.segments.length>Qn)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments).");let I=S.process(w);for(let B=0,H=I.length;B<H;B++){let G=I[B];G.consumedBy===void 0&&h.insert(G)}v=h.size,F=h.pop()}D.reset();let M=Ie.factory(S.segments);return new vt(M).getGeom()}}let ve=new Kn;var Jn={union:function(g){for(var o=arguments.length,u=new Array(o>1?o-1:0),f=1;f<o;f++)u[f-1]=arguments[f];return ve.run("union",g,u)},intersection:function(g){for(var o=arguments.length,u=new Array(o>1?o-1:0),f=1;f<o;f++)u[f-1]=arguments[f];return ve.run("intersection",g,u)},xor:function(g){for(var o=arguments.length,u=new Array(o>1?o-1:0),f=1;f<o;f++)u[f-1]=arguments[f];return ve.run("xor",g,u)},difference:function(g){for(var o=arguments.length,u=new Array(o>1?o-1:0),f=1;f<o;f++)u[f-1]=arguments[f];return ve.run("difference",g,u)}};return Jn})});var nt=new Set,St=!1;function Te(t,e,n=2){let r=e&&e.length,i=r?e[0]*n:t.length;nt.size&&nt.clear();let s=en(t,0,i,n,!0),l=[];if(!s||s.next===s.prev)return l;let c=0,a=0,p=0;if(r&&(s=mr(t,e,s,n)),t.length>80*n){c=t[0],a=t[1];let x=c,y=a;for(let d=n;d<i;d+=n){let b=t[d],E=t[d+1];b<c&&(c=b),E<a&&(a=E),b>x&&(x=b),E>y&&(y=E)}p=Math.max(x-c,y-a),p=p!==0?32767/p:0}return Et(s,l,c,a,p),l}function en(t,e,n,r,i){let s=null;if(i===Ir(t,e,n,r)>0)for(let l=e;l<n;l+=r)s=qt(l/r|0,t[l],t[l+1],s);else for(let l=n-r;l>=e;l-=r)s=qt(l/r|0,t[l],t[l+1],s);return s&&rt(s,s.next)&&(ot(s),s=s.next),s}function Ge(t,e=t){let n=e===t,r=t,i;do i=!1,r!==r.next&&(nt.size===0||!nt.has(r))&&(rt(r,r.next)||le(r.prev,r,r.next)===0)?((n||r===e)&&(e=r.prev),St=!0,ot(r),r=r.prev,i=!0):(n||r!==e)&&(r=r.next,i=!n);while(i||r!==e);return e}function Et(t,e,n,r,i){i&&vr(t,n,r,i);let s=t,l=!1;for(;t.prev!==t.next;){let c=t.prev,a=t.next;if(le(c,t,a)<0&&(i?ar(t,n,r,i):fr(t))){e.push(c.i,t.i,a.i),ot(t),t=a,s=a;continue}if(t=a,t===s){if(St=!1,t=Ge(t),St){s=t;continue}if(!l){t=hr(t,e),s=t,l=!0;continue}pr(t,e,n,r,i);break}}}function fr(t){let e=t.prev,n=t,r=t.next,i=e.x,s=n.x,l=r.x,c=e.y,a=n.y,p=r.y,x=Math.min(i,s,l),y=Math.min(c,a,p),d=Math.max(i,s,l),b=Math.max(c,a,p),E=r.next;for(;E!==e;){if(E.x>=x&&E.x<=d&&E.y>=y&&E.y<=b&&!(i===E.x&&c===E.y)&&mt(i,c,s,a,l,p,E.x,E.y)&&le(E.prev,E,E.next)>=0)return!1;E=E.next}return!0}function ar(t,e,n,r){let i=t.prev,s=t,l=t.next,c=i.x,a=s.x,p=l.x,x=i.y,y=s.y,d=l.y,b=Math.min(c,a,p),E=Math.min(x,y,d),A=Math.max(c,a,p),_=Math.max(x,y,d),R=It(b,E,e,n,r),L=It(A,_,e,n,r),k=t.prevZ;for(;k&&k.z>=R;){if(k.x>=b&&k.x<=A&&k.y>=E&&k.y<=_&&k!==l&&!(c===k.x&&x===k.y)&&mt(c,x,a,y,p,d,k.x,k.y)&&le(k.prev,k,k.next)>=0)return!1;k=k.prevZ}let T=t.nextZ;for(;T&&T.z<=L;){if(T.x>=b&&T.x<=A&&T.y>=E&&T.y<=_&&T!==l&&!(c===T.x&&x===T.y)&&mt(c,x,a,y,p,d,T.x,T.y)&&le(T.prev,T,T.next)>=0)return!1;T=T.nextZ}return!0}function hr(t,e){let n=t,r=!1;do{let i=n.prev,s=n.next.next;rn(i,n,n.next,s,!1)&&it(i,s)&&it(s,i)&&(e.push(i.i,n.i,s.i),ot(n),ot(n.next),n=t=s,r=!0),n=n.next}while(n!==t);return r?Ge(n):n}function pr(t,e,n,r,i){let s=t;do{let l=s.next.next;for(;l!==s.prev;){if(s.i!==l.i&&Mr(s,l)){let c=on(s,l);s=Ge(s,s.next),c=Ge(c,c.next),Et(s,e,n,r,i),Et(c,e,n,r,i);return}l=l.next}s=s.next}while(s!==t)}var Mt=!1;function mr(t,e,n,r){let i=[];for(let s=0,l=e.length;s<l;s++){let c=e[s]*r,a=s<l-1?e[s+1]*r:t.length,p=en(t,c,a,r,!1);p===p.next&&nt.add(p),i.push(Er(p))}i.sort(xr),gr(t.length/r,e.length),nn(n,n),Mt=!0;for(let s=0;s<i.length;s++)n=dr(i[s],n);return Mt=!1,Ge(n)}function xr(t,e){return t.x-e.x||t.y-e.y||(t.next.y-t.y)/(t.next.x-t.x)-(e.next.y-e.y)/(e.next.x-e.x)}function dr(t,e){let n=br(t,e);if(!n)return e;let r=on(n,t),i=r.next;return nn(n,i.next),Ge(r,r.next),Ge(n,n.next)}var tn=16,ie=new Float64Array(0),pt=0,Rt=[],Ft=[];function gr(t,e){let n=Math.ceil((t+2*e)/tn)+e+2;ie.length<n*4&&(ie=new Float64Array(n*4)),pt=0}function nn(t,e){let n=t;do{let r=pt++;Rt[r]=n;let i=1/0,s=1/0,l=-1/0,c=-1/0,a=0;do{let x=n.next;n.z=r,n.x<i&&(i=n.x),n.x>l&&(l=n.x),n.y<s&&(s=n.y),n.y>c&&(c=n.y),x.x<i&&(i=x.x),x.x>l&&(l=x.x),x.y<s&&(s=x.y),x.y>c&&(c=x.y),n=x}while(++a<tn&&n!==e);Ft[r]=n;let p=r*4;ie[p]=i,ie[p+1]=s,ie[p+2]=l,ie[p+3]=c}while(n!==e)}function yr(t,e){let n=t.z*4;e.x<ie[n]&&(ie[n]=e.x),e.y<ie[n+1]&&(ie[n+1]=e.y),e.x>ie[n+2]&&(ie[n+2]=e.x),e.y>ie[n+3]&&(ie[n+3]=e.y)}function Kt(t){let e=Ft[t];for(;e.prev.next!==e;)e=e.next;return Ft[t]=e,e}function Jt(t){let e=Rt[t];for(;e.prev.next!==e;)e=e.next;return Rt[t]=e,e}function br(t,e){let n=e,r=t.x,i=t.y,s=-1/0,l;if(rt(t,n))return n;for(let d=0,b=0;d<pt;d++,b+=4){if(i<ie[b+1]||i>ie[b+3]||ie[b]>r||ie[b+2]<=s)continue;let E=Kt(d);n=Jt(d);do{if(n.prev.next===n){if(rt(t,n.next))return n.next;if(i<=n.y&&i>=n.next.y&&n.next.y!==n.y){let A=n.x+(i-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(A<=r&&A>s&&(s=A,l=n.x<n.next.x?n:n.next,A===r))return l}}n=n.next}while(n!==E)}if(!l)return null;let c=l.x,a=l.y,p=Math.min(i,a),x=Math.max(i,a),y=1/0;for(let d=0,b=0;d<pt;d++,b+=4){if(ie[b+2]<c||ie[b]>r||ie[b+3]<p||ie[b+1]>x)continue;let E=Kt(d);n=Jt(d);do{if(n.prev.next===n&&r>=n.x&&n.x>=c&&r!==n.x&&mt(i<a?r:s,i,c,a,i<a?s:r,i,n.x,n.y)){let A=Math.abs(i-n.y)/(r-n.x);(it(n,t)||n.y===i&&n.next.y===i&&n.next.x>r)&&(A<y||A===y&&(n.x>l.x||n.x===l.x&&wr(l,n)))&&(l=n,y=A)}n=n.next}while(n!==E)}return l}function wr(t,e){return le(t.prev,t,e.prev)<0&&le(e.next,t,t.next)<0}var ye=[],qe=[],Ue=new Uint32Array(0),et=new Uint32Array(0),tt=new Uint32Array(256);function vr(t,e,n,r){let i=t,s=0;do i.z=It(i.x,i.y,e,n,r),ye[s++]=i,i=i.next;while(i!==t);Sr(s);let l=null;for(let c=0;c<s;c++){let a=ye[c];a.prevZ=l,l&&(l.nextZ=a),l=a}l.nextZ=null}function Sr(t){if(t<=32){for(let e=1;e<t;e++){let n=ye[e],r=n.z,i=e-1;for(;i>=0&&ye[i].z>r;)ye[i+1]=ye[i],i--;ye[i+1]=n}return}Ue.length<t&&(Ue=new Uint32Array(t),et=new Uint32Array(t),qe=new Array(t));for(let e=0;e<t;e++)Ue[e]=ye[e].z;at(t,ye,Ue,qe,et,0),at(t,qe,et,ye,Ue,8),at(t,ye,Ue,qe,et,16),at(t,qe,et,ye,Ue,24)}function at(t,e,n,r,i,s){tt.fill(0);for(let c=0;c<t;c++)tt[n[c]>>>s&255]++;let l=0;for(let c=0;c<256;c++){let a=tt[c];tt[c]=l,l+=a}for(let c=0;c<t;c++){let a=n[c],p=tt[a>>>s&255]++;r[p]=e[c],i[p]=a}}function It(t,e,n,r,i){return t=(t-n)*i|0,e=(e-r)*i|0,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,t|e<<1}function Er(t){let e=t,n=t;do(e.x<n.x||e.x===n.x&&e.y<n.y)&&(n=e),e=e.next;while(e!==t);return n}function mt(t,e,n,r,i,s,l,c){return(i-l)*(e-c)>=(t-l)*(s-c)&&(t-l)*(r-c)>=(n-l)*(e-c)&&(n-l)*(s-c)>=(i-l)*(r-c)}function Mr(t,e){let n=rt(t,e)&&le(t.prev,t,t.next)>0&&le(e.prev,e,e.next)>0;return t.next.i!==e.i&&(n||it(t,e)&&it(e,t)&&(le(t.prev,t,e.prev)!==0||le(t,e.prev,e)!==0))&&!Rr(t,e)&&(n||Fr(t,e))}function le(t,e,n){return(e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y)}function rt(t,e){return t.x===e.x&&t.y===e.y}function rn(t,e,n,r,i=!0){let s=le(t,e,n),l=le(t,e,r),c=le(n,r,t),a=le(n,r,e);return(s>0&&l<0||s<0&&l>0)&&(c>0&&a<0||c<0&&a>0)?!0:i?!!(s===0&&ht(t,n,e)||l===0&&ht(t,r,e)||c===0&&ht(n,t,r)||a===0&&ht(n,e,r)):!1}function ht(t,e,n){return e.x<=Math.max(t.x,n.x)&&e.x>=Math.min(t.x,n.x)&&e.y<=Math.max(t.y,n.y)&&e.y>=Math.min(t.y,n.y)}function Rr(t,e){let n=Math.min(t.x,e.x),r=Math.max(t.x,e.x),i=Math.min(t.y,e.y),s=Math.max(t.y,e.y),l=t;do{let c=l.next;if(l.x>r&&c.x>r||l.x<n&&c.x<n||l.y>s&&c.y>s||l.y<i&&c.y<i){l=c;continue}if(l.i!==t.i&&c.i!==t.i&&l.i!==e.i&&c.i!==e.i&&rn(l,c,t,e))return!0;l=c}while(l!==t);return!1}function it(t,e){return le(t.prev,t,t.next)<0?le(t,e,t.next)>=0&&le(t,t.prev,e)>=0:le(t,e,t.prev)<0||le(t,t.next,e)<0}function Fr(t,e){let n=t,r=!1,i=(t.x+e.x)/2,s=(t.y+e.y)/2;do{let l=n.next;n.y>s!=l.y>s&&i<(l.x-n.x)*(s-n.y)/(l.y-n.y)+n.x&&(r=!r),n=l}while(n!==t);return r}function on(t,e){let n=Pt(t.i,t.x,t.y),r=Pt(e.i,e.x,e.y),i=t.next,s=e.prev;return t.next=e,e.prev=t,n.next=i,i.prev=n,r.next=n,n.prev=r,s.next=r,r.prev=s,r}function qt(t,e,n,r){let i=Pt(t,e,n);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function ot(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),Mt&&yr(t.prev,t.next)}function Pt(t,e,n){return{i:t,x:e,y:n,prev:null,next:null,z:0,prevZ:null,nextZ:null}}function Ir(t,e,n,r){let i=0;for(let s=e,l=n-r;s<n;s+=r)i+=(t[l]-t[s])*(t[s+1]+t[l+1]),l=s;return i}var sn=23283064365386963e-26,Pr=12,un=typeof TextDecoder>"u"?null:new TextDecoder("utf-8"),kt=0,xt=1,st=2,dt=5,ut=class{constructor(e=new Uint8Array(16)){this.buf=ArrayBuffer.isView(e)?e:new Uint8Array(e),this.dataView=new DataView(this.buf.buffer),this.pos=0,this.type=0,this.length=this.buf.length}readFields(e,n,r=this.length){for(;this.pos<r;){let i=this.readVarint(),s=i>>3,l=this.pos;this.type=i&7,e(s,n,this),this.pos===l&&this.skip(i)}return n}readMessage(e,n){return this.readFields(e,n,this.readVarint()+this.pos)}readFixed32(){let e=this.dataView.getUint32(this.pos,!0);return this.pos+=4,e}readSFixed32(){let e=this.dataView.getInt32(this.pos,!0);return this.pos+=4,e}readFixed64(){let e=this.dataView.getUint32(this.pos,!0)+this.dataView.getUint32(this.pos+4,!0)*4294967296;return this.pos+=8,e}readSFixed64(){let e=this.dataView.getUint32(this.pos,!0)+this.dataView.getInt32(this.pos+4,!0)*4294967296;return this.pos+=8,e}readFloat(){let e=this.dataView.getFloat32(this.pos,!0);return this.pos+=4,e}readDouble(){let e=this.dataView.getFloat64(this.pos,!0);return this.pos+=8,e}readVarint(e){let n=this.buf,r,i;return i=n[this.pos++],r=i&127,i<128||(i=n[this.pos++],r|=(i&127)<<7,i<128)||(i=n[this.pos++],r|=(i&127)<<14,i<128)||(i=n[this.pos++],r|=(i&127)<<21,i<128)?r:(i=n[this.pos],r|=(i&15)<<28,kr(r,e,this))}readVarint64(){return this.readVarint(!0)}readSVarint(){let e=this.readVarint();return e%2===1?(e+1)/-2:e/2}readBoolean(){return!!this.readVarint()}readString(){let e=this.readVarint()+this.pos,n=this.pos;return this.pos=e,e-n>=Pr&&un?un.decode(this.buf.subarray(n,e)):zr(this.buf,n,e)}readBytes(){let e=this.readVarint()+this.pos,n=this.buf.subarray(this.pos,e);return this.pos=e,n}readPackedVarint(e=[],n){let r=this.readPackedEnd();for(;this.pos<r;)e.push(this.readVarint(n));return e}readPackedSVarint(e=[]){let n=this.readPackedEnd();for(;this.pos<n;)e.push(this.readSVarint());return e}readPackedBoolean(e=[]){let n=this.readPackedEnd();for(;this.pos<n;)e.push(this.readBoolean());return e}readPackedFloat(e=[]){let n=this.readPackedEnd();for(;this.pos<n;)e.push(this.readFloat());return e}readPackedDouble(e=[]){let n=this.readPackedEnd();for(;this.pos<n;)e.push(this.readDouble());return e}readPackedFixed32(e=[]){let n=this.readPackedEnd();for(;this.pos<n;)e.push(this.readFixed32());return e}readPackedSFixed32(e=[]){let n=this.readPackedEnd();for(;this.pos<n;)e.push(this.readSFixed32());return e}readPackedFixed64(e=[]){let n=this.readPackedEnd();for(;this.pos<n;)e.push(this.readFixed64());return e}readPackedSFixed64(e=[]){let n=this.readPackedEnd();for(;this.pos<n;)e.push(this.readSFixed64());return e}readPackedEnd(){return this.type===st?this.readVarint()+this.pos:this.pos+1}skip(e){let n=e&7;if(n===kt)for(;this.buf[this.pos++]>127;);else if(n===st)this.pos=this.readVarint()+this.pos;else if(n===dt)this.pos+=4;else if(n===xt)this.pos+=8;else throw new Error(`Unimplemented type: ${n}`)}writeTag(e,n){this.writeVarint(e<<3|n)}realloc(e){let n=this.length||16;for(;n<this.pos+e;)n*=2;if(n!==this.length){let r=new Uint8Array(n);r.set(this.buf),this.buf=r,this.dataView=new DataView(r.buffer),this.length=n}}finish(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)}writeFixed32(e){this.realloc(4),this.dataView.setInt32(this.pos,e,!0),this.pos+=4}writeSFixed32(e){this.realloc(4),this.dataView.setInt32(this.pos,e,!0),this.pos+=4}writeFixed64(e){this.realloc(8),this.dataView.setInt32(this.pos,e&-1,!0),this.dataView.setInt32(this.pos+4,Math.floor(e*sn),!0),this.pos+=8}writeSFixed64(e){this.realloc(8),this.dataView.setInt32(this.pos,e&-1,!0),this.dataView.setInt32(this.pos+4,Math.floor(e*sn),!0),this.pos+=8}writeVarint(e){if(e=+e||0,e>268435455||e<0){_r(e,this);return}this.realloc(4),this.buf[this.pos++]=e&127|(e>127?128:0),!(e<=127)&&(this.buf[this.pos++]=(e>>>=7)&127|(e>127?128:0),!(e<=127)&&(this.buf[this.pos++]=(e>>>=7)&127|(e>127?128:0),!(e<=127)&&(this.buf[this.pos++]=e>>>7&127)))}writeSVarint(e){this.writeVarint(e<0?-e*2-1:e*2)}writeBoolean(e){this.writeVarint(+e)}writeString(e){e=String(e),this.realloc(e.length*4),this.pos++;let n=this.pos;this.pos=Hr(this.buf,e,this.pos);let r=this.pos-n;r>=128&&ln(n,r,this),this.pos=n-1,this.writeVarint(r),this.pos+=r}writeFloat(e){this.realloc(4),this.dataView.setFloat32(this.pos,e,!0),this.pos+=4}writeDouble(e){this.realloc(8),this.dataView.setFloat64(this.pos,e,!0),this.pos+=8}writeBytes(e){let n=e.length;this.writeVarint(n),this.realloc(n);for(let r=0;r<n;r++)this.buf[this.pos++]=e[r]}writeRawMessage(e,n){this.pos++;let r=this.pos;e(n,this);let i=this.pos-r;i>=128&&ln(r,i,this),this.pos=r-1,this.writeVarint(i),this.pos+=i}writeMessage(e,n,r){this.writeTag(e,st),this.writeRawMessage(n,r)}writePackedVarint(e,n){n.length&&this.writeMessage(e,Br,n)}writePackedSVarint(e,n){n.length&&this.writeMessage(e,Tr,n)}writePackedBoolean(e,n){n.length&&this.writeMessage(e,Or,n)}writePackedFloat(e,n){n.length&&this.writeMessage(e,Cr,n)}writePackedDouble(e,n){n.length&&this.writeMessage(e,Vr,n)}writePackedFixed32(e,n){n.length&&this.writeMessage(e,Dr,n)}writePackedSFixed32(e,n){n.length&&this.writeMessage(e,Ur,n)}writePackedFixed64(e,n){n.length&&this.writeMessage(e,Gr,n)}writePackedSFixed64(e,n){n.length&&this.writeMessage(e,Nr,n)}writeBytesField(e,n){this.writeTag(e,st),this.writeBytes(n)}writeFixed32Field(e,n){this.writeTag(e,dt),this.writeFixed32(n)}writeSFixed32Field(e,n){this.writeTag(e,dt),this.writeSFixed32(n)}writeFixed64Field(e,n){this.writeTag(e,xt),this.writeFixed64(n)}writeSFixed64Field(e,n){this.writeTag(e,xt),this.writeSFixed64(n)}writeVarintField(e,n){this.writeTag(e,kt),this.writeVarint(n)}writeSVarintField(e,n){this.writeTag(e,kt),this.writeSVarint(n)}writeStringField(e,n){this.writeTag(e,st),this.writeString(n)}writeFloatField(e,n){this.writeTag(e,dt),this.writeFloat(n)}writeDoubleField(e,n){this.writeTag(e,xt),this.writeDouble(n)}writeBooleanField(e,n){this.writeVarintField(e,+n)}};function kr(t,e,n){let r=n.buf,i,s;if(s=r[n.pos++],i=(s&112)>>4,s<128||(s=r[n.pos++],i|=(s&127)<<3,s<128)||(s=r[n.pos++],i|=(s&127)<<10,s<128)||(s=r[n.pos++],i|=(s&127)<<17,s<128)||(s=r[n.pos++],i|=(s&127)<<24,s<128)||(s=r[n.pos++],i|=(s&1)<<31,s<128))return He(t,i,e);throw new Error("Expected varint not more than 10 bytes")}function He(t,e,n){return n?e*4294967296+(t>>>0):(e>>>0)*4294967296+(t>>>0)}function _r(t,e){let n,r;if(t>=0?(n=t%4294967296|0,r=t/4294967296|0):(n=~(-t%4294967296),r=~(-t/4294967296),n^4294967295?n=n+1|0:(n=0,r=r+1|0)),t>=18446744073709552e3||t<-18446744073709552e3)throw new Error("Given varint doesn\'t fit into 10 bytes");e.realloc(10),Ar(n,r,e),Lr(r,e)}function Ar(t,e,n){n.buf[n.pos++]=t&127|128,t>>>=7,n.buf[n.pos++]=t&127|128,t>>>=7,n.buf[n.pos++]=t&127|128,t>>>=7,n.buf[n.pos++]=t&127|128,t>>>=7,n.buf[n.pos]=t&127}function Lr(t,e){let n=(t&7)<<4;e.buf[e.pos++]|=n|((t>>>=3)?128:0),t&&(e.buf[e.pos++]=t&127|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=t&127|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=t&127|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=t&127|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=t&127)))))}function ln(t,e,n){let r=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(Math.LN2*7));n.realloc(r);for(let i=n.pos-1;i>=t;i--)n.buf[i+r]=n.buf[i]}function Br(t,e){for(let n=0;n<t.length;n++)e.writeVarint(t[n])}function Tr(t,e){for(let n=0;n<t.length;n++)e.writeSVarint(t[n])}function Cr(t,e){for(let n=0;n<t.length;n++)e.writeFloat(t[n])}function Vr(t,e){for(let n=0;n<t.length;n++)e.writeDouble(t[n])}function Or(t,e){for(let n=0;n<t.length;n++)e.writeBoolean(t[n])}function Dr(t,e){for(let n=0;n<t.length;n++)e.writeFixed32(t[n])}function Ur(t,e){for(let n=0;n<t.length;n++)e.writeSFixed32(t[n])}function Gr(t,e){for(let n=0;n<t.length;n++)e.writeFixed64(t[n])}function Nr(t,e){for(let n=0;n<t.length;n++)e.writeSFixed64(t[n])}function zr(t,e,n){let r="",i=e;for(;i<n;){let s=t[i],l=null,c=s>239?4:s>223?3:s>191?2:1;if(i+c>n)break;let a,p,x;c===1?s<128&&(l=s):c===2?(a=t[i+1],(a&192)===128&&(l=(s&31)<<6|a&63,l<=127&&(l=null))):c===3?(a=t[i+1],p=t[i+2],(a&192)===128&&(p&192)===128&&(l=(s&15)<<12|(a&63)<<6|p&63,(l<=2047||l>=55296&&l<=57343)&&(l=null))):c===4&&(a=t[i+1],p=t[i+2],x=t[i+3],(a&192)===128&&(p&192)===128&&(x&192)===128&&(l=(s&15)<<18|(a&63)<<12|(p&63)<<6|x&63,(l<=65535||l>=1114112)&&(l=null))),l===null?(l=65533,c=1):l>65535&&(l-=65536,r+=String.fromCharCode(l>>>10&1023|55296),l=56320|l&1023),r+=String.fromCharCode(l),i+=c}return r}function Hr(t,e,n){for(let r=0,i,s;r<e.length;r++){if(i=e.charCodeAt(r),i>55295&&i<57344)if(s)if(i<56320){t[n++]=239,t[n++]=191,t[n++]=189,s=i;continue}else i=s-55296<<10|i-56320|65536,s=null;else{i>56319||r+1===e.length?(t[n++]=239,t[n++]=191,t[n++]=189):s=i;continue}else s&&(t[n++]=239,t[n++]=191,t[n++]=189,s=null);i<128?t[n++]=i:(i<2048?t[n++]=i>>6|192:(i<65536?t[n++]=i>>12|224:(t[n++]=i>>18|240,t[n++]=i>>12&63|128),t[n++]=i>>6&63|128),t[n++]=i&63|128)}return n}var _t=class t{constructor(e,n,r,i){this.pbf=e;this.keys=n;this.values=r;this.extent=i;this.type=0;this.properties={};this.geomOffset=-1}static read(e,n,r,i,s){let l=new t(e,r,i,s);return e.readFields($r,l,n),l}loadGeometry(){if(this.geomOffset<0)return[];let e=this.pbf,n=e.pos;e.pos=this.geomOffset;let r=e.readVarint()+e.pos,i=1,s=0,l=0,c=0,a=[],p=[];for(;e.pos<r;){if(s<=0){let x=e.readVarint();i=x&7,s=x>>3}if(s--,i===1||i===2)l+=e.readSVarint(),c+=e.readSVarint(),i===1&&(p.length&&a.push(p),p=[]),p.push(l,c);else if(i===7)p.length>=2&&p.push(p[0],p[1]);else throw new Error(`[osmgl] \\u043D\\u0435\\u0438\\u0437\\u0432\\u0435\\u0441\\u0442\\u043D\\u0430\\u044F \\u043A\\u043E\\u043C\\u0430\\u043D\\u0434\\u0430 \\u0433\\u0435\\u043E\\u043C\\u0435\\u0442\\u0440\\u0438\\u0438 MVT: ${i}`)}return p.length&&a.push(p),e.pos=n,a}bbox(){let e=this.loadGeometry(),n=1/0,r=1/0,i=-1/0,s=-1/0;for(let l of e)for(let c=0;c<l.length;c+=2)l[c]<n&&(n=l[c]),l[c]>i&&(i=l[c]),l[c+1]<r&&(r=l[c+1]),l[c+1]>s&&(s=l[c+1]);return[n,r,i,s]}};function $r(t,e,n){n&&(t===1?e.id=n.readVarint():t===2?jr(n,e):t===3?e.type=n.readVarint():t===4&&(e.geomOffset=n.pos,n.skip(2)))}function jr(t,e){let n=t.readVarint()+t.pos;for(;t.pos<n;){let r=e.keys[t.readVarint()],i=e.values[t.readVarint()];r!==void 0&&(e.properties[r]=i)}}var At=class t{constructor(e){this.pbf=e;this.version=1;this.name="";this.extent=4096;this.featureOffsets=[];this.keys=[];this.values=[]}static read(e,n){let r=new t(e);return e.readFields(Xr,r,n),r}get length(){return this.featureOffsets.length}feature(e){let n=this.pbf;n.pos=this.featureOffsets[e];let r=n.readVarint()+n.pos;return _t.read(n,r,this.keys,this.values,this.extent)}*features(){for(let e=0;e<this.featureOffsets.length;e++)yield this.feature(e)}};function Xr(t,e,n){n&&(t===15?e.version=n.readVarint():t===1?e.name=n.readString():t===5?e.extent=n.readVarint():t===2?e.featureOffsets.push(n.pos):t===3?e.keys.push(n.readString()):t===4&&e.values.push(Yr(n)))}function Yr(t){let e=t.readVarint()+t.pos,n=null;for(;t.pos<e;){let r=t.readVarint()>>3;r===1?n=t.readString():r===2?n=t.readFloat():r===3?n=t.readDouble():r===4?n=t.readVarint64():r===5?n=t.readVarint():r===6?n=t.readSVarint():r===7?n=t.readBoolean():t.skip(r)}return n}var gt=class{constructor(e){this.layers={};new ut(e instanceof Uint8Array?e:new Uint8Array(e)).readFields((r,i,s)=>{if(r===3&&s){let l=At.read(s,s.readVarint()+s.pos);l.length&&(this.layers[l.name]=l)}},null)}};function $e(t){let e=[],n=null;for(let r of t){if(r.length<6)continue;let i=Zr(r);i!==0&&(i>0?(n&&e.push(n),n={outer:r,holes:[]}):n&&n.holes.push(r))}return n&&e.push(n),e}function Zr(t){let e=0;for(let n=0,r=t.length-2;n<t.length;r=n,n+=2)e+=(t[r]-t[n])*(t[n+1]+t[r+1]);return e/2}function ce(t,e){if(!t)return!0;let n=t[0];switch(n){case"all":return t.slice(1).every(r=>ce(r,e));case"any":return t.slice(1).some(r=>ce(r,e));case"!":return!ce(t[1],e);case"has":return e[t[1]]!=null;case"!has":return e[t[1]]==null;case"in":{let r=e[t[1]];return r==null?!1:t.slice(2).includes(r)}case"!in":{let r=e[t[1]];return r==null?!0:!t.slice(2).includes(r)}default:{let r=e[t[1]],i=t[2];if(r==null)return n==="!=";switch(n){case"==":return r===i;case"!=":return r!==i;case">":return r>i;case">=":return r>=i;case"<":return r<i;case"<=":return r<=i;default:return!0}}}}var Wr=Math.PI/8,Qr=.35,Kr=32,cn=.25,fn=.07;function _e(t,e){let n=e.radius;if(!(n>0))return t;let r=t.length/2-1;if(r<3)return t;let i=Math.max(2,Math.round(e.segments??4)),s=Math.max(e.minCutRatio??Qr,0),l=e.extent,c=e.margin??0,a=[];for(let p=0;p<r;p++){let x=t[p*2],y=t[p*2+1],d=t[(p+r-1)%r*2],b=t[(p+r-1)%r*2+1],E=t[(p+1)%r*2],A=t[(p+1)%r*2+1],_=x-d,R=y-b,L=E-x,k=A-y,T=Math.hypot(_,R),O=Math.hypot(L,k);if(T<1e-6||O<1e-6){a.push(x,y);continue}let D=_/T,U=R/T,P=L/O,C=k/O;if(e.keep?.[p]){a.push(x,y);continue}let Y=D*P+U*C;if(Y>.985){a.push(x,y);continue}if(l!==void 0&&(Lt(x,y,l,c)||Lt(d,b,l,c)||Lt(E,A,l,c))){a.push(x,y);continue}let Q=Math.min(n,T*.4,O*.4);if(Q<n*s){a.push(x,y);continue}let Z=x-D*Q,re=y-U*Q,X=x+P*Q,$=y+C*Q,z=Math.acos(Math.max(-1,Math.min(1,Y))),N=Math.min(Wr,Math.PI/2/i),q=Math.ceil(z/N-1e-6),te=e.maxChord&&e.maxChord>0?Math.ceil(Q/Math.tan(z/2)*z/e.maxChord):0,K=Math.max(1,Math.min(Kr,Math.max(Math.min(i,q),te)));a.push(Z,re);for(let oe=1;oe<K;oe++){let ee=oe/K,J=1-ee;a.push(J*J*Z+2*J*ee*x+ee*ee*X,J*J*re+2*J*ee*y+ee*ee*$)}a.push(X,$)}return a.length<6?t:(a.push(a[0],a[1]),a)}var Lt=(t,e,n,r)=>t<=-r||e<=-r||t>=n+r||e>=n+r;var Ae=t=>t/64;function je(t,e,n=0){let r=an(t.outer,e,n);if(!r)return null;let i=[];for(let s of t.holes){let l=an(s,e,n);l&&i.push(l)}return{outer:r,holes:i}}function an(t,e,n){let r=[];for(let i=0;i<t.length-2;i+=2)r.push(t[i],t[i+1]);if(r.length<6)return null;for(let i=0;i<4;i++){let s=r;r=[];let l=s.length/2;if(l===0)return null;for(let c=0;c<l;c++){let a=s[c*2],p=s[c*2+1],x=s[(c+l-1)%l*2],y=s[(c+l-1)%l*2+1],d=hn(a,p,i,e,n),b=hn(x,y,i,e,n);if(d!==b){let E=Jr(x,y,a,p,i,e,n);r.push(x+(a-x)*E,y+(p-y)*E)}d&&r.push(a,p)}}return r.length<6?null:(r.push(r[0],r[1]),r)}function hn(t,e,n,r,i){return n===0?t>=-i:n===1?t<=r+i:n===2?e>=-i:e<=r+i}function Jr(t,e,n,r,i,s,l){return i===0?(-l-t)/(n-t):i===1?(s+l-t)/(n-t):i===2?(-l-e)/(r-e):(s+l-e)/(r-e)}function yt(t,e,n,r,i,s=0){let l=-s,c=i+s;return t===l&&n===l||t===c&&n===c||e===l&&r===l||e===c&&r===c}function pn(t,e){for(let n=0;n<t.length;n+=2)if(t[n]<=0||t[n]>=e||t[n+1]<=0||t[n+1]>=e)return!0;return!1}var Ct=18,Vt=4,yn=65535/Vt,qr=9,ei=1,ti=0,ni=1,ri=2;var mn=0,ii=1,xn=2,oi=3,si=.47;function bn(t,e,n,r={}){let i=r.metersPerUnit&&r.metersPerUnit>0?r.metersPerUnit:si,s=Math.max(1024,t.length*48),l=new ArrayBuffer(s*Ct),c={verts:new DataView(l),vertsU8:new Uint8Array(l),vertOffset:0,vertexCount:0,indices:[],featureIds:[],ensure:()=>{}};c.ensure=d=>a(d);let a=d=>{if(c.vertexCount+d<=s)return;s=Math.max(s*2,c.vertexCount+d);let b=new ArrayBuffer(s*Ct);new Uint8Array(b).set(c.vertsU8.subarray(0,c.vertOffset)),l=b,c.verts=new DataView(b),c.vertsU8=new Uint8Array(b)};for(let d of t.features()){if(d.type!==3||!ce(n,d.properties))continue;let b=Ii(d.properties),E=Pi(d.properties,b);if(b<=E)continue;let A=_i(d.properties)??Number(d.id??0),_=Fi(A>>>0),R=Ri(_,d.properties),L=Mi(d.properties,b),k=$e(d.loadGeometry());for(let T of k){let O=je(T,e);if(!O)continue;let D=pn(O.outer,e),U=(r.cornerRadius??0)/i,P={radius:U,segments:r.cornerSegments,extent:e,minCutRatio:0},C=U>0?{outer:_e(O.outer,P),holes:O.holes.map($=>_e($,P))}:O,Y=C.outer.length/2+C.holes.reduce(($,z)=>$+z.length/2,0);a(Y*5+32);let Q=C.holes.length||D?null:fi(C.outer),Z=Q?di(d.properties,Q,b,_,i):null,re=null,X=[];if(Z&&Q){let $=wn(bi(C.outer,i),Q,Z.shape);X=wi($,C.outer);let z=vi($,X);if(z>1e-6){let N=Math.min(Math.max(z*i*pi,xi),mi);re=Si($,N/z,b)}}dn(c,C.outer,E,b,A,R,L,i,e,re);for(let $ of C.holes)dn(c,$,E,b,A,R,L,i,e,null);re?Ei(c,X,re,b,A,R,L,i):ci(c,C.outer,C.holes,b,A,R,L)}}if(!c.indices.length)return null;let p=new Uint32Array(c.indices),x=new Float64Array(c.featureIds);return{vertices:l.slice(0,c.vertOffset),indices:p.buffer,featureIds:x.buffer,vertexCount:c.vertexCount,indexCount:p.length,extent:e}}var Ot=(t,e)=>t|e<<2,Bt=t=>Math.max(0,Math.min(65535,Math.round(Math.min(t,yn)*Vt)));function Xe(t,e,n,r,i,s,l,c,a,p,x=0,y=0,d=0){let b=t.vertOffset;return t.verts.setInt16(b,Math.round(e),!0),t.verts.setInt16(b+2,Math.round(n),!0),t.verts.setUint16(b+4,Math.round(Math.min(r,yn)*Vt),!0),t.vertsU8[b+6]=a,t.vertsU8[b+7]=c,t.verts.setInt8(b+8,Tt(Math.round(i*127))),t.verts.setInt8(b+9,Tt(Math.round(s*127))),t.verts.setInt8(b+10,Tt(Math.round(l*127))),t.vertsU8[b+11]=p,t.verts.setUint16(b+12,Bt(x),!0),t.verts.setUint16(b+14,Bt(y),!0),t.verts.setUint16(b+16,Bt(d),!0),t.vertOffset+=Ct,t.vertexCount++}function dn(t,e,n,r,i,s,l,c,a,p=null){let x=e.length/2;if(x<3)return;let y=Ot(ti,l),d=li(e,c),b=r-n,E=new Float64Array(x*2),A=new Uint8Array(x);{let _=new Float64Array(x*2);for(let R=0;R<x-1;R++){let L=e[R*2+2]-e[R*2],k=e[R*2+3]-e[R*2+1],T=Math.hypot(L,k)||1;_[R*2]=k/T,_[R*2+1]=-L/T}for(let R=0;R<x-1;R++){let L=(R+x-2)%(x-1),k=_[L*2]*_[R*2]+_[L*2+1]*_[R*2+1],T=_[L*2]+_[R*2],O=_[L*2+1]+_[R*2+1],D=Math.hypot(T,O);k>.5&&D>1e-6&&(E[R*2]=T/D,E[R*2+1]=O/D,A[R]=1)}}for(let _=0;_<x-1;_++){let R=e[_*2],L=e[_*2+1],k=e[_*2+2],T=e[_*2+3];if(R===k&&L===T||yt(R,L,k,T,a))continue;let O=k-R,D=T-L,U=Math.hypot(O,D)||1,P=D/U,C=-O/U,Y=d.offset[_],Q=d.width[_],Z=[0,1];if(p){for(let X=0;X<p.length;X++)for(let $=X+1;$<p.length;$++){let z=Ne(p[X],R,L)-Ne(p[$],R,L),N=Ne(p[X],k,T)-Ne(p[$],k,T);if(z===N)continue;let q=z/(z-N);q>1e-4&&q<1-1e-4&&Z.push(q)}Z.sort((X,$)=>X-$)}let re=(X,$)=>{if(!p)return r;let z=1/0;for(let N of p)z=Math.min(z,Ne(N,X,$));return Math.max(r,z)};for(let X=0;X+1<Z.length;X++){let $=Z[X],z=Z[X+1];if(z-$<1e-6)continue;let N=R+O*$,q=L+D*$,te=R+O*z,K=L+D*z,oe=Y+U*$*c,ee=Y+U*z*c,J=(_+1)%(x-1),fe=A[_]?E[_*2]:P,be=A[_]?E[_*2+1]:C,de=A[J]?E[J*2]:P,Fe=A[J]?E[J*2+1]:C,Ce=P+(fe-P)*(1-$),Le=C+(be-C)*(1-$),Ve=P+(de-P)*z,we=C+(Fe-C)*z,se=Math.hypot(Ce,Le)||1,Pe=Math.hypot(Ve,we)||1,xe=Ce/se,Be=Le/se,Oe=Ve/Pe,De=we/Pe;t.ensure(4);let Ie=Xe(t,N,q,n,xe,Be,0,0,s,y,oe,Q,b),ze=Xe(t,te,K,n,Oe,De,0,0,s,y,ee,Q,b),vt=Xe(t,N,q,re(N,q),xe,Be,0,255,s,y,oe,Q,b),ft=Xe(t,te,K,re(te,K),Oe,De,0,255,s,y,ee,Q,b);t.indices.push(Ie,ft,ze,Ie,vt,ft),t.featureIds.push(i,i)}}}var ui=.9976;function li(t,e){let n=t.length/2-1,r=[];for(let a=0;a<n;a++){let p=t[a*2+2]-t[a*2],x=t[a*2+3]-t[a*2+1],y=Math.hypot(p,x);r.push(y>0?{x:p/y,y:x/y,len:y*e}:{x:0,y:0,len:0})}let i=(a,p)=>r[a].len>0&&r[p].len>0&&r[a].x*r[p].x+r[a].y*r[p].y>=ui,s=0;for(;s<n&&i((s-1+n)%n,s);)s++;s>=n&&(s=0);let l=new Array(n).fill(0),c=new Array(n).fill(0);for(let a=0;a<n;){let p=(s+a)%n,x=[p],y=r[p].len,d=a+1;for(;d<n;){let E=(s+d)%n;if(!i((s+d-1)%n,E))break;x.push(E),y+=r[E].len,d++}let b=0;for(let E of x)l[E]=b,c[E]=y,b+=r[E].len;a=d}return{offset:l,width:c}}function ci(t,e,n,r,i,s,l){let c=[],a=[];for(let d=0;d<e.length;d++)c.push(e[d]);for(let d of n){a.push(c.length/2);for(let b=0;b<d.length;b++)c.push(d[b])}let p=Te(c,a.length?a:void 0,2);if(!p.length)return;let x=Ot(ni,l),y=t.vertexCount;for(let d=0;d<c.length;d+=2)Xe(t,c[d],c[d+1],r,0,0,1,255,s,x);for(let d=0;d<p.length;d+=3)t.indices.push(y+p[d],y+p[d+2],y+p[d+1]),t.featureIds.push(i)}function fi(t){let e=ai(t);if(e.length<3)return null;let n=Math.abs(hi(t));if(n<=0)return null;let r=null,i=1/0;for(let s=0;s<e.length;s++){let l=(s+1)%e.length,c=e[l].x-e[s].x,a=e[l].y-e[s].y,p=Math.hypot(c,a);if(p<1e-6)continue;c/=p,a/=p;let x=1/0,y=-1/0,d=1/0,b=-1/0;for(let T of e){let O=T.x*c+T.y*a,D=-T.x*a+T.y*c;O<x&&(x=O),O>y&&(y=O),D<d&&(d=D),D>b&&(b=D)}let E=y-x,A=b-d,_=E*A;if(_<=0||_>=i)continue;i=_;let R=(x+y)/2,L=(d+b)/2,k=E>=A;r={cx:R*c-L*a,cy:R*a+L*c,ax:k?c:-a,ay:k?a:c,halfLong:(k?E:A)/2,halfShort:(k?A:E)/2,fill:n/_}}return r}function ai(t){let e=[];for(let s=0;s<t.length-2;s+=2)e.push({x:t[s],y:t[s+1]});if(e.length<3)return e;e.sort((s,l)=>s.x===l.x?s.y-l.y:s.x-l.x);let n=(s,l,c)=>(l.x-s.x)*(c.y-s.y)-(l.y-s.y)*(c.x-s.x),r=[];for(let s of e){for(;r.length>=2&&n(r[r.length-2],r[r.length-1],s)<=0;)r.pop();r.push(s)}let i=[];for(let s=e.length-1;s>=0;s--){let l=e[s];for(;i.length>=2&&n(i[i.length-2],i[i.length-1],l)<=0;)i.pop();i.push(l)}return r.pop(),i.pop(),r.concat(i)}function hi(t){let e=0;for(let n=0;n<t.length-2;n+=2)e+=t[n]*t[n+3]-t[n+2]*t[n+1];return e/2}var pi=Math.tan(30*Math.PI/180),mi=3.5,xi=.9;function di(t,e,n,r,i){if(e.fill<.86)return null;let s=e.halfShort*2*i,l=e.halfLong*2*i,c=s*l,a=e.halfShort>0?e.halfLong/e.halfShort:99,p=gi(t);if(!p){if(n>15||c>600||s<3)return null;let x=r%1e3/1e3;c<30?p=x<.5?"skillion":"gabled":a<1.25?p=x<.35?"pyramidal":"hipped":p=x<.8?"gabled":"hipped"}return p==="flat"?null:{shape:p}}function gi(t){let e=String(t.roof_shape??t["roof:shape"]??"").toLowerCase();return e?e==="flat"?"flat":e==="skillion"||e==="lean_to"||e==="shed"?"skillion":e==="hipped"||e==="half-hipped"||e==="gambrel"?"hipped":e==="pyramidal"||e==="dome"||e==="conical"||e==="onion"?"pyramidal":e==="gabled"||e==="mansard"||e==="round"?"gabled":null:null}var Ne=(t,e,n)=>t.a*e+t.b*n+t.c;function yi(t,e,n,r){let i=t.length/2;if(i<3)return[];let s=[],l=c=>[t[c*2],t[c*2+1]];for(let c=0;c<i;c++){let[a,p]=l(c),[x,y]=l((c+i-1)%i),d=e*a+n*p+r,b=e*x+n*y+r;if(d<=0!=b<=0){let E=b/(b-d);s.push(x+(a-x)*E,y+(p-y)*E)}d<=0&&s.push(a,p)}return s}function bi(t,e){let n=.5/Math.max(e,1e-6),r=t.length/2-1;if(r<5)return t;let i=[],s=0;i.push(t[0],t[1]);for(let l=1;l<r;l++){let c=t[s*2],a=t[s*2+1],p=t[l*2],x=t[l*2+1],y=p-c,d=x-a,b=Math.hypot(y,d),E=b>1e-6;if(E){for(let A=s+1;A<l;A++)if(Math.abs((t[A*2]-c)*d-(t[A*2+1]-a)*y)/b>=n){E=!1;break}}E||(i.push(t[(l-1)*2],t[(l-1)*2+1]),s=l-1)}return i.length/2<3?t:(i.push(i[0],i[1]),i)}function wn(t,e,n){let{ax:r,ay:i,halfLong:s}=e;if(n==="skillion"){let a=-i,p=r;return[{a,b:p,c:-(a*e.cx+p*e.cy)+e.halfShort}]}let l=[],c=t.length/2-1;for(let a=0;a<c;a++){let p=t[a*2],x=t[a*2+1],y=t[(a+1)%c*2],d=t[(a+1)%c*2+1],b=y-p,E=d-x,A=Math.hypot(b,E);if(A<1e-6||n==="gabled"&&Math.abs((b*r+E*i)/A)<.86)continue;let _=-E/A,R=b/A;l.push({a:_,b:R,c:-(_*p+R*x)})}return!l.length&&s>0?wn(t,e,"hipped"):l}function wi(t,e){let n=[];for(let i=0;i<e.length-2;i+=2)n.push(e[i],e[i+1]);if(n.length<6)return[];let r=[];for(let i=0;i<t.length;i++){let s=n;for(let l=0;l<t.length&&s.length>=6;l++)l!==i&&(s=yi(s,t[i].a-t[l].a,t[i].b-t[l].b,t[i].c-t[l].c));r.push(s.length>=6?s:[])}return r}function vi(t,e){let n=0;for(let r=0;r<e.length;r++){let i=e[r];for(let s=0;s<i.length;s+=2){let l=Ne(t[r],i[s],i[s+1]);l>n&&(n=l)}}return n}function Si(t,e,n){return t.map(r=>({a:r.a*e,b:r.b*e,c:r.c*e+n}))}function Ei(t,e,n,r,i,s,l,c){let a=Ot(ri,l);for(let p=0;p<n.length;p++){let x=e[p];if(!x||x.length<6)continue;let y=Te(x,void 0,2);if(!y.length)continue;let d=-n[p].a/c,b=-n[p].b/c,E=Math.hypot(d,b,1),A={x:d/E,y:b/E,z:1/E};t.ensure(x.length/2);let _=t.vertexCount;for(let R=0;R<x.length;R+=2){let L=Math.max(r,Ne(n[p],x[R],x[R+1]));Xe(t,x[R],x[R+1],L,A.x,A.y,A.z,255,s,a)}for(let R=0;R<y.length;R+=3)t.indices.push(_+y[R],_+y[R+2],_+y[R+1]),t.featureIds.push(i)}}function Mi(t,e){let n=String(t.class??"").toLowerCase();return n==="industrial"||n==="warehouse"||n==="hangar"||n==="construction"?oi:n==="commercial"||n==="office"||n==="retail"||n==="supermarket"?xn:n==="house"||n==="detached"||n==="garage"||n==="hut"||n==="shed"||e<=7?mn:e>=40?xn:ii}function Ri(t,e){let n=String(e.class??""),r=128;return n==="industrial"||n==="warehouse"||n==="construction"?r=96:n==="commercial"||n==="office"||n==="retail"?r=150:(n==="apartments"||n==="residential"||n==="house")&&(r=134),Math.max(0,Math.min(255,r+(t%121-60)))}function Fi(t){let e=t>>>0;return e=(e>>>16^e)*73244475,e=(e>>>16^e)*73244475,e=e>>>16^e,e>>>0}function Ii(t){let e=Ye(t.render_height)??Ye(t.height)??ki(t.levels??t.building_levels??t["building:levels"]);return e&&e>0?Math.max(e,ei):qr}function Pi(t,e){let n=Ye(t.render_min_height)??Ye(t.min_height)??Ye(t.base)??0;return n>0&&n<e?n:0}function ki(t){let e=Ye(t);return e&&e>0?e*3:null}function Ye(t){if(typeof t=="number"&&isFinite(t))return t;if(typeof t=="string"){let e=parseFloat(t);if(isFinite(e))return e}return null}var Tt=t=>t>127?127:t<-127?-127:t;function _i(t){let e=t.osm_id;if(typeof e=="number"&&Number.isFinite(e))return e;if(typeof e=="string"){let n=Number(e);if(Number.isFinite(n))return n}return null}function Ai(t,e,n,r,i){let s=r*r,l=[],c=x=>t[x*2],a=x=>t[x*2+1],p=(x,y)=>{let d=t.length/2;return t.push((c(x)+c(y))/2,(a(x)+a(y))/2),d};for(let x=0;x<e.length;x+=3){l.push([n+e[x],n+e[x+1],n+e[x+2]]);let y=0;for(;l.length&&!(++y>2e4);){let[d,b,E]=l.pop(),A=(c(d)-c(b))**2+(a(d)-a(b))**2,_=(c(b)-c(E))**2+(a(b)-a(E))**2,R=(c(E)-c(d))**2+(a(E)-a(d))**2,L=Math.max(A,_,R);if(L<=s){i.push(d,b,E);continue}if(L===A){let k=p(d,b);l.push([d,k,E],[k,b,E])}else if(L===_){let k=p(b,E);l.push([b,k,d],[k,E,d])}else{let k=p(E,d);l.push([E,k,b],[k,d,b])}}}}function vn(t,e,n=0,r,i=!1,s=4096){let l=[],c=[],a=[];for(let b of t.features()){if(b.type!==3||!ce(e,b.properties))continue;let E=b.properties.osm_id,A=typeof E=="number"?E:typeof E=="string"?Number(E):NaN,_=Number.isFinite(A)?A:Number(b.id??0);for(let R of $e(b.loadGeometry())){let L=i?je(R,s):R;if(!L)continue;let k=[],T=[],O=r?_e(L.outer,r):L.outer;for(let P=0;P<O.length;P++)k.push(O[P]);for(let P of L.holes){let C=r?_e(P,r):P;T.push(k.length/2);for(let Y=0;Y<C.length;Y++)k.push(C[Y])}let D=Te(k,T.length?T:void 0,2);if(!D.length)continue;let U=l.length/2;for(let P=0;P<k.length;P++)l.push(k[P]);if(n>0){let P=[];Ai(l,D,U,n,P);for(let C=0;C<P.length;C+=3)c.push(P[C],P[C+2],P[C+1]),a.push(_);continue}for(let P=0;P<D.length;P+=3)c.push(U+D[P],U+D[P+2],U+D[P+1]),a.push(_)}}if(!c.length)return null;let p=l.length/2,x=new Int16Array(l),y=new Uint32Array(c);return{featureIds:new Float64Array(a).buffer,vertices:x.buffer,indices:y.buffer,vertexCount:p,indexCount:y.length}}function En(t){return{shapes:[],cells:[],extent:0,metersPerTile:t}}function Mn(t,e,n,r){if(!(n<=0)){t.extent=r;for(let i of e){let s=i.outer;if(s.length<6)continue;let l=1/0,c=1/0,a=-1/0,p=-1/0;for(let x=0;x<s.length;x+=2)s[x]<l&&(l=s[x]),s[x]>a&&(a=s[x]),s[x+1]<c&&(c=s[x+1]),s[x+1]>p&&(p=s[x+1]);t.shapes.push({outer:s,holes:i.holes,level:n,minX:l,minY:c,maxX:a,maxY:p})}t.cells=[]}}function Li(t){t.cells=Array.from({length:32*32},()=>[]);let e=t.extent/32;for(let n=0;n<t.shapes.length;n++){let r=t.shapes[n],i=Ze(Math.floor(r.minX/e)),s=Ze(Math.floor(r.maxX/e)),l=Ze(Math.floor(r.minY/e)),c=Ze(Math.floor(r.maxY/e));for(let a=l;a<=c;a++)for(let p=i;p<=s;p++)t.cells[a*32+p].push(n)}}var Rn=t=>t.shapes.length===0;function Dt(t,e,n){!t.cells.length&&t.shapes.length&&Li(t);let r=t.extent/32,i=t.cells[Ze(Math.floor(n/r))*32+Ze(Math.floor(e/r))];if(!i||!i.length)return 0;let s=0;for(let l of i){let c=t.shapes[l];if(c.level<=s||e<c.minX||e>c.maxX||n<c.minY||n>c.maxY||!Sn(c.outer,e,n))continue;let a=!1;for(let p of c.holes)if(Sn(p,e,n)){a=!0;break}a||(s=c.level)}return Math.min(Math.round(s*100),127)}function Fn(t,e){let n=[],r=[],i=t.extent>0?t.metersPerTile/t.extent:0,s=i>0?2/i:0,l=Dt(t,e[0],e[1]);n.push(e[0],e[1]),r.push(l);for(let c=0;c+3<e.length;c+=2){let a=e[c],p=e[c+1],x=e[c+2],y=e[c+3],d=Dt(t,x,y);if(d!==l&&s>0){let b=Math.hypot(x-a,y-p),E=Math.min(Math.ceil(b/s),64),A=l;for(let _=1;_<E;_++){let R=_/E,L=a+(x-a)*R,k=p+(y-p)*R,T=Dt(t,L,k);T!==A&&(n.push(L,k),r.push(T),A=T)}}n.push(x,y),r.push(d),l=d}return{pts:n,levels:r}}var Ze=t=>t<0?0:t>31?31:t;function Sn(t,e,n){let r=!1,i=t.length/2;for(let s=0,l=i-1;s<i;l=s++){let c=t[s*2],a=t[s*2+1],p=t[l*2],x=t[l*2+1];a>n!=x>n&&e<(p-c)*(n-a)/(x-a)+c&&(r=!r)}return r}var _n=cr(In(),1);function Pn(t){let e=[];for(let n=0;n+1<t.length;n+=2)e.push([t[n],t[n+1]]);return e}function kn(t){let e=[];for(let r of t)e.push(r[0],r[1]);let n=e.length;return n>=4&&(e[0]!==e[n-2]||e[1]!==e[n-1])&&e.push(e[0],e[1]),e}function An(t,e,n=0){if(t.length<2)return t;let r=new Map;for(let s of t){let l=s.lift??0,c=r.get(l);c?c.push(s):r.set(l,[s])}let i=[];for(let[s,l]of r){if(l.length<2){i.push(...l);continue}let a=(n>0&&e?l.map(y=>({outer:e(y.outer,-n)??y.outer,holes:y.holes.map(d=>e(d,n)??d)})):l).map(y=>[Pn(y.outer),...y.holes.map(Pn)]),p;try{p=_n.union(a[0],...a.slice(1))}catch{i.push(...l);continue}let x=p;if(!Array.isArray(x)||x.length===0){i.push(...l);continue}for(let y of x){if(!y.length)continue;let d=kn(y[0]);if(d.length<8)continue;let b=[];for(let E=1;E<y.length;E++){let A=kn(y[E]);A.length>=8&&b.push(A)}i.push(s?{outer:d,holes:b,lift:s}:{outer:d,holes:b})}}return i}var jt=16,Bi=64,Ti=0,Ci=1,Ln=2,Vi=3,bt=1,Oi=.6;function On(t,e,n,r){let i=r.metersPerUnit>0?r.metersPerUnit:.5,s=r.elevation,l=r.base??0,c=Math.max(r.bevel??0,0)/i,a=Math.max(r.bevelDrop??0,0),p=Math.max(r.cornerRadius??0,0)/i,x=Math.max(512,t.length*24),y=new ArrayBuffer(x*jt),d={view:new DataView(y),bytes:new Uint8Array(y),offset:0,count:0,indices:[],extent:e,ensure(P){if(d.count+P<=x)return;x=Math.max(x*2,d.count+P);let C=new ArrayBuffer(x*jt);new Uint8Array(C).set(d.bytes.subarray(0,d.offset)),y=C,d.view=new DataView(C),d.bytes=new Uint8Array(C)}},b=[],E=new Map;for(let P of t.features()){if(P.type!==3||!ce(n,P.properties))continue;let C=r.liftBy?.(P.properties)??0;for(let Y of $e(P.loadGeometry())){let Q=je(Y,e,Ae(e));Q&&b.push(C?{...Q,lift:C}:Q)}}let A=new Set,_=Math.max(r.weld??Oi,0),R=An(b,(P,C)=>zt(P,C,e,A),_/i),L=_>0?R.map(P=>({...P,outer:Vn(P.outer,_/i,e),holes:P.holes.map(C=>Vn(C,_/i,e))})):R;for(let P of L){Bn(P.outer,E);for(let C of P.holes)Bn(C,E)}r.onShapes?.(L);let k=new Set;for(let[P,C]of E)C>1&&k.add(P);let T=[],O={radius:p,segments:r.cornerSegments,extent:e,margin:Ae(e),minCutRatio:0,maxChord:cn/i};for(let P of L){let C=p>0?{outer:_e(P.outer,{...O,keep:Tn(P.outer,k)}),holes:P.holes.map(N=>_e(N,{...O,keep:Tn(N,k)}))}:P,Y=c>0?zt(C.outer,c,e,k):C.outer,Q=C.holes.map(N=>c>0?zt(N,-c,e,k):N),Z=P.lift??0,re=s+Z,X=l+Z;Cn(d,Y??C.outer,Q.map((N,q)=>N??C.holes[q]),re);let $=re,z=re-a;Y&&c>0&&a>0&&Nt(d,Y,C.outer,$,z,Ci,e,k),z!==X&&Nt(d,C.outer,C.outer,z,X,Ln,e,k);for(let N of C.holes)if(z!==X&&Nt(d,N,N,z,X,Ln,e,k),re<X){let q=d.indices.length;Cn(d,N,[],X,Vi);for(let te=q;te<d.indices.length;te++)T.push(d.indices[te]);d.indices.length=q}}if(!d.indices.length&&!T.length)return null;let D=d.indices.length,U=new Uint32Array(D+T.length);return U.set(d.indices,0),U.set(T,D),{vertices:y.slice(0,d.offset),indices:U.buffer,vertexCount:d.count,indexCount:U.length,extent:e,capIndexOffset:D}}function We(t,e,n,r){let i=`${Math.round(t*100)},${Math.round(e*100)}`,s=`${Math.round(n*100)},${Math.round(r*100)}`;return i<s?`${i}|${s}`:`${s}|${i}`}function Bn(t,e){for(let n=0;n+3<t.length;n+=2){let r=We(t[n],t[n+1],t[n+2],t[n+3]);e.set(r,(e.get(r)??0)+1)}}function Tn(t,e){if(!e.size)return;let n=t.length/2-1,r=new Array(n).fill(!1);for(let i=0;i<n;i++){let s=We(t[(i+n-1)%n*2],t[(i+n-1)%n*2+1],t[i*2],t[i*2+1]),l=We(t[i*2],t[i*2+1],t[(i+1)%n*2],t[(i+1)%n*2+1]);(e.has(s)||e.has(l))&&(r[i]=!0)}return r}function lt(t,e,n,r,i,s,l,c){let a=t.offset;return t.view.setFloat32(a,e,!0),t.view.setFloat32(a+4,n,!0),t.view.setInt16(a+8,Di(Math.round(r*Bi)),!0),t.view.setInt8(a+10,$t(Math.round(i*127))),t.view.setInt8(a+11,$t(Math.round(s*127))),t.view.setInt8(a+12,$t(Math.round(l*127))),t.bytes[a+13]=c,t.view.setInt8(a+14,e<=0?-bt:e>=t.extent?bt:0),t.view.setInt8(a+15,n<=0?-bt:n>=t.extent?bt:0),t.offset+=jt,t.count++}function Cn(t,e,n,r,i=Ti){let s=[],l=[];for(let p=0;p<e.length;p++)s.push(e[p]);for(let p of n){l.push(s.length/2);for(let x=0;x<p.length;x++)s.push(p[x])}let c=Te(s,l.length?l:void 0,2);if(!c.length)return;t.ensure(s.length/2);let a=t.count;for(let p=0;p<s.length;p+=2)lt(t,s[p],s[p+1],r,0,0,1,i);for(let p=0;p<c.length;p+=3)t.indices.push(a+c[p],a+c[p+2],a+c[p+1])}function Nt(t,e,n,r,i,s,l,c){let a=Math.min(e.length,n.length)/2;if(!(a<3)){t.ensure((a-1)*4);for(let p=0;p<a-1;p++){let x=n[p*2],y=n[p*2+1],d=n[p*2+2],b=n[p*2+3];if(x===d&&y===b||yt(x,y,d,b,l,Ae(l))||c.has(We(x,y,d,b)))continue;let E=d-x,A=b-y,_=Math.hypot(E,A)||1,R=A/_,L=-E/_,k=r-i,T=Math.hypot(e[p*2]-x,e[p*2+1]-y)||0,O=0;if(T>1e-6&&k!==0){let Y=1/Math.hypot(1,k/T);O=T/Math.hypot(T,k)*Math.sign(k),R*=Y,L*=Y}let D=lt(t,e[p*2],e[p*2+1],r,R,L,O,s),U=lt(t,e[p*2+2],e[p*2+3],r,R,L,O,s),P=lt(t,x,y,i,R,L,O,s),C=lt(t,d,b,i,R,L,O,s);t.indices.push(P,U,C,P,D,U)}}}function zt(t,e,n,r){let i=t.length/2-1;if(i<3)return null;let s=[];for(let x=0;x<i;x++){let y=t[x*2],d=t[x*2+1],b=t[(x+i-1)%i*2],E=t[(x+i-1)%i*2+1],A=t[(x+1)%i*2],_=t[(x+1)%i*2+1],R=Math.hypot(y-b,d-E)||1,L=Math.hypot(A-y,_-d)||1,k=(d-E)/R,T=-(y-b)/R,O=(_-d)/L,D=-(A-y)/L,U=k+O,P=T+D,C=Math.hypot(U,P);if(C<1e-6){s.push(y,d);continue}U/=C,P/=C;let Y=Math.min(1/Math.max(U*k+P*T,.35),3),Q=y-U*e*Y,Z=d-P*e*Y,re=We(b,E,y,d),X=We(y,d,A,_);if(r.has(re)||r.has(X)){s.push(y,d);continue}let $=-Ae(n),z=n+Ae(n),N=(q,te)=>q<=$||q>=z||te<=$||te>=z;(N(y,d)||N(b,E)||N(A,_))&&(Q=y,Z=d),s.push(Q,Z)}s.push(s[0],s[1]);let l=Math.abs(Ht(t)),c=Ht(s);if(Math.sign(c)!==Math.sign(Ht(t))||Math.abs(c)<l*.25)return null;let a=-Ae(n),p=n+Ae(n);for(let x=0;x<s.length;x+=2)s[x]=Math.max(a,Math.min(p,s[x])),s[x+1]=Math.max(a,Math.min(p,s[x+1]));return s}function Ht(t){let e=0;for(let n=0;n<t.length-2;n+=2)e+=t[n]*t[n+3]-t[n+2]*t[n+1];return e/2}var $t=t=>t>127?127:t<-127?-127:t,Di=t=>t>32767?32767:t<-32768?-32768:t;function Vn(t,e,n){if(!(e>0))return t;let r=Ae(n),i=-r,s=n+r,l=t;for(let c=0;c<3;c++){let a=l.length/2-1;if(a<6)break;let p=new Array(a).fill(!0),x=a;for(let d=0;d<a&&!(x<=5);d++){let b=l[d*2],E=l[d*2+1];if(b<=i||b>=s||E<=i||E>=s)continue;let A=(d+a-1)%a;for(;!p[A]&&A!==d;)A=(A+a-1)%a;let _=(d+1)%a;for(;!p[_]&&_!==d;)_=(_+1)%a;if(A===d||_===d)break;let R=l[A*2],L=l[A*2+1],k=l[_*2]-R,T=l[_*2+1]-L,O=Math.hypot(k,T);O<1e-6||Math.abs((b-R)*T-(E-L)*k)/O<e&&(p[d]=!1,x--)}if(x===a)break;let y=[];for(let d=0;d<a;d++)p[d]&&y.push(l[d*2],l[d*2+1]);y.push(y[0],y[1]),l=y}return l}function Qe(t){let e=t.layer,n=typeof e=="number"?e:typeof e=="string"?Number(e):NaN;if(Number.isFinite(n)&&n!==0)return Math.max(-5,Math.min(5,Math.trunc(n)));let r=t.brunnel;return r==="bridge"?1:r==="tunnel"?-1:0}var ct=20;function Gn(t,e,n=0,r,i=0,s={}){let{level:l}=s,c=Math.max(256,t.length*24),a=new ArrayBuffer(c*ct),p=new DataView(a),x=0,y=[],d=L=>{if(x+L<=c)return;c=Math.max(c*2,x+L);let k=new ArrayBuffer(c*ct);new Uint8Array(k).set(new Uint8Array(a,0,x*ct)),a=k,p=new DataView(k)},b=(L,k,T,O,D,U,P,C=0,Y=0,Q=0)=>{let Z=x*ct;return p.setInt16(Z,L,!0),p.setInt16(Z+2,k,!0),p.setInt16(Z+4,T,!0),p.setInt16(Z+6,O,!0),p.setInt8(Z+8,D),p.setInt8(Z+9,U),p.setInt8(Z+10,C),p.setInt8(Z+11,Y),p.setFloat32(Z+12,P,!0),p.setFloat32(Z+16,Q,!0),x++},E=0,A=i>0?12/i:0,_=A>0?Hi(t):null;for(let L of t.features()){if(L.type!==2&&L.type!==3||!ce(e,L.properties)||l!==void 0&&Qe(L.properties)!==l)continue;let k=L.properties.width;E=typeof k=="number"&&k>.5&&k<100?k:0;let T=L.type===3;for(let O of L.loadGeometry()){let D=n>0?Gi(Dn(O),n):Dn(O);if(D.length<4)continue;let U=r&&!Rn(r)?Fn(r,D):null,P=U?U.pts:D,C=U?.levels,Y=P.length/2;if(Y<2)continue;let Q=Qe(L.properties),Z=wt(Math.round(P[0]),Math.round(P[1])),re=wt(Math.round(P[Y*2-2]),Math.round(P[Y*2-1])),X=null,$=E;if(_&&E>0&&!T){let N=0;for(let ee=0;ee<Y-1;ee++)N+=Math.hypot(P[ee*2+2]-P[ee*2],P[ee*2+3]-P[ee*2+1]);$=Nn(Q,E,Z,re,_);let q=ee=>Math.min(_.width.get(ee)??0,$*2),te=q(Z)-$,K=q(re)-$,oe=Math.min(A,N/2);if(oe>0&&(te>0||K>0)){X=J=>{let fe=0;return te>0&&J<oe&&(fe=te*(1-J/oe)),K>0&&N-J<oe&&(fe=Math.max(fe,K*(1-(N-J)/oe))),$+fe};let ee=[];for(let J of[oe,N-oe])J>.01&&J<N-.01&&ee.push(J);if(ee.length){let J=Ui(P,C,ee);P=J.pts,C=J.levels,Y=P.length/2}}}d((Y-1)*4);let z=0;for(let N=0;N<Y-1;N++){let q=P[N*2],te=P[N*2+1],K=P[N*2+2],oe=P[N*2+3],ee=Math.hypot(K-q,oe-te);if(T&&zi(q,te,K,oe,t.extent)){z+=ee;continue}let J=Ni(q,te,K,oe,t.extent);if(!J){z+=ee;continue}let[fe,be,de,Fe]=J,Ce=Math.hypot(fe-q,be-te),Le=Math.hypot(de-fe,Fe-be),Ve=Math.hypot(K-de,oe-Fe),we=z+Ce,se=C?C[N]:0,Pe=C?C[N+1]:0,xe=X?X(we):$,Be=X?X(we+Le):$,Oe=b(fe,be,de,Fe,0,-1,we,se,Pe,xe),De=b(fe,be,de,Fe,0,1,we,se,Pe,xe),Ie=b(fe,be,de,Fe,1,1,we,se,Pe,Be),ze=b(fe,be,de,Fe,1,-1,we,se,Pe,Be);z+=Ce+Le+Ve,y.push(Oe,De,Ie,Oe,Ie,ze)}}}if(!y.length)return null;let R=new Uint32Array(y);return{vertices:a.slice(0,x*ct),indices:R.buffer,vertexCount:x,indexCount:R.length}}function Ui(t,e,n){let r=[...n].sort((a,p)=>a-p),i=[t[0],t[1]],s=e?[e[0]]:void 0,l=0,c=0;for(let a=0;a+3<t.length;a+=2){let p=t[a],x=t[a+1],y=t[a+2],d=t[a+3],b=Math.hypot(y-p,d-x);for(;c<r.length&&r[c]<=l+.01;)c++;for(;c<r.length&&r[c]<l+b-.01;){let E=(r[c]-l)/b;i.push(p+(y-p)*E,x+(d-x)*E),s&&e&&s.push(Math.round(e[a/2]+(e[a/2+1]-e[a/2])*E)),c++}l+=b,i.push(y,d),s&&e&&s.push(e[a/2+1])}return{pts:i,levels:s}}function Gi(t,e){let n=[];for(let r=0;r+3<t.length;r+=2){let i=t[r],s=t[r+1],l=t[r+2],c=t[r+3];n.push(i,s);let a=Math.min(64,Math.floor(Math.hypot(l-i,c-s)/e));for(let p=1;p<a;p++){let x=p/a;n.push(i+(l-i)*x,s+(c-s)*x)}}return n.push(t[t.length-2],t[t.length-1]),n}function Dn(t){let e=[];for(let n=0;n<t.length;n+=2){let r=t[n],i=t[n+1],s=e.length;s>=2&&e[s-2]===r&&e[s-1]===i||e.push(r,i)}return e}function Ni(t,e,n,r,i){let s=n-t,l=r-e,c=0,a=1,p=[[-s,t],[s,i-t],[-l,e],[l,i-e]];for(let[x,y]of p){if(x===0){if(y<0)return null;continue}let d=y/x;if(x<0){if(d>a)return null;d>c&&(c=d)}else{if(d<c)return null;d<a&&(a=d)}}return a-c<1e-6?null:[Math.round(t+s*c),Math.round(e+l*c),Math.round(t+s*a),Math.round(e+l*a)]}function zi(t,e,n,r,i){return t===n&&(t<=0||t>=i)?!0:e===r&&(e<=0||e>=i)}var Un=new WeakMap,wt=(t,e)=>(t+512)*65536+(e+512);function Nn(t,e,n,r,i){if(t===0||e<=0)return e;let s=8*4294967296,l=Math.max(i.raw.get(n+s)??0,i.raw.get(r+s)??0);return l>0&&e>l?l:e}function Hi(t){let e=Un.get(t);if(e)return e;let n={width:new Map,ends:new Map,raw:new Map},r=[];for(let i of t.features()){if(i.type!==2)continue;let s=i.properties.width,l=typeof s=="number"&&s>.5&&s<100?s:0,c=Qe(i.properties);for(let a of i.loadGeometry()){if(a.length<4)continue;let p=wt(Math.round(a[0]),Math.round(a[1])),x=wt(Math.round(a[a.length-2]),Math.round(a[a.length-1]));for(let y of[p,x]){let d=y+(c+8)*4294967296;n.ends.set(d,(n.ends.get(d)??0)+1),l>0&&n.raw.set(d,Math.max(n.raw.get(d)??0,l))}r.push({h:p,t:x,lv:c,w:l})}}for(let i of r){let s=Nn(i.lv,i.w,i.h,i.t,n);if(!(s<=0))for(let l of[i.h,i.t]){let c=n.width.get(l);(c===void 0||s>c)&&n.width.set(l,s)}}return Un.set(t,n),n}var $i=[["\\u0443\\u043B\\u0438\\u0446\\u0430","\\u0443\\u043B."],["\\u0443\\u043B\\u0438\\u0446\\u044B","\\u0443\\u043B."],["\\u0443\\u043B\\u0438\\u0446\\u0435","\\u0443\\u043B."],["\\u043F\\u0440\\u043E\\u0441\\u043F\\u0435\\u043A\\u0442","\\u043F\\u0440\\u043E\\u0441\\u043F."],["\\u043F\\u0440\\u043E\\u0441\\u043F\\u0435\\u043A\\u0442\\u0430","\\u043F\\u0440\\u043E\\u0441\\u043F."],["\\u043F\\u0435\\u0440\\u0435\\u0443\\u043B\\u043E\\u043A","\\u043F\\u0435\\u0440."],["\\u043F\\u0435\\u0440\\u0435\\u0443\\u043B\\u043A\\u0430","\\u043F\\u0435\\u0440."],["\\u043F\\u0440\\u043E\\u0435\\u0437\\u0434","\\u043F\\u0440-\\u0434"],["\\u043F\\u0440\\u043E\\u0435\\u0437\\u0434\\u0430","\\u043F\\u0440-\\u0434"],["\\u043F\\u043B\\u043E\\u0449\\u0430\\u0434\\u044C","\\u043F\\u043B."],["\\u043F\\u043B\\u043E\\u0449\\u0430\\u0434\\u0438","\\u043F\\u043B."],["\\u0431\\u0443\\u043B\\u044C\\u0432\\u0430\\u0440","\\u0431\\u0443\\u043B."],["\\u0431\\u0443\\u043B\\u044C\\u0432\\u0430\\u0440\\u0430","\\u0431\\u0443\\u043B."],["\\u043D\\u0430\\u0431\\u0435\\u0440\\u0435\\u0436\\u043D\\u0430\\u044F","\\u043D\\u0430\\u0431."],["\\u043D\\u0430\\u0431\\u0435\\u0440\\u0435\\u0436\\u043D\\u043E\\u0439","\\u043D\\u0430\\u0431."],["\\u0448\\u043E\\u0441\\u0441\\u0435","\\u0448."],["\\u0442\\u0443\\u043F\\u0438\\u043A","\\u0442\\u0443\\u043F."],["\\u0442\\u0443\\u043F\\u0438\\u043A\\u0430","\\u0442\\u0443\\u043F."],["\\u043C\\u0438\\u043A\\u0440\\u043E\\u0440\\u0430\\u0439\\u043E\\u043D","\\u043C\\u043A\\u0440."],["\\u043C\\u0438\\u043A\\u0440\\u043E\\u0440\\u0430\\u0439\\u043E\\u043D\\u0430","\\u043C\\u043A\\u0440."],["\\u043A\\u04EF\\u0447\\u0430\\u0438","\\u043A."],["\\u043A\\u0443\\u0447\\u0430\\u0438","\\u043A."],["\\u0445\\u0438\\u0451\\u0431\\u043E\\u043D\\u0438","\\u0445\\u0438\\u0451\\u0431."],["\\u0448\\u043E\\u04B3\\u0440\\u043E\\u04B3\\u0438","\\u0448\\u043E\\u04B3."],["\\u0433\\u0443\\u0437\\u0430\\u0440\\u0433\\u043E\\u04B3\\u0438","\\u0433\\u0443\\u0437."],["\\u043C\\u0430\\u0439\\u0434\\u043E\\u043D\\u0438","\\u043C\\u0430\\u0439\\u0434."]],zn=new Map($i);function Hn(t){let e=t.split(" ");if(e.length<2)return t;let n=!1,r=e.map(s=>{let l=zn.get(s.toLowerCase());return l?(n=!0,s[0]===s[0].toUpperCase()?l[0].toUpperCase()+l.slice(1):l):s});return!n||!e.filter(s=>zn.get(s.toLowerCase())===void 0).length?t:r.join(" ")}function jn(t,e){let n=[],r=[],i=[],s=[],l=[],c=e.textPlacement==="line",a=[],p=[],x=[];for(let y of t.features()){if(!ce(e.filter,y.properties))continue;let d=y.loadGeometry(),b=Yi(y.type,d);if(!b)continue;let E=e.textField?$n(e.textField,y.properties):"",A=E&&e.abbreviate?Hn(E):E,_=e.iconImage?$n(e.iconImage,y.properties):"";if(!(!A&&!_)){if(c){let R=Xi(y.type,d);if(!R)continue;x.push({text:A,line:R});continue}n.push(b[0],b[1]),r.push(A),i.push(_),s.push(Zi(y.properties)),l.push(e.iconRotate&&Math.round(Number(y.properties[e.iconRotate]??0))||0)}}if(c){for(let{text:y,line:d}of ji(x)){p.push(a.length/2);for(let b of d)a.push(b);n.push(Math.round(d[0]),Math.round(d[1])),r.push(y),i.push(""),s.push(128),l.push(0)}p.push(a.length/2)}return r.length?{anchors:new Int16Array(n).buffer,texts:r,icons:i,priorities:new Uint8Array(s).buffer,rotations:new Int16Array(l).buffer,...c?{lines:new Int16Array(a).buffer,lineStarts:new Uint32Array(p).buffer}:{}}:null}function ji(t){let e=[],n=new Map,r=new Map,i=(s,l,c)=>`${s}\\u241F${l}\\u241F${c}`;for(let{text:s,line:l}of t){let c=i(s,l[0],l[1]),a=i(s,l[l.length-2],l[l.length-1]),p=n.get(a),x=r.get(c);if(x!==void 0){let y=e[x];if(y.line.push(...l.slice(2)),r.delete(c),r.set(i(s,y.line[y.line.length-2],y.line[y.line.length-1]),x),p!==void 0&&p!==x){let d=e[p];y.line.push(...d.line.slice(2)),d.line=[],n.delete(a),r.set(i(s,y.line[y.line.length-2],y.line[y.line.length-1]),x)}continue}if(p!==void 0){let y=e[p];y.line.unshift(...l.slice(0,l.length-2)),n.delete(a),n.set(i(s,y.line[0],y.line[1]),p);continue}n.set(c,e.length),r.set(a,e.length),e.push({text:s,line:l})}return e.filter(s=>s.line.length>=4)}function Xi(t,e){if(t!==2)return null;let n=null,r=0;for(let i of e){if(i.length<4)continue;let s=0;for(let l=0;l+3<i.length;l+=2)s+=Math.hypot(i[l+2]-i[l],i[l+3]-i[l+1]);s>r&&(r=s,n=i)}return n}function Yi(t,e){if(!e.length)return null;if(t===1){let l=e[0];return l.length>=2?[l[0],l[1]]:null}if(t===2){let l=-1,c=0,a=0;for(let p of e)for(let x=0;x+3<p.length;x+=2){let y=p[x+2]-p[x],d=p[x+3]-p[x+1],b=y*y+d*d;b>l&&(l=b,c=p[x]+y/2,a=p[x+1]+d/2)}return l>0?[Math.round(c),Math.round(a)]:null}let n=1/0,r=1/0,i=-1/0,s=-1/0;for(let l of e)for(let c=0;c<l.length;c+=2)l[c]<n&&(n=l[c]),l[c]>i&&(i=l[c]),l[c+1]<r&&(r=l[c+1]),l[c+1]>s&&(s=l[c+1]);return isFinite(n)?[Math.round((n+i)/2),Math.round((r+s)/2)]:null}function Zi(t){let e=t.rank;return typeof e=="number"&&isFinite(e)?Math.max(0,255-Math.min(e,255)):128}function $n(t,e){let n=Array.isArray(t)?t:[t];for(let r of n){let i=!0,l=r.replace(/\\{([^}]+)\\}/g,(c,a)=>{let p=e[a];return p==null||p===""?(i=!1,""):String(p)}).trim();if(i&&l)return l}return""}function Xn(t,e){let n=[],r=[];for(let i=0;i<t.length;i++){let s=t.feature(i);if(s.type===1&&ce(e,s.properties))for(let l of s.loadGeometry())for(let c=0;c+1<l.length;c+=2)n.push(l[c],l[c+1]),r.push(s.properties)}return r.length?{anchors:Int16Array.from(n).buffer,props:r}:null}var Wi="\\u241F",Xt=(t,e)=>t+Wi+String(e);function Qi(){let t=typeof self<"u"?self.origin:void 0;return t&&t!=="null"&&!t.startsWith("blob:")?t+"/":void 0}async function Yn(t,e){let n=performance.now(),r=Qi(),i=await fetch(t.url,{signal:e,credentials:"same-origin",...r?{referrer:r}:{}}),s=(R,L,k,T,O=0)=>({type:"loaded",id:t.id,buckets:{},timing:{fetchMs:T,parseMs:O},diag:{status:R,bytes:L,layers:k,built:0}});if(!i.ok){if(i.status===404||i.status===204)return s(i.status,0,[],performance.now()-n);throw new Error(`HTTP ${i.status} \\u0434\\u043B\\u044F ${t.url}`)}let l=await i.arrayBuffer(),c=performance.now()-n;if(l.byteLength===0)return s(i.status,0,[],c);let a=performance.now(),p=new gt(l),x=Object.keys(p.layers),y={},d={},b=new Set,E=[],_=t.plan.some(R=>R.type==="surface"&&(R.elevation??0)>0)&&t.plan.some(R=>R.type==="line"&&R.ground)?En(t.metersPerTile):void 0;for(let R of t.plan){if(!Ji(R,t.zoom,t.sourceMaxZoom))continue;let L=p.layers[R.sourceLayer];if(!L)continue;let k=qi(t.zoom,L.extent);try{if(R.splitBy){let O=eo(L,R.splitBy,R.filter);if(!O.length)continue;let D=d[R.splitBy]??(d[R.splitBy]=[]);for(let U of O){D.includes(U)||D.push(U);let P={...R,splitBy:void 0,filter:no(R.filter,R.splitBy,U)},C=Yt(P,L,k,t.metersPerTile,_);C&&(y[Xt(R.id,U)]=C)}continue}if(R.network&&R.type==="line"){for(let O of to(L,R.filter)){let D=Yt(R,L,k,t.metersPerTile,_,O);D&&(y[Xt(R.id,O)]=D,b.add(O))}continue}let T=Yt(R,L,k,t.metersPerTile,_);T&&(y[R.id]=T)}catch(T){E.push(`${R.id}: ${T instanceof Error?T.message:String(T)}`)}}return{type:"loaded",id:t.id,buckets:y,...Object.keys(d).length?{splits:d}:{},...b.size?{levels:[...b].sort((R,L)=>R-L)}:{},timing:{fetchMs:c,parseMs:performance.now()-a},diag:{status:i.status,bytes:l.byteLength,layers:x,built:Object.keys(y).length,...E.length?{failed:E}:{}}}}function Ki(t){return e=>{let n=e.on;if(typeof n!="string"||!n)return 0;let r=0;for(let i of n.split(",")){let s=t[i];typeof s=="number"&&s>r&&(r=s)}return r}}function Ji(t,e,n){let r=e-1,i=e<n?e+1:24;return!(t.maxzoom<r||t.minzoom>i)}function qi(t,e){return t<=6?Math.max(64,e/24):0}function Yt(t,e,n,r,i,s){{if(t.type==="fill"){let c=r>0?r/e.extent:0,a=t.cornerRadius&&c>0?{radius:t.cornerRadius/c,segments:t.cornerSegments,extent:e.extent,minCutRatio:0,maxChord:fn/c}:void 0,p=vn(e,t.filter,n,a,t.clipToTile===!0,e.extent);return p?{kind:"fill",...p,extent:e.extent}:null}if(t.type==="surface"){let c=On(e,e.extent,t.filter,{metersPerUnit:r>0?r/e.extent:0,elevation:t.elevation??0,base:t.base,bevel:t.bevel,weld:t.weld,bevelDrop:t.bevelDrop,cornerRadius:t.cornerRadius,cornerSegments:t.cornerSegments,...i?{onShapes:a=>Mn(i,a,t.elevation??0,e.extent)}:{},...t.groundBy?{liftBy:Ki(t.groundBy)}:{}});return c?{kind:"surface",...c}:null}if(t.type==="line"){let c=Gn(e,t.filter,n,t.ground?i:void 0,r>0?r/e.extent:0,{level:s});return c?{kind:"line",...c,extent:e.extent}:null}if(t.type==="model"){let c=Xn(e,t.filter);return c?{kind:"placement",...c,extent:e.extent}:null}if(t.type==="symbol"){let c=jn(e,{filter:t.filter,textField:t.textField,iconImage:t.iconImage,iconRotate:t.iconRotate,textPlacement:t.textPlacement,abbreviate:t.abbreviate});return c?{kind:"symbol",...c,extent:e.extent}:null}let l=bn(e,e.extent,t.filter,{metersPerUnit:r>0?r/e.extent:0,cornerRadius:t.cornerRadius,cornerSegments:t.cornerSegments});return l?{kind:"fill-extrusion",vertices:l.vertices,indices:l.indices,featureIds:l.featureIds,vertexCount:l.vertexCount,indexCount:l.indexCount,extent:l.extent}:null}}function eo(t,e,n){let r=[];for(let i of t.features()){if(!ce(n,i.properties))continue;let s=i.properties[e];typeof s!="string"&&typeof s!="number"||r.includes(s)||r.push(s)}return r.sort((i,s)=>typeof i=="number"&&typeof s=="number"?i-s:String(i).localeCompare(String(s))),r}function to(t,e){let n=[];for(let r of t.features()){if(!ce(e,r.properties))continue;let i=Qe(r.properties);n.includes(i)||n.push(i)}return n.sort((r,i)=>r-i)}function no(t,e,n){let r=["==",e,n];return t?["all",t,r]:r}var ro=t=>t.kind==="symbol",io=t=>t.kind==="placement";function Zn(t){let e=[];for(let n of Object.values(t.buckets)){if(io(n)){e.push(n.anchors);continue}if(ro(n)){e.push(n.anchors,n.priorities),n.lines&&e.push(n.lines),n.lineStarts&&e.push(n.lineStarts);continue}e.push(n.vertices,n.indices),n.featureIds&&e.push(n.featureIds)}return e}var Wn=Map;var Ke=new Wn,Zt=self;Zt.onmessage=t=>{let e=t.data;if(e.type==="abort"){Ke.get(e.id)?.abort(),Ke.delete(e.id);return}let n=new AbortController;Ke.set(e.id,n),Yn(e,n.signal).then(r=>{Ke.has(e.id)&&(Ke.delete(e.id),Zt.postMessage(r,Zn(r)))}).catch(r=>{let i=n.signal.aborted;Ke.delete(e.id);let s={type:"error",id:e.id,message:r instanceof Error?r.message:String(r),aborted:i};Zt.postMessage(s)})};})();\n';var Do=class{constructor(e=sn()){this.workers=[];this.blobUrl=null;this.pending=new B;this.nextId=1;this.cursor=0;this.mainThreadAborts=new B;this.destroyed=false;try{let t=new Blob([ln],{type:"text/javascript"});this.blobUrl=URL.createObjectURL(t);for(let o=0;o<e;o++){let r=new Worker(this.blobUrl);r.onmessage=n=>this.onMessage(n.data),r.onerror=n=>console.error("[osmgl] \u0432\u043E\u0440\u043A\u0435\u0440 \u0443\u043F\u0430\u043B:",n.message),this.workers.push(r);}}catch(t){console.warn("[osmgl] \u0432\u043E\u0440\u043A\u0435\u0440\u044B \u043D\u0435\u0434\u043E\u0441\u0442\u0443\u043F\u043D\u044B, \u0440\u0430\u0437\u0431\u043E\u0440 \u0442\u0430\u0439\u043B\u043E\u0432 \u043F\u043E\u0439\u0434\u0451\u0442 \u0432 \u0433\u043B\u0430\u0432\u043D\u043E\u043C \u043F\u043E\u0442\u043E\u043A\u0435:",t),this.disposeWorkers();}this.usingWorkers=this.workers.length>0;}get size(){return this.workers.length}load(e,t){let o=this.nextId++,r={type:"load",id:o,...e};if(!this.usingWorkers){let a=new AbortController;return this.mainThreadAborts.set(o,a),ol(r,a.signal).then(l=>{this.mainThreadAborts.has(o)&&(this.mainThreadAborts.delete(o),t(l));}).catch(l=>{let s=a.signal.aborted;this.mainThreadAborts.delete(o),t({type:"error",id:o,message:l instanceof Error?l.message:String(l),aborted:s});}),o}let n=this.cursor++%this.workers.length;return this.pending.set(o,{resolve:t,workerIndex:n}),this.workers[n].postMessage(r),o}abort(e){if(!this.usingWorkers){this.mainThreadAborts.get(e)?.abort(),this.mainThreadAborts.delete(e);return}let t=this.pending.get(e);if(!t)return;this.pending.delete(e);let o={type:"abort",id:e};this.workers[t.workerIndex].postMessage(o);}onMessage(e){if(this.destroyed)return;let t=this.pending.get(e.id);t&&(this.pending.delete(e.id),t.resolve(e));}disposeWorkers(){for(let e of this.workers)e.terminate();this.workers=[],this.blobUrl&&URL.revokeObjectURL(this.blobUrl),this.blobUrl=null;}destroy(){this.destroyed=true;for(let e of this.mainThreadAborts.values())e.abort();this.mainThreadAborts.clear(),this.pending.clear(),this.disposeWorkers();}};function sn(){let i=typeof navigator<"u"&&navigator.hardwareConcurrency||4;return Math.max(1,Math.min(i-1,6))}function rl(i){return Math.max(0,Math.ceil((i*Math.LN2+Math.log(512/360/.5))/Math.LN10))}function cn(i,e){let t=rl(i.zoom),o=[Math.round(i.zoom*100)/100,i.center.lat.toFixed(t),i.center.lng.toFixed(t)],r=Math.round(i.bearing*10)/10,n=Math.round(i.pitch*10)/10;(r!==0||n!==0)&&(o.push(r),n!==0&&o.push(n));let a=o.join("/");return e?`${e}=${a}`:a}function fn(i,e){let t=i.replace(/^#/,"");if(!t)return null;if(e){let s=t.split("&").map(c=>c.split("=")).find(([c])=>c===e);if(!s||s.length<2)return null;t=s[1];}let o=t.split("/");if(o.length<3)return null;let r=Number(o[0]),n=Number(o[1]),a=Number(o[2]);if(!isFinite(r)||!isFinite(n)||!isFinite(a)||Math.abs(n)>90||Math.abs(a)>180)return null;let l={center:{lng:a,lat:n},zoom:r};return o.length>3&&isFinite(Number(o[3]))&&(l.bearing=Number(o[3])),o.length>4&&isFinite(Number(o[4]))&&(l.pitch=Number(o[4])),l}function nl(i){if(typeof window>"u"||!window.history?.replaceState)return;let e=new URL(window.location.href);e.hash=i,window.history.replaceState(window.history.state,"",e.toString());}var il={high:{name:"high",maxPixelRatio:2,maxCanvasPixels:16777216,antialias:true,maxWorkers:6,shadowMapSize:1024,detail:1,tileCacheSize:64,allowShadows:true,detailBias:1,maxTiles:512,modelBudget:1,simpleGeometry:false},balanced:{name:"balanced",maxPixelRatio:1.75,maxCanvasPixels:5529600,antialias:true,maxWorkers:4,shadowMapSize:1024,detail:.85,tileCacheSize:40,allowShadows:true,detailBias:1.1,maxTiles:192,modelBudget:.7,simpleGeometry:false},low:{name:"low",maxPixelRatio:1.25,maxCanvasPixels:2592e3,antialias:true,maxWorkers:2,shadowMapSize:512,detail:.5,tileCacheSize:24,allowShadows:false,detailBias:1.25,maxTiles:96,modelBudget:.4,simpleGeometry:true},minimal:{name:"minimal",maxPixelRatio:1,maxCanvasPixels:1152e3,antialias:false,maxWorkers:2,shadowMapSize:512,detail:0,tileCacheSize:16,allowShadows:false,detailBias:1.7,maxTiles:48,modelBudget:.2,simpleGeometry:true}},_t=i=>il[i]??il.high;function Go(i){let{cores:e,memory:t,mobile:o,devicePixelRatio:r}=i;return e<=2||t!==void 0&&t<=2?"minimal":o?e<=4||t!==void 0&&t<=3?"minimal":e<=6||t!==void 0&&t<=4||r>=3?"low":"balanced":e<=4||t!==void 0&&t<=4?"balanced":"high"}function No(){if(typeof navigator>"u")return {cores:4,mobile:false,devicePixelRatio:1};let i=navigator,e=typeof matchMedia=="function"&&matchMedia("(pointer: coarse)").matches&&typeof screen<"u"&&Math.min(screen.width,screen.height)<=820,t=i.userAgentData?.mobile===true||e;return {cores:i.hardwareConcurrency||4,memory:i.deviceMemory,mobile:t,devicePixelRatio:typeof devicePixelRatio=="number"?devicePixelRatio:1}}function un(i,e,t,o){let r=Math.min(t||1,o.maxPixelRatio),n=Math.max(i*e,1),a=Math.sqrt(o.maxCanvasPixels/n);return Math.max(Math.min(r,a),1)}function hn(i){return i==="high"?3:i==="balanced"?2:i==="low"?1:0}function al(i){return i==="minimal"?"low":i==="low"?"balanced":i==="balanced"?"high":null}function dn(i){return i==="high"?"balanced":i==="balanced"?"low":i==="low"?"minimal":null}var eu=1,eo=class{constructor(e){this.originX=0;this.originY=0;this._revision=0;this.id=e.id??`obj-${eu++}`,this.zIndex=e.zIndex??0,this.altitude=e.altitude??0,this.visible=e.visible!==false,this.userData=e.userData??{},this.paint=e;}get ghostOpacity(){return this.paint.ghostOpacity??0}get revision(){return this._revision}invalidate(){this._revision++;}setPaint(e){return Object.assign(this.paint,e),this.invalidate(),this}setOriginFromCoords(e){let t=1/0,o=1/0,r=-1/0,n=-1/0;for(let a of e)for(let l of a){let s=Z(l),c=re(s.lng),f=ne(s.lat);c<t&&(t=c),c>r&&(r=c),f<o&&(o=f),f>n&&(n=f);}if(!isFinite(t)){this.originX=0,this.originY=0;return}this.originX=(t+r)/2,this.originY=(o+n)/2;}toLocal(e){let t=[];for(let o of e){let r=Z(o);t.push(re(r.lng)-this.originX,ne(r.lat)-this.originY);}return t}color(e,t){let o=he(this.paint[e]??t),r=this.paint.opacity??1;return [o[0],o[1],o[2],o[3]*r]}linePaint(e){return e.dashArray=this.paint.dashArray,e.offset=this.paint.offset,this.paint.arrow&&(e.arrow=true,e.arrowColor=this.color("arrowColor","#ffffff"),e.arrowPeriod=this.paint.arrowPeriod??46,e.arrowSize=this.paint.arrowSize??5),e}},pn=class extends eo{constructor(e){super(e),this.coordinates=e.coordinates,this.segments=e.segments??[],this.setOriginFromCoords([this.coordinates]);}setCoordinates(e){return this.coordinates=e,this.setOriginFromCoords([e]),this.invalidate(),this}setSegments(e){return this.segments=e,this.invalidate(),this}getCoordinates(){return this.coordinates}rings(){return [this.coordinates]}build(){let e=Pt([this.toLocal(this.coordinates)]);if(!e)return [];let t=this.paint.width??6,o=[],r=this.paint.strokeWidth??0;r>0&&o.push({kind:"line",mesh:e,color:this.color("strokeColor","#ffffff"),width:t+r*2,offset:this.paint.offset});let n=this.colorRuns();if(!n.length)return o.push(this.linePaint({kind:"line",mesh:e,color:this.color("color","#2f6df6"),width:t})),o;let a=this.paint.opacity??1;for(let l of n){let s=Pt([this.toLocal(this.coordinates.slice(l.from,l.to+1))]);if(!s)continue;let c=he(l.color);o.push(this.linePaint({kind:"line",mesh:s,color:[c[0],c[1],c[2],c[3]*a],width:t}));}return o}colorRuns(){if(this.segments.length===0||this.coordinates.length<2)return [];let e=this.coordinates.length-1,t=this.segments.filter(r=>Number.isInteger(r.at)&&r.at>=0&&r.at<e).sort((r,n)=>r.at-n.at);if(!t.length)return [];let o=[];for(let r=0;r<t.length;r++){let n=r===0?0:t[r].at,a=r+1<t.length?t[r+1].at:e;a>n&&o.push({from:n,to:a,color:t[r].color});}return o}hitTest(e,t,o){let r=(this.paint.width??6)/2+(this.paint.strokeWidth??0)+o,n=yn(this.coordinates,this.altitude,t);for(let a=0;a+1<n.length;a++)if(ll(e,n[a],n[a+1])<=r)return true;return false}},Uo=class extends eo{constructor(e){super(e),this.coordinates=e.coordinates,this.setOriginFromCoords(this.coordinates);}setCoordinates(e){return this.coordinates=e,this.setOriginFromCoords(e),this.invalidate(),this}rings(){return this.coordinates}build(){let e=[],t=Ir(this.coordinates.map(r=>this.toLocal(r)));t&&e.push({kind:"fill",mesh:t,color:this.color("color","#2f6df6"),width:0});let o=this.paint.strokeWidth??this.paint.width??0;if(o>0){let r=this.coordinates.map(a=>this.toLocal(mn(a))),n=Pt(r);n&&e.push(this.linePaint({kind:"line",mesh:n,color:this.color("strokeColor","#2f6df6"),width:o}));}return e}hitTest(e,t){let o=yn(mn(this.coordinates[0]??[]),this.altitude,t);if(!gn(e,o))return false;for(let r=1;r<this.coordinates.length;r++)if(gn(e,yn(mn(this.coordinates[r]),this.altitude,t)))return false;return true}},bn=class extends Uo{constructor(e){super({...e,coordinates:[tu(e.center,e.radius,e.segments)]});}};function tu(i,e,t){let o=Z(i),r=e/Ae(o.lat),n=re(o.lng),a=ne(o.lat),l=Math.max(12,t??Math.min(128,Math.round(24+e/20))),s=[];for(let c=0;c<l;c++){let f=c/l*Math.PI*2;s.push([Se(n+Math.cos(f)*r),Ce(a+Math.sin(f)*r)]);}return s}function yn(i,e,t){let o=[];for(let r of i){let n=Z(r),a=t(n.lng,n.lat,e);a&&o.push(a);}return o}function mn(i){if(i.length<2)return i;let e=Z(i[0]),t=Z(i[i.length-1]);return e.lng===t.lng&&e.lat===t.lat?i:[...i,i[0]]}function ll(i,e,t){let o=t.x-e.x,r=t.y-e.y,n=o*o+r*r;if(n<1e-12)return Math.hypot(i.x-e.x,i.y-e.y);let a=((i.x-e.x)*o+(i.y-e.y)*r)/n;return a=a<0?0:a>1?1:a,Math.hypot(i.x-(e.x+a*o),i.y-(e.y+a*r))}function gn(i,e){let t=false;for(let o=0,r=e.length-1;o<e.length;r=o++){let n=e[o].x,a=e[o].y,l=e[r].x,s=e[r].y;a>i.y!=s>i.y&&i.x<(l-n)*(i.y-a)/(s-a)+n&&(t=!t);}return t}var sl="objects3d",Ct="level",ou=32,ru=100,vn=120,nu=40,iu=.35,au=.02,lu=150,su=250;function cl(i){return typeof i=="number"?{top:i,right:i,bottom:i,left:i}:{top:i?.top??0,right:i?.right??0,bottom:i?.bottom??0,left:i?.left??0}}function cu(i){let e={...i};return delete e.cornerRadius,delete e.cornerSegments,e.type==="surface"&&(e.type="fill",delete e.elevation,delete e.base,delete e.bevel,delete e.bevelDrop),e}var wn=class extends De{constructor(t){super();this.options=t;this.transform=new Tt;this.ctx=null;this.sources=new B;this.rasterSources=new B;this.renderer=new Gt;this.objects=new Ot;this.markerHost=null;this.gestures=null;this.resizeObserver=null;this.frameHandle=0;this.needsRepaint=true;this.padding={top:0,right:0,bottom:0,left:0};this.animation=null;this.loaded=false;this.destroyed=false;this.objects3d=null;this.objects3dEnabled=true;this.frameRing=new Uint8Array(vn);this.ringAt=0;this.ringSum=0;this.ringFilled=0;this.steadyFrames=0;this.lastFrameAt=0;this.continuousFrames=0;this.onHashChange=null;this.lastMoveEmit=0;this.lastIndoorKey="";this.writingHash=false;this.hashTimer=0;this.layerOverrides=new B;this.autoIndoorLevel=true;let o=typeof t.container=="string"?document.getElementById(t.container):t.container;if(!o)throw new Error(`[osmgl] \u043A\u043E\u043D\u0442\u0435\u0439\u043D\u0435\u0440 \u043D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D: ${String(t.container)}`);this.container=o,this.qualityAuto=(t.quality??"auto")==="auto";let r=this.qualityAuto?Go(No()):t.quality;this.qualityCeiling=r,this.quality=_t(r),this.densityQuality=this.quality,this.maxPixelRatio=t.maxPixelRatio??this.quality.maxPixelRatio,this._style=new ut(t.theme?xo(t.theme,t.style):t.style),this.background=t.background?he(t.background):null,this.canvas=document.createElement("canvas"),this.canvas.style.width="100%",this.canvas.style.height="100%",this.canvas.style.display="block",this.canvas.style.outline="none",getComputedStyle(this.container).position==="static"&&(this.container.style.position="relative"),this.container.appendChild(this.canvas);let n=document.createElement("div");n.className="osmgl-markers",n.style.cssText="position:absolute;inset:0;overflow:hidden;pointer-events:none",this.container.appendChild(n),this.markerHost=n,this.objects.setMarkerHost(n);let a=this.transform;a.minZoom=t.minZoom??0,a.maxZoom=t.maxZoom??22,a.maxPitch=t.maxPitch??75,a.projection=t.projection??"mercator",a.center=Z(t.center??[0,0]),a.zoom=t.zoom??2,a.bearing=t.bearing??0,a.pitch=t.pitch??0,this.hashName=typeof t.hash=="string"?t.hash:void 0,t.hash&&this.applyHash(false),this.pool=new Do(t.workerCount??Math.min(sn(),this.quality.maxWorkers)),this.initGL(),this.initSource(),this.initInput(),this.initResize(),queueMicrotask(()=>{this.destroyed||(this.loaded=true,this.emit("load",void 0),this.triggerRepaint());});}initGL(){let t=this.canvas.getContext("webgl2",{alpha:false,antialias:this.quality.antialias,depth:true,stencil:true,preserveDrawingBuffer:false,powerPreference:"high-performance",failIfMajorPerformanceCaveat:false});if(!t)throw new Error("[osmgl] WebGL2 \u043D\u0435\u0434\u043E\u0441\u0442\u0443\u043F\u0435\u043D \u0432 \u044D\u0442\u043E\u043C \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435");this.ctx=new io(t);let o=new gt(this.options.fonts??"/tileserver/fonts/{fontstack}/{range}.pbf",this.options.fontstack);this.options.icons&&o.icons.setIcons({...tt,...this.options.icons}),o.onAssetsReady=()=>this.triggerRepaint(),this.renderer.symbols=o,this.renderer.objects=this.objects,this.renderer.models.onLoaded=()=>this.triggerRepaint(),this.renderer.init(this.ctx),this.canvas.addEventListener("webglcontextlost",r=>{r.preventDefault(),this.stopFrameLoop(),this.emit("contextlost",void 0),this.emit("error",{message:"\u043A\u043E\u043D\u0442\u0435\u043A\u0441\u0442 WebGL \u043F\u043E\u0442\u0435\u0440\u044F\u043D"});});}initSource(){this.options.tiles&&this.addSource(K,{url:this.options.tiles,minzoom:this.options.sourceMinZoom??0,maxzoom:this.options.sourceMaxZoom??14});for(let[o,r]of Object.entries({...this._style.spec.sources??{},...this.options.sources??{}}))this.addSource(o,r);let t=this.options.objects3d;if(t){this.objects3d=new Vo({endpoint:t.endpoint??"/objects3d",apiKey:t.apiKey??null}),this.objects3d.onReady=()=>this.triggerRepaint(),this.objects3d.setModelKey(this._style.spec.model3dKey??"");let o=t.sourceMaxZoom??14;this.addSource(this.objects3dSource,{url:t.tiles,minzoom:o,maxzoom:o});}}get objects3dSource(){return this.options.objects3d?this.options.objects3d.source??"model3d":null}objects3dPlan(){let t=this.options.objects3d;return {id:sl,type:"model",sourceLayer:t.sourceLayer??"model3d",minzoom:0,maxzoom:24}}planFor(t,o=this._style){let r=o.workerPlan(t),n=t===this.objects3dSource?[...r,this.objects3dPlan()]:r;return this.quality.simpleGeometry?n.map(cu):n}updateObjects3D(){let t=this.objects3d,o=this.objects3dSource;if(!t||!o)return;let r=this.sources.get(o);if(!r)return;if(!this.objects3dEnabled){t.models.length&&t.clear(l=>this.renderer.models.remove(l,this.ctx?.gl)),this.renderer.hiddenBuildings=t.replacedBuildings,this.renderer.hiddenVenues=t.replacedVenues,this.renderer.hiddenVenueLayer=null;return}let n=this.venuesForMask();t.update({id:sl,"source-layer":this.options.objects3d.sourceLayer??"model3d",layout:this.options.objects3d.layout},r,this.transform,l=>this.renderer.models.add(l),l=>this.renderer.models.remove(l,this.ctx?.gl),this.buildingsForMask(),n),this.renderer.hiddenBuildings=t.replacedBuildings,this.renderer.hiddenVenues=t.replacedVenues,this.renderer.hiddenVenueLayer=n?.key??null;let a=this.renderer.indoorMask.footprint();if(a){let l=this.transform.worldSize>0?this.transform.pixelsPerMeter/this.transform.worldSize*1.5:0;for(let s of t.models){let c=s.origin();s.setHidden(We(a,c.x,c.y,l));}}else for(let l of t.models)l.setHidden(false);}buildingsForMask(){let t=this.sources.get(K);if(!t)return null;for(let o of this._style.layers){if(o.type!=="fill-extrusion"||(o.source??K)!==K)continue;let r=this._style.bucketKeyFor(o);if(r!==null)return {source:t,key:r}}return null}venuesForMask(){let t=new Set;for(let o of this._style.layers)"splitBy"in o&&o.splitBy===Ct&&t.add(o.source??K);for(let o of this._style.layers){if(o.type!=="fill-extrusion"||"splitBy"in o&&o.splitBy)continue;let r=o.source??K;if(!t.has(r))continue;let n=this.sources.get(r),a=this._style.bucketKeyFor(o);if(n&&a!==null)return {source:n,key:a}}return null}addSource(t,o){if(this.sources.get(t)?.destroy(),this.sources.delete(t),this.rasterSources.get(t)?.destroy(),this.rasterSources.delete(t),o.type==="raster"){let n=new $t({url:o.url,minzoom:o.minzoom??0,maxzoom:o.maxzoom??19,cacheSize:this.quality.tileCacheSize*2});return n.on("data",()=>this.triggerRepaint()),n.on("error",({message:a})=>this.emit("error",{message:a})),this.rasterSources.set(t,n),this.triggerRepaint(),this}let r=new Po(this.pool,{url:o.url,minzoom:o.minzoom??0,maxzoom:o.maxzoom??14,cacheSize:this.quality.tileCacheSize*2,plan:this.planFor(t)});return r.on("data",()=>this.triggerRepaint()),r.on("error",({message:n})=>this.emit("error",{message:n})),t===K&&r.on("idle",()=>this.emit("idle",void 0)),this.sources.set(t,r),this.triggerRepaint(),this}initInput(){this.gestures=new mo(this.canvas,this.transform,t=>{this.animation=null,t==="zoom"&&this.emit("zoom",void 0),this.emitMove(),this.triggerRepaint();},()=>this.emit("moveend",void 0),this.options.gestures),this.initClicks(),this.initHash();}initClicks(){let t=null;this.canvas.addEventListener("pointerdown",r=>{r.button===0&&(t={x:r.clientX,y:r.clientY,t:performance.now()});}),this.canvas.addEventListener("pointerup",r=>{let n=t;if(t=null,r.button!==0||!n||Math.hypot(r.clientX-n.x,r.clientY-n.y)>4||performance.now()-n.t>500)return;let a=this.canvas.getBoundingClientRect(),l={x:r.clientX-a.left,y:r.clientY-a.top},s=this.objects.hitTest(this.transform,l),c=s?null:this.queryRoom(l),f=s||c?null:this.queryBuilding(l);this.options.highlightBuildings!==false&&(this.setHighlight(f),this.setRoomHighlight(c));for(let u of this.getPopups())u.closeOnClick&&this.removePopup(u);this.emit("click",{point:l,lngLat:this.transform.unproject(l),object:s,building:f,symbol:this.querySymbol(l,4)});}),this.canvas.addEventListener("dblclick",r=>{let n=this.pointOf(r);this.emit("dblclick",{point:n,lngLat:this.transform.unproject(n)});}),this.canvas.addEventListener("contextmenu",r=>{r.preventDefault();let n=this.pointOf(r);this.emit("contextmenu",{point:n,lngLat:this.transform.unproject(n)});});let o=0;this.canvas.addEventListener("pointermove",r=>{if(r.pointerType==="touch")return;let n=performance.now();if(n-o<16)return;o=n;let a=this.pointOf(r),l=this.querySymbol(a);this.setSymbolHover(l),this.emit("mousemove",{point:a,lngLat:this.transform.unproject(a),object:this.objects.hitTest(this.transform,a),symbol:l});});}pointOf(t){let o=this.canvas.getBoundingClientRect();return {x:t.clientX-o.left,y:t.clientY-o.top}}initResize(){this.resizeObserver=new ResizeObserver(()=>this.resize()),this.resizeObserver.observe(this.container),this.resize();}resize(){if(this.destroyed)return;let t=this.container.clientWidth||1,o=this.container.clientHeight||1,r=un(t,o,Math.min(window.devicePixelRatio||1,this.maxPixelRatio),this.densityQuality);this.canvas.width=Math.round(t*r),this.canvas.height=Math.round(o*r),this.transform.resize(t,o),this.triggerRepaint();}getCenter(){return this.transform.center}getZoom(){return this.transform.zoom}getBearing(){return this.transform.bearing}getPitch(){return this.transform.pitch}setCenter(t){return this.transform.center=Z(t),this.afterCameraChange()}setZoom(t){return this.transform.zoom=t,this.emit("zoom",void 0),this.afterCameraChange()}setBearing(t){return this.transform.bearing=t,this.afterCameraChange()}setPitch(t){return this.transform.pitch=t,this.afterCameraChange()}jumpTo(t){let o=this.transform;return t.center!==void 0&&(o.center=Z(t.center)),t.zoom!==void 0&&(o.zoom=t.zoom),t.bearing!==void 0&&(o.bearing=t.bearing),t.pitch!==void 0&&(o.pitch=t.pitch),this.animation=null,this.afterCameraChange()}easeTo(t){let o=t.duration??0;if(o<=0)return this.jumpTo(t);let r=this.transform,n={center:r.center,zoom:r.zoom,bearing:r.bearing,pitch:r.pitch},l={center:t.center!==void 0?Z(t.center):r.center,zoom:t.zoom??r.zoom,bearing:n.bearing+rt((t.bearing??r.bearing)-n.bearing),pitch:t.pitch??r.pitch};return this.animation={start:performance.now(),duration:o,from:n,to:l},this.triggerRepaint(),this}flyTo(t){let o=this.transform,r={center:o.center,zoom:o.zoom,bearing:o.bearing,pitch:o.pitch},a={center:t.center!==void 0?Z(t.center):o.center,zoom:t.zoom??o.zoom,bearing:r.bearing+rt((t.bearing??o.bearing)-r.bearing),pitch:t.pitch??o.pitch},l=Ge(r.zoom),s=(re(a.center.lng)-re(r.center.lng))*l,c=(ne(a.center.lat)-ne(r.center.lat))*l,f=Math.hypot(s,c),u=Math.max(o.width,o.height),h=u*Math.pow(2,r.zoom-a.zoom),m=1.42,d=m*m,p,y=null;if(f<1e-6){let g=Math.log(h/u);p=Math.abs(g)/m,y=v=>({u:0,w:u*Math.exp(m*Math.sign(g)*v)});}else {let g=w=>{let _=w===0?u:h,T=w===0?h:u;return (T*T-_*_+(w===0?1:-1)*d*d*f*f)/(2*_*d*f)},v=w=>Math.log(-g(w)+Math.sqrt(g(w)*g(w)+1)),x=v(0);p=(v(1)-x)/m;let S=w=>(Math.exp(w)+Math.exp(-w))/2,M=w=>(Math.exp(2*w)-1)/(Math.exp(2*w)+1);y=w=>{let _=m*w+x;return {u:u*S(x)*M(_)/d-u*Math.sinh(x)/d,w:u*S(x)/S(_)}};}if(!Number.isFinite(p)||p<=0)return this.jumpTo(t);let b=t.duration??Math.min(3e3,p/1.2*1e3);return this.animation={start:performance.now(),duration:b,from:r,to:a,fly:{S:p,u1:f,curve:y,w0:u}},this.triggerRepaint(),this}setPadding(t){return this.padding=cl(t),this.renderer.symbols&&(this.renderer.symbols.padding=this.padding),this.triggerRepaint(),this}getPadding(){return {...this.padding}}getBounds(){let t=this.transform,o=new St;for(let[r,n]of [[0,0],[t.width,0],[t.width,t.height],[0,t.height]])o.extend(t.unproject({x:r,y:n}));return o}cameraForBounds(t,o={}){let r=this.transform,n=Yo(t,{width:r.width,height:r.height,bearing:o.bearing??r.bearing,padding:o.padding!==void 0?cl(o.padding):this.padding,maxZoom:Math.min(o.maxZoom??r.maxZoom,r.maxZoom),minZoom:r.minZoom});return n?{...n,pitch:o.pitch??r.pitch}:null}fitBounds(t,o={}){let r=this.cameraForBounds(t,o);if(!r)return this;let n={...r,duration:o.duration??600};return o.fly?this.flyTo(n):this.easeTo(n)}stepAnimation(t){let o=this.animation;if(!o)return false;let r=we((t-o.start)/o.duration,0,1),n=o.fly?r:no(r),a=this.transform,l=Z(o.from.center),s=Z(o.to.center);if(o.fly){let{u:c,w:f}=o.fly.curve(o.fly.S*r),u=o.fly.u1>1e-6?we(c/o.fly.u1,0,1):r;return a.center={lng:l.lng+(s.lng-l.lng)*u,lat:l.lat+(s.lat-l.lat)*u},a.zoom=o.from.zoom+Math.log2(o.fly.w0/f),a.bearing=o.from.bearing+(o.to.bearing-o.from.bearing)*no(r),a.pitch=o.from.pitch+(o.to.pitch-o.from.pitch)*no(r),r>=1&&(a.center=s,a.zoom=o.to.zoom),this.emitMove(),r>=1?(this.animation=null,this.emit("moveend",void 0),false):true}return a.center={lng:l.lng+(s.lng-l.lng)*n,lat:l.lat+(s.lat-l.lat)*n},a.zoom=o.from.zoom+(o.to.zoom-o.from.zoom)*n,a.bearing=o.from.bearing+(o.to.bearing-o.from.bearing)*n,a.pitch=o.from.pitch+(o.to.pitch-o.from.pitch)*n,this.emitMove(),r>=1?(this.animation=null,this.emit("moveend",void 0),false):true}afterCameraChange(){return this.emitMove(),this.triggerRepaint(),this}emitMove(){let t=performance.now();t-this.lastMoveEmit<8||(this.lastMoveEmit=t,this.emit("move",void 0));}project(t,o=0){return this.transform.project(Z(t),o)}unproject(t){return this.transform.unproject(t)}get style(){return this._style}setStyle(t){let o=this._style,r=new ut(t);Object.assign(r.splitValues,o.splitValues),this._style=r,this.applyLayerOverrides();for(let[n,a]of this.sources.entries()){let l=JSON.stringify(o.workerPlan(n)),s=JSON.stringify(r.workerPlan(n));l!==s&&a.setPlan(this.planFor(n,r));}return this.objects3d?.setModelKey(t.model3dKey??""),this.triggerRepaint(),this}setTheme(t){return this.setStyle(xo(t,this.options.style))}static get themes(){return Object.keys(ht)}static get themeList(){return Object.entries(ht).map(([t,o])=>({id:t,name:o.name||t}))}setLayoutProperty(t,o,r){let n=this._style.layers.find(l=>l.id===t);if(!n)return console.warn(`[osmgl] \u0441\u043B\u043E\u0439 \u0441\u0442\u0438\u043B\u044F "${t}" \u043D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D`),this;let a=n.layout??(n.layout={});if(a[o]=r,this.rememberOverride(t,{layout:{[o]:r}}),o==="textField"||o==="iconImage"||o==="splitBy")for(let[l,s]of this.sources)s.setPlan(this.planFor(l));return this.triggerRepaint(),this}setPaintProperty(t,o,r){let n=this._style.layers.find(a=>a.id===t);return n?(n.paint[o]=r,this.rememberOverride(t,{paint:{[o]:r}}),this.triggerRepaint(),this):(console.warn(`[osmgl] \u0441\u043B\u043E\u0439 \u0441\u0442\u0438\u043B\u044F "${t}" \u043D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D`),this)}setShadows(t){let o=typeof t=="boolean"?{enabled:t}:t;return Object.assign(this.renderer.shadows,o),this.triggerRepaint(),this}querySymbol(t,o=2){let r=this.renderer.symbols?.querySymbol(t,o);return r?{layerId:r.layerId,text:r.text,icon:r.icon,lngLat:{lng:Se(r.mercX),lat:Ce(r.mercY)},key:gt.keyOf(r)}:null}setSymbolHover(t){return this.renderer.symbols?.setHover(t?.key??null)&&this.triggerRepaint(),this}setSymbolHidden(t){return this.renderer.symbols?.setHidden(t?.key??null)&&this.triggerRepaint(),this}queryBuilding(t){let o=null;for(let r of this._style.layers){if(r.type!=="fill-extrusion"||r.overlay||!this._style.layerVisibleAt(r,this.transform.zoom))continue;let n=this.sources.get(r.source??K);if(!n)continue;let a=Er(this.transform,n,r.id,t);a&&(!o||a.distance<o.distance)&&(o=a);}return o}setHighlight(t,o={}){return this.renderer.highlight=t?{layerId:t.layerId,featureId:t.featureId,color:o.color??this.options.highlightColor??"#4ec97f",opacity:o.opacity??.45}:null,this.triggerRepaint(),this}queryRoom(t){if(!this.renderer.indoorOpen)return null;let o=[],r=new B,n;for(let l of this._style.layers){if(l.type!=="fill"||!l.id.startsWith("indoor-")||l.id==="indoor-shell"||!this._style.layerVisibleAt(l,this.transform.zoom))continue;let s=this._style.bucketKeyFor(l);s&&(o.push(s),r.set(s,l.id),n??(n=this.sources.get(l.source??K)));}if(!n||!o.length)return null;let a=Ar(this.transform,n,o,t);return a?{...a,layerId:r.get(a.layerId)??a.layerId,bucketKey:a.layerId}:null}setRoomHighlight(t,o={}){return this.renderer.highlightFill=t?{layerId:t.layerId,bucketKey:t.bucketKey??t.layerId,featureId:t.featureId,color:o.color??this.options.highlightColor??"#4ec97f",opacity:o.opacity??.5}:null,this.triggerRepaint(),this}getHighlight(){let t=this.renderer.highlight;return t?{featureId:t.featureId,layerId:t.layerId}:null}initHash(){this.options.hash&&(this.on("move",()=>this.scheduleHash()),this.on("moveend",()=>this.scheduleHash(true)),this.onHashChange=()=>{this.writingHash||this.applyHash(true);},window.addEventListener("hashchange",this.onHashChange),this.scheduleHash(true));}scheduleHash(t=false){if(!(!this.options.hash||this.destroyed)){if(this.hashTimer){if(!t)return;clearTimeout(this.hashTimer);}this.hashTimer=setTimeout(()=>{this.hashTimer=0,this.writeHash();},t?0:300);}}writeHash(){if(!this.options.hash||this.destroyed)return;let t=this.transform,o=cn({center:t.center,zoom:t.zoom,bearing:t.bearing,pitch:t.pitch},this.hashName);this.writingHash=true,nl("#"+o),setTimeout(()=>this.writingHash=false,0);}applyHash(t){if(typeof window>"u")return;let o=fn(window.location.hash,this.hashName);if(!o)return;let r=this.transform;o.center&&(r.center=o.center),o.zoom!==void 0&&(r.zoom=o.zoom),o.bearing!==void 0&&(r.bearing=o.bearing),o.pitch!==void 0&&(r.pitch=o.pitch),t&&(this.emitMove(),this.triggerRepaint());}setQuality(t){this.qualityAuto=t==="auto";let o=t==="auto"?Go(No()):t;return this.qualityCeiling=o,this.resetFrameWindow(),this.applyQuality(_t(o)),this}getQuality(){return {auto:this.qualityAuto,profile:{...this.quality},pixelRatio:this.transform.width>0?this.canvas.width/this.transform.width:1}}applyQuality(t,o=false){let r=this.quality.simpleGeometry,n=o?r:t.simpleGeometry;if(this.quality={...t,simpleGeometry:n},this.resetFrameWindow(),this.objects3d&&(this.objects3d.budgetScale=t.modelBudget),r!==n)for(let[a,l]of this.sources.entries())l.setPlan(this.planFor(a));o||(this.densityQuality=t,this.options.maxPixelRatio===void 0&&(this.maxPixelRatio=t.maxPixelRatio)),this.renderer.detailScale=t.detail,this.renderer.allowShadows=t.allowShadows,this.renderer.shadows.resolution!==t.shadowMapSize&&this.setShadows({resolution:t.shadowMapSize});for(let a of this.sources.values())a.setCoverOptions({detailBias:t.detailBias,maxTiles:t.maxTiles});this.resize();}resetFrameWindow(){this.frameRing.fill(0),this.ringAt=0,this.ringSum=0,this.ringFilled=0,this.steadyFrames=0;}checkFrameBudget(t){if(!this.qualityAuto||this.sum(a=>a.pendingCount)>0)return;let o=t>ru?3:t>ou?1:0;if(this.ringSum+=o-this.frameRing[this.ringAt],this.frameRing[this.ringAt]=o,this.ringAt=(this.ringAt+1)%vn,this.ringFilled<vn&&this.ringFilled++,this.steadyFrames++,this.ringFilled<nu)return;let r=this.ringSum/this.ringFilled;if(r>=iu){let a=dn(this.quality.name);if(!a)return;console.info(`[osmgl] \u0442\u044F\u0436\u0451\u043B\u044B\u0445 \u043A\u0430\u0434\u0440\u043E\u0432 ${(r*100).toFixed(0)}% \u2014 \u043A\u0430\u0447\u0435\u0441\u0442\u0432\u043E \u043F\u043E\u043D\u0438\u0436\u0435\u043D\u043E \u0434\u043E \xAB${a}\xBB (\u043F\u043B\u043E\u0442\u043D\u043E\u0441\u0442\u044C \u0431\u0443\u0444\u0435\u0440\u0430 \u043F\u0440\u0435\u0436\u043D\u044F\u044F)`),this.applyQuality(_t(a),true);return}if(r>au||this.steadyFrames<lu)return;let n=al(this.quality.name);!n||hn(n)>hn(this.qualityCeiling)||(console.info(`[osmgl] \u043A\u0430\u0434\u0440\u044B \u0443\u043A\u043B\u0430\u0434\u044B\u0432\u0430\u044E\u0442\u0441\u044F \u0432 \u0431\u044E\u0434\u0436\u0435\u0442 \u2014 \u043A\u0430\u0447\u0435\u0441\u0442\u0432\u043E \u043F\u043E\u0434\u043D\u044F\u0442\u043E \u0434\u043E \xAB${n}\xBB`),this.applyQuality(_t(n),true));}getShadows(){return {...this.renderer.shadows}}setSky(t){let o=typeof t=="boolean"?{enabled:t}:t;return Object.assign(this._style.sky,o),this.triggerRepaint(),this}getSky(){return {...this._style.sky}}setLight(t){return Object.assign(this._style.light,t),this.triggerRepaint(),this}setLayerVisible(t,o){let r=this._style.layers.find(n=>n.id===t);return r&&(r.visible=o,this.rememberOverride(t,{visible:o}),this.triggerRepaint()),this}setObjects3DEnabled(t){return this.objects3dEnabled===t?this:(this.objects3dEnabled=t,this.triggerRepaint(),this)}get objects3DEnabled(){return this.objects3dEnabled}rasterLayerVisible(t){let o=this.transform.zoom;return this._style.layers.some(r=>r.type==="raster"&&r.source===t&&this._style.layerVisibleAt(r,o))}rememberOverride(t,o){let r=this.layerOverrides.get(t)??{};this.layerOverrides.set(t,{...r,...o,paint:{...r.paint??{},...o.paint??{}},layout:{...r.layout??{},...o.layout??{}}});}applyLayerOverrides(){if(this.layerOverrides.size)for(let t of this._style.layers){let o=this.layerOverrides.get(t.id);if(o&&(o.visible!==void 0&&(t.visible=o.visible),o.paint&&Object.assign(t.paint??(t.paint={}),o.paint),o.layout)){let r=t;Object.assign(r.layout??(r.layout={}),o.layout);}}}setBackground(t){return this.background=he(t),this.triggerRepaint(),this}getIndoorLevels(){let t=[];for(let[o,r]of this.sources.entries())if(this._style.layers.some(n=>(n.source??K)===o&&"splitBy"in n&&n.splitBy===Ct))for(let n of r.splitValues(Ct)){let a=Number(n);Number.isFinite(a)&&!t.includes(a)&&t.push(a);}return t.sort((o,r)=>o-r)}getIndoorLevel(){let t=this._style.splitValues[Ct];return typeof t=="number"?t:null}setIndoorLevel(t){return t===null?delete this._style.splitValues[Ct]:this._style.splitValues[Ct]=t,this.triggerRepaint(),this}syncIndoor(){let t=this.getIndoorLevels(),o=t.join(",");if(o!==this.lastIndoorKey){if(this.lastIndoorKey=o,this.autoIndoorLevel){let r=this.getIndoorLevel();t.length?(r===null||!t.includes(r))&&this.setIndoorLevel(t.includes(0)?0:t.find(n=>n>=0)??t[0]):r!==null&&this.setIndoorLevel(null);}this.emit("indoor",{levels:t,level:this.getIndoorLevel()});}}addObject(t){return this.objects.add(t),this.triggerRepaint(),this}removeObject(t){return this.objects.remove(t),this.triggerRepaint(),this}getObjects(){return this.objects.all}updateObject(){return this.triggerRepaint(),this}addModel(t){return this.renderer.models.add(t),this.triggerRepaint(),this}removeModel(t){return this.renderer.models.remove(t,this.ctx?.gl),this.triggerRepaint(),this}getObjects3DStats(){return this.objects3d?.stats??null}getModels(){return this.renderer.models.all}addMarker(t){return this.objects.addMarker(t),t.update(this.transform),this}removeMarker(t){return this.objects.removeMarker(t),this}getMarkers(){return this.objects.allMarkers}addPopup(t){return t.onCloseRequest(()=>this.removePopup(t)),this.objects.addMarker(t),t.update(this.transform),this}removePopup(t){return this.objects.removeMarker(t),this}getPopups(){return this.objects.allMarkers.filter(t=>t instanceof Jt)}objectAt(t,o=4){return this.objects.hitTest(this.transform,t,o)}setProjection(t){let o=this.transform;if(o.projection===t)return this;o.projection=t;let r=o.effectiveMinZoom(),n=t==="globe"?Math.min(o.maxPitch,Mt):o.maxPitch,a=o.zoom<r,l=o.pitch>n;return a||l?this.easeTo({zoom:a?r:o.zoom,pitch:l?n:o.pitch,duration:600}):(this.emit("move",void 0),this.triggerRepaint()),this}getProjection(){return this.transform.projection}refreshSource(t){return this.sources.get(t)?.reload(),this.rasterSources.get(t)?.reload(),this.triggerRepaint(),this}refresh(){for(let t of this.sources.values())t.reload();for(let t of this.rasterSources.values())t.reload();return this.renderer.refreshHighlight(),this.triggerRepaint(),this}sum(t){let o=0;for(let r of this.sources.values())o+=t(r);return o}getStats(){return {pendingTiles:this.sum(t=>t.pendingCount),visibleTiles:this.sum(t=>t.visibleTiles.length),labels:this.renderer.symbols?.placedCount??0,models:this.renderer.models.readyCount,workers:this.pool.usingWorkers?this.pool.size:0,renderer:this.ctx?.caps.rendererName??"\u043D\u0435\u0442 \u043A\u043E\u043D\u0442\u0435\u043A\u0441\u0442\u0430"}}triggerRepaint(){this.destroyed||(this.needsRepaint=true,!this.frameHandle&&(this.frameHandle=requestAnimationFrame(t=>{this.frameHandle=0,this.renderFrame(t);})));}renderFrame(t){if(this.destroyed||!this.ctx)return;let o=performance.now();this.needsRepaint=false;let r=this.stepAnimation(t),n=this.ctx;n.bindFramebuffer(null),n.viewport(0,0,this.canvas.width,this.canvas.height),n.setDepthMask(true),n.clear(this.background??this._style.background,true,true);for(let m of this.sources.values())m.update(this.transform);this.updateObjects3D();for(let[m,d]of this.rasterSources)this.rasterLayerVisible(m)&&d.update(this.transform);this.syncIndoor(),this.objects.updateMarkers(this.transform);let a=(this.sources.size>0||this.rasterSources.size>0)&&this.renderer.render(n,this.transform,this.sources,this._style,t,this.rasterSources),l=performance.now()-o,s=r||a||this.needsRepaint,c=this.lastFrameAt>0?t-this.lastFrameAt:0,f=c>0&&c<su,u=f?c:0;this.continuousFrames=f?this.continuousFrames+1:0;let h=this.continuousFrames>1?c:l;this.lastFrameAt=t,this.checkFrameBudget(h),this.emit("render",{frameMs:l,intervalMs:u}),s&&this.triggerRepaint();}stopFrameLoop(){this.frameHandle&&cancelAnimationFrame(this.frameHandle),this.frameHandle=0;}get isLoaded(){return this.loaded}destroy(){if(this.onHashChange&&(window.removeEventListener("hashchange",this.onHashChange),this.onHashChange=null),this.hashTimer&&clearTimeout(this.hashTimer),!this.destroyed){this.destroyed=true,this.stopFrameLoop(),this.resizeObserver?.disconnect(),this.gestures?.destroy();for(let t of this.sources.values())t.destroy();this.sources.clear();for(let t of this.rasterSources.values())t.destroy();this.rasterSources.clear(),this.objects.destroy(),this.markerHost?.remove(),this.pool.destroy(),this.ctx&&this.renderer.destroy(this.ctx),this.removeAllListeners(),this.canvas.remove();}}},q0=wn;
|
|
1965
|
+
exports.AssetLoader=qt;exports.BASE_SOURCE=K;exports.BUILDING_HEIGHT_SCALE=lt;exports.BUILDING_VERTEX_STRIDE=Me;exports.CITY_STYLE=ac;exports.Circle=bn;exports.DEFAULT_ICONS=tt;exports.DEFAULT_LIGHT=yr;exports.DEFAULT_SHADOWS=Pa;exports.DEFAULT_SKY=br;exports.DEFAULT_STYLE=gr;exports.DepthTarget=It;exports.EARTH_CIRCUMFERENCE=ao;exports.FILL_VERTEX_STRIDE=Ne;exports.GLOBE_MAX_PITCH=Mt;exports.GLOBE_ZOOM_MAX=Ze;exports.GLOBE_ZOOM_MIN=co;exports.GLYPH_BORDER=be;exports.GLYPH_SIZE=Ve;exports.GROUND_SCALE=_s;exports.GeomType=Et;exports.GlyphSource=Ut;exports.GroundArrows=Rt;exports.IconSource=Xt;exports.IndoorMask=zt;exports.LEVEL_LIMIT=Ss;exports.LINE_VERTEX_STRIDE=Ue;exports.LayerRenderer=Gt;exports.LngLatBounds=St;exports.MAX_LATITUDE=_n;exports.MODEL_VERTEX_STRIDE=Eo;exports.Map=wn;exports.MapObject=eo;exports.Marker=Qt;exports.Model=Zt;exports.ModelLayer=Xe;exports.ObjectManager=Ot;exports.Polygon=Uo;exports.Polyline=pn;exports.Popup=Jt;exports.RELIEF_STYLE=ic;exports.RUNTIME_FILL_STRIDE=Lr;exports.RUNTIME_LINE_STRIDE=mt;exports.RasterSource=$t;exports.RasterTile=Ho;exports.SDF_EDGE=Nr;exports.SDF_PX=jt;exports.SOFT_STYLE=nc;exports.SPLIT_SEP=Gi;exports.SURFACE_CUT_BLEED=At;exports.SURFACE_LEVEL_SCALE=li;exports.SURFACE_VERTEX_STRIDE=st;exports.SdfAtlas=Nt;exports.Style=ut;exports.SymbolRenderer=gt;exports.THEMES=ht;exports.TILE_SIZE=qe;exports.TileID=wt;exports.Transform=Tt;exports.VectorTile=kt;exports.VectorTileFeature=po;exports.VectorTileLayer=bo;exports.abbreviateStreet=on;exports.addGround=dr;exports.altitudeFromMercatorZ=bu;exports.applyTheme=wo;exports.arrowLabelOffset=Ka;exports.arrowVertices=gc;exports.buildRuntimeFill=Ir;exports.buildRuntimeLine=Pt;exports.cameraForBounds=Yo;exports.circumferenceAtLatitude=Ae;exports.clampLat=lo;exports.clampPixelRatio=un;exports.clipLineToRect=Xr;exports.coordinateDigits=rl;exports.coveringTiles=Kt;exports.createGround=hr;exports.default=q0;exports.deviceHints=No;exports.distToSegment=ll;exports.evaluateColor=Ee;exports.evaluateNumber=D;exports.extractFeature=Mo;exports.featureLevel=et;exports.fillFootprint=Cr;exports.fogPlanes=dt;exports.footprintOf=Sr;exports.formatHash=cn;exports.generateBuildings=nr;exports.generateFill=ur;exports.generateLine=pr;exports.generateSurface=fr;exports.generateSymbols=nn;exports.globeBasis=Qo;exports.globeFlatMix=uo;exports.globeRadius=fo;exports.globeToLocal=Ln;exports.groundAt=go;exports.iconRotation=$a;exports.insideFootprint=We;exports.latFromMercatorY=Ce;exports.lngFromMercatorX=Se;exports.lngLatToUnit=ho;exports.matchesFilter=pe;exports.mercatorMetersPerTile=Xo;exports.mercatorX=re;exports.mercatorY=ne;exports.mercatorZFromAltitude=jo;exports.metersPerPixel=gu;exports.metersPerTile=Cn;exports.nextQualityDown=dn;exports.parseGlb=Wc;exports.parseGlbAsync=zr;exports.parseGlyphs=Oa;exports.parseHash=fn;exports.patchUV=xa;exports.pickBuilding=Er;exports.pickFill=Ar;exports.pitchIntent=On;exports.pixelsPerMeter=yu;exports.placeAlongLine=Kr;exports.pointInRing=gn;exports.qualityFor=Go;exports.qualityProfile=_t;exports.raySphere=Jo;exports.resolveTemplate=rn;exports.roundRing=Re;exports.sdfFromAlpha=Ur;exports.shapeText=jr;exports.splitBucketKey=ze;exports.splitByGround=mr;exports.splitPolygons=Qe;exports.styleWithTheme=xo;exports.tileOriginMeters=Sn;exports.tileUrl=qa;exports.toLngLat=Z;exports.unitToLngLat=Zo;exports.worldSize=Ge;//# sourceMappingURL=osmgl.cjs.map
|
|
1954
1966
|
//# sourceMappingURL=osmgl.cjs.map
|