osmgl 0.1.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 +1501 -0
- package/dist/osmgl.cjs +1954 -0
- package/dist/osmgl.cjs.map +1 -0
- package/dist/osmgl.d.cts +5659 -0
- package/dist/osmgl.d.ts +5659 -0
- package/dist/osmgl.global.js +1954 -0
- package/dist/osmgl.js +1954 -0
- package/dist/osmgl.js.map +1 -0
- package/package.json +55 -0
|
@@ -0,0 +1,1954 @@
|
|
|
1
|
+
var OsmGL=(function(exports){'use strict';var Jl=Object.defineProperty;var go=(n,e)=>()=>(n&&(e=n(n=0)),e);var Xl=(n,e)=>{for(var t in e)Jl(n,t,{get:e[t],enumerable:true});};var Nf,el=go(()=>{Nf=(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),h=0;h<f.length;++h){var p=f.charCodeAt(h);d[h]=p>96?p-71:p>64?p-65:p>47?p+4:p>46?63:62;}for(var b=0,h=0;h<f.length;++h)d[b++]=d[h]<60?e[d[h]]:(d[h]-60)*64+d[++h];return d.buffer.slice(0,b)}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,h){var p=t.exports.sbrk,b=p(f.length*4),A=p(d*4),y=new Uint8Array(t.exports.memory.buffer),g=a(f);y.set(g,b),h&&h(b,b,f.length,d);var B=t.exports.meshopt_optimizeVertexFetchRemap(A,b,f.length,d);y=new Uint8Array(t.exports.memory.buffer);var C=new Uint32Array(d);new Uint8Array(C.buffer).set(y.subarray(A,A+d*4)),g.set(y.subarray(b,b+f.length*4)),p(b-p(0));for(var v=0;v<f.length;++v)f[v]=C[f[v]];return [C,B]}function s(f,d,h,p,b){var A=t.exports.sbrk,y=A(d),g=A(p*b),B=new Uint8Array(t.exports.memory.buffer);B.set(a(h),g);var C=f(y,d,g,p,b),v=new Uint8Array(C);return v.set(B.subarray(y,y+C)),A(y-A(0)),v}function c(f){for(var d=0,h=0;h<f.length;++h){var p=f[h];d=d<p?p: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 h=new Uint16Array(f.buffer,f.byteOffset,f.byteLength/2);return new Uint32Array(h)}function m(f,d,h,p,b,A){var y=t.exports.sbrk,g=y(h*p),B=y(h*A),C=new Uint8Array(t.exports.memory.buffer);C.set(a(d),B),f(g,h,p,b,B);var v=new Uint8Array(h*p);return v.set(C.subarray(g,g+h*p)),y(g-y(0)),v}return {ready:o,supported:true,reorderMesh:function(f,d,h){var p=d?h?t.exports.meshopt_optimizeVertexCacheStrip:t.exports.meshopt_optimizeVertexCache:void 0;return l(f,c(f)+1,p)},encodeVertexBuffer:function(f,d,h){i(h>0&&h<=256),i(h%4==0);var p=t.exports.meshopt_encodeVertexBufferBound(d,h);return s(t.exports.meshopt_encodeVertexBuffer,p,f,d,h)},encodeIndexBuffer:function(f,d,h){i(h==2||h==4),i(d%3==0);var p=u(f,h),b=t.exports.meshopt_encodeIndexBufferBound(d,c(p)+1);return s(t.exports.meshopt_encodeIndexBuffer,b,p,d,4)},encodeIndexSequence:function(f,d,h){i(h==2||h==4);var p=u(f,h),b=t.exports.meshopt_encodeIndexSequenceBound(d,c(p)+1);return s(t.exports.meshopt_encodeIndexSequence,b,p,d,4)},encodeGltfBuffer:function(f,d,h,p){var b={ATTRIBUTES:this.encodeVertexBuffer,TRIANGLES:this.encodeIndexBuffer,INDICES:this.encodeIndexSequence};return i(b[p]),b[p](f,d,h)},encodeFilterOct:function(f,d,h,p){return i(h==4||h==8),i(p>=1&&p<=16),m(t.exports.meshopt_encodeFilterOct,f,d,h,p,16)},encodeFilterQuat:function(f,d,h,p){return i(h==8),i(p>=4&&p<=16),m(t.exports.meshopt_encodeFilterQuat,f,d,h,p,16)},encodeFilterExp:function(f,d,h,p){return i(h>0&&h%4==0),i(p>=1&&p<=24),m(t.exports.meshopt_encodeFilterExp,f,d,h,p,h)}}})();});var Kf,tl=go(()=>{Kf=(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(m){i=m.instance,i.exports.__wasm_call_ctors();});function l(m){for(var f=new Uint8Array(m.length),d=0;d<m.length;++d){var h=m.charCodeAt(d);f[d]=h>96?h-71:h>64?h-65:h>47?h+4:h>46?63:62;}for(var p=0,d=0;d<m.length;++d)f[p++]=f[d]<60?o[f[d]]:(f[d]-60)*64+f[++d];return f.buffer.slice(0,p)}function s(m,f,d,h,p,b){var A=i.exports.sbrk,y=d+3&-4,g=A(y*h),B=A(p.length),C=new Uint8Array(i.exports.memory.buffer);C.set(p,B);var v=m(g,d,h,B,p.length);if(v==0&&b&&b(g,y,h),f.set(C.subarray(g,g+d*h)),A(g-A(0)),v!=0)throw new Error("Malformed buffer data: "+v)}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(m,f,d,h,p){s(i.exports.meshopt_decodeVertexBuffer,m,f,d,h,i.exports[c[p]]);},decodeIndexBuffer:function(m,f,d,h){s(i.exports.meshopt_decodeIndexBuffer,m,f,d,h);},decodeIndexSequence:function(m,f,d,h){s(i.exports.meshopt_decodeIndexSequence,m,f,d,h);},decodeGltfBuffer:function(m,f,d,h,p,b){s(i.exports[u[p]],m,f,d,h,i.exports[c[b]]);}}})();});var Uf,ol=go(()=>{Uf=(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),h=0;h<f.length;++h){var p=f.charCodeAt(h);d[h]=p>96?p-71:p>64?p-65:p>47?p+4:p>46?63:62;}for(var b=0,h=0;h<f.length;++h)d[b++]=d[h]<60?e[d[h]]:(d[h]-60)*64+d[++h];return d.buffer.slice(0,b)}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 h=t.exports.sbrk,p=h(f.length*4),b=h(d*4),A=new Uint8Array(t.exports.memory.buffer),y=a(f);A.set(y,p);var g=t.exports.meshopt_optimizeVertexFetchRemap(b,p,f.length,d);A=new Uint8Array(t.exports.memory.buffer);var B=new Uint32Array(d);new Uint8Array(B.buffer).set(A.subarray(b,b+d*4)),y.set(A.subarray(p,p+f.length*4)),h(p-h(0));for(var C=0;C<f.length;++C)f[C]=B[f[C]];return [B,g]}function s(f){for(var d=0,h=0;h<f.length;++h){var p=f[h];d=d<p?p:d;}return d}function c(f,d,h,p,b,A,y,g,B){var C=t.exports.sbrk,v=C(4),_=C(h*4),w=C(b*A),x=C(h*4),D=new Uint8Array(t.exports.memory.buffer);D.set(a(p),w),D.set(a(d),x);var I=f(_,x,h,w,b,A,y,g,B,v);D=new Uint8Array(t.exports.memory.buffer);var E=new Uint32Array(I);a(E).set(D.subarray(_,_+I*4));var L=new Float32Array(1);return a(L).set(D.subarray(v,v+4)),C(v-C(0)),[E,L[0]]}function u(f,d,h,p){var b=t.exports.sbrk,A=b(h*p),y=new Uint8Array(t.exports.memory.buffer);y.set(a(d),A);var g=f(A,h,p);return b(A-b(0)),g}var m={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,h,p,b,A){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%h==0),i(h>=3),i(p%3==0);for(var y=0,g=0;g<(A?A.length:0);++g)y|=m[A[g]];var B=f.BYTES_PER_ELEMENT==4?f:new Uint32Array(f),C=c(t.exports.meshopt_simplify,B,f.length,d,d.length,h*4,p,b,y);return C[0]=f instanceof Uint32Array?C[0]:new f.constructor(C[0]),C},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 rl={};Xl(rl,{MeshoptDecoder:()=>Kf,MeshoptEncoder:()=>Nf,MeshoptSimplifier:()=>Uf});var nl=go(()=>{el();tl();ol();});var P=Map,q=Set;var Ne=class{constructor(){this.listeners=new P;}on(e,t){let o=this.listeners.get(e);return o||this.listeners.set(e,o=new q),o.add(t),this}once(e,t){let o=r=>{this.off(e,o),t(r);};return this.on(e,o)}off(e,t){return this.listeners.get(e)?.delete(t),this}emit(e,t){let o=this.listeners.get(e);if(!o)return this;for(let r of [...o])try{r(t);}catch(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 ve=(n,e,t)=>n<e?e:n>t?t:n;var Qe=n=>n*Math.PI/180,Xn=n=>n*180/Math.PI;function lt(n){let e=((n+180)%360+360)%360-180;return e===-180?180:e}var Bo=n=>1-Math.pow(1-n,3);function ce(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 xe(n){return [n[0]*n[3],n[1]*n[3],n[2]*n[3],n[3]]}var Co=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 P;this._stencilTest=false;this.gl=e,this.caps=jl(e),e.enable(e.DEPTH_TEST),this._depthTest=true,e.depthFunc(e.LEQUAL),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,false);}useProgram(e){return this._program===e?false:(this.gl.useProgram(e),this._program=e,true)}bindVAO(e){this._vao!==e&&(this.gl.bindVertexArray(e),this._vao=e);}bindFramebuffer(e){this._framebuffer!==e&&(this.gl.bindFramebuffer(this.gl.FRAMEBUFFER,e),this._framebuffer=e);}bindTexture(e,t,o=this.gl.TEXTURE_2D){this._activeTexture!==e&&(this.gl.activeTexture(this.gl.TEXTURE0+e),this._activeTexture=e),this._boundTextures.get(e)!==t&&(this.gl.bindTexture(o,t),this._boundTextures.set(e,t));}viewport(e,t,o,r){let 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 jl(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 qe=512,vo=40075016686e-3,jn=85.051129;function Z(n){return Array.isArray(n)?{lng:n[0],lat:n[1]}:n}var Ke=n=>512*Math.pow(2,n),wo=n=>Math.max(-jn,Math.min(jn,n));function ee(n){return (180+n)/360}function te(n){let e=wo(n);return (180-180/Math.PI*Math.log(Math.tan(Math.PI/4+e*Math.PI/360)))/360}function De(n){return n*360-180}function _e(n){let e=180-n*360;return 360/Math.PI*Math.atan(Math.exp(e*Math.PI/180))-90}function He(n){return vo*Math.cos(n*Math.PI/180)}function ur(n,e){return n/He(e)}function Fd(n,e){return n*He(e)}function Ed(n,e){return ur(1,n)*Ke(e)}function Md(n,e){return He(n)/Ke(e)}function Yn(n,e){let t=Math.pow(2,n);return He(_e((e+.5)/t))/t}function dr(n){return vo/Math.pow(2,n)}function Zn(n,e,t){let o=dr(n),r=65536;return [(e*o%r+r)%r,(t*o%r+r)%r]}var It=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=Z(e);return this.west=Math.min(this.west,t.lng),this.south=Math.min(this.south,t.lat),this.east=Math.max(this.east,t.lng),this.north=Math.max(this.north,t.lat),this}isEmpty(){return !(this.west<=this.east&&this.south<=this.north)}getCenter(){return {lng:(this.west+this.east)/2,lat:(this.south+this.north)/2}}getSouthWest(){return {lng:this.west,lat:this.south}}getNorthEast(){return {lng:this.east,lat:this.north}}contains(e){let t=Z(e);return t.lng>=this.west&&t.lng<=this.east&&t.lat>=this.south&&t.lat<=this.north}pad(e){if(this.isEmpty())return this;let t=(this.east-this.west)*e,o=(this.north-this.south)*e;return this.west-=t,this.east+=t,this.south-=o,this.north+=o,this}toMercator(){return {minX:ee(this.west),maxX:ee(this.east),minY:te(this.north),maxY:te(this.south)}}};function hr(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,Qn),r=Math.max(e.height-t.top-t.bottom,Qn),i=n.toMercator(),a=e.bearing??0,l=-a*Math.PI/180,s=Math.cos(l),c=Math.sin(l),u=(i.minX+i.maxX)/2,m=(i.minY+i.maxY)/2,f=0,d=0;for(let[g,B]of [[i.minX,i.minY],[i.maxX,i.minY],[i.maxX,i.maxY],[i.minX,i.maxY]]){let C=(g-u)*s-(B-m)*c,v=(g-u)*c+(B-m)*s;f=Math.max(f,Math.abs(C)*2),d=Math.max(d,Math.abs(v)*2);}let h=Math.min(o/Math.max(f,1e-12),r/Math.max(d,1e-12)),p=Math.min(Math.max(Math.log2(h/512),e.minZoom??0),e.maxZoom??22),b=Ke(p),A=(t.left-t.right)/2/b,y=(t.top-t.bottom)/2/b;return {center:{lng:De(u-(A*s+y*c)),lat:_e(m-(-A*c+y*s))},zoom:p,bearing:a}}var Qn=32;function z(){let n=new Float64Array(16);return n[0]=n[5]=n[10]=n[15]=1,n}function Re(n){return n.fill(0),n[0]=n[5]=n[10]=n[15]=1,n}function we(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],u=e[7],m=e[8],f=e[9],d=e[10],h=e[11],p=e[12],b=e[13],A=e[14],y=e[15];for(let g=0;g<4;g++){let B=t[g*4],C=t[g*4+1],v=t[g*4+2],_=t[g*4+3];n[g*4]=B*o+C*l+v*m+_*p,n[g*4+1]=B*r+C*s+v*f+_*b,n[g*4+2]=B*i+C*c+v*d+_*A,n[g*4+3]=B*a+C*u+v*h+_*y;}return n}function Pe(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 Te(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 pr(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],u=e[9],m=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]=l*r+m*o,n[7]=s*r+f*o,n[8]=c*r-i*o,n[9]=u*r-a*o,n[10]=m*r-l*o,n[11]=f*r-s*o,n}function br(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],u=e[5],m=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]=l*r+m*o,n[3]=s*r+f*o,n[4]=c*r-i*o,n[5]=u*r-a*o,n[6]=m*r-l*o,n[7]=f*r-s*o,n}function $n(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 ei(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 ke(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],u=e[8],m=e[9],f=e[10],d=e[11],h=e[12],p=e[13],b=e[14],A=e[15],y=t*l-o*a,g=t*s-r*a,B=t*c-i*a,C=o*s-r*l,v=o*c-i*l,_=r*c-i*s,w=u*p-m*h,x=u*b-f*h,D=u*A-d*h,I=m*b-f*p,E=m*A-d*p,L=f*A-d*b,M=y*L-g*E+B*I+C*D-v*x+_*w;return M?(M=1/M,n[0]=(l*L-s*E+c*I)*M,n[1]=(r*E-o*L-i*I)*M,n[2]=(p*_-b*v+A*C)*M,n[3]=(f*v-m*_-d*C)*M,n[4]=(s*D-a*L-c*x)*M,n[5]=(t*L-r*D+i*x)*M,n[6]=(b*B-h*_-A*g)*M,n[7]=(u*_-f*B+d*g)*M,n[8]=(a*E-l*D+c*w)*M,n[9]=(o*D-t*E-i*w)*M,n[10]=(h*v-p*B+A*y)*M,n[11]=(m*B-u*v-d*y)*M,n[12]=(l*x-a*I-s*w)*M,n[13]=(t*I-o*x+r*w)*M,n[14]=(p*g-h*C-b*y)*M,n[15]=(u*C-m*g+f*y)*M,n):null}function ae(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 Oe(n,e){for(let t=0;t<16;t++)n[t]=e[t];return n}function xo(n){let e=Math.hypot(n[0],n[1],n[2])||1;return [n[0]/e,n[1]/e,n[2]/e]}function qn(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 Yl(n,e){return [n[0]-e[0],n[1]-e[1],n[2]-e[2]]}function mr(n,e){return n[0]*e[0]+n[1]*e[1]+n[2]*e[2]}function ti(n,e,t,o){let r=xo(Yl(t,e)),i=xo(qn(r,o)),a=qn(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]=-mr(i,e),n[13]=-mr(a,e),n[14]=mr(r,e),n[15]=1,n}var St=60,_o=4.5,$e=6,Do=n=>n/(2*Math.PI);function Fo(n){if(n<=_o)return 0;if(n>=$e)return 1;let e=(n-_o)/($e-_o);return e*e*(3-2*e)}function Eo(n,e){let t=n*Math.PI/180,o=wo(e)*Math.PI/180,r=Math.cos(o);return [r*Math.sin(t),-Math.sin(o),r*Math.cos(t)]}function Ar(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 Zl(n,e){return Eo(De(n),_e(e))}function yr(n,e){let t=n*Math.PI/180,o=wo(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 oi(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 Ql(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 ri(n,e,t,o,r,i,a,l){let s=oi(Zl(n,e),r,a);if(l<=0)return s;let c=Ql(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 gr(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 ni=1e3,ql=2,ii=84,$l=.42,Lt=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=Qe(36.87);this._worldSize=512;this._pixelsPerMeter=1;this._cameraToCenterDistance=0;this._centerX=0;this._centerY=0;this._projMatrix=z();this._viewProjPx=z();this._viewMatrix=z();this._pixelMatrix=z();this._pixelMatrixInverse=z();this._cameraPosPx=[0,0,0];this._frustumPlanes=[];this._dirty=true;this.projection="mercator";this._f32=new Float32Array(16);this._tileMatrix=z();this._localView=z();this._localProj=z();this._localPixel=z();this._localPixelInverse=z();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=z();this._shadowView=z();this._shadowProj=z();this._shadowVP=z();this._shadowVPm=z();this._shadowTile=z();this._shadowObject=z();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=$l*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=ve(e,this.effectiveMinZoom(),this.maxZoom);t!==this._zoom&&(this._zoom=t,this._dirty=true);}get bearing(){return this._bearing}set bearing(e){let t=lt(e);t!==this._bearing&&(this._bearing=t,this._dirty=true);}get pitch(){return this._pitch}set pitch(e){let t=this.projection==="globe"&&this._zoom<$e?Math.min(this.maxPitch,St):this.maxPitch,o=ve(e,this.minPitch,t);o!==this._pitch&&(this._pitch=o,this._dirty=true);}get fov(){return Xn(this._fov)}set fov(e){let t=Qe(ve(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=[ee(e.lng)*this._worldSize,te(e.lat)*this._worldSize,t,1],r=[0,0,0,0];ae(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:De(e/this._worldSize),lat:_e(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 ae(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:De(t.x/this._worldSize),lat:_e(t.y/this._worldSize)}}pointToWorldPx(e){this._ensure();let t=[0,0,0,0],o=[0,0,0,0];ae(t,this._pixelMatrixInverse,[e.x,e.y,0,1]),ae(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,u=ve(c,-1e6,1e6);return {x:a.x+(l.x-a.x)*u,y:a.y+(l.y-a.y)*u}}setLocationAtPoint(e,t){if(this._ensure(),this.globeActive){let l=this.globeUnproject(t);if(!l)return;let s=lt(this._center.lng+(e.lng-l.lng)),c=ve(this._center.lat+(e.lat-l.lat),-ii,ii);this._center={lng:s,lat:c},this._dirty=true;return}let o=this.pointToWorldPx(t),r={x:ee(e.lng)*this._worldSize,y:te(e.lat)*this._worldSize},i=r.x-o.x,a=r.y-o.y;this._center={lng:De((this._centerX+i)/this._worldSize),lat:_e((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 Pe(i,this._projMatrix,o.minX*this._worldSize,o.minY*this._worldSize,0),Te(i,i,r,r,1),Oe(this._f32,i)}tileMatrix64(e,t,o=z()){this._ensure();let r=e.bounds(),i=(r.maxX-r.minX)*this._worldSize/t;return Pe(o,this._projMatrix,r.minX*this._worldSize,r.minY*this._worldSize,0),Te(o,o,i,i,1),o}objectMatrix(e,t,o=0){this._ensure();let r=this._objectMatrix;return Pe(r,this._projMatrix,e*this._worldSize,t*this._worldSize,o),Te(r,r,this._worldSize,this._worldSize,1),Oe(this._objectF32,r)}horizonScreenY(){this._ensure();let e=Math.PI/2-Qe(this._pitch),o=this.height/2/Math.tan(this._fov/2)*Math.tan(Math.min(e,Qe(89.5)));return this.height/2-Math.min(o,this.height*50)}get globeActive(){return this._ensure(),this.projection==="globe"&&this._zoom<$e}get globeFlatMix(){return this._ensure(),Fo(this._zoom)}get globeRadiusPx(){return this._ensure(),Do(this._worldSize)}get globeBasis(){return this._ensure(),this._globeBasis}get localProjMatrix(){return this._ensure(),this._localProj}globeCamera(){this._ensure();let e=this.globeRadiusPx,t=z();if(!ke(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];ae(a,this._localPixelInverse,[r,i,0,1]),ae(l,this._localPixelInverse,[r,i,1,1]);let s=a[3]||1e-9,c=l[3]||1e-9,u=l[0]/c-a[0]/s,m=l[1]/c-a[1]/s,f=l[2]/c-a[2]/s,d=Math.hypot(u,m,f)||1;return [u/d,m/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(),Oe(this._localF32,this._localProj)}globeLocal(e,t){return this._ensure(),ri(e,t,this._centerX/this._worldSize,this._centerY/this._worldSize,this.globeRadiusPx,this._worldSize,this._globeBasis,Fo(this._zoom))}localToPoint(e){this._ensure();let t=[0,0,0,0];return ae(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];ae(t,this._localPixelInverse,[e.x,e.y,0,1]),ae(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,u=[s[0]/c,s[1]/c,s[2]/c],m=gr(l,u,a);if(!m)return null;let f=this._globeBasis,d=[m[0]/a,m[1]/a,m[2]/a],h=[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 Ar(h)}isOnGlobeFront(e,t,o=.06){this._ensure();let r=this.globeCamera(),i=this._globeBasis,a=Eo(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)*ql,r=z();if(!ke(r,this._viewProjPx))return;let i=this._cameraPosPx,a=[],l=[0,0,0,0];for(let C of [-1,1])for(let v of [-1,1])for(let _ of [-1,1]){if(ae(l,r,[C,v,_,1]),l[3]===0)continue;let w=l[0]/l[3],x=l[1]/l[3],D=w-i[0],I=x-i[1],E=Math.hypot(D,I);if(E>o){let L=o/E;w=i[0]+D*L,x=i[1]+I*L;}a.push({x:w,y:x,z:0});}if(!a.length)return;let s=xo(e),c=Math.abs(s[2])>.999?[0,1,0]:[0,0,1],u=this._shadowView;ti(u,[this._centerX,this._centerY,0],[this._centerX+s[0],this._centerY+s[1],s[2]],c);let m=Math.min(t*this._pixelsPerMeter,o),f=1/0,d=1/0,h=1/0,p=-1/0,b=-1/0,A=-1/0,y=[0,0,0,0];for(let C of a)for(let v of [0,m])ae(y,u,[C.x,C.y,v,1]),y[0]<f&&(f=y[0]),y[0]>p&&(p=y[0]),y[1]<d&&(d=y[1]),y[1]>b&&(b=y[1]),y[2]<h&&(h=y[2]),y[2]>A&&(A=y[2]);let g=m+1,B=this._shadowProj;ei(B,f,p,d,b,-A-g,-h+g),we(this._shadowVP,B,u),Te(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 Pe(r,this._shadowVPm,e*this._worldSize,t*this._worldSize,o),Te(r,r,this._worldSize,this._worldSize,1),Oe(this._shadowObject32,r)}shadowTileMatrix(e,t){this._ensure();let o=e.bounds(),r=(o.maxX-o.minX)*this._worldSize/t,i=this._shadowTile;return Pe(i,this._shadowVPm,o.minX*this._worldSize,o.minY*this._worldSize,0),Te(i,i,r,r,1),Oe(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=ni*this._pixelsPerMeter;for(let s of this._frustumPlanes){let c=s[0]>0?r:o,u=s[1]>0?a:i,m=s[2]>0?l:0;if(s[0]*c+s[1]*u+s[2]*m+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-ni*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=Ke(this._zoom);this._worldSize=e,this._pixelsPerMeter=ur(1,this._center.lat)*e,this._centerX=ee(this._center.lng)*e,this._centerY=te(this._center.lat)*e;let t=Math.max(this.width,1),o=Math.max(this.height,1),r=Qe(this._pitch),i=-Qe(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(ve(Math.PI-l-s,.01,Math.PI-.01)),u=Math.cos(Math.PI/2-r)*c+a,m=Math.min(u*1.01,a*30),f=o/50;if(this.projection==="globe"&&this._zoom<$e){let y=Do(e);f=Math.max(a-y*1.6,a*.02),m=a+y*2.4;}let d=this._viewMatrix;Te(d,z(),1,-1,1),Pe(d,d,0,0,-a),pr(d,d,r),br(d,d,i),Pe(d,d,-this._centerX,-this._centerY,0);let h=z();$n(h,this._fov,t/o,f,m),we(this._viewProjPx,h,d);let p=z();Te(p,d,1,1,this._pixelsPerMeter),we(this._projMatrix,h,p);let b=this._localView;Te(b,z(),1,-1,1),Pe(b,b,0,0,-a),pr(b,b,r),br(b,b,i),we(this._localProj,h,b),this._globeBasis=yr(this._center.lng,this._center.lat);let A=z();Te(A,z(),t/2,-o/2,1),Pe(A,A,1,-1,0),we(this._pixelMatrix,A,this._projMatrix),ke(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"),we(this._localPixel,A,this._localProj),ke(this._localPixelInverse,this._localPixel),this._calcCameraPosition(),this._calcFrustum();}_calcCameraPosition(){let e=z();if(!ke(e,this._viewMatrix)){this._cameraPosPx=[this._centerX,this._centerY,this._cameraToCenterDistance];return}this._cameraPosPx=[e[12],e[13],e[14]];}_calcFrustum(){let e=z();if(!ke(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 u=[0,0,0,0];ae(u,e,[c,s,l,1]);let m=u[3]||1e-9;t.push([u[0]/m,u[1]/m,u[2]/m]);}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 u=t[l],m=t[s],f=t[c],d=m[0]-u[0],h=m[1]-u[1],p=m[2]-u[2],b=f[0]-u[0],A=f[1]-u[1],y=f[2]-u[2],g=h*y-p*A,B=p*b-d*y,C=d*A-h*b,v=Math.hypot(g,B,C)||1;g/=v,B/=v,C/=v;let _=new Float64Array(4);return _[0]=g,_[1]=B,_[2]=C,_[3]=-(g*u[0]+B*u[1]+C*u[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:ve(t,-3,3),max:ve(o,-3,3)}}};var es={dragPan:true,scrollZoom:true,dragRotate:true,touchZoomRotate:true,touchPitch:true,doubleClickZoom:true,keyboard:true,inertia:1},ai=2,ts=100,os=.5,rs=.1,ns=25,li=n=>Math.abs(n.y)>Math.abs(n.x);function ci(n,e,t){let o=Math.hypot(n.x,n.y)>=ai,r=Math.hypot(e.x,e.y)>=ai;return !o&&!r?void 0:!o||!r?t<ts?void 0:false:n.y>0==e.y>0&&li(n)&&li(e)}function si(n,e){let t=(n-e)*(180/Math.PI);for(;t>180;)t-=360;for(;t<=-180;)t+=360;return t}var is=160,Br=4,Mo=class{constructor(e,t,o,r,i={}){this.canvas=e;this.tr=t;this.onChange=o;this.onInteractionEnd=r;this.pointers=new P;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=ve(-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={...es,...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?ci(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*os,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",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))>=rs&&(e.zoomActive=true),e.zoomActive)){let m=Math.log2(r/u);m!==0&&(this.tr.zoom=this.tr.zoom+m,c="zoom");}if(this.opts.dragRotate){e.minDist=Math.min(e.minDist,r);let m=ns/Math.max(Math.PI*e.minDist,1)*360;if(!e.rotateActive&&Math.abs(si(i,e.startAngle))>=m&&(e.rotateActive=true),e.rotateActive){let f=Math.atan2(e.lastB.y-e.lastA.y,e.lastB.x-e.lastA.x),d=si(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>is;)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>Br&&(r=r/a*Br,i=i/a*Br);let l=performance.now(),s=()=>{if(this.disposed)return;let c=performance.now(),u=Math.min(c-l,34);l=c;let m=Math.exp(-25e-4*u*10);if(r*=m,i*=m,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(s);};this.inertiaRaf=requestAnimationFrame(s);}stopInertia(){this.inertiaRaf&&cancelAnimationFrame(this.inertiaRaf),this.inertiaRaf=0;}destroy(){this.disposed=true,this.stopInertia();let e=this.canvas;e.removeEventListener("pointerdown",this.onPointerDown),e.removeEventListener("pointermove",this.onPointerMove),e.removeEventListener("pointerup",this.onPointerUp),e.removeEventListener("pointercancel",this.onPointerUp),e.removeEventListener("wheel",this.onWheel),e.removeEventListener("contextmenu",this.onContextMenu),e.removeEventListener("keydown",this.onKeyDown),this.pointers.clear();}};var ye=class{constructor(e,t,o,r=false){this.ctx=e;this.layout=o;let 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);}},fe=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);}},le=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 ls=["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"],ue=class{constructor(e,t,o,r,i={}){this.ctx=e;this.name=t;this.uniforms=new P;this.attribs=new P;let a=e.gl,l=ss(i),s=ui(a,a.VERTEX_SHADER,fi(o,l),`${t}.vert`),c=ui(a,a.FRAGMENT_SHADER,fi(r,l),`${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,s),a.attachShader(u,c),ls.forEach((m,f)=>a.bindAttribLocation(u,f,m)),a.linkProgram(u),a.detachShader(u,s),a.detachShader(u,c),a.deleteShader(s),a.deleteShader(c),!a.getProgramParameter(u,a.LINK_STATUS)){let m=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: ${m}`)}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 ss(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 fi(n,e){if(!e)return n;let t=n.match(/^\s*#version[^\n]*\n/);return t?n.slice(0,t[0].length)+e+`
|
|
3
|
+
`+n.slice(t[0].length):`${e}
|
|
4
|
+
${n}`}function ui(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
|
+
${i}
|
|
6
|
+
${cs(t)}`)}return r}function cs(n){return n.split(`
|
|
7
|
+
`).map((e,t)=>`${String(t+1).padStart(4)} | ${e}`).join(`
|
|
8
|
+
`)}var kt=new Set,Cr=false;function Se(n,e,t=2){let o=e&&e.length,r=o?e[0]*t:n.length;kt.size&&kt.clear();let i=pi(n,0,r,t,true),a=[];if(!i||i.next===i.prev)return a;let l=0,s=0,c=0;if(o&&(i=ms(n,e,i,t)),n.length>80*t){l=n[0],s=n[1];let u=l,m=s;for(let f=t;f<r;f+=t){let d=n[f],h=n[f+1];d<l&&(l=d),h<s&&(s=h),d>u&&(u=d),h>m&&(m=h);}c=Math.max(u-l,m-s),c=c!==0?32767/c:0;}return vr(i,a,l,s,c),a}function pi(n,e,t,o,r){let i=null;if(r===Fs(n,e,t,o)>0)for(let a=e;a<t;a+=o)i=mi(a/o|0,n[a],n[a+1],i);else for(let a=t-o;a>=e;a-=o)i=mi(a/o|0,n[a],n[a+1],i);return i&&Gt(i,i.next)&&(Ot(i),i=i.next),i}function tt(n,e=n){let t=e===n,o=n,r;do r=false,o!==o.next&&(kt.size===0||!kt.has(o))&&(Gt(o,o.next)||se(o.prev,o,o.next)===0)?((t||o===e)&&(e=o.prev),Cr=true,Ot(o),o=o.prev,r=true):(t||o!==e)&&(o=o.next,r=!t);while(r||o!==e);return e}function vr(n,e,t,o,r){r&&Cs(n,t,o,r);let i=n,a=false;for(;n.prev!==n.next;){let l=n.prev,s=n.next;if(se(l,n,s)<0&&(r?us(n,t,o,r):fs(n))){e.push(l.i,n.i,s.i),Ot(n),n=s,i=s;continue}if(n=s,n===i){if(Cr=false,n=tt(n),Cr){i=n;continue}if(!a){n=ds(n,e),i=n,a=true;continue}hs(n,e,t,o,r);break}}}function fs(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,u=Math.min(r,i,a),m=Math.min(l,s,c),f=Math.max(r,i,a),d=Math.max(l,s,c),h=o.next;for(;h!==e;){if(h.x>=u&&h.x<=f&&h.y>=m&&h.y<=d&&!(r===h.x&&l===h.y)&&Ho(r,l,i,s,a,c,h.x,h.y)&&se(h.prev,h,h.next)>=0)return false;h=h.next;}return true}function us(n,e,t,o){let r=n.prev,i=n,a=n.next,l=r.x,s=i.x,c=a.x,u=r.y,m=i.y,f=a.y,d=Math.min(l,s,c),h=Math.min(u,m,f),p=Math.max(l,s,c),b=Math.max(u,m,f),A=Dr(d,h,e,t,o),y=Dr(p,b,e,t,o),g=n.prevZ;for(;g&&g.z>=A;){if(g.x>=d&&g.x<=p&&g.y>=h&&g.y<=b&&g!==a&&!(l===g.x&&u===g.y)&&Ho(l,u,s,m,c,f,g.x,g.y)&&se(g.prev,g,g.next)>=0)return false;g=g.prevZ;}let B=n.nextZ;for(;B&&B.z<=y;){if(B.x>=d&&B.x<=p&&B.y>=h&&B.y<=b&&B!==a&&!(l===B.x&&u===B.y)&&Ho(l,u,s,m,c,f,B.x,B.y)&&se(B.prev,B,B.next)>=0)return false;B=B.nextZ;}return true}function ds(n,e){let t=n,o=false;do{let r=t.prev,i=t.next.next;yi(r,t,t.next,i,false)&&Rt(r,i)&&Rt(i,r)&&(e.push(r.i,t.i,i.i),Ot(t),Ot(t.next),t=n=i,o=true),t=t.next;}while(t!==n);return o?tt(t):t}function hs(n,e,t,o,r){let i=n;do{let a=i.next.next;for(;a!==i.prev;){if(i.i!==a.i&&xs(i,a)){let l=gi(i,a);i=tt(i,i.next),l=tt(l,l.next),vr(i,e,t,o,r),vr(l,e,t,o,r);return}a=a.next;}i=i.next;}while(i!==n)}var wr=false;function ms(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=pi(n,l,s,o,false);c===c.next&&kt.add(c),r.push(ws(c));}r.sort(ps),As(n.length/o,e.length),Ai(t,t),wr=true;for(let i=0;i<r.length;i++)t=bs(r[i],t);return wr=false,tt(t)}function ps(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 bs(n,e){let t=gs(n,e);if(!t)return e;let o=gi(t,n),r=o.next;return Ai(t,r.next),tt(o,o.next),tt(t,t.next)}var bi=16,re=new Float64Array(0),Lo=0,xr=[],_r=[];function As(n,e){let t=Math.ceil((n+2*e)/bi)+e+2;re.length<t*4&&(re=new Float64Array(t*4)),Lo=0;}function Ai(n,e){let t=n;do{let o=Lo++;xr[o]=t;let r=1/0,i=1/0,a=-1/0,l=-1/0,s=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>l&&(l=t.y),u.x<r&&(r=u.x),u.x>a&&(a=u.x),u.y<i&&(i=u.y),u.y>l&&(l=u.y),t=u;}while(++s<bi&&t!==e);_r[o]=t;let c=o*4;re[c]=r,re[c+1]=i,re[c+2]=a,re[c+3]=l;}while(t!==e)}function ys(n,e){let t=n.z*4;e.x<re[t]&&(re[t]=e.x),e.y<re[t+1]&&(re[t+1]=e.y),e.x>re[t+2]&&(re[t+2]=e.x),e.y>re[t+3]&&(re[t+3]=e.y);}function di(n){let e=_r[n];for(;e.prev.next!==e;)e=e.next;return _r[n]=e,e}function hi(n){let e=xr[n];for(;e.prev.next!==e;)e=e.next;return xr[n]=e,e}function gs(n,e){let t=e,o=n.x,r=n.y,i=-1/0,a;if(Gt(n,t))return t;for(let f=0,d=0;f<Lo;f++,d+=4){if(r<re[d+1]||r>re[d+3]||re[d]>o||re[d+2]<=i)continue;let h=di(f);t=hi(f);do{if(t.prev.next===t){if(Gt(n,t.next))return t.next;if(r<=t.y&&r>=t.next.y&&t.next.y!==t.y){let p=t.x+(r-t.y)*(t.next.x-t.x)/(t.next.y-t.y);if(p<=o&&p>i&&(i=p,a=t.x<t.next.x?t:t.next,p===o))return a}}t=t.next;}while(t!==h)}if(!a)return null;let l=a.x,s=a.y,c=Math.min(r,s),u=Math.max(r,s),m=1/0;for(let f=0,d=0;f<Lo;f++,d+=4){if(re[d+2]<l||re[d]>o||re[d+3]<c||re[d+1]>u)continue;let h=di(f);t=hi(f);do{if(t.prev.next===t&&o>=t.x&&t.x>=l&&o!==t.x&&Ho(r<s?o:i,r,l,s,r<s?i:o,r,t.x,t.y)){let p=Math.abs(r-t.y)/(o-t.x);(Rt(t,n)||t.y===r&&t.next.y===r&&t.next.x>o)&&(p<m||p===m&&(t.x>a.x||t.x===a.x&&Bs(a,t)))&&(a=t,m=p);}t=t.next;}while(t!==h)}return a}function Bs(n,e){return se(n.prev,n,e.prev)<0&&se(e.next,n,n.next)<0}var Ie=[],Ht=[],et=new Uint32Array(0),Tt=new Uint32Array(0),Pt=new Uint32Array(256);function Cs(n,e,t,o){let r=n,i=0;do r.z=Dr(r.x,r.y,e,t,o),Ie[i++]=r,r=r.next;while(r!==n);vs(i);let a=null;for(let l=0;l<i;l++){let s=Ie[l];s.prevZ=a,a&&(a.nextZ=s),a=s;}a.nextZ=null;}function vs(n){if(n<=32){for(let e=1;e<n;e++){let t=Ie[e],o=t.z,r=e-1;for(;r>=0&&Ie[r].z>o;)Ie[r+1]=Ie[r],r--;Ie[r+1]=t;}return}et.length<n&&(et=new Uint32Array(n),Tt=new Uint32Array(n),Ht=new Array(n));for(let e=0;e<n;e++)et[e]=Ie[e].z;Io(n,Ie,et,Ht,Tt,0),Io(n,Ht,Tt,Ie,et,8),Io(n,Ie,et,Ht,Tt,16),Io(n,Ht,Tt,Ie,et,24);}function Io(n,e,t,o,r,i){Pt.fill(0);for(let l=0;l<n;l++)Pt[t[l]>>>i&255]++;let a=0;for(let l=0;l<256;l++){let s=Pt[l];Pt[l]=a,a+=s;}for(let l=0;l<n;l++){let s=t[l],c=Pt[s>>>i&255]++;o[c]=e[l],r[c]=s;}}function Dr(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 ws(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 Ho(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 xs(n,e){let t=Gt(n,e)&&se(n.prev,n,n.next)>0&&se(e.prev,e,e.next)>0;return n.next.i!==e.i&&(t||Rt(n,e)&&Rt(e,n)&&(se(n.prev,n,e.prev)!==0||se(n,e.prev,e)!==0))&&!_s(n,e)&&(t||Ds(n,e))}function se(n,e,t){return (e.y-n.y)*(t.x-e.x)-(e.x-n.x)*(t.y-e.y)}function Gt(n,e){return n.x===e.x&&n.y===e.y}function yi(n,e,t,o,r=true){let i=se(n,e,t),a=se(n,e,o),l=se(t,o,n),s=se(t,o,e);return (i>0&&a<0||i<0&&a>0)&&(l>0&&s<0||l<0&&s>0)?true:r?!!(i===0&&So(n,t,e)||a===0&&So(n,o,e)||l===0&&So(t,n,o)||s===0&&So(t,e,o)):false}function So(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 _s(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&&yi(a,l,n,e))return true;a=l;}while(a!==n);return false}function Rt(n,e){return se(n.prev,n,n.next)<0?se(n,e,n.next)>=0&&se(n,n.prev,e)>=0:se(n,e,n.prev)<0||se(n,n.next,e)<0}function Ds(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 gi(n,e){let t=Fr(n.i,n.x,n.y),o=Fr(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 mi(n,e,t,o){let r=Fr(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 Ot(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),wr&&ys(n.prev,n.next);}function Fr(n,e,t){return {i:n,x:e,y:t,prev:null,next:null,z:0,prevZ:null,nextZ:null}}function Fs(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 Bi=23283064365386963e-26,Es=12,Ci=typeof TextDecoder>"u"?null:new TextDecoder("utf-8"),Er=0,To=1,Wt=2,Po=5,ot=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,Ms(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>=Es&&Ci?Ci.decode(this.buf.subarray(t,e)):zs(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===Wt?this.readVarint()+this.pos:this.pos+1}skip(e){let t=e&7;if(t===Er)for(;this.buf[this.pos++]>127;);else if(t===Wt)this.pos=this.readVarint()+this.pos;else if(t===Po)this.pos+=4;else if(t===To)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*Bi),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*Bi),true),this.pos+=8;}writeVarint(e){if(e=+e||0,e>268435455||e<0){Is(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=Ns(this.buf,e,this.pos);let o=this.pos-t;o>=128&&vi(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&&vi(o,r,this),this.pos=o-1,this.writeVarint(r),this.pos+=r;}writeMessage(e,t,o){this.writeTag(e,Wt),this.writeRawMessage(t,o);}writePackedVarint(e,t){t.length&&this.writeMessage(e,Hs,t);}writePackedSVarint(e,t){t.length&&this.writeMessage(e,Ts,t);}writePackedBoolean(e,t){t.length&&this.writeMessage(e,Gs,t);}writePackedFloat(e,t){t.length&&this.writeMessage(e,Ps,t);}writePackedDouble(e,t){t.length&&this.writeMessage(e,ks,t);}writePackedFixed32(e,t){t.length&&this.writeMessage(e,Rs,t);}writePackedSFixed32(e,t){t.length&&this.writeMessage(e,Os,t);}writePackedFixed64(e,t){t.length&&this.writeMessage(e,Ws,t);}writePackedSFixed64(e,t){t.length&&this.writeMessage(e,Vs,t);}writeBytesField(e,t){this.writeTag(e,Wt),this.writeBytes(t);}writeFixed32Field(e,t){this.writeTag(e,Po),this.writeFixed32(t);}writeSFixed32Field(e,t){this.writeTag(e,Po),this.writeSFixed32(t);}writeFixed64Field(e,t){this.writeTag(e,To),this.writeFixed64(t);}writeSFixed64Field(e,t){this.writeTag(e,To),this.writeSFixed64(t);}writeVarintField(e,t){this.writeTag(e,Er),this.writeVarint(t);}writeSVarintField(e,t){this.writeTag(e,Er),this.writeSVarint(t);}writeStringField(e,t){this.writeTag(e,Wt),this.writeString(t);}writeFloatField(e,t){this.writeTag(e,Po),this.writeFloat(t);}writeDoubleField(e,t){this.writeTag(e,To),this.writeDouble(t);}writeBooleanField(e,t){this.writeVarintField(e,+t);}};function Ms(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 st(n,r,e);throw new Error("Expected varint not more than 10 bytes")}function st(n,e,t){return t?e*4294967296+(n>>>0):(e>>>0)*4294967296+(n>>>0)}function Is(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),Ss(t,o,e),Ls(o,e);}function Ss(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 Ls(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 vi(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 Hs(n,e){for(let t=0;t<n.length;t++)e.writeVarint(n[t]);}function Ts(n,e){for(let t=0;t<n.length;t++)e.writeSVarint(n[t]);}function Ps(n,e){for(let t=0;t<n.length;t++)e.writeFloat(n[t]);}function ks(n,e){for(let t=0;t<n.length;t++)e.writeDouble(n[t]);}function Gs(n,e){for(let t=0;t<n.length;t++)e.writeBoolean(n[t]);}function Rs(n,e){for(let t=0;t<n.length;t++)e.writeFixed32(n[t]);}function Os(n,e){for(let t=0;t<n.length;t++)e.writeSFixed32(n[t]);}function Ws(n,e){for(let t=0;t<n.length;t++)e.writeFixed64(n[t]);}function Vs(n,e){for(let t=0;t<n.length;t++)e.writeSFixed64(n[t]);}function zs(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,u;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],u=n[r+3],(s&192)===128&&(c&192)===128&&(u&192)===128&&(a=(i&15)<<18|(s&63)<<12|(c&63)<<6|u&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 Ns(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 zt=(r=>(r[r.Unknown=0]="Unknown",r[r.Point=1]="Point",r[r.LineString=2]="LineString",r[r.Polygon=3]="Polygon",r))(zt||{}),ko=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(Ks,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 u=e.readVarint();r=u&7,i=u>>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 Ks(n,e,t){t&&(n===1?e.id=t.readVarint():n===2?Us(t,e):n===3?e.type=t.readVarint():n===4&&(e.geomOffset=t.pos,t.skip(2)));}function Us(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 Go=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(Js,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 ko.read(t,o,this.keys,this.values,this.extent)}*features(){for(let e=0;e<this.featureOffsets.length;e++)yield this.feature(e);}};function Js(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(Xs(t)));}function Xs(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 Vt=class{constructor(e){this.layers={};new ot(e instanceof Uint8Array?e:new Uint8Array(e)).readFields((o,r,i)=>{if(o===3&&i){let a=Go.read(i,i.readVarint()+i.pos);a.length&&(this.layers[a.name]=a);}},null);}};function rt(n){let e=[],t=null;for(let o of n){if(o.length<6)continue;let r=js(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 js(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 O(n,e,t){return n===void 0?t:typeof n=="number"?n:wi(n.stops,e,(o,r,i)=>o+(r-o)*i,t)}function Le(n,e,t){return n===void 0?t:typeof n=="string"?ce(n):wi(n.stops,e,(o,r,i)=>{let a=ce(o),l=ce(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 wi(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],u=a-s,m=u===0?0:(e-s)/u;return t(c,l,m)}return o}function me(n,e){if(!n)return true;let t=n[0];switch(t){case "all":return n.slice(1).every(o=>me(o,e));case "any":return n.slice(1).some(o=>me(o,e));case "!":return !me(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 Ys=Math.PI/8,Zs=.35,Qs=32,xi=.25,_i=.07;function Ge(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??Zs,0),a=e.extent,l=[];for(let s=0;s<o;s++){let c=n[s*2],u=n[s*2+1],m=n[(s+o-1)%o*2],f=n[(s+o-1)%o*2+1],d=n[(s+1)%o*2],h=n[(s+1)%o*2+1],p=c-m,b=u-f,A=d-c,y=h-u,g=Math.hypot(p,b),B=Math.hypot(A,y);if(g<1e-6||B<1e-6){l.push(c,u);continue}let C=p/g,v=b/g,_=A/B,w=y/B;if(e.keep?.[s]){l.push(c,u);continue}let x=C*_+v*w;if(x>.985){l.push(c,u);continue}if(a!==void 0&&(Mr(c,u,a)||Mr(m,f,a)||Mr(d,h,a))){l.push(c,u);continue}let D=Math.min(t,g*.4,B*.4);if(D<t*i){l.push(c,u);continue}let I=c-C*D,E=u-v*D,L=c+_*D,M=u+w*D,S=Math.acos(Math.max(-1,Math.min(1,x))),F=Math.min(Ys,Math.PI/2/r),T=Math.ceil(S/F-1e-6),k=e.maxChord&&e.maxChord>0?Math.ceil(D/Math.tan(S/2)*S/e.maxChord):0,H=Math.max(1,Math.min(Qs,Math.max(Math.min(r,T),k)));l.push(I,E);for(let G=1;G<H;G++){let N=G/H,R=1-N;l.push(R*R*I+2*R*N*c+N*N*L,R*R*E+2*R*N*u+N*N*M);}l.push(L,M);}return l.length<6?n:(l.push(l[0],l[1]),l)}var Mr=(n,e,t)=>n<=0||e<=0||n>=t||e>=t;function ct(n,e){let t=Di(n.outer,e);if(!t)return null;let o=[];for(let r of n.holes){let i=Di(r,e);i&&o.push(i);}return {outer:t,holes:o}}function Di(n,e){let t=[];for(let o=0;o<n.length-2;o+=2)t.push(n[o],n[o+1]);if(t.length<6)return null;for(let o=0;o<4;o++){let r=t;t=[];let i=r.length/2;if(i===0)return null;for(let a=0;a<i;a++){let l=r[a*2],s=r[a*2+1],c=r[(a+i-1)%i*2],u=r[(a+i-1)%i*2+1],m=Fi(l,s,o,e),f=Fi(c,u,o,e);if(m!==f){let d=qs(c,u,l,s,o,e);t.push(c+(l-c)*d,u+(s-u)*d);}m&&t.push(l,s);}}return t.length<6?null:(t.push(t[0],t[1]),t)}function Fi(n,e,t,o){return t===0?n>=0:t===1?n<=o:t===2?e>=0:e<=o}function qs(n,e,t,o,r,i){return r===0?(0-n)/(t-n):r===1?(i-n)/(t-n):r===2?(0-e)/(o-e):(i-e)/(o-e)}function Ro(n,e,t,o,r){return n===0&&t===0||n===r&&t===r||e===0&&o===0||e===r&&o===r}function Ei(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 Fe=18,dt=4,Li=65535/dt,$s=9,ec=1,tc=0,oc=1,rc=2;var Mi=0,nc=1,Ii=2,ic=3,ac=.47;function Lr(n,e,t,o={}){let r=o.metersPerUnit&&o.metersPerUnit>0?o.metersPerUnit:ac,i=Math.max(1024,n.length*48),a=new ArrayBuffer(i*Fe),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*Fe);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||!me(t,f.properties))continue;let d=Fc(f.properties),h=Ec(f.properties,d);if(d<=h)continue;let p=Ic(f.properties)??Number(f.id??0),b=Dc(p>>>0),A=_c(b,f.properties),y=xc(f.properties,d),g=rt(f.loadGeometry());for(let B of g){let C=ct(B,e);if(!C)continue;let v=Ei(C.outer,e),_=(o.cornerRadius??0)/r,w={radius:_,segments:o.cornerSegments,extent:e,minCutRatio:0},x=_>0?{outer:Ge(C.outer,w),holes:C.holes.map(S=>Ge(S,w))}:C,D=x.outer.length/2+x.holes.reduce((S,F)=>S+F.length/2,0);s(D*5+32);let I=x.holes.length||v?null:fc(x.outer),E=I?bc(f.properties,I,d,b,r):null,L=null,M=[];if(E&&I){let S=Hi(gc(x.outer,r),I,E.shape);M=Bc(S,x.outer);let F=Cc(S,M);if(F>1e-6){let T=Math.min(Math.max(F*r*hc,pc),mc);L=vc(S,T/F,d);}}Si(l,x.outer,h,d,p,A,y,r,e,L);for(let S of x.holes)Si(l,S,h,d,p,A,y,r,e,null);L?wc(l,M,L,d,p,A,y,r):cc(l,x.outer,x.holes,d,p,A,y);}}if(!l.indices.length)return null;let c=new Uint32Array(l.indices),u=new Float64Array(l.featureIds);return {vertices:a.slice(0,l.vertOffset),indices:c.buffer,featureIds:u.buffer,vertexCount:l.vertexCount,indexCount:c.length,extent:e}}var Hr=(n,e)=>n|e<<2,Ir=n=>Math.max(0,Math.min(65535,Math.round(Math.min(n,Li)*dt)));function ft(n,e,t,o,r,i,a,l,s,c,u=0,m=0,f=0){let d=n.vertOffset;return n.verts.setInt16(d,Math.round(e),true),n.verts.setInt16(d+2,Math.round(t),true),n.verts.setUint16(d+4,Math.round(Math.min(o,Li)*dt),true),n.vertsU8[d+6]=s,n.vertsU8[d+7]=l,n.verts.setInt8(d+8,Sr(Math.round(r*127))),n.verts.setInt8(d+9,Sr(Math.round(i*127))),n.verts.setInt8(d+10,Sr(Math.round(a*127))),n.vertsU8[d+11]=c,n.verts.setUint16(d+12,Ir(u),true),n.verts.setUint16(d+14,Ir(m),true),n.verts.setUint16(d+16,Ir(f),true),n.vertOffset+=Fe,n.vertexCount++}function Si(n,e,t,o,r,i,a,l,s,c=null){let u=e.length/2;if(u<3)return;let m=Hr(tc,a),f=sc(e,l),d=o-t,h=new Float64Array(u*2),p=new Uint8Array(u);{let b=new Float64Array(u*2);for(let A=0;A<u-1;A++){let y=e[A*2+2]-e[A*2],g=e[A*2+3]-e[A*2+1],B=Math.hypot(y,g)||1;b[A*2]=g/B,b[A*2+1]=-y/B;}for(let A=0;A<u-1;A++){let y=(A+u-2)%(u-1),g=b[y*2]*b[A*2]+b[y*2+1]*b[A*2+1],B=b[y*2]+b[A*2],C=b[y*2+1]+b[A*2+1],v=Math.hypot(B,C);g>.5&&v>1e-6&&(h[A*2]=B/v,h[A*2+1]=C/v,p[A]=1);}}for(let b=0;b<u-1;b++){let A=e[b*2],y=e[b*2+1],g=e[b*2+2],B=e[b*2+3];if(A===g&&y===B||Ro(A,y,g,B,s))continue;let C=g-A,v=B-y,_=Math.hypot(C,v)||1,w=v/_,x=-C/_,D=f.offset[b],I=f.width[b],E=[0,1];if(c){for(let M=0;M<c.length;M++)for(let S=M+1;S<c.length;S++){let F=nt(c[M],A,y)-nt(c[S],A,y),T=nt(c[M],g,B)-nt(c[S],g,B);if(F===T)continue;let k=F/(F-T);k>1e-4&&k<1-1e-4&&E.push(k);}E.sort((M,S)=>M-S);}let L=(M,S)=>{if(!c)return o;let F=1/0;for(let T of c)F=Math.min(F,nt(T,M,S));return Math.max(o,F)};for(let M=0;M+1<E.length;M++){let S=E[M],F=E[M+1];if(F-S<1e-6)continue;let T=A+C*S,k=y+v*S,H=A+C*F,G=y+v*F,N=D+_*S*l,R=D+_*F*l,W=(b+1)%(u-1),V=p[b]?h[b*2]:w,j=p[b]?h[b*2+1]:x,Y=p[W]?h[W*2]:w,oe=p[W]?h[W*2+1]:x,ge=w+(V-w)*(1-S),$=x+(j-x)*(1-S),J=w+(Y-w)*F,be=x+(oe-x)*F,Ae=Math.hypot(ge,$)||1,Q=Math.hypot(J,be)||1,K=ge/Ae,U=$/Ae,de=J/Q,ie=be/Q;n.ensure(4);let he=ft(n,T,k,t,K,U,0,0,i,m,N,I,d),ne=ft(n,H,G,t,de,ie,0,0,i,m,R,I,d),Be=ft(n,T,k,L(T,k),K,U,0,255,i,m,N,I,d),Me=ft(n,H,G,L(H,G),de,ie,0,255,i,m,R,I,d);n.indices.push(he,Me,ne,he,Be,Me),n.featureIds.push(r,r);}}}var lc=.9976;function sc(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],u=n[s*2+3]-n[s*2+1],m=Math.hypot(c,u);o.push(m>0?{x:c/m,y:u/m,len:m*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>=lc,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,u=[c],m=o[c].len,f=s+1;for(;f<t;){let h=(i+f)%t;if(!r((i+f-1)%t,h))break;u.push(h),m+=o[h].len,f++;}let d=0;for(let h of u)a[h]=d,l[h]=m,d+=o[h].len;s=f;}return {offset:a,width:l}}function cc(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=Se(l,s.length?s:void 0,2);if(!c.length)return;let u=Hr(oc,a),m=n.vertexCount;for(let f=0;f<l.length;f+=2)ft(n,l[f],l[f+1],o,0,0,1,255,i,u);for(let f=0;f<c.length;f+=3)n.indices.push(m+c[f],m+c[f+2],m+c[f+1]),n.featureIds.push(r);}function fc(n){let e=uc(n);if(e.length<3)return null;let t=Math.abs(dc(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 u=1/0,m=-1/0,f=1/0,d=-1/0;for(let B of e){let C=B.x*l+B.y*s,v=-B.x*s+B.y*l;C<u&&(u=C),C>m&&(m=C),v<f&&(f=v),v>d&&(d=v);}let h=m-u,p=d-f,b=h*p;if(b<=0||b>=r)continue;r=b;let A=(u+m)/2,y=(f+d)/2,g=h>=p;o={cx:A*l-y*s,cy:A*s+y*l,ax:g?l:-s,ay:g?s:l,halfLong:(g?h:p)/2,halfShort:(g?p:h)/2,fill:t/b};}return o}function uc(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 dc(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 hc=Math.tan(30*Math.PI/180),mc=3.5,pc=.9;function bc(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=Ac(n);if(!c){if(t>15||l>600||i<3)return null;let u=o%1e3/1e3;l<30?c=u<.5?"skillion":"gabled":s<1.25?c=u<.35?"pyramidal":"hipped":c=u<.8?"gabled":"hipped";}return c==="flat"?null:{shape:c}}function Ac(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 nt=(n,e,t)=>n.a*e+n.b*t+n.c;function yc(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),[u,m]=a((l+r-1)%r),f=e*s+t*c+o,d=e*u+t*m+o;if(f<=0!=d<=0){let h=d/(d-f);i.push(u+(s-u)*h,m+(c-m)*h);}f<=0&&i.push(s,c);}return i}function gc(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],u=n[a*2+1],m=c-l,f=u-s,d=Math.hypot(m,f),h=d>1e-6;if(h){for(let p=i+1;p<a;p++)if(Math.abs((n[p*2]-l)*f-(n[p*2+1]-s)*m)/d>=t){h=false;break}}h||(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 Hi(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],u=n[s*2+1],m=n[(s+1)%l*2],f=n[(s+1)%l*2+1],d=m-c,h=f-u,p=Math.hypot(d,h);if(p<1e-6||t==="gabled"&&Math.abs((d*o+h*r)/p)<.86)continue;let b=-h/p,A=d/p;a.push({a:b,b:A,c:-(b*c+A*u)});}return !a.length&&i>0?Hi(n,e,"hipped"):a}function Bc(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=yc(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 Cc(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=nt(n[o],r[i],r[i+1]);a>t&&(t=a);}}return t}function vc(n,e,t){return n.map(o=>({a:o.a*e,b:o.b*e,c:o.c*e+t}))}function wc(n,e,t,o,r,i,a,l){let s=Hr(rc,a);for(let c=0;c<t.length;c++){let u=e[c];if(!u||u.length<6)continue;let m=Se(u,void 0,2);if(!m.length)continue;let f=-t[c].a/l,d=-t[c].b/l,h=Math.hypot(f,d,1),p={x:f/h,y:d/h,z:1/h};n.ensure(u.length/2);let b=n.vertexCount;for(let A=0;A<u.length;A+=2){let y=Math.max(o,nt(t[c],u[A],u[A+1]));ft(n,u[A],u[A+1],y,p.x,p.y,p.z,255,i,s);}for(let A=0;A<m.length;A+=3)n.indices.push(b+m[A],b+m[A+2],b+m[A+1]),n.featureIds.push(r);}}function xc(n,e){let t=String(n.class??"").toLowerCase();return t==="industrial"||t==="warehouse"||t==="hangar"||t==="construction"?ic:t==="commercial"||t==="office"||t==="retail"||t==="supermarket"?Ii:t==="house"||t==="detached"||t==="garage"||t==="hut"||t==="shed"||e<=7?Mi:e>=40?Ii:nc}function _c(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 Dc(n){let e=n>>>0;return e=(e>>>16^e)*73244475,e=(e>>>16^e)*73244475,e=e>>>16^e,e>>>0}function Fc(n){let e=ut(n.render_height)??ut(n.height)??Mc(n.levels??n.building_levels??n["building:levels"]);return e&&e>0?Math.max(e,ec):$s}function Ec(n,e){let t=ut(n.render_min_height)??ut(n.min_height)??ut(n.base)??0;return t>0&&t<e?t:0}function Mc(n){let e=ut(n);return e&&e>0?e*3:null}function ut(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 Sr=n=>n>127?127:n<-127?-127:n;function Ic(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 ht=16,Oi=64,Sc=0,Lc=1,Ti=2,Hc=3,Nt=1;function Gr(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,u=Math.max(512,n.length*24),m=new ArrayBuffer(u*ht),f={view:new DataView(m),bytes:new Uint8Array(m),offset:0,count:0,indices:[],extent:e,ensure(B){if(f.count+B<=u)return;u=Math.max(u*2,f.count+B);let C=new ArrayBuffer(u*ht);new Uint8Array(C).set(f.bytes.subarray(0,f.offset)),m=C,f.view=new DataView(C),f.bytes=new Uint8Array(C);}},d=[],h=new Map;for(let B of n.features()){if(B.type!==3||!me(t,B.properties))continue;let C=o.liftBy?.(B.properties)??0;for(let v of rt(B.loadGeometry())){let _=ct(v,e);if(_){d.push(C?{..._,lift:C}:_),Pi(_.outer,h);for(let w of _.holes)Pi(w,h);}}}o.onShapes?.(d);let p=new Set;for(let[B,C]of h)C>1&&p.add(B);let b=[],A={radius:c,segments:o.cornerSegments,extent:e,minCutRatio:0,maxChord:xi/r};for(let B of d){let C=c>0?{outer:Ge(B.outer,{...A,keep:ki(B.outer,p)}),holes:B.holes.map(L=>Ge(L,{...A,keep:ki(L,p)}))}:B,v=l>0?Ri(C.outer,l,e,p):C.outer,_=C.holes.map(L=>l>0?Ri(L,-l,e,p):L),w=B.lift??0,x=i+w,D=a+w;Gi(f,v??C.outer,_.map((L,M)=>L??C.holes[M]),x);let I=x,E=x-s;v&&l>0&&s>0&&Tr(f,v,C.outer,I,E,Lc,e,p),E!==D&&Tr(f,C.outer,C.outer,E,D,Ti,e,p);for(let L of C.holes)if(E!==D&&Tr(f,L,L,E,D,Ti,e,p),x<D){let M=f.indices.length;Gi(f,L,[],D,Hc);for(let S=M;S<f.indices.length;S++)b.push(f.indices[S]);f.indices.length=M;}}if(!f.indices.length&&!b.length)return null;let y=f.indices.length,g=new Uint32Array(y+b.length);return g.set(f.indices,0),g.set(b,y),{vertices:m.slice(0,f.offset),indices:g.buffer,vertexCount:f.count,indexCount:g.length,extent:e,capIndexOffset:y}}function mt(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 Pi(n,e){for(let t=0;t+3<n.length;t+=2){let o=mt(n[t],n[t+1],n[t+2],n[t+3]);e.set(o,(e.get(o)??0)+1);}}function ki(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=mt(n[(r+t-1)%t*2],n[(r+t-1)%t*2+1],n[r*2],n[r*2+1]),a=mt(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 Kt(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,Tc(Math.round(o*Oi)),true),n.view.setInt8(s+10,kr(Math.round(r*127))),n.view.setInt8(s+11,kr(Math.round(i*127))),n.view.setInt8(s+12,kr(Math.round(a*127))),n.bytes[s+13]=l,n.view.setInt8(s+14,e<=0?-Nt:e>=n.extent?Nt:0),n.view.setInt8(s+15,t<=0?-Nt:t>=n.extent?Nt:0),n.offset+=ht,n.count++}function Gi(n,e,t,o,r=Sc){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 l=Se(i,a.length?a:void 0,2);if(!l.length)return;n.ensure(i.length/2);let s=n.count;for(let c=0;c<i.length;c+=2)Kt(n,i[c],i[c+1],o,0,0,1,r);for(let c=0;c<l.length;c+=3)n.indices.push(s+l[c],s+l[c+2],s+l[c+1]);}function Tr(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 u=t[c*2],m=t[c*2+1],f=t[c*2+2],d=t[c*2+3];if(u===f&&m===d||Ro(u,m,f,d,a)||l.has(mt(u,m,f,d)))continue;let h=f-u,p=d-m,b=Math.hypot(h,p)||1,A=p/b,y=-h/b,g=o-r,B=Math.hypot(e[c*2]-u,e[c*2+1]-m)||0,C=0;if(B>1e-6&&g!==0){let D=1/Math.hypot(1,g/B);C=B/Math.hypot(B,g)*Math.sign(g),A*=D,y*=D;}let v=Kt(n,e[c*2],e[c*2+1],o,A,y,C,i),_=Kt(n,e[c*2+2],e[c*2+3],o,A,y,C,i),w=Kt(n,u,m,r,A,y,C,i),x=Kt(n,f,d,r,A,y,C,i);n.indices.push(w,_,x,w,v,_);}}}function Ri(n,e,t,o){let r=n.length/2-1;if(r<3)return null;let i=[];for(let s=0;s<r;s++){let c=n[s*2],u=n[s*2+1],m=n[(s+r-1)%r*2],f=n[(s+r-1)%r*2+1],d=n[(s+1)%r*2],h=n[(s+1)%r*2+1],p=Math.hypot(c-m,u-f)||1,b=Math.hypot(d-c,h-u)||1,A=(u-f)/p,y=-(c-m)/p,g=(h-u)/b,B=-(d-c)/b,C=A+g,v=y+B,_=Math.hypot(C,v);if(_<1e-6){i.push(c,u);continue}C/=_,v/=_;let w=Math.min(1/Math.max(C*A+v*y,.35),3),x=c-C*e*w,D=u-v*e*w,I=mt(m,f,c,u),E=mt(c,u,d,h);if(o.has(I)||o.has(E)){i.push(c,u);continue}(c<=0||c>=t)&&(x=c),(u<=0||u>=t)&&(D=u),i.push(x,D);}i.push(i[0],i[1]);let a=Math.abs(Pr(n)),l=Pr(i);if(Math.sign(l)!==Math.sign(Pr(n))||Math.abs(l)<a*.25)return null;for(let s=0;s<i.length;s+=2)i[s]=Math.max(0,Math.min(t,i[s])),i[s+1]=Math.max(0,Math.min(t,i[s+1]));return i}function Pr(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 kr=n=>n>127?127:n<-127?-127:n,Tc=n=>n>32767?32767:n<-32768?-32768:n;var Ue=4;function Pc(n,e,t,o,r){let i=o*o,a=[],l=u=>n[u*2],s=u=>n[u*2+1],c=(u,m)=>{let f=n.length/2;return n.push((l(u)+l(m))/2,(s(u)+s(m))/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 m=0;for(;a.length&&!(++m>2e4);){let[f,d,h]=a.pop(),p=(l(f)-l(d))**2+(s(f)-s(d))**2,b=(l(d)-l(h))**2+(s(d)-s(h))**2,A=(l(h)-l(f))**2+(s(h)-s(f))**2,y=Math.max(p,b,A);if(y<=i){r.push(f,d,h);continue}if(y===p){let g=c(f,d);a.push([f,g,h],[g,d,h]);}else if(y===b){let g=c(d,h);a.push([d,g,f],[g,h,f]);}else {let g=c(h,f);a.push([h,g,d],[g,f,d]);}}}}function Rr(n,e,t=0,o,r=false,i=4096){let a=[],l=[],s=[];for(let d of n.features()){if(d.type!==3||!me(e,d.properties))continue;let h=d.properties.osm_id,p=typeof h=="number"?h:typeof h=="string"?Number(h):NaN,b=Number.isFinite(p)?p:Number(d.id??0);for(let A of rt(d.loadGeometry())){let y=r?ct(A,i):A;if(!y)continue;let g=[],B=[],C=o?Ge(y.outer,o):y.outer;for(let w=0;w<C.length;w++)g.push(C[w]);for(let w of y.holes){let x=o?Ge(w,o):w;B.push(g.length/2);for(let D=0;D<x.length;D++)g.push(x[D]);}let v=Se(g,B.length?B:void 0,2);if(!v.length)continue;let _=a.length/2;for(let w=0;w<g.length;w++)a.push(g[w]);if(t>0){let w=[];Pc(a,v,_,t,w);for(let x=0;x<w.length;x+=3)l.push(w[x],w[x+2],w[x+1]),s.push(b);continue}for(let w=0;w<v.length;w+=3)l.push(_+v[w],_+v[w+2],_+v[w+1]),s.push(b);}}if(!l.length)return null;let c=a.length/2,u=new Int16Array(a),m=new Uint32Array(l);return {featureIds:new Float64Array(s).buffer,vertices:u.buffer,indices:m.buffer,vertexCount:c,indexCount:m.length}}var kc=100;function Or(n){return {shapes:[],cells:[],extent:0,metersPerTile:n}}function Wr(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 u=0;u<i.length;u+=2)i[u]<a&&(a=i[u]),i[u]>s&&(s=i[u]),i[u+1]<l&&(l=i[u+1]),i[u+1]>c&&(c=i[u+1]);n.shapes.push({outer:i,holes:r.holes,level:t,minX:a,minY:l,maxX:s,maxY:c});}n.cells=[];}}function Gc(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=pt(Math.floor(o.minX/e)),i=pt(Math.floor(o.maxX/e)),a=pt(Math.floor(o.minY/e)),l=pt(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 Vi=n=>n.shapes.length===0;function Oo(n,e,t){!n.cells.length&&n.shapes.length&&Gc(n);let o=n.extent/32,r=n.cells[pt(Math.floor(t/o))*32+pt(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||!Wi(l.outer,e,t))continue;let s=false;for(let c of l.holes)if(Wi(c,e,t)){s=true;break}s||(i=l.level);}return Math.min(Math.round(i*100),127)}function Vr(n,e){let t=[],o=[],r=n.extent>0?n.metersPerTile/n.extent:0,i=r>0?2/r:0,a=Oo(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],u=e[l+2],m=e[l+3],f=Oo(n,u,m);if(f!==a&&i>0){let d=Math.hypot(u-s,m-c),h=Math.min(Math.ceil(d/i),64),p=a;for(let b=1;b<h;b++){let A=b/h,y=s+(u-s)*A,g=c+(m-c)*A,B=Oo(n,y,g);B!==p&&(t.push(y,g),o.push(B),p=B);}}t.push(u,m),o.push(f),a=f;}return {pts:t,levels:o}}var pt=n=>n<0?0:n>31?31:n;function Wi(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],u=n[a*2+1];s>t!=u>t&&e<(c-l)*(t-s)/(u-s)+l&&(o=!o);}return o}var Je=20;function zr(n,e,t=0,o){let r=Math.max(256,n.length*24),i=new ArrayBuffer(r*Je),a=new DataView(i),l=0,s=[],c=d=>{if(l+d<=r)return;r=Math.max(r*2,l+d);let h=new ArrayBuffer(r*Je);new Uint8Array(h).set(new Uint8Array(i,0,l*Je)),i=h,a=new DataView(h);},u=(d,h,p,b,A,y,g,B=0,C=0)=>{let v=l*Je;return a.setInt16(v,d,true),a.setInt16(v+2,h,true),a.setInt16(v+4,p,true),a.setInt16(v+6,b,true),a.setInt8(v+8,A),a.setInt8(v+9,y),a.setInt8(v+10,B),a.setInt8(v+11,C),a.setFloat32(v+12,g,true),a.setFloat32(v+16,m,true),l++},m=0;for(let d of n.features()){if(d.type!==2&&d.type!==3||!me(e,d.properties))continue;let h=d.properties.width;m=typeof h=="number"&&h>.5&&h<100?h:0;let p=d.type===3;for(let b of d.loadGeometry()){let A=t>0?Rc(zi(b),t):zi(b);if(A.length<4)continue;let y=o&&!Vi(o)?Vr(o,A):null,g=y?y.pts:A,B=y?.levels,C=g.length/2;if(C<2)continue;c((C-1)*4);let v=0;for(let _=0;_<C-1;_++){let w=g[_*2],x=g[_*2+1],D=g[_*2+2],I=g[_*2+3],E=Math.hypot(D-w,I-x);if(p&&Wc(w,x,D,I,n.extent)){v+=E;continue}let L=Oc(w,x,D,I,n.extent);if(!L){v+=E;continue}let[M,S,F,T]=L,k=Math.hypot(M-w,S-x),H=Math.hypot(F-M,T-S),G=Math.hypot(D-F,I-T),N=v+k,R=B?B[_]:0,W=B?B[_+1]:0,V=u(M,S,F,T,0,-1,N,R,W),j=u(M,S,F,T,0,1,N,R,W),Y=u(M,S,F,T,1,1,N,R,W),oe=u(M,S,F,T,1,-1,N,R,W);v+=k+H+G,s.push(V,j,Y,V,Y,oe);}}}if(!s.length)return null;let f=new Uint32Array(s);return {vertices:i.slice(0,l*Je),indices:f.buffer,vertexCount:l,indexCount:f.length}}function Rc(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 u=c/s;t.push(r+(a-r)*u,i+(l-i)*u);}}return t.push(n[n.length-2],n[n.length-1]),t}function zi(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 Oc(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[u,m]of c){if(u===0){if(m<0)return null;continue}let f=m/u;if(u<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 Wc(n,e,t,o,r){return n===t&&(n<=0||n>=r)?true:e===o&&(e<=0||e>=r)}var Nr={enabled:true,skyColor:"#7fb2e5",horizonColor:"#dfe6ee",fogRange:[1.35,7.5],fogIntensity:.92,spaceColor:"#05070f",atmosphereColor:"#79b8f5",starIntensity:.55,horizonBlend:.75},Kr={ambientColor:"#ffffff",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#fff4e2",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#dce6f2",fillIntensity:.18};var Ni={version:1,name:"OSM 3D \u2014 \u0434\u043D\u0435\u0432\u043D\u043E\u0439",background:"#eceae4",light:{ambientColor:"#ffffff",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#fff4e2",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#dce6f2",fillIntensity:.18},layers:[{id:"landcover-wood",type:"fill","source-layer":"landcover",filter:["in","class","wood","forest"],paint:{color:"#c6dcb4",opacity:{stops:[[8,.5],[12,.85]]},material:"foliage",materialScale:16}},{id:"landcover-grass",type:"fill","source-layer":"landcover",filter:["in","class","grass","farmland","meadow"],paint:{color:"#d9e6c6",opacity:{stops:[[8,.45],[12,.8]]},material:"foliage",materialScale:11}},{id:"landcover-sand",type:"fill","source-layer":"landcover",filter:["in","class","sand","beach"],paint:{color:"#f2e7c8",material:"sand",materialScale:26}},{id:"landcover-ice",type:"fill","source-layer":"landcover",filter:["in","class","ice","glacier"],paint:{color:"#e6f2f7"}},{id:"landcover-wetland",type:"fill","source-layer":"landcover",filter:["in","class","wetland","swamp"],paint:{color:"#cfe0d4",material:"foliage",materialScale:9}},{id:"landuse-residential",type:"fill","source-layer":"landuse",filter:["in","class","residential","suburb","neighbourhood","quarter"],paint:{color:"#e6e2da",opacity:{stops:[[10,.4],[14,.7]]}}},{id:"landuse-industrial",type:"fill","source-layer":"landuse",filter:["in","class","industrial","quarry","railway","substation"],paint:{color:"#e7e0dd"}},{id:"landuse-civic",type:"fill","source-layer":"landuse",filter:["in","class","school","university","college","hospital","clinic","police","kindergarten","bus_station"],paint:{color:"#ece3d8"}},{id:"landuse-sport",type:"fill","source-layer":"landuse",filter:["in","class","pitch","stadium","playground","track","swimming_pool"],paint:{color:"#cfe3c4",material:"foliage",materialScale:10}},{id:"landuse-cemetery",type:"fill","source-layer":"landuse",filter:["in","class","cemetery","grave_yard"],paint:{color:"#d6dfc8",material:"foliage",materialScale:12}},{id:"landuse-parking",type:"fill","source-layer":"landuse",filter:["in","class","parking","fuel"],paint:{color:"#e8e4dc"}},{id:"park",type:"fill","source-layer":"park",paint:{color:"#cfe5bd",opacity:.75,material:"foliage",materialScale:15}},{id:"aeroway-area",type:"fill","source-layer":"aeroway",filter:["in","class","aerodrome","apron","helipad"],paint:{color:"#e4e2e6"}},{id:"water",type:"fill","source-layer":"water",filter:["!in","class","swimming_pool"],paint:{color:"#a5cbe3",material:"water",materialScale:14,materialSpeed:1}},{id:"water-pool",type:"fill","source-layer":"water",filter:["==","class","swimming_pool"],paint:{color:"#9fd3e8",material:"water",materialScale:8,materialSpeed:1}},{id:"waterway",type:"line","source-layer":"waterway",paint:{color:"#a5cbe3",width:{stops:[[8,.6],[12,1.4],[16,4],[19,11.5],[20,23],[21,46],[22,92]]},material:"water",materialScale:10,materialSpeed:1}},{id:"aeroway-line",type:"line","source-layer":"aeroway",filter:["in","class","runway","taxiway"],paint:{color:"#d8d5da",width:{stops:[[10,1],[14,5],[18,24],[19,24],[20,48],[21,96],[22,192]]},material:"asphalt",materialScale:4}},{id:"road-casing-major",type:"line","source-layer":"transportation",filter:["in","class","motorway","trunk","primary"],minzoom:5,paint:{color:"#d4ab68",width:{stops:[[6,1.6],[10,3.4],[14,8],[16,14],[18,30],[19,45],[20,90],[21,180],[22,360]]},widthFromData:true,widthExtra:2.5}},{id:"road-casing-secondary",type:"line","source-layer":"transportation",filter:["in","class","secondary","tertiary"],minzoom:9,paint:{color:"#c6bca6",width:{stops:[[10,1.6],[14,5.5],[16,10],[18,22],[19,33],[20,66],[21,132],[22,264]]},widthFromData:true,widthExtra:2}},{id:"road-casing-minor",type:"line","source-layer":"transportation",filter:["in","class","minor","service","track"],minzoom:12,paint:{color:"#cdc4b2",width:{stops:[[13,1.4],[16,6],[18,14],[19,22],[20,44],[21,88],[22,176]]},widthFromData:true,widthExtra:1.5}},{id:"road-rail",type:"line","source-layer":"transportation",filter:["in","class","rail","transit"],minzoom:10,paint:{color:"#b2a99e",width:{stops:[[10,.8],[14,1.8],[18,4],[19,5.5],[20,11],[21,22],[22,44]]}}},{id:"road-path",type:"line","source-layer":"transportation",filter:["in","class","path","pedestrian","footway","steps"],minzoom:14,paint:{color:"#bdb2a0",width:{stops:[[14,.8],[17,2],[19,4],[20,8],[21,16],[22,32]]},dashArray:[4,3],material:"asphalt",materialScale:2}},{id:"road-minor",type:"line","source-layer":"transportation",filter:["in","class","minor","service","track"],minzoom:12,paint:{color:"#ffffff",width:{stops:[[13,.6],[16,4],[18,11],[19,18],[20,36],[21,72],[22,144]]},material:"asphalt",materialScale:3,widthFromData:true}},{id:"road-secondary",type:"line","source-layer":"transportation",filter:["in","class","secondary","tertiary"],minzoom:9,paint:{color:"#ffffff",width:{stops:[[10,.8],[14,3.6],[16,7.5],[18,18],[19,28],[20,56],[21,112],[22,224]]},material:"asphalt",materialScale:3,widthFromData:true}},{id:"road-major",type:"line","source-layer":"transportation",filter:["in","class","motorway","trunk","primary"],minzoom:5,paint:{color:"#ffdfa3",width:{stops:[[6,.8],[10,2.2],[14,6],[16,11],[18,25],[19,38.5],[20,77],[21,154],[22,308]]},material:"asphalt",materialScale:3,widthFromData:true}},{id:"road-lane-divider-major",type:"line","source-layer":"transportation",filter:["all",["!has","oneway"],["in","class","motorway","trunk","primary"]],minzoom:16.5,paint:{color:"#e3bd7f",width:{stops:[[16.5,.54],[17,.78],[18,1.4],[19,2.17],[20,4.34],[21,8.68],[22,17.36]]},dashArray:[7,18],material:"flat"}},{id:"road-lane-divider-secondary",type:"line","source-layer":"transportation",filter:["all",["!has","oneway"],["in","class","secondary","tertiary"]],minzoom:16.5,paint:{color:"#d8cfbc",width:{stops:[[16.5,.46],[17,.67],[18,1.2],[19,1.86],[20,3.72],[21,7.44],[22,14.88]]},dashArray:[7,18],material:"flat"}},{id:"boundary",type:"line","source-layer":"boundary",filter:["<=","admin_level",4],paint:{color:"#b3a6b8",opacity:.7,width:{stops:[[4,.7],[10,1.4],[16,2.4]]},dashArray:[6,4]}},{id:"building",type:"fill-extrusion","source-layer":"building",minzoom:15,paint:{color:"#d8d3c8",roofColor:"#d9d3c7",opacity:1,heightScale:{stops:[[15,0],[15.8,1]]},aoStrength:.18,tintVariation:.06,windowColor:"#7f9ab5",windowFrameColor:"#e9e5dc",windowGlow:0,facadeDetail:1,floorHeight:3.2,roofVariation:.35}},{id:"indoor-venue",type:"fill-extrusion",source:"indoor","source-layer":"area",filter:["all",["==","class","level"],["==","base",1]],minzoom:15,maxzoom:16,paint:{color:"#d8d3c8",roofColor:"#d9d3c7",opacity:1,aoStrength:.18,tintVariation:.06,windowColor:"#7f9ab5",windowFrameColor:"#e9e5dc",windowGlow:0,facadeDetail:1,floorHeight:3.2,roofVariation:.35}},{id:"road-closed-casing",type:"line",source:"closures","source-layer":"closures",minzoom:11,paint:{color:"#ffffff",width:{stops:[[11,4],[14,6],[17,10],[19,16],[20,32],[21,64],[22,128]]},opacity:.9},overlay:true},{id:"road-closed",type:"line",source:"closures","source-layer":"closures",minzoom:11,paint:{color:"#d92b2b",width:{stops:[[11,2.5],[14,4],[17,7],[19,11],[20,22],[21,44],[22,88]]},dashArray:[5,4]},overlay:true},{id:"crossing",type:"fill",source:"points","source-layer":"crossings",minzoom:16.5,overlay:true,paint:{color:"#ffffff",opacity:.9}},{id:"housenumber",type:"symbol","source-layer":"housenumber",minzoom:17,layout:{textField:"{housenumber}",textSize:{stops:[[17,9],[19,11]]},maxLineChars:6,priority:-60},paint:{color:"#8c8478",haloColor:"#f5f3ee",haloWidth:1}},{id:"poi-food",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#c2681c",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#c2681c",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","cafe","restaurant","fast_food","bar","pub","beer","bakery","ice_cream"]},{id:"poi-shop",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#2f77c4",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#2f77c4",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","shop","clothing_store","grocery","alcohol_shop","music","laundry","hairdresser","car","bicycle"]},{id:"poi-transport",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#3b82a6",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#3b82a6",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","bus","railway","parking","fuel","bicycle_parking","bicycle_rental","taxi","airport"]},{id:"poi-health",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#c24444",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#c24444",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","pharmacy","hospital","doctors","dentist","veterinary"]},{id:"poi-education",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#3f7f7a",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#3f7f7a",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","school","college","university","library","kindergarten"]},{id:"poi-culture",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#8b5aa5",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#8b5aa5",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","museum","theatre","cinema","art_gallery","attraction","monument","zoo","theme_park","castle","place_of_worship","information"]},{id:"poi-sport",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#4f8b45",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#4f8b45",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","pitch","park","garden","playground","stadium","sports_centre","swimming_pool","athletics","running"]},{id:"poi-lodging",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#7a5fbf",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#7a5fbf",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","lodging"]},{id:"poi-service",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#59636e",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#59636e",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","bank","atm","post","office","town_hall","police","fire_station","toilets"]},{id:"poi",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#4a4a4a",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#4a4a4a",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["!in","class","cafe","restaurant","fast_food","bar","pub","beer","bakery","ice_cream","shop","clothing_store","grocery","alcohol_shop","music","laundry","hairdresser","car","bicycle","bus","railway","parking","fuel","bicycle_parking","bicycle_rental","taxi","airport","pharmacy","hospital","doctors","dentist","veterinary","school","college","university","library","kindergarten","museum","theatre","cinema","art_gallery","attraction","monument","zoo","theme_park","castle","place_of_worship","information","pitch","park","garden","playground","stadium","sports_centre","swimming_pool","athletics","running","lodging","bank","atm","post","office","town_hall","police","fire_station","toilets"]},{id:"traffic-signal",type:"symbol",source:"points","source-layer":"roadpoints",minzoom:16,filter:["==","kind","traffic_signals"],layout:{iconImage:"traffic_signals",priority:3},paint:{color:"#5c6470",haloColor:"#ffffff",haloWidth:1.4,iconSize:15}},{id:"road-shield",type:"symbol","source-layer":"transportation_name",filter:["has","ref"],minzoom:11,layout:{textField:"{ref}",iconImage:"shield-{ref_length}",iconPlacement:"behind",textSize:{stops:[[11,9.5],[16,11]]},iconTextGap:4,maxLineChars:10,collisionPadding:70,priority:3},paint:{color:"#3a4048",haloColor:"#f7f3e8",haloWidth:.5,iconColor:"#f7f3e8",iconHaloColor:"#8a8172",iconHaloWidth:1.4}},{id:"road-label",type:"symbol","source-layer":"transportation_name",minzoom:14,layout:{textField:["{name:ru}","{name}"],textPlacement:"line",textSize:{stops:[[14,10],[18,13]]},priority:20,abbreviate:true},paint:{color:"#5c5646",haloColor:"#ffffff",haloWidth:1.6}},{id:"water-label",type:"symbol","source-layer":"water_name",minzoom:10,layout:{textField:["{name:ru}","{name}"],textSize:{stops:[[10,11],[16,14]]},priority:30},paint:{color:"#3d7ea6",haloColor:"#ffffff",haloWidth:1.4}},{id:"place-label",type:"symbol","source-layer":"place",minzoom:4,layout:{textField:["{name:ru}","{name}"],textSize:{stops:[[6,12],[12,17],[16,22]]},maxLineChars:16,priority:90},paint:{color:"#3a3a3a",haloColor:"#ffffff",haloWidth:1.8}},{id:"indoor-shell",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","level"],minzoom:16,paint:{color:"#f6f3ec",opacity:.97},clipToTile:true},{id:"indoor-corridor",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","corridor"],minzoom:16,paint:{color:"#ffffff"},clipToTile:true},{id:"indoor-room",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["in","class","room","area"],minzoom:16,paint:{color:"#efeae0"},clipToTile:true},{id:"indoor-service",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","service"],minzoom:16,paint:{color:"#e6e1d6"},clipToTile:true},{id:"indoor-shop",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","shop"],minzoom:16,paint:{color:"#e8e0f0"},clipToTile:true},{id:"indoor-food",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","food"],minzoom:16,paint:{color:"#f7e3cd"},clipToTile:true},{id:"indoor-wc",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","wc"],minzoom:16,paint:{color:"#d8e8f2"},clipToTile:true},{id:"indoor-wall",type:"fill-extrusion",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","wall"],minzoom:16,paint:{color:"#cbc4b8",roofColor:"#e4ded2",facadeDetail:0,tintVariation:0,roofVariation:0,aoStrength:0}},{id:"indoor-transportation",type:"fill",source:"indoor","source-layer":"transportation",splitBy:"level",minzoom:16,paint:{color:"#d9d2e8",opacity:.95},clipToTile:true},{id:"indoor-door",type:"symbol",source:"indoor","source-layer":"poi",filter:["==","class","door"],splitBy:"level",minzoom:18,layout:{iconImage:"door",iconSize:{stops:[[18,9],[20,13]]},allowOverlap:true,priority:-10},paint:{color:"#8a8172",haloColor:"#ffffff",haloWidth:1.2}},{id:"indoor-poi",type:"symbol",source:"indoor","source-layer":"poi",splitBy:"level",minzoom:17,layout:{textField:["{name}"],iconImage:"{class}",textSize:{stops:[[17,10],[19,12]]},iconSize:{stops:[[17,12],[19,15]]},iconTextGap:2,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#4a4a4a",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:.32}},{id:"indoor-name",type:"symbol",source:"indoor","source-layer":"area_name",splitBy:"level",minzoom:17,layout:{textField:["{name}"],textSize:{stops:[[17,10.5],[19,12.5]]},maxLineChars:8},paint:{color:"#3c3830",haloColor:"#ffffff",haloWidth:1.4}},{id:"building-entrance",type:"symbol",source:"points","source-layer":"entrances",minzoom:17,layout:{iconImage:"entrance",showFor:"highlight",textField:["{ref}"],textSize:{stops:[[17,10],[19,12.5]]},allowOverlap:true,priority:40,iconRotate:"angle",placement:"map",arrowLength:{stops:[[17,22],[18,32],[19,40],[20,48],[22,56]]},arrowWidth:{stops:[[17,6],[18,8.5],[19,10.5],[20,12.5],[22,15]]},arrowOutline:{stops:[[17,1.4],[18,2],[19,2.5],[20,3],[22,3.5]]},arrowGap:{stops:[[17,14],[18,19],[19,23],[20,27],[22,31]]},arrowUnits:"pixels",iconTextGap:3,arrowDotRadius:{stops:[[17,2.2],[18,3.2],[19,4],[20,4.8],[22,5.6]]},arrowDotGap:{stops:[[17,5],[18,7],[19,9],[20,11],[22,12.5]]}},paint:{color:"#2d6ecb",haloColor:"#ffffff",haloWidth:1.6}}],sources:{indoor:{url:"/tileserver/data/indoor/{z}/{x}/{y}.pbf",minzoom:15,maxzoom:18},points:{url:"/tileserver/data/points/{z}/{x}/{y}.pbf",minzoom:13,maxzoom:16},closures:{url:"/closures/tiles/{z}/{x}/{y}.mvt",minzoom:10,maxzoom:16}}};var Ki={version:1,name:"\u041C\u044F\u0433\u043A\u0430\u044F \u0433\u0435\u043E\u043C\u0435\u0442\u0440\u0438\u044F",background:"#eceae4",light:{ambientColor:"#ffffff",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#fff4e2",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#dce6f2",fillIntensity:.18},layers:[{id:"landcover-wood",type:"fill","source-layer":"landcover",filter:["in","class","wood","forest"],paint:{color:"#c6dcb4",opacity:{stops:[[8,.5],[12,.85]]},material:"foliage",materialScale:16},cornerRadius:10,cornerSegments:4},{id:"landcover-grass",type:"fill","source-layer":"landcover",filter:["in","class","grass","farmland","meadow"],paint:{color:"#d9e6c6",opacity:{stops:[[8,.45],[12,.8]]},material:"foliage",materialScale:11},cornerRadius:8,cornerSegments:4},{id:"landcover-sand",type:"fill","source-layer":"landcover",filter:["in","class","sand","beach"],paint:{color:"#f2e7c8",material:"sand",materialScale:26},cornerRadius:10,cornerSegments:4},{id:"landcover-ice",type:"fill","source-layer":"landcover",filter:["in","class","ice","glacier"],paint:{color:"#e6f2f7"}},{id:"landcover-wetland",type:"fill","source-layer":"landcover",filter:["in","class","wetland","swamp"],paint:{color:"#cfe0d4",material:"foliage",materialScale:9},cornerRadius:8,cornerSegments:4},{id:"landuse-residential",type:"fill","source-layer":"landuse",filter:["in","class","residential","suburb","neighbourhood","quarter"],paint:{color:"#e6e2da",opacity:{stops:[[10,.4],[14,.7]]}},cornerRadius:4,cornerSegments:3},{id:"landuse-industrial",type:"fill","source-layer":"landuse",filter:["in","class","industrial","quarry","railway","substation"],paint:{color:"#e7e0dd"},cornerRadius:4,cornerSegments:3},{id:"landuse-civic",type:"fill","source-layer":"landuse",filter:["in","class","school","university","college","hospital","clinic","police","kindergarten","bus_station"],paint:{color:"#ece3d8"},cornerRadius:4,cornerSegments:3},{id:"landuse-sport",type:"fill","source-layer":"landuse",filter:["in","class","pitch","stadium","playground","track","swimming_pool"],paint:{color:"#cfe3c4",material:"foliage",materialScale:10},cornerRadius:5,cornerSegments:3},{id:"landuse-cemetery",type:"fill","source-layer":"landuse",filter:["in","class","cemetery","grave_yard"],paint:{color:"#d6dfc8",material:"foliage",materialScale:12},cornerRadius:5,cornerSegments:3},{id:"landuse-parking",type:"fill","source-layer":"landuse",filter:["in","class","parking","fuel"],paint:{color:"#e8e4dc"},cornerRadius:3,cornerSegments:3},{id:"park",type:"fill","source-layer":"park",paint:{color:"#cfe5bd",opacity:.75,material:"foliage",materialScale:15},cornerRadius:9,cornerSegments:4},{id:"aeroway-area",type:"fill","source-layer":"aeroway",filter:["in","class","aerodrome","apron","helipad"],paint:{color:"#e4e2e6"},cornerRadius:5,cornerSegments:3},{id:"water",type:"fill","source-layer":"water",filter:["!in","class","swimming_pool"],paint:{color:"#a5cbe3",material:"water",materialScale:14,materialSpeed:1},cornerRadius:7,cornerSegments:4},{id:"water-pool",type:"fill","source-layer":"water",filter:["==","class","swimming_pool"],paint:{color:"#9fd3e8",material:"water",materialScale:8,materialSpeed:1},cornerRadius:4,cornerSegments:4},{id:"waterway",type:"line","source-layer":"waterway",paint:{color:"#a5cbe3",width:{stops:[[8,.6],[12,1.4],[16,4],[19,11.5],[20,23],[21,46],[22,92]]},material:"water",materialScale:10,materialSpeed:1}},{id:"aeroway-line",type:"line","source-layer":"aeroway",filter:["in","class","runway","taxiway"],paint:{color:"#d8d5da",width:{stops:[[10,1],[14,5],[18,24],[19,24],[20,48],[21,96],[22,192]]},material:"asphalt",materialScale:4}},{id:"road-casing-major",type:"line","source-layer":"transportation",filter:["in","class","motorway","trunk","primary"],minzoom:5,paint:{color:"#d4ab68",width:{stops:[[6,1.6],[10,3.4],[14,8],[16,14],[18,30],[19,45],[20,90],[21,180],[22,360]]},widthFromData:true,widthExtra:2.5}},{id:"road-casing-secondary",type:"line","source-layer":"transportation",filter:["in","class","secondary","tertiary"],minzoom:9,paint:{color:"#c6bca6",width:{stops:[[10,1.6],[14,5.5],[16,10],[18,22],[19,33],[20,66],[21,132],[22,264]]},widthFromData:true,widthExtra:2}},{id:"road-casing-minor",type:"line","source-layer":"transportation",filter:["in","class","minor","service","track"],minzoom:12,paint:{color:"#cdc4b2",width:{stops:[[13,1.4],[16,6],[18,14],[19,22],[20,44],[21,88],[22,176]]},widthFromData:true,widthExtra:1.5}},{id:"road-rail",type:"line","source-layer":"transportation",filter:["in","class","rail","transit"],minzoom:10,paint:{color:"#b2a99e",width:{stops:[[10,.8],[14,1.8],[18,4],[19,5.5],[20,11],[21,22],[22,44]]}}},{id:"road-path",type:"line","source-layer":"transportation",filter:["in","class","path","pedestrian","footway","steps"],minzoom:14,paint:{color:"#bdb2a0",width:{stops:[[14,.8],[17,2],[19,4],[20,8],[21,16],[22,32]]},dashArray:[4,3],material:"asphalt",materialScale:2}},{id:"road-minor",type:"line","source-layer":"transportation",filter:["in","class","minor","service","track"],minzoom:12,paint:{color:"#ffffff",width:{stops:[[13,.6],[16,4],[18,11],[19,18],[20,36],[21,72],[22,144]]},material:"asphalt",materialScale:3,widthFromData:true}},{id:"road-secondary",type:"line","source-layer":"transportation",filter:["in","class","secondary","tertiary"],minzoom:9,paint:{color:"#ffffff",width:{stops:[[10,.8],[14,3.6],[16,7.5],[18,18],[19,28],[20,56],[21,112],[22,224]]},material:"asphalt",materialScale:3,widthFromData:true}},{id:"road-major",type:"line","source-layer":"transportation",filter:["in","class","motorway","trunk","primary"],minzoom:5,paint:{color:"#ffdfa3",width:{stops:[[6,.8],[10,2.2],[14,6],[16,11],[18,25],[19,38.5],[20,77],[21,154],[22,308]]},material:"asphalt",materialScale:3,widthFromData:true}},{id:"road-lane-divider-major",type:"line","source-layer":"transportation",filter:["all",["!has","oneway"],["in","class","motorway","trunk","primary"]],minzoom:16.5,paint:{color:"#e3bd7f",width:{stops:[[16.5,.54],[17,.78],[18,1.4],[19,2.17],[20,4.34],[21,8.68],[22,17.36]]},dashArray:[7,18],material:"flat"}},{id:"road-lane-divider-secondary",type:"line","source-layer":"transportation",filter:["all",["!has","oneway"],["in","class","secondary","tertiary"]],minzoom:16.5,paint:{color:"#d8cfbc",width:{stops:[[16.5,.46],[17,.67],[18,1.2],[19,1.86],[20,3.72],[21,7.44],[22,14.88]]},dashArray:[7,18],material:"flat"}},{id:"boundary",type:"line","source-layer":"boundary",filter:["<=","admin_level",4],paint:{color:"#b3a6b8",opacity:.7,width:{stops:[[4,.7],[10,1.4],[16,2.4]]},dashArray:[6,4]}},{id:"building",type:"fill-extrusion","source-layer":"building",minzoom:15,paint:{color:"#d8d3c8",roofColor:"#d9d3c7",opacity:1,heightScale:{stops:[[15,0],[15.8,1]]},aoStrength:.18,tintVariation:.06,windowColor:"#7f9ab5",windowFrameColor:"#e9e5dc",windowGlow:0,facadeDetail:1,floorHeight:3.2,roofVariation:.35},cornerRadius:1.6,cornerSegments:2},{id:"indoor-venue",type:"fill-extrusion",source:"indoor","source-layer":"area",filter:["all",["==","class","level"],["==","base",1]],minzoom:15,maxzoom:16,paint:{color:"#d8d3c8",roofColor:"#d9d3c7",opacity:1,aoStrength:.18,tintVariation:.06,windowColor:"#7f9ab5",windowFrameColor:"#e9e5dc",windowGlow:0,facadeDetail:1,floorHeight:3.2,roofVariation:.35}},{id:"road-closed-casing",type:"line",source:"closures","source-layer":"closures",minzoom:11,paint:{color:"#ffffff",width:{stops:[[11,4],[14,6],[17,10],[19,16],[20,32],[21,64],[22,128]]},opacity:.9},overlay:true},{id:"road-closed",type:"line",source:"closures","source-layer":"closures",minzoom:11,paint:{color:"#d92b2b",width:{stops:[[11,2.5],[14,4],[17,7],[19,11],[20,22],[21,44],[22,88]]},dashArray:[5,4]},overlay:true},{id:"crossing",type:"fill",source:"points","source-layer":"crossings",minzoom:16.5,overlay:true,paint:{color:"#ffffff",opacity:.9}},{id:"housenumber",type:"symbol","source-layer":"housenumber",minzoom:17,layout:{textField:"{housenumber}",textSize:{stops:[[17,9],[19,11]]},maxLineChars:6,priority:-60},paint:{color:"#8c8478",haloColor:"#f5f3ee",haloWidth:1}},{id:"poi-food",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#c2681c",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#c2681c",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","cafe","restaurant","fast_food","bar","pub","beer","bakery","ice_cream"]},{id:"poi-shop",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#2f77c4",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#2f77c4",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","shop","clothing_store","grocery","alcohol_shop","music","laundry","hairdresser","car","bicycle"]},{id:"poi-transport",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#3b82a6",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#3b82a6",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","bus","railway","parking","fuel","bicycle_parking","bicycle_rental","taxi","airport"]},{id:"poi-health",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#c24444",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#c24444",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","pharmacy","hospital","doctors","dentist","veterinary"]},{id:"poi-education",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#3f7f7a",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#3f7f7a",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","school","college","university","library","kindergarten"]},{id:"poi-culture",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#8b5aa5",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#8b5aa5",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","museum","theatre","cinema","art_gallery","attraction","monument","zoo","theme_park","castle","place_of_worship","information"]},{id:"poi-sport",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#4f8b45",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#4f8b45",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","pitch","park","garden","playground","stadium","sports_centre","swimming_pool","athletics","running"]},{id:"poi-lodging",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#7a5fbf",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#7a5fbf",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","lodging"]},{id:"poi-service",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#59636e",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#59636e",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","bank","atm","post","office","town_hall","police","fire_station","toilets"]},{id:"poi",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#4a4a4a",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#4a4a4a",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["!in","class","cafe","restaurant","fast_food","bar","pub","beer","bakery","ice_cream","shop","clothing_store","grocery","alcohol_shop","music","laundry","hairdresser","car","bicycle","bus","railway","parking","fuel","bicycle_parking","bicycle_rental","taxi","airport","pharmacy","hospital","doctors","dentist","veterinary","school","college","university","library","kindergarten","museum","theatre","cinema","art_gallery","attraction","monument","zoo","theme_park","castle","place_of_worship","information","pitch","park","garden","playground","stadium","sports_centre","swimming_pool","athletics","running","lodging","bank","atm","post","office","town_hall","police","fire_station","toilets"]},{id:"traffic-signal",type:"symbol",source:"points","source-layer":"roadpoints",minzoom:16,filter:["==","kind","traffic_signals"],layout:{iconImage:"traffic_signals",priority:3},paint:{color:"#5c6470",haloColor:"#ffffff",haloWidth:1.4,iconSize:15}},{id:"road-shield",type:"symbol","source-layer":"transportation_name",filter:["has","ref"],minzoom:11,layout:{textField:"{ref}",iconImage:"shield-{ref_length}",iconPlacement:"behind",textSize:{stops:[[11,9.5],[16,11]]},iconTextGap:4,maxLineChars:10,collisionPadding:70,priority:3},paint:{color:"#3a4048",haloColor:"#f7f3e8",haloWidth:.5,iconColor:"#f7f3e8",iconHaloColor:"#8a8172",iconHaloWidth:1.4}},{id:"road-label",type:"symbol","source-layer":"transportation_name",minzoom:14,layout:{textField:["{name:ru}","{name}"],textPlacement:"line",textSize:{stops:[[14,10],[18,13]]},priority:20,abbreviate:true},paint:{color:"#5c5646",haloColor:"#ffffff",haloWidth:1.6}},{id:"water-label",type:"symbol","source-layer":"water_name",minzoom:10,layout:{textField:["{name:ru}","{name}"],textSize:{stops:[[10,11],[16,14]]},priority:30},paint:{color:"#3d7ea6",haloColor:"#ffffff",haloWidth:1.4}},{id:"place-label",type:"symbol","source-layer":"place",minzoom:4,layout:{textField:["{name:ru}","{name}"],textSize:{stops:[[6,12],[12,17],[16,22]]},maxLineChars:16,priority:90},paint:{color:"#3a3a3a",haloColor:"#ffffff",haloWidth:1.8}},{id:"indoor-shell",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","level"],minzoom:16,paint:{color:"#f6f3ec",opacity:.97},clipToTile:true},{id:"indoor-corridor",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","corridor"],minzoom:16,paint:{color:"#ffffff"},clipToTile:true},{id:"indoor-room",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["in","class","room","area"],minzoom:16,paint:{color:"#efeae0"},clipToTile:true},{id:"indoor-service",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","service"],minzoom:16,paint:{color:"#e6e1d6"},clipToTile:true},{id:"indoor-shop",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","shop"],minzoom:16,paint:{color:"#e8e0f0"},clipToTile:true},{id:"indoor-food",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","food"],minzoom:16,paint:{color:"#f7e3cd"},clipToTile:true},{id:"indoor-wc",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","wc"],minzoom:16,paint:{color:"#d8e8f2"},clipToTile:true},{id:"indoor-wall",type:"fill-extrusion",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","wall"],minzoom:16,paint:{color:"#cbc4b8",roofColor:"#e4ded2",facadeDetail:0,tintVariation:0,roofVariation:0,aoStrength:0}},{id:"indoor-transportation",type:"fill",source:"indoor","source-layer":"transportation",splitBy:"level",minzoom:16,paint:{color:"#d9d2e8",opacity:.95},clipToTile:true},{id:"indoor-door",type:"symbol",source:"indoor","source-layer":"poi",filter:["==","class","door"],splitBy:"level",minzoom:18,layout:{iconImage:"door",iconSize:{stops:[[18,9],[20,13]]},allowOverlap:true,priority:-10},paint:{color:"#8a8172",haloColor:"#ffffff",haloWidth:1.2}},{id:"indoor-poi",type:"symbol",source:"indoor","source-layer":"poi",splitBy:"level",minzoom:17,layout:{textField:["{name}"],iconImage:"{class}",textSize:{stops:[[17,10],[19,12]]},iconSize:{stops:[[17,12],[19,15]]},iconTextGap:2,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#4a4a4a",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:.32}},{id:"indoor-name",type:"symbol",source:"indoor","source-layer":"area_name",splitBy:"level",minzoom:17,layout:{textField:["{name}"],textSize:{stops:[[17,10.5],[19,12.5]]},maxLineChars:8},paint:{color:"#3c3830",haloColor:"#ffffff",haloWidth:1.4}},{id:"building-entrance",type:"symbol",source:"points","source-layer":"entrances",minzoom:17,layout:{iconImage:"entrance",showFor:"highlight",textField:["{ref}"],textSize:{stops:[[17,10],[19,12.5]]},allowOverlap:true,priority:40,iconRotate:"angle",placement:"map",arrowLength:{stops:[[17,22],[18,32],[19,40],[20,48],[22,56]]},arrowWidth:{stops:[[17,6],[18,8.5],[19,10.5],[20,12.5],[22,15]]},arrowOutline:{stops:[[17,1.4],[18,2],[19,2.5],[20,3],[22,3.5]]},arrowGap:{stops:[[17,14],[18,19],[19,23],[20,27],[22,31]]},arrowUnits:"pixels",iconTextGap:3,arrowDotRadius:{stops:[[17,2.2],[18,3.2],[19,4],[20,4.8],[22,5.6]]},arrowDotGap:{stops:[[17,5],[18,7],[19,9],[20,11],[22,12.5]]}},paint:{color:"#2d6ecb",haloColor:"#ffffff",haloWidth:1.6}}],sources:{indoor:{url:"/tileserver/data/indoor/{z}/{x}/{y}.pbf",minzoom:15,maxzoom:18},points:{url:"/tileserver/data/points/{z}/{x}/{y}.pbf",minzoom:13,maxzoom:16},closures:{url:"/closures/tiles/{z}/{x}/{y}.mvt",minzoom:10,maxzoom:16}}};var Ui={version:1,name:"\u0420\u0435\u043B\u044C\u0435\u0444",background:"#eceae4",light:{ambientColor:"#ffffff",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#fff4e2",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#dce6f2",fillIntensity:.18},layers:[{id:"landcover-wood",type:"surface","source-layer":"landcover",filter:["in","class","wood","forest"],paint:{color:"#c6dcb4",opacity:{stops:[[8,.5],[12,.85]]},material:"foliage",materialScale:16,sideShade:.16},elevation:.7,bevel:.5,bevelDrop:.15,cornerRadius:10,cornerSegments:4},{id:"landcover-grass",type:"surface","source-layer":"landcover",filter:["in","class","grass","farmland","meadow"],paint:{color:"#d9e6c6",opacity:{stops:[[8,.45],[12,.8]]},material:"foliage",materialScale:11,sideShade:.16},elevation:.5,bevel:.45,bevelDrop:.12,cornerRadius:8,cornerSegments:4},{id:"landcover-sand",type:"surface","source-layer":"landcover",filter:["in","class","sand","beach"],paint:{color:"#f2e7c8",material:"sand",materialScale:26,sideShade:.16},elevation:.12,bevel:.6,bevelDrop:.08,cornerRadius:10,cornerSegments:4},{id:"landcover-ice",type:"fill","source-layer":"landcover",filter:["in","class","ice","glacier"],paint:{color:"#e6f2f7"}},{id:"landcover-wetland",type:"surface","source-layer":"landcover",filter:["in","class","wetland","swamp"],paint:{color:"#cfe0d4",material:"foliage",materialScale:9,sideShade:.16},elevation:.15,bevel:.5,bevelDrop:.08,cornerRadius:8,cornerSegments:4},{id:"landuse-residential",type:"fill","source-layer":"landuse",filter:["in","class","residential","suburb","neighbourhood","quarter"],paint:{color:"#e6e2da",opacity:{stops:[[10,.4],[14,.7]]}}},{id:"landuse-industrial",type:"fill","source-layer":"landuse",filter:["in","class","industrial","quarry","railway","substation"],paint:{color:"#e7e0dd"}},{id:"landuse-civic",type:"fill","source-layer":"landuse",filter:["in","class","school","university","college","hospital","clinic","police","kindergarten","bus_station"],paint:{color:"#ece3d8"}},{id:"landuse-sport",type:"surface","source-layer":"landuse",filter:["in","class","pitch","stadium","playground","track","swimming_pool"],paint:{color:"#cfe3c4",material:"foliage",materialScale:10,sideShade:.16},elevation:.35,bevel:.4,bevelDrop:.1,cornerRadius:5,cornerSegments:4},{id:"landuse-cemetery",type:"surface","source-layer":"landuse",filter:["in","class","cemetery","grave_yard"],paint:{color:"#d6dfc8",material:"foliage",materialScale:12,sideShade:.16},elevation:.3,bevel:.4,bevelDrop:.1,cornerRadius:5,cornerSegments:4},{id:"landuse-parking",type:"fill","source-layer":"landuse",filter:["in","class","parking","fuel"],paint:{color:"#e8e4dc"}},{id:"park",type:"surface","source-layer":"park",paint:{color:"#cfe5bd",opacity:.75,material:"foliage",materialScale:15,sideShade:.16},elevation:.6,bevel:.5,bevelDrop:.15,cornerRadius:9,cornerSegments:4},{id:"aeroway-area",type:"fill","source-layer":"aeroway",filter:["in","class","aerodrome","apron","helipad"],paint:{color:"#e4e2e6"}},{id:"water",type:"surface","source-layer":"water",filter:["!in","class","swimming_pool"],paint:{color:"#a5cbe3",material:"water",materialScale:14,materialSpeed:1,sideShade:0},elevation:-0.35,bevel:.8,bevelDrop:.12,cornerRadius:7,cornerSegments:4},{id:"water-pool",type:"surface","source-layer":"water",filter:["==","class","swimming_pool"],paint:{color:"#9fd3e8",material:"water",materialScale:8,materialSpeed:1,sideShade:0},elevation:-0.2,bevel:.4,bevelDrop:.08,cornerRadius:4,cornerSegments:4},{id:"waterway",type:"line","source-layer":"waterway",paint:{color:"#a5cbe3",width:{stops:[[8,.6],[12,1.4],[16,4],[19,11.5],[20,23],[21,46],[22,92]]},material:"water",materialScale:10,materialSpeed:1,elevation:-0.3}},{id:"aeroway-line",type:"line","source-layer":"aeroway",filter:["in","class","runway","taxiway"],paint:{color:"#d8d5da",width:{stops:[[10,1],[14,5],[18,24],[19,24],[20,48],[21,96],[22,192]]},material:"asphalt",materialScale:4,elevation:.08}},{id:"road-casing-major",type:"line","source-layer":"transportation",filter:["in","class","motorway","trunk","primary"],minzoom:5,paint:{color:"#d4ab68",width:{stops:[[6,1.6],[10,3.4],[14,8],[16,14],[18,30],[19,45],[20,90],[21,180],[22,360]]},elevation:.15,widthFromData:true,widthExtra:2.5}},{id:"road-casing-secondary",type:"line","source-layer":"transportation",filter:["in","class","secondary","tertiary"],minzoom:9,paint:{color:"#c6bca6",width:{stops:[[10,1.6],[14,5.5],[16,10],[18,22],[19,33],[20,66],[21,132],[22,264]]},elevation:.13,widthFromData:true,widthExtra:2}},{id:"road-casing-minor",type:"line","source-layer":"transportation",filter:["in","class","minor","service","track"],minzoom:12,paint:{color:"#cdc4b2",width:{stops:[[13,1.4],[16,6],[18,14],[19,22],[20,44],[21,88],[22,176]]},elevation:.11,widthFromData:true,widthExtra:1.5}},{id:"road-rail",type:"line","source-layer":"transportation",filter:["in","class","rail","transit"],minzoom:10,paint:{color:"#b2a99e",width:{stops:[[10,.8],[14,1.8],[18,4],[19,5.5],[20,11],[21,22],[22,44]]},elevation:.12}},{id:"road-path",type:"line","source-layer":"transportation",filter:["in","class","path","pedestrian","footway","steps"],minzoom:14,paint:{color:"#bdb2a0",width:{stops:[[14,.8],[17,2],[19,4],[20,8],[21,16],[22,32]]},dashArray:[4,3],material:"asphalt",materialScale:2,elevation:.05}},{id:"road-minor",type:"line","source-layer":"transportation",filter:["in","class","minor","service","track"],minzoom:12,paint:{color:"#ffffff",width:{stops:[[13,.6],[16,4],[18,11],[19,18],[20,36],[21,72],[22,144]]},material:"asphalt",materialScale:3,elevation:.14,widthFromData:true}},{id:"road-secondary",type:"line","source-layer":"transportation",filter:["in","class","secondary","tertiary"],minzoom:9,paint:{color:"#ffffff",width:{stops:[[10,.8],[14,3.6],[16,7.5],[18,18],[19,28],[20,56],[21,112],[22,224]]},material:"asphalt",materialScale:3,elevation:.16,widthFromData:true}},{id:"road-major",type:"line","source-layer":"transportation",filter:["in","class","motorway","trunk","primary"],minzoom:5,paint:{color:"#ffdfa3",width:{stops:[[6,.8],[10,2.2],[14,6],[16,11],[18,25],[19,38.5],[20,77],[21,154],[22,308]]},material:"asphalt",materialScale:3,elevation:.18,widthFromData:true}},{id:"road-lane-divider-major",type:"line","source-layer":"transportation",filter:["all",["!has","oneway"],["in","class","motorway","trunk","primary"]],minzoom:16.5,paint:{color:"#e3bd7f",width:{stops:[[16.5,.54],[17,.78],[18,1.4],[19,2.17],[20,4.34],[21,8.68],[22,17.36]]},dashArray:[7,18],material:"flat",elevation:.182}},{id:"road-lane-divider-secondary",type:"line","source-layer":"transportation",filter:["all",["!has","oneway"],["in","class","secondary","tertiary"]],minzoom:16.5,paint:{color:"#d8cfbc",width:{stops:[[16.5,.46],[17,.67],[18,1.2],[19,1.86],[20,3.72],[21,7.44],[22,14.88]]},dashArray:[7,18],material:"flat",elevation:.162}},{id:"boundary",type:"line","source-layer":"boundary",filter:["<=","admin_level",4],paint:{color:"#b3a6b8",opacity:.7,width:{stops:[[4,.7],[10,1.4],[16,2.4]]},dashArray:[6,4]}},{id:"building",type:"fill-extrusion","source-layer":"building",minzoom:15,paint:{color:"#d8d3c8",roofColor:"#d9d3c7",opacity:1,heightScale:{stops:[[15,0],[15.8,1]]},aoStrength:.18,tintVariation:.06,windowColor:"#7f9ab5",windowFrameColor:"#e9e5dc",windowGlow:0,facadeDetail:1,floorHeight:3.2,roofVariation:.35}},{id:"indoor-venue",type:"fill-extrusion",source:"indoor","source-layer":"area",filter:["all",["==","class","level"],["==","base",1]],minzoom:15,maxzoom:16,paint:{color:"#d8d3c8",roofColor:"#d9d3c7",opacity:1,aoStrength:.18,tintVariation:.06,windowColor:"#7f9ab5",windowFrameColor:"#e9e5dc",windowGlow:0,facadeDetail:1,floorHeight:3.2,roofVariation:.35}},{id:"road-closed-casing",type:"line",source:"closures","source-layer":"closures",minzoom:11,paint:{color:"#ffffff",width:{stops:[[11,4],[14,6],[17,10],[19,16],[20,32],[21,64],[22,128]]},opacity:.9},overlay:true},{id:"road-closed",type:"line",source:"closures","source-layer":"closures",minzoom:11,paint:{color:"#d92b2b",width:{stops:[[11,2.5],[14,4],[17,7],[19,11],[20,22],[21,44],[22,88]]},dashArray:[5,4]},overlay:true},{id:"crossing",type:"surface",source:"points","source-layer":"crossings",minzoom:16.5,overlay:true,paint:{color:"#ffffff",opacity:.9,sideShade:.16},elevation:.09,bevel:.05,bevelDrop:.02,groundBy:{"landcover:wood":.7,"landcover:forest":.7,"landcover:grass":.5,"landcover:farmland":.5,"landcover:meadow":.5,"landcover:sand":.12,"landcover:beach":.12,"landcover:wetland":.15,"landcover:swamp":.15,"landuse:pitch":.35,"landuse:stadium":.35,"landuse:playground":.35,"landuse:track":.35,"landuse:swimming_pool":.35,"landuse:cemetery":.3,"landuse:grave_yard":.3,"park:park":.6}},{id:"housenumber",type:"symbol","source-layer":"housenumber",minzoom:17,layout:{textField:"{housenumber}",textSize:{stops:[[17,9],[19,11]]},maxLineChars:6,priority:-60},paint:{color:"#8c8478",haloColor:"#f5f3ee",haloWidth:1}},{id:"poi-food",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#c2681c",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#c2681c",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","cafe","restaurant","fast_food","bar","pub","beer","bakery","ice_cream"]},{id:"poi-shop",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#2f77c4",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#2f77c4",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","shop","clothing_store","grocery","alcohol_shop","music","laundry","hairdresser","car","bicycle"]},{id:"poi-transport",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#3b82a6",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#3b82a6",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","bus","railway","parking","fuel","bicycle_parking","bicycle_rental","taxi","airport"]},{id:"poi-health",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#c24444",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#c24444",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","pharmacy","hospital","doctors","dentist","veterinary"]},{id:"poi-education",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#3f7f7a",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#3f7f7a",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","school","college","university","library","kindergarten"]},{id:"poi-culture",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#8b5aa5",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#8b5aa5",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","museum","theatre","cinema","art_gallery","attraction","monument","zoo","theme_park","castle","place_of_worship","information"]},{id:"poi-sport",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#4f8b45",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#4f8b45",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","pitch","park","garden","playground","stadium","sports_centre","swimming_pool","athletics","running"]},{id:"poi-lodging",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#7a5fbf",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#7a5fbf",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","lodging"]},{id:"poi-service",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#59636e",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#59636e",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","bank","atm","post","office","town_hall","police","fire_station","toilets"]},{id:"poi",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#4a4a4a",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#4a4a4a",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["!in","class","cafe","restaurant","fast_food","bar","pub","beer","bakery","ice_cream","shop","clothing_store","grocery","alcohol_shop","music","laundry","hairdresser","car","bicycle","bus","railway","parking","fuel","bicycle_parking","bicycle_rental","taxi","airport","pharmacy","hospital","doctors","dentist","veterinary","school","college","university","library","kindergarten","museum","theatre","cinema","art_gallery","attraction","monument","zoo","theme_park","castle","place_of_worship","information","pitch","park","garden","playground","stadium","sports_centre","swimming_pool","athletics","running","lodging","bank","atm","post","office","town_hall","police","fire_station","toilets"]},{id:"traffic-signal",type:"symbol",source:"points","source-layer":"roadpoints",minzoom:16,filter:["==","kind","traffic_signals"],layout:{iconImage:"traffic_signals",priority:3},paint:{color:"#5c6470",haloColor:"#ffffff",haloWidth:1.4,iconSize:15}},{id:"road-shield",type:"symbol","source-layer":"transportation_name",filter:["has","ref"],minzoom:11,layout:{textField:"{ref}",iconImage:"shield-{ref_length}",iconPlacement:"behind",textSize:{stops:[[11,9.5],[16,11]]},iconTextGap:4,maxLineChars:10,collisionPadding:70,priority:3},paint:{color:"#3a4048",haloColor:"#f7f3e8",haloWidth:.5,iconColor:"#f7f3e8",iconHaloColor:"#8a8172",iconHaloWidth:1.4}},{id:"road-label",type:"symbol","source-layer":"transportation_name",minzoom:14,layout:{textField:["{name:ru}","{name}"],textPlacement:"line",textSize:{stops:[[14,10],[18,13]]},priority:20,abbreviate:true},paint:{color:"#5c5646",haloColor:"#ffffff",haloWidth:1.6}},{id:"water-label",type:"symbol","source-layer":"water_name",minzoom:10,layout:{textField:["{name:ru}","{name}"],textSize:{stops:[[10,11],[16,14]]},priority:30},paint:{color:"#3d7ea6",haloColor:"#ffffff",haloWidth:1.4}},{id:"place-label",type:"symbol","source-layer":"place",minzoom:4,layout:{textField:["{name:ru}","{name}"],textSize:{stops:[[6,12],[12,17],[16,22]]},maxLineChars:16,priority:90},paint:{color:"#3a3a3a",haloColor:"#ffffff",haloWidth:1.8}},{id:"indoor-shell",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","level"],minzoom:16,paint:{color:"#f6f3ec",opacity:.97},clipToTile:true},{id:"indoor-corridor",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","corridor"],minzoom:16,paint:{color:"#ffffff"},clipToTile:true},{id:"indoor-room",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["in","class","room","area"],minzoom:16,paint:{color:"#efeae0"},clipToTile:true},{id:"indoor-service",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","service"],minzoom:16,paint:{color:"#e6e1d6"},clipToTile:true},{id:"indoor-shop",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","shop"],minzoom:16,paint:{color:"#e8e0f0"},clipToTile:true},{id:"indoor-food",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","food"],minzoom:16,paint:{color:"#f7e3cd"},clipToTile:true},{id:"indoor-wc",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","wc"],minzoom:16,paint:{color:"#d8e8f2"},clipToTile:true},{id:"indoor-wall",type:"fill-extrusion",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","wall"],minzoom:16,paint:{color:"#cbc4b8",roofColor:"#e4ded2",facadeDetail:0,tintVariation:0,roofVariation:0,aoStrength:0}},{id:"indoor-transportation",type:"fill",source:"indoor","source-layer":"transportation",splitBy:"level",minzoom:16,paint:{color:"#d9d2e8",opacity:.95},clipToTile:true},{id:"indoor-door",type:"symbol",source:"indoor","source-layer":"poi",filter:["==","class","door"],splitBy:"level",minzoom:18,layout:{iconImage:"door",iconSize:{stops:[[18,9],[20,13]]},allowOverlap:true,priority:-10},paint:{color:"#8a8172",haloColor:"#ffffff",haloWidth:1.2}},{id:"indoor-poi",type:"symbol",source:"indoor","source-layer":"poi",splitBy:"level",minzoom:17,layout:{textField:["{name}"],iconImage:"{class}",textSize:{stops:[[17,10],[19,12]]},iconSize:{stops:[[17,12],[19,15]]},iconTextGap:2,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#4a4a4a",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:.32}},{id:"indoor-name",type:"symbol",source:"indoor","source-layer":"area_name",splitBy:"level",minzoom:17,layout:{textField:["{name}"],textSize:{stops:[[17,10.5],[19,12.5]]},maxLineChars:8},paint:{color:"#3c3830",haloColor:"#ffffff",haloWidth:1.4}},{id:"building-entrance",type:"symbol",source:"points","source-layer":"entrances",minzoom:17,layout:{iconImage:"entrance",showFor:"highlight",textField:["{ref}"],textSize:{stops:[[17,10],[19,12.5]]},allowOverlap:true,priority:40,iconRotate:"angle",placement:"map",arrowLength:{stops:[[17,22],[18,32],[19,40],[20,48],[22,56]]},arrowWidth:{stops:[[17,6],[18,8.5],[19,10.5],[20,12.5],[22,15]]},arrowOutline:{stops:[[17,1.4],[18,2],[19,2.5],[20,3],[22,3.5]]},arrowGap:{stops:[[17,14],[18,19],[19,23],[20,27],[22,31]]},arrowUnits:"pixels",iconTextGap:3,arrowDotRadius:{stops:[[17,2.2],[18,3.2],[19,4],[20,4.8],[22,5.6]]},arrowDotGap:{stops:[[17,5],[18,7],[19,9],[20,11],[22,12.5]]}},paint:{color:"#2d6ecb",haloColor:"#ffffff",haloWidth:1.6}}],sources:{indoor:{url:"/tileserver/data/indoor/{z}/{x}/{y}.pbf",minzoom:15,maxzoom:18},points:{url:"/tileserver/data/points/{z}/{x}/{y}.pbf",minzoom:13,maxzoom:16},closures:{url:"/closures/tiles/{z}/{x}/{y}.mvt",minzoom:10,maxzoom:16}}};var Ji={version:1,name:"\u041E\u0431\u044A\u0451\u043C\u043D\u044B\u0439 \u0433\u043E\u0440\u043E\u0434",background:"#eceae4",light:{ambientColor:"#ffffff",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#fff4e2",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#dce6f2",fillIntensity:.18},layers:[{id:"landcover-wood",type:"surface","source-layer":"landcover",filter:["in","class","wood","forest"],paint:{color:"#c6dcb4",opacity:{stops:[[8,.5],[12,.85]]},material:"flat",sideShade:.16},elevation:.175,bevel:.125,bevelDrop:.038,cornerRadius:10,cornerSegments:4},{id:"landcover-grass",type:"surface","source-layer":"landcover",filter:["in","class","grass","farmland","meadow"],paint:{color:"#d9e6c6",opacity:{stops:[[8,.45],[12,.8]]},material:"flat",sideShade:.16},elevation:.125,bevel:.113,bevelDrop:.03,cornerRadius:8,cornerSegments:4},{id:"landcover-sand",type:"surface","source-layer":"landcover",filter:["in","class","sand","beach"],paint:{color:"#f2e7c8",material:"flat",sideShade:.16},elevation:.035,bevel:.15,bevelDrop:.02,cornerRadius:10,cornerSegments:4},{id:"landcover-ice",type:"fill","source-layer":"landcover",filter:["in","class","ice","glacier"],paint:{color:"#e6f2f7"}},{id:"landcover-wetland",type:"surface","source-layer":"landcover",filter:["in","class","wetland","swamp"],paint:{color:"#cfe0d4",material:"flat",sideShade:.16},elevation:.045,bevel:.125,bevelDrop:.02,cornerRadius:8,cornerSegments:4},{id:"landuse-residential",type:"surface","source-layer":"landuse",filter:["in","class","residential","suburb","neighbourhood","quarter"],paint:{color:"#e6e2da",opacity:{stops:[[10,.4],[14,.7]]},material:"flat",sideShade:.16},cornerRadius:4,cornerSegments:3,elevation:.02,bevel:.1,bevelDrop:.02},{id:"landuse-industrial",type:"surface","source-layer":"landuse",filter:["in","class","industrial","quarry","railway","substation"],paint:{color:"#e7e0dd",material:"flat",sideShade:.16},cornerRadius:4,cornerSegments:3,elevation:.03,bevel:.1,bevelDrop:.02},{id:"landuse-civic",type:"surface","source-layer":"landuse",filter:["in","class","school","university","college","hospital","clinic","police","kindergarten","bus_station"],paint:{color:"#ece3d8",material:"flat",sideShade:.16},cornerRadius:4,cornerSegments:3,elevation:.055,bevel:.1,bevelDrop:.02},{id:"landuse-sport",type:"surface","source-layer":"landuse",filter:["in","class","pitch","stadium","playground","track","swimming_pool"],paint:{color:"#cfe3c4",material:"flat",sideShade:.16},elevation:.088,bevel:.1,bevelDrop:.025,cornerRadius:5,cornerSegments:3},{id:"landuse-cemetery",type:"surface","source-layer":"landuse",filter:["in","class","cemetery","grave_yard"],paint:{color:"#d6dfc8",material:"flat",sideShade:.16},elevation:.075,bevel:.1,bevelDrop:.025,cornerRadius:5,cornerSegments:3},{id:"landuse-parking",type:"surface","source-layer":"landuse",filter:["in","class","parking","fuel"],paint:{color:"#e8e4dc",material:"flat",sideShade:.16},cornerRadius:3,cornerSegments:3,elevation:.19,bevel:.1,bevelDrop:.02},{id:"park",type:"surface","source-layer":"park",paint:{color:"#cfe5bd",opacity:.75,material:"flat",sideShade:.16},elevation:.15,bevel:.125,bevelDrop:.038,cornerRadius:9,cornerSegments:4},{id:"aeroway-area",type:"surface","source-layer":"aeroway",filter:["in","class","aerodrome","apron","helipad"],paint:{color:"#e4e2e6",material:"flat",sideShade:.16},cornerRadius:5,cornerSegments:3,elevation:.065,bevel:.1,bevelDrop:.02},{id:"water",type:"surface","source-layer":"water",filter:["!in","class","swimming_pool"],paint:{color:"#a5cbe3",material:"water",materialScale:14,materialSpeed:1,sideShade:0},elevation:-0.087,bevel:.2,bevelDrop:.03,cornerRadius:7,cornerSegments:4},{id:"water-pool",type:"surface","source-layer":"water",filter:["==","class","swimming_pool"],paint:{color:"#9fd3e8",material:"water",materialScale:8,materialSpeed:1,sideShade:0},elevation:-0.05,bevel:.1,bevelDrop:.02,cornerRadius:4,cornerSegments:3},{id:"waterway",type:"line","source-layer":"waterway",paint:{color:"#a5cbe3",width:{stops:[[8,.6],[12,1.4],[16,4],[19,11.5],[20,23],[21,46],[22,92]]},material:"water",materialScale:10,materialSpeed:1,elevation:-0.075}},{id:"aeroway-line",type:"line","source-layer":"aeroway",filter:["in","class","runway","taxiway"],paint:{color:"#d8d5da",width:{stops:[[10,1],[14,5],[18,24],[19,24],[20,48],[21,96],[22,192]]},material:"flat",elevation:.02}},{id:"road-casing-major",type:"line","source-layer":"transportation",filter:["in","class","motorway","trunk","primary"],minzoom:5,paint:{color:"#d4ab68",width:{stops:[[6,1.6],[10,3.4],[14,8],[16,14],[18,30],[19,45],[20,90],[21,180],[22,360]]},elevation:.037,widthFromData:true,widthExtra:2.5}},{id:"road-casing-secondary",type:"line","source-layer":"transportation",filter:["in","class","secondary","tertiary"],minzoom:9,paint:{color:"#c6bca6",width:{stops:[[10,1.6],[14,5.5],[16,10],[18,22],[19,33],[20,66],[21,132],[22,264]]},elevation:.033,widthFromData:true,widthExtra:2}},{id:"road-casing-minor",type:"line","source-layer":"transportation",filter:["in","class","minor","service","track"],minzoom:12,paint:{color:"#cdc4b2",width:{stops:[[13,1.4],[16,6],[18,14],[19,22],[20,44],[21,88],[22,176]]},elevation:.028,widthFromData:true,widthExtra:1.5}},{id:"road-rail",type:"line","source-layer":"transportation",filter:["in","class","rail","transit"],minzoom:10,paint:{color:"#b2a99e",width:{stops:[[10,.8],[14,1.8],[18,4],[19,5.5],[20,11],[21,22],[22,44]]},elevation:.03}},{id:"road-path",type:"line","source-layer":"transportation",filter:["in","class","path","pedestrian","footway","steps"],minzoom:14,paint:{color:"#bdb2a0",width:{stops:[[14,.8],[17,2],[19,4],[20,8],[21,16],[22,32]]},dashArray:[4,3],material:"flat",elevation:.013}},{id:"road-minor",type:"line","source-layer":"transportation",filter:["in","class","minor","service","track"],minzoom:12,paint:{color:"#ffffff",width:{stops:[[13,.6],[16,4],[18,11],[19,18],[20,36],[21,72],[22,144]]},material:"flat",elevation:.035,widthFromData:true}},{id:"road-secondary",type:"line","source-layer":"transportation",filter:["in","class","secondary","tertiary"],minzoom:9,paint:{color:"#ffffff",width:{stops:[[10,.8],[14,3.6],[16,7.5],[18,18],[19,28],[20,56],[21,112],[22,224]]},material:"flat",elevation:.04,widthFromData:true}},{id:"road-major",type:"line","source-layer":"transportation",filter:["in","class","motorway","trunk","primary"],minzoom:5,paint:{color:"#ffdfa3",width:{stops:[[6,.8],[10,2.2],[14,6],[16,11],[18,25],[19,38.5],[20,77],[21,154],[22,308]]},material:"flat",elevation:.045,widthFromData:true}},{id:"road-lane-divider-major",type:"line","source-layer":"transportation",filter:["all",["!has","oneway"],["in","class","motorway","trunk","primary"]],minzoom:16.5,paint:{color:"#e3bd7f",width:{stops:[[16.5,.54],[17,.78],[18,1.4],[19,2.17],[20,4.34],[21,8.68],[22,17.36]]},dashArray:[7,18],material:"flat",elevation:.047}},{id:"road-lane-divider-secondary",type:"line","source-layer":"transportation",filter:["all",["!has","oneway"],["in","class","secondary","tertiary"]],minzoom:16.5,paint:{color:"#d8cfbc",width:{stops:[[16.5,.46],[17,.67],[18,1.2],[19,1.86],[20,3.72],[21,7.44],[22,14.88]]},dashArray:[7,18],material:"flat",elevation:.042}},{id:"boundary",type:"line","source-layer":"boundary",filter:["<=","admin_level",4],paint:{color:"#b3a6b8",opacity:.7,width:{stops:[[4,.7],[10,1.4],[16,2.4]]},dashArray:[6,4]}},{id:"building",type:"fill-extrusion","source-layer":"building",minzoom:15,paint:{color:"#d8d3c8",roofColor:"#d9d3c7",opacity:1,heightScale:{stops:[[15,0],[15.8,1]]},aoStrength:.18,tintVariation:.06,windowColor:"#7f9ab5",windowFrameColor:"#e9e5dc",windowGlow:0,facadeDetail:1,floorHeight:3.2,roofVariation:.35},cornerRadius:1.6,cornerSegments:2},{id:"indoor-venue",type:"fill-extrusion",source:"indoor","source-layer":"area",filter:["all",["==","class","level"],["==","base",1]],minzoom:15,maxzoom:16,paint:{color:"#d8d3c8",roofColor:"#d9d3c7",opacity:1,aoStrength:.18,tintVariation:.06,windowColor:"#7f9ab5",windowFrameColor:"#e9e5dc",windowGlow:0,facadeDetail:1,floorHeight:3.2,roofVariation:.35}},{id:"road-closed-casing",type:"line",source:"closures","source-layer":"closures",minzoom:11,paint:{color:"#ffffff",width:{stops:[[11,4],[14,6],[17,10],[19,16],[20,32],[21,64],[22,128]]},opacity:.9},overlay:true},{id:"road-closed",type:"line",source:"closures","source-layer":"closures",minzoom:11,paint:{color:"#d92b2b",width:{stops:[[11,2.5],[14,4],[17,7],[19,11],[20,22],[21,44],[22,88]]},dashArray:[5,4]},overlay:true},{id:"crossing",type:"surface",source:"points","source-layer":"crossings",minzoom:16.5,overlay:true,paint:{color:"#ffffff",opacity:.9,sideShade:.16,material:"flat"},elevation:.023,bevel:.013,bevelDrop:.005,groundBy:{"landcover:wood":.175,"landcover:forest":.175,"landcover:grass":.125,"landcover:farmland":.125,"landcover:meadow":.125,"landcover:sand":.035,"landcover:beach":.035,"landcover:wetland":.045,"landcover:swamp":.045,"landuse:residential":.02,"landuse:suburb":.02,"landuse:neighbourhood":.02,"landuse:quarter":.02,"landuse:industrial":.03,"landuse:quarry":.03,"landuse:railway":.03,"landuse:substation":.03,"landuse:school":.055,"landuse:university":.055,"landuse:college":.055,"landuse:hospital":.055,"landuse:clinic":.055,"landuse:police":.055,"landuse:kindergarten":.055,"landuse:bus_station":.055,"landuse:pitch":.088,"landuse:stadium":.088,"landuse:playground":.088,"landuse:track":.088,"landuse:swimming_pool":.088,"landuse:cemetery":.075,"landuse:grave_yard":.075,"landuse:parking":.19,"landuse:fuel":.19,"park:park":.15,"aeroway:aerodrome":.065,"aeroway:apron":.065,"aeroway:helipad":.065}},{id:"housenumber",type:"symbol","source-layer":"housenumber",minzoom:17,layout:{textField:"{housenumber}",textSize:{stops:[[17,9],[19,11]]},maxLineChars:6,priority:-60},paint:{color:"#8c8478",haloColor:"#f5f3ee",haloWidth:1}},{id:"poi-food",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#c2681c",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#c2681c",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","cafe","restaurant","fast_food","bar","pub","beer","bakery","ice_cream"]},{id:"poi-shop",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#2f77c4",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#2f77c4",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","shop","clothing_store","grocery","alcohol_shop","music","laundry","hairdresser","car","bicycle"]},{id:"poi-transport",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#3b82a6",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#3b82a6",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","bus","railway","parking","fuel","bicycle_parking","bicycle_rental","taxi","airport"]},{id:"poi-health",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#c24444",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#c24444",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","pharmacy","hospital","doctors","dentist","veterinary"]},{id:"poi-education",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#3f7f7a",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#3f7f7a",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","school","college","university","library","kindergarten"]},{id:"poi-culture",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#8b5aa5",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#8b5aa5",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","museum","theatre","cinema","art_gallery","attraction","monument","zoo","theme_park","castle","place_of_worship","information"]},{id:"poi-sport",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#4f8b45",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#4f8b45",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","pitch","park","garden","playground","stadium","sports_centre","swimming_pool","athletics","running"]},{id:"poi-lodging",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#7a5fbf",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#7a5fbf",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","lodging"]},{id:"poi-service",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#59636e",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#59636e",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","bank","atm","post","office","town_hall","police","fire_station","toilets"]},{id:"poi",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#4a4a4a",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#4a4a4a",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["!in","class","cafe","restaurant","fast_food","bar","pub","beer","bakery","ice_cream","shop","clothing_store","grocery","alcohol_shop","music","laundry","hairdresser","car","bicycle","bus","railway","parking","fuel","bicycle_parking","bicycle_rental","taxi","airport","pharmacy","hospital","doctors","dentist","veterinary","school","college","university","library","kindergarten","museum","theatre","cinema","art_gallery","attraction","monument","zoo","theme_park","castle","place_of_worship","information","pitch","park","garden","playground","stadium","sports_centre","swimming_pool","athletics","running","lodging","bank","atm","post","office","town_hall","police","fire_station","toilets"]},{id:"traffic-signal",type:"symbol",source:"points","source-layer":"roadpoints",minzoom:16,filter:["==","kind","traffic_signals"],layout:{iconImage:"traffic_signals",priority:3},paint:{color:"#5c6470",haloColor:"#ffffff",haloWidth:1.4,iconSize:15}},{id:"road-shield",type:"symbol","source-layer":"transportation_name",filter:["has","ref"],minzoom:11,layout:{textField:"{ref}",iconImage:"shield-{ref_length}",iconPlacement:"behind",textSize:{stops:[[11,9.5],[16,11]]},iconTextGap:4,maxLineChars:10,collisionPadding:70,priority:3},paint:{color:"#3a4048",haloColor:"#f7f3e8",haloWidth:.5,iconColor:"#f7f3e8",iconHaloColor:"#8a8172",iconHaloWidth:1.4}},{id:"road-label",type:"symbol","source-layer":"transportation_name",minzoom:14,layout:{textField:["{name:ru}","{name}"],textPlacement:"line",textSize:{stops:[[14,10],[18,13]]},priority:20,abbreviate:true},paint:{color:"#5c5646",haloColor:"#ffffff",haloWidth:1.6}},{id:"water-label",type:"symbol","source-layer":"water_name",minzoom:10,layout:{textField:["{name:ru}","{name}"],textSize:{stops:[[10,11],[16,14]]},priority:30},paint:{color:"#3d7ea6",haloColor:"#ffffff",haloWidth:1.4}},{id:"place-label",type:"symbol","source-layer":"place",minzoom:4,layout:{textField:["{name:ru}","{name}"],textSize:{stops:[[6,12],[12,17],[16,22]]},maxLineChars:16,priority:90},paint:{color:"#3a3a3a",haloColor:"#ffffff",haloWidth:1.8}},{id:"indoor-shell",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","level"],minzoom:16,paint:{color:"#f6f3ec",opacity:.97},clipToTile:true},{id:"indoor-corridor",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","corridor"],minzoom:16,paint:{color:"#ffffff"},clipToTile:true},{id:"indoor-room",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["in","class","room","area"],minzoom:16,paint:{color:"#efeae0"},clipToTile:true},{id:"indoor-service",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","service"],minzoom:16,paint:{color:"#e6e1d6"},clipToTile:true},{id:"indoor-shop",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","shop"],minzoom:16,paint:{color:"#e8e0f0"},clipToTile:true},{id:"indoor-food",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","food"],minzoom:16,paint:{color:"#f7e3cd"},clipToTile:true},{id:"indoor-wc",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","wc"],minzoom:16,paint:{color:"#d8e8f2"},clipToTile:true},{id:"indoor-wall",type:"fill-extrusion",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","wall"],minzoom:16,paint:{color:"#cbc4b8",roofColor:"#e4ded2",facadeDetail:0,tintVariation:0,roofVariation:0,aoStrength:0}},{id:"indoor-transportation",type:"fill",source:"indoor","source-layer":"transportation",splitBy:"level",minzoom:16,paint:{color:"#d9d2e8",opacity:.95},clipToTile:true},{id:"indoor-door",type:"symbol",source:"indoor","source-layer":"poi",filter:["==","class","door"],splitBy:"level",minzoom:18,layout:{iconImage:"door",iconSize:{stops:[[18,9],[20,13]]},allowOverlap:true,priority:-10},paint:{color:"#8a8172",haloColor:"#ffffff",haloWidth:1.2}},{id:"indoor-poi",type:"symbol",source:"indoor","source-layer":"poi",splitBy:"level",minzoom:17,layout:{textField:["{name}"],iconImage:"{class}",textSize:{stops:[[17,10],[19,12]]},iconSize:{stops:[[17,12],[19,15]]},iconTextGap:2,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#4a4a4a",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:.32}},{id:"indoor-name",type:"symbol",source:"indoor","source-layer":"area_name",splitBy:"level",minzoom:17,layout:{textField:["{name}"],textSize:{stops:[[17,10.5],[19,12.5]]},maxLineChars:8},paint:{color:"#3c3830",haloColor:"#ffffff",haloWidth:1.4}},{id:"building-entrance",type:"symbol",source:"points","source-layer":"entrances",minzoom:17,layout:{iconImage:"entrance",showFor:"highlight",textField:["{ref}"],textSize:{stops:[[17,10],[19,12.5]]},allowOverlap:true,priority:40,iconRotate:"angle",placement:"map",arrowLength:{stops:[[17,22],[18,32],[19,40],[20,48],[22,56]]},arrowWidth:{stops:[[17,6],[18,8.5],[19,10.5],[20,12.5],[22,15]]},arrowOutline:{stops:[[17,1.4],[18,2],[19,2.5],[20,3],[22,3.5]]},arrowGap:{stops:[[17,14],[18,19],[19,23],[20,27],[22,31]]},arrowUnits:"pixels",iconTextGap:3,arrowDotRadius:{stops:[[17,2.2],[18,3.2],[19,4],[20,4.8],[22,5.6]]},arrowDotGap:{stops:[[17,5],[18,7],[19,9],[20,11],[22,12.5]]}},paint:{color:"#2d6ecb",haloColor:"#ffffff",haloWidth:1.6}}],sources:{indoor:{url:"/tileserver/data/indoor/{z}/{x}/{y}.pbf",minzoom:15,maxzoom:18},points:{url:"/tileserver/data/points/{z}/{x}/{y}.pbf",minzoom:13,maxzoom:16},closures:{url:"/closures/tiles/{z}/{x}/{y}.mvt",minzoom:10,maxzoom:16}}};var Xi={name:"\u041D\u043E\u0447\u043D\u0430\u044F",background:"#11151c",model3dKey:"night",light:{ambientColor:"#8fa3c4",ambientIntensity:.34,keyAzimuth:120,keyAltitude:55,keyColor:"#cfd8ea",keyIntensity:.3,fillAzimuth:300,fillAltitude:20,fillColor:"#4a5f86",fillIntensity:.22},paint:{"landcover-wood":{color:"#16261a"},"landcover-grass":{color:"#182619"},"landcover-sand":{color:"#2a2417"},"landcover-ice":{color:"#1b2730"},"landcover-wetland":{color:"#16242a"},"landuse-residential":{color:"#171b23"},"landuse-industrial":{color:"#1b1c20"},"landuse-civic":{color:"#1c1f28"},"landuse-sport":{color:"#16261c"},"landuse-cemetery":{color:"#182018"},"landuse-parking":{color:"#191d24"},park:{color:"#15271a"},"aeroway-area":{color:"#1b1e26"},water:{color:"#0f2438"},"water-pool":{color:"#123048"},waterway:{color:"#14304a"},"aeroway-line":{color:"#242833"},"road-casing-major":{color:"#2a2519"},"road-casing-secondary":{color:"#22262f"},"road-casing-minor":{color:"#1e222a"},"road-rail":{color:"#333842"},"road-path":{color:"#2a2e36"},"road-minor":{color:"#2f343d"},"road-secondary":{color:"#3c424d"},"road-major":{color:"#6b5c3c"},boundary:{color:"#4a3f52"},building:{color:"#232833",roofColor:"#2b313d",aoStrength:.3,tintVariation:.1,windowColor:"#8fb8e8",windowFrameColor:"#39424f",windowGlow:.35},housenumber:{color:"#5f6672",haloColor:"#12161d"},poi:{color:"#c3ccd9",haloColor:"#12161d",haloWidth:1.3},"road-label":{color:"#a8b0bd",haloColor:"#12161d",haloWidth:1.5},"water-label":{color:"#6ea2c7",haloColor:"#0e1b28"},"place-label":{color:"#e2e7ee",haloColor:"#10141b",haloWidth:2},"poi-food":{color:"#d89964",haloColor:"#12161d",haloWidth:1.3,frameColor:"#d89964",frameOpacity:1,frameHaloColor:"#12161d",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-shop":{color:"#699cd4",haloColor:"#12161d",haloWidth:1.3,frameColor:"#699cd4",frameOpacity:1,frameHaloColor:"#12161d",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-transport":{color:"#75acc8",haloColor:"#12161d",haloWidth:1.3,frameColor:"#75acc8",frameOpacity:1,frameHaloColor:"#12161d",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-health":{color:"#ca7272",haloColor:"#12161d",haloWidth:1.3,frameColor:"#ca7272",frameOpacity:1,frameHaloColor:"#12161d",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-education":{color:"#81bbb7",haloColor:"#12161d",haloWidth:1.3,frameColor:"#81bbb7",frameOpacity:1,frameHaloColor:"#12161d",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-culture":{color:"#a684b8",haloColor:"#12161d",haloWidth:1.3,frameColor:"#a684b8",frameOpacity:1,frameHaloColor:"#12161d",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-sport":{color:"#89bb81",haloColor:"#12161d",haloWidth:1.3,frameColor:"#89bb81",frameOpacity:1,frameHaloColor:"#12161d",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-lodging":{color:"#8e79c3",haloColor:"#12161d",haloWidth:1.3,frameColor:"#8e79c3",frameOpacity:1,frameHaloColor:"#12161d",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-service":{color:"#959ea7",haloColor:"#12161d",haloWidth:1.3,frameColor:"#959ea7",frameOpacity:1,frameHaloColor:"#12161d",iconColor:"#1b1b1b",iconHaloWidth:0},"building-entrance":{color:"#79a0d7",haloColor:"#12161d"},"indoor-shell":{color:"#3a4254",opacity:.97},"indoor-corridor":{color:"#363d4e"},"indoor-room":{color:"#414a5f"},"indoor-service":{color:"#535f79"},"indoor-shop":{color:"#5c4672"},"indoor-food":{color:"#725d46"},"indoor-wc":{color:"#466172"},"indoor-wall":{color:"#697183",roofColor:"#868c99",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#65548a",opacity:.95},"indoor-door":{color:"#c3ccd9",haloColor:"#12161d",haloWidth:1.3},"indoor-poi":{color:"#c3ccd9",haloColor:"#12161d",haloWidth:1.3},"indoor-name":{color:"#e2e7ee",haloColor:"#10141b",haloWidth:2}},sky:{skyColor:"#080d18",horizonColor:"#1b2436",fogRange:[1.3,6.5],fogIntensity:.9,spaceColor:"#02030a",atmosphereColor:"#3f6fa8",starIntensity:.8}};var ji={name:"\u0413\u0440\u0430\u0444\u0438\u0442",background:"#eeeeee",light:{ambientColor:"#ffffff",ambientIntensity:.55,keyAzimuth:120,keyAltitude:60,keyColor:"#ffffff",keyIntensity:.5,fillAzimuth:300,fillAltitude:25,fillColor:"#ffffff",fillIntensity:.16},paint:{"landcover-wood":{color:"#e2e2e2"},"landcover-grass":{color:"#e7e7e7"},"landcover-sand":{color:"#eaeaea"},"landcover-ice":{color:"#f0f0f0"},"landcover-wetland":{color:"#e4e4e4"},"landuse-residential":{color:"#e9e9e9"},"landuse-industrial":{color:"#e5e5e5"},"landuse-civic":{color:"#ebebeb"},"landuse-sport":{color:"#e4e4e4"},"landuse-cemetery":{color:"#e6e6e6"},"landuse-parking":{color:"#ececec"},park:{color:"#e3e3e3"},"aeroway-area":{color:"#e8e8e8"},water:{color:"#d4d4d4"},"water-pool":{color:"#d8d8d8"},waterway:{color:"#d4d4d4"},"aeroway-line":{color:"#dedede"},"road-casing-major":{color:"#c9c9c9"},"road-casing-secondary":{color:"#d2d2d2"},"road-casing-minor":{color:"#d8d8d8"},"road-rail":{color:"#c2c2c2"},"road-path":{color:"#d0d0d0"},"road-minor":{color:"#f7f7f7"},"road-secondary":{color:"#fbfbfb"},"road-major":{color:"#ffffff"},boundary:{color:"#b0b0b0"},building:{color:"#dcdcdc",roofColor:"#e0e0e0",aoStrength:.22,tintVariation:.05,windowColor:"#b7bcc2",windowFrameColor:"#f2f2f2",windowGlow:0},housenumber:{color:"#9a9a9a",haloColor:"#f4f4f4"},poi:{color:"#3c3c3c",haloColor:"#ffffff"},"road-label":{color:"#585858",haloColor:"#ffffff"},"water-label":{color:"#6e6e6e",haloColor:"#ffffff"},"place-label":{color:"#2a2a2a",haloColor:"#ffffff"},"poi-food":{color:"#3c3c3c",haloColor:"#ffffff",frameColor:"#3c3c3c",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{color:"#3c3c3c",haloColor:"#ffffff",frameColor:"#3c3c3c",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{color:"#3c3c3c",haloColor:"#ffffff",frameColor:"#3c3c3c",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{color:"#3c3c3c",haloColor:"#ffffff",frameColor:"#3c3c3c",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{color:"#3c3c3c",haloColor:"#ffffff",frameColor:"#3c3c3c",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{color:"#3c3c3c",haloColor:"#ffffff",frameColor:"#3c3c3c",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{color:"#3c3c3c",haloColor:"#ffffff",frameColor:"#3c3c3c",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{color:"#3c3c3c",haloColor:"#ffffff",frameColor:"#3c3c3c",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{color:"#3c3c3c",haloColor:"#ffffff",frameColor:"#3c3c3c",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"building-entrance":{color:"#564e4e",haloColor:"#ffffff"},"indoor-shell":{color:"#e9e9e9",opacity:.97},"indoor-corridor":{color:"#eeeeee"},"indoor-room":{color:"#e2e2e2"},"indoor-service":{color:"#cecece"},"indoor-shop":{color:"#d7cfdf"},"indoor-food":{color:"#dfd7cf"},"indoor-wc":{color:"#cfd9df"},"indoor-wall":{color:"#c0c0c0",roofColor:"#d4d4d4",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#c2bbd1",opacity:.95},"indoor-door":{color:"#3c3c3c",haloColor:"#ffffff"},"indoor-poi":{color:"#3c3c3c",haloColor:"#ffffff"},"indoor-name":{color:"#2a2a2a",haloColor:"#ffffff"}},sky:{skyColor:"#8f96a0",horizonColor:"#d7dade",fogRange:[1.35,7.5],fogIntensity:.9,spaceColor:"#07080b",atmosphereColor:"#9aa3ad",starIntensity:.5}};var Yi={name:"\u0411\u043B\u0435\u0434\u043D\u0430\u044F",background:"#f7f6f3",light:{ambientColor:"#ffffff",ambientIntensity:.62,keyAzimuth:120,keyAltitude:65,keyColor:"#fffaf0",keyIntensity:.38,fillAzimuth:300,fillAltitude:25,fillColor:"#eef2f8",fillIntensity:.14},paint:{"landcover-wood":{color:"#e8efe2"},"landcover-grass":{color:"#edf2e6"},"landcover-sand":{color:"#f4eede"},"landcover-ice":{color:"#f0f5f7"},"landcover-wetland":{color:"#e8f0ec"},"landuse-residential":{color:"#f2f0ec"},"landuse-industrial":{color:"#f0edeb"},"landuse-civic":{color:"#f4efe9"},"landuse-sport":{color:"#e9f1e4"},"landuse-cemetery":{color:"#ecefe6"},"landuse-parking":{color:"#f3f1ed"},park:{color:"#e7f0df"},"aeroway-area":{color:"#f0f0f2"},water:{color:"#dce9f2"},"water-pool":{color:"#dcecf5"},waterway:{color:"#dce9f2"},"aeroway-line":{color:"#ebebee"},"road-casing-major":{color:"#efe4d2"},"road-casing-secondary":{color:"#eceae2"},"road-casing-minor":{color:"#efedE6"},"road-rail":{color:"#e0dcd6"},"road-path":{color:"#e6e2da"},"road-minor":{color:"#fdfcfa"},"road-secondary":{color:"#ffffff"},"road-major":{color:"#fff8e8"},boundary:{color:"#cfc3d2"},building:{color:"#eae7e0",roofColor:"#ecE9e2",aoStrength:.14,tintVariation:.04,windowColor:"#c7d6e4",windowFrameColor:"#f6f7f9",windowGlow:0},housenumber:{color:"#a9a296",haloColor:"#fbfaf7"},poi:{color:"#6b6b6b",haloColor:"#ffffff"},"road-label":{color:"#8a8474",haloColor:"#ffffff"},"water-label":{color:"#7ea8c4",haloColor:"#ffffff"},"place-label":{color:"#55524c",haloColor:"#ffffff"},"poi-food":{color:"#6b6b6b",haloColor:"#ffffff",frameColor:"#6b6b6b",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{color:"#6b6b6b",haloColor:"#ffffff",frameColor:"#6b6b6b",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{color:"#6b6b6b",haloColor:"#ffffff",frameColor:"#6b6b6b",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{color:"#6b6b6b",haloColor:"#ffffff",frameColor:"#6b6b6b",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{color:"#6b6b6b",haloColor:"#ffffff",frameColor:"#6b6b6b",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{color:"#6b6b6b",haloColor:"#ffffff",frameColor:"#6b6b6b",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{color:"#6b6b6b",haloColor:"#ffffff",frameColor:"#6b6b6b",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{color:"#6b6b6b",haloColor:"#ffffff",frameColor:"#6b6b6b",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{color:"#6b6b6b",haloColor:"#ffffff",frameColor:"#6b6b6b",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"building-entrance":{color:"#564e4e",haloColor:"#ffffff"},"indoor-shell":{color:"#f4f3f0",opacity:.97},"indoor-corridor":{color:"#f8f7f6"},"indoor-room":{color:"#edece8"},"indoor-service":{color:"#dcd9d1"},"indoor-shop":{color:"#e0dae6"},"indoor-food":{color:"#e6e0da"},"indoor-wc":{color:"#dae1e6"},"indoor-wall":{color:"#cdcbc4",roofColor:"#e0dedb",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#ccc5d9",opacity:.95},"indoor-door":{color:"#6b6b6b",haloColor:"#ffffff"},"indoor-poi":{color:"#6b6b6b",haloColor:"#ffffff"},"indoor-name":{color:"#55524c",haloColor:"#ffffff"}},sky:{skyColor:"#c8dbee",horizonColor:"#eef2f6",fogRange:[1.4,9],fogIntensity:.85,spaceColor:"#0a1018",atmosphereColor:"#9fd0ff",starIntensity:.45}};var Zi={name:"\u041E\u0431\u044A\u0451\u043C\u043D\u0430\u044F",background:"#f0ecea",light:{ambientColor:"#f8f8f8",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#ffffff",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#dee8ed",fillIntensity:.18},paint:{"landcover-wood":{color:"#9bda95"},"landcover-grass":{color:"#b2e6a8"},"landcover-sand":{color:"#efeac8"},"landcover-ice":{color:"#d5e8f1"},"landcover-wetland":{color:"#badbde"},"landuse-residential":{color:"#f4f2f1"},"landuse-industrial":{color:"#dadce7"},"landuse-civic":{color:"#ecdae0"},"landuse-sport":{color:"#bbeba2"},"landuse-cemetery":{color:"#c2e2bb"},"landuse-parking":{color:"#e0dddc"},park:{color:"#b2e6a8"},"aeroway-area":{color:"#d6dbeb"},water:{color:"#94d8f9"},waterway:{color:"#94d8f9"},"aeroway-line":{color:"#f0ede9"},"road-casing-major":{color:"#8997b3"},"road-casing-secondary":{color:"#9da7be"},"road-casing-minor":{color:"#9da7be"},"road-rail":{color:"#9e9e9e"},"road-path":{color:"#bbc1d3"},"road-minor":{color:"#bbc1d3"},"road-secondary":{color:"#bbc1d3"},"road-major":{color:"#99abc2"},boundary:{color:"#f66f91"},building:{color:"#ede7de",roofColor:"#ede7de",aoStrength:.19,tintVariation:.06,windowColor:"#6b9ed1",windowFrameColor:"#eef0f4",windowGlow:0},housenumber:{color:"#2e2e2e",haloColor:"#ffffff",haloWidth:1.4},poi:{color:"#586e84",haloColor:"#ffffff",haloWidth:1.4},"road-label":{color:"#2e2e2e",haloColor:"#ffffff",haloWidth:1.4},"water-label":{color:"#35688d",haloColor:"#f7f7f7",haloWidth:1.4},"place-label":{color:"#2e2e2e",haloColor:"#ffffff",haloWidth:1.4},"poi-food":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#c2681c",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#2f77c4",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#3b82a6",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#c24444",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#3f7f7a",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#8b5aa5",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#4f8b45",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#7a5fbf",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#59636e",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"water-pool":{color:"#a7e1fd"},"indoor-shell":{color:"#f4f3f1",opacity:.97},"indoor-corridor":{color:"#f8f8f6"},"indoor-room":{color:"#eeece8"},"indoor-service":{color:"#ddd8d2"},"indoor-shop":{color:"#e0dae7"},"indoor-food":{color:"#e7e1da"},"indoor-wc":{color:"#dae2e7"},"indoor-wall":{color:"#cecac5",roofColor:"#e0dedc",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#ccc6d9",opacity:.95},"indoor-door":{color:"#586e84",haloColor:"#ffffff",haloWidth:1.4},"indoor-poi":{color:"#586e84",haloColor:"#ffffff",haloWidth:1.4},"indoor-name":{color:"#2e2e2e",haloColor:"#ffffff",haloWidth:1.4},"building-entrance":{color:"#225aaa",haloColor:"#ffffff"}},sky:{skyColor:"#91b8cb",horizonColor:"#dfd9d6",fogRange:[1.34,7.36],fogIntensity:.86,spaceColor:"#0e0b0a",atmosphereColor:"#5daad0",starIntensity:.38}};var Qi={name:"\u041C\u0443\u043B\u044C\u0442\u044F\u0448\u043D\u0430\u044F",background:"#f7f3de",light:{ambientColor:"#f8f7f7",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#ffffff",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#dee8ed",fillIntensity:.18},paint:{"landcover-wood":{color:"#61d161"},"landcover-grass":{color:"#91e481"},"landcover-sand":{color:"#efeac8"},"landcover-ice":{color:"#c7dfeb"},"landcover-wetland":{color:"#9fccd1"},"landuse-residential":{color:"#f2ecd9"},"landuse-industrial":{color:"#d7d9e4"},"landuse-civic":{color:"#ead7dd"},"landuse-sport":{color:"#9fec79"},"landuse-cemetery":{color:"#a8d69f"},"landuse-parking":{color:"#dddcda"},park:{color:"#91e481"},"aeroway-area":{color:"#d6dbeb"},water:{color:"#71c8f4"},waterway:{color:"#71c8f4"},"aeroway-line":{color:"#f0ede9"},"road-casing-major":{color:"#ca6a16"},"road-casing-secondary":{color:"#5a6faf"},"road-casing-minor":{color:"#5a6faf"},"road-rail":{color:"#737373"},"road-path":{color:"#ffffff"},"road-minor":{color:"#ffffff"},"road-secondary":{color:"#ffffff"},"road-major":{color:"#f8c662"},boundary:{color:"#f6517a"},building:{color:"#f4dfc2",roofColor:"#f4dfc2",aoStrength:.19,tintVariation:.06,windowColor:"#5b9ee0",windowFrameColor:"#ffffff",windowGlow:0},housenumber:{color:"#222b59",haloColor:"#ffffff",haloWidth:1.4},poi:{color:"#f05a0f",haloColor:"#ffffff",haloWidth:1.4},"road-label":{color:"#222b59",haloColor:"#ffffff",haloWidth:1.4},"water-label":{color:"#35688d",haloColor:"#f7f7f7",haloWidth:1.4},"place-label":{color:"#222b59",haloColor:"#ffffff",haloWidth:1.4},"poi-food":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#c2681c",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#2f77c4",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#3b82a6",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#c24444",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#3f7f7a",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#8b5aa5",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#4f8b45",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#7a5fbf",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#59636e",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"water-pool":{color:"#80d1fa"},"indoor-shell":{color:"#ebe9e5",opacity:.97},"indoor-corridor":{color:"#efedea"},"indoor-room":{color:"#e5e1dc"},"indoor-service":{color:"#d4cec6"},"indoor-shop":{color:"#d6cede"},"indoor-food":{color:"#ded6ce"},"indoor-wc":{color:"#ced8de"},"indoor-wall":{color:"#c4c0ba",roofColor:"#d6d4d0",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#c1b9d1",opacity:.95},"indoor-door":{color:"#f05a0f",haloColor:"#ffffff",haloWidth:1.4},"indoor-poi":{color:"#f05a0f",haloColor:"#ffffff",haloWidth:1.4},"indoor-name":{color:"#222b59",haloColor:"#ffffff",haloWidth:1.4},"building-entrance":{color:"#225aaa",haloColor:"#ffffff"}},sky:{skyColor:"#8cb5c9",horizonColor:"#e8e2c7",fogRange:[1.34,7.35],fogIntensity:.86,spaceColor:"#131105",atmosphereColor:"#5ca9d0",starIntensity:.39}};var qi={name:"\u041A\u0438\u0431\u0435\u0440\u043F\u0430\u043D\u043A",background:"#120817",model3dKey:"night",light:{ambientColor:"#b279cf",ambientIntensity:.34,keyAzimuth:120,keyAltitude:55,keyColor:"#ff70d0",keyIntensity:.28,fillAzimuth:300,fillAltitude:25,fillColor:"#854770",fillIntensity:.22},paint:{"landcover-wood":{color:"#0c3728"},"landcover-grass":{color:"#104131"},"landcover-sand":{color:"#262417"},"landcover-ice":{color:"#74345f"},"landcover-wetland":{color:"#152223"},"landuse-residential":{color:"#170b1e"},"landuse-industrial":{color:"#171921"},"landuse-civic":{color:"#21171a"},"landuse-sport":{color:"#0c4529"},"landuse-cemetery":{color:"#151e1b"},"landuse-parking":{color:"#272428"},park:{color:"#104131"},"aeroway-area":{color:"#1a1c23"},water:{color:"#5f1145"},waterway:{color:"#711452"},"aeroway-line":{color:"#55493a"},"road-casing-major":{color:"#981662"},"road-casing-secondary":{color:"#6a1b6a"},"road-casing-minor":{color:"#6a1b6a"},"road-rail":{color:"#39acac"},"road-path":{color:"#12e2e2"},"road-minor":{color:"#12e2e2"},"road-secondary":{color:"#12e2e2"},"road-major":{color:"#f631a4"},boundary:{color:"#f53da8"},building:{color:"#311839",roofColor:"#9d2575",aoStrength:.29,tintVariation:.1,windowColor:"#84dcff",windowFrameColor:"#84dcff",windowGlow:.5},housenumber:{color:"#acf6f6",haloColor:"#110514",haloWidth:1.4},poi:{color:"#f6e95a",haloColor:"#110514",haloWidth:1.4},"road-label":{color:"#acf6f6",haloColor:"#110514",haloWidth:1.4},"water-label":{color:"#9fbcd1",haloColor:"#131b20",haloWidth:1.4},"place-label":{color:"#acf6f6",haloColor:"#110514",haloWidth:1.4},"poi-food":{color:"#d89964",haloColor:"#110514",haloWidth:1.4,frameColor:"#d89964",frameOpacity:1,frameHaloColor:"#110514",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-shop":{color:"#699cd4",haloColor:"#110514",haloWidth:1.4,frameColor:"#699cd4",frameOpacity:1,frameHaloColor:"#110514",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-transport":{color:"#75acc8",haloColor:"#110514",haloWidth:1.4,frameColor:"#75acc8",frameOpacity:1,frameHaloColor:"#110514",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-health":{color:"#ca7272",haloColor:"#110514",haloWidth:1.4,frameColor:"#ca7272",frameOpacity:1,frameHaloColor:"#110514",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-education":{color:"#81bbb7",haloColor:"#110514",haloWidth:1.4,frameColor:"#81bbb7",frameOpacity:1,frameHaloColor:"#110514",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-culture":{color:"#a684b8",haloColor:"#110514",haloWidth:1.4,frameColor:"#a684b8",frameOpacity:1,frameHaloColor:"#110514",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-sport":{color:"#89bb81",haloColor:"#110514",haloWidth:1.4,frameColor:"#89bb81",frameOpacity:1,frameHaloColor:"#110514",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-lodging":{color:"#8e79c3",haloColor:"#110514",haloWidth:1.4,frameColor:"#8e79c3",frameOpacity:1,frameHaloColor:"#110514",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-service":{color:"#959ea7",haloColor:"#110514",haloWidth:1.4,frameColor:"#959ea7",frameOpacity:1,frameHaloColor:"#110514",iconColor:"#1b1b1b",iconHaloWidth:0},"water-pool":{color:"#84135f"},"indoor-shell":{color:"#4c3752",opacity:.97},"indoor-corridor":{color:"#46334c"},"indoor-room":{color:"#553e5d"},"indoor-service":{color:"#6e5078"},"indoor-shop":{color:"#59446f"},"indoor-food":{color:"#6f5a44"},"indoor-wc":{color:"#445e6f"},"indoor-wall":{color:"#7b6681",roofColor:"#938298",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#635287",opacity:.95},"indoor-door":{color:"#f6e95a",haloColor:"#110514",haloWidth:1.4},"indoor-poi":{color:"#f6e95a",haloColor:"#110514",haloWidth:1.4},"indoor-name":{color:"#acf6f6",haloColor:"#110514",haloWidth:1.4},"building-entrance":{color:"#79a0d7",haloColor:"#110514"}},sky:{skyColor:"#180813",horizonColor:"#281831",fogRange:[1.3,6.5],fogIntensity:.9,spaceColor:"#060308",atmosphereColor:"#b5358b",starIntensity:.82}};var $i={name:"\u0420\u0430\u0441\u0441\u0432\u0435\u0442",background:"#f4ebe1",light:{ambientColor:"#f8f7f7",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#ffe0c0",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#dee7ed",fillIntensity:.18},paint:{"landcover-wood":{color:"#a4db9f"},"landcover-grass":{color:"#bae7b1"},"landcover-sand":{color:"#efeac8"},"landcover-ice":{color:"#dbe7f0"},"landcover-wetland":{color:"#c1dee1"},"landuse-residential":{color:"#f5efeb"},"landuse-industrial":{color:"#d7d9e4"},"landuse-civic":{color:"#ead7dd"},"landuse-sport":{color:"#c1ecac"},"landuse-cemetery":{color:"#c8e5c2"},"landuse-parking":{color:"#dddbda"},park:{color:"#bae7b1"},"aeroway-area":{color:"#d6dbeb"},water:{color:"#a6d2f2"},waterway:{color:"#a6d2f2"},"aeroway-line":{color:"#f0ede9"},"road-casing-major":{color:"#92a1bf"},"road-casing-secondary":{color:"#a6afc9"},"road-casing-minor":{color:"#a6afc9"},"road-rail":{color:"#b5a49b"},"road-path":{color:"#c3c9df"},"road-minor":{color:"#c3c9df"},"road-secondary":{color:"#c3c9df"},"road-major":{color:"#a9b9d1"},boundary:{color:"#f584a1"},building:{color:"#f6ebdf",roofColor:"#fdede7",aoStrength:.19,tintVariation:.06,windowColor:"#6b9ed1",windowFrameColor:"#f0ece8",windowGlow:0},housenumber:{color:"#46332a",haloColor:"#fdfaf7",haloWidth:1.4},poi:{color:"#56738f",haloColor:"#fdfaf7",haloWidth:1.4},"road-label":{color:"#46332a",haloColor:"#fdfaf7",haloWidth:1.4},"water-label":{color:"#35688d",haloColor:"#f7f7f7",haloWidth:1.4},"place-label":{color:"#46332a",haloColor:"#fdfaf7",haloWidth:1.4},"poi-food":{haloColor:"#fdfaf7",haloWidth:1.4,frameColor:"#c2681c",frameOpacity:1,frameHaloColor:"#fdfaf7",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{haloColor:"#fdfaf7",haloWidth:1.4,frameColor:"#2f77c4",frameOpacity:1,frameHaloColor:"#fdfaf7",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{haloColor:"#fdfaf7",haloWidth:1.4,frameColor:"#3b82a6",frameOpacity:1,frameHaloColor:"#fdfaf7",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{haloColor:"#fdfaf7",haloWidth:1.4,frameColor:"#c24444",frameOpacity:1,frameHaloColor:"#fdfaf7",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{haloColor:"#fdfaf7",haloWidth:1.4,frameColor:"#3f7f7a",frameOpacity:1,frameHaloColor:"#fdfaf7",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{haloColor:"#fdfaf7",haloWidth:1.4,frameColor:"#8b5aa5",frameOpacity:1,frameHaloColor:"#fdfaf7",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{haloColor:"#fdfaf7",haloWidth:1.4,frameColor:"#4f8b45",frameOpacity:1,frameHaloColor:"#fdfaf7",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{haloColor:"#fdfaf7",haloWidth:1.4,frameColor:"#7a5fbf",frameOpacity:1,frameHaloColor:"#fdfaf7",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{haloColor:"#fdfaf7",haloWidth:1.4,frameColor:"#59636e",frameOpacity:1,frameHaloColor:"#fdfaf7",iconColor:"#ffffff",iconHaloWidth:0},"water-pool":{color:"#b9ddf7"},"indoor-shell":{color:"#f8f7f5",opacity:.97},"indoor-corridor":{color:"#fcfbfb"},"indoor-room":{color:"#f1efed"},"indoor-service":{color:"#e0dbd6"},"indoor-shop":{color:"#e4dfea"},"indoor-food":{color:"#eae4df"},"indoor-wc":{color:"#dfe5ea"},"indoor-wall":{color:"#d1cdc9",roofColor:"#e4e2e0",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#d0cbdc",opacity:.95},"indoor-door":{color:"#56738f",haloColor:"#fdfaf7",haloWidth:1.4},"indoor-poi":{color:"#56738f",haloColor:"#fdfaf7",haloWidth:1.4},"indoor-name":{color:"#46332a",haloColor:"#fdfaf7",haloWidth:1.4},"building-entrance":{color:"#225aaa",haloColor:"#fdfaf7"}},sky:{skyColor:"#8cb0c9",horizonColor:"#e4d7cb",fogRange:[1.34,7.35],fogIntensity:.86,spaceColor:"#120c07",atmosphereColor:"#5c9fd0",starIntensity:.39}};var ea={name:"\u0421\u0443\u043C\u0435\u0440\u043A\u0438",background:"#d7cbc1",light:{ambientColor:"#ececeb",ambientIntensity:.46,keyAzimuth:120,keyAltitude:59,keyColor:"#ffcaa0",keyIntensity:.56,fillAzimuth:300,fillAltitude:25,fillColor:"#c7d0e1",fillIntensity:.19},paint:{"landcover-wood":{color:"#75af6a"},"landcover-grass":{color:"#94bd7f"},"landcover-sand":{color:"#efeac8"},"landcover-ice":{color:"#c1c8d7"},"landcover-wetland":{color:"#83bec3"},"landuse-residential":{color:"#d5cac3"},"landuse-industrial":{color:"#b3b7cc"},"landuse-civic":{color:"#d5aebb"},"landuse-sport":{color:"#91c775"},"landuse-cemetery":{color:"#9ac982"},"landuse-parking":{color:"#c0bcb9"},park:{color:"#94bd7f"},"aeroway-area":{color:"#d6dbeb"},water:{color:"#708bc2"},waterway:{color:"#708bc2"},"aeroway-line":{color:"#f0ede9"},"road-casing-major":{color:"#6a5b9a"},"road-casing-secondary":{color:"#7078a4"},"road-casing-minor":{color:"#7078a4"},"road-rail":{color:"#93796c"},"road-path":{color:"#8f94b7"},"road-minor":{color:"#8f94b7"},"road-secondary":{color:"#8f94b7"},"road-major":{color:"#8576b2"},boundary:{color:"#e05275"},building:{color:"#e0d1c2",roofColor:"#f1d6cb",aoStrength:.2,tintVariation:.07,windowColor:"#6b9ed1",windowFrameColor:"#efe6df",windowGlow:0},housenumber:{color:"#2c283e",haloColor:"#f5ebe0",haloWidth:1.4},poi:{color:"#64568f",haloColor:"#f5ebe0",haloWidth:1.4},"road-label":{color:"#2c283e",haloColor:"#f5ebe0",haloWidth:1.4},"water-label":{color:"#35688d",haloColor:"#f7f7f7",haloWidth:1.4},"place-label":{color:"#2c283e",haloColor:"#f5ebe0",haloWidth:1.4},"poi-food":{haloColor:"#f5ebe0",haloWidth:1.4,frameColor:"#c2681c",frameOpacity:1,frameHaloColor:"#f5ebe0",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{haloColor:"#f5ebe0",haloWidth:1.4,frameColor:"#2f77c4",frameOpacity:1,frameHaloColor:"#f5ebe0",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{haloColor:"#f5ebe0",haloWidth:1.4,frameColor:"#3b82a6",frameOpacity:1,frameHaloColor:"#f5ebe0",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{haloColor:"#f5ebe0",haloWidth:1.4,frameColor:"#c24444",frameOpacity:1,frameHaloColor:"#f5ebe0",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{haloColor:"#f5ebe0",haloWidth:1.4,frameColor:"#3f7f7a",frameOpacity:1,frameHaloColor:"#f5ebe0",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{haloColor:"#f5ebe0",haloWidth:1.4,frameColor:"#8b5aa5",frameOpacity:1,frameHaloColor:"#f5ebe0",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{haloColor:"#f5ebe0",haloWidth:1.4,frameColor:"#4f8b45",frameOpacity:1,frameHaloColor:"#f5ebe0",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{haloColor:"#f5ebe0",haloWidth:1.4,frameColor:"#7a5fbf",frameOpacity:1,frameHaloColor:"#f5ebe0",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{haloColor:"#f5ebe0",haloWidth:1.4,frameColor:"#59636e",frameOpacity:1,frameHaloColor:"#f5ebe0",iconColor:"#ffffff",iconHaloWidth:0},"water-pool":{color:"#7a94ca"},"indoor-shell":{color:"#e3deda",opacity:.97},"indoor-corridor":{color:"#e7e3df"},"indoor-room":{color:"#dcd7d1"},"indoor-service":{color:"#cbc3ba"},"indoor-shop":{color:"#ccc2d6"},"indoor-food":{color:"#d6ccc2"},"indoor-wc":{color:"#c2ced6"},"indoor-wall":{color:"#bbb5af",roofColor:"#cdc9c6",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#b6adc9",opacity:.95},"indoor-door":{color:"#64568f",haloColor:"#f5ebe0",haloWidth:1.4},"indoor-poi":{color:"#64568f",haloColor:"#f5ebe0",haloWidth:1.4},"indoor-name":{color:"#2c283e",haloColor:"#f5ebe0",haloWidth:1.4},"building-entrance":{haloColor:"#f5ebe0"}},sky:{skyColor:"#5675b3",horizonColor:"#c0b4aa",fogRange:[1.33,7.14],fogIntensity:.87,spaceColor:"#0e0b09",atmosphereColor:"#557dce",starIntensity:.45}};var ta={name:"\u0417\u0435\u043C\u043B\u044F",background:"#dbd1bd",light:{ambientColor:"#edecea",ambientIntensity:.46,keyAzimuth:120,keyAltitude:59,keyColor:"#fff2dc",keyIntensity:.56,fillAzimuth:300,fillAltitude:25,fillColor:"#c7d6e1",fillIntensity:.19},paint:{"landcover-wood":{color:"#50a136"},"landcover-grass":{color:"#8ac76b"},"landcover-sand":{color:"#efeac8"},"landcover-ice":{color:"#aec5d6"},"landcover-wetland":{color:"#7cbac0"},"landuse-residential":{color:"#ded5c4"},"landuse-industrial":{color:"#b3b7cc"},"landuse-civic":{color:"#d5aebb"},"landuse-sport":{color:"#86d161"},"landuse-cemetery":{color:"#94c67b"},"landuse-parking":{color:"#c0beb9"},park:{color:"#8ac76b"},"aeroway-area":{color:"#d6dbeb"},water:{color:"#3b91ce"},waterway:{color:"#4798d1"},"aeroway-line":{color:"#f0ede9"},"road-casing-major":{color:"#a47546"},"road-casing-secondary":{color:"#a79376"},"road-casing-minor":{color:"#a79376"},"road-rail":{color:"#877564"},"road-path":{color:"#c6bba9"},"road-minor":{color:"#c6bba9"},"road-secondary":{color:"#c6bba9"},"road-major":{color:"#cdaa7a"},boundary:{color:"#bf6a40"},building:{color:"#d4c5af",roofColor:"#d4c5af",aoStrength:.2,tintVariation:.07,windowColor:"#9fb0c0",windowFrameColor:"#eceae4",windowGlow:0},housenumber:{color:"#46382a",haloColor:"#f7f4ee",haloWidth:1.4},poi:{color:"#7c5c3c",haloColor:"#f7f4ee",haloWidth:1.4},"road-label":{color:"#46382a",haloColor:"#f7f4ee",haloWidth:1.4},"water-label":{color:"#35688d",haloColor:"#f7f7f7",haloWidth:1.4},"place-label":{color:"#46382a",haloColor:"#f7f4ee",haloWidth:1.4},"poi-food":{haloColor:"#f7f4ee",haloWidth:1.4,frameColor:"#c2681c",frameOpacity:1,frameHaloColor:"#f7f4ee",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{haloColor:"#f7f4ee",haloWidth:1.4,frameColor:"#2f77c4",frameOpacity:1,frameHaloColor:"#f7f4ee",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{haloColor:"#f7f4ee",haloWidth:1.4,frameColor:"#3b82a6",frameOpacity:1,frameHaloColor:"#f7f4ee",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{haloColor:"#f7f4ee",haloWidth:1.4,frameColor:"#c24444",frameOpacity:1,frameHaloColor:"#f7f4ee",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{haloColor:"#f7f4ee",haloWidth:1.4,frameColor:"#3f7f7a",frameOpacity:1,frameHaloColor:"#f7f4ee",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{haloColor:"#f7f4ee",haloWidth:1.4,frameColor:"#8b5aa5",frameOpacity:1,frameHaloColor:"#f7f4ee",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{haloColor:"#f7f4ee",haloWidth:1.4,frameColor:"#4f8b45",frameOpacity:1,frameHaloColor:"#f7f4ee",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{haloColor:"#f7f4ee",haloWidth:1.4,frameColor:"#7a5fbf",frameOpacity:1,frameHaloColor:"#f7f4ee",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{haloColor:"#f7f4ee",haloWidth:1.4,frameColor:"#59636e",frameOpacity:1,frameHaloColor:"#f7f4ee",iconColor:"#ffffff",iconHaloWidth:0},"water-pool":{color:"#4299d7"},"indoor-shell":{color:"#d6d0c8",opacity:.97},"indoor-corridor":{color:"#d9d5cd"},"indoor-room":{color:"#cfc9bf"},"indoor-service":{color:"#beb5a9"},"indoor-shop":{color:"#bcafca"},"indoor-food":{color:"#cabdaf"},"indoor-wc":{color:"#afbfca"},"indoor-wall":{color:"#ada79e",roofColor:"#bebbb5",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#a69bbc",opacity:.95},"indoor-door":{color:"#7c5c3c",haloColor:"#f7f4ee",haloWidth:1.4},"indoor-poi":{color:"#7c5c3c",haloColor:"#f7f4ee",haloWidth:1.4},"indoor-name":{color:"#46382a",haloColor:"#f7f4ee",haloWidth:1.4},"building-entrance":{haloColor:"#f7f4ee"}},sky:{skyColor:"#568db3",horizonColor:"#c4baa5",fogRange:[1.33,7.14],fogIntensity:.87,spaceColor:"#0f0c08",atmosphereColor:"#559cce",starIntensity:.45}};var oa={name:"\u0424\u0443\u0442\u0443\u0440\u0438\u0437\u043C",background:"#0c0f1d",model3dKey:"night",light:{ambientColor:"#8590c7",ambientIntensity:.34,keyAzimuth:120,keyAltitude:55,keyColor:"#8ff0ff",keyIntensity:.28,fillAzimuth:300,fillAltitude:25,fillColor:"#477b85",fillIntensity:.22},paint:{"landcover-wood":{color:"#123026"},"landcover-grass":{color:"#18392e"},"landcover-sand":{color:"#2d2a1b"},"landcover-ice":{color:"#276672"},"landcover-wetland":{color:"#192829"},"landuse-residential":{color:"#111422"},"landuse-industrial":{color:"#1b1d27"},"landuse-civic":{color:"#271b1f"},"landuse-sport":{color:"#143d29"},"landuse-cemetery":{color:"#192420"},"landuse-parking":{color:"#292a2e"},park:{color:"#18392e"},"aeroway-area":{color:"#1e2129"},water:{color:"#055261"},waterway:{color:"#076a7e"},"aeroway-line":{color:"#55493a"},"road-casing-major":{color:"#8b238b"},"road-casing-secondary":{color:"#185662"},"road-casing-minor":{color:"#185662"},"road-rail":{color:"#8546a4"},"road-path":{color:"#22b6c3"},"road-minor":{color:"#22b6c3"},"road-secondary":{color:"#22b6c3"},"road-major":{color:"#e03ee0"},boundary:{color:"#eb47eb"},building:{color:"#1e2b3e",roofColor:"#277686",aoStrength:.29,tintVariation:.1,windowColor:"#84dcff",windowFrameColor:"#bfe6ff",windowGlow:.5},housenumber:{color:"#c6edf1",haloColor:"#080a17",haloWidth:1.4},poi:{color:"#eb84eb",haloColor:"#080a17",haloWidth:1.4},"road-label":{color:"#c6edf1",haloColor:"#080a17",haloWidth:1.4},"water-label":{color:"#9fbcd1",haloColor:"#131b20",haloWidth:1.4},"place-label":{color:"#c6edf1",haloColor:"#080a17",haloWidth:1.4},"poi-food":{color:"#d89964",haloColor:"#080a17",haloWidth:1.4,frameColor:"#d89964",frameOpacity:1,frameHaloColor:"#080a17",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-shop":{color:"#699cd4",haloColor:"#080a17",haloWidth:1.4,frameColor:"#699cd4",frameOpacity:1,frameHaloColor:"#080a17",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-transport":{color:"#75acc8",haloColor:"#080a17",haloWidth:1.4,frameColor:"#75acc8",frameOpacity:1,frameHaloColor:"#080a17",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-health":{color:"#ca7272",haloColor:"#080a17",haloWidth:1.4,frameColor:"#ca7272",frameOpacity:1,frameHaloColor:"#080a17",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-education":{color:"#81bbb7",haloColor:"#080a17",haloWidth:1.4,frameColor:"#81bbb7",frameOpacity:1,frameHaloColor:"#080a17",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-culture":{color:"#a684b8",haloColor:"#080a17",haloWidth:1.4,frameColor:"#a684b8",frameOpacity:1,frameHaloColor:"#080a17",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-sport":{color:"#89bb81",haloColor:"#080a17",haloWidth:1.4,frameColor:"#89bb81",frameOpacity:1,frameHaloColor:"#080a17",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-lodging":{color:"#8e79c3",haloColor:"#080a17",haloWidth:1.4,frameColor:"#8e79c3",frameOpacity:1,frameHaloColor:"#080a17",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-service":{color:"#959ea7",haloColor:"#080a17",haloWidth:1.4,frameColor:"#959ea7",frameOpacity:1,frameHaloColor:"#080a17",iconColor:"#1b1b1b",iconHaloWidth:0},"water-pool":{color:"#027288"},"indoor-shell":{color:"#394556",opacity:.97},"indoor-corridor":{color:"#354050"},"indoor-room":{color:"#404d60"},"indoor-service":{color:"#52637b"},"indoor-shop":{color:"#5c4672"},"indoor-food":{color:"#725d46"},"indoor-wc":{color:"#466172"},"indoor-wall":{color:"#687485",roofColor:"#858e9a",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#66558a",opacity:.95},"indoor-door":{color:"#eb84eb",haloColor:"#080a17",haloWidth:1.4},"indoor-poi":{color:"#eb84eb",haloColor:"#080a17",haloWidth:1.4},"indoor-name":{color:"#c6edf1",haloColor:"#080a17",haloWidth:1.4},"building-entrance":{color:"#79a0d7",haloColor:"#080a17"}},sky:{skyColor:"#081619",horizonColor:"#1b1f30",fogRange:[1.3,6.51],fogIntensity:.9,spaceColor:"#030408",atmosphereColor:"#35a1b7",starIntensity:.81}};var ra={name:"\u0421\u0442\u0435\u043A\u043B\u043E \u043C\u044F\u0433\u043A\u043E\u0435",background:"#f2f5f7",light:{ambientColor:"#fbfbfb",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#ffffff",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#dee9ed",fillIntensity:.18},paint:{"landcover-wood":{color:"#bddbc3"},"landcover-grass":{color:"#d0ecda"},"landcover-sand":{color:"#efeac8"},"landcover-ice":{color:"#cbebdb"},"landcover-wetland":{color:"#d9ebed"},"landuse-residential":{color:"#f6f7f9"},"landuse-industrial":{color:"#e3e5ed"},"landuse-civic":{color:"#f1e4e8"},"landuse-sport":{color:"#cdefd4"},"landuse-cemetery":{color:"#dbf0e3"},"landuse-parking":{color:"#e4e6e7"},park:{color:"#ccead9"},"aeroway-area":{color:"#d6dbeb"},water:{color:"#b9e5f4"},waterway:{color:"#81c6e4"},"aeroway-line":{color:"#f0ede9"},"road-casing-major":{color:"#dabc95"},"road-casing-secondary":{color:"#d5cdb8"},"road-casing-minor":{color:"#cad1d8"},"road-rail":{color:"#a5a0b1"},"road-path":{color:"#9fbcad"},"road-minor":{color:"#ffffff"},"road-secondary":{color:"#fbf6ea"},"road-major":{color:"#f8e5c3"},boundary:{color:"#ce97c0"},building:{color:"#e5ebf0",roofColor:"#f7fbfd",aoStrength:.18,tintVariation:.06,windowColor:"#bcd4e8",windowFrameColor:"#dfe8f2",windowGlow:0},housenumber:{color:"#4e6779",haloColor:"#fbfdfe",haloWidth:1.4},poi:{color:"#4e6779",haloColor:"#fbfdfe",haloWidth:1.4},"road-label":{color:"#2f3f50",haloColor:"#fbfdfe",haloWidth:1.4},"water-label":{color:"#35688d",haloColor:"#f7f7f7",haloWidth:1.4},"place-label":{color:"#2f3f50",haloColor:"#fbfdfe",haloWidth:1.4},"poi-food":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#c2681c",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#2f77c4",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#3b82a6",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#c24444",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#3f7f7a",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#8b5aa5",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#4f8b45",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#7a5fbf",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#59636e",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"water-pool":{color:"#ceeef9"},"indoor-shell":{color:"#f5f7f8",opacity:.97},"indoor-corridor":{color:"#fbfbfc"},"indoor-room":{color:"#edeff1"},"indoor-service":{color:"#d6dce0"},"indoor-shop":{color:"#e4dfea"},"indoor-food":{color:"#eae4df"},"indoor-wc":{color:"#dfe5ea"},"indoor-wall":{color:"#c9ced1",roofColor:"#e0e2e4",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#d0cbdc",opacity:.95},"indoor-door":{color:"#4e6779",haloColor:"#fbfdfe",haloWidth:1.4},"indoor-poi":{color:"#4e6779",haloColor:"#fbfdfe",haloWidth:1.4},"indoor-name":{color:"#2f3f50",haloColor:"#fbfdfe",haloWidth:1.4},"building-entrance":{color:"#225aaa",haloColor:"#fbfdfe"}},sky:{skyColor:"#9fc5d2",horizonColor:"#dfe3e8",fogRange:[1.35,7.42],fogIntensity:.85,spaceColor:"#090c0f",atmosphereColor:"#5fb3d0",starIntensity:.37}};var na={name:"\u0421\u0442\u0435\u043A\u043B\u043E",background:"#f2f5f7",light:{ambientColor:"#fbfbfb",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#ffffff",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#dee9ed",fillIntensity:.18},paint:{"landcover-wood":{color:"#b8e0cf"},"landcover-grass":{color:"#cbebdb"},"landcover-sand":{color:"#efeac8"},"landcover-ice":{color:"#e5f0f3"},"landcover-wetland":{color:"#d6e9eb"},"landuse-residential":{color:"#f6f7f9"},"landuse-industrial":{color:"#e3e5ed"},"landuse-civic":{color:"#f1e4e8"},"landuse-sport":{color:"#c8efd5"},"landuse-cemetery":{color:"#d8eee3"},"landuse-parking":{color:"#e4e6e7"},park:{color:"#cbebdb"},"aeroway-area":{color:"#d6dbeb"},water:{color:"#bee6f4"},waterway:{color:"#bee6f4"},"aeroway-line":{color:"#f0ede9"},"road-casing-major":{color:"#9dc7dd"},"road-casing-secondary":{color:"#bdcfdb"},"road-casing-minor":{color:"#bdcfdb"},"road-rail":{color:"#adb9c2"},"road-path":{color:"#d6e2eb"},"road-minor":{color:"#d6e2eb"},"road-secondary":{color:"#d6e2eb"},"road-major":{color:"#b8daea"},boundary:{color:"#e28dc6"},building:{color:"#e8eef3",roofColor:"#f4f8fb",aoStrength:.18,tintVariation:.06,windowColor:"#bcd4e8",windowFrameColor:"#dfe8f2",windowGlow:0},housenumber:{color:"#2d4053",haloColor:"#fbfdfe",haloWidth:1.4},poi:{color:"#457aa1",haloColor:"#fbfdfe",haloWidth:1.4},"road-label":{color:"#2d4053",haloColor:"#fbfdfe",haloWidth:1.4},"water-label":{color:"#35688d",haloColor:"#f7f7f7",haloWidth:1.4},"place-label":{color:"#2d4053",haloColor:"#fbfdfe",haloWidth:1.4},"poi-food":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#c2681c",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#2f77c4",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#3b82a6",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#c24444",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#3f7f7a",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#8b5aa5",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#4f8b45",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#7a5fbf",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#59636e",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"water-pool":{color:"#d3eff9"},"indoor-shell":{color:"#f5f7f8",opacity:.97},"indoor-corridor":{color:"#fbfbfc"},"indoor-room":{color:"#edeff1"},"indoor-service":{color:"#d6dce0"},"indoor-shop":{color:"#e4dfea"},"indoor-food":{color:"#eae4df"},"indoor-wc":{color:"#dfe5ea"},"indoor-wall":{color:"#c9ced1",roofColor:"#e0e2e4",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#d0cbdc",opacity:.95},"indoor-door":{color:"#457aa1",haloColor:"#fbfdfe",haloWidth:1.4},"indoor-poi":{color:"#457aa1",haloColor:"#fbfdfe",haloWidth:1.4},"indoor-name":{color:"#2d4053",haloColor:"#fbfdfe",haloWidth:1.4},"building-entrance":{color:"#225aaa",haloColor:"#fbfdfe"}},sky:{skyColor:"#9fc5d2",horizonColor:"#dfe3e8",fogRange:[1.35,7.42],fogIntensity:.85,spaceColor:"#090c10",atmosphereColor:"#5fb3d0",starIntensity:.37}};var ia={name:"\u0413\u0430\u0440\u043C\u043E\u043D\u0438\u044F \u0447\u0451\u0440\u043D\u0430\u044F",background:"#1a1a1a",model3dKey:"night",light:{ambientColor:"#a8a8a8",ambientIntensity:.34,keyAzimuth:120,keyAltitude:55,keyColor:"#cccccc",keyIntensity:.29,fillAzimuth:300,fillAltitude:25,fillColor:"#854747",fillIntensity:.22},paint:{"landcover-wood":{color:"#212121"},"landcover-grass":{color:"#292929"},"landcover-sand":{color:"#33301f"},"landcover-ice":{color:"#545454"},"landcover-wetland":{color:"#1d2e30"},"landuse-residential":{color:"#1f1f1f"},"landuse-industrial":{color:"#1f222d"},"landuse-civic":{color:"#2d1f24"},"landuse-sport":{color:"#2d2525"},"landuse-cemetery":{color:"#2a1d1d"},"landuse-parking":{color:"#332e2e"},park:{color:"#292929"},"aeroway-area":{color:"#23262f"},water:{color:"#383838"},waterway:{color:"#3d3d3d"},"aeroway-line":{color:"#55493a"},"road-casing-major":{color:"#525252"},"road-casing-secondary":{color:"#383838"},"road-casing-minor":{color:"#383838"},"road-rail":{color:"#595959"},"road-path":{color:"#525252"},"road-minor":{color:"#525252"},"road-secondary":{color:"#525252"},"road-major":{color:"#757575"},boundary:{color:"#808080"},building:{color:"#2e2e2e",roofColor:"#4f4f4f",aoStrength:.29,tintVariation:.1,windowColor:"#8fb8e8",windowFrameColor:"#c8ccd4",windowGlow:.36},housenumber:{color:"#d9d9d9",haloColor:"#0a0a0a",haloWidth:1.4},poi:{color:"#a3a3a3",haloColor:"#0a0a0a",haloWidth:1.4},"road-label":{color:"#d9d9d9",haloColor:"#0a0a0a",haloWidth:1.4},"water-label":{color:"#9fbcd1",haloColor:"#131b20",haloWidth:1.4},"place-label":{color:"#d9d9d9",haloColor:"#0a0a0a",haloWidth:1.4},"poi-food":{color:"#a3a3a3",haloColor:"#0a0a0a",haloWidth:1.4,frameColor:"#a3a3a3",frameOpacity:1,frameHaloColor:"#0a0a0a",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-shop":{color:"#a3a3a3",haloColor:"#0a0a0a",haloWidth:1.4,frameColor:"#a3a3a3",frameOpacity:1,frameHaloColor:"#0a0a0a",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-transport":{color:"#a3a3a3",haloColor:"#0a0a0a",haloWidth:1.4,frameColor:"#a3a3a3",frameOpacity:1,frameHaloColor:"#0a0a0a",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-health":{color:"#a3a3a3",haloColor:"#0a0a0a",haloWidth:1.4,frameColor:"#a3a3a3",frameOpacity:1,frameHaloColor:"#0a0a0a",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-education":{color:"#a3a3a3",haloColor:"#0a0a0a",haloWidth:1.4,frameColor:"#a3a3a3",frameOpacity:1,frameHaloColor:"#0a0a0a",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-culture":{color:"#a3a3a3",haloColor:"#0a0a0a",haloWidth:1.4,frameColor:"#a3a3a3",frameOpacity:1,frameHaloColor:"#0a0a0a",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-sport":{color:"#a3a3a3",haloColor:"#0a0a0a",haloWidth:1.4,frameColor:"#a3a3a3",frameOpacity:1,frameHaloColor:"#0a0a0a",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-lodging":{color:"#a3a3a3",haloColor:"#0a0a0a",haloWidth:1.4,frameColor:"#a3a3a3",frameOpacity:1,frameHaloColor:"#0a0a0a",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-service":{color:"#a3a3a3",haloColor:"#0a0a0a",haloWidth:1.4,frameColor:"#a3a3a3",frameOpacity:1,frameHaloColor:"#0a0a0a",iconColor:"#1b1b1b",iconHaloWidth:0},"water-pool":{color:"#4c4c4c"},"indoor-shell":{color:"#484848",opacity:.97},"indoor-corridor":{color:"#424242"},"indoor-room":{color:"#505050"},"indoor-service":{color:"#676767"},"indoor-shop":{color:"#5c4672"},"indoor-food":{color:"#725d46"},"indoor-wc":{color:"#466172"},"indoor-wall":{color:"#767676",roofColor:"#909090",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#66558a",opacity:.95},"indoor-door":{color:"#a3a3a3",haloColor:"#0a0a0a",haloWidth:1.4},"indoor-poi":{color:"#a3a3a3",haloColor:"#0a0a0a",haloWidth:1.4},"indoor-name":{color:"#d9d9d9",haloColor:"#0a0a0a",haloWidth:1.4},"building-entrance":{color:"#cac4c4",haloColor:"#0a0a0a"}},sky:{skyColor:"#190909",horizonColor:"#282828",fogRange:[1.3,6.51],fogIntensity:.9,spaceColor:"#060606",atmosphereColor:"#b83535",starIntensity:.8}};var aa={name:"\u0413\u0430\u0440\u043C\u043E\u043D\u0438\u044F \u0441\u0438\u043D\u044F\u044F",background:"#e3e9f2",light:{ambientColor:"#f7f7f7",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#eef4ff",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#dee5ed",fillIntensity:.18},paint:{"landcover-wood":{color:"#a1b8ce"},"landcover-grass":{color:"#bdccdb"},"landcover-sand":{color:"#efeac8"},"landcover-ice":{color:"#baccde"},"landcover-wetland":{color:"#c1dee1"},"landuse-residential":{color:"#ebeff4"},"landuse-industrial":{color:"#d7d9e4"},"landuse-civic":{color:"#ead7dd"},"landuse-sport":{color:"#b8d3e0"},"landuse-cemetery":{color:"#c2d4e5"},"landuse-parking":{color:"#dadbdd"},park:{color:"#bdccdb"},"aeroway-area":{color:"#d6dbeb"},water:{color:"#5799db"},waterway:{color:"#5f9edd"},"aeroway-line":{color:"#f0ede9"},"road-casing-major":{color:"#407fbf"},"road-casing-secondary":{color:"#80a1c6"},"road-casing-minor":{color:"#80a1c6"},"road-rail":{color:"#738dab"},"road-path":{color:"#b0c5dd"},"road-minor":{color:"#b0c5dd"},"road-secondary":{color:"#b0c5dd"},"road-major":{color:"#71a3d6"},boundary:{color:"#478cd1"},building:{color:"#cfdae8",roofColor:"#e5edf6",aoStrength:.19,tintVariation:.06,windowColor:"#6b9ed1",windowFrameColor:"#e8eef6",windowGlow:0},housenumber:{color:"#1f395c",haloColor:"#fbfcfe",haloWidth:1.4},poi:{color:"#3e6da3",haloColor:"#fbfcfe",haloWidth:1.4},"road-label":{color:"#1f395c",haloColor:"#fbfcfe",haloWidth:1.4},"water-label":{color:"#35688d",haloColor:"#f7f7f7",haloWidth:1.4},"place-label":{color:"#1f395c",haloColor:"#fbfcfe",haloWidth:1.4},"poi-food":{haloColor:"#fbfcfe",haloWidth:1.4,frameColor:"#c2681c",frameOpacity:1,frameHaloColor:"#fbfcfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{haloColor:"#fbfcfe",haloWidth:1.4,frameColor:"#2f77c4",frameOpacity:1,frameHaloColor:"#fbfcfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{haloColor:"#fbfcfe",haloWidth:1.4,frameColor:"#3b82a6",frameOpacity:1,frameHaloColor:"#fbfcfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{haloColor:"#fbfcfe",haloWidth:1.4,frameColor:"#c24444",frameOpacity:1,frameHaloColor:"#fbfcfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{haloColor:"#fbfcfe",haloWidth:1.4,frameColor:"#3f7f7a",frameOpacity:1,frameHaloColor:"#fbfcfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{haloColor:"#fbfcfe",haloWidth:1.4,frameColor:"#8b5aa5",frameOpacity:1,frameHaloColor:"#fbfcfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{haloColor:"#fbfcfe",haloWidth:1.4,frameColor:"#4f8b45",frameOpacity:1,frameHaloColor:"#fbfcfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{haloColor:"#fbfcfe",haloWidth:1.4,frameColor:"#7a5fbf",frameOpacity:1,frameHaloColor:"#fbfcfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{haloColor:"#fbfcfe",haloWidth:1.4,frameColor:"#59636e",frameOpacity:1,frameHaloColor:"#fbfcfe",iconColor:"#ffffff",iconHaloWidth:0},"water-pool":{color:"#61a2e3"},"indoor-shell":{color:"#e6e8ec",opacity:.97},"indoor-corridor":{color:"#ebedf0"},"indoor-room":{color:"#dde1e5"},"indoor-service":{color:"#c6ccd4"},"indoor-shop":{color:"#d6cedf"},"indoor-food":{color:"#dfd7ce"},"indoor-wc":{color:"#ced8df"},"indoor-wall":{color:"#babfc5",roofColor:"#d1d4d7",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#c1bad1",opacity:.95},"indoor-door":{color:"#3e6da3",haloColor:"#fbfcfe",haloWidth:1.4},"indoor-poi":{color:"#3e6da3",haloColor:"#fbfcfe",haloWidth:1.4},"indoor-name":{color:"#1f395c",haloColor:"#fbfcfe",haloWidth:1.4},"building-entrance":{color:"#225aaa",haloColor:"#fbfcfe"}},sky:{skyColor:"#8cabc9",horizonColor:"#ced6e1",fogRange:[1.34,7.35],fogIntensity:.86,spaceColor:"#080b10",atmosphereColor:"#5c96d0",starIntensity:.39}};var la={name:"\u0413\u0430\u0440\u043C\u043E\u043D\u0438\u044F \u0437\u0435\u043B\u0451\u043D\u0430\u044F",background:"#dfecdf",light:{ambientColor:"#f5f6f5",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#f0fff0",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#dcece7",fillIntensity:.18},paint:{"landcover-wood":{color:"#5ccc65"},"landcover-grass":{color:"#8cd98c"},"landcover-sand":{color:"#efeac8"},"landcover-ice":{color:"#bbd8ce"},"landcover-wetland":{color:"#9fccd1"},"landuse-residential":{color:"#e6efe6"},"landuse-industrial":{color:"#d1d4e0"},"landuse-civic":{color:"#e7d0d7"},"landuse-sport":{color:"#94e085"},"landuse-cemetery":{color:"#9fd69f"},"landuse-parking":{color:"#d4d8d4"},park:{color:"#8cd98c"},"aeroway-area":{color:"#d6dbeb"},water:{color:"#5ec9a6"},waterway:{color:"#66ccaa"},"aeroway-line":{color:"#f0ede9"},"road-casing-major":{color:"#44a754"},"road-casing-secondary":{color:"#7fbd7f"},"road-casing-minor":{color:"#7fbd7f"},"road-rail":{color:"#72a172"},"road-path":{color:"#afd4af"},"road-minor":{color:"#afd4af"},"road-secondary":{color:"#afd4af"},"road-major":{color:"#64c474"},boundary:{color:"#39c668"},building:{color:"#cfe2cb",roofColor:"#dff1df",aoStrength:.19,tintVariation:.06,windowColor:"#6b9ed1",windowFrameColor:"#e8f0e8",windowGlow:0},housenumber:{color:"#1c4a24",haloColor:"#f8fcf8",haloWidth:1.4},poi:{color:"#358d44",haloColor:"#f8fcf8",haloWidth:1.4},"road-label":{color:"#1c4a24",haloColor:"#f8fcf8",haloWidth:1.4},"water-label":{color:"#35688d",haloColor:"#f7f7f7",haloWidth:1.4},"place-label":{color:"#1c4a24",haloColor:"#f8fcf8",haloWidth:1.4},"poi-food":{haloColor:"#f8fcf8",haloWidth:1.4,frameColor:"#c2681c",frameOpacity:1,frameHaloColor:"#f8fcf8",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{haloColor:"#f8fcf8",haloWidth:1.4,frameColor:"#2f77c4",frameOpacity:1,frameHaloColor:"#f8fcf8",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{haloColor:"#f8fcf8",haloWidth:1.4,frameColor:"#3b82a6",frameOpacity:1,frameHaloColor:"#f8fcf8",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{haloColor:"#f8fcf8",haloWidth:1.4,frameColor:"#c24444",frameOpacity:1,frameHaloColor:"#f8fcf8",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{haloColor:"#f8fcf8",haloWidth:1.4,frameColor:"#3f7f7a",frameOpacity:1,frameHaloColor:"#f8fcf8",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{haloColor:"#f8fcf8",haloWidth:1.4,frameColor:"#8b5aa5",frameOpacity:1,frameHaloColor:"#f8fcf8",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{haloColor:"#f8fcf8",haloWidth:1.4,frameColor:"#4f8b45",frameOpacity:1,frameHaloColor:"#f8fcf8",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{haloColor:"#f8fcf8",haloWidth:1.4,frameColor:"#7a5fbf",frameOpacity:1,frameHaloColor:"#f8fcf8",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{haloColor:"#f8fcf8",haloWidth:1.4,frameColor:"#59636e",frameOpacity:1,frameHaloColor:"#f8fcf8",iconColor:"#ffffff",iconHaloWidth:0},"water-pool":{color:"#67d1af"},"indoor-shell":{color:"#e1e8e0",opacity:.97},"indoor-corridor":{color:"#e6ece5"},"indoor-room":{color:"#d9e1d7"},"indoor-service":{color:"#c3d0c1"},"indoor-shop":{color:"#d1c8db"},"indoor-food":{color:"#dbd2c8"},"indoor-wc":{color:"#c8d4db"},"indoor-wall":{color:"#b7c0b5",roofColor:"#cdd2cc",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#bcb4cd",opacity:.95},"indoor-door":{color:"#358d44",haloColor:"#f8fcf8",haloWidth:1.4},"indoor-poi":{color:"#358d44",haloColor:"#f8fcf8",haloWidth:1.4},"indoor-name":{color:"#1c4a24",haloColor:"#f8fcf8",haloWidth:1.4},"building-entrance":{color:"#225aaa",haloColor:"#f8fcf8"}},sky:{skyColor:"#83c5af",horizonColor:"#cad9ca",fogRange:[1.34,7.31],fogIntensity:.86,spaceColor:"#090f09",atmosphereColor:"#5bcfa9",starIntensity:.4}};var sa={name:"\u041B\u0443\u043D\u043D\u0430\u044F",background:"#c8cbd0",light:{ambientColor:"#ebecec",ambientIntensity:.46,keyAzimuth:120,keyAltitude:59,keyColor:"#e8ecf2",keyIntensity:.56,fillAzimuth:300,fillAltitude:25,fillColor:"#c7d0e1",fillIntensity:.19},paint:{"landcover-wood":{color:"#a8abb3"},"landcover-grass":{color:"#b9bbc1"},"landcover-sand":{color:"#efeac8"},"landcover-ice":{color:"#cbcdd2"},"landcover-wetland":{color:"#acd4d7"},"landuse-residential":{color:"#ced0d4"},"landuse-industrial":{color:"#b3b7cc"},"landuse-civic":{color:"#d5aebb"},"landuse-sport":{color:"#b2bdc7"},"landuse-cemetery":{color:"#adbddc"},"landuse-parking":{color:"#b9bcc0"},park:{color:"#b9bbc1"},"aeroway-area":{color:"#d6dbeb"},water:{color:"#929aaa"},waterway:{color:"#929aaa"},"aeroway-line":{color:"#f0ede9"},"road-casing-major":{color:"#6c7689"},"road-casing-secondary":{color:"#848b9a"},"road-casing-minor":{color:"#848b9a"},"road-rail":{color:"#7e838b"},"road-path":{color:"#acb0b9"},"road-minor":{color:"#acb0b9"},"road-secondary":{color:"#acb0b9"},"road-major":{color:"#949ba8"},boundary:{color:"#6a7181"},building:{color:"#c8cbd0",roofColor:"#d9dbdd",aoStrength:.2,tintVariation:.07,windowColor:"#9fb0c0",windowFrameColor:"#cfd6e0",windowGlow:0},housenumber:{color:"#31363f",haloColor:"#f1f2f4",haloWidth:1.4},poi:{color:"#606876",haloColor:"#f1f2f4",haloWidth:1.4},"road-label":{color:"#31363f",haloColor:"#f1f2f4",haloWidth:1.4},"water-label":{color:"#35688d",haloColor:"#f7f7f7",haloWidth:1.4},"place-label":{color:"#31363f",haloColor:"#f1f2f4",haloWidth:1.4},"poi-food":{haloColor:"#f1f2f4",haloWidth:1.4,frameColor:"#c2681c",frameOpacity:1,frameHaloColor:"#f1f2f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{haloColor:"#f1f2f4",haloWidth:1.4,frameColor:"#2f77c4",frameOpacity:1,frameHaloColor:"#f1f2f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{haloColor:"#f1f2f4",haloWidth:1.4,frameColor:"#3b82a6",frameOpacity:1,frameHaloColor:"#f1f2f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{haloColor:"#f1f2f4",haloWidth:1.4,frameColor:"#c24444",frameOpacity:1,frameHaloColor:"#f1f2f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{haloColor:"#f1f2f4",haloWidth:1.4,frameColor:"#3f7f7a",frameOpacity:1,frameHaloColor:"#f1f2f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{haloColor:"#f1f2f4",haloWidth:1.4,frameColor:"#8b5aa5",frameOpacity:1,frameHaloColor:"#f1f2f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{haloColor:"#f1f2f4",haloWidth:1.4,frameColor:"#4f8b45",frameOpacity:1,frameHaloColor:"#f1f2f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{haloColor:"#f1f2f4",haloWidth:1.4,frameColor:"#7a5fbf",frameOpacity:1,frameHaloColor:"#f1f2f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{haloColor:"#f1f2f4",haloWidth:1.4,frameColor:"#59636e",frameOpacity:1,frameHaloColor:"#f1f2f4",iconColor:"#ffffff",iconHaloWidth:0},"water-pool":{color:"#9ca4b3"},"indoor-shell":{color:"#d6d9dc",opacity:.97},"indoor-corridor":{color:"#dbdde0"},"indoor-room":{color:"#ced1d5"},"indoor-service":{color:"#b9bcc3"},"indoor-shop":{color:"#c7bcd2"},"indoor-food":{color:"#d2c7bc"},"indoor-wc":{color:"#bcc9d2"},"indoor-wall":{color:"#acafb4",roofColor:"#c2c4c7",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#b1a7c5",opacity:.95},"indoor-door":{color:"#606876",haloColor:"#f1f2f4",haloWidth:1.4},"indoor-poi":{color:"#606876",haloColor:"#f1f2f4",haloWidth:1.4},"indoor-name":{color:"#31363f",haloColor:"#f1f2f4",haloWidth:1.4},"building-entrance":{haloColor:"#f1f2f4"}},sky:{skyColor:"#5675b3",horizonColor:"#b1b4b9",fogRange:[1.33,7.14],fogIntensity:.87,spaceColor:"#0a0b0c",atmosphereColor:"#557dce",starIntensity:.45}};var ca={name:"\u041C\u0430\u0442\u043E\u0432\u0430\u044F",background:"#e7e6e4",light:{ambientColor:"#f5f5f5",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#ffffff",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#dce6ec",fillIntensity:.18},paint:{"landcover-wood":{color:"#a3be9d"},"landcover-grass":{color:"#b3cbae"},"landcover-sand":{color:"#efeac8"},"landcover-ice":{color:"#d6dce0"},"landcover-wetland":{color:"#acd4d7"},"landuse-residential":{color:"#ecebe9"},"landuse-industrial":{color:"#d1d4e0"},"landuse-civic":{color:"#e7d0d7"},"landuse-sport":{color:"#b6d2a7"},"landuse-cemetery":{color:"#b5dcad"},"landuse-parking":{color:"#d8d6d4"},park:{color:"#b3cbae"},"aeroway-area":{color:"#d6dbeb"},water:{color:"#a6bbc9"},waterway:{color:"#a6bbc9"},"aeroway-line":{color:"#f0ede9"},"road-casing-major":{color:"#969fb0"},"road-casing-secondary":{color:"#abb0ba"},"road-casing-minor":{color:"#abb0ba"},"road-rail":{color:"#adadad"},"road-path":{color:"#c7cad1"},"road-minor":{color:"#c7cad1"},"road-secondary":{color:"#c7cad1"},"road-major":{color:"#aeb4c2"},boundary:{color:"#ca919f"},building:{color:"#dad6d2",roofColor:"#e3e0dd",aoStrength:.19,tintVariation:.06,windowColor:"#9fb0c0",windowFrameColor:"#f0f0f2",windowGlow:0},housenumber:{color:"#4d4742",haloColor:"#f6f5f4",haloWidth:1.4},poi:{color:"#707a8f",haloColor:"#f6f5f4",haloWidth:1.4},"road-label":{color:"#4d4742",haloColor:"#f6f5f4",haloWidth:1.4},"water-label":{color:"#35688d",haloColor:"#f7f7f7",haloWidth:1.4},"place-label":{color:"#4d4742",haloColor:"#f6f5f4",haloWidth:1.4},"poi-food":{haloColor:"#f6f5f4",haloWidth:1.4,frameColor:"#c2681c",frameOpacity:1,frameHaloColor:"#f6f5f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{haloColor:"#f6f5f4",haloWidth:1.4,frameColor:"#2f77c4",frameOpacity:1,frameHaloColor:"#f6f5f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{haloColor:"#f6f5f4",haloWidth:1.4,frameColor:"#3b82a6",frameOpacity:1,frameHaloColor:"#f6f5f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{haloColor:"#f6f5f4",haloWidth:1.4,frameColor:"#c24444",frameOpacity:1,frameHaloColor:"#f6f5f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{haloColor:"#f6f5f4",haloWidth:1.4,frameColor:"#3f7f7a",frameOpacity:1,frameHaloColor:"#f6f5f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{haloColor:"#f6f5f4",haloWidth:1.4,frameColor:"#8b5aa5",frameOpacity:1,frameHaloColor:"#f6f5f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{haloColor:"#f6f5f4",haloWidth:1.4,frameColor:"#4f8b45",frameOpacity:1,frameHaloColor:"#f6f5f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{haloColor:"#f6f5f4",haloWidth:1.4,frameColor:"#7a5fbf",frameOpacity:1,frameHaloColor:"#f6f5f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{haloColor:"#f6f5f4",haloWidth:1.4,frameColor:"#59636e",frameOpacity:1,frameHaloColor:"#f6f5f4",iconColor:"#ffffff",iconHaloWidth:0},"water-pool":{color:"#b3c6d2"},"indoor-shell":{color:"#e6e3e1",opacity:.97},"indoor-corridor":{color:"#eae8e6"},"indoor-room":{color:"#dfdcd8"},"indoor-service":{color:"#cdc8c2"},"indoor-shop":{color:"#d1c8da"},"indoor-food":{color:"#dad1c8"},"indoor-wc":{color:"#c8d3da"},"indoor-wall":{color:"#bebab6",roofColor:"#d1cecc",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#bbb3cd",opacity:.95},"indoor-door":{color:"#707a8f",haloColor:"#f6f5f4",haloWidth:1.4},"indoor-poi":{color:"#707a8f",haloColor:"#f6f5f4",haloWidth:1.4},"indoor-name":{color:"#4d4742",haloColor:"#f6f5f4",haloWidth:1.4},"building-entrance":{color:"#225aaa",haloColor:"#f6f5f4"}},sky:{skyColor:"#83abc5",horizonColor:"#d3d2d0",fogRange:[1.34,7.31],fogIntensity:.86,spaceColor:"#0d0c0b",atmosphereColor:"#5ba1cf",starIntensity:.4}};var fa={name:"\u041C\u0438\u043D\u0438\u043C\u0430\u043B\u0438\u0437\u043C",background:"#f7f7f7",light:{ambientColor:"#fcfcfc",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#ffffff",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#dee7ed",fillIntensity:.18},paint:{"landcover-wood":{color:"#d6e1d6"},"landcover-grass":{color:"#e1eae1"},"landcover-sand":{color:"#efeac8"},"landcover-ice":{color:"#edf0f2"},"landcover-wetland":{color:"#e3f1f2"},"landuse-residential":{color:"#fafafa"},"landuse-industrial":{color:"#e7e8ef"},"landuse-civic":{color:"#f3e7eb"},"landuse-sport":{color:"#e1edde"},"landuse-cemetery":{color:"#e6f4e6"},"landuse-parking":{color:"#e9e7e7"},park:{color:"#e1eae1"},"aeroway-area":{color:"#d6dbeb"},water:{color:"#d7e2ea"},waterway:{color:"#d7e2ea"},"aeroway-line":{color:"#f0ede9"},"road-casing-major":{color:"#a3a3a3"},"road-casing-secondary":{color:"#b8b8b8"},"road-casing-minor":{color:"#b8b8b8"},"road-rail":{color:"#b3b3b3"},"road-path":{color:"#d1d1d1"},"road-minor":{color:"#d1d1d1"},"road-secondary":{color:"#d1d1d1"},"road-major":{color:"#bdbdbd"},boundary:{color:"#999999"},building:{color:"#ebebeb",roofColor:"#f2f2f2",aoStrength:.18,tintVariation:.06,windowColor:"#9fb0c0",windowFrameColor:"#f4f4f6",windowGlow:0},housenumber:{color:"#404040",haloColor:"#ffffff",haloWidth:1.4},poi:{color:"#737373",haloColor:"#ffffff",haloWidth:1.4},"road-label":{color:"#404040",haloColor:"#ffffff",haloWidth:1.4},"water-label":{color:"#35688d",haloColor:"#f7f7f7",haloWidth:1.4},"place-label":{color:"#404040",haloColor:"#ffffff",haloWidth:1.4},"poi-food":{color:"#737373",haloColor:"#ffffff",haloWidth:1.4,frameColor:"#737373",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{color:"#737373",haloColor:"#ffffff",haloWidth:1.4,frameColor:"#737373",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{color:"#737373",haloColor:"#ffffff",haloWidth:1.4,frameColor:"#737373",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{color:"#737373",haloColor:"#ffffff",haloWidth:1.4,frameColor:"#737373",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{color:"#737373",haloColor:"#ffffff",haloWidth:1.4,frameColor:"#737373",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{color:"#737373",haloColor:"#ffffff",haloWidth:1.4,frameColor:"#737373",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{color:"#737373",haloColor:"#ffffff",haloWidth:1.4,frameColor:"#737373",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{color:"#737373",haloColor:"#ffffff",haloWidth:1.4,frameColor:"#737373",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{color:"#737373",haloColor:"#ffffff",haloWidth:1.4,frameColor:"#737373",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"water-pool":{color:"#e8eff4"},"indoor-shell":{color:"#f7f7f7",opacity:.97},"indoor-corridor":{color:"#fbfbfb"},"indoor-room":{color:"#efefef"},"indoor-service":{color:"#dbdbdb"},"indoor-shop":{color:"#e4dfea"},"indoor-food":{color:"#eae4df"},"indoor-wc":{color:"#dfe5ea"},"indoor-wall":{color:"#cdcdcd",roofColor:"#e2e2e2",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#d0cbdc",opacity:.95},"indoor-door":{color:"#737373",haloColor:"#ffffff",haloWidth:1.4},"indoor-poi":{color:"#737373",haloColor:"#ffffff",haloWidth:1.4},"indoor-name":{color:"#404040",haloColor:"#ffffff",haloWidth:1.4},"building-entrance":{color:"#564e4e",haloColor:"#ffffff"}},sky:{skyColor:"#a4c0d4",horizonColor:"#e6e6e6",fogRange:[1.35,7.44],fogIntensity:.85,spaceColor:"#0d0d0d",atmosphereColor:"#5fa1d1",starIntensity:.37}};var ua={name:"\u041E\u043A\u0435\u0430\u043D",background:"#d7e3ea",light:{ambientColor:"#f3f4f4",ambientIntensity:.47,keyAzimuth:120,keyAltitude:60,keyColor:"#e8f6ff",keyIntensity:.59,fillAzimuth:300,fillAltitude:25,fillColor:"#d8e4ea",fillIntensity:.18},paint:{"landcover-wood":{color:"#75c7c7"},"landcover-grass":{color:"#97d8d2"},"landcover-sand":{color:"#efeac8"},"landcover-ice":{color:"#accedf"},"landcover-wetland":{color:"#a5d0d4"},"landuse-residential":{color:"#dfe8ec"},"landuse-industrial":{color:"#cbcedc"},"landuse-civic":{color:"#e3c9d2"},"landuse-sport":{color:"#90dfcb"},"landuse-cemetery":{color:"#a6d9d4"},"landuse-parking":{color:"#cfd2d3"},park:{color:"#97d8d2"},"aeroway-area":{color:"#d6dbeb"},water:{color:"#30abe8"},waterway:{color:"#3eb0ea"},"aeroway-line":{color:"#f0ede9"},"road-casing-major":{color:"#47a3c2"},"road-casing-secondary":{color:"#8ab2c7"},"road-casing-minor":{color:"#8ab2c7"},"road-rail":{color:"#8a9ea8"},"road-path":{color:"#b8d3e0"},"road-minor":{color:"#b8d3e0"},"road-secondary":{color:"#b8d3e0"},"road-major":{color:"#79c0d8"},boundary:{color:"#47bad1"},building:{color:"#d2dee4",roofColor:"#e7f0f3",aoStrength:.19,tintVariation:.06,windowColor:"#6b9ed1",windowFrameColor:"#e6f0f6",windowGlow:0},housenumber:{color:"#1f3c51",haloColor:"#f8fbfc",haloWidth:1.4},poi:{color:"#3b7b9b",haloColor:"#f8fbfc",haloWidth:1.4},"road-label":{color:"#1f3c51",haloColor:"#f8fbfc",haloWidth:1.4},"water-label":{color:"#35688d",haloColor:"#f7f7f7",haloWidth:1.4},"place-label":{color:"#1f3c51",haloColor:"#f8fbfc",haloWidth:1.4},"poi-food":{haloColor:"#f8fbfc",haloWidth:1.4,frameColor:"#c2681c",frameOpacity:1,frameHaloColor:"#f8fbfc",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{haloColor:"#f8fbfc",haloWidth:1.4,frameColor:"#2f77c4",frameOpacity:1,frameHaloColor:"#f8fbfc",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{haloColor:"#f8fbfc",haloWidth:1.4,frameColor:"#3b82a6",frameOpacity:1,frameHaloColor:"#f8fbfc",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{haloColor:"#f8fbfc",haloWidth:1.4,frameColor:"#c24444",frameOpacity:1,frameHaloColor:"#f8fbfc",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{haloColor:"#f8fbfc",haloWidth:1.4,frameColor:"#3f7f7a",frameOpacity:1,frameHaloColor:"#f8fbfc",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{haloColor:"#f8fbfc",haloWidth:1.4,frameColor:"#8b5aa5",frameOpacity:1,frameHaloColor:"#f8fbfc",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{haloColor:"#f8fbfc",haloWidth:1.4,frameColor:"#4f8b45",frameOpacity:1,frameHaloColor:"#f8fbfc",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{haloColor:"#f8fbfc",haloWidth:1.4,frameColor:"#7a5fbf",frameOpacity:1,frameHaloColor:"#f8fbfc",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{haloColor:"#f8fbfc",haloWidth:1.4,frameColor:"#59636e",frameOpacity:1,frameHaloColor:"#f8fbfc",iconColor:"#ffffff",iconHaloWidth:0},"water-pool":{color:"#38b3f1"},"indoor-shell":{color:"#e5e9eb",opacity:.97},"indoor-corridor":{color:"#eaeeef"},"indoor-room":{color:"#dce2e5"},"indoor-service":{color:"#c6cfd4"},"indoor-shop":{color:"#d6cede"},"indoor-food":{color:"#ded6ce"},"indoor-wc":{color:"#ced8de"},"indoor-wall":{color:"#bac1c4",roofColor:"#d0d4d6",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#c1b9d1",opacity:.95},"indoor-door":{color:"#3b7b9b",haloColor:"#f8fbfc",haloWidth:1.4},"indoor-poi":{color:"#3b7b9b",haloColor:"#f8fbfc",haloWidth:1.4},"indoor-name":{color:"#1f3c51",haloColor:"#f8fbfc",haloWidth:1.4},"building-entrance":{color:"#225aaa",haloColor:"#f8fbfc"}},sky:{skyColor:"#7aaac1",horizonColor:"#c1cfd6",fogRange:[1.34,7.27],fogIntensity:.86,spaceColor:"#080d0f",atmosphereColor:"#5aa8cf",starIntensity:.41}};var da={name:"\u041F\u0440\u0435\u043C\u0438\u0443\u043C",background:"#211f1c",model3dKey:"night",light:{ambientColor:"#b0aaa4",ambientIntensity:.34,keyAzimuth:120,keyAltitude:55,keyColor:"#c8b48a",keyIntensity:.3,fillAzimuth:300,fillAltitude:25,fillColor:"#496887",fillIntensity:.22},paint:{"landcover-wood":{color:"#1b271b"},"landcover-grass":{color:"#232f23"},"landcover-sand":{color:"#393622"},"landcover-ice":{color:"#2d3d4c"},"landcover-wetland":{color:"#213436"},"landuse-residential":{color:"#272421"},"landuse-industrial":{color:"#242633"},"landuse-civic":{color:"#332429"},"landuse-sport":{color:"#22331f"},"landuse-cemetery":{color:"#213021"},"landuse-parking":{color:"#383633"},park:{color:"#232f23"},"aeroway-area":{color:"#272a35"},water:{color:"#16293b"},waterway:{color:"#1c334a"},"aeroway-line":{color:"#55493a"},"road-casing-major":{color:"#856e32"},"road-casing-secondary":{color:"#423b2e"},"road-casing-minor":{color:"#423b2e"},"road-rail":{color:"#6b6457"},"road-path":{color:"#5e5645"},"road-minor":{color:"#5e5645"},"road-secondary":{color:"#5e5645"},"road-major":{color:"#bf9e4a"},boundary:{color:"#d1aa47"},building:{color:"#443b2c",roofColor:"#726037",aoStrength:.29,tintVariation:.1,windowColor:"#8fb8e8",windowFrameColor:"#eef0f4",windowGlow:.36},housenumber:{color:"#eae3d7",haloColor:"#181410",haloWidth:1.4},poi:{color:"#d4bb7d",haloColor:"#181410",haloWidth:1.4},"road-label":{color:"#eae3d7",haloColor:"#181410",haloWidth:1.4},"water-label":{color:"#9fbcd1",haloColor:"#131b20",haloWidth:1.4},"place-label":{color:"#eae3d7",haloColor:"#181410",haloWidth:1.4},"poi-food":{color:"#d89964",haloColor:"#181410",haloWidth:1.4,frameColor:"#d89964",frameOpacity:1,frameHaloColor:"#181410",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-shop":{color:"#699cd4",haloColor:"#181410",haloWidth:1.4,frameColor:"#699cd4",frameOpacity:1,frameHaloColor:"#181410",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-transport":{color:"#75acc8",haloColor:"#181410",haloWidth:1.4,frameColor:"#75acc8",frameOpacity:1,frameHaloColor:"#181410",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-health":{color:"#ca7272",haloColor:"#181410",haloWidth:1.4,frameColor:"#ca7272",frameOpacity:1,frameHaloColor:"#181410",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-education":{color:"#81bbb7",haloColor:"#181410",haloWidth:1.4,frameColor:"#81bbb7",frameOpacity:1,frameHaloColor:"#181410",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-culture":{color:"#a684b8",haloColor:"#181410",haloWidth:1.4,frameColor:"#a684b8",frameOpacity:1,frameHaloColor:"#181410",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-sport":{color:"#89bb81",haloColor:"#181410",haloWidth:1.4,frameColor:"#89bb81",frameOpacity:1,frameHaloColor:"#181410",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-lodging":{color:"#8e79c3",haloColor:"#181410",haloWidth:1.4,frameColor:"#8e79c3",frameOpacity:1,frameHaloColor:"#181410",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-service":{color:"#959ea7",haloColor:"#181410",haloWidth:1.4,frameColor:"#959ea7",frameOpacity:1,frameHaloColor:"#181410",iconColor:"#1b1b1b",iconHaloWidth:0},"water-pool":{color:"#1c3752"},"indoor-shell":{color:"#564b39",opacity:.97},"indoor-corridor":{color:"#504635"},"indoor-room":{color:"#605440"},"indoor-service":{color:"#7b6c52"},"indoor-shop":{color:"#5c4672"},"indoor-food":{color:"#725d46"},"indoor-wc":{color:"#466172"},"indoor-wall":{color:"#857a68",roofColor:"#9a9285",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#66558a",opacity:.95},"indoor-door":{color:"#d4bb7d",haloColor:"#181410",haloWidth:1.4},"indoor-poi":{color:"#d4bb7d",haloColor:"#181410",haloWidth:1.4},"indoor-name":{color:"#eae3d7",haloColor:"#181410",haloWidth:1.4},"building-entrance":{color:"#79a0d7",haloColor:"#181410"}},sky:{skyColor:"#09121b",horizonColor:"#2c2a27",fogRange:[1.3,6.51],fogIntensity:.9,spaceColor:"#060606",atmosphereColor:"#3679b9",starIntensity:.79}};var ha={name:"\u0420\u0435\u0430\u043B\u0438\u0441\u0442\u0438\u0447\u043D\u0430\u044F",background:"#d6dac8",light:{ambientColor:"#eeeeed",ambientIntensity:.46,keyAzimuth:120,keyAltitude:59,keyColor:"#fff0d8",keyIntensity:.57,fillAzimuth:300,fillAltitude:25,fillColor:"#cbd9e3",fillIntensity:.18},paint:{"landcover-wood":{color:"#62a63f"},"landcover-grass":{color:"#8dbf69"},"landcover-sand":{color:"#efeac8"},"landcover-ice":{color:"#b4c9d7"},"landcover-wetland":{color:"#75b7bd"},"landuse-residential":{color:"#d6d1c2"},"landuse-industrial":{color:"#b9bdd0"},"landuse-civic":{color:"#d9b5c1"},"landuse-sport":{color:"#8bc95e"},"landuse-cemetery":{color:"#95c374"},"landuse-parking":{color:"#c3c5bf"},park:{color:"#8dbf69"},"aeroway-area":{color:"#d6dbeb"},water:{color:"#4d97cb"},waterway:{color:"#599ecf"},"aeroway-line":{color:"#f0ede9"},"road-casing-major":{color:"#856b47"},"road-casing-secondary":{color:"#766b60"},"road-casing-minor":{color:"#766b60"},"road-rail":{color:"#666666"},"road-path":{color:"#9c948b"},"road-minor":{color:"#9c948b"},"road-secondary":{color:"#9c948b"},"road-major":{color:"#ccaa66"},boundary:{color:"#8a735c"},building:{color:"#cdc4b7",roofColor:"#cdc4b7",aoStrength:.2,tintVariation:.07,windowColor:"#9fb0c0",windowFrameColor:"#eceef2",windowGlow:0},housenumber:{color:"#3b332b",haloColor:"#f5f5f0",haloWidth:1.4},poi:{color:"#735c45",haloColor:"#f5f5f0",haloWidth:1.4},"road-label":{color:"#3b332b",haloColor:"#f5f5f0",haloWidth:1.4},"water-label":{color:"#35688d",haloColor:"#f7f7f7",haloWidth:1.4},"place-label":{color:"#3b332b",haloColor:"#f5f5f0",haloWidth:1.4},"poi-food":{haloColor:"#f5f5f0",haloWidth:1.4,frameColor:"#c2681c",frameOpacity:1,frameHaloColor:"#f5f5f0",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{haloColor:"#f5f5f0",haloWidth:1.4,frameColor:"#2f77c4",frameOpacity:1,frameHaloColor:"#f5f5f0",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{haloColor:"#f5f5f0",haloWidth:1.4,frameColor:"#3b82a6",frameOpacity:1,frameHaloColor:"#f5f5f0",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{haloColor:"#f5f5f0",haloWidth:1.4,frameColor:"#c24444",frameOpacity:1,frameHaloColor:"#f5f5f0",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{haloColor:"#f5f5f0",haloWidth:1.4,frameColor:"#3f7f7a",frameOpacity:1,frameHaloColor:"#f5f5f0",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{haloColor:"#f5f5f0",haloWidth:1.4,frameColor:"#8b5aa5",frameOpacity:1,frameHaloColor:"#f5f5f0",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{haloColor:"#f5f5f0",haloWidth:1.4,frameColor:"#4f8b45",frameOpacity:1,frameHaloColor:"#f5f5f0",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{haloColor:"#f5f5f0",haloWidth:1.4,frameColor:"#7a5fbf",frameOpacity:1,frameHaloColor:"#f5f5f0",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{haloColor:"#f5f5f0",haloWidth:1.4,frameColor:"#59636e",frameOpacity:1,frameHaloColor:"#f5f5f0",iconColor:"#ffffff",iconHaloWidth:0},"water-pool":{color:"#559fd3"},"indoor-shell":{color:"#d6d0c9",opacity:.97},"indoor-corridor":{color:"#dad5ce"},"indoor-room":{color:"#cfc9c0"},"indoor-service":{color:"#beb6a9"},"indoor-shop":{color:"#bdb0ca"},"indoor-food":{color:"#cabeb0"},"indoor-wc":{color:"#b0c0ca"},"indoor-wall":{color:"#ada79e",roofColor:"#bfbbb6",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#a69bbd",opacity:.95},"indoor-door":{color:"#735c45",haloColor:"#f5f5f0",haloWidth:1.4},"indoor-poi":{color:"#735c45",haloColor:"#f5f5f0",haloWidth:1.4},"indoor-name":{color:"#3b332b",haloColor:"#f5f5f0",haloWidth:1.4},"building-entrance":{haloColor:"#f5f5f0"}},sky:{skyColor:"#5f92b7",horizonColor:"#bfc4b1",fogRange:[1.33,7.17],fogIntensity:.87,spaceColor:"#0d0e09",atmosphereColor:"#569dce",starIntensity:.44}};var ma={name:"\u041A\u043E\u0441\u043C\u043E\u0441",background:"#0c0a1a",model3dKey:"night",light:{ambientColor:"#8c7fcb",ambientIntensity:.34,keyAzimuth:120,keyAltitude:55,keyColor:"#c0a8ff",keyIntensity:.28,fillAzimuth:300,fillAltitude:25,fillColor:"#475385",fillIntensity:.22},paint:{"landcover-wood":{color:"#241730"},"landcover-grass":{color:"#2e203c"},"landcover-sand":{color:"#292719"},"landcover-ice":{color:"#2e365b"},"landcover-wetland":{color:"#172526"},"landuse-residential":{color:"#110e20"},"landuse-industrial":{color:"#191b24"},"landuse-civic":{color:"#24191d"},"landuse-sport":{color:"#281c40"},"landuse-cemetery":{color:"#1c1721"},"landuse-parking":{color:"#27272b"},park:{color:"#2e203c"},"aeroway-area":{color:"#1c1f26"},water:{color:"#121c49"},waterway:{color:"#16225a"},"aeroway-line":{color:"#55493a"},"road-casing-major":{color:"#7e279b"},"road-casing-secondary":{color:"#3a2060"},"road-casing-minor":{color:"#3a2060"},"road-rail":{color:"#985298"},"road-path":{color:"#6b35b6"},"road-minor":{color:"#6b35b6"},"road-secondary":{color:"#6b35b6"},"road-major":{color:"#bf4ce6"},boundary:{color:"#ec51b8"},building:{color:"#2a2145",roofColor:"#7f30a6",aoStrength:.29,tintVariation:.1,windowColor:"#84dcff",windowFrameColor:"#9fb0d8",windowGlow:.5},housenumber:{color:"#dbd1f0",haloColor:"#080614",haloWidth:1.4},poi:{color:"#d186ea",haloColor:"#080614",haloWidth:1.4},"road-label":{color:"#dbd1f0",haloColor:"#080614",haloWidth:1.4},"water-label":{color:"#9fbcd1",haloColor:"#131b20",haloWidth:1.4},"place-label":{color:"#dbd1f0",haloColor:"#080614",haloWidth:1.4},"poi-food":{color:"#d89964",haloColor:"#080614",haloWidth:1.4,frameColor:"#d89964",frameOpacity:1,frameHaloColor:"#080614",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-shop":{color:"#699cd4",haloColor:"#080614",haloWidth:1.4,frameColor:"#699cd4",frameOpacity:1,frameHaloColor:"#080614",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-transport":{color:"#75acc8",haloColor:"#080614",haloWidth:1.4,frameColor:"#75acc8",frameOpacity:1,frameHaloColor:"#080614",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-health":{color:"#ca7272",haloColor:"#080614",haloWidth:1.4,frameColor:"#ca7272",frameOpacity:1,frameHaloColor:"#080614",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-education":{color:"#81bbb7",haloColor:"#080614",haloWidth:1.4,frameColor:"#81bbb7",frameOpacity:1,frameHaloColor:"#080614",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-culture":{color:"#a684b8",haloColor:"#080614",haloWidth:1.4,frameColor:"#a684b8",frameOpacity:1,frameHaloColor:"#080614",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-sport":{color:"#89bb81",haloColor:"#080614",haloWidth:1.4,frameColor:"#89bb81",frameOpacity:1,frameHaloColor:"#080614",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-lodging":{color:"#8e79c3",haloColor:"#080614",haloWidth:1.4,frameColor:"#8e79c3",frameOpacity:1,frameHaloColor:"#080614",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-service":{color:"#959ea7",haloColor:"#080614",haloWidth:1.4,frameColor:"#959ea7",frameOpacity:1,frameHaloColor:"#080614",iconColor:"#1b1b1b",iconHaloWidth:0},"water-pool":{color:"#152466"},"indoor-shell":{color:"#403956",opacity:.97},"indoor-corridor":{color:"#3c3550"},"indoor-room":{color:"#484060"},"indoor-service":{color:"#5c527b"},"indoor-shop":{color:"#5c4672"},"indoor-food":{color:"#725d46"},"indoor-wc":{color:"#466172"},"indoor-wall":{color:"#6f6885",roofColor:"#8a859a",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#66558a",opacity:.95},"indoor-door":{color:"#d186ea",haloColor:"#080614",haloWidth:1.4},"indoor-poi":{color:"#d186ea",haloColor:"#080614",haloWidth:1.4},"indoor-name":{color:"#dbd1f0",haloColor:"#080614",haloWidth:1.4},"building-entrance":{color:"#79a0d7",haloColor:"#080614"}},sky:{skyColor:"#080b18",horizonColor:"#1d1931",fogRange:[1.3,6.5],fogIntensity:.9,spaceColor:"#040308",atmosphereColor:"#354cb6",starIntensity:.82}};var pa={name:"\u0412\u0443\u043B\u043A\u0430\u043D",background:"#29211e",model3dKey:"night",light:{ambientColor:"#b6a6a1",ambientIntensity:.35,keyAzimuth:120,keyAltitude:55,keyColor:"#ffb070",keyIntensity:.29,fillAzimuth:300,fillAltitude:25,fillColor:"#8b604b",fillIntensity:.22},paint:{"landcover-wood":{color:"#31241c"},"landcover-grass":{color:"#392e22"},"landcover-sand":{color:"#403c26"},"landcover-ice":{color:"#aa6b4b"},"landcover-wetland":{color:"#243b3d"},"landuse-residential":{color:"#2f2623"},"landuse-industrial":{color:"#282b39"},"landuse-civic":{color:"#39282e"},"landuse-sport":{color:"#3e2e1e"},"landuse-cemetery":{color:"#362e26"},"landuse-parking":{color:"#3e3938"},park:{color:"#392e22"},"aeroway-area":{color:"#2b2f3b"},water:{color:"#8b3f18"},waterway:{color:"#9c461c"},"aeroway-line":{color:"#55493a"},"road-casing-major":{color:"#aa350e"},"road-casing-secondary":{color:"#712b14"},"road-casing-minor":{color:"#712b14"},"road-rail":{color:"#8f583d"},"road-path":{color:"#e65e19"},"road-minor":{color:"#e65e19"},"road-secondary":{color:"#e65e19"},"road-major":{color:"#f98c1f"},boundary:{color:"#f48c25"},building:{color:"#422b24",roofColor:"#c1551f",aoStrength:.28,tintVariation:.09,windowColor:"#84dcff",windowFrameColor:"#d8b0a0",windowGlow:.5},housenumber:{color:"#f3e0ce",haloColor:"#150b09",haloWidth:1.4},poi:{color:"#f09e4c",haloColor:"#150b09",haloWidth:1.4},"road-label":{color:"#f3e0ce",haloColor:"#150b09",haloWidth:1.4},"water-label":{color:"#9fbcd1",haloColor:"#131b20",haloWidth:1.4},"place-label":{color:"#f3e0ce",haloColor:"#150b09",haloWidth:1.4},"poi-food":{color:"#d89964",haloColor:"#150b09",haloWidth:1.4,frameColor:"#d89964",frameOpacity:1,frameHaloColor:"#150b09",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-shop":{color:"#699cd4",haloColor:"#150b09",haloWidth:1.4,frameColor:"#699cd4",frameOpacity:1,frameHaloColor:"#150b09",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-transport":{color:"#75acc8",haloColor:"#150b09",haloWidth:1.4,frameColor:"#75acc8",frameOpacity:1,frameHaloColor:"#150b09",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-health":{color:"#ca7272",haloColor:"#150b09",haloWidth:1.4,frameColor:"#ca7272",frameOpacity:1,frameHaloColor:"#150b09",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-education":{color:"#81bbb7",haloColor:"#150b09",haloWidth:1.4,frameColor:"#81bbb7",frameOpacity:1,frameHaloColor:"#150b09",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-culture":{color:"#a684b8",haloColor:"#150b09",haloWidth:1.4,frameColor:"#a684b8",frameOpacity:1,frameHaloColor:"#150b09",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-sport":{color:"#89bb81",haloColor:"#150b09",haloWidth:1.4,frameColor:"#89bb81",frameOpacity:1,frameHaloColor:"#150b09",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-lodging":{color:"#8e79c3",haloColor:"#150b09",haloWidth:1.4,frameColor:"#8e79c3",frameOpacity:1,frameHaloColor:"#150b09",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-service":{color:"#959ea7",haloColor:"#150b09",haloWidth:1.4,frameColor:"#959ea7",frameOpacity:1,frameHaloColor:"#150b09",iconColor:"#1b1b1b",iconHaloWidth:0},"water-pool":{color:"#c2531a"},"indoor-shell":{color:"#564039",opacity:.97},"indoor-corridor":{color:"#503b35"},"indoor-room":{color:"#604840"},"indoor-service":{color:"#7b5c52"},"indoor-shop":{color:"#5c4672"},"indoor-food":{color:"#725d46"},"indoor-wc":{color:"#466172"},"indoor-wall":{color:"#856f68",roofColor:"#9a8a85",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#66558a",opacity:.95},"indoor-door":{color:"#f09e4c",haloColor:"#150b09",haloWidth:1.4},"indoor-poi":{color:"#f09e4c",haloColor:"#150b09",haloWidth:1.4},"indoor-name":{color:"#f3e0ce",haloColor:"#150b09",haloWidth:1.4},"building-entrance":{color:"#79a0d7",haloColor:"#150b09"}},sky:{skyColor:"#1c100a",horizonColor:"#312a27",fogRange:[1.3,6.52],fogIntensity:.9,spaceColor:"#070605",atmosphereColor:"#ba6336",starIntensity:.78}};var ba={name:"\u0411\u0435\u043B\u0430\u044F",background:"#f5f1f0",light:{ambientColor:"#fafafa",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#ffffff",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#dee8ed",fillIntensity:.18},paint:{"landcover-wood":{color:"#a7e2a2"},"landcover-grass":{color:"#b8ebad"},"landcover-sand":{color:"#efeac8"},"landcover-ice":{color:"#d7eaf4"},"landcover-wetland":{color:"#c1dee1"},"landuse-residential":{color:"#f6f4f4"},"landuse-industrial":{color:"#e0e2eb"},"landuse-civic":{color:"#efe1e6"},"landuse-sport":{color:"#c0f0a8"},"landuse-cemetery":{color:"#c8e5c2"},"landuse-parking":{color:"#e4e2e2"},park:{color:"#b8ebad"},"aeroway-area":{color:"#d6dbeb"},water:{color:"#99ddff"},waterway:{color:"#99ddff"},"aeroway-line":{color:"#f0ede9"},"road-casing-major":{color:"#94a0b8"},"road-casing-secondary":{color:"#a3adc2"},"road-casing-minor":{color:"#a3adc2"},"road-rail":{color:"#a6a6a6"},"road-path":{color:"#bfc6d9"},"road-minor":{color:"#bfc6d9"},"road-secondary":{color:"#bfc6d9"},"road-major":{color:"#a1b0c4"},boundary:{color:"#f87797"},building:{color:"#ffffff",roofColor:"#ffffff",aoStrength:.19,tintVariation:.06,windowColor:"#6b9ed1",windowFrameColor:"#ffffff",windowGlow:0},housenumber:{color:"#262626",haloColor:"#ffffff",haloWidth:1.4},poi:{color:"#586e84",haloColor:"#ffffff",haloWidth:1.4},"road-label":{color:"#262626",haloColor:"#ffffff",haloWidth:1.4},"water-label":{color:"#35688d",haloColor:"#f7f7f7",haloWidth:1.4},"place-label":{color:"#262626",haloColor:"#ffffff",haloWidth:1.4},"poi-food":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#c2681c",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#2f77c4",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#3b82a6",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#c24444",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#3f7f7a",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#8b5aa5",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#4f8b45",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#7a5fbf",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#59636e",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"water-pool":{color:"#b1e5ff"},"indoor-shell":{color:"#f7f7f7",opacity:.97},"indoor-corridor":{color:"#fbfbfb"},"indoor-room":{color:"#efefef"},"indoor-service":{color:"#dbdbdb"},"indoor-shop":{color:"#e4dfea"},"indoor-food":{color:"#eae4df"},"indoor-wc":{color:"#dfe5ea"},"indoor-wall":{color:"#cdcdcd",roofColor:"#e2e2e2",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#d0cbdc",opacity:.95},"indoor-door":{color:"#586e84",haloColor:"#ffffff",haloWidth:1.4},"indoor-poi":{color:"#586e84",haloColor:"#ffffff",haloWidth:1.4},"indoor-name":{color:"#262626",haloColor:"#ffffff",haloWidth:1.4},"building-entrance":{color:"#225aaa",haloColor:"#ffffff"}},sky:{skyColor:"#9bbecf",horizonColor:"#e5dfdc",fogRange:[1.35,7.4],fogIntensity:.85,spaceColor:"#0f0c0a",atmosphereColor:"#5eaad0",starIntensity:.38}};var Aa={"3d":Zi,cartoon:Qi,cyberpunk:qi,dawn:$i,dusk:ea,earth:ta,future:oa,"glass-refined":ra,glass:na,"harmony-black":ia,"harmony-blue":aa,"harmony-green":la,lunar:sa,matte:ca,minimal:fa,ocean:ua,premium:da,realistic:ha,space:ma,volcano:pa,white:ba};function Wo(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 X="base",ya="\u241F",bt=(n,e)=>n+"\u241F"+String(e);var At=class{constructor(e=Ur){this.splitValues={};this.spec=e,this.light={...Kr,...e.light??{}},this.sky={...Nr,...e.sky??{}},this.layers=e.layers.map(t=>({...t,paint:{...t.paint}}));}get background(){return ce(this.spec.background??"#eceae4")}colorAt(e,t,o=[1,0,1,1]){let r=e.paint;return Le(r?.color,t,o)}layerVisibleAt(e,t){return !(e.visible===false||e.minzoom!==void 0&&t<e.minzoom||e.maxzoom!==void 0&&t>=e.maxzoom)}workerPlan(e=X){return this.layers.filter(t=>t.type!=="raster").filter(t=>(t.source??X)===e).map(t=>({id:t.id,type:t.type,sourceLayer:t["source-layer"],filter:t.filter,minzoom:t.minzoom??0,maxzoom:t.maxzoom??24,...t.splitBy?{splitBy:t.splitBy}:{},...t.cornerRadius?{cornerRadius:t.cornerRadius,cornerSegments:t.cornerSegments}:{},...t.clipToTile?{clipToTile:true}:{},...t.groundBy?{groundBy:t.groundBy}:{},...t.type==="surface"?{elevation:t.elevation,base:t.base,bevel:t.bevel,bevelDrop:t.bevelDrop}:{},...t.type==="line"&&typeof t.paint?.elevation=="number"&&t.paint.elevation>0?{ground:true}:{},...t.type==="symbol"?{textField:t.layout?.textField,iconImage:t.layout?.iconImage,iconRotate:t.layout?.iconRotate,textPlacement:t.layout?.textPlacement,abbreviate:t.layout?.abbreviate}:{}}))}usedSources(){return [...new Set(this.layers.map(e=>e.source??X))]}bucketKeyFor(e){if(e.type==="raster"||!e.splitBy)return e.id;let t=this.splitValues[e.splitBy];return t===void 0?null:bt(e.id,t)}sourceLayers(){return [...new Set(this.layers.flatMap(e=>e.type==="raster"?[]:[e["source-layer"]]))]}},Ur=Ni,bf=Ki,Af=Ui,yf=Ji,yt={day:{name:"\u0414\u043D\u0435\u0432\u043D\u0430\u044F"},night:Xi,mono:ji,pale:Yi,...Aa};function Vo(n,e=Ur){if(typeof n!="string")return Wo(e,n);if(n==="day")return e;let t=yt[n];return t?Wo(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(yt).join(", ")}`),e)}var Ut=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 ga(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 Jt=`
|
|
9
|
+
uniform vec3 u_ambient_color;
|
|
10
|
+
uniform float u_ambient_intensity;
|
|
11
|
+
uniform vec3 u_key_dir; // \u043A\u0443\u0434\u0430 \u043B\u0435\u0442\u0438\u0442 \u0441\u0432\u0435\u0442 \u043A\u043B\u044E\u0447\u0435\u0432\u043E\u0433\u043E \u0438\u0441\u0442\u043E\u0447\u043D\u0438\u043A\u0430
|
|
12
|
+
uniform vec3 u_key_color;
|
|
13
|
+
uniform float u_key_intensity;
|
|
14
|
+
uniform vec3 u_fill_dir;
|
|
15
|
+
uniform vec3 u_fill_color;
|
|
16
|
+
uniform float u_fill_intensity;
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Ambient \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043E\u0442 \u041D\u041E\u0420\u041C\u0410\u041B\u0418, \u0445\u043E\u0442\u044F \u0444\u043E\u0440\u043C\u0430\u043B\u044C\u043D\u043E \u043E\u043D \u0440\u043E\u0432\u043D\u044B\u0439.
|
|
20
|
+
*
|
|
21
|
+
* \u0414\u0432\u0435 \u043F\u043E\u043F\u0440\u0430\u0432\u043A\u0438, \u043E\u0431\u0435 \u0437\u0430 \u043A\u043E\u043F\u0435\u0439\u043A\u0438 \u0438 \u043E\u0431\u0435 \u0440\u0435\u0448\u0430\u044E\u0442, \u0432\u044B\u0433\u043B\u044F\u0434\u0438\u0442 \u0441\u0446\u0435\u043D\u0430 \u0436\u0438\u0432\u043E\u0439 \u0438\u043B\u0438 \u043F\u043B\u0430\u0441\u0442\u0438\u043A\u043E\u0432\u043E\u0439:
|
|
22
|
+
* - \u043D\u0435\u0431\u043E \u044F\u0440\u0447\u0435 \u0441\u043E \u0441\u0442\u043E\u0440\u043E\u043D\u044B \u0441\u043E\u043B\u043D\u0446\u0430, \u043F\u043E\u044D\u0442\u043E\u043C\u0443 \u0433\u0440\u0430\u043D\u044C, \u043E\u0442\u0432\u0451\u0440\u043D\u0443\u0442\u0430\u044F \u043E\u0442 \u043D\u0435\u0433\u043E, \u043F\u043E\u043B\u0443\u0447\u0430\u0435\u0442
|
|
23
|
+
* \u043C\u0435\u043D\u044C\u0448\u0435 \u0440\u0430\u0441\u0441\u0435\u044F\u043D\u043D\u043E\u0433\u043E \u0441\u0432\u0435\u0442\u0430;
|
|
24
|
+
* - \u0433\u0440\u0430\u043D\u044C, \u0441\u043C\u043E\u0442\u0440\u044F\u0449\u0430\u044F \u0432\u043D\u0438\u0437, \u0432\u0438\u0434\u0438\u0442 \u043C\u0435\u043D\u044C\u0448\u0435 \u043D\u0435\u0431\u0430 \u0438 \u0431\u043E\u043B\u044C\u0448\u0435 \u0437\u0435\u043C\u043B\u0438 \u2014 \u044D\u0442\u043E \u0434\u0435\u0448\u0451\u0432\u0430\u044F
|
|
25
|
+
* \u0438\u043C\u0438\u0442\u0430\u0446\u0438\u044F \u0442\u043E\u0433\u043E, \u0447\u0442\u043E \u043E\u043A\u0440\u0443\u0436\u0435\u043D\u0438\u0435 \u0447\u0430\u0441\u0442\u0438\u0447\u043D\u043E \u0437\u0430\u0433\u043E\u0440\u043E\u0436\u0435\u043D\u043E.
|
|
26
|
+
* \u041F\u0440\u0438\u0451\u043C \u0432\u0437\u044F\u0442 \u0443 Mapbox (calculate_ambient_directional_factor).
|
|
27
|
+
*/
|
|
28
|
+
float ambientFactor(vec3 normal) {
|
|
29
|
+
float ndl = dot(normal, -u_key_dir);
|
|
30
|
+
float lum = dot(u_key_color * u_key_intensity, vec3(0.2126, 0.7152, 0.0722));
|
|
31
|
+
float minFactor = 1.0 - 0.3 * min(lum, 1.0);
|
|
32
|
+
float towardSun = mix(minFactor, 1.0, min(ndl + 1.0, 1.0));
|
|
33
|
+
float upward = mix(0.92, 1.0, normal.z * 0.5 + 0.5);
|
|
34
|
+
return towardSun * upward;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* \u0421\u0432\u0435\u0442 \u0441\u043A\u043B\u0430\u0434\u044B\u0432\u0430\u0435\u0442\u0441\u044F \u0432 \u041B\u0418\u041D\u0415\u0419\u041D\u041E\u041C \u043F\u0440\u043E\u0441\u0442\u0440\u0430\u043D\u0441\u0442\u0432\u0435, \u0430 \u043A \u0446\u0432\u0435\u0442\u0443 \u043F\u0440\u0438\u043C\u0435\u043D\u044F\u0435\u0442\u0441\u044F \u0441 \u0433\u0430\u043C\u043C\u043E\u0439.
|
|
39
|
+
*
|
|
40
|
+
* \u041F\u0440\u044F\u043C\u043E\u0435 \u0443\u043C\u043D\u043E\u0436\u0435\u043D\u0438\u0435 sRGB-\u0446\u0432\u0435\u0442\u0430 \u043D\u0430 \u0441\u0443\u043C\u043C\u0443 \u0438\u0441\u0442\u043E\u0447\u043D\u0438\u043A\u043E\u0432 \u043F\u0435\u0440\u0435\u0441\u0432\u0435\u0447\u0438\u0432\u0430\u0435\u0442 \u0441\u0432\u0435\u0442\u043B\u043E\u0435 \u0438
|
|
41
|
+
* \u0437\u0430\u0432\u0430\u043B\u0438\u0432\u0430\u0435\u0442 \u0442\u0451\u043C\u043D\u043E\u0435: \u0432 \u0442\u0435\u043D\u0438 \u0432\u043C\u0435\u0441\u0442\u043E \u043F\u0440\u0438\u0433\u043B\u0443\u0448\u0451\u043D\u043D\u043E\u0433\u043E \u0446\u0432\u0435\u0442\u0430 \u043F\u043E\u043B\u0443\u0447\u0430\u0435\u0442\u0441\u044F \u0433\u0440\u044F\u0437\u044C.
|
|
42
|
+
* pow(k, 1/2.2) \u2014 \u0442\u043E\u0442 \u0436\u0435 \u0440\u0435\u0437\u0443\u043B\u044C\u0442\u0430\u0442, \u0447\u0442\u043E \xAB\u043F\u0435\u0440\u0435\u0432\u0435\u0441\u0442\u0438 \u0432 \u043B\u0438\u043D\u0435\u0439\u043D\u043E\u0435, \u0443\u043C\u043D\u043E\u0436\u0438\u0442\u044C,
|
|
43
|
+
* \u0432\u0435\u0440\u043D\u0443\u0442\u044C \u043E\u0431\u0440\u0430\u0442\u043D\u043E\xBB, \u043D\u043E \u0431\u0435\u0437 \u0434\u0432\u0443\u0445 \u0432\u043E\u0437\u0432\u0435\u0434\u0435\u043D\u0438\u0439 \u0432 \u0441\u0442\u0435\u043F\u0435\u043D\u044C \u043D\u0430 \u0446\u0432\u0435\u0442.
|
|
44
|
+
*/
|
|
45
|
+
/**
|
|
46
|
+
* \u0422\u043E \u0436\u0435 \u043E\u0441\u0432\u0435\u0449\u0435\u043D\u0438\u0435, \u043D\u043E \u0441 \u0414\u041E\u0411\u0410\u0412\u041E\u0427\u041D\u042B\u041C \u0441\u0432\u0435\u0442\u043E\u043C \u2014 \u0441\u043E\u0431\u0441\u0442\u0432\u0435\u043D\u043D\u044B\u043C\u0438 \u0444\u043E\u043D\u0430\u0440\u044F\u043C\u0438 \u043E\u0431\u044A\u0435\u043A\u0442\u0430.
|
|
47
|
+
*
|
|
48
|
+
* \u041F\u043E\u0447\u0435\u043C\u0443 \u0434\u043E\u0431\u0430\u0432\u043A\u0430 \u0437\u0430\u0445\u043E\u0434\u0438\u0442 \u0437\u0434\u0435\u0441\u044C, \u0430 \u043D\u0435 \u043F\u0440\u0438\u0431\u0430\u0432\u043B\u044F\u0435\u0442\u0441\u044F \u043A \u0433\u043E\u0442\u043E\u0432\u043E\u043C\u0443 \u0446\u0432\u0435\u0442\u0443: \u043A\u0440\u0438\u0432\u0430\u044F pow(light, 1/2.2)
|
|
49
|
+
* \u043F\u0440\u0438\u043C\u0435\u043D\u044F\u0435\u0442\u0441\u044F \u043A \u0421\u0412\u0415\u0422\u0423, \u0438 \u0432 \u044D\u0442\u043E\u043C \u0432\u0435\u0441\u044C \u0441\u043C\u044B\u0441\u043B \u2014 \u044F\u0440\u043A\u043E\u0435 \u0441\u0432\u043E\u0440\u0430\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044F \u043F\u043B\u0430\u0432\u043D\u043E. \u0421\u0432\u0435\u0442 \u0444\u043E\u043D\u0430\u0440\u044F, \u043F\u0440\u0438\u0431\u0430\u0432\u043B\u0435\u043D\u043D\u044B\u0439
|
|
50
|
+
* \u0443\u0436\u0435 \u043F\u043E\u0441\u043B\u0435 \u043D\u0435\u0451, \u0438\u0434\u0451\u0442 \u043C\u0438\u043C\u043E \u043A\u0440\u0438\u0432\u043E\u0439 \u0438 \u0443\u043F\u0438\u0440\u0430\u0435\u0442\u0441\u044F \u0432 \u043F\u043E\u0442\u043E\u043B\u043E\u043A: \u043F\u044F\u0442\u043D\u043E \u043D\u0430 \u043F\u043B\u043E\u0449\u0430\u0434\u043A\u0435 \u0441\u0442\u0430\u043D\u043E\u0432\u0438\u043B\u043E\u0441\u044C \u043F\u043B\u043E\u0441\u043A\u0438\u043C
|
|
51
|
+
* \u0431\u0435\u043B\u044B\u043C \u043E\u0432\u0430\u043B\u043E\u043C \u0431\u0435\u0437 \u0444\u043E\u0440\u043C\u044B. \u0417\u0430\u0432\u0435\u0434\u0451\u043D\u043D\u044B\u0439 \u0434\u043E \u043A\u0440\u0438\u0432\u043E\u0439, \u043E\u043D \u0432\u0435\u0434\u0451\u0442 \u0441\u0435\u0431\u044F \u043A\u0430\u043A \u043B\u044E\u0431\u043E\u0439 \u0434\u0440\u0443\u0433\u043E\u0439 \u0438\u0441\u0442\u043E\u0447\u043D\u0438\u043A.
|
|
52
|
+
*/
|
|
53
|
+
vec3 applyLightWithExtra(vec3 albedo, vec3 normal, float keyFactor, vec3 extra) {
|
|
54
|
+
float fill = max(dot(normal, -u_fill_dir), 0.0);
|
|
55
|
+
|
|
56
|
+
vec3 light = u_ambient_color * (u_ambient_intensity * ambientFactor(normal))
|
|
57
|
+
+ u_key_color * (u_key_intensity * keyFactor)
|
|
58
|
+
+ u_fill_color * (u_fill_intensity * fill)
|
|
59
|
+
+ extra;
|
|
60
|
+
|
|
61
|
+
return albedo * pow(max(light, vec3(0.0)), vec3(1.0 / 2.2));
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
vec3 applyLightWithFactor(vec3 albedo, vec3 normal, float keyFactor) {
|
|
65
|
+
return applyLightWithExtra(albedo, normal, keyFactor, vec3(0.0));
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
vec3 applyLight(vec3 albedo, vec3 normal) {
|
|
69
|
+
return applyLightWithFactor(albedo, normal, max(dot(normal, -u_key_dir), 0.0));
|
|
70
|
+
}
|
|
71
|
+
`,zo=`
|
|
72
|
+
// \u0423 \u0441\u0440\u0430\u0432\u043D\u0438\u0432\u0430\u044E\u0449\u0435\u0433\u043E \u0441\u044D\u043C\u043F\u043B\u0435\u0440\u0430 \u0432 GLSL ES 3.00 \u041D\u0415\u0422 \u0442\u043E\u0447\u043D\u043E\u0441\u0442\u0438 \u043F\u043E \u0443\u043C\u043E\u043B\u0447\u0430\u043D\u0438\u044E (\u0432 \u043E\u0442\u043B\u0438\u0447\u0438\u0435
|
|
73
|
+
// \u043E\u0442 \u043E\u0431\u044B\u0447\u043D\u043E\u0433\u043E sampler2D \u0432\u043E \u0444\u0440\u0430\u0433\u043C\u0435\u043D\u0442\u0435) \u2014 \u0431\u0435\u0437 \u044D\u0442\u043E\u0439 \u0441\u0442\u0440\u043E\u043A\u0438 \u0448\u0435\u0439\u0434\u0435\u0440 \u043D\u0435 \u043A\u043E\u043C\u043F\u0438\u043B\u0438\u0440\u0443\u0435\u0442\u0441\u044F.
|
|
74
|
+
precision highp sampler2DShadow;
|
|
75
|
+
|
|
76
|
+
uniform sampler2DShadow u_shadow_map;
|
|
77
|
+
uniform vec4 u_shadow_params; // x: \u0441\u0438\u043B\u0430, y: 1/\u0440\u0430\u0437\u043C\u0435\u0440 \u043A\u0430\u0440\u0442\u044B, z: bias, w: \u0432\u043A\u043B
|
|
78
|
+
uniform vec3 u_shadow_color;
|
|
79
|
+
|
|
80
|
+
in vec4 v_shadow;
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* \u0414\u043E\u043B\u044F \u041F\u0415\u0420\u0415\u041A\u0420\u042B\u0422\u0418\u042F: 0 \u2014 \u0441\u0432\u0435\u0442\u0430 \u043F\u043E\u043B\u043D\u043E, 1 \u2014 \u043F\u043E\u043B\u043D\u0430\u044F \u0442\u0435\u043D\u044C.
|
|
84
|
+
*
|
|
85
|
+
* ndotl \u043D\u0443\u0436\u0435\u043D \u043D\u0430\u043A\u043B\u043E\u043D\u043D\u043E\u043C\u0443 \u0441\u043C\u0435\u0449\u0435\u043D\u0438\u044E: \u0447\u0435\u043C \u043E\u0441\u0442\u0440\u0435\u0435 \u0441\u0432\u0435\u0442 \u043F\u0430\u0434\u0430\u0435\u0442 \u043D\u0430 \u043F\u043E\u0432\u0435\u0440\u0445\u043D\u043E\u0441\u0442\u044C, \u0442\u0435\u043C
|
|
86
|
+
* \u0442\u043E\u043B\u0449\u0435 \u0435\u0451 \u0442\u0435\u043A\u0441\u0435\u043B\u044C \u0432 \u0433\u043B\u0443\u0431\u0438\u043D\u0443 \u0438 \u0442\u0435\u043C \u0431\u043E\u043B\u044C\u0448\u0435 \u043D\u0443\u0436\u0435\u043D \u0437\u0430\u043F\u0430\u0441 \u043F\u0440\u043E\u0442\u0438\u0432 \u0441\u0430\u043C\u043E\u0437\u0430\u0442\u0435\u043D\u0435\u043D\u0438\u044F.
|
|
87
|
+
* \u0424\u043E\u0440\u043C\u0443\u043B\u0430 \u0441\u043E \u0441\u0440\u0435\u0437\u043A\u043E\u0439 (tan \u043E\u0442 \u0443\u0433\u043B\u0430, \u043E\u0433\u0440\u0430\u043D\u0438\u0447\u0435\u043D\u043D\u044B\u0439 \u0441\u0432\u0435\u0440\u0445\u0443) \u2014 \u0441\u0442\u0430\u043D\u0434\u0430\u0440\u0442\u043D\u0430\u044F; \u0431\u0435\u0437
|
|
88
|
+
* \u0441\u0440\u0435\u0437\u043A\u0438 \u043D\u0430 \u0433\u0440\u0430\u043D\u044F\u0445, \u0441\u0442\u043E\u044F\u0449\u0438\u0445 \u0440\u0435\u0431\u0440\u043E\u043C \u043A \u0441\u043E\u043B\u043D\u0446\u0443, \u0441\u043C\u0435\u0449\u0435\u043D\u0438\u0435 \u0443\u0445\u043E\u0434\u0438\u0442 \u0432 \u0431\u0435\u0441\u043A\u043E\u043D\u0435\u0447\u043D\u043E\u0441\u0442\u044C
|
|
89
|
+
* \u0438 \u0442\u0435\u043D\u044C \u043E\u0442\u0440\u044B\u0432\u0430\u0435\u0442\u0441\u044F \u043E\u0442 \u043E\u0441\u043D\u043E\u0432\u0430\u043D\u0438\u044F.
|
|
90
|
+
*/
|
|
91
|
+
float shadowOcclusion(float ndotl) {
|
|
92
|
+
if (u_shadow_params.w < 0.5) return 0.0;
|
|
93
|
+
|
|
94
|
+
/*
|
|
95
|
+
* \u041F\u041E\u0412\u0415\u0420\u0425\u041D\u041E\u0421\u0422\u042C, \u041E\u0422\u0412\u0401\u0420\u041D\u0423\u0422\u0410\u042F \u041E\u0422 \u0421\u0412\u0415\u0422\u0410, \u041D\u0415 \u0417\u0410\u0422\u0415\u041D\u042F\u0415\u0422\u0421\u042F.
|
|
96
|
+
*
|
|
97
|
+
* \u041A\u0430\u0440\u0442\u0430 \u0442\u0435\u043D\u0435\u0439 \u043F\u0440\u043E \u0442\u0430\u043A\u0443\u044E \u0441\u0442\u043E\u0440\u043E\u043D\u0443 \u043D\u0438\u0447\u0435\u0433\u043E \u0441\u043A\u0430\u0437\u0430\u0442\u044C \u043D\u0435 \u043C\u043E\u0436\u0435\u0442: \u0441\u0432\u0435\u0442 \u0434\u043E \u043D\u0435\u0451 \u043D\u0435 \u0434\u043E\u0445\u043E\u0434\u0438\u0442 \u043F\u043E \u0441\u0430\u043C\u043E\u0439 \u0435\u0451
|
|
98
|
+
* \u043E\u0440\u0438\u0435\u043D\u0442\u0430\u0446\u0438\u0438, \u0430 \u0441\u0440\u0430\u0432\u043D\u0435\u043D\u0438\u0435 \u0433\u043B\u0443\u0431\u0438\u043D \u0442\u0430\u043C \u0432\u044B\u0440\u043E\u0436\u0434\u0430\u0435\u0442\u0441\u044F. \u041D\u0430\u043A\u043B\u043E\u043D\u043D\u0430\u044F \u0434\u043E\u0431\u0430\u0432\u043A\u0430 \u043D\u0438\u0436\u0435 \u0438 \u0432\u043E\u0432\u0441\u0435 \u0431\u0435\u0440\u0451\u0442 \u0442\u0430\u043D\u0433\u0435\u043D\u0441
|
|
99
|
+
* \u0443\u0433\u043B\u0430 \u0431\u043E\u043B\u044C\u0448\u0435 \u043F\u0440\u044F\u043C\u043E\u0433\u043E \u0438 \u043C\u0435\u043D\u044F\u0435\u0442 \u0437\u043D\u0430\u043A.
|
|
100
|
+
*
|
|
101
|
+
* \u0422\u0430\u043C, \u0433\u0434\u0435 \u0440\u0435\u0437\u0443\u043B\u044C\u0442\u0430\u0442 \u0443\u043C\u043D\u043E\u0436\u0430\u0435\u0442\u0441\u044F \u043D\u0430 max(ndotl, 0), \u044D\u0442\u043E \u0431\u044B\u043B\u043E \u0431\u0435\u0437\u0432\u0440\u0435\u0434\u043D\u043E \u2014 \u043C\u043D\u043E\u0436\u0438\u0442\u0435\u043B\u044C \u0438 \u0442\u0430\u043A \u043D\u043E\u043B\u044C. \u041D\u043E
|
|
102
|
+
* \u043E\u0442\u0440\u0430\u0436\u0435\u043D\u0438\u0435 \u0443 \u043C\u043E\u0434\u0435\u043B\u0435\u0439 \u043D\u0430 \u0437\u0430\u0442\u0435\u043D\u0435\u043D\u0438\u0435 \u0443\u043C\u043D\u043E\u0436\u0430\u0435\u0442\u0441\u044F \u0411\u0415\u0417 \u0442\u0430\u043A\u043E\u0439 \u043F\u0440\u043E\u0432\u0435\u0440\u043A\u0438, \u0438 \u043D\u0430 \u0442\u0451\u043C\u043D\u043E\u0439 \u0441\u0442\u043E\u0440\u043E\u043D\u0435 \u043E\u043D\u043E
|
|
103
|
+
* \u043F\u043E\u043B\u0443\u0447\u0430\u043B\u043E \u043F\u044F\u0442\u043D\u0438\u0441\u0442\u044B\u0439 \u043C\u0443\u0441\u043E\u0440: \u044D\u0442\u043E \u0438 \u0435\u0441\u0442\u044C \u043E\u0441\u0442\u0430\u0442\u043E\u0447\u043D\u0430\u044F \u0440\u044F\u0431\u044C \u043D\u0430 \u0432\u043D\u0443\u0442\u0440\u0435\u043D\u043D\u0435\u043C \u043A\u043E\u043D\u0443\u0441\u0435 \u043A\u043E\u0440\u043E\u043D\u044B.
|
|
104
|
+
*/
|
|
105
|
+
if (ndotl <= 0.0) return 0.0;
|
|
106
|
+
|
|
107
|
+
vec3 c = v_shadow.xyz / v_shadow.w;
|
|
108
|
+
c = c * 0.5 + 0.5;
|
|
109
|
+
|
|
110
|
+
// \u0417\u0430 \u043F\u0440\u0435\u0434\u0435\u043B\u0430\u043C\u0438 \u043E\u0431\u044A\u0451\u043C\u0430 \u0438\u0441\u0442\u043E\u0447\u043D\u0438\u043A\u0430 \u0442\u0435\u043D\u0435\u0439 \u043D\u0435\u0442. \u0411\u0435\u0437 \u044D\u0442\u043E\u0439 \u043F\u0440\u043E\u0432\u0435\u0440\u043A\u0438 \u0432\u0441\u0451, \u0447\u0442\u043E \u0432\u044B\u0448\u043B\u043E
|
|
111
|
+
// \u0437\u0430 \u043A\u0430\u0440\u0442\u0443, \u043E\u043A\u0430\u0437\u0430\u043B\u043E\u0441\u044C \u0431\u044B \u0437\u0430\u0442\u0435\u043D\u0435\u043D\u043E \u043A\u0440\u0430\u0439\u043D\u0438\u043C \u0442\u0435\u043A\u0441\u0435\u043B\u0435\u043C.
|
|
112
|
+
if (c.x < 0.0 || c.x > 1.0 || c.y < 0.0 || c.y > 1.0 || c.z > 1.0) return 0.0;
|
|
113
|
+
|
|
114
|
+
// \u0421\u043C\u0435\u0449\u0435\u043D\u0438\u0435 \u043F\u0440\u0438\u0445\u043E\u0434\u0438\u0442 \u0443\u0436\u0435 \u0432 \u0435\u0434\u0438\u043D\u0438\u0446\u0430\u0445 \u0433\u043B\u0443\u0431\u0438\u043D\u044B (\u043F\u0435\u0440\u0435\u0432\u0435\u0434\u0435\u043D\u043E \u0438\u0437 \u043C\u0435\u0442\u0440\u043E\u0432 \u043D\u0430 CPU).
|
|
115
|
+
// \u041D\u0430\u043A\u043B\u043E\u043D\u043D\u0430\u044F \u0434\u043E\u0431\u0430\u0432\u043A\u0430 \u0440\u0430\u0441\u0442\u0451\u0442 \u0441 \u0443\u0433\u043B\u043E\u043C \u043F\u0430\u0434\u0435\u043D\u0438\u044F, \u043D\u043E \u043E\u0433\u0440\u0430\u043D\u0438\u0447\u0435\u043D\u0430 \u0441\u0432\u0435\u0440\u0445\u0443: \u0431\u0435\u0437 \u0441\u0440\u0435\u0437\u043A\u0438
|
|
116
|
+
// \u043D\u0430 \u0433\u0440\u0430\u043D\u044F\u0445, \u0441\u0442\u043E\u044F\u0449\u0438\u0445 \u0440\u0435\u0431\u0440\u043E\u043C \u043A \u0441\u043E\u043B\u043D\u0446\u0443, \u043E\u043D\u0430 \u0443\u0445\u043E\u0434\u0438\u0442 \u0432 \u0431\u0435\u0441\u043A\u043E\u043D\u0435\u0447\u043D\u043E\u0441\u0442\u044C \u0438 \u0442\u0435\u043D\u044C
|
|
117
|
+
// \u043E\u0442\u0440\u044B\u0432\u0430\u0435\u0442\u0441\u044F \u043E\u0442 \u043E\u0441\u043D\u043E\u0432\u0430\u043D\u0438\u044F.
|
|
118
|
+
float slope = clamp(2.0 * tan(acos(clamp(ndotl, -1.0, 1.0))), 0.0, 4.0);
|
|
119
|
+
c.z -= u_shadow_params.z * (1.0 + slope);
|
|
120
|
+
|
|
121
|
+
// 2\xD72 \u0432\u044B\u0431\u043E\u0440\u043A\u0430 \u043F\u043E\u0432\u0435\u0440\u0445 \u0430\u043F\u043F\u0430\u0440\u0430\u0442\u043D\u043E\u0439 \u0444\u0438\u043B\u044C\u0442\u0440\u0430\u0446\u0438\u0438: \u043A\u0440\u0430\u0439 \u0442\u0435\u043D\u0438 \u043F\u0435\u0440\u0435\u0441\u0442\u0430\u0451\u0442 \u0431\u044B\u0442\u044C
|
|
122
|
+
// \u0441\u0442\u0443\u043F\u0435\u043D\u0447\u0430\u0442\u044B\u043C, \u0430 \u0441\u0442\u043E\u0438\u0442 \u044D\u0442\u043E \u0447\u0435\u0442\u044B\u0440\u0451\u0445 \u0432\u044B\u0431\u043E\u0440\u043E\u043A \u0432\u043C\u0435\u0441\u0442\u043E \u043E\u0434\u043D\u043E\u0439.
|
|
123
|
+
float t = u_shadow_params.y;
|
|
124
|
+
float lit = 0.0;
|
|
125
|
+
lit += textureProj(u_shadow_map, vec4(c.xy + vec2(-t, -t), c.z, 1.0));
|
|
126
|
+
lit += textureProj(u_shadow_map, vec4(c.xy + vec2( t, -t), c.z, 1.0));
|
|
127
|
+
lit += textureProj(u_shadow_map, vec4(c.xy + vec2(-t, t), c.z, 1.0));
|
|
128
|
+
lit += textureProj(u_shadow_map, vec4(c.xy + vec2( t, t), c.z, 1.0));
|
|
129
|
+
|
|
130
|
+
return (1.0 - lit * 0.25) * u_shadow_params.x;
|
|
131
|
+
}
|
|
132
|
+
`,Jr=`
|
|
133
|
+
uniform int u_material; // 0 \u2014 \u043D\u0435\u0442, 1 \u0432\u043E\u0434\u0430, 2 \u0437\u0435\u043B\u0435\u043D\u044C, 3 \u043F\u0435\u0441\u043E\u043A, 4 \u0430\u0441\u0444\u0430\u043B\u044C\u0442
|
|
134
|
+
uniform vec4 u_material_params; // x: \u0441\u0438\u043B\u0430, y: \u043C\u0430\u0441\u0448\u0442\u0430\u0431 (\u043C), z: \u0441\u043A\u043E\u0440\u043E\u0441\u0442\u044C, w: \u0432\u0440\u0435\u043C\u044F (\u0441)
|
|
135
|
+
|
|
136
|
+
float matHash(vec2 p) {
|
|
137
|
+
vec3 p3 = fract(vec3(p.xyx) * 0.1031);
|
|
138
|
+
p3 += dot(p3, p3.yzx + 33.33);
|
|
139
|
+
return fract((p3.x + p3.y) * p3.z);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
float matNoise(vec2 p) {
|
|
143
|
+
vec2 i = floor(p);
|
|
144
|
+
vec2 f = fract(p);
|
|
145
|
+
vec2 u = f * f * (3.0 - 2.0 * f);
|
|
146
|
+
return mix(mix(matHash(i), matHash(i + vec2(1.0, 0.0)), u.x),
|
|
147
|
+
mix(matHash(i + vec2(0.0, 1.0)), matHash(i + vec2(1.0, 1.0)), u.x), u.y);
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* \u041D\u043E\u0440\u043C\u0430\u043B\u044C \u0440\u044F\u0431\u0438. \u0412\u043E\u043B\u043D\u0430 \u2014 \u0441\u0443\u043C\u043C\u0430 \u0442\u0440\u0451\u0445 \u0431\u0435\u0433\u0443\u0449\u0438\u0445 \u0441\u0438\u043D\u0443\u0441\u043E\u0432, \u043F\u043E\u044D\u0442\u043E\u043C\u0443 \u0433\u0440\u0430\u0434\u0438\u0435\u043D\u0442 \u0431\u0435\u0440\u0451\u0442\u0441\u044F
|
|
152
|
+
* \u0410\u041D\u0410\u041B\u0418\u0422\u0418\u0427\u0415\u0421\u041A\u0418 (\u043F\u0440\u043E\u0438\u0437\u0432\u043E\u0434\u043D\u0430\u044F \u0441\u0438\u043D\u0443\u0441\u0430 \u2014 \u043A\u043E\u0441\u0438\u043D\u0443\u0441), \u0431\u0435\u0437 \u0432\u044B\u0431\u043E\u0440\u043E\u043A \u0441\u043E\u0441\u0435\u0434\u043D\u0438\u0445 \u0442\u043E\u0447\u0435\u043A:
|
|
153
|
+
* \u0447\u0438\u0441\u043B\u0435\u043D\u043D\u044B\u0439 \u0433\u0440\u0430\u0434\u0438\u0435\u043D\u0442 \u0441\u0442\u043E\u0438\u043B \u0431\u044B \u0447\u0435\u0442\u044B\u0440\u0451\u0445 \u0432\u044B\u0447\u0438\u0441\u043B\u0435\u043D\u0438\u0439 \u0432\u044B\u0441\u043E\u0442\u044B \u043D\u0430 \u0444\u0440\u0430\u0433\u043C\u0435\u043D\u0442.
|
|
154
|
+
*/
|
|
155
|
+
vec3 waterNormal(vec2 p, float t) {
|
|
156
|
+
// \u0412\u043E\u043B\u043D\u043E\u0432\u044B\u0435 \u0432\u0435\u043A\u0442\u043E\u0440\u044B \u0434\u043B\u0438\u043D\u043E\u0439 2\u03C0 (\u0438 \u0435\u0451 \u0433\u0430\u0440\u043C\u043E\u043D\u0438\u043A\u0438): \u0442\u043E\u0433\u0434\u0430 \u041E\u0414\u041D\u0410 \u0432\u043E\u043B\u043D\u0430 \u0443\u043A\u043B\u0430\u0434\u044B\u0432\u0430\u0435\u0442\u0441\u044F
|
|
157
|
+
// \u0440\u043E\u0432\u043D\u043E \u0432 materialScale \u043C\u0435\u0442\u0440\u043E\u0432, \u0438 \xAB\u043C\u0430\u0441\u0448\u0442\u0430\u0431\xBB \u0432 \u0441\u0442\u0438\u043B\u0435 \u0437\u043D\u0430\u0447\u0438\u0442 \u0434\u043B\u0438\u043D\u0443 \u0432\u043E\u043B\u043D\u044B, \u0430
|
|
158
|
+
// \u043D\u0435 \u0430\u0431\u0441\u0442\u0440\u0430\u043A\u0442\u043D\u044B\u0439 \u043C\u043D\u043E\u0436\u0438\u0442\u0435\u043B\u044C.
|
|
159
|
+
const float TAU = 6.28318;
|
|
160
|
+
vec2 k1 = vec2(0.90, 0.44) * TAU;
|
|
161
|
+
vec2 k2 = vec2(-0.35, 0.94) * TAU * 1.7;
|
|
162
|
+
vec2 k3 = vec2(0.62, -0.79) * TAU * 2.9;
|
|
163
|
+
|
|
164
|
+
// \u0424\u0430\u0437\u0430 \u0441\u0431\u0438\u0432\u0430\u0435\u0442\u0441\u044F \u043C\u0435\u0434\u043B\u0435\u043D\u043D\u044B\u043C \u0448\u0443\u043C\u043E\u043C. \u0411\u0435\u0437 \u044D\u0442\u043E\u0433\u043E \u0442\u0440\u0438 \u0441\u0438\u043D\u0443\u0441\u0430 \u0434\u0430\u044E\u0442 \u0438\u0434\u0435\u0430\u043B\u044C\u043D\u043E \u0440\u043E\u0432\u043D\u044B\u0435
|
|
165
|
+
// \u043F\u0430\u0440\u0430\u043B\u043B\u0435\u043B\u044C\u043D\u044B\u0435 \u0433\u0440\u0435\u0431\u043D\u0438 \u2014 \u0440\u0438\u0441\u0443\u043D\u043E\u043A \u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044F \u0448\u0442\u0440\u0438\u0445\u043E\u0432\u043A\u043E\u0439, \u0430 \u043D\u0435 \u0432\u043E\u0434\u043E\u0439.
|
|
166
|
+
float ph = matNoise(p * 0.3) * 7.0;
|
|
167
|
+
|
|
168
|
+
vec2 grad = k1 * (0.009 * cos(dot(p, k1) + t * 0.9 + ph))
|
|
169
|
+
+ k2 * (0.0045 * cos(dot(p, k2) - t * 1.35 + ph * 1.3))
|
|
170
|
+
+ k3 * (0.0018 * cos(dot(p, k3) + t * 2.0 - ph));
|
|
171
|
+
return normalize(vec3(-grad, 1.0));
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
/** \u041D\u043E\u0440\u043C\u0430\u043B\u044C \u043F\u043E \u0433\u0440\u0430\u0434\u0438\u0435\u043D\u0442\u0443 \u0448\u0443\u043C\u0430 \u2014 \u0434\u043B\u044F \u043A\u0440\u043E\u043D, \u0434\u044E\u043D \u0438 \u0437\u0435\u0440\u043D\u0430 \u0430\u0441\u0444\u0430\u043B\u044C\u0442\u0430. */
|
|
175
|
+
vec3 bumpNormal(vec2 p, float amp, float step_) {
|
|
176
|
+
float gx = matNoise(p + vec2(step_, 0.0)) - matNoise(p - vec2(step_, 0.0));
|
|
177
|
+
float gy = matNoise(p + vec2(0.0, step_)) - matNoise(p - vec2(0.0, step_));
|
|
178
|
+
return normalize(vec3(-gx * amp, -gy * amp, 1.0));
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
/** \u0411\u043B\u0438\u043A: \u043F\u043E\u043B\u0443\u0443\u0433\u043E\u043B \u043C\u0435\u0436\u0434\u0443 \u0441\u043E\u043B\u043D\u0446\u0435\u043C \u0438 \u0432\u0437\u0433\u043B\u044F\u0434\u043E\u043C \u0441\u0432\u0435\u0440\u0445\u0443 \u2014 \u0434\u0451\u0448\u0435\u0432\u043E \u0438 \u0441\u0442\u0430\u0431\u0438\u043B\u044C\u043D\u043E. */
|
|
182
|
+
float matSpecular(vec3 n, float power) {
|
|
183
|
+
vec3 h = normalize(-u_key_dir + vec3(0.0, 0.0, 1.0));
|
|
184
|
+
return pow(max(dot(n, h), 0.0), power);
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
vec3 applyMaterial(vec3 color, vec2 world) {
|
|
188
|
+
if (u_material == 0) return color;
|
|
189
|
+
|
|
190
|
+
// \u041C\u0435\u0442\u0440\u043E\u0432 \u043D\u0430 \u043F\u0438\u043A\u0441\u0435\u043B\u044C: \u043C\u0435\u0440\u0430 \u0442\u043E\u0433\u043E, \u0441\u043A\u043E\u043B\u044C\u043A\u043E \u0434\u0435\u0442\u0430\u043B\u0435\u0439 \u0432\u043E\u043E\u0431\u0449\u0435 \u0438\u043C\u0435\u0435\u0442 \u0441\u043C\u044B\u0441\u043B \u0440\u0438\u0441\u043E\u0432\u0430\u0442\u044C.
|
|
191
|
+
// \u041F\u043E\u0440\u043E\u0433 \u0441\u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044F \u041E\u0422 \u0420\u0410\u0417\u041C\u0415\u0420\u0410 \u0420\u0418\u0421\u0423\u041D\u041A\u0410, \u0430 \u043D\u0435 \u0444\u0438\u043A\u0441\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u043C \u0447\u0438\u0441\u043B\u043E\u043C: \u0440\u044F\u0431\u044C \u0434\u043B\u0438\u043D\u043E\u0439
|
|
192
|
+
// 9 \u043C \u0438 \u0434\u044E\u043D\u044B \u0432 26 \u043C \u0438\u0441\u0447\u0435\u0437\u0430\u044E\u0442 \u0438\u0437 \u0432\u0438\u0434\u0443 \u043D\u0430 \u0441\u043E\u0432\u0435\u0440\u0448\u0435\u043D\u043D\u043E \u0440\u0430\u0437\u043D\u044B\u0445 \u0437\u0443\u043C\u0430\u0445, \u0438 \u043E\u0431\u0449\u0438\u0439
|
|
193
|
+
// \u043F\u043E\u0440\u043E\u0433 \u043B\u0438\u0431\u043E \u0433\u0430\u0441\u0438\u043B \u0431\u044B \u0434\u044E\u043D\u044B \u0440\u0430\u043D\u044C\u0448\u0435 \u0432\u0440\u0435\u043C\u0435\u043D\u0438, \u043B\u0438\u0431\u043E \u043E\u0441\u0442\u0430\u0432\u043B\u044F\u043B \u0431\u044B \u0432\u043E\u0434\u0443 \u0440\u044F\u0431\u0438\u0442\u044C
|
|
194
|
+
// \u043F\u0438\u043A\u0441\u0435\u043B\u044F\u043C\u0438.
|
|
195
|
+
float scale = max(u_material_params.y, 0.05);
|
|
196
|
+
float aa = max(fwidth(world.x), fwidth(world.y)) + 1e-5;
|
|
197
|
+
float strength = u_material_params.x * (1.0 - smoothstep(scale * 0.12, scale * 0.45, aa));
|
|
198
|
+
if (strength <= 0.004) return color;
|
|
199
|
+
|
|
200
|
+
vec2 p = world / scale;
|
|
201
|
+
float t = u_material_params.w * u_material_params.z;
|
|
202
|
+
vec3 shaded = color;
|
|
203
|
+
|
|
204
|
+
if (u_material == 1) {
|
|
205
|
+
vec3 n = waterNormal(p, t);
|
|
206
|
+
// \u041D\u0430\u0441\u0442\u043E\u044F\u0449\u0430\u044F \u0440\u044F\u0431\u044C \u043D\u0430\u043A\u043B\u043E\u043D\u0435\u043D\u0430 \u043D\u0430 \u0435\u0434\u0438\u043D\u0438\u0446\u044B \u0433\u0440\u0430\u0434\u0443\u0441\u043E\u0432, \u0438 \u041B\u042E\u0411\u0410\u042F \u0444\u043E\u0440\u043C\u0443\u043B\u0430 \u0431\u043B\u0438\u043A\u0430 \u043D\u0430
|
|
207
|
+
// \u0442\u0430\u043A\u043E\u0439 \u043D\u043E\u0440\u043C\u0430\u043B\u0438 \u0434\u0430\u0451\u0442 \u043D\u043E\u043B\u044C: \u0432\u043E\u0434\u0430 \u043E\u0441\u0442\u0430\u0451\u0442\u0441\u044F \u0431\u0443\u043C\u0430\u0433\u043E\u0439. \u041F\u043E\u044D\u0442\u043E\u043C\u0443 \u0434\u043B\u044F \u0431\u043B\u0438\u043A\u0430 \u043D\u043E\u0440\u043C\u0430\u043B\u044C
|
|
208
|
+
// \u043D\u0430\u043C\u0435\u0440\u0435\u043D\u043D\u043E \xAB\u043A\u0440\u0443\u0442\u0438\u043C\xBB \u2014 \u0440\u0435\u043B\u044C\u0435\u0444 \u0442\u043E\u0442 \u0436\u0435, \u043F\u0440\u043E\u0441\u0442\u043E \u043A\u0440\u0443\u0447\u0435; \u0434\u043B\u044F \u0440\u0430\u0441\u0441\u0435\u044F\u043D\u043D\u043E\u0433\u043E \u0441\u0432\u0435\u0442\u0430
|
|
209
|
+
// \u0431\u0435\u0440\u0451\u0442\u0441\u044F \u0447\u0435\u0441\u0442\u043D\u0430\u044F.
|
|
210
|
+
vec3 steep = normalize(vec3(n.xy * 9.0, 1.0));
|
|
211
|
+
float sun = max(dot(steep, -u_key_dir), 0.0);
|
|
212
|
+
float glint = pow(sun, 26.0);
|
|
213
|
+
// \u041A\u0440\u0443\u043F\u043D\u044B\u0435 \u043F\u044F\u0442\u043D\u0430 \u2014 \u0440\u0430\u0437\u043D\u0430\u044F \u0433\u043B\u0443\u0431\u0438\u043D\u0430: \u0440\u043E\u0432\u043D\u0430\u044F \u0437\u0430\u043B\u0438\u0432\u043A\u0430 \u0432\u044B\u0434\u0430\u0451\u0442 \xAB\u0431\u0443\u043C\u0430\u0433\u0443\xBB \u0434\u0430\u0436\u0435 \u0441 \u0431\u043B\u0438\u043A\u043E\u043C.
|
|
214
|
+
float deep = matNoise(p * 0.09);
|
|
215
|
+
shaded = color * mix(0.93, 1.07, deep) * (0.93 + 0.14 * sun);
|
|
216
|
+
shaded += u_key_color * (u_key_intensity * glint * 0.32);
|
|
217
|
+
} else if (u_material == 2) {
|
|
218
|
+
// \u041A\u0440\u043E\u043D\u044B: \u0434\u0432\u0430 \u043C\u0430\u0441\u0448\u0442\u0430\u0431\u0430 \u043F\u044F\u0442\u0435\u043D \u043F\u043B\u044E\u0441 \u043C\u0438\u043A\u0440\u043E\u0440\u0435\u043B\u044C\u0435\u0444 \u043F\u043E\u0434 \u0441\u0432\u0435\u0442.
|
|
219
|
+
float clump = matNoise(p * 0.85) * 0.65 + matNoise(p * 2.2) * 0.35;
|
|
220
|
+
vec3 n = bumpNormal(p * 0.85, 2.6, 0.35);
|
|
221
|
+
float ndotl = max(dot(n, -u_key_dir), 0.0);
|
|
222
|
+
shaded = color * (0.84 + 0.30 * clump) * (0.90 + 0.20 * ndotl);
|
|
223
|
+
} else if (u_material == 3) {
|
|
224
|
+
// \u041F\u0435\u0441\u043E\u043A: \u043F\u043E\u043B\u043E\u0433\u0438\u0435 \u0434\u044E\u043D\u044B + \u0437\u0435\u0440\u043D\u043E, \u0431\u043B\u0438\u043A \u0448\u0438\u0440\u043E\u043A\u0438\u0439 \u0438 \u0441\u043B\u0430\u0431\u044B\u0439.
|
|
225
|
+
float dune = matNoise(p * 0.28);
|
|
226
|
+
vec3 n = bumpNormal(p * 0.28, 1.4, 0.4);
|
|
227
|
+
float ndotl = max(dot(n, -u_key_dir), 0.0);
|
|
228
|
+
shaded = color * (0.94 + 0.10 * dune) * (0.95 + 0.10 * ndotl)
|
|
229
|
+
+ u_key_color * (u_key_intensity * matSpecular(n, 8.0) * 0.06);
|
|
230
|
+
} else {
|
|
231
|
+
// \u0410\u0441\u0444\u0430\u043B\u044C\u0442: \u043C\u0435\u043B\u043A\u043E\u0435 \u0437\u0435\u0440\u043D\u043E \u0438 \u043A\u0440\u0443\u043F\u043D\u044B\u0435 \u0437\u0430\u043F\u043B\u0430\u0442\u044B \u2014 \u043F\u043E\u043B\u043E\u0442\u043D\u043E \u043F\u0435\u0440\u0435\u0441\u0442\u0430\u0451\u0442 \u0431\u044B\u0442\u044C \u043F\u043B\u0430\u0448\u043A\u043E\u0439.
|
|
232
|
+
float grain = matNoise(p * 6.0);
|
|
233
|
+
// patch \u2014 \u0437\u0430\u0440\u0435\u0437\u0435\u0440\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u043E\u0435 \u0441\u043B\u043E\u0432\u043E GLSL ES 3.00 (\u043E\u0431\u0440\u0430\u0442\u043D\u044B\u0435 \u043A\u0430\u0432\u044B\u0447\u043A\u0438 \u0442\u0443\u0442 \u0442\u043E\u0436\u0435
|
|
234
|
+
// \u043D\u0435\u043B\u044C\u0437\u044F: \u0431\u043B\u043E\u043A \u0448\u0435\u0439\u0434\u0435\u0440\u0430 \u0441\u0430\u043C \u043B\u0435\u0436\u0438\u0442 \u0432 \u0448\u0430\u0431\u043B\u043E\u043D\u043D\u043E\u0439 \u0441\u0442\u0440\u043E\u043A\u0435), \u043E\u0442\u0441\u044E\u0434\u0430 \u0438\u043C\u044F \u043F\u043E\u0434\u043B\u0438\u043D\u043D\u0435\u0435.
|
|
235
|
+
float patches = matNoise(p * 0.5);
|
|
236
|
+
shaded = color * (0.95 + 0.07 * grain) * (0.97 + 0.06 * patches);
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
return mix(color, shaded, strength);
|
|
240
|
+
}
|
|
241
|
+
`,Ba=`
|
|
242
|
+
uniform vec4 u_globe; // x: \u0432\u043A\u043B, y: \u0434\u043E\u043B\u044F \u043F\u043B\u043E\u0441\u043A\u043E\u0439 \u043A\u0430\u0440\u0442\u044B, z: \u0440\u0430\u0434\u0438\u0443\u0441, w: worldSize
|
|
243
|
+
uniform vec2 u_globe_center; // \u0446\u0435\u043D\u0442\u0440 \u043A\u0430\u0440\u0442\u044B \u0432 \u043D\u043E\u0440\u043C\u0430\u043B\u0438\u0437\u043E\u0432\u0430\u043D\u043D\u043E\u043C \u043C\u0435\u0440\u043A\u0430\u0442\u043E\u0440\u0435
|
|
244
|
+
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
|
|
245
|
+
uniform mat3 u_globe_basis; // \u0432\u043E\u0441\u0442\u043E\u043A, \u044E\u0433, \u0432\u0432\u0435\u0440\u0445 \u2014 \u043A\u043E\u043B\u043E\u043D\u043A\u0438
|
|
246
|
+
uniform vec3 u_tile_merc; // \u043D\u0430\u0447\u0430\u043B\u043E \u0442\u0430\u0439\u043B\u0430 (\u043D\u043E\u0440\u043C\u0430\u043B\u0438\u0437\u043E\u0432\u0430\u043D\u043D\u044B\u0439 \u043C\u0435\u0440\u043A\u0430\u0442\u043E\u0440) \u0438 \u0448\u0430\u0433 \u043D\u0430 \u0435\u0434\u0438\u043D\u0438\u0446\u0443
|
|
247
|
+
|
|
248
|
+
const float GLOBE_PI = 3.1415926535897932;
|
|
249
|
+
|
|
250
|
+
vec3 globeLocal(vec2 tilePos) {
|
|
251
|
+
vec2 merc = u_tile_merc.xy + tilePos * u_tile_merc.z;
|
|
252
|
+
|
|
253
|
+
// \u041C\u0435\u0440\u043A\u0430\u0442\u043E\u0440 \u2192 \u0448\u0438\u0440\u043E\u0442\u0430/\u0434\u043E\u043B\u0433\u043E\u0442\u0430 \u2192 \u0442\u043E\u0447\u043A\u0430 \u043D\u0430 \u0441\u0444\u0435\u0440\u0435. Y \u0440\u0430\u0441\u0442\u0451\u0442 \u043D\u0430 \u042E\u0413, \u043A\u0430\u043A \u0438 \u0432 \u043D\u0430\u0448\u0438\u0445
|
|
254
|
+
// \u043C\u0438\u0440\u043E\u0432\u044B\u0445 \u043F\u0438\u043A\u0441\u0435\u043B\u044F\u0445, \u0438\u043D\u0430\u0447\u0435 \u043D\u0430 \u043F\u0435\u0440\u0435\u0445\u043E\u0434\u0435 \u043A\u0430\u0440\u0442\u0430 \u043F\u0435\u0440\u0435\u0432\u0435\u0440\u043D\u0443\u043B\u0430\u0441\u044C \u0431\u044B.
|
|
255
|
+
float lng = (merc.x * 2.0 - 1.0) * GLOBE_PI;
|
|
256
|
+
float lat = 2.0 * atan(exp((1.0 - merc.y * 2.0) * GLOBE_PI)) - GLOBE_PI * 0.5;
|
|
257
|
+
|
|
258
|
+
float cosLat = cos(lat);
|
|
259
|
+
vec3 unit = vec3(cosLat * sin(lng), -sin(lat), cosLat * cos(lng));
|
|
260
|
+
vec3 nl = u_globe_basis * unit;
|
|
261
|
+
|
|
262
|
+
// \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.
|
|
263
|
+
//
|
|
264
|
+
// \u0422\u0430\u0439\u043B \u043D\u0430 \u043A\u0440\u0430\u044E \u0434\u0438\u0441\u043A\u0430 \u043B\u0435\u0436\u0438\u0442 \u043D\u0430\u043F\u043E\u043B\u043E\u0432\u0438\u043D\u0443 \u043D\u0430 \u0438\u0437\u043D\u0430\u043D\u043A\u0435, \u0438 \u0435\u0433\u043E \u0442\u0440\u0435\u0443\u0433\u043E\u043B\u044C\u043D\u0438\u043A\u0438 \u0442\u044F\u043D\u0443\u0442\u0441\u044F
|
|
265
|
+
// \u0447\u0435\u0440\u0435\u0437 \u0448\u0430\u0440 \u043D\u0430\u0441\u043A\u0432\u043E\u0437\u044C. \u041E\u0442\u0431\u0440\u043E\u0441\u0438\u0442\u044C \u0442\u0430\u043A\u0443\u044E \u0432\u0435\u0440\u0448\u0438\u043D\u0443 \u043D\u0435\u043B\u044C\u0437\u044F \u2014 \u0440\u0430\u0437\u0432\u0430\u043B\u0438\u0442\u0441\u044F \u0432\u0435\u0441\u044C
|
|
266
|
+
// \u0442\u0440\u0435\u0443\u0433\u043E\u043B\u044C\u043D\u0438\u043A, \u0438 \u0432 \u043E\u043A\u0435\u0430\u043D\u0435 \u043F\u043E\u044F\u0432\u0438\u0442\u0441\u044F \u043A\u043B\u0438\u043D \u0441 \u043F\u0440\u044F\u043C\u044B\u043C\u0438 \u043A\u0440\u0430\u044F\u043C\u0438. \u041F\u0440\u0438\u0436\u0430\u0442\u0438\u0435 \u0436\u0435
|
|
267
|
+
// \u0437\u0430\u043A\u0430\u043D\u0447\u0438\u0432\u0430\u0435\u0442 \u0437\u0430\u043B\u0438\u0432\u043A\u0443 \u0440\u043E\u0432\u043D\u043E \u043D\u0430 \u043A\u0440\u0430\u044E \u0434\u0438\u0441\u043A\u0430: \u0433\u0435\u043E\u043C\u0435\u0442\u0440\u0438\u044F \u0437\u0430 \u0433\u043E\u0440\u0438\u0437\u043E\u043D\u0442\u043E\u043C \u0432\u0441\u0451 \u0440\u0430\u0432\u043D\u043E
|
|
268
|
+
// \u043D\u0435\u0432\u0438\u0434\u0438\u043C\u0430, \u0430 \u0435\u0451 \u043F\u0440\u043E\u0435\u043A\u0446\u0438\u044F \u043D\u0430 \u0433\u043E\u0440\u0438\u0437\u043E\u043D\u0442 \u2014 \u044D\u0442\u043E \u0438 \u0435\u0441\u0442\u044C \u0441\u0438\u043B\u0443\u044D\u0442.
|
|
269
|
+
//
|
|
270
|
+
// \u041C\u0435\u0440\u0438\u0442\u044C \u043D\u0430\u0434\u043E \u043E\u0442 \u043D\u0430\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u044F \u041D\u0410 \u041A\u0410\u041C\u0415\u0420\u0423, \u0430 \u043D\u0435 \u043E\u0442 \u0432\u0435\u0440\u0442\u0438\u043A\u0430\u043B\u0438 \u0432 \u0446\u0435\u043D\u0442\u0440\u0435 \u043A\u0430\u0440\u0442\u044B. \u041F\u0440\u0438
|
|
271
|
+
// \u043D\u0430\u043A\u043B\u043E\u043D\u0435 \u044D\u0442\u043E \u0440\u0430\u0437\u043D\u044B\u0435 \u043E\u0441\u0438, \u0438 \u043F\u043B\u043E\u0441\u043A\u043E\u0441\u0442\u044C, \u043F\u0435\u0440\u043F\u0435\u043D\u0434\u0438\u043A\u0443\u043B\u044F\u0440\u043D\u0430\u044F \u0432\u0435\u0440\u0442\u0438\u043A\u0430\u043B\u0438, \u0441\u0440\u0435\u0437\u0430\u0435\u0442 \u0448\u0430\u0440
|
|
272
|
+
// \u043F\u043E \u043F\u0440\u044F\u043C\u043E\u0439 \u2014 \xAB\u0447\u0430\u0441\u0442\u044C \u0433\u043B\u043E\u0431\u0443\u0441\u0430 \u0441\u043A\u0440\u044B\u0432\u0430\u0435\u0442\u0441\u044F\xBB.
|
|
273
|
+
float toCam = dot(nl, u_globe_cam.xyz);
|
|
274
|
+
if (toCam < u_globe_cam.w) {
|
|
275
|
+
vec3 side = nl - u_globe_cam.xyz * toCam;
|
|
276
|
+
float len = length(side);
|
|
277
|
+
side = len > 1e-6 ? side / len : vec3(1.0, 0.0, 0.0);
|
|
278
|
+
nl = u_globe_cam.xyz * u_globe_cam.w + side * sqrt(max(1.0 - u_globe_cam.w * u_globe_cam.w, 0.0));
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
vec3 sphere = nl * u_globe.z;
|
|
282
|
+
sphere.z -= u_globe.z;
|
|
283
|
+
|
|
284
|
+
if (u_globe.y <= 0.0) return sphere;
|
|
285
|
+
|
|
286
|
+
// \u041F\u043B\u043E\u0441\u043A\u0430\u044F \u043A\u0430\u0440\u0442\u0430 \u0432 \u0442\u0435\u0445 \u0436\u0435 \u043A\u043E\u043E\u0440\u0434\u0438\u043D\u0430\u0442\u0430\u0445. \u041A\u043E\u043F\u0438\u044E \u043C\u0438\u0440\u0430 \u0431\u0435\u0440\u0451\u043C \u0431\u043B\u0438\u0436\u0430\u0439\u0448\u0443\u044E, \u0438\u043D\u0430\u0447\u0435 \u0442\u043E\u0447\u043A\u0430
|
|
287
|
+
// \u0443 \u0430\u043D\u0442\u0438\u043C\u0435\u0440\u0438\u0434\u0438\u0430\u043D\u0430 \u0443\u0435\u0434\u0435\u0442 \u043D\u0430 \u0448\u0438\u0440\u0438\u043D\u0443 \u043C\u0438\u0440\u0430 \u0438 \u043F\u0435\u0440\u0435\u0445\u043E\u0434 \u0434\u0451\u0440\u043D\u0435\u0442\u0441\u044F.
|
|
288
|
+
vec2 d = merc - u_globe_center;
|
|
289
|
+
d.x -= floor(d.x + 0.5);
|
|
290
|
+
vec3 flat_pos = vec3(d * u_globe.w, 0.0);
|
|
291
|
+
|
|
292
|
+
return mix(sphere, flat_pos, u_globe.y);
|
|
293
|
+
}
|
|
294
|
+
`,Ca=`#version 300 es
|
|
295
|
+
precision highp float;
|
|
296
|
+
|
|
297
|
+
in vec2 a_lnglat; // \u0440\u0430\u0434\u0438\u0430\u043D\u044B: \u0434\u043E\u043B\u0433\u043E\u0442\u0430, \u0448\u0438\u0440\u043E\u0442\u0430
|
|
298
|
+
|
|
299
|
+
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
|
|
300
|
+
uniform mat3 u_globe_basis;
|
|
301
|
+
uniform vec4 u_globe; // z: \u0440\u0430\u0434\u0438\u0443\u0441
|
|
302
|
+
|
|
303
|
+
out float v_rim;
|
|
304
|
+
|
|
305
|
+
void main() {
|
|
306
|
+
float cosLat = cos(a_lnglat.y);
|
|
307
|
+
vec3 unit = vec3(cosLat * sin(a_lnglat.x), -sin(a_lnglat.y), cosLat * cos(a_lnglat.x));
|
|
308
|
+
vec3 local = u_globe_basis * (unit * u_globe.z);
|
|
309
|
+
local.z -= u_globe.z;
|
|
310
|
+
|
|
311
|
+
gl_Position = u_matrix * vec4(local, 1.0);
|
|
312
|
+
|
|
313
|
+
// \u041D\u043E\u0440\u043C\u0430\u043B\u044C \u0432 \u043B\u043E\u043A\u0430\u043B\u044C\u043D\u044B\u0445 \u043A\u043E\u043E\u0440\u0434\u0438\u043D\u0430\u0442\u0430\u0445 \u2014 \u044D\u0442\u043E \u0442\u043E\u0442 \u0436\u0435 \u0432\u0435\u043A\u0442\u043E\u0440, \u0442\u043E\u043B\u044C\u043A\u043E \u0431\u0435\u0437 \u043C\u0430\u0441\u0448\u0442\u0430\u0431\u0430;
|
|
314
|
+
// \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.
|
|
315
|
+
vec3 n = u_globe_basis * unit;
|
|
316
|
+
v_rim = 1.0 - clamp(n.z, 0.0, 1.0);
|
|
317
|
+
}
|
|
318
|
+
`,va=`#version 300 es
|
|
319
|
+
precision highp float;
|
|
320
|
+
|
|
321
|
+
in float v_rim;
|
|
322
|
+
uniform vec3 u_body_color;
|
|
323
|
+
uniform vec3 u_atmo_color;
|
|
324
|
+
uniform float u_atmo_strength;
|
|
325
|
+
|
|
326
|
+
out vec4 fragColor;
|
|
327
|
+
|
|
328
|
+
void main() {
|
|
329
|
+
// \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
|
|
330
|
+
// \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.
|
|
331
|
+
float rim = pow(v_rim, 6.0) * u_atmo_strength;
|
|
332
|
+
fragColor = vec4(mix(u_body_color, u_atmo_color, clamp(rim, 0.0, 1.0)), 1.0);
|
|
333
|
+
}
|
|
334
|
+
`,wa=`#version 300 es
|
|
335
|
+
precision highp float;
|
|
336
|
+
in vec2 a_pos; // 0..1, \u043E\u0431\u0449\u0438\u0439 \u043A\u0432\u0430\u0434\u0440\u0430\u0442
|
|
337
|
+
uniform float u_center_depth; // NDC-\u0433\u043B\u0443\u0431\u0438\u043D\u0430 \u0446\u0435\u043D\u0442\u0440\u0430 \u0448\u0430\u0440\u0430
|
|
338
|
+
void main() {
|
|
339
|
+
gl_Position = vec4(a_pos * 2.0 - 1.0, u_center_depth, 1.0);
|
|
340
|
+
}
|
|
341
|
+
`,xa=`#version 300 es
|
|
342
|
+
precision highp float;
|
|
343
|
+
void main() {}
|
|
344
|
+
`,_a=`#version 300 es
|
|
345
|
+
precision highp float;
|
|
346
|
+
in vec2 a_pos;
|
|
347
|
+
in float a_height; // \u043C\u0435\u0442\u0440\u044B \xD7 4, \u043A\u0430\u043A \u0443 \u0437\u0434\u0430\u043D\u0438\u0439
|
|
348
|
+
uniform mat4 u_matrix;
|
|
349
|
+
uniform float u_height_scale;
|
|
350
|
+
void main() {
|
|
351
|
+
gl_Position = u_matrix * vec4(a_pos, (a_height / 4.0) * u_height_scale, 1.0);
|
|
352
|
+
}
|
|
353
|
+
`,Xr=`#version 300 es
|
|
354
|
+
precision highp float;
|
|
355
|
+
void main() {}
|
|
356
|
+
`,Xe=`
|
|
357
|
+
uniform vec3 u_fog_color;
|
|
358
|
+
uniform vec3 u_fog_range; // x: \u043D\u0430\u0447\u0430\u043B\u043E, y: \u043A\u043E\u043D\u0435\u0446 (\u043C\u0438\u0440\u043E\u0432\u044B\u0435 \u043F\u0438\u043A\u0441\u0435\u043B\u0438), z: \u043F\u0440\u0435\u0434\u0435\u043B \u0441\u0438\u043B\u044B
|
|
359
|
+
|
|
360
|
+
float fogAmount() {
|
|
361
|
+
if (u_fog_range.z <= 0.001) return 0.0;
|
|
362
|
+
float depth = 1.0 / gl_FragCoord.w;
|
|
363
|
+
float t = (depth - u_fog_range.x) / max(u_fog_range.y - u_fog_range.x, 1.0);
|
|
364
|
+
if (t <= 0.0) return 0.0;
|
|
365
|
+
float falloff = 1.0 - min(1.0, exp(-6.0 * t));
|
|
366
|
+
falloff *= falloff * falloff;
|
|
367
|
+
return min(falloff, 1.0) * u_fog_range.z;
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
/** \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. */
|
|
371
|
+
vec4 applyFogPremultiplied(vec4 color) {
|
|
372
|
+
float f = fogAmount();
|
|
373
|
+
return vec4(mix(color.rgb, u_fog_color * color.a, f), color.a);
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
vec3 applyFog(vec3 color) {
|
|
377
|
+
return mix(color, u_fog_color, fogAmount());
|
|
378
|
+
}
|
|
379
|
+
`,Da=`#version 300 es
|
|
380
|
+
precision highp float;
|
|
381
|
+
|
|
382
|
+
in vec3 a_pos;
|
|
383
|
+
in vec3 a_normal;
|
|
384
|
+
in vec2 a_tex;
|
|
385
|
+
|
|
386
|
+
uniform mat4 u_matrix;
|
|
387
|
+
uniform mat3 u_normal_matrix;
|
|
388
|
+
uniform mat4 u_shadow_matrix;
|
|
389
|
+
/** \u041F\u043E\u0437\u0438\u0446\u0438\u044F \u043A\u0430\u043C\u0435\u0440\u044B \u0432 \u0435\u0434\u0438\u043D\u0438\u0446\u0430\u0445 \u043C\u043E\u0434\u0435\u043B\u0438 \u2014 \u0441\u043C. \u043E\u0434\u043D\u043E\u0438\u043C\u0451\u043D\u043D\u044B\u0439 \u044E\u043D\u0438\u0444\u043E\u0440\u043C \u0438\u043D\u0441\u0442\u0430\u043D\u0441\u043D\u043E\u0433\u043E \u0432\u0430\u0440\u0438\u0430\u043D\u0442\u0430. */
|
|
390
|
+
uniform vec3 u_camera_model;
|
|
391
|
+
|
|
392
|
+
out vec3 v_normal;
|
|
393
|
+
out vec2 v_tex;
|
|
394
|
+
uniform vec3 u_key_dir; // \u043A\u0443\u0434\u0430 \u043B\u0435\u0442\u0438\u0442 \u043A\u043B\u044E\u0447\u0435\u0432\u043E\u0439 \u0441\u0432\u0435\u0442: \u043D\u0443\u0436\u0435\u043D \u043D\u0430\u043A\u043B\u043E\u043D\u043D\u043E\u0439 \u0434\u043E\u0431\u0430\u0432\u043A\u0435 \u043D\u0438\u0436\u0435
|
|
395
|
+
uniform float u_shadow_normal_offset; // \u0441\u0434\u0432\u0438\u0433 \u0432\u044B\u0431\u043E\u0440\u043A\u0438 \u0432\u0434\u043E\u043B\u044C \u043D\u043E\u0440\u043C\u0430\u043B\u0438, \u0432 \u0435\u0434\u0438\u043D\u0438\u0446\u0430\u0445 \u043E\u0442\u0441\u0435\u0447\u0435\u043D\u0438\u044F
|
|
396
|
+
out vec4 v_shadow;
|
|
397
|
+
out vec3 v_pos;
|
|
398
|
+
out vec3 v_nmodel;
|
|
399
|
+
out vec3 v_view;
|
|
400
|
+
|
|
401
|
+
void main() {
|
|
402
|
+
gl_Position = u_matrix * vec4(a_pos, 1.0);
|
|
403
|
+
// \u041D\u043E\u0440\u043C\u0430\u043B\u0438 \u043A\u0440\u0443\u0442\u0438\u043C \u041E\u0422\u0414\u0415\u041B\u042C\u041D\u041E\u0419 \u043C\u0430\u0442\u0440\u0438\u0446\u0435\u0439: \u043E\u0441\u043D\u043E\u0432\u043D\u0430\u044F \u043F\u0435\u0440\u0435\u0432\u043E\u0434\u0438\u0442 \u0433\u043E\u0440\u0438\u0437\u043E\u043D\u0442\u0430\u043B\u044C \u0432
|
|
404
|
+
// \u043C\u0435\u0440\u043A\u0430\u0442\u043E\u0440, \u0430 \u0432\u0435\u0440\u0442\u0438\u043A\u0430\u043B\u044C \u043E\u0441\u0442\u0430\u0432\u043B\u044F\u0435\u0442 \u0432 \u043C\u0435\u0442\u0440\u0430\u0445 \u2014 \u043C\u0430\u0441\u0448\u0442\u0430\u0431 \u043D\u0435\u0440\u0430\u0432\u043D\u043E\u043C\u0435\u0440\u043D\u044B\u0439, \u0438
|
|
405
|
+
// \u043D\u043E\u0440\u043C\u0430\u043B\u0438 \u043E\u0442 \u043D\u0435\u0433\u043E \u043F\u0435\u0440\u0435\u0441\u0442\u0430\u043B\u0438 \u0431\u044B \u0431\u044B\u0442\u044C \u043F\u0435\u0440\u043F\u0435\u043D\u0434\u0438\u043A\u0443\u043B\u044F\u0440\u043D\u044B\u043C\u0438.
|
|
406
|
+
v_normal = u_normal_matrix * a_normal;
|
|
407
|
+
v_tex = a_tex;
|
|
408
|
+
/*
|
|
409
|
+
* \u0421\u0414\u0412\u0418\u0413 \u0422\u041E\u0427\u041A\u0418 \u0412\u042B\u0411\u041E\u0420\u041A\u0418 \u0412\u0414\u041E\u041B\u042C \u041D\u041E\u0420\u041C\u0410\u041B\u0418 \u2014 \u043F\u0440\u043E\u0442\u0438\u0432 \u0441\u0430\u043C\u043E\u0437\u0430\u0442\u0435\u043D\u0435\u043D\u0438\u044F.
|
|
410
|
+
*
|
|
411
|
+
* \u0421\u043C\u0435\u0449\u0435\u043D\u0438\u0435 \u043F\u043E \u0433\u043B\u0443\u0431\u0438\u043D\u0435, \u043A\u043E\u0442\u043E\u0440\u043E\u0435 \u0434\u0435\u043B\u0430\u0435\u0442 shadowOcclusion, \u0434\u0432\u0438\u0433\u0430\u0435\u0442 \u0421\u0420\u0410\u0412\u041D\u0415\u041D\u0418\u0415. \u041D\u0430 \u0438\u0437\u043E\u0433\u043D\u0443\u0442\u043E\u0439 \u0442\u043E\u043D\u043A\u043E\u0439
|
|
412
|
+
* \u0441\u0442\u0435\u043D\u043A\u0435 \u043F\u0440\u0438 \u0441\u043A\u043E\u043B\u044C\u0437\u044F\u0449\u0435\u043C \u0441\u0432\u0435\u0442\u0435 \u044D\u0442\u043E\u0433\u043E \u043C\u0430\u043B\u043E: \u0441\u043E\u0441\u0435\u0434\u043D\u0438\u0435 \u0442\u043E\u0447\u043A\u0438 \u043B\u0435\u0436\u0430\u0442 \u043F\u043E\u0447\u0442\u0438 \u043D\u0430 \u043E\u0434\u043D\u043E\u0439 \u0433\u043B\u0443\u0431\u0438\u043D\u0435, \u0441\u0440\u0430\u0432\u043D\u0435\u043D\u0438\u0435
|
|
413
|
+
* \u0431\u0430\u043B\u0430\u043D\u0441\u0438\u0440\u0443\u0435\u0442 \u043D\u0430 \u0433\u0440\u0430\u043D\u0438 \u0438 \u0440\u0430\u0441\u0441\u044B\u043F\u0430\u0435\u0442\u0441\u044F \u0432 \u0440\u044F\u0431\u044C \u2014 \u043E\u043D\u0430 \u0438 \u0432\u0438\u0434\u043D\u0430 \u043F\u043E\u043B\u043E\u0441\u0430\u043C\u0438 \u043D\u0430 \u0432\u043D\u0443\u0442\u0440\u0435\u043D\u043D\u0435\u043C \u043A\u043E\u043D\u0443\u0441\u0435 \u043A\u043E\u0440\u043E\u043D\u044B.
|
|
414
|
+
* \u0423\u0432\u0435\u043B\u0438\u0447\u0438\u0442\u044C \u0437\u0430\u043F\u0430\u0441 \u043F\u043E \u0433\u043B\u0443\u0431\u0438\u043D\u0435 \u043D\u0435\u043B\u044C\u0437\u044F: \u043E\u043D \u0436\u0435 \u0441\u0442\u0438\u0440\u0430\u0435\u0442 \u043A\u043E\u043D\u0442\u0430\u043A\u0442\u043D\u0443\u044E \u0442\u0435\u043D\u044C \u0443 \u043E\u0441\u043D\u043E\u0432\u0430\u043D\u0438\u044F.
|
|
415
|
+
*
|
|
416
|
+
* \u0414\u0432\u0438\u0433\u0430\u0435\u043C \u0441\u0430\u043C\u0443 \u0422\u041E\u0427\u041A\u0423, \u0438 \u0434\u0435\u043B\u0430\u0435\u043C \u044D\u0442\u043E \u0432 \u043F\u0440\u043E\u0441\u0442\u0440\u0430\u043D\u0441\u0442\u0432\u0435 \u043E\u0442\u0441\u0435\u0447\u0435\u043D\u0438\u044F \u0438\u0441\u0442\u043E\u0447\u043D\u0438\u043A\u0430, \u0430 \u043D\u0435 \u0432 \u043A\u043E\u043E\u0440\u0434\u0438\u043D\u0430\u0442\u0430\u0445 \u043C\u043E\u0434\u0435\u043B\u0438:
|
|
417
|
+
* \u0443 \u043C\u043E\u0434\u0435\u043B\u0435\u0439 \u0441\u0432\u043E\u0438 \u043C\u0430\u0441\u0448\u0442\u0430\u0431\u044B, \u0430 \u0437\u0434\u0435\u0441\u044C \u0442\u0435\u043A\u0441\u0435\u043B\u044C \u043E\u0434\u0438\u043D\u0430\u043A\u043E\u0432 \u043F\u043E \u043E\u043F\u0440\u0435\u0434\u0435\u043B\u0435\u043D\u0438\u044E. \u041D\u0430\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u0435 \u0431\u0435\u0440\u0451\u043C \u043A\u0430\u043A \u043E\u0431\u0440\u0430\u0437
|
|
418
|
+
* \u043D\u043E\u0440\u043C\u0430\u043B\u0438 \u0432 \u0442\u043E\u043C \u0436\u0435 \u043F\u0440\u043E\u0441\u0442\u0440\u0430\u043D\u0441\u0442\u0432\u0435.
|
|
419
|
+
*/
|
|
420
|
+
/*
|
|
421
|
+
* \u0421\u0414\u0412\u0418\u0413 \u0422\u041E\u0427\u041A\u0418 \u0412\u042B\u0411\u041E\u0420\u041A\u0418 \u0412\u0414\u041E\u041B\u042C \u041D\u041E\u0420\u041C\u0410\u041B\u0418 \u2014 \u0412 \u041C\u0418\u0420\u041E\u0412\u042B\u0425 \u0415\u0414\u0418\u041D\u0418\u0426\u0410\u0425, \u0414\u041E \u041C\u0410\u0422\u0420\u0418\u0426\u042B.
|
|
422
|
+
*
|
|
423
|
+
* \u0420\u0430\u043D\u044C\u0448\u0435 \u044F \u0434\u0432\u0438\u0433\u0430\u043B \u0442\u043E\u0447\u043A\u0443 \u0443\u0436\u0435 \u0432 \u043F\u0440\u043E\u0441\u0442\u0440\u0430\u043D\u0441\u0442\u0432\u0435 \u043E\u0442\u0441\u0435\u0447\u0435\u043D\u0438\u044F \u0438\u0441\u0442\u043E\u0447\u043D\u0438\u043A\u0430. \u0414\u043B\u044F \u043D\u0430\u043A\u043B\u043E\u043D\u043D\u043E\u0439 \u0441\u0442\u0435\u043D\u043A\u0438 \u044D\u0442\u043E \u0441\u0445\u043E\u0434\u0438\u043B\u043E
|
|
424
|
+
* \u0441 \u0440\u0443\u043A, \u0430 \u0434\u043B\u044F \u0413\u041E\u0420\u0418\u0417\u041E\u041D\u0422\u0410\u041B\u042C\u041D\u041E\u0419 \u043F\u043B\u043E\u0449\u0430\u0434\u043A\u0438 \u2014 \u043D\u0435\u0442: \u0442\u0430\u043C \u043D\u043E\u0440\u043C\u0430\u043B\u044C \u0432 \u044D\u0442\u043E\u043C \u043F\u0440\u043E\u0441\u0442\u0440\u0430\u043D\u0441\u0442\u0432\u0435 \u0441\u043C\u043E\u0442\u0440\u0438\u0442 \u043F\u043E\u0447\u0442\u0438
|
|
425
|
+
* \u0446\u0435\u043B\u0438\u043A\u043E\u043C \u0432\u0434\u043E\u043B\u044C \u043E\u0441\u0438 \u0433\u043B\u0443\u0431\u0438\u043D\u044B, \u0438 \u0441\u0434\u0432\u0438\u0433 \u0432\u044B\u0440\u043E\u0436\u0434\u0430\u043B\u0441\u044F \u0432 \u043F\u043E\u043F\u0440\u0430\u0432\u043A\u0443 \u043F\u043E \u0433\u043B\u0443\u0431\u0438\u043D\u0435, \u043E\u0442\u043C\u0435\u0440\u0435\u043D\u043D\u0443\u044E \u043B\u0438\u043D\u0435\u0439\u043A\u043E\u0439 \u043E\u0442
|
|
426
|
+
* X/Y. \u041E\u0431\u044A\u0451\u043C \u0438\u0441\u0442\u043E\u0447\u043D\u0438\u043A\u0430 \u043F\u043E \u0433\u043B\u0443\u0431\u0438\u043D\u0435 \u0438 \u043F\u043E \u0448\u0438\u0440\u0438\u043D\u0435 \u0440\u0430\u0437\u043D\u043E\u0433\u043E \u0440\u0430\u0437\u043C\u0435\u0440\u0430, \u043F\u043E\u044D\u0442\u043E\u043C\u0443 \u043F\u043E\u043F\u0440\u0430\u0432\u043A\u0430 \u043F\u043E\u043B\u0443\u0447\u0430\u043B\u0430\u0441\u044C
|
|
427
|
+
* \u043F\u0440\u043E\u0438\u0437\u0432\u043E\u043B\u044C\u043D\u043E\u0433\u043E \u043C\u0430\u0441\u0448\u0442\u0430\u0431\u0430: \u043D\u0430 \u043E\u0434\u043D\u043E\u043C \u0437\u0443\u043C\u0435 \u0435\u0451 \u0445\u0432\u0430\u0442\u0430\u043B\u043E, \u043D\u0430 \u0434\u0440\u0443\u0433\u043E\u043C \u043A\u0440\u0443\u0433 \u043D\u0430\u0447\u0438\u043D\u0430\u043B \u0437\u0430\u0442\u0435\u043D\u044F\u0442\u044C \u0441\u0430\u043C \u0441\u0435\u0431\u044F.
|
|
428
|
+
*
|
|
429
|
+
* \u0414\u0432\u0438\u0433\u0430\u0435\u043C \u0432 \u043C\u0438\u0440\u043E\u0432\u044B\u0445 \u0435\u0434\u0438\u043D\u0438\u0446\u0430\u0445. \u0421\u043A\u043E\u043B\u044C\u043A\u043E \u0438\u0445 \u0432 \u043E\u0434\u043D\u043E\u043C \u0442\u0435\u043A\u0441\u0435\u043B\u0435, \u043C\u0430\u0442\u0440\u0438\u0446\u0430 \u0437\u043D\u0430\u0435\u0442 \u0441\u0430\u043C\u0430: \u0441\u0442\u043E\u043B\u0431\u0435\u0446 \u043F\u0440\u0438 x \u0434\u0430\u0451\u0442
|
|
430
|
+
* \u043F\u0440\u0438\u0440\u0430\u0449\u0435\u043D\u0438\u0435 \u043E\u0442\u0441\u0435\u0447\u0435\u043D\u0438\u044F \u043D\u0430 \u0435\u0434\u0438\u043D\u0438\u0446\u0443 \u043C\u0438\u0440\u0430, \u0430 \u0441\u0434\u0432\u0438\u0433 \u0437\u0430\u0434\u0430\u043D \u0432 \u0442\u0435\u043A\u0441\u0435\u043B\u044F\u0445 \u043E\u0442\u0441\u0435\u0447\u0435\u043D\u0438\u044F \u2014 \u0438\u0445 \u0447\u0430\u0441\u0442\u043D\u043E\u0435 \u0438 \u0435\u0441\u0442\u044C
|
|
431
|
+
* \u0442\u0435\u043A\u0441\u0435\u043B\u044C \u0432 \u043C\u0438\u0440\u0435. \u041D\u0438\u043A\u0430\u043A\u0438\u0445 \u043D\u043E\u0432\u044B\u0445 \u0432\u0435\u043B\u0438\u0447\u0438\u043D \u0441 CPU \u0434\u043B\u044F \u044D\u0442\u043E\u0433\u043E \u043D\u0435 \u043D\u0443\u0436\u043D\u043E.
|
|
432
|
+
*
|
|
433
|
+
* \u041C\u043D\u043E\u0436\u0438\u0442\u0435\u043B\u044C \u043F\u043E \u043D\u0430\u043A\u043B\u043E\u043D\u0443 \u2014 \u043A\u0430\u043A \u0432 render3d: \u0442\u0430\u043D\u0433\u0435\u043D\u0441 \u0443\u0433\u043B\u0430 \u043F\u0430\u0434\u0435\u043D\u0438\u044F \u0441 \u043F\u043E\u0442\u043E\u043B\u043A\u043E\u043C 4. \u041F\u043E\u0442\u043E\u043B\u043E\u043A \u043E\u0431\u044F\u0437\u0430\u0442\u0435\u043B\u0435\u043D,
|
|
434
|
+
* \u0438\u043D\u0430\u0447\u0435 \u0443 \u0441\u0430\u043C\u043E\u0433\u043E \u043A\u0440\u0430\u044F \u0442\u0435\u043D\u044C \u043E\u0442\u043E\u0440\u0432\u0430\u043B\u0430\u0441\u044C \u0431\u044B \u043E\u0442 \u043E\u0441\u043D\u043E\u0432\u0430\u043D\u0438\u044F \u043F\u0440\u0435\u0434\u043C\u0435\u0442\u0430.
|
|
435
|
+
*/
|
|
436
|
+
vec3 nWorld = normalize(u_normal_matrix * a_normal);
|
|
437
|
+
vec3 posShadow = a_pos;
|
|
438
|
+
if (u_shadow_normal_offset > 0.0) {
|
|
439
|
+
float clipPerWorld = length(vec3(u_shadow_matrix[0][0], u_shadow_matrix[1][0], u_shadow_matrix[2][0]));
|
|
440
|
+
float texelWorld = clipPerWorld > 0.0 ? u_shadow_normal_offset / clipPerWorld : 0.0;
|
|
441
|
+
float cosine = clamp(dot(nWorld, -u_key_dir), 0.0, 1.0);
|
|
442
|
+
float slope = min(sqrt(1.0 - cosine * cosine) / max(cosine, 0.1), 4.0);
|
|
443
|
+
posShadow = a_pos + a_normal * texelWorld * (1.0 + slope);
|
|
444
|
+
}
|
|
445
|
+
v_shadow = u_shadow_matrix * vec4(posShadow, 1.0);
|
|
446
|
+
v_pos = a_pos;
|
|
447
|
+
v_nmodel = a_normal;
|
|
448
|
+
// \u041C\u0430\u0442\u0440\u0438\u0446\u0430 \u043D\u043E\u0440\u043C\u0430\u043B\u0435\u0439 \u043F\u0435\u0440\u0435\u0432\u043E\u0434\u0438\u0442 \u043D\u0430\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u044F \u0438\u0437 \u043F\u0440\u043E\u0441\u0442\u0440\u0430\u043D\u0441\u0442\u0432\u0430 \u043C\u043E\u0434\u0435\u043B\u0438 \u0432 \u043C\u0438\u0440\u043E\u0432\u043E\u0435; \u043C\u0430\u0441\u0448\u0442\u0430\u0431 \u0440\u0430\u0432\u043D\u043E\u043C\u0435\u0440\u043D\u044B\u0439,
|
|
449
|
+
// \u043F\u043E\u044D\u0442\u043E\u043C\u0443 \u043E\u043D\u0430 \u0436\u0435 \u0433\u043E\u0434\u0438\u0442\u0441\u044F \u0438 \u0434\u043B\u044F \u0432\u0435\u043A\u0442\u043E\u0440\u0430 \u0432\u0437\u0433\u043B\u044F\u0434\u0430.
|
|
450
|
+
v_view = u_normal_matrix * (u_camera_model - a_pos);
|
|
451
|
+
}
|
|
452
|
+
`,Fa=`#version 300 es
|
|
453
|
+
precision highp float;
|
|
454
|
+
|
|
455
|
+
in vec3 a_pos;
|
|
456
|
+
in vec3 a_normal;
|
|
457
|
+
in vec2 a_tex;
|
|
458
|
+
|
|
459
|
+
in vec4 a_i_m0;
|
|
460
|
+
in vec4 a_i_m1;
|
|
461
|
+
in vec4 a_i_m2;
|
|
462
|
+
in vec4 a_i_m3;
|
|
463
|
+
in vec4 a_i_s0;
|
|
464
|
+
in vec4 a_i_s1;
|
|
465
|
+
in vec4 a_i_s2;
|
|
466
|
+
in vec4 a_i_s3;
|
|
467
|
+
in vec3 a_i_n0;
|
|
468
|
+
in vec3 a_i_n1;
|
|
469
|
+
in vec3 a_i_n2;
|
|
470
|
+
|
|
471
|
+
out vec3 v_normal;
|
|
472
|
+
out vec2 v_tex;
|
|
473
|
+
out vec4 v_shadow;
|
|
474
|
+
/**
|
|
475
|
+
* \u041F\u043E\u0437\u0438\u0446\u0438\u044F \u0432\u0435\u0440\u0448\u0438\u043D\u044B \u0412 \u041F\u0420\u041E\u0421\u0422\u0420\u0410\u041D\u0421\u0422\u0412\u0415 \u041C\u041E\u0414\u0415\u041B\u0418 \u2014 \u0434\u043B\u044F \u0441\u043E\u0431\u0441\u0442\u0432\u0435\u043D\u043D\u043E\u0439 \u043F\u043E\u0434\u0441\u0432\u0435\u0442\u043A\u0438 \u043E\u0431\u044A\u0435\u043A\u0442\u0430.
|
|
476
|
+
*
|
|
477
|
+
* \u0418\u043C\u0435\u043D\u043D\u043E \u0432 \u043D\u0451\u043C, \u0430 \u043D\u0435 \u0432 \u043C\u0438\u0440\u043E\u0432\u043E\u043C: \u0441\u0432\u0435\u0442\u0438\u043B\u044C\u043D\u0438\u043A\u0438 \u043F\u0440\u0438\u0435\u0437\u0436\u0430\u044E\u0442 \u0438\u0437 glTF \u0432 \u043A\u043E\u043E\u0440\u0434\u0438\u043D\u0430\u0442\u0430\u0445 \u043C\u043E\u0434\u0435\u043B\u0438 \u0438 \u043E\u0434\u043D\u0438 \u043D\u0430 \u0432\u0441\u0435
|
|
478
|
+
* \u0435\u0451 \u044D\u043A\u0437\u0435\u043C\u043F\u043B\u044F\u0440\u044B. \u041F\u0435\u0440\u0435\u0432\u043E\u0434\u0438\u0442\u044C \u0438\u0445 \u0432 \u043C\u0438\u0440\u043E\u0432\u044B\u0435 \u043F\u0440\u0438\u0448\u043B\u043E\u0441\u044C \u0431\u044B \u043D\u0430 \u043A\u0430\u0436\u0434\u044B\u0439 \u044D\u043A\u0437\u0435\u043C\u043F\u043B\u044F\u0440 \u043E\u0442\u0434\u0435\u043B\u044C\u043D\u043E, \u0430 \u0442\u0430\u043A \u0448\u0435\u0439\u0434\u0435\u0440
|
|
479
|
+
* \u0441\u0440\u0430\u0432\u043D\u0438\u0432\u0430\u0435\u0442 \u0442\u043E \u0438 \u0434\u0440\u0443\u0433\u043E\u0435 \u043D\u0430\u043F\u0440\u044F\u043C\u0443\u044E.
|
|
480
|
+
*/
|
|
481
|
+
out vec3 v_pos;
|
|
482
|
+
/**
|
|
483
|
+
* \u041D\u043E\u0440\u043C\u0430\u043B\u044C \u0412 \u041F\u0420\u041E\u0421\u0422\u0420\u0410\u041D\u0421\u0422\u0412\u0415 \u041C\u041E\u0414\u0415\u041B\u0418 \u2014 \u0434\u043B\u044F \u0441\u043E\u0431\u0441\u0442\u0432\u0435\u043D\u043D\u044B\u0445 \u0444\u043E\u043D\u0430\u0440\u0435\u0439 \u043E\u0431\u044A\u0435\u043A\u0442\u0430.
|
|
484
|
+
*
|
|
485
|
+
* \u041E\u0442\u0434\u0435\u043B\u044C\u043D\u043E \u043E\u0442 v_normal, \u0438 \u044D\u0442\u043E \u043D\u0435 \u0434\u0443\u0431\u043B\u044C: \u0444\u043E\u043D\u0430\u0440\u0438 \u043F\u0440\u0438\u0435\u0437\u0436\u0430\u044E\u0442 \u0438\u0437 glTF \u0432 \u043A\u043E\u043E\u0440\u0434\u0438\u043D\u0430\u0442\u0430\u0445 \u043C\u043E\u0434\u0435\u043B\u0438, \u0442\u0430\u043C \u0436\u0435
|
|
486
|
+
* \u043B\u0435\u0436\u0438\u0442 v_pos, \u0438 \u0441\u0447\u0438\u0442\u0430\u0442\u044C \u0438\u0445 \u043E\u0441\u0432\u0435\u0449\u0451\u043D\u043D\u043E\u0441\u0442\u044C \u043D\u0443\u0436\u043D\u043E \u0432 \u0442\u043E\u043C \u0436\u0435 \u043F\u0440\u043E\u0441\u0442\u0440\u0430\u043D\u0441\u0442\u0432\u0435. \u041C\u0438\u0440\u043E\u0432\u0430\u044F \u043D\u043E\u0440\u043C\u0430\u043B\u044C \u0434\u043B\u044F \u044D\u0442\u043E\u0433\u043E
|
|
487
|
+
* \u043D\u0435 \u0433\u043E\u0434\u0438\u0442\u0441\u044F \u2014 \u043E\u0441\u0438 \u043C\u043E\u0434\u0435\u043B\u0438 \u0438 \u043A\u0430\u0440\u0442\u044B \u043D\u0435 \u0441\u043E\u0432\u043F\u0430\u0434\u0430\u044E\u0442, \u0438 \u0441\u043A\u0430\u043B\u044F\u0440\u043D\u043E\u0435 \u043F\u0440\u043E\u0438\u0437\u0432\u0435\u0434\u0435\u043D\u0438\u0435 \u0441 \u043D\u0435\u0439 \u0441\u0440\u0435\u0437\u0430\u043B\u043E \u043F\u043E\u043B\u043E\u0432\u0438\u043D\u0443
|
|
488
|
+
* \u0441\u0432\u0435\u0442\u043E\u0432\u043E\u0433\u043E \u043F\u044F\u0442\u043D\u0430.
|
|
489
|
+
*/
|
|
490
|
+
out vec3 v_nmodel;
|
|
491
|
+
/**
|
|
492
|
+
* \u041D\u0430\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u0435 \u043D\u0430 \u043A\u0430\u043C\u0435\u0440\u0443 \u0432 \u041C\u0418\u0420\u041E\u0412\u041E\u041C \u043F\u0440\u043E\u0441\u0442\u0440\u0430\u043D\u0441\u0442\u0432\u0435 \u2014 \u0434\u043B\u044F \u043E\u0442\u0440\u0430\u0436\u0435\u043D\u0438\u0439.
|
|
493
|
+
*
|
|
494
|
+
* \u0421\u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044F \u0437\u0434\u0435\u0441\u044C, \u0430 \u043D\u0435 \u0432\u043E \u0444\u0440\u0430\u0433\u043C\u0435\u043D\u0442\u043D\u043E\u043C, \u0440\u0430\u0434\u0438 \u043E\u0434\u043D\u043E\u0439 \u0432\u0435\u0449\u0438: \u043C\u0430\u0442\u0440\u0438\u0446\u0430 \u043D\u043E\u0440\u043C\u0430\u043B\u0435\u0439 \u043F\u0435\u0440\u0435\u0432\u043E\u0434\u0438\u0442 \u043D\u0430\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u044F \u0438\u0437
|
|
495
|
+
* \u043F\u0440\u043E\u0441\u0442\u0440\u0430\u043D\u0441\u0442\u0432\u0430 \u043C\u043E\u0434\u0435\u043B\u0438 \u0432 \u043C\u0438\u0440\u043E\u0432\u043E\u0435, \u0438 \u043E\u043D\u0430 \u0443\u0436\u0435 \u0435\u0441\u0442\u044C \u0443 \u0432\u0435\u0440\u0448\u0438\u043D\u043D\u043E\u0433\u043E \u0448\u0435\u0439\u0434\u0435\u0440\u0430. \u041C\u0430\u0441\u0448\u0442\u0430\u0431 \u043C\u043E\u0434\u0435\u043B\u0438 \u0440\u0430\u0432\u043D\u043E\u043C\u0435\u0440\u043D\u044B\u0439,
|
|
496
|
+
* \u043F\u043E\u044D\u0442\u043E\u043C\u0443 \u0442\u0430 \u0436\u0435 \u043C\u0430\u0442\u0440\u0438\u0446\u0430 \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, \u0430 \u043D\u0435 \u0442\u043E\u043B\u044C\u043A\u043E \u0434\u043B\u044F \u043D\u043E\u0440\u043C\u0430\u043B\u0435\u0439.
|
|
497
|
+
*/
|
|
498
|
+
out vec3 v_view;
|
|
499
|
+
|
|
500
|
+
/** \u041F\u043E\u0437\u0438\u0446\u0438\u044F \u043A\u0430\u043C\u0435\u0440\u044B \u0432 \u0435\u0434\u0438\u043D\u0438\u0446\u0430\u0445 \u043C\u043E\u0434\u0435\u043B\u0438. \u041E\u0434\u043D\u0430 \u043D\u0430 \u043C\u043E\u0434\u0435\u043B\u044C \u2014 \u0441\u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044F \u043D\u0430 \u043F\u0440\u043E\u0446\u0435\u0441\u0441\u043E\u0440\u0435. */
|
|
501
|
+
uniform vec3 u_camera_model;
|
|
502
|
+
|
|
503
|
+
void main() {
|
|
504
|
+
mat4 m = mat4(a_i_m0, a_i_m1, a_i_m2, a_i_m3);
|
|
505
|
+
mat4 s = mat4(a_i_s0, a_i_s1, a_i_s2, a_i_s3);
|
|
506
|
+
mat3 n = mat3(a_i_n0, a_i_n1, a_i_n2);
|
|
507
|
+
|
|
508
|
+
gl_Position = m * vec4(a_pos, 1.0);
|
|
509
|
+
v_normal = n * a_normal;
|
|
510
|
+
v_tex = a_tex;
|
|
511
|
+
v_shadow = s * vec4(a_pos, 1.0);
|
|
512
|
+
v_pos = a_pos;
|
|
513
|
+
v_nmodel = a_normal;
|
|
514
|
+
v_view = n * (u_camera_model - a_pos);
|
|
515
|
+
}
|
|
516
|
+
`,jr=`#version 300 es
|
|
517
|
+
precision highp float;
|
|
518
|
+
|
|
519
|
+
${Jt}
|
|
520
|
+
${zo}
|
|
521
|
+
${Xe}
|
|
522
|
+
|
|
523
|
+
in vec3 v_normal;
|
|
524
|
+
in vec2 v_tex;
|
|
525
|
+
in vec3 v_pos;
|
|
526
|
+
in vec3 v_nmodel;
|
|
527
|
+
in vec3 v_view;
|
|
528
|
+
|
|
529
|
+
/** \u041F\u043E\u0437\u0438\u0446\u0438\u044F \u043A\u0430\u043C\u0435\u0440\u044B \u0432 \u0435\u0434\u0438\u043D\u0438\u0446\u0430\u0445 \u043C\u043E\u0434\u0435\u043B\u0438 \u2014 \u0442\u043E\u0442 \u0436\u0435 \u044E\u043D\u0438\u0444\u043E\u0440\u043C, \u0447\u0442\u043E \u0443 \u0432\u0435\u0440\u0448\u0438\u043D\u043D\u043E\u0433\u043E: \u043D\u0443\u0436\u0435\u043D \u0434\u043B\u044F \u0432\u0437\u0433\u043B\u044F\u0434\u0430 \u0432 \u0444\u043E\u043D\u0430\u0440\u044F\u0445. */
|
|
530
|
+
uniform vec3 u_camera_model;
|
|
531
|
+
|
|
532
|
+
/** \u041C\u0435\u0442\u0430\u043B\u043B\u0438\u0447\u043D\u043E\u0441\u0442\u044C \u0438 \u0448\u0435\u0440\u043E\u0445\u043E\u0432\u0430\u0442\u043E\u0441\u0442\u044C \u043C\u0430\u0442\u0435\u0440\u0438\u0430\u043B\u0430 (glTF pbrMetallicRoughness). */
|
|
533
|
+
uniform float u_metallic;
|
|
534
|
+
uniform float u_roughness;
|
|
535
|
+
/**
|
|
536
|
+
* \u0421\u0447\u0438\u0442\u0430\u0442\u044C \u043B\u0438 \u043E\u0442\u0440\u0430\u0436\u0435\u043D\u0438\u0435. \u041D\u043E\u043B\u044C \u2014 \u0443 \u0413\u0420\u0423\u041F\u041F\u041E\u0412\u041E\u0419 \u043E\u0442\u0440\u0438\u0441\u043E\u0432\u043A\u0438.
|
|
537
|
+
*
|
|
538
|
+
* \u041F\u0440\u0438\u0447\u0438\u043D\u0430 \u0432 \u0443\u0441\u0442\u0440\u043E\u0439\u0441\u0442\u0432\u0435: \u0437\u0430\u043C\u0435\u043D\u044B \u043F\u043E \u0442\u0438\u043F\u0443 \u0440\u0438\u0441\u0443\u044E\u0442\u0441\u044F \u0441\u043E\u0442\u043D\u044F\u043C\u0438 \u043A\u043E\u043F\u0438\u0439 \u0437\u0430 \u043E\u0434\u0438\u043D \u0432\u044B\u0437\u043E\u0432, \u0430 \u043F\u043E\u0437\u0438\u0446\u0438\u044F \u043A\u0430\u043C\u0435\u0440\u044B \u0432
|
|
539
|
+
* \u043F\u0440\u043E\u0441\u0442\u0440\u0430\u043D\u0441\u0442\u0432\u0435 \u043C\u043E\u0434\u0435\u043B\u0438 \u0443 \u043A\u0430\u0436\u0434\u043E\u0439 \u043A\u043E\u043F\u0438\u0438 \u0441\u0432\u043E\u044F \u0438 \u043F\u0440\u0438\u0445\u043E\u0434\u0438\u0442 \u044E\u043D\u0438\u0444\u043E\u0440\u043C\u043E\u043C \u2014 \u043E\u0434\u043D\u0438\u043C \u043D\u0430 \u0432\u0435\u0441\u044C \u0432\u044B\u0437\u043E\u0432. \u0412\u0435\u0440\u043D\u043E\u0439 \u043E\u043D\u0430
|
|
540
|
+
* \u0431\u044B\u043B\u0430 \u0431\u044B \u0440\u043E\u0432\u043D\u043E \u0434\u043B\u044F \u043E\u0434\u043D\u043E\u0439 \u043A\u043E\u043F\u0438\u0438, \u0434\u043B\u044F \u043E\u0441\u0442\u0430\u043B\u044C\u043D\u044B\u0445 \u0434\u0430\u043B\u0430 \u0431\u044B \u0431\u043B\u0438\u043A \u043D\u0435 \u0441 \u0442\u043E\u0439 \u0441\u0442\u043E\u0440\u043E\u043D\u044B. \u0421\u0432\u043E\u0431\u043E\u0434\u043D\u044B\u0445 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043E\u0432
|
|
541
|
+
* \u043D\u0430 \u044D\u043A\u0437\u0435\u043C\u043F\u043B\u044F\u0440 \u043D\u0435 \u043E\u0441\u0442\u0430\u043B\u043E\u0441\u044C (14 \u0438\u0437 16 \u0433\u0430\u0440\u0430\u043D\u0442\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0445 \u0437\u0430\u043D\u044F\u0442\u044B \u043C\u0430\u0442\u0440\u0438\u0446\u0430\u043C\u0438), \u043F\u043E\u044D\u0442\u043E\u043C\u0443 \u0443 \u0433\u0440\u0443\u043F\u043F\u043E\u0432\u044B\u0445
|
|
542
|
+
* \u043E\u0431\u044A\u0435\u043A\u0442\u043E\u0432 \u043E\u0442\u0440\u0430\u0436\u0435\u043D\u0438\u0435 \u0432\u044B\u043A\u043B\u044E\u0447\u0435\u043D\u043E. \u042D\u0442\u043E \u0434\u0435\u0440\u0435\u0432\u044C\u044F, \u0441\u0432\u0435\u0442\u043E\u0444\u043E\u0440\u044B \u0438 \u0441\u0442\u043E\u043B\u0431\u0438\u043A\u0438 \u2014 \u043C\u0430\u0442\u0435\u0440\u0438\u0430\u043B\u044B \u043C\u0430\u0442\u043E\u0432\u044B\u0435, \u0442\u0435\u0440\u044F\u0435\u0442\u0441\u044F
|
|
543
|
+
* \u043D\u0435\u043C\u043D\u043E\u0433\u043E\u0435; \u043E\u0434\u0438\u043D\u043E\u0447\u043D\u044B\u0435 \u0440\u0430\u0437\u043C\u0435\u0449\u0435\u043D\u0438\u044F, \u0440\u0430\u0434\u0438 \u043A\u043E\u0442\u043E\u0440\u044B\u0445 \u0432\u0441\u0451 \u0438 \u0434\u0435\u043B\u0430\u043B\u043E\u0441\u044C, \u043E\u0442\u0440\u0430\u0436\u0430\u044E\u0442 \u043F\u043E\u043B\u043D\u043E\u0446\u0435\u043D\u043D\u043E.
|
|
544
|
+
*/
|
|
545
|
+
uniform float u_reflect;
|
|
546
|
+
|
|
547
|
+
/*
|
|
548
|
+
* \u0411\u041B\u0418\u041A \u2014 \u041A\u0443\u043A-\u0422\u043E\u0440\u0440\u0435\u043D\u0441 \u043D\u0430 GGX, \u0440\u043E\u0432\u043D\u043E \u043A\u0430\u043A \u0432 three.js (ShaderChunk/bsdfs).
|
|
549
|
+
*
|
|
550
|
+
* \u0412\u0437\u044F\u0442\u043E \u043E\u0442\u0442\u0443\u0434\u0430 \u043D\u0430\u043C\u0435\u0440\u0435\u043D\u043D\u043E, \u0430 \u043D\u0435 \u0432\u044B\u0432\u0435\u0434\u0435\u043D\u043E \u0437\u0430\u043D\u043E\u0432\u043E: \u0442\u0435 \u0436\u0435 \u043C\u043E\u0434\u0435\u043B\u0438 \u043F\u043E\u043A\u0430\u0437\u044B\u0432\u0430\u044E\u0442\u0441\u044F \u0438 \u0447\u0435\u0440\u0435\u0437 web SDK, \u043A\u043E\u0442\u043E\u0440\u044B\u0439
|
|
551
|
+
* \u0440\u0438\u0441\u0443\u0435\u0442 \u0438\u0445 \u043C\u0430\u0442\u0435\u0440\u0438\u0430\u043B\u0430\u043C\u0438 three. \u0421\u0432\u043E\u044F \u0444\u043E\u0440\u043C\u0443\u043B\u0430 \u043E\u0437\u043D\u0430\u0447\u0430\u043B\u0430 \u0431\u044B, \u0447\u0442\u043E \u043E\u0434\u0438\u043D \u0438 \u0442\u043E\u0442 \u0436\u0435 \u0444\u0430\u0439\u043B \u0431\u043B\u0435\u0441\u0442\u0438\u0442 \u0432 \u0434\u0432\u0443\u0445
|
|
552
|
+
* \u0434\u0432\u0438\u0436\u043A\u0430\u0445 \u043F\u043E-\u0440\u0430\u0437\u043D\u043E\u043C\u0443 \u2014 \u0430 \u044D\u0442\u043E \u0440\u043E\u0432\u043D\u043E \u0442\u043E, \u0447\u0435\u0433\u043E \u043C\u044B \u0434\u043E\u0431\u0438\u0432\u0430\u0435\u043C\u0441\u044F \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044C.
|
|
553
|
+
*
|
|
554
|
+
* \u041F\u0440\u0435\u0436\u043D\u0438\u0439 \u0411\u043B\u0438\u043D\u043D \u0434\u0430\u0432\u0430\u043B \u0431\u043B\u0438\u043A \xAB\u0432\u043E\u043E\u0431\u0449\u0435\xBB, \u0431\u0435\u0437 \u0441\u0432\u044F\u0437\u0438 \u0441 \u0448\u0435\u0440\u043E\u0445\u043E\u0432\u0430\u0442\u043E\u0441\u0442\u044C\u044E: \u0443 \u043F\u043E\u043B\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u043E\u0433\u043E \u043C\u0435\u0442\u0430\u043B\u043B\u0430 \u043E\u043D \u0431\u044B\u043B
|
|
555
|
+
* \u0442\u0430\u043A\u043E\u0439 \u0436\u0435 \u0432\u0430\u0442\u043D\u044B\u0439, \u043A\u0430\u043A \u0443 \u043A\u0430\u043C\u043D\u044F. GGX \u0434\u0430\u0451\u0442 \u0434\u043B\u0438\u043D\u043D\u044B\u0439 \u0445\u0432\u043E\u0441\u0442 \u0438 \u0443\u0437\u043A\u043E\u0435 \u044F\u0434\u0440\u043E \u2014 \u0442\u043E, \u043F\u043E \u0447\u0435\u043C\u0443 \u043C\u0435\u0442\u0430\u043B\u043B \u0438
|
|
556
|
+
* \u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044F \u043C\u0435\u0442\u0430\u043B\u043B\u043E\u043C.
|
|
557
|
+
*/
|
|
558
|
+
float pow2(float x) { return x * x; }
|
|
559
|
+
|
|
560
|
+
float D_GGX(float alpha, float dotNH) {
|
|
561
|
+
float a2 = pow2(alpha);
|
|
562
|
+
float denom = pow2(dotNH) * (a2 - 1.0) + 1.0;
|
|
563
|
+
return 0.31830988618 * a2 / pow2(denom); // 1/pi * a2 / denom^2
|
|
564
|
+
}
|
|
565
|
+
|
|
566
|
+
float V_GGX_SmithCorrelated(float alpha, float dotNL, float dotNV) {
|
|
567
|
+
float a2 = pow2(alpha);
|
|
568
|
+
float gv = dotNL * sqrt(a2 + (1.0 - a2) * pow2(dotNV));
|
|
569
|
+
float gl = dotNV * sqrt(a2 + (1.0 - a2) * pow2(dotNL));
|
|
570
|
+
return 0.5 / max(gv + gl, 1e-6);
|
|
571
|
+
}
|
|
572
|
+
|
|
573
|
+
vec3 F_Schlick(vec3 f0, float dotVH) {
|
|
574
|
+
// \u0421\u0444\u0435\u0440\u0438\u0447\u0435\u0441\u043A\u0430\u044F \u0430\u043F\u043F\u0440\u043E\u043A\u0441\u0438\u043C\u0430\u0446\u0438\u044F \u0413\u0430\u0443\u0441\u0441\u0430 \u0432\u043C\u0435\u0441\u0442\u043E \u0432\u043E\u0437\u0432\u0435\u0434\u0435\u043D\u0438\u044F \u0432 \u043F\u044F\u0442\u0443\u044E \u0441\u0442\u0435\u043F\u0435\u043D\u044C \u2014 \u043A\u0430\u043A \u0432 three.
|
|
575
|
+
float fresnel = exp2((-5.55473 * dotVH - 6.98316) * dotVH);
|
|
576
|
+
return f0 * (1.0 - fresnel) + fresnel;
|
|
577
|
+
}
|
|
578
|
+
|
|
579
|
+
/** \u0417\u0435\u0440\u043A\u0430\u043B\u044C\u043D\u044B\u0439 \u043E\u0442\u043A\u043B\u0438\u043A \u043E\u0434\u043D\u043E\u0433\u043E \u0438\u0441\u0442\u043E\u0447\u043D\u0438\u043A\u0430. \u041D\u0430\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u0435 l \u2014 \u041E\u0422 \u043F\u043E\u0432\u0435\u0440\u0445\u043D\u043E\u0441\u0442\u0438 \u041A \u0441\u0432\u0435\u0442\u0443. */
|
|
580
|
+
vec3 specularGGX(vec3 l, vec3 v, vec3 n, vec3 f0, float roughness) {
|
|
581
|
+
float alpha = roughness * roughness;
|
|
582
|
+
vec3 h = normalize(l + v);
|
|
583
|
+
float dotNL = clamp(dot(n, l), 0.0, 1.0);
|
|
584
|
+
float dotNV = clamp(dot(n, v), 0.0, 1.0);
|
|
585
|
+
float dotNH = clamp(dot(n, h), 0.0, 1.0);
|
|
586
|
+
float dotVH = clamp(dot(v, h), 0.0, 1.0);
|
|
587
|
+
return F_Schlick(f0, dotVH) * (V_GGX_SmithCorrelated(alpha, dotNL, dotNV) * D_GGX(alpha, dotNH));
|
|
588
|
+
}
|
|
589
|
+
|
|
590
|
+
/**
|
|
591
|
+
* \u0421\u041E\u0411\u0421\u0422\u0412\u0415\u041D\u041D\u0410\u042F \u041F\u041E\u0414\u0421\u0412\u0415\u0422\u041A\u0410 \u041E\u0411\u042A\u0415\u041A\u0422\u0410 (KHR_lights_punctual \u0438\u0437 \u0435\u0433\u043E \u0436\u0435 \u0444\u0430\u0439\u043B\u0430).
|
|
592
|
+
*
|
|
593
|
+
* \u0428\u0435\u0441\u0442\u043D\u0430\u0434\u0446\u0430\u0442\u044C \u0438\u0441\u0442\u043E\u0447\u043D\u0438\u043A\u043E\u0432 \u2014 \u0441\u0442\u043E\u043B\u044C\u043A\u043E, \u0447\u0442\u043E\u0431\u044B \u0443 \u043D\u0430\u0441\u0442\u043E\u044F\u0449\u0435\u0439 \u0430\u0440\u0445\u0438\u0442\u0435\u043A\u0442\u0443\u0440\u043D\u043E\u0439 \u043F\u043E\u0434\u0441\u0432\u0435\u0442\u043A\u0438 \u043D\u0435 \u0433\u0430\u0441\u043B\u0430 \u043F\u043E\u043B\u043E\u0432\u0438\u043D\u0430
|
|
594
|
+
* \u043F\u0440\u043E\u0436\u0435\u043A\u0442\u043E\u0440\u043E\u0432 (\u0443 \u0441\u0442\u0435\u043B\u044B \u0418\u0441\u0442\u0438\u043A\u043B\u043E\u043B \u0438\u0445 \u0434\u0435\u0432\u044F\u0442\u043D\u0430\u0434\u0446\u0430\u0442\u044C). \u041A\u0430\u0436\u0434\u044B\u0439 \u043B\u0438\u0448\u043D\u0438\u0439 \u0441\u0442\u043E\u0438\u0442 \u043C\u0435\u0441\u0442\u0430 \u0432 \u044E\u043D\u0438\u0444\u043E\u0440\u043C\u0430\u0445 \u0438 \u0432\u0435\u0442\u043A\u0438 \u0432
|
|
595
|
+
* \u0446\u0438\u043A\u043B\u0435; \u043F\u0440\u0438 \u043F\u0435\u0440\u0435\u043F\u043E\u043B\u043D\u0435\u043D\u0438\u0438 \u0441\u0438\u043B\u044C\u043D\u0435\u0439\u0448\u0438\u0435 \u043E\u0442\u0431\u0438\u0440\u0430\u044E\u0442\u0441\u044F \u043D\u0430 \u0441\u0442\u043E\u0440\u043E\u043D\u0435 \u043F\u0440\u043E\u0446\u0435\u0441\u0441\u043E\u0440\u0430.
|
|
596
|
+
*
|
|
597
|
+
* \u0423\u043F\u0430\u043A\u043E\u0432\u043A\u0430 \u043F\u043B\u043E\u0442\u043D\u0430\u044F, \u043F\u043E vec4, \u0447\u0442\u043E\u0431\u044B \u043E\u0431\u043E\u0439\u0442\u0438\u0441\u044C \u0447\u0435\u0442\u044B\u0440\u044C\u043C\u044F \u043C\u0430\u0441\u0441\u0438\u0432\u0430\u043C\u0438:
|
|
598
|
+
* pos = xyz \u043F\u043E\u0437\u0438\u0446\u0438\u044F \u0432 \u043F\u0440\u043E\u0441\u0442\u0440\u0430\u043D\u0441\u0442\u0432\u0435 \u043C\u043E\u0434\u0435\u043B\u0438, w \u2014 \u0440\u0430\u0434\u0438\u0443\u0441 \u0432\u043B\u0438\u044F\u043D\u0438\u044F (0 = \u0431\u0435\u0437 \u043F\u0440\u0435\u0434\u0435\u043B\u0430);
|
|
599
|
+
* color = rgb \u0446\u0432\u0435\u0442, \u0443\u043C\u043D\u043E\u0436\u0435\u043D\u043D\u044B\u0439 \u043D\u0430 \u0441\u0438\u043B\u0443, w \u2014 \u0442\u0438\u043F (0 \u0442\u043E\u0447\u0435\u0447\u043D\u044B\u0439, 1 \u043F\u0440\u043E\u0436\u0435\u043A\u0442\u043E\u0440);
|
|
600
|
+
* dir = xyz \u043D\u0430\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u0435 \u043F\u0440\u043E\u0436\u0435\u043A\u0442\u043E\u0440\u0430;
|
|
601
|
+
* cone = x \u043A\u043E\u0441\u0438\u043D\u0443\u0441 \u0432\u043D\u0443\u0442\u0440\u0435\u043D\u043D\u0435\u0433\u043E \u0443\u0433\u043B\u0430, y \u0432\u043D\u0435\u0448\u043D\u0435\u0433\u043E.
|
|
602
|
+
*/
|
|
603
|
+
#define MODEL_LIGHTS 16
|
|
604
|
+
uniform int u_light_count;
|
|
605
|
+
uniform vec4 u_light_pos[MODEL_LIGHTS];
|
|
606
|
+
uniform vec4 u_light_color[MODEL_LIGHTS];
|
|
607
|
+
uniform vec4 u_light_dir[MODEL_LIGHTS];
|
|
608
|
+
uniform vec4 u_light_cone[MODEL_LIGHTS];
|
|
609
|
+
|
|
610
|
+
/**
|
|
611
|
+
* \u041E\u0441\u0432\u0435\u0449\u0451\u043D\u043D\u043E\u0441\u0442\u044C \u043E\u0442 \u0441\u043E\u0431\u0441\u0442\u0432\u0435\u043D\u043D\u044B\u0445 \u0438\u0441\u0442\u043E\u0447\u043D\u0438\u043A\u043E\u0432 \u043C\u043E\u0434\u0435\u043B\u0438.
|
|
612
|
+
*
|
|
613
|
+
* \u0412\u043E\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0438\u043C\u0435\u043D\u043D\u043E \u0421\u0412\u0415\u0422, \u0430 \u043D\u0435 \u0433\u043E\u0442\u043E\u0432\u044B\u0439 \u0446\u0432\u0435\u0442: \u0435\u0433\u043E \u043F\u043E\u0434\u043C\u0435\u0448\u0438\u0432\u0430\u044E\u0442 \u043A \u0441\u0432\u0435\u0442\u0443 \u0441\u0446\u0435\u043D\u044B \u0434\u043E \u0442\u043E\u043D\u0430\u043B\u044C\u043D\u043E\u0439 \u043A\u0440\u0438\u0432\u043E\u0439,
|
|
614
|
+
* \u0438\u043D\u0430\u0447\u0435 \u044F\u0440\u043A\u043E\u0435 \u043F\u044F\u0442\u043D\u043E \u0443\u043F\u0438\u0440\u0430\u0435\u0442\u0441\u044F \u0432 \u043F\u043E\u0442\u043E\u043B\u043E\u043A \u0438 \u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u0441\u044F \u043F\u043B\u043E\u0441\u043A\u0438\u043C \u0431\u0435\u043B\u044B\u043C \u043E\u0432\u0430\u043B\u043E\u043C.
|
|
615
|
+
*
|
|
616
|
+
* \u0417\u0430\u0442\u0443\u0445\u0430\u043D\u0438\u0435 \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043A\u043E\u0435, \u043E\u0431\u0440\u0430\u0442\u043D\u044B\u0439 \u043A\u0432\u0430\u0434\u0440\u0430\u0442 \u2014 \u0442\u0430\u043A \u0437\u0430\u0434\u0430\u043D\u043E \u0432 \u0441\u043F\u0435\u0446\u0438\u0444\u0438\u043A\u0430\u0446\u0438\u0438 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043D\u0438\u044F \u0438 \u0442\u0430\u043A \u0436\u0435 \u0441\u0447\u0438\u0442\u0430\u044E\u0442
|
|
617
|
+
* \u0432\u044C\u044E\u0435\u0440\u044B, \u0432 \u043A\u043E\u0442\u043E\u0440\u044B\u0445 \u0445\u0443\u0434\u043E\u0436\u043D\u0438\u043A \u043D\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u043B \u0441\u0446\u0435\u043D\u0443. \u041E\u0431\u0440\u0435\u0437\u043A\u0430 \u043F\u043E \u0440\u0430\u0434\u0438\u0443\u0441\u0443 \u043F\u043B\u0430\u0432\u043D\u0430\u044F, \u0438\u043D\u0430\u0447\u0435 \u043D\u0430 \u0433\u0440\u0430\u043D\u0438\u0446\u0435
|
|
618
|
+
* \u0432\u043B\u0438\u044F\u043D\u0438\u044F \u043F\u043E\u044F\u0432\u043B\u044F\u043B\u043E\u0441\u044C \u0431\u044B \u043A\u043E\u043B\u044C\u0446\u043E.
|
|
619
|
+
*/
|
|
620
|
+
vec3 modelLights(vec3 normal, vec3 v, vec3 f0, out vec3 spec) {
|
|
621
|
+
spec = vec3(0.0);
|
|
622
|
+
vec3 sum = vec3(0.0);
|
|
623
|
+
for (int i = 0; i < MODEL_LIGHTS; i++) {
|
|
624
|
+
if (i >= u_light_count) break;
|
|
625
|
+
vec3 toLight = u_light_pos[i].xyz - v_pos;
|
|
626
|
+
float d2 = max(dot(toLight, toLight), 1e-4);
|
|
627
|
+
float range = u_light_pos[i].w;
|
|
628
|
+
// \u0417\u0430 \u043F\u0440\u0435\u0434\u0435\u043B\u043E\u043C \u0432\u043B\u0438\u044F\u043D\u0438\u044F \u0438\u0441\u0442\u043E\u0447\u043D\u0438\u043A \u043D\u0435 \u0441\u0447\u0438\u0442\u0430\u0435\u043C \u0432\u043E\u0432\u0441\u0435 \u2014 \u044D\u0442\u043E \u0438 \u044D\u043A\u043E\u043D\u043E\u043C\u0438\u044F, \u0438 \u0437\u0430\u0449\u0438\u0442\u0430 \u043E\u0442 \xAB\u0441\u0432\u0435\u0442 \u0441\u043A\u0432\u043E\u0437\u044C \u0433\u043E\u0440\u043E\u0434\xBB.
|
|
629
|
+
if (range > 0.0 && d2 > range * range) continue;
|
|
630
|
+
vec3 l = toLight * inversesqrt(d2);
|
|
631
|
+
float ndotl = max(dot(normal, l), 0.0);
|
|
632
|
+
if (ndotl <= 0.0) continue;
|
|
633
|
+
|
|
634
|
+
float att = 1.0 / d2;
|
|
635
|
+
if (range > 0.0) att *= smoothstep(range * range, range * range * 0.25, d2);
|
|
636
|
+
|
|
637
|
+
// \u041F\u0440\u043E\u0436\u0435\u043A\u0442\u043E\u0440: \u043C\u044F\u0433\u043A\u0438\u0439 \u043A\u0440\u0430\u0439 \u043C\u0435\u0436\u0434\u0443 \u0432\u043D\u0443\u0442\u0440\u0435\u043D\u043D\u0438\u043C \u0438 \u0432\u043D\u0435\u0448\u043D\u0438\u043C \u043A\u043E\u043D\u0443\u0441\u043E\u043C.
|
|
638
|
+
if (u_light_color[i].w > 0.5) {
|
|
639
|
+
float cd = dot(-l, u_light_dir[i].xyz);
|
|
640
|
+
att *= smoothstep(u_light_cone[i].y, u_light_cone[i].x, cd);
|
|
641
|
+
}
|
|
642
|
+
vec3 radiance = u_light_color[i].rgb * att;
|
|
643
|
+
sum += radiance * ndotl;
|
|
644
|
+
// \u0424\u043E\u043D\u0430\u0440\u044C \u0434\u0430\u0451\u0442 \u043D\u0435 \u0442\u043E\u043B\u044C\u043A\u043E \u0437\u0430\u043B\u0438\u0432\u043A\u0443, \u043D\u043E \u0438 \u0431\u043B\u0438\u043A \u2014 \u0431\u0435\u0437 \u043D\u0435\u0433\u043E \u043F\u043E\u0434\u0441\u0432\u0435\u0447\u0435\u043D\u043D\u044B\u0439 \u043C\u0435\u0442\u0430\u043B\u043B \u0432\u044B\u0433\u043B\u044F\u0434\u0438\u0442 \u043A\u0440\u0430\u0448\u0435\u043D\u044B\u043C.
|
|
645
|
+
spec += radiance * specularGGX(l, v, normal, f0, u_roughness) * ndotl;
|
|
646
|
+
}
|
|
647
|
+
return sum;
|
|
648
|
+
}
|
|
649
|
+
|
|
650
|
+
/**
|
|
651
|
+
* \u041F\u0440\u0438\u0431\u043B\u0438\u0436\u0435\u043D\u0438\u0435 \u0438\u043D\u0442\u0435\u0433\u0440\u0430\u043B\u0430 \u043E\u043A\u0440\u0443\u0436\u0435\u043D\u0438\u044F \u2014 [Lazarov 2013, \xABGetting More Physical in Call of Duty: Black
|
|
652
|
+
* Ops II\xBB], \u0442\u043E\u0442 \u0436\u0435, \u043A\u043E\u0442\u043E\u0440\u044B\u043C Epic \u0441\u0447\u0438\u0442\u0430\u0435\u0442 PBR \u043D\u0430 \u043C\u043E\u0431\u0438\u043B\u044C\u043D\u044B\u0445.
|
|
653
|
+
*
|
|
654
|
+
* \u041F\u043E\u043B\u043D\u043E\u0435 \u0440\u0435\u0448\u0435\u043D\u0438\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0442\u0430\u0431\u043B\u0438\u0446\u044B (BRDF LUT) \u0438 \u043F\u0440\u0435\u0434\u0444\u0438\u043B\u044C\u0442\u0440\u043E\u0432\u0430\u043D\u043D\u043E\u0439 \u043A\u0443\u0431\u043C\u0430\u043F\u044B \u043E\u043A\u0440\u0443\u0436\u0435\u043D\u0438\u044F. \u041D\u0438 \u0442\u043E\u0433\u043E \u043D\u0438
|
|
655
|
+
* \u0434\u0440\u0443\u0433\u043E\u0433\u043E \u0443 \u0434\u0432\u0438\u0436\u043A\u0430 \u043D\u0435\u0442 \u0438 \u0437\u0430\u0432\u043E\u0434\u0438\u0442\u044C \u0434\u043E\u0440\u043E\u0433\u043E: \u043A\u0443\u0431\u043C\u0430\u043F\u0443 \u043F\u0440\u0438\u0448\u043B\u043E\u0441\u044C \u0431\u044B \u043F\u0435\u0440\u0435\u0440\u0438\u0441\u043E\u0432\u044B\u0432\u0430\u0442\u044C \u043D\u0430 \u043A\u0430\u0436\u0434\u043E\u0435 \u0434\u0432\u0438\u0436\u0435\u043D\u0438\u0435
|
|
656
|
+
* \u043A\u0430\u043C\u0435\u0440\u044B. \u041F\u043E\u043B\u0438\u043D\u043E\u043C \u0438\u0437 \u0434\u0432\u0443\u0445 \u043A\u043E\u043D\u0441\u0442\u0430\u043D\u0442 \u0434\u0430\u0451\u0442 \u0442\u0435 \u0436\u0435 \u0434\u0432\u0435 \u0432\u0435\u043B\u0438\u0447\u0438\u043D\u044B \u2014 \u043C\u043D\u043E\u0436\u0438\u0442\u0435\u043B\u044C \u043F\u0440\u0438 \u043E\u0442\u0440\u0430\u0436\u0430\u0442\u0435\u043B\u044C\u043D\u043E\u0439
|
|
657
|
+
* \u0441\u043F\u043E\u0441\u043E\u0431\u043D\u043E\u0441\u0442\u0438 \u0438 \u0434\u043E\u0431\u0430\u0432\u043A\u0443 \u2014 \u0431\u0435\u0437 \u0435\u0434\u0438\u043D\u043E\u0439 \u0432\u044B\u0431\u043E\u0440\u043A\u0438 \u0438\u0437 \u0442\u0435\u043A\u0441\u0442\u0443\u0440\u044B.
|
|
658
|
+
*
|
|
659
|
+
* \u0412\u0430\u0436\u043D\u043E\u0435 \u0441\u0432\u043E\u0439\u0441\u0442\u0432\u043E, \u0440\u0430\u0434\u0438 \u043A\u043E\u0442\u043E\u0440\u043E\u0433\u043E \u043E\u043D \u0438 \u0432\u0437\u044F\u0442: \u043F\u043E\u043B\u0438\u043D\u043E\u043C \u0432\u0435\u0440\u043D\u043E \u0440\u0430\u0431\u043E\u0442\u0430\u0435\u0442 \u043F\u0440\u0438 \u041B\u042E\u0411\u041E\u0419 \u0448\u0435\u0440\u043E\u0445\u043E\u0432\u0430\u0442\u043E\u0441\u0442\u0438,
|
|
660
|
+
* \u0432\u043A\u043B\u044E\u0447\u0430\u044F \u0435\u0434\u0438\u043D\u0438\u0446\u0443. \u041F\u0440\u0435\u0436\u043D\u044F\u044F \u0441\u0430\u043C\u043E\u0434\u0435\u043B\u044C\u043D\u0430\u044F \u043F\u0440\u0438\u043A\u0438\u0434\u043A\u0430 \u043F\u0440\u0438 \u0448\u0435\u0440\u043E\u0445\u043E\u0432\u0430\u0442\u043E\u0441\u0442\u0438 1 \u0434\u0430\u0432\u0430\u043B\u0430 \u043D\u043E\u043B\u044C, \u0438 \u043E\u0442\u0440\u0430\u0436\u0435\u043D\u0438\u044F \u043D\u0435
|
|
661
|
+
* \u0431\u044B\u043B\u043E \u043F\u043E\u0447\u0442\u0438 \u043D\u0438\u0433\u0434\u0435 \u2014 \u0432\u0435\u0434\u044C \u0435\u0434\u0438\u043D\u0438\u0446\u0430 \u044D\u0442\u043E \u0435\u0449\u0451 \u0438 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u043F\u043E \u0443\u043C\u043E\u043B\u0447\u0430\u043D\u0438\u044E.
|
|
662
|
+
*/
|
|
663
|
+
vec2 envBRDF(float roughness, float ndotv) {
|
|
664
|
+
const vec4 c0 = vec4(-1.0, -0.0275, -0.572, 0.022);
|
|
665
|
+
const vec4 c1 = vec4(1.0, 0.0425, 1.04, -0.04);
|
|
666
|
+
vec4 r = roughness * c0 + c1;
|
|
667
|
+
float a004 = min(r.x * r.x, exp2(-9.28 * ndotv)) * r.x + r.y;
|
|
668
|
+
return vec2(-1.04, 1.04) * a004 + r.zw;
|
|
669
|
+
}
|
|
670
|
+
|
|
671
|
+
/**
|
|
672
|
+
* \u0421\u0432\u0435\u0442, \u043F\u0440\u0438\u0445\u043E\u0434\u044F\u0449\u0438\u0439 \u0441 \u043D\u0435\u0431\u0430 \u0438 \u043E\u0442 \u0437\u0435\u043C\u043B\u0438 \u043F\u043E \u043D\u0430\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u044E dir. \u0417\u0430\u043C\u0435\u043D\u0430 \u043A\u0443\u0431\u043C\u0430\u043F\u0435.
|
|
673
|
+
*
|
|
674
|
+
* \u042F\u0420\u0427\u0415 \u0412\u0421\u0415\u0413\u041E \u2014 \u0423 \u0413\u041E\u0420\u0418\u0417\u041E\u041D\u0422\u0410, \u0430 \u043D\u0435 \u0432 \u0437\u0435\u043D\u0438\u0442\u0435. \u0422\u0430\u043A \u0443\u0441\u0442\u0440\u043E\u0435\u043D\u043E \u043D\u0430\u0441\u0442\u043E\u044F\u0449\u0435\u0435 \u043D\u0435\u0431\u043E: \u0443 \u0433\u043E\u0440\u0438\u0437\u043E\u043D\u0442\u0430 \u043B\u0443\u0447 \u0437\u0440\u0435\u043D\u0438\u044F \u0438\u0434\u0451\u0442
|
|
675
|
+
* \u0441\u043A\u0432\u043E\u0437\u044C \u0437\u0430\u043C\u0435\u0442\u043D\u043E \u0431\u043E\u043B\u0435\u0435 \u0442\u043E\u043B\u0441\u0442\u044B\u0439 \u0441\u043B\u043E\u0439 \u0432\u043E\u0437\u0434\u0443\u0445\u0430 \u0438 \u043D\u0430\u0431\u0438\u0440\u0430\u0435\u0442 \u0431\u043E\u043B\u044C\u0448\u0435 \u0440\u0430\u0441\u0441\u0435\u044F\u043D\u043D\u043E\u0433\u043E \u0441\u0432\u0435\u0442\u0430.
|
|
676
|
+
*
|
|
677
|
+
* \u041F\u0440\u043E\u043F\u043E\u0440\u0446\u0438\u0438 \u0432\u0437\u044F\u0442\u044B \u0438\u0437 \u0430\u0432\u0442\u043E\u0440\u0441\u043A\u043E\u0439 \u0441\u0446\u0435\u043D\u044B \u0441\u0442\u0435\u043B\u044B \u0438 \u043F\u0435\u0440\u0435\u0441\u0447\u0438\u0442\u0430\u043D\u044B \u0412 \u041B\u0418\u041D\u0415\u0419\u041D\u042B\u0419 \u0421\u0412\u0415\u0422 \u2014 \u0441\u043A\u043B\u0430\u0434\u044B\u0432\u0430\u0435\u0442\u0441\u044F \u043E\u0441\u0432\u0435\u0449\u0435\u043D\u0438\u0435
|
|
678
|
+
* \u0438\u043C\u0435\u043D\u043D\u043E \u0432 \u043D\u0451\u043C. \u041D\u0430 \u0433\u043B\u0430\u0437 \u0435\u0451 \u0433\u043E\u0440\u0438\u0437\u043E\u043D\u0442 \u0441\u0432\u0435\u0442\u043B\u0435\u0435 \u0437\u0435\u043D\u0438\u0442\u0430 \xAB\u0432 \u043F\u043E\u043B\u0442\u043E\u0440\u0430 \u0440\u0430\u0437\u0430\xBB, \u043D\u043E sRGB \u0441\u0436\u0438\u043C\u0430\u0435\u0442 \u0442\u0451\u043C\u043D\u043E\u0435, \u0438 \u0432
|
|
679
|
+
* \u043B\u0438\u043D\u0435\u0439\u043D\u044B\u0445 \u0435\u0434\u0438\u043D\u0438\u0446\u0430\u0445 \u0440\u0430\u0437\u0440\u044B\u0432 \u0431\u043E\u043B\u044C\u0448\u0435 \u0447\u0435\u043C \u0434\u0432\u043E\u0439\u043D\u043E\u0439 (0.79 \u043F\u0440\u043E\u0442\u0438\u0432 0.35 \u043F\u043E \u044F\u0440\u043A\u043E\u0441\u0442\u0438). \u0417\u0435\u043C\u043B\u044F \u0442\u0430\u043C \u2014 \u043D\u0435 \u043F\u0440\u043E\u0432\u0430\u043B:
|
|
680
|
+
* \u043E\u0441\u0432\u0435\u0449\u0451\u043D\u043D\u0430\u044F \u043F\u043B\u043E\u0449\u0430\u0434\u043A\u0430 \u043F\u043E\u0447\u0442\u0438 \u0434\u043E\u0433\u043E\u043D\u044F\u0435\u0442 \u0437\u0435\u043D\u0438\u0442.
|
|
681
|
+
*
|
|
682
|
+
* \u0420\u0430\u0437\u043D\u0438\u0446\u0430 \u043D\u0435 \u043A\u043E\u0441\u043C\u0435\u0442\u0438\u0447\u0435\u0441\u043A\u0430\u044F. \u0423 \u043C\u0435\u0442\u0430\u043B\u043B\u0430 \u0441\u043E\u0431\u0441\u0442\u0432\u0435\u043D\u043D\u044B\u0439 \u0440\u0430\u0441\u0441\u0435\u044F\u043D\u043D\u044B\u0439 \u0441\u0432\u0435\u0442 \u043F\u043E\u0447\u0442\u0438 \u043D\u0443\u043B\u0435\u0432\u043E\u0439 (\u043E\u043D \u0432\u0435\u0441\u044C \u0443\u0448\u0451\u043B \u0432
|
|
683
|
+
* \u043C\u043D\u043E\u0436\u0438\u0442\u0435\u043B\u044C 1 - metallic), \u0438 \u0432\u0441\u044F \u0435\u0433\u043E \u044F\u0440\u043A\u043E\u0441\u0442\u044C \u043F\u0440\u0438\u0445\u043E\u0434\u0438\u0442 \u043E\u0442\u0441\u044E\u0434\u0430. \u0410 \u043D\u043E\u0440\u043C\u0430\u043B\u0438 \u043A\u043E\u0440\u043E\u043D\u044B, \u0441\u0442\u0451\u043A\u043E\u043B \u0438 \u0432\u043E\u043E\u0431\u0449\u0435 \u043B\u044E\u0431\u043E\u0439
|
|
684
|
+
* \u0432\u0435\u0440\u0442\u0438\u043A\u0430\u043B\u044C\u043D\u043E\u0439 \u0441\u0442\u0435\u043D\u043A\u0438 \u0441\u043C\u043E\u0442\u0440\u044F\u0442 \u0412\u0411\u041E\u041A, \u0442\u043E \u0435\u0441\u0442\u044C \u043E\u0442\u0440\u0430\u0436\u0430\u044E\u0442 \u0438\u043C\u0435\u043D\u043D\u043E \u0433\u043E\u0440\u0438\u0437\u043E\u043D\u0442. \u041F\u0440\u0435\u0436\u043D\u0438\u0439 \u0433\u0440\u0430\u0434\u0438\u0435\u043D\u0442 \u2014 \u043E\u0442
|
|
685
|
+
* \u0442\u0451\u043C\u043D\u043E\u0439 \u0437\u0435\u043C\u043B\u0438 \u043A \u043D\u0435\u0431\u0443 \u2014 \u0434\u0435\u043B\u0430\u043B \u0433\u043E\u0440\u0438\u0437\u043E\u043D\u0442 \u0421\u0410\u041C\u042B\u041C \u0422\u0401\u041C\u041D\u042B\u041C \u043C\u0435\u0441\u0442\u043E\u043C \u043E\u043A\u0440\u0443\u0436\u0435\u043D\u0438\u044F, \u0432\u0434\u0432\u043E\u0435 \u0442\u0435\u043C\u043D\u0435\u0435 \u0437\u0435\u043D\u0438\u0442\u0430, \u0438
|
|
686
|
+
* \u0437\u043E\u043B\u043E\u0442\u043E \u043A\u043E\u0440\u043E\u043D\u044B \u0432 \u0434\u043D\u0435\u0432\u043D\u043E\u0439 \u0442\u0435\u043C\u0435 \u0432\u044B\u0445\u043E\u0434\u0438\u043B\u043E \u043A\u043E\u0440\u0438\u0447\u043D\u0435\u0432\u044B\u043C.
|
|
687
|
+
*
|
|
688
|
+
* \u0417\u0435\u043C\u043B\u044F \u0432\u0441\u0451 \u0436\u0435 \u043F\u0440\u0438\u0433\u043B\u0443\u0448\u0435\u043D\u0430 \u0441\u0438\u043B\u044C\u043D\u0435\u0435, \u0447\u0435\u043C \u0432 \u0442\u043E\u0439 \u0441\u0446\u0435\u043D\u0435: \u0442\u0430\u043C \u043F\u043E\u0434 \u0441\u0442\u0435\u043B\u043E\u0439 \u0438\u0437\u0432\u0435\u0441\u0442\u043D\u0430\u044F \u0441\u0432\u0435\u0442\u043B\u0430\u044F \u043F\u043B\u043E\u0449\u0430\u0434\u043A\u0430, \u0430
|
|
689
|
+
* \u043D\u0430 \u043A\u0430\u0440\u0442\u0435 \u043F\u043E\u0434 \u043E\u0431\u044A\u0435\u043A\u0442\u043E\u043C \u043C\u043E\u0436\u0435\u0442 \u0431\u044B\u0442\u044C \u0447\u0442\u043E \u0443\u0433\u043E\u0434\u043D\u043E, \u0438 \u0442\u0451\u043C\u043D\u044B\u0439 \u043D\u0438\u0437 \u0432\u044B\u0433\u043B\u044F\u0434\u0438\u0442 \u0443\u0431\u0435\u0434\u0438\u0442\u0435\u043B\u044C\u043D\u0435\u0435 \u0437\u0435\u0440\u043A\u0430\u043B\u044C\u043D\u043E\u0433\u043E.
|
|
690
|
+
*/
|
|
691
|
+
vec3 environment(vec3 dir, float roughness) {
|
|
692
|
+
vec3 sky = u_ambient_color * u_ambient_intensity + u_key_color * u_key_intensity * 0.35;
|
|
693
|
+
vec3 horizon = sky * 2.25;
|
|
694
|
+
vec3 ground = sky * 0.7;
|
|
695
|
+
// \u041F\u0438\u043A \u043D\u0430 \u0433\u043E\u0440\u0438\u0437\u043E\u043D\u0442\u0435: \u0432\u0432\u0435\u0440\u0445 \u0443\u0445\u043E\u0434\u0438\u043C \u043A \u0437\u0435\u043D\u0438\u0442\u0443, \u0432\u043D\u0438\u0437 \u2014 \u043A \u0437\u0435\u043C\u043B\u0435.
|
|
696
|
+
float t = clamp(dir.z, -1.0, 1.0);
|
|
697
|
+
vec3 env = t >= 0.0 ? mix(horizon, sky, t) : mix(horizon, ground, -t);
|
|
698
|
+
// \u0428\u0435\u0440\u043E\u0445\u043E\u0432\u0430\u0442\u0430\u044F \u043F\u043E\u0432\u0435\u0440\u0445\u043D\u043E\u0441\u0442\u044C \u043E\u0442\u0440\u0430\u0436\u0430\u0435\u0442 \u043D\u0435 \u043A\u0430\u0440\u0442\u0438\u043D\u043A\u0443, \u0430 \u0435\u0451 \u0441\u0440\u0435\u0434\u043D\u0435\u0435 \u2014 \u0442\u043E, \u0447\u0442\u043E \u0434\u0430\u043B\u0430 \u0431\u044B \u0440\u0430\u0437\u043C\u044B\u0442\u0430\u044F \u043A\u0443\u0431\u043C\u0430\u043F\u0430.
|
|
699
|
+
return mix(env, (sky + horizon + ground) / 3.0, roughness);
|
|
700
|
+
}
|
|
701
|
+
|
|
702
|
+
/**
|
|
703
|
+
* \u041E\u0422\u0420\u0410\u0416\u0415\u041D\u0418\u0415: \u043C\u0435\u0442\u0430\u043B\u043B, \u0441\u0442\u0435\u043A\u043B\u043E \u0438 \u0432\u0441\u0451, \u0447\u0442\u043E \u0431\u043B\u0435\u0441\u0442\u0438\u0442.
|
|
704
|
+
*
|
|
705
|
+
* \u0421\u043A\u043B\u0430\u0434\u044B\u0432\u0430\u0435\u0442\u0441\u044F \u0438\u0437 \u0434\u0432\u0443\u0445 \u0447\u0430\u0441\u0442\u0435\u0439, \u043A\u0430\u043A \u0438 \u043F\u043E\u043B\u043E\u0436\u0435\u043D\u043E: \u0437\u0435\u0440\u043A\u0430\u043B\u044C\u043D\u044B\u0439 \u043E\u0442\u043A\u043B\u0438\u043A \u043E\u043A\u0440\u0443\u0436\u0435\u043D\u0438\u044F (\u0447\u0435\u0440\u0435\u0437 envBRDF) \u0438
|
|
706
|
+
* \u0431\u043B\u0438\u043A \u043E\u0442 \u043A\u043B\u044E\u0447\u0435\u0432\u043E\u0433\u043E \u0438\u0441\u0442\u043E\u0447\u043D\u0438\u043A\u0430. \u041E\u0431\u0435 \u0443\u043C\u043D\u043E\u0436\u0430\u044E\u0442\u0441\u044F \u043D\u0430 \u0444\u0440\u0435\u043D\u0435\u043B\u0435\u0432\u0441\u043A\u0443\u044E \u043E\u0442\u0440\u0430\u0436\u0430\u0442\u0435\u043B\u044C\u043D\u0443\u044E \u0441\u043F\u043E\u0441\u043E\u0431\u043D\u043E\u0441\u0442\u044C, \u043F\u043E\u044D\u0442\u043E\u043C\u0443
|
|
707
|
+
* \u043A\u0440\u0430\u0439 \u043F\u043E\u0432\u0435\u0440\u0445\u043D\u043E\u0441\u0442\u0438 \u0431\u043B\u0435\u0441\u0442\u0438\u0442 \u0441\u0438\u043B\u044C\u043D\u0435\u0435 \u0441\u0435\u0440\u0435\u0434\u0438\u043D\u044B \u2014 \u0442\u043E \u0441\u0430\u043C\u043E\u0435, \u043F\u043E \u0447\u0435\u043C\u0443 \u0441\u0442\u0435\u043A\u043B\u043E \u0438 \u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044F \u0441\u0442\u0435\u043A\u043B\u043E\u043C.
|
|
708
|
+
*/
|
|
709
|
+
vec3 reflection(vec3 albedo, vec3 n) {
|
|
710
|
+
vec3 v = normalize(v_view);
|
|
711
|
+
float ndotv = max(dot(n, v), 1e-3);
|
|
712
|
+
|
|
713
|
+
// \u041E\u0442\u0440\u0430\u0436\u0430\u0442\u0435\u043B\u044C\u043D\u0430\u044F \u0441\u043F\u043E\u0441\u043E\u0431\u043D\u043E\u0441\u0442\u044C \u0432 \u0443\u043F\u043E\u0440: \u0443 \u0434\u0438\u044D\u043B\u0435\u043A\u0442\u0440\u0438\u043A\u0430 \u043E\u043A\u043E\u043B\u043E 4 %, \u0443 \u043C\u0435\u0442\u0430\u043B\u043B\u0430 \u044D\u0442\u043E \u0435\u0433\u043E \u0441\u043E\u0431\u0441\u0442\u0432\u0435\u043D\u043D\u044B\u0439 \u0446\u0432\u0435\u0442.
|
|
714
|
+
vec3 f0 = mix(vec3(0.04), albedo, u_metallic);
|
|
715
|
+
vec2 ab = envBRDF(u_roughness, ndotv);
|
|
716
|
+
/*
|
|
717
|
+
* \u0414\u0412\u0410 \u0427\u041B\u0415\u041D\u0410 \u041E\u0422\u0420\u0410\u0416\u0415\u041D\u0418\u042F \u0412\u0415\u0414\u0423\u0422 \u0421\u0415\u0411\u042F \u041F\u041E-\u0420\u0410\u0417\u041D\u041E\u041C\u0423, \u0418 \u041C\u0410\u0421\u0428\u0422\u0410\u0411 \u0423 \u041D\u0418\u0425 \u0420\u0410\u0417\u041D\u042B\u0419.
|
|
718
|
+
*
|
|
719
|
+
* \u0417\u0415\u0420\u041A\u0410\u041B\u042C\u041D\u042B\u0419 (f0 * ab.x) \u043C\u043D\u043E\u0436\u0438\u0442\u0441\u044F \u043D\u0430 \u0441\u043E\u0431\u0441\u0442\u0432\u0435\u043D\u043D\u0443\u044E \u043E\u0442\u0440\u0430\u0436\u0430\u0442\u0435\u043B\u044C\u043D\u0443\u044E \u0441\u043F\u043E\u0441\u043E\u0431\u043D\u043E\u0441\u0442\u044C \u043C\u0430\u0442\u0435\u0440\u0438\u0430\u043B\u0430. \u0423 \u043C\u0435\u0442\u0430\u043B\u043B\u0430
|
|
720
|
+
* \u043E\u043D\u0430 \u0440\u0430\u0432\u043D\u0430 \u0435\u0433\u043E \u0446\u0432\u0435\u0442\u0443, \u0438 \u044D\u0442\u043E\u0442 \u0447\u043B\u0435\u043D \u2014 \u0432\u0435\u0441\u044C \u0435\u0433\u043E \u043E\u0431\u043B\u0438\u043A: \u0440\u0430\u0441\u0441\u0435\u044F\u043D\u043D\u043E\u0439 \u0441\u043E\u0441\u0442\u0430\u0432\u043B\u044F\u044E\u0449\u0435\u0439 \u0443 \u043C\u0435\u0442\u0430\u043B\u043B\u0430 \u043D\u0435\u0442 \u0432\u043E\u0432\u0441\u0435.
|
|
721
|
+
* \u0412\u044B\u0439\u0442\u0438 \u0437\u0430 \u043F\u0440\u0435\u0434\u0435\u043B (\u044F\u0440\u043A\u043E\u0441\u0442\u044C \u043D\u0435\u0431\u0430 * \u0446\u0432\u0435\u0442 \u043C\u0435\u0442\u0430\u043B\u043B\u0430) \u043E\u043D \u043D\u0435 \u043C\u043E\u0436\u0435\u0442, \u043F\u043E\u044D\u0442\u043E\u043C\u0443 \u0431\u0435\u0440\u0451\u043C \u043E\u043A\u0440\u0443\u0436\u0435\u043D\u0438\u0435 \u0446\u0435\u043B\u0438\u043A\u043E\u043C.
|
|
722
|
+
* \u0420\u0430\u0437\u0434\u0435\u043B\u0438\u0432 \u0435\u0433\u043E, \u044F \u043F\u0440\u0438\u0442\u0443\u0448\u0438\u043B \u0432\u0441\u0451 \u0437\u043E\u043B\u043E\u0442\u043E \u0440\u043E\u0432\u043D\u043E \u0432 \u043F\u0438 \u0440\u0430\u0437 \u2014 \u043A\u043E\u0440\u043E\u043D\u0430 \u0432\u044B\u0448\u043B\u0430 \u043A\u043E\u0440\u0438\u0447\u043D\u0435\u0432\u043E\u0439.
|
|
723
|
+
*
|
|
724
|
+
* \u0421\u041A\u041E\u041B\u042C\u0417\u042F\u0429\u0418\u0419 (ab.y) \u043F\u043E\u0434\u0445\u043E\u0434\u0438\u0442 \u043A \u0435\u0434\u0438\u043D\u0438\u0446\u0435 \u0443 \u041B\u042E\u0411\u041E\u0413\u041E \u043C\u0430\u0442\u0435\u0440\u0438\u0430\u043B\u0430, \u043D\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043C\u043E \u043E\u0442 \u0435\u0433\u043E \u0446\u0432\u0435\u0442\u0430: \u044D\u0442\u043E \u043E\u043D \u043A\u0440\u0430\u0441\u0438\u043B
|
|
725
|
+
* \u0441\u0438\u043D\u044E\u044E \u0431\u0430\u0448\u043D\u044E \u0432 \u0431\u0435\u043B\u043E\u0435. \u0415\u0433\u043E \u0438 \u0434\u0435\u043B\u0438\u043C. \u041E\u0431\u043E\u0441\u043D\u043E\u0432\u0430\u043D\u0438\u0435 \u043D\u0435 \u0442\u043E\u043B\u044C\u043A\u043E \u0432 \u0442\u043E\u043C, \u0447\u0442\u043E \u043E\u0442\u0440\u0430\u0436\u0435\u043D\u0438\u044E \u043D\u0443\u0436\u043D\u0430 \u044F\u0440\u043A\u043E\u0441\u0442\u044C, \u0430
|
|
726
|
+
* \u043D\u0435 \u043E\u0441\u0432\u0435\u0449\u0451\u043D\u043D\u043E\u0441\u0442\u044C: \u0432\u0441\u043A\u043E\u043B\u044C\u0437\u044C \u0444\u0430\u0441\u0430\u0434 \u043E\u0442\u0440\u0430\u0436\u0430\u0435\u0442 \u0413\u041E\u0420\u041E\u0414, \u0430 \u043D\u0435 \u044F\u0440\u043A\u0443\u044E \u043F\u043E\u043B\u043E\u0441\u0443 \u043D\u0435\u0431\u0430, \u0430 \u0443 \u0442\u0440\u0451\u0445\u043F\u043E\u043B\u043E\u0441\u043D\u043E\u0433\u043E
|
|
727
|
+
* \u043E\u043A\u0440\u0443\u0436\u0435\u043D\u0438\u044F \u0442\u0430\u043A\u043E\u0439 \u0434\u0435\u0442\u0430\u043B\u0438 \u043D\u0435\u0442, \u0438 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u0442\u0430\u043C \u0437\u0430\u0432\u0435\u0434\u043E\u043C\u043E \u0437\u0430\u0432\u044B\u0448\u0435\u043D\u043E.
|
|
728
|
+
*/
|
|
729
|
+
const float PI = 3.14159265;
|
|
730
|
+
vec3 envLight = environment(reflect(-v, n), u_roughness);
|
|
731
|
+
|
|
732
|
+
// \u0411\u043B\u0438\u043A \u0441\u043E\u043B\u043D\u0446\u0430 \u2014 \u0442\u043E\u0442 \u0436\u0435 GGX, \u0447\u0442\u043E \u0443 three: \u0443\u0437\u043A\u043E\u0435 \u044F\u0434\u0440\u043E \u0443 \u043F\u043E\u043B\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u043E\u0433\u043E, \u0448\u0438\u0440\u043E\u043A\u0438\u0439 \u0445\u0432\u043E\u0441\u0442 \u0443 \u043C\u0430\u0442\u043E\u0432\u043E\u0433\u043E.
|
|
733
|
+
float ndotl = max(dot(n, -u_key_dir), 0.0);
|
|
734
|
+
vec3 sun = u_key_color * u_key_intensity * specularGGX(-u_key_dir, v, n, f0, u_roughness) * ndotl;
|
|
735
|
+
|
|
736
|
+
return envLight * f0 * ab.x + (envLight / PI) * ab.y + sun;
|
|
737
|
+
}
|
|
738
|
+
|
|
739
|
+
uniform vec4 u_base_color;
|
|
740
|
+
uniform sampler2D u_base_texture;
|
|
741
|
+
uniform float u_has_texture;
|
|
742
|
+
uniform float u_opacity;
|
|
743
|
+
uniform float u_alpha_cutoff;
|
|
744
|
+
/** \u0421\u043E\u0431\u0441\u0442\u0432\u0435\u043D\u043D\u043E\u0435 \u0441\u0432\u0435\u0447\u0435\u043D\u0438\u0435 \u043C\u0430\u0442\u0435\u0440\u0438\u0430\u043B\u0430 (emissiveFactor \xD7 emissiveStrength \u0438\u0437 glTF). */
|
|
745
|
+
uniform vec3 u_emissive;
|
|
746
|
+
|
|
747
|
+
out vec4 fragColor;
|
|
748
|
+
|
|
749
|
+
void main() {
|
|
750
|
+
vec4 albedo = u_base_color;
|
|
751
|
+
if (u_has_texture > 0.5) albedo *= texture(u_base_texture, v_tex);
|
|
752
|
+
if (albedo.a < u_alpha_cutoff) discard;
|
|
753
|
+
|
|
754
|
+
vec3 n = normalize(v_normal);
|
|
755
|
+
// \u0414\u0432\u0443\u0441\u0442\u043E\u0440\u043E\u043D\u043D\u0438\u0435 \u043C\u0430\u0442\u0435\u0440\u0438\u0430\u043B\u044B: \u0443 \u043E\u0431\u0440\u0430\u0442\u043D\u043E\u0439 \u0433\u0440\u0430\u043D\u0438 \u043D\u043E\u0440\u043C\u0430\u043B\u044C \u0441\u043C\u043E\u0442\u0440\u0438\u0442 \u043E\u0442 \u043D\u0430\u0441, \u0438 \u0431\u0435\u0437
|
|
756
|
+
// \u0440\u0430\u0437\u0432\u043E\u0440\u043E\u0442\u0430 \u0442\u0430\u043A\u0430\u044F \u0433\u0440\u0430\u043D\u044C \u0432\u0441\u0435\u0433\u0434\u0430 \u0447\u0451\u0440\u043D\u0430\u044F.
|
|
757
|
+
if (!gl_FrontFacing) n = -n;
|
|
758
|
+
|
|
759
|
+
float ndotl = dot(n, -u_key_dir);
|
|
760
|
+
float keyFactor = max(ndotl, 0.0) * (1.0 - shadowOcclusion(ndotl));
|
|
761
|
+
// \u0421\u043E\u0431\u0441\u0442\u0432\u0435\u043D\u043D\u043E\u0435 \u0441\u0432\u0435\u0447\u0435\u043D\u0438\u0435 \u041F\u0420\u0418\u0411\u0410\u0412\u041B\u042F\u0415\u0422\u0421\u042F \u043A \u043E\u0441\u0432\u0435\u0449\u0451\u043D\u043D\u043E\u043C\u0443 \u0446\u0432\u0435\u0442\u0443 \u0438 \u043D\u0430 \u0441\u0432\u0435\u0442 \u043D\u0435
|
|
762
|
+
// \u0443\u043C\u043D\u043E\u0436\u0430\u0435\u0442\u0441\u044F: \u043F\u043E\u0432\u0435\u0440\u0445\u043D\u043E\u0441\u0442\u044C \u0441\u0432\u0435\u0442\u0438\u0442\u0441\u044F \u0441\u0430\u043C\u0430. \u041E\u0442\u0441\u044E\u0434\u0430 \u0438 \xAB\u043D\u0438\u0436\u043D\u0438\u0439 \u043F\u043E\u0440\u043E\u0433\xBB \u044F\u0440\u043A\u043E\u0441\u0442\u0438, \u0438\u0437-\u0437\u0430
|
|
763
|
+
// \u043E\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u044F \u043A\u043E\u0442\u043E\u0440\u043E\u0433\u043E \u043C\u043E\u0434\u0435\u043B\u044C \u0432\u044B\u0433\u043B\u044F\u0434\u0435\u043B\u0430 \u0442\u0435\u043C\u043D\u0435\u0435 \u0437\u0430\u0434\u0443\u043C\u0430\u043D\u043D\u043E\u0433\u043E, \u0430 \u043D\u043E\u0447\u044C\u044E \u0433\u0430\u0441\u043B\u0430.
|
|
764
|
+
// \u041F\u043E\u0434\u0441\u0432\u0435\u0442\u043A\u0430 \u043E\u0431\u044A\u0435\u043A\u0442\u0430 \u043F\u0440\u0438\u0431\u0430\u0432\u043B\u044F\u0435\u0442\u0441\u044F \u043A \u043E\u0441\u0432\u0435\u0449\u0435\u043D\u0438\u044E \u0441\u0446\u0435\u043D\u044B: \u044D\u0442\u043E \u0415\u0413\u041E \u0441\u043E\u0431\u0441\u0442\u0432\u0435\u043D\u043D\u044B\u0435 \u0444\u043E\u043D\u0430\u0440\u0438, \u0430 \u043D\u0435 \u0441\u043E\u043B\u043D\u0446\u0435,
|
|
765
|
+
// \u0438 \u0433\u0430\u0441\u0438\u0442\u044C \u0438\u0445 \u0432\u043C\u0435\u0441\u0442\u0435 \u0441 \u043D\u043E\u0447\u044C\u044E \u043D\u0435\u043B\u044C\u0437\u044F \u2014 \u043D\u043E\u0447\u044C\u044E \u043E\u043D\u0438 \u043A\u0430\u043A \u0440\u0430\u0437 \u0438 \u043D\u0443\u0436\u043D\u044B.
|
|
766
|
+
/*
|
|
767
|
+
* \u0421\u0411\u041E\u0420\u041A\u0410 \u0426\u0412\u0415\u0422\u0410.
|
|
768
|
+
*
|
|
769
|
+
* \u0423 \u043C\u0435\u0442\u0430\u043B\u043B\u0430 \u0441\u043E\u0431\u0441\u0442\u0432\u0435\u043D\u043D\u043E\u0433\u043E \u0440\u0430\u0441\u0441\u0435\u044F\u043D\u043D\u043E\u0433\u043E \u0446\u0432\u0435\u0442\u0430 \u043D\u0435\u0442 \u2014 \u043E\u043D \u0432\u0435\u0441\u044C \u0432 \u043E\u0442\u0440\u0430\u0436\u0435\u043D\u0438\u0438, \u043F\u043E\u044D\u0442\u043E\u043C\u0443 \u0434\u0438\u0444\u0444\u0443\u0437\u043D\u0430\u044F \u0447\u0430\u0441\u0442\u044C
|
|
770
|
+
* \u0433\u0430\u0441\u0438\u0442\u0441\u044F \u043C\u0435\u0442\u0430\u043B\u043B\u0438\u0447\u043D\u043E\u0441\u0442\u044C\u044E. \u0420\u0430\u043D\u044C\u0448\u0435 \u044D\u0442\u043E \u043F\u0440\u0438\u0445\u043E\u0434\u0438\u043B\u043E\u0441\u044C \u043E\u0442\u043A\u043B\u044E\u0447\u0430\u0442\u044C: \u0444\u0430\u0439\u043B\u044B \u0431\u0435\u0437 \u0440\u0430\u0437\u043C\u0435\u0442\u043A\u0438 \u043E\u0431\u044A\u044F\u0432\u043B\u044F\u043B\u0438\u0441\u044C
|
|
771
|
+
* \u043C\u0435\u0442\u0430\u043B\u043B\u043E\u043C \u043F\u043E \u0443\u043C\u043E\u043B\u0447\u0430\u043D\u0438\u044E \u0438 \u0447\u0435\u0440\u043D\u0435\u043B\u0438. \u0422\u0435\u043F\u0435\u0440\u044C \u0442\u0430\u043A\u0438\u0435 \u043C\u0430\u0442\u0435\u0440\u0438\u0430\u043B\u044B \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u044E\u0442\u0441\u044F \u043A\u0430\u043A \u043C\u0430\u0442\u043E\u0432\u044B\u0439 \u0434\u0438\u044D\u043B\u0435\u043A\u0442\u0440\u0438\u043A
|
|
772
|
+
* (\u0441\u043C. metallic \u0432 \u0440\u0430\u0437\u0431\u043E\u0440\u0435 GLB), \u0438 \u044D\u043D\u0435\u0440\u0433\u043E\u0441\u0431\u0435\u0440\u0435\u0436\u0435\u043D\u0438\u0435 \u043C\u043E\u0436\u043D\u043E \u0441\u043E\u0431\u043B\u044E\u0434\u0430\u0442\u044C \u0447\u0435\u0441\u0442\u043D\u043E.
|
|
773
|
+
*
|
|
774
|
+
* \u0421\u043E\u0431\u0441\u0442\u0432\u0435\u043D\u043D\u044B\u0435 \u0444\u043E\u043D\u0430\u0440\u0438 \u043E\u0431\u044A\u0435\u043A\u0442\u0430 \u0437\u0430\u0445\u043E\u0434\u044F\u0442 \u0414\u041E \u0442\u043E\u043D\u0430\u043B\u044C\u043D\u043E\u0439 \u043A\u0440\u0438\u0432\u043E\u0439 \u2014 \u0432\u043C\u0435\u0441\u0442\u0435 \u0441 \u043E\u0441\u0442\u0430\u043B\u044C\u043D\u044B\u043C \u0441\u0432\u0435\u0442\u043E\u043C \u0441\u0446\u0435\u043D\u044B.
|
|
775
|
+
*/
|
|
776
|
+
vec3 diffuse = albedo.rgb * (1.0 - u_metallic);
|
|
777
|
+
vec3 f0 = mix(vec3(0.04), albedo.rgb, u_metallic);
|
|
778
|
+
|
|
779
|
+
/*
|
|
780
|
+
* \u0424\u041E\u041D\u0410\u0420\u0418 \u0421\u0427\u0418\u0422\u0410\u042E\u0422\u0421\u042F \u0426\u0415\u041B\u0418\u041A\u041E\u041C \u0412 \u041F\u0420\u041E\u0421\u0422\u0420\u0410\u041D\u0421\u0422\u0412\u0415 \u041C\u041E\u0414\u0415\u041B\u0418.
|
|
781
|
+
*
|
|
782
|
+
* \u0418\u0445 \u043F\u043E\u0437\u0438\u0446\u0438\u0438 \u0438 v_pos \u0437\u0430\u0434\u0430\u043D\u044B \u0442\u0430\u043C, \u043F\u043E\u044D\u0442\u043E\u043C\u0443 \u0438 \u043D\u043E\u0440\u043C\u0430\u043B\u044C, \u0438 \u043D\u0430\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u0435 \u0432\u0437\u0433\u043B\u044F\u0434\u0430 \u0431\u0435\u0440\u0443\u0442\u0441\u044F \u043C\u043E\u0434\u0435\u043B\u044C\u043D\u044B\u0435.
|
|
783
|
+
* \u0421\u043C\u0435\u0448\u0435\u043D\u0438\u0435 \u0441 \u043C\u0438\u0440\u043E\u0432\u043E\u0439 \u043D\u043E\u0440\u043C\u0430\u043B\u044C\u044E \u0434\u0430\u0432\u0430\u043B\u043E \u0440\u043E\u0432\u043D\u043E \u0442\u043E\u0442 \u0432\u0438\u0434, \u043F\u043E \u043A\u043E\u0442\u043E\u0440\u043E\u043C\u0443 \u044D\u0442\u043E \u0438 \u0437\u0430\u043C\u0435\u0442\u0438\u043B\u0438: \u043F\u043E\u043B\u043E\u0432\u0438\u043D\u0430
|
|
784
|
+
* \u0441\u0432\u0435\u0442\u043E\u0432\u043E\u0433\u043E \u043F\u044F\u0442\u043D\u0430 \u0443\u0445\u043E\u0434\u0438\u043B\u0430 \u0432 \u0442\u0435\u043C\u043D\u043E\u0442\u0443, \u043F\u043E\u0442\u043E\u043C\u0443 \u0447\u0442\u043E \u043E\u0441\u0438 \u043C\u043E\u0434\u0435\u043B\u0438 \u0438 \u043A\u0430\u0440\u0442\u044B \u043D\u0435 \u0441\u043E\u0432\u043F\u0430\u0434\u0430\u044E\u0442 \u0438 \u0441\u043A\u0430\u043B\u044F\u0440\u043D\u043E\u0435
|
|
785
|
+
* \u043F\u0440\u043E\u0438\u0437\u0432\u0435\u0434\u0435\u043D\u0438\u0435 \u0441\u0447\u0438\u0442\u0430\u043B\u043E\u0441\u044C \u043C\u0435\u0436\u0434\u0443 \u0440\u0430\u0437\u043D\u044B\u043C\u0438 \u0441\u0438\u0441\u0442\u0435\u043C\u0430\u043C\u0438 \u043A\u043E\u043E\u0440\u0434\u0438\u043D\u0430\u0442.
|
|
786
|
+
*/
|
|
787
|
+
vec3 nModel = normalize(v_nmodel);
|
|
788
|
+
if (!gl_FrontFacing) nModel = -nModel;
|
|
789
|
+
vec3 vModel = normalize(u_camera_model - v_pos);
|
|
790
|
+
vec3 lampSpec;
|
|
791
|
+
vec3 lampDiffuse = modelLights(nModel, vModel, f0, lampSpec);
|
|
792
|
+
vec3 color = applyLightWithExtra(diffuse, n, keyFactor, lampDiffuse)
|
|
793
|
+
+ u_emissive
|
|
794
|
+
+ lampSpec
|
|
795
|
+
+ reflection(albedo.rgb, n) * u_reflect * (1.0 - shadowOcclusion(ndotl) * 0.5);
|
|
796
|
+
|
|
797
|
+
float alpha = albedo.a * u_opacity;
|
|
798
|
+
fragColor = vec4(applyFog(color) * alpha, alpha);
|
|
799
|
+
}
|
|
800
|
+
`,Ea=`#version 300 es
|
|
801
|
+
precision highp float;
|
|
802
|
+
in vec3 a_pos;
|
|
803
|
+
uniform mat4 u_matrix;
|
|
804
|
+
void main() {
|
|
805
|
+
gl_Position = u_matrix * vec4(a_pos, 1.0);
|
|
806
|
+
}
|
|
807
|
+
`,Ma=`#version 300 es
|
|
808
|
+
precision highp float;
|
|
809
|
+
in vec2 a_pos; // 0..1, \u0442\u043E\u0442 \u0436\u0435 \u043A\u0432\u0430\u0434\u0440\u0430\u0442, \u0447\u0442\u043E \u0443 \u0442\u0435\u043D\u0438 \u043D\u0430 \u0437\u0435\u043C\u043B\u0435
|
|
810
|
+
|
|
811
|
+
// \u041D\u0430\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u044F \u043B\u0443\u0447\u0435\u0439 \u0447\u0435\u0440\u0435\u0437 \u0443\u0433\u043B\u044B \u043A\u0430\u0434\u0440\u0430. \u0418\u043D\u0442\u0435\u0440\u043F\u043E\u043B\u0438\u0440\u0443\u044E\u0442\u0441\u044F \u043B\u0438\u043D\u0435\u0439\u043D\u043E \u2014 \u044D\u0442\u043E\u0433\u043E \u0445\u0432\u0430\u0442\u0430\u0435\u0442,
|
|
812
|
+
// \u0441\u0447\u0438\u0442\u0430\u0442\u044C \u043E\u0431\u0440\u0430\u0442\u043D\u0443\u044E \u043F\u0440\u043E\u0435\u043A\u0446\u0438\u044E \u0432 \u043A\u0430\u0436\u0434\u043E\u043C \u0444\u0440\u0430\u0433\u043C\u0435\u043D\u0442\u0435 \u043D\u0435\u0437\u0430\u0447\u0435\u043C.
|
|
813
|
+
uniform vec3 u_ray_tl;
|
|
814
|
+
uniform vec3 u_ray_tr;
|
|
815
|
+
uniform vec3 u_ray_bl;
|
|
816
|
+
uniform vec3 u_ray_br;
|
|
817
|
+
|
|
818
|
+
out vec2 v_uv;
|
|
819
|
+
out vec3 v_ray;
|
|
820
|
+
|
|
821
|
+
void main() {
|
|
822
|
+
v_uv = a_pos;
|
|
823
|
+
v_ray = mix(mix(u_ray_bl, u_ray_br, a_pos.x), mix(u_ray_tl, u_ray_tr, a_pos.x), a_pos.y);
|
|
824
|
+
gl_Position = vec4(a_pos * 2.0 - 1.0, 0.999, 1.0);
|
|
825
|
+
}
|
|
826
|
+
`,Ia=`#version 300 es
|
|
827
|
+
precision highp float;
|
|
828
|
+
|
|
829
|
+
in vec2 v_uv;
|
|
830
|
+
in vec3 v_ray;
|
|
831
|
+
|
|
832
|
+
uniform vec3 u_sky_color;
|
|
833
|
+
uniform vec3 u_horizon_color;
|
|
834
|
+
uniform vec3 u_sky_params; // x: Y \u0433\u043E\u0440\u0438\u0437\u043E\u043D\u0442\u0430 (\u0441\u043D\u0438\u0437\u0443), y: \u0448\u0438\u0440\u0438\u043D\u0430 \u043F\u0435\u0440\u0435\u0445\u043E\u0434\u0430 \u0432\u0432\u0435\u0440\u0445, z: \u043F\u043E\u043B\u043E\u0441\u0430 \u0434\u044B\u043C\u043A\u0438 \u0432\u043D\u0438\u0437
|
|
835
|
+
|
|
836
|
+
// \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.
|
|
837
|
+
uniform vec3 u_space_color;
|
|
838
|
+
uniform vec3 u_atmo_color;
|
|
839
|
+
uniform vec4 u_globe_disc; // xyz: \u043D\u0430\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u0435 \u043D\u0430 \u0446\u0435\u043D\u0442\u0440 \u043F\u043B\u0430\u043D\u0435\u0442\u044B, w: \u0435\u0451 \u0443\u0433\u043B\u043E\u0432\u043E\u0439 \u0440\u0430\u0434\u0438\u0443\u0441
|
|
840
|
+
uniform vec2 u_space; // x: \u0432\u043A\u043B (\u0434\u043E\u043B\u044F \u0441\u0444\u0435\u0440\u044B), y: \u044F\u0440\u043A\u043E\u0441\u0442\u044C \u0437\u0432\u0451\u0437\u0434
|
|
841
|
+
|
|
842
|
+
out vec4 fragColor;
|
|
843
|
+
|
|
844
|
+
/**
|
|
845
|
+
* \u0417\u0432\u0451\u0437\u0434\u044B: \u0434\u0435\u0442\u0435\u0440\u043C\u0438\u043D\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0439 \u0445\u0435\u0448 \u043F\u043E \u041D\u0410\u041F\u0420\u0410\u0412\u041B\u0415\u041D\u0418\u042E \u043B\u0443\u0447\u0430, \u0430 \u043D\u0435 \u043F\u043E \u044D\u043A\u0440\u0430\u043D\u0443.
|
|
846
|
+
*
|
|
847
|
+
* \u041E\u0442 \u044D\u043A\u0440\u0430\u043D\u0430 \u043E\u043D\u0438 \u0431\u044B \xAB\u043F\u043E\u043B\u0437\u043B\u0438\xBB \u043F\u0440\u0438 \u043F\u043E\u0432\u043E\u0440\u043E\u0442\u0435 \u043A\u0430\u043C\u0435\u0440\u044B \u2014 \u043D\u0435\u0431\u043E \u0432\u0435\u0434\u0451\u0442 \u0441\u0435\u0431\u044F \u043A\u0430\u043A \u043D\u0430\u043A\u043B\u0435\u0439\u043A\u0430
|
|
848
|
+
* \u043D\u0430 \u0441\u0442\u0435\u043A\u043B\u0435. \u041F\u043E \u043D\u0430\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u044E \u0437\u0432\u0451\u0437\u0434\u044B \u0441\u0442\u043E\u044F\u0442 \u0432 \u043C\u0438\u0440\u0435 \u0438 \u0432\u0440\u0430\u0449\u0430\u044E\u0442\u0441\u044F \u0432\u043C\u0435\u0441\u0442\u0435 \u0441 \u043F\u043B\u0430\u043D\u0435\u0442\u043E\u0439,
|
|
849
|
+
* \u0442\u043E \u0435\u0441\u0442\u044C \u0432\u0435\u0434\u0443\u0442 \u0441\u0435\u0431\u044F \u043A\u0430\u043A \u043D\u0430\u0441\u0442\u043E\u044F\u0449\u0438\u0435.
|
|
850
|
+
*/
|
|
851
|
+
float hash13(vec3 v) {
|
|
852
|
+
return fract(sin(dot(v, vec3(12.9898, 78.233, 37.719))) * 43758.5453);
|
|
853
|
+
}
|
|
854
|
+
|
|
855
|
+
float stars(vec3 dir) {
|
|
856
|
+
// \u0421\u0435\u0442\u043A\u0430 \u043F\u043E \u043D\u0430\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u044E; \u0447\u0435\u043C \u043C\u0435\u043B\u044C\u0447\u0435 \u044F\u0447\u0435\u0439\u043A\u0430, \u0442\u0435\u043C \u043F\u043B\u043E\u0442\u043D\u0435\u0435 \u0440\u043E\u0441\u0441\u044B\u043F\u044C.
|
|
857
|
+
vec3 g = dir * 90.0;
|
|
858
|
+
vec3 cell = floor(g);
|
|
859
|
+
float h = hash13(cell);
|
|
860
|
+
|
|
861
|
+
// \u041E\u0441\u0442\u0430\u0432\u043B\u044F\u0435\u043C \u0440\u0435\u0434\u043A\u0438\u0435 \u044F\u0447\u0435\u0439\u043A\u0438 \u2014 \u0438\u043D\u0430\u0447\u0435 \u043F\u043E\u043B\u0443\u0447\u0430\u0435\u0442\u0441\u044F \u0448\u0443\u043C, \u0430 \u043D\u0435 \u0437\u0432\u0451\u0437\u0434\u044B. \u041F\u043E\u0440\u043E\u0433 \u0438 \u0448\u0430\u0433
|
|
862
|
+
// \u0441\u0435\u0442\u043A\u0438 \u043F\u043E\u0434\u043E\u0431\u0440\u0430\u043D\u044B \u0442\u0430\u043A, \u0447\u0442\u043E\u0431\u044B \u0432 \u043A\u0430\u0434\u0440\u0435 \u0431\u044B\u043B\u0430 \u0432\u0438\u0434\u0438\u043C\u0430\u044F \u0440\u043E\u0441\u0441\u044B\u043F\u044C, \u043D\u043E \u043D\u0435 \xAB\u043C\u0430\u043D\u043A\u0430\xBB.
|
|
863
|
+
if (h < 0.982) return 0.0;
|
|
864
|
+
|
|
865
|
+
// \u0412\u043D\u0443\u0442\u0440\u0438 \u044F\u0447\u0435\u0439\u043A\u0438 \u0440\u0438\u0441\u0443\u0435\u043C \u0422\u041E\u0427\u041A\u0423, \u0430 \u043D\u0435 \u0437\u0430\u043B\u0438\u0432\u0430\u0435\u043C \u0435\u0451 \u0446\u0435\u043B\u0438\u043A\u043E\u043C: \u0437\u0430\u043B\u0438\u0442\u0430\u044F \u044F\u0447\u0435\u0439\u043A\u0430 \u0432\u0438\u0434\u043D\u0430
|
|
866
|
+
// \u043A\u0430\u043A \u043A\u0432\u0430\u0434\u0440\u0430\u0442\u0438\u043A, \u0438 \u043D\u0435\u0431\u043E \u0432\u044B\u0433\u043B\u044F\u0434\u0438\u0442 \u0431\u0438\u0442\u043E\u0439 \u0442\u0435\u043A\u0441\u0442\u0443\u0440\u043E\u0439.
|
|
867
|
+
vec3 centre = vec3(hash13(cell + 1.3), hash13(cell + 2.7), hash13(cell + 5.1));
|
|
868
|
+
float d = length(fract(g) - centre);
|
|
869
|
+
float point = smoothstep(0.34, 0.0, d);
|
|
870
|
+
|
|
871
|
+
// \u0420\u0430\u0437\u043D\u0430\u044F \u044F\u0440\u043A\u043E\u0441\u0442\u044C: \u043E\u0434\u0438\u043D\u0430\u043A\u043E\u0432\u044B\u0435 \u0442\u043E\u0447\u043A\u0438 \u0442\u043E\u0436\u0435 \u0447\u0438\u0442\u0430\u044E\u0442\u0441\u044F \u043A\u0430\u043A \u0431\u0440\u0430\u043A.
|
|
872
|
+
return point * (0.4 + 0.6 * fract(h * 91.7));
|
|
873
|
+
}
|
|
874
|
+
|
|
875
|
+
void main() {
|
|
876
|
+
float above = gl_FragCoord.y - u_sky_params.x;
|
|
877
|
+
// \u041D\u0438\u0436\u0435 \u0433\u043E\u0440\u0438\u0437\u043E\u043D\u0442\u0430 \u2014 \u0447\u0438\u0441\u0442\u044B\u0439 \u0446\u0432\u0435\u0442 \u0434\u044B\u043C\u043A\u0438; \u0432\u044B\u0448\u0435 \u2014 \u043F\u043B\u0430\u0432\u043D\u044B\u0439 \u043F\u0435\u0440\u0435\u0445\u043E\u0434 \u043A \u0437\u0435\u043D\u0438\u0442\u0443.
|
|
878
|
+
float t = clamp(above / max(u_sky_params.y, 1.0), 0.0, 1.0);
|
|
879
|
+
// \u041A\u0432\u0430\u0434\u0440\u0430\u0442: \u0443 \u0433\u043E\u0440\u0438\u0437\u043E\u043D\u0442\u0430 \u043F\u043E\u043B\u043E\u0441\u0430 \u0441\u0432\u0435\u0442\u043B\u0435\u0435 \u0438 \u0443\u0436\u0435, \u043A\u0430\u043A \u0432 \u0436\u0438\u0437\u043D\u0438
|
|
880
|
+
vec3 sky = mix(u_horizon_color, u_sky_color, t * t);
|
|
881
|
+
|
|
882
|
+
// \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.
|
|
883
|
+
//
|
|
884
|
+
// \u0414\u044B\u043C\u043A\u0430 \u043F\u043E\u0434 \u0433\u043E\u0440\u0438\u0437\u043E\u043D\u0442\u043E\u043C \u043D\u0443\u0436\u043D\u0430 \u0440\u043E\u0432\u043D\u043E \u0437\u0430\u0442\u0435\u043C, \u0447\u0442\u043E\u0431\u044B \u0441\u043F\u0440\u044F\u0442\u0430\u0442\u044C \u043A\u0440\u0430\u0439 \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043D\u043D\u043E\u0439
|
|
885
|
+
// \u0437\u0435\u043C\u043B\u0438; \u0434\u0430\u043B\u044C\u0448\u0435 \u0432\u043D\u0438\u0437 \u043F\u043E\u0434 \u043D\u0435\u0439 \u0443\u0436\u0435 \u0433\u043E\u0440\u043E\u0434. \u041F\u043E\u043A\u0430 \u043E\u043D\u0430 \u043A\u0440\u0430\u0441\u0438\u043B\u0430 \u0432\u0435\u0441\u044C \u043D\u0438\u0437 \u044D\u043A\u0440\u0430\u043D\u0430,
|
|
886
|
+
// \u0445\u043E\u043B\u043E\u0434\u043D\u044B\u0439 \u0446\u0432\u0435\u0442 \u043D\u0435\u0431\u0430 \u043F\u0440\u043E\u0441\u0442\u0443\u043F\u0430\u043B \u0432 \u043A\u0430\u0436\u0434\u043E\u0439 \u043F\u0440\u043E\u0440\u0435\u0445\u0435 \u0434\u0430\u043D\u043D\u044B\u0445 \u2014 \u0430 \u043F\u0440\u043E\u0440\u0435\u0445 \u0443 \u043A\u0430\u0440\u0442\u044B
|
|
887
|
+
// \u0434\u043E\u0441\u0442\u0430\u0442\u043E\u0447\u043D\u043E: \u0434\u0430\u043B\u0435\u043A\u043E \u043D\u0435 \u0432\u0441\u044F\u043A\u0438\u0439 \u0434\u0432\u043E\u0440 \u043E\u043F\u0438\u0441\u0430\u043D \u043F\u043E\u043B\u0438\u0433\u043E\u043D\u043E\u043C. \u0421\u043C\u043E\u0442\u0440\u0435\u043B\u043E\u0441\u044C \u044D\u0442\u043E \u043A\u0430\u043A
|
|
888
|
+
// \u0441\u0438\u043D\u0435\u0432\u0430\u0442\u0430\u044F \u0437\u0430\u043B\u0438\u0432\u043A\u0430 \u0432\u043C\u0435\u0441\u0442\u043E \u0444\u043E\u043D\u0430 \u043A\u0430\u0440\u0442\u044B. \u0420\u0430\u0441\u0442\u0432\u043E\u0440\u044F\u0435\u043C \u2014 \u0438 \u0441\u043D\u0438\u0437\u0443 \u043E\u0441\u0442\u0430\u0451\u0442\u0441\u044F \u0442\u043E,
|
|
889
|
+
// \u0447\u0435\u043C \u043E\u0447\u0438\u0449\u0435\u043D \u043A\u0430\u0434\u0440, \u0442\u043E \u0435\u0441\u0442\u044C \u0444\u043E\u043D \u0441\u0442\u0438\u043B\u044F.
|
|
890
|
+
float alpha = 1.0 - clamp(-above / max(u_sky_params.z, 1.0), 0.0, 1.0);
|
|
891
|
+
|
|
892
|
+
if (u_space.x > 0.001) {
|
|
893
|
+
vec3 dir = normalize(v_ray);
|
|
894
|
+
// \u0423\u0433\u043B\u043E\u0432\u043E\u0435 \u0440\u0430\u0441\u0441\u0442\u043E\u044F\u043D\u0438\u0435 \u043E\u0442 \u043A\u0440\u0430\u044F \u0434\u0438\u0441\u043A\u0430 \u043F\u043B\u0430\u043D\u0435\u0442\u044B: <0 \u0432\u043D\u0443\u0442\u0440\u0438, >0 \u0432 \u043A\u043E\u0441\u043C\u043E\u0441\u0435.
|
|
895
|
+
float ang = acos(clamp(dot(dir, u_globe_disc.xyz), -1.0, 1.0));
|
|
896
|
+
float edge = max(ang - u_globe_disc.w, 0.0);
|
|
897
|
+
|
|
898
|
+
// \u041A\u0430\u0439\u043C\u0430 \u0441\u043F\u0430\u0434\u0430\u0435\u0442 \u044D\u043A\u0441\u043F\u043E\u043D\u0435\u043D\u0442\u043E\u0439 \u2014 \u0442\u0430\u043A \u0436\u0435, \u043A\u0430\u043A \u0434\u044B\u043C\u043A\u0430 \u0443 Mapbox. \u0428\u0438\u0440\u0438\u043D\u0430 \u0432\u0437\u044F\u0442\u0430 \u0432
|
|
899
|
+
// \u0434\u043E\u043B\u044F\u0445 \u0443\u0433\u043B\u043E\u0432\u043E\u0433\u043E \u0440\u0430\u0434\u0438\u0443\u0441\u0430 \u043F\u043B\u0430\u043D\u0435\u0442\u044B, \u043F\u043E\u044D\u0442\u043E\u043C\u0443 \u043D\u0430 \u043B\u044E\u0431\u043E\u043C \u0437\u0443\u043C\u0435 \u043E\u043D\u0430 \u0432\u044B\u0433\u043B\u044F\u0434\u0438\u0442 \u043E\u0434\u0438\u043D\u0430\u043A\u043E\u0432\u043E.
|
|
900
|
+
float halo = exp(-edge / max(u_globe_disc.w * 0.16, 1e-4));
|
|
901
|
+
|
|
902
|
+
vec3 space = u_space_color + vec3(stars(dir) * u_space.y);
|
|
903
|
+
vec3 outer = mix(space, u_atmo_color, clamp(halo, 0.0, 1.0));
|
|
904
|
+
|
|
905
|
+
// \u041D\u0430 \u043F\u0435\u0440\u0435\u0445\u043E\u0434\u0435 \u043A \u043F\u043B\u043E\u0441\u043A\u043E\u0439 \u043A\u0430\u0440\u0442\u0435 \u043A\u043E\u0441\u043C\u043E\u0441 \u0443\u0441\u0442\u0443\u043F\u0430\u0435\u0442 \u043E\u0431\u044B\u0447\u043D\u043E\u043C\u0443 \u043D\u0435\u0431\u0443.
|
|
906
|
+
sky = mix(sky, outer, u_space.x);
|
|
907
|
+
}
|
|
908
|
+
|
|
909
|
+
// \u041D\u0430 \u0433\u043B\u043E\u0431\u0443\u0441\u0435 \u043D\u0438\u0437\u0430 \u044D\u043A\u0440\u0430\u043D\u0430 \u043A\u0430\u043A \u0442\u0430\u043A\u043E\u0432\u043E\u0433\u043E \u043D\u0435\u0442: \u0442\u0430\u043C \u043A\u043E\u0441\u043C\u043E\u0441, \u0438 \u043E\u043D \u0434\u043E\u043B\u0436\u0435\u043D \u0437\u0430\u043A\u0440\u044B\u0432\u0430\u0442\u044C
|
|
910
|
+
// \u043A\u0430\u0434\u0440 \u0446\u0435\u043B\u0438\u043A\u043E\u043C \u2014 \u0442\u0435\u043B\u043E \u043F\u043B\u0430\u043D\u0435\u0442\u044B \u0440\u0438\u0441\u0443\u0435\u0442\u0441\u044F \u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0438\u043C \u043F\u0440\u043E\u0445\u043E\u0434\u043E\u043C \u043F\u043E\u0432\u0435\u0440\u0445.
|
|
911
|
+
if (u_space.x > 0.001) alpha = 1.0;
|
|
912
|
+
|
|
913
|
+
fragColor = vec4(sky * alpha, alpha);
|
|
914
|
+
}
|
|
915
|
+
`,Sa=`#version 300 es
|
|
916
|
+
precision highp float;
|
|
917
|
+
|
|
918
|
+
in vec2 a_pos; // \u0443\u0433\u043E\u043B \u043A\u0432\u0430\u0434\u0440\u0430\u0442\u0430 \u0442\u0430\u0439\u043B\u0430, 0..1
|
|
919
|
+
|
|
920
|
+
uniform mat4 u_matrix;
|
|
921
|
+
// xy \u2014 \u0441\u0434\u0432\u0438\u0433, z \u2014 \u043C\u0430\u0441\u0448\u0442\u0430\u0431 \u0442\u0435\u043A\u0441\u0442\u0443\u0440\u043D\u043E\u0439 \u043A\u043E\u043E\u0440\u0434\u0438\u043D\u0430\u0442\u044B. \u041F\u043E\u043A\u0430 \u0441\u0432\u043E\u0439 \u0442\u0430\u0439\u043B \u0433\u0440\u0443\u0437\u0438\u0442\u0441\u044F, \u043D\u0430 \u0435\u0433\u043E
|
|
922
|
+
// \u043C\u0435\u0441\u0442\u043E \u0440\u0438\u0441\u0443\u0435\u0442\u0441\u044F \u041A\u0423\u0421\u041E\u041A \u043F\u0440\u0435\u0434\u043A\u0430, \u0438 \u043B\u043E\u0441\u043A\u0443\u0442 \u0431\u0435\u0440\u0451\u0442\u0441\u044F \u043E\u0442\u0441\u044E\u0434\u0430; \u0443 \u0441\u0432\u043E\u0435\u0433\u043E \u0442\u0430\u0439\u043B\u0430 \u044D\u0442\u043E (0,0,1).
|
|
923
|
+
uniform vec3 u_uv_transform;
|
|
924
|
+
|
|
925
|
+
out vec2 v_uv;
|
|
926
|
+
|
|
927
|
+
void main() {
|
|
928
|
+
// \u041F\u0435\u0440\u0435\u0432\u043E\u0440\u0430\u0447\u0438\u0432\u0430\u0442\u044C Y \u043D\u0435 \u043D\u0443\u0436\u043D\u043E: \u0443 \u0442\u0430\u0439\u043B\u0430 \u043D\u0430\u0447\u0430\u043B\u043E \u043D\u0430 \u0441\u0435\u0432\u0435\u0440\u0435, \u0438 \u043F\u0435\u0440\u0432\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430
|
|
929
|
+
// \u043A\u0430\u0440\u0442\u0438\u043D\u043A\u0438, \u0443\u0445\u043E\u0434\u044F\u0449\u0430\u044F \u0432 texImage2D, \u2014 \u0442\u043E\u0436\u0435 \u0441\u0435\u0432\u0435\u0440\u043D\u0430\u044F.
|
|
930
|
+
v_uv = u_uv_transform.xy + a_pos * u_uv_transform.z;
|
|
931
|
+
gl_Position = u_matrix * vec4(a_pos, 0.0, 1.0);
|
|
932
|
+
}
|
|
933
|
+
`,La=`#version 300 es
|
|
934
|
+
precision highp float;
|
|
935
|
+
|
|
936
|
+
${Xe}
|
|
937
|
+
|
|
938
|
+
in vec2 v_uv;
|
|
939
|
+
|
|
940
|
+
uniform sampler2D u_image;
|
|
941
|
+
uniform float u_opacity;
|
|
942
|
+
|
|
943
|
+
out vec4 fragColor;
|
|
944
|
+
|
|
945
|
+
void main() {
|
|
946
|
+
vec4 color = texture(u_image, v_uv);
|
|
947
|
+
// \u0414\u044B\u043C\u043A\u0443 \u043F\u043E\u0434\u043B\u043E\u0436\u043A\u0430 \u0431\u0435\u0440\u0451\u0442 \u043D\u0430\u0440\u0430\u0432\u043D\u0435 \u0441 \u0432\u0435\u043A\u0442\u043E\u0440\u043D\u043E\u0439 \u0437\u0435\u043C\u043B\u0451\u0439: \u0438\u043D\u0430\u0447\u0435 \u043D\u0430 \u043D\u0430\u043A\u043B\u043E\u043D\u0451\u043D\u043D\u043E\u0439
|
|
948
|
+
// \u043A\u0430\u043C\u0435\u0440\u0435 \u0434\u0430\u043B\u0451\u043A\u0438\u0439 \u0440\u0430\u0441\u0442\u0440 \u043E\u0441\u0442\u0430\u0451\u0442\u0441\u044F \u0447\u0451\u0442\u043A\u0438\u043C \u0442\u0430\u043C, \u0433\u0434\u0435 \u0432\u0441\u0451 \u043E\u0441\u0442\u0430\u043B\u044C\u043D\u043E\u0435 \u0443\u0436\u0435 \u0437\u0430\u0442\u044F\u043D\u0443\u0442\u043E.
|
|
949
|
+
fragColor = applyFogPremultiplied(vec4(color.rgb * color.a, color.a)) * u_opacity;
|
|
950
|
+
}
|
|
951
|
+
`,Ha=`#version 300 es
|
|
952
|
+
precision highp float;
|
|
953
|
+
in vec2 a_pos; // \u0443\u0433\u043E\u043B \u043A\u0432\u0430\u0434\u0440\u0430\u0442\u0430 \u0442\u0430\u0439\u043B\u0430, 0..1
|
|
954
|
+
uniform mat4 u_matrix;
|
|
955
|
+
uniform mat4 u_shadow_matrix;
|
|
956
|
+
out vec4 v_shadow;
|
|
957
|
+
void main() {
|
|
958
|
+
vec4 local = vec4(a_pos, 0.0, 1.0);
|
|
959
|
+
gl_Position = u_matrix * local;
|
|
960
|
+
v_shadow = u_shadow_matrix * local;
|
|
961
|
+
}
|
|
962
|
+
`,Ta=`#version 300 es
|
|
963
|
+
precision highp float;
|
|
964
|
+
|
|
965
|
+
${zo}
|
|
966
|
+
${Xe}
|
|
967
|
+
|
|
968
|
+
uniform vec3 u_shadow_ground; // \u0432\u043E \u0447\u0442\u043E \u043F\u0440\u0435\u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044F \u043E\u0441\u0432\u0435\u0449\u0451\u043D\u043D\u044B\u0439 \u0446\u0432\u0435\u0442 \u0432 \u0442\u0435\u043D\u0438
|
|
969
|
+
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
|
|
970
|
+
out vec4 fragColor;
|
|
971
|
+
|
|
972
|
+
void main() {
|
|
973
|
+
// \u0414\u044B\u043C\u043A\u0430 \u0433\u0430\u0441\u0438\u0442 \u0438 \u0442\u0435\u043D\u044C: \u0432 \u0437\u0430\u0442\u044F\u043D\u0443\u0442\u043E\u0439 \u0434\u0430\u043B\u0438 \u0442\u0435\u043D\u0435\u0439 \u043D\u0435 \u0432\u0438\u0434\u043D\u043E, \u0438 \u043E\u0441\u0442\u0430\u0432\u043B\u0435\u043D\u043D\u0430\u044F \u0442\u0430\u043C
|
|
974
|
+
// \u0442\u0435\u043D\u044C \u0447\u0438\u0442\u0430\u043B\u0430\u0441\u044C \u0431\u044B \u043A\u0430\u043A \u0433\u0440\u044F\u0437\u043D\u043E\u0435 \u043F\u044F\u0442\u043D\u043E \u043F\u043E\u0432\u0435\u0440\u0445 \u0440\u043E\u0432\u043D\u043E\u0439 \u0434\u044B\u043C\u043A\u0438.
|
|
975
|
+
float occlusion = shadowOcclusion(u_ground_ndotl) * (1.0 - fogAmount());
|
|
976
|
+
fragColor = vec4(mix(vec3(1.0), u_shadow_ground, occlusion), 1.0);
|
|
977
|
+
}
|
|
978
|
+
`,Pa=`#version 300 es
|
|
979
|
+
precision highp float;
|
|
980
|
+
|
|
981
|
+
${Ba}
|
|
982
|
+
|
|
983
|
+
in vec2 a_pos;
|
|
984
|
+
uniform mat4 u_matrix;
|
|
985
|
+
uniform float u_meters_per_unit; // \u0435\u0434\u0438\u043D\u0438\u0446\u0430 \u0442\u0430\u0439\u043B\u0430 \u2192 \u043C\u0435\u0442\u0440\u044B, \u0434\u043B\u044F \u043C\u0430\u0442\u0435\u0440\u0438\u0430\u043B\u0430
|
|
986
|
+
/** \u041D\u0430\u0447\u0430\u043B\u043E \u0442\u0430\u0439\u043B\u0430 \u0432 \u043C\u0435\u0442\u0440\u0430\u0445: \u0431\u0435\u0437 \u043D\u0435\u0433\u043E \u0440\u0438\u0441\u0443\u043D\u043E\u043A \u043D\u0430\u0447\u0438\u043D\u0430\u0435\u0442\u0441\u044F \u0437\u0430\u043D\u043E\u0432\u043E \u043D\u0430 \u043A\u0430\u0436\u0434\u043E\u043C \u0448\u0432\u0435. */
|
|
987
|
+
uniform vec2 u_world_origin;
|
|
988
|
+
|
|
989
|
+
out vec2 v_world;
|
|
990
|
+
|
|
991
|
+
void main() {
|
|
992
|
+
// \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
|
|
993
|
+
// \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.
|
|
994
|
+
gl_Position = u_globe.x > 0.5
|
|
995
|
+
? u_matrix * vec4(globeLocal(a_pos), 1.0)
|
|
996
|
+
: u_matrix * vec4(a_pos, 0.0, 1.0);
|
|
997
|
+
|
|
998
|
+
// \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
|
|
999
|
+
// \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
|
|
1000
|
+
// \u043D\u0435 \u043F\u043E\u043F\u0430\u0434\u0430\u043B \u2014 \u0443 \u043B\u0438\u043D\u0438\u0439 \u0438 \u043F\u043E\u0432\u0435\u0440\u0445\u043D\u043E\u0441\u0442\u0435\u0439 \u044D\u0442\u043E \u0441\u0434\u0435\u043B\u0430\u043D\u043E, \u0443 \u0437\u0430\u043B\u0438\u0432\u043A\u0438 \u0437\u0430\u0431\u044B\u043B\u043E\u0441\u044C.
|
|
1001
|
+
v_world = u_world_origin + a_pos * u_meters_per_unit;
|
|
1002
|
+
}
|
|
1003
|
+
`,ka=`#version 300 es
|
|
1004
|
+
precision highp float;
|
|
1005
|
+
|
|
1006
|
+
${Xe}
|
|
1007
|
+
${Jt}
|
|
1008
|
+
${Jr}
|
|
1009
|
+
|
|
1010
|
+
in vec2 v_world;
|
|
1011
|
+
|
|
1012
|
+
uniform vec4 u_color;
|
|
1013
|
+
out vec4 fragColor;
|
|
1014
|
+
void main() {
|
|
1015
|
+
// \u0422\u0435\u043D\u0438 \u0437\u0434\u0435\u0441\u044C \u043D\u0435\u0442 \u043D\u0430\u043C\u0435\u0440\u0435\u043D\u043D\u043E: \u043D\u0430 \u0437\u0435\u043C\u043B\u044E \u043E\u043D\u0438 \u043A\u043B\u0430\u0434\u0443\u0442\u0441\u044F \u041E\u0414\u041D\u0418\u041C \u043F\u0440\u043E\u0445\u043E\u0434\u043E\u043C \u043F\u043E\u0432\u0435\u0440\u0445 \u0432\u0441\u0435\u0439
|
|
1016
|
+
// \u043F\u043B\u043E\u0441\u043A\u043E\u0439 \u0433\u0440\u0430\u0444\u0438\u043A\u0438 (GROUND_SHADOW). \u0418\u043D\u0430\u0447\u0435 \u0432\u044B\u0431\u043E\u0440\u043A\u0443 \u0438\u0437 \u043A\u0430\u0440\u0442\u044B \u0442\u0435\u043D\u0435\u0439 \u043F\u0440\u0438\u0448\u043B\u043E\u0441\u044C \u0431\u044B
|
|
1017
|
+
// \u0434\u0435\u043B\u0430\u0442\u044C \u0432 \u043A\u0430\u0436\u0434\u043E\u043C \u0444\u0440\u0430\u0433\u043C\u0435\u043D\u0442\u0435 \u043A\u0430\u0436\u0434\u043E\u0433\u043E \u0441\u043B\u043E\u044F \u2014 \u0430 \u0441\u043B\u043E\u0451\u0432 \u0437\u0435\u043C\u043B\u0438 \u0442\u0440\u0438 \u0434\u0435\u0441\u044F\u0442\u043A\u0430, \u0438 \u043E\u043D\u0438
|
|
1018
|
+
// \u043F\u0435\u0440\u0435\u043A\u0440\u044B\u0432\u0430\u044E\u0442\u0441\u044F. \u041F\u0440\u0438\u0451\u043C \u0432\u0437\u044F\u0442 \u0443 Mapbox (ground_shadow + \u0443\u043C\u043D\u043E\u0436\u0430\u044E\u0449\u0438\u0439 \u0431\u043B\u0435\u043D\u0434\u0438\u043D\u0433).
|
|
1019
|
+
// \u041C\u0430\u0442\u0435\u0440\u0438\u0430\u043B (\u0432\u043E\u0434\u0430, \u0437\u0435\u043B\u0435\u043D\u044C, \u043F\u0435\u0441\u043E\u043A, \u0430\u0441\u0444\u0430\u043B\u044C\u0442) \u043F\u0440\u0430\u0432\u0438\u0442 \u0422\u041E\u041B\u042C\u041A\u041E \u0446\u0432\u0435\u0442: \u0430\u043B\u044C\u0444\u0430 \u043E\u0441\u0442\u0430\u0451\u0442\u0441\u044F
|
|
1020
|
+
// \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.
|
|
1021
|
+
vec4 c = u_color;
|
|
1022
|
+
if (u_material != 0) c.rgb = applyMaterial(c.rgb, v_world);
|
|
1023
|
+
fragColor = applyFogPremultiplied(c);
|
|
1024
|
+
}
|
|
1025
|
+
`,Ga=`#version 300 es
|
|
1026
|
+
precision highp float;
|
|
1027
|
+
|
|
1028
|
+
${Ba}
|
|
1029
|
+
|
|
1030
|
+
in vec2 a_p0; // \u043D\u0430\u0447\u0430\u043B\u043E \u043E\u0442\u0440\u0435\u0437\u043A\u0430 (\u043E\u0434\u0438\u043D\u0430\u043A\u043E\u0432\u043E \u0443 \u0432\u0441\u0435\u0445 \u0432\u0435\u0440\u0448\u0438\u043D \u043A\u0430\u043F\u0441\u0443\u043B\u044B)
|
|
1031
|
+
in vec2 a_p1; // \u043A\u043E\u043D\u0435\u0446 \u043E\u0442\u0440\u0435\u0437\u043A\u0430
|
|
1032
|
+
in vec2 a_corner; // x: 0 \u2014 \u0432\u0435\u0440\u0448\u0438\u043D\u0430 \u0443 p0, 1 \u2014 \u0443 p1; y: \u0441\u0442\u043E\u0440\u043E\u043D\u0430 \xB11
|
|
1033
|
+
/**
|
|
1034
|
+
* \u0423\u0440\u043E\u0432\u0435\u043D\u044C \u043F\u043E\u0432\u0435\u0440\u0445\u043D\u043E\u0441\u0442\u0438 \u041F\u041E\u0414 \u0434\u043E\u0440\u043E\u0433\u043E\u0439 \u0443 \u043E\u0431\u043E\u0438\u0445 \u043A\u043E\u043D\u0446\u043E\u0432 \u043E\u0442\u0440\u0435\u0437\u043A\u0430, \u0441\u0430\u043D\u0442\u0438\u043C\u0435\u0442\u0440\u044B (\u0441\u043C. generators/ground).
|
|
1035
|
+
*
|
|
1036
|
+
* \u0410\u0442\u0440\u0438\u0431\u0443\u0442, \u0430 \u043D\u0435 \u044E\u043D\u0438\u0444\u043E\u0440\u043C: \u043E\u0434\u043D\u0430 \u0438 \u0442\u0430 \u0436\u0435 \u0434\u043E\u0440\u043E\u0433\u0430 \u0437\u0430\u0435\u0437\u0436\u0430\u0435\u0442 \u043D\u0430 \u043F\u0430\u0440\u043A\u043E\u0432\u043A\u0443 \u0438 \u0441\u044A\u0435\u0437\u0436\u0430\u0435\u0442 \u0441 \u043D\u0435\u0451, \u0438 \u0432\u044B\u0441\u043E\u0442\u0430 \u0443 \u043D\u0435\u0451
|
|
1037
|
+
* \u0441\u0432\u043E\u044F \u0432 \u043A\u0430\u0436\u0434\u043E\u0439 \u0442\u043E\u0447\u043A\u0435. \u041A\u0430\u0436\u0434\u0430\u044F \u0432\u0435\u0440\u0448\u0438\u043D\u0430 \u0431\u0435\u0440\u0451\u0442 \u0443\u0440\u043E\u0432\u0435\u043D\u044C \u0441\u0432\u043E\u0435\u0433\u043E \u043A\u043E\u043D\u0446\u0430, \u0430 \u043F\u043E\u0434\u044A\u0451\u043C \u043C\u0435\u0436\u0434\u0443 \u043D\u0438\u043C\u0438 \u0440\u0430\u0441\u0442\u044F\u0433\u0438\u0432\u0430\u0435\u0442
|
|
1038
|
+
* \u0440\u0430\u0441\u0442\u0435\u0440\u0438\u0437\u0430\u0446\u0438\u044F \u2014 \u043F\u043E\u043B\u0443\u0447\u0430\u0435\u0442\u0441\u044F \u043F\u0430\u043D\u0434\u0443\u0441, \u0430 \u043D\u0435 \u0441\u0442\u0443\u043F\u0435\u043D\u044C\u043A\u0430.
|
|
1039
|
+
*/
|
|
1040
|
+
in vec2 a_ground;
|
|
1041
|
+
in float a_dist; // \u0440\u0430\u0441\u0441\u0442\u043E\u044F\u043D\u0438\u0435 \u043E\u0442 \u043D\u0430\u0447\u0430\u043B\u0430 \u043B\u0438\u043D\u0438\u0438 \u0434\u043E p0, \u0435\u0434\u0438\u043D\u0438\u0446\u044B \u0442\u0430\u0439\u043B\u0430
|
|
1042
|
+
|
|
1043
|
+
uniform mat4 u_matrix;
|
|
1044
|
+
/** \u041F\u043E\u043B\u0443\u0448\u0438\u0440\u0438\u043D\u0430 \u0438 \u0441\u0434\u0432\u0438\u0433 \u0432 \u0415\u0414\u0418\u041D\u0418\u0426\u0410\u0425 \u0422\u0410\u0419\u041B\u0410 \u2014 \u0442\u043E \u0435\u0441\u0442\u044C \u0432 \u043F\u043B\u043E\u0441\u043A\u043E\u0441\u0442\u0438 \u0437\u0435\u043C\u043B\u0438. */
|
|
1045
|
+
uniform float u_half_width;
|
|
1046
|
+
in float a_width; // \u0448\u0438\u0440\u0438\u043D\u0430 \u043E\u0431\u044A\u0435\u043A\u0442\u0430 \u0432 \u041C\u0415\u0422\u0420\u0410\u0425 \u0438\u0437 \u0442\u0430\u0439\u043B\u0430; 0 \u2014 \u043D\u0435 \u0437\u0430\u0434\u0430\u043D\u0430
|
|
1047
|
+
uniform float u_meters_to_units; // \u043C\u0435\u0442\u0440\u044B \u2192 \u0435\u0434\u0438\u043D\u0438\u0446\u044B \u0442\u0430\u0439\u043B\u0430 \u043D\u0430 \u0442\u0435\u043A\u0443\u0449\u0435\u043C \u0437\u0443\u043C\u0435
|
|
1048
|
+
uniform float u_width_from_data; // 1 \u2014 \u0441\u043B\u043E\u044E \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043D\u043E \u0431\u0440\u0430\u0442\u044C \u0448\u0438\u0440\u0438\u043D\u0443 \u0438\u0437 \u0434\u0430\u043D\u043D\u044B\u0445
|
|
1049
|
+
uniform float u_width_extra; // \u043F\u0440\u0438\u0431\u0430\u0432\u043A\u0430 \u043A \u043F\u043E\u043B\u0443\u0448\u0438\u0440\u0438\u043D\u0435, \u0435\u0434\u0438\u043D\u0438\u0446\u044B \u0442\u0430\u0439\u043B\u0430 (\u043E\u0431\u0432\u043E\u0434\u043A\u0430 \u0434\u043E\u0440\u043E\u0433\u0438)
|
|
1050
|
+
out float v_half_width; // \u043E\u0442\u0434\u0430\u0451\u043C \u0432\u043E \u0444\u0440\u0430\u0433\u043C\u0435\u043D\u0442: \u043F\u0443\u043D\u043A\u0442\u0438\u0440 \u0441\u0447\u0438\u0442\u0430\u0435\u0442 \u0442\u043E\u043B\u0449\u0438\u043D\u0443 \u0441\u0430\u043C
|
|
1051
|
+
uniform float u_offset;
|
|
1052
|
+
/** \u0415\u0434\u0438\u043D\u0438\u0446 \u0442\u0430\u0439\u043B\u0430 \u0432 \u043F\u0438\u043A\u0441\u0435\u043B\u0435 \u043D\u0430 \u0443\u0440\u043E\u0432\u043D\u0435 \u0446\u0435\u043D\u0442\u0440\u0430 \u043A\u0430\u0440\u0442\u044B \u2014 \u0437\u0430\u043F\u0430\u0441 \u043D\u0430 \u0441\u0433\u043B\u0430\u0436\u0438\u0432\u0430\u043D\u0438\u0435. */
|
|
1053
|
+
uniform float u_tile_per_px;
|
|
1054
|
+
uniform float u_center_w; // w \u043A\u043B\u0438\u043F\u0430 \u0432 \u0446\u0435\u043D\u0442\u0440\u0435 \u043A\u0430\u0440\u0442\u044B \u2014 \u044D\u0442\u0430\u043B\u043E\u043D \u0433\u043B\u0443\u0431\u0438\u043D\u044B
|
|
1055
|
+
|
|
1056
|
+
uniform float u_tile_to_px; // \u0435\u0434\u0438\u043D\u0438\u0446\u044B \u0442\u0430\u0439\u043B\u0430 \u2192 \u043F\u0438\u043A\u0441\u0435\u043B\u0438, \u0434\u043B\u044F \u0440\u0438\u0441\u0443\u043D\u043A\u0430 \u0432\u0434\u043E\u043B\u044C \u043B\u0438\u043D\u0438\u0438
|
|
1057
|
+
uniform float u_meters_per_unit; // \u0435\u0434\u0438\u043D\u0438\u0446\u0430 \u0442\u0430\u0439\u043B\u0430 \u2192 \u043C\u0435\u0442\u0440\u044B, \u0434\u043B\u044F \u043C\u0430\u0442\u0435\u0440\u0438\u0430\u043B\u0430
|
|
1058
|
+
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
|
|
1059
|
+
/**
|
|
1060
|
+
* \u0423\u0440\u043E\u0432\u0435\u043D\u044C \u043F\u043E\u043B\u043E\u0442\u043D\u0430 \u0432 \u043C\u0435\u0442\u0440\u0430\u0445. \u042E\u043D\u0438\u0444\u043E\u0440\u043C, \u0430 \u043D\u0435 \u0430\u0442\u0440\u0438\u0431\u0443\u0442: \u043E\u043D \u043E\u0434\u0438\u043D \u043D\u0430 \u0441\u043B\u043E\u0439, \u0433\u0435\u043E\u043C\u0435\u0442\u0440\u0438\u044E
|
|
1061
|
+
* \u043F\u0435\u0440\u0435\u0441\u043E\u0431\u0438\u0440\u0430\u0442\u044C \u043D\u0435\u0437\u0430\u0447\u0435\u043C \u2014 \u0438 \u043F\u043E\u044D\u0442\u043E\u043C\u0443 \u0434\u043E\u0440\u043E\u0433\u0443 \u043C\u043E\u0436\u043D\u043E \u043F\u043E\u0434\u043D\u044F\u0442\u044C \u0438\u043B\u0438 \u043E\u043F\u0443\u0441\u0442\u0438\u0442\u044C \u043D\u0430 \u043B\u0435\u0442\u0443.
|
|
1062
|
+
*/
|
|
1063
|
+
uniform float u_elevation;
|
|
1064
|
+
/** \u041C\u043D\u043E\u0436\u0438\u0442\u0435\u043B\u044C \u0440\u0435\u043B\u044C\u0435\u0444\u0430: \u0438\u043C \u0436\u0435 \u043F\u0440\u0438\u0436\u0438\u043C\u0430\u0435\u0442\u0441\u044F \u0432\u044B\u0441\u043E\u0442\u0430 \u043F\u043E\u0432\u0435\u0440\u0445\u043D\u043E\u0441\u0442\u0435\u0439, \u0438 \u043F\u043E\u0434\u044A\u0451\u043C \u0434\u043E\u0440\u043E\u0433\u0438 \u043E\u0431\u044F\u0437\u0430\u043D \u0438\u0434\u0442\u0438 \u0441 \u043D\u0438\u043C\u0438. */
|
|
1065
|
+
uniform float u_relief;
|
|
1066
|
+
|
|
1067
|
+
/** \u041F\u043E\u0437\u0438\u0446\u0438\u044F \u0444\u0440\u0430\u0433\u043C\u0435\u043D\u0442\u0430 \u0438 \u043A\u043E\u043D\u0446\u044B \u043E\u0442\u0440\u0435\u0437\u043A\u0430 \u2014 \u0432\u0441\u0451 \u0432 \u0435\u0434\u0438\u043D\u0438\u0446\u0430\u0445 \u0442\u0430\u0439\u043B\u0430. */
|
|
1068
|
+
out vec2 v_pos;
|
|
1069
|
+
out vec2 v_p0;
|
|
1070
|
+
out vec2 v_p1;
|
|
1071
|
+
out float v_dist0; // \u043F\u0438\u043A\u0441\u0435\u043B\u0438 \u043E\u0442 \u043D\u0430\u0447\u0430\u043B\u0430 \u043B\u0438\u043D\u0438\u0438 \u0434\u043E p0
|
|
1072
|
+
out float v_seg_len; // \u0434\u043B\u0438\u043D\u0430 \u043E\u0442\u0440\u0435\u0437\u043A\u0430 \u0432 \u043F\u0438\u043A\u0441\u0435\u043B\u044F\u0445 \u0440\u0438\u0441\u0443\u043D\u043A\u0430
|
|
1073
|
+
/** \u041A\u043E\u043D\u0446\u044B \u043E\u0442\u0440\u0435\u0437\u043A\u0430 \u0432 \u041C\u0415\u0422\u0420\u0410\u0425 \u2014 \u043F\u043E \u043D\u0438\u043C \u043C\u0430\u0442\u0435\u0440\u0438\u0430\u043B \u0441\u0442\u0440\u043E\u0438\u0442 \u0440\u0438\u0441\u0443\u043D\u043E\u043A \u043F\u043E\u043B\u043E\u0442\u043D\u0430. */
|
|
1074
|
+
out vec2 v_world0;
|
|
1075
|
+
out vec2 v_world1;
|
|
1076
|
+
|
|
1077
|
+
void main() {
|
|
1078
|
+
bool globe = u_globe.x > 0.5;
|
|
1079
|
+
|
|
1080
|
+
// \u042D\u041A\u0421\u0422\u0420\u0423\u0417\u0418\u042F \u0418\u0414\u0401\u0422 \u0412 \u041F\u041B\u041E\u0421\u041A\u041E\u0421\u0422\u0418 \u0417\u0415\u041C\u041B\u0418, \u0430 \u043D\u0435 \u0432 \u043F\u043B\u043E\u0441\u043A\u043E\u0441\u0442\u0438 \u044D\u043A\u0440\u0430\u043D\u0430.
|
|
1081
|
+
//
|
|
1082
|
+
// \u0421\u043D\u0430\u0447\u0430\u043B\u0430 \u0431\u044B\u043B\u043E \u043D\u0430\u043E\u0431\u043E\u0440\u043E\u0442: \u043A\u0432\u0430\u0434 \u0440\u0430\u0437\u0434\u0443\u0432\u0430\u043B\u0441\u044F \u0432 \u044D\u043A\u0440\u0430\u043D\u043D\u044B\u0445 \u043F\u0438\u043A\u0441\u0435\u043B\u044F\u0445, \u0430 \u043F\u0435\u0440\u0441\u043F\u0435\u043A\u0442\u0438\u0432\u0430
|
|
1083
|
+
// \u0443\u0447\u0438\u0442\u044B\u0432\u0430\u043B\u0430\u0441\u044C \u043C\u043D\u043E\u0436\u0438\u0442\u0435\u043B\u0435\u043C \u0448\u0438\u0440\u0438\u043D\u044B. \u0422\u043E\u043B\u0449\u0438\u043D\u0430 \u043E\u0442 \u044D\u0442\u043E\u0433\u043E \u0441\u043E\u043A\u0440\u0430\u0449\u0430\u043B\u0430\u0441\u044C \u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u043E, \u0430
|
|
1084
|
+
// \u0432\u043E\u0442 \u041D\u0410\u041F\u0420\u0410\u0412\u041B\u0415\u041D\u0418\u0415 \u2014 \u043D\u0435\u0442: \u043B\u0435\u043D\u0442\u0430 \u043E\u0441\u0442\u0430\u0432\u0430\u043B\u0430\u0441\u044C \u0440\u0430\u0437\u0432\u0451\u0440\u043D\u0443\u0442\u043E\u0439 \u043A \u044D\u043A\u0440\u0430\u043D\u0443, \u0438 \u043F\u0440\u0438 \u043D\u0430\u043A\u043B\u043E\u043D\u0435
|
|
1085
|
+
// 75\xB0 \u0434\u043E\u0440\u043E\u0433\u0430, \u0438\u0434\u0443\u0449\u0430\u044F \u043F\u043E\u043F\u0435\u0440\u0451\u043A \u0432\u0437\u0433\u043B\u044F\u0434\u0430, \u0447\u0438\u0442\u0430\u043B\u0430\u0441\u044C \u0432\u0435\u0440\u0442\u0438\u043A\u0430\u043B\u044C\u043D\u043E\u0439 \u0441\u0442\u0435\u043D\u043E\u0439 \u0432\u043C\u0435\u0441\u0442\u043E
|
|
1086
|
+
// \u0443\u0437\u043A\u043E\u0439 \u043F\u043E\u043B\u043E\u0441\u044B. \u0422\u0430\u043A \u0436\u0435 \u0443\u0441\u0442\u0440\u043E\u0435\u043D\u043E \u0443 Mapbox (extrude * u_pixels_to_tile_units,
|
|
1087
|
+
// \u0438 \u0442\u043E\u043B\u044C\u043A\u043E \u043F\u043E\u0442\u043E\u043C \u043C\u0430\u0442\u0440\u0438\u0446\u0430): \u0448\u0438\u0440\u0438\u043D\u0430 \u0436\u0438\u0432\u0451\u0442 \u043D\u0430 \u0437\u0435\u043C\u043B\u0435, \u0430 \u0441\u043E\u043A\u0440\u0430\u0449\u0435\u043D\u0438\u0435 \u043F\u043E\u043B\u0443\u0447\u0430\u0435\u0442\u0441\u044F
|
|
1088
|
+
// \u0441\u0430\u043C\u043E \u0441\u043E\u0431\u043E\u0439 \u0438\u0437 \u043F\u0440\u043E\u0435\u043A\u0446\u0438\u0438.
|
|
1089
|
+
vec2 delta = a_p1 - a_p0;
|
|
1090
|
+
float len = length(delta);
|
|
1091
|
+
// \u041D\u0430\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u0435 \u041A\u0410\u041D\u041E\u041D\u0418\u0427\u0415\u0421\u041A\u041E\u0415 (p0 \u2192 p1), \u043E\u0434\u043D\u043E \u043D\u0430 \u0432\u0441\u044E \u043A\u0430\u043F\u0441\u0443\u043B\u0443: \u0435\u0441\u043B\u0438 \u0441\u0447\u0438\u0442\u0430\u0442\u044C \u0435\u0433\u043E
|
|
1092
|
+
// \xAB\u043D\u0430 \u0441\u043E\u0441\u0435\u0434\u0430\xBB, \u043D\u0430 \u0434\u0430\u043B\u044C\u043D\u0435\u043C \u043A\u043E\u043D\u0446\u0435 \u043F\u0435\u0440\u043F\u0435\u043D\u0434\u0438\u043A\u0443\u043B\u044F\u0440 \u043F\u0435\u0440\u0435\u0432\u0435\u0440\u043D\u0451\u0442\u0441\u044F \u0438 \u043A\u0432\u0430\u0434 \u0441\u043A\u0440\u0443\u0442\u0438\u0442\u0441\u044F.
|
|
1093
|
+
vec2 dir = len > 1e-6 ? delta / len : vec2(1.0, 0.0);
|
|
1094
|
+
vec2 perp = vec2(-dir.y, dir.x);
|
|
1095
|
+
|
|
1096
|
+
bool atEnd = a_corner.x > 0.5;
|
|
1097
|
+
vec2 base = atEnd ? a_p1 : a_p0;
|
|
1098
|
+
float alongSign = atEnd ? 1.0 : -1.0; // \u043D\u0430\u0440\u0443\u0436\u0443 \u043E\u0442 \u0441\u0432\u043E\u0435\u0433\u043E \u043A\u043E\u043D\u0446\u0430
|
|
1099
|
+
|
|
1100
|
+
// \u0412\u044B\u0441\u043E\u0442\u0430 = \u0443\u0440\u043E\u0432\u0435\u043D\u044C \u0437\u0435\u043C\u043B\u0438 \u043F\u043E\u0434 \u044D\u0442\u0438\u043C \u043A\u043E\u043D\u0446\u043E\u043C \u043F\u043B\u044E\u0441 \u043F\u0440\u0438\u0431\u0430\u0432\u043A\u0430 \u0441\u043B\u043E\u044F. \u0421\u0430\u043D\u0442\u0438\u043C\u0435\u0442\u0440\u044B \u2192 \u043C\u0435\u0442\u0440\u044B.
|
|
1101
|
+
float height = (atEnd ? a_ground.y : a_ground.x) * 0.01 * u_relief + u_elevation;
|
|
1102
|
+
|
|
1103
|
+
// \u0417\u0430\u043F\u0430\u0441 \u043D\u0430 \u0441\u0433\u043B\u0430\u0436\u0438\u0432\u0430\u043D\u0438\u0435 \u2014 \u0432 \u0435\u0434\u0438\u043D\u0438\u0446\u0430\u0445 \u0442\u0430\u0439\u043B\u0430, \u043D\u043E \u041D\u0410 \u0422\u041E\u0419 \u0416\u0415 \u0413\u041B\u0423\u0411\u0418\u041D\u0415: \u0434\u0430\u043B\u044C\u043D\u0438\u0439
|
|
1104
|
+
// \u043A\u043E\u043D\u0435\u0446 \u0437\u0430\u043D\u0438\u043C\u0430\u0435\u0442 \u043C\u0435\u043D\u044C\u0448\u0435 \u043F\u0438\u043A\u0441\u0435\u043B\u0435\u0439, \u0438 \u043F\u043E\u0441\u0442\u043E\u044F\u043D\u043D\u044B\u0439 \u0437\u0430\u043F\u0430\u0441 \u0442\u0430\u043C \u0431\u044B\u043B \u0431\u044B \u0432\u043F\u0443\u0441\u0442\u0443\u044E, \u0430
|
|
1105
|
+
// \u043D\u0430 \u0431\u043B\u0438\u0436\u043D\u0435\u043C \u2014 \u043D\u0435\u0434\u043E\u0441\u0442\u0430\u0442\u043E\u0447\u0435\u043D. \u0413\u043B\u0443\u0431\u0438\u043D\u0443 \u0431\u0435\u0440\u0451\u043C \u0447\u0435\u0440\u0435\u0437 w \u043A\u043B\u0438\u043F\u0430 \u0441\u0430\u043C\u043E\u0439 \u0442\u043E\u0447\u043A\u0438.
|
|
1106
|
+
vec4 clipBase = globe
|
|
1107
|
+
? u_matrix * vec4(globeLocal(base), 1.0)
|
|
1108
|
+
: u_matrix * vec4(base, height, 1.0);
|
|
1109
|
+
float depth = clamp(clipBase.w / max(u_center_w, 1e-6), 0.02, 40.0);
|
|
1110
|
+
float aa = u_tile_per_px * depth * 2.0;
|
|
1111
|
+
|
|
1112
|
+
/*
|
|
1113
|
+
* \u0428\u0418\u0420\u0418\u041D\u0410 \u0418\u0417 \u0414\u0410\u041D\u041D\u042B\u0425, \u0435\u0441\u043B\u0438 \u043E\u043D\u0430 \u0442\u0430\u043C \u0435\u0441\u0442\u044C.
|
|
1114
|
+
*
|
|
1115
|
+
* \u0420\u0430\u043D\u044C\u0448\u0435 \u0442\u043E\u043B\u0449\u0438\u043D\u0430 \u0431\u044B\u043B\u0430 \u043E\u0431\u0449\u0435\u0439 \u043D\u0430 \u0432\u0435\u0441\u044C \u0441\u043B\u043E\u0439, \u043F\u043E\u044D\u0442\u043E\u043C\u0443 \u0434\u0432\u0443\u0445\u043F\u043E\u043B\u043E\u0441\u043D\u044B\u0439 \u043F\u0435\u0440\u0435\u0443\u043B\u043E\u043A \u0438 \u0448\u0435\u0441\u0442\u0438\u043F\u043E\u043B\u043E\u0441\u043D\u044B\u0439 \u043F\u0440\u043E\u0441\u043F\u0435\u043A\u0442
|
|
1116
|
+
* \u043E\u0434\u043D\u043E\u0433\u043E \u043A\u043B\u0430\u0441\u0441\u0430 \u0440\u0438\u0441\u043E\u0432\u0430\u043B\u0438\u0441\u044C \u043E\u0434\u0438\u043D\u0430\u043A\u043E\u0432\u044B\u043C\u0438. \u0422\u0435\u043F\u0435\u0440\u044C \u043A\u0430\u0436\u0434\u0430\u044F \u0434\u043E\u0440\u043E\u0433\u0430 \u043D\u0435\u0441\u0451\u0442 \u0441\u0432\u043E\u044E \u0448\u0438\u0440\u0438\u043D\u0443 \u0432 \u043C\u0435\u0442\u0440\u0430\u0445, \u0438 \u043F\u043E\u043B\u043E\u0442\u043D\u043E
|
|
1117
|
+
* \u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u0441\u044F \u043E\u0431\u044A\u0435\u043A\u0442\u043E\u043C \u043C\u0435\u0441\u0442\u043D\u043E\u0441\u0442\u0438, \u0430 \u043D\u0435 \u043B\u0438\u043D\u0438\u0435\u0439 \u0432 \u043F\u0438\u043A\u0441\u0435\u043B\u044F\u0445.
|
|
1118
|
+
*
|
|
1119
|
+
* \u041D\u043E\u043B\u044C \u043E\u0437\u043D\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043E \u0432 \u0442\u0430\u0439\u043B\u0435 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430 \u043D\u0435\u0442 \u2014 \u0442\u043E\u0433\u0434\u0430 \u0440\u0430\u0431\u043E\u0442\u0430\u0435\u0442 \u043F\u0440\u0435\u0436\u043D\u044F\u044F \u0448\u0438\u0440\u0438\u043D\u0430 \u0438\u0437 \u0441\u0442\u0438\u043B\u044F. \u0411\u043B\u0430\u0433\u043E\u0434\u0430\u0440\u044F
|
|
1120
|
+
* \u044D\u0442\u043E\u043C\u0443 \u0434\u0432\u0438\u0436\u043E\u043A \u043C\u043E\u0436\u043D\u043E \u0432\u044B\u043B\u043E\u0436\u0438\u0442\u044C \u0414\u041E \u043F\u0435\u0440\u0435\u0441\u0431\u043E\u0440\u043A\u0438 \u0442\u0430\u0439\u043B\u043E\u0432: \u043F\u043E\u043A\u0430 \u0434\u0430\u043D\u043D\u044B\u0445 \u043D\u0435\u0442, \u043A\u0430\u0440\u0442\u0438\u043D\u043A\u0430 \u043D\u0435 \u043C\u0435\u043D\u044F\u0435\u0442\u0441\u044F \u0432\u043E\u0432\u0441\u0435.
|
|
1121
|
+
*/
|
|
1122
|
+
float halfWidth = (u_width_from_data > 0.5 && a_width > 0.0)
|
|
1123
|
+
? a_width * 0.5 * u_meters_to_units + u_width_extra
|
|
1124
|
+
: u_half_width;
|
|
1125
|
+
v_half_width = halfWidth;
|
|
1126
|
+
float r = halfWidth + aa;
|
|
1127
|
+
vec2 pos = base + dir * (alongSign * r) + perp * (a_corner.y * r + u_offset);
|
|
1128
|
+
|
|
1129
|
+
gl_Position = globe
|
|
1130
|
+
? u_matrix * vec4(globeLocal(pos), 1.0)
|
|
1131
|
+
: u_matrix * vec4(pos, height, 1.0);
|
|
1132
|
+
|
|
1133
|
+
v_pos = pos;
|
|
1134
|
+
// \u041A\u043E\u043D\u0446\u044B \u0441\u043E \u0441\u0434\u0432\u0438\u0433\u043E\u043C: \u043F\u043E \u043D\u0438\u043C \u0444\u0440\u0430\u0433\u043C\u0435\u043D\u0442 \u043C\u0435\u0440\u044F\u0435\u0442 \u0440\u0430\u0441\u0441\u0442\u043E\u044F\u043D\u0438\u0435 \u0434\u043E \u043E\u0441\u0438.
|
|
1135
|
+
v_p0 = a_p0 + perp * u_offset;
|
|
1136
|
+
v_p1 = a_p1 + perp * u_offset;
|
|
1137
|
+
v_world0 = u_world_origin + a_p0 * u_meters_per_unit;
|
|
1138
|
+
v_world1 = u_world_origin + a_p1 * u_meters_per_unit;
|
|
1139
|
+
|
|
1140
|
+
// \u041A\u043E\u043E\u0440\u0434\u0438\u043D\u0430\u0442\u0430 \u0440\u0438\u0441\u0443\u043D\u043A\u0430. \u0411\u0435\u0440\u0451\u043C \u041D\u0415 \u044D\u043A\u0440\u0430\u043D\u043D\u0443\u044E \u0434\u043B\u0438\u043D\u0443 \u043E\u0442\u0440\u0435\u0437\u043A\u0430, \u0430 \u0442\u0430\u0439\u043B\u043E\u0432\u0443\u044E, \u0443\u043C\u043D\u043E\u0436\u0435\u043D\u043D\u0443\u044E
|
|
1141
|
+
// \u043D\u0430 \u043E\u0431\u0449\u0438\u0439 \u0434\u043B\u044F \u0442\u0430\u0439\u043B\u0430 \u043C\u0430\u0441\u0448\u0442\u0430\u0431: \u0438\u043D\u0430\u0447\u0435 \u043F\u0440\u0438 \u043D\u0430\u043A\u043B\u043E\u043D\u0435 \u0441\u043E\u0441\u0435\u0434\u043D\u0438\u0435 \u043E\u0442\u0440\u0435\u0437\u043A\u0438 \u043F\u043E\u043B\u0443\u0447\u0438\u043B\u0438 \u0431\u044B
|
|
1142
|
+
// \u0440\u0430\u0437\u043D\u044B\u0439 \u043C\u0430\u0441\u0448\u0442\u0430\u0431 \u0438 \u043F\u0443\u043D\u043A\u0442\u0438\u0440 \u0440\u0432\u0430\u043B\u0441\u044F \u0431\u044B \u043D\u0430 \u0441\u0442\u044B\u043A\u0430\u0445.
|
|
1143
|
+
v_dist0 = a_dist * u_tile_to_px;
|
|
1144
|
+
v_seg_len = len * u_tile_to_px;
|
|
1145
|
+
}
|
|
1146
|
+
`,Ra=`#version 300 es
|
|
1147
|
+
precision highp float;
|
|
1148
|
+
|
|
1149
|
+
${Xe}
|
|
1150
|
+
${Jt}
|
|
1151
|
+
${Jr}
|
|
1152
|
+
|
|
1153
|
+
in vec2 v_pos;
|
|
1154
|
+
in vec2 v_p0;
|
|
1155
|
+
in vec2 v_p1;
|
|
1156
|
+
in float v_dist0;
|
|
1157
|
+
in float v_seg_len;
|
|
1158
|
+
in vec2 v_world0;
|
|
1159
|
+
in vec2 v_world1;
|
|
1160
|
+
|
|
1161
|
+
uniform vec4 u_color; // premultiplied
|
|
1162
|
+
/** \u041F\u043E\u043B\u0443\u0448\u0438\u0440\u0438\u043D\u0430 \u0432 \u0415\u0414\u0418\u041D\u0418\u0426\u0410\u0425 \u0422\u0410\u0419\u041B\u0410: \u043A\u0430\u043F\u0441\u0443\u043B\u0430 \u0436\u0438\u0432\u0451\u0442 \u043D\u0430 \u0437\u0435\u043C\u043B\u0435, \u0430 \u043D\u0435 \u043D\u0430 \u044D\u043A\u0440\u0430\u043D\u0435. */
|
|
1163
|
+
uniform float u_half_width;
|
|
1164
|
+
// \u0422\u043E\u043B\u0449\u0438\u043D\u0430 \u043F\u0440\u0438\u0445\u043E\u0434\u0438\u0442 \u0438\u0437 \u0432\u0435\u0440\u0448\u0438\u043D\u043D\u043E\u0433\u043E \u0448\u0435\u0439\u0434\u0435\u0440\u0430: \u043E\u043D\u0430 \u043C\u043E\u0436\u0435\u0442 \u0431\u044B\u0442\u044C \u0441\u0432\u043E\u0435\u0439 \u0443 \u043A\u0430\u0436\u0434\u043E\u0439 \u0434\u043E\u0440\u043E\u0433\u0438, \u0438 \u043F\u0443\u043D\u043A\u0442\u0438\u0440 \u0441\u043E
|
|
1165
|
+
// \u0441\u0442\u0440\u0435\u043B\u043A\u0430\u043C\u0438 \u043E\u0431\u044F\u0437\u0430\u043D \u0441\u0447\u0438\u0442\u0430\u0442\u044C \u0435\u0451 \u043E\u0442 \u0442\u043E\u0439 \u0436\u0435 \u0432\u0435\u043B\u0438\u0447\u0438\u043D\u044B, \u0438\u043D\u0430\u0447\u0435 \u0440\u0438\u0441\u0443\u043D\u043E\u043A \u0440\u0430\u0437\u044A\u0435\u0434\u0435\u0442\u0441\u044F \u0441 \u043F\u043E\u043B\u043E\u0442\u043D\u043E\u043C.
|
|
1166
|
+
in float v_half_width;
|
|
1167
|
+
/** \u0415\u0434\u0438\u043D\u0438\u0446\u044B \u0442\u0430\u0439\u043B\u0430 \u2192 \u043F\u0438\u043A\u0441\u0435\u043B\u0438 \u0446\u0435\u043D\u0442\u0440\u0430 \u043A\u0430\u0440\u0442\u044B: \u0432 \u043D\u0438\u0445 \u0437\u0430\u0434\u0430\u043D \u0440\u0438\u0441\u0443\u043D\u043E\u043A \u0432\u0434\u043E\u043B\u044C \u043B\u0438\u043D\u0438\u0438. */
|
|
1168
|
+
uniform float u_tile_to_px;
|
|
1169
|
+
|
|
1170
|
+
// \u0420\u0438\u0441\u0443\u043D\u043E\u043A \u0432\u0434\u043E\u043B\u044C \u043B\u0438\u043D\u0438\u0438: 0 \u2014 \u0441\u043F\u043B\u043E\u0448\u043D\u0430\u044F, 1 \u2014 \u043F\u0443\u043D\u043A\u0442\u0438\u0440, 2 \u2014 \u0448\u0435\u0432\u0440\u043E\u043D,
|
|
1171
|
+
// 3 \u2014 \u043C\u0435\u0442\u043A\u0430-\u043E\u0441\u0442\u0440\u0438\u0451 \u043F\u043E\u0432\u0435\u0440\u0445 \u043F\u043E\u043B\u043E\u0442\u043D\u0430, 4 \u2014 \u0442\u043E\u043B\u044C\u043A\u043E \u043E\u0441\u0442\u0440\u0438\u0451,
|
|
1172
|
+
// 5 \u2014 \u0421\u0422\u0420\u0415\u041B\u041A\u0410-\u0428\u0422\u0420\u0418\u0425: \u0434\u0440\u0435\u0432\u043A\u043E \u0441 \u0433\u043E\u043B\u043E\u0432\u043E\u0439 \u043E\u0434\u043D\u043E\u0439 \u0444\u0438\u0433\u0443\u0440\u043E\u0439, \u043C\u0435\u0436\u0434\u0443 \u0441\u0442\u0440\u0435\u043B\u043A\u0430\u043C\u0438 \u043F\u0440\u043E\u0441\u0432\u0435\u0442.
|
|
1173
|
+
uniform int u_pattern;
|
|
1174
|
+
uniform vec2 u_dash; // (\u0448\u0442\u0440\u0438\u0445, \u043F\u0435\u0440\u0438\u043E\u0434) \u0432 \u043F\u0438\u043A\u0441\u0435\u043B\u044F\u0445
|
|
1175
|
+
uniform vec4 u_arrow_color; // premultiplied
|
|
1176
|
+
uniform vec4 u_arrow; // 2: (\u043F\u0435\u0440\u0438\u043E\u0434, \u0442\u043E\u043B\u0449\u0438\u043D\u0430 \u0448\u0442\u0440\u0438\u0445\u0430, \u0440\u0430\u0437\u043C\u0430\u0445, \u2014)
|
|
1177
|
+
// 5: (\u043F\u043E\u043B\u0443\u0448\u0438\u0440\u0438\u043D\u0430 \u0434\u0440\u0435\u0432\u043A\u0430, \u0434\u043B\u0438\u043D\u0430 \u0433\u043E\u043B\u043E\u0432\u044B, \u043F\u043E\u043B\u0443\u0448\u0438\u0440\u0438\u043D\u0430 \u0433\u043E\u043B\u043E\u0432\u044B, \u0434\u043B\u0438\u043D\u0430 \u0441\u0442\u0440\u0435\u043B\u043A\u0438)
|
|
1178
|
+
|
|
1179
|
+
/**
|
|
1180
|
+
* \u0428\u0435\u0432\u0440\u043E\u043D \xAB\u043F\u0442\u0438\u0447\u043A\u043E\u0439\xBB \u043F\u043E \u043D\u0430\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u044E \u043B\u0438\u043D\u0438\u0438, \u043F\u043E\u0441\u0447\u0438\u0442\u0430\u043D\u043D\u044B\u0439 \u0430\u043D\u0430\u043B\u0438\u0442\u0438\u0447\u0435\u0441\u043A\u0438.
|
|
1181
|
+
* \u0422\u0435\u043A\u0441\u0442\u0443\u0440\u0430 \u043D\u0435 \u043D\u0443\u0436\u043D\u0430: \u0443 2GIS \u044D\u0442\u043E \u0442\u043E\u0436\u0435 \u043E\u0442\u0434\u0435\u043B\u044C\u043D\u0430\u044F \u0444\u0443\u043D\u043A\u0446\u0438\u044F (sdf_chevron), \u0438 \u0442\u0430\u043A
|
|
1182
|
+
* \u0441\u0442\u0440\u0435\u043B\u043A\u0430 \u043E\u0441\u0442\u0430\u0451\u0442\u0441\u044F \u0447\u0451\u0442\u043A\u043E\u0439 \u043D\u0430 \u043B\u044E\u0431\u043E\u043C \u043C\u0430\u0441\u0448\u0442\u0430\u0431\u0435 \u0438 \u043D\u0435 \u0442\u0440\u0430\u0442\u0438\u0442 \u043C\u0435\u0441\u0442\u0430 \u0432 \u0430\u0442\u043B\u0430\u0441\u0435.
|
|
1183
|
+
*/
|
|
1184
|
+
float chevron(float along, float lateral, float pw) {
|
|
1185
|
+
float x = mod(along, u_arrow.x) - u_arrow.x * 0.5;
|
|
1186
|
+
float m = 1.0; // \u043D\u0430\u043A\u043B\u043E\u043D 45\xB0
|
|
1187
|
+
// \u043F\u0440\u044F\u043C\u0430\u044F x + m*|lateral| = 0: \u0447\u0435\u043C \u0434\u0430\u043B\u044C\u0448\u0435 \u043E\u0442 \u043E\u0441\u0438, \u0442\u0435\u043C \u043F\u043E\u0437\u0430\u0434\u0438 \u0448\u0442\u0440\u0438\u0445 \u2014
|
|
1188
|
+
// \u0437\u043D\u0430\u0447\u0438\u0442 \u043E\u0441\u0442\u0440\u0438\u0451 \u0441\u043C\u043E\u0442\u0440\u0438\u0442 \u0412\u041F\u0415\u0420\u0401\u0414, \u043F\u043E \u043D\u0430\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u044E \u043E\u0446\u0438\u0444\u0440\u043E\u0432\u043A\u0438 \u043B\u0438\u043D\u0438\u0438
|
|
1189
|
+
float d = abs(x + m * lateral) / sqrt(1.0 + m * m);
|
|
1190
|
+
// \u0422\u043E\u043B\u0449\u0438\u043D\u0430 \u0438 \u0440\u0430\u0437\u043C\u0430\u0445 \u0441\u043E\u043A\u0440\u0430\u0449\u0430\u044E\u0442\u0441\u044F \u0432\u043C\u0435\u0441\u0442\u0435 \u0441 \u043F\u043E\u043B\u043E\u0442\u043D\u043E\u043C, \u0438\u043D\u0430\u0447\u0435 \u043D\u0430 \u0434\u0430\u043B\u044C\u043D\u0435\u043C \u043F\u043B\u0430\u043D\u0435
|
|
1191
|
+
// \u0441\u0442\u0440\u0435\u043B\u043A\u0430 \u0432\u044B\u043B\u0435\u0437\u0435\u0442 \u0437\u0430 \u043A\u0440\u0430\u044F \u0434\u043E\u0440\u043E\u0433\u0438.
|
|
1192
|
+
float thick = u_arrow.y * pw;
|
|
1193
|
+
float span = u_arrow.z * pw;
|
|
1194
|
+
float a = 1.0 - smoothstep(thick * 0.5 - 0.5, thick * 0.5 + 0.5, d);
|
|
1195
|
+
a *= 1.0 - smoothstep(span - 0.5, span + 0.5, lateral);
|
|
1196
|
+
return a;
|
|
1197
|
+
}
|
|
1198
|
+
|
|
1199
|
+
/**
|
|
1200
|
+
* \u0421\u041F\u041B\u041E\u0428\u041D\u041E\u0415 \u041E\u0421\u0422\u0420\u0418\u0401 \u2014 \u0442\u043E, \u0447\u0435\u043C \u0441\u0435\u0440\u0432\u0435\u0440 \u0440\u0438\u0441\u0443\u0435\u0442 \u043D\u0430\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u0435 \u043D\u0430 \u043B\u0435\u043D\u0442\u0435 \u043F\u0440\u043E\u0431\u043E\u043A
|
|
1201
|
+
* (TrafficRaster.DrawHeads): \u043A\u043E\u043D\u0435\u0446 \u0443\u0447\u0430\u0441\u0442\u043A\u0430 \u0440\u0430\u0441\u0448\u0438\u0440\u044F\u0435\u0442\u0441\u044F \u0432 \u0441\u0442\u0440\u0435\u043B\u043A\u0443.
|
|
1202
|
+
*
|
|
1203
|
+
* \u041E\u0442\u043B\u0438\u0447\u0438\u0435 \u043E\u0442 \u0448\u0435\u0432\u0440\u043E\u043D\u0430 \u043F\u0440\u0438\u043D\u0446\u0438\u043F\u0438\u0430\u043B\u044C\u043D\u043E\u0435, \u0438 \u043E\u043D\u043E \u043F\u0440\u043E \u0447\u0438\u0442\u0430\u0435\u043C\u043E\u0441\u0442\u044C: \u0448\u0435\u0432\u0440\u043E\u043D \u2014 \u044D\u0442\u043E \u0448\u0442\u0440\u0438\u0445
|
|
1204
|
+
* \u041F\u041E\u0412\u0415\u0420\u0425 \u043B\u0435\u043D\u0442\u044B, \u0438 \u043D\u0430 \u0443\u0437\u043A\u043E\u0439 \u0434\u043E\u0440\u043E\u0433\u0435 \u043E\u043D \u0432\u044B\u0433\u043B\u044F\u0434\u0438\u0442 \u0437\u043D\u0430\u0447\u043A\u043E\u043C, \u043D\u0430\u043A\u043B\u0435\u0435\u043D\u043D\u044B\u043C \u0441\u0432\u0435\u0440\u0445\u0443.
|
|
1205
|
+
* \u041E\u0441\u0442\u0440\u0438\u0451 \u0436\u0435 \u0437\u0430\u043D\u0438\u043C\u0430\u0435\u0442 \u0432\u0441\u044E \u0448\u0438\u0440\u0438\u043D\u0443 \u043B\u0435\u043D\u0442\u044B \u0438 \u0441\u0445\u043E\u0434\u0438\u0442 \u043D\u0430 \u043D\u0435\u0442, \u043F\u043E\u044D\u0442\u043E\u043C\u0443 \u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044F \u043A\u0430\u043A
|
|
1206
|
+
* \u0441\u0430\u043C\u0430 \u043B\u0435\u043D\u0442\u0430, \u0443 \u043A\u043E\u0442\u043E\u0440\u043E\u0439 \u0435\u0441\u0442\u044C \u043D\u0430\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u0435. \u041E\u0442\u0441\u044E\u0434\u0430 \u0438 \xAB\u0440\u0430\u0437\u0434\u0435\u043B\u044C\u043D\u044B\u0435\xBB \u0441\u0442\u0440\u0435\u043B\u043A\u0438: \u043C\u0435\u0436\u0434\u0443
|
|
1207
|
+
* \u043E\u0441\u0442\u0440\u0438\u044F\u043C\u0438 \u043E\u0441\u0442\u0430\u0451\u0442\u0441\u044F \u0447\u0438\u0441\u0442\u0430\u044F \u043B\u0435\u043D\u0442\u0430, \u0430 \u043D\u0435 \u0447\u0430\u0441\u0442\u043E\u043A\u043E\u043B \u0433\u0430\u043B\u043E\u0447\u0435\u043A.
|
|
1208
|
+
*
|
|
1209
|
+
* \u0428\u0438\u0440\u0438\u043D\u0430 \u043A\u0432\u0430\u0434\u0430 \u0443 \u043D\u0430\u0441 \u043F\u043E\u0441\u0442\u043E\u044F\u043D\u043D\u0430\u044F, \u0440\u0430\u0441\u0448\u0438\u0440\u0438\u0442\u044C\u0441\u044F \u043D\u0430\u0440\u0443\u0436\u0443 \u043E\u0441\u0442\u0440\u0438\u0451 \u043D\u0435 \u043C\u043E\u0436\u0435\u0442 \u2014 \u043F\u043E\u044D\u0442\u043E\u043C\u0443
|
|
1210
|
+
* \u043E\u043D\u043E \u0421\u0423\u0416\u0410\u0415\u0422\u0421\u042F \u0432\u043D\u0443\u0442\u0440\u0438 \u043B\u0435\u043D\u0442\u044B: \u043E\u0442 \u043F\u043E\u043B\u043D\u043E\u0439 \u0448\u0438\u0440\u0438\u043D\u044B \u0443 \u043E\u0441\u043D\u043E\u0432\u0430\u043D\u0438\u044F \u0434\u043E \u0442\u043E\u0447\u043A\u0438 \u043D\u0430 \u043A\u043E\u043D\u0446\u0435.
|
|
1211
|
+
*/
|
|
1212
|
+
float head(float along, float lateral, float pw) {
|
|
1213
|
+
float period = u_arrow.x;
|
|
1214
|
+
float len = u_arrow.y; // \u0434\u043B\u0438\u043D\u0430 \u043E\u0442 \u043E\u0441\u043D\u043E\u0432\u0430\u043D\u0438\u044F \u0434\u043E \u043E\u0441\u0442\u0440\u0438\u044F, \u043F\u0438\u043A\u0441\u0435\u043B\u0438
|
|
1215
|
+
float span = u_arrow.z; // \u043F\u043E\u043B\u0443\u0448\u0438\u0440\u0438\u043D\u0430 \u043E\u0441\u043D\u043E\u0432\u0430\u043D\u0438\u044F, \u043F\u0438\u043A\u0441\u0435\u043B\u0438
|
|
1216
|
+
if (len <= 0.0 || span <= 0.0) return 0.0;
|
|
1217
|
+
|
|
1218
|
+
// \u041E\u0441\u0442\u0440\u0438\u0451 \u0441\u0442\u043E\u0438\u0442 \u0432 \u041A\u041E\u041D\u0426\u0415 \u043F\u0435\u0440\u0438\u043E\u0434\u0430: \u0442\u0430\u043A \u043C\u0435\u0436\u0434\u0443 \u0434\u0432\u0443\u043C\u044F \u0441\u0442\u0440\u0435\u043B\u043A\u0430\u043C\u0438 \u043E\u0441\u0442\u0430\u0451\u0442\u0441\u044F \u0447\u0438\u0441\u0442\u0430\u044F
|
|
1219
|
+
// \u043B\u0435\u043D\u0442\u0430, \u0430 \u043D\u0435 \u043D\u0430\u043E\u0431\u043E\u0440\u043E\u0442.
|
|
1220
|
+
float t = mod(along, period) - (period - len);
|
|
1221
|
+
if (t < 0.0) return 0.0;
|
|
1222
|
+
|
|
1223
|
+
float edge = span * (1.0 - t / len);
|
|
1224
|
+
// \u0421\u0433\u043B\u0430\u0436\u0438\u0432\u0430\u0435\u043C \u0438 \u043F\u043E\u043F\u0435\u0440\u0451\u043A, \u0438 \u043F\u043E \u043E\u0441\u043D\u043E\u0432\u0430\u043D\u0438\u044E: \u0438\u043D\u0430\u0447\u0435 \u043D\u0430 \u043F\u043E\u043B\u043E\u0433\u043E\u0439 \u0434\u043E\u0440\u043E\u0433\u0435 \u043E\u0441\u043D\u043E\u0432\u0430\u043D\u0438\u0435
|
|
1225
|
+
// \u043C\u0435\u0440\u0446\u0430\u0435\u0442, \u043F\u043E\u043F\u0430\u0434\u0430\u044F \u043A\u0440\u0430\u0435\u043C \u043C\u0435\u0436\u0434\u0443 \u043F\u0438\u043A\u0441\u0435\u043B\u044F\u043C\u0438.
|
|
1226
|
+
float a = 1.0 - smoothstep(edge - 0.75, edge + 0.75, abs(lateral));
|
|
1227
|
+
a *= clamp(t + 0.75, 0.0, 1.0);
|
|
1228
|
+
return a;
|
|
1229
|
+
}
|
|
1230
|
+
|
|
1231
|
+
/**
|
|
1232
|
+
* \u0417\u043D\u0430\u043A\u043E\u0432\u043E\u0435 \u0440\u0430\u0441\u0441\u0442\u043E\u044F\u043D\u0438\u0435 \u0434\u043E \u0421\u0422\u0420\u0415\u041B\u041A\u0418 \u2014 \u0434\u0440\u0435\u0432\u043A\u043E \u0441 \u0433\u043E\u043B\u043E\u0432\u043E\u0439 \u043E\u0434\u043D\u043E\u0439 \u0444\u0438\u0433\u0443\u0440\u043E\u0439.
|
|
1233
|
+
*
|
|
1234
|
+
* \u0422\u0430\u043A \u0440\u0438\u0441\u0443\u0435\u0442 \u043D\u0430\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u0435 \u042F\u043D\u0434\u0435\u043A\u0441: \u043B\u0435\u043D\u0442\u0430 \u0440\u0430\u0437\u0431\u0438\u0442\u0430 \u043D\u0430 \u043E\u0442\u0434\u0435\u043B\u044C\u043D\u044B\u0435 \u0441\u0442\u0440\u0435\u043B\u043A\u0438 \u0441
|
|
1235
|
+
* \u043F\u0440\u043E\u0441\u0432\u0435\u0442\u0430\u043C\u0438, \u0443 \u043A\u0430\u0436\u0434\u043E\u0439 \u043E\u0431\u0449\u0430\u044F \u043E\u0431\u0432\u043E\u0434\u043A\u0430 \u0438 \u0441\u043A\u0440\u0443\u0433\u043B\u0451\u043D\u043D\u044B\u0435 \u043A\u0440\u0430\u044F. \u0421\u043F\u043B\u043E\u0448\u043D\u0430\u044F \u043B\u0435\u043D\u0442\u0430 \u0441
|
|
1236
|
+
* \u043C\u0435\u0442\u043A\u0430\u043C\u0438 \u044D\u0442\u043E\u0433\u043E \u043D\u0435 \u0434\u0430\u0451\u0442: \u043F\u043E \u043D\u0435\u0439 \u043D\u0435 \u0432\u0438\u0434\u043D\u043E, \u0433\u0434\u0435 \u0443\u0447\u0430\u0441\u0442\u043E\u043A \u043D\u0430\u0447\u0438\u043D\u0430\u0435\u0442\u0441\u044F \u0438 \u043A\u043E\u043D\u0447\u0430\u0435\u0442\u0441\u044F, \u0430
|
|
1237
|
+
* \u043F\u0440\u043E\u0441\u0432\u0435\u0442 \u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044F \u043C\u0433\u043D\u043E\u0432\u0435\u043D\u043D\u043E.
|
|
1238
|
+
*
|
|
1239
|
+
* \u0420\u0430\u0441\u0441\u0442\u043E\u044F\u043D\u0438\u0435 \u0417\u041D\u0410\u041A\u041E\u0412\u041E\u0415 (\u0432\u043D\u0443\u0442\u0440\u0438 \u043E\u0442\u0440\u0438\u0446\u0430\u0442\u0435\u043B\u044C\u043D\u043E\u0435) \u2014 \u0438\u0437 \u043D\u0435\u0433\u043E \u043F\u043E\u043B\u0443\u0447\u0430\u0435\u0442\u0441\u044F \u0438 \u0437\u0430\u043B\u0438\u0432\u043A\u0430, \u0438
|
|
1240
|
+
* \u043E\u0431\u0432\u043E\u0434\u043A\u0430 \u043B\u044E\u0431\u043E\u0439 \u0442\u043E\u043B\u0449\u0438\u043D\u044B (\u043E\u0431\u0432\u043E\u0434\u043A\u0430 \u044D\u0442\u043E \u0442\u0430 \u0436\u0435 \u0444\u0438\u0433\u0443\u0440\u0430, \u0440\u0430\u0437\u0434\u0443\u0442\u0430\u044F \u043D\u0430\u0440\u0443\u0436\u0443), \u0438
|
|
1241
|
+
* \u0441\u043A\u0440\u0443\u0433\u043B\u0435\u043D\u0438\u0435 \u043A\u0440\u0430\u0451\u0432: \u0443 \u0437\u043D\u0430\u043A\u043E\u0432\u043E\u0433\u043E \u0440\u0430\u0441\u0441\u0442\u043E\u044F\u043D\u0438\u044F \u043E\u043D\u043E \u0431\u0435\u0441\u043F\u043B\u0430\u0442\u043D\u043E.
|
|
1242
|
+
*/
|
|
1243
|
+
/** \u0417\u043D\u0430\u043A\u043E\u0432\u043E\u0435 \u0440\u0430\u0441\u0441\u0442\u043E\u044F\u043D\u0438\u0435 \u0434\u043E \u041E\u0414\u041D\u041E\u0419 \u0441\u0442\u0440\u0435\u043B\u043A\u0438, \u043D\u0430\u0447\u0430\u043B\u043E \u043A\u043E\u0442\u043E\u0440\u043E\u0439 \u0432 \u043D\u0443\u043B\u0435. */
|
|
1244
|
+
float arrowShape(float x, float lateral, float r) {
|
|
1245
|
+
float shaftHalf = u_arrow.x;
|
|
1246
|
+
float headLen = u_arrow.y;
|
|
1247
|
+
float headHalf = u_arrow.z;
|
|
1248
|
+
float total = u_arrow.w;
|
|
1249
|
+
float shaftLen = max(total - headLen, 0.0);
|
|
1250
|
+
|
|
1251
|
+
// \u0414\u0440\u0435\u0432\u043A\u043E \u2014 \u043A\u0430\u043F\u0441\u0443\u043B\u0430: \u0441\u043A\u0440\u0443\u0433\u043B\u0451\u043D\u043D\u044B\u0435 \u0442\u043E\u0440\u0446\u044B \u0434\u0430\u0440\u043E\u043C \u0438 \u0431\u0435\u0437 \u0435\u0434\u0438\u043D\u043E\u0433\u043E \u0432\u0435\u0442\u0432\u043B\u0435\u043D\u0438\u044F.
|
|
1252
|
+
vec2 p = vec2(x, lateral);
|
|
1253
|
+
vec2 q = p - vec2(clamp(x, 0.0, shaftLen), 0.0);
|
|
1254
|
+
float dShaft = length(q) - max(shaftHalf - r, 0.0);
|
|
1255
|
+
|
|
1256
|
+
// \u0413\u043E\u043B\u043E\u0432\u044B \u043C\u043E\u0436\u0435\u0442 \u043D\u0435 \u0431\u044B\u0442\u044C \u0432\u043E\u0432\u0441\u0435: \u043D\u0430 \u043C\u0435\u043B\u043A\u043E\u043C \u0437\u0443\u043C\u0435 \u0441\u0442\u0440\u0435\u043B\u043A\u0438 \u0432\u044B\u0442\u044F\u0433\u0438\u0432\u0430\u044E\u0442\u0441\u044F \u0438 \u0441\u043C\u044B\u043A\u0430\u044E\u0442\u0441\u044F
|
|
1257
|
+
// \u0432 \u0441\u043F\u043B\u043E\u0448\u043D\u0443\u044E \u043B\u0435\u043D\u0442\u0443, \u0438 \u0442\u043E\u0433\u0434\u0430 \u0444\u0438\u0433\u0443\u0440\u0430 \u044D\u0442\u043E \u043E\u0434\u043D\u043E \u0434\u0440\u0435\u0432\u043A\u043E.
|
|
1258
|
+
if (headLen <= 0.0) return dShaft - r;
|
|
1259
|
+
|
|
1260
|
+
// \u0413\u043E\u043B\u043E\u0432\u0430 \u2014 \u0440\u0430\u0432\u043D\u043E\u0431\u0435\u0434\u0440\u0435\u043D\u043D\u044B\u0439 \u0442\u0440\u0435\u0443\u0433\u043E\u043B\u044C\u043D\u0438\u043A \u043E\u0442 \u043E\u0441\u043D\u043E\u0432\u0430\u043D\u0438\u044F \u043A \u043E\u0441\u0442\u0440\u0438\u044E. \u0421\u0438\u043C\u043C\u0435\u0442\u0440\u0438\u044E \u043F\u043E
|
|
1261
|
+
// \u043F\u043E\u043F\u0435\u0440\u0435\u0447\u043D\u043E\u0439 \u043E\u0441\u0438 \u0431\u0435\u0440\u0451\u043C \u043C\u043E\u0434\u0443\u043B\u0435\u043C, \u043F\u043E\u044D\u0442\u043E\u043C\u0443 \u0440\u0451\u0431\u0435\u0440 \u043E\u0441\u0442\u0430\u0451\u0442\u0441\u044F \u043E\u0434\u043D\u043E.
|
|
1262
|
+
float tip = total - r;
|
|
1263
|
+
vec2 a = vec2(shaftLen, max(headHalf - r, 0.0));
|
|
1264
|
+
vec2 c = vec2(tip, 0.0);
|
|
1265
|
+
vec2 e = c - a;
|
|
1266
|
+
vec2 w = vec2(x, abs(lateral)) - a;
|
|
1267
|
+
vec2 proj = w - e * clamp(dot(w, e) / max(dot(e, e), 1e-6), 0.0, 1.0);
|
|
1268
|
+
float dEdge = length(proj);
|
|
1269
|
+
float side = e.x * w.y - e.y * w.x;
|
|
1270
|
+
bool inside = side <= 0.0 && x >= shaftLen && x <= tip;
|
|
1271
|
+
float dHead = inside ? -min(dEdge, min(x - shaftLen, tip - x)) : dEdge;
|
|
1272
|
+
|
|
1273
|
+
return min(dShaft, dHead) - r;
|
|
1274
|
+
}
|
|
1275
|
+
|
|
1276
|
+
float arrowDash(float s, float segLen, float lateral) {
|
|
1277
|
+
float shaftHalf = u_arrow.x;
|
|
1278
|
+
float headLen = u_arrow.y;
|
|
1279
|
+
float total = u_arrow.w; // \u0434\u043B\u0438\u043D\u0430 \u0432\u0441\u0435\u0439 \u0441\u0442\u0440\u0435\u043B\u043A\u0438: \u0434\u0440\u0435\u0432\u043A\u043E \u043F\u043B\u044E\u0441 \u0433\u043E\u043B\u043E\u0432\u0430
|
|
1280
|
+
float period = u_dash.y; // \u0441\u0442\u0440\u0435\u043B\u043A\u0430 \u043F\u043B\u044E\u0441 \u043F\u0440\u043E\u0441\u0432\u0435\u0442
|
|
1281
|
+
if (total <= 0.0 || period <= 0.0) return 1e9;
|
|
1282
|
+
|
|
1283
|
+
// \u2605 \u0421\u0442\u0440\u0435\u043B\u043A\u0438 \u0440\u0430\u0441\u043A\u043B\u0430\u0434\u044B\u0432\u0430\u044E\u0442\u0441\u044F \u0412\u041D\u0423\u0422\u0420\u0418 \u041E\u0422\u0420\u0415\u0417\u041A\u0410, \u0430 \u043D\u0435 \u0432\u0434\u043E\u043B\u044C \u0432\u0441\u0435\u0439 \u043B\u0438\u043D\u0438\u0438.
|
|
1284
|
+
//
|
|
1285
|
+
// \u0422\u0430\u0439\u043B\u043E\u0432\u0430\u044F \u043B\u0438\u043D\u0438\u044F \u0440\u0438\u0441\u0443\u0435\u0442\u0441\u044F \u043A\u0430\u043F\u0441\u0443\u043B\u043E\u0439 \u041D\u0410 \u041A\u0410\u0416\u0414\u042B\u0419 \u041E\u0422\u0420\u0415\u0417\u041E\u041A, \u0438 \u043E\u0442\u0441\u0447\u0451\u0442 \u0432\u0434\u043E\u043B\u044C \u043D\u0435\u0451
|
|
1286
|
+
// \u0443\u043F\u0438\u0440\u0430\u0435\u0442\u0441\u044F \u0432 \u0435\u0451 \u043A\u043E\u043D\u0435\u0446: \u0434\u0430\u043B\u044C\u0448\u0435 \u0434\u043E\u043B\u044F \u0432\u0434\u043E\u043B\u044C \u043E\u0442\u0440\u0435\u0437\u043A\u0430 \u0437\u0430\u0436\u0430\u0442\u0430, \u0430 \u0440\u0430\u0441\u0441\u0442\u043E\u044F\u043D\u0438\u0435 \u0434\u043E \u043E\u0441\u0438
|
|
1287
|
+
// \u0441\u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044F \u0443\u0436\u0435 \u0434\u043E \u0432\u0435\u0440\u0448\u0438\u043D\u044B. \u0421\u0442\u0440\u0435\u043B\u043A\u0430, \u043F\u043E\u043F\u0430\u0432\u0448\u0430\u044F \u043D\u0430 \u0441\u0442\u044B\u043A, \u0442\u0435\u0440\u044F\u043B\u0430 \u043E\u0441\u0442\u0440\u0438\u0451 \u2014 \u043E\u043D\u043E
|
|
1288
|
+
// \u043E\u043A\u0430\u0437\u044B\u0432\u0430\u043B\u043E\u0441\u044C \u0437\u0430 \u043A\u0440\u0430\u0435\u043C \u0441\u0432\u043E\u0435\u0439 \u043A\u0430\u043F\u0441\u0443\u043B\u044B \u0438 \u043E\u0431\u0440\u0435\u0437\u0430\u043B\u043E\u0441\u044C, \u043E\u0442\u0447\u0435\u0433\u043E \u0441\u043A\u0440\u0443\u0433\u043B\u0451\u043D\u043D\u044B\u0439 \u043A\u043E\u043D\u0447\u0438\u043A
|
|
1289
|
+
// \u0432\u044B\u0433\u043B\u044F\u0434\u0435\u043B \u0440\u0443\u0431\u043B\u0435\u043D\u044B\u043C. \u0420\u0430\u0441\u043A\u043B\u0430\u0434\u043A\u0430 \u043F\u043E \u043E\u0442\u0440\u0435\u0437\u043A\u0443 \u0443\u0431\u0438\u0440\u0430\u0435\u0442 \u043F\u0440\u0438\u0447\u0438\u043D\u0443: \u0441\u0442\u0440\u0435\u043B\u043A\u0430 \u0446\u0435\u043B\u0438\u043A\u043E\u043C
|
|
1290
|
+
// \u043B\u0435\u0436\u0438\u0442 \u043D\u0430 \u043E\u0434\u043D\u043E\u0439 \u043A\u0430\u043F\u0441\u0443\u043B\u0435, \u0430 \u043A\u043E\u0440\u043E\u0442\u043A\u0438\u0439 \u043E\u0442\u0440\u0435\u0437\u043E\u043A \u0441\u0442\u0440\u0435\u043B\u043A\u0438 \u043F\u0440\u043E\u0441\u0442\u043E \u043D\u0435 \u043F\u043E\u043B\u0443\u0447\u0430\u0435\u0442.
|
|
1291
|
+
//
|
|
1292
|
+
// \u2605 \xAB\u041D\u0435 \u043F\u043E\u043B\u0443\u0447\u0430\u0435\u0442 \u0441\u0442\u0440\u0435\u043B\u043A\u0438\xBB \u044D\u0442\u043E \u041E\u0414\u041D\u041E \u0414\u0420\u0415\u0412\u041A\u041E \u0432\u043E \u0432\u0441\u044E \u0434\u043B\u0438\u043D\u0443 \u043E\u0442\u0440\u0435\u0437\u043A\u0430, \u0430 \u043D\u0435 \u043F\u0443\u0441\u0442\u043E\u0442\u0430.
|
|
1293
|
+
// \u0422\u0430\u043A \u0436\u0435 \u0443\u0441\u0442\u0440\u043E\u0435\u043D \u0441\u0435\u0440\u0432\u0435\u0440\u043D\u044B\u0439 \u0440\u0430\u0441\u0442\u0440: \u043F\u043E\u043B\u043E\u0442\u043D\u043E \u0440\u0438\u0441\u0443\u0435\u0442\u0441\u044F \u0432\u0441\u0435\u0433\u0434\u0430, \u0433\u043E\u043B\u043E\u0432\u044B \u0441\u0442\u0430\u0432\u044F\u0442\u0441\u044F
|
|
1294
|
+
// \u0441\u0432\u0435\u0440\u0445\u0443 \u0438 \u0442\u043E\u043B\u044C\u043A\u043E \u043D\u0430 \u0434\u043E\u0441\u0442\u0430\u0442\u043E\u0447\u043D\u043E \u0434\u043B\u0438\u043D\u043D\u044B\u0445 \u0440\u0451\u0431\u0440\u0430\u0445. \u041F\u0443\u0441\u0442\u043E\u0442\u0430 \u0437\u0434\u0435\u0441\u044C \u043E\u0437\u043D\u0430\u0447\u0430\u043B\u0430 \u0431\u044B, \u0447\u0442\u043E
|
|
1295
|
+
// \u0443\u0447\u0430\u0441\u0442\u043E\u043A \u0434\u043E\u0440\u043E\u0433\u0438 \u0431\u0435\u0437 \u043F\u0440\u043E\u0431\u043A\u0438, \u2014 \u0430 \u043E\u043D \u0441 \u043F\u0440\u043E\u0431\u043A\u043E\u0439, \u043F\u0440\u043E\u0441\u0442\u043E \u043A\u043E\u0440\u043E\u0442\u043A\u0438\u0439; \u043D\u0430 \u043C\u0435\u043B\u043A\u043E\u043C \u0437\u0443\u043C\u0435,
|
|
1296
|
+
// \u0433\u0434\u0435 \u0441\u0442\u0440\u0435\u043B\u043A\u0430 \u0434\u043B\u0438\u043D\u043D\u0435\u0435 \u043F\u043E\u043B\u043E\u0432\u0438\u043D\u044B \u0443\u043B\u0438\u0446\u044B, \u0442\u0430\u043A \u043F\u0440\u043E\u043F\u0430\u0434\u0430\u043B \u0431\u044B \u0412\u0415\u0421\u042C \u0441\u043B\u043E\u0439.
|
|
1297
|
+
//
|
|
1298
|
+
// \u2605 \u041F\u0440\u043E\u0441\u0432\u0435\u0442 \u0434\u0435\u0440\u0436\u0438\u043C \u0438 \u041D\u0410 \u0421\u0422\u042B\u041A\u0415. \u0420\u0430\u0441\u043A\u043B\u0430\u0434\u043A\u0430 \u0443 \u043A\u0430\u0436\u0434\u043E\u0433\u043E \u043E\u0442\u0440\u0435\u0437\u043A\u0430 \u0441\u0432\u043E\u044F, \u0438 \u0431\u0435\u0437 \u043F\u043E\u043B\u0435\u0439
|
|
1299
|
+
// \u043F\u043E \u043A\u0440\u0430\u044F\u043C \u043F\u043E\u0441\u043B\u0435\u0434\u043D\u044F\u044F \u0441\u0442\u0440\u0435\u043B\u043A\u0430 \u043E\u0434\u043D\u043E\u0433\u043E \u043E\u0442\u0440\u0435\u0437\u043A\u0430 \u0443\u043F\u0438\u0440\u0430\u043B\u0430\u0441\u044C \u0432 \u043F\u0435\u0440\u0432\u0443\u044E \u0441\u0442\u0440\u0435\u043B\u043A\u0443
|
|
1300
|
+
// \u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0435\u0433\u043E: \u043D\u0430 \u0438\u0437\u0432\u0438\u043B\u0438\u0441\u0442\u043E\u0439 \u0434\u043E\u0440\u043E\u0433\u0435, \u0440\u0430\u0437\u0431\u0438\u0442\u043E\u0439 \u043D\u0430 \u043A\u043E\u0440\u043E\u0442\u043A\u0438\u0435 \u0437\u0432\u0435\u043D\u044C\u044F, \u0441\u0442\u0440\u0435\u043B\u043A\u0438
|
|
1301
|
+
// \u043D\u0430\u0435\u0437\u0436\u0430\u043B\u0438 \u0434\u0440\u0443\u0433 \u043D\u0430 \u0434\u0440\u0443\u0433\u0430 \u043A\u0443\u0447\u0435\u0439 \u2014 \u0442\u0435\u043C \u0437\u0430\u043C\u0435\u0442\u043D\u0435\u0435, \u0447\u0442\u043E \u043D\u0430 \u0438\u0437\u043B\u043E\u043C\u0435 \u043A\u0430\u043F\u0441\u0443\u043B\u044B \u0441\u043E\u0441\u0435\u0434\u0435\u0439
|
|
1302
|
+
// \u0435\u0449\u0451 \u0438 \u043F\u0435\u0440\u0435\u043A\u0440\u044B\u0432\u0430\u044E\u0442\u0441\u044F. \u0420\u0435\u0437\u0435\u0440\u0432\u0438\u0440\u0443\u0435\u043C \u043F\u043E \u041F\u041E\u041B\u041E\u0412\u0418\u041D\u0415 \u043F\u0440\u043E\u0441\u0432\u0435\u0442\u0430 \u0441 \u043A\u0430\u0436\u0434\u043E\u0439 \u0441\u0442\u043E\u0440\u043E\u043D\u044B,
|
|
1303
|
+
// \u0442\u043E\u0433\u0434\u0430 \u0447\u0435\u0440\u0435\u0437 \u0441\u0442\u044B\u043A \u043E\u0441\u0442\u0430\u0451\u0442\u0441\u044F \u0442\u043E\u0442 \u0436\u0435 \u043F\u0440\u043E\u0441\u0432\u0435\u0442, \u0447\u0442\u043E \u0438 \u0432\u043D\u0443\u0442\u0440\u0438 \u043E\u0442\u0440\u0435\u0437\u043A\u0430.
|
|
1304
|
+
float gap = max(period - total, 0.0);
|
|
1305
|
+
float room = segLen - gap;
|
|
1306
|
+
if (room < total) {
|
|
1307
|
+
vec2 tail = vec2(s, lateral) - vec2(clamp(s, 0.0, segLen), 0.0);
|
|
1308
|
+
return length(tail) - shaftHalf;
|
|
1309
|
+
}
|
|
1310
|
+
float count = max(floor((room + gap) / period), 1.0);
|
|
1311
|
+
float used = count * period - gap;
|
|
1312
|
+
float x = s - (segLen - used) * 0.5; // \u0440\u044F\u0434 \u0441\u0442\u0440\u0435\u043B\u043E\u043A \u043F\u043E \u0446\u0435\u043D\u0442\u0440\u0443 \u043E\u0442\u0440\u0435\u0437\u043A\u0430
|
|
1313
|
+
|
|
1314
|
+
// \u0421\u043A\u0440\u0443\u0433\u043B\u0435\u043D\u0438\u0435 \u041E\u0421\u0422\u0420\u0418\u042F, \u0443\u0433\u043B\u043E\u0432 \u0433\u043E\u043B\u043E\u0432\u044B \u0438 \u0422\u041E\u0420\u0426\u0410 \u0414\u0420\u0415\u0412\u041A\u0410. \u0420\u0430\u0434\u0438\u0443\u0441 \u0440\u0430\u0432\u0435\u043D \u043F\u043E\u043B\u0443\u0448\u0438\u0440\u0438\u043D\u0435
|
|
1315
|
+
// \u0434\u0440\u0435\u0432\u043A\u0430 \u2014 \u0440\u043E\u0432\u043D\u043E \u0441\u0442\u043E\u043B\u044C\u043A\u043E \u0436\u0435 \u0443 \u043A\u0440\u0443\u0433\u043B\u043E\u0433\u043E \u043A\u043E\u043D\u0446\u0430 \u043B\u0438\u043D\u0438\u0438 \u043C\u0430\u0440\u0448\u0440\u0443\u0442\u0430. \u0424\u0438\u0433\u0443\u0440\u0430 \u0441\u0442\u0440\u043E\u0438\u0442\u0441\u044F
|
|
1316
|
+
// \u0443\u043C\u0435\u043D\u044C\u0448\u0435\u043D\u043D\u043E\u0439 \u043D\u0430 \u0440\u0430\u0434\u0438\u0443\u0441 \u0438 \u0440\u0430\u0437\u0434\u0443\u0432\u0430\u0435\u0442\u0441\u044F \u043E\u0431\u0440\u0430\u0442\u043D\u043E, \u043F\u043E\u044D\u0442\u043E\u043C\u0443 \u0440\u0430\u0437\u043C\u0435\u0440 \u043D\u0435 \u043C\u0435\u043D\u044F\u0435\u0442\u0441\u044F.
|
|
1317
|
+
float r = min(shaftHalf, headLen * 0.45);
|
|
1318
|
+
|
|
1319
|
+
// \u0421\u043E\u0441\u0435\u0434\u043D\u044E\u044E \u0441\u0442\u0440\u0435\u043B\u043A\u0443 \u043F\u0440\u043E\u0432\u0435\u0440\u044F\u0435\u043C \u0422\u041E\u0416\u0415. \u041A\u0440\u0443\u0433\u043B\u044B\u0439 \u0442\u043E\u0440\u0435\u0446 \u0434\u0440\u0435\u0432\u043A\u0430 \u0438 \u043E\u0431\u0432\u043E\u0434\u043A\u0430 \u0432\u044B\u0445\u043E\u0434\u044F\u0442
|
|
1320
|
+
// \u0417\u0410 \u043F\u0440\u0435\u0434\u0435\u043B\u044B \u0441\u0432\u043E\u0435\u0433\u043E \u043F\u0435\u0440\u0438\u043E\u0434\u0430, \u0438 \xAB\u0432\u0437\u044F\u0442\u044C \u043E\u0441\u0442\u0430\u0442\u043E\u043A \u043E\u0442 \u0434\u0435\u043B\u0435\u043D\u0438\u044F\xBB \u0438\u0445 \u0441\u0440\u0435\u0437\u0430\u0435\u0442: \u0445\u0432\u043E\u0441\u0442
|
|
1321
|
+
// \u0441\u0442\u0440\u0435\u043B\u043A\u0438 \u043E\u043A\u0430\u0437\u044B\u0432\u0430\u043B\u0441\u044F \u043F\u043B\u043E\u0441\u043A\u0438\u043C \u0438 \u0431\u0435\u0437 \u043A\u0430\u0439\u043C\u044B. \u0414\u0432\u0443\u0445 \u043A\u0430\u043D\u0434\u0438\u0434\u0430\u0442\u043E\u0432 \u0445\u0432\u0430\u0442\u0430\u0435\u0442 \u2014 \u0434\u0430\u043B\u044C\u0448\u0435
|
|
1322
|
+
// \u0441\u043E\u0441\u0435\u0434\u0430 \u0444\u0438\u0433\u0443\u0440\u0430 \u043D\u0435 \u0434\u043E\u0441\u0442\u0430\u0451\u0442.
|
|
1323
|
+
float base = floor(x / period);
|
|
1324
|
+
float d = 1e9;
|
|
1325
|
+
for (int k = 0; k < 2; k++) {
|
|
1326
|
+
float idx = clamp(base + float(k), 0.0, count - 1.0);
|
|
1327
|
+
d = min(d, arrowShape(x - idx * period, lateral, r));
|
|
1328
|
+
}
|
|
1329
|
+
return d;
|
|
1330
|
+
}
|
|
1331
|
+
|
|
1332
|
+
out vec4 fragColor;
|
|
1333
|
+
|
|
1334
|
+
void main() {
|
|
1335
|
+
vec2 d = v_p1 - v_p0;
|
|
1336
|
+
float t = clamp(dot(v_pos - v_p0, d) / max(dot(d, d), 1e-9), 0.0, 1.0);
|
|
1337
|
+
// \u0420\u0430\u0441\u0441\u0442\u043E\u044F\u043D\u0438\u0435 \u0434\u043E \u043E\u0441\u0438 \u2014 \u0432 \u0415\u0414\u0418\u041D\u0418\u0426\u0410\u0425 \u0422\u0410\u0419\u041B\u0410: \u043A\u0430\u043F\u0441\u0443\u043B\u0430 \u0436\u0438\u0432\u0451\u0442 \u043D\u0430 \u0437\u0435\u043C\u043B\u0435 \u0432\u043C\u0435\u0441\u0442\u0435 \u0441
|
|
1338
|
+
// \u044D\u043A\u0441\u0442\u0440\u0443\u0437\u0438\u0435\u0439, \u043F\u043E\u044D\u0442\u043E\u043C\u0443 \u043A\u0440\u0443\u0433\u043B\u044B\u0435 \u0441\u0442\u044B\u043A\u0438 \u0438 \u043A\u043E\u043D\u0446\u044B \u0441\u043E\u0445\u0440\u0430\u043D\u0438\u043B\u0438\u0441\u044C, \u0430 \u0441\u043E\u043A\u0440\u0430\u0449\u0435\u043D\u0438\u0435 \u043F\u0440\u0438
|
|
1339
|
+
// \u043D\u0430\u043A\u043B\u043E\u043D\u0435 \u0431\u0435\u0440\u0451\u0442 \u043D\u0430 \u0441\u0435\u0431\u044F \u043F\u0440\u043E\u0435\u043A\u0446\u0438\u044F.
|
|
1340
|
+
float dist = distance(v_pos, v_p0 + d * t);
|
|
1341
|
+
|
|
1342
|
+
// \u0421\u043A\u043E\u043B\u044C\u043A\u043E \u0435\u0434\u0438\u043D\u0438\u0446 \u0442\u0430\u0439\u043B\u0430 \u043F\u0440\u0438\u0445\u043E\u0434\u0438\u0442\u0441\u044F \u043D\u0430 \u043F\u0438\u043A\u0441\u0435\u043B\u044C \u0417\u0414\u0415\u0421\u042C \u2014 \u043F\u0440\u044F\u043C\u043E \u0438\u0437 \u043F\u0440\u043E\u0438\u0437\u0432\u043E\u0434\u043D\u044B\u0445.
|
|
1343
|
+
// \u042D\u0442\u043E \u0438 \u0435\u0441\u0442\u044C \u043F\u0435\u0440\u0441\u043F\u0435\u043A\u0442\u0438\u0432\u0430, \u043F\u043E\u0441\u0447\u0438\u0442\u0430\u043D\u043D\u0430\u044F \u0442\u043E\u0447\u043D\u043E \u043D\u0430 \u043A\u0430\u0436\u0434\u043E\u043C \u043F\u0438\u043A\u0441\u0435\u043B\u0435, \u0431\u0435\u0437 \u0435\u0434\u0438\u043D\u043E\u0433\u043E
|
|
1344
|
+
// \u044E\u043D\u0438\u0444\u043E\u0440\u043C\u0430: \u0443 \u0434\u0430\u043B\u044C\u043D\u0435\u0433\u043E \u043A\u0440\u0430\u044F \u0434\u043E\u0440\u043E\u0433\u0438 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u0431\u043E\u043B\u044C\u0448\u0435, \u0443 \u0431\u043B\u0438\u0436\u043D\u0435\u0433\u043E \u043C\u0435\u043D\u044C\u0448\u0435.
|
|
1345
|
+
float px = max(fwidth(dist), 1e-9);
|
|
1346
|
+
|
|
1347
|
+
// \u0422\u043E\u043D\u044C\u0448\u0435 \u043F\u0438\u043A\u0441\u0435\u043B\u044F \u0434\u043E\u0440\u043E\u0433\u0430 \u0443\u0445\u043E\u0434\u0438\u0442 \u0432 \u043F\u0440\u043E\u0437\u0440\u0430\u0447\u043D\u043E\u0441\u0442\u044C, \u0430 \u043D\u0435 \u0432 \u0441\u0435\u0440\u0443\u044E \u0440\u0430\u0437\u043C\u0430\u0437\u043D\u044E:
|
|
1348
|
+
// \u0432\u0438\u0434\u0438\u043C\u0430\u044F \u0448\u0438\u0440\u0438\u043D\u0430 \u043E\u0441\u0442\u0430\u0451\u0442\u0441\u044F \u043F\u0438\u043A\u0441\u0435\u043B\u044C\u043D\u043E\u0439, \u0430 \u043D\u0435\u0434\u043E\u0441\u0442\u0430\u044E\u0449\u0443\u044E \u0442\u043E\u043B\u0449\u0438\u043D\u0443 \u043A\u043E\u043C\u043F\u0435\u043D\u0441\u0438\u0440\u0443\u0435\u0442
|
|
1349
|
+
// \u0430\u043B\u044C\u0444\u0430.
|
|
1350
|
+
//
|
|
1351
|
+
// \u041F\u043E\u0434\u044A\u0451\u043C \u0448\u0438\u0440\u0438\u043D\u044B \u0434\u043E \u043F\u0438\u043A\u0441\u0435\u043B\u044F \u041E\u0411\u042F\u0417\u0410\u041D \u0431\u044B\u0442\u044C \u043E\u0433\u0440\u0430\u043D\u0438\u0447\u0435\u043D. \u0423 \u0441\u0430\u043C\u043E\u0433\u043E \u0433\u043E\u0440\u0438\u0437\u043E\u043D\u0442\u0430 \u043D\u0430 \u043E\u0434\u0438\u043D
|
|
1352
|
+
// \u043F\u0438\u043A\u0441\u0435\u043B\u044C \u043F\u0440\u0438\u0445\u043E\u0434\u044F\u0442\u0441\u044F \u0434\u0435\u0441\u044F\u0442\u043A\u0438 \u0435\u0434\u0438\u043D\u0438\u0446 \u0442\u0430\u0439\u043B\u0430, \u0438 \xAB\u043F\u043E\u043B\u043F\u0438\u043A\u0441\u0435\u043B\u044F\xBB \u043F\u0440\u0435\u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044F \u0432
|
|
1353
|
+
// \u0434\u0435\u0441\u044F\u0442\u043A\u0438 \u043C\u0435\u0442\u0440\u043E\u0432: \u0434\u043E\u0440\u043E\u0433\u0430 \u0440\u0430\u0441\u043F\u043B\u044B\u0432\u0430\u0435\u0442\u0441\u044F \u043E\u0440\u0430\u043D\u0436\u0435\u0432\u044B\u043C \u043F\u044F\u0442\u043D\u043E\u043C \u0432\u043E \u0432\u0435\u0441\u044C \u0441\u043A\u043B\u043E\u043D. \u042D\u0442\u043E \u0438
|
|
1354
|
+
// \u0431\u044B\u043B\u043E \u0432\u0438\u0434\u043D\u043E \u043F\u0440\u0438 \u043D\u0430\u043A\u043B\u043E\u043D\u0435 60\xB0.
|
|
1355
|
+
float widthPx = 2.0 * v_half_width / px;
|
|
1356
|
+
float hw = max(v_half_width, min(px * 0.5, v_half_width * 2.0));
|
|
1357
|
+
|
|
1358
|
+
// \u0421\u0433\u043B\u0430\u0436\u0438\u0432\u0430\u043D\u0438\u0435 \u0440\u043E\u0432\u043D\u043E \u0432 \u043F\u043E\u043B\u043F\u0438\u043A\u0441\u0435\u043B\u044F \u0441 \u043A\u0430\u0436\u0434\u043E\u0439 \u0441\u0442\u043E\u0440\u043E\u043D\u044B \u043A\u0440\u0430\u044F. \u0428\u0438\u0440\u0435 \u2014 \u043B\u0438\u043D\u0438\u044F
|
|
1359
|
+
// \xAB\u043C\u044B\u043B\u0438\u0442\u0441\u044F\xBB, \u0443\u0436\u0435 \u2014 \u043D\u0430 \u0434\u0438\u0430\u0433\u043E\u043D\u0430\u043B\u044F\u0445 \u043B\u0435\u0437\u0443\u0442 \u0441\u0442\u0443\u043F\u0435\u043D\u044C\u043A\u0438.
|
|
1360
|
+
float alpha = 1.0 - smoothstep(hw - px * 0.5, hw + px * 0.5, dist);
|
|
1361
|
+
alpha *= min(widthPx, 1.0);
|
|
1362
|
+
|
|
1363
|
+
// \u0420\u0438\u0441\u0443\u043D\u043E\u043A \u0432\u0434\u043E\u043B\u044C \u043B\u0438\u043D\u0438\u0438 \u0441\u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044F \u0432 \u043F\u0438\u043A\u0441\u0435\u043B\u044F\u0445 \u0446\u0435\u043D\u0442\u0440\u0430 \u043A\u0430\u0440\u0442\u044B \u2014 \u0442\u0430\u043C \u0436\u0435, \u0433\u0434\u0435 \u0437\u0430\u0434\u0430\u043D
|
|
1364
|
+
// \u0441\u0442\u0438\u043B\u0435\u043C \u043F\u0443\u043D\u043A\u0442\u0438\u0440 \u0438 \u0440\u0430\u0437\u043C\u0435\u0440 \u0441\u0442\u0440\u0435\u043B\u043E\u043A.
|
|
1365
|
+
float distPx = dist * u_tile_to_px;
|
|
1366
|
+
|
|
1367
|
+
float along = v_dist0 + t * v_seg_len;
|
|
1368
|
+
vec4 color = u_color;
|
|
1369
|
+
|
|
1370
|
+
// \u041C\u0430\u0442\u0435\u0440\u0438\u0430\u043B \u043F\u043E\u043B\u043E\u0442\u043D\u0430 (\u0430\u0441\u0444\u0430\u043B\u044C\u0442 \u0438 \u043F\u0440\u043E\u0447\u0435\u0435). \u041C\u0438\u0440\u043E\u0432\u0430\u044F \u0442\u043E\u0447\u043A\u0430 \u0431\u0435\u0440\u0451\u0442\u0441\u044F \u0442\u0435\u043C \u0436\u0435
|
|
1371
|
+
// \u043F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u043E\u043C t, \u0447\u0442\u043E \u0438 \u0440\u0430\u0441\u0441\u0442\u043E\u044F\u043D\u0438\u0435 \u0434\u043E \u043E\u0441\u0438: \u043F\u0435\u0440\u0441\u043F\u0435\u043A\u0442\u0438\u0432\u043D\u043E\u0435 \u0438\u0441\u043A\u0430\u0436\u0435\u043D\u0438\u0435 \u0432\u0434\u043E\u043B\u044C
|
|
1372
|
+
// \u043A\u043E\u0440\u043E\u0442\u043A\u043E\u0433\u043E \u043E\u0442\u0440\u0435\u0437\u043A\u0430 \u0434\u043E\u0440\u043E\u0433\u0438 \u043D\u0430 \u0440\u0438\u0441\u0443\u043D\u043E\u043A \u0437\u0435\u0440\u043D\u0430 \u043D\u0435 \u0432\u043B\u0438\u044F\u0435\u0442.
|
|
1373
|
+
if (u_material != 0) color.rgb = applyMaterial(color.rgb, mix(v_world0, v_world1, t));
|
|
1374
|
+
|
|
1375
|
+
if (u_pattern == 1) {
|
|
1376
|
+
// \u041F\u0443\u043D\u043A\u0442\u0438\u0440: \u0441\u0433\u043B\u0430\u0436\u0438\u0432\u0430\u0435\u043C \u041E\u0411\u0410 \u043A\u0440\u0430\u044F \u0448\u0442\u0440\u0438\u0445\u0430, \u0438\u043D\u0430\u0447\u0435 \u043D\u0430 \u043F\u043E\u043B\u043E\u0433\u0438\u0445 \u0434\u043E\u0440\u043E\u0433\u0430\u0445
|
|
1377
|
+
// \u043F\u043E\u044F\u0432\u043B\u044F\u0435\u0442\u0441\u044F \u0440\u044F\u0431\u044C \u043E\u0442 \u043F\u043E\u043F\u0430\u0434\u0430\u043D\u0438\u044F \u043A\u0440\u0430\u044F \u0448\u0442\u0440\u0438\u0445\u0430 \u043C\u0435\u0436\u0434\u0443 \u043F\u0438\u043A\u0441\u0435\u043B\u044F\u043C\u0438.
|
|
1378
|
+
float phase = mod(along, u_dash.y);
|
|
1379
|
+
float edge = min(phase, u_dash.x - phase);
|
|
1380
|
+
alpha *= clamp(edge + 0.5, 0.0, 1.0);
|
|
1381
|
+
} else if (u_pattern == 2) {
|
|
1382
|
+
float a = chevron(along, distPx, 1.0);
|
|
1383
|
+
color = mix(color, u_arrow_color, a);
|
|
1384
|
+
} else if (u_pattern == 3) {
|
|
1385
|
+
float a = head(along, distPx, 1.0);
|
|
1386
|
+
color = mix(color, u_arrow_color, a);
|
|
1387
|
+
} else if (u_pattern == 4) {
|
|
1388
|
+
// \u0421\u043B\u043E\u0439-\u043E\u0441\u0442\u0440\u0438\u0451: \u043F\u043E\u043B\u043E\u0442\u043D\u0430 \u0443 \u043D\u0435\u0433\u043E \u043D\u0435\u0442 \u0432\u043E\u0432\u0441\u0435, \u0432\u0438\u0434\u043D\u0430 \u0442\u043E\u043B\u044C\u043A\u043E \u0441\u0430\u043C\u0430 \u0441\u0442\u0440\u0435\u043B\u043A\u0430. \u0422\u0430\u043A
|
|
1389
|
+
// \u0440\u0438\u0441\u0443\u0435\u0442 \u0441\u0435\u0440\u0432\u0435\u0440 \u2014 \u0442\u0440\u0435\u0443\u0433\u043E\u043B\u044C\u043D\u0438\u043A \u0428\u0418\u0420\u0415 \u043B\u0435\u043D\u0442\u044B, \u0441\u0432\u043E\u0435\u0433\u043E \u0446\u0432\u0435\u0442\u0430 \u0438 \u0441\u043E \u0441\u0432\u043E\u0435\u0439 \u043A\u0430\u0439\u043C\u043E\u0439, \u2014
|
|
1390
|
+
// \u0438 \u043F\u043E\u0432\u0442\u043E\u0440\u0438\u0442\u044C \u044D\u0442\u043E \u043E\u0434\u043D\u0438\u043C \u043F\u043E\u043B\u043E\u0442\u043D\u043E\u043C \u043D\u0435\u043B\u044C\u0437\u044F: \u043E\u0441\u0442\u0440\u0438\u0451 \u0432\u044B\u0445\u043E\u0434\u0438\u0442 \u0437\u0430 \u0435\u0433\u043E \u043A\u0440\u0430\u044F.
|
|
1391
|
+
alpha *= head(along, distPx, 1.0);
|
|
1392
|
+
} else if (u_pattern == 5) {
|
|
1393
|
+
// \u0421\u0442\u0440\u0435\u043B\u043A\u0430-\u0448\u0442\u0440\u0438\u0445: \u043F\u043E\u043B\u043E\u0442\u043D\u0430 \u043D\u0435\u0442, \u0432\u0438\u0434\u043D\u0430 \u0440\u043E\u0432\u043D\u043E \u0444\u0438\u0433\u0443\u0440\u0430 \u0441\u0442\u0440\u0435\u043B\u043A\u0438. \u041E\u0431\u0432\u043E\u0434\u043A\u0430 \u2014 \u0422\u0410 \u0416\u0415
|
|
1394
|
+
// \u0444\u0438\u0433\u0443\u0440\u0430, \u0440\u0430\u0437\u0434\u0443\u0442\u0430\u044F \u043D\u0430 u_dash.x: \u0443 \u0437\u043D\u0430\u043A\u043E\u0432\u043E\u0433\u043E \u0440\u0430\u0441\u0441\u0442\u043E\u044F\u043D\u0438\u044F \u044D\u0442\u043E \u043F\u0440\u043E\u0441\u0442\u043E \u0441\u0434\u0432\u0438\u0433
|
|
1395
|
+
// \u043F\u043E\u0440\u043E\u0433\u0430, \u0438 \u043A\u0440\u0430\u044F \u0441\u043A\u0440\u0443\u0433\u043B\u044F\u044E\u0442\u0441\u044F \u0441\u0430\u043C\u0438.
|
|
1396
|
+
alpha *= 1.0 - smoothstep(-0.5, 0.5, arrowDash(t * v_seg_len, v_seg_len, distPx) - u_dash.x);
|
|
1397
|
+
}
|
|
1398
|
+
|
|
1399
|
+
if (alpha <= 0.003) discard;
|
|
1400
|
+
fragColor = applyFogPremultiplied(color) * alpha;
|
|
1401
|
+
}
|
|
1402
|
+
`,Oa=`#version 300 es
|
|
1403
|
+
precision highp float;
|
|
1404
|
+
|
|
1405
|
+
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
|
|
1406
|
+
in vec2 a_extrude; // \u043A\u0443\u0434\u0430 \u0440\u0430\u0437\u0434\u0443\u0432\u0430\u0442\u044C: \u0435\u0434\u0438\u043D\u0438\u0447\u043D\u044B\u0439 \u0432\u0435\u043A\u0442\u043E\u0440 (\u0432 \u0441\u0442\u044B\u043A\u0435 \u0434\u043B\u0438\u043D\u043D\u0435\u0435 \u2014 \u043C\u0438\u0442\u0440\u0430)
|
|
1407
|
+
in float a_side; // \u22121 | 0 | +1 \u2014 \u0441\u0442\u043E\u0440\u043E\u043D\u0430 \u043F\u043E\u043B\u043E\u0442\u043D\u0430, 0 \u0432 \u0446\u0435\u043D\u0442\u0440\u0435 \u0441\u043A\u0440\u0443\u0433\u043B\u0435\u043D\u0438\u044F
|
|
1408
|
+
in float a_dist; // \u0440\u0430\u0441\u0441\u0442\u043E\u044F\u043D\u0438\u0435 \u0432\u0434\u043E\u043B\u044C \u043B\u0438\u043D\u0438\u0438, \u0435\u0434\u0438\u043D\u0438\u0446\u044B \u043E\u0431\u044A\u0435\u043A\u0442\u0430
|
|
1409
|
+
|
|
1410
|
+
uniform mat4 u_matrix;
|
|
1411
|
+
/** \u041F\u043E\u043B\u0443\u0448\u0438\u0440\u0438\u043D\u0430, \u0441\u0434\u0432\u0438\u0433 \u0438 \u0437\u0430\u043F\u0430\u0441 \u043D\u0430 \u0441\u0433\u043B\u0430\u0436\u0438\u0432\u0430\u043D\u0438\u0435 \u2014 \u0412 \u041F\u0418\u041A\u0421\u0415\u041B\u042F\u0425. */
|
|
1412
|
+
uniform float u_half_width;
|
|
1413
|
+
uniform float u_offset;
|
|
1414
|
+
uniform float u_aa;
|
|
1415
|
+
/** \u0415\u0434\u0438\u043D\u0438\u0446 \u043E\u0431\u044A\u0435\u043A\u0442\u0430 \u0432 \u043F\u0438\u043A\u0441\u0435\u043B\u0435 \u0438 \u043E\u0431\u0440\u0430\u0442\u043D\u044B\u0439 \u0435\u043C\u0443 \u043C\u043D\u043E\u0436\u0438\u0442\u0435\u043B\u044C \u0434\u043B\u044F \u0440\u0438\u0441\u0443\u043D\u043A\u0430 \u0432\u0434\u043E\u043B\u044C \u043B\u0438\u043D\u0438\u0438. */
|
|
1416
|
+
uniform float u_units_per_px;
|
|
1417
|
+
uniform float u_units_to_px;
|
|
1418
|
+
|
|
1419
|
+
out float v_side;
|
|
1420
|
+
out float v_outset; // \u043F\u043E\u043B\u0443\u0448\u0438\u0440\u0438\u043D\u0430 \u0432\u043C\u0435\u0441\u0442\u0435 \u0441 \u0437\u0430\u043F\u0430\u0441\u043E\u043C, \u043F\u0438\u043A\u0441\u0435\u043B\u0438
|
|
1421
|
+
out float v_half; // \u043F\u043E\u043B\u0443\u0448\u0438\u0440\u0438\u043D\u0430, \u043F\u0438\u043A\u0441\u0435\u043B\u0438
|
|
1422
|
+
out float v_dist; // \u043F\u0438\u043A\u0441\u0435\u043B\u0438 \u0432\u0434\u043E\u043B\u044C \u043B\u0438\u043D\u0438\u0438
|
|
1423
|
+
|
|
1424
|
+
void main() {
|
|
1425
|
+
float outset = u_half_width + u_aa;
|
|
1426
|
+
// \u0421\u0434\u0432\u0438\u0433 \u043F\u043E\u043F\u0435\u0440\u0451\u043A \u043F\u043E\u043B\u043E\u0442\u043D\u0430 \u0438\u0434\u0451\u0442 \u043F\u043E \u0442\u043E\u0439 \u0436\u0435 \u0431\u0438\u0441\u0441\u0435\u043A\u0442\u0440\u0438\u0441\u0435 \u2014 \u043F\u0430\u0440\u0430\u043B\u043B\u0435\u043B\u044C\u043D\u0430\u044F \u043B\u0438\u043D\u0438\u044F
|
|
1427
|
+
// \u043E\u0441\u0442\u0430\u0451\u0442\u0441\u044F \u043F\u0430\u0440\u0430\u043B\u043B\u0435\u043B\u044C\u043D\u043E\u0439 \u0438 \u043D\u0430 \u0438\u0437\u043B\u043E\u043C\u0430\u0445.
|
|
1428
|
+
vec2 shift = a_extrude * (outset + u_offset * a_side) * u_units_per_px;
|
|
1429
|
+
gl_Position = u_matrix * vec4(a_pos + shift, 0.0, 1.0);
|
|
1430
|
+
|
|
1431
|
+
v_side = a_side;
|
|
1432
|
+
v_outset = outset;
|
|
1433
|
+
v_half = u_half_width;
|
|
1434
|
+
v_dist = a_dist * u_units_to_px;
|
|
1435
|
+
}
|
|
1436
|
+
`,Wa=`#version 300 es
|
|
1437
|
+
precision highp float;
|
|
1438
|
+
|
|
1439
|
+
${Xe}
|
|
1440
|
+
|
|
1441
|
+
in float v_side;
|
|
1442
|
+
in float v_outset;
|
|
1443
|
+
in float v_half;
|
|
1444
|
+
in float v_dist;
|
|
1445
|
+
|
|
1446
|
+
uniform vec4 u_color; // premultiplied
|
|
1447
|
+
uniform int u_pattern; // 0 \u2014 \u0441\u043F\u043B\u043E\u0448\u043D\u0430\u044F, 1 \u2014 \u043F\u0443\u043D\u043A\u0442\u0438\u0440, 2 \u2014 \u0441\u0442\u0440\u0435\u043B\u043A\u0438
|
|
1448
|
+
uniform vec2 u_dash; // (\u0448\u0442\u0440\u0438\u0445, \u043F\u0435\u0440\u0438\u043E\u0434) \u0432 \u043F\u0438\u043A\u0441\u0435\u043B\u044F\u0445
|
|
1449
|
+
uniform vec4 u_arrow_color; // premultiplied
|
|
1450
|
+
uniform vec3 u_arrow; // (\u043F\u0435\u0440\u0438\u043E\u0434, \u0442\u043E\u043B\u0449\u0438\u043D\u0430 \u0448\u0442\u0440\u0438\u0445\u0430, \u0440\u0430\u0437\u043C\u0430\u0445 \u043F\u043E\u043F\u0435\u0440\u0451\u043A) \u0432 \u043F\u0438\u043A\u0441\u0435\u043B\u044F\u0445
|
|
1451
|
+
|
|
1452
|
+
out vec4 fragColor;
|
|
1453
|
+
|
|
1454
|
+
/** \u0428\u0435\u0432\u0440\u043E\u043D \xAB\u043F\u0442\u0438\u0447\u043A\u043E\u0439\xBB \u043F\u043E \u043D\u0430\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u044E \u043B\u0438\u043D\u0438\u0438 \u2014 \u0442\u043E\u0442 \u0436\u0435, \u0447\u0442\u043E \u0443 \u0442\u0430\u0439\u043B\u043E\u0432\u044B\u0445 \u043B\u0438\u043D\u0438\u0439. */
|
|
1455
|
+
float chevron(float along, float lateral) {
|
|
1456
|
+
float x = mod(along, u_arrow.x) - u_arrow.x * 0.5;
|
|
1457
|
+
float d = abs(x + abs(lateral)) / sqrt(2.0);
|
|
1458
|
+
float a = 1.0 - smoothstep(u_arrow.y * 0.5 - 0.5, u_arrow.y * 0.5 + 0.5, d);
|
|
1459
|
+
a *= 1.0 - smoothstep(u_arrow.z - 0.5, u_arrow.z + 0.5, abs(lateral));
|
|
1460
|
+
return a;
|
|
1461
|
+
}
|
|
1462
|
+
|
|
1463
|
+
void main() {
|
|
1464
|
+
// \u0420\u0430\u0441\u0441\u0442\u043E\u044F\u043D\u0438\u0435 \u0434\u043E \u043E\u0441\u0438 \u0412 \u041F\u0418\u041A\u0421\u0415\u041B\u042F\u0425: \u0441\u0442\u043E\u0440\u043E\u043D\u0430 \u043F\u0440\u0438\u0445\u043E\u0434\u0438\u0442 \u0438\u0437 \u0432\u0435\u0440\u0448\u0438\u043D\u044B \u0443\u0436\u0435 \u043D\u043E\u0440\u043C\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u043E\u0439
|
|
1465
|
+
// (\xB11 \u043D\u0430 \u043A\u0440\u0430\u044E), \u0438 \u0443\u043C\u043D\u043E\u0436\u0438\u0442\u044C \u0435\u0451 \u043D\u0430 \u043F\u043E\u043B\u0443\u0448\u0438\u0440\u0438\u043D\u0443 \u0434\u043E\u0441\u0442\u0430\u0442\u043E\u0447\u043D\u043E \u2014 \u043F\u0440\u043E\u0438\u0437\u0432\u043E\u0434\u043D\u044B\u0445 \u043D\u0435 \u043D\u0430\u0434\u043E.
|
|
1466
|
+
float dist = abs(v_side) * v_outset;
|
|
1467
|
+
|
|
1468
|
+
// \u0421\u0433\u043B\u0430\u0436\u0438\u0432\u0430\u043D\u0438\u0435 \u0440\u043E\u0432\u043D\u043E \u0432 \u043F\u043E\u043B\u043F\u0438\u043A\u0441\u0435\u043B\u044F \u0441 \u043A\u0430\u0436\u0434\u043E\u0439 \u0441\u0442\u043E\u0440\u043E\u043D\u044B \u043A\u0440\u0430\u044F.
|
|
1469
|
+
float alpha = clamp(v_half - dist + 0.5, 0.0, 1.0);
|
|
1470
|
+
// \u0422\u043E\u043D\u044C\u0448\u0435 \u043F\u0438\u043A\u0441\u0435\u043B\u044F \u043B\u0438\u043D\u0438\u044F \u0443\u0445\u043E\u0434\u0438\u0442 \u0432 \u043F\u0440\u043E\u0437\u0440\u0430\u0447\u043D\u043E\u0441\u0442\u044C, \u0430 \u043D\u0435 \u0432 \u0440\u0430\u0437\u043C\u0430\u0437\u043D\u044E.
|
|
1471
|
+
alpha *= min(v_half * 2.0, 1.0);
|
|
1472
|
+
|
|
1473
|
+
vec4 color = u_color;
|
|
1474
|
+
if (u_pattern == 1) {
|
|
1475
|
+
float phase = mod(v_dist, u_dash.y);
|
|
1476
|
+
float edge = min(phase, u_dash.x - phase);
|
|
1477
|
+
alpha *= clamp(edge + 0.5, 0.0, 1.0);
|
|
1478
|
+
} else if (u_pattern == 2) {
|
|
1479
|
+
color = mix(color, u_arrow_color, chevron(v_dist, v_side * v_outset));
|
|
1480
|
+
}
|
|
1481
|
+
|
|
1482
|
+
if (alpha <= 0.003) discard;
|
|
1483
|
+
fragColor = applyFogPremultiplied(color) * alpha;
|
|
1484
|
+
}
|
|
1485
|
+
`,Va=`#version 300 es
|
|
1486
|
+
precision highp float;
|
|
1487
|
+
|
|
1488
|
+
in vec2 a_pos;
|
|
1489
|
+
in float a_height; // \u043C\u0435\u0442\u0440\u044B \xD7 4 (\u043D\u043E\u0440\u043C\u0430\u043B\u0438\u0437\u0430\u0446\u0438\u044F \u0432\u044B\u043A\u043B\u044E\u0447\u0435\u043D\u0430, \u0434\u0435\u043B\u0438\u043C \u0441\u0430\u043C\u0438)
|
|
1490
|
+
in float a_tint;
|
|
1491
|
+
in float a_ao;
|
|
1492
|
+
in vec3 a_normal;
|
|
1493
|
+
in float a_kind; // \u043C\u043B\u0430\u0434\u0448\u0438\u0435 2 \u0431\u0438\u0442\u0430 \u2014 \u043F\u043E\u0432\u0435\u0440\u0445\u043D\u043E\u0441\u0442\u044C, \u0441\u0442\u0430\u0440\u0448\u0438\u0435 \u2014 \u043A\u043B\u0430\u0441\u0441 \u0444\u0430\u0441\u0430\u0434\u0430
|
|
1494
|
+
in vec3 a_wall; // \u043C\u0435\u0442\u0440\u044B \xD7 4: \u0441\u043C\u0435\u0449\u0435\u043D\u0438\u0435 \u0432\u0434\u043E\u043B\u044C \u0433\u0440\u0430\u043D\u0438, \u0448\u0438\u0440\u0438\u043D\u0430 \u0433\u0440\u0430\u043D\u0438, \u0435\u0451 \u0432\u044B\u0441\u043E\u0442\u0430
|
|
1495
|
+
|
|
1496
|
+
uniform mat4 u_matrix;
|
|
1497
|
+
uniform float u_height_scale; // 0..1 \u2014 \u0430\u043D\u0438\u043C\u0430\u0446\u0438\u044F \xAB\u0432\u044B\u0440\u0430\u0441\u0442\u0430\u043D\u0438\u044F\xBB \u043F\u0440\u0438 \u043F\u043E\u044F\u0432\u043B\u0435\u043D\u0438\u0438
|
|
1498
|
+
uniform mat4 u_shadow_matrix;
|
|
1499
|
+
uniform float u_meters_per_unit;
|
|
1500
|
+
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
|
|
1501
|
+
|
|
1502
|
+
out vec3 v_normal;
|
|
1503
|
+
out float v_ao;
|
|
1504
|
+
out float v_tint;
|
|
1505
|
+
out vec4 v_shadow;
|
|
1506
|
+
out float v_kind;
|
|
1507
|
+
/** \u041F\u043E\u043B\u043E\u0436\u0435\u043D\u0438\u0435 \u043D\u0430 \u0437\u0435\u043C\u043B\u0435 \u0432 \u041C\u0415\u0422\u0420\u0410\u0425: \u043F\u043E \u043D\u0435\u043C\u0443 \u0441\u0442\u0440\u043E\u0438\u0442\u0441\u044F \u0440\u0438\u0441\u0443\u043D\u043E\u043A \u043A\u0440\u043E\u0432\u043B\u0438. */
|
|
1508
|
+
out vec2 v_world;
|
|
1509
|
+
out float v_up;
|
|
1510
|
+
/** \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. */
|
|
1511
|
+
out vec3 v_wall;
|
|
1512
|
+
|
|
1513
|
+
void main() {
|
|
1514
|
+
float h = (a_height / 4.0) * u_height_scale;
|
|
1515
|
+
vec4 local = vec4(a_pos, h, 1.0);
|
|
1516
|
+
gl_Position = u_matrix * local;
|
|
1517
|
+
|
|
1518
|
+
v_normal = a_normal;
|
|
1519
|
+
v_ao = a_ao;
|
|
1520
|
+
v_tint = a_tint;
|
|
1521
|
+
v_kind = a_kind;
|
|
1522
|
+
v_shadow = u_shadow_matrix * local;
|
|
1523
|
+
v_world = u_world_origin + a_pos * u_meters_per_unit;
|
|
1524
|
+
v_up = h;
|
|
1525
|
+
v_wall = a_wall / 4.0;
|
|
1526
|
+
}
|
|
1527
|
+
`,gf=`
|
|
1528
|
+
uniform float u_facade_detail; // 0 \u2014 \u0433\u043B\u0430\u0434\u043A\u0438\u0435 \u0441\u0442\u0435\u043D\u044B, 1 \u2014 \u043F\u043E\u043B\u043D\u044B\u0439 \u0440\u0438\u0441\u0443\u043D\u043E\u043A
|
|
1529
|
+
uniform vec3 u_window_color;
|
|
1530
|
+
uniform vec3 u_window_frame;
|
|
1531
|
+
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)
|
|
1532
|
+
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
|
|
1533
|
+
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
|
|
1534
|
+
|
|
1535
|
+
float hashNoise(vec2 p) {
|
|
1536
|
+
vec3 p3 = fract(vec3(p.xyx) * 0.1031);
|
|
1537
|
+
p3 += dot(p3, p3.yzx + 33.33);
|
|
1538
|
+
return fract((p3.x + p3.y) * p3.z);
|
|
1539
|
+
}
|
|
1540
|
+
|
|
1541
|
+
/** \u041C\u044F\u0433\u043A\u0430\u044F \u043F\u043E\u043B\u043E\u0441\u0430: 1 \u0432\u043D\u0443\u0442\u0440\u0438 |v| < half, \u0441 \u0430\u043D\u0442\u0438\u0430\u043B\u0438\u0430\u0441\u0438\u043D\u0433\u043E\u043C \u0448\u0438\u0440\u0438\u043D\u043E\u0439 aa. */
|
|
1542
|
+
float band(float v, float half_, float aa) {
|
|
1543
|
+
return smoothstep(half_ + aa, half_ - aa, abs(v));
|
|
1544
|
+
}
|
|
1545
|
+
|
|
1546
|
+
/**
|
|
1547
|
+
* \u0420\u0438\u0441\u0443\u043D\u043E\u043A \u0441\u0442\u0435\u043D\u044B. \u0412\u043E\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0446\u0432\u0435\u0442, \u0432 w \u2014 \xAB\u0441\u0442\u0435\u043A\u043B\u044F\u043D\u043D\u043E\u0441\u0442\u044C\xBB (\u0434\u043B\u044F \u0431\u043B\u0438\u043A\u043E\u0432 \u0438 \u0441\u0432\u0435\u0447\u0435\u043D\u0438\u044F).
|
|
1548
|
+
*
|
|
1549
|
+
* \u041A\u043B\u0430\u0441\u0441\u044B \u043E\u0442\u043B\u0438\u0447\u0430\u044E\u0442\u0441\u044F \u043D\u0435 \u0442\u043E\u043B\u044C\u043A\u043E \u0440\u0430\u0437\u043C\u0435\u0440\u043E\u043C \u043E\u043A\u043D\u0430: \u0436\u0438\u043B\u0430\u044F \u0441\u0435\u043A\u0446\u0438\u044F \u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044F \u0440\u0435\u0433\u0443\u043B\u044F\u0440\u043D\u043E\u0439
|
|
1550
|
+
* \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
|
|
1551
|
+
* \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.
|
|
1552
|
+
*/
|
|
1553
|
+
vec4 facadePattern(vec3 base, vec3 wall, float y, int cls, float seed, float aa, out float glow) {
|
|
1554
|
+
float floorH = u_floor_height;
|
|
1555
|
+
float stepX = 2.7;
|
|
1556
|
+
float winW = 1.5;
|
|
1557
|
+
float winH = 1.6;
|
|
1558
|
+
float sill = 0.9;
|
|
1559
|
+
float ground = 4.0; // \u0432\u044B\u0441\u043E\u0442\u0430 \u0432\u0438\u0442\u0440\u0438\u043D\u043D\u043E\u0433\u043E/\u0446\u043E\u043A\u043E\u043B\u044C\u043D\u043E\u0433\u043E \u043F\u043E\u044F\u0441\u0430
|
|
1560
|
+
|
|
1561
|
+
if (cls == 0) { // \u0447\u0430\u0441\u0442\u043D\u044B\u0439 \u0434\u043E\u043C
|
|
1562
|
+
floorH = u_floor_height * 0.95;
|
|
1563
|
+
stepX = 3.1; winW = 1.35; winH = 1.45; sill = 1.0; ground = 0.7;
|
|
1564
|
+
} else if (cls == 2) { // \u043E\u0444\u0438\u0441, \u0442\u043E\u0440\u0433\u043E\u0432\u044B\u0439 \u0446\u0435\u043D\u0442\u0440
|
|
1565
|
+
floorH = u_floor_height * 1.2;
|
|
1566
|
+
stepX = 1.7; winW = 1.4; winH = 2.3; sill = 0.7; ground = 5.0;
|
|
1567
|
+
} else if (cls == 3) { // \u0446\u0435\u0445, \u0441\u043A\u043B\u0430\u0434
|
|
1568
|
+
floorH = u_floor_height * 1.5;
|
|
1569
|
+
stepX = 5.0; winW = 2.6; winH = 1.2; sill = 2.4; ground = 1.2;
|
|
1570
|
+
}
|
|
1571
|
+
|
|
1572
|
+
vec3 color = base;
|
|
1573
|
+
glow = 0.0;
|
|
1574
|
+
|
|
1575
|
+
float faceW = wall.y;
|
|
1576
|
+
float faceH = wall.z;
|
|
1577
|
+
// \u041F\u043E\u043B\u044F \u043F\u043E \u043A\u0440\u0430\u044F\u043C \u0433\u0440\u0430\u043D\u0438. \u041F\u0440\u043E\u0441\u0442\u0435\u043D\u043E\u043A \u0443 \u0443\u0433\u043B\u0430 \u043E\u0431\u044F\u0437\u0430\u0442\u0435\u043B\u0435\u043D: \u043E\u043A\u043D\u043E, \u0440\u0430\u0437\u0440\u0435\u0437\u0430\u043D\u043D\u043E\u0435 \u0440\u0435\u0431\u0440\u043E\u043C
|
|
1578
|
+
// \u0434\u043E\u043C\u0430, \u2014 \u043F\u0435\u0440\u0432\u043E\u0435, \u0447\u0442\u043E \u0432\u044B\u0434\u0430\u0451\u0442 \u043F\u0440\u043E\u0446\u0435\u0434\u0443\u0440\u043D\u044B\u0439 \u0444\u0430\u0441\u0430\u0434.
|
|
1579
|
+
float mSide = min(1.1, faceW * 0.16);
|
|
1580
|
+
float mBot = min(ground, faceH * 0.4);
|
|
1581
|
+
float mTop = min(0.9, faceH * 0.12);
|
|
1582
|
+
|
|
1583
|
+
float availW = faceW - 2.0 * mSide;
|
|
1584
|
+
float availH = faceH - mBot - mTop;
|
|
1585
|
+
// \u041D\u0430 \u0443\u0437\u043A\u043E\u0439 \u0438\u043B\u0438 \u043D\u0438\u0437\u043A\u043E\u0439 \u0433\u0440\u0430\u043D\u0438 \u0441\u0435\u0442\u043A\u0438 \u043F\u0440\u043E\u0441\u0442\u043E \u043D\u0435\u0442 \u2014 \u0433\u043B\u0443\u0445\u0430\u044F \u0441\u0442\u0435\u043D\u0430 \u0447\u0435\u0441\u0442\u043D\u0435\u0435 \u0440\u0432\u0430\u043D\u044C\u044F.
|
|
1586
|
+
if (availW < winW * 1.2 || availH < winH * 1.3) return vec4(color, 0.0);
|
|
1587
|
+
|
|
1588
|
+
// \u042F\u0447\u0435\u0439\u043A\u0430 \u0412\u041F\u0418\u0421\u042B\u0412\u0410\u0415\u0422\u0421\u042F \u0432 \u0433\u0440\u0430\u043D\u044C: \u0446\u0435\u043B\u043E\u0435 \u0447\u0438\u0441\u043B\u043E \u043A\u043E\u043B\u043E\u043D\u043E\u043A \u0438 \u0440\u044F\u0434\u043E\u0432, \u043E\u0441\u0442\u0430\u0442\u043E\u043A
|
|
1589
|
+
// \u0440\u0430\u0437\u043C\u0430\u0437\u044B\u0432\u0430\u0435\u0442\u0441\u044F \u043F\u043E \u043F\u0440\u043E\u0441\u0442\u0435\u043D\u043A\u0430\u043C. \u041E\u0442\u0441\u044E\u0434\u0430 \u0438 \u0441\u0438\u043C\u043C\u0435\u0442\u0440\u0438\u044F \u043E\u0442\u043D\u043E\u0441\u0438\u0442\u0435\u043B\u044C\u043D\u043E \u0443\u0433\u043B\u043E\u0432, \u0438 \u0442\u043E,
|
|
1590
|
+
// \u0447\u0442\u043E \u0432\u0435\u0440\u0445\u043D\u0438\u0439 \u0440\u044F\u0434 \u043D\u0435 \u0441\u0440\u0435\u0437\u0430\u0435\u0442\u0441\u044F \u043A\u0430\u0440\u043D\u0438\u0437\u043E\u043C.
|
|
1591
|
+
float cols = max(floor(availW / stepX), 1.0);
|
|
1592
|
+
float rows = max(floor(availH / floorH), 1.0);
|
|
1593
|
+
float cw = availW / cols;
|
|
1594
|
+
float ch = availH / rows;
|
|
1595
|
+
|
|
1596
|
+
float gx = (wall.x - mSide) / cw;
|
|
1597
|
+
float gy = (y - mBot) / ch;
|
|
1598
|
+
bool inGrid = gx >= 0.0 && gx <= cols && gy >= 0.0 && gy <= rows;
|
|
1599
|
+
|
|
1600
|
+
// \u041E\u043A\u043D\u043E \u0432 \u0421\u0412\u041E\u0415\u0419 \u044F\u0447\u0435\u0439\u043A\u0435: \u0440\u0430\u0437\u043C\u0435\u0440 \u0432 \u043C\u0435\u0442\u0440\u0430\u0445 (\u0432\u0438\u0434 \u043E\u0441\u0442\u0430\u0451\u0442\u0441\u044F \u043F\u0440\u0435\u0436\u043D\u0438\u043C), \u0446\u0435\u043D\u0442\u0440 \u2014 \u043E\u0442
|
|
1601
|
+
// \u044F\u0447\u0435\u0439\u043A\u0438, \u0430 \u043D\u0435 \u043E\u0442 \u043E\u0431\u0449\u0435\u0439 \u0441\u0435\u0442\u043A\u0438.
|
|
1602
|
+
float fx = (fract(gx) - 0.5) * cw;
|
|
1603
|
+
float fy = (fract(gy)) * ch - (sill + winH * 0.5);
|
|
1604
|
+
|
|
1605
|
+
float win = 0.0;
|
|
1606
|
+
float frame = 0.0;
|
|
1607
|
+
if (inGrid) {
|
|
1608
|
+
win = band(fx, winW * 0.5, aa) * band(fy, winH * 0.5, aa);
|
|
1609
|
+
frame = band(fx, winW * 0.5 + 0.12, aa) * band(fy, winH * 0.5 + 0.12, aa) - win;
|
|
1610
|
+
}
|
|
1611
|
+
|
|
1612
|
+
float atGround = step(y, mBot);
|
|
1613
|
+
if (cls == 1 || cls == 2) {
|
|
1614
|
+
// \u041F\u0435\u0440\u0432\u044B\u0439 \u044D\u0442\u0430\u0436: \u0432\u0438\u0442\u0440\u0438\u043D\u044B \u043F\u043E \u0442\u0435\u043C \u0436\u0435 \u043A\u043E\u043B\u043E\u043D\u043A\u0430\u043C, \u0447\u0442\u043E \u0438 \u043E\u043A\u043D\u0430 \u0432\u044B\u0448\u0435.
|
|
1615
|
+
float gw = band(fx, cw * 0.36, aa) * band(y - mBot * 0.55, mBot * 0.3, aa);
|
|
1616
|
+
win = mix(win, max(win, gw), atGround * step(0.0, gx) * step(gx, cols));
|
|
1617
|
+
}
|
|
1618
|
+
|
|
1619
|
+
// \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 \u043F\u0430\u043D\u0435\u043B\u0438.
|
|
1620
|
+
if (cls == 3) {
|
|
1621
|
+
win *= step(4.0, y);
|
|
1622
|
+
frame *= step(4.0, y);
|
|
1623
|
+
}
|
|
1624
|
+
|
|
1625
|
+
// \u0428\u0432\u044B: \u0443 \u043F\u0430\u043D\u0435\u043B\u044C\u043D\u043E\u0433\u043E \u0434\u043E\u043C\u0430 \u0438 \u0446\u0435\u0445\u0430 \u043E\u043D\u0438 \u0432\u0438\u0434\u043D\u044B, \u0443 \u0441\u0442\u0435\u043A\u043B\u0430 \u0438\u0445 \u0437\u0430\u043C\u0435\u043D\u044F\u044E\u0442 \u0438\u043C\u043F\u043E\u0441\u0442\u044B.
|
|
1626
|
+
float seamY = band(fract(gy) * ch, 0.06, aa) * step(0.0, gy) * step(gy, rows);
|
|
1627
|
+
float seamX = band(fract(gx) * cw, 0.05, aa) * step(0.0, gx) * step(gx, cols);
|
|
1628
|
+
float seams = cls == 2 ? seamX : max(seamY, seamX) * (cls == 3 ? 1.0 : 0.55);
|
|
1629
|
+
color *= 1.0 - seams * 0.10;
|
|
1630
|
+
|
|
1631
|
+
// \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.
|
|
1632
|
+
color *= mix(1.0, 0.86, atGround * (cls == 0 || cls == 3 ? 1.0 : 0.4));
|
|
1633
|
+
|
|
1634
|
+
// \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
|
|
1635
|
+
// \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.
|
|
1636
|
+
float jitter = hashNoise(vec2(floor(gx), floor(gy)) + seed * 37.0);
|
|
1637
|
+
float sky = clamp(0.5 + fy / max(winH, 0.2), 0.0, 1.0);
|
|
1638
|
+
vec3 glass = u_window_color * (0.7 + 0.45 * jitter) * (0.82 + 0.5 * sky);
|
|
1639
|
+
|
|
1640
|
+
// \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
|
|
1641
|
+
// \u043F\u043E\u0432\u043E\u0440\u043E\u0442\u0435 \u043A\u0430\u043C\u0435\u0440\u044B \u0438 \u043F\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u043A\u0435 \u0442\u0430\u0439\u043B\u0430 \u0441\u0432\u0435\u0442 \u043E\u0441\u0442\u0430\u0451\u0442\u0441\u044F \u0432 \u0442\u0435\u0445 \u0436\u0435 \u043E\u043A\u043D\u0430\u0445.
|
|
1642
|
+
float lit = step(1.0 - u_window_glow, hashNoise(vec2(floor(gx), floor(gy)) * 1.7 + seed * 91.0));
|
|
1643
|
+
// \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
|
|
1644
|
+
// \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.
|
|
1645
|
+
glow = win * lit * (0.45 + 0.75 * jitter);
|
|
1646
|
+
|
|
1647
|
+
color = mix(color, glass, win * 0.9);
|
|
1648
|
+
color = mix(color, u_window_frame, frame * 0.75);
|
|
1649
|
+
|
|
1650
|
+
return vec4(color, win);
|
|
1651
|
+
}
|
|
1652
|
+
|
|
1653
|
+
/**
|
|
1654
|
+
* \u041A\u0440\u043E\u0432\u043B\u044F. \u041F\u043B\u043E\u0441\u043A\u0430\u044F \u043F\u043E\u043B\u0443\u0447\u0430\u0435\u0442 \u0448\u0432\u044B \u0440\u0443\u043B\u043E\u043D\u043D\u043E\u0433\u043E \u043F\u043E\u043A\u0440\u044B\u0442\u0438\u044F \u0438 \u043F\u044F\u0442\u043D\u0430, \u0441\u043A\u0430\u0442 \u2014 \u0444\u0430\u043B\u044C\u0446\u044B \u0432\u0434\u043E\u043B\u044C
|
|
1655
|
+
* \u0443\u043A\u043B\u043E\u043D\u0430. \u041D\u0430\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u0435 \u0443\u043A\u043B\u043E\u043D\u0430 \u0431\u0435\u0440\u0451\u0442\u0441\u044F \u0438\u0437 \u043D\u043E\u0440\u043C\u0430\u043B\u0438, \u043F\u043E\u044D\u0442\u043E\u043C\u0443 \u0444\u0430\u043B\u044C\u0446\u044B \u0438\u0434\u0443\u0442 \u0442\u0443\u0434\u0430 \u0436\u0435,
|
|
1656
|
+
* \u043A\u0443\u0434\u0430 \u0441\u0442\u0435\u043A\u0430\u0435\u0442 \u0432\u043E\u0434\u0430, \u2014 \u043A\u0430\u043A \u043D\u0430 \u043D\u0430\u0441\u0442\u043E\u044F\u0449\u0435\u0439 \u043A\u0440\u044B\u0448\u0435.
|
|
1657
|
+
*/
|
|
1658
|
+
vec3 roofPattern(vec3 base, vec2 world, vec3 n, bool sloped, float aa) {
|
|
1659
|
+
if (sloped) {
|
|
1660
|
+
vec2 down = normalize(n.xy + vec2(1e-5, 0.0));
|
|
1661
|
+
vec2 across = vec2(-down.y, down.x);
|
|
1662
|
+
float s = dot(world, across);
|
|
1663
|
+
float t = dot(world, down);
|
|
1664
|
+
float seam = band(fract(s / 0.55) - 0.5, 0.06, aa / 0.55);
|
|
1665
|
+
float row = band(fract(t / 0.42) - 0.5, 0.04, aa / 0.42);
|
|
1666
|
+
return base * (1.0 - seam * 0.16 - row * 0.06);
|
|
1667
|
+
}
|
|
1668
|
+
float seamX = band(fract(world.x / 3.6) - 0.5, 0.04, aa / 3.6);
|
|
1669
|
+
float seamY = band(fract(world.y / 3.6) - 0.5, 0.04, aa / 3.6);
|
|
1670
|
+
// \u041F\u044F\u0442\u043D\u0430 \u043A\u0440\u0443\u043F\u043D\u044B\u0435 \u0438 \u0441\u043B\u0430\u0431\u044B\u0435: \u043C\u0435\u043B\u043A\u0438\u0435 \u0434\u0430\u0432\u0430\u043B\u0438 \u0448\u0430\u0445\u043C\u0430\u0442\u043D\u0443\u044E \u0434\u043E\u0441\u043A\u0443 \u043D\u0430 \u0431\u043E\u043B\u044C\u0448\u0438\u0445 \u043A\u0440\u043E\u0432\u043B\u044F\u0445.
|
|
1671
|
+
float mottle = hashNoise(floor(world * 0.16));
|
|
1672
|
+
return base * (1.0 - max(seamX, seamY) * 0.07) * (0.97 + 0.06 * mottle);
|
|
1673
|
+
}
|
|
1674
|
+
|
|
1675
|
+
/**
|
|
1676
|
+
* \u0426\u0432\u0435\u0442 \u0441\u043A\u0430\u0442\u043D\u043E\u0439 \u043A\u0440\u043E\u0432\u043B\u0438. \u0422\u043E\u043D \u0431\u0435\u0440\u0451\u0442\u0441\u044F \u0438\u0437 \u0445\u0435\u0448\u0430 \u0437\u0434\u0430\u043D\u0438\u044F, \u043D\u043E \u042F\u0420\u041A\u041E\u0421\u0422\u042C \u043E\u0441\u0442\u0430\u0451\u0442\u0441\u044F \u043E\u0442 \u0442\u0435\u043C\u044B:
|
|
1677
|
+
* \u0438\u043D\u0430\u0447\u0435 \u0442\u0435\u0440\u0440\u0430\u043A\u043E\u0442\u0430 \u0441 \u0437\u0435\u043B\u0451\u043D\u044B\u043C \u043C\u0435\u0442\u0430\u043B\u043B\u043E\u043C \u0432\u0441\u043F\u043B\u044B\u043B\u0438 \u0431\u044B \u043F\u043E\u0441\u0440\u0435\u0434\u0438 \u043D\u043E\u0447\u043D\u043E\u0439 \u043A\u0430\u0440\u0442\u044B.
|
|
1678
|
+
*/
|
|
1679
|
+
vec3 roofHue(vec3 base, float seed) {
|
|
1680
|
+
vec3 hues[4];
|
|
1681
|
+
hues[0] = vec3(0.62, 0.29, 0.22); // \u0442\u0435\u0440\u0440\u0430\u043A\u043E\u0442\u0430
|
|
1682
|
+
hues[1] = vec3(0.36, 0.38, 0.42); // \u0448\u0438\u0444\u0435\u0440
|
|
1683
|
+
hues[2] = vec3(0.30, 0.40, 0.33); // \u0437\u0435\u043B\u0451\u043D\u044B\u0439 \u043C\u0435\u0442\u0430\u043B\u043B
|
|
1684
|
+
hues[3] = vec3(0.45, 0.40, 0.36); // \u0431\u0443\u0440\u044B\u0439
|
|
1685
|
+
int idx = int(mod(floor(seed * 4.0), 4.0));
|
|
1686
|
+
vec3 hue = hues[idx];
|
|
1687
|
+
|
|
1688
|
+
float baseLum = dot(base, vec3(0.2126, 0.7152, 0.0722));
|
|
1689
|
+
float hueLum = max(dot(hue, vec3(0.2126, 0.7152, 0.0722)), 1e-3);
|
|
1690
|
+
return hue * (baseLum / hueLum);
|
|
1691
|
+
}
|
|
1692
|
+
`,za=`#version 300 es
|
|
1693
|
+
precision highp float;
|
|
1694
|
+
|
|
1695
|
+
${Jt}
|
|
1696
|
+
${zo}
|
|
1697
|
+
${Xe}
|
|
1698
|
+
${gf}
|
|
1699
|
+
|
|
1700
|
+
in vec3 v_normal;
|
|
1701
|
+
in float v_ao;
|
|
1702
|
+
in float v_tint;
|
|
1703
|
+
in float v_kind;
|
|
1704
|
+
in vec2 v_world;
|
|
1705
|
+
in float v_up;
|
|
1706
|
+
in vec3 v_wall;
|
|
1707
|
+
|
|
1708
|
+
uniform vec4 u_wall_color;
|
|
1709
|
+
uniform vec4 u_roof_color;
|
|
1710
|
+
uniform float u_opacity;
|
|
1711
|
+
uniform float u_ao_strength;
|
|
1712
|
+
uniform float u_tint_variation;
|
|
1713
|
+
|
|
1714
|
+
out vec4 fragColor;
|
|
1715
|
+
|
|
1716
|
+
void main() {
|
|
1717
|
+
vec3 n = normalize(v_normal);
|
|
1718
|
+
|
|
1719
|
+
// \u0422\u0438\u043F \u043F\u043E\u0432\u0435\u0440\u0445\u043D\u043E\u0441\u0442\u0438 \u043F\u0440\u0438\u0445\u043E\u0434\u0438\u0442 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043E\u043C, \u0430 \u043D\u0435 \u0432\u044B\u0432\u043E\u0434\u0438\u0442\u0441\u044F \u0438\u0437 \u043D\u043E\u0440\u043C\u0430\u043B\u0438: \u0443 \u043F\u043E\u043B\u043E\u0433\u043E\u0433\u043E
|
|
1720
|
+
// \u0441\u043A\u0430\u0442\u0430 normal.z \u0442\u0430\u043A\u043E\u0439 \u0436\u0435, \u043A\u0430\u043A \u0443 \u043D\u0430\u043A\u043B\u043E\u043D\u043D\u043E\u0439 \u0441\u0442\u0435\u043D\u044B, \u0438 \u043A\u0440\u043E\u0432\u043B\u044F \u043F\u043E\u043B\u0443\u0447\u0430\u043B\u0430 \u0431\u044B \u043E\u043A\u043D\u0430.
|
|
1721
|
+
int kind = int(v_kind + 0.5);
|
|
1722
|
+
int surface = kind & 3;
|
|
1723
|
+
int cls = kind >> 2;
|
|
1724
|
+
bool isRoof = surface == 1 || surface == 2;
|
|
1725
|
+
|
|
1726
|
+
vec3 albedo = isRoof ? u_roof_color.rgb : u_wall_color.rgb;
|
|
1727
|
+
|
|
1728
|
+
// \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
|
|
1729
|
+
albedo *= 1.0 + (v_tint - 0.5) * 2.0 * u_tint_variation;
|
|
1730
|
+
|
|
1731
|
+
// \u041C\u0435\u0442\u0440\u043E\u0432 \u043D\u0430 \u043F\u0438\u043A\u0441\u0435\u043B\u044C \u2014 \u043C\u0435\u0440\u0430 \u0442\u043E\u0433\u043E, \u0441\u043A\u043E\u043B\u044C\u043A\u043E \u0434\u0435\u0442\u0430\u043B\u0435\u0439 \u0432\u043E\u043E\u0431\u0449\u0435 \u0438\u043C\u0435\u0435\u0442 \u0441\u043C\u044B\u0441\u043B \u0440\u0438\u0441\u043E\u0432\u0430\u0442\u044C.
|
|
1732
|
+
float aa = max(fwidth(v_world.x), fwidth(v_up)) + 1e-5;
|
|
1733
|
+
float detail = u_facade_detail * (1.0 - smoothstep(0.22, 0.85, aa));
|
|
1734
|
+
float glass = 0.0;
|
|
1735
|
+
float glow = 0.0;
|
|
1736
|
+
|
|
1737
|
+
if (detail > 0.004) {
|
|
1738
|
+
if (surface == 2) {
|
|
1739
|
+
albedo = mix(albedo, roofHue(albedo, v_tint), u_roof_variation);
|
|
1740
|
+
albedo = mix(albedo, roofPattern(albedo, v_world, n, true, aa), detail);
|
|
1741
|
+
} else if (surface == 1) {
|
|
1742
|
+
albedo = mix(albedo, roofPattern(albedo, v_world, n, false, aa), detail);
|
|
1743
|
+
} else {
|
|
1744
|
+
// \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
|
|
1745
|
+
// \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
|
|
1746
|
+
// (v_wall.y == 0) \u043E\u0441\u0442\u0430\u044E\u0442\u0441\u044F \u0433\u043B\u0443\u0445\u0438\u043C\u0438.
|
|
1747
|
+
float lit = 0.0;
|
|
1748
|
+
vec4 wall = v_wall.y > 0.5
|
|
1749
|
+
? facadePattern(albedo, v_wall, v_up, cls, v_tint, aa, lit)
|
|
1750
|
+
: vec4(albedo, 0.0);
|
|
1751
|
+
albedo = mix(albedo, wall.rgb, detail);
|
|
1752
|
+
glass = wall.a * detail;
|
|
1753
|
+
glow = lit * detail;
|
|
1754
|
+
}
|
|
1755
|
+
} else if (surface == 2) {
|
|
1756
|
+
albedo = mix(albedo, roofHue(albedo, v_tint), u_roof_variation);
|
|
1757
|
+
}
|
|
1758
|
+
|
|
1759
|
+
// \u0422\u0435\u043D\u044C \u0433\u0430\u0441\u0438\u0442 \u0422\u041E\u041B\u042C\u041A\u041E \u043D\u0430\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u043D\u044B\u0439 \u0441\u0432\u0435\u0442, \u0430 \u043D\u0435 \u0438\u0442\u043E\u0433\u043E\u0432\u044B\u0439 \u0446\u0432\u0435\u0442. \u0412 \u044D\u0442\u043E\u043C \u0432\u0441\u044F \u0440\u0430\u0437\u043D\u0438\u0446\u0430
|
|
1760
|
+
// \u043C\u0435\u0436\u0434\u0443 \xAB\u0435\u0441\u0442\u0435\u0441\u0442\u0432\u0435\u043D\u043D\u043E\xBB \u0438 \xAB\u0441\u0435\u0440\u043E\u0435 \u043F\u044F\u0442\u043D\u043E\xBB: \u0432 \u0442\u0435\u043D\u0438 \u043E\u0441\u0442\u0430\u0451\u0442\u0441\u044F ambient \u0438 \u0437\u0430\u043F\u043E\u043B\u043D\u044F\u044E\u0449\u0438\u0439
|
|
1761
|
+
// \u0438\u0441\u0442\u043E\u0447\u043D\u0438\u043A, \u043F\u043E\u044D\u0442\u043E\u043C\u0443 \u0441\u0442\u0435\u043D\u0430 \u0441\u043E\u0445\u0440\u0430\u043D\u044F\u0435\u0442 \u0441\u0432\u043E\u0439 \u0446\u0432\u0435\u0442, \u043F\u0440\u043E\u0441\u0442\u043E \u0442\u0435\u0440\u044F\u0435\u0442 \u0441\u043E\u043B\u043D\u0446\u0435.
|
|
1762
|
+
// \u0421\u0442\u0435\u043D\u0430, \u0438 \u0442\u0430\u043A \u043E\u0442\u0432\u0451\u0440\u043D\u0443\u0442\u0430\u044F \u043E\u0442 \u0441\u043E\u043B\u043D\u0446\u0430, \u0432\u0442\u043E\u0440\u043E\u0439 \u0440\u0430\u0437 \u043D\u0435 \u0437\u0430\u0442\u0435\u043D\u044F\u0435\u0442\u0441\u044F.
|
|
1763
|
+
float ndotl = dot(n, -u_key_dir);
|
|
1764
|
+
float keyFactor = max(ndotl, 0.0) * (1.0 - shadowOcclusion(ndotl));
|
|
1765
|
+
vec3 color = applyLightWithFactor(albedo, n, keyFactor);
|
|
1766
|
+
|
|
1767
|
+
// \u0437\u0430\u0442\u0435\u043D\u0435\u043D\u0438\u0435 \u0443 \u043E\u0441\u043D\u043E\u0432\u0430\u043D\u0438\u044F: \u0431\u0435\u0437 \u043D\u0435\u0433\u043E \u043F\u043B\u043E\u0442\u043D\u0430\u044F \u0437\u0430\u0441\u0442\u0440\u043E\u0439\u043A\u0430 \u0441\u043B\u0438\u0432\u0430\u0435\u0442\u0441\u044F \u0432 \u043A\u0430\u0448\u0443
|
|
1768
|
+
color *= mix(1.0 - u_ao_strength, 1.0, v_ao);
|
|
1769
|
+
|
|
1770
|
+
// \u0413\u043E\u0440\u044F\u0449\u0435\u0435 \u043E\u043A\u043D\u043E \u0434\u043E\u0431\u0430\u0432\u043B\u044F\u0435\u0442\u0441\u044F \u041F\u041E\u0421\u041B\u0415 \u043E\u0441\u0432\u0435\u0449\u0435\u043D\u0438\u044F \u0438 \u0442\u0435\u043D\u0438: \u043E\u043D\u043E \u0441\u0432\u0435\u0442\u0438\u0442 \u0441\u0430\u043C\u043E, \u0438 \u043D\u0430
|
|
1771
|
+
// \u0442\u0435\u043D\u0435\u0432\u043E\u0439 \u0441\u0442\u043E\u0440\u043E\u043D\u0435 \u0434\u043E\u043C\u0430 \u0434\u043E\u043B\u0436\u043D\u043E \u0431\u044B\u0442\u044C \u0432\u0438\u0434\u043D\u043E \u0434\u0430\u0436\u0435 \u044F\u0440\u0447\u0435, \u0447\u0435\u043C \u043D\u0430 \u0441\u043E\u043B\u043D\u0435\u0447\u043D\u043E\u0439.
|
|
1772
|
+
color += u_window_color * glow * 0.55;
|
|
1773
|
+
|
|
1774
|
+
float alpha = u_opacity * u_wall_color.a;
|
|
1775
|
+
fragColor = vec4(applyFog(color) * alpha, alpha);
|
|
1776
|
+
}
|
|
1777
|
+
`,Na=`#version 300 es
|
|
1778
|
+
precision highp float;
|
|
1779
|
+
|
|
1780
|
+
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)
|
|
1781
|
+
in float a_level; // \u043C\u0435\u0442\u0440\u044B \xD7 SURFACE_LEVEL_SCALE (64)
|
|
1782
|
+
in vec3 a_normal;
|
|
1783
|
+
in float a_kind; // 0 \u0432\u0435\u0440\u0445, 1 \u0431\u043E\u0440\u0442, 2 \u044E\u0431\u043A\u0430
|
|
1784
|
+
in vec2 a_bleed; // \u043A\u0443\u0434\u0430 \u0432\u044B\u0434\u0432\u0438\u043D\u0443\u0442\u044C \u0432\u0435\u0440\u0448\u0438\u043D\u0443, \u043B\u0435\u0436\u0430\u0449\u0443\u044E \u043D\u0430 \u043B\u0438\u043D\u0438\u0438 \u0440\u0430\u0437\u0440\u0435\u0437\u0430
|
|
1785
|
+
|
|
1786
|
+
uniform mat4 u_matrix;
|
|
1787
|
+
uniform mat4 u_shadow_matrix;
|
|
1788
|
+
uniform float u_meters_per_unit;
|
|
1789
|
+
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
|
|
1790
|
+
/** \u041E\u0431\u0449\u0438\u0439 \u043C\u043D\u043E\u0436\u0438\u0442\u0435\u043B\u044C \u0443\u0440\u043E\u0432\u043D\u044F: 0 \u043A\u043B\u0430\u0434\u0451\u0442 \u0440\u0435\u043B\u044C\u0435\u0444 \u043E\u0431\u0440\u0430\u0442\u043D\u043E \u0432 \u043F\u043B\u043E\u0441\u043A\u043E\u0441\u0442\u044C. */
|
|
1791
|
+
uniform float u_relief;
|
|
1792
|
+
|
|
1793
|
+
out vec3 v_normal;
|
|
1794
|
+
out float v_kind;
|
|
1795
|
+
out vec2 v_world;
|
|
1796
|
+
out vec4 v_shadow;
|
|
1797
|
+
|
|
1798
|
+
void main() {
|
|
1799
|
+
float level = (a_level / 64.0) * u_relief;
|
|
1800
|
+
|
|
1801
|
+
// \u041D\u0430\u0445\u043B\u0451\u0441\u0442 \u043F\u043E \u043B\u0438\u043D\u0438\u0438 \u0440\u0430\u0437\u0440\u0435\u0437\u0430: \u0441\u043E\u0441\u0435\u0434\u043D\u0438\u0435 \u0442\u0430\u0439\u043B\u044B \u0441\u0447\u0438\u0442\u0430\u044E\u0442 \u043E\u0431\u0449\u0443\u044E \u0433\u0440\u0430\u043D\u0438\u0446\u0443 \u0440\u0430\u0437\u043D\u044B\u043C\u0438
|
|
1802
|
+
// \u043C\u0430\u0442\u0440\u0438\u0446\u0430\u043C\u0438 \u0438 \u0432\u043E Float32 \u0440\u0430\u0441\u0445\u043E\u0434\u044F\u0442\u0441\u044F \u043D\u0430 \u0434\u043E\u043B\u0438 \u043F\u0438\u043A\u0441\u0435\u043B\u044F \u2014 \u0441\u043A\u0432\u043E\u0437\u044C \u0432\u043E\u0434\u0443 \u043F\u0440\u043E\u0441\u0442\u0443\u043F\u0430\u043B\u0430
|
|
1803
|
+
// \u0437\u0435\u043C\u043B\u044F \u0442\u043E\u0447\u043A\u0430\u043C\u0438. \u0412\u044B\u0435\u0437\u0436\u0430\u0435\u043C \u0437\u0430 \u0433\u0440\u0430\u043D\u0438\u0446\u0443 \u0441 \u0437\u0430\u043F\u0430\u0441\u043E\u043C, \u0430 \u043E\u0431\u0440\u0435\u0437\u0430\u0435\u0442 \u043D\u0430\u0441 \u0422\u0420\u0410\u0424\u0410\u0420\u0415\u0422 \u043F\u043E
|
|
1804
|
+
// \u0442\u0430\u0439\u043B\u0430\u043C (\u0441\u043C. drawTileStencil \u0432 layers/renderer.ts), \u043F\u043E\u044D\u0442\u043E\u043C\u0443 \u0432\u0442\u043E\u0440\u043E\u0439 \u0440\u0430\u0437 \u0442\u043E\u0442
|
|
1805
|
+
// \u0436\u0435 \u043F\u0438\u043A\u0441\u0435\u043B\u044C \u043D\u0438\u043A\u0442\u043E \u043D\u0435
|
|
1806
|
+
// \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.
|
|
1807
|
+
vec2 pos = a_pos + a_bleed;
|
|
1808
|
+
|
|
1809
|
+
vec4 local = vec4(pos, level, 1.0);
|
|
1810
|
+
gl_Position = u_matrix * local;
|
|
1811
|
+
|
|
1812
|
+
v_normal = a_normal;
|
|
1813
|
+
v_kind = a_kind;
|
|
1814
|
+
v_world = u_world_origin + pos * u_meters_per_unit;
|
|
1815
|
+
v_shadow = u_shadow_matrix * local;
|
|
1816
|
+
}
|
|
1817
|
+
`,Ka=`#version 300 es
|
|
1818
|
+
precision highp float;
|
|
1819
|
+
|
|
1820
|
+
${Jt}
|
|
1821
|
+
${zo}
|
|
1822
|
+
${Xe}
|
|
1823
|
+
${Jr}
|
|
1824
|
+
|
|
1825
|
+
in vec3 v_normal;
|
|
1826
|
+
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
|
|
1827
|
+
in vec2 v_world;
|
|
1828
|
+
|
|
1829
|
+
uniform vec4 u_color; // \u041D\u0415 premultiplied: \u043C\u0430\u0442\u0435\u0440\u0438\u0430\u043B \u043F\u0440\u0430\u0432\u0438\u0442 \u0446\u0432\u0435\u0442
|
|
1830
|
+
uniform float u_opacity;
|
|
1831
|
+
/** \u041D\u0430\u0441\u043A\u043E\u043B\u044C\u043A\u043E \u0442\u0435\u043C\u043D\u0435\u0435 \u0431\u043E\u0440\u0442\u0430 \u0438 \u044E\u0431\u043A\u0430: \u0438\u0445 \u043D\u0435 \u0432\u0438\u0434\u043D\u043E \u0441\u0432\u0435\u0440\u0445\u0443, \u0438 \u0431\u0435\u0437 \u044D\u0442\u043E\u0433\u043E \u043A\u0440\u0430\u0439 \u043F\u043B\u043E\u0441\u043A\u0438\u0439. */
|
|
1832
|
+
uniform float u_side_shade;
|
|
1833
|
+
/** \u0426\u0432\u0435\u0442 \u0431\u043E\u0440\u0442\u0430 \u0438 \u044E\u0431\u043A\u0438: \u0443 \u0443\u0442\u043E\u043F\u043B\u0435\u043D\u043D\u043E\u0439 \u043F\u043E\u0432\u0435\u0440\u0445\u043D\u043E\u0441\u0442\u0438 \u044D\u0442\u043E \u0437\u0435\u043C\u043B\u044F \u0432\u043E\u043A\u0440\u0443\u0433, \u0430 \u043D\u0435 \u0432\u043E\u0434\u0430. */
|
|
1834
|
+
uniform vec3 u_side_color;
|
|
1835
|
+
/**
|
|
1836
|
+
* 0 \u2014 \u0431\u043E\u0440\u0442 \u0441\u0432\u0435\u0442\u0438\u0442\u0441\u044F \u043F\u043E \u0441\u0432\u043E\u0435\u0439 \u043D\u043E\u0440\u043C\u0430\u043B\u0438, 1 \u2014 \u0432\u044B\u0433\u043B\u044F\u0434\u0438\u0442 \u0420\u041E\u0412\u041D\u041E \u043A\u0430\u043A \u0437\u0435\u043C\u043B\u044F \u0432\u043E\u043A\u0440\u0443\u0433.
|
|
1837
|
+
*
|
|
1838
|
+
* \u0417\u0435\u043C\u043B\u044F \u0443 \u043D\u0430\u0441 \u043D\u0435 \u0433\u0435\u043E\u043C\u0435\u0442\u0440\u0438\u044F, \u0430 \u0444\u043E\u043D: \u0441\u0432\u0435\u0442\u0430 \u043E\u043D\u0430 \u043D\u0435 \u043F\u043E\u043B\u0443\u0447\u0430\u0435\u0442 \u0432\u043E\u0432\u0441\u0435. \u041F\u043E\u044D\u0442\u043E\u043C\u0443 \xAB\u043A\u0430\u043A
|
|
1839
|
+
* \u0437\u0435\u043C\u043B\u044F\xBB \u2014 \u044D\u0442\u043E \u043D\u0435 \u043D\u0430\u043A\u043B\u043E\u043D \u043D\u043E\u0440\u043C\u0430\u043B\u0438 \u043A \u0432\u0435\u0440\u0442\u0438\u043A\u0430\u043B\u0438 (\u0431\u043E\u0440\u0442 \u0432\u0441\u0451 \u0440\u0430\u0432\u043D\u043E \u043E\u0441\u0442\u0430\u043D\u0435\u0442\u0441\u044F \u0441\u0432\u0435\u0442\u043B\u0435\u0435
|
|
1840
|
+
* \u0438\u043B\u0438 \u0442\u0435\u043C\u043D\u0435\u0435 \u0444\u043E\u043D\u0430 \u0438 \u043F\u0440\u043E\u0447\u0442\u0451\u0442\u0441\u044F \u043B\u0435\u043D\u0442\u043E\u0439 \u0432\u0434\u043E\u043B\u044C \u0431\u0435\u0440\u0435\u0433\u0430), \u0430 \u043F\u0440\u044F\u043C\u043E\u0435 \u0441\u043C\u0435\u0448\u0438\u0432\u0430\u043D\u0438\u0435 \u0441
|
|
1841
|
+
* \u043F\u043B\u043E\u0441\u043A\u0438\u043C \u0446\u0432\u0435\u0442\u043E\u043C \u0437\u0435\u043C\u043B\u0438.
|
|
1842
|
+
*/
|
|
1843
|
+
uniform float u_side_light;
|
|
1844
|
+
|
|
1845
|
+
out vec4 fragColor;
|
|
1846
|
+
|
|
1847
|
+
void main() {
|
|
1848
|
+
vec3 n = normalize(v_normal);
|
|
1849
|
+
vec3 albedo = u_color.rgb;
|
|
1850
|
+
float alpha = u_opacity * u_color.a;
|
|
1851
|
+
|
|
1852
|
+
// \u041A\u0440\u044B\u0448\u043A\u0438 \u043E\u0441\u0442\u0440\u043E\u0432\u043E\u0432 (v_kind = 3) \u0441\u044E\u0434\u0430 \u0434\u043E\u0445\u043E\u0434\u044F\u0442 \u0441 \u0412\u042B\u041A\u041B\u042E\u0427\u0415\u041D\u041D\u041E\u0419 \u0437\u0430\u043F\u0438\u0441\u044C\u044E \u0446\u0432\u0435\u0442\u0430:
|
|
1853
|
+
// \u043E\u043D\u0438 \u0442\u043E\u043B\u044C\u043A\u043E \u0437\u0430\u043A\u0440\u044B\u0432\u0430\u044E\u0442 \u0434\u044B\u0440\u043A\u0443 \u0432 \u0433\u043B\u0443\u0431\u0438\u043D\u0435, \u0430 \u043A\u0440\u0430\u0441\u043A\u0443 \u043E\u0441\u0442\u0440\u043E\u0432\u0430 \u043E\u0441\u0442\u0430\u0432\u043B\u044F\u044E\u0442 \u0435\u0433\u043E
|
|
1854
|
+
// \u0441\u043E\u0431\u0441\u0442\u0432\u0435\u043D\u043D\u044B\u043C \u0441\u043B\u043E\u044F\u043C. \u041E\u0442\u0434\u0435\u043B\u044C\u043D\u043E\u0439 \u0432\u0435\u0442\u043A\u0438 \u0438\u043C \u043F\u043E\u044D\u0442\u043E\u043C\u0443 \u043D\u0435 \u043D\u0443\u0436\u043D\u043E.
|
|
1855
|
+
|
|
1856
|
+
// \u041C\u0430\u0442\u0435\u0440\u0438\u0430\u043B (\u0432\u043E\u0434\u0430, \u0437\u0435\u043B\u0435\u043D\u044C, \u043F\u0435\u0441\u043E\u043A) \u2014 \u0442\u043E\u043B\u044C\u043A\u043E \u043D\u0430 \u0412\u0415\u0420\u0425\u041D\u0415\u0419 \u043F\u043B\u043E\u0441\u043A\u043E\u0441\u0442\u0438: \u043D\u0430 \u0431\u043E\u0440\u0442\u0443
|
|
1857
|
+
// \u0440\u044F\u0431\u044C \u0447\u0438\u0442\u0430\u043B\u0430\u0441\u044C \u0431\u044B \u043F\u043E\u043B\u043E\u0441\u0430\u043C\u0438 \u043F\u043E\u043F\u0435\u0440\u0451\u043A \u0444\u0430\u0441\u043A\u0438.
|
|
1858
|
+
if (v_kind < 0.5 && u_material != 0) albedo = applyMaterial(albedo, v_world);
|
|
1859
|
+
if (v_kind > 0.5) albedo = u_side_color * (1.0 - u_side_shade);
|
|
1860
|
+
|
|
1861
|
+
float ndotl = dot(n, -u_key_dir);
|
|
1862
|
+
float keyFactor = max(ndotl, 0.0) * (1.0 - shadowOcclusion(ndotl));
|
|
1863
|
+
vec3 color = applyLightWithFactor(albedo, n, keyFactor);
|
|
1864
|
+
|
|
1865
|
+
// \u0411\u0435\u0440\u0435\u0433 \u0443\u0442\u043E\u043F\u043B\u0435\u043D\u043D\u043E\u0439 \u043F\u043E\u0432\u0435\u0440\u0445\u043D\u043E\u0441\u0442\u0438 \u2014 \u043F\u0440\u043E\u0434\u043E\u043B\u0436\u0435\u043D\u0438\u0435 \u0437\u0435\u043C\u043B\u0438, \u0430 \u043D\u0435 \u0441\u0442\u0435\u043D\u043A\u0430 \u0431\u0430\u0441\u0441\u0435\u0439\u043D\u0430.
|
|
1866
|
+
// \u0421\u0432\u0435\u0442 \u043D\u0430 \u043D\u0435\u0433\u043E \u043D\u0435 \u043A\u043B\u0430\u0434\u0451\u043C \u0432\u043E\u0432\u0441\u0435: \u043B\u044E\u0431\u043E\u0439 \u043F\u0435\u0440\u0435\u043F\u0430\u0434 \u044F\u0440\u043A\u043E\u0441\u0442\u0438 \u0432\u0434\u043E\u043B\u044C \u0432\u0441\u0435\u0439 \u0431\u0435\u0440\u0435\u0433\u043E\u0432\u043E\u0439
|
|
1867
|
+
// \u043B\u0438\u043D\u0438\u0438 \u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044F \u043B\u0435\u043D\u0442\u043E\u0439, \u0434\u0430\u0436\u0435 \u043A\u043E\u0433\u0434\u0430 \u0446\u0432\u0435\u0442 \u0432\u0435\u0440\u043D\u044B\u0439.
|
|
1868
|
+
if (v_kind > 0.5 && u_side_light > 0.0) color = mix(color, albedo, u_side_light);
|
|
1869
|
+
|
|
1870
|
+
fragColor = vec4(applyFog(color) * alpha, alpha);
|
|
1871
|
+
}
|
|
1872
|
+
`,Ua=`#version 300 es
|
|
1873
|
+
precision highp float;
|
|
1874
|
+
|
|
1875
|
+
in vec2 a_pos; // \u044D\u043A\u0440\u0430\u043D\u043D\u044B\u0435 \u043F\u0438\u043A\u0441\u0435\u043B\u0438 (CSS)
|
|
1876
|
+
in vec2 a_tex; // \u0442\u0435\u043A\u0441\u0435\u043B\u0438 \u0430\u0442\u043B\u0430\u0441\u0430
|
|
1877
|
+
in float a_scale; // \u044D\u043A\u0440\u0430\u043D\u043D\u044B\u0445 \u043F\u0438\u043A\u0441\u0435\u043B\u0435\u0439 \u043D\u0430 \u043E\u0434\u0438\u043D \u0442\u0435\u043A\u0441\u0435\u043B\u044C SDF
|
|
1878
|
+
/**
|
|
1879
|
+
* \u041F\u0440\u043E\u0437\u0440\u0430\u0447\u043D\u043E\u0441\u0442\u044C \u042D\u0422\u041E\u0419 \u043F\u043E\u0434\u043F\u0438\u0441\u0438, 0..1 \u2014 \u043F\u043B\u0430\u0432\u043D\u043E\u0435 \u043F\u043E\u044F\u0432\u043B\u0435\u043D\u0438\u0435.
|
|
1880
|
+
*
|
|
1881
|
+
* \u0418\u0434\u0451\u0442 \u0432\u0435\u0440\u0448\u0438\u043D\u043E\u0439, \u0430 \u043D\u0435 \u044E\u043D\u0438\u0444\u043E\u0440\u043C\u043E\u043C, \u043F\u043E\u0442\u043E\u043C\u0443 \u0447\u0442\u043E \u0432 \u043E\u0434\u043D\u043E\u043C \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D\u0435 \u043E\u0442\u0440\u0438\u0441\u043E\u0432\u043A\u0438 \u043B\u0435\u0436\u0430\u0442 \u043F\u043E\u0434\u043F\u0438\u0441\u0438 \u0440\u0430\u0437\u043D\u043E\u0433\u043E
|
|
1882
|
+
* \u0432\u043E\u0437\u0440\u0430\u0441\u0442\u0430: \u043E\u0434\u043D\u0430 \u0432\u0438\u0441\u0438\u0442 \u0434\u0430\u0432\u043D\u043E, \u0441\u043E\u0441\u0435\u0434\u043D\u044F\u044F \u043F\u043E\u044F\u0432\u0438\u043B\u0430\u0441\u044C \u0442\u043E\u043B\u044C\u043A\u043E \u0447\u0442\u043E. \u042E\u043D\u0438\u0444\u043E\u0440\u043C \u043A\u0440\u0430\u0441\u0438\u043B \u0431\u044B \u0438\u0445 \u043E\u0434\u0438\u043D\u0430\u043A\u043E\u0432\u043E, \u0438
|
|
1883
|
+
* \u043F\u043E\u044F\u0432\u043B\u0435\u043D\u0438\u0435 \u0441\u043D\u043E\u0432\u0430 \u0441\u0442\u0430\u043B\u043E \u0431\u044B \u043C\u0433\u043D\u043E\u0432\u0435\u043D\u043D\u044B\u043C.
|
|
1884
|
+
*/
|
|
1885
|
+
in float a_fade;
|
|
1886
|
+
|
|
1887
|
+
uniform vec2 u_viewport;
|
|
1888
|
+
uniform float u_atlas_size;
|
|
1889
|
+
|
|
1890
|
+
out vec2 v_tex;
|
|
1891
|
+
out float v_scale;
|
|
1892
|
+
out float v_fade;
|
|
1893
|
+
|
|
1894
|
+
void main() {
|
|
1895
|
+
// \u044D\u043A\u0440\u0430\u043D \u2192 \u043A\u043B\u0438\u043F; Y \u043D\u0430 \u044D\u043A\u0440\u0430\u043D\u0435 \u0432\u043D\u0438\u0437, \u0432 \u043A\u043B\u0438\u043F\u0435 \u0432\u0432\u0435\u0440\u0445
|
|
1896
|
+
vec2 ndc = a_pos / u_viewport * 2.0 - 1.0;
|
|
1897
|
+
gl_Position = vec4(ndc.x, -ndc.y, 0.0, 1.0);
|
|
1898
|
+
v_tex = a_tex / u_atlas_size;
|
|
1899
|
+
v_scale = a_scale;
|
|
1900
|
+
v_fade = a_fade;
|
|
1901
|
+
}
|
|
1902
|
+
`,Ja=`#version 300 es
|
|
1903
|
+
precision highp float;
|
|
1904
|
+
|
|
1905
|
+
in vec2 v_tex;
|
|
1906
|
+
in float v_scale; // \u044D\u043A\u0440\u0430\u043D\u043D\u044B\u0445 \u043F\u0438\u043A\u0441\u0435\u043B\u0435\u0439 (CSS) \u043D\u0430 \u0442\u0435\u043A\u0441\u0435\u043B\u044C SDF
|
|
1907
|
+
in float v_fade; // 0..1 \u2014 \u043F\u043B\u0430\u0432\u043D\u043E\u0435 \u043F\u043E\u044F\u0432\u043B\u0435\u043D\u0438\u0435 \u043F\u043E\u0434\u043F\u0438\u0441\u0438
|
|
1908
|
+
|
|
1909
|
+
uniform sampler2D u_atlas;
|
|
1910
|
+
uniform vec4 u_color; // premultiplied
|
|
1911
|
+
uniform vec4 u_halo_color; // premultiplied
|
|
1912
|
+
uniform float u_edge; // \u043A\u0440\u0430\u0439 \u0444\u0438\u0433\u0443\u0440\u044B \u0432 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u044F\u0445 SDF (0.75)
|
|
1913
|
+
uniform float u_halo; // \u0442\u043E\u043B\u0449\u0438\u043D\u0430 \u043E\u0431\u0432\u043E\u0434\u043A\u0438 \u0432 \u0435\u0434\u0438\u043D\u0438\u0446\u0430\u0445 SDF
|
|
1914
|
+
uniform float u_dpr; // \u043F\u043B\u043E\u0442\u043D\u043E\u0441\u0442\u044C \u0431\u0443\u0444\u0435\u0440\u0430: \u044D\u043A\u0440\u0430\u043D\u043D\u044B\u0439 \u043F\u0438\u043A\u0441\u0435\u043B\u044C \u2260 \u043F\u0438\u043A\u0441\u0435\u043B\u044C CSS
|
|
1915
|
+
|
|
1916
|
+
/**
|
|
1917
|
+
* \u041F\u043E\u043B\u0443\u0448\u0438\u0440\u0438\u043D\u0430 \u043F\u0435\u0440\u0435\u0445\u043E\u0434\u0430 \u0432 \u0435\u0434\u0438\u043D\u0438\u0446\u0430\u0445 SDF, \u043A\u0430\u043A \u0443 Mapbox (EDGE_GAMMA = 0.105/dpr).
|
|
1918
|
+
* \u041F\u043E \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u044E \u044D\u0442\u043E 0.84 \u0430\u043F\u043F\u0430\u0440\u0430\u0442\u043D\u043E\u0433\u043E \u043F\u0438\u043A\u0441\u0435\u043B\u044F \u2014 \u0442\u043E \u0435\u0441\u0442\u044C \u043F\u0435\u0440\u0435\u0445\u043E\u0434 \u0447\u0443\u0442\u044C \u0423\u0416\u0415 \u043F\u0438\u043A\u0441\u0435\u043B\u044F,
|
|
1919
|
+
* \u0430 \u043D\u0435 \u0448\u0438\u0440\u0435 \u0435\u0433\u043E.
|
|
1920
|
+
*/
|
|
1921
|
+
const float EDGE_GAMMA = 0.105;
|
|
1922
|
+
|
|
1923
|
+
out vec4 fragColor;
|
|
1924
|
+
|
|
1925
|
+
void main() {
|
|
1926
|
+
float d = texture(u_atlas, v_tex).r;
|
|
1927
|
+
|
|
1928
|
+
// \u0428\u0438\u0440\u0438\u043D\u0443 \u0441\u0433\u043B\u0430\u0436\u0438\u0432\u0430\u043D\u0438\u044F \u0441\u0447\u0438\u0442\u0430\u0435\u043C \u041F\u041E \u041C\u0410\u0421\u0428\u0422\u0410\u0411\u0423 \u043A\u0432\u0430\u0434\u0430, \u0430 \u043D\u0435 \u0447\u0435\u0440\u0435\u0437 fwidth.
|
|
1929
|
+
// \u041F\u0440\u0438\u0447\u0438\u043D \u0434\u0432\u0435. \u041F\u0435\u0440\u0432\u0430\u044F: fwidth \u0434\u0430\u0451\u0442 \xB11 \u0430\u043F\u043F\u0430\u0440\u0430\u0442\u043D\u044B\u0439 \u043F\u0438\u043A\u0441\u0435\u043B\u044C, \u0442\u043E \u0435\u0441\u0442\u044C \u043F\u0435\u0440\u0435\u0445\u043E\u0434 \u0432
|
|
1930
|
+
// \u0434\u0432\u0430 \u043F\u0438\u043A\u0441\u0435\u043B\u044F \u0432\u043C\u0435\u0441\u0442\u043E \u043D\u0443\u0436\u043D\u044B\u0445 1.7 \u2014 \u0431\u0443\u043A\u0432\u0430 \u043F\u043E\u043B\u0443\u0447\u0430\u0435\u0442\u0441\u044F \u043C\u044F\u0433\u0447\u0435, \u0447\u0435\u043C \u0443 Mapbox.
|
|
1931
|
+
// \u0412\u0442\u043E\u0440\u0430\u044F, \u0438 \u0431\u043E\u043B\u0435\u0435 \u0437\u0430\u043C\u0435\u0442\u043D\u0430\u044F: fwidth \u044D\u0442\u043E |dFdx| + |dFdy|, \u0438 \u043D\u0430 \u0434\u0438\u0430\u0433\u043E\u043D\u0430\u043B\u044C\u043D\u043E\u043C
|
|
1932
|
+
// \u0448\u0442\u0440\u0438\u0445\u0435 \u0441\u0443\u043C\u043C\u0430 \u0432 1.4 \u0440\u0430\u0437\u0430 \u0431\u043E\u043B\u044C\u0448\u0435 \u043D\u0430\u0441\u0442\u043E\u044F\u0449\u0435\u0433\u043E \u0433\u0440\u0430\u0434\u0438\u0435\u043D\u0442\u0430 \u2014 \u043A\u043E\u0441\u044B\u0435 \u0447\u0430\u0441\u0442\u0438 \u0431\u0443\u043A\u0432
|
|
1933
|
+
// \u0440\u0430\u0437\u043C\u044B\u0432\u0430\u043B\u0438\u0441\u044C \u0441\u0438\u043B\u044C\u043D\u0435\u0435 \u043F\u0440\u044F\u043C\u044B\u0445. \u0410\u043D\u0430\u043B\u0438\u0442\u0438\u0447\u0435\u0441\u043A\u0430\u044F \u0448\u0438\u0440\u0438\u043D\u0430 \u043E\u0442 \u043E\u0431\u0435\u0438\u0445 \u0431\u0435\u0434 \u0441\u0432\u043E\u0431\u043E\u0434\u043D\u0430 \u0438
|
|
1934
|
+
// \u0432\u0434\u043E\u0431\u0430\u0432\u043E\u043A \u043D\u0435 \u0448\u0443\u043C\u0438\u0442 \u043D\u0430 \u0433\u0440\u0430\u043D\u0438\u0446\u0430\u0445 \u0442\u0435\u043A\u0441\u0435\u043B\u0435\u0439 (\u043F\u0440\u043E\u0438\u0437\u0432\u043E\u0434\u043D\u0430\u044F \u043E\u0442 \u0431\u0438\u043B\u0438\u043D\u0435\u0439\u043D\u043E\u0439 \u0432\u044B\u0431\u043E\u0440\u043A\u0438
|
|
1935
|
+
// \u0441\u0442\u0443\u043F\u0435\u043D\u0447\u0430\u0442\u0430\u044F \u2014 \u043E\u0442 \u043D\u0435\u0451 \u043A\u0440\u0430\u0439 \u0448\u0451\u043B \u0435\u0434\u0432\u0430 \u0437\u0430\u043C\u0435\u0442\u043D\u043E\u0439 \u0440\u044F\u0431\u044C\u044E).
|
|
1936
|
+
float w = EDGE_GAMMA / max(u_dpr * v_scale, 1e-4);
|
|
1937
|
+
|
|
1938
|
+
float fill = smoothstep(u_edge - w, u_edge + w, d);
|
|
1939
|
+
float halo = smoothstep(u_edge - u_halo - w, u_edge - u_halo + w, d);
|
|
1940
|
+
|
|
1941
|
+
// \u043E\u0431\u0432\u043E\u0434\u043A\u0430 \u0441\u043D\u0438\u0437\u0443, \u0437\u0430\u043B\u0438\u0432\u043A\u0430 \u043F\u043E\u0432\u0435\u0440\u0445 (\u0446\u0432\u0435\u0442\u0430 premultiplied)
|
|
1942
|
+
vec4 color = u_halo_color * halo;
|
|
1943
|
+
color = color * (1.0 - fill) + u_color * fill;
|
|
1944
|
+
|
|
1945
|
+
// \u041F\u043B\u0430\u0432\u043D\u043E\u0435 \u043F\u043E\u044F\u0432\u043B\u0435\u043D\u0438\u0435. \u0426\u0432\u0435\u0442 premultiplied, \u043F\u043E\u044D\u0442\u043E\u043C\u0443 \u043F\u0440\u043E\u0437\u0440\u0430\u0447\u043D\u043E\u0441\u0442\u044C \u0434\u043E\u043C\u043D\u043E\u0436\u0430\u0435\u0442 \u0412\u0421\u0415 \u043A\u0430\u043D\u0430\u043B\u044B: \u0438\u043D\u0430\u0447\u0435 \u043E\u0431\u0432\u043E\u0434\u043A\u0430
|
|
1946
|
+
// \u043F\u0440\u043E\u0441\u0442\u0443\u043F\u0430\u043B\u0430 \u0431\u044B \u0440\u0430\u043D\u044C\u0448\u0435 \u0431\u0443\u043A\u0432\u044B \u0438 \u043F\u043E\u0434\u043F\u0438\u0441\u044C \u0432\u0441\u043F\u043B\u044B\u0432\u0430\u043B\u0430 \u0431\u044B \u0431\u0435\u043B\u044B\u043C \u043F\u044F\u0442\u043D\u043E\u043C.
|
|
1947
|
+
color *= v_fade;
|
|
1948
|
+
|
|
1949
|
+
if (color.a <= 0.001) discard;
|
|
1950
|
+
fragColor = color;
|
|
1951
|
+
}
|
|
1952
|
+
`;var No=n=>n.kind==="symbol",Xa=n=>n.kind==="placement";function We(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],u=r[i+4],m=r[i+5];if(Bf(e,t,a,l,s,c,u,m)||o>0&&(Yr(e,t,a,l,s,c)<=o||Yr(e,t,s,c,u,m)<=o||Yr(e,t,u,m,a,l)<=o))return true}return false}function Bf(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),u=(n-t)*(l-o)-(a-t)*(e-o),m=s<0||c<0||u<0,f=s>0||c>0||u>0;return !(m&&f)}function Yr(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 Zr(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]*Ue;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 Qr(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 u=n.indices[c]*Fe;s[c*2]=a+o.getInt16(u,true)*i,s[c*2+1]=l+o.getInt16(u+2,true)*i;}return s}var Cf={stride:8,attribs:[{name:"a_pos",size:2,type:5126,offset:0}]},vf=40,wf=10.5,ja=2.5,xf=16,_f=4,Df=7,Xt=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,u=r.layers.filter(B=>B.type==="symbol"&&B.layout?.placement==="map"&&r.layerVisibleAt(B,c));if(!u.length)return;let m=t.center,f=ee(m.lng),d=te(m.lat),h=t.worldSize>0?t.pixelsPerMeter/t.worldSize:0;if(!(h>0))return;let p=[];for(let B of u){let C=o.get(B.source??X);if(!C)continue;let v=r.bucketKeyFor(B);if(v===null)continue;let _=B.layout?.showFor==="highlight";if(_&&!this.highlightFootprint)continue;let w=h*1.5,D=B.layout?.arrowUnits==="meters"?h:1/t.worldSize,I=O(B.layout?.arrowLength,c,vf)*D,E=O(B.layout?.arrowWidth,c,wf)*D,L=O(B.layout?.arrowOutline,c,ja)*D,M=O(B.layout?.arrowGap,c,xf)*D,S=O(B.layout?.arrowDotRadius,c,_f)*D,F=O(B.layout?.arrowDotGap,c,Df)*D,T=$r(I,E,S,M-F),k=L>0?$r(I,E,S,M-F,L).outline:null,H={layer:B,verts:[],shape:T};for(let G of C.visibleTiles){let R=C.getTile(G)?.data?.buckets?.[v];if(!R||!No(R))continue;let W=new Int16Array(R.anchors),V=R.rotations?new Int16Array(R.rotations):null,j=G.bounds(),Y=(j.maxX-j.minX)/R.extent,oe=j.minX,ge=j.minY;for(let $=0;$<W.length/2;$++){let J=oe+W[$*2]*Y,be=ge+W[$*2+1]*Y;if(_&&!We(this.highlightFootprint,J,be,w))continue;let Ae=(V?V[$]:0)*Math.PI/180,Q=Math.sin(Ae),K=-Math.cos(Ae),U=J-f-Q*M,de=be-d-K*M;k&&en(H,k,U,de,Q,K),en(H,T.outline,U,de,Q,K),this.count++;}}H.verts.length&&p.push(H);}if(!p.length)return;let b=p[0].shape,A=b.outline.length/2,y=[],g=[];for(let B of p){let C=y.length/2/A;for(let v of B.verts)y.push(v);g.push({layer:B.layer,first:C,count:B.verts.length/2/A});}if(this.ensureBuffers(e,y.length/2/A,b,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 g){let C=B.layer.paint,v=O(C.opacity,c,1),_=Le(C.color,c,[.18,.45,.76,1]),w=Le(C.haloColor,c,[1,1,1,1]),x=O(B.layer.layout?.arrowOutline,c,ja)>0;Ff(e,i,B,w,_,v,x,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 ye(e,new Uint8Array(this.capacity*i*8),Cf,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 fe(e,a),this.vao=new le(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 Ff(n,e,t,o,r,i,a,l){let s=a?2:1;if(a){e.setVec4v("u_color",xe([o[0],o[1],o[2],o[3]*i]));for(let c=0;c<t.count;c+=s)Ya(n,t.first+c,l);}e.setVec4v("u_color",xe([r[0],r[1],r[2],r[3]*i]));for(let c=a?1:0;c<t.count;c+=s)Ya(n,t.first+c,l);}function Ya(n,e,t){n.gl.drawElements(n.gl.TRIANGLES,t,n.gl.UNSIGNED_INT,e*t*4);}var Za=4,qr=12;function $r(n,e,t,o,r=0){let i=n*.38,a=e*1.35,l=i*.3,s=e*.32,c=e/2,u=-n+s,m=[],f=(A,y)=>m.push(A,y);f(0,0),f(-i,a),f(-i+l,c),f(u,s);for(let A=1;A<Za;A++){let y=A/Za*Math.PI;f(u-Math.sin(y)*s,Math.cos(y)*s);}f(u,-s),f(-i+l,-c),f(-i,-a);let d=r>0?Ef(m,r):m,h=Se(m,void 0,2);if(t<=0)return {outline:d,indices:h};let p=d.length/2,b=t+r;for(let A=0;A<qr;A++){let y=A/qr*Math.PI*2;d.push(o+Math.cos(y)*b,Math.sin(y)*b);}for(let A=1;A<qr-1;A++)h.push(p,p+A,p+A+1);return {outline:d,indices:h}}function Ef(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],u=n[a*2+1],m=n[(a+1)%t*2],f=n[(a+1)%t*2+1],d=Math.hypot(c-l,u-s)||1,h=Math.hypot(m-c,f-u)||1,p=r*(u-s)/d,b=-r*(c-l)/d,A=r*(f-u)/h,y=-r*(m-c)/h,g=p+A,B=b+y,C=Math.hypot(g,B);if(C<1e-9){i.push(c,u);continue}g/=C,B/=C;let v=Math.min(1/Math.max(g*p+B*b,.35),3);i.push(c+g*e*v,u+B*e*v);}return i}function en(n,e,t,o,r,i){let a=-i,l=r;for(let s=0;s<e.length;s+=2){let c=e[s],u=e[s+1];n.verts.push(t+r*c+a*u,o+i*c+l*u);}}function Mf(n,e,t,o,r,i=0,a=0){let l=t*Math.PI/180,s={verts:[]};return en(s,$r(o,r,i,a).outline,n,e,Math.sin(l),-Math.cos(l)),s.verts}var If=5;function Qa(n,e){let t=1/(1<<e),o=(1<<e)-1;return [(n.x&o)*t,(n.y&o)*t,t]}var Ko=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(u=>u.type==="raster"&&!!u.overlay===s&&i.layerVisibleAt(u,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 u of c){let m=a.get(u.source);if(!m)continue;let f=O(u.paint?.opacity,l,1);if(!(f<=.001)){r.setFloat("u_opacity",f),o.bind();for(let d of m.visibleTiles){let h=this.patchFor(e,m,d);h&&(e.bindTexture(0,h.texture),r.setVec3("u_uv_transform",h.uv[0],h.uv[1],h.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<=If&&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:Qa(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 Sf="indoor-",jt=class{constructor(){this.parts=null;this.stamp="";this.cache=new P;this.box=null;this.hidden=new q;this.collected=new q;}get active(){return this.parts!==null}footprint(){return this.parts}get hiddenCount(){return this.hidden.size}sync(e,t,o){let r=[],i;for(let f of t.layers){if(!f.id.startsWith(Sf)||f.type!=="fill"||!t.layerVisibleAt(f,o))continue;let d=t.bucketKeyFor(f);d&&(r.push(d),i??(i=e.get(f.source??X)));}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,u=-1/0,m=-1/0;for(let f of i.visibleTiles){let d=i.getTile(f)?.data?.buckets;if(d)for(let h of r){let p=d[h];if(!p||p.kind!=="fill")continue;let b=Zr(p,f);l.push(b);for(let A=0;A<b.length;A+=2)b[A]<s&&(s=b[A]),b[A]>u&&(u=b[A]),b[A+1]<c&&(c=b[A+1]),b[A+1]>m&&(m=b[A+1]);}}this.parts=l.length?l:null,this.box=l.length?[s,c,u,m]: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,u=new P;for(let m=0;m*3<r.length;m++){let f=i[m];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 h=0;h<3;h++){let p=r[m*3+h]*Fe,b=a.getInt16(p,true),A=a.getInt16(p+2,true);b<d[0]&&(d[0]=b),A<d[1]&&(d[1]=A),b>d[2]&&(d[2]=b),A>d[3]&&(d[3]=A);}}for(let[m,f]of u){let d=l.minX+(f[0]+f[2])/2*s,h=l.minY+(f[1]+f[3])/2*s;c&&(d<c[0]||d>c[2]||h<c[1]||h>c[3])||We(o,d,h,0)&&this.hidden.add(m);}}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 u=new Uint32Array(s.indices),m=new Float64Array(s.featureIds),f=[];for(let d=0;d*3<u.length;d++)this.hidden.has(m[d])||f.push(u[d*3],u[d*3+1],u[d*3+2]);if(f.length<u.length){let d=new fe(e,new Uint32Array(f));c={vao:new le(e,[{buffer:i,locations:a}],d),ibo:d,count:f.length};}}return this.cache.set(r.dataKey,c),c}};var qa=35,Lf=70,Hf=.35,Tf=.5,Pf=1.1;function gt(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=ve((n.pitch-qa)/(Lf-qa),0,1),i=t.fogRange[0]*(1-Hf*r)*o,a=t.fogRange[1]*(1-Tf*r)*o,l=Math.min(1,t.fogIntensity+(1-t.fogIntensity)*Math.min(1,r*2)),s=l>=.995?a*Pf:1/0;return {near:i,far:a,intensity:l,cutoff:s}}function tn(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 u of e.visibleTiles){let m=e.getTile(u),f=m&&$a(m,t);if(!f||!ke(l,n.tileMatrix64(u,f.extent))||(ae(s,l,[r,i,-1,1]),ae(c,l,[r,i,1,1]),s[3]===0||c[3]===0))continue;let d=s[0]/s[3],h=s[1]/s[3],p=s[2]/s[3],b=c[0]/c[3]-d,A=c[1]/c[3]-h,y=c[2]/c[3]-p,g=Gf(f,d,h,p,b,A,y);g&&(!a||g.t<a.distance)&&(a={featureId:g.featureId,tile:u,layerId:t,distance:g.t});}return a}function on(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 u of e.visibleTiles){let m=e.getTile(u);if(m)for(let f of t){let d=m.data?.buckets?.[f];if(!d||d.kind!=="fill"||!d.featureIds||!ke(l,n.tileMatrix64(u,d.extent))||(ae(s,l,[r,i,-1,1]),ae(c,l,[r,i,1,1]),s[3]===0||c[3]===0))continue;let h=s[0]/s[3],p=s[1]/s[3],b=s[2]/s[3],A=c[2]/c[3]-b;if(Math.abs(A)<1e-9)continue;let y=-b/A;if(y<0||y>1)continue;let g=h+(c[0]/c[3]-h)*y,B=p+(c[1]/c[3]-p)*y,C=kf(d,g,B);C!==null&&(!a||y<a.distance)&&(a={featureId:C,tile:u,layerId:f,distance:y});}}return a}function kf(n,e,t){let o=new DataView(n.vertices),r=new Uint32Array(n.indices),i=new Float64Array(n.featureIds),a=s=>o.getInt16(s*Ue,true),l=s=>o.getInt16(s*Ue+2,true);for(let s=0;s*3<r.length;s++){let c=r[s*3],u=r[s*3+1],m=r[s*3+2],f=a(c),d=l(c),h=a(u),p=l(u),b=a(m),A=l(m),y=(e-h)*(d-p)-(f-h)*(t-p),g=(e-b)*(p-A)-(h-b)*(t-A),B=(e-f)*(A-d)-(b-f)*(t-d),C=y<0||g<0||B<0,v=y>0||g>0||B>0;if(!(C&&v))return i[s]}return null}function $a(n,e){let t=n.data?.buckets?.[e];return !t||t.kind!=="fill-extrusion"||!t.featureIds?null:t}function Gf(n,e,t,o,r,i,a){let l=new DataView(n.vertices),s=new Uint32Array(n.indices),c=new Float64Array(n.featureIds),u=p=>l.getInt16(p*Fe,true),m=p=>l.getInt16(p*Fe+2,true),f=p=>l.getUint16(p*Fe+4,true)/dt,d=1/0,h=-1;for(let p=0;p+2<s.length;p+=3){let b=s[p],A=s[p+1],y=s[p+2],g=u(b),B=m(b),C=f(b),v=u(A)-g,_=m(A)-B,w=f(A)-C,x=u(y)-g,D=m(y)-B,I=f(y)-C,E=i*I-a*D,L=a*x-r*I,M=r*D-i*x,S=v*E+_*L+w*M;if(S>-1e-9&&S<1e-9)continue;let F=1/S,T=e-g,k=t-B,H=o-C,G=(T*E+k*L+H*M)*F;if(G<0||G>1)continue;let N=k*w-H*_,R=H*v-T*w,W=T*_-k*v,V=(r*N+i*R+a*W)*F;if(V<0||G+V>1)continue;let j=(x*N+D*R+I*W)*F;j<0||j>1||j>=d||(d=j,h=c[p/3]??0);}return h>=0?{featureId:h,t:d}:null}function Uo(n,e,t){let o=$a(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 Bt=24,rn=8,Rf=2,Of=12,Jo=8,Xo=8;function Yt(n){let e=0;for(let d of n)e+=d.length/2;if(e<2)return null;let t=(Jo+2)*2,o=e*t+n.length*(Xo+2)*2+8,r=e*(Jo+2)*6+n.length*Xo*6+24,i=new ArrayBuffer(o*Bt),a=new DataView(i),l=new Uint32Array(r),s=0,c=0,u=(d,h,p,b,A,y)=>{let g=s*Bt;return a.setFloat32(g,d,true),a.setFloat32(g+4,h,true),a.setFloat32(g+8,p,true),a.setFloat32(g+12,b,true),a.setFloat32(g+16,A,true),a.setFloat32(g+20,y,true),s++},m=(d,h,p,b)=>{l[c++]=d,l[c++]=h,l[c++]=b,l[c++]=d,l[c++]=b,l[c++]=p;},f=(d,h,p,b,A,y,g)=>{let B=u(d,h,0,0,0,g),C=u(d,h,p,b,1,g);for(let v=1;v<=Xo;v++){let _=Math.PI*v/Xo,w=p*Math.cos(_)+A*Math.sin(_),x=b*Math.cos(_)+y*Math.sin(_),D=u(d,h,w,x,1,g);l[c++]=B,l[c++]=C,l[c++]=D,C=D;}};for(let d of n){let h=Wf(d),p=h.length/2;if(p<2)continue;let b=new Float64Array(p-1),A=new Float64Array(p-1);for(let v=0;v<p-1;v++){let _=h[v*2+2]-h[v*2],w=h[v*2+3]-h[v*2+1],x=Math.hypot(_,w)||1;b[v]=_/x,A[v]=w/x;}let y=0,g=-1,B=-1;for(let v=0;v<p;v++){let _=h[v*2],w=h[v*2+1];v>0&&(y+=Math.hypot(_-h[v*2-2],w-h[v*2-1]));let x=v>0?v-1:0,D=v<p-1?v:p-2,I=-A[x],E=b[x],L=-A[D],M=b[D],S=I+L,F=E+M,T=Math.hypot(S,F);T>1e-9?(S/=T,F/=T):(S=I,F=E);let k=S*L+F*M,H=k>1e-6?1/k:1/0,G=Math.acos(Math.min(1,Math.max(-1,b[x]*b[D]+A[x]*A[D])));if(!(G>Of*Math.PI/180)&&H<=Rf){let R=u(_,w,S*H,F*H,1,y),W=u(_,w,-S*H,-F*H,-1,y);g>=0&&m(g,B,R,W),g=R,B=W;}else {let R=Math.max(1,Math.min(Jo,Math.ceil(G/(Math.PI/Jo)))),V=b[x]*A[D]-A[x]*b[D]>=0?1:-1,j=u(_,w,I,E,1,y),Y=u(_,w,-I,-E,-1,y);g>=0&&m(g,B,j,Y);for(let oe=1;oe<=R;oe++){let ge=V*G*(oe/R),$=Math.cos(ge),J=Math.sin(ge),be=I*$-E*J,Ae=I*J+E*$,Q=u(_,w,be,Ae,1,y),K=u(_,w,-be,-Ae,-1,y);m(j,Y,Q,K),j=Q,Y=K;}g=j,B=Y;}}let C=p-2;f(h[0],h[1],-A[0],b[0],-b[0],-A[0],0),f(h[(p-1)*2],h[(p-1)*2+1],-A[C],b[C],b[C],A[C],y);}return c?{vertices:i.slice(0,s*Bt),indices:l.slice(0,c),vertexCount:s}:null}function nn(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=Se(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 Wf(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 Zt=5126,Vf={stride:rn,attribs:[{name:"a_pos",size:2,type:Zt,offset:0}]},ln={stride:Bt,attribs:[{name:"a_pos",size:2,type:Zt,offset:0},{name:"a_extrude",size:2,type:Zt,offset:8},{name:"a_side",size:1,type:Zt,offset:16},{name:"a_dist",size:1,type:Zt,offset:20}]},an=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();}},zf=(n,e)=>[n[0],n[1],n[2],n[3]*e],Qt=class{constructor(){this.objects=[];this.markers=[];this.gpu=new P;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(h=>h.ghostOpacity>0))return;this.objects.length>1&&this.objects.sort((h,p)=>h.zIndex-p.zIndex);let u=e.gl.drawingBufferWidth,m=t.width>0?u/t.width:1,f=t.worldSize*m,d=null;for(let h of this.objects){if(!h.visible)continue;let p=h.ghostOpacity;if(c&&p<=0)continue;let b=this.gpuFor(e,h,r,a);if(!b)continue;let A=s?t.shadowObjectMatrix(h.originX,h.originY,h.altitude):null,y=t.objectMatrix(h.originX,h.originY,h.altitude);for(let{part:g,vao:B,ibo:C}of b.parts){if(c&&(g.kind!=="line"||g.arrow))continue;let v=c?zf(g.color,p):g.color;if(g.kind==="fill")d!==o&&(o.use(),l?.(o),d=o),o.setVec4v("u_color",xe(v)),A&&o.setMat4("u_shadow_matrix",A),o.setMat4("u_matrix",y);else {d!==i&&(i.use(),l?.(i),d=i);let _=g.width/2*m,w=f>1e-9?1/f:1;if(i.setVec4v("u_color",xe(v)),i.setFloat("u_half_width",_),i.setFloat("u_offset",(g.offset??0)*m),i.setFloat("u_aa",1),i.setFloat("u_units_per_px",w),i.setFloat("u_units_to_px",f),i.setInt("u_pattern",c?0:g.dashArray?1:g.arrow?2:0),g.dashArray){let[x,D]=g.dashArray;i.setVec2("u_dash",x*m,(x+D)*m);}if(g.arrow){i.setVec4v("u_arrow_color",xe(g.arrowColor??[1,1,1,1]));let x=(g.arrowSize??5)*m;i.setVec3("u_arrow",(g.arrowPeriod??46)*m,Math.max(x*.4,1),Math.min(x,_*.72));}A&&i.setMat4("u_shadow_matrix",A),i.setMat4("u_matrix",y);}B.bind(),e.gl.drawElements(e.gl.TRIANGLES,C.count,C.type,0);}}e.bindVAO(null);}hitTest(e,t,o=4){let r=e.worldSize,i=(a,l,s)=>e.worldPxToPoint(ee(a)*r,te(l)*r,s);for(let a=this.objects.length-1;a>=0;a--){let l=this.objects[a];if(l.visible&&l.hitTest(t,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=Z(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"?Vf:ln,u=s.kind==="fill"?o:r,m=new ye(e,new Uint8Array(s.mesh.vertices),c),f=new fe(e,s.mesh.indices),d=new le(e,[{buffer:m,locations:u}],f);a.push({part:s,vao:d,vbo:m,ibo:f});}let l=new an(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 jo=32,Jf=1179937895,Xf=1313821514,jf=5130562,Yf={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},Zf={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT4:16};async function sn(n){let{json:e,bin:t}=il(n),o=await qf(e,t);return ll(e,t,o)}function Qf(n){let{json:e,bin:t}=il(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 ll(e,t,null)}function il(n){let e=new DataView(n);if(e.getUint32(0,true)!==Jf)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===Xf?t=JSON.parse(new TextDecoder().decode(new Uint8Array(n,l,i))):a===jf&&(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 qf(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(()=>(nl(),rl));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),u=new Uint8Array(l.count*l.byteStride);r.decodeGltfBuffer(u,l.count,l.byteStride,c,l.mode,l.filter??"NONE"),i.set(a,u);}return i}function al(n){let e=z();if(n.matrix){for(let w=0;w<16;w++)e[w]=n.matrix[w];return e}Re(e);let[t,o,r]=n.translation??[0,0,0],[i,a,l,s]=n.rotation??[0,0,0,1],[c,u,m]=n.scale??[1,1,1],f=i+i,d=a+a,h=l+l,p=i*f,b=i*d,A=i*h,y=a*d,g=a*h,B=l*h,C=s*f,v=s*d,_=s*h;return e[0]=(1-(y+B))*c,e[1]=(b+_)*c,e[2]=(A-v)*c,e[4]=(b-_)*u,e[5]=(1-(p+B))*u,e[6]=(g+C)*u,e[8]=(A+v)*m,e[9]=(g-C)*m,e[10]=(1-(p+y))*m,e[12]=t,e[13]=o,e[14]=r,e}var $f={5120:127,5121:255,5122:32767,5123:65535};function eu(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],u=e*(i*c-a*s)-r*(t*c-o*s)+l*(t*a-o*i);if(Math.abs(u)<1e-20)return [1,0,0,0,1,0,0,0,1];let m=1/u;return [(i*c-a*s)*m,(a*l-r*c)*m,(r*s-i*l)*m,(o*s-t*c)*m,(e*c-o*l)*m,(t*l-e*s)*m,(t*a-o*i)*m,(o*r-e*a)*m,(e*i-t*r)*m]}function ll(n,e,t){let o=w=>{let x=t?.get(w);if(x)return x;let D=n.bufferViews?.[w];if(!D)return null;let I=D.byteOffset??0;return e.subarray(I,I+D.byteLength)},r=[],i=[],a=[],l=[],s=[],c=[1/0,1/0,1/0],u=[-1/0,-1/0,-1/0],m=w=>{if(w===void 0)return null;let x=n.accessors?.[w];if(!x)return null;let D=Zf[x.type]??1,I=new Float64Array(x.count*D),E=x.bufferView!==void 0?n.bufferViews?.[x.bufferView]:void 0;if(!E||x.bufferView===void 0)return {data:I,components:D};let L=o(x.bufferView);if(!L)return {data:I,components:D};let M=Yf[x.componentType]??4,S=E.extensions?.EXT_meshopt_compression,F=S?S.byteStride:E.byteStride,T=F&&F>0?F:M*D,k=x.byteOffset??0,H=new DataView(L.buffer,L.byteOffset,L.byteLength),G=x.normalized?$f[x.componentType]??1:1;for(let N=0;N<x.count;N++)for(let R=0;R<D;R++){let W=k+N*T+R*M,V;switch(x.componentType){case 5120:V=H.getInt8(W);break;case 5121:V=H.getUint8(W);break;case 5122:V=H.getInt16(W,true);break;case 5123:V=H.getUint16(W,true);break;case 5125:V=H.getUint32(W,true);break;default:V=H.getFloat32(W,true);}I[N*D+R]=G===1?V:Math.max(V/G,-1);}return {data:I,components:D}},f=(w,x,D=-1)=>{if(w.mode!==void 0&&w.mode!==4)return;let I=m(w.attributes.POSITION);if(!I)return;let E=m(w.attributes.NORMAL),L=m(w.attributes.TEXCOORD_0),M=m(w.indices),S=r.length/3,F=I.data.length/3,T=eu(x),H=(w.material!==void 0?n.materials?.[w.material]:void 0)?.pbrMetallicRoughness?.baseColorTexture?.extensions?.KHR_texture_transform,G=H?{ox:H.offset?.[0]??0,oy:H.offset?.[1]??0,sx:H.scale?.[0]??1,sy:H.scale?.[1]??1,rot:H.rotation??0}:null;for(let J=0;J<F;J++){let be=I.data[J*3],Ae=I.data[J*3+1],Q=I.data[J*3+2],K=x[0]*be+x[4]*Ae+x[8]*Q+x[12],U=x[1]*be+x[5]*Ae+x[9]*Q+x[13],de=x[2]*be+x[6]*Ae+x[10]*Q+x[14];if(r.push(K,U,de),K<c[0]&&(c[0]=K),U<c[1]&&(c[1]=U),de<c[2]&&(c[2]=de),K>u[0]&&(u[0]=K),U>u[1]&&(u[1]=U),de>u[2]&&(u[2]=de),E){let ne=E.data[J*3],Be=E.data[J*3+1],Me=E.data[J*3+2],Ce=T[0]*ne+T[3]*Be+T[6]*Me,bo=T[1]*ne+T[4]*Be+T[7]*Me,Ao=T[2]*ne+T[5]*Be+T[8]*Me,yo=Math.hypot(Ce,bo,Ao);yo>1e-12?(Ce/=yo,bo/=yo,Ao/=yo):(Ce=0,bo=1,Ao=0),i.push(Ce,bo,Ao);}else i.push(0,1,0);let ie=L?L.data[J*2]:0,he=L?L.data[J*2+1]:0;if(G){if(G.rot!==0){let ne=Math.cos(G.rot),Be=Math.sin(G.rot),Me=ne*ie+Be*he,Ce=-Be*ie+ne*he;ie=Me,he=Ce;}ie=ie*G.sx+G.ox,he=he*G.sy+G.oy;}a.push(ie,he);}let N=l.length;if(M)for(let J=0;J<M.data.length;J++)l.push(S+M.data[J]);else for(let J=0;J<F;J++)l.push(S+J);let R=w.material!==void 0?n.materials?.[w.material]:void 0,W=R?.pbrMetallicRoughness,V=W?.metallicFactor!==void 0||W?.roughnessFactor!==void 0,j=W?.baseColorFactor??[1,1,1,1],Y=W?.baseColorTexture?.index,oe=Y!==void 0?n.textures?.[Y]?.source:void 0,ge=R?.emissiveFactor??[0,0,0],$=R?.extensions?.KHR_materials_emissive_strength?.emissiveStrength??1;s.push({indexOffset:N,indexCount:l.length-N,baseColor:[j[0],j[1],j[2],j[3]??1],metallic:V?W?.metallicFactor??1:0,roughness:V?W?.roughnessFactor??1:1,emissive:[ge[0]*$,ge[1]*$,ge[2]*$],texture:oe??-1,doubleSided:R?.doubleSided===true,blend:R?.alphaMode==="BLEND",alphaCutoff:R?.alphaMode==="MASK"?R.alphaCutoff??.5:.02,node:D});},d=n.skins?.length?null:tu(n,m),h=d?d.nodes:null,p=(w,x,D,I)=>{let E=n.nodes?.[w];if(!E)return;let L=al(E),M=z();we(M,x,L);let S=z(),F=I,T=h?.get(w);if(T?(T.parentNode=I,T.parent=D.slice(),Re(S),F=w):we(S,D,L),E.mesh!==void 0)for(let H of n.meshes?.[E.mesh]?.primitives??[])f(H,S,F);let k=E.extensions?.KHR_lights_punctual?.light;if(k!==void 0){let H=n.extensions?.KHR_lights_punctual?.lights?.[k],G=H?.type;if(H&&(G==="point"||G==="spot"||G==="directional")){let N=-M[8],R=-M[9],W=-M[10],V=Math.hypot(N,R,W)||1,j=H.spot?.innerConeAngle??0,Y=H.spot?.outerConeAngle??Math.PI/4;b.push({type:G,color:[H.color?.[0]??1,H.color?.[1]??1,H.color?.[2]??1],intensity:H.intensity??1,range:H.range??0,position:[M[12],M[13],M[14]],direction:[N/V,R/V,W/V],cosInner:Math.cos(j),cosOuter:Math.cos(Y)});}}for(let H of E.children??[])p(H,M,S,F);},b=[],A=z();Re(A);let y=z();Re(y);let g=n.scenes?.[n.scene??0]?.nodes??n.nodes?.map((w,x)=>x)??[];for(let w of g)p(w,A,y,-1);let B=[];for(let w of n.images??[]){if(w.bufferView===void 0){B.push(new Uint8Array(0));continue}let x=o(w.bufferView);B.push(x?x.slice():new Uint8Array(0));}let C=r.length/3,v=new ArrayBuffer(C*jo),_=new Float32Array(v);for(let w=0;w<C;w++){let x=w*8;_[x]=r[w*3],_[x+1]=r[w*3+1],_[x+2]=r[w*3+2],_[x+3]=i[w*3],_[x+4]=i[w*3+1],_[x+5]=i[w*3+2],_[x+6]=a[w*2],_[x+7]=a[w*2+1];}return isFinite(c[0])||(c[0]=c[1]=c[2]=0,u[0]=u[1]=u[2]=0),{vertices:v,indices:new Uint32Array(l),primitives:s,images:B,min:c,max:u,animation:d,lights:b}}function tu(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),u=e(s.output);if(!c||!u||!c.data.length)continue;let m=l==="rotation"?4:3,f=s.interpolation==="CUBICSPLINE",d=c.data.length,h=new Float32Array(d*m);for(let b=0;b<d;b++){let A=f?(b*3+1)*m:b*m;for(let y=0;y<m;y++)h[b*m+y]=u.data[A+y];}let p=o.get(a)??{parentNode:-1,parent:Re(z()),base:ou(n.nodes?.[a]),channels:[]};p.channels.push({path:l,times:Float32Array.from(c.data),values:h,step:s.interpolation==="STEP"}),o.set(a,p),r=Math.max(r,c.data[d-1]);}return o.size?{duration:r||1,nodes:o}:null}function ou(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 cn(n,e,t,o){let r=n.nodes.get(e);if(!r)return Re(o);let i=z();ru(r,t,i);let a=z();if(we(a,r.parent,i),r.parentNode<0)return sl(o,a);let l=z();return cn(n,r.parentNode,t,l),we(o,l,a)}var sl=(n,e)=>{for(let t=0;t<16;t++)n[t]=e[t];return n};function ru(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 u=Math.min(c+1,l-1),m=a.times[u]-a.times[c],f=a.step||m<=0?0:Math.min(Math.max((e-a.times[c])/m,0),1),d=c*s,h=u*s;if(a.path==="rotation"){let p=0;for(let y=0;y<4;y++)p+=a.values[d+y]*a.values[h+y];let b=p<0?-1:1,A=0;for(let y=0;y<4;y++)r[y]=a.values[d+y]*(1-f)+a.values[h+y]*b*f,A+=r[y]*r[y];A=Math.sqrt(A)||1;for(let y=0;y<4;y++)r[y]/=A;}else {let p=a.path==="translation"?o:i;for(let b=0;b<3;b++)p[b]=a.values[d+b]*(1-f)+a.values[h+b]*f;}}return sl(t,al({translation:o,rotation:r,scale:i}))}var Ee=5126,nu=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),cl={stride:jo,attribs:[{name:"a_pos",size:3,type:Ee,offset:0},{name:"a_normal",size:3,type:Ee,offset:12},{name:"a_tex",size:2,type:Ee,offset:24}]},un=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);}},fn=256,Yo=41,fl={stride:Yo*4,attribs:[{name:"a_i_m0",size:4,type:Ee,offset:0,divisor:1},{name:"a_i_m1",size:4,type:Ee,offset:16,divisor:1},{name:"a_i_m2",size:4,type:Ee,offset:32,divisor:1},{name:"a_i_m3",size:4,type:Ee,offset:48,divisor:1},{name:"a_i_s0",size:4,type:Ee,offset:64,divisor:1},{name:"a_i_s1",size:4,type:Ee,offset:80,divisor:1},{name:"a_i_s2",size:4,type:Ee,offset:96,divisor:1},{name:"a_i_s3",size:4,type:Ee,offset:112,divisor:1},{name:"a_i_n0",size:3,type:Ee,offset:128,divisor:1},{name:"a_i_n1",size:3,type:Ee,offset:140,divisor:1},{name:"a_i_n2",size:3,type:Ee,offset:152,divisor:1}]},qt=2,Ct=16,je=class{constructor(){this.models=[];this.gpu=new P;this.counted=new Set;this.instBuffer=null;this.instScratch=new Float32Array(fn*Yo);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",qt);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 m=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 h=c.cameraInModelSpace(t);o.setVec3("u_camera_model",h[0],h[1],h[2]),o.setFloat("u_reflect",1),u.vao.bind();for(let p of [false,true])if(!(m&&!p))for(let b of c.mesh.primitives){if(!m&&b.blend!==p)continue;o.setMat4("u_matrix",b.node>=0?c.matrixForNode(t,b.node,l):f),d&&o.setMat4("u_shadow_matrix",b.node>=0?this.shadowMatrixForNodeAt(t,c,b.node,l):d);let A=b.texture>=0?u.textures[b.texture]:null;o.setFloat("u_has_texture",A?1:0),o.setFloat("u_alpha_cutoff",b.alphaCutoff),A&&e.bindTexture(qt,A),o.setVec4v("u_base_color",b.baseColor),o.setVec3("u_emissive",b.emissive[0],b.emissive[1],b.emissive[2]),o.setFloat("u_metallic",b.metallic),o.setFloat("u_roughness",b.roughness),e.setCull(b.doubleSided?"none":"back"),e.setBlend(p?"premultiplied":"none"),e.setDepthMask(!p),e.gl.drawElements(e.gl.TRIANGLES,b.indexCount,e.gl.UNSIGNED_INT,b.indexOffset*4);}}e.bindVAO(null),e.setCull("back"),e.setBlend("premultiplied"),e.setDepthMask(true);}}renderInstanced(e,t,o,r,i,a){let l=new P;for(let c of this.models){if(!c.visible||c.fade<1||!c.mesh||!c.isLoaded||!this.inView(t,c)||c.mesh.primitives.some(m=>m.blend||m.node>=0))continue;let u=l.get(c.url);u?u.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 u=this.gpuFor(e,c[0],r);if(!u||!c[0].mesh)continue;this.instBuffer||(this.instBuffer=new ye(e,this.instScratch,fl,true)),u.instVao||(u.instVao=new le(e,[{buffer:u.vbo,locations:r},{buffer:this.instBuffer,locations:r}],u.ibo)),s||(o.use(),i(o),o.setInt("u_base_texture",qt),o.setFloat("u_opacity",1),s=true);let m=c[0].mesh;for(let f=0;f<c.length;f+=fn){let d=Math.min(fn,c.length-f);for(let h=0;h<d;h++){let p=c[f+h],b=h*Yo;this.instScratch.set(p.matrixFor(t),b);let A=a?this.shadowMatrix(t,p):nu;this.instScratch.set(A,b+16),this.instScratch.set(p.normalMatrix(),b+32),this.drawnInstanced.add(p);}this.instBuffer.update(this.instScratch.subarray(0,d*Yo)),e.bindVAO(u.instVao.vao);for(let h of m.primitives){let p=h.texture>=0?u.textures[h.texture]:null;o.setFloat("u_has_texture",p?1:0),o.setFloat("u_alpha_cutoff",h.alphaCutoff),p&&e.bindTexture(qt,p),o.setVec4v("u_base_color",h.baseColor),o.setVec3("u_emissive",h.emissive[0],h.emissive[1],h.emissive[2]),o.setFloat("u_metallic",h.metallic),o.setFloat("u_roughness",h.roughness),e.setCull(h.doubleSided?"none":"back"),e.setBlend("none"),e.setDepthMask(true),e.gl.drawElementsInstanced(e.gl.TRIANGLES,h.indexCount,e.gl.UNSIGNED_INT,h.indexOffset*4,d);}}}s&&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<=Ct?r:[...r].sort((u,m)=>m.intensity-u.intensity).slice(0,Ct),a=new Float32Array(Ct*4),l=new Float32Array(Ct*4),s=new Float32Array(Ct*4),c=new Float32Array(Ct*4);i.forEach((u,m)=>{let f=m*4;a[f]=u.position[0],a[f+1]=u.position[1],a[f+2]=u.position[2],a[f+3]=u.range,l[f]=u.color[0]*u.intensity,l[f+1]=u.color[1]*u.intensity,l[f+2]=u.color[2]*u.intensity,l[f+3]=u.type==="spot"?1:0,s[f]=u.direction[0],s[f+1]=u.direction[1],s[f+2]=u.direction[2],c[f]=u.cosInner,c[f+1]=u.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 ye(e,new Uint8Array(t.mesh.vertices),cl),l=new fe(e,t.mesh.indices),s=new le(e,[{buffer:a,locations:o}],l),c=t.bitmaps.map(m=>{if(!m)return null;let f=i.createTexture();return f?(e.bindTexture(qt,f),i.texImage2D(i.TEXTURE_2D,0,i.RGBA,i.RGBA,i.UNSIGNED_BYTE,m),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 un(s,a,l,c);return u.users=1,this.counted.add(t),this.gpu.set(t.url,u),u}static get layout(){return cl}static get instanceLayout(){return fl}destroy(e){for(let t of this.gpu.values())t.destroy(e);this.gpu.clear(),this.models=[];}};var dn=4,ul=new q;function iu(n){ul.has(n)||(ul.add(n),console.warn(`[osmgl] ${n}`));}var au=.5,lu=.01,su=300,hn=127,mn=128,$t=5120,qo=5121,eo=5122,dl=5123,to=5126,cu={stride:8,attribs:[{name:"a_pos",size:2,type:to,offset:0}]},pn={stride:Ue,attribs:[{name:"a_pos",size:2,type:eo,offset:0}]},hl={stride:Je,attribs:[{name:"a_p0",size:2,type:eo,offset:0},{name:"a_p1",size:2,type:eo,offset:4},{name:"a_corner",size:2,type:$t,offset:8},{name:"a_ground",size:2,type:$t,offset:10},{name:"a_dist",size:1,type:to,offset:12},{name:"a_width",size:1,type:to,offset:16}]},Zo={stride:Fe,attribs:[{name:"a_pos",size:2,type:eo,offset:0},{name:"a_height",size:1,type:dl,offset:4},{name:"a_tint",size:1,type:qo,normalized:true,offset:6},{name:"a_ao",size:1,type:qo,normalized:true,offset:7},{name:"a_normal",size:3,type:$t,normalized:true,offset:8},{name:"a_kind",size:1,type:qo,offset:11},{name:"a_wall",size:3,type:dl,offset:12}]},fu={flat:0,water:1,foliage:2,sand:3,asphalt:4},uu=[1,9,14,26,3],ml={stride:ht,attribs:[{name:"a_pos",size:2,type:to,offset:0},{name:"a_level",size:1,type:eo,offset:8},{name:"a_normal",size:3,type:$t,normalized:true,offset:10},{name:"a_kind",size:1,type:qo,offset:13},{name:"a_bleed",size:2,type:$t,offset:14}]},bn=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();}},bl={enabled:false,resolution:1024,strength:.75,color:"#5a6b86",bias:.25},oo=class{constructor(){this.fill=null;this.surface=null;this.surfaceLocs=new P;this.line=null;this.building=null;this.depth=null;this.groundShadow=null;this.sky=null;this.raster=null;this.rasterLayer=new Ko;this.globeBody=null;this.globeClip=null;this.globeMesh=null;this.quad=null;this.fillLocs=new P;this.lineLocs=new P;this.objectLine=null;this.objectLineLocs=new P;this.buildingLocs=new P;this.shadows={...bl};this.shadowTarget=null;this.shadowPlaceholder=null;this.fog=null;this.shadowActive=false;this.materialTime=0;this.materialAnimating=false;this.stencilIds=new P;this.patternScale=1;this.detailScale=1;this.reliefScale=1;this.allowShadows=true;this.highlight=null;this.highlightGpu=new P;this.highlightKey="";this.groundArrows=new Xt;this.highlightTris=new P;this.fillHighlightGpu=new P;this.fillHighlightKey="";this.footprintKey="";this.highlightFill=null;this.indoorMask=new jt;this.hiddenBuildings=new Set;this.hiddenVenues=new Set;this.hiddenVenueLayer=null;this.hiddenCut=new P;this.hiddenStamp="";this.shadowDepthPerMeter=1;this.shadowTexelMeters=0;this.growDurationMs=350;this.symbols=null;this.objects=null;this.models=new je;this.model=null;this.modelInstanced=null;this.modelDepth=null;this.modelLocs=new P;this.modelInstLocs=new P;}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 u=new Uint32Array(c.indices),m=new Float64Array(c.featureIds),f=[];for(let h=0;h*3<u.length;h++)a.has(m[h])||f.push(u[h*3],u[h*3+1],u[h*3+2]);let d=null;if(f.length<u.length){let h=new fe(e,new Uint32Array(f));d={vao:new le(e,[{buffer:i,locations:this.buildingLocs}],h),ibo:h,count:f.length,vbo:i};}return this.hiddenCut.set(l,d),d}init(e){this.symbols?.init(e),this.fill=new ue(e,"fill",Pa,ka),this.surface=new ue(e,"surface",Na,Ka),this.line=new ue(e,"line",Ga,Ra),this.objectLine=new ue(e,"objectLine",Oa,Wa),this.building=new ue(e,"buildings",Va,za),this.depth=new ue(e,"depth",_a,Xr),this.groundShadow=new ue(e,"groundShadow",Ha,Ta),this.sky=new ue(e,"sky",Ma,Ia),this.raster=new ue(e,"raster",Sa,La),this.globeBody=new ue(e,"globeBody",Ca,va),this.globeClip=new ue(e,"globeClip",wa,xa),this.globeMesh=du(e,this.globeBody),this.model=new ue(e,"model",Da,jr),this.modelInstanced=new ue(e,"model-instanced",Fa,jr),this.modelDepth=new ue(e,"modelDepth",Ea,Xr);for(let i of je.layout.attribs)this.modelLocs.set(i.name,this.model.attribLocation(i.name));for(let i of [...je.layout.attribs,...je.instanceLayout.attribs])this.modelInstLocs.set(i.name,this.modelInstanced.attribLocation(i.name));this.shadowPlaceholder=ga(e);let t=new P([["a_pos",this.groundShadow.attribLocation("a_pos")]]),o=new ye(e,new Float32Array([0,0,1,0,1,1,0,1]),cu),r=new fe(e,new Uint16Array([0,1,2,0,2,3]));this.quad={vao:new le(e,[{buffer:o,locations:t}],r),vbo:o,ibo:r};for(let i of pn.attribs)this.fillLocs.set(i.name,this.fill.attribLocation(i.name));for(let i of ml.attribs)this.surfaceLocs.set(i.name,this.surface.attribLocation(i.name));for(let i of hl.attribs)this.lineLocs.set(i.name,this.line.attribLocation(i.name));for(let i of ln.attribs)this.objectLineLocs.set(i.name,this.objectLine.attribLocation(i.name));for(let i of Zo.attribs)this.buildingLocs.set(i.name,this.building.attribLocation(i.name));}render(e,t,o,r,i,a=new P){if(!this.fill||!this.line||!this.building)return false;let l=t.zoom,s=false;this.materialTime=i/1e3,this.materialAnimating=false,this.fog=gt(t,r),this.patternScale=vo/Math.max(He(t.center.lat),1);let c=f=>o.get(f.source??X);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 u=f=>f.type==="line"&&O(f.paint.elevation,l,0)!==0;for(let f of r.layers){if(f.type==="raster"||f.type==="fill-extrusion"||f.type==="symbol"||f.overlay||u(f)||!r.layerVisibleAt(f,l))continue;let d=c(f);if(d){if(f.type==="surface"){if(!this.flattened(d,r,f))continue;this.drawFill(e,t,d,r,f,l);continue}f.type==="fill"?this.drawFill(e,t,d,r,f,l):this.drawLine(e,t,d,r,f,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,f=>{this.applyFogUniforms(f,t,r),f.setVec4("u_globe",0,0,0,0),f.setInt("u_material",0),f.setFloat("u_elevation",0),f.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 f of r.layers){if(f.type!=="surface"||f.overlay||!r.layerVisibleAt(f,l))continue;let d=c(f);d&&(this.flattened(d,r,f)||this.drawSurface(e,t,d,r,f,l));}e.setStencilTest(false),e.setDepthMask(false),e.setBlend("premultiplied"),e.setCull("none"),e.setDepthTest(false);for(let f of r.layers){if(f.type==="raster"||!u(f)||f.overlay||!r.layerVisibleAt(f,l))continue;let d=c(f);d&&this.drawLine(e,t,d,r,f,l);}e.setDepthTest(true),e.setDepthMask(true),e.setCull("back");for(let f of r.layers){if(f.type!=="fill-extrusion"||!r.layerVisibleAt(f,l))continue;let d=c(f);d&&(this.drawBuildings(e,t,d,r,f,l,i)&&(s=true),this.drawHighlight(e,t,d,r,f,l));}this.model&&!this.models.isEmpty&&(this.models.render(e,t,this.model,this.modelLocs,f=>{this.applyShadowUniforms(f),this.applyFogUniforms(f,t,r),this.applyLight(f,r);},this.shadowActive,i/1e3,this.modelInstanced?{shader:this.modelInstanced,locations:this.modelInstLocs}:void 0),(this.models.hasAnimated||this.models.hasTransitions)&&(s=true)),e.setDepthTest(false),e.setDepthMask(false),e.setCull("none");for(let f of r.layers){if(f.type==="raster"||!f.overlay||f.type==="symbol"||f.type==="fill-extrusion"||!r.layerVisibleAt(f,l))continue;let d=c(f);if(d){if(f.type==="surface"){this.flattened(d,r,f)?this.drawFill(e,t,d,r,f,l):this.drawSurface(e,t,d,r,f,l),e.setDepthTest(false),e.setDepthMask(false),e.setCull("none");continue}f.type==="fill"?this.drawFill(e,t,d,r,f,l):this.drawLine(e,t,d,r,f,l);}}this.objects&&!this.objects.isEmpty&&(e.setDepthTest(true),e.setDepthFunc("lequal"),e.setDepthMask(false),e.setBlend("premultiplied"),e.setCull("none"),this.objects.render(e,t,this.fill,this.fillLocs,this.objectLine,this.objectLineLocs,f=>{this.applyFogUniforms(f,t,r),f.setVec4("u_globe",0,0,0,0),f.setInt("u_material",0),f.setFloat("u_elevation",0),f.setVec2("u_world_origin",0,0);},this.shadowActive),e.setDepthTest(false)),this.raster&&this.quad&&this.rasterLayer.render(e,t,this.quad.vao,this.raster,r,a,l,true);let m=r.layers.filter(f=>f.type==="line"&&O(f.paint.ghostOpacity,l,0)>.001&&r.layerVisibleAt(f,l));if(m.length){e.setDepthTest(true),e.setDepthFunc("greater"),e.setDepthMask(false),e.setBlend("premultiplied"),e.setCull("none");for(let f of m){let d=c(f);d&&this.drawLine(e,t,d,r,f,l,O(f.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,f=>{this.applyFogUniforms(f,t,r),f.setVec4("u_globe",0,0,0,0),f.setInt("u_material",0),f.setFloat("u_elevation",0),f.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(dn,this.shadowPlaceholder),this.shadowActive=false,!this.shadows.enabled||!this.allowShadows||!this.depth)return;let a=r.layers.filter(m=>m.type==="fill-extrusion"&&!m.overlay&&r.layerVisibleAt(m,t.zoom));if(!a.length&&this.models.isEmpty)return;this.shadowTarget?this.shadowTarget.resize(this.shadows.resolution):this.shadowTarget=new Ut(e,this.shadows.resolution);let l=r.light;if(t.updateShadow(Qo(l.keyAzimuth,l.keyAltitude),su),!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 u=this.depth;u.use();for(let m of a){let f=o.get(m.source??X);if(!f)continue;let d=r.bucketKeyFor(m);if(d===null)continue;let h=O(m.paint.heightScale,t.zoom,1);(m.source??X)===X&&this.indoorMask.prepare(f,d);for(let p of f.visibleTiles){if(!this.drawsTile(t,r,m,p))continue;let b=f.getTile(p),A=b&&this.bucketFor(e,b,d,Zo,this.buildingLocs,"fill-extrusion");if(!A)continue;u.setFloat("u_height_scale",this.growScale(A,i,!f.warm)*h),u.setMat4("u_matrix",t.shadowTileMatrix(p,A.extent));let y=(m.source??X)===X,g=this.cutHidden(e,b,d,p.dataKey,A.buffer,this.hiddenFor(d,y)),B=y?g??this.indoorMask.indicesFor(e,b,d,p,A.buffer,this.buildingLocs):g;B?(B.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,B.count,e.gl.UNSIGNED_INT,0)):(A.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,A.indexCount,A.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(dn),this.shadowDepthPerMeter=t.shadowDepthPerMeter(),this.shadowTexelMeters=Math.abs(t.shadowTexelWorldSize(s.size))/(t.pixelsPerMeter||1),this.shadowActive=true;}drawGlobeBody(e,t,o){if(!t.globeActive||!this.globeBody||!this.globeMesh)return;let r=this.globeBody;r.use(),this.applyGlobeUniforms(r,t),r.setMat4("u_matrix",t.localMatrix());let 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(ae(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(),Ve(r,"u_sky_color",o.sky.skyColor),Ve(r,"u_horizon_color",o.sky.horizonColor);let i=t.width>0?e.gl.drawingBufferWidth/t.width:1,a=t.horizonScreenY(),l=(t.height-a)*i,s=Math.max(a,1)*i,c=Math.min(s*.5,t.height*i*.1);r.setVec3("u_sky_params",l,o.sky.horizonBlend*s,c);let u=t.globeActive?1-t.globeFlatMix:0;if(r.setVec2("u_space",u,o.sky.starIntensity),u>.001){Ve(r,"u_space_color",o.sky.spaceColor),Ve(r,"u_atmo_color",o.sky.atmosphereColor);let m=t.globeDisc();r.setVec4("u_globe_disc",m.dir[0],m.dir[1],m.dir[2],m.angle);let[f,d,h,p]=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",h[0],h[1],h[2]),r.setVec3("u_ray_br",p[0],p[1],p[2]);}e.setDepthTest(false),e.setDepthMask(false),e.setBlend("premultiplied"),e.setCull("none"),this.quad.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,6,e.gl.UNSIGNED_SHORT,0),e.bindVAO(null);}applyGlobeUniforms(e,t){if(!t.globeActive){e.setVec4("u_globe",0,0,0,0);return}let o=t.globeBasis,r=t.worldSize;e.setVec4("u_globe",1,t.globeFlatMix,t.globeRadiusPx,r),e.setVec2("u_globe_center",t.centerPointPx.x/r,t.centerPointPx.y/r);let 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??gt(t,o);if(r.intensity<=0){e.setVec3("u_fog_range",0,1,0);return}Ve(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,O(i.paint.elevation,t.zoom,0)*this.reliefScale));let r=Math.max(au/Math.max(t.pixelsPerMeter,1e-9),lu);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,hn);}drawTileStencil(e,t,o){this.stencilIds.clear();let r=o.get(X);if(!r||!this.fill||!this.quad)return;let i=r.visibleTiles;if(!i.length||i.length>hn)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,hn),l.setMat4("u_matrix",t.tileMatrix(c,1)),a.drawElements(a.TRIANGLES,6,a.UNSIGNED_SHORT,0);e.bindVAO(null),e.setColorMask(true),a.stencilOp(a.KEEP,a.KEEP,a.KEEP),e.setStencilTest(false);}drawEarthDepth(e,t,o,r){if(!this.fill||!this.quad)return;let i=o.get(X);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 u=t.tileMatrix(c,1);s.set(u);for(let m=0;m<4;m++)s[12+m]+=l*u[8+m];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(X);if(!i)return;let a=this.groundShadow;a.use(),this.applyShadowUniforms(a),this.applyFogUniforms(a,t,r);let l=r.light,[,,s]=Qo(l.keyAzimuth,l.keyAltitude),c=Math.max(-s,0),u=ce(l.ambientColor),m=ce(l.keyColor),f=[0,0,0];for(let d=0;d<3;d++){let h=u[d]*l.ambientIntensity,p=m[d]*l.keyIntensity*c;f[d]=h>0?h/(h+p):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",dn),!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=ce(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=dr(t.z)/this.patternScale;e.setFloat("u_meters_per_unit",r/o);let[i,a]=Zn(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:fu[r??"flat"]??0;if(e.setInt("u_material",i),i===0)return;let a=t.paint,l=O(a.materialStrength,o,1)*this.detailScale,s=O(a.materialScale,o,uu[i]),c=O(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=O(i.paint?.opacity,a,1);if(c<=.001)return;l.use(),this.applyFogUniforms(l,t,r),this.applyGlobeUniforms(l,t),this.applyLight(l,r),this.applyMaterial(l,i,a),l.setVec4v("u_color",xe([s[0],s[1],s[2],s[3]*c]));let u=r.bucketKeyFor(i);if(u!==null){for(let m of o.visibleTiles){if(!this.drawsTile(t,r,i,m))continue;let f=o.getTile(m),d=f&&this.bucketFor(e,f,u,pn,this.fillLocs,"fill");d&&(this.clipToTile(e,m),this.shadowActive&&l.setMat4("u_shadow_matrix",t.shadowTileMatrix(m,d.extent)),this.applyTileScale(l,m,d.extent),this.applyTileMatrix(l,t,m,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){let s=this.line,c=r.colorAt(i,a),u=O(i.paint.opacity,a,1)*(l||1),m=O(i.paint.width,a,1);if(u<=.001||m<=.01)return;let f=e.gl.drawingBufferWidth,d=e.gl.drawingBufferHeight,h=t.width>0?f/t.width:1,p=m/2*h;s.use(),this.applyFogUniforms(s,t,r),this.applyGlobeUniforms(s,t),this.applyLight(s,r),this.applyMaterial(s,i,a),s.setVec4v("u_color",xe([c[0],c[1],c[2],c[3]*u])),s.setFloat("u_center_w",t.cameraToCenterDistance);let b=O(i.paint.offset,a,0)*h;s.setFloat("u_elevation",O(i.paint.elevation,a,0)*this.reliefScale),s.setFloat("u_relief",this.reliefScale),s.setVec2("u_viewport",f,d);let A=i.paint.dashArray,y=i.paint.arrow===true,g=i.paint.arrowStyle,B=y&&(g==="head"||g==="headOnly"),C=y&&g==="dash";if(s.setInt("u_pattern",C?5:A?1:g==="headOnly"&&y?4:B?3:y?2:0),A){let[_,w]=A;s.setVec2("u_dash",_*h,(_+w)*h);}if(y){let _=Le(i.paint.arrowColor,a,[1,1,1,1]);s.setVec4v("u_arrow_color",xe(_));let w=O(i.paint.arrowPeriod,a,46)*h,x=O(i.paint.arrowSize,a,5)*h;if(C){let D=O(i.paint.arrowGap,a,24)*h,I=Math.max(w-D,1),E=Math.min(x,I),L=O(i.paint.arrowShaft,a,2)*h,M=O(i.paint.arrowHead,a,4)*h,S=O(i.paint.arrowOutline,a,0)*h;s.setVec4("u_arrow",L,E,M,I),s.setVec2("u_dash",S,w);}else B?s.setVec4("u_arrow",w,x,p,0):s.setVec4("u_arrow",w,Math.max(x*.4,1),Math.min(x,p*.72),0);}let v=r.bucketKeyFor(i);if(v!==null)for(let _ of o.visibleTiles){if(!this.drawsTile(t,r,i,_))continue;let w=o.getTile(_),x=w&&this.bucketFor(e,w,v,hl,this.lineLocs,"line");if(!x)continue;let D=_.bounds(),I=(D.maxX-D.minX)*t.worldSize/x.extent*h;s.setFloat("u_tile_to_px",I);let E=I>1e-6?1/I:1;s.setFloat("u_half_width",p*E),s.setFloat("u_meters_to_units",t.pixelsPerMeter*E),s.setFloat("u_width_from_data",i.paint.widthFromData===true?1:0),s.setFloat("u_width_extra",O(i.paint.widthExtra,a,0)*E),s.setFloat("u_offset",b*E),s.setFloat("u_tile_per_px",E),this.applyTileScale(s,_,x.extent),this.shadowActive&&s.setMat4("u_shadow_matrix",t.shadowTileMatrix(_,x.extent)),this.applyTileMatrix(s,t,_,x.extent),x.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,x.indexCount,x.indexType,0);}}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=ce(l.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",l.opacity),u.setFloat("u_ao_strength",O(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",O(i.paint.heightScale,a,1)),e.setDepthFunc("lequal"),e.setDepthMask(false),e.setBlend("alpha");for(let m of o.visibleTiles){let f=o.getTile(m);if(!f)continue;let d=f.data?.buckets?.[i.id];if(!d)continue;let h=m.dataKey,p=this.highlightGpu.get(h);if(p===void 0){let b=Uo(f,i.id,l.featureId);if(b){let A=new ye(e,new Uint8Array(b.vertices),Zo),y=new fe(e,b.indices);p={vao:new le(e,[{buffer:A,locations:this.buildingLocs}],y),vbo:A,ibo:y,count:b.indices.length};}else p=null;this.highlightGpu.set(h,p);}p&&(this.applyTileScale(u,m,d.extent),this.shadowActive&&u.setMat4("u_shadow_matrix",t.shadowTileMatrix(m,d.extent)),u.setMat4("u_matrix",t.tileMatrix(m,d.extent)),p.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,p.count,e.gl.UNSIGNED_INT,0));}e.setBlend("none"),e.setDepthMask(true);}refreshHighlight(){this.disposeHighlight();}disposeHighlight(){for(let e of this.highlightGpu.values())e&&(e.vao.destroy(),e.vbo.destroy(),e.ibo.destroy());this.highlightGpu.clear(),this.highlightTris.clear(),this.highlightKey="";}syncHighlightFootprint(e,t){let o=this.highlight;if(!o){this.highlightTris.size&&this.highlightTris.clear();return}let r=`${o.layerId}/${o.featureId}`;this.footprintKey!==r&&(this.highlightTris.clear(),this.footprintKey=r);let i=t.layers.find(s=>s.id===o.layerId),a=e.get(i?.source??X);if(!a)return;let l=new q;for(let s of a.visibleTiles){if(l.add(s.dataKey),this.highlightTris.has(s.dataKey))continue;let c=a.getTile(s),u=c?.data?.buckets?.[o.layerId];if(!c||!u)continue;let m=Uo(c,o.layerId,o.featureId);m&&this.highlightTris.set(s.dataKey,Qr(m,u.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??X):void 0;if(!l||!s)return;let c=i.bucketKey,u=ce(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",xe([u[0],u[1],u[2],i.opacity])),e.setDepthTest(false),e.setDepthMask(false),e.setBlend("premultiplied"),e.setCull("none");let m=e.gl;e.setStencilTest(true),m.stencilFunc(m.NOTEQUAL,mn,mn),m.stencilOp(m.KEEP,m.KEEP,m.REPLACE),m.stencilMask(mn);for(let f of s.visibleTiles){let d=s.getTile(f),h=d?.data?.buckets?.[c];if(!d||!h||h.kind!=="fill"||!h.featureIds)continue;let p=this.fillHighlightFor(e,h,f,i.featureId,c);p&&(a.setMat4("u_matrix",t.tileMatrix(f,h.extent)),p.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,p.count,e.gl.UNSIGNED_INT,0));}e.setStencilTest(false),m.stencilOp(m.KEEP,m.KEEP,m.KEEP),m.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),u=[];for(let f=0;f*3<s.length;f++)c[f]===r&&u.push(s[f*3],s[f*3+1],s[f*3+2]);let m=null;if(u.length){let f=new ye(e,new Uint8Array(t.vertices),pn),d=new fe(e,new Uint32Array(u));m={vao:new le(e,[{buffer:f,locations:this.fillLocs}],d),vbo:f,ibo:d,count:u.length};}return this.fillHighlightGpu.set(a,m),m}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=O(i.paint.opacity,a,1);if(c<=.001)return;l.use(),this.applyShadowUniforms(l),this.applyFogUniforms(l,t,r),this.applyLight(l,r),this.applyMaterial(l,i,a),l.setVec4v("u_color",s),l.setFloat("u_opacity",c),l.setFloat("u_side_shade",O(i.paint.sideShade,a,.12));let u=i.elevation<(i.base??0),m=i.paint.sideColor?Le(i.paint.sideColor,a,s):s;l.setVec3("u_side_color",m[0],m[1],m[2]),l.setFloat("u_side_light",O(i.paint.sideLight,a,u?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 h=[];for(let A of o.visibleTiles){if(!this.drawsTile(t,r,i,A))continue;let y=o.getTile(A),g=y&&this.bucketFor(e,y,f,ml,this.surfaceLocs,"surface");g&&h.push({id:A,bucket:g});}let p=(A,y)=>{this.clipToTile(e,A),this.applyTileScale(l,A,y.extent),this.shadowActive&&l.setMat4("u_shadow_matrix",t.shadowTileMatrix(A,y.extent)),l.setMat4("u_matrix",t.tileMatrix(A,y.extent)),y.vao.bind();},b=h.filter(({bucket:A})=>A.capIndexOffset<A.indexCount);if(b.length){e.setColorMask(false),e.setDepthMask(true);for(let{id:A,bucket:y}of b){p(A,y);let g=y.indexType===e.gl.UNSIGNED_INT?4:2;e.gl.drawElements(e.gl.TRIANGLES,y.indexCount-y.capIndexOffset,y.indexType,y.capIndexOffset*g);}e.setColorMask(true),e.setDepthMask(d);}for(let{id:A,bucket:y}of h)p(A,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]),u=i.paint.roofColor?r.colorAt({...i,paint:{...i.paint,color:i.paint.roofColor}},a,c):c,m=O(i.paint.opacity,a,1);if(m<=.001)return false;s.use(),this.applyShadowUniforms(s),this.applyFogUniforms(s,t,r),s.setVec4v("u_wall_color",c),s.setVec4v("u_roof_color",u),s.setFloat("u_opacity",m),s.setFloat("u_ao_strength",O(i.paint.aoStrength,a,.4)),s.setFloat("u_tint_variation",O(i.paint.tintVariation,a,.07));let f=(B,C)=>i.paint[B]?r.colorAt({...i,paint:{...i.paint,color:i.paint[B]}},a,C):C,d=f("windowColor",[.62,.71,.8,1]),h=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",h[0],h[1],h[2]),s.setFloat("u_facade_detail",O(i.paint.facadeDetail,a,1)*this.detailScale),s.setFloat("u_window_glow",O(i.paint.windowGlow,a,0)),s.setFloat("u_floor_height",O(i.paint.floorHeight,a,3.2)),s.setFloat("u_roof_variation",O(i.paint.roofVariation,a,.3)),this.applyLight(s,r);let p=m>=1;e.setDepthMask(p),e.setBlend(p?"none":"premultiplied");let b=O(i.paint.heightScale,a,1),A=false,y=r.bucketKeyFor(i);if(y===null)return A;let g=(i.source??X)===X;g&&this.indoorMask.prepare(o,y);for(let B of o.visibleTiles){if(!this.drawsTile(t,r,i,B))continue;let C=o.getTile(B),v=C&&this.bucketFor(e,C,y,Zo,this.buildingLocs,"fill-extrusion");if(!v)continue;let _=this.growScale(v,l,!o.warm);_<1&&(A=true),s.setFloat("u_height_scale",_*b),this.applyTileScale(s,B,v.extent),this.shadowActive&&s.setMat4("u_shadow_matrix",t.shadowTileMatrix(B,v.extent)),s.setMat4("u_matrix",t.tileMatrix(B,v.extent));let x=this.cutHidden(e,C,y,B.dataKey,v.buffer,this.hiddenFor(y,g))??(C&&g?this.indoorMask.indicesFor(e,C,y,B,v.buffer,this.buildingLocs):null);x?(x.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,x.count,e.gl.UNSIGNED_INT,0)):(v.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,v.indexCount,v.indexType,0));}return A}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?hu(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]=Qo(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]=Qo(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 iu(`\u0441\u043B\u043E\u0439 ${o}: \u0432 \u0442\u0430\u0439\u043B\u0435 \u043C\u0435\u0448 \xAB${s.kind}\xBB, \u0430 \u0440\u0438\u0441\u0443\u044E\u0442 \u043A\u0430\u043A \xAB${a}\xBB \u2014 \u043F\u0440\u043E\u043F\u0443\u0449\u0435\u043D`),null;let c=new ye(e,new Uint8Array(s.vertices),r),u=new fe(e,new Uint32Array(s.indices)),m=new le(e,[{buffer:c,locations:i}],u),f=new bn(m,c,u,u.count,u.type,s.extent,s.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;}},pl=new P;function du(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 h=0;h<=64;h++)r[i++]=h/64*2*Math.PI-Math.PI,r[i++]=d;}let a=new Uint16Array(2048*6),l=0;for(let f=0;f<32;f++)for(let d=0;d<64;d++){let h=f*65+d,p=h+64+1;a[l++]=h,a[l++]=h+1,a[l++]=p,a[l++]=h+1,a[l++]=p+1,a[l++]=p;}let s={stride:8,attribs:[{name:"a_lnglat",size:2,type:to,offset:0}]},c=new P([["a_lnglat",e.attribLocation("a_lnglat")]]),u=new ye(n,r,s),m=new fe(n,a);return {vao:new le(n,[{buffer:u,locations:c}],m),vbo:u,ibo:m,count:a.length}}function Ve(n,e,t){let o=pl.get(t);o||(o=ce(t),pl.set(t,o)),n.setVec3(e,o[0],o[1],o[2]);}function Qo(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 hu(n){let o=n-1;return 1+2.20158*o*o*o+1.20158*o*o}var $o=1,ro=class{constructor(e=1024){this.entries=new P;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+$o>this.size&&(this.shelfY+=this.shelfHeight+$o,this.shelfX=0,this.shelfHeight=0),this.shelfY+r+$o>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+$o,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 An=.75,io=8,pe=3,ze=24,vt=256,Al=255,no=class{constructor(e,t="Noto Sans Regular"){this.urlTemplate=e;this.fontstack=t;this.glyphs=new P;this.loaded=new q;this.inflight=new P;}get(e){return this.glyphs.get(e)}hasRange(e){return this.loaded.has(Math.floor(e/vt))}needsLoad(e){for(let t of e){let o=t.codePointAt(0);if(o===void 0)continue;let r=Math.floor(o/vt);if(r<=Al&&!this.loaded.has(r))return true}return false}async ensure(e){let t=new q;for(let o of e){let r=o.codePointAt(0);if(r===void 0)continue;let i=Math.floor(r/vt);i>Al||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*vt}-${e*vt+vt-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 yl(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 yl(n){let e=new ot(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 u=c.readVarint()+c.pos,m={id:0,bitmap:null,width:0,height:0,left:0,top:0,advance:0};c.readFields((f,d,h)=>{h&&(f===1?m.id=h.readVarint():f===2?m.bitmap=h.readBytes():f===3?m.width=h.readVarint():f===4?m.height=h.readVarint():f===5?m.left=h.readSVarint():f===6?m.top=h.readSVarint():f===7&&(m.advance=h.readVarint()));},null,u),t.push(m);},null,a);},null),t}var mu=.25,wt=1e20;function yn(n,e,t){let o=e+pe*2,r=t+pe*2,i=o*r,a=new Float64Array(i),l=new Float64Array(i);a.fill(wt),l.fill(0);for(let c=0;c<t;c++)for(let u=0;u<e;u++){let m=n[c*e+u]/255,f=(c+pe)*o+(u+pe);if(m>=1)a[f]=0,l[f]=wt;else if(m>0){let d=.5-m;a[f]=d>0?d*d:0,l[f]=d<0?d*d:0;}else a[f]=wt,l[f]=0;}gl(a,o,r),gl(l,o,r);let s=new Uint8Array(i);for(let c=0;c<i;c++){let u=Math.sqrt(a[c])-Math.sqrt(l[c]);s[c]=pu(Math.round(255-255*(u/io+mu)));}return {data:s,width:o,height:r}}function gl(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];Bl(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];Bl(r,i,a,l,e);for(let c=0;c<e;c++)n[s*e+c]=i[c];}}function Bl(n,e,t,o,r){t[0]=0,o[0]=-wt,o[1]=wt;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]=wt;}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 pu=n=>n<0?0:n>255?255:n;var Cl=48,ao=class{constructor(e={}){this.defs=e;this.sdfs=new P;this.pending=new q;this.failed=new q;}setIcons(e){this.defs=e,this.sdfs.clear(),this.failed.clear();}has(e){return this.sdfs.has(e)}get(e){return this.sdfs.get(e)}isDefined(e){return this.defs[e]!==void 0}async ensure(e){if(this.sdfs.has(e)||this.pending.has(e)||this.failed.has(e))return false;let t=this.defs[e];if(t===void 0)return this.failed.add(e),false;this.pending.add(e);try{let o=typeof t=="string"?t:t.svg,r=/viewBox="0 0 ([\d.]+) ([\d.]+)"/.exec(o),i=r?Number(r[1])/Number(r[2]):1,a=Math.max(8,Math.round(Cl*(i>1?i:1))),l=Math.max(8,Math.round(Cl/(i<1?i:1))),s=await bu(o,a,l);return this.sdfs.set(e,yn(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 bu(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((m,f)=>{a.onload=()=>m(),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,u=new Uint8ClampedArray(e*t);for(let m=0;m<u.length;m++)u[m]=c[m*4+3];return u}finally{URL.revokeObjectURL(i);}}var it={dot:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><circle cx="12" cy="12" r="5"/></svg>',entrance:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2.5 19.5 10l-2.1 2.1-3.9-3.9V21h-3V8.2l-3.9 3.9L4.5 10 12 2.5z"/></svg>',door:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M5 2h11a3 3 0 0 1 3 3v17H5V2zm9 9.2a1.2 1.2 0 1 0 0 2.4 1.2 1.2 0 0 0 0-2.4z"/></svg>',elevator:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M5 3h14v18H5V3zm7 2.2L9.2 9h5.6L12 5.2zM9.2 15h5.6L12 18.8 9.2 15z"/></svg>',"frame-circle":'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><circle cx="12" cy="12" r="11"/></svg>',cafe:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M4 6h12v6a6 6 0 0 1-12 0V6zm12 1h2.5a2.5 2.5 0 0 1 0 5H16V7zM3 20h14v2H3z"/></svg>',restaurant:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M6 2h2v8a2 2 0 0 1-4 0V2h2zM5 2v6h2V2zm7 0h2v20h-2V13a4 4 0 0 1 0-8V2zM6 12h2v10H6z"/></svg>',shop:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M4 8h16l-1.5 12h-13L4 8zm4-3a4 4 0 0 1 8 0v2h-2V5a2 2 0 0 0-4 0v2H8V5z"/></svg>',grocery:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M3 4h3l3 11h9l2-8H8m1 15a2 2 0 1 0 4 0 2 2 0 0 0-4 0zm8 0a2 2 0 1 0 4 0 2 2 0 0 0-4 0z"/></svg>',fuel:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M4 3h9v18H4V3zm2 2v5h5V5H6zm10 2 3 3v8a2 2 0 0 1-4 0V9h1V7z"/></svg>',parking:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M6 3h6a5 5 0 0 1 0 10H9v8H6V3zm3 3v4h3a2 2 0 0 0 0-4H9z"/></svg>',hospital:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M10 3h4v7h7v4h-7v7h-4v-7H3v-4h7V3z"/></svg>',pharmacy:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M11 4h2v5h5v2h-5v5h-2v-5H6V9h5V4zM5 18h14v3H5z"/></svg>',school:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 3 2 8l10 5 10-5-10-5zM5 12v5c0 2 3 4 7 4s7-2 7-4v-5l-7 3.5L5 12z"/></svg>',bank:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2 2 8h20L12 2zM4 10h3v8H4v-8zm6.5 0h3v8h-3v-8zM17 10h3v8h-3v-8zM2 20h20v2H2z"/></svg>',bus:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M4 5a3 3 0 0 1 3-3h10a3 3 0 0 1 3 3v10a2 2 0 0 1-2 2v2h-3v-2H9v2H6v-2a2 2 0 0 1-2-2V5zm2 2v5h12V7H6zm1 8a1.5 1.5 0 1 0 3 0 1.5 1.5 0 0 0-3 0zm7 0a1.5 1.5 0 1 0 3 0 1.5 1.5 0 0 0-3 0z"/></svg>',railway:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M6 3h12v11a3 3 0 0 1-3 3H9a3 3 0 0 1-3-3V3zm2 3v4h8V6H8zm-2 15 3-3h6l3 3H6z"/></svg>',park:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2a6 6 0 0 1 5.2 9 4.5 4.5 0 0 1-2.4 8.3H13V22h-2v-2.7H9.2A4.5 4.5 0 0 1 6.8 11 6 6 0 0 1 12 2z"/></svg>',hotel:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M2 6h3v7h10a4 4 0 0 1 4 4v3h-3v-3H5v3H2V6zm5 2a2.5 2.5 0 1 1 0 5 2.5 2.5 0 0 1 0-5z"/></svg>',place_of_worship:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2c3 3 5 5 5 8v12h-4v-5a1 1 0 0 0-2 0v5H7V10c0-3 2-5 5-8z"/></svg>',police:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2l8 3v7c0 5-3.5 8.5-8 10-4.5-1.5-8-5-8-10V5l8-3z"/></svg>',stadium:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 4c5.5 0 10 1.8 10 4v4c0 2.2-4.5 4-10 4S2 14.2 2 12V8c0-2.2 4.5-4 10-4zm0 2C7.6 6 4 7.1 4 8s3.6 2 8 2 8-1.1 8-2-3.6-2-8-2z"/></svg>',fast_food:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M3 9a9 9 0 0 1 18 0H3zm-1 3h20v2H2v-2zm2 4h16a3 3 0 0 1-3 3H7a3 3 0 0 1-3-3z"/></svg>',bakery:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M4 9c0-2 1.5-3 3-3h10c1.5 0 3 1 3 3l-1 9H5L4 9zm4-1v9h2V8H8zm4 0v9h2V8h-2z"/></svg>',ice_cream:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2a5 5 0 0 1 5 5H7a5 5 0 0 1 5-5zM7 9h10l-5 13L7 9z"/></svg>',bar:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M3 4h18l-8 9v6h4v2H7v-2h4v-6L3 4zm3.5 2 2 2h7l2-2h-11z"/></svg>',butcher:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M5 3h6l2 5-3 3-5-3V3zm8 7 6 6-2 2-6-6 2-2zM3 17h8v4H3v-4z"/></svg>',alcohol_shop:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M10 2h4v4l3 5v11H7V11l3-5V2zm-1 11h6v7H9v-7z"/></svg>',clothing_store:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M9 3h6l5 3-2 4-2-1v12H8V9L6 10 4 6l5-3zm1 1.5L12 6l2-1.5h-4z"/></svg>',hairdresser:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M5 3l9 9-2 2-2-2-2 2 2 2-1 1a3 3 0 1 1-2-2l1-1-1-1a3 3 0 1 1 2-2L5 3zm14 0l-6 6 2 2 5-6V3zM6 17a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3zm0-11a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3z"/></svg>',laundry:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M5 2h14v20H5V2zm2 2v2h10V4H7zm5 4a6 6 0 1 0 0 12 6 6 0 0 0 0-12zm0 3a3 3 0 1 1 0 6 3 3 0 0 1 0-6z"/></svg>',music:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M9 4l11-2v13a3.5 3.5 0 1 1-2-3.2V6L11 7.4v10.1A3.5 3.5 0 1 1 9 14.3V4z"/></svg>',car:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M5 11l2-5a2 2 0 0 1 2-1h6a2 2 0 0 1 2 1l2 5v7h-3v-2H8v2H5v-7zm2.5-1h9l-1.2-3H8.7L7.5 10zM7 13a1.3 1.3 0 1 0 0 2.6A1.3 1.3 0 0 0 7 13zm10 0a1.3 1.3 0 1 0 0 2.6 1.3 1.3 0 0 0 0-2.6z"/></svg>',bicycle:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M6 12a5 5 0 1 0 0 10 5 5 0 0 0 0-10zm12 0a5 5 0 1 0 0 10 5 5 0 0 0 0-10zM6 15a2 2 0 1 1 0 4 2 2 0 0 1 0-4zm12 0a2 2 0 1 1 0 4 2 2 0 0 1 0-4zM9 4h4l4 8-2 1-3-6H9V4z"/></svg>',atm:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M2 5h20v14H2V5zm2 2v3h16V7H4zm0 5v5h16v-5H4zm2 2h5v2H6v-2z"/></svg>',post:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M2 5h20v14H2V5zm2.5 2 7.5 6 7.5-6h-15z"/></svg>',telephone:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M7 2c1 0 2 3 2 4s-2 2-2 3 4 6 5 6 2-2 3-2 4 1 4 2-1 4-3 4C9 19 5 15 3 5c0-2 3-3 4-3z"/></svg>',office:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M4 2h11v20H4V2zm2 3v3h3V5H6zm5 0v3h3V5h-3zM6 10v3h3v-3H6zm5 0v3h3v-3h-3zM6 15v3h3v-3H6zm5 0v7h3v-7h-3zM17 8h4v14h-4V8z"/></svg>',town_hall:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2l9 5v2H3V7l9-5zM5 11h3v7H5v-7zm5.5 0h3v7h-3v-7zM16 11h3v7h-3v-7zM3 20h18v2H3v-2z"/></svg>',doctors:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M7 2v6a5 5 0 0 0 4 4.9V16a3 3 0 1 0 6 0v-1.2a2.5 2.5 0 1 0-2 0V16a1 1 0 1 1-2 0v-3.1A5 5 0 0 0 17 8V2h-3v6a2 2 0 0 1-4 0V2H7z"/></svg>',dentist:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2c3 0 4-1 6 0 2 1 2 4 1 8l-1 5c-1 4-3 4-3.5 1L14 12c-.4-2-1.6-2-2 0l-.5 4c-.5 3-2.5 3-3.5-1l-1-5C6 6 6 3 8 2c2-1 3 0 4 0z"/></svg>',veterinary:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 11c3 0 6 3 6 6a3 3 0 0 1-3 3H9a3 3 0 0 1-3-3c0-3 3-6 6-6zM6 5a2.5 2.5 0 1 1 0 5 2.5 2.5 0 0 1 0-5zm12 0a2.5 2.5 0 1 1 0 5 2.5 2.5 0 0 1 0-5zM10 2a2.5 2.5 0 1 1 0 5 2.5 2.5 0 0 1 0-5zm4 0a2.5 2.5 0 1 1 0 5 2.5 2.5 0 0 1 0-5z"/></svg>',library:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M4 3h5c1.5 0 2.5.5 3 1.2.5-.7 1.5-1.2 3-1.2h5v16h-5c-1.5 0-2.5.6-3 1.5-.5-.9-1.5-1.5-3-1.5H4V3zm2 2v12h3c1 0 2 .2 2.5.5V5.8C11 5.3 10 5 9 5H6z"/></svg>',college:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 3 2 8l10 5 10-5-10-5zM5 12v5c0 2 3 4 7 4s7-2 7-4v-5l-7 3.5L5 12zm15-2v7h2v-7h-2z"/></svg>',museum:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2l10 5v2H2V7l10-5zM5 11h2.5v7H5v-7zm5 0h2.5v7H10v-7zm5 0h2.5v7H15v-7zM3 20h18v2H3v-2z"/></svg>',art_gallery:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2a10 10 0 0 0 0 20c1.7 0 2-1 1.4-2-.7-1.2 0-2.5 1.6-2.5H18a4 4 0 0 0 4-4c0-6-4.5-11.5-10-11.5zM7 9a1.7 1.7 0 1 1 0 3.4A1.7 1.7 0 0 1 7 9zm3-4a1.7 1.7 0 1 1 0 3.4A1.7 1.7 0 0 1 10 5zm5 0a1.7 1.7 0 1 1 0 3.4A1.7 1.7 0 0 1 15 5zm3 4a1.7 1.7 0 1 1 0 3.4A1.7 1.7 0 0 1 18 9z"/></svg>',theatre:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M3 5h8v9a4 4 0 0 1-8 0V5zm2.5 3a1 1 0 1 0 0 2 1 1 0 0 0 0-2zm3 0a1 1 0 1 0 0 2 1 1 0 0 0 0-2zM13 5h8v9a4 4 0 0 1-8 0V5zm2.5 3a1 1 0 1 0 0 2 1 1 0 0 0 0-2zm3 0a1 1 0 1 0 0 2 1 1 0 0 0 0-2z"/></svg>',cinema:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M2 4h20v16H2V4zm3 2v2h2V6H5zm0 5v2h2v-2H5zm0 5v2h2v-2H5zm12-10v2h2V6h-2zm0 5v2h2v-2h-2zm0 5v2h2v-2h-2zM9 6v12h6V6H9z"/></svg>',monument:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M10 2h4l1 13H9l1-13zM7 17h10v2H7v-2zm-2 3h14v2H5v-2z"/></svg>',castle:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M2 6h3V3h2v3h3V3h2v3h3V3h2v3h3v16H2V6zm7 8h6v8H9v-8z"/></svg>',attraction:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2l2.9 6.3 6.9.8-5.1 4.7 1.4 6.8L12 17.2 5.9 20.6l1.4-6.8L2.2 9.1l6.9-.8L12 2z"/></svg>',zoo:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 12c3.3 0 6 2.7 6 5.5S15.3 21 12 21s-6-.7-6-3.5S8.7 12 12 12zM5 6a2.7 2.7 0 1 1 0 5.4A2.7 2.7 0 0 1 5 6zm14 0a2.7 2.7 0 1 1 0 5.4A2.7 2.7 0 0 1 19 6zM9.5 2a2.7 2.7 0 1 1 0 5.4 2.7 2.7 0 0 1 0-5.4zm5 0a2.7 2.7 0 1 1 0 5.4 2.7 2.7 0 0 1 0-5.4z"/></svg>',theme_park:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M11 2h2v6h-2V2zM4 20a8 8 0 0 1 16 0v2H4v-2zm3.5-2h9A6 6 0 0 0 12 14a6 6 0 0 0-4.5 4zM3 9l3-2 3 2-3 2-3-2zm12 0l3-2 3 2-3 2-3-2z"/></svg>',information:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zm-1.5 4h3v3h-3V6zm0 5h3v8h-3v-8z"/></svg>',garden:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2c2 2 3 4 3 6a3 3 0 0 1-6 0c0-2 1-4 3-6zM4 9c2.5 0 5 1.5 6 4H8c-2.5 0-4-1.5-4-4zm16 0c0 2.5-1.5 4-4 4h-2c1-2.5 3.5-4 6-4zm-9 5h2v8h-2v-8z"/></svg>',pitch:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M2 5h20v14H2V5zm2 2v10h7V7H4zm9 0v10h7V7h-7zm-1 3a2 2 0 1 1 0 4 2 2 0 0 1 0-4z"/></svg>',playground:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M3 4h2v16H3V4zm16 0h2v16h-2V4zM5 6h14v2H5V6zm2 3 3 11H8L5 9h2zm10 0-3 11h2l3-11h-2z"/></svg>',swimming_pool:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M6 3a3 3 0 0 1 6 0v3h4a3 3 0 0 1 3 3h-3a1 1 0 0 0-1 1v3H12V6a1 1 0 0 0-2 0v8H6V3zm-4 14c2 0 2 2 5 2s3-2 5-2 3 2 5 2 3-2 5-2v3c-2 0-2 2-5 2s-3-2-5-2-3 2-5 2-3-2-5-2v-3z"/></svg>',sports_centre:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M4 8h3v8H4V8zM2 10h2v4H2v-4zm15-2h3v8h-3V8zm3 2h2v4h-2v-4zM8 11h8v2H8v-2z"/></svg>',bicycle_parking:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M4 2h5a4 4 0 0 1 0 8H7v5H4V2zm3 3v2h2a1 1 0 0 0 0-2H7zm-2 13a4 4 0 1 1 8 0 4 4 0 0 1-8 0zm10 0a4 4 0 1 1 8 0 4 4 0 0 1-8 0z"/></svg>',aerialway:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M2 4l20-2v2L13 5v2h1l4 3v6a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2v-6l4-3h1V5.3L2 6V4zm7 8v3h6v-3H9z"/></svg>',ferry_terminal:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M11 2h2v3h4v4h-4v5l7 2-2 6c-2 0-2-1-4-1s-2 1-4 1-2-1-4-1-2 1-4 1l-2-6 7-2V9H3V5h4V2h4zM9 7v2h6V7H9z"/></svg>',traffic_signals:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M8 2h8a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2h-3v3h4v2H7v-2h4v-3H8a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2zm4 1.6a1.6 1.6 0 1 0 0 3.2 1.6 1.6 0 0 0 0-3.2zm0 4.3a1.6 1.6 0 1 0 0 3.2 1.6 1.6 0 0 0 0-3.2zm0 4.3a1.4 1.4 0 1 0 0 2.8 1.4 1.4 0 0 0 0-2.8z"/></svg>',gate:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M2 4h3v16H2V4zm17 0h3v16h-3V4zM6 8h12v2H6V8zm0 5h12v2H6v-2z"/></svg>',toilets:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M6 2a2 2 0 1 1 0 4 2 2 0 0 1 0-4zM4 7h4l2 7H8v8H4v-8H2l2-7zm12-5a2 2 0 1 1 0 4 2 2 0 0 1 0-4zm-3 5h6l1 8h-2v7h-4v-7h-2l1-8z"/></svg>',drinking_water:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2c4 5 6 8 6 11a6 6 0 0 1-12 0c0-3 2-6 6-11zm0 5c-2 3-3 4.6-3 6a3 3 0 0 0 6 0c0-1.4-1-3-3-6z"/></svg>',waste_basket:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M9 2h6l1 2h4v3H4V4h4l1-2zM5 8h14l-1 14H6L5 8zm4 3v8h2v-8H9zm4 0v8h2v-8h-2z"/></svg>',recycling:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2l4 7h-3v4h-2V9H8l4-7zM3 18l3-6 2 1-1.4 2.5H10v2H6.6L8 20l-2 1-3-3zm18 0-3 3-2-1 1.4-2.5H14v-2h3.4L16 13l2-1 3 6z"/></svg>',campsite:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2l9 18h-4l-5-10-5 10H3L12 2zm0 9 5 9H7l5-9z"/></svg>',shelter:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2l10 8-1.5 2L19 11v9H5v-9l-1.5 1L2 10l10-8zm0 3.5L7 9.5V18h10V9.5l-5-4z"/></svg>',fire_station:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M13 2c0 3-4 4-4 8 0 1 .4 2 1 2.6C9.4 11 10 9.5 11 9c0 2 3 3 3 6a3.5 3.5 0 0 1-1 2.5c2.5-.6 4-2.8 4-5.5 0-5-4-7-4-10zM7 15c0 4 2.5 7 5 7s5-3 5-7c0 2-1 3-2 3.5.3-.6.5-1.2.5-2 0-2.5-2-3.5-2.5-5.5-1 1-2 2.5-2 4 0 .8.2 1.5.6 2C10.2 17.5 9 16.5 9 15H7z"/></svg>',prison:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M3 3h2v18H3V3zm4 0h2v18H7V3zm4 0h2v18h-2V3zm4 0h2v18h-2V3zm4 0h2v18h-2V3zM2 10h20v2H2v-2z"/></svg>',cemetery:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2c3 0 5 2 5 5v13H7V7c0-3 2-5 5-5zm-1 3v2H9v2h2v7h2v-7h2V7h-2V5h-2zM5 21h14v2H5v-2z"/></svg>',basin:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M2 8c2 0 2 2 5 2s3-2 5-2 3 2 5 2 3-2 5-2v3c-2 0-2 2-5 2s-3-2-5-2-3 2-5 2-3-2-5-2V8zm0 7c2 0 2 2 5 2s3-2 5-2 3 2 5 2 3-2 5-2v3c-2 0-2 2-5 2s-3-2-5-2-3 2-5 2-3-2-5-2v-3z"/></svg>',"shield-2":'<svg viewBox="0 0 32 24" xmlns="http://www.w3.org/2000/svg"><rect x="1" y="3" width="30" height="18" rx="4"/></svg>',"shield-3":'<svg viewBox="0 0 41 24" xmlns="http://www.w3.org/2000/svg"><rect x="1" y="3" width="39" height="18" rx="4"/></svg>',"shield-4":'<svg viewBox="0 0 50 24" xmlns="http://www.w3.org/2000/svg"><rect x="1" y="3" width="48" height="18" rx="4"/></svg>',"shield-5":'<svg viewBox="0 0 59 24" xmlns="http://www.w3.org/2000/svg"><rect x="1" y="3" width="57" height="18" rx="4"/></svg>',"shield-6":'<svg viewBox="0 0 68 24" xmlns="http://www.w3.org/2000/svg"><rect x="1" y="3" width="66" height="18" rx="4"/></svg>',"shield-7":'<svg viewBox="0 0 77 24" xmlns="http://www.w3.org/2000/svg"><rect x="1" y="3" width="75" height="18" rx="4"/></svg>',"shield-8":'<svg viewBox="0 0 86 24" xmlns="http://www.w3.org/2000/svg"><rect x="1" y="3" width="84" height="18" rx="4"/></svg>'},Au={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(Au)){let t=it[e];t?it[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 yu=1.2;function gn(n,e,t=16,o=0){let r=gu(n,t),i=[],a=[],l=0;for(let u of r){let m=0,f=0;for(let d of u){let h=d.codePointAt(0);if(h===void 0)continue;let p=e.get(h);p&&(m+=p.advance,f++);}f>1&&(m+=o*(f-1)),a.push(m),m>l&&(l=m);}if(l===0)return null;let s=ze*yu,c=r.length*s;for(let u=0;u<r.length;u++){let m=-a[u]/2,f=-c/2+u*s+s/2;for(let d of r[u]){let h=d.codePointAt(0);if(h===void 0)continue;let p=e.get(h);p&&(p.width>0&&p.height>0&&p.bitmap&&i.push({glyph:p,x:m,y:f}),m+=p.advance+o);}}return i.length?{glyphs:i,width:l,height:c}:null}function gu(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 Bn(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=[],u=[],m=()=>{u.length>=2&&c.push(u),u=[];};for(let f=0;f+1<n.length;f++){let d=n[f],h=n[f+1],p=s(d),b=s(h);if(p&&b){u.length||u.push(d),u.push(h);continue}let A=Bu(d,h,r,i,a,l);if(!A){m();continue}u.length||u.push(A[0]),u.push(A[1]),b||m();}return m(),c}function Bu(n,e,t,o,r,i){let a=e.x-n.x,l=e.y-n.y,s=0,c=1,u=[[-a,n.x-t],[a,r-n.x],[-l,n.y-o],[l,i-n.y]];for(let[m,f]of u){if(m===0){if(f<0)return null;continue}let d=f/m;if(m<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 Cu=[0,.25,-0.25,.5,-0.5,.75,-0.75,1,-1];function vn(n,e,t,o={}){if(n.length<2||!e.length||t<=0)return [];let r=_u(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,u=(o.fontSize??0)*.85,m=[],f=o.spacing??250,d=f>0&&f-t<f*.25?t+f*.25:f;if(o.accept)return vu(n,r,e,t,d,c,a,u,o.accept);if(d>0&&s>=t+d){let p=Math.min(Math.floor((s-t)/d)+1,24),b=t+d*(p-1),A=(s-b)/2;for(let y=0;y<p;y++,A+=d){let g=A/l,B=Cn(n,r,e,t,g,c,a,u);B&&m.push({glyphs:B,path:B.map(C=>({x:C.x,y:C.y})),at:g});}if(m.length)return m}let h=(i-t)/2;for(let p of Cu){let b=h+h*p,A=Cn(n,r,e,t,b,c,a,u);if(A)return [{glyphs:A,path:A.map(y=>({x:y.x,y:y.y})),at:b}];if(h===0)break}return []}function vu(n,e,t,o,r,i,a,l,s){let c=e[e.length-1],u=Math.max(o/3,r/8,12),m=[],f=-1/0;for(let d=0;d+o<=c;d+=u){if(d-f<r)continue;let h=Cn(n,e,t,o,d,i,a,l);if(!h)continue;let p={glyphs:h,path:h.map(b=>({x:b.x,y:b.y})),at:d};if(s(p)&&(m.push(p),f=d,m.length>=24))break}return m}function Cn(n,e,t,o,r,i,a,l){if(r<0||r+o>e[e.length-1]||!wu(n,e,r,r+o,i,a))return null;let s=lo(n,e,r),c=lo(n,e,r+o);if(!s||!c)return null;if(c.x>=s.x)return vl(n,e,t,r,l);let u=e[e.length-1];return vl([...n].reverse(),Du(e),t,u-(r+o),l)}function wu(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 u=Math.atan2(n[s].y-n[s-1].y,n[s].x-n[s-1].x),m=Math.atan2(n[s+1].y-n[s].y,n[s+1].x-n[s].x),f=Math.abs((m-u)*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 vl(n,e,t,o,r){let i=[];for(let c of t){let u=wl(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=[],l=o,s=0;for(let c=0;c<t.length;c++){if(c>0){let m=Math.abs(xu(i[c].angle,i[c-1].angle))*(Math.PI/180);s+=r*2*Math.tan(Math.min(m,Math.PI/3)/2);}l=o+t[c].offset+s;let u=wl(n,e,l,t[c].width);if(!u)return null;a.push(u);}return a}function wl(n,e,t,o){let r=lo(n,e,t+o/2);if(!r)return null;let i=lo(n,e,t),a=lo(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 xu(n,e){let t=n-e;for(;t>180;)t-=360;for(;t<=-180;)t+=360;return t}function _u(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 Du(n){let e=n[n.length-1];return n.map(t=>e-t).reverse()}function lo(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 xn=20,xl={stride:xn,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}]},Fu=220,Ye=64,_l=2,Eu=1.22,Mu=128,Iu=.7;function Su(n,e,t){let o=n.layout?.letterSpacing;if(o!==void 0)return O(o,e,0)*ze;let r=O(n.paint?.haloWidth,e,0);return r<=0||t<=0?0:r*Iu/(t/ze)}var Lu=256,Hu=200,wn="frame-circle",xt=class n{constructor(e,t){this.shader=null;this.locations=new P;this.atlas=new ro(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 P;this.fading=false;this.styleOrder=new P;this.glyphs=new no(e,t),this.icons=new ao(it);}init(e){this.shader=new ue(e,"symbol",Ua,Ja);for(let t of xl.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)/Fu;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}))?Hu: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 P,u=new P,m=new P;l.forEach((d,h)=>m.set(d.id,h));let f=0;for(let d of s){let h=this.place(d,a,c);if(!h)continue;this.placed.push({layerId:d.layer.id,text:d.text,icon:d.icon,mercX:d.mercX,mercY:d.mercY,box:h.box,order:m.get(d.layer.id)??0});let p=u.get(d.layer.id);p||u.set(d.layer.id,p={layer:d.layer,verts:[],texs:[],iconVerts:[],iconTexs:[],frameVerts:[],frameTexs:[]}),p.verts.push(...h.verts),p.texs.push(...h.texs),p.iconVerts.push(...h.iconVerts),p.iconTexs.push(...h.iconTexs),p.frameVerts.push(...h.frameVerts),p.frameTexs.push(...h.frameTexs),f+=h.quads,this.placedCount++;}this.rememberPlaced(),this.fading&&this.onAssetsReady?.(),this.requestMissing(),f&&(this.styleOrder=m,this.draw(e,t,u,f,a));}collect(e,t,o,r){let i=[],l=this.padding,s=gt(e,o).far,[c,u,m]=e.cameraPositionPx;for(let f of r){let d=(f.layout?.priority??0)*Lu,h=t.get(f.source??X);if(!h)continue;let p=f.layout?.showFor==="highlight",b=f.layout?.placement==="map",{shift:A,drop:y}=b?Ml(f,e.zoom,e.pixelsPerMeter):{shift:0,drop:0};if(p&&!this.highlightFootprint)continue;let g=e.worldSize>0?e.pixelsPerMeter/e.worldSize*1.5:0,B=o.bucketKeyFor(f);if(B!==null)for(let C of h.visibleTiles){if(!o.layerVisibleAt(f,e.detailZoom(e.distanceToTile(C))))continue;let _=h.getTile(C)?.data?.buckets?.[B];if(!_||!No(_))continue;let w=new Int16Array(_.anchors),x=new Uint8Array(_.priorities),D=_.rotations?new Int16Array(_.rotations):null,I=_.lines?new Int16Array(_.lines):null,E=_.lineStarts?new Uint32Array(_.lineStarts):null,L=C.bounds(),M=e.worldSize,S=(L.maxX-L.minX)*M/_.extent,F=L.minX*M,T=L.minY*M;for(let k=0;k<x.length;k++){let H=F+w[k*2]*S,G=T+w[k*2+1]*S;if(s!==1/0&&Math.hypot(H-c,G-u,m)>s||p&&!We(this.highlightFootprint,H/M,G/M,g))continue;let N=H,R=G;if(b&&D){let Y=D[k]*Math.PI/180,oe=A;N-=Math.sin(Y)*oe,R+=Math.cos(Y)*oe;}let W=e.worldPxToPoint(N,R),V=I&&E?Tu(e,I,E,k,F,T,S):void 0;if(f.layout?.textPlacement==="line"){if(!V)continue}else if(!W||W.x<l.left-64||W.y<l.top-64||W.x>e.width-l.right+64||W.y>e.height-l.bottom+64)continue;i.push({layer:f,screenX:W?W.x:V[0].x,screenY:(W?W.y:V[0].y)+y,text:_.texts[k]??"",icon:_.icons[k]??"",priority:x[k]+d,rotate:Il(f,D,k,e.bearing),mercX:H/M,mercY:G/M,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),l=this.hoverKey!==null&&this.hoverKey===i,s=O(r.textSize,t,13),c=O(r.iconSize,t,16),u=r.iconTextGap??5,[m,f]=r.offset??[0,0],d=r.placement==="map",h=null;if(e.icon&&!d){this.icons.isDefined(e.icon)||(e.icon="dot");let Q=`icon:${e.icon}`,K=this.atlas.get(Q);if(!K){let U=this.icons.get(e.icon);U?K=this.atlas.add(Q,U.data,U.width,U.height)??void 0:this.pendingIcons.add(e.icon);}K&&(h=K);}let p=null;if(h&&r.iconFrame==="circle"){let Q=`icon:${wn}`,K=this.atlas.get(Q);if(!K){let U=this.icons.get(wn);U?K=this.atlas.add(Q,U.data,U.width,U.height)??void 0:this.pendingIcons.add(wn);}K&&(p=K);}let b=p?Math.max(r.iconFrameScale??1.6,1):1,A=null;if(e.text&&(this.glyphs.needsLoad(e.text)&&this.pendingText.add(e.text),A=gn(e.text,this.glyphs,r.textPlacement==="line"?Number.MAX_SAFE_INTEGER:r.maxLineChars??15,Su(e.layer,t,s)),!A&&!h)||!A&&!h)return null;let y=s/ze,g=A?A.width*y:0,B=A?A.height*y:0;if(e.layer.layout?.textPlacement==="line")return A&&e.line?this.placeOnLine(e,A,y,B,o,t,a):null;let C=r.iconPlacement??"top",v=C==="behind"&&!!h&&!!A,_=C==="top"&&!!h&&!!A,w=h?h.width/Math.max(h.height,1):1,x=v?B+u*2:c,D=h?x*w:0,I=Math.max(D,h?c*b:0),E=Math.max(x,h?c*b:0),L=v?Math.max(D,g+u*2):_?Math.max(I,g):I+(h&&A?u:0)+g,M=v?Math.max(x,B):_?E+u+B:Math.max(h?E:0,B),S=e.screenX+m,F=e.screenY+f,T=_l+(r.collisionPadding??0),k={x1:S-L/2-T,y1:F-M/2-T,x2:S+L/2+T,y2:F+M/2+T},H=this.padding;if(k.x1<H.left||k.y1<H.top||k.x2>this.viewport.width-H.right||k.y2>this.viewport.height-H.bottom)return null;if(!r.allowOverlap){if(Dl(o,k))return null;Fl(o,k);}let G=[],N=[],R=[],W=[],V=[],j=[],Y=0,oe=S-L/2,ge=_?(E+u)/2:0,$=1/0,J=1/0,be=-1/0,Ae=-1/0;if(A){let Q=_||v?S:oe+(h?I+u:0)+g/2;for(let K of A.glyphs){let U=K.glyph,de=`g:${U.id}`,ie=this.atlas.get(de);if(!ie&&(!U.bitmap||(ie=this.atlas.add(de,U.bitmap,U.width+pe*2,U.height+pe*2)??void 0,!ie)))continue;let he=Q+(K.x+U.left-pe)*y,ne=F+ge+(K.y-U.top-pe)*y,Be=ie.width*y,Me=ie.height*y;er(G,N,he,ne,Be,Me,ie,0,a),Y++;let Ce=pe*y;$=Math.min($,he+Ce),J=Math.min(J,ne+Ce),be=Math.max(be,he+Be-Ce),Ae=Math.max(Ae,ne+Me-Ce);}if(_&&h&&J<1/0){let K=F-M/2+E+u-J;if(K!==0){for(let U=1;U<G.length;U+=4)G[U]+=K;J+=K,Ae+=K;}}}if(h){let Q=l?Eu:1,K=D*Q,U=x*Q,de=(_?S-D/2:oe+(I-D)/2)-(K-D)/2,ie=(_?F-M/2+(E-x)/2:F-x/2)-(U-x)/2;if(p){let ne=c*b*Q,Be=de+K/2-ne/2,Me=ie+U/2-ne/2,Ce=pe/Math.max(p.height-pe*2,1)*ne;er(V,j,Be-Ce,Me-Ce,ne+Ce*2,ne+Ce*2,p,0,a),Y++;}if(v&&be>$){let ne=u*1.6,Be=u;K=(be-$+ne*2)*Q,U=(Ae-J+Be*2)*Q,de=$-ne,ie=J-Be;}let he=pe/Math.max(h.height-pe*2,1)*U;er(R,W,de-he,ie-he,K+he*2,U+he*2,h,e.rotate,a),Y++;}return Y?{verts:G,texs:N,iconVerts:R,iconTexs:W,frameVerts:V,frameTexs:j,quads:Y,box:k}:null}placeOnLine(e,t,o,r,i,a,l){let s=e.line,c=t.glyphs.map(D=>({offset:(D.x+t.width/2)*o,width:Math.max(D.glyph.advance,1)*o})),u=c.length?c[c.length-1].offset+c[c.length-1].width:0,m=e.layer.layout??{},f=[],d=[],h=[],p=0,b=r/2+_l,A=this.padding,y=D=>{let I=D.path.map(E=>({x1:E.x-b,y1:E.y-b,x2:E.x+b,y2:E.y+b}));for(let E of I)if(E.x1<A.left||E.y1<A.top||E.x2>this.viewport.width-A.right||E.y2>this.viewport.height-A.bottom||!m.allowOverlap&&Dl(i,E))return false;if(!m.allowOverlap)for(let E of I)Fl(i,E);return h.push(...I),true},g=-1/0,B=1/0;for(let D of t.glyphs)D.glyph.height<=0||(g=Math.max(g,D.glyph.top),B=Math.min(B,D.glyph.top-D.glyph.height));let C=Number.isFinite(g)?(g+B)/2*o:0,_=Bn(s,this.viewport.width,this.viewport.height,Mu).flatMap(D=>vn(D,c,u,{spacing:m.symbolSpacing,fontSize:ze*o,stableScale:Math.pow(2,Math.round(a)-a),accept:y}));if(!_.length)return null;for(let D of _)for(let I=0;I<t.glyphs.length;I++){let E=t.glyphs[I].glyph,L=D.glyphs[I],M=`g:${E.id}`,S=this.atlas.get(M);if(!S&&(!E.bitmap||(S=this.atlas.add(M,E.bitmap,E.width+pe*2,E.height+pe*2)??void 0,!S)))continue;let F=S.width*o,T=S.height*o,k=(E.height/2-E.top)*o+C,H=L.angle*Math.PI/180;er(f,d,L.x-F/2-Math.sin(H)*k,L.y-T/2+Math.cos(H)*k,F,T,S,L.angle,l),p++;}if(!p)return null;let w=h.map(D=>(D.x1+D.x2)/2),x=h.map(D=>(D.y1+D.y2)/2);return {verts:f,texs:d,iconVerts:[],iconTexs:[],frameVerts:[],frameTexs:[],quads:p,box:{x1:Math.min(...w)-b,y1:Math.min(...x)-b,x2:Math.max(...w)+b,y2:Math.max(...x)+b}}}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 u=new ArrayBuffer(r*4*xn),m=new Float32Array(u),f=new Uint16Array(u),d=[],h=0,p=(b,A,y,g)=>{let B=b.length/16;if(B){d.push({layer:y,role:g,first:h/4*6,count:B*6});for(let C=0;C<B*4;C++){let v=h*5;m[v]=b[C*4],m[v+1]=b[C*4+1],f[v*2+4]=A[C*2],f[v*2+5]=A[C*2+1],m[v+3]=b[C*4+2],m[v+4]=b[C*4+3],h++;}}};for(let b of this.inStyleOrder(o))p(b.frameVerts,b.frameTexs,b.layer,"frame"),p(b.iconVerts,b.iconTexs,b.layer,"icon"),p(b.verts,b.texs,b.layer,"text");s.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",An),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 b of d){let A=b.layer.paint,y=O(A.opacity,i,1),g=b.role==="icon",B=b.role==="frame",C=(I,E,L)=>B?E??I??L:g?I??L:L,v=Le(B?A.frameColor??A.haloColor??A.color:C(A.iconColor,void 0,A.color),i,[.15,.15,.15,1]),_=B?A.frameHaloColor:C(A.iconHaloColor,void 0,A.haloColor),w=Le(_??(B?A.iconColor??A.color:A.haloColor),i,[1,1,1,1]);B&&A.frameHaloColor===void 0&&(w[3]*=.35),B&&(v[3]*=O(A.frameOpacity,i,1));let x=O(B?A.frameHaloWidth??1.1:C(A.iconHaloWidth,void 0,A.haloWidth),i,1.2),D=O(b.layer.layout?.textSize,i,13);a.setVec4v("u_color",xe([v[0],v[1],v[2],v[3]*y])),a.setVec4v("u_halo_color",xe([w[0],w[1],w[2],w[3]*y])),a.setFloat("u_halo",x/(io*(D/ze))),l.drawElements(l.TRIANGLES,b.count,l.UNSIGNED_INT,b.first*4);}e.bindVAO(null);}ensureBuffers(e,t){if(this.vao&&t<=this.capacityQuads)return;this.vao?.destroy(),this.vbo?.destroy(),this.ibo?.destroy(),this.capacityQuads=Math.max(1024,Math.ceil(t*1.5)),this.vbo=new ye(e,new Uint8Array(this.capacityQuads*4*xn),xl,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 fe(e,o),this.vao=new le(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 er(n,e,t,o,r,i,a,l=0,s=1){let c=i/Math.max(a.height,1);if(l){let u=l*Math.PI/180,m=Math.cos(u),f=Math.sin(u),d=t+r/2,h=o+i/2;for(let[p,b]of [[t,o],[t+r,o],[t+r,o+i],[t,o+i]]){let A=p-d,y=b-h;n.push(d+A*m-y*f,h+A*f+y*m,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 Tu(n,e,t,o,r,i,a){if(o+1>=t.length)return;let l=t[o],s=t[o+1],c=[];for(let u=l;u<s;u++){let m=n.worldPxToPoint(r+e[u*2]*a,i+e[u*2+1]*a);if(!m)break;c.push(m);}return c.length>=2?c:void 0}var El=(n,e)=>n*4096+e;function Dl(n,e){let t=Math.floor(e.x1/Ye),o=Math.floor(e.y1/Ye),r=Math.floor(e.x2/Ye),i=Math.floor(e.y2/Ye);for(let a=t;a<=r;a++)for(let l=o;l<=i;l++){let s=n.get(El(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 Fl(n,e){let t=Math.floor(e.x1/Ye),o=Math.floor(e.y1/Ye),r=Math.floor(e.x2/Ye),i=Math.floor(e.y2/Ye);for(let a=t;a<=r;a++)for(let l=o;l<=i;l++){let s=El(a,l),c=n.get(s);c||n.set(s,c=[]),c.push(e);}}function Ml(n,e,t){let r=n.layout?.arrowUnits!=="meters"?1:t,i=O(n.layout?.arrowLength,e,50)*r;return {shift:O(n.layout?.arrowGap,e,20)*r+i/2,drop:i/2+(n.layout?.iconTextGap??4)}}function Il(n,e,t,o){return !n.layout?.iconRotate||!e?0:e[t]-o}var _t=class{constructor(e,t){this.capacity=e;this.onEvict=t;this.map=new P;}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 Dt=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 Pu(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 Dt(t,s,l),u=c.bounds(),m=(u.minX+u.maxX)/2,f=(u.minY+u.maxY)/2,d=[[m,f],[u.minX,u.minY],[u.maxX,u.minY],[u.minX,u.maxY],[u.maxX,u.maxY]],h=false;for(let[b,A]of d)if(n.isOnGlobeFront(De(b),_e(A))){h=true;break}if(!h)continue;let p=false;for(let[b,A]of d){let y=n.localToPoint(n.globeLocal(b,A));if(y&&y.x>-a&&y.y>-a&&y.x<n.width+a&&y.y<n.height+a){p=true;break}}if(p&&(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 Pu(n,e,l);let{min:s,max:c}=n.visibleWrapRange(),u=[],m=[];for(let d=s;d<=c;d++)m.push(new Dt(0,0,0,d));let f=0;for(;m.length&&!(++f>2e4||u.length>=i);){let d=m.pop();if(!n.isTileVisible(d))continue;if(d.z>=l){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 p of d.children())m.push(p);}return u.sort((d,h)=>n.distanceToTile(d)-n.distanceToTile(h)),u}var _n=class{constructor(e){this.id=e;this.state="loading";this.data=null;this.error=null;this.requestId=0;this.buckets=new P;}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;}},ku=1500,tr=class extends Ne{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 _t(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 q;for(let s of o)r.add(s.dataKey);for(let[s,c]of this.cache.entries())c.state==="loading"&&!r.has(s)&&(this.pool.abort(c.requestId),this.cache.delete(s));let 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>ku?(this.visible=o,this.holdSince=0,this.readyFor(o)&&o.length&&(this.warmed=true)):this.holdSince||(this.holdSince=l);}readyFor(t){for(let o of t){let r=this.cache.peek(o.dataKey);if(!r||r.state==="loading")return false}return true}covers(t){let o=new q;for(let r of this.visible)o.add(r.dataKey);for(let r of t){if(o.has(r.dataKey))continue;let 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 _n(t);this.cache.set(t.dataKey,o);let r=Gu(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:Yn(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 Gu(n){if(typeof location>"u")return n;try{return new URL(n,location.href).href}catch{return n}}var or=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;}},co=class extends Ne{constructor(t){super();this.visible=[];this.aborts=new Map;this.opts={cacheSize:128,detailBias:1,maxTiles:256,...t},this.cache=new _t(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 q;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 or(t);this.cache.set(t.dataKey,o);let r=new AbortController;this.aborts.set(t.dataKey,r),this.fetchImage(Sl(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 Sl(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 Ru="osmgl-assets",Ft="assets";var rr=null;function Hl(){return rr||(rr=new Promise(n=>{if(typeof indexedDB>"u")return n(null);try{let e=indexedDB.open(Ru,1);e.onupgradeneeded=()=>{let t=e.result;t.objectStoreNames.contains(Ft)||t.createObjectStore(Ft,{keyPath:"key"});},e.onsuccess=()=>n(e.result),e.onerror=()=>n(null);}catch{n(null);}}),rr)}function Ou(n){return Hl().then(e=>new Promise(t=>{if(!e)return t(null);try{let o=e.transaction(Ft,"readonly").objectStore(Ft).get(n);o.onsuccess=()=>t(o.result??null),o.onerror=()=>t(null);}catch{t(null);}}))}function Wu(n){Hl().then(e=>{if(e)try{e.transaction(Ft,"readwrite").objectStore(Ft).put(n);}catch{}});}var Ll=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 Vu(n,e,t){let o=await crypto.subtle.importKey("raw",Ll(e),"AES-GCM",false,["decrypt"]);return crypto.subtle.decrypt({name:"AES-GCM",iv:Ll(t),tagLength:128},o,n)}var fo=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 Ou(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(),Wu({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 Vu(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 zu=1,uo=class{constructor(e){this.mesh=null;this.bitmaps=[];this.error=null;this.loading=null;this.matrix=z();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-${zu++}`,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 sn(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=Z(this.coordinates);return {x:ee(e.lng),y:te(e.lat)}}localMatrix(e){let t=this.effectiveScale(),o=t/He(e),r=[o,0,0,0,0,t*this.grow,0,o,0],i=c=>c*Math.PI/180,a=Fn(i(-this.rotation));this.rotationTiltX&&(a=Ze(Dn(i(this.rotationTiltX)),a)),this.rotationTiltZ&&(a=Ze(En(i(this.rotationTiltZ)),a));let l=Ze(r,a),s=this.matrix;return Re(s),s[0]=l[0],s[1]=l[1],s[2]=l[2],s[4]=l[3],s[5]=l[4],s[6]=l[5],s[8]=l[6],s[9]=l[7],s[10]=l[8],s[15]=1,s}matrixInSpace(e,t){let o=Z(this.coordinates),r=z();for(let a=0;a<16;a++)r[a]=e[a];let i=z();return we(i,r,this.localMatrix(o.lat)),Oe(t??this.matrix32,i)}cameraInModelSpace(e){let t=this.effectiveScale();if(!(t>0))return [0,0,0];let o=this.origin(),r=Z(this.coordinates),i=He(r.lat),a=e.worldSize,l=e.cameraPositionPx,s=(l[0]/a-o.x)*i,c=(l[1]/a-o.y)*i,u=l[2]/e.pixelsPerMeter-this.altitude,m=s,f=u,d=c,h=b=>b*Math.PI/180,p=Fn(h(-this.rotation));return this.rotationTiltX&&(p=Ze(Dn(h(this.rotationTiltX)),p)),this.rotationTiltZ&&(p=Ze(En(h(this.rotationTiltZ)),p)),[(p[0]*m+p[1]*f+p[2]*d)/t,(p[3]*m+p[4]*f+p[5]*d)/t,(p[6]*m+p[7]*f+p[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=Z(this.coordinates),s=this.localMatrix(l.lat),c=s[0],u=s[1],m=s[8],f=s[9],d=c*f-u*m;if(Math.abs(d)<1e-30)return false;let h=(i*f-a*m)/d,p=(c*a-u*i)/d,b=1.05,A=(o.min[0]+o.max[0])/2,y=(o.min[2]+o.max[2])/2,g=(o.max[0]-o.min[0])/2*b,B=(o.max[2]-o.min[2])/2*b;return Math.abs(h-A)<=g&&Math.abs(p-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=z();for(let m=0;m<16;m++)a[m]=e[m];let l=Z(this.coordinates),s=z();we(s,a,this.localMatrix(l.lat));let c=z();cn(i,t,i.duration>0?o%i.duration:0,c);let u=z();return we(u,s,c),Oe(r,u)}normalMatrix(){let e=i=>i*Math.PI/180,t=Fn(e(-this.rotation));this.rotationTiltX&&(t=Ze(Dn(e(this.rotationTiltX)),t)),this.rotationTiltZ&&(t=Ze(En(e(this.rotationTiltZ)),t));let o=Ze([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 Ze(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 Dn=n=>{let e=Math.cos(n),t=Math.sin(n);return [1,0,0,0,e,t,0,-t,e]},Fn=n=>{let e=Math.cos(n),t=Math.sin(n);return [e,0,-t,0,1,0,t,0,e]},En=n=>{let e=Math.cos(n),t=Math.sin(n);return [e,t,0,-t,e,0,0,0,1]};var ir=class{constructor(){this.hit=new P;this.miss=new q;this.stamp="";}find(e,t){if(!t)return null;let o=this.hit.get(e.id);if(o!==void 0)return o;let r=t.source.visibleTiles.map(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,u=new Int16Array(a.vertices),m=new Uint32Array(a.indices),f=new Float64Array(a.featureIds),d=u.length/a.vertexCount;for(let h=0;h*3+2<m.length;h++){let p=m[h*3]*d,b=m[h*3+1]*d,A=m[h*3+2]*d;if(!Yu(s,c,u[p],u[p+1],u[b],u[b+1],u[A],u[A+1]))continue;let y=f[h];return this.hit.set(e.id,y),y}}return this.miss.add(e.id),null}clear(){this.hit.clear(),this.miss.clear(),this.stamp="";}},Nu=14,Ku=2e3,Uu=4e3,Tl=160,Ju=50,Xu=4e3,Mn=6,ar=class{constructor(e){this.wantKey="";this.modelKey="";this.entries=new P;this.loading=0;this.pending=[];this.known=new P;this.underBuilding=new ir;this.underVenue=new ir;this.tilesStamp="";this.rulesInScan=0;this.found=[];this.foundStamp="";this.sortedAt=null;this.budgetScale=1;this.addModel=null;this.lod=0;this.budget=Tl;this.replacedBuildings=new q;this.replacedVenues=new q;this.onReady=null;this.stats={found:0,kept:0,live:0,tooFar:0,overBudget:0,queued:0,rules:0,loadingNow:0,pendingNow:0,replaced:0};this.loader=new fo(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??Nu,u=s.loadRadius??Ku,m=Math.max(s.keepRadius??Uu,u),f=Math.min(1,Math.max(.25,(o.zoom-c)/3)),d=Math.max(8,Math.round((s.budget??Tl)*this.budgetScale*f));this.budget=d,this.addModel=r;let h=s.maskReplaced!==false,p=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 b=o.center,A=this.lodFor(o.zoom,c);this.lod=A;let y="";for(let F of t.visibleTiles)y+=F.dataKey+(t.getTile(F)?.data?"+":"-");let g=this.rulesInScan;if(y!==this.tilesStamp){this.tilesStamp=y;let F=new q;g=0;for(let T of t.visibleTiles){let k=t.getTile(T)?.data?.buckets?.[e.id];if(!k||!Xa(k))continue;let H=new Int16Array(k.anchors),G=T.bounds(),N=G.maxX-G.minX,R=G.maxY-G.minY;for(let W=0;W<k.props.length;W++){let V=k.props[W],j=at(V.file,NaN);if(!Number.isFinite(j))continue;let Y=String(V.kind??"model"),oe=Y==="rule"?`t-${V.rid}-${V.oid}`:`m-${V.mid}`;if(F.has(oe))continue;F.add(oe),Y==="rule"&&g++;let ge=G.minX+H[W*2]/k.extent*N,$=G.minY+H[W*2+1]/k.extent*R,J=ju(ge,$);this.known.set(oe,{id:oe,fileId:j,lng:J.lng,lat:J.lat,mercX:ge,mercY:$,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:Y==="rule"?"rule":"model",target:nr(Y==="rule"?V.oid:V.replaces),replaces:h?Y==="rule"?nr(V.oid):String(V.anchor??"replace")==="replace"?nr(V.replaces):null:null});}}this.rulesInScan=g;}y!==this.foundStamp&&(this.foundStamp=y,this.found=[...this.known.values()],this.sortedAt=null);let B=this.found,C=new q;for(let F of B)F.kind==="model"&&F.target!==null&&C.add(F.target);let v=111320,_=Math.cos(b.lat*Math.PI/180),w=F=>Math.hypot((F.lng-b.lng)*v*_,(F.lat-b.lat)*v);this.replacedBuildings.clear(),this.replacedVenues.clear();let x=new q,D=[],I=0,E=0;(this.sortedAt===null||Math.hypot((b.lng-this.sortedAt.lng)*v*_,(b.lat-this.sortedAt.lat)*v)>Ju)&&(B.sort((F,T)=>w(F)-w(T)),this.sortedAt={lng:b.lng,lat:b.lat});let M=0;for(let F of B){let T=w(F);if(T>m){I++;continue}if(F.kind==="rule"&&F.target!==null&&C.has(F.target)){let N=this.entries.get(F.id);N&&N.model.retire();continue}let k=this.entries.get(F.id);if(M>=d){E++,k&&k.model.retire();continue}M++,x.add(F.id);let H=()=>{if(F.replaces===null)return;this.replacedBuildings.add(F.replaces);let N=this.underBuilding.find(F,a);N!==null&&this.replacedBuildings.add(N);let R=this.underVenue.find(F,l);R!==null&&this.replacedVenues.add(R);},G=k;if(G){H(),G.distance=T,G.leftAt=0,G.model.revive(),A<G.lod&&!G.upgrading&&this.loading<Mn&&this.upgrade(G,A,r,i);continue}if(T>u){I++;continue}if(this.loading>=Mn){D.push(F),H();continue}H(),this.spawn(F,T,A,r);}for(let F of [...this.entries.values()])if(!x.has(F.placement.id)){if(F.leftAt===0){F.leftAt=p;continue}p-F.leftAt>Xu&&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()])w(T)>m*3&&this.known.delete(F);let S=this.stats;S.found=B.length,S.kept=x.size,S.live=this.entries.size,S.tooFar=I,S.overBudget=E,S.queued=D.length,S.rules=g,S.loadingNow=this.loading,S.pendingNow=D.length,S.replaced=this.replacedBuildings.size,this.pending=D;}pump(){let e=this.addModel;if(this.stats.loadingNow=this.loading,this.stats.pendingNow=this.pending.length,!!e)for(;this.pending.length&&this.loading<Mn&&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 uo({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},nr=n=>{let e=at(n,NaN);return Number.isFinite(e)?e:null};function ju(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 Yu(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),u=(n-t)*(l-o)-(a-t)*(e-o),m=s<0||c<0||u<0,f=s>0||c>0||u>0;return !(m&&f)}var Zu=200,Qu={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=Qu[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??qu),t.classList.add("osmgl-marker"),e.className&&t.classList.add(e.className),t.style.position="absolute",t.style.top="0",t.style.left="0",t.style.willChange="transform",e.zIndex!==void 0&&(t.style.zIndex=String(e.zIndex)),this.element=t;}get coordinates(){return this._coordinates}setCoordinates(e){return this._coordinates=e,this}setVisible(e){return this._visible=e,this.applyVisibility(),this}get visible(){return this._visible}attach(e){this.attachedTo!==e&&(e.appendChild(this.element),this.attachedTo=e);}detach(){this.element.remove(),this.attachedTo=null;}update(e){let t=Z(this._coordinates),o=e.worldSize,r=e.worldPxToPoint(ee(t.lng)*o,te(t.lat)*o,this.altitude);if(!r){this.culled=true,this.applyVisibility();return}let i=Zu;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";}},qu='<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 mo=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 $u=[["\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."]],Pl=new Map($u);function In(n){let e=n.split(" ");if(e.length<2)return n;let t=false,o=e.map(i=>{let a=Pl.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=>Pl.get(i.toLowerCase())===void 0).length?n:o.join(" ")}function Ln(n,e){let t=[],o=[],r=[],i=[],a=[],l=e.textPlacement==="line",s=[],c=[],u=[];for(let m of n.features()){if(!me(e.filter,m.properties))continue;let f=m.loadGeometry(),d=od(m.type,f);if(!d)continue;let h=e.textField?Sn(e.textField,m.properties):"",p=h&&e.abbreviate?In(h):h,b=e.iconImage?Sn(e.iconImage,m.properties):"";if(!(!p&&!b)){if(l){let A=td(m.type,f);if(!A)continue;u.push({text:p,line:A});continue}t.push(d[0],d[1]),o.push(p),r.push(b),i.push(rd(m.properties)),a.push(e.iconRotate&&Math.round(Number(m.properties[e.iconRotate]??0))||0);}}if(l){for(let{text:m,line:f}of ed(u)){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(m),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 ed(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),u=o.get(l);if(u!==void 0){let m=e[u];if(m.line.push(...a.slice(2)),o.delete(l),o.set(r(i,m.line[m.line.length-2],m.line[m.line.length-1]),u),c!==void 0&&c!==u){let f=e[c];m.line.push(...f.line.slice(2)),f.line=[],t.delete(s),o.set(r(i,m.line[m.line.length-2],m.line[m.line.length-1]),u);}continue}if(c!==void 0){let m=e[c];m.line.unshift(...a.slice(0,a.length-2)),t.delete(s),t.set(r(i,m.line[0],m.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 td(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 od(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 u=0;u+3<c.length;u+=2){let m=c[u+2]-c[u],f=c[u+3]-c[u+1],d=m*m+f*f;d>a&&(a=d,l=c[u]+m/2,s=c[u+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 rd(n){let e=n.rank;return typeof e=="number"&&isFinite(e)?Math.max(0,255-Math.min(e,255)):128}function Sn(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 kl(n,e){let t=[],o=[];for(let r=0;r<n.length;r++){let i=n.feature(r);if(i.type===1&&me(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 nd(){let n=typeof self<"u"?self.origin:void 0;return n&&n!=="null"&&!n.startsWith("blob:")?n+"/":void 0}async function Rl(n,e){let t=performance.now(),o=nd(),r=await fetch(n.url,{signal:e,credentials:"same-origin",...o?{referrer:o}:{}}),i=(b,A,y,g,B=0)=>({type:"loaded",id:n.id,buckets:{},timing:{fetchMs:g,parseMs:B},diag:{status:b,bytes:A,layers:y,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 Vt(a),u=Object.keys(c.layers),m={},f={},d=[],p=n.plan.some(b=>b.type==="surface"&&(b.elevation??0)>0)&&n.plan.some(b=>b.type==="line"&&b.ground)?Or(n.metersPerTile):void 0;for(let b of n.plan){if(!ad(b,n.zoom,n.sourceMaxZoom))continue;let A=c.layers[b.sourceLayer];if(!A)continue;let y=ld(n.zoom,A.extent);try{if(b.splitBy){let B=sd(A,b.splitBy,b.filter);if(!B.length)continue;let C=f[b.splitBy]??(f[b.splitBy]=[]);for(let v of B){C.includes(v)||C.push(v);let _={...b,splitBy:void 0,filter:cd(b.filter,b.splitBy,v)},w=Gl(_,A,y,n.metersPerTile,p);w&&(m[bt(b.id,v)]=w);}continue}let g=Gl(b,A,y,n.metersPerTile,p);g&&(m[b.id]=g);}catch(g){d.push(`${b.id}: ${g instanceof Error?g.message:String(g)}`);}}return {type:"loaded",id:n.id,buckets:m,...Object.keys(f).length?{splits:f}:{},timing:{fetchMs:l,parseMs:performance.now()-s},diag:{status:r.status,bytes:a.byteLength,layers:u,built:Object.keys(m).length,...d.length?{failed:d}:{}}}}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 ad(n,e,t){let o=e-1,r=e<t?e+1:24;return !(n.maxzoom<o||n.minzoom>r)}function ld(n,e){return n<=6?Math.max(64,e/24):0}function Gl(n,e,t,o,r){{if(n.type==="fill"){let a=o>0?o/e.extent:0,l=n.cornerRadius&&a>0?{radius:n.cornerRadius/a,segments:n.cornerSegments,extent:e.extent,minCutRatio:0,maxChord:_i/a}:void 0,s=Rr(e,n.filter,t,l,n.clipToTile===true,e.extent);return s?{kind:"fill",...s,extent:e.extent}:null}if(n.type==="surface"){let a=Gr(e,e.extent,n.filter,{metersPerUnit:o>0?o/e.extent:0,elevation:n.elevation??0,base:n.base,bevel:n.bevel,bevelDrop:n.bevelDrop,cornerRadius:n.cornerRadius,cornerSegments:n.cornerSegments,...r?{onShapes:l=>Wr(r,l,n.elevation??0,e.extent)}:{},...n.groundBy?{liftBy:id(n.groundBy)}:{}});return a?{kind:"surface",...a}:null}if(n.type==="line"){let a=zr(e,n.filter,t,n.ground?r:void 0);return a?{kind:"line",...a,extent:e.extent}:null}if(n.type==="model"){let a=kl(e,n.filter);return a?{kind:"placement",...a,extent:e.extent}:null}if(n.type==="symbol"){let a=Ln(e,{filter:n.filter,textField:n.textField,iconImage:n.iconImage,iconRotate:n.iconRotate,textPlacement:n.textPlacement,abbreviate:n.abbreviate});return a?{kind:"symbol",...a,extent:e.extent}:null}let i=Lr(e,e.extent,n.filter,{metersPerUnit:o>0?o/e.extent:0,cornerRadius:n.cornerRadius,cornerSegments:n.cornerSegments});return i?{kind:"fill-extrusion",vertices:i.vertices,indices:i.indices,featureIds:i.featureIds,vertexCount:i.vertexCount,indexCount:i.indexCount,extent:i.extent}:null}}function sd(n,e,t){let o=[];for(let r of n.features()){if(!me(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 cd(n,e,t){let o=["==",e,t];return n?["all",n,o]:o}var Hn='"use strict";(()=>{var se=new Set,Pe=!1;function Y(t,e,n=2){let r=e&&e.length,o=r?e[0]*n:t.length;se.size&&se.clear();let i=ft(t,0,o,n,!0),s=[];if(!i||i.next===i.prev)return s;let u=0,c=0,l=0;if(r&&(i=un(t,e,i,n)),t.length>80*n){u=t[0],c=t[1];let f=u,m=c;for(let a=n;a<o;a+=n){let h=t[a],d=t[a+1];h<u&&(u=h),d<c&&(c=d),h>f&&(f=h),d>m&&(m=d)}l=Math.max(f-u,m-c),l=l!==0?32767/l:0}return Ae(i,s,u,c,l),s}function ft(t,e,n,r,o){let i=null;if(o===wn(t,e,n,r)>0)for(let s=e;s<n;s+=r)i=lt(s/r|0,t[s],t[s+1],i);else for(let s=n-r;s>=e;s-=r)i=lt(s/r|0,t[s],t[s+1],i);return i&&ue(i,i.next)&&(le(i),i=i.next),i}function $(t,e=t){let n=e===t,r=t,o;do o=!1,r!==r.next&&(se.size===0||!se.has(r))&&(ue(r,r.next)||L(r.prev,r,r.next)===0)?((n||r===e)&&(e=r.prev),Pe=!0,le(r),r=r.prev,o=!0):(n||r!==e)&&(r=r.next,o=!n);while(o||r!==e);return e}function Ae(t,e,n,r,o){o&&dn(t,n,r,o);let i=t,s=!1;for(;t.prev!==t.next;){let u=t.prev,c=t.next;if(L(u,t,c)<0&&(o?rn(t,n,r,o):nn(t))){e.push(u.i,t.i,c.i),le(t),t=c,i=c;continue}if(t=c,t===i){if(Pe=!1,t=$(t),Pe){i=t;continue}if(!s){t=on(t,e),i=t,s=!0;continue}sn(t,e,n,r,o);break}}}function nn(t){let e=t.prev,n=t,r=t.next,o=e.x,i=n.x,s=r.x,u=e.y,c=n.y,l=r.y,f=Math.min(o,i,s),m=Math.min(u,c,l),a=Math.max(o,i,s),h=Math.max(u,c,l),d=r.next;for(;d!==e;){if(d.x>=f&&d.x<=a&&d.y>=m&&d.y<=h&&!(o===d.x&&u===d.y)&&ge(o,u,i,c,s,l,d.x,d.y)&&L(d.prev,d,d.next)>=0)return!1;d=d.next}return!0}function rn(t,e,n,r){let o=t.prev,i=t,s=t.next,u=o.x,c=i.x,l=s.x,f=o.y,m=i.y,a=s.y,h=Math.min(u,c,l),d=Math.min(f,m,a),g=Math.max(u,c,l),x=Math.max(f,m,a),p=Te(h,d,e,n,r),w=Te(g,x,e,n,r),b=t.prevZ;for(;b&&b.z>=p;){if(b.x>=h&&b.x<=g&&b.y>=d&&b.y<=x&&b!==s&&!(u===b.x&&f===b.y)&&ge(u,f,c,m,l,a,b.x,b.y)&&L(b.prev,b,b.next)>=0)return!1;b=b.prevZ}let y=t.nextZ;for(;y&&y.z<=w;){if(y.x>=h&&y.x<=g&&y.y>=d&&y.y<=x&&y!==s&&!(u===y.x&&f===y.y)&&ge(u,f,c,m,l,a,y.x,y.y)&&L(y.prev,y,y.next)>=0)return!1;y=y.nextZ}return!0}function on(t,e){let n=t,r=!1;do{let o=n.prev,i=n.next.next;mt(o,n,n.next,i,!1)&&ce(o,i)&&ce(i,o)&&(e.push(o.i,n.i,i.i),le(n),le(n.next),n=t=i,r=!0),n=n.next}while(n!==t);return r?$(n):n}function sn(t,e,n,r,o){let i=t;do{let s=i.next.next;for(;s!==i.prev;){if(i.i!==s.i&&bn(i,s)){let u=dt(i,s);i=$(i,i.next),u=$(u,u.next),Ae(i,e,n,r,o),Ae(u,e,n,r,o);return}s=s.next}i=i.next}while(i!==t)}var Be=!1;function un(t,e,n,r){let o=[];for(let i=0,s=e.length;i<s;i++){let u=e[i]*r,c=i<s-1?e[i+1]*r:t.length,l=ft(t,u,c,r,!1);l===l.next&&se.add(l),o.push(pn(l))}o.sort(cn),fn(t.length/r,e.length),ht(n,n),Be=!0;for(let i=0;i<o.length;i++)n=ln(o[i],n);return Be=!1,$(n)}function cn(t,e){return t.x-e.x||t.y-e.y||(t.next.y-t.y)/(t.next.x-t.x)-(e.next.y-e.y)/(e.next.x-e.x)}function ln(t,e){let n=hn(t,e);if(!n)return e;let r=dt(n,t),o=r.next;return ht(n,o.next),$(r,r.next),$(n,n.next)}var at=16,T=new Float64Array(0),ye=0,Ie=[],Ee=[];function fn(t,e){let n=Math.ceil((t+2*e)/at)+e+2;T.length<n*4&&(T=new Float64Array(n*4)),ye=0}function ht(t,e){let n=t;do{let r=ye++;Ie[r]=n;let o=1/0,i=1/0,s=-1/0,u=-1/0,c=0;do{let f=n.next;n.z=r,n.x<o&&(o=n.x),n.x>s&&(s=n.x),n.y<i&&(i=n.y),n.y>u&&(u=n.y),f.x<o&&(o=f.x),f.x>s&&(s=f.x),f.y<i&&(i=f.y),f.y>u&&(u=f.y),n=f}while(++c<at&&n!==e);Ee[r]=n;let l=r*4;T[l]=o,T[l+1]=i,T[l+2]=s,T[l+3]=u}while(n!==e)}function an(t,e){let n=t.z*4;e.x<T[n]&&(T[n]=e.x),e.y<T[n+1]&&(T[n+1]=e.y),e.x>T[n+2]&&(T[n+2]=e.x),e.y>T[n+3]&&(T[n+3]=e.y)}function ut(t){let e=Ee[t];for(;e.prev.next!==e;)e=e.next;return Ee[t]=e,e}function ct(t){let e=Ie[t];for(;e.prev.next!==e;)e=e.next;return Ie[t]=e,e}function hn(t,e){let n=e,r=t.x,o=t.y,i=-1/0,s;if(ue(t,n))return n;for(let a=0,h=0;a<ye;a++,h+=4){if(o<T[h+1]||o>T[h+3]||T[h]>r||T[h+2]<=i)continue;let d=ut(a);n=ct(a);do{if(n.prev.next===n){if(ue(t,n.next))return n.next;if(o<=n.y&&o>=n.next.y&&n.next.y!==n.y){let g=n.x+(o-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(g<=r&&g>i&&(i=g,s=n.x<n.next.x?n:n.next,g===r))return s}}n=n.next}while(n!==d)}if(!s)return null;let u=s.x,c=s.y,l=Math.min(o,c),f=Math.max(o,c),m=1/0;for(let a=0,h=0;a<ye;a++,h+=4){if(T[h+2]<u||T[h]>r||T[h+3]<l||T[h+1]>f)continue;let d=ut(a);n=ct(a);do{if(n.prev.next===n&&r>=n.x&&n.x>=u&&r!==n.x&&ge(o<c?r:i,o,u,c,o<c?i:r,o,n.x,n.y)){let g=Math.abs(o-n.y)/(r-n.x);(ce(n,t)||n.y===o&&n.next.y===o&&n.next.x>r)&&(g<m||g===m&&(n.x>s.x||n.x===s.x&&mn(s,n)))&&(s=n,m=g)}n=n.next}while(n!==d)}return s}function mn(t,e){return L(t.prev,t,e.prev)<0&&L(e.next,t,t.next)<0}var G=[],re=[],Z=new Uint32Array(0),oe=new Uint32Array(0),ie=new Uint32Array(256);function dn(t,e,n,r){let o=t,i=0;do o.z=Te(o.x,o.y,e,n,r),G[i++]=o,o=o.next;while(o!==t);xn(i);let s=null;for(let u=0;u<i;u++){let c=G[u];c.prevZ=s,s&&(s.nextZ=c),s=c}s.nextZ=null}function xn(t){if(t<=32){for(let e=1;e<t;e++){let n=G[e],r=n.z,o=e-1;for(;o>=0&&G[o].z>r;)G[o+1]=G[o],o--;G[o+1]=n}return}Z.length<t&&(Z=new Uint32Array(t),oe=new Uint32Array(t),re=new Array(t));for(let e=0;e<t;e++)Z[e]=G[e].z;pe(t,G,Z,re,oe,0),pe(t,re,oe,G,Z,8),pe(t,G,Z,re,oe,16),pe(t,re,oe,G,Z,24)}function pe(t,e,n,r,o,i){ie.fill(0);for(let u=0;u<t;u++)ie[n[u]>>>i&255]++;let s=0;for(let u=0;u<256;u++){let c=ie[u];ie[u]=s,s+=c}for(let u=0;u<t;u++){let c=n[u],l=ie[c>>>i&255]++;r[l]=e[u],o[l]=c}}function Te(t,e,n,r,o){return t=(t-n)*o|0,e=(e-r)*o|0,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,t|e<<1}function pn(t){let e=t,n=t;do(e.x<n.x||e.x===n.x&&e.y<n.y)&&(n=e),e=e.next;while(e!==t);return n}function ge(t,e,n,r,o,i,s,u){return(o-s)*(e-u)>=(t-s)*(i-u)&&(t-s)*(r-u)>=(n-s)*(e-u)&&(n-s)*(i-u)>=(o-s)*(r-u)}function bn(t,e){let n=ue(t,e)&&L(t.prev,t,t.next)>0&&L(e.prev,e,e.next)>0;return t.next.i!==e.i&&(n||ce(t,e)&&ce(e,t)&&(L(t.prev,t,e.prev)!==0||L(t,e.prev,e)!==0))&&!yn(t,e)&&(n||gn(t,e))}function L(t,e,n){return(e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y)}function ue(t,e){return t.x===e.x&&t.y===e.y}function mt(t,e,n,r,o=!0){let i=L(t,e,n),s=L(t,e,r),u=L(n,r,t),c=L(n,r,e);return(i>0&&s<0||i<0&&s>0)&&(u>0&&c<0||u<0&&c>0)?!0:o?!!(i===0&&be(t,n,e)||s===0&&be(t,r,e)||u===0&&be(n,t,r)||c===0&&be(n,e,r)):!1}function be(t,e,n){return e.x<=Math.max(t.x,n.x)&&e.x>=Math.min(t.x,n.x)&&e.y<=Math.max(t.y,n.y)&&e.y>=Math.min(t.y,n.y)}function yn(t,e){let n=Math.min(t.x,e.x),r=Math.max(t.x,e.x),o=Math.min(t.y,e.y),i=Math.max(t.y,e.y),s=t;do{let u=s.next;if(s.x>r&&u.x>r||s.x<n&&u.x<n||s.y>i&&u.y>i||s.y<o&&u.y<o){s=u;continue}if(s.i!==t.i&&u.i!==t.i&&s.i!==e.i&&u.i!==e.i&&mt(s,u,t,e))return!0;s=u}while(s!==t);return!1}function ce(t,e){return L(t.prev,t,t.next)<0?L(t,e,t.next)>=0&&L(t,t.prev,e)>=0:L(t,e,t.prev)<0||L(t,t.next,e)<0}function gn(t,e){let n=t,r=!1,o=(t.x+e.x)/2,i=(t.y+e.y)/2;do{let s=n.next;n.y>i!=s.y>i&&o<(s.x-n.x)*(i-n.y)/(s.y-n.y)+n.x&&(r=!r),n=s}while(n!==t);return r}function dt(t,e){let n=Ve(t.i,t.x,t.y),r=Ve(e.i,e.x,e.y),o=t.next,i=e.prev;return t.next=e,e.prev=t,n.next=o,o.prev=n,r.next=n,n.prev=r,i.next=r,r.prev=i,r}function lt(t,e,n,r){let o=Ve(t,e,n);return r?(o.next=r.next,o.prev=r,r.next.prev=o,r.next=o):(o.prev=o,o.next=o),o}function le(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ),Be&&an(t.prev,t.next)}function Ve(t,e,n){return{i:t,x:e,y:n,prev:null,next:null,z:0,prevZ:null,nextZ:null}}function wn(t,e,n,r){let o=0;for(let i=e,s=n-r;i<n;i+=r)o+=(t[s]-t[i])*(t[i+1]+t[s+1]),s=i;return o}var xt=23283064365386963e-26,Fn=12,pt=typeof TextDecoder>"u"?null:new TextDecoder("utf-8"),Le=0,we=1,fe=2,Fe=5,ae=class{constructor(e=new Uint8Array(16)){this.buf=ArrayBuffer.isView(e)?e:new Uint8Array(e),this.dataView=new DataView(this.buf.buffer),this.pos=0,this.type=0,this.length=this.buf.length}readFields(e,n,r=this.length){for(;this.pos<r;){let o=this.readVarint(),i=o>>3,s=this.pos;this.type=o&7,e(i,n,this),this.pos===s&&this.skip(o)}return n}readMessage(e,n){return this.readFields(e,n,this.readVarint()+this.pos)}readFixed32(){let e=this.dataView.getUint32(this.pos,!0);return this.pos+=4,e}readSFixed32(){let e=this.dataView.getInt32(this.pos,!0);return this.pos+=4,e}readFixed64(){let e=this.dataView.getUint32(this.pos,!0)+this.dataView.getUint32(this.pos+4,!0)*4294967296;return this.pos+=8,e}readSFixed64(){let e=this.dataView.getUint32(this.pos,!0)+this.dataView.getInt32(this.pos+4,!0)*4294967296;return this.pos+=8,e}readFloat(){let e=this.dataView.getFloat32(this.pos,!0);return this.pos+=4,e}readDouble(){let e=this.dataView.getFloat64(this.pos,!0);return this.pos+=8,e}readVarint(e){let n=this.buf,r,o;return o=n[this.pos++],r=o&127,o<128||(o=n[this.pos++],r|=(o&127)<<7,o<128)||(o=n[this.pos++],r|=(o&127)<<14,o<128)||(o=n[this.pos++],r|=(o&127)<<21,o<128)?r:(o=n[this.pos],r|=(o&15)<<28,Mn(r,e,this))}readVarint64(){return this.readVarint(!0)}readSVarint(){let e=this.readVarint();return e%2===1?(e+1)/-2:e/2}readBoolean(){return!!this.readVarint()}readString(){let e=this.readVarint()+this.pos,n=this.pos;return this.pos=e,e-n>=Fn&&pt?pt.decode(this.buf.subarray(n,e)):Cn(this.buf,n,e)}readBytes(){let e=this.readVarint()+this.pos,n=this.buf.subarray(this.pos,e);return this.pos=e,n}readPackedVarint(e=[],n){let r=this.readPackedEnd();for(;this.pos<r;)e.push(this.readVarint(n));return e}readPackedSVarint(e=[]){let n=this.readPackedEnd();for(;this.pos<n;)e.push(this.readSVarint());return e}readPackedBoolean(e=[]){let n=this.readPackedEnd();for(;this.pos<n;)e.push(this.readBoolean());return e}readPackedFloat(e=[]){let n=this.readPackedEnd();for(;this.pos<n;)e.push(this.readFloat());return e}readPackedDouble(e=[]){let n=this.readPackedEnd();for(;this.pos<n;)e.push(this.readDouble());return e}readPackedFixed32(e=[]){let n=this.readPackedEnd();for(;this.pos<n;)e.push(this.readFixed32());return e}readPackedSFixed32(e=[]){let n=this.readPackedEnd();for(;this.pos<n;)e.push(this.readSFixed32());return e}readPackedFixed64(e=[]){let n=this.readPackedEnd();for(;this.pos<n;)e.push(this.readFixed64());return e}readPackedSFixed64(e=[]){let n=this.readPackedEnd();for(;this.pos<n;)e.push(this.readSFixed64());return e}readPackedEnd(){return this.type===fe?this.readVarint()+this.pos:this.pos+1}skip(e){let n=e&7;if(n===Le)for(;this.buf[this.pos++]>127;);else if(n===fe)this.pos=this.readVarint()+this.pos;else if(n===Fe)this.pos+=4;else if(n===we)this.pos+=8;else throw new Error(`Unimplemented type: ${n}`)}writeTag(e,n){this.writeVarint(e<<3|n)}realloc(e){let n=this.length||16;for(;n<this.pos+e;)n*=2;if(n!==this.length){let r=new Uint8Array(n);r.set(this.buf),this.buf=r,this.dataView=new DataView(r.buffer),this.length=n}}finish(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)}writeFixed32(e){this.realloc(4),this.dataView.setInt32(this.pos,e,!0),this.pos+=4}writeSFixed32(e){this.realloc(4),this.dataView.setInt32(this.pos,e,!0),this.pos+=4}writeFixed64(e){this.realloc(8),this.dataView.setInt32(this.pos,e&-1,!0),this.dataView.setInt32(this.pos+4,Math.floor(e*xt),!0),this.pos+=8}writeSFixed64(e){this.realloc(8),this.dataView.setInt32(this.pos,e&-1,!0),this.dataView.setInt32(this.pos+4,Math.floor(e*xt),!0),this.pos+=8}writeVarint(e){if(e=+e||0,e>268435455||e<0){Rn(e,this);return}this.realloc(4),this.buf[this.pos++]=e&127|(e>127?128:0),!(e<=127)&&(this.buf[this.pos++]=(e>>>=7)&127|(e>127?128:0),!(e<=127)&&(this.buf[this.pos++]=(e>>>=7)&127|(e>127?128:0),!(e<=127)&&(this.buf[this.pos++]=e>>>7&127)))}writeSVarint(e){this.writeVarint(e<0?-e*2-1:e*2)}writeBoolean(e){this.writeVarint(+e)}writeString(e){e=String(e),this.realloc(e.length*4),this.pos++;let n=this.pos;this.pos=_n(this.buf,e,this.pos);let r=this.pos-n;r>=128&&bt(n,r,this),this.pos=n-1,this.writeVarint(r),this.pos+=r}writeFloat(e){this.realloc(4),this.dataView.setFloat32(this.pos,e,!0),this.pos+=4}writeDouble(e){this.realloc(8),this.dataView.setFloat64(this.pos,e,!0),this.pos+=8}writeBytes(e){let n=e.length;this.writeVarint(n),this.realloc(n);for(let r=0;r<n;r++)this.buf[this.pos++]=e[r]}writeRawMessage(e,n){this.pos++;let r=this.pos;e(n,this);let o=this.pos-r;o>=128&&bt(r,o,this),this.pos=r-1,this.writeVarint(o),this.pos+=o}writeMessage(e,n,r){this.writeTag(e,fe),this.writeRawMessage(n,r)}writePackedVarint(e,n){n.length&&this.writeMessage(e,kn,n)}writePackedSVarint(e,n){n.length&&this.writeMessage(e,Pn,n)}writePackedBoolean(e,n){n.length&&this.writeMessage(e,In,n)}writePackedFloat(e,n){n.length&&this.writeMessage(e,An,n)}writePackedDouble(e,n){n.length&&this.writeMessage(e,Bn,n)}writePackedFixed32(e,n){n.length&&this.writeMessage(e,En,n)}writePackedSFixed32(e,n){n.length&&this.writeMessage(e,Tn,n)}writePackedFixed64(e,n){n.length&&this.writeMessage(e,Vn,n)}writePackedSFixed64(e,n){n.length&&this.writeMessage(e,Ln,n)}writeBytesField(e,n){this.writeTag(e,fe),this.writeBytes(n)}writeFixed32Field(e,n){this.writeTag(e,Fe),this.writeFixed32(n)}writeSFixed32Field(e,n){this.writeTag(e,Fe),this.writeSFixed32(n)}writeFixed64Field(e,n){this.writeTag(e,we),this.writeFixed64(n)}writeSFixed64Field(e,n){this.writeTag(e,we),this.writeSFixed64(n)}writeVarintField(e,n){this.writeTag(e,Le),this.writeVarint(n)}writeSVarintField(e,n){this.writeTag(e,Le),this.writeSVarint(n)}writeStringField(e,n){this.writeTag(e,fe),this.writeString(n)}writeFloatField(e,n){this.writeTag(e,Fe),this.writeFloat(n)}writeDoubleField(e,n){this.writeTag(e,we),this.writeDouble(n)}writeBooleanField(e,n){this.writeVarintField(e,+n)}};function Mn(t,e,n){let r=n.buf,o,i;if(i=r[n.pos++],o=(i&112)>>4,i<128||(i=r[n.pos++],o|=(i&127)<<3,i<128)||(i=r[n.pos++],o|=(i&127)<<10,i<128)||(i=r[n.pos++],o|=(i&127)<<17,i<128)||(i=r[n.pos++],o|=(i&127)<<24,i<128)||(i=r[n.pos++],o|=(i&1)<<31,i<128))return W(t,o,e);throw new Error("Expected varint not more than 10 bytes")}function W(t,e,n){return n?e*4294967296+(t>>>0):(e>>>0)*4294967296+(t>>>0)}function Rn(t,e){let n,r;if(t>=0?(n=t%4294967296|0,r=t/4294967296|0):(n=~(-t%4294967296),r=~(-t/4294967296),n^4294967295?n=n+1|0:(n=0,r=r+1|0)),t>=18446744073709552e3||t<-18446744073709552e3)throw new Error("Given varint doesn\'t fit into 10 bytes");e.realloc(10),Sn(n,r,e),vn(r,e)}function Sn(t,e,n){n.buf[n.pos++]=t&127|128,t>>>=7,n.buf[n.pos++]=t&127|128,t>>>=7,n.buf[n.pos++]=t&127|128,t>>>=7,n.buf[n.pos++]=t&127|128,t>>>=7,n.buf[n.pos]=t&127}function vn(t,e){let n=(t&7)<<4;e.buf[e.pos++]|=n|((t>>>=3)?128:0),t&&(e.buf[e.pos++]=t&127|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=t&127|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=t&127|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=t&127|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=t&127)))))}function bt(t,e,n){let r=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(Math.LN2*7));n.realloc(r);for(let o=n.pos-1;o>=t;o--)n.buf[o+r]=n.buf[o]}function kn(t,e){for(let n=0;n<t.length;n++)e.writeVarint(t[n])}function Pn(t,e){for(let n=0;n<t.length;n++)e.writeSVarint(t[n])}function An(t,e){for(let n=0;n<t.length;n++)e.writeFloat(t[n])}function Bn(t,e){for(let n=0;n<t.length;n++)e.writeDouble(t[n])}function In(t,e){for(let n=0;n<t.length;n++)e.writeBoolean(t[n])}function En(t,e){for(let n=0;n<t.length;n++)e.writeFixed32(t[n])}function Tn(t,e){for(let n=0;n<t.length;n++)e.writeSFixed32(t[n])}function Vn(t,e){for(let n=0;n<t.length;n++)e.writeFixed64(t[n])}function Ln(t,e){for(let n=0;n<t.length;n++)e.writeSFixed64(t[n])}function Cn(t,e,n){let r="",o=e;for(;o<n;){let i=t[o],s=null,u=i>239?4:i>223?3:i>191?2:1;if(o+u>n)break;let c,l,f;u===1?i<128&&(s=i):u===2?(c=t[o+1],(c&192)===128&&(s=(i&31)<<6|c&63,s<=127&&(s=null))):u===3?(c=t[o+1],l=t[o+2],(c&192)===128&&(l&192)===128&&(s=(i&15)<<12|(c&63)<<6|l&63,(s<=2047||s>=55296&&s<=57343)&&(s=null))):u===4&&(c=t[o+1],l=t[o+2],f=t[o+3],(c&192)===128&&(l&192)===128&&(f&192)===128&&(s=(i&15)<<18|(c&63)<<12|(l&63)<<6|f&63,(s<=65535||s>=1114112)&&(s=null))),s===null?(s=65533,u=1):s>65535&&(s-=65536,r+=String.fromCharCode(s>>>10&1023|55296),s=56320|s&1023),r+=String.fromCharCode(s),o+=u}return r}function _n(t,e,n){for(let r=0,o,i;r<e.length;r++){if(o=e.charCodeAt(r),o>55295&&o<57344)if(i)if(o<56320){t[n++]=239,t[n++]=191,t[n++]=189,i=o;continue}else o=i-55296<<10|o-56320|65536,i=null;else{o>56319||r+1===e.length?(t[n++]=239,t[n++]=191,t[n++]=189):i=o;continue}else i&&(t[n++]=239,t[n++]=191,t[n++]=189,i=null);o<128?t[n++]=o:(o<2048?t[n++]=o>>6|192:(o<65536?t[n++]=o>>12|224:(t[n++]=o>>18|240,t[n++]=o>>12&63|128),t[n++]=o>>6&63|128),t[n++]=o&63|128)}return n}var Ce=class t{constructor(e,n,r,o){this.pbf=e;this.keys=n;this.values=r;this.extent=o;this.type=0;this.properties={};this.geomOffset=-1}static read(e,n,r,o,i){let s=new t(e,r,o,i);return e.readFields(Dn,s,n),s}loadGeometry(){if(this.geomOffset<0)return[];let e=this.pbf,n=e.pos;e.pos=this.geomOffset;let r=e.readVarint()+e.pos,o=1,i=0,s=0,u=0,c=[],l=[];for(;e.pos<r;){if(i<=0){let f=e.readVarint();o=f&7,i=f>>3}if(i--,o===1||o===2)s+=e.readSVarint(),u+=e.readSVarint(),o===1&&(l.length&&c.push(l),l=[]),l.push(s,u);else if(o===7)l.length>=2&&l.push(l[0],l[1]);else throw new Error(`[osmgl] \\u043D\\u0435\\u0438\\u0437\\u0432\\u0435\\u0441\\u0442\\u043D\\u0430\\u044F \\u043A\\u043E\\u043C\\u0430\\u043D\\u0434\\u0430 \\u0433\\u0435\\u043E\\u043C\\u0435\\u0442\\u0440\\u0438\\u0438 MVT: ${o}`)}return l.length&&c.push(l),e.pos=n,c}bbox(){let e=this.loadGeometry(),n=1/0,r=1/0,o=-1/0,i=-1/0;for(let s of e)for(let u=0;u<s.length;u+=2)s[u]<n&&(n=s[u]),s[u]>o&&(o=s[u]),s[u+1]<r&&(r=s[u+1]),s[u+1]>i&&(i=s[u+1]);return[n,r,o,i]}};function Dn(t,e,n){n&&(t===1?e.id=n.readVarint():t===2?Un(n,e):t===3?e.type=n.readVarint():t===4&&(e.geomOffset=n.pos,n.skip(2)))}function Un(t,e){let n=t.readVarint()+t.pos;for(;t.pos<n;){let r=e.keys[t.readVarint()],o=e.values[t.readVarint()];r!==void 0&&(e.properties[r]=o)}}var _e=class t{constructor(e){this.pbf=e;this.version=1;this.name="";this.extent=4096;this.featureOffsets=[];this.keys=[];this.values=[]}static read(e,n){let r=new t(e);return e.readFields(On,r,n),r}get length(){return this.featureOffsets.length}feature(e){let n=this.pbf;n.pos=this.featureOffsets[e];let r=n.readVarint()+n.pos;return Ce.read(n,r,this.keys,this.values,this.extent)}*features(){for(let e=0;e<this.featureOffsets.length;e++)yield this.feature(e)}};function On(t,e,n){n&&(t===15?e.version=n.readVarint():t===1?e.name=n.readString():t===5?e.extent=n.readVarint():t===2?e.featureOffsets.push(n.pos):t===3?e.keys.push(n.readString()):t===4&&e.values.push(Gn(n)))}function Gn(t){let e=t.readVarint()+t.pos,n=null;for(;t.pos<e;){let r=t.readVarint()>>3;r===1?n=t.readString():r===2?n=t.readFloat():r===3?n=t.readDouble():r===4?n=t.readVarint64():r===5?n=t.readVarint():r===6?n=t.readSVarint():r===7?n=t.readBoolean():t.skip(r)}return n}var Me=class{constructor(e){this.layers={};new ae(e instanceof Uint8Array?e:new Uint8Array(e)).readFields((r,o,i)=>{if(r===3&&i){let s=_e.read(i,i.readVarint()+i.pos);s.length&&(this.layers[s.name]=s)}},null)}};function K(t){let e=[],n=null;for(let r of t){if(r.length<6)continue;let o=Hn(r);o!==0&&(o>0?(n&&e.push(n),n={outer:r,holes:[]}):n&&n.holes.push(r))}return n&&e.push(n),e}function Hn(t){let e=0;for(let n=0,r=t.length-2;n<t.length;r=n,n+=2)e+=(t[r]-t[n])*(t[n+1]+t[r+1]);return e/2}function _(t,e){if(!t)return!0;let n=t[0];switch(n){case"all":return t.slice(1).every(r=>_(r,e));case"any":return t.slice(1).some(r=>_(r,e));case"!":return!_(t[1],e);case"has":return e[t[1]]!=null;case"!has":return e[t[1]]==null;case"in":{let r=e[t[1]];return r==null?!1:t.slice(2).includes(r)}case"!in":{let r=e[t[1]];return r==null?!0:!t.slice(2).includes(r)}default:{let r=e[t[1]],o=t[2];if(r==null)return n==="!=";switch(n){case"==":return r===o;case"!=":return r!==o;case">":return r>o;case">=":return r>=o;case"<":return r<o;case"<=":return r<=o;default:return!0}}}}var Nn=Math.PI/8,Xn=.35,zn=32,yt=.25,gt=.07;function X(t,e){let n=e.radius;if(!(n>0))return t;let r=t.length/2-1;if(r<3)return t;let o=Math.max(2,Math.round(e.segments??4)),i=Math.max(e.minCutRatio??Xn,0),s=e.extent,u=[];for(let c=0;c<r;c++){let l=t[c*2],f=t[c*2+1],m=t[(c+r-1)%r*2],a=t[(c+r-1)%r*2+1],h=t[(c+1)%r*2],d=t[(c+1)%r*2+1],g=l-m,x=f-a,p=h-l,w=d-f,b=Math.hypot(g,x),y=Math.hypot(p,w);if(b<1e-6||y<1e-6){u.push(l,f);continue}let F=g/b,M=x/b,v=p/y,R=w/y;if(e.keep?.[c]){u.push(l,f);continue}let S=F*v+M*R;if(S>.985){u.push(l,f);continue}if(s!==void 0&&(De(l,f,s)||De(m,a,s)||De(h,d,s))){u.push(l,f);continue}let P=Math.min(n,b*.4,y*.4);if(P<n*i){u.push(l,f);continue}let V=l-F*P,E=f-M*P,I=l+v*P,A=f+R*P,k=Math.acos(Math.max(-1,Math.min(1,S))),B=Math.min(Nn,Math.PI/2/o),C=Math.ceil(k/B-1e-6),O=e.maxChord&&e.maxChord>0?Math.ceil(P/Math.tan(k/2)*k/e.maxChord):0,z=Math.max(1,Math.min(zn,Math.max(Math.min(o,C),O)));u.push(V,E);for(let H=1;H<z;H++){let D=H/z,U=1-D;u.push(U*U*V+2*U*D*l+D*D*I,U*U*E+2*U*D*f+D*D*A)}u.push(I,A)}return u.length<6?t:(u.push(u[0],u[1]),u)}var De=(t,e,n)=>t<=0||e<=0||t>=n||e>=n;function J(t,e){let n=wt(t.outer,e);if(!n)return null;let r=[];for(let o of t.holes){let i=wt(o,e);i&&r.push(i)}return{outer:n,holes:r}}function wt(t,e){let n=[];for(let r=0;r<t.length-2;r+=2)n.push(t[r],t[r+1]);if(n.length<6)return null;for(let r=0;r<4;r++){let o=n;n=[];let i=o.length/2;if(i===0)return null;for(let s=0;s<i;s++){let u=o[s*2],c=o[s*2+1],l=o[(s+i-1)%i*2],f=o[(s+i-1)%i*2+1],m=Ft(u,c,r,e),a=Ft(l,f,r,e);if(m!==a){let h=Yn(l,f,u,c,r,e);n.push(l+(u-l)*h,f+(c-f)*h)}m&&n.push(u,c)}}return n.length<6?null:(n.push(n[0],n[1]),n)}function Ft(t,e,n,r){return n===0?t>=0:n===1?t<=r:n===2?e>=0:e<=r}function Yn(t,e,n,r,o,i){return o===0?(0-t)/(n-t):o===1?(i-t)/(n-t):o===2?(0-e)/(r-e):(i-e)/(r-e)}function Re(t,e,n,r,o){return t===0&&n===0||t===o&&n===o||e===0&&r===0||e===o&&r===o}function Mt(t,e){for(let n=0;n<t.length;n+=2)if(t[n]<=0||t[n]>=e||t[n+1]<=0||t[n+1]>=e)return!0;return!1}var Ge=18,He=4,Pt=65535/He,Zn=9,$n=1,jn=0,Wn=1,Kn=2;var Rt=0,Jn=1,St=2,Qn=3,qn=.47;function At(t,e,n,r={}){let o=r.metersPerUnit&&r.metersPerUnit>0?r.metersPerUnit:qn,i=Math.max(1024,t.length*48),s=new ArrayBuffer(i*Ge),u={verts:new DataView(s),vertsU8:new Uint8Array(s),vertOffset:0,vertexCount:0,indices:[],featureIds:[],ensure:()=>{}};u.ensure=a=>c(a);let c=a=>{if(u.vertexCount+a<=i)return;i=Math.max(i*2,u.vertexCount+a);let h=new ArrayBuffer(i*Ge);new Uint8Array(h).set(u.vertsU8.subarray(0,u.vertOffset)),s=h,u.verts=new DataView(h),u.vertsU8=new Uint8Array(h)};for(let a of t.features()){if(a.type!==3||!_(n,a.properties))continue;let h=wr(a.properties),d=Fr(a.properties,h);if(h<=d)continue;let g=Rr(a.properties)??Number(a.id??0),x=gr(g>>>0),p=yr(x,a.properties),w=br(a.properties,h),b=K(a.loadGeometry());for(let y of b){let F=J(y,e);if(!F)continue;let M=Mt(F.outer,e),v=(r.cornerRadius??0)/o,R={radius:v,segments:r.cornerSegments,extent:e,minCutRatio:0},S=v>0?{outer:X(F.outer,R),holes:F.holes.map(k=>X(k,R))}:F,P=S.outer.length/2+S.holes.reduce((k,B)=>k+B.length/2,0);c(P*5+32);let V=S.holes.length||M?null:rr(S.outer),E=V?lr(a.properties,V,h,x,o):null,I=null,A=[];if(E&&V){let k=Bt(hr(S.outer,o),V,E.shape);A=mr(k,S.outer);let B=dr(k,A);if(B>1e-6){let C=Math.min(Math.max(B*o*sr,cr),ur);I=xr(k,C/B,h)}}vt(u,S.outer,d,h,g,p,w,o,e,I);for(let k of S.holes)vt(u,k,d,h,g,p,w,o,e,null);I?pr(u,A,I,h,g,p,w,o):nr(u,S.outer,S.holes,h,g,p,w)}}if(!u.indices.length)return null;let l=new Uint32Array(u.indices),f=new Float64Array(u.featureIds);return{vertices:s.slice(0,u.vertOffset),indices:l.buffer,featureIds:f.buffer,vertexCount:u.vertexCount,indexCount:l.length,extent:e}}var Ne=(t,e)=>t|e<<2,Ue=t=>Math.max(0,Math.min(65535,Math.round(Math.min(t,Pt)*He)));function Q(t,e,n,r,o,i,s,u,c,l,f=0,m=0,a=0){let h=t.vertOffset;return t.verts.setInt16(h,Math.round(e),!0),t.verts.setInt16(h+2,Math.round(n),!0),t.verts.setUint16(h+4,Math.round(Math.min(r,Pt)*He),!0),t.vertsU8[h+6]=c,t.vertsU8[h+7]=u,t.verts.setInt8(h+8,Oe(Math.round(o*127))),t.verts.setInt8(h+9,Oe(Math.round(i*127))),t.verts.setInt8(h+10,Oe(Math.round(s*127))),t.vertsU8[h+11]=l,t.verts.setUint16(h+12,Ue(f),!0),t.verts.setUint16(h+14,Ue(m),!0),t.verts.setUint16(h+16,Ue(a),!0),t.vertOffset+=Ge,t.vertexCount++}function vt(t,e,n,r,o,i,s,u,c,l=null){let f=e.length/2;if(f<3)return;let m=Ne(jn,s),a=tr(e,u),h=r-n,d=new Float64Array(f*2),g=new Uint8Array(f);{let x=new Float64Array(f*2);for(let p=0;p<f-1;p++){let w=e[p*2+2]-e[p*2],b=e[p*2+3]-e[p*2+1],y=Math.hypot(w,b)||1;x[p*2]=b/y,x[p*2+1]=-w/y}for(let p=0;p<f-1;p++){let w=(p+f-2)%(f-1),b=x[w*2]*x[p*2]+x[w*2+1]*x[p*2+1],y=x[w*2]+x[p*2],F=x[w*2+1]+x[p*2+1],M=Math.hypot(y,F);b>.5&&M>1e-6&&(d[p*2]=y/M,d[p*2+1]=F/M,g[p]=1)}}for(let x=0;x<f-1;x++){let p=e[x*2],w=e[x*2+1],b=e[x*2+2],y=e[x*2+3];if(p===b&&w===y||Re(p,w,b,y,c))continue;let F=b-p,M=y-w,v=Math.hypot(F,M)||1,R=M/v,S=-F/v,P=a.offset[x],V=a.width[x],E=[0,1];if(l){for(let A=0;A<l.length;A++)for(let k=A+1;k<l.length;k++){let B=j(l[A],p,w)-j(l[k],p,w),C=j(l[A],b,y)-j(l[k],b,y);if(B===C)continue;let O=B/(B-C);O>1e-4&&O<1-1e-4&&E.push(O)}E.sort((A,k)=>A-k)}let I=(A,k)=>{if(!l)return r;let B=1/0;for(let C of l)B=Math.min(B,j(C,A,k));return Math.max(r,B)};for(let A=0;A+1<E.length;A++){let k=E[A],B=E[A+1];if(B-k<1e-6)continue;let C=p+F*k,O=w+M*k,z=p+F*B,H=w+M*B,D=P+v*k*u,U=P+v*B*u,N=(x+1)%(f-1),de=g[x]?d[x*2]:R,ve=g[x]?d[x*2+1]:S,xe=g[N]?d[N*2]:R,ke=g[N]?d[N*2+1]:S,We=R+(de-R)*(1-k),Ke=S+(ve-S)*(1-k),Je=R+(xe-R)*B,Qe=S+(ke-S)*B,qe=Math.hypot(We,Ke)||1,et=Math.hypot(Je,Qe)||1,tt=We/qe,nt=Ke/qe,rt=Je/et,ot=Qe/et;t.ensure(4);let it=Q(t,C,O,n,tt,nt,0,0,i,m,D,V,h),en=Q(t,z,H,n,rt,ot,0,0,i,m,U,V,h),tn=Q(t,C,O,I(C,O),tt,nt,0,255,i,m,D,V,h),st=Q(t,z,H,I(z,H),rt,ot,0,255,i,m,U,V,h);t.indices.push(it,st,en,it,tn,st),t.featureIds.push(o,o)}}}var er=.9976;function tr(t,e){let n=t.length/2-1,r=[];for(let c=0;c<n;c++){let l=t[c*2+2]-t[c*2],f=t[c*2+3]-t[c*2+1],m=Math.hypot(l,f);r.push(m>0?{x:l/m,y:f/m,len:m*e}:{x:0,y:0,len:0})}let o=(c,l)=>r[c].len>0&&r[l].len>0&&r[c].x*r[l].x+r[c].y*r[l].y>=er,i=0;for(;i<n&&o((i-1+n)%n,i);)i++;i>=n&&(i=0);let s=new Array(n).fill(0),u=new Array(n).fill(0);for(let c=0;c<n;){let l=(i+c)%n,f=[l],m=r[l].len,a=c+1;for(;a<n;){let d=(i+a)%n;if(!o((i+a-1)%n,d))break;f.push(d),m+=r[d].len,a++}let h=0;for(let d of f)s[d]=h,u[d]=m,h+=r[d].len;c=a}return{offset:s,width:u}}function nr(t,e,n,r,o,i,s){let u=[],c=[];for(let a=0;a<e.length;a++)u.push(e[a]);for(let a of n){c.push(u.length/2);for(let h=0;h<a.length;h++)u.push(a[h])}let l=Y(u,c.length?c:void 0,2);if(!l.length)return;let f=Ne(Wn,s),m=t.vertexCount;for(let a=0;a<u.length;a+=2)Q(t,u[a],u[a+1],r,0,0,1,255,i,f);for(let a=0;a<l.length;a+=3)t.indices.push(m+l[a],m+l[a+2],m+l[a+1]),t.featureIds.push(o)}function rr(t){let e=or(t);if(e.length<3)return null;let n=Math.abs(ir(t));if(n<=0)return null;let r=null,o=1/0;for(let i=0;i<e.length;i++){let s=(i+1)%e.length,u=e[s].x-e[i].x,c=e[s].y-e[i].y,l=Math.hypot(u,c);if(l<1e-6)continue;u/=l,c/=l;let f=1/0,m=-1/0,a=1/0,h=-1/0;for(let y of e){let F=y.x*u+y.y*c,M=-y.x*c+y.y*u;F<f&&(f=F),F>m&&(m=F),M<a&&(a=M),M>h&&(h=M)}let d=m-f,g=h-a,x=d*g;if(x<=0||x>=o)continue;o=x;let p=(f+m)/2,w=(a+h)/2,b=d>=g;r={cx:p*u-w*c,cy:p*c+w*u,ax:b?u:-c,ay:b?c:u,halfLong:(b?d:g)/2,halfShort:(b?g:d)/2,fill:n/x}}return r}function or(t){let e=[];for(let i=0;i<t.length-2;i+=2)e.push({x:t[i],y:t[i+1]});if(e.length<3)return e;e.sort((i,s)=>i.x===s.x?i.y-s.y:i.x-s.x);let n=(i,s,u)=>(s.x-i.x)*(u.y-i.y)-(s.y-i.y)*(u.x-i.x),r=[];for(let i of e){for(;r.length>=2&&n(r[r.length-2],r[r.length-1],i)<=0;)r.pop();r.push(i)}let o=[];for(let i=e.length-1;i>=0;i--){let s=e[i];for(;o.length>=2&&n(o[o.length-2],o[o.length-1],s)<=0;)o.pop();o.push(s)}return r.pop(),o.pop(),r.concat(o)}function ir(t){let e=0;for(let n=0;n<t.length-2;n+=2)e+=t[n]*t[n+3]-t[n+2]*t[n+1];return e/2}var sr=Math.tan(30*Math.PI/180),ur=3.5,cr=.9;function lr(t,e,n,r,o){if(e.fill<.86)return null;let i=e.halfShort*2*o,s=e.halfLong*2*o,u=i*s,c=e.halfShort>0?e.halfLong/e.halfShort:99,l=fr(t);if(!l){if(n>15||u>600||i<3)return null;let f=r%1e3/1e3;u<30?l=f<.5?"skillion":"gabled":c<1.25?l=f<.35?"pyramidal":"hipped":l=f<.8?"gabled":"hipped"}return l==="flat"?null:{shape:l}}function fr(t){let e=String(t.roof_shape??t["roof:shape"]??"").toLowerCase();return e?e==="flat"?"flat":e==="skillion"||e==="lean_to"||e==="shed"?"skillion":e==="hipped"||e==="half-hipped"||e==="gambrel"?"hipped":e==="pyramidal"||e==="dome"||e==="conical"||e==="onion"?"pyramidal":e==="gabled"||e==="mansard"||e==="round"?"gabled":null:null}var j=(t,e,n)=>t.a*e+t.b*n+t.c;function ar(t,e,n,r){let o=t.length/2;if(o<3)return[];let i=[],s=u=>[t[u*2],t[u*2+1]];for(let u=0;u<o;u++){let[c,l]=s(u),[f,m]=s((u+o-1)%o),a=e*c+n*l+r,h=e*f+n*m+r;if(a<=0!=h<=0){let d=h/(h-a);i.push(f+(c-f)*d,m+(l-m)*d)}a<=0&&i.push(c,l)}return i}function hr(t,e){let n=.5/Math.max(e,1e-6),r=t.length/2-1;if(r<5)return t;let o=[],i=0;o.push(t[0],t[1]);for(let s=1;s<r;s++){let u=t[i*2],c=t[i*2+1],l=t[s*2],f=t[s*2+1],m=l-u,a=f-c,h=Math.hypot(m,a),d=h>1e-6;if(d){for(let g=i+1;g<s;g++)if(Math.abs((t[g*2]-u)*a-(t[g*2+1]-c)*m)/h>=n){d=!1;break}}d||(o.push(t[(s-1)*2],t[(s-1)*2+1]),i=s-1)}return o.length/2<3?t:(o.push(o[0],o[1]),o)}function Bt(t,e,n){let{ax:r,ay:o,halfLong:i}=e;if(n==="skillion"){let c=-o,l=r;return[{a:c,b:l,c:-(c*e.cx+l*e.cy)+e.halfShort}]}let s=[],u=t.length/2-1;for(let c=0;c<u;c++){let l=t[c*2],f=t[c*2+1],m=t[(c+1)%u*2],a=t[(c+1)%u*2+1],h=m-l,d=a-f,g=Math.hypot(h,d);if(g<1e-6||n==="gabled"&&Math.abs((h*r+d*o)/g)<.86)continue;let x=-d/g,p=h/g;s.push({a:x,b:p,c:-(x*l+p*f)})}return!s.length&&i>0?Bt(t,e,"hipped"):s}function mr(t,e){let n=[];for(let o=0;o<e.length-2;o+=2)n.push(e[o],e[o+1]);if(n.length<6)return[];let r=[];for(let o=0;o<t.length;o++){let i=n;for(let s=0;s<t.length&&i.length>=6;s++)s!==o&&(i=ar(i,t[o].a-t[s].a,t[o].b-t[s].b,t[o].c-t[s].c));r.push(i.length>=6?i:[])}return r}function dr(t,e){let n=0;for(let r=0;r<e.length;r++){let o=e[r];for(let i=0;i<o.length;i+=2){let s=j(t[r],o[i],o[i+1]);s>n&&(n=s)}}return n}function xr(t,e,n){return t.map(r=>({a:r.a*e,b:r.b*e,c:r.c*e+n}))}function pr(t,e,n,r,o,i,s,u){let c=Ne(Kn,s);for(let l=0;l<n.length;l++){let f=e[l];if(!f||f.length<6)continue;let m=Y(f,void 0,2);if(!m.length)continue;let a=-n[l].a/u,h=-n[l].b/u,d=Math.hypot(a,h,1),g={x:a/d,y:h/d,z:1/d};t.ensure(f.length/2);let x=t.vertexCount;for(let p=0;p<f.length;p+=2){let w=Math.max(r,j(n[l],f[p],f[p+1]));Q(t,f[p],f[p+1],w,g.x,g.y,g.z,255,i,c)}for(let p=0;p<m.length;p+=3)t.indices.push(x+m[p],x+m[p+2],x+m[p+1]),t.featureIds.push(o)}}function br(t,e){let n=String(t.class??"").toLowerCase();return n==="industrial"||n==="warehouse"||n==="hangar"||n==="construction"?Qn:n==="commercial"||n==="office"||n==="retail"||n==="supermarket"?St:n==="house"||n==="detached"||n==="garage"||n==="hut"||n==="shed"||e<=7?Rt:e>=40?St:Jn}function yr(t,e){let n=String(e.class??""),r=128;return n==="industrial"||n==="warehouse"||n==="construction"?r=96:n==="commercial"||n==="office"||n==="retail"?r=150:(n==="apartments"||n==="residential"||n==="house")&&(r=134),Math.max(0,Math.min(255,r+(t%121-60)))}function gr(t){let e=t>>>0;return e=(e>>>16^e)*73244475,e=(e>>>16^e)*73244475,e=e>>>16^e,e>>>0}function wr(t){let e=q(t.render_height)??q(t.height)??Mr(t.levels??t.building_levels??t["building:levels"]);return e&&e>0?Math.max(e,$n):Zn}function Fr(t,e){let n=q(t.render_min_height)??q(t.min_height)??q(t.base)??0;return n>0&&n<e?n:0}function Mr(t){let e=q(t);return e&&e>0?e*3:null}function q(t){if(typeof t=="number"&&isFinite(t))return t;if(typeof t=="string"){let e=parseFloat(t);if(isFinite(e))return e}return null}var Oe=t=>t>127?127:t<-127?-127:t;function Rr(t){let e=t.osm_id;if(typeof e=="number"&&Number.isFinite(e))return e;if(typeof e=="string"){let n=Number(e);if(Number.isFinite(n))return n}return null}function Sr(t,e,n,r,o){let i=r*r,s=[],u=f=>t[f*2],c=f=>t[f*2+1],l=(f,m)=>{let a=t.length/2;return t.push((u(f)+u(m))/2,(c(f)+c(m))/2),a};for(let f=0;f<e.length;f+=3){s.push([n+e[f],n+e[f+1],n+e[f+2]]);let m=0;for(;s.length&&!(++m>2e4);){let[a,h,d]=s.pop(),g=(u(a)-u(h))**2+(c(a)-c(h))**2,x=(u(h)-u(d))**2+(c(h)-c(d))**2,p=(u(d)-u(a))**2+(c(d)-c(a))**2,w=Math.max(g,x,p);if(w<=i){o.push(a,h,d);continue}if(w===g){let b=l(a,h);s.push([a,b,d],[b,h,d])}else if(w===x){let b=l(h,d);s.push([h,b,a],[b,d,a])}else{let b=l(d,a);s.push([d,b,h],[b,a,h])}}}}function It(t,e,n=0,r,o=!1,i=4096){let s=[],u=[],c=[];for(let h of t.features()){if(h.type!==3||!_(e,h.properties))continue;let d=h.properties.osm_id,g=typeof d=="number"?d:typeof d=="string"?Number(d):NaN,x=Number.isFinite(g)?g:Number(h.id??0);for(let p of K(h.loadGeometry())){let w=o?J(p,i):p;if(!w)continue;let b=[],y=[],F=r?X(w.outer,r):w.outer;for(let R=0;R<F.length;R++)b.push(F[R]);for(let R of w.holes){let S=r?X(R,r):R;y.push(b.length/2);for(let P=0;P<S.length;P++)b.push(S[P])}let M=Y(b,y.length?y:void 0,2);if(!M.length)continue;let v=s.length/2;for(let R=0;R<b.length;R++)s.push(b[R]);if(n>0){let R=[];Sr(s,M,v,n,R);for(let S=0;S<R.length;S+=3)u.push(R[S],R[S+2],R[S+1]),c.push(x);continue}for(let R=0;R<M.length;R+=3)u.push(v+M[R],v+M[R+2],v+M[R+1]),c.push(x)}}if(!u.length)return null;let l=s.length/2,f=new Int16Array(s),m=new Uint32Array(u);return{featureIds:new Float64Array(c).buffer,vertices:f.buffer,indices:m.buffer,vertexCount:l,indexCount:m.length}}function Tt(t){return{shapes:[],cells:[],extent:0,metersPerTile:t}}function Vt(t,e,n,r){if(!(n<=0)){t.extent=r;for(let o of e){let i=o.outer;if(i.length<6)continue;let s=1/0,u=1/0,c=-1/0,l=-1/0;for(let f=0;f<i.length;f+=2)i[f]<s&&(s=i[f]),i[f]>c&&(c=i[f]),i[f+1]<u&&(u=i[f+1]),i[f+1]>l&&(l=i[f+1]);t.shapes.push({outer:i,holes:o.holes,level:n,minX:s,minY:u,maxX:c,maxY:l})}t.cells=[]}}function vr(t){t.cells=Array.from({length:32*32},()=>[]);let e=t.extent/32;for(let n=0;n<t.shapes.length;n++){let r=t.shapes[n],o=ee(Math.floor(r.minX/e)),i=ee(Math.floor(r.maxX/e)),s=ee(Math.floor(r.minY/e)),u=ee(Math.floor(r.maxY/e));for(let c=s;c<=u;c++)for(let l=o;l<=i;l++)t.cells[c*32+l].push(n)}}var Lt=t=>t.shapes.length===0;function Xe(t,e,n){!t.cells.length&&t.shapes.length&&vr(t);let r=t.extent/32,o=t.cells[ee(Math.floor(n/r))*32+ee(Math.floor(e/r))];if(!o||!o.length)return 0;let i=0;for(let s of o){let u=t.shapes[s];if(u.level<=i||e<u.minX||e>u.maxX||n<u.minY||n>u.maxY||!Et(u.outer,e,n))continue;let c=!1;for(let l of u.holes)if(Et(l,e,n)){c=!0;break}c||(i=u.level)}return Math.min(Math.round(i*100),127)}function Ct(t,e){let n=[],r=[],o=t.extent>0?t.metersPerTile/t.extent:0,i=o>0?2/o:0,s=Xe(t,e[0],e[1]);n.push(e[0],e[1]),r.push(s);for(let u=0;u+3<e.length;u+=2){let c=e[u],l=e[u+1],f=e[u+2],m=e[u+3],a=Xe(t,f,m);if(a!==s&&i>0){let h=Math.hypot(f-c,m-l),d=Math.min(Math.ceil(h/i),64),g=s;for(let x=1;x<d;x++){let p=x/d,w=c+(f-c)*p,b=l+(m-l)*p,y=Xe(t,w,b);y!==g&&(n.push(w,b),r.push(y),g=y)}}n.push(f,m),r.push(a),s=a}return{pts:n,levels:r}}var ee=t=>t<0?0:t>31?31:t;function Et(t,e,n){let r=!1,o=t.length/2;for(let i=0,s=o-1;i<o;s=i++){let u=t[i*2],c=t[i*2+1],l=t[s*2],f=t[s*2+1];c>n!=f>n&&e<(l-u)*(n-c)/(f-c)+u&&(r=!r)}return r}var $e=16,kr=64,Pr=0,Ar=1,_t=2,Br=3,Se=1;function Ht(t,e,n,r){let o=r.metersPerUnit>0?r.metersPerUnit:.5,i=r.elevation,s=r.base??0,u=Math.max(r.bevel??0,0)/o,c=Math.max(r.bevelDrop??0,0),l=Math.max(r.cornerRadius??0,0)/o,f=Math.max(512,t.length*24),m=new ArrayBuffer(f*$e),a={view:new DataView(m),bytes:new Uint8Array(m),offset:0,count:0,indices:[],extent:e,ensure(y){if(a.count+y<=f)return;f=Math.max(f*2,a.count+y);let F=new ArrayBuffer(f*$e);new Uint8Array(F).set(a.bytes.subarray(0,a.offset)),m=F,a.view=new DataView(F),a.bytes=new Uint8Array(F)}},h=[],d=new Map;for(let y of t.features()){if(y.type!==3||!_(n,y.properties))continue;let F=r.liftBy?.(y.properties)??0;for(let M of K(y.loadGeometry())){let v=J(M,e);if(v){h.push(F?{...v,lift:F}:v),Dt(v.outer,d);for(let R of v.holes)Dt(R,d)}}}r.onShapes?.(h);let g=new Set;for(let[y,F]of d)F>1&&g.add(y);let x=[],p={radius:l,segments:r.cornerSegments,extent:e,minCutRatio:0,maxChord:yt/o};for(let y of h){let F=l>0?{outer:X(y.outer,{...p,keep:Ut(y.outer,g)}),holes:y.holes.map(I=>X(I,{...p,keep:Ut(I,g)}))}:y,M=u>0?Gt(F.outer,u,e,g):F.outer,v=F.holes.map(I=>u>0?Gt(I,-u,e,g):I),R=y.lift??0,S=i+R,P=s+R;Ot(a,M??F.outer,v.map((I,A)=>I??F.holes[A]),S);let V=S,E=S-c;M&&u>0&&c>0&&ze(a,M,F.outer,V,E,Ar,e,g),E!==P&&ze(a,F.outer,F.outer,E,P,_t,e,g);for(let I of F.holes)if(E!==P&&ze(a,I,I,E,P,_t,e,g),S<P){let A=a.indices.length;Ot(a,I,[],P,Br);for(let k=A;k<a.indices.length;k++)x.push(a.indices[k]);a.indices.length=A}}if(!a.indices.length&&!x.length)return null;let w=a.indices.length,b=new Uint32Array(w+x.length);return b.set(a.indices,0),b.set(x,w),{vertices:m.slice(0,a.offset),indices:b.buffer,vertexCount:a.count,indexCount:b.length,extent:e,capIndexOffset:w}}function te(t,e,n,r){let o=`${Math.round(t*100)},${Math.round(e*100)}`,i=`${Math.round(n*100)},${Math.round(r*100)}`;return o<i?`${o}|${i}`:`${i}|${o}`}function Dt(t,e){for(let n=0;n+3<t.length;n+=2){let r=te(t[n],t[n+1],t[n+2],t[n+3]);e.set(r,(e.get(r)??0)+1)}}function Ut(t,e){if(!e.size)return;let n=t.length/2-1,r=new Array(n).fill(!1);for(let o=0;o<n;o++){let i=te(t[(o+n-1)%n*2],t[(o+n-1)%n*2+1],t[o*2],t[o*2+1]),s=te(t[o*2],t[o*2+1],t[(o+1)%n*2],t[(o+1)%n*2+1]);(e.has(i)||e.has(s))&&(r[o]=!0)}return r}function he(t,e,n,r,o,i,s,u){let c=t.offset;return t.view.setFloat32(c,e,!0),t.view.setFloat32(c+4,n,!0),t.view.setInt16(c+8,Ir(Math.round(r*kr)),!0),t.view.setInt8(c+10,Ze(Math.round(o*127))),t.view.setInt8(c+11,Ze(Math.round(i*127))),t.view.setInt8(c+12,Ze(Math.round(s*127))),t.bytes[c+13]=u,t.view.setInt8(c+14,e<=0?-Se:e>=t.extent?Se:0),t.view.setInt8(c+15,n<=0?-Se:n>=t.extent?Se:0),t.offset+=$e,t.count++}function Ot(t,e,n,r,o=Pr){let i=[],s=[];for(let l=0;l<e.length;l++)i.push(e[l]);for(let l of n){s.push(i.length/2);for(let f=0;f<l.length;f++)i.push(l[f])}let u=Y(i,s.length?s:void 0,2);if(!u.length)return;t.ensure(i.length/2);let c=t.count;for(let l=0;l<i.length;l+=2)he(t,i[l],i[l+1],r,0,0,1,o);for(let l=0;l<u.length;l+=3)t.indices.push(c+u[l],c+u[l+2],c+u[l+1])}function ze(t,e,n,r,o,i,s,u){let c=Math.min(e.length,n.length)/2;if(!(c<3)){t.ensure((c-1)*4);for(let l=0;l<c-1;l++){let f=n[l*2],m=n[l*2+1],a=n[l*2+2],h=n[l*2+3];if(f===a&&m===h||Re(f,m,a,h,s)||u.has(te(f,m,a,h)))continue;let d=a-f,g=h-m,x=Math.hypot(d,g)||1,p=g/x,w=-d/x,b=r-o,y=Math.hypot(e[l*2]-f,e[l*2+1]-m)||0,F=0;if(y>1e-6&&b!==0){let P=1/Math.hypot(1,b/y);F=y/Math.hypot(y,b)*Math.sign(b),p*=P,w*=P}let M=he(t,e[l*2],e[l*2+1],r,p,w,F,i),v=he(t,e[l*2+2],e[l*2+3],r,p,w,F,i),R=he(t,f,m,o,p,w,F,i),S=he(t,a,h,o,p,w,F,i);t.indices.push(R,v,S,R,M,v)}}}function Gt(t,e,n,r){let o=t.length/2-1;if(o<3)return null;let i=[];for(let c=0;c<o;c++){let l=t[c*2],f=t[c*2+1],m=t[(c+o-1)%o*2],a=t[(c+o-1)%o*2+1],h=t[(c+1)%o*2],d=t[(c+1)%o*2+1],g=Math.hypot(l-m,f-a)||1,x=Math.hypot(h-l,d-f)||1,p=(f-a)/g,w=-(l-m)/g,b=(d-f)/x,y=-(h-l)/x,F=p+b,M=w+y,v=Math.hypot(F,M);if(v<1e-6){i.push(l,f);continue}F/=v,M/=v;let R=Math.min(1/Math.max(F*p+M*w,.35),3),S=l-F*e*R,P=f-M*e*R,V=te(m,a,l,f),E=te(l,f,h,d);if(r.has(V)||r.has(E)){i.push(l,f);continue}(l<=0||l>=n)&&(S=l),(f<=0||f>=n)&&(P=f),i.push(S,P)}i.push(i[0],i[1]);let s=Math.abs(Ye(t)),u=Ye(i);if(Math.sign(u)!==Math.sign(Ye(t))||Math.abs(u)<s*.25)return null;for(let c=0;c<i.length;c+=2)i[c]=Math.max(0,Math.min(n,i[c])),i[c+1]=Math.max(0,Math.min(n,i[c+1]));return i}function Ye(t){let e=0;for(let n=0;n<t.length-2;n+=2)e+=t[n]*t[n+3]-t[n+2]*t[n+1];return e/2}var Ze=t=>t>127?127:t<-127?-127:t,Ir=t=>t>32767?32767:t<-32768?-32768:t;var me=20;function Xt(t,e,n=0,r){let o=Math.max(256,t.length*24),i=new ArrayBuffer(o*me),s=new DataView(i),u=0,c=[],l=h=>{if(u+h<=o)return;o=Math.max(o*2,u+h);let d=new ArrayBuffer(o*me);new Uint8Array(d).set(new Uint8Array(i,0,u*me)),i=d,s=new DataView(d)},f=(h,d,g,x,p,w,b,y=0,F=0)=>{let M=u*me;return s.setInt16(M,h,!0),s.setInt16(M+2,d,!0),s.setInt16(M+4,g,!0),s.setInt16(M+6,x,!0),s.setInt8(M+8,p),s.setInt8(M+9,w),s.setInt8(M+10,y),s.setInt8(M+11,F),s.setFloat32(M+12,b,!0),s.setFloat32(M+16,m,!0),u++},m=0;for(let h of t.features()){if(h.type!==2&&h.type!==3||!_(e,h.properties))continue;let d=h.properties.width;m=typeof d=="number"&&d>.5&&d<100?d:0;let g=h.type===3;for(let x of h.loadGeometry()){let p=n>0?Er(Nt(x),n):Nt(x);if(p.length<4)continue;let w=r&&!Lt(r)?Ct(r,p):null,b=w?w.pts:p,y=w?.levels,F=b.length/2;if(F<2)continue;l((F-1)*4);let M=0;for(let v=0;v<F-1;v++){let R=b[v*2],S=b[v*2+1],P=b[v*2+2],V=b[v*2+3],E=Math.hypot(P-R,V-S);if(g&&Vr(R,S,P,V,t.extent)){M+=E;continue}let I=Tr(R,S,P,V,t.extent);if(!I){M+=E;continue}let[A,k,B,C]=I,O=Math.hypot(A-R,k-S),z=Math.hypot(B-A,C-k),H=Math.hypot(P-B,V-C),D=M+O,U=y?y[v]:0,N=y?y[v+1]:0,de=f(A,k,B,C,0,-1,D,U,N),ve=f(A,k,B,C,0,1,D,U,N),xe=f(A,k,B,C,1,1,D,U,N),ke=f(A,k,B,C,1,-1,D,U,N);M+=O+z+H,c.push(de,ve,xe,de,xe,ke)}}}if(!c.length)return null;let a=new Uint32Array(c);return{vertices:i.slice(0,u*me),indices:a.buffer,vertexCount:u,indexCount:a.length}}function Er(t,e){let n=[];for(let r=0;r+3<t.length;r+=2){let o=t[r],i=t[r+1],s=t[r+2],u=t[r+3];n.push(o,i);let c=Math.min(64,Math.floor(Math.hypot(s-o,u-i)/e));for(let l=1;l<c;l++){let f=l/c;n.push(o+(s-o)*f,i+(u-i)*f)}}return n.push(t[t.length-2],t[t.length-1]),n}function Nt(t){let e=[];for(let n=0;n<t.length;n+=2){let r=t[n],o=t[n+1],i=e.length;i>=2&&e[i-2]===r&&e[i-1]===o||e.push(r,o)}return e}function Tr(t,e,n,r,o){let i=n-t,s=r-e,u=0,c=1,l=[[-i,t],[i,o-t],[-s,e],[s,o-e]];for(let[f,m]of l){if(f===0){if(m<0)return null;continue}let a=m/f;if(f<0){if(a>c)return null;a>u&&(u=a)}else{if(a<u)return null;a<c&&(c=a)}}return c-u<1e-6?null:[Math.round(t+i*u),Math.round(e+s*u),Math.round(t+i*c),Math.round(e+s*c)]}function Vr(t,e,n,r,o){return t===n&&(t<=0||t>=o)?!0:e===r&&(e<=0||e>=o)}var Lr=[["\\u0443\\u043B\\u0438\\u0446\\u0430","\\u0443\\u043B."],["\\u0443\\u043B\\u0438\\u0446\\u044B","\\u0443\\u043B."],["\\u0443\\u043B\\u0438\\u0446\\u0435","\\u0443\\u043B."],["\\u043F\\u0440\\u043E\\u0441\\u043F\\u0435\\u043A\\u0442","\\u043F\\u0440\\u043E\\u0441\\u043F."],["\\u043F\\u0440\\u043E\\u0441\\u043F\\u0435\\u043A\\u0442\\u0430","\\u043F\\u0440\\u043E\\u0441\\u043F."],["\\u043F\\u0435\\u0440\\u0435\\u0443\\u043B\\u043E\\u043A","\\u043F\\u0435\\u0440."],["\\u043F\\u0435\\u0440\\u0435\\u0443\\u043B\\u043A\\u0430","\\u043F\\u0435\\u0440."],["\\u043F\\u0440\\u043E\\u0435\\u0437\\u0434","\\u043F\\u0440-\\u0434"],["\\u043F\\u0440\\u043E\\u0435\\u0437\\u0434\\u0430","\\u043F\\u0440-\\u0434"],["\\u043F\\u043B\\u043E\\u0449\\u0430\\u0434\\u044C","\\u043F\\u043B."],["\\u043F\\u043B\\u043E\\u0449\\u0430\\u0434\\u0438","\\u043F\\u043B."],["\\u0431\\u0443\\u043B\\u044C\\u0432\\u0430\\u0440","\\u0431\\u0443\\u043B."],["\\u0431\\u0443\\u043B\\u044C\\u0432\\u0430\\u0440\\u0430","\\u0431\\u0443\\u043B."],["\\u043D\\u0430\\u0431\\u0435\\u0440\\u0435\\u0436\\u043D\\u0430\\u044F","\\u043D\\u0430\\u0431."],["\\u043D\\u0430\\u0431\\u0435\\u0440\\u0435\\u0436\\u043D\\u043E\\u0439","\\u043D\\u0430\\u0431."],["\\u0448\\u043E\\u0441\\u0441\\u0435","\\u0448."],["\\u0442\\u0443\\u043F\\u0438\\u043A","\\u0442\\u0443\\u043F."],["\\u0442\\u0443\\u043F\\u0438\\u043A\\u0430","\\u0442\\u0443\\u043F."],["\\u043C\\u0438\\u043A\\u0440\\u043E\\u0440\\u0430\\u0439\\u043E\\u043D","\\u043C\\u043A\\u0440."],["\\u043C\\u0438\\u043A\\u0440\\u043E\\u0440\\u0430\\u0439\\u043E\\u043D\\u0430","\\u043C\\u043A\\u0440."],["\\u043A\\u04EF\\u0447\\u0430\\u0438","\\u043A."],["\\u043A\\u0443\\u0447\\u0430\\u0438","\\u043A."],["\\u0445\\u0438\\u0451\\u0431\\u043E\\u043D\\u0438","\\u0445\\u0438\\u0451\\u0431."],["\\u0448\\u043E\\u04B3\\u0440\\u043E\\u04B3\\u0438","\\u0448\\u043E\\u04B3."],["\\u0433\\u0443\\u0437\\u0430\\u0440\\u0433\\u043E\\u04B3\\u0438","\\u0433\\u0443\\u0437."],["\\u043C\\u0430\\u0439\\u0434\\u043E\\u043D\\u0438","\\u043C\\u0430\\u0439\\u0434."]],zt=new Map(Lr);function Yt(t){let e=t.split(" ");if(e.length<2)return t;let n=!1,r=e.map(i=>{let s=zt.get(i.toLowerCase());return s?(n=!0,i[0]===i[0].toUpperCase()?s[0].toUpperCase()+s.slice(1):s):i});return!n||!e.filter(i=>zt.get(i.toLowerCase())===void 0).length?t:r.join(" ")}function $t(t,e){let n=[],r=[],o=[],i=[],s=[],u=e.textPlacement==="line",c=[],l=[],f=[];for(let m of t.features()){if(!_(e.filter,m.properties))continue;let a=m.loadGeometry(),h=Dr(m.type,a);if(!h)continue;let d=e.textField?Zt(e.textField,m.properties):"",g=d&&e.abbreviate?Yt(d):d,x=e.iconImage?Zt(e.iconImage,m.properties):"";if(!(!g&&!x)){if(u){let p=_r(m.type,a);if(!p)continue;f.push({text:g,line:p});continue}n.push(h[0],h[1]),r.push(g),o.push(x),i.push(Ur(m.properties)),s.push(e.iconRotate&&Math.round(Number(m.properties[e.iconRotate]??0))||0)}}if(u){for(let{text:m,line:a}of Cr(f)){l.push(c.length/2);for(let h of a)c.push(h);n.push(Math.round(a[0]),Math.round(a[1])),r.push(m),o.push(""),i.push(128),s.push(0)}l.push(c.length/2)}return r.length?{anchors:new Int16Array(n).buffer,texts:r,icons:o,priorities:new Uint8Array(i).buffer,rotations:new Int16Array(s).buffer,...u?{lines:new Int16Array(c).buffer,lineStarts:new Uint32Array(l).buffer}:{}}:null}function Cr(t){let e=[],n=new Map,r=new Map,o=(i,s,u)=>`${i}\\u241F${s}\\u241F${u}`;for(let{text:i,line:s}of t){let u=o(i,s[0],s[1]),c=o(i,s[s.length-2],s[s.length-1]),l=n.get(c),f=r.get(u);if(f!==void 0){let m=e[f];if(m.line.push(...s.slice(2)),r.delete(u),r.set(o(i,m.line[m.line.length-2],m.line[m.line.length-1]),f),l!==void 0&&l!==f){let a=e[l];m.line.push(...a.line.slice(2)),a.line=[],n.delete(c),r.set(o(i,m.line[m.line.length-2],m.line[m.line.length-1]),f)}continue}if(l!==void 0){let m=e[l];m.line.unshift(...s.slice(0,s.length-2)),n.delete(c),n.set(o(i,m.line[0],m.line[1]),l);continue}n.set(u,e.length),r.set(c,e.length),e.push({text:i,line:s})}return e.filter(i=>i.line.length>=4)}function _r(t,e){if(t!==2)return null;let n=null,r=0;for(let o of e){if(o.length<4)continue;let i=0;for(let s=0;s+3<o.length;s+=2)i+=Math.hypot(o[s+2]-o[s],o[s+3]-o[s+1]);i>r&&(r=i,n=o)}return n}function Dr(t,e){if(!e.length)return null;if(t===1){let s=e[0];return s.length>=2?[s[0],s[1]]:null}if(t===2){let s=-1,u=0,c=0;for(let l of e)for(let f=0;f+3<l.length;f+=2){let m=l[f+2]-l[f],a=l[f+3]-l[f+1],h=m*m+a*a;h>s&&(s=h,u=l[f]+m/2,c=l[f+1]+a/2)}return s>0?[Math.round(u),Math.round(c)]:null}let n=1/0,r=1/0,o=-1/0,i=-1/0;for(let s of e)for(let u=0;u<s.length;u+=2)s[u]<n&&(n=s[u]),s[u]>o&&(o=s[u]),s[u+1]<r&&(r=s[u+1]),s[u+1]>i&&(i=s[u+1]);return isFinite(n)?[Math.round((n+o)/2),Math.round((r+i)/2)]:null}function Ur(t){let e=t.rank;return typeof e=="number"&&isFinite(e)?Math.max(0,255-Math.min(e,255)):128}function Zt(t,e){let n=Array.isArray(t)?t:[t];for(let r of n){let o=!0,s=r.replace(/\\{([^}]+)\\}/g,(u,c)=>{let l=e[c];return l==null||l===""?(o=!1,""):String(l)}).trim();if(o&&s)return s}return""}function jt(t,e){let n=[],r=[];for(let o=0;o<t.length;o++){let i=t.feature(o);if(i.type===1&&_(e,i.properties))for(let s of i.loadGeometry())for(let u=0;u+1<s.length;u+=2)n.push(s[u],s[u+1]),r.push(i.properties)}return r.length?{anchors:Int16Array.from(n).buffer,props:r}:null}var Or="\\u241F",Wt=(t,e)=>t+Or+String(e);function Gr(){let t=typeof self<"u"?self.origin:void 0;return t&&t!=="null"&&!t.startsWith("blob:")?t+"/":void 0}async function Jt(t,e){let n=performance.now(),r=Gr(),o=await fetch(t.url,{signal:e,credentials:"same-origin",...r?{referrer:r}:{}}),i=(x,p,w,b,y=0)=>({type:"loaded",id:t.id,buckets:{},timing:{fetchMs:b,parseMs:y},diag:{status:x,bytes:p,layers:w,built:0}});if(!o.ok){if(o.status===404||o.status===204)return i(o.status,0,[],performance.now()-n);throw new Error(`HTTP ${o.status} \\u0434\\u043B\\u044F ${t.url}`)}let s=await o.arrayBuffer(),u=performance.now()-n;if(s.byteLength===0)return i(o.status,0,[],u);let c=performance.now(),l=new Me(s),f=Object.keys(l.layers),m={},a={},h=[],g=t.plan.some(x=>x.type==="surface"&&(x.elevation??0)>0)&&t.plan.some(x=>x.type==="line"&&x.ground)?Tt(t.metersPerTile):void 0;for(let x of t.plan){if(!Nr(x,t.zoom,t.sourceMaxZoom))continue;let p=l.layers[x.sourceLayer];if(!p)continue;let w=Xr(t.zoom,p.extent);try{if(x.splitBy){let y=zr(p,x.splitBy,x.filter);if(!y.length)continue;let F=a[x.splitBy]??(a[x.splitBy]=[]);for(let M of y){F.includes(M)||F.push(M);let v={...x,splitBy:void 0,filter:Yr(x.filter,x.splitBy,M)},R=Kt(v,p,w,t.metersPerTile,g);R&&(m[Wt(x.id,M)]=R)}continue}let b=Kt(x,p,w,t.metersPerTile,g);b&&(m[x.id]=b)}catch(b){h.push(`${x.id}: ${b instanceof Error?b.message:String(b)}`)}}return{type:"loaded",id:t.id,buckets:m,...Object.keys(a).length?{splits:a}:{},timing:{fetchMs:u,parseMs:performance.now()-c},diag:{status:o.status,bytes:s.byteLength,layers:f,built:Object.keys(m).length,...h.length?{failed:h}:{}}}}function Hr(t){return e=>{let n=e.on;if(typeof n!="string"||!n)return 0;let r=0;for(let o of n.split(",")){let i=t[o];typeof i=="number"&&i>r&&(r=i)}return r}}function Nr(t,e,n){let r=e-1,o=e<n?e+1:24;return!(t.maxzoom<r||t.minzoom>o)}function Xr(t,e){return t<=6?Math.max(64,e/24):0}function Kt(t,e,n,r,o){{if(t.type==="fill"){let s=r>0?r/e.extent:0,u=t.cornerRadius&&s>0?{radius:t.cornerRadius/s,segments:t.cornerSegments,extent:e.extent,minCutRatio:0,maxChord:gt/s}:void 0,c=It(e,t.filter,n,u,t.clipToTile===!0,e.extent);return c?{kind:"fill",...c,extent:e.extent}:null}if(t.type==="surface"){let s=Ht(e,e.extent,t.filter,{metersPerUnit:r>0?r/e.extent:0,elevation:t.elevation??0,base:t.base,bevel:t.bevel,bevelDrop:t.bevelDrop,cornerRadius:t.cornerRadius,cornerSegments:t.cornerSegments,...o?{onShapes:u=>Vt(o,u,t.elevation??0,e.extent)}:{},...t.groundBy?{liftBy:Hr(t.groundBy)}:{}});return s?{kind:"surface",...s}:null}if(t.type==="line"){let s=Xt(e,t.filter,n,t.ground?o:void 0);return s?{kind:"line",...s,extent:e.extent}:null}if(t.type==="model"){let s=jt(e,t.filter);return s?{kind:"placement",...s,extent:e.extent}:null}if(t.type==="symbol"){let s=$t(e,{filter:t.filter,textField:t.textField,iconImage:t.iconImage,iconRotate:t.iconRotate,textPlacement:t.textPlacement,abbreviate:t.abbreviate});return s?{kind:"symbol",...s,extent:e.extent}:null}let i=At(e,e.extent,t.filter,{metersPerUnit:r>0?r/e.extent:0,cornerRadius:t.cornerRadius,cornerSegments:t.cornerSegments});return i?{kind:"fill-extrusion",vertices:i.vertices,indices:i.indices,featureIds:i.featureIds,vertexCount:i.vertexCount,indexCount:i.indexCount,extent:i.extent}:null}}function zr(t,e,n){let r=[];for(let o of t.features()){if(!_(n,o.properties))continue;let i=o.properties[e];typeof i!="string"&&typeof i!="number"||r.includes(i)||r.push(i)}return r.sort((o,i)=>typeof o=="number"&&typeof i=="number"?o-i:String(o).localeCompare(String(i))),r}function Yr(t,e,n){let r=["==",e,n];return t?["all",t,r]:r}var Zr=t=>t.kind==="symbol",$r=t=>t.kind==="placement";function Qt(t){let e=[];for(let n of Object.values(t.buckets)){if($r(n)){e.push(n.anchors);continue}if(Zr(n)){e.push(n.anchors,n.priorities),n.lines&&e.push(n.lines),n.lineStarts&&e.push(n.lineStarts);continue}e.push(n.vertices,n.indices),n.featureIds&&e.push(n.featureIds)}return e}var qt=Map;var ne=new qt,je=self;je.onmessage=t=>{let e=t.data;if(e.type==="abort"){ne.get(e.id)?.abort(),ne.delete(e.id);return}let n=new AbortController;ne.set(e.id,n),Jt(e,n.signal).then(r=>{ne.has(e.id)&&(ne.delete(e.id),je.postMessage(r,Qt(r)))}).catch(r=>{let o=n.signal.aborted;ne.delete(e.id);let i={type:"error",id:e.id,message:r instanceof Error?r.message:String(r),aborted:o};je.postMessage(i)})};})();\n';var lr=class{constructor(e=Tn()){this.workers=[];this.blobUrl=null;this.pending=new P;this.nextId=1;this.cursor=0;this.mainThreadAborts=new P;this.destroyed=false;try{let t=new Blob([Hn],{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),Rl(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 Tn(){let n=typeof navigator<"u"&&navigator.hardwareConcurrency||4;return Math.max(1,Math.min(n-1,6))}function Ol(n){return Math.max(0,Math.ceil((n*Math.LN2+Math.log(512/360/.5))/Math.LN10))}function Pn(n,e){let t=Ol(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 kn(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 Wl(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 Vl={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}},Et=n=>Vl[n]??Vl.high;function sr(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 cr(){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 Gn(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 Rn(n){return n==="high"?3:n==="balanced"?2:n==="low"?1:0}function zl(n){return n==="minimal"?"low":n==="low"?"balanced":n==="balanced"?"high":null}function On(n){return n==="high"?"balanced":n==="balanced"?"low":n==="low"?"minimal":null}var fd=1,po=class{constructor(e){this.originX=0;this.originY=0;this._revision=0;this.id=e.id??`obj-${fd++}`,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=Z(l),c=ee(s.lng),u=te(s.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=Z(o);t.push(ee(r.lng)-this.originX,te(r.lat)-this.originY);}return t}color(e,t){let o=ce(this.paint[e]??t),r=this.paint.opacity??1;return [o[0],o[1],o[2],o[3]*r]}linePaint(e){return e.dashArray=this.paint.dashArray,e.offset=this.paint.offset,this.paint.arrow&&(e.arrow=true,e.arrowColor=this.color("arrowColor","#ffffff"),e.arrowPeriod=this.paint.arrowPeriod??46,e.arrowSize=this.paint.arrowSize??5),e}},Vn=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=Yt([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=Yt([this.toLocal(this.coordinates.slice(l.from,l.to+1))]);if(!s)continue;let c=ce(l.color);o.push(this.linePaint({kind:"line",mesh:s,color:[c[0],c[1],c[2],c[3]*a],width:t}));}return o}colorRuns(){if(this.segments.length===0||this.coordinates.length<2)return [];let e=this.coordinates.length-1,t=this.segments.filter(r=>Number.isInteger(r.at)&&r.at>=0&&r.at<e).sort((r,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=Nn(this.coordinates,this.altitude,t);for(let a=0;a+1<i.length;a++)if(Nl(e,i[a],i[a+1])<=r)return true;return false}},fr=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=nn(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(Wn(a))),i=Yt(r);i&&e.push(this.linePaint({kind:"line",mesh:i,color:this.color("strokeColor","#2f6df6"),width:o}));}return e}hitTest(e,t){let o=Nn(Wn(this.coordinates[0]??[]),this.altitude,t);if(!Kn(e,o))return false;for(let r=1;r<this.coordinates.length;r++)if(Kn(e,Nn(Wn(this.coordinates[r]),this.altitude,t)))return false;return true}},zn=class extends fr{constructor(e){super({...e,coordinates:[ud(e.center,e.radius,e.segments)]});}};function ud(n,e,t){let o=Z(n),r=e/He(o.lat),i=ee(o.lng),a=te(o.lat),l=Math.max(12,t??Math.min(128,Math.round(24+e/20))),s=[];for(let c=0;c<l;c++){let u=c/l*Math.PI*2;s.push([De(i+Math.cos(u)*r),_e(a+Math.sin(u)*r)]);}return s}function Nn(n,e,t){let o=[];for(let r of n){let i=Z(r),a=t(i.lng,i.lat,e);a&&o.push(a);}return o}function Wn(n){if(n.length<2)return n;let e=Z(n[0]),t=Z(n[n.length-1]);return e.lng===t.lng&&e.lat===t.lat?n:[...n,n[0]]}function Nl(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 Kn(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 Kl="objects3d",Mt="level",dd=32,hd=100,Un=120,md=40,pd=.35,bd=.02,Ad=150,yd=250;function Ul(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 gd(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 Jn=class extends Ne{constructor(t){super();this.options=t;this.transform=new Lt;this.ctx=null;this.sources=new P;this.rasterSources=new P;this.renderer=new oo;this.objects=new Qt;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(Un);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 P;this.autoIndoorLevel=true;let o=typeof t.container=="string"?document.getElementById(t.container):t.container;if(!o)throw new Error(`[osmgl] \u043A\u043E\u043D\u0442\u0435\u0439\u043D\u0435\u0440 \u043D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D: ${String(t.container)}`);this.container=o,this.qualityAuto=(t.quality??"auto")==="auto";let r=this.qualityAuto?sr(cr()):t.quality;this.qualityCeiling=r,this.quality=Et(r),this.densityQuality=this.quality,this.maxPixelRatio=t.maxPixelRatio??this.quality.maxPixelRatio,this._style=new At(t.theme?Vo(t.theme,t.style):t.style),this.background=t.background?ce(t.background):null,this.canvas=document.createElement("canvas"),this.canvas.style.width="100%",this.canvas.style.height="100%",this.canvas.style.display="block",this.canvas.style.outline="none",getComputedStyle(this.container).position==="static"&&(this.container.style.position="relative"),this.container.appendChild(this.canvas);let 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=Z(t.center??[0,0]),a.zoom=t.zoom??2,a.bearing=t.bearing??0,a.pitch=t.pitch??0,this.hashName=typeof t.hash=="string"?t.hash:void 0,t.hash&&this.applyHash(false),this.pool=new lr(t.workerCount??Math.min(Tn(),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 Co(t);let o=new xt(this.options.fonts??"/tileserver/fonts/{fontstack}/{range}.pbf",this.options.fontstack);this.options.icons&&o.icons.setIcons({...it,...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(X,{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 ar({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:Kl,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(gd):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:Kl,"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(We(a,c.x,c.y,l));}}else for(let l of t.models)l.setHidden(false);}buildingsForMask(){let t=this.sources.get(X);if(!t)return null;for(let o of this._style.layers){if(o.type!=="fill-extrusion"||(o.source??X)!==X)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===Mt&&t.add(o.source??X);for(let o of this._style.layers){if(o.type!=="fill-extrusion"||"splitBy"in o&&o.splitBy)continue;let r=o.source??X;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 co({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 tr(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===X&&r.on("idle",()=>this.emit("idle",void 0)),this.sources.set(t,r),this.triggerRepaint(),this}initInput(){this.gestures=new Mo(this.canvas,this.transform,t=>{this.animation=null,t==="zoom"&&this.emit("zoom",void 0),this.emitMove(),this.triggerRepaint();},()=>this.emit("moveend",void 0),this.options.gestures),this.initClicks(),this.initHash();}initClicks(){let t=null;this.canvas.addEventListener("pointerdown",r=>{r.button===0&&(t={x:r.clientX,y:r.clientY,t:performance.now()});}),this.canvas.addEventListener("pointerup",r=>{let 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),u=s||c?null:this.queryBuilding(l);this.options.highlightBuildings!==false&&(this.setHighlight(u),this.setRoomHighlight(c));for(let m of this.getPopups())m.closeOnClick&&this.removePopup(m);this.emit("click",{point:l,lngLat:this.transform.unproject(l),object:s,building:u,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=Gn(t,o,Math.min(window.devicePixelRatio||1,this.maxPixelRatio),this.densityQuality);this.canvas.width=Math.round(t*r),this.canvas.height=Math.round(o*r),this.transform.resize(t,o),this.triggerRepaint();}getCenter(){return this.transform.center}getZoom(){return this.transform.zoom}getBearing(){return this.transform.bearing}getPitch(){return this.transform.pitch}setCenter(t){return this.transform.center=Z(t),this.afterCameraChange()}setZoom(t){return this.transform.zoom=t,this.emit("zoom",void 0),this.afterCameraChange()}setBearing(t){return this.transform.bearing=t,this.afterCameraChange()}setPitch(t){return this.transform.pitch=t,this.afterCameraChange()}jumpTo(t){let o=this.transform;return t.center!==void 0&&(o.center=Z(t.center)),t.zoom!==void 0&&(o.zoom=t.zoom),t.bearing!==void 0&&(o.bearing=t.bearing),t.pitch!==void 0&&(o.pitch=t.pitch),this.animation=null,this.afterCameraChange()}easeTo(t){let o=t.duration??0;if(o<=0)return this.jumpTo(t);let r=this.transform,i={center:r.center,zoom:r.zoom,bearing:r.bearing,pitch:r.pitch},l={center:t.center!==void 0?Z(t.center):r.center,zoom:t.zoom??r.zoom,bearing:i.bearing+lt((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?Z(t.center):o.center,zoom:t.zoom??o.zoom,bearing:r.bearing+lt((t.bearing??o.bearing)-r.bearing),pitch:t.pitch??o.pitch},l=Ke(r.zoom),s=(ee(a.center.lng)-ee(r.center.lng))*l,c=(te(a.center.lat)-te(r.center.lat))*l,u=Math.hypot(s,c),m=Math.max(o.width,o.height),f=m*Math.pow(2,r.zoom-a.zoom),d=1.42,h=d*d,p,b=null;if(u<1e-6){let y=Math.log(f/m);p=Math.abs(y)/d,b=g=>({u:0,w:m*Math.exp(d*Math.sign(y)*g)});}else {let y=w=>{let x=w===0?m:f,D=w===0?f:m;return (D*D-x*x+(w===0?1:-1)*h*h*u*u)/(2*x*h*u)},g=w=>Math.log(-y(w)+Math.sqrt(y(w)*y(w)+1)),B=g(0);p=(g(1)-B)/d;let v=w=>(Math.exp(w)+Math.exp(-w))/2,_=w=>(Math.exp(2*w)-1)/(Math.exp(2*w)+1);b=w=>{let x=d*w+B;return {u:m*v(B)*_(x)/h-m*Math.sinh(B)/h,w:m*v(B)/v(x)}};}if(!Number.isFinite(p)||p<=0)return this.jumpTo(t);let A=t.duration??Math.min(3e3,p/1.2*1e3);return this.animation={start:performance.now(),duration:A,from:r,to:a,fly:{S:p,u1:u,curve:b,w0:m}},this.triggerRepaint(),this}setPadding(t){return this.padding=Ul(t),this.renderer.symbols&&(this.renderer.symbols.padding=this.padding),this.triggerRepaint(),this}getPadding(){return {...this.padding}}getBounds(){let t=this.transform,o=new It;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=hr(t,{width:r.width,height:r.height,bearing:o.bearing??r.bearing,padding:o.padding!==void 0?Ul(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=ve((t-o.start)/o.duration,0,1),i=o.fly?r:Bo(r),a=this.transform,l=Z(o.from.center),s=Z(o.to.center);if(o.fly){let{u:c,w:u}=o.fly.curve(o.fly.S*r),m=o.fly.u1>1e-6?ve(c/o.fly.u1,0,1):r;return a.center={lng:l.lng+(s.lng-l.lng)*m,lat:l.lat+(s.lat-l.lat)*m},a.zoom=o.from.zoom+Math.log2(o.fly.w0/u),a.bearing=o.from.bearing+(o.to.bearing-o.from.bearing)*Bo(r),a.pitch=o.from.pitch+(o.to.pitch-o.from.pitch)*Bo(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(Z(t),o)}unproject(t){return this.transform.unproject(t)}get style(){return this._style}setStyle(t){let o=this._style,r=new At(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(Vo(t,this.options.style))}static get themes(){return Object.keys(yt)}static get themeList(){return Object.entries(yt).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:De(r.mercX),lat:_e(r.mercY)},key:xt.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??X);if(!i)continue;let a=tn(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 P,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??X)));}if(!i||!o.length)return null;let a=on(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=Pn({center:t.center,zoom:t.zoom,bearing:t.bearing,pitch:t.pitch},this.hashName);this.writingHash=true,Wl("#"+o),setTimeout(()=>this.writingHash=false,0);}applyHash(t){if(typeof window>"u")return;let o=kn(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"?sr(cr()):t;return this.qualityCeiling=o,this.resetFrameWindow(),this.applyQuality(Et(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>hd?3:t>dd?1:0;if(this.ringSum+=o-this.frameRing[this.ringAt],this.frameRing[this.ringAt]=o,this.ringAt=(this.ringAt+1)%Un,this.ringFilled<Un&&this.ringFilled++,this.steadyFrames++,this.ringFilled<md)return;let r=this.ringSum/this.ringFilled;if(r>=pd){let a=On(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(Et(a),true);return}if(r>bd||this.steadyFrames<Ad)return;let i=zl(this.quality.name);!i||Rn(i)>Rn(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(Et(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=ce(t),this.triggerRepaint(),this}getIndoorLevels(){let t=[];for(let[o,r]of this.sources.entries())if(this._style.layers.some(i=>(i.source??X)===o&&"splitBy"in i&&i.splitBy===Mt))for(let i of r.splitValues(Mt)){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[Mt];return typeof t=="number"?t:null}setIndoorLevel(t){return t===null?delete this._style.splitValues[Mt]:this._style.splitValues[Mt]=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 mo)}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,St):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);})));}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,h]of this.rasterSources)this.rasterLayerVisible(d)&&h.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,u=c>0&&c<yd,m=u?c:0;this.continuousFrames=u?this.continuousFrames+1:0;let f=this.continuousFrames>1?c:l;this.lastFrameAt=t,this.checkFrameBudget(f),this.emit("render",{frameMs:l,intervalMs:m}),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();}}},fb=Jn;
|
|
1953
|
+
exports.AssetLoader=fo;exports.BASE_SOURCE=X;exports.BUILDING_HEIGHT_SCALE=dt;exports.BUILDING_VERTEX_STRIDE=Fe;exports.CITY_STYLE=yf;exports.Circle=zn;exports.DEFAULT_ICONS=it;exports.DEFAULT_LIGHT=Kr;exports.DEFAULT_SHADOWS=bl;exports.DEFAULT_SKY=Nr;exports.DEFAULT_STYLE=Ur;exports.DepthTarget=Ut;exports.EARTH_CIRCUMFERENCE=vo;exports.FILL_VERTEX_STRIDE=Ue;exports.GLOBE_MAX_PITCH=St;exports.GLOBE_ZOOM_MAX=$e;exports.GLOBE_ZOOM_MIN=_o;exports.GLYPH_BORDER=pe;exports.GLYPH_SIZE=ze;exports.GROUND_SCALE=kc;exports.GeomType=zt;exports.GlyphSource=no;exports.GroundArrows=Xt;exports.IconSource=ao;exports.IndoorMask=jt;exports.LINE_VERTEX_STRIDE=Je;exports.LayerRenderer=oo;exports.LngLatBounds=It;exports.MAX_LATITUDE=jn;exports.MODEL_VERTEX_STRIDE=jo;exports.Map=Jn;exports.MapObject=po;exports.Marker=ho;exports.Model=uo;exports.ModelLayer=je;exports.ObjectManager=Qt;exports.Polygon=fr;exports.Polyline=Vn;exports.Popup=mo;exports.RELIEF_STYLE=Af;exports.RUNTIME_FILL_STRIDE=rn;exports.RUNTIME_LINE_STRIDE=Bt;exports.RasterSource=co;exports.RasterTile=or;exports.SDF_EDGE=An;exports.SDF_PX=io;exports.SOFT_STYLE=bf;exports.SPLIT_SEP=ya;exports.SURFACE_CUT_BLEED=Nt;exports.SURFACE_LEVEL_SCALE=Oi;exports.SURFACE_VERTEX_STRIDE=ht;exports.SdfAtlas=ro;exports.Style=At;exports.SymbolRenderer=xt;exports.THEMES=yt;exports.TILE_SIZE=qe;exports.TileID=Dt;exports.Transform=Lt;exports.VectorTile=Vt;exports.VectorTileFeature=ko;exports.VectorTileLayer=Go;exports.abbreviateStreet=In;exports.addGround=Wr;exports.altitudeFromMercatorZ=Fd;exports.applyTheme=Wo;exports.arrowLabelOffset=Ml;exports.arrowVertices=Mf;exports.buildRuntimeFill=nn;exports.buildRuntimeLine=Yt;exports.cameraForBounds=hr;exports.circumferenceAtLatitude=He;exports.clampLat=wo;exports.clampPixelRatio=Gn;exports.clipLineToRect=Bn;exports.coordinateDigits=Ol;exports.coveringTiles=so;exports.createGround=Or;exports.default=fb;exports.deviceHints=cr;exports.distToSegment=Nl;exports.evaluateColor=Le;exports.evaluateNumber=O;exports.extractFeature=Uo;exports.fillFootprint=Zr;exports.fogPlanes=gt;exports.footprintOf=Qr;exports.formatHash=Pn;exports.generateBuildings=Lr;exports.generateFill=Rr;exports.generateLine=zr;exports.generateSurface=Gr;exports.generateSymbols=Ln;exports.globeBasis=yr;exports.globeFlatMix=Fo;exports.globeRadius=Do;exports.globeToLocal=oi;exports.groundAt=Oo;exports.iconRotation=Il;exports.insideFootprint=We;exports.latFromMercatorY=_e;exports.lngFromMercatorX=De;exports.lngLatToUnit=Eo;exports.matchesFilter=me;exports.mercatorMetersPerTile=dr;exports.mercatorX=ee;exports.mercatorY=te;exports.mercatorZFromAltitude=ur;exports.metersPerPixel=Md;exports.metersPerTile=Yn;exports.nextQualityDown=On;exports.parseGlb=Qf;exports.parseGlbAsync=sn;exports.parseGlyphs=yl;exports.parseHash=kn;exports.patchUV=Qa;exports.pickBuilding=tn;exports.pickFill=on;exports.pitchIntent=ci;exports.pixelsPerMeter=Ed;exports.placeAlongLine=vn;exports.pointInRing=Kn;exports.qualityFor=sr;exports.qualityProfile=Et;exports.raySphere=gr;exports.resolveTemplate=Sn;exports.roundRing=Ge;exports.sdfFromAlpha=yn;exports.shapeText=gn;exports.splitBucketKey=bt;exports.splitByGround=Vr;exports.splitPolygons=rt;exports.styleWithTheme=Vo;exports.tileOriginMeters=Zn;exports.tileUrl=Sl;exports.toLngLat=Z;exports.unitToLngLat=Ar;exports.worldSize=Ke;Object.defineProperty(exports,'__esModule',{value:true});return exports;})({});//# sourceMappingURL=osmgl.global.js.map
|
|
1954
|
+
//# sourceMappingURL=osmgl.global.js.map
|