osmgl 0.4.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -3
- package/dist/osmgl.cjs +393 -99
- package/dist/osmgl.cjs.map +1 -1
- package/dist/osmgl.d.cts +97 -11
- package/dist/osmgl.d.ts +97 -11
- package/dist/osmgl.global.js +394 -100
- package/dist/osmgl.js +393 -99
- package/dist/osmgl.js.map +1 -1
- package/package.json +1 -1
package/dist/osmgl.global.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
var OsmGL=(function(exports){'use strict';var ql=Object.defineProperty;var Oo=(n,e)=>()=>(n&&(e=n(n=0)),e);var $l=(n,e)=>{for(var t in e)ql(n,t,{get:e[t],enumerable:true});};var mh,sl=Oo(()=>{mh=(function(){var n="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FHRAOCUFHOXBKKAVC+QDF8kJJJJBK/uLEVUCUAICDTGVAICffffI0eGOCBYD1+KJJBhJJJJBBHRALALYD9gGWCDTFARbDBALAWCEFbD9gABARbDBAOCBYD1+KJJBhJJJJBBHRALALYD9gGOCDTFARbDBALAOCEFbD9gABARbDLCUADCDTADCffffI0eCBYD1+KJJBhJJJJBBHRALALYD9gGOCDTFARbDBALAOCEFbD9gABARbDWABYDBCBAVZ+TJJJB8aADCI9uHWDNADtMBABYDBHOAEHLADHRINAOALYDBCDTFGVAVYDBCEFbDBALCLFHLARCUFGRMBKKDNAItMBABYDBHLABYDLHRCBHVAIHOINARAVbDBARCLFHRALYDBAVFHVALCLFHLAOCUFGOMBKKDNADCI6MBAWCEAWCE0eHdABYDLHRABYDWHVCBHLINAECWFYDBHOAECLFYDBHDARAEYDBCDTFGWAWYDBGWCEFbDBAVAWCDTFALbDBARADCDTFGDADYDBGDCEFbDBAVADCDTFALbDBARAOCDTFGOAOYDBGOCEFbDBAVAOCDTFALbDBAECXFHEAdALCEFGL9HMBKKDNAItMBABYDLHEABYDBHLINAEAEYDBALYDB9rbDBALCLFHLAECLFHEAICUFGIMBKKKqBABAEADAIC+01JJBZ+MJJJBKqBABAEADAIC+c+JJJBZ+MJJJBK9dEEUABCfEAICDTZ+TJJJBHLCBHIDNADtMBINDNALAEYDBCDTFGBYDBCU9HMBABAIbDBAICEFHIKAECLFHEADCUFGDMBKKAIK9TEIUCBCBYD+M+KJJBGEABCIFC98gFGBbD+M+KJJBDNDNABzBCZTGD9NMBCUHIABAD9rCffIFCZ4NBCUsMEKAEHIKAIK/lEEEUDNDNAEABvCIgtMBABHIXEKDNDNADCZ9PMBABHIXEKABHIINAIAEYDBbDBAICLFAECLFYDBbDBAICWFAECWFYDBbDBAICXFAECXFYDBbDBAICZFHIAECZFHEADC9wFGDCS0MBKKADCL6MBINAIAEYDBbDBAECLFHEAICLFHIADC98FGDCI0MBKKDNADtMBINAIAErBB86BBAICEFHIAECEFHEADCUFGDMBKKABK/AEEDUDNDNABCIgtMBABHIXEKAECfEgC+B+C+EW2HLDNDNADCZ9PMBABHIXEKABHIINAIALbDBAICXFALbDBAICWFALbDBAICLFALbDBAICZFHIADC9wFGDCS0MBKKADCL6MBINAIALbDBAICLFHIADC98FGDCI0MBKKDNADtMBINAIAE86BBAICEFHIADCUFGDMBKKABK9TEIUCBCBYD+M+KJJBGEABCIFC98gFGBbD+M+KJJBDNDNABzBCZTGD9NMBCUHIABAD9rCffIFCZ4NBCUsMEKAEHIKAIK9+EIUzBHEDNDNCBYD+M+KJJBGDAECZTGI9NMBCUHEADAI9rCffIFCZ4NBCUsMEKADHEKCBABAE9rCIFC98gCBYD+M+KJJBFGDbD+M+KJJBDNADzBCZTGE9NMBADAE9rCffIFCZ4NB8aKKXBABAEZ+YJJJBK+BEEIUDNAB+8GDCl4GICfEgGLCfEsMBDNALMBDNABjBBBB9cMBAECBbDBABSKABjBBJ9fnAEZ+XJJJBHBAEAEYDBCNFbDBABSKAEAICfEgC+CUFbDBADCfff+D94gCJJJ/4Iv++HBKABK+gEBDNDNAECJE9IMBABjBBBUnHBDNAECfE9PMBAEC+BUFHEXDKABjBBBUnHBAECPDAECPD6eC+C9+FHEXEKAEC+BU9KMBABjBBJXnHBDNAEC+b9+9NMBAEC/mBFHEXEKABjBBJXnHBAEC+299AEC+2990eC/MEFHEKABAEClTCJJJ/8IF++nKK+eDDBCJWK+EDB4+H9W9n94+p+Gw+J9o+YE9pBBBBBBEBBBDBBBEBBBDBBBBBBBDBBBBBBBEBBBBBBB+L29Hz/69+9Kz/n/76z/RG97z/Z/O9Xz8j/b85z/+/U9Yz/B/K9hz+2/z9dz9E+L9Mz59a8kz+R/t3z+a+Zyz79ohz/J4++8++y+d9v8+BBBB9S+49+z8r+Hbz9m9m/m8+l/Z/O8+/8+pg89Q/X+j878r+Hq8++m+b/E87BBBBBBJzBBJzBBJz+e/v/n8++y+dSz9I/h/68+XD/r8+/H0838+/w+nOzBBBB+wv9o8+UF888+9I/h/68+9C9g/l89/N/M9M89/d8kO8+BBBBF+8Tz9M836zs+2azl/Zpzz818ez9E+LXz/u98f8+819e/68+BC+EQKXEBBBDBBBAwBB",e=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!="object")return {supported:false};var t,o=WebAssembly.instantiate(r(n),{}).then(function(f){t=f.instance,t.exports.__wasm_call_ctors(),t.exports.meshopt_encodeVertexVersion(0),t.exports.meshopt_encodeIndexVersion(1);});function r(f){for(var d=new Uint8Array(f.length),p=0;p<f.length;++p){var m=f.charCodeAt(p);d[p]=m>96?m-71:m>64?m-65:m>47?m+4:m>46?63:62;}for(var y=0,p=0;p<f.length;++p)d[y++]=d[p]<60?e[d[p]]:(d[p]-60)*64+d[++p];return d.buffer.slice(0,y)}function i(f){if(!f)throw new Error("Assertion failed")}function a(f){return new Uint8Array(f.buffer,f.byteOffset,f.byteLength)}function s(f,d,p){var m=t.exports.sbrk,y=m(f.length*4),b=m(d*4),g=new Uint8Array(t.exports.memory.buffer),A=a(f);g.set(A,y),p&&p(y,y,f.length,d);var B=t.exports.meshopt_optimizeVertexFetchRemap(b,y,f.length,d);g=new Uint8Array(t.exports.memory.buffer);var x=new Uint32Array(d);new Uint8Array(x.buffer).set(g.subarray(b,b+d*4)),A.set(g.subarray(y,y+f.length*4)),m(y-m(0));for(var w=0;w<f.length;++w)f[w]=x[f[w]];return [x,B]}function l(f,d,p,m,y){var b=t.exports.sbrk,g=b(d),A=b(m*y),B=new Uint8Array(t.exports.memory.buffer);B.set(a(p),A);var x=f(g,d,A,m,y),w=new Uint8Array(x);return w.set(B.subarray(g,g+x)),b(g-b(0)),w}function c(f){for(var d=0,p=0;p<f.length;++p){var m=f[p];d=d<m?m:d;}return d}function u(f,d){if(i(d==2||d==4),d==4)return new Uint32Array(f.buffer,f.byteOffset,f.byteLength/4);var p=new Uint16Array(f.buffer,f.byteOffset,f.byteLength/2);return new Uint32Array(p)}function h(f,d,p,m,y,b){var g=t.exports.sbrk,A=g(p*m),B=g(p*b),x=new Uint8Array(t.exports.memory.buffer);x.set(a(d),B),f(A,p,m,y,B);var w=new Uint8Array(p*m);return w.set(x.subarray(A,A+p*m)),g(A-g(0)),w}return {ready:o,supported:true,reorderMesh:function(f,d,p){var m=d?p?t.exports.meshopt_optimizeVertexCacheStrip:t.exports.meshopt_optimizeVertexCache:void 0;return s(f,c(f)+1,m)},encodeVertexBuffer:function(f,d,p){i(p>0&&p<=256),i(p%4==0);var m=t.exports.meshopt_encodeVertexBufferBound(d,p);return l(t.exports.meshopt_encodeVertexBuffer,m,f,d,p)},encodeIndexBuffer:function(f,d,p){i(p==2||p==4),i(d%3==0);var m=u(f,p),y=t.exports.meshopt_encodeIndexBufferBound(d,c(m)+1);return l(t.exports.meshopt_encodeIndexBuffer,y,m,d,4)},encodeIndexSequence:function(f,d,p){i(p==2||p==4);var m=u(f,p),y=t.exports.meshopt_encodeIndexSequenceBound(d,c(m)+1);return l(t.exports.meshopt_encodeIndexSequence,y,m,d,4)},encodeGltfBuffer:function(f,d,p,m){var y={ATTRIBUTES:this.encodeVertexBuffer,TRIANGLES:this.encodeIndexBuffer,INDICES:this.encodeIndexSequence};return i(y[m]),y[m](f,d,p)},encodeFilterOct:function(f,d,p,m){return i(p==4||p==8),i(m>=1&&m<=16),h(t.exports.meshopt_encodeFilterOct,f,d,p,m,16)},encodeFilterQuat:function(f,d,p,m){return i(p==8),i(m>=4&&m<=16),h(t.exports.meshopt_encodeFilterQuat,f,d,p,m,16)},encodeFilterExp:function(f,d,p,m){return i(p>0&&p%4==0),i(m>=1&&m<=24),h(t.exports.meshopt_encodeFilterExp,f,d,p,m,p)}}})();});var bh,ll=Oo(()=>{bh=(function(){var n="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",e="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",t=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]),o=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!="object")return {supported:false};var r=n;WebAssembly.validate(t)&&(r=e);var i,a=WebAssembly.instantiate(s(r),{}).then(function(h){i=h.instance,i.exports.__wasm_call_ctors();});function s(h){for(var f=new Uint8Array(h.length),d=0;d<h.length;++d){var p=h.charCodeAt(d);f[d]=p>96?p-71:p>64?p-65:p>47?p+4:p>46?63:62;}for(var m=0,d=0;d<h.length;++d)f[m++]=f[d]<60?o[f[d]]:(f[d]-60)*64+f[++d];return f.buffer.slice(0,m)}function l(h,f,d,p,m,y){var b=i.exports.sbrk,g=d+3&-4,A=b(g*p),B=b(m.length),x=new Uint8Array(i.exports.memory.buffer);x.set(m,B);var w=h(A,d,p,B,m.length);if(w==0&&y&&y(A,g,p),f.set(x.subarray(A,A+d*p)),b(A-b(0)),w!=0)throw new Error("Malformed buffer data: "+w)}var c={0:"",1:"meshopt_decodeFilterOct",2:"meshopt_decodeFilterQuat",3:"meshopt_decodeFilterExp",NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},u={0:"meshopt_decodeVertexBuffer",1:"meshopt_decodeIndexBuffer",2:"meshopt_decodeIndexSequence",ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"};return {ready:a,supported:true,decodeVertexBuffer:function(h,f,d,p,m){l(i.exports.meshopt_decodeVertexBuffer,h,f,d,p,i.exports[c[m]]);},decodeIndexBuffer:function(h,f,d,p){l(i.exports.meshopt_decodeIndexBuffer,h,f,d,p);},decodeIndexSequence:function(h,f,d,p){l(i.exports.meshopt_decodeIndexSequence,h,f,d,p);},decodeGltfBuffer:function(h,f,d,p,m,y){l(i.exports[u[m]],h,f,d,p,i.exports[c[y]]);}}})();});var yh,cl=Oo(()=>{yh=(function(){var n="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iDZGK+TjBBBB+XGQALiDLALiDcGX+TGMAMAQ9deGQALiDWALiDkGM+TGpApAQ9deHpDNABtMBADtMBjBBBBjBBJzAp+VApjBBBB9beHQINABAQABiDBAK+TnuDBABCLFGIAQAIiDBAX+TnuDBABCWFGIAQAIiDBAM+TnuDBABCXFHBADCUFGDMBKKApK+qDIDUI99DUCBHI8jJJJJBCA9rGLCZFCWFCBYD11JJBbDBALCB8pDJ1JJB83IZALCWFCBYDn1JJBbDBALCB8pD+M1JJB83IBDNDNAEMBjBBJfHVjBBJfHOjBBJfHRXEKADCD4CDTHWINCBHDINALCZFADFGdABADFiDBGOAdiDBGRARAO9eeuDBALADFGdAOAdiDBGRARAO9deuDBADCLFGDCX9HMBKABAWFHBAICEFGIAE9HMBKALiDWALiDk+THRALiDLALiDc+THOALiDBALiDZ+THVKAVjBBBB+XGVAOAOAV9deGOARARAO9deK9dEEUABCfEAICDTZ1JJJBHLCBHIDNADtMBINDNALAEYDBCDTFGBYDBCU9HMBABAIbDBAICEFHIKAECLFHEADCUFGDMBKKAIK9TEIUCBCBYD/01JJBGEABCIFC98gFGBbD/01JJBDNDNABzBCZTGD9NMBCUHIABAD9rCffIFCZ4NBCUsMEKAEHIKAIK/lEEEUDNDNAEABvCIgtMBABHIXEKDNDNADCZ9PMBABHIXEKABHIINAIAEYDBbDBAICLFAECLFYDBbDBAICWFAECWFYDBbDBAICXFAECXFYDBbDBAICZFHIAECZFHEADC9wFGDCS0MBKKADCL6MBINAIAEYDBbDBAECLFHEAICLFHIADC98FGDCI0MBKKDNADtMBINAIAErBB86BBAICEFHIAECEFHEADCUFGDMBKKABK/AEEDUDNDNABCIgtMBABHIXEKAECfEgC+B+C+EW2HLDNDNADCZ9PMBABHIXEKABHIINAIALbDBAICXFALbDBAICWFALbDBAICLFALbDBAICZFHIADC9wFGDCS0MBKKADCL6MBINAIALbDBAICLFHIADC98FGDCI0MBKKDNADtMBINAIAE86BBAICEFHIADCUFGDMBKKABK9TEIUCBCBYD/01JJBGEABCIFC98gFGBbD/01JJBDNDNABzBCZTGD9NMBCUHIABAD9rCffIFCZ4NBCUsMEKAEHIKAIK9+EIUzBHEDNDNCBYD/01JJBGDAECZTGI9NMBCUHEADAI9rCffIFCZ4NBCUsMEKADHEKCBABAE9rCIFC98gCBYD/01JJBFGDbD/01JJBDNADzBCZTGE9NMBADAE9rCffIFCZ4NB8aKK6EIUCBHIDNADtMBDNINABrBBGLAErBBGV9HMEAECEFHEABCEFHBADCUFGDMBXDKKALAV9rHIKAIKK+CEDBCJWK9pffUUffUUffUUffUfffUfffUfBBBBBBBBEEEBEEBEBBEEEBEBBBBBEBEBBBBBEBBBDBBBBBBBBBBBBBBBEEEEEBEBBBBBEBBBBBEEBBBBBBC/sWKXEBBBDBBBJ9kBB",e=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!="object")return {supported:false};var t,o=WebAssembly.instantiate(r(n),{}).then(function(f){t=f.instance,t.exports.__wasm_call_ctors();});function r(f){for(var d=new Uint8Array(f.length),p=0;p<f.length;++p){var m=f.charCodeAt(p);d[p]=m>96?m-71:m>64?m-65:m>47?m+4:m>46?63:62;}for(var y=0,p=0;p<f.length;++p)d[y++]=d[p]<60?e[d[p]]:(d[p]-60)*64+d[++p];return d.buffer.slice(0,y)}function i(f){if(!f)throw new Error("Assertion failed")}function a(f){return new Uint8Array(f.buffer,f.byteOffset,f.byteLength)}function s(f,d){var p=t.exports.sbrk,m=p(f.length*4),y=p(d*4),b=new Uint8Array(t.exports.memory.buffer),g=a(f);b.set(g,m);var A=t.exports.meshopt_optimizeVertexFetchRemap(y,m,f.length,d);b=new Uint8Array(t.exports.memory.buffer);var B=new Uint32Array(d);new Uint8Array(B.buffer).set(b.subarray(y,y+d*4)),g.set(b.subarray(m,m+f.length*4)),p(m-p(0));for(var x=0;x<f.length;++x)f[x]=B[f[x]];return [B,A]}function l(f){for(var d=0,p=0;p<f.length;++p){var m=f[p];d=d<m?m:d;}return d}function c(f,d,p,m,y,b,g,A,B){var x=t.exports.sbrk,w=x(4),_=x(p*4),C=x(y*b),v=x(p*4),E=new Uint8Array(t.exports.memory.buffer);E.set(a(m),C),E.set(a(d),v);var D=f(_,v,p,C,y,b,g,A,B,w);E=new Uint8Array(t.exports.memory.buffer);var M=new Uint32Array(D);a(M).set(E.subarray(_,_+D*4));var H=new Float32Array(1);return a(H).set(E.subarray(w,w+4)),x(w-x(0)),[M,H[0]]}function u(f,d,p,m){var y=t.exports.sbrk,b=y(p*m),g=new Uint8Array(t.exports.memory.buffer);g.set(a(d),b);var A=f(b,p,m);return y(b-y(0)),A}var h={LockBorder:1};return {ready:o,supported:true,compactMesh:function(f){i(f instanceof Uint32Array||f instanceof Int32Array||f instanceof Uint16Array||f instanceof Int16Array),i(f.length%3==0);var d=f.BYTES_PER_ELEMENT==4?f:new Uint32Array(f);return s(d,l(f)+1)},simplify:function(f,d,p,m,y,b){i(f instanceof Uint32Array||f instanceof Int32Array||f instanceof Uint16Array||f instanceof Int16Array),i(f.length%3==0),i(d instanceof Float32Array),i(d.length%p==0),i(p>=3),i(m%3==0);for(var g=0,A=0;A<(b?b.length:0);++A)g|=h[b[A]];var B=f.BYTES_PER_ELEMENT==4?f:new Uint32Array(f),x=c(t.exports.meshopt_simplify,B,f.length,d,d.length,p*4,m,y,g);return x[0]=f instanceof Uint32Array?x[0]:new f.constructor(x[0]),x},getScale:function(f,d){return i(f instanceof Float32Array),i(f.length%d==0),u(t.exports.meshopt_simplifyScale,f,f.length,d*4)}}})();});var fl={};$l(fl,{MeshoptDecoder:()=>bh,MeshoptEncoder:()=>mh,MeshoptSimplifier:()=>yh});var ul=Oo(()=>{sl();ll();cl();});var W=Map,oe=Set;var Qe=class{constructor(){this.listeners=new W;}on(e,t){let o=this.listeners.get(e);return o||this.listeners.set(e,o=new oe),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(i){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:`,i);}return this}removeAllListeners(){this.listeners.clear();}};var _e=(n,e,t)=>n<e?e:n>t?t:n;var st=n=>n*Math.PI/180,Pi=n=>n*180/Math.PI;function Bt(n){let e=((n+180)%360+360)%360-180;return e===-180?180:e}var Wo=n=>1-Math.pow(1-n,3);function ye(n){let e=n.trim();if(e[0]==="#"){let o=e.slice(1);if(o.length===3||o.length===4){let r=o.split("").map(i=>parseInt(i+i,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 i=0;i<o.length;i+=2)r.push(parseInt(o.slice(i,i+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 Fe(n){return [n[0]*n[3],n[1]*n[3],n[2]*n[3],n[3]]}var Vo=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 W;this._stencilTest=false;this.screen=null;this.gl=e,this.caps=ec(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 i=this._viewport;i[0]===e&&i[1]===t&&i[2]===o&&i[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,i=0;e&&(r.clearColor(e[0],e[1],e[2],e[3]),i|=r.COLOR_BUFFER_BIT),t&&(this.setDepthMask(true),r.clearDepth(1),i|=r.DEPTH_BUFFER_BIT),o&&(r.clearStencil(0),i|=r.STENCIL_BUFFER_BIT),i&&r.clear(i);}invalidateState(){this._program=null,this._vao=null,this._framebuffer=null,this._activeTexture=-1,this._boundTextures.clear(),this._viewport=[-1,-1,-1,-1];}};function ec(n){let e=n.getExtension("EXT_texture_filter_anisotropic")??n.getExtension("WEBKIT_EXT_texture_filter_anisotropic"),t=n.getExtension("WEBGL_debug_renderer_info");return {maxTextureSize:n.getParameter(n.MAX_TEXTURE_SIZE),maxVertexAttribs:n.getParameter(n.MAX_VERTEX_ATTRIBS),colorBufferFloat:!!n.getExtension("EXT_color_buffer_float"),anisotropic:e,maxAnisotropy:e?n.getParameter(e.MAX_TEXTURE_MAX_ANISOTROPY_EXT):1,timerQuery:!!n.getExtension("EXT_disjoint_timer_query_webgl2"),rendererName:t?String(n.getParameter(t.UNMASKED_RENDERER_WEBGL)):"unknown"}}var lt=512,zo=40075016686e-3,Ri=85.051129;function $(n){return Array.isArray(n)?{lng:n[0],lat:n[1]}:n}var qe=n=>512*Math.pow(2,n),No=n=>Math.max(-Ri,Math.min(Ri,n));function ie(n){return (180+n)/360}function ae(n){let e=No(n);return (180-180/Math.PI*Math.log(Math.tan(Math.PI/4+e*Math.PI/360)))/360}function Se(n){return n*360-180}function Me(n){let e=180-n*360;return 360/Math.PI*Math.atan(Math.exp(e*Math.PI/180))-90}function Ge(n){return zo*Math.cos(n*Math.PI/180)}function Gr(n,e){return n/Ge(e)}function ep(n,e){return n*Ge(e)}function tp(n,e){return Gr(1,n)*qe(e)}function op(n,e){return Ge(n)/qe(e)}function Gi(n,e){let t=Math.pow(2,n);return Ge(Me((e+.5)/t))/t}function Or(n){return zo/Math.pow(2,n)}function Oi(n,e,t){let o=Or(n),r=65536;return [(e*o%r+r)%r,(t*o%r+r)%r]}var Jt=class n{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 n;for(let o of e)t.extend(o);return t}extend(e){if(e instanceof n)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=$(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=$(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:ie(this.west),maxX:ie(this.east),minY:ae(this.north),maxY:ae(this.south)}}};function Wr(n,e){if(n.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,Wi),r=Math.max(e.height-t.top-t.bottom,Wi),i=n.toMercator(),a=e.bearing??0,s=-a*Math.PI/180,l=Math.cos(s),c=Math.sin(s),u=(i.minX+i.maxX)/2,h=(i.minY+i.maxY)/2,f=0,d=0;for(let[A,B]of [[i.minX,i.minY],[i.maxX,i.minY],[i.maxX,i.maxY],[i.minX,i.maxY]]){let x=(A-u)*l-(B-h)*c,w=(A-u)*c+(B-h)*l;f=Math.max(f,Math.abs(x)*2),d=Math.max(d,Math.abs(w)*2);}let p=Math.min(o/Math.max(f,1e-12),r/Math.max(d,1e-12)),m=Math.min(Math.max(Math.log2(p/512),e.minZoom??0),e.maxZoom??22),y=qe(m),b=(t.left-t.right)/2/y,g=(t.top-t.bottom)/2/y;return {center:{lng:Se(u-(b*l+g*c)),lat:Me(h-(-b*c+g*l))},zoom:m,bearing:a}}var Wi=32;function K(){let n=new Float64Array(16);return n[0]=n[5]=n[10]=n[15]=1,n}function Ue(n){return n.fill(0),n[0]=n[5]=n[10]=n[15]=1,n}function Ee(n,e,t){let o=e[0],r=e[1],i=e[2],a=e[3],s=e[4],l=e[5],c=e[6],u=e[7],h=e[8],f=e[9],d=e[10],p=e[11],m=e[12],y=e[13],b=e[14],g=e[15];for(let A=0;A<4;A++){let B=t[A*4],x=t[A*4+1],w=t[A*4+2],_=t[A*4+3];n[A*4]=B*o+x*s+w*h+_*m,n[A*4+1]=B*r+x*l+w*f+_*y,n[A*4+2]=B*i+x*c+w*d+_*b,n[A*4+3]=B*a+x*u+w*p+_*g;}return n}function We(n,e,t,o,r){return n!==e&&n.set(e),n[12]=e[0]*t+e[4]*o+e[8]*r+e[12],n[13]=e[1]*t+e[5]*o+e[9]*r+e[13],n[14]=e[2]*t+e[6]*o+e[10]*r+e[14],n[15]=e[3]*t+e[7]*o+e[11]*r+e[15],n}function Oe(n,e,t,o,r){for(let i=0;i<4;i++)n[i]=e[i]*t,n[4+i]=e[4+i]*o,n[8+i]=e[8+i]*r,n[12+i]=e[12+i];return n}function zr(n,e,t){let o=Math.sin(t),r=Math.cos(t),i=e[4],a=e[5],s=e[6],l=e[7],c=e[8],u=e[9],h=e[10],f=e[11];return n!==e&&(n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15]),n[4]=i*r+c*o,n[5]=a*r+u*o,n[6]=s*r+h*o,n[7]=l*r+f*o,n[8]=c*r-i*o,n[9]=u*r-a*o,n[10]=h*r-s*o,n[11]=f*r-l*o,n}function Nr(n,e,t){let o=Math.sin(t),r=Math.cos(t),i=e[0],a=e[1],s=e[2],l=e[3],c=e[4],u=e[5],h=e[6],f=e[7];return n!==e&&(n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15]),n[0]=i*r+c*o,n[1]=a*r+u*o,n[2]=s*r+h*o,n[3]=l*r+f*o,n[4]=c*r-i*o,n[5]=u*r-a*o,n[6]=h*r-s*o,n[7]=f*r-l*o,n}function zi(n,e,t,o,r){let i=1/Math.tan(e/2);return n.fill(0),n[0]=i/t,n[5]=i,n[11]=-1,n[10]=(r+o)/(o-r),n[14]=2*r*o/(o-r),n}function Ni(n,e,t,o,r,i,a){let s=1/(e-t),l=1/(o-r),c=1/(i-a);return n.fill(0),n[0]=-2*s,n[5]=-2*l,n[10]=2*c,n[12]=(e+t)*s,n[13]=(r+o)*l,n[14]=(a+i)*c,n[15]=1,n}function Ve(n,e){let t=e[0],o=e[1],r=e[2],i=e[3],a=e[4],s=e[5],l=e[6],c=e[7],u=e[8],h=e[9],f=e[10],d=e[11],p=e[12],m=e[13],y=e[14],b=e[15],g=t*s-o*a,A=t*l-r*a,B=t*c-i*a,x=o*l-r*s,w=o*c-i*s,_=r*c-i*l,C=u*m-h*p,v=u*y-f*p,E=u*b-d*p,D=h*y-f*m,M=h*b-d*m,H=f*b-d*y,S=g*H-A*M+B*D+x*E-w*v+_*C;return S?(S=1/S,n[0]=(s*H-l*M+c*D)*S,n[1]=(r*M-o*H-i*D)*S,n[2]=(m*_-y*w+b*x)*S,n[3]=(f*w-h*_-d*x)*S,n[4]=(l*E-a*H-c*v)*S,n[5]=(t*H-r*E+i*v)*S,n[6]=(y*B-p*_-b*A)*S,n[7]=(u*_-f*B+d*A)*S,n[8]=(a*M-s*E+c*C)*S,n[9]=(o*E-t*M-i*C)*S,n[10]=(p*w-m*B+b*g)*S,n[11]=(h*B-u*w-d*g)*S,n[12]=(s*v-a*D-l*C)*S,n[13]=(t*D-o*v+r*C)*S,n[14]=(m*A-p*x-y*g)*S,n[15]=(u*x-h*A+f*g)*S,n):null}function he(n,e,t){let[o,r,i,a]=t;return n[0]=e[0]*o+e[4]*r+e[8]*i+e[12]*a,n[1]=e[1]*o+e[5]*r+e[9]*i+e[13]*a,n[2]=e[2]*o+e[6]*r+e[10]*i+e[14]*a,n[3]=e[3]*o+e[7]*r+e[11]*i+e[15]*a,n}function Je(n,e){for(let t=0;t<16;t++)n[t]=e[t];return n}function Ko(n){let e=Math.hypot(n[0],n[1],n[2])||1;return [n[0]/e,n[1]/e,n[2]/e]}function Vi(n,e){return [n[1]*e[2]-n[2]*e[1],n[2]*e[0]-n[0]*e[2],n[0]*e[1]-n[1]*e[0]]}function tc(n,e){return [n[0]-e[0],n[1]-e[1],n[2]-e[2]]}function Vr(n,e){return n[0]*e[0]+n[1]*e[1]+n[2]*e[2]}function Ki(n,e,t,o){let r=Ko(tc(t,e)),i=Ko(Vi(r,o)),a=Vi(i,r);return n[0]=i[0],n[1]=a[0],n[2]=-r[0],n[3]=0,n[4]=i[1],n[5]=a[1],n[6]=-r[1],n[7]=0,n[8]=i[2],n[9]=a[2],n[10]=-r[2],n[11]=0,n[12]=-Vr(i,e),n[13]=-Vr(a,e),n[14]=Vr(r,e),n[15]=1,n}var Xt=60,Uo=4.5,ct=6,Jo=n=>n/(2*Math.PI);function Xo(n){if(n<=Uo)return 0;if(n>=ct)return 1;let e=(n-Uo)/(ct-Uo);return e*e*(3-2*e)}function jo(n,e){let t=n*Math.PI/180,o=No(e)*Math.PI/180,r=Math.cos(o);return [r*Math.sin(t),-Math.sin(o),r*Math.cos(t)]}function Kr(n){let e=Math.hypot(n[0],n[1],n[2])||1,t=n[0]/e,o=n[1]/e,r=n[2]/e;return {lng:Math.atan2(t,r)*180/Math.PI,lat:Math.asin(-o)*180/Math.PI}}function oc(n,e){return jo(Se(n),Me(e))}function Ur(n,e){let t=n*Math.PI/180,o=No(e)*Math.PI/180,r=Math.cos(o),i=Math.sin(o);return {east:[Math.cos(t),0,-Math.sin(t)],south:[i*Math.sin(t),r,i*Math.cos(t)],up:[r*Math.sin(t),-i,r*Math.cos(t)]}}function Ui(n,e,t){let o=n[0]*e,r=n[1]*e,i=n[2]*e;return [o*t.east[0]+r*t.east[1]+i*t.east[2],o*t.south[0]+r*t.south[1]+i*t.south[2],o*t.up[0]+r*t.up[1]+i*t.up[2]-e]}function rc(n,e,t,o,r){let i=n-t;return i>.5&&(i-=1),i<-0.5&&(i+=1),[i*r,(e-o)*r,0]}function Ji(n,e,t,o,r,i,a,s){let l=Ui(oc(n,e),r,a);if(s<=0)return l;let c=rc(n,e,t,o,i);return [l[0]+(c[0]-l[0])*s,l[1]+(c[1]-l[1])*s,l[2]+(c[2]-l[2])*s]}function Jr(n,e,t){let o=n[0]*e[0]+n[1]*e[1]+n[2]*e[2],r=n[0]**2+n[1]**2+n[2]**2-t*t,i=o*o-r;if(i<0)return null;let a=-o-Math.sqrt(i);return a<0?null:[n[0]+e[0]*a,n[1]+e[1]*a,n[2]+e[2]*a]}var Xi=1e3,nc=2,ji=84,ic=.42,jt=class n{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=st(36.87);this._worldSize=512;this._pixelsPerMeter=1;this._cameraToCenterDistance=0;this._centerX=0;this._centerY=0;this._projMatrix=K();this._viewProjPx=K();this._viewMatrix=K();this._pixelMatrix=K();this._pixelMatrixInverse=K();this._cameraPosPx=[0,0,0];this._frustumPlanes=[];this._dirty=true;this.projection="mercator";this._f32=new Float32Array(16);this._tileMatrix=K();this._localView=K();this._localProj=K();this._localPixel=K();this._localPixelInverse=K();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=K();this._shadowView=K();this._shadowProj=K();this._shadowVP=K();this._shadowVPm=K();this._shadowTile=K();this._shadowObject=K();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=ic*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=_e(e,this.effectiveMinZoom(),this.maxZoom);t!==this._zoom&&(this._zoom=t,this._dirty=true);}get bearing(){return this._bearing}set bearing(e){let t=Bt(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<ct?Math.min(this.maxPitch,Xt):this.maxPitch,o=_e(e,this.minPitch,t);o!==this._pitch&&(this._pitch=o,this._dirty=true);}get fov(){return Pi(this._fov)}set fov(e){let t=st(_e(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 n;return e.width=this.width,e.height=this.height,e.minZoom=this.minZoom,e.maxZoom=this.maxZoom,e.minPitch=this.minPitch,e.maxPitch=this.maxPitch,e._center={...this._center},e._zoom=this._zoom,e._bearing=this._bearing,e._pitch=this._pitch,e._fov=this._fov,e._dirty=true,e}project(e,t=0){this._ensure();let o=[ie(e.lng)*this._worldSize,ae(e.lat)*this._worldSize,t,1],r=[0,0,0,0];he(r,this._pixelMatrix,o);let i=r[3]||1e-9;return {x:r[0]/i,y:r[1]/i}}worldPxToPoint(e,t,o=0){if(this._ensure(),this.globeActive){let i=this.globeLocal(e/this._worldSize,t/this._worldSize),a={lng:Se(e/this._worldSize),lat:Me(t/this._worldSize)};return this.isOnGlobeFront(a.lng,a.lat,0)?(i[2]+=o*this._pixelsPerMeter,this.localToPoint(i)):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:Se(t.x/this._worldSize),lat:Me(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,i=o[3]||1e-9,a={x:t[0]/r,y:t[1]/r,z:t[2]/r},s={x:o[0]/i,y:o[1]/i,z:o[2]/i},l=s.z-a.z,c=Math.abs(l)<1e-9?1:(0-a.z)/l,u=_e(c,-1e6,1e6);return {x:a.x+(s.x-a.x)*u,y:a.y+(s.y-a.y)*u}}setLocationAtPoint(e,t){if(this._ensure(),this.globeActive){let s=this.globeUnproject(t);if(!s)return;let l=Bt(this._center.lng+(e.lng-s.lng)),c=_e(this._center.lat+(e.lat-s.lat),-ji,ji);this._center={lng:l,lat:c},this._dirty=true;return}let o=this.pointToWorldPx(t),r={x:ie(e.lng)*this._worldSize,y:ae(e.lat)*this._worldSize},i=r.x-o.x,a=r.y-o.y;this._center={lng:Se((this._centerX+i)/this._worldSize),lat:Me((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,i=this._tileMatrix;return We(i,this._projMatrix,o.minX*this._worldSize,o.minY*this._worldSize,0),Oe(i,i,r,r,1),Je(this._f32,i)}tileMatrix64(e,t,o=K()){this._ensure();let r=e.bounds(),i=(r.maxX-r.minX)*this._worldSize/t;return We(o,this._projMatrix,r.minX*this._worldSize,r.minY*this._worldSize,0),Oe(o,o,i,i,1),o}objectMatrix(e,t,o=0){this._ensure();let r=this._objectMatrix;return We(r,this._projMatrix,e*this._worldSize,t*this._worldSize,o),Oe(r,r,this._worldSize,this._worldSize,1),Je(this._objectF32,r)}horizonScreenY(){this._ensure();let e=Math.PI/2-st(this._pitch),o=this.height/2/Math.tan(this._fov/2)*Math.tan(Math.min(e,st(89.5)));return this.height/2-Math.min(o,this.height*50)}get globeActive(){return this._ensure(),this.projection==="globe"&&this._zoom<ct}get globeFlatMix(){return this._ensure(),Xo(this._zoom)}get globeRadiusPx(){return this._ensure(),Jo(this._worldSize)}get globeBasis(){return this._ensure(),this._globeBasis}get localProjMatrix(){return this._ensure(),this._localProj}globeCamera(){this._ensure();let e=this.globeRadiusPx,t=K();if(!Ve(t,this._localView))return {dir:[0,0,1],horizonCos:1};let o=t[12],r=t[13],i=t[14]+e,a=Math.hypot(o,r,i)||1;return {dir:[o/a,r/a,i/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,i])=>{let a=[0,0,0,0],s=[0,0,0,0];he(a,this._localPixelInverse,[r,i,0,1]),he(s,this._localPixelInverse,[r,i,1,1]);let l=a[3]||1e-9,c=s[3]||1e-9,u=s[0]/c-a[0]/l,h=s[1]/c-a[1]/l,f=s[2]/c-a[2]/l,d=Math.hypot(u,h,f)||1;return [u/d,h/d,f/d]})}globeDisc(){this._ensure();let e=this.globeCamera();return {dir:[-e.dir[0],-e.dir[1],-e.dir[2]],angle:Math.asin(Math.min(e.horizonCos,1))}}localMatrix(){return this._ensure(),Je(this._localF32,this._localProj)}globeLocal(e,t){return this._ensure(),Ji(e,t,this._centerX/this._worldSize,this._centerY/this._worldSize,this.globeRadiusPx,this._worldSize,this._globeBasis,Xo(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,i=o[3]||1e-9,a=this.globeRadiusPx,s=[t[0]/r,t[1]/r,t[2]/r+a],l=[o[0]/i-s[0],o[1]/i-s[1],o[2]/i+a-s[2]],c=Math.hypot(l[0],l[1],l[2])||1,u=[l[0]/c,l[1]/c,l[2]/c],h=Jr(s,u,a);if(!h)return null;let f=this._globeBasis,d=[h[0]/a,h[1]/a,h[2]/a],p=[d[0]*f.east[0]+d[1]*f.south[0]+d[2]*f.up[0],d[0]*f.east[1]+d[1]*f.south[1]+d[2]*f.up[1],d[0]*f.east[2]+d[1]*f.south[2]+d[2]*f.up[2]];return Kr(p)}isOnGlobeFront(e,t,o=.06){this._ensure();let r=this.globeCamera(),i=this._globeBasis,a=jo(e,t),s=[a[0]*i.east[0]+a[1]*i.east[1]+a[2]*i.east[2],a[0]*i.south[0]+a[1]*i.south[1]+a[2]*i.south[2],a[0]*i.up[0]+a[1]*i.up[1]+a[2]*i.up[2]];return s[0]*r.dir[0]+s[1]*r.dir[1]+s[2]*r.dir[2]>=r.horizonCos-o}updateShadow(e,t){this._ensure();let o=Math.max(this.width,this.height)*nc,r=K();if(!Ve(r,this._viewProjPx))return;let i=this._cameraPosPx,a=[],s=[0,0,0,0];for(let x of [-1,1])for(let w of [-1,1])for(let _ of [-1,1]){if(he(s,r,[x,w,_,1]),s[3]===0)continue;let C=s[0]/s[3],v=s[1]/s[3],E=C-i[0],D=v-i[1],M=Math.hypot(E,D);if(M>o){let H=o/M;C=i[0]+E*H,v=i[1]+D*H;}a.push({x:C,y:v,z:0});}if(!a.length)return;let l=Ko(e),c=Math.abs(l[2])>.999?[0,1,0]:[0,0,1],u=this._shadowView;Ki(u,[this._centerX,this._centerY,0],[this._centerX+l[0],this._centerY+l[1],l[2]],c);let h=Math.min(t*this._pixelsPerMeter,o),f=1/0,d=1/0,p=1/0,m=-1/0,y=-1/0,b=-1/0,g=[0,0,0,0];for(let x of a)for(let w of [0,h])he(g,u,[x.x,x.y,w,1]),g[0]<f&&(f=g[0]),g[0]>m&&(m=g[0]),g[1]<d&&(d=g[1]),g[1]>y&&(y=g[1]),g[2]<p&&(p=g[2]),g[2]>b&&(b=g[2]);let A=h+1,B=this._shadowProj;Ni(B,f,m,d,y,-b-A,-p+A),Ee(this._shadowVP,B,u),Oe(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 We(r,this._shadowVPm,e*this._worldSize,t*this._worldSize,o),Oe(r,r,this._worldSize,this._worldSize,1),Je(this._shadowObject32,r)}shadowTileMatrix(e,t){this._ensure();let o=e.bounds(),r=(o.maxX-o.minX)*this._worldSize/t,i=this._shadowTile;return We(i,this._shadowVPm,o.minX*this._worldSize,o.minY*this._worldSize,0),Oe(i,i,r,r,1),Je(this._shadowTile32,i)}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,i=t.minY*this._worldSize,a=t.maxY*this._worldSize,s=Xi*this._pixelsPerMeter;for(let l of this._frustumPlanes){let c=l[0]>0?r:o,u=l[1]>0?a:i,h=l[2]>0?s:0;if(l[0]*c+l[1]*u+l[2]*h+l[3]<0)return false}return true}isSphereVisible(e,t,o,r){this._ensure();let i=e*this._worldSize,a=t*this._worldSize,s=o*this._pixelsPerMeter,l=r*this._pixelsPerMeter;for(let c of this._frustumPlanes)if(c[0]*i+c[1]*a+c[2]*s+c[3]<-l)return false;return true}distanceToTile(e){this._ensure();let t=e.bounds(),[o,r,i]=this._cameraPosPx,a=Math.max(t.minX*this._worldSize-o,0,o-t.maxX*this._worldSize),s=Math.max(t.minY*this._worldSize-r,0,r-t.maxY*this._worldSize),l=Math.max(0-i,0,i-Xi*this._pixelsPerMeter);return Math.hypot(a,s,l)}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=qe(this._zoom);this._worldSize=e,this._pixelsPerMeter=Gr(1,this._center.lat)*e,this._centerX=ie(this._center.lng)*e,this._centerY=ae(this._center.lat)*e;let t=Math.max(this.width,1),o=Math.max(this.height,1),r=st(this._pitch),i=-st(this._bearing),a=.5/Math.tan(this._fov/2)*o;this._cameraToCenterDistance=a;let s=Math.PI/2+r,l=this._fov/2,c=Math.sin(l)*a/Math.sin(_e(Math.PI-s-l,.01,Math.PI-.01)),u=Math.cos(Math.PI/2-r)*c+a,h=Math.min(u*1.01,a*30),f=o/50;if(this.projection==="globe"&&this._zoom<ct){let g=Jo(e);f=Math.max(a-g*1.6,a*.02),h=a+g*2.4;}let d=this._viewMatrix;Oe(d,K(),1,-1,1),We(d,d,0,0,-a),zr(d,d,r),Nr(d,d,i),We(d,d,-this._centerX,-this._centerY,0);let p=K();zi(p,this._fov,t/o,f,h),Ee(this._viewProjPx,p,d);let m=K();Oe(m,d,1,1,this._pixelsPerMeter),Ee(this._projMatrix,p,m);let y=this._localView;Oe(y,K(),1,-1,1),We(y,y,0,0,-a),zr(y,y,r),Nr(y,y,i),Ee(this._localProj,p,y),this._globeBasis=Ur(this._center.lng,this._center.lat);let b=K();Oe(b,K(),t/2,-o/2,1),We(b,b,1,-1,0),Ee(this._pixelMatrix,b,this._projMatrix),Ve(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"),Ee(this._localPixel,b,this._localProj),Ve(this._localPixelInverse,this._localPixel),this._calcCameraPosition(),this._calcFrustum();}_calcCameraPosition(){let e=K();if(!Ve(e,this._viewMatrix)){this._cameraPosPx=[this._centerX,this._centerY,this._cameraToCenterDistance];return}this._cameraPosPx=[e[12],e[13],e[14]];}_calcFrustum(){let e=K();if(!Ve(e,this._viewProjPx)){this._frustumPlanes=[];return}let t=[];for(let s of [-1,1])for(let l of [-1,1])for(let c of [-1,1]){let u=[0,0,0,0];he(u,e,[c,l,s,1]);let h=u[3]||1e-9;t.push([u[0]/h,u[1]/h,u[2]/h]);}let o=[[0,1,2],[6,5,4],[0,2,4],[5,3,1],[0,4,1],[3,6,2]];this._frustumPlanes=o.map(([s,l,c])=>{let u=t[s],h=t[l],f=t[c],d=h[0]-u[0],p=h[1]-u[1],m=h[2]-u[2],y=f[0]-u[0],b=f[1]-u[1],g=f[2]-u[2],A=p*g-m*b,B=m*y-d*g,x=d*b-p*y,w=Math.hypot(A,B,x)||1;A/=w,B/=w,x/=w;let _=new Float64Array(4);return _[0]=A,_[1]=B,_[2]=x,_[3]=-(A*u[0]+B*u[1]+x*u[2]),_});let r=0,i=0,a=0;for(let s of t)r+=s[0]/8,i+=s[1]/8,a+=s[2]/8;for(let s of this._frustumPlanes)s[0]*r+s[1]*i+s[2]*a+s[3]<0&&(s[0]=-s[0],s[1]=-s[1],s[2]=-s[2],s[3]=-s[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 i=Math.floor(r.x/this._worldSize);i<t&&(t=i),i>o&&(o=i);}return !isFinite(t)||!isFinite(o)?{min:0,max:0}:{min:_e(t,-3,3),max:_e(o,-3,3)}}};var ac={dragPan:true,scrollZoom:true,dragRotate:true,touchZoomRotate:true,touchPitch:true,doubleClickZoom:true,keyboard:true,inertia:1},Yi=2,sc=100,lc=.5,cc=.1,fc=25,Zi=n=>Math.abs(n.y)>Math.abs(n.x);function qi(n,e,t){let o=Math.hypot(n.x,n.y)>=Yi,r=Math.hypot(e.x,e.y)>=Yi;return !o&&!r?void 0:!o||!r?t<sc?void 0:false:n.y>0==e.y>0&&Zi(n)&&Zi(e)}function Qi(n,e){let t=(n-e)*(180/Math.PI);for(;t>180;)t-=360;for(;t<=-180;)t+=360;return t}var uc=160,Xr=4,Yo=class{constructor(e,t,o,r,i={}){this.canvas=e;this.tr=t;this.onChange=o;this.onInteractionEnd=r;this.pointers=new W;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=_e(-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={...ac,...i},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,i=Math.hypot(o,r);this.touch={mode:void 0,lastA:e,lastB:t,startA:e,startB:t,startDist:i,startAngle:Math.atan2(r,o),minDist:i,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},i={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(i.x,i.y)>0)&&(e.firstMoveAt=performance.now());let a=e.pitchPossible&&this.opts.touchPitch?qi(r,i,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+i.y)/2;a!==0&&(this.tr.pitch=this.tr.pitch-a*lc,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),i=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},s={x:(t.x+o.x)/2,y:(t.y+o.y)/2},l=this.tr.unproject(a),c="pan",u=Math.hypot(e.lastB.x-e.lastA.x,e.lastB.y-e.lastA.y);if(r>0&&u>0&&e.startDist>0&&(!e.zoomActive&&Math.abs(Math.log2(r/e.startDist))>=cc&&(e.zoomActive=true),e.zoomActive)){let h=Math.log2(r/u);h!==0&&(this.tr.zoom=this.tr.zoom+h,c="zoom");}if(this.opts.dragRotate){e.minDist=Math.min(e.minDist,r);let h=fc/Math.max(Math.PI*e.minDist,1)*360;if(!e.rotateActive&&Math.abs(Qi(i,e.startAngle))>=h&&(e.rotateActive=true),e.rotateActive){let f=Math.atan2(e.lastB.y-e.lastA.y,e.lastB.x-e.lastA.x),d=Qi(i,f);d!==0&&(this.tr.bearing=this.tr.bearing-d,c==="pan"&&(c="rotate"));}}this.tr.setLocationAtPoint(l,s),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>uc;)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,i=(t.y-e.y)/o*this.opts.inertia,a=Math.hypot(r,i);if(a<.05)return;a>Xr&&(r=r/a*Xr,i=i/a*Xr);let s=performance.now(),l=()=>{if(this.disposed)return;let c=performance.now(),u=Math.min(c-s,34);s=c;let h=Math.exp(-25e-4*u*10);if(r*=h,i*=h,Math.hypot(r,i)<.01){this.inertiaRaf=0,this.onInteractionEnd();return}let f={x:this.tr.width/2,y:this.tr.height/2};this.panBy(-r*u,-i*u,f),this.inertiaRaf=requestAnimationFrame(l);};this.inertiaRaf=requestAnimationFrame(l);}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 ve=class{constructor(e,t,o,r=false){this.ctx=e;this.layout=o;let i=e.gl,a=i.createBuffer();if(!a)throw new Error("[osmgl] createBuffer \u0432\u0435\u0440\u043D\u0443\u043B null");this.buffer=a,e.bindVAO(null),i.bindBuffer(i.ARRAY_BUFFER,a),i.bufferData(i.ARRAY_BUFFER,t,r?i.DYNAMIC_DRAW:i.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);}},ge=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);}},de=class{constructor(e,t,o){this.ctx=e;let r=e.gl,i=r.createVertexArray();if(!i)throw new Error("[osmgl] createVertexArray \u0432\u0435\u0440\u043D\u0443\u043B null");this.vao=i,e.bindVAO(i);for(let{buffer:a,locations:s}of t){r.bindBuffer(r.ARRAY_BUFFER,a.buffer);for(let l of a.layout.attribs){let c=s.get(l.name);c===void 0||c<0||(r.enableVertexAttribArray(c),l.integer?r.vertexAttribIPointer(c,l.size,l.type,a.layout.stride,l.offset):r.vertexAttribPointer(c,l.size,l.type,l.normalized??false,a.layout.stride,l.offset),l.divisor&&r.vertexAttribDivisor(c,l.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 dc=["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"],Ae=class{constructor(e,t,o,r,i={}){this.ctx=e;this.name=t;this.uniforms=new W;this.attribs=new W;let a=e.gl,s=pc(i),l=ea(a,a.VERTEX_SHADER,$i(o,s),`${t}.vert`),c=ea(a,a.FRAGMENT_SHADER,$i(r,s),`${t}.frag`),u=a.createProgram();if(!u)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(u,l),a.attachShader(u,c),dc.forEach((h,f)=>a.bindAttribLocation(u,f,h)),a.linkProgram(u),a.detachShader(u,l),a.detachShader(u,c),a.deleteShader(l),a.deleteShader(c),!a.getProgramParameter(u,a.LINK_STATUS)){let h=a.getProgramInfoLog(u);throw a.deleteProgram(u),new Error(`[osmgl] \u043B\u0438\u043D\u043A\u043E\u0432\u043A\u0430 ${t} \u043D\u0435 \u043F\u0440\u043E\u0448\u043B\u0430: ${h}`)}this.program=u,this.cacheLocations();}cacheLocations(){let e=this.ctx.gl,t=e.getProgramParameter(this.program,e.ACTIVE_UNIFORMS);for(let r=0;r<t;r++){let i=e.getActiveUniform(this.program,r);if(!i)continue;let a=i.name.replace(/\[0\]$/,"");this.uniforms.set(a,e.getUniformLocation(this.program,i.name));}let o=e.getProgramParameter(this.program,e.ACTIVE_ATTRIBUTES);for(let r=0;r<o;r++){let i=e.getActiveAttrib(this.program,r);i&&this.attribs.set(i.name,e.getAttribLocation(this.program,i.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 i=this.loc(e);i&&this.ctx.gl.uniform3f(i,t,o,r);}setVec4(e,t,o,r,i){let a=this.loc(e);a&&this.ctx.gl.uniform4f(a,t,o,r,i);}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 pc(n){let e=[];for(let[t,o]of Object.entries(n))o!==false&&e.push(o===true?`#define ${t}`:`#define ${t} ${o}`);return e.join(`
|
|
2
|
-
`)}function
|
|
1
|
+
var OsmGL=(function(exports){'use strict';var oc=Object.defineProperty;var zo=(n,e)=>()=>(n&&(e=n(n=0)),e);var rc=(n,e)=>{for(var t in e)oc(n,t,{get:e[t],enumerable:true});};var gh,hs=zo(()=>{gh=(function(){var n="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FHRAOCUFHOXBKKAVC+QDF8kJJJJBK/uLEVUCUAICDTGVAICffffI0eGOCBYD1+KJJBhJJJJBBHRALALYD9gGWCDTFARbDBALAWCEFbD9gABARbDBAOCBYD1+KJJBhJJJJBBHRALALYD9gGOCDTFARbDBALAOCEFbD9gABARbDLCUADCDTADCffffI0eCBYD1+KJJBhJJJJBBHRALALYD9gGOCDTFARbDBALAOCEFbD9gABARbDWABYDBCBAVZ+TJJJB8aADCI9uHWDNADtMBABYDBHOAEHLADHRINAOALYDBCDTFGVAVYDBCEFbDBALCLFHLARCUFGRMBKKDNAItMBABYDBHLABYDLHRCBHVAIHOINARAVbDBARCLFHRALYDBAVFHVALCLFHLAOCUFGOMBKKDNADCI6MBAWCEAWCE0eHdABYDLHRABYDWHVCBHLINAECWFYDBHOAECLFYDBHDARAEYDBCDTFGWAWYDBGWCEFbDBAVAWCDTFALbDBARADCDTFGDADYDBGDCEFbDBAVADCDTFALbDBARAOCDTFGOAOYDBGOCEFbDBAVAOCDTFALbDBAECXFHEAdALCEFGL9HMBKKDNAItMBABYDLHEABYDBHLINAEAEYDBALYDB9rbDBALCLFHLAECLFHEAICUFGIMBKKKqBABAEADAIC+01JJBZ+MJJJBKqBABAEADAIC+c+JJJBZ+MJJJBK9dEEUABCfEAICDTZ+TJJJBHLCBHIDNADtMBINDNALAEYDBCDTFGBYDBCU9HMBABAIbDBAICEFHIKAECLFHEADCUFGDMBKKAIK9TEIUCBCBYD+M+KJJBGEABCIFC98gFGBbD+M+KJJBDNDNABzBCZTGD9NMBCUHIABAD9rCffIFCZ4NBCUsMEKAEHIKAIK/lEEEUDNDNAEABvCIgtMBABHIXEKDNDNADCZ9PMBABHIXEKABHIINAIAEYDBbDBAICLFAECLFYDBbDBAICWFAECWFYDBbDBAICXFAECXFYDBbDBAICZFHIAECZFHEADC9wFGDCS0MBKKADCL6MBINAIAEYDBbDBAECLFHEAICLFHIADC98FGDCI0MBKKDNADtMBINAIAErBB86BBAICEFHIAECEFHEADCUFGDMBKKABK/AEEDUDNDNABCIgtMBABHIXEKAECfEgC+B+C+EW2HLDNDNADCZ9PMBABHIXEKABHIINAIALbDBAICXFALbDBAICWFALbDBAICLFALbDBAICZFHIADC9wFGDCS0MBKKADCL6MBINAIALbDBAICLFHIADC98FGDCI0MBKKDNADtMBINAIAE86BBAICEFHIADCUFGDMBKKABK9TEIUCBCBYD+M+KJJBGEABCIFC98gFGBbD+M+KJJBDNDNABzBCZTGD9NMBCUHIABAD9rCffIFCZ4NBCUsMEKAEHIKAIK9+EIUzBHEDNDNCBYD+M+KJJBGDAECZTGI9NMBCUHEADAI9rCffIFCZ4NBCUsMEKADHEKCBABAE9rCIFC98gCBYD+M+KJJBFGDbD+M+KJJBDNADzBCZTGE9NMBADAE9rCffIFCZ4NB8aKKXBABAEZ+YJJJBK+BEEIUDNAB+8GDCl4GICfEgGLCfEsMBDNALMBDNABjBBBB9cMBAECBbDBABSKABjBBJ9fnAEZ+XJJJBHBAEAEYDBCNFbDBABSKAEAICfEgC+CUFbDBADCfff+D94gCJJJ/4Iv++HBKABK+gEBDNDNAECJE9IMBABjBBBUnHBDNAECfE9PMBAEC+BUFHEXDKABjBBBUnHBAECPDAECPD6eC+C9+FHEXEKAEC+BU9KMBABjBBJXnHBDNAEC+b9+9NMBAEC/mBFHEXEKABjBBJXnHBAEC+299AEC+2990eC/MEFHEKABAEClTCJJJ/8IF++nKK+eDDBCJWK+EDB4+H9W9n94+p+Gw+J9o+YE9pBBBBBBEBBBDBBBEBBBDBBBBBBBDBBBBBBBEBBBBBBB+L29Hz/69+9Kz/n/76z/RG97z/Z/O9Xz8j/b85z/+/U9Yz/B/K9hz+2/z9dz9E+L9Mz59a8kz+R/t3z+a+Zyz79ohz/J4++8++y+d9v8+BBBB9S+49+z8r+Hbz9m9m/m8+l/Z/O8+/8+pg89Q/X+j878r+Hq8++m+b/E87BBBBBBJzBBJzBBJz+e/v/n8++y+dSz9I/h/68+XD/r8+/H0838+/w+nOzBBBB+wv9o8+UF888+9I/h/68+9C9g/l89/N/M9M89/d8kO8+BBBBF+8Tz9M836zs+2azl/Zpzz818ez9E+LXz/u98f8+819e/68+BC+EQKXEBBBDBBBAwBB",e=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!="object")return {supported:false};var t,o=WebAssembly.instantiate(r(n),{}).then(function(f){t=f.instance,t.exports.__wasm_call_ctors(),t.exports.meshopt_encodeVertexVersion(0),t.exports.meshopt_encodeIndexVersion(1);});function r(f){for(var d=new Uint8Array(f.length),p=0;p<f.length;++p){var b=f.charCodeAt(p);d[p]=b>96?b-71:b>64?b-65:b>47?b+4:b>46?63:62;}for(var m=0,p=0;p<f.length;++p)d[m++]=d[p]<60?e[d[p]]:(d[p]-60)*64+d[++p];return d.buffer.slice(0,m)}function i(f){if(!f)throw new Error("Assertion failed")}function a(f){return new Uint8Array(f.buffer,f.byteOffset,f.byteLength)}function l(f,d,p){var b=t.exports.sbrk,m=b(f.length*4),g=b(d*4),y=new Uint8Array(t.exports.memory.buffer),A=a(f);y.set(A,m),p&&p(m,m,f.length,d);var B=t.exports.meshopt_optimizeVertexFetchRemap(g,m,f.length,d);y=new Uint8Array(t.exports.memory.buffer);var x=new Uint32Array(d);new Uint8Array(x.buffer).set(y.subarray(g,g+d*4)),A.set(y.subarray(m,m+f.length*4)),b(m-b(0));for(var w=0;w<f.length;++w)f[w]=x[f[w]];return [x,B]}function s(f,d,p,b,m){var g=t.exports.sbrk,y=g(d),A=g(b*m),B=new Uint8Array(t.exports.memory.buffer);B.set(a(p),A);var x=f(y,d,A,b,m),w=new Uint8Array(x);return w.set(B.subarray(y,y+x)),g(y-g(0)),w}function c(f){for(var d=0,p=0;p<f.length;++p){var b=f[p];d=d<b?b:d;}return d}function h(f,d){if(i(d==2||d==4),d==4)return new Uint32Array(f.buffer,f.byteOffset,f.byteLength/4);var p=new Uint16Array(f.buffer,f.byteOffset,f.byteLength/2);return new Uint32Array(p)}function u(f,d,p,b,m,g){var y=t.exports.sbrk,A=y(p*b),B=y(p*g),x=new Uint8Array(t.exports.memory.buffer);x.set(a(d),B),f(A,p,b,m,B);var w=new Uint8Array(p*b);return w.set(x.subarray(A,A+p*b)),y(A-y(0)),w}return {ready:o,supported:true,reorderMesh:function(f,d,p){var b=d?p?t.exports.meshopt_optimizeVertexCacheStrip:t.exports.meshopt_optimizeVertexCache:void 0;return l(f,c(f)+1,b)},encodeVertexBuffer:function(f,d,p){i(p>0&&p<=256),i(p%4==0);var b=t.exports.meshopt_encodeVertexBufferBound(d,p);return s(t.exports.meshopt_encodeVertexBuffer,b,f,d,p)},encodeIndexBuffer:function(f,d,p){i(p==2||p==4),i(d%3==0);var b=h(f,p),m=t.exports.meshopt_encodeIndexBufferBound(d,c(b)+1);return s(t.exports.meshopt_encodeIndexBuffer,m,b,d,4)},encodeIndexSequence:function(f,d,p){i(p==2||p==4);var b=h(f,p),m=t.exports.meshopt_encodeIndexSequenceBound(d,c(b)+1);return s(t.exports.meshopt_encodeIndexSequence,m,b,d,4)},encodeGltfBuffer:function(f,d,p,b){var m={ATTRIBUTES:this.encodeVertexBuffer,TRIANGLES:this.encodeIndexBuffer,INDICES:this.encodeIndexSequence};return i(m[b]),m[b](f,d,p)},encodeFilterOct:function(f,d,p,b){return i(p==4||p==8),i(b>=1&&b<=16),u(t.exports.meshopt_encodeFilterOct,f,d,p,b,16)},encodeFilterQuat:function(f,d,p,b){return i(p==8),i(b>=4&&b<=16),u(t.exports.meshopt_encodeFilterQuat,f,d,p,b,16)},encodeFilterExp:function(f,d,p,b){return i(p>0&&p%4==0),i(b>=1&&b<=24),u(t.exports.meshopt_encodeFilterExp,f,d,p,b,p)}}})();});var yh,ds=zo(()=>{yh=(function(){var n="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",e="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",t=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]),o=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!="object")return {supported:false};var r=n;WebAssembly.validate(t)&&(r=e);var i,a=WebAssembly.instantiate(l(r),{}).then(function(u){i=u.instance,i.exports.__wasm_call_ctors();});function l(u){for(var f=new Uint8Array(u.length),d=0;d<u.length;++d){var p=u.charCodeAt(d);f[d]=p>96?p-71:p>64?p-65:p>47?p+4:p>46?63:62;}for(var b=0,d=0;d<u.length;++d)f[b++]=f[d]<60?o[f[d]]:(f[d]-60)*64+f[++d];return f.buffer.slice(0,b)}function s(u,f,d,p,b,m){var g=i.exports.sbrk,y=d+3&-4,A=g(y*p),B=g(b.length),x=new Uint8Array(i.exports.memory.buffer);x.set(b,B);var w=u(A,d,p,B,b.length);if(w==0&&m&&m(A,y,p),f.set(x.subarray(A,A+d*p)),g(A-g(0)),w!=0)throw new Error("Malformed buffer data: "+w)}var c={0:"",1:"meshopt_decodeFilterOct",2:"meshopt_decodeFilterQuat",3:"meshopt_decodeFilterExp",NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},h={0:"meshopt_decodeVertexBuffer",1:"meshopt_decodeIndexBuffer",2:"meshopt_decodeIndexSequence",ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"};return {ready:a,supported:true,decodeVertexBuffer:function(u,f,d,p,b){s(i.exports.meshopt_decodeVertexBuffer,u,f,d,p,i.exports[c[b]]);},decodeIndexBuffer:function(u,f,d,p){s(i.exports.meshopt_decodeIndexBuffer,u,f,d,p);},decodeIndexSequence:function(u,f,d,p){s(i.exports.meshopt_decodeIndexSequence,u,f,d,p);},decodeGltfBuffer:function(u,f,d,p,b,m){s(i.exports[h[b]],u,f,d,p,i.exports[c[m]]);}}})();});var Ah,ps=zo(()=>{Ah=(function(){var n="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iDZGK+TjBBBB+XGQALiDLALiDcGX+TGMAMAQ9deGQALiDWALiDkGM+TGpApAQ9deHpDNABtMBADtMBjBBBBjBBJzAp+VApjBBBB9beHQINABAQABiDBAK+TnuDBABCLFGIAQAIiDBAX+TnuDBABCWFGIAQAIiDBAM+TnuDBABCXFHBADCUFGDMBKKApK+qDIDUI99DUCBHI8jJJJJBCA9rGLCZFCWFCBYD11JJBbDBALCB8pDJ1JJB83IZALCWFCBYDn1JJBbDBALCB8pD+M1JJB83IBDNDNAEMBjBBJfHVjBBJfHOjBBJfHRXEKADCD4CDTHWINCBHDINALCZFADFGdABADFiDBGOAdiDBGRARAO9eeuDBALADFGdAOAdiDBGRARAO9deuDBADCLFGDCX9HMBKABAWFHBAICEFGIAE9HMBKALiDWALiDk+THRALiDLALiDc+THOALiDBALiDZ+THVKAVjBBBB+XGVAOAOAV9deGOARARAO9deK9dEEUABCfEAICDTZ1JJJBHLCBHIDNADtMBINDNALAEYDBCDTFGBYDBCU9HMBABAIbDBAICEFHIKAECLFHEADCUFGDMBKKAIK9TEIUCBCBYD/01JJBGEABCIFC98gFGBbD/01JJBDNDNABzBCZTGD9NMBCUHIABAD9rCffIFCZ4NBCUsMEKAEHIKAIK/lEEEUDNDNAEABvCIgtMBABHIXEKDNDNADCZ9PMBABHIXEKABHIINAIAEYDBbDBAICLFAECLFYDBbDBAICWFAECWFYDBbDBAICXFAECXFYDBbDBAICZFHIAECZFHEADC9wFGDCS0MBKKADCL6MBINAIAEYDBbDBAECLFHEAICLFHIADC98FGDCI0MBKKDNADtMBINAIAErBB86BBAICEFHIAECEFHEADCUFGDMBKKABK/AEEDUDNDNABCIgtMBABHIXEKAECfEgC+B+C+EW2HLDNDNADCZ9PMBABHIXEKABHIINAIALbDBAICXFALbDBAICWFALbDBAICLFALbDBAICZFHIADC9wFGDCS0MBKKADCL6MBINAIALbDBAICLFHIADC98FGDCI0MBKKDNADtMBINAIAE86BBAICEFHIADCUFGDMBKKABK9TEIUCBCBYD/01JJBGEABCIFC98gFGBbD/01JJBDNDNABzBCZTGD9NMBCUHIABAD9rCffIFCZ4NBCUsMEKAEHIKAIK9+EIUzBHEDNDNCBYD/01JJBGDAECZTGI9NMBCUHEADAI9rCffIFCZ4NBCUsMEKADHEKCBABAE9rCIFC98gCBYD/01JJBFGDbD/01JJBDNADzBCZTGE9NMBADAE9rCffIFCZ4NB8aKK6EIUCBHIDNADtMBDNINABrBBGLAErBBGV9HMEAECEFHEABCEFHBADCUFGDMBXDKKALAV9rHIKAIKK+CEDBCJWK9pffUUffUUffUUffUfffUfffUfBBBBBBBBEEEBEEBEBBEEEBEBBBBBEBEBBBBBEBBBDBBBBBBBBBBBBBBBEEEEEBEBBBBBEBBBBBEEBBBBBBC/sWKXEBBBDBBBJ9kBB",e=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!="object")return {supported:false};var t,o=WebAssembly.instantiate(r(n),{}).then(function(f){t=f.instance,t.exports.__wasm_call_ctors();});function r(f){for(var d=new Uint8Array(f.length),p=0;p<f.length;++p){var b=f.charCodeAt(p);d[p]=b>96?b-71:b>64?b-65:b>47?b+4:b>46?63:62;}for(var m=0,p=0;p<f.length;++p)d[m++]=d[p]<60?e[d[p]]:(d[p]-60)*64+d[++p];return d.buffer.slice(0,m)}function i(f){if(!f)throw new Error("Assertion failed")}function a(f){return new Uint8Array(f.buffer,f.byteOffset,f.byteLength)}function l(f,d){var p=t.exports.sbrk,b=p(f.length*4),m=p(d*4),g=new Uint8Array(t.exports.memory.buffer),y=a(f);g.set(y,b);var A=t.exports.meshopt_optimizeVertexFetchRemap(m,b,f.length,d);g=new Uint8Array(t.exports.memory.buffer);var B=new Uint32Array(d);new Uint8Array(B.buffer).set(g.subarray(m,m+d*4)),y.set(g.subarray(b,b+f.length*4)),p(b-p(0));for(var x=0;x<f.length;++x)f[x]=B[f[x]];return [B,A]}function s(f){for(var d=0,p=0;p<f.length;++p){var b=f[p];d=d<b?b:d;}return d}function c(f,d,p,b,m,g,y,A,B){var x=t.exports.sbrk,w=x(4),_=x(p*4),C=x(m*g),v=x(p*4),E=new Uint8Array(t.exports.memory.buffer);E.set(a(b),C),E.set(a(d),v);var D=f(_,v,p,C,m,g,y,A,B,w);E=new Uint8Array(t.exports.memory.buffer);var F=new Uint32Array(D);a(F).set(E.subarray(_,_+D*4));var H=new Float32Array(1);return a(H).set(E.subarray(w,w+4)),x(w-x(0)),[F,H[0]]}function h(f,d,p,b){var m=t.exports.sbrk,g=m(p*b),y=new Uint8Array(t.exports.memory.buffer);y.set(a(d),g);var A=f(g,p,b);return m(g-m(0)),A}var u={LockBorder:1};return {ready:o,supported:true,compactMesh:function(f){i(f instanceof Uint32Array||f instanceof Int32Array||f instanceof Uint16Array||f instanceof Int16Array),i(f.length%3==0);var d=f.BYTES_PER_ELEMENT==4?f:new Uint32Array(f);return l(d,s(f)+1)},simplify:function(f,d,p,b,m,g){i(f instanceof Uint32Array||f instanceof Int32Array||f instanceof Uint16Array||f instanceof Int16Array),i(f.length%3==0),i(d instanceof Float32Array),i(d.length%p==0),i(p>=3),i(b%3==0);for(var y=0,A=0;A<(g?g.length:0);++A)y|=u[g[A]];var B=f.BYTES_PER_ELEMENT==4?f:new Uint32Array(f),x=c(t.exports.meshopt_simplify,B,f.length,d,d.length,p*4,b,m,y);return x[0]=f instanceof Uint32Array?x[0]:new f.constructor(x[0]),x},getScale:function(f,d){return i(f instanceof Float32Array),i(f.length%d==0),h(t.exports.meshopt_simplifyScale,f,f.length,d*4)}}})();});var ms={};rc(ms,{MeshoptDecoder:()=>yh,MeshoptEncoder:()=>gh,MeshoptSimplifier:()=>Ah});var bs=zo(()=>{hs();ds();ps();});var z=Map,oe=Set;var qe=class{constructor(){this.listeners=new z;}on(e,t){let o=this.listeners.get(e);return o||this.listeners.set(e,o=new oe),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(i){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:`,i);}return this}removeAllListeners(){this.listeners.clear();}};var _e=(n,e,t)=>n<e?e:n>t?t:n;var Ge=n=>n*Math.PI/180,Oi=n=>n*180/Math.PI;function Bt(n){let e=((n+180)%360+360)%360-180;return e===-180?180:e}var Vo=n=>1-Math.pow(1-n,3);function he(n){let e=n.trim();if(e[0]==="#"){let o=e.slice(1);if(o.length===3||o.length===4){let r=o.split("").map(i=>parseInt(i+i,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 i=0;i<o.length;i+=2)r.push(parseInt(o.slice(i,i+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 Me(n){return [n[0]*n[3],n[1]*n[3],n[2]*n[3],n[3]]}var Wo=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=nc(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 i=this._viewport;i[0]===e&&i[1]===t&&i[2]===o&&i[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,i=0;e&&(r.clearColor(e[0],e[1],e[2],e[3]),i|=r.COLOR_BUFFER_BIT),t&&(this.setDepthMask(true),r.clearDepth(1),i|=r.DEPTH_BUFFER_BIT),o&&(r.clearStencil(0),i|=r.STENCIL_BUFFER_BIT),i&&r.clear(i);}invalidateState(){this._program=null,this._vao=null,this._framebuffer=null,this._activeTexture=-1,this._boundTextures.clear(),this._viewport=[-1,-1,-1,-1];}};function nc(n){let e=n.getExtension("EXT_texture_filter_anisotropic")??n.getExtension("WEBKIT_EXT_texture_filter_anisotropic"),t=n.getExtension("WEBGL_debug_renderer_info");return {maxTextureSize:n.getParameter(n.MAX_TEXTURE_SIZE),maxVertexAttribs:n.getParameter(n.MAX_VERTEX_ATTRIBS),colorBufferFloat:!!n.getExtension("EXT_color_buffer_float"),anisotropic:e,maxAnisotropy:e?n.getParameter(e.MAX_TEXTURE_MAX_ANISOTROPY_EXT):1,timerQuery:!!n.getExtension("EXT_disjoint_timer_query_webgl2"),rendererName:t?String(n.getParameter(t.UNMASKED_RENDERER_WEBGL)):"unknown"}}var st=512,No=40075016686e-3,zi=85.051129;function $(n){return Array.isArray(n)?{lng:n[0],lat:n[1]}:n}var $e=n=>512*Math.pow(2,n),Ko=n=>Math.max(-zi,Math.min(zi,n));function ne(n){return (180+n)/360}function ie(n){let e=Ko(n);return (180-180/Math.PI*Math.log(Math.tan(Math.PI/4+e*Math.PI/360)))/360}function Se(n){return n*360-180}function Fe(n){let e=180-n*360;return 360/Math.PI*Math.atan(Math.exp(e*Math.PI/180))-90}function Oe(n){return No*Math.cos(n*Math.PI/180)}function Or(n,e){return n/Oe(e)}function rp(n,e){return n*Oe(e)}function np(n,e){return Or(1,n)*$e(e)}function ip(n,e){return Oe(n)/$e(e)}function Vi(n,e){let t=Math.pow(2,n);return Oe(Fe((e+.5)/t))/t}function zr(n){return No/Math.pow(2,n)}function Wi(n,e,t){let o=zr(n),r=65536;return [(e*o%r+r)%r,(t*o%r+r)%r]}var Xt=class n{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 n;for(let o of e)t.extend(o);return t}extend(e){if(e instanceof n)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=$(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=$(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:ne(this.west),maxX:ne(this.east),minY:ie(this.north),maxY:ie(this.south)}}};function Vr(n,e){if(n.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,Ni),r=Math.max(e.height-t.top-t.bottom,Ni),i=n.toMercator(),a=e.bearing??0,l=-a*Math.PI/180,s=Math.cos(l),c=Math.sin(l),h=(i.minX+i.maxX)/2,u=(i.minY+i.maxY)/2,f=0,d=0;for(let[A,B]of [[i.minX,i.minY],[i.maxX,i.minY],[i.maxX,i.maxY],[i.minX,i.maxY]]){let x=(A-h)*s-(B-u)*c,w=(A-h)*c+(B-u)*s;f=Math.max(f,Math.abs(x)*2),d=Math.max(d,Math.abs(w)*2);}let p=Math.min(o/Math.max(f,1e-12),r/Math.max(d,1e-12)),b=Math.min(Math.max(Math.log2(p/512),e.minZoom??0),e.maxZoom??22),m=$e(b),g=(t.left-t.right)/2/m,y=(t.top-t.bottom)/2/m;return {center:{lng:Se(h-(g*s+y*c)),lat:Fe(u-(-g*c+y*s))},zoom:b,bearing:a}}var Ni=32;function K(){let n=new Float64Array(16);return n[0]=n[5]=n[10]=n[15]=1,n}function Xe(n){return n.fill(0),n[0]=n[5]=n[10]=n[15]=1,n}function Ee(n,e,t){let o=e[0],r=e[1],i=e[2],a=e[3],l=e[4],s=e[5],c=e[6],h=e[7],u=e[8],f=e[9],d=e[10],p=e[11],b=e[12],m=e[13],g=e[14],y=e[15];for(let A=0;A<4;A++){let B=t[A*4],x=t[A*4+1],w=t[A*4+2],_=t[A*4+3];n[A*4]=B*o+x*l+w*u+_*b,n[A*4+1]=B*r+x*s+w*f+_*m,n[A*4+2]=B*i+x*c+w*d+_*g,n[A*4+3]=B*a+x*h+w*p+_*y;}return n}function We(n,e,t,o,r){return n!==e&&n.set(e),n[12]=e[0]*t+e[4]*o+e[8]*r+e[12],n[13]=e[1]*t+e[5]*o+e[9]*r+e[13],n[14]=e[2]*t+e[6]*o+e[10]*r+e[14],n[15]=e[3]*t+e[7]*o+e[11]*r+e[15],n}function ze(n,e,t,o,r){for(let i=0;i<4;i++)n[i]=e[i]*t,n[4+i]=e[4+i]*o,n[8+i]=e[8+i]*r,n[12+i]=e[12+i];return n}function Nr(n,e,t){let o=Math.sin(t),r=Math.cos(t),i=e[4],a=e[5],l=e[6],s=e[7],c=e[8],h=e[9],u=e[10],f=e[11];return n!==e&&(n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15]),n[4]=i*r+c*o,n[5]=a*r+h*o,n[6]=l*r+u*o,n[7]=s*r+f*o,n[8]=c*r-i*o,n[9]=h*r-a*o,n[10]=u*r-l*o,n[11]=f*r-s*o,n}function Kr(n,e,t){let o=Math.sin(t),r=Math.cos(t),i=e[0],a=e[1],l=e[2],s=e[3],c=e[4],h=e[5],u=e[6],f=e[7];return n!==e&&(n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15]),n[0]=i*r+c*o,n[1]=a*r+h*o,n[2]=l*r+u*o,n[3]=s*r+f*o,n[4]=c*r-i*o,n[5]=h*r-a*o,n[6]=u*r-l*o,n[7]=f*r-s*o,n}function Ui(n,e,t,o,r){let i=1/Math.tan(e/2);return n.fill(0),n[0]=i/t,n[5]=i,n[11]=-1,n[10]=(r+o)/(o-r),n[14]=2*r*o/(o-r),n}function Ji(n,e,t,o,r,i,a){let l=1/(e-t),s=1/(o-r),c=1/(i-a);return n.fill(0),n[0]=-2*l,n[5]=-2*s,n[10]=2*c,n[12]=(e+t)*l,n[13]=(r+o)*s,n[14]=(a+i)*c,n[15]=1,n}function Ne(n,e){let t=e[0],o=e[1],r=e[2],i=e[3],a=e[4],l=e[5],s=e[6],c=e[7],h=e[8],u=e[9],f=e[10],d=e[11],p=e[12],b=e[13],m=e[14],g=e[15],y=t*l-o*a,A=t*s-r*a,B=t*c-i*a,x=o*s-r*l,w=o*c-i*l,_=r*c-i*s,C=h*b-u*p,v=h*m-f*p,E=h*g-d*p,D=u*m-f*b,F=u*g-d*b,H=f*g-d*m,S=y*H-A*F+B*D+x*E-w*v+_*C;return S?(S=1/S,n[0]=(l*H-s*F+c*D)*S,n[1]=(r*F-o*H-i*D)*S,n[2]=(b*_-m*w+g*x)*S,n[3]=(f*w-u*_-d*x)*S,n[4]=(s*E-a*H-c*v)*S,n[5]=(t*H-r*E+i*v)*S,n[6]=(m*B-p*_-g*A)*S,n[7]=(h*_-f*B+d*A)*S,n[8]=(a*F-l*E+c*C)*S,n[9]=(o*E-t*F-i*C)*S,n[10]=(p*w-b*B+g*y)*S,n[11]=(u*B-h*w-d*y)*S,n[12]=(l*v-a*D-s*C)*S,n[13]=(t*D-o*v+r*C)*S,n[14]=(b*A-p*x-m*y)*S,n[15]=(h*x-u*A+f*y)*S,n):null}function de(n,e,t){let[o,r,i,a]=t;return n[0]=e[0]*o+e[4]*r+e[8]*i+e[12]*a,n[1]=e[1]*o+e[5]*r+e[9]*i+e[13]*a,n[2]=e[2]*o+e[6]*r+e[10]*i+e[14]*a,n[3]=e[3]*o+e[7]*r+e[11]*i+e[15]*a,n}function je(n,e){for(let t=0;t<16;t++)n[t]=e[t];return n}function Uo(n){let e=Math.hypot(n[0],n[1],n[2])||1;return [n[0]/e,n[1]/e,n[2]/e]}function Ki(n,e){return [n[1]*e[2]-n[2]*e[1],n[2]*e[0]-n[0]*e[2],n[0]*e[1]-n[1]*e[0]]}function ic(n,e){return [n[0]-e[0],n[1]-e[1],n[2]-e[2]]}function Wr(n,e){return n[0]*e[0]+n[1]*e[1]+n[2]*e[2]}function Xi(n,e,t,o){let r=Uo(ic(t,e)),i=Uo(Ki(r,o)),a=Ki(i,r);return n[0]=i[0],n[1]=a[0],n[2]=-r[0],n[3]=0,n[4]=i[1],n[5]=a[1],n[6]=-r[1],n[7]=0,n[8]=i[2],n[9]=a[2],n[10]=-r[2],n[11]=0,n[12]=-Wr(i,e),n[13]=-Wr(a,e),n[14]=Wr(r,e),n[15]=1,n}var jt=60,Jo=4.5,ct=6,Xo=n=>n/(2*Math.PI);function jo(n){if(n<=Jo)return 0;if(n>=ct)return 1;let e=(n-Jo)/(ct-Jo);return e*e*(3-2*e)}function Yo(n,e){let t=n*Math.PI/180,o=Ko(e)*Math.PI/180,r=Math.cos(o);return [r*Math.sin(t),-Math.sin(o),r*Math.cos(t)]}function Ur(n){let e=Math.hypot(n[0],n[1],n[2])||1,t=n[0]/e,o=n[1]/e,r=n[2]/e;return {lng:Math.atan2(t,r)*180/Math.PI,lat:Math.asin(-o)*180/Math.PI}}function ac(n,e){return Yo(Se(n),Fe(e))}function Jr(n,e){let t=n*Math.PI/180,o=Ko(e)*Math.PI/180,r=Math.cos(o),i=Math.sin(o);return {east:[Math.cos(t),0,-Math.sin(t)],south:[i*Math.sin(t),r,i*Math.cos(t)],up:[r*Math.sin(t),-i,r*Math.cos(t)]}}function ji(n,e,t){let o=n[0]*e,r=n[1]*e,i=n[2]*e;return [o*t.east[0]+r*t.east[1]+i*t.east[2],o*t.south[0]+r*t.south[1]+i*t.south[2],o*t.up[0]+r*t.up[1]+i*t.up[2]-e]}function lc(n,e,t,o,r){let i=n-t;return i>.5&&(i-=1),i<-0.5&&(i+=1),[i*r,(e-o)*r,0]}function Yi(n,e,t,o,r,i,a,l){let s=ji(ac(n,e),r,a);if(l<=0)return s;let c=lc(n,e,t,o,i);return [s[0]+(c[0]-s[0])*l,s[1]+(c[1]-s[1])*l,s[2]+(c[2]-s[2])*l]}function Xr(n,e,t){let o=n[0]*e[0]+n[1]*e[1]+n[2]*e[2],r=n[0]**2+n[1]**2+n[2]**2-t*t,i=o*o-r;if(i<0)return null;let a=-o-Math.sqrt(i);return a<0?null:[n[0]+e[0]*a,n[1]+e[1]*a,n[2]+e[2]*a]}var Zi=1e3,sc=2,Qi=84,cc=.42,Yt=class n{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=Ge(36.87);this._worldSize=512;this._pixelsPerMeter=1;this._cameraToCenterDistance=0;this._centerX=0;this._centerY=0;this._projMatrix=K();this._viewProjPx=K();this._viewMatrix=K();this._pixelMatrix=K();this._pixelMatrixInverse=K();this._cameraPosPx=[0,0,0];this._frustumPlanes=[];this._dirty=true;this.projection="mercator";this._f32=new Float32Array(16);this._tileMatrix=K();this._localView=K();this._localProj=K();this._localPixel=K();this._localPixelInverse=K();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=K();this._shadowView=K();this._shadowProj=K();this._shadowVP=K();this._shadowVPm=K();this._shadowTile=K();this._shadowObject=K();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=cc*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=_e(e,this.effectiveMinZoom(),this.maxZoom);t!==this._zoom&&(this._zoom=t,this._dirty=true);}get bearing(){return this._bearing}set bearing(e){let t=Bt(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<ct?Math.min(this.maxPitch,jt):this.maxPitch,o=_e(e,this.minPitch,t);o!==this._pitch&&(this._pitch=o,this._dirty=true);}get fov(){return Oi(this._fov)}set fov(e){let t=Ge(_e(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 n;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(ne(e.lng),ie(e.lat));a[2]+=t*this._pixelsPerMeter;let l=this.localToPoint(a);if(l)return l}let o=[ne(e.lng)*this._worldSize,ie(e.lat)*this._worldSize,t,1],r=[0,0,0,0];de(r,this._pixelMatrix,o);let i=r[3]||1e-9;return {x:r[0]/i,y:r[1]/i}}worldPxToPoint(e,t,o=0){if(this._ensure(),this.globeActive){let i=this.globeLocal(e/this._worldSize,t/this._worldSize),a={lng:Se(e/this._worldSize),lat:Fe(t/this._worldSize)};return this.isOnGlobeFront(a.lng,a.lat,0)?(i[2]+=o*this._pixelsPerMeter,this.localToPoint(i)):null}let r=[0,0,0,0];return de(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:Fe(t.y/this._worldSize)}}pointToWorldPx(e){this._ensure();let t=[0,0,0,0],o=[0,0,0,0];de(t,this._pixelMatrixInverse,[e.x,e.y,0,1]),de(o,this._pixelMatrixInverse,[e.x,e.y,1,1]);let r=t[3]||1e-9,i=o[3]||1e-9,a={x:t[0]/r,y:t[1]/r,z:t[2]/r},l={x:o[0]/i,y:o[1]/i,z:o[2]/i},s=l.z-a.z,c=Math.abs(s)<1e-9?1:(0-a.z)/s,h=_e(c,-1e6,1e6);return {x:a.x+(l.x-a.x)*h,y:a.y+(l.y-a.y)*h}}setLocationAtPoint(e,t){if(this._ensure(),this.globeActive){let l=this.globeUnproject(t);if(!l)return;let s=Bt(this._center.lng+(e.lng-l.lng)),c=_e(this._center.lat+(e.lat-l.lat),-Qi,Qi);this._center={lng:s,lat:c},this._dirty=true;return}let o=this.pointToWorldPx(t),r={x:ne(e.lng)*this._worldSize,y:ie(e.lat)*this._worldSize},i=r.x-o.x,a=r.y-o.y;this._center={lng:Se((this._centerX+i)/this._worldSize),lat:Fe((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,i=this._tileMatrix;return We(i,this._projMatrix,o.minX*this._worldSize,o.minY*this._worldSize,0),ze(i,i,r,r,1),je(this._f32,i)}tileMatrix64(e,t,o=K()){this._ensure();let r=e.bounds(),i=(r.maxX-r.minX)*this._worldSize/t;return We(o,this._projMatrix,r.minX*this._worldSize,r.minY*this._worldSize,0),ze(o,o,i,i,1),o}objectMatrix(e,t,o=0){this._ensure();let r=this._objectMatrix;return We(r,this._projMatrix,e*this._worldSize,t*this._worldSize,o),ze(r,r,this._worldSize,this._worldSize,1),je(this._objectF32,r)}horizonScreenY(){this._ensure();let e=Math.PI/2-Ge(this._pitch),o=this.height/2/Math.tan(this._fov/2)*Math.tan(Math.min(e,Ge(89.5)));return this.height/2-Math.min(o,this.height*50)}get globeActive(){return this._ensure(),this.projection==="globe"&&this._zoom<ct}get globeFlatMix(){return this._ensure(),jo(this._zoom)}get globeRadiusPx(){return this._ensure(),Xo(this._worldSize)}get globeBasis(){return this._ensure(),this._globeBasis}get localProjMatrix(){return this._ensure(),this._localProj}globeCamera(){this._ensure();let e=this.globeRadiusPx,t=K();if(!Ne(t,this._localView))return {dir:[0,0,1],horizonCos:1};let o=t[12],r=t[13],i=t[14]+e,a=Math.hypot(o,r,i)||1;return {dir:[o/a,r/a,i/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,i])=>{let a=[0,0,0,0],l=[0,0,0,0];de(a,this._localPixelInverse,[r,i,0,1]),de(l,this._localPixelInverse,[r,i,1,1]);let s=a[3]||1e-9,c=l[3]||1e-9,h=l[0]/c-a[0]/s,u=l[1]/c-a[1]/s,f=l[2]/c-a[2]/s,d=Math.hypot(h,u,f)||1;return [h/d,u/d,f/d]})}cameraRay(){this._ensure();let e=Ge(this._pitch),t=Ge(this._bearing),o=Math.sin(e),r=Math.cos(e),i=Math.sin(t),a=Math.cos(t);return {right:[a,i,0],up:[i*r,-a*r,o],fwd:[i*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(),je(this._localF32,this._localProj)}globeLocal(e,t){return this._ensure(),Yi(e,t,this._centerX/this._worldSize,this._centerY/this._worldSize,this.globeRadiusPx,this._worldSize,this._globeBasis,jo(this._zoom))}localToPoint(e){this._ensure();let t=[0,0,0,0];return de(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];de(t,this._localPixelInverse,[e.x,e.y,0,1]),de(o,this._localPixelInverse,[e.x,e.y,1,1]);let r=t[3]||1e-9,i=o[3]||1e-9,a=this.globeRadiusPx,l=[t[0]/r,t[1]/r,t[2]/r+a],s=[o[0]/i-l[0],o[1]/i-l[1],o[2]/i+a-l[2]],c=Math.hypot(s[0],s[1],s[2])||1,h=[s[0]/c,s[1]/c,s[2]/c],u=Xr(l,h,a);if(!u)return null;let f=this._globeBasis,d=[u[0]/a,u[1]/a,u[2]/a],p=[d[0]*f.east[0]+d[1]*f.south[0]+d[2]*f.up[0],d[0]*f.east[1]+d[1]*f.south[1]+d[2]*f.up[1],d[0]*f.east[2]+d[1]*f.south[2]+d[2]*f.up[2]];return Ur(p)}isOnGlobeFront(e,t,o=.06){this._ensure();let r=this.globeCamera(),i=this._globeBasis,a=Yo(e,t),l=[a[0]*i.east[0]+a[1]*i.east[1]+a[2]*i.east[2],a[0]*i.south[0]+a[1]*i.south[1]+a[2]*i.south[2],a[0]*i.up[0]+a[1]*i.up[1]+a[2]*i.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)*sc,r=K();if(!Ne(r,this._viewProjPx))return;let i=this._cameraPosPx,a=[],l=[0,0,0,0];for(let x of [-1,1])for(let w of [-1,1])for(let _ of [-1,1]){if(de(l,r,[x,w,_,1]),l[3]===0)continue;let C=l[0]/l[3],v=l[1]/l[3],E=C-i[0],D=v-i[1],F=Math.hypot(E,D);if(F>o){let H=o/F;C=i[0]+E*H,v=i[1]+D*H;}a.push({x:C,y:v,z:0});}if(!a.length)return;let s=Uo(e),c=Math.abs(s[2])>.999?[0,1,0]:[0,0,1],h=this._shadowView;Xi(h,[this._centerX,this._centerY,0],[this._centerX+s[0],this._centerY+s[1],s[2]],c);let u=Math.min(t*this._pixelsPerMeter,o),f=1/0,d=1/0,p=1/0,b=-1/0,m=-1/0,g=-1/0,y=[0,0,0,0];for(let x of a)for(let w of [0,u])de(y,h,[x.x,x.y,w,1]),y[0]<f&&(f=y[0]),y[0]>b&&(b=y[0]),y[1]<d&&(d=y[1]),y[1]>m&&(m=y[1]),y[2]<p&&(p=y[2]),y[2]>g&&(g=y[2]);let A=u+1,B=this._shadowProj;Ji(B,f,b,d,m,-g-A,-p+A),Ee(this._shadowVP,B,h),ze(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 We(r,this._shadowVPm,e*this._worldSize,t*this._worldSize,o),ze(r,r,this._worldSize,this._worldSize,1),je(this._shadowObject32,r)}shadowTileMatrix(e,t){this._ensure();let o=e.bounds(),r=(o.maxX-o.minX)*this._worldSize/t,i=this._shadowTile;return We(i,this._shadowVPm,o.minX*this._worldSize,o.minY*this._worldSize,0),ze(i,i,r,r,1),je(this._shadowTile32,i)}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,i=t.minY*this._worldSize,a=t.maxY*this._worldSize,l=Zi*this._pixelsPerMeter;for(let s of this._frustumPlanes){let c=s[0]>0?r:o,h=s[1]>0?a:i,u=s[2]>0?l:0;if(s[0]*c+s[1]*h+s[2]*u+s[3]<0)return false}return true}isSphereVisible(e,t,o,r){this._ensure();let i=e*this._worldSize,a=t*this._worldSize,l=o*this._pixelsPerMeter,s=r*this._pixelsPerMeter;for(let c of this._frustumPlanes)if(c[0]*i+c[1]*a+c[2]*l+c[3]<-s)return false;return true}distanceToTile(e){this._ensure();let t=e.bounds(),[o,r,i]=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-i,0,i-Zi*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=$e(this._zoom);this._worldSize=e,this._pixelsPerMeter=Or(1,this._center.lat)*e,this._centerX=ne(this._center.lng)*e,this._centerY=ie(this._center.lat)*e;let t=Math.max(this.width,1),o=Math.max(this.height,1),r=Ge(this._pitch),i=-Ge(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(_e(Math.PI-l-s,.01,Math.PI-.01)),h=Math.cos(Math.PI/2-r)*c+a,u=Math.min(h*1.01,a*30),f=o/50;if(this.projection==="globe"&&this._zoom<ct){let y=Xo(e);f=Math.max(a-y*1.6,a*.02),u=a+y*2.4;}let d=this._viewMatrix;ze(d,K(),1,-1,1),We(d,d,0,0,-a),Nr(d,d,r),Kr(d,d,i),We(d,d,-this._centerX,-this._centerY,0);let p=K();Ui(p,this._fov,t/o,f,u),Ee(this._viewProjPx,p,d);let b=K();ze(b,d,1,1,this._pixelsPerMeter),Ee(this._projMatrix,p,b);let m=this._localView;ze(m,K(),1,-1,1),We(m,m,0,0,-a),Nr(m,m,r),Kr(m,m,i),Ee(this._localProj,p,m),this._globeBasis=Jr(this._center.lng,this._center.lat);let g=K();ze(g,K(),t/2,-o/2,1),We(g,g,1,-1,0),Ee(this._pixelMatrix,g,this._projMatrix),Ne(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"),Ee(this._localPixel,g,this._localProj),Ne(this._localPixelInverse,this._localPixel),this._calcCameraPosition(),this._calcFrustum();}_calcCameraPosition(){let e=K();if(!Ne(e,this._viewMatrix)){this._cameraPosPx=[this._centerX,this._centerY,this._cameraToCenterDistance];return}this._cameraPosPx=[e[12],e[13],e[14]];}_calcFrustum(){let e=K();if(!Ne(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 h=[0,0,0,0];de(h,e,[c,s,l,1]);let u=h[3]||1e-9;t.push([h[0]/u,h[1]/u,h[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 h=t[l],u=t[s],f=t[c],d=u[0]-h[0],p=u[1]-h[1],b=u[2]-h[2],m=f[0]-h[0],g=f[1]-h[1],y=f[2]-h[2],A=p*y-b*g,B=b*m-d*y,x=d*g-p*m,w=Math.hypot(A,B,x)||1;A/=w,B/=w,x/=w;let _=new Float64Array(4);return _[0]=A,_[1]=B,_[2]=x,_[3]=-(A*h[0]+B*h[1]+x*h[2]),_});let r=0,i=0,a=0;for(let l of t)r+=l[0]/8,i+=l[1]/8,a+=l[2]/8;for(let l of this._frustumPlanes)l[0]*r+l[1]*i+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 i=Math.floor(r.x/this._worldSize);i<t&&(t=i),i>o&&(o=i);}return !isFinite(t)||!isFinite(o)?{min:0,max:0}:{min:_e(t,-3,3),max:_e(o,-3,3)}}};var fc={dragPan:true,scrollZoom:true,dragRotate:true,touchZoomRotate:true,touchPitch:true,doubleClickZoom:true,keyboard:true,inertia:1},qi=2,uc=100,hc=.5,dc=.1,pc=25,$i=n=>Math.abs(n.y)>Math.abs(n.x);function ta(n,e,t){let o=Math.hypot(n.x,n.y)>=qi,r=Math.hypot(e.x,e.y)>=qi;return !o&&!r?void 0:!o||!r?t<uc?void 0:false:n.y>0==e.y>0&&$i(n)&&$i(e)}function ea(n,e){let t=(n-e)*(180/Math.PI);for(;t>180;)t-=360;for(;t<=-180;)t+=360;return t}var mc=160,jr=4,Zo=class{constructor(e,t,o,r,i={}){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=_e(-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={...fc,...i},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,i=Math.hypot(o,r);this.touch={mode:void 0,lastA:e,lastB:t,startA:e,startB:t,startDist:i,startAngle:Math.atan2(r,o),minDist:i,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},i={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(i.x,i.y)>0)&&(e.firstMoveAt=performance.now());let a=e.pitchPossible&&this.opts.touchPitch?ta(r,i,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+i.y)/2;a!==0&&(this.tr.pitch=this.tr.pitch-a*hc,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),i=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",h=Math.hypot(e.lastB.x-e.lastA.x,e.lastB.y-e.lastA.y);if(r>0&&h>0&&e.startDist>0&&(!e.zoomActive&&Math.abs(Math.log2(r/e.startDist))>=dc&&(e.zoomActive=true),e.zoomActive)){let u=Math.log2(r/h);u!==0&&(this.tr.zoom=this.tr.zoom+u,c="zoom");}if(this.opts.dragRotate){e.minDist=Math.min(e.minDist,r);let u=pc/Math.max(Math.PI*e.minDist,1)*360;if(!e.rotateActive&&Math.abs(ea(i,e.startAngle))>=u&&(e.rotateActive=true),e.rotateActive){let f=Math.atan2(e.lastB.y-e.lastA.y,e.lastB.x-e.lastA.x),d=ea(i,f);d!==0&&(this.tr.bearing=this.tr.bearing-d,c==="pan"&&(c="rotate"));}}this.tr.setLocationAtPoint(s,l),this.onChange(c);}zoomAround(e,t){let o=this.tr.unproject(e);this.tr.zoom=this.tr.zoom+t,this.tr.setLocationAtPoint(o,e),this.onChange("zoom");}panBy(e,t,o){let r=this.tr.unproject(o);this.tr.setLocationAtPoint(r,{x:o.x-e,y:o.y-t}),this.onChange("pan");}rotateBy(e,t){e&&(this.tr.bearing=this.tr.bearing+e),t&&(this.tr.pitch=this.tr.pitch+t),this.onChange("rotate");}pushSample(e){let t=performance.now();for(this.samples.push({t,x:e.x,y:e.y});this.samples.length>2&&t-this.samples[0].t>mc;)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,i=(t.y-e.y)/o*this.opts.inertia,a=Math.hypot(r,i);if(a<.05)return;a>jr&&(r=r/a*jr,i=i/a*jr);let l=performance.now(),s=()=>{if(this.disposed)return;let c=performance.now(),h=Math.min(c-l,34);l=c;let u=Math.exp(-25e-4*h*10);if(r*=u,i*=u,Math.hypot(r,i)<.01){this.inertiaRaf=0,this.onInteractionEnd();return}let f={x:this.tr.width/2,y:this.tr.height/2};this.panBy(-r*h,-i*h,f),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 ve=class{constructor(e,t,o,r=false){this.ctx=e;this.layout=o;let i=e.gl,a=i.createBuffer();if(!a)throw new Error("[osmgl] createBuffer \u0432\u0435\u0440\u043D\u0443\u043B null");this.buffer=a,e.bindVAO(null),i.bindBuffer(i.ARRAY_BUFFER,a),i.bufferData(i.ARRAY_BUFFER,t,r?i.DYNAMIC_DRAW:i.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);}},ye=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);}},pe=class{constructor(e,t,o){this.ctx=e;let r=e.gl,i=r.createVertexArray();if(!i)throw new Error("[osmgl] createVertexArray \u0432\u0435\u0440\u043D\u0443\u043B null");this.vao=i,e.bindVAO(i);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 gc=["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"],Ae=class{constructor(e,t,o,r,i={}){this.ctx=e;this.name=t;this.uniforms=new z;this.attribs=new z;let a=e.gl,l=yc(i),s=ra(a,a.VERTEX_SHADER,oa(o,l),`${t}.vert`),c=ra(a,a.FRAGMENT_SHADER,oa(r,l),`${t}.frag`),h=a.createProgram();if(!h)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(h,s),a.attachShader(h,c),gc.forEach((u,f)=>a.bindAttribLocation(h,f,u)),a.linkProgram(h),a.detachShader(h,s),a.detachShader(h,c),a.deleteShader(s),a.deleteShader(c),!a.getProgramParameter(h,a.LINK_STATUS)){let u=a.getProgramInfoLog(h);throw a.deleteProgram(h),new Error(`[osmgl] \u043B\u0438\u043D\u043A\u043E\u0432\u043A\u0430 ${t} \u043D\u0435 \u043F\u0440\u043E\u0448\u043B\u0430: ${u}`)}this.program=h,this.cacheLocations();}cacheLocations(){let e=this.ctx.gl,t=e.getProgramParameter(this.program,e.ACTIVE_UNIFORMS);for(let r=0;r<t;r++){let i=e.getActiveUniform(this.program,r);if(!i)continue;let a=i.name.replace(/\[0\]$/,"");this.uniforms.set(a,e.getUniformLocation(this.program,i.name));}let o=e.getProgramParameter(this.program,e.ACTIVE_ATTRIBUTES);for(let r=0;r<o;r++){let i=e.getActiveAttrib(this.program,r);i&&this.attribs.set(i.name,e.getAttribLocation(this.program,i.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 i=this.loc(e);i&&this.ctx.gl.uniform3f(i,t,o,r);}setVec4(e,t,o,r,i){let a=this.loc(e);a&&this.ctx.gl.uniform4f(a,t,o,r,i);}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 yc(n){let e=[];for(let[t,o]of Object.entries(n))o!==false&&e.push(o===true?`#define ${t}`:`#define ${t} ${o}`);return e.join(`
|
|
2
|
+
`)}function oa(n,e){if(!e)return n;let t=n.match(/^\s*#version[^\n]*\n/);return t?n.slice(0,t[0].length)+e+`
|
|
3
3
|
`+n.slice(t[0].length):`${e}
|
|
4
|
-
${n}`}function
|
|
4
|
+
${n}`}function ra(n,e,t,o){let r=n.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(n.shaderSource(r,t),n.compileShader(r),!n.getShaderParameter(r,n.COMPILE_STATUS)){let i=n.getShaderInfoLog(r)??"";throw n.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
|
${i}
|
|
6
|
-
${
|
|
6
|
+
${Ac(t)}`)}return r}function Ac(n){return n.split(`
|
|
7
7
|
`).map((e,t)=>`${String(t+1).padStart(4)} | ${e}`).join(`
|
|
8
|
-
`)}var qt=new Set,jr=false;function Pe(n,e,t=2){let o=e&&e.length,r=o?e[0]*t:n.length;qt.size&&qt.clear();let i=na(n,0,r,t,true),a=[];if(!i||i.next===i.prev)return a;let s=0,l=0,c=0;if(o&&(i=Bc(n,e,i,t)),n.length>80*t){s=n[0],l=n[1];let u=s,h=l;for(let f=t;f<r;f+=t){let d=n[f],p=n[f+1];d<s&&(s=d),p<l&&(l=p),d>u&&(u=d),p>h&&(h=p);}c=Math.max(u-s,h-l),c=c!==0?32767/c:0;}return Yr(i,a,s,l,c),a}function na(n,e,t,o,r){let i=null;if(r===Tc(n,e,t,o)>0)for(let a=e;a<t;a+=o)i=ra(a/o|0,n[a],n[a+1],i);else for(let a=t-o;a>=e;a-=o)i=ra(a/o|0,n[a],n[a+1],i);return i&&$t(i,i.next)&&(to(i),i=i.next),i}function ut(n,e=n){let t=e===n,o=n,r;do r=false,o!==o.next&&(qt.size===0||!qt.has(o))&&($t(o,o.next)||pe(o.prev,o,o.next)===0)?((t||o===e)&&(e=o.prev),jr=true,to(o),o=o.prev,r=true):(t||o!==e)&&(o=o.next,r=!t);while(r||o!==e);return e}function Yr(n,e,t,o,r){r&&Fc(n,t,o,r);let i=n,a=false;for(;n.prev!==n.next;){let s=n.prev,l=n.next;if(pe(s,n,l)<0&&(r?yc(n,t,o,r):bc(n))){e.push(s.i,n.i,l.i),to(n),n=l,i=l;continue}if(n=l,n===i){if(jr=false,n=ut(n),jr){i=n;continue}if(!a){n=gc(n,e),i=n,a=true;continue}Ac(n,e,t,o,r);break}}}function bc(n){let e=n.prev,t=n,o=n.next,r=e.x,i=t.x,a=o.x,s=e.y,l=t.y,c=o.y,u=Math.min(r,i,a),h=Math.min(s,l,c),f=Math.max(r,i,a),d=Math.max(s,l,c),p=o.next;for(;p!==e;){if(p.x>=u&&p.x<=f&&p.y>=h&&p.y<=d&&!(r===p.x&&s===p.y)&&$o(r,s,i,l,a,c,p.x,p.y)&&pe(p.prev,p,p.next)>=0)return false;p=p.next;}return true}function yc(n,e,t,o){let r=n.prev,i=n,a=n.next,s=r.x,l=i.x,c=a.x,u=r.y,h=i.y,f=a.y,d=Math.min(s,l,c),p=Math.min(u,h,f),m=Math.max(s,l,c),y=Math.max(u,h,f),b=$r(d,p,e,t,o),g=$r(m,y,e,t,o),A=n.prevZ;for(;A&&A.z>=b;){if(A.x>=d&&A.x<=m&&A.y>=p&&A.y<=y&&A!==a&&!(s===A.x&&u===A.y)&&$o(s,u,l,h,c,f,A.x,A.y)&&pe(A.prev,A,A.next)>=0)return false;A=A.prevZ;}let B=n.nextZ;for(;B&&B.z<=g;){if(B.x>=d&&B.x<=m&&B.y>=p&&B.y<=y&&B!==a&&!(s===B.x&&u===B.y)&&$o(s,u,l,h,c,f,B.x,B.y)&&pe(B.prev,B,B.next)>=0)return false;B=B.nextZ;}return true}function gc(n,e){let t=n,o=false;do{let r=t.prev,i=t.next.next;sa(r,t,t.next,i,false)&&eo(r,i)&&eo(i,r)&&(e.push(r.i,t.i,i.i),to(t),to(t.next),t=n=i,o=true),t=t.next;}while(t!==n);return o?ut(t):t}function Ac(n,e,t,o,r){let i=n;do{let a=i.next.next;for(;a!==i.prev;){if(i.i!==a.i&&Sc(i,a)){let s=la(i,a);i=ut(i,i.next),s=ut(s,s.next),Yr(i,e,t,o,r),Yr(s,e,t,o,r);return}a=a.next;}i=i.next;}while(i!==n)}var Zr=false;function Bc(n,e,t,o){let r=[];for(let i=0,a=e.length;i<a;i++){let s=e[i]*o,l=i<a-1?e[i+1]*o:n.length,c=na(n,s,l,o,false);c===c.next&&qt.add(c),r.push(Dc(c));}r.sort(Cc),xc(n.length/o,e.length),aa(t,t),Zr=true;for(let i=0;i<r.length;i++)t=vc(r[i],t);return Zr=false,ut(t)}function Cc(n,e){return n.x-e.x||n.y-e.y||(n.next.y-n.y)/(n.next.x-n.x)-(e.next.y-e.y)/(e.next.x-e.x)}function vc(n,e){let t=_c(n,e);if(!t)return e;let o=la(t,n),r=o.next;return aa(t,r.next),ut(o,o.next),ut(t,t.next)}var ia=16,ce=new Float64Array(0),qo=0,Qr=[],qr=[];function xc(n,e){let t=Math.ceil((n+2*e)/ia)+e+2;ce.length<t*4&&(ce=new Float64Array(t*4)),qo=0;}function aa(n,e){let t=n;do{let o=qo++;Qr[o]=t;let r=1/0,i=1/0,a=-1/0,s=-1/0,l=0;do{let u=t.next;t.z=o,t.x<r&&(r=t.x),t.x>a&&(a=t.x),t.y<i&&(i=t.y),t.y>s&&(s=t.y),u.x<r&&(r=u.x),u.x>a&&(a=u.x),u.y<i&&(i=u.y),u.y>s&&(s=u.y),t=u;}while(++l<ia&&t!==e);qr[o]=t;let c=o*4;ce[c]=r,ce[c+1]=i,ce[c+2]=a,ce[c+3]=s;}while(t!==e)}function wc(n,e){let t=n.z*4;e.x<ce[t]&&(ce[t]=e.x),e.y<ce[t+1]&&(ce[t+1]=e.y),e.x>ce[t+2]&&(ce[t+2]=e.x),e.y>ce[t+3]&&(ce[t+3]=e.y);}function ta(n){let e=qr[n];for(;e.prev.next!==e;)e=e.next;return qr[n]=e,e}function oa(n){let e=Qr[n];for(;e.prev.next!==e;)e=e.next;return Qr[n]=e,e}function _c(n,e){let t=e,o=n.x,r=n.y,i=-1/0,a;if($t(n,t))return t;for(let f=0,d=0;f<qo;f++,d+=4){if(r<ce[d+1]||r>ce[d+3]||ce[d]>o||ce[d+2]<=i)continue;let p=ta(f);t=oa(f);do{if(t.prev.next===t){if($t(n,t.next))return t.next;if(r<=t.y&&r>=t.next.y&&t.next.y!==t.y){let m=t.x+(r-t.y)*(t.next.x-t.x)/(t.next.y-t.y);if(m<=o&&m>i&&(i=m,a=t.x<t.next.x?t:t.next,m===o))return a}}t=t.next;}while(t!==p)}if(!a)return null;let s=a.x,l=a.y,c=Math.min(r,l),u=Math.max(r,l),h=1/0;for(let f=0,d=0;f<qo;f++,d+=4){if(ce[d+2]<s||ce[d]>o||ce[d+3]<c||ce[d+1]>u)continue;let p=ta(f);t=oa(f);do{if(t.prev.next===t&&o>=t.x&&t.x>=s&&o!==t.x&&$o(r<l?o:i,r,s,l,r<l?i:o,r,t.x,t.y)){let m=Math.abs(r-t.y)/(o-t.x);(eo(t,n)||t.y===r&&t.next.y===r&&t.next.x>o)&&(m<h||m===h&&(t.x>a.x||t.x===a.x&&Ec(a,t)))&&(a=t,h=m);}t=t.next;}while(t!==p)}return a}function Ec(n,e){return pe(n.prev,n,e.prev)<0&&pe(e.next,n,n.next)<0}var ke=[],Yt=[],ft=new Uint32Array(0),Zt=new Uint32Array(0),Qt=new Uint32Array(256);function Fc(n,e,t,o){let r=n,i=0;do r.z=$r(r.x,r.y,e,t,o),ke[i++]=r,r=r.next;while(r!==n);Mc(i);let a=null;for(let s=0;s<i;s++){let l=ke[s];l.prevZ=a,a&&(a.nextZ=l),a=l;}a.nextZ=null;}function Mc(n){if(n<=32){for(let e=1;e<n;e++){let t=ke[e],o=t.z,r=e-1;for(;r>=0&&ke[r].z>o;)ke[r+1]=ke[r],r--;ke[r+1]=t;}return}ft.length<n&&(ft=new Uint32Array(n),Zt=new Uint32Array(n),Yt=new Array(n));for(let e=0;e<n;e++)ft[e]=ke[e].z;Zo(n,ke,ft,Yt,Zt,0),Zo(n,Yt,Zt,ke,ft,8),Zo(n,ke,ft,Yt,Zt,16),Zo(n,Yt,Zt,ke,ft,24);}function Zo(n,e,t,o,r,i){Qt.fill(0);for(let s=0;s<n;s++)Qt[t[s]>>>i&255]++;let a=0;for(let s=0;s<256;s++){let l=Qt[s];Qt[s]=a,a+=l;}for(let s=0;s<n;s++){let l=t[s],c=Qt[l>>>i&255]++;o[c]=e[s],r[c]=l;}}function $r(n,e,t,o,r){return n=(n-t)*r|0,e=(e-o)*r|0,n=(n|n<<8)&16711935,n=(n|n<<4)&252645135,n=(n|n<<2)&858993459,n=(n|n<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,n|e<<1}function Dc(n){let e=n,t=n;do(e.x<t.x||e.x===t.x&&e.y<t.y)&&(t=e),e=e.next;while(e!==n);return t}function $o(n,e,t,o,r,i,a,s){return (r-a)*(e-s)>=(n-a)*(i-s)&&(n-a)*(o-s)>=(t-a)*(e-s)&&(t-a)*(i-s)>=(r-a)*(o-s)}function Sc(n,e){let t=$t(n,e)&&pe(n.prev,n,n.next)>0&&pe(e.prev,e,e.next)>0;return n.next.i!==e.i&&(t||eo(n,e)&&eo(e,n)&&(pe(n.prev,n,e.prev)!==0||pe(n,e.prev,e)!==0))&&!Ic(n,e)&&(t||Lc(n,e))}function pe(n,e,t){return (e.y-n.y)*(t.x-e.x)-(e.x-n.x)*(t.y-e.y)}function $t(n,e){return n.x===e.x&&n.y===e.y}function sa(n,e,t,o,r=true){let i=pe(n,e,t),a=pe(n,e,o),s=pe(t,o,n),l=pe(t,o,e);return (i>0&&a<0||i<0&&a>0)&&(s>0&&l<0||s<0&&l>0)?true:r?!!(i===0&&Qo(n,t,e)||a===0&&Qo(n,o,e)||s===0&&Qo(t,n,o)||l===0&&Qo(t,e,o)):false}function Qo(n,e,t){return e.x<=Math.max(n.x,t.x)&&e.x>=Math.min(n.x,t.x)&&e.y<=Math.max(n.y,t.y)&&e.y>=Math.min(n.y,t.y)}function Ic(n,e){let t=Math.min(n.x,e.x),o=Math.max(n.x,e.x),r=Math.min(n.y,e.y),i=Math.max(n.y,e.y),a=n;do{let s=a.next;if(a.x>o&&s.x>o||a.x<t&&s.x<t||a.y>i&&s.y>i||a.y<r&&s.y<r){a=s;continue}if(a.i!==n.i&&s.i!==n.i&&a.i!==e.i&&s.i!==e.i&&sa(a,s,n,e))return true;a=s;}while(a!==n);return false}function eo(n,e){return pe(n.prev,n,n.next)<0?pe(n,e,n.next)>=0&&pe(n,n.prev,e)>=0:pe(n,e,n.prev)<0||pe(n,n.next,e)<0}function Lc(n,e){let t=n,o=false,r=(n.x+e.x)/2,i=(n.y+e.y)/2;do{let a=t.next;t.y>i!=a.y>i&&r<(a.x-t.x)*(i-t.y)/(a.y-t.y)+t.x&&(o=!o),t=a;}while(t!==n);return o}function la(n,e){let t=en(n.i,n.x,n.y),o=en(e.i,e.x,e.y),r=n.next,i=e.prev;return n.next=e,e.prev=n,t.next=r,r.prev=t,o.next=t,t.prev=o,i.next=o,o.prev=i,o}function ra(n,e,t,o){let r=en(n,e,t);return o?(r.next=o.next,r.prev=o,o.next.prev=r,o.next=r):(r.prev=r,r.next=r),r}function to(n){n.next.prev=n.prev,n.prev.next=n.next,n.prevZ&&(n.prevZ.nextZ=n.nextZ),n.nextZ&&(n.nextZ.prevZ=n.prevZ),Zr&&wc(n.prev,n.next);}function en(n,e,t){return {i:n,x:e,y:t,prev:null,next:null,z:0,prevZ:null,nextZ:null}}function Tc(n,e,t,o){let r=0;for(let i=e,a=t-o;i<t;i+=o)r+=(n[a]-n[i])*(n[i+1]+n[a+1]),a=i;return r}var ca=23283064365386963e-26,Hc=12,fa=typeof TextDecoder>"u"?null:new TextDecoder("utf-8"),tn=0,er=1,oo=2,tr=5,ht=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,t,o=this.length){for(;this.pos<o;){let r=this.readVarint(),i=r>>3,a=this.pos;this.type=r&7,e(i,t,this),this.pos===a&&this.skip(r);}return t}readMessage(e,t){return this.readFields(e,t,this.readVarint()+this.pos)}readFixed32(){let e=this.dataView.getUint32(this.pos,true);return this.pos+=4,e}readSFixed32(){let e=this.dataView.getInt32(this.pos,true);return this.pos+=4,e}readFixed64(){let e=this.dataView.getUint32(this.pos,true)+this.dataView.getUint32(this.pos+4,true)*4294967296;return this.pos+=8,e}readSFixed64(){let e=this.dataView.getUint32(this.pos,true)+this.dataView.getInt32(this.pos+4,true)*4294967296;return this.pos+=8,e}readFloat(){let e=this.dataView.getFloat32(this.pos,true);return this.pos+=4,e}readDouble(){let e=this.dataView.getFloat64(this.pos,true);return this.pos+=8,e}readVarint(e){let t=this.buf,o,r;return r=t[this.pos++],o=r&127,r<128||(r=t[this.pos++],o|=(r&127)<<7,r<128)||(r=t[this.pos++],o|=(r&127)<<14,r<128)||(r=t[this.pos++],o|=(r&127)<<21,r<128)?o:(r=t[this.pos],o|=(r&15)<<28,kc(o,e,this))}readVarint64(){return this.readVarint(true)}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,t=this.pos;return this.pos=e,e-t>=Hc&&fa?fa.decode(this.buf.subarray(t,e)):jc(this.buf,t,e)}readBytes(){let e=this.readVarint()+this.pos,t=this.buf.subarray(this.pos,e);return this.pos=e,t}readPackedVarint(e=[],t){let o=this.readPackedEnd();for(;this.pos<o;)e.push(this.readVarint(t));return e}readPackedSVarint(e=[]){let t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readSVarint());return e}readPackedBoolean(e=[]){let t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readBoolean());return e}readPackedFloat(e=[]){let t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readFloat());return e}readPackedDouble(e=[]){let t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readDouble());return e}readPackedFixed32(e=[]){let t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readFixed32());return e}readPackedSFixed32(e=[]){let t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readSFixed32());return e}readPackedFixed64(e=[]){let t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readFixed64());return e}readPackedSFixed64(e=[]){let t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readSFixed64());return e}readPackedEnd(){return this.type===oo?this.readVarint()+this.pos:this.pos+1}skip(e){let t=e&7;if(t===tn)for(;this.buf[this.pos++]>127;);else if(t===oo)this.pos=this.readVarint()+this.pos;else if(t===tr)this.pos+=4;else if(t===er)this.pos+=8;else throw new Error(`Unimplemented type: ${t}`)}writeTag(e,t){this.writeVarint(e<<3|t);}realloc(e){let t=this.length||16;for(;t<this.pos+e;)t*=2;if(t!==this.length){let o=new Uint8Array(t);o.set(this.buf),this.buf=o,this.dataView=new DataView(o.buffer),this.length=t;}}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,true),this.pos+=4;}writeSFixed32(e){this.realloc(4),this.dataView.setInt32(this.pos,e,true),this.pos+=4;}writeFixed64(e){this.realloc(8),this.dataView.setInt32(this.pos,e&-1,true),this.dataView.setInt32(this.pos+4,Math.floor(e*ca),true),this.pos+=8;}writeSFixed64(e){this.realloc(8),this.dataView.setInt32(this.pos,e&-1,true),this.dataView.setInt32(this.pos+4,Math.floor(e*ca),true),this.pos+=8;}writeVarint(e){if(e=+e||0,e>268435455||e<0){Pc(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 t=this.pos;this.pos=Yc(this.buf,e,this.pos);let o=this.pos-t;o>=128&&ua(t,o,this),this.pos=t-1,this.writeVarint(o),this.pos+=o;}writeFloat(e){this.realloc(4),this.dataView.setFloat32(this.pos,e,true),this.pos+=4;}writeDouble(e){this.realloc(8),this.dataView.setFloat64(this.pos,e,true),this.pos+=8;}writeBytes(e){let t=e.length;this.writeVarint(t),this.realloc(t);for(let o=0;o<t;o++)this.buf[this.pos++]=e[o];}writeRawMessage(e,t){this.pos++;let o=this.pos;e(t,this);let r=this.pos-o;r>=128&&ua(o,r,this),this.pos=o-1,this.writeVarint(r),this.pos+=r;}writeMessage(e,t,o){this.writeTag(e,oo),this.writeRawMessage(t,o);}writePackedVarint(e,t){t.length&&this.writeMessage(e,Oc,t);}writePackedSVarint(e,t){t.length&&this.writeMessage(e,Wc,t);}writePackedBoolean(e,t){t.length&&this.writeMessage(e,Nc,t);}writePackedFloat(e,t){t.length&&this.writeMessage(e,Vc,t);}writePackedDouble(e,t){t.length&&this.writeMessage(e,zc,t);}writePackedFixed32(e,t){t.length&&this.writeMessage(e,Kc,t);}writePackedSFixed32(e,t){t.length&&this.writeMessage(e,Uc,t);}writePackedFixed64(e,t){t.length&&this.writeMessage(e,Jc,t);}writePackedSFixed64(e,t){t.length&&this.writeMessage(e,Xc,t);}writeBytesField(e,t){this.writeTag(e,oo),this.writeBytes(t);}writeFixed32Field(e,t){this.writeTag(e,tr),this.writeFixed32(t);}writeSFixed32Field(e,t){this.writeTag(e,tr),this.writeSFixed32(t);}writeFixed64Field(e,t){this.writeTag(e,er),this.writeFixed64(t);}writeSFixed64Field(e,t){this.writeTag(e,er),this.writeSFixed64(t);}writeVarintField(e,t){this.writeTag(e,tn),this.writeVarint(t);}writeSVarintField(e,t){this.writeTag(e,tn),this.writeSVarint(t);}writeStringField(e,t){this.writeTag(e,oo),this.writeString(t);}writeFloatField(e,t){this.writeTag(e,tr),this.writeFloat(t);}writeDoubleField(e,t){this.writeTag(e,er),this.writeDouble(t);}writeBooleanField(e,t){this.writeVarintField(e,+t);}};function kc(n,e,t){let o=t.buf,r,i;if(i=o[t.pos++],r=(i&112)>>4,i<128||(i=o[t.pos++],r|=(i&127)<<3,i<128)||(i=o[t.pos++],r|=(i&127)<<10,i<128)||(i=o[t.pos++],r|=(i&127)<<17,i<128)||(i=o[t.pos++],r|=(i&127)<<24,i<128)||(i=o[t.pos++],r|=(i&1)<<31,i<128))return Ct(n,r,e);throw new Error("Expected varint not more than 10 bytes")}function Ct(n,e,t){return t?e*4294967296+(n>>>0):(e>>>0)*4294967296+(n>>>0)}function Pc(n,e){let t,o;if(n>=0?(t=n%4294967296|0,o=n/4294967296|0):(t=~(-n%4294967296),o=~(-n/4294967296),t^4294967295?t=t+1|0:(t=0,o=o+1|0)),n>=18446744073709552e3||n<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");e.realloc(10),Rc(t,o,e),Gc(o,e);}function Rc(n,e,t){t.buf[t.pos++]=n&127|128,n>>>=7,t.buf[t.pos++]=n&127|128,n>>>=7,t.buf[t.pos++]=n&127|128,n>>>=7,t.buf[t.pos++]=n&127|128,n>>>=7,t.buf[t.pos]=n&127;}function Gc(n,e){let t=(n&7)<<4;e.buf[e.pos++]|=t|((n>>>=3)?128:0),n&&(e.buf[e.pos++]=n&127|((n>>>=7)?128:0),n&&(e.buf[e.pos++]=n&127|((n>>>=7)?128:0),n&&(e.buf[e.pos++]=n&127|((n>>>=7)?128:0),n&&(e.buf[e.pos++]=n&127|((n>>>=7)?128:0),n&&(e.buf[e.pos++]=n&127)))));}function ua(n,e,t){let o=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(Math.LN2*7));t.realloc(o);for(let r=t.pos-1;r>=n;r--)t.buf[r+o]=t.buf[r];}function Oc(n,e){for(let t=0;t<n.length;t++)e.writeVarint(n[t]);}function Wc(n,e){for(let t=0;t<n.length;t++)e.writeSVarint(n[t]);}function Vc(n,e){for(let t=0;t<n.length;t++)e.writeFloat(n[t]);}function zc(n,e){for(let t=0;t<n.length;t++)e.writeDouble(n[t]);}function Nc(n,e){for(let t=0;t<n.length;t++)e.writeBoolean(n[t]);}function Kc(n,e){for(let t=0;t<n.length;t++)e.writeFixed32(n[t]);}function Uc(n,e){for(let t=0;t<n.length;t++)e.writeSFixed32(n[t]);}function Jc(n,e){for(let t=0;t<n.length;t++)e.writeFixed64(n[t]);}function Xc(n,e){for(let t=0;t<n.length;t++)e.writeSFixed64(n[t]);}function jc(n,e,t){let o="",r=e;for(;r<t;){let i=n[r],a=null,s=i>239?4:i>223?3:i>191?2:1;if(r+s>t)break;let l,c,u;s===1?i<128&&(a=i):s===2?(l=n[r+1],(l&192)===128&&(a=(i&31)<<6|l&63,a<=127&&(a=null))):s===3?(l=n[r+1],c=n[r+2],(l&192)===128&&(c&192)===128&&(a=(i&15)<<12|(l&63)<<6|c&63,(a<=2047||a>=55296&&a<=57343)&&(a=null))):s===4&&(l=n[r+1],c=n[r+2],u=n[r+3],(l&192)===128&&(c&192)===128&&(u&192)===128&&(a=(i&15)<<18|(l&63)<<12|(c&63)<<6|u&63,(a<=65535||a>=1114112)&&(a=null))),a===null?(a=65533,s=1):a>65535&&(a-=65536,o+=String.fromCharCode(a>>>10&1023|55296),a=56320|a&1023),o+=String.fromCharCode(a),r+=s;}return o}function Yc(n,e,t){for(let o=0,r,i;o<e.length;o++){if(r=e.charCodeAt(o),r>55295&&r<57344)if(i)if(r<56320){n[t++]=239,n[t++]=191,n[t++]=189,i=r;continue}else r=i-55296<<10|r-56320|65536,i=null;else {r>56319||o+1===e.length?(n[t++]=239,n[t++]=191,n[t++]=189):i=r;continue}else i&&(n[t++]=239,n[t++]=191,n[t++]=189,i=null);r<128?n[t++]=r:(r<2048?n[t++]=r>>6|192:(r<65536?n[t++]=r>>12|224:(n[t++]=r>>18|240,n[t++]=r>>12&63|128),n[t++]=r>>6&63|128),n[t++]=r&63|128);}return t}var no=(r=>(r[r.Unknown=0]="Unknown",r[r.Point=1]="Point",r[r.LineString=2]="LineString",r[r.Polygon=3]="Polygon",r))(no||{}),or=class n{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,i){let a=new n(e,o,r,i);return e.readFields(Zc,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,i=0,a=0,s=0,l=[],c=[];for(;e.pos<o;){if(i<=0){let u=e.readVarint();r=u&7,i=u>>3;}if(i--,r===1||r===2)a+=e.readSVarint(),s+=e.readSVarint(),r===1&&(c.length&&l.push(c),c=[]),c.push(a,s);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&&l.push(c),e.pos=t,l}bbox(){let e=this.loadGeometry(),t=1/0,o=1/0,r=-1/0,i=-1/0;for(let a of e)for(let s=0;s<a.length;s+=2)a[s]<t&&(t=a[s]),a[s]>r&&(r=a[s]),a[s+1]<o&&(o=a[s+1]),a[s+1]>i&&(i=a[s+1]);return [t,o,r,i]}};function Zc(n,e,t){t&&(n===1?e.id=t.readVarint():n===2?Qc(t,e):n===3?e.type=t.readVarint():n===4&&(e.geomOffset=t.pos,t.skip(2)));}function Qc(n,e){let t=n.readVarint()+n.pos;for(;n.pos<t;){let o=e.keys[n.readVarint()],r=e.values[n.readVarint()];o!==void 0&&(e.properties[o]=r);}}var rr=class n{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 n(e);return e.readFields(qc,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 or.read(t,o,this.keys,this.values,this.extent)}*features(){for(let e=0;e<this.featureOffsets.length;e++)yield this.feature(e);}};function qc(n,e,t){t&&(n===15?e.version=t.readVarint():n===1?e.name=t.readString():n===5?e.extent=t.readVarint():n===2?e.featureOffsets.push(t.pos):n===3?e.keys.push(t.readString()):n===4&&e.values.push($c(t)));}function $c(n){let e=n.readVarint()+n.pos,t=null;for(;n.pos<e;){let o=n.readVarint()>>3;o===1?t=n.readString():o===2?t=n.readFloat():o===3?t=n.readDouble():o===4?t=n.readVarint64():o===5?t=n.readVarint():o===6?t=n.readSVarint():o===7?t=n.readBoolean():n.skip(o);}return t}var ro=class{constructor(e){this.layers={};new ht(e instanceof Uint8Array?e:new Uint8Array(e)).readFields((o,r,i)=>{if(o===3&&i){let a=rr.read(i,i.readVarint()+i.pos);a.length&&(this.layers[a.name]=a);}},null);}};function dt(n){let e=[],t=null;for(let o of n){if(o.length<6)continue;let r=ef(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 ef(n){let e=0;for(let t=0,o=n.length-2;t<n.length;o=t,t+=2)e+=(n[o]-n[t])*(n[t+1]+n[o+1]);return e/2}function z(n,e,t){return n===void 0?t:typeof n=="number"?n:ha(n.stops,e,(o,r,i)=>o+(r-o)*i,t)}function He(n,e,t){return n===void 0?t:typeof n=="string"?ye(n):ha(n.stops,e,(o,r,i)=>{let a=ye(o),s=ye(r);return [a[0]+(s[0]-a[0])*i,a[1]+(s[1]-a[1])*i,a[2]+(s[2]-a[2])*i,a[3]+(s[3]-a[3])*i]},t)}function ha(n,e,t,o){if(!n.length)return o;if(e<=n[0][0])return t(n[0][1],n[0][1],0);let r=n[n.length-1];if(e>=r[0])return t(r[1],r[1],0);for(let i=1;i<n.length;i++){let[a,s]=n[i];if(e>a)continue;let[l,c]=n[i-1],u=a-l,h=u===0?0:(e-l)/u;return t(c,s,h)}return o}function Be(n,e){if(!n)return true;let t=n[0];switch(t){case "all":return n.slice(1).every(o=>Be(o,e));case "any":return n.slice(1).some(o=>Be(o,e));case "!":return !Be(n[1],e);case "has":return e[n[1]]!=null;case "!has":return e[n[1]]==null;case "in":{let o=e[n[1]];return o==null?false:n.slice(2).includes(o)}case "!in":{let o=e[n[1]];return o==null?true:!n.slice(2).includes(o)}default:{let o=e[n[1]],r=n[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 tf=Math.PI/8,of=.35,rf=32,da=.25,pa=.5,ma=.07;function ze(n,e){let t=e.radius;if(!(t>0))return n;let o=n.length/2-1;if(o<3)return n;let r=Math.max(2,Math.round(e.segments??4)),i=Math.max(e.minCutRatio??of,0),a=e.extent,s=e.margin??0,l=[];for(let c=0;c<o;c++){let u=n[c*2],h=n[c*2+1],f=n[(c+o-1)%o*2],d=n[(c+o-1)%o*2+1],p=n[(c+1)%o*2],m=n[(c+1)%o*2+1],y=u-f,b=h-d,g=p-u,A=m-h,B=Math.hypot(y,b),x=Math.hypot(g,A);if(B<1e-6||x<1e-6){l.push(u,h);continue}let w=y/B,_=b/B,C=g/x,v=A/x;if(e.keep?.[c]){l.push(u,h);continue}let E=w*C+_*v;if(E>.985){l.push(u,h);continue}if(a!==void 0&&(on(u,h,a,s)||on(f,d,a,s)||on(p,m,a,s))){l.push(u,h);continue}let D=Math.min(t,B*.4,x*.4);if(D<t*i){l.push(u,h);continue}let M=u-w*D,H=h-_*D,S=u+C*D,L=h+v*D,F=Math.acos(Math.max(-1,Math.min(1,E))),T=Math.min(tf,Math.PI/2/r),P=Math.ceil(F/T-1e-6),k=e.maxChord&&e.maxChord>0?Math.ceil(D/Math.tan(F/2)*F/e.maxChord):0,O=Math.max(1,Math.min(rf,Math.max(Math.min(r,P),k)));l.push(M,H);for(let N=1;N<O;N++){let G=N/O,R=1-G;l.push(R*R*M+2*R*G*u+G*G*S,R*R*H+2*R*G*h+G*G*L);}l.push(S,L);}return l.length<6?n:(l.push(l[0],l[1]),l)}var on=(n,e,t,o)=>n<=-o||e<=-o||n>=t+o||e>=t+o;var Xe=n=>n/64;function vt(n,e,t=0){let o=ba(n.outer,e,t);if(!o)return null;let r=[];for(let i of n.holes){let a=ba(i,e,t);a&&r.push(a);}return {outer:o,holes:r}}function ba(n,e,t){let o=[];for(let r=0;r<n.length-2;r+=2)o.push(n[r],n[r+1]);if(o.length<6)return null;for(let r=0;r<4;r++){let i=o;o=[];let a=i.length/2;if(a===0)return null;for(let s=0;s<a;s++){let l=i[s*2],c=i[s*2+1],u=i[(s+a-1)%a*2],h=i[(s+a-1)%a*2+1],f=ya(l,c,r,e,t),d=ya(u,h,r,e,t);if(f!==d){let p=nf(u,h,l,c,r,e,t);o.push(u+(l-u)*p,h+(c-h)*p);}f&&o.push(l,c);}}return o.length<6?null:(o.push(o[0],o[1]),o)}function ya(n,e,t,o,r){return t===0?n>=-r:t===1?n<=o+r:t===2?e>=-r:e<=o+r}function nf(n,e,t,o,r,i,a){return r===0?(-a-n)/(t-n):r===1?(i+a-n)/(t-n):r===2?(-a-e)/(o-e):(i+a-e)/(o-e)}function nr(n,e,t,o,r,i=0){let a=-i,s=r+i;return n===a&&t===a||n===s&&t===s||e===a&&o===a||e===s&&o===s}function ga(n,e){for(let t=0;t<n.length;t+=2)if(n[t]<=0||n[t]>=e||n[t+1]<=0||n[t+1]>=e)return true;return false}var Ie=18,Et=32,_t=8,xa=65535/Et,af=9,sf=1,lf=0,cf=1,ff=2;var Aa=0,uf=1,Ba=2,hf=3,df=.47;function an(n,e,t,o={}){let r=o.metersPerUnit&&o.metersPerUnit>0?o.metersPerUnit:df,i=Math.max(1024,n.length*48),a=new ArrayBuffer(i*Ie),s={verts:new DataView(a),vertsU8:new Uint8Array(a),vertOffset:0,vertexCount:0,indices:[],featureIds:[],ensure:()=>{}};s.ensure=f=>l(f);let l=f=>{if(s.vertexCount+f<=i)return;i=Math.max(i*2,s.vertexCount+f);let d=new ArrayBuffer(i*Ie);new Uint8Array(d).set(s.vertsU8.subarray(0,s.vertOffset)),a=d,s.verts=new DataView(d),s.vertsU8=new Uint8Array(d);};for(let f of n.features()){if(f.type!==3||!Be(t,f.properties))continue;let d=Hf(f.properties),p=kf(f.properties,d);if(d<=p)continue;let m=Rf(f.properties)??Number(f.id??0),y=Tf(m>>>0),b=Lf(y,f.properties),g=If(f.properties,d),A=dt(f.loadGeometry());for(let B of A){let x=vt(B,e);if(!x)continue;let w=ga(x.outer,e),_=(o.cornerRadius??0)/r,C={radius:_,segments:o.cornerSegments,extent:e,minCutRatio:0,maxChord:r>0?pa/r:0},v=_>0?{outer:ze(x.outer,C),holes:x.holes.map(L=>ze(L,C))}:x,E=v.outer.length/2+v.holes.reduce((L,F)=>L+F.length/2,0);l(E*5+32);let D=v.holes.length||w?null:yf(v.outer),M=D?xf(f.properties,D,d,y,r):null,H=null,S=[];if(M&&D){let L=wa(Ef(v.outer,r),D,M.shape);S=Ff(L,v.outer);let F=Mf(L,S);if(F>1e-6){let T=Math.min(Math.max(F*r*Bf,vf),Cf);H=Df(L,T/F,d);}}va(s,v.outer,p,d,m,b,g,r,e,H);for(let L of v.holes)va(s,L,p,d,m,b,g,r,e,null);H?Sf(s,S,H,d,m,b,g,r):bf(s,v.outer,v.holes,d,m,b,g);}}if(!s.indices.length)return null;let c=new Uint32Array(s.indices),u=new Float64Array(s.featureIds);return {vertices:a.slice(0,s.vertOffset),indices:c.buffer,featureIds:u.buffer,vertexCount:s.vertexCount,indexCount:c.length,extent:e}}var sn=(n,e)=>n|e<<2,Ca=n=>Math.max(-32768,Math.min(32767,n)),rn=n=>Math.max(0,Math.min(65535,Math.round(Math.min(n,xa)*Et)));function xt(n,e,t,o,r,i,a,s,l,c,u=0,h=0,f=0){let d=n.vertOffset;return n.verts.setInt16(d,Ca(Math.round(e*_t)),true),n.verts.setInt16(d+2,Ca(Math.round(t*_t)),true),n.verts.setUint16(d+4,Math.round(Math.min(o,xa)*Et),true),n.vertsU8[d+6]=l,n.vertsU8[d+7]=s,n.verts.setInt8(d+8,nn(Math.round(r*127))),n.verts.setInt8(d+9,nn(Math.round(i*127))),n.verts.setInt8(d+10,nn(Math.round(a*127))),n.vertsU8[d+11]=c,n.verts.setUint16(d+12,rn(u),true),n.verts.setUint16(d+14,rn(h),true),n.verts.setUint16(d+16,rn(f),true),n.vertOffset+=Ie,n.vertexCount++}function va(n,e,t,o,r,i,a,s,l,c=null){let u=e.length/2;if(u<3)return;let h=sn(lf,a),f=mf(e,s),d=o-t,p=new Float64Array(u*2),m=new Uint8Array(u);{let y=new Float64Array(u*2);for(let b=0;b<u-1;b++){let g=e[b*2+2]-e[b*2],A=e[b*2+3]-e[b*2+1],B=Math.hypot(g,A)||1;y[b*2]=A/B,y[b*2+1]=-g/B;}for(let b=0;b<u-1;b++){let g=(b+u-2)%(u-1),A=y[g*2]*y[b*2]+y[g*2+1]*y[b*2+1],B=y[g*2]+y[b*2],x=y[g*2+1]+y[b*2+1],w=Math.hypot(B,x);A>.5&&w>1e-6&&(p[b*2]=B/w,p[b*2+1]=x/w,m[b]=1);}}for(let y=0;y<u-1;y++){let b=e[y*2],g=e[y*2+1],A=e[y*2+2],B=e[y*2+3];if(b===A&&g===B||nr(b,g,A,B,l))continue;let x=A-b,w=B-g,_=Math.hypot(x,w)||1,C=w/_,v=-x/_,E=f.offset[y],D=f.width[y],M=[0,1];if(c){for(let S=0;S<c.length;S++)for(let L=S+1;L<c.length;L++){let F=pt(c[S],b,g)-pt(c[L],b,g),T=pt(c[S],A,B)-pt(c[L],A,B);if(F===T)continue;let P=F/(F-T);P>1e-4&&P<1-1e-4&&M.push(P);}M.sort((S,L)=>S-L);}let H=(S,L)=>{if(!c)return o;let F=1/0;for(let T of c)F=Math.min(F,pt(T,S,L));return Math.max(o,F)};for(let S=0;S+1<M.length;S++){let L=M[S],F=M[S+1];if(F-L<1e-6)continue;let T=b+x*L,P=g+w*L,k=b+x*F,O=g+w*F,N=E+_*L*s,G=E+_*F*s,R=(y+1)%(u-1),V=m[y]?p[y*2]:C,j=m[y]?p[y*2+1]:v,Z=m[R]?p[R*2]:C,ee=m[R]?p[R*2+1]:v,be=C+(V-C)*(1-L),te=v+(j-v)*(1-L),X=C+(Z-C)*F,re=v+(ee-v)*F,se=Math.hypot(be,te)||1,q=Math.hypot(X,re)||1,U=be/se,J=te/se,fe=X/q,le=re/q;n.ensure(4);let ue=xt(n,T,P,t,U,J,0,0,i,h,N,D,d),ne=xt(n,k,O,t,fe,le,0,0,i,h,G,D,d),xe=xt(n,T,P,H(T,P),U,J,0,255,i,h,N,D,d),Te=xt(n,k,O,H(k,O),fe,le,0,255,i,h,G,D,d);n.indices.push(ue,Te,ne,ue,xe,Te),n.featureIds.push(r,r);}}}var pf=.9976;function mf(n,e){let t=n.length/2-1,o=[];for(let l=0;l<t;l++){let c=n[l*2+2]-n[l*2],u=n[l*2+3]-n[l*2+1],h=Math.hypot(c,u);o.push(h>0?{x:c/h,y:u/h,len:h*e}:{x:0,y:0,len:0});}let r=(l,c)=>o[l].len>0&&o[c].len>0&&o[l].x*o[c].x+o[l].y*o[c].y>=pf,i=0;for(;i<t&&r((i-1+t)%t,i);)i++;i>=t&&(i=0);let a=new Array(t).fill(0),s=new Array(t).fill(0);for(let l=0;l<t;){let c=(i+l)%t,u=[c],h=o[c].len,f=l+1;for(;f<t;){let p=(i+f)%t;if(!r((i+f-1)%t,p))break;u.push(p),h+=o[p].len,f++;}let d=0;for(let p of u)a[p]=d,s[p]=h,d+=o[p].len;l=f;}return {offset:a,width:s}}function bf(n,e,t,o,r,i,a){let s=[],l=[];for(let f=0;f<e.length;f++)s.push(e[f]);for(let f of t){l.push(s.length/2);for(let d=0;d<f.length;d++)s.push(f[d]);}let c=Pe(s,l.length?l:void 0,2);if(!c.length)return;let u=sn(cf,a),h=n.vertexCount;for(let f=0;f<s.length;f+=2)xt(n,s[f],s[f+1],o,0,0,1,255,i,u);for(let f=0;f<c.length;f+=3)n.indices.push(h+c[f],h+c[f+2],h+c[f+1]),n.featureIds.push(r);}function yf(n){let e=gf(n);if(e.length<3)return null;let t=Math.abs(Af(n));if(t<=0)return null;let o=null,r=1/0;for(let i=0;i<e.length;i++){let a=(i+1)%e.length,s=e[a].x-e[i].x,l=e[a].y-e[i].y,c=Math.hypot(s,l);if(c<1e-6)continue;s/=c,l/=c;let u=1/0,h=-1/0,f=1/0,d=-1/0;for(let B of e){let x=B.x*s+B.y*l,w=-B.x*l+B.y*s;x<u&&(u=x),x>h&&(h=x),w<f&&(f=w),w>d&&(d=w);}let p=h-u,m=d-f,y=p*m;if(y<=0||y>=r)continue;r=y;let b=(u+h)/2,g=(f+d)/2,A=p>=m;o={cx:b*s-g*l,cy:b*l+g*s,ax:A?s:-l,ay:A?l:s,halfLong:(A?p:m)/2,halfShort:(A?m:p)/2,fill:t/y};}return o}function gf(n){let e=[];for(let i=0;i<n.length-2;i+=2)e.push({x:n[i],y:n[i+1]});if(e.length<3)return e;e.sort((i,a)=>i.x===a.x?i.y-a.y:i.x-a.x);let t=(i,a,s)=>(a.x-i.x)*(s.y-i.y)-(a.y-i.y)*(s.x-i.x),o=[];for(let i of e){for(;o.length>=2&&t(o[o.length-2],o[o.length-1],i)<=0;)o.pop();o.push(i);}let r=[];for(let i=e.length-1;i>=0;i--){let a=e[i];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 Af(n){let e=0;for(let t=0;t<n.length-2;t+=2)e+=n[t]*n[t+3]-n[t+2]*n[t+1];return e/2}var Bf=Math.tan(30*Math.PI/180),Cf=3.5,vf=.9;function xf(n,e,t,o,r){if(e.fill<.86)return null;let i=e.halfShort*2*r,a=e.halfLong*2*r,s=i*a,l=e.halfShort>0?e.halfLong/e.halfShort:99,c=wf(n);if(!c){if(t>15||s>600||i<3)return null;let u=o%1e3/1e3;s<30?c=u<.5?"skillion":"gabled":l<1.25?c=u<.35?"pyramidal":"hipped":c=u<.8?"gabled":"hipped";}return c==="flat"?null:{shape:c}}function wf(n){let e=String(n.roof_shape??n["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 pt=(n,e,t)=>n.a*e+n.b*t+n.c;function _f(n,e,t,o){let r=n.length/2;if(r<3)return [];let i=[],a=s=>[n[s*2],n[s*2+1]];for(let s=0;s<r;s++){let[l,c]=a(s),[u,h]=a((s+r-1)%r),f=e*l+t*c+o,d=e*u+t*h+o;if(f<=0!=d<=0){let p=d/(d-f);i.push(u+(l-u)*p,h+(c-h)*p);}f<=0&&i.push(l,c);}return i}function Ef(n,e){let t=.5/Math.max(e,1e-6),o=n.length/2-1;if(o<5)return n;let r=[],i=0;r.push(n[0],n[1]);for(let a=1;a<o;a++){let s=n[i*2],l=n[i*2+1],c=n[a*2],u=n[a*2+1],h=c-s,f=u-l,d=Math.hypot(h,f),p=d>1e-6;if(p){for(let m=i+1;m<a;m++)if(Math.abs((n[m*2]-s)*f-(n[m*2+1]-l)*h)/d>=t){p=false;break}}p||(r.push(n[(a-1)*2],n[(a-1)*2+1]),i=a-1);}return r.length/2<3?n:(r.push(r[0],r[1]),r)}function wa(n,e,t){let{ax:o,ay:r,halfLong:i}=e;if(t==="skillion"){let l=-r,c=o;return [{a:l,b:c,c:-(l*e.cx+c*e.cy)+e.halfShort}]}let a=[],s=n.length/2-1;for(let l=0;l<s;l++){let c=n[l*2],u=n[l*2+1],h=n[(l+1)%s*2],f=n[(l+1)%s*2+1],d=h-c,p=f-u,m=Math.hypot(d,p);if(m<1e-6||t==="gabled"&&Math.abs((d*o+p*r)/m)<.86)continue;let y=-p/m,b=d/m;a.push({a:y,b,c:-(y*c+b*u)});}return !a.length&&i>0?wa(n,e,"hipped"):a}function Ff(n,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<n.length;r++){let i=t;for(let a=0;a<n.length&&i.length>=6;a++)a!==r&&(i=_f(i,n[r].a-n[a].a,n[r].b-n[a].b,n[r].c-n[a].c));o.push(i.length>=6?i:[]);}return o}function Mf(n,e){let t=0;for(let o=0;o<e.length;o++){let r=e[o];for(let i=0;i<r.length;i+=2){let a=pt(n[o],r[i],r[i+1]);a>t&&(t=a);}}return t}function Df(n,e,t){return n.map(o=>({a:o.a*e,b:o.b*e,c:o.c*e+t}))}function Sf(n,e,t,o,r,i,a,s){let l=sn(ff,a);for(let c=0;c<t.length;c++){let u=e[c];if(!u||u.length<6)continue;let h=Pe(u,void 0,2);if(!h.length)continue;let f=-t[c].a/s,d=-t[c].b/s,p=Math.hypot(f,d,1),m={x:f/p,y:d/p,z:1/p};n.ensure(u.length/2);let y=n.vertexCount;for(let b=0;b<u.length;b+=2){let g=Math.max(o,pt(t[c],u[b],u[b+1]));xt(n,u[b],u[b+1],g,m.x,m.y,m.z,255,i,l);}for(let b=0;b<h.length;b+=3)n.indices.push(y+h[b],y+h[b+2],y+h[b+1]),n.featureIds.push(r);}}function If(n,e){let t=String(n.class??"").toLowerCase();return t==="industrial"||t==="warehouse"||t==="hangar"||t==="construction"?hf:t==="commercial"||t==="office"||t==="retail"||t==="supermarket"?Ba:t==="house"||t==="detached"||t==="garage"||t==="hut"||t==="shed"||e<=7?Aa:e>=40?Ba:uf}function Lf(n,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+(n%121-60)))}function Tf(n){let e=n>>>0;return e=(e>>>16^e)*73244475,e=(e>>>16^e)*73244475,e=e>>>16^e,e>>>0}function Hf(n){let e=wt(n.render_height)??wt(n.height)??Pf(n.levels??n.building_levels??n["building:levels"]);return e&&e>0?Math.max(e,sf):af}function kf(n,e){let t=wt(n.render_min_height)??wt(n.min_height)??wt(n.base)??0;return t>0&&t<e?t:0}function Pf(n){let e=wt(n);return e&&e>0?e*3:null}function wt(n){if(typeof n=="number"&&isFinite(n))return n;if(typeof n=="string"){let e=parseFloat(n);if(isFinite(e))return e}return null}var nn=n=>n>127?127:n<-127?-127:n;function Rf(n){let e=n.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 Ne=class{constructor(e,t){this.next=null,this.key=e,this.data=t,this.left=null,this.right=null;}};function Gf(n,e){return n>e?1:n<e?-1:0}function $e(n,e,t){let o=new Ne(null,null),r=o,i=o;for(;;){let a=t(n,e.key);if(a<0){if(e.left===null)break;if(t(n,e.left.key)<0){let s=e.left;if(e.left=s.right,s.right=e,e=s,e.left===null)break}i.left=e,i=e,e=e.left;}else if(a>0){if(e.right===null)break;if(t(n,e.right.key)>0){let s=e.right;if(e.right=s.left,s.left=e,e=s,e.right===null)break}r.right=e,r=e,e=e.right;}else break}return r.right=e.left,i.left=e.right,e.left=o.right,e.right=o.left,e}function ln(n,e,t,o){let r=new Ne(n,e);if(t===null)return r.left=r.right=null,r;t=$e(n,t,o);let i=o(n,t.key);return i<0?(r.left=t.left,r.right=t,t.left=null):i>=0&&(r.right=t.right,r.left=t,t.right=null),r}function _a(n,e,t){let o=null,r=null;if(e){e=$e(n,e,t);let i=t(e.key,n);i===0?(o=e.left,r=e.right):i<0?(r=e.right,e.right=null,o=e):(o=e.left,e.left=null,r=e);}return {left:o,right:r}}function Of(n,e,t){return e===null?n:(n===null||(e=$e(n.key,e,t),e.left=n),e)}function cn(n,e,t,o,r){if(n){o(`${e}${t?"\u2514\u2500\u2500 ":"\u251C\u2500\u2500 "}${r(n)}
|
|
9
|
-
`);let i=e+(t?" ":"\u2502 ");n.left&&cn(n.left,i,false,o,r),n.right&&cn(n.right,i,true,o,r);}}var Ft=class{constructor(e=Gf){this._root=null,this._size=0,this._comparator=e;}insert(e,t){return this._size++,this._root=ln(e,t,this._root,this._comparator)}add(e,t){let o=new Ne(e,t);this._root===null&&(o.left=o.right=null,this._size++,this._root=o);let r=this._comparator,i=$e(e,this._root,r),a=r(e,i.key);return a===0?this._root=i:(a<0?(o.left=i.left,o.right=i,i.left=null):a>0&&(o.right=i.right,o.left=i,i.right=null),this._size++,this._root=o),this._root}remove(e){this._root=this._remove(e,this._root,this._comparator);}_remove(e,t,o){let r;return t===null?null:(t=$e(e,t,o),o(e,t.key)===0?(t.left===null?r=t.right:(r=$e(e,t.left,o),r.right=t.right),this._size--,r):t)}pop(){let e=this._root;if(e){for(;e.left;)e=e.left;return this._root=$e(e.key,this._root,this._comparator),this._root=this._remove(e.key,this._root,this._comparator),{key:e.key,data:e.data}}return null}findStatic(e){let t=this._root,o=this._comparator;for(;t;){let r=o(e,t.key);if(r===0)return t;r<0?t=t.left:t=t.right;}return null}find(e){return this._root&&(this._root=$e(e,this._root,this._comparator),this._comparator(e,this._root.key)!==0)?null:this._root}contains(e){let t=this._root,o=this._comparator;for(;t;){let r=o(e,t.key);if(r===0)return true;r<0?t=t.left:t=t.right;}return false}forEach(e,t){let o=this._root,r=[],i=false;for(;!i;)o!==null?(r.push(o),o=o.left):r.length!==0?(o=r.pop(),e.call(t,o),o=o.right):i=true;return this}range(e,t,o,r){let i=[],a=this._comparator,s=this._root,l;for(;i.length!==0||s;)if(s)i.push(s),s=s.left;else {if(s=i.pop(),l=a(s.key,t),l>0)break;if(a(s.key,e)>=0&&o.call(r,s))return this;s=s.right;}return this}keys(){let e=[];return this.forEach(({key:t})=>{e.push(t);}),e}values(){let e=[];return this.forEach(({data:t})=>{e.push(t);}),e}min(){return this._root?this.minNode(this._root).key:null}max(){return this._root?this.maxNode(this._root).key:null}minNode(e=this._root){if(e)for(;e.left;)e=e.left;return e}maxNode(e=this._root){if(e)for(;e.right;)e=e.right;return e}at(e){let t=this._root,o=false,r=0,i=[];for(;!o;)if(t)i.push(t),t=t.left;else if(i.length>0){if(t=i.pop(),r===e)return t;r++,t=t.right;}else o=true;return null}next(e){let t=this._root,o=null;if(e.right){for(o=e.right;o.left;)o=o.left;return o}let r=this._comparator;for(;t;){let i=r(e.key,t.key);if(i===0)break;i<0?(o=t,t=t.left):t=t.right;}return o}prev(e){let t=this._root,o=null;if(e.left!==null){for(o=e.left;o.right;)o=o.right;return o}let r=this._comparator;for(;t;){let i=r(e.key,t.key);if(i===0)break;i<0?t=t.left:(o=t,t=t.right);}return o}clear(){return this._root=null,this._size=0,this}toList(){return Vf(this._root)}load(e,t=[],o=false){let r=e.length,i=this._comparator;if(o&&hn(e,t,0,r-1,i),this._root===null)this._root=fn(e,t,0,r),this._size=r;else {let a=zf(this.toList(),Wf(e,t),i);r=this._size+r,this._root=un({head:a},0,r);}return this}isEmpty(){return this._root===null}get size(){return this._size}get root(){return this._root}toString(e=t=>String(t.key)){let t=[];return cn(this._root,"",true,o=>t.push(o),e),t.join("")}update(e,t,o){let r=this._comparator,{left:i,right:a}=_a(e,this._root,r);r(e,t)<0?a=ln(t,o,a,r):i=ln(t,o,i,r),this._root=Of(i,a,r);}split(e){return _a(e,this._root,this._comparator)}*[Symbol.iterator](){let e=this._root,t=[],o=false;for(;!o;)e!==null?(t.push(e),e=e.left):t.length!==0?(e=t.pop(),yield e,e=e.right):o=true;}};function fn(n,e,t,o){let r=o-t;if(r>0){let i=t+Math.floor(r/2),a=n[i],s=e[i],l=new Ne(a,s);return l.left=fn(n,e,t,i),l.right=fn(n,e,i+1,o),l}return null}function Wf(n,e){let t=new Ne(null,null),o=t;for(let r=0;r<n.length;r++)o=o.next=new Ne(n[r],e[r]);return o.next=null,t.next}function Vf(n){let e=n,t=[],o=false,r=new Ne(null,null),i=r;for(;!o;)e?(t.push(e),e=e.left):t.length>0?(e=i=i.next=t.pop(),e=e.right):o=true;return i.next=null,r.next}function un(n,e,t){let o=t-e;if(o>0){let r=e+Math.floor(o/2),i=un(n,e,r),a=n.head;return a.left=i,n.head=n.head.next,a.right=un(n,r+1,t),a}return null}function zf(n,e,t){let o=new Ne(null,null),r=o,i=n,a=e;for(;i!==null&&a!==null;)t(i.key,a.key)<0?(r.next=i,i=i.next):(r.next=a,a=a.next),r=r.next;return i!==null?r.next=i:a!==null&&(r.next=a),o.next}function hn(n,e,t,o,r){if(t>=o)return;let i=n[t+o>>1],a=t-1,s=o+1;for(;;){do a++;while(r(n[a],i)<0);do s--;while(r(n[s],i)>0);if(a>=s)break;let l=n[a];n[a]=n[s],n[s]=l,l=e[a],e[a]=e[s],e[s]=l;}hn(n,e,t,s,r),hn(n,e,s+1,o,r);}var et=Number.EPSILON;et===void 0&&(et=Math.pow(2,-52));var jf=et*et,Sa=(n,e)=>{if(-et<n&&n<et&&-et<e&&e<et)return 0;let t=n-e;return t*t<jf*n*e?0:n<e?-1:1},mn=class{constructor(){this.reset();}reset(){this.xRounder=new ar,this.yRounder=new ar;}round(e,t){return {x:this.xRounder.round(e),y:this.yRounder.round(t)}}},ar=class{constructor(){this.tree=new Ft,this.round(0);}round(e){let t=this.tree.add(e),o=this.tree.prev(t);if(o!==null&&Sa(t.key,o.key)===0)return this.tree.remove(e),o.key;let r=this.tree.next(t);return r!==null&&Sa(t.key,r.key)===0?(this.tree.remove(e),r.key):e}};new mn;typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6;typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6;function Pa(n){let e=[];for(let t=0;t+1<n.length;t+=2)e.push([n[t],n[t+1]]);return e}function Ra(n){let e=[];for(let o of n)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 Ga(n,e,t=0){if(n.length<2)return n;let o=new Map;for(let i of n){let a=i.lift??0,s=o.get(a);s?s.push(i):o.set(a,[i]);}let r=[];for(let[i,a]of o){if(a.length<2){r.push(...a);continue}let l=(t>0&&e?a.map(h=>({outer:e(h.outer,-t)??h.outer,holes:h.holes.map(f=>e(f,t)??f)})):a).map(h=>[Pa(h.outer),...h.holes.map(Pa)]),c;try{c=(void 0)(l[0],...l.slice(1));}catch{r.push(...a);continue}let u=c;if(!Array.isArray(u)||u.length===0){r.push(...a);continue}for(let h of u){if(!h.length)continue;let f=Ra(h[0]);if(f.length<8)continue;let d=[];for(let p=1;p<h.length;p++){let m=Ra(h[p]);m.length>=8&&d.push(m);}r.push(i?{outer:f,holes:d,lift:i}:{outer:f,holes:d});}}return r}var St=16,Ka=64,eu=0,tu=1,Oa=2,ou=3,co=1,ru=.6;function En(n,e,t,o){let r=o.metersPerUnit>0?o.metersPerUnit:.5,i=o.elevation,a=o.base??0,s=Math.max(o.bevel??0,0)/r,l=Math.max(o.bevelDrop??0,0),c=Math.max(o.cornerRadius??0,0)/r,u=Math.max(512,n.length*24),h=new ArrayBuffer(u*St),f={view:new DataView(h),bytes:new Uint8Array(h),offset:0,count:0,indices:[],extent:e,ensure(C){if(f.count+C<=u)return;u=Math.max(u*2,f.count+C);let v=new ArrayBuffer(u*St);new Uint8Array(v).set(f.bytes.subarray(0,f.offset)),h=v,f.view=new DataView(v),f.bytes=new Uint8Array(v);}},d=[],p=new Map;for(let C of n.features()){if(C.type!==3||!Be(t,C.properties))continue;let v=o.liftBy?.(C.properties)??0;for(let E of dt(C.loadGeometry())){let D=vt(E,e,Xe(e));D&&d.push(v?{...D,lift:v}:D);}}let m=new Set,y=Math.max(o.weld??ru,0),b=Ga(d,(C,v)=>xn(C,v,e,m),y/r),g=y>0?b.map(C=>({...C,outer:Na(C.outer,y/r,e),holes:C.holes.map(v=>Na(v,y/r,e))})):b;for(let C of g){Wa(C.outer,p);for(let v of C.holes)Wa(v,p);}o.onShapes?.(g);let A=new Set;for(let[C,v]of p)v>1&&A.add(C);let B=[],x={radius:c,segments:o.cornerSegments,extent:e,margin:Xe(e),minCutRatio:0,maxChord:da/r};for(let C of g){let v=c>0?{outer:ze(C.outer,{...x,keep:Va(C.outer,A)}),holes:C.holes.map(T=>ze(T,{...x,keep:Va(T,A)}))}:C,E=s>0?xn(v.outer,s,e,A):v.outer,D=v.holes.map(T=>s>0?xn(T,-s,e,A):T),M=C.lift??0,H=i+M,S=a+M;za(f,E??v.outer,D.map((T,P)=>T??v.holes[P]),H);let L=H,F=H-l;E&&s>0&&l>0&&vn(f,E,v.outer,L,F,tu,e,A),F!==S&&vn(f,v.outer,v.outer,F,S,Oa,e,A);for(let T of v.holes)if(F!==S&&vn(f,T,T,F,S,Oa,e,A),H<S){let P=f.indices.length;za(f,T,[],S,ou);for(let k=P;k<f.indices.length;k++)B.push(f.indices[k]);f.indices.length=P;}}if(!f.indices.length&&!B.length)return null;let w=f.indices.length,_=new Uint32Array(w+B.length);return _.set(f.indices,0),_.set(B,w),{vertices:h.slice(0,f.offset),indices:_.buffer,vertexCount:f.count,indexCount:_.length,extent:e,capIndexOffset:w}}function It(n,e,t,o){let r=`${Math.round(n*100)},${Math.round(e*100)}`,i=`${Math.round(t*100)},${Math.round(o*100)}`;return r<i?`${r}|${i}`:`${i}|${r}`}function Wa(n,e){for(let t=0;t+3<n.length;t+=2){let o=It(n[t],n[t+1],n[t+2],n[t+3]);e.set(o,(e.get(o)??0)+1);}}function Va(n,e){if(!e.size)return;let t=n.length/2-1,o=new Array(t).fill(false);for(let r=0;r<t;r++){let i=It(n[(r+t-1)%t*2],n[(r+t-1)%t*2+1],n[r*2],n[r*2+1]),a=It(n[r*2],n[r*2+1],n[(r+1)%t*2],n[(r+1)%t*2+1]);(e.has(i)||e.has(a))&&(o[r]=true);}return o}function fo(n,e,t,o,r,i,a,s){let l=n.offset;return n.view.setFloat32(l,e,true),n.view.setFloat32(l+4,t,true),n.view.setInt16(l+8,nu(Math.round(o*Ka)),true),n.view.setInt8(l+10,_n(Math.round(r*127))),n.view.setInt8(l+11,_n(Math.round(i*127))),n.view.setInt8(l+12,_n(Math.round(a*127))),n.bytes[l+13]=s,n.view.setInt8(l+14,e<=0?-co:e>=n.extent?co:0),n.view.setInt8(l+15,t<=0?-co:t>=n.extent?co:0),n.offset+=St,n.count++}function za(n,e,t,o,r=eu){let i=[],a=[];for(let c=0;c<e.length;c++)i.push(e[c]);for(let c of t){a.push(i.length/2);for(let u=0;u<c.length;u++)i.push(c[u]);}let s=Pe(i,a.length?a:void 0,2);if(!s.length)return;n.ensure(i.length/2);let l=n.count;for(let c=0;c<i.length;c+=2)fo(n,i[c],i[c+1],o,0,0,1,r);for(let c=0;c<s.length;c+=3)n.indices.push(l+s[c],l+s[c+2],l+s[c+1]);}function vn(n,e,t,o,r,i,a,s){let l=Math.min(e.length,t.length)/2;if(!(l<3)){n.ensure((l-1)*4);for(let c=0;c<l-1;c++){let u=t[c*2],h=t[c*2+1],f=t[c*2+2],d=t[c*2+3];if(u===f&&h===d||nr(u,h,f,d,a,Xe(a))||s.has(It(u,h,f,d)))continue;let p=f-u,m=d-h,y=Math.hypot(p,m)||1,b=m/y,g=-p/y,A=o-r,B=Math.hypot(e[c*2]-u,e[c*2+1]-h)||0,x=0;if(B>1e-6&&A!==0){let E=1/Math.hypot(1,A/B);x=B/Math.hypot(B,A)*Math.sign(A),b*=E,g*=E;}let w=fo(n,e[c*2],e[c*2+1],o,b,g,x,i),_=fo(n,e[c*2+2],e[c*2+3],o,b,g,x,i),C=fo(n,u,h,r,b,g,x,i),v=fo(n,f,d,r,b,g,x,i);n.indices.push(C,_,v,C,w,_);}}}function xn(n,e,t,o){let r=n.length/2-1;if(r<3)return null;let i=[];for(let u=0;u<r;u++){let h=n[u*2],f=n[u*2+1],d=n[(u+r-1)%r*2],p=n[(u+r-1)%r*2+1],m=n[(u+1)%r*2],y=n[(u+1)%r*2+1],b=Math.hypot(h-d,f-p)||1,g=Math.hypot(m-h,y-f)||1,A=(f-p)/b,B=-(h-d)/b,x=(y-f)/g,w=-(m-h)/g,_=A+x,C=B+w,v=Math.hypot(_,C);if(v<1e-6){i.push(h,f);continue}_/=v,C/=v;let E=Math.min(1/Math.max(_*A+C*B,.35),3),D=h-_*e*E,M=f-C*e*E,H=It(d,p,h,f),S=It(h,f,m,y);if(o.has(H)||o.has(S)){i.push(h,f);continue}let L=-Xe(t),F=t+Xe(t),T=(P,k)=>P<=L||P>=F||k<=L||k>=F;(T(h,f)||T(d,p)||T(m,y))&&(D=h,M=f),i.push(D,M);}i.push(i[0],i[1]);let a=Math.abs(wn(n)),s=wn(i);if(Math.sign(s)!==Math.sign(wn(n))||Math.abs(s)<a*.25)return null;let l=-Xe(t),c=t+Xe(t);for(let u=0;u<i.length;u+=2)i[u]=Math.max(l,Math.min(c,i[u])),i[u+1]=Math.max(l,Math.min(c,i[u+1]));return i}function wn(n){let e=0;for(let t=0;t<n.length-2;t+=2)e+=n[t]*n[t+3]-n[t+2]*n[t+1];return e/2}var _n=n=>n>127?127:n<-127?-127:n,nu=n=>n>32767?32767:n<-32768?-32768:n;function Na(n,e,t){if(!(e>0))return n;let o=Xe(t),r=-o,i=t+o,a=n;for(let s=0;s<3;s++){let l=a.length/2-1;if(l<6)break;let c=new Array(l).fill(true),u=l;for(let f=0;f<l&&!(u<=5);f++){let d=a[f*2],p=a[f*2+1];if(d<=r||d>=i||p<=r||p>=i)continue;let m=(f+l-1)%l;for(;!c[m]&&m!==f;)m=(m+l-1)%l;let y=(f+1)%l;for(;!c[y]&&y!==f;)y=(y+1)%l;if(m===f||y===f)break;let b=a[m*2],g=a[m*2+1],A=a[y*2]-b,B=a[y*2+1]-g,x=Math.hypot(A,B);x<1e-6||Math.abs((d-b)*B-(p-g)*A)/x<e&&(c[f]=false,u--);}if(u===l)break;let h=[];for(let f=0;f<l;f++)c[f]&&h.push(a[f*2],a[f*2+1]);h.push(h[0],h[1]),a=h;}return a}var tt=4;function iu(n,e,t,o,r){let i=o*o,a=[],s=u=>n[u*2],l=u=>n[u*2+1],c=(u,h)=>{let f=n.length/2;return n.push((s(u)+s(h))/2,(l(u)+l(h))/2),f};for(let u=0;u<e.length;u+=3){a.push([t+e[u],t+e[u+1],t+e[u+2]]);let h=0;for(;a.length&&!(++h>2e4);){let[f,d,p]=a.pop(),m=(s(f)-s(d))**2+(l(f)-l(d))**2,y=(s(d)-s(p))**2+(l(d)-l(p))**2,b=(s(p)-s(f))**2+(l(p)-l(f))**2,g=Math.max(m,y,b);if(g<=i){r.push(f,d,p);continue}if(g===m){let A=c(f,d);a.push([f,A,p],[A,d,p]);}else if(g===y){let A=c(d,p);a.push([d,A,f],[A,p,f]);}else {let A=c(p,f);a.push([p,A,d],[A,f,d]);}}}}function Fn(n,e,t=0,o,r=false,i=4096){let a=[],s=[],l=[];for(let d of n.features()){if(d.type!==3||!Be(e,d.properties))continue;let p=d.properties.osm_id,m=typeof p=="number"?p:typeof p=="string"?Number(p):NaN,y=Number.isFinite(m)?m:Number(d.id??0);for(let b of dt(d.loadGeometry())){let g=r?vt(b,i):b;if(!g)continue;let A=[],B=[],x=o?ze(g.outer,o):g.outer;for(let C=0;C<x.length;C++)A.push(x[C]);for(let C of g.holes){let v=o?ze(C,o):C;B.push(A.length/2);for(let E=0;E<v.length;E++)A.push(v[E]);}let w=Pe(A,B.length?B:void 0,2);if(!w.length)continue;let _=a.length/2;for(let C=0;C<A.length;C++)a.push(A[C]);if(t>0){let C=[];iu(a,w,_,t,C);for(let v=0;v<C.length;v+=3)s.push(C[v],C[v+2],C[v+1]),l.push(y);continue}for(let C=0;C<w.length;C+=3)s.push(_+w[C],_+w[C+2],_+w[C+1]),l.push(y);}}if(!s.length)return null;let c=a.length/2,u=new Int16Array(a),h=new Uint32Array(s);return {featureIds:new Float64Array(l).buffer,vertices:u.buffer,indices:h.buffer,vertexCount:c,indexCount:h.length}}var au=100;function Mn(n){return {shapes:[],cells:[],extent:0,metersPerTile:n}}function Dn(n,e,t,o){if(!(t<=0)){n.extent=o;for(let r of e){let i=r.outer;if(i.length<6)continue;let a=1/0,s=1/0,l=-1/0,c=-1/0;for(let u=0;u<i.length;u+=2)i[u]<a&&(a=i[u]),i[u]>l&&(l=i[u]),i[u+1]<s&&(s=i[u+1]),i[u+1]>c&&(c=i[u+1]);n.shapes.push({outer:i,holes:r.holes,level:t,minX:a,minY:s,maxX:l,maxY:c});}n.cells=[];}}function su(n){n.cells=Array.from({length:1024},()=>[]);let e=n.extent/32;for(let t=0;t<n.shapes.length;t++){let o=n.shapes[t],r=Lt(Math.floor(o.minX/e)),i=Lt(Math.floor(o.maxX/e)),a=Lt(Math.floor(o.minY/e)),s=Lt(Math.floor(o.maxY/e));for(let l=a;l<=s;l++)for(let c=r;c<=i;c++)n.cells[l*32+c].push(t);}}var Ja=n=>n.shapes.length===0;function ur(n,e,t){!n.cells.length&&n.shapes.length&&su(n);let o=n.extent/32,r=n.cells[Lt(Math.floor(t/o))*32+Lt(Math.floor(e/o))];if(!r||!r.length)return 0;let i=0;for(let a of r){let s=n.shapes[a];if(s.level<=i||e<s.minX||e>s.maxX||t<s.minY||t>s.maxY||!Ua(s.outer,e,t))continue;let l=false;for(let c of s.holes)if(Ua(c,e,t)){l=true;break}l||(i=s.level);}return Math.min(Math.round(i*100),127)}function Sn(n,e){let t=[],o=[],r=n.extent>0?n.metersPerTile/n.extent:0,i=r>0?2/r:0,a=ur(n,e[0],e[1]);t.push(e[0],e[1]),o.push(a);for(let s=0;s+3<e.length;s+=2){let l=e[s],c=e[s+1],u=e[s+2],h=e[s+3],f=ur(n,u,h);if(f!==a&&i>0){let d=Math.hypot(u-l,h-c),p=Math.min(Math.ceil(d/i),64),m=a;for(let y=1;y<p;y++){let b=y/p,g=l+(u-l)*b,A=c+(h-c)*b,B=ur(n,g,A);B!==m&&(t.push(g,A),o.push(B),m=B);}}t.push(u,h),o.push(f),a=f;}return {pts:t,levels:o}}var Lt=n=>n<0?0:n>31?31:n;function Ua(n,e,t){let o=false,r=n.length/2;for(let i=0,a=r-1;i<r;a=i++){let s=n[i*2],l=n[i*2+1],c=n[a*2],u=n[a*2+1];l>t!=u>t&&e<(c-s)*(t-l)/(u-l)+s&&(o=!o);}return o}var lu=5;function yt(n){let e=n.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=n.brunnel;return o==="bridge"?1:o==="tunnel"?-1:0}var ot=20;function In(n,e,t=0,o,r=0,i={}){let{level:a}=i,s=Math.max(256,n.length*24),l=new ArrayBuffer(s*ot),c=new DataView(l),u=0,h=[],f=g=>{if(u+g<=s)return;s=Math.max(s*2,u+g);let A=new ArrayBuffer(s*ot);new Uint8Array(A).set(new Uint8Array(l,0,u*ot)),l=A,c=new DataView(A);},d=(g,A,B,x,w,_,C,v=0,E=0,D=0)=>{let M=u*ot;return c.setInt16(M,g,true),c.setInt16(M+2,A,true),c.setInt16(M+4,B,true),c.setInt16(M+6,x,true),c.setInt8(M+8,w),c.setInt8(M+9,_),c.setInt8(M+10,v),c.setInt8(M+11,E),c.setFloat32(M+12,C,true),c.setFloat32(M+16,D,true),u++},p=0,m=r>0?12/r:0,y=m>0?du(n):null;for(let g of n.features()){if(g.type!==2&&g.type!==3||!Be(e,g.properties)||a!==void 0&&yt(g.properties)!==a)continue;let A=g.properties.width;p=typeof A=="number"&&A>.5&&A<100?A:0;let B=g.type===3;for(let x of g.loadGeometry()){let w=t>0?fu(Xa(x),t):Xa(x);if(w.length<4)continue;let _=o&&!Ja(o)?Sn(o,w):null,C=_?_.pts:w,v=_?.levels,E=C.length/2;if(E<2)continue;let D=yt(g.properties),M=hr(Math.round(C[0]),Math.round(C[1])),H=hr(Math.round(C[E*2-2]),Math.round(C[E*2-1])),S=null,L=p;if(y&&p>0&&!B){let T=0;for(let G=0;G<E-1;G++)T+=Math.hypot(C[G*2+2]-C[G*2],C[G*2+3]-C[G*2+1]);L=Ya(D,p,M,H,y);let P=G=>Math.min(y.width.get(G)??0,L*2),k=P(M)-L,O=P(H)-L,N=Math.min(m,T/2);if(N>0&&(k>0||O>0)){S=R=>{let V=0;return k>0&&R<N&&(V=k*(1-R/N)),O>0&&T-R<N&&(V=Math.max(V,O*(1-(T-R)/N))),L+V};let G=[];for(let R of [N,T-N])R>.01&&R<T-.01&&G.push(R);if(G.length){let R=cu(C,v,G);C=R.pts,v=R.levels,E=C.length/2;}}}f((E-1)*4);let F=0;for(let T=0;T<E-1;T++){let P=C[T*2],k=C[T*2+1],O=C[T*2+2],N=C[T*2+3],G=Math.hypot(O-P,N-k);if(B&&hu(P,k,O,N,n.extent)){F+=G;continue}let R=uu(P,k,O,N,n.extent);if(!R){F+=G;continue}let[V,j,Z,ee]=R,be=Math.hypot(V-P,j-k),te=Math.hypot(Z-V,ee-j),X=Math.hypot(O-Z,N-ee),re=F+be,se=v?v[T]:0,q=v?v[T+1]:0,U=S?S(re):L,J=S?S(re+te):L,fe=d(V,j,Z,ee,0,-1,re,se,q,U),le=d(V,j,Z,ee,0,1,re,se,q,U),ue=d(V,j,Z,ee,1,1,re,se,q,J),ne=d(V,j,Z,ee,1,-1,re,se,q,J);F+=be+te+X,h.push(fe,le,ue,fe,ue,ne);}}}if(!h.length)return null;let b=new Uint32Array(h);return {vertices:l.slice(0,u*ot),indices:b.buffer,vertexCount:u,indexCount:b.length}}function cu(n,e,t){let o=[...t].sort((l,c)=>l-c),r=[n[0],n[1]],i=e?[e[0]]:void 0,a=0,s=0;for(let l=0;l+3<n.length;l+=2){let c=n[l],u=n[l+1],h=n[l+2],f=n[l+3],d=Math.hypot(h-c,f-u);for(;s<o.length&&o[s]<=a+.01;)s++;for(;s<o.length&&o[s]<a+d-.01;){let p=(o[s]-a)/d;r.push(c+(h-c)*p,u+(f-u)*p),i&&e&&i.push(Math.round(e[l/2]+(e[l/2+1]-e[l/2])*p)),s++;}a+=d,r.push(h,f),i&&e&&i.push(e[l/2+1]);}return {pts:r,levels:i}}function fu(n,e){let t=[];for(let o=0;o+3<n.length;o+=2){let r=n[o],i=n[o+1],a=n[o+2],s=n[o+3];t.push(r,i);let l=Math.min(64,Math.floor(Math.hypot(a-r,s-i)/e));for(let c=1;c<l;c++){let u=c/l;t.push(r+(a-r)*u,i+(s-i)*u);}}return t.push(n[n.length-2],n[n.length-1]),t}function Xa(n){let e=[];for(let t=0;t<n.length;t+=2){let o=n[t],r=n[t+1],i=e.length;i>=2&&e[i-2]===o&&e[i-1]===r||e.push(o,r);}return e}function uu(n,e,t,o,r){let i=t-n,a=o-e,s=0,l=1,c=[[-i,n],[i,r-n],[-a,e],[a,r-e]];for(let[u,h]of c){if(u===0){if(h<0)return null;continue}let f=h/u;if(u<0){if(f>l)return null;f>s&&(s=f);}else {if(f<s)return null;f<l&&(l=f);}}return l-s<1e-6?null:[Math.round(n+i*s),Math.round(e+a*s),Math.round(n+i*l),Math.round(e+a*l)]}function hu(n,e,t,o,r){return n===t&&(n<=0||n>=r)?true:e===o&&(e<=0||e>=r)}var ja=new WeakMap,hr=(n,e)=>(n+512)*65536+(e+512);function Ya(n,e,t,o,r){if(n===0||e<=0)return e;let i=8*4294967296,a=Math.max(r.raw.get(t+i)??0,r.raw.get(o+i)??0);return a>0&&e>a?a:e}function du(n){let e=ja.get(n);if(e)return e;let t={width:new Map,ends:new Map,raw:new Map},o=[];for(let r of n.features()){if(r.type!==2)continue;let i=r.properties.width,a=typeof i=="number"&&i>.5&&i<100?i:0,s=yt(r.properties);for(let l of r.loadGeometry()){if(l.length<4)continue;let c=hr(Math.round(l[0]),Math.round(l[1])),u=hr(Math.round(l[l.length-2]),Math.round(l[l.length-1]));for(let h of [c,u]){let f=h+(s+8)*4294967296;t.ends.set(f,(t.ends.get(f)??0)+1),a>0&&t.raw.set(f,Math.max(t.raw.get(f)??0,a));}o.push({h:c,t:u,lv:s,w:a});}}for(let r of o){let i=Ya(r.lv,r.w,r.h,r.t,t);if(!(i<=0))for(let a of [r.h,r.t]){let s=t.width.get(a);(s===void 0||i>s)&&t.width.set(a,i);}}return ja.set(n,t),t}var Ln={enabled:true,skyColor:"#7fb2e5",horizonColor:"#dfe6ee",fogRange:[1.35,7.5],fogIntensity:.92,spaceColor:"#05070f",atmosphereColor:"#79b8f5",starIntensity:.55,horizonBlend:.75},Tn={ambientColor:"#ffffff",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#fff4e2",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#dce6f2",fillIntensity:.18};var Za={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:"landcover-wood",type:"fill","source-layer":"landcover",filter:["in","class","wood","forest"],paint:{color:"#c6dcb4",opacity:{stops:[[8,.5],[12,.85]]},material:"foliage",materialScale:16}},{id:"landcover-grass",type:"fill","source-layer":"landcover",filter:["in","class","grass","farmland","meadow"],paint:{color:"#d9e6c6",opacity:{stops:[[8,.45],[12,.8]]},material:"foliage",materialScale:11}},{id:"landcover-sand",type:"fill","source-layer":"landcover",filter:["in","class","sand","beach"],paint:{color:"#f2e7c8",material:"sand",materialScale:26}},{id:"landcover-ice",type:"fill","source-layer":"landcover",filter:["in","class","ice","glacier"],paint:{color:"#e6f2f7"}},{id:"landcover-wetland",type:"fill","source-layer":"landcover",filter:["in","class","wetland","swamp"],paint:{color:"#cfe0d4",material:"foliage",materialScale:9}},{id:"landuse-residential",type:"fill","source-layer":"landuse",filter:["in","class","residential","suburb","neighbourhood","quarter"],paint:{color:"#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","source-layer":"water",filter:["!in","class","swimming_pool"],paint:{color:"#a5cbe3",material:"water",materialScale:14,materialSpeed:1}},{id:"water-pool",type:"fill","source-layer":"water",filter:["==","class","swimming_pool"],paint:{color:"#9fd3e8",material:"water",materialScale:8,materialSpeed:1}},{id:"waterway",type:"line","source-layer":"waterway",paint:{color:"#a5cbe3",width:{stops:[[8,.6],[12,1.4],[16,4],[19,11.5],[20,23],[21,46],[22,92]]},material:"water",materialScale:10,materialSpeed:1}},{id:"aeroway-line",type:"line","source-layer":"aeroway",filter:["in","class","runway","taxiway"],paint:{color:"#d8d5da",width:{stops:[[10,1],[14,5],[18,24],[19,24],[20,48],[21,96],[22,192]]},material:"asphalt",materialScale:4}},{id:"road-bridge-outline",type:"line",network:"roads","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","motorway","trunk","primary","secondary","tertiary","minor","service","track"]],minzoom:14,paint:{color:{from:"road-casing-major",darken:.2},width:{stops:[[6,1.6],[10,3.4],[14,8],[16,14],[18,30],[19,45],[20,90],[21,180],[22,360]]},widthFromData:true,widthExtra:5.5}},{id:"road-bridge-outline-thin",type:"line",network:"roads","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","path","pedestrian","footway","steps","rail","transit"]],minzoom:14,paint:{color:{from:"road-casing-major",darken:.2},width:{stops:[[14,2.5],[17,5],[19,9],[20,15],[21,28]]}}},{id:"road-casing-major",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","motorway","trunk","primary"],minzoom:5,paint:{color:"#d4ab68",width:{stops:[[6,1.6],[10,3.4],[14,8],[16,14],[18,30],[19,45],[20,90],[21,180],[22,360]]},widthFromData:true,widthExtra:2.5}},{id:"road-casing-secondary",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","secondary","tertiary"],minzoom:9,paint:{color:{stops:[[16,"#c6bca6"],[18.5,"#d4ab68"]]},width:{stops:[[10,1.6],[14,5.5],[16,10],[18,22],[19,33],[20,66],[21,132],[22,264]]},widthFromData:true,widthExtra:2}},{id:"road-casing-minor",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","minor","service","track"],minzoom:12,paint:{color:{stops:[[16,"#cdc4b2"],[18.5,"#d4ab68"]]},width:{stops:[[13,1.4],[16,6],[18,14],[19,22],[20,44],[21,88],[22,176]]},widthFromData:true,widthExtra:1.5}},{id:"road-rail",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","rail","transit"],minzoom:10,paint:{color:"#b2a99e",width:{stops:[[10,.8],[14,1.8],[18,4],[19,5.5],[20,11],[21,22],[22,44]]}}},{id:"road-path",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","path","pedestrian","footway","steps"],minzoom:14,paint:{color:"#bdb2a0",width:{stops:[[14,.8],[17,2],[19,4],[20,8],[21,16],[22,32]]},dashArray:[4,3],material:"asphalt",materialScale:2}},{id:"road-minor",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","minor","service","track"],minzoom:12,paint:{color:{stops:[[16,"#ffffff"],[18.5,"#ffdfa3"]]},width:{stops:[[13,.6],[16,4],[18,11],[19,18],[20,36],[21,72],[22,144]]},material:"asphalt",materialScale:3,widthFromData:true}},{id:"road-ramp",network:"roads",type:"line","source-layer":"transportation",filter:["all",["in","class","motorway","trunk","primary"],["has","ramp"]],minzoom:5,paint:{color:"#ffdfa3",width:{stops:[[6,.8],[10,2.2],[14,6],[16,11],[18,25],[19,38.5],[20,77],[21,154],[22,308]]},material:"asphalt",materialScale:3,widthFromData:true}},{id:"road-secondary",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","secondary","tertiary"],minzoom:9,paint:{color:{stops:[[16,"#ffffff"],[18.5,"#ffdfa3"]]},width:{stops:[[10,.8],[14,3.6],[16,7.5],[18,18],[19,28],[20,56],[21,112],[22,224]]},material:"asphalt",materialScale:3,widthFromData:true}},{id:"road-major",network:"roads",type:"line","source-layer":"transportation",filter:["all",["in","class","motorway","trunk","primary"],["!has","ramp"]],minzoom:5,paint:{color:"#ffdfa3",width:{stops:[[6,.8],[10,2.2],[14,6],[16,11],[18,25],[19,38.5],[20,77],[21,154],[22,308]]},material:"asphalt",materialScale:3,widthFromData:true}},{id:"road-lane-divider-major",network:"roads",type:"line","source-layer":"transportation",filter:["all",["!has","oneway"],["in","class","motorway","trunk","primary"]],minzoom:16.5,paint:{color:"#e3bd7f",width:{stops:[[16.5,.54],[17,.78],[18,1.4],[19,2.17],[20,4.34],[21,8.68],[22,17.36]]},dashArray:[7,18],material:"flat"}},{id:"road-lane-divider-secondary",network:"roads",type:"line","source-layer":"transportation",filter:["all",["!has","oneway"],["in","class","secondary","tertiary"]],minzoom:16.5,paint:{color:"#d8cfbc",width:{stops:[[16.5,.46],[17,.67],[18,1.2],[19,1.86],[20,3.72],[21,7.44],[22,14.88]]},dashArray:[7,18],material:"flat"}},{id:"boundary",type:"line","source-layer":"boundary",filter:["<=","admin_level",4],paint:{color:"#b3a6b8",opacity:.7,width:{stops:[[4,.7],[10,1.4],[16,2.4]]},dashArray:[6,4]}},{id:"building",type:"fill-extrusion","source-layer":"building",minzoom:15,paint:{color:"#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:true},{id:"road-closed",type:"line",source:"closures","source-layer":"closures",minzoom:11,paint:{color:"#d92b2b",width:{stops:[[11,2.5],[14,4],[17,7],[19,11],[20,22],[21,44],[22,88]]},dashArray:[5,4]},overlay:true},{id:"road-closed-end",type:"symbol",source:"closures","source-layer":"closure_ends",minzoom:13,layout:{iconImage:"road_closed",iconFrame:"circle",iconFrameScale:1.6,allowOverlap:true,priority:6},paint:{color:"#d92b2b",frameColor:"#d92b2b",frameOpacity:1,frameHaloColor:"#ffffff",frameHaloWidth:1.4,iconColor:"#ffffff",iconHaloWidth:0,iconSize:13}},{id:"crossing",type:"fill",source:"points","source-layer":"crossings",minzoom:16.5,overlay:true,paint:{color:"#ffffff",opacity:.9}},{id:"housenumber",type:"symbol","source-layer":"housenumber",minzoom:17,layout:{textField:"{housenumber}",textSize:{stops:[[17,9],[19,11]]},maxLineChars:6,priority:-60},paint:{color:"#8c8478",haloColor:"#f5f3ee",haloWidth:1}},{id:"poi-food",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#c2681c",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#c2681c",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","cafe","restaurant","fast_food","bar","pub","beer","bakery","ice_cream"]},{id:"poi-shop",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#2f77c4",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#2f77c4",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","shop","clothing_store","grocery","alcohol_shop","music","laundry","hairdresser","car","bicycle"]},{id:"poi-transport",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#3b82a6",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#3b82a6",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","bus","railway","parking","fuel","bicycle_parking","bicycle_rental","taxi","airport"]},{id:"poi-health",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#c24444",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#c24444",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","pharmacy","hospital","doctors","dentist","veterinary"]},{id:"poi-education",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#3f7f7a",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#3f7f7a",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","school","college","university","library","kindergarten"]},{id:"poi-culture",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#8b5aa5",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#8b5aa5",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","museum","theatre","cinema","art_gallery","attraction","monument","zoo","theme_park","castle","place_of_worship","information"]},{id:"poi-sport",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#4f8b45",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#4f8b45",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","pitch","park","garden","playground","stadium","sports_centre","swimming_pool","athletics","running"]},{id:"poi-lodging",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#7a5fbf",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#7a5fbf",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","lodging"]},{id:"poi-service",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#59636e",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#59636e",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","bank","atm","post","office","town_hall","police","fire_station","toilets"]},{id:"poi",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#4a4a4a",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#4a4a4a",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["!in","class","cafe","restaurant","fast_food","bar","pub","beer","bakery","ice_cream","shop","clothing_store","grocery","alcohol_shop","music","laundry","hairdresser","car","bicycle","bus","railway","parking","fuel","bicycle_parking","bicycle_rental","taxi","airport","pharmacy","hospital","doctors","dentist","veterinary","school","college","university","library","kindergarten","museum","theatre","cinema","art_gallery","attraction","monument","zoo","theme_park","castle","place_of_worship","information","pitch","park","garden","playground","stadium","sports_centre","swimming_pool","athletics","running","lodging","bank","atm","post","office","town_hall","police","fire_station","toilets"]},{id:"traffic-signal",type:"symbol",source:"points","source-layer":"roadpoints",minzoom:16,filter:["==","kind","traffic_signals"],layout:{iconImage:"traffic_signals",priority:3},paint:{color:"#5c6470",haloColor:"#ffffff",haloWidth:1.4,iconSize:15}},{id:"road-shield",type:"symbol","source-layer":"transportation_name",filter:["has","ref"],minzoom:11,layout:{textField:"{ref}",iconImage:"shield-{ref_length}",iconPlacement:"behind",textSize:{stops:[[11,9.5],[16,11]]},iconTextGap:4,maxLineChars:10,collisionPadding:70,priority:3},paint:{color:"#3a4048",haloColor:"#f7f3e8",haloWidth:.5,iconColor:"#f7f3e8",iconHaloColor:"#8a8172",iconHaloWidth:1.4}},{id:"road-label",type:"symbol","source-layer":"transportation_name",minzoom:14,layout:{textField:["{name:ru}","{name}"],textPlacement:"line",textSize:{stops:[[14,10],[18,13]]},priority:20,abbreviate:true},paint:{color:"#5c5646",haloColor:"#ffffff",haloWidth:1.6}},{id:"water-label",type:"symbol","source-layer":"water_name",minzoom:10,layout:{textField:["{name:ru}","{name}"],textSize:{stops:[[10,11],[16,14]]},priority:30},paint:{color:"#3d7ea6",haloColor:"#ffffff",haloWidth:1.4}},{id:"place-label",type:"symbol","source-layer":"place",minzoom:4,layout:{textField:["{name:ru}","{name}"],textSize:{stops:[[6,12],[12,17],[16,22]]},maxLineChars:16,priority:90},paint:{color:"#3a3a3a",haloColor:"#ffffff",haloWidth:1.8}},{id:"indoor-shell",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","level"],minzoom:16,paint:{color:"#f6f3ec",opacity:.97},clipToTile:true},{id:"indoor-corridor",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","corridor"],minzoom:16,paint:{color:"#ffffff"},clipToTile:true},{id:"indoor-room",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["in","class","room","area"],minzoom:16,paint:{color:"#efeae0"},clipToTile:true},{id:"indoor-service",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","service"],minzoom:16,paint:{color:"#e6e1d6"},clipToTile:true},{id:"indoor-shop",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","shop"],minzoom:16,paint:{color:"#e8e0f0"},clipToTile:true},{id:"indoor-food",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","food"],minzoom:16,paint:{color:"#f7e3cd"},clipToTile:true},{id:"indoor-wc",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","wc"],minzoom:16,paint:{color:"#d8e8f2"},clipToTile:true},{id:"indoor-wall",type:"fill-extrusion",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","wall"],minzoom:16,paint:{color:"#cbc4b8",roofColor:"#e4ded2",facadeDetail:0,tintVariation:0,roofVariation:0,aoStrength:0}},{id:"indoor-transportation",type:"fill",source:"indoor","source-layer":"transportation",splitBy:"level",minzoom:16,paint:{color:"#d9d2e8",opacity:.95},clipToTile:true},{id:"indoor-door",type:"symbol",source:"indoor","source-layer":"poi",filter:["==","class","door"],splitBy:"level",minzoom:18,layout:{iconImage:"door",iconSize:{stops:[[18,9],[20,13]]},allowOverlap:true,priority:-10},paint:{color:"#8a8172",haloColor:"#ffffff",haloWidth:1.2}},{id:"indoor-poi",type:"symbol",source:"indoor","source-layer":"poi",splitBy:"level",minzoom:17,layout:{textField:["{name}"],iconImage:"{class}",textSize:{stops:[[17,10],[19,12]]},iconSize:{stops:[[17,12],[19,15]]},iconTextGap:2,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#4a4a4a",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:.32}},{id:"indoor-name",type:"symbol",source:"indoor","source-layer":"area_name",splitBy:"level",minzoom:17,layout:{textField:["{name}"],textSize:{stops:[[17,10.5],[19,12.5]]},maxLineChars:8},paint:{color:"#3c3830",haloColor:"#ffffff",haloWidth:1.4}},{id:"building-entrance",type:"symbol",source:"points","source-layer":"entrances",minzoom:17,layout:{iconImage:"entrance",showFor:"highlight",textField:["{ref}"],textSize:{stops:[[17,10],[19,12.5]]},allowOverlap:true,priority:40,iconRotate:"angle",placement:"map",arrowLength:{stops:[[17,22],[18,32],[19,40],[20,48],[22,56]]},arrowWidth:{stops:[[17,6],[18,8.5],[19,10.5],[20,12.5],[22,15]]},arrowOutline:{stops:[[17,1.4],[18,2],[19,2.5],[20,3],[22,3.5]]},arrowGap:{stops:[[17,14],[18,19],[19,23],[20,27],[22,31]]},arrowUnits:"pixels",iconTextGap:3,arrowDotRadius:{stops:[[17,2.2],[18,3.2],[19,4],[20,4.8],[22,5.6]]},arrowDotGap:{stops:[[17,5],[18,7],[19,9],[20,11],[22,12.5]]}},paint:{color:"#2d6ecb",haloColor:"#ffffff",haloWidth:1.6}}],sources:{indoor:{url:"/tileserver/data/indoor/{z}/{x}/{y}.pbf",minzoom:15,maxzoom:18},points:{url:"/tileserver/data/points/{z}/{x}/{y}.pbf",minzoom:13,maxzoom:16},closures:{url:"/tileserver/data/closures/{z}/{x}/{y}.pbf",minzoom:10,maxzoom:16}}};var Qa={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:"landcover-wood",type:"fill","source-layer":"landcover",filter:["in","class","wood","forest"],paint:{color:"#c6dcb4",opacity:{stops:[[8,.5],[12,.85]]},material:"foliage",materialScale:16},cornerRadius:10,cornerSegments:4},{id:"landcover-grass",type:"fill","source-layer":"landcover",filter:["in","class","grass","farmland","meadow"],paint:{color:"#d9e6c6",opacity:{stops:[[8,.45],[12,.8]]},material:"foliage",materialScale:11},cornerRadius:8,cornerSegments:4},{id:"landcover-sand",type:"fill","source-layer":"landcover",filter:["in","class","sand","beach"],paint:{color:"#f2e7c8",material:"sand",materialScale:26},cornerRadius:10,cornerSegments:4},{id:"landcover-ice",type:"fill","source-layer":"landcover",filter:["in","class","ice","glacier"],paint:{color:"#e6f2f7"}},{id:"landcover-wetland",type:"fill","source-layer":"landcover",filter:["in","class","wetland","swamp"],paint:{color:"#cfe0d4",material:"foliage",materialScale:9},cornerRadius:8,cornerSegments:4},{id:"landuse-residential",type:"fill","source-layer":"landuse",filter:["in","class","residential","suburb","neighbourhood","quarter"],paint:{color:"#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","source-layer":"water",filter:["!in","class","swimming_pool"],paint:{color:"#a5cbe3",material:"water",materialScale:14,materialSpeed:1},cornerRadius:7,cornerSegments:4},{id:"water-pool",type:"fill","source-layer":"water",filter:["==","class","swimming_pool"],paint:{color:"#9fd3e8",material:"water",materialScale:8,materialSpeed:1},cornerRadius:4,cornerSegments:4},{id:"waterway",type:"line","source-layer":"waterway",paint:{color:"#a5cbe3",width:{stops:[[8,.6],[12,1.4],[16,4],[19,11.5],[20,23],[21,46],[22,92]]},material:"water",materialScale:10,materialSpeed:1}},{id:"aeroway-line",type:"line","source-layer":"aeroway",filter:["in","class","runway","taxiway"],paint:{color:"#d8d5da",width:{stops:[[10,1],[14,5],[18,24],[19,24],[20,48],[21,96],[22,192]]},material:"asphalt",materialScale:4}},{id:"road-bridge-outline",type:"line",network:"roads","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","motorway","trunk","primary","secondary","tertiary","minor","service","track"]],minzoom:14,paint:{color:{from:"road-casing-major",darken:.2},width:{stops:[[6,1.6],[10,3.4],[14,8],[16,14],[18,30],[19,45],[20,90],[21,180],[22,360]]},widthFromData:true,widthExtra:5.5}},{id:"road-bridge-outline-thin",type:"line",network:"roads","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","path","pedestrian","footway","steps","rail","transit"]],minzoom:14,paint:{color:{from:"road-casing-major",darken:.2},width:{stops:[[14,2.5],[17,5],[19,9],[20,15],[21,28]]}}},{id:"road-casing-major",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","motorway","trunk","primary"],minzoom:5,paint:{color:"#d4ab68",width:{stops:[[6,1.6],[10,3.4],[14,8],[16,14],[18,30],[19,45],[20,90],[21,180],[22,360]]},widthFromData:true,widthExtra:2.5}},{id:"road-casing-secondary",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","secondary","tertiary"],minzoom:9,paint:{color:{stops:[[16,"#c6bca6"],[18.5,"#d4ab68"]]},width:{stops:[[10,1.6],[14,5.5],[16,10],[18,22],[19,33],[20,66],[21,132],[22,264]]},widthFromData:true,widthExtra:2}},{id:"road-casing-minor",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","minor","service","track"],minzoom:12,paint:{color:{stops:[[16,"#cdc4b2"],[18.5,"#d4ab68"]]},width:{stops:[[13,1.4],[16,6],[18,14],[19,22],[20,44],[21,88],[22,176]]},widthFromData:true,widthExtra:1.5}},{id:"road-rail",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","rail","transit"],minzoom:10,paint:{color:"#b2a99e",width:{stops:[[10,.8],[14,1.8],[18,4],[19,5.5],[20,11],[21,22],[22,44]]}}},{id:"road-path",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","path","pedestrian","footway","steps"],minzoom:14,paint:{color:"#bdb2a0",width:{stops:[[14,.8],[17,2],[19,4],[20,8],[21,16],[22,32]]},dashArray:[4,3],material:"asphalt",materialScale:2}},{id:"road-minor",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","minor","service","track"],minzoom:12,paint:{color:{stops:[[16,"#ffffff"],[18.5,"#ffdfa3"]]},width:{stops:[[13,.6],[16,4],[18,11],[19,18],[20,36],[21,72],[22,144]]},material:"asphalt",materialScale:3,widthFromData:true}},{id:"road-ramp",network:"roads",type:"line","source-layer":"transportation",filter:["all",["in","class","motorway","trunk","primary"],["has","ramp"]],minzoom:5,paint:{color:"#ffdfa3",width:{stops:[[6,.8],[10,2.2],[14,6],[16,11],[18,25],[19,38.5],[20,77],[21,154],[22,308]]},material:"asphalt",materialScale:3,widthFromData:true}},{id:"road-secondary",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","secondary","tertiary"],minzoom:9,paint:{color:{stops:[[16,"#ffffff"],[18.5,"#ffdfa3"]]},width:{stops:[[10,.8],[14,3.6],[16,7.5],[18,18],[19,28],[20,56],[21,112],[22,224]]},material:"asphalt",materialScale:3,widthFromData:true}},{id:"road-major",network:"roads",type:"line","source-layer":"transportation",filter:["all",["in","class","motorway","trunk","primary"],["!has","ramp"]],minzoom:5,paint:{color:"#ffdfa3",width:{stops:[[6,.8],[10,2.2],[14,6],[16,11],[18,25],[19,38.5],[20,77],[21,154],[22,308]]},material:"asphalt",materialScale:3,widthFromData:true}},{id:"road-lane-divider-major",network:"roads",type:"line","source-layer":"transportation",filter:["all",["!has","oneway"],["in","class","motorway","trunk","primary"]],minzoom:16.5,paint:{color:"#e3bd7f",width:{stops:[[16.5,.54],[17,.78],[18,1.4],[19,2.17],[20,4.34],[21,8.68],[22,17.36]]},dashArray:[7,18],material:"flat"}},{id:"road-lane-divider-secondary",network:"roads",type:"line","source-layer":"transportation",filter:["all",["!has","oneway"],["in","class","secondary","tertiary"]],minzoom:16.5,paint:{color:"#d8cfbc",width:{stops:[[16.5,.46],[17,.67],[18,1.2],[19,1.86],[20,3.72],[21,7.44],[22,14.88]]},dashArray:[7,18],material:"flat"}},{id:"boundary",type:"line","source-layer":"boundary",filter:["<=","admin_level",4],paint:{color:"#b3a6b8",opacity:.7,width:{stops:[[4,.7],[10,1.4],[16,2.4]]},dashArray:[6,4]}},{id:"building",type:"fill-extrusion","source-layer":"building",minzoom:15,paint:{color:"#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:true},{id:"road-closed",type:"line",source:"closures","source-layer":"closures",minzoom:11,paint:{color:"#d92b2b",width:{stops:[[11,2.5],[14,4],[17,7],[19,11],[20,22],[21,44],[22,88]]},dashArray:[5,4]},overlay:true},{id:"road-closed-end",type:"symbol",source:"closures","source-layer":"closure_ends",minzoom:13,layout:{iconImage:"road_closed",iconFrame:"circle",iconFrameScale:1.6,allowOverlap:true,priority:6},paint:{color:"#d92b2b",frameColor:"#d92b2b",frameOpacity:1,frameHaloColor:"#ffffff",frameHaloWidth:1.4,iconColor:"#ffffff",iconHaloWidth:0,iconSize:13}},{id:"crossing",type:"fill",source:"points","source-layer":"crossings",minzoom:16.5,overlay:true,paint:{color:"#ffffff",opacity:.9}},{id:"housenumber",type:"symbol","source-layer":"housenumber",minzoom:17,layout:{textField:"{housenumber}",textSize:{stops:[[17,9],[19,11]]},maxLineChars:6,priority:-60},paint:{color:"#8c8478",haloColor:"#f5f3ee",haloWidth:1}},{id:"poi-food",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#c2681c",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#c2681c",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","cafe","restaurant","fast_food","bar","pub","beer","bakery","ice_cream"]},{id:"poi-shop",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#2f77c4",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#2f77c4",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","shop","clothing_store","grocery","alcohol_shop","music","laundry","hairdresser","car","bicycle"]},{id:"poi-transport",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#3b82a6",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#3b82a6",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","bus","railway","parking","fuel","bicycle_parking","bicycle_rental","taxi","airport"]},{id:"poi-health",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#c24444",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#c24444",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","pharmacy","hospital","doctors","dentist","veterinary"]},{id:"poi-education",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#3f7f7a",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#3f7f7a",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","school","college","university","library","kindergarten"]},{id:"poi-culture",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#8b5aa5",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#8b5aa5",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","museum","theatre","cinema","art_gallery","attraction","monument","zoo","theme_park","castle","place_of_worship","information"]},{id:"poi-sport",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#4f8b45",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#4f8b45",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","pitch","park","garden","playground","stadium","sports_centre","swimming_pool","athletics","running"]},{id:"poi-lodging",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#7a5fbf",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#7a5fbf",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","lodging"]},{id:"poi-service",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#59636e",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#59636e",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","bank","atm","post","office","town_hall","police","fire_station","toilets"]},{id:"poi",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#4a4a4a",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#4a4a4a",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["!in","class","cafe","restaurant","fast_food","bar","pub","beer","bakery","ice_cream","shop","clothing_store","grocery","alcohol_shop","music","laundry","hairdresser","car","bicycle","bus","railway","parking","fuel","bicycle_parking","bicycle_rental","taxi","airport","pharmacy","hospital","doctors","dentist","veterinary","school","college","university","library","kindergarten","museum","theatre","cinema","art_gallery","attraction","monument","zoo","theme_park","castle","place_of_worship","information","pitch","park","garden","playground","stadium","sports_centre","swimming_pool","athletics","running","lodging","bank","atm","post","office","town_hall","police","fire_station","toilets"]},{id:"traffic-signal",type:"symbol",source:"points","source-layer":"roadpoints",minzoom:16,filter:["==","kind","traffic_signals"],layout:{iconImage:"traffic_signals",priority:3},paint:{color:"#5c6470",haloColor:"#ffffff",haloWidth:1.4,iconSize:15}},{id:"road-shield",type:"symbol","source-layer":"transportation_name",filter:["has","ref"],minzoom:11,layout:{textField:"{ref}",iconImage:"shield-{ref_length}",iconPlacement:"behind",textSize:{stops:[[11,9.5],[16,11]]},iconTextGap:4,maxLineChars:10,collisionPadding:70,priority:3},paint:{color:"#3a4048",haloColor:"#f7f3e8",haloWidth:.5,iconColor:"#f7f3e8",iconHaloColor:"#8a8172",iconHaloWidth:1.4}},{id:"road-label",type:"symbol","source-layer":"transportation_name",minzoom:14,layout:{textField:["{name:ru}","{name}"],textPlacement:"line",textSize:{stops:[[14,10],[18,13]]},priority:20,abbreviate:true},paint:{color:"#5c5646",haloColor:"#ffffff",haloWidth:1.6}},{id:"water-label",type:"symbol","source-layer":"water_name",minzoom:10,layout:{textField:["{name:ru}","{name}"],textSize:{stops:[[10,11],[16,14]]},priority:30},paint:{color:"#3d7ea6",haloColor:"#ffffff",haloWidth:1.4}},{id:"place-label",type:"symbol","source-layer":"place",minzoom:4,layout:{textField:["{name:ru}","{name}"],textSize:{stops:[[6,12],[12,17],[16,22]]},maxLineChars:16,priority:90},paint:{color:"#3a3a3a",haloColor:"#ffffff",haloWidth:1.8}},{id:"indoor-shell",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","level"],minzoom:16,paint:{color:"#f6f3ec",opacity:.97},clipToTile:true},{id:"indoor-corridor",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","corridor"],minzoom:16,paint:{color:"#ffffff"},clipToTile:true},{id:"indoor-room",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["in","class","room","area"],minzoom:16,paint:{color:"#efeae0"},clipToTile:true},{id:"indoor-service",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","service"],minzoom:16,paint:{color:"#e6e1d6"},clipToTile:true},{id:"indoor-shop",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","shop"],minzoom:16,paint:{color:"#e8e0f0"},clipToTile:true},{id:"indoor-food",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","food"],minzoom:16,paint:{color:"#f7e3cd"},clipToTile:true},{id:"indoor-wc",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","wc"],minzoom:16,paint:{color:"#d8e8f2"},clipToTile:true},{id:"indoor-wall",type:"fill-extrusion",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","wall"],minzoom:16,paint:{color:"#cbc4b8",roofColor:"#e4ded2",facadeDetail:0,tintVariation:0,roofVariation:0,aoStrength:0}},{id:"indoor-transportation",type:"fill",source:"indoor","source-layer":"transportation",splitBy:"level",minzoom:16,paint:{color:"#d9d2e8",opacity:.95},clipToTile:true},{id:"indoor-door",type:"symbol",source:"indoor","source-layer":"poi",filter:["==","class","door"],splitBy:"level",minzoom:18,layout:{iconImage:"door",iconSize:{stops:[[18,9],[20,13]]},allowOverlap:true,priority:-10},paint:{color:"#8a8172",haloColor:"#ffffff",haloWidth:1.2}},{id:"indoor-poi",type:"symbol",source:"indoor","source-layer":"poi",splitBy:"level",minzoom:17,layout:{textField:["{name}"],iconImage:"{class}",textSize:{stops:[[17,10],[19,12]]},iconSize:{stops:[[17,12],[19,15]]},iconTextGap:2,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#4a4a4a",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:.32}},{id:"indoor-name",type:"symbol",source:"indoor","source-layer":"area_name",splitBy:"level",minzoom:17,layout:{textField:["{name}"],textSize:{stops:[[17,10.5],[19,12.5]]},maxLineChars:8},paint:{color:"#3c3830",haloColor:"#ffffff",haloWidth:1.4}},{id:"building-entrance",type:"symbol",source:"points","source-layer":"entrances",minzoom:17,layout:{iconImage:"entrance",showFor:"highlight",textField:["{ref}"],textSize:{stops:[[17,10],[19,12.5]]},allowOverlap:true,priority:40,iconRotate:"angle",placement:"map",arrowLength:{stops:[[17,22],[18,32],[19,40],[20,48],[22,56]]},arrowWidth:{stops:[[17,6],[18,8.5],[19,10.5],[20,12.5],[22,15]]},arrowOutline:{stops:[[17,1.4],[18,2],[19,2.5],[20,3],[22,3.5]]},arrowGap:{stops:[[17,14],[18,19],[19,23],[20,27],[22,31]]},arrowUnits:"pixels",iconTextGap:3,arrowDotRadius:{stops:[[17,2.2],[18,3.2],[19,4],[20,4.8],[22,5.6]]},arrowDotGap:{stops:[[17,5],[18,7],[19,9],[20,11],[22,12.5]]}},paint:{color:"#2d6ecb",haloColor:"#ffffff",haloWidth:1.6}}],sources:{indoor:{url:"/tileserver/data/indoor/{z}/{x}/{y}.pbf",minzoom:15,maxzoom:18},points:{url:"/tileserver/data/points/{z}/{x}/{y}.pbf",minzoom:13,maxzoom:16},closures:{url:"/tileserver/data/closures/{z}/{x}/{y}.pbf",minzoom:10,maxzoom:16}}};var qa={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:"landcover-wood",type:"surface","source-layer":"landcover",filter:["in","class","wood","forest"],paint:{color:"#c6dcb4",opacity:{stops:[[8,.5],[12,.85]]},material:"foliage",materialScale:16,sideShade:.16},elevation:.7,bevel:.5,bevelDrop:.15,cornerRadius:10,cornerSegments:4},{id:"landcover-grass",type:"surface","source-layer":"landcover",filter:["in","class","grass","farmland","meadow"],paint:{color:"#d9e6c6",opacity:{stops:[[8,.45],[12,.8]]},material:"foliage",materialScale:11,sideShade:.16},elevation:.5,bevel:.45,bevelDrop:.12,cornerRadius:8,cornerSegments:4},{id:"landcover-sand",type:"surface","source-layer":"landcover",filter:["in","class","sand","beach"],paint:{color:"#f2e7c8",material:"sand",materialScale:26,sideShade:.16},elevation:.12,bevel:.6,bevelDrop:.08,cornerRadius:10,cornerSegments:4},{id:"landcover-ice",type:"fill","source-layer":"landcover",filter:["in","class","ice","glacier"],paint:{color:"#e6f2f7"}},{id:"landcover-wetland",type:"surface","source-layer":"landcover",filter:["in","class","wetland","swamp"],paint:{color:"#cfe0d4",material:"foliage",materialScale:9,sideShade:.16},elevation:.15,bevel:.5,bevelDrop:.08,cornerRadius:8,cornerSegments:4},{id:"landuse-residential",type:"fill","source-layer":"landuse",filter:["in","class","residential","suburb","neighbourhood","quarter"],paint:{color:"#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","source-layer":"water",filter:["!in","class","swimming_pool"],paint:{color:"#a5cbe3",material:"water",materialScale:14,materialSpeed:1,sideShade:0},elevation:-0.35,bevel:.8,bevelDrop:.12,cornerRadius:7,cornerSegments:4},{id:"water-pool",type:"surface","source-layer":"water",filter:["==","class","swimming_pool"],paint:{color:"#9fd3e8",material:"water",materialScale:8,materialSpeed:1,sideShade:0},elevation:-0.2,bevel:.4,bevelDrop:.08,cornerRadius:4,cornerSegments:4},{id:"waterway",type:"line","source-layer":"waterway",paint:{color:"#a5cbe3",width:{stops:[[8,.6],[12,1.4],[16,4],[19,11.5],[20,23],[21,46],[22,92]]},material:"water",materialScale:10,materialSpeed:1,elevation:-0.3}},{id:"aeroway-line",type:"line","source-layer":"aeroway",filter:["in","class","runway","taxiway"],paint:{color:"#d8d5da",width:{stops:[[10,1],[14,5],[18,24],[19,24],[20,48],[21,96],[22,192]]},material:"asphalt",materialScale:4,elevation:.08}},{id:"road-bridge-outline",type:"line",network:"roads","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","motorway","trunk","primary","secondary","tertiary","minor","service","track"]],minzoom:14,paint:{elevation:.1,color:{from:"road-casing-major",darken:.2},width:{stops:[[6,1.6],[10,3.4],[14,8],[16,14],[18,30],[19,45],[20,90],[21,180],[22,360]]},widthFromData:true,widthExtra:5.5}},{id:"road-bridge-outline-thin",type:"line",network:"roads","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","path","pedestrian","footway","steps","rail","transit"]],minzoom:14,paint:{elevation:.1,color:{from:"road-casing-major",darken:.2},width:{stops:[[14,2.5],[17,5],[19,9],[20,15],[21,28]]}}},{id:"road-casing-major",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","motorway","trunk","primary"],minzoom:5,paint:{color:"#d4ab68",width:{stops:[[6,1.6],[10,3.4],[14,8],[16,14],[18,30],[19,45],[20,90],[21,180],[22,360]]},elevation:.15,widthFromData:true,widthExtra:2.5}},{id:"road-casing-secondary",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","secondary","tertiary"],minzoom:9,paint:{color:{stops:[[16,"#c6bca6"],[18.5,"#d4ab68"]]},width:{stops:[[10,1.6],[14,5.5],[16,10],[18,22],[19,33],[20,66],[21,132],[22,264]]},elevation:.13,widthFromData:true,widthExtra:2}},{id:"road-casing-minor",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","minor","service","track"],minzoom:12,paint:{color:{stops:[[16,"#cdc4b2"],[18.5,"#d4ab68"]]},width:{stops:[[13,1.4],[16,6],[18,14],[19,22],[20,44],[21,88],[22,176]]},elevation:.11,widthFromData:true,widthExtra:1.5}},{id:"road-rail",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","rail","transit"],minzoom:10,paint:{color:"#b2a99e",width:{stops:[[10,.8],[14,1.8],[18,4],[19,5.5],[20,11],[21,22],[22,44]]},elevation:.12}},{id:"road-path",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","path","pedestrian","footway","steps"],minzoom:14,paint:{color:"#bdb2a0",width:{stops:[[14,.8],[17,2],[19,4],[20,8],[21,16],[22,32]]},dashArray:[4,3],material:"asphalt",materialScale:2,elevation:.05}},{id:"road-minor",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","minor","service","track"],minzoom:12,paint:{color:{stops:[[16,"#ffffff"],[18.5,"#ffdfa3"]]},width:{stops:[[13,.6],[16,4],[18,11],[19,18],[20,36],[21,72],[22,144]]},material:"asphalt",materialScale:3,elevation:.14,widthFromData:true}},{id:"road-ramp",network:"roads",type:"line","source-layer":"transportation",filter:["all",["in","class","motorway","trunk","primary"],["has","ramp"]],minzoom:5,paint:{color:"#ffdfa3",width:{stops:[[6,.8],[10,2.2],[14,6],[16,11],[18,25],[19,38.5],[20,77],[21,154],[22,308]]},material:"asphalt",materialScale:3,elevation:.18,widthFromData:true}},{id:"road-secondary",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","secondary","tertiary"],minzoom:9,paint:{color:{stops:[[16,"#ffffff"],[18.5,"#ffdfa3"]]},width:{stops:[[10,.8],[14,3.6],[16,7.5],[18,18],[19,28],[20,56],[21,112],[22,224]]},material:"asphalt",materialScale:3,elevation:.16,widthFromData:true}},{id:"road-major",network:"roads",type:"line","source-layer":"transportation",filter:["all",["in","class","motorway","trunk","primary"],["!has","ramp"]],minzoom:5,paint:{color:"#ffdfa3",width:{stops:[[6,.8],[10,2.2],[14,6],[16,11],[18,25],[19,38.5],[20,77],[21,154],[22,308]]},material:"asphalt",materialScale:3,elevation:.18,widthFromData:true}},{id:"road-lane-divider-major",network:"roads",type:"line","source-layer":"transportation",filter:["all",["!has","oneway"],["in","class","motorway","trunk","primary"]],minzoom:16.5,paint:{color:"#e3bd7f",width:{stops:[[16.5,.54],[17,.78],[18,1.4],[19,2.17],[20,4.34],[21,8.68],[22,17.36]]},dashArray:[7,18],material:"flat",elevation:.182}},{id:"road-lane-divider-secondary",network:"roads",type:"line","source-layer":"transportation",filter:["all",["!has","oneway"],["in","class","secondary","tertiary"]],minzoom:16.5,paint:{color:"#d8cfbc",width:{stops:[[16.5,.46],[17,.67],[18,1.2],[19,1.86],[20,3.72],[21,7.44],[22,14.88]]},dashArray:[7,18],material:"flat",elevation:.162}},{id:"boundary",type:"line","source-layer":"boundary",filter:["<=","admin_level",4],paint:{color:"#b3a6b8",opacity:.7,width:{stops:[[4,.7],[10,1.4],[16,2.4]]},dashArray:[6,4]}},{id:"building",type:"fill-extrusion","source-layer":"building",minzoom:15,paint:{color:"#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:true},{id:"road-closed",type:"line",source:"closures","source-layer":"closures",minzoom:11,paint:{color:"#d92b2b",width:{stops:[[11,2.5],[14,4],[17,7],[19,11],[20,22],[21,44],[22,88]]},dashArray:[5,4]},overlay:true},{id:"road-closed-end",type:"symbol",source:"closures","source-layer":"closure_ends",minzoom:13,layout:{iconImage:"road_closed",iconFrame:"circle",iconFrameScale:1.6,allowOverlap:true,priority:6},paint:{color:"#d92b2b",frameColor:"#d92b2b",frameOpacity:1,frameHaloColor:"#ffffff",frameHaloWidth:1.4,iconColor:"#ffffff",iconHaloWidth:0,iconSize:13}},{id:"crossing",type:"surface",weld:0,source:"points","source-layer":"crossings",minzoom:16.5,overlay:true,paint:{color:"#ffffff",opacity:.9,sideShade:.16},elevation:.09,bevel:.05,bevelDrop:.02,groundBy:{"landcover:wood":.7,"landcover:forest":.7,"landcover:grass":.5,"landcover:farmland":.5,"landcover:meadow":.5,"landcover:sand":.12,"landcover:beach":.12,"landcover:wetland":.15,"landcover:swamp":.15,"landuse:pitch":.35,"landuse:stadium":.35,"landuse:playground":.35,"landuse:track":.35,"landuse:swimming_pool":.35,"landuse:cemetery":.3,"landuse:grave_yard":.3,"park:park":.6}},{id:"housenumber",type:"symbol","source-layer":"housenumber",minzoom:17,layout:{textField:"{housenumber}",textSize:{stops:[[17,9],[19,11]]},maxLineChars:6,priority:-60},paint:{color:"#8c8478",haloColor:"#f5f3ee",haloWidth:1}},{id:"poi-food",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#c2681c",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#c2681c",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","cafe","restaurant","fast_food","bar","pub","beer","bakery","ice_cream"]},{id:"poi-shop",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#2f77c4",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#2f77c4",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","shop","clothing_store","grocery","alcohol_shop","music","laundry","hairdresser","car","bicycle"]},{id:"poi-transport",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#3b82a6",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#3b82a6",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","bus","railway","parking","fuel","bicycle_parking","bicycle_rental","taxi","airport"]},{id:"poi-health",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#c24444",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#c24444",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","pharmacy","hospital","doctors","dentist","veterinary"]},{id:"poi-education",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#3f7f7a",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#3f7f7a",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","school","college","university","library","kindergarten"]},{id:"poi-culture",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#8b5aa5",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#8b5aa5",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","museum","theatre","cinema","art_gallery","attraction","monument","zoo","theme_park","castle","place_of_worship","information"]},{id:"poi-sport",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#4f8b45",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#4f8b45",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","pitch","park","garden","playground","stadium","sports_centre","swimming_pool","athletics","running"]},{id:"poi-lodging",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#7a5fbf",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#7a5fbf",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","lodging"]},{id:"poi-service",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#59636e",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#59636e",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","bank","atm","post","office","town_hall","police","fire_station","toilets"]},{id:"poi",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#4a4a4a",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#4a4a4a",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["!in","class","cafe","restaurant","fast_food","bar","pub","beer","bakery","ice_cream","shop","clothing_store","grocery","alcohol_shop","music","laundry","hairdresser","car","bicycle","bus","railway","parking","fuel","bicycle_parking","bicycle_rental","taxi","airport","pharmacy","hospital","doctors","dentist","veterinary","school","college","university","library","kindergarten","museum","theatre","cinema","art_gallery","attraction","monument","zoo","theme_park","castle","place_of_worship","information","pitch","park","garden","playground","stadium","sports_centre","swimming_pool","athletics","running","lodging","bank","atm","post","office","town_hall","police","fire_station","toilets"]},{id:"traffic-signal",type:"symbol",source:"points","source-layer":"roadpoints",minzoom:16,filter:["==","kind","traffic_signals"],layout:{iconImage:"traffic_signals",priority:3},paint:{color:"#5c6470",haloColor:"#ffffff",haloWidth:1.4,iconSize:15}},{id:"road-shield",type:"symbol","source-layer":"transportation_name",filter:["has","ref"],minzoom:11,layout:{textField:"{ref}",iconImage:"shield-{ref_length}",iconPlacement:"behind",textSize:{stops:[[11,9.5],[16,11]]},iconTextGap:4,maxLineChars:10,collisionPadding:70,priority:3},paint:{color:"#3a4048",haloColor:"#f7f3e8",haloWidth:.5,iconColor:"#f7f3e8",iconHaloColor:"#8a8172",iconHaloWidth:1.4}},{id:"road-label",type:"symbol","source-layer":"transportation_name",minzoom:14,layout:{textField:["{name:ru}","{name}"],textPlacement:"line",textSize:{stops:[[14,10],[18,13]]},priority:20,abbreviate:true},paint:{color:"#5c5646",haloColor:"#ffffff",haloWidth:1.6}},{id:"water-label",type:"symbol","source-layer":"water_name",minzoom:10,layout:{textField:["{name:ru}","{name}"],textSize:{stops:[[10,11],[16,14]]},priority:30},paint:{color:"#3d7ea6",haloColor:"#ffffff",haloWidth:1.4}},{id:"place-label",type:"symbol","source-layer":"place",minzoom:4,layout:{textField:["{name:ru}","{name}"],textSize:{stops:[[6,12],[12,17],[16,22]]},maxLineChars:16,priority:90},paint:{color:"#3a3a3a",haloColor:"#ffffff",haloWidth:1.8}},{id:"indoor-shell",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","level"],minzoom:16,paint:{color:"#f6f3ec",opacity:.97},clipToTile:true},{id:"indoor-corridor",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","corridor"],minzoom:16,paint:{color:"#ffffff"},clipToTile:true},{id:"indoor-room",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["in","class","room","area"],minzoom:16,paint:{color:"#efeae0"},clipToTile:true},{id:"indoor-service",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","service"],minzoom:16,paint:{color:"#e6e1d6"},clipToTile:true},{id:"indoor-shop",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","shop"],minzoom:16,paint:{color:"#e8e0f0"},clipToTile:true},{id:"indoor-food",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","food"],minzoom:16,paint:{color:"#f7e3cd"},clipToTile:true},{id:"indoor-wc",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","wc"],minzoom:16,paint:{color:"#d8e8f2"},clipToTile:true},{id:"indoor-wall",type:"fill-extrusion",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","wall"],minzoom:16,paint:{color:"#cbc4b8",roofColor:"#e4ded2",facadeDetail:0,tintVariation:0,roofVariation:0,aoStrength:0}},{id:"indoor-transportation",type:"fill",source:"indoor","source-layer":"transportation",splitBy:"level",minzoom:16,paint:{color:"#d9d2e8",opacity:.95},clipToTile:true},{id:"indoor-door",type:"symbol",source:"indoor","source-layer":"poi",filter:["==","class","door"],splitBy:"level",minzoom:18,layout:{iconImage:"door",iconSize:{stops:[[18,9],[20,13]]},allowOverlap:true,priority:-10},paint:{color:"#8a8172",haloColor:"#ffffff",haloWidth:1.2}},{id:"indoor-poi",type:"symbol",source:"indoor","source-layer":"poi",splitBy:"level",minzoom:17,layout:{textField:["{name}"],iconImage:"{class}",textSize:{stops:[[17,10],[19,12]]},iconSize:{stops:[[17,12],[19,15]]},iconTextGap:2,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#4a4a4a",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:.32}},{id:"indoor-name",type:"symbol",source:"indoor","source-layer":"area_name",splitBy:"level",minzoom:17,layout:{textField:["{name}"],textSize:{stops:[[17,10.5],[19,12.5]]},maxLineChars:8},paint:{color:"#3c3830",haloColor:"#ffffff",haloWidth:1.4}},{id:"building-entrance",type:"symbol",source:"points","source-layer":"entrances",minzoom:17,layout:{iconImage:"entrance",showFor:"highlight",textField:["{ref}"],textSize:{stops:[[17,10],[19,12.5]]},allowOverlap:true,priority:40,iconRotate:"angle",placement:"map",arrowLength:{stops:[[17,22],[18,32],[19,40],[20,48],[22,56]]},arrowWidth:{stops:[[17,6],[18,8.5],[19,10.5],[20,12.5],[22,15]]},arrowOutline:{stops:[[17,1.4],[18,2],[19,2.5],[20,3],[22,3.5]]},arrowGap:{stops:[[17,14],[18,19],[19,23],[20,27],[22,31]]},arrowUnits:"pixels",iconTextGap:3,arrowDotRadius:{stops:[[17,2.2],[18,3.2],[19,4],[20,4.8],[22,5.6]]},arrowDotGap:{stops:[[17,5],[18,7],[19,9],[20,11],[22,12.5]]}},paint:{color:"#2d6ecb",haloColor:"#ffffff",haloWidth:1.6}}],sources:{indoor:{url:"/tileserver/data/indoor/{z}/{x}/{y}.pbf",minzoom:15,maxzoom:18},points:{url:"/tileserver/data/points/{z}/{x}/{y}.pbf",minzoom:13,maxzoom:16},closures:{url:"/tileserver/data/closures/{z}/{x}/{y}.pbf",minzoom:10,maxzoom:16}}};var $a={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:"landcover-wood",type:"surface","source-layer":"landcover",filter:["in","class","wood","forest"],paint:{color:"#c6dcb4",opacity:{stops:[[8,.5],[12,.85]]},material:"flat",sideShade:.16},elevation:.175,bevel:.125,bevelDrop:.038,cornerRadius:10,cornerSegments:4},{id:"landcover-grass",type:"surface","source-layer":"landcover",filter:["in","class","grass","farmland","meadow"],paint:{color:"#d9e6c6",opacity:{stops:[[8,.45],[12,.8]]},material:"flat",sideShade:.16},elevation:.125,bevel:.113,bevelDrop:.03,cornerRadius:8,cornerSegments:4},{id:"landcover-sand",type:"surface","source-layer":"landcover",filter:["in","class","sand","beach"],paint:{color:"#f2e7c8",material:"flat",sideShade:.16},elevation:.035,bevel:.15,bevelDrop:.02,cornerRadius:10,cornerSegments:4},{id:"landcover-ice",type:"fill","source-layer":"landcover",filter:["in","class","ice","glacier"],paint:{color:"#e6f2f7"}},{id:"landcover-wetland",type:"surface","source-layer":"landcover",filter:["in","class","wetland","swamp"],paint:{color:"#cfe0d4",material:"flat",sideShade:.16},elevation:.045,bevel:.125,bevelDrop:.02,cornerRadius:8,cornerSegments:4},{id:"landuse-residential",type:"surface","source-layer":"landuse",filter:["in","class","residential","suburb","neighbourhood","quarter"],paint:{color:"#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","source-layer":"water",filter:["!in","class","swimming_pool"],paint:{color:"#a5cbe3",material:"water",materialScale:14,materialSpeed:1,sideShade:0},elevation:-0.087,bevel:.2,bevelDrop:.03,cornerRadius:7,cornerSegments:4},{id:"water-pool",type:"surface","source-layer":"water",filter:["==","class","swimming_pool"],paint:{color:"#9fd3e8",material:"water",materialScale:8,materialSpeed:1,sideShade:0},elevation:-0.05,bevel:.1,bevelDrop:.02,cornerRadius:4,cornerSegments:3},{id:"waterway",type:"line","source-layer":"waterway",paint:{color:"#a5cbe3",width:{stops:[[8,.6],[12,1.4],[16,4],[19,11.5],[20,23],[21,46],[22,92]]},material:"water",materialScale:10,materialSpeed:1,elevation:-0.075}},{id:"aeroway-line",type:"line","source-layer":"aeroway",filter:["in","class","runway","taxiway"],paint:{color:"#d8d5da",width:{stops:[[10,1],[14,5],[18,24],[19,24],[20,48],[21,96],[22,192]]},material:"flat",elevation:.02}},{id:"road-bridge-outline",type:"line",network:"roads","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","motorway","trunk","primary","secondary","tertiary","minor","service","track"]],minzoom:14,paint:{elevation:.025,color:{from:"road-casing-major",darken:.2},width:{stops:[[6,1.6],[10,3.4],[14,8],[16,14],[18,30],[19,45],[20,90],[21,180],[22,360]]},widthFromData:true,widthExtra:5.5}},{id:"road-bridge-outline-thin",type:"line",network:"roads","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","path","pedestrian","footway","steps","rail","transit"]],minzoom:14,paint:{elevation:.025,color:{from:"road-casing-major",darken:.2},width:{stops:[[14,2.5],[17,5],[19,9],[20,15],[21,28]]}}},{id:"road-casing-major",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","motorway","trunk","primary"],minzoom:5,paint:{color:"#d4ab68",width:{stops:[[6,1.6],[10,3.4],[14,8],[16,14],[18,30],[19,45],[20,90],[21,180],[22,360]]},elevation:.037,widthFromData:true,widthExtra:2.5}},{id:"road-casing-secondary",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","secondary","tertiary"],minzoom:9,paint:{color:{stops:[[16,"#c6bca6"],[18.5,"#d4ab68"]]},width:{stops:[[10,1.6],[14,5.5],[16,10],[18,22],[19,33],[20,66],[21,132],[22,264]]},elevation:.033,widthFromData:true,widthExtra:2}},{id:"road-casing-minor",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","minor","service","track"],minzoom:12,paint:{color:{stops:[[16,"#cdc4b2"],[18.5,"#d4ab68"]]},width:{stops:[[13,1.4],[16,6],[18,14],[19,22],[20,44],[21,88],[22,176]]},elevation:.028,widthFromData:true,widthExtra:1.5}},{id:"road-rail",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","rail","transit"],minzoom:10,paint:{color:"#b2a99e",width:{stops:[[10,.8],[14,1.8],[18,4],[19,5.5],[20,11],[21,22],[22,44]]},elevation:.03}},{id:"road-path",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","path","pedestrian","footway","steps"],minzoom:14,paint:{color:"#bdb2a0",width:{stops:[[14,.8],[17,2],[19,4],[20,8],[21,16],[22,32]]},dashArray:[4,3],material:"flat",elevation:.013}},{id:"road-minor",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","minor","service","track"],minzoom:12,paint:{color:{stops:[[16,"#ffffff"],[18.5,"#ffdfa3"]]},width:{stops:[[13,.6],[16,4],[18,11],[19,18],[20,36],[21,72],[22,144]]},material:"flat",elevation:.035,widthFromData:true}},{id:"road-ramp",network:"roads",type:"line","source-layer":"transportation",filter:["all",["in","class","motorway","trunk","primary"],["has","ramp"]],minzoom:5,paint:{color:"#ffdfa3",width:{stops:[[6,.8],[10,2.2],[14,6],[16,11],[18,25],[19,38.5],[20,77],[21,154],[22,308]]},material:"flat",elevation:.045,widthFromData:true}},{id:"road-secondary",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","secondary","tertiary"],minzoom:9,paint:{color:{stops:[[16,"#ffffff"],[18.5,"#ffdfa3"]]},width:{stops:[[10,.8],[14,3.6],[16,7.5],[18,18],[19,28],[20,56],[21,112],[22,224]]},material:"flat",elevation:.04,widthFromData:true}},{id:"road-major",network:"roads",type:"line","source-layer":"transportation",filter:["all",["in","class","motorway","trunk","primary"],["!has","ramp"]],minzoom:5,paint:{color:"#ffdfa3",width:{stops:[[6,.8],[10,2.2],[14,6],[16,11],[18,25],[19,38.5],[20,77],[21,154],[22,308]]},material:"flat",elevation:.045,widthFromData:true}},{id:"road-lane-divider-major",network:"roads",type:"line","source-layer":"transportation",filter:["all",["!has","oneway"],["in","class","motorway","trunk","primary"]],minzoom:16.5,paint:{color:"#e3bd7f",width:{stops:[[16.5,.54],[17,.78],[18,1.4],[19,2.17],[20,4.34],[21,8.68],[22,17.36]]},dashArray:[7,18],material:"flat",elevation:.047}},{id:"road-lane-divider-secondary",network:"roads",type:"line","source-layer":"transportation",filter:["all",["!has","oneway"],["in","class","secondary","tertiary"]],minzoom:16.5,paint:{color:"#d8cfbc",width:{stops:[[16.5,.46],[17,.67],[18,1.2],[19,1.86],[20,3.72],[21,7.44],[22,14.88]]},dashArray:[7,18],material:"flat",elevation:.042}},{id:"boundary",type:"line","source-layer":"boundary",filter:["<=","admin_level",4],paint:{color:"#b3a6b8",opacity:.7,width:{stops:[[4,.7],[10,1.4],[16,2.4]]},dashArray:[6,4]}},{id:"building",type:"fill-extrusion","source-layer":"building",minzoom:15,paint:{color:"#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:true},{id:"road-closed",type:"line",source:"closures","source-layer":"closures",minzoom:11,paint:{color:"#d92b2b",width:{stops:[[11,2.5],[14,4],[17,7],[19,11],[20,22],[21,44],[22,88]]},dashArray:[5,4]},overlay:true},{id:"road-closed-end",type:"symbol",source:"closures","source-layer":"closure_ends",minzoom:13,layout:{iconImage:"road_closed",iconFrame:"circle",iconFrameScale:1.6,allowOverlap:true,priority:6},paint:{color:"#d92b2b",frameColor:"#d92b2b",frameOpacity:1,frameHaloColor:"#ffffff",frameHaloWidth:1.4,iconColor:"#ffffff",iconHaloWidth:0,iconSize:13}},{id:"crossing",type:"surface",weld:0,source:"points","source-layer":"crossings",minzoom:16.5,overlay:true,paint:{color:"#ffffff",opacity:.9,sideShade:.16,material:"flat"},elevation:.023,bevel:.013,bevelDrop:.005,groundBy:{"landcover:wood":.175,"landcover:forest":.175,"landcover:grass":.125,"landcover:farmland":.125,"landcover:meadow":.125,"landcover:sand":.035,"landcover:beach":.035,"landcover:wetland":.045,"landcover:swamp":.045,"landuse:residential":.02,"landuse:suburb":.02,"landuse:neighbourhood":.02,"landuse:quarter":.02,"landuse:industrial":.03,"landuse:quarry":.03,"landuse:railway":.03,"landuse:substation":.03,"landuse:school":.055,"landuse:university":.055,"landuse:college":.055,"landuse:hospital":.055,"landuse:clinic":.055,"landuse:police":.055,"landuse:kindergarten":.055,"landuse:bus_station":.055,"landuse:pitch":.088,"landuse:stadium":.088,"landuse:playground":.088,"landuse:track":.088,"landuse:swimming_pool":.088,"landuse:cemetery":.075,"landuse:grave_yard":.075,"landuse:parking":.19,"landuse:fuel":.19,"park:park":.15,"aeroway:aerodrome":.065,"aeroway:apron":.065,"aeroway:helipad":.065}},{id:"housenumber",type:"symbol","source-layer":"housenumber",minzoom:17,layout:{textField:"{housenumber}",textSize:{stops:[[17,9],[19,11]]},maxLineChars:6,priority:-60},paint:{color:"#8c8478",haloColor:"#f5f3ee",haloWidth:1}},{id:"poi-food",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#c2681c",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#c2681c",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","cafe","restaurant","fast_food","bar","pub","beer","bakery","ice_cream"]},{id:"poi-shop",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#2f77c4",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#2f77c4",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","shop","clothing_store","grocery","alcohol_shop","music","laundry","hairdresser","car","bicycle"]},{id:"poi-transport",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#3b82a6",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#3b82a6",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","bus","railway","parking","fuel","bicycle_parking","bicycle_rental","taxi","airport"]},{id:"poi-health",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#c24444",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#c24444",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","pharmacy","hospital","doctors","dentist","veterinary"]},{id:"poi-education",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#3f7f7a",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#3f7f7a",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","school","college","university","library","kindergarten"]},{id:"poi-culture",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#8b5aa5",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#8b5aa5",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","museum","theatre","cinema","art_gallery","attraction","monument","zoo","theme_park","castle","place_of_worship","information"]},{id:"poi-sport",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#4f8b45",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#4f8b45",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","pitch","park","garden","playground","stadium","sports_centre","swimming_pool","athletics","running"]},{id:"poi-lodging",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#7a5fbf",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#7a5fbf",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","lodging"]},{id:"poi-service",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#59636e",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#59636e",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","bank","atm","post","office","town_hall","police","fire_station","toilets"]},{id:"poi",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#4a4a4a",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#4a4a4a",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["!in","class","cafe","restaurant","fast_food","bar","pub","beer","bakery","ice_cream","shop","clothing_store","grocery","alcohol_shop","music","laundry","hairdresser","car","bicycle","bus","railway","parking","fuel","bicycle_parking","bicycle_rental","taxi","airport","pharmacy","hospital","doctors","dentist","veterinary","school","college","university","library","kindergarten","museum","theatre","cinema","art_gallery","attraction","monument","zoo","theme_park","castle","place_of_worship","information","pitch","park","garden","playground","stadium","sports_centre","swimming_pool","athletics","running","lodging","bank","atm","post","office","town_hall","police","fire_station","toilets"]},{id:"traffic-signal",type:"symbol",source:"points","source-layer":"roadpoints",minzoom:16,filter:["==","kind","traffic_signals"],layout:{iconImage:"traffic_signals",priority:3},paint:{color:"#5c6470",haloColor:"#ffffff",haloWidth:1.4,iconSize:15}},{id:"road-shield",type:"symbol","source-layer":"transportation_name",filter:["has","ref"],minzoom:11,layout:{textField:"{ref}",iconImage:"shield-{ref_length}",iconPlacement:"behind",textSize:{stops:[[11,9.5],[16,11]]},iconTextGap:4,maxLineChars:10,collisionPadding:70,priority:3},paint:{color:"#3a4048",haloColor:"#f7f3e8",haloWidth:.5,iconColor:"#f7f3e8",iconHaloColor:"#8a8172",iconHaloWidth:1.4}},{id:"road-label",type:"symbol","source-layer":"transportation_name",minzoom:14,layout:{textField:["{name:ru}","{name}"],textPlacement:"line",textSize:{stops:[[14,10],[18,13]]},priority:20,abbreviate:true},paint:{color:"#5c5646",haloColor:"#ffffff",haloWidth:1.6}},{id:"water-label",type:"symbol","source-layer":"water_name",minzoom:10,layout:{textField:["{name:ru}","{name}"],textSize:{stops:[[10,11],[16,14]]},priority:30},paint:{color:"#3d7ea6",haloColor:"#ffffff",haloWidth:1.4}},{id:"place-label",type:"symbol","source-layer":"place",minzoom:4,layout:{textField:["{name:ru}","{name}"],textSize:{stops:[[6,12],[12,17],[16,22]]},maxLineChars:16,priority:90},paint:{color:"#3a3a3a",haloColor:"#ffffff",haloWidth:1.8}},{id:"indoor-shell",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","level"],minzoom:16,paint:{color:"#f6f3ec",opacity:.97},clipToTile:true},{id:"indoor-corridor",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","corridor"],minzoom:16,paint:{color:"#ffffff"},clipToTile:true},{id:"indoor-room",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["in","class","room","area"],minzoom:16,paint:{color:"#efeae0"},clipToTile:true},{id:"indoor-service",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","service"],minzoom:16,paint:{color:"#e6e1d6"},clipToTile:true},{id:"indoor-shop",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","shop"],minzoom:16,paint:{color:"#e8e0f0"},clipToTile:true},{id:"indoor-food",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","food"],minzoom:16,paint:{color:"#f7e3cd"},clipToTile:true},{id:"indoor-wc",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","wc"],minzoom:16,paint:{color:"#d8e8f2"},clipToTile:true},{id:"indoor-wall",type:"fill-extrusion",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","wall"],minzoom:16,paint:{color:"#cbc4b8",roofColor:"#e4ded2",facadeDetail:0,tintVariation:0,roofVariation:0,aoStrength:0}},{id:"indoor-transportation",type:"fill",source:"indoor","source-layer":"transportation",splitBy:"level",minzoom:16,paint:{color:"#d9d2e8",opacity:.95},clipToTile:true},{id:"indoor-door",type:"symbol",source:"indoor","source-layer":"poi",filter:["==","class","door"],splitBy:"level",minzoom:18,layout:{iconImage:"door",iconSize:{stops:[[18,9],[20,13]]},allowOverlap:true,priority:-10},paint:{color:"#8a8172",haloColor:"#ffffff",haloWidth:1.2}},{id:"indoor-poi",type:"symbol",source:"indoor","source-layer":"poi",splitBy:"level",minzoom:17,layout:{textField:["{name}"],iconImage:"{class}",textSize:{stops:[[17,10],[19,12]]},iconSize:{stops:[[17,12],[19,15]]},iconTextGap:2,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#4a4a4a",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:.32}},{id:"indoor-name",type:"symbol",source:"indoor","source-layer":"area_name",splitBy:"level",minzoom:17,layout:{textField:["{name}"],textSize:{stops:[[17,10.5],[19,12.5]]},maxLineChars:8},paint:{color:"#3c3830",haloColor:"#ffffff",haloWidth:1.4}},{id:"building-entrance",type:"symbol",source:"points","source-layer":"entrances",minzoom:17,layout:{iconImage:"entrance",showFor:"highlight",textField:["{ref}"],textSize:{stops:[[17,10],[19,12.5]]},allowOverlap:true,priority:40,iconRotate:"angle",placement:"map",arrowLength:{stops:[[17,22],[18,32],[19,40],[20,48],[22,56]]},arrowWidth:{stops:[[17,6],[18,8.5],[19,10.5],[20,12.5],[22,15]]},arrowOutline:{stops:[[17,1.4],[18,2],[19,2.5],[20,3],[22,3.5]]},arrowGap:{stops:[[17,14],[18,19],[19,23],[20,27],[22,31]]},arrowUnits:"pixels",iconTextGap:3,arrowDotRadius:{stops:[[17,2.2],[18,3.2],[19,4],[20,4.8],[22,5.6]]},arrowDotGap:{stops:[[17,5],[18,7],[19,9],[20,11],[22,12.5]]}},paint:{color:"#2d6ecb",haloColor:"#ffffff",haloWidth:1.6}}],sources:{indoor:{url:"/tileserver/data/indoor/{z}/{x}/{y}.pbf",minzoom:15,maxzoom:18},points:{url:"/tileserver/data/points/{z}/{x}/{y}.pbf",minzoom:13,maxzoom:16},closures:{url:"/tileserver/data/closures/{z}/{x}/{y}.pbf",minzoom:10,maxzoom:16}}};var es={name:"\u041D\u043E\u0447\u043D\u0430\u044F",background:"#11151c",model3dKey:"night",light:{ambientColor:"#8fa3c4",ambientIntensity:.34,keyAzimuth:120,keyAltitude:55,keyColor:"#cfd8ea",keyIntensity:.3,fillAzimuth:300,fillAltitude:20,fillColor:"#4a5f86",fillIntensity:.22},paint:{"landcover-wood":{color:"#16261a"},"landcover-grass":{color:"#182619"},"landcover-sand":{color:"#2a2417"},"landcover-ice":{color:"#1b2730"},"landcover-wetland":{color:"#16242a"},"landuse-residential":{color:"#171b23"},"landuse-industrial":{color:"#1b1c20"},"landuse-civic":{color:"#1c1f28"},"landuse-sport":{color:"#16261c"},"landuse-cemetery":{color:"#182018"},"landuse-parking":{color:"#191d24"},park:{color:"#15271a"},"aeroway-area":{color:"#1b1e26"},water:{color:"#0f2438"},"water-pool":{color:"#123048"},waterway:{color:"#14304a"},"aeroway-line":{color:"#242833"},"road-casing-major":{color:"#2a2519"},"road-casing-secondary":{color:{stops:[[16,"#22262f"],[18.5,"#2a2519"]]}},"road-casing-minor":{color:{stops:[[16,"#1e222a"],[18.5,"#2a2519"]]}},"road-rail":{color:"#333842"},"road-path":{color:"#2a2e36"},"road-minor":{color:{stops:[[16,"#2f343d"],[18.5,"#6b5c3c"]]}},"road-secondary":{color:{stops:[[16,"#3c424d"],[18.5,"#6b5c3c"]]}},"road-ramp":{color:"#6b5c3c"},"road-major":{color:"#6b5c3c"},boundary:{color:"#4a3f52"},building:{color:"#232833",roofColor:"#2b313d",aoStrength:.3,tintVariation:.1,windowColor:"#8fb8e8",windowFrameColor:"#39424f",windowGlow:.35},housenumber:{color:"#5f6672",haloColor:"#12161d"},poi:{color:"#c3ccd9",haloColor:"#12161d",haloWidth:1.3},"road-label":{color:"#a8b0bd",haloColor:"#12161d",haloWidth:1.5},"water-label":{color:"#6ea2c7",haloColor:"#0e1b28"},"place-label":{color:"#e2e7ee",haloColor:"#10141b",haloWidth:2},"poi-food":{color:"#d89964",haloColor:"#12161d",haloWidth:1.3,frameColor:"#d89964",frameOpacity:1,frameHaloColor:"#12161d",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-shop":{color:"#699cd4",haloColor:"#12161d",haloWidth:1.3,frameColor:"#699cd4",frameOpacity:1,frameHaloColor:"#12161d",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-transport":{color:"#75acc8",haloColor:"#12161d",haloWidth:1.3,frameColor:"#75acc8",frameOpacity:1,frameHaloColor:"#12161d",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-health":{color:"#ca7272",haloColor:"#12161d",haloWidth:1.3,frameColor:"#ca7272",frameOpacity:1,frameHaloColor:"#12161d",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-education":{color:"#81bbb7",haloColor:"#12161d",haloWidth:1.3,frameColor:"#81bbb7",frameOpacity:1,frameHaloColor:"#12161d",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-culture":{color:"#a684b8",haloColor:"#12161d",haloWidth:1.3,frameColor:"#a684b8",frameOpacity:1,frameHaloColor:"#12161d",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-sport":{color:"#89bb81",haloColor:"#12161d",haloWidth:1.3,frameColor:"#89bb81",frameOpacity:1,frameHaloColor:"#12161d",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-lodging":{color:"#8e79c3",haloColor:"#12161d",haloWidth:1.3,frameColor:"#8e79c3",frameOpacity:1,frameHaloColor:"#12161d",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-service":{color:"#959ea7",haloColor:"#12161d",haloWidth:1.3,frameColor:"#959ea7",frameOpacity:1,frameHaloColor:"#12161d",iconColor:"#1b1b1b",iconHaloWidth:0},"building-entrance":{color:"#79a0d7",haloColor:"#12161d"},"indoor-shell":{color:"#3a4254",opacity:.97},"indoor-corridor":{color:"#363d4e"},"indoor-room":{color:"#414a5f"},"indoor-service":{color:"#535f79"},"indoor-shop":{color:"#5c4672"},"indoor-food":{color:"#725d46"},"indoor-wc":{color:"#466172"},"indoor-wall":{color:"#697183",roofColor:"#868c99",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#65548a",opacity:.95},"indoor-door":{color:"#c3ccd9",haloColor:"#12161d",haloWidth:1.3},"indoor-poi":{color:"#c3ccd9",haloColor:"#12161d",haloWidth:1.3},"indoor-name":{color:"#e2e7ee",haloColor:"#10141b",haloWidth:2}},sky:{skyColor:"#080d18",horizonColor:"#1b2436",fogRange:[1.3,6.5],fogIntensity:.9,spaceColor:"#02030a",atmosphereColor:"#3f6fa8",starIntensity:.8}};var ts={name:"\u0413\u0440\u0430\u0444\u0438\u0442",background:"#eeeeee",light:{ambientColor:"#ffffff",ambientIntensity:.55,keyAzimuth:120,keyAltitude:60,keyColor:"#ffffff",keyIntensity:.5,fillAzimuth:300,fillAltitude:25,fillColor:"#ffffff",fillIntensity:.16},paint:{"landcover-wood":{color:"#e2e2e2"},"landcover-grass":{color:"#e7e7e7"},"landcover-sand":{color:"#eaeaea"},"landcover-ice":{color:"#f0f0f0"},"landcover-wetland":{color:"#e4e4e4"},"landuse-residential":{color:"#e9e9e9"},"landuse-industrial":{color:"#e5e5e5"},"landuse-civic":{color:"#ebebeb"},"landuse-sport":{color:"#e4e4e4"},"landuse-cemetery":{color:"#e6e6e6"},"landuse-parking":{color:"#ececec"},park:{color:"#e3e3e3"},"aeroway-area":{color:"#e8e8e8"},water:{color:"#d4d4d4"},"water-pool":{color:"#d8d8d8"},waterway:{color:"#d4d4d4"},"aeroway-line":{color:"#dedede"},"road-casing-major":{color:"#c9c9c9"},"road-casing-secondary":{color:{stops:[[16,"#d2d2d2"],[18.5,"#c9c9c9"]]}},"road-casing-minor":{color:{stops:[[16,"#d8d8d8"],[18.5,"#c9c9c9"]]}},"road-rail":{color:"#c2c2c2"},"road-path":{color:"#d0d0d0"},"road-minor":{color:{stops:[[16,"#f7f7f7"],[18.5,"#ffffff"]]}},"road-secondary":{color:{stops:[[16,"#fbfbfb"],[18.5,"#ffffff"]]}},"road-ramp":{color:"#ffffff"},"road-major":{color:"#ffffff"},boundary:{color:"#b0b0b0"},building:{color:"#dcdcdc",roofColor:"#e0e0e0",aoStrength:.22,tintVariation:.05,windowColor:"#b7bcc2",windowFrameColor:"#f2f2f2",windowGlow:0},housenumber:{color:"#9a9a9a",haloColor:"#f4f4f4"},poi:{color:"#3c3c3c",haloColor:"#ffffff"},"road-label":{color:"#585858",haloColor:"#ffffff"},"water-label":{color:"#6e6e6e",haloColor:"#ffffff"},"place-label":{color:"#2a2a2a",haloColor:"#ffffff"},"poi-food":{color:"#3c3c3c",haloColor:"#ffffff",frameColor:"#3c3c3c",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{color:"#3c3c3c",haloColor:"#ffffff",frameColor:"#3c3c3c",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{color:"#3c3c3c",haloColor:"#ffffff",frameColor:"#3c3c3c",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{color:"#3c3c3c",haloColor:"#ffffff",frameColor:"#3c3c3c",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{color:"#3c3c3c",haloColor:"#ffffff",frameColor:"#3c3c3c",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{color:"#3c3c3c",haloColor:"#ffffff",frameColor:"#3c3c3c",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{color:"#3c3c3c",haloColor:"#ffffff",frameColor:"#3c3c3c",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{color:"#3c3c3c",haloColor:"#ffffff",frameColor:"#3c3c3c",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{color:"#3c3c3c",haloColor:"#ffffff",frameColor:"#3c3c3c",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"building-entrance":{color:"#564e4e",haloColor:"#ffffff"},"indoor-shell":{color:"#e9e9e9",opacity:.97},"indoor-corridor":{color:"#eeeeee"},"indoor-room":{color:"#e2e2e2"},"indoor-service":{color:"#cecece"},"indoor-shop":{color:"#d7cfdf"},"indoor-food":{color:"#dfd7cf"},"indoor-wc":{color:"#cfd9df"},"indoor-wall":{color:"#c0c0c0",roofColor:"#d4d4d4",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#c2bbd1",opacity:.95},"indoor-door":{color:"#3c3c3c",haloColor:"#ffffff"},"indoor-poi":{color:"#3c3c3c",haloColor:"#ffffff"},"indoor-name":{color:"#2a2a2a",haloColor:"#ffffff"}},sky:{skyColor:"#8f96a0",horizonColor:"#d7dade",fogRange:[1.35,7.5],fogIntensity:.9,spaceColor:"#07080b",atmosphereColor:"#9aa3ad",starIntensity:.5}};var os={name:"\u0411\u043B\u0435\u0434\u043D\u0430\u044F",background:"#f7f6f3",light:{ambientColor:"#ffffff",ambientIntensity:.62,keyAzimuth:120,keyAltitude:65,keyColor:"#fffaf0",keyIntensity:.38,fillAzimuth:300,fillAltitude:25,fillColor:"#eef2f8",fillIntensity:.14},paint:{"landcover-wood":{color:"#e8efe2"},"landcover-grass":{color:"#edf2e6"},"landcover-sand":{color:"#f4eede"},"landcover-ice":{color:"#f0f5f7"},"landcover-wetland":{color:"#e8f0ec"},"landuse-residential":{color:"#f2f0ec"},"landuse-industrial":{color:"#f0edeb"},"landuse-civic":{color:"#f4efe9"},"landuse-sport":{color:"#e9f1e4"},"landuse-cemetery":{color:"#ecefe6"},"landuse-parking":{color:"#f3f1ed"},park:{color:"#e7f0df"},"aeroway-area":{color:"#f0f0f2"},water:{color:"#dce9f2"},"water-pool":{color:"#dcecf5"},waterway:{color:"#dce9f2"},"aeroway-line":{color:"#ebebee"},"road-casing-major":{color:"#efe4d2"},"road-casing-secondary":{color:{stops:[[16,"#eceae2"],[18.5,"#efe4d2"]]}},"road-casing-minor":{color:{stops:[[16,"#efedE6"],[18.5,"#efe4d2"]]}},"road-rail":{color:"#e0dcd6"},"road-path":{color:"#e6e2da"},"road-minor":{color:{stops:[[16,"#fdfcfa"],[18.5,"#fff8e8"]]}},"road-secondary":{color:{stops:[[16,"#ffffff"],[18.5,"#fff8e8"]]}},"road-ramp":{color:"#fff8e8"},"road-major":{color:"#fff8e8"},boundary:{color:"#cfc3d2"},building:{color:"#eae7e0",roofColor:"#ecE9e2",aoStrength:.14,tintVariation:.04,windowColor:"#c7d6e4",windowFrameColor:"#f6f7f9",windowGlow:0},housenumber:{color:"#a9a296",haloColor:"#fbfaf7"},poi:{color:"#6b6b6b",haloColor:"#ffffff"},"road-label":{color:"#8a8474",haloColor:"#ffffff"},"water-label":{color:"#7ea8c4",haloColor:"#ffffff"},"place-label":{color:"#55524c",haloColor:"#ffffff"},"poi-food":{color:"#6b6b6b",haloColor:"#ffffff",frameColor:"#6b6b6b",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{color:"#6b6b6b",haloColor:"#ffffff",frameColor:"#6b6b6b",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{color:"#6b6b6b",haloColor:"#ffffff",frameColor:"#6b6b6b",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{color:"#6b6b6b",haloColor:"#ffffff",frameColor:"#6b6b6b",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{color:"#6b6b6b",haloColor:"#ffffff",frameColor:"#6b6b6b",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{color:"#6b6b6b",haloColor:"#ffffff",frameColor:"#6b6b6b",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{color:"#6b6b6b",haloColor:"#ffffff",frameColor:"#6b6b6b",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{color:"#6b6b6b",haloColor:"#ffffff",frameColor:"#6b6b6b",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{color:"#6b6b6b",haloColor:"#ffffff",frameColor:"#6b6b6b",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"building-entrance":{color:"#564e4e",haloColor:"#ffffff"},"indoor-shell":{color:"#f4f3f0",opacity:.97},"indoor-corridor":{color:"#f8f7f6"},"indoor-room":{color:"#edece8"},"indoor-service":{color:"#dcd9d1"},"indoor-shop":{color:"#e0dae6"},"indoor-food":{color:"#e6e0da"},"indoor-wc":{color:"#dae1e6"},"indoor-wall":{color:"#cdcbc4",roofColor:"#e0dedb",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#ccc5d9",opacity:.95},"indoor-door":{color:"#6b6b6b",haloColor:"#ffffff"},"indoor-poi":{color:"#6b6b6b",haloColor:"#ffffff"},"indoor-name":{color:"#55524c",haloColor:"#ffffff"}},sky:{skyColor:"#c8dbee",horizonColor:"#eef2f6",fogRange:[1.4,9],fogIntensity:.85,spaceColor:"#0a1018",atmosphereColor:"#9fd0ff",starIntensity:.45}};var rs={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:[1.34,7.36],fogIntensity:.86,spaceColor:"#0e0b0a",atmosphereColor:"#5daad0",starIntensity:.38}};var ns={name:"\u041C\u0443\u043B\u044C\u0442\u044F\u0448\u043D\u0430\u044F",background:"#f7f3de",light:{ambientColor:"#f8f7f7",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#ffffff",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#dee8ed",fillIntensity:.18},paint:{"landcover-wood":{color:"#61d161"},"landcover-grass":{color:"#91e481"},"landcover-sand":{color:"#efeac8"},"landcover-ice":{color:"#c7dfeb"},"landcover-wetland":{color:"#9fccd1"},"landuse-residential":{color:"#f2ecd9"},"landuse-industrial":{color:"#d7d9e4"},"landuse-civic":{color:"#ead7dd"},"landuse-sport":{color:"#9fec79"},"landuse-cemetery":{color:"#a8d69f"},"landuse-parking":{color:"#dddcda"},park:{color:"#91e481"},"aeroway-area":{color:"#d6dbeb"},water:{color:"#71c8f4"},waterway:{color:"#71c8f4"},"aeroway-line":{color:"#f0ede9"},"road-casing-major":{color:"#ca6a16"},"road-casing-secondary":{color:{stops:[[16,"#5a6faf"],[18.5,"#ca6a16"]]}},"road-casing-minor":{color:{stops:[[16,"#5a6faf"],[18.5,"#ca6a16"]]}},"road-rail":{color:"#737373"},"road-path":{color:"#ffffff"},"road-minor":{color:{stops:[[16,"#ffffff"],[18.5,"#f8c662"]]}},"road-secondary":{color:{stops:[[16,"#ffffff"],[18.5,"#f8c662"]]}},"road-ramp":{color:"#f8c662"},"road-major":{color:"#f8c662"},boundary:{color:"#f6517a"},building:{color:"#f4dfc2",roofColor:"#f4dfc2",aoStrength:.19,tintVariation:.06,windowColor:"#5b9ee0",windowFrameColor:"#ffffff",windowGlow:0},housenumber:{color:"#222b59",haloColor:"#ffffff",haloWidth:1.4},poi:{color:"#f05a0f",haloColor:"#ffffff",haloWidth:1.4},"road-label":{color:"#222b59",haloColor:"#ffffff",haloWidth:1.4},"water-label":{color:"#35688d",haloColor:"#f7f7f7",haloWidth:1.4},"place-label":{color:"#222b59",haloColor:"#ffffff",haloWidth:1.4},"poi-food":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#c2681c",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#2f77c4",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#3b82a6",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#c24444",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#3f7f7a",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#8b5aa5",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#4f8b45",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#7a5fbf",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#59636e",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"water-pool":{color:"#80d1fa"},"indoor-shell":{color:"#ebe9e5",opacity:.97},"indoor-corridor":{color:"#efedea"},"indoor-room":{color:"#e5e1dc"},"indoor-service":{color:"#d4cec6"},"indoor-shop":{color:"#d6cede"},"indoor-food":{color:"#ded6ce"},"indoor-wc":{color:"#ced8de"},"indoor-wall":{color:"#c4c0ba",roofColor:"#d6d4d0",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#c1b9d1",opacity:.95},"indoor-door":{color:"#f05a0f",haloColor:"#ffffff",haloWidth:1.4},"indoor-poi":{color:"#f05a0f",haloColor:"#ffffff",haloWidth:1.4},"indoor-name":{color:"#222b59",haloColor:"#ffffff",haloWidth:1.4},"building-entrance":{color:"#225aaa",haloColor:"#ffffff"}},sky:{skyColor:"#8cb5c9",horizonColor:"#e8e2c7",fogRange:[1.34,7.35],fogIntensity:.86,spaceColor:"#131105",atmosphereColor:"#5ca9d0",starIntensity:.39}};var is={name:"\u041A\u0438\u0431\u0435\u0440\u043F\u0430\u043D\u043A",background:"#120817",model3dKey:"night",light:{ambientColor:"#b279cf",ambientIntensity:.34,keyAzimuth:120,keyAltitude:55,keyColor:"#ff70d0",keyIntensity:.28,fillAzimuth:300,fillAltitude:25,fillColor:"#854770",fillIntensity:.22},paint:{"landcover-wood":{color:"#0c3728"},"landcover-grass":{color:"#104131"},"landcover-sand":{color:"#262417"},"landcover-ice":{color:"#74345f"},"landcover-wetland":{color:"#152223"},"landuse-residential":{color:"#170b1e"},"landuse-industrial":{color:"#171921"},"landuse-civic":{color:"#21171a"},"landuse-sport":{color:"#0c4529"},"landuse-cemetery":{color:"#151e1b"},"landuse-parking":{color:"#272428"},park:{color:"#104131"},"aeroway-area":{color:"#1a1c23"},water:{color:"#5f1145"},waterway:{color:"#711452"},"aeroway-line":{color:"#55493a"},"road-casing-major":{color:"#981662"},"road-casing-secondary":{color:{stops:[[16,"#6a1b6a"],[18.5,"#981662"]]}},"road-casing-minor":{color:{stops:[[16,"#6a1b6a"],[18.5,"#981662"]]}},"road-rail":{color:"#39acac"},"road-path":{color:"#12e2e2"},"road-minor":{color:{stops:[[16,"#12e2e2"],[18.5,"#f631a4"]]}},"road-secondary":{color:{stops:[[16,"#12e2e2"],[18.5,"#f631a4"]]}},"road-ramp":{color:"#f631a4"},"road-major":{color:"#f631a4"},boundary:{color:"#f53da8"},building:{color:"#311839",roofColor:"#9d2575",aoStrength:.29,tintVariation:.1,windowColor:"#84dcff",windowFrameColor:"#84dcff",windowGlow:.5},housenumber:{color:"#acf6f6",haloColor:"#110514",haloWidth:1.4},poi:{color:"#f6e95a",haloColor:"#110514",haloWidth:1.4},"road-label":{color:"#acf6f6",haloColor:"#110514",haloWidth:1.4},"water-label":{color:"#9fbcd1",haloColor:"#131b20",haloWidth:1.4},"place-label":{color:"#acf6f6",haloColor:"#110514",haloWidth:1.4},"poi-food":{color:"#d89964",haloColor:"#110514",haloWidth:1.4,frameColor:"#d89964",frameOpacity:1,frameHaloColor:"#110514",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-shop":{color:"#699cd4",haloColor:"#110514",haloWidth:1.4,frameColor:"#699cd4",frameOpacity:1,frameHaloColor:"#110514",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-transport":{color:"#75acc8",haloColor:"#110514",haloWidth:1.4,frameColor:"#75acc8",frameOpacity:1,frameHaloColor:"#110514",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-health":{color:"#ca7272",haloColor:"#110514",haloWidth:1.4,frameColor:"#ca7272",frameOpacity:1,frameHaloColor:"#110514",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-education":{color:"#81bbb7",haloColor:"#110514",haloWidth:1.4,frameColor:"#81bbb7",frameOpacity:1,frameHaloColor:"#110514",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-culture":{color:"#a684b8",haloColor:"#110514",haloWidth:1.4,frameColor:"#a684b8",frameOpacity:1,frameHaloColor:"#110514",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-sport":{color:"#89bb81",haloColor:"#110514",haloWidth:1.4,frameColor:"#89bb81",frameOpacity:1,frameHaloColor:"#110514",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-lodging":{color:"#8e79c3",haloColor:"#110514",haloWidth:1.4,frameColor:"#8e79c3",frameOpacity:1,frameHaloColor:"#110514",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-service":{color:"#959ea7",haloColor:"#110514",haloWidth:1.4,frameColor:"#959ea7",frameOpacity:1,frameHaloColor:"#110514",iconColor:"#1b1b1b",iconHaloWidth:0},"water-pool":{color:"#84135f"},"indoor-shell":{color:"#4c3752",opacity:.97},"indoor-corridor":{color:"#46334c"},"indoor-room":{color:"#553e5d"},"indoor-service":{color:"#6e5078"},"indoor-shop":{color:"#59446f"},"indoor-food":{color:"#6f5a44"},"indoor-wc":{color:"#445e6f"},"indoor-wall":{color:"#7b6681",roofColor:"#938298",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#635287",opacity:.95},"indoor-door":{color:"#f6e95a",haloColor:"#110514",haloWidth:1.4},"indoor-poi":{color:"#f6e95a",haloColor:"#110514",haloWidth:1.4},"indoor-name":{color:"#acf6f6",haloColor:"#110514",haloWidth:1.4},"building-entrance":{color:"#79a0d7",haloColor:"#110514"}},sky:{skyColor:"#180813",horizonColor:"#281831",fogRange:[1.3,6.5],fogIntensity:.9,spaceColor:"#060308",atmosphereColor:"#b5358b",starIntensity:.82}};var as={name:"\u0420\u0430\u0441\u0441\u0432\u0435\u0442",background:"#f4ebe1",light:{ambientColor:"#f8f7f7",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#ffe0c0",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#dee7ed",fillIntensity:.18},paint:{"landcover-wood":{color:"#a4db9f"},"landcover-grass":{color:"#bae7b1"},"landcover-sand":{color:"#efeac8"},"landcover-ice":{color:"#dbe7f0"},"landcover-wetland":{color:"#c1dee1"},"landuse-residential":{color:"#f5efeb"},"landuse-industrial":{color:"#d7d9e4"},"landuse-civic":{color:"#ead7dd"},"landuse-sport":{color:"#c1ecac"},"landuse-cemetery":{color:"#c8e5c2"},"landuse-parking":{color:"#dddbda"},park:{color:"#bae7b1"},"aeroway-area":{color:"#d6dbeb"},water:{color:"#a6d2f2"},waterway:{color:"#a6d2f2"},"aeroway-line":{color:"#f0ede9"},"road-casing-major":{color:"#92a1bf"},"road-casing-secondary":{color:{stops:[[16,"#a6afc9"],[18.5,"#92a1bf"]]}},"road-casing-minor":{color:{stops:[[16,"#a6afc9"],[18.5,"#92a1bf"]]}},"road-rail":{color:"#b5a49b"},"road-path":{color:"#c3c9df"},"road-minor":{color:{stops:[[16,"#c3c9df"],[18.5,"#a9b9d1"]]}},"road-secondary":{color:{stops:[[16,"#c3c9df"],[18.5,"#a9b9d1"]]}},"road-ramp":{color:"#a9b9d1"},"road-major":{color:"#a9b9d1"},boundary:{color:"#f584a1"},building:{color:"#f6ebdf",roofColor:"#fdede7",aoStrength:.19,tintVariation:.06,windowColor:"#6b9ed1",windowFrameColor:"#f0ece8",windowGlow:0},housenumber:{color:"#46332a",haloColor:"#fdfaf7",haloWidth:1.4},poi:{color:"#56738f",haloColor:"#fdfaf7",haloWidth:1.4},"road-label":{color:"#46332a",haloColor:"#fdfaf7",haloWidth:1.4},"water-label":{color:"#35688d",haloColor:"#f7f7f7",haloWidth:1.4},"place-label":{color:"#46332a",haloColor:"#fdfaf7",haloWidth:1.4},"poi-food":{haloColor:"#fdfaf7",haloWidth:1.4,frameColor:"#c2681c",frameOpacity:1,frameHaloColor:"#fdfaf7",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{haloColor:"#fdfaf7",haloWidth:1.4,frameColor:"#2f77c4",frameOpacity:1,frameHaloColor:"#fdfaf7",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{haloColor:"#fdfaf7",haloWidth:1.4,frameColor:"#3b82a6",frameOpacity:1,frameHaloColor:"#fdfaf7",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{haloColor:"#fdfaf7",haloWidth:1.4,frameColor:"#c24444",frameOpacity:1,frameHaloColor:"#fdfaf7",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{haloColor:"#fdfaf7",haloWidth:1.4,frameColor:"#3f7f7a",frameOpacity:1,frameHaloColor:"#fdfaf7",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{haloColor:"#fdfaf7",haloWidth:1.4,frameColor:"#8b5aa5",frameOpacity:1,frameHaloColor:"#fdfaf7",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{haloColor:"#fdfaf7",haloWidth:1.4,frameColor:"#4f8b45",frameOpacity:1,frameHaloColor:"#fdfaf7",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{haloColor:"#fdfaf7",haloWidth:1.4,frameColor:"#7a5fbf",frameOpacity:1,frameHaloColor:"#fdfaf7",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{haloColor:"#fdfaf7",haloWidth:1.4,frameColor:"#59636e",frameOpacity:1,frameHaloColor:"#fdfaf7",iconColor:"#ffffff",iconHaloWidth:0},"water-pool":{color:"#b9ddf7"},"indoor-shell":{color:"#f8f7f5",opacity:.97},"indoor-corridor":{color:"#fcfbfb"},"indoor-room":{color:"#f1efed"},"indoor-service":{color:"#e0dbd6"},"indoor-shop":{color:"#e4dfea"},"indoor-food":{color:"#eae4df"},"indoor-wc":{color:"#dfe5ea"},"indoor-wall":{color:"#d1cdc9",roofColor:"#e4e2e0",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#d0cbdc",opacity:.95},"indoor-door":{color:"#56738f",haloColor:"#fdfaf7",haloWidth:1.4},"indoor-poi":{color:"#56738f",haloColor:"#fdfaf7",haloWidth:1.4},"indoor-name":{color:"#46332a",haloColor:"#fdfaf7",haloWidth:1.4},"building-entrance":{color:"#225aaa",haloColor:"#fdfaf7"}},sky:{skyColor:"#8cb0c9",horizonColor:"#e4d7cb",fogRange:[1.34,7.35],fogIntensity:.86,spaceColor:"#120c07",atmosphereColor:"#5c9fd0",starIntensity:.39}};var ss={name:"\u0421\u0443\u043C\u0435\u0440\u043A\u0438",background:"#d7cbc1",light:{ambientColor:"#ececeb",ambientIntensity:.46,keyAzimuth:120,keyAltitude:59,keyColor:"#ffcaa0",keyIntensity:.56,fillAzimuth:300,fillAltitude:25,fillColor:"#c7d0e1",fillIntensity:.19},paint:{"landcover-wood":{color:"#75af6a"},"landcover-grass":{color:"#94bd7f"},"landcover-sand":{color:"#efeac8"},"landcover-ice":{color:"#c1c8d7"},"landcover-wetland":{color:"#83bec3"},"landuse-residential":{color:"#d5cac3"},"landuse-industrial":{color:"#b3b7cc"},"landuse-civic":{color:"#d5aebb"},"landuse-sport":{color:"#91c775"},"landuse-cemetery":{color:"#9ac982"},"landuse-parking":{color:"#c0bcb9"},park:{color:"#94bd7f"},"aeroway-area":{color:"#d6dbeb"},water:{color:"#708bc2"},waterway:{color:"#708bc2"},"aeroway-line":{color:"#f0ede9"},"road-casing-major":{color:"#6a5b9a"},"road-casing-secondary":{color:{stops:[[16,"#7078a4"],[18.5,"#6a5b9a"]]}},"road-casing-minor":{color:{stops:[[16,"#7078a4"],[18.5,"#6a5b9a"]]}},"road-rail":{color:"#93796c"},"road-path":{color:"#8f94b7"},"road-minor":{color:{stops:[[16,"#8f94b7"],[18.5,"#8576b2"]]}},"road-secondary":{color:{stops:[[16,"#8f94b7"],[18.5,"#8576b2"]]}},"road-ramp":{color:"#8576b2"},"road-major":{color:"#8576b2"},boundary:{color:"#e05275"},building:{color:"#e0d1c2",roofColor:"#f1d6cb",aoStrength:.2,tintVariation:.07,windowColor:"#6b9ed1",windowFrameColor:"#efe6df",windowGlow:0},housenumber:{color:"#2c283e",haloColor:"#f5ebe0",haloWidth:1.4},poi:{color:"#64568f",haloColor:"#f5ebe0",haloWidth:1.4},"road-label":{color:"#2c283e",haloColor:"#f5ebe0",haloWidth:1.4},"water-label":{color:"#35688d",haloColor:"#f7f7f7",haloWidth:1.4},"place-label":{color:"#2c283e",haloColor:"#f5ebe0",haloWidth:1.4},"poi-food":{haloColor:"#f5ebe0",haloWidth:1.4,frameColor:"#c2681c",frameOpacity:1,frameHaloColor:"#f5ebe0",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{haloColor:"#f5ebe0",haloWidth:1.4,frameColor:"#2f77c4",frameOpacity:1,frameHaloColor:"#f5ebe0",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{haloColor:"#f5ebe0",haloWidth:1.4,frameColor:"#3b82a6",frameOpacity:1,frameHaloColor:"#f5ebe0",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{haloColor:"#f5ebe0",haloWidth:1.4,frameColor:"#c24444",frameOpacity:1,frameHaloColor:"#f5ebe0",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{haloColor:"#f5ebe0",haloWidth:1.4,frameColor:"#3f7f7a",frameOpacity:1,frameHaloColor:"#f5ebe0",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{haloColor:"#f5ebe0",haloWidth:1.4,frameColor:"#8b5aa5",frameOpacity:1,frameHaloColor:"#f5ebe0",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{haloColor:"#f5ebe0",haloWidth:1.4,frameColor:"#4f8b45",frameOpacity:1,frameHaloColor:"#f5ebe0",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{haloColor:"#f5ebe0",haloWidth:1.4,frameColor:"#7a5fbf",frameOpacity:1,frameHaloColor:"#f5ebe0",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{haloColor:"#f5ebe0",haloWidth:1.4,frameColor:"#59636e",frameOpacity:1,frameHaloColor:"#f5ebe0",iconColor:"#ffffff",iconHaloWidth:0},"water-pool":{color:"#7a94ca"},"indoor-shell":{color:"#e3deda",opacity:.97},"indoor-corridor":{color:"#e7e3df"},"indoor-room":{color:"#dcd7d1"},"indoor-service":{color:"#cbc3ba"},"indoor-shop":{color:"#ccc2d6"},"indoor-food":{color:"#d6ccc2"},"indoor-wc":{color:"#c2ced6"},"indoor-wall":{color:"#bbb5af",roofColor:"#cdc9c6",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#b6adc9",opacity:.95},"indoor-door":{color:"#64568f",haloColor:"#f5ebe0",haloWidth:1.4},"indoor-poi":{color:"#64568f",haloColor:"#f5ebe0",haloWidth:1.4},"indoor-name":{color:"#2c283e",haloColor:"#f5ebe0",haloWidth:1.4},"building-entrance":{haloColor:"#f5ebe0"}},sky:{skyColor:"#5675b3",horizonColor:"#c0b4aa",fogRange:[1.33,7.14],fogIntensity:.87,spaceColor:"#0e0b09",atmosphereColor:"#557dce",starIntensity:.45}};var ls={name:"\u0417\u0435\u043C\u043B\u044F",background:"#dbd1bd",light:{ambientColor:"#edecea",ambientIntensity:.46,keyAzimuth:120,keyAltitude:59,keyColor:"#fff2dc",keyIntensity:.56,fillAzimuth:300,fillAltitude:25,fillColor:"#c7d6e1",fillIntensity:.19},paint:{"landcover-wood":{color:"#50a136"},"landcover-grass":{color:"#8ac76b"},"landcover-sand":{color:"#efeac8"},"landcover-ice":{color:"#aec5d6"},"landcover-wetland":{color:"#7cbac0"},"landuse-residential":{color:"#ded5c4"},"landuse-industrial":{color:"#b3b7cc"},"landuse-civic":{color:"#d5aebb"},"landuse-sport":{color:"#86d161"},"landuse-cemetery":{color:"#94c67b"},"landuse-parking":{color:"#c0beb9"},park:{color:"#8ac76b"},"aeroway-area":{color:"#d6dbeb"},water:{color:"#3b91ce"},waterway:{color:"#4798d1"},"aeroway-line":{color:"#f0ede9"},"road-casing-major":{color:"#a47546"},"road-casing-secondary":{color:{stops:[[16,"#a79376"],[18.5,"#a47546"]]}},"road-casing-minor":{color:{stops:[[16,"#a79376"],[18.5,"#a47546"]]}},"road-rail":{color:"#877564"},"road-path":{color:"#c6bba9"},"road-minor":{color:{stops:[[16,"#c6bba9"],[18.5,"#cdaa7a"]]}},"road-secondary":{color:{stops:[[16,"#c6bba9"],[18.5,"#cdaa7a"]]}},"road-ramp":{color:"#cdaa7a"},"road-major":{color:"#cdaa7a"},boundary:{color:"#bf6a40"},building:{color:"#d4c5af",roofColor:"#d4c5af",aoStrength:.2,tintVariation:.07,windowColor:"#9fb0c0",windowFrameColor:"#eceae4",windowGlow:0},housenumber:{color:"#46382a",haloColor:"#f7f4ee",haloWidth:1.4},poi:{color:"#7c5c3c",haloColor:"#f7f4ee",haloWidth:1.4},"road-label":{color:"#46382a",haloColor:"#f7f4ee",haloWidth:1.4},"water-label":{color:"#35688d",haloColor:"#f7f7f7",haloWidth:1.4},"place-label":{color:"#46382a",haloColor:"#f7f4ee",haloWidth:1.4},"poi-food":{haloColor:"#f7f4ee",haloWidth:1.4,frameColor:"#c2681c",frameOpacity:1,frameHaloColor:"#f7f4ee",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{haloColor:"#f7f4ee",haloWidth:1.4,frameColor:"#2f77c4",frameOpacity:1,frameHaloColor:"#f7f4ee",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{haloColor:"#f7f4ee",haloWidth:1.4,frameColor:"#3b82a6",frameOpacity:1,frameHaloColor:"#f7f4ee",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{haloColor:"#f7f4ee",haloWidth:1.4,frameColor:"#c24444",frameOpacity:1,frameHaloColor:"#f7f4ee",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{haloColor:"#f7f4ee",haloWidth:1.4,frameColor:"#3f7f7a",frameOpacity:1,frameHaloColor:"#f7f4ee",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{haloColor:"#f7f4ee",haloWidth:1.4,frameColor:"#8b5aa5",frameOpacity:1,frameHaloColor:"#f7f4ee",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{haloColor:"#f7f4ee",haloWidth:1.4,frameColor:"#4f8b45",frameOpacity:1,frameHaloColor:"#f7f4ee",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{haloColor:"#f7f4ee",haloWidth:1.4,frameColor:"#7a5fbf",frameOpacity:1,frameHaloColor:"#f7f4ee",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{haloColor:"#f7f4ee",haloWidth:1.4,frameColor:"#59636e",frameOpacity:1,frameHaloColor:"#f7f4ee",iconColor:"#ffffff",iconHaloWidth:0},"water-pool":{color:"#4299d7"},"indoor-shell":{color:"#d6d0c8",opacity:.97},"indoor-corridor":{color:"#d9d5cd"},"indoor-room":{color:"#cfc9bf"},"indoor-service":{color:"#beb5a9"},"indoor-shop":{color:"#bcafca"},"indoor-food":{color:"#cabdaf"},"indoor-wc":{color:"#afbfca"},"indoor-wall":{color:"#ada79e",roofColor:"#bebbb5",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#a69bbc",opacity:.95},"indoor-door":{color:"#7c5c3c",haloColor:"#f7f4ee",haloWidth:1.4},"indoor-poi":{color:"#7c5c3c",haloColor:"#f7f4ee",haloWidth:1.4},"indoor-name":{color:"#46382a",haloColor:"#f7f4ee",haloWidth:1.4},"building-entrance":{haloColor:"#f7f4ee"}},sky:{skyColor:"#568db3",horizonColor:"#c4baa5",fogRange:[1.33,7.14],fogIntensity:.87,spaceColor:"#0f0c08",atmosphereColor:"#559cce",starIntensity:.45}};var cs={name:"\u0424\u0443\u0442\u0443\u0440\u0438\u0437\u043C",background:"#0c0f1d",model3dKey:"night",light:{ambientColor:"#8590c7",ambientIntensity:.34,keyAzimuth:120,keyAltitude:55,keyColor:"#8ff0ff",keyIntensity:.28,fillAzimuth:300,fillAltitude:25,fillColor:"#477b85",fillIntensity:.22},paint:{"landcover-wood":{color:"#123026"},"landcover-grass":{color:"#18392e"},"landcover-sand":{color:"#2d2a1b"},"landcover-ice":{color:"#276672"},"landcover-wetland":{color:"#192829"},"landuse-residential":{color:"#111422"},"landuse-industrial":{color:"#1b1d27"},"landuse-civic":{color:"#271b1f"},"landuse-sport":{color:"#143d29"},"landuse-cemetery":{color:"#192420"},"landuse-parking":{color:"#292a2e"},park:{color:"#18392e"},"aeroway-area":{color:"#1e2129"},water:{color:"#055261"},waterway:{color:"#076a7e"},"aeroway-line":{color:"#55493a"},"road-casing-major":{color:"#8b238b"},"road-casing-secondary":{color:{stops:[[16,"#185662"],[18.5,"#8b238b"]]}},"road-casing-minor":{color:{stops:[[16,"#185662"],[18.5,"#8b238b"]]}},"road-rail":{color:"#8546a4"},"road-path":{color:"#22b6c3"},"road-minor":{color:{stops:[[16,"#22b6c3"],[18.5,"#e03ee0"]]}},"road-secondary":{color:{stops:[[16,"#22b6c3"],[18.5,"#e03ee0"]]}},"road-ramp":{color:"#e03ee0"},"road-major":{color:"#e03ee0"},boundary:{color:"#eb47eb"},building:{color:"#1e2b3e",roofColor:"#277686",aoStrength:.29,tintVariation:.1,windowColor:"#84dcff",windowFrameColor:"#bfe6ff",windowGlow:.5},housenumber:{color:"#c6edf1",haloColor:"#080a17",haloWidth:1.4},poi:{color:"#eb84eb",haloColor:"#080a17",haloWidth:1.4},"road-label":{color:"#c6edf1",haloColor:"#080a17",haloWidth:1.4},"water-label":{color:"#9fbcd1",haloColor:"#131b20",haloWidth:1.4},"place-label":{color:"#c6edf1",haloColor:"#080a17",haloWidth:1.4},"poi-food":{color:"#d89964",haloColor:"#080a17",haloWidth:1.4,frameColor:"#d89964",frameOpacity:1,frameHaloColor:"#080a17",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-shop":{color:"#699cd4",haloColor:"#080a17",haloWidth:1.4,frameColor:"#699cd4",frameOpacity:1,frameHaloColor:"#080a17",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-transport":{color:"#75acc8",haloColor:"#080a17",haloWidth:1.4,frameColor:"#75acc8",frameOpacity:1,frameHaloColor:"#080a17",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-health":{color:"#ca7272",haloColor:"#080a17",haloWidth:1.4,frameColor:"#ca7272",frameOpacity:1,frameHaloColor:"#080a17",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-education":{color:"#81bbb7",haloColor:"#080a17",haloWidth:1.4,frameColor:"#81bbb7",frameOpacity:1,frameHaloColor:"#080a17",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-culture":{color:"#a684b8",haloColor:"#080a17",haloWidth:1.4,frameColor:"#a684b8",frameOpacity:1,frameHaloColor:"#080a17",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-sport":{color:"#89bb81",haloColor:"#080a17",haloWidth:1.4,frameColor:"#89bb81",frameOpacity:1,frameHaloColor:"#080a17",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-lodging":{color:"#8e79c3",haloColor:"#080a17",haloWidth:1.4,frameColor:"#8e79c3",frameOpacity:1,frameHaloColor:"#080a17",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-service":{color:"#959ea7",haloColor:"#080a17",haloWidth:1.4,frameColor:"#959ea7",frameOpacity:1,frameHaloColor:"#080a17",iconColor:"#1b1b1b",iconHaloWidth:0},"water-pool":{color:"#027288"},"indoor-shell":{color:"#394556",opacity:.97},"indoor-corridor":{color:"#354050"},"indoor-room":{color:"#404d60"},"indoor-service":{color:"#52637b"},"indoor-shop":{color:"#5c4672"},"indoor-food":{color:"#725d46"},"indoor-wc":{color:"#466172"},"indoor-wall":{color:"#687485",roofColor:"#858e9a",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#66558a",opacity:.95},"indoor-door":{color:"#eb84eb",haloColor:"#080a17",haloWidth:1.4},"indoor-poi":{color:"#eb84eb",haloColor:"#080a17",haloWidth:1.4},"indoor-name":{color:"#c6edf1",haloColor:"#080a17",haloWidth:1.4},"building-entrance":{color:"#79a0d7",haloColor:"#080a17"}},sky:{skyColor:"#081619",horizonColor:"#1b1f30",fogRange:[1.3,6.51],fogIntensity:.9,spaceColor:"#030408",atmosphereColor:"#35a1b7",starIntensity:.81}};var fs={name:"\u0421\u0442\u0435\u043A\u043B\u043E \u043C\u044F\u0433\u043A\u043E\u0435",background:"#f2f5f7",light:{ambientColor:"#fbfbfb",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#ffffff",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#dee9ed",fillIntensity:.18},paint:{"landcover-wood":{color:"#bddbc3"},"landcover-grass":{color:"#d0ecda"},"landcover-sand":{color:"#efeac8"},"landcover-ice":{color:"#cbebdb"},"landcover-wetland":{color:"#d9ebed"},"landuse-residential":{color:"#f6f7f9"},"landuse-industrial":{color:"#e3e5ed"},"landuse-civic":{color:"#f1e4e8"},"landuse-sport":{color:"#cdefd4"},"landuse-cemetery":{color:"#dbf0e3"},"landuse-parking":{color:"#e4e6e7"},park:{color:"#ccead9"},"aeroway-area":{color:"#d6dbeb"},water:{color:"#b9e5f4"},waterway:{color:"#81c6e4"},"aeroway-line":{color:"#f0ede9"},"road-casing-major":{color:"#dabc95"},"road-casing-secondary":{color:{stops:[[16,"#d5cdb8"],[18.5,"#dabc95"]]}},"road-casing-minor":{color:{stops:[[16,"#cad1d8"],[18.5,"#dabc95"]]}},"road-rail":{color:"#a5a0b1"},"road-path":{color:"#9fbcad"},"road-minor":{color:{stops:[[16,"#ffffff"],[18.5,"#f8e5c3"]]}},"road-secondary":{color:{stops:[[16,"#fbf6ea"],[18.5,"#f8e5c3"]]}},"road-ramp":{color:"#f8e5c3"},"road-major":{color:"#f8e5c3"},boundary:{color:"#ce97c0"},building:{color:"#e5ebf0",roofColor:"#f7fbfd",aoStrength:.18,tintVariation:.06,windowColor:"#bcd4e8",windowFrameColor:"#dfe8f2",windowGlow:0},housenumber:{color:"#4e6779",haloColor:"#fbfdfe",haloWidth:1.4},poi:{color:"#4e6779",haloColor:"#fbfdfe",haloWidth:1.4},"road-label":{color:"#2f3f50",haloColor:"#fbfdfe",haloWidth:1.4},"water-label":{color:"#35688d",haloColor:"#f7f7f7",haloWidth:1.4},"place-label":{color:"#2f3f50",haloColor:"#fbfdfe",haloWidth:1.4},"poi-food":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#c2681c",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#2f77c4",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#3b82a6",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#c24444",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#3f7f7a",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#8b5aa5",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#4f8b45",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#7a5fbf",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#59636e",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"water-pool":{color:"#ceeef9"},"indoor-shell":{color:"#f5f7f8",opacity:.97},"indoor-corridor":{color:"#fbfbfc"},"indoor-room":{color:"#edeff1"},"indoor-service":{color:"#d6dce0"},"indoor-shop":{color:"#e4dfea"},"indoor-food":{color:"#eae4df"},"indoor-wc":{color:"#dfe5ea"},"indoor-wall":{color:"#c9ced1",roofColor:"#e0e2e4",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#d0cbdc",opacity:.95},"indoor-door":{color:"#4e6779",haloColor:"#fbfdfe",haloWidth:1.4},"indoor-poi":{color:"#4e6779",haloColor:"#fbfdfe",haloWidth:1.4},"indoor-name":{color:"#2f3f50",haloColor:"#fbfdfe",haloWidth:1.4},"building-entrance":{color:"#225aaa",haloColor:"#fbfdfe"}},sky:{skyColor:"#9fc5d2",horizonColor:"#dfe3e8",fogRange:[1.35,7.42],fogIntensity:.85,spaceColor:"#090c0f",atmosphereColor:"#5fb3d0",starIntensity:.37}};var us={name:"\u0421\u0442\u0435\u043A\u043B\u043E",background:"#f2f5f7",light:{ambientColor:"#fbfbfb",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#ffffff",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#dee9ed",fillIntensity:.18},paint:{"landcover-wood":{color:"#b8e0cf"},"landcover-grass":{color:"#cbebdb"},"landcover-sand":{color:"#efeac8"},"landcover-ice":{color:"#e5f0f3"},"landcover-wetland":{color:"#d6e9eb"},"landuse-residential":{color:"#f6f7f9"},"landuse-industrial":{color:"#e3e5ed"},"landuse-civic":{color:"#f1e4e8"},"landuse-sport":{color:"#c8efd5"},"landuse-cemetery":{color:"#d8eee3"},"landuse-parking":{color:"#e4e6e7"},park:{color:"#cbebdb"},"aeroway-area":{color:"#d6dbeb"},water:{color:"#bee6f4"},waterway:{color:"#bee6f4"},"aeroway-line":{color:"#f0ede9"},"road-casing-major":{color:"#9dc7dd"},"road-casing-secondary":{color:{stops:[[16,"#bdcfdb"],[18.5,"#9dc7dd"]]}},"road-casing-minor":{color:{stops:[[16,"#bdcfdb"],[18.5,"#9dc7dd"]]}},"road-rail":{color:"#adb9c2"},"road-path":{color:"#d6e2eb"},"road-minor":{color:{stops:[[16,"#d6e2eb"],[18.5,"#b8daea"]]}},"road-secondary":{color:{stops:[[16,"#d6e2eb"],[18.5,"#b8daea"]]}},"road-ramp":{color:"#b8daea"},"road-major":{color:"#b8daea"},boundary:{color:"#e28dc6"},building:{color:"#e8eef3",roofColor:"#f4f8fb",aoStrength:.18,tintVariation:.06,windowColor:"#bcd4e8",windowFrameColor:"#dfe8f2",windowGlow:0},housenumber:{color:"#2d4053",haloColor:"#fbfdfe",haloWidth:1.4},poi:{color:"#457aa1",haloColor:"#fbfdfe",haloWidth:1.4},"road-label":{color:"#2d4053",haloColor:"#fbfdfe",haloWidth:1.4},"water-label":{color:"#35688d",haloColor:"#f7f7f7",haloWidth:1.4},"place-label":{color:"#2d4053",haloColor:"#fbfdfe",haloWidth:1.4},"poi-food":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#c2681c",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#2f77c4",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#3b82a6",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#c24444",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#3f7f7a",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#8b5aa5",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#4f8b45",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#7a5fbf",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#59636e",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"water-pool":{color:"#d3eff9"},"indoor-shell":{color:"#f5f7f8",opacity:.97},"indoor-corridor":{color:"#fbfbfc"},"indoor-room":{color:"#edeff1"},"indoor-service":{color:"#d6dce0"},"indoor-shop":{color:"#e4dfea"},"indoor-food":{color:"#eae4df"},"indoor-wc":{color:"#dfe5ea"},"indoor-wall":{color:"#c9ced1",roofColor:"#e0e2e4",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#d0cbdc",opacity:.95},"indoor-door":{color:"#457aa1",haloColor:"#fbfdfe",haloWidth:1.4},"indoor-poi":{color:"#457aa1",haloColor:"#fbfdfe",haloWidth:1.4},"indoor-name":{color:"#2d4053",haloColor:"#fbfdfe",haloWidth:1.4},"building-entrance":{color:"#225aaa",haloColor:"#fbfdfe"}},sky:{skyColor:"#9fc5d2",horizonColor:"#dfe3e8",fogRange:[1.35,7.42],fogIntensity:.85,spaceColor:"#090c10",atmosphereColor:"#5fb3d0",starIntensity:.37}};var hs={name:"\u0413\u0430\u0440\u043C\u043E\u043D\u0438\u044F \u0447\u0451\u0440\u043D\u0430\u044F",background:"#1a1a1a",model3dKey:"night",light:{ambientColor:"#a8a8a8",ambientIntensity:.34,keyAzimuth:120,keyAltitude:55,keyColor:"#cccccc",keyIntensity:.29,fillAzimuth:300,fillAltitude:25,fillColor:"#854747",fillIntensity:.22},paint:{"landcover-wood":{color:"#212121"},"landcover-grass":{color:"#292929"},"landcover-sand":{color:"#33301f"},"landcover-ice":{color:"#545454"},"landcover-wetland":{color:"#1d2e30"},"landuse-residential":{color:"#1f1f1f"},"landuse-industrial":{color:"#1f222d"},"landuse-civic":{color:"#2d1f24"},"landuse-sport":{color:"#2d2525"},"landuse-cemetery":{color:"#2a1d1d"},"landuse-parking":{color:"#332e2e"},park:{color:"#292929"},"aeroway-area":{color:"#23262f"},water:{color:"#383838"},waterway:{color:"#3d3d3d"},"aeroway-line":{color:"#55493a"},"road-casing-major":{color:"#525252"},"road-casing-secondary":{color:{stops:[[16,"#383838"],[18.5,"#525252"]]}},"road-casing-minor":{color:{stops:[[16,"#383838"],[18.5,"#525252"]]}},"road-rail":{color:"#595959"},"road-path":{color:"#525252"},"road-minor":{color:{stops:[[16,"#525252"],[18.5,"#757575"]]}},"road-secondary":{color:{stops:[[16,"#525252"],[18.5,"#757575"]]}},"road-ramp":{color:"#757575"},"road-major":{color:"#757575"},boundary:{color:"#808080"},building:{color:"#2e2e2e",roofColor:"#4f4f4f",aoStrength:.29,tintVariation:.1,windowColor:"#8fb8e8",windowFrameColor:"#c8ccd4",windowGlow:.36},housenumber:{color:"#d9d9d9",haloColor:"#0a0a0a",haloWidth:1.4},poi:{color:"#a3a3a3",haloColor:"#0a0a0a",haloWidth:1.4},"road-label":{color:"#d9d9d9",haloColor:"#0a0a0a",haloWidth:1.4},"water-label":{color:"#9fbcd1",haloColor:"#131b20",haloWidth:1.4},"place-label":{color:"#d9d9d9",haloColor:"#0a0a0a",haloWidth:1.4},"poi-food":{color:"#a3a3a3",haloColor:"#0a0a0a",haloWidth:1.4,frameColor:"#a3a3a3",frameOpacity:1,frameHaloColor:"#0a0a0a",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-shop":{color:"#a3a3a3",haloColor:"#0a0a0a",haloWidth:1.4,frameColor:"#a3a3a3",frameOpacity:1,frameHaloColor:"#0a0a0a",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-transport":{color:"#a3a3a3",haloColor:"#0a0a0a",haloWidth:1.4,frameColor:"#a3a3a3",frameOpacity:1,frameHaloColor:"#0a0a0a",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-health":{color:"#a3a3a3",haloColor:"#0a0a0a",haloWidth:1.4,frameColor:"#a3a3a3",frameOpacity:1,frameHaloColor:"#0a0a0a",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-education":{color:"#a3a3a3",haloColor:"#0a0a0a",haloWidth:1.4,frameColor:"#a3a3a3",frameOpacity:1,frameHaloColor:"#0a0a0a",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-culture":{color:"#a3a3a3",haloColor:"#0a0a0a",haloWidth:1.4,frameColor:"#a3a3a3",frameOpacity:1,frameHaloColor:"#0a0a0a",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-sport":{color:"#a3a3a3",haloColor:"#0a0a0a",haloWidth:1.4,frameColor:"#a3a3a3",frameOpacity:1,frameHaloColor:"#0a0a0a",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-lodging":{color:"#a3a3a3",haloColor:"#0a0a0a",haloWidth:1.4,frameColor:"#a3a3a3",frameOpacity:1,frameHaloColor:"#0a0a0a",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-service":{color:"#a3a3a3",haloColor:"#0a0a0a",haloWidth:1.4,frameColor:"#a3a3a3",frameOpacity:1,frameHaloColor:"#0a0a0a",iconColor:"#1b1b1b",iconHaloWidth:0},"water-pool":{color:"#4c4c4c"},"indoor-shell":{color:"#484848",opacity:.97},"indoor-corridor":{color:"#424242"},"indoor-room":{color:"#505050"},"indoor-service":{color:"#676767"},"indoor-shop":{color:"#5c4672"},"indoor-food":{color:"#725d46"},"indoor-wc":{color:"#466172"},"indoor-wall":{color:"#767676",roofColor:"#909090",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#66558a",opacity:.95},"indoor-door":{color:"#a3a3a3",haloColor:"#0a0a0a",haloWidth:1.4},"indoor-poi":{color:"#a3a3a3",haloColor:"#0a0a0a",haloWidth:1.4},"indoor-name":{color:"#d9d9d9",haloColor:"#0a0a0a",haloWidth:1.4},"building-entrance":{color:"#cac4c4",haloColor:"#0a0a0a"}},sky:{skyColor:"#190909",horizonColor:"#282828",fogRange:[1.3,6.51],fogIntensity:.9,spaceColor:"#060606",atmosphereColor:"#b83535",starIntensity:.8}};var ds={name:"\u0413\u0430\u0440\u043C\u043E\u043D\u0438\u044F \u0441\u0438\u043D\u044F\u044F",background:"#e3e9f2",light:{ambientColor:"#f7f7f7",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#eef4ff",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#dee5ed",fillIntensity:.18},paint:{"landcover-wood":{color:"#a1b8ce"},"landcover-grass":{color:"#bdccdb"},"landcover-sand":{color:"#efeac8"},"landcover-ice":{color:"#baccde"},"landcover-wetland":{color:"#c1dee1"},"landuse-residential":{color:"#ebeff4"},"landuse-industrial":{color:"#d7d9e4"},"landuse-civic":{color:"#ead7dd"},"landuse-sport":{color:"#b8d3e0"},"landuse-cemetery":{color:"#c2d4e5"},"landuse-parking":{color:"#dadbdd"},park:{color:"#bdccdb"},"aeroway-area":{color:"#d6dbeb"},water:{color:"#5799db"},waterway:{color:"#5f9edd"},"aeroway-line":{color:"#f0ede9"},"road-casing-major":{color:"#407fbf"},"road-casing-secondary":{color:{stops:[[16,"#80a1c6"],[18.5,"#407fbf"]]}},"road-casing-minor":{color:{stops:[[16,"#80a1c6"],[18.5,"#407fbf"]]}},"road-rail":{color:"#738dab"},"road-path":{color:"#b0c5dd"},"road-minor":{color:{stops:[[16,"#b0c5dd"],[18.5,"#71a3d6"]]}},"road-secondary":{color:{stops:[[16,"#b0c5dd"],[18.5,"#71a3d6"]]}},"road-ramp":{color:"#71a3d6"},"road-major":{color:"#71a3d6"},boundary:{color:"#478cd1"},building:{color:"#cfdae8",roofColor:"#e5edf6",aoStrength:.19,tintVariation:.06,windowColor:"#6b9ed1",windowFrameColor:"#e8eef6",windowGlow:0},housenumber:{color:"#1f395c",haloColor:"#fbfcfe",haloWidth:1.4},poi:{color:"#3e6da3",haloColor:"#fbfcfe",haloWidth:1.4},"road-label":{color:"#1f395c",haloColor:"#fbfcfe",haloWidth:1.4},"water-label":{color:"#35688d",haloColor:"#f7f7f7",haloWidth:1.4},"place-label":{color:"#1f395c",haloColor:"#fbfcfe",haloWidth:1.4},"poi-food":{haloColor:"#fbfcfe",haloWidth:1.4,frameColor:"#c2681c",frameOpacity:1,frameHaloColor:"#fbfcfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{haloColor:"#fbfcfe",haloWidth:1.4,frameColor:"#2f77c4",frameOpacity:1,frameHaloColor:"#fbfcfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{haloColor:"#fbfcfe",haloWidth:1.4,frameColor:"#3b82a6",frameOpacity:1,frameHaloColor:"#fbfcfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{haloColor:"#fbfcfe",haloWidth:1.4,frameColor:"#c24444",frameOpacity:1,frameHaloColor:"#fbfcfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{haloColor:"#fbfcfe",haloWidth:1.4,frameColor:"#3f7f7a",frameOpacity:1,frameHaloColor:"#fbfcfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{haloColor:"#fbfcfe",haloWidth:1.4,frameColor:"#8b5aa5",frameOpacity:1,frameHaloColor:"#fbfcfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{haloColor:"#fbfcfe",haloWidth:1.4,frameColor:"#4f8b45",frameOpacity:1,frameHaloColor:"#fbfcfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{haloColor:"#fbfcfe",haloWidth:1.4,frameColor:"#7a5fbf",frameOpacity:1,frameHaloColor:"#fbfcfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{haloColor:"#fbfcfe",haloWidth:1.4,frameColor:"#59636e",frameOpacity:1,frameHaloColor:"#fbfcfe",iconColor:"#ffffff",iconHaloWidth:0},"water-pool":{color:"#61a2e3"},"indoor-shell":{color:"#e6e8ec",opacity:.97},"indoor-corridor":{color:"#ebedf0"},"indoor-room":{color:"#dde1e5"},"indoor-service":{color:"#c6ccd4"},"indoor-shop":{color:"#d6cedf"},"indoor-food":{color:"#dfd7ce"},"indoor-wc":{color:"#ced8df"},"indoor-wall":{color:"#babfc5",roofColor:"#d1d4d7",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#c1bad1",opacity:.95},"indoor-door":{color:"#3e6da3",haloColor:"#fbfcfe",haloWidth:1.4},"indoor-poi":{color:"#3e6da3",haloColor:"#fbfcfe",haloWidth:1.4},"indoor-name":{color:"#1f395c",haloColor:"#fbfcfe",haloWidth:1.4},"building-entrance":{color:"#225aaa",haloColor:"#fbfcfe"}},sky:{skyColor:"#8cabc9",horizonColor:"#ced6e1",fogRange:[1.34,7.35],fogIntensity:.86,spaceColor:"#080b10",atmosphereColor:"#5c96d0",starIntensity:.39}};var ps={name:"\u0413\u0430\u0440\u043C\u043E\u043D\u0438\u044F \u0437\u0435\u043B\u0451\u043D\u0430\u044F",background:"#dfecdf",light:{ambientColor:"#f5f6f5",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#f0fff0",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#dcece7",fillIntensity:.18},paint:{"landcover-wood":{color:"#5ccc65"},"landcover-grass":{color:"#8cd98c"},"landcover-sand":{color:"#efeac8"},"landcover-ice":{color:"#bbd8ce"},"landcover-wetland":{color:"#9fccd1"},"landuse-residential":{color:"#e6efe6"},"landuse-industrial":{color:"#d1d4e0"},"landuse-civic":{color:"#e7d0d7"},"landuse-sport":{color:"#94e085"},"landuse-cemetery":{color:"#9fd69f"},"landuse-parking":{color:"#d4d8d4"},park:{color:"#8cd98c"},"aeroway-area":{color:"#d6dbeb"},water:{color:"#5ec9a6"},waterway:{color:"#66ccaa"},"aeroway-line":{color:"#f0ede9"},"road-casing-major":{color:"#44a754"},"road-casing-secondary":{color:{stops:[[16,"#7fbd7f"],[18.5,"#44a754"]]}},"road-casing-minor":{color:{stops:[[16,"#7fbd7f"],[18.5,"#44a754"]]}},"road-rail":{color:"#72a172"},"road-path":{color:"#afd4af"},"road-minor":{color:{stops:[[16,"#afd4af"],[18.5,"#64c474"]]}},"road-secondary":{color:{stops:[[16,"#afd4af"],[18.5,"#64c474"]]}},"road-ramp":{color:"#64c474"},"road-major":{color:"#64c474"},boundary:{color:"#39c668"},building:{color:"#cfe2cb",roofColor:"#dff1df",aoStrength:.19,tintVariation:.06,windowColor:"#6b9ed1",windowFrameColor:"#e8f0e8",windowGlow:0},housenumber:{color:"#1c4a24",haloColor:"#f8fcf8",haloWidth:1.4},poi:{color:"#358d44",haloColor:"#f8fcf8",haloWidth:1.4},"road-label":{color:"#1c4a24",haloColor:"#f8fcf8",haloWidth:1.4},"water-label":{color:"#35688d",haloColor:"#f7f7f7",haloWidth:1.4},"place-label":{color:"#1c4a24",haloColor:"#f8fcf8",haloWidth:1.4},"poi-food":{haloColor:"#f8fcf8",haloWidth:1.4,frameColor:"#c2681c",frameOpacity:1,frameHaloColor:"#f8fcf8",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{haloColor:"#f8fcf8",haloWidth:1.4,frameColor:"#2f77c4",frameOpacity:1,frameHaloColor:"#f8fcf8",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{haloColor:"#f8fcf8",haloWidth:1.4,frameColor:"#3b82a6",frameOpacity:1,frameHaloColor:"#f8fcf8",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{haloColor:"#f8fcf8",haloWidth:1.4,frameColor:"#c24444",frameOpacity:1,frameHaloColor:"#f8fcf8",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{haloColor:"#f8fcf8",haloWidth:1.4,frameColor:"#3f7f7a",frameOpacity:1,frameHaloColor:"#f8fcf8",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{haloColor:"#f8fcf8",haloWidth:1.4,frameColor:"#8b5aa5",frameOpacity:1,frameHaloColor:"#f8fcf8",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{haloColor:"#f8fcf8",haloWidth:1.4,frameColor:"#4f8b45",frameOpacity:1,frameHaloColor:"#f8fcf8",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{haloColor:"#f8fcf8",haloWidth:1.4,frameColor:"#7a5fbf",frameOpacity:1,frameHaloColor:"#f8fcf8",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{haloColor:"#f8fcf8",haloWidth:1.4,frameColor:"#59636e",frameOpacity:1,frameHaloColor:"#f8fcf8",iconColor:"#ffffff",iconHaloWidth:0},"water-pool":{color:"#67d1af"},"indoor-shell":{color:"#e1e8e0",opacity:.97},"indoor-corridor":{color:"#e6ece5"},"indoor-room":{color:"#d9e1d7"},"indoor-service":{color:"#c3d0c1"},"indoor-shop":{color:"#d1c8db"},"indoor-food":{color:"#dbd2c8"},"indoor-wc":{color:"#c8d4db"},"indoor-wall":{color:"#b7c0b5",roofColor:"#cdd2cc",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#bcb4cd",opacity:.95},"indoor-door":{color:"#358d44",haloColor:"#f8fcf8",haloWidth:1.4},"indoor-poi":{color:"#358d44",haloColor:"#f8fcf8",haloWidth:1.4},"indoor-name":{color:"#1c4a24",haloColor:"#f8fcf8",haloWidth:1.4},"building-entrance":{color:"#225aaa",haloColor:"#f8fcf8"}},sky:{skyColor:"#83c5af",horizonColor:"#cad9ca",fogRange:[1.34,7.31],fogIntensity:.86,spaceColor:"#090f09",atmosphereColor:"#5bcfa9",starIntensity:.4}};var ms={name:"\u041B\u0443\u043D\u043D\u0430\u044F",background:"#c8cbd0",light:{ambientColor:"#ebecec",ambientIntensity:.46,keyAzimuth:120,keyAltitude:59,keyColor:"#e8ecf2",keyIntensity:.56,fillAzimuth:300,fillAltitude:25,fillColor:"#c7d0e1",fillIntensity:.19},paint:{"landcover-wood":{color:"#a8abb3"},"landcover-grass":{color:"#b9bbc1"},"landcover-sand":{color:"#efeac8"},"landcover-ice":{color:"#cbcdd2"},"landcover-wetland":{color:"#acd4d7"},"landuse-residential":{color:"#ced0d4"},"landuse-industrial":{color:"#b3b7cc"},"landuse-civic":{color:"#d5aebb"},"landuse-sport":{color:"#b2bdc7"},"landuse-cemetery":{color:"#adbddc"},"landuse-parking":{color:"#b9bcc0"},park:{color:"#b9bbc1"},"aeroway-area":{color:"#d6dbeb"},water:{color:"#929aaa"},waterway:{color:"#929aaa"},"aeroway-line":{color:"#f0ede9"},"road-casing-major":{color:"#6c7689"},"road-casing-secondary":{color:{stops:[[16,"#848b9a"],[18.5,"#6c7689"]]}},"road-casing-minor":{color:{stops:[[16,"#848b9a"],[18.5,"#6c7689"]]}},"road-rail":{color:"#7e838b"},"road-path":{color:"#acb0b9"},"road-minor":{color:{stops:[[16,"#acb0b9"],[18.5,"#949ba8"]]}},"road-secondary":{color:{stops:[[16,"#acb0b9"],[18.5,"#949ba8"]]}},"road-ramp":{color:"#949ba8"},"road-major":{color:"#949ba8"},boundary:{color:"#6a7181"},building:{color:"#c8cbd0",roofColor:"#d9dbdd",aoStrength:.2,tintVariation:.07,windowColor:"#9fb0c0",windowFrameColor:"#cfd6e0",windowGlow:0},housenumber:{color:"#31363f",haloColor:"#f1f2f4",haloWidth:1.4},poi:{color:"#606876",haloColor:"#f1f2f4",haloWidth:1.4},"road-label":{color:"#31363f",haloColor:"#f1f2f4",haloWidth:1.4},"water-label":{color:"#35688d",haloColor:"#f7f7f7",haloWidth:1.4},"place-label":{color:"#31363f",haloColor:"#f1f2f4",haloWidth:1.4},"poi-food":{haloColor:"#f1f2f4",haloWidth:1.4,frameColor:"#c2681c",frameOpacity:1,frameHaloColor:"#f1f2f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{haloColor:"#f1f2f4",haloWidth:1.4,frameColor:"#2f77c4",frameOpacity:1,frameHaloColor:"#f1f2f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{haloColor:"#f1f2f4",haloWidth:1.4,frameColor:"#3b82a6",frameOpacity:1,frameHaloColor:"#f1f2f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{haloColor:"#f1f2f4",haloWidth:1.4,frameColor:"#c24444",frameOpacity:1,frameHaloColor:"#f1f2f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{haloColor:"#f1f2f4",haloWidth:1.4,frameColor:"#3f7f7a",frameOpacity:1,frameHaloColor:"#f1f2f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{haloColor:"#f1f2f4",haloWidth:1.4,frameColor:"#8b5aa5",frameOpacity:1,frameHaloColor:"#f1f2f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{haloColor:"#f1f2f4",haloWidth:1.4,frameColor:"#4f8b45",frameOpacity:1,frameHaloColor:"#f1f2f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{haloColor:"#f1f2f4",haloWidth:1.4,frameColor:"#7a5fbf",frameOpacity:1,frameHaloColor:"#f1f2f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{haloColor:"#f1f2f4",haloWidth:1.4,frameColor:"#59636e",frameOpacity:1,frameHaloColor:"#f1f2f4",iconColor:"#ffffff",iconHaloWidth:0},"water-pool":{color:"#9ca4b3"},"indoor-shell":{color:"#d6d9dc",opacity:.97},"indoor-corridor":{color:"#dbdde0"},"indoor-room":{color:"#ced1d5"},"indoor-service":{color:"#b9bcc3"},"indoor-shop":{color:"#c7bcd2"},"indoor-food":{color:"#d2c7bc"},"indoor-wc":{color:"#bcc9d2"},"indoor-wall":{color:"#acafb4",roofColor:"#c2c4c7",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#b1a7c5",opacity:.95},"indoor-door":{color:"#606876",haloColor:"#f1f2f4",haloWidth:1.4},"indoor-poi":{color:"#606876",haloColor:"#f1f2f4",haloWidth:1.4},"indoor-name":{color:"#31363f",haloColor:"#f1f2f4",haloWidth:1.4},"building-entrance":{haloColor:"#f1f2f4"}},sky:{skyColor:"#5675b3",horizonColor:"#b1b4b9",fogRange:[1.33,7.14],fogIntensity:.87,spaceColor:"#0a0b0c",atmosphereColor:"#557dce",starIntensity:.45}};var bs={name:"\u041C\u0430\u0442\u043E\u0432\u0430\u044F",background:"#e7e6e4",light:{ambientColor:"#f5f5f5",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#ffffff",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#dce6ec",fillIntensity:.18},paint:{"landcover-wood":{color:"#a3be9d"},"landcover-grass":{color:"#b3cbae"},"landcover-sand":{color:"#efeac8"},"landcover-ice":{color:"#d6dce0"},"landcover-wetland":{color:"#acd4d7"},"landuse-residential":{color:"#ecebe9"},"landuse-industrial":{color:"#d1d4e0"},"landuse-civic":{color:"#e7d0d7"},"landuse-sport":{color:"#b6d2a7"},"landuse-cemetery":{color:"#b5dcad"},"landuse-parking":{color:"#d8d6d4"},park:{color:"#b3cbae"},"aeroway-area":{color:"#d6dbeb"},water:{color:"#a6bbc9"},waterway:{color:"#a6bbc9"},"aeroway-line":{color:"#f0ede9"},"road-casing-major":{color:"#969fb0"},"road-casing-secondary":{color:{stops:[[16,"#abb0ba"],[18.5,"#969fb0"]]}},"road-casing-minor":{color:{stops:[[16,"#abb0ba"],[18.5,"#969fb0"]]}},"road-rail":{color:"#adadad"},"road-path":{color:"#c7cad1"},"road-minor":{color:{stops:[[16,"#c7cad1"],[18.5,"#aeb4c2"]]}},"road-secondary":{color:{stops:[[16,"#c7cad1"],[18.5,"#aeb4c2"]]}},"road-ramp":{color:"#aeb4c2"},"road-major":{color:"#aeb4c2"},boundary:{color:"#ca919f"},building:{color:"#dad6d2",roofColor:"#e3e0dd",aoStrength:.19,tintVariation:.06,windowColor:"#9fb0c0",windowFrameColor:"#f0f0f2",windowGlow:0},housenumber:{color:"#4d4742",haloColor:"#f6f5f4",haloWidth:1.4},poi:{color:"#707a8f",haloColor:"#f6f5f4",haloWidth:1.4},"road-label":{color:"#4d4742",haloColor:"#f6f5f4",haloWidth:1.4},"water-label":{color:"#35688d",haloColor:"#f7f7f7",haloWidth:1.4},"place-label":{color:"#4d4742",haloColor:"#f6f5f4",haloWidth:1.4},"poi-food":{haloColor:"#f6f5f4",haloWidth:1.4,frameColor:"#c2681c",frameOpacity:1,frameHaloColor:"#f6f5f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{haloColor:"#f6f5f4",haloWidth:1.4,frameColor:"#2f77c4",frameOpacity:1,frameHaloColor:"#f6f5f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{haloColor:"#f6f5f4",haloWidth:1.4,frameColor:"#3b82a6",frameOpacity:1,frameHaloColor:"#f6f5f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{haloColor:"#f6f5f4",haloWidth:1.4,frameColor:"#c24444",frameOpacity:1,frameHaloColor:"#f6f5f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{haloColor:"#f6f5f4",haloWidth:1.4,frameColor:"#3f7f7a",frameOpacity:1,frameHaloColor:"#f6f5f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{haloColor:"#f6f5f4",haloWidth:1.4,frameColor:"#8b5aa5",frameOpacity:1,frameHaloColor:"#f6f5f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{haloColor:"#f6f5f4",haloWidth:1.4,frameColor:"#4f8b45",frameOpacity:1,frameHaloColor:"#f6f5f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{haloColor:"#f6f5f4",haloWidth:1.4,frameColor:"#7a5fbf",frameOpacity:1,frameHaloColor:"#f6f5f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{haloColor:"#f6f5f4",haloWidth:1.4,frameColor:"#59636e",frameOpacity:1,frameHaloColor:"#f6f5f4",iconColor:"#ffffff",iconHaloWidth:0},"water-pool":{color:"#b3c6d2"},"indoor-shell":{color:"#e6e3e1",opacity:.97},"indoor-corridor":{color:"#eae8e6"},"indoor-room":{color:"#dfdcd8"},"indoor-service":{color:"#cdc8c2"},"indoor-shop":{color:"#d1c8da"},"indoor-food":{color:"#dad1c8"},"indoor-wc":{color:"#c8d3da"},"indoor-wall":{color:"#bebab6",roofColor:"#d1cecc",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#bbb3cd",opacity:.95},"indoor-door":{color:"#707a8f",haloColor:"#f6f5f4",haloWidth:1.4},"indoor-poi":{color:"#707a8f",haloColor:"#f6f5f4",haloWidth:1.4},"indoor-name":{color:"#4d4742",haloColor:"#f6f5f4",haloWidth:1.4},"building-entrance":{color:"#225aaa",haloColor:"#f6f5f4"}},sky:{skyColor:"#83abc5",horizonColor:"#d3d2d0",fogRange:[1.34,7.31],fogIntensity:.86,spaceColor:"#0d0c0b",atmosphereColor:"#5ba1cf",starIntensity:.4}};var ys={name:"\u041C\u0438\u043D\u0438\u043C\u0430\u043B\u0438\u0437\u043C",background:"#f7f7f7",light:{ambientColor:"#fcfcfc",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#ffffff",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#dee7ed",fillIntensity:.18},paint:{"landcover-wood":{color:"#d6e1d6"},"landcover-grass":{color:"#e1eae1"},"landcover-sand":{color:"#efeac8"},"landcover-ice":{color:"#edf0f2"},"landcover-wetland":{color:"#e3f1f2"},"landuse-residential":{color:"#fafafa"},"landuse-industrial":{color:"#e7e8ef"},"landuse-civic":{color:"#f3e7eb"},"landuse-sport":{color:"#e1edde"},"landuse-cemetery":{color:"#e6f4e6"},"landuse-parking":{color:"#e9e7e7"},park:{color:"#e1eae1"},"aeroway-area":{color:"#d6dbeb"},water:{color:"#d7e2ea"},waterway:{color:"#d7e2ea"},"aeroway-line":{color:"#f0ede9"},"road-casing-major":{color:"#a3a3a3"},"road-casing-secondary":{color:{stops:[[16,"#b8b8b8"],[18.5,"#a3a3a3"]]}},"road-casing-minor":{color:{stops:[[16,"#b8b8b8"],[18.5,"#a3a3a3"]]}},"road-rail":{color:"#b3b3b3"},"road-path":{color:"#d1d1d1"},"road-minor":{color:{stops:[[16,"#d1d1d1"],[18.5,"#bdbdbd"]]}},"road-secondary":{color:{stops:[[16,"#d1d1d1"],[18.5,"#bdbdbd"]]}},"road-ramp":{color:"#bdbdbd"},"road-major":{color:"#bdbdbd"},boundary:{color:"#999999"},building:{color:"#ebebeb",roofColor:"#f2f2f2",aoStrength:.18,tintVariation:.06,windowColor:"#9fb0c0",windowFrameColor:"#f4f4f6",windowGlow:0},housenumber:{color:"#404040",haloColor:"#ffffff",haloWidth:1.4},poi:{color:"#737373",haloColor:"#ffffff",haloWidth:1.4},"road-label":{color:"#404040",haloColor:"#ffffff",haloWidth:1.4},"water-label":{color:"#35688d",haloColor:"#f7f7f7",haloWidth:1.4},"place-label":{color:"#404040",haloColor:"#ffffff",haloWidth:1.4},"poi-food":{color:"#737373",haloColor:"#ffffff",haloWidth:1.4,frameColor:"#737373",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{color:"#737373",haloColor:"#ffffff",haloWidth:1.4,frameColor:"#737373",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{color:"#737373",haloColor:"#ffffff",haloWidth:1.4,frameColor:"#737373",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{color:"#737373",haloColor:"#ffffff",haloWidth:1.4,frameColor:"#737373",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{color:"#737373",haloColor:"#ffffff",haloWidth:1.4,frameColor:"#737373",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{color:"#737373",haloColor:"#ffffff",haloWidth:1.4,frameColor:"#737373",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{color:"#737373",haloColor:"#ffffff",haloWidth:1.4,frameColor:"#737373",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{color:"#737373",haloColor:"#ffffff",haloWidth:1.4,frameColor:"#737373",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{color:"#737373",haloColor:"#ffffff",haloWidth:1.4,frameColor:"#737373",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"water-pool":{color:"#e8eff4"},"indoor-shell":{color:"#f7f7f7",opacity:.97},"indoor-corridor":{color:"#fbfbfb"},"indoor-room":{color:"#efefef"},"indoor-service":{color:"#dbdbdb"},"indoor-shop":{color:"#e4dfea"},"indoor-food":{color:"#eae4df"},"indoor-wc":{color:"#dfe5ea"},"indoor-wall":{color:"#cdcdcd",roofColor:"#e2e2e2",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#d0cbdc",opacity:.95},"indoor-door":{color:"#737373",haloColor:"#ffffff",haloWidth:1.4},"indoor-poi":{color:"#737373",haloColor:"#ffffff",haloWidth:1.4},"indoor-name":{color:"#404040",haloColor:"#ffffff",haloWidth:1.4},"building-entrance":{color:"#564e4e",haloColor:"#ffffff"}},sky:{skyColor:"#a4c0d4",horizonColor:"#e6e6e6",fogRange:[1.35,7.44],fogIntensity:.85,spaceColor:"#0d0d0d",atmosphereColor:"#5fa1d1",starIntensity:.37}};var gs={name:"\u041E\u043A\u0435\u0430\u043D",background:"#d7e3ea",light:{ambientColor:"#f3f4f4",ambientIntensity:.47,keyAzimuth:120,keyAltitude:60,keyColor:"#e8f6ff",keyIntensity:.59,fillAzimuth:300,fillAltitude:25,fillColor:"#d8e4ea",fillIntensity:.18},paint:{"landcover-wood":{color:"#75c7c7"},"landcover-grass":{color:"#97d8d2"},"landcover-sand":{color:"#efeac8"},"landcover-ice":{color:"#accedf"},"landcover-wetland":{color:"#a5d0d4"},"landuse-residential":{color:"#dfe8ec"},"landuse-industrial":{color:"#cbcedc"},"landuse-civic":{color:"#e3c9d2"},"landuse-sport":{color:"#90dfcb"},"landuse-cemetery":{color:"#a6d9d4"},"landuse-parking":{color:"#cfd2d3"},park:{color:"#97d8d2"},"aeroway-area":{color:"#d6dbeb"},water:{color:"#30abe8"},waterway:{color:"#3eb0ea"},"aeroway-line":{color:"#f0ede9"},"road-casing-major":{color:"#47a3c2"},"road-casing-secondary":{color:{stops:[[16,"#8ab2c7"],[18.5,"#47a3c2"]]}},"road-casing-minor":{color:{stops:[[16,"#8ab2c7"],[18.5,"#47a3c2"]]}},"road-rail":{color:"#8a9ea8"},"road-path":{color:"#b8d3e0"},"road-minor":{color:{stops:[[16,"#b8d3e0"],[18.5,"#79c0d8"]]}},"road-secondary":{color:{stops:[[16,"#b8d3e0"],[18.5,"#79c0d8"]]}},"road-ramp":{color:"#79c0d8"},"road-major":{color:"#79c0d8"},boundary:{color:"#47bad1"},building:{color:"#d2dee4",roofColor:"#e7f0f3",aoStrength:.19,tintVariation:.06,windowColor:"#6b9ed1",windowFrameColor:"#e6f0f6",windowGlow:0},housenumber:{color:"#1f3c51",haloColor:"#f8fbfc",haloWidth:1.4},poi:{color:"#3b7b9b",haloColor:"#f8fbfc",haloWidth:1.4},"road-label":{color:"#1f3c51",haloColor:"#f8fbfc",haloWidth:1.4},"water-label":{color:"#35688d",haloColor:"#f7f7f7",haloWidth:1.4},"place-label":{color:"#1f3c51",haloColor:"#f8fbfc",haloWidth:1.4},"poi-food":{haloColor:"#f8fbfc",haloWidth:1.4,frameColor:"#c2681c",frameOpacity:1,frameHaloColor:"#f8fbfc",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{haloColor:"#f8fbfc",haloWidth:1.4,frameColor:"#2f77c4",frameOpacity:1,frameHaloColor:"#f8fbfc",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{haloColor:"#f8fbfc",haloWidth:1.4,frameColor:"#3b82a6",frameOpacity:1,frameHaloColor:"#f8fbfc",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{haloColor:"#f8fbfc",haloWidth:1.4,frameColor:"#c24444",frameOpacity:1,frameHaloColor:"#f8fbfc",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{haloColor:"#f8fbfc",haloWidth:1.4,frameColor:"#3f7f7a",frameOpacity:1,frameHaloColor:"#f8fbfc",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{haloColor:"#f8fbfc",haloWidth:1.4,frameColor:"#8b5aa5",frameOpacity:1,frameHaloColor:"#f8fbfc",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{haloColor:"#f8fbfc",haloWidth:1.4,frameColor:"#4f8b45",frameOpacity:1,frameHaloColor:"#f8fbfc",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{haloColor:"#f8fbfc",haloWidth:1.4,frameColor:"#7a5fbf",frameOpacity:1,frameHaloColor:"#f8fbfc",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{haloColor:"#f8fbfc",haloWidth:1.4,frameColor:"#59636e",frameOpacity:1,frameHaloColor:"#f8fbfc",iconColor:"#ffffff",iconHaloWidth:0},"water-pool":{color:"#38b3f1"},"indoor-shell":{color:"#e5e9eb",opacity:.97},"indoor-corridor":{color:"#eaeeef"},"indoor-room":{color:"#dce2e5"},"indoor-service":{color:"#c6cfd4"},"indoor-shop":{color:"#d6cede"},"indoor-food":{color:"#ded6ce"},"indoor-wc":{color:"#ced8de"},"indoor-wall":{color:"#bac1c4",roofColor:"#d0d4d6",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#c1b9d1",opacity:.95},"indoor-door":{color:"#3b7b9b",haloColor:"#f8fbfc",haloWidth:1.4},"indoor-poi":{color:"#3b7b9b",haloColor:"#f8fbfc",haloWidth:1.4},"indoor-name":{color:"#1f3c51",haloColor:"#f8fbfc",haloWidth:1.4},"building-entrance":{color:"#225aaa",haloColor:"#f8fbfc"}},sky:{skyColor:"#7aaac1",horizonColor:"#c1cfd6",fogRange:[1.34,7.27],fogIntensity:.86,spaceColor:"#080d0f",atmosphereColor:"#5aa8cf",starIntensity:.41}};var As={name:"\u041F\u0440\u0435\u043C\u0438\u0443\u043C",background:"#211f1c",model3dKey:"night",light:{ambientColor:"#b0aaa4",ambientIntensity:.34,keyAzimuth:120,keyAltitude:55,keyColor:"#c8b48a",keyIntensity:.3,fillAzimuth:300,fillAltitude:25,fillColor:"#496887",fillIntensity:.22},paint:{"landcover-wood":{color:"#1b271b"},"landcover-grass":{color:"#232f23"},"landcover-sand":{color:"#393622"},"landcover-ice":{color:"#2d3d4c"},"landcover-wetland":{color:"#213436"},"landuse-residential":{color:"#272421"},"landuse-industrial":{color:"#242633"},"landuse-civic":{color:"#332429"},"landuse-sport":{color:"#22331f"},"landuse-cemetery":{color:"#213021"},"landuse-parking":{color:"#383633"},park:{color:"#232f23"},"aeroway-area":{color:"#272a35"},water:{color:"#16293b"},waterway:{color:"#1c334a"},"aeroway-line":{color:"#55493a"},"road-casing-major":{color:"#856e32"},"road-casing-secondary":{color:{stops:[[16,"#423b2e"],[18.5,"#856e32"]]}},"road-casing-minor":{color:{stops:[[16,"#423b2e"],[18.5,"#856e32"]]}},"road-rail":{color:"#6b6457"},"road-path":{color:"#5e5645"},"road-minor":{color:{stops:[[16,"#5e5645"],[18.5,"#bf9e4a"]]}},"road-secondary":{color:{stops:[[16,"#5e5645"],[18.5,"#bf9e4a"]]}},"road-ramp":{color:"#bf9e4a"},"road-major":{color:"#bf9e4a"},boundary:{color:"#d1aa47"},building:{color:"#443b2c",roofColor:"#726037",aoStrength:.29,tintVariation:.1,windowColor:"#8fb8e8",windowFrameColor:"#eef0f4",windowGlow:.36},housenumber:{color:"#eae3d7",haloColor:"#181410",haloWidth:1.4},poi:{color:"#d4bb7d",haloColor:"#181410",haloWidth:1.4},"road-label":{color:"#eae3d7",haloColor:"#181410",haloWidth:1.4},"water-label":{color:"#9fbcd1",haloColor:"#131b20",haloWidth:1.4},"place-label":{color:"#eae3d7",haloColor:"#181410",haloWidth:1.4},"poi-food":{color:"#d89964",haloColor:"#181410",haloWidth:1.4,frameColor:"#d89964",frameOpacity:1,frameHaloColor:"#181410",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-shop":{color:"#699cd4",haloColor:"#181410",haloWidth:1.4,frameColor:"#699cd4",frameOpacity:1,frameHaloColor:"#181410",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-transport":{color:"#75acc8",haloColor:"#181410",haloWidth:1.4,frameColor:"#75acc8",frameOpacity:1,frameHaloColor:"#181410",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-health":{color:"#ca7272",haloColor:"#181410",haloWidth:1.4,frameColor:"#ca7272",frameOpacity:1,frameHaloColor:"#181410",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-education":{color:"#81bbb7",haloColor:"#181410",haloWidth:1.4,frameColor:"#81bbb7",frameOpacity:1,frameHaloColor:"#181410",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-culture":{color:"#a684b8",haloColor:"#181410",haloWidth:1.4,frameColor:"#a684b8",frameOpacity:1,frameHaloColor:"#181410",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-sport":{color:"#89bb81",haloColor:"#181410",haloWidth:1.4,frameColor:"#89bb81",frameOpacity:1,frameHaloColor:"#181410",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-lodging":{color:"#8e79c3",haloColor:"#181410",haloWidth:1.4,frameColor:"#8e79c3",frameOpacity:1,frameHaloColor:"#181410",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-service":{color:"#959ea7",haloColor:"#181410",haloWidth:1.4,frameColor:"#959ea7",frameOpacity:1,frameHaloColor:"#181410",iconColor:"#1b1b1b",iconHaloWidth:0},"water-pool":{color:"#1c3752"},"indoor-shell":{color:"#564b39",opacity:.97},"indoor-corridor":{color:"#504635"},"indoor-room":{color:"#605440"},"indoor-service":{color:"#7b6c52"},"indoor-shop":{color:"#5c4672"},"indoor-food":{color:"#725d46"},"indoor-wc":{color:"#466172"},"indoor-wall":{color:"#857a68",roofColor:"#9a9285",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#66558a",opacity:.95},"indoor-door":{color:"#d4bb7d",haloColor:"#181410",haloWidth:1.4},"indoor-poi":{color:"#d4bb7d",haloColor:"#181410",haloWidth:1.4},"indoor-name":{color:"#eae3d7",haloColor:"#181410",haloWidth:1.4},"building-entrance":{color:"#79a0d7",haloColor:"#181410"}},sky:{skyColor:"#09121b",horizonColor:"#2c2a27",fogRange:[1.3,6.51],fogIntensity:.9,spaceColor:"#060606",atmosphereColor:"#3679b9",starIntensity:.79}};var Bs={name:"\u0420\u0435\u0430\u043B\u0438\u0441\u0442\u0438\u0447\u043D\u0430\u044F",background:"#d6dac8",light:{ambientColor:"#eeeeed",ambientIntensity:.46,keyAzimuth:120,keyAltitude:59,keyColor:"#fff0d8",keyIntensity:.57,fillAzimuth:300,fillAltitude:25,fillColor:"#cbd9e3",fillIntensity:.18},paint:{"landcover-wood":{color:"#62a63f"},"landcover-grass":{color:"#8dbf69"},"landcover-sand":{color:"#efeac8"},"landcover-ice":{color:"#b4c9d7"},"landcover-wetland":{color:"#75b7bd"},"landuse-residential":{color:"#d6d1c2"},"landuse-industrial":{color:"#b9bdd0"},"landuse-civic":{color:"#d9b5c1"},"landuse-sport":{color:"#8bc95e"},"landuse-cemetery":{color:"#95c374"},"landuse-parking":{color:"#c3c5bf"},park:{color:"#8dbf69"},"aeroway-area":{color:"#d6dbeb"},water:{color:"#4d97cb"},waterway:{color:"#599ecf"},"aeroway-line":{color:"#f0ede9"},"road-casing-major":{color:"#856b47"},"road-casing-secondary":{color:{stops:[[16,"#766b60"],[18.5,"#856b47"]]}},"road-casing-minor":{color:{stops:[[16,"#766b60"],[18.5,"#856b47"]]}},"road-rail":{color:"#666666"},"road-path":{color:"#9c948b"},"road-minor":{color:{stops:[[16,"#9c948b"],[18.5,"#ccaa66"]]}},"road-secondary":{color:{stops:[[16,"#9c948b"],[18.5,"#ccaa66"]]}},"road-ramp":{color:"#ccaa66"},"road-major":{color:"#ccaa66"},boundary:{color:"#8a735c"},building:{color:"#cdc4b7",roofColor:"#cdc4b7",aoStrength:.2,tintVariation:.07,windowColor:"#9fb0c0",windowFrameColor:"#eceef2",windowGlow:0},housenumber:{color:"#3b332b",haloColor:"#f5f5f0",haloWidth:1.4},poi:{color:"#735c45",haloColor:"#f5f5f0",haloWidth:1.4},"road-label":{color:"#3b332b",haloColor:"#f5f5f0",haloWidth:1.4},"water-label":{color:"#35688d",haloColor:"#f7f7f7",haloWidth:1.4},"place-label":{color:"#3b332b",haloColor:"#f5f5f0",haloWidth:1.4},"poi-food":{haloColor:"#f5f5f0",haloWidth:1.4,frameColor:"#c2681c",frameOpacity:1,frameHaloColor:"#f5f5f0",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{haloColor:"#f5f5f0",haloWidth:1.4,frameColor:"#2f77c4",frameOpacity:1,frameHaloColor:"#f5f5f0",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{haloColor:"#f5f5f0",haloWidth:1.4,frameColor:"#3b82a6",frameOpacity:1,frameHaloColor:"#f5f5f0",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{haloColor:"#f5f5f0",haloWidth:1.4,frameColor:"#c24444",frameOpacity:1,frameHaloColor:"#f5f5f0",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{haloColor:"#f5f5f0",haloWidth:1.4,frameColor:"#3f7f7a",frameOpacity:1,frameHaloColor:"#f5f5f0",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{haloColor:"#f5f5f0",haloWidth:1.4,frameColor:"#8b5aa5",frameOpacity:1,frameHaloColor:"#f5f5f0",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{haloColor:"#f5f5f0",haloWidth:1.4,frameColor:"#4f8b45",frameOpacity:1,frameHaloColor:"#f5f5f0",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{haloColor:"#f5f5f0",haloWidth:1.4,frameColor:"#7a5fbf",frameOpacity:1,frameHaloColor:"#f5f5f0",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{haloColor:"#f5f5f0",haloWidth:1.4,frameColor:"#59636e",frameOpacity:1,frameHaloColor:"#f5f5f0",iconColor:"#ffffff",iconHaloWidth:0},"water-pool":{color:"#559fd3"},"indoor-shell":{color:"#d6d0c9",opacity:.97},"indoor-corridor":{color:"#dad5ce"},"indoor-room":{color:"#cfc9c0"},"indoor-service":{color:"#beb6a9"},"indoor-shop":{color:"#bdb0ca"},"indoor-food":{color:"#cabeb0"},"indoor-wc":{color:"#b0c0ca"},"indoor-wall":{color:"#ada79e",roofColor:"#bfbbb6",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#a69bbd",opacity:.95},"indoor-door":{color:"#735c45",haloColor:"#f5f5f0",haloWidth:1.4},"indoor-poi":{color:"#735c45",haloColor:"#f5f5f0",haloWidth:1.4},"indoor-name":{color:"#3b332b",haloColor:"#f5f5f0",haloWidth:1.4},"building-entrance":{haloColor:"#f5f5f0"}},sky:{skyColor:"#5f92b7",horizonColor:"#bfc4b1",fogRange:[1.33,7.17],fogIntensity:.87,spaceColor:"#0d0e09",atmosphereColor:"#569dce",starIntensity:.44}};var Cs={name:"\u041A\u043E\u0441\u043C\u043E\u0441",background:"#0c0a1a",model3dKey:"night",light:{ambientColor:"#8c7fcb",ambientIntensity:.34,keyAzimuth:120,keyAltitude:55,keyColor:"#c0a8ff",keyIntensity:.28,fillAzimuth:300,fillAltitude:25,fillColor:"#475385",fillIntensity:.22},paint:{"landcover-wood":{color:"#241730"},"landcover-grass":{color:"#2e203c"},"landcover-sand":{color:"#292719"},"landcover-ice":{color:"#2e365b"},"landcover-wetland":{color:"#172526"},"landuse-residential":{color:"#110e20"},"landuse-industrial":{color:"#191b24"},"landuse-civic":{color:"#24191d"},"landuse-sport":{color:"#281c40"},"landuse-cemetery":{color:"#1c1721"},"landuse-parking":{color:"#27272b"},park:{color:"#2e203c"},"aeroway-area":{color:"#1c1f26"},water:{color:"#121c49"},waterway:{color:"#16225a"},"aeroway-line":{color:"#55493a"},"road-casing-major":{color:"#7e279b"},"road-casing-secondary":{color:{stops:[[16,"#3a2060"],[18.5,"#7e279b"]]}},"road-casing-minor":{color:{stops:[[16,"#3a2060"],[18.5,"#7e279b"]]}},"road-rail":{color:"#985298"},"road-path":{color:"#6b35b6"},"road-minor":{color:{stops:[[16,"#6b35b6"],[18.5,"#bf4ce6"]]}},"road-secondary":{color:{stops:[[16,"#6b35b6"],[18.5,"#bf4ce6"]]}},"road-ramp":{color:"#bf4ce6"},"road-major":{color:"#bf4ce6"},boundary:{color:"#ec51b8"},building:{color:"#2a2145",roofColor:"#7f30a6",aoStrength:.29,tintVariation:.1,windowColor:"#84dcff",windowFrameColor:"#9fb0d8",windowGlow:.5},housenumber:{color:"#dbd1f0",haloColor:"#080614",haloWidth:1.4},poi:{color:"#d186ea",haloColor:"#080614",haloWidth:1.4},"road-label":{color:"#dbd1f0",haloColor:"#080614",haloWidth:1.4},"water-label":{color:"#9fbcd1",haloColor:"#131b20",haloWidth:1.4},"place-label":{color:"#dbd1f0",haloColor:"#080614",haloWidth:1.4},"poi-food":{color:"#d89964",haloColor:"#080614",haloWidth:1.4,frameColor:"#d89964",frameOpacity:1,frameHaloColor:"#080614",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-shop":{color:"#699cd4",haloColor:"#080614",haloWidth:1.4,frameColor:"#699cd4",frameOpacity:1,frameHaloColor:"#080614",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-transport":{color:"#75acc8",haloColor:"#080614",haloWidth:1.4,frameColor:"#75acc8",frameOpacity:1,frameHaloColor:"#080614",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-health":{color:"#ca7272",haloColor:"#080614",haloWidth:1.4,frameColor:"#ca7272",frameOpacity:1,frameHaloColor:"#080614",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-education":{color:"#81bbb7",haloColor:"#080614",haloWidth:1.4,frameColor:"#81bbb7",frameOpacity:1,frameHaloColor:"#080614",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-culture":{color:"#a684b8",haloColor:"#080614",haloWidth:1.4,frameColor:"#a684b8",frameOpacity:1,frameHaloColor:"#080614",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-sport":{color:"#89bb81",haloColor:"#080614",haloWidth:1.4,frameColor:"#89bb81",frameOpacity:1,frameHaloColor:"#080614",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-lodging":{color:"#8e79c3",haloColor:"#080614",haloWidth:1.4,frameColor:"#8e79c3",frameOpacity:1,frameHaloColor:"#080614",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-service":{color:"#959ea7",haloColor:"#080614",haloWidth:1.4,frameColor:"#959ea7",frameOpacity:1,frameHaloColor:"#080614",iconColor:"#1b1b1b",iconHaloWidth:0},"water-pool":{color:"#152466"},"indoor-shell":{color:"#403956",opacity:.97},"indoor-corridor":{color:"#3c3550"},"indoor-room":{color:"#484060"},"indoor-service":{color:"#5c527b"},"indoor-shop":{color:"#5c4672"},"indoor-food":{color:"#725d46"},"indoor-wc":{color:"#466172"},"indoor-wall":{color:"#6f6885",roofColor:"#8a859a",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#66558a",opacity:.95},"indoor-door":{color:"#d186ea",haloColor:"#080614",haloWidth:1.4},"indoor-poi":{color:"#d186ea",haloColor:"#080614",haloWidth:1.4},"indoor-name":{color:"#dbd1f0",haloColor:"#080614",haloWidth:1.4},"building-entrance":{color:"#79a0d7",haloColor:"#080614"}},sky:{skyColor:"#080b18",horizonColor:"#1d1931",fogRange:[1.3,6.5],fogIntensity:.9,spaceColor:"#040308",atmosphereColor:"#354cb6",starIntensity:.82}};var vs={name:"\u0412\u0443\u043B\u043A\u0430\u043D",background:"#29211e",model3dKey:"night",light:{ambientColor:"#b6a6a1",ambientIntensity:.35,keyAzimuth:120,keyAltitude:55,keyColor:"#ffb070",keyIntensity:.29,fillAzimuth:300,fillAltitude:25,fillColor:"#8b604b",fillIntensity:.22},paint:{"landcover-wood":{color:"#31241c"},"landcover-grass":{color:"#392e22"},"landcover-sand":{color:"#403c26"},"landcover-ice":{color:"#aa6b4b"},"landcover-wetland":{color:"#243b3d"},"landuse-residential":{color:"#2f2623"},"landuse-industrial":{color:"#282b39"},"landuse-civic":{color:"#39282e"},"landuse-sport":{color:"#3e2e1e"},"landuse-cemetery":{color:"#362e26"},"landuse-parking":{color:"#3e3938"},park:{color:"#392e22"},"aeroway-area":{color:"#2b2f3b"},water:{color:"#8b3f18"},waterway:{color:"#9c461c"},"aeroway-line":{color:"#55493a"},"road-casing-major":{color:"#aa350e"},"road-casing-secondary":{color:{stops:[[16,"#712b14"],[18.5,"#aa350e"]]}},"road-casing-minor":{color:{stops:[[16,"#712b14"],[18.5,"#aa350e"]]}},"road-rail":{color:"#8f583d"},"road-path":{color:"#e65e19"},"road-minor":{color:{stops:[[16,"#e65e19"],[18.5,"#f98c1f"]]}},"road-secondary":{color:{stops:[[16,"#e65e19"],[18.5,"#f98c1f"]]}},"road-ramp":{color:"#f98c1f"},"road-major":{color:"#f98c1f"},boundary:{color:"#f48c25"},building:{color:"#422b24",roofColor:"#c1551f",aoStrength:.28,tintVariation:.09,windowColor:"#84dcff",windowFrameColor:"#d8b0a0",windowGlow:.5},housenumber:{color:"#f3e0ce",haloColor:"#150b09",haloWidth:1.4},poi:{color:"#f09e4c",haloColor:"#150b09",haloWidth:1.4},"road-label":{color:"#f3e0ce",haloColor:"#150b09",haloWidth:1.4},"water-label":{color:"#9fbcd1",haloColor:"#131b20",haloWidth:1.4},"place-label":{color:"#f3e0ce",haloColor:"#150b09",haloWidth:1.4},"poi-food":{color:"#d89964",haloColor:"#150b09",haloWidth:1.4,frameColor:"#d89964",frameOpacity:1,frameHaloColor:"#150b09",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-shop":{color:"#699cd4",haloColor:"#150b09",haloWidth:1.4,frameColor:"#699cd4",frameOpacity:1,frameHaloColor:"#150b09",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-transport":{color:"#75acc8",haloColor:"#150b09",haloWidth:1.4,frameColor:"#75acc8",frameOpacity:1,frameHaloColor:"#150b09",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-health":{color:"#ca7272",haloColor:"#150b09",haloWidth:1.4,frameColor:"#ca7272",frameOpacity:1,frameHaloColor:"#150b09",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-education":{color:"#81bbb7",haloColor:"#150b09",haloWidth:1.4,frameColor:"#81bbb7",frameOpacity:1,frameHaloColor:"#150b09",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-culture":{color:"#a684b8",haloColor:"#150b09",haloWidth:1.4,frameColor:"#a684b8",frameOpacity:1,frameHaloColor:"#150b09",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-sport":{color:"#89bb81",haloColor:"#150b09",haloWidth:1.4,frameColor:"#89bb81",frameOpacity:1,frameHaloColor:"#150b09",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-lodging":{color:"#8e79c3",haloColor:"#150b09",haloWidth:1.4,frameColor:"#8e79c3",frameOpacity:1,frameHaloColor:"#150b09",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-service":{color:"#959ea7",haloColor:"#150b09",haloWidth:1.4,frameColor:"#959ea7",frameOpacity:1,frameHaloColor:"#150b09",iconColor:"#1b1b1b",iconHaloWidth:0},"water-pool":{color:"#c2531a"},"indoor-shell":{color:"#564039",opacity:.97},"indoor-corridor":{color:"#503b35"},"indoor-room":{color:"#604840"},"indoor-service":{color:"#7b5c52"},"indoor-shop":{color:"#5c4672"},"indoor-food":{color:"#725d46"},"indoor-wc":{color:"#466172"},"indoor-wall":{color:"#856f68",roofColor:"#9a8a85",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#66558a",opacity:.95},"indoor-door":{color:"#f09e4c",haloColor:"#150b09",haloWidth:1.4},"indoor-poi":{color:"#f09e4c",haloColor:"#150b09",haloWidth:1.4},"indoor-name":{color:"#f3e0ce",haloColor:"#150b09",haloWidth:1.4},"building-entrance":{color:"#79a0d7",haloColor:"#150b09"}},sky:{skyColor:"#1c100a",horizonColor:"#312a27",fogRange:[1.3,6.52],fogIntensity:.9,spaceColor:"#070605",atmosphereColor:"#ba6336",starIntensity:.78}};var xs={name:"\u0411\u0435\u043B\u0430\u044F",background:"#f5f1f0",light:{ambientColor:"#fafafa",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#ffffff",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#dee8ed",fillIntensity:.18},paint:{"landcover-wood":{color:"#a7e2a2"},"landcover-grass":{color:"#b8ebad"},"landcover-sand":{color:"#efeac8"},"landcover-ice":{color:"#d7eaf4"},"landcover-wetland":{color:"#c1dee1"},"landuse-residential":{color:"#f6f4f4"},"landuse-industrial":{color:"#e0e2eb"},"landuse-civic":{color:"#efe1e6"},"landuse-sport":{color:"#c0f0a8"},"landuse-cemetery":{color:"#c8e5c2"},"landuse-parking":{color:"#e4e2e2"},park:{color:"#b8ebad"},"aeroway-area":{color:"#d6dbeb"},water:{color:"#99ddff"},waterway:{color:"#99ddff"},"aeroway-line":{color:"#f0ede9"},"road-casing-major":{color:"#94a0b8"},"road-casing-secondary":{color:{stops:[[16,"#a3adc2"],[18.5,"#94a0b8"]]}},"road-casing-minor":{color:{stops:[[16,"#a3adc2"],[18.5,"#94a0b8"]]}},"road-rail":{color:"#a6a6a6"},"road-path":{color:"#bfc6d9"},"road-minor":{color:{stops:[[16,"#bfc6d9"],[18.5,"#a1b0c4"]]}},"road-secondary":{color:{stops:[[16,"#bfc6d9"],[18.5,"#a1b0c4"]]}},"road-ramp":{color:"#a1b0c4"},"road-major":{color:"#a1b0c4"},boundary:{color:"#f87797"},building:{color:"#ffffff",roofColor:"#ffffff",aoStrength:.19,tintVariation:.06,windowColor:"#6b9ed1",windowFrameColor:"#ffffff",windowGlow:0},housenumber:{color:"#262626",haloColor:"#ffffff",haloWidth:1.4},poi:{color:"#586e84",haloColor:"#ffffff",haloWidth:1.4},"road-label":{color:"#262626",haloColor:"#ffffff",haloWidth:1.4},"water-label":{color:"#35688d",haloColor:"#f7f7f7",haloWidth:1.4},"place-label":{color:"#262626",haloColor:"#ffffff",haloWidth:1.4},"poi-food":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#c2681c",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#2f77c4",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#3b82a6",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#c24444",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#3f7f7a",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#8b5aa5",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#4f8b45",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#7a5fbf",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#59636e",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"water-pool":{color:"#b1e5ff"},"indoor-shell":{color:"#f7f7f7",opacity:.97},"indoor-corridor":{color:"#fbfbfb"},"indoor-room":{color:"#efefef"},"indoor-service":{color:"#dbdbdb"},"indoor-shop":{color:"#e4dfea"},"indoor-food":{color:"#eae4df"},"indoor-wc":{color:"#dfe5ea"},"indoor-wall":{color:"#cdcdcd",roofColor:"#e2e2e2",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#d0cbdc",opacity:.95},"indoor-door":{color:"#586e84",haloColor:"#ffffff",haloWidth:1.4},"indoor-poi":{color:"#586e84",haloColor:"#ffffff",haloWidth:1.4},"indoor-name":{color:"#262626",haloColor:"#ffffff",haloWidth:1.4},"building-entrance":{color:"#225aaa",haloColor:"#ffffff"}},sky:{skyColor:"#9bbecf",horizonColor:"#e5dfdc",fogRange:[1.35,7.4],fogIntensity:.85,spaceColor:"#0f0c0a",atmosphereColor:"#5eaad0",starIntensity:.38}};var ws={"3d":rs,cartoon:ns,cyberpunk:is,dawn:as,dusk:ss,earth:ls,future:cs,"glass-refined":fs,glass:us,"harmony-black":hs,"harmony-blue":ds,"harmony-green":ps,lunar:ms,matte:bs,minimal:ys,ocean:gs,premium:As,realistic:Bs,space:Cs,volcano:vs,white:xs};function dr(n,e){let t=new Set(e.hidden??[]),o=n.layers.map(r=>{let i=e.paint?.[r.id],a={...r,paint:i?{...r.paint,...i}:{...r.paint}};return t.has(r.id)&&(a.visible=false),a});if(e.paint)for(let r of Object.keys(e.paint))n.layers.some(i=>i.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 {...n,name:e.name,background:e.background??n.background,light:{...n.light,...e.light},sky:{...n.sky,...e.sky},model3dKey:e.model3dKey??n.model3dKey,layers:o}}var Y="base",_s="\u241F",Ke=(n,e)=>n+"\u241F"+String(e);var Tt=class{constructor(e=Hn){this.splitValues={};this.spec=e,this.light={...Tn,...e.light??{}},this.sky={...Ln,...e.sky??{}},this.layers=e.layers.map(t=>({...t,paint:{...t.paint}}));}get background(){return ye(this.spec.background??"#eceae4")}colorAt(e,t,o=[1,0,1,1]){let i=e.paint?.color;if(i&&typeof i=="object"&&"from"in i){let s=this.layers.find(u=>u.id===i.from)?.paint?.color,l=He(s,t,o),c=1-Math.min(Math.max(i.darken??0,0),1);return [l[0]*c,l[1]*c,l[2]*c,l[3]]}return He(i,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:Ke(e.id,t)}sourceLayers(){return [...new Set(this.layers.flatMap(e=>e.type==="raster"?[]:[e["source-layer"]]))]}},Hn=Za,zu=Qa,Nu=qa,Ku=$a,Ht={day:{name:"\u0414\u043D\u0435\u0432\u043D\u0430\u044F"},night:es,mono:ts,pale:os,...ws};function pr(n,e=Hn){if(typeof n!="string")return dr(e,n);if(n==="day")return e;let t=Ht[n];return t?dr(e,t):(console.warn(`[osmgl] \u043D\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043D\u0430\u044F \u0442\u0435\u043C\u0430 \xAB${n}\xBB; \u0434\u043E\u0441\u0442\u0443\u043F\u043D\u044B: ${Object.keys(Ht).join(", ")}`),e)}var uo=class{constructor(e,t){this.ctx=e;let o=e.gl;this._size=t;let r=o.createTexture(),i=o.createFramebuffer();if(!r||!i)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=i,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,i),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 Es(n){let e=n.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 n.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),n.bindTexture(7,null),t}var ho=`
|
|
8
|
+
`)}var $t=new Set,Yr=false;function Pe(n,e,t=2){let o=e&&e.length,r=o?e[0]*t:n.length;$t.size&&$t.clear();let i=la(n,0,r,t,true),a=[];if(!i||i.next===i.prev)return a;let l=0,s=0,c=0;if(o&&(i=wc(n,e,i,t)),n.length>80*t){l=n[0],s=n[1];let h=l,u=s;for(let f=t;f<r;f+=t){let d=n[f],p=n[f+1];d<l&&(l=d),p<s&&(s=p),d>h&&(h=d),p>u&&(u=p);}c=Math.max(h-l,u-s),c=c!==0?32767/c:0;}return Zr(i,a,l,s,c),a}function la(n,e,t,o,r){let i=null;if(r===Rc(n,e,t,o)>0)for(let a=e;a<t;a+=o)i=aa(a/o|0,n[a],n[a+1],i);else for(let a=t-o;a>=e;a-=o)i=aa(a/o|0,n[a],n[a+1],i);return i&&eo(i,i.next)&&(oo(i),i=i.next),i}function ut(n,e=n){let t=e===n,o=n,r;do r=false,o!==o.next&&($t.size===0||!$t.has(o))&&(eo(o,o.next)||me(o.prev,o,o.next)===0)?((t||o===e)&&(e=o.prev),Yr=true,oo(o),o=o.prev,r=true):(t||o!==e)&&(o=o.next,r=!t);while(r||o!==e);return e}function Zr(n,e,t,o,r){r&&Ic(n,t,o,r);let i=n,a=false;for(;n.prev!==n.next;){let l=n.prev,s=n.next;if(me(l,n,s)<0&&(r?Cc(n,t,o,r):Bc(n))){e.push(l.i,n.i,s.i),oo(n),n=s,i=s;continue}if(n=s,n===i){if(Yr=false,n=ut(n),Yr){i=n;continue}if(!a){n=vc(n,e),i=n,a=true;continue}xc(n,e,t,o,r);break}}}function Bc(n){let e=n.prev,t=n,o=n.next,r=e.x,i=t.x,a=o.x,l=e.y,s=t.y,c=o.y,h=Math.min(r,i,a),u=Math.min(l,s,c),f=Math.max(r,i,a),d=Math.max(l,s,c),p=o.next;for(;p!==e;){if(p.x>=h&&p.x<=f&&p.y>=u&&p.y<=d&&!(r===p.x&&l===p.y)&&er(r,l,i,s,a,c,p.x,p.y)&&me(p.prev,p,p.next)>=0)return false;p=p.next;}return true}function Cc(n,e,t,o){let r=n.prev,i=n,a=n.next,l=r.x,s=i.x,c=a.x,h=r.y,u=i.y,f=a.y,d=Math.min(l,s,c),p=Math.min(h,u,f),b=Math.max(l,s,c),m=Math.max(h,u,f),g=en(d,p,e,t,o),y=en(b,m,e,t,o),A=n.prevZ;for(;A&&A.z>=g;){if(A.x>=d&&A.x<=b&&A.y>=p&&A.y<=m&&A!==a&&!(l===A.x&&h===A.y)&&er(l,h,s,u,c,f,A.x,A.y)&&me(A.prev,A,A.next)>=0)return false;A=A.prevZ;}let B=n.nextZ;for(;B&&B.z<=y;){if(B.x>=d&&B.x<=b&&B.y>=p&&B.y<=m&&B!==a&&!(l===B.x&&h===B.y)&&er(l,h,s,u,c,f,B.x,B.y)&&me(B.prev,B,B.next)>=0)return false;B=B.nextZ;}return true}function vc(n,e){let t=n,o=false;do{let r=t.prev,i=t.next.next;fa(r,t,t.next,i,false)&&to(r,i)&&to(i,r)&&(e.push(r.i,t.i,i.i),oo(t),oo(t.next),t=n=i,o=true),t=t.next;}while(t!==n);return o?ut(t):t}function xc(n,e,t,o,r){let i=n;do{let a=i.next.next;for(;a!==i.prev;){if(i.i!==a.i&&Hc(i,a)){let l=ua(i,a);i=ut(i,i.next),l=ut(l,l.next),Zr(i,e,t,o,r),Zr(l,e,t,o,r);return}a=a.next;}i=i.next;}while(i!==n)}var Qr=false;function wc(n,e,t,o){let r=[];for(let i=0,a=e.length;i<a;i++){let l=e[i]*o,s=i<a-1?e[i+1]*o:n.length,c=la(n,l,s,o,false);c===c.next&&$t.add(c),r.push(Tc(c));}r.sort(_c),Mc(n.length/o,e.length),ca(t,t),Qr=true;for(let i=0;i<r.length;i++)t=Ec(r[i],t);return Qr=false,ut(t)}function _c(n,e){return n.x-e.x||n.y-e.y||(n.next.y-n.y)/(n.next.x-n.x)-(e.next.y-e.y)/(e.next.x-e.x)}function Ec(n,e){let t=Dc(n,e);if(!t)return e;let o=ua(t,n),r=o.next;return ca(t,r.next),ut(o,o.next),ut(t,t.next)}var sa=16,ce=new Float64Array(0),$o=0,qr=[],$r=[];function Mc(n,e){let t=Math.ceil((n+2*e)/sa)+e+2;ce.length<t*4&&(ce=new Float64Array(t*4)),$o=0;}function ca(n,e){let t=n;do{let o=$o++;qr[o]=t;let r=1/0,i=1/0,a=-1/0,l=-1/0,s=0;do{let h=t.next;t.z=o,t.x<r&&(r=t.x),t.x>a&&(a=t.x),t.y<i&&(i=t.y),t.y>l&&(l=t.y),h.x<r&&(r=h.x),h.x>a&&(a=h.x),h.y<i&&(i=h.y),h.y>l&&(l=h.y),t=h;}while(++s<sa&&t!==e);$r[o]=t;let c=o*4;ce[c]=r,ce[c+1]=i,ce[c+2]=a,ce[c+3]=l;}while(t!==e)}function Fc(n,e){let t=n.z*4;e.x<ce[t]&&(ce[t]=e.x),e.y<ce[t+1]&&(ce[t+1]=e.y),e.x>ce[t+2]&&(ce[t+2]=e.x),e.y>ce[t+3]&&(ce[t+3]=e.y);}function na(n){let e=$r[n];for(;e.prev.next!==e;)e=e.next;return $r[n]=e,e}function ia(n){let e=qr[n];for(;e.prev.next!==e;)e=e.next;return qr[n]=e,e}function Dc(n,e){let t=e,o=n.x,r=n.y,i=-1/0,a;if(eo(n,t))return t;for(let f=0,d=0;f<$o;f++,d+=4){if(r<ce[d+1]||r>ce[d+3]||ce[d]>o||ce[d+2]<=i)continue;let p=na(f);t=ia(f);do{if(t.prev.next===t){if(eo(n,t.next))return t.next;if(r<=t.y&&r>=t.next.y&&t.next.y!==t.y){let b=t.x+(r-t.y)*(t.next.x-t.x)/(t.next.y-t.y);if(b<=o&&b>i&&(i=b,a=t.x<t.next.x?t:t.next,b===o))return a}}t=t.next;}while(t!==p)}if(!a)return null;let l=a.x,s=a.y,c=Math.min(r,s),h=Math.max(r,s),u=1/0;for(let f=0,d=0;f<$o;f++,d+=4){if(ce[d+2]<l||ce[d]>o||ce[d+3]<c||ce[d+1]>h)continue;let p=na(f);t=ia(f);do{if(t.prev.next===t&&o>=t.x&&t.x>=l&&o!==t.x&&er(r<s?o:i,r,l,s,r<s?i:o,r,t.x,t.y)){let b=Math.abs(r-t.y)/(o-t.x);(to(t,n)||t.y===r&&t.next.y===r&&t.next.x>o)&&(b<u||b===u&&(t.x>a.x||t.x===a.x&&Sc(a,t)))&&(a=t,u=b);}t=t.next;}while(t!==p)}return a}function Sc(n,e){return me(n.prev,n,e.prev)<0&&me(e.next,n,n.next)<0}var ke=[],Zt=[],ft=new Uint32Array(0),Qt=new Uint32Array(0),qt=new Uint32Array(256);function Ic(n,e,t,o){let r=n,i=0;do r.z=en(r.x,r.y,e,t,o),ke[i++]=r,r=r.next;while(r!==n);Lc(i);let a=null;for(let l=0;l<i;l++){let s=ke[l];s.prevZ=a,a&&(a.nextZ=s),a=s;}a.nextZ=null;}function Lc(n){if(n<=32){for(let e=1;e<n;e++){let t=ke[e],o=t.z,r=e-1;for(;r>=0&&ke[r].z>o;)ke[r+1]=ke[r],r--;ke[r+1]=t;}return}ft.length<n&&(ft=new Uint32Array(n),Qt=new Uint32Array(n),Zt=new Array(n));for(let e=0;e<n;e++)ft[e]=ke[e].z;Qo(n,ke,ft,Zt,Qt,0),Qo(n,Zt,Qt,ke,ft,8),Qo(n,ke,ft,Zt,Qt,16),Qo(n,Zt,Qt,ke,ft,24);}function Qo(n,e,t,o,r,i){qt.fill(0);for(let l=0;l<n;l++)qt[t[l]>>>i&255]++;let a=0;for(let l=0;l<256;l++){let s=qt[l];qt[l]=a,a+=s;}for(let l=0;l<n;l++){let s=t[l],c=qt[s>>>i&255]++;o[c]=e[l],r[c]=s;}}function en(n,e,t,o,r){return n=(n-t)*r|0,e=(e-o)*r|0,n=(n|n<<8)&16711935,n=(n|n<<4)&252645135,n=(n|n<<2)&858993459,n=(n|n<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,n|e<<1}function Tc(n){let e=n,t=n;do(e.x<t.x||e.x===t.x&&e.y<t.y)&&(t=e),e=e.next;while(e!==n);return t}function er(n,e,t,o,r,i,a,l){return (r-a)*(e-l)>=(n-a)*(i-l)&&(n-a)*(o-l)>=(t-a)*(e-l)&&(t-a)*(i-l)>=(r-a)*(o-l)}function Hc(n,e){let t=eo(n,e)&&me(n.prev,n,n.next)>0&&me(e.prev,e,e.next)>0;return n.next.i!==e.i&&(t||to(n,e)&&to(e,n)&&(me(n.prev,n,e.prev)!==0||me(n,e.prev,e)!==0))&&!kc(n,e)&&(t||Pc(n,e))}function me(n,e,t){return (e.y-n.y)*(t.x-e.x)-(e.x-n.x)*(t.y-e.y)}function eo(n,e){return n.x===e.x&&n.y===e.y}function fa(n,e,t,o,r=true){let i=me(n,e,t),a=me(n,e,o),l=me(t,o,n),s=me(t,o,e);return (i>0&&a<0||i<0&&a>0)&&(l>0&&s<0||l<0&&s>0)?true:r?!!(i===0&&qo(n,t,e)||a===0&&qo(n,o,e)||l===0&&qo(t,n,o)||s===0&&qo(t,e,o)):false}function qo(n,e,t){return e.x<=Math.max(n.x,t.x)&&e.x>=Math.min(n.x,t.x)&&e.y<=Math.max(n.y,t.y)&&e.y>=Math.min(n.y,t.y)}function kc(n,e){let t=Math.min(n.x,e.x),o=Math.max(n.x,e.x),r=Math.min(n.y,e.y),i=Math.max(n.y,e.y),a=n;do{let l=a.next;if(a.x>o&&l.x>o||a.x<t&&l.x<t||a.y>i&&l.y>i||a.y<r&&l.y<r){a=l;continue}if(a.i!==n.i&&l.i!==n.i&&a.i!==e.i&&l.i!==e.i&&fa(a,l,n,e))return true;a=l;}while(a!==n);return false}function to(n,e){return me(n.prev,n,n.next)<0?me(n,e,n.next)>=0&&me(n,n.prev,e)>=0:me(n,e,n.prev)<0||me(n,n.next,e)<0}function Pc(n,e){let t=n,o=false,r=(n.x+e.x)/2,i=(n.y+e.y)/2;do{let a=t.next;t.y>i!=a.y>i&&r<(a.x-t.x)*(i-t.y)/(a.y-t.y)+t.x&&(o=!o),t=a;}while(t!==n);return o}function ua(n,e){let t=tn(n.i,n.x,n.y),o=tn(e.i,e.x,e.y),r=n.next,i=e.prev;return n.next=e,e.prev=n,t.next=r,r.prev=t,o.next=t,t.prev=o,i.next=o,o.prev=i,o}function aa(n,e,t,o){let r=tn(n,e,t);return o?(r.next=o.next,r.prev=o,o.next.prev=r,o.next=r):(r.prev=r,r.next=r),r}function oo(n){n.next.prev=n.prev,n.prev.next=n.next,n.prevZ&&(n.prevZ.nextZ=n.nextZ),n.nextZ&&(n.nextZ.prevZ=n.prevZ),Qr&&Fc(n.prev,n.next);}function tn(n,e,t){return {i:n,x:e,y:t,prev:null,next:null,z:0,prevZ:null,nextZ:null}}function Rc(n,e,t,o){let r=0;for(let i=e,a=t-o;i<t;i+=o)r+=(n[a]-n[i])*(n[i+1]+n[a+1]),a=i;return r}var ha=23283064365386963e-26,Gc=12,da=typeof TextDecoder>"u"?null:new TextDecoder("utf-8"),on=0,tr=1,ro=2,or=5,ht=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,t,o=this.length){for(;this.pos<o;){let r=this.readVarint(),i=r>>3,a=this.pos;this.type=r&7,e(i,t,this),this.pos===a&&this.skip(r);}return t}readMessage(e,t){return this.readFields(e,t,this.readVarint()+this.pos)}readFixed32(){let e=this.dataView.getUint32(this.pos,true);return this.pos+=4,e}readSFixed32(){let e=this.dataView.getInt32(this.pos,true);return this.pos+=4,e}readFixed64(){let e=this.dataView.getUint32(this.pos,true)+this.dataView.getUint32(this.pos+4,true)*4294967296;return this.pos+=8,e}readSFixed64(){let e=this.dataView.getUint32(this.pos,true)+this.dataView.getInt32(this.pos+4,true)*4294967296;return this.pos+=8,e}readFloat(){let e=this.dataView.getFloat32(this.pos,true);return this.pos+=4,e}readDouble(){let e=this.dataView.getFloat64(this.pos,true);return this.pos+=8,e}readVarint(e){let t=this.buf,o,r;return r=t[this.pos++],o=r&127,r<128||(r=t[this.pos++],o|=(r&127)<<7,r<128)||(r=t[this.pos++],o|=(r&127)<<14,r<128)||(r=t[this.pos++],o|=(r&127)<<21,r<128)?o:(r=t[this.pos],o|=(r&15)<<28,Oc(o,e,this))}readVarint64(){return this.readVarint(true)}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,t=this.pos;return this.pos=e,e-t>=Gc&&da?da.decode(this.buf.subarray(t,e)):qc(this.buf,t,e)}readBytes(){let e=this.readVarint()+this.pos,t=this.buf.subarray(this.pos,e);return this.pos=e,t}readPackedVarint(e=[],t){let o=this.readPackedEnd();for(;this.pos<o;)e.push(this.readVarint(t));return e}readPackedSVarint(e=[]){let t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readSVarint());return e}readPackedBoolean(e=[]){let t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readBoolean());return e}readPackedFloat(e=[]){let t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readFloat());return e}readPackedDouble(e=[]){let t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readDouble());return e}readPackedFixed32(e=[]){let t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readFixed32());return e}readPackedSFixed32(e=[]){let t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readSFixed32());return e}readPackedFixed64(e=[]){let t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readFixed64());return e}readPackedSFixed64(e=[]){let t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readSFixed64());return e}readPackedEnd(){return this.type===ro?this.readVarint()+this.pos:this.pos+1}skip(e){let t=e&7;if(t===on)for(;this.buf[this.pos++]>127;);else if(t===ro)this.pos=this.readVarint()+this.pos;else if(t===or)this.pos+=4;else if(t===tr)this.pos+=8;else throw new Error(`Unimplemented type: ${t}`)}writeTag(e,t){this.writeVarint(e<<3|t);}realloc(e){let t=this.length||16;for(;t<this.pos+e;)t*=2;if(t!==this.length){let o=new Uint8Array(t);o.set(this.buf),this.buf=o,this.dataView=new DataView(o.buffer),this.length=t;}}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,true),this.pos+=4;}writeSFixed32(e){this.realloc(4),this.dataView.setInt32(this.pos,e,true),this.pos+=4;}writeFixed64(e){this.realloc(8),this.dataView.setInt32(this.pos,e&-1,true),this.dataView.setInt32(this.pos+4,Math.floor(e*ha),true),this.pos+=8;}writeSFixed64(e){this.realloc(8),this.dataView.setInt32(this.pos,e&-1,true),this.dataView.setInt32(this.pos+4,Math.floor(e*ha),true),this.pos+=8;}writeVarint(e){if(e=+e||0,e>268435455||e<0){zc(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 t=this.pos;this.pos=$c(this.buf,e,this.pos);let o=this.pos-t;o>=128&&pa(t,o,this),this.pos=t-1,this.writeVarint(o),this.pos+=o;}writeFloat(e){this.realloc(4),this.dataView.setFloat32(this.pos,e,true),this.pos+=4;}writeDouble(e){this.realloc(8),this.dataView.setFloat64(this.pos,e,true),this.pos+=8;}writeBytes(e){let t=e.length;this.writeVarint(t),this.realloc(t);for(let o=0;o<t;o++)this.buf[this.pos++]=e[o];}writeRawMessage(e,t){this.pos++;let o=this.pos;e(t,this);let r=this.pos-o;r>=128&&pa(o,r,this),this.pos=o-1,this.writeVarint(r),this.pos+=r;}writeMessage(e,t,o){this.writeTag(e,ro),this.writeRawMessage(t,o);}writePackedVarint(e,t){t.length&&this.writeMessage(e,Nc,t);}writePackedSVarint(e,t){t.length&&this.writeMessage(e,Kc,t);}writePackedBoolean(e,t){t.length&&this.writeMessage(e,Xc,t);}writePackedFloat(e,t){t.length&&this.writeMessage(e,Uc,t);}writePackedDouble(e,t){t.length&&this.writeMessage(e,Jc,t);}writePackedFixed32(e,t){t.length&&this.writeMessage(e,jc,t);}writePackedSFixed32(e,t){t.length&&this.writeMessage(e,Yc,t);}writePackedFixed64(e,t){t.length&&this.writeMessage(e,Zc,t);}writePackedSFixed64(e,t){t.length&&this.writeMessage(e,Qc,t);}writeBytesField(e,t){this.writeTag(e,ro),this.writeBytes(t);}writeFixed32Field(e,t){this.writeTag(e,or),this.writeFixed32(t);}writeSFixed32Field(e,t){this.writeTag(e,or),this.writeSFixed32(t);}writeFixed64Field(e,t){this.writeTag(e,tr),this.writeFixed64(t);}writeSFixed64Field(e,t){this.writeTag(e,tr),this.writeSFixed64(t);}writeVarintField(e,t){this.writeTag(e,on),this.writeVarint(t);}writeSVarintField(e,t){this.writeTag(e,on),this.writeSVarint(t);}writeStringField(e,t){this.writeTag(e,ro),this.writeString(t);}writeFloatField(e,t){this.writeTag(e,or),this.writeFloat(t);}writeDoubleField(e,t){this.writeTag(e,tr),this.writeDouble(t);}writeBooleanField(e,t){this.writeVarintField(e,+t);}};function Oc(n,e,t){let o=t.buf,r,i;if(i=o[t.pos++],r=(i&112)>>4,i<128||(i=o[t.pos++],r|=(i&127)<<3,i<128)||(i=o[t.pos++],r|=(i&127)<<10,i<128)||(i=o[t.pos++],r|=(i&127)<<17,i<128)||(i=o[t.pos++],r|=(i&127)<<24,i<128)||(i=o[t.pos++],r|=(i&1)<<31,i<128))return Ct(n,r,e);throw new Error("Expected varint not more than 10 bytes")}function Ct(n,e,t){return t?e*4294967296+(n>>>0):(e>>>0)*4294967296+(n>>>0)}function zc(n,e){let t,o;if(n>=0?(t=n%4294967296|0,o=n/4294967296|0):(t=~(-n%4294967296),o=~(-n/4294967296),t^4294967295?t=t+1|0:(t=0,o=o+1|0)),n>=18446744073709552e3||n<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");e.realloc(10),Vc(t,o,e),Wc(o,e);}function Vc(n,e,t){t.buf[t.pos++]=n&127|128,n>>>=7,t.buf[t.pos++]=n&127|128,n>>>=7,t.buf[t.pos++]=n&127|128,n>>>=7,t.buf[t.pos++]=n&127|128,n>>>=7,t.buf[t.pos]=n&127;}function Wc(n,e){let t=(n&7)<<4;e.buf[e.pos++]|=t|((n>>>=3)?128:0),n&&(e.buf[e.pos++]=n&127|((n>>>=7)?128:0),n&&(e.buf[e.pos++]=n&127|((n>>>=7)?128:0),n&&(e.buf[e.pos++]=n&127|((n>>>=7)?128:0),n&&(e.buf[e.pos++]=n&127|((n>>>=7)?128:0),n&&(e.buf[e.pos++]=n&127)))));}function pa(n,e,t){let o=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(Math.LN2*7));t.realloc(o);for(let r=t.pos-1;r>=n;r--)t.buf[r+o]=t.buf[r];}function Nc(n,e){for(let t=0;t<n.length;t++)e.writeVarint(n[t]);}function Kc(n,e){for(let t=0;t<n.length;t++)e.writeSVarint(n[t]);}function Uc(n,e){for(let t=0;t<n.length;t++)e.writeFloat(n[t]);}function Jc(n,e){for(let t=0;t<n.length;t++)e.writeDouble(n[t]);}function Xc(n,e){for(let t=0;t<n.length;t++)e.writeBoolean(n[t]);}function jc(n,e){for(let t=0;t<n.length;t++)e.writeFixed32(n[t]);}function Yc(n,e){for(let t=0;t<n.length;t++)e.writeSFixed32(n[t]);}function Zc(n,e){for(let t=0;t<n.length;t++)e.writeFixed64(n[t]);}function Qc(n,e){for(let t=0;t<n.length;t++)e.writeSFixed64(n[t]);}function qc(n,e,t){let o="",r=e;for(;r<t;){let i=n[r],a=null,l=i>239?4:i>223?3:i>191?2:1;if(r+l>t)break;let s,c,h;l===1?i<128&&(a=i):l===2?(s=n[r+1],(s&192)===128&&(a=(i&31)<<6|s&63,a<=127&&(a=null))):l===3?(s=n[r+1],c=n[r+2],(s&192)===128&&(c&192)===128&&(a=(i&15)<<12|(s&63)<<6|c&63,(a<=2047||a>=55296&&a<=57343)&&(a=null))):l===4&&(s=n[r+1],c=n[r+2],h=n[r+3],(s&192)===128&&(c&192)===128&&(h&192)===128&&(a=(i&15)<<18|(s&63)<<12|(c&63)<<6|h&63,(a<=65535||a>=1114112)&&(a=null))),a===null?(a=65533,l=1):a>65535&&(a-=65536,o+=String.fromCharCode(a>>>10&1023|55296),a=56320|a&1023),o+=String.fromCharCode(a),r+=l;}return o}function $c(n,e,t){for(let o=0,r,i;o<e.length;o++){if(r=e.charCodeAt(o),r>55295&&r<57344)if(i)if(r<56320){n[t++]=239,n[t++]=191,n[t++]=189,i=r;continue}else r=i-55296<<10|r-56320|65536,i=null;else {r>56319||o+1===e.length?(n[t++]=239,n[t++]=191,n[t++]=189):i=r;continue}else i&&(n[t++]=239,n[t++]=191,n[t++]=189,i=null);r<128?n[t++]=r:(r<2048?n[t++]=r>>6|192:(r<65536?n[t++]=r>>12|224:(n[t++]=r>>18|240,n[t++]=r>>12&63|128),n[t++]=r>>6&63|128),n[t++]=r&63|128);}return t}var io=(r=>(r[r.Unknown=0]="Unknown",r[r.Point=1]="Point",r[r.LineString=2]="LineString",r[r.Polygon=3]="Polygon",r))(io||{}),rr=class n{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,i){let a=new n(e,o,r,i);return e.readFields(ef,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,i=0,a=0,l=0,s=[],c=[];for(;e.pos<o;){if(i<=0){let h=e.readVarint();r=h&7,i=h>>3;}if(i--,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,i=-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]>i&&(i=a[l+1]);return [t,o,r,i]}};function ef(n,e,t){t&&(n===1?e.id=t.readVarint():n===2?tf(t,e):n===3?e.type=t.readVarint():n===4&&(e.geomOffset=t.pos,t.skip(2)));}function tf(n,e){let t=n.readVarint()+n.pos;for(;n.pos<t;){let o=e.keys[n.readVarint()],r=e.values[n.readVarint()];o!==void 0&&(e.properties[o]=r);}}var nr=class n{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 n(e);return e.readFields(of,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 rr.read(t,o,this.keys,this.values,this.extent)}*features(){for(let e=0;e<this.featureOffsets.length;e++)yield this.feature(e);}};function of(n,e,t){t&&(n===15?e.version=t.readVarint():n===1?e.name=t.readString():n===5?e.extent=t.readVarint():n===2?e.featureOffsets.push(t.pos):n===3?e.keys.push(t.readString()):n===4&&e.values.push(rf(t)));}function rf(n){let e=n.readVarint()+n.pos,t=null;for(;n.pos<e;){let o=n.readVarint()>>3;o===1?t=n.readString():o===2?t=n.readFloat():o===3?t=n.readDouble():o===4?t=n.readVarint64():o===5?t=n.readVarint():o===6?t=n.readSVarint():o===7?t=n.readBoolean():n.skip(o);}return t}var no=class{constructor(e){this.layers={};new ht(e instanceof Uint8Array?e:new Uint8Array(e)).readFields((o,r,i)=>{if(o===3&&i){let a=nr.read(i,i.readVarint()+i.pos);a.length&&(this.layers[a.name]=a);}},null);}};function dt(n){let e=[],t=null;for(let o of n){if(o.length<6)continue;let r=nf(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 nf(n){let e=0;for(let t=0,o=n.length-2;t<n.length;o=t,t+=2)e+=(n[o]-n[t])*(n[t+1]+n[o+1]);return e/2}function V(n,e,t){return n===void 0?t:typeof n=="number"?n:ma(n.stops,e,(o,r,i)=>o+(r-o)*i,t)}function He(n,e,t){return n===void 0?t:typeof n=="string"?he(n):ma(n.stops,e,(o,r,i)=>{let a=he(o),l=he(r);return [a[0]+(l[0]-a[0])*i,a[1]+(l[1]-a[1])*i,a[2]+(l[2]-a[2])*i,a[3]+(l[3]-a[3])*i]},t)}function ma(n,e,t,o){if(!n.length)return o;if(e<=n[0][0])return t(n[0][1],n[0][1],0);let r=n[n.length-1];if(e>=r[0])return t(r[1],r[1],0);for(let i=1;i<n.length;i++){let[a,l]=n[i];if(e>a)continue;let[s,c]=n[i-1],h=a-s,u=h===0?0:(e-s)/h;return t(c,l,u)}return o}function Be(n,e){if(!n)return true;let t=n[0];switch(t){case "all":return n.slice(1).every(o=>Be(o,e));case "any":return n.slice(1).some(o=>Be(o,e));case "!":return !Be(n[1],e);case "has":return e[n[1]]!=null;case "!has":return e[n[1]]==null;case "in":{let o=e[n[1]];return o==null?false:n.slice(2).includes(o)}case "!in":{let o=e[n[1]];return o==null?true:!n.slice(2).includes(o)}default:{let o=e[n[1]],r=n[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 af=Math.PI/8,lf=.35,sf=32,ba=.25,ga=.5,ya=.07;function Ke(n,e){let t=e.radius;if(!(t>0))return n;let o=n.length/2-1;if(o<3)return n;let r=Math.max(2,Math.round(e.segments??4)),i=Math.max(e.minCutRatio??lf,0),a=e.extent,l=e.margin??0,s=[];for(let c=0;c<o;c++){let h=n[c*2],u=n[c*2+1],f=n[(c+o-1)%o*2],d=n[(c+o-1)%o*2+1],p=n[(c+1)%o*2],b=n[(c+1)%o*2+1],m=h-f,g=u-d,y=p-h,A=b-u,B=Math.hypot(m,g),x=Math.hypot(y,A);if(B<1e-6||x<1e-6){s.push(h,u);continue}let w=m/B,_=g/B,C=y/x,v=A/x;if(e.keep?.[c]){s.push(h,u);continue}let E=w*C+_*v;if(E>.985){s.push(h,u);continue}if(a!==void 0&&(rn(h,u,a,l)||rn(f,d,a,l)||rn(p,b,a,l))){s.push(h,u);continue}let D=Math.min(t,B*.4,x*.4);if(D<t*i){s.push(h,u);continue}let F=h-w*D,H=u-_*D,S=h+C*D,L=u+v*D,M=Math.acos(Math.max(-1,Math.min(1,E))),T=Math.min(af,Math.PI/2/r),P=Math.ceil(M/T-1e-6),k=e.maxChord&&e.maxChord>0?Math.ceil(D/Math.tan(M/2)*M/e.maxChord):0,O=Math.max(1,Math.min(sf,Math.max(Math.min(r,P),k)));s.push(F,H);for(let N=1;N<O;N++){let G=N/O,R=1-G;s.push(R*R*F+2*R*G*h+G*G*S,R*R*H+2*R*G*u+G*G*L);}s.push(S,L);}return s.length<6?n:(s.push(s[0],s[1]),s)}var rn=(n,e,t,o)=>n<=-o||e<=-o||n>=t+o||e>=t+o;var Ye=n=>n/64;function vt(n,e,t=0){let o=Aa(n.outer,e,t);if(!o)return null;let r=[];for(let i of n.holes){let a=Aa(i,e,t);a&&r.push(a);}return {outer:o,holes:r}}function Aa(n,e,t){let o=[];for(let r=0;r<n.length-2;r+=2)o.push(n[r],n[r+1]);if(o.length<6)return null;for(let r=0;r<4;r++){let i=o;o=[];let a=i.length/2;if(a===0)return null;for(let l=0;l<a;l++){let s=i[l*2],c=i[l*2+1],h=i[(l+a-1)%a*2],u=i[(l+a-1)%a*2+1],f=Ba(s,c,r,e,t),d=Ba(h,u,r,e,t);if(f!==d){let p=cf(h,u,s,c,r,e,t);o.push(h+(s-h)*p,u+(c-u)*p);}f&&o.push(s,c);}}return o.length<6?null:(o.push(o[0],o[1]),o)}function Ba(n,e,t,o,r){return t===0?n>=-r:t===1?n<=o+r:t===2?e>=-r:e<=o+r}function cf(n,e,t,o,r,i,a){return r===0?(-a-n)/(t-n):r===1?(i+a-n)/(t-n):r===2?(-a-e)/(o-e):(i+a-e)/(o-e)}function ir(n,e,t,o,r,i=0){let a=-i,l=r+i;return n===a&&t===a||n===l&&t===l||e===a&&o===a||e===l&&o===l}function Ca(n,e){for(let t=0;t<n.length;t+=2)if(n[t]<=0||n[t]>=e||n[t+1]<=0||n[t+1]>=e)return true;return false}var Ie=18,Et=32,_t=8,Ea=65535/Et,ff=9,uf=1,hf=0,df=1,pf=2;var va=0,mf=1,xa=2,bf=3,gf=.47;function ln(n,e,t,o={}){let r=o.metersPerUnit&&o.metersPerUnit>0?o.metersPerUnit:gf,i=Math.max(1024,n.length*48),a=new ArrayBuffer(i*Ie),l={verts:new DataView(a),vertsU8:new Uint8Array(a),vertOffset:0,vertexCount:0,indices:[],featureIds:[],ensure:()=>{}};l.ensure=f=>s(f);let s=f=>{if(l.vertexCount+f<=i)return;i=Math.max(i*2,l.vertexCount+f);let d=new ArrayBuffer(i*Ie);new Uint8Array(d).set(l.vertsU8.subarray(0,l.vertOffset)),a=d,l.verts=new DataView(d),l.vertsU8=new Uint8Array(d);};for(let f of n.features()){if(f.type!==3||!Be(t,f.properties))continue;let d=Gf(f.properties),p=Of(f.properties,d);if(d<=p)continue;let b=Vf(f.properties)??Number(f.id??0),m=Rf(b>>>0),g=Pf(m,f.properties),y=kf(f.properties,d),A=dt(f.loadGeometry());for(let B of A){let x=vt(B,e);if(!x)continue;let w=Ca(x.outer,e),_=(o.cornerRadius??0)/r,C={radius:_,segments:o.cornerSegments,extent:e,minCutRatio:0,maxChord:r>0?ga/r:0},v=_>0?{outer:Ke(x.outer,C),holes:x.holes.map(L=>Ke(L,C))}:x,E=v.outer.length/2+v.holes.reduce((L,M)=>L+M.length/2,0);s(E*5+32);let D=v.holes.length||w?null:Cf(v.outer),F=D?Mf(f.properties,D,d,m,r):null,H=null,S=[];if(F&&D){let L=Ma(Sf(v.outer,r),D,F.shape);S=If(L,v.outer);let M=Lf(L,S);if(M>1e-6){let T=Math.min(Math.max(M*r*wf,Ef),_f);H=Tf(L,T/M,d);}}_a(l,v.outer,p,d,b,g,y,r,e,H);for(let L of v.holes)_a(l,L,p,d,b,g,y,r,e,null);H?Hf(l,S,H,d,b,g,y,r):Bf(l,v.outer,v.holes,d,b,g,y);}}if(!l.indices.length)return null;let c=new Uint32Array(l.indices),h=new Float64Array(l.featureIds);return {vertices:a.slice(0,l.vertOffset),indices:c.buffer,featureIds:h.buffer,vertexCount:l.vertexCount,indexCount:c.length,extent:e}}var sn=(n,e)=>n|e<<2,wa=n=>Math.max(-32768,Math.min(32767,n)),nn=n=>Math.max(0,Math.min(65535,Math.round(Math.min(n,Ea)*Et)));function xt(n,e,t,o,r,i,a,l,s,c,h=0,u=0,f=0){let d=n.vertOffset;return n.verts.setInt16(d,wa(Math.round(e*_t)),true),n.verts.setInt16(d+2,wa(Math.round(t*_t)),true),n.verts.setUint16(d+4,Math.round(Math.min(o,Ea)*Et),true),n.vertsU8[d+6]=s,n.vertsU8[d+7]=l,n.verts.setInt8(d+8,an(Math.round(r*127))),n.verts.setInt8(d+9,an(Math.round(i*127))),n.verts.setInt8(d+10,an(Math.round(a*127))),n.vertsU8[d+11]=c,n.verts.setUint16(d+12,nn(h),true),n.verts.setUint16(d+14,nn(u),true),n.verts.setUint16(d+16,nn(f),true),n.vertOffset+=Ie,n.vertexCount++}function _a(n,e,t,o,r,i,a,l,s,c=null){let h=e.length/2;if(h<3)return;let u=sn(hf,a),f=Af(e,l),d=o-t,p=new Float64Array(h*2),b=new Uint8Array(h);{let m=new Float64Array(h*2);for(let g=0;g<h-1;g++){let y=e[g*2+2]-e[g*2],A=e[g*2+3]-e[g*2+1],B=Math.hypot(y,A)||1;m[g*2]=A/B,m[g*2+1]=-y/B;}for(let g=0;g<h-1;g++){let y=(g+h-2)%(h-1),A=m[y*2]*m[g*2]+m[y*2+1]*m[g*2+1],B=m[y*2]+m[g*2],x=m[y*2+1]+m[g*2+1],w=Math.hypot(B,x);A>.5&&w>1e-6&&(p[g*2]=B/w,p[g*2+1]=x/w,b[g]=1);}}for(let m=0;m<h-1;m++){let g=e[m*2],y=e[m*2+1],A=e[m*2+2],B=e[m*2+3];if(g===A&&y===B||ir(g,y,A,B,s))continue;let x=A-g,w=B-y,_=Math.hypot(x,w)||1,C=w/_,v=-x/_,E=f.offset[m],D=f.width[m],F=[0,1];if(c){for(let S=0;S<c.length;S++)for(let L=S+1;L<c.length;L++){let M=pt(c[S],g,y)-pt(c[L],g,y),T=pt(c[S],A,B)-pt(c[L],A,B);if(M===T)continue;let P=M/(M-T);P>1e-4&&P<1-1e-4&&F.push(P);}F.sort((S,L)=>S-L);}let H=(S,L)=>{if(!c)return o;let M=1/0;for(let T of c)M=Math.min(M,pt(T,S,L));return Math.max(o,M)};for(let S=0;S+1<F.length;S++){let L=F[S],M=F[S+1];if(M-L<1e-6)continue;let T=g+x*L,P=y+w*L,k=g+x*M,O=y+w*M,N=E+_*L*l,G=E+_*M*l,R=(m+1)%(h-1),W=b[m]?p[m*2]:C,j=b[m]?p[m*2+1]:v,Z=b[R]?p[R*2]:C,ee=b[R]?p[R*2+1]:v,ge=C+(W-C)*(1-L),te=v+(j-v)*(1-L),X=C+(Z-C)*M,re=v+(ee-v)*M,le=Math.hypot(ge,te)||1,q=Math.hypot(X,re)||1,U=ge/le,J=te/le,fe=X/q,se=re/q;n.ensure(4);let ue=xt(n,T,P,t,U,J,0,0,i,u,N,D,d),ae=xt(n,k,O,t,fe,se,0,0,i,u,G,D,d),xe=xt(n,T,P,H(T,P),U,J,0,255,i,u,N,D,d),Te=xt(n,k,O,H(k,O),fe,se,0,255,i,u,G,D,d);n.indices.push(ue,Te,ae,ue,xe,Te),n.featureIds.push(r,r);}}}var yf=.9976;function Af(n,e){let t=n.length/2-1,o=[];for(let s=0;s<t;s++){let c=n[s*2+2]-n[s*2],h=n[s*2+3]-n[s*2+1],u=Math.hypot(c,h);o.push(u>0?{x:c/u,y:h/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>=yf,i=0;for(;i<t&&r((i-1+t)%t,i);)i++;i>=t&&(i=0);let a=new Array(t).fill(0),l=new Array(t).fill(0);for(let s=0;s<t;){let c=(i+s)%t,h=[c],u=o[c].len,f=s+1;for(;f<t;){let p=(i+f)%t;if(!r((i+f-1)%t,p))break;h.push(p),u+=o[p].len,f++;}let d=0;for(let p of h)a[p]=d,l[p]=u,d+=o[p].len;s=f;}return {offset:a,width:l}}function Bf(n,e,t,o,r,i,a){let l=[],s=[];for(let f=0;f<e.length;f++)l.push(e[f]);for(let f of t){s.push(l.length/2);for(let d=0;d<f.length;d++)l.push(f[d]);}let c=Pe(l,s.length?s:void 0,2);if(!c.length)return;let h=sn(df,a),u=n.vertexCount;for(let f=0;f<l.length;f+=2)xt(n,l[f],l[f+1],o,0,0,1,255,i,h);for(let f=0;f<c.length;f+=3)n.indices.push(u+c[f],u+c[f+2],u+c[f+1]),n.featureIds.push(r);}function Cf(n){let e=vf(n);if(e.length<3)return null;let t=Math.abs(xf(n));if(t<=0)return null;let o=null,r=1/0;for(let i=0;i<e.length;i++){let a=(i+1)%e.length,l=e[a].x-e[i].x,s=e[a].y-e[i].y,c=Math.hypot(l,s);if(c<1e-6)continue;l/=c,s/=c;let h=1/0,u=-1/0,f=1/0,d=-1/0;for(let B of e){let x=B.x*l+B.y*s,w=-B.x*s+B.y*l;x<h&&(h=x),x>u&&(u=x),w<f&&(f=w),w>d&&(d=w);}let p=u-h,b=d-f,m=p*b;if(m<=0||m>=r)continue;r=m;let g=(h+u)/2,y=(f+d)/2,A=p>=b;o={cx:g*l-y*s,cy:g*s+y*l,ax:A?l:-s,ay:A?s:l,halfLong:(A?p:b)/2,halfShort:(A?b:p)/2,fill:t/m};}return o}function vf(n){let e=[];for(let i=0;i<n.length-2;i+=2)e.push({x:n[i],y:n[i+1]});if(e.length<3)return e;e.sort((i,a)=>i.x===a.x?i.y-a.y:i.x-a.x);let t=(i,a,l)=>(a.x-i.x)*(l.y-i.y)-(a.y-i.y)*(l.x-i.x),o=[];for(let i of e){for(;o.length>=2&&t(o[o.length-2],o[o.length-1],i)<=0;)o.pop();o.push(i);}let r=[];for(let i=e.length-1;i>=0;i--){let a=e[i];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 xf(n){let e=0;for(let t=0;t<n.length-2;t+=2)e+=n[t]*n[t+3]-n[t+2]*n[t+1];return e/2}var wf=Math.tan(30*Math.PI/180),_f=3.5,Ef=.9;function Mf(n,e,t,o,r){if(e.fill<.86)return null;let i=e.halfShort*2*r,a=e.halfLong*2*r,l=i*a,s=e.halfShort>0?e.halfLong/e.halfShort:99,c=Ff(n);if(!c){if(t>15||l>600||i<3)return null;let h=o%1e3/1e3;l<30?c=h<.5?"skillion":"gabled":s<1.25?c=h<.35?"pyramidal":"hipped":c=h<.8?"gabled":"hipped";}return c==="flat"?null:{shape:c}}function Ff(n){let e=String(n.roof_shape??n["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 pt=(n,e,t)=>n.a*e+n.b*t+n.c;function Df(n,e,t,o){let r=n.length/2;if(r<3)return [];let i=[],a=l=>[n[l*2],n[l*2+1]];for(let l=0;l<r;l++){let[s,c]=a(l),[h,u]=a((l+r-1)%r),f=e*s+t*c+o,d=e*h+t*u+o;if(f<=0!=d<=0){let p=d/(d-f);i.push(h+(s-h)*p,u+(c-u)*p);}f<=0&&i.push(s,c);}return i}function Sf(n,e){let t=.5/Math.max(e,1e-6),o=n.length/2-1;if(o<5)return n;let r=[],i=0;r.push(n[0],n[1]);for(let a=1;a<o;a++){let l=n[i*2],s=n[i*2+1],c=n[a*2],h=n[a*2+1],u=c-l,f=h-s,d=Math.hypot(u,f),p=d>1e-6;if(p){for(let b=i+1;b<a;b++)if(Math.abs((n[b*2]-l)*f-(n[b*2+1]-s)*u)/d>=t){p=false;break}}p||(r.push(n[(a-1)*2],n[(a-1)*2+1]),i=a-1);}return r.length/2<3?n:(r.push(r[0],r[1]),r)}function Ma(n,e,t){let{ax:o,ay:r,halfLong:i}=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=n.length/2-1;for(let s=0;s<l;s++){let c=n[s*2],h=n[s*2+1],u=n[(s+1)%l*2],f=n[(s+1)%l*2+1],d=u-c,p=f-h,b=Math.hypot(d,p);if(b<1e-6||t==="gabled"&&Math.abs((d*o+p*r)/b)<.86)continue;let m=-p/b,g=d/b;a.push({a:m,b:g,c:-(m*c+g*h)});}return !a.length&&i>0?Ma(n,e,"hipped"):a}function If(n,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<n.length;r++){let i=t;for(let a=0;a<n.length&&i.length>=6;a++)a!==r&&(i=Df(i,n[r].a-n[a].a,n[r].b-n[a].b,n[r].c-n[a].c));o.push(i.length>=6?i:[]);}return o}function Lf(n,e){let t=0;for(let o=0;o<e.length;o++){let r=e[o];for(let i=0;i<r.length;i+=2){let a=pt(n[o],r[i],r[i+1]);a>t&&(t=a);}}return t}function Tf(n,e,t){return n.map(o=>({a:o.a*e,b:o.b*e,c:o.c*e+t}))}function Hf(n,e,t,o,r,i,a,l){let s=sn(pf,a);for(let c=0;c<t.length;c++){let h=e[c];if(!h||h.length<6)continue;let u=Pe(h,void 0,2);if(!u.length)continue;let f=-t[c].a/l,d=-t[c].b/l,p=Math.hypot(f,d,1),b={x:f/p,y:d/p,z:1/p};n.ensure(h.length/2);let m=n.vertexCount;for(let g=0;g<h.length;g+=2){let y=Math.max(o,pt(t[c],h[g],h[g+1]));xt(n,h[g],h[g+1],y,b.x,b.y,b.z,255,i,s);}for(let g=0;g<u.length;g+=3)n.indices.push(m+u[g],m+u[g+2],m+u[g+1]),n.featureIds.push(r);}}function kf(n,e){let t=String(n.class??"").toLowerCase();return t==="industrial"||t==="warehouse"||t==="hangar"||t==="construction"?bf:t==="commercial"||t==="office"||t==="retail"||t==="supermarket"?xa:t==="house"||t==="detached"||t==="garage"||t==="hut"||t==="shed"||e<=7?va:e>=40?xa:mf}function Pf(n,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+(n%121-60)))}function Rf(n){let e=n>>>0;return e=(e>>>16^e)*73244475,e=(e>>>16^e)*73244475,e=e>>>16^e,e>>>0}function Gf(n){let e=wt(n.render_height)??wt(n.height)??zf(n.levels??n.building_levels??n["building:levels"]);return e&&e>0?Math.max(e,uf):ff}function Of(n,e){let t=wt(n.render_min_height)??wt(n.min_height)??wt(n.base)??0;return t>0&&t<e?t:0}function zf(n){let e=wt(n);return e&&e>0?e*3:null}function wt(n){if(typeof n=="number"&&isFinite(n))return n;if(typeof n=="string"){let e=parseFloat(n);if(isFinite(e))return e}return null}var an=n=>n>127?127:n<-127?-127:n;function Vf(n){let e=n.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 et=4;function cn(n,e,t,o,r){let i=o*o,a=[],l=h=>n[h*2],s=h=>n[h*2+1],c=(h,u)=>{let f=n.length/2;return n.push((l(h)+l(u))/2,(s(h)+s(u))/2),f};for(let h=0;h<e.length;h+=3){a.push([t+e[h],t+e[h+1],t+e[h+2]]);let u=0;for(;a.length&&!(++u>2e4);){let[f,d,p]=a.pop(),b=(l(f)-l(d))**2+(s(f)-s(d))**2,m=(l(d)-l(p))**2+(s(d)-s(p))**2,g=(l(p)-l(f))**2+(s(p)-s(f))**2,y=Math.max(b,m,g);if(y<=i){r.push(f,d,p);continue}if(y===b){let A=c(f,d);a.push([f,A,p],[A,d,p]);}else if(y===m){let A=c(d,p);a.push([d,A,f],[A,p,f]);}else {let A=c(p,f);a.push([p,A,d],[A,f,d]);}}}}function fn(n,e,t=0,o,r=false,i=4096){let a=[],l=[],s=[];for(let d of n.features()){if(d.type!==3||!Be(e,d.properties))continue;let p=d.properties.osm_id,b=typeof p=="number"?p:typeof p=="string"?Number(p):NaN,m=Number.isFinite(b)?b:Number(d.id??0);for(let g of dt(d.loadGeometry())){let y=r?vt(g,i):g;if(!y)continue;let A=[],B=[],x=o?Ke(y.outer,o):y.outer;for(let C=0;C<x.length;C++)A.push(x[C]);for(let C of y.holes){let v=o?Ke(C,o):C;B.push(A.length/2);for(let E=0;E<v.length;E++)A.push(v[E]);}let w=Pe(A,B.length?B:void 0,2);if(!w.length)continue;let _=a.length/2;for(let C=0;C<A.length;C++)a.push(A[C]);if(t>0){let C=[];cn(a,w,_,t,C);for(let v=0;v<C.length;v+=3)l.push(C[v],C[v+2],C[v+1]),s.push(m);continue}for(let C=0;C<w.length;C+=3)l.push(_+w[C],_+w[C+2],_+w[C+1]),s.push(m);}}if(!l.length)return null;let c=a.length/2,h=new Int16Array(a),u=new Uint32Array(l);return {featureIds:new Float64Array(s).buffer,vertices:h.buffer,indices:u.buffer,vertexCount:c,indexCount:u.length}}var Ue=class{constructor(e,t){this.next=null,this.key=e,this.data=t,this.left=null,this.right=null;}};function Wf(n,e){return n>e?1:n<e?-1:0}function tt(n,e,t){let o=new Ue(null,null),r=o,i=o;for(;;){let a=t(n,e.key);if(a<0){if(e.left===null)break;if(t(n,e.left.key)<0){let l=e.left;if(e.left=l.right,l.right=e,e=l,e.left===null)break}i.left=e,i=e,e=e.left;}else if(a>0){if(e.right===null)break;if(t(n,e.right.key)>0){let l=e.right;if(e.right=l.left,l.left=e,e=l,e.right===null)break}r.right=e,r=e,e=e.right;}else break}return r.right=e.left,i.left=e.right,e.left=o.right,e.right=o.left,e}function un(n,e,t,o){let r=new Ue(n,e);if(t===null)return r.left=r.right=null,r;t=tt(n,t,o);let i=o(n,t.key);return i<0?(r.left=t.left,r.right=t,t.left=null):i>=0&&(r.right=t.right,r.left=t,t.right=null),r}function Fa(n,e,t){let o=null,r=null;if(e){e=tt(n,e,t);let i=t(e.key,n);i===0?(o=e.left,r=e.right):i<0?(r=e.right,e.right=null,o=e):(o=e.left,e.left=null,r=e);}return {left:o,right:r}}function Nf(n,e,t){return e===null?n:(n===null||(e=tt(n.key,e,t),e.left=n),e)}function hn(n,e,t,o,r){if(n){o(`${e}${t?"\u2514\u2500\u2500 ":"\u251C\u2500\u2500 "}${r(n)}
|
|
9
|
+
`);let i=e+(t?" ":"\u2502 ");n.left&&hn(n.left,i,false,o,r),n.right&&hn(n.right,i,true,o,r);}}var Mt=class{constructor(e=Wf){this._root=null,this._size=0,this._comparator=e;}insert(e,t){return this._size++,this._root=un(e,t,this._root,this._comparator)}add(e,t){let o=new Ue(e,t);this._root===null&&(o.left=o.right=null,this._size++,this._root=o);let r=this._comparator,i=tt(e,this._root,r),a=r(e,i.key);return a===0?this._root=i:(a<0?(o.left=i.left,o.right=i,i.left=null):a>0&&(o.right=i.right,o.left=i,i.right=null),this._size++,this._root=o),this._root}remove(e){this._root=this._remove(e,this._root,this._comparator);}_remove(e,t,o){let r;return t===null?null:(t=tt(e,t,o),o(e,t.key)===0?(t.left===null?r=t.right:(r=tt(e,t.left,o),r.right=t.right),this._size--,r):t)}pop(){let e=this._root;if(e){for(;e.left;)e=e.left;return this._root=tt(e.key,this._root,this._comparator),this._root=this._remove(e.key,this._root,this._comparator),{key:e.key,data:e.data}}return null}findStatic(e){let t=this._root,o=this._comparator;for(;t;){let r=o(e,t.key);if(r===0)return t;r<0?t=t.left:t=t.right;}return null}find(e){return this._root&&(this._root=tt(e,this._root,this._comparator),this._comparator(e,this._root.key)!==0)?null:this._root}contains(e){let t=this._root,o=this._comparator;for(;t;){let r=o(e,t.key);if(r===0)return true;r<0?t=t.left:t=t.right;}return false}forEach(e,t){let o=this._root,r=[],i=false;for(;!i;)o!==null?(r.push(o),o=o.left):r.length!==0?(o=r.pop(),e.call(t,o),o=o.right):i=true;return this}range(e,t,o,r){let i=[],a=this._comparator,l=this._root,s;for(;i.length!==0||l;)if(l)i.push(l),l=l.left;else {if(l=i.pop(),s=a(l.key,t),s>0)break;if(a(l.key,e)>=0&&o.call(r,l))return this;l=l.right;}return this}keys(){let e=[];return this.forEach(({key:t})=>{e.push(t);}),e}values(){let e=[];return this.forEach(({data:t})=>{e.push(t);}),e}min(){return this._root?this.minNode(this._root).key:null}max(){return this._root?this.maxNode(this._root).key:null}minNode(e=this._root){if(e)for(;e.left;)e=e.left;return e}maxNode(e=this._root){if(e)for(;e.right;)e=e.right;return e}at(e){let t=this._root,o=false,r=0,i=[];for(;!o;)if(t)i.push(t),t=t.left;else if(i.length>0){if(t=i.pop(),r===e)return t;r++,t=t.right;}else o=true;return null}next(e){let t=this._root,o=null;if(e.right){for(o=e.right;o.left;)o=o.left;return o}let r=this._comparator;for(;t;){let i=r(e.key,t.key);if(i===0)break;i<0?(o=t,t=t.left):t=t.right;}return o}prev(e){let t=this._root,o=null;if(e.left!==null){for(o=e.left;o.right;)o=o.right;return o}let r=this._comparator;for(;t;){let i=r(e.key,t.key);if(i===0)break;i<0?t=t.left:(o=t,t=t.right);}return o}clear(){return this._root=null,this._size=0,this}toList(){return Uf(this._root)}load(e,t=[],o=false){let r=e.length,i=this._comparator;if(o&&mn(e,t,0,r-1,i),this._root===null)this._root=dn(e,t,0,r),this._size=r;else {let a=Jf(this.toList(),Kf(e,t),i);r=this._size+r,this._root=pn({head:a},0,r);}return this}isEmpty(){return this._root===null}get size(){return this._size}get root(){return this._root}toString(e=t=>String(t.key)){let t=[];return hn(this._root,"",true,o=>t.push(o),e),t.join("")}update(e,t,o){let r=this._comparator,{left:i,right:a}=Fa(e,this._root,r);r(e,t)<0?a=un(t,o,a,r):i=un(t,o,i,r),this._root=Nf(i,a,r);}split(e){return Fa(e,this._root,this._comparator)}*[Symbol.iterator](){let e=this._root,t=[],o=false;for(;!o;)e!==null?(t.push(e),e=e.left):t.length!==0?(e=t.pop(),yield e,e=e.right):o=true;}};function dn(n,e,t,o){let r=o-t;if(r>0){let i=t+Math.floor(r/2),a=n[i],l=e[i],s=new Ue(a,l);return s.left=dn(n,e,t,i),s.right=dn(n,e,i+1,o),s}return null}function Kf(n,e){let t=new Ue(null,null),o=t;for(let r=0;r<n.length;r++)o=o.next=new Ue(n[r],e[r]);return o.next=null,t.next}function Uf(n){let e=n,t=[],o=false,r=new Ue(null,null),i=r;for(;!o;)e?(t.push(e),e=e.left):t.length>0?(e=i=i.next=t.pop(),e=e.right):o=true;return i.next=null,r.next}function pn(n,e,t){let o=t-e;if(o>0){let r=e+Math.floor(o/2),i=pn(n,e,r),a=n.head;return a.left=i,n.head=n.head.next,a.right=pn(n,r+1,t),a}return null}function Jf(n,e,t){let o=new Ue(null,null),r=o,i=n,a=e;for(;i!==null&&a!==null;)t(i.key,a.key)<0?(r.next=i,i=i.next):(r.next=a,a=a.next),r=r.next;return i!==null?r.next=i:a!==null&&(r.next=a),o.next}function mn(n,e,t,o,r){if(t>=o)return;let i=n[t+o>>1],a=t-1,l=o+1;for(;;){do a++;while(r(n[a],i)<0);do l--;while(r(n[l],i)>0);if(a>=l)break;let s=n[a];n[a]=n[l],n[l]=s,s=e[a],e[a]=e[l],e[l]=s;}mn(n,e,t,l,r),mn(n,e,l+1,o,r);}var ot=Number.EPSILON;ot===void 0&&(ot=Math.pow(2,-52));var qf=ot*ot,Ta=(n,e)=>{if(-ot<n&&n<ot&&-ot<e&&e<ot)return 0;let t=n-e;return t*t<qf*n*e?0:n<e?-1:1},yn=class{constructor(){this.reset();}reset(){this.xRounder=new lr,this.yRounder=new lr;}round(e,t){return {x:this.xRounder.round(e),y:this.yRounder.round(t)}}},lr=class{constructor(){this.tree=new Mt,this.round(0);}round(e){let t=this.tree.add(e),o=this.tree.prev(t);if(o!==null&&Ta(t.key,o.key)===0)return this.tree.remove(e),o.key;let r=this.tree.next(t);return r!==null&&Ta(t.key,r.key)===0?(this.tree.remove(e),r.key):e}};new yn;typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6;typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6;function Oa(n){let e=[];for(let t=0;t+1<n.length;t+=2)e.push([n[t],n[t+1]]);return e}function za(n){let e=[];for(let o of n)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 Va(n,e,t=0){if(n.length<2)return n;let o=new Map;for(let i of n){let a=i.lift??0,l=o.get(a);l?l.push(i):o.set(a,[i]);}let r=[];for(let[i,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(f=>e(f,t)??f)})):a).map(u=>[Oa(u.outer),...u.holes.map(Oa)]),c;try{c=(void 0)(s[0],...s.slice(1));}catch{r.push(...a);continue}let h=c;if(!Array.isArray(h)||h.length===0){r.push(...a);continue}for(let u of h){if(!u.length)continue;let f=za(u[0]);if(f.length<8)continue;let d=[];for(let p=1;p<u.length;p++){let b=za(u[p]);b.length>=8&&d.push(b);}r.push(i?{outer:f,holes:d,lift:i}:{outer:f,holes:d});}}return r}var St=16,Xa=64,ja=0,nu=1,Wa=2,iu=3,fo=1,au=.6;function Dn(n,e,t,o){let r=o.metersPerUnit>0?o.metersPerUnit:.5,i=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,h=Math.max(512,n.length*24),u=new ArrayBuffer(h*St),f={view:new DataView(u),bytes:new Uint8Array(u),offset:0,count:0,indices:[],extent:e,ensure(C){if(f.count+C<=h)return;h=Math.max(h*2,f.count+C);let v=new ArrayBuffer(h*St);new Uint8Array(v).set(f.bytes.subarray(0,f.offset)),u=v,f.view=new DataView(v),f.bytes=new Uint8Array(v);}},d=[],p=new Map;for(let C of n.features()){if(C.type!==3||!Be(t,C.properties))continue;let v=o.liftBy?.(C.properties)??0;for(let E of dt(C.loadGeometry())){let D=vt(E,e,Ye(e));D&&d.push(v?{...D,lift:v}:D);}}let b=new Set,m=Math.max(o.weld??au,0),g=Va(d,(C,v)=>En(C,v,e,b),m/r),y=m>0?g.map(C=>({...C,outer:Ja(C.outer,m/r,e),holes:C.holes.map(v=>Ja(v,m/r,e))})):g;for(let C of y){Na(C.outer,p);for(let v of C.holes)Na(v,p);}o.onShapes?.(y);let A=new Set;for(let[C,v]of p)v>1&&A.add(C);let B=[],x={radius:c,segments:o.cornerSegments,extent:e,margin:Ye(e),minCutRatio:0,maxChord:ba/r};for(let C of y){let v=c>0?{outer:Ke(C.outer,{...x,keep:Ka(C.outer,A)}),holes:C.holes.map(T=>Ke(T,{...x,keep:Ka(T,A)}))}:C,E=l>0?En(v.outer,l,e,A):v.outer,D=v.holes.map(T=>l>0?En(T,-l,e,A):T),F=C.lift??0,H=i+F,S=a+F;Ua(f,E??v.outer,D.map((T,P)=>T??v.holes[P]),H,ja,o.maxSegment??0);let L=H,M=H-s;E&&l>0&&s>0&&_n(f,E,v.outer,L,M,nu,e,A),M!==S&&_n(f,v.outer,v.outer,M,S,Wa,e,A);for(let T of v.holes)if(M!==S&&_n(f,T,T,M,S,Wa,e,A),H<S){let P=f.indices.length;Ua(f,T,[],S,iu);for(let k=P;k<f.indices.length;k++)B.push(f.indices[k]);f.indices.length=P;}}if(!f.indices.length&&!B.length)return null;let w=f.indices.length,_=new Uint32Array(w+B.length);return _.set(f.indices,0),_.set(B,w),{vertices:u.slice(0,f.offset),indices:_.buffer,vertexCount:f.count,indexCount:_.length,extent:e,capIndexOffset:w}}function It(n,e,t,o){let r=`${Math.round(n*100)},${Math.round(e*100)}`,i=`${Math.round(t*100)},${Math.round(o*100)}`;return r<i?`${r}|${i}`:`${i}|${r}`}function Na(n,e){for(let t=0;t+3<n.length;t+=2){let o=It(n[t],n[t+1],n[t+2],n[t+3]);e.set(o,(e.get(o)??0)+1);}}function Ka(n,e){if(!e.size)return;let t=n.length/2-1,o=new Array(t).fill(false);for(let r=0;r<t;r++){let i=It(n[(r+t-1)%t*2],n[(r+t-1)%t*2+1],n[r*2],n[r*2+1]),a=It(n[r*2],n[r*2+1],n[(r+1)%t*2],n[(r+1)%t*2+1]);(e.has(i)||e.has(a))&&(o[r]=true);}return o}function uo(n,e,t,o,r,i,a,l){let s=n.offset;return n.view.setFloat32(s,e,true),n.view.setFloat32(s+4,t,true),n.view.setInt16(s+8,lu(Math.round(o*Xa)),true),n.view.setInt8(s+10,Fn(Math.round(r*127))),n.view.setInt8(s+11,Fn(Math.round(i*127))),n.view.setInt8(s+12,Fn(Math.round(a*127))),n.bytes[s+13]=l,n.view.setInt8(s+14,e<=0?-fo:e>=n.extent?fo:0),n.view.setInt8(s+15,t<=0?-fo:t>=n.extent?fo:0),n.offset+=St,n.count++}function Ua(n,e,t,o,r=ja,i=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 f=0;f<u.length;f++)a.push(u[f]);}let s=Pe(a,l.length?l:void 0,2);if(!s.length)return;let c=s;if(i>0){let u=[];cn(a,s,0,i,u),c=u;}n.ensure(a.length/2);let h=n.count;for(let u=0;u<a.length;u+=2)uo(n,a[u],a[u+1],o,0,0,1,r);for(let u=0;u<c.length;u+=3)n.indices.push(h+c[u],h+c[u+2],h+c[u+1]);}function _n(n,e,t,o,r,i,a,l){let s=Math.min(e.length,t.length)/2;if(!(s<3)){n.ensure((s-1)*4);for(let c=0;c<s-1;c++){let h=t[c*2],u=t[c*2+1],f=t[c*2+2],d=t[c*2+3];if(h===f&&u===d||ir(h,u,f,d,a,Ye(a))||l.has(It(h,u,f,d)))continue;let p=f-h,b=d-u,m=Math.hypot(p,b)||1,g=b/m,y=-p/m,A=o-r,B=Math.hypot(e[c*2]-h,e[c*2+1]-u)||0,x=0;if(B>1e-6&&A!==0){let E=1/Math.hypot(1,A/B);x=B/Math.hypot(B,A)*Math.sign(A),g*=E,y*=E;}let w=uo(n,e[c*2],e[c*2+1],o,g,y,x,i),_=uo(n,e[c*2+2],e[c*2+3],o,g,y,x,i),C=uo(n,h,u,r,g,y,x,i),v=uo(n,f,d,r,g,y,x,i);n.indices.push(C,_,v,C,w,_);}}}function En(n,e,t,o){let r=n.length/2-1;if(r<3)return null;let i=[];for(let h=0;h<r;h++){let u=n[h*2],f=n[h*2+1],d=n[(h+r-1)%r*2],p=n[(h+r-1)%r*2+1],b=n[(h+1)%r*2],m=n[(h+1)%r*2+1],g=Math.hypot(u-d,f-p)||1,y=Math.hypot(b-u,m-f)||1,A=(f-p)/g,B=-(u-d)/g,x=(m-f)/y,w=-(b-u)/y,_=A+x,C=B+w,v=Math.hypot(_,C);if(v<1e-6){i.push(u,f);continue}_/=v,C/=v;let E=Math.min(1/Math.max(_*A+C*B,.35),3),D=u-_*e*E,F=f-C*e*E,H=It(d,p,u,f),S=It(u,f,b,m);if(o.has(H)||o.has(S)){i.push(u,f);continue}let L=-Ye(t),M=t+Ye(t),T=(P,k)=>P<=L||P>=M||k<=L||k>=M;(T(u,f)||T(d,p)||T(b,m))&&(D=u,F=f),i.push(D,F);}i.push(i[0],i[1]);let a=Math.abs(Mn(n)),l=Mn(i);if(Math.sign(l)!==Math.sign(Mn(n))||Math.abs(l)<a*.25)return null;let s=-Ye(t),c=t+Ye(t);for(let h=0;h<i.length;h+=2)i[h]=Math.max(s,Math.min(c,i[h])),i[h+1]=Math.max(s,Math.min(c,i[h+1]));return i}function Mn(n){let e=0;for(let t=0;t<n.length-2;t+=2)e+=n[t]*n[t+3]-n[t+2]*n[t+1];return e/2}var Fn=n=>n>127?127:n<-127?-127:n,lu=n=>n>32767?32767:n<-32768?-32768:n;function Ja(n,e,t){if(!(e>0))return n;let o=Ye(t),r=-o,i=t+o,a=n;for(let l=0;l<3;l++){let s=a.length/2-1;if(s<6)break;let c=new Array(s).fill(true),h=s;for(let f=0;f<s&&!(h<=5);f++){let d=a[f*2],p=a[f*2+1];if(d<=r||d>=i||p<=r||p>=i)continue;let b=(f+s-1)%s;for(;!c[b]&&b!==f;)b=(b+s-1)%s;let m=(f+1)%s;for(;!c[m]&&m!==f;)m=(m+1)%s;if(b===f||m===f)break;let g=a[b*2],y=a[b*2+1],A=a[m*2]-g,B=a[m*2+1]-y,x=Math.hypot(A,B);x<1e-6||Math.abs((d-g)*B-(p-y)*A)/x<e&&(c[f]=false,h--);}if(h===s)break;let u=[];for(let f=0;f<s;f++)c[f]&&u.push(a[f*2],a[f*2+1]);u.push(u[0],u[1]),a=u;}return a}var su=100;function Sn(n){return {shapes:[],cells:[],extent:0,metersPerTile:n}}function In(n,e,t,o){if(!(t<=0)){n.extent=o;for(let r of e){let i=r.outer;if(i.length<6)continue;let a=1/0,l=1/0,s=-1/0,c=-1/0;for(let h=0;h<i.length;h+=2)i[h]<a&&(a=i[h]),i[h]>s&&(s=i[h]),i[h+1]<l&&(l=i[h+1]),i[h+1]>c&&(c=i[h+1]);n.shapes.push({outer:i,holes:r.holes,level:t,minX:a,minY:l,maxX:s,maxY:c});}n.cells=[];}}function cu(n){n.cells=Array.from({length:1024},()=>[]);let e=n.extent/32;for(let t=0;t<n.shapes.length;t++){let o=n.shapes[t],r=Lt(Math.floor(o.minX/e)),i=Lt(Math.floor(o.maxX/e)),a=Lt(Math.floor(o.minY/e)),l=Lt(Math.floor(o.maxY/e));for(let s=a;s<=l;s++)for(let c=r;c<=i;c++)n.cells[s*32+c].push(t);}}var Za=n=>n.shapes.length===0;function hr(n,e,t){!n.cells.length&&n.shapes.length&&cu(n);let o=n.extent/32,r=n.cells[Lt(Math.floor(t/o))*32+Lt(Math.floor(e/o))];if(!r||!r.length)return 0;let i=0;for(let a of r){let l=n.shapes[a];if(l.level<=i||e<l.minX||e>l.maxX||t<l.minY||t>l.maxY||!Ya(l.outer,e,t))continue;let s=false;for(let c of l.holes)if(Ya(c,e,t)){s=true;break}s||(i=l.level);}return Math.min(Math.round(i*100),127)}function Ln(n,e){let t=[],o=[],r=n.extent>0?n.metersPerTile/n.extent:0,i=r>0?2/r:0,a=hr(n,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],h=e[l+2],u=e[l+3],f=hr(n,h,u);if(f!==a&&i>0){let d=Math.hypot(h-s,u-c),p=Math.min(Math.ceil(d/i),64),b=a;for(let m=1;m<p;m++){let g=m/p,y=s+(h-s)*g,A=c+(u-c)*g,B=hr(n,y,A);B!==b&&(t.push(y,A),o.push(B),b=B);}}t.push(h,u),o.push(f),a=f;}return {pts:t,levels:o}}var Lt=n=>n<0?0:n>31?31:n;function Ya(n,e,t){let o=false,r=n.length/2;for(let i=0,a=r-1;i<r;a=i++){let l=n[i*2],s=n[i*2+1],c=n[a*2],h=n[a*2+1];s>t!=h>t&&e<(c-l)*(t-s)/(h-s)+l&&(o=!o);}return o}var fu=5;function gt(n){let e=n.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=n.brunnel;return o==="bridge"?1:o==="tunnel"?-1:0}var rt=20;function Tn(n,e,t=0,o,r=0,i={}){let{level:a}=i,l=Math.max(256,n.length*24),s=new ArrayBuffer(l*rt),c=new DataView(s),h=0,u=[],f=y=>{if(h+y<=l)return;l=Math.max(l*2,h+y);let A=new ArrayBuffer(l*rt);new Uint8Array(A).set(new Uint8Array(s,0,h*rt)),s=A,c=new DataView(A);},d=(y,A,B,x,w,_,C,v=0,E=0,D=0)=>{let F=h*rt;return c.setInt16(F,y,true),c.setInt16(F+2,A,true),c.setInt16(F+4,B,true),c.setInt16(F+6,x,true),c.setInt8(F+8,w),c.setInt8(F+9,_),c.setInt8(F+10,v),c.setInt8(F+11,E),c.setFloat32(F+12,C,true),c.setFloat32(F+16,D,true),h++},p=0,b=r>0?12/r:0,m=b>0?mu(n):null;for(let y of n.features()){if(y.type!==2&&y.type!==3||!Be(e,y.properties)||a!==void 0&>(y.properties)!==a)continue;let A=y.properties.width;p=typeof A=="number"&&A>.5&&A<100?A:0;let B=y.type===3;for(let x of y.loadGeometry()){let w=t>0?hu(Qa(x),t):Qa(x);if(w.length<4)continue;let _=o&&!Za(o)?Ln(o,w):null,C=_?_.pts:w,v=_?.levels,E=C.length/2;if(E<2)continue;let D=gt(y.properties),F=dr(Math.round(C[0]),Math.round(C[1])),H=dr(Math.round(C[E*2-2]),Math.round(C[E*2-1])),S=null,L=p;if(m&&p>0&&!B){let T=0;for(let G=0;G<E-1;G++)T+=Math.hypot(C[G*2+2]-C[G*2],C[G*2+3]-C[G*2+1]);L=$a(D,p,F,H,m);let P=G=>Math.min(m.width.get(G)??0,L*2),k=P(F)-L,O=P(H)-L,N=Math.min(b,T/2);if(N>0&&(k>0||O>0)){S=R=>{let W=0;return k>0&&R<N&&(W=k*(1-R/N)),O>0&&T-R<N&&(W=Math.max(W,O*(1-(T-R)/N))),L+W};let G=[];for(let R of [N,T-N])R>.01&&R<T-.01&&G.push(R);if(G.length){let R=uu(C,v,G);C=R.pts,v=R.levels,E=C.length/2;}}}f((E-1)*4);let M=0;for(let T=0;T<E-1;T++){let P=C[T*2],k=C[T*2+1],O=C[T*2+2],N=C[T*2+3],G=Math.hypot(O-P,N-k);if(B&&pu(P,k,O,N,n.extent)){M+=G;continue}let R=du(P,k,O,N,n.extent);if(!R){M+=G;continue}let[W,j,Z,ee]=R,ge=Math.hypot(W-P,j-k),te=Math.hypot(Z-W,ee-j),X=Math.hypot(O-Z,N-ee),re=M+ge,le=v?v[T]:0,q=v?v[T+1]:0,U=S?S(re):L,J=S?S(re+te):L,fe=d(W,j,Z,ee,0,-1,re,le,q,U),se=d(W,j,Z,ee,0,1,re,le,q,U),ue=d(W,j,Z,ee,1,1,re,le,q,J),ae=d(W,j,Z,ee,1,-1,re,le,q,J);M+=ge+te+X,u.push(fe,se,ue,fe,ue,ae);}}}if(!u.length)return null;let g=new Uint32Array(u);return {vertices:s.slice(0,h*rt),indices:g.buffer,vertexCount:h,indexCount:g.length}}function uu(n,e,t){let o=[...t].sort((s,c)=>s-c),r=[n[0],n[1]],i=e?[e[0]]:void 0,a=0,l=0;for(let s=0;s+3<n.length;s+=2){let c=n[s],h=n[s+1],u=n[s+2],f=n[s+3],d=Math.hypot(u-c,f-h);for(;l<o.length&&o[l]<=a+.01;)l++;for(;l<o.length&&o[l]<a+d-.01;){let p=(o[l]-a)/d;r.push(c+(u-c)*p,h+(f-h)*p),i&&e&&i.push(Math.round(e[s/2]+(e[s/2+1]-e[s/2])*p)),l++;}a+=d,r.push(u,f),i&&e&&i.push(e[s/2+1]);}return {pts:r,levels:i}}function hu(n,e){let t=[];for(let o=0;o+3<n.length;o+=2){let r=n[o],i=n[o+1],a=n[o+2],l=n[o+3];t.push(r,i);let s=Math.min(64,Math.floor(Math.hypot(a-r,l-i)/e));for(let c=1;c<s;c++){let h=c/s;t.push(r+(a-r)*h,i+(l-i)*h);}}return t.push(n[n.length-2],n[n.length-1]),t}function Qa(n){let e=[];for(let t=0;t<n.length;t+=2){let o=n[t],r=n[t+1],i=e.length;i>=2&&e[i-2]===o&&e[i-1]===r||e.push(o,r);}return e}function du(n,e,t,o,r){let i=t-n,a=o-e,l=0,s=1,c=[[-i,n],[i,r-n],[-a,e],[a,r-e]];for(let[h,u]of c){if(h===0){if(u<0)return null;continue}let f=u/h;if(h<0){if(f>s)return null;f>l&&(l=f);}else {if(f<l)return null;f<s&&(s=f);}}return s-l<1e-6?null:[Math.round(n+i*l),Math.round(e+a*l),Math.round(n+i*s),Math.round(e+a*s)]}function pu(n,e,t,o,r){return n===t&&(n<=0||n>=r)?true:e===o&&(e<=0||e>=r)}var qa=new WeakMap,dr=(n,e)=>(n+512)*65536+(e+512);function $a(n,e,t,o,r){if(n===0||e<=0)return e;let i=8*4294967296,a=Math.max(r.raw.get(t+i)??0,r.raw.get(o+i)??0);return a>0&&e>a?a:e}function mu(n){let e=qa.get(n);if(e)return e;let t={width:new Map,ends:new Map,raw:new Map},o=[];for(let r of n.features()){if(r.type!==2)continue;let i=r.properties.width,a=typeof i=="number"&&i>.5&&i<100?i:0,l=gt(r.properties);for(let s of r.loadGeometry()){if(s.length<4)continue;let c=dr(Math.round(s[0]),Math.round(s[1])),h=dr(Math.round(s[s.length-2]),Math.round(s[s.length-1]));for(let u of [c,h]){let f=u+(l+8)*4294967296;t.ends.set(f,(t.ends.get(f)??0)+1),a>0&&t.raw.set(f,Math.max(t.raw.get(f)??0,a));}o.push({h:c,t:h,lv:l,w:a});}}for(let r of o){let i=$a(r.lv,r.w,r.h,r.t,t);if(!(i<=0))for(let a of [r.h,r.t]){let l=t.width.get(a);(l===void 0||i>l)&&t.width.set(a,i);}}return qa.set(n,t),t}var Hn={enabled:true,skyColor:"#7fb2e5",horizonColor:"#dfe6ee",fogRange:[2.43,10.1],fogIntensity:.92,fogVerticalRange:[35,220],spaceColor:"#05070f",atmosphereColor:"#79b8f5",starIntensity:.55,horizonBlend:.14},kn={ambientColor:"#ffffff",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#fff4e2",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#dce6f2",fillIntensity:.18};var el={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 tl={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 ol={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 rl={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 nl={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 il={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 al={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 ll={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 sl={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 cl={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 fl={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 ul={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 hl={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 dl={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 pl={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 ml={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 bl={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 gl={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 yl={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 Al={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 Bl={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 Cl={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 vl={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 xl={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 wl={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 _l={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 El={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 Ml={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 Fl={"3d":ll,cartoon:sl,cyberpunk:cl,dawn:fl,dusk:ul,earth:hl,future:dl,"glass-refined":pl,glass:ml,"harmony-black":bl,"harmony-blue":gl,"harmony-green":yl,lunar:Al,matte:Bl,minimal:Cl,ocean:vl,premium:xl,realistic:wl,space:_l,volcano:El,white:Ml};function pr(n,e){let t=new Set(e.hidden??[]),o=n.layers.map(r=>{let i=e.paint?.[r.id],a={...r,paint:i?{...r.paint,...i}:{...r.paint}};return t.has(r.id)&&(a.visible=false),a});if(e.paint)for(let r of Object.keys(e.paint))n.layers.some(i=>i.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 {...n,name:e.name,background:e.background??n.background,light:{...n.light,...e.light},sky:{...n.sky,...e.sky},model3dKey:e.model3dKey??n.model3dKey,layers:o}}var Y="base",Dl="\u241F",Je=(n,e)=>n+"\u241F"+String(e);var Tt=class{constructor(e=Pn){this.splitValues={};this.spec=e,this.light={...kn,...e.light??{}},this.sky={...Hn,...e.sky??{}},this.layers=e.layers.map(t=>({...t,paint:{...t.paint}}));}get background(){return he(this.spec.background??"#eceae4")}colorAt(e,t,o=[1,0,1,1]){let i=e.paint?.color;if(i&&typeof i=="object"&&"from"in i){let l=this.layers.find(h=>h.id===i.from)?.paint?.color,s=He(l,t,o),c=1-Math.min(Math.max(i.darken??0,0),1);return [s[0]*c,s[1]*c,s[2]*c,s[3]]}return He(i,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:Je(e.id,t)}sourceLayers(){return [...new Set(this.layers.flatMap(e=>e.type==="raster"?[]:[e["source-layer"]]))]}},Pn=el,Ku=tl,Uu=ol,Ju=rl,Ht={day:{name:"\u0414\u043D\u0435\u0432\u043D\u0430\u044F"},night:nl,mono:il,pale:al,...Fl};function mr(n,e=Pn){if(typeof n!="string")return pr(e,n);if(n==="day")return e;let t=Ht[n];return t?pr(e,t):(console.warn(`[osmgl] \u043D\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043D\u0430\u044F \u0442\u0435\u043C\u0430 \xAB${n}\xBB; \u0434\u043E\u0441\u0442\u0443\u043F\u043D\u044B: ${Object.keys(Ht).join(", ")}`),e)}var ho=class{constructor(e,t){this.ctx=e;let o=e.gl;this._size=t;let r=o.createTexture(),i=o.createFramebuffer();if(!r||!i)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=i,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,i),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 Sl(n){let e=n.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 n.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),n.bindTexture(7,null),t}var po=`
|
|
10
10
|
uniform vec3 u_ambient_color;
|
|
11
11
|
uniform float u_ambient_intensity;
|
|
12
12
|
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
|
|
@@ -69,7 +69,7 @@ vec3 applyLightWithFactor(vec3 albedo, vec3 normal, float keyFactor) {
|
|
|
69
69
|
vec3 applyLight(vec3 albedo, vec3 normal) {
|
|
70
70
|
return applyLightWithFactor(albedo, normal, max(dot(normal, -u_key_dir), 0.0));
|
|
71
71
|
}
|
|
72
|
-
`,
|
|
72
|
+
`,br=`
|
|
73
73
|
// \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
|
|
74
74
|
// \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.
|
|
75
75
|
precision highp sampler2DShadow;
|
|
@@ -130,7 +130,7 @@ float shadowOcclusion(float ndotl) {
|
|
|
130
130
|
|
|
131
131
|
return (1.0 - lit * 0.25) * u_shadow_params.x;
|
|
132
132
|
}
|
|
133
|
-
`,
|
|
133
|
+
`,Rn=`
|
|
134
134
|
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
|
|
135
135
|
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)
|
|
136
136
|
|
|
@@ -239,7 +239,36 @@ vec3 applyMaterial(vec3 color, vec2 world) {
|
|
|
239
239
|
|
|
240
240
|
return mix(color, shaded, strength);
|
|
241
241
|
}
|
|
242
|
-
`,
|
|
242
|
+
`,Il=`
|
|
243
|
+
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
|
|
244
|
+
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
|
|
245
|
+
|
|
246
|
+
/**
|
|
247
|
+
* \u041D\u043E\u0440\u043C\u0430\u043B\u044C \u043F\u043E\u0441\u043B\u0435\u0434\u043D\u0435\u0439 \u0442\u043E\u0447\u043A\u0438, \u043F\u043E\u0441\u0447\u0438\u0442\u0430\u043D\u043D\u043E\u0439 globeLocal. \u041D\u0443\u0436\u043D\u0430 \u043E\u0441\u0432\u0435\u0449\u0435\u043D\u0438\u044E: \u0441\u0447\u0438\u0442\u0430\u0442\u044C \u0435\u0451 \u0432\u0442\u043E\u0440\u043E\u0439 \u0440\u0430\u0437
|
|
248
|
+
* \u0437\u043D\u0430\u0447\u0438\u043B\u043E \u0431\u044B \u043F\u043E\u0432\u0442\u043E\u0440\u0438\u0442\u044C \u0432\u0435\u0441\u044C \u043F\u0435\u0440\u0435\u0432\u043E\u0434 \u043C\u0435\u0440\u043A\u0430\u0442\u043E\u0440\u0430 \u0432 \u0441\u0444\u0435\u0440\u0443.
|
|
249
|
+
*/
|
|
250
|
+
vec3 g_globe_normal = vec3(0.0, 0.0, 1.0);
|
|
251
|
+
|
|
252
|
+
/**
|
|
253
|
+
* \u0421\u0412\u0415\u0422 \u0428\u0410\u0420\u0410. \u041F\u043B\u043E\u0441\u043A\u0438\u0439 \u0434\u0438\u0441\u043A \u043D\u0435 \u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044F \u043F\u043B\u0430\u043D\u0435\u0442\u043E\u0439, \u0441\u043A\u043E\u043B\u044C\u043A\u043E \u0435\u0433\u043E \u043D\u0438 \u043A\u0440\u0430\u0441\u044C: \u043A\u0440\u0443\u0433\u043B\u044B\u043C \u0435\u0433\u043E \u0434\u0435\u043B\u0430\u0435\u0442 \u043D\u0435
|
|
254
|
+
* \u0441\u0438\u043B\u0443\u044D\u0442, \u0430 \u0442\u043E, \u043A\u0430\u043A \u043F\u043E \u043D\u0435\u043C\u0443 \u043B\u043E\u0436\u0438\u0442\u0441\u044F \u0441\u0432\u0435\u0442.
|
|
255
|
+
*
|
|
256
|
+
* \u0414\u0432\u0435 \u0441\u043E\u0441\u0442\u0430\u0432\u043B\u044F\u044E\u0449\u0438\u0435. \u0421\u043E\u043B\u043D\u0435\u0447\u043D\u0430\u044F \u0441\u0442\u043E\u0440\u043E\u043D\u0430 \u0441\u0432\u0435\u0442\u043B\u0435\u0435 \u0442\u0435\u043D\u0435\u0432\u043E\u0439 \u2014 \u043D\u043E \u0411\u0415\u0417 \u0442\u0435\u0440\u043C\u0438\u043D\u0430\u0442\u043E\u0440\u0430: \u043A\u0430\u0440\u0442\u0430 \u043E\u0431\u044F\u0437\u0430\u043D\u0430
|
|
257
|
+
* \u0447\u0438\u0442\u0430\u0442\u044C\u0441\u044F \u0438 \u043D\u0430 \u043D\u043E\u0447\u043D\u043E\u0439 \u0441\u0442\u043E\u0440\u043E\u043D\u0435, \u043F\u043E\u044D\u0442\u043E\u043C\u0443 \u043F\u0435\u0440\u0435\u043F\u0430\u0434 \u043C\u044F\u0433\u043A\u0438\u0439 \u0438 \u043D\u0438\u043A\u043E\u0433\u0434\u0430 \u043D\u0435 \u0443\u0445\u043E\u0434\u0438\u0442 \u0432 \u0442\u0435\u043C\u043D\u043E\u0442\u0443. \u0418 \u043A\u0440\u0430\u0439
|
|
258
|
+
* \u0434\u0438\u0441\u043A\u0430 \u0442\u0435\u043C\u043D\u0435\u0435 \u0441\u0435\u0440\u0435\u0434\u0438\u043D\u044B: \u0443 \u043D\u0430\u0441\u0442\u043E\u044F\u0449\u0435\u0433\u043E \u0448\u0430\u0440\u0430 \u043B\u0443\u0447 \u0442\u0430\u043C \u0438\u0434\u0451\u0442 \u043F\u043E \u043A\u0430\u0441\u0430\u0442\u0435\u043B\u044C\u043D\u043E\u0439.
|
|
259
|
+
*
|
|
260
|
+
* \u041E\u0434\u043D\u0430 \u0444\u0443\u043D\u043A\u0446\u0438\u044F \u043D\u0430 \u0432\u0441\u0435\u0445, \u043A\u0442\u043E \u0440\u0438\u0441\u0443\u0435\u0442 \u043D\u0430 \u0441\u0444\u0435\u0440\u0435, \u2014 \u0438\u043D\u0430\u0447\u0435 \u0442\u0435\u043B\u043E \u043F\u043B\u0430\u043D\u0435\u0442\u044B \u043E\u043A\u0430\u0436\u0435\u0442\u0441\u044F \u043E\u0441\u0432\u0435\u0449\u0451\u043D\u043D\u044B\u043C, \u0430 \u043E\u043A\u0435\u0430\u043D
|
|
261
|
+
* \u043D\u0430 \u043D\u0451\u043C \u043F\u043B\u043E\u0441\u043A\u0438\u043C.
|
|
262
|
+
*/
|
|
263
|
+
float globeShade() {
|
|
264
|
+
float lit = dot(g_globe_normal, u_globe_sun);
|
|
265
|
+
float sun = mix(1.0 - u_globe_light.x, 1.0 + u_globe_light.x * 0.35, smoothstep(-0.45, 0.65, lit));
|
|
266
|
+
float limb = mix(1.0 - u_globe_light.y, 1.0, pow(clamp(g_globe_normal.z, 0.0, 1.0), 0.35));
|
|
267
|
+
return sun * limb;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
`,Gn=`
|
|
271
|
+
${Il}
|
|
243
272
|
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
|
|
244
273
|
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
|
|
245
274
|
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
|
|
@@ -259,6 +288,7 @@ vec3 globeLocal(vec2 tilePos) {
|
|
|
259
288
|
float cosLat = cos(lat);
|
|
260
289
|
vec3 unit = vec3(cosLat * sin(lng), -sin(lat), cosLat * cos(lng));
|
|
261
290
|
vec3 nl = u_globe_basis * unit;
|
|
291
|
+
g_globe_normal = nl;
|
|
262
292
|
|
|
263
293
|
// \u0422\u043E\u0447\u043A\u0443 \u0417\u0410 \u0413\u041E\u0420\u0418\u0417\u041E\u041D\u0422\u041E\u041C \u043F\u0440\u0438\u0436\u0438\u043C\u0430\u0435\u043C \u043A \u0435\u0433\u043E \u043B\u0438\u043D\u0438\u0438, \u0430 \u043D\u0435 \u0432\u044B\u0431\u0440\u0430\u0441\u044B\u0432\u0430\u0435\u043C.
|
|
264
294
|
//
|
|
@@ -292,9 +322,11 @@ vec3 globeLocal(vec2 tilePos) {
|
|
|
292
322
|
|
|
293
323
|
return mix(sphere, flat_pos, u_globe.y);
|
|
294
324
|
}
|
|
295
|
-
`,
|
|
325
|
+
`,Ll=`#version 300 es
|
|
296
326
|
precision highp float;
|
|
297
327
|
|
|
328
|
+
${Il}
|
|
329
|
+
|
|
298
330
|
in vec2 a_lnglat; // \u0440\u0430\u0434\u0438\u0430\u043D\u044B: \u0434\u043E\u043B\u0433\u043E\u0442\u0430, \u0448\u0438\u0440\u043E\u0442\u0430
|
|
299
331
|
|
|
300
332
|
uniform mat4 u_matrix; // \u043A\u0430\u043C\u0435\u0440\u0430 \u0434\u043B\u044F \u043B\u043E\u043A\u0430\u043B\u044C\u043D\u044B\u0445 \u043A\u043E\u043E\u0440\u0434\u0438\u043D\u0430\u0442
|
|
@@ -302,6 +334,7 @@ uniform mat3 u_globe_basis;
|
|
|
302
334
|
uniform vec4 u_globe; // z: \u0440\u0430\u0434\u0438\u0443\u0441
|
|
303
335
|
|
|
304
336
|
out float v_rim;
|
|
337
|
+
out float v_shade;
|
|
305
338
|
|
|
306
339
|
void main() {
|
|
307
340
|
float cosLat = cos(a_lnglat.y);
|
|
@@ -315,11 +348,16 @@ void main() {
|
|
|
315
348
|
// \u0432 \u0442\u043E\u0447\u043A\u0435 \u043F\u043E\u0434 \u043A\u0430\u043C\u0435\u0440\u043E\u0439 \u043E\u043D\u0430 \u0441\u043C\u043E\u0442\u0440\u0438\u0442 \u0432\u0432\u0435\u0440\u0445, \u0443 \u043A\u0440\u0430\u044F \u0434\u0438\u0441\u043A\u0430 \u2014 \u0432\u0431\u043E\u043A.
|
|
316
349
|
vec3 n = u_globe_basis * unit;
|
|
317
350
|
v_rim = 1.0 - clamp(n.z, 0.0, 1.0);
|
|
351
|
+
// \u0421\u0432\u0435\u0442 \u0441\u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044F \u0422\u041E\u0419 \u0416\u0415 \u0444\u0443\u043D\u043A\u0446\u0438\u0435\u0439, \u0447\u0442\u043E \u0443 \u0437\u0430\u043B\u0438\u0432\u043E\u043A \u043D\u0430 \u0441\u0444\u0435\u0440\u0435: \u0438\u043D\u0430\u0447\u0435 \u0442\u0435\u043B\u043E \u043F\u043B\u0430\u043D\u0435\u0442\u044B \u043E\u043A\u0430\u0436\u0435\u0442\u0441\u044F
|
|
352
|
+
// \u043E\u0441\u0432\u0435\u0449\u0451\u043D\u043D\u044B\u043C, \u0430 \u043E\u043A\u0435\u0430\u043D \u043D\u0430 \u043D\u0451\u043C \u043F\u043B\u043E\u0441\u043A\u0438\u043C.
|
|
353
|
+
g_globe_normal = n;
|
|
354
|
+
v_shade = globeShade();
|
|
318
355
|
}
|
|
319
|
-
`,
|
|
356
|
+
`,Tl=`#version 300 es
|
|
320
357
|
precision highp float;
|
|
321
358
|
|
|
322
359
|
in float v_rim;
|
|
360
|
+
in float v_shade;
|
|
323
361
|
uniform vec3 u_body_color;
|
|
324
362
|
uniform vec3 u_atmo_color;
|
|
325
363
|
uniform float u_atmo_strength;
|
|
@@ -330,19 +368,20 @@ void main() {
|
|
|
330
368
|
// \u041A\u0430\u0439\u043C\u0430 \u043D\u0430\u0440\u0430\u0441\u0442\u0430\u0435\u0442 \u043A\u0440\u0443\u0442\u043E: \u0432 \u0441\u0435\u0440\u0435\u0434\u0438\u043D\u0435 \u0434\u0438\u0441\u043A\u0430 \u0435\u0451 \u0431\u044B\u0442\u044C \u043D\u0435 \u0434\u043E\u043B\u0436\u043D\u043E \u0432\u043E\u0432\u0441\u0435, \u0438\u043D\u0430\u0447\u0435
|
|
331
369
|
// \u043F\u043B\u0430\u043D\u0435\u0442\u0430 \u0432\u044B\u0433\u043B\u044F\u0434\u0438\u0442 \u043F\u043E\u0434\u0441\u0432\u0435\u0447\u0435\u043D\u043D\u043E\u0439 \u0438\u0437\u043D\u0443\u0442\u0440\u0438.
|
|
332
370
|
float rim = pow(v_rim, 6.0) * u_atmo_strength;
|
|
333
|
-
|
|
371
|
+
vec3 body = u_body_color * v_shade;
|
|
372
|
+
fragColor = vec4(mix(body, u_atmo_color, clamp(rim, 0.0, 1.0)), 1.0);
|
|
334
373
|
}
|
|
335
|
-
`,
|
|
374
|
+
`,Hl=`#version 300 es
|
|
336
375
|
precision highp float;
|
|
337
376
|
in vec2 a_pos; // 0..1, \u043E\u0431\u0449\u0438\u0439 \u043A\u0432\u0430\u0434\u0440\u0430\u0442
|
|
338
377
|
uniform float u_center_depth; // NDC-\u0433\u043B\u0443\u0431\u0438\u043D\u0430 \u0446\u0435\u043D\u0442\u0440\u0430 \u0448\u0430\u0440\u0430
|
|
339
378
|
void main() {
|
|
340
379
|
gl_Position = vec4(a_pos * 2.0 - 1.0, u_center_depth, 1.0);
|
|
341
380
|
}
|
|
342
|
-
`,
|
|
381
|
+
`,kl=`#version 300 es
|
|
343
382
|
precision highp float;
|
|
344
383
|
void main() {}
|
|
345
|
-
`,
|
|
384
|
+
`,Pl=`#version 300 es
|
|
346
385
|
precision highp float;
|
|
347
386
|
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)
|
|
348
387
|
in float a_height; // \u043C\u0435\u0442\u0440\u044B \xD7 32, \u043A\u0430\u043A \u0443 \u0437\u0434\u0430\u043D\u0438\u0439 (BUILDING_HEIGHT_SCALE)
|
|
@@ -351,12 +390,41 @@ uniform float u_height_scale;
|
|
|
351
390
|
void main() {
|
|
352
391
|
gl_Position = u_matrix * vec4(a_pos / 8.0, (a_height / 32.0) * u_height_scale, 1.0);
|
|
353
392
|
}
|
|
354
|
-
`,
|
|
393
|
+
`,On=`#version 300 es
|
|
355
394
|
precision highp float;
|
|
356
395
|
void main() {}
|
|
357
|
-
`,
|
|
396
|
+
`,Rl=`
|
|
397
|
+
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
|
|
398
|
+
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
|
|
399
|
+
|
|
400
|
+
/** \u0421\u0438\u043D\u0443\u0441 \u0443\u0433\u043B\u0430 \u043F\u043E\u0434\u044A\u0451\u043C\u0430 \u043B\u0443\u0447\u0430, \u0438\u0434\u0443\u0449\u0435\u0433\u043E \u0447\u0435\u0440\u0435\u0437 \u044D\u0442\u043E\u0442 \u043F\u0438\u043A\u0441\u0435\u043B\u044C. */
|
|
401
|
+
float rayElevSin() {
|
|
402
|
+
return sin(u_cam_ray.x + atan((gl_FragCoord.y - u_cam_ray.z) / max(u_cam_ray.y, 1.0)));
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
/** \u0412\u043E\u0437\u0434\u0443\u0448\u043D\u0430\u044F \u043C\u0430\u0441\u0441\u0430 \u043F\u043E \u041A\u0430\u0441\u0442\u0435\u043D\u0443\u2013\u042F\u043D\u0433\u0443: 1 \u0432 \u0437\u0435\u043D\u0438\u0442\u0435, \u043E\u043A\u043E\u043B\u043E 38 \u0443 \u0433\u043E\u0440\u0438\u0437\u043E\u043D\u0442\u0430. */
|
|
406
|
+
float airMass(float sinE) {
|
|
407
|
+
float deg = degrees(asin(clamp(sinE, -1.0, 1.0)));
|
|
408
|
+
return 1.0 / (max(sinE, 0.0) + 0.15 * pow(max(93.885 - deg, 1.0), -1.253));
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
/** \u0414\u043E\u043B\u044F \u043C\u0433\u043B\u044B: 0 \u0432 \u0437\u0435\u043D\u0438\u0442\u0435, \u043F\u043E\u0447\u0442\u0438 1 \u0443 \u0433\u043E\u0440\u0438\u0437\u043E\u043D\u0442\u0430. */
|
|
412
|
+
float hazeMix(float sinE) {
|
|
413
|
+
return pow(clamp(1.0 - 1.0 / airMass(sinE), 0.0, 1.0), u_haze_exp);
|
|
414
|
+
}
|
|
415
|
+
`,nt=`
|
|
416
|
+
${Rl}
|
|
358
417
|
uniform vec3 u_fog_color;
|
|
359
418
|
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
|
|
419
|
+
/** \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. */
|
|
420
|
+
uniform vec2 u_fog_vertical;
|
|
421
|
+
|
|
422
|
+
/*
|
|
423
|
+
* \u0414\u042B\u041C\u041A\u0410 \u0421\u041B\u0410\u0411\u0415\u0415\u0422, \u0427\u0415\u041C \u0412\u042B\u0428\u0415 \u0421\u041C\u041E\u0422\u0420\u0418\u0422 \u041B\u0423\u0427. \u0422\u043E\u043B\u0449\u0430 \u0432\u043E\u0437\u0434\u0443\u0445\u0430 \u043D\u0430 \u043B\u0443\u0447\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043D\u0435 \u0442\u043E\u043B\u044C\u043A\u043E \u043E\u0442 \u0440\u0430\u0441\u0441\u0442\u043E\u044F\u043D\u0438\u044F:
|
|
424
|
+
* \u0432\u0434\u043E\u043B\u044C \u0437\u0435\u043C\u043B\u0438 \u0435\u0451 \u043A\u0438\u043B\u043E\u043C\u0435\u0442\u0440\u044B, \u0430 \u0432\u0432\u0435\u0440\u0445 \u2014 \u0441\u0447\u0438\u0442\u0430\u043D\u043D\u044B\u0435 \u0441\u043E\u0442\u043D\u0438 \u043C\u0435\u0442\u0440\u043E\u0432. \u0411\u0435\u0437 \u044D\u0442\u043E\u0433\u043E \u043C\u043D\u043E\u0436\u0438\u0442\u0435\u043B\u044F \u0434\u0430\u043B\u0451\u043A\u0430\u044F \u043A\u0440\u044B\u0448\u0430
|
|
425
|
+
* \u0432\u044B\u0446\u0432\u0435\u0442\u0430\u043B\u0430 \u0440\u043E\u0432\u043D\u043E \u043A\u0430\u043A \u0437\u0435\u043C\u043B\u044F \u043F\u043E\u0434 \u043D\u0435\u0439, \u0438 \u0434\u0430\u043B\u044C\u043D\u0438\u0439 \u043F\u043B\u0430\u043D \u0432\u044B\u0445\u043E\u0434\u0438\u043B \u0440\u0430\u0432\u043D\u043E\u043C\u0435\u0440\u043D\u043E\u0439 \u0437\u0430\u043B\u0438\u0432\u043A\u043E\u0439. \u041C\u043D\u043E\u0436\u0438\u0442\u0435\u043B\u044C \u2014
|
|
426
|
+
* \u0442\u0430 \u0436\u0435 \u0434\u043E\u043B\u044F \u043C\u0433\u043B\u044B, \u0447\u0442\u043E \u043A\u0440\u0430\u0441\u0438\u0442 \u043D\u0435\u0431\u043E (hazeMix), \u043F\u043E\u044D\u0442\u043E\u043C\u0443 \u0443 \u0433\u043E\u0440\u0438\u0437\u043E\u043D\u0442\u0430 \u0434\u044B\u043C\u043A\u0430 \u0438 \u043D\u0435\u0431\u043E \u043F\u0440\u0438\u0445\u043E\u0434\u044F\u0442 \u0432 \u043E\u0434\u0438\u043D \u0446\u0432\u0435\u0442.
|
|
427
|
+
*/
|
|
360
428
|
|
|
361
429
|
float fogAmount() {
|
|
362
430
|
if (u_fog_range.z <= 0.001) return 0.0;
|
|
@@ -365,7 +433,24 @@ float fogAmount() {
|
|
|
365
433
|
if (t <= 0.0) return 0.0;
|
|
366
434
|
float falloff = 1.0 - min(1.0, exp(-6.0 * t));
|
|
367
435
|
falloff *= falloff * falloff;
|
|
368
|
-
return min(falloff, 1.0) * u_fog_range.z;
|
|
436
|
+
return min(falloff, 1.0) * u_fog_range.z * hazeMix(rayElevSin());
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
/**
|
|
440
|
+
* \u0414\u044B\u043C\u043A\u0430 \u0441 \u0443\u0447\u0451\u0442\u043E\u043C \u0412\u042B\u0421\u041E\u0422\u042B \u0442\u043E\u0447\u043A\u0438 \u043D\u0430\u0434 \u0437\u0435\u043C\u043B\u0451\u0439.
|
|
441
|
+
*
|
|
442
|
+
* \u041C\u0433\u043B\u0430 \u043B\u0435\u0436\u0438\u0442 \u0441\u043B\u043E\u0435\u043C \u0443 \u0437\u0435\u043C\u043B\u0438, \u0438 \u0431\u0430\u0448\u043D\u044F \u0438\u0437 \u043D\u0435\u0451 \u0432\u044B\u0445\u043E\u0434\u0438\u0442: \u043D\u0438\u0437 \u0442\u0435\u0440\u044F\u0435\u0442\u0441\u044F, \u0432\u0435\u0440\u0445 \u043E\u0441\u0442\u0430\u0451\u0442\u0441\u044F \u0447\u0438\u0441\u0442\u044B\u043C. \u0420\u043E\u0432\u043D\u043E
|
|
443
|
+
* \u0432\u044B\u0446\u0432\u0435\u0442\u0448\u0430\u044F \u043F\u043E \u0432\u0441\u0435\u0439 \u0432\u044B\u0441\u043E\u0442\u0435 \u0431\u0430\u0448\u043D\u044F \u2014 \u043F\u0435\u0440\u0432\u043E\u0435, \u0447\u0442\u043E \u0432\u044B\u0434\u0430\u0451\u0442 \u043D\u0430\u0440\u0438\u0441\u043E\u0432\u0430\u043D\u043D\u0443\u044E \u0434\u044B\u043C\u043A\u0443.
|
|
444
|
+
*
|
|
445
|
+
* \u041F\u0440\u0435\u0434\u0435\u043B \u043D\u0435 \u0434\u0430\u0451\u0442 \u0432\u044B\u0441\u043E\u043A\u043E\u043C\u0443 \u0434\u043E\u043C\u0443 \u0432\u044B\u043F\u0440\u044B\u0433\u043D\u0443\u0442\u044C \u0438\u0437 \u041F\u041E\u041B\u041D\u041E\u0421\u0422\u042C\u042E \u0437\u0430\u0442\u044F\u043D\u0443\u0442\u043E\u0439 \u0434\u0430\u043B\u0438: \u0442\u0430\u043C \u043D\u0435\u0442 \u0443\u0436\u0435 \u043D\u0438\u0447\u0435\u0433\u043E, \u0438\u0437 \u0447\u0435\u0433\u043E
|
|
446
|
+
* \u043E\u043D \u043C\u043E\u0433 \u0431\u044B \u043F\u0440\u043E\u0441\u0442\u0443\u043F\u0438\u0442\u044C, \u0438 \u0447\u0438\u0441\u0442\u0430\u044F \u043A\u0440\u044B\u0448\u0430 \u043F\u043E\u0441\u0440\u0435\u0434\u0438 \u0431\u0435\u043B\u0438\u0437\u043D\u044B \u0447\u0438\u0442\u0430\u043B\u0430\u0441\u044C \u0431\u044B \u0432\u044B\u0440\u0435\u0437\u0430\u043D\u043D\u043E\u0439 \u043D\u0430\u043A\u043B\u0435\u0439\u043A\u043E\u0439.
|
|
447
|
+
*/
|
|
448
|
+
float fogAmountAt(float heightMeters) {
|
|
449
|
+
float f = fogAmount();
|
|
450
|
+
if (u_fog_vertical.y <= u_fog_vertical.x) return f;
|
|
451
|
+
float up = smoothstep(u_fog_vertical.x, u_fog_vertical.y, heightMeters);
|
|
452
|
+
float limit = 1.0 - smoothstep(0.9, 1.0, f);
|
|
453
|
+
return f * (1.0 - min(up, limit));
|
|
369
454
|
}
|
|
370
455
|
|
|
371
456
|
/** \u0426\u0432\u0435\u0442 \u0443\u0436\u0435 premultiplied \u2014 \u0446\u0432\u0435\u0442 \u0434\u044B\u043C\u043A\u0438 \u0434\u043E\u043C\u043D\u043E\u0436\u0430\u0435\u043C \u043D\u0430 \u0442\u0443 \u0436\u0435 \u0430\u043B\u044C\u0444\u0443. */
|
|
@@ -377,7 +462,11 @@ vec4 applyFogPremultiplied(vec4 color) {
|
|
|
377
462
|
vec3 applyFog(vec3 color) {
|
|
378
463
|
return mix(color, u_fog_color, fogAmount());
|
|
379
464
|
}
|
|
380
|
-
|
|
465
|
+
|
|
466
|
+
vec3 applyFogAt(vec3 color, float heightMeters) {
|
|
467
|
+
return mix(color, u_fog_color, fogAmountAt(heightMeters));
|
|
468
|
+
}
|
|
469
|
+
`,Gl=`#version 300 es
|
|
381
470
|
precision highp float;
|
|
382
471
|
|
|
383
472
|
in vec3 a_pos;
|
|
@@ -450,7 +539,7 @@ void main() {
|
|
|
450
539
|
// \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.
|
|
451
540
|
v_view = u_normal_matrix * (u_camera_model - a_pos);
|
|
452
541
|
}
|
|
453
|
-
`,
|
|
542
|
+
`,Ol=`#version 300 es
|
|
454
543
|
precision highp float;
|
|
455
544
|
|
|
456
545
|
in vec3 a_pos;
|
|
@@ -514,12 +603,12 @@ void main() {
|
|
|
514
603
|
v_nmodel = a_normal;
|
|
515
604
|
v_view = n * (u_camera_model - a_pos);
|
|
516
605
|
}
|
|
517
|
-
`,
|
|
606
|
+
`,zn=`#version 300 es
|
|
518
607
|
precision highp float;
|
|
519
608
|
|
|
520
|
-
${
|
|
521
|
-
${
|
|
522
|
-
${
|
|
609
|
+
${po}
|
|
610
|
+
${br}
|
|
611
|
+
${nt}
|
|
523
612
|
|
|
524
613
|
in vec3 v_normal;
|
|
525
614
|
in vec2 v_tex;
|
|
@@ -798,14 +887,14 @@ void main() {
|
|
|
798
887
|
float alpha = albedo.a * u_opacity;
|
|
799
888
|
fragColor = vec4(applyFog(color) * alpha, alpha);
|
|
800
889
|
}
|
|
801
|
-
`,
|
|
890
|
+
`,zl=`#version 300 es
|
|
802
891
|
precision highp float;
|
|
803
892
|
in vec3 a_pos;
|
|
804
893
|
uniform mat4 u_matrix;
|
|
805
894
|
void main() {
|
|
806
895
|
gl_Position = u_matrix * vec4(a_pos, 1.0);
|
|
807
896
|
}
|
|
808
|
-
`,
|
|
897
|
+
`,Vl=`#version 300 es
|
|
809
898
|
precision highp float;
|
|
810
899
|
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
|
|
811
900
|
|
|
@@ -824,7 +913,7 @@ void main() {
|
|
|
824
913
|
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);
|
|
825
914
|
gl_Position = vec4(a_pos * 2.0 - 1.0, 0.999, 1.0);
|
|
826
915
|
}
|
|
827
|
-
`,
|
|
916
|
+
`,Wl=`#version 300 es
|
|
828
917
|
precision highp float;
|
|
829
918
|
|
|
830
919
|
in vec2 v_uv;
|
|
@@ -832,7 +921,20 @@ in vec3 v_ray;
|
|
|
832
921
|
|
|
833
922
|
uniform vec3 u_sky_color;
|
|
834
923
|
uniform vec3 u_horizon_color;
|
|
835
|
-
uniform vec3
|
|
924
|
+
uniform vec3 u_high_color; // \u0432\u0435\u0440\u0445\u043D\u044F\u044F \u0430\u0442\u043C\u043E\u0441\u0444\u0435\u0440\u0430: \u0432\u044B\u0448\u0435 \u0432\u043E\u0437\u0434\u0443\u0445\u0430 \u043C\u0435\u043D\u044C\u0448\u0435 \u0438 \u0441\u0438\u043D\u044C \u0433\u043B\u0443\u0431\u0436\u0435
|
|
925
|
+
/** x: Y \u0433\u043E\u0440\u0438\u0437\u043E\u043D\u0442\u0430 (\u0441\u043D\u0438\u0437\u0443), y: \u043D\u0435 \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u0435\u0442\u0441\u044F, z: \u043F\u043E\u043B\u043E\u0441\u0430 \u0440\u0430\u0441\u0442\u0432\u043E\u0440\u0435\u043D\u0438\u044F \u041F\u041E\u0414 \u0433\u043E\u0440\u0438\u0437\u043E\u043D\u0442\u043E\u043C. */
|
|
926
|
+
uniform vec3 u_sky_params;
|
|
927
|
+
/** \u041D\u0430\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u0435 \u041D\u0410 \u0441\u043E\u043B\u043D\u0446\u0435 \u0432 \u043C\u0438\u0440\u043E\u0432\u044B\u0445 \u043E\u0441\u044F\u0445, \u0435\u0433\u043E \u0446\u0432\u0435\u0442 \u0438 \u0441\u0438\u043B\u0430 \u043F\u043E\u0434\u0441\u0432\u0435\u0442\u043A\u0438 \u0432 \u043D\u0435\u0431\u0435. */
|
|
928
|
+
uniform vec3 u_sun_dir;
|
|
929
|
+
uniform vec3 u_sun_color;
|
|
930
|
+
uniform float u_sun_glow;
|
|
931
|
+
/** \u0411\u0430\u0437\u0438\u0441 \u043A\u0430\u043C\u0435\u0440\u044B \u0432 \u043C\u0438\u0440\u043E\u0432\u044B\u0445 \u043E\u0441\u044F\u0445: \u043F\u043E \u043D\u0435\u043C\u0443 \u0438\u0437 \u043F\u0438\u043A\u0441\u0435\u043B\u044F \u043F\u043E\u043B\u0443\u0447\u0430\u0435\u0442\u0441\u044F \u043B\u0443\u0447 (\u0441\u043C. Transform.cameraRay). */
|
|
932
|
+
uniform vec3 u_cam_right;
|
|
933
|
+
uniform vec3 u_cam_up;
|
|
934
|
+
uniform vec3 u_cam_fwd;
|
|
935
|
+
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
|
|
936
|
+
|
|
937
|
+
${Rl}
|
|
836
938
|
|
|
837
939
|
// \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.
|
|
838
940
|
uniform vec3 u_space_color;
|
|
@@ -875,10 +977,53 @@ float stars(vec3 dir) {
|
|
|
875
977
|
|
|
876
978
|
void main() {
|
|
877
979
|
float above = gl_FragCoord.y - u_sky_params.x;
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
980
|
+
|
|
981
|
+
/*
|
|
982
|
+
* \u041D\u0415\u0411\u041E \u2014 \u0422\u0420\u0418 \u0417\u041E\u041D\u042B, \u0430 \u043D\u0435 \u0433\u0440\u0430\u0434\u0438\u0435\u043D\u0442 \u0438\u0437 \u0434\u0432\u0443\u0445 \u0446\u0432\u0435\u0442\u043E\u0432.
|
|
983
|
+
*
|
|
984
|
+
* \u0421\u043D\u0438\u0437\u0443 \u0432\u0432\u0435\u0440\u0445: \u043C\u0433\u043B\u0430 \u0443 \u0433\u043E\u0440\u0438\u0437\u043E\u043D\u0442\u0430 (\u0442\u043E\u0442 \u0436\u0435 \u0446\u0432\u0435\u0442, \u0432 \u043A\u043E\u0442\u043E\u0440\u044B\u0439 \u0443\u0445\u043E\u0434\u0438\u0442 \u0434\u0430\u043B\u044C\u043D\u044F\u044F \u0437\u0435\u043C\u043B\u044F), \u043D\u0430\u0434 \u043D\u0435\u0439 \u043E\u0442\u043A\u0440\u044B\u0442\u043E\u0435
|
|
985
|
+
* \u043D\u0435\u0431\u043E, \u0435\u0449\u0451 \u0432\u044B\u0448\u0435 \u2014 \u0432\u0435\u0440\u0445\u043D\u044F\u044F \u0430\u0442\u043C\u043E\u0441\u0444\u0435\u0440\u0430, \u0433\u0434\u0435 \u0432\u043E\u0437\u0434\u0443\u0445\u0430 \u043C\u0435\u043D\u044C\u0448\u0435 \u0438 \u0441\u0438\u043D\u044C \u0433\u043B\u0443\u0431\u0436\u0435. \u0414\u0432\u0443\u0445 \u0446\u0432\u0435\u0442\u043E\u0432 \u043D\u0430 \u044D\u0442\u043E \u043D\u0435
|
|
986
|
+
* \u0445\u0432\u0430\u0442\u0430\u0435\u0442: \u043F\u043E\u043B\u0443\u0447\u0430\u0435\u0442\u0441\u044F \u0440\u043E\u0432\u043D\u0430\u044F \u0437\u0430\u043B\u0438\u0432\u043A\u0430, \u043F\u043E \u043A\u043E\u0442\u043E\u0440\u043E\u0439 \u043D\u0435 \u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044F \u043D\u0438 \u0442\u043E\u043B\u0449\u0430 \u0432\u043E\u0437\u0434\u0443\u0445\u0430, \u043D\u0438 \u0432\u044B\u0441\u043E\u0442\u0430.
|
|
987
|
+
*
|
|
988
|
+
* \u041C\u0433\u043B\u0430 \u043F\u043E\u0434\u043C\u0435\u0448\u0438\u0432\u0430\u0435\u0442\u0441\u044F \u0413\u0410\u0423\u0421\u0421\u041E\u041C \u043F\u043E \u043F\u0440\u0435\u0432\u044B\u0448\u0435\u043D\u0438\u044E \u043D\u0430\u0434 \u0433\u043E\u0440\u0438\u0437\u043E\u043D\u0442\u043E\u043C \u2014 \u0442\u043E\u0439 \u0436\u0435 \u0444\u0443\u043D\u043A\u0446\u0438\u0435\u0439 \u0438 \u043E\u0442 \u0442\u043E\u0439 \u0436\u0435
|
|
989
|
+
* \u0432\u0435\u043B\u0438\u0447\u0438\u043D\u044B, \u0447\u0442\u043E \u0438 \u0434\u044B\u043C\u043A\u0430 \u043D\u0430 \u0433\u0435\u043E\u043C\u0435\u0442\u0440\u0438\u0438 (\u0441\u043C. fogHorizon \u0432 \u0431\u043B\u043E\u043A\u0435 FOG). \u0421\u043E\u0432\u043F\u0430\u0434\u0435\u043D\u0438\u0435 \u0444\u0443\u043D\u043A\u0446\u0438\u0439 \u0438 \u0434\u0435\u043B\u0430\u0435\u0442
|
|
990
|
+
* \u0441\u0442\u044B\u043A \u043D\u0435\u0432\u0438\u0434\u0438\u043C\u044B\u043C: \u0434\u0430\u043B\u044C\u043D\u0438\u0439 \u0434\u043E\u043C \u0438 \u043D\u0435\u0431\u043E \u0437\u0430 \u043D\u0438\u043C \u043F\u0440\u0438\u0445\u043E\u0434\u044F\u0442 \u0443 \u0433\u043E\u0440\u0438\u0437\u043E\u043D\u0442\u0430 \u0432 \u043E\u0434\u0438\u043D \u0446\u0432\u0435\u0442.
|
|
991
|
+
*/
|
|
992
|
+
/*
|
|
993
|
+
* \u041B\u0443\u0447 \u0447\u0435\u0440\u0435\u0437 \u044D\u0442\u043E\u0442 \u043F\u0438\u043A\u0441\u0435\u043B\u044C \u2014 \u0432 \u043C\u0438\u0440\u043E\u0432\u044B\u0445 \u043E\u0441\u044F\u0445. \u041D\u0435\u0431\u043E \u0441\u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044F \u043E\u0442 \u043D\u0435\u0433\u043E, \u0430 \u043D\u0435 \u043E\u0442 \u044D\u043A\u0440\u0430\u043D\u043D\u043E\u0439 \u0432\u044B\u0441\u043E\u0442\u044B:
|
|
994
|
+
* \u0442\u043E\u043B\u044C\u043A\u043E \u043F\u043E \u043D\u0430\u0441\u0442\u043E\u044F\u0449\u0435\u043C\u0443 \u0443\u0433\u043B\u0443 \u043F\u043E\u0434\u044A\u0451\u043C\u0430 \u043F\u043E\u043B\u0443\u0447\u0430\u0435\u0442\u0441\u044F \u043D\u0430\u0441\u0442\u043E\u044F\u0449\u0430\u044F \u0432\u043E\u0437\u0434\u0443\u0448\u043D\u0430\u044F \u043C\u0430\u0441\u0441\u0430 \u0443 \u0433\u043E\u0440\u0438\u0437\u043E\u043D\u0442\u0430.
|
|
995
|
+
*/
|
|
996
|
+
vec3 dir = normalize(u_cam_fwd * u_cam_ray.y
|
|
997
|
+
+ u_cam_right * (gl_FragCoord.x - u_cam_center.x)
|
|
998
|
+
+ u_cam_up * (gl_FragCoord.y - u_cam_center.y));
|
|
999
|
+
float sinE = dir.z;
|
|
1000
|
+
|
|
1001
|
+
/*
|
|
1002
|
+
* \u0413\u0420\u0410\u0414\u0418\u0415\u041D\u0422 \u0421\u0416\u0410\u0422 \u0412 \u0412\u0418\u0414\u0418\u041C\u0423\u042E \u041F\u041E\u041B\u041E\u0421\u0423 \u041D\u0415\u0411\u0410, \u0430 \u043D\u0435 \u0440\u0430\u0437\u043B\u043E\u0436\u0435\u043D \u043F\u043E \u043D\u0430\u0441\u0442\u043E\u044F\u0449\u0438\u043C \u0443\u0433\u043B\u0430\u043C.
|
|
1003
|
+
*
|
|
1004
|
+
* \u041D\u0430\u043A\u043B\u043E\u043D \u043A\u0430\u043C\u0435\u0440\u044B \u043E\u0433\u0440\u0430\u043D\u0438\u0447\u0435\u043D 75\xB0, \u0438 \u043D\u0430\u0434 \u0433\u043E\u0440\u0438\u0437\u043E\u043D\u0442\u043E\u043C \u0432 \u043A\u0430\u0434\u0440 \u043F\u043E\u043F\u0430\u0434\u0430\u0435\u0442 \u0432\u0441\u0435\u0433\u043E \u0442\u0440\u0438 \u0441 \u043F\u043E\u043B\u043E\u0432\u0438\u043D\u043E\u0439 \u0433\u0440\u0430\u0434\u0443\u0441\u0430.
|
|
1005
|
+
* \u0412 \u043D\u0430\u0441\u0442\u043E\u044F\u0449\u0435\u0439 \u0430\u0442\u043C\u043E\u0441\u0444\u0435\u0440\u0435 \u044D\u0442\u0438 \u0433\u0440\u0430\u0434\u0443\u0441\u044B \u0446\u0435\u043B\u0438\u043A\u043E\u043C \u0437\u0430\u043D\u044F\u0442\u044B \u043C\u0433\u043B\u043E\u0439 \u2014 \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043A\u0438 \u0432\u0435\u0440\u043D\u0430\u044F \u043A\u0440\u0438\u0432\u0430\u044F \u043E\u0441\u0442\u0430\u0432\u0438\u043B\u0430 \u0431\u044B
|
|
1006
|
+
* \u043E\u0442 \u0441\u0438\u043D\u0435\u0432\u044B \u043E\u0434\u043D\u0443 \u0431\u0435\u043B\u0451\u0441\u0443\u044E \u043F\u043E\u043B\u043E\u0441\u0443. \u041F\u043E\u044D\u0442\u043E\u043C\u0443 \u0432\u0441\u044F \u0430\u0442\u043C\u043E\u0441\u0444\u0435\u0440\u0430 \u0443\u043A\u043B\u0430\u0434\u044B\u0432\u0430\u0435\u0442\u0441\u044F \u0432 \u0442\u0443 \u043F\u043E\u043B\u043E\u0441\u0443, \u043A\u043E\u0442\u043E\u0440\u0430\u044F \u0432\u0438\u0434\u043D\u0430:
|
|
1007
|
+
* \u043C\u0433\u043B\u0430 \u0432\u043D\u0438\u0437\u0443, \u043E\u0442\u043A\u0440\u044B\u0442\u043E\u0435 \u043D\u0435\u0431\u043E \u0432\u044B\u0448\u0435, \u0432\u0435\u0440\u0445\u043D\u044F\u044F \u0430\u0442\u043C\u043E\u0441\u0444\u0435\u0440\u0430 \u0443 \u043A\u0440\u043E\u043C\u043A\u0438.
|
|
1008
|
+
*
|
|
1009
|
+
* \u041D\u0430 \u0433\u0435\u043E\u043C\u0435\u0442\u0440\u0438\u0438 \u0442\u0430\u043A\u043E\u0439 \u043F\u043E\u0434\u043C\u0435\u043D\u044B \u043D\u0435\u0442: \u0442\u0430\u043C \u0434\u044B\u043C\u043A\u0430 \u0441\u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044F \u043E\u0442 \u043D\u0430\u0441\u0442\u043E\u044F\u0449\u0435\u0433\u043E \u0443\u0433\u043B\u0430 \u043B\u0443\u0447\u0430 (\u0441\u043C. hazeMix), \u0438
|
|
1010
|
+
* \u0443 \u0433\u043E\u0440\u0438\u0437\u043E\u043D\u0442\u0430 \u043E\u0431\u0435 \u0441\u0442\u043E\u0440\u043E\u043D\u044B \u0432\u0441\u0451 \u0440\u0430\u0432\u043D\u043E \u0441\u0445\u043E\u0434\u044F\u0442\u0441\u044F \u0432 \u0446\u0432\u0435\u0442\u0435 \u043C\u0433\u043B\u044B.
|
|
1011
|
+
*/
|
|
1012
|
+
float up = max(0.0, above) / max(u_sky_params.y, 1.0);
|
|
1013
|
+
vec3 sky = mix(u_sky_color, u_high_color, clamp(up * 0.8, 0.0, 1.0));
|
|
1014
|
+
|
|
1015
|
+
/*
|
|
1016
|
+
* \u041F\u043E\u0434\u0441\u0432\u0435\u0442\u043A\u0430 \u0432\u043E\u043A\u0440\u0443\u0433 \u0441\u043E\u043B\u043D\u0446\u0430 \u2014 \u0440\u0430\u0441\u0441\u0435\u044F\u043D\u0438\u0435 \u0432\u043F\u0435\u0440\u0451\u0434 (\u041C\u0438). \u0418\u043C\u0435\u043D\u043D\u043E \u043E\u043D\u0430 \u043E\u0442\u043B\u0438\u0447\u0430\u0435\u0442 \u043D\u0430\u0440\u0438\u0441\u043E\u0432\u0430\u043D\u043D\u044B\u0439 \u0433\u0440\u0430\u0434\u0438\u0435\u043D\u0442 \u043E\u0442
|
|
1017
|
+
* \u043D\u0435\u0431\u0430: \u0443 \u0433\u043E\u0440\u0438\u0437\u043E\u043D\u0442\u0430 \u0441\u043E \u0441\u0442\u043E\u0440\u043E\u043D\u044B \u0441\u043E\u043B\u043D\u0446\u0430 \u0432\u043E\u0437\u0434\u0443\u0445 \u0441\u0432\u0435\u0442\u0438\u0442\u0441\u044F, \u0441 \u043F\u0440\u043E\u0442\u0438\u0432\u043E\u043F\u043E\u043B\u043E\u0436\u043D\u043E\u0439 \u043E\u0441\u0442\u0430\u0451\u0442\u0441\u044F \u0445\u043E\u043B\u043E\u0434\u043D\u044B\u043C.
|
|
1018
|
+
* \u0424\u0430\u0437\u0430 \u0425\u0435\u043D\u044C\u0438\u2013\u0413\u0440\u0438\u043D\u0448\u0442\u0435\u0439\u043D\u0430, \u0442\u0430 \u0436\u0435, \u0447\u0442\u043E \u0432 \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043A\u0438\u0445 \u043C\u043E\u0434\u0435\u043B\u044F\u0445, \u0442\u043E\u043B\u044C\u043A\u043E \u043E\u0434\u0438\u043D \u0447\u043B\u0435\u043D \u0432\u043C\u0435\u0441\u0442\u043E \u0438\u043D\u0442\u0435\u0433\u0440\u0430\u043B\u0430.
|
|
1019
|
+
*/
|
|
1020
|
+
float cosT = clamp(dot(dir, u_sun_dir), -1.0, 1.0);
|
|
1021
|
+
float g = 0.76;
|
|
1022
|
+
float phase = (1.0 - g * g) / pow(1.0 + g * g - 2.0 * g * cosT, 1.5);
|
|
1023
|
+
sky += u_sun_color * (u_sun_glow * phase * 0.06);
|
|
1024
|
+
|
|
1025
|
+
// \u041C\u0433\u043B\u0430 \u0443 \u0433\u043E\u0440\u0438\u0437\u043E\u043D\u0442\u0430: \u0441\u043F\u0430\u0434 \u0431\u044B\u0441\u0442\u0440\u044B\u0439, \u0438\u043D\u0430\u0447\u0435 \u043E\u043D\u0430 \u0441\u044A\u0435\u0434\u0430\u0435\u0442 \u0432\u0441\u044E \u0432\u0438\u0434\u0438\u043C\u0443\u044E \u043F\u043E\u043B\u043E\u0441\u0443.
|
|
1026
|
+
sky = mix(sky, u_horizon_color, exp(-4.0 * up));
|
|
882
1027
|
|
|
883
1028
|
// \u041D\u0418\u0416\u0415 \u0413\u041E\u0420\u0418\u0417\u041E\u041D\u0422\u0410 \u041D\u0415\u0411\u041E \u0420\u0410\u0421\u0422\u0412\u041E\u0420\u042F\u0415\u0422\u0421\u042F, \u0430 \u043D\u0435 \u0437\u0430\u043B\u0438\u0432\u0430\u0435\u0442 \u0432\u0441\u0451 \u0434\u044B\u043C\u043A\u043E\u0439.
|
|
884
1029
|
//
|
|
@@ -913,7 +1058,7 @@ void main() {
|
|
|
913
1058
|
|
|
914
1059
|
fragColor = vec4(sky * alpha, alpha);
|
|
915
1060
|
}
|
|
916
|
-
`,
|
|
1061
|
+
`,Nl=`#version 300 es
|
|
917
1062
|
precision highp float;
|
|
918
1063
|
|
|
919
1064
|
in vec2 a_pos; // \u0443\u0433\u043E\u043B \u043A\u0432\u0430\u0434\u0440\u0430\u0442\u0430 \u0442\u0430\u0439\u043B\u0430, 0..1
|
|
@@ -931,10 +1076,10 @@ void main() {
|
|
|
931
1076
|
v_uv = u_uv_transform.xy + a_pos * u_uv_transform.z;
|
|
932
1077
|
gl_Position = u_matrix * vec4(a_pos, 0.0, 1.0);
|
|
933
1078
|
}
|
|
934
|
-
`,
|
|
1079
|
+
`,Kl=`#version 300 es
|
|
935
1080
|
precision highp float;
|
|
936
1081
|
|
|
937
|
-
${
|
|
1082
|
+
${nt}
|
|
938
1083
|
|
|
939
1084
|
in vec2 v_uv;
|
|
940
1085
|
|
|
@@ -949,7 +1094,7 @@ void main() {
|
|
|
949
1094
|
// \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.
|
|
950
1095
|
fragColor = applyFogPremultiplied(vec4(color.rgb * color.a, color.a)) * u_opacity;
|
|
951
1096
|
}
|
|
952
|
-
`,
|
|
1097
|
+
`,Ul=`#version 300 es
|
|
953
1098
|
precision highp float;
|
|
954
1099
|
in vec2 a_pos; // \u0443\u0433\u043E\u043B \u043A\u0432\u0430\u0434\u0440\u0430\u0442\u0430 \u0442\u0430\u0439\u043B\u0430, 0..1
|
|
955
1100
|
uniform mat4 u_matrix;
|
|
@@ -960,11 +1105,11 @@ void main() {
|
|
|
960
1105
|
gl_Position = u_matrix * local;
|
|
961
1106
|
v_shadow = u_shadow_matrix * local;
|
|
962
1107
|
}
|
|
963
|
-
`,
|
|
1108
|
+
`,Jl=`#version 300 es
|
|
964
1109
|
precision highp float;
|
|
965
1110
|
|
|
966
|
-
${
|
|
967
|
-
${
|
|
1111
|
+
${br}
|
|
1112
|
+
${nt}
|
|
968
1113
|
|
|
969
1114
|
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
|
|
970
1115
|
uniform float u_ground_ndotl; // \u0441\u0438\u043D\u0443\u0441 \u0432\u044B\u0441\u043E\u0442\u044B \u0441\u043E\u043B\u043D\u0446\u0430: \u0437\u0435\u043C\u043B\u044F \u0433\u043E\u0440\u0438\u0437\u043E\u043D\u0442\u0430\u043B\u044C\u043D\u0430
|
|
@@ -976,10 +1121,10 @@ void main() {
|
|
|
976
1121
|
float occlusion = shadowOcclusion(u_ground_ndotl) * (1.0 - fogAmount());
|
|
977
1122
|
fragColor = vec4(mix(vec3(1.0), u_shadow_ground, occlusion), 1.0);
|
|
978
1123
|
}
|
|
979
|
-
`,
|
|
1124
|
+
`,Xl=`#version 300 es
|
|
980
1125
|
precision highp float;
|
|
981
1126
|
|
|
982
|
-
${
|
|
1127
|
+
${Gn}
|
|
983
1128
|
|
|
984
1129
|
in vec2 a_pos;
|
|
985
1130
|
uniform mat4 u_matrix;
|
|
@@ -988,27 +1133,34 @@ uniform float u_meters_per_unit; // \u0435\u0434\u0438\u043D\u0438\u0446\u0430
|
|
|
988
1133
|
uniform vec2 u_world_origin;
|
|
989
1134
|
|
|
990
1135
|
out vec2 v_world;
|
|
1136
|
+
/** \u0421\u0432\u0435\u0442 \u0448\u0430\u0440\u0430: \u043D\u0430 \u043F\u043B\u043E\u0441\u043A\u043E\u0439 \u043A\u0430\u0440\u0442\u0435 \u0435\u0434\u0438\u043D\u0438\u0446\u0430, \u043D\u0430 \u0441\u0444\u0435\u0440\u0435 \u2014 \u0441\u043E\u043B\u043D\u0446\u0435 \u0438 \u043A\u0440\u0430\u0439 \u0434\u0438\u0441\u043A\u0430 (\u0441\u043C. globeShade). */
|
|
1137
|
+
out float v_globe_shade;
|
|
991
1138
|
|
|
992
1139
|
void main() {
|
|
993
1140
|
// \u041D\u0430 \u0433\u043B\u043E\u0431\u0443\u0441\u0435 u_matrix \u2014 \u043A\u0430\u043C\u0435\u0440\u0430 \u0434\u043B\u044F \u041B\u041E\u041A\u0410\u041B\u042C\u041D\u042B\u0425 \u043A\u043E\u043E\u0440\u0434\u0438\u043D\u0430\u0442, \u043D\u0430 \u043F\u043B\u043E\u0441\u043A\u043E\u0439 \u043A\u0430\u0440\u0442\u0435 \u2014
|
|
994
1141
|
// \u043F\u0440\u0438\u0432\u044B\u0447\u043D\u0430\u044F \u043C\u0430\u0442\u0440\u0438\u0446\u0430 \u0442\u0430\u0439\u043B\u0430. \u0420\u0430\u0437\u0432\u0438\u043B\u043A\u0430 \u043E\u0434\u043D\u0430 \u043D\u0430 \u0432\u0435\u0441\u044C \u0434\u0432\u0438\u0436\u043E\u043A.
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
1142
|
+
v_globe_shade = 1.0;
|
|
1143
|
+
if (u_globe.x > 0.5) {
|
|
1144
|
+
gl_Position = u_matrix * vec4(globeLocal(a_pos), 1.0);
|
|
1145
|
+
v_globe_shade = globeShade();
|
|
1146
|
+
} else {
|
|
1147
|
+
gl_Position = u_matrix * vec4(a_pos, 0.0, 1.0);
|
|
1148
|
+
}
|
|
998
1149
|
|
|
999
1150
|
// \u041D\u0430\u0447\u0430\u043B\u043E \u0442\u0430\u0439\u043B\u0430 \u041E\u0411\u042F\u0417\u0410\u0422\u0415\u041B\u042C\u041D\u041E: \u0431\u0435\u0437 \u043D\u0435\u0433\u043E \u0440\u0438\u0441\u0443\u043D\u043E\u043A \u043C\u0430\u0442\u0435\u0440\u0438\u0430\u043B\u0430 \u043D\u0430\u0447\u0438\u043D\u0430\u0435\u0442\u0441\u044F \u0437\u0430\u043D\u043E\u0432\u043E \u043D\u0430
|
|
1000
1151
|
// \u043A\u0430\u0436\u0434\u043E\u0439 \u0433\u0440\u0430\u043D\u0438\u0446\u0435, \u0438 \u043F\u043E \u0448\u0432\u0430\u043C \u0438\u0434\u0443\u0442 \u043F\u043E\u043B\u043E\u0441\u044B. \u042E\u043D\u0438\u0444\u043E\u0440\u043C \u043E\u0431\u044A\u044F\u0432\u043B\u0435\u043D \u0431\u044B\u043B, \u0430 \u0432 \u043A\u043E\u043E\u0440\u0434\u0438\u043D\u0430\u0442\u0443
|
|
1001
1152
|
// \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.
|
|
1002
1153
|
v_world = u_world_origin + a_pos * u_meters_per_unit;
|
|
1003
1154
|
}
|
|
1004
|
-
`,
|
|
1155
|
+
`,jl=`#version 300 es
|
|
1005
1156
|
precision highp float;
|
|
1006
1157
|
|
|
1007
|
-
${
|
|
1008
|
-
${
|
|
1009
|
-
${
|
|
1158
|
+
${nt}
|
|
1159
|
+
${po}
|
|
1160
|
+
${Rn}
|
|
1010
1161
|
|
|
1011
1162
|
in vec2 v_world;
|
|
1163
|
+
in float v_globe_shade;
|
|
1012
1164
|
|
|
1013
1165
|
uniform vec4 u_color;
|
|
1014
1166
|
out vec4 fragColor;
|
|
@@ -1021,12 +1173,14 @@ void main() {
|
|
|
1021
1173
|
// \u043F\u0440\u0435\u0436\u043D\u0435\u0439, \u0438\u043D\u0430\u0447\u0435 premultiplied-\u0431\u043B\u0435\u043D\u0434\u0438\u043D\u0433 \u0440\u0430\u0437\u043E\u0448\u0451\u043B\u0441\u044F \u0431\u044B \u0441 \u043D\u0435\u0439.
|
|
1022
1174
|
vec4 c = u_color;
|
|
1023
1175
|
if (u_material != 0) c.rgb = applyMaterial(c.rgb, v_world);
|
|
1176
|
+
// \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.
|
|
1177
|
+
c.rgb *= v_globe_shade;
|
|
1024
1178
|
fragColor = applyFogPremultiplied(c);
|
|
1025
1179
|
}
|
|
1026
|
-
`,
|
|
1180
|
+
`,Yl=`#version 300 es
|
|
1027
1181
|
precision highp float;
|
|
1028
1182
|
|
|
1029
|
-
${
|
|
1183
|
+
${Gn}
|
|
1030
1184
|
|
|
1031
1185
|
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)
|
|
1032
1186
|
in vec2 a_p1; // \u043A\u043E\u043D\u0435\u0446 \u043E\u0442\u0440\u0435\u0437\u043A\u0430
|
|
@@ -1144,12 +1298,12 @@ void main() {
|
|
|
1144
1298
|
v_dist0 = a_dist * u_tile_to_px;
|
|
1145
1299
|
v_seg_len = len * u_tile_to_px;
|
|
1146
1300
|
}
|
|
1147
|
-
`,
|
|
1301
|
+
`,Zl=`#version 300 es
|
|
1148
1302
|
precision highp float;
|
|
1149
1303
|
|
|
1150
|
-
${
|
|
1151
|
-
${
|
|
1152
|
-
${
|
|
1304
|
+
${nt}
|
|
1305
|
+
${po}
|
|
1306
|
+
${Rn}
|
|
1153
1307
|
|
|
1154
1308
|
in vec2 v_pos;
|
|
1155
1309
|
in vec2 v_p0;
|
|
@@ -1412,7 +1566,7 @@ void main() {
|
|
|
1412
1566
|
if (alpha <= 0.003) discard;
|
|
1413
1567
|
fragColor = applyFogPremultiplied(color) * alpha;
|
|
1414
1568
|
}
|
|
1415
|
-
`,
|
|
1569
|
+
`,Ql=`#version 300 es
|
|
1416
1570
|
precision highp float;
|
|
1417
1571
|
|
|
1418
1572
|
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
|
|
@@ -1446,10 +1600,10 @@ void main() {
|
|
|
1446
1600
|
v_half = u_half_width;
|
|
1447
1601
|
v_dist = a_dist * u_units_to_px;
|
|
1448
1602
|
}
|
|
1449
|
-
`,
|
|
1603
|
+
`,ql=`#version 300 es
|
|
1450
1604
|
precision highp float;
|
|
1451
1605
|
|
|
1452
|
-
${
|
|
1606
|
+
${nt}
|
|
1453
1607
|
|
|
1454
1608
|
in float v_side;
|
|
1455
1609
|
in float v_outset;
|
|
@@ -1495,7 +1649,7 @@ void main() {
|
|
|
1495
1649
|
if (alpha <= 0.003) discard;
|
|
1496
1650
|
fragColor = applyFogPremultiplied(color) * alpha;
|
|
1497
1651
|
}
|
|
1498
|
-
|
|
1652
|
+
`,$l=`#version 300 es
|
|
1499
1653
|
precision highp float;
|
|
1500
1654
|
|
|
1501
1655
|
in vec2 a_pos;
|
|
@@ -1511,6 +1665,11 @@ uniform float u_height_scale; // 0..1 \u2014 \u0430\u043D\u0438\u043C\u0430\u0
|
|
|
1511
1665
|
uniform mat4 u_shadow_matrix;
|
|
1512
1666
|
uniform float u_meters_per_unit;
|
|
1513
1667
|
uniform vec2 u_world_origin; // \u043D\u0430\u0447\u0430\u043B\u043E \u0442\u0430\u0439\u043B\u0430 \u0432 \u043C\u0435\u0442\u0440\u0430\u0445 \u2014 \u0440\u0438\u0441\u0443\u043D\u043E\u043A \u0441\u043A\u0432\u043E\u0437\u043D\u043E\u0439
|
|
1668
|
+
/**
|
|
1669
|
+
* \u041A\u0430\u043C\u0435\u0440\u0430 \u0432 \u043C\u0435\u0442\u0440\u0430\u0445 \u041E\u0422 \u041D\u0410\u0427\u0410\u041B\u0410 \u042D\u0422\u041E\u0413\u041E \u0422\u0410\u0419\u041B\u0410. \u041D\u0435 \u043E\u0442 \u043C\u0438\u0440\u043E\u0432\u043E\u0433\u043E \u043D\u0443\u043B\u044F: \u043C\u0438\u0440\u043E\u0432\u044B\u0435 \u043C\u0435\u0442\u0440\u044B \u0437\u0430\u0432\u043E\u0440\u0430\u0447\u0438\u0432\u0430\u044E\u0442\u0441\u044F
|
|
1670
|
+
* \u043A\u0430\u0436\u0434\u044B\u0435 65 \u043A\u043C, \u0438 \u0440\u0430\u0437\u043D\u043E\u0441\u0442\u044C \u043A\u0430\u043C\u0435\u0440\u044B \u0441 \u0442\u043E\u0447\u043A\u043E\u0439 \u043D\u0430 \u0434\u0440\u0443\u0433\u043E\u0439 \u0441\u0442\u043E\u0440\u043E\u043D\u0435 \u0432\u0438\u0442\u043A\u0430 \u0443\u0448\u043B\u0430 \u0431\u044B \u0432 \u043C\u0443\u0441\u043E\u0440.
|
|
1671
|
+
*/
|
|
1672
|
+
uniform vec3 u_camera_local;
|
|
1514
1673
|
|
|
1515
1674
|
out vec3 v_normal;
|
|
1516
1675
|
out float v_ao;
|
|
@@ -1531,6 +1690,8 @@ out vec2 v_world;
|
|
|
1531
1690
|
out float v_up;
|
|
1532
1691
|
/** \u0413\u0440\u0430\u043D\u044C \u0432 \u043C\u0435\u0442\u0440\u0430\u0445: \u0441\u043C\u0435\u0449\u0435\u043D\u0438\u0435 \u0432\u0434\u043E\u043B\u044C \u043D\u0435\u0451, \u0435\u0451 \u0448\u0438\u0440\u0438\u043D\u0430 \u0438 \u0432\u044B\u0441\u043E\u0442\u0430. */
|
|
1533
1692
|
out vec3 v_wall;
|
|
1693
|
+
/** \u041E\u0442 \u0442\u043E\u0447\u043A\u0438 \u043A \u043A\u0430\u043C\u0435\u0440\u0435, \u0432 \u043C\u0435\u0442\u0440\u0430\u0445. \u041D\u0443\u0436\u0435\u043D \u043E\u0442\u043A\u043E\u0441\u0430\u043C \u043E\u043A\u043E\u043D: \u043F\u043E \u043D\u0435\u043C\u0443 \u0441\u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044F \u043F\u0430\u0440\u0430\u043B\u043B\u0430\u043A\u0441. */
|
|
1694
|
+
out vec3 v_view;
|
|
1534
1695
|
|
|
1535
1696
|
void main() {
|
|
1536
1697
|
// \u041F\u043E\u043B\u043E\u0436\u0435\u043D\u0438\u0435 \u043F\u0440\u0438\u0445\u043E\u0434\u0438\u0442 \u0432 \u0435\u0434\u0438\u043D\u0438\u0446\u0430\u0445 \u0442\u0430\u0439\u043B\u0430 \xD7 8 (BUILDING_POS_SCALE): \u0446\u0435\u043B\u044B\u0445 \u0435\u0434\u0438\u043D\u0438\u0446 \u043D\u0435 \u0445\u0432\u0430\u0442\u0430\u043B\u043E
|
|
@@ -1550,13 +1711,18 @@ void main() {
|
|
|
1550
1711
|
// \u041C\u0435\u0442\u0440\u044B \u0438\u0437 Uint16: \u043C\u043D\u043E\u0436\u0438\u0442\u0435\u043B\u044C \u0442\u043E\u0442 \u0436\u0435, \u0447\u0442\u043E \u0443 \u0433\u0435\u043D\u0435\u0440\u0430\u0442\u043E\u0440\u0430 (BUILDING_HEIGHT_SCALE) \u2014 32 \u0435\u0434\u0438\u043D\u0438\u0446\u044B
|
|
1551
1712
|
// \u043D\u0430 \u043C\u0435\u0442\u0440, \u0442\u043E \u0435\u0441\u0442\u044C 3 \u0441\u043C. \u0422\u043E\u0447\u043D\u043E\u0441\u0442\u044C \u0437\u0434\u0435\u0441\u044C \u0432\u0430\u0436\u043D\u0430: \u0438\u0437 \u044D\u0442\u043E\u0439 \u043A\u043E\u043E\u0440\u0434\u0438\u043D\u0430\u0442\u044B \u0440\u0430\u0441\u043A\u043B\u0430\u0434\u044B\u0432\u0430\u044E\u0442\u0441\u044F \u043E\u043A\u043D\u0430.
|
|
1552
1713
|
v_wall = a_wall / 32.0;
|
|
1714
|
+
v_view = u_camera_local - vec3(pos * u_meters_per_unit, h);
|
|
1553
1715
|
}
|
|
1554
|
-
`,
|
|
1716
|
+
`,Xu=`
|
|
1555
1717
|
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
|
|
1556
1718
|
uniform vec3 u_window_color;
|
|
1557
1719
|
uniform vec3 u_window_frame;
|
|
1558
1720
|
uniform float u_window_glow; // \u0434\u043E\u043B\u044F \u0441\u0432\u0435\u0442\u044F\u0449\u0438\u0445\u0441\u044F \u043E\u043A\u043E\u043D (\u043D\u043E\u0447\u043D\u044B\u0435 \u0442\u0435\u043C\u044B)
|
|
1559
1721
|
uniform float u_floor_height; // \u043C\u0435\u0442\u0440\u044B, \u0431\u0430\u0437\u043E\u0432\u0430\u044F \u0432\u044B\u0441\u043E\u0442\u0430 \u044D\u0442\u0430\u0436\u0430
|
|
1722
|
+
uniform float u_window_recess; // \u043D\u0430 \u0441\u043A\u043E\u043B\u044C\u043A\u043E \u043C\u0435\u0442\u0440\u043E\u0432 \u0441\u0442\u0435\u043A\u043B\u043E \u0443\u0442\u043E\u043F\u043B\u0435\u043D\u043E \u043E\u0442 \u043F\u043B\u043E\u0441\u043A\u043E\u0441\u0442\u0438 \u0441\u0442\u0435\u043D\u044B
|
|
1723
|
+
uniform float u_window_recess_shade; // \u043D\u0430\u0441\u043A\u043E\u043B\u044C\u043A\u043E \u0442\u0451\u043C\u043D\u043E\u0439 \u0432\u044B\u0445\u043E\u0434\u0438\u0442 \u0442\u0435\u043D\u044C \u043E\u0442\u043A\u043E\u0441\u0430, 0..1
|
|
1724
|
+
uniform float u_plinth_height; // \u043C\u0435\u0442\u0440\u044B, \u043D\u0430 \u043A\u043E\u0442\u043E\u0440\u044B\u0445 \u0446\u043E\u043A\u043E\u043B\u044C\u043D\u043E\u0435 \u0437\u0430\u0442\u0435\u043C\u043D\u0435\u043D\u0438\u0435 \u0441\u0445\u043E\u0434\u0438\u0442 \u043D\u0430 \u043D\u0435\u0442
|
|
1725
|
+
uniform float u_plinth_shade; // \u0441\u0438\u043B\u0430 \u0437\u0430\u0442\u0435\u043C\u043D\u0435\u043D\u0438\u044F \u0443 \u0441\u0430\u043C\u043E\u0439 \u0437\u0435\u043C\u043B\u0438, 0..1
|
|
1560
1726
|
uniform float u_roof_variation; // \u0440\u0430\u0437\u0431\u0440\u043E\u0441 \u0446\u0432\u0435\u0442\u0430 \u0441\u043A\u0430\u0442\u043D\u044B\u0445 \u043A\u0440\u043E\u0432\u0435\u043B\u044C
|
|
1561
1727
|
|
|
1562
1728
|
float hashNoise(vec2 p) {
|
|
@@ -1577,7 +1743,7 @@ float band(float v, float half_, float aa) {
|
|
|
1577
1743
|
* \u0441\u0435\u0442\u043A\u043E\u0439, \u043E\u0444\u0438\u0441 \u2014 \u0433\u043E\u0440\u0438\u0437\u043E\u043D\u0442\u0430\u043B\u044C\u043D\u044B\u043C\u0438 \u043B\u0435\u043D\u0442\u0430\u043C\u0438 \u043E\u0441\u0442\u0435\u043A\u043B\u0435\u043D\u0438\u044F, \u0446\u0435\u0445 \u2014 \u043A\u0440\u0443\u043F\u043D\u044B\u043C\u0438 \u043F\u0430\u043D\u0435\u043B\u044F\u043C\u0438
|
|
1578
1744
|
* \u0441 \u0440\u0435\u0434\u043A\u0438\u043C\u0438 \u043E\u043A\u043D\u0430\u043C\u0438 \u043F\u043E\u0432\u0435\u0440\u0445\u0443. \u0418\u043C\u0435\u043D\u043D\u043E \u044D\u0442\u043E \u0438 \u043E\u0442\u043B\u0438\u0447\u0430\u0435\u0442 \u0437\u0430\u0441\u0442\u0440\u043E\u0439\u043A\u0443 \u043D\u0430 \u0433\u043B\u0430\u0437.
|
|
1579
1745
|
*/
|
|
1580
|
-
vec4 facadePattern(vec3 base, vec3 wall, float y, int cls, float seed, float aa, out float glow) {
|
|
1746
|
+
vec4 facadePattern(vec3 base, vec3 wall, float y, int cls, float seed, float aa, vec2 sunOff, vec2 par, out float glow) {
|
|
1581
1747
|
float floorH = u_floor_height;
|
|
1582
1748
|
float stepX = 2.7;
|
|
1583
1749
|
float winW = 1.5;
|
|
@@ -1637,24 +1803,41 @@ vec4 facadePattern(vec3 base, vec3 wall, float y, int cls, float seed, float aa,
|
|
|
1637
1803
|
*/
|
|
1638
1804
|
float fine = 1.0 - smoothstep(0.05, 0.14, aa);
|
|
1639
1805
|
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1806
|
+
/*
|
|
1807
|
+
* \u0413\u041B\u0423\u0411\u0418\u041D\u0410 \u041E\u041A\u041D\u0410. \u041C\u0430\u0441\u043A\u0430 win \u2014 \u043E\u0442\u0432\u0435\u0440\u0441\u0442\u0438\u0435 \u0432 \u043F\u043B\u043E\u0441\u043A\u043E\u0441\u0442\u0438 \u0441\u0442\u0435\u043D\u044B, \u0442\u043E\u0447\u043A\u0430 deep \u2014 \u0442\u0430\u043C, \u0433\u0434\u0435 \u043B\u0443\u0447 \u0432\u0437\u0433\u043B\u044F\u0434\u0430,
|
|
1808
|
+
* \u0432\u043E\u0439\u0434\u044F \u0432 \u044D\u0442\u043E \u043E\u0442\u0432\u0435\u0440\u0441\u0442\u0438\u0435, \u0434\u043E\u0445\u043E\u0434\u0438\u0442 \u0434\u043E \u0441\u0442\u0435\u043A\u043B\u0430. \u0421\u0442\u0435\u043A\u043B\u043E \u0432\u0438\u0434\u043D\u043E \u0442\u043E\u043B\u044C\u043A\u043E \u0442\u0430\u043C, \u0433\u0434\u0435 \u043E\u0431\u0435 \u0442\u043E\u0447\u043A\u0438 \u0432\u043D\u0443\u0442\u0440\u0438 \u043F\u0440\u043E\u0451\u043C\u0430; \u0433\u0434\u0435
|
|
1809
|
+
* \u043B\u0443\u0447 \u0443\u0441\u043F\u0435\u043B \u0432\u044B\u0439\u0442\u0438 \u0437\u0430 \u043A\u0440\u0430\u0439 \u2014 \u0432\u0438\u0434\u0435\u043D \u041E\u0422\u041A\u041E\u0421, \u0431\u043E\u043A\u043E\u0432\u0430\u044F \u0441\u0442\u0435\u043D\u043A\u0430 \u043D\u0438\u0448\u0438. \u041E\u043D \u0438 \u043F\u043E\u044F\u0432\u043B\u044F\u0435\u0442\u0441\u044F \u0441\u0431\u043E\u043A\u0443 \u043F\u0440\u0438
|
|
1810
|
+
* \u043F\u043E\u0432\u043E\u0440\u043E\u0442\u0435 \u043A\u0430\u043C\u0435\u0440\u044B, \u0438 \u044D\u0442\u043E \u0435\u0434\u0438\u043D\u0441\u0442\u0432\u0435\u043D\u043D\u043E\u0435, \u0447\u0442\u043E \u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044F \u043A\u0430\u043A \u043D\u0430\u0441\u0442\u043E\u044F\u0449\u0430\u044F \u0433\u043B\u0443\u0431\u0438\u043D\u0430.
|
|
1811
|
+
*/
|
|
1647
1812
|
float atGround = step(y, mBot);
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1813
|
+
bool inCols = gx >= 0.0 && gx <= cols;
|
|
1814
|
+
|
|
1815
|
+
/*
|
|
1816
|
+
* \u041F\u0420\u041E\u0401\u041C \u2014 \u041E\u0414\u041D\u0410 \u041A\u041E\u0420\u041E\u0411\u041A\u0410 \u043D\u0430 \u0432\u0441\u0435 \u0441\u043B\u0443\u0447\u0430\u0438. \u0412\u0438\u0442\u0440\u0438\u043D\u0430 \u043F\u0435\u0440\u0432\u043E\u0433\u043E \u044D\u0442\u0430\u0436\u0430 \u043E\u0442\u043B\u0438\u0447\u0430\u0435\u0442\u0441\u044F \u043E\u0442 \u043E\u043A\u043D\u0430 \u0442\u043E\u043B\u044C\u043A\u043E \u0440\u0430\u0437\u043C\u0435\u0440\u043E\u043C
|
|
1817
|
+
* \u0438 \u0442\u0435\u043C, \u043E\u0442 \u0447\u0435\u0433\u043E \u0441\u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044F \u0435\u0451 \u0446\u0435\u043D\u0442\u0440; \u0440\u0430\u043D\u044C\u0448\u0435 \u043E\u043D\u0430 \u0434\u043E\u0431\u0430\u0432\u043B\u044F\u043B\u0430\u0441\u044C \u043E\u0442\u0434\u0435\u043B\u044C\u043D\u043E\u0439 \u043C\u0430\u0441\u043A\u043E\u0439 \u0421\u0420\u0410\u0417\u0423 \u0438 \u0432 \u043F\u0440\u043E\u0451\u043C, \u0438
|
|
1818
|
+
* \u0432 \u0441\u0442\u0435\u043A\u043B\u043E \u2014 \u043E\u0442\u043A\u043E\u0441\u0443 \u0442\u0430\u043C \u0431\u044B\u043B\u043E \u043D\u0435\u043E\u0442\u043A\u0443\u0434\u0430 \u0432\u0437\u044F\u0442\u044C\u0441\u044F, \u0438 \u043D\u0438\u0437 \u0434\u043E\u043C\u0430 \u043E\u0441\u0442\u0430\u0432\u0430\u043B\u0441\u044F \u0441 \u043F\u043B\u043E\u0441\u043A\u0438\u043C\u0438 \u043E\u043A\u043D\u0430\u043C\u0438. \u0422\u0435\u043F\u0435\u0440\u044C
|
|
1819
|
+
* \u0440\u0430\u0437\u043C\u0435\u0440\u044B \u043A\u043E\u0440\u043E\u0431\u043A\u0438 \u043F\u043E\u0434\u043C\u0435\u043D\u044F\u044E\u0442\u0441\u044F, \u0430 \u0433\u043B\u0443\u0431\u0438\u043D\u0430, \u043E\u0442\u043A\u043E\u0441\u044B \u0438 \u043F\u0435\u0440\u0435\u043F\u043B\u0451\u0442 \u0441\u0447\u0438\u0442\u0430\u044E\u0442\u0441\u044F \u0434\u0430\u043B\u044C\u0448\u0435 \u043E\u0434\u043D\u0438\u043C \u043A\u043E\u0434\u043E\u043C.
|
|
1820
|
+
*/
|
|
1821
|
+
vec2 f = vec2(fx, fy);
|
|
1822
|
+
vec2 halfBox = vec2(winW, winH) * 0.5;
|
|
1823
|
+
bool opening = inGrid;
|
|
1824
|
+
if ((cls == 1 || cls == 2) && atGround > 0.5 && inCols) {
|
|
1825
|
+
f = vec2(fx, y - mBot * 0.55);
|
|
1826
|
+
halfBox = vec2(cw * 0.36, mBot * 0.3);
|
|
1827
|
+
opening = true;
|
|
1652
1828
|
}
|
|
1829
|
+
// \u0426\u0435\u0445: \u043E\u043A\u043D\u0430 \u0442\u043E\u043B\u044C\u043A\u043E \u0432\u044B\u0448\u0435 \u0447\u0435\u0442\u044B\u0440\u0451\u0445 \u043C\u0435\u0442\u0440\u043E\u0432, \u043E\u0441\u0442\u0430\u043B\u044C\u043D\u043E\u0435 \u2014 \u0433\u043B\u0443\u0445\u0438\u0435 \u043F\u0430\u043D\u0435\u043B\u0438.
|
|
1830
|
+
if (cls == 3 && y < 4.0) opening = false;
|
|
1831
|
+
|
|
1832
|
+
vec2 deep = f - par * u_window_recess;
|
|
1653
1833
|
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1834
|
+
float win = 0.0;
|
|
1835
|
+
float glassMask = 0.0;
|
|
1836
|
+
float frame = 0.0;
|
|
1837
|
+
if (opening) {
|
|
1838
|
+
win = band(f.x, halfBox.x, aa) * band(f.y, halfBox.y, aa);
|
|
1839
|
+
glassMask = win * band(deep.x, halfBox.x, aa) * band(deep.y, halfBox.y, aa);
|
|
1840
|
+
frame = (band(f.x, halfBox.x + 0.12, aa) * band(f.y, halfBox.y + 0.12, aa) - win) * fine;
|
|
1658
1841
|
}
|
|
1659
1842
|
|
|
1660
1843
|
/*
|
|
@@ -1672,9 +1855,6 @@ vec4 facadePattern(vec3 base, vec3 wall, float y, int cls, float seed, float aa,
|
|
|
1672
1855
|
float seams = (cls == 2 ? seamX : max(seamY, seamX) * (cls == 3 ? 1.0 : 0.55)) * fine;
|
|
1673
1856
|
color *= 1.0 - seams * 0.10;
|
|
1674
1857
|
|
|
1675
|
-
// \u0426\u043E\u043A\u043E\u043B\u044C \u0442\u0435\u043C\u043D\u0435\u0435 \u2014 \u0437\u0434\u0430\u043D\u0438\u0435 \xAB\u0441\u0442\u043E\u0438\u0442\xBB, \u0430 \u043D\u0435 \u0432\u0438\u0441\u0438\u0442.
|
|
1676
|
-
color *= mix(1.0, 0.86, atGround * (cls == 0 || cls == 3 ? 1.0 : 0.4));
|
|
1677
|
-
|
|
1678
1858
|
// \u0421\u0442\u0435\u043A\u043B\u043E: \u0443 \u043A\u0430\u0436\u0434\u043E\u0433\u043E \u043E\u043A\u043D\u0430 \u0441\u0432\u043E\u0439 \u0442\u043E\u043D \u0438 \u0433\u0440\u0430\u0434\u0438\u0435\u043D\u0442 \u043F\u043E \u0432\u044B\u0441\u043E\u0442\u0435 \u2014 \u0441\u0432\u0435\u0440\u0445\u0443 \u0432 \u043D\u0451\u043C
|
|
1679
1859
|
// \u043E\u0442\u0440\u0430\u0436\u0430\u0435\u0442\u0441\u044F \u043D\u0435\u0431\u043E, \u0441\u043D\u0438\u0437\u0443 \u0442\u0451\u043C\u043D\u044B\u0439 \u0438\u043D\u0442\u0435\u0440\u044C\u0435\u0440. \u0420\u043E\u0432\u043D\u0430\u044F \u0437\u0430\u043B\u0438\u0432\u043A\u0430 \u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044F \u043D\u0430\u043A\u043B\u0435\u0439\u043A\u043E\u0439.
|
|
1680
1860
|
// \u0412\u0445\u043E\u0434 \u0445\u0435\u0448\u0430 \u2014 \u0442\u043E\u043B\u044C\u043A\u043E \u0426\u0415\u041B\u042B\u0415 \u0447\u0438\u0441\u043B\u0430: \u043D\u043E\u043C\u0435\u0440 \u044F\u0447\u0435\u0439\u043A\u0438 \u0438 \u043E\u0442\u0442\u0435\u043D\u043E\u043A, \u0432\u043E\u0437\u0432\u0440\u0430\u0449\u0451\u043D\u043D\u044B\u0439 \u043A \u0441\u0432\u043E\u0435\u043C\u0443
|
|
@@ -1682,7 +1862,9 @@ vec4 facadePattern(vec3 base, vec3 wall, float y, int cls, float seed, float aa,
|
|
|
1682
1862
|
vec2 cell = floor(vec2(gx, gy));
|
|
1683
1863
|
float cellSeed = floor(seed * 255.0 + 0.5);
|
|
1684
1864
|
float jitter = hashNoise(cell + cellSeed * 37.0);
|
|
1685
|
-
|
|
1865
|
+
// \u0413\u0440\u0430\u0434\u0438\u0435\u043D\u0442 \u043D\u0435\u0431\u0430 \u0436\u0438\u0432\u0451\u0442 \u041D\u0410 \u0421\u0422\u0415\u041A\u041B\u0415, \u0437\u043D\u0430\u0447\u0438\u0442 \u0438 \u0441\u0447\u0438\u0442\u0430\u0442\u044C \u0435\u0433\u043E \u043D\u0430\u0434\u043E \u0432 \u0442\u043E\u0447\u043A\u0435 \u0441\u0442\u0435\u043A\u043B\u0430: \u0438\u043D\u0430\u0447\u0435 \u043F\u0440\u0438 \u043F\u043E\u0432\u043E\u0440\u043E\u0442\u0435
|
|
1866
|
+
// \u043A\u0430\u043C\u0435\u0440\u044B \u043E\u0442\u0440\u0430\u0436\u0435\u043D\u0438\u0435 \u043E\u0441\u0442\u0430\u0451\u0442\u0441\u044F \u043F\u0440\u0438\u043A\u043B\u0435\u0435\u043D\u043D\u044B\u043C \u043A \u0441\u0442\u0435\u043D\u0435, \u0430 \u043D\u0435 \u0441\u044A\u0435\u0437\u0436\u0430\u0435\u0442 \u0432\u043C\u0435\u0441\u0442\u0435 \u0441 \u043E\u043A\u043D\u043E\u043C.
|
|
1867
|
+
float sky = clamp(0.5 + deep.y / max(halfBox.y * 2.0, 0.2), 0.0, 1.0);
|
|
1686
1868
|
vec3 glass = u_window_color * (0.7 + 0.45 * jitter) * (0.82 + 0.5 * sky);
|
|
1687
1869
|
|
|
1688
1870
|
// \u041D\u043E\u0447\u044C\u044E \u0433\u043E\u0440\u0438\u0442 \u0447\u0430\u0441\u0442\u044C \u043E\u043A\u043E\u043D. \u041A\u0430\u043A\u0438\u0435 \u0438\u043C\u0435\u043D\u043D\u043E \u2014 \u0440\u0435\u0448\u0430\u0435\u0442 \u0445\u0435\u0448 \u044F\u0447\u0435\u0439\u043A\u0438, \u043F\u043E\u044D\u0442\u043E\u043C\u0443 \u043F\u0440\u0438
|
|
@@ -1690,12 +1872,53 @@ vec4 facadePattern(vec3 base, vec3 wall, float y, int cls, float seed, float aa,
|
|
|
1690
1872
|
float lit = step(1.0 - u_window_glow, hashNoise(cell * 1.7 + cellSeed * 91.0));
|
|
1691
1873
|
// \u042F\u0440\u043A\u043E\u0441\u0442\u044C \u0433\u043E\u0440\u044F\u0449\u0435\u0433\u043E \u043E\u043A\u043D\u0430 \u0442\u043E\u0436\u0435 \u0440\u0430\u0437\u043D\u0430\u044F: \u043E\u0434\u0438\u043D\u0430\u043A\u043E\u0432\u043E \u0441\u0432\u0435\u0442\u044F\u0449\u0438\u0435\u0441\u044F \u043E\u043A\u043D\u0430 \u0432\u044B\u0433\u043B\u044F\u0434\u044F\u0442
|
|
1692
1874
|
// \u0441\u0432\u0435\u0442\u043E\u0434\u0438\u043E\u0434\u043D\u043E\u0439 \u0432\u044B\u0432\u0435\u0441\u043A\u043E\u0439, \u0430 \u043D\u0435 \u0436\u0438\u043B\u044B\u043C \u0434\u043E\u043C\u043E\u043C.
|
|
1693
|
-
glow =
|
|
1875
|
+
glow = glassMask * lit * (0.45 + 0.75 * jitter);
|
|
1876
|
+
|
|
1877
|
+
/*
|
|
1878
|
+
* \u0422\u0435\u043D\u044C \u043E\u0442 \u043A\u0440\u0430\u044F \u043F\u0440\u043E\u0451\u043C\u0430. \u0422\u043E\u0447\u043A\u0430 \u0441\u0442\u0435\u043A\u043B\u0430 \u043E\u0441\u0432\u0435\u0449\u0435\u043D\u0430, \u0435\u0441\u043B\u0438 \u043B\u0443\u0447 \u043D\u0430 \u0441\u043E\u043B\u043D\u0446\u0435 \u0432\u044B\u0445\u043E\u0434\u0438\u0442 \u043D\u0430\u0440\u0443\u0436\u0443, \u0442\u043E \u0435\u0441\u0442\u044C \u0435\u0441\u043B\u0438
|
|
1879
|
+
* \u0441\u0434\u0432\u0438\u043D\u0443\u0442\u0430\u044F \u043D\u0430 sunOff \u0442\u043E\u0447\u043A\u0430 \u0435\u0449\u0451 \u0432\u043D\u0443\u0442\u0440\u0438 \u043E\u043A\u043D\u0430. \u0421\u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044F \u0412 \u0422\u041E\u0427\u041A\u0415 \u0421\u0422\u0415\u041A\u041B\u0410 \u0438 \u0434\u043E \u043F\u0435\u0440\u0435\u043F\u043B\u0451\u0442\u0430: \u0441\u0430\u043C
|
|
1880
|
+
* \u043F\u0435\u0440\u0435\u043F\u043B\u0451\u0442 \u043B\u0435\u0436\u0438\u0442 \u0432 \u043F\u043B\u043E\u0441\u043A\u043E\u0441\u0442\u0438 \u0441\u0442\u0435\u043D\u044B \u0438 \u043D\u0438\u0447\u0435\u0433\u043E \u043D\u0435 \u0437\u0430\u0442\u0435\u043D\u044F\u0435\u0442.
|
|
1881
|
+
*
|
|
1882
|
+
* \u0413\u0440\u0430\u043D\u0438\u0446\u0430 \u0420\u0410\u0417\u041C\u042B\u0422\u0410 \u043D\u0430 \u0432\u0441\u044E \u0434\u043B\u0438\u043D\u0443 \u0432\u044B\u043D\u043E\u0441\u0430, \u0430 \u043D\u0435 \u043D\u0430 \u043F\u0438\u043A\u0441\u0435\u043B\u044C. \u0421\u043E\u043B\u043D\u0446\u0435 \u2014 \u043D\u0435 \u0442\u043E\u0447\u043A\u0430, \u043A\u0440\u0430\u0439 \u043F\u0440\u043E\u0451\u043C\u0430 \u0434\u0430\u0451\u0442
|
|
1883
|
+
* \u043F\u043E\u043B\u0443\u0442\u0435\u043D\u044C \u0442\u0435\u043C \u0448\u0438\u0440\u0435, \u0447\u0435\u043C \u0434\u043B\u0438\u043D\u043D\u0435\u0435 \u0442\u0435\u043D\u044C; \u0440\u0435\u0437\u043A\u0430\u044F \u0433\u0440\u0430\u043D\u0438\u0446\u0430 \u043D\u0430 \u0441\u0442\u0435\u043A\u043B\u0435 \u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044F \u043F\u044F\u0442\u043D\u043E\u043C \u0433\u0440\u044F\u0437\u0438, \u0430 \u043D\u0435
|
|
1884
|
+
* \u0433\u043B\u0443\u0431\u0438\u043D\u043E\u0439. \u0421\u0442\u0435\u043A\u043B\u043E \u0432\u0434\u043E\u0431\u0430\u0432\u043E\u043A \u0437\u0435\u0440\u043A\u0430\u043B\u044C\u043D\u043E\u0435: \u0442\u0435\u043D\u044C \u043D\u0430 \u043D\u0451\u043C \u0438 \u0432 \u0436\u0438\u0437\u043D\u0438 \u0435\u0434\u0432\u0430 \u0432\u0438\u0434\u043D\u0430, \u043F\u043E\u044D\u0442\u043E\u043C\u0443 \u043E\u043D\u0430 \u0437\u0434\u0435\u0441\u044C
|
|
1885
|
+
* \u0437\u0430\u043C\u0435\u0442\u043D\u043E \u0441\u043B\u0430\u0431\u0435\u0435, \u0447\u0435\u043C \u043D\u0430 \u043E\u0442\u043A\u043E\u0441\u0435.
|
|
1886
|
+
*/
|
|
1887
|
+
float penumbra = max(abs(sunOff.x), abs(sunOff.y)) * 0.9 + aa;
|
|
1888
|
+
float sunlit = band(deep.x + sunOff.x, halfBox.x, penumbra) * band(deep.y + sunOff.y, halfBox.y, penumbra);
|
|
1889
|
+
glass *= 1.0 - (1.0 - sunlit) * u_window_recess_shade * fine;
|
|
1890
|
+
color = mix(color, glass, glassMask * 0.9);
|
|
1891
|
+
|
|
1892
|
+
/*
|
|
1893
|
+
* \u041E\u0442\u043A\u043E\u0441 \u2014 \u0447\u0430\u0441\u0442\u044C \u043F\u0440\u043E\u0451\u043C\u0430, \u0433\u0434\u0435 \u043B\u0443\u0447 \u043D\u0435 \u0434\u043E\u0448\u0451\u043B \u0434\u043E \u0441\u0442\u0435\u043A\u043B\u0430. \u041E\u043D \u043D\u0435 \u043F\u043B\u043E\u0441\u043A\u0438\u0439: \u043D\u0438\u0437 \u043F\u0435\u0440\u0435\u043C\u044B\u0447\u043A\u0438 \u0441\u043C\u043E\u0442\u0440\u0438\u0442 \u0432\u043D\u0438\u0437
|
|
1894
|
+
* \u0438 \u0432\u0441\u0435\u0433\u0434\u0430 \u0432 \u0442\u0435\u043D\u0438, \u043F\u043E\u0434\u043E\u043A\u043E\u043D\u043D\u0438\u043A \u0441\u043C\u043E\u0442\u0440\u0438\u0442 \u0432\u0432\u0435\u0440\u0445 \u0438 \u043B\u043E\u0432\u0438\u0442 \u043D\u0435\u0431\u043E, \u0431\u043E\u043A\u043E\u0432\u044B\u0435 \u0449\u0451\u043A\u0438 \u043C\u0435\u0436\u0434\u0443 \u043D\u0438\u043C\u0438.
|
|
1895
|
+
*
|
|
1896
|
+
* \u041A\u0430\u043A\u0430\u044F \u0438\u043C\u0435\u043D\u043D\u043E \u0433\u0440\u0430\u043D\u044C \u0432\u0438\u0434\u043D\u0430 \u2014 \u0440\u0435\u0448\u0430\u0435\u0442 \u041D\u0415 \u0432\u044B\u0441\u043E\u0442\u0430 \u0442\u043E\u0447\u043A\u0438, \u0430 \u0442\u043E, \u0434\u043E \u043A\u0430\u043A\u043E\u0439 \u043F\u043B\u043E\u0441\u043A\u043E\u0441\u0442\u0438 \u043B\u0443\u0447 \u0434\u043E\u0448\u0451\u043B
|
|
1897
|
+
* \u0420\u0410\u041D\u042C\u0428\u0415. \u042D\u0442\u043E \u043E\u0431\u044B\u0447\u043D\u0430\u044F \u0437\u0430\u0434\u0430\u0447\u0430 \u043F\u0435\u0440\u0435\u0441\u0435\u0447\u0435\u043D\u0438\u044F \u043B\u0443\u0447\u0430 \u0441 \u043A\u043E\u0440\u043E\u0431\u043A\u043E\u0439, \u0438 \u0431\u0435\u0437 \u043D\u0435\u0451 \u0443 \u043D\u0438\u0436\u043D\u0435\u0433\u043E \u0443\u0433\u043B\u0430 \u0431\u043E\u043A\u043E\u0432\u0430\u044F
|
|
1898
|
+
* \u0449\u0435\u043A\u0430 \u043E\u0431\u0440\u044B\u0432\u0430\u043B\u0430\u0441\u044C \u043F\u043E\u0434\u043E\u043A\u043E\u043D\u043D\u0438\u043A\u043E\u043C: \u0432 \u0443\u0433\u043B\u0443 \u043B\u0443\u0447 \u0432\u044B\u0445\u043E\u0434\u0438\u0442 \u0441\u0440\u0430\u0437\u0443 \u043F\u043E \u043E\u0431\u0435\u0438\u043C \u043E\u0441\u044F\u043C, \u0438 \u0432\u044B\u0431\u043E\u0440 \xAB\u043F\u043E \u0432\u044B\u0441\u043E\u0442\u0435\xBB
|
|
1899
|
+
* \u043E\u0442\u0434\u0430\u0432\u0430\u043B \u0443\u0433\u043E\u043B \u0433\u043E\u0440\u0438\u0437\u043E\u043D\u0442\u0430\u043B\u044C\u043D\u043E\u0439 \u0433\u0440\u0430\u043D\u0438. \u0423 \u043D\u0430\u0441\u0442\u043E\u044F\u0449\u0435\u0439 \u043D\u0438\u0448\u0438 \u0442\u0430\u043C \u0438\u0434\u0451\u0442 \u0434\u0438\u0430\u0433\u043E\u043D\u0430\u043B\u044C \u2014 \u043B\u0438\u043D\u0438\u044F \u0441\u0445\u043E\u0434\u0430 \u0434\u0432\u0443\u0445
|
|
1900
|
+
* \u043F\u043B\u043E\u0441\u043A\u043E\u0441\u0442\u0435\u0439.
|
|
1901
|
+
*/
|
|
1902
|
+
float revealMask = max(win - glassMask, 0.0) * fine;
|
|
1903
|
+
if (revealMask > 0.001) {
|
|
1904
|
+
// \u0421\u043C\u0435\u0449\u0435\u043D\u0438\u0435 \u0442\u043E\u0447\u043A\u0438 \u043F\u043E\u043F\u0430\u0434\u0430\u043D\u0438\u044F \u043D\u0430 \u041C\u0415\u0422\u0420 \u0433\u043B\u0443\u0431\u0438\u043D\u044B; \u043E\u0442\u0441\u044E\u0434\u0430 \u2014 \u0433\u043B\u0443\u0431\u0438\u043D\u0430 \u0432\u044B\u0445\u043E\u0434\u0430 \u043F\u043E \u043A\u0430\u0436\u0434\u043E\u0439 \u043E\u0441\u0438.
|
|
1905
|
+
vec2 dir = -par;
|
|
1906
|
+
float big = 1e6;
|
|
1907
|
+
float tX = abs(dir.x) > 1e-4 ? ((dir.x > 0.0 ? halfBox.x : -halfBox.x) - f.x) / dir.x : big;
|
|
1908
|
+
float tY = abs(dir.y) > 1e-4 ? ((dir.y > 0.0 ? halfBox.y : -halfBox.y) - f.y) / dir.y : big;
|
|
1909
|
+
// \u0428\u0438\u0440\u0438\u043D\u0430 \u0440\u0430\u0437\u043C\u044B\u0442\u0438\u044F \u2014 \u0432 \u0442\u0435\u0445 \u0436\u0435 \u0435\u0434\u0438\u043D\u0438\u0446\u0430\u0445, \u0447\u0442\u043E \u0438 \u0433\u043B\u0443\u0431\u0438\u043D\u0430: \u043F\u0438\u043A\u0441\u0435\u043B\u044C \u043F\u043E \u0433\u0440\u0430\u043D\u0438 \u044D\u0442\u043E aa \u043C\u0435\u0442\u0440\u043E\u0432 \u0432\u0431\u043E\u043A,
|
|
1910
|
+
// \u0430 \u0432\u0431\u043E\u043A \u0437\u0430 \u043C\u0435\u0442\u0440 \u0433\u043B\u0443\u0431\u0438\u043D\u044B \u043B\u0443\u0447 \u0443\u0445\u043E\u0434\u0438\u0442 \u043D\u0430 length(dir).
|
|
1911
|
+
float w = aa / max(length(dir), 1e-3) + 1e-4;
|
|
1912
|
+
float sideFirst = smoothstep(-w, w, tY - tX);
|
|
1913
|
+
// \u041B\u0443\u0447 \u0438\u0434\u0451\u0442 \u0432\u0432\u0435\u0440\u0445 \u2014 \u0432\u044B\u0445\u043E\u0434\u0438\u0442 \u0447\u0435\u0440\u0435\u0437 \u0432\u0435\u0440\u0445 \u043D\u0438\u0448\u0438, \u0430 \u044D\u0442\u043E \u043D\u0438\u0437 \u043F\u0435\u0440\u0435\u043C\u044B\u0447\u043A\u0438, \u043E\u043D \u0432\u0441\u0435\u0433\u0434\u0430 \u0432 \u0442\u0435\u043D\u0438.
|
|
1914
|
+
float horizTone = dir.y > 0.0 ? 0.58 : 1.06;
|
|
1915
|
+
float tone = mix(horizTone, 0.82, sideFirst);
|
|
1916
|
+
color = mix(color, base * tone, revealMask);
|
|
1917
|
+
}
|
|
1694
1918
|
|
|
1695
|
-
color = mix(color, glass, win * 0.9);
|
|
1696
1919
|
color = mix(color, u_window_frame, frame * 0.75);
|
|
1697
1920
|
|
|
1698
|
-
return vec4(color,
|
|
1921
|
+
return vec4(color, glassMask);
|
|
1699
1922
|
}
|
|
1700
1923
|
|
|
1701
1924
|
/**
|
|
@@ -1737,17 +1960,18 @@ vec3 roofHue(vec3 base, float seed) {
|
|
|
1737
1960
|
float hueLum = max(dot(hue, vec3(0.2126, 0.7152, 0.0722)), 1e-3);
|
|
1738
1961
|
return hue * (baseLum / hueLum);
|
|
1739
1962
|
}
|
|
1740
|
-
`,
|
|
1963
|
+
`,es=`#version 300 es
|
|
1741
1964
|
precision highp float;
|
|
1742
1965
|
|
|
1743
|
-
${
|
|
1744
|
-
${
|
|
1745
|
-
${
|
|
1746
|
-
${
|
|
1966
|
+
${po}
|
|
1967
|
+
${br}
|
|
1968
|
+
${nt}
|
|
1969
|
+
${Xu}
|
|
1747
1970
|
|
|
1748
1971
|
in vec3 v_normal;
|
|
1749
1972
|
in float v_ao;
|
|
1750
1973
|
flat in float v_tint; // \u0431\u0435\u0437 \u0438\u043D\u0442\u0435\u0440\u043F\u043E\u043B\u044F\u0446\u0438\u0438 \u2014 \u0441\u043C. \u0432\u0435\u0440\u0448\u0438\u043D\u043D\u044B\u0439 \u0448\u0435\u0439\u0434\u0435\u0440
|
|
1974
|
+
in vec3 v_view; // \u043E\u0442 \u0442\u043E\u0447\u043A\u0438 \u043A \u043A\u0430\u043C\u0435\u0440\u0435, \u043C\u0435\u0442\u0440\u044B
|
|
1751
1975
|
in float v_kind;
|
|
1752
1976
|
in vec2 v_world;
|
|
1753
1977
|
in float v_up;
|
|
@@ -1776,6 +2000,22 @@ void main() {
|
|
|
1776
2000
|
// \u0440\u0430\u0437\u0431\u0440\u043E\u0441 \u043E\u0442\u0442\u0435\u043D\u043A\u0430 \u043F\u043E \u0437\u0434\u0430\u043D\u0438\u044F\u043C: \u043A\u0432\u0430\u0440\u0442\u0430\u043B \u043F\u0435\u0440\u0435\u0441\u0442\u0430\u0451\u0442 \u0431\u044B\u0442\u044C \u0441\u043F\u043B\u043E\u0448\u043D\u043E\u0439 \u043C\u0430\u0441\u0441\u043E\u0439
|
|
1777
2001
|
albedo *= 1.0 + (v_tint - 0.5) * 2.0 * u_tint_variation;
|
|
1778
2002
|
|
|
2003
|
+
/*
|
|
2004
|
+
* \u0426\u041E\u041A\u041E\u041B\u042C. \u0423 \u0437\u0435\u043C\u043B\u0438 \u0441\u0442\u0435\u043D\u0430 \u0442\u0435\u043C\u043D\u0435\u0435: \u0442\u0443\u0434\u0430 \u043C\u0435\u043D\u044C\u0448\u0435 \u0434\u043E\u0445\u043E\u0434\u0438\u0442 \u043D\u0435\u0431\u0430, \u0438 \u0437\u0434\u0430\u043D\u0438\u0435 \u0432\u0438\u0437\u0443\u0430\u043B\u044C\u043D\u043E \u0441\u0442\u043E\u0438\u0442, \u0430 \u043D\u0435 \u0432\u0438\u0441\u0438\u0442.
|
|
2005
|
+
*
|
|
2006
|
+
* \u0420\u0430\u043D\u044C\u0448\u0435 \u044D\u0442\u043E \u0431\u044B\u043B\u0430 \u041F\u041E\u041B\u041E\u0421\u0410 \u0441 \u0440\u0435\u0437\u043A\u0438\u043C \u0432\u0435\u0440\u0445\u043D\u0438\u043C \u043A\u0440\u0430\u0435\u043C \u043D\u0430 \u0432\u044B\u0441\u043E\u0442\u0435 \u0446\u043E\u043A\u043E\u043B\u044C\u043D\u043E\u0433\u043E \u043F\u043E\u044F\u0441\u0430, \u0438 \u0441\u0447\u0438\u0442\u0430\u043B\u0430\u0441\u044C \u043E\u043D\u0430
|
|
2007
|
+
* \u0432\u043D\u0443\u0442\u0440\u0438 \u0444\u0430\u0441\u0430\u0434\u043D\u043E\u0433\u043E \u0443\u0437\u043E\u0440\u0430 \u2014 \u0442\u043E \u0435\u0441\u0442\u044C \u0442\u043E\u043B\u044C\u043A\u043E \u043D\u0430 \u0433\u0440\u0430\u043D\u044F\u0445, \u043A\u0443\u0434\u0430 \u0443\u0437\u043E\u0440 \u0432\u043E\u043E\u0431\u0449\u0435 \u043B\u043E\u0436\u0438\u0442\u0441\u044F. \u041D\u0430 \u0441\u043A\u0440\u0443\u0433\u043B\u0451\u043D\u043D\u043E\u043C
|
|
2008
|
+
* \u0443\u0433\u043B\u0443 \u0433\u0440\u0430\u043D\u044C \u0441\u043B\u0438\u0448\u043A\u043E\u043C \u0443\u0437\u043A\u0430\u044F, \u0443\u0437\u043E\u0440 \u0442\u0443\u0434\u0430 \u043D\u0435 \u043A\u043B\u0430\u0434\u0451\u0442\u0441\u044F, \u0438 \u043F\u043E\u043B\u043E\u0441\u0430 \u0442\u0430\u043C \u043E\u0431\u0440\u044B\u0432\u0430\u043B\u0430\u0441\u044C \u043F\u043E\u0441\u0440\u0435\u0434\u0438 \u0434\u043E\u043C\u0430.
|
|
2009
|
+
*
|
|
2010
|
+
* \u0422\u0435\u043F\u0435\u0440\u044C \u044D\u0442\u043E \u0437\u0430\u0442\u0443\u0445\u0430\u043D\u0438\u0435 \u0432\u0432\u0435\u0440\u0445 \u043F\u043E \u0432\u044B\u0441\u043E\u0442\u0435 \u0438 \u0441\u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044F \u043E\u043D\u043E \u0434\u043B\u044F \u0432\u0441\u0435\u0439 \u0441\u0442\u0435\u043D\u044B \u0440\u0430\u0437\u043E\u043C, \u0434\u043E \u0443\u0437\u043E\u0440\u0430. \u0421\u043F\u0430\u0434
|
|
2011
|
+
* \u043A\u0432\u0430\u0434\u0440\u0430\u0442\u0438\u0447\u043D\u044B\u0439: \u0443 \u043D\u0430\u0441\u0442\u043E\u044F\u0449\u0435\u0439 \u043A\u043E\u043D\u0442\u0430\u043A\u0442\u043D\u043E\u0439 \u0442\u0435\u043D\u0438 \u043F\u043B\u043E\u0442\u043D\u043E\u0441\u0442\u044C \u043F\u0430\u0434\u0430\u0435\u0442 \u0431\u044B\u0441\u0442\u0440\u0435\u0435 \u0443 \u0437\u0435\u043C\u043B\u0438, \u0430 \u043B\u0438\u043D\u0435\u0439\u043D\u044B\u0439 \u0441\u043F\u0430\u0434
|
|
2012
|
+
* \u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044F \u0433\u0440\u0430\u0434\u0438\u0435\u043D\u0442\u043D\u043E\u0439 \u0437\u0430\u043B\u0438\u0432\u043A\u043E\u0439.
|
|
2013
|
+
*/
|
|
2014
|
+
if (!isRoof) {
|
|
2015
|
+
float toGround = 1.0 - clamp(v_up / max(u_plinth_height, 0.01), 0.0, 1.0);
|
|
2016
|
+
albedo *= 1.0 - u_plinth_shade * toGround * toGround;
|
|
2017
|
+
}
|
|
2018
|
+
|
|
1779
2019
|
/*
|
|
1780
2020
|
* \u041C\u0415\u0422\u0420\u041E\u0412 \u041D\u0410 \u041F\u0418\u041A\u0421\u0415\u041B\u042C \u2014 \u0438 \u043C\u0435\u0440\u0430 \u0442\u043E\u0433\u043E, \u0441\u043A\u043E\u043B\u044C\u043A\u043E \u0434\u0435\u0442\u0430\u043B\u0435\u0439 \u0438\u043C\u0435\u0435\u0442 \u0441\u043C\u044B\u0441\u043B \u0440\u0438\u0441\u043E\u0432\u0430\u0442\u044C, \u0438 \u0448\u0438\u0440\u0438\u043D\u0430 \u0441\u0433\u043B\u0430\u0436\u0438\u0432\u0430\u043D\u0438\u044F.
|
|
1781
2021
|
*
|
|
@@ -1805,9 +2045,47 @@ void main() {
|
|
|
1805
2045
|
// \u0420\u0430\u0441\u043A\u043B\u0430\u0434\u043A\u0430 \u0438\u0434\u0451\u0442 \u043F\u043E \u0413\u0420\u0410\u041D\u0418, \u0430 \u043D\u0435 \u043F\u043E \u043E\u0431\u0449\u0435\u0439 \u0441\u0435\u0442\u043A\u0435: \u0441\u043C\u0435\u0449\u0435\u043D\u0438\u0435 \u0432\u0434\u043E\u043B\u044C \u043D\u0435\u0451, \u0435\u0451
|
|
1806
2046
|
// \u0448\u0438\u0440\u0438\u043D\u0430 \u0438 \u0432\u044B\u0441\u043E\u0442\u0430 \u043F\u0440\u0438\u0448\u043B\u0438 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043E\u043C. \u0424\u0440\u043E\u043D\u0442\u043E\u043D\u044B \u0438 \u043F\u0440\u043E\u0447\u0438\u0435 \u043A\u0443\u0441\u043A\u0438 \u0431\u0435\u0437 \u0433\u0440\u0430\u043D\u0438
|
|
1807
2047
|
// (v_wall.y == 0) \u043E\u0441\u0442\u0430\u044E\u0442\u0441\u044F \u0433\u043B\u0443\u0445\u0438\u043C\u0438.
|
|
2048
|
+
/*
|
|
2049
|
+
* \u041E\u0422\u041A\u041E\u0421 \u041E\u041A\u041D\u0410. \u0421\u0442\u0435\u043A\u043B\u043E \u0441\u0442\u043E\u0438\u0442 \u043D\u0435 \u0437\u0430\u043F\u043E\u0434\u043B\u0438\u0446\u043E \u0441\u043E \u0441\u0442\u0435\u043D\u043E\u0439, \u0430 \u043D\u0430 \u0433\u043B\u0443\u0431\u0438\u043D\u0435 u_window_recess, \u0438 \u043A\u0440\u0430\u0439
|
|
2050
|
+
* \u043F\u0440\u043E\u0451\u043C\u0430 \u043A\u043B\u0430\u0434\u0451\u0442 \u043D\u0430 \u043D\u0435\u0433\u043E \u0442\u0435\u043D\u044C \u2014 \u0441\u0432\u0435\u0440\u0445\u0443 \u0438 \u0441 \u0442\u043E\u0439 \u0441\u0442\u043E\u0440\u043E\u043D\u044B, \u0433\u0434\u0435 \u043D\u0435\u0442 \u0441\u043E\u043B\u043D\u0446\u0430. \u042D\u0442\u043E \u0438 \u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044F \u043A\u0430\u043A
|
|
2051
|
+
* \xAB\u043E\u043A\u043D\u043E \u0443\u0442\u043E\u043F\u043B\u0435\u043D\u043E\xBB: \u043F\u043B\u043E\u0441\u043A\u0430\u044F \u0437\u0430\u043B\u0438\u0432\u043A\u0430 \u0432\u0441\u0435\u0433\u0434\u0430 \u0432\u044B\u0433\u043B\u044F\u0434\u0438\u0442 \u043D\u0430\u043A\u043B\u0435\u0439\u043A\u043E\u0439, \u0441\u043A\u043E\u043B\u044C\u043A\u043E \u0435\u0439 \u043D\u0438 \u0434\u043E\u0431\u0430\u0432\u043B\u044F\u0439
|
|
2052
|
+
* \u043F\u0435\u0440\u0435\u043F\u043B\u0451\u0442\u0430.
|
|
2053
|
+
*
|
|
2054
|
+
* \u0421\u043C\u0435\u0449\u0435\u043D\u0438\u0435 \u0442\u0435\u043D\u0438 \u0441\u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044F \u0440\u043E\u0432\u043D\u043E \u043A\u0430\u043A \u043D\u0430\u0441\u0442\u043E\u044F\u0449\u0435\u0435: \u043B\u0443\u0447 \u043D\u0430 \u0441\u043E\u043B\u043D\u0446\u0435 \u043E\u0442 \u0442\u043E\u0447\u043A\u0438 \u0441\u0442\u0435\u043A\u043B\u0430 \u0432\u044B\u0445\u043E\u0434\u0438\u0442 \u0438\u0437
|
|
2055
|
+
* \u043F\u0440\u043E\u0451\u043C\u0430 \u0447\u0435\u0440\u0435\u0437 \u0442\u043E\u0447\u043A\u0443 \u0441\u0442\u0435\u043D\u044B, \u043E\u0442\u0441\u0442\u043E\u044F\u0449\u0443\u044E \u043D\u0430 \u0433\u043B\u0443\u0431\u0438\u043D\u0443 \xD7 \u0442\u0430\u043D\u0433\u0435\u043D\u0441 \u0443\u0433\u043B\u0430. \u0420\u0430\u0441\u043A\u043B\u0430\u0434\u044B\u0432\u0430\u0435\u043C \u043D\u0430\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u0435
|
|
2056
|
+
* \u043D\u0430 \u0441\u043E\u043B\u043D\u0446\u0435 \u043F\u043E \u043E\u0441\u044F\u043C \u0433\u0440\u0430\u043D\u0438 \u2014 \u0432\u0434\u043E\u043B\u044C \u043D\u0435\u0451 (t) \u0438 \u0432\u0432\u0435\u0440\u0445 \u2014 \u0438 \u0434\u0435\u043B\u0438\u043C \u043D\u0430 \u0441\u043E\u0441\u0442\u0430\u0432\u043B\u044F\u044E\u0449\u0443\u044E \u043F\u043E \u043D\u043E\u0440\u043C\u0430\u043B\u0438.
|
|
2057
|
+
* \u0423 \u043A\u0440\u0430\u044F \u0433\u0440\u0430\u043D\u0438 (\u0441\u043E\u043B\u043D\u0446\u0435 \u043F\u043E\u0447\u0442\u0438 \u0432\u0434\u043E\u043B\u044C \u0441\u0442\u0435\u043D\u044B) \u0442\u0430\u043D\u0433\u0435\u043D\u0441 \u0443\u0445\u043E\u0434\u0438\u0442 \u0432 \u0431\u0435\u0441\u043A\u043E\u043D\u0435\u0447\u043D\u043E\u0441\u0442\u044C, \u043F\u043E\u044D\u0442\u043E\u043C\u0443 \u0441\u043C\u0435\u0449\u0435\u043D\u0438\u0435
|
|
2058
|
+
* \u043E\u0433\u0440\u0430\u043D\u0438\u0447\u0435\u043D\u043E: \u0434\u043B\u0438\u043D\u043D\u0430\u044F \u0442\u0435\u043D\u044C \u0432\u0441\u0451 \u0440\u0430\u0432\u043D\u043E \u043D\u0430\u043A\u0440\u044B\u043B\u0430 \u0431\u044B \u043E\u043A\u043D\u043E \u0446\u0435\u043B\u0438\u043A\u043E\u043C.
|
|
2059
|
+
*/
|
|
2060
|
+
vec3 t = normalize(cross(vec3(0.0, 0.0, 1.0), n));
|
|
2061
|
+
|
|
2062
|
+
/*
|
|
2063
|
+
* \u041F\u0410\u0420\u0410\u041B\u041B\u0410\u041A\u0421 \u041E\u0422\u041A\u041E\u0421\u0410. \u041B\u0443\u0447 \u0432\u0437\u0433\u043B\u044F\u0434\u0430 \u043D\u0435 \u043E\u0441\u0442\u0430\u043D\u0430\u0432\u043B\u0438\u0432\u0430\u0435\u0442\u0441\u044F \u043D\u0430 \u043F\u043B\u043E\u0441\u043A\u043E\u0441\u0442\u0438 \u0441\u0442\u0435\u043D\u044B: \u0432\u043D\u0443\u0442\u0440\u0438 \u043F\u0440\u043E\u0451\u043C\u0430 \u043E\u043D
|
|
2064
|
+
* \u0438\u0434\u0451\u0442 \u0434\u0430\u043B\u044C\u0448\u0435 \u0438 \u043F\u0435\u0440\u0435\u0441\u0435\u043A\u0430\u0435\u0442 \u0441\u0442\u0435\u043A\u043B\u043E \u043D\u0430 \u0433\u043B\u0443\u0431\u0438\u043D\u0435 u_window_recess. \u0421\u043C\u0435\u0449\u0435\u043D\u0438\u0435 \u0442\u043E\u0447\u043A\u0438 \u043F\u043E\u043F\u0430\u0434\u0430\u043D\u0438\u044F
|
|
2065
|
+
* \u0432\u0434\u043E\u043B\u044C \u0433\u0440\u0430\u043D\u0438 \u0438 \u043F\u043E \u0432\u044B\u0441\u043E\u0442\u0435 \u0438 \u0435\u0441\u0442\u044C \u043F\u0430\u0440\u0430\u043B\u043B\u0430\u043A\u0441 \u2014 \u0438\u0437-\u0437\u0430 \u043D\u0435\u0433\u043E \u0441\u0431\u043E\u043A\u0443 \u0432\u0438\u0434\u043D\u043E \u043E\u0442\u043A\u043E\u0441, \u0438 \u0432\u0438\u0434\u043D\u043E
|
|
2066
|
+
* \u0418\u041C\u0415\u041D\u041D\u041E \u0422\u041E\u0422, \u043A\u043E\u0442\u043E\u0440\u044B\u0439 \u043E\u0442\u0432\u0451\u0440\u043D\u0443\u0442 \u043E\u0442 \u043A\u0430\u043C\u0435\u0440\u044B. \u0422\u0435\u043D\u044C \u043E\u0442 \u043A\u0440\u0430\u044F \u0441\u0432\u0435\u0442\u0430 \u044D\u0442\u043E\u0433\u043E \u043D\u0435 \u0434\u0430\u0451\u0442: \u043E\u043D\u0430 \u0441\u0442\u043E\u0438\u0442 \u043D\u0430
|
|
2067
|
+
* \u043C\u0435\u0441\u0442\u0435 \u043F\u0440\u0438 \u043F\u043E\u0432\u043E\u0440\u043E\u0442\u0435, \u0438 \u043E\u043A\u043D\u043E \u043E\u0441\u0442\u0430\u0451\u0442\u0441\u044F \u043D\u0430\u043A\u043B\u0435\u0439\u043A\u043E\u0439.
|
|
2068
|
+
*
|
|
2069
|
+
* \u042D\u0442\u043E \u0442\u043E\u0442 \u0436\u0435 \u043F\u0440\u0438\u0451\u043C, \u043A\u043E\u0442\u043E\u0440\u044B\u043C \u0432 \u0438\u0433\u0440\u0430\u0445 \u0440\u0438\u0441\u0443\u044E\u0442 \u043A\u043E\u043C\u043D\u0430\u0442\u044B \u0437\u0430 \u043E\u043A\u043D\u0430\u043C\u0438 (interior mapping): \u0432\u043C\u0435\u0441\u0442\u043E
|
|
2070
|
+
* \u0433\u0435\u043E\u043C\u0435\u0442\u0440\u0438\u0438 \u2014 \u043F\u0435\u0440\u0435\u0441\u0435\u0447\u0435\u043D\u0438\u0435 \u043B\u0443\u0447\u0430 \u0441 \u043A\u043E\u0440\u043E\u0431\u043A\u043E\u0439 \u0432 \u043E\u0441\u044F\u0445 \u0433\u0440\u0430\u043D\u0438.
|
|
2071
|
+
*/
|
|
2072
|
+
vec3 view = normalize(v_view);
|
|
2073
|
+
float viewN = dot(view, n);
|
|
2074
|
+
// \u0413\u0440\u0430\u043D\u044C \u043A \u043D\u0430\u043C \u043F\u043E\u0447\u0442\u0438 \u0440\u0435\u0431\u0440\u043E\u043C \u2014 \u043F\u0430\u0440\u0430\u043B\u043B\u0430\u043A\u0441 \u0443\u0445\u043E\u0434\u0438\u0442 \u0432 \u0431\u0435\u0441\u043A\u043E\u043D\u0435\u0447\u043D\u043E\u0441\u0442\u044C; \u043E\u0433\u0440\u0430\u043D\u0438\u0447\u0438\u0432\u0430\u0435\u043C.
|
|
2075
|
+
vec2 par = vec2(dot(view, t), view.z) / max(viewN, 0.25);
|
|
2076
|
+
|
|
2077
|
+
vec3 sun = -u_key_dir;
|
|
2078
|
+
float sunN = dot(sun, n);
|
|
2079
|
+
vec2 sunOff = vec2(0.0);
|
|
2080
|
+
if (sunN > 0.02) {
|
|
2081
|
+
// \u041F\u0440\u0435\u0434\u0435\u043B \u2014 \u0434\u0432\u043E\u0439\u043D\u0430\u044F \u0433\u043B\u0443\u0431\u0438\u043D\u0430 \u043E\u0442\u043A\u043E\u0441\u0430: \u0434\u0430\u043B\u044C\u0448\u0435 \u0442\u0435\u043D\u044C \u0437\u0430\u043D\u0438\u043C\u0430\u0435\u0442 \u043F\u043E\u043B-\u043E\u043A\u043D\u0430 \u0438 \u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044F \u0443\u0436\u0435 \u043D\u0435
|
|
2082
|
+
// \u0433\u043B\u0443\u0431\u0438\u043D\u043E\u0439, \u0430 \u0433\u0440\u044F\u0437\u043D\u044B\u043C \u043F\u044F\u0442\u043D\u043E\u043C \u043D\u0430 \u0441\u0442\u0435\u043A\u043B\u0435.
|
|
2083
|
+
float lim = u_window_recess * 2.0;
|
|
2084
|
+
sunOff = clamp(vec2(dot(sun, t), sun.z) / sunN * u_window_recess, -lim, lim);
|
|
2085
|
+
}
|
|
1808
2086
|
float lit = 0.0;
|
|
1809
2087
|
vec4 wall = v_wall.y > 0.5
|
|
1810
|
-
? facadePattern(albedo, v_wall, v_up, cls, v_tint, aa, lit)
|
|
2088
|
+
? facadePattern(albedo, v_wall, v_up, cls, v_tint, aa, sunOff, par, lit)
|
|
1811
2089
|
: vec4(albedo, 0.0);
|
|
1812
2090
|
albedo = mix(albedo, wall.rgb, detail);
|
|
1813
2091
|
glass = wall.a * detail;
|
|
@@ -1833,11 +2111,14 @@ void main() {
|
|
|
1833
2111
|
color += u_window_color * glow * 0.55;
|
|
1834
2112
|
|
|
1835
2113
|
float alpha = u_opacity * u_wall_color.a;
|
|
1836
|
-
|
|
2114
|
+
// \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.
|
|
2115
|
+
fragColor = vec4(applyFogAt(color, v_up) * alpha, alpha);
|
|
1837
2116
|
}
|
|
1838
|
-
`,
|
|
2117
|
+
`,ts=`#version 300 es
|
|
1839
2118
|
precision highp float;
|
|
1840
2119
|
|
|
2120
|
+
${Gn}
|
|
2121
|
+
|
|
1841
2122
|
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)
|
|
1842
2123
|
in float a_level; // \u043C\u0435\u0442\u0440\u044B \xD7 SURFACE_LEVEL_SCALE (64)
|
|
1843
2124
|
in vec3 a_normal;
|
|
@@ -1867,21 +2148,34 @@ void main() {
|
|
|
1867
2148
|
// \u043F\u043E\u043A\u0440\u0430\u0441\u0438\u0442 \u2014 \u0434\u0430\u0436\u0435 \u0443 \u043F\u043E\u043B\u0443\u043F\u0440\u043E\u0437\u0440\u0430\u0447\u043D\u043E\u0433\u043E \u0441\u043B\u043E\u044F.
|
|
1868
2149
|
vec2 pos = a_pos + a_bleed;
|
|
1869
2150
|
|
|
2151
|
+
/*
|
|
2152
|
+
* \u041D\u0430 \u0433\u043B\u043E\u0431\u0443\u0441\u0435 u_matrix \u2014 \u043A\u0430\u043C\u0435\u0440\u0430 \u0434\u043B\u044F \u041B\u041E\u041A\u0410\u041B\u042C\u041D\u042B\u0425 \u043A\u043E\u043E\u0440\u0434\u0438\u043D\u0430\u0442, \u043D\u0430 \u043F\u043B\u043E\u0441\u043A\u043E\u0439 \u043A\u0430\u0440\u0442\u0435 \u043F\u0440\u0438\u0432\u044B\u0447\u043D\u0430\u044F \u043C\u0430\u0442\u0440\u0438\u0446\u0430
|
|
2153
|
+
* \u0442\u0430\u0439\u043B\u0430. \u0420\u0430\u0437\u0432\u0438\u043B\u043A\u0430 \u0442\u0430 \u0436\u0435, \u0447\u0442\u043E \u0443 \u0437\u0430\u043B\u0438\u0432\u043A\u0438 \u0438 \u043B\u0438\u043D\u0438\u0439.
|
|
2154
|
+
*
|
|
2155
|
+
* \u041F\u043E\u0432\u0435\u0440\u0445\u043D\u043E\u0441\u0442\u0435\u0439 \u044D\u0442\u0430 \u0432\u0435\u0442\u043A\u0430 \u0434\u043E\u043B\u0433\u043E \u043D\u0435 \u043A\u0430\u0441\u0430\u043B\u0430\u0441\u044C, \u0438 \u0437\u0440\u044F: \u0432\u043E\u0434\u043E\u0439, \u0437\u0435\u043B\u0435\u043D\u044C\u044E \u0438 \u0437\u0430\u0441\u0442\u0440\u043E\u0439\u043A\u043E\u0439 \u0437\u0430\u043D\u044F\u0442\u044B \u043A\u0430\u043A \u0440\u0430\u0437
|
|
2156
|
+
* \u0441\u043B\u043E\u0438 \u0442\u0438\u043F\u0430 surface, \u0430 \u0440\u0438\u0441\u043E\u0432\u0430\u043B\u0438\u0441\u044C \u043E\u043D\u0438 \u043F\u043B\u043E\u0441\u043A\u043E\u0439 \u043C\u0430\u0442\u0440\u0438\u0446\u0435\u0439 \u2014 \u043D\u0430 \u0448\u0430\u0440\u0435 \u043E\u043A\u0435\u0430\u043D \u0432\u044B\u0445\u043E\u0434\u0438\u043B \u043F\u0440\u044F\u043C\u043E\u0443\u0433\u043E\u043B\u044C\u043D\u043E\u0439
|
|
2157
|
+
* \u0437\u0430\u043F\u043B\u0430\u0442\u043E\u0439, \u0430 \u0434\u0430\u043B\u044C\u043D\u0438\u0435 \u043C\u043E\u0440\u044F \u0432\u0438\u0441\u0435\u043B\u0438 \u0437\u0430 \u0434\u0438\u0441\u043A\u043E\u043C.
|
|
2158
|
+
*
|
|
2159
|
+
* \u0423\u0440\u043E\u0432\u0435\u043D\u044C \u043D\u0430 \u0448\u0430\u0440\u0435 \u043D\u0435 \u043F\u043E\u0434\u043D\u0438\u043C\u0430\u0435\u043C: \u0443 \u0441\u0444\u0435\u0440\u044B \xAB\u0432\u0432\u0435\u0440\u0445\xBB \u0441\u0432\u043E\u0451 \u0432 \u043A\u0430\u0436\u0434\u043E\u0439 \u0442\u043E\u0447\u043A\u0435, \u0430 \u043D\u0430 \u0437\u0443\u043C\u0430\u0445 \u0433\u043B\u043E\u0431\u0443\u0441\u0430
|
|
2160
|
+
* \u043F\u0440\u0438\u043F\u043E\u0434\u043D\u044F\u0442\u044B\u0439 \u043D\u0430 \u043C\u0435\u0442\u0440 \u043F\u0430\u0440\u043A \u0432\u0441\u0451 \u0440\u0430\u0432\u043D\u043E \u043D\u0435\u0440\u0430\u0437\u043B\u0438\u0447\u0438\u043C.
|
|
2161
|
+
*/
|
|
1870
2162
|
vec4 local = vec4(pos, level, 1.0);
|
|
1871
|
-
gl_Position =
|
|
2163
|
+
gl_Position = u_globe.x > 0.5
|
|
2164
|
+
? u_matrix * vec4(globeLocal(pos), 1.0)
|
|
2165
|
+
: u_matrix * local;
|
|
1872
2166
|
|
|
1873
2167
|
v_normal = a_normal;
|
|
1874
2168
|
v_kind = a_kind;
|
|
1875
2169
|
v_world = u_world_origin + pos * u_meters_per_unit;
|
|
1876
2170
|
v_shadow = u_shadow_matrix * local;
|
|
1877
2171
|
}
|
|
1878
|
-
`,
|
|
2172
|
+
`,os=`#version 300 es
|
|
1879
2173
|
precision highp float;
|
|
1880
2174
|
|
|
1881
|
-
${
|
|
1882
|
-
${
|
|
1883
|
-
${
|
|
1884
|
-
${
|
|
2175
|
+
${po}
|
|
2176
|
+
${br}
|
|
2177
|
+
${nt}
|
|
2178
|
+
${Rn}
|
|
1885
2179
|
|
|
1886
2180
|
in vec3 v_normal;
|
|
1887
2181
|
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
|
|
@@ -1930,7 +2224,7 @@ void main() {
|
|
|
1930
2224
|
|
|
1931
2225
|
fragColor = vec4(applyFog(color) * alpha, alpha);
|
|
1932
2226
|
}
|
|
1933
|
-
`,
|
|
2227
|
+
`,rs=`#version 300 es
|
|
1934
2228
|
precision highp float;
|
|
1935
2229
|
|
|
1936
2230
|
in vec2 a_pos; // \u044D\u043A\u0440\u0430\u043D\u043D\u044B\u0435 \u043F\u0438\u043A\u0441\u0435\u043B\u0438 (CSS)
|
|
@@ -1960,7 +2254,7 @@ void main() {
|
|
|
1960
2254
|
v_scale = a_scale;
|
|
1961
2255
|
v_fade = a_fade;
|
|
1962
2256
|
}
|
|
1963
|
-
|
|
2257
|
+
`,ns=`#version 300 es
|
|
1964
2258
|
precision highp float;
|
|
1965
2259
|
|
|
1966
2260
|
in vec2 v_tex;
|
|
@@ -2010,6 +2304,6 @@ void main() {
|
|
|
2010
2304
|
if (color.a <= 0.001) discard;
|
|
2011
2305
|
fragColor = color;
|
|
2012
2306
|
}
|
|
2013
|
-
`;var br=n=>n.kind==="symbol",el=n=>n.kind==="placement";function je(n,e,t,o){for(let r of n)for(let i=0;i+5<r.length;i+=6){let a=r[i],s=r[i+1],l=r[i+2],c=r[i+3],u=r[i+4],h=r[i+5];if(Ju(e,t,a,s,l,c,u,h)||o>0&&(Gn(e,t,a,s,l,c)<=o||Gn(e,t,l,c,u,h)<=o||Gn(e,t,u,h,a,s)<=o))return true}return false}function Ju(n,e,t,o,r,i,a,s){let l=(n-r)*(o-i)-(t-r)*(e-i),c=(n-a)*(i-s)-(r-a)*(e-s),u=(n-t)*(s-o)-(a-t)*(e-o),h=l<0||c<0||u<0,f=l>0||c>0||u>0;return !(h&&f)}function Gn(n,e,t,o,r,i){let a=r-t,s=i-o,l=a*a+s*s,c=l>0?Math.max(0,Math.min(1,((n-t)*a+(e-o)*s)/l)):0;return Math.hypot(n-(t+a*c),e-(o+s*c))}function On(n,e){let t=new DataView(n.vertices),o=new Uint32Array(n.indices),r=e.bounds(),i=(r.maxX-r.minX)/n.extent,a=new Float64Array(o.length*2);for(let s=0;s<o.length;s++){let l=o[s]*tt;a[s*2]=r.minX+t.getInt16(l,true)*i,a[s*2+1]=r.minY+t.getInt16(l+2,true)*i;}return a}function Wn(n,e,t){let o=new DataView(n.vertices),r=t.bounds(),i=(r.maxX-r.minX)/e,a=r.minX,s=r.minY,l=new Float64Array(n.indices.length*2);for(let c=0;c<n.indices.length;c++){let u=n.indices[c]*Ie;l[c*2]=a+o.getInt16(u,true)*i,l[c*2+1]=s+o.getInt16(u+2,true)*i;}return l}var Xu={stride:8,attribs:[{name:"a_pos",size:2,type:5126,offset:0}]},ju=40,Yu=10.5,tl=2.5,Zu=16,Qu=4,qu=7,po=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,i,a,s,l=false){this.count=0;let c=t.zoom,u=r.layers.filter(B=>B.type==="symbol"&&B.layout?.placement==="map"&&r.layerVisibleAt(B,c));if(!u.length)return;let h=t.center,f=ie(h.lng),d=ae(h.lat),p=t.worldSize>0?t.pixelsPerMeter/t.worldSize:0;if(!(p>0))return;let m=[];for(let B of u){let x=o.get(B.source??Y);if(!x)continue;let w=r.bucketKeyFor(B);if(w===null)continue;let _=B.layout?.showFor==="highlight";if(_&&!this.highlightFootprint)continue;let C=p*1.5,E=B.layout?.arrowUnits==="meters"?p:1/t.worldSize,D=z(B.layout?.arrowLength,c,ju)*E,M=z(B.layout?.arrowWidth,c,Yu)*E,H=z(B.layout?.arrowOutline,c,tl)*E,S=z(B.layout?.arrowGap,c,Zu)*E,L=z(B.layout?.arrowDotRadius,c,Qu)*E,F=z(B.layout?.arrowDotGap,c,qu)*E,T=zn(D,M,L,S-F),P=H>0?zn(D,M,L,S-F,H).outline:null,k={layer:B,verts:[],shape:T};for(let O of x.visibleTiles){let G=x.getTile(O)?.data?.buckets?.[w];if(!G||!br(G))continue;let R=new Int16Array(G.anchors),V=G.rotations?new Int16Array(G.rotations):null,j=O.bounds(),Z=(j.maxX-j.minX)/G.extent,ee=j.minX,be=j.minY;for(let te=0;te<R.length/2;te++){let X=ee+R[te*2]*Z,re=be+R[te*2+1]*Z;if(_&&!je(this.highlightFootprint,X,re,C))continue;let se=(V?V[te]:0)*Math.PI/180,q=Math.sin(se),U=-Math.cos(se),J=X-f-q*S,fe=re-d-U*S;P&&Nn(k,P,J,fe,q,U),Nn(k,T.outline,J,fe,q,U),this.count++;}}k.verts.length&&m.push(k);}if(!m.length)return;let y=m[0].shape,b=y.outline.length/2,g=[],A=[];for(let B of m){let x=g.length/2/b;for(let w of B.verts)g.push(w);A.push({layer:B.layer,first:x,count:B.verts.length/2/b});}if(this.ensureBuffers(e,g.length/2/b,y,a),!(!this.vao||!this.vbo)){this.vbo.update(new Uint8Array(new Float32Array(g).buffer)),i.use(),s?.(i),l&&i.setMat4("u_shadow_matrix",t.shadowObjectMatrix(f,d,0)),i.setMat4("u_matrix",t.objectMatrix(f,d,0)),e.setDepthTest(false),e.setDepthMask(false),e.setBlend("premultiplied"),e.setCull("none"),this.vao.bind();for(let B of A){let x=B.layer.paint,w=z(x.opacity,c,1),_=He(x.color,c,[.18,.45,.76,1]),C=He(x.haloColor,c,[1,1,1,1]),v=z(B.layer.layout?.arrowOutline,c,tl)>0;$u(e,i,B,C,_,w,v,this.indicesPerArrow);}e.bindVAO(null),e.setDepthTest(true);}}ensureBuffers(e,t,o,r){let i=o.outline.length/2;if(this.vao&&t<=this.capacity&&i===this.perArrow)return;this.vao?.destroy(),this.vbo?.destroy(),this.ibo?.destroy(),this.capacity=Math.max(256,Math.ceil(t*1.5)),this.perArrow=i,this.indicesPerArrow=o.indices.length,this.vbo=new ve(e,new Uint8Array(this.capacity*i*8),Xu,true);let a=new Uint32Array(this.capacity*o.indices.length);for(let s=0;s<this.capacity;s++){let l=s*i;for(let c=0;c<o.indices.length;c++)a[s*o.indices.length+c]=l+o.indices[c];}this.ibo=new ge(e,a),this.vao=new de(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 $u(n,e,t,o,r,i,a,s){let l=a?2:1;if(a){e.setVec4v("u_color",Fe([o[0],o[1],o[2],o[3]*i]));for(let c=0;c<t.count;c+=l)ol(n,t.first+c,s);}e.setVec4v("u_color",Fe([r[0],r[1],r[2],r[3]*i]));for(let c=a?1:0;c<t.count;c+=l)ol(n,t.first+c,s);}function ol(n,e,t){n.gl.drawElements(n.gl.TRIANGLES,t,n.gl.UNSIGNED_INT,e*t*4);}var rl=4,Vn=12;function zn(n,e,t,o,r=0){let i=n*.38,a=e*1.35,s=i*.3,l=e*.32,c=e/2,u=-n+l,h=[],f=(b,g)=>h.push(b,g);f(0,0),f(-i,a),f(-i+s,c),f(u,l);for(let b=1;b<rl;b++){let g=b/rl*Math.PI;f(u-Math.sin(g)*l,Math.cos(g)*l);}f(u,-l),f(-i+s,-c),f(-i,-a);let d=r>0?eh(h,r):h,p=Pe(h,void 0,2);if(t<=0)return {outline:d,indices:p};let m=d.length/2,y=t+r;for(let b=0;b<Vn;b++){let g=b/Vn*Math.PI*2;d.push(o+Math.cos(g)*y,Math.sin(g)*y);}for(let b=1;b<Vn-1;b++)p.push(m,m+b,m+b+1);return {outline:d,indices:p}}function eh(n,e){let t=n.length/2,o=0;for(let a=0;a<t;a++){let s=(a+1)%t;o+=n[a*2]*n[s*2+1]-n[s*2]*n[a*2+1];}let r=o<0?-1:1,i=[];for(let a=0;a<t;a++){let s=n[(a+t-1)%t*2],l=n[(a+t-1)%t*2+1],c=n[a*2],u=n[a*2+1],h=n[(a+1)%t*2],f=n[(a+1)%t*2+1],d=Math.hypot(c-s,u-l)||1,p=Math.hypot(h-c,f-u)||1,m=r*(u-l)/d,y=-r*(c-s)/d,b=r*(f-u)/p,g=-r*(h-c)/p,A=m+b,B=y+g,x=Math.hypot(A,B);if(x<1e-9){i.push(c,u);continue}A/=x,B/=x;let w=Math.min(1/Math.max(A*m+B*y,.35),3);i.push(c+A*e*w,u+B*e*w);}return i}function Nn(n,e,t,o,r,i){let a=-i,s=r;for(let l=0;l<e.length;l+=2){let c=e[l],u=e[l+1];n.verts.push(t+r*c+a*u,o+i*c+s*u);}}function th(n,e,t,o,r,i=0,a=0){let s=t*Math.PI/180,l={verts:[]};return Nn(l,zn(o,r,i,a).outline,n,e,Math.sin(s),-Math.cos(s)),l.verts}var oh=5;function nl(n,e){let t=1/(1<<e),o=(1<<e)-1;return [(n.x&o)*t,(n.y&o)*t,t]}var yr=class{constructor(){this.anisotropy=0;this.anisotropyPname=0;this.anisotropyChecked=false;}render(e,t,o,r,i,a,s,l=false){if(!a.size)return;let c=i.layers.filter(u=>u.type==="raster"&&!!u.overlay===l&&i.layerVisibleAt(u,s));if(c.length){r.use(),e.setDepthTest(false),e.setDepthMask(false),e.setBlend("premultiplied"),e.setCull("none"),r.setInt("u_image",0);for(let u of c){let h=a.get(u.source);if(!h)continue;let f=z(u.paint?.opacity,s,1);if(!(f<=.001)){r.setFloat("u_opacity",f),o.bind();for(let d of h.visibleTiles){let p=this.patchFor(e,h,d);p&&(e.bindTexture(0,p.texture),r.setVec3("u_uv_transform",p.uv[0],p.uv[1],p.uv[2]),r.setMat4("u_matrix",t.tileMatrix(d,1)),e.gl.drawElements(e.gl.TRIANGLES,6,e.gl.UNSIGNED_SHORT,0));}}}e.bindVAO(null);}}patchFor(e,t,o){let r=t.getTile(o),i=r&&r.state==="loaded"?this.textureFor(e,r):null;if(i)return {texture:i,uv:[0,0,1]};for(let a=1;a<=oh&&a<=o.z;a++){let s=o.scaledTo(o.z-a),l=t.getTile(s);if(!l||l.state!=="loaded")continue;let c=this.textureFor(e,l);if(c)return {texture:c,uv:nl(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,i=r.createTexture();if(!i)return null;e.bindTexture(0,i),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:i,destroy:()=>r.deleteTexture(i)};return t.texture=a,t.image.close(),t.image=null,i}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 rh="indoor-",mo=class{constructor(){this.parts=null;this.stamp="";this.cache=new W;this.box=null;this.hidden=new oe;this.collected=new oe;}get active(){return this.parts!==null}footprint(){return this.parts}get hiddenCount(){return this.hidden.size}sync(e,t,o){let r=[],i;for(let f of t.layers){if(!f.id.startsWith(rh)||f.type!=="fill"||!t.layerVisibleAt(f,o))continue;let d=t.bucketKeyFor(f);d&&(r.push(d),i??(i=e.get(f.source??Y)));}if(!r.length||!i){this.parts&&this.destroy();return}let a=r.join(",")+"|"+i.visibleTiles.map(f=>f.dataKey+(i.getTile(f)?.data?"+":"-")).join(",");if(a===this.stamp)return;this.stamp=a,this.free();let s=[],l=1/0,c=1/0,u=-1/0,h=-1/0;for(let f of i.visibleTiles){let d=i.getTile(f)?.data?.buckets;if(d)for(let p of r){let m=d[p];if(!m||m.kind!=="fill")continue;let y=On(m,f);s.push(y);for(let b=0;b<y.length;b+=2)y[b]<l&&(l=y[b]),y[b]>u&&(u=y[b]),y[b+1]<c&&(c=y[b+1]),y[b+1]>h&&(h=y[b+1]);}}this.parts=s.length?s:null,this.box=s.length?[l,c,u,h]:null,this.hidden.clear(),this.collected.clear();}collectHidden(e,t){let o=this.parts;if(!o||!e.featureIds)return;let r=new Uint32Array(e.indices),i=new Float64Array(e.featureIds),a=new DataView(e.vertices),s=t.bounds(),l=(s.maxX-s.minX)/e.extent,c=this.box,u=new W;for(let h=0;h*3<r.length;h++){let f=i[h];if(this.hidden.has(f))continue;let d=u.get(f);d||u.set(f,d=[1/0,1/0,-1/0,-1/0]);for(let p=0;p<3;p++){let m=r[h*3+p]*Ie,y=a.getInt16(m,true),b=a.getInt16(m+2,true);y<d[0]&&(d[0]=y),b<d[1]&&(d[1]=b),y>d[2]&&(d[2]=y),b>d[3]&&(d[3]=b);}}for(let[h,f]of u){let d=s.minX+(f[0]+f[2])/2*l,p=s.minY+(f[1]+f[3])/2*l;c&&(d<c[0]||d>c[2]||p<c[1]||p>c[3])||je(o,d,p,0)&&this.hidden.add(h);}}destroy(){this.parts=null,this.hidden.clear(),this.collected.clear(),this.box=null,this.stamp="",this.free();}free(){this.cache.forEach(e=>{e?.vao.destroy(),e?.ibo.destroy();}),this.cache.clear();}prepare(e,t){if(!this.parts)return;let o=this.hidden.size;for(let r of e.visibleTiles){if(this.collected.has(r.dataKey))continue;let i=e.getTile(r)?.data?.buckets?.[t];!i||i.kind!=="fill-extrusion"||(this.collected.add(r.dataKey),this.collectHidden(i,r));}this.hidden.size!==o&&this.free();}indicesFor(e,t,o,r,i,a){if(!this.parts)return null;let s=this.cache.get(r.dataKey);if(s!==void 0)return s;let l=t.data?.buckets?.[o];if(!l)return null;let c=null;if(l.kind==="fill-extrusion"&&l.featureIds&&this.hidden.size){let u=new Uint32Array(l.indices),h=new Float64Array(l.featureIds),f=[];for(let d=0;d*3<u.length;d++)this.hidden.has(h[d])||f.push(u[d*3],u[d*3+1],u[d*3+2]);if(f.length<u.length){let d=new ge(e,new Uint32Array(f));c={vao:new de(e,[{buffer:i,locations:a}],d),ibo:d,count:f.length};}}return this.cache.set(r.dataKey,c),c}};var il=35,nh=70,ih=.35,ah=.5,sh=1.1;function kt(n,e){let t=e.sky;if(!t.enabled||t.fogIntensity<=0)return {near:0,far:1/0,intensity:0,cutoff:1/0};let o=n.cameraToCenterDistance,r=_e((n.pitch-il)/(nh-il),0,1),i=t.fogRange[0]*(1-ih*r)*o,a=t.fogRange[1]*(1-ah*r)*o,s=Math.min(1,t.fogIntensity+(1-t.fogIntensity)*Math.min(1,r*2)),l=s>=.995?a*sh:1/0;return {near:i,far:a,intensity:s,cutoff:l}}function Kn(n,e,t,o){let r=o.x/Math.max(n.width,1)*2-1,i=1-o.y/Math.max(n.height,1)*2,a=null,s=new Float64Array(16),l=[0,0,0,0],c=[0,0,0,0];for(let u of e.visibleTiles){let h=e.getTile(u),f=h&&al(h,t);if(!f||!Ve(s,n.tileMatrix64(u,f.extent))||(he(l,s,[r,i,-1,1]),he(c,s,[r,i,1,1]),l[3]===0||c[3]===0))continue;let d=l[0]/l[3],p=l[1]/l[3],m=l[2]/l[3],y=c[0]/c[3]-d,b=c[1]/c[3]-p,g=c[2]/c[3]-m,A=ch(f,d,p,m,y,b,g);A&&(!a||A.t<a.distance)&&(a={featureId:A.featureId,tile:u,layerId:t,distance:A.t});}return a}function Un(n,e,t,o){let r=o.x/Math.max(n.width,1)*2-1,i=1-o.y/Math.max(n.height,1)*2,a=null,s=new Float64Array(16),l=[0,0,0,0],c=[0,0,0,0];for(let u of e.visibleTiles){let h=e.getTile(u);if(h)for(let f of t){let d=h.data?.buckets?.[f];if(!d||d.kind!=="fill"||!d.featureIds||!Ve(s,n.tileMatrix64(u,d.extent))||(he(l,s,[r,i,-1,1]),he(c,s,[r,i,1,1]),l[3]===0||c[3]===0))continue;let p=l[0]/l[3],m=l[1]/l[3],y=l[2]/l[3],b=c[2]/c[3]-y;if(Math.abs(b)<1e-9)continue;let g=-y/b;if(g<0||g>1)continue;let A=p+(c[0]/c[3]-p)*g,B=m+(c[1]/c[3]-m)*g,x=lh(d,A,B);x!==null&&(!a||g<a.distance)&&(a={featureId:x,tile:u,layerId:f,distance:g});}}return a}function lh(n,e,t){let o=new DataView(n.vertices),r=new Uint32Array(n.indices),i=new Float64Array(n.featureIds),a=l=>o.getInt16(l*tt,true),s=l=>o.getInt16(l*tt+2,true);for(let l=0;l*3<r.length;l++){let c=r[l*3],u=r[l*3+1],h=r[l*3+2],f=a(c),d=s(c),p=a(u),m=s(u),y=a(h),b=s(h),g=(e-p)*(d-m)-(f-p)*(t-m),A=(e-y)*(m-b)-(p-y)*(t-b),B=(e-f)*(b-d)-(y-f)*(t-d),x=g<0||A<0||B<0,w=g>0||A>0||B>0;if(!(x&&w))return i[l]}return null}function al(n,e){let t=n.data?.buckets?.[e];return !t||t.kind!=="fill-extrusion"||!t.featureIds?null:t}function ch(n,e,t,o,r,i,a){let s=new DataView(n.vertices),l=new Uint32Array(n.indices),c=new Float64Array(n.featureIds),u=m=>s.getInt16(m*Ie,true)/_t,h=m=>s.getInt16(m*Ie+2,true)/_t,f=m=>s.getUint16(m*Ie+4,true)/Et,d=1/0,p=-1;for(let m=0;m+2<l.length;m+=3){let y=l[m],b=l[m+1],g=l[m+2],A=u(y),B=h(y),x=f(y),w=u(b)-A,_=h(b)-B,C=f(b)-x,v=u(g)-A,E=h(g)-B,D=f(g)-x,M=i*D-a*E,H=a*v-r*D,S=r*E-i*v,L=w*M+_*H+C*S;if(L>-1e-9&&L<1e-9)continue;let F=1/L,T=e-A,P=t-B,k=o-x,O=(T*M+P*H+k*S)*F;if(O<0||O>1)continue;let N=P*C-k*_,G=k*w-T*C,R=T*_-P*w,V=(r*N+i*G+a*R)*F;if(V<0||O+V>1)continue;let j=(v*N+E*G+D*R)*F;j<0||j>1||j>=d||(d=j,p=c[m/3]??0);}return p>=0?{featureId:p,t:d}:null}function gr(n,e,t){let o=al(n,e);if(!o)return null;let r=new Uint32Array(o.indices),i=new Float64Array(o.featureIds),a=[];for(let s=0;s+2<r.length;s+=3)i[s/3]===t&&a.push(r[s],r[s+1],r[s+2]);return a.length?{vertices:o.vertices,indices:new Uint32Array(a)}:null}var Pt=24,Jn=8,fh=2,uh=12,Ar=8,Br=8;function bo(n){let e=0;for(let d of n)e+=d.length/2;if(e<2)return null;let t=(Ar+2)*2,o=e*t+n.length*(Br+2)*2+8,r=e*(Ar+2)*6+n.length*Br*6+24,i=new ArrayBuffer(o*Pt),a=new DataView(i),s=new Uint32Array(r),l=0,c=0,u=(d,p,m,y,b,g)=>{let A=l*Pt;return a.setFloat32(A,d,true),a.setFloat32(A+4,p,true),a.setFloat32(A+8,m,true),a.setFloat32(A+12,y,true),a.setFloat32(A+16,b,true),a.setFloat32(A+20,g,true),l++},h=(d,p,m,y)=>{s[c++]=d,s[c++]=p,s[c++]=y,s[c++]=d,s[c++]=y,s[c++]=m;},f=(d,p,m,y,b,g,A)=>{let B=u(d,p,0,0,0,A),x=u(d,p,m,y,1,A);for(let w=1;w<=Br;w++){let _=Math.PI*w/Br,C=m*Math.cos(_)+b*Math.sin(_),v=y*Math.cos(_)+g*Math.sin(_),E=u(d,p,C,v,1,A);s[c++]=B,s[c++]=x,s[c++]=E,x=E;}};for(let d of n){let p=hh(d),m=p.length/2;if(m<2)continue;let y=new Float64Array(m-1),b=new Float64Array(m-1);for(let w=0;w<m-1;w++){let _=p[w*2+2]-p[w*2],C=p[w*2+3]-p[w*2+1],v=Math.hypot(_,C)||1;y[w]=_/v,b[w]=C/v;}let g=0,A=-1,B=-1;for(let w=0;w<m;w++){let _=p[w*2],C=p[w*2+1];w>0&&(g+=Math.hypot(_-p[w*2-2],C-p[w*2-1]));let v=w>0?w-1:0,E=w<m-1?w:m-2,D=-b[v],M=y[v],H=-b[E],S=y[E],L=D+H,F=M+S,T=Math.hypot(L,F);T>1e-9?(L/=T,F/=T):(L=D,F=M);let P=L*H+F*S,k=P>1e-6?1/P:1/0,O=Math.acos(Math.min(1,Math.max(-1,y[v]*y[E]+b[v]*b[E])));if(!(O>uh*Math.PI/180)&&k<=fh){let G=u(_,C,L*k,F*k,1,g),R=u(_,C,-L*k,-F*k,-1,g);A>=0&&h(A,B,G,R),A=G,B=R;}else {let G=Math.max(1,Math.min(Ar,Math.ceil(O/(Math.PI/Ar)))),V=y[v]*b[E]-b[v]*y[E]>=0?1:-1,j=u(_,C,D,M,1,g),Z=u(_,C,-D,-M,-1,g);A>=0&&h(A,B,j,Z);for(let ee=1;ee<=G;ee++){let be=V*O*(ee/G),te=Math.cos(be),X=Math.sin(be),re=D*te-M*X,se=D*X+M*te,q=u(_,C,re,se,1,g),U=u(_,C,-re,-se,-1,g);h(j,Z,q,U),j=q,Z=U;}A=j,B=Z;}}let x=m-2;f(p[0],p[1],-b[0],y[0],-y[0],-b[0],0),f(p[(m-1)*2],p[(m-1)*2+1],-b[x],y[x],y[x],b[x],g);}return c?{vertices:i.slice(0,l*Pt),indices:s.slice(0,c),vertexCount:l}:null}function Xn(n){if(!n.length||n[0].length<6)return null;let e=[],t=[];for(let i=0;i<n[0].length;i++)e.push(n[0][i]);for(let i=1;i<n.length;i++)if(!(n[i].length<6)){t.push(e.length/2);for(let a=0;a<n[i].length;a++)e.push(n[i][a]);}let o=Pe(e,t.length?t:void 0,2);if(!o.length)return null;let r=new Uint32Array(o.length);for(let i=0;i<o.length;i+=3)r[i]=o[i],r[i+1]=o[i+2],r[i+2]=o[i+1];return {vertices:new Float32Array(e).buffer,indices:r,vertexCount:e.length/2}}function hh(n){let e=[];for(let t=0;t<n.length;t+=2){let o=n[t],r=n[t+1],i=e.length;i>=2&&e[i-2]===o&&e[i-1]===r||e.push(o,r);}return e}var yo=5126,dh={stride:Jn,attribs:[{name:"a_pos",size:2,type:yo,offset:0}]},Yn={stride:Pt,attribs:[{name:"a_pos",size:2,type:yo,offset:0},{name:"a_extrude",size:2,type:yo,offset:8},{name:"a_side",size:1,type:yo,offset:16},{name:"a_dist",size:1,type:yo,offset:20}]},jn=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();}},ph=(n,e)=>[n[0],n[1],n[2],n[3]*e],go=class{constructor(){this.objects=[];this.markers=[];this.gpu=new W;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,i,a,s,l=false,c=false){if(!this.objects.length||c&&!this.objects.some(p=>p.ghostOpacity>0))return;this.objects.length>1&&this.objects.sort((p,m)=>p.zIndex-m.zIndex);let u=e.gl.drawingBufferWidth,h=t.width>0?u/t.width:1,f=t.worldSize*h,d=null;for(let p of this.objects){if(!p.visible)continue;let m=p.ghostOpacity;if(c&&m<=0)continue;let y=this.gpuFor(e,p,r,a);if(!y)continue;let b=l?t.shadowObjectMatrix(p.originX,p.originY,p.altitude):null,g=t.objectMatrix(p.originX,p.originY,p.altitude);for(let{part:A,vao:B,ibo:x}of y.parts){if(c&&(A.kind!=="line"||A.arrow))continue;let w=c?ph(A.color,m):A.color;if(A.kind==="fill")d!==o&&(o.use(),s?.(o),d=o),o.setVec4v("u_color",Fe(w)),b&&o.setMat4("u_shadow_matrix",b),o.setMat4("u_matrix",g);else {d!==i&&(i.use(),s?.(i),d=i);let _=A.width/2*h,C=f>1e-9?1/f:1;if(i.setVec4v("u_color",Fe(w)),i.setFloat("u_half_width",_),i.setFloat("u_offset",(A.offset??0)*h),i.setFloat("u_aa",1),i.setFloat("u_units_per_px",C),i.setFloat("u_units_to_px",f),i.setInt("u_pattern",c?0:A.dashArray?1:A.arrow?2:0),A.dashArray){let[v,E]=A.dashArray;i.setVec2("u_dash",v*h,(v+E)*h);}if(A.arrow){i.setVec4v("u_arrow_color",Fe(A.arrowColor??[1,1,1,1]));let v=(A.arrowSize??5)*h;i.setVec3("u_arrow",(A.arrowPeriod??46)*h,Math.max(v*.4,1),Math.min(v,_*.72));}b&&i.setMat4("u_shadow_matrix",b),i.setMat4("u_matrix",g);}B.bind(),e.gl.drawElements(e.gl.TRIANGLES,x.count,x.type,0);}}e.bindVAO(null);}hitTest(e,t,o=4){let r=e.worldSize,i=(a,s,l)=>e.worldPxToPoint(ie(a)*r,ae(s)*r,l);for(let a=this.objects.length-1;a>=0;a--){let s=this.objects[a];if(s.visible&&s.hitTest(t,i,o))return s}return null}boundsOf(e){let t=1/0,o=1/0,r=-1/0,i=-1/0;for(let a of e.rings())for(let s of a){let l=$(s);l.lng<t&&(t=l.lng),l.lng>r&&(r=l.lng),l.lat<o&&(o=l.lat),l.lat>i&&(i=l.lat);}return isFinite(t)?{west:t,south:o,east:r,north:i}:null}gpuFor(e,t,o,r){let i=this.gpu.get(t.id);if(i&&i.revision===t.revision)return i;i?.destroy();let a=[];for(let l of t.build()){let c=l.kind==="fill"?dh:Yn,u=l.kind==="fill"?o:r,h=new ve(e,new Uint8Array(l.mesh.vertices),c),f=new ge(e,l.mesh.indices),d=new de(e,[{buffer:h,locations:u}],f);a.push({part:l,vao:d,vbo:h,ibo:f});}let s=new jn(t.revision,a);return this.gpu.set(t.id,s),a.length?s: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 Cr=32,gh=1179937895,Ah=1313821514,Bh=5130562,Ch={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},vh={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT4:16};async function Zn(n){let{json:e,bin:t}=hl(n),o=await wh(e,t);return pl(e,t,o)}function xh(n){let{json:e,bin:t}=hl(n);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 pl(e,t,null)}function hl(n){let e=new DataView(n);if(e.getUint32(0,true)!==gh)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<=n.byteLength;){let i=e.getUint32(r,true),a=e.getUint32(r+4,true),s=r+8;a===Ah?t=JSON.parse(new TextDecoder().decode(new Uint8Array(n,s,i))):a===Bh&&(o=new Uint8Array(n,s,i)),r=s+i+(4-i%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 wh(n,e){let t=n.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 Promise.resolve().then(()=>(ul(),fl));await r.ready;let i=new Map;for(let a of o){let s=t[a].extensions.EXT_meshopt_compression,l=s.byteOffset??0,c=e.subarray(l,l+s.byteLength),u=new Uint8Array(s.count*s.byteStride);r.decodeGltfBuffer(u,s.count,s.byteStride,c,s.mode,s.filter??"NONE"),i.set(a,u);}return i}function dl(n){let e=K();if(n.matrix){for(let C=0;C<16;C++)e[C]=n.matrix[C];return e}Ue(e);let[t,o,r]=n.translation??[0,0,0],[i,a,s,l]=n.rotation??[0,0,0,1],[c,u,h]=n.scale??[1,1,1],f=i+i,d=a+a,p=s+s,m=i*f,y=i*d,b=i*p,g=a*d,A=a*p,B=s*p,x=l*f,w=l*d,_=l*p;return e[0]=(1-(g+B))*c,e[1]=(y+_)*c,e[2]=(b-w)*c,e[4]=(y-_)*u,e[5]=(1-(m+B))*u,e[6]=(A+x)*u,e[8]=(b+w)*h,e[9]=(A-x)*h,e[10]=(1-(m+g))*h,e[12]=t,e[13]=o,e[14]=r,e}var _h={5120:127,5121:255,5122:32767,5123:65535};function Eh(n){let e=n[0],t=n[1],o=n[2],r=n[4],i=n[5],a=n[6],s=n[8],l=n[9],c=n[10],u=e*(i*c-a*l)-r*(t*c-o*l)+s*(t*a-o*i);if(Math.abs(u)<1e-20)return [1,0,0,0,1,0,0,0,1];let h=1/u;return [(i*c-a*l)*h,(a*s-r*c)*h,(r*l-i*s)*h,(o*l-t*c)*h,(e*c-o*s)*h,(t*s-e*l)*h,(t*a-o*i)*h,(o*r-e*a)*h,(e*i-t*r)*h]}function pl(n,e,t){let o=C=>{let v=t?.get(C);if(v)return v;let E=n.bufferViews?.[C];if(!E)return null;let D=E.byteOffset??0;return e.subarray(D,D+E.byteLength)},r=[],i=[],a=[],s=[],l=[],c=[1/0,1/0,1/0],u=[-1/0,-1/0,-1/0],h=C=>{if(C===void 0)return null;let v=n.accessors?.[C];if(!v)return null;let E=vh[v.type]??1,D=new Float64Array(v.count*E),M=v.bufferView!==void 0?n.bufferViews?.[v.bufferView]:void 0;if(!M||v.bufferView===void 0)return {data:D,components:E};let H=o(v.bufferView);if(!H)return {data:D,components:E};let S=Ch[v.componentType]??4,L=M.extensions?.EXT_meshopt_compression,F=L?L.byteStride:M.byteStride,T=F&&F>0?F:S*E,P=v.byteOffset??0,k=new DataView(H.buffer,H.byteOffset,H.byteLength),O=v.normalized?_h[v.componentType]??1:1;for(let N=0;N<v.count;N++)for(let G=0;G<E;G++){let R=P+N*T+G*S,V;switch(v.componentType){case 5120:V=k.getInt8(R);break;case 5121:V=k.getUint8(R);break;case 5122:V=k.getInt16(R,true);break;case 5123:V=k.getUint16(R,true);break;case 5125:V=k.getUint32(R,true);break;default:V=k.getFloat32(R,true);}D[N*E+G]=O===1?V:Math.max(V/O,-1);}return {data:D,components:E}},f=(C,v,E=-1)=>{if(C.mode!==void 0&&C.mode!==4)return;let D=h(C.attributes.POSITION);if(!D)return;let M=h(C.attributes.NORMAL),H=h(C.attributes.TEXCOORD_0),S=h(C.indices),L=r.length/3,F=D.data.length/3,T=Eh(v),k=(C.material!==void 0?n.materials?.[C.material]:void 0)?.pbrMetallicRoughness?.baseColorTexture?.extensions?.KHR_texture_transform,O=k?{ox:k.offset?.[0]??0,oy:k.offset?.[1]??0,sx:k.scale?.[0]??1,sy:k.scale?.[1]??1,rot:k.rotation??0}:null;for(let X=0;X<F;X++){let re=D.data[X*3],se=D.data[X*3+1],q=D.data[X*3+2],U=v[0]*re+v[4]*se+v[8]*q+v[12],J=v[1]*re+v[5]*se+v[9]*q+v[13],fe=v[2]*re+v[6]*se+v[10]*q+v[14];if(r.push(U,J,fe),U<c[0]&&(c[0]=U),J<c[1]&&(c[1]=J),fe<c[2]&&(c[2]=fe),U>u[0]&&(u[0]=U),J>u[1]&&(u[1]=J),fe>u[2]&&(u[2]=fe),M){let ne=M.data[X*3],xe=M.data[X*3+1],Te=M.data[X*3+2],we=T[0]*ne+T[3]*xe+T[6]*Te,Po=T[1]*ne+T[4]*xe+T[7]*Te,Ro=T[2]*ne+T[5]*xe+T[8]*Te,Go=Math.hypot(we,Po,Ro);Go>1e-12?(we/=Go,Po/=Go,Ro/=Go):(we=0,Po=1,Ro=0),i.push(we,Po,Ro);}else i.push(0,1,0);let le=H?H.data[X*2]:0,ue=H?H.data[X*2+1]:0;if(O){if(O.rot!==0){let ne=Math.cos(O.rot),xe=Math.sin(O.rot),Te=ne*le+xe*ue,we=-xe*le+ne*ue;le=Te,ue=we;}le=le*O.sx+O.ox,ue=ue*O.sy+O.oy;}a.push(le,ue);}let N=s.length;if(S)for(let X=0;X<S.data.length;X++)s.push(L+S.data[X]);else for(let X=0;X<F;X++)s.push(L+X);let G=C.material!==void 0?n.materials?.[C.material]:void 0,R=G?.pbrMetallicRoughness,V=R?.metallicFactor!==void 0||R?.roughnessFactor!==void 0,j=R?.baseColorFactor??[1,1,1,1],Z=R?.baseColorTexture?.index,ee=Z!==void 0?n.textures?.[Z]?.source:void 0,be=G?.emissiveFactor??[0,0,0],te=G?.extensions?.KHR_materials_emissive_strength?.emissiveStrength??1;l.push({indexOffset:N,indexCount:s.length-N,baseColor:[j[0],j[1],j[2],j[3]??1],metallic:V?R?.metallicFactor??1:0,roughness:V?R?.roughnessFactor??1:1,emissive:[be[0]*te,be[1]*te,be[2]*te],texture:ee??-1,doubleSided:G?.doubleSided===true,blend:G?.alphaMode==="BLEND",alphaCutoff:G?.alphaMode==="MASK"?G.alphaCutoff??.5:.02,node:E});},d=n.skins?.length?null:Fh(n,h),p=d?d.nodes:null,m=(C,v,E,D)=>{let M=n.nodes?.[C];if(!M)return;let H=dl(M),S=K();Ee(S,v,H);let L=K(),F=D,T=p?.get(C);if(T?(T.parentNode=D,T.parent=E.slice(),Ue(L),F=C):Ee(L,E,H),M.mesh!==void 0)for(let k of n.meshes?.[M.mesh]?.primitives??[])f(k,L,F);let P=M.extensions?.KHR_lights_punctual?.light;if(P!==void 0){let k=n.extensions?.KHR_lights_punctual?.lights?.[P],O=k?.type;if(k&&(O==="point"||O==="spot"||O==="directional")){let N=-S[8],G=-S[9],R=-S[10],V=Math.hypot(N,G,R)||1,j=k.spot?.innerConeAngle??0,Z=k.spot?.outerConeAngle??Math.PI/4;y.push({type:O,color:[k.color?.[0]??1,k.color?.[1]??1,k.color?.[2]??1],intensity:k.intensity??1,range:k.range??0,position:[S[12],S[13],S[14]],direction:[N/V,G/V,R/V],cosInner:Math.cos(j),cosOuter:Math.cos(Z)});}}for(let k of M.children??[])m(k,S,L,F);},y=[],b=K();Ue(b);let g=K();Ue(g);let A=n.scenes?.[n.scene??0]?.nodes??n.nodes?.map((C,v)=>v)??[];for(let C of A)m(C,b,g,-1);let B=[];for(let C of n.images??[]){if(C.bufferView===void 0){B.push(new Uint8Array(0));continue}let v=o(C.bufferView);B.push(v?v.slice():new Uint8Array(0));}let x=r.length/3,w=new ArrayBuffer(x*Cr),_=new Float32Array(w);for(let C=0;C<x;C++){let v=C*8;_[v]=r[C*3],_[v+1]=r[C*3+1],_[v+2]=r[C*3+2],_[v+3]=i[C*3],_[v+4]=i[C*3+1],_[v+5]=i[C*3+2],_[v+6]=a[C*2],_[v+7]=a[C*2+1];}return isFinite(c[0])||(c[0]=c[1]=c[2]=0,u[0]=u[1]=u[2]=0),{vertices:w,indices:new Uint32Array(s),primitives:l,images:B,min:c,max:u,animation:d,lights:y}}function Fh(n,e){let t=n.animations?.[0];if(!t||!t.channels.length)return null;let o=new Map,r=0;for(let i of t.channels){let a=i.target.node,s=i.target.path;if(a===void 0||s!=="translation"&&s!=="rotation"&&s!=="scale")continue;let l=t.samplers[i.sampler];if(!l)continue;let c=e(l.input),u=e(l.output);if(!c||!u||!c.data.length)continue;let h=s==="rotation"?4:3,f=l.interpolation==="CUBICSPLINE",d=c.data.length,p=new Float32Array(d*h);for(let y=0;y<d;y++){let b=f?(y*3+1)*h:y*h;for(let g=0;g<h;g++)p[y*h+g]=u.data[b+g];}let m=o.get(a)??{parentNode:-1,parent:Ue(K()),base:Mh(n.nodes?.[a]),channels:[]};m.channels.push({path:s,times:Float32Array.from(c.data),values:p,step:l.interpolation==="STEP"}),o.set(a,m),r=Math.max(r,c.data[d-1]);}return o.size?{duration:r||1,nodes:o}:null}function Mh(n){let e=n?.translation,t=n?.rotation,o=n?.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 Qn(n,e,t,o){let r=n.nodes.get(e);if(!r)return Ue(o);let i=K();Dh(r,t,i);let a=K();if(Ee(a,r.parent,i),r.parentNode<0)return ml(o,a);let s=K();return Qn(n,r.parentNode,t,s),Ee(o,s,a)}var ml=(n,e)=>{for(let t=0;t<16;t++)n[t]=e[t];return n};function Dh(n,e,t){let o=[...n.base.t],r=[...n.base.r],i=[...n.base.s];for(let a of n.channels){let s=a.times.length,l=a.path==="rotation"?4:3,c=0;for(;c<s-1&&a.times[c+1]<e;)c++;let u=Math.min(c+1,s-1),h=a.times[u]-a.times[c],f=a.step||h<=0?0:Math.min(Math.max((e-a.times[c])/h,0),1),d=c*l,p=u*l;if(a.path==="rotation"){let m=0;for(let g=0;g<4;g++)m+=a.values[d+g]*a.values[p+g];let y=m<0?-1:1,b=0;for(let g=0;g<4;g++)r[g]=a.values[d+g]*(1-f)+a.values[p+g]*y*f,b+=r[g]*r[g];b=Math.sqrt(b)||1;for(let g=0;g<4;g++)r[g]/=b;}else {let m=a.path==="translation"?o:i;for(let y=0;y<3;y++)m[y]=a.values[d+y]*(1-f)+a.values[p+y]*f;}}return ml(t,dl({translation:o,rotation:r,scale:i}))}var Le=5126,Sh=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),bl={stride:Cr,attribs:[{name:"a_pos",size:3,type:Le,offset:0},{name:"a_normal",size:3,type:Le,offset:12},{name:"a_tex",size:2,type:Le,offset:24}]},$n=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);}},qn=256,vr=41,yl={stride:vr*4,attribs:[{name:"a_i_m0",size:4,type:Le,offset:0,divisor:1},{name:"a_i_m1",size:4,type:Le,offset:16,divisor:1},{name:"a_i_m2",size:4,type:Le,offset:32,divisor:1},{name:"a_i_m3",size:4,type:Le,offset:48,divisor:1},{name:"a_i_s0",size:4,type:Le,offset:64,divisor:1},{name:"a_i_s1",size:4,type:Le,offset:80,divisor:1},{name:"a_i_s2",size:4,type:Le,offset:96,divisor:1},{name:"a_i_s3",size:4,type:Le,offset:112,divisor:1},{name:"a_i_n0",size:3,type:Le,offset:128,divisor:1},{name:"a_i_n1",size:3,type:Le,offset:140,divisor:1},{name:"a_i_n2",size:3,type:Le,offset:152,divisor:1}]},Ao=2,Rt=16,nt=class{constructor(){this.models=[];this.gpu=new W;this.counted=new Set;this.instBuffer=null;this.instScratch=new Float32Array(qn*vr);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,i,a,s=0,l){if(this.models.length){this.drawnInstanced.clear(),l&&this.renderInstanced(e,t,l.shader,l.locations,i,a),o.use(),i(o),o.setInt("u_base_texture",Ao);for(let c of this.models){if(this.drawnInstanced.has(c)||!this.inView(t,c))continue;let u=c.visible&&c.fade>0?this.gpuFor(e,c,r):null;if(!u||!c.mesh)continue;let h=c.fade<1;o.setFloat("u_opacity",c.fade);let f=c.matrixFor(t);o.setMat4("u_matrix",f),o.setMat3("u_normal_matrix",c.normalMatrix());let d=a?this.shadowMatrix(t,c):null;this.uploadLights(o,c.mesh);let p=c.cameraInModelSpace(t);o.setVec3("u_camera_model",p[0],p[1],p[2]),o.setFloat("u_reflect",1),u.vao.bind();for(let m of [false,true])if(!(h&&!m))for(let y of c.mesh.primitives){if(!h&&y.blend!==m)continue;o.setMat4("u_matrix",y.node>=0?c.matrixForNode(t,y.node,s):f),d&&o.setMat4("u_shadow_matrix",y.node>=0?this.shadowMatrixForNodeAt(t,c,y.node,s):d);let b=y.texture>=0?u.textures[y.texture]:null;o.setFloat("u_has_texture",b?1:0),o.setFloat("u_alpha_cutoff",y.alphaCutoff),b&&e.bindTexture(Ao,b),o.setVec4v("u_base_color",y.baseColor),o.setVec3("u_emissive",y.emissive[0],y.emissive[1],y.emissive[2]),o.setFloat("u_metallic",y.metallic),o.setFloat("u_roughness",y.roughness),e.setCull(y.doubleSided?"none":"back"),e.setBlend(m?"premultiplied":"none"),e.setDepthMask(!m),e.gl.drawElements(e.gl.TRIANGLES,y.indexCount,e.gl.UNSIGNED_INT,y.indexOffset*4);}}e.bindVAO(null),e.setCull("back"),e.setBlend("premultiplied"),e.setDepthMask(true);}}renderInstanced(e,t,o,r,i,a){let s=new W;for(let c of this.models){if(!c.visible||c.fade<1||!c.mesh||!c.isLoaded||!this.inView(t,c)||c.mesh.primitives.some(h=>h.blend||h.node>=0))continue;let u=s.get(c.url);u?u.push(c):s.set(c.url,[c]);}let l=false;o.setFloat("u_reflect",0);for(let[,c]of s){if(c.length<2)continue;let u=this.gpuFor(e,c[0],r);if(!u||!c[0].mesh)continue;this.instBuffer||(this.instBuffer=new ve(e,this.instScratch,yl,true)),u.instVao||(u.instVao=new de(e,[{buffer:u.vbo,locations:r},{buffer:this.instBuffer,locations:r}],u.ibo)),l||(o.use(),i(o),o.setInt("u_base_texture",Ao),o.setFloat("u_opacity",1),l=true);let h=c[0].mesh;for(let f=0;f<c.length;f+=qn){let d=Math.min(qn,c.length-f);for(let p=0;p<d;p++){let m=c[f+p],y=p*vr;this.instScratch.set(m.matrixFor(t),y);let b=a?this.shadowMatrix(t,m):Sh;this.instScratch.set(b,y+16),this.instScratch.set(m.normalMatrix(),y+32),this.drawnInstanced.add(m);}this.instBuffer.update(this.instScratch.subarray(0,d*vr)),e.bindVAO(u.instVao.vao);for(let p of h.primitives){let m=p.texture>=0?u.textures[p.texture]:null;o.setFloat("u_has_texture",m?1:0),o.setFloat("u_alpha_cutoff",p.alphaCutoff),m&&e.bindTexture(Ao,m),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("none"),e.setDepthMask(true),e.gl.drawElementsInstanced(e.gl.TRIANGLES,p.indexCount,e.gl.UNSIGNED_INT,p.indexOffset*4,d);}}}l&&e.bindVAO(null);}uploadLights(e,t){let o=this.lightPacks.get(t);if(!o){let r=t.lights.filter(u=>u.type!=="directional"),i=r.length<=Rt?r:[...r].sort((u,h)=>h.intensity-u.intensity).slice(0,Rt),a=new Float32Array(Rt*4),s=new Float32Array(Rt*4),l=new Float32Array(Rt*4),c=new Float32Array(Rt*4);i.forEach((u,h)=>{let f=h*4;a[f]=u.position[0],a[f+1]=u.position[1],a[f+2]=u.position[2],a[f+3]=u.range,s[f]=u.color[0]*u.intensity,s[f+1]=u.color[1]*u.intensity,s[f+2]=u.color[2]*u.intensity,s[f+3]=u.type==="spot"?1:0,l[f]=u.direction[0],l[f+1]=u.direction[1],l[f+2]=u.direction[2],c[f]=u.cosInner,c[f+1]=u.cosOuter;}),o={count:i.length,pos:a,color:s,dir:l,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(),i=t.boundingRadiusM();return e.isSphereVisible(r.x,r.y,t.altitude+i*.5,i)}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 i of this.models){let a=i.visible&&i.fade>.5?this.gpuFor(e,i,r):null;if(!a||!i.mesh)continue;let s=this.shadowMatrix(t,i);o.setMat4("u_matrix",s),a.vao.bind();for(let l of i.mesh.primitives)l.blend||(o.setMat4("u_matrix",l.node>=0?this.shadowMatrixForNode(t,i,l.node):s),e.gl.drawElements(e.gl.TRIANGLES,l.indexCount,e.gl.UNSIGNED_INT,l.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,i){let a=t.origin();return t.matrixInSpaceForNode(e.shadowObjectMatrix(a.x,a.y,t.altitude),o,r,i)}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 i=e.gl,a=new ve(e,new Uint8Array(t.mesh.vertices),bl),s=new ge(e,t.mesh.indices),l=new de(e,[{buffer:a,locations:o}],s),c=t.bitmaps.map(h=>{if(!h)return null;let f=i.createTexture();return f?(e.bindTexture(Ao,f),i.texImage2D(i.TEXTURE_2D,0,i.RGBA,i.RGBA,i.UNSIGNED_BYTE,h),i.generateMipmap(i.TEXTURE_2D),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,i.LINEAR_MIPMAP_LINEAR),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MAG_FILTER,i.LINEAR),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_S,i.REPEAT),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_T,i.REPEAT),f):null}),u=new $n(l,a,s,c);return u.users=1,this.counted.add(t),this.gpu.set(t.url,u),u}static get layout(){return bl}static get instanceLayout(){return yl}destroy(e){for(let t of this.gpu.values())t.destroy(e);this.gpu.clear(),this.models=[];}};var ei=4,gl=new oe;function Ih(n){gl.has(n)||(gl.add(n),console.warn(`[osmgl] ${n}`));}var Lh=.5,Th=.01,Hh=300,ti=127,oi=128,Bo=5120,_r=5121,Co=5122,Al=5123,vo=5126,kh={stride:8,attribs:[{name:"a_pos",size:2,type:vo,offset:0}]},ri={stride:tt,attribs:[{name:"a_pos",size:2,type:Co,offset:0}]},Bl={stride:ot,attribs:[{name:"a_p0",size:2,type:Co,offset:0},{name:"a_p1",size:2,type:Co,offset:4},{name:"a_corner",size:2,type:Bo,offset:8},{name:"a_ground",size:2,type:Bo,offset:10},{name:"a_dist",size:1,type:vo,offset:12},{name:"a_width",size:1,type:vo,offset:16}]},xr={stride:Ie,attribs:[{name:"a_pos",size:2,type:Co,offset:0},{name:"a_height",size:1,type:Al,offset:4},{name:"a_tint",size:1,type:_r,normalized:true,offset:6},{name:"a_ao",size:1,type:_r,normalized:true,offset:7},{name:"a_normal",size:3,type:Bo,normalized:true,offset:8},{name:"a_kind",size:1,type:_r,offset:11},{name:"a_wall",size:3,type:Al,offset:12}]},Ph={flat:0,water:1,foliage:2,sand:3,asphalt:4},Rh=[1,9,14,26,3],Cl={stride:St,attribs:[{name:"a_pos",size:2,type:vo,offset:0},{name:"a_level",size:1,type:Co,offset:8},{name:"a_normal",size:3,type:Bo,normalized:true,offset:10},{name:"a_kind",size:1,type:_r,offset:13},{name:"a_bleed",size:2,type:Bo,offset:14}]},ni=class{constructor(e,t,o,r,i,a,s=r){this.vao=e;this.buffer=t;this.ibo=o;this.indexCount=r;this.indexType=i;this.extent=a;this.capIndexOffset=s;this.firstDrawTime=0;}destroy(){this.vao.destroy(),this.buffer.destroy(),this.ibo.destroy();}},xl={enabled:false,resolution:1024,strength:.75,color:"#5a6b86",bias:.25},xo=class{constructor(){this.fill=null;this.surface=null;this.surfaceLocs=new W;this.line=null;this.building=null;this.depth=null;this.groundShadow=null;this.sky=null;this.raster=null;this.rasterLayer=new yr;this.globeBody=null;this.globeClip=null;this.globeMesh=null;this.quad=null;this.fillLocs=new W;this.lineLocs=new W;this.objectLine=null;this.objectLineLocs=new W;this.buildingLocs=new W;this.shadows={...xl};this.shadowTarget=null;this.shadowPlaceholder=null;this.fog=null;this.shadowActive=false;this.materialTime=0;this.materialAnimating=false;this.stencilIds=new W;this.patternScale=1;this.detailScale=1;this.reliefScale=1;this.allowShadows=true;this.highlight=null;this.highlightGpu=new W;this.highlightKey="";this.groundArrows=new po;this.highlightTris=new W;this.fillHighlightGpu=new W;this.fillHighlightKey="";this.footprintKey="";this.highlightFill=null;this.indoorMask=new mo;this.hiddenBuildings=new Set;this.hiddenVenues=new Set;this.hiddenVenueLayer=null;this.hiddenCut=new W;this.hiddenStamp="";this.shadowDepthPerMeter=1;this.shadowTexelMeters=0;this.growDurationMs=350;this.symbols=null;this.objects=null;this.models=new nt;this.model=null;this.modelInstanced=null;this.modelDepth=null;this.modelLocs=new W;this.modelInstLocs=new W;}get indoorOpen(){return this.indoorMask.active}syncHiddenStamp(){let e=o=>[...o].sort((r,i)=>r-i).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,i,a){if(!a||!a.size)return null;let s=r+"|"+o,l=this.hiddenCut.get(s);if(l!==void 0&&(l===null||l.vbo===i))return l;l&&(l.vao.destroy(),l.ibo.destroy());let c=t.data?.buckets?.[o];if(!c||c.kind!=="fill-extrusion"||!c.featureIds)return null;let u=new Uint32Array(c.indices),h=new Float64Array(c.featureIds),f=[];for(let p=0;p*3<u.length;p++)a.has(h[p])||f.push(u[p*3],u[p*3+1],u[p*3+2]);let d=null;if(f.length<u.length){let p=new ge(e,new Uint32Array(f));d={vao:new de(e,[{buffer:i,locations:this.buildingLocs}],p),ibo:p,count:f.length,vbo:i};}return this.hiddenCut.set(s,d),d}init(e){this.symbols?.init(e),this.fill=new Ae(e,"fill",zs,Ns),this.surface=new Ae(e,"surface",Zs,Qs),this.line=new Ae(e,"line",Ks,Us),this.objectLine=new Ae(e,"objectLine",Js,Xs),this.building=new Ae(e,"buildings",js,Ys),this.depth=new Ae(e,"depth",Ls,Pn),this.groundShadow=new Ae(e,"groundShadow",Ws,Vs),this.sky=new Ae(e,"sky",Ps,Rs),this.raster=new Ae(e,"raster",Gs,Os),this.globeBody=new Ae(e,"globeBody",Ms,Ds),this.globeClip=new Ae(e,"globeClip",Ss,Is),this.globeMesh=Gh(e,this.globeBody),this.model=new Ae(e,"model",Ts,Rn),this.modelInstanced=new Ae(e,"model-instanced",Hs,Rn),this.modelDepth=new Ae(e,"modelDepth",ks,Pn);for(let i of nt.layout.attribs)this.modelLocs.set(i.name,this.model.attribLocation(i.name));for(let i of [...nt.layout.attribs,...nt.instanceLayout.attribs])this.modelInstLocs.set(i.name,this.modelInstanced.attribLocation(i.name));this.shadowPlaceholder=Es(e);let t=new W([["a_pos",this.groundShadow.attribLocation("a_pos")]]),o=new ve(e,new Float32Array([0,0,1,0,1,1,0,1]),kh),r=new ge(e,new Uint16Array([0,1,2,0,2,3]));this.quad={vao:new de(e,[{buffer:o,locations:t}],r),vbo:o,ibo:r};for(let i of ri.attribs)this.fillLocs.set(i.name,this.fill.attribLocation(i.name));for(let i of Cl.attribs)this.surfaceLocs.set(i.name,this.surface.attribLocation(i.name));for(let i of Bl.attribs)this.lineLocs.set(i.name,this.line.attribLocation(i.name));for(let i of Yn.attribs)this.objectLineLocs.set(i.name,this.objectLine.attribLocation(i.name));for(let i of xr.attribs)this.buildingLocs.set(i.name,this.building.attribLocation(i.name));}render(e,t,o,r,i,a=new W){if(!this.fill||!this.line||!this.building)return false;let s=t.zoom,l=false;this.materialTime=i/1e3,this.materialAnimating=false,this.fog=kt(t,r),this.patternScale=zo/Math.max(Ge(t.center.lat),1);let c=p=>o.get(p.source??Y);this.syncHighlightFootprint(o,r),this.indoorMask.sync(o,r,s),this.syncHiddenStamp(),this.models.advanceTransitions(),this.renderShadowMap(e,t,o,r,i),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,s),this.drawTileStencil(e,t,o),e.setDepthTest(t.globeActive),e.setDepthFunc("lequal"),e.setDepthMask(false),e.setBlend("premultiplied"),e.setCull("none");let u=p=>p.type==="line"&&z(p.paint.elevation,s,0)!==0,h=new Set;for(let p of r.layers){if(p.type==="raster"||p.type==="fill-extrusion"||p.type==="symbol"||p.overlay||u(p)||!r.layerVisibleAt(p,s))continue;let m=c(p);if(m){if(p.type==="line"&&p.network){if(h.has(p.network))continue;h.add(p.network),this.drawNetwork(e,t,r,c,p.network,s,y=>!y.overlay&&!u(y)&&r.layerVisibleAt(y,s));continue}if(p.type==="surface"){if(!this.flattened(m,r,p))continue;this.drawFill(e,t,m,r,p,s);continue}p.type==="fill"?this.drawFill(e,t,m,r,p,s):this.drawLine(e,t,m,r,p,s);}}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,s))continue;let m=c(p);m&&(this.flattened(m,r,p)||this.drawSurface(e,t,m,r,p,s));}e.setStencilTest(false),e.setDepthMask(false),e.setBlend("premultiplied"),e.setCull("none"),e.setDepthTest(false);let f=new Set;for(let p of r.layers){if(p.type==="raster"||!u(p)||p.overlay||!r.layerVisibleAt(p,s))continue;let m=c(p);if(m){if(p.type==="line"&&p.network){if(f.has(p.network))continue;f.add(p.network),this.drawNetwork(e,t,r,c,p.network,s,y=>!y.overlay&&u(y)&&r.layerVisibleAt(y,s));continue}this.drawLine(e,t,m,r,p,s);}}e.setDepthTest(true),e.setDepthMask(true),e.setCull("back");for(let p of r.layers){if(p.type!=="fill-extrusion"||!r.layerVisibleAt(p,s))continue;let m=c(p);m&&(this.drawBuildings(e,t,m,r,p,s,i)&&(l=true),this.drawHighlight(e,t,m,r,p,s));}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,i/1e3,this.modelInstanced?{shader:this.modelInstanced,locations:this.modelInstLocs}:void 0),(this.models.hasAnimated||this.models.hasTransitions)&&(l=true)),e.setDepthTest(false),e.setDepthMask(false),e.setCull("none");for(let p of r.layers){if(p.type==="raster"||!p.overlay||p.type==="symbol"||p.type==="fill-extrusion"||!r.layerVisibleAt(p,s))continue;let m=c(p);if(m){if(p.type==="surface"){this.flattened(m,r,p)?this.drawFill(e,t,m,r,p,s):this.drawSurface(e,t,m,r,p,s),e.setDepthTest(false),e.setDepthMask(false),e.setCull("none");continue}p.type==="fill"?this.drawFill(e,t,m,r,p,s):this.drawLine(e,t,m,r,p,s);}}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,s,true);let d=r.layers.filter(p=>p.type==="line"&&z(p.paint.ghostOpacity,s,0)>.001&&r.layerVisibleAt(p,s));if(d.length){e.setDepthTest(true),e.setDepthFunc("greater"),e.setDepthMask(false),e.setBlend("premultiplied"),e.setCull("none");for(let p of d){let m=c(p);m&&this.drawLine(e,t,m,r,p,s,z(p.paint.ghostOpacity,s,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),l||this.materialAnimating}renderShadowMap(e,t,o,r,i){if(this.shadowPlaceholder&&e.bindTexture(ei,this.shadowPlaceholder),this.shadowActive=false,!this.shadows.enabled||!this.allowShadows||!this.depth)return;let a=r.layers.filter(h=>h.type==="fill-extrusion"&&!h.overlay&&r.layerVisibleAt(h,t.zoom));if(!a.length&&this.models.isEmpty)return;this.shadowTarget?this.shadowTarget.resize(this.shadows.resolution):this.shadowTarget=new uo(e,this.shadows.resolution);let s=r.light;if(t.updateShadow(wr(s.keyAzimuth,s.keyAltitude),Hh),!t.shadowReady)return;let l=this.shadowTarget;l.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 u=this.depth;u.use();for(let h of a){let f=o.get(h.source??Y);if(!f)continue;let d=r.bucketKeyFor(h);if(d===null)continue;let p=z(h.paint.heightScale,t.zoom,1);(h.source??Y)===Y&&this.indoorMask.prepare(f,d);for(let m of f.visibleTiles){if(!this.drawsTile(t,r,h,m))continue;let y=f.getTile(m),b=y&&this.bucketFor(e,y,d,xr,this.buildingLocs,"fill-extrusion");if(!b)continue;u.setFloat("u_height_scale",this.growScale(b,i,!f.warm)*p),u.setMat4("u_matrix",t.shadowTileMatrix(m,b.extent));let g=(h.source??Y)===Y,A=this.cutHidden(e,y,d,m.dataKey,b.buffer,this.hiddenFor(d,g)),B=g?A??this.indoorMask.indicesFor(e,y,d,m,b.buffer,this.buildingLocs):A;B?(B.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,B.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=i/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),l.bindTexture(ei),this.shadowDepthPerMeter=t.shadowDepthPerMeter(),this.shadowTexelMeters=Math.abs(t.shadowTexelWorldSize(l.size))/(t.pixelsPerMeter||1),this.shadowActive=true;}drawGlobeBody(e,t,o){if(!t.globeActive||!this.globeBody||!this.globeMesh)return;let r=this.globeBody;r.use(),this.applyGlobeUniforms(r,t),r.setMat4("u_matrix",t.localMatrix());let i=o.background;r.setVec3("u_body_color",i[0],i[1],i[2]),Ye(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],i=[0,0,0,0];if(he(i,t.localProjMatrix,r),i[3]<=1e-6)return;let a=this.globeClip;a.use(),a.setFloat("u_center_depth",i[2]/i[3]),o.colorMask(false,false,false,false),e.setDepthTest(true),e.setDepthMask(true),e.setDepthFunc("always"),this.quad.vao.bind(),o.drawElements(o.TRIANGLES,6,o.UNSIGNED_SHORT,0),o.colorMask(true,true,true,true),e.bindVAO(null);}drawSky(e,t,o){if(!this.sky||!this.quad||!o.sky.enabled)return;let r=this.sky;r.use(),Ye(r,"u_sky_color",o.sky.skyColor),Ye(r,"u_horizon_color",o.sky.horizonColor);let i=t.width>0?e.gl.drawingBufferWidth/t.width:1,a=t.horizonScreenY(),s=(t.height-a)*i,l=Math.max(a,1)*i,c=Math.min(l*.5,t.height*i*.1);r.setVec3("u_sky_params",s,o.sky.horizonBlend*l,c);let u=t.globeActive?1-t.globeFlatMix:0;if(r.setVec2("u_space",u,o.sky.starIntensity),u>.001){Ye(r,"u_space_color",o.sky.spaceColor),Ye(r,"u_atmo_color",o.sky.atmosphereColor);let h=t.globeDisc();r.setVec4("u_globe_disc",h.dir[0],h.dir[1],h.dir[2],h.angle);let[f,d,p,m]=t.localRayCorners();r.setVec3("u_ray_tl",f[0],f[1],f[2]),r.setVec3("u_ray_tr",d[0],d[1],d[2]),r.setVec3("u_ray_bl",p[0],p[1],p[2]),r.setVec3("u_ray_br",m[0],m[1],m[2]);}e.setDepthTest(false),e.setDepthMask(false),e.setBlend("premultiplied"),e.setCull("none"),this.quad.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,6,e.gl.UNSIGNED_SHORT,0),e.bindVAO(null);}applyGlobeUniforms(e,t){if(!t.globeActive){e.setVec4("u_globe",0,0,0,0);return}let o=t.globeBasis,r=t.worldSize;e.setVec4("u_globe",1,t.globeFlatMix,t.globeRadiusPx,r),e.setVec2("u_globe_center",t.centerPointPx.x/r,t.centerPointPx.y/r);let i=t.globeCamera();e.setVec4("u_globe_cam",i.dir[0],i.dir[1],i.dir[2],i.horizonCos),e.setMat3("u_globe_basis",[o.east[0],o.south[0],o.up[0],o.east[1],o.south[1],o.up[1],o.east[2],o.south[2],o.up[2]]);}applyTileMatrix(e,t,o,r){if(t.globeActive){let i=o.bounds();e.setVec3("u_tile_merc",i.minX,i.minY,(i.maxX-i.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??kt(t,o);if(r.intensity<=0){e.setVec3("u_fog_range",0,1,0);return}Ye(e,"u_fog_color",o.sky.horizonColor),e.setVec3("u_fog_range",r.near,r.far,r.intensity);}drawsTile(e,t,o,r){let i=this.fog;if(!i)return true;let a=e.distanceToTile(r);return a>i.cutoff?false:t.layerVisibleAt(o,e.detailZoom(a))}earthDepthLevel(e,t){let o=0;for(let i of e.layers)i.type==="surface"?o=Math.min(o,(i.elevation-(i.bevelDrop??0))*this.reliefScale):i.type==="line"&&(o=Math.min(o,z(i.paint.elevation,t.zoom,0)*this.reliefScale));let r=Math.max(Lh/Math.max(t.pixelsPerMeter,1e-9),Th);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,ti);}drawTileStencil(e,t,o){this.stencilIds.clear();let r=o.get(Y);if(!r||!this.fill||!this.quad)return;let i=r.visibleTiles;if(!i.length||i.length>ti)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 s=this.fill;s.use(),s.setVec4("u_globe",0,0,0,0),s.setInt("u_material",0),s.setVec2("u_world_origin",0,0),s.setVec4("u_color",0,0,0,1),s.setFloat("u_elevation",0),this.quad.vao.bind();let l=0;for(let c of i)l++,this.stencilIds.set(c.dataKey,l),a.stencilFunc(a.ALWAYS,l,ti),s.setMat4("u_matrix",t.tileMatrix(c,1)),a.drawElements(a.TRIANGLES,6,a.UNSIGNED_SHORT,0);e.bindVAO(null),e.setColorMask(true),a.stencilOp(a.KEEP,a.KEEP,a.KEEP),e.setStencilTest(false);}drawEarthDepth(e,t,o,r){if(!this.fill||!this.quad)return;let i=o.get(Y);if(!i)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 s=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 l=new Float32Array(16);for(let c of i.visibleTiles){let u=t.tileMatrix(c,1);l.set(u);for(let h=0;h<4;h++)l[12+h]+=s*u[8+h];a.setMat4("u_matrix",l),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 i=o.get(Y);if(!i)return;let a=this.groundShadow;a.use(),this.applyShadowUniforms(a),this.applyFogUniforms(a,t,r);let s=r.light,[,,l]=wr(s.keyAzimuth,s.keyAltitude),c=Math.max(-l,0),u=ye(s.ambientColor),h=ye(s.keyColor),f=[0,0,0];for(let d=0;d<3;d++){let p=u[d]*s.ambientIntensity,m=h[d]*s.keyIntensity*c;f[d]=p>0?p/(p+m):1;}a.setVec3("u_shadow_ground",f[0],f[1],f[2]),a.setFloat("u_ground_ndotl",c),e.setBlend("multiply"),e.setDepthTest(false),e.setDepthMask(false),e.setCull("none"),this.quad.vao.bind();for(let d of i.visibleTiles)a.setMat4("u_shadow_matrix",t.shadowTileMatrix(d,1)),a.setMat4("u_matrix",t.tileMatrix(d,1)),e.gl.drawElements(e.gl.TRIANGLES,6,e.gl.UNSIGNED_SHORT,0);e.setBlend("premultiplied");}applyShadowUniforms(e){if(e.setInt("u_shadow_map",ei),!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 i=ye(this.shadows.color);e.setVec3("u_shadow_color",i[0],i[1],i[2]);}get shadowsActive(){return this.shadowActive}applyTileScale(e,t,o){let r=Or(t.z)/this.patternScale;e.setFloat("u_meters_per_unit",r/o);let[i,a]=Oi(t.z,t.x,t.y);e.setVec2("u_world_origin",i/this.patternScale,a/this.patternScale);}applyMaterial(e,t,o){let r=t.paint&&"material"in t.paint?t.paint.material:void 0,i=this.detailScale<=0?0:Ph[r??"flat"]??0;if(e.setInt("u_material",i),i===0)return;let a=t.paint,s=z(a.materialStrength,o,1)*this.detailScale,l=z(a.materialScale,o,Rh[i]),c=z(a.materialSpeed,o,i===1?1:0);e.setVec4("u_material_params",s,l,c,this.materialTime),c>0&&s>.004&&(this.materialAnimating=true);}drawFill(e,t,o,r,i,a){let s=this.fill,l=r.colorAt(i,a),c=z(i.paint?.opacity,a,1);if(c<=.001)return;s.use(),this.applyFogUniforms(s,t,r),this.applyGlobeUniforms(s,t),this.applyLight(s,r),this.applyMaterial(s,i,a),s.setVec4v("u_color",Fe([l[0],l[1],l[2],l[3]*c]));let u=r.bucketKeyFor(i);if(u!==null){for(let h of o.visibleTiles){if(!this.drawsTile(t,r,i,h))continue;let f=o.getTile(h),d=f&&this.bucketFor(e,f,u,ri,this.fillLocs,"fill");d&&(this.clipToTile(e,h),this.shadowActive&&s.setMat4("u_shadow_matrix",t.shadowTileMatrix(h,d.extent)),this.applyTileScale(s,h,d.extent),this.applyTileMatrix(s,t,h,d.extent),d.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,d.indexCount,d.indexType,0));}e.setStencilTest(false);}}drawLine(e,t,o,r,i,a,s=0,l){let c=this.line,u=r.colorAt(i,a),h=z(i.paint.opacity,a,1)*(s||1),f=z(i.paint.width,a,1);if(h<=.001||f<=.01)return;let d=e.gl.drawingBufferWidth,p=e.gl.drawingBufferHeight,m=t.width>0?d/t.width:1,y=f/2*m;c.use(),this.applyFogUniforms(c,t,r),this.applyGlobeUniforms(c,t),this.applyLight(c,r),this.applyMaterial(c,i,a),c.setVec4v("u_color",Fe([u[0],u[1],u[2],u[3]*h])),c.setFloat("u_center_w",t.cameraToCenterDistance);let b=z(i.paint.offset,a,0)*m,g=Math.max(z(i.paint.blur,a,0),0)*m;c.setFloat("u_elevation",z(i.paint.elevation,a,0)*this.reliefScale),c.setFloat("u_relief",this.reliefScale),c.setVec2("u_viewport",d,p);let A=i.paint.dashArray,B=i.paint.arrow===true,x=i.paint.arrowStyle,w=B&&(x==="head"||x==="headOnly"),_=B&&x==="dash";if(c.setInt("u_pattern",_?5:A?1:x==="headOnly"&&B?4:w?3:B?2:0),A){let[v,E]=A;c.setVec2("u_dash",v*m,(v+E)*m);}if(B){let v=He(i.paint.arrowColor,a,[1,1,1,1]);c.setVec4v("u_arrow_color",Fe(v));let E=z(i.paint.arrowPeriod,a,46)*m,D=z(i.paint.arrowSize,a,5)*m;if(_){let M=z(i.paint.arrowGap,a,24)*m,H=Math.max(E-M,1),S=Math.min(D,H),L=z(i.paint.arrowShaft,a,2)*m,F=z(i.paint.arrowHead,a,4)*m,T=z(i.paint.arrowOutline,a,0)*m;c.setVec4("u_arrow",L,S,F,H),c.setVec2("u_dash",T,E);}else w?c.setVec4("u_arrow",E,D,y,0):c.setVec4("u_arrow",E,Math.max(D*.4,1),Math.min(D,y*.72),0);}let C=r.bucketKeyFor(i);if(C!==null)for(let v of o.visibleTiles){if(!this.drawsTile(t,r,i,v))continue;let E=o.getTile(v);if(!E)continue;let D=i.network?l!==void 0?[Ke(i.id,l)]:(E.data?.levels??[]).map(M=>Ke(i.id,M)):[C];for(let M of D){let H=this.bucketFor(e,E,M,Bl,this.lineLocs,"line");if(!H)continue;let S=v.bounds(),L=(S.maxX-S.minX)*t.worldSize/H.extent*m;c.setFloat("u_tile_to_px",L);let F=L>1e-6?1/L:1;c.setFloat("u_half_width",y*F),c.setFloat("u_blur",g*F),c.setFloat("u_meters_to_units",t.pixelsPerMeter*F),c.setFloat("u_width_from_data",i.paint.widthFromData===true?1:0),c.setFloat("u_width_extra",z(i.paint.widthExtra,a,0)*F),c.setFloat("u_offset",b*F),c.setFloat("u_tile_per_px",F),this.applyTileScale(c,v,H.extent),this.shadowActive&&c.setMat4("u_shadow_matrix",t.shadowTileMatrix(v,H.extent)),this.applyTileMatrix(c,t,v,H.extent),H.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,H.indexCount,H.indexType,0);}}}drawNetwork(e,t,o,r,i,a,s){let l=o.layers.filter(u=>u.type==="line"&&u.network===i&&s(u));if(!l.length)return;let c=new Set;for(let u of l){let h=r(u);if(h)for(let f of h.visibleTiles){let d=h.getTile(f);for(let p of d?.data?.levels??[])c.add(p);}}if(c.size)for(let u of [...c].sort((h,f)=>h-f))for(let h of l){let f=r(h);f&&this.drawLine(e,t,f,o,h,a,0,u);}}drawHighlight(e,t,o,r,i,a){let s=this.highlight;if(!s||!this.building||s.layerId!==i.id)return;let l=`${i.id}/${s.featureId}`;this.highlightKey!==l&&(this.disposeHighlight(),this.highlightKey=l);let c=ye(s.color)??[.31,.79,.5,1],u=this.building;u.use(),this.applyShadowUniforms(u),this.applyFogUniforms(u,t,r),this.applyLight(u,r),u.setVec4v("u_wall_color",[c[0],c[1],c[2],1]),u.setVec4v("u_roof_color",[c[0],c[1],c[2],1]),u.setFloat("u_opacity",s.opacity),u.setFloat("u_ao_strength",z(i.paint.aoStrength,a,.4)),u.setFloat("u_tint_variation",0),u.setFloat("u_facade_detail",0),u.setFloat("u_window_glow",0),u.setFloat("u_roof_variation",0),u.setFloat("u_height_scale",z(i.paint.heightScale,a,1)),e.setDepthFunc("lequal"),e.setDepthMask(false),e.setBlend("alpha");for(let h of o.visibleTiles){let f=o.getTile(h);if(!f)continue;let d=f.data?.buckets?.[i.id];if(!d)continue;let p=h.dataKey,m=this.highlightGpu.get(p);if(m===void 0){let y=gr(f,i.id,s.featureId);if(y){let b=new ve(e,new Uint8Array(y.vertices),xr),g=new ge(e,y.indices);m={vao:new de(e,[{buffer:b,locations:this.buildingLocs}],g),vbo:b,ibo:g,count:y.indices.length};}else m=null;this.highlightGpu.set(p,m);}m&&(this.applyTileScale(u,h,d.extent),this.shadowActive&&u.setMat4("u_shadow_matrix",t.shadowTileMatrix(h,d.extent)),u.setMat4("u_matrix",t.tileMatrix(h,d.extent)),m.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,m.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 i=t.layers.find(l=>l.id===o.layerId),a=e.get(i?.source??Y);if(!a)return;let s=new oe;for(let l of a.visibleTiles){if(s.add(l.dataKey),this.highlightTris.has(l.dataKey))continue;let c=a.getTile(l),u=c?.data?.buckets?.[o.layerId];if(!c||!u)continue;let h=gr(c,o.layerId,o.featureId);h&&this.highlightTris.set(l.dataKey,Wn(h,u.extent,l));}for(let l of [...this.highlightTris.keys()])s.has(l)||this.highlightTris.delete(l);}drawFillHighlight(e,t,o,r){let i=this.highlightFill,a=this.fill;if(!i||!a)return;let s=r.layers.find(f=>f.id===i.layerId),l=s?o.get(s.source??Y):void 0;if(!s||!l)return;let c=i.bucketKey,u=ye(i.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",Fe([u[0],u[1],u[2],i.opacity])),e.setDepthTest(false),e.setDepthMask(false),e.setBlend("premultiplied"),e.setCull("none");let h=e.gl;e.setStencilTest(true),h.stencilFunc(h.NOTEQUAL,oi,oi),h.stencilOp(h.KEEP,h.KEEP,h.REPLACE),h.stencilMask(oi);for(let f of l.visibleTiles){let d=l.getTile(f),p=d?.data?.buckets?.[c];if(!d||!p||p.kind!=="fill"||!p.featureIds)continue;let m=this.fillHighlightFor(e,p,f,i.featureId,c);m&&(a.setMat4("u_matrix",t.tileMatrix(f,p.extent)),m.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,m.count,e.gl.UNSIGNED_INT,0));}e.setStencilTest(false),h.stencilOp(h.KEEP,h.KEEP,h.KEEP),h.stencilMask(255),e.bindVAO(null);}fillHighlightFor(e,t,o,r,i){let a=`${i}/${r}/${o.dataKey}`;this.fillHighlightKey!==`${i}/${r}`&&(this.fillHighlightGpu.forEach(f=>{f?.vao.destroy(),f?.ibo.destroy(),f?.vbo.destroy();}),this.fillHighlightGpu.clear(),this.fillHighlightKey=`${i}/${r}`);let s=this.fillHighlightGpu.get(a);if(s!==void 0)return s;let l=new Uint32Array(t.indices),c=new Float64Array(t.featureIds),u=[];for(let f=0;f*3<l.length;f++)c[f]===r&&u.push(l[f*3],l[f*3+1],l[f*3+2]);let h=null;if(u.length){let f=new ve(e,new Uint8Array(t.vertices),ri),d=new ge(e,new Uint32Array(u));h={vao:new de(e,[{buffer:f,locations:this.fillLocs}],d),vbo:f,ibo:d,count:u.length};}return this.fillHighlightGpu.set(a,h),h}highlightFootprint(){return this.highlight&&this.highlightTris.size?[...this.highlightTris.values()]:this.indoorMask.footprint()}drawSurface(e,t,o,r,i,a){let s=this.surface,l=r.colorAt(i,a,[.7,.8,.7,1]),c=z(i.paint.opacity,a,1);if(c<=.001)return;s.use(),this.applyShadowUniforms(s),this.applyFogUniforms(s,t,r),this.applyLight(s,r),this.applyMaterial(s,i,a),s.setVec4v("u_color",l),s.setFloat("u_opacity",c),s.setFloat("u_side_shade",z(i.paint.sideShade,a,.12));let u=i.elevation<(i.base??0),h=i.paint.sideColor?He(i.paint.sideColor,a,l):l;s.setVec3("u_side_color",h[0],h[1],h[2]),s.setFloat("u_side_light",z(i.paint.sideLight,a,u?1:0)),s.setFloat("u_relief",this.reliefScale);let f=r.bucketKeyFor(i);if(f===null)return;let d=c>=1&&!i.overlay;e.setDepthMask(d),e.setBlend(d?"none":"premultiplied"),e.setCull("none");let p=[];for(let b of o.visibleTiles){if(!this.drawsTile(t,r,i,b))continue;let g=o.getTile(b),A=g&&this.bucketFor(e,g,f,Cl,this.surfaceLocs,"surface");A&&p.push({id:b,bucket:A});}let m=(b,g)=>{this.clipToTile(e,b),this.applyTileScale(s,b,g.extent),this.shadowActive&&s.setMat4("u_shadow_matrix",t.shadowTileMatrix(b,g.extent)),s.setMat4("u_matrix",t.tileMatrix(b,g.extent)),g.vao.bind();},y=p.filter(({bucket:b})=>b.capIndexOffset<b.indexCount);if(y.length){e.setColorMask(false),e.setDepthMask(true);for(let{id:b,bucket:g}of y){m(b,g);let A=g.indexType===e.gl.UNSIGNED_INT?4:2;e.gl.drawElements(e.gl.TRIANGLES,g.indexCount-g.capIndexOffset,g.indexType,g.capIndexOffset*A);}e.setColorMask(true),e.setDepthMask(d);}for(let{id:b,bucket:g}of p)m(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,i,a,s){let l=this.building,c=r.colorAt(i,a,[.86,.84,.8,1]),u=i.paint.roofColor?r.colorAt({...i,paint:{...i.paint,color:i.paint.roofColor}},a,c):c,h=z(i.paint.opacity,a,1);if(h<=.001)return false;l.use(),this.applyShadowUniforms(l),this.applyFogUniforms(l,t,r),l.setVec4v("u_wall_color",c),l.setVec4v("u_roof_color",u),l.setFloat("u_opacity",h),l.setFloat("u_ao_strength",z(i.paint.aoStrength,a,.4)),l.setFloat("u_tint_variation",z(i.paint.tintVariation,a,.07));let f=(B,x)=>i.paint[B]?r.colorAt({...i,paint:{...i.paint,color:i.paint[B]}},a,x):x,d=f("windowColor",[.62,.71,.8,1]),p=f("windowFrameColor",[c[0]*1.1,c[1]*1.1,c[2]*1.1,1]);l.setVec3("u_window_color",d[0],d[1],d[2]),l.setVec3("u_window_frame",p[0],p[1],p[2]),l.setFloat("u_facade_detail",z(i.paint.facadeDetail,a,1)*this.detailScale),l.setFloat("u_window_glow",z(i.paint.windowGlow,a,0)),l.setFloat("u_floor_height",z(i.paint.floorHeight,a,3.2)),l.setFloat("u_roof_variation",z(i.paint.roofVariation,a,.3)),this.applyLight(l,r);let m=h>=1;e.setDepthMask(m),e.setBlend(m?"none":"premultiplied");let y=z(i.paint.heightScale,a,1),b=false,g=r.bucketKeyFor(i);if(g===null)return b;let A=(i.source??Y)===Y;A&&this.indoorMask.prepare(o,g);for(let B of o.visibleTiles){if(!this.drawsTile(t,r,i,B))continue;let x=o.getTile(B),w=x&&this.bucketFor(e,x,g,xr,this.buildingLocs,"fill-extrusion");if(!w)continue;let _=this.growScale(w,s,!o.warm);_<1&&(b=true),l.setFloat("u_height_scale",_*y),this.applyTileScale(l,B,w.extent),this.shadowActive&&l.setMat4("u_shadow_matrix",t.shadowTileMatrix(B,w.extent)),l.setMat4("u_matrix",t.tileMatrix(B,w.extent));let v=this.cutHidden(e,x,g,B.dataKey,w.buffer,this.hiddenFor(g,A))??(x&&A?this.indoorMask.indicesFor(e,x,g,B,w.buffer,this.buildingLocs):null);v?(v.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,v.count,e.gl.UNSIGNED_INT,0)):(w.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,w.indexCount,w.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?Oh(Math.max(r,0)):1}applyLight(e,t){let o=t.light;Ye(e,"u_ambient_color",o.ambientColor),e.setFloat("u_ambient_intensity",o.ambientIntensity);let[r,i,a]=wr(o.keyAzimuth,o.keyAltitude);e.setVec3("u_key_dir",r,i,a),Ye(e,"u_key_color",o.keyColor),e.setFloat("u_key_intensity",o.keyIntensity);let[s,l,c]=wr(o.fillAzimuth,o.fillAltitude);e.setVec3("u_fill_dir",s,l,c),Ye(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 i of e.visibleTiles){let a=e.getTile(i)?.data?.buckets?.[r];if(a)return a.kind==="fill"}return false}bucketFor(e,t,o,r,i,a){let s=t.buckets.get(o);if(s)return s;let l=t.data?.buckets?.[o];if(!l||l.kind==="symbol"||l.kind==="placement")return null;if(l.kind!==a)return Ih(`\u0441\u043B\u043E\u0439 ${o}: \u0432 \u0442\u0430\u0439\u043B\u0435 \u043C\u0435\u0448 \xAB${l.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 ve(e,new Uint8Array(l.vertices),r),u=new ge(e,new Uint32Array(l.indices)),h=new de(e,[{buffer:c,locations:i}],u),f=new ni(h,c,u,u.count,u.type,l.extent,l.capIndexOffset??u.count);return t.buckets.set(o,f),f}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;}},vl=new W;function Gh(n,e){let r=new Float32Array(4290),i=0;for(let f=0;f<=32;f++){let d=(f/32-.5)*Math.PI;for(let p=0;p<=64;p++)r[i++]=p/64*2*Math.PI-Math.PI,r[i++]=d;}let a=new Uint16Array(2048*6),s=0;for(let f=0;f<32;f++)for(let d=0;d<64;d++){let p=f*65+d,m=p+64+1;a[s++]=p,a[s++]=p+1,a[s++]=m,a[s++]=p+1,a[s++]=m+1,a[s++]=m;}let l={stride:8,attribs:[{name:"a_lnglat",size:2,type:vo,offset:0}]},c=new W([["a_lnglat",e.attribLocation("a_lnglat")]]),u=new ve(n,r,l),h=new ge(n,a);return {vao:new de(n,[{buffer:u,locations:c}],h),vbo:u,ibo:h,count:a.length}}function Ye(n,e,t){let o=vl.get(t);o||(o=ye(t),vl.set(t,o)),n.setVec3(e,o[0],o[1],o[2]);}function wr(n,e){let t=n*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 Oh(n){let o=n-1;return 1+2.20158*o*o*o+1.20158*o*o}var Er=1,wo=class{constructor(e=1024){this.entries=new W;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 i=this.entries.get(e);if(i)return i;if(this.full||o>this.size)return null;if(this.shelfX+o+Er>this.size&&(this.shelfY+=this.shelfHeight+Er,this.shelfX=0,this.shelfHeight=0),this.shelfY+r+Er>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 s=0;s<r;s++){let l=s*o,c=(a.y+s)*this.size+a.x;this.data.set(t.subarray(l,l+o),c);}return this.shelfX+=o+Er,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 ii=.75,Eo=8,Ce=3,Ze=24,Gt=256,wl=255,_o=class{constructor(e,t="Noto Sans Regular"){this.urlTemplate=e;this.fontstack=t;this.glyphs=new W;this.loaded=new oe;this.inflight=new W;}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<=wl&&!this.loaded.has(r))return true}return false}async ensure(e){let t=new oe;for(let o of e){let r=o.codePointAt(0);if(r===void 0)continue;let i=Math.floor(r/Gt);i>wl||this.loaded.has(i)||t.add(i);}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(i=>{if(!i.ok)throw new Error(`HTTP ${i.status}`);return i.arrayBuffer()}).then(i=>{for(let a of _l(i))this.glyphs.set(a.id,a);this.loaded.add(e);}).catch(i=>{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:`,i instanceof Error?i.message:i);}).finally(()=>{this.inflight.delete(e);});return this.inflight.set(e,r),r}};function _l(n){let e=new ht(n instanceof Uint8Array?n:new Uint8Array(n)),t=[];return e.readFields((o,r,i)=>{if(o!==1||!i)return;let a=i.readVarint()+i.pos;i.readFields((s,l,c)=>{if(s!==3||!c)return;let u=c.readVarint()+c.pos,h={id:0,bitmap:null,width:0,height:0,left:0,top:0,advance:0};c.readFields((f,d,p)=>{p&&(f===1?h.id=p.readVarint():f===2?h.bitmap=p.readBytes():f===3?h.width=p.readVarint():f===4?h.height=p.readVarint():f===5?h.left=p.readSVarint():f===6?h.top=p.readSVarint():f===7&&(h.advance=p.readVarint()));},null,u),t.push(h);},null,a);},null),t}var Wh=.25,Ot=1e20;function ai(n,e,t){let o=e+Ce*2,r=t+Ce*2,i=o*r,a=new Float64Array(i),s=new Float64Array(i);a.fill(Ot),s.fill(0);for(let c=0;c<t;c++)for(let u=0;u<e;u++){let h=n[c*e+u]/255,f=(c+Ce)*o+(u+Ce);if(h>=1)a[f]=0,s[f]=Ot;else if(h>0){let d=.5-h;a[f]=d>0?d*d:0,s[f]=d<0?d*d:0;}else a[f]=Ot,s[f]=0;}El(a,o,r),El(s,o,r);let l=new Uint8Array(i);for(let c=0;c<i;c++){let u=Math.sqrt(a[c])-Math.sqrt(s[c]);l[c]=Vh(Math.round(255-255*(u/Eo+Wh)));}return {data:l,width:o,height:r}}function El(n,e,t){let o=Math.max(e,t),r=new Float64Array(o),i=new Float64Array(o),a=new Int32Array(o),s=new Float64Array(o+1);for(let l=0;l<e;l++){for(let c=0;c<t;c++)r[c]=n[c*e+l];Fl(r,i,a,s,t);for(let c=0;c<t;c++)n[c*e+l]=i[c];}for(let l=0;l<t;l++){for(let c=0;c<e;c++)r[c]=n[l*e+c];Fl(r,i,a,s,e);for(let c=0;c<e;c++)n[l*e+c]=i[c];}}function Fl(n,e,t,o,r){t[0]=0,o[0]=-Ot,o[1]=Ot;for(let i=1,a=0;i<r;i++){let s=0;do{let l=t[a];s=(n[i]-n[l]+i*i-l*l)/(i-l)/2;}while(s<=o[a]&&--a>-1);a++,t[a]=i,o[a]=s,o[a+1]=Ot;}for(let i=0,a=0;i<r;i++){for(;o[a+1]<i;)a++;let s=t[a];e[i]=(i-s)*(i-s)+n[s];}}var Vh=n=>n<0?0:n>255?255:n;var Ml=48,Fo=class{constructor(e={}){this.defs=e;this.sdfs=new W;this.pending=new oe;this.failed=new oe;}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),i=r?Number(r[1])/Number(r[2]):1,a=Math.max(8,Math.round(Ml*(i>1?i:1))),s=Math.max(8,Math.round(Ml/(i<1?i:1))),l=await zh(o,a,s);return this.sdfs.set(e,ai(l,a,s)),!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 zh(n,e,t){let o=n.includes("width=")?n:n.replace("<svg",`<svg width="${e}" height="${t}"`),r=new Blob([o],{type:"image/svg+xml;charset=utf-8"}),i=URL.createObjectURL(r);try{let a=new Image;a.width=e,a.height=t,await new Promise((h,f)=>{a.onload=()=>h(),a.onerror=()=>f(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=i;});let s=document.createElement("canvas");s.width=e,s.height=t;let l=s.getContext("2d",{willReadFrequently:!0});if(!l)throw new Error("\u043D\u0435\u0442 2D-\u043A\u043E\u043D\u0442\u0435\u043A\u0441\u0442\u0430");l.clearRect(0,0,e,t),l.drawImage(a,0,0,e,t);let c=l.getImageData(0,0,e,t).data,u=new Uint8ClampedArray(e*t);for(let h=0;h<u.length;h++)u[h]=c[h*4+3];return u}finally{URL.revokeObjectURL(i);}}var gt={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>'},Nh={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[n,e]of Object.entries(Nh)){let t=gt[e];t?gt[n]=t:console.warn(`[osmgl] \u043F\u0441\u0435\u0432\u0434\u043E\u043D\u0438\u043C \u0438\u043A\u043E\u043D\u043A\u0438 \xAB${n}\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 Kh=1.2;function si(n,e,t=16,o=0){let r=Uh(n,t),i=[],a=[],s=0;for(let u of r){let h=0,f=0;for(let d of u){let p=d.codePointAt(0);if(p===void 0)continue;let m=e.get(p);m&&(h+=m.advance,f++);}f>1&&(h+=o*(f-1)),a.push(h),h>s&&(s=h);}if(s===0)return null;let l=Ze*Kh,c=r.length*l;for(let u=0;u<r.length;u++){let h=-a[u]/2,f=-c/2+u*l+l/2;for(let d of r[u]){let p=d.codePointAt(0);if(p===void 0)continue;let m=e.get(p);m&&(m.width>0&&m.height>0&&m.bitmap&&i.push({glyph:m,x:h,y:f}),h+=m.advance+o);}}return i.length?{glyphs:i,width:s,height:c}:null}function Uh(n,e){let t=n.replace(/\s+/g," ").trim();if(t.length<=e)return [t];let o=t.split(" "),r=[],i="";for(let a of o)i?i.length+1+a.length<=e?i+=" "+a:(r.push(i),i=a):i=a;return i&&r.push(i),r.slice(0,3)}function li(n,e,t,o){if(n.length<2)return [];let r=-o,i=-o,a=e+o,s=t+o,l=f=>f.x>=r&&f.x<=a&&f.y>=i&&f.y<=s,c=[],u=[],h=()=>{u.length>=2&&c.push(u),u=[];};for(let f=0;f+1<n.length;f++){let d=n[f],p=n[f+1],m=l(d),y=l(p);if(m&&y){u.length||u.push(d),u.push(p);continue}let b=Jh(d,p,r,i,a,s);if(!b){h();continue}u.length||u.push(b[0]),u.push(b[1]),y||h();}return h(),c}function Jh(n,e,t,o,r,i){let a=e.x-n.x,s=e.y-n.y,l=0,c=1,u=[[-a,n.x-t],[a,r-n.x],[-s,n.y-o],[s,i-n.y]];for(let[h,f]of u){if(h===0){if(f<0)return null;continue}let d=f/h;if(h<0){if(d>c)return null;d>l&&(l=d);}else {if(d<l)return null;d<c&&(c=d);}}return [{x:n.x+a*l,y:n.y+s*l},{x:n.x+a*c,y:n.y+s*c}]}var Xh=[0,.25,-0.25,.5,-0.5,.75,-0.75,1,-1];function fi(n,e,t,o={}){if(n.length<2||!e.length||t<=0)return [];let r=Qh(n),i=r[r.length-1];if(i<t)return [];let a=o.maxAngle??25,s=o.stableScale&&o.stableScale>0?o.stableScale:1,l=i*s,c=o.fontSize?o.fontSize*.6:t/e.length,u=(o.fontSize??0)*.85,h=[],f=o.spacing??250,d=f>0&&f-t<f*.25?t+f*.25:f;if(o.accept)return jh(n,r,e,t,d,c,a,u,o.accept);if(d>0&&l>=t+d){let m=Math.min(Math.floor((l-t)/d)+1,24),y=t+d*(m-1),b=(l-y)/2;for(let g=0;g<m;g++,b+=d){let A=b/s,B=ci(n,r,e,t,A,c,a,u);B&&h.push({glyphs:B,path:B.map(x=>({x:x.x,y:x.y})),at:A});}if(h.length)return h}let p=(i-t)/2;for(let m of Xh){let y=p+p*m,b=ci(n,r,e,t,y,c,a,u);if(b)return [{glyphs:b,path:b.map(g=>({x:g.x,y:g.y})),at:y}];if(p===0)break}return []}function jh(n,e,t,o,r,i,a,s,l){let c=e[e.length-1],u=Math.max(o/3,r/8,12),h=[],f=-1/0;for(let d=0;d+o<=c;d+=u){if(d-f<r)continue;let p=ci(n,e,t,o,d,i,a,s);if(!p)continue;let m={glyphs:p,path:p.map(y=>({x:y.x,y:y.y})),at:d};if(l(m)&&(h.push(m),f=d,h.length>=24))break}return h}function ci(n,e,t,o,r,i,a,s){if(r<0||r+o>e[e.length-1]||!Yh(n,e,r,r+o,i,a))return null;let l=Mo(n,e,r),c=Mo(n,e,r+o);if(!l||!c)return null;if(c.x>=l.x)return Dl(n,e,t,r,s);let u=e[e.length-1];return Dl([...n].reverse(),qh(e),t,u-(r+o),s)}function Yh(n,e,t,o,r,i){if(r<=0)return true;let a=[],s=0;for(let l=1;l+1<n.length;l++){let c=e[l];if(c<=t)continue;if(c>=o)break;let u=Math.atan2(n[l].y-n[l-1].y,n[l].x-n[l-1].x),h=Math.atan2(n[l+1].y-n[l].y,n[l+1].x-n[l].x),f=Math.abs((h-u)*180/Math.PI+540)%360-180,d=Math.abs(f);for(a.push({at:c,delta:d}),s+=d;a.length&&c-a[0].at>r;)s-=a.shift().delta;if(s>i)return false}return true}function Dl(n,e,t,o,r){let i=[];for(let c of t){let u=Sl(n,e,o+c.offset,c.width);if(!u)return null;i.push(u);}if(!i.length)return null;if(r<=0)return i;let a=[],s=o,l=0;for(let c=0;c<t.length;c++){if(c>0){let h=Math.abs(Zh(i[c].angle,i[c-1].angle))*(Math.PI/180);l+=r*2*Math.tan(Math.min(h,Math.PI/3)/2);}s=o+t[c].offset+l;let u=Sl(n,e,s,t[c].width);if(!u)return null;a.push(u);}return a}function Sl(n,e,t,o){let r=Mo(n,e,t+o/2);if(!r)return null;let i=Mo(n,e,t),a=Mo(n,e,t+o);if(!i||!a)return r;let s=a.x-i.x,l=a.y-i.y;return s===0&&l===0?r:{x:r.x,y:r.y,angle:Math.atan2(l,s)*180/Math.PI}}function Zh(n,e){let t=n-e;for(;t>180;)t-=360;for(;t<=-180;)t+=360;return t}function Qh(n){let e=new Array(n.length);e[0]=0;for(let t=1;t<n.length;t++)e[t]=e[t-1]+Math.hypot(n[t].x-n[t-1].x,n[t].y-n[t-1].y);return e}function qh(n){let e=n[n.length-1];return n.map(t=>e-t).reverse()}function Mo(n,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 i=(t-e[o-1])/r,a=n[o-1],s=n[o],l=s.x-a.x,c=s.y-a.y;return {x:a.x+l*i,y:a.y+c*i,angle:Math.atan2(c,l)*180/Math.PI}}var hi=20,Il={stride:hi,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}]},$h=220,it=64,Ll=2,ed=1.22,td=128,od=.7;function rd(n,e,t){let o=n.layout?.letterSpacing;if(o!==void 0)return z(o,e,0)*Ze;let r=z(n.paint?.haloWidth,e,0);return r<=0||t<=0?0:r*od/(t/Ze)}var nd=256,id=200,ui="frame-circle",Wt=class n{constructor(e,t){this.shader=null;this.locations=new W;this.atlas=new wo(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 W;this.fading=false;this.styleOrder=new W;this.glyphs=new _o(e,t),this.icons=new Fo(gt);}init(e){this.shader=new Ae(e,"symbol",qs,$s);for(let t of Il.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)/$h;return r<1?(this.fading=true,r):1}order(e){let t=o=>o.priority+(this.stickyKeys.has(n.keyOf({layerId:o.layer.id,mercX:o.mercX,mercY:o.mercY}))?id:0);e.sort((o,r)=>t(r)-t(o));}rememberPlaced(){this.stickyKeys=new Set(this.placed.map(e=>n.keyOf(e)));for(let e of [...this.shownAt.keys()])this.stickyKeys.has(e)||this.shownAt.delete(e);}render(e,t,o,r){let i=this.shader;if(this.placedCount=0,this.placed=[],this.viewport={width:t.width,height:t.height},!i)return;let a=t.zoom,s=r.layers.filter(d=>d.type==="symbol"&&r.layerVisibleAt(d,a));if(!s.length)return;let l=this.collect(t,o,r,s);if(!l.length)return;this.now=performance.now(),this.fading=false,this.order(l);let c=new W,u=new W,h=new W;s.forEach((d,p)=>h.set(d.id,p));let f=0;for(let d of l){let p=this.place(d,a,c);if(!p)continue;this.placed.push({layerId:d.layer.id,text:d.text,icon:d.icon,mercX:d.mercX,mercY:d.mercY,box:p.box,order:h.get(d.layer.id)??0});let m=u.get(d.layer.id);m||u.set(d.layer.id,m={layer:d.layer,verts:[],texs:[],iconVerts:[],iconTexs:[],frameVerts:[],frameTexs:[]}),m.verts.push(...p.verts),m.texs.push(...p.texs),m.iconVerts.push(...p.iconVerts),m.iconTexs.push(...p.iconTexs),m.frameVerts.push(...p.frameVerts),m.frameTexs.push(...p.frameTexs),f+=p.quads,this.placedCount++;}this.rememberPlaced(),this.fading&&this.onAssetsReady?.(),this.requestMissing(),f&&(this.styleOrder=h,this.draw(e,t,u,f,a));}collect(e,t,o,r){let i=[],s=this.padding,l=kt(e,o).far,[c,u,h]=e.cameraPositionPx;for(let f of r){let d=(f.layout?.priority??0)*nd,p=t.get(f.source??Y);if(!p)continue;let m=f.layout?.showFor==="highlight",y=f.layout?.placement==="map",{shift:b,drop:g}=y?Pl(f,e.zoom,e.pixelsPerMeter):{shift:0,drop:0};if(m&&!this.highlightFootprint)continue;let A=e.worldSize>0?e.pixelsPerMeter/e.worldSize*1.5:0,B=o.bucketKeyFor(f);if(B!==null)for(let x of p.visibleTiles){if(!o.layerVisibleAt(f,e.detailZoom(e.distanceToTile(x))))continue;let _=p.getTile(x)?.data?.buckets?.[B];if(!_||!br(_))continue;let C=new Int16Array(_.anchors),v=new Uint8Array(_.priorities),E=_.rotations?new Int16Array(_.rotations):null,D=_.lines?new Int16Array(_.lines):null,M=_.lineStarts?new Uint32Array(_.lineStarts):null,H=x.bounds(),S=e.worldSize,L=(H.maxX-H.minX)*S/_.extent,F=H.minX*S,T=H.minY*S;for(let P=0;P<v.length;P++){let k=F+C[P*2]*L,O=T+C[P*2+1]*L;if(l!==1/0&&Math.hypot(k-c,O-u,h)>l||m&&!je(this.highlightFootprint,k/S,O/S,A))continue;let N=k,G=O;if(y&&E){let Z=E[P]*Math.PI/180,ee=b;N-=Math.sin(Z)*ee,G+=Math.cos(Z)*ee;}let R=e.worldPxToPoint(N,G),V=D&&M?ad(e,D,M,P,F,T,L):void 0;if(f.layout?.textPlacement==="line"){if(!V)continue}else if(!R||R.x<s.left-64||R.y<s.top-64||R.x>e.width-s.right+64||R.y>e.height-s.bottom+64)continue;i.push({layer:f,screenX:R?R.x:V[0].x,screenY:(R?R.y:V[0].y)+g,text:_.texts[P]??"",icon:_.icons[P]??"",priority:v[P]+d,rotate:Rl(f,E,P,e.bearing),mercX:k/S,mercY:O/S,line:V});}}}return i}place(e,t,o){let r=e.layer.layout??{},i=n.keyOf({layerId:e.layer.id,mercX:e.mercX,mercY:e.mercY});if(this.hiddenKey!==null&&this.hiddenKey===i)return null;let a=this.fadeOf(i,this.now),s=this.hoverKey!==null&&this.hoverKey===i,l=z(r.textSize,t,13),c=z(r.iconSize,t,16),u=r.iconTextGap??5,[h,f]=r.offset??[0,0],d=r.placement==="map",p=null;if(e.icon&&!d){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&&(p=U);}let m=null;if(p&&r.iconFrame==="circle"){let q=`icon:${ui}`,U=this.atlas.get(q);if(!U){let J=this.icons.get(ui);J?U=this.atlas.add(q,J.data,J.width,J.height)??void 0:this.pendingIcons.add(ui);}U&&(m=U);}let y=m?Math.max(r.iconFrameScale??1.6,1):1,b=null;if(e.text&&(this.glyphs.needsLoad(e.text)&&this.pendingText.add(e.text),b=si(e.text,this.glyphs,r.textPlacement==="line"?Number.MAX_SAFE_INTEGER:r.maxLineChars??15,rd(e.layer,t,l)),!b&&!p)||!b&&!p)return null;let g=l/Ze,A=b?b.width*g:0,B=b?b.height*g:0;if(e.layer.layout?.textPlacement==="line")return b&&e.line?this.placeOnLine(e,b,g,B,o,t,a):null;let x=r.iconPlacement??"top",w=x==="behind"&&!!p&&!!b,_=x==="top"&&!!p&&!!b,C=p?p.width/Math.max(p.height,1):1,v=w?B+u*2:c,E=p?v*C:0,D=Math.max(E,p?c*y:0),M=Math.max(v,p?c*y:0),H=w?Math.max(E,A+u*2):_?Math.max(D,A):D+(p&&b?u:0)+A,S=w?Math.max(v,B):_?M+u+B:Math.max(p?M:0,B),L=e.screenX+h,F=e.screenY+f,T=Ll+(r.collisionPadding??0),P={x1:L-H/2-T,y1:F-S/2-T,x2:L+H/2+T,y2:F+S/2+T},k=this.padding;if(P.x1<k.left||P.y1<k.top||P.x2>this.viewport.width-k.right||P.y2>this.viewport.height-k.bottom)return null;if(!r.allowOverlap){if(Tl(o,P))return null;Hl(o,P);}let O=[],N=[],G=[],R=[],V=[],j=[],Z=0,ee=L-H/2,be=_?(M+u)/2:0,te=1/0,X=1/0,re=-1/0,se=-1/0;if(b){let q=_||w?L:ee+(p?D+u:0)+A/2;for(let U of b.glyphs){let J=U.glyph,fe=`g:${J.id}`,le=this.atlas.get(fe);if(!le&&(!J.bitmap||(le=this.atlas.add(fe,J.bitmap,J.width+Ce*2,J.height+Ce*2)??void 0,!le)))continue;let ue=q+(U.x+J.left-Ce)*g,ne=F+be+(U.y-J.top-Ce)*g,xe=le.width*g,Te=le.height*g;Fr(O,N,ue,ne,xe,Te,le,0,a),Z++;let we=Ce*g;te=Math.min(te,ue+we),X=Math.min(X,ne+we),re=Math.max(re,ue+xe-we),se=Math.max(se,ne+Te-we);}if(_&&p&&X<1/0){let U=F-S/2+M+u-X;if(U!==0){for(let J=1;J<O.length;J+=4)O[J]+=U;X+=U,se+=U;}}}if(p){let q=s?ed:1,U=E*q,J=v*q,fe=(_?L-E/2:ee+(D-E)/2)-(U-E)/2,le=(_?F-S/2+(M-v)/2:F-v/2)-(J-v)/2;if(m){let ne=c*y*q,xe=fe+U/2-ne/2,Te=le+J/2-ne/2,we=Ce/Math.max(m.height-Ce*2,1)*ne;Fr(V,j,xe-we,Te-we,ne+we*2,ne+we*2,m,0,a),Z++;}if(w&&re>te){let ne=u*1.6,xe=u;U=(re-te+ne*2)*q,J=(se-X+xe*2)*q,fe=te-ne,le=X-xe;}let ue=Ce/Math.max(p.height-Ce*2,1)*J;Fr(G,R,fe-ue,le-ue,U+ue*2,J+ue*2,p,e.rotate,a),Z++;}return Z?{verts:O,texs:N,iconVerts:G,iconTexs:R,frameVerts:V,frameTexs:j,quads:Z,box:P}:null}placeOnLine(e,t,o,r,i,a,s){let l=e.line,c=t.glyphs.map(E=>({offset:(E.x+t.width/2)*o,width:Math.max(E.glyph.advance,1)*o})),u=c.length?c[c.length-1].offset+c[c.length-1].width:0,h=e.layer.layout??{},f=[],d=[],p=[],m=0,y=r/2+Ll,b=this.padding,g=E=>{let D=E.path.map(M=>({x1:M.x-y,y1:M.y-y,x2:M.x+y,y2:M.y+y}));for(let M of D)if(M.x1<b.left||M.y1<b.top||M.x2>this.viewport.width-b.right||M.y2>this.viewport.height-b.bottom||!h.allowOverlap&&Tl(i,M))return false;if(!h.allowOverlap)for(let M of D)Hl(i,M);return p.push(...D),true},A=-1/0,B=1/0;for(let E of t.glyphs)E.glyph.height<=0||(A=Math.max(A,E.glyph.top),B=Math.min(B,E.glyph.top-E.glyph.height));let x=Number.isFinite(A)?(A+B)/2*o:0,_=li(l,this.viewport.width,this.viewport.height,td).flatMap(E=>fi(E,c,u,{spacing:h.symbolSpacing,fontSize:Ze*o,stableScale:Math.pow(2,Math.round(a)-a),accept:g}));if(!_.length)return null;for(let E of _)for(let D=0;D<t.glyphs.length;D++){let M=t.glyphs[D].glyph,H=E.glyphs[D],S=`g:${M.id}`,L=this.atlas.get(S);if(!L&&(!M.bitmap||(L=this.atlas.add(S,M.bitmap,M.width+Ce*2,M.height+Ce*2)??void 0,!L)))continue;let F=L.width*o,T=L.height*o,P=(M.height/2-M.top)*o+x,k=H.angle*Math.PI/180;Fr(f,d,H.x-F/2-Math.sin(k)*P,H.y-T/2+Math.cos(k)*P,F,T,L,H.angle,s),m++;}if(!m)return null;let C=p.map(E=>(E.x1+E.x2)/2),v=p.map(E=>(E.y1+E.y2)/2);return {verts:f,texs:d,iconVerts:[],iconTexs:[],frameVerts:[],frameTexs:[],quads:m,box:{x1:Math.min(...C)-y,y1:Math.min(...v)-y,x2:Math.max(...C)+y,y2:Math.max(...v)+y}}}inStyleOrder(e){return [...e.values()].sort((t,o)=>(this.styleOrder.get(t.layer.id)??0)-(this.styleOrder.get(o.layer.id)??0))}draw(e,t,o,r,i){let a=this.shader,s=e.gl;this.ensureBuffers(e,r);let l=this.vbo,c=this.vao;if(!l||!c||!this.ibo)return;let u=new ArrayBuffer(r*4*hi),h=new Float32Array(u),f=new Uint16Array(u),d=[],p=0,m=(y,b,g,A)=>{let B=y.length/16;if(B){d.push({layer:g,role:A,first:p/4*6,count:B*6});for(let x=0;x<B*4;x++){let w=p*5;h[w]=y[x*4],h[w+1]=y[x*4+1],f[w*2+4]=b[x*2],f[w*2+5]=b[x*2+1],h[w+3]=y[x*4+2],h[w+4]=y[x*4+3],p++;}}};for(let y of this.inStyleOrder(o))m(y.frameVerts,y.frameTexs,y.layer,"frame"),m(y.iconVerts,y.iconTexs,y.layer,"icon"),m(y.verts,y.texs,y.layer,"text");l.update(new Uint8Array(u)),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",ii),a.setFloat("u_dpr",t.width>0?s.drawingBufferWidth/t.width:1),e.setDepthTest(false),e.setDepthMask(false),e.setBlend("premultiplied"),e.setCull("none"),c.bind();for(let y of d){let b=y.layer.paint,g=z(b.opacity,i,1),A=y.role==="icon",B=y.role==="frame",x=(D,M,H)=>B?M??D??H:A?D??H:H,w=He(B?b.frameColor??b.haloColor??b.color:x(b.iconColor,void 0,b.color),i,[.15,.15,.15,1]),_=B?b.frameHaloColor:x(b.iconHaloColor,void 0,b.haloColor),C=He(_??(B?b.iconColor??b.color:b.haloColor),i,[1,1,1,1]);B&&b.frameHaloColor===void 0&&(C[3]*=.35),B&&(w[3]*=z(b.frameOpacity,i,1));let v=z(B?b.frameHaloWidth??1.1:x(b.iconHaloWidth,void 0,b.haloWidth),i,1.2),E=z(y.layer.layout?.textSize,i,13);a.setVec4v("u_color",Fe([w[0],w[1],w[2],w[3]*g])),a.setVec4v("u_halo_color",Fe([C[0],C[1],C[2],C[3]*g])),a.setFloat("u_halo",v/(Eo*(E/Ze))),s.drawElements(s.TRIANGLES,y.count,s.UNSIGNED_INT,y.first*4);}e.bindVAO(null);}ensureBuffers(e,t){if(this.vao&&t<=this.capacityQuads)return;this.vao?.destroy(),this.vbo?.destroy(),this.ibo?.destroy(),this.capacityQuads=Math.max(1024,Math.ceil(t*1.5)),this.vbo=new ve(e,new Uint8Array(this.capacityQuads*4*hi),Il,true);let o=new Uint32Array(this.capacityQuads*6);for(let r=0;r<this.capacityQuads;r++){let i=r*4;o.set([i,i+1,i+2,i,i+2,i+3],r*6);}this.ibo=new ge(e,o),this.vao=new de(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 Fr(n,e,t,o,r,i,a,s=0,l=1){let c=i/Math.max(a.height,1);if(s){let u=s*Math.PI/180,h=Math.cos(u),f=Math.sin(u),d=t+r/2,p=o+i/2;for(let[m,y]of [[t,o],[t+r,o],[t+r,o+i],[t,o+i]]){let b=m-d,g=y-p;n.push(d+b*h-g*f,p+b*f+g*h,c,l);}}else n.push(t,o,c,l,t+r,o,c,l,t+r,o+i,c,l,t,o+i,c,l);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 ad(n,e,t,o,r,i,a){if(o+1>=t.length)return;let s=t[o],l=t[o+1],c=[];for(let u=s;u<l;u++){let h=n.worldPxToPoint(r+e[u*2]*a,i+e[u*2+1]*a);if(!h)break;c.push(h);}return c.length>=2?c:void 0}var kl=(n,e)=>n*4096+e;function Tl(n,e){let t=Math.floor(e.x1/it),o=Math.floor(e.y1/it),r=Math.floor(e.x2/it),i=Math.floor(e.y2/it);for(let a=t;a<=r;a++)for(let s=o;s<=i;s++){let l=n.get(kl(a,s));if(l){for(let c of l)if(e.x1<c.x2&&e.x2>c.x1&&e.y1<c.y2&&e.y2>c.y1)return true}}return false}function Hl(n,e){let t=Math.floor(e.x1/it),o=Math.floor(e.y1/it),r=Math.floor(e.x2/it),i=Math.floor(e.y2/it);for(let a=t;a<=r;a++)for(let s=o;s<=i;s++){let l=kl(a,s),c=n.get(l);c||n.set(l,c=[]),c.push(e);}}function Pl(n,e,t){let r=n.layout?.arrowUnits!=="meters"?1:t,i=z(n.layout?.arrowLength,e,50)*r;return {shift:z(n.layout?.arrowGap,e,20)*r+i/2,drop:i/2+(n.layout?.iconTextGap??4)}}function Rl(n,e,t,o){return !n.layout?.iconRotate||!e?0:e[t]-o}var Vt=class{constructor(e,t){this.capacity=e;this.onEvict=t;this.map=new W;}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 zt=class n{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 n(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 n(e,t,o,this.wrap),new n(e,t+1,o,this.wrap),new n(e,t,o+1,this.wrap),new n(e,t+1,o+1,this.wrap)]}scaledTo(e){if(e>=this.z)return this;let t=this.z-e;return new n(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 sd(n,e,t){let o=Math.pow(2,t),r=e.maxTiles??512,i=[],a=128;for(let s=0;s<o;s++)for(let l=0;l<o;l++){let c=new zt(t,l,s),u=c.bounds(),h=(u.minX+u.maxX)/2,f=(u.minY+u.maxY)/2,d=[[h,f],[u.minX,u.minY],[u.maxX,u.minY],[u.minX,u.maxY],[u.maxX,u.maxY]],p=false;for(let[y,b]of d)if(n.isOnGlobeFront(Se(y),Me(b))){p=true;break}if(!p)continue;let m=false;for(let[y,b]of d){let g=n.localToPoint(n.globeLocal(y,b));if(g&&g.x>-a&&g.y>-a&&g.x<n.width+a&&g.y<n.height+a){m=true;break}}if(m&&(i.push(c),i.length>=r))return i}return i}function Do(n,e){let t=Math.min(e.maxzoom,24),o=Math.max(0,Math.min(e.minzoom,t)),r=e.detailBias??1,i=e.maxTiles??512,a=512*r,s=Math.min(Math.round(n.zoom),t);if(s<o)return [];if(n.globeActive)return sd(n,e,s);let{min:l,max:c}=n.visibleWrapRange(),u=[],h=[];for(let d=l;d<=c;d++)h.push(new zt(0,0,0,d));let f=0;for(;h.length&&!(++f>2e4||u.length>=i);){let d=h.pop();if(!n.isTileVisible(d))continue;if(d.z>=s){d.z>=o&&u.push(d);continue}if(n.tileScreenSize(d.z,n.distanceToTile(d))<=a&&d.z>=o){u.push(d);continue}for(let m of d.children())h.push(m);}return u.sort((d,p)=>n.distanceToTile(d)-n.distanceToTile(p)),u}var di=class{constructor(e){this.id=e;this.state="loading";this.data=null;this.error=null;this.requestId=0;this.buckets=new W;}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;}},ld=1500,Mr=class extends Qe{constructor(t,o){super();this.pool=t;this.visible=[];this.holdSince=0;this.warmed=false;this.version=0;this.opts={cacheSize:160,detailBias:1,maxTiles:512,...o},this.cache=new Vt(this.opts.cacheSize,(r,i)=>{i.state==="loading"&&this.pool.abort(i.requestId),i.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 i=this.getTile(r)?.data?.splits?.[t];if(i)for(let a of i)o.includes(a)||o.push(a);}return o.sort((r,i)=>typeof r=="number"&&typeof i=="number"?r-i:String(r).localeCompare(String(i))),o}get pendingCount(){let t=0;for(let o of this.cache.values())o.state==="loading"&&t++;return t}update(t){let o=Do(t,this.opts),r=new oe;for(let l of o)r.add(l.dataKey);for(let[l,c]of this.cache.entries())c.state==="loading"&&!r.has(l)&&(this.pool.abort(c.requestId),this.cache.delete(l));let i=Math.max(this.opts.cacheSize,r.size*2);this.cache.setCapacity(i);for(let l of o)this.cache.get(l.dataKey)||this.loadTile(l);let a=this.visible.length>0&&this.covers(o),s=performance.now();this.readyFor(o)||!a||this.holdSince&&s-this.holdSince>ld?(this.visible=o,this.holdSince=0,this.readyFor(o)&&o.length&&(this.warmed=true)):this.holdSince||(this.holdSince=s);}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 oe;for(let r of this.visible)o.add(r.dataKey);for(let r of t){if(o.has(r.dataKey))continue;let i=r.parent(),a=false;for(let s=0;i&&s<4;s++){if(o.has(i.dataKey)){a=true;break}i=i.parent();}if(!a)for(let s of this.visible){let l=s.parent();for(let c=0;l&&c<4;c++){if(l.dataKey===r.dataKey){a=true;break}l=l.parent();}if(a)break}if(!a)return false}return true}loadTile(t){let o=new di(t);this.cache.set(t.dataKey,o);let r=cd(this.opts.url.replace("{z}",String(t.z)).replace("{x}",String(t.x)).replace("{y}",String(t.y)));o.requestId=this.pool.load({url:r,zoom:t.z,metersPerTile:Gi(t.z,t.y),sourceMaxZoom:this.opts.maxzoom,plan:this.opts.plan},i=>{if(this.cache.peek(t.dataKey)===o){if(i.type==="error"){if(i.aborted)return;o.state="error",o.error=i.message,this.emit("error",{tile:t,message:i.message});}else o.data=i,o.state=Object.keys(i.buckets).length?"loaded":"empty",this.version++,i.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 ${i.diag.failed.join("; ")}`),this.emit("data",{tile:o});this.pendingCount===0&&this.emit("idle",void 0);}});}findReadyAncestor(t,o=5){let r=t.parent();for(let i=0;r&&i<o;i++){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 cd(n){if(typeof location>"u")return n;try{return new URL(n,location.href).href}catch{return n}}var Dr=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;}},So=class extends Qe{constructor(t){super();this.visible=[];this.aborts=new Map;this.opts={cacheSize:128,detailBias:1,maxTiles:256,...t},this.cache=new Vt(this.opts.cacheSize,(o,r)=>{this.aborts.get(o)?.abort(),this.aborts.delete(o),r.destroy();});}get visibleTiles(){return this.visible}getTile(t){return this.cache.peek(t.dataKey)}update(t){this.visible=Do(t,this.opts);let o=new oe;for(let r of this.visible)o.add(r.dataKey);for(let[r,i]of this.cache.entries())i.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 Dr(t);this.cache.set(t.dataKey,o);let r=new AbortController;this.aborts.set(t.dataKey,r),this.fetchImage(Gl(this.opts.url,t),r.signal).then(i=>{if(this.aborts.delete(t.dataKey),this.cache.peek(t.dataKey)!==o){i.close();return}o.image=i,o.state="loaded",this.emit("data",{tile:o});}).catch(i=>{this.aborts.delete(t.dataKey),!r.signal.aborted&&this.cache.peek(t.dataKey)===o&&(o.state="error",o.error=i instanceof Error?i.message:String(i),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 Gl(n,e){let t=n.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 fd="osmgl-assets",Nt="assets";var Sr=null;function Wl(){return Sr||(Sr=new Promise(n=>{if(typeof indexedDB>"u")return n(null);try{let e=indexedDB.open(fd,1);e.onupgradeneeded=()=>{let t=e.result;t.objectStoreNames.contains(Nt)||t.createObjectStore(Nt,{keyPath:"key"});},e.onsuccess=()=>n(e.result),e.onerror=()=>n(null);}catch{n(null);}}),Sr)}function ud(n){return Wl().then(e=>new Promise(t=>{if(!e)return t(null);try{let o=e.transaction(Nt,"readonly").objectStore(Nt).get(n);o.onsuccess=()=>t(o.result??null),o.onerror=()=>t(null);}catch{t(null);}}))}function hd(n){Wl().then(e=>{if(e)try{e.transaction(Nt,"readwrite").objectStore(Nt).put(n);}catch{}});}var Ol=n=>{let e=atob(n),t=new Uint8Array(e.length);for(let o=0;o<e.length;o++)t[o]=e.charCodeAt(o);return t};async function dd(n,e,t){let o=await crypto.subtle.importKey("raw",Ol(e),"AES-GCM",false,["decrypt"]);return crypto.subtle.decrypt({name:"AES-GCM",iv:Ol(t),tagLength:128},o,n)}var Io=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 i=await this.resolve(e,o),a=`${i}:${t}`,s=this.inflight.get(a);if(s)return s;let l=this.fetchAsset(a,i,t,r).finally(()=>this.inflight.delete(a));return this.inflight.set(a,l),l}async fetchAsset(e,t,o,r){let i,a,s=await ud(e);if(s)i=s.bytes,a=s.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",i=await c.arrayBuffer(),hd({key:e,bytes:i,encrypted:a,savedAt:Date.now()});}if(!a)return i;let l=await this.getKey(t,r);if(!l)throw new Error("\u043D\u0435\u0442 \u043A\u043B\u044E\u0447\u0430 \u0440\u0430\u0441\u0448\u0438\u0444\u0440\u043E\u0432\u043A\u0438");return dd(i,l.key,l.iv)}getKey(e,t){let o=this.keys.get(e);if(o)return o;let r=(async()=>{let i=await fetch(this.withKey(`${this.endpoint}/files/${e}/key`),{signal:t,credentials:"same-origin"});if(!i.ok)return null;let a=await i.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 pd=1,Lo=class{constructor(e){this.mesh=null;this.bitmaps=[];this.error=null;this.loading=null;this.matrix=K();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-${pd++}`,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 Zn(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 i=Math.max(o,0);return this.grow=this.shrinkFrom*(1-i*i*(3-2*i)),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])),i=Math.max(Math.abs(e.min[2]),Math.abs(e.max[2]));return Math.hypot(o,r,i)*t}origin(){let e=$(this.coordinates);return {x:ie(e.lng),y:ae(e.lat)}}localMatrix(e){let t=this.effectiveScale(),o=t/Ge(e),r=[o,0,0,0,0,t*this.grow,0,o,0],i=c=>c*Math.PI/180,a=mi(i(-this.rotation));this.rotationTiltX&&(a=at(pi(i(this.rotationTiltX)),a)),this.rotationTiltZ&&(a=at(bi(i(this.rotationTiltZ)),a));let s=at(r,a),l=this.matrix;return Ue(l),l[0]=s[0],l[1]=s[1],l[2]=s[2],l[4]=s[3],l[5]=s[4],l[6]=s[5],l[8]=s[6],l[9]=s[7],l[10]=s[8],l[15]=1,l}matrixInSpace(e,t){let o=$(this.coordinates),r=K();for(let a=0;a<16;a++)r[a]=e[a];let i=K();return Ee(i,r,this.localMatrix(o.lat)),Je(t??this.matrix32,i)}cameraInModelSpace(e){let t=this.effectiveScale();if(!(t>0))return [0,0,0];let o=this.origin(),r=$(this.coordinates),i=Ge(r.lat),a=e.worldSize,s=e.cameraPositionPx,l=(s[0]/a-o.x)*i,c=(s[1]/a-o.y)*i,u=s[2]/e.pixelsPerMeter-this.altitude,h=l,f=u,d=c,p=y=>y*Math.PI/180,m=mi(p(-this.rotation));return this.rotationTiltX&&(m=at(pi(p(this.rotationTiltX)),m)),this.rotationTiltZ&&(m=at(bi(p(this.rotationTiltZ)),m)),[(m[0]*h+m[1]*f+m[2]*d)/t,(m[3]*h+m[4]*f+m[5]*d)/t,(m[6]*h+m[7]*f+m[8]*d)/t]}matrixFor(e){let t=this.origin();return this.matrixInSpace(e.objectMatrix(t.x,t.y,this.altitude))}coversPoint(e,t){let o=this.mesh;if(!o)return false;let r=this.origin(),i=e-r.x,a=t-r.y,s=$(this.coordinates),l=this.localMatrix(s.lat),c=l[0],u=l[1],h=l[8],f=l[9],d=c*f-u*h;if(Math.abs(d)<1e-30)return false;let p=(i*f-a*h)/d,m=(c*a-u*i)/d,y=1.05,b=(o.min[0]+o.max[0])/2,g=(o.min[2]+o.max[2])/2,A=(o.max[0]-o.min[0])/2*y,B=(o.max[2]-o.min[2])/2*y;return Math.abs(p-b)<=A&&Math.abs(m-g)<=B}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 i=this.mesh?.animation;if(!i||!i.nodes.has(t))return this.matrixInSpace(e,r);let a=K();for(let h=0;h<16;h++)a[h]=e[h];let s=$(this.coordinates),l=K();Ee(l,a,this.localMatrix(s.lat));let c=K();Qn(i,t,i.duration>0?o%i.duration:0,c);let u=K();return Ee(u,l,c),Je(r,u)}normalMatrix(){let e=i=>i*Math.PI/180,t=mi(e(-this.rotation));this.rotationTiltX&&(t=at(pi(e(this.rotationTiltX)),t)),this.rotationTiltZ&&(t=at(bi(e(this.rotationTiltZ)),t));let o=at([1,0,0,0,0,1,0,1,0],t),r=this.normal32;for(let i=0;i<9;i++)r[i]=o[i];return r}};function at(n,e){let t=new Array(9);for(let o=0;o<3;o++)for(let r=0;r<3;r++)t[o*3+r]=n[r]*e[o*3]+n[3+r]*e[o*3+1]+n[6+r]*e[o*3+2];return t}var pi=n=>{let e=Math.cos(n),t=Math.sin(n);return [1,0,0,0,e,t,0,-t,e]},mi=n=>{let e=Math.cos(n),t=Math.sin(n);return [e,0,-t,0,1,0,t,0,e]},bi=n=>{let e=Math.cos(n),t=Math.sin(n);return [e,t,0,-t,e,0,0,0,1]};var Lr=class{constructor(){this.hit=new W;this.miss=new oe;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(i=>i.dataKey).join(",");if(r!==this.stamp&&(this.stamp=r,this.miss.clear()),this.miss.has(e.id))return null;for(let i of t.source.visibleTiles){let a=t.source.getTile(i)?.data?.buckets?.[t.key];if(!a||a.kind!=="fill-extrusion"||!a.featureIds)continue;let s=i.bounds();if(e.mercX<s.minX||e.mercX>s.maxX||e.mercY<s.minY||e.mercY>s.maxY)continue;let l=(e.mercX-s.minX)/(s.maxX-s.minX)*a.extent,c=(e.mercY-s.minY)/(s.maxY-s.minY)*a.extent,u=new Int16Array(a.vertices),h=new Uint32Array(a.indices),f=new Float64Array(a.featureIds),d=u.length/a.vertexCount;for(let p=0;p*3+2<h.length;p++){let m=h[p*3]*d,y=h[p*3+1]*d,b=h[p*3+2]*d;if(!Cd(l,c,u[m],u[m+1],u[y],u[y+1],u[b],u[b+1]))continue;let g=f[p];return this.hit.set(e.id,g),g}}return this.miss.add(e.id),null}clear(){this.hit.clear(),this.miss.clear(),this.stamp="";}},md=14,bd=2e3,yd=4e3,Vl=160,gd=50,Ad=4e3,yi=6,Tr=class{constructor(e){this.wantKey="";this.modelKey="";this.entries=new W;this.loading=0;this.pending=[];this.known=new W;this.underBuilding=new Lr;this.underVenue=new Lr;this.tilesStamp="";this.rulesInScan=0;this.found=[];this.foundStamp="";this.sortedAt=null;this.budgetScale=1;this.addModel=null;this.lod=0;this.budget=Vl;this.replacedBuildings=new oe;this.replacedVenues=new oe;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 Io(e);}get models(){let e=[];for(let t of this.entries.values())e.push(t.model);return e}update(e,t,o,r,i,a,s){this.wantKey!==this.modelKey&&(this.modelKey=this.wantKey,this.clear(i));let l=e.layout??{},c=l.minZoom??md,u=l.loadRadius??bd,h=Math.max(l.keepRadius??yd,u),f=Math.min(1,Math.max(.25,(o.zoom-c)/3)),d=Math.max(8,Math.round((l.budget??Vl)*this.budgetScale*f));this.budget=d,this.addModel=r;let p=l.maskReplaced!==false,m=performance.now();if(o.zoom<c){for(let F of [...this.entries.values()])F.model.retire(),F.model.grow<=0&&this.release(F,i);this.replacedBuildings.clear(),this.replacedVenues.clear();return}let y=o.center,b=this.lodFor(o.zoom,c);this.lod=b;let g="";for(let F of t.visibleTiles)g+=F.dataKey+(t.getTile(F)?.data?"+":"-");let A=this.rulesInScan;if(g!==this.tilesStamp){this.tilesStamp=g;let F=new oe;A=0;for(let T of t.visibleTiles){let P=t.getTile(T)?.data?.buckets?.[e.id];if(!P||!el(P))continue;let k=new Int16Array(P.anchors),O=T.bounds(),N=O.maxX-O.minX,G=O.maxY-O.minY;for(let R=0;R<P.props.length;R++){let V=P.props[R],j=At(V.file,NaN);if(!Number.isFinite(j))continue;let Z=String(V.kind??"model"),ee=Z==="rule"?`t-${V.rid}-${V.oid}`:`m-${V.mid}`;if(F.has(ee))continue;F.add(ee),Z==="rule"&&A++;let be=O.minX+k[R*2]/P.extent*N,te=O.minY+k[R*2+1]/P.extent*G,X=Bd(be,te);this.known.set(ee,{id:ee,fileId:j,lng:X.lng,lat:X.lat,mercX:be,mercY:te,altitude:At(V.alt,0),scale:At(V.scale,1),rotation:At(V.rx,0),tiltX:At(V.rz,0),tiltZ:At(V.ry,0),kind:Z==="rule"?"rule":"model",target:Ir(Z==="rule"?V.oid:V.replaces),replaces:p?Z==="rule"?Ir(V.oid):String(V.anchor??"replace")==="replace"?Ir(V.replaces):null:null});}}this.rulesInScan=A;}g!==this.foundStamp&&(this.foundStamp=g,this.found=[...this.known.values()],this.sortedAt=null);let B=this.found,x=new oe;for(let F of B)F.kind==="model"&&F.target!==null&&x.add(F.target);let w=111320,_=Math.cos(y.lat*Math.PI/180),C=F=>Math.hypot((F.lng-y.lng)*w*_,(F.lat-y.lat)*w);this.replacedBuildings.clear(),this.replacedVenues.clear();let v=new oe,E=[],D=0,M=0;(this.sortedAt===null||Math.hypot((y.lng-this.sortedAt.lng)*w*_,(y.lat-this.sortedAt.lat)*w)>gd)&&(B.sort((F,T)=>C(F)-C(T)),this.sortedAt={lng:y.lng,lat:y.lat});let S=0;for(let F of B){let T=C(F);if(T>h){D++;continue}if(F.kind==="rule"&&F.target!==null&&x.has(F.target)){let N=this.entries.get(F.id);N&&N.model.retire();continue}let P=this.entries.get(F.id);if(S>=d){M++,P&&P.model.retire();continue}S++,v.add(F.id);let k=()=>{if(F.replaces===null)return;this.replacedBuildings.add(F.replaces);let N=this.underBuilding.find(F,a);N!==null&&this.replacedBuildings.add(N);let G=this.underVenue.find(F,s);G!==null&&this.replacedVenues.add(G);},O=P;if(O){k(),O.distance=T,O.leftAt=0,O.model.revive(),b<O.lod&&!O.upgrading&&this.loading<yi&&this.upgrade(O,b,r,i);continue}if(T>u){D++;continue}if(this.loading>=yi){E.push(F),k();continue}k(),this.spawn(F,T,b,r);}for(let F of [...this.entries.values()])if(!v.has(F.placement.id)){if(F.leftAt===0){F.leftAt=m;continue}m-F.leftAt>Ad&&F.model.retire();}for(let F of [...this.entries.values()])F.model.growTarget===0&&F.model.grow<=0&&this.release(F,i);if(this.known.size>4e3)for(let[F,T]of [...this.known.entries()])C(T)>h*3&&this.known.delete(F);let L=this.stats;L.found=B.length,L.kept=v.size,L.live=this.entries.size,L.tooFar=D,L.overBudget=M,L.queued=E.length,L.rules=A,L.loadingNow=this.loading,L.pendingNow=E.length,L.replaced=this.replacedBuildings.size,this.pending=E;}pump(){let e=this.addModel;if(this.stats.loadingNow=this.loading,this.stats.pendingNow=this.pending.length,!!e)for(;this.pending.length&&this.loading<yi&&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 i=this.makeModel(e.placement,t,true);e.upgrading=i,this.loading++,i.load(()=>{this.loading--,this.pump(),this.entries.get(e.placement.id)===e&&(e.upgrading=null,i.isLoaded&&(r(e.model),e.model=i,e.lod=t,o(i),this.onReady?.()));});}makeModel(e,t,o){let r=new Lo({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,i=false){let a=this.makeModel(e,o,i);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;}},At=(n,e)=>{let t=typeof n=="number"?n:Number(n);return Number.isFinite(t)?t:e},Ir=n=>{let e=At(n,NaN);return Number.isFinite(e)?e:null};function Bd(n,e){let t=n*360-180,o=Math.PI*(1-2*e),r=Math.atan(Math.sinh(o))*180/Math.PI;return {lng:t,lat:r}}function Cd(n,e,t,o,r,i,a,s){let l=(n-r)*(o-i)-(t-r)*(e-i),c=(n-a)*(i-s)-(r-a)*(e-s),u=(n-t)*(s-o)-(a-t)*(e-o),h=l<0||c<0||u<0,f=l>0||c>0||u>0;return !(h&&f)}var vd=200,xd={center:"translate(-50%, -50%)",top:"translate(-50%, 0)",bottom:"translate(-50%, -100%)",left:"translate(0, -50%)",right:"translate(-100%, -50%)"},To=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=xd[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??wd),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=$(this._coordinates),o=e.worldSize,r=e.worldPxToPoint(ie(t.lng)*o,ae(t.lat)*o,this.altitude);if(!r){this.culled=true,this.applyVisibility();return}let i=vd;if(r.x<-i||r.y<-i||r.x>e.width+i||r.y>e.height+i){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";}},wd='<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 Ho=class extends To{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 i=document.createElement("div");i.className="osmgl-popup-tip",o.appendChild(i);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 _d=[["\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."]],zl=new Map(_d);function gi(n){let e=n.split(" ");if(e.length<2)return n;let t=false,o=e.map(i=>{let a=zl.get(i.toLowerCase());return a?(t=true,i[0]===i[0].toUpperCase()?a[0].toUpperCase()+a.slice(1):a):i});return !t||!e.filter(i=>zl.get(i.toLowerCase())===void 0).length?n:o.join(" ")}function Bi(n,e){let t=[],o=[],r=[],i=[],a=[],s=e.textPlacement==="line",l=[],c=[],u=[];for(let h of n.features()){if(!Be(e.filter,h.properties))continue;let f=h.loadGeometry(),d=Md(h.type,f);if(!d)continue;let p=e.textField?Ai(e.textField,h.properties):"",m=p&&e.abbreviate?gi(p):p,y=e.iconImage?Ai(e.iconImage,h.properties):"";if(!(!m&&!y)){if(s){let b=Fd(h.type,f);if(!b)continue;u.push({text:m,line:b});continue}t.push(d[0],d[1]),o.push(m),r.push(y),i.push(Dd(h.properties)),a.push(e.iconRotate&&Math.round(Number(h.properties[e.iconRotate]??0))||0);}}if(s){for(let{text:h,line:f}of Ed(u)){c.push(l.length/2);for(let d of f)l.push(d);t.push(Math.round(f[0]),Math.round(f[1])),o.push(h),r.push(""),i.push(128),a.push(0);}c.push(l.length/2);}return o.length?{anchors:new Int16Array(t).buffer,texts:o,icons:r,priorities:new Uint8Array(i).buffer,rotations:new Int16Array(a).buffer,...s?{lines:new Int16Array(l).buffer,lineStarts:new Uint32Array(c).buffer}:{}}:null}function Ed(n){let e=[],t=new Map,o=new Map,r=(i,a,s)=>`${i}\u241F${a}\u241F${s}`;for(let{text:i,line:a}of n){let s=r(i,a[0],a[1]),l=r(i,a[a.length-2],a[a.length-1]),c=t.get(l),u=o.get(s);if(u!==void 0){let h=e[u];if(h.line.push(...a.slice(2)),o.delete(s),o.set(r(i,h.line[h.line.length-2],h.line[h.line.length-1]),u),c!==void 0&&c!==u){let f=e[c];h.line.push(...f.line.slice(2)),f.line=[],t.delete(l),o.set(r(i,h.line[h.line.length-2],h.line[h.line.length-1]),u);}continue}if(c!==void 0){let h=e[c];h.line.unshift(...a.slice(0,a.length-2)),t.delete(l),t.set(r(i,h.line[0],h.line[1]),c);continue}t.set(s,e.length),o.set(l,e.length),e.push({text:i,line:a});}return e.filter(i=>i.line.length>=4)}function Fd(n,e){if(n!==2)return null;let t=null,o=0;for(let r of e){if(r.length<4)continue;let i=0;for(let a=0;a+3<r.length;a+=2)i+=Math.hypot(r[a+2]-r[a],r[a+3]-r[a+1]);i>o&&(o=i,t=r);}return t}function Md(n,e){if(!e.length)return null;if(n===1){let a=e[0];return a.length>=2?[a[0],a[1]]:null}if(n===2){let a=-1,s=0,l=0;for(let c of e)for(let u=0;u+3<c.length;u+=2){let h=c[u+2]-c[u],f=c[u+3]-c[u+1],d=h*h+f*f;d>a&&(a=d,s=c[u]+h/2,l=c[u+1]+f/2);}return a>0?[Math.round(s),Math.round(l)]:null}let t=1/0,o=1/0,r=-1/0,i=-1/0;for(let a of e)for(let s=0;s<a.length;s+=2)a[s]<t&&(t=a[s]),a[s]>r&&(r=a[s]),a[s+1]<o&&(o=a[s+1]),a[s+1]>i&&(i=a[s+1]);return isFinite(t)?[Math.round((t+r)/2),Math.round((o+i)/2)]:null}function Dd(n){let e=n.rank;return typeof e=="number"&&isFinite(e)?Math.max(0,255-Math.min(e,255)):128}function Ai(n,e){let t=Array.isArray(n)?n:[n];for(let o of t){let r=true,a=o.replace(/\{([^}]+)\}/g,(s,l)=>{let c=e[l];return c==null||c===""?(r=false,""):String(c)}).trim();if(r&&a)return a}return ""}function Nl(n,e){let t=[],o=[];for(let r=0;r<n.length;r++){let i=n.feature(r);if(i.type===1&&Be(e,i.properties))for(let a of i.loadGeometry())for(let s=0;s+1<a.length;s+=2)t.push(a[s],a[s+1]),o.push(i.properties);}return o.length?{anchors:Int16Array.from(t).buffer,props:o}:null}function Sd(){let n=typeof self<"u"?self.origin:void 0;return n&&n!=="null"&&!n.startsWith("blob:")?n+"/":void 0}async function Kl(n,e){let t=performance.now(),o=Sd(),r=await fetch(n.url,{signal:e,credentials:"same-origin",...o?{referrer:o}:{}}),i=(b,g,A,B,x=0)=>({type:"loaded",id:n.id,buckets:{},timing:{fetchMs:B,parseMs:x},diag:{status:b,bytes:g,layers:A,built:0}});if(!r.ok){if(r.status===404||r.status===204)return i(r.status,0,[],performance.now()-t);throw new Error(`HTTP ${r.status} \u0434\u043B\u044F ${n.url}`)}let a=await r.arrayBuffer(),s=performance.now()-t;if(a.byteLength===0)return i(r.status,0,[],s);let l=performance.now(),c=new ro(a),u=Object.keys(c.layers),h={},f={},d=new Set,p=[],y=n.plan.some(b=>b.type==="surface"&&(b.elevation??0)>0)&&n.plan.some(b=>b.type==="line"&&b.ground)?Mn(n.metersPerTile):void 0;for(let b of n.plan){if(!Ld(b,n.zoom,n.sourceMaxZoom))continue;let g=c.layers[b.sourceLayer];if(!g)continue;let A=Td(n.zoom,g.extent);try{if(b.splitBy){let x=Hd(g,b.splitBy,b.filter);if(!x.length)continue;let w=f[b.splitBy]??(f[b.splitBy]=[]);for(let _ of x){w.includes(_)||w.push(_);let C={...b,splitBy:void 0,filter:Pd(b.filter,b.splitBy,_)},v=Ci(C,g,A,n.metersPerTile,y);v&&(h[Ke(b.id,_)]=v);}continue}if(b.network&&b.type==="line"){for(let x of kd(g,b.filter)){let w=Ci(b,g,A,n.metersPerTile,y,x);w&&(h[Ke(b.id,x)]=w,d.add(x));}continue}let B=Ci(b,g,A,n.metersPerTile,y);B&&(h[b.id]=B);}catch(B){p.push(`${b.id}: ${B instanceof Error?B.message:String(B)}`);}}return {type:"loaded",id:n.id,buckets:h,...Object.keys(f).length?{splits:f}:{},...d.size?{levels:[...d].sort((b,g)=>b-g)}:{},timing:{fetchMs:s,parseMs:performance.now()-l},diag:{status:r.status,bytes:a.byteLength,layers:u,built:Object.keys(h).length,...p.length?{failed:p}:{}}}}function Id(n){return e=>{let t=e.on;if(typeof t!="string"||!t)return 0;let o=0;for(let r of t.split(",")){let i=n[r];typeof i=="number"&&i>o&&(o=i);}return o}}function Ld(n,e,t){let o=e-1,r=e<t?e+1:24;return !(n.maxzoom<o||n.minzoom>r)}function Td(n,e){return n<=6?Math.max(64,e/24):0}function Ci(n,e,t,o,r,i){{if(n.type==="fill"){let s=o>0?o/e.extent:0,l=n.cornerRadius&&s>0?{radius:n.cornerRadius/s,segments:n.cornerSegments,extent:e.extent,minCutRatio:0,maxChord:ma/s}:void 0,c=Fn(e,n.filter,t,l,n.clipToTile===true,e.extent);return c?{kind:"fill",...c,extent:e.extent}:null}if(n.type==="surface"){let s=En(e,e.extent,n.filter,{metersPerUnit:o>0?o/e.extent:0,elevation:n.elevation??0,base:n.base,bevel:n.bevel,weld:n.weld,bevelDrop:n.bevelDrop,cornerRadius:n.cornerRadius,cornerSegments:n.cornerSegments,...r?{onShapes:l=>Dn(r,l,n.elevation??0,e.extent)}:{},...n.groundBy?{liftBy:Id(n.groundBy)}:{}});return s?{kind:"surface",...s}:null}if(n.type==="line"){let s=In(e,n.filter,t,n.ground?r:void 0,o>0?o/e.extent:0,{level:i});return s?{kind:"line",...s,extent:e.extent}:null}if(n.type==="model"){let s=Nl(e,n.filter);return s?{kind:"placement",...s,extent:e.extent}:null}if(n.type==="symbol"){let s=Bi(e,{filter:n.filter,textField:n.textField,iconImage:n.iconImage,iconRotate:n.iconRotate,textPlacement:n.textPlacement,abbreviate:n.abbreviate});return s?{kind:"symbol",...s,extent:e.extent}:null}let a=an(e,e.extent,n.filter,{metersPerUnit:o>0?o/e.extent:0,cornerRadius:n.cornerRadius,cornerSegments:n.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 Hd(n,e,t){let o=[];for(let r of n.features()){if(!Be(t,r.properties))continue;let i=r.properties[e];typeof i!="string"&&typeof i!="number"||o.includes(i)||o.push(i);}return o.sort((r,i)=>typeof r=="number"&&typeof i=="number"?r-i:String(r).localeCompare(String(i))),o}function kd(n,e){let t=[];for(let o of n.features()){if(!Be(e,o.properties))continue;let r=yt(o.properties);t.includes(r)||t.push(r);}return t.sort((o,r)=>o-r)}function Pd(n,e,t){let o=["==",e,t];return n?["all",n,o]:o}var vi='"use strict";(()=>{var or=Object.create;var Qt=Object.defineProperty;var sr=Object.getOwnPropertyDescriptor;var ur=Object.getOwnPropertyNames;var lr=Object.getPrototypeOf,cr=Object.prototype.hasOwnProperty;var fr=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var ar=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of ur(e))!cr.call(t,i)&&i!==n&&Qt(t,i,{get:()=>e[i],enumerable:!(r=sr(e,i))||r.enumerable});return t};var hr=(t,e,n)=>(n=t!=null?or(lr(t)):{},ar(e||!t||!t.__esModule?Qt(n,"default",{value:t,enumerable:!0}):n,t));var _n=fr((Ut,Gt)=>{(function(t,e){typeof Ut=="object"&&typeof Gt<"u"?Gt.exports=e():typeof define=="function"&&define.amd?define(e):(t=typeof globalThis<"u"?globalThis:t||self,t.polygonClipping=e())})(Ut,function(){"use strict";function t(g,o){var u={label:0,sent:function(){if(h[0]&1)throw h[1];return h[1]},trys:[],ops:[]},f,m,h,S;return S={next:v(0),throw:v(1),return:v(2)},typeof Symbol=="function"&&(S[Symbol.iterator]=function(){return this}),S;function v(M){return function(V){return F([M,V])}}function F(M){if(f)throw new TypeError("Generator is already executing.");for(;u;)try{if(f=1,m&&(h=M[0]&2?m.return:M[0]?m.throw||((h=m.return)&&h.call(m),0):m.next)&&!(h=h.call(m,M[1])).done)return h;switch(m=0,h&&(M=[M[0]&2,h.value]),M[0]){case 0:case 1:h=M;break;case 4:return u.label++,{value:M[1],done:!1};case 5:u.label++,m=M[1],M=[0];continue;case 7:M=u.ops.pop(),u.trys.pop();continue;default:if(h=u.trys,!(h=h.length>0&&h[h.length-1])&&(M[0]===6||M[0]===2)){u=0;continue}if(M[0]===3&&(!h||M[1]>h[0]&&M[1]<h[3])){u.label=M[1];break}if(M[0]===6&&u.label<h[1]){u.label=h[1],h=M;break}if(h&&u.label<h[2]){u.label=h[2],u.ops.push(M);break}h[2]&&u.ops.pop(),u.trys.pop();continue}M=o.call(g,u)}catch(V){M=[6,V],m=0}finally{f=h=0}if(M[0]&5)throw M[1];return{value:M[0]?M[1]:void 0,done:!0}}}var e=function(){function g(o,u){this.next=null,this.key=o,this.data=u,this.left=null,this.right=null}return g}();function n(g,o){return g>o?1:g<o?-1:0}function r(g,o,u){for(var f=new e(null,null),m=f,h=f;;){var S=u(g,o.key);if(S<0){if(o.left===null)break;if(u(g,o.left.key)<0){var v=o.left;if(o.left=v.right,v.right=o,o=v,o.left===null)break}h.left=o,h=o,o=o.left}else if(S>0){if(o.right===null)break;if(u(g,o.right.key)>0){var v=o.right;if(o.right=v.left,v.left=o,o=v,o.right===null)break}m.right=o,m=o,o=o.right}else break}return m.right=o.left,h.left=o.right,o.left=f.right,o.right=f.left,o}function i(g,o,u,f){var m=new e(g,o);if(u===null)return m.left=m.right=null,m;u=r(g,u,f);var h=f(g,u.key);return h<0?(m.left=u.left,m.right=u,u.left=null):h>=0&&(m.right=u.right,m.left=u,u.right=null),m}function s(g,o,u){var f=null,m=null;if(o){o=r(g,o,u);var h=u(o.key,g);h===0?(f=o.left,m=o.right):h<0?(m=o.right,o.right=null,f=o):(f=o.left,o.left=null,m=o)}return{left:f,right:m}}function l(g,o,u){return o===null?g:(g===null||(o=r(g.key,o,u),o.left=g),o)}function c(g,o,u,f,m){if(g){f(""+o+(u?"\\u2514\\u2500\\u2500 ":"\\u251C\\u2500\\u2500 ")+m(g)+`\n`);var h=o+(u?" ":"\\u2502 ");g.left&&c(g.left,h,!1,f,m),g.right&&c(g.right,h,!0,f,m)}}var a=function(){function g(o){o===void 0&&(o=n),this._root=null,this._size=0,this._comparator=o}return g.prototype.insert=function(o,u){return this._size++,this._root=i(o,u,this._root,this._comparator)},g.prototype.add=function(o,u){var f=new e(o,u);this._root===null&&(f.left=f.right=null,this._size++,this._root=f);var m=this._comparator,h=r(o,this._root,m),S=m(o,h.key);return S===0?this._root=h:(S<0?(f.left=h.left,f.right=h,h.left=null):S>0&&(f.right=h.right,f.left=h,h.right=null),this._size++,this._root=f),this._root},g.prototype.remove=function(o){this._root=this._remove(o,this._root,this._comparator)},g.prototype._remove=function(o,u,f){var m;if(u===null)return null;u=r(o,u,f);var h=f(o,u.key);return h===0?(u.left===null?m=u.right:(m=r(o,u.left,f),m.right=u.right),this._size--,m):u},g.prototype.pop=function(){var o=this._root;if(o){for(;o.left;)o=o.left;return this._root=r(o.key,this._root,this._comparator),this._root=this._remove(o.key,this._root,this._comparator),{key:o.key,data:o.data}}return null},g.prototype.findStatic=function(o){for(var u=this._root,f=this._comparator;u;){var m=f(o,u.key);if(m===0)return u;m<0?u=u.left:u=u.right}return null},g.prototype.find=function(o){return this._root&&(this._root=r(o,this._root,this._comparator),this._comparator(o,this._root.key)!==0)?null:this._root},g.prototype.contains=function(o){for(var u=this._root,f=this._comparator;u;){var m=f(o,u.key);if(m===0)return!0;m<0?u=u.left:u=u.right}return!1},g.prototype.forEach=function(o,u){for(var f=this._root,m=[],h=!1;!h;)f!==null?(m.push(f),f=f.left):m.length!==0?(f=m.pop(),o.call(u,f),f=f.right):h=!0;return this},g.prototype.range=function(o,u,f,m){for(var h=[],S=this._comparator,v=this._root,F;h.length!==0||v;)if(v)h.push(v),v=v.left;else{if(v=h.pop(),F=S(v.key,u),F>0)break;if(S(v.key,o)>=0&&f.call(m,v))return this;v=v.right}return this},g.prototype.keys=function(){var o=[];return this.forEach(function(u){var f=u.key;return o.push(f)}),o},g.prototype.values=function(){var o=[];return this.forEach(function(u){var f=u.data;return o.push(f)}),o},g.prototype.min=function(){return this._root?this.minNode(this._root).key:null},g.prototype.max=function(){return this._root?this.maxNode(this._root).key:null},g.prototype.minNode=function(o){if(o===void 0&&(o=this._root),o)for(;o.left;)o=o.left;return o},g.prototype.maxNode=function(o){if(o===void 0&&(o=this._root),o)for(;o.right;)o=o.right;return o},g.prototype.at=function(o){for(var u=this._root,f=!1,m=0,h=[];!f;)if(u)h.push(u),u=u.left;else if(h.length>0){if(u=h.pop(),m===o)return u;m++,u=u.right}else f=!0;return null},g.prototype.next=function(o){var u=this._root,f=null;if(o.right){for(f=o.right;f.left;)f=f.left;return f}for(var m=this._comparator;u;){var h=m(o.key,u.key);if(h===0)break;h<0?(f=u,u=u.left):u=u.right}return f},g.prototype.prev=function(o){var u=this._root,f=null;if(o.left!==null){for(f=o.left;f.right;)f=f.right;return f}for(var m=this._comparator;u;){var h=m(o.key,u.key);if(h===0)break;h<0?u=u.left:(f=u,u=u.right)}return f},g.prototype.clear=function(){return this._root=null,this._size=0,this},g.prototype.toList=function(){return y(this._root)},g.prototype.load=function(o,u,f){u===void 0&&(u=[]),f===void 0&&(f=!1);var m=o.length,h=this._comparator;if(f&&E(o,u,0,m-1,h),this._root===null)this._root=p(o,u,0,m),this._size=m;else{var S=b(this.toList(),x(o,u),h);m=this._size+m,this._root=d({head:S},0,m)}return this},g.prototype.isEmpty=function(){return this._root===null},Object.defineProperty(g.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(g.prototype,"root",{get:function(){return this._root},enumerable:!0,configurable:!0}),g.prototype.toString=function(o){o===void 0&&(o=function(f){return String(f.key)});var u=[];return c(this._root,"",!0,function(f){return u.push(f)},o),u.join("")},g.prototype.update=function(o,u,f){var m=this._comparator,h=s(o,this._root,m),S=h.left,v=h.right;m(o,u)<0?v=i(u,f,v,m):S=i(u,f,S,m),this._root=l(S,v,m)},g.prototype.split=function(o){return s(o,this._root,this._comparator)},g.prototype[Symbol.iterator]=function(){var o,u,f;return t(this,function(m){switch(m.label){case 0:o=this._root,u=[],f=!1,m.label=1;case 1:return f?[3,6]:o===null?[3,2]:(u.push(o),o=o.left,[3,5]);case 2:return u.length===0?[3,4]:(o=u.pop(),[4,o]);case 3:return m.sent(),o=o.right,[3,5];case 4:f=!0,m.label=5;case 5:return[3,1];case 6:return[2]}})},g}();function p(g,o,u,f){var m=f-u;if(m>0){var h=u+Math.floor(m/2),S=g[h],v=o[h],F=new e(S,v);return F.left=p(g,o,u,h),F.right=p(g,o,h+1,f),F}return null}function x(g,o){for(var u=new e(null,null),f=u,m=0;m<g.length;m++)f=f.next=new e(g[m],o[m]);return f.next=null,u.next}function y(g){for(var o=g,u=[],f=!1,m=new e(null,null),h=m;!f;)o?(u.push(o),o=o.left):u.length>0?(o=h=h.next=u.pop(),o=o.right):f=!0;return h.next=null,m.next}function d(g,o,u){var f=u-o;if(f>0){var m=o+Math.floor(f/2),h=d(g,o,m),S=g.head;return S.left=h,g.head=g.head.next,S.right=d(g,m+1,u),S}return null}function b(g,o,u){for(var f=new e(null,null),m=f,h=g,S=o;h!==null&&S!==null;)u(h.key,S.key)<0?(m.next=h,h=h.next):(m.next=S,S=S.next),m=m.next;return h!==null?m.next=h:S!==null&&(m.next=S),f.next}function E(g,o,u,f,m){if(!(u>=f)){for(var h=g[u+f>>1],S=u-1,v=f+1;;){do S++;while(m(g[S],h)<0);do v--;while(m(g[v],h)>0);if(S>=v)break;var F=g[S];g[S]=g[v],g[v]=F,F=o[S],o[S]=o[v],o[v]=F}E(g,o,u,v,m),E(g,o,v+1,f,m)}}let A=(g,o)=>g.ll.x<=o.x&&o.x<=g.ur.x&&g.ll.y<=o.y&&o.y<=g.ur.y,_=(g,o)=>{if(o.ur.x<g.ll.x||g.ur.x<o.ll.x||o.ur.y<g.ll.y||g.ur.y<o.ll.y)return null;let u=g.ll.x<o.ll.x?o.ll.x:g.ll.x,f=g.ur.x<o.ur.x?g.ur.x:o.ur.x,m=g.ll.y<o.ll.y?o.ll.y:g.ll.y,h=g.ur.y<o.ur.y?g.ur.y:o.ur.y;return{ll:{x:u,y:m},ur:{x:f,y:h}}},R=Number.EPSILON;R===void 0&&(R=Math.pow(2,-52));let L=R*R,k=(g,o)=>{if(-R<g&&g<R&&-R<o&&o<R)return 0;let u=g-o;return u*u<L*g*o?0:g<o?-1:1};class T{constructor(){this.reset()}reset(){this.xRounder=new O,this.yRounder=new O}round(o,u){return{x:this.xRounder.round(o),y:this.yRounder.round(u)}}}class O{constructor(){this.tree=new a,this.round(0)}round(o){let u=this.tree.add(o),f=this.tree.prev(u);if(f!==null&&k(u.key,f.key)===0)return this.tree.remove(o),f.key;let m=this.tree.next(u);return m!==null&&k(u.key,m.key)===0?(this.tree.remove(o),m.key):o}}let D=new T,U=11102230246251565e-32,P=134217729,C=(3+8*U)*U;function Y(g,o,u,f,m){let h,S,v,F,M=o[0],V=f[0],w=0,I=0;V>M==V>-M?(h=M,M=o[++w]):(h=V,V=f[++I]);let B=0;if(w<g&&I<u)for(V>M==V>-M?(S=M+h,v=h-(S-M),M=o[++w]):(S=V+h,v=h-(S-V),V=f[++I]),h=S,v!==0&&(m[B++]=v);w<g&&I<u;)V>M==V>-M?(S=h+M,F=S-h,v=h-(S-F)+(M-F),M=o[++w]):(S=h+V,F=S-h,v=h-(S-F)+(V-F),V=f[++I]),h=S,v!==0&&(m[B++]=v);for(;w<g;)S=h+M,F=S-h,v=h-(S-F)+(M-F),M=o[++w],h=S,v!==0&&(m[B++]=v);for(;I<u;)S=h+V,F=S-h,v=h-(S-F)+(V-F),V=f[++I],h=S,v!==0&&(m[B++]=v);return(h!==0||B===0)&&(m[B++]=h),B}function Q(g,o){let u=o[0];for(let f=1;f<g;f++)u+=o[f];return u}function Z(g){return new Float64Array(g)}let re=(3+16*U)*U,X=(2+12*U)*U,$=(9+64*U)*U*U,z=Z(4),N=Z(8),q=Z(12),te=Z(16),K=Z(4);function oe(g,o,u,f,m,h,S){let v,F,M,V,w,I,B,H,G,W,j,ne,ae,ue,he,pe,ge,me,Se=g-m,Ee=u-m,Me=o-h,Re=f-h;ue=Se*Re,I=P*Se,B=I-(I-Se),H=Se-B,I=P*Re,G=I-(I-Re),W=Re-G,he=H*W-(ue-B*G-H*G-B*W),pe=Me*Ee,I=P*Me,B=I-(I-Me),H=Me-B,I=P*Ee,G=I-(I-Ee),W=Ee-G,ge=H*W-(pe-B*G-H*G-B*W),j=he-ge,w=he-j,z[0]=he-(j+w)+(w-ge),ne=ue+j,w=ne-ue,ae=ue-(ne-w)+(j-w),j=ae-pe,w=ae-j,z[1]=ae-(j+w)+(w-pe),me=ne+j,w=me-ne,z[2]=ne-(me-w)+(j-w),z[3]=me;let ke=Q(4,z),Je=X*S;if(ke>=Je||-ke>=Je||(w=g-Se,v=g-(Se+w)+(w-m),w=u-Ee,M=u-(Ee+w)+(w-m),w=o-Me,F=o-(Me+w)+(w-h),w=f-Re,V=f-(Re+w)+(w-h),v===0&&F===0&&M===0&&V===0)||(Je=$*S+C*Math.abs(ke),ke+=Se*V+Re*v-(Me*M+Ee*F),ke>=Je||-ke>=Je))return ke;ue=v*Re,I=P*v,B=I-(I-v),H=v-B,I=P*Re,G=I-(I-Re),W=Re-G,he=H*W-(ue-B*G-H*G-B*W),pe=F*Ee,I=P*F,B=I-(I-F),H=F-B,I=P*Ee,G=I-(I-Ee),W=Ee-G,ge=H*W-(pe-B*G-H*G-B*W),j=he-ge,w=he-j,K[0]=he-(j+w)+(w-ge),ne=ue+j,w=ne-ue,ae=ue-(ne-w)+(j-w),j=ae-pe,w=ae-j,K[1]=ae-(j+w)+(w-pe),me=ne+j,w=me-ne,K[2]=ne-(me-w)+(j-w),K[3]=me;let nr=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 rr=Y(nr,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 ir=Y(rr,q,4,K,te);return te[ir-1]}function ee(g,o,u,f,m,h){let S=(o-h)*(u-m),v=(g-m)*(f-h),F=S-v,M=Math.abs(S+v);return Math.abs(F)>=re*M?F:-oe(g,o,u,f,m,h,M)}let J=(g,o)=>g.x*o.y-g.y*o.x,fe=(g,o)=>g.x*o.x+g.y*o.y,be=(g,o,u)=>{let f=ee(g.x,g.y,o.x,o.y,u.x,u.y);return f>0?-1:f<0?1:0},de=g=>Math.sqrt(fe(g,g)),Fe=(g,o,u)=>{let f={x:o.x-g.x,y:o.y-g.y},m={x:u.x-g.x,y:u.y-g.y};return J(m,f)/de(m)/de(f)},Ce=(g,o,u)=>{let f={x:o.x-g.x,y:o.y-g.y},m={x:u.x-g.x,y:u.y-g.y};return fe(m,f)/de(m)/de(f)},Le=(g,o,u)=>o.y===0?null:{x:g.x+o.x/o.y*(u-g.y),y:u},Ve=(g,o,u)=>o.x===0?null:{x:u,y:g.y+o.y/o.x*(u-g.x)},we=(g,o,u,f)=>{if(o.x===0)return Ve(u,f,g.x);if(f.x===0)return Ve(g,o,u.x);if(o.y===0)return Le(u,f,g.y);if(f.y===0)return Le(g,o,u.y);let m=J(o,f);if(m==0)return null;let h={x:u.x-g.x,y:u.y-g.y},S=J(h,o)/m,v=J(h,f)/m,F=g.x+v*o.x,M=u.x+S*f.x,V=g.y+v*o.y,w=u.y+S*f.y,I=(F+M)/2,B=(V+w)/2;return{x:I,y:B}};class se{static compare(o,u){let f=se.comparePoints(o.point,u.point);return f!==0?f:(o.point!==u.point&&o.link(u),o.isLeft!==u.isLeft?o.isLeft?1:-1:xe.compare(o.segment,u.segment))}static comparePoints(o,u){return o.x<u.x?-1:o.x>u.x?1:o.y<u.y?-1:o.y>u.y?1:0}constructor(o,u){o.events===void 0?o.events=[this]:o.events.push(this),this.point=o,this.isLeft=u}link(o){if(o.point===this.point)throw new Error("Tried to link already linked events");let u=o.point.events;for(let f=0,m=u.length;f<m;f++){let h=u[f];this.point.events.push(h),h.point=this.point}this.checkForConsuming()}checkForConsuming(){let o=this.point.events.length;for(let u=0;u<o;u++){let f=this.point.events[u];if(f.segment.consumedBy===void 0)for(let m=u+1;m<o;m++){let h=this.point.events[m];h.consumedBy===void 0&&f.otherSE.point.events===h.otherSE.point.events&&f.segment.consume(h.segment)}}}getAvailableLinkedEvents(){let o=[];for(let u=0,f=this.point.events.length;u<f;u++){let m=this.point.events[u];m!==this&&!m.segment.ringOut&&m.segment.isInResult()&&o.push(m)}return o}getLeftmostComparator(o){let u=new Map,f=m=>{let h=m.otherSE;u.set(m,{sine:Fe(this.point,o.point,h.point),cosine:Ce(this.point,o.point,h.point)})};return(m,h)=>{u.has(m)||f(m),u.has(h)||f(h);let{sine:S,cosine:v}=u.get(m),{sine:F,cosine:M}=u.get(h);return S>=0&&F>=0?v<M?1:v>M?-1:0:S<0&&F<0?v<M?-1:v>M?1:0:F<S?-1:F>S?1:0}}}let Pe=0;class xe{static compare(o,u){let f=o.leftSE.point.x,m=u.leftSE.point.x,h=o.rightSE.point.x,S=u.rightSE.point.x;if(S<f)return 1;if(h<m)return-1;let v=o.leftSE.point.y,F=u.leftSE.point.y,M=o.rightSE.point.y,V=u.rightSE.point.y;if(f<m){if(F<v&&F<M)return 1;if(F>v&&F>M)return-1;let w=o.comparePoint(u.leftSE.point);if(w<0)return 1;if(w>0)return-1;let I=u.comparePoint(o.rightSE.point);return I!==0?I:-1}if(f>m){if(v<F&&v<V)return-1;if(v>F&&v>V)return 1;let w=u.comparePoint(o.leftSE.point);if(w!==0)return w;let I=o.comparePoint(u.rightSE.point);return I<0?1:I>0?-1:1}if(v<F)return-1;if(v>F)return 1;if(h<S){let w=u.comparePoint(o.rightSE.point);if(w!==0)return w}if(h>S){let w=o.comparePoint(u.rightSE.point);if(w<0)return 1;if(w>0)return-1}if(h!==S){let w=M-v,I=h-f,B=V-F,H=S-m;if(w>I&&B<H)return 1;if(w<I&&B>H)return-1}return h>S?1:h<S||M<V?-1:M>V?1:o.id<u.id?-1:o.id>u.id?1:0}constructor(o,u,f,m){this.id=++Pe,this.leftSE=o,o.segment=this,o.otherSE=u,this.rightSE=u,u.segment=this,u.otherSE=o,this.rings=f,this.windings=m}static fromRing(o,u,f){let m,h,S,v=se.comparePoints(o,u);if(v<0)m=o,h=u,S=1;else if(v>0)m=u,h=o,S=-1;else throw new Error(`Tried to create degenerate segment at [${o.x}, ${o.y}]`);let F=new se(m,!0),M=new se(h,!1);return new xe(F,M,[f],[S])}replaceRightSE(o){this.rightSE=o,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}bbox(){let o=this.leftSE.point.y,u=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:o<u?o:u},ur:{x:this.rightSE.point.x,y:o>u?o:u}}}vector(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}isAnEndpoint(o){return o.x===this.leftSE.point.x&&o.y===this.leftSE.point.y||o.x===this.rightSE.point.x&&o.y===this.rightSE.point.y}comparePoint(o){if(this.isAnEndpoint(o))return 0;let u=this.leftSE.point,f=this.rightSE.point,m=this.vector();if(u.x===f.x)return o.x===u.x?0:o.x<u.x?1:-1;let h=(o.y-u.y)/m.y,S=u.x+h*m.x;if(o.x===S)return 0;let v=(o.x-u.x)/m.x,F=u.y+v*m.y;return o.y===F?0:o.y<F?-1:1}getIntersection(o){let u=this.bbox(),f=o.bbox(),m=_(u,f);if(m===null)return null;let h=this.leftSE.point,S=this.rightSE.point,v=o.leftSE.point,F=o.rightSE.point,M=A(u,v)&&this.comparePoint(v)===0,V=A(f,h)&&o.comparePoint(h)===0,w=A(u,F)&&this.comparePoint(F)===0,I=A(f,S)&&o.comparePoint(S)===0;if(V&&M)return I&&!w?S:!I&&w?F:null;if(V)return w&&h.x===F.x&&h.y===F.y?null:h;if(M)return I&&S.x===v.x&&S.y===v.y?null:v;if(I&&w)return null;if(I)return S;if(w)return F;let B=we(h,this.vector(),v,o.vector());return B===null||!A(m,B)?null:D.round(B.x,B.y)}split(o){let u=[],f=o.events!==void 0,m=new se(o,!0),h=new se(o,!1),S=this.rightSE;this.replaceRightSE(h),u.push(h),u.push(m);let v=new xe(m,S,this.rings.slice(),this.windings.slice());return se.comparePoints(v.leftSE.point,v.rightSE.point)>0&&v.swapEvents(),se.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),f&&(m.checkForConsuming(),h.checkForConsuming()),u}swapEvents(){let o=this.rightSE;this.rightSE=this.leftSE,this.leftSE=o,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(let u=0,f=this.windings.length;u<f;u++)this.windings[u]*=-1}consume(o){let u=this,f=o;for(;u.consumedBy;)u=u.consumedBy;for(;f.consumedBy;)f=f.consumedBy;let m=xe.compare(u,f);if(m!==0){if(m>0){let h=u;u=f,f=h}if(u.prev===f){let h=u;u=f,f=h}for(let h=0,S=f.rings.length;h<S;h++){let v=f.rings[h],F=f.windings[h],M=u.rings.indexOf(v);M===-1?(u.rings.push(v),u.windings.push(F)):u.windings[M]+=F}f.rings=null,f.windings=null,f.consumedBy=u,f.leftSE.consumedBy=u.leftSE,f.rightSE.consumedBy=u.rightSE}}prevInResult(){return this._prevInResult!==void 0?this._prevInResult:(this.prev?this.prev.isInResult()?this._prevInResult=this.prev:this._prevInResult=this.prev.prevInResult():this._prevInResult=null,this._prevInResult)}beforeState(){if(this._beforeState!==void 0)return this._beforeState;if(!this.prev)this._beforeState={rings:[],windings:[],multiPolys:[]};else{let o=this.prev.consumedBy||this.prev;this._beforeState=o.afterState()}return this._beforeState}afterState(){if(this._afterState!==void 0)return this._afterState;let o=this.beforeState();this._afterState={rings:o.rings.slice(0),windings:o.windings.slice(0),multiPolys:[]};let u=this._afterState.rings,f=this._afterState.windings,m=this._afterState.multiPolys;for(let v=0,F=this.rings.length;v<F;v++){let M=this.rings[v],V=this.windings[v],w=u.indexOf(M);w===-1?(u.push(M),f.push(V)):f[w]+=V}let h=[],S=[];for(let v=0,F=u.length;v<F;v++){if(f[v]===0)continue;let M=u[v],V=M.poly;if(S.indexOf(V)===-1)if(M.isExterior)h.push(V);else{S.indexOf(V)===-1&&S.push(V);let w=h.indexOf(M.poly);w!==-1&&h.splice(w,1)}}for(let v=0,F=h.length;v<F;v++){let M=h[v].multiPoly;m.indexOf(M)===-1&&m.push(M)}return this._afterState}isInResult(){if(this.consumedBy)return!1;if(this._isInResult!==void 0)return this._isInResult;let o=this.beforeState().multiPolys,u=this.afterState().multiPolys;switch(ve.type){case"union":{let f=o.length===0,m=u.length===0;this._isInResult=f!==m;break}case"intersection":{let f,m;o.length<u.length?(f=o.length,m=u.length):(f=u.length,m=o.length),this._isInResult=m===ve.numMultiPolys&&f<m;break}case"xor":{let f=Math.abs(o.length-u.length);this._isInResult=f%2===1;break}case"difference":{let f=m=>m.length===1&&m[0].isSubject;this._isInResult=f(o)!==f(u);break}default:throw new Error(`Unrecognized operation type found ${ve.type}`)}return this._isInResult}}class Be{constructor(o,u,f){if(!Array.isArray(o)||o.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=u,this.isExterior=f,this.segments=[],typeof o[0][0]!="number"||typeof o[0][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let m=D.round(o[0][0],o[0][1]);this.bbox={ll:{x:m.x,y:m.y},ur:{x:m.x,y:m.y}};let h=m;for(let S=1,v=o.length;S<v;S++){if(typeof o[S][0]!="number"||typeof o[S][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let F=D.round(o[S][0],o[S][1]);F.x===h.x&&F.y===h.y||(this.segments.push(xe.fromRing(h,F,this)),F.x<this.bbox.ll.x&&(this.bbox.ll.x=F.x),F.y<this.bbox.ll.y&&(this.bbox.ll.y=F.y),F.x>this.bbox.ur.x&&(this.bbox.ur.x=F.x),F.y>this.bbox.ur.y&&(this.bbox.ur.y=F.y),h=F)}(m.x!==h.x||m.y!==h.y)&&this.segments.push(xe.fromRing(h,m,this))}getSweepEvents(){let o=[];for(let u=0,f=this.segments.length;u<f;u++){let m=this.segments[u];o.push(m.leftSE),o.push(m.rightSE)}return o}}class Oe{constructor(o,u){if(!Array.isArray(o))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new Be(o[0],this,!0),this.bbox={ll:{x:this.exteriorRing.bbox.ll.x,y:this.exteriorRing.bbox.ll.y},ur:{x:this.exteriorRing.bbox.ur.x,y:this.exteriorRing.bbox.ur.y}},this.interiorRings=[];for(let f=1,m=o.length;f<m;f++){let h=new Be(o[f],this,!1);h.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=h.bbox.ll.x),h.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=h.bbox.ll.y),h.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=h.bbox.ur.x),h.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=h.bbox.ur.y),this.interiorRings.push(h)}this.multiPoly=u}getSweepEvents(){let o=this.exteriorRing.getSweepEvents();for(let u=0,f=this.interiorRings.length;u<f;u++){let m=this.interiorRings[u].getSweepEvents();for(let h=0,S=m.length;h<S;h++)o.push(m[h])}return o}}class De{constructor(o,u){if(!Array.isArray(o))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{typeof o[0][0][0]=="number"&&(o=[o])}catch{}this.polys=[],this.bbox={ll:{x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY},ur:{x:Number.NEGATIVE_INFINITY,y:Number.NEGATIVE_INFINITY}};for(let f=0,m=o.length;f<m;f++){let h=new Oe(o[f],this);h.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=h.bbox.ll.x),h.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=h.bbox.ll.y),h.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=h.bbox.ur.x),h.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=h.bbox.ur.y),this.polys.push(h)}this.isSubject=u}getSweepEvents(){let o=[];for(let u=0,f=this.polys.length;u<f;u++){let m=this.polys[u].getSweepEvents();for(let h=0,S=m.length;h<S;h++)o.push(m[h])}return o}}class Ie{static factory(o){let u=[];for(let f=0,m=o.length;f<m;f++){let h=o[f];if(!h.isInResult()||h.ringOut)continue;let S=null,v=h.leftSE,F=h.rightSE,M=[v],V=v.point,w=[];for(;S=v,v=F,M.push(v),v.point!==V;)for(;;){let I=v.getAvailableLinkedEvents();if(I.length===0){let G=M[0].point,W=M[M.length-1].point;throw new Error(`Unable to complete output ring starting at [${G.x}, ${G.y}]. Last matching segment found ends at [${W.x}, ${W.y}].`)}if(I.length===1){F=I[0].otherSE;break}let B=null;for(let G=0,W=w.length;G<W;G++)if(w[G].point===v.point){B=G;break}if(B!==null){let G=w.splice(B)[0],W=M.splice(G.index);W.unshift(W[0].otherSE),u.push(new Ie(W.reverse()));continue}w.push({index:M.length,point:v.point});let H=v.getLeftmostComparator(S);F=I.sort(H)[0].otherSE;break}u.push(new Ie(M))}return u}constructor(o){this.events=o;for(let u=0,f=o.length;u<f;u++)o[u].segment.ringOut=this;this.poly=null}getGeom(){let o=this.events[0].point,u=[o];for(let M=1,V=this.events.length-1;M<V;M++){let w=this.events[M].point,I=this.events[M+1].point;be(w,o,I)!==0&&(u.push(w),o=w)}if(u.length===1)return null;let f=u[0],m=u[1];be(f,o,m)===0&&u.shift(),u.push(u[0]);let h=this.isExteriorRing()?1:-1,S=this.isExteriorRing()?0:u.length-1,v=this.isExteriorRing()?u.length:-1,F=[];for(let M=S;M!=v;M+=h)F.push([u[M].x,u[M].y]);return F}isExteriorRing(){if(this._isExteriorRing===void 0){let o=this.enclosingRing();this._isExteriorRing=o?!o.isExteriorRing():!0}return this._isExteriorRing}enclosingRing(){return this._enclosingRing===void 0&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}_calcEnclosingRing(){let o=this.events[0];for(let m=1,h=this.events.length;m<h;m++){let S=this.events[m];se.compare(o,S)>0&&(o=S)}let u=o.segment.prevInResult(),f=u?u.prevInResult():null;for(;;){if(!u)return null;if(!f)return u.ringOut;if(f.ringOut!==u.ringOut)return f.ringOut.enclosingRing()!==u.ringOut?u.ringOut:u.ringOut.enclosingRing();u=f.prevInResult(),f=u?u.prevInResult():null}}}class ze{constructor(o){this.exteriorRing=o,o.poly=this,this.interiorRings=[]}addInterior(o){this.interiorRings.push(o),o.poly=this}getGeom(){let o=[this.exteriorRing.getGeom()];if(o[0]===null)return null;for(let u=0,f=this.interiorRings.length;u<f;u++){let m=this.interiorRings[u].getGeom();m!==null&&o.push(m)}return o}}class vt{constructor(o){this.rings=o,this.polys=this._composePolys(o)}getGeom(){let o=[];for(let u=0,f=this.polys.length;u<f;u++){let m=this.polys[u].getGeom();m!==null&&o.push(m)}return o}_composePolys(o){let u=[];for(let f=0,m=o.length;f<m;f++){let h=o[f];if(!h.poly)if(h.isExteriorRing())u.push(new ze(h));else{let S=h.enclosingRing();S.poly||u.push(new ze(S)),S.poly.addInterior(h)}}return u}}class ft{constructor(o){let u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:xe.compare;this.queue=o,this.tree=new a(u),this.segments=[]}process(o){let u=o.segment,f=[];if(o.consumedBy)return o.isLeft?this.queue.remove(o.otherSE):this.tree.remove(u),f;let m=o.isLeft?this.tree.add(u):this.tree.find(u);if(!m)throw new Error(`Unable to find segment #${u.id} [${u.leftSE.point.x}, ${u.leftSE.point.y}] -> [${u.rightSE.point.x}, ${u.rightSE.point.y}] in SweepLine tree.`);let h=m,S=m,v,F;for(;v===void 0;)h=this.tree.prev(h),h===null?v=null:h.key.consumedBy===void 0&&(v=h.key);for(;F===void 0;)S=this.tree.next(S),S===null?F=null:S.key.consumedBy===void 0&&(F=S.key);if(o.isLeft){let M=null;if(v){let w=v.getIntersection(u);if(w!==null&&(u.isAnEndpoint(w)||(M=w),!v.isAnEndpoint(w))){let I=this._splitSafely(v,w);for(let B=0,H=I.length;B<H;B++)f.push(I[B])}}let V=null;if(F){let w=F.getIntersection(u);if(w!==null&&(u.isAnEndpoint(w)||(V=w),!F.isAnEndpoint(w))){let I=this._splitSafely(F,w);for(let B=0,H=I.length;B<H;B++)f.push(I[B])}}if(M!==null||V!==null){let w=null;M===null?w=V:V===null?w=M:w=se.comparePoints(M,V)<=0?M:V,this.queue.remove(u.rightSE),f.push(u.rightSE);let I=u.split(w);for(let B=0,H=I.length;B<H;B++)f.push(I[B])}f.length>0?(this.tree.remove(u),f.push(o)):(this.segments.push(u),u.prev=v)}else{if(v&&F){let M=v.getIntersection(F);if(M!==null){if(!v.isAnEndpoint(M)){let V=this._splitSafely(v,M);for(let w=0,I=V.length;w<I;w++)f.push(V[w])}if(!F.isAnEndpoint(M)){let V=this._splitSafely(F,M);for(let w=0,I=V.length;w<I;w++)f.push(V[w])}}}this.tree.remove(u)}return f}_splitSafely(o,u){this.tree.remove(o);let f=o.rightSE;this.queue.remove(f);let m=o.split(u);return m.push(f),o.consumedBy===void 0&&this.tree.add(o),m}}let Wt=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,qn=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6;class er{run(o,u,f){ve.type=o,D.reset();let m=[new De(u,!0)];for(let w=0,I=f.length;w<I;w++)m.push(new De(f[w],!1));if(ve.numMultiPolys=m.length,ve.type==="difference"){let w=m[0],I=1;for(;I<m.length;)_(m[I].bbox,w.bbox)!==null?I++:m.splice(I,1)}if(ve.type==="intersection")for(let w=0,I=m.length;w<I;w++){let B=m[w];for(let H=w+1,G=m.length;H<G;H++)if(_(B.bbox,m[H].bbox)===null)return[]}let h=new a(se.compare);for(let w=0,I=m.length;w<I;w++){let B=m[w].getSweepEvents();for(let H=0,G=B.length;H<G;H++)if(h.insert(B[H]),h.size>Wt)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big).")}let S=new ft(h),v=h.size,F=h.pop();for(;F;){let w=F.key;if(h.size===v){let B=w.segment;throw new Error(`Unable to pop() ${w.isLeft?"left":"right"} SweepEvent [${w.point.x}, ${w.point.y}] from segment #${B.id} [${B.leftSE.point.x}, ${B.leftSE.point.y}] -> [${B.rightSE.point.x}, ${B.rightSE.point.y}] from queue.`)}if(h.size>Wt)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big).");if(S.segments.length>qn)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments).");let I=S.process(w);for(let B=0,H=I.length;B<H;B++){let G=I[B];G.consumedBy===void 0&&h.insert(G)}v=h.size,F=h.pop()}D.reset();let M=Ie.factory(S.segments);return new vt(M).getGeom()}}let ve=new er;var tr={union:function(g){for(var o=arguments.length,u=new Array(o>1?o-1:0),f=1;f<o;f++)u[f-1]=arguments[f];return ve.run("union",g,u)},intersection:function(g){for(var o=arguments.length,u=new Array(o>1?o-1:0),f=1;f<o;f++)u[f-1]=arguments[f];return ve.run("intersection",g,u)},xor:function(g){for(var o=arguments.length,u=new Array(o>1?o-1:0),f=1;f<o;f++)u[f-1]=arguments[f];return ve.run("xor",g,u)},difference:function(g){for(var o=arguments.length,u=new Array(o>1?o-1:0),f=1;f<o;f++)u[f-1]=arguments[f];return ve.run("difference",g,u)}};return tr})});var nt=new Set,St=!1;function Te(t,e,n=2){let r=e&&e.length,i=r?e[0]*n:t.length;nt.size&&nt.clear();let s=en(t,0,i,n,!0),l=[];if(!s||s.next===s.prev)return l;let c=0,a=0,p=0;if(r&&(s=gr(t,e,s,n)),t.length>80*n){c=t[0],a=t[1];let x=c,y=a;for(let d=n;d<i;d+=n){let b=t[d],E=t[d+1];b<c&&(c=b),E<a&&(a=E),b>x&&(x=b),E>y&&(y=E)}p=Math.max(x-c,y-a),p=p!==0?32767/p:0}return Et(s,l,c,a,p),l}function en(t,e,n,r,i){let s=null;if(i===_r(t,e,n,r)>0)for(let l=e;l<n;l+=r)s=qt(l/r|0,t[l],t[l+1],s);else for(let l=n-r;l>=e;l-=r)s=qt(l/r|0,t[l],t[l+1],s);return s&&rt(s,s.next)&&(ot(s),s=s.next),s}function Ge(t,e=t){let n=e===t,r=t,i;do i=!1,r!==r.next&&(nt.size===0||!nt.has(r))&&(rt(r,r.next)||le(r.prev,r,r.next)===0)?((n||r===e)&&(e=r.prev),St=!0,ot(r),r=r.prev,i=!0):(n||r!==e)&&(r=r.next,i=!n);while(i||r!==e);return e}function Et(t,e,n,r,i){i&&Mr(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?mr(t,n,r,i):pr(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=xr(t,e),s=t,l=!0;continue}dr(t,e,n,r,i);break}}}function pr(t){let e=t.prev,n=t,r=t.next,i=e.x,s=n.x,l=r.x,c=e.y,a=n.y,p=r.y,x=Math.min(i,s,l),y=Math.min(c,a,p),d=Math.max(i,s,l),b=Math.max(c,a,p),E=r.next;for(;E!==e;){if(E.x>=x&&E.x<=d&&E.y>=y&&E.y<=b&&!(i===E.x&&c===E.y)&&mt(i,c,s,a,l,p,E.x,E.y)&&le(E.prev,E,E.next)>=0)return!1;E=E.next}return!0}function mr(t,e,n,r){let i=t.prev,s=t,l=t.next,c=i.x,a=s.x,p=l.x,x=i.y,y=s.y,d=l.y,b=Math.min(c,a,p),E=Math.min(x,y,d),A=Math.max(c,a,p),_=Math.max(x,y,d),R=It(b,E,e,n,r),L=It(A,_,e,n,r),k=t.prevZ;for(;k&&k.z>=R;){if(k.x>=b&&k.x<=A&&k.y>=E&&k.y<=_&&k!==l&&!(c===k.x&&x===k.y)&&mt(c,x,a,y,p,d,k.x,k.y)&&le(k.prev,k,k.next)>=0)return!1;k=k.prevZ}let T=t.nextZ;for(;T&&T.z<=L;){if(T.x>=b&&T.x<=A&&T.y>=E&&T.y<=_&&T!==l&&!(c===T.x&&x===T.y)&&mt(c,x,a,y,p,d,T.x,T.y)&&le(T.prev,T,T.next)>=0)return!1;T=T.nextZ}return!0}function xr(t,e){let n=t,r=!1;do{let i=n.prev,s=n.next.next;rn(i,n,n.next,s,!1)&&it(i,s)&&it(s,i)&&(e.push(i.i,n.i,s.i),ot(n),ot(n.next),n=t=s,r=!0),n=n.next}while(n!==t);return r?Ge(n):n}function dr(t,e,n,r,i){let s=t;do{let l=s.next.next;for(;l!==s.prev;){if(s.i!==l.i&&Ir(s,l)){let c=on(s,l);s=Ge(s,s.next),c=Ge(c,c.next),Et(s,e,n,r,i),Et(c,e,n,r,i);return}l=l.next}s=s.next}while(s!==t)}var Mt=!1;function gr(t,e,n,r){let i=[];for(let s=0,l=e.length;s<l;s++){let c=e[s]*r,a=s<l-1?e[s+1]*r:t.length,p=en(t,c,a,r,!1);p===p.next&&nt.add(p),i.push(Fr(p))}i.sort(yr),wr(t.length/r,e.length),nn(n,n),Mt=!0;for(let s=0;s<i.length;s++)n=br(i[s],n);return Mt=!1,Ge(n)}function yr(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 br(t,e){let n=Sr(t,e);if(!n)return e;let r=on(n,t),i=r.next;return nn(n,i.next),Ge(r,r.next),Ge(n,n.next)}var tn=16,ie=new Float64Array(0),pt=0,Rt=[],Ft=[];function wr(t,e){let n=Math.ceil((t+2*e)/tn)+e+2;ie.length<n*4&&(ie=new Float64Array(n*4)),pt=0}function nn(t,e){let n=t;do{let r=pt++;Rt[r]=n;let i=1/0,s=1/0,l=-1/0,c=-1/0,a=0;do{let x=n.next;n.z=r,n.x<i&&(i=n.x),n.x>l&&(l=n.x),n.y<s&&(s=n.y),n.y>c&&(c=n.y),x.x<i&&(i=x.x),x.x>l&&(l=x.x),x.y<s&&(s=x.y),x.y>c&&(c=x.y),n=x}while(++a<tn&&n!==e);Ft[r]=n;let p=r*4;ie[p]=i,ie[p+1]=s,ie[p+2]=l,ie[p+3]=c}while(n!==e)}function vr(t,e){let n=t.z*4;e.x<ie[n]&&(ie[n]=e.x),e.y<ie[n+1]&&(ie[n+1]=e.y),e.x>ie[n+2]&&(ie[n+2]=e.x),e.y>ie[n+3]&&(ie[n+3]=e.y)}function Kt(t){let e=Ft[t];for(;e.prev.next!==e;)e=e.next;return Ft[t]=e,e}function Jt(t){let e=Rt[t];for(;e.prev.next!==e;)e=e.next;return Rt[t]=e,e}function Sr(t,e){let n=e,r=t.x,i=t.y,s=-1/0,l;if(rt(t,n))return n;for(let d=0,b=0;d<pt;d++,b+=4){if(i<ie[b+1]||i>ie[b+3]||ie[b]>r||ie[b+2]<=s)continue;let E=Kt(d);n=Jt(d);do{if(n.prev.next===n){if(rt(t,n.next))return n.next;if(i<=n.y&&i>=n.next.y&&n.next.y!==n.y){let A=n.x+(i-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(A<=r&&A>s&&(s=A,l=n.x<n.next.x?n:n.next,A===r))return l}}n=n.next}while(n!==E)}if(!l)return null;let c=l.x,a=l.y,p=Math.min(i,a),x=Math.max(i,a),y=1/0;for(let d=0,b=0;d<pt;d++,b+=4){if(ie[b+2]<c||ie[b]>r||ie[b+3]<p||ie[b+1]>x)continue;let E=Kt(d);n=Jt(d);do{if(n.prev.next===n&&r>=n.x&&n.x>=c&&r!==n.x&&mt(i<a?r:s,i,c,a,i<a?s:r,i,n.x,n.y)){let A=Math.abs(i-n.y)/(r-n.x);(it(n,t)||n.y===i&&n.next.y===i&&n.next.x>r)&&(A<y||A===y&&(n.x>l.x||n.x===l.x&&Er(l,n)))&&(l=n,y=A)}n=n.next}while(n!==E)}return l}function Er(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 Mr(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);Rr(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 Rr(t){if(t<=32){for(let e=1;e<t;e++){let n=ye[e],r=n.z,i=e-1;for(;i>=0&&ye[i].z>r;)ye[i+1]=ye[i],i--;ye[i+1]=n}return}Ue.length<t&&(Ue=new Uint32Array(t),et=new Uint32Array(t),qe=new Array(t));for(let e=0;e<t;e++)Ue[e]=ye[e].z;at(t,ye,Ue,qe,et,0),at(t,qe,et,ye,Ue,8),at(t,ye,Ue,qe,et,16),at(t,qe,et,ye,Ue,24)}function at(t,e,n,r,i,s){tt.fill(0);for(let c=0;c<t;c++)tt[n[c]>>>s&255]++;let l=0;for(let c=0;c<256;c++){let a=tt[c];tt[c]=l,l+=a}for(let c=0;c<t;c++){let a=n[c],p=tt[a>>>s&255]++;r[p]=e[c],i[p]=a}}function It(t,e,n,r,i){return t=(t-n)*i|0,e=(e-r)*i|0,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,t|e<<1}function Fr(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 Ir(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))&&!Pr(t,e)&&(n||kr(t,e))}function le(t,e,n){return(e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y)}function rt(t,e){return t.x===e.x&&t.y===e.y}function rn(t,e,n,r,i=!0){let s=le(t,e,n),l=le(t,e,r),c=le(n,r,t),a=le(n,r,e);return(s>0&&l<0||s<0&&l>0)&&(c>0&&a<0||c<0&&a>0)?!0:i?!!(s===0&&ht(t,n,e)||l===0&&ht(t,r,e)||c===0&&ht(n,t,r)||a===0&&ht(n,e,r)):!1}function ht(t,e,n){return e.x<=Math.max(t.x,n.x)&&e.x>=Math.min(t.x,n.x)&&e.y<=Math.max(t.y,n.y)&&e.y>=Math.min(t.y,n.y)}function Pr(t,e){let n=Math.min(t.x,e.x),r=Math.max(t.x,e.x),i=Math.min(t.y,e.y),s=Math.max(t.y,e.y),l=t;do{let c=l.next;if(l.x>r&&c.x>r||l.x<n&&c.x<n||l.y>s&&c.y>s||l.y<i&&c.y<i){l=c;continue}if(l.i!==t.i&&c.i!==t.i&&l.i!==e.i&&c.i!==e.i&&rn(l,c,t,e))return!0;l=c}while(l!==t);return!1}function it(t,e){return le(t.prev,t,t.next)<0?le(t,e,t.next)>=0&&le(t,t.prev,e)>=0:le(t,e,t.prev)<0||le(t,t.next,e)<0}function kr(t,e){let n=t,r=!1,i=(t.x+e.x)/2,s=(t.y+e.y)/2;do{let l=n.next;n.y>s!=l.y>s&&i<(l.x-n.x)*(s-n.y)/(l.y-n.y)+n.x&&(r=!r),n=l}while(n!==t);return r}function on(t,e){let n=Pt(t.i,t.x,t.y),r=Pt(e.i,e.x,e.y),i=t.next,s=e.prev;return t.next=e,e.prev=t,n.next=i,i.prev=n,r.next=n,n.prev=r,s.next=r,r.prev=s,r}function qt(t,e,n,r){let i=Pt(t,e,n);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function ot(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ),Mt&&vr(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 _r(t,e,n,r){let i=0;for(let s=e,l=n-r;s<n;s+=r)i+=(t[l]-t[s])*(t[s+1]+t[l+1]),l=s;return i}var sn=23283064365386963e-26,Ar=12,un=typeof TextDecoder>"u"?null:new TextDecoder("utf-8"),kt=0,xt=1,st=2,dt=5,ut=class{constructor(e=new Uint8Array(16)){this.buf=ArrayBuffer.isView(e)?e:new Uint8Array(e),this.dataView=new DataView(this.buf.buffer),this.pos=0,this.type=0,this.length=this.buf.length}readFields(e,n,r=this.length){for(;this.pos<r;){let i=this.readVarint(),s=i>>3,l=this.pos;this.type=i&7,e(s,n,this),this.pos===l&&this.skip(i)}return n}readMessage(e,n){return this.readFields(e,n,this.readVarint()+this.pos)}readFixed32(){let e=this.dataView.getUint32(this.pos,!0);return this.pos+=4,e}readSFixed32(){let e=this.dataView.getInt32(this.pos,!0);return this.pos+=4,e}readFixed64(){let e=this.dataView.getUint32(this.pos,!0)+this.dataView.getUint32(this.pos+4,!0)*4294967296;return this.pos+=8,e}readSFixed64(){let e=this.dataView.getUint32(this.pos,!0)+this.dataView.getInt32(this.pos+4,!0)*4294967296;return this.pos+=8,e}readFloat(){let e=this.dataView.getFloat32(this.pos,!0);return this.pos+=4,e}readDouble(){let e=this.dataView.getFloat64(this.pos,!0);return this.pos+=8,e}readVarint(e){let n=this.buf,r,i;return i=n[this.pos++],r=i&127,i<128||(i=n[this.pos++],r|=(i&127)<<7,i<128)||(i=n[this.pos++],r|=(i&127)<<14,i<128)||(i=n[this.pos++],r|=(i&127)<<21,i<128)?r:(i=n[this.pos],r|=(i&15)<<28,Lr(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>=Ar&&un?un.decode(this.buf.subarray(n,e)):jr(this.buf,n,e)}readBytes(){let e=this.readVarint()+this.pos,n=this.buf.subarray(this.pos,e);return this.pos=e,n}readPackedVarint(e=[],n){let r=this.readPackedEnd();for(;this.pos<r;)e.push(this.readVarint(n));return e}readPackedSVarint(e=[]){let n=this.readPackedEnd();for(;this.pos<n;)e.push(this.readSVarint());return e}readPackedBoolean(e=[]){let n=this.readPackedEnd();for(;this.pos<n;)e.push(this.readBoolean());return e}readPackedFloat(e=[]){let n=this.readPackedEnd();for(;this.pos<n;)e.push(this.readFloat());return e}readPackedDouble(e=[]){let n=this.readPackedEnd();for(;this.pos<n;)e.push(this.readDouble());return e}readPackedFixed32(e=[]){let n=this.readPackedEnd();for(;this.pos<n;)e.push(this.readFixed32());return e}readPackedSFixed32(e=[]){let n=this.readPackedEnd();for(;this.pos<n;)e.push(this.readSFixed32());return e}readPackedFixed64(e=[]){let n=this.readPackedEnd();for(;this.pos<n;)e.push(this.readFixed64());return e}readPackedSFixed64(e=[]){let n=this.readPackedEnd();for(;this.pos<n;)e.push(this.readSFixed64());return e}readPackedEnd(){return this.type===st?this.readVarint()+this.pos:this.pos+1}skip(e){let n=e&7;if(n===kt)for(;this.buf[this.pos++]>127;);else if(n===st)this.pos=this.readVarint()+this.pos;else if(n===dt)this.pos+=4;else if(n===xt)this.pos+=8;else throw new Error(`Unimplemented type: ${n}`)}writeTag(e,n){this.writeVarint(e<<3|n)}realloc(e){let n=this.length||16;for(;n<this.pos+e;)n*=2;if(n!==this.length){let r=new Uint8Array(n);r.set(this.buf),this.buf=r,this.dataView=new DataView(r.buffer),this.length=n}}finish(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)}writeFixed32(e){this.realloc(4),this.dataView.setInt32(this.pos,e,!0),this.pos+=4}writeSFixed32(e){this.realloc(4),this.dataView.setInt32(this.pos,e,!0),this.pos+=4}writeFixed64(e){this.realloc(8),this.dataView.setInt32(this.pos,e&-1,!0),this.dataView.setInt32(this.pos+4,Math.floor(e*sn),!0),this.pos+=8}writeSFixed64(e){this.realloc(8),this.dataView.setInt32(this.pos,e&-1,!0),this.dataView.setInt32(this.pos+4,Math.floor(e*sn),!0),this.pos+=8}writeVarint(e){if(e=+e||0,e>268435455||e<0){Br(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=Xr(this.buf,e,this.pos);let r=this.pos-n;r>=128&&ln(n,r,this),this.pos=n-1,this.writeVarint(r),this.pos+=r}writeFloat(e){this.realloc(4),this.dataView.setFloat32(this.pos,e,!0),this.pos+=4}writeDouble(e){this.realloc(8),this.dataView.setFloat64(this.pos,e,!0),this.pos+=8}writeBytes(e){let n=e.length;this.writeVarint(n),this.realloc(n);for(let r=0;r<n;r++)this.buf[this.pos++]=e[r]}writeRawMessage(e,n){this.pos++;let r=this.pos;e(n,this);let i=this.pos-r;i>=128&&ln(r,i,this),this.pos=r-1,this.writeVarint(i),this.pos+=i}writeMessage(e,n,r){this.writeTag(e,st),this.writeRawMessage(n,r)}writePackedVarint(e,n){n.length&&this.writeMessage(e,Vr,n)}writePackedSVarint(e,n){n.length&&this.writeMessage(e,Or,n)}writePackedBoolean(e,n){n.length&&this.writeMessage(e,Gr,n)}writePackedFloat(e,n){n.length&&this.writeMessage(e,Dr,n)}writePackedDouble(e,n){n.length&&this.writeMessage(e,Ur,n)}writePackedFixed32(e,n){n.length&&this.writeMessage(e,Nr,n)}writePackedSFixed32(e,n){n.length&&this.writeMessage(e,zr,n)}writePackedFixed64(e,n){n.length&&this.writeMessage(e,Hr,n)}writePackedSFixed64(e,n){n.length&&this.writeMessage(e,$r,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 Lr(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 Br(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),Tr(n,r,e),Cr(r,e)}function Tr(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 Cr(t,e){let n=(t&7)<<4;e.buf[e.pos++]|=n|((t>>>=3)?128:0),t&&(e.buf[e.pos++]=t&127|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=t&127|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=t&127|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=t&127|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=t&127)))))}function ln(t,e,n){let r=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(Math.LN2*7));n.realloc(r);for(let i=n.pos-1;i>=t;i--)n.buf[i+r]=n.buf[i]}function Vr(t,e){for(let n=0;n<t.length;n++)e.writeVarint(t[n])}function Or(t,e){for(let n=0;n<t.length;n++)e.writeSVarint(t[n])}function Dr(t,e){for(let n=0;n<t.length;n++)e.writeFloat(t[n])}function Ur(t,e){for(let n=0;n<t.length;n++)e.writeDouble(t[n])}function Gr(t,e){for(let n=0;n<t.length;n++)e.writeBoolean(t[n])}function Nr(t,e){for(let n=0;n<t.length;n++)e.writeFixed32(t[n])}function zr(t,e){for(let n=0;n<t.length;n++)e.writeSFixed32(t[n])}function Hr(t,e){for(let n=0;n<t.length;n++)e.writeFixed64(t[n])}function $r(t,e){for(let n=0;n<t.length;n++)e.writeSFixed64(t[n])}function jr(t,e,n){let r="",i=e;for(;i<n;){let s=t[i],l=null,c=s>239?4:s>223?3:s>191?2:1;if(i+c>n)break;let a,p,x;c===1?s<128&&(l=s):c===2?(a=t[i+1],(a&192)===128&&(l=(s&31)<<6|a&63,l<=127&&(l=null))):c===3?(a=t[i+1],p=t[i+2],(a&192)===128&&(p&192)===128&&(l=(s&15)<<12|(a&63)<<6|p&63,(l<=2047||l>=55296&&l<=57343)&&(l=null))):c===4&&(a=t[i+1],p=t[i+2],x=t[i+3],(a&192)===128&&(p&192)===128&&(x&192)===128&&(l=(s&15)<<18|(a&63)<<12|(p&63)<<6|x&63,(l<=65535||l>=1114112)&&(l=null))),l===null?(l=65533,c=1):l>65535&&(l-=65536,r+=String.fromCharCode(l>>>10&1023|55296),l=56320|l&1023),r+=String.fromCharCode(l),i+=c}return r}function Xr(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(Yr,l,n),l}loadGeometry(){if(this.geomOffset<0)return[];let e=this.pbf,n=e.pos;e.pos=this.geomOffset;let r=e.readVarint()+e.pos,i=1,s=0,l=0,c=0,a=[],p=[];for(;e.pos<r;){if(s<=0){let x=e.readVarint();i=x&7,s=x>>3}if(s--,i===1||i===2)l+=e.readSVarint(),c+=e.readSVarint(),i===1&&(p.length&&a.push(p),p=[]),p.push(l,c);else if(i===7)p.length>=2&&p.push(p[0],p[1]);else throw new Error(`[osmgl] \\u043D\\u0435\\u0438\\u0437\\u0432\\u0435\\u0441\\u0442\\u043D\\u0430\\u044F \\u043A\\u043E\\u043C\\u0430\\u043D\\u0434\\u0430 \\u0433\\u0435\\u043E\\u043C\\u0435\\u0442\\u0440\\u0438\\u0438 MVT: ${i}`)}return p.length&&a.push(p),e.pos=n,a}bbox(){let e=this.loadGeometry(),n=1/0,r=1/0,i=-1/0,s=-1/0;for(let l of e)for(let c=0;c<l.length;c+=2)l[c]<n&&(n=l[c]),l[c]>i&&(i=l[c]),l[c+1]<r&&(r=l[c+1]),l[c+1]>s&&(s=l[c+1]);return[n,r,i,s]}};function Yr(t,e,n){n&&(t===1?e.id=n.readVarint():t===2?Zr(n,e):t===3?e.type=n.readVarint():t===4&&(e.geomOffset=n.pos,n.skip(2)))}function Zr(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(Wr,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 Wr(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(Qr(n)))}function Qr(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=Kr(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 Kr(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 Jr=Math.PI/8,qr=.35,ei=32,cn=.25,fn=.5,an=.07;function _e(t,e){let n=e.radius;if(!(n>0))return t;let r=t.length/2-1;if(r<3)return t;let i=Math.max(2,Math.round(e.segments??4)),s=Math.max(e.minCutRatio??qr,0),l=e.extent,c=e.margin??0,a=[];for(let p=0;p<r;p++){let x=t[p*2],y=t[p*2+1],d=t[(p+r-1)%r*2],b=t[(p+r-1)%r*2+1],E=t[(p+1)%r*2],A=t[(p+1)%r*2+1],_=x-d,R=y-b,L=E-x,k=A-y,T=Math.hypot(_,R),O=Math.hypot(L,k);if(T<1e-6||O<1e-6){a.push(x,y);continue}let D=_/T,U=R/T,P=L/O,C=k/O;if(e.keep?.[p]){a.push(x,y);continue}let Y=D*P+U*C;if(Y>.985){a.push(x,y);continue}if(l!==void 0&&(Lt(x,y,l,c)||Lt(d,b,l,c)||Lt(E,A,l,c))){a.push(x,y);continue}let Q=Math.min(n,T*.4,O*.4);if(Q<n*s){a.push(x,y);continue}let Z=x-D*Q,re=y-U*Q,X=x+P*Q,$=y+C*Q,z=Math.acos(Math.max(-1,Math.min(1,Y))),N=Math.min(Jr,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(ei,Math.max(Math.min(i,q),te)));a.push(Z,re);for(let oe=1;oe<K;oe++){let ee=oe/K,J=1-ee;a.push(J*J*Z+2*J*ee*x+ee*ee*X,J*J*re+2*J*ee*y+ee*ee*$)}a.push(X,$)}return a.length<6?t:(a.push(a[0],a[1]),a)}var Lt=(t,e,n,r)=>t<=-r||e<=-r||t>=n+r||e>=n+r;var Ae=t=>t/64;function je(t,e,n=0){let r=hn(t.outer,e,n);if(!r)return null;let i=[];for(let s of t.holes){let l=hn(s,e,n);l&&i.push(l)}return{outer:r,holes:i}}function hn(t,e,n){let r=[];for(let i=0;i<t.length-2;i+=2)r.push(t[i],t[i+1]);if(r.length<6)return null;for(let i=0;i<4;i++){let s=r;r=[];let l=s.length/2;if(l===0)return null;for(let c=0;c<l;c++){let a=s[c*2],p=s[c*2+1],x=s[(c+l-1)%l*2],y=s[(c+l-1)%l*2+1],d=pn(a,p,i,e,n),b=pn(x,y,i,e,n);if(d!==b){let E=ti(x,y,a,p,i,e,n);r.push(x+(a-x)*E,y+(p-y)*E)}d&&r.push(a,p)}}return r.length<6?null:(r.push(r[0],r[1]),r)}function pn(t,e,n,r,i){return n===0?t>=-i:n===1?t<=r+i:n===2?e>=-i:e<=r+i}function ti(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 mn(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,xn=8,vn=65535/Vt,ni=9,ri=1,ii=0,oi=1,si=2;var dn=0,ui=1,gn=2,li=3,ci=.47;function Sn(t,e,n,r={}){let i=r.metersPerUnit&&r.metersPerUnit>0?r.metersPerUnit:ci,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=_i(d.properties),E=Ai(d.properties,b);if(b<=E)continue;let A=Bi(d.properties)??Number(d.id??0),_=ki(A>>>0),R=Pi(_,d.properties),L=Ii(d.properties,b),k=$e(d.loadGeometry());for(let T of k){let O=je(T,e);if(!O)continue;let D=mn(O.outer,e),U=(r.cornerRadius??0)/i,P={radius:U,segments:r.cornerSegments,extent:e,minCutRatio:0,maxChord:i>0?fn/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:pi(C.outer),Z=Q?bi(d.properties,Q,b,_,i):null,re=null,X=[];if(Z&&Q){let $=En(Si(C.outer,i),Q,Z.shape);X=Ei($,C.outer);let z=Mi($,X);if(z>1e-6){let N=Math.min(Math.max(z*i*di,yi),gi);re=Ri($,N/z,b)}}bn(c,C.outer,E,b,A,R,L,i,e,re);for(let $ of C.holes)bn(c,$,E,b,A,R,L,i,e,null);re?Fi(c,X,re,b,A,R,L,i):hi(c,C.outer,C.holes,b,A,R,L)}}if(!c.indices.length)return null;let p=new Uint32Array(c.indices),x=new Float64Array(c.featureIds);return{vertices:l.slice(0,c.vertOffset),indices:p.buffer,featureIds:x.buffer,vertexCount:c.vertexCount,indexCount:p.length,extent:e}}var Ot=(t,e)=>t|e<<2,yn=t=>Math.max(-32768,Math.min(32767,t)),Bt=t=>Math.max(0,Math.min(65535,Math.round(Math.min(t,vn)*Vt)));function Xe(t,e,n,r,i,s,l,c,a,p,x=0,y=0,d=0){let b=t.vertOffset;return t.verts.setInt16(b,yn(Math.round(e*xn)),!0),t.verts.setInt16(b+2,yn(Math.round(n*xn)),!0),t.verts.setUint16(b+4,Math.round(Math.min(r,vn)*Vt),!0),t.vertsU8[b+6]=a,t.vertsU8[b+7]=c,t.verts.setInt8(b+8,Tt(Math.round(i*127))),t.verts.setInt8(b+9,Tt(Math.round(s*127))),t.verts.setInt8(b+10,Tt(Math.round(l*127))),t.vertsU8[b+11]=p,t.verts.setUint16(b+12,Bt(x),!0),t.verts.setUint16(b+14,Bt(y),!0),t.verts.setUint16(b+16,Bt(d),!0),t.vertOffset+=Ct,t.vertexCount++}function bn(t,e,n,r,i,s,l,c,a,p=null){let x=e.length/2;if(x<3)return;let y=Ot(ii,l),d=ai(e,c),b=r-n,E=new Float64Array(x*2),A=new Uint8Array(x);{let _=new Float64Array(x*2);for(let R=0;R<x-1;R++){let L=e[R*2+2]-e[R*2],k=e[R*2+3]-e[R*2+1],T=Math.hypot(L,k)||1;_[R*2]=k/T,_[R*2+1]=-L/T}for(let R=0;R<x-1;R++){let L=(R+x-2)%(x-1),k=_[L*2]*_[R*2]+_[L*2+1]*_[R*2+1],T=_[L*2]+_[R*2],O=_[L*2+1]+_[R*2+1],D=Math.hypot(T,O);k>.5&&D>1e-6&&(E[R*2]=T/D,E[R*2+1]=O/D,A[R]=1)}}for(let _=0;_<x-1;_++){let R=e[_*2],L=e[_*2+1],k=e[_*2+2],T=e[_*2+3];if(R===k&&L===T||yt(R,L,k,T,a))continue;let O=k-R,D=T-L,U=Math.hypot(O,D)||1,P=D/U,C=-O/U,Y=d.offset[_],Q=d.width[_],Z=[0,1];if(p){for(let X=0;X<p.length;X++)for(let $=X+1;$<p.length;$++){let z=Ne(p[X],R,L)-Ne(p[$],R,L),N=Ne(p[X],k,T)-Ne(p[$],k,T);if(z===N)continue;let q=z/(z-N);q>1e-4&&q<1-1e-4&&Z.push(q)}Z.sort((X,$)=>X-$)}let re=(X,$)=>{if(!p)return r;let z=1/0;for(let N of p)z=Math.min(z,Ne(N,X,$));return Math.max(r,z)};for(let X=0;X+1<Z.length;X++){let $=Z[X],z=Z[X+1];if(z-$<1e-6)continue;let N=R+O*$,q=L+D*$,te=R+O*z,K=L+D*z,oe=Y+U*$*c,ee=Y+U*z*c,J=(_+1)%(x-1),fe=A[_]?E[_*2]:P,be=A[_]?E[_*2+1]:C,de=A[J]?E[J*2]:P,Fe=A[J]?E[J*2+1]:C,Ce=P+(fe-P)*(1-$),Le=C+(be-C)*(1-$),Ve=P+(de-P)*z,we=C+(Fe-C)*z,se=Math.hypot(Ce,Le)||1,Pe=Math.hypot(Ve,we)||1,xe=Ce/se,Be=Le/se,Oe=Ve/Pe,De=we/Pe;t.ensure(4);let Ie=Xe(t,N,q,n,xe,Be,0,0,s,y,oe,Q,b),ze=Xe(t,te,K,n,Oe,De,0,0,s,y,ee,Q,b),vt=Xe(t,N,q,re(N,q),xe,Be,0,255,s,y,oe,Q,b),ft=Xe(t,te,K,re(te,K),Oe,De,0,255,s,y,ee,Q,b);t.indices.push(Ie,ft,ze,Ie,vt,ft),t.featureIds.push(i,i)}}}var fi=.9976;function ai(t,e){let n=t.length/2-1,r=[];for(let a=0;a<n;a++){let p=t[a*2+2]-t[a*2],x=t[a*2+3]-t[a*2+1],y=Math.hypot(p,x);r.push(y>0?{x:p/y,y:x/y,len:y*e}:{x:0,y:0,len:0})}let i=(a,p)=>r[a].len>0&&r[p].len>0&&r[a].x*r[p].x+r[a].y*r[p].y>=fi,s=0;for(;s<n&&i((s-1+n)%n,s);)s++;s>=n&&(s=0);let l=new Array(n).fill(0),c=new Array(n).fill(0);for(let a=0;a<n;){let p=(s+a)%n,x=[p],y=r[p].len,d=a+1;for(;d<n;){let E=(s+d)%n;if(!i((s+d-1)%n,E))break;x.push(E),y+=r[E].len,d++}let b=0;for(let E of x)l[E]=b,c[E]=y,b+=r[E].len;a=d}return{offset:l,width:c}}function hi(t,e,n,r,i,s,l){let c=[],a=[];for(let d=0;d<e.length;d++)c.push(e[d]);for(let d of n){a.push(c.length/2);for(let b=0;b<d.length;b++)c.push(d[b])}let p=Te(c,a.length?a:void 0,2);if(!p.length)return;let x=Ot(oi,l),y=t.vertexCount;for(let d=0;d<c.length;d+=2)Xe(t,c[d],c[d+1],r,0,0,1,255,s,x);for(let d=0;d<p.length;d+=3)t.indices.push(y+p[d],y+p[d+2],y+p[d+1]),t.featureIds.push(i)}function pi(t){let e=mi(t);if(e.length<3)return null;let n=Math.abs(xi(t));if(n<=0)return null;let r=null,i=1/0;for(let s=0;s<e.length;s++){let l=(s+1)%e.length,c=e[l].x-e[s].x,a=e[l].y-e[s].y,p=Math.hypot(c,a);if(p<1e-6)continue;c/=p,a/=p;let x=1/0,y=-1/0,d=1/0,b=-1/0;for(let T of e){let O=T.x*c+T.y*a,D=-T.x*a+T.y*c;O<x&&(x=O),O>y&&(y=O),D<d&&(d=D),D>b&&(b=D)}let E=y-x,A=b-d,_=E*A;if(_<=0||_>=i)continue;i=_;let R=(x+y)/2,L=(d+b)/2,k=E>=A;r={cx:R*c-L*a,cy:R*a+L*c,ax:k?c:-a,ay:k?a:c,halfLong:(k?E:A)/2,halfShort:(k?A:E)/2,fill:n/_}}return r}function mi(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 xi(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 di=Math.tan(30*Math.PI/180),gi=3.5,yi=.9;function bi(t,e,n,r,i){if(e.fill<.86)return null;let s=e.halfShort*2*i,l=e.halfLong*2*i,c=s*l,a=e.halfShort>0?e.halfLong/e.halfShort:99,p=wi(t);if(!p){if(n>15||c>600||s<3)return null;let x=r%1e3/1e3;c<30?p=x<.5?"skillion":"gabled":a<1.25?p=x<.35?"pyramidal":"hipped":p=x<.8?"gabled":"hipped"}return p==="flat"?null:{shape:p}}function wi(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 vi(t,e,n,r){let i=t.length/2;if(i<3)return[];let s=[],l=c=>[t[c*2],t[c*2+1]];for(let c=0;c<i;c++){let[a,p]=l(c),[x,y]=l((c+i-1)%i),d=e*a+n*p+r,b=e*x+n*y+r;if(d<=0!=b<=0){let E=b/(b-d);s.push(x+(a-x)*E,y+(p-y)*E)}d<=0&&s.push(a,p)}return s}function Si(t,e){let n=.5/Math.max(e,1e-6),r=t.length/2-1;if(r<5)return t;let i=[],s=0;i.push(t[0],t[1]);for(let l=1;l<r;l++){let c=t[s*2],a=t[s*2+1],p=t[l*2],x=t[l*2+1],y=p-c,d=x-a,b=Math.hypot(y,d),E=b>1e-6;if(E){for(let A=s+1;A<l;A++)if(Math.abs((t[A*2]-c)*d-(t[A*2+1]-a)*y)/b>=n){E=!1;break}}E||(i.push(t[(l-1)*2],t[(l-1)*2+1]),s=l-1)}return i.length/2<3?t:(i.push(i[0],i[1]),i)}function En(t,e,n){let{ax:r,ay:i,halfLong:s}=e;if(n==="skillion"){let a=-i,p=r;return[{a,b:p,c:-(a*e.cx+p*e.cy)+e.halfShort}]}let l=[],c=t.length/2-1;for(let a=0;a<c;a++){let p=t[a*2],x=t[a*2+1],y=t[(a+1)%c*2],d=t[(a+1)%c*2+1],b=y-p,E=d-x,A=Math.hypot(b,E);if(A<1e-6||n==="gabled"&&Math.abs((b*r+E*i)/A)<.86)continue;let _=-E/A,R=b/A;l.push({a:_,b:R,c:-(_*p+R*x)})}return!l.length&&s>0?En(t,e,"hipped"):l}function Ei(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=vi(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 Mi(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 Ri(t,e,n){return t.map(r=>({a:r.a*e,b:r.b*e,c:r.c*e+n}))}function Fi(t,e,n,r,i,s,l,c){let a=Ot(si,l);for(let p=0;p<n.length;p++){let x=e[p];if(!x||x.length<6)continue;let y=Te(x,void 0,2);if(!y.length)continue;let d=-n[p].a/c,b=-n[p].b/c,E=Math.hypot(d,b,1),A={x:d/E,y:b/E,z:1/E};t.ensure(x.length/2);let _=t.vertexCount;for(let R=0;R<x.length;R+=2){let L=Math.max(r,Ne(n[p],x[R],x[R+1]));Xe(t,x[R],x[R+1],L,A.x,A.y,A.z,255,s,a)}for(let R=0;R<y.length;R+=3)t.indices.push(_+y[R],_+y[R+2],_+y[R+1]),t.featureIds.push(i)}}function Ii(t,e){let n=String(t.class??"").toLowerCase();return n==="industrial"||n==="warehouse"||n==="hangar"||n==="construction"?li:n==="commercial"||n==="office"||n==="retail"||n==="supermarket"?gn:n==="house"||n==="detached"||n==="garage"||n==="hut"||n==="shed"||e<=7?dn:e>=40?gn:ui}function Pi(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 ki(t){let e=t>>>0;return e=(e>>>16^e)*73244475,e=(e>>>16^e)*73244475,e=e>>>16^e,e>>>0}function _i(t){let e=Ye(t.render_height)??Ye(t.height)??Li(t.levels??t.building_levels??t["building:levels"]);return e&&e>0?Math.max(e,ri):ni}function Ai(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 Li(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 Bi(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 Ti(t,e,n,r,i){let s=r*r,l=[],c=x=>t[x*2],a=x=>t[x*2+1],p=(x,y)=>{let d=t.length/2;return t.push((c(x)+c(y))/2,(a(x)+a(y))/2),d};for(let x=0;x<e.length;x+=3){l.push([n+e[x],n+e[x+1],n+e[x+2]]);let y=0;for(;l.length&&!(++y>2e4);){let[d,b,E]=l.pop(),A=(c(d)-c(b))**2+(a(d)-a(b))**2,_=(c(b)-c(E))**2+(a(b)-a(E))**2,R=(c(E)-c(d))**2+(a(E)-a(d))**2,L=Math.max(A,_,R);if(L<=s){i.push(d,b,E);continue}if(L===A){let k=p(d,b);l.push([d,k,E],[k,b,E])}else if(L===_){let k=p(b,E);l.push([b,k,d],[k,E,d])}else{let k=p(E,d);l.push([E,k,b],[k,d,b])}}}}function Mn(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=[];Ti(l,D,U,n,P);for(let C=0;C<P.length;C+=3)c.push(P[C],P[C+2],P[C+1]),a.push(_);continue}for(let P=0;P<D.length;P+=3)c.push(U+D[P],U+D[P+2],U+D[P+1]),a.push(_)}}if(!c.length)return null;let p=l.length/2,x=new Int16Array(l),y=new Uint32Array(c);return{featureIds:new Float64Array(a).buffer,vertices:x.buffer,indices:y.buffer,vertexCount:p,indexCount:y.length}}function Fn(t){return{shapes:[],cells:[],extent:0,metersPerTile:t}}function In(t,e,n,r){if(!(n<=0)){t.extent=r;for(let i of e){let s=i.outer;if(s.length<6)continue;let l=1/0,c=1/0,a=-1/0,p=-1/0;for(let x=0;x<s.length;x+=2)s[x]<l&&(l=s[x]),s[x]>a&&(a=s[x]),s[x+1]<c&&(c=s[x+1]),s[x+1]>p&&(p=s[x+1]);t.shapes.push({outer:s,holes:i.holes,level:n,minX:l,minY:c,maxX:a,maxY:p})}t.cells=[]}}function Ci(t){t.cells=Array.from({length:32*32},()=>[]);let e=t.extent/32;for(let n=0;n<t.shapes.length;n++){let r=t.shapes[n],i=Ze(Math.floor(r.minX/e)),s=Ze(Math.floor(r.maxX/e)),l=Ze(Math.floor(r.minY/e)),c=Ze(Math.floor(r.maxY/e));for(let a=l;a<=c;a++)for(let p=i;p<=s;p++)t.cells[a*32+p].push(n)}}var Pn=t=>t.shapes.length===0;function Dt(t,e,n){!t.cells.length&&t.shapes.length&&Ci(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||!Rn(c.outer,e,n))continue;let a=!1;for(let p of c.holes)if(Rn(p,e,n)){a=!0;break}a||(s=c.level)}return Math.min(Math.round(s*100),127)}function kn(t,e){let n=[],r=[],i=t.extent>0?t.metersPerTile/t.extent:0,s=i>0?2/i:0,l=Dt(t,e[0],e[1]);n.push(e[0],e[1]),r.push(l);for(let c=0;c+3<e.length;c+=2){let a=e[c],p=e[c+1],x=e[c+2],y=e[c+3],d=Dt(t,x,y);if(d!==l&&s>0){let b=Math.hypot(x-a,y-p),E=Math.min(Math.ceil(b/s),64),A=l;for(let _=1;_<E;_++){let R=_/E,L=a+(x-a)*R,k=p+(y-p)*R,T=Dt(t,L,k);T!==A&&(n.push(L,k),r.push(T),A=T)}}n.push(x,y),r.push(d),l=d}return{pts:n,levels:r}}var Ze=t=>t<0?0:t>31?31:t;function Rn(t,e,n){let r=!1,i=t.length/2;for(let s=0,l=i-1;s<i;l=s++){let c=t[s*2],a=t[s*2+1],p=t[l*2],x=t[l*2+1];a>n!=x>n&&e<(p-c)*(n-a)/(x-a)+c&&(r=!r)}return r}var Bn=hr(_n(),1);function An(t){let e=[];for(let n=0;n+1<t.length;n+=2)e.push([t[n],t[n+1]]);return e}function Ln(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 Tn(t,e,n=0){if(t.length<2)return t;let r=new Map;for(let s of t){let l=s.lift??0,c=r.get(l);c?c.push(s):r.set(l,[s])}let i=[];for(let[s,l]of r){if(l.length<2){i.push(...l);continue}let a=(n>0&&e?l.map(y=>({outer:e(y.outer,-n)??y.outer,holes:y.holes.map(d=>e(d,n)??d)})):l).map(y=>[An(y.outer),...y.holes.map(An)]),p;try{p=Bn.union(a[0],...a.slice(1))}catch{i.push(...l);continue}let x=p;if(!Array.isArray(x)||x.length===0){i.push(...l);continue}for(let y of x){if(!y.length)continue;let d=Ln(y[0]);if(d.length<8)continue;let b=[];for(let E=1;E<y.length;E++){let A=Ln(y[E]);A.length>=8&&b.push(A)}i.push(s?{outer:d,holes:b,lift:s}:{outer:d,holes:b})}}return i}var jt=16,Vi=64,Oi=0,Di=1,Cn=2,Ui=3,bt=1,Gi=.6;function Gn(t,e,n,r){let i=r.metersPerUnit>0?r.metersPerUnit:.5,s=r.elevation,l=r.base??0,c=Math.max(r.bevel??0,0)/i,a=Math.max(r.bevelDrop??0,0),p=Math.max(r.cornerRadius??0,0)/i,x=Math.max(512,t.length*24),y=new ArrayBuffer(x*jt),d={view:new DataView(y),bytes:new Uint8Array(y),offset:0,count:0,indices:[],extent:e,ensure(P){if(d.count+P<=x)return;x=Math.max(x*2,d.count+P);let C=new ArrayBuffer(x*jt);new Uint8Array(C).set(d.bytes.subarray(0,d.offset)),y=C,d.view=new DataView(C),d.bytes=new Uint8Array(C)}},b=[],E=new Map;for(let P of t.features()){if(P.type!==3||!ce(n,P.properties))continue;let C=r.liftBy?.(P.properties)??0;for(let Y of $e(P.loadGeometry())){let Q=je(Y,e,Ae(e));Q&&b.push(C?{...Q,lift:C}:Q)}}let A=new Set,_=Math.max(r.weld??Gi,0),R=Tn(b,(P,C)=>zt(P,C,e,A),_/i),L=_>0?R.map(P=>({...P,outer:Un(P.outer,_/i,e),holes:P.holes.map(C=>Un(C,_/i,e))})):R;for(let P of L){Vn(P.outer,E);for(let C of P.holes)Vn(C,E)}r.onShapes?.(L);let k=new Set;for(let[P,C]of E)C>1&&k.add(P);let T=[],O={radius:p,segments:r.cornerSegments,extent:e,margin:Ae(e),minCutRatio:0,maxChord:cn/i};for(let P of L){let C=p>0?{outer:_e(P.outer,{...O,keep:On(P.outer,k)}),holes:P.holes.map(N=>_e(N,{...O,keep:On(N,k)}))}:P,Y=c>0?zt(C.outer,c,e,k):C.outer,Q=C.holes.map(N=>c>0?zt(N,-c,e,k):N),Z=P.lift??0,re=s+Z,X=l+Z;Dn(d,Y??C.outer,Q.map((N,q)=>N??C.holes[q]),re);let $=re,z=re-a;Y&&c>0&&a>0&&Nt(d,Y,C.outer,$,z,Di,e,k),z!==X&&Nt(d,C.outer,C.outer,z,X,Cn,e,k);for(let N of C.holes)if(z!==X&&Nt(d,N,N,z,X,Cn,e,k),re<X){let q=d.indices.length;Dn(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:y.slice(0,d.offset),indices:U.buffer,vertexCount:d.count,indexCount:U.length,extent:e,capIndexOffset:D}}function We(t,e,n,r){let i=`${Math.round(t*100)},${Math.round(e*100)}`,s=`${Math.round(n*100)},${Math.round(r*100)}`;return i<s?`${i}|${s}`:`${s}|${i}`}function Vn(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 On(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*Vi)),!0),t.view.setInt8(a+10,$t(Math.round(i*127))),t.view.setInt8(a+11,$t(Math.round(s*127))),t.view.setInt8(a+12,$t(Math.round(l*127))),t.bytes[a+13]=c,t.view.setInt8(a+14,e<=0?-bt:e>=t.extent?bt:0),t.view.setInt8(a+15,n<=0?-bt:n>=t.extent?bt:0),t.offset+=jt,t.count++}function Dn(t,e,n,r,i=Oi){let s=[],l=[];for(let p=0;p<e.length;p++)s.push(e[p]);for(let p of n){l.push(s.length/2);for(let x=0;x<p.length;x++)s.push(p[x])}let c=Te(s,l.length?l:void 0,2);if(!c.length)return;t.ensure(s.length/2);let a=t.count;for(let p=0;p<s.length;p+=2)lt(t,s[p],s[p+1],r,0,0,1,i);for(let p=0;p<c.length;p+=3)t.indices.push(a+c[p],a+c[p+2],a+c[p+1])}function Nt(t,e,n,r,i,s,l,c){let a=Math.min(e.length,n.length)/2;if(!(a<3)){t.ensure((a-1)*4);for(let p=0;p<a-1;p++){let x=n[p*2],y=n[p*2+1],d=n[p*2+2],b=n[p*2+3];if(x===d&&y===b||yt(x,y,d,b,l,Ae(l))||c.has(We(x,y,d,b)))continue;let E=d-x,A=b-y,_=Math.hypot(E,A)||1,R=A/_,L=-E/_,k=r-i,T=Math.hypot(e[p*2]-x,e[p*2+1]-y)||0,O=0;if(T>1e-6&&k!==0){let Y=1/Math.hypot(1,k/T);O=T/Math.hypot(T,k)*Math.sign(k),R*=Y,L*=Y}let D=lt(t,e[p*2],e[p*2+1],r,R,L,O,s),U=lt(t,e[p*2+2],e[p*2+3],r,R,L,O,s),P=lt(t,x,y,i,R,L,O,s),C=lt(t,d,b,i,R,L,O,s);t.indices.push(P,U,C,P,D,U)}}}function zt(t,e,n,r){let i=t.length/2-1;if(i<3)return null;let s=[];for(let x=0;x<i;x++){let y=t[x*2],d=t[x*2+1],b=t[(x+i-1)%i*2],E=t[(x+i-1)%i*2+1],A=t[(x+1)%i*2],_=t[(x+1)%i*2+1],R=Math.hypot(y-b,d-E)||1,L=Math.hypot(A-y,_-d)||1,k=(d-E)/R,T=-(y-b)/R,O=(_-d)/L,D=-(A-y)/L,U=k+O,P=T+D,C=Math.hypot(U,P);if(C<1e-6){s.push(y,d);continue}U/=C,P/=C;let Y=Math.min(1/Math.max(U*k+P*T,.35),3),Q=y-U*e*Y,Z=d-P*e*Y,re=We(b,E,y,d),X=We(y,d,A,_);if(r.has(re)||r.has(X)){s.push(y,d);continue}let $=-Ae(n),z=n+Ae(n),N=(q,te)=>q<=$||q>=z||te<=$||te>=z;(N(y,d)||N(b,E)||N(A,_))&&(Q=y,Z=d),s.push(Q,Z)}s.push(s[0],s[1]);let l=Math.abs(Ht(t)),c=Ht(s);if(Math.sign(c)!==Math.sign(Ht(t))||Math.abs(c)<l*.25)return null;let a=-Ae(n),p=n+Ae(n);for(let x=0;x<s.length;x+=2)s[x]=Math.max(a,Math.min(p,s[x])),s[x+1]=Math.max(a,Math.min(p,s[x+1]));return s}function Ht(t){let e=0;for(let n=0;n<t.length-2;n+=2)e+=t[n]*t[n+3]-t[n+2]*t[n+1];return e/2}var $t=t=>t>127?127:t<-127?-127:t,Ni=t=>t>32767?32767:t<-32768?-32768:t;function Un(t,e,n){if(!(e>0))return t;let r=Ae(n),i=-r,s=n+r,l=t;for(let c=0;c<3;c++){let a=l.length/2-1;if(a<6)break;let p=new Array(a).fill(!0),x=a;for(let d=0;d<a&&!(x<=5);d++){let b=l[d*2],E=l[d*2+1];if(b<=i||b>=s||E<=i||E>=s)continue;let A=(d+a-1)%a;for(;!p[A]&&A!==d;)A=(A+a-1)%a;let _=(d+1)%a;for(;!p[_]&&_!==d;)_=(_+1)%a;if(A===d||_===d)break;let R=l[A*2],L=l[A*2+1],k=l[_*2]-R,T=l[_*2+1]-L,O=Math.hypot(k,T);O<1e-6||Math.abs((b-R)*T-(E-L)*k)/O<e&&(p[d]=!1,x--)}if(x===a)break;let y=[];for(let d=0;d<a;d++)p[d]&&y.push(l[d*2],l[d*2+1]);y.push(y[0],y[1]),l=y}return l}function Qe(t){let e=t.layer,n=typeof e=="number"?e:typeof e=="string"?Number(e):NaN;if(Number.isFinite(n)&&n!==0)return Math.max(-5,Math.min(5,Math.trunc(n)));let r=t.brunnel;return r==="bridge"?1:r==="tunnel"?-1:0}var ct=20;function Hn(t,e,n=0,r,i=0,s={}){let{level:l}=s,c=Math.max(256,t.length*24),a=new ArrayBuffer(c*ct),p=new DataView(a),x=0,y=[],d=L=>{if(x+L<=c)return;c=Math.max(c*2,x+L);let k=new ArrayBuffer(c*ct);new Uint8Array(k).set(new Uint8Array(a,0,x*ct)),a=k,p=new DataView(k)},b=(L,k,T,O,D,U,P,C=0,Y=0,Q=0)=>{let Z=x*ct;return p.setInt16(Z,L,!0),p.setInt16(Z+2,k,!0),p.setInt16(Z+4,T,!0),p.setInt16(Z+6,O,!0),p.setInt8(Z+8,D),p.setInt8(Z+9,U),p.setInt8(Z+10,C),p.setInt8(Z+11,Y),p.setFloat32(Z+12,P,!0),p.setFloat32(Z+16,Q,!0),x++},E=0,A=i>0?12/i:0,_=A>0?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(Nn(O),n):Nn(O);if(D.length<4)continue;let U=r&&!Pn(r)?kn(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]);$=$n(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,y.push(Oe,De,Ie,Oe,Ie,ze)}}}if(!y.length)return null;let R=new Uint32Array(y);return{vertices:a.slice(0,x*ct),indices:R.buffer,vertexCount:x,indexCount:R.length}}function zi(t,e,n){let r=[...n].sort((a,p)=>a-p),i=[t[0],t[1]],s=e?[e[0]]:void 0,l=0,c=0;for(let a=0;a+3<t.length;a+=2){let p=t[a],x=t[a+1],y=t[a+2],d=t[a+3],b=Math.hypot(y-p,d-x);for(;c<r.length&&r[c]<=l+.01;)c++;for(;c<r.length&&r[c]<l+b-.01;){let E=(r[c]-l)/b;i.push(p+(y-p)*E,x+(d-x)*E),s&&e&&s.push(Math.round(e[a/2]+(e[a/2+1]-e[a/2])*E)),c++}l+=b,i.push(y,d),s&&e&&s.push(e[a/2+1])}return{pts:i,levels:s}}function 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 p=1;p<a;p++){let x=p/a;n.push(i+(l-i)*x,s+(c-s)*x)}}return n.push(t[t.length-2],t[t.length-1]),n}function Nn(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,p=[[-s,t],[s,i-t],[-l,e],[l,i-e]];for(let[x,y]of p){if(x===0){if(y<0)return null;continue}let d=y/x;if(x<0){if(d>a)return null;d>c&&(c=d)}else{if(d<c)return null;d<a&&(a=d)}}return a-c<1e-6?null:[Math.round(t+s*c),Math.round(e+l*c),Math.round(t+s*a),Math.round(e+l*a)]}function ji(t,e,n,r,i){return t===n&&(t<=0||t>=i)?!0:e===r&&(e<=0||e>=i)}var zn=new WeakMap,wt=(t,e)=>(t+512)*65536+(e+512);function $n(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=zn.get(t);if(e)return e;let n={width:new Map,ends:new Map,raw:new Map},r=[];for(let i of t.features()){if(i.type!==2)continue;let s=i.properties.width,l=typeof s=="number"&&s>.5&&s<100?s:0,c=Qe(i.properties);for(let a of i.loadGeometry()){if(a.length<4)continue;let p=wt(Math.round(a[0]),Math.round(a[1])),x=wt(Math.round(a[a.length-2]),Math.round(a[a.length-1]));for(let y of[p,x]){let d=y+(c+8)*4294967296;n.ends.set(d,(n.ends.get(d)??0)+1),l>0&&n.raw.set(d,Math.max(n.raw.get(d)??0,l))}r.push({h:p,t:x,lv:c,w:l})}}for(let i of r){let s=$n(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 zn.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."]],jn=new Map(Yi);function Xn(t){let e=t.split(" ");if(e.length<2)return t;let n=!1,r=e.map(s=>{let l=jn.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=>jn.get(s.toLowerCase())===void 0).length?t:r.join(" ")}function Zn(t,e){let n=[],r=[],i=[],s=[],l=[],c=e.textPlacement==="line",a=[],p=[],x=[];for(let y of t.features()){if(!ce(e.filter,y.properties))continue;let d=y.loadGeometry(),b=Qi(y.type,d);if(!b)continue;let E=e.textField?Yn(e.textField,y.properties):"",A=E&&e.abbreviate?Xn(E):E,_=e.iconImage?Yn(e.iconImage,y.properties):"";if(!(!A&&!_)){if(c){let R=Wi(y.type,d);if(!R)continue;x.push({text:A,line:R});continue}n.push(b[0],b[1]),r.push(A),i.push(_),s.push(Ki(y.properties)),l.push(e.iconRotate&&Math.round(Number(y.properties[e.iconRotate]??0))||0)}}if(c){for(let{text:y,line:d}of Zi(x)){p.push(a.length/2);for(let b of d)a.push(b);n.push(Math.round(d[0]),Math.round(d[1])),r.push(y),i.push(""),s.push(128),l.push(0)}p.push(a.length/2)}return r.length?{anchors:new Int16Array(n).buffer,texts:r,icons:i,priorities:new Uint8Array(s).buffer,rotations:new Int16Array(l).buffer,...c?{lines:new Int16Array(a).buffer,lineStarts:new Uint32Array(p).buffer}:{}}:null}function 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]),p=n.get(a),x=r.get(c);if(x!==void 0){let y=e[x];if(y.line.push(...l.slice(2)),r.delete(c),r.set(i(s,y.line[y.line.length-2],y.line[y.line.length-1]),x),p!==void 0&&p!==x){let d=e[p];y.line.push(...d.line.slice(2)),d.line=[],n.delete(a),r.set(i(s,y.line[y.line.length-2],y.line[y.line.length-1]),x)}continue}if(p!==void 0){let y=e[p];y.line.unshift(...l.slice(0,l.length-2)),n.delete(a),n.set(i(s,y.line[0],y.line[1]),p);continue}n.set(c,e.length),r.set(a,e.length),e.push({text:s,line:l})}return e.filter(s=>s.line.length>=4)}function 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 p of e)for(let x=0;x+3<p.length;x+=2){let y=p[x+2]-p[x],d=p[x+3]-p[x+1],b=y*y+d*d;b>l&&(l=b,c=p[x]+y/2,a=p[x+1]+d/2)}return l>0?[Math.round(c),Math.round(a)]:null}let n=1/0,r=1/0,i=-1/0,s=-1/0;for(let l of e)for(let c=0;c<l.length;c+=2)l[c]<n&&(n=l[c]),l[c]>i&&(i=l[c]),l[c+1]<r&&(r=l[c+1]),l[c+1]>s&&(s=l[c+1]);return isFinite(n)?[Math.round((n+i)/2),Math.round((r+s)/2)]:null}function Ki(t){let e=t.rank;return typeof e=="number"&&isFinite(e)?Math.max(0,255-Math.min(e,255)):128}function Yn(t,e){let n=Array.isArray(t)?t:[t];for(let r of n){let i=!0,l=r.replace(/\\{([^}]+)\\}/g,(c,a)=>{let p=e[a];return p==null||p===""?(i=!1,""):String(p)}).trim();if(i&&l)return l}return""}function Wn(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",Xt=(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 Qn(t,e){let n=performance.now(),r=qi(),i=await fetch(t.url,{signal:e,credentials:"same-origin",...r?{referrer:r}:{}}),s=(R,L,k,T,O=0)=>({type:"loaded",id:t.id,buckets:{},timing:{fetchMs:T,parseMs:O},diag:{status:R,bytes:L,layers:k,built:0}});if(!i.ok){if(i.status===404||i.status===204)return s(i.status,0,[],performance.now()-n);throw new Error(`HTTP ${i.status} \\u0434\\u043B\\u044F ${t.url}`)}let l=await i.arrayBuffer(),c=performance.now()-n;if(l.byteLength===0)return s(i.status,0,[],c);let a=performance.now(),p=new gt(l),x=Object.keys(p.layers),y={},d={},b=new Set,E=[],_=t.plan.some(R=>R.type==="surface"&&(R.elevation??0)>0)&&t.plan.some(R=>R.type==="line"&&R.ground)?Fn(t.metersPerTile):void 0;for(let R of t.plan){if(!to(R,t.zoom,t.sourceMaxZoom))continue;let L=p.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=Yt(P,L,k,t.metersPerTile,_);C&&(y[Xt(R.id,U)]=C)}continue}if(R.network&&R.type==="line"){for(let O of io(L,R.filter)){let D=Yt(R,L,k,t.metersPerTile,_,O);D&&(y[Xt(R.id,O)]=D,b.add(O))}continue}let T=Yt(R,L,k,t.metersPerTile,_);T&&(y[R.id]=T)}catch(T){E.push(`${R.id}: ${T instanceof Error?T.message:String(T)}`)}}return{type:"loaded",id:t.id,buckets:y,...Object.keys(d).length?{splits:d}:{},...b.size?{levels:[...b].sort((R,L)=>R-L)}:{},timing:{fetchMs:c,parseMs:performance.now()-a},diag:{status:i.status,bytes:l.byteLength,layers:x,built:Object.keys(y).length,...E.length?{failed:E}:{}}}}function 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 Yt(t,e,n,r,i,s){{if(t.type==="fill"){let c=r>0?r/e.extent:0,a=t.cornerRadius&&c>0?{radius:t.cornerRadius/c,segments:t.cornerSegments,extent:e.extent,minCutRatio:0,maxChord:an/c}:void 0,p=Mn(e,t.filter,n,a,t.clipToTile===!0,e.extent);return p?{kind:"fill",...p,extent:e.extent}:null}if(t.type==="surface"){let c=Gn(e,e.extent,t.filter,{metersPerUnit:r>0?r/e.extent:0,elevation:t.elevation??0,base:t.base,bevel:t.bevel,weld:t.weld,bevelDrop:t.bevelDrop,cornerRadius:t.cornerRadius,cornerSegments:t.cornerSegments,...i?{onShapes:a=>In(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=Hn(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=Wn(e,t.filter);return c?{kind:"placement",...c,extent:e.extent}:null}if(t.type==="symbol"){let c=Zn(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=Sn(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 Kn(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 Jn=Map;var Ke=new Jn,Zt=self;Zt.onmessage=t=>{let e=t.data;if(e.type==="abort"){Ke.get(e.id)?.abort(),Ke.delete(e.id);return}let n=new AbortController;Ke.set(e.id,n),Qn(e,n.signal).then(r=>{Ke.has(e.id)&&(Ke.delete(e.id),Zt.postMessage(r,Kn(r)))}).catch(r=>{let i=n.signal.aborted;Ke.delete(e.id);let s={type:"error",id:e.id,message:r instanceof Error?r.message:String(r),aborted:i};Zt.postMessage(s)})};})();\n';var Hr=class{constructor(e=xi()){this.workers=[];this.blobUrl=null;this.pending=new W;this.nextId=1;this.cursor=0;this.mainThreadAborts=new W;this.destroyed=false;try{let t=new Blob([vi],{type:"text/javascript"});this.blobUrl=URL.createObjectURL(t);for(let o=0;o<e;o++){let r=new Worker(this.blobUrl);r.onmessage=i=>this.onMessage(i.data),r.onerror=i=>console.error("[osmgl] \u0432\u043E\u0440\u043A\u0435\u0440 \u0443\u043F\u0430\u043B:",i.message),this.workers.push(r);}}catch(t){console.warn("[osmgl] \u0432\u043E\u0440\u043A\u0435\u0440\u044B \u043D\u0435\u0434\u043E\u0441\u0442\u0443\u043F\u043D\u044B, \u0440\u0430\u0437\u0431\u043E\u0440 \u0442\u0430\u0439\u043B\u043E\u0432 \u043F\u043E\u0439\u0434\u0451\u0442 \u0432 \u0433\u043B\u0430\u0432\u043D\u043E\u043C \u043F\u043E\u0442\u043E\u043A\u0435:",t),this.disposeWorkers();}this.usingWorkers=this.workers.length>0;}get size(){return this.workers.length}load(e,t){let o=this.nextId++,r={type:"load",id:o,...e};if(!this.usingWorkers){let a=new AbortController;return this.mainThreadAborts.set(o,a),Kl(r,a.signal).then(s=>{this.mainThreadAborts.has(o)&&(this.mainThreadAborts.delete(o),t(s));}).catch(s=>{let l=a.signal.aborted;this.mainThreadAborts.delete(o),t({type:"error",id:o,message:s instanceof Error?s.message:String(s),aborted:l});}),o}let i=this.cursor++%this.workers.length;return this.pending.set(o,{resolve:t,workerIndex:i}),this.workers[i].postMessage(r),o}abort(e){if(!this.usingWorkers){this.mainThreadAborts.get(e)?.abort(),this.mainThreadAborts.delete(e);return}let t=this.pending.get(e);if(!t)return;this.pending.delete(e);let o={type:"abort",id:e};this.workers[t.workerIndex].postMessage(o);}onMessage(e){if(this.destroyed)return;let t=this.pending.get(e.id);t&&(this.pending.delete(e.id),t.resolve(e));}disposeWorkers(){for(let e of this.workers)e.terminate();this.workers=[],this.blobUrl&&URL.revokeObjectURL(this.blobUrl),this.blobUrl=null;}destroy(){this.destroyed=true;for(let e of this.mainThreadAborts.values())e.abort();this.mainThreadAborts.clear(),this.pending.clear(),this.disposeWorkers();}};function xi(){let n=typeof navigator<"u"&&navigator.hardwareConcurrency||4;return Math.max(1,Math.min(n-1,6))}function Ul(n){return Math.max(0,Math.ceil((n*Math.LN2+Math.log(512/360/.5))/Math.LN10))}function wi(n,e){let t=Ul(n.zoom),o=[Math.round(n.zoom*100)/100,n.center.lat.toFixed(t),n.center.lng.toFixed(t)],r=Math.round(n.bearing*10)/10,i=Math.round(n.pitch*10)/10;(r!==0||i!==0)&&(o.push(r),i!==0&&o.push(i));let a=o.join("/");return e?`${e}=${a}`:a}function _i(n,e){let t=n.replace(/^#/,"");if(!t)return null;if(e){let l=t.split("&").map(c=>c.split("=")).find(([c])=>c===e);if(!l||l.length<2)return null;t=l[1];}let o=t.split("/");if(o.length<3)return null;let r=Number(o[0]),i=Number(o[1]),a=Number(o[2]);if(!isFinite(r)||!isFinite(i)||!isFinite(a)||Math.abs(i)>90||Math.abs(a)>180)return null;let s={center:{lng:a,lat:i},zoom:r};return o.length>3&&isFinite(Number(o[3]))&&(s.bearing=Number(o[3])),o.length>4&&isFinite(Number(o[4]))&&(s.pitch=Number(o[4])),s}function Jl(n){if(typeof window>"u"||!window.history?.replaceState)return;let e=new URL(window.location.href);e.hash=n,window.history.replaceState(window.history.state,"",e.toString());}var Xl={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}},Kt=n=>Xl[n]??Xl.high;function kr(n){let{cores:e,memory:t,mobile:o,devicePixelRatio:r}=n;return e<=2||t!==void 0&&t<=2?"minimal":o?e<=4||t!==void 0&&t<=3?"minimal":e<=6||t!==void 0&&t<=4||r>=3?"low":"balanced":e<=4||t!==void 0&&t<=4?"balanced":"high"}function Pr(){if(typeof navigator>"u")return {cores:4,mobile:false,devicePixelRatio:1};let n=navigator,e=typeof matchMedia=="function"&&matchMedia("(pointer: coarse)").matches&&typeof screen<"u"&&Math.min(screen.width,screen.height)<=820,t=n.userAgentData?.mobile===true||e;return {cores:n.hardwareConcurrency||4,memory:n.deviceMemory,mobile:t,devicePixelRatio:typeof devicePixelRatio=="number"?devicePixelRatio:1}}function Ei(n,e,t,o){let r=Math.min(t||1,o.maxPixelRatio),i=Math.max(n*e,1),a=Math.sqrt(o.maxCanvasPixels/i);return Math.max(Math.min(r,a),1)}function Fi(n){return n==="high"?3:n==="balanced"?2:n==="low"?1:0}function jl(n){return n==="minimal"?"low":n==="low"?"balanced":n==="balanced"?"high":null}function Mi(n){return n==="high"?"balanced":n==="balanced"?"low":n==="low"?"minimal":null}var Rd=1,ko=class{constructor(e){this.originX=0;this.originY=0;this._revision=0;this.id=e.id??`obj-${Rd++}`,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,i=-1/0;for(let a of e)for(let s of a){let l=$(s),c=ie(l.lng),u=ae(l.lat);c<t&&(t=c),c>r&&(r=c),u<o&&(o=u),u>i&&(i=u);}if(!isFinite(t)){this.originX=0,this.originY=0;return}this.originX=(t+r)/2,this.originY=(o+i)/2;}toLocal(e){let t=[];for(let o of e){let r=$(o);t.push(ie(r.lng)-this.originX,ae(r.lat)-this.originY);}return t}color(e,t){let o=ye(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}},Si=class extends ko{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=bo([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 i=this.colorRuns();if(!i.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 s of i){let l=bo([this.toLocal(this.coordinates.slice(s.from,s.to+1))]);if(!l)continue;let c=ye(s.color);o.push(this.linePaint({kind:"line",mesh:l,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,i)=>r.at-i.at);if(!t.length)return [];let o=[];for(let r=0;r<t.length;r++){let i=r===0?0:t[r].at,a=r+1<t.length?t[r+1].at:e;a>i&&o.push({from:i,to:a,color:t[r].color});}return o}hitTest(e,t,o){let r=(this.paint.width??6)/2+(this.paint.strokeWidth??0)+o,i=Li(this.coordinates,this.altitude,t);for(let a=0;a+1<i.length;a++)if(Yl(e,i[a],i[a+1])<=r)return true;return false}},Rr=class extends ko{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=Xn(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(Di(a))),i=bo(r);i&&e.push(this.linePaint({kind:"line",mesh:i,color:this.color("strokeColor","#2f6df6"),width:o}));}return e}hitTest(e,t){let o=Li(Di(this.coordinates[0]??[]),this.altitude,t);if(!Ti(e,o))return false;for(let r=1;r<this.coordinates.length;r++)if(Ti(e,Li(Di(this.coordinates[r]),this.altitude,t)))return false;return true}},Ii=class extends Rr{constructor(e){super({...e,coordinates:[Gd(e.center,e.radius,e.segments)]});}};function Gd(n,e,t){let o=$(n),r=e/Ge(o.lat),i=ie(o.lng),a=ae(o.lat),s=Math.max(12,t??Math.min(128,Math.round(24+e/20))),l=[];for(let c=0;c<s;c++){let u=c/s*Math.PI*2;l.push([Se(i+Math.cos(u)*r),Me(a+Math.sin(u)*r)]);}return l}function Li(n,e,t){let o=[];for(let r of n){let i=$(r),a=t(i.lng,i.lat,e);a&&o.push(a);}return o}function Di(n){if(n.length<2)return n;let e=$(n[0]),t=$(n[n.length-1]);return e.lng===t.lng&&e.lat===t.lat?n:[...n,n[0]]}function Yl(n,e,t){let o=t.x-e.x,r=t.y-e.y,i=o*o+r*r;if(i<1e-12)return Math.hypot(n.x-e.x,n.y-e.y);let a=((n.x-e.x)*o+(n.y-e.y)*r)/i;return a=a<0?0:a>1?1:a,Math.hypot(n.x-(e.x+a*o),n.y-(e.y+a*r))}function Ti(n,e){let t=false;for(let o=0,r=e.length-1;o<e.length;r=o++){let i=e[o].x,a=e[o].y,s=e[r].x,l=e[r].y;a>n.y!=l>n.y&&n.x<(s-i)*(n.y-a)/(l-a)+i&&(t=!t);}return t}var Zl="objects3d",Ut="level",Od=32,Wd=100,Hi=120,Vd=40,zd=.35,Nd=.02,Kd=150,Ud=250;function Ql(n){return typeof n=="number"?{top:n,right:n,bottom:n,left:n}:{top:n?.top??0,right:n?.right??0,bottom:n?.bottom??0,left:n?.left??0}}function Jd(n){let e={...n};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 ki=class extends Qe{constructor(t){super();this.options=t;this.transform=new jt;this.ctx=null;this.sources=new W;this.rasterSources=new W;this.renderer=new xo;this.objects=new go;this.markerHost=null;this.gestures=null;this.resizeObserver=null;this.frameHandle=0;this.needsRepaint=true;this.padding={top:0,right:0,bottom:0,left:0};this.animation=null;this.loaded=false;this.destroyed=false;this.objects3d=null;this.objects3dEnabled=true;this.frameRing=new Uint8Array(Hi);this.ringAt=0;this.ringSum=0;this.ringFilled=0;this.steadyFrames=0;this.lastFrameAt=0;this.continuousFrames=0;this.onHashChange=null;this.lastMoveEmit=0;this.lastIndoorKey="";this.writingHash=false;this.hashTimer=0;this.layerOverrides=new W;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?kr(Pr()):t.quality;this.qualityCeiling=r,this.quality=Kt(r),this.densityQuality=this.quality,this.maxPixelRatio=t.maxPixelRatio??this.quality.maxPixelRatio,this._style=new Tt(t.theme?pr(t.theme,t.style):t.style),this.background=t.background?ye(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 i=document.createElement("div");i.className="osmgl-markers",i.style.cssText="position:absolute;inset:0;overflow:hidden;pointer-events:none",this.container.appendChild(i),this.markerHost=i,this.objects.setMarkerHost(i);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=$(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 Hr(t.workerCount??Math.min(xi(),this.quality.maxWorkers)),this.initGL(),this.initSource(),this.initInput(),this.initResize(),queueMicrotask(()=>{this.destroyed||(this.loaded=true,this.emit("load",void 0),this.triggerRepaint());});}initGL(){let t=this.canvas.getContext("webgl2",{alpha:false,antialias:this.quality.antialias,depth:true,stencil:true,preserveDrawingBuffer:false,powerPreference:"high-performance",failIfMajorPerformanceCaveat:false});if(!t)throw new Error("[osmgl] WebGL2 \u043D\u0435\u0434\u043E\u0441\u0442\u0443\u043F\u0435\u043D \u0432 \u044D\u0442\u043E\u043C \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435");this.ctx=new Vo(t);let o=new Wt(this.options.fonts??"/tileserver/fonts/{fontstack}/{range}.pbf",this.options.fontstack);this.options.icons&&o.icons.setIcons({...gt,...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 Tr({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:Zl,type:"model",sourceLayer:t.sourceLayer??"model3d",minzoom:0,maxzoom:24}}planFor(t,o=this._style){let r=o.workerPlan(t),i=t===this.objects3dSource?[...r,this.objects3dPlan()]:r;return this.quality.simpleGeometry?i.map(Jd):i}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(s=>this.renderer.models.remove(s,this.ctx?.gl)),this.renderer.hiddenBuildings=t.replacedBuildings,this.renderer.hiddenVenues=t.replacedVenues,this.renderer.hiddenVenueLayer=null;return}let i=this.venuesForMask();t.update({id:Zl,"source-layer":this.options.objects3d.sourceLayer??"model3d",layout:this.options.objects3d.layout},r,this.transform,s=>this.renderer.models.add(s),s=>this.renderer.models.remove(s,this.ctx?.gl),this.buildingsForMask(),i),this.renderer.hiddenBuildings=t.replacedBuildings,this.renderer.hiddenVenues=t.replacedVenues,this.renderer.hiddenVenueLayer=i?.key??null;let a=this.renderer.indoorMask.footprint();if(a){let s=this.transform.worldSize>0?this.transform.pixelsPerMeter/this.transform.worldSize*1.5:0;for(let l of t.models){let c=l.origin();l.setHidden(je(a,c.x,c.y,s));}}else for(let s of t.models)s.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===Ut&&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 i=this.sources.get(r),a=this._style.bucketKeyFor(o);if(i&&a!==null)return {source:i,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 i=new So({url:o.url,minzoom:o.minzoom??0,maxzoom:o.maxzoom??19,cacheSize:this.quality.tileCacheSize*2});return i.on("data",()=>this.triggerRepaint()),i.on("error",({message:a})=>this.emit("error",{message:a})),this.rasterSources.set(t,i),this.triggerRepaint(),this}let r=new Mr(this.pool,{url:o.url,minzoom:o.minzoom??0,maxzoom:o.maxzoom??14,cacheSize:this.quality.tileCacheSize*2,plan:this.planFor(t)});return r.on("data",()=>this.triggerRepaint()),r.on("error",({message:i})=>this.emit("error",{message:i})),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 i=t;if(t=null,r.button!==0||!i||Math.hypot(r.clientX-i.x,r.clientY-i.y)>4||performance.now()-i.t>500)return;let a=this.canvas.getBoundingClientRect(),s={x:r.clientX-a.left,y:r.clientY-a.top},l=this.objects.hitTest(this.transform,s),c=l?null:this.queryRoom(s),u=l||c?null:this.queryBuilding(s);this.options.highlightBuildings!==false&&(this.setHighlight(u),this.setRoomHighlight(c));for(let h of this.getPopups())h.closeOnClick&&this.removePopup(h);this.emit("click",{point:s,lngLat:this.transform.unproject(s),object:l,building:u,symbol:this.querySymbol(s,4)});}),this.canvas.addEventListener("dblclick",r=>{let i=this.pointOf(r);this.emit("dblclick",{point:i,lngLat:this.transform.unproject(i)});}),this.canvas.addEventListener("contextmenu",r=>{r.preventDefault();let i=this.pointOf(r);this.emit("contextmenu",{point:i,lngLat:this.transform.unproject(i)});});let o=0;this.canvas.addEventListener("pointermove",r=>{if(r.pointerType==="touch")return;let i=performance.now();if(i-o<16)return;o=i;let a=this.pointOf(r),s=this.querySymbol(a);this.setSymbolHover(s),this.emit("mousemove",{point:a,lngLat:this.transform.unproject(a),object:this.objects.hitTest(this.transform,a),symbol:s});});}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=Ei(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=$(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=$(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,i={center:r.center,zoom:r.zoom,bearing:r.bearing,pitch:r.pitch},s={center:t.center!==void 0?$(t.center):r.center,zoom:t.zoom??r.zoom,bearing:i.bearing+Bt((t.bearing??r.bearing)-i.bearing),pitch:t.pitch??r.pitch};return this.animation={start:performance.now(),duration:o,from:i,to:s},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?$(t.center):o.center,zoom:t.zoom??o.zoom,bearing:r.bearing+Bt((t.bearing??o.bearing)-r.bearing),pitch:t.pitch??o.pitch},s=qe(r.zoom),l=(ie(a.center.lng)-ie(r.center.lng))*s,c=(ae(a.center.lat)-ae(r.center.lat))*s,u=Math.hypot(l,c),h=Math.max(o.width,o.height),f=h*Math.pow(2,r.zoom-a.zoom),d=1.42,p=d*d,m,y=null;if(u<1e-6){let g=Math.log(f/h);m=Math.abs(g)/d,y=A=>({u:0,w:h*Math.exp(d*Math.sign(g)*A)});}else {let g=C=>{let v=C===0?h:f,E=C===0?f:h;return (E*E-v*v+(C===0?1:-1)*p*p*u*u)/(2*v*p*u)},A=C=>Math.log(-g(C)+Math.sqrt(g(C)*g(C)+1)),B=A(0);m=(A(1)-B)/d;let w=C=>(Math.exp(C)+Math.exp(-C))/2,_=C=>(Math.exp(2*C)-1)/(Math.exp(2*C)+1);y=C=>{let v=d*C+B;return {u:h*w(B)*_(v)/p-h*Math.sinh(B)/p,w:h*w(B)/w(v)}};}if(!Number.isFinite(m)||m<=0)return this.jumpTo(t);let b=t.duration??Math.min(3e3,m/1.2*1e3);return this.animation={start:performance.now(),duration:b,from:r,to:a,fly:{S:m,u1:u,curve:y,w0:h}},this.triggerRepaint(),this}setPadding(t){return this.padding=Ql(t),this.renderer.symbols&&(this.renderer.symbols.padding=this.padding),this.triggerRepaint(),this}getPadding(){return {...this.padding}}getBounds(){let t=this.transform,o=new Jt;for(let[r,i]of [[0,0],[t.width,0],[t.width,t.height],[0,t.height]])o.extend(t.unproject({x:r,y:i}));return o}cameraForBounds(t,o={}){let r=this.transform,i=Wr(t,{width:r.width,height:r.height,bearing:o.bearing??r.bearing,padding:o.padding!==void 0?Ql(o.padding):this.padding,maxZoom:Math.min(o.maxZoom??r.maxZoom,r.maxZoom),minZoom:r.minZoom});return i?{...i,pitch:o.pitch??r.pitch}:null}fitBounds(t,o={}){let r=this.cameraForBounds(t,o);if(!r)return this;let i={...r,duration:o.duration??600};return o.fly?this.flyTo(i):this.easeTo(i)}stepAnimation(t){let o=this.animation;if(!o)return false;let r=_e((t-o.start)/o.duration,0,1),i=o.fly?r:Wo(r),a=this.transform,s=$(o.from.center),l=$(o.to.center);if(o.fly){let{u:c,w:u}=o.fly.curve(o.fly.S*r),h=o.fly.u1>1e-6?_e(c/o.fly.u1,0,1):r;return a.center={lng:s.lng+(l.lng-s.lng)*h,lat:s.lat+(l.lat-s.lat)*h},a.zoom=o.from.zoom+Math.log2(o.fly.w0/u),a.bearing=o.from.bearing+(o.to.bearing-o.from.bearing)*Wo(r),a.pitch=o.from.pitch+(o.to.pitch-o.from.pitch)*Wo(r),r>=1&&(a.center=l,a.zoom=o.to.zoom),this.emitMove(),r>=1?(this.animation=null,this.emit("moveend",void 0),false):true}return a.center={lng:s.lng+(l.lng-s.lng)*i,lat:s.lat+(l.lat-s.lat)*i},a.zoom=o.from.zoom+(o.to.zoom-o.from.zoom)*i,a.bearing=o.from.bearing+(o.to.bearing-o.from.bearing)*i,a.pitch=o.from.pitch+(o.to.pitch-o.from.pitch)*i,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($(t),o)}unproject(t){return this.transform.unproject(t)}get style(){return this._style}setStyle(t){let o=this._style,r=new Tt(t);Object.assign(r.splitValues,o.splitValues),this._style=r,this.applyLayerOverrides();for(let[i,a]of this.sources.entries()){let s=JSON.stringify(o.workerPlan(i)),l=JSON.stringify(r.workerPlan(i));s!==l&&a.setPlan(this.planFor(i,r));}return this.objects3d?.setModelKey(t.model3dKey??""),this.triggerRepaint(),this}setTheme(t){return this.setStyle(pr(t,this.options.style))}static get themes(){return Object.keys(Ht)}static get themeList(){return Object.entries(Ht).map(([t,o])=>({id:t,name:o.name||t}))}setLayoutProperty(t,o,r){let i=this._style.layers.find(s=>s.id===t);if(!i)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=i.layout??(i.layout={});if(a[o]=r,this.rememberOverride(t,{layout:{[o]:r}}),o==="textField"||o==="iconImage"||o==="splitBy")for(let[s,l]of this.sources)l.setPlan(this.planFor(s));return this.triggerRepaint(),this}setPaintProperty(t,o,r){let i=this._style.layers.find(a=>a.id===t);return i?(i.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:Me(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 i=this.sources.get(r.source??Y);if(!i)continue;let a=Kn(this.transform,i,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 W,i;for(let s of this._style.layers){if(s.type!=="fill"||!s.id.startsWith("indoor-")||s.id==="indoor-shell"||!this._style.layerVisibleAt(s,this.transform.zoom))continue;let l=this._style.bucketKeyFor(s);l&&(o.push(l),r.set(l,s.id),i??(i=this.sources.get(s.source??Y)));}if(!i||!o.length)return null;let a=Un(this.transform,i,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=wi({center:t.center,zoom:t.zoom,bearing:t.bearing,pitch:t.pitch},this.hashName);this.writingHash=true,Jl("#"+o),setTimeout(()=>this.writingHash=false,0);}applyHash(t){if(typeof window>"u")return;let o=_i(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"?kr(Pr()):t;return this.qualityCeiling=o,this.resetFrameWindow(),this.applyQuality(Kt(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,i=o?r:t.simpleGeometry;if(this.quality={...t,simpleGeometry:i},this.resetFrameWindow(),this.objects3d&&(this.objects3d.budgetScale=t.modelBudget),r!==i)for(let[a,s]of this.sources.entries())s.setPlan(this.planFor(a));o||(this.densityQuality=t,this.options.maxPixelRatio===void 0&&(this.maxPixelRatio=t.maxPixelRatio)),this.renderer.detailScale=t.detail,this.renderer.allowShadows=t.allowShadows,this.renderer.shadows.resolution!==t.shadowMapSize&&this.setShadows({resolution:t.shadowMapSize});for(let a of this.sources.values())a.setCoverOptions({detailBias:t.detailBias,maxTiles:t.maxTiles});this.resize();}resetFrameWindow(){this.frameRing.fill(0),this.ringAt=0,this.ringSum=0,this.ringFilled=0,this.steadyFrames=0;}checkFrameBudget(t){if(!this.qualityAuto||this.sum(a=>a.pendingCount)>0)return;let o=t>Wd?3:t>Od?1:0;if(this.ringSum+=o-this.frameRing[this.ringAt],this.frameRing[this.ringAt]=o,this.ringAt=(this.ringAt+1)%Hi,this.ringFilled<Hi&&this.ringFilled++,this.steadyFrames++,this.ringFilled<Vd)return;let r=this.ringSum/this.ringFilled;if(r>=zd){let a=Mi(this.quality.name);if(!a)return;console.info(`[osmgl] \u0442\u044F\u0436\u0451\u043B\u044B\u0445 \u043A\u0430\u0434\u0440\u043E\u0432 ${(r*100).toFixed(0)}% \u2014 \u043A\u0430\u0447\u0435\u0441\u0442\u0432\u043E \u043F\u043E\u043D\u0438\u0436\u0435\u043D\u043E \u0434\u043E \xAB${a}\xBB (\u043F\u043B\u043E\u0442\u043D\u043E\u0441\u0442\u044C \u0431\u0443\u0444\u0435\u0440\u0430 \u043F\u0440\u0435\u0436\u043D\u044F\u044F)`),this.applyQuality(Kt(a),true);return}if(r>Nd||this.steadyFrames<Kd)return;let i=jl(this.quality.name);!i||Fi(i)>Fi(this.qualityCeiling)||(console.info(`[osmgl] \u043A\u0430\u0434\u0440\u044B \u0443\u043A\u043B\u0430\u0434\u044B\u0432\u0430\u044E\u0442\u0441\u044F \u0432 \u0431\u044E\u0434\u0436\u0435\u0442 \u2014 \u043A\u0430\u0447\u0435\u0441\u0442\u0432\u043E \u043F\u043E\u0434\u043D\u044F\u0442\u043E \u0434\u043E \xAB${i}\xBB`),this.applyQuality(Kt(i),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(i=>i.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=ye(t),this.triggerRepaint(),this}getIndoorLevels(){let t=[];for(let[o,r]of this.sources.entries())if(this._style.layers.some(i=>(i.source??Y)===o&&"splitBy"in i&&i.splitBy===Ut))for(let i of r.splitValues(Ut)){let a=Number(i);Number.isFinite(a)&&!t.includes(a)&&t.push(a);}return t.sort((o,r)=>o-r)}getIndoorLevel(){let t=this._style.splitValues[Ut];return typeof t=="number"?t:null}setIndoorLevel(t){return t===null?delete this._style.splitValues[Ut]:this._style.splitValues[Ut]=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(i=>i>=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 Ho)}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(),i=t==="globe"?Math.min(o.maxPitch,Xt):o.maxPitch,a=o.zoom<r,s=o.pitch>i;return a||s?this.easeTo({zoom:a?r:o.zoom,pitch:s?i: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,i){let a=this.ctx;if(!a||!a.caps.colorBufferFloat)return null;let s=a.gl,l=this.canvas.width,c=this.canvas.height,u=!!s.getExtension("EXT_float_blend"),h=u?s.RGBA32F:s.RGBA16F,f=u?s.FLOAT:s.HALF_FLOAT;if(this.debugFB&&(this.debugFB.w!==l||this.debugFB.h!==c)&&(s.deleteFramebuffer(this.debugFB.fb),s.deleteTexture(this.debugFB.tex),s.deleteRenderbuffer(this.debugFB.rb),this.debugFB=null),!this.debugFB){let d=s.createTexture(),p=s.createFramebuffer(),m=s.createRenderbuffer();if(!d||!p||!m)return null;s.bindTexture(s.TEXTURE_2D,d),s.texImage2D(s.TEXTURE_2D,0,h,l,c,0,s.RGBA,f,null),s.texParameteri(s.TEXTURE_2D,s.TEXTURE_MIN_FILTER,s.NEAREST),s.texParameteri(s.TEXTURE_2D,s.TEXTURE_MAG_FILTER,s.NEAREST),s.bindTexture(s.TEXTURE_2D,null),s.bindRenderbuffer(s.RENDERBUFFER,m),s.renderbufferStorage(s.RENDERBUFFER,s.DEPTH24_STENCIL8,l,c),s.bindRenderbuffer(s.RENDERBUFFER,null),s.bindFramebuffer(s.FRAMEBUFFER,p),s.framebufferTexture2D(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0,s.TEXTURE_2D,d,0),s.framebufferRenderbuffer(s.FRAMEBUFFER,s.DEPTH_STENCIL_ATTACHMENT,s.RENDERBUFFER,m);let y=s.checkFramebufferStatus(s.FRAMEBUFFER);if(s.bindFramebuffer(s.FRAMEBUFFER,null),a.invalidateState(),y!==s.FRAMEBUFFER_COMPLETE)return null;this.debugFB={fb:p,tex:d,rb:m,w:l,h:c};}a.screen=this.debugFB.fb;try{this.renderFrame(performance.now()),a.bindFramebuffer(this.debugFB.fb);let d=new Float32Array(r*i*4);return s.readPixels(t,o,r,i,s.RGBA,s.FLOAT,d),{data:d,format:u?"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),i=this.ctx;i.bindFramebuffer(null),i.viewport(0,0,this.canvas.width,this.canvas.height),i.setDepthMask(true),i.clear(this.background??this._style.background,true,true);for(let d of this.sources.values())d.update(this.transform);this.updateObjects3D();for(let[d,p]of this.rasterSources)this.rasterLayerVisible(d)&&p.update(this.transform);this.syncIndoor(),this.objects.updateMarkers(this.transform);let a=(this.sources.size>0||this.rasterSources.size>0)&&this.renderer.render(i,this.transform,this.sources,this._style,t,this.rasterSources),s=performance.now()-o,l=r||a||this.needsRepaint,c=this.lastFrameAt>0?t-this.lastFrameAt:0,u=c>0&&c<Ud,h=u?c:0;this.continuousFrames=u?this.continuousFrames+1:0;let f=this.continuousFrames>1?c:s;this.lastFrameAt=t,this.checkFrameBudget(f),this.emit("render",{frameMs:s,intervalMs:h}),l&&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();}}},c2=ki;
|
|
2014
|
-
exports.AssetLoader=
|
|
2307
|
+
`;var gr=n=>n.kind==="symbol",is=n=>n.kind==="placement";function Ze(n,e,t,o){for(let r of n)for(let i=0;i+5<r.length;i+=6){let a=r[i],l=r[i+1],s=r[i+2],c=r[i+3],h=r[i+4],u=r[i+5];if(ju(e,t,a,l,s,c,h,u)||o>0&&(Vn(e,t,a,l,s,c)<=o||Vn(e,t,s,c,h,u)<=o||Vn(e,t,h,u,a,l)<=o))return true}return false}function ju(n,e,t,o,r,i,a,l){let s=(n-r)*(o-i)-(t-r)*(e-i),c=(n-a)*(i-l)-(r-a)*(e-l),h=(n-t)*(l-o)-(a-t)*(e-o),u=s<0||c<0||h<0,f=s>0||c>0||h>0;return !(u&&f)}function Vn(n,e,t,o,r,i){let a=r-t,l=i-o,s=a*a+l*l,c=s>0?Math.max(0,Math.min(1,((n-t)*a+(e-o)*l)/s)):0;return Math.hypot(n-(t+a*c),e-(o+l*c))}function Wn(n,e){let t=new DataView(n.vertices),o=new Uint32Array(n.indices),r=e.bounds(),i=(r.maxX-r.minX)/n.extent,a=new Float64Array(o.length*2);for(let l=0;l<o.length;l++){let s=o[l]*et;a[l*2]=r.minX+t.getInt16(s,true)*i,a[l*2+1]=r.minY+t.getInt16(s+2,true)*i;}return a}function Nn(n,e,t){let o=new DataView(n.vertices),r=t.bounds(),i=(r.maxX-r.minX)/e,a=r.minX,l=r.minY,s=new Float64Array(n.indices.length*2);for(let c=0;c<n.indices.length;c++){let h=n.indices[c]*Ie;s[c*2]=a+o.getInt16(h,true)*i,s[c*2+1]=l+o.getInt16(h+2,true)*i;}return s}var Yu={stride:8,attribs:[{name:"a_pos",size:2,type:5126,offset:0}]},Zu=40,Qu=10.5,as=2.5,qu=16,$u=4,eh=7,mo=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,i,a,l,s=false){this.count=0;let c=t.zoom,h=r.layers.filter(B=>B.type==="symbol"&&B.layout?.placement==="map"&&r.layerVisibleAt(B,c));if(!h.length)return;let u=t.center,f=ne(u.lng),d=ie(u.lat),p=t.worldSize>0?t.pixelsPerMeter/t.worldSize:0;if(!(p>0))return;let b=[];for(let B of h){let x=o.get(B.source??Y);if(!x)continue;let w=r.bucketKeyFor(B);if(w===null)continue;let _=B.layout?.showFor==="highlight";if(_&&!this.highlightFootprint)continue;let C=p*1.5,E=B.layout?.arrowUnits==="meters"?p:1/t.worldSize,D=V(B.layout?.arrowLength,c,Zu)*E,F=V(B.layout?.arrowWidth,c,Qu)*E,H=V(B.layout?.arrowOutline,c,as)*E,S=V(B.layout?.arrowGap,c,qu)*E,L=V(B.layout?.arrowDotRadius,c,$u)*E,M=V(B.layout?.arrowDotGap,c,eh)*E,T=Un(D,F,L,S-M),P=H>0?Un(D,F,L,S-M,H).outline:null,k={layer:B,verts:[],shape:T};for(let O of x.visibleTiles){let G=x.getTile(O)?.data?.buckets?.[w];if(!G||!gr(G))continue;let R=new Int16Array(G.anchors),W=G.rotations?new Int16Array(G.rotations):null,j=O.bounds(),Z=(j.maxX-j.minX)/G.extent,ee=j.minX,ge=j.minY;for(let te=0;te<R.length/2;te++){let X=ee+R[te*2]*Z,re=ge+R[te*2+1]*Z;if(_&&!Ze(this.highlightFootprint,X,re,C))continue;let le=(W?W[te]:0)*Math.PI/180,q=Math.sin(le),U=-Math.cos(le),J=X-f-q*S,fe=re-d-U*S;P&&Jn(k,P,J,fe,q,U),Jn(k,T.outline,J,fe,q,U),this.count++;}}k.verts.length&&b.push(k);}if(!b.length)return;let m=b[0].shape,g=m.outline.length/2,y=[],A=[];for(let B of b){let x=y.length/2/g;for(let w of B.verts)y.push(w);A.push({layer:B.layer,first:x,count:B.verts.length/2/g});}if(this.ensureBuffers(e,y.length/2/g,m,a),!(!this.vao||!this.vbo)){this.vbo.update(new Uint8Array(new Float32Array(y).buffer)),i.use(),l?.(i),s&&i.setMat4("u_shadow_matrix",t.shadowObjectMatrix(f,d,0)),i.setMat4("u_matrix",t.objectMatrix(f,d,0)),e.setDepthTest(false),e.setDepthMask(false),e.setBlend("premultiplied"),e.setCull("none"),this.vao.bind();for(let B of A){let x=B.layer.paint,w=V(x.opacity,c,1),_=He(x.color,c,[.18,.45,.76,1]),C=He(x.haloColor,c,[1,1,1,1]),v=V(B.layer.layout?.arrowOutline,c,as)>0;th(e,i,B,C,_,w,v,this.indicesPerArrow);}e.bindVAO(null),e.setDepthTest(true);}}ensureBuffers(e,t,o,r){let i=o.outline.length/2;if(this.vao&&t<=this.capacity&&i===this.perArrow)return;this.vao?.destroy(),this.vbo?.destroy(),this.ibo?.destroy(),this.capacity=Math.max(256,Math.ceil(t*1.5)),this.perArrow=i,this.indicesPerArrow=o.indices.length,this.vbo=new ve(e,new Uint8Array(this.capacity*i*8),Yu,true);let a=new Uint32Array(this.capacity*o.indices.length);for(let l=0;l<this.capacity;l++){let s=l*i;for(let c=0;c<o.indices.length;c++)a[l*o.indices.length+c]=s+o.indices[c];}this.ibo=new ye(e,a),this.vao=new pe(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 th(n,e,t,o,r,i,a,l){let s=a?2:1;if(a){e.setVec4v("u_color",Me([o[0],o[1],o[2],o[3]*i]));for(let c=0;c<t.count;c+=s)ls(n,t.first+c,l);}e.setVec4v("u_color",Me([r[0],r[1],r[2],r[3]*i]));for(let c=a?1:0;c<t.count;c+=s)ls(n,t.first+c,l);}function ls(n,e,t){n.gl.drawElements(n.gl.TRIANGLES,t,n.gl.UNSIGNED_INT,e*t*4);}var ss=4,Kn=12;function Un(n,e,t,o,r=0){let i=n*.38,a=e*1.35,l=i*.3,s=e*.32,c=e/2,h=-n+s,u=[],f=(g,y)=>u.push(g,y);f(0,0),f(-i,a),f(-i+l,c),f(h,s);for(let g=1;g<ss;g++){let y=g/ss*Math.PI;f(h-Math.sin(y)*s,Math.cos(y)*s);}f(h,-s),f(-i+l,-c),f(-i,-a);let d=r>0?oh(u,r):u,p=Pe(u,void 0,2);if(t<=0)return {outline:d,indices:p};let b=d.length/2,m=t+r;for(let g=0;g<Kn;g++){let y=g/Kn*Math.PI*2;d.push(o+Math.cos(y)*m,Math.sin(y)*m);}for(let g=1;g<Kn-1;g++)p.push(b,b+g,b+g+1);return {outline:d,indices:p}}function oh(n,e){let t=n.length/2,o=0;for(let a=0;a<t;a++){let l=(a+1)%t;o+=n[a*2]*n[l*2+1]-n[l*2]*n[a*2+1];}let r=o<0?-1:1,i=[];for(let a=0;a<t;a++){let l=n[(a+t-1)%t*2],s=n[(a+t-1)%t*2+1],c=n[a*2],h=n[a*2+1],u=n[(a+1)%t*2],f=n[(a+1)%t*2+1],d=Math.hypot(c-l,h-s)||1,p=Math.hypot(u-c,f-h)||1,b=r*(h-s)/d,m=-r*(c-l)/d,g=r*(f-h)/p,y=-r*(u-c)/p,A=b+g,B=m+y,x=Math.hypot(A,B);if(x<1e-9){i.push(c,h);continue}A/=x,B/=x;let w=Math.min(1/Math.max(A*b+B*m,.35),3);i.push(c+A*e*w,h+B*e*w);}return i}function Jn(n,e,t,o,r,i){let a=-i,l=r;for(let s=0;s<e.length;s+=2){let c=e[s],h=e[s+1];n.verts.push(t+r*c+a*h,o+i*c+l*h);}}function rh(n,e,t,o,r,i=0,a=0){let l=t*Math.PI/180,s={verts:[]};return Jn(s,Un(o,r,i,a).outline,n,e,Math.sin(l),-Math.cos(l)),s.verts}var nh=5;function cs(n,e){let t=1/(1<<e),o=(1<<e)-1;return [(n.x&o)*t,(n.y&o)*t,t]}var yr=class{constructor(){this.anisotropy=0;this.anisotropyPname=0;this.anisotropyChecked=false;}render(e,t,o,r,i,a,l,s=false){if(!a.size)return;let c=i.layers.filter(h=>h.type==="raster"&&!!h.overlay===s&&i.layerVisibleAt(h,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 h of c){let u=a.get(h.source);if(!u)continue;let f=V(h.paint?.opacity,l,1);if(!(f<=.001)){r.setFloat("u_opacity",f),o.bind();for(let d of u.visibleTiles){let p=this.patchFor(e,u,d);p&&(e.bindTexture(0,p.texture),r.setVec3("u_uv_transform",p.uv[0],p.uv[1],p.uv[2]),r.setMat4("u_matrix",t.tileMatrix(d,1)),e.gl.drawElements(e.gl.TRIANGLES,6,e.gl.UNSIGNED_SHORT,0));}}}e.bindVAO(null);}}patchFor(e,t,o){let r=t.getTile(o),i=r&&r.state==="loaded"?this.textureFor(e,r):null;if(i)return {texture:i,uv:[0,0,1]};for(let a=1;a<=nh&&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:cs(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,i=r.createTexture();if(!i)return null;e.bindTexture(0,i),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:i,destroy:()=>r.deleteTexture(i)};return t.texture=a,t.image.close(),t.image=null,i}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 ih="indoor-",bo=class{constructor(){this.parts=null;this.stamp="";this.cache=new z;this.box=null;this.hidden=new oe;this.collected=new oe;}get active(){return this.parts!==null}footprint(){return this.parts}get hiddenCount(){return this.hidden.size}sync(e,t,o){let r=[],i;for(let f of t.layers){if(!f.id.startsWith(ih)||f.type!=="fill"||!t.layerVisibleAt(f,o))continue;let d=t.bucketKeyFor(f);d&&(r.push(d),i??(i=e.get(f.source??Y)));}if(!r.length||!i){this.parts&&this.destroy();return}let a=r.join(",")+"|"+i.visibleTiles.map(f=>f.dataKey+(i.getTile(f)?.data?"+":"-")).join(",");if(a===this.stamp)return;this.stamp=a,this.free();let l=[],s=1/0,c=1/0,h=-1/0,u=-1/0;for(let f of i.visibleTiles){let d=i.getTile(f)?.data?.buckets;if(d)for(let p of r){let b=d[p];if(!b||b.kind!=="fill")continue;let m=Wn(b,f);l.push(m);for(let g=0;g<m.length;g+=2)m[g]<s&&(s=m[g]),m[g]>h&&(h=m[g]),m[g+1]<c&&(c=m[g+1]),m[g+1]>u&&(u=m[g+1]);}}this.parts=l.length?l:null,this.box=l.length?[s,c,h,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),i=new Float64Array(e.featureIds),a=new DataView(e.vertices),l=t.bounds(),s=(l.maxX-l.minX)/e.extent,c=this.box,h=new z;for(let u=0;u*3<r.length;u++){let f=i[u];if(this.hidden.has(f))continue;let d=h.get(f);d||h.set(f,d=[1/0,1/0,-1/0,-1/0]);for(let p=0;p<3;p++){let b=r[u*3+p]*Ie,m=a.getInt16(b,true),g=a.getInt16(b+2,true);m<d[0]&&(d[0]=m),g<d[1]&&(d[1]=g),m>d[2]&&(d[2]=m),g>d[3]&&(d[3]=g);}}for(let[u,f]of h){let d=l.minX+(f[0]+f[2])/2*s,p=l.minY+(f[1]+f[3])/2*s;c&&(d<c[0]||d>c[2]||p<c[1]||p>c[3])||Ze(o,d,p,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 i=e.getTile(r)?.data?.buckets?.[t];!i||i.kind!=="fill-extrusion"||(this.collected.add(r.dataKey),this.collectHidden(i,r));}this.hidden.size!==o&&this.free();}indicesFor(e,t,o,r,i,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 h=new Uint32Array(s.indices),u=new Float64Array(s.featureIds),f=[];for(let d=0;d*3<h.length;d++)this.hidden.has(u[d])||f.push(h[d*3],h[d*3+1],h[d*3+2]);if(f.length<h.length){let d=new ye(e,new Uint32Array(f));c={vao:new pe(e,[{buffer:i,locations:a}],d),ibo:d,count:f.length};}}return this.cache.set(r.dataKey,c),c}};var fs=35,ah=70,lh=.35,sh=.5,ch=1.1;function kt(n,e){let t=e.sky;if(!t.enabled||t.fogIntensity<=0)return {near:0,far:1/0,intensity:0,cutoff:1/0};let o=n.cameraToCenterDistance,r=_e((n.pitch-fs)/(ah-fs),0,1),i=t.fogRange[0]*(1-lh*r)*o,a=t.fogRange[1]*(1-sh*r)*o,l=Math.min(1,t.fogIntensity+(1-t.fogIntensity)*Math.min(1,r*2)),s=l>=.995?a*ch:1/0;return {near:i,far:a,intensity:l,cutoff:s}}function Xn(n,e,t,o){let r=o.x/Math.max(n.width,1)*2-1,i=1-o.y/Math.max(n.height,1)*2,a=null,l=new Float64Array(16),s=[0,0,0,0],c=[0,0,0,0];for(let h of e.visibleTiles){let u=e.getTile(h),f=u&&us(u,t);if(!f||!Ne(l,n.tileMatrix64(h,f.extent))||(de(s,l,[r,i,-1,1]),de(c,l,[r,i,1,1]),s[3]===0||c[3]===0))continue;let d=s[0]/s[3],p=s[1]/s[3],b=s[2]/s[3],m=c[0]/c[3]-d,g=c[1]/c[3]-p,y=c[2]/c[3]-b,A=uh(f,d,p,b,m,g,y);A&&(!a||A.t<a.distance)&&(a={featureId:A.featureId,tile:h,layerId:t,distance:A.t});}return a}function jn(n,e,t,o){let r=o.x/Math.max(n.width,1)*2-1,i=1-o.y/Math.max(n.height,1)*2,a=null,l=new Float64Array(16),s=[0,0,0,0],c=[0,0,0,0];for(let h of e.visibleTiles){let u=e.getTile(h);if(u)for(let f of t){let d=u.data?.buckets?.[f];if(!d||d.kind!=="fill"||!d.featureIds||!Ne(l,n.tileMatrix64(h,d.extent))||(de(s,l,[r,i,-1,1]),de(c,l,[r,i,1,1]),s[3]===0||c[3]===0))continue;let p=s[0]/s[3],b=s[1]/s[3],m=s[2]/s[3],g=c[2]/c[3]-m;if(Math.abs(g)<1e-9)continue;let y=-m/g;if(y<0||y>1)continue;let A=p+(c[0]/c[3]-p)*y,B=b+(c[1]/c[3]-b)*y,x=fh(d,A,B);x!==null&&(!a||y<a.distance)&&(a={featureId:x,tile:h,layerId:f,distance:y});}}return a}function fh(n,e,t){let o=new DataView(n.vertices),r=new Uint32Array(n.indices),i=new Float64Array(n.featureIds),a=s=>o.getInt16(s*et,true),l=s=>o.getInt16(s*et+2,true);for(let s=0;s*3<r.length;s++){let c=r[s*3],h=r[s*3+1],u=r[s*3+2],f=a(c),d=l(c),p=a(h),b=l(h),m=a(u),g=l(u),y=(e-p)*(d-b)-(f-p)*(t-b),A=(e-m)*(b-g)-(p-m)*(t-g),B=(e-f)*(g-d)-(m-f)*(t-d),x=y<0||A<0||B<0,w=y>0||A>0||B>0;if(!(x&&w))return i[s]}return null}function us(n,e){let t=n.data?.buckets?.[e];return !t||t.kind!=="fill-extrusion"||!t.featureIds?null:t}function uh(n,e,t,o,r,i,a){let l=new DataView(n.vertices),s=new Uint32Array(n.indices),c=new Float64Array(n.featureIds),h=b=>l.getInt16(b*Ie,true)/_t,u=b=>l.getInt16(b*Ie+2,true)/_t,f=b=>l.getUint16(b*Ie+4,true)/Et,d=1/0,p=-1;for(let b=0;b+2<s.length;b+=3){let m=s[b],g=s[b+1],y=s[b+2],A=h(m),B=u(m),x=f(m),w=h(g)-A,_=u(g)-B,C=f(g)-x,v=h(y)-A,E=u(y)-B,D=f(y)-x,F=i*D-a*E,H=a*v-r*D,S=r*E-i*v,L=w*F+_*H+C*S;if(L>-1e-9&&L<1e-9)continue;let M=1/L,T=e-A,P=t-B,k=o-x,O=(T*F+P*H+k*S)*M;if(O<0||O>1)continue;let N=P*C-k*_,G=k*w-T*C,R=T*_-P*w,W=(r*N+i*G+a*R)*M;if(W<0||O+W>1)continue;let j=(v*N+E*G+D*R)*M;j<0||j>1||j>=d||(d=j,p=c[b/3]??0);}return p>=0?{featureId:p,t:d}:null}function Ar(n,e,t){let o=us(n,e);if(!o)return null;let r=new Uint32Array(o.indices),i=new Float64Array(o.featureIds),a=[];for(let l=0;l+2<r.length;l+=3)i[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,Yn=8,hh=2,dh=12,Br=8,Cr=8;function go(n){let e=0;for(let d of n)e+=d.length/2;if(e<2)return null;let t=(Br+2)*2,o=e*t+n.length*(Cr+2)*2+8,r=e*(Br+2)*6+n.length*Cr*6+24,i=new ArrayBuffer(o*Pt),a=new DataView(i),l=new Uint32Array(r),s=0,c=0,h=(d,p,b,m,g,y)=>{let A=s*Pt;return a.setFloat32(A,d,true),a.setFloat32(A+4,p,true),a.setFloat32(A+8,b,true),a.setFloat32(A+12,m,true),a.setFloat32(A+16,g,true),a.setFloat32(A+20,y,true),s++},u=(d,p,b,m)=>{l[c++]=d,l[c++]=p,l[c++]=m,l[c++]=d,l[c++]=m,l[c++]=b;},f=(d,p,b,m,g,y,A)=>{let B=h(d,p,0,0,0,A),x=h(d,p,b,m,1,A);for(let w=1;w<=Cr;w++){let _=Math.PI*w/Cr,C=b*Math.cos(_)+g*Math.sin(_),v=m*Math.cos(_)+y*Math.sin(_),E=h(d,p,C,v,1,A);l[c++]=B,l[c++]=x,l[c++]=E,x=E;}};for(let d of n){let p=ph(d),b=p.length/2;if(b<2)continue;let m=new Float64Array(b-1),g=new Float64Array(b-1);for(let w=0;w<b-1;w++){let _=p[w*2+2]-p[w*2],C=p[w*2+3]-p[w*2+1],v=Math.hypot(_,C)||1;m[w]=_/v,g[w]=C/v;}let y=0,A=-1,B=-1;for(let w=0;w<b;w++){let _=p[w*2],C=p[w*2+1];w>0&&(y+=Math.hypot(_-p[w*2-2],C-p[w*2-1]));let v=w>0?w-1:0,E=w<b-1?w:b-2,D=-g[v],F=m[v],H=-g[E],S=m[E],L=D+H,M=F+S,T=Math.hypot(L,M);T>1e-9?(L/=T,M/=T):(L=D,M=F);let P=L*H+M*S,k=P>1e-6?1/P:1/0,O=Math.acos(Math.min(1,Math.max(-1,m[v]*m[E]+g[v]*g[E])));if(!(O>dh*Math.PI/180)&&k<=hh){let G=h(_,C,L*k,M*k,1,y),R=h(_,C,-L*k,-M*k,-1,y);A>=0&&u(A,B,G,R),A=G,B=R;}else {let G=Math.max(1,Math.min(Br,Math.ceil(O/(Math.PI/Br)))),W=m[v]*g[E]-g[v]*m[E]>=0?1:-1,j=h(_,C,D,F,1,y),Z=h(_,C,-D,-F,-1,y);A>=0&&u(A,B,j,Z);for(let ee=1;ee<=G;ee++){let ge=W*O*(ee/G),te=Math.cos(ge),X=Math.sin(ge),re=D*te-F*X,le=D*X+F*te,q=h(_,C,re,le,1,y),U=h(_,C,-re,-le,-1,y);u(j,Z,q,U),j=q,Z=U;}A=j,B=Z;}}let x=b-2;f(p[0],p[1],-g[0],m[0],-m[0],-g[0],0),f(p[(b-1)*2],p[(b-1)*2+1],-g[x],m[x],m[x],g[x],y);}return c?{vertices:i.slice(0,s*Pt),indices:l.slice(0,c),vertexCount:s}:null}function Zn(n){if(!n.length||n[0].length<6)return null;let e=[],t=[];for(let i=0;i<n[0].length;i++)e.push(n[0][i]);for(let i=1;i<n.length;i++)if(!(n[i].length<6)){t.push(e.length/2);for(let a=0;a<n[i].length;a++)e.push(n[i][a]);}let o=Pe(e,t.length?t:void 0,2);if(!o.length)return null;let r=new Uint32Array(o.length);for(let i=0;i<o.length;i+=3)r[i]=o[i],r[i+1]=o[i+2],r[i+2]=o[i+1];return {vertices:new Float32Array(e).buffer,indices:r,vertexCount:e.length/2}}function ph(n){let e=[];for(let t=0;t<n.length;t+=2){let o=n[t],r=n[t+1],i=e.length;i>=2&&e[i-2]===o&&e[i-1]===r||e.push(o,r);}return e}var yo=5126,mh={stride:Yn,attribs:[{name:"a_pos",size:2,type:yo,offset:0}]},qn={stride:Pt,attribs:[{name:"a_pos",size:2,type:yo,offset:0},{name:"a_extrude",size:2,type:yo,offset:8},{name:"a_side",size:1,type:yo,offset:16},{name:"a_dist",size:1,type:yo,offset:20}]},Qn=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();}},bh=(n,e)=>[n[0],n[1],n[2],n[3]*e],Ao=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,i,a,l,s=false,c=false){if(!this.objects.length||c&&!this.objects.some(p=>p.ghostOpacity>0))return;this.objects.length>1&&this.objects.sort((p,b)=>p.zIndex-b.zIndex);let h=e.gl.drawingBufferWidth,u=t.width>0?h/t.width:1,f=t.worldSize*u,d=null;for(let p of this.objects){if(!p.visible)continue;let b=p.ghostOpacity;if(c&&b<=0)continue;let m=this.gpuFor(e,p,r,a);if(!m)continue;let g=s?t.shadowObjectMatrix(p.originX,p.originY,p.altitude):null,y=t.objectMatrix(p.originX,p.originY,p.altitude);for(let{part:A,vao:B,ibo:x}of m.parts){if(c&&(A.kind!=="line"||A.arrow))continue;let w=c?bh(A.color,b):A.color;if(A.kind==="fill")d!==o&&(o.use(),l?.(o),d=o),o.setVec4v("u_color",Me(w)),g&&o.setMat4("u_shadow_matrix",g),o.setMat4("u_matrix",y);else {d!==i&&(i.use(),l?.(i),d=i);let _=A.width/2*u,C=f>1e-9?1/f:1;if(i.setVec4v("u_color",Me(w)),i.setFloat("u_half_width",_),i.setFloat("u_offset",(A.offset??0)*u),i.setFloat("u_aa",1),i.setFloat("u_units_per_px",C),i.setFloat("u_units_to_px",f),i.setInt("u_pattern",c?0:A.dashArray?1:A.arrow?2:0),A.dashArray){let[v,E]=A.dashArray;i.setVec2("u_dash",v*u,(v+E)*u);}if(A.arrow){i.setVec4v("u_arrow_color",Me(A.arrowColor??[1,1,1,1]));let v=(A.arrowSize??5)*u;i.setVec3("u_arrow",(A.arrowPeriod??46)*u,Math.max(v*.4,1),Math.min(v,_*.72));}g&&i.setMat4("u_shadow_matrix",g),i.setMat4("u_matrix",y);}B.bind(),e.gl.drawElements(e.gl.TRIANGLES,x.count,x.type,0);}}e.bindVAO(null);}hitTest(e,t,o=4){let r=e.worldSize,i=(a,l,s)=>e.worldPxToPoint(ne(a)*r,ie(l)*r,s);for(let a=this.objects.length-1;a>=0;a--){let l=this.objects[a];if(l.visible&&l.hitTest(t,i,o))return l}return null}boundsOf(e){let t=1/0,o=1/0,r=-1/0,i=-1/0;for(let a of e.rings())for(let l of a){let s=$(l);s.lng<t&&(t=s.lng),s.lng>r&&(r=s.lng),s.lat<o&&(o=s.lat),s.lat>i&&(i=s.lat);}return isFinite(t)?{west:t,south:o,east:r,north:i}:null}gpuFor(e,t,o,r){let i=this.gpu.get(t.id);if(i&&i.revision===t.revision)return i;i?.destroy();let a=[];for(let s of t.build()){let c=s.kind==="fill"?mh:qn,h=s.kind==="fill"?o:r,u=new ve(e,new Uint8Array(s.mesh.vertices),c),f=new ye(e,s.mesh.indices),d=new pe(e,[{buffer:u,locations:h}],f);a.push({part:s,vao:d,vbo:u,ibo:f});}let l=new Qn(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 vr=32,Bh=1179937895,Ch=1313821514,vh=5130562,xh={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},wh={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT4:16};async function $n(n){let{json:e,bin:t}=gs(n),o=await Eh(e,t);return As(e,t,o)}function _h(n){let{json:e,bin:t}=gs(n);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 As(e,t,null)}function gs(n){let e=new DataView(n);if(e.getUint32(0,true)!==Bh)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<=n.byteLength;){let i=e.getUint32(r,true),a=e.getUint32(r+4,true),l=r+8;a===Ch?t=JSON.parse(new TextDecoder().decode(new Uint8Array(n,l,i))):a===vh&&(o=new Uint8Array(n,l,i)),r=l+i+(4-i%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 Eh(n,e){let t=n.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 Promise.resolve().then(()=>(bs(),ms));await r.ready;let i=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),h=new Uint8Array(l.count*l.byteStride);r.decodeGltfBuffer(h,l.count,l.byteStride,c,l.mode,l.filter??"NONE"),i.set(a,h);}return i}function ys(n){let e=K();if(n.matrix){for(let C=0;C<16;C++)e[C]=n.matrix[C];return e}Xe(e);let[t,o,r]=n.translation??[0,0,0],[i,a,l,s]=n.rotation??[0,0,0,1],[c,h,u]=n.scale??[1,1,1],f=i+i,d=a+a,p=l+l,b=i*f,m=i*d,g=i*p,y=a*d,A=a*p,B=l*p,x=s*f,w=s*d,_=s*p;return e[0]=(1-(y+B))*c,e[1]=(m+_)*c,e[2]=(g-w)*c,e[4]=(m-_)*h,e[5]=(1-(b+B))*h,e[6]=(A+x)*h,e[8]=(g+w)*u,e[9]=(A-x)*u,e[10]=(1-(b+y))*u,e[12]=t,e[13]=o,e[14]=r,e}var Mh={5120:127,5121:255,5122:32767,5123:65535};function Fh(n){let e=n[0],t=n[1],o=n[2],r=n[4],i=n[5],a=n[6],l=n[8],s=n[9],c=n[10],h=e*(i*c-a*s)-r*(t*c-o*s)+l*(t*a-o*i);if(Math.abs(h)<1e-20)return [1,0,0,0,1,0,0,0,1];let u=1/h;return [(i*c-a*s)*u,(a*l-r*c)*u,(r*s-i*l)*u,(o*s-t*c)*u,(e*c-o*l)*u,(t*l-e*s)*u,(t*a-o*i)*u,(o*r-e*a)*u,(e*i-t*r)*u]}function As(n,e,t){let o=C=>{let v=t?.get(C);if(v)return v;let E=n.bufferViews?.[C];if(!E)return null;let D=E.byteOffset??0;return e.subarray(D,D+E.byteLength)},r=[],i=[],a=[],l=[],s=[],c=[1/0,1/0,1/0],h=[-1/0,-1/0,-1/0],u=C=>{if(C===void 0)return null;let v=n.accessors?.[C];if(!v)return null;let E=wh[v.type]??1,D=new Float64Array(v.count*E),F=v.bufferView!==void 0?n.bufferViews?.[v.bufferView]:void 0;if(!F||v.bufferView===void 0)return {data:D,components:E};let H=o(v.bufferView);if(!H)return {data:D,components:E};let S=xh[v.componentType]??4,L=F.extensions?.EXT_meshopt_compression,M=L?L.byteStride:F.byteStride,T=M&&M>0?M:S*E,P=v.byteOffset??0,k=new DataView(H.buffer,H.byteOffset,H.byteLength),O=v.normalized?Mh[v.componentType]??1:1;for(let N=0;N<v.count;N++)for(let G=0;G<E;G++){let R=P+N*T+G*S,W;switch(v.componentType){case 5120:W=k.getInt8(R);break;case 5121:W=k.getUint8(R);break;case 5122:W=k.getInt16(R,true);break;case 5123:W=k.getUint16(R,true);break;case 5125:W=k.getUint32(R,true);break;default:W=k.getFloat32(R,true);}D[N*E+G]=O===1?W:Math.max(W/O,-1);}return {data:D,components:E}},f=(C,v,E=-1)=>{if(C.mode!==void 0&&C.mode!==4)return;let D=u(C.attributes.POSITION);if(!D)return;let F=u(C.attributes.NORMAL),H=u(C.attributes.TEXCOORD_0),S=u(C.indices),L=r.length/3,M=D.data.length/3,T=Fh(v),k=(C.material!==void 0?n.materials?.[C.material]:void 0)?.pbrMetallicRoughness?.baseColorTexture?.extensions?.KHR_texture_transform,O=k?{ox:k.offset?.[0]??0,oy:k.offset?.[1]??0,sx:k.scale?.[0]??1,sy:k.scale?.[1]??1,rot:k.rotation??0}:null;for(let X=0;X<M;X++){let re=D.data[X*3],le=D.data[X*3+1],q=D.data[X*3+2],U=v[0]*re+v[4]*le+v[8]*q+v[12],J=v[1]*re+v[5]*le+v[9]*q+v[13],fe=v[2]*re+v[6]*le+v[10]*q+v[14];if(r.push(U,J,fe),U<c[0]&&(c[0]=U),J<c[1]&&(c[1]=J),fe<c[2]&&(c[2]=fe),U>h[0]&&(h[0]=U),J>h[1]&&(h[1]=J),fe>h[2]&&(h[2]=fe),F){let ae=F.data[X*3],xe=F.data[X*3+1],Te=F.data[X*3+2],we=T[0]*ae+T[3]*xe+T[6]*Te,Ro=T[1]*ae+T[4]*xe+T[7]*Te,Go=T[2]*ae+T[5]*xe+T[8]*Te,Oo=Math.hypot(we,Ro,Go);Oo>1e-12?(we/=Oo,Ro/=Oo,Go/=Oo):(we=0,Ro=1,Go=0),i.push(we,Ro,Go);}else i.push(0,1,0);let se=H?H.data[X*2]:0,ue=H?H.data[X*2+1]:0;if(O){if(O.rot!==0){let ae=Math.cos(O.rot),xe=Math.sin(O.rot),Te=ae*se+xe*ue,we=-xe*se+ae*ue;se=Te,ue=we;}se=se*O.sx+O.ox,ue=ue*O.sy+O.oy;}a.push(se,ue);}let N=l.length;if(S)for(let X=0;X<S.data.length;X++)l.push(L+S.data[X]);else for(let X=0;X<M;X++)l.push(L+X);let G=C.material!==void 0?n.materials?.[C.material]:void 0,R=G?.pbrMetallicRoughness,W=R?.metallicFactor!==void 0||R?.roughnessFactor!==void 0,j=R?.baseColorFactor??[1,1,1,1],Z=R?.baseColorTexture?.index,ee=Z!==void 0?n.textures?.[Z]?.source:void 0,ge=G?.emissiveFactor??[0,0,0],te=G?.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:W?R?.metallicFactor??1:0,roughness:W?R?.roughnessFactor??1:1,emissive:[ge[0]*te,ge[1]*te,ge[2]*te],texture:ee??-1,doubleSided:G?.doubleSided===true,blend:G?.alphaMode==="BLEND",alphaCutoff:G?.alphaMode==="MASK"?G.alphaCutoff??.5:.02,node:E});},d=n.skins?.length?null:Dh(n,u),p=d?d.nodes:null,b=(C,v,E,D)=>{let F=n.nodes?.[C];if(!F)return;let H=ys(F),S=K();Ee(S,v,H);let L=K(),M=D,T=p?.get(C);if(T?(T.parentNode=D,T.parent=E.slice(),Xe(L),M=C):Ee(L,E,H),F.mesh!==void 0)for(let k of n.meshes?.[F.mesh]?.primitives??[])f(k,L,M);let P=F.extensions?.KHR_lights_punctual?.light;if(P!==void 0){let k=n.extensions?.KHR_lights_punctual?.lights?.[P],O=k?.type;if(k&&(O==="point"||O==="spot"||O==="directional")){let N=-S[8],G=-S[9],R=-S[10],W=Math.hypot(N,G,R)||1,j=k.spot?.innerConeAngle??0,Z=k.spot?.outerConeAngle??Math.PI/4;m.push({type:O,color:[k.color?.[0]??1,k.color?.[1]??1,k.color?.[2]??1],intensity:k.intensity??1,range:k.range??0,position:[S[12],S[13],S[14]],direction:[N/W,G/W,R/W],cosInner:Math.cos(j),cosOuter:Math.cos(Z)});}}for(let k of F.children??[])b(k,S,L,M);},m=[],g=K();Xe(g);let y=K();Xe(y);let A=n.scenes?.[n.scene??0]?.nodes??n.nodes?.map((C,v)=>v)??[];for(let C of A)b(C,g,y,-1);let B=[];for(let C of n.images??[]){if(C.bufferView===void 0){B.push(new Uint8Array(0));continue}let v=o(C.bufferView);B.push(v?v.slice():new Uint8Array(0));}let x=r.length/3,w=new ArrayBuffer(x*vr),_=new Float32Array(w);for(let C=0;C<x;C++){let v=C*8;_[v]=r[C*3],_[v+1]=r[C*3+1],_[v+2]=r[C*3+2],_[v+3]=i[C*3],_[v+4]=i[C*3+1],_[v+5]=i[C*3+2],_[v+6]=a[C*2],_[v+7]=a[C*2+1];}return isFinite(c[0])||(c[0]=c[1]=c[2]=0,h[0]=h[1]=h[2]=0),{vertices:w,indices:new Uint32Array(l),primitives:s,images:B,min:c,max:h,animation:d,lights:m}}function Dh(n,e){let t=n.animations?.[0];if(!t||!t.channels.length)return null;let o=new Map,r=0;for(let i of t.channels){let a=i.target.node,l=i.target.path;if(a===void 0||l!=="translation"&&l!=="rotation"&&l!=="scale")continue;let s=t.samplers[i.sampler];if(!s)continue;let c=e(s.input),h=e(s.output);if(!c||!h||!c.data.length)continue;let u=l==="rotation"?4:3,f=s.interpolation==="CUBICSPLINE",d=c.data.length,p=new Float32Array(d*u);for(let m=0;m<d;m++){let g=f?(m*3+1)*u:m*u;for(let y=0;y<u;y++)p[m*u+y]=h.data[g+y];}let b=o.get(a)??{parentNode:-1,parent:Xe(K()),base:Sh(n.nodes?.[a]),channels:[]};b.channels.push({path:l,times:Float32Array.from(c.data),values:p,step:s.interpolation==="STEP"}),o.set(a,b),r=Math.max(r,c.data[d-1]);}return o.size?{duration:r||1,nodes:o}:null}function Sh(n){let e=n?.translation,t=n?.rotation,o=n?.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 ei(n,e,t,o){let r=n.nodes.get(e);if(!r)return Xe(o);let i=K();Ih(r,t,i);let a=K();if(Ee(a,r.parent,i),r.parentNode<0)return Bs(o,a);let l=K();return ei(n,r.parentNode,t,l),Ee(o,l,a)}var Bs=(n,e)=>{for(let t=0;t<16;t++)n[t]=e[t];return n};function Ih(n,e,t){let o=[...n.base.t],r=[...n.base.r],i=[...n.base.s];for(let a of n.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 h=Math.min(c+1,l-1),u=a.times[h]-a.times[c],f=a.step||u<=0?0:Math.min(Math.max((e-a.times[c])/u,0),1),d=c*s,p=h*s;if(a.path==="rotation"){let b=0;for(let y=0;y<4;y++)b+=a.values[d+y]*a.values[p+y];let m=b<0?-1:1,g=0;for(let y=0;y<4;y++)r[y]=a.values[d+y]*(1-f)+a.values[p+y]*m*f,g+=r[y]*r[y];g=Math.sqrt(g)||1;for(let y=0;y<4;y++)r[y]/=g;}else {let b=a.path==="translation"?o:i;for(let m=0;m<3;m++)b[m]=a.values[d+m]*(1-f)+a.values[p+m]*f;}}return Bs(t,ys({translation:o,rotation:r,scale:i}))}var Le=5126,Lh=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),Cs={stride:vr,attribs:[{name:"a_pos",size:3,type:Le,offset:0},{name:"a_normal",size:3,type:Le,offset:12},{name:"a_tex",size:2,type:Le,offset:24}]},oi=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);}},ti=256,xr=41,vs={stride:xr*4,attribs:[{name:"a_i_m0",size:4,type:Le,offset:0,divisor:1},{name:"a_i_m1",size:4,type:Le,offset:16,divisor:1},{name:"a_i_m2",size:4,type:Le,offset:32,divisor:1},{name:"a_i_m3",size:4,type:Le,offset:48,divisor:1},{name:"a_i_s0",size:4,type:Le,offset:64,divisor:1},{name:"a_i_s1",size:4,type:Le,offset:80,divisor:1},{name:"a_i_s2",size:4,type:Le,offset:96,divisor:1},{name:"a_i_s3",size:4,type:Le,offset:112,divisor:1},{name:"a_i_n0",size:3,type:Le,offset:128,divisor:1},{name:"a_i_n1",size:3,type:Le,offset:140,divisor:1},{name:"a_i_n2",size:3,type:Le,offset:152,divisor:1}]},Bo=2,Rt=16,it=class{constructor(){this.models=[];this.gpu=new z;this.counted=new Set;this.instBuffer=null;this.instScratch=new Float32Array(ti*xr);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,i,a,l=0,s){if(this.models.length){this.drawnInstanced.clear(),s&&this.renderInstanced(e,t,s.shader,s.locations,i,a),o.use(),i(o),o.setInt("u_base_texture",Bo);for(let c of this.models){if(this.drawnInstanced.has(c)||!this.inView(t,c))continue;let h=c.visible&&c.fade>0?this.gpuFor(e,c,r):null;if(!h||!c.mesh)continue;let u=c.fade<1;o.setFloat("u_opacity",c.fade);let f=c.matrixFor(t);o.setMat4("u_matrix",f),o.setMat3("u_normal_matrix",c.normalMatrix());let d=a?this.shadowMatrix(t,c):null;this.uploadLights(o,c.mesh);let p=c.cameraInModelSpace(t);o.setVec3("u_camera_model",p[0],p[1],p[2]),o.setFloat("u_reflect",1),h.vao.bind();for(let b of [false,true])if(!(u&&!b))for(let m of c.mesh.primitives){if(!u&&m.blend!==b)continue;o.setMat4("u_matrix",m.node>=0?c.matrixForNode(t,m.node,l):f),d&&o.setMat4("u_shadow_matrix",m.node>=0?this.shadowMatrixForNodeAt(t,c,m.node,l):d);let g=m.texture>=0?h.textures[m.texture]:null;o.setFloat("u_has_texture",g?1:0),o.setFloat("u_alpha_cutoff",m.alphaCutoff),g&&e.bindTexture(Bo,g),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(b?"premultiplied":"none"),e.setDepthMask(!b),e.gl.drawElements(e.gl.TRIANGLES,m.indexCount,e.gl.UNSIGNED_INT,m.indexOffset*4);}}e.bindVAO(null),e.setCull("back"),e.setBlend("premultiplied"),e.setDepthMask(true);}}renderInstanced(e,t,o,r,i,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 h=l.get(c.url);h?h.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 h=this.gpuFor(e,c[0],r);if(!h||!c[0].mesh)continue;this.instBuffer||(this.instBuffer=new ve(e,this.instScratch,vs,true)),h.instVao||(h.instVao=new pe(e,[{buffer:h.vbo,locations:r},{buffer:this.instBuffer,locations:r}],h.ibo)),s||(o.use(),i(o),o.setInt("u_base_texture",Bo),o.setFloat("u_opacity",1),s=true);let u=c[0].mesh;for(let f=0;f<c.length;f+=ti){let d=Math.min(ti,c.length-f);for(let p=0;p<d;p++){let b=c[f+p],m=p*xr;this.instScratch.set(b.matrixFor(t),m);let g=a?this.shadowMatrix(t,b):Lh;this.instScratch.set(g,m+16),this.instScratch.set(b.normalMatrix(),m+32),this.drawnInstanced.add(b);}this.instBuffer.update(this.instScratch.subarray(0,d*xr)),e.bindVAO(h.instVao.vao);for(let p of u.primitives){let b=p.texture>=0?h.textures[p.texture]:null;o.setFloat("u_has_texture",b?1:0),o.setFloat("u_alpha_cutoff",p.alphaCutoff),b&&e.bindTexture(Bo,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("none"),e.setDepthMask(true),e.gl.drawElementsInstanced(e.gl.TRIANGLES,p.indexCount,e.gl.UNSIGNED_INT,p.indexOffset*4,d);}}}s&&e.bindVAO(null);}uploadLights(e,t){let o=this.lightPacks.get(t);if(!o){let r=t.lights.filter(h=>h.type!=="directional"),i=r.length<=Rt?r:[...r].sort((h,u)=>u.intensity-h.intensity).slice(0,Rt),a=new Float32Array(Rt*4),l=new Float32Array(Rt*4),s=new Float32Array(Rt*4),c=new Float32Array(Rt*4);i.forEach((h,u)=>{let f=u*4;a[f]=h.position[0],a[f+1]=h.position[1],a[f+2]=h.position[2],a[f+3]=h.range,l[f]=h.color[0]*h.intensity,l[f+1]=h.color[1]*h.intensity,l[f+2]=h.color[2]*h.intensity,l[f+3]=h.type==="spot"?1:0,s[f]=h.direction[0],s[f+1]=h.direction[1],s[f+2]=h.direction[2],c[f]=h.cosInner,c[f+1]=h.cosOuter;}),o={count:i.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(),i=t.boundingRadiusM();return e.isSphereVisible(r.x,r.y,t.altitude+i*.5,i)}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 i of this.models){let a=i.visible&&i.fade>.5?this.gpuFor(e,i,r):null;if(!a||!i.mesh)continue;let l=this.shadowMatrix(t,i);o.setMat4("u_matrix",l),a.vao.bind();for(let s of i.mesh.primitives)s.blend||(o.setMat4("u_matrix",s.node>=0?this.shadowMatrixForNode(t,i,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,i){let a=t.origin();return t.matrixInSpaceForNode(e.shadowObjectMatrix(a.x,a.y,t.altitude),o,r,i)}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 i=e.gl,a=new ve(e,new Uint8Array(t.mesh.vertices),Cs),l=new ye(e,t.mesh.indices),s=new pe(e,[{buffer:a,locations:o}],l),c=t.bitmaps.map(u=>{if(!u)return null;let f=i.createTexture();return f?(e.bindTexture(Bo,f),i.texImage2D(i.TEXTURE_2D,0,i.RGBA,i.RGBA,i.UNSIGNED_BYTE,u),i.generateMipmap(i.TEXTURE_2D),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,i.LINEAR_MIPMAP_LINEAR),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MAG_FILTER,i.LINEAR),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_S,i.REPEAT),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_T,i.REPEAT),f):null}),h=new oi(s,a,l,c);return h.users=1,this.counted.add(t),this.gpu.set(t.url,h),h}static get layout(){return Cs}static get instanceLayout(){return vs}destroy(e){for(let t of this.gpu.values())t.destroy(e);this.gpu.clear(),this.models=[];}};var ri=4,xs=new oe;function Th(n){xs.has(n)||(xs.add(n),console.warn(`[osmgl] ${n}`));}var Hh=.5,kh=.01,Ph=300,ni=127,ii=128,Co=5120,_r=5121,vo=5122,ws=5123,xo=5126,Rh={stride:8,attribs:[{name:"a_pos",size:2,type:xo,offset:0}]},ai={stride:et,attribs:[{name:"a_pos",size:2,type:vo,offset:0}]},_s={stride:rt,attribs:[{name:"a_p0",size:2,type:vo,offset:0},{name:"a_p1",size:2,type:vo,offset:4},{name:"a_corner",size:2,type:Co,offset:8},{name:"a_ground",size:2,type:Co,offset:10},{name:"a_dist",size:1,type:xo,offset:12},{name:"a_width",size:1,type:xo,offset:16}]},wr={stride:Ie,attribs:[{name:"a_pos",size:2,type:vo,offset:0},{name:"a_height",size:1,type:ws,offset:4},{name:"a_tint",size:1,type:_r,normalized:true,offset:6},{name:"a_ao",size:1,type:_r,normalized:true,offset:7},{name:"a_normal",size:3,type:Co,normalized:true,offset:8},{name:"a_kind",size:1,type:_r,offset:11},{name:"a_wall",size:3,type:ws,offset:12}]},Gh={flat:0,water:1,foliage:2,sand:3,asphalt:4},Oh=[1,9,14,26,3],Es={stride:St,attribs:[{name:"a_pos",size:2,type:xo,offset:0},{name:"a_level",size:1,type:vo,offset:8},{name:"a_normal",size:3,type:Co,normalized:true,offset:10},{name:"a_kind",size:1,type:_r,offset:13},{name:"a_bleed",size:2,type:Co,offset:14}]},li=class{constructor(e,t,o,r,i,a,l=r){this.vao=e;this.buffer=t;this.ibo=o;this.indexCount=r;this.indexType=i;this.extent=a;this.capIndexOffset=l;this.firstDrawTime=0;}destroy(){this.vao.destroy(),this.buffer.destroy(),this.ibo.destroy();}},Ms={enabled:false,resolution:1024,strength:.75,color:"#5a6b86",bias:.25},wo=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 yr;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={...Ms};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.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 mo;this.highlightTris=new z;this.fillHighlightGpu=new z;this.fillHighlightKey="";this.footprintKey="";this.highlightFill=null;this.indoorMask=new bo;this.hiddenBuildings=new Set;this.hiddenVenues=new Set;this.hiddenVenueLayer=null;this.hiddenCut=new z;this.hiddenStamp="";this.shadowDepthPerMeter=1;this.shadowTexelMeters=0;this.growDurationMs=350;this.symbols=null;this.objects=null;this.models=new it;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=o=>[...o].sort((r,i)=>r-i).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,i,a){if(!a||!a.size)return null;let l=r+"|"+o,s=this.hiddenCut.get(l);if(s!==void 0&&(s===null||s.vbo===i))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 h=new Uint32Array(c.indices),u=new Float64Array(c.featureIds),f=[];for(let p=0;p*3<h.length;p++)a.has(u[p])||f.push(h[p*3],h[p*3+1],h[p*3+2]);let d=null;if(f.length<h.length){let p=new ye(e,new Uint32Array(f));d={vao:new pe(e,[{buffer:i,locations:this.buildingLocs}],p),ibo:p,count:f.length,vbo:i};}return this.hiddenCut.set(l,d),d}init(e){this.symbols?.init(e),this.fill=new Ae(e,"fill",Xl,jl),this.surface=new Ae(e,"surface",ts,os),this.line=new Ae(e,"line",Yl,Zl),this.objectLine=new Ae(e,"objectLine",Ql,ql),this.building=new Ae(e,"buildings",$l,es),this.depth=new Ae(e,"depth",Pl,On),this.groundShadow=new Ae(e,"groundShadow",Ul,Jl),this.sky=new Ae(e,"sky",Vl,Wl),this.raster=new Ae(e,"raster",Nl,Kl),this.globeBody=new Ae(e,"globeBody",Ll,Tl),this.globeClip=new Ae(e,"globeClip",Hl,kl),this.globeMesh=zh(e,this.globeBody),this.model=new Ae(e,"model",Gl,zn),this.modelInstanced=new Ae(e,"model-instanced",Ol,zn),this.modelDepth=new Ae(e,"modelDepth",zl,On);for(let i of it.layout.attribs)this.modelLocs.set(i.name,this.model.attribLocation(i.name));for(let i of [...it.layout.attribs,...it.instanceLayout.attribs])this.modelInstLocs.set(i.name,this.modelInstanced.attribLocation(i.name));this.shadowPlaceholder=Sl(e);let t=new z([["a_pos",this.groundShadow.attribLocation("a_pos")]]),o=new ve(e,new Float32Array([0,0,1,0,1,1,0,1]),Rh),r=new ye(e,new Uint16Array([0,1,2,0,2,3]));this.quad={vao:new pe(e,[{buffer:o,locations:t}],r),vbo:o,ibo:r};for(let i of ai.attribs)this.fillLocs.set(i.name,this.fill.attribLocation(i.name));for(let i of Es.attribs)this.surfaceLocs.set(i.name,this.surface.attribLocation(i.name));for(let i of _s.attribs)this.lineLocs.set(i.name,this.line.attribLocation(i.name));for(let i of qn.attribs)this.objectLineLocs.set(i.name,this.objectLine.attribLocation(i.name));for(let i of wr.attribs)this.buildingLocs.set(i.name,this.building.attribLocation(i.name));}render(e,t,o,r,i,a=new z){if(!this.fill||!this.line||!this.building)return false;let l=t.zoom,s=false;this.materialTime=i/1e3,this.materialAnimating=false,this.fog=kt(t,r),this.patternScale=No/Math.max(Oe(t.center.lat),1),this.dpr=t.width>0?e.gl.drawingBufferWidth/t.width:1;let c=Math.max(t.pixelsPerMeter,1e-9),h=t.cameraPositionPx;this.cameraMeters=[h[0]/c,h[1]/c,h[2]/c];let u=m=>o.get(m.source??Y);this.syncHighlightFootprint(o,r),this.indoorMask.sync(o,r,l),this.syncHiddenStamp(),this.models.advanceTransitions(),this.renderShadowMap(e,t,o,r,i),this.drawSky(e,t,r),this.drawGlobeBody(e,t,r),this.raster&&this.quad&&this.rasterLayer.render(e,t,this.quad.vao,this.raster,r,a,l),this.drawTileStencil(e,t,o),e.setDepthTest(t.globeActive),e.setDepthFunc("lequal"),e.setDepthMask(false),e.setBlend("premultiplied"),e.setCull("none");let f=m=>m.type==="line"&&V(m.paint.elevation,l,0)!==0,d=new Set;for(let m of r.layers){if(m.type==="raster"||m.type==="fill-extrusion"||m.type==="symbol"||m.overlay||f(m)||!r.layerVisibleAt(m,l))continue;let g=u(m);if(g){if(m.type==="line"&&m.network){if(d.has(m.network))continue;d.add(m.network),this.drawNetwork(e,t,r,u,m.network,l,y=>!y.overlay&&!f(y)&&r.layerVisibleAt(y,l));continue}if(m.type==="surface"){if(!this.flattened(g,r,m))continue;this.drawFill(e,t,g,r,m,l);continue}m.type==="fill"?this.drawFill(e,t,g,r,m,l):this.drawLine(e,t,g,r,m,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,m=>{this.applyFogUniforms(m,t,r),m.setVec4("u_globe",0,0,0,0),m.setInt("u_material",0),m.setFloat("u_elevation",0),m.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 m of r.layers){if(m.type!=="surface"||m.overlay||!r.layerVisibleAt(m,l))continue;let g=u(m);g&&(this.flattened(g,r,m)||this.drawSurface(e,t,g,r,m,l));}e.setStencilTest(false),e.setDepthMask(false),e.setBlend("premultiplied"),e.setCull("none"),e.setDepthTest(false);let p=new Set;for(let m of r.layers){if(m.type==="raster"||!f(m)||m.overlay||!r.layerVisibleAt(m,l))continue;let g=u(m);if(g){if(m.type==="line"&&m.network){if(p.has(m.network))continue;p.add(m.network),this.drawNetwork(e,t,r,u,m.network,l,y=>!y.overlay&&f(y)&&r.layerVisibleAt(y,l));continue}this.drawLine(e,t,g,r,m,l);}}this.drawOverlay(e,t,r,u,l,"roads"),e.setDepthTest(true),e.setDepthMask(true),e.setCull("back");for(let m of r.layers){if(m.type!=="fill-extrusion"||!r.layerVisibleAt(m,l))continue;let g=u(m);g&&(this.drawBuildings(e,t,g,r,m,l,i)&&(s=true),this.drawHighlight(e,t,g,r,m,l));}this.model&&!this.models.isEmpty&&(this.models.render(e,t,this.model,this.modelLocs,m=>{this.applyShadowUniforms(m),this.applyFogUniforms(m,t,r),this.applyLight(m,r);},this.shadowActive,i/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,m=>{this.applyFogUniforms(m,t,r),m.setVec4("u_globe",0,0,0,0),m.setInt("u_material",0),m.setFloat("u_elevation",0),m.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 b=r.layers.filter(m=>m.type==="line"&&V(m.paint.ghostOpacity,l,0)>.001&&r.layerVisibleAt(m,l));if(b.length){e.setDepthTest(true),e.setDepthFunc("greater"),e.setDepthMask(false),e.setBlend("premultiplied"),e.setCull("none");for(let m of b){let g=u(m);g&&this.drawLine(e,t,g,r,m,l,V(m.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,m=>{this.applyFogUniforms(m,t,r),m.setVec4("u_globe",0,0,0,0),m.setInt("u_material",0),m.setFloat("u_elevation",0),m.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,i){if(this.shadowPlaceholder&&e.bindTexture(ri,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 ho(e,this.shadows.resolution);let l=r.light;if(t.updateShadow(Gt(l.keyAzimuth,l.keyAltitude),Ph),!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 h=this.depth;h.use();for(let u of a){let f=o.get(u.source??Y);if(!f)continue;let d=r.bucketKeyFor(u);if(d===null)continue;let p=V(u.paint.heightScale,t.zoom,1);(u.source??Y)===Y&&this.indoorMask.prepare(f,d);for(let b of f.visibleTiles){if(!this.drawsTile(t,r,u,b))continue;let m=f.getTile(b),g=m&&this.bucketFor(e,m,d,wr,this.buildingLocs,"fill-extrusion");if(!g)continue;h.setFloat("u_height_scale",this.growScale(g,i,!f.warm)*p),h.setMat4("u_matrix",t.shadowTileMatrix(b,g.extent));let y=(u.source??Y)===Y,A=this.cutHidden(e,m,d,b.dataKey,g.buffer,this.hiddenFor(d,y)),B=y?A??this.indoorMask.indicesFor(e,m,d,b,g.buffer,this.buildingLocs):A;B?(B.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,B.count,e.gl.UNSIGNED_INT,0)):(g.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,g.indexCount,g.indexType,0));}}this.modelDepth&&(this.models.depthTimeSec=i/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(ri),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 i=o.background;r.setVec3("u_body_color",i[0],i[1],i[2]),Ve(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],i=[0,0,0,0];if(de(i,t.localProjMatrix,r),i[3]<=1e-6)return;let a=this.globeClip;a.use(),a.setFloat("u_center_depth",i[2]/i[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(Ge(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(),Ve(r,"u_sky_color",o.sky.skyColor),Ve(r,"u_horizon_color",o.sky.horizonColor),Vh(r,o.sky);let[i,a]=this.skyBand(t,o),l=Math.min(a*.5,t.height*this.dpr*.1);r.setVec3("u_sky_params",i,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=Gt(o.light.keyAzimuth,o.light.keyAltitude);r.setVec3("u_sun_dir",-c[0],-c[1],-c[2]),Ve(r,"u_sun_color",o.light.keyColor),r.setFloat("u_sun_glow",o.light.keyIntensity);let h=t.globeActive?1-t.globeFlatMix:0;if(r.setVec2("u_space",h,o.sky.starIntensity),h>.001){Ve(r,"u_space_color",o.sky.spaceColor),Ve(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[f,d,p,b]=t.localRayCorners();r.setVec3("u_ray_tl",f[0],f[1],f[2]),r.setVec3("u_ray_tr",d[0],d[1],d[2]),r.setVec3("u_ray_bl",p[0],p[1],p[2]),r.setVec3("u_ray_br",b[0],b[1],b[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,i=t.worldSize;e.setVec4("u_globe",1,t.globeFlatMix,t.globeRadiusPx,i),e.setVec2("u_globe_center",t.centerPointPx.x/i,t.centerPointPx.y/i);let a=t.globeCamera();e.setVec4("u_globe_cam",a.dir[0],a.dir[1],a.dir[2],a.horizonCos);let l=Gt(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 i=o.bounds();e.setVec3("u_tile_merc",i.minX,i.minY,(i.maxX-i.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??kt(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}Ve(e,"u_fog_color",o.sky.horizonColor),e.setVec3("u_fog_range",r.near,r.far,r.intensity);let[i,a]=o.sky.fogVerticalRange;e.setVec2("u_fog_vertical",i,a),this.applyAtmosphere(e,t,o);}drawsTile(e,t,o,r){let i=this.fog;if(!i)return true;let a=e.distanceToTile(r);return a>i.cutoff?false:t.layerVisibleAt(o,e.detailZoom(a))}earthDepthLevel(e,t){let o=0;for(let i of e.layers)i.type==="surface"?o=Math.min(o,(i.elevation-(i.bevelDrop??0))*this.reliefScale):i.type==="line"&&(o=Math.min(o,V(i.paint.elevation,t.zoom,0)*this.reliefScale));let r=Math.max(Hh/Math.max(t.pixelsPerMeter,1e-9),kh);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,ni);}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 i=r.visibleTiles;if(!i.length||i.length>ni)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 i)s++,this.stencilIds.set(c.dataKey,s),a.stencilFunc(a.ALWAYS,s,ni),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 i=o.get(Y);if(!i)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 i.visibleTiles){let h=t.tileMatrix(c,1);s.set(h);for(let u=0;u<4;u++)s[12+u]+=l*h[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 i=o.get(Y);if(!i)return;let a=this.groundShadow;a.use(),this.applyShadowUniforms(a),this.applyFogUniforms(a,t,r);let l=r.light,[,,s]=Gt(l.keyAzimuth,l.keyAltitude),c=Math.max(-s,0),h=he(l.ambientColor),u=he(l.keyColor),f=[0,0,0];for(let d=0;d<3;d++){let p=h[d]*l.ambientIntensity,b=u[d]*l.keyIntensity*c;f[d]=p>0?p/(p+b):1;}a.setVec3("u_shadow_ground",f[0],f[1],f[2]),a.setFloat("u_ground_ndotl",c),e.setBlend("multiply"),e.setDepthTest(false),e.setDepthMask(false),e.setCull("none"),this.quad.vao.bind();for(let d of i.visibleTiles)a.setMat4("u_shadow_matrix",t.shadowTileMatrix(d,1)),a.setMat4("u_matrix",t.tileMatrix(d,1)),e.gl.drawElements(e.gl.TRIANGLES,6,e.gl.UNSIGNED_SHORT,0);e.setBlend("premultiplied");}applyShadowUniforms(e){if(e.setInt("u_shadow_map",ri),!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 i=he(this.shadows.color);e.setVec3("u_shadow_color",i[0],i[1],i[2]);}get shadowsActive(){return this.shadowActive}drawOverlay(e,t,o,r,i,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,i))continue;let c=r(s);if(c){if(s.type==="surface"){this.flattened(c,o,s)?this.drawFill(e,t,c,o,s,i):this.drawSurface(e,t,c,o,s,i),l();continue}s.type==="fill"?this.drawFill(e,t,c,o,s,i):this.drawLine(e,t,c,o,s,i);}}}applyTileScale(e,t,o){let r=zr(t.z)/this.patternScale;e.setFloat("u_meters_per_unit",r/o);let[i,a]=Wi(t.z,t.x,t.y);e.setVec2("u_world_origin",i/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,i=this.detailScale<=0?0:Gh[r??"flat"]??0;if(e.setInt("u_material",i),i===0)return;let a=t.paint,l=V(a.materialStrength,o,1)*this.detailScale,s=V(a.materialScale,o,Oh[i]),c=V(a.materialSpeed,o,i===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,i,a){let l=this.fill,s=r.colorAt(i,a),c=V(i.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,i,a),l.setVec4v("u_color",Me([s[0],s[1],s[2],s[3]*c]));let h=r.bucketKeyFor(i);if(h!==null){for(let u of o.visibleTiles){if(!this.drawsTile(t,r,i,u))continue;let f=o.getTile(u),d=f&&this.bucketFor(e,f,h,ai,this.fillLocs,"fill");d&&(this.clipToTile(e,u),this.shadowActive&&l.setMat4("u_shadow_matrix",t.shadowTileMatrix(u,d.extent)),this.applyTileScale(l,u,d.extent),this.applyTileMatrix(l,t,u,d.extent),d.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,d.indexCount,d.indexType,0));}e.setStencilTest(false);}}drawLine(e,t,o,r,i,a,l=0,s){let c=this.line,h=r.colorAt(i,a),u=V(i.paint.opacity,a,1)*(l||1),f=V(i.paint.width,a,1);if(u<=.001||f<=.01)return;let d=e.gl.drawingBufferWidth,p=e.gl.drawingBufferHeight,b=t.width>0?d/t.width:1,m=f/2*b;c.use(),this.applyFogUniforms(c,t,r),this.applyGlobeUniforms(c,t,r),this.applyLight(c,r),this.applyMaterial(c,i,a),c.setVec4v("u_color",Me([h[0],h[1],h[2],h[3]*u])),c.setFloat("u_center_w",t.cameraToCenterDistance);let g=V(i.paint.offset,a,0)*b,y=Math.max(V(i.paint.blur,a,0),0)*b;c.setFloat("u_elevation",V(i.paint.elevation,a,0)*this.reliefScale),c.setFloat("u_relief",this.reliefScale),c.setVec2("u_viewport",d,p);let A=i.paint.dashArray,B=i.paint.arrow===true,x=i.paint.arrowStyle,w=B&&(x==="head"||x==="headOnly"),_=B&&x==="dash";if(c.setInt("u_pattern",_?5:A?1:x==="headOnly"&&B?4:w?3:B?2:0),A){let[v,E]=A;c.setVec2("u_dash",v*b,(v+E)*b);}if(B){let v=He(i.paint.arrowColor,a,[1,1,1,1]);c.setVec4v("u_arrow_color",Me(v));let E=V(i.paint.arrowPeriod,a,46)*b,D=V(i.paint.arrowSize,a,5)*b;if(_){let F=V(i.paint.arrowGap,a,24)*b,H=Math.max(E-F,1),S=Math.min(D,H),L=V(i.paint.arrowShaft,a,2)*b,M=V(i.paint.arrowHead,a,4)*b,T=V(i.paint.arrowOutline,a,0)*b;c.setVec4("u_arrow",L,S,M,H),c.setVec2("u_dash",T,E);}else w?c.setVec4("u_arrow",E,D,m,0):c.setVec4("u_arrow",E,Math.max(D*.4,1),Math.min(D,m*.72),0);}let C=r.bucketKeyFor(i);if(C!==null)for(let v of o.visibleTiles){if(!this.drawsTile(t,r,i,v))continue;let E=o.getTile(v);if(!E)continue;let D=i.network?s!==void 0?[Je(i.id,s)]:(E.data?.levels??[]).map(F=>Je(i.id,F)):[C];for(let F of D){let H=this.bucketFor(e,E,F,_s,this.lineLocs,"line");if(!H)continue;let S=v.bounds(),L=(S.maxX-S.minX)*t.worldSize/H.extent*b;c.setFloat("u_tile_to_px",L);let M=L>1e-6?1/L:1;c.setFloat("u_half_width",m*M),c.setFloat("u_blur",y*M),c.setFloat("u_meters_to_units",t.pixelsPerMeter*M),c.setFloat("u_width_from_data",i.paint.widthFromData===true?1:0),c.setFloat("u_width_extra",V(i.paint.widthExtra,a,0)*M),c.setFloat("u_offset",g*M),c.setFloat("u_tile_per_px",M),this.applyTileScale(c,v,H.extent),this.shadowActive&&c.setMat4("u_shadow_matrix",t.shadowTileMatrix(v,H.extent)),this.applyTileMatrix(c,t,v,H.extent),H.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,H.indexCount,H.indexType,0);}}}drawNetwork(e,t,o,r,i,a,l){let s=o.layers.filter(h=>h.type==="line"&&h.network===i&&l(h));if(!s.length)return;let c=new Set;for(let h of s){let u=r(h);if(u)for(let f of u.visibleTiles){let d=u.getTile(f);for(let p of d?.data?.levels??[])c.add(p);}}if(c.size)for(let h of [...c].sort((u,f)=>u-f))for(let u of s){let f=r(u);f&&this.drawLine(e,t,f,o,u,a,0,h);}}drawHighlight(e,t,o,r,i,a){let l=this.highlight;if(!l||!this.building||l.layerId!==i.id)return;let s=`${i.id}/${l.featureId}`;this.highlightKey!==s&&(this.disposeHighlight(),this.highlightKey=s);let c=he(l.color)??[.31,.79,.5,1],h=this.building;h.use(),this.applyShadowUniforms(h),this.applyFogUniforms(h,t,r),this.applyLight(h,r),h.setVec4v("u_wall_color",[c[0],c[1],c[2],1]),h.setVec4v("u_roof_color",[c[0],c[1],c[2],1]),h.setFloat("u_opacity",l.opacity),h.setFloat("u_ao_strength",V(i.paint.aoStrength,a,.4)),h.setFloat("u_tint_variation",0),h.setFloat("u_facade_detail",0),h.setFloat("u_window_glow",0),h.setFloat("u_roof_variation",0),h.setFloat("u_height_scale",V(i.paint.heightScale,a,1)),e.setDepthFunc("lequal"),e.setDepthMask(false),e.setBlend("alpha");for(let u of o.visibleTiles){let f=o.getTile(u);if(!f)continue;let d=f.data?.buckets?.[i.id];if(!d)continue;let p=u.dataKey,b=this.highlightGpu.get(p);if(b===void 0){let m=Ar(f,i.id,l.featureId);if(m){let g=new ve(e,new Uint8Array(m.vertices),wr),y=new ye(e,m.indices);b={vao:new pe(e,[{buffer:g,locations:this.buildingLocs}],y),vbo:g,ibo:y,count:m.indices.length};}else b=null;this.highlightGpu.set(p,b);}b&&(this.applyTileScale(h,u,d.extent),this.shadowActive&&h.setMat4("u_shadow_matrix",t.shadowTileMatrix(u,d.extent)),h.setMat4("u_matrix",t.tileMatrix(u,d.extent)),b.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,b.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 i=t.layers.find(s=>s.id===o.layerId),a=e.get(i?.source??Y);if(!a)return;let l=new oe;for(let s of a.visibleTiles){if(l.add(s.dataKey),this.highlightTris.has(s.dataKey))continue;let c=a.getTile(s),h=c?.data?.buckets?.[o.layerId];if(!c||!h)continue;let u=Ar(c,o.layerId,o.featureId);u&&this.highlightTris.set(s.dataKey,Nn(u,h.extent,s));}for(let s of [...this.highlightTris.keys()])l.has(s)||this.highlightTris.delete(s);}drawFillHighlight(e,t,o,r){let i=this.highlightFill,a=this.fill;if(!i||!a)return;let l=r.layers.find(f=>f.id===i.layerId),s=l?o.get(l.source??Y):void 0;if(!l||!s)return;let c=i.bucketKey,h=he(i.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",Me([h[0],h[1],h[2],i.opacity])),e.setDepthTest(false),e.setDepthMask(false),e.setBlend("premultiplied"),e.setCull("none");let u=e.gl;e.setStencilTest(true),u.stencilFunc(u.NOTEQUAL,ii,ii),u.stencilOp(u.KEEP,u.KEEP,u.REPLACE),u.stencilMask(ii);for(let f of s.visibleTiles){let d=s.getTile(f),p=d?.data?.buckets?.[c];if(!d||!p||p.kind!=="fill"||!p.featureIds)continue;let b=this.fillHighlightFor(e,p,f,i.featureId,c);b&&(a.setMat4("u_matrix",t.tileMatrix(f,p.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.bindVAO(null);}fillHighlightFor(e,t,o,r,i){let a=`${i}/${r}/${o.dataKey}`;this.fillHighlightKey!==`${i}/${r}`&&(this.fillHighlightGpu.forEach(f=>{f?.vao.destroy(),f?.ibo.destroy(),f?.vbo.destroy();}),this.fillHighlightGpu.clear(),this.fillHighlightKey=`${i}/${r}`);let l=this.fillHighlightGpu.get(a);if(l!==void 0)return l;let s=new Uint32Array(t.indices),c=new Float64Array(t.featureIds),h=[];for(let f=0;f*3<s.length;f++)c[f]===r&&h.push(s[f*3],s[f*3+1],s[f*3+2]);let u=null;if(h.length){let f=new ve(e,new Uint8Array(t.vertices),ai),d=new ye(e,new Uint32Array(h));u={vao:new pe(e,[{buffer:f,locations:this.fillLocs}],d),vbo:f,ibo:d,count:h.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,i,a){let l=this.surface,s=r.colorAt(i,a,[.7,.8,.7,1]),c=V(i.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,i,a),l.setVec4v("u_color",s),l.setFloat("u_opacity",c),l.setFloat("u_side_shade",V(i.paint.sideShade,a,.12));let h=i.elevation<(i.base??0),u=i.paint.sideColor?He(i.paint.sideColor,a,s):s;l.setVec3("u_side_color",u[0],u[1],u[2]),l.setFloat("u_side_light",V(i.paint.sideLight,a,h?1:0)),l.setFloat("u_relief",this.reliefScale);let f=r.bucketKeyFor(i);if(f===null)return;let d=c>=1&&!i.overlay;e.setDepthMask(d),e.setBlend(d?"none":"premultiplied"),e.setCull("none");let p=[];for(let g of o.visibleTiles){if(!this.drawsTile(t,r,i,g))continue;let y=o.getTile(g),A=y&&this.bucketFor(e,y,f,Es,this.surfaceLocs,"surface");A&&p.push({id:g,bucket:A});}let b=(g,y)=>{this.clipToTile(e,g),this.applyTileScale(l,g,y.extent),this.shadowActive&&l.setMat4("u_shadow_matrix",t.shadowTileMatrix(g,y.extent)),this.applyTileMatrix(l,t,g,y.extent),y.vao.bind();},m=p.filter(({bucket:g})=>g.capIndexOffset<g.indexCount);if(m.length){e.setColorMask(false),e.setDepthMask(true);for(let{id:g,bucket:y}of m){b(g,y);let A=y.indexType===e.gl.UNSIGNED_INT?4:2;e.gl.drawElements(e.gl.TRIANGLES,y.indexCount-y.capIndexOffset,y.indexType,y.capIndexOffset*A);}e.setColorMask(true),e.setDepthMask(d);}for(let{id:g,bucket:y}of p)b(g,y),e.gl.drawElements(e.gl.TRIANGLES,y.capIndexOffset,y.indexType,0);e.setCull("back"),e.setDepthMask(true),e.setBlend("none");}drawBuildings(e,t,o,r,i,a,l){let s=this.building,c=r.colorAt(i,a,[.86,.84,.8,1]),h=i.paint.roofColor?r.colorAt({...i,paint:{...i.paint,color:i.paint.roofColor}},a,c):c,u=V(i.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",h),s.setFloat("u_opacity",u),s.setFloat("u_ao_strength",V(i.paint.aoStrength,a,.4)),s.setFloat("u_tint_variation",V(i.paint.tintVariation,a,.07));let f=(B,x)=>i.paint[B]?r.colorAt({...i,paint:{...i.paint,color:i.paint[B]}},a,x):x,d=f("windowColor",[.62,.71,.8,1]),p=f("windowFrameColor",[c[0]*1.1,c[1]*1.1,c[2]*1.1,1]);s.setVec3("u_window_color",d[0],d[1],d[2]),s.setVec3("u_window_frame",p[0],p[1],p[2]),s.setFloat("u_facade_detail",V(i.paint.facadeDetail,a,1)*this.detailScale),s.setFloat("u_window_glow",V(i.paint.windowGlow,a,0)),s.setFloat("u_floor_height",V(i.paint.floorHeight,a,3.2)),s.setFloat("u_window_recess",V(i.paint.windowRecess,a,.18)),s.setFloat("u_window_recess_shade",V(i.paint.windowRecessShade,a,.16)),s.setFloat("u_plinth_height",V(i.paint.plinthHeight,a,4)),s.setFloat("u_plinth_shade",V(i.paint.plinthShade,a,.14)),s.setFloat("u_roof_variation",V(i.paint.roofVariation,a,.3)),this.applyLight(s,r);let b=u>=1;e.setDepthMask(b),e.setBlend(b?"none":"premultiplied");let m=V(i.paint.heightScale,a,1),g=false,y=r.bucketKeyFor(i);if(y===null)return g;let A=(i.source??Y)===Y;A&&this.indoorMask.prepare(o,y);for(let B of o.visibleTiles){if(!this.drawsTile(t,r,i,B))continue;let x=o.getTile(B),w=x&&this.bucketFor(e,x,y,wr,this.buildingLocs,"fill-extrusion");if(!w)continue;let _=this.growScale(w,l,!o.warm);_<1&&(g=true),s.setFloat("u_height_scale",_*m),this.applyTileScale(s,B,w.extent),this.shadowActive&&s.setMat4("u_shadow_matrix",t.shadowTileMatrix(B,w.extent)),s.setMat4("u_matrix",t.tileMatrix(B,w.extent));let v=this.cutHidden(e,x,y,B.dataKey,w.buffer,this.hiddenFor(y,A))??(x&&A?this.indoorMask.indicesFor(e,x,y,B,w.buffer,this.buildingLocs):null);v?(v.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,v.count,e.gl.UNSIGNED_INT,0)):(w.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,w.indexCount,w.indexType,0));}return g}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?Wh(Math.max(r,0)):1}applyLight(e,t){let o=t.light;Ve(e,"u_ambient_color",o.ambientColor),e.setFloat("u_ambient_intensity",o.ambientIntensity);let[r,i,a]=Gt(o.keyAzimuth,o.keyAltitude);e.setVec3("u_key_dir",r,i,a),Ve(e,"u_key_color",o.keyColor),e.setFloat("u_key_intensity",o.keyIntensity);let[l,s,c]=Gt(o.fillAzimuth,o.fillAltitude);e.setVec3("u_fill_dir",l,s,c),Ve(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 i of e.visibleTiles){let a=e.getTile(i)?.data?.buckets?.[r];if(a)return a.kind==="fill"}return false}bucketFor(e,t,o,r,i,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 Th(`\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 ve(e,new Uint8Array(s.vertices),r),h=new ye(e,new Uint32Array(s.indices)),u=new pe(e,[{buffer:c,locations:i}],h),f=new li(u,c,h,h.count,h.type,s.extent,s.capIndexOffset??h.count);return t.buckets.set(o,f),f}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;}},Er=new z;function zh(n,e){let r=new Float32Array(66306),i=0;for(let f=0;f<=128;f++){let d=(f/128-.5)*Math.PI;for(let p=0;p<=256;p++)r[i++]=p/256*2*Math.PI-Math.PI,r[i++]=d;}let a=new Uint16Array(256*128*6),l=0;for(let f=0;f<128;f++)for(let d=0;d<256;d++){let p=f*257+d,b=p+256+1;a[l++]=p,a[l++]=p+1,a[l++]=b,a[l++]=p+1,a[l++]=b+1,a[l++]=b;}let s={stride:8,attribs:[{name:"a_lnglat",size:2,type:xo,offset:0}]},c=new z([["a_lnglat",e.attribLocation("a_lnglat")]]),h=new ve(n,r,s),u=new ye(n,a);return {vao:new pe(n,[{buffer:h,locations:c}],u),vbo:h,ibo:u,count:a.length}}function Vh(n,e){if(e.highColor){Ve(n,"u_high_color",e.highColor);return}let t=Er.get(e.skyColor);t||(t=he(e.skyColor),Er.set(e.skyColor,t)),n.setVec3("u_high_color",t[0]*.6,t[1]*.74,Math.min(1,t[2]*.99+.02));}function Ve(n,e,t){let o=Er.get(t);o||(o=he(t),Er.set(t,o)),n.setVec3(e,o[0],o[1],o[2]);}function Gt(n,e){let t=n*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 Wh(n){let o=n-1;return 1+2.20158*o*o*o+1.20158*o*o}var Mr=1,_o=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 i=this.entries.get(e);if(i)return i;if(this.full||o>this.size)return null;if(this.shelfX+o+Mr>this.size&&(this.shelfY+=this.shelfHeight+Mr,this.shelfX=0,this.shelfHeight=0),this.shelfY+r+Mr>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+Mr,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 si=.75,Mo=8,Ce=3,Qe=24,Ot=256,Fs=255,Eo=class{constructor(e,t="Noto Sans Regular"){this.urlTemplate=e;this.fontstack=t;this.glyphs=new z;this.loaded=new oe;this.inflight=new z;}get(e){return this.glyphs.get(e)}hasRange(e){return this.loaded.has(Math.floor(e/Ot))}needsLoad(e){for(let t of e){let o=t.codePointAt(0);if(o===void 0)continue;let r=Math.floor(o/Ot);if(r<=Fs&&!this.loaded.has(r))return true}return false}async ensure(e){let t=new oe;for(let o of e){let r=o.codePointAt(0);if(r===void 0)continue;let i=Math.floor(r/Ot);i>Fs||this.loaded.has(i)||t.add(i);}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*Ot}-${e*Ot+Ot-1}`),r=fetch(o,{credentials:"same-origin"}).then(i=>{if(!i.ok)throw new Error(`HTTP ${i.status}`);return i.arrayBuffer()}).then(i=>{for(let a of Ds(i))this.glyphs.set(a.id,a);this.loaded.add(e);}).catch(i=>{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:`,i instanceof Error?i.message:i);}).finally(()=>{this.inflight.delete(e);});return this.inflight.set(e,r),r}};function Ds(n){let e=new ht(n instanceof Uint8Array?n:new Uint8Array(n)),t=[];return e.readFields((o,r,i)=>{if(o!==1||!i)return;let a=i.readVarint()+i.pos;i.readFields((l,s,c)=>{if(l!==3||!c)return;let h=c.readVarint()+c.pos,u={id:0,bitmap:null,width:0,height:0,left:0,top:0,advance:0};c.readFields((f,d,p)=>{p&&(f===1?u.id=p.readVarint():f===2?u.bitmap=p.readBytes():f===3?u.width=p.readVarint():f===4?u.height=p.readVarint():f===5?u.left=p.readSVarint():f===6?u.top=p.readSVarint():f===7&&(u.advance=p.readVarint()));},null,h),t.push(u);},null,a);},null),t}var Nh=.25,zt=1e20;function ci(n,e,t){let o=e+Ce*2,r=t+Ce*2,i=o*r,a=new Float64Array(i),l=new Float64Array(i);a.fill(zt),l.fill(0);for(let c=0;c<t;c++)for(let h=0;h<e;h++){let u=n[c*e+h]/255,f=(c+Ce)*o+(h+Ce);if(u>=1)a[f]=0,l[f]=zt;else if(u>0){let d=.5-u;a[f]=d>0?d*d:0,l[f]=d<0?d*d:0;}else a[f]=zt,l[f]=0;}Ss(a,o,r),Ss(l,o,r);let s=new Uint8Array(i);for(let c=0;c<i;c++){let h=Math.sqrt(a[c])-Math.sqrt(l[c]);s[c]=Kh(Math.round(255-255*(h/Mo+Nh)));}return {data:s,width:o,height:r}}function Ss(n,e,t){let o=Math.max(e,t),r=new Float64Array(o),i=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]=n[c*e+s];Is(r,i,a,l,t);for(let c=0;c<t;c++)n[c*e+s]=i[c];}for(let s=0;s<t;s++){for(let c=0;c<e;c++)r[c]=n[s*e+c];Is(r,i,a,l,e);for(let c=0;c<e;c++)n[s*e+c]=i[c];}}function Is(n,e,t,o,r){t[0]=0,o[0]=-zt,o[1]=zt;for(let i=1,a=0;i<r;i++){let l=0;do{let s=t[a];l=(n[i]-n[s]+i*i-s*s)/(i-s)/2;}while(l<=o[a]&&--a>-1);a++,t[a]=i,o[a]=l,o[a+1]=zt;}for(let i=0,a=0;i<r;i++){for(;o[a+1]<i;)a++;let l=t[a];e[i]=(i-l)*(i-l)+n[l];}}var Kh=n=>n<0?0:n>255?255:n;var Ls=48,Fo=class{constructor(e={}){this.defs=e;this.sdfs=new z;this.pending=new oe;this.failed=new oe;}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),i=r?Number(r[1])/Number(r[2]):1,a=Math.max(8,Math.round(Ls*(i>1?i:1))),l=Math.max(8,Math.round(Ls/(i<1?i:1))),s=await Uh(o,a,l);return this.sdfs.set(e,ci(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 Uh(n,e,t){let o=n.includes("width=")?n:n.replace("<svg",`<svg width="${e}" height="${t}"`),r=new Blob([o],{type:"image/svg+xml;charset=utf-8"}),i=URL.createObjectURL(r);try{let a=new Image;a.width=e,a.height=t,await new Promise((u,f)=>{a.onload=()=>u(),a.onerror=()=>f(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=i;});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,h=new Uint8ClampedArray(e*t);for(let u=0;u<h.length;u++)h[u]=c[u*4+3];return h}finally{URL.revokeObjectURL(i);}}var yt={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>'},Jh={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[n,e]of Object.entries(Jh)){let t=yt[e];t?yt[n]=t:console.warn(`[osmgl] \u043F\u0441\u0435\u0432\u0434\u043E\u043D\u0438\u043C \u0438\u043A\u043E\u043D\u043A\u0438 \xAB${n}\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 Xh=1.2;function fi(n,e,t=16,o=0){let r=jh(n,t),i=[],a=[],l=0;for(let h of r){let u=0,f=0;for(let d of h){let p=d.codePointAt(0);if(p===void 0)continue;let b=e.get(p);b&&(u+=b.advance,f++);}f>1&&(u+=o*(f-1)),a.push(u),u>l&&(l=u);}if(l===0)return null;let s=Qe*Xh,c=r.length*s;for(let h=0;h<r.length;h++){let u=-a[h]/2,f=-c/2+h*s+s/2;for(let d of r[h]){let p=d.codePointAt(0);if(p===void 0)continue;let b=e.get(p);b&&(b.width>0&&b.height>0&&b.bitmap&&i.push({glyph:b,x:u,y:f}),u+=b.advance+o);}}return i.length?{glyphs:i,width:l,height:c}:null}function jh(n,e){let t=n.replace(/\s+/g," ").trim();if(t.length<=e)return [t];let o=t.split(" "),r=[],i="";for(let a of o)i?i.length+1+a.length<=e?i+=" "+a:(r.push(i),i=a):i=a;return i&&r.push(i),r.slice(0,3)}function ui(n,e,t,o){if(n.length<2)return [];let r=-o,i=-o,a=e+o,l=t+o,s=f=>f.x>=r&&f.x<=a&&f.y>=i&&f.y<=l,c=[],h=[],u=()=>{h.length>=2&&c.push(h),h=[];};for(let f=0;f+1<n.length;f++){let d=n[f],p=n[f+1],b=s(d),m=s(p);if(b&&m){h.length||h.push(d),h.push(p);continue}let g=Yh(d,p,r,i,a,l);if(!g){u();continue}h.length||h.push(g[0]),h.push(g[1]),m||u();}return u(),c}function Yh(n,e,t,o,r,i){let a=e.x-n.x,l=e.y-n.y,s=0,c=1,h=[[-a,n.x-t],[a,r-n.x],[-l,n.y-o],[l,i-n.y]];for(let[u,f]of h){if(u===0){if(f<0)return null;continue}let d=f/u;if(u<0){if(d>c)return null;d>s&&(s=d);}else {if(d<s)return null;d<c&&(c=d);}}return [{x:n.x+a*s,y:n.y+l*s},{x:n.x+a*c,y:n.y+l*c}]}var Zh=[0,.25,-0.25,.5,-0.5,.75,-0.75,1,-1];function di(n,e,t,o={}){if(n.length<2||!e.length||t<=0)return [];let r=ed(n),i=r[r.length-1];if(i<t)return [];let a=o.maxAngle??25,l=o.stableScale&&o.stableScale>0?o.stableScale:1,s=i*l,c=o.fontSize?o.fontSize*.6:t/e.length,h=(o.fontSize??0)*.85,u=[],f=o.spacing??250,d=f>0&&f-t<f*.25?t+f*.25:f;if(o.accept)return Qh(n,r,e,t,d,c,a,h,o.accept);if(d>0&&s>=t+d){let b=Math.min(Math.floor((s-t)/d)+1,24),m=t+d*(b-1),g=(s-m)/2;for(let y=0;y<b;y++,g+=d){let A=g/l,B=hi(n,r,e,t,A,c,a,h);B&&u.push({glyphs:B,path:B.map(x=>({x:x.x,y:x.y})),at:A});}if(u.length)return u}let p=(i-t)/2;for(let b of Zh){let m=p+p*b,g=hi(n,r,e,t,m,c,a,h);if(g)return [{glyphs:g,path:g.map(y=>({x:y.x,y:y.y})),at:m}];if(p===0)break}return []}function Qh(n,e,t,o,r,i,a,l,s){let c=e[e.length-1],h=Math.max(o/3,r/8,12),u=[],f=-1/0;for(let d=0;d+o<=c;d+=h){if(d-f<r)continue;let p=hi(n,e,t,o,d,i,a,l);if(!p)continue;let b={glyphs:p,path:p.map(m=>({x:m.x,y:m.y})),at:d};if(s(b)&&(u.push(b),f=d,u.length>=24))break}return u}function hi(n,e,t,o,r,i,a,l){if(r<0||r+o>e[e.length-1]||!qh(n,e,r,r+o,i,a))return null;let s=Do(n,e,r),c=Do(n,e,r+o);if(!s||!c)return null;if(c.x>=s.x)return Ts(n,e,t,r,l);let h=e[e.length-1];return Ts([...n].reverse(),td(e),t,h-(r+o),l)}function qh(n,e,t,o,r,i){if(r<=0)return true;let a=[],l=0;for(let s=1;s+1<n.length;s++){let c=e[s];if(c<=t)continue;if(c>=o)break;let h=Math.atan2(n[s].y-n[s-1].y,n[s].x-n[s-1].x),u=Math.atan2(n[s+1].y-n[s].y,n[s+1].x-n[s].x),f=Math.abs((u-h)*180/Math.PI+540)%360-180,d=Math.abs(f);for(a.push({at:c,delta:d}),l+=d;a.length&&c-a[0].at>r;)l-=a.shift().delta;if(l>i)return false}return true}function Ts(n,e,t,o,r){let i=[];for(let c of t){let h=Hs(n,e,o+c.offset,c.width);if(!h)return null;i.push(h);}if(!i.length)return null;if(r<=0)return i;let a=[],l=o,s=0;for(let c=0;c<t.length;c++){if(c>0){let u=Math.abs($h(i[c].angle,i[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 h=Hs(n,e,l,t[c].width);if(!h)return null;a.push(h);}return a}function Hs(n,e,t,o){let r=Do(n,e,t+o/2);if(!r)return null;let i=Do(n,e,t),a=Do(n,e,t+o);if(!i||!a)return r;let l=a.x-i.x,s=a.y-i.y;return l===0&&s===0?r:{x:r.x,y:r.y,angle:Math.atan2(s,l)*180/Math.PI}}function $h(n,e){let t=n-e;for(;t>180;)t-=360;for(;t<=-180;)t+=360;return t}function ed(n){let e=new Array(n.length);e[0]=0;for(let t=1;t<n.length;t++)e[t]=e[t-1]+Math.hypot(n[t].x-n[t-1].x,n[t].y-n[t-1].y);return e}function td(n){let e=n[n.length-1];return n.map(t=>e-t).reverse()}function Do(n,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 i=(t-e[o-1])/r,a=n[o-1],l=n[o],s=l.x-a.x,c=l.y-a.y;return {x:a.x+s*i,y:a.y+c*i,angle:Math.atan2(c,s)*180/Math.PI}}var mi=20,ks={stride:mi,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}]},od=220,at=64,Ps=2,rd=1.22,nd=128,id=.7;function ad(n,e,t){let o=n.layout?.letterSpacing;if(o!==void 0)return V(o,e,0)*Qe;let r=V(n.paint?.haloWidth,e,0);return r<=0||t<=0?0:r*id/(t/Qe)}var ld=256,sd=200,pi="frame-circle",Vt=class n{constructor(e,t){this.shader=null;this.locations=new z;this.atlas=new _o(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 Eo(e,t),this.icons=new Fo(yt);}init(e){this.shader=new Ae(e,"symbol",rs,ns);for(let t of ks.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)/od;return r<1?(this.fading=true,r):1}order(e){let t=o=>o.priority+(this.stickyKeys.has(n.keyOf({layerId:o.layer.id,mercX:o.mercX,mercY:o.mercY}))?sd:0);e.sort((o,r)=>t(r)-t(o));}rememberPlaced(){this.stickyKeys=new Set(this.placed.map(e=>n.keyOf(e)));for(let e of [...this.shownAt.keys()])this.stickyKeys.has(e)||this.shownAt.delete(e);}render(e,t,o,r){let i=this.shader;if(this.placedCount=0,this.placed=[],this.viewport={width:t.width,height:t.height},!i)return;let a=t.zoom,l=r.layers.filter(d=>d.type==="symbol"&&r.layerVisibleAt(d,a));if(!l.length)return;let s=this.collect(t,o,r,l);if(!s.length)return;this.now=performance.now(),this.fading=false,this.order(s);let c=new z,h=new z,u=new z;l.forEach((d,p)=>u.set(d.id,p));let f=0;for(let d of s){let p=this.place(d,a,c);if(!p)continue;this.placed.push({layerId:d.layer.id,text:d.text,icon:d.icon,mercX:d.mercX,mercY:d.mercY,box:p.box,order:u.get(d.layer.id)??0});let b=h.get(d.layer.id);b||h.set(d.layer.id,b={layer:d.layer,verts:[],texs:[],iconVerts:[],iconTexs:[],frameVerts:[],frameTexs:[]}),b.verts.push(...p.verts),b.texs.push(...p.texs),b.iconVerts.push(...p.iconVerts),b.iconTexs.push(...p.iconTexs),b.frameVerts.push(...p.frameVerts),b.frameTexs.push(...p.frameTexs),f+=p.quads,this.placedCount++;}this.rememberPlaced(),this.fading&&this.onAssetsReady?.(),this.requestMissing(),f&&(this.styleOrder=u,this.draw(e,t,h,f,a));}collect(e,t,o,r){let i=[],l=this.padding,s=kt(e,o).far,[c,h,u]=e.cameraPositionPx;for(let f of r){let d=(f.layout?.priority??0)*ld,p=t.get(f.source??Y);if(!p)continue;let b=f.layout?.showFor==="highlight",m=f.layout?.placement==="map",{shift:g,drop:y}=m?zs(f,e.zoom,e.pixelsPerMeter):{shift:0,drop:0};if(b&&!this.highlightFootprint)continue;let A=e.worldSize>0?e.pixelsPerMeter/e.worldSize*1.5:0,B=o.bucketKeyFor(f);if(B!==null)for(let x of p.visibleTiles){if(!o.layerVisibleAt(f,e.detailZoom(e.distanceToTile(x))))continue;let _=p.getTile(x)?.data?.buckets?.[B];if(!_||!gr(_))continue;let C=new Int16Array(_.anchors),v=new Uint8Array(_.priorities),E=_.rotations?new Int16Array(_.rotations):null,D=_.lines?new Int16Array(_.lines):null,F=_.lineStarts?new Uint32Array(_.lineStarts):null,H=x.bounds(),S=e.worldSize,L=(H.maxX-H.minX)*S/_.extent,M=H.minX*S,T=H.minY*S;for(let P=0;P<v.length;P++){let k=M+C[P*2]*L,O=T+C[P*2+1]*L;if(s!==1/0&&Math.hypot(k-c,O-h,u)>s||b&&!Ze(this.highlightFootprint,k/S,O/S,A))continue;let N=k,G=O;if(m&&E){let Z=E[P]*Math.PI/180,ee=g;N-=Math.sin(Z)*ee,G+=Math.cos(Z)*ee;}let R=e.worldPxToPoint(N,G),W=D&&F?cd(e,D,F,P,M,T,L):void 0;if(f.layout?.textPlacement==="line"){if(!W)continue}else if(!R||R.x<l.left-64||R.y<l.top-64||R.x>e.width-l.right+64||R.y>e.height-l.bottom+64)continue;i.push({layer:f,screenX:R?R.x:W[0].x,screenY:(R?R.y:W[0].y)+y,text:_.texts[P]??"",icon:_.icons[P]??"",priority:v[P]+d,rotate:Vs(f,E,P,e.bearing),mercX:k/S,mercY:O/S,line:W});}}}return i}place(e,t,o){let r=e.layer.layout??{},i=n.keyOf({layerId:e.layer.id,mercX:e.mercX,mercY:e.mercY});if(this.hiddenKey!==null&&this.hiddenKey===i)return null;let a=this.fadeOf(i,this.now),l=this.hoverKey!==null&&this.hoverKey===i,s=V(r.textSize,t,13),c=V(r.iconSize,t,16),h=r.iconTextGap??5,[u,f]=r.offset??[0,0],d=r.placement==="map",p=null;if(e.icon&&!d){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&&(p=U);}let b=null;if(p&&r.iconFrame==="circle"){let q=`icon:${pi}`,U=this.atlas.get(q);if(!U){let J=this.icons.get(pi);J?U=this.atlas.add(q,J.data,J.width,J.height)??void 0:this.pendingIcons.add(pi);}U&&(b=U);}let m=b?Math.max(r.iconFrameScale??1.6,1):1,g=null;if(e.text&&(this.glyphs.needsLoad(e.text)&&this.pendingText.add(e.text),g=fi(e.text,this.glyphs,r.textPlacement==="line"?Number.MAX_SAFE_INTEGER:r.maxLineChars??15,ad(e.layer,t,s)),!g&&!p)||!g&&!p)return null;let y=s/Qe,A=g?g.width*y:0,B=g?g.height*y:0;if(e.layer.layout?.textPlacement==="line")return g&&e.line?this.placeOnLine(e,g,y,B,o,t,a):null;let x=r.iconPlacement??"top",w=x==="behind"&&!!p&&!!g,_=x==="top"&&!!p&&!!g,C=p?p.width/Math.max(p.height,1):1,v=w?B+h*2:c,E=p?v*C:0,D=Math.max(E,p?c*m:0),F=Math.max(v,p?c*m:0),H=w?Math.max(E,A+h*2):_?Math.max(D,A):D+(p&&g?h:0)+A,S=w?Math.max(v,B):_?F+h+B:Math.max(p?F:0,B),L=e.screenX+u,M=e.screenY+f,T=Ps+(r.collisionPadding??0),P={x1:L-H/2-T,y1:M-S/2-T,x2:L+H/2+T,y2:M+S/2+T},k=this.padding;if(P.x1<k.left||P.y1<k.top||P.x2>this.viewport.width-k.right||P.y2>this.viewport.height-k.bottom)return null;if(!r.allowOverlap){if(Rs(o,P))return null;Gs(o,P);}let O=[],N=[],G=[],R=[],W=[],j=[],Z=0,ee=L-H/2,ge=_?(F+h)/2:0,te=1/0,X=1/0,re=-1/0,le=-1/0;if(g){let q=_||w?L:ee+(p?D+h:0)+A/2;for(let U of g.glyphs){let J=U.glyph,fe=`g:${J.id}`,se=this.atlas.get(fe);if(!se&&(!J.bitmap||(se=this.atlas.add(fe,J.bitmap,J.width+Ce*2,J.height+Ce*2)??void 0,!se)))continue;let ue=q+(U.x+J.left-Ce)*y,ae=M+ge+(U.y-J.top-Ce)*y,xe=se.width*y,Te=se.height*y;Fr(O,N,ue,ae,xe,Te,se,0,a),Z++;let we=Ce*y;te=Math.min(te,ue+we),X=Math.min(X,ae+we),re=Math.max(re,ue+xe-we),le=Math.max(le,ae+Te-we);}if(_&&p&&X<1/0){let U=M-S/2+F+h-X;if(U!==0){for(let J=1;J<O.length;J+=4)O[J]+=U;X+=U,le+=U;}}}if(p){let q=l?rd:1,U=E*q,J=v*q,fe=(_?L-E/2:ee+(D-E)/2)-(U-E)/2,se=(_?M-S/2+(F-v)/2:M-v/2)-(J-v)/2;if(b){let ae=c*m*q,xe=fe+U/2-ae/2,Te=se+J/2-ae/2,we=Ce/Math.max(b.height-Ce*2,1)*ae;Fr(W,j,xe-we,Te-we,ae+we*2,ae+we*2,b,0,a),Z++;}if(w&&re>te){let ae=h*1.6,xe=h;U=(re-te+ae*2)*q,J=(le-X+xe*2)*q,fe=te-ae,se=X-xe;}let ue=Ce/Math.max(p.height-Ce*2,1)*J;Fr(G,R,fe-ue,se-ue,U+ue*2,J+ue*2,p,e.rotate,a),Z++;}return Z?{verts:O,texs:N,iconVerts:G,iconTexs:R,frameVerts:W,frameTexs:j,quads:Z,box:P}:null}placeOnLine(e,t,o,r,i,a,l){let s=e.line,c=t.glyphs.map(E=>({offset:(E.x+t.width/2)*o,width:Math.max(E.glyph.advance,1)*o})),h=c.length?c[c.length-1].offset+c[c.length-1].width:0,u=e.layer.layout??{},f=[],d=[],p=[],b=0,m=r/2+Ps,g=this.padding,y=E=>{let D=E.path.map(F=>({x1:F.x-m,y1:F.y-m,x2:F.x+m,y2:F.y+m}));for(let F of D)if(F.x1<g.left||F.y1<g.top||F.x2>this.viewport.width-g.right||F.y2>this.viewport.height-g.bottom||!u.allowOverlap&&Rs(i,F))return false;if(!u.allowOverlap)for(let F of D)Gs(i,F);return p.push(...D),true},A=-1/0,B=1/0;for(let E of t.glyphs)E.glyph.height<=0||(A=Math.max(A,E.glyph.top),B=Math.min(B,E.glyph.top-E.glyph.height));let x=Number.isFinite(A)?(A+B)/2*o:0,_=ui(s,this.viewport.width,this.viewport.height,nd).flatMap(E=>di(E,c,h,{spacing:u.symbolSpacing,fontSize:Qe*o,stableScale:Math.pow(2,Math.round(a)-a),accept:y}));if(!_.length)return null;for(let E of _)for(let D=0;D<t.glyphs.length;D++){let F=t.glyphs[D].glyph,H=E.glyphs[D],S=`g:${F.id}`,L=this.atlas.get(S);if(!L&&(!F.bitmap||(L=this.atlas.add(S,F.bitmap,F.width+Ce*2,F.height+Ce*2)??void 0,!L)))continue;let M=L.width*o,T=L.height*o,P=(F.height/2-F.top)*o+x,k=H.angle*Math.PI/180;Fr(f,d,H.x-M/2-Math.sin(k)*P,H.y-T/2+Math.cos(k)*P,M,T,L,H.angle,l),b++;}if(!b)return null;let C=p.map(E=>(E.x1+E.x2)/2),v=p.map(E=>(E.y1+E.y2)/2);return {verts:f,texs:d,iconVerts:[],iconTexs:[],frameVerts:[],frameTexs:[],quads:b,box:{x1:Math.min(...C)-m,y1:Math.min(...v)-m,x2:Math.max(...C)+m,y2:Math.max(...v)+m}}}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,i){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 h=new ArrayBuffer(r*4*mi),u=new Float32Array(h),f=new Uint16Array(h),d=[],p=0,b=(m,g,y,A)=>{let B=m.length/16;if(B){d.push({layer:y,role:A,first:p/4*6,count:B*6});for(let x=0;x<B*4;x++){let w=p*5;u[w]=m[x*4],u[w+1]=m[x*4+1],f[w*2+4]=g[x*2],f[w*2+5]=g[x*2+1],u[w+3]=m[x*4+2],u[w+4]=m[x*4+3],p++;}}};for(let m of this.inStyleOrder(o))b(m.frameVerts,m.frameTexs,m.layer,"frame"),b(m.iconVerts,m.iconTexs,m.layer,"icon"),b(m.verts,m.texs,m.layer,"text");s.update(new Uint8Array(h)),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",si),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 m of d){let g=m.layer.paint,y=V(g.opacity,i,1),A=m.role==="icon",B=m.role==="frame",x=(D,F,H)=>B?F??D??H:A?D??H:H,w=He(B?g.frameColor??g.haloColor??g.color:x(g.iconColor,void 0,g.color),i,[.15,.15,.15,1]),_=B?g.frameHaloColor:x(g.iconHaloColor,void 0,g.haloColor),C=He(_??(B?g.iconColor??g.color:g.haloColor),i,[1,1,1,1]);B&&g.frameHaloColor===void 0&&(C[3]*=.35),B&&(w[3]*=V(g.frameOpacity,i,1));let v=V(B?g.frameHaloWidth??1.1:x(g.iconHaloWidth,void 0,g.haloWidth),i,1.2),E=V(m.layer.layout?.textSize,i,13);a.setVec4v("u_color",Me([w[0],w[1],w[2],w[3]*y])),a.setVec4v("u_halo_color",Me([C[0],C[1],C[2],C[3]*y])),a.setFloat("u_halo",v/(Mo*(E/Qe))),l.drawElements(l.TRIANGLES,m.count,l.UNSIGNED_INT,m.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 ve(e,new Uint8Array(this.capacityQuads*4*mi),ks,true);let o=new Uint32Array(this.capacityQuads*6);for(let r=0;r<this.capacityQuads;r++){let i=r*4;o.set([i,i+1,i+2,i,i+2,i+3],r*6);}this.ibo=new ye(e,o),this.vao=new pe(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 Fr(n,e,t,o,r,i,a,l=0,s=1){let c=i/Math.max(a.height,1);if(l){let h=l*Math.PI/180,u=Math.cos(h),f=Math.sin(h),d=t+r/2,p=o+i/2;for(let[b,m]of [[t,o],[t+r,o],[t+r,o+i],[t,o+i]]){let g=b-d,y=m-p;n.push(d+g*u-y*f,p+g*f+y*u,c,s);}}else n.push(t,o,c,s,t+r,o,c,s,t+r,o+i,c,s,t,o+i,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 cd(n,e,t,o,r,i,a){if(o+1>=t.length)return;let l=t[o],s=t[o+1],c=[];for(let h=l;h<s;h++){let u=n.worldPxToPoint(r+e[h*2]*a,i+e[h*2+1]*a);if(!u)break;c.push(u);}return c.length>=2?c:void 0}var Os=(n,e)=>n*4096+e;function Rs(n,e){let t=Math.floor(e.x1/at),o=Math.floor(e.y1/at),r=Math.floor(e.x2/at),i=Math.floor(e.y2/at);for(let a=t;a<=r;a++)for(let l=o;l<=i;l++){let s=n.get(Os(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 Gs(n,e){let t=Math.floor(e.x1/at),o=Math.floor(e.y1/at),r=Math.floor(e.x2/at),i=Math.floor(e.y2/at);for(let a=t;a<=r;a++)for(let l=o;l<=i;l++){let s=Os(a,l),c=n.get(s);c||n.set(s,c=[]),c.push(e);}}function zs(n,e,t){let r=n.layout?.arrowUnits!=="meters"?1:t,i=V(n.layout?.arrowLength,e,50)*r;return {shift:V(n.layout?.arrowGap,e,20)*r+i/2,drop:i/2+(n.layout?.iconTextGap??4)}}function Vs(n,e,t,o){return !n.layout?.iconRotate||!e?0:e[t]-o}var Wt=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 Nt=class n{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 n(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 n(e,t,o,this.wrap),new n(e,t+1,o,this.wrap),new n(e,t,o+1,this.wrap),new n(e,t+1,o+1,this.wrap)]}scaledTo(e){if(e>=this.z)return this;let t=this.z-e;return new n(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 fd(n,e,t){let o=Math.pow(2,t),r=e.maxTiles??512,i=[],a=128;for(let l=0;l<o;l++)for(let s=0;s<o;s++){let c=new Nt(t,s,l),h=c.bounds(),u=(h.minX+h.maxX)/2,f=(h.minY+h.maxY)/2,d=[[u,f],[h.minX,h.minY],[h.maxX,h.minY],[h.minX,h.maxY],[h.maxX,h.maxY]],p=false;for(let[m,g]of d)if(n.isOnGlobeFront(Se(m),Fe(g))){p=true;break}if(!p)continue;let b=false;for(let[m,g]of d){let y=n.localToPoint(n.globeLocal(m,g));if(y&&y.x>-a&&y.y>-a&&y.x<n.width+a&&y.y<n.height+a){b=true;break}}if(b&&(i.push(c),i.length>=r))return i}return i}function So(n,e){let t=Math.min(e.maxzoom,24),o=Math.max(0,Math.min(e.minzoom,t)),r=e.detailBias??1,i=e.maxTiles??512,a=512*r,l=Math.min(Math.round(n.zoom),t);if(l<o)return [];if(n.globeActive)return fd(n,e,l);let{min:s,max:c}=n.visibleWrapRange(),h=[],u=[];for(let d=s;d<=c;d++)u.push(new Nt(0,0,0,d));let f=0;for(;u.length&&!(++f>2e4||h.length>=i);){let d=u.pop();if(!n.isTileVisible(d))continue;if(d.z>=l){d.z>=o&&h.push(d);continue}if(n.tileScreenSize(d.z,n.distanceToTile(d))<=a&&d.z>=o){h.push(d);continue}for(let b of d.children())u.push(b);}return h.sort((d,p)=>n.distanceToTile(d)-n.distanceToTile(p)),h}var bi=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;}},ud=1500,Dr=class extends qe{constructor(t,o){super();this.pool=t;this.visible=[];this.holdSince=0;this.warmed=false;this.version=0;this.opts={cacheSize:160,detailBias:1,maxTiles:512,...o},this.cache=new Wt(this.opts.cacheSize,(r,i)=>{i.state==="loading"&&this.pool.abort(i.requestId),i.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 i=this.getTile(r)?.data?.splits?.[t];if(i)for(let a of i)o.includes(a)||o.push(a);}return o.sort((r,i)=>typeof r=="number"&&typeof i=="number"?r-i:String(r).localeCompare(String(i))),o}get pendingCount(){let t=0;for(let o of this.cache.values())o.state==="loading"&&t++;return t}update(t){let o=So(t,this.opts),r=new oe;for(let s of o)r.add(s.dataKey);for(let[s,c]of this.cache.entries())c.state==="loading"&&!r.has(s)&&(this.pool.abort(c.requestId),this.cache.delete(s));let i=Math.max(this.opts.cacheSize,r.size*2);this.cache.setCapacity(i);for(let s of o)this.cache.get(s.dataKey)||this.loadTile(s);let a=this.visible.length>0&&this.covers(o),l=performance.now();this.readyFor(o)||!a||this.holdSince&&l-this.holdSince>ud?(this.visible=o,this.holdSince=0,this.readyFor(o)&&o.length&&(this.warmed=true)):this.holdSince||(this.holdSince=l);}readyFor(t){for(let o of t){let r=this.cache.peek(o.dataKey);if(!r||r.state==="loading")return false}return true}covers(t){let o=new oe;for(let r of this.visible)o.add(r.dataKey);for(let r of t){if(o.has(r.dataKey))continue;let i=r.parent(),a=false;for(let l=0;i&&l<4;l++){if(o.has(i.dataKey)){a=true;break}i=i.parent();}if(!a)for(let l of this.visible){let s=l.parent();for(let c=0;s&&c<4;c++){if(s.dataKey===r.dataKey){a=true;break}s=s.parent();}if(a)break}if(!a)return false}return true}loadTile(t){let o=new bi(t);this.cache.set(t.dataKey,o);let r=hd(this.opts.url.replace("{z}",String(t.z)).replace("{x}",String(t.x)).replace("{y}",String(t.y)));o.requestId=this.pool.load({url:r,zoom:t.z,metersPerTile:Vi(t.z,t.y),sourceMaxZoom:this.opts.maxzoom,plan:this.opts.plan},i=>{if(this.cache.peek(t.dataKey)===o){if(i.type==="error"){if(i.aborted)return;o.state="error",o.error=i.message,this.emit("error",{tile:t,message:i.message});}else o.data=i,o.state=Object.keys(i.buckets).length?"loaded":"empty",this.version++,i.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 ${i.diag.failed.join("; ")}`),this.emit("data",{tile:o});this.pendingCount===0&&this.emit("idle",void 0);}});}findReadyAncestor(t,o=5){let r=t.parent();for(let i=0;r&&i<o;i++){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 hd(n){if(typeof location>"u")return n;try{return new URL(n,location.href).href}catch{return n}}var Sr=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;}},Io=class extends qe{constructor(t){super();this.visible=[];this.aborts=new Map;this.opts={cacheSize:128,detailBias:1,maxTiles:256,...t},this.cache=new Wt(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=So(t,this.opts);let o=new oe;for(let r of this.visible)o.add(r.dataKey);for(let[r,i]of this.cache.entries())i.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 Sr(t);this.cache.set(t.dataKey,o);let r=new AbortController;this.aborts.set(t.dataKey,r),this.fetchImage(Ws(this.opts.url,t),r.signal).then(i=>{if(this.aborts.delete(t.dataKey),this.cache.peek(t.dataKey)!==o){i.close();return}o.image=i,o.state="loaded",this.emit("data",{tile:o});}).catch(i=>{this.aborts.delete(t.dataKey),!r.signal.aborted&&this.cache.peek(t.dataKey)===o&&(o.state="error",o.error=i instanceof Error?i.message:String(i),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 Ws(n,e){let t=n.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 dd="osmgl-assets",Kt="assets";var Ir=null;function Ks(){return Ir||(Ir=new Promise(n=>{if(typeof indexedDB>"u")return n(null);try{let e=indexedDB.open(dd,1);e.onupgradeneeded=()=>{let t=e.result;t.objectStoreNames.contains(Kt)||t.createObjectStore(Kt,{keyPath:"key"});},e.onsuccess=()=>n(e.result),e.onerror=()=>n(null);}catch{n(null);}}),Ir)}function pd(n){return Ks().then(e=>new Promise(t=>{if(!e)return t(null);try{let o=e.transaction(Kt,"readonly").objectStore(Kt).get(n);o.onsuccess=()=>t(o.result??null),o.onerror=()=>t(null);}catch{t(null);}}))}function md(n){Ks().then(e=>{if(e)try{e.transaction(Kt,"readwrite").objectStore(Kt).put(n);}catch{}});}var Ns=n=>{let e=atob(n),t=new Uint8Array(e.length);for(let o=0;o<e.length;o++)t[o]=e.charCodeAt(o);return t};async function bd(n,e,t){let o=await crypto.subtle.importKey("raw",Ns(e),"AES-GCM",false,["decrypt"]);return crypto.subtle.decrypt({name:"AES-GCM",iv:Ns(t),tagLength:128},o,n)}var Lo=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 i=await this.resolve(e,o),a=`${i}:${t}`,l=this.inflight.get(a);if(l)return l;let s=this.fetchAsset(a,i,t,r).finally(()=>this.inflight.delete(a));return this.inflight.set(a,s),s}async fetchAsset(e,t,o,r){let i,a,l=await pd(e);if(l)i=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",i=await c.arrayBuffer(),md({key:e,bytes:i,encrypted:a,savedAt:Date.now()});}if(!a)return i;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 bd(i,s.key,s.iv)}getKey(e,t){let o=this.keys.get(e);if(o)return o;let r=(async()=>{let i=await fetch(this.withKey(`${this.endpoint}/files/${e}/key`),{signal:t,credentials:"same-origin"});if(!i.ok)return null;let a=await i.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 gd=1,To=class{constructor(e){this.mesh=null;this.bitmaps=[];this.error=null;this.loading=null;this.matrix=K();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-${gd++}`,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 $n(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 i=Math.max(o,0);return this.grow=this.shrinkFrom*(1-i*i*(3-2*i)),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])),i=Math.max(Math.abs(e.min[2]),Math.abs(e.max[2]));return Math.hypot(o,r,i)*t}origin(){let e=$(this.coordinates);return {x:ne(e.lng),y:ie(e.lat)}}localMatrix(e){let t=this.effectiveScale(),o=t/Oe(e),r=[o,0,0,0,0,t*this.grow,0,o,0],i=c=>c*Math.PI/180,a=yi(i(-this.rotation));this.rotationTiltX&&(a=lt(gi(i(this.rotationTiltX)),a)),this.rotationTiltZ&&(a=lt(Ai(i(this.rotationTiltZ)),a));let l=lt(r,a),s=this.matrix;return Xe(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=$(this.coordinates),r=K();for(let a=0;a<16;a++)r[a]=e[a];let i=K();return Ee(i,r,this.localMatrix(o.lat)),je(t??this.matrix32,i)}cameraInModelSpace(e){let t=this.effectiveScale();if(!(t>0))return [0,0,0];let o=this.origin(),r=$(this.coordinates),i=Oe(r.lat),a=e.worldSize,l=e.cameraPositionPx,s=(l[0]/a-o.x)*i,c=(l[1]/a-o.y)*i,h=l[2]/e.pixelsPerMeter-this.altitude,u=s,f=h,d=c,p=m=>m*Math.PI/180,b=yi(p(-this.rotation));return this.rotationTiltX&&(b=lt(gi(p(this.rotationTiltX)),b)),this.rotationTiltZ&&(b=lt(Ai(p(this.rotationTiltZ)),b)),[(b[0]*u+b[1]*f+b[2]*d)/t,(b[3]*u+b[4]*f+b[5]*d)/t,(b[6]*u+b[7]*f+b[8]*d)/t]}matrixFor(e){let t=this.origin();return this.matrixInSpace(e.objectMatrix(t.x,t.y,this.altitude))}coversPoint(e,t){let o=this.mesh;if(!o)return false;let r=this.origin(),i=e-r.x,a=t-r.y,l=$(this.coordinates),s=this.localMatrix(l.lat),c=s[0],h=s[1],u=s[8],f=s[9],d=c*f-h*u;if(Math.abs(d)<1e-30)return false;let p=(i*f-a*u)/d,b=(c*a-h*i)/d,m=1.05,g=(o.min[0]+o.max[0])/2,y=(o.min[2]+o.max[2])/2,A=(o.max[0]-o.min[0])/2*m,B=(o.max[2]-o.min[2])/2*m;return Math.abs(p-g)<=A&&Math.abs(b-y)<=B}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 i=this.mesh?.animation;if(!i||!i.nodes.has(t))return this.matrixInSpace(e,r);let a=K();for(let u=0;u<16;u++)a[u]=e[u];let l=$(this.coordinates),s=K();Ee(s,a,this.localMatrix(l.lat));let c=K();ei(i,t,i.duration>0?o%i.duration:0,c);let h=K();return Ee(h,s,c),je(r,h)}normalMatrix(){let e=i=>i*Math.PI/180,t=yi(e(-this.rotation));this.rotationTiltX&&(t=lt(gi(e(this.rotationTiltX)),t)),this.rotationTiltZ&&(t=lt(Ai(e(this.rotationTiltZ)),t));let o=lt([1,0,0,0,0,1,0,1,0],t),r=this.normal32;for(let i=0;i<9;i++)r[i]=o[i];return r}};function lt(n,e){let t=new Array(9);for(let o=0;o<3;o++)for(let r=0;r<3;r++)t[o*3+r]=n[r]*e[o*3]+n[3+r]*e[o*3+1]+n[6+r]*e[o*3+2];return t}var gi=n=>{let e=Math.cos(n),t=Math.sin(n);return [1,0,0,0,e,t,0,-t,e]},yi=n=>{let e=Math.cos(n),t=Math.sin(n);return [e,0,-t,0,1,0,t,0,e]},Ai=n=>{let e=Math.cos(n),t=Math.sin(n);return [e,t,0,-t,e,0,0,0,1]};var Tr=class{constructor(){this.hit=new z;this.miss=new oe;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(i=>i.dataKey).join(",");if(r!==this.stamp&&(this.stamp=r,this.miss.clear()),this.miss.has(e.id))return null;for(let i of t.source.visibleTiles){let a=t.source.getTile(i)?.data?.buckets?.[t.key];if(!a||a.kind!=="fill-extrusion"||!a.featureIds)continue;let l=i.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,h=new Int16Array(a.vertices),u=new Uint32Array(a.indices),f=new Float64Array(a.featureIds),d=h.length/a.vertexCount;for(let p=0;p*3+2<u.length;p++){let b=u[p*3]*d,m=u[p*3+1]*d,g=u[p*3+2]*d;if(!wd(s,c,h[b],h[b+1],h[m],h[m+1],h[g],h[g+1]))continue;let y=f[p];return this.hit.set(e.id,y),y}}return this.miss.add(e.id),null}clear(){this.hit.clear(),this.miss.clear(),this.stamp="";}},yd=14,Ad=2e3,Bd=4e3,Us=160,Cd=50,vd=4e3,Bi=6,Hr=class{constructor(e){this.wantKey="";this.modelKey="";this.entries=new z;this.loading=0;this.pending=[];this.known=new z;this.underBuilding=new Tr;this.underVenue=new Tr;this.tilesStamp="";this.rulesInScan=0;this.found=[];this.foundStamp="";this.sortedAt=null;this.budgetScale=1;this.addModel=null;this.lod=0;this.budget=Us;this.replacedBuildings=new oe;this.replacedVenues=new oe;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 Lo(e);}get models(){let e=[];for(let t of this.entries.values())e.push(t.model);return e}update(e,t,o,r,i,a,l){this.wantKey!==this.modelKey&&(this.modelKey=this.wantKey,this.clear(i));let s=e.layout??{},c=s.minZoom??yd,h=s.loadRadius??Ad,u=Math.max(s.keepRadius??Bd,h),f=Math.min(1,Math.max(.25,(o.zoom-c)/3)),d=Math.max(8,Math.round((s.budget??Us)*this.budgetScale*f));this.budget=d,this.addModel=r;let p=s.maskReplaced!==false,b=performance.now();if(o.zoom<c){for(let M of [...this.entries.values()])M.model.retire(),M.model.grow<=0&&this.release(M,i);this.replacedBuildings.clear(),this.replacedVenues.clear();return}let m=o.center,g=this.lodFor(o.zoom,c);this.lod=g;let y="";for(let M of t.visibleTiles)y+=M.dataKey+(t.getTile(M)?.data?"+":"-");let A=this.rulesInScan;if(y!==this.tilesStamp){this.tilesStamp=y;let M=new oe;A=0;for(let T of t.visibleTiles){let P=t.getTile(T)?.data?.buckets?.[e.id];if(!P||!is(P))continue;let k=new Int16Array(P.anchors),O=T.bounds(),N=O.maxX-O.minX,G=O.maxY-O.minY;for(let R=0;R<P.props.length;R++){let W=P.props[R],j=At(W.file,NaN);if(!Number.isFinite(j))continue;let Z=String(W.kind??"model"),ee=Z==="rule"?`t-${W.rid}-${W.oid}`:`m-${W.mid}`;if(M.has(ee))continue;M.add(ee),Z==="rule"&&A++;let ge=O.minX+k[R*2]/P.extent*N,te=O.minY+k[R*2+1]/P.extent*G,X=xd(ge,te);this.known.set(ee,{id:ee,fileId:j,lng:X.lng,lat:X.lat,mercX:ge,mercY:te,altitude:At(W.alt,0),scale:At(W.scale,1),rotation:At(W.rx,0),tiltX:At(W.rz,0),tiltZ:At(W.ry,0),kind:Z==="rule"?"rule":"model",target:Lr(Z==="rule"?W.oid:W.replaces),replaces:p?Z==="rule"?Lr(W.oid):String(W.anchor??"replace")==="replace"?Lr(W.replaces):null:null});}}this.rulesInScan=A;}y!==this.foundStamp&&(this.foundStamp=y,this.found=[...this.known.values()],this.sortedAt=null);let B=this.found,x=new oe;for(let M of B)M.kind==="model"&&M.target!==null&&x.add(M.target);let w=111320,_=Math.cos(m.lat*Math.PI/180),C=M=>Math.hypot((M.lng-m.lng)*w*_,(M.lat-m.lat)*w);this.replacedBuildings.clear(),this.replacedVenues.clear();let v=new oe,E=[],D=0,F=0;(this.sortedAt===null||Math.hypot((m.lng-this.sortedAt.lng)*w*_,(m.lat-this.sortedAt.lat)*w)>Cd)&&(B.sort((M,T)=>C(M)-C(T)),this.sortedAt={lng:m.lng,lat:m.lat});let S=0;for(let M of B){let T=C(M);if(T>u){D++;continue}if(M.kind==="rule"&&M.target!==null&&x.has(M.target)){let N=this.entries.get(M.id);N&&N.model.retire();continue}let P=this.entries.get(M.id);if(S>=d){F++,P&&P.model.retire();continue}S++,v.add(M.id);let k=()=>{if(M.replaces===null)return;this.replacedBuildings.add(M.replaces);let N=this.underBuilding.find(M,a);N!==null&&this.replacedBuildings.add(N);let G=this.underVenue.find(M,l);G!==null&&this.replacedVenues.add(G);},O=P;if(O){k(),O.distance=T,O.leftAt=0,O.model.revive(),g<O.lod&&!O.upgrading&&this.loading<Bi&&this.upgrade(O,g,r,i);continue}if(T>h){D++;continue}if(this.loading>=Bi){E.push(M),k();continue}k(),this.spawn(M,T,g,r);}for(let M of [...this.entries.values()])if(!v.has(M.placement.id)){if(M.leftAt===0){M.leftAt=b;continue}b-M.leftAt>vd&&M.model.retire();}for(let M of [...this.entries.values()])M.model.growTarget===0&&M.model.grow<=0&&this.release(M,i);if(this.known.size>4e3)for(let[M,T]of [...this.known.entries()])C(T)>u*3&&this.known.delete(M);let L=this.stats;L.found=B.length,L.kept=v.size,L.live=this.entries.size,L.tooFar=D,L.overBudget=F,L.queued=E.length,L.rules=A,L.loadingNow=this.loading,L.pendingNow=E.length,L.replaced=this.replacedBuildings.size,this.pending=E;}pump(){let e=this.addModel;if(this.stats.loadingNow=this.loading,this.stats.pendingNow=this.pending.length,!!e)for(;this.pending.length&&this.loading<Bi&&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 i=this.makeModel(e.placement,t,true);e.upgrading=i,this.loading++,i.load(()=>{this.loading--,this.pump(),this.entries.get(e.placement.id)===e&&(e.upgrading=null,i.isLoaded&&(r(e.model),e.model=i,e.lod=t,o(i),this.onReady?.()));});}makeModel(e,t,o){let r=new To({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,i=false){let a=this.makeModel(e,o,i);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;}},At=(n,e)=>{let t=typeof n=="number"?n:Number(n);return Number.isFinite(t)?t:e},Lr=n=>{let e=At(n,NaN);return Number.isFinite(e)?e:null};function xd(n,e){let t=n*360-180,o=Math.PI*(1-2*e),r=Math.atan(Math.sinh(o))*180/Math.PI;return {lng:t,lat:r}}function wd(n,e,t,o,r,i,a,l){let s=(n-r)*(o-i)-(t-r)*(e-i),c=(n-a)*(i-l)-(r-a)*(e-l),h=(n-t)*(l-o)-(a-t)*(e-o),u=s<0||c<0||h<0,f=s>0||c>0||h>0;return !(u&&f)}var _d=200,Ed={center:"translate(-50%, -50%)",top:"translate(-50%, 0)",bottom:"translate(-50%, -100%)",left:"translate(0, -50%)",right:"translate(-100%, -50%)"},Ho=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=Ed[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??Md),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=$(this._coordinates),o=e.worldSize,r=e.worldPxToPoint(ne(t.lng)*o,ie(t.lat)*o,this.altitude);if(!r){this.culled=true,this.applyVisibility();return}let i=_d;if(r.x<-i||r.y<-i||r.x>e.width+i||r.y>e.height+i){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";}},Md='<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 ko=class extends Ho{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 i=document.createElement("div");i.className="osmgl-popup-tip",o.appendChild(i);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 Fd=[["\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."]],Js=new Map(Fd);function Ci(n){let e=n.split(" ");if(e.length<2)return n;let t=false,o=e.map(i=>{let a=Js.get(i.toLowerCase());return a?(t=true,i[0]===i[0].toUpperCase()?a[0].toUpperCase()+a.slice(1):a):i});return !t||!e.filter(i=>Js.get(i.toLowerCase())===void 0).length?n:o.join(" ")}function xi(n,e){let t=[],o=[],r=[],i=[],a=[],l=e.textPlacement==="line",s=[],c=[],h=[];for(let u of n.features()){if(!Be(e.filter,u.properties))continue;let f=u.loadGeometry(),d=Id(u.type,f);if(!d)continue;let p=e.textField?vi(e.textField,u.properties):"",b=p&&e.abbreviate?Ci(p):p,m=e.iconImage?vi(e.iconImage,u.properties):"";if(!(!b&&!m)){if(l){let g=Sd(u.type,f);if(!g)continue;h.push({text:b,line:g});continue}t.push(d[0],d[1]),o.push(b),r.push(m),i.push(Ld(u.properties)),a.push(e.iconRotate&&Math.round(Number(u.properties[e.iconRotate]??0))||0);}}if(l){for(let{text:u,line:f}of Dd(h)){c.push(s.length/2);for(let d of f)s.push(d);t.push(Math.round(f[0]),Math.round(f[1])),o.push(u),r.push(""),i.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(i).buffer,rotations:new Int16Array(a).buffer,...l?{lines:new Int16Array(s).buffer,lineStarts:new Uint32Array(c).buffer}:{}}:null}function Dd(n){let e=[],t=new Map,o=new Map,r=(i,a,l)=>`${i}\u241F${a}\u241F${l}`;for(let{text:i,line:a}of n){let l=r(i,a[0],a[1]),s=r(i,a[a.length-2],a[a.length-1]),c=t.get(s),h=o.get(l);if(h!==void 0){let u=e[h];if(u.line.push(...a.slice(2)),o.delete(l),o.set(r(i,u.line[u.line.length-2],u.line[u.line.length-1]),h),c!==void 0&&c!==h){let f=e[c];u.line.push(...f.line.slice(2)),f.line=[],t.delete(s),o.set(r(i,u.line[u.line.length-2],u.line[u.line.length-1]),h);}continue}if(c!==void 0){let u=e[c];u.line.unshift(...a.slice(0,a.length-2)),t.delete(s),t.set(r(i,u.line[0],u.line[1]),c);continue}t.set(l,e.length),o.set(s,e.length),e.push({text:i,line:a});}return e.filter(i=>i.line.length>=4)}function Sd(n,e){if(n!==2)return null;let t=null,o=0;for(let r of e){if(r.length<4)continue;let i=0;for(let a=0;a+3<r.length;a+=2)i+=Math.hypot(r[a+2]-r[a],r[a+3]-r[a+1]);i>o&&(o=i,t=r);}return t}function Id(n,e){if(!e.length)return null;if(n===1){let a=e[0];return a.length>=2?[a[0],a[1]]:null}if(n===2){let a=-1,l=0,s=0;for(let c of e)for(let h=0;h+3<c.length;h+=2){let u=c[h+2]-c[h],f=c[h+3]-c[h+1],d=u*u+f*f;d>a&&(a=d,l=c[h]+u/2,s=c[h+1]+f/2);}return a>0?[Math.round(l),Math.round(s)]:null}let t=1/0,o=1/0,r=-1/0,i=-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]>i&&(i=a[l+1]);return isFinite(t)?[Math.round((t+r)/2),Math.round((o+i)/2)]:null}function Ld(n){let e=n.rank;return typeof e=="number"&&isFinite(e)?Math.max(0,255-Math.min(e,255)):128}function vi(n,e){let t=Array.isArray(n)?n:[n];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 Xs(n,e){let t=[],o=[];for(let r=0;r<n.length;r++){let i=n.feature(r);if(i.type===1&&Be(e,i.properties))for(let a of i.loadGeometry())for(let l=0;l+1<a.length;l+=2)t.push(a[l],a[l+1]),o.push(i.properties);}return o.length?{anchors:Int16Array.from(t).buffer,props:o}:null}function Td(){let n=typeof self<"u"?self.origin:void 0;return n&&n!=="null"&&!n.startsWith("blob:")?n+"/":void 0}async function js(n,e){let t=performance.now(),o=Td(),r=await fetch(n.url,{signal:e,credentials:"same-origin",...o?{referrer:o}:{}}),i=(g,y,A,B,x=0)=>({type:"loaded",id:n.id,buckets:{},timing:{fetchMs:B,parseMs:x},diag:{status:g,bytes:y,layers:A,built:0}});if(!r.ok){if(r.status===404||r.status===204)return i(r.status,0,[],performance.now()-t);throw new Error(`HTTP ${r.status} \u0434\u043B\u044F ${n.url}`)}let a=await r.arrayBuffer(),l=performance.now()-t;if(a.byteLength===0)return i(r.status,0,[],l);let s=performance.now(),c=new no(a),h=Object.keys(c.layers),u={},f={},d=new Set,p=[],m=n.plan.some(g=>g.type==="surface"&&(g.elevation??0)>0)&&n.plan.some(g=>g.type==="line"&&g.ground)?Sn(n.metersPerTile):void 0;for(let g of n.plan){if(!kd(g,n.zoom,n.sourceMaxZoom))continue;let y=c.layers[g.sourceLayer];if(!y)continue;let A=Pd(n.zoom,y.extent);try{if(g.splitBy){let x=Rd(y,g.splitBy,g.filter);if(!x.length)continue;let w=f[g.splitBy]??(f[g.splitBy]=[]);for(let _ of x){w.includes(_)||w.push(_);let C={...g,splitBy:void 0,filter:Od(g.filter,g.splitBy,_)},v=wi(C,y,A,n.metersPerTile,m);v&&(u[Je(g.id,_)]=v);}continue}if(g.network&&g.type==="line"){for(let x of Gd(y,g.filter)){let w=wi(g,y,A,n.metersPerTile,m,x);w&&(u[Je(g.id,x)]=w,d.add(x));}continue}let B=wi(g,y,A,n.metersPerTile,m);B&&(u[g.id]=B);}catch(B){p.push(`${g.id}: ${B instanceof Error?B.message:String(B)}`);}}return {type:"loaded",id:n.id,buckets:u,...Object.keys(f).length?{splits:f}:{},...d.size?{levels:[...d].sort((g,y)=>g-y)}:{},timing:{fetchMs:l,parseMs:performance.now()-s},diag:{status:r.status,bytes:a.byteLength,layers:h,built:Object.keys(u).length,...p.length?{failed:p}:{}}}}function Hd(n){return e=>{let t=e.on;if(typeof t!="string"||!t)return 0;let o=0;for(let r of t.split(",")){let i=n[r];typeof i=="number"&&i>o&&(o=i);}return o}}function kd(n,e,t){let o=e-1,r=e<t?e+1:24;return !(n.maxzoom<o||n.minzoom>r)}function Pd(n,e){return n<=6?Math.max(64,e/24):0}function wi(n,e,t,o,r,i){{if(n.type==="fill"){let l=o>0?o/e.extent:0,s=n.cornerRadius&&l>0?{radius:n.cornerRadius/l,segments:n.cornerSegments,extent:e.extent,minCutRatio:0,maxChord:ya/l}:void 0,c=fn(e,n.filter,t,s,n.clipToTile===true,e.extent);return c?{kind:"fill",...c,extent:e.extent}:null}if(n.type==="surface"){let l=Dn(e,e.extent,n.filter,{metersPerUnit:o>0?o/e.extent:0,maxSegment:t,elevation:n.elevation??0,base:n.base,bevel:n.bevel,weld:n.weld,bevelDrop:n.bevelDrop,cornerRadius:n.cornerRadius,cornerSegments:n.cornerSegments,...r?{onShapes:s=>In(r,s,n.elevation??0,e.extent)}:{},...n.groundBy?{liftBy:Hd(n.groundBy)}:{}});return l?{kind:"surface",...l}:null}if(n.type==="line"){let l=Tn(e,n.filter,t,n.ground?r:void 0,o>0?o/e.extent:0,{level:i});return l?{kind:"line",...l,extent:e.extent}:null}if(n.type==="model"){let l=Xs(e,n.filter);return l?{kind:"placement",...l,extent:e.extent}:null}if(n.type==="symbol"){let l=xi(e,{filter:n.filter,textField:n.textField,iconImage:n.iconImage,iconRotate:n.iconRotate,textPlacement:n.textPlacement,abbreviate:n.abbreviate});return l?{kind:"symbol",...l,extent:e.extent}:null}let a=ln(e,e.extent,n.filter,{metersPerUnit:o>0?o/e.extent:0,cornerRadius:n.cornerRadius,cornerSegments:n.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 Rd(n,e,t){let o=[];for(let r of n.features()){if(!Be(t,r.properties))continue;let i=r.properties[e];typeof i!="string"&&typeof i!="number"||o.includes(i)||o.push(i);}return o.sort((r,i)=>typeof r=="number"&&typeof i=="number"?r-i:String(r).localeCompare(String(i))),o}function Gd(n,e){let t=[];for(let o of n.features()){if(!Be(e,o.properties))continue;let r=gt(o.properties);t.includes(r)||t.push(r);}return t.sort((o,r)=>o-r)}function Od(n,e,t){let o=["==",e,t];return n?["all",n,o]:o}var _i='"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 kr=class{constructor(e=Ei()){this.workers=[];this.blobUrl=null;this.pending=new z;this.nextId=1;this.cursor=0;this.mainThreadAborts=new z;this.destroyed=false;try{let t=new Blob([_i],{type:"text/javascript"});this.blobUrl=URL.createObjectURL(t);for(let o=0;o<e;o++){let r=new Worker(this.blobUrl);r.onmessage=i=>this.onMessage(i.data),r.onerror=i=>console.error("[osmgl] \u0432\u043E\u0440\u043A\u0435\u0440 \u0443\u043F\u0430\u043B:",i.message),this.workers.push(r);}}catch(t){console.warn("[osmgl] \u0432\u043E\u0440\u043A\u0435\u0440\u044B \u043D\u0435\u0434\u043E\u0441\u0442\u0443\u043F\u043D\u044B, \u0440\u0430\u0437\u0431\u043E\u0440 \u0442\u0430\u0439\u043B\u043E\u0432 \u043F\u043E\u0439\u0434\u0451\u0442 \u0432 \u0433\u043B\u0430\u0432\u043D\u043E\u043C \u043F\u043E\u0442\u043E\u043A\u0435:",t),this.disposeWorkers();}this.usingWorkers=this.workers.length>0;}get size(){return this.workers.length}load(e,t){let o=this.nextId++,r={type:"load",id:o,...e};if(!this.usingWorkers){let a=new AbortController;return this.mainThreadAborts.set(o,a),js(r,a.signal).then(l=>{this.mainThreadAborts.has(o)&&(this.mainThreadAborts.delete(o),t(l));}).catch(l=>{let s=a.signal.aborted;this.mainThreadAborts.delete(o),t({type:"error",id:o,message:l instanceof Error?l.message:String(l),aborted:s});}),o}let i=this.cursor++%this.workers.length;return this.pending.set(o,{resolve:t,workerIndex:i}),this.workers[i].postMessage(r),o}abort(e){if(!this.usingWorkers){this.mainThreadAborts.get(e)?.abort(),this.mainThreadAborts.delete(e);return}let t=this.pending.get(e);if(!t)return;this.pending.delete(e);let o={type:"abort",id:e};this.workers[t.workerIndex].postMessage(o);}onMessage(e){if(this.destroyed)return;let t=this.pending.get(e.id);t&&(this.pending.delete(e.id),t.resolve(e));}disposeWorkers(){for(let e of this.workers)e.terminate();this.workers=[],this.blobUrl&&URL.revokeObjectURL(this.blobUrl),this.blobUrl=null;}destroy(){this.destroyed=true;for(let e of this.mainThreadAborts.values())e.abort();this.mainThreadAborts.clear(),this.pending.clear(),this.disposeWorkers();}};function Ei(){let n=typeof navigator<"u"&&navigator.hardwareConcurrency||4;return Math.max(1,Math.min(n-1,6))}function Ys(n){return Math.max(0,Math.ceil((n*Math.LN2+Math.log(512/360/.5))/Math.LN10))}function Mi(n,e){let t=Ys(n.zoom),o=[Math.round(n.zoom*100)/100,n.center.lat.toFixed(t),n.center.lng.toFixed(t)],r=Math.round(n.bearing*10)/10,i=Math.round(n.pitch*10)/10;(r!==0||i!==0)&&(o.push(r),i!==0&&o.push(i));let a=o.join("/");return e?`${e}=${a}`:a}function Fi(n,e){let t=n.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]),i=Number(o[1]),a=Number(o[2]);if(!isFinite(r)||!isFinite(i)||!isFinite(a)||Math.abs(i)>90||Math.abs(a)>180)return null;let l={center:{lng:a,lat:i},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 Zs(n){if(typeof window>"u"||!window.history?.replaceState)return;let e=new URL(window.location.href);e.hash=n,window.history.replaceState(window.history.state,"",e.toString());}var Qs={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}},Ut=n=>Qs[n]??Qs.high;function Pr(n){let{cores:e,memory:t,mobile:o,devicePixelRatio:r}=n;return e<=2||t!==void 0&&t<=2?"minimal":o?e<=4||t!==void 0&&t<=3?"minimal":e<=6||t!==void 0&&t<=4||r>=3?"low":"balanced":e<=4||t!==void 0&&t<=4?"balanced":"high"}function Rr(){if(typeof navigator>"u")return {cores:4,mobile:false,devicePixelRatio:1};let n=navigator,e=typeof matchMedia=="function"&&matchMedia("(pointer: coarse)").matches&&typeof screen<"u"&&Math.min(screen.width,screen.height)<=820,t=n.userAgentData?.mobile===true||e;return {cores:n.hardwareConcurrency||4,memory:n.deviceMemory,mobile:t,devicePixelRatio:typeof devicePixelRatio=="number"?devicePixelRatio:1}}function Di(n,e,t,o){let r=Math.min(t||1,o.maxPixelRatio),i=Math.max(n*e,1),a=Math.sqrt(o.maxCanvasPixels/i);return Math.max(Math.min(r,a),1)}function Si(n){return n==="high"?3:n==="balanced"?2:n==="low"?1:0}function qs(n){return n==="minimal"?"low":n==="low"?"balanced":n==="balanced"?"high":null}function Ii(n){return n==="high"?"balanced":n==="balanced"?"low":n==="low"?"minimal":null}var zd=1,Po=class{constructor(e){this.originX=0;this.originY=0;this._revision=0;this.id=e.id??`obj-${zd++}`,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,i=-1/0;for(let a of e)for(let l of a){let s=$(l),c=ne(s.lng),h=ie(s.lat);c<t&&(t=c),c>r&&(r=c),h<o&&(o=h),h>i&&(i=h);}if(!isFinite(t)){this.originX=0,this.originY=0;return}this.originX=(t+r)/2,this.originY=(o+i)/2;}toLocal(e){let t=[];for(let o of e){let r=$(o);t.push(ne(r.lng)-this.originX,ie(r.lat)-this.originY);}return t}color(e,t){let o=he(this.paint[e]??t),r=this.paint.opacity??1;return [o[0],o[1],o[2],o[3]*r]}linePaint(e){return e.dashArray=this.paint.dashArray,e.offset=this.paint.offset,this.paint.arrow&&(e.arrow=true,e.arrowColor=this.color("arrowColor","#ffffff"),e.arrowPeriod=this.paint.arrowPeriod??46,e.arrowSize=this.paint.arrowSize??5),e}},Ti=class extends Po{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=go([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 i=this.colorRuns();if(!i.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 i){let s=go([this.toLocal(this.coordinates.slice(l.from,l.to+1))]);if(!s)continue;let c=he(l.color);o.push(this.linePaint({kind:"line",mesh:s,color:[c[0],c[1],c[2],c[3]*a],width:t}));}return o}colorRuns(){if(this.segments.length===0||this.coordinates.length<2)return [];let e=this.coordinates.length-1,t=this.segments.filter(r=>Number.isInteger(r.at)&&r.at>=0&&r.at<e).sort((r,i)=>r.at-i.at);if(!t.length)return [];let o=[];for(let r=0;r<t.length;r++){let i=r===0?0:t[r].at,a=r+1<t.length?t[r+1].at:e;a>i&&o.push({from:i,to:a,color:t[r].color});}return o}hitTest(e,t,o){let r=(this.paint.width??6)/2+(this.paint.strokeWidth??0)+o,i=ki(this.coordinates,this.altitude,t);for(let a=0;a+1<i.length;a++)if($s(e,i[a],i[a+1])<=r)return true;return false}},Gr=class extends Po{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=Zn(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(Li(a))),i=go(r);i&&e.push(this.linePaint({kind:"line",mesh:i,color:this.color("strokeColor","#2f6df6"),width:o}));}return e}hitTest(e,t){let o=ki(Li(this.coordinates[0]??[]),this.altitude,t);if(!Pi(e,o))return false;for(let r=1;r<this.coordinates.length;r++)if(Pi(e,ki(Li(this.coordinates[r]),this.altitude,t)))return false;return true}},Hi=class extends Gr{constructor(e){super({...e,coordinates:[Vd(e.center,e.radius,e.segments)]});}};function Vd(n,e,t){let o=$(n),r=e/Oe(o.lat),i=ne(o.lng),a=ie(o.lat),l=Math.max(12,t??Math.min(128,Math.round(24+e/20))),s=[];for(let c=0;c<l;c++){let h=c/l*Math.PI*2;s.push([Se(i+Math.cos(h)*r),Fe(a+Math.sin(h)*r)]);}return s}function ki(n,e,t){let o=[];for(let r of n){let i=$(r),a=t(i.lng,i.lat,e);a&&o.push(a);}return o}function Li(n){if(n.length<2)return n;let e=$(n[0]),t=$(n[n.length-1]);return e.lng===t.lng&&e.lat===t.lat?n:[...n,n[0]]}function $s(n,e,t){let o=t.x-e.x,r=t.y-e.y,i=o*o+r*r;if(i<1e-12)return Math.hypot(n.x-e.x,n.y-e.y);let a=((n.x-e.x)*o+(n.y-e.y)*r)/i;return a=a<0?0:a>1?1:a,Math.hypot(n.x-(e.x+a*o),n.y-(e.y+a*r))}function Pi(n,e){let t=false;for(let o=0,r=e.length-1;o<e.length;r=o++){let i=e[o].x,a=e[o].y,l=e[r].x,s=e[r].y;a>n.y!=s>n.y&&n.x<(l-i)*(n.y-a)/(s-a)+i&&(t=!t);}return t}var ec="objects3d",Jt="level",Wd=32,Nd=100,Ri=120,Kd=40,Ud=.35,Jd=.02,Xd=150,jd=250;function tc(n){return typeof n=="number"?{top:n,right:n,bottom:n,left:n}:{top:n?.top??0,right:n?.right??0,bottom:n?.bottom??0,left:n?.left??0}}function Yd(n){let e={...n};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 Gi=class extends qe{constructor(t){super();this.options=t;this.transform=new Yt;this.ctx=null;this.sources=new z;this.rasterSources=new z;this.renderer=new wo;this.objects=new Ao;this.markerHost=null;this.gestures=null;this.resizeObserver=null;this.frameHandle=0;this.needsRepaint=true;this.padding={top:0,right:0,bottom:0,left:0};this.animation=null;this.loaded=false;this.destroyed=false;this.objects3d=null;this.objects3dEnabled=true;this.frameRing=new Uint8Array(Ri);this.ringAt=0;this.ringSum=0;this.ringFilled=0;this.steadyFrames=0;this.lastFrameAt=0;this.continuousFrames=0;this.onHashChange=null;this.lastMoveEmit=0;this.lastIndoorKey="";this.writingHash=false;this.hashTimer=0;this.layerOverrides=new 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?Pr(Rr()):t.quality;this.qualityCeiling=r,this.quality=Ut(r),this.densityQuality=this.quality,this.maxPixelRatio=t.maxPixelRatio??this.quality.maxPixelRatio,this._style=new Tt(t.theme?mr(t.theme,t.style):t.style),this.background=t.background?he(t.background):null,this.canvas=document.createElement("canvas"),this.canvas.style.width="100%",this.canvas.style.height="100%",this.canvas.style.display="block",this.canvas.style.outline="none",getComputedStyle(this.container).position==="static"&&(this.container.style.position="relative"),this.container.appendChild(this.canvas);let i=document.createElement("div");i.className="osmgl-markers",i.style.cssText="position:absolute;inset:0;overflow:hidden;pointer-events:none",this.container.appendChild(i),this.markerHost=i,this.objects.setMarkerHost(i);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=$(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 kr(t.workerCount??Math.min(Ei(),this.quality.maxWorkers)),this.initGL(),this.initSource(),this.initInput(),this.initResize(),queueMicrotask(()=>{this.destroyed||(this.loaded=true,this.emit("load",void 0),this.triggerRepaint());});}initGL(){let t=this.canvas.getContext("webgl2",{alpha:false,antialias:this.quality.antialias,depth:true,stencil:true,preserveDrawingBuffer:false,powerPreference:"high-performance",failIfMajorPerformanceCaveat:false});if(!t)throw new Error("[osmgl] WebGL2 \u043D\u0435\u0434\u043E\u0441\u0442\u0443\u043F\u0435\u043D \u0432 \u044D\u0442\u043E\u043C \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435");this.ctx=new Wo(t);let o=new Vt(this.options.fonts??"/tileserver/fonts/{fontstack}/{range}.pbf",this.options.fontstack);this.options.icons&&o.icons.setIcons({...yt,...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 Hr({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:ec,type:"model",sourceLayer:t.sourceLayer??"model3d",minzoom:0,maxzoom:24}}planFor(t,o=this._style){let r=o.workerPlan(t),i=t===this.objects3dSource?[...r,this.objects3dPlan()]:r;return this.quality.simpleGeometry?i.map(Yd):i}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 i=this.venuesForMask();t.update({id:ec,"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(),i),this.renderer.hiddenBuildings=t.replacedBuildings,this.renderer.hiddenVenues=t.replacedVenues,this.renderer.hiddenVenueLayer=i?.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(Ze(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===Jt&&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 i=this.sources.get(r),a=this._style.bucketKeyFor(o);if(i&&a!==null)return {source:i,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 i=new Io({url:o.url,minzoom:o.minzoom??0,maxzoom:o.maxzoom??19,cacheSize:this.quality.tileCacheSize*2});return i.on("data",()=>this.triggerRepaint()),i.on("error",({message:a})=>this.emit("error",{message:a})),this.rasterSources.set(t,i),this.triggerRepaint(),this}let r=new Dr(this.pool,{url:o.url,minzoom:o.minzoom??0,maxzoom:o.maxzoom??14,cacheSize:this.quality.tileCacheSize*2,plan:this.planFor(t)});return r.on("data",()=>this.triggerRepaint()),r.on("error",({message:i})=>this.emit("error",{message:i})),t===Y&&r.on("idle",()=>this.emit("idle",void 0)),this.sources.set(t,r),this.triggerRepaint(),this}initInput(){this.gestures=new Zo(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 i=t;if(t=null,r.button!==0||!i||Math.hypot(r.clientX-i.x,r.clientY-i.y)>4||performance.now()-i.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),h=s||c?null:this.queryBuilding(l);this.options.highlightBuildings!==false&&(this.setHighlight(h),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:h,symbol:this.querySymbol(l,4)});}),this.canvas.addEventListener("dblclick",r=>{let i=this.pointOf(r);this.emit("dblclick",{point:i,lngLat:this.transform.unproject(i)});}),this.canvas.addEventListener("contextmenu",r=>{r.preventDefault();let i=this.pointOf(r);this.emit("contextmenu",{point:i,lngLat:this.transform.unproject(i)});});let o=0;this.canvas.addEventListener("pointermove",r=>{if(r.pointerType==="touch")return;let i=performance.now();if(i-o<16)return;o=i;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=Di(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=$(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=$(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,i={center:r.center,zoom:r.zoom,bearing:r.bearing,pitch:r.pitch},l={center:t.center!==void 0?$(t.center):r.center,zoom:t.zoom??r.zoom,bearing:i.bearing+Bt((t.bearing??r.bearing)-i.bearing),pitch:t.pitch??r.pitch};return this.animation={start:performance.now(),duration:o,from:i,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?$(t.center):o.center,zoom:t.zoom??o.zoom,bearing:r.bearing+Bt((t.bearing??o.bearing)-r.bearing),pitch:t.pitch??o.pitch},l=$e(r.zoom),s=(ne(a.center.lng)-ne(r.center.lng))*l,c=(ie(a.center.lat)-ie(r.center.lat))*l,h=Math.hypot(s,c),u=Math.max(o.width,o.height),f=u*Math.pow(2,r.zoom-a.zoom),d=1.42,p=d*d,b,m=null;if(h<1e-6){let y=Math.log(f/u);b=Math.abs(y)/d,m=A=>({u:0,w:u*Math.exp(d*Math.sign(y)*A)});}else {let y=C=>{let v=C===0?u:f,E=C===0?f:u;return (E*E-v*v+(C===0?1:-1)*p*p*h*h)/(2*v*p*h)},A=C=>Math.log(-y(C)+Math.sqrt(y(C)*y(C)+1)),B=A(0);b=(A(1)-B)/d;let w=C=>(Math.exp(C)+Math.exp(-C))/2,_=C=>(Math.exp(2*C)-1)/(Math.exp(2*C)+1);m=C=>{let v=d*C+B;return {u:u*w(B)*_(v)/p-u*Math.sinh(B)/p,w:u*w(B)/w(v)}};}if(!Number.isFinite(b)||b<=0)return this.jumpTo(t);let g=t.duration??Math.min(3e3,b/1.2*1e3);return this.animation={start:performance.now(),duration:g,from:r,to:a,fly:{S:b,u1:h,curve:m,w0:u}},this.triggerRepaint(),this}setPadding(t){return this.padding=tc(t),this.renderer.symbols&&(this.renderer.symbols.padding=this.padding),this.triggerRepaint(),this}getPadding(){return {...this.padding}}getBounds(){let t=this.transform,o=new Xt;for(let[r,i]of [[0,0],[t.width,0],[t.width,t.height],[0,t.height]])o.extend(t.unproject({x:r,y:i}));return o}cameraForBounds(t,o={}){let r=this.transform,i=Vr(t,{width:r.width,height:r.height,bearing:o.bearing??r.bearing,padding:o.padding!==void 0?tc(o.padding):this.padding,maxZoom:Math.min(o.maxZoom??r.maxZoom,r.maxZoom),minZoom:r.minZoom});return i?{...i,pitch:o.pitch??r.pitch}:null}fitBounds(t,o={}){let r=this.cameraForBounds(t,o);if(!r)return this;let i={...r,duration:o.duration??600};return o.fly?this.flyTo(i):this.easeTo(i)}stepAnimation(t){let o=this.animation;if(!o)return false;let r=_e((t-o.start)/o.duration,0,1),i=o.fly?r:Vo(r),a=this.transform,l=$(o.from.center),s=$(o.to.center);if(o.fly){let{u:c,w:h}=o.fly.curve(o.fly.S*r),u=o.fly.u1>1e-6?_e(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/h),a.bearing=o.from.bearing+(o.to.bearing-o.from.bearing)*Vo(r),a.pitch=o.from.pitch+(o.to.pitch-o.from.pitch)*Vo(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)*i,lat:l.lat+(s.lat-l.lat)*i},a.zoom=o.from.zoom+(o.to.zoom-o.from.zoom)*i,a.bearing=o.from.bearing+(o.to.bearing-o.from.bearing)*i,a.pitch=o.from.pitch+(o.to.pitch-o.from.pitch)*i,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($(t),o)}unproject(t){return this.transform.unproject(t)}get style(){return this._style}setStyle(t){let o=this._style,r=new Tt(t);Object.assign(r.splitValues,o.splitValues),this._style=r,this.applyLayerOverrides();for(let[i,a]of this.sources.entries()){let l=JSON.stringify(o.workerPlan(i)),s=JSON.stringify(r.workerPlan(i));l!==s&&a.setPlan(this.planFor(i,r));}return this.objects3d?.setModelKey(t.model3dKey??""),this.triggerRepaint(),this}setTheme(t){return this.setStyle(mr(t,this.options.style))}static get themes(){return Object.keys(Ht)}static get themeList(){return Object.entries(Ht).map(([t,o])=>({id:t,name:o.name||t}))}setLayoutProperty(t,o,r){let i=this._style.layers.find(l=>l.id===t);if(!i)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=i.layout??(i.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 i=this._style.layers.find(a=>a.id===t);return i?(i.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:Fe(r.mercY)},key:Vt.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 i=this.sources.get(r.source??Y);if(!i)continue;let a=Xn(this.transform,i,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,i;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),i??(i=this.sources.get(l.source??Y)));}if(!i||!o.length)return null;let a=jn(this.transform,i,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=Mi({center:t.center,zoom:t.zoom,bearing:t.bearing,pitch:t.pitch},this.hashName);this.writingHash=true,Zs("#"+o),setTimeout(()=>this.writingHash=false,0);}applyHash(t){if(typeof window>"u")return;let o=Fi(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"?Pr(Rr()):t;return this.qualityCeiling=o,this.resetFrameWindow(),this.applyQuality(Ut(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,i=o?r:t.simpleGeometry;if(this.quality={...t,simpleGeometry:i},this.resetFrameWindow(),this.objects3d&&(this.objects3d.budgetScale=t.modelBudget),r!==i)for(let[a,l]of this.sources.entries())l.setPlan(this.planFor(a));o||(this.densityQuality=t,this.options.maxPixelRatio===void 0&&(this.maxPixelRatio=t.maxPixelRatio)),this.renderer.detailScale=t.detail,this.renderer.allowShadows=t.allowShadows,this.renderer.shadows.resolution!==t.shadowMapSize&&this.setShadows({resolution:t.shadowMapSize});for(let a of this.sources.values())a.setCoverOptions({detailBias:t.detailBias,maxTiles:t.maxTiles});this.resize();}resetFrameWindow(){this.frameRing.fill(0),this.ringAt=0,this.ringSum=0,this.ringFilled=0,this.steadyFrames=0;}checkFrameBudget(t){if(!this.qualityAuto||this.sum(a=>a.pendingCount)>0)return;let o=t>Nd?3:t>Wd?1:0;if(this.ringSum+=o-this.frameRing[this.ringAt],this.frameRing[this.ringAt]=o,this.ringAt=(this.ringAt+1)%Ri,this.ringFilled<Ri&&this.ringFilled++,this.steadyFrames++,this.ringFilled<Kd)return;let r=this.ringSum/this.ringFilled;if(r>=Ud){let a=Ii(this.quality.name);if(!a)return;console.info(`[osmgl] \u0442\u044F\u0436\u0451\u043B\u044B\u0445 \u043A\u0430\u0434\u0440\u043E\u0432 ${(r*100).toFixed(0)}% \u2014 \u043A\u0430\u0447\u0435\u0441\u0442\u0432\u043E \u043F\u043E\u043D\u0438\u0436\u0435\u043D\u043E \u0434\u043E \xAB${a}\xBB (\u043F\u043B\u043E\u0442\u043D\u043E\u0441\u0442\u044C \u0431\u0443\u0444\u0435\u0440\u0430 \u043F\u0440\u0435\u0436\u043D\u044F\u044F)`),this.applyQuality(Ut(a),true);return}if(r>Jd||this.steadyFrames<Xd)return;let i=qs(this.quality.name);!i||Si(i)>Si(this.qualityCeiling)||(console.info(`[osmgl] \u043A\u0430\u0434\u0440\u044B \u0443\u043A\u043B\u0430\u0434\u044B\u0432\u0430\u044E\u0442\u0441\u044F \u0432 \u0431\u044E\u0434\u0436\u0435\u0442 \u2014 \u043A\u0430\u0447\u0435\u0441\u0442\u0432\u043E \u043F\u043E\u0434\u043D\u044F\u0442\u043E \u0434\u043E \xAB${i}\xBB`),this.applyQuality(Ut(i),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(i=>i.id===t);return r&&(r.visible=o,this.rememberOverride(t,{visible:o}),this.triggerRepaint()),this}setObjects3DEnabled(t){return this.objects3dEnabled===t?this:(this.objects3dEnabled=t,this.triggerRepaint(),this)}get objects3DEnabled(){return this.objects3dEnabled}rasterLayerVisible(t){let o=this.transform.zoom;return this._style.layers.some(r=>r.type==="raster"&&r.source===t&&this._style.layerVisibleAt(r,o))}rememberOverride(t,o){let r=this.layerOverrides.get(t)??{};this.layerOverrides.set(t,{...r,...o,paint:{...r.paint??{},...o.paint??{}},layout:{...r.layout??{},...o.layout??{}}});}applyLayerOverrides(){if(this.layerOverrides.size)for(let t of this._style.layers){let o=this.layerOverrides.get(t.id);if(o&&(o.visible!==void 0&&(t.visible=o.visible),o.paint&&Object.assign(t.paint??(t.paint={}),o.paint),o.layout)){let r=t;Object.assign(r.layout??(r.layout={}),o.layout);}}}setBackground(t){return this.background=he(t),this.triggerRepaint(),this}getIndoorLevels(){let t=[];for(let[o,r]of this.sources.entries())if(this._style.layers.some(i=>(i.source??Y)===o&&"splitBy"in i&&i.splitBy===Jt))for(let i of r.splitValues(Jt)){let a=Number(i);Number.isFinite(a)&&!t.includes(a)&&t.push(a);}return t.sort((o,r)=>o-r)}getIndoorLevel(){let t=this._style.splitValues[Jt];return typeof t=="number"?t:null}setIndoorLevel(t){return t===null?delete this._style.splitValues[Jt]:this._style.splitValues[Jt]=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(i=>i>=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 ko)}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(),i=t==="globe"?Math.min(o.maxPitch,jt):o.maxPitch,a=o.zoom<r,l=o.pitch>i;return a||l?this.easeTo({zoom:a?r:o.zoom,pitch:l?i: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,i){let a=this.ctx;if(!a||!a.caps.colorBufferFloat)return null;let l=a.gl,s=this.canvas.width,c=this.canvas.height,h=!!l.getExtension("EXT_float_blend"),u=h?l.RGBA32F:l.RGBA16F,f=h?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 d=l.createTexture(),p=l.createFramebuffer(),b=l.createRenderbuffer();if(!d||!p||!b)return null;l.bindTexture(l.TEXTURE_2D,d),l.texImage2D(l.TEXTURE_2D,0,u,s,c,0,l.RGBA,f,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,b),l.renderbufferStorage(l.RENDERBUFFER,l.DEPTH24_STENCIL8,s,c),l.bindRenderbuffer(l.RENDERBUFFER,null),l.bindFramebuffer(l.FRAMEBUFFER,p),l.framebufferTexture2D(l.FRAMEBUFFER,l.COLOR_ATTACHMENT0,l.TEXTURE_2D,d,0),l.framebufferRenderbuffer(l.FRAMEBUFFER,l.DEPTH_STENCIL_ATTACHMENT,l.RENDERBUFFER,b);let m=l.checkFramebufferStatus(l.FRAMEBUFFER);if(l.bindFramebuffer(l.FRAMEBUFFER,null),a.invalidateState(),m!==l.FRAMEBUFFER_COMPLETE)return null;this.debugFB={fb:p,tex:d,rb:b,w:s,h:c};}a.screen=this.debugFB.fb;try{this.renderFrame(performance.now()),a.bindFramebuffer(this.debugFB.fb);let d=new Float32Array(r*i*4);return l.readPixels(t,o,r,i,l.RGBA,l.FLOAT,d),{data:d,format:h?"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),i=this.ctx;i.bindFramebuffer(null),i.viewport(0,0,this.canvas.width,this.canvas.height),i.setDepthMask(true),i.clear(this.background??this._style.background,true,true);for(let d of this.sources.values())d.update(this.transform);this.updateObjects3D();for(let[d,p]of this.rasterSources)this.rasterLayerVisible(d)&&p.update(this.transform);this.syncIndoor(),this.objects.updateMarkers(this.transform);let a=(this.sources.size>0||this.rasterSources.size>0)&&this.renderer.render(i,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,h=c>0&&c<jd,u=h?c:0;this.continuousFrames=h?this.continuousFrames+1:0;let f=this.continuousFrames>1?c:l;this.lastFrameAt=t,this.checkFrameBudget(f),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();}}},d2=Gi;
|
|
2308
|
+
exports.AssetLoader=Lo;exports.BASE_SOURCE=Y;exports.BUILDING_HEIGHT_SCALE=Et;exports.BUILDING_POS_SCALE=_t;exports.BUILDING_VERTEX_STRIDE=Ie;exports.CITY_STYLE=Ju;exports.Circle=Hi;exports.DEFAULT_ICONS=yt;exports.DEFAULT_LIGHT=kn;exports.DEFAULT_SHADOWS=Ms;exports.DEFAULT_SKY=Hn;exports.DEFAULT_STYLE=Pn;exports.DepthTarget=ho;exports.EARTH_CIRCUMFERENCE=No;exports.FILL_VERTEX_STRIDE=et;exports.GLOBE_MAX_PITCH=jt;exports.GLOBE_ZOOM_MAX=ct;exports.GLOBE_ZOOM_MIN=Jo;exports.GLYPH_BORDER=Ce;exports.GLYPH_SIZE=Qe;exports.GROUND_SCALE=su;exports.GeomType=io;exports.GlyphSource=Eo;exports.GroundArrows=mo;exports.IconSource=Fo;exports.IndoorMask=bo;exports.LEVEL_LIMIT=fu;exports.LINE_VERTEX_STRIDE=rt;exports.LayerRenderer=wo;exports.LngLatBounds=Xt;exports.MAX_LATITUDE=zi;exports.MODEL_VERTEX_STRIDE=vr;exports.Map=Gi;exports.MapObject=Po;exports.Marker=Ho;exports.Model=To;exports.ModelLayer=it;exports.ObjectManager=Ao;exports.Polygon=Gr;exports.Polyline=Ti;exports.Popup=ko;exports.RELIEF_STYLE=Uu;exports.RUNTIME_FILL_STRIDE=Yn;exports.RUNTIME_LINE_STRIDE=Pt;exports.RasterSource=Io;exports.RasterTile=Sr;exports.SDF_EDGE=si;exports.SDF_PX=Mo;exports.SOFT_STYLE=Ku;exports.SPLIT_SEP=Dl;exports.SURFACE_CUT_BLEED=fo;exports.SURFACE_LEVEL_SCALE=Xa;exports.SURFACE_VERTEX_STRIDE=St;exports.SdfAtlas=_o;exports.Style=Tt;exports.SymbolRenderer=Vt;exports.THEMES=Ht;exports.TILE_SIZE=st;exports.TileID=Nt;exports.Transform=Yt;exports.VectorTile=no;exports.VectorTileFeature=rr;exports.VectorTileLayer=nr;exports.abbreviateStreet=Ci;exports.addGround=In;exports.altitudeFromMercatorZ=rp;exports.applyTheme=pr;exports.arrowLabelOffset=zs;exports.arrowVertices=rh;exports.buildRuntimeFill=Zn;exports.buildRuntimeLine=go;exports.cameraForBounds=Vr;exports.circumferenceAtLatitude=Oe;exports.clampLat=Ko;exports.clampPixelRatio=Di;exports.clipLineToRect=ui;exports.coordinateDigits=Ys;exports.coveringTiles=So;exports.createGround=Sn;exports.default=d2;exports.deviceHints=Rr;exports.distToSegment=$s;exports.evaluateColor=He;exports.evaluateNumber=V;exports.extractFeature=Ar;exports.featureLevel=gt;exports.fillFootprint=Wn;exports.fogPlanes=kt;exports.footprintOf=Nn;exports.formatHash=Mi;exports.generateBuildings=ln;exports.generateFill=fn;exports.generateLine=Tn;exports.generateSurface=Dn;exports.generateSymbols=xi;exports.globeBasis=Jr;exports.globeFlatMix=jo;exports.globeRadius=Xo;exports.globeToLocal=ji;exports.groundAt=hr;exports.iconRotation=Vs;exports.insideFootprint=Ze;exports.latFromMercatorY=Fe;exports.lngFromMercatorX=Se;exports.lngLatToUnit=Yo;exports.matchesFilter=Be;exports.mercatorMetersPerTile=zr;exports.mercatorX=ne;exports.mercatorY=ie;exports.mercatorZFromAltitude=Or;exports.metersPerPixel=ip;exports.metersPerTile=Vi;exports.nextQualityDown=Ii;exports.parseGlb=_h;exports.parseGlbAsync=$n;exports.parseGlyphs=Ds;exports.parseHash=Fi;exports.patchUV=cs;exports.pickBuilding=Xn;exports.pickFill=jn;exports.pitchIntent=ta;exports.pixelsPerMeter=np;exports.placeAlongLine=di;exports.pointInRing=Pi;exports.qualityFor=Pr;exports.qualityProfile=Ut;exports.raySphere=Xr;exports.resolveTemplate=vi;exports.roundRing=Ke;exports.sdfFromAlpha=ci;exports.shapeText=fi;exports.splitBucketKey=Je;exports.splitByGround=Ln;exports.splitPolygons=dt;exports.styleWithTheme=mr;exports.tileOriginMeters=Wi;exports.tileUrl=Ws;exports.toLngLat=$;exports.unitToLngLat=Ur;exports.worldSize=$e;Object.defineProperty(exports,'__esModule',{value:true});return exports;})({});//# sourceMappingURL=osmgl.global.js.map
|
|
2015
2309
|
//# sourceMappingURL=osmgl.global.js.map
|