osmgl 0.7.3 → 0.8.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/dist/osmgl.cjs CHANGED
@@ -1,11 +1,11 @@
1
- 'use strict';Object.defineProperty(exports,'__esModule',{value:true});var ni=require('earcut'),Wl=require('pbf'),ci=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 ni__default=/*#__PURE__*/_interopDefault(ni);var Wl__default=/*#__PURE__*/_interopDefault(Wl);var ci__namespace=/*#__PURE__*/_interopNamespace(ci);var B=Map,ee=Set;var Ne=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 Ae=i=>i*Math.PI/180,En=i=>i*180/Math.PI;function nt(i){let e=((i+180)%360+360)%360-180;return e===-180?180:e}var lo=i=>1-Math.pow(1-i,3);function ce(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 so=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.screen=null;this.gl=e,this.caps=_l(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){let t=e??this.screen;this._framebuffer!==t&&(this.gl.bindFramebuffer(this.gl.FRAMEBUFFER,t),this._framebuffer=t);}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 _l(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 Ze=512,co=40075016686e-3,An=85.051129;function Z(i){return Array.isArray(i)?{lng:i[0],lat:i[1]}:i}var Ue=i=>512*Math.pow(2,i),fo=i=>Math.max(-An,Math.min(An,i));function oe(i){return (180+i)/360}function re(i){let e=fo(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 co*Math.cos(i*Math.PI/180)}function $o(i,e){return i/Le(e)}function zu(i,e){return i*Le(e)}function Pu(i,e){return $o(1,i)*Ue(e)}function Hu(i,e){return Le(i)/Ue(e)}function Ln(i,e){let t=Math.pow(2,i);return Le(Ce((e+.5)/t))/t}function qo(i){return co/Math.pow(2,i)}function In(i,e,t){let o=qo(i),r=65536;return [(e*o%r+r)%r,(t*o%r+r)%r]}var Mt=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:oe(this.west),maxX:oe(this.east),minY:re(this.north),maxY:re(this.south)}}};function Zo(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,Rn),r=Math.max(e.height-t.top-t.bottom,Rn),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,d=0,h=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;d=Math.max(d,Math.abs(C)*2),h=Math.max(h,Math.abs(S)*2);}let m=Math.min(o/Math.max(d,1e-12),r/Math.max(h,1e-12)),y=Math.min(Math.max(Math.log2(m/512),e.minZoom??0),e.maxZoom??22),p=Ue(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(u-(-b*c+g*s))},zoom:y,bearing:a}}var Rn=32;function N(){let i=new Float64Array(16);return i[0]=i[5]=i[10]=i[15]=1,i}function We(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],d=e[9],h=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 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*y,i[v*4+1]=x*r+C*s+S*d+M*p,i[v*4+2]=x*n+C*c+S*h+M*b,i[v*4+3]=x*a+C*f+S*m+M*g;}return i}function Fe(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 Jo(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],d=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+d*o,i[8]=c*r-n*o,i[9]=f*r-a*o,i[10]=u*r-l*o,i[11]=d*r-s*o,i}function er(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],d=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+d*o,i[4]=c*r-n*o,i[5]=f*r-a*o,i[6]=u*r-l*o,i[7]=d*r-s*o,i}function zn(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 Pn(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 ze(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],d=e[10],h=e[11],m=e[12],y=e[13],p=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*y-u*m,_=f*p-d*m,T=f*b-h*m,L=u*p-d*y,E=u*b-h*y,z=d*b-h*p,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]=(y*M-p*S+b*C)*A,i[3]=(d*S-u*M-h*C)*A,i[4]=(s*T-a*z-c*_)*A,i[5]=(t*z-r*T+n*_)*A,i[6]=(p*x-m*M-b*v)*A,i[7]=(f*M-d*x+h*v)*A,i[8]=(a*E-l*T+c*w)*A,i[9]=(o*T-t*E-n*w)*A,i[10]=(m*S-y*x+b*g)*A,i[11]=(u*x-f*S-h*g)*A,i[12]=(l*_-a*L-s*w)*A,i[13]=(t*L-o*_+r*w)*A,i[14]=(y*v-m*C-p*g)*A,i[15]=(f*C-u*v+d*g)*A,i):null}function fe(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 Be(i,e){for(let t=0;t<16;t++)i[t]=e[t];return i}function uo(i){let e=Math.hypot(i[0],i[1],i[2])||1;return [i[0]/e,i[1]/e,i[2]/e]}function Fn(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 Cl(i,e){return [i[0]-e[0],i[1]-e[1],i[2]-e[2]]}function Qo(i,e){return i[0]*e[0]+i[1]*e[1]+i[2]*e[2]}function Hn(i,e,t,o){let r=uo(Cl(t,e)),n=uo(Fn(r,o)),a=Fn(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]=-Qo(n,e),i[13]=-Qo(a,e),i[14]=Qo(r,e),i[15]=1,i}var Tt=60,ho=4.5,Qe=6,mo=i=>i/(2*Math.PI);function po(i){if(i<=ho)return 0;if(i>=Qe)return 1;let e=(i-ho)/(Qe-ho);return e*e*(3-2*e)}function bo(i,e){let t=i*Math.PI/180,o=fo(e)*Math.PI/180,r=Math.cos(o);return [r*Math.sin(t),-Math.sin(o),r*Math.cos(t)]}function tr(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 Sl(i,e){return bo(Se(i),Ce(e))}function or(i,e){let t=i*Math.PI/180,o=fo(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 On(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 Ml(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 Wn(i,e,t,o,r,n,a,l){let s=On(Sl(i,e),r,a);if(l<=0)return s;let c=Ml(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 rr(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 Bn=1e3,Tl=2,Vn=84,kl=.42,kt=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=Ae(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=kl*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=nt(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<Qe?Math.min(this.maxPitch,Tt):this.maxPitch,o=we(e,this.minPitch,t);o!==this._pitch&&(this._pitch=o,this._dirty=true);}get fov(){return En(this._fov)}set fov(e){let t=Ae(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){if(this._ensure(),this.globeActive){let a=this.globeLocal(oe(e.lng),re(e.lat));a[2]+=t*this._pixelsPerMeter;let l=this.localToPoint(a);if(l)return l}let o=[oe(e.lng)*this._worldSize,re(e.lat)*this._worldSize,t,1],r=[0,0,0,0];fe(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 fe(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];fe(t,this._pixelMatrixInverse,[e.x,e.y,0,1]),fe(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=nt(this._center.lng+(e.lng-l.lng)),c=we(this._center.lat+(e.lat-l.lat),-Vn,Vn);this._center={lng:s,lat:c},this._dirty=true;return}let o=this.pointToWorldPx(t),r={x:oe(e.lng)*this._worldSize,y:re(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 Fe(n,this._projMatrix,o.minX*this._worldSize,o.minY*this._worldSize,0),Ie(n,n,r,r,1),Be(this._f32,n)}tileMatrix64(e,t,o=N()){this._ensure();let r=e.bounds(),n=(r.maxX-r.minX)*this._worldSize/t;return Fe(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 Fe(r,this._projMatrix,e*this._worldSize,t*this._worldSize,o),Ie(r,r,this._worldSize,this._worldSize,1),Be(this._objectF32,r)}horizonScreenY(){this._ensure();let e=Math.PI/2-Ae(this._pitch),o=this.height/2/Math.tan(this._fov/2)*Math.tan(Math.min(e,Ae(89.5)));return this.height/2-Math.min(o,this.height*50)}get globeActive(){return this._ensure(),this.projection==="globe"&&this._zoom<Qe}get globeFlatMix(){return this._ensure(),po(this._zoom)}get globeRadiusPx(){return this._ensure(),mo(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(!ze(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];fe(a,this._localPixelInverse,[r,n,0,1]),fe(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,d=l[2]/c-a[2]/s,h=Math.hypot(f,u,d)||1;return [f/h,u/h,d/h]})}cameraRay(){this._ensure();let e=Ae(this._pitch),t=Ae(this._bearing),o=Math.sin(e),r=Math.cos(e),n=Math.sin(t),a=Math.cos(t);return {right:[a,n,0],up:[n*r,-a*r,o],fwd:[n*o,-a*o,-r],focal:this.height/2/Math.tan(this._fov/2),axisElev:e-Math.PI/2}}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(),Be(this._localF32,this._localProj)}globeLocal(e,t){return this._ensure(),Wn(e,t,this._centerX/this._worldSize,this._centerY/this._worldSize,this.globeRadiusPx,this._worldSize,this._globeBasis,po(this._zoom))}localToPoint(e){this._ensure();let t=[0,0,0,0];return fe(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];fe(t,this._localPixelInverse,[e.x,e.y,0,1]),fe(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=rr(l,f,a);if(!u)return null;let d=this._globeBasis,h=[u[0]/a,u[1]/a,u[2]/a],m=[h[0]*d.east[0]+h[1]*d.south[0]+h[2]*d.up[0],h[0]*d.east[1]+h[1]*d.south[1]+h[2]*d.up[1],h[0]*d.east[2]+h[1]*d.south[2]+h[2]*d.up[2]];return tr(m)}isOnGlobeFront(e,t,o=.06){this._ensure();let r=this.globeCamera(),n=this._globeBasis,a=bo(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)*Tl,r=N();if(!ze(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(fe(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=uo(e),c=Math.abs(s[2])>.999?[0,1,0]:[0,0,1],f=this._shadowView;Hn(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),d=1/0,h=1/0,m=1/0,y=-1/0,p=-1/0,b=-1/0,g=[0,0,0,0];for(let C of a)for(let S of [0,u])fe(g,f,[C.x,C.y,S,1]),g[0]<d&&(d=g[0]),g[0]>y&&(y=g[0]),g[1]<h&&(h=g[1]),g[1]>p&&(p=g[1]),g[2]<m&&(m=g[2]),g[2]>b&&(b=g[2]);let v=u+1,x=this._shadowProj;Pn(x,d,y,h,p,-b-v,-m+v),xe(this._shadowVP,x,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 Fe(r,this._shadowVPm,e*this._worldSize,t*this._worldSize,o),Ie(r,r,this._worldSize,this._worldSize,1),Be(this._shadowObject32,r)}shadowTileMatrix(e,t){this._ensure();let o=e.bounds(),r=(o.maxX-o.minX)*this._worldSize/t,n=this._shadowTile;return Fe(n,this._shadowVPm,o.minX*this._worldSize,o.minY*this._worldSize,0),Ie(n,n,r,r,1),Be(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=Bn*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-Bn*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=Ue(this._zoom);this._worldSize=e,this._pixelsPerMeter=$o(1,this._center.lat)*e,this._centerX=oe(this._center.lng)*e,this._centerY=re(this._center.lat)*e;let t=Math.max(this.width,1),o=Math.max(this.height,1),r=Ae(this._pitch),n=-Ae(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),d=o/50;if(this.projection==="globe"&&this._zoom<Qe){let g=mo(e);d=Math.max(a-g*1.6,a*.02),u=a+g*2.4;}let h=this._viewMatrix;Ie(h,N(),1,-1,1),Fe(h,h,0,0,-a),Jo(h,h,r),er(h,h,n),Fe(h,h,-this._centerX,-this._centerY,0);let m=N();zn(m,this._fov,t/o,d,u),xe(this._viewProjPx,m,h);let y=N();Ie(y,h,1,1,this._pixelsPerMeter),xe(this._projMatrix,m,y);let p=this._localView;Ie(p,N(),1,-1,1),Fe(p,p,0,0,-a),Jo(p,p,r),er(p,p,n),xe(this._localProj,m,p),this._globeBasis=or(this._center.lng,this._center.lat);let b=N();Ie(b,N(),t/2,-o/2,1),Fe(b,b,1,-1,0),xe(this._pixelMatrix,b,this._projMatrix),ze(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),ze(this._localPixelInverse,this._localPixel),this._calcCameraPosition(),this._calcFrustum();}_calcCameraPosition(){let e=N();if(!ze(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(!ze(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];fe(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],d=t[c],h=u[0]-f[0],m=u[1]-f[1],y=u[2]-f[2],p=d[0]-f[0],b=d[1]-f[1],g=d[2]-f[2],v=m*g-y*b,x=y*p-h*g,C=h*b-m*p,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 El={dragPan:true,scrollZoom:true,dragRotate:true,touchZoomRotate:true,touchPitch:true,doubleClickZoom:true,keyboard:true,inertia:1},Dn=2,Al=100,Ll=.5,Il=.1,Rl=25,Gn=i=>Math.abs(i.y)>Math.abs(i.x);function Un(i,e,t){let o=Math.hypot(i.x,i.y)>=Dn,r=Math.hypot(e.x,e.y)>=Dn;return !o&&!r?void 0:!o||!r?t<Al?void 0:false:i.y>0==e.y>0&&Gn(i)&&Gn(e)}function Nn(i,e){let t=(i-e)*(180/Math.PI);for(;t>180;)t-=360;for(;t<=-180;)t+=360;return t}var Fl=160,nr=4,yo=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={...El,...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?Un(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*Ll,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))>=Il&&(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=Rl/Math.max(Math.PI*e.minDist,1)*360;if(!e.rotateActive&&Math.abs(Nn(n,e.startAngle))>=u&&(e.rotateActive=true),e.rotateActive){let d=Math.atan2(e.lastB.y-e.lastA.y,e.lastB.x-e.lastA.x),h=Nn(n,d);h!==0&&(this.tr.bearing=this.tr.bearing-h,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>Fl;)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>nr&&(r=r/a*nr,n=n/a*nr);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 d={x:this.tr.width/2,y:this.tr.height/2};this.panBy(-r*f,-n*f,d),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);}},he=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);}},ue=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 Pl=["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=Hl(n),s=Xn(a,a.VERTEX_SHADER,jn(o,l),`${t}.vert`),c=Xn(a,a.FRAGMENT_SHADER,jn(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),Pl.forEach((u,d)=>a.bindAttribLocation(f,d,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 Hl(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 jn(i,e){if(!e)return i;let t=i.match(/^\s*#version[^\n]*\n/);return t?i.slice(0,t[0].length)+e+`
1
+ 'use strict';Object.defineProperty(exports,'__esModule',{value:true});var mi=require('earcut'),es=require('pbf'),Gs=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 mi__default=/*#__PURE__*/_interopDefault(mi);var es__default=/*#__PURE__*/_interopDefault(es);var Gs__namespace=/*#__PURE__*/_interopNamespace(Gs);var z=Map,ee=Set;var Ue=class{constructor(){this.listeners=new z;}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 xe=(i,e,t)=>i<e?e:i>t?t:i;var Ie=i=>i*Math.PI/180,Pn=i=>i*180/Math.PI;function lt(i){let e=((i+180)%360+360)%360-180;return e===-180?180:e}var co=i=>1-Math.pow(1-i,3);function de(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 Ce(i){return [i[0]*i[3],i[1]*i[3],i[2]*i[3],i[3]]}var fo=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 z;this._stencilTest=false;this.screen=null;this.gl=e,this.caps=Bl(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){let t=e??this.screen;this._framebuffer!==t&&(this.gl.bindFramebuffer(this.gl.FRAMEBUFFER,t),this._framebuffer=t);}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 Bl(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 Je=512,uo=40075016686e-3,Hn=85.051129;function te(i){return Array.isArray(i)?{lng:i[0],lat:i[1]}:i}var je=i=>512*Math.pow(2,i),ho=i=>Math.max(-Hn,Math.min(Hn,i));function le(i){return (180+i)/360}function se(i){let e=ho(i);return (180-180/Math.PI*Math.log(Math.tan(Math.PI/4+e*Math.PI/360)))/360}function Te(i){return i*360-180}function Se(i){let e=180-i*360;return 360/Math.PI*Math.atan(Math.exp(e*Math.PI/180))-90}function Le(i){return uo*Math.cos(i*Math.PI/180)}function er(i,e){return i/Le(e)}function ed(i,e){return i*Le(e)}function td(i,e){return er(1,i)*je(e)}function od(i,e){return Le(i)/je(e)}function On(i,e){let t=Math.pow(2,i);return Le(Se((e+.5)/t))/t}function mo(i){return uo/Math.pow(2,i)}function Bn(i,e,t){let o=mo(i),r=65536;return [(e*o%r+r)%r,(t*o%r+r)%r]}var At=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=te(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=te(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:le(this.west),maxX:le(this.east),minY:se(this.north),maxY:se(this.south)}}};function tr(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,u=(n.minY+n.maxY)/2,d=0,h=0;for(let[v,w]of [[n.minX,n.minY],[n.maxX,n.minY],[n.maxX,n.maxY],[n.minX,n.maxY]]){let x=(v-f)*s-(w-u)*c,_=(v-f)*c+(w-u)*s;d=Math.max(d,Math.abs(x)*2),h=Math.max(h,Math.abs(_)*2);}let m=Math.min(o/Math.max(d,1e-12),r/Math.max(h,1e-12)),y=Math.min(Math.max(Math.log2(m/512),e.minZoom??0),e.maxZoom??22),p=je(y),b=(t.left-t.right)/2/p,g=(t.top-t.bottom)/2/p;return {center:{lng:Te(f-(b*s+g*c)),lat:Se(u-(-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 We(i){return i.fill(0),i[0]=i[5]=i[10]=i[15]=1,i}function _e(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],d=e[9],h=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],x=t[v*4+1],_=t[v*4+2],M=t[v*4+3];i[v*4]=w*o+x*l+_*u+M*y,i[v*4+1]=w*r+x*s+_*d+M*p,i[v*4+2]=w*n+x*c+_*h+M*b,i[v*4+3]=w*a+x*f+_*m+M*g;}return i}function ze(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 Re(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 rr(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],d=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+d*o,i[8]=c*r-n*o,i[9]=f*r-a*o,i[10]=u*r-l*o,i[11]=d*r-s*o,i}function nr(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],d=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+d*o,i[4]=c*r-n*o,i[5]=f*r-a*o,i[6]=u*r-l*o,i[7]=d*r-s*o,i}function Dn(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 Nn(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 Pe(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],d=e[10],h=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,x=o*s-r*l,_=o*c-n*l,M=r*c-n*s,C=f*y-u*m,S=f*p-d*m,T=f*b-h*m,A=u*p-d*y,k=u*b-h*y,L=d*b-h*p,R=g*L-v*k+w*A+x*T-_*S+M*C;return R?(R=1/R,i[0]=(l*L-s*k+c*A)*R,i[1]=(r*k-o*L-n*A)*R,i[2]=(y*M-p*_+b*x)*R,i[3]=(d*_-u*M-h*x)*R,i[4]=(s*T-a*L-c*S)*R,i[5]=(t*L-r*T+n*S)*R,i[6]=(p*w-m*M-b*v)*R,i[7]=(f*M-d*w+h*v)*R,i[8]=(a*k-l*T+c*C)*R,i[9]=(o*T-t*k-n*C)*R,i[10]=(m*_-y*w+b*g)*R,i[11]=(u*w-f*_-h*g)*R,i[12]=(l*S-a*A-s*C)*R,i[13]=(t*A-o*S+r*C)*R,i[14]=(y*v-m*x-p*g)*R,i[15]=(f*x-u*v+d*g)*R,i):null}function he(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 Ve(i,e){for(let t=0;t<16;t++)i[t]=e[t];return i}function po(i){let e=Math.hypot(i[0],i[1],i[2])||1;return [i[0]/e,i[1]/e,i[2]/e]}function Vn(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 Wl(i,e){return [i[0]-e[0],i[1]-e[1],i[2]-e[2]]}function or(i,e){return i[0]*e[0]+i[1]*e[1]+i[2]*e[2]}function Gn(i,e,t,o){let r=po(Wl(t,e)),n=po(Vn(r,o)),a=Vn(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]=-or(n,e),i[13]=-or(a,e),i[14]=or(r,e),i[15]=1,i}var It=60,bo=4.5,et=6,yo=i=>i/(2*Math.PI);function go(i){if(i<=bo)return 0;if(i>=et)return 1;let e=(i-bo)/(et-bo);return e*e*(3-2*e)}function vo(i,e){let t=i*Math.PI/180,o=ho(e)*Math.PI/180,r=Math.cos(o);return [r*Math.sin(t),-Math.sin(o),r*Math.cos(t)]}function ir(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 Vl(i,e){return vo(Te(i),Se(e))}function ar(i,e){let t=i*Math.PI/180,o=ho(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 Un(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 jn(i,e,t,o,r,n,a,l){let s=Un(Vl(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 lr(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 Xn=1e3,Nl=2,Kn=84,Gl=.42,Lt=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=Ie(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=Gl*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=xe(e,this.effectiveMinZoom(),this.maxZoom);t!==this._zoom&&(this._zoom=t,this._dirty=true);}get bearing(){return this._bearing}set bearing(e){let t=lt(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<et?Math.min(this.maxPitch,It):this.maxPitch,o=xe(e,this.minPitch,t);o!==this._pitch&&(this._pitch=o,this._dirty=true);}get fov(){return Pn(this._fov)}set fov(e){let t=Ie(xe(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){if(this._ensure(),this.globeActive){let a=this.globeLocal(le(e.lng),se(e.lat));a[2]+=t*this._pixelsPerMeter;let l=this.localToPoint(a);if(l)return l}let o=[le(e.lng)*this._worldSize,se(e.lat)*this._worldSize,t,1],r=[0,0,0,0];he(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:Te(e/this._worldSize),lat:Se(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 he(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:Te(t.x/this._worldSize),lat:Se(t.y/this._worldSize)}}pointToWorldPx(e){this._ensure();let t=[0,0,0,0],o=[0,0,0,0];he(t,this._pixelMatrixInverse,[e.x,e.y,0,1]),he(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=xe(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=lt(this._center.lng+(e.lng-l.lng)),c=xe(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:le(e.lng)*this._worldSize,y:se(e.lat)*this._worldSize},n=r.x-o.x,a=r.y-o.y;this._center={lng:Te((this._centerX+n)/this._worldSize),lat:Se((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 ze(n,this._projMatrix,o.minX*this._worldSize,o.minY*this._worldSize,0),Re(n,n,r,r,1),Ve(this._f32,n)}tileMatrix64(e,t,o=G()){this._ensure();let r=e.bounds(),n=(r.maxX-r.minX)*this._worldSize/t;return ze(o,this._projMatrix,r.minX*this._worldSize,r.minY*this._worldSize,0),Re(o,o,n,n,1),o}objectMatrix(e,t,o=0){this._ensure();let r=this._objectMatrix;return ze(r,this._projMatrix,e*this._worldSize,t*this._worldSize,o),Re(r,r,this._worldSize,this._worldSize,1),Ve(this._objectF32,r)}horizonScreenY(){this._ensure();let e=Math.PI/2-Ie(this._pitch),o=this.height/2/Math.tan(this._fov/2)*Math.tan(Math.min(e,Ie(89.5)));return this.height/2-Math.min(o,this.height*50)}get globeActive(){return this._ensure(),this.projection==="globe"&&this._zoom<et}get globeFlatMix(){return this._ensure(),go(this._zoom)}get globeRadiusPx(){return this._ensure(),yo(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(!Pe(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];he(a,this._localPixelInverse,[r,n,0,1]),he(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,d=l[2]/c-a[2]/s,h=Math.hypot(f,u,d)||1;return [f/h,u/h,d/h]})}cameraRay(){this._ensure();let e=Ie(this._pitch),t=Ie(this._bearing),o=Math.sin(e),r=Math.cos(e),n=Math.sin(t),a=Math.cos(t);return {right:[a,n,0],up:[n*r,-a*r,o],fwd:[n*o,-a*o,-r],focal:this.height/2/Math.tan(this._fov/2),axisElev:e-Math.PI/2}}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(),Ve(this._localF32,this._localProj)}globeLocal(e,t){return this._ensure(),jn(e,t,this._centerX/this._worldSize,this._centerY/this._worldSize,this.globeRadiusPx,this._worldSize,this._globeBasis,go(this._zoom))}localToPoint(e){this._ensure();let t=[0,0,0,0];return he(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];he(t,this._localPixelInverse,[e.x,e.y,0,1]),he(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=lr(l,f,a);if(!u)return null;let d=this._globeBasis,h=[u[0]/a,u[1]/a,u[2]/a],m=[h[0]*d.east[0]+h[1]*d.south[0]+h[2]*d.up[0],h[0]*d.east[1]+h[1]*d.south[1]+h[2]*d.up[1],h[0]*d.east[2]+h[1]*d.south[2]+h[2]*d.up[2]];return ir(m)}isOnGlobeFront(e,t,o=.06){this._ensure();let r=this.globeCamera(),n=this._globeBasis,a=vo(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(!Pe(r,this._viewProjPx))return;let n=this._cameraPosPx,a=[],l=[0,0,0,0];for(let x of [-1,1])for(let _ of [-1,1])for(let M of [-1,1]){if(he(l,r,[x,_,M,1]),l[3]===0)continue;let C=l[0]/l[3],S=l[1]/l[3],T=C-n[0],A=S-n[1],k=Math.hypot(T,A);if(k>o){let L=o/k;C=n[0]+T*L,S=n[1]+A*L;}a.push({x:C,y:S,z:0});}if(!a.length)return;let s=po(e),c=Math.abs(s[2])>.999?[0,1,0]:[0,0,1],f=this._shadowView;Gn(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),d=1/0,h=1/0,m=1/0,y=-1/0,p=-1/0,b=-1/0,g=[0,0,0,0];for(let x of a)for(let _ of [0,u])he(g,f,[x.x,x.y,_,1]),g[0]<d&&(d=g[0]),g[0]>y&&(y=g[0]),g[1]<h&&(h=g[1]),g[1]>p&&(p=g[1]),g[2]<m&&(m=g[2]),g[2]>b&&(b=g[2]);let v=u+1,w=this._shadowProj;Nn(w,d,y,h,p,-b-v,-m+v),_e(this._shadowVP,w,f),Re(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 ze(r,this._shadowVPm,e*this._worldSize,t*this._worldSize,o),Re(r,r,this._worldSize,this._worldSize,1),Ve(this._shadowObject32,r)}shadowTileMatrix(e,t){this._ensure();let o=e.bounds(),r=(o.maxX-o.minX)*this._worldSize/t,n=this._shadowTile;return ze(n,this._shadowVPm,o.minX*this._worldSize,o.minY*this._worldSize,0),Re(n,n,r,r,1),Ve(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=Xn*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-Xn*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=je(this._zoom);this._worldSize=e,this._pixelsPerMeter=er(1,this._center.lat)*e,this._centerX=le(this._center.lng)*e,this._centerY=se(this._center.lat)*e;let t=Math.max(this.width,1),o=Math.max(this.height,1),r=Ie(this._pitch),n=-Ie(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(xe(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),d=o/50;if(this.projection==="globe"&&this._zoom<et){let g=yo(e);d=Math.max(a-g*1.6,a*.02),u=a+g*2.4;}let h=this._viewMatrix;Re(h,G(),1,-1,1),ze(h,h,0,0,-a),rr(h,h,r),nr(h,h,n),ze(h,h,-this._centerX,-this._centerY,0);let m=G();Dn(m,this._fov,t/o,d,u),_e(this._viewProjPx,m,h);let y=G();Re(y,h,1,1,this._pixelsPerMeter),_e(this._projMatrix,m,y);let p=this._localView;Re(p,G(),1,-1,1),ze(p,p,0,0,-a),rr(p,p,r),nr(p,p,n),_e(this._localProj,m,p),this._globeBasis=ar(this._center.lng,this._center.lat);let b=G();Re(b,G(),t/2,-o/2,1),ze(b,b,1,-1,0),_e(this._pixelMatrix,b,this._projMatrix),Pe(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"),_e(this._localPixel,b,this._localProj),Pe(this._localPixelInverse,this._localPixel),this._calcCameraPosition(),this._calcFrustum();}_calcCameraPosition(){let e=G();if(!Pe(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(!Pe(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];he(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],d=t[c],h=u[0]-f[0],m=u[1]-f[1],y=u[2]-f[2],p=d[0]-f[0],b=d[1]-f[1],g=d[2]-f[2],v=m*g-y*b,w=y*p-h*g,x=h*b-m*p,_=Math.hypot(v,w,x)||1;v/=_,w/=_,x/=_;let M=new Float64Array(4);return M[0]=v,M[1]=w,M[2]=x,M[3]=-(v*f[0]+w*f[1]+x*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:xe(t,-3,3),max:xe(o,-3,3)}}};var Ul={dragPan:true,scrollZoom:true,dragRotate:true,touchZoomRotate:true,touchPitch:true,doubleClickZoom:true,keyboard:true,inertia:1},Yn=2,jl=100,Xl=.5,Kl=.1,Yl=25,$n=i=>Math.abs(i.y)>Math.abs(i.x);function Zn(i,e,t){let o=Math.hypot(i.x,i.y)>=Yn,r=Math.hypot(e.x,e.y)>=Yn;return !o&&!r?void 0:!o||!r?t<jl?void 0:false:i.y>0==e.y>0&&$n(i)&&$n(e)}function qn(i,e){let t=(i-e)*(180/Math.PI);for(;t>180;)t-=360;for(;t<=-180;)t+=360;return t}var $l=160,sr=4,wo=class{constructor(e,t,o,r,n={}){this.canvas=e;this.tr=t;this.onChange=o;this.onInteractionEnd=r;this.pointers=new z;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=xe(-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={...Ul,...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?Zn(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*Xl,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))>=Kl&&(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=Yl/Math.max(Math.PI*e.minDist,1)*360;if(!e.rotateActive&&Math.abs(qn(n,e.startAngle))>=u&&(e.rotateActive=true),e.rotateActive){let d=Math.atan2(e.lastB.y-e.lastA.y,e.lastB.x-e.lastA.x),h=qn(n,d);h!==0&&(this.tr.bearing=this.tr.bearing-h,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>$l;)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>sr&&(r=r/a*sr,n=n/a*sr);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 d={x:this.tr.width/2,y:this.tr.height/2};this.panBy(-r*f,-n*f,d),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 pe=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);}},ue=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 Zl=["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"],be=class{constructor(e,t,o,r,n={}){this.ctx=e;this.name=t;this.uniforms=new z;this.attribs=new z;let a=e.gl,l=Ql(n),s=Jn(a,a.VERTEX_SHADER,Qn(o,l),`${t}.vert`),c=Jn(a,a.FRAGMENT_SHADER,Qn(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),Zl.forEach((u,d)=>a.bindAttribLocation(f,d,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 Ql(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 Qn(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 Xn(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:
4
+ ${i}`}function Jn(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
- ${Ol(t)}`)}return r}function Ol(i){return i.split(`
6
+ ${Jl(t)}`)}return r}function Jl(i){return i.split(`
7
7
  `).map((e,t)=>`${String(t+1).padStart(4)} | ${e}`).join(`
8
- `)}var At=(r=>(r[r.Unknown=0]="Unknown",r[r.Point=1]="Point",r[r.LineString=2]="LineString",r[r.Polygon=3]="Polygon",r))(At||{}),go=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(Bl,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 Bl(i,e,t){t&&(i===1?e.id=t.readVarint():i===2?Vl(t,e):i===3?e.type=t.readVarint():i===4&&(e.geomOffset=t.pos,t.skip(2)));}function Vl(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 vo=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(Dl,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 go.read(t,o,this.keys,this.values,this.extent)}*features(){for(let e=0;e<this.featureOffsets.length;e++)yield this.feature(e);}};function Dl(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(Gl(t)));}function Gl(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 Et=class{constructor(e){this.layers={};new Wl__default.default(e instanceof Uint8Array?e:new Uint8Array(e)).readFields((o,r,n)=>{if(o===3&&n){let a=vo.read(n,n.readVarint()+n.pos);a.length&&(this.layers[a.name]=a);}},null);}};function Je(i){let e=[],t=null;for(let o of i){if(o.length<6)continue;let r=Nl(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 Nl(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:Yn(i.stops,e,(o,r,n)=>o+(r-o)*n,t)}function Ee(i,e,t){return i===void 0?t:typeof i=="string"?ce(i):Yn(i.stops,e,(o,r,n)=>{let a=ce(o),l=ce(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 Yn(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 Ul=Math.PI/8,jl=.35,Xl=32,Kn=.25,$n=.5,qn=.07;function Pe(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??jl,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],d=i[(c+o-1)%o*2],h=i[(c+o-1)%o*2+1],m=i[(c+1)%o*2],y=i[(c+1)%o*2+1],p=f-d,b=u-h,g=m-f,v=y-u,x=Math.hypot(p,b),C=Math.hypot(g,v);if(x<1e-6||C<1e-6){s.push(f,u);continue}let S=p/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&&(ir(f,u,a,l)||ir(d,h,a,l)||ir(m,y,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))),R=Math.min(Ul,Math.PI/2/r),P=Math.ceil(k/R-1e-6),F=e.maxChord&&e.maxChord>0?Math.ceil(L/Math.tan(k/2)*k/e.maxChord):0,W=Math.max(1,Math.min(Xl,Math.max(Math.min(r,P),F)));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 ir=(i,e,t,o)=>i<=-o||e<=-o||i>=t+o||e>=t+o;var Ve=i=>i/64;function it(i,e,t=0){let o=Zn(i.outer,e,t);if(!o)return null;let r=[];for(let n of i.holes){let a=Zn(n,e,t);a&&r.push(a);}return {outer:o,holes:r}}function Zn(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],d=Qn(s,c,r,e,t),h=Qn(f,u,r,e,t);if(d!==h){let m=Yl(f,u,s,c,r,e,t);o.push(f+(s-f)*m,u+(c-u)*m);}d&&o.push(s,c);}}return o.length<6?null:(o.push(o[0],o[1]),o)}function Qn(i,e,t,o,r){return t===0?i>=-r:t===1?i<=o+r:t===2?e>=-r:e<=o+r}function Yl(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 wo(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,ct=32,st=8,ii=65535/ct,Kl=9,$l=1,ql=0,Zl=1,Ql=2;var ei=0,Jl=1,ti=2,es=3,ts=.47;function sr(i,e,t,o={}){let r=o.metersPerUnit&&o.metersPerUnit>0?o.metersPerUnit:ts,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=d=>s(d);let s=d=>{if(l.vertexCount+d<=n)return;n=Math.max(n*2,l.vertexCount+d);let h=new ArrayBuffer(n*Me);new Uint8Array(h).set(l.vertsU8.subarray(0,l.vertOffset)),a=h,l.verts=new DataView(h),l.vertsU8=new Uint8Array(h);};for(let d of i.features()){if(d.type!==3||!pe(t,d.properties))continue;let h=_s(d.properties),m=Cs(d.properties,h);if(h<=m)continue;let y=Ms(d.properties)??Number(d.id??0),p=xs(y>>>0),b=ws(p,d.properties),g=vs(d.properties,h),v=Je(d.loadGeometry());for(let x of v){let C=it(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,maxChord:r>0?$n/r:0},_=M>0?{outer:Pe(C.outer,w),holes:C.holes.map(I=>Pe(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:is(_.outer),E=L?us(d.properties,L,h,p,r):null,z=null,A=[];if(E&&L){let I=ai(ms(_.outer,r),L,E.shape);A=ps(I,_.outer);let k=bs(I,A);if(k>1e-6){let R=Math.min(Math.max(k*r*ss,fs),cs);z=ys(I,R/k,h);}}ri(l,_.outer,m,h,y,b,g,r,e,z);for(let I of _.holes)ri(l,I,m,h,y,b,g,r,e,null);z?gs(l,A,z,h,y,b,g,r):ns(l,_.outer,_.holes,h,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 cr=(i,e)=>i|e<<2,oi=i=>Math.max(-32768,Math.min(32767,i)),ar=i=>Math.max(0,Math.min(65535,Math.round(Math.min(i,ii)*ct)));function at(i,e,t,o,r,n,a,l,s,c,f=0,u=0,d=0){let h=i.vertOffset;return i.verts.setInt16(h,oi(Math.round(e*st)),true),i.verts.setInt16(h+2,oi(Math.round(t*st)),true),i.verts.setUint16(h+4,Math.round(Math.min(o,ii)*ct),true),i.vertsU8[h+6]=s,i.vertsU8[h+7]=l,i.verts.setInt8(h+8,lr(Math.round(r*127))),i.verts.setInt8(h+9,lr(Math.round(n*127))),i.verts.setInt8(h+10,lr(Math.round(a*127))),i.vertsU8[h+11]=c,i.verts.setUint16(h+12,ar(f),true),i.verts.setUint16(h+14,ar(u),true),i.verts.setUint16(h+16,ar(d),true),i.vertOffset+=Me,i.vertexCount++}function ri(i,e,t,o,r,n,a,l,s,c=null){let f=e.length/2;if(f<3)return;let u=cr(ql,a),d=rs(e,l),h=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],x=Math.hypot(g,v)||1;p[b*2]=v/x,p[b*2+1]=-g/x;}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],x=p[g*2]+p[b*2],C=p[g*2+1]+p[b*2+1],S=Math.hypot(x,C);v>.5&&S>1e-6&&(m[b*2]=x/S,m[b*2+1]=C/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],x=e[p*2+3];if(b===v&&g===x||wo(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=d.offset[p],L=d.width[p],E=[0,1];if(c){for(let A=0;A<c.length;A++)for(let I=A+1;I<c.length;I++){let k=et(c[A],b,g)-et(c[I],b,g),R=et(c[A],v,x)-et(c[I],v,x);if(k===R)continue;let P=k/(k-R);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 R of c)k=Math.min(k,et(R,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 R=b+C*I,P=g+S*I,F=b+C*k,W=g+S*k,G=T+M*I*l,O=T+M*k*l,H=(p+1)%(f-1),D=y[p]?m[p*2]:w,K=y[p]?m[p*2+1]:_,$=y[H]?m[H*2]:w,Q=y[H]?m[H*2+1]:_,de=w+(D-w)*(1-I),J=_+(K-_)*(1-I),X=w+($-w)*k,te=_+(Q-_)*k,ie=Math.hypot(de,J)||1,q=Math.hypot(X,te)||1,U=de/ie,j=J/ie,le=X/q,ae=te/q;i.ensure(4);let se=at(i,R,P,t,U,j,0,0,n,u,G,L,h),ne=at(i,F,W,t,le,ae,0,0,n,u,O,L,h),ge=at(i,R,P,z(R,P),U,j,0,255,n,u,G,L,h),ke=at(i,F,W,z(F,W),le,ae,0,255,n,u,O,L,h);i.indices.push(se,ke,ne,se,ge,ke),i.featureIds.push(r,r);}}}var os=.9976;function rs(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>=os,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,d=s+1;for(;d<t;){let m=(n+d)%t;if(!r((n+d-1)%t,m))break;f.push(m),u+=o[m].len,d++;}let h=0;for(let m of f)a[m]=h,l[m]=u,h+=o[m].len;s=d;}return {offset:a,width:l}}function ns(i,e,t,o,r,n,a){let l=[],s=[];for(let d=0;d<e.length;d++)l.push(e[d]);for(let d of t){s.push(l.length/2);for(let h=0;h<d.length;h++)l.push(d[h]);}let c=ni__default.default(l,s.length?s:void 0,2);if(!c.length)return;let f=cr(Zl,a),u=i.vertexCount;for(let d=0;d<l.length;d+=2)at(i,l[d],l[d+1],o,0,0,1,255,n,f);for(let d=0;d<c.length;d+=3)i.indices.push(u+c[d],u+c[d+2],u+c[d+1]),i.featureIds.push(r);}function is(i){let e=as(i);if(e.length<3)return null;let t=Math.abs(ls(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,d=1/0,h=-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<d&&(d=S),S>h&&(h=S);}let m=u-f,y=h-d,p=m*y;if(p<=0||p>=r)continue;r=p;let b=(f+u)/2,g=(d+h)/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 as(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 ls(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 ss=Math.tan(30*Math.PI/180),cs=3.5,fs=.9;function us(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=ds(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 ds(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 et=(i,e,t)=>i.a*e+i.b*t+i.c;function hs(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),d=e*s+t*c+o,h=e*f+t*u+o;if(d<=0!=h<=0){let m=h/(h-d);n.push(f+(s-f)*m,u+(c-u)*m);}d<=0&&n.push(s,c);}return n}function ms(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,d=f-s,h=Math.hypot(u,d),m=h>1e-6;if(m){for(let y=n+1;y<a;y++)if(Math.abs((i[y*2]-l)*d-(i[y*2+1]-s)*u)/h>=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 ai(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],d=i[(s+1)%l*2+1],h=u-c,m=d-f,y=Math.hypot(h,m);if(y<1e-6||t==="gabled"&&Math.abs((h*o+m*r)/y)<.86)continue;let p=-m/y,b=h/y;a.push({a:p,b,c:-(p*c+b*f)});}return !a.length&&n>0?ai(i,e,"hipped"):a}function ps(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=hs(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 bs(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=et(i[o],r[n],r[n+1]);a>t&&(t=a);}}return t}function ys(i,e,t){return i.map(o=>({a:o.a*e,b:o.b*e,c:o.c*e+t}))}function gs(i,e,t,o,r,n,a,l){let s=cr(Ql,a);for(let c=0;c<t.length;c++){let f=e[c];if(!f||f.length<6)continue;let u=ni__default.default(f,void 0,2);if(!u.length)continue;let d=-t[c].a/l,h=-t[c].b/l,m=Math.hypot(d,h,1),y={x:d/m,y:h/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,et(t[c],f[b],f[b+1]));at(i,f[b],f[b+1],g,y.x,y.y,y.z,255,n,s);}for(let b=0;b<u.length;b+=3)i.indices.push(p+u[b],p+u[b+2],p+u[b+1]),i.featureIds.push(r);}}function vs(i,e){let t=String(i.class??"").toLowerCase();return t==="industrial"||t==="warehouse"||t==="hangar"||t==="construction"?es:t==="commercial"||t==="office"||t==="retail"||t==="supermarket"?ti:t==="house"||t==="detached"||t==="garage"||t==="hut"||t==="shed"||e<=7?ei:e>=40?ti:Jl}function ws(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 xs(i){let e=i>>>0;return e=(e>>>16^e)*73244475,e=(e>>>16^e)*73244475,e=e>>>16^e,e>>>0}function _s(i){let e=lt(i.render_height)??lt(i.height)??Ss(i.levels??i.building_levels??i["building:levels"]);return e&&e>0?Math.max(e,$l):Kl}function Cs(i,e){let t=lt(i.render_min_height)??lt(i.min_height)??lt(i.base)??0;return t>0&&t<e?t:0}function Ss(i){let e=lt(i);return e&&e>0?e*3:null}function lt(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 lr=i=>i>127?127:i<-127?-127:i;function Ms(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 je=4;function fr(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 d=i.length/2;return i.push((l(f)+l(u))/2,(s(f)+s(u))/2),d};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[d,h,m]=a.pop(),y=(l(d)-l(h))**2+(s(d)-s(h))**2,p=(l(h)-l(m))**2+(s(h)-s(m))**2,b=(l(m)-l(d))**2+(s(m)-s(d))**2,g=Math.max(y,p,b);if(g<=n){r.push(d,h,m);continue}if(g===y){let v=c(d,h);a.push([d,v,m],[v,h,m]);}else if(g===p){let v=c(h,m);a.push([h,v,d],[v,m,d]);}else {let v=c(m,d);a.push([m,v,h],[v,d,h]);}}}}function ur(i,e,t=0,o,r=false,n=4096){let a=[],l=[],s=[];for(let h of i.features()){if(h.type!==3||!pe(e,h.properties))continue;let m=h.properties.osm_id,y=typeof m=="number"?m:typeof m=="string"?Number(m):NaN,p=Number.isFinite(y)?y:Number(h.id??0);for(let b of Je(h.loadGeometry())){let g=r?it(b,n):b;if(!g)continue;let v=[],x=[],C=o?Pe(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?Pe(w,o):w;x.push(v.length/2);for(let T=0;T<_.length;T++)v.push(_[T]);}let S=ni__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=[];fr(a,S,M,t,w);for(let _=0;_<w.length;_+=3)l.push(w[_],w[_+2],w[_+1]),s.push(p);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(p);}}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}}function li(i){let e=[];for(let t=0;t+1<i.length;t+=2)e.push([i[t],i[t+1]]);return e}function si(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 fi(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(d=>e(d,t)??d)})):a).map(u=>[li(u.outer),...u.holes.map(li)]),c;try{c=ci__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 d=si(u[0]);if(d.length<8)continue;let h=[];for(let m=1;m<u.length;m++){let y=si(u[m]);y.length>=8&&h.push(y);}r.push(n?{outer:d,holes:h,lift:n}:{outer:d,holes:h});}}return r}var ft=16,bi=64,yi=0,Es=1,ui=2,As=3,Lt=1,Ls=.6;function br(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*ft),d={view:new DataView(u),bytes:new Uint8Array(u),offset:0,count:0,indices:[],extent:e,ensure(w){if(d.count+w<=f)return;f=Math.max(f*2,d.count+w);let _=new ArrayBuffer(f*ft);new Uint8Array(_).set(d.bytes.subarray(0,d.offset)),u=_,d.view=new DataView(_),d.bytes=new Uint8Array(_);}},h=[],m=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 Je(w.loadGeometry())){let L=it(T,e,Ve(e));L&&h.push(_?{...L,lift:_}:L);}}let y=new Set,p=Math.max(o.weld??Ls,0),b=fi(h,(w,_)=>hr(w,_,e,y),p/r),g=p>0?b.map(w=>({...w,outer:pi(w.outer,p/r,e),holes:w.holes.map(_=>pi(_,p/r,e))})):b;for(let w of g){di(w.outer,m);for(let _ of w.holes)di(_,m);}o.onShapes?.(g);let v=new Set;for(let[w,_]of m)_>1&&v.add(w);let x=[],C={radius:c,segments:o.cornerSegments,extent:e,margin:Ve(e),minCutRatio:0,maxChord:Kn/r};for(let w of g){let _=c>0?{outer:Pe(w.outer,{...C,keep:hi(w.outer,v)}),holes:w.holes.map(R=>Pe(R,{...C,keep:hi(R,v)}))}:w,T=l>0?hr(_.outer,l,e,v):_.outer,L=_.holes.map(R=>l>0?hr(R,-l,e,v):R),E=w.lift??0,z=n+E,A=a+E;mi(d,T??_.outer,L.map((R,P)=>R??_.holes[P]),z,yi,o.maxSegment??0);let I=z,k=z-s;T&&l>0&&s>0&&dr(d,T,_.outer,I,k,Es,e,v),k!==A&&dr(d,_.outer,_.outer,k,A,ui,e,v);for(let R of _.holes)if(k!==A&&dr(d,R,R,k,A,ui,e,v),z<A){let P=d.indices.length;mi(d,R,[],A,As);for(let F=P;F<d.indices.length;F++)x.push(d.indices[F]);d.indices.length=P;}}if(!d.indices.length&&!x.length)return null;let S=d.indices.length,M=new Uint32Array(S+x.length);return M.set(d.indices,0),M.set(x,S),{vertices:u.slice(0,d.offset),indices:M.buffer,vertexCount:d.count,indexCount:M.length,extent:e,capIndexOffset:S}}function ut(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 di(i,e){for(let t=0;t+3<i.length;t+=2){let o=ut(i[t],i[t+1],i[t+2],i[t+3]);e.set(o,(e.get(o)??0)+1);}}function hi(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=ut(i[(r+t-1)%t*2],i[(r+t-1)%t*2+1],i[r*2],i[r*2+1]),a=ut(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 It(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,Is(Math.round(o*bi)),true),i.view.setInt8(s+10,pr(Math.round(r*127))),i.view.setInt8(s+11,pr(Math.round(n*127))),i.view.setInt8(s+12,pr(Math.round(a*127))),i.bytes[s+13]=l,i.view.setInt8(s+14,e<=0?-Lt:e>=i.extent?Lt:0),i.view.setInt8(s+15,t<=0?-Lt:t>=i.extent?Lt:0),i.offset+=ft,i.count++}function mi(i,e,t,o,r=yi,n=0){let a=[],l=[];for(let u=0;u<e.length;u++)a.push(e[u]);for(let u of t){l.push(a.length/2);for(let d=0;d<u.length;d++)a.push(u[d]);}let s=ni__default.default(a,l.length?l:void 0,2);if(!s.length)return;let c=s;if(n>0){let u=[];fr(a,s,0,n,u),c=u;}i.ensure(a.length/2);let f=i.count;for(let u=0;u<a.length;u+=2)It(i,a[u],a[u+1],o,0,0,1,r);for(let u=0;u<c.length;u+=3)i.indices.push(f+c[u],f+c[u+2],f+c[u+1]);}function dr(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],d=t[c*2+2],h=t[c*2+3];if(f===d&&u===h||wo(f,u,d,h,a,Ve(a))||l.has(ut(f,u,d,h)))continue;let m=d-f,y=h-u,p=Math.hypot(m,y)||1,b=y/p,g=-m/p,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=It(i,e[c*2],e[c*2+1],o,b,g,C,n),M=It(i,e[c*2+2],e[c*2+3],o,b,g,C,n),w=It(i,f,u,r,b,g,C,n),_=It(i,d,h,r,b,g,C,n);i.indices.push(w,M,_,w,S,M);}}}function hr(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],d=i[f*2+1],h=i[(f+r-1)%r*2],m=i[(f+r-1)%r*2+1],y=i[(f+1)%r*2],p=i[(f+1)%r*2+1],b=Math.hypot(u-h,d-m)||1,g=Math.hypot(y-u,p-d)||1,v=(d-m)/b,x=-(u-h)/b,C=(p-d)/g,S=-(y-u)/g,M=v+C,w=x+S,_=Math.hypot(M,w);if(_<1e-6){n.push(u,d);continue}M/=_,w/=_;let T=Math.min(1/Math.max(M*v+w*x,.35),3),L=u-M*e*T,E=d-w*e*T,z=ut(h,m,u,d),A=ut(u,d,y,p);if(o.has(z)||o.has(A)){n.push(u,d);continue}let I=-Ve(t),k=t+Ve(t),R=(P,F)=>P<=I||P>=k||F<=I||F>=k;(R(u,d)||R(h,m)||R(y,p))&&(L=u,E=d),n.push(L,E);}n.push(n[0],n[1]);let a=Math.abs(mr(i)),l=mr(n);if(Math.sign(l)!==Math.sign(mr(i))||Math.abs(l)<a*.25)return null;let s=-Ve(t),c=t+Ve(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 mr(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 pr=i=>i>127?127:i<-127?-127:i,Is=i=>i>32767?32767:i<-32768?-32768:i;function pi(i,e,t){if(!(e>0))return i;let o=Ve(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 d=0;d<s&&!(f<=5);d++){let h=a[d*2],m=a[d*2+1];if(h<=r||h>=n||m<=r||m>=n)continue;let y=(d+s-1)%s;for(;!c[y]&&y!==d;)y=(y+s-1)%s;let p=(d+1)%s;for(;!c[p]&&p!==d;)p=(p+1)%s;if(y===d||p===d)break;let b=a[y*2],g=a[y*2+1],v=a[p*2]-b,x=a[p*2+1]-g,C=Math.hypot(v,x);C<1e-6||Math.abs((h-b)*x-(m-g)*v)/C<e&&(c[d]=false,f--);}if(f===s)break;let u=[];for(let d=0;d<s;d++)c[d]&&u.push(a[d*2],a[d*2+1]);u.push(u[0],u[1]),a=u;}return a}var Rs=100;function yr(i){return {shapes:[],cells:[],extent:0,metersPerTile:i}}function gr(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 Fs(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=dt(Math.floor(o.minX/e)),n=dt(Math.floor(o.maxX/e)),a=dt(Math.floor(o.minY/e)),l=dt(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 vi=i=>i.shapes.length===0;function xo(i,e,t){!i.cells.length&&i.shapes.length&&Fs(i);let o=i.extent/32,r=i.cells[dt(Math.floor(t/o))*32+dt(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||!gi(l.outer,e,t))continue;let s=false;for(let c of l.holes)if(gi(c,e,t)){s=true;break}s||(n=l.level);}return Math.min(Math.round(n*100),127)}function vr(i,e){let t=[],o=[],r=i.extent>0?i.metersPerTile/i.extent:0,n=r>0?2/r:0,a=xo(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],d=xo(i,f,u);if(d!==a&&n>0){let h=Math.hypot(f-s,u-c),m=Math.min(Math.ceil(h/n),64),y=a;for(let p=1;p<m;p++){let b=p/m,g=s+(f-s)*b,v=c+(u-c)*b,x=xo(i,g,v);x!==y&&(t.push(g,v),o.push(x),y=x);}}t.push(f,u),o.push(d),a=d;}return {pts:t,levels:o}}var dt=i=>i<0?0:i>31?31:i;function gi(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 zs=5;function tt(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 Xe=20;function wr(i,e,t=0,o,r=0,n={}){let{level:a}=n,l=Math.max(256,i.length*24),s=new ArrayBuffer(l*Xe),c=new DataView(s),f=0,u=[],d=g=>{if(f+g<=l)return;l=Math.max(l*2,f+g);let v=new ArrayBuffer(l*Xe);new Uint8Array(v).set(new Uint8Array(s,0,f*Xe)),s=v,c=new DataView(v);},h=(g,v,x,C,S,M,w,_=0,T=0,L=0)=>{let E=f*Xe;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++},m=0,y=r>0?12/r:0,p=y>0?Bs(i):null;for(let g of i.features()){if(g.type!==2&&g.type!==3||!pe(e,g.properties)||a!==void 0&&tt(g.properties)!==a)continue;let v=g.properties.width;m=typeof v=="number"&&v>.5&&v<100?v:0;let x=g.type===3;for(let C of g.loadGeometry()){let S=t>0?Hs(wi(C),t):wi(C);if(S.length<4)continue;let M=o&&!vi(o)?vr(o,S):null,w=M?M.pts:S,_=M?.levels,T=w.length/2;if(T<2)continue;let L=tt(g.properties),E=_o(Math.round(w[0]),Math.round(w[1])),z=_o(Math.round(w[T*2-2]),Math.round(w[T*2-1])),A=null,I=m;if(p&&m>0&&!x){let R=0;for(let O=0;O<T-1;O++)R+=Math.hypot(w[O*2+2]-w[O*2],w[O*2+3]-w[O*2+1]);I=_i(L,m,E,z,p);let P=O=>Math.min(p.width.get(O)??0,I*2),F=P(E)-I,W=P(z)-I,G=Math.min(y,R/2);if(G>0&&(F>0||W>0)){A=H=>{let D=0;return F>0&&H<G&&(D=F*(1-H/G)),W>0&&R-H<G&&(D=Math.max(D,W*(1-(R-H)/G))),I+D};let O=[];for(let H of [G,R-G])H>.01&&H<R-.01&&O.push(H);if(O.length){let H=Ps(w,_,O);w=H.pts,_=H.levels,T=w.length/2;}}}d((T-1)*4);let k=0;for(let R=0;R<T-1;R++){let P=w[R*2],F=w[R*2+1],W=w[R*2+2],G=w[R*2+3],O=Math.hypot(W-P,G-F);if(x&&Ws(P,F,W,G,i.extent)){k+=O;continue}let H=Os(P,F,W,G,i.extent);if(!H){k+=O;continue}let[D,K,$,Q]=H,de=Math.hypot(D-P,K-F),J=Math.hypot($-D,Q-K),X=Math.hypot(W-$,G-Q),te=k+de,ie=_?_[R]:0,q=_?_[R+1]:0,U=A?A(te):I,j=A?A(te+J):I,le=h(D,K,$,Q,0,-1,te,ie,q,U),ae=h(D,K,$,Q,0,1,te,ie,q,U),se=h(D,K,$,Q,1,1,te,ie,q,j),ne=h(D,K,$,Q,1,-1,te,ie,q,j);k+=de+J+X,u.push(le,ae,se,le,se,ne);}}}if(!u.length)return null;let b=new Uint32Array(u);return {vertices:s.slice(0,f*Xe),indices:b.buffer,vertexCount:f,indexCount:b.length}}function Ps(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],d=i[s+3],h=Math.hypot(u-c,d-f);for(;l<o.length&&o[l]<=a+.01;)l++;for(;l<o.length&&o[l]<a+h-.01;){let m=(o[l]-a)/h;r.push(c+(u-c)*m,f+(d-f)*m),n&&e&&n.push(Math.round(e[s/2]+(e[s/2+1]-e[s/2])*m)),l++;}a+=h,r.push(u,d),n&&e&&n.push(e[s/2+1]);}return {pts:r,levels:n}}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 wi(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 Os(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 d=u/f;if(f<0){if(d>s)return null;d>l&&(l=d);}else {if(d<l)return null;d<s&&(s=d);}}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 Ws(i,e,t,o,r){return i===t&&(i<=0||i>=r)?true:e===o&&(e<=0||e>=r)}var xi=new WeakMap,_o=(i,e)=>(i+512)*65536+(e+512);function _i(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 Bs(i){let e=xi.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=tt(r.properties);for(let s of r.loadGeometry()){if(s.length<4)continue;let c=_o(Math.round(s[0]),Math.round(s[1])),f=_o(Math.round(s[s.length-2]),Math.round(s[s.length-1]));for(let u of [c,f]){let d=u+(l+8)*4294967296;t.ends.set(d,(t.ends.get(d)??0)+1),a>0&&t.raw.set(d,Math.max(t.raw.get(d)??0,a));}o.push({h:c,t:f,lv:l,w:a});}}for(let r of o){let n=_i(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 xi.set(i,t),t}var xr={enabled:true,skyColor:"#7fb2e5",horizonColor:"#dfe6ee",fogRange:[2.43,10.1],fogIntensity:.92,fogVerticalRange:[35,220],spaceColor:"#05070f",atmosphereColor:"#79b8f5",starIntensity:.55,horizonBlend:.14},_r={ambientColor:"#ffffff",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#fff4e2",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#dce6f2",fillIntensity:.18};var Ci={version:1,name:"OSM 3D \u2014 \u0434\u043D\u0435\u0432\u043D\u043E\u0439",background:"#dbd8d4",light:{ambientColor:"#ffffff",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#ffffff",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#ffffff",fillIntensity:.18},layers:[{id:"world-landcover-wood",type:"fill",source:"world","source-layer":"landcover",maxzoom:7,filter:["in","class","wood","forest"],paint:{color:{from:"landcover-wood"}}},{id:"world-landcover-grass",type:"fill",source:"world","source-layer":"landcover",maxzoom:7,filter:["in","class","grass","farmland","meadow"],paint:{color:{from:"landcover-grass"}}},{id:"world-landcover-sand",type:"fill",source:"world","source-layer":"landcover",maxzoom:7,filter:["in","class","sand","beach"],paint:{color:{from:"landcover-sand"}}},{id:"world-landcover-ice",type:"fill",source:"world","source-layer":"landcover",maxzoom:7,filter:["in","class","ice","glacier"],paint:{color:{from:"landcover-ice"}}},{id:"world-water",type:"fill",source:"world","source-layer":"water",maxzoom:7,paint:{color:{from:"water"}}},{id:"world-boundary",type:"line",source:"world","source-layer":"boundary",maxzoom:7,paint:{color:{from:"boundary"},opacity:.7,width:{stops:[[0,.5],[6,1.1]]}}},{id:"landcover-wood",type:"fill",minzoom:7,"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",minzoom:7,"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",minzoom:7,"source-layer":"landcover",filter:["in","class","sand","beach"],paint:{color:"#f2e7c8",material:"sand",materialScale:26}},{id:"landcover-ice",type:"fill",minzoom:7,"source-layer":"landcover",filter:["in","class","ice","glacier"],paint:{color:"#e6f2f7"}},{id:"landcover-wetland",type:"fill",minzoom:7,"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:"#d3d0cb",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:"#dddad5"}},{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",minzoom:7,"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",minzoom:7,"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:"#ffffff",roofColor:"#f2f1f0",opacity:1,heightScale:{stops:[[15,0],[15.8,1]]},aoStrength:.18,tintVariation:0,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:"roads"},{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:"roads"},{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:"roads",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:{world:{url:"/tileserver/data/world/{z}/{x}/{y}.pbf",minzoom:0,maxzoom:6},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 Si={version:1,name:"\u041C\u044F\u0433\u043A\u0430\u044F \u0433\u0435\u043E\u043C\u0435\u0442\u0440\u0438\u044F",background:"#dbd8d4",light:{ambientColor:"#ffffff",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#ffffff",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#ffffff",fillIntensity:.18},layers:[{id:"world-landcover-wood",type:"fill",source:"world","source-layer":"landcover",maxzoom:7,filter:["in","class","wood","forest"],paint:{color:{from:"landcover-wood"}}},{id:"world-landcover-grass",type:"fill",source:"world","source-layer":"landcover",maxzoom:7,filter:["in","class","grass","farmland","meadow"],paint:{color:{from:"landcover-grass"}}},{id:"world-landcover-sand",type:"fill",source:"world","source-layer":"landcover",maxzoom:7,filter:["in","class","sand","beach"],paint:{color:{from:"landcover-sand"}}},{id:"world-landcover-ice",type:"fill",source:"world","source-layer":"landcover",maxzoom:7,filter:["in","class","ice","glacier"],paint:{color:{from:"landcover-ice"}}},{id:"world-water",type:"fill",source:"world","source-layer":"water",maxzoom:7,paint:{color:{from:"water"}}},{id:"world-boundary",type:"line",source:"world","source-layer":"boundary",maxzoom:7,paint:{color:{from:"boundary"},opacity:.7,width:{stops:[[0,.5],[6,1.1]]}}},{id:"landcover-wood",type:"fill",minzoom:7,"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",minzoom:7,"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",minzoom:7,"source-layer":"landcover",filter:["in","class","sand","beach"],paint:{color:"#f2e7c8",material:"sand",materialScale:26},cornerRadius:10,cornerSegments:4},{id:"landcover-ice",type:"fill",minzoom:7,"source-layer":"landcover",filter:["in","class","ice","glacier"],paint:{color:"#e6f2f7"}},{id:"landcover-wetland",type:"fill",minzoom:7,"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:"#d3d0cb",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:"#dddad5"},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",minzoom:7,"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",minzoom:7,"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:"#ffffff",roofColor:"#f2f1f0",opacity:1,heightScale:{stops:[[15,0],[15.8,1]]},aoStrength:.18,tintVariation:0,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:"roads"},{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:"roads"},{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:"roads",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:{world:{url:"/tileserver/data/world/{z}/{x}/{y}.pbf",minzoom:0,maxzoom:6},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:"\u0420\u0435\u043B\u044C\u0435\u0444",background:"#dbd8d4",light:{ambientColor:"#ffffff",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#ffffff",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#ffffff",fillIntensity:.18},layers:[{id:"world-landcover-wood",type:"fill",source:"world","source-layer":"landcover",maxzoom:7,filter:["in","class","wood","forest"],paint:{color:{from:"landcover-wood"}}},{id:"world-landcover-grass",type:"fill",source:"world","source-layer":"landcover",maxzoom:7,filter:["in","class","grass","farmland","meadow"],paint:{color:{from:"landcover-grass"}}},{id:"world-landcover-sand",type:"fill",source:"world","source-layer":"landcover",maxzoom:7,filter:["in","class","sand","beach"],paint:{color:{from:"landcover-sand"}}},{id:"world-landcover-ice",type:"fill",source:"world","source-layer":"landcover",maxzoom:7,filter:["in","class","ice","glacier"],paint:{color:{from:"landcover-ice"}}},{id:"world-water",type:"fill",source:"world","source-layer":"water",maxzoom:7,paint:{color:{from:"water"}}},{id:"world-boundary",type:"line",source:"world","source-layer":"boundary",maxzoom:7,paint:{color:{from:"boundary"},opacity:.7,width:{stops:[[0,.5],[6,1.1]]}}},{id:"landcover-wood",type:"surface",minzoom:7,"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",minzoom:7,"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",minzoom:7,"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",minzoom:7,"source-layer":"landcover",filter:["in","class","ice","glacier"],paint:{color:"#e6f2f7"}},{id:"landcover-wetland",type:"surface",minzoom:7,"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:"#d3d0cb",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:"#dddad5"}},{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",minzoom:7,"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",minzoom:7,"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:"#ffffff",roofColor:"#f2f1f0",opacity:1,heightScale:{stops:[[15,0],[15.8,1]]},aoStrength:.18,tintVariation:0,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:"roads"},{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:"roads"},{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:"roads",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:{world:{url:"/tileserver/data/world/{z}/{x}/{y}.pbf",minzoom:0,maxzoom:6},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 Ti={version:1,name:"\u041E\u0431\u044A\u0451\u043C\u043D\u044B\u0439 \u0433\u043E\u0440\u043E\u0434",background:"#dbd8d4",light:{ambientColor:"#ffffff",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#ffffff",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#ffffff",fillIntensity:.18},layers:[{id:"world-landcover-wood",type:"fill",source:"world","source-layer":"landcover",maxzoom:7,filter:["in","class","wood","forest"],paint:{color:{from:"landcover-wood"}}},{id:"world-landcover-grass",type:"fill",source:"world","source-layer":"landcover",maxzoom:7,filter:["in","class","grass","farmland","meadow"],paint:{color:{from:"landcover-grass"}}},{id:"world-landcover-sand",type:"fill",source:"world","source-layer":"landcover",maxzoom:7,filter:["in","class","sand","beach"],paint:{color:{from:"landcover-sand"}}},{id:"world-landcover-ice",type:"fill",source:"world","source-layer":"landcover",maxzoom:7,filter:["in","class","ice","glacier"],paint:{color:{from:"landcover-ice"}}},{id:"world-water",type:"fill",source:"world","source-layer":"water",maxzoom:7,paint:{color:{from:"water"}}},{id:"world-boundary",type:"line",source:"world","source-layer":"boundary",maxzoom:7,paint:{color:{from:"boundary"},opacity:.7,width:{stops:[[0,.5],[6,1.1]]}}},{id:"landcover-wood",type:"surface",minzoom:7,"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",minzoom:7,"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",minzoom:7,"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",minzoom:7,"source-layer":"landcover",filter:["in","class","ice","glacier"],paint:{color:"#e6f2f7"}},{id:"landcover-wetland",type:"surface",minzoom:7,"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:"#d3d0cb",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:"#dddad5",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",minzoom:7,"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",minzoom:7,"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:"#ffffff",roofColor:"#f2f1f0",opacity:1,heightScale:{stops:[[15,0],[15.8,1]]},aoStrength:.18,tintVariation:0,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:"roads"},{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:"roads"},{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:"roads",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:{world:{url:"/tileserver/data/world/{z}/{x}/{y}.pbf",minzoom:0,maxzoom:6},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 ki={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:[2.34,8.77],fogIntensity:.9,spaceColor:"#02030a",atmosphereColor:"#3f6fa8",starIntensity:.8}};var Ei={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:[2.43,10.12],fogIntensity:.9,spaceColor:"#07080b",atmosphereColor:"#9aa3ad",starIntensity:.5}};var Ai={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:[2.52,12.15],fogIntensity:.85,spaceColor:"#0a1018",atmosphereColor:"#9fd0ff",starIntensity:.45}};var Li={name:"\u041E\u0431\u044A\u0451\u043C\u043D\u0430\u044F",background:"#dfdbda",light:{ambientColor:"#ffffff",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#ffffff",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#ffffff",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:"#e4e1e0"},"landuse-industrial":{color:"#dadce7"},"landuse-civic":{color:"#ecdae0"},"landuse-sport":{color:"#bbeba2"},"landuse-cemetery":{color:"#c2e2bb"},"landuse-parking":{color:"#d6d4d4"},park:{color:"#b2e6a8"},"aeroway-area":{color:"#d6dbeb"},water:{color:"#94d8f9"},waterway:{color:"#94d8f9"},"aeroway-line":{color:"#dfdcd9"},"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:"#ffffff",roofColor:"#f2f1f0",aoStrength:.19,tintVariation:0,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:[2.41,9.94],fogIntensity:.86,spaceColor:"#0e0b0a",atmosphereColor:"#5daad0",starIntensity:.38}};var Ii={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:[2.41,9.92],fogIntensity:.86,spaceColor:"#131105",atmosphereColor:"#5ca9d0",starIntensity:.39}};var Ri={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:[2.34,8.77],fogIntensity:.9,spaceColor:"#060308",atmosphereColor:"#b5358b",starIntensity:.82}};var Fi={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:[2.41,9.92],fogIntensity:.86,spaceColor:"#120c07",atmosphereColor:"#5c9fd0",starIntensity:.39}};var zi={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:[2.39,9.64],fogIntensity:.87,spaceColor:"#0e0b09",atmosphereColor:"#557dce",starIntensity:.45}};var Pi={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:[2.39,9.64],fogIntensity:.87,spaceColor:"#0f0c08",atmosphereColor:"#559cce",starIntensity:.45}};var Hi={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:[2.34,8.79],fogIntensity:.9,spaceColor:"#030408",atmosphereColor:"#35a1b7",starIntensity:.81}};var Oi={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:[2.43,10.02],fogIntensity:.85,spaceColor:"#090c0f",atmosphereColor:"#5fb3d0",starIntensity:.37}};var Wi={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:[2.43,10.02],fogIntensity:.85,spaceColor:"#090c10",atmosphereColor:"#5fb3d0",starIntensity:.37}};var Bi={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:[2.34,8.79],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:{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:[2.41,9.92],fogIntensity:.86,spaceColor:"#080b10",atmosphereColor:"#5c96d0",starIntensity:.39}};var Di={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:[2.41,9.87],fogIntensity:.86,spaceColor:"#090f09",atmosphereColor:"#5bcfa9",starIntensity:.4}};var Gi={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:[2.39,9.64],fogIntensity:.87,spaceColor:"#0a0b0c",atmosphereColor:"#557dce",starIntensity:.45}};var Ni={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:[2.41,9.87],fogIntensity:.86,spaceColor:"#0d0c0b",atmosphereColor:"#5ba1cf",starIntensity:.4}};var Ui={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:[2.43,10.04],fogIntensity:.85,spaceColor:"#0d0d0d",atmosphereColor:"#5fa1d1",starIntensity:.37}};var ji={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:[2.41,9.82],fogIntensity:.86,spaceColor:"#080d0f",atmosphereColor:"#5aa8cf",starIntensity:.41}};var Xi={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:[2.34,8.79],fogIntensity:.9,spaceColor:"#060606",atmosphereColor:"#3679b9",starIntensity:.79}};var Yi={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:[2.39,9.68],fogIntensity:.87,spaceColor:"#0d0e09",atmosphereColor:"#569dce",starIntensity:.44}};var Ki={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:[2.34,8.77],fogIntensity:.9,spaceColor:"#040308",atmosphereColor:"#354cb6",starIntensity:.82}};var $i={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:[2.34,8.8],fogIntensity:.9,spaceColor:"#070605",atmosphereColor:"#ba6336",starIntensity:.78}};var qi={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:[2.43,9.99],fogIntensity:.85,spaceColor:"#0f0c0a",atmosphereColor:"#5eaad0",starIntensity:.38}};var Zi={"3d":Li,cartoon:Ii,cyberpunk:Ri,dawn:Fi,dusk:zi,earth:Pi,future:Hi,"glass-refined":Oi,glass:Wi,"harmony-black":Bi,"harmony-blue":Vi,"harmony-green":Di,lunar:Gi,matte:Ni,minimal:Ui,ocean:ji,premium:Xi,realistic:Yi,space:Ki,volcano:$i,white:qi};function Co(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",Qi="\u241F",He=(i,e)=>i+"\u241F"+String(e);var ht=class{constructor(e=Cr){this.splitValues={};this.spec=e,this.light={..._r,...e.light??{}},this.sky={...xr,...e.sky??{}},this.layers=e.layers.map(t=>({...t,paint:{...t.paint}}));}get background(){return ce(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=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.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??Y))]}bucketKeyFor(e){if(e.type==="raster"||!e.splitBy)return e.id;let t=this.splitValues[e.splitBy];return t===void 0?null:He(e.id,t)}sourceLayers(){return [...new Set(this.layers.flatMap(e=>e.type==="raster"?[]:[e["source-layer"]]))]}},Cr=Ci,mc=Si,pc=Mi,bc=Ti;function yc(i,e){if(typeof i!="string")return i;let t=/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i.exec(i);if(!t)return i;let o=r=>Math.round(parseInt(t[r],16)*e).toString(16).padStart(2,"0");return `#${o(1)}${o(2)}${o(3)}`}function Ji(i,e,t,o){let r=i.paint?.building;return r?{...i,name:e,paint:{...i.paint,building:{...r,windowColor:yc(r.color,t),windowGlow:0,...o}}}:{...i,name:e}}var Oe={day:{name:"\u0414\u043D\u0435\u0432\u043D\u0430\u044F"},night:ki,mono:Ei,pale:Ai,...Zi};Oe["3d-tone"]=Ji(Oe["3d"],"\u0421\u0432\u0435\u0442\u043B\u0430\u044F, \u043E\u043A\u043D\u0430 \u0432 \u0442\u043E\u043D",1,{windowVariation:0,windowRecess:.12,windowRecessShade:0,seamStrength:0});Oe["night-tone"]=Ji(Oe.night,"\u0422\u0451\u043C\u043D\u0430\u044F, \u043E\u043A\u043D\u0430 \u0432 \u0442\u043E\u043D",1,{windowVariation:1,seamStrength:0});function So(i,e=Cr){if(typeof i!="string")return Co(e,i);if(i==="day")return e;let t=Oe[i];return t?Co(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(Oe).join(", ")}`),e)}var Rt=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 ea(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=`
8
+ `)}var Ft=(r=>(r[r.Unknown=0]="Unknown",r[r.Point=1]="Point",r[r.LineString=2]="LineString",r[r.Polygon=3]="Polygon",r))(Ft||{}),xo=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(ts,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 ts(i,e,t){t&&(i===1?e.id=t.readVarint():i===2?os(t,e):i===3?e.type=t.readVarint():i===4&&(e.geomOffset=t.pos,t.skip(2)));}function os(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 _o=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(rs,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 xo.read(t,o,this.keys,this.values,this.extent)}*features(){for(let e=0;e<this.featureOffsets.length;e++)yield this.feature(e);}};function rs(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(ns(t)));}function ns(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 Rt=class{constructor(e){this.layers={};new es__default.default(e instanceof Uint8Array?e:new Uint8Array(e)).readFields((o,r,n)=>{if(o===3&&n){let a=_o.read(n,n.readVarint()+n.pos);a.length&&(this.layers[a.name]=a);}},null);}};function tt(i){let e=[],t=null;for(let o of i){if(o.length<6)continue;let r=is(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 is(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:ei(i.stops,e,(o,r,n)=>o+(r-o)*n,t)}function Ae(i,e,t){return i===void 0?t:typeof i=="string"?de(i):ei(i.stops,e,(o,r,n)=>{let a=de(o),l=de(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 ei(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 ye(i,e){if(!i)return true;let t=i[0];switch(t){case "all":return i.slice(1).every(o=>ye(o,e));case "any":return i.slice(1).some(o=>ye(o,e));case "!":return !ye(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 as=Math.PI/8,ls=.35,ss=32,oi=.25,ri=.5,ni=.07;function He(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??ls,0),a=e.extent,l=[];for(let s=0;s<o;s++){let c=i[s*2],f=i[s*2+1],u=i[(s+o-1)%o*2],d=i[(s+o-1)%o*2+1],h=i[(s+1)%o*2],m=i[(s+1)%o*2+1],y=c-u,p=f-d,b=h-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 x=y/v,_=p/v,M=b/w,C=g/w;if(e.keep?.[s]){l.push(c,f);continue}let S=x*M+_*C;if(S>.985){l.push(c,f);continue}if(a!==void 0&&(c<=0||c>=a||f<=0||f>=a)){l.push(c,f);continue}let T=Math.min(t,v*ti,w*ti);if(T<t*n){l.push(c,f);continue}let A=c-x*T,k=f-_*T,L=c+M*T,R=f+C*T,I=Math.acos(Math.max(-1,Math.min(1,S))),E=Math.min(as,Math.PI/2/r),H=Math.ceil(I/E-1e-6),W=e.maxChord&&e.maxChord>0?Math.ceil(T/Math.tan(I/2)*I/e.maxChord):0,F=Math.max(1,Math.min(ss,Math.max(Math.min(r,H),W)));l.push(A,k);for(let P=1;P<F;P++){let N=P/F,O=1-N;l.push(O*O*A+2*O*N*c+N*N*L,O*O*k+2*O*N*f+N*N*R);}l.push(L,R);}return l.length<6?i:(l.push(l[0],l[1]),l)}var ti=.4;var Me=i=>i/64;function De(i,e,t=0){let o=ii(i.outer,e,t);if(!o)return null;let r=[];for(let n of i.holes){let a=ii(n,e,t);a&&r.push(a);}return {outer:o,holes:r}}function ii(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],d=ai(s,c,r,e,t),h=ai(f,u,r,e,t);if(d!==h){let m=cs(f,u,s,c,r,e,t),y=r===0?-t:r===1?e+t:f+(s-f)*m,p=r===2?-t:r===3?e+t:u+(c-u)*m;o.push(y,p);}d&&o.push(s,c);}}return o.length<6?null:(o.push(o[0],o[1]),o)}function ai(i,e,t,o,r){return t===0?i>=-r:t===1?i<=o+r:t===2?e>=-r:e<=o+r}function cs(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 Co(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 cr(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 li=1,ke=18,ut=32,ft=8,pi=65535/ut,fs=9,us=1,ds=0,hs=1,ms=2;var si=0,ps=1,ci=2,bs=3,bi=.47;function dr(i,e,t,o={},r){let n=o.metersPerUnit&&o.metersPerUnit>0?o.metersPerUnit:bi,{b:a,ensure:l,take:s}=yi(Math.max(1024,i.length*48));for(let c of i.features()){if(c.type!==3||!ye(t,c.properties))continue;let f=Os(c.properties),u=Bs(c.properties,f);if(f<=u)continue;let d=Vs(c.properties)??Number(c.id??0),h=Hs(d>>>0),m=Ps(h,c.properties),y=zs(c.properties,f),p=tt(c.loadGeometry()),b=r?p.some(g=>{let v=De(g,e,Me(e));return v?cr(v.outer,e):false}):false;for(let g of p){if(r&&b){let v=Ds(g,e,f,u,d,h,m,y);v&&r.push(v);}wi(a,g,l,{extent:e,metersPerUnit:n,height:f,minHeight:u,featureId:d,seed:h,tint:m,facade:y,props:c.properties,cornerRadius:o.cornerRadius??0,cornerSegments:o.cornerSegments,whole:false});}}return s(e)}function yi(i){let e=i,t=new ArrayBuffer(e*ke),o={verts:new DataView(t),vertsU8:new Uint8Array(t),vertOffset:0,vertexCount:0,indices:[],featureIds:[],ensure:()=>{}},r=a=>{if(o.vertexCount+a<=e)return;e=Math.max(e*2,o.vertexCount+a);let l=new ArrayBuffer(e*ke);new Uint8Array(l).set(o.vertsU8.subarray(0,o.vertOffset)),t=l,o.verts=new DataView(l),o.vertsU8=new Uint8Array(l);};return o.ensure=r,{b:o,ensure:r,take:a=>{if(!o.indices.length)return null;let l=new Uint32Array(o.indices),s=new Float64Array(o.featureIds);return {vertices:t.slice(0,o.vertOffset),indices:l.buffer,featureIds:s.buffer,vertexCount:o.vertexCount,indexCount:l.length,extent:a}}}}function gi(i,e,t={}){let o=t.metersPerUnit&&t.metersPerUnit>0?t.metersPerUnit:bi,{b:r,ensure:n,take:a}=yi(Math.max(1024,i.length*64));for(let{rings:l,seam:s}of i)wi(r,l,n,{extent:e,metersPerUnit:o,height:s.height,minHeight:s.minHeight,featureId:s.osmId,seed:s.seed,tint:s.tint,facade:s.facade,props:{},cornerRadius:t.cornerRadius??0,cornerSegments:t.cornerSegments,whole:true});return a(e)}var hr=(i,e)=>i|e<<2,fi=i=>Math.max(-32768,Math.min(32767,i)),fr=i=>Math.max(0,Math.min(65535,Math.round(Math.min(i,pi)*ut)));function st(i,e,t,o,r,n,a,l,s,c,f=0,u=0,d=0){let h=i.vertOffset;return i.verts.setInt16(h,fi(Math.round(e*ft)),true),i.verts.setInt16(h+2,fi(Math.round(t*ft)),true),i.verts.setUint16(h+4,Math.round(Math.min(o,pi)*ut),true),i.vertsU8[h+6]=s,i.vertsU8[h+7]=l,i.verts.setInt8(h+8,ur(Math.round(r*127))),i.verts.setInt8(h+9,ur(Math.round(n*127))),i.verts.setInt8(h+10,ur(Math.round(a*127))),i.vertsU8[h+11]=c,i.verts.setUint16(h+12,fr(f),true),i.verts.setUint16(h+14,fr(u),true),i.verts.setUint16(h+16,fr(d),true),i.vertOffset+=ke,i.vertexCount++}function ui(i,e,t,o,r,n,a,l,s,c){let f=e.length/2;if(f<3)return;let u=hr(ds,a),d=gs(e,l),h=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],x=p[g*2+1]+p[b*2+1],_=Math.hypot(w,x);v>.5&&_>1e-6&&(m[b*2]=w/_,m[b*2+1]=x/_,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||c[p])continue;let x=v-b,_=w-g,M=Math.hypot(x,_)||1,C=_/M,S=-x/M,T=d.offset[p],A=d.width[p],k=[0,1];if(s){for(let R=0;R<s.length;R++)for(let I=R+1;I<s.length;I++){let E=ot(s[R],b,g)-ot(s[I],b,g),H=ot(s[R],v,w)-ot(s[I],v,w);if(E===H)continue;let W=E/(E-H);W>1e-4&&W<1-1e-4&&k.push(W);}k.sort((R,I)=>R-I);}let L=(R,I)=>{if(!s)return o;let E=1/0;for(let H of s)E=Math.min(E,ot(H,R,I));return Math.max(o,E)};for(let R=0;R+1<k.length;R++){let I=k[R],E=k[R+1];if(E-I<1e-6)continue;let H=b+x*I,W=g+_*I,F=b+x*E,P=g+_*E,N=T+M*I*l,O=T+M*E*l,B=(p+1)%(f-1),V=y[p]?m[p*2]:C,j=y[p]?m[p*2+1]:S,X=y[B]?m[B*2]:C,q=y[B]?m[B*2+1]:S,Q=C+(V-C)*(1-I),Z=S+(j-S)*(1-I),U=C+(X-C)*E,ne=S+(q-S)*E,ie=Math.hypot(Q,Z)||1,J=Math.hypot(U,ne)||1,K=Q/ie,Y=Z/ie,oe=U/J,re=ne/J;i.ensure(4);let ce=st(i,H,W,t,K,Y,0,0,n,u,N,A,h),ae=st(i,F,P,t,oe,re,0,0,n,u,O,A,h),me=st(i,H,W,L(H,W),K,Y,0,255,n,u,N,A,h),we=st(i,F,P,L(F,P),oe,re,0,255,n,u,O,A,h);i.indices.push(ce,we,ae,ce,me,we),i.featureIds.push(r,r);}}}var ys=.9976;function gs(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>=ys,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,d=s+1;for(;d<t;){let m=(n+d)%t;if(!r((n+d-1)%t,m))break;f.push(m),u+=o[m].len,d++;}let h=0;for(let m of f)a[m]=h,l[m]=u,h+=o[m].len;s=d;}return {offset:a,width:l}}function vs(i,e,t,o,r,n,a){let l=[],s=[];for(let d=0;d<e.length;d++)l.push(e[d]);for(let d of t){s.push(l.length/2);for(let h=0;h<d.length;h++)l.push(d[h]);}let c=mi__default.default(l,s.length?s:void 0,2);if(!c.length)return;let f=hr(hs,a),u=i.vertexCount;for(let d=0;d<l.length;d+=2)st(i,l[d],l[d+1],o,0,0,1,255,n,f);for(let d=0;d<c.length;d+=3)i.indices.push(u+c[d],u+c[d+2],u+c[d+1]),i.featureIds.push(r);}function ws(i){let e=xs(i);if(e.length<3)return null;let t=Math.abs(_s(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,d=1/0,h=-1/0;for(let w of e){let x=w.x*l+w.y*s,_=-w.x*s+w.y*l;x<f&&(f=x),x>u&&(u=x),_<d&&(d=_),_>h&&(h=_);}let m=u-f,y=h-d,p=m*y;if(p<=0||p>=r)continue;r=p;let b=(f+u)/2,g=(d+h)/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 xs(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 _s(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 Cs=Math.tan(30*Math.PI/180),Ss=3.5,Ms=.9;function Ts(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=ks(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 ks(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 ot=(i,e,t)=>i.a*e+i.b*t+i.c;function Es(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),d=e*s+t*c+o,h=e*f+t*u+o;if(d<=0!=h<=0){let m=h/(h-d);n.push(f+(s-f)*m,u+(c-u)*m);}d<=0&&n.push(s,c);}return n}function As(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,d=f-s,h=Math.hypot(u,d),m=h>1e-6;if(m){for(let y=n+1;y<a;y++)if(Math.abs((i[y*2]-l)*d-(i[y*2+1]-s)*u)/h>=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 vi(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],d=i[(s+1)%l*2+1],h=u-c,m=d-f,y=Math.hypot(h,m);if(y<1e-6||t==="gabled"&&Math.abs((h*o+m*r)/y)<.86)continue;let p=-m/y,b=h/y;a.push({a:p,b,c:-(p*c+b*f)});}return !a.length&&n>0?vi(i,e,"hipped"):a}function Is(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=Es(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 Ls(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=ot(i[o],r[n],r[n+1]);a>t&&(t=a);}}return t}function Rs(i,e,t){return i.map(o=>({a:o.a*e,b:o.b*e,c:o.c*e+t}))}function Fs(i,e,t,o,r,n,a,l){let s=hr(ms,a);for(let c=0;c<t.length;c++){let f=e[c];if(!f||f.length<6)continue;let u=mi__default.default(f,void 0,2);if(!u.length)continue;let d=-t[c].a/l,h=-t[c].b/l,m=Math.hypot(d,h,1),y={x:d/m,y:h/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,ot(t[c],f[b],f[b+1]));st(i,f[b],f[b+1],g,y.x,y.y,y.z,255,n,s);}for(let b=0;b<u.length;b+=3)i.indices.push(p+u[b],p+u[b+2],p+u[b+1]),i.featureIds.push(r);}}function zs(i,e){let t=String(i.class??"").toLowerCase();return t==="industrial"||t==="warehouse"||t==="hangar"||t==="construction"?bs:t==="commercial"||t==="office"||t==="retail"||t==="supermarket"?ci:t==="house"||t==="detached"||t==="garage"||t==="hut"||t==="shed"||e<=7?si:e>=40?ci:ps}function Ps(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 Hs(i){let e=i>>>0;return e=(e>>>16^e)*73244475,e=(e>>>16^e)*73244475,e=e>>>16^e,e>>>0}function Os(i){let e=ct(i.render_height)??ct(i.height)??Ws(i.levels??i.building_levels??i["building:levels"]);return e&&e>0?Math.max(e,us):fs}function Bs(i,e){let t=ct(i.render_min_height)??ct(i.min_height)??ct(i.base)??0;return t>0&&t<e?t:0}function Ws(i){let e=ct(i);return e&&e>0?e*3:null}function ct(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 ur=i=>i>127?127:i<-127?-127:i;function Vs(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 di(i,e){let t=i.length/2-1,o=new Array(Math.max(t,0)).fill(false);if(t<3)return {ring:i,cut:o};let r=(a,l)=>a===0?1:a===e?2:l===0?3:l===e?4:0,n=i.slice();for(let a=0;a<t;a++){let l=i[a*2],s=i[a*2+1],c=r(l,s);if(!c)continue;let f=(a+t-1)%t,u=(a+1)%t,d=r(i[f*2],i[f*2+1])===c,h=r(i[u*2],i[u*2+1])===c;h&&(o[a]=true);let m=d===h?-1:d?u:f;if(m<0)continue;let y=l-i[m*2],p=s-i[m*2+1],b=Math.hypot(y,p);b<1e-6||(n[a*2]=l+y/b*li,n[a*2+1]=s+p/b*li);}return n[t*2]=n[0],n[t*2+1]=n[1],{ring:n,cut:o}}function wi(i,e,t,o){let{extent:r,metersPerUnit:n,height:a,minHeight:l,featureId:s,seed:c,tint:f,facade:u}=o,d=o.whole?e:De(e,r,Me(r));if(!d)return;let h=o.cornerRadius/n,m={radius:h,segments:o.cornerSegments,minCutRatio:0,maxChord:n>0?ri/n:0,...o.whole?{}:{extent:r,margin:Me(r)}},y=h>0?{outer:He(d.outer,m),holes:d.holes.map(A=>He(A,m))}:d,p=o.whole?y:De(y,r);if(!p)return;let b=A=>({ring:A,cut:new Array(Math.max(A.length/2-1,0)).fill(false)}),g=o.whole?b(p.outer):di(p.outer,r),v=p.holes.map(A=>o.whole?b(A):di(A,r)),w={outer:g.ring,holes:v.map(A=>A.ring)},x=o.whole?true:cr(w.outer,r),_=w.outer.length/2+w.holes.reduce((A,k)=>A+k.length/2,0);t(_*5+32);let M=w.holes.length||x?null:ws(w.outer),C=M?Ts(o.props,M,a,c,n):null,S=null,T=[];if(C&&M){let A=vi(As(w.outer,n),M,C.shape);T=Is(A,w.outer);let k=Ls(A,T);if(k>1e-6){let L=Math.min(Math.max(k*n*Cs,Ms),Ss);S=Rs(A,L/k,a);}}ui(i,w.outer,l,a,s,f,u,n,S,g.cut);for(let A=0;A<w.holes.length;A++)ui(i,w.holes[A],l,a,s,f,u,n,null,v[A].cut);S?Fs(i,T,S,a,s,f,u,n):vs(i,w.outer,w.holes,a,s,f,u);}function hi(i,e){let t=Me(e),o=Math.max(i.length/2-1,0),r=new Array(o);for(let n=0;n<o;n++)r[n]=Co(i[n*2],i[n*2+1],i[n*2+2],i[n*2+3],e,t);return r}function Ds(i,e,t,o,r,n,a,l){let s=De(i,e,Me(e));if(!s)return null;let c=hi(s.outer,e);return {osmId:r,height:t,minHeight:o,seed:n,tint:a,facade:l,outer:s.outer,holes:s.holes,outerCut:c,holeCuts:s.holes.map(f=>hi(f,e))}}var Xe=4;function mr(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 d=i.length/2;return i.push((l(f)+l(u))/2,(s(f)+s(u))/2),d};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[d,h,m]=a.pop(),y=(l(d)-l(h))**2+(s(d)-s(h))**2,p=(l(h)-l(m))**2+(s(h)-s(m))**2,b=(l(m)-l(d))**2+(s(m)-s(d))**2,g=Math.max(y,p,b);if(g<=n){r.push(d,h,m);continue}if(g===y){let v=c(d,h);a.push([d,v,m],[v,h,m]);}else if(g===p){let v=c(h,m);a.push([h,v,d],[v,m,d]);}else {let v=c(m,d);a.push([m,v,h],[v,d,h]);}}}}function pr(i,e,t=0,o,r=false,n=4096){let a=[],l=[],s=[];for(let h of i.features()){if(h.type!==3||!ye(e,h.properties))continue;let m=h.properties.osm_id,y=typeof m=="number"?m:typeof m=="string"?Number(m):NaN,p=Number.isFinite(y)?y:Number(h.id??0);for(let b of tt(h.loadGeometry())){let g=r?De(b,n):b;if(!g)continue;let v=[],w=[],x=o?He(g.outer,o):g.outer;for(let C=0;C<x.length;C++)v.push(x[C]);for(let C of g.holes){let S=o?He(C,o):C;w.push(v.length/2);for(let T=0;T<S.length;T++)v.push(S[T]);}let _=mi__default.default(v,w.length?w:void 0,2);if(!_.length)continue;let M=a.length/2;for(let C=0;C<v.length;C++)a.push(v[C]);if(t>0){let C=[];mr(a,_,M,t,C);for(let S=0;S<C.length;S+=3)l.push(C[S],C[S+2],C[S+1]),s.push(p);continue}for(let C=0;C<_.length;C+=3)l.push(M+_[C],M+_[C+2],M+_[C+1]),s.push(p);}}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 xi=Gs__namespace,br=xi.union??xi.default?.union??null;br||console.warn("[osmgl] polygon-clipping \u0431\u0435\u0437 union \u2014 \u043E\u0431\u044A\u0435\u0434\u0438\u043D\u0435\u043D\u0438\u0435 \u0444\u0438\u0433\u0443\u0440 \u0432\u044B\u043A\u043B\u044E\u0447\u0435\u043D\u043E");function _i(i){let e=[];for(let t=0;t+1<i.length;t+=2)e.push([i[t],i[t+1]]);return e}function Ci(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 So(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(d=>e(d,t)??d)})):a).map(u=>[_i(u.outer),...u.holes.map(_i)]),c;try{if(!br)throw new Error("\u043D\u0435\u0442 union");c=br(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 d=Ci(u[0]);if(d.length<8)continue;let h=[];for(let m=1;m<u.length;m++){let y=Ci(u[m]);y.length>=8&&h.push(y);}r.push(n?{outer:d,holes:h,lift:n}:{outer:d,holes:h});}}return r}var dt=16,Ii=64,Li=0,js=1,Si=2,Xs=3,zt=1,Ks=.6;function _r(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*dt),d={view:new DataView(u),bytes:new Uint8Array(u),offset:0,count:0,indices:[],extent:e,ensure(k){if(d.count+k<=f)return;f=Math.max(f*2,d.count+k);let L=new ArrayBuffer(f*dt);new Uint8Array(L).set(d.bytes.subarray(0,d.offset)),u=L,d.view=new DataView(L),d.bytes=new Uint8Array(L);}},h=[],m=[],y=new Map;for(let k of i.features()){if(k.type!==3||!ye(t,k.properties))continue;let L=o.liftBy?.(k.properties)??0,R=k.properties.osm_id,I=typeof R=="number"?R:typeof R=="string"?Number(R):NaN,E=Number.isFinite(I)?I:Number(k.id??0);for(let H of tt(k.loadGeometry())){let W=De(H,e,Me(e));W&&(h.push(L?{...W,lift:L}:W),m.push(E));}}let p=new Set,b=Math.max(o.weld??Ks,0),g=So(h,(k,L)=>gr(k,L,e,p),b/r),v=b>0?g.map(k=>({...k,outer:Ai(k.outer,b/r,e),holes:k.holes.map(L=>Ai(L,b/r,e))})):g;for(let k of v){Ti(k.outer,y);for(let L of k.holes)Ti(L,y);}o.onShapes?.(v);let w=Ys(v,h,m),x=new Set;for(let[k,L]of y)L>1&&x.add(k);let _=[],M={radius:c,segments:o.cornerSegments,extent:e,margin:Me(e),minCutRatio:0,maxChord:oi/r},C=[];for(let k of v){let L=d.indices.length,R=_.length,I=c>0?{outer:He(k.outer,{...M,keep:ki(k.outer,x)}),holes:k.holes.map(B=>He(B,{...M,keep:ki(B,x)}))}:k,E=l>0?gr(I.outer,l,e,x):I.outer,H=I.holes.map(B=>l>0?gr(B,-l,e,x):B),W=k.lift??0,F=n+W,P=a+W;Ei(d,E??I.outer,H.map((B,V)=>B??I.holes[V]),F,Li,o.maxSegment??0);let N=F,O=F-s;E&&l>0&&s>0&&yr(d,E,I.outer,N,O,js,e,x),O!==P&&yr(d,I.outer,I.outer,O,P,Si,e,x);for(let B of I.holes)if(O!==P&&yr(d,B,B,O,P,Si,e,x),F<P){let V=d.indices.length;Ei(d,B,[],P,Xs);for(let j=V;j<d.indices.length;j++)_.push(d.indices[j]);d.indices.length=V;}C.push(L,d.indices.length,R,_.length);}if(!d.indices.length&&!_.length)return null;let S=d.indices.length;for(let k=0;k<C.length;k+=4)C[k+2]+=S,C[k+3]+=S;let T=[];for(let k of w){T.push(k.length);for(let L of k)T.push(L);}let A=new Uint32Array(S+_.length);return A.set(d.indices,0),A.set(_,S),{vertices:u.slice(0,d.offset),indices:A.buffer,vertexCount:d.count,indexCount:A.length,extent:e,capIndexOffset:S,shapeFeatures:new Float64Array(T).buffer,shapeRanges:new Uint32Array(C).buffer}}function Ys(i,e,t){let o=i.map(()=>[]);if(!i.length)return o;let r=i.map(n=>Mi(n.outer));for(let n=0;n<e.length;n++){let a=$s(e[n].outer);if(!a)continue;let l=-1;for(let s=0;s<i.length;s++){let c=r[s];if(a[0]<c[0]||a[0]>c[2]||a[1]<c[1]||a[1]>c[3]||!xr(i[s].outer,a[0],a[1]))continue;let f=false;for(let u of i[s].holes)if(xr(u,a[0],a[1])){f=true;break}if(!f){l=s;break}}if(l<0){let s=Mi(e[n].outer),c=0;for(let f=0;f<i.length;f++){let u=r[f],d=Math.min(s[2],u[2])-Math.max(s[0],u[0]),h=Math.min(s[3],u[3])-Math.max(s[1],u[1]),m=d>0&&h>0?d*h:0;m>c&&(c=m,l=f);}}l<0&&(l=0),o[l].includes(t[n])||o[l].push(t[n]);}return o}function Mi(i){let e=1/0,t=1/0,o=-1/0,r=-1/0;for(let n=0;n<i.length;n+=2)i[n]<e&&(e=i[n]),i[n]>o&&(o=i[n]),i[n+1]<t&&(t=i[n+1]),i[n+1]>r&&(r=i[n+1]);return [e,t,o,r]}function $s(i){let e=i.length/2-1;if(e<3)return null;let t=0;for(let r=0;r<e;r++){let n=(r+1)%e;t+=i[r*2]*i[n*2+1]-i[n*2]*i[r*2+1];}let o=t>0;for(let r=0;r<e;r++){let n=(r+e-1)%e*2,a=r*2,l=(r+1)%e*2,s=(i[a]-i[n])*(i[l+1]-i[n+1])-(i[a+1]-i[n+1])*(i[l]-i[n]);if(s===0||s>0!==o)continue;let c=(i[n]+i[a]+i[l])/3,f=(i[n+1]+i[a+1]+i[l+1])/3;if(xr(i,c,f))return [c,f]}return null}function xr(i,e,t){let o=false,r=i.length/2-1;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}function ht(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 Ti(i,e){for(let t=0;t+3<i.length;t+=2){let o=ht(i[t],i[t+1],i[t+2],i[t+3]);e.set(o,(e.get(o)??0)+1);}}function ki(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=ht(i[(r+t-1)%t*2],i[(r+t-1)%t*2+1],i[r*2],i[r*2+1]),a=ht(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 Pt(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,qs(Math.round(o*Ii)),true),i.view.setInt8(s+10,wr(Math.round(r*127))),i.view.setInt8(s+11,wr(Math.round(n*127))),i.view.setInt8(s+12,wr(Math.round(a*127))),i.bytes[s+13]=l,i.view.setInt8(s+14,e<=0?-zt:e>=i.extent?zt:0),i.view.setInt8(s+15,t<=0?-zt:t>=i.extent?zt:0),i.offset+=dt,i.count++}function Ei(i,e,t,o,r=Li,n=0){let a=[],l=[];for(let u=0;u<e.length;u++)a.push(e[u]);for(let u of t){l.push(a.length/2);for(let d=0;d<u.length;d++)a.push(u[d]);}let s=mi__default.default(a,l.length?l:void 0,2);if(!s.length)return;let c=s;if(n>0){let u=[];mr(a,s,0,n,u),c=u;}i.ensure(a.length/2);let f=i.count;for(let u=0;u<a.length;u+=2)Pt(i,a[u],a[u+1],o,0,0,1,r);for(let u=0;u<c.length;u+=3)i.indices.push(f+c[u],f+c[u+2],f+c[u+1]);}function yr(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],d=t[c*2+2],h=t[c*2+3];if(f===d&&u===h||Co(f,u,d,h,a,Me(a))||l.has(ht(f,u,d,h)))continue;let m=d-f,y=h-u,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]-u)||0,x=0;if(w>1e-6&&v!==0){let T=1/Math.hypot(1,v/w);x=w/Math.hypot(w,v)*Math.sign(v),b*=T,g*=T;}let _=Pt(i,e[c*2],e[c*2+1],o,b,g,x,n),M=Pt(i,e[c*2+2],e[c*2+3],o,b,g,x,n),C=Pt(i,f,u,r,b,g,x,n),S=Pt(i,d,h,r,b,g,x,n);i.indices.push(C,M,S,C,_,M);}}}function gr(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],d=i[f*2+1],h=i[(f+r-1)%r*2],m=i[(f+r-1)%r*2+1],y=i[(f+1)%r*2],p=i[(f+1)%r*2+1],b=Math.hypot(u-h,d-m)||1,g=Math.hypot(y-u,p-d)||1,v=(d-m)/b,w=-(u-h)/b,x=(p-d)/g,_=-(y-u)/g,M=v+x,C=w+_,S=Math.hypot(M,C);if(S<1e-6){n.push(u,d);continue}M/=S,C/=S;let T=Math.min(1/Math.max(M*v+C*w,.35),3),A=u-M*e*T,k=d-C*e*T,L=ht(h,m,u,d),R=ht(u,d,y,p);if(o.has(L)||o.has(R)){n.push(u,d);continue}let I=-Me(t),E=t+Me(t);((W,F)=>W<=I||W>=E||F<=I||F>=E)(u,d)&&(A=u,k=d),n.push(A,k);}n.push(n[0],n[1]);let a=Math.abs(vr(i)),l=vr(n);if(Math.sign(l)!==Math.sign(vr(i))||Math.abs(l)<a*.25)return null;let s=-Me(t),c=t+Me(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 vr(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 wr=i=>i>127?127:i<-127?-127:i,qs=i=>i>32767?32767:i<-32768?-32768:i;function Ai(i,e,t){if(!(e>0))return i;let o=Me(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 d=0;d<s&&!(f<=5);d++){let h=a[d*2],m=a[d*2+1];if(h<=r||h>=n||m<=r||m>=n)continue;let y=(d+s-1)%s;for(;!c[y]&&y!==d;)y=(y+s-1)%s;let p=(d+1)%s;for(;!c[p]&&p!==d;)p=(p+1)%s;if(y===d||p===d)break;let b=a[y*2],g=a[y*2+1],v=a[p*2]-b,w=a[p*2+1]-g,x=Math.hypot(v,w);x<1e-6||Math.abs((h-b)*w-(m-g)*v)/x<e&&(c[d]=false,f--);}if(f===s)break;let u=[];for(let d=0;d<s;d++)c[d]&&u.push(a[d*2],a[d*2+1]);u.push(u[0],u[1]),a=u;}return a}var Zs=100;function Cr(i){return {shapes:[],cells:[],extent:0,metersPerTile:i}}function Sr(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 Qs(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=mt(Math.floor(o.minX/e)),n=mt(Math.floor(o.maxX/e)),a=mt(Math.floor(o.minY/e)),l=mt(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 Fi=i=>i.shapes.length===0;function Mo(i,e,t){!i.cells.length&&i.shapes.length&&Qs(i);let o=i.extent/32,r=i.cells[mt(Math.floor(t/o))*32+mt(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||!Ri(l.outer,e,t))continue;let s=false;for(let c of l.holes)if(Ri(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=Mo(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],d=Mo(i,f,u);if(d!==a&&n>0){let h=Math.hypot(f-s,u-c),m=Math.min(Math.ceil(h/n),64),y=a;for(let p=1;p<m;p++){let b=p/m,g=s+(f-s)*b,v=c+(u-c)*b,w=Mo(i,g,v);w!==y&&(t.push(g,v),o.push(w),y=w);}}t.push(f,u),o.push(d),a=d;}return {pts:t,levels:o}}var mt=i=>i<0?0:i>31?31:i;function Ri(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 Js=5;function rt(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 Ke=20;function Tr(i,e,t=0,o,r=0,n={}){let{level:a}=n,l=Math.max(256,i.length*24),s=new ArrayBuffer(l*Ke),c=new DataView(s),f=0,u=[],d=[],h=x=>{if(f+x<=l)return;l=Math.max(l*2,f+x);let _=new ArrayBuffer(l*Ke);new Uint8Array(_).set(new Uint8Array(s,0,f*Ke)),s=_,c=new DataView(_);},m=(x,_,M,C,S,T,A,k=0,L=0,R=0)=>{let I=f*Ke;return c.setInt16(I,x,true),c.setInt16(I+2,_,true),c.setInt16(I+4,M,true),c.setInt16(I+6,C,true),c.setInt8(I+8,S),c.setInt8(I+9,T),c.setInt8(I+10,k),c.setInt8(I+11,L),c.setFloat32(I+12,A,true),c.setFloat32(I+16,R,true),f++},y=0,p=0,b=r>0?12/r:0,g=b>0?nc(i):null;for(let x of i.features()){if(x.type!==2&&x.type!==3||!ye(e,x.properties)||a!==void 0&&rt(x.properties)!==a)continue;let _=x.properties.osm_id,M=typeof _=="number"?_:typeof _=="string"?Number(_):NaN;p=Number.isFinite(M)?M:Number(x.id??0);let C=x.properties.width;y=typeof C=="number"&&C>.5&&C<100?C:0;let S=x.type===3;for(let T of x.loadGeometry()){let A=t>0?tc(zi(T),t):zi(T);if(A.length<4)continue;let k=o&&!Fi(o)?Mr(o,A):null,L=k?k.pts:A,R=k?.levels,I=L.length/2;if(I<2)continue;let E=rt(x.properties),H=To(Math.round(L[0]),Math.round(L[1])),W=To(Math.round(L[I*2-2]),Math.round(L[I*2-1])),F=null,P=y;if(g&&y>0&&!S){let O=0;for(let q=0;q<I-1;q++)O+=Math.hypot(L[q*2+2]-L[q*2],L[q*2+3]-L[q*2+1]);P=Hi(E,y,H,W,g);let B=q=>Math.min(g.width.get(q)??0,P*2),V=B(H)-P,j=B(W)-P,X=Math.min(b,O/2);if(X>0&&(V>0||j>0)){F=Q=>{let Z=0;return V>0&&Q<X&&(Z=V*(1-Q/X)),j>0&&O-Q<X&&(Z=Math.max(Z,j*(1-(O-Q)/X))),P+Z};let q=[];for(let Q of [X,O-X])Q>.01&&Q<O-.01&&q.push(Q);if(q.length){let Q=ec(L,R,q);L=Q.pts,R=Q.levels,I=L.length/2;}}}h((I-1)*4);let N=0;for(let O=0;O<I-1;O++){let B=L[O*2],V=L[O*2+1],j=L[O*2+2],X=L[O*2+3],q=Math.hypot(j-B,X-V);if(S&&rc(B,V,j,X,i.extent)){N+=q;continue}let Q=oc(B,V,j,X,i.extent);if(!Q){N+=q;continue}let[Z,U,ne,ie]=Q,J=Math.hypot(Z-B,U-V),K=Math.hypot(ne-Z,ie-U),Y=Math.hypot(j-ne,X-ie),oe=N+J,re=R?R[O]:0,ce=R?R[O+1]:0,ae=F?F(oe):P,me=F?F(oe+K):P,we=m(Z,U,ne,ie,0,-1,oe,re,ce,ae),ge=m(Z,U,ne,ie,0,1,oe,re,ce,ae),Qe=m(Z,U,ne,ie,1,1,oe,re,ce,me),at=m(Z,U,ne,ie,1,-1,oe,re,ce,me);N+=J+K+Y,u.push(we,ge,Qe,we,Qe,at),d.push(p,p);}}}if(!u.length)return null;let v=new Uint32Array(u),w=new Float64Array(d);return {vertices:s.slice(0,f*Ke),indices:v.buffer,vertexCount:f,indexCount:v.length,featureIds:w.buffer}}function ec(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],d=i[s+3],h=Math.hypot(u-c,d-f);for(;l<o.length&&o[l]<=a+.01;)l++;for(;l<o.length&&o[l]<a+h-.01;){let m=(o[l]-a)/h;r.push(c+(u-c)*m,f+(d-f)*m),n&&e&&n.push(Math.round(e[s/2]+(e[s/2+1]-e[s/2])*m)),l++;}a+=h,r.push(u,d),n&&e&&n.push(e[s/2+1]);}return {pts:r,levels:n}}function tc(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 zi(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 oc(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 d=u/f;if(f<0){if(d>s)return null;d>l&&(l=d);}else {if(d<l)return null;d<s&&(s=d);}}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 rc(i,e,t,o,r){return i===t&&(i<=0||i>=r)?true:e===o&&(e<=0||e>=r)}var Pi=new WeakMap,To=(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 nc(i){let e=Pi.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=rt(r.properties);for(let s of r.loadGeometry()){if(s.length<4)continue;let c=To(Math.round(s[0]),Math.round(s[1])),f=To(Math.round(s[s.length-2]),Math.round(s[s.length-1]));for(let u of [c,f]){let d=u+(l+8)*4294967296;t.ends.set(d,(t.ends.get(d)??0)+1),a>0&&t.raw.set(d,Math.max(t.raw.get(d)??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 Pi.set(i,t),t}function kr(i){if(!i.length)return null;for(let t of i)if(!t.cut.some(Boolean))return [{outer:t.ring,holes:t.holes??[]}];if(i.length<2)return null;let e=So(i.map(t=>({outer:t.ring,holes:t.holes??[]})));return e.length?e:null}var ko=class{constructor(){this.meshes=new z;this.stitched=new ee;this.hiddenByTile=new z;this.changed=new ee;this.signature="";this.meshSig=new z;this.cache=new z;}update(e,t,o){let r=new z,n=0,a="";for(let[u,d]of e.loadedTiles()){if(d.id.z!==o.zoom)continue;let h=d.data?.seams;if(h?.length){a+=u+";",n=d.data?.buckets?.[t]?.extent??n;for(let m of h){let y=r.get(m.osmId);y?y.push({seam:m,tile:d.id}):r.set(m.osmId,[{seam:m,tile:d.id}]);}}}if(a===this.signature)return false;if(this.signature=a,this.changed.clear(),this.stitched.clear(),this.hiddenByTile.clear(),!n||!r.size){for(let u of this.meshes.keys())this.changed.add(u);return this.meshes.clear(),this.meshSig.clear(),this.cache.clear(),true}let l=new z,s=new z,c=new z,f=new ee;for(let[u,d]of r){f.add(u);let h=d.map(b=>b.tile.dataKey).sort().join(","),m=this.cache.get(u);if(!m||m.sig!==h){let b=d[0].tile,g=d.map(({seam:w,tile:x})=>({ring:Oi(w.outer,x,b,n),holes:w.holes.map(_=>Oi(_,x,b,n)),cut:w.outerCut})),v=kr(g);if(v?.length)m={sig:h,shapes:v,owner:b,seam:d[0].seam,tiles:d.map(w=>w.tile.dataKey)},this.cache.set(u,m);else if(!m)continue}let y=m.owner.dataKey;s.set(y,m.owner);let p=l.get(y)??[];for(let b of m.shapes)p.push({rings:{outer:b.outer,holes:b.holes},seam:m.seam});l.set(y,p),c.set(y,(c.get(y)??"")+u+":"+m.sig+";"),this.stitched.add(u);for(let b of [...m.tiles,...d.map(g=>g.tile.dataKey)]){let g=this.hiddenByTile.get(b);g?g.add(u):this.hiddenByTile.set(b,new Set([u]));}}for(let u of [...this.cache.keys()])f.has(u)||this.cache.delete(u);for(let[u,d]of l){let h=c.get(u);if(this.meshSig.get(u)===h&&this.meshes.has(u))continue;let m=gi(d,n,{metersPerUnit:o.metersPerTile>0?o.metersPerTile/n:0,cornerRadius:o.cornerRadius,cornerSegments:o.cornerSegments});this.changed.add(u),m?(this.meshes.set(u,{tile:s.get(u),mesh:m}),this.meshSig.set(u,h)):(this.meshes.delete(u),this.meshSig.delete(u));}for(let u of [...this.meshes.keys()])l.has(u)||(this.meshes.delete(u),this.meshSig.delete(u),this.changed.add(u));return true}reset(){this.meshes.clear(),this.stitched.clear(),this.hiddenByTile.clear(),this.cache.clear();for(let e of this.meshSig.keys())this.changed.add(e);this.meshSig.clear(),this.signature="";}};function Oi(i,e,t,o){let r=(e.x-t.x)*o,n=(e.y-t.y)*o,a=new Array(i.length);for(let l=0;l<i.length;l+=2)a[l]=i[l]+r,a[l+1]=i[l+1]+n;return a}var Er={enabled:true,skyColor:"#7fb2e5",horizonColor:"#dfe6ee",fogRange:[2.43,10.1],fogIntensity:.92,fogVerticalRange:[35,220],spaceColor:"#05070f",atmosphereColor:"#79b8f5",starIntensity:.55,horizonBlend:.14},Ar={ambientColor:"#ffffff",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#fff4e2",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#dce6f2",fillIntensity:.18};var Bi={version:1,name:"OSM 3D \u2014 \u0434\u043D\u0435\u0432\u043D\u043E\u0439",background:"#dbd8d4",light:{ambientColor:"#ffffff",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#ffffff",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#ffffff",fillIntensity:.18},layers:[{id:"world-landcover-wood",type:"fill",source:"world","source-layer":"landcover",maxzoom:7,filter:["in","class","wood","forest"],paint:{color:{from:"landcover-wood"}}},{id:"world-landcover-grass",type:"fill",source:"world","source-layer":"landcover",maxzoom:7,filter:["in","class","grass","farmland","meadow"],paint:{color:{from:"landcover-grass"}}},{id:"world-landcover-sand",type:"fill",source:"world","source-layer":"landcover",maxzoom:7,filter:["in","class","sand","beach"],paint:{color:{from:"landcover-sand"}}},{id:"world-landcover-ice",type:"fill",source:"world","source-layer":"landcover",maxzoom:7,filter:["in","class","ice","glacier"],paint:{color:{from:"landcover-ice"}}},{id:"world-water",type:"fill",source:"world","source-layer":"water",maxzoom:7,paint:{color:{from:"water"}}},{id:"world-boundary",type:"line",source:"world","source-layer":"boundary",maxzoom:7,paint:{color:{from:"boundary"},opacity:.7,width:{stops:[[0,.5],[6,1.1]]}}},{id:"landcover-wood",type:"fill",minzoom:7,"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",minzoom:7,"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",minzoom:7,"source-layer":"landcover",filter:["in","class","sand","beach"],paint:{color:"#f2e7c8",material:"sand",materialScale:26}},{id:"landcover-ice",type:"fill",minzoom:7,"source-layer":"landcover",filter:["in","class","ice","glacier"],paint:{color:"#e6f2f7"}},{id:"landcover-wetland",type:"fill",minzoom:7,"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:"#d3d0cb",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:"#dddad5"}},{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",minzoom:7,"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",minzoom:7,"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:"#ffffff",roofColor:"#f2f1f0",opacity:1,heightScale:{stops:[[15,0],[15.8,1]]},aoStrength:.18,tintVariation:0,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:"roads"},{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:"roads"},{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:"roads",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:{world:{url:"/tileserver/data/world/{z}/{x}/{y}.pbf",minzoom:0,maxzoom:6},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 Wi={version:1,name:"\u041C\u044F\u0433\u043A\u0430\u044F \u0433\u0435\u043E\u043C\u0435\u0442\u0440\u0438\u044F",background:"#dbd8d4",light:{ambientColor:"#ffffff",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#ffffff",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#ffffff",fillIntensity:.18},layers:[{id:"world-landcover-wood",type:"fill",source:"world","source-layer":"landcover",maxzoom:7,filter:["in","class","wood","forest"],paint:{color:{from:"landcover-wood"}}},{id:"world-landcover-grass",type:"fill",source:"world","source-layer":"landcover",maxzoom:7,filter:["in","class","grass","farmland","meadow"],paint:{color:{from:"landcover-grass"}}},{id:"world-landcover-sand",type:"fill",source:"world","source-layer":"landcover",maxzoom:7,filter:["in","class","sand","beach"],paint:{color:{from:"landcover-sand"}}},{id:"world-landcover-ice",type:"fill",source:"world","source-layer":"landcover",maxzoom:7,filter:["in","class","ice","glacier"],paint:{color:{from:"landcover-ice"}}},{id:"world-water",type:"fill",source:"world","source-layer":"water",maxzoom:7,paint:{color:{from:"water"}}},{id:"world-boundary",type:"line",source:"world","source-layer":"boundary",maxzoom:7,paint:{color:{from:"boundary"},opacity:.7,width:{stops:[[0,.5],[6,1.1]]}}},{id:"landcover-wood",type:"fill",minzoom:7,"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",minzoom:7,"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",minzoom:7,"source-layer":"landcover",filter:["in","class","sand","beach"],paint:{color:"#f2e7c8",material:"sand",materialScale:26},cornerRadius:10,cornerSegments:4},{id:"landcover-ice",type:"fill",minzoom:7,"source-layer":"landcover",filter:["in","class","ice","glacier"],paint:{color:"#e6f2f7"}},{id:"landcover-wetland",type:"fill",minzoom:7,"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:"#d3d0cb",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:"#dddad5"},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",minzoom:7,"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",minzoom:7,"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:"#ffffff",roofColor:"#f2f1f0",opacity:1,heightScale:{stops:[[15,0],[15.8,1]]},aoStrength:.18,tintVariation:0,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:"roads"},{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:"roads"},{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:"roads",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:{world:{url:"/tileserver/data/world/{z}/{x}/{y}.pbf",minzoom:0,maxzoom:6},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 Vi={version:1,name:"\u0420\u0435\u043B\u044C\u0435\u0444",background:"#dbd8d4",light:{ambientColor:"#ffffff",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#ffffff",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#ffffff",fillIntensity:.18},layers:[{id:"world-landcover-wood",type:"fill",source:"world","source-layer":"landcover",maxzoom:7,filter:["in","class","wood","forest"],paint:{color:{from:"landcover-wood"}}},{id:"world-landcover-grass",type:"fill",source:"world","source-layer":"landcover",maxzoom:7,filter:["in","class","grass","farmland","meadow"],paint:{color:{from:"landcover-grass"}}},{id:"world-landcover-sand",type:"fill",source:"world","source-layer":"landcover",maxzoom:7,filter:["in","class","sand","beach"],paint:{color:{from:"landcover-sand"}}},{id:"world-landcover-ice",type:"fill",source:"world","source-layer":"landcover",maxzoom:7,filter:["in","class","ice","glacier"],paint:{color:{from:"landcover-ice"}}},{id:"world-water",type:"fill",source:"world","source-layer":"water",maxzoom:7,paint:{color:{from:"water"}}},{id:"world-boundary",type:"line",source:"world","source-layer":"boundary",maxzoom:7,paint:{color:{from:"boundary"},opacity:.7,width:{stops:[[0,.5],[6,1.1]]}}},{id:"landcover-wood",type:"surface",minzoom:7,"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",minzoom:7,"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",minzoom:7,"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",minzoom:7,"source-layer":"landcover",filter:["in","class","ice","glacier"],paint:{color:"#e6f2f7"}},{id:"landcover-wetland",type:"surface",minzoom:7,"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:"#d3d0cb",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:"#dddad5"}},{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",minzoom:7,"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,weld:0,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",minzoom:7,"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:"#ffffff",roofColor:"#f2f1f0",opacity:1,heightScale:{stops:[[15,0],[15.8,1]]},aoStrength:.18,tintVariation:0,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:"roads"},{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:"roads"},{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:"roads",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:{world:{url:"/tileserver/data/world/{z}/{x}/{y}.pbf",minzoom:0,maxzoom:6},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 Di={version:1,name:"\u041E\u0431\u044A\u0451\u043C\u043D\u044B\u0439 \u0433\u043E\u0440\u043E\u0434",background:"#dbd8d4",light:{ambientColor:"#ffffff",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#ffffff",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#ffffff",fillIntensity:.18},layers:[{id:"world-landcover-wood",type:"fill",source:"world","source-layer":"landcover",maxzoom:7,filter:["in","class","wood","forest"],paint:{color:{from:"landcover-wood"}}},{id:"world-landcover-grass",type:"fill",source:"world","source-layer":"landcover",maxzoom:7,filter:["in","class","grass","farmland","meadow"],paint:{color:{from:"landcover-grass"}}},{id:"world-landcover-sand",type:"fill",source:"world","source-layer":"landcover",maxzoom:7,filter:["in","class","sand","beach"],paint:{color:{from:"landcover-sand"}}},{id:"world-landcover-ice",type:"fill",source:"world","source-layer":"landcover",maxzoom:7,filter:["in","class","ice","glacier"],paint:{color:{from:"landcover-ice"}}},{id:"world-water",type:"fill",source:"world","source-layer":"water",maxzoom:7,paint:{color:{from:"water"}}},{id:"world-boundary",type:"line",source:"world","source-layer":"boundary",maxzoom:7,paint:{color:{from:"boundary"},opacity:.7,width:{stops:[[0,.5],[6,1.1]]}}},{id:"landcover-wood",type:"surface",minzoom:7,"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",minzoom:7,"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",minzoom:7,"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",minzoom:7,"source-layer":"landcover",filter:["in","class","ice","glacier"],paint:{color:"#e6f2f7"}},{id:"landcover-wetland",type:"surface",minzoom:7,"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:"#d3d0cb",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:"#dddad5",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",minzoom:7,"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,weld:0,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",minzoom:7,"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:"#ffffff",roofColor:"#f2f1f0",opacity:1,heightScale:{stops:[[15,0],[15.8,1]]},aoStrength:.18,tintVariation:0,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:"roads"},{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:"roads"},{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:"roads",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:{world:{url:"/tileserver/data/world/{z}/{x}/{y}.pbf",minzoom:0,maxzoom:6},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 Ni={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:[2.34,8.77],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:[2.43,10.12],fogIntensity:.9,spaceColor:"#07080b",atmosphereColor:"#9aa3ad",starIntensity:.5}};var Ui={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:[2.52,12.15],fogIntensity:.85,spaceColor:"#0a1018",atmosphereColor:"#9fd0ff",starIntensity:.45}};var ji={name:"\u041E\u0431\u044A\u0451\u043C\u043D\u0430\u044F",background:"#dfdbda",light:{ambientColor:"#ffffff",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#ffffff",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#ffffff",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:"#e4e1e0"},"landuse-industrial":{color:"#dadce7"},"landuse-civic":{color:"#ecdae0"},"landuse-sport":{color:"#bbeba2"},"landuse-cemetery":{color:"#c2e2bb"},"landuse-parking":{color:"#d6d4d4"},park:{color:"#b2e6a8"},"aeroway-area":{color:"#d6dbeb"},water:{color:"#94d8f9"},waterway:{color:"#94d8f9"},"aeroway-line":{color:"#dfdcd9"},"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:"#ffffff",roofColor:"#f2f1f0",aoStrength:.19,tintVariation:0,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:[2.41,9.94],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:[2.41,9.92],fogIntensity:.86,spaceColor:"#131105",atmosphereColor:"#5ca9d0",starIntensity:.39}};var Ki={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:[2.34,8.77],fogIntensity:.9,spaceColor:"#060308",atmosphereColor:"#b5358b",starIntensity:.82}};var Yi={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:[2.41,9.92],fogIntensity:.86,spaceColor:"#120c07",atmosphereColor:"#5c9fd0",starIntensity:.39}};var $i={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:[2.39,9.64],fogIntensity:.87,spaceColor:"#0e0b09",atmosphereColor:"#557dce",starIntensity:.45}};var qi={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:[2.39,9.64],fogIntensity:.87,spaceColor:"#0f0c08",atmosphereColor:"#559cce",starIntensity:.45}};var Zi={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:[2.34,8.79],fogIntensity:.9,spaceColor:"#030408",atmosphereColor:"#35a1b7",starIntensity:.81}};var Qi={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:[2.43,10.02],fogIntensity:.85,spaceColor:"#090c0f",atmosphereColor:"#5fb3d0",starIntensity:.37}};var Ji={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:[2.43,10.02],fogIntensity:.85,spaceColor:"#090c10",atmosphereColor:"#5fb3d0",starIntensity:.37}};var ea={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:[2.34,8.79],fogIntensity:.9,spaceColor:"#060606",atmosphereColor:"#b83535",starIntensity:.8}};var ta={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:[2.41,9.92],fogIntensity:.86,spaceColor:"#080b10",atmosphereColor:"#5c96d0",starIntensity:.39}};var oa={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:[2.41,9.87],fogIntensity:.86,spaceColor:"#090f09",atmosphereColor:"#5bcfa9",starIntensity:.4}};var ra={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:[2.39,9.64],fogIntensity:.87,spaceColor:"#0a0b0c",atmosphereColor:"#557dce",starIntensity:.45}};var na={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:[2.41,9.87],fogIntensity:.86,spaceColor:"#0d0c0b",atmosphereColor:"#5ba1cf",starIntensity:.4}};var ia={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:[2.43,10.04],fogIntensity:.85,spaceColor:"#0d0d0d",atmosphereColor:"#5fa1d1",starIntensity:.37}};var aa={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:[2.41,9.82],fogIntensity:.86,spaceColor:"#080d0f",atmosphereColor:"#5aa8cf",starIntensity:.41}};var la={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:[2.34,8.79],fogIntensity:.9,spaceColor:"#060606",atmosphereColor:"#3679b9",starIntensity:.79}};var sa={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:[2.39,9.68],fogIntensity:.87,spaceColor:"#0d0e09",atmosphereColor:"#569dce",starIntensity:.44}};var ca={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:[2.34,8.77],fogIntensity:.9,spaceColor:"#040308",atmosphereColor:"#354cb6",starIntensity:.82}};var fa={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:[2.34,8.8],fogIntensity:.9,spaceColor:"#070605",atmosphereColor:"#ba6336",starIntensity:.78}};var ua={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:[2.43,9.99],fogIntensity:.85,spaceColor:"#0f0c0a",atmosphereColor:"#5eaad0",starIntensity:.38}};var da={"3d":ji,cartoon:Xi,cyberpunk:Ki,dawn:Yi,dusk:$i,earth:qi,future:Zi,"glass-refined":Qi,glass:Ji,"harmony-black":ea,"harmony-blue":ta,"harmony-green":oa,lunar:ra,matte:na,minimal:ia,ocean:aa,premium:la,realistic:sa,space:ca,volcano:fa,white:ua};function Eo(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 $="base",ha="\u241F",Oe=(i,e)=>i+"\u241F"+String(e);var pt=class{constructor(e=Ir){this.splitValues={};this.spec=e,this.light={...Ar,...e.light??{}},this.sky={...Er,...e.sky??{}},this.layers=e.layers.map(t=>({...t,paint:{...t.paint}}));}get background(){return de(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=Ae(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 Ae(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=$){return this.layers.filter(t=>t.type!=="raster").filter(t=>(t.source??$)===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??$))]}bucketKeyFor(e){if(e.type==="raster"||!e.splitBy)return e.id;let t=this.splitValues[e.splitBy];return t===void 0?null:Oe(e.id,t)}sourceLayers(){return [...new Set(this.layers.flatMap(e=>e.type==="raster"?[]:[e["source-layer"]]))]}},Ir=Bi,Fc=Wi,zc=Vi,Pc=Di;function Hc(i,e){if(typeof i!="string")return i;let t=/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i.exec(i);if(!t)return i;let o=r=>Math.round(parseInt(t[r],16)*e).toString(16).padStart(2,"0");return `#${o(1)}${o(2)}${o(3)}`}function ma(i,e,t,o){let r=i.paint?.building;return r?{...i,name:e,paint:{...i.paint,building:{...r,windowColor:Hc(r.color,t),windowGlow:0,...o}}}:{...i,name:e}}var Be={day:{name:"\u0414\u043D\u0435\u0432\u043D\u0430\u044F"},night:Ni,mono:Gi,pale:Ui,...da};Be["3d-tone"]=ma(Be["3d"],"\u0421\u0432\u0435\u0442\u043B\u0430\u044F, \u043E\u043A\u043D\u0430 \u0432 \u0442\u043E\u043D",1,{windowVariation:0,windowRecess:.12,windowRecessShade:0,seamStrength:0});Be["night-tone"]=ma(Be.night,"\u0422\u0451\u043C\u043D\u0430\u044F, \u043E\u043A\u043D\u0430 \u0432 \u0442\u043E\u043D",1,{windowVariation:1,seamStrength:0});function Ao(i,e=Ir){if(typeof i!="string")return Eo(e,i);if(i==="day")return e;let t=Be[i];return t?Eo(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(Be).join(", ")}`),e)}var Ht=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 pa(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 Ot=`
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
- `,Mo=`
71
+ `,Io=`
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
- `,Sr=`
132
+ `,Lr=`
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
- `,ta=`
241
+ `,ba=`
242
242
  uniform vec3 u_globe_sun; // \u043D\u0430\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u0435 \u041D\u0410 \u0441\u043E\u043B\u043D\u0446\u0435 \u0432 \u0442\u0435\u0445 \u0436\u0435 \u043E\u0441\u044F\u0445, \u0447\u0442\u043E \u0438 \u043D\u043E\u0440\u043C\u0430\u043B\u044C \u0448\u0430\u0440\u0430
243
243
  uniform vec2 u_globe_light; // x: \u0441\u0438\u043B\u0430 \u0441\u043E\u043B\u043D\u0435\u0447\u043D\u043E\u0439 \u0441\u0442\u043E\u0440\u043E\u043D\u044B, y: \u0437\u0430\u0442\u0435\u043C\u043D\u0435\u043D\u0438\u0435 \u043A \u043A\u0440\u0430\u044E \u0434\u0438\u0441\u043A\u0430
244
244
 
@@ -266,8 +266,8 @@ float globeShade() {
266
266
  return sun * limb;
267
267
  }
268
268
 
269
- `,Mr=`
270
- ${ta}
269
+ `,Rr=`
270
+ ${ba}
271
271
  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
272
272
  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
273
273
  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
@@ -321,10 +321,10 @@ vec3 globeLocal(vec2 tilePos) {
321
321
 
322
322
  return mix(sphere, flat_pos, u_globe.y);
323
323
  }
324
- `,oa=`#version 300 es
324
+ `,ya=`#version 300 es
325
325
  precision highp float;
326
326
 
327
- ${ta}
327
+ ${ba}
328
328
 
329
329
  in vec2 a_lnglat; // \u0440\u0430\u0434\u0438\u0430\u043D\u044B: \u0434\u043E\u043B\u0433\u043E\u0442\u0430, \u0448\u0438\u0440\u043E\u0442\u0430
330
330
 
@@ -352,7 +352,7 @@ void main() {
352
352
  g_globe_normal = n;
353
353
  v_shade = globeShade();
354
354
  }
355
- `,ra=`#version 300 es
355
+ `,ga=`#version 300 es
356
356
  precision highp float;
357
357
 
358
358
  in float v_rim;
@@ -370,17 +370,17 @@ void main() {
370
370
  vec3 body = u_body_color * v_shade;
371
371
  fragColor = vec4(mix(body, u_atmo_color, clamp(rim, 0.0, 1.0)), 1.0);
372
372
  }
373
- `,na=`#version 300 es
373
+ `,va=`#version 300 es
374
374
  precision highp float;
375
375
  in vec2 a_pos; // 0..1, \u043E\u0431\u0449\u0438\u0439 \u043A\u0432\u0430\u0434\u0440\u0430\u0442
376
376
  uniform float u_center_depth; // NDC-\u0433\u043B\u0443\u0431\u0438\u043D\u0430 \u0446\u0435\u043D\u0442\u0440\u0430 \u0448\u0430\u0440\u0430
377
377
  void main() {
378
378
  gl_Position = vec4(a_pos * 2.0 - 1.0, u_center_depth, 1.0);
379
379
  }
380
- `,ia=`#version 300 es
380
+ `,wa=`#version 300 es
381
381
  precision highp float;
382
382
  void main() {}
383
- `,aa=`#version 300 es
383
+ `,xa=`#version 300 es
384
384
  precision highp float;
385
385
  in vec2 a_pos; // \u0435\u0434\u0438\u043D\u0438\u0446\u044B \u0442\u0430\u0439\u043B\u0430 \xD7 8, \u043A\u0430\u043A \u0443 \u0437\u0434\u0430\u043D\u0438\u0439 (BUILDING_POS_SCALE)
386
386
  in float a_height; // \u043C\u0435\u0442\u0440\u044B \xD7 32, \u043A\u0430\u043A \u0443 \u0437\u0434\u0430\u043D\u0438\u0439 (BUILDING_HEIGHT_SCALE)
@@ -389,10 +389,10 @@ uniform float u_height_scale;
389
389
  void main() {
390
390
  gl_Position = u_matrix * vec4(a_pos / 8.0, (a_height / 32.0) * u_height_scale, 1.0);
391
391
  }
392
- `,Tr=`#version 300 es
392
+ `,Fr=`#version 300 es
393
393
  precision highp float;
394
394
  void main() {}
395
- `,la=`
395
+ `,_a=`
396
396
  uniform vec3 u_cam_ray; // x: \u043D\u0430\u043A\u043B\u043E\u043D \u043E\u0441\u0438 \u043A\u0430\u043C\u0435\u0440\u044B \u043D\u0430\u0434 \u0433\u043E\u0440\u0438\u0437\u043E\u043D\u0442\u043E\u043C (\u0440\u0430\u0434), y: \u0444\u043E\u043A\u0443\u0441 (\u043F\u0438\u043A\u0441\u0435\u043B\u0438 \u0431\u0443\u0444\u0435\u0440\u0430), z: Y \u0446\u0435\u043D\u0442\u0440\u0430 \u043A\u0430\u0434\u0440\u0430 \u0441\u043D\u0438\u0437\u0443
397
397
  uniform float u_haze_exp; // \u043F\u043E\u043A\u0430\u0437\u0430\u0442\u0435\u043B\u044C \u043F\u043E\u043B\u043E\u0441\u044B \u043C\u0433\u043B\u044B: \u0431\u043E\u043B\u044C\u0448\u0435 \u2014 \u0443\u0436\u0435 \u043F\u043E\u043B\u043E\u0441\u0430
398
398
 
@@ -411,8 +411,14 @@ float airMass(float sinE) {
411
411
  float hazeMix(float sinE) {
412
412
  return pow(clamp(1.0 - 1.0 / airMass(sinE), 0.0, 1.0), u_haze_exp);
413
413
  }
414
+ `,zr=`
415
+ uniform vec4 u_tile_tint;
416
+ vec4 tileTint(vec4 c) {
417
+ if (u_tile_tint.a <= 0.0) return c;
418
+ return vec4(mix(c.rgb, u_tile_tint.rgb * c.a, u_tile_tint.a), c.a);
419
+ }
414
420
  `,Ye=`
415
- ${la}
421
+ ${_a}
416
422
  uniform vec3 u_fog_color;
417
423
  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
418
424
  /** \u0412\u0435\u0440\u0442\u0438\u043A\u0430\u043B\u044C\u043D\u044B\u0439 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D \u0434\u044B\u043C\u043A\u0438 \u0432 \u043C\u0435\u0442\u0440\u0430\u0445: \u0433\u0434\u0435 \u043E\u043D\u0430 \u043D\u0430\u0447\u0438\u043D\u0430\u0435\u0442 \u043E\u0442\u043F\u0443\u0441\u043A\u0430\u0442\u044C \u0433\u0435\u043E\u043C\u0435\u0442\u0440\u0438\u044E \u0438 \u0433\u0434\u0435 \u043E\u0442\u043F\u0443\u0441\u043A\u0430\u0435\u0442 \u0441\u043E\u0432\u0441\u0435\u043C. */
@@ -465,7 +471,7 @@ vec3 applyFog(vec3 color) {
465
471
  vec3 applyFogAt(vec3 color, float heightMeters) {
466
472
  return mix(color, u_fog_color, fogAmountAt(heightMeters));
467
473
  }
468
- `,sa=`#version 300 es
474
+ `,Ca=`#version 300 es
469
475
  precision highp float;
470
476
 
471
477
  in vec3 a_pos;
@@ -538,7 +544,7 @@ void main() {
538
544
  // \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.
539
545
  v_view = u_normal_matrix * (u_camera_model - a_pos);
540
546
  }
541
- `,ca=`#version 300 es
547
+ `,Sa=`#version 300 es
542
548
  precision highp float;
543
549
 
544
550
  in vec3 a_pos;
@@ -602,11 +608,11 @@ void main() {
602
608
  v_nmodel = a_normal;
603
609
  v_view = n * (u_camera_model - a_pos);
604
610
  }
605
- `,kr=`#version 300 es
611
+ `,Pr=`#version 300 es
606
612
  precision highp float;
607
613
 
608
- ${Ft}
609
- ${Mo}
614
+ ${Ot}
615
+ ${Io}
610
616
  ${Ye}
611
617
 
612
618
  in vec3 v_normal;
@@ -886,14 +892,14 @@ void main() {
886
892
  float alpha = albedo.a * u_opacity;
887
893
  fragColor = vec4(applyFog(color) * alpha, alpha);
888
894
  }
889
- `,fa=`#version 300 es
895
+ `,Ma=`#version 300 es
890
896
  precision highp float;
891
897
  in vec3 a_pos;
892
898
  uniform mat4 u_matrix;
893
899
  void main() {
894
900
  gl_Position = u_matrix * vec4(a_pos, 1.0);
895
901
  }
896
- `,ua=`#version 300 es
902
+ `,Ta=`#version 300 es
897
903
  precision highp float;
898
904
  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
899
905
 
@@ -912,7 +918,7 @@ void main() {
912
918
  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);
913
919
  gl_Position = vec4(a_pos * 2.0 - 1.0, 0.999, 1.0);
914
920
  }
915
- `,da=`#version 300 es
921
+ `,ka=`#version 300 es
916
922
  precision highp float;
917
923
 
918
924
  in vec2 v_uv;
@@ -933,7 +939,7 @@ uniform vec3 u_cam_up;
933
939
  uniform vec3 u_cam_fwd;
934
940
  uniform vec2 u_cam_center; // \u0446\u0435\u043D\u0442\u0440 \u043A\u0430\u0434\u0440\u0430 \u0432 \u043F\u0438\u043A\u0441\u0435\u043B\u044F\u0445 \u0431\u0443\u0444\u0435\u0440\u0430
935
941
 
936
- ${la}
942
+ ${_a}
937
943
 
938
944
  // \u041A\u043E\u0441\u043C\u043E\u0441: \u0432\u043A\u043B\u044E\u0447\u0430\u0435\u0442\u0441\u044F \u0442\u043E\u043B\u044C\u043A\u043E \u043D\u0430 \u0433\u043B\u043E\u0431\u0443\u0441\u0435.
939
945
  uniform vec3 u_space_color;
@@ -1057,7 +1063,7 @@ void main() {
1057
1063
 
1058
1064
  fragColor = vec4(sky * alpha, alpha);
1059
1065
  }
1060
- `,ha=`#version 300 es
1066
+ `,Ea=`#version 300 es
1061
1067
  precision highp float;
1062
1068
 
1063
1069
  in vec2 a_pos; // \u0443\u0433\u043E\u043B \u043A\u0432\u0430\u0434\u0440\u0430\u0442\u0430 \u0442\u0430\u0439\u043B\u0430, 0..1
@@ -1075,7 +1081,7 @@ void main() {
1075
1081
  v_uv = u_uv_transform.xy + a_pos * u_uv_transform.z;
1076
1082
  gl_Position = u_matrix * vec4(a_pos, 0.0, 1.0);
1077
1083
  }
1078
- `,ma=`#version 300 es
1084
+ `,Aa=`#version 300 es
1079
1085
  precision highp float;
1080
1086
 
1081
1087
  ${Ye}
@@ -1093,7 +1099,7 @@ void main() {
1093
1099
  // \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.
1094
1100
  fragColor = applyFogPremultiplied(vec4(color.rgb * color.a, color.a)) * u_opacity;
1095
1101
  }
1096
- `,pa=`#version 300 es
1102
+ `,Ia=`#version 300 es
1097
1103
  precision highp float;
1098
1104
  in vec2 a_pos; // \u0443\u0433\u043E\u043B \u043A\u0432\u0430\u0434\u0440\u0430\u0442\u0430 \u0442\u0430\u0439\u043B\u0430, 0..1
1099
1105
  uniform mat4 u_matrix;
@@ -1104,10 +1110,10 @@ void main() {
1104
1110
  gl_Position = u_matrix * local;
1105
1111
  v_shadow = u_shadow_matrix * local;
1106
1112
  }
1107
- `,ba=`#version 300 es
1113
+ `,La=`#version 300 es
1108
1114
  precision highp float;
1109
1115
 
1110
- ${Mo}
1116
+ ${Io}
1111
1117
  ${Ye}
1112
1118
 
1113
1119
  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
@@ -1120,10 +1126,10 @@ void main() {
1120
1126
  float occlusion = shadowOcclusion(u_ground_ndotl) * (1.0 - fogAmount());
1121
1127
  fragColor = vec4(mix(vec3(1.0), u_shadow_ground, occlusion), 1.0);
1122
1128
  }
1123
- `,ya=`#version 300 es
1129
+ `,Ra=`#version 300 es
1124
1130
  precision highp float;
1125
1131
 
1126
- ${Mr}
1132
+ ${Rr}
1127
1133
 
1128
1134
  in vec2 a_pos;
1129
1135
  uniform mat4 u_matrix;
@@ -1151,12 +1157,14 @@ void main() {
1151
1157
  // \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.
1152
1158
  v_world = u_world_origin + a_pos * u_meters_per_unit;
1153
1159
  }
1154
- `,ga=`#version 300 es
1160
+ `,Fa=`#version 300 es
1155
1161
  precision highp float;
1156
1162
 
1163
+ ${zr}
1164
+
1157
1165
  ${Ye}
1158
- ${Ft}
1159
- ${Sr}
1166
+ ${Ot}
1167
+ ${Lr}
1160
1168
 
1161
1169
  in vec2 v_world;
1162
1170
  in float v_globe_shade;
@@ -1174,12 +1182,12 @@ void main() {
1174
1182
  if (u_material != 0) c.rgb = applyMaterial(c.rgb, v_world);
1175
1183
  // \u0421\u0432\u0435\u0442 \u0448\u0430\u0440\u0430. \u041D\u0430 \u043F\u043B\u043E\u0441\u043A\u043E\u0439 \u043A\u0430\u0440\u0442\u0435 \u043C\u043D\u043E\u0436\u0438\u0442\u0435\u043B\u044C \u0440\u0430\u0432\u0435\u043D \u0435\u0434\u0438\u043D\u0438\u0446\u0435 \u0438 \u043D\u0435 \u0441\u0442\u043E\u0438\u0442 \u043D\u0438\u0447\u0435\u0433\u043E.
1176
1184
  c.rgb *= v_globe_shade;
1177
- fragColor = applyFogPremultiplied(c);
1185
+ fragColor = tileTint(applyFogPremultiplied(c));
1178
1186
  }
1179
- `,va=`#version 300 es
1187
+ `,za=`#version 300 es
1180
1188
  precision highp float;
1181
1189
 
1182
- ${Mr}
1190
+ ${Rr}
1183
1191
 
1184
1192
  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)
1185
1193
  in vec2 a_p1; // \u043A\u043E\u043D\u0435\u0446 \u043E\u0442\u0440\u0435\u0437\u043A\u0430
@@ -1297,12 +1305,12 @@ void main() {
1297
1305
  v_dist0 = a_dist * u_tile_to_px;
1298
1306
  v_seg_len = len * u_tile_to_px;
1299
1307
  }
1300
- `,wa=`#version 300 es
1308
+ `,Pa=`#version 300 es
1301
1309
  precision highp float;
1302
1310
 
1303
1311
  ${Ye}
1304
- ${Ft}
1305
- ${Sr}
1312
+ ${Ot}
1313
+ ${Lr}
1306
1314
 
1307
1315
  in vec2 v_pos;
1308
1316
  in vec2 v_p0;
@@ -1565,7 +1573,7 @@ void main() {
1565
1573
  if (alpha <= 0.003) discard;
1566
1574
  fragColor = applyFogPremultiplied(color) * alpha;
1567
1575
  }
1568
- `,xa=`#version 300 es
1576
+ `,Ha=`#version 300 es
1569
1577
  precision highp float;
1570
1578
 
1571
1579
  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
@@ -1599,7 +1607,7 @@ void main() {
1599
1607
  v_half = u_half_width;
1600
1608
  v_dist = a_dist * u_units_to_px;
1601
1609
  }
1602
- `,_a=`#version 300 es
1610
+ `,Oa=`#version 300 es
1603
1611
  precision highp float;
1604
1612
 
1605
1613
  ${Ye}
@@ -1648,7 +1656,7 @@ void main() {
1648
1656
  if (alpha <= 0.003) discard;
1649
1657
  fragColor = applyFogPremultiplied(color) * alpha;
1650
1658
  }
1651
- `,Ca=`#version 300 es
1659
+ `,Ba=`#version 300 es
1652
1660
  precision highp float;
1653
1661
 
1654
1662
  in vec2 a_pos;
@@ -1712,7 +1720,7 @@ void main() {
1712
1720
  v_wall = a_wall / 32.0;
1713
1721
  v_view = u_camera_local - vec3(pos * u_meters_per_unit, h);
1714
1722
  }
1715
- `,gc=`
1723
+ `,Oc=`
1716
1724
  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
1717
1725
  uniform vec3 u_window_color;
1718
1726
  uniform vec3 u_window_frame;
@@ -1977,13 +1985,15 @@ vec3 roofHue(vec3 base, float seed) {
1977
1985
  float hueLum = max(dot(hue, vec3(0.2126, 0.7152, 0.0722)), 1e-3);
1978
1986
  return hue * (baseLum / hueLum);
1979
1987
  }
1980
- `,Sa=`#version 300 es
1988
+ `,Wa=`#version 300 es
1981
1989
  precision highp float;
1982
1990
 
1983
- ${Ft}
1984
- ${Mo}
1991
+ ${zr}
1992
+
1993
+ ${Ot}
1994
+ ${Io}
1985
1995
  ${Ye}
1986
- ${gc}
1996
+ ${Oc}
1987
1997
 
1988
1998
  in vec3 v_normal;
1989
1999
  in float v_ao;
@@ -2129,12 +2139,12 @@ void main() {
2129
2139
 
2130
2140
  float alpha = u_opacity * u_wall_color.a;
2131
2141
  // \u0412\u044B\u0441\u043E\u0442\u0443 \u0437\u043D\u0430\u0435\u0442 \u0442\u043E\u043B\u044C\u043A\u043E \u0437\u0434\u0430\u043D\u0438\u0435 \u2014 \u043E\u043D\u043E \u0438 \u043F\u0440\u043E\u0441\u0438\u0442 \u0434\u044B\u043C\u043A\u0443 \u0441 \u0435\u0451 \u0443\u0447\u0451\u0442\u043E\u043C: \u043D\u0438\u0437 \u0432 \u043C\u0433\u043B\u0435, \u0432\u0435\u0440\u0445 \u0447\u0438\u0449\u0435.
2132
- fragColor = vec4(applyFogAt(color, v_up) * alpha, alpha);
2142
+ fragColor = tileTint(vec4(applyFogAt(color, v_up) * alpha, alpha));
2133
2143
  }
2134
- `,Ma=`#version 300 es
2144
+ `,Va=`#version 300 es
2135
2145
  precision highp float;
2136
2146
 
2137
- ${Mr}
2147
+ ${Rr}
2138
2148
 
2139
2149
  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)
2140
2150
  in float a_level; // \u043C\u0435\u0442\u0440\u044B \xD7 SURFACE_LEVEL_SCALE (64)
@@ -2186,13 +2196,15 @@ void main() {
2186
2196
  v_world = u_world_origin + pos * u_meters_per_unit;
2187
2197
  v_shadow = u_shadow_matrix * local;
2188
2198
  }
2189
- `,Ta=`#version 300 es
2199
+ `,Da=`#version 300 es
2190
2200
  precision highp float;
2191
2201
 
2192
- ${Ft}
2193
- ${Mo}
2202
+ ${zr}
2203
+
2204
+ ${Ot}
2205
+ ${Io}
2194
2206
  ${Ye}
2195
- ${Sr}
2207
+ ${Lr}
2196
2208
 
2197
2209
  in vec3 v_normal;
2198
2210
  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
@@ -2239,9 +2251,9 @@ void main() {
2239
2251
  // \u043B\u0438\u043D\u0438\u0438 \u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044F \u043B\u0435\u043D\u0442\u043E\u0439, \u0434\u0430\u0436\u0435 \u043A\u043E\u0433\u0434\u0430 \u0446\u0432\u0435\u0442 \u0432\u0435\u0440\u043D\u044B\u0439.
2240
2252
  if (v_kind > 0.5 && u_side_light > 0.0) color = mix(color, albedo, u_side_light);
2241
2253
 
2242
- fragColor = vec4(applyFog(color) * alpha, alpha);
2254
+ fragColor = tileTint(vec4(applyFog(color) * alpha, alpha));
2243
2255
  }
2244
- `,ka=`#version 300 es
2256
+ `,Na=`#version 300 es
2245
2257
  precision highp float;
2246
2258
 
2247
2259
  in vec2 a_pos; // \u044D\u043A\u0440\u0430\u043D\u043D\u044B\u0435 \u043F\u0438\u043A\u0441\u0435\u043B\u0438 (CSS)
@@ -2271,7 +2283,7 @@ void main() {
2271
2283
  v_scale = a_scale;
2272
2284
  v_fade = a_fade;
2273
2285
  }
2274
- `,Ea=`#version 300 es
2286
+ `,Ga=`#version 300 es
2275
2287
  precision highp float;
2276
2288
 
2277
2289
  in vec2 v_tex;
@@ -2321,6 +2333,6 @@ void main() {
2321
2333
  if (color.a <= 0.001) discard;
2322
2334
  fragColor = color;
2323
2335
  }
2324
- `;var To=i=>i.kind==="symbol",Aa=i=>i.kind==="placement";function De(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(vc(e,t,a,l,s,c,f,u)||o>0&&(Er(e,t,a,l,s,c)<=o||Er(e,t,s,c,f,u)<=o||Er(e,t,f,u,a,l)<=o))return true}return false}function vc(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,d=s>0||c>0||f>0;return !(u&&d)}function Er(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 Ar(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]*je;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 Lr(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 xc={stride:8,attribs:[{name:"a_pos",size:2,type:5126,offset:0}]},_c=40,Cc=10.5,La=2.5,Sc=16,Mc=4,Tc=7,zt=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,d=oe(u.lng),h=re(u.lat),m=t.worldSize>0?t.pixelsPerMeter/t.worldSize:0;if(!(m>0))return;let y=[];for(let x of f){let C=o.get(x.source??Y);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=m*1.5,T=x.layout?.arrowUnits==="meters"?m:1/t.worldSize,L=V(x.layout?.arrowLength,c,_c)*T,E=V(x.layout?.arrowWidth,c,Cc)*T,z=V(x.layout?.arrowOutline,c,La)*T,A=V(x.layout?.arrowGap,c,Sc)*T,I=V(x.layout?.arrowDotRadius,c,Mc)*T,k=V(x.layout?.arrowDotGap,c,Tc)*T,R=Rr(L,E,I,A-k),P=z>0?Rr(L,E,I,A-k,z).outline:null,F={layer:x,verts:[],shape:R};for(let W of C.visibleTiles){let O=C.getTile(W)?.data?.buckets?.[S];if(!O||!To(O))continue;let H=new Int16Array(O.anchors),D=O.rotations?new Int16Array(O.rotations):null,K=W.bounds(),$=(K.maxX-K.minX)/O.extent,Q=K.minX,de=K.minY;for(let J=0;J<H.length/2;J++){let X=Q+H[J*2]*$,te=de+H[J*2+1]*$;if(M&&!De(this.highlightFootprint,X,te,w))continue;let ie=(D?D[J]:0)*Math.PI/180,q=Math.sin(ie),U=-Math.cos(ie),j=X-d-q*A,le=te-h-U*A;P&&Fr(F,P,j,le,q,U),Fr(F,R.outline,j,le,q,U),this.count++;}}F.verts.length&&y.push(F);}if(!y.length)return;let p=y[0].shape,b=p.outline.length/2,g=[],v=[];for(let x of y){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,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(d,h,0)),n.setMat4("u_matrix",t.objectMatrix(d,h,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=V(C.opacity,c,1),M=Ee(C.color,c,[.18,.45,.76,1]),w=Ee(C.haloColor,c,[1,1,1,1]),_=V(x.layer.layout?.arrowOutline,c,La)>0;kc(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),xc,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 he(e,a),this.vao=new ue(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 kc(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)Ia(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)Ia(i,t.first+c,l);}function Ia(i,e,t){i.gl.drawElements(i.gl.TRIANGLES,t,i.gl.UNSIGNED_INT,e*t*4);}var Ra=4,Ir=12;function Rr(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=[],d=(b,g)=>u.push(b,g);d(0,0),d(-n,a),d(-n+l,c),d(f,s);for(let b=1;b<Ra;b++){let g=b/Ra*Math.PI;d(f-Math.sin(g)*s,Math.cos(g)*s);}d(f,-s),d(-n+l,-c),d(-n,-a);let h=r>0?Ec(u,r):u,m=ni__default.default(u,void 0,2);if(t<=0)return {outline:h,indices:m};let y=h.length/2,p=t+r;for(let b=0;b<Ir;b++){let g=b/Ir*Math.PI*2;h.push(o+Math.cos(g)*p,Math.sin(g)*p);}for(let b=1;b<Ir-1;b++)m.push(y,y+b,y+b+1);return {outline:h,indices:m}}function Ec(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],d=i[(a+1)%t*2+1],h=Math.hypot(c-l,f-s)||1,m=Math.hypot(u-c,d-f)||1,y=r*(f-s)/h,p=-r*(c-l)/h,b=r*(d-f)/m,g=-r*(u-c)/m,v=y+b,x=p+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*y+x*p,.35),3);n.push(c+v*e*S,f+x*e*S);}return n}function Fr(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 Ac(i,e,t,o,r,n=0,a=0){let l=t*Math.PI/180,s={verts:[]};return Fr(s,Rr(o,r,n,a).outline,i,e,Math.sin(l),-Math.cos(l)),s.verts}var Lc=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 ko=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 d=V(f.paint?.opacity,l,1);if(!(d<=.001)){r.setFloat("u_opacity",d),o.bind();for(let h of u.visibleTiles){let m=this.patchFor(e,u,h);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(h,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<=Lc&&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 Ic="indoor-",Pt=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 d of t.layers){if(!d.id.startsWith(Ic)||d.type!=="fill"||!t.layerVisibleAt(d,o))continue;let h=t.bucketKeyFor(d);h&&(r.push(h),n??(n=e.get(d.source??Y)));}if(!r.length||!n){this.parts&&this.destroy();return}let a=r.join(",")+"|"+n.visibleTiles.map(d=>d.dataKey+(n.getTile(d)?.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 d of n.visibleTiles){let h=n.getTile(d)?.data?.buckets;if(h)for(let m of r){let y=h[m];if(!y||y.kind!=="fill")continue;let p=Ar(y,d);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]>u&&(u=p[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 d=n[u];if(this.hidden.has(d))continue;let h=f.get(d);h||f.set(d,h=[1/0,1/0,-1/0,-1/0]);for(let m=0;m<3;m++){let y=r[u*3+m]*Me,p=a.getInt16(y,true),b=a.getInt16(y+2,true);p<h[0]&&(h[0]=p),b<h[1]&&(h[1]=b),p>h[2]&&(h[2]=p),b>h[3]&&(h[3]=b);}}for(let[u,d]of f){let h=l.minX+(d[0]+d[2])/2*s,m=l.minY+(d[1]+d[3])/2*s;c&&(h<c[0]||h>c[2]||m<c[1]||m>c[3])||De(o,h,m,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),d=[];for(let h=0;h*3<f.length;h++)this.hidden.has(u[h])||d.push(f[h*3],f[h*3+1],f[h*3+2]);if(d.length<f.length){let h=new he(e,new Uint32Array(d));c={vao:new ue(e,[{buffer:n,locations:a}],h),ibo:h,count:d.length};}}return this.cache.set(r.dataKey,c),c}};var za=35,Rc=70,Fc=.35,zc=.5,Pc=1.1;function mt(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-za)/(Rc-za),0,1),n=t.fogRange[0]*(1-Fc*r)*o,a=t.fogRange[1]*(1-zc*r)*o,l=Math.min(1,t.fogIntensity+(1-t.fogIntensity)*Math.min(1,r*2)),s=l>=.995?a*Pc:1/0;return {near:n,far:a,intensity:l,cutoff:s}}function zr(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),d=u&&Pa(u,t);if(!d||!ze(l,i.tileMatrix64(f,d.extent))||(fe(s,l,[r,n,-1,1]),fe(c,l,[r,n,1,1]),s[3]===0||c[3]===0))continue;let h=s[0]/s[3],m=s[1]/s[3],y=s[2]/s[3],p=c[0]/c[3]-h,b=c[1]/c[3]-m,g=c[2]/c[3]-y,v=Oc(d,h,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 Pr(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 d of t){let h=u.data?.buckets?.[d];if(!h||h.kind!=="fill"||!h.featureIds||!ze(l,i.tileMatrix64(f,h.extent))||(fe(s,l,[r,n,-1,1]),fe(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,x=y+(c[1]/c[3]-y)*g,C=Hc(h,v,x);C!==null&&(!a||g<a.distance)&&(a={featureId:C,tile:f,layerId:d,distance:g});}}return a}function Hc(i,e,t){let o=new DataView(i.vertices),r=new Uint32Array(i.indices),n=new Float64Array(i.featureIds),a=s=>o.getInt16(s*je,true),l=s=>o.getInt16(s*je+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],d=a(c),h=l(c),m=a(f),y=l(f),p=a(u),b=l(u),g=(e-m)*(h-y)-(d-m)*(t-y),v=(e-p)*(y-b)-(m-p)*(t-b),x=(e-d)*(b-h)-(p-d)*(t-h),C=g<0||v<0||x<0,S=g>0||v>0||x>0;if(!(C&&S))return n[s]}return null}function Pa(i,e){let t=i.data?.buckets?.[e];return !t||t.kind!=="fill-extrusion"||!t.featureIds?null:t}function Oc(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)/st,u=y=>l.getInt16(y*Me+2,true)/st,d=y=>l.getUint16(y*Me+4,true)/ct,h=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),x=u(p),C=d(p),S=f(b)-v,M=u(b)-x,w=d(b)-C,_=f(g)-v,T=u(g)-x,L=d(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,R=e-v,P=t-x,F=o-C,W=(R*E+P*z+F*A)*k;if(W<0||W>1)continue;let G=P*w-F*M,O=F*S-R*w,H=R*M-P*S,D=(r*G+n*O+a*H)*k;if(D<0||W+D>1)continue;let K=(_*G+T*O+L*H)*k;K<0||K>1||K>=h||(h=K,m=c[y/3]??0);}return m>=0?{featureId:m,t:h}:null}function Eo(i,e,t){let o=Pa(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 pt=24,Hr=8,Bc=2,Vc=12,Ao=8,Lo=8;function Ht(i){let e=0;for(let h of i)e+=h.length/2;if(e<2)return null;let t=(Ao+2)*2,o=e*t+i.length*(Lo+2)*2+8,r=e*(Ao+2)*6+i.length*Lo*6+24,n=new ArrayBuffer(o*pt),a=new DataView(n),l=new Uint32Array(r),s=0,c=0,f=(h,m,y,p,b,g)=>{let v=s*pt;return a.setFloat32(v,h,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++},u=(h,m,y,p)=>{l[c++]=h,l[c++]=m,l[c++]=p,l[c++]=h,l[c++]=p,l[c++]=y;},d=(h,m,y,p,b,g,v)=>{let x=f(h,m,0,0,0,v),C=f(h,m,y,p,1,v);for(let S=1;S<=Lo;S++){let M=Math.PI*S/Lo,w=y*Math.cos(M)+b*Math.sin(M),_=p*Math.cos(M)+g*Math.sin(M),T=f(h,m,w,_,1,v);l[c++]=x,l[c++]=C,l[c++]=T,C=T;}};for(let h of i){let m=Dc(h),y=m.length/2;if(y<2)continue;let p=new Float64Array(y-1),b=new Float64Array(y-1);for(let S=0;S<y-1;S++){let M=m[S*2+2]-m[S*2],w=m[S*2+3]-m[S*2+1],_=Math.hypot(M,w)||1;p[S]=M/_,b[S]=w/_;}let g=0,v=-1,x=-1;for(let S=0;S<y;S++){let M=m[S*2],w=m[S*2+1];S>0&&(g+=Math.hypot(M-m[S*2-2],w-m[S*2-1]));let _=S>0?S-1:0,T=S<y-1?S:y-2,L=-b[_],E=p[_],z=-b[T],A=p[T],I=L+z,k=E+A,R=Math.hypot(I,k);R>1e-9?(I/=R,k/=R):(I=L,k=E);let P=I*z+k*A,F=P>1e-6?1/P:1/0,W=Math.acos(Math.min(1,Math.max(-1,p[_]*p[T]+b[_]*b[T])));if(!(W>Vc*Math.PI/180)&&F<=Bc){let O=f(M,w,I*F,k*F,1,g),H=f(M,w,-I*F,-k*F,-1,g);v>=0&&u(v,x,O,H),v=O,x=H;}else {let O=Math.max(1,Math.min(Ao,Math.ceil(W/(Math.PI/Ao)))),D=p[_]*b[T]-b[_]*p[T]>=0?1:-1,K=f(M,w,L,E,1,g),$=f(M,w,-L,-E,-1,g);v>=0&&u(v,x,K,$);for(let Q=1;Q<=O;Q++){let de=D*W*(Q/O),J=Math.cos(de),X=Math.sin(de),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(K,$,q,U),K=q,$=U;}v=K,x=$;}}let C=y-2;d(m[0],m[1],-b[0],p[0],-p[0],-b[0],0),d(m[(y-1)*2],m[(y-1)*2+1],-b[C],p[C],p[C],b[C],g);}return c?{vertices:n.slice(0,s*pt),indices:l.slice(0,c),vertexCount:s}:null}function Or(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=ni__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 Dc(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 Ot=5126,Gc={stride:Hr,attribs:[{name:"a_pos",size:2,type:Ot,offset:0}]},Br={stride:pt,attribs:[{name:"a_pos",size:2,type:Ot,offset:0},{name:"a_extrude",size:2,type:Ot,offset:8},{name:"a_side",size:1,type:Ot,offset:16},{name:"a_dist",size:1,type:Ot,offset:20}]},Wr=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();}},Nc=(i,e)=>[i[0],i[1],i[2],i[3]*e],Wt=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(m=>m.ghostOpacity>0))return;this.objects.length>1&&this.objects.sort((m,y)=>m.zIndex-y.zIndex);let f=e.gl.drawingBufferWidth,u=t.width>0?f/t.width:1,d=t.worldSize*u,h=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:x,ibo:C}of p.parts){if(c&&(v.kind!=="line"||v.arrow))continue;let S=c?Nc(v.color,y):v.color;if(v.kind==="fill")h!==o&&(o.use(),l?.(o),h=o),o.setVec4v("u_color",_e(S)),b&&o.setMat4("u_shadow_matrix",b),o.setMat4("u_matrix",g);else {h!==n&&(n.use(),l?.(n),h=n);let M=v.width/2*u,w=d>1e-9?1/d: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",d),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(oe(a)*r,re(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"?Gc:Br,f=s.kind==="fill"?o:r,u=new ye(e,new Uint8Array(s.mesh.vertices),c),d=new he(e,s.mesh.indices),h=new ue(e,[{buffer:u,locations:f}],d);a.push({part:s,vao:h,vbo:u,ibo:d});}let l=new Wr(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 Io=32,Uc=1179937895,jc=1313821514,Xc=5130562,Yc={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},Kc={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT4:16};async function Vr(i){let{json:e,bin:t}=Ha(i),o=await qc(e,t);return Wa(e,t,o)}function $c(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 Wa(e,t,null)}function Ha(i){let e=new DataView(i);if(e.getUint32(0,true)!==Uc)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===jc?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 qc(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 Oa(i){let e=N();if(i.matrix){for(let w=0;w<16;w++)e[w]=i.matrix[w];return e}We(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],d=n+n,h=a+a,m=l+l,y=n*d,p=n*h,b=n*m,g=a*h,v=a*m,x=l*m,C=s*d,S=s*h,M=s*m;return e[0]=(1-(g+x))*c,e[1]=(p+M)*c,e[2]=(b-S)*c,e[4]=(p-M)*f,e[5]=(1-(y+x))*f,e[6]=(v+C)*f,e[8]=(b+S)*u,e[9]=(v-C)*u,e[10]=(1-(y+g))*u,e[12]=t,e[13]=o,e[14]=r,e}var Zc={5120:127,5121:255,5122:32767,5123:65535};function Qc(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 Wa(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=Kc[_.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=Yc[_.componentType]??4,I=E.extensions?.EXT_meshopt_compression,k=I?I.byteStride:E.byteStride,R=k&&k>0?k:A*T,P=_.byteOffset??0,F=new DataView(z.buffer,z.byteOffset,z.byteLength),W=_.normalized?Zc[_.componentType]??1:1;for(let G=0;G<_.count;G++)for(let O=0;O<T;O++){let H=P+G*R+O*A,D;switch(_.componentType){case 5120:D=F.getInt8(H);break;case 5121:D=F.getUint8(H);break;case 5122:D=F.getInt16(H,true);break;case 5123:D=F.getUint16(H,true);break;case 5125:D=F.getUint32(H,true);break;default:D=F.getFloat32(H,true);}L[G*T+O]=W===1?D:Math.max(D/W,-1);}return {data:L,components:T}},d=(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,R=Qc(_),F=(w.material!==void 0?i.materials?.[w.material]:void 0)?.pbrMetallicRoughness?.baseColorTexture?.extensions?.KHR_texture_transform,W=F?{ox:F.offset?.[0]??0,oy:F.offset?.[1]??0,sx:F.scale?.[0]??1,sy:F.scale?.[1]??1,rot:F.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 ne=E.data[X*3],ge=E.data[X*3+1],ke=E.data[X*3+2],ve=R[0]*ne+R[3]*ge+R[6]*ke,no=R[1]*ne+R[4]*ge+R[7]*ke,io=R[2]*ne+R[5]*ge+R[8]*ke,ao=Math.hypot(ve,no,io);ao>1e-12?(ve/=ao,no/=ao,io/=ao):(ve=0,no=1,io=0),n.push(ve,no,io);}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 ne=Math.cos(W.rot),ge=Math.sin(W.rot),ke=ne*ae+ge*se,ve=-ge*ae+ne*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,D=H?.metallicFactor!==void 0||H?.roughnessFactor!==void 0,K=H?.baseColorFactor??[1,1,1,1],$=H?.baseColorTexture?.index,Q=$!==void 0?i.textures?.[$]?.source:void 0,de=O?.emissiveFactor??[0,0,0],J=O?.extensions?.KHR_materials_emissive_strength?.emissiveStrength??1;s.push({indexOffset:G,indexCount:l.length-G,baseColor:[K[0],K[1],K[2],K[3]??1],metallic:D?H?.metallicFactor??1:0,roughness:D?H?.roughnessFactor??1:1,emissive:[de[0]*J,de[1]*J,de[2]*J],texture:Q??-1,doubleSided:O?.doubleSided===true,blend:O?.alphaMode==="BLEND",alphaCutoff:O?.alphaMode==="MASK"?O.alphaCutoff??.5:.02,node:T});},h=i.skins?.length?null:Jc(i,u),m=h?h.nodes:null,y=(w,_,T,L)=>{let E=i.nodes?.[w];if(!E)return;let z=Oa(E),A=N();xe(A,_,z);let I=N(),k=L,R=m?.get(w);if(R?(R.parentNode=L,R.parent=T.slice(),We(I),k=w):xe(I,T,z),E.mesh!==void 0)for(let F of i.meshes?.[E.mesh]?.primitives??[])d(F,I,k);let P=E.extensions?.KHR_lights_punctual?.light;if(P!==void 0){let F=i.extensions?.KHR_lights_punctual?.lights?.[P],W=F?.type;if(F&&(W==="point"||W==="spot"||W==="directional")){let G=-A[8],O=-A[9],H=-A[10],D=Math.hypot(G,O,H)||1,K=F.spot?.innerConeAngle??0,$=F.spot?.outerConeAngle??Math.PI/4;p.push({type:W,color:[F.color?.[0]??1,F.color?.[1]??1,F.color?.[2]??1],intensity:F.intensity??1,range:F.range??0,position:[A[12],A[13],A[14]],direction:[G/D,O/D,H/D],cosInner:Math.cos(K),cosOuter:Math.cos($)});}}for(let F of E.children??[])y(F,A,I,k);},p=[],b=N();We(b);let g=N();We(g);let v=i.scenes?.[i.scene??0]?.nodes??i.nodes?.map((w,_)=>_)??[];for(let w of v)y(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*Io),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:h,lights:p}}function Jc(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,d=s.interpolation==="CUBICSPLINE",h=c.data.length,m=new Float32Array(h*u);for(let p=0;p<h;p++){let b=d?(p*3+1)*u:p*u;for(let g=0;g<u;g++)m[p*u+g]=f.data[b+g];}let y=o.get(a)??{parentNode:-1,parent:We(N()),base:ef(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[h-1]);}return o.size?{duration:r||1,nodes:o}:null}function ef(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 Dr(i,e,t,o){let r=i.nodes.get(e);if(!r)return We(o);let n=N();tf(r,t,n);let a=N();if(xe(a,r.parent,n),r.parentNode<0)return Ba(o,a);let l=N();return Dr(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 tf(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],d=a.step||u<=0?0:Math.min(Math.max((e-a.times[c])/u,0),1),h=c*s,m=f*s;if(a.path==="rotation"){let y=0;for(let g=0;g<4;g++)y+=a.values[h+g]*a.values[m+g];let p=y<0?-1:1,b=0;for(let g=0;g<4;g++)r[g]=a.values[h+g]*(1-d)+a.values[m+g]*p*d,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[h+p]*(1-d)+a.values[m+p]*d;}}return Ba(t,Oa({translation:o,rotation:r,scale:n}))}var Te=5126,of=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),Va={stride:Io,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}]},Nr=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);}},Gr=256,Ro=41,Da={stride:Ro*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}]},Bt=2,bt=16,Ke=class{constructor(){this.models=[];this.gpu=new B;this.counted=new Set;this.instBuffer=null;this.instScratch=new Float32Array(Gr*Ro);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",Bt);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 d=c.matrixFor(t);o.setMat4("u_matrix",d),o.setMat3("u_normal_matrix",c.normalMatrix());let h=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(!(u&&!y))for(let p of c.mesh.primitives){if(!u&&p.blend!==y)continue;o.setMat4("u_matrix",p.node>=0?c.matrixForNode(t,p.node,l):d),h&&o.setMat4("u_shadow_matrix",p.node>=0?this.shadowMatrixForNodeAt(t,c,p.node,l):h);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(Bt,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 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,Da,true)),f.instVao||(f.instVao=new ue(e,[{buffer:f.vbo,locations:r},{buffer:this.instBuffer,locations:r}],f.ibo)),s||(o.use(),n(o),o.setInt("u_base_texture",Bt),o.setFloat("u_opacity",1),s=true);let u=c[0].mesh;for(let d=0;d<c.length;d+=Gr){let h=Math.min(Gr,c.length-d);for(let m=0;m<h;m++){let y=c[d+m],p=m*Ro;this.instScratch.set(y.matrixFor(t),p);let b=a?this.shadowMatrix(t,y):of;this.instScratch.set(b,p+16),this.instScratch.set(y.normalMatrix(),p+32),this.drawnInstanced.add(y);}this.instBuffer.update(this.instScratch.subarray(0,h*Ro)),e.bindVAO(f.instVao.vao);for(let m of u.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(Bt,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,h);}}}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<=bt?r:[...r].sort((f,u)=>u.intensity-f.intensity).slice(0,bt),a=new Float32Array(bt*4),l=new Float32Array(bt*4),s=new Float32Array(bt*4),c=new Float32Array(bt*4);n.forEach((f,u)=>{let d=u*4;a[d]=f.position[0],a[d+1]=f.position[1],a[d+2]=f.position[2],a[d+3]=f.range,l[d]=f.color[0]*f.intensity,l[d+1]=f.color[1]*f.intensity,l[d+2]=f.color[2]*f.intensity,l[d+3]=f.type==="spot"?1:0,s[d]=f.direction[0],s[d+1]=f.direction[1],s[d+2]=f.direction[2],c[d]=f.cosInner,c[d+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),Va),l=new he(e,t.mesh.indices),s=new ue(e,[{buffer:a,locations:o}],l),c=t.bitmaps.map(u=>{if(!u)return null;let d=n.createTexture();return d?(e.bindTexture(Bt,d),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),d):null}),f=new Nr(s,a,l,c);return f.users=1,this.counted.add(t),this.gpu.set(t.url,f),f}static get layout(){return Va}static get instanceLayout(){return Da}destroy(e){for(let t of this.gpu.values())t.destroy(e);this.gpu.clear(),this.models=[];}};var Ur=4,Ga=new ee;function rf(i){Ga.has(i)||(Ga.add(i),console.warn(`[osmgl] ${i}`));}var nf=.5,af=.01,lf=300,jr=127,Xr=128,Vt=5120,zo=5121,Dt=5122,Na=5123,Gt=5126,sf={stride:8,attribs:[{name:"a_pos",size:2,type:Gt,offset:0}]},Yr={stride:je,attribs:[{name:"a_pos",size:2,type:Dt,offset:0}]},Ua={stride:Xe,attribs:[{name:"a_p0",size:2,type:Dt,offset:0},{name:"a_p1",size:2,type:Dt,offset:4},{name:"a_corner",size:2,type:Vt,offset:8},{name:"a_ground",size:2,type:Vt,offset:10},{name:"a_dist",size:1,type:Gt,offset:12},{name:"a_width",size:1,type:Gt,offset:16}]},Fo={stride:Me,attribs:[{name:"a_pos",size:2,type:Dt,offset:0},{name:"a_height",size:1,type:Na,offset:4},{name:"a_tint",size:1,type:zo,normalized:true,offset:6},{name:"a_ao",size:1,type:zo,normalized:true,offset:7},{name:"a_normal",size:3,type:Vt,normalized:true,offset:8},{name:"a_kind",size:1,type:zo,offset:11},{name:"a_wall",size:3,type:Na,offset:12}]},cf={flat:0,water:1,foliage:2,sand:3,asphalt:4},ff=[1,9,14,26,3],ja={stride:ft,attribs:[{name:"a_pos",size:2,type:Gt,offset:0},{name:"a_level",size:1,type:Dt,offset:8},{name:"a_normal",size:3,type:Vt,normalized:true,offset:10},{name:"a_kind",size:1,type:zo,offset:13},{name:"a_bleed",size:2,type:Vt,offset:14}]},Kr=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();}},Xa={enabled:false,resolution:1024,strength:.75,color:"#5a6b86",bias:.25},Nt=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 ko;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={...Xa};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.cameraMeters=[0,0,0];this.dpr=1;this.detailScale=1;this.reliefScale=1;this.allowShadows=true;this.highlight=null;this.highlightGpu=new B;this.highlightKey="";this.groundArrows=new zt;this.highlightTris=new B;this.fillHighlightGpu=new B;this.fillHighlightKey="";this.footprintKey="";this.highlightFill=null;this.indoorMask=new Pt;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 Ke;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),d=[];for(let m=0;m*3<f.length;m++)a.has(u[m])||d.push(f[m*3],f[m*3+1],f[m*3+2]);let h=null;if(d.length<f.length){let m=new he(e,new Uint32Array(d));h={vao:new ue(e,[{buffer:n,locations:this.buildingLocs}],m),ibo:m,count:d.length,vbo:n};}return this.hiddenCut.set(l,h),h}init(e){this.symbols?.init(e),this.fill=new me(e,"fill",ya,ga),this.surface=new me(e,"surface",Ma,Ta),this.line=new me(e,"line",va,wa),this.objectLine=new me(e,"objectLine",xa,_a),this.building=new me(e,"buildings",Ca,Sa),this.depth=new me(e,"depth",aa,Tr),this.groundShadow=new me(e,"groundShadow",pa,ba),this.sky=new me(e,"sky",ua,da),this.raster=new me(e,"raster",ha,ma),this.globeBody=new me(e,"globeBody",oa,ra),this.globeClip=new me(e,"globeClip",na,ia),this.globeMesh=uf(e,this.globeBody),this.model=new me(e,"model",sa,kr),this.modelInstanced=new me(e,"model-instanced",ca,kr),this.modelDepth=new me(e,"modelDepth",fa,Tr);for(let n of Ke.layout.attribs)this.modelLocs.set(n.name,this.model.attribLocation(n.name));for(let n of [...Ke.layout.attribs,...Ke.instanceLayout.attribs])this.modelInstLocs.set(n.name,this.modelInstanced.attribLocation(n.name));this.shadowPlaceholder=ea(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]),sf),r=new he(e,new Uint16Array([0,1,2,0,2,3]));this.quad={vao:new ue(e,[{buffer:o,locations:t}],r),vbo:o,ibo:r};for(let n of Yr.attribs)this.fillLocs.set(n.name,this.fill.attribLocation(n.name));for(let n of ja.attribs)this.surfaceLocs.set(n.name,this.surface.attribLocation(n.name));for(let n of Ua.attribs)this.lineLocs.set(n.name,this.line.attribLocation(n.name));for(let n of Br.attribs)this.objectLineLocs.set(n.name,this.objectLine.attribLocation(n.name));for(let n of Fo.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=mt(t,r),this.patternScale=co/Math.max(Le(t.center.lat),1),this.dpr=t.width>0?e.gl.drawingBufferWidth/t.width:1;let c=Math.max(t.pixelsPerMeter,1e-9),f=t.cameraPositionPx;this.cameraMeters=[f[0]/c,f[1]/c,f[2]/c];let u=p=>o.get(p.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 d=p=>p.type==="line"&&V(p.paint.elevation,l,0)!==0,h=new Set;for(let p of r.layers){if(p.type==="raster"||p.type==="fill-extrusion"||p.type==="symbol"||p.overlay||d(p)||!r.layerVisibleAt(p,l))continue;let b=u(p);if(b){if(p.type==="line"&&p.network){if(h.has(p.network))continue;h.add(p.network),this.drawNetwork(e,t,r,u,p.network,l,g=>!g.overlay&&!d(g)&&r.layerVisibleAt(g,l));continue}if(p.type==="surface"){if(!this.flattened(b,r,p))continue;this.drawFill(e,t,b,r,p,l);continue}p.type==="fill"?this.drawFill(e,t,b,r,p,l):this.drawLine(e,t,b,r,p,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,p=>{this.applyFogUniforms(p,t,r),p.setVec4("u_globe",0,0,0,0),p.setInt("u_material",0),p.setFloat("u_elevation",0),p.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 p of r.layers){if(p.type!=="surface"||p.overlay||!r.layerVisibleAt(p,l))continue;let b=u(p);b&&(this.flattened(b,r,p)||this.drawSurface(e,t,b,r,p,l));}e.setStencilTest(false),e.setDepthMask(false),e.setBlend("premultiplied"),e.setCull("none"),e.setDepthTest(false);let m=new Set;for(let p of r.layers){if(p.type==="raster"||!d(p)||p.overlay||!r.layerVisibleAt(p,l))continue;let b=u(p);if(b){if(p.type==="line"&&p.network){if(m.has(p.network))continue;m.add(p.network),this.drawNetwork(e,t,r,u,p.network,l,g=>!g.overlay&&d(g)&&r.layerVisibleAt(g,l));continue}this.drawLine(e,t,b,r,p,l);}}this.drawOverlay(e,t,r,u,l,"roads"),e.setDepthTest(true),e.setDepthMask(true),e.setCull("back");for(let p of r.layers){if(p.type!=="fill-extrusion"||!r.layerVisibleAt(p,l))continue;let b=u(p);b&&(this.drawBuildings(e,t,b,r,p,l,n)&&(s=true),this.drawHighlight(e,t,b,r,p,l));}this.model&&!this.models.isEmpty&&(this.models.render(e,t,this.model,this.modelLocs,p=>{this.applyShadowUniforms(p),this.applyFogUniforms(p,t,r),this.applyLight(p,r);},this.shadowActive,n/1e3,this.modelInstanced?{shader:this.modelInstanced,locations:this.modelInstLocs}:void 0),(this.models.hasAnimated||this.models.hasTransitions)&&(s=true)),this.drawOverlay(e,t,r,u,l,"volume"),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,p=>{this.applyFogUniforms(p,t,r),p.setVec4("u_globe",0,0,0,0),p.setInt("u_material",0),p.setFloat("u_elevation",0),p.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 y=r.layers.filter(p=>p.type==="line"&&V(p.paint.ghostOpacity,l,0)>.001&&r.layerVisibleAt(p,l));if(y.length){e.setDepthTest(true),e.setDepthFunc("greater"),e.setDepthMask(false),e.setBlend("premultiplied"),e.setCull("none");for(let p of y){let b=u(p);b&&this.drawLine(e,t,b,r,p,l,V(p.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,p=>{this.applyFogUniforms(p,t,r),p.setVec4("u_globe",0,0,0,0),p.setInt("u_material",0),p.setFloat("u_elevation",0),p.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(Ur,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 Rt(e,this.shadows.resolution);let l=r.light;if(t.updateShadow(yt(l.keyAzimuth,l.keyAltitude),lf),!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 d=o.get(u.source??Y);if(!d)continue;let h=r.bucketKeyFor(u);if(h===null)continue;let m=V(u.paint.heightScale,t.zoom,1);(u.source??Y)===Y&&this.indoorMask.prepare(d,h);for(let y of d.visibleTiles){if(!this.drawsTile(t,r,u,y))continue;let p=d.getTile(y),b=p&&this.bucketFor(e,p,h,Fo,this.buildingLocs,"fill-extrusion");if(!b)continue;f.setFloat("u_height_scale",this.growScale(b,n,!d.warm)*m),f.setMat4("u_matrix",t.shadowTileMatrix(y,b.extent));let g=(u.source??Y)===Y,v=this.cutHidden(e,p,h,y.dataKey,b.buffer,this.hiddenFor(h,g)),x=g?v??this.indoorMask.indicesFor(e,p,h,y,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(Ur),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,o),r.setMat4("u_matrix",t.localMatrix());let n=o.background;r.setVec3("u_body_color",n[0],n[1],n[2]),Re(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(fe(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);}applyAtmosphere(e,t,o){let r=t.cameraRay();e.setVec3("u_cam_ray",r.axisElev,r.focal*this.dpr,t.height*this.dpr/2),e.setFloat("u_haze_exp",1/Math.max(o.sky.horizonBlend,.01));}skyBand(e,t){let o=e.horizonScreenY(),r=e.height*this.dpr/Math.max(Ae(e.fov),.001);return [(e.height-o)*this.dpr,Math.max(o,1)*this.dpr,Math.max(t.sky.horizonBlend*r,1)]}drawSky(e,t,o){if(!this.sky||!this.quad||!o.sky.enabled)return;let r=this.sky;r.use(),Re(r,"u_sky_color",o.sky.skyColor),Re(r,"u_horizon_color",o.sky.horizonColor),df(r,o.sky);let[n,a]=this.skyBand(t,o),l=Math.min(a*.5,t.height*this.dpr*.1);r.setVec3("u_sky_params",n,a,l),this.applyAtmosphere(r,t,o);let s=t.cameraRay();r.setVec3("u_cam_right",s.right[0],s.right[1],s.right[2]),r.setVec3("u_cam_up",s.up[0],s.up[1],s.up[2]),r.setVec3("u_cam_fwd",s.fwd[0],s.fwd[1],s.fwd[2]),r.setVec2("u_cam_center",t.width*this.dpr/2,t.height*this.dpr/2);let c=yt(o.light.keyAzimuth,o.light.keyAltitude);r.setVec3("u_sun_dir",-c[0],-c[1],-c[2]),Re(r,"u_sun_color",o.light.keyColor),r.setFloat("u_sun_glow",o.light.keyIntensity);let f=t.globeActive?1-t.globeFlatMix:0;if(r.setVec2("u_space",f,o.sky.starIntensity),f>.001){Re(r,"u_space_color",o.sky.spaceColor),Re(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[d,h,m,y]=t.localRayCorners();r.setVec3("u_ray_tl",d[0],d[1],d[2]),r.setVec3("u_ray_tr",h[0],h[1],h[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,o){if(!t.globeActive){e.setVec4("u_globe",0,0,0,0);return}let r=t.globeBasis,n=t.worldSize;e.setVec4("u_globe",1,t.globeFlatMix,t.globeRadiusPx,n),e.setVec2("u_globe_center",t.centerPointPx.x/n,t.centerPointPx.y/n);let a=t.globeCamera();e.setVec4("u_globe_cam",a.dir[0],a.dir[1],a.dir[2],a.horizonCos);let l=yt(o.light.keyAzimuth,o.light.keyAltitude);e.setVec3("u_globe_sun",-l[0],-l[1],-l[2]),e.setVec2("u_globe_light",.16,.14),e.setMat3("u_globe_basis",[r.east[0],r.south[0],r.up[0],r.east[1],r.south[1],r.up[1],r.east[2],r.south[2],r.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??mt(t,o);if(r.intensity<=0){e.setVec3("u_fog_range",0,1,0),e.setVec2("u_fog_vertical",0,0),this.applyAtmosphere(e,t,o);return}Re(e,"u_fog_color",o.sky.horizonColor),e.setVec3("u_fog_range",r.near,r.far,r.intensity);let[n,a]=o.sky.fogVerticalRange;e.setVec2("u_fog_vertical",n,a),this.applyAtmosphere(e,t,o);}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(nf/Math.max(t.pixelsPerMeter,1e-9),af);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,jr);}drawTileStencil(e,t,o){if(this.stencilIds.clear(),t.globeActive){e.gl.stencilMask(255),e.clear(null,false,true),e.setStencilTest(false);return}let r=o.get(Y);if(!r||!this.fill||!this.quad)return;let n=r.visibleTiles;if(!n.length||n.length>jr)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,jr),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||t.globeActive)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 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(Y);if(!n)return;let a=this.groundShadow;a.use(),this.applyShadowUniforms(a),this.applyFogUniforms(a,t,r);let l=r.light,[,,s]=yt(l.keyAzimuth,l.keyAltitude),c=Math.max(-s,0),f=ce(l.ambientColor),u=ce(l.keyColor),d=[0,0,0];for(let h=0;h<3;h++){let m=f[h]*l.ambientIntensity,y=u[h]*l.keyIntensity*c;d[h]=m>0?m/(m+y):1;}a.setVec3("u_shadow_ground",d[0],d[1],d[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 h of n.visibleTiles)a.setMat4("u_shadow_matrix",t.shadowTileMatrix(h,1)),a.setMat4("u_matrix",t.tileMatrix(h,1)),e.gl.drawElements(e.gl.TRIANGLES,6,e.gl.UNSIGNED_SHORT,0);e.setBlend("premultiplied");}applyShadowUniforms(e){if(e.setInt("u_shadow_map",Ur),!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=ce(this.shadows.color);e.setVec3("u_shadow_color",n[0],n[1],n[2]);}get shadowsActive(){return this.shadowActive}drawOverlay(e,t,o,r,n,a){let l=()=>{e.setDepthTest(false),e.setDepthMask(false),e.setBlend("premultiplied"),e.setCull("none");};l();for(let s of o.layers){if(s.type==="raster"||s.type==="symbol"||s.type==="fill-extrusion"||!s.overlay||(s.overlay===true?"volume":s.overlay)!==a||!o.layerVisibleAt(s,n))continue;let c=r(s);if(c){if(s.type==="surface"){this.flattened(c,o,s)?this.drawFill(e,t,c,o,s,n):this.drawSurface(e,t,c,o,s,n),l();continue}s.type==="fill"?this.drawFill(e,t,c,o,s,n):this.drawLine(e,t,c,o,s,n);}}}applyTileScale(e,t,o){let r=qo(t.z)/this.patternScale;e.setFloat("u_meters_per_unit",r/o);let[n,a]=In(t.z,t.x,t.y);e.setVec2("u_world_origin",n/this.patternScale,a/this.patternScale);let l=this.cameraMeters;e.setVec3("u_camera_local",l[0]-t.x*r,l[1]-t.y*r,l[2]);}applyMaterial(e,t,o){let r=t.paint&&"material"in t.paint?t.paint.material:void 0,n=this.detailScale<=0?0:cf[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,ff[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,r),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 d=o.getTile(u),h=d&&this.bucketFor(e,d,f,Yr,this.fillLocs,"fill");h&&(this.clipToTile(e,u),this.shadowActive&&l.setMat4("u_shadow_matrix",t.shadowTileMatrix(u,h.extent)),this.applyTileScale(l,u,h.extent),this.applyTileMatrix(l,t,u,h.extent),h.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,h.indexCount,h.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=V(n.paint.opacity,a,1)*(l||1),d=V(n.paint.width,a,1);if(u<=.001||d<=.01)return;let h=e.gl.drawingBufferWidth,m=e.gl.drawingBufferHeight,y=t.width>0?h/t.width:1,p=d/2*y;c.use(),this.applyFogUniforms(c,t,r),this.applyGlobeUniforms(c,t,r),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=V(n.paint.offset,a,0)*y,g=Math.max(V(n.paint.blur,a,0),0)*y;c.setFloat("u_elevation",V(n.paint.elevation,a,0)*this.reliefScale),c.setFloat("u_relief",this.reliefScale),c.setVec2("u_viewport",h,m);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",_*y,(_+T)*y);}if(x){let _=Ee(n.paint.arrowColor,a,[1,1,1,1]);c.setVec4v("u_arrow_color",_e(_));let T=V(n.paint.arrowPeriod,a,46)*y,L=V(n.paint.arrowSize,a,5)*y;if(M){let E=V(n.paint.arrowGap,a,24)*y,z=Math.max(T-E,1),A=Math.min(L,z),I=V(n.paint.arrowShaft,a,2)*y,k=V(n.paint.arrowHead,a,4)*y,R=V(n.paint.arrowOutline,a,0)*y;c.setVec4("u_arrow",I,A,k,z),c.setVec2("u_dash",R,T);}else S?c.setVec4("u_arrow",T,L,p,0):c.setVec4("u_arrow",T,Math.max(L*.4,1),Math.min(L,p*.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?[He(n.id,s)]:(T.data?.levels??[]).map(E=>He(n.id,E)):[w];for(let E of L){let z=this.bucketFor(e,T,E,Ua,this.lineLocs,"line");if(!z)continue;let A=_.bounds(),I=(A.maxX-A.minX)*t.worldSize/z.extent*y;c.setFloat("u_tile_to_px",I);let k=I>1e-6?1/I:1;c.setFloat("u_half_width",p*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",V(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 d of u.visibleTiles){let h=u.getTile(d);for(let m of h?.data?.levels??[])c.add(m);}}if(c.size)for(let f of [...c].sort((u,d)=>u-d))for(let u of s){let d=r(u);d&&this.drawLine(e,t,d,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=ce(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 u of o.visibleTiles){let d=o.getTile(u);if(!d)continue;let h=d.data?.buckets?.[n.id];if(!h)continue;let m=u.dataKey,y=this.highlightGpu.get(m);if(y===void 0){let p=Eo(d,n.id,l.featureId);if(p){let b=new ye(e,new Uint8Array(p.vertices),Fo),g=new he(e,p.indices);y={vao:new ue(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,u,h.extent),this.shadowActive&&f.setMat4("u_shadow_matrix",t.shadowTileMatrix(u,h.extent)),f.setMat4("u_matrix",t.tileMatrix(u,h.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 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=Eo(c,o.layerId,o.featureId);u&&this.highlightTris.set(s.dataKey,Lr(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(d=>d.id===n.layerId),s=l?o.get(l.source??Y):void 0;if(!l||!s)return;let c=n.bucketKey,f=ce(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,Xr,Xr),u.stencilOp(u.KEEP,u.KEEP,u.REPLACE),u.stencilMask(Xr);for(let d of s.visibleTiles){let h=s.getTile(d),m=h?.data?.buckets?.[c];if(!h||!m||m.kind!=="fill"||!m.featureIds)continue;let y=this.fillHighlightFor(e,m,d,n.featureId,c);y&&(a.setMat4("u_matrix",t.tileMatrix(d,m.extent)),y.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,y.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(d=>{d?.vao.destroy(),d?.ibo.destroy(),d?.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 d=0;d*3<s.length;d++)c[d]===r&&f.push(s[d*3],s[d*3+1],s[d*3+2]);let u=null;if(f.length){let d=new ye(e,new Uint8Array(t.vertices),Yr),h=new he(e,new Uint32Array(f));u={vao:new ue(e,[{buffer:d,locations:this.fillLocs}],h),vbo:d,ibo:h,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=V(n.paint.opacity,a,1);if(c<=.001)return;l.use(),this.applyShadowUniforms(l),this.applyFogUniforms(l,t,r),this.applyGlobeUniforms(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),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",V(n.paint.sideLight,a,f?1:0)),l.setFloat("u_relief",this.reliefScale);let d=r.bucketKeyFor(n);if(d===null)return;let h=c>=1&&!n.overlay;e.setDepthMask(h),e.setBlend(h?"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,d,ja,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)),this.applyTileMatrix(l,t,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(h);}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,u=V(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",V(n.paint.aoStrength,a,.4)),s.setFloat("u_tint_variation",V(n.paint.tintVariation,a,.07));let d=(x,C)=>n.paint[x]?r.colorAt({...n,paint:{...n.paint,color:n.paint[x]}},a,C):C,h=d("windowColor",[.62,.71,.8,1]),m=d("windowFrameColor",[c[0]*1.1,c[1]*1.1,c[2]*1.1,1]);s.setVec3("u_window_color",h[0],h[1],h[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_window_variation",V(n.paint.windowVariation,a,1)),s.setFloat("u_seam_strength",V(n.paint.seamStrength,a,1)),s.setFloat("u_window_recess",V(n.paint.windowRecess,a,.18)),s.setFloat("u_window_recess_shade",V(n.paint.windowRecessShade,a,.16)),s.setFloat("u_plinth_height",V(n.paint.plinthHeight,a,4)),s.setFloat("u_plinth_shade",V(n.paint.plinthShade,a,.14)),s.setFloat("u_roof_variation",V(n.paint.roofVariation,a,.3)),this.applyLight(s,r);let y=u>=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 x of o.visibleTiles){if(!this.drawsTile(t,r,n,x))continue;let C=o.getTile(x),S=C&&this.bucketFor(e,C,g,Fo,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*p),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?hf(Math.max(r,0)):1}applyLight(e,t){let o=t.light;Re(e,"u_ambient_color",o.ambientColor),e.setFloat("u_ambient_intensity",o.ambientIntensity);let[r,n,a]=yt(o.keyAzimuth,o.keyAltitude);e.setVec3("u_key_dir",r,n,a),Re(e,"u_key_color",o.keyColor),e.setFloat("u_key_intensity",o.keyIntensity);let[l,s,c]=yt(o.fillAzimuth,o.fillAltitude);e.setVec3("u_fill_dir",l,s,c),Re(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 rf(`\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 he(e,new Uint32Array(s.indices)),u=new ue(e,[{buffer:c,locations:n}],f),d=new Kr(u,c,f,f.count,f.type,s.extent,s.capIndexOffset??f.count);return t.buckets.set(o,d),d}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;}},Po=new B;function uf(i,e){let r=new Float32Array(66306),n=0;for(let d=0;d<=128;d++){let h=(d/128-.5)*Math.PI;for(let m=0;m<=256;m++)r[n++]=m/256*2*Math.PI-Math.PI,r[n++]=h;}let a=new Uint16Array(256*128*6),l=0;for(let d=0;d<128;d++)for(let h=0;h<256;h++){let m=d*257+h,y=m+256+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:Gt,offset:0}]},c=new B([["a_lnglat",e.attribLocation("a_lnglat")]]),f=new ye(i,r,s),u=new he(i,a);return {vao:new ue(i,[{buffer:f,locations:c}],u),vbo:f,ibo:u,count:a.length}}function df(i,e){if(e.highColor){Re(i,"u_high_color",e.highColor);return}let t=Po.get(e.skyColor);t||(t=ce(e.skyColor),Po.set(e.skyColor,t)),i.setVec3("u_high_color",t[0]*.6,t[1]*.74,Math.min(1,t[2]*.99+.02));}function Re(i,e,t){let o=Po.get(t);o||(o=ce(t),Po.set(t,o)),i.setVec3(e,o[0],o[1],o[2]);}function yt(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 hf(i){let o=i-1;return 1+2.20158*o*o*o+1.20158*o*o}var Ho=1,Ut=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+Ho>this.size&&(this.shelfY+=this.shelfHeight+Ho,this.shelfX=0,this.shelfHeight=0),this.shelfY+r+Ho>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+Ho,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 $r=.75,Xt=8,be=3,Ge=24,gt=256,Ya=255,jt=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/gt))}needsLoad(e){for(let t of e){let o=t.codePointAt(0);if(o===void 0)continue;let r=Math.floor(o/gt);if(r<=Ya&&!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/gt);n>Ya||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*gt}-${e*gt+gt-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 Ka(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 Ka(i){let e=new Wl__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((d,h,m)=>{m&&(d===1?u.id=m.readVarint():d===2?u.bitmap=m.readBytes():d===3?u.width=m.readVarint():d===4?u.height=m.readVarint():d===5?u.left=m.readSVarint():d===6?u.top=m.readSVarint():d===7&&(u.advance=m.readVarint()));},null,f),t.push(u);},null,a);},null),t}var pf=.25,vt=1e20;function qr(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(vt),l.fill(0);for(let c=0;c<t;c++)for(let f=0;f<e;f++){let u=i[c*e+f]/255,d=(c+be)*o+(f+be);if(u>=1)a[d]=0,l[d]=vt;else if(u>0){let h=.5-u;a[d]=h>0?h*h:0,l[d]=h<0?h*h:0;}else a[d]=vt,l[d]=0;}$a(a,o,r),$a(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]=bf(Math.round(255-255*(f/Xt+pf)));}return {data:s,width:o,height:r}}function $a(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];qa(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];qa(r,n,a,l,e);for(let c=0;c<e;c++)i[s*e+c]=n[c];}}function qa(i,e,t,o,r){t[0]=0,o[0]=-vt,o[1]=vt;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]=vt;}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 bf=i=>i<0?0:i>255?255:i;var Za=48,Yt=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(Za*(n>1?n:1))),l=Math.max(8,Math.round(Za/(n<1?n:1))),s=await yf(o,a,l);return this.sdfs.set(e,qr(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 yf(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,d)=>{a.onload=()=>u(),a.onerror=()=>d(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 ot={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>'},gf={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(gf)){let t=ot[e];t?ot[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 vf=1.2;function Zr(i,e,t=16,o=0){let r=wf(i,t),n=[],a=[],l=0;for(let f of r){let u=0,d=0;for(let h of f){let m=h.codePointAt(0);if(m===void 0)continue;let y=e.get(m);y&&(u+=y.advance,d++);}d>1&&(u+=o*(d-1)),a.push(u),u>l&&(l=u);}if(l===0)return null;let s=Ge*vf,c=r.length*s;for(let f=0;f<r.length;f++){let u=-a[f]/2,d=-c/2+f*s+s/2;for(let h of r[f]){let m=h.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:u,y:d}),u+=y.advance+o);}}return n.length?{glyphs:n,width:l,height:c}:null}function wf(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 Qr(i,e,t,o){if(i.length<2)return [];let r=-o,n=-o,a=e+o,l=t+o,s=d=>d.x>=r&&d.x<=a&&d.y>=n&&d.y<=l,c=[],f=[],u=()=>{f.length>=2&&c.push(f),f=[];};for(let d=0;d+1<i.length;d++){let h=i[d],m=i[d+1],y=s(h),p=s(m);if(y&&p){f.length||f.push(h),f.push(m);continue}let b=xf(h,m,r,n,a,l);if(!b){u();continue}f.length||f.push(b[0]),f.push(b[1]),p||u();}return u(),c}function xf(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,d]of f){if(u===0){if(d<0)return null;continue}let h=d/u;if(u<0){if(h>c)return null;h>s&&(s=h);}else {if(h<s)return null;h<c&&(c=h);}}return [{x:i.x+a*s,y:i.y+l*s},{x:i.x+a*c,y:i.y+l*c}]}var _f=[0,.25,-0.25,.5,-0.5,.75,-0.75,1,-1];function en(i,e,t,o={}){if(i.length<2||!e.length||t<=0)return [];let r=Tf(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=[],d=o.spacing??250,h=d>0&&d-t<d*.25?t+d*.25:d;if(o.accept)return Cf(i,r,e,t,h,c,a,f,o.accept);if(h>0&&s>=t+h){let y=Math.min(Math.floor((s-t)/h)+1,24),p=t+h*(y-1),b=(s-p)/2;for(let g=0;g<y;g++,b+=h){let v=b/l,x=Jr(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 m=(n-t)/2;for(let y of _f){let p=m+m*y,b=Jr(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 Cf(i,e,t,o,r,n,a,l,s){let c=e[e.length-1],f=Math.max(o/3,r/8,12),u=[],d=-1/0;for(let h=0;h+o<=c;h+=f){if(h-d<r)continue;let m=Jr(i,e,t,o,h,n,a,l);if(!m)continue;let y={glyphs:m,path:m.map(p=>({x:p.x,y:p.y})),at:h};if(s(y)&&(u.push(y),d=h,u.length>=24))break}return u}function Jr(i,e,t,o,r,n,a,l){if(r<0||r+o>e[e.length-1]||!Sf(i,e,r,r+o,n,a))return null;let s=Kt(i,e,r),c=Kt(i,e,r+o);if(!s||!c)return null;if(c.x>=s.x)return Qa(i,e,t,r,l);let f=e[e.length-1];return Qa([...i].reverse(),kf(e),t,f-(r+o),l)}function Sf(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),d=Math.abs((u-f)*180/Math.PI+540)%360-180,h=Math.abs(d);for(a.push({at:c,delta:h}),l+=h;a.length&&c-a[0].at>r;)l-=a.shift().delta;if(l>n)return false}return true}function Qa(i,e,t,o,r){let n=[];for(let c of t){let f=Ja(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(Mf(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=Ja(i,e,l,t[c].width);if(!f)return null;a.push(f);}return a}function Ja(i,e,t,o){let r=Kt(i,e,t+o/2);if(!r)return null;let n=Kt(i,e,t),a=Kt(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 Mf(i,e){let t=i-e;for(;t>180;)t-=360;for(;t<=-180;)t+=360;return t}function Tf(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 kf(i){let e=i[i.length-1];return i.map(t=>e-t).reverse()}function Kt(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 on=20,el={stride:on,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}]},Ef=220,$e=64,tl=2,Af=1.22,Lf=128,If=.7;function Rf(i,e,t){let o=i.layout?.letterSpacing;if(o!==void 0)return V(o,e,0)*Ge;let r=V(i.paint?.haloWidth,e,0);return r<=0||t<=0?0:r*If/(t/Ge)}var Ff=256,zf=200,tn="frame-circle",wt=class i{constructor(e,t){this.shader=null;this.locations=new B;this.atlas=new Ut(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 jt(e,t),this.icons=new Yt(ot);}init(e){this.shader=new me(e,"symbol",ka,Ea);for(let t of el.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)/Ef;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}))?zf: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(h=>h.type==="symbol"&&r.layerVisibleAt(h,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((h,m)=>u.set(h.id,m));let d=0;for(let h of s){let m=this.place(h,a,c);if(!m)continue;this.placed.push({layerId:h.layer.id,text:h.text,icon:h.icon,mercX:h.mercX,mercY:h.mercY,box:m.box,order:u.get(h.layer.id)??0});let y=f.get(h.layer.id);y||f.set(h.layer.id,y={layer:h.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),d+=m.quads,this.placedCount++;}this.rememberPlaced(),this.fading&&this.onAssetsReady?.(),this.requestMissing(),d&&(this.styleOrder=u,this.draw(e,t,f,d,a));}collect(e,t,o,r){let n=[],l=this.padding,s=mt(e,o).far,[c,f,u]=e.cameraPositionPx;for(let d of r){let h=(d.layout?.priority??0)*Ff,m=t.get(d.source??Y);if(!m)continue;let y=d.layout?.showFor==="highlight",p=d.layout?.placement==="map",{shift:b,drop:g}=p?il(d,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,x=o.bucketKeyFor(d);if(x!==null)for(let C of m.visibleTiles){if(!o.layerVisibleAt(d,e.detailZoom(e.distanceToTile(C))))continue;let M=m.getTile(C)?.data?.buckets?.[x];if(!M||!To(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,R=z.minY*A;for(let P=0;P<_.length;P++){let F=k+w[P*2]*I,W=R+w[P*2+1]*I;if(s!==1/0&&Math.hypot(F-c,W-f,u)>s||y&&!De(this.highlightFootprint,F/A,W/A,v))continue;let G=F,O=W;if(p&&T){let $=T[P]*Math.PI/180,Q=b;G-=Math.sin($)*Q,O+=Math.cos($)*Q;}let H=e.worldPxToPoint(G,O),D=L&&E?Pf(e,L,E,P,k,R,I):void 0;if(d.layout?.textPlacement==="line"){if(!D)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:d,screenX:H?H.x:D[0].x,screenY:(H?H.y:D[0].y)+g,text:M.texts[P]??"",icon:M.icons[P]??"",priority:_[P]+h,rotate:al(d,T,P,e.bearing),mercX:F/A,mercY:W/A,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,[u,d]=r.offset??[0,0],h=r.placement==="map",m=null;if(e.icon&&!h){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&&(m=U);}let y=null;if(m&&r.iconFrame==="circle"){let q=`icon:${tn}`,U=this.atlas.get(q);if(!U){let j=this.icons.get(tn);j?U=this.atlas.add(q,j.data,j.width,j.height)??void 0:this.pendingIcons.add(tn);}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=Zr(e.text,this.glyphs,r.textPlacement==="line"?Number.MAX_SAFE_INTEGER:r.maxLineChars??15,Rf(e.layer,t,s)),!b&&!m)||!b&&!m)return null;let g=s/Ge,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"&&!!m&&!!b,M=C==="top"&&!!m&&!!b,w=m?m.width/Math.max(m.height,1):1,_=S?x+f*2:c,T=m?_*w:0,L=Math.max(T,m?c*p:0),E=Math.max(_,m?c*p:0),z=S?Math.max(T,v+f*2):M?Math.max(L,v):L+(m&&b?f:0)+v,A=S?Math.max(_,x):M?E+f+x:Math.max(m?E:0,x),I=e.screenX+u,k=e.screenY+d,R=tl+(r.collisionPadding??0),P={x1:I-z/2-R,y1:k-A/2-R,x2:I+z/2+R,y2:k+A/2+R},F=this.padding;if(P.x1<F.left||P.y1<F.top||P.x2>this.viewport.width-F.right||P.y2>this.viewport.height-F.bottom)return null;if(!r.allowOverlap){if(ol(o,P))return null;rl(o,P);}let W=[],G=[],O=[],H=[],D=[],K=[],$=0,Q=I-z/2,de=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+(m?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,ne=k+de+(U.y-j.top-be)*g,ge=ae.width*g,ke=ae.height*g;Oo(W,G,se,ne,ge,ke,ae,0,a),$++;let ve=be*g;J=Math.min(J,se+ve),X=Math.min(X,ne+ve),te=Math.max(te,se+ge-ve),ie=Math.max(ie,ne+ke-ve);}if(M&&m&&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(m){let q=l?Af: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(y){let ne=c*p*q,ge=le+U/2-ne/2,ke=ae+j/2-ne/2,ve=be/Math.max(y.height-be*2,1)*ne;Oo(D,K,ge-ve,ke-ve,ne+ve*2,ne+ve*2,y,0,a),$++;}if(S&&te>J){let ne=f*1.6,ge=f;U=(te-J+ne*2)*q,j=(ie-X+ge*2)*q,le=J-ne,ae=X-ge;}let se=be/Math.max(m.height-be*2,1)*j;Oo(O,H,le-se,ae-se,U+se*2,j+se*2,m,e.rotate,a),$++;}return $?{verts:W,texs:G,iconVerts:O,iconTexs:H,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,u=e.layer.layout??{},d=[],h=[],m=[],y=0,p=r/2+tl,b=this.padding,g=T=>{let L=T.path.map(E=>({x1:E.x-p,y1:E.y-p,x2:E.x+p,y2:E.y+p}));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&&ol(n,E))return false;if(!u.allowOverlap)for(let E of L)rl(n,E);return m.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=Qr(s,this.viewport.width,this.viewport.height,Lf).flatMap(T=>en(T,c,f,{spacing:u.symbolSpacing,fontSize:Ge*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,R=I.height*o,P=(E.height/2-E.top)*o+C,F=z.angle*Math.PI/180;Oo(d,h,z.x-k/2-Math.sin(F)*P,z.y-R/2+Math.cos(F)*P,k,R,I,z.angle,l),y++;}if(!y)return null;let w=m.map(T=>(T.x1+T.x2)/2),_=m.map(T=>(T.y1+T.y2)/2);return {verts:d,texs:h,iconVerts:[],iconTexs:[],frameVerts:[],frameTexs:[],quads:y,box:{x1:Math.min(...w)-p,y1:Math.min(..._)-p,x2:Math.max(...w)+p,y2:Math.max(..._)+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*on),u=new Float32Array(f),d=new Uint16Array(f),h=[],m=0,y=(p,b,g,v)=>{let x=p.length/16;if(x){h.push({layer:g,role:v,first:m/4*6,count:x*6});for(let C=0;C<x*4;C++){let S=m*5;u[S]=p[C*4],u[S+1]=p[C*4+1],d[S*2+4]=b[C*2],d[S*2+5]=b[C*2+1],u[S+3]=p[C*4+2],u[S+4]=p[C*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",$r),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 h){let b=p.layer.paint,g=V(b.opacity,n,1),v=p.role==="icon",x=p.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]*=V(b.frameOpacity,n,1));let _=V(x?b.frameHaloWidth??1.1:C(b.iconHaloWidth,void 0,b.haloWidth),n,1.2),T=V(p.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",_/(Xt*(T/Ge))),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 ye(e,new Uint8Array(this.capacityQuads*4*on),el,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 he(e,o),this.vao=new ue(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 Oo(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),d=Math.sin(f),h=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-h,g=p-m;i.push(h+b*u-g*d,m+b*d+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 Pf(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 nl=(i,e)=>i*4096+e;function ol(i,e){let t=Math.floor(e.x1/$e),o=Math.floor(e.y1/$e),r=Math.floor(e.x2/$e),n=Math.floor(e.y2/$e);for(let a=t;a<=r;a++)for(let l=o;l<=n;l++){let s=i.get(nl(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 rl(i,e){let t=Math.floor(e.x1/$e),o=Math.floor(e.y1/$e),r=Math.floor(e.x2/$e),n=Math.floor(e.y2/$e);for(let a=t;a<=r;a++)for(let l=o;l<=n;l++){let s=nl(a,l),c=i.get(s);c||i.set(s,c=[]),c.push(e);}}function il(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 al(i,e,t,o){return !i.layout?.iconRotate||!e?0:e[t]-o}var xt=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 _t=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 Hf(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 _t(t,s,l),f=c.bounds(),u=(f.minX+f.maxX)/2,d=(f.minY+f.maxY)/2,h=[[u,d],[f.minX,f.minY],[f.maxX,f.minY],[f.minX,f.maxY],[f.maxX,f.maxY]],m=false;for(let[p,b]of h)if(i.isOnGlobeFront(Se(p),Ce(b))){m=true;break}if(!m)continue;let y=false;for(let[p,b]of h){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 $t(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 Hf(i,e,l);let{min:s,max:c}=i.visibleWrapRange(),f=[],u=[];for(let h=s;h<=c;h++)u.push(new _t(0,0,0,h));let d=0;for(;u.length&&!(++d>2e4||f.length>=n);){let h=u.pop();if(!i.isTileVisible(h))continue;if(h.z>=l){h.z>=o&&f.push(h);continue}if(i.tileScreenSize(h.z,i.distanceToTile(h))<=a&&h.z>=o){f.push(h);continue}for(let y of h.children())u.push(y);}return f.sort((h,m)=>i.distanceToTile(h)-i.distanceToTile(m)),f}var nn=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;}},rn=6,Of=24,Wo=class extends Ne{constructor(t,o){super();this.pool=t;this.visible=[];this.warmed=false;this.version=0;this.opts={cacheSize:160,detailBias:1,maxTiles:512,rank:1,...o},this.cache=new xt(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=$t(t,this.opts),r=new ee;for(let c of o)r.add(c.dataKey);for(let[c,f]of this.cache.entries())f.state==="loading"&&!r.has(c)&&(this.pool.abort(f.requestId),this.cache.delete(c));let n=Math.max(this.opts.cacheSize,r.size*2);this.cache.setCapacity(n);let a=this.opts.rank*1e9;for(let c of o)this.cache.get(c.dataKey)||this.loadTile(c,a+t.distanceToTile(c));let l=this.coverFor(o),s=this.readyFor(o);(this.anyReady(l)||this.visible.length===0||!this.covers(o))&&(this.visible=l,s&&o.length&&(this.warmed=true));}coverFor(t){let o=c=>{let f=this.cache.peek(c.dataKey);return !!f&&f.state!=="loading"},r=(c,f)=>{let u=f.parent();for(let d=0;u&&d<=rn;d++){if(u.dataKey===c.dataKey)return true;u=u.parent();}return false},n=new B,a=[];for(let c of t)o(c)?n.set(c.dataKey,c):a.push(c);let l=this.descendantsOf(a);for(let c of a){let f=l.get(c.dataKey);if(f&&f.length){for(let m of f)n.set(m.dataKey,m),this.cache.get(m.dataKey);continue}let u=c.parent(),d=null;for(let m=1;u&&m<=rn;m++,u=u.parent()){if(!o(u))continue;let y=u;if(m>1&&t.some(p=>p!==c&&o(p)&&r(y,p)))break;d=y;break}let h=d??c;n.set(h.dataKey,h);}let s=[];for(let[,c]of n){let f=c.parent(),u=false;for(let d=0;f&&d<=rn;d++){if(n.has(f.dataKey)){u=true;break}f=f.parent();}u||(s.push(c),this.cache.get(c.dataKey));}return s}descendantsOf(t){let o=new B;for(let n of t)o.set(n.dataKey,n);let r=new B;if(!o.size)return r;for(let[n,a]of this.cache.entries()){if(a.state==="loading")continue;let l=a.id.parent();for(let s=0;l&&s<Of;s++){let c=o.get(l.dataKey);if(c){let f=r.get(c.dataKey);f?f.push(a.id):r.set(c.dataKey,[a.id]);break}l=l.parent();}}return r}anyReady(t){for(let o of t){let r=this.cache.peek(o.dataKey);if(r&&r.state!=="loading")return true}return t.length===0}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}deactivate(){for(let[t,o]of this.cache.entries())o.state==="loading"&&(this.pool.abort(o.requestId),this.cache.delete(t));this.visible=[];}loadTile(t,o=0){let r=new nn(t);this.cache.set(t.dataKey,r);let n=Wf(this.opts.url.replace("{z}",String(t.z)).replace("{x}",String(t.x)).replace("{y}",String(t.y)));r.requestId=this.pool.load({url:n,zoom:t.z,metersPerTile:Ln(t.z,t.y),sourceMaxZoom:this.opts.maxzoom,plan:this.opts.plan},a=>{if(this.cache.peek(t.dataKey)===r){if(a.type==="error"){if(a.aborted)return;r.state="error",r.error=a.message,this.emit("error",{tile:t,message:a.message});}else r.data=a,r.state=Object.keys(a.buckets).length?"loaded":"empty",this.version++,a.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 ${a.diag.failed.join("; ")}`),this.emit("data",{tile:r});this.pendingCount===0&&this.emit("idle",void 0);}},o);}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 Wf(i){if(typeof location>"u")return i;try{return new URL(i,location.href).href}catch{return i}}var Bo=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;}},qt=class extends Ne{constructor(t){super();this.visible=[];this.aborts=new Map;this.opts={cacheSize:128,detailBias:1,maxTiles:256,...t},this.cache=new xt(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=$t(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 Bo(t);this.cache.set(t.dataKey,o);let r=new AbortController;this.aborts.set(t.dataKey,r),this.fetchImage(ll(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 ll(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 Bf="osmgl-assets",Ct="assets";var Vo=null;function cl(){return Vo||(Vo=new Promise(i=>{if(typeof indexedDB>"u")return i(null);try{let e=indexedDB.open(Bf,1);e.onupgradeneeded=()=>{let t=e.result;t.objectStoreNames.contains(Ct)||t.createObjectStore(Ct,{keyPath:"key"});},e.onsuccess=()=>i(e.result),e.onerror=()=>i(null);}catch{i(null);}}),Vo)}function Vf(i){return cl().then(e=>new Promise(t=>{if(!e)return t(null);try{let o=e.transaction(Ct,"readonly").objectStore(Ct).get(i);o.onsuccess=()=>t(o.result??null),o.onerror=()=>t(null);}catch{t(null);}}))}function Df(i){cl().then(e=>{if(e)try{e.transaction(Ct,"readwrite").objectStore(Ct).put(i);}catch{}});}var sl=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 Gf(i,e,t){let o=await crypto.subtle.importKey("raw",sl(e),"AES-GCM",false,["decrypt"]);return crypto.subtle.decrypt({name:"AES-GCM",iv:sl(t),tagLength:128},o,i)}var Zt=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 Vf(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(),Df({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 Gf(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 Nf=1,Qt=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-${Nf++}`,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 Vr(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:oe(e.lng),y:re(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=ln(n(-this.rotation));this.rotationTiltX&&(a=qe(an(n(this.rotationTiltX)),a)),this.rotationTiltZ&&(a=qe(sn(n(this.rotationTiltZ)),a));let l=qe(r,a),s=this.matrix;return We(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)),Be(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=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,u=s,d=f,h=c,m=p=>p*Math.PI/180,y=ln(m(-this.rotation));return this.rotationTiltX&&(y=qe(an(m(this.rotationTiltX)),y)),this.rotationTiltZ&&(y=qe(sn(m(this.rotationTiltZ)),y)),[(y[0]*u+y[1]*d+y[2]*h)/t,(y[3]*u+y[4]*d+y[5]*h)/t,(y[6]*u+y[7]*d+y[8]*h)/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],d=s[9],h=c*d-f*u;if(Math.abs(h)<1e-30)return false;let m=(n*d-a*u)/h,y=(c*a-f*n)/h,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,x=(o.max[2]-o.min[2])/2*p;return Math.abs(m-b)<=v&&Math.abs(y-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();Dr(n,t,n.duration>0?o%n.duration:0,c);let f=N();return xe(f,s,c),Be(r,f)}normalMatrix(){let e=n=>n*Math.PI/180,t=ln(e(-this.rotation));this.rotationTiltX&&(t=qe(an(e(this.rotationTiltX)),t)),this.rotationTiltZ&&(t=qe(sn(e(this.rotationTiltZ)),t));let o=qe([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 qe(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 an=i=>{let e=Math.cos(i),t=Math.sin(i);return [1,0,0,0,e,t,0,-t,e]},ln=i=>{let e=Math.cos(i),t=Math.sin(i);return [e,0,-t,0,1,0,t,0,e]},sn=i=>{let e=Math.cos(i),t=Math.sin(i);return [e,t,0,-t,e,0,0,0,1]};var Go=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),d=new Float64Array(a.featureIds),h=f.length/a.vertexCount;for(let m=0;m*3+2<u.length;m++){let y=u[m*3]*h,p=u[m*3+1]*h,b=u[m*3+2]*h;if(!qf(s,c,f[y],f[y+1],f[p],f[p+1],f[b],f[b+1]))continue;let g=d[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="";}},Uf=14,jf=2e3,Xf=4e3,fl=160,Yf=50,Kf=4e3,cn=6,No=class{constructor(e){this.wantKey="";this.modelKey="";this.entries=new B;this.loading=0;this.pending=[];this.known=new B;this.underBuilding=new Go;this.underVenue=new Go;this.tilesStamp="";this.rulesInScan=0;this.found=[];this.foundStamp="";this.sortedAt=null;this.budgetScale=1;this.addModel=null;this.lod=0;this.budget=fl;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 Zt(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??Uf,f=s.loadRadius??jf,u=Math.max(s.keepRadius??Xf,f),d=Math.min(1,Math.max(.25,(o.zoom-c)/3)),h=Math.max(8,Math.round((s.budget??fl)*this.budgetScale*d));this.budget=h,this.addModel=r;let m=s.maskReplaced!==false,y=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 p=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 R of t.visibleTiles){let P=t.getTile(R)?.data?.buckets?.[e.id];if(!P||!Aa(P))continue;let F=new Int16Array(P.anchors),W=R.bounds(),G=W.maxX-W.minX,O=W.maxY-W.minY;for(let H=0;H<P.props.length;H++){let D=P.props[H],K=rt(D.file,NaN);if(!Number.isFinite(K))continue;let $=String(D.kind??"model"),Q=$==="rule"?`t-${D.rid}-${D.oid}`:`m-${D.mid}`;if(k.has(Q))continue;k.add(Q),$==="rule"&&v++;let de=W.minX+F[H*2]/P.extent*G,J=W.minY+F[H*2+1]/P.extent*O,X=$f(de,J);this.known.set(Q,{id:Q,fileId:K,lng:X.lng,lat:X.lat,mercX:de,mercY:J,altitude:rt(D.alt,0),scale:rt(D.scale,1),rotation:rt(D.rx,0),tiltX:rt(D.rz,0),tiltZ:rt(D.ry,0),kind:$==="rule"?"rule":"model",target:Do($==="rule"?D.oid:D.replaces),replaces:m?$==="rule"?Do(D.oid):String(D.anchor??"replace")==="replace"?Do(D.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(p.lat*Math.PI/180),w=k=>Math.hypot((k.lng-p.lng)*S*M,(k.lat-p.lat)*S);this.replacedBuildings.clear(),this.replacedVenues.clear();let _=new ee,T=[],L=0,E=0;(this.sortedAt===null||Math.hypot((p.lng-this.sortedAt.lng)*S*M,(p.lat-this.sortedAt.lat)*S)>Yf)&&(x.sort((k,R)=>w(k)-w(R)),this.sortedAt={lng:p.lng,lat:p.lat});let A=0;for(let k of x){let R=w(k);if(R>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>=h){E++,P&&P.model.retire();continue}A++,_.add(k.id);let F=()=>{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){F(),W.distance=R,W.leftAt=0,W.model.revive(),b<W.lod&&!W.upgrading&&this.loading<cn&&this.upgrade(W,b,r,n);continue}if(R>f){L++;continue}if(this.loading>=cn){T.push(k),F();continue}F(),this.spawn(k,R,b,r);}for(let k of [...this.entries.values()])if(!_.has(k.placement.id)){if(k.leftAt===0){k.leftAt=y;continue}y-k.leftAt>Kf&&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,R]of [...this.known.entries()])w(R)>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<cn&&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 Qt({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;}},rt=(i,e)=>{let t=typeof i=="number"?i:Number(i);return Number.isFinite(t)?t:e},Do=i=>{let e=rt(i,NaN);return Number.isFinite(e)?e:null};function $f(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 qf(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,d=s>0||c>0||f>0;return !(u&&d)}var Zf=200,Qf={center:"translate(-50%, -50%)",top:"translate(-50%, 0)",bottom:"translate(-50%, -100%)",left:"translate(0, -50%)",right:"translate(-100%, -50%)"},Jt=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=Qf[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??Jf),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(oe(t.lng)*o,re(t.lat)*o,this.altitude);if(!r){this.culled=true,this.applyVisibility();return}let n=Zf;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";}},Jf='<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 eo=class extends Jt{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 eu=[["\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."]],ul=new Map(eu);function fn(i){let e=i.split(" ");if(e.length<2)return i;let t=false,o=e.map(n=>{let a=ul.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=>ul.get(n.toLowerCase())===void 0).length?i:o.join(" ")}function dn(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 d=u.loadGeometry(),h=ru(u.type,d);if(!h)continue;let m=e.textField?un(e.textField,u.properties):"",y=m&&e.abbreviate?fn(m):m,p=e.iconImage?un(e.iconImage,u.properties):"";if(!(!y&&!p)){if(l){let b=ou(u.type,d);if(!b)continue;f.push({text:y,line:b});continue}t.push(h[0],h[1]),o.push(y),r.push(p),n.push(nu(u.properties)),a.push(e.iconRotate&&Math.round(Number(u.properties[e.iconRotate]??0))||0);}}if(l){for(let{text:u,line:d}of tu(f)){c.push(s.length/2);for(let h of d)s.push(h);t.push(Math.round(d[0]),Math.round(d[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 tu(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 d=e[c];u.line.push(...d.line.slice(2)),d.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 ou(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 ru(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],d=c[f+3]-c[f+1],h=u*u+d*d;h>a&&(a=h,l=c[f]+u/2,s=c[f+1]+d/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 nu(i){let e=i.rank;return typeof e=="number"&&isFinite(e)?Math.max(0,255-Math.min(e,255)):128}function un(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 dl(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 iu(){let i=typeof self<"u"?self.origin:void 0;return i&&i!=="null"&&!i.startsWith("blob:")?i+"/":void 0}async function hl(i,e){let t=performance.now(),o=iu(),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 Et(a),f=Object.keys(c.layers),u={},d={},h=new Set,m=[],p=i.plan.some(b=>b.type==="surface"&&(b.elevation??0)>0)&&i.plan.some(b=>b.type==="line"&&b.ground)?yr(i.metersPerTile):void 0;for(let b of i.plan){if(!lu(b,i.zoom,i.sourceMaxZoom))continue;let g=c.layers[b.sourceLayer];if(!g)continue;let v=su(i.zoom,g.extent);try{if(b.splitBy){let C=cu(g,b.splitBy,b.filter);if(!C.length)continue;let S=d[b.splitBy]??(d[b.splitBy]=[]);for(let M of C){S.includes(M)||S.push(M);let w={...b,splitBy:void 0,filter:uu(b.filter,b.splitBy,M)},_=hn(w,g,v,i.metersPerTile,p);_&&(u[He(b.id,M)]=_);}continue}if(b.network&&b.type==="line"){for(let C of fu(g,b.filter)){let S=hn(b,g,v,i.metersPerTile,p,C);S&&(u[He(b.id,C)]=S,h.add(C));}continue}let x=hn(b,g,v,i.metersPerTile,p);x&&(u[b.id]=x);}catch(x){m.push(`${b.id}: ${x instanceof Error?x.message:String(x)}`);}}return {type:"loaded",id:i.id,buckets:u,...Object.keys(d).length?{splits:d}:{},...h.size?{levels:[...h].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,...m.length?{failed:m}:{}}}}function au(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 lu(i,e,t){let o=e-1,r=e<t?e+1:24;return !(i.maxzoom<o||i.minzoom>r)}function su(i,e){return i<=6?Math.max(64,e/24):0}function hn(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:qn/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=br(e,e.extent,i.filter,{metersPerUnit:o>0?o/e.extent:0,maxSegment:t,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=>gr(r,s,i.elevation??0,e.extent)}:{},...i.groundBy?{liftBy:au(i.groundBy)}:{}});return l?{kind:"surface",...l}:null}if(i.type==="line"){let l=wr(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=dl(e,i.filter);return l?{kind:"placement",...l,extent:e.extent}:null}if(i.type==="symbol"){let l=dn(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=sr(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 cu(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 fu(i,e){let t=[];for(let o of i.features()){if(!pe(e,o.properties))continue;let r=tt(o.properties);t.includes(r)||t.push(r);}return t.sort((o,r)=>o-r)}function uu(i,e,t){let o=["==",e,t];return i?["all",i,o]:o}var mn='"use strict";(()=>{var ur=Object.create;var Kt=Object.defineProperty;var lr=Object.getOwnPropertyDescriptor;var cr=Object.getOwnPropertyNames;var fr=Object.getPrototypeOf,ar=Object.prototype.hasOwnProperty;var hr=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var pr=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of cr(e))!ar.call(t,i)&&i!==n&&Kt(t,i,{get:()=>e[i],enumerable:!(r=lr(e,i))||r.enumerable});return t};var mr=(t,e,n)=>(n=t!=null?ur(fr(t)):{},pr(e||!t||!t.__esModule?Kt(n,"default",{value:t,enumerable:!0}):n,t));var An=hr((Gt,Nt)=>{(function(t,e){typeof Gt=="object"&&typeof Nt<"u"?Nt.exports=e():typeof define=="function"&&define.amd?define(e):(t=typeof globalThis<"u"?globalThis:t||self,t.polygonClipping=e())})(Gt,function(){"use strict";function t(y,o){var u={label:0,sent:function(){if(h[0]&1)throw h[1];return h[1]},trys:[],ops:[]},f,p,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,p&&(h=M[0]&2?p.return:M[0]?p.throw||((h=p.return)&&h.call(p),0):p.next)&&!(h=h.call(p,M[1])).done)return h;switch(p=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++,p=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(y,u)}catch(V){M=[6,V],p=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 y(o,u){this.next=null,this.key=o,this.data=u,this.left=null,this.right=null}return y}();function n(y,o){return y>o?1:y<o?-1:0}function r(y,o,u){for(var f=new e(null,null),p=f,h=f;;){var S=u(y,o.key);if(S<0){if(o.left===null)break;if(u(y,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(y,o.right.key)>0){var v=o.right;if(o.right=v.left,v.left=o,o=v,o.right===null)break}p.right=o,p=o,o=o.right}else break}return p.right=o.left,h.left=o.right,o.left=f.right,o.right=f.left,o}function i(y,o,u,f){var p=new e(y,o);if(u===null)return p.left=p.right=null,p;u=r(y,u,f);var h=f(y,u.key);return h<0?(p.left=u.left,p.right=u,u.left=null):h>=0&&(p.right=u.right,p.left=u,u.right=null),p}function s(y,o,u){var f=null,p=null;if(o){o=r(y,o,u);var h=u(o.key,y);h===0?(f=o.left,p=o.right):h<0?(p=o.right,o.right=null,f=o):(f=o.left,o.left=null,p=o)}return{left:f,right:p}}function l(y,o,u){return o===null?y:(y===null||(o=r(y.key,o,u),o.left=y),o)}function c(y,o,u,f,p){if(y){f(""+o+(u?"\\u2514\\u2500\\u2500 ":"\\u251C\\u2500\\u2500 ")+p(y)+`\n`);var h=o+(u?" ":"\\u2502 ");y.left&&c(y.left,h,!1,f,p),y.right&&c(y.right,h,!0,f,p)}}var a=function(){function y(o){o===void 0&&(o=n),this._root=null,this._size=0,this._comparator=o}return y.prototype.insert=function(o,u){return this._size++,this._root=i(o,u,this._root,this._comparator)},y.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 p=this._comparator,h=r(o,this._root,p),S=p(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},y.prototype.remove=function(o){this._root=this._remove(o,this._root,this._comparator)},y.prototype._remove=function(o,u,f){var p;if(u===null)return null;u=r(o,u,f);var h=f(o,u.key);return h===0?(u.left===null?p=u.right:(p=r(o,u.left,f),p.right=u.right),this._size--,p):u},y.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},y.prototype.findStatic=function(o){for(var u=this._root,f=this._comparator;u;){var p=f(o,u.key);if(p===0)return u;p<0?u=u.left:u=u.right}return null},y.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},y.prototype.contains=function(o){for(var u=this._root,f=this._comparator;u;){var p=f(o,u.key);if(p===0)return!0;p<0?u=u.left:u=u.right}return!1},y.prototype.forEach=function(o,u){for(var f=this._root,p=[],h=!1;!h;)f!==null?(p.push(f),f=f.left):p.length!==0?(f=p.pop(),o.call(u,f),f=f.right):h=!0;return this},y.prototype.range=function(o,u,f,p){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(p,v))return this;v=v.right}return this},y.prototype.keys=function(){var o=[];return this.forEach(function(u){var f=u.key;return o.push(f)}),o},y.prototype.values=function(){var o=[];return this.forEach(function(u){var f=u.data;return o.push(f)}),o},y.prototype.min=function(){return this._root?this.minNode(this._root).key:null},y.prototype.max=function(){return this._root?this.maxNode(this._root).key:null},y.prototype.minNode=function(o){if(o===void 0&&(o=this._root),o)for(;o.left;)o=o.left;return o},y.prototype.maxNode=function(o){if(o===void 0&&(o=this._root),o)for(;o.right;)o=o.right;return o},y.prototype.at=function(o){for(var u=this._root,f=!1,p=0,h=[];!f;)if(u)h.push(u),u=u.left;else if(h.length>0){if(u=h.pop(),p===o)return u;p++,u=u.right}else f=!0;return null},y.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 p=this._comparator;u;){var h=p(o.key,u.key);if(h===0)break;h<0?(f=u,u=u.left):u=u.right}return f},y.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 p=this._comparator;u;){var h=p(o.key,u.key);if(h===0)break;h<0?u=u.left:(f=u,u=u.right)}return f},y.prototype.clear=function(){return this._root=null,this._size=0,this},y.prototype.toList=function(){return g(this._root)},y.prototype.load=function(o,u,f){u===void 0&&(u=[]),f===void 0&&(f=!1);var p=o.length,h=this._comparator;if(f&&E(o,u,0,p-1,h),this._root===null)this._root=m(o,u,0,p),this._size=p;else{var S=b(this.toList(),x(o,u),h);p=this._size+p,this._root=d({head:S},0,p)}return this},y.prototype.isEmpty=function(){return this._root===null},Object.defineProperty(y.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(y.prototype,"root",{get:function(){return this._root},enumerable:!0,configurable:!0}),y.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("")},y.prototype.update=function(o,u,f){var p=this._comparator,h=s(o,this._root,p),S=h.left,v=h.right;p(o,u)<0?v=i(u,f,v,p):S=i(u,f,S,p),this._root=l(S,v,p)},y.prototype.split=function(o){return s(o,this._root,this._comparator)},y.prototype[Symbol.iterator]=function(){var o,u,f;return t(this,function(p){switch(p.label){case 0:o=this._root,u=[],f=!1,p.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 p.sent(),o=o.right,[3,5];case 4:f=!0,p.label=5;case 5:return[3,1];case 6:return[2]}})},y}();function m(y,o,u,f){var p=f-u;if(p>0){var h=u+Math.floor(p/2),S=y[h],v=o[h],F=new e(S,v);return F.left=m(y,o,u,h),F.right=m(y,o,h+1,f),F}return null}function x(y,o){for(var u=new e(null,null),f=u,p=0;p<y.length;p++)f=f.next=new e(y[p],o[p]);return f.next=null,u.next}function g(y){for(var o=y,u=[],f=!1,p=new e(null,null),h=p;!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,p.next}function d(y,o,u){var f=u-o;if(f>0){var p=o+Math.floor(f/2),h=d(y,o,p),S=y.head;return S.left=h,y.head=y.head.next,S.right=d(y,p+1,u),S}return null}function b(y,o,u){for(var f=new e(null,null),p=f,h=y,S=o;h!==null&&S!==null;)u(h.key,S.key)<0?(p.next=h,h=h.next):(p.next=S,S=S.next),p=p.next;return h!==null?p.next=h:S!==null&&(p.next=S),f.next}function E(y,o,u,f,p){if(!(u>=f)){for(var h=y[u+f>>1],S=u-1,v=f+1;;){do S++;while(p(y[S],h)<0);do v--;while(p(y[v],h)>0);if(S>=v)break;var F=y[S];y[S]=y[v],y[v]=F,F=o[S],o[S]=o[v],o[v]=F}E(y,o,u,v,p),E(y,o,v+1,f,p)}}let A=(y,o)=>y.ll.x<=o.x&&o.x<=y.ur.x&&y.ll.y<=o.y&&o.y<=y.ur.y,_=(y,o)=>{if(o.ur.x<y.ll.x||y.ur.x<o.ll.x||o.ur.y<y.ll.y||y.ur.y<o.ll.y)return null;let u=y.ll.x<o.ll.x?o.ll.x:y.ll.x,f=y.ur.x<o.ur.x?y.ur.x:o.ur.x,p=y.ll.y<o.ll.y?o.ll.y:y.ll.y,h=y.ur.y<o.ur.y?y.ur.y:o.ur.y;return{ll:{x:u,y:p},ur:{x:f,y:h}}},R=Number.EPSILON;R===void 0&&(R=Math.pow(2,-52));let L=R*R,k=(y,o)=>{if(-R<y&&y<R&&-R<o&&o<R)return 0;let u=y-o;return u*u<L*y*o?0:y<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 p=this.tree.next(u);return p!==null&&k(u.key,p.key)===0?(this.tree.remove(o),p.key):o}}let D=new T,U=11102230246251565e-32,P=134217729,C=(3+8*U)*U;function Y(y,o,u,f,p){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<y&&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&&(p[B++]=v);w<y&&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&&(p[B++]=v);for(;w<y;)S=h+M,F=S-h,v=h-(S-F)+(M-F),M=o[++w],h=S,v!==0&&(p[B++]=v);for(;I<u;)S=h+V,F=S-h,v=h-(S-F)+(V-F),V=f[++I],h=S,v!==0&&(p[B++]=v);return(h!==0||B===0)&&(p[B++]=h),B}function Q(y,o){let u=o[0];for(let f=1;f<y;f++)u+=o[f];return u}function Z(y){return new Float64Array(y)}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(y,o,u,f,p,h,S){let v,F,M,V,w,I,B,H,G,W,j,ne,ae,ue,he,pe,ge,me,Se=y-p,Ee=u-p,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=y-Se,v=y-(Se+w)+(w-p),w=u-Ee,M=u-(Ee+w)+(w-p),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 ir=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 or=Y(ir,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 sr=Y(or,q,4,K,te);return te[sr-1]}function ee(y,o,u,f,p,h){let S=(o-h)*(u-p),v=(y-p)*(f-h),F=S-v,M=Math.abs(S+v);return Math.abs(F)>=re*M?F:-oe(y,o,u,f,p,h,M)}let J=(y,o)=>y.x*o.y-y.y*o.x,fe=(y,o)=>y.x*o.x+y.y*o.y,be=(y,o,u)=>{let f=ee(y.x,y.y,o.x,o.y,u.x,u.y);return f>0?-1:f<0?1:0},de=y=>Math.sqrt(fe(y,y)),Fe=(y,o,u)=>{let f={x:o.x-y.x,y:o.y-y.y},p={x:u.x-y.x,y:u.y-y.y};return J(p,f)/de(p)/de(f)},Ce=(y,o,u)=>{let f={x:o.x-y.x,y:o.y-y.y},p={x:u.x-y.x,y:u.y-y.y};return fe(p,f)/de(p)/de(f)},Le=(y,o,u)=>o.y===0?null:{x:y.x+o.x/o.y*(u-y.y),y:u},Ve=(y,o,u)=>o.x===0?null:{x:u,y:y.y+o.y/o.x*(u-y.x)},we=(y,o,u,f)=>{if(o.x===0)return Ve(u,f,y.x);if(f.x===0)return Ve(y,o,u.x);if(o.y===0)return Le(u,f,y.y);if(f.y===0)return Le(y,o,u.y);let p=J(o,f);if(p==0)return null;let h={x:u.x-y.x,y:u.y-y.y},S=J(h,o)/p,v=J(h,f)/p,F=y.x+v*o.x,M=u.x+S*f.x,V=y.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,p=u.length;f<p;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 p=u+1;p<o;p++){let h=this.point.events[p];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 p=this.point.events[u];p!==this&&!p.segment.ringOut&&p.segment.isInResult()&&o.push(p)}return o}getLeftmostComparator(o){let u=new Map,f=p=>{let h=p.otherSE;u.set(p,{sine:Fe(this.point,o.point,h.point),cosine:Ce(this.point,o.point,h.point)})};return(p,h)=>{u.has(p)||f(p),u.has(h)||f(h);let{sine:S,cosine:v}=u.get(p),{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,p=u.leftSE.point.x,h=o.rightSE.point.x,S=u.rightSE.point.x;if(S<f)return 1;if(h<p)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<p){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>p){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-p;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,p){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=p}static fromRing(o,u,f){let p,h,S,v=se.comparePoints(o,u);if(v<0)p=o,h=u,S=1;else if(v>0)p=u,h=o,S=-1;else throw new Error(`Tried to create degenerate segment at [${o.x}, ${o.y}]`);let F=new se(p,!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,p=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)/p.y,S=u.x+h*p.x;if(o.x===S)return 0;let v=(o.x-u.x)/p.x,F=u.y+v*p.y;return o.y===F?0:o.y<F?-1:1}getIntersection(o){let u=this.bbox(),f=o.bbox(),p=_(u,f);if(p===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(p,B)?null:D.round(B.x,B.y)}split(o){let u=[],f=o.events!==void 0,p=new se(o,!0),h=new se(o,!1),S=this.rightSE;this.replaceRightSE(h),u.push(h),u.push(p);let v=new xe(p,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&&(p.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 p=xe.compare(u,f);if(p!==0){if(p>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,p=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;p.indexOf(M)===-1&&p.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,p=u.length===0;this._isInResult=f!==p;break}case"intersection":{let f,p;o.length<u.length?(f=o.length,p=u.length):(f=u.length,p=o.length),this._isInResult=p===ve.numMultiPolys&&f<p;break}case"xor":{let f=Math.abs(o.length-u.length);this._isInResult=f%2===1;break}case"difference":{let f=p=>p.length===1&&p[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 p=D.round(o[0][0],o[0][1]);this.bbox={ll:{x:p.x,y:p.y},ur:{x:p.x,y:p.y}};let h=p;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)}(p.x!==h.x||p.y!==h.y)&&this.segments.push(xe.fromRing(h,p,this))}getSweepEvents(){let o=[];for(let u=0,f=this.segments.length;u<f;u++){let p=this.segments[u];o.push(p.leftSE),o.push(p.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,p=o.length;f<p;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 p=this.interiorRings[u].getSweepEvents();for(let h=0,S=p.length;h<S;h++)o.push(p[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,p=o.length;f<p;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 p=this.polys[u].getSweepEvents();for(let h=0,S=p.length;h<S;h++)o.push(p[h])}return o}}class Ie{static factory(o){let u=[];for(let f=0,p=o.length;f<p;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],p=u[1];be(f,o,p)===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 p=1,h=this.events.length;p<h;p++){let S=this.events[p];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 p=this.interiorRings[u].getGeom();p!==null&&o.push(p)}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 p=this.polys[u].getGeom();p!==null&&o.push(p)}return o}_composePolys(o){let u=[];for(let f=0,p=o.length;f<p;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 p=o.isLeft?this.tree.add(u):this.tree.find(u);if(!p)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=p,S=p,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 p=o.split(u);return p.push(f),o.consumedBy===void 0&&this.tree.add(o),p}}let Qt=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,tr=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6;class nr{run(o,u,f){ve.type=o,D.reset();let p=[new De(u,!0)];for(let w=0,I=f.length;w<I;w++)p.push(new De(f[w],!1));if(ve.numMultiPolys=p.length,ve.type==="difference"){let w=p[0],I=1;for(;I<p.length;)_(p[I].bbox,w.bbox)!==null?I++:p.splice(I,1)}if(ve.type==="intersection")for(let w=0,I=p.length;w<I;w++){let B=p[w];for(let H=w+1,G=p.length;H<G;H++)if(_(B.bbox,p[H].bbox)===null)return[]}let h=new a(se.compare);for(let w=0,I=p.length;w<I;w++){let B=p[w].getSweepEvents();for(let H=0,G=B.length;H<G;H++)if(h.insert(B[H]),h.size>Qt)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>Qt)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big).");if(S.segments.length>tr)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 nr;var rr={union:function(y){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",y,u)},intersection:function(y){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",y,u)},xor:function(y){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",y,u)},difference:function(y){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",y,u)}};return rr})});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=tn(t,0,i,n,!0),l=[];if(!s||s.next===s.prev)return l;let c=0,a=0,m=0;if(r&&(s=br(t,e,s,n)),t.length>80*n){c=t[0],a=t[1];let x=c,g=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>g&&(g=E)}m=Math.max(x-c,g-a),m=m!==0?32767/m:0}return Et(s,l,c,a,m),l}function tn(t,e,n,r,i){let s=null;if(i===Lr(t,e,n,r)>0)for(let l=e;l<n;l+=r)s=en(l/r|0,t[l],t[l+1],s);else for(let l=n-r;l>=e;l-=r)s=en(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&&Fr(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?dr(t,n,r,i):xr(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=gr(t,e),s=t,l=!0;continue}yr(t,e,n,r,i);break}}}function xr(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,m=r.y,x=Math.min(i,s,l),g=Math.min(c,a,m),d=Math.max(i,s,l),b=Math.max(c,a,m),E=r.next;for(;E!==e;){if(E.x>=x&&E.x<=d&&E.y>=g&&E.y<=b&&!(i===E.x&&c===E.y)&&mt(i,c,s,a,l,m,E.x,E.y)&&le(E.prev,E,E.next)>=0)return!1;E=E.next}return!0}function dr(t,e,n,r){let i=t.prev,s=t,l=t.next,c=i.x,a=s.x,m=l.x,x=i.y,g=s.y,d=l.y,b=Math.min(c,a,m),E=Math.min(x,g,d),A=Math.max(c,a,m),_=Math.max(x,g,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,g,m,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,g,m,d,T.x,T.y)&&le(T.prev,T,T.next)>=0)return!1;T=T.nextZ}return!0}function gr(t,e){let n=t,r=!1;do{let i=n.prev,s=n.next.next;on(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 yr(t,e,n,r,i){let s=t;do{let l=s.next.next;for(;l!==s.prev;){if(s.i!==l.i&&kr(s,l)){let c=sn(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 br(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,m=tn(t,c,a,r,!1);m===m.next&&nt.add(m),i.push(Pr(m))}i.sort(wr),Sr(t.length/r,e.length),rn(n,n),Mt=!0;for(let s=0;s<i.length;s++)n=vr(i[s],n);return Mt=!1,Ge(n)}function wr(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 vr(t,e){let n=Mr(t,e);if(!n)return e;let r=sn(n,t),i=r.next;return rn(n,i.next),Ge(r,r.next),Ge(n,n.next)}var nn=16,ie=new Float64Array(0),pt=0,Rt=[],Ft=[];function Sr(t,e){let n=Math.ceil((t+2*e)/nn)+e+2;ie.length<n*4&&(ie=new Float64Array(n*4)),pt=0}function rn(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<nn&&n!==e);Ft[r]=n;let m=r*4;ie[m]=i,ie[m+1]=s,ie[m+2]=l,ie[m+3]=c}while(n!==e)}function Er(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 Jt(t){let e=Ft[t];for(;e.prev.next!==e;)e=e.next;return Ft[t]=e,e}function qt(t){let e=Rt[t];for(;e.prev.next!==e;)e=e.next;return Rt[t]=e,e}function Mr(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=Jt(d);n=qt(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,m=Math.min(i,a),x=Math.max(i,a),g=1/0;for(let d=0,b=0;d<pt;d++,b+=4){if(ie[b+2]<c||ie[b]>r||ie[b+3]<m||ie[b+1]>x)continue;let E=Jt(d);n=qt(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<g||A===g&&(n.x>l.x||n.x===l.x&&Rr(l,n)))&&(l=n,g=A)}n=n.next}while(n!==E)}return l}function Rr(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 Fr(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);Ir(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 Ir(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],m=tt[a>>>s&255]++;r[m]=e[c],i[m]=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 Pr(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 kr(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))&&!_r(t,e)&&(n||Ar(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 on(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 _r(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&&on(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 Ar(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 sn(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 en(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&&Er(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 Lr(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 un=23283064365386963e-26,Br=12,ln=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,Tr(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>=Br&&ln?ln.decode(this.buf.subarray(n,e)):Yr(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*un),!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*un),!0),this.pos+=8}writeVarint(e){if(e=+e||0,e>268435455||e<0){Cr(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=Zr(this.buf,e,this.pos);let r=this.pos-n;r>=128&&cn(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&&cn(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,Dr,n)}writePackedSVarint(e,n){n.length&&this.writeMessage(e,Ur,n)}writePackedBoolean(e,n){n.length&&this.writeMessage(e,zr,n)}writePackedFloat(e,n){n.length&&this.writeMessage(e,Gr,n)}writePackedDouble(e,n){n.length&&this.writeMessage(e,Nr,n)}writePackedFixed32(e,n){n.length&&this.writeMessage(e,Hr,n)}writePackedSFixed32(e,n){n.length&&this.writeMessage(e,$r,n)}writePackedFixed64(e,n){n.length&&this.writeMessage(e,jr,n)}writePackedSFixed64(e,n){n.length&&this.writeMessage(e,Xr,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 Tr(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 Cr(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),Vr(n,r,e),Or(r,e)}function Vr(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 Or(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 cn(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 Dr(t,e){for(let n=0;n<t.length;n++)e.writeVarint(t[n])}function Ur(t,e){for(let n=0;n<t.length;n++)e.writeSVarint(t[n])}function Gr(t,e){for(let n=0;n<t.length;n++)e.writeFloat(t[n])}function Nr(t,e){for(let n=0;n<t.length;n++)e.writeDouble(t[n])}function zr(t,e){for(let n=0;n<t.length;n++)e.writeBoolean(t[n])}function Hr(t,e){for(let n=0;n<t.length;n++)e.writeFixed32(t[n])}function $r(t,e){for(let n=0;n<t.length;n++)e.writeSFixed32(t[n])}function jr(t,e){for(let n=0;n<t.length;n++)e.writeFixed64(t[n])}function Xr(t,e){for(let n=0;n<t.length;n++)e.writeSFixed64(t[n])}function Yr(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,m,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],m=t[i+2],(a&192)===128&&(m&192)===128&&(l=(s&15)<<12|(a&63)<<6|m&63,(l<=2047||l>=55296&&l<=57343)&&(l=null))):c===4&&(a=t[i+1],m=t[i+2],x=t[i+3],(a&192)===128&&(m&192)===128&&(x&192)===128&&(l=(s&15)<<18|(a&63)<<12|(m&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 Zr(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(Wr,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=[],m=[];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&&(m.length&&a.push(m),m=[]),m.push(l,c);else if(i===7)m.length>=2&&m.push(m[0],m[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 m.length&&a.push(m),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 Wr(t,e,n){n&&(t===1?e.id=n.readVarint():t===2?Qr(n,e):t===3?e.type=n.readVarint():t===4&&(e.geomOffset=n.pos,n.skip(2)))}function Qr(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(Kr,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 Kr(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(Jr(n)))}function Jr(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=qr(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 qr(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 ei=Math.PI/8,ti=.35,ni=32,fn=.25,an=.5,hn=.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??ti,0),l=e.extent,c=e.margin??0,a=[];for(let m=0;m<r;m++){let x=t[m*2],g=t[m*2+1],d=t[(m+r-1)%r*2],b=t[(m+r-1)%r*2+1],E=t[(m+1)%r*2],A=t[(m+1)%r*2+1],_=x-d,R=g-b,L=E-x,k=A-g,T=Math.hypot(_,R),O=Math.hypot(L,k);if(T<1e-6||O<1e-6){a.push(x,g);continue}let D=_/T,U=R/T,P=L/O,C=k/O;if(e.keep?.[m]){a.push(x,g);continue}let Y=D*P+U*C;if(Y>.985){a.push(x,g);continue}if(l!==void 0&&(Lt(x,g,l,c)||Lt(d,b,l,c)||Lt(E,A,l,c))){a.push(x,g);continue}let Q=Math.min(n,T*.4,O*.4);if(Q<n*s){a.push(x,g);continue}let Z=x-D*Q,re=g-U*Q,X=x+P*Q,$=g+C*Q,z=Math.acos(Math.max(-1,Math.min(1,Y))),N=Math.min(ei,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(ni,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*g+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=pn(t.outer,e,n);if(!r)return null;let i=[];for(let s of t.holes){let l=pn(s,e,n);l&&i.push(l)}return{outer:r,holes:i}}function pn(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],m=s[c*2+1],x=s[(c+l-1)%l*2],g=s[(c+l-1)%l*2+1],d=mn(a,m,i,e,n),b=mn(x,g,i,e,n);if(d!==b){let E=ri(x,g,a,m,i,e,n);r.push(x+(a-x)*E,g+(m-g)*E)}d&&r.push(a,m)}}return r.length<6?null:(r.push(r[0],r[1]),r)}function mn(t,e,n,r,i){return n===0?t>=-i:n===1?t<=r+i:n===2?e>=-i:e<=r+i}function ri(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 xn(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=32,dn=8,Sn=65535/Vt,ii=9,oi=1,si=0,ui=1,li=2;var gn=0,ci=1,yn=2,fi=3,ai=.47;function En(t,e,n,r={}){let i=r.metersPerUnit&&r.metersPerUnit>0?r.metersPerUnit:ai,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=Li(d.properties),E=Bi(d.properties,b);if(b<=E)continue;let A=Ci(d.properties)??Number(d.id??0),_=Ai(A>>>0),R=_i(_,d.properties),L=ki(d.properties,b),k=$e(d.loadGeometry());for(let T of k){let O=je(T,e);if(!O)continue;let D=xn(O.outer,e),U=(r.cornerRadius??0)/i,P={radius:U,segments:r.cornerSegments,extent:e,minCutRatio:0,maxChord:i>0?an/i: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:xi(C.outer),Z=Q?vi(d.properties,Q,b,_,i):null,re=null,X=[];if(Z&&Q){let $=Mn(Mi(C.outer,i),Q,Z.shape);X=Ri($,C.outer);let z=Fi($,X);if(z>1e-6){let N=Math.min(Math.max(z*i*yi,wi),bi);re=Ii($,N/z,b)}}wn(c,C.outer,E,b,A,R,L,i,e,re);for(let $ of C.holes)wn(c,$,E,b,A,R,L,i,e,null);re?Pi(c,X,re,b,A,R,L,i):mi(c,C.outer,C.holes,b,A,R,L)}}if(!c.indices.length)return null;let m=new Uint32Array(c.indices),x=new Float64Array(c.featureIds);return{vertices:l.slice(0,c.vertOffset),indices:m.buffer,featureIds:x.buffer,vertexCount:c.vertexCount,indexCount:m.length,extent:e}}var Ot=(t,e)=>t|e<<2,bn=t=>Math.max(-32768,Math.min(32767,t)),Bt=t=>Math.max(0,Math.min(65535,Math.round(Math.min(t,Sn)*Vt)));function Xe(t,e,n,r,i,s,l,c,a,m,x=0,g=0,d=0){let b=t.vertOffset;return t.verts.setInt16(b,bn(Math.round(e*dn)),!0),t.verts.setInt16(b+2,bn(Math.round(n*dn)),!0),t.verts.setUint16(b+4,Math.round(Math.min(r,Sn)*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]=m,t.verts.setUint16(b+12,Bt(x),!0),t.verts.setUint16(b+14,Bt(g),!0),t.verts.setUint16(b+16,Bt(d),!0),t.vertOffset+=Ct,t.vertexCount++}function wn(t,e,n,r,i,s,l,c,a,m=null){let x=e.length/2;if(x<3)return;let g=Ot(si,l),d=pi(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(m){for(let X=0;X<m.length;X++)for(let $=X+1;$<m.length;$++){let z=Ne(m[X],R,L)-Ne(m[$],R,L),N=Ne(m[X],k,T)-Ne(m[$],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(!m)return r;let z=1/0;for(let N of m)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,g,oe,Q,b),ze=Xe(t,te,K,n,Oe,De,0,0,s,g,ee,Q,b),vt=Xe(t,N,q,re(N,q),xe,Be,0,255,s,g,oe,Q,b),ft=Xe(t,te,K,re(te,K),Oe,De,0,255,s,g,ee,Q,b);t.indices.push(Ie,ft,ze,Ie,vt,ft),t.featureIds.push(i,i)}}}var hi=.9976;function pi(t,e){let n=t.length/2-1,r=[];for(let a=0;a<n;a++){let m=t[a*2+2]-t[a*2],x=t[a*2+3]-t[a*2+1],g=Math.hypot(m,x);r.push(g>0?{x:m/g,y:x/g,len:g*e}:{x:0,y:0,len:0})}let i=(a,m)=>r[a].len>0&&r[m].len>0&&r[a].x*r[m].x+r[a].y*r[m].y>=hi,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 m=(s+a)%n,x=[m],g=r[m].len,d=a+1;for(;d<n;){let E=(s+d)%n;if(!i((s+d-1)%n,E))break;x.push(E),g+=r[E].len,d++}let b=0;for(let E of x)l[E]=b,c[E]=g,b+=r[E].len;a=d}return{offset:l,width:c}}function mi(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 m=Te(c,a.length?a:void 0,2);if(!m.length)return;let x=Ot(ui,l),g=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<m.length;d+=3)t.indices.push(g+m[d],g+m[d+2],g+m[d+1]),t.featureIds.push(i)}function xi(t){let e=di(t);if(e.length<3)return null;let n=Math.abs(gi(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,m=Math.hypot(c,a);if(m<1e-6)continue;c/=m,a/=m;let x=1/0,g=-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>g&&(g=O),D<d&&(d=D),D>b&&(b=D)}let E=g-x,A=b-d,_=E*A;if(_<=0||_>=i)continue;i=_;let R=(x+g)/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 di(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 gi(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 yi=Math.tan(30*Math.PI/180),bi=3.5,wi=.9;function vi(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,m=Si(t);if(!m){if(n>15||c>600||s<3)return null;let x=r%1e3/1e3;c<30?m=x<.5?"skillion":"gabled":a<1.25?m=x<.35?"pyramidal":"hipped":m=x<.8?"gabled":"hipped"}return m==="flat"?null:{shape:m}}function Si(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 Ei(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,m]=l(c),[x,g]=l((c+i-1)%i),d=e*a+n*m+r,b=e*x+n*g+r;if(d<=0!=b<=0){let E=b/(b-d);s.push(x+(a-x)*E,g+(m-g)*E)}d<=0&&s.push(a,m)}return s}function Mi(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],m=t[l*2],x=t[l*2+1],g=m-c,d=x-a,b=Math.hypot(g,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)*g)/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 Mn(t,e,n){let{ax:r,ay:i,halfLong:s}=e;if(n==="skillion"){let a=-i,m=r;return[{a,b:m,c:-(a*e.cx+m*e.cy)+e.halfShort}]}let l=[],c=t.length/2-1;for(let a=0;a<c;a++){let m=t[a*2],x=t[a*2+1],g=t[(a+1)%c*2],d=t[(a+1)%c*2+1],b=g-m,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:-(_*m+R*x)})}return!l.length&&s>0?Mn(t,e,"hipped"):l}function Ri(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=Ei(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 Fi(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 Ii(t,e,n){return t.map(r=>({a:r.a*e,b:r.b*e,c:r.c*e+n}))}function Pi(t,e,n,r,i,s,l,c){let a=Ot(li,l);for(let m=0;m<n.length;m++){let x=e[m];if(!x||x.length<6)continue;let g=Te(x,void 0,2);if(!g.length)continue;let d=-n[m].a/c,b=-n[m].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[m],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<g.length;R+=3)t.indices.push(_+g[R],_+g[R+2],_+g[R+1]),t.featureIds.push(i)}}function ki(t,e){let n=String(t.class??"").toLowerCase();return n==="industrial"||n==="warehouse"||n==="hangar"||n==="construction"?fi:n==="commercial"||n==="office"||n==="retail"||n==="supermarket"?yn:n==="house"||n==="detached"||n==="garage"||n==="hut"||n==="shed"||e<=7?gn:e>=40?yn:ci}function _i(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 Ai(t){let e=t>>>0;return e=(e>>>16^e)*73244475,e=(e>>>16^e)*73244475,e=e>>>16^e,e>>>0}function Li(t){let e=Ye(t.render_height)??Ye(t.height)??Ti(t.levels??t.building_levels??t["building:levels"]);return e&&e>0?Math.max(e,oi):ii}function Bi(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 Ti(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 Ci(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 Dt(t,e,n,r,i){let s=r*r,l=[],c=x=>t[x*2],a=x=>t[x*2+1],m=(x,g)=>{let d=t.length/2;return t.push((c(x)+c(g))/2,(a(x)+a(g))/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 g=0;for(;l.length&&!(++g>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=m(d,b);l.push([d,k,E],[k,b,E])}else if(L===_){let k=m(b,E);l.push([b,k,d],[k,E,d])}else{let k=m(E,d);l.push([E,k,b],[k,d,b])}}}}function Rn(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=[];Dt(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 m=l.length/2,x=new Int16Array(l),g=new Uint32Array(c);return{featureIds:new Float64Array(a).buffer,vertices:x.buffer,indices:g.buffer,vertexCount:m,indexCount:g.length}}function In(t){return{shapes:[],cells:[],extent:0,metersPerTile:t}}function Pn(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,m=-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]>m&&(m=s[x+1]);t.shapes.push({outer:s,holes:i.holes,level:n,minX:l,minY:c,maxX:a,maxY:m})}t.cells=[]}}function Vi(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 m=i;m<=s;m++)t.cells[a*32+m].push(n)}}var kn=t=>t.shapes.length===0;function Ut(t,e,n){!t.cells.length&&t.shapes.length&&Vi(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||!Fn(c.outer,e,n))continue;let a=!1;for(let m of c.holes)if(Fn(m,e,n)){a=!0;break}a||(s=c.level)}return Math.min(Math.round(s*100),127)}function _n(t,e){let n=[],r=[],i=t.extent>0?t.metersPerTile/t.extent:0,s=i>0?2/i:0,l=Ut(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],m=e[c+1],x=e[c+2],g=e[c+3],d=Ut(t,x,g);if(d!==l&&s>0){let b=Math.hypot(x-a,g-m),E=Math.min(Math.ceil(b/s),64),A=l;for(let _=1;_<E;_++){let R=_/E,L=a+(x-a)*R,k=m+(g-m)*R,T=Ut(t,L,k);T!==A&&(n.push(L,k),r.push(T),A=T)}}n.push(x,g),r.push(d),l=d}return{pts:n,levels:r}}var Ze=t=>t<0?0:t>31?31:t;function Fn(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],m=t[l*2],x=t[l*2+1];a>n!=x>n&&e<(m-c)*(n-a)/(x-a)+c&&(r=!r)}return r}var Tn=mr(An(),1);function Ln(t){let e=[];for(let n=0;n+1<t.length;n+=2)e.push([t[n],t[n+1]]);return e}function Bn(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 Cn(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(g=>({outer:e(g.outer,-n)??g.outer,holes:g.holes.map(d=>e(d,n)??d)})):l).map(g=>[Ln(g.outer),...g.holes.map(Ln)]),m;try{m=Tn.union(a[0],...a.slice(1))}catch{i.push(...l);continue}let x=m;if(!Array.isArray(x)||x.length===0){i.push(...l);continue}for(let g of x){if(!g.length)continue;let d=Bn(g[0]);if(d.length<8)continue;let b=[];for(let E=1;E<g.length;E++){let A=Bn(g[E]);A.length>=8&&b.push(A)}i.push(s?{outer:d,holes:b,lift:s}:{outer:d,holes:b})}}return i}var Xt=16,Oi=64,Nn=0,Di=1,Vn=2,Ui=3,bt=1,Gi=.6;function zn(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),m=Math.max(r.cornerRadius??0,0)/i,x=Math.max(512,t.length*24),g=new ArrayBuffer(x*Xt),d={view:new DataView(g),bytes:new Uint8Array(g),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*Xt);new Uint8Array(C).set(d.bytes.subarray(0,d.offset)),g=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??Gi,0),R=Cn(b,(P,C)=>Ht(P,C,e,A),_/i),L=_>0?R.map(P=>({...P,outer:Gn(P.outer,_/i,e),holes:P.holes.map(C=>Gn(C,_/i,e))})):R;for(let P of L){On(P.outer,E);for(let C of P.holes)On(C,E)}r.onShapes?.(L);let k=new Set;for(let[P,C]of E)C>1&&k.add(P);let T=[],O={radius:m,segments:r.cornerSegments,extent:e,margin:Ae(e),minCutRatio:0,maxChord:fn/i};for(let P of L){let C=m>0?{outer:_e(P.outer,{...O,keep:Dn(P.outer,k)}),holes:P.holes.map(N=>_e(N,{...O,keep:Dn(N,k)}))}:P,Y=c>0?Ht(C.outer,c,e,k):C.outer,Q=C.holes.map(N=>c>0?Ht(N,-c,e,k):N),Z=P.lift??0,re=s+Z,X=l+Z;Un(d,Y??C.outer,Q.map((N,q)=>N??C.holes[q]),re,Nn,r.maxSegment??0);let $=re,z=re-a;Y&&c>0&&a>0&&zt(d,Y,C.outer,$,z,Di,e,k),z!==X&&zt(d,C.outer,C.outer,z,X,Vn,e,k);for(let N of C.holes)if(z!==X&&zt(d,N,N,z,X,Vn,e,k),re<X){let q=d.indices.length;Un(d,N,[],X,Ui);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:g.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 On(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 Dn(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,Ni(Math.round(r*Oi)),!0),t.view.setInt8(a+10,jt(Math.round(i*127))),t.view.setInt8(a+11,jt(Math.round(s*127))),t.view.setInt8(a+12,jt(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+=Xt,t.count++}function Un(t,e,n,r,i=Nn,s=0){let l=[],c=[];for(let g=0;g<e.length;g++)l.push(e[g]);for(let g of n){c.push(l.length/2);for(let d=0;d<g.length;d++)l.push(g[d])}let a=Te(l,c.length?c:void 0,2);if(!a.length)return;let m=a;if(s>0){let g=[];Dt(l,a,0,s,g),m=g}t.ensure(l.length/2);let x=t.count;for(let g=0;g<l.length;g+=2)lt(t,l[g],l[g+1],r,0,0,1,i);for(let g=0;g<m.length;g+=3)t.indices.push(x+m[g],x+m[g+2],x+m[g+1])}function zt(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 m=0;m<a-1;m++){let x=n[m*2],g=n[m*2+1],d=n[m*2+2],b=n[m*2+3];if(x===d&&g===b||yt(x,g,d,b,l,Ae(l))||c.has(We(x,g,d,b)))continue;let E=d-x,A=b-g,_=Math.hypot(E,A)||1,R=A/_,L=-E/_,k=r-i,T=Math.hypot(e[m*2]-x,e[m*2+1]-g)||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[m*2],e[m*2+1],r,R,L,O,s),U=lt(t,e[m*2+2],e[m*2+3],r,R,L,O,s),P=lt(t,x,g,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 Ht(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 g=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(g-b,d-E)||1,L=Math.hypot(A-g,_-d)||1,k=(d-E)/R,T=-(g-b)/R,O=(_-d)/L,D=-(A-g)/L,U=k+O,P=T+D,C=Math.hypot(U,P);if(C<1e-6){s.push(g,d);continue}U/=C,P/=C;let Y=Math.min(1/Math.max(U*k+P*T,.35),3),Q=g-U*e*Y,Z=d-P*e*Y,re=We(b,E,g,d),X=We(g,d,A,_);if(r.has(re)||r.has(X)){s.push(g,d);continue}let $=-Ae(n),z=n+Ae(n),N=(q,te)=>q<=$||q>=z||te<=$||te>=z;(N(g,d)||N(b,E)||N(A,_))&&(Q=g,Z=d),s.push(Q,Z)}s.push(s[0],s[1]);let l=Math.abs($t(t)),c=$t(s);if(Math.sign(c)!==Math.sign($t(t))||Math.abs(c)<l*.25)return null;let a=-Ae(n),m=n+Ae(n);for(let x=0;x<s.length;x+=2)s[x]=Math.max(a,Math.min(m,s[x])),s[x+1]=Math.max(a,Math.min(m,s[x+1]));return s}function $t(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 jt=t=>t>127?127:t<-127?-127:t,Ni=t=>t>32767?32767:t<-32768?-32768:t;function Gn(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 m=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(;!m[A]&&A!==d;)A=(A+a-1)%a;let _=(d+1)%a;for(;!m[_]&&_!==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&&(m[d]=!1,x--)}if(x===a)break;let g=[];for(let d=0;d<a;d++)m[d]&&g.push(l[d*2],l[d*2+1]);g.push(g[0],g[1]),l=g}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 jn(t,e,n=0,r,i=0,s={}){let{level:l}=s,c=Math.max(256,t.length*24),a=new ArrayBuffer(c*ct),m=new DataView(a),x=0,g=[],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,m=new DataView(k)},b=(L,k,T,O,D,U,P,C=0,Y=0,Q=0)=>{let Z=x*ct;return m.setInt16(Z,L,!0),m.setInt16(Z+2,k,!0),m.setInt16(Z+4,T,!0),m.setInt16(Z+6,O,!0),m.setInt8(Z+8,D),m.setInt8(Z+9,U),m.setInt8(Z+10,C),m.setInt8(Z+11,Y),m.setFloat32(Z+12,P,!0),m.setFloat32(Z+16,Q,!0),x++},E=0,A=i>0?12/i:0,_=A>0?Xi(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?Hi(Hn(O),n):Hn(O);if(D.length<4)continue;let U=r&&!kn(r)?_n(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]);$=Xn(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=zi(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&&ji(q,te,K,oe,t.extent)){z+=ee;continue}let J=$i(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,g.push(Oe,De,Ie,Oe,Ie,ze)}}}if(!g.length)return null;let R=new Uint32Array(g);return{vertices:a.slice(0,x*ct),indices:R.buffer,vertexCount:x,indexCount:R.length}}function zi(t,e,n){let r=[...n].sort((a,m)=>a-m),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 m=t[a],x=t[a+1],g=t[a+2],d=t[a+3],b=Math.hypot(g-m,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(m+(g-m)*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(g,d),s&&e&&s.push(e[a/2+1])}return{pts:i,levels:s}}function Hi(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 m=1;m<a;m++){let x=m/a;n.push(i+(l-i)*x,s+(c-s)*x)}}return n.push(t[t.length-2],t[t.length-1]),n}function Hn(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 $i(t,e,n,r,i){let s=n-t,l=r-e,c=0,a=1,m=[[-s,t],[s,i-t],[-l,e],[l,i-e]];for(let[x,g]of m){if(x===0){if(g<0)return null;continue}let d=g/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 ji(t,e,n,r,i){return t===n&&(t<=0||t>=i)?!0:e===r&&(e<=0||e>=i)}var $n=new WeakMap,wt=(t,e)=>(t+512)*65536+(e+512);function Xn(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 Xi(t){let e=$n.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 m=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 g of[m,x]){let d=g+(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:m,t:x,lv:c,w:l})}}for(let i of r){let s=Xn(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 $n.set(t,n),n}var Yi=[["\\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."]],Yn=new Map(Yi);function Zn(t){let e=t.split(" ");if(e.length<2)return t;let n=!1,r=e.map(s=>{let l=Yn.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=>Yn.get(s.toLowerCase())===void 0).length?t:r.join(" ")}function Qn(t,e){let n=[],r=[],i=[],s=[],l=[],c=e.textPlacement==="line",a=[],m=[],x=[];for(let g of t.features()){if(!ce(e.filter,g.properties))continue;let d=g.loadGeometry(),b=Qi(g.type,d);if(!b)continue;let E=e.textField?Wn(e.textField,g.properties):"",A=E&&e.abbreviate?Zn(E):E,_=e.iconImage?Wn(e.iconImage,g.properties):"";if(!(!A&&!_)){if(c){let R=Wi(g.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(Ki(g.properties)),l.push(e.iconRotate&&Math.round(Number(g.properties[e.iconRotate]??0))||0)}}if(c){for(let{text:g,line:d}of Zi(x)){m.push(a.length/2);for(let b of d)a.push(b);n.push(Math.round(d[0]),Math.round(d[1])),r.push(g),i.push(""),s.push(128),l.push(0)}m.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(m).buffer}:{}}:null}function Zi(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]),m=n.get(a),x=r.get(c);if(x!==void 0){let g=e[x];if(g.line.push(...l.slice(2)),r.delete(c),r.set(i(s,g.line[g.line.length-2],g.line[g.line.length-1]),x),m!==void 0&&m!==x){let d=e[m];g.line.push(...d.line.slice(2)),d.line=[],n.delete(a),r.set(i(s,g.line[g.line.length-2],g.line[g.line.length-1]),x)}continue}if(m!==void 0){let g=e[m];g.line.unshift(...l.slice(0,l.length-2)),n.delete(a),n.set(i(s,g.line[0],g.line[1]),m);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 Wi(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 Qi(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 m of e)for(let x=0;x+3<m.length;x+=2){let g=m[x+2]-m[x],d=m[x+3]-m[x+1],b=g*g+d*d;b>l&&(l=b,c=m[x]+g/2,a=m[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 Ki(t){let e=t.rank;return typeof e=="number"&&isFinite(e)?Math.max(0,255-Math.min(e,255)):128}function Wn(t,e){let n=Array.isArray(t)?t:[t];for(let r of n){let i=!0,l=r.replace(/\\{([^}]+)\\}/g,(c,a)=>{let m=e[a];return m==null||m===""?(i=!1,""):String(m)}).trim();if(i&&l)return l}return""}function Kn(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 Ji="\\u241F",Yt=(t,e)=>t+Ji+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 Jn(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(),m=new gt(l),x=Object.keys(m.layers),g={},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)?In(t.metersPerTile):void 0;for(let R of t.plan){if(!to(R,t.zoom,t.sourceMaxZoom))continue;let L=m.layers[R.sourceLayer];if(!L)continue;let k=no(t.zoom,L.extent);try{if(R.splitBy){let O=ro(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:oo(R.filter,R.splitBy,U)},C=Zt(P,L,k,t.metersPerTile,_);C&&(g[Yt(R.id,U)]=C)}continue}if(R.network&&R.type==="line"){for(let O of io(L,R.filter)){let D=Zt(R,L,k,t.metersPerTile,_,O);D&&(g[Yt(R.id,O)]=D,b.add(O))}continue}let T=Zt(R,L,k,t.metersPerTile,_);T&&(g[R.id]=T)}catch(T){E.push(`${R.id}: ${T instanceof Error?T.message:String(T)}`)}}return{type:"loaded",id:t.id,buckets:g,...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(g).length,...E.length?{failed:E}:{}}}}function eo(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 to(t,e,n){let r=e-1,i=e<n?e+1:24;return!(t.maxzoom<r||t.minzoom>i)}function no(t,e){return t<=6?Math.max(64,e/24):0}function Zt(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:hn/c}:void 0,m=Rn(e,t.filter,n,a,t.clipToTile===!0,e.extent);return m?{kind:"fill",...m,extent:e.extent}:null}if(t.type==="surface"){let c=zn(e,e.extent,t.filter,{metersPerUnit:r>0?r/e.extent:0,maxSegment:n,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=>Pn(i,a,t.elevation??0,e.extent)}:{},...t.groundBy?{liftBy:eo(t.groundBy)}:{}});return c?{kind:"surface",...c}:null}if(t.type==="line"){let c=jn(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=Kn(e,t.filter);return c?{kind:"placement",...c,extent:e.extent}:null}if(t.type==="symbol"){let c=Qn(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=En(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 ro(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 io(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 oo(t,e,n){let r=["==",e,n];return t?["all",t,r]:r}var so=t=>t.kind==="symbol",uo=t=>t.kind==="placement";function qn(t){let e=[];for(let n of Object.values(t.buckets)){if(uo(n)){e.push(n.anchors);continue}if(so(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 er=Map;var Ke=new er,Wt=self;Wt.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),Jn(e,n.signal).then(r=>{Ke.has(e.id)&&(Ke.delete(e.id),Wt.postMessage(r,qn(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};Wt.postMessage(s)})};})();\n';var du=2,Uo=class{constructor(e=pn()){this.workers=[];this.blobUrl=null;this.pending=new B;this.queue=new B;this.busy=[];this.nextId=1;this.mainThreadAborts=new B;this.destroyed=false;try{let t=new Blob([mn],{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,this.busy=new Array(this.workers.length).fill(0);}get size(){return this.workers.length}load(e,t,o=0){let r=this.nextId++,n={type:"load",id:r,...e};if(!this.usingWorkers){let a=new AbortController;return this.mainThreadAborts.set(r,a),hl(n,a.signal).then(l=>{this.mainThreadAborts.has(r)&&(this.mainThreadAborts.delete(r),t(l));}).catch(l=>{let s=a.signal.aborted;this.mainThreadAborts.delete(r),t({type:"error",id:r,message:l instanceof Error?l.message:String(l),aborted:s});}),r}return this.queue.set(r,{message:n,resolve:t,priority:o}),this.pump(),r}pump(){for(;;){if(!this.queue.size)return;let e=-1;for(let r=0;r<this.busy.length;r++)this.busy[r]>=du||(e<0||this.busy[r]<this.busy[e])&&(e=r);if(e<0)return;let t=-1,o=null;for(let[r,n]of this.queue.entries())o&&n.priority>=o.priority||(t=r,o=n);if(!o)return;this.queue.delete(t),this.busy[e]++,this.pending.set(t,{resolve:o.resolve,workerIndex:e}),this.workers[e].postMessage(o.message);}}abort(e){if(!this.usingWorkers){this.mainThreadAborts.get(e)?.abort(),this.mainThreadAborts.delete(e);return}if(this.queue.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),this.busy[t.workerIndex]--,this.pump();}onMessage(e){if(this.destroyed)return;let t=this.pending.get(e.id);t&&(this.pending.delete(e.id),this.busy[t.workerIndex]--,this.pump(),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.queue.clear(),this.busy=[],this.disposeWorkers();}};function pn(){let i=typeof navigator<"u"&&navigator.hardwareConcurrency||4;return Math.max(1,Math.min(i-1,6))}function ml(i){return Math.max(0,Math.ceil((i*Math.LN2+Math.log(512/360/.5))/Math.LN10))}function bn(i,e){let t=ml(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 yn(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 pl(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 bl={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}},oo=i=>bl[i]??bl.high;function yl(i){let e=i.toLowerCase();return e?/swiftshader|llvmpipe|software|basic render|microsoft basic|mesa offscreen/.test(e)?"software":/rtx|geforce gtx (9|10|16|20|30|40|50)|radeon rx|radeon pro|arc a\d|apple m\d/.test(e)?"strong":/intel\(r\) hd graphics|hd graphics [2-5]\d{3}|uhd graphics 6\d\d/.test(e)||/mali-t\d|mali-g[35]\d|adreno \(tm\) [3-5]\d\d|powervr/.test(e)?"weak":"unknown":"unknown"}function Xo(i){let{cores:e,memory:t,mobile:o,devicePixelRatio:r,gpu:n}=i;if(n==="software")return "minimal";let a=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";return n==="weak"?xn(a)??a:n==="strong"&&!o?gl(a)??a:a}function Yo(){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,gpu:hu()}}function hu(){if(typeof document>"u")return "unknown";let i=null;try{let e=document.createElement("canvas");if(e.width=1,e.height=1,i=e.getContext("webgl2")??e.getContext("webgl"),!i)return "software";let t=i.getExtension("WEBGL_debug_renderer_info"),o=t?i.getParameter(t.UNMASKED_RENDERER_WEBGL):i.getParameter(i.RENDERER);return typeof o=="string"?yl(o):"unknown"}catch{return "unknown"}finally{i?.getExtension("WEBGL_lose_context")?.loseContext();}}function wn(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 jo(i){return i==="high"?3:i==="balanced"?2:i==="low"?1:0}function gl(i){return i==="minimal"?"low":i==="low"?"balanced":i==="balanced"?"high":null}function xn(i){return i==="high"?"balanced":i==="balanced"?"low":i==="low"?"minimal":null}var gn=120,mu=40,pu=.35,bu=.02,yu=150,gu=30,vu=2,wu=1800,vn=30,xu=1.25,to=class{constructor(e,t,o,r){this.current=e;this.ceiling=t;this.slowMs=o;this.verySlowMs=r;this.ring=new Uint8Array(gn);this.at=0;this.sum=0;this.filled=0;this.steady=0;this.warmup=0;this.attempts={};this.arrivedByUp=false;this.recent=new Float32Array(vn);this.recentAt=0;this.recentFilled=0;this.refreshMs=0;}get limit(){return this.ceiling}reset(e,t){this.current=e,this.ceiling=t,this.attempts={},this.arrivedByUp=false,this.restart();}frame(e,t){if(t)return null;if(this.warmup>0)return this.warmup--,null;let o=this.threshold(e),r=e>o*(this.verySlowMs/this.slowMs)?3:e>o?1:0;if(this.sum+=r-this.ring[this.at],this.ring[this.at]=r,this.at=(this.at+1)%gn,this.filled<gn&&this.filled++,this.steady++,this.steady===wu&&(this.attempts[this.current]=0),this.filled<mu)return null;let n=this.sum/this.filled;return n>=pu?this.down(n):n>bu?null:this.up(n)}threshold(e){this.recent[this.recentAt]=e,this.recentAt=(this.recentAt+1)%vn,this.recentFilled<vn&&this.recentFilled++;let t=this.refreshMs;if(!t){t=1/0;for(let o=0;o<this.recentFilled;o++)t=Math.min(t,this.recent[o]);}return Math.max(this.slowMs,t*xu)}setRefresh(e){e>=1e3/240&&e<=50&&(this.refreshMs=e);}down(e){let t=xn(this.current);if(!t)return null;if(this.arrivedByUp){let o=(this.attempts[this.current]??0)+1;this.attempts[this.current]=o,o>=vu&&jo(t)<jo(this.ceiling)&&(this.ceiling=t);}return this.moveTo(t,false),{to:t,direction:"down",share:e}}up(e){let t=gl(this.current);if(!t||jo(t)>jo(this.ceiling))return null;let o=yu*2**(this.attempts[t]??0);return this.steady<o?null:(this.moveTo(t,true),{to:t,direction:"up",share:e})}moveTo(e,t){this.current=e,this.arrivedByUp=t,this.restart();}restart(){this.ring.fill(0),this.at=0,this.sum=0,this.filled=0,this.steady=0,this.warmup=gu;}};var _u=1,ro=class{constructor(e){this.originX=0;this.originY=0;this._revision=0;this.id=e.id??`obj-${_u++}`,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=oe(s.lng),f=re(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(oe(r.lng)-this.originX,re(r.lat)-this.originY);}return t}color(e,t){let o=ce(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}},Cn=class extends ro{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=Ht([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=Ht([this.toLocal(this.coordinates.slice(l.from,l.to+1))]);if(!s)continue;let c=ce(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=Mn(this.coordinates,this.altitude,t);for(let a=0;a+1<n.length;a++)if(vl(e,n[a],n[a+1])<=r)return true;return false}},Ko=class extends ro{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=Or(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(_n(a))),n=Ht(r);n&&e.push(this.linePaint({kind:"line",mesh:n,color:this.color("strokeColor","#2f6df6"),width:o}));}return e}hitTest(e,t){let o=Mn(_n(this.coordinates[0]??[]),this.altitude,t);if(!Tn(e,o))return false;for(let r=1;r<this.coordinates.length;r++)if(Tn(e,Mn(_n(this.coordinates[r]),this.altitude,t)))return false;return true}},Sn=class extends Ko{constructor(e){super({...e,coordinates:[Cu(e.center,e.radius,e.segments)]});}};function Cu(i,e,t){let o=Z(i),r=e/Le(o.lat),n=oe(o.lng),a=re(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 Mn(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 _n(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 vl(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 Tn(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 wl="objects3d",St="level",Su=32,Mu=100,Tu=250;function xl(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 ku(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 kn=class extends Ne{constructor(t){super();this.options=t;this.transform=new kt;this.ctx=null;this.sources=new B;this.rasterSources=new B;this.renderer=new Nt;this.objects=new Wt;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.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;this.debugFB=null;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?Xo(Yo()):t.quality;this.governor=new to(r,r,Su,Mu),this.quality=oo(r),this.densityQuality=this.quality,this.maxPixelRatio=t.maxPixelRatio??this.quality.maxPixelRatio,this._style=new ht(t.theme?So(t.theme,t.style):t.style),this.background=t.background?ce(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 Uo(t.workerCount??Math.min(pn(),this.quality.maxWorkers)),this.initGL(),this.initSource(),this.initInput(),this.initResize(),this.measureRefresh(),queueMicrotask(()=>{this.destroyed||(this.loaded=true,this.emit("load",void 0),this.triggerRepaint());});}measureRefresh(){if(typeof requestAnimationFrame!="function")return;let t=[],o=r=>{if(this.destroyed)return;if(t.push(r),t.length<12){requestAnimationFrame(o);return}let n=1/0;for(let a=1;a<t.length;a++)n=Math.min(n,t[a]-t[a-1]);this.governor.setRefresh(n);};requestAnimationFrame(o);}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 so(t);let o=new wt(this.options.fonts??"/tileserver/fonts/{fontstack}/{range}.pbf",this.options.fontstack);this.options.icons&&o.icons.setIcons({...ot,...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 No({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:wl,type:"model",sourceLayer:t.sourceLayer??"model3d",minzoom:0,maxzoom:24}}sourceDrawn(t,o){for(let r of this._style.layers)if(r.type!=="raster"&&(r.source??Y)===t&&this._style.layerVisibleAt(r,o))return true;return t===this.objects3dSource&&this.objects3dEnabled?o>=(this.options.objects3d?.layout?.minZoom??0):false}planFor(t,o=this._style){let r=o.workerPlan(t),n=t===this.objects3dSource?[...r,this.objects3dPlan()]:r;return this.quality.simpleGeometry?n.map(ku):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:wl,"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(De(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===St&&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 qt({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 Wo(this.pool,{url:o.url,minzoom:o.minzoom??0,maxzoom:o.maxzoom??14,cacheSize:this.quality.tileCacheSize*2,plan:this.planFor(t),rank:t===Y?0:1});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 yo(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=wn(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+nt((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+nt((t.bearing??o.bearing)-r.bearing),pitch:t.pitch??o.pitch},l=Ue(r.zoom),s=(oe(a.center.lng)-oe(r.center.lng))*l,c=(re(a.center.lat)-re(r.center.lat))*l,f=Math.hypot(s,c),u=Math.max(o.width,o.height),d=u*Math.pow(2,r.zoom-a.zoom),h=1.42,m=h*h,y,p=null;if(f<1e-6){let g=Math.log(d/u);y=Math.abs(g)/h,p=v=>({u:0,w:u*Math.exp(h*Math.sign(g)*v)});}else {let g=w=>{let _=w===0?u:d,T=w===0?d:u;return (T*T-_*_+(w===0?1:-1)*m*m*f*f)/(2*_*m*f)},v=w=>Math.log(-g(w)+Math.sqrt(g(w)*g(w)+1)),x=v(0);y=(v(1)-x)/h;let S=w=>(Math.exp(w)+Math.exp(-w))/2,M=w=>(Math.exp(2*w)-1)/(Math.exp(2*w)+1);p=w=>{let _=h*w+x;return {u:u*S(x)*M(_)/m-u*Math.sinh(x)/m,w:u*S(x)/S(_)}};}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:u}},this.triggerRepaint(),this}setPadding(t){return this.padding=xl(t),this.renderer.symbols&&(this.renderer.symbols.padding=this.padding),this.triggerRepaint(),this}getPadding(){return {...this.padding}}getBounds(){let t=this.transform,o=new Mt;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=Zo(t,{width:r.width,height:r.height,bearing:o.bearing??r.bearing,padding:o.padding!==void 0?xl(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:lo(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)*lo(r),a.pitch=o.from.pitch+(o.to.pitch-o.from.pitch)*lo(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 ht(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(So(t,this.options.style))}static get themes(){return Object.keys(Oe)}static get themeList(){return Object.entries(Oe).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:wt.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=zr(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??Y)));}if(!n||!o.length)return null;let a=Pr(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=bn({center:t.center,zoom:t.zoom,bearing:t.bearing,pitch:t.pitch},this.hashName);this.writingHash=true,pl("#"+o),setTimeout(()=>this.writingHash=false,0);}applyHash(t){if(typeof window>"u")return;let o=yn(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"?Xo(Yo()):t;return this.governor.reset(o,o),this.applyQuality(oo(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.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();}checkFrameBudget(t){if(!this.qualityAuto)return;let o=this.governor.frame(t,this.sum(n=>n.pendingCount)>0);if(!o)return;let r=`${(o.share*100).toFixed(0)}%`;console.info(o.direction==="down"?`[osmgl] \u0442\u044F\u0436\u0451\u043B\u044B\u0445 \u043A\u0430\u0434\u0440\u043E\u0432 ${r} \u2014 \u043A\u0430\u0447\u0435\u0441\u0442\u0432\u043E \u043F\u043E\u043D\u0438\u0436\u0435\u043D\u043E \u0434\u043E \xAB${o.to}\xBB (\u043F\u043B\u043E\u0442\u043D\u043E\u0441\u0442\u044C \u0431\u0443\u0444\u0435\u0440\u0430 \u043F\u0440\u0435\u0436\u043D\u044F\u044F, \u043F\u043E\u0442\u043E\u043B\u043E\u043A \xAB${this.governor.limit}\xBB)`:`[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${o.to}\xBB`),this.applyQuality(oo(o.to),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=ce(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===St))for(let n of r.splitValues(St)){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[St];return typeof t=="number"?t:null}setIndoorLevel(t){return t===null?delete this._style.splitValues[St]:this._style.splitValues[St]=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 eo)}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,Tt):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);})));}debugFloatPixels(t,o,r,n){let a=this.ctx;if(!a||!a.caps.colorBufferFloat)return null;let l=a.gl,s=this.canvas.width,c=this.canvas.height,f=!!l.getExtension("EXT_float_blend"),u=f?l.RGBA32F:l.RGBA16F,d=f?l.FLOAT:l.HALF_FLOAT;if(this.debugFB&&(this.debugFB.w!==s||this.debugFB.h!==c)&&(l.deleteFramebuffer(this.debugFB.fb),l.deleteTexture(this.debugFB.tex),l.deleteRenderbuffer(this.debugFB.rb),this.debugFB=null),!this.debugFB){let h=l.createTexture(),m=l.createFramebuffer(),y=l.createRenderbuffer();if(!h||!m||!y)return null;l.bindTexture(l.TEXTURE_2D,h),l.texImage2D(l.TEXTURE_2D,0,u,s,c,0,l.RGBA,d,null),l.texParameteri(l.TEXTURE_2D,l.TEXTURE_MIN_FILTER,l.NEAREST),l.texParameteri(l.TEXTURE_2D,l.TEXTURE_MAG_FILTER,l.NEAREST),l.bindTexture(l.TEXTURE_2D,null),l.bindRenderbuffer(l.RENDERBUFFER,y),l.renderbufferStorage(l.RENDERBUFFER,l.DEPTH24_STENCIL8,s,c),l.bindRenderbuffer(l.RENDERBUFFER,null),l.bindFramebuffer(l.FRAMEBUFFER,m),l.framebufferTexture2D(l.FRAMEBUFFER,l.COLOR_ATTACHMENT0,l.TEXTURE_2D,h,0),l.framebufferRenderbuffer(l.FRAMEBUFFER,l.DEPTH_STENCIL_ATTACHMENT,l.RENDERBUFFER,y);let p=l.checkFramebufferStatus(l.FRAMEBUFFER);if(l.bindFramebuffer(l.FRAMEBUFFER,null),a.invalidateState(),p!==l.FRAMEBUFFER_COMPLETE)return null;this.debugFB={fb:m,tex:h,rb:y,w:s,h:c};}a.screen=this.debugFB.fb;try{this.renderFrame(performance.now()),a.bindFramebuffer(this.debugFB.fb);let h=new Float32Array(r*n*4);return l.readPixels(t,o,r,n,l.RGBA,l.FLOAT,h),{data:h,format:f?"rgba32f":"rgba16f"}}finally{a.screen=null,this.triggerRepaint();}}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[h,m]of this.sources)this.sourceDrawn(h,this.transform.zoom)?m.update(this.transform):m.deactivate();this.updateObjects3D();for(let[h,m]of this.rasterSources)this.rasterLayerVisible(h)&&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<Tu,u=f?c:0;this.continuousFrames=f?this.continuousFrames+1:0;let d=this.continuousFrames>1?c:l;this.lastFrameAt=t,this.checkFrameBudget(d),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();}}},p1=kn;
2325
- exports.AssetLoader=Zt;exports.BASE_SOURCE=Y;exports.BUILDING_HEIGHT_SCALE=ct;exports.BUILDING_POS_SCALE=st;exports.BUILDING_VERTEX_STRIDE=Me;exports.CITY_STYLE=bc;exports.Circle=Sn;exports.DEFAULT_ICONS=ot;exports.DEFAULT_LIGHT=_r;exports.DEFAULT_SHADOWS=Xa;exports.DEFAULT_SKY=xr;exports.DEFAULT_STYLE=Cr;exports.DepthTarget=Rt;exports.EARTH_CIRCUMFERENCE=co;exports.FILL_VERTEX_STRIDE=je;exports.GLOBE_MAX_PITCH=Tt;exports.GLOBE_ZOOM_MAX=Qe;exports.GLOBE_ZOOM_MIN=ho;exports.GLYPH_BORDER=be;exports.GLYPH_SIZE=Ge;exports.GROUND_SCALE=Rs;exports.GeomType=At;exports.GlyphSource=jt;exports.GroundArrows=zt;exports.IconSource=Yt;exports.IndoorMask=Pt;exports.LEVEL_LIMIT=zs;exports.LINE_VERTEX_STRIDE=Xe;exports.LayerRenderer=Nt;exports.LngLatBounds=Mt;exports.MAX_LATITUDE=An;exports.MODEL_VERTEX_STRIDE=Io;exports.Map=kn;exports.MapObject=ro;exports.Marker=Jt;exports.Model=Qt;exports.ModelLayer=Ke;exports.ObjectManager=Wt;exports.Polygon=Ko;exports.Polyline=Cn;exports.Popup=eo;exports.QualityGovernor=to;exports.RELIEF_STYLE=pc;exports.RUNTIME_FILL_STRIDE=Hr;exports.RUNTIME_LINE_STRIDE=pt;exports.RasterSource=qt;exports.RasterTile=Bo;exports.SDF_EDGE=$r;exports.SDF_PX=Xt;exports.SOFT_STYLE=mc;exports.SPLIT_SEP=Qi;exports.SURFACE_CUT_BLEED=Lt;exports.SURFACE_LEVEL_SCALE=bi;exports.SURFACE_VERTEX_STRIDE=ft;exports.SdfAtlas=Ut;exports.Style=ht;exports.SymbolRenderer=wt;exports.THEMES=Oe;exports.TILE_SIZE=Ze;exports.TileID=_t;exports.Transform=kt;exports.VectorTile=Et;exports.VectorTileFeature=go;exports.VectorTileLayer=vo;exports.abbreviateStreet=fn;exports.addGround=gr;exports.altitudeFromMercatorZ=zu;exports.applyTheme=Co;exports.arrowLabelOffset=il;exports.arrowVertices=Ac;exports.buildRuntimeFill=Or;exports.buildRuntimeLine=Ht;exports.cameraForBounds=Zo;exports.circumferenceAtLatitude=Le;exports.clampLat=fo;exports.clampPixelRatio=wn;exports.classifyRenderer=yl;exports.clipLineToRect=Qr;exports.coordinateDigits=ml;exports.coveringTiles=$t;exports.createGround=yr;exports.default=p1;exports.deviceHints=Yo;exports.distToSegment=vl;exports.evaluateColor=Ee;exports.evaluateNumber=V;exports.extractFeature=Eo;exports.featureLevel=tt;exports.fillFootprint=Ar;exports.fogPlanes=mt;exports.footprintOf=Lr;exports.formatHash=bn;exports.generateBuildings=sr;exports.generateFill=ur;exports.generateLine=wr;exports.generateSurface=br;exports.generateSymbols=dn;exports.globeBasis=or;exports.globeFlatMix=po;exports.globeRadius=mo;exports.globeToLocal=On;exports.groundAt=xo;exports.iconRotation=al;exports.insideFootprint=De;exports.latFromMercatorY=Ce;exports.lngFromMercatorX=Se;exports.lngLatToUnit=bo;exports.matchesFilter=pe;exports.mercatorMetersPerTile=qo;exports.mercatorX=oe;exports.mercatorY=re;exports.mercatorZFromAltitude=$o;exports.metersPerPixel=Hu;exports.metersPerTile=Ln;exports.nextQualityDown=xn;exports.parseGlb=$c;exports.parseGlbAsync=Vr;exports.parseGlyphs=Ka;exports.parseHash=yn;exports.patchUV=Fa;exports.pickBuilding=zr;exports.pickFill=Pr;exports.pitchIntent=Un;exports.pixelsPerMeter=Pu;exports.placeAlongLine=en;exports.pointInRing=Tn;exports.qualityFor=Xo;exports.qualityProfile=oo;exports.raySphere=rr;exports.resolveTemplate=un;exports.roundRing=Pe;exports.sdfFromAlpha=qr;exports.shapeText=Zr;exports.splitBucketKey=He;exports.splitByGround=vr;exports.splitPolygons=Je;exports.styleWithTheme=So;exports.tileOriginMeters=In;exports.tileUrl=ll;exports.toLngLat=Z;exports.unitToLngLat=tr;exports.worldSize=Ue;//# sourceMappingURL=osmgl.cjs.map
2336
+ `;var Lo=i=>i.kind==="symbol",Ua=i=>i.kind==="placement";function Ne(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(Bc(e,t,a,l,s,c,f,u)||o>0&&(Hr(e,t,a,l,s,c)<=o||Hr(e,t,s,c,f,u)<=o||Hr(e,t,f,u,a,l)<=o))return true}return false}function Bc(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,d=s>0||c>0||f>0;return !(u&&d)}function Hr(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 Or(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]*Xe;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 Br(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]*ke;s[c*2]=a+o.getInt16(f,true)*n,s[c*2+1]=l+o.getInt16(f+2,true)*n;}return s}var Vc={stride:8,attribs:[{name:"a_pos",size:2,type:5126,offset:0}]},Dc=40,Nc=10.5,ja=2.5,Gc=16,Uc=4,jc=7,Bt=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 u=t.center,d=le(u.lng),h=se(u.lat),m=t.worldSize>0?t.pixelsPerMeter/t.worldSize:0;if(!(m>0))return;let y=[];for(let w of f){let x=o.get(w.source??$);if(!x)continue;let _=r.bucketKeyFor(w);if(_===null)continue;let M=w.layout?.showFor==="highlight";if(M&&!this.highlightFootprint)continue;let C=m*1.5,T=w.layout?.arrowUnits==="meters"?m:1/t.worldSize,A=D(w.layout?.arrowLength,c,Dc)*T,k=D(w.layout?.arrowWidth,c,Nc)*T,L=D(w.layout?.arrowOutline,c,ja)*T,R=D(w.layout?.arrowGap,c,Gc)*T,I=D(w.layout?.arrowDotRadius,c,Uc)*T,E=D(w.layout?.arrowDotGap,c,jc)*T,H=Vr(A,k,I,R-E),W=L>0?Vr(A,k,I,R-E,L).outline:null,F={layer:w,verts:[],shape:H};for(let P of x.visibleTiles){let O=x.getTile(P)?.data?.buckets?.[_];if(!O||!Lo(O))continue;let B=new Int16Array(O.anchors),V=O.rotations?new Int16Array(O.rotations):null,j=P.bounds(),X=(j.maxX-j.minX)/O.extent,q=j.minX,Q=j.minY;for(let Z=0;Z<B.length/2;Z++){let U=q+B[Z*2]*X,ne=Q+B[Z*2+1]*X;if(M&&!Ne(this.highlightFootprint,U,ne,C))continue;let ie=(V?V[Z]:0)*Math.PI/180,J=Math.sin(ie),K=-Math.cos(ie),Y=U-d-J*R,oe=ne-h-K*R;W&&Dr(F,W,Y,oe,J,K),Dr(F,H.outline,Y,oe,J,K),this.count++;}}F.verts.length&&y.push(F);}if(!y.length)return;let p=y[0].shape,b=p.outline.length/2,g=[],v=[];for(let w of y){let x=g.length/2/b;for(let _ of w.verts)g.push(_);v.push({layer:w.layer,first:x,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(d,h,0)),n.setMat4("u_matrix",t.objectMatrix(d,h,0)),e.setDepthTest(false),e.setDepthMask(false),e.setBlend("premultiplied"),e.setCull("none"),this.vao.bind();for(let w of v){let x=w.layer.paint,_=D(x.opacity,c,1),M=Ae(x.color,c,[.18,.45,.76,1]),C=Ae(x.haloColor,c,[1,1,1,1]),S=D(w.layer.layout?.arrowOutline,c,ja)>0;Xc(e,n,w,C,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 pe(e,new Uint8Array(this.capacity*n*8),Vc,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 ue(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 Xc(i,e,t,o,r,n,a,l){let s=a?2:1;if(a){e.setVec4v("u_color",Ce([o[0],o[1],o[2],o[3]*n]));for(let c=0;c<t.count;c+=s)Xa(i,t.first+c,l);}e.setVec4v("u_color",Ce([r[0],r[1],r[2],r[3]*n]));for(let c=a?1:0;c<t.count;c+=s)Xa(i,t.first+c,l);}function Xa(i,e,t){i.gl.drawElements(i.gl.TRIANGLES,t,i.gl.UNSIGNED_INT,e*t*4);}var Ka=4,Wr=12;function Vr(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=[],d=(b,g)=>u.push(b,g);d(0,0),d(-n,a),d(-n+l,c),d(f,s);for(let b=1;b<Ka;b++){let g=b/Ka*Math.PI;d(f-Math.sin(g)*s,Math.cos(g)*s);}d(f,-s),d(-n+l,-c),d(-n,-a);let h=r>0?Kc(u,r):u,m=mi__default.default(u,void 0,2);if(t<=0)return {outline:h,indices:m};let y=h.length/2,p=t+r;for(let b=0;b<Wr;b++){let g=b/Wr*Math.PI*2;h.push(o+Math.cos(g)*p,Math.sin(g)*p);}for(let b=1;b<Wr-1;b++)m.push(y,y+b,y+b+1);return {outline:h,indices:m}}function Kc(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],d=i[(a+1)%t*2+1],h=Math.hypot(c-l,f-s)||1,m=Math.hypot(u-c,d-f)||1,y=r*(f-s)/h,p=-r*(c-l)/h,b=r*(d-f)/m,g=-r*(u-c)/m,v=y+b,w=p+g,x=Math.hypot(v,w);if(x<1e-9){n.push(c,f);continue}v/=x,w/=x;let _=Math.min(1/Math.max(v*y+w*p,.35),3);n.push(c+v*e*_,f+w*e*_);}return n}function Dr(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 Yc(i,e,t,o,r,n=0,a=0){let l=t*Math.PI/180,s={verts:[]};return Dr(s,Vr(o,r,n,a).outline,i,e,Math.sin(l),-Math.cos(l)),s.verts}var $c=5;function Ya(i,e){let t=1/(1<<e),o=(1<<e)-1;return [(i.x&o)*t,(i.y&o)*t,t]}var Ro=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 d=D(f.paint?.opacity,l,1);if(!(d<=.001)){r.setFloat("u_opacity",d),o.bind();for(let h of u.visibleTiles){let m=this.patchFor(e,u,h);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(h,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<=$c&&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:Ya(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 qc="indoor-",Wt=class{constructor(){this.parts=null;this.stamp="";this.cache=new z;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 d of t.layers){if(!d.id.startsWith(qc)||d.type!=="fill"||!t.layerVisibleAt(d,o))continue;let h=t.bucketKeyFor(d);h&&(r.push(h),n??(n=e.get(d.source??$)));}if(!r.length||!n){this.parts&&this.destroy();return}let a=r.join(",")+"|"+n.visibleTiles.map(d=>d.dataKey+(n.getTile(d)?.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 d of n.visibleTiles){let h=n.getTile(d)?.data?.buckets;if(h)for(let m of r){let y=h[m];if(!y||y.kind!=="fill")continue;let p=Or(y,d);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]>u&&(u=p[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 z;for(let u=0;u*3<r.length;u++){let d=n[u];if(this.hidden.has(d))continue;let h=f.get(d);h||f.set(d,h=[1/0,1/0,-1/0,-1/0]);for(let m=0;m<3;m++){let y=r[u*3+m]*ke,p=a.getInt16(y,true),b=a.getInt16(y+2,true);p<h[0]&&(h[0]=p),b<h[1]&&(h[1]=b),p>h[2]&&(h[2]=p),b>h[3]&&(h[3]=b);}}for(let[u,d]of f){let h=l.minX+(d[0]+d[2])/2*s,m=l.minY+(d[1]+d[3])/2*s;c&&(h<c[0]||h>c[2]||m<c[1]||m>c[3])||Ne(o,h,m,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),d=[];for(let h=0;h*3<f.length;h++)this.hidden.has(u[h])||d.push(f[h*3],f[h*3+1],f[h*3+2]);if(d.length<f.length){let h=new ue(e,new Uint32Array(d));c={vao:new fe(e,[{buffer:n,locations:a}],h),ibo:h,count:d.length};}}return this.cache.set(r.dataKey,c),c}};var $a=35,Zc=70,Qc=.35,Jc=.5,ef=1.1;function bt(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=xe((i.pitch-$a)/(Zc-$a),0,1),n=t.fogRange[0]*(1-Qc*r)*o,a=t.fogRange[1]*(1-Jc*r)*o,l=Math.min(1,t.fogIntensity+(1-t.fogIntensity)*Math.min(1,r*2)),s=l>=.995?a*ef:1/0;return {near:n,far:a,intensity:l,cutoff:s}}function Nr(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),d=u&&qa(u,t);if(!d||!Pe(l,i.tileMatrix64(f,d.extent))||(he(s,l,[r,n,-1,1]),he(c,l,[r,n,1,1]),s[3]===0||c[3]===0))continue;let h=s[0]/s[3],m=s[1]/s[3],y=s[2]/s[3],p=c[0]/c[3]-h,b=c[1]/c[3]-m,g=c[2]/c[3]-y,v=of(d,h,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 Gr(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 d of t){let h=u.data?.buckets?.[d];if(!h||h.kind!=="fill"||!h.featureIds||!Pe(l,i.tileMatrix64(f,h.extent))||(he(s,l,[r,n,-1,1]),he(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,x=tf(h,v,w);x!==null&&(!a||g<a.distance)&&(a={featureId:x,tile:f,layerId:d,distance:g});}}return a}function tf(i,e,t){let o=new DataView(i.vertices),r=new Uint32Array(i.indices),n=new Float64Array(i.featureIds),a=s=>o.getInt16(s*Xe,true),l=s=>o.getInt16(s*Xe+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],d=a(c),h=l(c),m=a(f),y=l(f),p=a(u),b=l(u),g=(e-m)*(h-y)-(d-m)*(t-y),v=(e-p)*(y-b)-(m-p)*(t-b),w=(e-d)*(b-h)-(p-d)*(t-h),x=g<0||v<0||w<0,_=g>0||v>0||w>0;if(!(x&&_))return n[s]}return null}function qa(i,e){let t=i.data?.buckets?.[e];return !t||t.kind!=="fill-extrusion"||!t.featureIds?null:t}function of(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*ke,true)/ft,u=y=>l.getInt16(y*ke+2,true)/ft,d=y=>l.getUint16(y*ke+4,true)/ut,h=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=u(p),x=d(p),_=f(b)-v,M=u(b)-w,C=d(b)-x,S=f(g)-v,T=u(g)-w,A=d(g)-x,k=n*A-a*T,L=a*S-r*A,R=r*T-n*S,I=_*k+M*L+C*R;if(I>-1e-9&&I<1e-9)continue;let E=1/I,H=e-v,W=t-w,F=o-x,P=(H*k+W*L+F*R)*E;if(P<0||P>1)continue;let N=W*C-F*M,O=F*_-H*C,B=H*M-W*_,V=(r*N+n*O+a*B)*E;if(V<0||P+V>1)continue;let j=(S*N+T*O+A*B)*E;j<0||j>1||j>=h||(h=j,m=c[y/3]??0);}return m>=0?{featureId:m,t:h}:null}function Fo(i,e,t){let o=qa(i,e);return o?Ur(o,t):null}function Ur(i,e){if(!i.featureIds)return null;let t=new Uint32Array(i.indices),o=new Float64Array(i.featureIds),r=[];for(let n=0;n+2<t.length;n+=3)o[n/3]===e&&r.push(t[n],t[n+1],t[n+2]);return r.length?{vertices:i.vertices,indices:new Uint32Array(r)}:null}var yt=24,jr=8,nf=2,af=12,zo=8,Po=8;function Vt(i){let e=0;for(let h of i)e+=h.length/2;if(e<2)return null;let t=(zo+2)*2,o=e*t+i.length*(Po+2)*2+8,r=e*(zo+2)*6+i.length*Po*6+24,n=new ArrayBuffer(o*yt),a=new DataView(n),l=new Uint32Array(r),s=0,c=0,f=(h,m,y,p,b,g)=>{let v=s*yt;return a.setFloat32(v,h,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++},u=(h,m,y,p)=>{l[c++]=h,l[c++]=m,l[c++]=p,l[c++]=h,l[c++]=p,l[c++]=y;},d=(h,m,y,p,b,g,v)=>{let w=f(h,m,0,0,0,v),x=f(h,m,y,p,1,v);for(let _=1;_<=Po;_++){let M=Math.PI*_/Po,C=y*Math.cos(M)+b*Math.sin(M),S=p*Math.cos(M)+g*Math.sin(M),T=f(h,m,C,S,1,v);l[c++]=w,l[c++]=x,l[c++]=T,x=T;}};for(let h of i){let m=lf(h),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],C=m[_*2+3]-m[_*2+1],S=Math.hypot(M,C)||1;p[_]=M/S,b[_]=C/S;}let g=0,v=-1,w=-1;for(let _=0;_<y;_++){let M=m[_*2],C=m[_*2+1];_>0&&(g+=Math.hypot(M-m[_*2-2],C-m[_*2-1]));let S=_>0?_-1:0,T=_<y-1?_:y-2,A=-b[S],k=p[S],L=-b[T],R=p[T],I=A+L,E=k+R,H=Math.hypot(I,E);H>1e-9?(I/=H,E/=H):(I=A,E=k);let W=I*L+E*R,F=W>1e-6?1/W:1/0,P=Math.acos(Math.min(1,Math.max(-1,p[S]*p[T]+b[S]*b[T])));if(!(P>af*Math.PI/180)&&F<=nf){let O=f(M,C,I*F,E*F,1,g),B=f(M,C,-I*F,-E*F,-1,g);v>=0&&u(v,w,O,B),v=O,w=B;}else {let O=Math.max(1,Math.min(zo,Math.ceil(P/(Math.PI/zo)))),V=p[S]*b[T]-b[S]*p[T]>=0?1:-1,j=f(M,C,A,k,1,g),X=f(M,C,-A,-k,-1,g);v>=0&&u(v,w,j,X);for(let q=1;q<=O;q++){let Q=V*P*(q/O),Z=Math.cos(Q),U=Math.sin(Q),ne=A*Z-k*U,ie=A*U+k*Z,J=f(M,C,ne,ie,1,g),K=f(M,C,-ne,-ie,-1,g);u(j,X,J,K),j=J,X=K;}v=j,w=X;}}let x=y-2;d(m[0],m[1],-b[0],p[0],-p[0],-b[0],0),d(m[(y-1)*2],m[(y-1)*2+1],-b[x],p[x],p[x],b[x],g);}return c?{vertices:n.slice(0,s*yt),indices:l.slice(0,c),vertexCount:s}:null}function Xr(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=mi__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 lf(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 Dt=5126,sf={stride:jr,attribs:[{name:"a_pos",size:2,type:Dt,offset:0}]},Yr={stride:yt,attribs:[{name:"a_pos",size:2,type:Dt,offset:0},{name:"a_extrude",size:2,type:Dt,offset:8},{name:"a_side",size:1,type:Dt,offset:16},{name:"a_dist",size:1,type:Dt,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();}},cf=(i,e)=>[i[0],i[1],i[2],i[3]*e],Nt=class{constructor(){this.objects=[];this.markers=[];this.gpu=new z;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,u=t.width>0?f/t.width:1,d=t.worldSize*u,h=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:x}of p.parts){if(c&&(v.kind!=="line"||v.arrow))continue;let _=c?cf(v.color,y):v.color;if(v.kind==="fill")h!==o&&(o.use(),l?.(o),h=o),o.setVec4v("u_color",Ce(_)),b&&o.setMat4("u_shadow_matrix",b),o.setMat4("u_matrix",g);else {h!==n&&(n.use(),l?.(n),h=n);let M=v.width/2*u,C=d>1e-9?1/d:1;if(n.setVec4v("u_color",Ce(_)),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",C),n.setFloat("u_units_to_px",d),n.setInt("u_pattern",c?0:v.dashArray?1:v.arrow?2:0),v.dashArray){let[S,T]=v.dashArray;n.setVec2("u_dash",S*u,(S+T)*u);}if(v.arrow){n.setVec4v("u_arrow_color",Ce(v.arrowColor??[1,1,1,1]));let S=(v.arrowSize??5)*u;n.setVec3("u_arrow",(v.arrowPeriod??46)*u,Math.max(S*.4,1),Math.min(S,M*.72));}b&&n.setMat4("u_shadow_matrix",b),n.setMat4("u_matrix",g);}w.bind(),e.gl.drawElements(e.gl.TRIANGLES,x.count,x.type,0);}}e.bindVAO(null);}hitTest(e,t,o=4){let r=e.worldSize,n=(a,l,s)=>e.worldPxToPoint(le(a)*r,se(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=te(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"?sf:Yr,f=s.kind==="fill"?o:r,u=new pe(e,new Uint8Array(s.mesh.vertices),c),d=new ue(e,s.mesh.indices),h=new fe(e,[{buffer:u,locations:f}],d);a.push({part:s,vao:h,vbo:u,ibo:d});}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 Ho=32,ff=1179937895,uf=1313821514,df=5130562,hf={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},mf={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT4:16};async function $r(i){let{json:e,bin:t}=Za(i),o=await bf(e,t);return Ja(e,t,o)}function pf(i){let{json:e,bin:t}=Za(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 Ja(e,t,null)}function Za(i){let e=new DataView(i);if(e.getUint32(0,true)!==ff)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===uf?t=JSON.parse(new TextDecoder().decode(new Uint8Array(i,l,n))):a===df&&(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 bf(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 Qa(i){let e=G();if(i.matrix){for(let C=0;C<16;C++)e[C]=i.matrix[C];return e}We(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],d=n+n,h=a+a,m=l+l,y=n*d,p=n*h,b=n*m,g=a*h,v=a*m,w=l*m,x=s*d,_=s*h,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+x)*f,e[8]=(b+_)*u,e[9]=(v-x)*u,e[10]=(1-(y+g))*u,e[12]=t,e[13]=o,e[14]=r,e}var yf={5120:127,5121:255,5122:32767,5123:65535};function gf(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 Ja(i,e,t){let o=C=>{let S=t?.get(C);if(S)return S;let T=i.bufferViews?.[C];if(!T)return null;let A=T.byteOffset??0;return e.subarray(A,A+T.byteLength)},r=[],n=[],a=[],l=[],s=[],c=[1/0,1/0,1/0],f=[-1/0,-1/0,-1/0],u=C=>{if(C===void 0)return null;let S=i.accessors?.[C];if(!S)return null;let T=mf[S.type]??1,A=new Float64Array(S.count*T),k=S.bufferView!==void 0?i.bufferViews?.[S.bufferView]:void 0;if(!k||S.bufferView===void 0)return {data:A,components:T};let L=o(S.bufferView);if(!L)return {data:A,components:T};let R=hf[S.componentType]??4,I=k.extensions?.EXT_meshopt_compression,E=I?I.byteStride:k.byteStride,H=E&&E>0?E:R*T,W=S.byteOffset??0,F=new DataView(L.buffer,L.byteOffset,L.byteLength),P=S.normalized?yf[S.componentType]??1:1;for(let N=0;N<S.count;N++)for(let O=0;O<T;O++){let B=W+N*H+O*R,V;switch(S.componentType){case 5120:V=F.getInt8(B);break;case 5121:V=F.getUint8(B);break;case 5122:V=F.getInt16(B,true);break;case 5123:V=F.getUint16(B,true);break;case 5125:V=F.getUint32(B,true);break;default:V=F.getFloat32(B,true);}A[N*T+O]=P===1?V:Math.max(V/P,-1);}return {data:A,components:T}},d=(C,S,T=-1)=>{if(C.mode!==void 0&&C.mode!==4)return;let A=u(C.attributes.POSITION);if(!A)return;let k=u(C.attributes.NORMAL),L=u(C.attributes.TEXCOORD_0),R=u(C.indices),I=r.length/3,E=A.data.length/3,H=gf(S),F=(C.material!==void 0?i.materials?.[C.material]:void 0)?.pbrMetallicRoughness?.baseColorTexture?.extensions?.KHR_texture_transform,P=F?{ox:F.offset?.[0]??0,oy:F.offset?.[1]??0,sx:F.scale?.[0]??1,sy:F.scale?.[1]??1,rot:F.rotation??0}:null;for(let U=0;U<E;U++){let ne=A.data[U*3],ie=A.data[U*3+1],J=A.data[U*3+2],K=S[0]*ne+S[4]*ie+S[8]*J+S[12],Y=S[1]*ne+S[5]*ie+S[9]*J+S[13],oe=S[2]*ne+S[6]*ie+S[10]*J+S[14];if(r.push(K,Y,oe),K<c[0]&&(c[0]=K),Y<c[1]&&(c[1]=Y),oe<c[2]&&(c[2]=oe),K>f[0]&&(f[0]=K),Y>f[1]&&(f[1]=Y),oe>f[2]&&(f[2]=oe),k){let ae=k.data[U*3],me=k.data[U*3+1],we=k.data[U*3+2],ge=H[0]*ae+H[3]*me+H[6]*we,Qe=H[1]*ae+H[4]*me+H[7]*we,at=H[2]*ae+H[5]*me+H[8]*we,so=Math.hypot(ge,Qe,at);so>1e-12?(ge/=so,Qe/=so,at/=so):(ge=0,Qe=1,at=0),n.push(ge,Qe,at);}else n.push(0,1,0);let re=L?L.data[U*2]:0,ce=L?L.data[U*2+1]:0;if(P){if(P.rot!==0){let ae=Math.cos(P.rot),me=Math.sin(P.rot),we=ae*re+me*ce,ge=-me*re+ae*ce;re=we,ce=ge;}re=re*P.sx+P.ox,ce=ce*P.sy+P.oy;}a.push(re,ce);}let N=l.length;if(R)for(let U=0;U<R.data.length;U++)l.push(I+R.data[U]);else for(let U=0;U<E;U++)l.push(I+U);let O=C.material!==void 0?i.materials?.[C.material]:void 0,B=O?.pbrMetallicRoughness,V=B?.metallicFactor!==void 0||B?.roughnessFactor!==void 0,j=B?.baseColorFactor??[1,1,1,1],X=B?.baseColorTexture?.index,q=X!==void 0?i.textures?.[X]?.source:void 0,Q=O?.emissiveFactor??[0,0,0],Z=O?.extensions?.KHR_materials_emissive_strength?.emissiveStrength??1;s.push({indexOffset:N,indexCount:l.length-N,baseColor:[j[0],j[1],j[2],j[3]??1],metallic:V?B?.metallicFactor??1:0,roughness:V?B?.roughnessFactor??1:1,emissive:[Q[0]*Z,Q[1]*Z,Q[2]*Z],texture:q??-1,doubleSided:O?.doubleSided===true,blend:O?.alphaMode==="BLEND",alphaCutoff:O?.alphaMode==="MASK"?O.alphaCutoff??.5:.02,node:T});},h=i.skins?.length?null:vf(i,u),m=h?h.nodes:null,y=(C,S,T,A)=>{let k=i.nodes?.[C];if(!k)return;let L=Qa(k),R=G();_e(R,S,L);let I=G(),E=A,H=m?.get(C);if(H?(H.parentNode=A,H.parent=T.slice(),We(I),E=C):_e(I,T,L),k.mesh!==void 0)for(let F of i.meshes?.[k.mesh]?.primitives??[])d(F,I,E);let W=k.extensions?.KHR_lights_punctual?.light;if(W!==void 0){let F=i.extensions?.KHR_lights_punctual?.lights?.[W],P=F?.type;if(F&&(P==="point"||P==="spot"||P==="directional")){let N=-R[8],O=-R[9],B=-R[10],V=Math.hypot(N,O,B)||1,j=F.spot?.innerConeAngle??0,X=F.spot?.outerConeAngle??Math.PI/4;p.push({type:P,color:[F.color?.[0]??1,F.color?.[1]??1,F.color?.[2]??1],intensity:F.intensity??1,range:F.range??0,position:[R[12],R[13],R[14]],direction:[N/V,O/V,B/V],cosInner:Math.cos(j),cosOuter:Math.cos(X)});}}for(let F of k.children??[])y(F,R,I,E);},p=[],b=G();We(b);let g=G();We(g);let v=i.scenes?.[i.scene??0]?.nodes??i.nodes?.map((C,S)=>S)??[];for(let C of v)y(C,b,g,-1);let w=[];for(let C of i.images??[]){if(C.bufferView===void 0){w.push(new Uint8Array(0));continue}let S=o(C.bufferView);w.push(S?S.slice():new Uint8Array(0));}let x=r.length/3,_=new ArrayBuffer(x*Ho),M=new Float32Array(_);for(let C=0;C<x;C++){let S=C*8;M[S]=r[C*3],M[S+1]=r[C*3+1],M[S+2]=r[C*3+2],M[S+3]=n[C*3],M[S+4]=n[C*3+1],M[S+5]=n[C*3+2],M[S+6]=a[C*2],M[S+7]=a[C*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:h,lights:p}}function vf(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,d=s.interpolation==="CUBICSPLINE",h=c.data.length,m=new Float32Array(h*u);for(let p=0;p<h;p++){let b=d?(p*3+1)*u:p*u;for(let g=0;g<u;g++)m[p*u+g]=f.data[b+g];}let y=o.get(a)??{parentNode:-1,parent:We(G()),base:wf(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[h-1]);}return o.size?{duration:r||1,nodes:o}:null}function wf(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 qr(i,e,t,o){let r=i.nodes.get(e);if(!r)return We(o);let n=G();xf(r,t,n);let a=G();if(_e(a,r.parent,n),r.parentNode<0)return el(o,a);let l=G();return qr(i,r.parentNode,t,l),_e(o,l,a)}var el=(i,e)=>{for(let t=0;t<16;t++)i[t]=e[t];return i};function xf(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],d=a.step||u<=0?0:Math.min(Math.max((e-a.times[c])/u,0),1),h=c*s,m=f*s;if(a.path==="rotation"){let y=0;for(let g=0;g<4;g++)y+=a.values[h+g]*a.values[m+g];let p=y<0?-1:1,b=0;for(let g=0;g<4;g++)r[g]=a.values[h+g]*(1-d)+a.values[m+g]*p*d,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[h+p]*(1-d)+a.values[m+p]*d;}}return el(t,Qa({translation:o,rotation:r,scale:n}))}var Ee=5126,_f=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),tl={stride:Ho,attribs:[{name:"a_pos",size:3,type:Ee,offset:0},{name:"a_normal",size:3,type:Ee,offset:12},{name:"a_tex",size:2,type:Ee,offset:24}]},Qr=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);}},Zr=256,Oo=41,ol={stride:Oo*4,attribs:[{name:"a_i_m0",size:4,type:Ee,offset:0,divisor:1},{name:"a_i_m1",size:4,type:Ee,offset:16,divisor:1},{name:"a_i_m2",size:4,type:Ee,offset:32,divisor:1},{name:"a_i_m3",size:4,type:Ee,offset:48,divisor:1},{name:"a_i_s0",size:4,type:Ee,offset:64,divisor:1},{name:"a_i_s1",size:4,type:Ee,offset:80,divisor:1},{name:"a_i_s2",size:4,type:Ee,offset:96,divisor:1},{name:"a_i_s3",size:4,type:Ee,offset:112,divisor:1},{name:"a_i_n0",size:3,type:Ee,offset:128,divisor:1},{name:"a_i_n1",size:3,type:Ee,offset:140,divisor:1},{name:"a_i_n2",size:3,type:Ee,offset:152,divisor:1}]},Gt=2,gt=16,$e=class{constructor(){this.models=[];this.gpu=new z;this.counted=new Set;this.instBuffer=null;this.instScratch=new Float32Array(Zr*Oo);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",Gt);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 d=c.matrixFor(t);o.setMat4("u_matrix",d),o.setMat3("u_normal_matrix",c.normalMatrix());let h=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(!(u&&!y))for(let p of c.mesh.primitives){if(!u&&p.blend!==y)continue;o.setMat4("u_matrix",p.node>=0?c.matrixForNode(t,p.node,l):d),h&&o.setMat4("u_shadow_matrix",p.node>=0?this.shadowMatrixForNodeAt(t,c,p.node,l):h);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(Gt,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 z;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 pe(e,this.instScratch,ol,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",Gt),o.setFloat("u_opacity",1),s=true);let u=c[0].mesh;for(let d=0;d<c.length;d+=Zr){let h=Math.min(Zr,c.length-d);for(let m=0;m<h;m++){let y=c[d+m],p=m*Oo;this.instScratch.set(y.matrixFor(t),p);let b=a?this.shadowMatrix(t,y):_f;this.instScratch.set(b,p+16),this.instScratch.set(y.normalMatrix(),p+32),this.drawnInstanced.add(y);}this.instBuffer.update(this.instScratch.subarray(0,h*Oo)),e.bindVAO(f.instVao.vao);for(let m of u.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(Gt,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,h);}}}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<=gt?r:[...r].sort((f,u)=>u.intensity-f.intensity).slice(0,gt),a=new Float32Array(gt*4),l=new Float32Array(gt*4),s=new Float32Array(gt*4),c=new Float32Array(gt*4);n.forEach((f,u)=>{let d=u*4;a[d]=f.position[0],a[d+1]=f.position[1],a[d+2]=f.position[2],a[d+3]=f.range,l[d]=f.color[0]*f.intensity,l[d+1]=f.color[1]*f.intensity,l[d+2]=f.color[2]*f.intensity,l[d+3]=f.type==="spot"?1:0,s[d]=f.direction[0],s[d+1]=f.direction[1],s[d+2]=f.direction[2],c[d]=f.cosInner,c[d+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 pe(e,new Uint8Array(t.mesh.vertices),tl),l=new ue(e,t.mesh.indices),s=new fe(e,[{buffer:a,locations:o}],l),c=t.bitmaps.map(u=>{if(!u)return null;let d=n.createTexture();return d?(e.bindTexture(Gt,d),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),d):null}),f=new Qr(s,a,l,c);return f.users=1,this.counted.add(t),this.gpu.set(t.url,f),f}static get layout(){return tl}static get instanceLayout(){return ol}destroy(e){for(let t of this.gpu.values())t.destroy(e);this.gpu.clear(),this.models=[];}};var Jr=4,rl=new ee;function Cf(i){rl.has(i)||(rl.add(i),console.warn(`[osmgl] ${i}`));}var Sf=.5,Mf=.01,Tf=300,en=127,kf=.5,vt=128,Ut=5120,Bo=5121,jt=5122,nl=5123,Xt=5126,Ef={stride:8,attribs:[{name:"a_pos",size:2,type:Xt,offset:0}]},tn={stride:Xe,attribs:[{name:"a_pos",size:2,type:jt,offset:0}]},il={stride:Ke,attribs:[{name:"a_p0",size:2,type:jt,offset:0},{name:"a_p1",size:2,type:jt,offset:4},{name:"a_corner",size:2,type:Ut,offset:8},{name:"a_ground",size:2,type:Ut,offset:10},{name:"a_dist",size:1,type:Xt,offset:12},{name:"a_width",size:1,type:Xt,offset:16}]},wt={stride:ke,attribs:[{name:"a_pos",size:2,type:jt,offset:0},{name:"a_height",size:1,type:nl,offset:4},{name:"a_tint",size:1,type:Bo,normalized:true,offset:6},{name:"a_ao",size:1,type:Bo,normalized:true,offset:7},{name:"a_normal",size:3,type:Ut,normalized:true,offset:8},{name:"a_kind",size:1,type:Bo,offset:11},{name:"a_wall",size:3,type:nl,offset:12}]},Af={flat:0,water:1,foliage:2,sand:3,asphalt:4},If=[1,9,14,26,3],al={stride:dt,attribs:[{name:"a_pos",size:2,type:Xt,offset:0},{name:"a_level",size:1,type:jt,offset:8},{name:"a_normal",size:3,type:Ut,normalized:true,offset:10},{name:"a_kind",size:1,type:Bo,offset:13},{name:"a_bleed",size:2,type:Ut,offset:14}]},Wo=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();}},ll={enabled:false,resolution:1024,strength:.75,color:"#5a6b86",bias:.25},Kt=class{constructor(){this.fill=null;this.surface=null;this.surfaceLocs=new z;this.line=null;this.building=null;this.depth=null;this.groundShadow=null;this.sky=null;this.raster=null;this.rasterLayer=new Ro;this.globeBody=null;this.globeClip=null;this.globeMesh=null;this.quad=null;this.fillLocs=new z;this.lineLocs=new z;this.objectLine=null;this.objectLineLocs=new z;this.buildingLocs=new z;this.shadows={...ll};this.shadowTarget=null;this.shadowPlaceholder=null;this.fog=null;this.shadowActive=false;this.materialTime=0;this.materialAnimating=false;this.stencilIds=new z;this.patternScale=1;this.debugTiles=false;this.cameraMeters=[0,0,0];this.dpr=1;this.detailScale=1;this.reliefScale=1;this.allowShadows=true;this.highlight=null;this.highlightGpu=new z;this.highlightKey="";this.groundArrows=new Bt;this.highlightTris=new z;this.fillHighlightGpu=new z;this.fillHighlightKey="";this.footprintKey="";this.highlightFill=null;this.indoorMask=new Wt;this.hiddenBuildings=new Set;this.seams=new ko;this.seamGpu=new z;this.hiddenWithSeams=new z;this.hiddenVenues=new Set;this.hiddenVenueLayer=null;this.hiddenCut=new z;this.hiddenStamp="";this.bucketIdCache=new z;this.surfaceCut=new z;this.shadowDepthPerMeter=1;this.shadowTexelMeters=0;this.growDurationMs=350;this.symbols=null;this.objects=null;this.models=new $e;this.model=null;this.modelInstanced=null;this.modelDepth=null;this.modelLocs=new z;this.modelInstLocs=new z;}get indoorOpen(){return this.indoorMask.active}syncHiddenStamp(){let e=r=>[...r].sort((n,a)=>n-a).join(","),t="";for(let[r,n]of this.seams.hiddenByTile)t+=`${r}=${e(n)};`;let o=e(this.hiddenBuildings)+"#"+e(this.hiddenVenues)+"#"+t;if(o!==this.hiddenStamp){this.hiddenStamp=o,this.hiddenWithSeams.clear();for(let[r,n]of this.seams.hiddenByTile){let a=new Set(this.hiddenBuildings);for(let l of n)a.add(l);this.hiddenWithSeams.set(r,a);}for(let r of this.hiddenCut.values())r?.vao.destroy(),r?.ibo.destroy();this.hiddenCut.clear();for(let r of this.surfaceCut.values())r?.vao.destroy(),r?.ibo.destroy();this.surfaceCut.clear();}}cutSurface(e,t,o,r,n,a){if(!a||!a.size)return null;let l=r+"|"+o,s=this.surfaceCut.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!=="surface"||!c.shapeFeatures||!c.shapeRanges)return null;let f=new Float64Array(c.shapeFeatures),u=new Uint32Array(c.shapeRanges),d=[],h=0;for(let x=0;x<f.length;h++){let _=f[x++],M=_>0;for(let C=0;C<_;C++)if(!a.has(f[x+C])){M=false;break}x+=_,M&&d.push(h);}if(!d.length)return this.surfaceCut.set(l,null),null;let m=new Uint32Array(c.indices),y=c.capIndexOffset??m.length,p=new Uint8Array(m.length);for(let x of d){for(let _=u[x*4];_<u[x*4+1];_++)p[_]=1;for(let _=u[x*4+2];_<u[x*4+3];_++)p[_]=1;}let b=[];for(let x=0;x<y;x++)p[x]||b.push(m[x]);let g=b.length;for(let x=y;x<m.length;x++)p[x]||b.push(m[x]);let v=new ue(e,new Uint32Array(b)),w={vao:new fe(e,[{buffer:n,locations:this.surfaceLocs}],v),ibo:v,vbo:n,mainCount:g,capCount:b.length-g};return this.surfaceCut.set(l,w),w}bucketIds(e,t,o){let r=this.bucketIdCache.get(e);if(r&&r.vbo===o)return r.ids;this.bucketIdCache.size>2e3&&this.bucketIdCache.clear();let n=new Set(new Float64Array(t));return this.bucketIdCache.set(e,{ids:n,vbo:o}),n}replacedIds(){return this.hiddenBuildings.size?this.hiddenBuildings:null}hiddenFor(e,t,o){return t?(o?this.hiddenWithSeams.get(o):void 0)??this.hiddenBuildings:e===this.hiddenVenueLayer?this.hiddenVenues:null}cutHidden(e,t,o,r,n,a,l=this.buildingLocs){if(!a||!a.size)return null;let s=r+"|"+o,c=this.hiddenCut.get(s);if(c!==void 0&&(c===null||c.vbo===n))return c;c&&(c.vao.destroy(),c.ibo.destroy());let f=t.data?.buckets?.[o];if(!f||!("featureIds"in f)||!f.featureIds)return null;let u=this.bucketIds(s,f.featureIds,n),d=false;for(let b of a)if(u.has(b)){d=true;break}if(!d)return this.hiddenCut.set(s,null),null;let h=new Uint32Array(f.indices),m=new Float64Array(f.featureIds),y=[];for(let b=0;b*3<h.length;b++)a.has(m[b])||y.push(h[b*3],h[b*3+1],h[b*3+2]);let p=null;if(y.length<h.length){let b=new ue(e,new Uint32Array(y));p={vao:new fe(e,[{buffer:n,locations:l}],b),ibo:b,count:y.length,vbo:n};}return this.hiddenCut.set(s,p),p}init(e){this.symbols?.init(e),this.fill=new be(e,"fill",Ra,Fa),this.surface=new be(e,"surface",Va,Da),this.line=new be(e,"line",za,Pa),this.objectLine=new be(e,"objectLine",Ha,Oa),this.building=new be(e,"buildings",Ba,Wa),this.depth=new be(e,"depth",xa,Fr),this.groundShadow=new be(e,"groundShadow",Ia,La),this.sky=new be(e,"sky",Ta,ka),this.raster=new be(e,"raster",Ea,Aa),this.globeBody=new be(e,"globeBody",ya,ga),this.globeClip=new be(e,"globeClip",va,wa),this.globeMesh=Lf(e,this.globeBody),this.model=new be(e,"model",Ca,Pr),this.modelInstanced=new be(e,"model-instanced",Sa,Pr),this.modelDepth=new be(e,"modelDepth",Ma,Fr);for(let n of $e.layout.attribs)this.modelLocs.set(n.name,this.model.attribLocation(n.name));for(let n of [...$e.layout.attribs,...$e.instanceLayout.attribs])this.modelInstLocs.set(n.name,this.modelInstanced.attribLocation(n.name));this.shadowPlaceholder=pa(e);let t=new z([["a_pos",this.groundShadow.attribLocation("a_pos")]]),o=new pe(e,new Float32Array([0,0,1,0,1,1,0,1]),Ef),r=new ue(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 tn.attribs)this.fillLocs.set(n.name,this.fill.attribLocation(n.name));for(let n of al.attribs)this.surfaceLocs.set(n.name,this.surface.attribLocation(n.name));for(let n of il.attribs)this.lineLocs.set(n.name,this.line.attribLocation(n.name));for(let n of Yr.attribs)this.objectLineLocs.set(n.name,this.objectLine.attribLocation(n.name));for(let n of wt.attribs)this.buildingLocs.set(n.name,this.building.attribLocation(n.name));}render(e,t,o,r,n,a=new z){if(!this.fill||!this.line||!this.building)return false;let l=t.zoom,s=false;this.materialTime=n/1e3,this.materialAnimating=false,this.fog=bt(t,r),this.patternScale=uo/Math.max(Le(t.center.lat),1),this.dpr=t.width>0?e.gl.drawingBufferWidth/t.width:1;let c=Math.max(t.pixelsPerMeter,1e-9),f=t.cameraPositionPx;this.cameraMeters=[f[0]/c,f[1]/c,f[2]/c];let u=p=>o.get(p.source??$);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 d=p=>p.type==="line"&&D(p.paint.elevation,l,0)!==0,h=new Set;for(let p of r.layers){if(p.type==="raster"||p.type==="fill-extrusion"||p.type==="symbol"||p.overlay||d(p)||!r.layerVisibleAt(p,l))continue;let b=u(p);if(b){if(p.type==="line"&&p.network){if(h.has(p.network))continue;h.add(p.network),this.drawNetwork(e,t,r,u,p.network,l,g=>!g.overlay&&!d(g)&&r.layerVisibleAt(g,l));continue}if(p.type==="surface"){if(!this.flattened(b,r,p))continue;this.drawFill(e,t,b,r,p,l);continue}p.type==="fill"?this.drawFill(e,t,b,r,p,l):this.drawLine(e,t,b,r,p,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,p=>{this.applyFogUniforms(p,t,r),p.setVec4("u_globe",0,0,0,0),p.setInt("u_material",0),p.setFloat("u_elevation",0),p.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 p of r.layers){if(p.type!=="surface"||p.overlay||!r.layerVisibleAt(p,l))continue;let b=u(p);b&&(this.flattened(b,r,p)||this.drawSurface(e,t,b,r,p,l));}e.setStencilTest(false),e.setDepthMask(false),e.setBlend("premultiplied"),e.setCull("none"),e.setDepthTest(false);let m=new Set;for(let p of r.layers){if(p.type==="raster"||!d(p)||p.overlay||!r.layerVisibleAt(p,l))continue;let b=u(p);if(b){if(p.type==="line"&&p.network){if(m.has(p.network))continue;m.add(p.network),this.drawNetwork(e,t,r,u,p.network,l,g=>!g.overlay&&d(g)&&r.layerVisibleAt(g,l));continue}this.drawLine(e,t,b,r,p,l);}}this.drawOverlay(e,t,r,u,l,"roads"),e.setDepthTest(true),e.setDepthMask(true),e.setCull("back");for(let p of r.layers){if(p.type!=="fill-extrusion"||!r.layerVisibleAt(p,l))continue;let b=u(p);b&&(this.drawBuildings(e,t,b,r,p,l,n)&&(s=true),this.drawHighlight(e,t,b,r,p,l));}this.model&&!this.models.isEmpty&&(this.models.render(e,t,this.model,this.modelLocs,p=>{this.applyShadowUniforms(p),this.applyFogUniforms(p,t,r),this.applyLight(p,r);},this.shadowActive,n/1e3,this.modelInstanced?{shader:this.modelInstanced,locations:this.modelInstLocs}:void 0),(this.models.hasAnimated||this.models.hasTransitions)&&(s=true)),this.drawOverlay(e,t,r,u,l,"volume"),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,p=>{this.applyFogUniforms(p,t,r),p.setVec4("u_globe",0,0,0,0),p.setInt("u_material",0),p.setFloat("u_elevation",0),p.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 y=r.layers.filter(p=>p.type==="line"&&D(p.paint.ghostOpacity,l,0)>.001&&r.layerVisibleAt(p,l));if(y.length){e.setDepthTest(true),e.setDepthFunc("greater"),e.setDepthMask(false),e.setBlend("premultiplied"),e.setCull("none");for(let p of y){let b=u(p);b&&this.drawLine(e,t,b,r,p,l,D(p.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,p=>{this.applyFogUniforms(p,t,r),p.setVec4("u_globe",0,0,0,0),p.setInt("u_material",0),p.setFloat("u_elevation",0),p.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(Jr,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 Ht(e,this.shadows.resolution);let l=r.light;if(t.updateShadow(xt(l.keyAzimuth,l.keyAltitude),Tf),!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 d=o.get(u.source??$);if(!d)continue;let h=r.bucketKeyFor(u);if(h===null)continue;let m=D(u.paint.heightScale,t.zoom,1);(u.source??$)===$&&this.indoorMask.prepare(d,h);for(let y of d.visibleTiles){if(!this.drawsTile(t,r,u,y))continue;let p=d.getTile(y),b=p&&this.bucketFor(e,p,h,wt,this.buildingLocs,"fill-extrusion");if(!b)continue;f.setFloat("u_height_scale",this.growScale(b,n,!d.warm)*m),f.setMat4("u_matrix",t.shadowTileMatrix(y,b.extent));let g=(u.source??$)===$,v=this.cutHidden(e,p,h,y.dataKey,b.buffer,this.hiddenFor(h,g,y.dataKey)),w=g?v??this.indoorMask.indicesFor(e,p,h,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(Jr),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,o),r.setMat4("u_matrix",t.localMatrix());let n=o.background;r.setVec3("u_body_color",n[0],n[1],n[2]),Fe(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(he(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);}applyAtmosphere(e,t,o){let r=t.cameraRay();e.setVec3("u_cam_ray",r.axisElev,r.focal*this.dpr,t.height*this.dpr/2),e.setFloat("u_haze_exp",1/Math.max(o.sky.horizonBlend,.01));}skyBand(e,t){let o=e.horizonScreenY(),r=e.height*this.dpr/Math.max(Ie(e.fov),.001);return [(e.height-o)*this.dpr,Math.max(o,1)*this.dpr,Math.max(t.sky.horizonBlend*r,1)]}drawSky(e,t,o){if(!this.sky||!this.quad||!o.sky.enabled)return;let r=this.sky;r.use(),Fe(r,"u_sky_color",o.sky.skyColor),Fe(r,"u_horizon_color",o.sky.horizonColor),Rf(r,o.sky);let[n,a]=this.skyBand(t,o),l=Math.min(a*.5,t.height*this.dpr*.1);r.setVec3("u_sky_params",n,a,l),this.applyAtmosphere(r,t,o);let s=t.cameraRay();r.setVec3("u_cam_right",s.right[0],s.right[1],s.right[2]),r.setVec3("u_cam_up",s.up[0],s.up[1],s.up[2]),r.setVec3("u_cam_fwd",s.fwd[0],s.fwd[1],s.fwd[2]),r.setVec2("u_cam_center",t.width*this.dpr/2,t.height*this.dpr/2);let c=xt(o.light.keyAzimuth,o.light.keyAltitude);r.setVec3("u_sun_dir",-c[0],-c[1],-c[2]),Fe(r,"u_sun_color",o.light.keyColor),r.setFloat("u_sun_glow",o.light.keyIntensity);let f=t.globeActive?1-t.globeFlatMix:0;if(r.setVec2("u_space",f,o.sky.starIntensity),f>.001){Fe(r,"u_space_color",o.sky.spaceColor),Fe(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[d,h,m,y]=t.localRayCorners();r.setVec3("u_ray_tl",d[0],d[1],d[2]),r.setVec3("u_ray_tr",h[0],h[1],h[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,o){if(!t.globeActive){e.setVec4("u_globe",0,0,0,0);return}let r=t.globeBasis,n=t.worldSize;e.setVec4("u_globe",1,t.globeFlatMix,t.globeRadiusPx,n),e.setVec2("u_globe_center",t.centerPointPx.x/n,t.centerPointPx.y/n);let a=t.globeCamera();e.setVec4("u_globe_cam",a.dir[0],a.dir[1],a.dir[2],a.horizonCos);let l=xt(o.light.keyAzimuth,o.light.keyAltitude);e.setVec3("u_globe_sun",-l[0],-l[1],-l[2]),e.setVec2("u_globe_light",.16,.14),e.setMat3("u_globe_basis",[r.east[0],r.south[0],r.up[0],r.east[1],r.south[1],r.up[1],r.east[2],r.south[2],r.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??bt(t,o);if(r.intensity<=0){e.setVec3("u_fog_range",0,1,0),e.setVec2("u_fog_vertical",0,0),this.applyAtmosphere(e,t,o);return}Fe(e,"u_fog_color",o.sky.horizonColor),e.setVec3("u_fog_range",r.near,r.far,r.intensity);let[n,a]=o.sky.fogVerticalRange;e.setVec2("u_fog_vertical",n,a),this.applyAtmosphere(e,t,o);}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(Sf/Math.max(t.pixelsPerMeter,1e-9),Mf);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,en);}drawTileStencil(e,t,o){if(this.stencilIds.clear(),t.globeActive){e.gl.stencilMask(255),e.clear(null,false,true),e.setStencilTest(false);return}let r=o.get($);if(!r||!this.fill||!this.quad)return;let n=r.visibleTiles;if(!n.length||n.length>en)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,en),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||t.globeActive)return;let n=o.get($);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($);if(!n)return;let a=this.groundShadow;a.use(),this.applyShadowUniforms(a),this.applyFogUniforms(a,t,r);let l=r.light,[,,s]=xt(l.keyAzimuth,l.keyAltitude),c=Math.max(-s,0),f=de(l.ambientColor),u=de(l.keyColor),d=[0,0,0];for(let h=0;h<3;h++){let m=f[h]*l.ambientIntensity,y=u[h]*l.keyIntensity*c;d[h]=m>0?m/(m+y):1;}a.setVec3("u_shadow_ground",d[0],d[1],d[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 h of n.visibleTiles)a.setMat4("u_shadow_matrix",t.shadowTileMatrix(h,1)),a.setMat4("u_matrix",t.tileMatrix(h,1)),e.gl.drawElements(e.gl.TRIANGLES,6,e.gl.UNSIGNED_SHORT,0);e.setBlend("premultiplied");}applyShadowUniforms(e){if(e.setInt("u_shadow_map",Jr),!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=de(this.shadows.color);e.setVec3("u_shadow_color",n[0],n[1],n[2]);}get shadowsActive(){return this.shadowActive}drawOverlay(e,t,o,r,n,a){let l=()=>{e.setDepthTest(false),e.setDepthMask(false),e.setBlend("premultiplied"),e.setCull("none");};l();for(let s of o.layers){if(s.type==="raster"||s.type==="symbol"||s.type==="fill-extrusion"||!s.overlay||(s.overlay===true?"volume":s.overlay)!==a||!o.layerVisibleAt(s,n))continue;let c=r(s);if(c){if(s.type==="surface"){this.flattened(c,o,s)?this.drawFill(e,t,c,o,s,n):this.drawSurface(e,t,c,o,s,n),l();continue}s.type==="fill"?this.drawFill(e,t,c,o,s,n):this.drawLine(e,t,c,o,s,n);}}}tileTint(e){let o=((e.x%3+3)%3*2+(e.y%2+2)%2)/6,r=n=>{let a=(n+o*6)%6;return 1-Math.max(0,Math.min(1,Math.min(a,4-a)))};return [r(5),r(3),r(1)]}applyTileScale(e,t,o){if(this.debugTiles){let[s,c,f]=this.tileTint(t);e.setVec4("u_tile_tint",s,c,f,kf);}else e.setVec4("u_tile_tint",0,0,0,0);let r=mo(t.z)/this.patternScale;e.setFloat("u_meters_per_unit",r/o);let[n,a]=Bn(t.z,t.x,t.y);e.setVec2("u_world_origin",n/this.patternScale,a/this.patternScale);let l=this.cameraMeters;e.setVec3("u_camera_local",l[0]-t.x*r,l[1]-t.y*r,l[2]);}applyMaterial(e,t,o){let r=t.paint&&"material"in t.paint?t.paint.material:void 0,n=this.detailScale<=0?0:Af[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,If[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,r),this.applyLight(l,r),this.applyMaterial(l,n,a),l.setVec4v("u_color",Ce([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 d=o.getTile(u),h=d&&this.bucketFor(e,d,f,tn,this.fillLocs,"fill");if(!h)continue;this.clipToTile(e,u),this.shadowActive&&l.setMat4("u_shadow_matrix",t.shadowTileMatrix(u,h.extent)),this.applyTileScale(l,u,h.extent),this.applyTileMatrix(l,t,u,h.extent);let m=this.cutHidden(e,d,f,u.dataKey,h.buffer,this.replacedIds(),this.fillLocs);m?(m.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,m.count,e.gl.UNSIGNED_INT,0)):(h.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,h.indexCount,h.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),d=D(n.paint.width,a,1);if(u<=.001||d<=.01)return;let h=e.gl.drawingBufferWidth,m=e.gl.drawingBufferHeight,y=t.width>0?h/t.width:1,p=d/2*y;c.use(),this.applyFogUniforms(c,t,r),this.applyGlobeUniforms(c,t,r),this.applyLight(c,r),this.applyMaterial(c,n,a),c.setVec4v("u_color",Ce([f[0],f[1],f[2],f[3]*u])),c.setFloat("u_center_w",t.cameraToCenterDistance);let b=D(n.paint.offset,a,0)*y,g=Math.max(D(n.paint.blur,a,0),0)*y;c.setFloat("u_elevation",D(n.paint.elevation,a,0)*this.reliefScale),c.setFloat("u_relief",this.reliefScale),c.setVec2("u_viewport",h,m);let v=n.paint.dashArray,w=n.paint.arrow===true,x=n.paint.arrowStyle,_=w&&(x==="head"||x==="headOnly"),M=w&&x==="dash";if(c.setInt("u_pattern",M?5:v?1:x==="headOnly"&&w?4:_?3:w?2:0),v){let[S,T]=v;c.setVec2("u_dash",S*y,(S+T)*y);}if(w){let S=Ae(n.paint.arrowColor,a,[1,1,1,1]);c.setVec4v("u_arrow_color",Ce(S));let T=D(n.paint.arrowPeriod,a,46)*y,A=D(n.paint.arrowSize,a,5)*y;if(M){let k=D(n.paint.arrowGap,a,24)*y,L=Math.max(T-k,1),R=Math.min(A,L),I=D(n.paint.arrowShaft,a,2)*y,E=D(n.paint.arrowHead,a,4)*y,H=D(n.paint.arrowOutline,a,0)*y;c.setVec4("u_arrow",I,R,E,L),c.setVec2("u_dash",H,T);}else _?c.setVec4("u_arrow",T,A,p,0):c.setVec4("u_arrow",T,Math.max(A*.4,1),Math.min(A,p*.72),0);}let C=r.bucketKeyFor(n);if(C!==null)for(let S of o.visibleTiles){if(!this.drawsTile(t,r,n,S))continue;let T=o.getTile(S);if(!T)continue;let A=n.network?s!==void 0?[Oe(n.id,s)]:(T.data?.levels??[]).map(k=>Oe(n.id,k)):[C];for(let k of A){let L=this.bucketFor(e,T,k,il,this.lineLocs,"line");if(!L)continue;let R=S.bounds(),I=(R.maxX-R.minX)*t.worldSize/L.extent*y;c.setFloat("u_tile_to_px",I);let E=I>1e-6?1/I:1;c.setFloat("u_half_width",p*E),c.setFloat("u_blur",g*E),c.setFloat("u_meters_to_units",t.pixelsPerMeter*E),c.setFloat("u_width_from_data",n.paint.widthFromData===true?1:0),c.setFloat("u_width_extra",D(n.paint.widthExtra,a,0)*E),c.setFloat("u_offset",b*E),c.setFloat("u_tile_per_px",E),this.applyTileScale(c,S,L.extent),this.shadowActive&&c.setMat4("u_shadow_matrix",t.shadowTileMatrix(S,L.extent)),this.applyTileMatrix(c,t,S,L.extent);let H=this.cutHidden(e,T,k,S.dataKey,L.buffer,this.replacedIds(),this.lineLocs);H?(H.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,H.count,e.gl.UNSIGNED_INT,0)):(L.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,L.indexCount,L.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 d of u.visibleTiles){let h=u.getTile(d);for(let m of h?.data?.levels??[])c.add(m);}}if(c.size)for(let f of [...c].sort((u,d)=>u-d))for(let u of s){let d=r(u);d&&this.drawLine(e,t,d,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=de(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");let u=e.gl;e.setStencilTest(true),u.stencilFunc(u.NOTEQUAL,vt,vt),u.stencilOp(u.KEEP,u.KEEP,u.REPLACE),u.stencilMask(vt);let d=this.seams.stitched.has(l.featureId);d&&this.drawSeamHighlight(e,t,f,l.featureId);for(let h of d?[]:o.visibleTiles){let m=o.getTile(h);if(!m)continue;let y=m.data?.buckets?.[n.id];if(!y)continue;let p=h.dataKey,b=this.highlightGpu.get(p);if(b===void 0){let g=Fo(m,n.id,l.featureId);if(g){let v=new pe(e,new Uint8Array(g.vertices),wt),w=new ue(e,g.indices);b={vao:new fe(e,[{buffer:v,locations:this.buildingLocs}],w),vbo:v,ibo:w,count:g.indices.length};}else b=null;this.highlightGpu.set(p,b);}b&&(this.applyTileScale(f,h,y.extent),this.shadowActive&&f.setMat4("u_shadow_matrix",t.shadowTileMatrix(h,y.extent)),f.setMat4("u_matrix",t.tileMatrix(h,y.extent)),b.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,b.count,e.gl.UNSIGNED_INT,0));}e.setStencilTest(false),u.stencilOp(u.KEEP,u.KEEP,u.KEEP),u.stencilMask(255),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??$);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=Fo(c,o.layerId,o.featureId);u&&this.highlightTris.set(s.dataKey,Br(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(d=>d.id===n.layerId),s=l?o.get(l.source??$):void 0;if(!l||!s)return;let c=n.bucketKey,f=de(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",Ce([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,vt,vt),u.stencilOp(u.KEEP,u.KEEP,u.REPLACE),u.stencilMask(vt);for(let d of s.visibleTiles){let h=s.getTile(d),m=h?.data?.buckets?.[c];if(!h||!m||m.kind!=="fill"||!m.featureIds)continue;let y=this.fillHighlightFor(e,m,d,n.featureId,c);y&&(a.setMat4("u_matrix",t.tileMatrix(d,m.extent)),y.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,y.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(d=>{d?.vao.destroy(),d?.ibo.destroy(),d?.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 d=0;d*3<s.length;d++)c[d]===r&&f.push(s[d*3],s[d*3+1],s[d*3+2]);let u=null;if(f.length){let d=new pe(e,new Uint8Array(t.vertices),tn),h=new ue(e,new Uint32Array(f));u={vao:new fe(e,[{buffer:d,locations:this.fillLocs}],h),vbo:d,ibo:h,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.applyGlobeUniforms(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?Ae(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 d=r.bucketKeyFor(n);if(d===null)return;let h=c>=1&&!n.overlay;e.setDepthMask(h),e.setBlend(h?"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,d,al,this.surfaceLocs,"surface");v&&m.push({id:b,bucket:v,cut:g?this.cutSurface(e,g,d,b.dataKey,v.buffer,this.replacedIds()):null});}let y=(b,g,v)=>{this.clipToTile(e,b),this.applyTileScale(l,b,g.extent),this.shadowActive&&l.setMat4("u_shadow_matrix",t.shadowTileMatrix(b,g.extent)),this.applyTileMatrix(l,t,b,g.extent),(v??g).vao.bind();},p=m.filter(({bucket:b,cut:g})=>g?g.capCount>0:b.capIndexOffset<b.indexCount);if(p.length){e.setColorMask(false),e.setDepthMask(true);for(let{id:b,bucket:g,cut:v}of p){y(b,g,v);let w=v?e.gl.UNSIGNED_INT:g.indexType,x=w===e.gl.UNSIGNED_INT?4:2;e.gl.drawElements(e.gl.TRIANGLES,v?v.capCount:g.indexCount-g.capIndexOffset,w,(v?v.mainCount:g.capIndexOffset)*x);}e.setColorMask(true),e.setDepthMask(h);}for(let{id:b,bucket:g,cut:v}of m)y(b,g,v),e.gl.drawElements(e.gl.TRIANGLES,v?v.mainCount:g.capIndexOffset,v?e.gl.UNSIGNED_INT: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 d=(w,x)=>n.paint[w]?r.colorAt({...n,paint:{...n.paint,color:n.paint[w]}},a,x):x,h=d("windowColor",[.62,.71,.8,1]),m=d("windowFrameColor",[c[0]*1.1,c[1]*1.1,c[2]*1.1,1]);s.setVec3("u_window_color",h[0],h[1],h[2]),s.setVec3("u_window_frame",m[0],m[1],m[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_window_variation",D(n.paint.windowVariation,a,1)),s.setFloat("u_seam_strength",D(n.paint.seamStrength,a,1)),s.setFloat("u_window_recess",D(n.paint.windowRecess,a,.18)),s.setFloat("u_window_recess_shade",D(n.paint.windowRecessShade,a,.16)),s.setFloat("u_plinth_height",D(n.paint.plinthHeight,a,4)),s.setFloat("u_plinth_shade",D(n.paint.plinthShade,a,.14)),s.setFloat("u_roof_variation",D(n.paint.roofVariation,a,.3)),this.applyLight(s,r);let y=u>=1;e.setDepthMask(y),e.setBlend(y?"none":"premultiplied");let p=D(n.paint.heightScale,a,1),b=false,g=r.bucketKeyFor(n);if(g===null)return b;let v=(n.source??$)===$;if(v&&this.indoorMask.prepare(o,g),v&&o.visibleTiles.length){let w=o.visibleTiles[0].z;this.seams.update(o,g,{zoom:w,metersPerTile:mo(w),cornerRadius:n.cornerRadius,cornerSegments:n.cornerSegments})&&this.syncSeamGpu();}for(let w of o.visibleTiles){if(!this.drawsTile(t,r,n,w))continue;let x=o.getTile(w),_=x&&this.bucketFor(e,x,g,wt,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 S=this.cutHidden(e,x,g,w.dataKey,_.buffer,this.hiddenFor(g,v,w.dataKey))??(x&&v?this.indoorMask.indicesFor(e,x,g,w,_.buffer,this.buildingLocs):null);S?(S.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,S.count,e.gl.UNSIGNED_INT,0)):(_.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,_.indexCount,_.indexType,0));}return v&&this.drawSeams(e,t,s,p),b}drawSeamHighlight(e,t,o,r){for(let[n,{tile:a,mesh:l}]of this.seams.meshes){let s=`${n}\u241F${r}`,c=this.highlightGpu.get(s);if(c===void 0){let f=Ur(l,r);if(f){let u=new pe(e,new Uint8Array(f.vertices),wt),d=new ue(e,f.indices);c={vao:new fe(e,[{buffer:u,locations:this.buildingLocs}],d),vbo:u,ibo:d,count:f.indices.length};}else c=null;this.highlightGpu.set(s,c);}c&&(this.applyTileScale(o,a,l.extent),this.shadowActive&&o.setMat4("u_shadow_matrix",t.shadowTileMatrix(a,l.extent)),o.setMat4("u_matrix",t.tileMatrix(a,l.extent)),c.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,c.count,e.gl.UNSIGNED_INT,0));}}drawSeams(e,t,o,r){for(let[n,{tile:a,mesh:l}]of this.seams.meshes){let s=this.seamGpu.get(n);if(!s){let c=new pe(e,new Uint8Array(l.vertices),wt),f=new ue(e,new Uint32Array(l.indices)),u=new fe(e,[{buffer:c,locations:this.buildingLocs}],f);s=new Wo(u,c,f,l.indexCount,e.gl.UNSIGNED_INT,l.extent),this.seamGpu.set(n,s);}o.setFloat("u_height_scale",r),this.applyTileScale(o,a,l.extent),this.shadowActive&&o.setMat4("u_shadow_matrix",t.shadowTileMatrix(a,l.extent)),o.setMat4("u_matrix",t.tileMatrix(a,l.extent)),s.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,l.indexCount,e.gl.UNSIGNED_INT,0);}}syncSeamGpu(){for(let e of this.seams.changed){let t=this.seamGpu.get(e);t&&(t.destroy(),this.seamGpu.delete(e));for(let o of [...this.highlightGpu.keys()]){if(!o.startsWith(e+"\u241F"))continue;let r=this.highlightGpu.get(o);r&&(r.vao.destroy(),r.vbo.destroy(),r.ibo.destroy()),this.highlightGpu.delete(o);}}}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?Ff(Math.max(r,0)):1}applyLight(e,t){let o=t.light;Fe(e,"u_ambient_color",o.ambientColor),e.setFloat("u_ambient_intensity",o.ambientIntensity);let[r,n,a]=xt(o.keyAzimuth,o.keyAltitude);e.setVec3("u_key_dir",r,n,a),Fe(e,"u_key_color",o.keyColor),e.setFloat("u_key_intensity",o.keyIntensity);let[l,s,c]=xt(o.fillAzimuth,o.fillAltitude);e.setVec3("u_fill_dir",l,s,c),Fe(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 Cf(`\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 pe(e,new Uint8Array(s.vertices),r),f=new ue(e,new Uint32Array(s.indices)),u=new fe(e,[{buffer:c,locations:n}],f),d=new Wo(u,c,f,f.count,f.type,s.extent,s.capIndexOffset??f.count);return t.buckets.set(o,d),d}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;}},Vo=new z;function Lf(i,e){let r=new Float32Array(66306),n=0;for(let d=0;d<=128;d++){let h=(d/128-.5)*Math.PI;for(let m=0;m<=256;m++)r[n++]=m/256*2*Math.PI-Math.PI,r[n++]=h;}let a=new Uint16Array(256*128*6),l=0;for(let d=0;d<128;d++)for(let h=0;h<256;h++){let m=d*257+h,y=m+256+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:Xt,offset:0}]},c=new z([["a_lnglat",e.attribLocation("a_lnglat")]]),f=new pe(i,r,s),u=new ue(i,a);return {vao:new fe(i,[{buffer:f,locations:c}],u),vbo:f,ibo:u,count:a.length}}function Rf(i,e){if(e.highColor){Fe(i,"u_high_color",e.highColor);return}let t=Vo.get(e.skyColor);t||(t=de(e.skyColor),Vo.set(e.skyColor,t)),i.setVec3("u_high_color",t[0]*.6,t[1]*.74,Math.min(1,t[2]*.99+.02));}function Fe(i,e,t){let o=Vo.get(t);o||(o=de(t),Vo.set(t,o)),i.setVec3(e,o[0],o[1],o[2]);}function xt(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 Ff(i){let o=i-1;return 1+2.20158*o*o*o+1.20158*o*o}var Do=1,Yt=class{constructor(e=1024){this.entries=new z;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+Do>this.size&&(this.shelfY+=this.shelfHeight+Do,this.shelfX=0,this.shelfHeight=0),this.shelfY+r+Do>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+Do,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 on=.75,qt=8,ve=3,Ge=24,_t=256,sl=255,$t=class{constructor(e,t="Noto Sans Regular"){this.urlTemplate=e;this.fontstack=t;this.glyphs=new z;this.loaded=new ee;this.inflight=new z;}get(e){return this.glyphs.get(e)}hasRange(e){return this.loaded.has(Math.floor(e/_t))}needsLoad(e){for(let t of e){let o=t.codePointAt(0);if(o===void 0)continue;let r=Math.floor(o/_t);if(r<=sl&&!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/_t);n>sl||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*_t}-${e*_t+_t-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 cl(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 cl(i){let e=new es__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((d,h,m)=>{m&&(d===1?u.id=m.readVarint():d===2?u.bitmap=m.readBytes():d===3?u.width=m.readVarint():d===4?u.height=m.readVarint():d===5?u.left=m.readSVarint():d===6?u.top=m.readSVarint():d===7&&(u.advance=m.readVarint()));},null,f),t.push(u);},null,a);},null),t}var Pf=.25,Ct=1e20;function rn(i,e,t){let o=e+ve*2,r=t+ve*2,n=o*r,a=new Float64Array(n),l=new Float64Array(n);a.fill(Ct),l.fill(0);for(let c=0;c<t;c++)for(let f=0;f<e;f++){let u=i[c*e+f]/255,d=(c+ve)*o+(f+ve);if(u>=1)a[d]=0,l[d]=Ct;else if(u>0){let h=.5-u;a[d]=h>0?h*h:0,l[d]=h<0?h*h:0;}else a[d]=Ct,l[d]=0;}fl(a,o,r),fl(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]=Hf(Math.round(255-255*(f/qt+Pf)));}return {data:s,width:o,height:r}}function fl(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];ul(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];ul(r,n,a,l,e);for(let c=0;c<e;c++)i[s*e+c]=n[c];}}function ul(i,e,t,o,r){t[0]=0,o[0]=-Ct,o[1]=Ct;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]=Ct;}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 Hf=i=>i<0?0:i>255?255:i;var dl=48,Zt=class{constructor(e={}){this.defs=e;this.sdfs=new z;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(dl*(n>1?n:1))),l=Math.max(8,Math.round(dl/(n<1?n:1))),s=await Of(o,a,l);return this.sdfs.set(e,rn(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 Of(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,d)=>{a.onload=()=>u(),a.onerror=()=>d(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 nt={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>'},Bf={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(Bf)){let t=nt[e];t?nt[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 Wf=1.2;function nn(i,e,t=16,o=0){let r=Vf(i,t),n=[],a=[],l=0;for(let f of r){let u=0,d=0;for(let h of f){let m=h.codePointAt(0);if(m===void 0)continue;let y=e.get(m);y&&(u+=y.advance,d++);}d>1&&(u+=o*(d-1)),a.push(u),u>l&&(l=u);}if(l===0)return null;let s=Ge*Wf,c=r.length*s;for(let f=0;f<r.length;f++){let u=-a[f]/2,d=-c/2+f*s+s/2;for(let h of r[f]){let m=h.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:u,y:d}),u+=y.advance+o);}}return n.length?{glyphs:n,width:l,height:c}:null}function Vf(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 an(i,e,t,o){if(i.length<2)return [];let r=-o,n=-o,a=e+o,l=t+o,s=d=>d.x>=r&&d.x<=a&&d.y>=n&&d.y<=l,c=[],f=[],u=()=>{f.length>=2&&c.push(f),f=[];};for(let d=0;d+1<i.length;d++){let h=i[d],m=i[d+1],y=s(h),p=s(m);if(y&&p){f.length||f.push(h),f.push(m);continue}let b=Df(h,m,r,n,a,l);if(!b){u();continue}f.length||f.push(b[0]),f.push(b[1]),p||u();}return u(),c}function Df(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,d]of f){if(u===0){if(d<0)return null;continue}let h=d/u;if(u<0){if(h>c)return null;h>s&&(s=h);}else {if(h<s)return null;h<c&&(c=h);}}return [{x:i.x+a*s,y:i.y+l*s},{x:i.x+a*c,y:i.y+l*c}]}var Nf=[0,.25,-0.25,.5,-0.5,.75,-0.75,1,-1];function sn(i,e,t,o={}){if(i.length<2||!e.length||t<=0)return [];let r=Xf(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=[],d=o.spacing??250,h=d>0&&d-t<d*.25?t+d*.25:d;if(o.accept)return Gf(i,r,e,t,h,c,a,f,o.accept);if(h>0&&s>=t+h){let y=Math.min(Math.floor((s-t)/h)+1,24),p=t+h*(y-1),b=(s-p)/2;for(let g=0;g<y;g++,b+=h){let v=b/l,w=ln(i,r,e,t,v,c,a,f);w&&u.push({glyphs:w,path:w.map(x=>({x:x.x,y:x.y})),at:v});}if(u.length)return u}let m=(n-t)/2;for(let y of Nf){let p=m+m*y,b=ln(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 Gf(i,e,t,o,r,n,a,l,s){let c=e[e.length-1],f=Math.max(o/3,r/8,12),u=[],d=-1/0;for(let h=0;h+o<=c;h+=f){if(h-d<r)continue;let m=ln(i,e,t,o,h,n,a,l);if(!m)continue;let y={glyphs:m,path:m.map(p=>({x:p.x,y:p.y})),at:h};if(s(y)&&(u.push(y),d=h,u.length>=24))break}return u}function ln(i,e,t,o,r,n,a,l){if(r<0||r+o>e[e.length-1]||!Uf(i,e,r,r+o,n,a))return null;let s=Qt(i,e,r),c=Qt(i,e,r+o);if(!s||!c)return null;if(c.x>=s.x)return hl(i,e,t,r,l);let f=e[e.length-1];return hl([...i].reverse(),Kf(e),t,f-(r+o),l)}function Uf(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),d=Math.abs((u-f)*180/Math.PI+540)%360-180,h=Math.abs(d);for(a.push({at:c,delta:h}),l+=h;a.length&&c-a[0].at>r;)l-=a.shift().delta;if(l>n)return false}return true}function hl(i,e,t,o,r){let n=[];for(let c of t){let f=ml(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(jf(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=ml(i,e,l,t[c].width);if(!f)return null;a.push(f);}return a}function ml(i,e,t,o){let r=Qt(i,e,t+o/2);if(!r)return null;let n=Qt(i,e,t),a=Qt(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 jf(i,e){let t=i-e;for(;t>180;)t-=360;for(;t<=-180;)t+=360;return t}function Xf(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 Kf(i){let e=i[i.length-1];return i.map(t=>e-t).reverse()}function Qt(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 fn=20,pl={stride:fn,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}]},Yf=220,qe=64,bl=2,$f=1.22,qf=128,Zf=.7;function Qf(i,e,t){let o=i.layout?.letterSpacing;if(o!==void 0)return D(o,e,0)*Ge;let r=D(i.paint?.haloWidth,e,0);return r<=0||t<=0?0:r*Zf/(t/Ge)}var Jf=256,eu=200,cn="frame-circle",St=class i{constructor(e,t){this.shader=null;this.locations=new z;this.atlas=new Yt(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 z;this.fading=false;this.styleOrder=new z;this.glyphs=new $t(e,t),this.icons=new Zt(nt);}init(e){this.shader=new be(e,"symbol",Na,Ga);for(let t of pl.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)/Yf;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}))?eu: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(h=>h.type==="symbol"&&r.layerVisibleAt(h,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 z,f=new z,u=new z;l.forEach((h,m)=>u.set(h.id,m));let d=0;for(let h of s){let m=this.place(h,a,c);if(!m)continue;this.placed.push({layerId:h.layer.id,text:h.text,icon:h.icon,mercX:h.mercX,mercY:h.mercY,box:m.box,order:u.get(h.layer.id)??0});let y=f.get(h.layer.id);y||f.set(h.layer.id,y={layer:h.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),d+=m.quads,this.placedCount++;}this.rememberPlaced(),this.fading&&this.onAssetsReady?.(),this.requestMissing(),d&&(this.styleOrder=u,this.draw(e,t,f,d,a));}collect(e,t,o,r){let n=[],l=this.padding,s=bt(e,o).far,[c,f,u]=e.cameraPositionPx;for(let d of r){let h=(d.layout?.priority??0)*Jf,m=t.get(d.source??$);if(!m)continue;let y=d.layout?.showFor==="highlight",p=d.layout?.placement==="map",{shift:b,drop:g}=p?wl(d,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(d);if(w!==null)for(let x of m.visibleTiles){if(!o.layerVisibleAt(d,e.detailZoom(e.distanceToTile(x))))continue;let M=m.getTile(x)?.data?.buckets?.[w];if(!M||!Lo(M))continue;let C=new Int16Array(M.anchors),S=new Uint8Array(M.priorities),T=M.rotations?new Int16Array(M.rotations):null,A=M.lines?new Int16Array(M.lines):null,k=M.lineStarts?new Uint32Array(M.lineStarts):null,L=x.bounds(),R=e.worldSize,I=(L.maxX-L.minX)*R/M.extent,E=L.minX*R,H=L.minY*R;for(let W=0;W<S.length;W++){let F=E+C[W*2]*I,P=H+C[W*2+1]*I;if(s!==1/0&&Math.hypot(F-c,P-f,u)>s||y&&!Ne(this.highlightFootprint,F/R,P/R,v))continue;let N=F,O=P;if(p&&T){let X=T[W]*Math.PI/180,q=b;N-=Math.sin(X)*q,O+=Math.cos(X)*q;}let B=e.worldPxToPoint(N,O),V=A&&k?tu(e,A,k,W,E,H,I):void 0;if(d.layout?.textPlacement==="line"){if(!V)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:d,screenX:B?B.x:V[0].x,screenY:(B?B.y:V[0].y)+g,text:M.texts[W]??"",icon:M.icons[W]??"",priority:S[W]+h,rotate:xl(d,T,W,e.bearing),mercX:F/R,mercY:P/R,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,d]=r.offset??[0,0],h=r.placement==="map",m=null;if(e.icon&&!h){this.icons.isDefined(e.icon)||(e.icon="dot");let J=`icon:${e.icon}`,K=this.atlas.get(J);if(!K){let Y=this.icons.get(e.icon);Y?K=this.atlas.add(J,Y.data,Y.width,Y.height)??void 0:this.pendingIcons.add(e.icon);}K&&(m=K);}let y=null;if(m&&r.iconFrame==="circle"){let J=`icon:${cn}`,K=this.atlas.get(J);if(!K){let Y=this.icons.get(cn);Y?K=this.atlas.add(J,Y.data,Y.width,Y.height)??void 0:this.pendingIcons.add(cn);}K&&(y=K);}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=nn(e.text,this.glyphs,r.textPlacement==="line"?Number.MAX_SAFE_INTEGER:r.maxLineChars??15,Qf(e.layer,t,s)),!b&&!m)||!b&&!m)return null;let g=s/Ge,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 x=r.iconPlacement??"top",_=x==="behind"&&!!m&&!!b,M=x==="top"&&!!m&&!!b,C=m?m.width/Math.max(m.height,1):1,S=_?w+f*2:c,T=m?S*C:0,A=Math.max(T,m?c*p:0),k=Math.max(S,m?c*p:0),L=_?Math.max(T,v+f*2):M?Math.max(A,v):A+(m&&b?f:0)+v,R=_?Math.max(S,w):M?k+f+w:Math.max(m?k:0,w),I=e.screenX+u,E=e.screenY+d,H=bl+(r.collisionPadding??0),W={x1:I-L/2-H,y1:E-R/2-H,x2:I+L/2+H,y2:E+R/2+H},F=this.padding;if(W.x1<F.left||W.y1<F.top||W.x2>this.viewport.width-F.right||W.y2>this.viewport.height-F.bottom)return null;if(!r.allowOverlap){if(yl(o,W))return null;gl(o,W);}let P=[],N=[],O=[],B=[],V=[],j=[],X=0,q=I-L/2,Q=M?(k+f)/2:0,Z=1/0,U=1/0,ne=-1/0,ie=-1/0;if(b){let J=M||_?I:q+(m?A+f:0)+v/2;for(let K of b.glyphs){let Y=K.glyph,oe=`g:${Y.id}`,re=this.atlas.get(oe);if(!re&&(!Y.bitmap||(re=this.atlas.add(oe,Y.bitmap,Y.width+ve*2,Y.height+ve*2)??void 0,!re)))continue;let ce=J+(K.x+Y.left-ve)*g,ae=E+Q+(K.y-Y.top-ve)*g,me=re.width*g,we=re.height*g;No(P,N,ce,ae,me,we,re,0,a),X++;let ge=ve*g;Z=Math.min(Z,ce+ge),U=Math.min(U,ae+ge),ne=Math.max(ne,ce+me-ge),ie=Math.max(ie,ae+we-ge);}if(M&&m&&U<1/0){let K=E-R/2+k+f-U;if(K!==0){for(let Y=1;Y<P.length;Y+=4)P[Y]+=K;U+=K,ie+=K;}}}if(m){let J=l?$f:1,K=T*J,Y=S*J,oe=(M?I-T/2:q+(A-T)/2)-(K-T)/2,re=(M?E-R/2+(k-S)/2:E-S/2)-(Y-S)/2;if(y){let ae=c*p*J,me=oe+K/2-ae/2,we=re+Y/2-ae/2,ge=ve/Math.max(y.height-ve*2,1)*ae;No(V,j,me-ge,we-ge,ae+ge*2,ae+ge*2,y,0,a),X++;}if(_&&ne>Z){let ae=f*1.6,me=f;K=(ne-Z+ae*2)*J,Y=(ie-U+me*2)*J,oe=Z-ae,re=U-me;}let ce=ve/Math.max(m.height-ve*2,1)*Y;No(O,B,oe-ce,re-ce,K+ce*2,Y+ce*2,m,e.rotate,a),X++;}return X?{verts:P,texs:N,iconVerts:O,iconTexs:B,frameVerts:V,frameTexs:j,quads:X,box:W}: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??{},d=[],h=[],m=[],y=0,p=r/2+bl,b=this.padding,g=T=>{let A=T.path.map(k=>({x1:k.x-p,y1:k.y-p,x2:k.x+p,y2:k.y+p}));for(let k of A)if(k.x1<b.left||k.y1<b.top||k.x2>this.viewport.width-b.right||k.y2>this.viewport.height-b.bottom||!u.allowOverlap&&yl(n,k))return false;if(!u.allowOverlap)for(let k of A)gl(n,k);return m.push(...A),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 x=Number.isFinite(v)?(v+w)/2*o:0,M=an(s,this.viewport.width,this.viewport.height,qf).flatMap(T=>sn(T,c,f,{spacing:u.symbolSpacing,fontSize:Ge*o,stableScale:Math.pow(2,Math.round(a)-a),accept:g}));if(!M.length)return null;for(let T of M)for(let A=0;A<t.glyphs.length;A++){let k=t.glyphs[A].glyph,L=T.glyphs[A],R=`g:${k.id}`,I=this.atlas.get(R);if(!I&&(!k.bitmap||(I=this.atlas.add(R,k.bitmap,k.width+ve*2,k.height+ve*2)??void 0,!I)))continue;let E=I.width*o,H=I.height*o,W=(k.height/2-k.top)*o+x,F=L.angle*Math.PI/180;No(d,h,L.x-E/2-Math.sin(F)*W,L.y-H/2+Math.cos(F)*W,E,H,I,L.angle,l),y++;}if(!y)return null;let C=m.map(T=>(T.x1+T.x2)/2),S=m.map(T=>(T.y1+T.y2)/2);return {verts:d,texs:h,iconVerts:[],iconTexs:[],frameVerts:[],frameTexs:[],quads:y,box:{x1:Math.min(...C)-p,y1:Math.min(...S)-p,x2:Math.max(...C)+p,y2:Math.max(...S)+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*fn),u=new Float32Array(f),d=new Uint16Array(f),h=[],m=0,y=(p,b,g,v)=>{let w=p.length/16;if(w){h.push({layer:g,role:v,first:m/4*6,count:w*6});for(let x=0;x<w*4;x++){let _=m*5;u[_]=p[x*4],u[_+1]=p[x*4+1],d[_*2+4]=b[x*2],d[_*2+5]=b[x*2+1],u[_+3]=p[x*4+2],u[_+4]=p[x*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",on),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 h){let b=p.layer.paint,g=D(b.opacity,n,1),v=p.role==="icon",w=p.role==="frame",x=(A,k,L)=>w?k??A??L:v?A??L:L,_=Ae(w?b.frameColor??b.haloColor??b.color:x(b.iconColor,void 0,b.color),n,[.15,.15,.15,1]),M=w?b.frameHaloColor:x(b.iconHaloColor,void 0,b.haloColor),C=Ae(M??(w?b.iconColor??b.color:b.haloColor),n,[1,1,1,1]);w&&b.frameHaloColor===void 0&&(C[3]*=.35),w&&(_[3]*=D(b.frameOpacity,n,1));let S=D(w?b.frameHaloWidth??1.1:x(b.iconHaloWidth,void 0,b.haloWidth),n,1.2),T=D(p.layer.layout?.textSize,n,13);a.setVec4v("u_color",Ce([_[0],_[1],_[2],_[3]*g])),a.setVec4v("u_halo_color",Ce([C[0],C[1],C[2],C[3]*g])),a.setFloat("u_halo",S/(qt*(T/Ge))),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 pe(e,new Uint8Array(this.capacityQuads*4*fn),pl,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 ue(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 No(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),d=Math.sin(f),h=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-h,g=p-m;i.push(h+b*u-g*d,m+b*d+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 tu(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 vl=(i,e)=>i*4096+e;function yl(i,e){let t=Math.floor(e.x1/qe),o=Math.floor(e.y1/qe),r=Math.floor(e.x2/qe),n=Math.floor(e.y2/qe);for(let a=t;a<=r;a++)for(let l=o;l<=n;l++){let s=i.get(vl(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 gl(i,e){let t=Math.floor(e.x1/qe),o=Math.floor(e.y1/qe),r=Math.floor(e.x2/qe),n=Math.floor(e.y2/qe);for(let a=t;a<=r;a++)for(let l=o;l<=n;l++){let s=vl(a,l),c=i.get(s);c||i.set(s,c=[]),c.push(e);}}function wl(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 xl(i,e,t,o){return !i.layout?.iconRotate||!e?0:e[t]-o}var Mt=class{constructor(e,t){this.capacity=e;this.onEvict=t;this.map=new z;}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 Tt=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 ou(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 Tt(t,s,l),f=c.bounds(),u=(f.minX+f.maxX)/2,d=(f.minY+f.maxY)/2,h=[[u,d],[f.minX,f.minY],[f.maxX,f.minY],[f.minX,f.maxY],[f.maxX,f.maxY]],m=false;for(let[p,b]of h)if(i.isOnGlobeFront(Te(p),Se(b))){m=true;break}if(!m)continue;let y=false;for(let[p,b]of h){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 Jt(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 ou(i,e,l);let{min:s,max:c}=i.visibleWrapRange(),f=[],u=[];for(let h=s;h<=c;h++)u.push(new Tt(0,0,0,h));let d=0;for(;u.length&&!(++d>2e4||f.length>=n);){let h=u.pop();if(!i.isTileVisible(h))continue;if(h.z>=l){h.z>=o&&f.push(h);continue}if(i.tileScreenSize(h.z,i.distanceToTile(h))<=a&&h.z>=o){f.push(h);continue}for(let y of h.children())u.push(y);}return f.sort((h,m)=>i.distanceToTile(h)-i.distanceToTile(m)),f}var dn=class{constructor(e){this.id=e;this.state="loading";this.data=null;this.error=null;this.requestId=0;this.buckets=new z;}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;}},un=6,ru=24,Go=class extends Ue{constructor(t,o){super();this.pool=t;this.visible=[];this.warmed=false;this.version=0;this.opts={cacheSize:160,detailBias:1,maxTiles:512,rank:1,...o},this.cache=new Mt(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}loadedTiles(){return this.cache.entries()}get pendingCount(){let t=0;for(let o of this.cache.values())o.state==="loading"&&t++;return t}update(t){let o=Jt(t,this.opts),r=new ee;for(let c of o)r.add(c.dataKey);for(let[c,f]of this.cache.entries())f.state==="loading"&&!r.has(c)&&(this.pool.abort(f.requestId),this.cache.delete(c));let n=Math.max(this.opts.cacheSize,r.size*2);this.cache.setCapacity(n);let a=this.opts.rank*1e9;for(let c of o)this.cache.get(c.dataKey)||this.loadTile(c,a+t.distanceToTile(c));let l=this.coverFor(o),s=this.readyFor(o);(this.anyReady(l)||this.visible.length===0||!this.covers(o))&&(this.visible=l,s&&o.length&&(this.warmed=true));}coverFor(t){let o=c=>{let f=this.cache.peek(c.dataKey);return !!f&&f.state!=="loading"},r=(c,f)=>{let u=f.parent();for(let d=0;u&&d<=un;d++){if(u.dataKey===c.dataKey)return true;u=u.parent();}return false},n=new z,a=[];for(let c of t)o(c)?n.set(c.dataKey,c):a.push(c);let l=this.descendantsOf(a);for(let c of a){let f=l.get(c.dataKey);if(f&&f.length){for(let m of f)n.set(m.dataKey,m),this.cache.get(m.dataKey);continue}let u=c.parent(),d=null;for(let m=1;u&&m<=un;m++,u=u.parent()){if(!o(u))continue;let y=u;if(m>1&&t.some(p=>p!==c&&o(p)&&r(y,p)))break;d=y;break}let h=d??c;n.set(h.dataKey,h);}let s=[];for(let[,c]of n){let f=c.parent(),u=false;for(let d=0;f&&d<=un;d++){if(n.has(f.dataKey)){u=true;break}f=f.parent();}u||(s.push(c),this.cache.get(c.dataKey));}return s}descendantsOf(t){let o=new z;for(let n of t)o.set(n.dataKey,n);let r=new z;if(!o.size)return r;for(let[n,a]of this.cache.entries()){if(a.state==="loading")continue;let l=a.id.parent();for(let s=0;l&&s<ru;s++){let c=o.get(l.dataKey);if(c){let f=r.get(c.dataKey);f?f.push(a.id):r.set(c.dataKey,[a.id]);break}l=l.parent();}}return r}anyReady(t){for(let o of t){let r=this.cache.peek(o.dataKey);if(r&&r.state!=="loading")return true}return t.length===0}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}deactivate(){for(let[t,o]of this.cache.entries())o.state==="loading"&&(this.pool.abort(o.requestId),this.cache.delete(t));this.visible=[];}loadTile(t,o=0){let r=new dn(t);this.cache.set(t.dataKey,r);let n=nu(this.opts.url.replace("{z}",String(t.z)).replace("{x}",String(t.x)).replace("{y}",String(t.y)));r.requestId=this.pool.load({url:n,zoom:t.z,metersPerTile:On(t.z,t.y),sourceMaxZoom:this.opts.maxzoom,plan:this.opts.plan},a=>{if(this.cache.peek(t.dataKey)===r){if(a.type==="error"){if(a.aborted)return;r.state="error",r.error=a.message,this.emit("error",{tile:t,message:a.message});}else r.data=a,r.state=Object.keys(a.buckets).length?"loaded":"empty",this.version++,a.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 ${a.diag.failed.join("; ")}`),this.emit("data",{tile:r});this.pendingCount===0&&this.emit("idle",void 0);}},o);}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 nu(i){if(typeof location>"u")return i;try{return new URL(i,location.href).href}catch{return i}}var Uo=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;}},eo=class extends Ue{constructor(t){super();this.visible=[];this.aborts=new Map;this.opts={cacheSize:128,detailBias:1,maxTiles:256,...t},this.cache=new Mt(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=Jt(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 Uo(t);this.cache.set(t.dataKey,o);let r=new AbortController;this.aborts.set(t.dataKey,r),this.fetchImage(_l(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 _l(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 iu="osmgl-assets",kt="assets";var jo=null;function Sl(){return jo||(jo=new Promise(i=>{if(typeof indexedDB>"u")return i(null);try{let e=indexedDB.open(iu,1);e.onupgradeneeded=()=>{let t=e.result;t.objectStoreNames.contains(kt)||t.createObjectStore(kt,{keyPath:"key"});},e.onsuccess=()=>i(e.result),e.onerror=()=>i(null);}catch{i(null);}}),jo)}function au(i){return Sl().then(e=>new Promise(t=>{if(!e)return t(null);try{let o=e.transaction(kt,"readonly").objectStore(kt).get(i);o.onsuccess=()=>t(o.result??null),o.onerror=()=>t(null);}catch{t(null);}}))}function lu(i){Sl().then(e=>{if(e)try{e.transaction(kt,"readwrite").objectStore(kt).put(i);}catch{}});}var Cl=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 su(i,e,t){let o=await crypto.subtle.importKey("raw",Cl(e),"AES-GCM",false,["decrypt"]);return crypto.subtle.decrypt({name:"AES-GCM",iv:Cl(t),tagLength:128},o,i)}var to=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 au(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(),lu({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 su(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 cu=1,oo=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-${cu++}`,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 $r(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=te(this.coordinates);return {x:le(e.lng),y:se(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=mn(n(-this.rotation));this.rotationTiltX&&(a=Ze(hn(n(this.rotationTiltX)),a)),this.rotationTiltZ&&(a=Ze(pn(n(this.rotationTiltZ)),a));let l=Ze(r,a),s=this.matrix;return We(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=te(this.coordinates),r=G();for(let a=0;a<16;a++)r[a]=e[a];let n=G();return _e(n,r,this.localMatrix(o.lat)),Ve(t??this.matrix32,n)}cameraInModelSpace(e){let t=this.effectiveScale();if(!(t>0))return [0,0,0];let o=this.origin(),r=te(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,u=s,d=f,h=c,m=p=>p*Math.PI/180,y=mn(m(-this.rotation));return this.rotationTiltX&&(y=Ze(hn(m(this.rotationTiltX)),y)),this.rotationTiltZ&&(y=Ze(pn(m(this.rotationTiltZ)),y)),[(y[0]*u+y[1]*d+y[2]*h)/t,(y[3]*u+y[4]*d+y[5]*h)/t,(y[6]*u+y[7]*d+y[8]*h)/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=te(this.coordinates),s=this.localMatrix(l.lat),c=s[0],f=s[1],u=s[8],d=s[9],h=c*d-f*u;if(Math.abs(h)<1e-30)return false;let m=(n*d-a*u)/h,y=(c*a-f*n)/h,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 u=0;u<16;u++)a[u]=e[u];let l=te(this.coordinates),s=G();_e(s,a,this.localMatrix(l.lat));let c=G();qr(n,t,n.duration>0?o%n.duration:0,c);let f=G();return _e(f,s,c),Ve(r,f)}normalMatrix(){let e=n=>n*Math.PI/180,t=mn(e(-this.rotation));this.rotationTiltX&&(t=Ze(hn(e(this.rotationTiltX)),t)),this.rotationTiltZ&&(t=Ze(pn(e(this.rotationTiltZ)),t));let o=Ze([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 Ze(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 hn=i=>{let e=Math.cos(i),t=Math.sin(i);return [1,0,0,0,e,t,0,-t,e]},mn=i=>{let e=Math.cos(i),t=Math.sin(i);return [e,0,-t,0,1,0,t,0,e]},pn=i=>{let e=Math.cos(i),t=Math.sin(i);return [e,t,0,-t,e,0,0,0,1]};var Ko=class{constructor(){this.hit=new z;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),d=new Float64Array(a.featureIds),h=f.length/a.vertexCount;for(let m=0;m*3+2<u.length;m++){let y=u[m*3]*h,p=u[m*3+1]*h,b=u[m*3+2]*h;if(!bu(s,c,f[y],f[y+1],f[p],f[p+1],f[b],f[b+1]))continue;let g=d[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="";}},fu=14,uu=2e3,du=4e3,Ml=160,hu=50,mu=4e3,bn=6,Yo=class{constructor(e){this.wantKey="";this.modelKey="";this.entries=new z;this.loading=0;this.pending=[];this.known=new z;this.underBuilding=new Ko;this.underVenue=new Ko;this.tilesStamp="";this.rulesInScan=0;this.found=[];this.foundStamp="";this.sortedAt=null;this.budgetScale=1;this.addModel=null;this.lod=0;this.budget=Ml;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 to(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??fu,f=s.loadRadius??uu,u=Math.max(s.keepRadius??du,f),d=Math.min(1,Math.max(.25,(o.zoom-c)/3)),h=Math.max(8,Math.round((s.budget??Ml)*this.budgetScale*d));this.budget=h,this.addModel=r;let m=s.maskReplaced!==false,y=performance.now();if(o.zoom<c){for(let E of [...this.entries.values()])E.model.retire(),E.model.grow<=0&&this.release(E,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 E of t.visibleTiles)g+=E.dataKey+(t.getTile(E)?.data?"+":"-");let v=this.rulesInScan;if(g!==this.tilesStamp){this.tilesStamp=g;let E=new ee;v=0;for(let H of t.visibleTiles){let W=t.getTile(H)?.data?.buckets?.[e.id];if(!W||!Ua(W))continue;let F=new Int16Array(W.anchors),P=H.bounds(),N=P.maxX-P.minX,O=P.maxY-P.minY;for(let B=0;B<W.props.length;B++){let V=W.props[B],j=it(V.file,NaN);if(!Number.isFinite(j))continue;let X=String(V.kind??"model"),q=X==="rule"?`t-${V.rid}-${V.oid}`:`m-${V.mid}`;if(E.has(q))continue;E.add(q),X==="rule"&&v++;let Q=P.minX+F[B*2]/W.extent*N,Z=P.minY+F[B*2+1]/W.extent*O,U=pu(Q,Z);this.known.set(q,{id:q,fileId:j,lng:U.lng,lat:U.lat,mercX:Q,mercY:Z,altitude:it(V.alt,0),scale:it(V.scale,1),rotation:it(V.rx,0),tiltX:it(V.rz,0),tiltZ:it(V.ry,0),kind:X==="rule"?"rule":"model",target:Tl(X==="rule"?V.oid:V.replaces),replaces:m?X==="rule"?Xo(V.oid):String(V.anchor??"replace")==="replace"?Xo(V.replaces_all).length?Xo(V.replaces_all):Xo(V.replaces):[]:[]});}}this.rulesInScan=v;}g!==this.foundStamp&&(this.foundStamp=g,this.found=[...this.known.values()],this.sortedAt=null);let w=this.found,x=new ee;for(let E of w)E.kind==="model"&&E.target!==null&&x.add(E.target);let _=111320,M=Math.cos(p.lat*Math.PI/180),C=E=>Math.hypot((E.lng-p.lng)*_*M,(E.lat-p.lat)*_);this.replacedBuildings.clear(),this.replacedVenues.clear();let S=new ee,T=[],A=0,k=0;(this.sortedAt===null||Math.hypot((p.lng-this.sortedAt.lng)*_*M,(p.lat-this.sortedAt.lat)*_)>hu)&&(w.sort((E,H)=>C(E)-C(H)),this.sortedAt={lng:p.lng,lat:p.lat});let R=0;for(let E of w){let H=C(E);if(H>u){A++;continue}if(E.kind==="rule"&&E.target!==null&&x.has(E.target)){let N=this.entries.get(E.id);N&&N.model.retire();continue}let W=this.entries.get(E.id);if(R>=h){k++,W&&W.model.retire();continue}R++,S.add(E.id);let F=()=>{if(!E.replaces.length)return;for(let B of E.replaces)this.replacedBuildings.add(B);let N=this.underBuilding.find(E,a);N!==null&&this.replacedBuildings.add(N);let O=this.underVenue.find(E,l);O!==null&&this.replacedVenues.add(O);},P=W;if(P){F(),P.distance=H,P.leftAt=0,P.model.revive(),b<P.lod&&!P.upgrading&&this.loading<bn&&this.upgrade(P,b,r,n);continue}if(H>f){A++;continue}if(this.loading>=bn){T.push(E),F();continue}F(),this.spawn(E,H,b,r);}for(let E of [...this.entries.values()])if(!S.has(E.placement.id)){if(E.leftAt===0){E.leftAt=y;continue}y-E.leftAt>mu&&E.model.retire();}for(let E of [...this.entries.values()])E.model.growTarget===0&&E.model.grow<=0&&this.release(E,n);if(this.known.size>4e3)for(let[E,H]of [...this.known.entries()])C(H)>u*3&&this.known.delete(E);let I=this.stats;I.found=w.length,I.kept=S.size,I.live=this.entries.size,I.tooFar=A,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<bn&&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 oo({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;}},it=(i,e)=>{let t=typeof i=="number"?i:Number(i);return Number.isFinite(t)?t:e},Xo=i=>{if(i==null)return [];let e=[];for(let t of String(i).split(",")){let o=Number(t);Number.isFinite(o)&&o!==0&&e.push(o);}return e},Tl=i=>{let e=it(i,NaN);return Number.isFinite(e)?e:null};function pu(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 bu(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,d=s>0||c>0||f>0;return !(u&&d)}var yu=200,gu={center:"translate(-50%, -50%)",top:"translate(-50%, 0)",bottom:"translate(-50%, -100%)",left:"translate(0, -50%)",right:"translate(-100%, -50%)"},ro=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=gu[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??vu),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=te(this._coordinates),o=e.worldSize,r=e.worldPxToPoint(le(t.lng)*o,se(t.lat)*o,this.altitude);if(!r){this.culled=true,this.applyVisibility();return}let n=yu;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";}},vu='<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 no=class extends ro{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 wu=[["\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."]],kl=new Map(wu);function yn(i){let e=i.split(" ");if(e.length<2)return i;let t=false,o=e.map(n=>{let a=kl.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=>kl.get(n.toLowerCase())===void 0).length?i:o.join(" ")}function vn(i,e){let t=[],o=[],r=[],n=[],a=[],l=e.textPlacement==="line",s=[],c=[],f=[];for(let u of i.features()){if(!ye(e.filter,u.properties))continue;let d=u.loadGeometry(),h=Cu(u.type,d);if(!h)continue;let m=e.textField?gn(e.textField,u.properties):"",y=m&&e.abbreviate?yn(m):m,p=e.iconImage?gn(e.iconImage,u.properties):"";if(!(!y&&!p)){if(l){let b=_u(u.type,d);if(!b)continue;f.push({text:y,line:b});continue}t.push(h[0],h[1]),o.push(y),r.push(p),n.push(Su(u.properties)),a.push(e.iconRotate&&Math.round(Number(u.properties[e.iconRotate]??0))||0);}}if(l){for(let{text:u,line:d}of xu(f)){c.push(s.length/2);for(let h of d)s.push(h);t.push(Math.round(d[0]),Math.round(d[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 xu(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 d=e[c];u.line.push(...d.line.slice(2)),d.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 _u(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 Cu(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],d=c[f+3]-c[f+1],h=u*u+d*d;h>a&&(a=h,l=c[f]+u/2,s=c[f+1]+d/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 Su(i){let e=i.rank;return typeof e=="number"&&isFinite(e)?Math.max(0,255-Math.min(e,255)):128}function gn(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 El(i,e){let t=[],o=[];for(let r=0;r<i.length;r++){let n=i.feature(r);if(n.type===1&&ye(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 Mu(){let i=typeof self<"u"?self.origin:void 0;return i&&i!=="null"&&!i.startsWith("blob:")?i+"/":void 0}async function Al(i,e){let t=performance.now(),o=Mu(),r=await fetch(i.url,{signal:e,credentials:"same-origin",...o?{referrer:o}:{}}),n=(g,v,w,x,_=0)=>({type:"loaded",id:i.id,buckets:{},timing:{fetchMs:x,parseMs:_},diag:{status:g,bytes:v,layers:w,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 Rt(a),f=Object.keys(c.layers),u={},d=[],h={},m=new Set,y=[],b=i.plan.some(g=>g.type==="surface"&&(g.elevation??0)>0)&&i.plan.some(g=>g.type==="line"&&g.ground)?Cr(i.metersPerTile):void 0;for(let g of i.plan){if(!ku(g,i.zoom,i.sourceMaxZoom))continue;let v=c.layers[g.sourceLayer];if(!v)continue;let w=Eu(i.zoom,v.extent);try{if(g.splitBy){let _=Au(v,g.splitBy,g.filter);if(!_.length)continue;let M=h[g.splitBy]??(h[g.splitBy]=[]);for(let C of _){M.includes(C)||M.push(C);let S={...g,splitBy:void 0,filter:Lu(g.filter,g.splitBy,C)},T=wn(S,v,w,i.metersPerTile,b,void 0,d);T&&(u[Oe(g.id,C)]=T);}continue}if(g.network&&g.type==="line"){for(let _ of Iu(v,g.filter)){let M=wn(g,v,w,i.metersPerTile,b,_,d);M&&(u[Oe(g.id,_)]=M,m.add(_));}continue}let x=wn(g,v,w,i.metersPerTile,b,void 0,d);x&&(u[g.id]=x);}catch(x){y.push(`${g.id}: ${x instanceof Error?x.message:String(x)}`);}}return {type:"loaded",id:i.id,buckets:u,...d.length?{seams:d}:{},...Object.keys(h).length?{splits:h}:{},...m.size?{levels:[...m].sort((g,v)=>g-v)}:{},timing:{fetchMs:l,parseMs:performance.now()-s},diag:{status:r.status,bytes:a.byteLength,layers:f,built:Object.keys(u).length,...y.length?{failed:y}:{}}}}function Tu(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 ku(i,e,t){let o=e-1,r=e<t?e+1:24;return !(i.maxzoom<o||i.minzoom>r)}function Eu(i,e){return i<=6?Math.max(64,e/24):0}function wn(i,e,t,o,r,n,a){{if(i.type==="fill"){let s=o>0?o/e.extent:0,c=i.cornerRadius&&s>0?{radius:i.cornerRadius/s,segments:i.cornerSegments,extent:e.extent,minCutRatio:0,maxChord:ni/s}:void 0,f=pr(e,i.filter,t,c,i.clipToTile===true,e.extent);return f?{kind:"fill",...f,extent:e.extent}:null}if(i.type==="surface"){let s=_r(e,e.extent,i.filter,{metersPerUnit:o>0?o/e.extent:0,maxSegment:t,elevation:i.elevation??0,base:i.base,bevel:i.bevel,weld:i.weld,bevelDrop:i.bevelDrop,cornerRadius:i.cornerRadius,cornerSegments:i.cornerSegments,...r?{onShapes:c=>Sr(r,c,i.elevation??0,e.extent)}:{},...i.groundBy?{liftBy:Tu(i.groundBy)}:{}});return s?{kind:"surface",...s}:null}if(i.type==="line"){let s=Tr(e,i.filter,t,i.ground?r:void 0,o>0?o/e.extent:0,{level:n});return s?{kind:"line",...s,extent:e.extent}:null}if(i.type==="model"){let s=El(e,i.filter);return s?{kind:"placement",...s,extent:e.extent}:null}if(i.type==="symbol"){let s=vn(e,{filter:i.filter,textField:i.textField,iconImage:i.iconImage,iconRotate:i.iconRotate,textPlacement:i.textPlacement,abbreviate:i.abbreviate});return s?{kind:"symbol",...s,extent:e.extent}:null}let l=dr(e,e.extent,i.filter,{metersPerUnit:o>0?o/e.extent:0,cornerRadius:i.cornerRadius,cornerSegments:i.cornerSegments},a);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 Au(i,e,t){let o=[];for(let r of i.features()){if(!ye(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 Iu(i,e){let t=[];for(let o of i.features()){if(!ye(e,o.properties))continue;let r=rt(o.properties);t.includes(r)||t.push(r);}return t.sort((o,r)=>o-r)}function Lu(i,e,t){let o=["==",e,t];return i?["all",i,o]:o}var xn='"use strict";(()=>{var pr=Object.create;var tn=Object.defineProperty;var mr=Object.getOwnPropertyDescriptor;var dr=Object.getOwnPropertyNames;var xr=Object.getPrototypeOf,gr=Object.prototype.hasOwnProperty;var yr=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var br=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of dr(t))!gr.call(e,i)&&i!==n&&tn(e,i,{get:()=>t[i],enumerable:!(r=mr(t,i))||r.enumerable});return e};var wr=(e,t,n)=>(n=e!=null?pr(xr(e)):{},br(t||!e||!e.__esModule?tn(n,"default",{value:e,enumerable:!0}):n,e));var Un=yr((zt,jt)=>{(function(e,t){typeof zt=="object"&&typeof jt<"u"?jt.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self,e.polygonClipping=t())})(zt,function(){"use strict";function e(y,s){var l={label:0,sent:function(){if(p[0]&1)throw p[1];return p[1]},trys:[],ops:[]},a,d,p,M;return M={next:w(0),throw:w(1),return:w(2)},typeof Symbol=="function"&&(M[Symbol.iterator]=function(){return this}),M;function w(E){return function(C){return R([E,C])}}function R(E){if(a)throw new TypeError("Generator is already executing.");for(;l;)try{if(a=1,d&&(p=E[0]&2?d.return:E[0]?d.throw||((p=d.return)&&p.call(d),0):d.next)&&!(p=p.call(d,E[1])).done)return p;switch(d=0,p&&(E=[E[0]&2,p.value]),E[0]){case 0:case 1:p=E;break;case 4:return l.label++,{value:E[1],done:!1};case 5:l.label++,d=E[1],E=[0];continue;case 7:E=l.ops.pop(),l.trys.pop();continue;default:if(p=l.trys,!(p=p.length>0&&p[p.length-1])&&(E[0]===6||E[0]===2)){l=0;continue}if(E[0]===3&&(!p||E[1]>p[0]&&E[1]<p[3])){l.label=E[1];break}if(E[0]===6&&l.label<p[1]){l.label=p[1],p=E;break}if(p&&l.label<p[2]){l.label=p[2],l.ops.push(E);break}p[2]&&l.ops.pop(),l.trys.pop();continue}E=s.call(y,l)}catch(C){E=[6,C],d=0}finally{a=p=0}if(E[0]&5)throw E[1];return{value:E[0]?E[1]:void 0,done:!0}}}var t=function(){function y(s,l){this.next=null,this.key=s,this.data=l,this.left=null,this.right=null}return y}();function n(y,s){return y>s?1:y<s?-1:0}function r(y,s,l){for(var a=new t(null,null),d=a,p=a;;){var M=l(y,s.key);if(M<0){if(s.left===null)break;if(l(y,s.left.key)<0){var w=s.left;if(s.left=w.right,w.right=s,s=w,s.left===null)break}p.left=s,p=s,s=s.left}else if(M>0){if(s.right===null)break;if(l(y,s.right.key)>0){var w=s.right;if(s.right=w.left,w.left=s,s=w,s.right===null)break}d.right=s,d=s,s=s.right}else break}return d.right=s.left,p.left=s.right,s.left=a.right,s.right=a.left,s}function i(y,s,l,a){var d=new t(y,s);if(l===null)return d.left=d.right=null,d;l=r(y,l,a);var p=a(y,l.key);return p<0?(d.left=l.left,d.right=l,l.left=null):p>=0&&(d.right=l.right,d.left=l,l.right=null),d}function o(y,s,l){var a=null,d=null;if(s){s=r(y,s,l);var p=l(s.key,y);p===0?(a=s.left,d=s.right):p<0?(d=s.right,s.right=null,a=s):(a=s.left,s.left=null,d=s)}return{left:a,right:d}}function u(y,s,l){return s===null?y:(y===null||(s=r(y.key,s,l),s.left=y),s)}function c(y,s,l,a,d){if(y){a(""+s+(l?"\\u2514\\u2500\\u2500 ":"\\u251C\\u2500\\u2500 ")+d(y)+`\n`);var p=s+(l?" ":"\\u2502 ");y.left&&c(y.left,p,!1,a,d),y.right&&c(y.right,p,!0,a,d)}}var f=function(){function y(s){s===void 0&&(s=n),this._root=null,this._size=0,this._comparator=s}return y.prototype.insert=function(s,l){return this._size++,this._root=i(s,l,this._root,this._comparator)},y.prototype.add=function(s,l){var a=new t(s,l);this._root===null&&(a.left=a.right=null,this._size++,this._root=a);var d=this._comparator,p=r(s,this._root,d),M=d(s,p.key);return M===0?this._root=p:(M<0?(a.left=p.left,a.right=p,p.left=null):M>0&&(a.right=p.right,a.left=p,p.right=null),this._size++,this._root=a),this._root},y.prototype.remove=function(s){this._root=this._remove(s,this._root,this._comparator)},y.prototype._remove=function(s,l,a){var d;if(l===null)return null;l=r(s,l,a);var p=a(s,l.key);return p===0?(l.left===null?d=l.right:(d=r(s,l.left,a),d.right=l.right),this._size--,d):l},y.prototype.pop=function(){var s=this._root;if(s){for(;s.left;)s=s.left;return this._root=r(s.key,this._root,this._comparator),this._root=this._remove(s.key,this._root,this._comparator),{key:s.key,data:s.data}}return null},y.prototype.findStatic=function(s){for(var l=this._root,a=this._comparator;l;){var d=a(s,l.key);if(d===0)return l;d<0?l=l.left:l=l.right}return null},y.prototype.find=function(s){return this._root&&(this._root=r(s,this._root,this._comparator),this._comparator(s,this._root.key)!==0)?null:this._root},y.prototype.contains=function(s){for(var l=this._root,a=this._comparator;l;){var d=a(s,l.key);if(d===0)return!0;d<0?l=l.left:l=l.right}return!1},y.prototype.forEach=function(s,l){for(var a=this._root,d=[],p=!1;!p;)a!==null?(d.push(a),a=a.left):d.length!==0?(a=d.pop(),s.call(l,a),a=a.right):p=!0;return this},y.prototype.range=function(s,l,a,d){for(var p=[],M=this._comparator,w=this._root,R;p.length!==0||w;)if(w)p.push(w),w=w.left;else{if(w=p.pop(),R=M(w.key,l),R>0)break;if(M(w.key,s)>=0&&a.call(d,w))return this;w=w.right}return this},y.prototype.keys=function(){var s=[];return this.forEach(function(l){var a=l.key;return s.push(a)}),s},y.prototype.values=function(){var s=[];return this.forEach(function(l){var a=l.data;return s.push(a)}),s},y.prototype.min=function(){return this._root?this.minNode(this._root).key:null},y.prototype.max=function(){return this._root?this.maxNode(this._root).key:null},y.prototype.minNode=function(s){if(s===void 0&&(s=this._root),s)for(;s.left;)s=s.left;return s},y.prototype.maxNode=function(s){if(s===void 0&&(s=this._root),s)for(;s.right;)s=s.right;return s},y.prototype.at=function(s){for(var l=this._root,a=!1,d=0,p=[];!a;)if(l)p.push(l),l=l.left;else if(p.length>0){if(l=p.pop(),d===s)return l;d++,l=l.right}else a=!0;return null},y.prototype.next=function(s){var l=this._root,a=null;if(s.right){for(a=s.right;a.left;)a=a.left;return a}for(var d=this._comparator;l;){var p=d(s.key,l.key);if(p===0)break;p<0?(a=l,l=l.left):l=l.right}return a},y.prototype.prev=function(s){var l=this._root,a=null;if(s.left!==null){for(a=s.left;a.right;)a=a.right;return a}for(var d=this._comparator;l;){var p=d(s.key,l.key);if(p===0)break;p<0?l=l.left:(a=l,l=l.right)}return a},y.prototype.clear=function(){return this._root=null,this._size=0,this},y.prototype.toList=function(){return g(this._root)},y.prototype.load=function(s,l,a){l===void 0&&(l=[]),a===void 0&&(a=!1);var d=s.length,p=this._comparator;if(a&&S(s,l,0,d-1,p),this._root===null)this._root=h(s,l,0,d),this._size=d;else{var M=v(this.toList(),m(s,l),p);d=this._size+d,this._root=x({head:M},0,d)}return this},y.prototype.isEmpty=function(){return this._root===null},Object.defineProperty(y.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(y.prototype,"root",{get:function(){return this._root},enumerable:!0,configurable:!0}),y.prototype.toString=function(s){s===void 0&&(s=function(a){return String(a.key)});var l=[];return c(this._root,"",!0,function(a){return l.push(a)},s),l.join("")},y.prototype.update=function(s,l,a){var d=this._comparator,p=o(s,this._root,d),M=p.left,w=p.right;d(s,l)<0?w=i(l,a,w,d):M=i(l,a,M,d),this._root=u(M,w,d)},y.prototype.split=function(s){return o(s,this._root,this._comparator)},y.prototype[Symbol.iterator]=function(){var s,l,a;return e(this,function(d){switch(d.label){case 0:s=this._root,l=[],a=!1,d.label=1;case 1:return a?[3,6]:s===null?[3,2]:(l.push(s),s=s.left,[3,5]);case 2:return l.length===0?[3,4]:(s=l.pop(),[4,s]);case 3:return d.sent(),s=s.right,[3,5];case 4:a=!0,d.label=5;case 5:return[3,1];case 6:return[2]}})},y}();function h(y,s,l,a){var d=a-l;if(d>0){var p=l+Math.floor(d/2),M=y[p],w=s[p],R=new t(M,w);return R.left=h(y,s,l,p),R.right=h(y,s,p+1,a),R}return null}function m(y,s){for(var l=new t(null,null),a=l,d=0;d<y.length;d++)a=a.next=new t(y[d],s[d]);return a.next=null,l.next}function g(y){for(var s=y,l=[],a=!1,d=new t(null,null),p=d;!a;)s?(l.push(s),s=s.left):l.length>0?(s=p=p.next=l.pop(),s=s.right):a=!0;return p.next=null,d.next}function x(y,s,l){var a=l-s;if(a>0){var d=s+Math.floor(a/2),p=x(y,s,d),M=y.head;return M.left=p,y.head=y.head.next,M.right=x(y,d+1,l),M}return null}function v(y,s,l){for(var a=new t(null,null),d=a,p=y,M=s;p!==null&&M!==null;)l(p.key,M.key)<0?(d.next=p,p=p.next):(d.next=M,M=M.next),d=d.next;return p!==null?d.next=p:M!==null&&(d.next=M),a.next}function S(y,s,l,a,d){if(!(l>=a)){for(var p=y[l+a>>1],M=l-1,w=a+1;;){do M++;while(d(y[M],p)<0);do w--;while(d(y[w],p)>0);if(M>=w)break;var R=y[M];y[M]=y[w],y[w]=R,R=s[M],s[M]=s[w],s[w]=R}S(y,s,l,w,d),S(y,s,w+1,a,d)}}let P=(y,s)=>y.ll.x<=s.x&&s.x<=y.ur.x&&y.ll.y<=s.y&&s.y<=y.ur.y,_=(y,s)=>{if(s.ur.x<y.ll.x||y.ur.x<s.ll.x||s.ur.y<y.ll.y||y.ur.y<s.ll.y)return null;let l=y.ll.x<s.ll.x?s.ll.x:y.ll.x,a=y.ur.x<s.ur.x?y.ur.x:s.ur.x,d=y.ll.y<s.ll.y?s.ll.y:y.ll.y,p=y.ur.y<s.ur.y?y.ur.y:s.ur.y;return{ll:{x:l,y:d},ur:{x:a,y:p}}},I=Number.EPSILON;I===void 0&&(I=Math.pow(2,-52));let A=I*I,k=(y,s)=>{if(-I<y&&y<I&&-I<s&&s<I)return 0;let l=y-s;return l*l<A*y*s?0:y<s?-1:1};class L{constructor(){this.reset()}reset(){this.xRounder=new V,this.yRounder=new V}round(s,l){return{x:this.xRounder.round(s),y:this.yRounder.round(l)}}}class V{constructor(){this.tree=new f,this.round(0)}round(s){let l=this.tree.add(s),a=this.tree.prev(l);if(a!==null&&k(l.key,a.key)===0)return this.tree.remove(s),a.key;let d=this.tree.next(l);return d!==null&&k(l.key,d.key)===0?(this.tree.remove(s),d.key):s}}let U=new L,N=11102230246251565e-32,T=134217729,j=(3+8*N)*N;function Y(y,s,l,a,d){let p,M,w,R,E=s[0],C=a[0],b=0,F=0;C>E==C>-E?(p=E,E=s[++b]):(p=C,C=a[++F]);let B=0;if(b<y&&F<l)for(C>E==C>-E?(M=E+p,w=p-(M-E),E=s[++b]):(M=C+p,w=p-(M-C),C=a[++F]),p=M,w!==0&&(d[B++]=w);b<y&&F<l;)C>E==C>-E?(M=p+E,R=M-p,w=p-(M-R)+(E-R),E=s[++b]):(M=p+C,R=M-p,w=p-(M-R)+(C-R),C=a[++F]),p=M,w!==0&&(d[B++]=w);for(;b<y;)M=p+E,R=M-p,w=p-(M-R)+(E-R),E=s[++b],p=M,w!==0&&(d[B++]=w);for(;F<l;)M=p+C,R=M-p,w=p-(M-R)+(C-R),C=a[++F],p=M,w!==0&&(d[B++]=w);return(p!==0||B===0)&&(d[B++]=p),B}function $(y,s){let l=s[0];for(let a=1;a<y;a++)l+=s[a];return l}function O(y){return new Float64Array(y)}let G=(3+16*N)*N,W=(2+12*N)*N,D=(9+64*N)*N*N,Q=O(4),oe=O(8),ee=O(12),ne=O(16),Z=O(4);function le(y,s,l,a,d,p,M){let w,R,E,C,b,F,B,z,H,J,X,te,xe,se,ge,ye,Ee,be,ke=y-d,_e=l-d,Ae=s-p,Be=a-p;se=ke*Be,F=T*ke,B=F-(F-ke),z=ke-B,F=T*Be,H=F-(F-Be),J=Be-H,ge=z*J-(se-B*H-z*H-B*J),ye=Ae*_e,F=T*Ae,B=F-(F-Ae),z=Ae-B,F=T*_e,H=F-(F-_e),J=_e-H,Ee=z*J-(ye-B*H-z*H-B*J),X=ge-Ee,b=ge-X,Q[0]=ge-(X+b)+(b-Ee),te=se+X,b=te-se,xe=se-(te-b)+(X-b),X=xe-ye,b=xe-X,Q[1]=xe-(X+b)+(b-ye),be=te+X,b=be-te,Q[2]=te-(be-b)+(X-b),Q[3]=be;let Te=$(4,Q),et=W*M;if(Te>=et||-Te>=et||(b=y-ke,w=y-(ke+b)+(b-d),b=l-_e,E=l-(_e+b)+(b-d),b=s-Ae,R=s-(Ae+b)+(b-p),b=a-Be,C=a-(Be+b)+(b-p),w===0&&R===0&&E===0&&C===0)||(et=D*M+j*Math.abs(Te),Te+=ke*C+Be*w-(Ae*E+_e*R),Te>=et||-Te>=et))return Te;se=w*Be,F=T*w,B=F-(F-w),z=w-B,F=T*Be,H=F-(F-Be),J=Be-H,ge=z*J-(se-B*H-z*H-B*J),ye=R*_e,F=T*R,B=F-(F-R),z=R-B,F=T*_e,H=F-(F-_e),J=_e-H,Ee=z*J-(ye-B*H-z*H-B*J),X=ge-Ee,b=ge-X,Z[0]=ge-(X+b)+(b-Ee),te=se+X,b=te-se,xe=se-(te-b)+(X-b),X=xe-ye,b=xe-X,Z[1]=xe-(X+b)+(b-ye),be=te+X,b=be-te,Z[2]=te-(be-b)+(X-b),Z[3]=be;let fr=Y(4,Q,4,Z,oe);se=ke*C,F=T*ke,B=F-(F-ke),z=ke-B,F=T*C,H=F-(F-C),J=C-H,ge=z*J-(se-B*H-z*H-B*J),ye=Ae*E,F=T*Ae,B=F-(F-Ae),z=Ae-B,F=T*E,H=F-(F-E),J=E-H,Ee=z*J-(ye-B*H-z*H-B*J),X=ge-Ee,b=ge-X,Z[0]=ge-(X+b)+(b-Ee),te=se+X,b=te-se,xe=se-(te-b)+(X-b),X=xe-ye,b=xe-X,Z[1]=xe-(X+b)+(b-ye),be=te+X,b=be-te,Z[2]=te-(be-b)+(X-b),Z[3]=be;let ar=Y(fr,oe,4,Z,ee);se=w*C,F=T*w,B=F-(F-w),z=w-B,F=T*C,H=F-(F-C),J=C-H,ge=z*J-(se-B*H-z*H-B*J),ye=R*E,F=T*R,B=F-(F-R),z=R-B,F=T*E,H=F-(F-E),J=E-H,Ee=z*J-(ye-B*H-z*H-B*J),X=ge-Ee,b=ge-X,Z[0]=ge-(X+b)+(b-Ee),te=se+X,b=te-se,xe=se-(te-b)+(X-b),X=xe-ye,b=xe-X,Z[1]=xe-(X+b)+(b-ye),be=te+X,b=be-te,Z[2]=te-(be-b)+(X-b),Z[3]=be;let hr=Y(ar,ee,4,Z,ne);return ne[hr-1]}function K(y,s,l,a,d,p){let M=(s-p)*(l-d),w=(y-d)*(a-p),R=M-w,E=Math.abs(M+w);return Math.abs(R)>=G*E?R:-le(y,s,l,a,d,p,E)}let q=(y,s)=>y.x*s.y-y.y*s.x,he=(y,s)=>y.x*s.x+y.y*s.y,me=(y,s,l)=>{let a=K(y.x,y.y,s.x,s.y,l.x,l.y);return a>0?-1:a<0?1:0},ce=y=>Math.sqrt(he(y,y)),fe=(y,s,l)=>{let a={x:s.x-y.x,y:s.y-y.y},d={x:l.x-y.x,y:l.y-y.y};return q(d,a)/ce(d)/ce(a)},ae=(y,s,l)=>{let a={x:s.x-y.x,y:s.y-y.y},d={x:l.x-y.x,y:l.y-y.y};return he(d,a)/ce(d)/ce(a)},de=(y,s,l)=>s.y===0?null:{x:y.x+s.x/s.y*(l-y.y),y:l},Se=(y,s,l)=>s.x===0?null:{x:l,y:y.y+s.y/s.x*(l-y.x)},Fe=(y,s,l,a)=>{if(s.x===0)return Se(l,a,y.x);if(a.x===0)return Se(y,s,l.x);if(s.y===0)return de(l,a,y.y);if(a.y===0)return de(y,s,l.y);let d=q(s,a);if(d==0)return null;let p={x:l.x-y.x,y:l.y-y.y},M=q(p,s)/d,w=q(p,a)/d,R=y.x+w*s.x,E=l.x+M*a.x,C=y.y+w*s.y,b=l.y+M*a.y,F=(R+E)/2,B=(C+b)/2;return{x:F,y:B}};class re{static compare(s,l){let a=re.comparePoints(s.point,l.point);return a!==0?a:(s.point!==l.point&&s.link(l),s.isLeft!==l.isLeft?s.isLeft?1:-1:ve.compare(s.segment,l.segment))}static comparePoints(s,l){return s.x<l.x?-1:s.x>l.x?1:s.y<l.y?-1:s.y>l.y?1:0}constructor(s,l){s.events===void 0?s.events=[this]:s.events.push(this),this.point=s,this.isLeft=l}link(s){if(s.point===this.point)throw new Error("Tried to link already linked events");let l=s.point.events;for(let a=0,d=l.length;a<d;a++){let p=l[a];this.point.events.push(p),p.point=this.point}this.checkForConsuming()}checkForConsuming(){let s=this.point.events.length;for(let l=0;l<s;l++){let a=this.point.events[l];if(a.segment.consumedBy===void 0)for(let d=l+1;d<s;d++){let p=this.point.events[d];p.consumedBy===void 0&&a.otherSE.point.events===p.otherSE.point.events&&a.segment.consume(p.segment)}}}getAvailableLinkedEvents(){let s=[];for(let l=0,a=this.point.events.length;l<a;l++){let d=this.point.events[l];d!==this&&!d.segment.ringOut&&d.segment.isInResult()&&s.push(d)}return s}getLeftmostComparator(s){let l=new Map,a=d=>{let p=d.otherSE;l.set(d,{sine:fe(this.point,s.point,p.point),cosine:ae(this.point,s.point,p.point)})};return(d,p)=>{l.has(d)||a(d),l.has(p)||a(p);let{sine:M,cosine:w}=l.get(d),{sine:R,cosine:E}=l.get(p);return M>=0&&R>=0?w<E?1:w>E?-1:0:M<0&&R<0?w<E?-1:w>E?1:0:R<M?-1:R>M?1:0}}}let Ue=0;class ve{static compare(s,l){let a=s.leftSE.point.x,d=l.leftSE.point.x,p=s.rightSE.point.x,M=l.rightSE.point.x;if(M<a)return 1;if(p<d)return-1;let w=s.leftSE.point.y,R=l.leftSE.point.y,E=s.rightSE.point.y,C=l.rightSE.point.y;if(a<d){if(R<w&&R<E)return 1;if(R>w&&R>E)return-1;let b=s.comparePoint(l.leftSE.point);if(b<0)return 1;if(b>0)return-1;let F=l.comparePoint(s.rightSE.point);return F!==0?F:-1}if(a>d){if(w<R&&w<C)return-1;if(w>R&&w>C)return 1;let b=l.comparePoint(s.leftSE.point);if(b!==0)return b;let F=s.comparePoint(l.rightSE.point);return F<0?1:F>0?-1:1}if(w<R)return-1;if(w>R)return 1;if(p<M){let b=l.comparePoint(s.rightSE.point);if(b!==0)return b}if(p>M){let b=s.comparePoint(l.rightSE.point);if(b<0)return 1;if(b>0)return-1}if(p!==M){let b=E-w,F=p-a,B=C-R,z=M-d;if(b>F&&B<z)return 1;if(b<F&&B>z)return-1}return p>M?1:p<M||E<C?-1:E>C?1:s.id<l.id?-1:s.id>l.id?1:0}constructor(s,l,a,d){this.id=++Ue,this.leftSE=s,s.segment=this,s.otherSE=l,this.rightSE=l,l.segment=this,l.otherSE=s,this.rings=a,this.windings=d}static fromRing(s,l,a){let d,p,M,w=re.comparePoints(s,l);if(w<0)d=s,p=l,M=1;else if(w>0)d=l,p=s,M=-1;else throw new Error(`Tried to create degenerate segment at [${s.x}, ${s.y}]`);let R=new re(d,!0),E=new re(p,!1);return new ve(R,E,[a],[M])}replaceRightSE(s){this.rightSE=s,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}bbox(){let s=this.leftSE.point.y,l=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:s<l?s:l},ur:{x:this.rightSE.point.x,y:s>l?s:l}}}vector(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}isAnEndpoint(s){return s.x===this.leftSE.point.x&&s.y===this.leftSE.point.y||s.x===this.rightSE.point.x&&s.y===this.rightSE.point.y}comparePoint(s){if(this.isAnEndpoint(s))return 0;let l=this.leftSE.point,a=this.rightSE.point,d=this.vector();if(l.x===a.x)return s.x===l.x?0:s.x<l.x?1:-1;let p=(s.y-l.y)/d.y,M=l.x+p*d.x;if(s.x===M)return 0;let w=(s.x-l.x)/d.x,R=l.y+w*d.y;return s.y===R?0:s.y<R?-1:1}getIntersection(s){let l=this.bbox(),a=s.bbox(),d=_(l,a);if(d===null)return null;let p=this.leftSE.point,M=this.rightSE.point,w=s.leftSE.point,R=s.rightSE.point,E=P(l,w)&&this.comparePoint(w)===0,C=P(a,p)&&s.comparePoint(p)===0,b=P(l,R)&&this.comparePoint(R)===0,F=P(a,M)&&s.comparePoint(M)===0;if(C&&E)return F&&!b?M:!F&&b?R:null;if(C)return b&&p.x===R.x&&p.y===R.y?null:p;if(E)return F&&M.x===w.x&&M.y===w.y?null:w;if(F&&b)return null;if(F)return M;if(b)return R;let B=Fe(p,this.vector(),w,s.vector());return B===null||!P(d,B)?null:U.round(B.x,B.y)}split(s){let l=[],a=s.events!==void 0,d=new re(s,!0),p=new re(s,!1),M=this.rightSE;this.replaceRightSE(p),l.push(p),l.push(d);let w=new ve(d,M,this.rings.slice(),this.windings.slice());return re.comparePoints(w.leftSE.point,w.rightSE.point)>0&&w.swapEvents(),re.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),a&&(d.checkForConsuming(),p.checkForConsuming()),l}swapEvents(){let s=this.rightSE;this.rightSE=this.leftSE,this.leftSE=s,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(let l=0,a=this.windings.length;l<a;l++)this.windings[l]*=-1}consume(s){let l=this,a=s;for(;l.consumedBy;)l=l.consumedBy;for(;a.consumedBy;)a=a.consumedBy;let d=ve.compare(l,a);if(d!==0){if(d>0){let p=l;l=a,a=p}if(l.prev===a){let p=l;l=a,a=p}for(let p=0,M=a.rings.length;p<M;p++){let w=a.rings[p],R=a.windings[p],E=l.rings.indexOf(w);E===-1?(l.rings.push(w),l.windings.push(R)):l.windings[E]+=R}a.rings=null,a.windings=null,a.consumedBy=l,a.leftSE.consumedBy=l.leftSE,a.rightSE.consumedBy=l.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 s=this.prev.consumedBy||this.prev;this._beforeState=s.afterState()}return this._beforeState}afterState(){if(this._afterState!==void 0)return this._afterState;let s=this.beforeState();this._afterState={rings:s.rings.slice(0),windings:s.windings.slice(0),multiPolys:[]};let l=this._afterState.rings,a=this._afterState.windings,d=this._afterState.multiPolys;for(let w=0,R=this.rings.length;w<R;w++){let E=this.rings[w],C=this.windings[w],b=l.indexOf(E);b===-1?(l.push(E),a.push(C)):a[b]+=C}let p=[],M=[];for(let w=0,R=l.length;w<R;w++){if(a[w]===0)continue;let E=l[w],C=E.poly;if(M.indexOf(C)===-1)if(E.isExterior)p.push(C);else{M.indexOf(C)===-1&&M.push(C);let b=p.indexOf(E.poly);b!==-1&&p.splice(b,1)}}for(let w=0,R=p.length;w<R;w++){let E=p[w].multiPoly;d.indexOf(E)===-1&&d.push(E)}return this._afterState}isInResult(){if(this.consumedBy)return!1;if(this._isInResult!==void 0)return this._isInResult;let s=this.beforeState().multiPolys,l=this.afterState().multiPolys;switch(Pe.type){case"union":{let a=s.length===0,d=l.length===0;this._isInResult=a!==d;break}case"intersection":{let a,d;s.length<l.length?(a=s.length,d=l.length):(a=l.length,d=s.length),this._isInResult=d===Pe.numMultiPolys&&a<d;break}case"xor":{let a=Math.abs(s.length-l.length);this._isInResult=a%2===1;break}case"difference":{let a=d=>d.length===1&&d[0].isSubject;this._isInResult=a(s)!==a(l);break}default:throw new Error(`Unrecognized operation type found ${Pe.type}`)}return this._isInResult}}class De{constructor(s,l,a){if(!Array.isArray(s)||s.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=l,this.isExterior=a,this.segments=[],typeof s[0][0]!="number"||typeof s[0][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let d=U.round(s[0][0],s[0][1]);this.bbox={ll:{x:d.x,y:d.y},ur:{x:d.x,y:d.y}};let p=d;for(let M=1,w=s.length;M<w;M++){if(typeof s[M][0]!="number"||typeof s[M][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let R=U.round(s[M][0],s[M][1]);R.x===p.x&&R.y===p.y||(this.segments.push(ve.fromRing(p,R,this)),R.x<this.bbox.ll.x&&(this.bbox.ll.x=R.x),R.y<this.bbox.ll.y&&(this.bbox.ll.y=R.y),R.x>this.bbox.ur.x&&(this.bbox.ur.x=R.x),R.y>this.bbox.ur.y&&(this.bbox.ur.y=R.y),p=R)}(d.x!==p.x||d.y!==p.y)&&this.segments.push(ve.fromRing(p,d,this))}getSweepEvents(){let s=[];for(let l=0,a=this.segments.length;l<a;l++){let d=this.segments[l];s.push(d.leftSE),s.push(d.rightSE)}return s}}class Ie{constructor(s,l){if(!Array.isArray(s))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new De(s[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 a=1,d=s.length;a<d;a++){let p=new De(s[a],this,!1);p.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=p.bbox.ll.x),p.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=p.bbox.ll.y),p.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=p.bbox.ur.x),p.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=p.bbox.ur.y),this.interiorRings.push(p)}this.multiPoly=l}getSweepEvents(){let s=this.exteriorRing.getSweepEvents();for(let l=0,a=this.interiorRings.length;l<a;l++){let d=this.interiorRings[l].getSweepEvents();for(let p=0,M=d.length;p<M;p++)s.push(d[p])}return s}}class Le{constructor(s,l){if(!Array.isArray(s))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{typeof s[0][0][0]=="number"&&(s=[s])}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 a=0,d=s.length;a<d;a++){let p=new Ie(s[a],this);p.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=p.bbox.ll.x),p.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=p.bbox.ll.y),p.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=p.bbox.ur.x),p.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=p.bbox.ur.y),this.polys.push(p)}this.isSubject=l}getSweepEvents(){let s=[];for(let l=0,a=this.polys.length;l<a;l++){let d=this.polys[l].getSweepEvents();for(let p=0,M=d.length;p<M;p++)s.push(d[p])}return s}}class Me{static factory(s){let l=[];for(let a=0,d=s.length;a<d;a++){let p=s[a];if(!p.isInResult()||p.ringOut)continue;let M=null,w=p.leftSE,R=p.rightSE,E=[w],C=w.point,b=[];for(;M=w,w=R,E.push(w),w.point!==C;)for(;;){let F=w.getAvailableLinkedEvents();if(F.length===0){let H=E[0].point,J=E[E.length-1].point;throw new Error(`Unable to complete output ring starting at [${H.x}, ${H.y}]. Last matching segment found ends at [${J.x}, ${J.y}].`)}if(F.length===1){R=F[0].otherSE;break}let B=null;for(let H=0,J=b.length;H<J;H++)if(b[H].point===w.point){B=H;break}if(B!==null){let H=b.splice(B)[0],J=E.splice(H.index);J.unshift(J[0].otherSE),l.push(new Me(J.reverse()));continue}b.push({index:E.length,point:w.point});let z=w.getLeftmostComparator(M);R=F.sort(z)[0].otherSE;break}l.push(new Me(E))}return l}constructor(s){this.events=s;for(let l=0,a=s.length;l<a;l++)s[l].segment.ringOut=this;this.poly=null}getGeom(){let s=this.events[0].point,l=[s];for(let E=1,C=this.events.length-1;E<C;E++){let b=this.events[E].point,F=this.events[E+1].point;me(b,s,F)!==0&&(l.push(b),s=b)}if(l.length===1)return null;let a=l[0],d=l[1];me(a,s,d)===0&&l.shift(),l.push(l[0]);let p=this.isExteriorRing()?1:-1,M=this.isExteriorRing()?0:l.length-1,w=this.isExteriorRing()?l.length:-1,R=[];for(let E=M;E!=w;E+=p)R.push([l[E].x,l[E].y]);return R}isExteriorRing(){if(this._isExteriorRing===void 0){let s=this.enclosingRing();this._isExteriorRing=s?!s.isExteriorRing():!0}return this._isExteriorRing}enclosingRing(){return this._enclosingRing===void 0&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}_calcEnclosingRing(){let s=this.events[0];for(let d=1,p=this.events.length;d<p;d++){let M=this.events[d];re.compare(s,M)>0&&(s=M)}let l=s.segment.prevInResult(),a=l?l.prevInResult():null;for(;;){if(!l)return null;if(!a)return l.ringOut;if(a.ringOut!==l.ringOut)return a.ringOut.enclosingRing()!==l.ringOut?l.ringOut:l.ringOut.enclosingRing();l=a.prevInResult(),a=l?l.prevInResult():null}}}class Ge{constructor(s){this.exteriorRing=s,s.poly=this,this.interiorRings=[]}addInterior(s){this.interiorRings.push(s),s.poly=this}getGeom(){let s=[this.exteriorRing.getGeom()];if(s[0]===null)return null;for(let l=0,a=this.interiorRings.length;l<a;l++){let d=this.interiorRings[l].getGeom();d!==null&&s.push(d)}return s}}class $e{constructor(s){this.rings=s,this.polys=this._composePolys(s)}getGeom(){let s=[];for(let l=0,a=this.polys.length;l<a;l++){let d=this.polys[l].getGeom();d!==null&&s.push(d)}return s}_composePolys(s){let l=[];for(let a=0,d=s.length;a<d;a++){let p=s[a];if(!p.poly)if(p.isExteriorRing())l.push(new Ge(p));else{let M=p.enclosingRing();M.poly||l.push(new Ge(M)),M.poly.addInterior(p)}}return l}}class Ne{constructor(s){let l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ve.compare;this.queue=s,this.tree=new f(l),this.segments=[]}process(s){let l=s.segment,a=[];if(s.consumedBy)return s.isLeft?this.queue.remove(s.otherSE):this.tree.remove(l),a;let d=s.isLeft?this.tree.add(l):this.tree.find(l);if(!d)throw new Error(`Unable to find segment #${l.id} [${l.leftSE.point.x}, ${l.leftSE.point.y}] -> [${l.rightSE.point.x}, ${l.rightSE.point.y}] in SweepLine tree.`);let p=d,M=d,w,R;for(;w===void 0;)p=this.tree.prev(p),p===null?w=null:p.key.consumedBy===void 0&&(w=p.key);for(;R===void 0;)M=this.tree.next(M),M===null?R=null:M.key.consumedBy===void 0&&(R=M.key);if(s.isLeft){let E=null;if(w){let b=w.getIntersection(l);if(b!==null&&(l.isAnEndpoint(b)||(E=b),!w.isAnEndpoint(b))){let F=this._splitSafely(w,b);for(let B=0,z=F.length;B<z;B++)a.push(F[B])}}let C=null;if(R){let b=R.getIntersection(l);if(b!==null&&(l.isAnEndpoint(b)||(C=b),!R.isAnEndpoint(b))){let F=this._splitSafely(R,b);for(let B=0,z=F.length;B<z;B++)a.push(F[B])}}if(E!==null||C!==null){let b=null;E===null?b=C:C===null?b=E:b=re.comparePoints(E,C)<=0?E:C,this.queue.remove(l.rightSE),a.push(l.rightSE);let F=l.split(b);for(let B=0,z=F.length;B<z;B++)a.push(F[B])}a.length>0?(this.tree.remove(l),a.push(s)):(this.segments.push(l),l.prev=w)}else{if(w&&R){let E=w.getIntersection(R);if(E!==null){if(!w.isAnEndpoint(E)){let C=this._splitSafely(w,E);for(let b=0,F=C.length;b<F;b++)a.push(C[b])}if(!R.isAnEndpoint(E)){let C=this._splitSafely(R,E);for(let b=0,F=C.length;b<F;b++)a.push(C[b])}}}this.tree.remove(l)}return a}_splitSafely(s,l){this.tree.remove(s);let a=s.rightSE;this.queue.remove(a);let d=s.split(l);return d.push(a),s.consumedBy===void 0&&this.tree.add(s),d}}let ht=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,pt=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6;class Et{run(s,l,a){Pe.type=s,U.reset();let d=[new Le(l,!0)];for(let b=0,F=a.length;b<F;b++)d.push(new Le(a[b],!1));if(Pe.numMultiPolys=d.length,Pe.type==="difference"){let b=d[0],F=1;for(;F<d.length;)_(d[F].bbox,b.bbox)!==null?F++:d.splice(F,1)}if(Pe.type==="intersection")for(let b=0,F=d.length;b<F;b++){let B=d[b];for(let z=b+1,H=d.length;z<H;z++)if(_(B.bbox,d[z].bbox)===null)return[]}let p=new f(re.compare);for(let b=0,F=d.length;b<F;b++){let B=d[b].getSweepEvents();for(let z=0,H=B.length;z<H;z++)if(p.insert(B[z]),p.size>ht)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big).")}let M=new Ne(p),w=p.size,R=p.pop();for(;R;){let b=R.key;if(p.size===w){let B=b.segment;throw new Error(`Unable to pop() ${b.isLeft?"left":"right"} SweepEvent [${b.point.x}, ${b.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(p.size>ht)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big).");if(M.segments.length>pt)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments).");let F=M.process(b);for(let B=0,z=F.length;B<z;B++){let H=F[B];H.consumedBy===void 0&&p.insert(H)}w=p.size,R=p.pop()}U.reset();let E=Me.factory(M.segments);return new $e(E).getGeom()}}let Pe=new Et;var cr={union:function(y){for(var s=arguments.length,l=new Array(s>1?s-1:0),a=1;a<s;a++)l[a-1]=arguments[a];return Pe.run("union",y,l)},intersection:function(y){for(var s=arguments.length,l=new Array(s>1?s-1:0),a=1;a<s;a++)l[a-1]=arguments[a];return Pe.run("intersection",y,l)},xor:function(y){for(var s=arguments.length,l=new Array(s>1?s-1:0),a=1;a<s;a++)l[a-1]=arguments[a];return Pe.run("xor",y,l)},difference:function(y){for(var s=arguments.length,l=new Array(s>1?s-1:0),a=1;a<s;a++)l[a-1]=arguments[a];return Pe.run("difference",y,l)}};return cr})});var it=new Set,Rt=!1;function Oe(e,t,n=2){let r=t&&t.length,i=r?t[0]*n:e.length;it.size&&it.clear();let o=sn(e,0,i,n,!0),u=[];if(!o||o.next===o.prev)return u;let c=0,f=0,h=0;if(r&&(o=Rr(e,t,o,n)),e.length>80*n){c=e[0],f=e[1];let m=c,g=f;for(let x=n;x<i;x+=n){let v=e[x],S=e[x+1];v<c&&(c=v),S<f&&(f=S),v>m&&(m=v),S>g&&(g=S)}h=Math.max(m-c,g-f),h=h!==0?32767/h:0}return Ft(o,u,c,f,h),u}function sn(e,t,n,r,i){let o=null;if(i===Ur(e,t,n,r)>0)for(let u=t;u<n;u+=r)o=on(u/r|0,e[u],e[u+1],o);else for(let u=n-r;u>=t;u-=r)o=on(u/r|0,e[u],e[u+1],o);return o&&ot(o,o.next)&&(ut(o),o=o.next),o}function ze(e,t=e){let n=t===e,r=e,i;do i=!1,r!==r.next&&(it.size===0||!it.has(r))&&(ot(r,r.next)||ue(r.prev,r,r.next)===0)?((n||r===t)&&(t=r.prev),Rt=!0,ut(r),r=r.prev,i=!0):(n||r!==t)&&(r=r.next,i=!n);while(i||r!==t);return t}function Ft(e,t,n,r,i){i&&Br(e,n,r,i);let o=e,u=!1;for(;e.prev!==e.next;){let c=e.prev,f=e.next;if(ue(c,e,f)<0&&(i?Sr(e,n,r,i):vr(e))){t.push(c.i,e.i,f.i),ut(e),e=f,o=f;continue}if(e=f,e===o){if(Rt=!1,e=ze(e),Rt){o=e;continue}if(!u){e=Mr(e,t),o=e,u=!0;continue}Er(e,t,n,r,i);break}}}function vr(e){let t=e.prev,n=e,r=e.next,i=t.x,o=n.x,u=r.x,c=t.y,f=n.y,h=r.y,m=Math.min(i,o,u),g=Math.min(c,f,h),x=Math.max(i,o,u),v=Math.max(c,f,h),S=r.next;for(;S!==t;){if(S.x>=m&&S.x<=x&&S.y>=g&&S.y<=v&&!(i===S.x&&c===S.y)&&gt(i,c,o,f,u,h,S.x,S.y)&&ue(S.prev,S,S.next)>=0)return!1;S=S.next}return!0}function Sr(e,t,n,r){let i=e.prev,o=e,u=e.next,c=i.x,f=o.x,h=u.x,m=i.y,g=o.y,x=u.y,v=Math.min(c,f,h),S=Math.min(m,g,x),P=Math.max(c,f,h),_=Math.max(m,g,x),I=_t(v,S,t,n,r),A=_t(P,_,t,n,r),k=e.prevZ;for(;k&&k.z>=I;){if(k.x>=v&&k.x<=P&&k.y>=S&&k.y<=_&&k!==u&&!(c===k.x&&m===k.y)&&gt(c,m,f,g,h,x,k.x,k.y)&&ue(k.prev,k,k.next)>=0)return!1;k=k.prevZ}let L=e.nextZ;for(;L&&L.z<=A;){if(L.x>=v&&L.x<=P&&L.y>=S&&L.y<=_&&L!==u&&!(c===L.x&&m===L.y)&&gt(c,m,f,g,h,x,L.x,L.y)&&ue(L.prev,L,L.next)>=0)return!1;L=L.nextZ}return!0}function Mr(e,t){let n=e,r=!1;do{let i=n.prev,o=n.next.next;cn(i,n,n.next,o,!1)&&st(i,o)&&st(o,i)&&(t.push(i.i,n.i,o.i),ut(n),ut(n.next),n=e=o,r=!0),n=n.next}while(n!==e);return r?ze(n):n}function Er(e,t,n,r,i){let o=e;do{let u=o.next.next;for(;u!==o.prev;){if(o.i!==u.i&&Cr(o,u)){let c=fn(o,u);o=ze(o,o.next),c=ze(c,c.next),Ft(o,t,n,r,i),Ft(c,t,n,r,i);return}u=u.next}o=o.next}while(o!==e)}var It=!1;function Rr(e,t,n,r){let i=[];for(let o=0,u=t.length;o<u;o++){let c=t[o]*r,f=o<u-1?t[o+1]*r:e.length,h=sn(e,c,f,r,!1);h===h.next&&it.add(h),i.push(Tr(h))}i.sort(Fr),Pr(e.length/r,t.length),ln(n,n),It=!0;for(let o=0;o<i.length;o++)n=Ir(i[o],n);return It=!1,ze(n)}function Fr(e,t){return e.x-t.x||e.y-t.y||(e.next.y-e.y)/(e.next.x-e.x)-(t.next.y-t.y)/(t.next.x-t.x)}function Ir(e,t){let n=_r(e,t);if(!n)return t;let r=fn(n,e),i=r.next;return ln(n,i.next),ze(r,r.next),ze(n,n.next)}var un=16,ie=new Float64Array(0),xt=0,Pt=[],kt=[];function Pr(e,t){let n=Math.ceil((e+2*t)/un)+t+2;ie.length<n*4&&(ie=new Float64Array(n*4)),xt=0}function ln(e,t){let n=e;do{let r=xt++;Pt[r]=n;let i=1/0,o=1/0,u=-1/0,c=-1/0,f=0;do{let m=n.next;n.z=r,n.x<i&&(i=n.x),n.x>u&&(u=n.x),n.y<o&&(o=n.y),n.y>c&&(c=n.y),m.x<i&&(i=m.x),m.x>u&&(u=m.x),m.y<o&&(o=m.y),m.y>c&&(c=m.y),n=m}while(++f<un&&n!==t);kt[r]=n;let h=r*4;ie[h]=i,ie[h+1]=o,ie[h+2]=u,ie[h+3]=c}while(n!==t)}function kr(e,t){let n=e.z*4;t.x<ie[n]&&(ie[n]=t.x),t.y<ie[n+1]&&(ie[n+1]=t.y),t.x>ie[n+2]&&(ie[n+2]=t.x),t.y>ie[n+3]&&(ie[n+3]=t.y)}function nn(e){let t=kt[e];for(;t.prev.next!==t;)t=t.next;return kt[e]=t,t}function rn(e){let t=Pt[e];for(;t.prev.next!==t;)t=t.next;return Pt[e]=t,t}function _r(e,t){let n=t,r=e.x,i=e.y,o=-1/0,u;if(ot(e,n))return n;for(let x=0,v=0;x<xt;x++,v+=4){if(i<ie[v+1]||i>ie[v+3]||ie[v]>r||ie[v+2]<=o)continue;let S=nn(x);n=rn(x);do{if(n.prev.next===n){if(ot(e,n.next))return n.next;if(i<=n.y&&i>=n.next.y&&n.next.y!==n.y){let P=n.x+(i-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(P<=r&&P>o&&(o=P,u=n.x<n.next.x?n:n.next,P===r))return u}}n=n.next}while(n!==S)}if(!u)return null;let c=u.x,f=u.y,h=Math.min(i,f),m=Math.max(i,f),g=1/0;for(let x=0,v=0;x<xt;x++,v+=4){if(ie[v+2]<c||ie[v]>r||ie[v+3]<h||ie[v+1]>m)continue;let S=nn(x);n=rn(x);do{if(n.prev.next===n&&r>=n.x&&n.x>=c&&r!==n.x&&gt(i<f?r:o,i,c,f,i<f?o:r,i,n.x,n.y)){let P=Math.abs(i-n.y)/(r-n.x);(st(n,e)||n.y===i&&n.next.y===i&&n.next.x>r)&&(P<g||P===g&&(n.x>u.x||n.x===u.x&&Ar(u,n)))&&(u=n,g=P)}n=n.next}while(n!==S)}return u}function Ar(e,t){return ue(e.prev,e,t.prev)<0&&ue(t.next,e,e.next)<0}var Re=[],tt=[],He=new Uint32Array(0),nt=new Uint32Array(0),rt=new Uint32Array(256);function Br(e,t,n,r){let i=e,o=0;do i.z=_t(i.x,i.y,t,n,r),Re[o++]=i,i=i.next;while(i!==e);Lr(o);let u=null;for(let c=0;c<o;c++){let f=Re[c];f.prevZ=u,u&&(u.nextZ=f),u=f}u.nextZ=null}function Lr(e){if(e<=32){for(let t=1;t<e;t++){let n=Re[t],r=n.z,i=t-1;for(;i>=0&&Re[i].z>r;)Re[i+1]=Re[i],i--;Re[i+1]=n}return}He.length<e&&(He=new Uint32Array(e),nt=new Uint32Array(e),tt=new Array(e));for(let t=0;t<e;t++)He[t]=Re[t].z;mt(e,Re,He,tt,nt,0),mt(e,tt,nt,Re,He,8),mt(e,Re,He,tt,nt,16),mt(e,tt,nt,Re,He,24)}function mt(e,t,n,r,i,o){rt.fill(0);for(let c=0;c<e;c++)rt[n[c]>>>o&255]++;let u=0;for(let c=0;c<256;c++){let f=rt[c];rt[c]=u,u+=f}for(let c=0;c<e;c++){let f=n[c],h=rt[f>>>o&255]++;r[h]=t[c],i[h]=f}}function _t(e,t,n,r,i){return e=(e-n)*i|0,t=(t-r)*i|0,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,e|t<<1}function Tr(e){let t=e,n=e;do(t.x<n.x||t.x===n.x&&t.y<n.y)&&(n=t),t=t.next;while(t!==e);return n}function gt(e,t,n,r,i,o,u,c){return(i-u)*(t-c)>=(e-u)*(o-c)&&(e-u)*(r-c)>=(n-u)*(t-c)&&(n-u)*(o-c)>=(i-u)*(r-c)}function Cr(e,t){let n=ot(e,t)&&ue(e.prev,e,e.next)>0&&ue(t.prev,t,t.next)>0;return e.next.i!==t.i&&(n||st(e,t)&&st(t,e)&&(ue(e.prev,e,t.prev)!==0||ue(e,t.prev,t)!==0))&&!Vr(e,t)&&(n||Or(e,t))}function ue(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function ot(e,t){return e.x===t.x&&e.y===t.y}function cn(e,t,n,r,i=!0){let o=ue(e,t,n),u=ue(e,t,r),c=ue(n,r,e),f=ue(n,r,t);return(o>0&&u<0||o<0&&u>0)&&(c>0&&f<0||c<0&&f>0)?!0:i?!!(o===0&&dt(e,n,t)||u===0&&dt(e,r,t)||c===0&&dt(n,e,r)||f===0&&dt(n,t,r)):!1}function dt(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function Vr(e,t){let n=Math.min(e.x,t.x),r=Math.max(e.x,t.x),i=Math.min(e.y,t.y),o=Math.max(e.y,t.y),u=e;do{let c=u.next;if(u.x>r&&c.x>r||u.x<n&&c.x<n||u.y>o&&c.y>o||u.y<i&&c.y<i){u=c;continue}if(u.i!==e.i&&c.i!==e.i&&u.i!==t.i&&c.i!==t.i&&cn(u,c,e,t))return!0;u=c}while(u!==e);return!1}function st(e,t){return ue(e.prev,e,e.next)<0?ue(e,t,e.next)>=0&&ue(e,e.prev,t)>=0:ue(e,t,e.prev)<0||ue(e,e.next,t)<0}function Or(e,t){let n=e,r=!1,i=(e.x+t.x)/2,o=(e.y+t.y)/2;do{let u=n.next;n.y>o!=u.y>o&&i<(u.x-n.x)*(o-n.y)/(u.y-n.y)+n.x&&(r=!r),n=u}while(n!==e);return r}function fn(e,t){let n=At(e.i,e.x,e.y),r=At(t.i,t.x,t.y),i=e.next,o=t.prev;return e.next=t,t.prev=e,n.next=i,i.prev=n,r.next=n,n.prev=r,o.next=r,r.prev=o,r}function on(e,t,n,r){let i=At(e,t,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 ut(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ),It&&kr(e.prev,e.next)}function At(e,t,n){return{i:e,x:t,y:n,prev:null,next:null,z:0,prevZ:null,nextZ:null}}function Ur(e,t,n,r){let i=0;for(let o=t,u=n-r;o<n;o+=r)i+=(e[u]-e[o])*(e[o+1]+e[u+1]),u=o;return i}var an=23283064365386963e-26,Dr=12,hn=typeof TextDecoder>"u"?null:new TextDecoder("utf-8"),Bt=0,yt=1,lt=2,bt=5,ct=class{constructor(t=new Uint8Array(16)){this.buf=ArrayBuffer.isView(t)?t:new Uint8Array(t),this.dataView=new DataView(this.buf.buffer),this.pos=0,this.type=0,this.length=this.buf.length}readFields(t,n,r=this.length){for(;this.pos<r;){let i=this.readVarint(),o=i>>3,u=this.pos;this.type=i&7,t(o,n,this),this.pos===u&&this.skip(i)}return n}readMessage(t,n){return this.readFields(t,n,this.readVarint()+this.pos)}readFixed32(){let t=this.dataView.getUint32(this.pos,!0);return this.pos+=4,t}readSFixed32(){let t=this.dataView.getInt32(this.pos,!0);return this.pos+=4,t}readFixed64(){let t=this.dataView.getUint32(this.pos,!0)+this.dataView.getUint32(this.pos+4,!0)*4294967296;return this.pos+=8,t}readSFixed64(){let t=this.dataView.getUint32(this.pos,!0)+this.dataView.getInt32(this.pos+4,!0)*4294967296;return this.pos+=8,t}readFloat(){let t=this.dataView.getFloat32(this.pos,!0);return this.pos+=4,t}readDouble(){let t=this.dataView.getFloat64(this.pos,!0);return this.pos+=8,t}readVarint(t){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,Gr(r,t,this))}readVarint64(){return this.readVarint(!0)}readSVarint(){let t=this.readVarint();return t%2===1?(t+1)/-2:t/2}readBoolean(){return!!this.readVarint()}readString(){let t=this.readVarint()+this.pos,n=this.pos;return this.pos=t,t-n>=Dr&&hn?hn.decode(this.buf.subarray(n,t)):qr(this.buf,n,t)}readBytes(){let t=this.readVarint()+this.pos,n=this.buf.subarray(this.pos,t);return this.pos=t,n}readPackedVarint(t=[],n){let r=this.readPackedEnd();for(;this.pos<r;)t.push(this.readVarint(n));return t}readPackedSVarint(t=[]){let n=this.readPackedEnd();for(;this.pos<n;)t.push(this.readSVarint());return t}readPackedBoolean(t=[]){let n=this.readPackedEnd();for(;this.pos<n;)t.push(this.readBoolean());return t}readPackedFloat(t=[]){let n=this.readPackedEnd();for(;this.pos<n;)t.push(this.readFloat());return t}readPackedDouble(t=[]){let n=this.readPackedEnd();for(;this.pos<n;)t.push(this.readDouble());return t}readPackedFixed32(t=[]){let n=this.readPackedEnd();for(;this.pos<n;)t.push(this.readFixed32());return t}readPackedSFixed32(t=[]){let n=this.readPackedEnd();for(;this.pos<n;)t.push(this.readSFixed32());return t}readPackedFixed64(t=[]){let n=this.readPackedEnd();for(;this.pos<n;)t.push(this.readFixed64());return t}readPackedSFixed64(t=[]){let n=this.readPackedEnd();for(;this.pos<n;)t.push(this.readSFixed64());return t}readPackedEnd(){return this.type===lt?this.readVarint()+this.pos:this.pos+1}skip(t){let n=t&7;if(n===Bt)for(;this.buf[this.pos++]>127;);else if(n===lt)this.pos=this.readVarint()+this.pos;else if(n===bt)this.pos+=4;else if(n===yt)this.pos+=8;else throw new Error(`Unimplemented type: ${n}`)}writeTag(t,n){this.writeVarint(t<<3|n)}realloc(t){let n=this.length||16;for(;n<this.pos+t;)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(t){this.realloc(4),this.dataView.setInt32(this.pos,t,!0),this.pos+=4}writeSFixed32(t){this.realloc(4),this.dataView.setInt32(this.pos,t,!0),this.pos+=4}writeFixed64(t){this.realloc(8),this.dataView.setInt32(this.pos,t&-1,!0),this.dataView.setInt32(this.pos+4,Math.floor(t*an),!0),this.pos+=8}writeSFixed64(t){this.realloc(8),this.dataView.setInt32(this.pos,t&-1,!0),this.dataView.setInt32(this.pos+4,Math.floor(t*an),!0),this.pos+=8}writeVarint(t){if(t=+t||0,t>268435455||t<0){Nr(t,this);return}this.realloc(4),this.buf[this.pos++]=t&127|(t>127?128:0),!(t<=127)&&(this.buf[this.pos++]=(t>>>=7)&127|(t>127?128:0),!(t<=127)&&(this.buf[this.pos++]=(t>>>=7)&127|(t>127?128:0),!(t<=127)&&(this.buf[this.pos++]=t>>>7&127)))}writeSVarint(t){this.writeVarint(t<0?-t*2-1:t*2)}writeBoolean(t){this.writeVarint(+t)}writeString(t){t=String(t),this.realloc(t.length*4),this.pos++;let n=this.pos;this.pos=ei(this.buf,t,this.pos);let r=this.pos-n;r>=128&&pn(n,r,this),this.pos=n-1,this.writeVarint(r),this.pos+=r}writeFloat(t){this.realloc(4),this.dataView.setFloat32(this.pos,t,!0),this.pos+=4}writeDouble(t){this.realloc(8),this.dataView.setFloat64(this.pos,t,!0),this.pos+=8}writeBytes(t){let n=t.length;this.writeVarint(n),this.realloc(n);for(let r=0;r<n;r++)this.buf[this.pos++]=t[r]}writeRawMessage(t,n){this.pos++;let r=this.pos;t(n,this);let i=this.pos-r;i>=128&&pn(r,i,this),this.pos=r-1,this.writeVarint(i),this.pos+=i}writeMessage(t,n,r){this.writeTag(t,lt),this.writeRawMessage(n,r)}writePackedVarint(t,n){n.length&&this.writeMessage(t,jr,n)}writePackedSVarint(t,n){n.length&&this.writeMessage(t,$r,n)}writePackedBoolean(t,n){n.length&&this.writeMessage(t,Zr,n)}writePackedFloat(t,n){n.length&&this.writeMessage(t,Xr,n)}writePackedDouble(t,n){n.length&&this.writeMessage(t,Yr,n)}writePackedFixed32(t,n){n.length&&this.writeMessage(t,Wr,n)}writePackedSFixed32(t,n){n.length&&this.writeMessage(t,Qr,n)}writePackedFixed64(t,n){n.length&&this.writeMessage(t,Kr,n)}writePackedSFixed64(t,n){n.length&&this.writeMessage(t,Jr,n)}writeBytesField(t,n){this.writeTag(t,lt),this.writeBytes(n)}writeFixed32Field(t,n){this.writeTag(t,bt),this.writeFixed32(n)}writeSFixed32Field(t,n){this.writeTag(t,bt),this.writeSFixed32(n)}writeFixed64Field(t,n){this.writeTag(t,yt),this.writeFixed64(n)}writeSFixed64Field(t,n){this.writeTag(t,yt),this.writeSFixed64(n)}writeVarintField(t,n){this.writeTag(t,Bt),this.writeVarint(n)}writeSVarintField(t,n){this.writeTag(t,Bt),this.writeSVarint(n)}writeStringField(t,n){this.writeTag(t,lt),this.writeString(n)}writeFloatField(t,n){this.writeTag(t,bt),this.writeFloat(n)}writeDoubleField(t,n){this.writeTag(t,yt),this.writeDouble(n)}writeBooleanField(t,n){this.writeVarintField(t,+n)}};function Gr(e,t,n){let r=n.buf,i,o;if(o=r[n.pos++],i=(o&112)>>4,o<128||(o=r[n.pos++],i|=(o&127)<<3,o<128)||(o=r[n.pos++],i|=(o&127)<<10,o<128)||(o=r[n.pos++],i|=(o&127)<<17,o<128)||(o=r[n.pos++],i|=(o&127)<<24,o<128)||(o=r[n.pos++],i|=(o&1)<<31,o<128))return Xe(e,i,t);throw new Error("Expected varint not more than 10 bytes")}function Xe(e,t,n){return n?t*4294967296+(e>>>0):(t>>>0)*4294967296+(e>>>0)}function Nr(e,t){let n,r;if(e>=0?(n=e%4294967296|0,r=e/4294967296|0):(n=~(-e%4294967296),r=~(-e/4294967296),n^4294967295?n=n+1|0:(n=0,r=r+1|0)),e>=18446744073709552e3||e<-18446744073709552e3)throw new Error("Given varint doesn\'t fit into 10 bytes");t.realloc(10),Hr(n,r,t),zr(r,t)}function Hr(e,t,n){n.buf[n.pos++]=e&127|128,e>>>=7,n.buf[n.pos++]=e&127|128,e>>>=7,n.buf[n.pos++]=e&127|128,e>>>=7,n.buf[n.pos++]=e&127|128,e>>>=7,n.buf[n.pos]=e&127}function zr(e,t){let n=(e&7)<<4;t.buf[t.pos++]|=n|((e>>>=3)?128:0),e&&(t.buf[t.pos++]=e&127|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=e&127|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=e&127|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=e&127|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=e&127)))))}function pn(e,t,n){let r=t<=16383?1:t<=2097151?2:t<=268435455?3:Math.floor(Math.log(t)/(Math.LN2*7));n.realloc(r);for(let i=n.pos-1;i>=e;i--)n.buf[i+r]=n.buf[i]}function jr(e,t){for(let n=0;n<e.length;n++)t.writeVarint(e[n])}function $r(e,t){for(let n=0;n<e.length;n++)t.writeSVarint(e[n])}function Xr(e,t){for(let n=0;n<e.length;n++)t.writeFloat(e[n])}function Yr(e,t){for(let n=0;n<e.length;n++)t.writeDouble(e[n])}function Zr(e,t){for(let n=0;n<e.length;n++)t.writeBoolean(e[n])}function Wr(e,t){for(let n=0;n<e.length;n++)t.writeFixed32(e[n])}function Qr(e,t){for(let n=0;n<e.length;n++)t.writeSFixed32(e[n])}function Kr(e,t){for(let n=0;n<e.length;n++)t.writeFixed64(e[n])}function Jr(e,t){for(let n=0;n<e.length;n++)t.writeSFixed64(e[n])}function qr(e,t,n){let r="",i=t;for(;i<n;){let o=e[i],u=null,c=o>239?4:o>223?3:o>191?2:1;if(i+c>n)break;let f,h,m;c===1?o<128&&(u=o):c===2?(f=e[i+1],(f&192)===128&&(u=(o&31)<<6|f&63,u<=127&&(u=null))):c===3?(f=e[i+1],h=e[i+2],(f&192)===128&&(h&192)===128&&(u=(o&15)<<12|(f&63)<<6|h&63,(u<=2047||u>=55296&&u<=57343)&&(u=null))):c===4&&(f=e[i+1],h=e[i+2],m=e[i+3],(f&192)===128&&(h&192)===128&&(m&192)===128&&(u=(o&15)<<18|(f&63)<<12|(h&63)<<6|m&63,(u<=65535||u>=1114112)&&(u=null))),u===null?(u=65533,c=1):u>65535&&(u-=65536,r+=String.fromCharCode(u>>>10&1023|55296),u=56320|u&1023),r+=String.fromCharCode(u),i+=c}return r}function ei(e,t,n){for(let r=0,i,o;r<t.length;r++){if(i=t.charCodeAt(r),i>55295&&i<57344)if(o)if(i<56320){e[n++]=239,e[n++]=191,e[n++]=189,o=i;continue}else i=o-55296<<10|i-56320|65536,o=null;else{i>56319||r+1===t.length?(e[n++]=239,e[n++]=191,e[n++]=189):o=i;continue}else o&&(e[n++]=239,e[n++]=191,e[n++]=189,o=null);i<128?e[n++]=i:(i<2048?e[n++]=i>>6|192:(i<65536?e[n++]=i>>12|224:(e[n++]=i>>18|240,e[n++]=i>>12&63|128),e[n++]=i>>6&63|128),e[n++]=i&63|128)}return n}var Lt=class e{constructor(t,n,r,i){this.pbf=t;this.keys=n;this.values=r;this.extent=i;this.type=0;this.properties={};this.geomOffset=-1}static read(t,n,r,i,o){let u=new e(t,r,i,o);return t.readFields(ti,u,n),u}loadGeometry(){if(this.geomOffset<0)return[];let t=this.pbf,n=t.pos;t.pos=this.geomOffset;let r=t.readVarint()+t.pos,i=1,o=0,u=0,c=0,f=[],h=[];for(;t.pos<r;){if(o<=0){let m=t.readVarint();i=m&7,o=m>>3}if(o--,i===1||i===2)u+=t.readSVarint(),c+=t.readSVarint(),i===1&&(h.length&&f.push(h),h=[]),h.push(u,c);else if(i===7)h.length>=2&&h.push(h[0],h[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 h.length&&f.push(h),t.pos=n,f}bbox(){let t=this.loadGeometry(),n=1/0,r=1/0,i=-1/0,o=-1/0;for(let u of t)for(let c=0;c<u.length;c+=2)u[c]<n&&(n=u[c]),u[c]>i&&(i=u[c]),u[c+1]<r&&(r=u[c+1]),u[c+1]>o&&(o=u[c+1]);return[n,r,i,o]}};function ti(e,t,n){n&&(e===1?t.id=n.readVarint():e===2?ni(n,t):e===3?t.type=n.readVarint():e===4&&(t.geomOffset=n.pos,n.skip(2)))}function ni(e,t){let n=e.readVarint()+e.pos;for(;e.pos<n;){let r=t.keys[e.readVarint()],i=t.values[e.readVarint()];r!==void 0&&(t.properties[r]=i)}}var Tt=class e{constructor(t){this.pbf=t;this.version=1;this.name="";this.extent=4096;this.featureOffsets=[];this.keys=[];this.values=[]}static read(t,n){let r=new e(t);return t.readFields(ri,r,n),r}get length(){return this.featureOffsets.length}feature(t){let n=this.pbf;n.pos=this.featureOffsets[t];let r=n.readVarint()+n.pos;return Lt.read(n,r,this.keys,this.values,this.extent)}*features(){for(let t=0;t<this.featureOffsets.length;t++)yield this.feature(t)}};function ri(e,t,n){n&&(e===15?t.version=n.readVarint():e===1?t.name=n.readString():e===5?t.extent=n.readVarint():e===2?t.featureOffsets.push(n.pos):e===3?t.keys.push(n.readString()):e===4&&t.values.push(ii(n)))}function ii(e){let t=e.readVarint()+e.pos,n=null;for(;e.pos<t;){let r=e.readVarint()>>3;r===1?n=e.readString():r===2?n=e.readFloat():r===3?n=e.readDouble():r===4?n=e.readVarint64():r===5?n=e.readVarint():r===6?n=e.readSVarint():r===7?n=e.readBoolean():e.skip(r)}return n}var wt=class{constructor(t){this.layers={};new ct(t instanceof Uint8Array?t:new Uint8Array(t)).readFields((r,i,o)=>{if(r===3&&o){let u=Tt.read(o,o.readVarint()+o.pos);u.length&&(this.layers[u.name]=u)}},null)}};function Ye(e){let t=[],n=null;for(let r of e){if(r.length<6)continue;let i=oi(r);i!==0&&(i>0?(n&&t.push(n),n={outer:r,holes:[]}):n&&n.holes.push(r))}return n&&t.push(n),t}function oi(e){let t=0;for(let n=0,r=e.length-2;n<e.length;r=n,n+=2)t+=(e[r]-e[n])*(e[n+1]+e[r+1]);return t/2}function pe(e,t){if(!e)return!0;let n=e[0];switch(n){case"all":return e.slice(1).every(r=>pe(r,t));case"any":return e.slice(1).some(r=>pe(r,t));case"!":return!pe(e[1],t);case"has":return t[e[1]]!=null;case"!has":return t[e[1]]==null;case"in":{let r=t[e[1]];return r==null?!1:e.slice(2).includes(r)}case"!in":{let r=t[e[1]];return r==null?!0:!e.slice(2).includes(r)}default:{let r=t[e[1]],i=e[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 si=Math.PI/8,ui=.35,li=32,dn=.25,xn=.5,gn=.07;function Ce(e,t){let n=t.radius;if(!(n>0))return e;let r=e.length/2-1;if(r<3)return e;let i=Math.max(2,Math.round(t.segments??4)),o=Math.max(t.minCutRatio??ui,0),u=t.extent,c=[];for(let f=0;f<r;f++){let h=e[f*2],m=e[f*2+1],g=e[(f+r-1)%r*2],x=e[(f+r-1)%r*2+1],v=e[(f+1)%r*2],S=e[(f+1)%r*2+1],P=h-g,_=m-x,I=v-h,A=S-m,k=Math.hypot(P,_),L=Math.hypot(I,A);if(k<1e-6||L<1e-6){c.push(h,m);continue}let V=P/k,U=_/k,N=I/L,T=A/L;if(t.keep?.[f]){c.push(h,m);continue}let j=V*N+U*T;if(j>.985){c.push(h,m);continue}if(u!==void 0&&(h<=0||h>=u||m<=0||m>=u)){c.push(h,m);continue}let Y=Math.min(n,k*mn,L*mn);if(Y<n*o){c.push(h,m);continue}let $=h-V*Y,O=m-U*Y,G=h+N*Y,W=m+T*Y,D=Math.acos(Math.max(-1,Math.min(1,j))),Q=Math.min(si,Math.PI/2/i),oe=Math.ceil(D/Q-1e-6),ee=t.maxChord&&t.maxChord>0?Math.ceil(Y/Math.tan(D/2)*D/t.maxChord):0,ne=Math.max(1,Math.min(li,Math.max(Math.min(i,oe),ee)));c.push($,O);for(let Z=1;Z<ne;Z++){let le=Z/ne,K=1-le;c.push(K*K*$+2*K*le*h+le*le*G,K*K*O+2*K*le*m+le*le*W)}c.push(G,W)}return c.length<6?e:(c.push(c[0],c[1]),c)}var mn=.4;var we=e=>e/64;function Ve(e,t,n=0){let r=yn(e.outer,t,n);if(!r)return null;let i=[];for(let o of e.holes){let u=yn(o,t,n);u&&i.push(u)}return{outer:r,holes:i}}function yn(e,t,n){let r=[];for(let i=0;i<e.length-2;i+=2)r.push(e[i],e[i+1]);if(r.length<6)return null;for(let i=0;i<4;i++){let o=r;r=[];let u=o.length/2;if(u===0)return null;for(let c=0;c<u;c++){let f=o[c*2],h=o[c*2+1],m=o[(c+u-1)%u*2],g=o[(c+u-1)%u*2+1],x=bn(f,h,i,t,n),v=bn(m,g,i,t,n);if(x!==v){let S=ci(m,g,f,h,i,t,n),P=i===0?-n:i===1?t+n:m+(f-m)*S,_=i===2?-n:i===3?t+n:g+(h-g)*S;r.push(P,_)}x&&r.push(f,h)}}return r.length<6?null:(r.push(r[0],r[1]),r)}function bn(e,t,n,r,i){return n===0?e>=-i:n===1?e<=r+i:n===2?t>=-i:t<=r+i}function ci(e,t,n,r,i,o,u){return i===0?(-u-e)/(n-e):i===1?(o+u-e)/(n-e):i===2?(-u-t)/(r-t):(o+u-t)/(r-t)}function vt(e,t,n,r,i,o=0){let u=-o,c=i+o;return e===u&&n===u||e===c&&n===c||t===u&&r===u||t===c&&r===c}function Ct(e,t){for(let n=0;n<e.length;n+=2)if(e[n]<=0||e[n]>=t||e[n+1]<=0||e[n+1]>=t)return!0;return!1}var wn=1,Ut=18,Dt=32,vn=8,kn=65535/Dt,fi=9,ai=1,hi=0,pi=1,mi=2;var Sn=0,di=1,Mn=2,xi=3,gi=.47;function _n(e,t,n,r={},i){let o=r.metersPerUnit&&r.metersPerUnit>0?r.metersPerUnit:gi,{b:u,ensure:c,take:f}=yi(Math.max(1024,e.length*48));for(let h of e.features()){if(h.type!==3||!pe(n,h.properties))continue;let m=Di(h.properties),g=Gi(h.properties,m);if(m<=g)continue;let x=Hi(h.properties)??Number(h.id??0),v=Ui(x>>>0),S=Oi(v,h.properties),P=Vi(h.properties,m),_=Ye(h.loadGeometry()),I=i?_.some(A=>{let k=Ve(A,t,we(t));return k?Ct(k.outer,t):!1}):!1;for(let A of _){if(i&&I){let k=ji(A,t,m,g,x,v,S,P);k&&i.push(k)}zi(u,A,c,{extent:t,metersPerUnit:o,height:m,minHeight:g,featureId:x,seed:v,tint:S,facade:P,props:h.properties,cornerRadius:r.cornerRadius??0,cornerSegments:r.cornerSegments,whole:!1})}}return f(t)}function yi(e){let t=e,n=new ArrayBuffer(t*Ut),r={verts:new DataView(n),vertsU8:new Uint8Array(n),vertOffset:0,vertexCount:0,indices:[],featureIds:[],ensure:()=>{}},i=u=>{if(r.vertexCount+u<=t)return;t=Math.max(t*2,r.vertexCount+u);let c=new ArrayBuffer(t*Ut);new Uint8Array(c).set(r.vertsU8.subarray(0,r.vertOffset)),n=c,r.verts=new DataView(c),r.vertsU8=new Uint8Array(c)};return r.ensure=i,{b:r,ensure:i,take:u=>{if(!r.indices.length)return null;let c=new Uint32Array(r.indices),f=new Float64Array(r.featureIds);return{vertices:n.slice(0,r.vertOffset),indices:c.buffer,featureIds:f.buffer,vertexCount:r.vertexCount,indexCount:c.length,extent:u}}}}var Gt=(e,t)=>e|t<<2,En=e=>Math.max(-32768,Math.min(32767,e)),Vt=e=>Math.max(0,Math.min(65535,Math.round(Math.min(e,kn)*Dt)));function Ze(e,t,n,r,i,o,u,c,f,h,m=0,g=0,x=0){let v=e.vertOffset;return e.verts.setInt16(v,En(Math.round(t*vn)),!0),e.verts.setInt16(v+2,En(Math.round(n*vn)),!0),e.verts.setUint16(v+4,Math.round(Math.min(r,kn)*Dt),!0),e.vertsU8[v+6]=f,e.vertsU8[v+7]=c,e.verts.setInt8(v+8,Ot(Math.round(i*127))),e.verts.setInt8(v+9,Ot(Math.round(o*127))),e.verts.setInt8(v+10,Ot(Math.round(u*127))),e.vertsU8[v+11]=h,e.verts.setUint16(v+12,Vt(m),!0),e.verts.setUint16(v+14,Vt(g),!0),e.verts.setUint16(v+16,Vt(x),!0),e.vertOffset+=Ut,e.vertexCount++}function Rn(e,t,n,r,i,o,u,c,f,h){let m=t.length/2;if(m<3)return;let g=Gt(hi,u),x=wi(t,c),v=r-n,S=new Float64Array(m*2),P=new Uint8Array(m);{let _=new Float64Array(m*2);for(let I=0;I<m-1;I++){let A=t[I*2+2]-t[I*2],k=t[I*2+3]-t[I*2+1],L=Math.hypot(A,k)||1;_[I*2]=k/L,_[I*2+1]=-A/L}for(let I=0;I<m-1;I++){let A=(I+m-2)%(m-1),k=_[A*2]*_[I*2]+_[A*2+1]*_[I*2+1],L=_[A*2]+_[I*2],V=_[A*2+1]+_[I*2+1],U=Math.hypot(L,V);k>.5&&U>1e-6&&(S[I*2]=L/U,S[I*2+1]=V/U,P[I]=1)}}for(let _=0;_<m-1;_++){let I=t[_*2],A=t[_*2+1],k=t[_*2+2],L=t[_*2+3];if(I===k&&A===L||h[_])continue;let V=k-I,U=L-A,N=Math.hypot(V,U)||1,T=U/N,j=-V/N,Y=x.offset[_],$=x.width[_],O=[0,1];if(f){for(let W=0;W<f.length;W++)for(let D=W+1;D<f.length;D++){let Q=je(f[W],I,A)-je(f[D],I,A),oe=je(f[W],k,L)-je(f[D],k,L);if(Q===oe)continue;let ee=Q/(Q-oe);ee>1e-4&&ee<1-1e-4&&O.push(ee)}O.sort((W,D)=>W-D)}let G=(W,D)=>{if(!f)return r;let Q=1/0;for(let oe of f)Q=Math.min(Q,je(oe,W,D));return Math.max(r,Q)};for(let W=0;W+1<O.length;W++){let D=O[W],Q=O[W+1];if(Q-D<1e-6)continue;let oe=I+V*D,ee=A+U*D,ne=I+V*Q,Z=A+U*Q,le=Y+N*D*c,K=Y+N*Q*c,q=(_+1)%(m-1),he=P[_]?S[_*2]:T,me=P[_]?S[_*2+1]:j,ce=P[q]?S[q*2]:T,fe=P[q]?S[q*2+1]:j,ae=T+(he-T)*(1-D),de=j+(me-j)*(1-D),Se=T+(ce-T)*Q,Fe=j+(fe-j)*Q,re=Math.hypot(ae,de)||1,Ue=Math.hypot(Se,Fe)||1,ve=ae/re,De=de/re,Ie=Se/Ue,Le=Fe/Ue;e.ensure(4);let Me=Ze(e,oe,ee,n,ve,De,0,0,o,g,le,$,v),Ge=Ze(e,ne,Z,n,Ie,Le,0,0,o,g,K,$,v),$e=Ze(e,oe,ee,G(oe,ee),ve,De,0,255,o,g,le,$,v),Ne=Ze(e,ne,Z,G(ne,Z),Ie,Le,0,255,o,g,K,$,v);e.indices.push(Me,Ne,Ge,Me,$e,Ne),e.featureIds.push(i,i)}}}var bi=.9976;function wi(e,t){let n=e.length/2-1,r=[];for(let f=0;f<n;f++){let h=e[f*2+2]-e[f*2],m=e[f*2+3]-e[f*2+1],g=Math.hypot(h,m);r.push(g>0?{x:h/g,y:m/g,len:g*t}:{x:0,y:0,len:0})}let i=(f,h)=>r[f].len>0&&r[h].len>0&&r[f].x*r[h].x+r[f].y*r[h].y>=bi,o=0;for(;o<n&&i((o-1+n)%n,o);)o++;o>=n&&(o=0);let u=new Array(n).fill(0),c=new Array(n).fill(0);for(let f=0;f<n;){let h=(o+f)%n,m=[h],g=r[h].len,x=f+1;for(;x<n;){let S=(o+x)%n;if(!i((o+x-1)%n,S))break;m.push(S),g+=r[S].len,x++}let v=0;for(let S of m)u[S]=v,c[S]=g,v+=r[S].len;f=x}return{offset:u,width:c}}function vi(e,t,n,r,i,o,u){let c=[],f=[];for(let x=0;x<t.length;x++)c.push(t[x]);for(let x of n){f.push(c.length/2);for(let v=0;v<x.length;v++)c.push(x[v])}let h=Oe(c,f.length?f:void 0,2);if(!h.length)return;let m=Gt(pi,u),g=e.vertexCount;for(let x=0;x<c.length;x+=2)Ze(e,c[x],c[x+1],r,0,0,1,255,o,m);for(let x=0;x<h.length;x+=3)e.indices.push(g+h[x],g+h[x+2],g+h[x+1]),e.featureIds.push(i)}function Si(e){let t=Mi(e);if(t.length<3)return null;let n=Math.abs(Ei(e));if(n<=0)return null;let r=null,i=1/0;for(let o=0;o<t.length;o++){let u=(o+1)%t.length,c=t[u].x-t[o].x,f=t[u].y-t[o].y,h=Math.hypot(c,f);if(h<1e-6)continue;c/=h,f/=h;let m=1/0,g=-1/0,x=1/0,v=-1/0;for(let L of t){let V=L.x*c+L.y*f,U=-L.x*f+L.y*c;V<m&&(m=V),V>g&&(g=V),U<x&&(x=U),U>v&&(v=U)}let S=g-m,P=v-x,_=S*P;if(_<=0||_>=i)continue;i=_;let I=(m+g)/2,A=(x+v)/2,k=S>=P;r={cx:I*c-A*f,cy:I*f+A*c,ax:k?c:-f,ay:k?f:c,halfLong:(k?S:P)/2,halfShort:(k?P:S)/2,fill:n/_}}return r}function Mi(e){let t=[];for(let o=0;o<e.length-2;o+=2)t.push({x:e[o],y:e[o+1]});if(t.length<3)return t;t.sort((o,u)=>o.x===u.x?o.y-u.y:o.x-u.x);let n=(o,u,c)=>(u.x-o.x)*(c.y-o.y)-(u.y-o.y)*(c.x-o.x),r=[];for(let o of t){for(;r.length>=2&&n(r[r.length-2],r[r.length-1],o)<=0;)r.pop();r.push(o)}let i=[];for(let o=t.length-1;o>=0;o--){let u=t[o];for(;i.length>=2&&n(i[i.length-2],i[i.length-1],u)<=0;)i.pop();i.push(u)}return r.pop(),i.pop(),r.concat(i)}function Ei(e){let t=0;for(let n=0;n<e.length-2;n+=2)t+=e[n]*e[n+3]-e[n+2]*e[n+1];return t/2}var Ri=Math.tan(30*Math.PI/180),Fi=3.5,Ii=.9;function Pi(e,t,n,r,i){if(t.fill<.86)return null;let o=t.halfShort*2*i,u=t.halfLong*2*i,c=o*u,f=t.halfShort>0?t.halfLong/t.halfShort:99,h=ki(e);if(!h){if(n>15||c>600||o<3)return null;let m=r%1e3/1e3;c<30?h=m<.5?"skillion":"gabled":f<1.25?h=m<.35?"pyramidal":"hipped":h=m<.8?"gabled":"hipped"}return h==="flat"?null:{shape:h}}function ki(e){let t=String(e.roof_shape??e["roof:shape"]??"").toLowerCase();return t?t==="flat"?"flat":t==="skillion"||t==="lean_to"||t==="shed"?"skillion":t==="hipped"||t==="half-hipped"||t==="gambrel"?"hipped":t==="pyramidal"||t==="dome"||t==="conical"||t==="onion"?"pyramidal":t==="gabled"||t==="mansard"||t==="round"?"gabled":null:null}var je=(e,t,n)=>e.a*t+e.b*n+e.c;function _i(e,t,n,r){let i=e.length/2;if(i<3)return[];let o=[],u=c=>[e[c*2],e[c*2+1]];for(let c=0;c<i;c++){let[f,h]=u(c),[m,g]=u((c+i-1)%i),x=t*f+n*h+r,v=t*m+n*g+r;if(x<=0!=v<=0){let S=v/(v-x);o.push(m+(f-m)*S,g+(h-g)*S)}x<=0&&o.push(f,h)}return o}function Ai(e,t){let n=.5/Math.max(t,1e-6),r=e.length/2-1;if(r<5)return e;let i=[],o=0;i.push(e[0],e[1]);for(let u=1;u<r;u++){let c=e[o*2],f=e[o*2+1],h=e[u*2],m=e[u*2+1],g=h-c,x=m-f,v=Math.hypot(g,x),S=v>1e-6;if(S){for(let P=o+1;P<u;P++)if(Math.abs((e[P*2]-c)*x-(e[P*2+1]-f)*g)/v>=n){S=!1;break}}S||(i.push(e[(u-1)*2],e[(u-1)*2+1]),o=u-1)}return i.length/2<3?e:(i.push(i[0],i[1]),i)}function An(e,t,n){let{ax:r,ay:i,halfLong:o}=t;if(n==="skillion"){let f=-i,h=r;return[{a:f,b:h,c:-(f*t.cx+h*t.cy)+t.halfShort}]}let u=[],c=e.length/2-1;for(let f=0;f<c;f++){let h=e[f*2],m=e[f*2+1],g=e[(f+1)%c*2],x=e[(f+1)%c*2+1],v=g-h,S=x-m,P=Math.hypot(v,S);if(P<1e-6||n==="gabled"&&Math.abs((v*r+S*i)/P)<.86)continue;let _=-S/P,I=v/P;u.push({a:_,b:I,c:-(_*h+I*m)})}return!u.length&&o>0?An(e,t,"hipped"):u}function Bi(e,t){let n=[];for(let i=0;i<t.length-2;i+=2)n.push(t[i],t[i+1]);if(n.length<6)return[];let r=[];for(let i=0;i<e.length;i++){let o=n;for(let u=0;u<e.length&&o.length>=6;u++)u!==i&&(o=_i(o,e[i].a-e[u].a,e[i].b-e[u].b,e[i].c-e[u].c));r.push(o.length>=6?o:[])}return r}function Li(e,t){let n=0;for(let r=0;r<t.length;r++){let i=t[r];for(let o=0;o<i.length;o+=2){let u=je(e[r],i[o],i[o+1]);u>n&&(n=u)}}return n}function Ti(e,t,n){return e.map(r=>({a:r.a*t,b:r.b*t,c:r.c*t+n}))}function Ci(e,t,n,r,i,o,u,c){let f=Gt(mi,u);for(let h=0;h<n.length;h++){let m=t[h];if(!m||m.length<6)continue;let g=Oe(m,void 0,2);if(!g.length)continue;let x=-n[h].a/c,v=-n[h].b/c,S=Math.hypot(x,v,1),P={x:x/S,y:v/S,z:1/S};e.ensure(m.length/2);let _=e.vertexCount;for(let I=0;I<m.length;I+=2){let A=Math.max(r,je(n[h],m[I],m[I+1]));Ze(e,m[I],m[I+1],A,P.x,P.y,P.z,255,o,f)}for(let I=0;I<g.length;I+=3)e.indices.push(_+g[I],_+g[I+2],_+g[I+1]),e.featureIds.push(i)}}function Vi(e,t){let n=String(e.class??"").toLowerCase();return n==="industrial"||n==="warehouse"||n==="hangar"||n==="construction"?xi:n==="commercial"||n==="office"||n==="retail"||n==="supermarket"?Mn:n==="house"||n==="detached"||n==="garage"||n==="hut"||n==="shed"||t<=7?Sn:t>=40?Mn:di}function Oi(e,t){let n=String(t.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+(e%121-60)))}function Ui(e){let t=e>>>0;return t=(t>>>16^t)*73244475,t=(t>>>16^t)*73244475,t=t>>>16^t,t>>>0}function Di(e){let t=We(e.render_height)??We(e.height)??Ni(e.levels??e.building_levels??e["building:levels"]);return t&&t>0?Math.max(t,ai):fi}function Gi(e,t){let n=We(e.render_min_height)??We(e.min_height)??We(e.base)??0;return n>0&&n<t?n:0}function Ni(e){let t=We(e);return t&&t>0?t*3:null}function We(e){if(typeof e=="number"&&isFinite(e))return e;if(typeof e=="string"){let t=parseFloat(e);if(isFinite(t))return t}return null}var Ot=e=>e>127?127:e<-127?-127:e;function Hi(e){let t=e.osm_id;if(typeof t=="number"&&Number.isFinite(t))return t;if(typeof t=="string"){let n=Number(t);if(Number.isFinite(n))return n}return null}function Fn(e,t){let n=e.length/2-1,r=new Array(Math.max(n,0)).fill(!1);if(n<3)return{ring:e,cut:r};let i=(u,c)=>u===0?1:u===t?2:c===0?3:c===t?4:0,o=e.slice();for(let u=0;u<n;u++){let c=e[u*2],f=e[u*2+1],h=i(c,f);if(!h)continue;let m=(u+n-1)%n,g=(u+1)%n,x=i(e[m*2],e[m*2+1])===h,v=i(e[g*2],e[g*2+1])===h;v&&(r[u]=!0);let S=x===v?-1:x?g:m;if(S<0)continue;let P=c-e[S*2],_=f-e[S*2+1],I=Math.hypot(P,_);I<1e-6||(o[u*2]=c+P/I*wn,o[u*2+1]=f+_/I*wn)}return o[n*2]=o[0],o[n*2+1]=o[1],{ring:o,cut:r}}function zi(e,t,n,r){let{extent:i,metersPerUnit:o,height:u,minHeight:c,featureId:f,seed:h,tint:m,facade:g}=r,x=r.whole?t:Ve(t,i,we(i));if(!x)return;let v=r.cornerRadius/o,S={radius:v,segments:r.cornerSegments,minCutRatio:0,maxChord:o>0?xn/o:0,...r.whole?{}:{extent:i,margin:we(i)}},P=v>0?{outer:Ce(x.outer,S),holes:x.holes.map($=>Ce($,S))}:x,_=r.whole?P:Ve(P,i);if(!_)return;let I=$=>({ring:$,cut:new Array(Math.max($.length/2-1,0)).fill(!1)}),A=r.whole?I(_.outer):Fn(_.outer,i),k=_.holes.map($=>r.whole?I($):Fn($,i)),L={outer:A.ring,holes:k.map($=>$.ring)},V=r.whole?!0:Ct(L.outer,i),U=L.outer.length/2+L.holes.reduce(($,O)=>$+O.length/2,0);n(U*5+32);let N=L.holes.length||V?null:Si(L.outer),T=N?Pi(r.props,N,u,h,o):null,j=null,Y=[];if(T&&N){let $=An(Ai(L.outer,o),N,T.shape);Y=Bi($,L.outer);let O=Li($,Y);if(O>1e-6){let G=Math.min(Math.max(O*o*Ri,Ii),Fi);j=Ti($,G/O,u)}}Rn(e,L.outer,c,u,f,m,g,o,j,A.cut);for(let $=0;$<L.holes.length;$++)Rn(e,L.holes[$],c,u,f,m,g,o,null,k[$].cut);j?Ci(e,Y,j,u,f,m,g,o):vi(e,L.outer,L.holes,u,f,m,g)}function In(e,t){let n=we(t),r=Math.max(e.length/2-1,0),i=new Array(r);for(let o=0;o<r;o++)i[o]=vt(e[o*2],e[o*2+1],e[o*2+2],e[o*2+3],t,n);return i}function ji(e,t,n,r,i,o,u,c){let f=Ve(e,t,we(t));if(!f)return null;let h=In(f.outer,t);return{osmId:i,height:n,minHeight:r,seed:o,tint:u,facade:c,outer:f.outer,holes:f.holes,outerCut:h,holeCuts:f.holes.map(m=>In(m,t))}}function Nt(e,t,n,r,i){let o=r*r,u=[],c=m=>e[m*2],f=m=>e[m*2+1],h=(m,g)=>{let x=e.length/2;return e.push((c(m)+c(g))/2,(f(m)+f(g))/2),x};for(let m=0;m<t.length;m+=3){u.push([n+t[m],n+t[m+1],n+t[m+2]]);let g=0;for(;u.length&&!(++g>2e4);){let[x,v,S]=u.pop(),P=(c(x)-c(v))**2+(f(x)-f(v))**2,_=(c(v)-c(S))**2+(f(v)-f(S))**2,I=(c(S)-c(x))**2+(f(S)-f(x))**2,A=Math.max(P,_,I);if(A<=o){i.push(x,v,S);continue}if(A===P){let k=h(x,v);u.push([x,k,S],[k,v,S])}else if(A===_){let k=h(v,S);u.push([v,k,x],[k,S,x])}else{let k=h(S,x);u.push([S,k,v],[k,x,v])}}}}function Bn(e,t,n=0,r,i=!1,o=4096){let u=[],c=[],f=[];for(let v of e.features()){if(v.type!==3||!pe(t,v.properties))continue;let S=v.properties.osm_id,P=typeof S=="number"?S:typeof S=="string"?Number(S):NaN,_=Number.isFinite(P)?P:Number(v.id??0);for(let I of Ye(v.loadGeometry())){let A=i?Ve(I,o):I;if(!A)continue;let k=[],L=[],V=r?Ce(A.outer,r):A.outer;for(let T=0;T<V.length;T++)k.push(V[T]);for(let T of A.holes){let j=r?Ce(T,r):T;L.push(k.length/2);for(let Y=0;Y<j.length;Y++)k.push(j[Y])}let U=Oe(k,L.length?L:void 0,2);if(!U.length)continue;let N=u.length/2;for(let T=0;T<k.length;T++)u.push(k[T]);if(n>0){let T=[];Nt(u,U,N,n,T);for(let j=0;j<T.length;j+=3)c.push(T[j],T[j+2],T[j+1]),f.push(_);continue}for(let T=0;T<U.length;T+=3)c.push(N+U[T],N+U[T+2],N+U[T+1]),f.push(_)}}if(!c.length)return null;let h=u.length/2,m=new Int16Array(u),g=new Uint32Array(c);return{featureIds:new Float64Array(f).buffer,vertices:m.buffer,indices:g.buffer,vertexCount:h,indexCount:g.length}}function Tn(e){return{shapes:[],cells:[],extent:0,metersPerTile:e}}function Cn(e,t,n,r){if(!(n<=0)){e.extent=r;for(let i of t){let o=i.outer;if(o.length<6)continue;let u=1/0,c=1/0,f=-1/0,h=-1/0;for(let m=0;m<o.length;m+=2)o[m]<u&&(u=o[m]),o[m]>f&&(f=o[m]),o[m+1]<c&&(c=o[m+1]),o[m+1]>h&&(h=o[m+1]);e.shapes.push({outer:o,holes:i.holes,level:n,minX:u,minY:c,maxX:f,maxY:h})}e.cells=[]}}function $i(e){e.cells=Array.from({length:32*32},()=>[]);let t=e.extent/32;for(let n=0;n<e.shapes.length;n++){let r=e.shapes[n],i=Qe(Math.floor(r.minX/t)),o=Qe(Math.floor(r.maxX/t)),u=Qe(Math.floor(r.minY/t)),c=Qe(Math.floor(r.maxY/t));for(let f=u;f<=c;f++)for(let h=i;h<=o;h++)e.cells[f*32+h].push(n)}}var Vn=e=>e.shapes.length===0;function Ht(e,t,n){!e.cells.length&&e.shapes.length&&$i(e);let r=e.extent/32,i=e.cells[Qe(Math.floor(n/r))*32+Qe(Math.floor(t/r))];if(!i||!i.length)return 0;let o=0;for(let u of i){let c=e.shapes[u];if(c.level<=o||t<c.minX||t>c.maxX||n<c.minY||n>c.maxY||!Ln(c.outer,t,n))continue;let f=!1;for(let h of c.holes)if(Ln(h,t,n)){f=!0;break}f||(o=c.level)}return Math.min(Math.round(o*100),127)}function On(e,t){let n=[],r=[],i=e.extent>0?e.metersPerTile/e.extent:0,o=i>0?2/i:0,u=Ht(e,t[0],t[1]);n.push(t[0],t[1]),r.push(u);for(let c=0;c+3<t.length;c+=2){let f=t[c],h=t[c+1],m=t[c+2],g=t[c+3],x=Ht(e,m,g);if(x!==u&&o>0){let v=Math.hypot(m-f,g-h),S=Math.min(Math.ceil(v/o),64),P=u;for(let _=1;_<S;_++){let I=_/S,A=f+(m-f)*I,k=h+(g-h)*I,L=Ht(e,A,k);L!==P&&(n.push(A,k),r.push(L),P=L)}}n.push(m,g),r.push(x),u=x}return{pts:n,levels:r}}var Qe=e=>e<0?0:e>31?31:e;function Ln(e,t,n){let r=!1,i=e.length/2;for(let o=0,u=i-1;o<i;u=o++){let c=e[o*2],f=e[o*2+1],h=e[u*2],m=e[u*2+1];f>n!=m>n&&t<(h-c)*(n-f)/(m-f)+c&&(r=!r)}return r}var Xi=wr(Un(),1),Dn=Xi,$t=Dn.union??Dn.default?.union??null;$t||console.warn("[osmgl] polygon-clipping \\u0431\\u0435\\u0437 union \\u2014 \\u043E\\u0431\\u044A\\u0435\\u0434\\u0438\\u043D\\u0435\\u043D\\u0438\\u0435 \\u0444\\u0438\\u0433\\u0443\\u0440 \\u0432\\u044B\\u043A\\u043B\\u044E\\u0447\\u0435\\u043D\\u043E");function Gn(e){let t=[];for(let n=0;n+1<e.length;n+=2)t.push([e[n],e[n+1]]);return t}function Nn(e){let t=[];for(let r of e)t.push(r[0],r[1]);let n=t.length;return n>=4&&(t[0]!==t[n-2]||t[1]!==t[n-1])&&t.push(t[0],t[1]),t}function Hn(e,t,n=0){if(e.length<2)return e;let r=new Map;for(let o of e){let u=o.lift??0,c=r.get(u);c?c.push(o):r.set(u,[o])}let i=[];for(let[o,u]of r){if(u.length<2){i.push(...u);continue}let f=(n>0&&t?u.map(g=>({outer:t(g.outer,-n)??g.outer,holes:g.holes.map(x=>t(x,n)??x)})):u).map(g=>[Gn(g.outer),...g.holes.map(Gn)]),h;try{if(!$t)throw new Error("\\u043D\\u0435\\u0442 union");h=$t(f[0],...f.slice(1))}catch{i.push(...u);continue}let m=h;if(!Array.isArray(m)||m.length===0){i.push(...u);continue}for(let g of m){if(!g.length)continue;let x=Nn(g[0]);if(x.length<8)continue;let v=[];for(let S=1;S<g.length;S++){let P=Nn(g[S]);P.length>=8&&v.push(P)}i.push(o?{outer:x,holes:v,lift:o}:{outer:x,holes:v})}}return i}var Qt=16,Yi=64,Wn=0,Zi=1,zn=2,Wi=3,St=1,Qi=.6;function Qn(e,t,n,r){let i=r.metersPerUnit>0?r.metersPerUnit:.5,o=r.elevation,u=r.base??0,c=Math.max(r.bevel??0,0)/i,f=Math.max(r.bevelDrop??0,0),h=Math.max(r.cornerRadius??0,0)/i,m=Math.max(512,e.length*24),g=new ArrayBuffer(m*Qt),x={view:new DataView(g),bytes:new Uint8Array(g),offset:0,count:0,indices:[],extent:t,ensure(O){if(x.count+O<=m)return;m=Math.max(m*2,x.count+O);let G=new ArrayBuffer(m*Qt);new Uint8Array(G).set(x.bytes.subarray(0,x.offset)),g=G,x.view=new DataView(G),x.bytes=new Uint8Array(G)}},v=[],S=[],P=new Map;for(let O of e.features()){if(O.type!==3||!pe(n,O.properties))continue;let G=r.liftBy?.(O.properties)??0,W=O.properties.osm_id,D=typeof W=="number"?W:typeof W=="string"?Number(W):NaN,Q=Number.isFinite(D)?D:Number(O.id??0);for(let oe of Ye(O.loadGeometry())){let ee=Ve(oe,t,we(t));ee&&(v.push(G?{...ee,lift:G}:ee),S.push(Q))}}let _=new Set,I=Math.max(r.weld??Qi,0),A=Hn(v,(O,G)=>Yt(O,G,t,_),I/i),k=I>0?A.map(O=>({...O,outer:Zn(O.outer,I/i,t),holes:O.holes.map(G=>Zn(G,I/i,t))})):A;for(let O of k){$n(O.outer,P);for(let G of O.holes)$n(G,P)}r.onShapes?.(k);let L=Ki(k,v,S),V=new Set;for(let[O,G]of P)G>1&&V.add(O);let U=[],N={radius:h,segments:r.cornerSegments,extent:t,margin:we(t),minCutRatio:0,maxChord:dn/i},T=[];for(let O of k){let G=x.indices.length,W=U.length,D=h>0?{outer:Ce(O.outer,{...N,keep:Xn(O.outer,V)}),holes:O.holes.map(q=>Ce(q,{...N,keep:Xn(q,V)}))}:O,Q=c>0?Yt(D.outer,c,t,V):D.outer,oe=D.holes.map(q=>c>0?Yt(q,-c,t,V):q),ee=O.lift??0,ne=o+ee,Z=u+ee;Yn(x,Q??D.outer,oe.map((q,he)=>q??D.holes[he]),ne,Wn,r.maxSegment??0);let le=ne,K=ne-f;Q&&c>0&&f>0&&Xt(x,Q,D.outer,le,K,Zi,t,V),K!==Z&&Xt(x,D.outer,D.outer,K,Z,zn,t,V);for(let q of D.holes)if(K!==Z&&Xt(x,q,q,K,Z,zn,t,V),ne<Z){let he=x.indices.length;Yn(x,q,[],Z,Wi);for(let me=he;me<x.indices.length;me++)U.push(x.indices[me]);x.indices.length=he}T.push(G,x.indices.length,W,U.length)}if(!x.indices.length&&!U.length)return null;let j=x.indices.length;for(let O=0;O<T.length;O+=4)T[O+2]+=j,T[O+3]+=j;let Y=[];for(let O of L){Y.push(O.length);for(let G of O)Y.push(G)}let $=new Uint32Array(j+U.length);return $.set(x.indices,0),$.set(U,j),{vertices:g.slice(0,x.offset),indices:$.buffer,vertexCount:x.count,indexCount:$.length,extent:t,capIndexOffset:j,shapeFeatures:new Float64Array(Y).buffer,shapeRanges:new Uint32Array(T).buffer}}function Ki(e,t,n){let r=e.map(()=>[]);if(!e.length)return r;let i=e.map(o=>jn(o.outer));for(let o=0;o<t.length;o++){let u=Ji(t[o].outer);if(!u)continue;let c=-1;for(let f=0;f<e.length;f++){let h=i[f];if(u[0]<h[0]||u[0]>h[2]||u[1]<h[1]||u[1]>h[3]||!Kt(e[f].outer,u[0],u[1]))continue;let m=!1;for(let g of e[f].holes)if(Kt(g,u[0],u[1])){m=!0;break}if(!m){c=f;break}}if(c<0){let f=jn(t[o].outer),h=0;for(let m=0;m<e.length;m++){let g=i[m],x=Math.min(f[2],g[2])-Math.max(f[0],g[0]),v=Math.min(f[3],g[3])-Math.max(f[1],g[1]),S=x>0&&v>0?x*v:0;S>h&&(h=S,c=m)}}c<0&&(c=0),r[c].includes(n[o])||r[c].push(n[o])}return r}function jn(e){let t=1/0,n=1/0,r=-1/0,i=-1/0;for(let o=0;o<e.length;o+=2)e[o]<t&&(t=e[o]),e[o]>r&&(r=e[o]),e[o+1]<n&&(n=e[o+1]),e[o+1]>i&&(i=e[o+1]);return[t,n,r,i]}function Ji(e){let t=e.length/2-1;if(t<3)return null;let n=0;for(let i=0;i<t;i++){let o=(i+1)%t;n+=e[i*2]*e[o*2+1]-e[o*2]*e[i*2+1]}let r=n>0;for(let i=0;i<t;i++){let o=(i+t-1)%t*2,u=i*2,c=(i+1)%t*2,f=(e[u]-e[o])*(e[c+1]-e[o+1])-(e[u+1]-e[o+1])*(e[c]-e[o]);if(f===0||f>0!==r)continue;let h=(e[o]+e[u]+e[c])/3,m=(e[o+1]+e[u+1]+e[c+1])/3;if(Kt(e,h,m))return[h,m]}return null}function Kt(e,t,n){let r=!1,i=e.length/2-1;for(let o=0,u=i-1;o<i;u=o++){let c=e[o*2],f=e[o*2+1],h=e[u*2],m=e[u*2+1];f>n!=m>n&&t<(h-c)*(n-f)/(m-f)+c&&(r=!r)}return r}function Ke(e,t,n,r){let i=`${Math.round(e*100)},${Math.round(t*100)}`,o=`${Math.round(n*100)},${Math.round(r*100)}`;return i<o?`${i}|${o}`:`${o}|${i}`}function $n(e,t){for(let n=0;n+3<e.length;n+=2){let r=Ke(e[n],e[n+1],e[n+2],e[n+3]);t.set(r,(t.get(r)??0)+1)}}function Xn(e,t){if(!t.size)return;let n=e.length/2-1,r=new Array(n).fill(!1);for(let i=0;i<n;i++){let o=Ke(e[(i+n-1)%n*2],e[(i+n-1)%n*2+1],e[i*2],e[i*2+1]),u=Ke(e[i*2],e[i*2+1],e[(i+1)%n*2],e[(i+1)%n*2+1]);(t.has(o)||t.has(u))&&(r[i]=!0)}return r}function ft(e,t,n,r,i,o,u,c){let f=e.offset;return e.view.setFloat32(f,t,!0),e.view.setFloat32(f+4,n,!0),e.view.setInt16(f+8,qi(Math.round(r*Yi)),!0),e.view.setInt8(f+10,Wt(Math.round(i*127))),e.view.setInt8(f+11,Wt(Math.round(o*127))),e.view.setInt8(f+12,Wt(Math.round(u*127))),e.bytes[f+13]=c,e.view.setInt8(f+14,t<=0?-St:t>=e.extent?St:0),e.view.setInt8(f+15,n<=0?-St:n>=e.extent?St:0),e.offset+=Qt,e.count++}function Yn(e,t,n,r,i=Wn,o=0){let u=[],c=[];for(let g=0;g<t.length;g++)u.push(t[g]);for(let g of n){c.push(u.length/2);for(let x=0;x<g.length;x++)u.push(g[x])}let f=Oe(u,c.length?c:void 0,2);if(!f.length)return;let h=f;if(o>0){let g=[];Nt(u,f,0,o,g),h=g}e.ensure(u.length/2);let m=e.count;for(let g=0;g<u.length;g+=2)ft(e,u[g],u[g+1],r,0,0,1,i);for(let g=0;g<h.length;g+=3)e.indices.push(m+h[g],m+h[g+2],m+h[g+1])}function Xt(e,t,n,r,i,o,u,c){let f=Math.min(t.length,n.length)/2;if(!(f<3)){e.ensure((f-1)*4);for(let h=0;h<f-1;h++){let m=n[h*2],g=n[h*2+1],x=n[h*2+2],v=n[h*2+3];if(m===x&&g===v||vt(m,g,x,v,u,we(u))||c.has(Ke(m,g,x,v)))continue;let S=x-m,P=v-g,_=Math.hypot(S,P)||1,I=P/_,A=-S/_,k=r-i,L=Math.hypot(t[h*2]-m,t[h*2+1]-g)||0,V=0;if(L>1e-6&&k!==0){let Y=1/Math.hypot(1,k/L);V=L/Math.hypot(L,k)*Math.sign(k),I*=Y,A*=Y}let U=ft(e,t[h*2],t[h*2+1],r,I,A,V,o),N=ft(e,t[h*2+2],t[h*2+3],r,I,A,V,o),T=ft(e,m,g,i,I,A,V,o),j=ft(e,x,v,i,I,A,V,o);e.indices.push(T,N,j,T,U,N)}}}function Yt(e,t,n,r){let i=e.length/2-1;if(i<3)return null;let o=[];for(let m=0;m<i;m++){let g=e[m*2],x=e[m*2+1],v=e[(m+i-1)%i*2],S=e[(m+i-1)%i*2+1],P=e[(m+1)%i*2],_=e[(m+1)%i*2+1],I=Math.hypot(g-v,x-S)||1,A=Math.hypot(P-g,_-x)||1,k=(x-S)/I,L=-(g-v)/I,V=(_-x)/A,U=-(P-g)/A,N=k+V,T=L+U,j=Math.hypot(N,T);if(j<1e-6){o.push(g,x);continue}N/=j,T/=j;let Y=Math.min(1/Math.max(N*k+T*L,.35),3),$=g-N*t*Y,O=x-T*t*Y,G=Ke(v,S,g,x),W=Ke(g,x,P,_);if(r.has(G)||r.has(W)){o.push(g,x);continue}let D=-we(n),Q=n+we(n);((ee,ne)=>ee<=D||ee>=Q||ne<=D||ne>=Q)(g,x)&&($=g,O=x),o.push($,O)}o.push(o[0],o[1]);let u=Math.abs(Zt(e)),c=Zt(o);if(Math.sign(c)!==Math.sign(Zt(e))||Math.abs(c)<u*.25)return null;let f=-we(n),h=n+we(n);for(let m=0;m<o.length;m+=2)o[m]=Math.max(f,Math.min(h,o[m])),o[m+1]=Math.max(f,Math.min(h,o[m+1]));return o}function Zt(e){let t=0;for(let n=0;n<e.length-2;n+=2)t+=e[n]*e[n+3]-e[n+2]*e[n+1];return t/2}var Wt=e=>e>127?127:e<-127?-127:e,qi=e=>e>32767?32767:e<-32768?-32768:e;function Zn(e,t,n){if(!(t>0))return e;let r=we(n),i=-r,o=n+r,u=e;for(let c=0;c<3;c++){let f=u.length/2-1;if(f<6)break;let h=new Array(f).fill(!0),m=f;for(let x=0;x<f&&!(m<=5);x++){let v=u[x*2],S=u[x*2+1];if(v<=i||v>=o||S<=i||S>=o)continue;let P=(x+f-1)%f;for(;!h[P]&&P!==x;)P=(P+f-1)%f;let _=(x+1)%f;for(;!h[_]&&_!==x;)_=(_+1)%f;if(P===x||_===x)break;let I=u[P*2],A=u[P*2+1],k=u[_*2]-I,L=u[_*2+1]-A,V=Math.hypot(k,L);V<1e-6||Math.abs((v-I)*L-(S-A)*k)/V<t&&(h[x]=!1,m--)}if(m===f)break;let g=[];for(let x=0;x<f;x++)h[x]&&g.push(u[x*2],u[x*2+1]);g.push(g[0],g[1]),u=g}return u}function Je(e){let t=e.layer,n=typeof t=="number"?t:typeof t=="string"?Number(t):NaN;if(Number.isFinite(n)&&n!==0)return Math.max(-5,Math.min(5,Math.trunc(n)));let r=e.brunnel;return r==="bridge"?1:r==="tunnel"?-1:0}var at=20;function qn(e,t,n=0,r,i=0,o={}){let{level:u}=o,c=Math.max(256,e.length*24),f=new ArrayBuffer(c*at),h=new DataView(f),m=0,g=[],x=[],v=V=>{if(m+V<=c)return;c=Math.max(c*2,m+V);let U=new ArrayBuffer(c*at);new Uint8Array(U).set(new Uint8Array(f,0,m*at)),f=U,h=new DataView(U)},S=(V,U,N,T,j,Y,$,O=0,G=0,W=0)=>{let D=m*at;return h.setInt16(D,V,!0),h.setInt16(D+2,U,!0),h.setInt16(D+4,N,!0),h.setInt16(D+6,T,!0),h.setInt8(D+8,j),h.setInt8(D+9,Y),h.setInt8(D+10,O),h.setInt8(D+11,G),h.setFloat32(D+12,$,!0),h.setFloat32(D+16,W,!0),m++},P=0,_=0,I=i>0?12/i:0,A=I>0?io(e):null;for(let V of e.features()){if(V.type!==2&&V.type!==3||!pe(t,V.properties)||u!==void 0&&Je(V.properties)!==u)continue;let U=V.properties.osm_id,N=typeof U=="number"?U:typeof U=="string"?Number(U):NaN;_=Number.isFinite(N)?N:Number(V.id??0);let T=V.properties.width;P=typeof T=="number"&&T>.5&&T<100?T:0;let j=V.type===3;for(let Y of V.loadGeometry()){let $=n>0?to(Kn(Y),n):Kn(Y);if($.length<4)continue;let O=r&&!Vn(r)?On(r,$):null,G=O?O.pts:$,W=O?.levels,D=G.length/2;if(D<2)continue;let Q=Je(V.properties),oe=Mt(Math.round(G[0]),Math.round(G[1])),ee=Mt(Math.round(G[D*2-2]),Math.round(G[D*2-1])),ne=null,Z=P;if(A&&P>0&&!j){let K=0;for(let fe=0;fe<D-1;fe++)K+=Math.hypot(G[fe*2+2]-G[fe*2],G[fe*2+3]-G[fe*2+1]);Z=er(Q,P,oe,ee,A);let q=fe=>Math.min(A.width.get(fe)??0,Z*2),he=q(oe)-Z,me=q(ee)-Z,ce=Math.min(I,K/2);if(ce>0&&(he>0||me>0)){ne=ae=>{let de=0;return he>0&&ae<ce&&(de=he*(1-ae/ce)),me>0&&K-ae<ce&&(de=Math.max(de,me*(1-(K-ae)/ce))),Z+de};let fe=[];for(let ae of[ce,K-ce])ae>.01&&ae<K-.01&&fe.push(ae);if(fe.length){let ae=eo(G,W,fe);G=ae.pts,W=ae.levels,D=G.length/2}}}v((D-1)*4);let le=0;for(let K=0;K<D-1;K++){let q=G[K*2],he=G[K*2+1],me=G[K*2+2],ce=G[K*2+3],fe=Math.hypot(me-q,ce-he);if(j&&ro(q,he,me,ce,e.extent)){le+=fe;continue}let ae=no(q,he,me,ce,e.extent);if(!ae){le+=fe;continue}let[de,Se,Fe,re]=ae,Ue=Math.hypot(de-q,Se-he),ve=Math.hypot(Fe-de,re-Se),De=Math.hypot(me-Fe,ce-re),Ie=le+Ue,Le=W?W[K]:0,Me=W?W[K+1]:0,Ge=ne?ne(Ie):Z,$e=ne?ne(Ie+ve):Z,Ne=S(de,Se,Fe,re,0,-1,Ie,Le,Me,Ge),ht=S(de,Se,Fe,re,0,1,Ie,Le,Me,Ge),pt=S(de,Se,Fe,re,1,1,Ie,Le,Me,$e),Et=S(de,Se,Fe,re,1,-1,Ie,Le,Me,$e);le+=Ue+ve+De,g.push(Ne,ht,pt,Ne,pt,Et),x.push(_,_)}}}if(!g.length)return null;let k=new Uint32Array(g),L=new Float64Array(x);return{vertices:f.slice(0,m*at),indices:k.buffer,vertexCount:m,indexCount:k.length,featureIds:L.buffer}}function eo(e,t,n){let r=[...n].sort((f,h)=>f-h),i=[e[0],e[1]],o=t?[t[0]]:void 0,u=0,c=0;for(let f=0;f+3<e.length;f+=2){let h=e[f],m=e[f+1],g=e[f+2],x=e[f+3],v=Math.hypot(g-h,x-m);for(;c<r.length&&r[c]<=u+.01;)c++;for(;c<r.length&&r[c]<u+v-.01;){let S=(r[c]-u)/v;i.push(h+(g-h)*S,m+(x-m)*S),o&&t&&o.push(Math.round(t[f/2]+(t[f/2+1]-t[f/2])*S)),c++}u+=v,i.push(g,x),o&&t&&o.push(t[f/2+1])}return{pts:i,levels:o}}function to(e,t){let n=[];for(let r=0;r+3<e.length;r+=2){let i=e[r],o=e[r+1],u=e[r+2],c=e[r+3];n.push(i,o);let f=Math.min(64,Math.floor(Math.hypot(u-i,c-o)/t));for(let h=1;h<f;h++){let m=h/f;n.push(i+(u-i)*m,o+(c-o)*m)}}return n.push(e[e.length-2],e[e.length-1]),n}function Kn(e){let t=[];for(let n=0;n<e.length;n+=2){let r=e[n],i=e[n+1],o=t.length;o>=2&&t[o-2]===r&&t[o-1]===i||t.push(r,i)}return t}function no(e,t,n,r,i){let o=n-e,u=r-t,c=0,f=1,h=[[-o,e],[o,i-e],[-u,t],[u,i-t]];for(let[m,g]of h){if(m===0){if(g<0)return null;continue}let x=g/m;if(m<0){if(x>f)return null;x>c&&(c=x)}else{if(x<c)return null;x<f&&(f=x)}}return f-c<1e-6?null:[Math.round(e+o*c),Math.round(t+u*c),Math.round(e+o*f),Math.round(t+u*f)]}function ro(e,t,n,r,i){return e===n&&(e<=0||e>=i)?!0:t===r&&(t<=0||t>=i)}var Jn=new WeakMap,Mt=(e,t)=>(e+512)*65536+(t+512);function er(e,t,n,r,i){if(e===0||t<=0)return t;let o=8*4294967296,u=Math.max(i.raw.get(n+o)??0,i.raw.get(r+o)??0);return u>0&&t>u?u:t}function io(e){let t=Jn.get(e);if(t)return t;let n={width:new Map,ends:new Map,raw:new Map},r=[];for(let i of e.features()){if(i.type!==2)continue;let o=i.properties.width,u=typeof o=="number"&&o>.5&&o<100?o:0,c=Je(i.properties);for(let f of i.loadGeometry()){if(f.length<4)continue;let h=Mt(Math.round(f[0]),Math.round(f[1])),m=Mt(Math.round(f[f.length-2]),Math.round(f[f.length-1]));for(let g of[h,m]){let x=g+(c+8)*4294967296;n.ends.set(x,(n.ends.get(x)??0)+1),u>0&&n.raw.set(x,Math.max(n.raw.get(x)??0,u))}r.push({h,t:m,lv:c,w:u})}}for(let i of r){let o=er(i.lv,i.w,i.h,i.t,n);if(!(o<=0))for(let u of[i.h,i.t]){let c=n.width.get(u);(c===void 0||o>c)&&n.width.set(u,o)}}return Jn.set(e,n),n}var oo=[["\\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."]],tr=new Map(oo);function nr(e){let t=e.split(" ");if(t.length<2)return e;let n=!1,r=t.map(o=>{let u=tr.get(o.toLowerCase());return u?(n=!0,o[0]===o[0].toUpperCase()?u[0].toUpperCase()+u.slice(1):u):o});return!n||!t.filter(o=>tr.get(o.toLowerCase())===void 0).length?e:r.join(" ")}function ir(e,t){let n=[],r=[],i=[],o=[],u=[],c=t.textPlacement==="line",f=[],h=[],m=[];for(let g of e.features()){if(!pe(t.filter,g.properties))continue;let x=g.loadGeometry(),v=lo(g.type,x);if(!v)continue;let S=t.textField?rr(t.textField,g.properties):"",P=S&&t.abbreviate?nr(S):S,_=t.iconImage?rr(t.iconImage,g.properties):"";if(!(!P&&!_)){if(c){let I=uo(g.type,x);if(!I)continue;m.push({text:P,line:I});continue}n.push(v[0],v[1]),r.push(P),i.push(_),o.push(co(g.properties)),u.push(t.iconRotate&&Math.round(Number(g.properties[t.iconRotate]??0))||0)}}if(c){for(let{text:g,line:x}of so(m)){h.push(f.length/2);for(let v of x)f.push(v);n.push(Math.round(x[0]),Math.round(x[1])),r.push(g),i.push(""),o.push(128),u.push(0)}h.push(f.length/2)}return r.length?{anchors:new Int16Array(n).buffer,texts:r,icons:i,priorities:new Uint8Array(o).buffer,rotations:new Int16Array(u).buffer,...c?{lines:new Int16Array(f).buffer,lineStarts:new Uint32Array(h).buffer}:{}}:null}function so(e){let t=[],n=new Map,r=new Map,i=(o,u,c)=>`${o}\\u241F${u}\\u241F${c}`;for(let{text:o,line:u}of e){let c=i(o,u[0],u[1]),f=i(o,u[u.length-2],u[u.length-1]),h=n.get(f),m=r.get(c);if(m!==void 0){let g=t[m];if(g.line.push(...u.slice(2)),r.delete(c),r.set(i(o,g.line[g.line.length-2],g.line[g.line.length-1]),m),h!==void 0&&h!==m){let x=t[h];g.line.push(...x.line.slice(2)),x.line=[],n.delete(f),r.set(i(o,g.line[g.line.length-2],g.line[g.line.length-1]),m)}continue}if(h!==void 0){let g=t[h];g.line.unshift(...u.slice(0,u.length-2)),n.delete(f),n.set(i(o,g.line[0],g.line[1]),h);continue}n.set(c,t.length),r.set(f,t.length),t.push({text:o,line:u})}return t.filter(o=>o.line.length>=4)}function uo(e,t){if(e!==2)return null;let n=null,r=0;for(let i of t){if(i.length<4)continue;let o=0;for(let u=0;u+3<i.length;u+=2)o+=Math.hypot(i[u+2]-i[u],i[u+3]-i[u+1]);o>r&&(r=o,n=i)}return n}function lo(e,t){if(!t.length)return null;if(e===1){let u=t[0];return u.length>=2?[u[0],u[1]]:null}if(e===2){let u=-1,c=0,f=0;for(let h of t)for(let m=0;m+3<h.length;m+=2){let g=h[m+2]-h[m],x=h[m+3]-h[m+1],v=g*g+x*x;v>u&&(u=v,c=h[m]+g/2,f=h[m+1]+x/2)}return u>0?[Math.round(c),Math.round(f)]:null}let n=1/0,r=1/0,i=-1/0,o=-1/0;for(let u of t)for(let c=0;c<u.length;c+=2)u[c]<n&&(n=u[c]),u[c]>i&&(i=u[c]),u[c+1]<r&&(r=u[c+1]),u[c+1]>o&&(o=u[c+1]);return isFinite(n)?[Math.round((n+i)/2),Math.round((r+o)/2)]:null}function co(e){let t=e.rank;return typeof t=="number"&&isFinite(t)?Math.max(0,255-Math.min(t,255)):128}function rr(e,t){let n=Array.isArray(e)?e:[e];for(let r of n){let i=!0,u=r.replace(/\\{([^}]+)\\}/g,(c,f)=>{let h=t[f];return h==null||h===""?(i=!1,""):String(h)}).trim();if(i&&u)return u}return""}function or(e,t){let n=[],r=[];for(let i=0;i<e.length;i++){let o=e.feature(i);if(o.type===1&&pe(t,o.properties))for(let u of o.loadGeometry())for(let c=0;c+1<u.length;c+=2)n.push(u[c],u[c+1]),r.push(o.properties)}return r.length?{anchors:Int16Array.from(n).buffer,props:r}:null}var fo="\\u241F",Jt=(e,t)=>e+fo+String(t);function ao(){let e=typeof self<"u"?self.origin:void 0;return e&&e!=="null"&&!e.startsWith("blob:")?e+"/":void 0}async function sr(e,t){let n=performance.now(),r=ao(),i=await fetch(e.url,{signal:t,credentials:"same-origin",...r?{referrer:r}:{}}),o=(A,k,L,V,U=0)=>({type:"loaded",id:e.id,buckets:{},timing:{fetchMs:V,parseMs:U},diag:{status:A,bytes:k,layers:L,built:0}});if(!i.ok){if(i.status===404||i.status===204)return o(i.status,0,[],performance.now()-n);throw new Error(`HTTP ${i.status} \\u0434\\u043B\\u044F ${e.url}`)}let u=await i.arrayBuffer(),c=performance.now()-n;if(u.byteLength===0)return o(i.status,0,[],c);let f=performance.now(),h=new wt(u),m=Object.keys(h.layers),g={},x=[],v={},S=new Set,P=[],I=e.plan.some(A=>A.type==="surface"&&(A.elevation??0)>0)&&e.plan.some(A=>A.type==="line"&&A.ground)?Tn(e.metersPerTile):void 0;for(let A of e.plan){if(!po(A,e.zoom,e.sourceMaxZoom))continue;let k=h.layers[A.sourceLayer];if(!k)continue;let L=mo(e.zoom,k.extent);try{if(A.splitBy){let U=xo(k,A.splitBy,A.filter);if(!U.length)continue;let N=v[A.splitBy]??(v[A.splitBy]=[]);for(let T of U){N.includes(T)||N.push(T);let j={...A,splitBy:void 0,filter:yo(A.filter,A.splitBy,T)},Y=qt(j,k,L,e.metersPerTile,I,void 0,x);Y&&(g[Jt(A.id,T)]=Y)}continue}if(A.network&&A.type==="line"){for(let U of go(k,A.filter)){let N=qt(A,k,L,e.metersPerTile,I,U,x);N&&(g[Jt(A.id,U)]=N,S.add(U))}continue}let V=qt(A,k,L,e.metersPerTile,I,void 0,x);V&&(g[A.id]=V)}catch(V){P.push(`${A.id}: ${V instanceof Error?V.message:String(V)}`)}}return{type:"loaded",id:e.id,buckets:g,...x.length?{seams:x}:{},...Object.keys(v).length?{splits:v}:{},...S.size?{levels:[...S].sort((A,k)=>A-k)}:{},timing:{fetchMs:c,parseMs:performance.now()-f},diag:{status:i.status,bytes:u.byteLength,layers:m,built:Object.keys(g).length,...P.length?{failed:P}:{}}}}function ho(e){return t=>{let n=t.on;if(typeof n!="string"||!n)return 0;let r=0;for(let i of n.split(",")){let o=e[i];typeof o=="number"&&o>r&&(r=o)}return r}}function po(e,t,n){let r=t-1,i=t<n?t+1:24;return!(e.maxzoom<r||e.minzoom>i)}function mo(e,t){return e<=6?Math.max(64,t/24):0}function qt(e,t,n,r,i,o,u){{if(e.type==="fill"){let f=r>0?r/t.extent:0,h=e.cornerRadius&&f>0?{radius:e.cornerRadius/f,segments:e.cornerSegments,extent:t.extent,minCutRatio:0,maxChord:gn/f}:void 0,m=Bn(t,e.filter,n,h,e.clipToTile===!0,t.extent);return m?{kind:"fill",...m,extent:t.extent}:null}if(e.type==="surface"){let f=Qn(t,t.extent,e.filter,{metersPerUnit:r>0?r/t.extent:0,maxSegment:n,elevation:e.elevation??0,base:e.base,bevel:e.bevel,weld:e.weld,bevelDrop:e.bevelDrop,cornerRadius:e.cornerRadius,cornerSegments:e.cornerSegments,...i?{onShapes:h=>Cn(i,h,e.elevation??0,t.extent)}:{},...e.groundBy?{liftBy:ho(e.groundBy)}:{}});return f?{kind:"surface",...f}:null}if(e.type==="line"){let f=qn(t,e.filter,n,e.ground?i:void 0,r>0?r/t.extent:0,{level:o});return f?{kind:"line",...f,extent:t.extent}:null}if(e.type==="model"){let f=or(t,e.filter);return f?{kind:"placement",...f,extent:t.extent}:null}if(e.type==="symbol"){let f=ir(t,{filter:e.filter,textField:e.textField,iconImage:e.iconImage,iconRotate:e.iconRotate,textPlacement:e.textPlacement,abbreviate:e.abbreviate});return f?{kind:"symbol",...f,extent:t.extent}:null}let c=_n(t,t.extent,e.filter,{metersPerUnit:r>0?r/t.extent:0,cornerRadius:e.cornerRadius,cornerSegments:e.cornerSegments},u);return c?{kind:"fill-extrusion",vertices:c.vertices,indices:c.indices,featureIds:c.featureIds,vertexCount:c.vertexCount,indexCount:c.indexCount,extent:c.extent}:null}}function xo(e,t,n){let r=[];for(let i of e.features()){if(!pe(n,i.properties))continue;let o=i.properties[t];typeof o!="string"&&typeof o!="number"||r.includes(o)||r.push(o)}return r.sort((i,o)=>typeof i=="number"&&typeof o=="number"?i-o:String(i).localeCompare(String(o))),r}function go(e,t){let n=[];for(let r of e.features()){if(!pe(t,r.properties))continue;let i=Je(r.properties);n.includes(i)||n.push(i)}return n.sort((r,i)=>r-i)}function yo(e,t,n){let r=["==",t,n];return e?["all",e,r]:r}var bo=e=>e.kind==="symbol",wo=e=>e.kind==="placement";function ur(e){let t=[];for(let n of Object.values(e.buckets)){if(wo(n)){t.push(n.anchors);continue}if(bo(n)){t.push(n.anchors,n.priorities),n.lines&&t.push(n.lines),n.lineStarts&&t.push(n.lineStarts);continue}t.push(n.vertices,n.indices),n.featureIds&&t.push(n.featureIds),n.shapeFeatures&&t.push(n.shapeFeatures),n.shapeRanges&&t.push(n.shapeRanges)}return t}var lr=Map;var qe=new lr,en=self;en.onmessage=e=>{let t=e.data;if(t.type==="abort"){qe.get(t.id)?.abort(),qe.delete(t.id);return}let n=new AbortController;qe.set(t.id,n),sr(t,n.signal).then(r=>{qe.has(t.id)&&(qe.delete(t.id),en.postMessage(r,ur(r)))}).catch(r=>{let i=n.signal.aborted;qe.delete(t.id);let o={type:"error",id:t.id,message:r instanceof Error?r.message:String(r),aborted:i};en.postMessage(o)})};})();\n';var Ru=2,$o=class{constructor(e=_n()){this.workers=[];this.blobUrl=null;this.pending=new z;this.queue=new z;this.busy=[];this.nextId=1;this.mainThreadAborts=new z;this.destroyed=false;try{let t=new Blob([xn],{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,this.busy=new Array(this.workers.length).fill(0);}get size(){return this.workers.length}load(e,t,o=0){let r=this.nextId++,n={type:"load",id:r,...e};if(!this.usingWorkers){let a=new AbortController;return this.mainThreadAborts.set(r,a),Al(n,a.signal).then(l=>{this.mainThreadAborts.has(r)&&(this.mainThreadAborts.delete(r),t(l));}).catch(l=>{let s=a.signal.aborted;this.mainThreadAborts.delete(r),t({type:"error",id:r,message:l instanceof Error?l.message:String(l),aborted:s});}),r}return this.queue.set(r,{message:n,resolve:t,priority:o}),this.pump(),r}pump(){for(;;){if(!this.queue.size)return;let e=-1;for(let r=0;r<this.busy.length;r++)this.busy[r]>=Ru||(e<0||this.busy[r]<this.busy[e])&&(e=r);if(e<0)return;let t=-1,o=null;for(let[r,n]of this.queue.entries())o&&n.priority>=o.priority||(t=r,o=n);if(!o)return;this.queue.delete(t),this.busy[e]++,this.pending.set(t,{resolve:o.resolve,workerIndex:e}),this.workers[e].postMessage(o.message);}}abort(e){if(!this.usingWorkers){this.mainThreadAborts.get(e)?.abort(),this.mainThreadAborts.delete(e);return}if(this.queue.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),this.busy[t.workerIndex]--,this.pump();}onMessage(e){if(this.destroyed)return;let t=this.pending.get(e.id);t&&(this.pending.delete(e.id),this.busy[t.workerIndex]--,this.pump(),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.queue.clear(),this.busy=[],this.disposeWorkers();}};function _n(){let i=typeof navigator<"u"&&navigator.hardwareConcurrency||4;return Math.max(1,Math.min(i-1,6))}function Il(i){return Math.max(0,Math.ceil((i*Math.LN2+Math.log(512/360/.5))/Math.LN10))}function Cn(i,e){let t=Il(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 Sn(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 Ll(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 Rl={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}},ao=i=>Rl[i]??Rl.high;function Fl(i){let e=i.toLowerCase();return e?/swiftshader|llvmpipe|software|basic render|microsoft basic|mesa offscreen/.test(e)?"software":/rtx|geforce gtx (9|10|16|20|30|40|50)|radeon rx|radeon pro|arc a\d|apple m\d/.test(e)?"strong":/intel\(r\) hd graphics|hd graphics [2-5]\d{3}|uhd graphics 6\d\d/.test(e)||/mali-t\d|mali-g[35]\d|adreno \(tm\) [3-5]\d\d|powervr/.test(e)?"weak":"unknown":"unknown"}function Zo(i){let{cores:e,memory:t,mobile:o,devicePixelRatio:r,gpu:n}=i;if(n==="software")return "minimal";let a=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";return n==="weak"?En(a)??a:n==="strong"&&!o?zl(a)??a:a}function Qo(){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,gpu:Fu()}}function Fu(){if(typeof document>"u")return "unknown";let i=null;try{let e=document.createElement("canvas");if(e.width=1,e.height=1,i=e.getContext("webgl2")??e.getContext("webgl"),!i)return "software";let t=i.getExtension("WEBGL_debug_renderer_info"),o=t?i.getParameter(t.UNMASKED_RENDERER_WEBGL):i.getParameter(i.RENDERER);return typeof o=="string"?Fl(o):"unknown"}catch{return "unknown"}finally{i?.getExtension("WEBGL_lose_context")?.loseContext();}}function kn(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 qo(i){return i==="high"?3:i==="balanced"?2:i==="low"?1:0}function zl(i){return i==="minimal"?"low":i==="low"?"balanced":i==="balanced"?"high":null}function En(i){return i==="high"?"balanced":i==="balanced"?"low":i==="low"?"minimal":null}var Mn=120,zu=40,Pu=.35,Hu=.02,Ou=150,Bu=30,Wu=1,Vu=1800,Tn=30,Du=1.25,io=class{constructor(e,t,o,r){this.current=e;this.ceiling=t;this.slowMs=o;this.verySlowMs=r;this.ring=new Uint8Array(Mn);this.at=0;this.sum=0;this.filled=0;this.steady=0;this.warmup=0;this.attempts={};this.arrivedByUp=false;this.recent=new Float32Array(Tn);this.recentAt=0;this.recentFilled=0;this.refreshMs=0;}get limit(){return this.ceiling}reset(e,t){this.current=e,this.ceiling=t,this.attempts={},this.arrivedByUp=false,this.restart();}frame(e,t){if(t)return null;if(this.warmup>0)return this.warmup--,null;let o=this.threshold(e),r=e>o*(this.verySlowMs/this.slowMs)?3:e>o?1:0;if(this.sum+=r-this.ring[this.at],this.ring[this.at]=r,this.at=(this.at+1)%Mn,this.filled<Mn&&this.filled++,this.steady++,this.steady===Vu&&(this.attempts[this.current]=0),this.filled<zu)return null;let n=this.sum/this.filled;return n>=Pu?this.down(n):n>Hu?null:this.up(n)}threshold(e){this.recent[this.recentAt]=e,this.recentAt=(this.recentAt+1)%Tn,this.recentFilled<Tn&&this.recentFilled++;let t=this.refreshMs;if(!t){t=1/0;for(let o=0;o<this.recentFilled;o++)t=Math.min(t,this.recent[o]);}return Math.max(this.slowMs,t*Du)}setRefresh(e){e>=1e3/240&&e<=50&&(this.refreshMs=e);}down(e){let t=En(this.current);if(!t)return null;if(this.arrivedByUp){let o=(this.attempts[this.current]??0)+1;this.attempts[this.current]=o,o>=Wu&&qo(t)<qo(this.ceiling)&&(this.ceiling=t);}return this.moveTo(t,false),{to:t,direction:"down",share:e}}up(e){let t=zl(this.current);if(!t||qo(t)>qo(this.ceiling))return null;let o=Ou*2**(this.attempts[t]??0);return this.steady<o?null:(this.moveTo(t,true),{to:t,direction:"up",share:e})}moveTo(e,t){this.current=e,this.arrivedByUp=t,this.restart();}restart(){this.ring.fill(0),this.at=0,this.sum=0,this.filled=0,this.steady=0,this.warmup=Bu;}};var Nu=1,lo=class{constructor(e){this.originX=0;this.originY=0;this._revision=0;this.id=e.id??`obj-${Nu++}`,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=te(l),c=le(s.lng),f=se(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=te(o);t.push(le(r.lng)-this.originX,se(r.lat)-this.originY);}return t}color(e,t){let o=de(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}},In=class extends lo{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=Vt([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=Vt([this.toLocal(this.coordinates.slice(l.from,l.to+1))]);if(!s)continue;let c=de(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=Rn(this.coordinates,this.altitude,t);for(let a=0;a+1<n.length;a++)if(Pl(e,n[a],n[a+1])<=r)return true;return false}},Jo=class extends lo{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=Xr(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(An(a))),n=Vt(r);n&&e.push(this.linePaint({kind:"line",mesh:n,color:this.color("strokeColor","#2f6df6"),width:o}));}return e}hitTest(e,t){let o=Rn(An(this.coordinates[0]??[]),this.altitude,t);if(!Fn(e,o))return false;for(let r=1;r<this.coordinates.length;r++)if(Fn(e,Rn(An(this.coordinates[r]),this.altitude,t)))return false;return true}},Ln=class extends Jo{constructor(e){super({...e,coordinates:[Gu(e.center,e.radius,e.segments)]});}};function Gu(i,e,t){let o=te(i),r=e/Le(o.lat),n=le(o.lng),a=se(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([Te(n+Math.cos(f)*r),Se(a+Math.sin(f)*r)]);}return s}function Rn(i,e,t){let o=[];for(let r of i){let n=te(r),a=t(n.lng,n.lat,e);a&&o.push(a);}return o}function An(i){if(i.length<2)return i;let e=te(i[0]),t=te(i[i.length-1]);return e.lng===t.lng&&e.lat===t.lat?i:[...i,i[0]]}function Pl(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 Fn(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 Hl="objects3d",Et="level",Uu=32,ju=100,Xu=250;function Ol(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 Ku(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 zn=class extends Ue{constructor(t){super();this.options=t;this.transform=new Lt;this.ctx=null;this.sources=new z;this.rasterSources=new z;this.renderer=new Kt;this.objects=new Nt;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.lastFrameAt=0;this.continuousFrames=0;this.onHashChange=null;this.lastMoveEmit=0;this.lastIndoorKey="";this.writingHash=false;this.hashTimer=0;this.layerOverrides=new z;this.autoIndoorLevel=true;this.debugFB=null;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?Zo(Qo()):t.quality;this.governor=new io(r,r,Uu,ju),this.quality=ao(r),this.densityQuality=this.quality,this.maxPixelRatio=t.maxPixelRatio??this.quality.maxPixelRatio,this._style=new pt(t.theme?Ao(t.theme,t.style):t.style),this.background=t.background?de(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=te(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 $o(t.workerCount??Math.min(_n(),this.quality.maxWorkers)),this.initGL(),this.initSource(),this.initInput(),this.initResize(),this.measureRefresh(),queueMicrotask(()=>{this.destroyed||(this.loaded=true,this.emit("load",void 0),this.triggerRepaint());});}measureRefresh(){if(typeof requestAnimationFrame!="function")return;let t=[],o=r=>{if(this.destroyed)return;if(t.push(r),t.length<12){requestAnimationFrame(o);return}let n=1/0;for(let a=1;a<t.length;a++)n=Math.min(n,t[a]-t[a-1]);this.governor.setRefresh(n);};requestAnimationFrame(o);}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 fo(t);let o=new St(this.options.fonts??"/tileserver/fonts/{fontstack}/{range}.pbf",this.options.fontstack);this.options.icons&&o.icons.setIcons({...nt,...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($,{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 Yo({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:Hl,type:"model",sourceLayer:t.sourceLayer??"model3d",minzoom:0,maxzoom:24}}sourceDrawn(t,o){for(let r of this._style.layers)if(r.type!=="raster"&&(r.source??$)===t&&this._style.layerVisibleAt(r,o))return true;return t===this.objects3dSource&&this.objects3dEnabled?o>=(this.options.objects3d?.layout?.minZoom??0):false}planFor(t,o=this._style){let r=o.workerPlan(t),n=t===this.objects3dSource?[...r,this.objects3dPlan()]:r;return this.quality.simpleGeometry?n.map(Ku):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:Hl,"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(Ne(a,c.x,c.y,l));}}else for(let l of t.models)l.setHidden(false);}buildingsForMask(){let t=this.sources.get($);if(!t)return null;for(let o of this._style.layers){if(o.type!=="fill-extrusion"||(o.source??$)!==$)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===Et&&t.add(o.source??$);for(let o of this._style.layers){if(o.type!=="fill-extrusion"||"splitBy"in o&&o.splitBy)continue;let r=o.source??$;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 eo({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 Go(this.pool,{url:o.url,minzoom:o.minzoom??0,maxzoom:o.maxzoom??14,cacheSize:this.quality.tileCacheSize*2,plan:this.planFor(t),rank:t===$?0:1});return r.on("data",()=>this.triggerRepaint()),r.on("error",({message:n})=>this.emit("error",{message:n})),t===$&&r.on("idle",()=>this.emit("idle",void 0)),this.sources.set(t,r),this.triggerRepaint(),this}initInput(){this.gestures=new wo(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=kn(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=te(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=te(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?te(t.center):r.center,zoom:t.zoom??r.zoom,bearing:n.bearing+lt((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?te(t.center):o.center,zoom:t.zoom??o.zoom,bearing:r.bearing+lt((t.bearing??o.bearing)-r.bearing),pitch:t.pitch??o.pitch},l=je(r.zoom),s=(le(a.center.lng)-le(r.center.lng))*l,c=(se(a.center.lat)-se(r.center.lat))*l,f=Math.hypot(s,c),u=Math.max(o.width,o.height),d=u*Math.pow(2,r.zoom-a.zoom),h=1.42,m=h*h,y,p=null;if(f<1e-6){let g=Math.log(d/u);y=Math.abs(g)/h,p=v=>({u:0,w:u*Math.exp(h*Math.sign(g)*v)});}else {let g=C=>{let S=C===0?u:d,T=C===0?d:u;return (T*T-S*S+(C===0?1:-1)*m*m*f*f)/(2*S*m*f)},v=C=>Math.log(-g(C)+Math.sqrt(g(C)*g(C)+1)),w=v(0);y=(v(1)-w)/h;let _=C=>(Math.exp(C)+Math.exp(-C))/2,M=C=>(Math.exp(2*C)-1)/(Math.exp(2*C)+1);p=C=>{let S=h*C+w;return {u:u*_(w)*M(S)/m-u*Math.sinh(w)/m,w:u*_(w)/_(S)}};}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:u}},this.triggerRepaint(),this}setPadding(t){return this.padding=Ol(t),this.renderer.symbols&&(this.renderer.symbols.padding=this.padding),this.triggerRepaint(),this}getPadding(){return {...this.padding}}getBounds(){let t=this.transform,o=new At;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=tr(t,{width:r.width,height:r.height,bearing:o.bearing??r.bearing,padding:o.padding!==void 0?Ol(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=xe((t-o.start)/o.duration,0,1),n=o.fly?r:co(r),a=this.transform,l=te(o.from.center),s=te(o.to.center);if(o.fly){let{u:c,w:f}=o.fly.curve(o.fly.S*r),u=o.fly.u1>1e-6?xe(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)*co(r),a.pitch=o.from.pitch+(o.to.pitch-o.from.pitch)*co(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(te(t),o)}unproject(t){return this.transform.unproject(t)}get style(){return this._style}setStyle(t){let o=this._style,r=new pt(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(Ao(t,this.options.style))}static get themes(){return Object.keys(Be)}static get themeList(){return Object.entries(Be).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)}setDebugTiles(t){return this.renderer.debugTiles=t,this.triggerRepaint(),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:Te(r.mercX),lat:Se(r.mercY)},key:St.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??$);if(!n)continue;let a=Nr(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 z,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??$)));}if(!n||!o.length)return null;let a=Gr(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,Ll("#"+o),setTimeout(()=>this.writingHash=false,0);}applyHash(t){if(typeof window>"u")return;let o=Sn(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"?Zo(Qo()):t;return this.governor.reset(o,o),this.applyQuality(ao(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.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();}checkFrameBudget(t){if(!this.qualityAuto)return;let o=this.governor.frame(t,this.sum(n=>n.pendingCount)>0);if(!o)return;let r=`${(o.share*100).toFixed(0)}%`;console.info(o.direction==="down"?`[osmgl] \u0442\u044F\u0436\u0451\u043B\u044B\u0445 \u043A\u0430\u0434\u0440\u043E\u0432 ${r} \u2014 \u043A\u0430\u0447\u0435\u0441\u0442\u0432\u043E \u043F\u043E\u043D\u0438\u0436\u0435\u043D\u043E \u0434\u043E \xAB${o.to}\xBB (\u043F\u043B\u043E\u0442\u043D\u043E\u0441\u0442\u044C \u0431\u0443\u0444\u0435\u0440\u0430 \u043F\u0440\u0435\u0436\u043D\u044F\u044F, \u043F\u043E\u0442\u043E\u043B\u043E\u043A \xAB${this.governor.limit}\xBB)`:`[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${o.to}\xBB`),this.applyQuality(ao(o.to),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=de(t),this.triggerRepaint(),this}getIndoorLevels(){let t=[];for(let[o,r]of this.sources.entries())if(this._style.layers.some(n=>(n.source??$)===o&&"splitBy"in n&&n.splitBy===Et))for(let n of r.splitValues(Et)){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[Et];return typeof t=="number"?t:null}setIndoorLevel(t){return t===null?delete this._style.splitValues[Et]:this._style.splitValues[Et]=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 no)}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,It):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);})));}debugFloatPixels(t,o,r,n){let a=this.ctx;if(!a||!a.caps.colorBufferFloat)return null;let l=a.gl,s=this.canvas.width,c=this.canvas.height,f=!!l.getExtension("EXT_float_blend"),u=f?l.RGBA32F:l.RGBA16F,d=f?l.FLOAT:l.HALF_FLOAT;if(this.debugFB&&(this.debugFB.w!==s||this.debugFB.h!==c)&&(l.deleteFramebuffer(this.debugFB.fb),l.deleteTexture(this.debugFB.tex),l.deleteRenderbuffer(this.debugFB.rb),this.debugFB=null),!this.debugFB){let h=l.createTexture(),m=l.createFramebuffer(),y=l.createRenderbuffer();if(!h||!m||!y)return null;l.bindTexture(l.TEXTURE_2D,h),l.texImage2D(l.TEXTURE_2D,0,u,s,c,0,l.RGBA,d,null),l.texParameteri(l.TEXTURE_2D,l.TEXTURE_MIN_FILTER,l.NEAREST),l.texParameteri(l.TEXTURE_2D,l.TEXTURE_MAG_FILTER,l.NEAREST),l.bindTexture(l.TEXTURE_2D,null),l.bindRenderbuffer(l.RENDERBUFFER,y),l.renderbufferStorage(l.RENDERBUFFER,l.DEPTH24_STENCIL8,s,c),l.bindRenderbuffer(l.RENDERBUFFER,null),l.bindFramebuffer(l.FRAMEBUFFER,m),l.framebufferTexture2D(l.FRAMEBUFFER,l.COLOR_ATTACHMENT0,l.TEXTURE_2D,h,0),l.framebufferRenderbuffer(l.FRAMEBUFFER,l.DEPTH_STENCIL_ATTACHMENT,l.RENDERBUFFER,y);let p=l.checkFramebufferStatus(l.FRAMEBUFFER);if(l.bindFramebuffer(l.FRAMEBUFFER,null),a.invalidateState(),p!==l.FRAMEBUFFER_COMPLETE)return null;this.debugFB={fb:m,tex:h,rb:y,w:s,h:c};}a.screen=this.debugFB.fb;try{this.renderFrame(performance.now()),a.bindFramebuffer(this.debugFB.fb);let h=new Float32Array(r*n*4);return l.readPixels(t,o,r,n,l.RGBA,l.FLOAT,h),{data:h,format:f?"rgba32f":"rgba16f"}}finally{a.screen=null,this.triggerRepaint();}}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[h,m]of this.sources)this.sourceDrawn(h,this.transform.zoom)?m.update(this.transform):m.deactivate();this.updateObjects3D();for(let[h,m]of this.rasterSources)this.rasterLayerVisible(h)&&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<Xu,u=f?c:0;this.continuousFrames=f?this.continuousFrames+1:0;let d=this.continuousFrames>1?c:l;this.lastFrameAt=t,this.checkFrameBudget(d),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();}}},N1=zn;
2337
+ exports.AssetLoader=to;exports.BASE_SOURCE=$;exports.BUILDING_HEIGHT_SCALE=ut;exports.BUILDING_POS_SCALE=ft;exports.BUILDING_VERTEX_STRIDE=ke;exports.CITY_STYLE=Pc;exports.Circle=Ln;exports.DEFAULT_ICONS=nt;exports.DEFAULT_LIGHT=Ar;exports.DEFAULT_SHADOWS=ll;exports.DEFAULT_SKY=Er;exports.DEFAULT_STYLE=Ir;exports.DepthTarget=Ht;exports.EARTH_CIRCUMFERENCE=uo;exports.FILL_VERTEX_STRIDE=Xe;exports.GLOBE_MAX_PITCH=It;exports.GLOBE_ZOOM_MAX=et;exports.GLOBE_ZOOM_MIN=bo;exports.GLYPH_BORDER=ve;exports.GLYPH_SIZE=Ge;exports.GROUND_SCALE=Zs;exports.GeomType=Ft;exports.GlyphSource=$t;exports.GroundArrows=Bt;exports.IconSource=Zt;exports.IndoorMask=Wt;exports.LEVEL_LIMIT=Js;exports.LINE_VERTEX_STRIDE=Ke;exports.LayerRenderer=Kt;exports.LngLatBounds=At;exports.MAX_LATITUDE=Hn;exports.MODEL_VERTEX_STRIDE=Ho;exports.Map=zn;exports.MapObject=lo;exports.Marker=ro;exports.Model=oo;exports.ModelLayer=$e;exports.ObjectManager=Nt;exports.Polygon=Jo;exports.Polyline=In;exports.Popup=no;exports.QualityGovernor=io;exports.RELIEF_STYLE=zc;exports.RUNTIME_FILL_STRIDE=jr;exports.RUNTIME_LINE_STRIDE=yt;exports.RasterSource=eo;exports.RasterTile=Uo;exports.SDF_EDGE=on;exports.SDF_PX=qt;exports.SOFT_STYLE=Fc;exports.SPLIT_SEP=ha;exports.SURFACE_CUT_BLEED=zt;exports.SURFACE_LEVEL_SCALE=Ii;exports.SURFACE_VERTEX_STRIDE=dt;exports.SdfAtlas=Yt;exports.Style=pt;exports.SymbolRenderer=St;exports.THEMES=Be;exports.TILE_SIZE=Je;exports.TileID=Tt;exports.Transform=Lt;exports.VectorTile=Rt;exports.VectorTileFeature=xo;exports.VectorTileLayer=_o;exports.abbreviateStreet=yn;exports.addGround=Sr;exports.altitudeFromMercatorZ=ed;exports.applyTheme=Eo;exports.arrowLabelOffset=wl;exports.arrowVertices=Yc;exports.buildRuntimeFill=Xr;exports.buildRuntimeLine=Vt;exports.cameraForBounds=tr;exports.circumferenceAtLatitude=Le;exports.clampLat=ho;exports.clampPixelRatio=kn;exports.classifyRenderer=Fl;exports.clipLineToRect=an;exports.coordinateDigits=Il;exports.coveringTiles=Jt;exports.createGround=Cr;exports.default=N1;exports.deviceHints=Qo;exports.distToSegment=Pl;exports.evaluateColor=Ae;exports.evaluateNumber=D;exports.extractFeature=Fo;exports.featureLevel=rt;exports.fillFootprint=Or;exports.fogPlanes=bt;exports.footprintOf=Br;exports.formatHash=Cn;exports.generateBuildings=dr;exports.generateFill=pr;exports.generateLine=Tr;exports.generateSurface=_r;exports.generateSymbols=vn;exports.globeBasis=ar;exports.globeFlatMix=go;exports.globeRadius=yo;exports.globeToLocal=Un;exports.groundAt=Mo;exports.iconRotation=xl;exports.insideFootprint=Ne;exports.latFromMercatorY=Se;exports.lngFromMercatorX=Te;exports.lngLatToUnit=vo;exports.matchesFilter=ye;exports.mercatorMetersPerTile=mo;exports.mercatorX=le;exports.mercatorY=se;exports.mercatorZFromAltitude=er;exports.metersPerPixel=od;exports.metersPerTile=On;exports.nextQualityDown=En;exports.parseGlb=pf;exports.parseGlbAsync=$r;exports.parseGlyphs=cl;exports.parseHash=Sn;exports.patchUV=Ya;exports.pickBuilding=Nr;exports.pickFill=Gr;exports.pitchIntent=Zn;exports.pixelsPerMeter=td;exports.placeAlongLine=sn;exports.pointInRing=Fn;exports.qualityFor=Zo;exports.qualityProfile=ao;exports.raySphere=lr;exports.resolveTemplate=gn;exports.roundRing=He;exports.sdfFromAlpha=rn;exports.shapeText=nn;exports.splitBucketKey=Oe;exports.splitByGround=Mr;exports.splitPolygons=tt;exports.stitchPieces=kr;exports.styleWithTheme=Ao;exports.tileOriginMeters=Bn;exports.tileUrl=_l;exports.toLngLat=te;exports.unitToLngLat=ir;exports.worldSize=je;//# sourceMappingURL=osmgl.cjs.map
2326
2338
  //# sourceMappingURL=osmgl.cjs.map