osmgl 0.16.0 → 0.18.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.
@@ -6,7 +6,7 @@ ${i}
6
6
  ${_m(t)}`)}return r}function _m(n){return n.split(`
7
7
  `).map((e,t)=>`${String(t+1).padStart(4)} | ${e}`).join(`
8
8
  `)}var xr=new Set,wa=false;function ot(n,e,t=2){let o=e&&e.length,r=o?e[0]*t:n.length;xr.size&&xr.clear();let i=dc(n,0,r,t,true),a=[];if(!i||i.next===i.prev)return a;let s=0,l=0,c=0;if(o&&(i=Dm(n,e,i,t)),n.length>80*t){s=n[0],l=n[1];let f=s,u=l;for(let h=t;h<r;h+=t){let d=n[h],m=n[h+1];d<s&&(s=d),m<l&&(l=m),d>f&&(f=d),m>u&&(u=m);}c=Math.max(f-s,u-l),c=c!==0?32767/c:0;}return va(i,a,s,l,c),a}function dc(n,e,t,o,r){let i=null;if(r===Um(n,e,t,o)>0)for(let a=e;a<t;a+=o)i=hc(a/o|0,n[a],n[a+1],i);else for(let a=t-o;a>=e;a-=o)i=hc(a/o|0,n[a],n[a+1],i);return i&&wr(i,i.next)&&(Cr(i),i=i.next),i}function go(n,e=n){let t=e===n,o=n,r;do r=false,o!==o.next&&(xr.size===0||!xr.has(o))&&(wr(o,o.next)||$e(o.prev,o,o.next)===0)?((t||o===e)&&(e=o.prev),wa=true,Cr(o),o=o.prev,r=true):(t||o!==e)&&(o=o.next,r=!t);while(r||o!==e);return e}function va(n,e,t,o,r){r&&Om(n,t,o,r);let i=n,a=false;for(;n.prev!==n.next;){let s=n.prev,l=n.next;if($e(s,n,l)<0&&(r?Sm(n,t,o,r):Em(n))){e.push(s.i,n.i,l.i),Cr(n),n=l,i=l;continue}if(n=l,n===i){if(wa=false,n=go(n),wa){i=n;continue}if(!a){n=Fm(n,e),i=n,a=true;continue}Im(n,e,t,o,r);break}}}function Em(n){let e=n.prev,t=n,o=n.next,r=e.x,i=t.x,a=o.x,s=e.y,l=t.y,c=o.y,f=Math.min(r,i,a),u=Math.min(s,l,c),h=Math.max(r,i,a),d=Math.max(s,l,c),m=o.next;for(;m!==e;){if(m.x>=f&&m.x<=h&&m.y>=u&&m.y<=d&&!(r===m.x&&s===m.y)&&Yn(r,s,i,l,a,c,m.x,m.y)&&$e(m.prev,m,m.next)>=0)return false;m=m.next;}return true}function Sm(n,e,t,o){let r=n.prev,i=n,a=n.next,s=r.x,l=i.x,c=a.x,f=r.y,u=i.y,h=a.y,d=Math.min(s,l,c),m=Math.min(f,u,h),p=Math.max(s,l,c),b=Math.max(f,u,h),g=_a(d,m,e,t,o),y=_a(p,b,e,t,o),A=n.prevZ;for(;A&&A.z>=g;){if(A.x>=d&&A.x<=p&&A.y>=m&&A.y<=b&&A!==a&&!(s===A.x&&f===A.y)&&Yn(s,f,l,u,c,h,A.x,A.y)&&$e(A.prev,A,A.next)>=0)return false;A=A.prevZ;}let x=n.nextZ;for(;x&&x.z<=y;){if(x.x>=d&&x.x<=p&&x.y>=m&&x.y<=b&&x!==a&&!(s===x.x&&f===x.y)&&Yn(s,f,l,u,c,h,x.x,x.y)&&$e(x.prev,x,x.next)>=0)return false;x=x.nextZ;}return true}function Fm(n,e){let t=n,o=false;do{let r=t.prev,i=t.next.next;bc(r,t,t.next,i,false)&&vr(r,i)&&vr(i,r)&&(e.push(r.i,t.i,i.i),Cr(t),Cr(t.next),t=n=i,o=true),t=t.next;}while(t!==n);return o?go(t):t}function Im(n,e,t,o,r){let i=n;do{let a=i.next.next;for(;a!==i.prev;){if(i.i!==a.i&&Wm(i,a)){let s=gc(i,a);i=go(i,i.next),s=go(s,s.next),va(i,e,t,o,r),va(s,e,t,o,r);return}a=a.next;}i=i.next;}while(i!==n)}var Ca=false;function Dm(n,e,t,o){let r=[];for(let i=0,a=e.length;i<a;i++){let s=e[i]*o,l=i<a-1?e[i+1]*o:n.length,c=dc(n,s,l,o,false);c===c.next&&xr.add(c),r.push(zm(c));}r.sort(Tm),Lm(n.length/o,e.length),pc(t,t),Ca=true;for(let i=0;i<r.length;i++)t=km(r[i],t);return Ca=false,go(t)}function Tm(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 km(n,e){let t=Pm(n,e);if(!t)return e;let o=gc(t,n),r=o.next;return pc(t,r.next),go(o,o.next),go(t,t.next)}var mc=16,Ze=new Float64Array(0),jn=0,Ba=[],Ma=[];function Lm(n,e){let t=Math.ceil((n+2*e)/mc)+e+2;Ze.length<t*4&&(Ze=new Float64Array(t*4)),jn=0;}function pc(n,e){let t=n;do{let o=jn++;Ba[o]=t;let r=1/0,i=1/0,a=-1/0,s=-1/0,l=0;do{let f=t.next;t.z=o,t.x<r&&(r=t.x),t.x>a&&(a=t.x),t.y<i&&(i=t.y),t.y>s&&(s=t.y),f.x<r&&(r=f.x),f.x>a&&(a=f.x),f.y<i&&(i=f.y),f.y>s&&(s=f.y),t=f;}while(++l<mc&&t!==e);Ma[o]=t;let c=o*4;Ze[c]=r,Ze[c+1]=i,Ze[c+2]=a,Ze[c+3]=s;}while(t!==e)}function Rm(n,e){let t=n.z*4;e.x<Ze[t]&&(Ze[t]=e.x),e.y<Ze[t+1]&&(Ze[t+1]=e.y),e.x>Ze[t+2]&&(Ze[t+2]=e.x),e.y>Ze[t+3]&&(Ze[t+3]=e.y);}function fc(n){let e=Ma[n];for(;e.prev.next!==e;)e=e.next;return Ma[n]=e,e}function uc(n){let e=Ba[n];for(;e.prev.next!==e;)e=e.next;return Ba[n]=e,e}function Pm(n,e){let t=e,o=n.x,r=n.y,i=-1/0,a;if(wr(n,t))return t;for(let h=0,d=0;h<jn;h++,d+=4){if(r<Ze[d+1]||r>Ze[d+3]||Ze[d]>o||Ze[d+2]<=i)continue;let m=fc(h);t=uc(h);do{if(t.prev.next===t){if(wr(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!==m)}if(!a)return null;let s=a.x,l=a.y,c=Math.min(r,l),f=Math.max(r,l),u=1/0;for(let h=0,d=0;h<jn;h++,d+=4){if(Ze[d+2]<s||Ze[d]>o||Ze[d+3]<c||Ze[d+1]>f)continue;let m=fc(h);t=uc(h);do{if(t.prev.next===t&&o>=t.x&&t.x>=s&&o!==t.x&&Yn(r<l?o:i,r,s,l,r<l?i:o,r,t.x,t.y)){let p=Math.abs(r-t.y)/(o-t.x);(vr(t,n)||t.y===r&&t.next.y===r&&t.next.x>o)&&(p<u||p===u&&(t.x>a.x||t.x===a.x&&Hm(a,t)))&&(a=t,u=p);}t=t.next;}while(t!==m)}return a}function Hm(n,e){return $e(n.prev,n,e.prev)<0&&$e(e.next,n,n.next)<0}var xt=[],gr=[],bo=new Uint32Array(0),yr=new Uint32Array(0),Ar=new Uint32Array(256);function Om(n,e,t,o){let r=n,i=0;do r.z=_a(r.x,r.y,e,t,o),xt[i++]=r,r=r.next;while(r!==n);Gm(i);let a=null;for(let s=0;s<i;s++){let l=xt[s];l.prevZ=a,a&&(a.nextZ=l),a=l;}a.nextZ=null;}function Gm(n){if(n<=32){for(let e=1;e<n;e++){let t=xt[e],o=t.z,r=e-1;for(;r>=0&&xt[r].z>o;)xt[r+1]=xt[r],r--;xt[r+1]=t;}return}bo.length<n&&(bo=new Uint32Array(n),yr=new Uint32Array(n),gr=new Array(n));for(let e=0;e<n;e++)bo[e]=xt[e].z;Xn(n,xt,bo,gr,yr,0),Xn(n,gr,yr,xt,bo,8),Xn(n,xt,bo,gr,yr,16),Xn(n,gr,yr,xt,bo,24);}function Xn(n,e,t,o,r,i){Ar.fill(0);for(let s=0;s<n;s++)Ar[t[s]>>>i&255]++;let a=0;for(let s=0;s<256;s++){let l=Ar[s];Ar[s]=a,a+=l;}for(let s=0;s<n;s++){let l=t[s],c=Ar[l>>>i&255]++;o[c]=e[s],r[c]=l;}}function _a(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 zm(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 Yn(n,e,t,o,r,i,a,s){return (r-a)*(e-s)>=(n-a)*(i-s)&&(n-a)*(o-s)>=(t-a)*(e-s)&&(t-a)*(i-s)>=(r-a)*(o-s)}function Wm(n,e){let t=wr(n,e)&&$e(n.prev,n,n.next)>0&&$e(e.prev,e,e.next)>0;return n.next.i!==e.i&&(t||vr(n,e)&&vr(e,n)&&($e(n.prev,n,e.prev)!==0||$e(n,e.prev,e)!==0))&&!Nm(n,e)&&(t||Vm(n,e))}function $e(n,e,t){return (e.y-n.y)*(t.x-e.x)-(e.x-n.x)*(t.y-e.y)}function wr(n,e){return n.x===e.x&&n.y===e.y}function bc(n,e,t,o,r=true){let i=$e(n,e,t),a=$e(n,e,o),s=$e(t,o,n),l=$e(t,o,e);return (i>0&&a<0||i<0&&a>0)&&(s>0&&l<0||s<0&&l>0)?true:r?!!(i===0&&Jn(n,t,e)||a===0&&Jn(n,o,e)||s===0&&Jn(t,n,o)||l===0&&Jn(t,e,o)):false}function Jn(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 Nm(n,e){let t=Math.min(n.x,e.x),o=Math.max(n.x,e.x),r=Math.min(n.y,e.y),i=Math.max(n.y,e.y),a=n;do{let s=a.next;if(a.x>o&&s.x>o||a.x<t&&s.x<t||a.y>i&&s.y>i||a.y<r&&s.y<r){a=s;continue}if(a.i!==n.i&&s.i!==n.i&&a.i!==e.i&&s.i!==e.i&&bc(a,s,n,e))return true;a=s;}while(a!==n);return false}function vr(n,e){return $e(n.prev,n,n.next)<0?$e(n,e,n.next)>=0&&$e(n,n.prev,e)>=0:$e(n,e,n.prev)<0||$e(n,n.next,e)<0}function Vm(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 gc(n,e){let t=Ea(n.i,n.x,n.y),o=Ea(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 hc(n,e,t,o){let r=Ea(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 Cr(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),Ca&&Rm(n.prev,n.next);}function Ea(n,e,t){return {i:n,x:e,y:t,prev:null,next:null,z:0,prevZ:null,nextZ:null}}function Um(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 yc=23283064365386963e-26,Km=12,Ac=typeof TextDecoder>"u"?null:new TextDecoder("utf-8"),Sa=0,Zn=1,Br=2,qn=5,yo=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,Xm(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>=Km&&Ac?Ac.decode(this.buf.subarray(t,e)):ip(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===Br?this.readVarint()+this.pos:this.pos+1}skip(e){let t=e&7;if(t===Sa)for(;this.buf[this.pos++]>127;);else if(t===Br)this.pos=this.readVarint()+this.pos;else if(t===qn)this.pos+=4;else if(t===Zn)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*yc),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*yc),true),this.pos+=8;}writeVarint(e){if(e=+e||0,e>268435455||e<0){Jm(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=ap(this.buf,e,this.pos);let o=this.pos-t;o>=128&&xc(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&&xc(o,r,this),this.pos=o-1,this.writeVarint(r),this.pos+=r;}writeMessage(e,t,o){this.writeTag(e,Br),this.writeRawMessage(t,o);}writePackedVarint(e,t){t.length&&this.writeMessage(e,Zm,t);}writePackedSVarint(e,t){t.length&&this.writeMessage(e,qm,t);}writePackedBoolean(e,t){t.length&&this.writeMessage(e,ep,t);}writePackedFloat(e,t){t.length&&this.writeMessage(e,Qm,t);}writePackedDouble(e,t){t.length&&this.writeMessage(e,$m,t);}writePackedFixed32(e,t){t.length&&this.writeMessage(e,tp,t);}writePackedSFixed32(e,t){t.length&&this.writeMessage(e,op,t);}writePackedFixed64(e,t){t.length&&this.writeMessage(e,rp,t);}writePackedSFixed64(e,t){t.length&&this.writeMessage(e,np,t);}writeBytesField(e,t){this.writeTag(e,Br),this.writeBytes(t);}writeFixed32Field(e,t){this.writeTag(e,qn),this.writeFixed32(t);}writeSFixed32Field(e,t){this.writeTag(e,qn),this.writeSFixed32(t);}writeFixed64Field(e,t){this.writeTag(e,Zn),this.writeFixed64(t);}writeSFixed64Field(e,t){this.writeTag(e,Zn),this.writeSFixed64(t);}writeVarintField(e,t){this.writeTag(e,Sa),this.writeVarint(t);}writeSVarintField(e,t){this.writeTag(e,Sa),this.writeSVarint(t);}writeStringField(e,t){this.writeTag(e,Br),this.writeString(t);}writeFloatField(e,t){this.writeTag(e,qn),this.writeFloat(t);}writeDoubleField(e,t){this.writeTag(e,Zn),this.writeDouble(t);}writeBooleanField(e,t){this.writeVarintField(e,+t);}};function Xm(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 ko(n,r,e);throw new Error("Expected varint not more than 10 bytes")}function ko(n,e,t){return t?e*4294967296+(n>>>0):(e>>>0)*4294967296+(n>>>0)}function Jm(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),jm(t,o,e),Ym(o,e);}function jm(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 Ym(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 xc(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 Zm(n,e){for(let t=0;t<n.length;t++)e.writeVarint(n[t]);}function qm(n,e){for(let t=0;t<n.length;t++)e.writeSVarint(n[t]);}function Qm(n,e){for(let t=0;t<n.length;t++)e.writeFloat(n[t]);}function $m(n,e){for(let t=0;t<n.length;t++)e.writeDouble(n[t]);}function ep(n,e){for(let t=0;t<n.length;t++)e.writeBoolean(n[t]);}function tp(n,e){for(let t=0;t<n.length;t++)e.writeFixed32(n[t]);}function op(n,e){for(let t=0;t<n.length;t++)e.writeSFixed32(n[t]);}function rp(n,e){for(let t=0;t<n.length;t++)e.writeFixed64(n[t]);}function np(n,e){for(let t=0;t<n.length;t++)e.writeSFixed64(n[t]);}function ip(n,e,t){let o="",r=e;for(;r<t;){let i=n[r],a=null,s=i>239?4:i>223?3:i>191?2:1;if(r+s>t)break;let l,c,f;s===1?i<128&&(a=i):s===2?(l=n[r+1],(l&192)===128&&(a=(i&31)<<6|l&63,a<=127&&(a=null))):s===3?(l=n[r+1],c=n[r+2],(l&192)===128&&(c&192)===128&&(a=(i&15)<<12|(l&63)<<6|c&63,(a<=2047||a>=55296&&a<=57343)&&(a=null))):s===4&&(l=n[r+1],c=n[r+2],f=n[r+3],(l&192)===128&&(c&192)===128&&(f&192)===128&&(a=(i&15)<<18|(l&63)<<12|(c&63)<<6|f&63,(a<=65535||a>=1114112)&&(a=null))),a===null?(a=65533,s=1):a>65535&&(a-=65536,o+=String.fromCharCode(a>>>10&1023|55296),a=56320|a&1023),o+=String.fromCharCode(a),r+=s;}return o}function ap(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 Lo=(r=>(r[r.Unknown=0]="Unknown",r[r.Point=1]="Point",r[r.LineString=2]="LineString",r[r.Polygon=3]="Polygon",r))(Lo||{}),Qn=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(sp,a,t),a}loadGeometry(){if(this.geomOffset<0)return [];let e=this.pbf,t=e.pos;e.pos=this.geomOffset;let o=e.readVarint()+e.pos,r=1,i=0,a=0,s=0,l=[],c=[];for(;e.pos<o;){if(i<=0){let f=e.readVarint();r=f&7,i=f>>3;}if(i--,r===1||r===2)a+=e.readSVarint(),s+=e.readSVarint(),r===1&&(c.length&&l.push(c),c=[]),c.push(a,s);else if(r===7)c.length>=2&&c.push(c[0],c[1]);else throw new Error(`[osmgl] \u043D\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043D\u0430\u044F \u043A\u043E\u043C\u0430\u043D\u0434\u0430 \u0433\u0435\u043E\u043C\u0435\u0442\u0440\u0438\u0438 MVT: ${r}`)}return c.length&&l.push(c),e.pos=t,l}bbox(){let e=this.loadGeometry(),t=1/0,o=1/0,r=-1/0,i=-1/0;for(let a of e)for(let s=0;s<a.length;s+=2)a[s]<t&&(t=a[s]),a[s]>r&&(r=a[s]),a[s+1]<o&&(o=a[s+1]),a[s+1]>i&&(i=a[s+1]);return [t,o,r,i]}};function sp(n,e,t){t&&(n===1?e.id=t.readVarint():n===2?lp(t,e):n===3?e.type=t.readVarint():n===4&&(e.geomOffset=t.pos,t.skip(2)));}function lp(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 $n=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(cp,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 Qn.read(t,o,this.keys,this.values,this.extent)}*features(){for(let e=0;e<this.featureOffsets.length;e++)yield this.feature(e);}};function cp(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(fp(t)));}function fp(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 Ut=class{constructor(e){this.layers={};new yo(e instanceof Uint8Array?e:new Uint8Array(e)).readFields((o,r,i)=>{if(o===3&&i){let a=$n.read(i,i.readVarint()+i.pos);a.length&&(this.layers[a.name]=a);}},null);}};function Ao(n){let e=[],t=null;for(let o of n){if(o.length<6)continue;let r=Fa(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 Fa(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 Ro(n){return Array.isArray(n)&&typeof n[0]=="string"}var wc=new WeakMap;function to(n,e){if(!Ro(n))return n;let t=wc.get(n);t||(t=Bc(n),wc.set(n,t));try{return t(e)}catch{return null}}var vc=new WeakMap,up=new Set(["get","has","id","geometry-type","properties","feature-state","within"]);function St(n){if(!Array.isArray(n))return false;let e=vc.get(n);if(e!==void 0)return e;let t=typeof n[0]=="string"&&up.has(n[0]);if(!t){for(let o of n)if(St(o)){t=true;break}}return vc.set(n,t),t}function Ia(n,e,t){let o=to(n,e);return typeof o=="number"&&Number.isFinite(o)?o:t}function _r(n,e){let t=to(n,e);return typeof t=="string"?Ve(t):ti(t)?[t.r,t.g,t.b,t.a]:null}function ti(n){return !!n&&typeof n=="object"&&"r"in n&&"a"in n}function ei(n){if(ti(n))return n;if(typeof n=="string"){let[e,t,o,r]=Ve(n);return {r:e,g:t,b:o,a:r}}return null}var ke=n=>typeof n=="number"?n:Number(n),wt=n=>n===null?"":ti(n)?`rgba(${n.r},${n.g},${n.b},${n.a})`:typeof n=="string"?n:JSON.stringify(n),Mr=n=>!(n===null||n===false||n===0||n==="");function Pt(n,e){if(typeof n=="number"&&typeof e=="number")return n-e;let t=wt(n),o=wt(e);return t<o?-1:t>o?1:0}function Bc(n){let e=n[0],t=n.slice(1),o=i=>{let a=t[i];return Ro(a)?Bc(a):()=>a},r=t.map((i,a)=>o(a));switch(e){case "get":{let i=o(0),a=t.length>1?o(1):null;return s=>(a?a(s):s.properties)?.[wt(i(s))]??null}case "has":{let i=o(0),a=t.length>1?o(1):null;return s=>{let l=a?a(s):s.properties;return !!l&&l[wt(i(s))]!=null}}case "properties":return i=>i.properties??{};case "id":return i=>i.id??null;case "geometry-type":return i=>i.geometryType??null;case "feature-state":{let i=o(0);return a=>a.featureState?.[wt(i(a))]??null}case "global-state":{let i=o(0);return a=>a.globalState?.[wt(i(a))]??null}case "zoom":return i=>i.zoom??0;case "literal":return ()=>t[0];case "array":return i=>r[r.length-1](i);case "to-string":return i=>wt(r[0](i));case "to-number":return i=>{for(let a of r){let s=Number(a(i));if(Number.isFinite(s))return s}return 0};case "to-boolean":return i=>Mr(r[0](i));case "to-color":return i=>ei(r[0](i))??null;case "typeof":return i=>{let a=r[0](i);return a===null?"null":Array.isArray(a)?"array":ti(a)?"color":typeof a};case "rgb":case "rgba":return i=>({r:ke(r[0](i))/255,g:ke(r[1](i))/255,b:ke(r[2](i))/255,a:r[3]?ke(r[3](i)):1});case "to-rgba":return i=>{let a=ei(r[0](i));return a?[a.r*255,a.g*255,a.b*255,a.a]:null};case "case":return i=>{for(let a=0;a+1<r.length;a+=2)if(Mr(r[a](i)))return r[a+1](i);return r.length%2===1?r[r.length-1](i):null};case "match":return i=>{let a=r[0](i);for(let s=1;s+1<r.length;s+=2){let l=t[s];if(Array.isArray(l)?l.some(f=>Pt(f,a)===0):Pt(l,a)===0)return r[s+1](i)}return r.length%2===0?r[r.length-1](i):null};case "coalesce":return i=>{for(let a of r){let s=a(i);if(s!=null)return s}return null};case "all":return i=>r.every(a=>Mr(a(i)));case "any":return i=>r.some(a=>Mr(a(i)));case "!":return i=>!Mr(r[0](i));case "==":return i=>Pt(r[0](i),r[1](i))===0;case "!=":return i=>Pt(r[0](i),r[1](i))!==0;case "<":return i=>Pt(r[0](i),r[1](i))<0;case "<=":return i=>Pt(r[0](i),r[1](i))<=0;case ">":return i=>Pt(r[0](i),r[1](i))>0;case ">=":return i=>Pt(r[0](i),r[1](i))>=0;case "in":return i=>{let a=r[0](i),s=r[1](i);return typeof s=="string"?s.includes(wt(a)):Array.isArray(s)&&s.some(l=>Pt(l,a)===0)};case "index-of":return i=>{let a=r[0](i),s=r[1](i);return typeof s=="string"?s.indexOf(wt(a)):Array.isArray(s)?s.findIndex(l=>Pt(l,a)===0):-1};case "step":return i=>{let a=ke(r[0](i)),s=r[1](i);for(let l=2;l+1<r.length&&a>=ke(r[l](i));l+=2)s=r[l+1](i);return s};case "interpolate":case "interpolate-hcl":case "interpolate-lab":{let i=t[0],a=o(1),s=[];for(let l=2;l+1<t.length;l+=2)s.push({at:o(l),value:o(l+1)});return l=>{let c=ke(a(l));if(!s.length)return null;if(c<=ke(s[0].at(l)))return s[0].value(l);let f=s[s.length-1];if(c>=ke(f.at(l)))return f.value(l);for(let u=1;u<s.length;u++){let h=ke(s[u].at(l));if(c>h)continue;let d=ke(s[u-1].at(l)),m=hp(i,d,h,c);return Mc(s[u-1].value(l),s[u].value(l),m)}return f.value(l)}}case "+":return i=>r.reduce((a,s)=>a+ke(s(i)),0);case "*":return i=>r.reduce((a,s)=>a*ke(s(i)),1);case "-":return i=>r.length===1?-ke(r[0](i)):ke(r[0](i))-ke(r[1](i));case "/":return i=>ke(r[0](i))/ke(r[1](i));case "%":return i=>ke(r[0](i))%ke(r[1](i));case "^":return i=>Math.pow(ke(r[0](i)),ke(r[1](i)));case "abs":return i=>Math.abs(ke(r[0](i)));case "ceil":return i=>Math.ceil(ke(r[0](i)));case "floor":return i=>Math.floor(ke(r[0](i)));case "round":return i=>Math.round(ke(r[0](i)));case "sqrt":return i=>Math.sqrt(ke(r[0](i)));case "ln":return i=>Math.log(ke(r[0](i)));case "ln2":return ()=>Math.LN2;case "log10":return i=>Math.log10(ke(r[0](i)));case "log2":return i=>Math.log2(ke(r[0](i)));case "sin":return i=>Math.sin(ke(r[0](i)));case "cos":return i=>Math.cos(ke(r[0](i)));case "tan":return i=>Math.tan(ke(r[0](i)));case "asin":return i=>Math.asin(ke(r[0](i)));case "acos":return i=>Math.acos(ke(r[0](i)));case "atan":return i=>Math.atan(ke(r[0](i)));case "e":return ()=>Math.E;case "pi":return ()=>Math.PI;case "min":return i=>Math.min(...r.map(a=>ke(a(i))));case "max":return i=>Math.max(...r.map(a=>ke(a(i))));case "random":return i=>{let a=r.length>0?ke(r[0](i)):0,s=r.length>1?ke(r[1](i)):1;return a+Math.random()*(s-a)};case "concat":return i=>r.map(a=>wt(a(i))).join("");case "downcase":return i=>wt(r[0](i)).toLowerCase();case "upcase":return i=>wt(r[0](i)).toUpperCase();case "length":return i=>{let a=r[0](i);return typeof a=="string"?[...a].length:Array.isArray(a)?a.length:0};case "at":return i=>{let a=ke(r[0](i)),s=r[1](i);return Array.isArray(s)?s[a]??null:null};case "slice":return i=>{let a=r[0](i),s=ke(r[1](i)),l=r.length>2?ke(r[2](i)):void 0;return typeof a=="string"||Array.isArray(a)?a.slice(s,l):null};case "number-format":return i=>{let a=ke(r[0](i)),s=t[1]??{};return new Intl.NumberFormat(s.locale??void 0,{minimumFractionDigits:s["min-fraction-digits"],maximumFractionDigits:s["max-fraction-digits"],currency:s.currency,style:s.currency?"currency":void 0}).format(a)};case "let":{let i=[],a=[];for(let l=0;l+1<t.length-1;l+=2)i.push(t[l]),a.push(o(l+1));let s=o(t.length-1);return l=>{let c={...l.vars};return i.forEach((f,u)=>{c[f]=a[u](l);}),s({...l,vars:c})}}case "var":{let i=t[0];return a=>a.vars?.[i]??null}case "within":{let i=t[0];return a=>{let s=a.point;if(!s||!i?.coordinates)return false;let l=i.type==="MultiPolygon"?i.coordinates.flat():i.coordinates,c=false;for(let f of l)for(let u=0,h=f.length-1;u<f.length;h=u++){let[d,m]=f[u],[p,b]=f[h];m>s[1]!=b>s[1]&&s[0]<(p-d)*(s[1]-m)/(b-m)+d&&(c=!c);}return c}}default:return ()=>(Cc.has(e)||(Cc.add(e),console.warn(`[osmgl] \u0432\u044B\u0440\u0430\u0436\u0435\u043D\u0438\u0435 \xAB${e}\xBB \u043F\u043E\u043A\u0430 \u043D\u0435 \u043F\u043E\u0434\u0434\u0435\u0440\u0436\u0430\u043D\u043E`)),null)}}var Cc=new Set;function hp(n,e,t,o){let r=t-e,i=r===0?0:(o-e)/r;if(!Array.isArray(n))return i;let a=n[0];if(a==="exponential"){let s=Number(n[1]??1);return s===1||r===0?i:(Math.pow(s,o-e)-1)/(Math.pow(s,r)-1)}if(a==="cubic-bezier"){let[,s,l,c,f]=n;return dp(s,l,c,f,i)}return i}function dp(n,e,t,o,r){let i=3*n,a=3*(t-n)-i,s=1-i-a,l=3*e,c=3*(o-e)-l,f=1-l-c,u=r;for(let h=0;h<8;h++){let d=((s*u+a)*u+i)*u-r;if(Math.abs(d)<1e-5)break;let m=(3*s*u+2*a)*u+i;if(Math.abs(m)<1e-6)break;u-=d/m;}return ((f*u+c)*u+l)*u}function Mc(n,e,t){if(typeof n=="number"&&typeof e=="number")return n+(e-n)*t;let o=ei(n),r=ei(e);return o&&r?{r:o.r+(r.r-o.r)*t,g:o.g+(r.g-o.g)*t,b:o.b+(r.b-o.b)*t,a:o.a+(r.a-o.a)*t}:Array.isArray(n)&&Array.isArray(e)?n.map((i,a)=>Mc(i,e[a]??i,t)):t<.5?n:e}function pe(n,e,t){if(n===void 0)return t;if(typeof n=="number")return n;if(Ro(n))return Sc(n),Ia(n,{zoom:e,globalState:xo},t);let o=n.stops;return Fc(o,e,(r,i,a)=>r+(i-r)*a,t)}var xo={};function ht(n,e,t){if(n===void 0)return t;if(typeof n=="string")return Ve(n);if(Ro(n))return Sc(n),_r(n,{zoom:e,globalState:xo})??t;let o=n.stops;return Fc(o,e,(r,i,a)=>{let s=Ve(r),l=Ve(i);return [s[0]+(l[0]-s[0])*a,s[1]+(l[1]-s[1])*a,s[2]+(l[2]-s[2])*a,s[3]+(l[3]-s[3])*a]},t)}var _c=new WeakSet,Ec=new WeakSet;function oi(n){n&&typeof n=="object"&&Ec.add(n);}function Sc(n){Ec.has(n)||!St(n)||_c.has(n)||(_c.add(n),console.warn("[osmgl] \u0432\u044B\u0440\u0430\u0436\u0435\u043D\u0438\u0435 \u0441\u043C\u043E\u0442\u0440\u0438\u0442 \u043D\u0430 \u0444\u0438\u0447\u0443, \u0430 \u044D\u0442\u043E \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u0441\u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044F \u0440\u0430\u0437 \u043D\u0430 \u0441\u043B\u043E\u0439 \u2014 \u043E\u043D\u043E \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043F\u0430\u0441\u043D\u044B\u043C. \u041D\u0430 \u0444\u0438\u0447\u0435 \u0441\u0447\u0438\u0442\u0430\u044E\u0442\u0441\u044F \u0446\u0432\u0435\u0442, \u043F\u0440\u043E\u0437\u0440\u0430\u0447\u043D\u043E\u0441\u0442\u044C \u0438 \u0448\u0438\u0440\u0438\u043D\u0430 \u043B\u0438\u043D\u0438\u0438; \u0441\u043C. porting/maplibre-api.md, \u0444\u0430\u0437\u0430 7\u0431.",n));}function mp(n){let e=n[0];return pp.has(e)?e==="all"||e==="any"||e==="!"?false:Array.isArray(n[1]):true}var pp=new Set(["==","!=",">",">=","<","<=","in","!in","has","!has","all","any","!"]);function Fc(n,e,t,o){if(!n.length)return o;if(e<=n[0][0])return t(n[0][1],n[0][1],0);let r=n[n.length-1];if(e>=r[0])return t(r[1],r[1],0);for(let i=1;i<n.length;i++){let[a,s]=n[i];if(e>a)continue;let[l,c]=n[i-1],f=a-l,u=f===0?0:(e-l)/f;return t(c,s,u)}return o}function et(n,e,t){if(!n)return true;let o=n[0];if(mp(n))return to(n,{properties:e,id:t?.id??null,geometryType:t?.geometryType,featureState:t?.featureState,globalState:xo})===true;switch(o){case "all":return n.slice(1).every(r=>et(r,e));case "any":return n.slice(1).some(r=>et(r,e));case "!":return !et(n[1],e);case "has":return e[n[1]]!=null;case "!has":return e[n[1]]==null;case "in":{let r=e[n[1]];return r==null?false:n.slice(2).includes(r)}case "!in":{let r=e[n[1]];return r==null?true:!n.slice(2).includes(r)}default:{let r=e[n[1]],i=n[2];if(r==null)return o==="!=";switch(o){case "==":return r===i;case "!=":return r!==i;case ">":return r>i;case ">=":return r>=i;case "<":return r<i;case "<=":return r<=i;default:return true}}}}var bp=Math.PI/8,gp=.35,yp=32,Dc=.25,Tc=.5,kc=.07;function dt(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??gp,0),a=e.extent,s=[];for(let l=0;l<o;l++){let c=n[l*2],f=n[l*2+1],u=n[(l+o-1)%o*2],h=n[(l+o-1)%o*2+1],d=n[(l+1)%o*2],m=n[(l+1)%o*2+1],p=c-u,b=f-h,g=d-c,y=m-f,A=Math.hypot(p,b),x=Math.hypot(g,y);if(A<1e-6||x<1e-6){s.push(c,f);continue}let v=p/A,w=b/A,C=g/x,B=y/x;if(e.keep?.[l]){s.push(c,f);continue}let _=v*C+w*B;if(_>.985){s.push(c,f);continue}if(a!==void 0&&(c<=0||c>=a||f<=0||f>=a)){s.push(c,f);continue}let T=Math.min(t,A*Ic,x*Ic);if(T<t*i){s.push(c,f);continue}let k=c-v*T,K=f-w*T,P=c+C*T,W=f+B*T,z=Math.acos(Math.max(-1,Math.min(1,_))),L=Math.min(bp,Math.PI/2/r),X=Math.ceil(z/L-1e-6),Q=e.maxChord&&e.maxChord>0?Math.ceil(T/Math.tan(z/2)*z/e.maxChord):0,G=Math.max(1,Math.min(yp,Math.max(Math.min(r,X),Q)));s.push(k,K);for(let Y=1;Y<G;Y++){let ie=Y/G,ee=1-ie;s.push(ee*ee*k+2*ee*ie*c+ie*ie*P,ee*ee*K+2*ee*ie*f+ie*ie*W);}s.push(P,W);}return s.length<6?n:(s.push(s[0],s[1]),s)}var Ic=.4;function Er(n,e,t=6){let o=n.length/2;if(!(e>0)||o<3)return n;let r=[n[0],n[1]];for(let i=1;i<o-1;i++){let a=n[i*2-2],s=n[i*2-1],l=n[i*2],c=n[i*2+1],f=n[i*2+2],u=n[i*2+3],h=Math.hypot(l-a,c-s),d=Math.hypot(f-l,u-c);if(h<1e-6||d<1e-6)continue;let m=(a-l)/h,p=(s-c)/h,b=(f-l)/d,g=(u-c)/d,y=Math.max(-1,Math.min(1,m*b+p*g)),A=Math.acos(y)/2;if(A>Math.PI/2-.02){r.push(l,c);continue}let x=Math.tan(A);if(!(x>1e-6)){r.push(l,c);continue}let v=e/x,w=Math.min(h,d)*.5;v>w&&(v=w);let C=v*x;if(!(C>1e-4)){r.push(l,c);continue}let B=l+m*v,_=c+p*v,T=l+b*v,k=c+g*v,K=m+b,P=p+g,W=Math.hypot(K,P);if(W<1e-9){r.push(l,c);continue}K/=W,P/=W;let z=C/Math.sin(A),L=l+K*z,X=c+P*z,Q=Math.atan2(_-X,B-L),G=Math.atan2(k-X,T-L)-Q;for(;G>Math.PI;)G-=Math.PI*2;for(;G<-Math.PI;)G+=Math.PI*2;let Y=Math.max(2,Math.min(t,Math.ceil(Math.abs(G)/(Math.PI/2)*t)));for(let ie=0;ie<=Y;ie++){let ee=Q+G*ie/Y;r.push(L+Math.cos(ee)*C,X+Math.sin(ee)*C);}}return r.push(n[o*2-2],n[o*2-1]),r}function Po(n,e=2){let t=Array.from(n);for(let o=0;o<e&&!(t.length/2<3);o++){let i=[t[0],t[1]];for(let a=0;a+3<t.length;a+=2){let s=t[a],l=t[a+1],c=t[a+2],f=t[a+3];i.push(s+(c-s)*.25,l+(f-l)*.25),i.push(s+(c-s)*.75,l+(f-l)*.75);}i.push(t[t.length-2],t[t.length-1]),t=i;}return t}function Da(n,e){if(n.length/2<2||!(e>0))return n;let o=[n[0],n[1]];for(let r=0;r+3<n.length;r+=2){let i=n[r],a=n[r+1],s=n[r+2],l=n[r+3],c=Math.hypot(s-i,l-a),f=Math.ceil(c/e);for(let u=1;u<f;u++)o.push(i+(s-i)*u/f,a+(l-a)*u/f);o.push(s,l);}return o}var st=n=>n/64;function Kt(n,e,t=0){let o=Lc(n.outer,e,t);if(!o)return null;let r=[];for(let i of n.holes){let a=Lc(i,e,t);a&&r.push(a);}return {outer:o,holes:r}}function Lc(n,e,t){let o=[];for(let r=0;r<n.length-2;r+=2)o.push(n[r],n[r+1]);if(o.length<6)return null;for(let r=0;r<4;r++){let i=o;o=[];let a=i.length/2;if(a===0)return null;for(let s=0;s<a;s++){let l=i[s*2],c=i[s*2+1],f=i[(s+a-1)%a*2],u=i[(s+a-1)%a*2+1],h=Rc(l,c,r,e,t),d=Rc(f,u,r,e,t);if(h!==d){let m=Ap(f,u,l,c,r,e,t),p=r===0?-t:r===1?e+t:f+(l-f)*m,b=r===2?-t:r===3?e+t:u+(c-u)*m;o.push(p,b);}h&&o.push(l,c);}}return o.length<6?null:(o.push(o[0],o[1]),o)}function Rc(n,e,t,o,r){return t===0?n>=-r:t===1?n<=o+r:t===2?e>=-r:e<=o+r}function Ap(n,e,t,o,r,i,a){return r===0?(-a-n)/(t-n):r===1?(i+a-n)/(t-n):r===2?(-a-e)/(o-e):(i+a-e)/(o-e)}function ri(n,e,t,o,r,i=0){let a=-i,s=r+i;return n===a&&t===a||n===s&&t===s||e===a&&o===a||e===s&&o===s}function Ta(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 Pc=1,rt=18,Go=32,Xt=8,Vc=65535/Go,xp=9,wp=1,vp=0,Cp=1,Bp=2;var Hc=0,Mp=1,Oc=2,_p=3,Uc=.47;function Ra(n,e,t,o={},r){let i=o.metersPerUnit&&o.metersPerUnit>0?o.metersPerUnit:Uc,{b:a,ensure:s,take:l}=Kc(Math.max(1024,n.length*48));for(let c of n.features()){if(c.type!==3||!et(t,c.properties))continue;let f=Jp(c.properties),u=jp(c.properties,f);if(f<=u)continue;let h=Zp(c.properties)??Number(c.id??0),d=Xp(h>>>0),m=Kp(d,c.properties),p=Up(c.properties,f);o.paint?.setFeature(c.properties,c.id??null,"Polygon");let b=Ao(c.loadGeometry()),g=r?b.some(y=>{let A=Kt(y,e,st(e));return A?Ta(A.outer,e):false}):false;for(let y of b){if(r&&g){let A=Qp(y,e,f,u,h,d,m,p);A&&r.push(A);}jc(a,y,s,{extent:e,metersPerUnit:i,height:f,minHeight:u,featureId:h,seed:d,tint:m,facade:p,props:c.properties,cornerRadius:o.cornerRadius??0,cornerSegments:o.cornerSegments,whole:false});}o.paint?.advanceTo(a.vertexCount);}return l(e,o.paint)}function Kc(n){let e=n,t=new ArrayBuffer(e*rt),o={verts:new DataView(t),vertsU8:new Uint8Array(t),vertOffset:0,vertexCount:0,indices:[],featureIds:[],ensure:()=>{}},r=a=>{if(o.vertexCount+a<=e)return;e=Math.max(e*2,o.vertexCount+a);let s=new ArrayBuffer(e*rt);new Uint8Array(s).set(o.vertsU8.subarray(0,o.vertOffset)),t=s,o.verts=new DataView(s),o.vertsU8=new Uint8Array(s);};return o.ensure=r,{b:o,ensure:r,take:(a,s)=>{if(!o.indices.length)return null;let l=new Uint32Array(o.indices),c=new Float64Array(o.featureIds);return {vertices:t.slice(0,o.vertOffset),indices:l.buffer,featureIds:c.buffer,vertexCount:o.vertexCount,indexCount:l.length,extent:a,...s?{dataPaint:s.take(o.vertexCount)}:{}}}}}function Xc(n,e,t={}){let o=t.metersPerUnit&&t.metersPerUnit>0?t.metersPerUnit:Uc,{b:r,ensure:i,take:a}=Kc(Math.max(1024,n.length*64));for(let{rings:s,seam:l}of n)jc(r,s,i,{extent:e,metersPerUnit:o,height:l.height,minHeight:l.minHeight,featureId:l.osmId,seed:l.seed,tint:l.tint,facade:l.facade,props:{},cornerRadius:t.cornerRadius??0,cornerSegments:t.cornerSegments,whole:true});return a(e)}var Pa=(n,e)=>n|e<<2,Gc=n=>Math.max(-32768,Math.min(32767,n)),ka=n=>Math.max(0,Math.min(65535,Math.round(Math.min(n,Vc)*Go)));function Ho(n,e,t,o,r,i,a,s,l,c,f=0,u=0,h=0){let d=n.vertOffset;return n.verts.setInt16(d,Gc(Math.round(e*Xt)),true),n.verts.setInt16(d+2,Gc(Math.round(t*Xt)),true),n.verts.setUint16(d+4,Math.round(Math.min(o,Vc)*Go),true),n.vertsU8[d+6]=l,n.vertsU8[d+7]=s,n.verts.setInt8(d+8,La(Math.round(r*127))),n.verts.setInt8(d+9,La(Math.round(i*127))),n.verts.setInt8(d+10,La(Math.round(a*127))),n.vertsU8[d+11]=c,n.verts.setUint16(d+12,ka(f),true),n.verts.setUint16(d+14,ka(u),true),n.verts.setUint16(d+16,ka(h),true),n.vertOffset+=rt,n.vertexCount++}function zc(n,e,t,o,r,i,a,s,l,c){let f=e.length/2;if(f<3)return;let u=Pa(vp,a),h=Sp(e,s),d=o-t,m=new Float64Array(f*2),p=new Uint8Array(f);{let b=new Float64Array(f*2);for(let g=0;g<f-1;g++){let y=e[g*2+2]-e[g*2],A=e[g*2+3]-e[g*2+1],x=Math.hypot(y,A)||1;b[g*2]=A/x,b[g*2+1]=-y/x;}for(let g=0;g<f-1;g++){let y=(g+f-2)%(f-1),A=b[y*2]*b[g*2]+b[y*2+1]*b[g*2+1],x=b[y*2]+b[g*2],v=b[y*2+1]+b[g*2+1],w=Math.hypot(x,v);A>.5&&w>1e-6&&(m[g*2]=x/w,m[g*2+1]=v/w,p[g]=1);}}for(let b=0;b<f-1;b++){let g=e[b*2],y=e[b*2+1],A=e[b*2+2],x=e[b*2+3];if(g===A&&y===x||c[b])continue;let v=A-g,w=x-y,C=Math.hypot(v,w)||1,B=w/C,_=-v/C,T=h.offset[b],k=h.width[b],K=[0,1];if(l){for(let W=0;W<l.length;W++)for(let z=W+1;z<l.length;z++){let L=wo(l[W],g,y)-wo(l[z],g,y),X=wo(l[W],A,x)-wo(l[z],A,x);if(L===X)continue;let Q=L/(L-X);Q>1e-4&&Q<1-1e-4&&K.push(Q);}K.sort((W,z)=>W-z);}let P=(W,z)=>{if(!l)return o;let L=1/0;for(let X of l)L=Math.min(L,wo(X,W,z));return Math.max(o,L)};for(let W=0;W+1<K.length;W++){let z=K[W],L=K[W+1];if(L-z<1e-6)continue;let X=g+v*z,Q=y+w*z,G=g+v*L,Y=y+w*L,ie=T+C*z*s,ee=T+C*L*s,ue=(b+1)%(f-1),$=p[b]?m[b*2]:B,Ae=p[b]?m[b*2+1]:_,ve=p[ue]?m[ue*2]:B,he=p[ue]?m[ue*2+1]:_,xe=B+($-B)*(1-z),de=_+(Ae-_)*(1-z),we=B+(ve-B)*L,I=_+(he-_)*L,J=Math.hypot(xe,de)||1,Z=Math.hypot(we,I)||1,ce=xe/J,ae=de/J,be=we/Z,Se=I/Z;n.ensure(4);let F=Ho(n,X,Q,t,ce,ae,0,0,i,u,ie,k,d),U=Ho(n,G,Y,t,be,Se,0,0,i,u,ee,k,d),j=Ho(n,X,Q,P(X,Q),ce,ae,0,255,i,u,ie,k,d),R=Ho(n,G,Y,P(G,Y),be,Se,0,255,i,u,ee,k,d);n.indices.push(F,R,U,F,j,R),n.featureIds.push(r,r);}}}var Ep=.9976;function Sp(n,e){let t=n.length/2-1,o=[];for(let l=0;l<t;l++){let c=n[l*2+2]-n[l*2],f=n[l*2+3]-n[l*2+1],u=Math.hypot(c,f);o.push(u>0?{x:c/u,y:f/u,len:u*e}:{x:0,y:0,len:0});}let r=(l,c)=>o[l].len>0&&o[c].len>0&&o[l].x*o[c].x+o[l].y*o[c].y>=Ep,i=0;for(;i<t&&r((i-1+t)%t,i);)i++;i>=t&&(i=0);let a=new Array(t).fill(0),s=new Array(t).fill(0);for(let l=0;l<t;){let c=(i+l)%t,f=[c],u=o[c].len,h=l+1;for(;h<t;){let m=(i+h)%t;if(!r((i+h-1)%t,m))break;f.push(m),u+=o[m].len,h++;}let d=0;for(let m of f)a[m]=d,s[m]=u,d+=o[m].len;l=h;}return {offset:a,width:s}}function Fp(n,e,t,o,r,i,a){let s=[],l=[];for(let h=0;h<e.length;h++)s.push(e[h]);for(let h of t){l.push(s.length/2);for(let d=0;d<h.length;d++)s.push(h[d]);}let c=ot(s,l.length?l:void 0,2);if(!c.length)return;let f=Pa(Cp,a),u=n.vertexCount;for(let h=0;h<s.length;h+=2)Ho(n,s[h],s[h+1],o,0,0,1,255,i,f);for(let h=0;h<c.length;h+=3)n.indices.push(u+c[h],u+c[h+2],u+c[h+1]),n.featureIds.push(r);}function Ip(n){let e=Dp(n);if(e.length<3)return null;let t=Math.abs(Tp(n));if(t<=0)return null;let o=null,r=1/0;for(let i=0;i<e.length;i++){let a=(i+1)%e.length,s=e[a].x-e[i].x,l=e[a].y-e[i].y,c=Math.hypot(s,l);if(c<1e-6)continue;s/=c,l/=c;let f=1/0,u=-1/0,h=1/0,d=-1/0;for(let x of e){let v=x.x*s+x.y*l,w=-x.x*l+x.y*s;v<f&&(f=v),v>u&&(u=v),w<h&&(h=w),w>d&&(d=w);}let m=u-f,p=d-h,b=m*p;if(b<=0||b>=r)continue;r=b;let g=(f+u)/2,y=(h+d)/2,A=m>=p;o={cx:g*s-y*l,cy:g*l+y*s,ax:A?s:-l,ay:A?l:s,halfLong:(A?m:p)/2,halfShort:(A?p:m)/2,fill:t/b};}return o}function Dp(n){let e=[];for(let i=0;i<n.length-2;i+=2)e.push({x:n[i],y:n[i+1]});if(e.length<3)return e;e.sort((i,a)=>i.x===a.x?i.y-a.y:i.x-a.x);let t=(i,a,s)=>(a.x-i.x)*(s.y-i.y)-(a.y-i.y)*(s.x-i.x),o=[];for(let i of e){for(;o.length>=2&&t(o[o.length-2],o[o.length-1],i)<=0;)o.pop();o.push(i);}let r=[];for(let i=e.length-1;i>=0;i--){let a=e[i];for(;r.length>=2&&t(r[r.length-2],r[r.length-1],a)<=0;)r.pop();r.push(a);}return o.pop(),r.pop(),o.concat(r)}function Tp(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 kp=Math.tan(30*Math.PI/180),Lp=3.5,Rp=.9;function Pp(n,e,t,o,r){if(e.fill<.86)return null;let i=e.halfShort*2*r,a=e.halfLong*2*r,s=i*a,l=e.halfShort>0?e.halfLong/e.halfShort:99,c=Hp(n);if(!c){if(t>15||s>600||i<3)return null;let f=o%1e3/1e3;s<30?c=f<.5?"skillion":"gabled":l<1.25?c=f<.35?"pyramidal":"hipped":c=f<.8?"gabled":"hipped";}return c==="flat"?null:{shape:c}}function Hp(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 wo=(n,e,t)=>n.a*e+n.b*t+n.c;function Op(n,e,t,o){let r=n.length/2;if(r<3)return [];let i=[],a=s=>[n[s*2],n[s*2+1]];for(let s=0;s<r;s++){let[l,c]=a(s),[f,u]=a((s+r-1)%r),h=e*l+t*c+o,d=e*f+t*u+o;if(h<=0!=d<=0){let m=d/(d-h);i.push(f+(l-f)*m,u+(c-u)*m);}h<=0&&i.push(l,c);}return i}function Gp(n,e){let t=.5/Math.max(e,1e-6),o=n.length/2-1;if(o<5)return n;let r=[],i=0;r.push(n[0],n[1]);for(let a=1;a<o;a++){let s=n[i*2],l=n[i*2+1],c=n[a*2],f=n[a*2+1],u=c-s,h=f-l,d=Math.hypot(u,h),m=d>1e-6;if(m){for(let p=i+1;p<a;p++)if(Math.abs((n[p*2]-s)*h-(n[p*2+1]-l)*u)/d>=t){m=false;break}}m||(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 Jc(n,e,t){let{ax:o,ay:r,halfLong:i}=e;if(t==="skillion"){let l=-r,c=o;return [{a:l,b:c,c:-(l*e.cx+c*e.cy)+e.halfShort}]}let a=[],s=n.length/2-1;for(let l=0;l<s;l++){let c=n[l*2],f=n[l*2+1],u=n[(l+1)%s*2],h=n[(l+1)%s*2+1],d=u-c,m=h-f,p=Math.hypot(d,m);if(p<1e-6||t==="gabled"&&Math.abs((d*o+m*r)/p)<.86)continue;let b=-m/p,g=d/p;a.push({a:b,b:g,c:-(b*c+g*f)});}return !a.length&&i>0?Jc(n,e,"hipped"):a}function zp(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=Op(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 Wp(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=wo(n[o],r[i],r[i+1]);a>t&&(t=a);}}return t}function Np(n,e,t){return n.map(o=>({a:o.a*e,b:o.b*e,c:o.c*e+t}))}function Vp(n,e,t,o,r,i,a,s){let l=Pa(Bp,a);for(let c=0;c<t.length;c++){let f=e[c];if(!f||f.length<6)continue;let u=ot(f,void 0,2);if(!u.length)continue;let h=-t[c].a/s,d=-t[c].b/s,m=Math.hypot(h,d,1),p={x:h/m,y:d/m,z:1/m};n.ensure(f.length/2);let b=n.vertexCount;for(let g=0;g<f.length;g+=2){let y=Math.max(o,wo(t[c],f[g],f[g+1]));Ho(n,f[g],f[g+1],y,p.x,p.y,p.z,255,i,l);}for(let g=0;g<u.length;g+=3)n.indices.push(b+u[g],b+u[g+2],b+u[g+1]),n.featureIds.push(r);}}function Up(n,e){let t=String(n.class??"").toLowerCase();return t==="industrial"||t==="warehouse"||t==="hangar"||t==="construction"?_p:t==="commercial"||t==="office"||t==="retail"||t==="supermarket"?Oc:t==="house"||t==="detached"||t==="garage"||t==="hut"||t==="shed"||e<=7?Hc:e>=40?Oc:Mp}function Kp(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 Xp(n){let e=n>>>0;return e=(e>>>16^e)*73244475,e=(e>>>16^e)*73244475,e=e>>>16^e,e>>>0}function Jp(n){let e=Oo(n.render_height)??Oo(n.height)??Yp(n.levels??n.building_levels??n["building:levels"]);return e&&e>0?Math.max(e,wp):xp}function jp(n,e){let t=Oo(n.render_min_height)??Oo(n.min_height)??Oo(n.base)??0;return t>0&&t<e?t:0}function Yp(n){let e=Oo(n);return e&&e>0?e*3:null}function Oo(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 La=n=>n>127?127:n<-127?-127:n;function Zp(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}function Wc(n,e){let t=n.length/2-1,o=new Array(Math.max(t,0)).fill(false);if(t<3)return {ring:n,cut:o};let r=(a,s)=>a===0?1:a===e?2:s===0?3:s===e?4:0,i=n.slice();for(let a=0;a<t;a++){let s=n[a*2],l=n[a*2+1],c=r(s,l);if(!c)continue;let f=(a+t-1)%t,u=(a+1)%t,h=r(n[f*2],n[f*2+1])===c,d=r(n[u*2],n[u*2+1])===c;d&&(o[a]=true);let m=h===d?-1:h?u:f;if(m<0)continue;let p=s-n[m*2],b=l-n[m*2+1],g=Math.hypot(p,b);g<1e-6||(i[a*2]=s+p/g*Pc,i[a*2+1]=l+b/g*Pc);}return i[t*2]=i[0],i[t*2+1]=i[1],{ring:i,cut:o}}function jc(n,e,t,o){let{extent:r,metersPerUnit:i,height:a,minHeight:s,featureId:l,seed:c,tint:f,facade:u}=o,h=o.whole?e:Kt(e,r,st(r));if(!h)return;let d=o.cornerRadius/i,m={radius:d,segments:o.cornerSegments,minCutRatio:0,maxChord:i>0?Tc/i:0,...o.whole?{}:{extent:r,margin:st(r)}},p=d>0?{outer:dt(h.outer,m),holes:h.holes.map(k=>dt(k,m))}:h,b=o.whole?p:Kt(p,r);if(!b)return;let g=k=>({ring:k,cut:new Array(Math.max(k.length/2-1,0)).fill(false)}),y=o.whole?g(b.outer):Wc(b.outer,r),A=b.holes.map(k=>o.whole?g(k):Wc(k,r)),x={outer:y.ring,holes:A.map(k=>k.ring)},v=o.whole?true:Ta(x.outer,r),w=x.outer.length/2+x.holes.reduce((k,K)=>k+K.length/2,0);t(w*5+32);let C=x.holes.length||v?null:Ip(x.outer),B=C?Pp(o.props,C,a,c,i):null,_=null,T=[];if(B&&C){let k=Jc(Gp(x.outer,i),C,B.shape);T=zp(k,x.outer);let K=Wp(k,T);if(K>1e-6){let P=Math.min(Math.max(K*i*kp,Rp),Lp);_=Np(k,P/K,a);}}zc(n,x.outer,s,a,l,f,u,i,_,y.cut);for(let k=0;k<x.holes.length;k++)zc(n,x.holes[k],s,a,l,f,u,i,null,A[k].cut);_?Vp(n,T,_,a,l,f,u,i):Fp(n,x.outer,x.holes,a,l,f,u);}function qp(n,e){let t=1/0,o=1/0,r=-1/0,i=-1/0;for(let a=0;a<n.length;a+=2)n[a]<t&&(t=n[a]),n[a]>r&&(r=n[a]),n[a+1]<o&&(o=n[a+1]),n[a+1]>i&&(i=n[a+1]);return r>0&&t<e&&i>0&&o<e}function Nc(n,e){let t=st(e),o=Math.max(n.length/2-1,0),r=new Array(o);for(let i=0;i<o;i++)r[i]=ri(n[i*2],n[i*2+1],n[i*2+2],n[i*2+3],e,t);return r}function Qp(n,e,t,o,r,i,a,s){let l=Kt(n,e,st(e));if(!l||!qp(l.outer,e))return null;let c=Nc(l.outer,e);return {osmId:r,height:t,minHeight:o,seed:i,tint:a,facade:s,outer:l.outer,holes:l.holes,outerCut:c,holeCuts:l.holes.map(f=>Nc(f,e))}}var Ft=4;function Ha(n,e,t,o,r){let i=o*o,a=[],s=f=>n[f*2],l=f=>n[f*2+1],c=(f,u)=>{let h=n.length/2;return n.push((s(f)+s(u))/2,(l(f)+l(u))/2),h};for(let f=0;f<e.length;f+=3){a.push([t+e[f],t+e[f+1],t+e[f+2]]);let u=0;for(;a.length&&!(++u>2e4);){let[h,d,m]=a.pop(),p=(s(h)-s(d))**2+(l(h)-l(d))**2,b=(s(d)-s(m))**2+(l(d)-l(m))**2,g=(s(m)-s(h))**2+(l(m)-l(h))**2,y=Math.max(p,b,g);if(y<=i){r.push(h,d,m);continue}if(y===p){let A=c(h,d);a.push([h,A,m],[A,d,m]);}else if(y===b){let A=c(d,m);a.push([d,A,h],[A,m,h]);}else {let A=c(m,h);a.push([m,A,d],[A,h,d]);}}}}function Oa(n,e,t=0,o,r=false,i=4096,a){let s=[],l=[],c=[];for(let m of n.features()){if(m.type!==3||!et(e,m.properties))continue;let p=m.properties.osm_id,b=typeof p=="number"?p:typeof p=="string"?Number(p):NaN,g=Number.isFinite(b)?b:Number(m.id??0);a?.setFeature(m.properties,m.id??null,"Polygon");for(let y of Ao(m.loadGeometry())){let A=r?Kt(y,i):y;if(!A)continue;let x=[],v=[],w=o?dt(A.outer,o):A.outer;for(let _=0;_<w.length;_++)x.push(w[_]);for(let _ of A.holes){let T=o?dt(_,o):_;v.push(x.length/2);for(let k=0;k<T.length;k++)x.push(T[k]);}let C=ot(x,v.length?v:void 0,2);if(!C.length)continue;let B=s.length/2;for(let _=0;_<x.length;_++)s.push(x[_]);if(t>0){let _=[];Ha(s,C,B,t,_);for(let T=0;T<_.length;T+=3)l.push(_[T],_[T+2],_[T+1]),c.push(g);continue}for(let _=0;_<C.length;_+=3)l.push(B+C[_],B+C[_+2],B+C[_+1]),c.push(g);}a?.advanceTo(s.length/2);}if(!l.length)return null;let f=s.length/2,u=new Int16Array(s),h=new Uint32Array(l);return {featureIds:new Float64Array(c).buffer,vertices:u.buffer,indices:h.buffer,vertexCount:f,indexCount:h.length,...a?{dataPaint:a.take(f)}:{}}}function $p(n,e){return zo(n,e)?.outer??null}function zo(n,e){let t=e.halfWidth;if(!(t>0))return null;let o=e0(n);if(o.length<4)return null;let r=t0(t,e.metersPerUnit),i=[],a=o.length/2,s=new Float64Array(a);for(let p=1;p<a;p++)s[p]=s[p-1]+Math.hypot(o[p*2]-o[p*2-2],o[p*2+1]-o[p*2-1]);let l=e.halfWidthAt,c=l?p=>Math.max(l(p),0):()=>t,f=p=>c(s[(p%a+a)%a]),u=1/0;for(let p=0;p<a;p++)u=Math.min(u,f(p));if(e.closed===true){let p=[],b=[];ni(p,o,f,true,r,true),ni(b,o,f,false,r,true);let g=[];for(let x of [p,b]){let v=Yc(x);if(v.length<8)continue;v.push(v[0],v[1]);let w=Qc(v,o,s,c,u);w&&w.length>=8&&g.push(w);}if(!g.length)return null;g.sort((x,v)=>Math.abs(Sr(v))-Math.abs(Sr(x)));let y=Sr(g[0])<0?Ga(g[0]):g[0],A=g.slice(1).map(x=>Sr(x)>0?Ga(x):x);return {outer:y,holes:A}}if(ni(i,o,f,true,r,false),ni(i,o,f,false,r,false),i.length<8)return null;let d=Yc(i);if(d.length<8)return null;d.push(d[0],d[1]);let m=Qc(d,o,s,c,u);return !m||m.length<8?null:{outer:Sr(m)<0?Ga(m):m,holes:[]}}function Yc(n){let e=[];for(let o=0;o+1<n.length;o+=2){let r=e.length;r>=2&&Math.abs(e[r-2]-n[o])<1e-9&&Math.abs(e[r-1]-n[o+1])<1e-9||e.push(n[o],n[o+1]);}let t=e.length;return t>=4&&Math.abs(e[0]-e[t-2])<1e-9&&Math.abs(e[1]-e[t-1])<1e-9&&(e.length=t-2),e}function Sr(n){let e=0;for(let t=0;t+3<n.length;t+=2)e+=n[t]*n[t+3]-n[t+2]*n[t+1];return e/2}function Ga(n){let e=[];for(let t=n.length-2;t>=0;t-=2)e.push(n[t],n[t+1]);return e}function e0(n){let e=[];for(let t=0;t+1<n.length;t+=2){let o=n[t],r=n[t+1],i=e.length;i>=2&&Math.abs(e[i-2]-o)<1e-6&&Math.abs(e[i-1]-r)<1e-6||e.push(o,r);}return e}function t0(n,e){let t=n*(e>0?e:.5),o=Math.ceil(Math.PI*t/1);return Math.max(2,Math.min(10,o))}function ni(n,e,t,o,r,i){let a=e.length/2,s=c=>{let f=(c%a+a)%a;return [e[f*2],e[f*2+1]]},l=[];if(o)for(let c=0;c<a;c++)l.push(c);else for(let c=a-1;c>=0;c--)l.push(c);for(let c=0;c<l.length;c++){let f=l[c],u=c>0?l[c-1]:i?l[l.length-1]:-1,h=c+1<l.length?l[c+1]:i?l[0]:-1,[d,m]=s(f),p=t(f);if(!(p>0))continue;let b=u>=0?qc(s(u),[d,m]):null,g=h>=0?qc([d,m],s(h)):null;if(b&&g){let y=b[0]*g[1]-b[1]*g[0],x=1+(b[0]*g[0]+b[1]*g[1]),v=x>1e-6?p*Math.sqrt(2/x):1/0,w=Zc(s(u),[d,m]),C=Zc([d,m],s(h));y>0&&v<=p*2&&v<=Math.min(w,C)?n.push(d+(b[0]+g[0])*p/x,m+(b[1]+g[1])*p/x):za(n,d,m,p,b,g,r);}else g?za(n,d,m,p,[-g[1],g[0]],g,r):b&&za(n,d,m,p,b,[b[1],-b[0]],r);}}function Zc(n,e){return Math.hypot(e[0]-n[0],e[1]-n[1])}function qc(n,e){let t=e[0]-n[0],o=e[1]-n[1],r=Math.hypot(t,o);return r>0?[-o/r,t/r]:null}function za(n,e,t,o,r,i,a){let s=Math.atan2(r[1],r[0]),l=Math.atan2(i[1],i[0])-s;for(;l>Math.PI;)l-=2*Math.PI;for(;l<-Math.PI;)l+=2*Math.PI;let c=Math.max(1,Math.min(a,Math.ceil(Math.abs(l)/Math.PI*a)));for(let f=0;f<=c;f++){let u=s+l*f/c;n.push(e+Math.cos(u)*o,t+Math.sin(u)*o);}}function Qc(n,e,t,o,r){let i=n0(n);if(!i.length)return n;let a=[],s=[],l=n.length/2-1,c=[];for(let m=0;m<l;m++){a.push(n[m*2],n[m*2+1]),s.push(false),c.length=0;for(let p of i)p.i===m&&c.push({t:p.t,x:p.x,y:p.y}),p.j===m&&c.push({t:p.u,x:p.x,y:p.y});if(c.length){c.sort((p,b)=>p.t-b.t);for(let p of c)a.push(p.x,p.y),s.push(true);}}let f=s.length,u=s.indexOf(true);if(u<0)return n;let h=[],d=0;for(let m=1;m<=f;m++){let p=(u+m)%f;if(!s[p])continue;let b=m;if(!o0(a,u,d,b,f,e,t,o,r))for(let g=d;g<=b;g++){let y=(u+g)%f,A=a[y*2],x=a[y*2+1],v=h.length;v>=2&&Math.abs(h[v-2]-A)<1e-9&&Math.abs(h[v-1]-x)<1e-9||h.push(A,x);}d=b;}return h.length<6?n:(h.push(h[0],h[1]),h)}function o0(n,e,t,o,r,i,a,s,l){for(let c=t;c<=o;c++){let f=(e+c)%r;if(r0(n[f*2],n[f*2+1],i,a,s,l))return true}return false}function r0(n,e,t,o,r,i){let a=t.length/2-1,s=i*(1-.01),l=s*s,c=1/0,f=0,u=0;for(let g=0;g<a;g++){let y=t[g*2],A=t[g*2+1],x=t[g*2+2]-y,v=t[g*2+3]-A,w=x*x+v*v,C=w>0?Math.max(0,Math.min(1,((n-y)*x+(e-A)*v)/w)):0,B=n-(y+x*C),_=e-(A+v*C),T=B*B+_*_;if(T<l)return true;T<c&&(c=T,f=g,u=C);}if(!(c<1/0))return false;let h=t[f*2],d=t[f*2+1],m=t[f*2+2]-h,p=t[f*2+3]-d,b=r(o[f]+Math.hypot(m,p)*u)*(1-.01);return c<b*b}function n0(n){let e=[],t=n.length/2-1;if(t<4)return e;let o=new Float64Array(t),r=new Float64Array(t),i=new Float64Array(t),a=new Float64Array(t),s=[];for(let l=0;l<t;l++){s.push(l);let c=n[l*2],f=n[l*2+2],u=n[l*2+1],h=n[l*2+3];o[l]=c<f?c:f,r[l]=c<f?f:c,i[l]=u<h?u:h,a[l]=u<h?h:u;}s.sort((l,c)=>o[l]-o[c]);for(let l=0;l<s.length;l++){let c=s[l];for(let f=l+1;f<s.length;f++){let u=s[f];if(o[u]>r[c])break;let h=Math.abs(c-u);if(h<2||h===t-1||i[u]>a[c]||i[c]>a[u])continue;let d=c<u?c:u,m=c<u?u:c,p=i0(n[d*2],n[d*2+1],n[d*2+2],n[d*2+3],n[m*2],n[m*2+1],n[m*2+2],n[m*2+3]);p&&e.push({i:d,j:m,t:p[2],u:p[3],x:p[0],y:p[1]});}}return e}function i0(n,e,t,o,r,i,a,s){let l=t-n,c=o-e,f=a-r,u=s-i,h=l*u-c*f;if(Math.abs(h)<1e-12)return null;let d=((r-n)*u-(i-e)*f)/h,m=((r-n)*c-(i-e)*l)/h;return d<=1e-9||d>=1-1e-9||m<=1e-9||m>=1-1e-9?null:[n+l*d,e+c*d,d,m]}var a0=5;function vt(n){let e=n.layer,t=typeof e=="number"?e:typeof e=="string"?Number(e):NaN;if(Number.isFinite(t)&&t!==0)return Math.max(-5,Math.min(5,Math.trunc(t)));let o=n.brunnel;return o==="bridge"?1:o==="tunnel"?-1:0}var $c=new WeakMap,oo=(n,e)=>(n+512)*65536+(e+512);function tf(n,e,t,o,r){if(n===0||e<=0)return e;let i=8*4294967296,a=Math.max(r.raw.get(t+i)??0,r.raw.get(o+i)??0);return a>0&&e>a?a:e}function Fr(n){let e=$c.get(n);if(e)return e;let t={width:new Map,ends:new Map,raw:new Map},o=[];for(let r of n.features()){if(r.type!==2)continue;let i=r.properties.width,a=typeof i=="number"&&i>.5&&i<100?i:0,s=vt(r.properties);for(let l of r.loadGeometry()){if(l.length<4)continue;let c=oo(Math.round(l[0]),Math.round(l[1])),f=oo(Math.round(l[l.length-2]),Math.round(l[l.length-1]));for(let u of [c,f]){let h=u+(s+8)*4294967296;t.ends.set(h,(t.ends.get(h)??0)+1),a>0&&t.raw.set(h,Math.max(t.raw.get(h)??0,a));}o.push({h:c,t:f,lv:s,w:a});}}for(let r of o){let i=tf(r.lv,r.w,r.h,r.t,t);if(!(i<=0))for(let a of [r.h,r.t]){let s=t.width.get(a);(s===void 0||i>s)&&t.width.set(a,i);}}return $c.set(n,t),t}var Ir=12;function Dr(n,e){let t=n.length/2,o=0;for(let d=0;d<t-1;d++)o+=Math.hypot(n[d*2+2]-n[d*2],n[d*2+3]-n[d*2+1]);let r=oo(Math.round(n[0]),Math.round(n[1])),i=oo(Math.round(n[t*2-2]),Math.round(n[t*2-1])),a=tf(e.level,e.width,r,i,e.junctions),s=d=>Math.min(e.junctions.width.get(d)??0,a*2),l=s(r)-a,c=s(i)-a,f=Math.min(e.taper,o/2);if(!(f>0)||l<=0&&c<=0)return {width:a,at:null,total:o,knots:[]};let u=d=>{let m=0;return l>0&&d<f&&(m=l*(1-d/f)),c>0&&o-d<f&&(m=Math.max(m,c*(1-(o-d)/f))),a+m},h=[];for(let d of [f,o-f])d>.01&&d<o-.01&&h.push(d);return {width:a,at:u,total:o,knots:h}}function of(n,e){let t=[...e].sort((a,s)=>a-s);if(!t.length)return n;let o=[n[0],n[1]],r=0,i=0;for(let a=0;a+3<n.length;a+=2){let s=n[a],l=n[a+1],c=n[a+2],f=n[a+3],u=Math.hypot(c-s,f-l);for(;i<t.length&&t[i]<=r+.01;)i++;for(;i<t.length&&t[i]<r+u-.01;){let h=(t[i]-r)/u;o.push(s+(c-s)*h,l+(f-l)*h),i++;}r+=u,o.push(c,f);}return o}function Wa(n,e,t){let o=[];for(let l of n.features()){if(l.type!==2||!e(l.properties))continue;let c=t(l.properties);if(!c||!(c>0))continue;let f=l.properties.osm_id,u=typeof f=="number"?f:typeof f=="string"?Number(f):NaN,h=Number.isFinite(u)?u:Number(l.id??0),d=vt(l.properties);for(let m of l.loadGeometry())m.length<4||o.push({pts:Array.from(m),props:l.properties,id:h,w:c,lv:d,used:false});}let r=new Map,i=(l,c)=>c?oo(Math.round(l[l.length-2]),Math.round(l[l.length-1])):oo(Math.round(l[0]),Math.round(l[1]));o.forEach((l,c)=>{for(let f of [false,true]){let u=i(l.pts,f),h=r.get(u);h?h.push({piece:c,tail:f}):r.set(u,[{piece:c,tail:f}]);}});let a=(l,c,f)=>{let u=r.get(l);if(!u||u.length!==2)return null;let h=u.filter(m=>!o[m.piece].used);if(h.length!==1)return null;let d=o[h[0].piece];return d.w===c&&d.lv===f?h[0]:null},s=[];for(let l=0;l<o.length;l++){let c=o[l];if(c.used)continue;c.used=true;let f=c.pts.slice(),u=[c.id];for(let h=0;h<256;h++){let d=a(i(f,true),c.w,c.lv);if(!d)break;let m=o[d.piece];m.used=true;let p=d.tail?ef(m.pts):m.pts;for(let b=2;b<p.length;b+=2)f.push(p[b],p[b+1]);u.push(m.id);}for(let h=0;h<256;h++){let d=a(i(f,false),c.w,c.lv);if(!d)break;let m=o[d.piece];m.used=true;let p=d.tail?m.pts:ef(m.pts),b=[];for(let g=0;g+3<p.length;g+=2)b.push(p[g],p[g+1]);f=b.concat(f),u.push(m.id);}s.push({pts:f,props:c.props,ids:u});}return s}function ef(n){let e=[];for(let t=n.length-2;t>=0;t-=2)e.push(n[t],n[t+1]);return e}var Pr={};Gl(Pr,{default:()=>E0});var Ht=class{constructor(e,t){this.next=null,this.key=e,this.data=t,this.left=null,this.right=null;}};function s0(n,e){return n>e?1:n<e?-1:0}function ro(n,e,t){let o=new Ht(null,null),r=o,i=o;for(;;){let a=t(n,e.key);if(a<0){if(e.left===null)break;if(t(n,e.left.key)<0){let s=e.left;if(e.left=s.right,s.right=e,e=s,e.left===null)break}i.left=e,i=e,e=e.left;}else if(a>0){if(e.right===null)break;if(t(n,e.right.key)>0){let s=e.right;if(e.right=s.left,s.left=e,e=s,e.right===null)break}r.right=e,r=e,e=e.right;}else break}return r.right=e.left,i.left=e.right,e.left=o.right,e.right=o.left,e}function Na(n,e,t,o){let r=new Ht(n,e);if(t===null)return r.left=r.right=null,r;t=ro(n,t,o);let i=o(n,t.key);return i<0?(r.left=t.left,r.right=t,t.left=null):i>=0&&(r.right=t.right,r.left=t,t.right=null),r}function rf(n,e,t){let o=null,r=null;if(e){e=ro(n,e,t);let i=t(e.key,n);i===0?(o=e.left,r=e.right):i<0?(r=e.right,e.right=null,o=e):(o=e.left,e.left=null,r=e);}return {left:o,right:r}}function l0(n,e,t){return e===null?n:(n===null||(e=ro(n.key,e,t),e.left=n),e)}function Va(n,e,t,o,r){if(n){o(`${e}${t?"\u2514\u2500\u2500 ":"\u251C\u2500\u2500 "}${r(n)}
9
- `);let i=e+(t?" ":"\u2502 ");n.left&&Va(n.left,i,false,o,r),n.right&&Va(n.right,i,true,o,r);}}var Wo=class{constructor(e=s0){this._root=null,this._size=0,this._comparator=e;}insert(e,t){return this._size++,this._root=Na(e,t,this._root,this._comparator)}add(e,t){let o=new Ht(e,t);this._root===null&&(o.left=o.right=null,this._size++,this._root=o);let r=this._comparator,i=ro(e,this._root,r),a=r(e,i.key);return a===0?this._root=i:(a<0?(o.left=i.left,o.right=i,i.left=null):a>0&&(o.right=i.right,o.left=i,i.right=null),this._size++,this._root=o),this._root}remove(e){this._root=this._remove(e,this._root,this._comparator);}_remove(e,t,o){let r;return t===null?null:(t=ro(e,t,o),o(e,t.key)===0?(t.left===null?r=t.right:(r=ro(e,t.left,o),r.right=t.right),this._size--,r):t)}pop(){let e=this._root;if(e){for(;e.left;)e=e.left;return this._root=ro(e.key,this._root,this._comparator),this._root=this._remove(e.key,this._root,this._comparator),{key:e.key,data:e.data}}return null}findStatic(e){let t=this._root,o=this._comparator;for(;t;){let r=o(e,t.key);if(r===0)return t;r<0?t=t.left:t=t.right;}return null}find(e){return this._root&&(this._root=ro(e,this._root,this._comparator),this._comparator(e,this._root.key)!==0)?null:this._root}contains(e){let t=this._root,o=this._comparator;for(;t;){let r=o(e,t.key);if(r===0)return true;r<0?t=t.left:t=t.right;}return false}forEach(e,t){let o=this._root,r=[],i=false;for(;!i;)o!==null?(r.push(o),o=o.left):r.length!==0?(o=r.pop(),e.call(t,o),o=o.right):i=true;return this}range(e,t,o,r){let i=[],a=this._comparator,s=this._root,l;for(;i.length!==0||s;)if(s)i.push(s),s=s.left;else {if(s=i.pop(),l=a(s.key,t),l>0)break;if(a(s.key,e)>=0&&o.call(r,s))return this;s=s.right;}return this}keys(){let e=[];return this.forEach(({key:t})=>{e.push(t);}),e}values(){let e=[];return this.forEach(({data:t})=>{e.push(t);}),e}min(){return this._root?this.minNode(this._root).key:null}max(){return this._root?this.maxNode(this._root).key:null}minNode(e=this._root){if(e)for(;e.left;)e=e.left;return e}maxNode(e=this._root){if(e)for(;e.right;)e=e.right;return e}at(e){let t=this._root,o=false,r=0,i=[];for(;!o;)if(t)i.push(t),t=t.left;else if(i.length>0){if(t=i.pop(),r===e)return t;r++,t=t.right;}else o=true;return null}next(e){let t=this._root,o=null;if(e.right){for(o=e.right;o.left;)o=o.left;return o}let r=this._comparator;for(;t;){let i=r(e.key,t.key);if(i===0)break;i<0?(o=t,t=t.left):t=t.right;}return o}prev(e){let t=this._root,o=null;if(e.left!==null){for(o=e.left;o.right;)o=o.right;return o}let r=this._comparator;for(;t;){let i=r(e.key,t.key);if(i===0)break;i<0?t=t.left:(o=t,t=t.right);}return o}clear(){return this._root=null,this._size=0,this}toList(){return f0(this._root)}load(e,t=[],o=false){let r=e.length,i=this._comparator;if(o&&Xa(e,t,0,r-1,i),this._root===null)this._root=Ua(e,t,0,r),this._size=r;else {let a=u0(this.toList(),c0(e,t),i);r=this._size+r,this._root=Ka({head:a},0,r);}return this}isEmpty(){return this._root===null}get size(){return this._size}get root(){return this._root}toString(e=t=>String(t.key)){let t=[];return Va(this._root,"",true,o=>t.push(o),e),t.join("")}update(e,t,o){let r=this._comparator,{left:i,right:a}=rf(e,this._root,r);r(e,t)<0?a=Na(t,o,a,r):i=Na(t,o,i,r),this._root=l0(i,a,r);}split(e){return rf(e,this._root,this._comparator)}*[Symbol.iterator](){let e=this._root,t=[],o=false;for(;!o;)e!==null?(t.push(e),e=e.left):t.length!==0?(e=t.pop(),yield e,e=e.right):o=true;}};function Ua(n,e,t,o){let r=o-t;if(r>0){let i=t+Math.floor(r/2),a=n[i],s=e[i],l=new Ht(a,s);return l.left=Ua(n,e,t,i),l.right=Ua(n,e,i+1,o),l}return null}function c0(n,e){let t=new Ht(null,null),o=t;for(let r=0;r<n.length;r++)o=o.next=new Ht(n[r],e[r]);return o.next=null,t.next}function f0(n){let e=n,t=[],o=false,r=new Ht(null,null),i=r;for(;!o;)e?(t.push(e),e=e.left):t.length>0?(e=i=i.next=t.pop(),e=e.right):o=true;return i.next=null,r.next}function Ka(n,e,t){let o=t-e;if(o>0){let r=e+Math.floor(o/2),i=Ka(n,e,r),a=n.head;return a.left=i,n.head=n.head.next,a.right=Ka(n,r+1,t),a}return null}function u0(n,e,t){let o=new Ht(null,null),r=o,i=n,a=e;for(;i!==null&&a!==null;)t(i.key,a.key)<0?(r.next=i,i=i.next):(r.next=a,a=a.next),r=r.next;return i!==null?r.next=i:a!==null&&(r.next=a),o.next}function Xa(n,e,t,o,r){if(t>=o)return;let i=n[t+o>>1],a=t-1,s=o+1;for(;;){do a++;while(r(n[a],i)<0);do s--;while(r(n[s],i)>0);if(a>=s)break;let l=n[a];n[a]=n[s],n[s]=l,l=e[a],e[a]=e[s],e[s]=l;}Xa(n,e,t,s,r),Xa(n,e,s+1,o,r);}var ze=11102230246251565e-32,tt=134217729,Tr=(3+8*ze)*ze;function vo(n,e,t,o,r){let i,a,s,l,c=e[0],f=o[0],u=0,h=0;f>c==f>-c?(i=c,c=e[++u]):(i=f,f=o[++h]);let d=0;if(u<n&&h<t)for(f>c==f>-c?(a=c+i,s=i-(a-c),c=e[++u]):(a=f+i,s=i-(a-f),f=o[++h]),i=a,s!==0&&(r[d++]=s);u<n&&h<t;)f>c==f>-c?(a=i+c,l=a-i,s=i-(a-l)+(c-l),c=e[++u]):(a=i+f,l=a-i,s=i-(a-l)+(f-l),f=o[++h]),i=a,s!==0&&(r[d++]=s);for(;u<n;)a=i+c,l=a-i,s=i-(a-l)+(c-l),c=e[++u],i=a,s!==0&&(r[d++]=s);for(;h<t;)a=i+f,l=a-i,s=i-(a-l)+(f-l),f=o[++h],i=a,s!==0&&(r[d++]=s);return (i!==0||d===0)&&(r[d++]=i),d}function kr(n,e){let t=e[0];for(let o=1;o<n;o++)t+=e[o];return t}function le(n){return new Float64Array(n)}var h0=(3+16*ze)*ze,d0=(2+12*ze)*ze,m0=(9+64*ze)*ze*ze,No=le(4),nf=le(8),af=le(12),sf=le(16),ft=le(4);function p0(n,e,t,o,r,i,a){let s,l,c,f,u,h,d,m,p,b,g,y,A,x,v,w,C,B,_=n-r,T=t-r,k=e-i,K=o-i;x=_*K,h=tt*_,d=h-(h-_),m=_-d,h=tt*K,p=h-(h-K),b=K-p,v=m*b-(x-d*p-m*p-d*b),w=k*T,h=tt*k,d=h-(h-k),m=k-d,h=tt*T,p=h-(h-T),b=T-p,C=m*b-(w-d*p-m*p-d*b),g=v-C,u=v-g,No[0]=v-(g+u)+(u-C),y=x+g,u=y-x,A=x-(y-u)+(g-u),g=A-w,u=A-g,No[1]=A-(g+u)+(u-w),B=y+g,u=B-y,No[2]=y-(B-u)+(g-u),No[3]=B;let P=kr(4,No),W=d0*a;if(P>=W||-P>=W||(u=n-_,s=n-(_+u)+(u-r),u=t-T,c=t-(T+u)+(u-r),u=e-k,l=e-(k+u)+(u-i),u=o-K,f=o-(K+u)+(u-i),s===0&&l===0&&c===0&&f===0)||(W=m0*a+Tr*Math.abs(P),P+=_*f+K*s-(k*c+T*l),P>=W||-P>=W))return P;x=s*K,h=tt*s,d=h-(h-s),m=s-d,h=tt*K,p=h-(h-K),b=K-p,v=m*b-(x-d*p-m*p-d*b),w=l*T,h=tt*l,d=h-(h-l),m=l-d,h=tt*T,p=h-(h-T),b=T-p,C=m*b-(w-d*p-m*p-d*b),g=v-C,u=v-g,ft[0]=v-(g+u)+(u-C),y=x+g,u=y-x,A=x-(y-u)+(g-u),g=A-w,u=A-g,ft[1]=A-(g+u)+(u-w),B=y+g,u=B-y,ft[2]=y-(B-u)+(g-u),ft[3]=B;let z=vo(4,No,4,ft,nf);x=_*f,h=tt*_,d=h-(h-_),m=_-d,h=tt*f,p=h-(h-f),b=f-p,v=m*b-(x-d*p-m*p-d*b),w=k*c,h=tt*k,d=h-(h-k),m=k-d,h=tt*c,p=h-(h-c),b=c-p,C=m*b-(w-d*p-m*p-d*b),g=v-C,u=v-g,ft[0]=v-(g+u)+(u-C),y=x+g,u=y-x,A=x-(y-u)+(g-u),g=A-w,u=A-g,ft[1]=A-(g+u)+(u-w),B=y+g,u=B-y,ft[2]=y-(B-u)+(g-u),ft[3]=B;let L=vo(z,nf,4,ft,af);x=s*f,h=tt*s,d=h-(h-s),m=s-d,h=tt*f,p=h-(h-f),b=f-p,v=m*b-(x-d*p-m*p-d*b),w=l*c,h=tt*l,d=h-(h-l),m=l-d,h=tt*c,p=h-(h-c),b=c-p,C=m*b-(w-d*p-m*p-d*b),g=v-C,u=v-g,ft[0]=v-(g+u)+(u-C),y=x+g,u=y-x,A=x-(y-u)+(g-u),g=A-w,u=A-g,ft[1]=A-(g+u)+(u-w),B=y+g,u=B-y,ft[2]=y-(B-u)+(g-u),ft[3]=B;let X=vo(L,af,4,ft,sf);return sf[X-1]}function Ja(n,e,t,o,r,i){let a=(e-i)*(t-r),s=(n-r)*(o-i),l=a-s,c=Math.abs(a+s);return Math.abs(l)>=h0*c?l:-p0(n,e,t,o,r,i,c)}var Lr=(n,e)=>n.ll.x<=e.x&&e.x<=n.ur.x&&n.ll.y<=e.y&&e.y<=n.ur.y,ja=(n,e)=>{if(e.ur.x<n.ll.x||n.ur.x<e.ll.x||e.ur.y<n.ll.y||n.ur.y<e.ll.y)return null;let t=n.ll.x<e.ll.x?e.ll.x:n.ll.x,o=n.ur.x<e.ur.x?n.ur.x:e.ur.x,r=n.ll.y<e.ll.y?e.ll.y:n.ll.y,i=n.ur.y<e.ur.y?n.ur.y:e.ur.y;return {ll:{x:t,y:r},ur:{x:o,y:i}}},no=Number.EPSILON;no===void 0&&(no=Math.pow(2,-52));var g0=no*no,cf=(n,e)=>{if(-no<n&&n<no&&-no<e&&e<no)return 0;let t=n-e;return t*t<g0*n*e?0:n<e?-1:1},Ya=class{constructor(){this.reset();}reset(){this.xRounder=new ai,this.yRounder=new ai;}round(e,t){return {x:this.xRounder.round(e),y:this.yRounder.round(t)}}},ai=class{constructor(){this.tree=new Wo,this.round(0);}round(e){let t=this.tree.add(e),o=this.tree.prev(t);if(o!==null&&cf(t.key,o.key)===0)return this.tree.remove(e),o.key;let r=this.tree.next(t);return r!==null&&cf(t.key,r.key)===0?(this.tree.remove(e),r.key):e}},Rr=new Ya,ii=(n,e)=>n.x*e.y-n.y*e.x,mf=(n,e)=>n.x*e.x+n.y*e.y,ff=(n,e,t)=>{let o=Ja(n.x,n.y,e.x,e.y,t.x,t.y);return o>0?-1:o<0?1:0},si=n=>Math.sqrt(mf(n,n)),y0=(n,e,t)=>{let o={x:e.x-n.x,y:e.y-n.y},r={x:t.x-n.x,y:t.y-n.y};return ii(r,o)/si(r)/si(o)},A0=(n,e,t)=>{let o={x:e.x-n.x,y:e.y-n.y},r={x:t.x-n.x,y:t.y-n.y};return mf(r,o)/si(r)/si(o)},uf=(n,e,t)=>e.y===0?null:{x:n.x+e.x/e.y*(t-n.y),y:t},hf=(n,e,t)=>e.x===0?null:{x:t,y:n.y+e.y/e.x*(t-n.x)},x0=(n,e,t,o)=>{if(e.x===0)return hf(t,o,n.x);if(o.x===0)return hf(n,e,t.x);if(e.y===0)return uf(t,o,n.y);if(o.y===0)return uf(n,e,t.y);let r=ii(e,o);if(r==0)return null;let i={x:t.x-n.x,y:t.y-n.y},a=ii(i,e)/r,s=ii(i,o)/r,l=n.x+s*e.x,c=t.x+a*o.x,f=n.y+s*e.y,u=t.y+a*o.y,h=(l+c)/2,d=(f+u)/2;return {x:h,y:d}},Ct=class n{static compare(e,t){let o=n.comparePoints(e.point,t.point);return o!==0?o:(e.point!==t.point&&e.link(t),e.isLeft!==t.isLeft?e.isLeft?1:-1:Vo.compare(e.segment,t.segment))}static comparePoints(e,t){return e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:e.y>t.y?1:0}constructor(e,t){e.events===void 0?e.events=[this]:e.events.push(this),this.point=e,this.isLeft=t;}link(e){if(e.point===this.point)throw new Error("Tried to link already linked events");let t=e.point.events;for(let o=0,r=t.length;o<r;o++){let i=t[o];this.point.events.push(i),i.point=this.point;}this.checkForConsuming();}checkForConsuming(){let e=this.point.events.length;for(let t=0;t<e;t++){let o=this.point.events[t];if(o.segment.consumedBy===void 0)for(let r=t+1;r<e;r++){let i=this.point.events[r];i.consumedBy===void 0&&o.otherSE.point.events===i.otherSE.point.events&&o.segment.consume(i.segment);}}}getAvailableLinkedEvents(){let e=[];for(let t=0,o=this.point.events.length;t<o;t++){let r=this.point.events[t];r!==this&&!r.segment.ringOut&&r.segment.isInResult()&&e.push(r);}return e}getLeftmostComparator(e){let t=new Map,o=r=>{let i=r.otherSE;t.set(r,{sine:y0(this.point,e.point,i.point),cosine:A0(this.point,e.point,i.point)});};return (r,i)=>{t.has(r)||o(r),t.has(i)||o(i);let{sine:a,cosine:s}=t.get(r),{sine:l,cosine:c}=t.get(i);return a>=0&&l>=0?s<c?1:s>c?-1:0:a<0&&l<0?s<c?-1:s>c?1:0:l<a?-1:l>a?1:0}}},w0=0,Vo=class n{static compare(e,t){let o=e.leftSE.point.x,r=t.leftSE.point.x,i=e.rightSE.point.x,a=t.rightSE.point.x;if(a<o)return 1;if(i<r)return -1;let s=e.leftSE.point.y,l=t.leftSE.point.y,c=e.rightSE.point.y,f=t.rightSE.point.y;if(o<r){if(l<s&&l<c)return 1;if(l>s&&l>c)return -1;let u=e.comparePoint(t.leftSE.point);if(u<0)return 1;if(u>0)return -1;let h=t.comparePoint(e.rightSE.point);return h!==0?h:-1}if(o>r){if(s<l&&s<f)return -1;if(s>l&&s>f)return 1;let u=t.comparePoint(e.leftSE.point);if(u!==0)return u;let h=e.comparePoint(t.rightSE.point);return h<0?1:h>0?-1:1}if(s<l)return -1;if(s>l)return 1;if(i<a){let u=t.comparePoint(e.rightSE.point);if(u!==0)return u}if(i>a){let u=e.comparePoint(t.rightSE.point);if(u<0)return 1;if(u>0)return -1}if(i!==a){let u=c-s,h=i-o,d=f-l,m=a-r;if(u>h&&d<m)return 1;if(u<h&&d>m)return -1}return i>a?1:i<a||c<f?-1:c>f?1:e.id<t.id?-1:e.id>t.id?1:0}constructor(e,t,o,r){this.id=++w0,this.leftSE=e,e.segment=this,e.otherSE=t,this.rightSE=t,t.segment=this,t.otherSE=e,this.rings=o,this.windings=r;}static fromRing(e,t,o){let r,i,a,s=Ct.comparePoints(e,t);if(s<0)r=e,i=t,a=1;else if(s>0)r=t,i=e,a=-1;else throw new Error(`Tried to create degenerate segment at [${e.x}, ${e.y}]`);let l=new Ct(r,true),c=new Ct(i,false);return new n(l,c,[o],[a])}replaceRightSE(e){this.rightSE=e,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE;}bbox(){let e=this.leftSE.point.y,t=this.rightSE.point.y;return {ll:{x:this.leftSE.point.x,y:e<t?e:t},ur:{x:this.rightSE.point.x,y:e>t?e:t}}}vector(){return {x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}isAnEndpoint(e){return e.x===this.leftSE.point.x&&e.y===this.leftSE.point.y||e.x===this.rightSE.point.x&&e.y===this.rightSE.point.y}comparePoint(e){if(this.isAnEndpoint(e))return 0;let t=this.leftSE.point,o=this.rightSE.point,r=this.vector();if(t.x===o.x)return e.x===t.x?0:e.x<t.x?1:-1;let i=(e.y-t.y)/r.y,a=t.x+i*r.x;if(e.x===a)return 0;let s=(e.x-t.x)/r.x,l=t.y+s*r.y;return e.y===l?0:e.y<l?-1:1}getIntersection(e){let t=this.bbox(),o=e.bbox(),r=ja(t,o);if(r===null)return null;let i=this.leftSE.point,a=this.rightSE.point,s=e.leftSE.point,l=e.rightSE.point,c=Lr(t,s)&&this.comparePoint(s)===0,f=Lr(o,i)&&e.comparePoint(i)===0,u=Lr(t,l)&&this.comparePoint(l)===0,h=Lr(o,a)&&e.comparePoint(a)===0;if(f&&c)return h&&!u?a:!h&&u?l:null;if(f)return u&&i.x===l.x&&i.y===l.y?null:i;if(c)return h&&a.x===s.x&&a.y===s.y?null:s;if(h&&u)return null;if(h)return a;if(u)return l;let d=x0(i,this.vector(),s,e.vector());return d===null||!Lr(r,d)?null:Rr.round(d.x,d.y)}split(e){let t=[],o=e.events!==void 0,r=new Ct(e,true),i=new Ct(e,false),a=this.rightSE;this.replaceRightSE(i),t.push(i),t.push(r);let s=new n(r,a,this.rings.slice(),this.windings.slice());return Ct.comparePoints(s.leftSE.point,s.rightSE.point)>0&&s.swapEvents(),Ct.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),o&&(r.checkForConsuming(),i.checkForConsuming()),t}swapEvents(){let e=this.rightSE;this.rightSE=this.leftSE,this.leftSE=e,this.leftSE.isLeft=true,this.rightSE.isLeft=false;for(let t=0,o=this.windings.length;t<o;t++)this.windings[t]*=-1;}consume(e){let t=this,o=e;for(;t.consumedBy;)t=t.consumedBy;for(;o.consumedBy;)o=o.consumedBy;let r=n.compare(t,o);if(r!==0){if(r>0){let i=t;t=o,o=i;}if(t.prev===o){let i=t;t=o,o=i;}for(let i=0,a=o.rings.length;i<a;i++){let s=o.rings[i],l=o.windings[i],c=t.rings.indexOf(s);c===-1?(t.rings.push(s),t.windings.push(l)):t.windings[c]+=l;}o.rings=null,o.windings=null,o.consumedBy=t,o.leftSE.consumedBy=t.leftSE,o.rightSE.consumedBy=t.rightSE;}}prevInResult(){return this._prevInResult!==void 0?this._prevInResult:(this.prev?this.prev.isInResult()?this._prevInResult=this.prev:this._prevInResult=this.prev.prevInResult():this._prevInResult=null,this._prevInResult)}beforeState(){if(this._beforeState!==void 0)return this._beforeState;if(!this.prev)this._beforeState={rings:[],windings:[],multiPolys:[]};else {let e=this.prev.consumedBy||this.prev;this._beforeState=e.afterState();}return this._beforeState}afterState(){if(this._afterState!==void 0)return this._afterState;let e=this.beforeState();this._afterState={rings:e.rings.slice(0),windings:e.windings.slice(0),multiPolys:[]};let t=this._afterState.rings,o=this._afterState.windings,r=this._afterState.multiPolys;for(let s=0,l=this.rings.length;s<l;s++){let c=this.rings[s],f=this.windings[s],u=t.indexOf(c);u===-1?(t.push(c),o.push(f)):o[u]+=f;}let i=[],a=[];for(let s=0,l=t.length;s<l;s++){if(o[s]===0)continue;let c=t[s],f=c.poly;if(a.indexOf(f)===-1)if(c.isExterior)i.push(f);else {a.indexOf(f)===-1&&a.push(f);let u=i.indexOf(c.poly);u!==-1&&i.splice(u,1);}}for(let s=0,l=i.length;s<l;s++){let c=i[s].multiPoly;r.indexOf(c)===-1&&r.push(c);}return this._afterState}isInResult(){if(this.consumedBy)return false;if(this._isInResult!==void 0)return this._isInResult;let e=this.beforeState().multiPolys,t=this.afterState().multiPolys;switch(It.type){case "union":{let o=e.length===0,r=t.length===0;this._isInResult=o!==r;break}case "intersection":{let o,r;e.length<t.length?(o=e.length,r=t.length):(o=t.length,r=e.length),this._isInResult=r===It.numMultiPolys&&o<r;break}case "xor":{let o=Math.abs(e.length-t.length);this._isInResult=o%2===1;break}case "difference":{let o=r=>r.length===1&&r[0].isSubject;this._isInResult=o(e)!==o(t);break}default:throw new Error(`Unrecognized operation type found ${It.type}`)}return this._isInResult}},li=class{constructor(e,t,o){if(!Array.isArray(e)||e.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=t,this.isExterior=o,this.segments=[],typeof e[0][0]!="number"||typeof e[0][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let r=Rr.round(e[0][0],e[0][1]);this.bbox={ll:{x:r.x,y:r.y},ur:{x:r.x,y:r.y}};let i=r;for(let a=1,s=e.length;a<s;a++){if(typeof e[a][0]!="number"||typeof e[a][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let l=Rr.round(e[a][0],e[a][1]);l.x===i.x&&l.y===i.y||(this.segments.push(Vo.fromRing(i,l,this)),l.x<this.bbox.ll.x&&(this.bbox.ll.x=l.x),l.y<this.bbox.ll.y&&(this.bbox.ll.y=l.y),l.x>this.bbox.ur.x&&(this.bbox.ur.x=l.x),l.y>this.bbox.ur.y&&(this.bbox.ur.y=l.y),i=l);}(r.x!==i.x||r.y!==i.y)&&this.segments.push(Vo.fromRing(i,r,this));}getSweepEvents(){let e=[];for(let t=0,o=this.segments.length;t<o;t++){let r=this.segments[t];e.push(r.leftSE),e.push(r.rightSE);}return e}},Za=class{constructor(e,t){if(!Array.isArray(e))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new li(e[0],this,true),this.bbox={ll:{x:this.exteriorRing.bbox.ll.x,y:this.exteriorRing.bbox.ll.y},ur:{x:this.exteriorRing.bbox.ur.x,y:this.exteriorRing.bbox.ur.y}},this.interiorRings=[];for(let o=1,r=e.length;o<r;o++){let i=new li(e[o],this,false);i.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=i.bbox.ll.x),i.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=i.bbox.ll.y),i.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=i.bbox.ur.x),i.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=i.bbox.ur.y),this.interiorRings.push(i);}this.multiPoly=t;}getSweepEvents(){let e=this.exteriorRing.getSweepEvents();for(let t=0,o=this.interiorRings.length;t<o;t++){let r=this.interiorRings[t].getSweepEvents();for(let i=0,a=r.length;i<a;i++)e.push(r[i]);}return e}},ci=class{constructor(e,t){if(!Array.isArray(e))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{typeof e[0][0][0]=="number"&&(e=[e]);}catch{}this.polys=[],this.bbox={ll:{x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY},ur:{x:Number.NEGATIVE_INFINITY,y:Number.NEGATIVE_INFINITY}};for(let o=0,r=e.length;o<r;o++){let i=new Za(e[o],this);i.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=i.bbox.ll.x),i.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=i.bbox.ll.y),i.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=i.bbox.ur.x),i.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=i.bbox.ur.y),this.polys.push(i);}this.isSubject=t;}getSweepEvents(){let e=[];for(let t=0,o=this.polys.length;t<o;t++){let r=this.polys[t].getSweepEvents();for(let i=0,a=r.length;i<a;i++)e.push(r[i]);}return e}},qa=class n{static factory(e){let t=[];for(let o=0,r=e.length;o<r;o++){let i=e[o];if(!i.isInResult()||i.ringOut)continue;let a=null,s=i.leftSE,l=i.rightSE,c=[s],f=s.point,u=[];for(;a=s,s=l,c.push(s),s.point!==f;)for(;;){let h=s.getAvailableLinkedEvents();if(h.length===0){let p=c[0].point,b=c[c.length-1].point;throw new Error(`Unable to complete output ring starting at [${p.x}, ${p.y}]. Last matching segment found ends at [${b.x}, ${b.y}].`)}if(h.length===1){l=h[0].otherSE;break}let d=null;for(let p=0,b=u.length;p<b;p++)if(u[p].point===s.point){d=p;break}if(d!==null){let p=u.splice(d)[0],b=c.splice(p.index);b.unshift(b[0].otherSE),t.push(new n(b.reverse()));continue}u.push({index:c.length,point:s.point});let m=s.getLeftmostComparator(a);l=h.sort(m)[0].otherSE;break}t.push(new n(c));}return t}constructor(e){this.events=e;for(let t=0,o=e.length;t<o;t++)e[t].segment.ringOut=this;this.poly=null;}getGeom(){let e=this.events[0].point,t=[e];for(let c=1,f=this.events.length-1;c<f;c++){let u=this.events[c].point,h=this.events[c+1].point;ff(u,e,h)!==0&&(t.push(u),e=u);}if(t.length===1)return null;let o=t[0],r=t[1];ff(o,e,r)===0&&t.shift(),t.push(t[0]);let i=this.isExteriorRing()?1:-1,a=this.isExteriorRing()?0:t.length-1,s=this.isExteriorRing()?t.length:-1,l=[];for(let c=a;c!=s;c+=i)l.push([t[c].x,t[c].y]);return l}isExteriorRing(){if(this._isExteriorRing===void 0){let e=this.enclosingRing();this._isExteriorRing=e?!e.isExteriorRing():true;}return this._isExteriorRing}enclosingRing(){return this._enclosingRing===void 0&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}_calcEnclosingRing(){let e=this.events[0];for(let r=1,i=this.events.length;r<i;r++){let a=this.events[r];Ct.compare(e,a)>0&&(e=a);}let t=e.segment.prevInResult(),o=t?t.prevInResult():null;for(;;){if(!t)return null;if(!o)return t.ringOut;if(o.ringOut!==t.ringOut)return o.ringOut.enclosingRing()!==t.ringOut?t.ringOut:t.ringOut.enclosingRing();t=o.prevInResult(),o=t?t.prevInResult():null;}}},fi=class{constructor(e){this.exteriorRing=e,e.poly=this,this.interiorRings=[];}addInterior(e){this.interiorRings.push(e),e.poly=this;}getGeom(){let e=[this.exteriorRing.getGeom()];if(e[0]===null)return null;for(let t=0,o=this.interiorRings.length;t<o;t++){let r=this.interiorRings[t].getGeom();r!==null&&e.push(r);}return e}},Qa=class{constructor(e){this.rings=e,this.polys=this._composePolys(e);}getGeom(){let e=[];for(let t=0,o=this.polys.length;t<o;t++){let r=this.polys[t].getGeom();r!==null&&e.push(r);}return e}_composePolys(e){let t=[];for(let o=0,r=e.length;o<r;o++){let i=e[o];if(!i.poly)if(i.isExteriorRing())t.push(new fi(i));else {let a=i.enclosingRing();a.poly||t.push(new fi(a)),a.poly.addInterior(i);}}return t}},$a=class{constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Vo.compare;this.queue=e,this.tree=new Wo(t),this.segments=[];}process(e){let t=e.segment,o=[];if(e.consumedBy)return e.isLeft?this.queue.remove(e.otherSE):this.tree.remove(t),o;let r=e.isLeft?this.tree.add(t):this.tree.find(t);if(!r)throw new Error(`Unable to find segment #${t.id} [${t.leftSE.point.x}, ${t.leftSE.point.y}] -> [${t.rightSE.point.x}, ${t.rightSE.point.y}] in SweepLine tree.`);let i=r,a=r,s,l;for(;s===void 0;)i=this.tree.prev(i),i===null?s=null:i.key.consumedBy===void 0&&(s=i.key);for(;l===void 0;)a=this.tree.next(a),a===null?l=null:a.key.consumedBy===void 0&&(l=a.key);if(e.isLeft){let c=null;if(s){let u=s.getIntersection(t);if(u!==null&&(t.isAnEndpoint(u)||(c=u),!s.isAnEndpoint(u))){let h=this._splitSafely(s,u);for(let d=0,m=h.length;d<m;d++)o.push(h[d]);}}let f=null;if(l){let u=l.getIntersection(t);if(u!==null&&(t.isAnEndpoint(u)||(f=u),!l.isAnEndpoint(u))){let h=this._splitSafely(l,u);for(let d=0,m=h.length;d<m;d++)o.push(h[d]);}}if(c!==null||f!==null){let u=null;c===null?u=f:f===null?u=c:u=Ct.comparePoints(c,f)<=0?c:f,this.queue.remove(t.rightSE),o.push(t.rightSE);let h=t.split(u);for(let d=0,m=h.length;d<m;d++)o.push(h[d]);}o.length>0?(this.tree.remove(t),o.push(e)):(this.segments.push(t),t.prev=s);}else {if(s&&l){let c=s.getIntersection(l);if(c!==null){if(!s.isAnEndpoint(c)){let f=this._splitSafely(s,c);for(let u=0,h=f.length;u<h;u++)o.push(f[u]);}if(!l.isAnEndpoint(c)){let f=this._splitSafely(l,c);for(let u=0,h=f.length;u<h;u++)o.push(f[u]);}}}this.tree.remove(t);}return o}_splitSafely(e,t){this.tree.remove(e);let o=e.rightSE;this.queue.remove(o);let r=e.split(t);return r.push(o),e.consumedBy===void 0&&this.tree.add(e),r}},df=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,v0=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6,es=class{run(e,t,o){It.type=e,Rr.reset();let r=[new ci(t,true)];for(let u=0,h=o.length;u<h;u++)r.push(new ci(o[u],false));if(It.numMultiPolys=r.length,It.type==="difference"){let u=r[0],h=1;for(;h<r.length;)ja(r[h].bbox,u.bbox)!==null?h++:r.splice(h,1);}if(It.type==="intersection")for(let u=0,h=r.length;u<h;u++){let d=r[u];for(let m=u+1,p=r.length;m<p;m++)if(ja(d.bbox,r[m].bbox)===null)return []}let i=new Wo(Ct.compare);for(let u=0,h=r.length;u<h;u++){let d=r[u].getSweepEvents();for(let m=0,p=d.length;m<p;m++)if(i.insert(d[m]),i.size>df)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big).")}let a=new $a(i),s=i.size,l=i.pop();for(;l;){let u=l.key;if(i.size===s){let d=u.segment;throw new Error(`Unable to pop() ${u.isLeft?"left":"right"} SweepEvent [${u.point.x}, ${u.point.y}] from segment #${d.id} [${d.leftSE.point.x}, ${d.leftSE.point.y}] -> [${d.rightSE.point.x}, ${d.rightSE.point.y}] from queue.`)}if(i.size>df)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big).");if(a.segments.length>v0)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments).");let h=a.process(u);for(let d=0,m=h.length;d<m;d++){let p=h[d];p.consumedBy===void 0&&i.insert(p);}s=i.size,l=i.pop();}Rr.reset();let c=qa.factory(a.segments);return new Qa(c).getGeom()}},It=new es,C0=function(n){for(var e=arguments.length,t=new Array(e>1?e-1:0),o=1;o<e;o++)t[o-1]=arguments[o];return It.run("union",n,t)},B0=function(n){for(var e=arguments.length,t=new Array(e>1?e-1:0),o=1;o<e;o++)t[o-1]=arguments[o];return It.run("intersection",n,t)},M0=function(n){for(var e=arguments.length,t=new Array(e>1?e-1:0),o=1;o<e;o++)t[o-1]=arguments[o];return It.run("xor",n,t)},_0=function(n){for(var e=arguments.length,t=new Array(e>1?e-1:0),o=1;o<e;o++)t[o-1]=arguments[o];return It.run("difference",n,t)},E0={union:C0,intersection:B0,xor:M0,difference:_0};var pf=Pr,Hr=pf.union??pf.default?.union??null;Hr||console.warn("[osmgl] polygon-clipping \u0431\u0435\u0437 union \u2014 \u043E\u0431\u044A\u0435\u0434\u0438\u043D\u0435\u043D\u0438\u0435 \u0444\u0438\u0433\u0443\u0440 \u0432\u044B\u043A\u043B\u044E\u0447\u0435\u043D\u043E");var ui=0,hi=0;function gf(n){for(let e of n)if(e.length>=2){ui=Math.round(e[0]),hi=Math.round(e[1]);return}ui=0,hi=0;}function di(n){let e=[];for(let t=0;t+1<n.length;t+=2)e.push([n[t]-ui,n[t+1]-hi]);return e}function mi(n){let e=[];for(let o of n)e.push(o[0]+ui,o[1]+hi);let t=e.length;return t>=4&&(e[0]!==e[t-2]||e[1]!==e[t-1])&&e.push(e[0],e[1]),e}function pi(n){if(!Hr)return [n];gf([n.outer]);let e=[di(n.outer),...n.holes.map(di)],t;try{t=Hr(e);}catch{return [n]}let o=[];for(let r of t??[])r?.length&&o.push({outer:mi(r[0]),holes:r.slice(1).map(mi),lift:n.lift,at:n.at});return o.length?o:[n]}function Uo(n,e,t=0){if(n.length<2)return n;let o=new Map;for(let i of n){let a=i.at?i:i.lift??0,s=o.get(a);s?s.push(i):o.set(a,[i]);}let r=[];for(let[i,a]of o){if(a.length<2){r.push(...a);continue}let s=typeof i=="number"?i:0;r.push(...S0(a,s,e,t));}return r}var ts=256;function S0(n,e,t,o=0){let r=n,i=o>0&&t?o:0;for(let a=0;a<32;a++){if(r.length<2)return r;if(r.length<=ts)return bf(r,e,t,i);let s=F0(r),l=[];for(let c=0;c<s.length;c+=ts)l.push(...bf(s.slice(c,c+ts),e,t,i));if(i=0,l.length>=r.length)return l;r=l;}return r}function F0(n){let e=1/0,t=1/0,o=-1/0,r=-1/0,i=n.map(c=>{let f=0,u=0,h=0;for(let p=0;p+1<c.outer.length;p+=2)f+=c.outer[p],u+=c.outer[p+1],h++;let d=h?f/h:0,m=h?u/h:0;return d<e&&(e=d),d>o&&(o=d),m<t&&(t=m),m>r&&(r=m),{s:c,cx:d,cy:m}}),a=o-e||1,s=r-t||1,l=c=>{let f=Math.max(0,Math.min(65535,Math.round(c*65535)));return f=(f|f<<8)&16711935,f=(f|f<<4)&252645135,f=(f|f<<2)&858993459,f=(f|f<<1)&1431655765,f};return i.map(c=>({s:c.s,key:l((c.cx-e)/a)|l((c.cy-t)/s)<<1})).sort((c,f)=>c.key-f.key).map(c=>c.s)}function bf(n,e,t,o=0){{let r=[],i=o>0&&t?n.map(c=>({outer:t(c.outer,-o)??c.outer,holes:c.holes.map(f=>t(f,o)??f)})):n;gf(i.map(c=>c.outer));let a=i.map(c=>[di(c.outer),...c.holes.map(di)]),s;try{if(!Hr)throw new Error("\u043D\u0435\u0442 union");s=Hr(a[0],...a.slice(1));}catch{return n}let l=s;if(!Array.isArray(l)||l.length===0)return n;for(let c of l){if(!c.length)continue;let f=mi(c[0]);if(f.length<8)continue;let u=[];for(let h=1;h<c.length;h++){let d=mi(c[h]);d.length>=8&&u.push(d);}r.push(e?{outer:f,holes:u,lift:e}:{outer:f,holes:u});}return r}}var I0=5,Jt=16,Bf=64,Mf=0,D0=1,yf=2,T0=3,Or=1,k0=.6;function L0(n,e,t,o){if(!e||!(e>0)||!(t>0))return [];let r=e/2/t,i=[];for(let a of n){let s=a.length>=8&&Math.abs(a[0]-a[a.length-2])<1e-6&&Math.abs(a[1]-a[a.length-1])<1e-6,l,c=a;if(o&&!s){let d=Array.from(a),m=Dr(d,{junctions:o.junctions,width:o.width,level:o.level,taper:o.reach});if(m.at){let p=o.extra/2/t,b=m.at;l=g=>b(g)/2/t+p,m.knots.length&&(c=of(d,m.knots));}}let f=zo(c,{halfWidth:r,metersPerUnit:t,closed:s,halfWidthAt:l});if(!f)continue;let u=f.outer,h=[];if(o&&!s){let d=a.length/2;for(let[m,p,b]of [[a[0],a[1],0],[a[d*2-2],a[d*2-1],-1]]){if(!P0(o,m,p))continue;let g=b===0?0:R0(c),y=l?l(g):r;h.push({x:m,y:p,r:y});}}i.push(h.length?{outer:u,holes:f.holes,caps:h}:{outer:u,holes:f.holes});}return i}function R0(n){let e=0;for(let t=0;t+3<n.length;t+=2)e+=Math.hypot(n[t+2]-n[t],n[t+3]-n[t+1]);return e}function P0(n,e,t){let o=oo(Math.round(e),Math.round(t))+(n.level+8)*4294967296;return (n.junctions.ends.get(o)??0)>1}function as(n,e,t,o){let r=o.metersPerUnit>0?o.metersPerUnit:.5,i=o.elevation,a=o.base??0,s=Math.max(o.bevel??0,0)/r,l=Math.max(o.bevelDrop??0,0),c=Math.max(o.cornerRadius??0,0)/r,f=Math.max(512,n.length*24),u=new ArrayBuffer(f*Jt),h={view:new DataView(u),bytes:new Uint8Array(u),offset:0,count:0,indices:[],extent:e,ensure(G){if(h.count+G<=f)return;f=Math.max(f*2,h.count+G);let Y=new ArrayBuffer(f*Jt);new Uint8Array(Y).set(h.bytes.subarray(0,h.offset)),u=Y,h.view=new DataView(Y),h.bytes=new Uint8Array(Y);}},d=o.widthOf?Fr(n):null,m=Math.max(o.widthExtra??0,0),p=Ir/r,b=G=>{if(!d)return;let Y=o.widthOf(G);if(!(!Y||!(Y>0)))return {junctions:d,width:Math.max(Y-m,0),extra:m,level:vt(G),reach:p}},g=[],y=[],A=new Map,x=o.widthOf?Wa(n,G=>et(t,G),o.widthOf):null,v=x?x.map(G=>({geometry:[G.pts],props:G.props,ids:G.ids})):[];if(!x)for(let G of n.features()){if(G.type!==3||!et(t,G.properties))continue;let Y=G.properties.osm_id,ie=typeof Y=="number"?Y:typeof Y=="string"?Number(Y):NaN;v.push({geometry:G.loadGeometry(),props:G.properties,ids:[Number.isFinite(ie)?ie:Number(G.id??0)]});}for(let G of v){let Y=x!==null,ie=o.liftAt?.(G.props)??null,ee=ie?0:o.liftBy?.(G.props)??0,ue=G.ids;for(let $ of Y?L0(G.geometry,o.widthOf(G.props),r,b(G.props)):Ao(G.geometry)){let Ae=Kt($,e,st(e));if(!Ae)continue;let ve=$.caps;g.push({...Ae,...ee?{lift:ee}:{},...ie?{at:ie}:{},...ve?{caps:ve}:{}}),y.push(ue);}}let w=new Set,C=Math.max(o.weld??k0,0),B=o.widthOf?g:Uo(g,(G,Y)=>rs(G,Y,e,w),C/r),_=C>0?B.map(G=>({...G,outer:Cf(G.outer,C/r,e),holes:G.holes.map(Y=>Cf(Y,C/r,e))})):B;for(let G of _){xf(G.outer,A);for(let Y of G.holes)xf(Y,A);}o.onShapes?.(_);let T=H0(_,g,y),k=new Set;for(let[G,Y]of A)Y>1&&k.add(G);if(_.some(G=>G.at)||new Set(_.map(G=>G.lift??0)).size>1){let G=(Y,ie,ee)=>{let ue=_[Y];return (ue.lift??0)+(ue.at?ue.at(ie,ee):0)};z0(_,(Y,ie,ee)=>i+G(Y,ie,ee),k,.5/r);}for(let G of _){let Y=G.caps;if(Y)for(let ie of Y)N0(G.outer,ie,k);}let P=[],W={radius:c,segments:o.cornerSegments,extent:e,margin:st(e),minCutRatio:0,maxChord:Dc/r},z=[];for(let G of _){let Y=h.indices.length,ie=P.length,ee=c>0?{outer:dt(G.outer,{...W,keep:wf(G.outer,k)}),holes:G.holes.map(Z=>dt(Z,{...W,keep:wf(Z,k)}))}:G,ue=s>0?rs(ee.outer,s,e,k):ee.outer,$=ee.holes.map(Z=>s>0?rs(Z,-s,e,k):Z),Ae=G.lift??0,ve=G.at,he=i+Ae,xe=Math.max(o.deck??0,0),de=a+Ae-(Ae>0||ve?xe:0),we=ve?Math.min(o.maxSegment||1/0,I0/r):o.maxSegment??0;vf(h,ue??ee.outer,$.map((Z,ce)=>Z??ee.holes[ce]),he,Mf,we,ve);let I=he,J=he-l;ue&&s>0&&l>0&&os(h,ue,ee.outer,I,J,D0,e,k,ve),(J!==de||ve)&&os(h,ee.outer,ee.outer,J,de,yf,e,k,ve);for(let Z of ee.holes)if((J!==de||ve)&&os(h,Z,Z,J,de,yf,e,k,ve),he<de){let ce=h.indices.length;vf(h,Z,[],de,T0,0,ve);for(let ae=ce;ae<h.indices.length;ae++)P.push(h.indices[ae]);h.indices.length=ce;}z.push(Y,h.indices.length,ie,P.length);}if(!h.indices.length&&!P.length)return null;let L=h.indices.length;for(let G=0;G<z.length;G+=4)z[G+2]+=L,z[G+3]+=L;let X=[];for(let G of T){X.push(G.length);for(let Y of G)X.push(Y);}let Q=new Uint32Array(L+P.length);return Q.set(h.indices,0),Q.set(P,L),{vertices:u.slice(0,h.offset),indices:Q.buffer,vertexCount:h.count,indexCount:Q.length,extent:e,capIndexOffset:L,shapeFeatures:new Float64Array(X).buffer,shapeRanges:new Uint32Array(z).buffer}}function H0(n,e,t){let o=n.map(()=>[]);if(!n.length)return o;let r=n.map(i=>Af(i.outer));for(let i=0;i<e.length;i++){let a=O0(e[i].outer);if(!a)continue;let s=-1;for(let l=0;l<n.length;l++){let c=r[l];if(a[0]<c[0]||a[0]>c[2]||a[1]<c[1]||a[1]>c[3]||!zr(n[l].outer,a[0],a[1]))continue;let f=false;for(let u of n[l].holes)if(zr(u,a[0],a[1])){f=true;break}if(!f){s=l;break}}if(s<0){let l=Af(e[i].outer),c=0;for(let f=0;f<n.length;f++){let u=r[f],h=Math.min(l[2],u[2])-Math.max(l[0],u[0]),d=Math.min(l[3],u[3])-Math.max(l[1],u[1]),m=h>0&&d>0?h*d:0;m>c&&(c=m,s=f);}}s<0&&(s=0);for(let l of t[i])o[s].includes(l)||o[s].push(l);}return o}function Af(n){let e=1/0,t=1/0,o=-1/0,r=-1/0;for(let i=0;i<n.length;i+=2)n[i]<e&&(e=n[i]),n[i]>o&&(o=n[i]),n[i+1]<t&&(t=n[i+1]),n[i+1]>r&&(r=n[i+1]);return [e,t,o,r]}function O0(n){let e=n.length/2-1;if(e<3)return null;let t=0;for(let r=0;r<e;r++){let i=(r+1)%e;t+=n[r*2]*n[i*2+1]-n[i*2]*n[r*2+1];}let o=t>0;for(let r=0;r<e;r++){let i=(r+e-1)%e*2,a=r*2,s=(r+1)%e*2,l=(n[a]-n[i])*(n[s+1]-n[i+1])-(n[a+1]-n[i+1])*(n[s]-n[i]);if(l===0||l>0!==o)continue;let c=(n[i]+n[a]+n[s])/3,f=(n[i+1]+n[a+1]+n[s+1])/3;if(zr(n,c,f))return [c,f]}return null}function zr(n,e,t){let o=false,r=n.length/2-1;for(let i=0,a=r-1;i<r;a=i++){let s=n[i*2],l=n[i*2+1],c=n[a*2],f=n[a*2+1];l>t!=f>t&&e<(c-s)*(t-l)/(f-l)+s&&(o=!o);}return o}var G0=Nn;function z0(n,e,t,o){if(n.length<2)return;let r=n.map(s=>{let l=1/0,c=1/0,f=-1/0,u=-1/0;for(let h=0;h<s.outer.length;h+=2)s.outer[h]<l&&(l=s.outer[h]),s.outer[h]>f&&(f=s.outer[h]),s.outer[h+1]<c&&(c=s.outer[h+1]),s.outer[h+1]>u&&(u=s.outer[h+1]);return {minX:l,minY:c,maxX:f,maxY:u}}),i=s=>{let l=n[s];return !!l.at||(l.lift??0)!==0},a=(s,l,c)=>{let f=r[s];if(l<f.minX||l>f.maxX||c<f.minY||c>f.maxY||!zr(n[s].outer,l,c))return false;for(let u of n[s].holes)if(zr(u,l,c))return false;return true};for(let s=0;s<n.length;s++)for(let l of [n[s].outer,...n[s].holes])for(let c=0;c+3<l.length;c+=2){let f=l[c+2]-l[c],u=l[c+3]-l[c+1],h=Math.hypot(f,u);if(h<1e-9)continue;let d=(l[c]+l[c+2])/2,m=(l[c+1]+l[c+3])/2,p=-u/h*o,b=f/h*o,g=a(s,d+p,m+b)?-1:1,y=d+p*g,A=m+b*g;for(let x=0;x<n.length;x++)if(!(x===s||!a(x,y,A))&&!(!i(s)&&!i(x))&&!(Math.abs(e(s,y,A)-e(x,y,A))>G0)){t.add(io(l[c],l[c+1],l[c+2],l[c+3]));break}}}function io(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 xf(n,e){for(let t=0;t+3<n.length;t+=2){let o=io(n[t],n[t+1],n[t+2],n[t+3]);e.set(o,(e.get(o)??0)+1);}}function wf(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=io(n[(r+t-1)%t*2],n[(r+t-1)%t*2+1],n[r*2],n[r*2+1]),a=io(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 Gr(n,e,t,o,r,i,a,s){let l=n.offset;return n.view.setFloat32(l,e,true),n.view.setFloat32(l+4,t,true),n.view.setInt16(l+8,W0(Math.round(o*Bf)),true),n.view.setInt8(l+10,is(Math.round(r*127))),n.view.setInt8(l+11,is(Math.round(i*127))),n.view.setInt8(l+12,is(Math.round(a*127))),n.bytes[l+13]=s,n.view.setInt8(l+14,e<=0?-Or:e>=n.extent?Or:0),n.view.setInt8(l+15,t<=0?-Or:t>=n.extent?Or:0),n.offset+=Jt,n.count++}function vf(n,e,t,o,r=Mf,i=0,a){let s=[],l=[];for(let h=0;h<e.length;h++)s.push(e[h]);for(let h of t){l.push(s.length/2);for(let d=0;d<h.length;d++)s.push(h[d]);}let c=ot(s,l.length?l:void 0,2);if(!c.length)return;let f=c;if(i>0){let h=[];Ha(s,c,0,i,h),f=h;}n.ensure(s.length/2);let u=n.count;for(let h=0;h<s.length;h+=2)Gr(n,s[h],s[h+1],a?o+a(s[h],s[h+1]):o,0,0,1,r);for(let h=0;h<f.length;h+=3)n.indices.push(u+f[h],u+f[h+2],u+f[h+1]);}function os(n,e,t,o,r,i,a,s,l,c){let f=Math.min(e.length,t.length)/2;if(!(f<3)){n.ensure((f-1)*4);for(let u=0;u<f-1;u++){let h=t[u*2],d=t[u*2+1],m=t[u*2+2],p=t[u*2+3];if(h===m&&d===p||ri(h,d,m,p,a,st(a))||s.has(io(h,d,m,p)))continue;let b=m-h,g=p-d,y=Math.hypot(b,g)||1,A=g/y,x=-b/y,v=o-r,w=Math.hypot(e[u*2]-h,e[u*2+1]-d)||0,C=0;if(w>1e-6&&v!==0){let X=1/Math.hypot(1,v/w);C=w/Math.hypot(w,v)*Math.sign(v),A*=X,x*=X;}let B=l?l(e[u*2],e[u*2+1]):0,_=l?l(e[u*2+2],e[u*2+3]):0,T=l,k=T?T(h,d):0,K=T?T(m,p):0,P=Gr(n,e[u*2],e[u*2+1],o+B,A,x,C,i),W=Gr(n,e[u*2+2],e[u*2+3],o+_,A,x,C,i),z=Gr(n,h,d,r+k,A,x,C,i),L=Gr(n,m,p,r+K,A,x,C,i);n.indices.push(z,W,L,z,P,W);}}}function rs(n,e,t,o){let r=n.length/2-1;if(r<3)return null;let i=[];for(let f=0;f<r;f++){let u=n[f*2],h=n[f*2+1],d=n[(f+r-1)%r*2],m=n[(f+r-1)%r*2+1],p=n[(f+1)%r*2],b=n[(f+1)%r*2+1],g=Math.hypot(u-d,h-m)||1,y=Math.hypot(p-u,b-h)||1,A=(h-m)/g,x=-(u-d)/g,v=(b-h)/y,w=-(p-u)/y,C=A+v,B=x+w,_=Math.hypot(C,B);if(_<1e-6){i.push(u,h);continue}C/=_,B/=_;let T=Math.min(1/Math.max(C*A+B*x,.35),3),k=u-C*e*T,K=h-B*e*T,P=io(d,m,u,h),W=io(u,h,p,b);if(o.has(P)||o.has(W)){i.push(u,h);continue}let z=-st(t),L=t+st(t);((Q,G)=>Q<=z||Q>=L||G<=z||G>=L)(u,h)&&(k=u,K=h),i.push(k,K);}i.push(i[0],i[1]);let a=Math.abs(ns(n)),s=ns(i);if(Math.sign(s)!==Math.sign(ns(n))||Math.abs(s)<a*.25)return null;let l=-st(t),c=t+st(t);for(let f=0;f<i.length;f+=2)i[f]=Math.max(l,Math.min(c,i[f])),i[f+1]=Math.max(l,Math.min(c,i[f+1]));return i}function ns(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 is=n=>n>127?127:n<-127?-127:n,W0=n=>n>32767?32767:n<-32768?-32768:n;function Cf(n,e,t){if(!(e>0))return n;let o=st(t),r=-o,i=t+o,a=n;for(let s=0;s<3;s++){let l=a.length/2-1;if(l<6)break;let c=new Array(l).fill(true),f=l;for(let h=0;h<l&&!(f<=5);h++){let d=a[h*2],m=a[h*2+1];if(d<=r||d>=i||m<=r||m>=i)continue;let p=(h+l-1)%l;for(;!c[p]&&p!==h;)p=(p+l-1)%l;let b=(h+1)%l;for(;!c[b]&&b!==h;)b=(b+1)%l;if(p===h||b===h)break;let g=a[p*2],y=a[p*2+1],A=a[b*2]-g,x=a[b*2+1]-y,v=Math.hypot(A,x);v<1e-6||Math.abs((d-g)*x-(m-y)*A)/v<e&&(c[h]=false,f--);}if(f===l)break;let u=[];for(let h=0;h<l;h++)c[h]&&u.push(a[h*2],a[h*2+1]);u.push(u[0],u[1]),a=u;}return a}function N0(n,e,t){let o=e.r*.8,r=e.r*1.2,i=(a,s)=>{let l=Math.hypot(a-e.x,s-e.y);return l>=o&&l<=r};for(let a=0;a+3<n.length;a+=2)!i(n[a],n[a+1])||!i(n[a+2],n[a+3])||t.add(io(n[a],n[a+1],n[a+2],n[a+3]));}var ao=8;function Ef(n){return n?St(n.color)||St(n.opacity)||St(n.width):false}var gi=class{constructor(e,t){this.spec=e;this.zoom=t;this.filled=0;this.r=0;this.g=0;this.b=0;this.a=1;this.width=0;this.capacity=1024,this.buffer=new ArrayBuffer(this.capacity*ao),this.view=new DataView(this.buffer),this.base=e.base!==void 0?ht(e.base,t,[1,0,1,1]):[1,0,1,1],this.setFeature({},null,void 0);}setFeature(e,t,o){let r={zoom:this.zoom,properties:e,id:t,geometryType:o},i=this.spec.color!==void 0?_r(this.spec.color,r):null,[a,s,l,c]=i??this.base,f=this.spec.opacity!==void 0?_f(to(this.spec.opacity,r),1):1;this.r=bi(a),this.g=bi(s),this.b=bi(l),this.a=bi(c*f),this.width=this.spec.width!==void 0?Math.max(_f(to(this.spec.width,r),0),0):0;}advanceTo(e){if(!(e<=this.filled)){this.ensure(e);for(let t=this.filled;t<e;t++){let o=t*ao;this.view.setUint8(o,Math.round(this.r*255)),this.view.setUint8(o+1,Math.round(this.g*255)),this.view.setUint8(o+2,Math.round(this.b*255)),this.view.setUint8(o+3,Math.round(this.a*255)),this.view.setFloat32(o+4,this.width,true);}this.filled=e;}}take(e){return this.advanceTo(e),this.buffer.slice(0,e*ao)}ensure(e){if(e<=this.capacity)return;this.capacity=Math.max(this.capacity*2,e);let t=new ArrayBuffer(this.capacity*ao);new Uint8Array(t).set(new Uint8Array(this.buffer,0,this.filled*ao)),this.buffer=t,this.view=new DataView(t);}};function Wr(n,e){return Ef(n)?new gi(n,e):void 0}var bi=n=>n<0?0:n>1?1:n;function _f(n,e){let t=typeof n=="number"?n:Number(n);return Number.isFinite(t)?t:e}var V0=100;function ss(n){return {shapes:[],cells:[],extent:0,metersPerTile:n}}function ls(n,e,t,o){if(!(t<=0)){n.extent=o;for(let r of e){let i=r.outer;if(i.length<6)continue;let a=1/0,s=1/0,l=-1/0,c=-1/0;for(let f=0;f<i.length;f+=2)i[f]<a&&(a=i[f]),i[f]>l&&(l=i[f]),i[f+1]<s&&(s=i[f+1]),i[f+1]>c&&(c=i[f+1]);n.shapes.push({outer:i,holes:r.holes,level:t,minX:a,minY:s,maxX:l,maxY:c});}n.cells=[];}}function U0(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=Ko(Math.floor(o.minX/e)),i=Ko(Math.floor(o.maxX/e)),a=Ko(Math.floor(o.minY/e)),s=Ko(Math.floor(o.maxY/e));for(let l=a;l<=s;l++)for(let c=r;c<=i;c++)n.cells[l*32+c].push(t);}}var Ff=n=>n.shapes.length===0;function yi(n,e,t){!n.cells.length&&n.shapes.length&&U0(n);let o=n.extent/32,r=n.cells[Ko(Math.floor(t/o))*32+Ko(Math.floor(e/o))];if(!r||!r.length)return 0;let i=0;for(let a of r){let s=n.shapes[a];if(s.level<=i||e<s.minX||e>s.maxX||t<s.minY||t>s.maxY||!Sf(s.outer,e,t))continue;let l=false;for(let c of s.holes)if(Sf(c,e,t)){l=true;break}l||(i=s.level);}return Math.min(Math.round(i*100),127)}function cs(n,e){let t=[],o=[],r=n.extent>0?n.metersPerTile/n.extent:0,i=r>0?2/r:0,a=yi(n,e[0],e[1]);t.push(e[0],e[1]),o.push(a);for(let s=0;s+3<e.length;s+=2){let l=e[s],c=e[s+1],f=e[s+2],u=e[s+3],h=yi(n,f,u);if(h!==a&&i>0){let d=Math.hypot(f-l,u-c),m=Math.min(Math.ceil(d/i),64),p=a;for(let b=1;b<m;b++){let g=b/m,y=l+(f-l)*g,A=c+(u-c)*g,x=yi(n,y,A);x!==p&&(t.push(y,A),o.push(x),p=x);}}t.push(f,u),o.push(h),a=h;}return {pts:t,levels:o}}var Ko=n=>n<0?0:n>31?31:n;function Sf(n,e,t){let o=false,r=n.length/2;for(let i=0,a=r-1;i<r;a=i++){let s=n[i*2],l=n[i*2+1],c=n[a*2],f=n[a*2+1];l>t!=f>t&&e<(c-s)*(t-l)/(f-l)+s&&(o=!o);}return o}var bt=24;function fs(n,e,t=0,o,r=0,i={}){let{level:a,paint:s}=i,l=Math.max(256,n.length*24),c=new ArrayBuffer(l*bt),f=new DataView(c),u=0,h=[],d=[],m=w=>{if(u+w<=l)return;l=Math.max(l*2,u+w);let C=new ArrayBuffer(l*bt);new Uint8Array(C).set(new Uint8Array(c,0,u*bt)),c=C,f=new DataView(C);},p=(w,C,B,_,T,k,K,P=0,W=0,z=0,L=0,X=0)=>{let Q=u*bt;return f.setInt16(Q,w,true),f.setInt16(Q+2,C,true),f.setInt16(Q+4,B,true),f.setInt16(Q+6,_,true),f.setInt8(Q+8,T),f.setInt8(Q+9,k),f.setInt8(Q+10,P),f.setInt8(Q+11,W),f.setFloat32(Q+12,K,true),f.setFloat32(Q+16,z,true),f.setInt16(Q+20,L,true),f.setInt16(Q+22,X,true),u++},b=0,g=0,y=r>0?Ir/r:0,A=y>0?Fr(n):null;for(let w of n.features()){if(w.type!==2&&w.type!==3||!et(e,w.properties)||a!==void 0&&vt(w.properties)!==a)continue;let C=w.properties.osm_id,B=typeof C=="number"?C:typeof C=="string"?Number(C):NaN;g=Number.isFinite(B)?B:Number(w.id??0);let _=w.properties.width;b=typeof _=="number"&&_>.5&&_<100?_:0;let T=i.liftAt?.(w.properties)??null;s?.setFeature(w.properties,w.id??null,w.type===3?"Polygon":"LineString");let k=w.type===3;for(let K of w.loadGeometry()){let P=t>0?X0(Df(K),t):Df(K);if(P.length<4)continue;let W=o&&!Ff(o)?cs(o,P):null,z=W?W.pts:P,L=W?.levels,X=z.length/2;if(X<2)continue;let Q=vt(w.properties),G=null,Y=b;if(A&&b>0&&!k){let ee=Dr(z,{junctions:A,width:b,level:Q,taper:y});if(Y=ee.width,ee.at){G=ee.at;let ue=ee.knots;if(ue.length){let $=K0(z,L,ue);z=$.pts,L=$.levels,X=z.length/2;}}}m((X-1)*4);let ie=0;for(let ee=0;ee<X-1;ee++){let ue=z[ee*2],$=z[ee*2+1],Ae=z[ee*2+2],ve=z[ee*2+3],he=Math.hypot(Ae-ue,ve-$);if(k&&j0(ue,$,Ae,ve,n.extent)){ie+=he;continue}let xe=J0(ue,$,Ae,ve,n.extent);if(!xe){ie+=he;continue}let[de,we,I,J]=xe,Z=Math.hypot(de-ue,we-$),ce=Math.hypot(I-de,J-we),ae=Math.hypot(Ae-I,ve-J),be=ie+Z,Se=L?L[ee]:0,F=L?L[ee+1]:0,U=T?If(T(de,we)):0,j=T?If(T(I,J)):0,R=G?G(be):Y,H=G?G(be+ce):Y,E=p(de,we,I,J,0,-1,be,Se,F,R,U,j),M=p(de,we,I,J,0,1,be,Se,F,R,U,j),S=p(de,we,I,J,1,1,be,Se,F,H,U,j),D=p(de,we,I,J,1,-1,be,Se,F,H,U,j);ie+=Z+ce+ae,h.push(E,M,S,E,S,D),d.push(g,g);}}s?.advanceTo(u);}if(!h.length)return null;let x=new Uint32Array(h),v=new Float64Array(d);return {vertices:c.slice(0,u*bt),indices:x.buffer,vertexCount:u,indexCount:x.length,featureIds:v.buffer,...s?{dataPaint:s.take(u)}:{}}}function If(n){return Math.max(-32768,Math.min(32767,Math.round(n*100)))}function K0(n,e,t){let o=[...t].sort((l,c)=>l-c),r=[n[0],n[1]],i=e?[e[0]]:void 0,a=0,s=0;for(let l=0;l+3<n.length;l+=2){let c=n[l],f=n[l+1],u=n[l+2],h=n[l+3],d=Math.hypot(u-c,h-f);for(;s<o.length&&o[s]<=a+.01;)s++;for(;s<o.length&&o[s]<a+d-.01;){let m=(o[s]-a)/d;r.push(c+(u-c)*m,f+(h-f)*m),i&&e&&i.push(Math.round(e[l/2]+(e[l/2+1]-e[l/2])*m)),s++;}a+=d,r.push(u,h),i&&e&&i.push(e[l/2+1]);}return {pts:r,levels:i}}function X0(n,e){let t=[];for(let o=0;o+3<n.length;o+=2){let r=n[o],i=n[o+1],a=n[o+2],s=n[o+3];t.push(r,i);let l=Math.min(64,Math.floor(Math.hypot(a-r,s-i)/e));for(let c=1;c<l;c++){let f=c/l;t.push(r+(a-r)*f,i+(s-i)*f);}}return t.push(n[n.length-2],n[n.length-1]),t}function Df(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 J0(n,e,t,o,r){let i=t-n,a=o-e,s=0,l=1,c=[[-i,n],[i,r-n],[-a,e],[a,r-e]];for(let[f,u]of c){if(f===0){if(u<0)return null;continue}let h=u/f;if(f<0){if(h>l)return null;h>s&&(s=h);}else {if(h<s)return null;h<l&&(l=h);}}return l-s<1e-6?null:[Math.round(n+i*s),Math.round(e+a*s),Math.round(n+i*l),Math.round(e+a*l)]}function j0(n,e,t,o,r){return n===t&&(n<=0||n>=r)?true:e===o&&(e<=0||e>=r)}function us(n,e){let t=new Le;for(let o of n.layers)o.type!=="line"||!o.yieldTo||n.layerVisibleAt(o,e)&&t.add(o.yieldTo);return t}function Ai(n,e,t){return n!=="loaded"&&n!=="empty"?false:e||!t}function hs(n,e=0){if(!n.length)return null;for(let r of n)if(!r.cut.some(Boolean))return [{outer:r.ring,holes:r.holes??[]}];if(n.length<2)return null;let t=Uo(n.map(r=>({outer:r.ring,holes:r.holes??[]}))),o=e>0?t.filter(r=>Tf(r.outer,e)):t;return o.length?e>0?o.map(r=>({outer:r.outer,holes:r.holes.filter(i=>Tf(i,e))})):o:null}function Tf(n,e){let t=0,o=0;for(let r=0;r+3<n.length;r+=2)t+=n[r]*n[r+3]-n[r+2]*n[r+1],o+=Math.hypot(n[r+2]-n[r],n[r+3]-n[r+1]);return o<=0?false:Math.abs(t)/o>=e}var so=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}};var xi=class{constructor(){this.meshes=new fe;this.stitched=new Le;this.hiddenByTile=new fe;this.changed=new Le;this.budget=0;this.pending=false;this.signature="";this.meshSig=new fe;this.cache=new fe;}update(e,t,o){let r=new fe,i=0,a="";for(let[m,p]of e.loadedTiles()){if(p.id.z!==o.zoom)continue;let b=p.data?.seams;if(b?.length){a+=m+";",i=p.data?.buckets?.[t]?.extent??i;for(let g of b){let y=r.get(g.osmId);y?y.push({seam:g,tile:p.id}):r.set(g.osmId,[{seam:g,tile:p.id}]);}}}if(a===this.signature)return false;this.signature=a,this.pending=false;let s=this.budget>0?this.budget:Number.MAX_SAFE_INTEGER,l=this.budget>0?this.budget:Number.MAX_SAFE_INTEGER;if(this.changed.clear(),this.stitched.clear(),this.hiddenByTile.clear(),!i||!r.size){for(let m of this.meshes.keys())this.changed.add(m);return this.meshes.clear(),this.meshSig.clear(),this.cache.clear(),true}let c=new fe,f=new fe,u=new fe,h=new Le,d=new fe;for(let[m,p]of r){h.add(m);let b=p.map(w=>w.tile.dataKey).sort().join(","),g=this.cache.get(m);if((!g||g.sig!==b)&&s<=0){if(this.pending=true,!g)continue}else if(!g||g.sig!==b){s--;let w=p[0].tile,C=p.map(({seam:T,tile:k})=>({ring:kf(T.outer,k,w,i),holes:T.holes.map(K=>kf(K,k,w,i)),cut:T.outerCut})),B=o.metersPerTile>0?.5*i/o.metersPerTile:0,_=hs(C,B);if(_?.length){let T=Z0(_,w,i);g={sig:b,shapes:_,owner:T,seam:p[0].seam,tiles:p.map(k=>k.tile.dataKey)},this.cache.set(m,g);}else if(!g)continue}let y=g.owner.dataKey,A=Math.floor((d.get(y)??0)/Y0);d.set(y,(d.get(y)??0)+g.shapes.length);let x=`${y}#${A}`;f.set(x,g.owner);let v=c.get(x)??[];for(let w of g.shapes)v.push({rings:{outer:w.outer,holes:w.holes},seam:g.seam});c.set(x,v),u.set(x,(u.get(x)??"")+m+":"+g.sig+";"),this.stitched.add(m);for(let w of [...g.tiles,...p.map(C=>C.tile.dataKey)]){let C=this.hiddenByTile.get(w);C?C.add(m):this.hiddenByTile.set(w,new Set([m]));}}for(let m of [...this.cache.keys()])h.has(m)||this.cache.delete(m);for(let[m,p]of c){let b=u.get(m);if(this.meshSig.get(m)===b&&this.meshes.has(m))continue;if(l<=0){this.pending=true;continue}l--;let g=Xc(p,i,{metersPerUnit:o.metersPerTile>0?o.metersPerTile/i:0,cornerRadius:o.cornerRadius,cornerSegments:o.cornerSegments});this.changed.add(m),g?(this.meshes.set(m,{tile:f.get(m),mesh:g}),this.meshSig.set(m,b)):(this.meshes.delete(m),this.meshSig.delete(m));}if(this.pending)this.signature="";else for(let m of [...this.meshes.keys()])c.has(m)||(this.meshes.delete(m),this.meshSig.delete(m),this.changed.add(m));return true}reset(){this.meshes.clear(),this.stitched.clear(),this.hiddenByTile.clear(),this.cache.clear();for(let e of this.meshSig.keys())this.changed.add(e);this.meshSig.clear(),this.signature="";}},Y0=12;function Z0(n,e,t){let o=-1/0,r=-1/0;for(let c of n)for(let f=0;f<c.outer.length;f+=2)c.outer[f]>o&&(o=c.outer[f]),c.outer[f+1]>r&&(r=c.outer[f+1]);if(!Number.isFinite(o))return e;let i=Math.ceil(o/t)-1,a=Math.ceil(r/t)-1;if(i===0&&a===0)return e;let s=i*t,l=a*t;for(let c of n)for(let f of [c.outer,...c.holes])for(let u=0;u<f.length;u+=2)f[u]-=s,f[u+1]-=l;return new so(e.z,e.x+i,e.y+a,e.wrap)}function kf(n,e,t,o){let r=(e.x-t.x)*o,i=(e.y-t.y)*o,a=new Array(n.length);for(let s=0;s<n.length;s+=2)a[s]=n[s]+r,a[s+1]=n[s+1]+i;return a}var ds={enabled:true,skyColor:"#7fb2e5",horizonColor:"#dfe6ee",fogRange:[2.43,10.1],fogIntensity:.92,fogVerticalRange:[35,220],spaceColor:"#05070f",atmosphereColor:"#79b8f5",starIntensity:.55,horizonBlend:.14},ms={ambientColor:"#ffffff",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#fff4e2",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#dce6f2",fillIntensity:.18};var Lf={version:1,name:"OSM 3D \u2014 \u0434\u043D\u0435\u0432\u043D\u043E\u0439",background:"#dbd8d4",levelHeight:1,light:{ambientColor:"#ffffff",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#ffffff",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#ffffff",fillIntensity:.18},layers:[{id:"world-landcover-wood",type:"fill",source:"world","source-layer":"landcover",maxzoom:7,filter:["in","class","wood","forest"],paint:{color:{from:"landcover-wood"}}},{id:"world-landcover-grass",type:"fill",source:"world","source-layer":"landcover",maxzoom:7,filter:["in","class","grass","farmland","meadow"],paint:{color:{from:"landcover-grass"}}},{id:"world-landcover-sand",type:"fill",source:"world","source-layer":"landcover",maxzoom:7,filter:["in","class","sand","beach"],paint:{color:{from:"landcover-sand"}}},{id:"world-landcover-ice",type:"fill",source:"world","source-layer":"landcover",maxzoom:7,filter:["in","class","ice","glacier"],paint:{color:{from:"landcover-ice"}}},{id:"world-water",type:"fill",source:"world","source-layer":"water",maxzoom:7,paint:{color:{from:"water"}}},{id:"world-boundary",type:"line",source:"world","source-layer":"boundary",maxzoom:7,paint:{color:{from:"boundary"},opacity:.7,width:{stops:[[0,.5],[6,1.1]]}}},{id:"landcover-wood",type:"surface",minzoom:7,"source-layer":"landcover",filter:["in","class","wood","forest"],elevation:.09,bevel:.12,bevelDrop:.09,paint:{color:"#c6dcb4",opacity:{stops:[[8,.5],[12,.85]]},material:"flat"}},{id:"landcover-grass",type:"surface",minzoom:7,"source-layer":"landcover",filter:["in","class","grass","farmland","meadow"],elevation:.06,bevel:.1,bevelDrop:.06,paint:{color:"#d9e6c6",opacity:{stops:[[8,.45],[12,.8]]},material:"flat"}},{id:"landcover-sand",type:"surface",minzoom:7,"source-layer":"landcover",filter:["in","class","sand","beach"],elevation:.03,bevel:.1,bevelDrop:.03,paint:{color:"#f2e7c8",material:"flat"}},{id:"landcover-ice",type:"surface",minzoom:7,"source-layer":"landcover",filter:["in","class","ice","glacier"],elevation:.03,bevel:.1,bevelDrop:.03,paint:{color:"#e6f2f7"}},{id:"landcover-wetland",type:"surface",minzoom:7,"source-layer":"landcover",filter:["in","class","wetland","swamp"],elevation:.03,bevel:.1,bevelDrop:.03,paint:{color:"#cfe0d4",material:"flat"}},{id:"landuse-residential",type:"surface","source-layer":"landuse",filter:["in","class","residential","suburb","neighbourhood","quarter"],elevation:.01,bevel:.08,bevelDrop:.01,paint:{color:"#d3d0cb",opacity:{stops:[[10,.4],[14,.7]]}}},{id:"landuse-industrial",type:"surface","source-layer":"landuse",filter:["in","class","industrial","quarry","railway","substation"],elevation:.02,bevel:.08,bevelDrop:.02,paint:{color:"#e7e0dd"}},{id:"landuse-civic",type:"surface","source-layer":"landuse",filter:["in","class","school","university","college","hospital","clinic","police","kindergarten","bus_station"],elevation:.03,bevel:.08,bevelDrop:.03,paint:{color:"#ece3d8"}},{id:"landuse-sport",type:"surface","source-layer":"landuse",filter:["in","class","pitch","stadium","playground","track","swimming_pool"],elevation:.07,bevel:.1,bevelDrop:.07,paint:{color:"#cfe3c4",material:"flat"}},{id:"landuse-cemetery",type:"surface","source-layer":"landuse",filter:["in","class","cemetery","grave_yard"],elevation:.06,bevel:.1,bevelDrop:.06,paint:{color:"#d6dfc8",material:"flat"}},{id:"landuse-parking",type:"surface","source-layer":"landuse",filter:["in","class","parking","fuel"],elevation:.05,bevel:.1,bevelDrop:.05,paint:{color:"#dddad5"}},{id:"park",type:"surface","source-layer":"park",elevation:.08,bevel:.12,bevelDrop:.08,paint:{color:"#cfe5bd",opacity:.75,material:"flat"}},{id:"aeroway-area",type:"surface","source-layer":"aeroway",filter:["in","class","aerodrome","apron","helipad"],elevation:.04,bevel:.1,bevelDrop:.04,paint:{color:"#e4e2e6"}},{id:"water",type:"surface",minzoom:7,"source-layer":"water",filter:["!in","class","swimming_pool"],elevation:-0.22,bevel:.6,paint:{color:"#a5cbe3",material:"water",materialScale:14,materialSpeed:1}},{id:"water-pool",type:"surface","source-layer":"water",filter:["==","class","swimming_pool"],elevation:-0.12,bevel:.3,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:"flat"}},{id:"road-bed",type:"surface","source-layer":"transportation",minzoom:16,filter:["in","class","motorway","trunk","primary","secondary","tertiary","minor","service","track"],fromLines:true,width:6,widthExtra:.9,deck:.5,elevation:.11,bevel:.12,bevelDrop:.11,weld:.6,paint:{color:{from:"road-casing-minor",darken:.07},sideShade:.24}},{id:"path-bed",type:"surface","source-layer":"transportation",minzoom:16.5,filter:["in","class","path","pedestrian","footway","steps"],fromLines:true,width:2.2,widthExtra:.3,deck:.25,elevation:.16,bevel:.08,bevelDrop:.16,weld:.4,paint:{color:{from:"road-path"},sideShade:.2}},{id:"road-bridge-outline-thin",type:"line",network:"roads","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","path","pedestrian","footway","steps","rail","transit"]],minzoom:14,paint:{color:{from:"road-casing-major",darken:.2},width:{stops:[[14,2.5],[17,5],[19,9],[20,15],[21,28]]}}},{id:"road-casing-major",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","motorway","trunk","primary"],minzoom:5,paint:{elevation:.085,color:"#d4ab68",width:{stops:[[6,1.6],[10,3.4],[14,8],[16,14],[18,30],[19,45],[20,90],[21,180],[22,360]]},widthFromData:true,widthExtra:2.5}},{id:"road-casing-secondary",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","secondary","tertiary"],minzoom:9,paint:{elevation:.085,color:{stops:[[16,"#c6bca6"],[18.5,"#d4ab68"]]},width:{stops:[[10,1.6],[14,5.5],[16,10],[18,22],[19,33],[20,66],[21,132],[22,264]]},widthFromData:true,widthExtra:2}},{id:"road-casing-minor",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","minor","service","track"],minzoom:12,paint:{elevation:.085,color:{stops:[[16,"#cdc4b2"],[18.5,"#d4ab68"]]},width:{stops:[[13,1.4],[16,6],[18,14],[19,22],[20,44],[21,88],[22,176]]},widthFromData:true,widthExtra:1.5}},{id:"road-rail",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","rail","transit"],minzoom:10,paint:{color:"#b2a99e",width:{stops:[[10,.8],[14,1.8],[18,4],[19,5.5],[20,11],[21,22],[22,44]]}}},{id:"road-path",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","path","pedestrian","footway","steps"],minzoom:14,paint:{elevation:.17,color:"#bdb2a0",width:{stops:[[14,.8],[17,2],[19,4],[20,8],[21,16],[22,32]]},dashArray:[4,3],material:"flat"}},{id:"road-minor",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","minor","service","track"],minzoom:12,paint:{elevation:.09,color:{stops:[[16,"#ffffff"],[18.5,"#ffdfa3"]]},width:{stops:[[13,.6],[16,4],[18,11],[19,18],[20,36],[21,72],[22,144]]},material:"flat",widthFromData:true}},{id:"road-ramp",network:"roads",type:"line","source-layer":"transportation",filter:["all",["in","class","motorway","trunk","primary"],["has","ramp"]],minzoom:5,paint:{elevation:.09,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",widthFromData:true}},{id:"road-secondary",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","secondary","tertiary"],minzoom:9,paint:{elevation:.09,color:{stops:[[16,"#ffffff"],[18.5,"#ffdfa3"]]},width:{stops:[[10,.8],[14,3.6],[16,7.5],[18,18],[19,28],[20,56],[21,112],[22,224]]},material:"flat",widthFromData:true}},{id:"road-major",network:"roads",type:"line","source-layer":"transportation",filter:["all",["in","class","motorway","trunk","primary"],["!has","ramp"]],minzoom:5,paint:{elevation:.09,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",widthFromData:true}},{id:"road-lane-divider-major",network:"roads",type:"line","source-layer":"transportation",filter:["all",["!has","oneway"],["in","class","motorway","trunk","primary"]],minzoom:16.5,paint:{elevation:.095,color:"#e3bd7f",width:{stops:[[16.5,.54],[17,.78],[18,1.4],[19,2.17],[20,4.34],[21,8.68],[22,17.36]]},dashArray:[7,18],material:"flat"}},{id:"road-lane-divider-secondary",network:"roads",type:"line","source-layer":"transportation",filter:["all",["!has","oneway"],["in","class","secondary","tertiary"]],minzoom:16.5,paint:{elevation:.095,color:"#d8cfbc",width:{stops:[[16.5,.46],[17,.67],[18,1.2],[19,1.86],[20,3.72],[21,7.44],[22,14.88]]},dashArray:[7,18],material:"flat"}},{id:"boundary",type:"line",minzoom:7,"source-layer":"boundary",filter:["<=","admin_level",4],paint:{color:"#b3a6b8",opacity:.7,width:{stops:[[4,.7],[10,1.4],[16,2.4]]},dashArray:[6,4]}},{id:"building",type:"fill-extrusion","source-layer":"building",minzoom:15,paint:{color:"#ffffff",roofColor:"#f2f1f0",opacity:1,heightScale:{stops:[[15,0],[15.8,1]]},aoStrength:.18,tintVariation:0,windowColor:"#7f9ab5",windowFrameColor:"#e9e5dc",windowGlow:0,facadeDetail:1,floorHeight:3.2,roofVariation:.35}},{id:"indoor-venue",type:"fill-extrusion",source:"indoor","source-layer":"area",filter:["all",["==","class","level"],["==","base",1]],minzoom:15,maxzoom:16,paint:{color:"#d8d3c8",roofColor:"#d9d3c7",opacity:1,aoStrength:.18,tintVariation:.06,windowColor:"#7f9ab5",windowFrameColor:"#e9e5dc",windowGlow:0,facadeDetail:1,floorHeight:3.2,roofVariation:.35}},{id:"road-closed-casing",type:"line",source:"closures","source-layer":"closures",minzoom:11,paint:{color:"#ffffff",width:{stops:[[11,4],[14,6],[17,10],[19,16],[20,32],[21,64],[22,128]]},opacity:.9},overlay:"roads"},{id:"road-closed",type:"line",source:"closures","source-layer":"closures",minzoom:11,paint:{color:"#d92b2b",width:{stops:[[11,2.5],[14,4],[17,7],[19,11],[20,22],[21,44],[22,88]]},dashArray:[5,4]},overlay:"roads"},{id:"traffic-signal",type:"symbol",source:"points","source-layer":"roadpoints",minzoom:17,filter:["==","kind","traffic_signals"],layout:{iconImage:"traffic_signals",allowOverlap:true,iconParts:["traffic_light_pole","traffic_light_body","traffic_light_red","traffic_light_amber","traffic_light_green"],offset:[0,-12],iconSize:{stops:[[17,17],[19,26]]},priority:3},paint:{color:"#5c6470",haloColor:"#ffffff",haloWidth:1.4,partColors:["#6a717c","#1c2026","#ff4d57","#f8cf2c","#12d370"],partHaloWidths:[1,1.3,0,0,0]}},{id:"housenumber",type:"symbol","source-layer":"housenumber",minzoom:17,layout:{ignorePlacement:true,placementGroup:"background-labels",textField:"{housenumber}",textSize:{stops:[[17,9],[19,11]]},maxLineChars:6,priority:-60},paint:{textWeight:.35,color:"#8c8478",haloColor:"#f5f3ee",haloWidth:1}},{id:"road-label-minor",type:"symbol","source-layer":"transportation_name",minzoom:15,filter:["!in","class","motorway","trunk","primary","secondary"],layout:{ignorePlacement:true,placementGroup:"background-labels",textField:["{name:ru}","{name}"],textPlacement:"line",symbolSpacing:900,textSize:{stops:[[15,10.5],[18,12]]},priority:15,abbreviate:true},paint:{textWeight:.35,color:{from:"road-label"},haloColor:{from:"road-label"},haloWidth:1.6}},{id:"road-label",type:"symbol","source-layer":"transportation_name",minzoom:12.5,filter:["in","class","motorway","trunk","primary","secondary"],layout:{ignorePlacement:true,placementGroup:"background-labels",textField:["{name:ru}","{name}"],textPlacement:"line",symbolSpacing:900,textSize:{stops:[[14,10],[18,13]]},priority:20,abbreviate:true},paint:{textWeight:.35,color:"#5c5646",haloColor:"#ffffff",haloWidth:1.6}},{id:"road-closed-end",type:"symbol",source:"closures","source-layer":"closure_ends",minzoom:13,layout:{iconImage:"road_closed",iconFrame:"circle",iconFrameScale:1.6,allowOverlap:true,iconSize:13,priority:6},paint:{color:"#d92b2b",frameColor:"#d92b2b",frameOpacity:1,frameHaloColor:"#ffffff",frameHaloWidth:1.4,frameGradient:.18,frameShadow:.5,frameShadowOffset:2.5,frameShadowBlur:4,iconColor:"#ffffff",iconHaloWidth:0}},{id:"crossing",type:"surface",source:"points","source-layer":"crossings",minzoom:16.5,overlay:"roads",elevation:.12,bevel:.04,bevelDrop:.02,paint:{color:"#ffffff",opacity:.9}},{id:"poi-food",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,11],[18,12]]},iconSize:{stops:[[15,14.9],[18,17.6]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{textWeight:.35,color:"#f4882c",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#f4882c",frameHaloColor:"#ffffff",frameHaloWidth:1.2,frameGradient:.18,frameShadow:.5,frameShadowOffset:2.5,frameShadowBlur:4,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:16,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,11],[18,12]]},iconSize:{stops:[[15,14.9],[18,17.6]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{textWeight:.35,color:"#a269e7",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#a269e7",frameHaloColor:"#ffffff",frameHaloWidth:1.2,frameGradient:.18,frameShadow:.5,frameShadowOffset:2.5,frameShadowBlur:4,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,11],[18,12]]},iconSize:{stops:[[15,14.9],[18,17.6]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{textWeight:.35,color:"#4677e8",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#4677e8",frameHaloColor:"#ffffff",frameHaloWidth:1.2,frameGradient:.18,frameShadow:.5,frameShadowOffset:2.5,frameShadowBlur:4,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,11],[18,12]]},iconSize:{stops:[[15,14.9],[18,17.6]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{textWeight:.35,color:"#f86776",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#f86776",frameHaloColor:"#ffffff",frameHaloWidth:1.2,frameGradient:.18,frameShadow:.5,frameShadowOffset:2.5,frameShadowBlur:4,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","pharmacy","hospital","doctors","dentist","veterinary"]},{id:"poi-education",type:"symbol","source-layer":"poi",minzoom:16,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,11],[18,12]]},iconSize:{stops:[[15,14.9],[18,17.6]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{textWeight:.35,color:"#2ac1d4",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#2ac1d4",frameHaloColor:"#ffffff",frameHaloWidth:1.2,frameGradient:.18,frameShadow:.5,frameShadowOffset:2.5,frameShadowBlur:4,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,11],[18,12]]},iconSize:{stops:[[15,14.9],[18,17.6]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{textWeight:.35,color:"#cc5e3c",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#cc5e3c",frameHaloColor:"#ffffff",frameHaloWidth:1.2,frameGradient:.18,frameShadow:.5,frameShadowOffset:2.5,frameShadowBlur:4,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,11],[18,12]]},iconSize:{stops:[[15,14.9],[18,17.6]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{textWeight:.35,color:"#2db375",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#2db375",frameHaloColor:"#ffffff",frameHaloWidth:1.2,frameGradient:.18,frameShadow:.5,frameShadowOffset:2.5,frameShadowBlur:4,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:16,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,11],[18,12]]},iconSize:{stops:[[15,14.9],[18,17.6]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{textWeight:.35,color:"#a66fe8",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#a66fe8",frameHaloColor:"#ffffff",frameHaloWidth:1.2,frameGradient:.18,frameShadow:.5,frameShadowOffset:2.5,frameShadowBlur:4,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","lodging"]},{id:"poi-service",type:"symbol","source-layer":"poi",minzoom:17,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,11],[18,12]]},iconSize:{stops:[[15,14.9],[18,17.6]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{textWeight:.35,color:"#6e87bf",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#6e87bf",frameHaloColor:"#ffffff",frameHaloWidth:1.2,frameGradient:.18,frameShadow:.5,frameShadowOffset:2.5,frameShadowBlur:4,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:17,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,11],[18,12]]},iconSize:{stops:[[15,14.9],[18,17.6]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{textWeight:.35,color:"#4caaf3",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#4caaf3",frameHaloColor:"#ffffff",frameHaloWidth:1.2,frameGradient:.18,frameShadow:.5,frameShadowOffset:2.5,frameShadowBlur:4,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:"road-shield",type:"symbol","source-layer":"transportation_name",filter:["all",["has","ref"],["in","class","motorway","trunk","primary"]],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:{textWeight:.35,color:"#3a4048",haloColor:"#f7f3e8",haloWidth:.5,iconColor:"#f7f3e8",iconHaloColor:"#8a8172",iconHaloWidth:1.4}},{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:{textWeight:.35,color:"#3d7ea6",haloColor:"#ffffff",haloWidth:1.4}},{id:"place-label",type:"symbol","source-layer":"place",minzoom:4,filter:["all",["in","class","city","country"],["!in","name","\u0414\u0443\u0448\u0430\u043D\u0431\u0435","\u0425\u0443\u04B7\u0430\u043D\u0434","\u0425\u0443\u0434\u0436\u0430\u043D\u0434","\u0411\u043E\u0445\u0442\u0430\u0440","\u0425\u043E\u0440\u0443\u0493","\u0425\u043E\u0440\u043E\u0433"]],layout:{textField:["{name:ru}","{name}"],textSize:{stops:[[4,11],[7,13],[10,14],[14,16],[17,17]]},maxLineChars:16,priority:90},paint:{textWeight:.35,color:"#57544e",haloColor:"#ffffff",haloWidth:1.8}},{id:"place-capital",type:"symbol","source-layer":"place",minzoom:4,filter:["all",["==","class","city"],["in","name","\u0414\u0443\u0448\u0430\u043D\u0431\u0435","\u0425\u0443\u04B7\u0430\u043D\u0434","\u0425\u0443\u0434\u0436\u0430\u043D\u0434","\u0411\u043E\u0445\u0442\u0430\u0440","\u0425\u043E\u0440\u0443\u0493","\u0425\u043E\u0440\u043E\u0433"]],layout:{textField:["{name:ru}","{name}"],textSize:{stops:[[4,12],[7,14],[10,15],[14,17],[17,18]]},maxLineChars:16,priority:110},paint:{textWeight:.35,color:"#57544e",haloColor:"#ffffff",haloWidth:1.8}},{id:"place-label-minor",type:"symbol","source-layer":"place",minzoom:7.5,filter:["in","class","town"],layout:{textField:["{name:ru}","{name}"],textSize:{stops:[[7.5,10.5],[12,12.5],[16,14]]},maxLineChars:16,priority:70},paint:{textWeight:.35,color:{from:"place-label"},haloColor:{from:"place-label"},haloWidth:1.6}},{id:"place-label-local",type:"symbol","source-layer":"place",minzoom:10.5,filter:["in","class","village","hamlet","suburb","quarter","neighbourhood","isolated_dwelling","island"],layout:{textField:["{name:ru}","{name}"],textSize:{stops:[[10.5,10.5],[16,12.5]]},maxLineChars:16,priority:55},paint:{textWeight:.35,color:{from:"place-label"},haloColor:{from:"place-label"},haloWidth:1.6}},{id:"place-region",type:"symbol",source:"regions","source-layer":"regions",minzoom:4.5,layout:{textField:["{name:ru}","{name}"],textSize:{stops:[[4.5,11.5],[7,14],[10,16],[14,17]]},letterSpacing:.15,maxLineChars:14,priority:100},paint:{textWeight:.35,color:{from:"place-label"},haloColor:{from:"place-label"},haloWidth:2}},{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:{textWeight:.35,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:{textWeight:.35,color:"#57544e",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:{textWeight:.35,color:"#2d6ecb",haloColor:"#ffffff",haloWidth:1.6}}],sources:{regions:{type:"geojson",sourceLayer:"regions",data:{type:"FeatureCollection",features:[{type:"Feature",geometry:{type:"Point",coordinates:[72.9987,38.3503]},properties:{class:"state",name:"\u0412\u0438\u043B\u043E\u044F\u0442\u0438 \u041C\u0443\u0445\u0442\u043E\u0440\u0438 \u041A\u04EF\u04B3\u0438\u0441\u0442\u043E\u043D\u0438 \u0411\u0430\u0434\u0430\u0445\u0448\u043E\u043D","name:ru":"\u0413\u043E\u0440\u043D\u043E-\u0411\u0430\u0434\u0430\u0445\u0448\u0430\u043D\u0441\u043A\u0430\u044F \u0430\u0432\u0442\u043E\u043D\u043E\u043C\u043D\u0430\u044F \u043E\u0431\u043B\u0430\u0441\u0442\u044C","name:en":"Gorno-Badakhshan Autonomous Province"}},{type:"Feature",geometry:{type:"Point",coordinates:[69.9582,40.5242]},properties:{class:"state",name:"\u0412\u0438\u043B\u043E\u044F\u0442\u0438 \u0421\u0443\u0493\u0434","name:ru":"\u0421\u043E\u0433\u0434\u0438\u0439\u0441\u043A\u0430\u044F \u043E\u0431\u043B\u0430\u0441\u0442\u044C","name:en":"Sughd Province"}},{type:"Feature",geometry:{type:"Point",coordinates:[69.2633,37.8814]},properties:{class:"state",name:"\u0412\u0438\u043B\u043E\u044F\u0442\u0438 \u0425\u0430\u0442\u043B\u043E\u043D","name:ru":"\u0425\u0430\u0442\u043B\u043E\u043D\u0441\u043A\u0430\u044F \u043E\u0431\u043B\u0430\u0441\u0442\u044C","name:en":"Khatlon Province"}},{type:"Feature",geometry:{type:"Point",coordinates:[70.0873,38.9722]},properties:{class:"state",name:"\u041D\u043E\u04B3\u0438\u044F\u04B3\u043E\u0438 \u0442\u043E\u0431\u0435\u0438 \u04B7\u0443\u043C\u04B3\u0443\u0440\u04E3","name:ru":"\u0420\u0430\u0439\u043E\u043D\u044B \u0440\u0435\u0441\u043F\u0443\u0431\u043B\u0438\u043A\u0430\u043D\u0441\u043A\u043E\u0433\u043E \u043F\u043E\u0434\u0447\u0438\u043D\u0435\u043D\u0438\u044F","name:en":"Districts of Republican Subordination"}}]}},world:{url:"/tileserver/data/world/{z}/{x}/{y}.pbf",minzoom:0,maxzoom:6},indoor:{url:"/tileserver/data/indoor/{z}/{x}/{y}.pbf",minzoom:15,maxzoom:18},points:{url:"/tileserver/data/points/{z}/{x}/{y}.pbf",minzoom:13,maxzoom:16},closures:{url:"/tileserver/data/closures/{z}/{x}/{y}.pbf",minzoom:10,maxzoom:16}}};var Rf={version:1,name:"\u041C\u044F\u0433\u043A\u0430\u044F \u0433\u0435\u043E\u043C\u0435\u0442\u0440\u0438\u044F",background:"#dbd8d4",light:{ambientColor:"#ffffff",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#ffffff",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#ffffff",fillIntensity:.18},layers:[{id:"world-landcover-wood",type:"fill",source:"world","source-layer":"landcover",maxzoom:7,filter:["in","class","wood","forest"],paint:{color:{from:"landcover-wood"}}},{id:"world-landcover-grass",type:"fill",source:"world","source-layer":"landcover",maxzoom:7,filter:["in","class","grass","farmland","meadow"],paint:{color:{from:"landcover-grass"}}},{id:"world-landcover-sand",type:"fill",source:"world","source-layer":"landcover",maxzoom:7,filter:["in","class","sand","beach"],paint:{color:{from:"landcover-sand"}}},{id:"world-landcover-ice",type:"fill",source:"world","source-layer":"landcover",maxzoom:7,filter:["in","class","ice","glacier"],paint:{color:{from:"landcover-ice"}}},{id:"world-water",type:"fill",source:"world","source-layer":"water",maxzoom:7,paint:{color:{from:"water"}}},{id:"world-boundary",type:"line",source:"world","source-layer":"boundary",maxzoom:7,paint:{color:{from:"boundary"},opacity:.7,width:{stops:[[0,.5],[6,1.1]]}}},{id:"landcover-wood",type:"fill",minzoom:7,"source-layer":"landcover",filter:["in","class","wood","forest"],paint:{color:"#c6dcb4",opacity:{stops:[[8,.5],[12,.85]]},material:"flat"},cornerRadius:10,cornerSegments:4},{id:"landcover-grass",type:"fill",minzoom:7,"source-layer":"landcover",filter:["in","class","grass","farmland","meadow"],paint:{color:"#d9e6c6",opacity:{stops:[[8,.45],[12,.8]]},material:"flat"},cornerRadius:8,cornerSegments:4},{id:"landcover-sand",type:"fill",minzoom:7,"source-layer":"landcover",filter:["in","class","sand","beach"],paint:{color:"#f2e7c8",material:"flat"},cornerRadius:10,cornerSegments:4},{id:"landcover-ice",type:"fill",minzoom:7,"source-layer":"landcover",filter:["in","class","ice","glacier"],paint:{color:"#e6f2f7"}},{id:"landcover-wetland",type:"fill",minzoom:7,"source-layer":"landcover",filter:["in","class","wetland","swamp"],paint:{color:"#cfe0d4",material:"flat"},cornerRadius:8,cornerSegments:4},{id:"landuse-residential",type:"fill","source-layer":"landuse",filter:["in","class","residential","suburb","neighbourhood","quarter"],paint:{color:"#d3d0cb",opacity:{stops:[[10,.4],[14,.7]]}},cornerRadius:4,cornerSegments:3},{id:"landuse-industrial",type:"fill","source-layer":"landuse",filter:["in","class","industrial","quarry","railway","substation"],paint:{color:"#e7e0dd"},cornerRadius:4,cornerSegments:3},{id:"landuse-civic",type:"fill","source-layer":"landuse",filter:["in","class","school","university","college","hospital","clinic","police","kindergarten","bus_station"],paint:{color:"#ece3d8"},cornerRadius:4,cornerSegments:3},{id:"landuse-sport",type:"fill","source-layer":"landuse",filter:["in","class","pitch","stadium","playground","track","swimming_pool"],paint:{color:"#cfe3c4",material:"flat"},cornerRadius:5,cornerSegments:3},{id:"landuse-cemetery",type:"fill","source-layer":"landuse",filter:["in","class","cemetery","grave_yard"],paint:{color:"#d6dfc8",material:"flat"},cornerRadius:5,cornerSegments:3},{id:"landuse-parking",type:"fill","source-layer":"landuse",filter:["in","class","parking","fuel"],paint:{color:"#dddad5"},cornerRadius:3,cornerSegments:3},{id:"park",type:"fill","source-layer":"park",paint:{color:"#cfe5bd",opacity:.75,material:"flat"},cornerRadius:9,cornerSegments:4},{id:"aeroway-area",type:"fill","source-layer":"aeroway",filter:["in","class","aerodrome","apron","helipad"],paint:{color:"#e4e2e6"},cornerRadius:5,cornerSegments:3},{id:"water",type:"fill",minzoom:7,"source-layer":"water",filter:["!in","class","swimming_pool"],paint:{color:"#a5cbe3",material:"water",materialScale:14,materialSpeed:1},cornerRadius:7,cornerSegments:4},{id:"water-pool",type:"fill","source-layer":"water",filter:["==","class","swimming_pool"],paint:{color:"#9fd3e8",material:"water",materialScale:8,materialSpeed:1},cornerRadius:4,cornerSegments:4},{id:"waterway",type:"line","source-layer":"waterway",paint:{color:"#a5cbe3",width:{stops:[[8,.6],[12,1.4],[16,4],[19,11.5],[20,23],[21,46],[22,92]]},material:"water",materialScale:10,materialSpeed:1}},{id:"aeroway-line",type:"line","source-layer":"aeroway",filter:["in","class","runway","taxiway"],paint:{color:"#d8d5da",width:{stops:[[10,1],[14,5],[18,24],[19,24],[20,48],[21,96],[22,192]]},material:"flat"}},{id:"road-bridge-outline-thin",type:"line",network:"roads","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","path","pedestrian","footway","steps","rail","transit"]],minzoom:14,paint:{color:{from:"road-casing-major",darken:.2},width:{stops:[[14,2.5],[17,5],[19,9],[20,15],[21,28]]}}},{id:"road-casing-major",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","motorway","trunk","primary"],minzoom:5,paint:{color:"#d4ab68",width:{stops:[[6,1.6],[10,3.4],[14,8],[16,14],[18,30],[19,45],[20,90],[21,180],[22,360]]},widthFromData:true,widthExtra:2.5}},{id:"road-casing-secondary",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","secondary","tertiary"],minzoom:9,paint:{color:{stops:[[16,"#c6bca6"],[18.5,"#d4ab68"]]},width:{stops:[[10,1.6],[14,5.5],[16,10],[18,22],[19,33],[20,66],[21,132],[22,264]]},widthFromData:true,widthExtra:2}},{id:"road-casing-minor",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","minor","service","track"],minzoom:12,paint:{color:{stops:[[16,"#cdc4b2"],[18.5,"#d4ab68"]]},width:{stops:[[13,1.4],[16,6],[18,14],[19,22],[20,44],[21,88],[22,176]]},widthFromData:true,widthExtra:1.5}},{id:"road-rail",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","rail","transit"],minzoom:10,paint:{color:"#b2a99e",width:{stops:[[10,.8],[14,1.8],[18,4],[19,5.5],[20,11],[21,22],[22,44]]}}},{id:"road-path",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","path","pedestrian","footway","steps"],minzoom:14,paint:{color:"#bdb2a0",width:{stops:[[14,.8],[17,2],[19,4],[20,8],[21,16],[22,32]]},dashArray:[4,3],material:"flat"}},{id:"road-minor",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","minor","service","track"],minzoom:12,paint:{color:{stops:[[16,"#ffffff"],[18.5,"#ffdfa3"]]},width:{stops:[[13,.6],[16,4],[18,11],[19,18],[20,36],[21,72],[22,144]]},material:"flat",widthFromData:true}},{id:"road-ramp",network:"roads",type:"line","source-layer":"transportation",filter:["all",["in","class","motorway","trunk","primary"],["has","ramp"]],minzoom:5,paint:{color:"#ffdfa3",width:{stops:[[6,.8],[10,2.2],[14,6],[16,11],[18,25],[19,38.5],[20,77],[21,154],[22,308]]},material:"flat",widthFromData:true}},{id:"road-secondary",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","secondary","tertiary"],minzoom:9,paint:{color:{stops:[[16,"#ffffff"],[18.5,"#ffdfa3"]]},width:{stops:[[10,.8],[14,3.6],[16,7.5],[18,18],[19,28],[20,56],[21,112],[22,224]]},material:"flat",widthFromData:true}},{id:"road-major",network:"roads",type:"line","source-layer":"transportation",filter:["all",["in","class","motorway","trunk","primary"],["!has","ramp"]],minzoom:5,paint:{color:"#ffdfa3",width:{stops:[[6,.8],[10,2.2],[14,6],[16,11],[18,25],[19,38.5],[20,77],[21,154],[22,308]]},material:"flat",widthFromData:true}},{id:"road-lane-divider-major",network:"roads",type:"line","source-layer":"transportation",filter:["all",["!has","oneway"],["in","class","motorway","trunk","primary"]],minzoom:16.5,paint:{color:"#e3bd7f",width:{stops:[[16.5,.54],[17,.78],[18,1.4],[19,2.17],[20,4.34],[21,8.68],[22,17.36]]},dashArray:[7,18],material:"flat"}},{id:"road-lane-divider-secondary",network:"roads",type:"line","source-layer":"transportation",filter:["all",["!has","oneway"],["in","class","secondary","tertiary"]],minzoom:16.5,paint:{color:"#d8cfbc",width:{stops:[[16.5,.46],[17,.67],[18,1.2],[19,1.86],[20,3.72],[21,7.44],[22,14.88]]},dashArray:[7,18],material:"flat"}},{id:"boundary",type:"line",minzoom:7,"source-layer":"boundary",filter:["<=","admin_level",4],paint:{color:"#b3a6b8",opacity:.7,width:{stops:[[4,.7],[10,1.4],[16,2.4]]},dashArray:[6,4]}},{id:"building",type:"fill-extrusion","source-layer":"building",minzoom:15,paint:{color:"#ffffff",roofColor:"#f2f1f0",opacity:1,heightScale:{stops:[[15,0],[15.8,1]]},aoStrength:.18,tintVariation:0,windowColor:"#7f9ab5",windowFrameColor:"#e9e5dc",windowGlow:0,facadeDetail:1,floorHeight:3.2,roofVariation:.35},cornerRadius:1.6,cornerSegments:2},{id:"indoor-venue",type:"fill-extrusion",source:"indoor","source-layer":"area",filter:["all",["==","class","level"],["==","base",1]],minzoom:15,maxzoom:16,paint:{color:"#d8d3c8",roofColor:"#d9d3c7",opacity:1,aoStrength:.18,tintVariation:.06,windowColor:"#7f9ab5",windowFrameColor:"#e9e5dc",windowGlow:0,facadeDetail:1,floorHeight:3.2,roofVariation:.35}},{id:"road-closed-casing",type:"line",source:"closures","source-layer":"closures",minzoom:11,paint:{color:"#ffffff",width:{stops:[[11,4],[14,6],[17,10],[19,16],[20,32],[21,64],[22,128]]},opacity:.9},overlay:"roads"},{id:"road-closed",type:"line",source:"closures","source-layer":"closures",minzoom:11,paint:{color:"#d92b2b",width:{stops:[[11,2.5],[14,4],[17,7],[19,11],[20,22],[21,44],[22,88]]},dashArray:[5,4]},overlay:"roads"},{id:"traffic-signal",type:"symbol",source:"points","source-layer":"roadpoints",minzoom:17,filter:["==","kind","traffic_signals"],layout:{iconImage:"traffic_signals",allowOverlap:true,iconParts:["traffic_light_pole","traffic_light_body","traffic_light_red","traffic_light_amber","traffic_light_green"],offset:[0,-12],iconSize:{stops:[[17,17],[19,26]]},priority:3},paint:{color:"#5c6470",haloColor:"#ffffff",haloWidth:1.4,partColors:["#6a717c","#1c2026","#ff4d57","#f8cf2c","#12d370"],partHaloWidths:[1,1.3,0,0,0]}},{id:"housenumber",type:"symbol","source-layer":"housenumber",minzoom:17,layout:{ignorePlacement:true,placementGroup:"background-labels",textField:"{housenumber}",textSize:{stops:[[17,9],[19,11]]},maxLineChars:6,priority:-60},paint:{textWeight:.35,color:"#8c8478",haloColor:"#f5f3ee",haloWidth:1}},{id:"road-label-minor",type:"symbol","source-layer":"transportation_name",minzoom:15,filter:["!in","class","motorway","trunk","primary","secondary"],layout:{ignorePlacement:true,placementGroup:"background-labels",textField:["{name:ru}","{name}"],textPlacement:"line",symbolSpacing:900,textSize:{stops:[[15,10.5],[18,12]]},priority:15,abbreviate:true},paint:{textWeight:.35,color:{from:"road-label"},haloColor:{from:"road-label"},haloWidth:1.6}},{id:"road-label",type:"symbol","source-layer":"transportation_name",minzoom:12.5,filter:["in","class","motorway","trunk","primary","secondary"],layout:{ignorePlacement:true,placementGroup:"background-labels",textField:["{name:ru}","{name}"],textPlacement:"line",symbolSpacing:900,textSize:{stops:[[14,10],[18,13]]},priority:20,abbreviate:true},paint:{textWeight:.35,color:"#5c5646",haloColor:"#ffffff",haloWidth:1.6}},{id:"road-closed-end",type:"symbol",source:"closures","source-layer":"closure_ends",minzoom:13,layout:{iconImage:"road_closed",iconFrame:"circle",iconFrameScale:1.6,allowOverlap:true,iconSize:13,priority:6},paint:{color:"#d92b2b",frameColor:"#d92b2b",frameOpacity:1,frameHaloColor:"#ffffff",frameHaloWidth:1.4,frameGradient:.18,frameShadow:.5,frameShadowOffset:2.5,frameShadowBlur:4,iconColor:"#ffffff",iconHaloWidth:0}},{id:"crossing",type:"fill",source:"points","source-layer":"crossings",minzoom:16.5,overlay:"roads",paint:{color:"#ffffff",opacity:.9}},{id:"poi-food",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,11],[18,12]]},iconSize:{stops:[[15,14.9],[18,17.6]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{textWeight:.35,color:"#f4882c",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#f4882c",frameHaloColor:"#ffffff",frameHaloWidth:1.2,frameGradient:.18,frameShadow:.5,frameShadowOffset:2.5,frameShadowBlur:4,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:16,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,11],[18,12]]},iconSize:{stops:[[15,14.9],[18,17.6]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{textWeight:.35,color:"#a269e7",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#a269e7",frameHaloColor:"#ffffff",frameHaloWidth:1.2,frameGradient:.18,frameShadow:.5,frameShadowOffset:2.5,frameShadowBlur:4,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,11],[18,12]]},iconSize:{stops:[[15,14.9],[18,17.6]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{textWeight:.35,color:"#4677e8",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#4677e8",frameHaloColor:"#ffffff",frameHaloWidth:1.2,frameGradient:.18,frameShadow:.5,frameShadowOffset:2.5,frameShadowBlur:4,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,11],[18,12]]},iconSize:{stops:[[15,14.9],[18,17.6]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{textWeight:.35,color:"#f86776",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#f86776",frameHaloColor:"#ffffff",frameHaloWidth:1.2,frameGradient:.18,frameShadow:.5,frameShadowOffset:2.5,frameShadowBlur:4,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","pharmacy","hospital","doctors","dentist","veterinary"]},{id:"poi-education",type:"symbol","source-layer":"poi",minzoom:16,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,11],[18,12]]},iconSize:{stops:[[15,14.9],[18,17.6]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{textWeight:.35,color:"#2ac1d4",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#2ac1d4",frameHaloColor:"#ffffff",frameHaloWidth:1.2,frameGradient:.18,frameShadow:.5,frameShadowOffset:2.5,frameShadowBlur:4,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,11],[18,12]]},iconSize:{stops:[[15,14.9],[18,17.6]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{textWeight:.35,color:"#cc5e3c",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#cc5e3c",frameHaloColor:"#ffffff",frameHaloWidth:1.2,frameGradient:.18,frameShadow:.5,frameShadowOffset:2.5,frameShadowBlur:4,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,11],[18,12]]},iconSize:{stops:[[15,14.9],[18,17.6]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{textWeight:.35,color:"#2db375",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#2db375",frameHaloColor:"#ffffff",frameHaloWidth:1.2,frameGradient:.18,frameShadow:.5,frameShadowOffset:2.5,frameShadowBlur:4,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:16,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,11],[18,12]]},iconSize:{stops:[[15,14.9],[18,17.6]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{textWeight:.35,color:"#a66fe8",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#a66fe8",frameHaloColor:"#ffffff",frameHaloWidth:1.2,frameGradient:.18,frameShadow:.5,frameShadowOffset:2.5,frameShadowBlur:4,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","lodging"]},{id:"poi-service",type:"symbol","source-layer":"poi",minzoom:17,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,11],[18,12]]},iconSize:{stops:[[15,14.9],[18,17.6]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{textWeight:.35,color:"#6e87bf",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#6e87bf",frameHaloColor:"#ffffff",frameHaloWidth:1.2,frameGradient:.18,frameShadow:.5,frameShadowOffset:2.5,frameShadowBlur:4,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:17,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,11],[18,12]]},iconSize:{stops:[[15,14.9],[18,17.6]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{textWeight:.35,color:"#4caaf3",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#4caaf3",frameHaloColor:"#ffffff",frameHaloWidth:1.2,frameGradient:.18,frameShadow:.5,frameShadowOffset:2.5,frameShadowBlur:4,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:"road-shield",type:"symbol","source-layer":"transportation_name",filter:["all",["has","ref"],["in","class","motorway","trunk","primary"]],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:{textWeight:.35,color:"#3a4048",haloColor:"#f7f3e8",haloWidth:.5,iconColor:"#f7f3e8",iconHaloColor:"#8a8172",iconHaloWidth:1.4}},{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:{textWeight:.35,color:"#3d7ea6",haloColor:"#ffffff",haloWidth:1.4}},{id:"place-label",type:"symbol","source-layer":"place",minzoom:4,filter:["all",["in","class","city","country"],["!in","name","\u0414\u0443\u0448\u0430\u043D\u0431\u0435","\u0425\u0443\u04B7\u0430\u043D\u0434","\u0425\u0443\u0434\u0436\u0430\u043D\u0434","\u0411\u043E\u0445\u0442\u0430\u0440","\u0425\u043E\u0440\u0443\u0493","\u0425\u043E\u0440\u043E\u0433"]],layout:{textField:["{name:ru}","{name}"],textSize:{stops:[[4,11],[7,13],[10,14],[14,16],[17,17]]},maxLineChars:16,priority:90},paint:{textWeight:.35,color:"#57544e",haloColor:"#ffffff",haloWidth:1.8}},{id:"place-capital",type:"symbol","source-layer":"place",minzoom:4,filter:["all",["==","class","city"],["in","name","\u0414\u0443\u0448\u0430\u043D\u0431\u0435","\u0425\u0443\u04B7\u0430\u043D\u0434","\u0425\u0443\u0434\u0436\u0430\u043D\u0434","\u0411\u043E\u0445\u0442\u0430\u0440","\u0425\u043E\u0440\u0443\u0493","\u0425\u043E\u0440\u043E\u0433"]],layout:{textField:["{name:ru}","{name}"],textSize:{stops:[[4,12],[7,14],[10,15],[14,17],[17,18]]},maxLineChars:16,priority:110},paint:{textWeight:.35,color:"#57544e",haloColor:"#ffffff",haloWidth:1.8}},{id:"place-label-minor",type:"symbol","source-layer":"place",minzoom:7.5,filter:["in","class","town"],layout:{textField:["{name:ru}","{name}"],textSize:{stops:[[7.5,10.5],[12,12.5],[16,14]]},maxLineChars:16,priority:70},paint:{textWeight:.35,color:{from:"place-label"},haloColor:{from:"place-label"},haloWidth:1.6}},{id:"place-label-local",type:"symbol","source-layer":"place",minzoom:10.5,filter:["in","class","village","hamlet","suburb","quarter","neighbourhood","isolated_dwelling","island"],layout:{textField:["{name:ru}","{name}"],textSize:{stops:[[10.5,10.5],[16,12.5]]},maxLineChars:16,priority:55},paint:{textWeight:.35,color:{from:"place-label"},haloColor:{from:"place-label"},haloWidth:1.6}},{id:"place-region",type:"symbol",source:"regions","source-layer":"regions",minzoom:4.5,layout:{textField:["{name:ru}","{name}"],textSize:{stops:[[4.5,11.5],[7,14],[10,16],[14,17]]},letterSpacing:.15,maxLineChars:14,priority:100},paint:{textWeight:.35,color:{from:"place-label"},haloColor:{from:"place-label"},haloWidth:2}},{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:{textWeight:.35,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:{textWeight:.35,color:"#57544e",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:{textWeight:.35,color:"#2d6ecb",haloColor:"#ffffff",haloWidth:1.6}}],sources:{regions:{type:"geojson",sourceLayer:"regions",data:{type:"FeatureCollection",features:[{type:"Feature",geometry:{type:"Point",coordinates:[72.9987,38.3503]},properties:{class:"state",name:"\u0412\u0438\u043B\u043E\u044F\u0442\u0438 \u041C\u0443\u0445\u0442\u043E\u0440\u0438 \u041A\u04EF\u04B3\u0438\u0441\u0442\u043E\u043D\u0438 \u0411\u0430\u0434\u0430\u0445\u0448\u043E\u043D","name:ru":"\u0413\u043E\u0440\u043D\u043E-\u0411\u0430\u0434\u0430\u0445\u0448\u0430\u043D\u0441\u043A\u0430\u044F \u0430\u0432\u0442\u043E\u043D\u043E\u043C\u043D\u0430\u044F \u043E\u0431\u043B\u0430\u0441\u0442\u044C","name:en":"Gorno-Badakhshan Autonomous Province"}},{type:"Feature",geometry:{type:"Point",coordinates:[69.9582,40.5242]},properties:{class:"state",name:"\u0412\u0438\u043B\u043E\u044F\u0442\u0438 \u0421\u0443\u0493\u0434","name:ru":"\u0421\u043E\u0433\u0434\u0438\u0439\u0441\u043A\u0430\u044F \u043E\u0431\u043B\u0430\u0441\u0442\u044C","name:en":"Sughd Province"}},{type:"Feature",geometry:{type:"Point",coordinates:[69.2633,37.8814]},properties:{class:"state",name:"\u0412\u0438\u043B\u043E\u044F\u0442\u0438 \u0425\u0430\u0442\u043B\u043E\u043D","name:ru":"\u0425\u0430\u0442\u043B\u043E\u043D\u0441\u043A\u0430\u044F \u043E\u0431\u043B\u0430\u0441\u0442\u044C","name:en":"Khatlon Province"}},{type:"Feature",geometry:{type:"Point",coordinates:[70.0873,38.9722]},properties:{class:"state",name:"\u041D\u043E\u04B3\u0438\u044F\u04B3\u043E\u0438 \u0442\u043E\u0431\u0435\u0438 \u04B7\u0443\u043C\u04B3\u0443\u0440\u04E3","name:ru":"\u0420\u0430\u0439\u043E\u043D\u044B \u0440\u0435\u0441\u043F\u0443\u0431\u043B\u0438\u043A\u0430\u043D\u0441\u043A\u043E\u0433\u043E \u043F\u043E\u0434\u0447\u0438\u043D\u0435\u043D\u0438\u044F","name:en":"Districts of Republican Subordination"}}]}},world:{url:"/tileserver/data/world/{z}/{x}/{y}.pbf",minzoom:0,maxzoom:6},indoor:{url:"/tileserver/data/indoor/{z}/{x}/{y}.pbf",minzoom:15,maxzoom:18},points:{url:"/tileserver/data/points/{z}/{x}/{y}.pbf",minzoom:13,maxzoom:16},closures:{url:"/tileserver/data/closures/{z}/{x}/{y}.pbf",minzoom:10,maxzoom:16}}};var Pf={version:1,name:"\u0420\u0435\u043B\u044C\u0435\u0444",background:"#dbd8d4",levelHeight:1,light:{ambientColor:"#ffffff",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#ffffff",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#ffffff",fillIntensity:.18},layers:[{id:"world-landcover-wood",type:"fill",source:"world","source-layer":"landcover",maxzoom:7,filter:["in","class","wood","forest"],paint:{color:{from:"landcover-wood"}}},{id:"world-landcover-grass",type:"fill",source:"world","source-layer":"landcover",maxzoom:7,filter:["in","class","grass","farmland","meadow"],paint:{color:{from:"landcover-grass"}}},{id:"world-landcover-sand",type:"fill",source:"world","source-layer":"landcover",maxzoom:7,filter:["in","class","sand","beach"],paint:{color:{from:"landcover-sand"}}},{id:"world-landcover-ice",type:"fill",source:"world","source-layer":"landcover",maxzoom:7,filter:["in","class","ice","glacier"],paint:{color:{from:"landcover-ice"}}},{id:"world-water",type:"fill",source:"world","source-layer":"water",maxzoom:7,paint:{color:{from:"water"}}},{id:"world-boundary",type:"line",source:"world","source-layer":"boundary",maxzoom:7,paint:{color:{from:"boundary"},opacity:.7,width:{stops:[[0,.5],[6,1.1]]}}},{id:"landcover-wood",type:"surface",minzoom:7,"source-layer":"landcover",filter:["in","class","wood","forest"],paint:{color:"#c6dcb4",opacity:{stops:[[8,.5],[12,.85]]},material:"flat",sideShade:.16},elevation:.7,bevel:.5,bevelDrop:.15,cornerRadius:10,cornerSegments:4},{id:"landcover-grass",type:"surface",minzoom:7,"source-layer":"landcover",filter:["in","class","grass","farmland","meadow"],paint:{color:"#d9e6c6",opacity:{stops:[[8,.45],[12,.8]]},material:"flat",sideShade:.16},elevation:.5,bevel:.45,bevelDrop:.12,cornerRadius:8,cornerSegments:4},{id:"landcover-sand",type:"surface",minzoom:7,"source-layer":"landcover",filter:["in","class","sand","beach"],paint:{color:"#f2e7c8",material:"flat",sideShade:.16},elevation:.12,bevel:.6,bevelDrop:.08,cornerRadius:10,cornerSegments:4},{id:"landcover-ice",type:"fill",minzoom:7,"source-layer":"landcover",filter:["in","class","ice","glacier"],paint:{color:"#e6f2f7"}},{id:"landcover-wetland",type:"surface",minzoom:7,"source-layer":"landcover",filter:["in","class","wetland","swamp"],paint:{color:"#cfe0d4",material:"flat",sideShade:.16},elevation:.15,bevel:.5,bevelDrop:.08,cornerRadius:8,cornerSegments:4},{id:"landuse-residential",type:"fill","source-layer":"landuse",filter:["in","class","residential","suburb","neighbourhood","quarter"],paint:{color:"#d3d0cb",opacity:{stops:[[10,.4],[14,.7]]}}},{id:"landuse-industrial",type:"fill","source-layer":"landuse",filter:["in","class","industrial","quarry","railway","substation"],paint:{color:"#e7e0dd"}},{id:"landuse-civic",type:"fill","source-layer":"landuse",filter:["in","class","school","university","college","hospital","clinic","police","kindergarten","bus_station"],paint:{color:"#ece3d8"}},{id:"landuse-sport",type:"surface","source-layer":"landuse",filter:["in","class","pitch","stadium","playground","track","swimming_pool"],paint:{color:"#cfe3c4",material:"flat",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:"flat",sideShade:.16},elevation:.3,bevel:.4,bevelDrop:.1,cornerRadius:5,cornerSegments:4},{id:"landuse-parking",type:"fill","source-layer":"landuse",filter:["in","class","parking","fuel"],paint:{color:"#dddad5"}},{id:"park",type:"surface","source-layer":"park",paint:{color:"#cfe5bd",opacity:.75,material:"flat",sideShade:.16},elevation:.6,bevel:.5,bevelDrop:.15,cornerRadius:9,cornerSegments:4},{id:"aeroway-area",type:"fill","source-layer":"aeroway",filter:["in","class","aerodrome","apron","helipad"],paint:{color:"#e4e2e6"}},{id:"water",type:"surface",minzoom:7,"source-layer":"water",filter:["!in","class","swimming_pool"],paint:{color:"#a5cbe3",material:"water",materialScale:14,materialSpeed:1,sideShade:0},elevation:-0.35,bevel:.8,bevelDrop:.12,weld:0,cornerRadius:7,cornerSegments:4},{id:"water-pool",type:"surface","source-layer":"water",filter:["==","class","swimming_pool"],paint:{color:"#9fd3e8",material:"water",materialScale:8,materialSpeed:1,sideShade:0},elevation:-0.2,bevel:.4,bevelDrop:.08,cornerRadius:4,cornerSegments:4},{id:"waterway",type:"line","source-layer":"waterway",paint:{color:"#a5cbe3",width:{stops:[[8,.6],[12,1.4],[16,4],[19,11.5],[20,23],[21,46],[22,92]]},material:"water",materialScale:10,materialSpeed:1,elevation:-0.3}},{id:"aeroway-line",type:"line","source-layer":"aeroway",filter:["in","class","runway","taxiway"],paint:{color:"#d8d5da",width:{stops:[[10,1],[14,5],[18,24],[19,24],[20,48],[21,96],[22,192]]},material:"flat",elevation:.08}},{id:"road-bed",type:"surface","source-layer":"transportation",minzoom:15,filter:["in","class","motorway","trunk","primary","secondary","tertiary","minor","service","track"],fromLines:true,width:6,widthExtra:.8,deck:.5,elevation:.12,bevel:.14,bevelDrop:.12,weld:.6,paint:{color:"#c9c3b7",material:"flat",sideShade:.18}},{id:"path-bed",type:"surface","source-layer":"transportation",minzoom:15.5,filter:["in","class","path","pedestrian","footway","steps"],fromLines:true,width:2.2,widthExtra:.3,deck:.25,elevation:.2,bevel:.09,bevelDrop:.2,weld:.4,paint:{color:"#ddd6c7",material:"flat",sideShade:.2}},{id:"road-bridge-outline-thin",type:"line",network:"roads","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","path","pedestrian","footway","steps","rail","transit"]],minzoom:14,paint:{elevation:.1,color:{from:"road-casing-major",darken:.2},width:{stops:[[14,2.5],[17,5],[19,9],[20,15],[21,28]]}}},{id:"road-casing-major",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","motorway","trunk","primary"],minzoom:5,paint:{color:"#d4ab68",width:{stops:[[6,1.6],[10,3.4],[14,8],[16,14],[18,30],[19,45],[20,90],[21,180],[22,360]]},elevation:.15,widthFromData:true,widthExtra:2.5}},{id:"road-casing-secondary",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","secondary","tertiary"],minzoom:9,paint:{color:{stops:[[16,"#c6bca6"],[18.5,"#d4ab68"]]},width:{stops:[[10,1.6],[14,5.5],[16,10],[18,22],[19,33],[20,66],[21,132],[22,264]]},elevation:.13,widthFromData:true,widthExtra:2}},{id:"road-casing-minor",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","minor","service","track"],minzoom:12,paint:{color:{stops:[[16,"#cdc4b2"],[18.5,"#d4ab68"]]},width:{stops:[[13,1.4],[16,6],[18,14],[19,22],[20,44],[21,88],[22,176]]},elevation:.11,widthFromData:true,widthExtra:1.5}},{id:"road-rail",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","rail","transit"],minzoom:10,paint:{color:"#b2a99e",width:{stops:[[10,.8],[14,1.8],[18,4],[19,5.5],[20,11],[21,22],[22,44]]},elevation:.12}},{id:"road-path",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","path","pedestrian","footway","steps"],minzoom:14,paint:{color:"#bdb2a0",width:{stops:[[14,.8],[17,2],[19,4],[20,8],[21,16],[22,32]]},dashArray:[4,3],material:"flat",elevation:.22}},{id:"road-minor",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","minor","service","track"],minzoom:12,paint:{color:{stops:[[16,"#ffffff"],[18.5,"#ffdfa3"]]},width:{stops:[[13,.6],[16,4],[18,11],[19,18],[20,36],[21,72],[22,144]]},material:"flat",elevation:.14,widthFromData:true}},{id:"road-ramp",network:"roads",type:"line","source-layer":"transportation",filter:["all",["in","class","motorway","trunk","primary"],["has","ramp"]],minzoom:5,paint:{color:"#ffdfa3",width:{stops:[[6,.8],[10,2.2],[14,6],[16,11],[18,25],[19,38.5],[20,77],[21,154],[22,308]]},material:"flat",elevation:.18,widthFromData:true}},{id:"road-secondary",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","secondary","tertiary"],minzoom:9,paint:{color:{stops:[[16,"#ffffff"],[18.5,"#ffdfa3"]]},width:{stops:[[10,.8],[14,3.6],[16,7.5],[18,18],[19,28],[20,56],[21,112],[22,224]]},material:"flat",elevation:.16,widthFromData:true}},{id:"road-major",network:"roads",type:"line","source-layer":"transportation",filter:["all",["in","class","motorway","trunk","primary"],["!has","ramp"]],minzoom:5,paint:{color:"#ffdfa3",width:{stops:[[6,.8],[10,2.2],[14,6],[16,11],[18,25],[19,38.5],[20,77],[21,154],[22,308]]},material:"flat",elevation:.18,widthFromData:true}},{id:"road-lane-divider-major",network:"roads",type:"line","source-layer":"transportation",filter:["all",["!has","oneway"],["in","class","motorway","trunk","primary"]],minzoom:16.5,paint:{color:"#e3bd7f",width:{stops:[[16.5,.54],[17,.78],[18,1.4],[19,2.17],[20,4.34],[21,8.68],[22,17.36]]},dashArray:[7,18],material:"flat",elevation:.182}},{id:"road-lane-divider-secondary",network:"roads",type:"line","source-layer":"transportation",filter:["all",["!has","oneway"],["in","class","secondary","tertiary"]],minzoom:16.5,paint:{color:"#d8cfbc",width:{stops:[[16.5,.46],[17,.67],[18,1.2],[19,1.86],[20,3.72],[21,7.44],[22,14.88]]},dashArray:[7,18],material:"flat",elevation:.162}},{id:"boundary",type:"line",minzoom:7,"source-layer":"boundary",filter:["<=","admin_level",4],paint:{color:"#b3a6b8",opacity:.7,width:{stops:[[4,.7],[10,1.4],[16,2.4]]},dashArray:[6,4]}},{id:"building",type:"fill-extrusion","source-layer":"building",minzoom:15,paint:{color:"#ffffff",roofColor:"#f2f1f0",opacity:1,heightScale:{stops:[[15,0],[15.8,1]]},aoStrength:.18,tintVariation:0,windowColor:"#7f9ab5",windowFrameColor:"#e9e5dc",windowGlow:0,facadeDetail:1,floorHeight:3.2,roofVariation:.35}},{id:"indoor-venue",type:"fill-extrusion",source:"indoor","source-layer":"area",filter:["all",["==","class","level"],["==","base",1]],minzoom:15,maxzoom:16,paint:{color:"#d8d3c8",roofColor:"#d9d3c7",opacity:1,aoStrength:.18,tintVariation:.06,windowColor:"#7f9ab5",windowFrameColor:"#e9e5dc",windowGlow:0,facadeDetail:1,floorHeight:3.2,roofVariation:.35}},{id:"road-closed-casing",type:"line",source:"closures","source-layer":"closures",minzoom:11,paint:{color:"#ffffff",width:{stops:[[11,4],[14,6],[17,10],[19,16],[20,32],[21,64],[22,128]]},opacity:.9},overlay:"roads"},{id:"road-closed",type:"line",source:"closures","source-layer":"closures",minzoom:11,paint:{color:"#d92b2b",width:{stops:[[11,2.5],[14,4],[17,7],[19,11],[20,22],[21,44],[22,88]]},dashArray:[5,4]},overlay:"roads"},{id:"traffic-signal",type:"symbol",source:"points","source-layer":"roadpoints",minzoom:17,filter:["==","kind","traffic_signals"],layout:{iconImage:"traffic_signals",allowOverlap:true,iconParts:["traffic_light_pole","traffic_light_body","traffic_light_red","traffic_light_amber","traffic_light_green"],offset:[0,-12],iconSize:{stops:[[17,17],[19,26]]},priority:3},paint:{color:"#5c6470",haloColor:"#ffffff",haloWidth:1.4,partColors:["#6a717c","#1c2026","#ff4d57","#f8cf2c","#12d370"],partHaloWidths:[1,1.3,0,0,0]}},{id:"housenumber",type:"symbol","source-layer":"housenumber",minzoom:17,layout:{ignorePlacement:true,placementGroup:"background-labels",textField:"{housenumber}",textSize:{stops:[[17,9],[19,11]]},maxLineChars:6,priority:-60},paint:{textWeight:.35,color:"#8c8478",haloColor:"#f5f3ee",haloWidth:1}},{id:"road-label-minor",type:"symbol","source-layer":"transportation_name",minzoom:15,filter:["!in","class","motorway","trunk","primary","secondary"],layout:{ignorePlacement:true,placementGroup:"background-labels",textField:["{name:ru}","{name}"],textPlacement:"line",symbolSpacing:900,textSize:{stops:[[15,10.5],[18,12]]},priority:15,abbreviate:true},paint:{textWeight:.35,color:{from:"road-label"},haloColor:{from:"road-label"},haloWidth:1.6}},{id:"road-label",type:"symbol","source-layer":"transportation_name",minzoom:12.5,filter:["in","class","motorway","trunk","primary","secondary"],layout:{ignorePlacement:true,placementGroup:"background-labels",textField:["{name:ru}","{name}"],textPlacement:"line",symbolSpacing:900,textSize:{stops:[[14,10],[18,13]]},priority:20,abbreviate:true},paint:{textWeight:.35,color:"#5c5646",haloColor:"#ffffff",haloWidth:1.6}},{id:"road-closed-end",type:"symbol",source:"closures","source-layer":"closure_ends",minzoom:13,layout:{iconImage:"road_closed",iconFrame:"circle",iconFrameScale:1.6,allowOverlap:true,iconSize:13,priority:6},paint:{color:"#d92b2b",frameColor:"#d92b2b",frameOpacity:1,frameHaloColor:"#ffffff",frameHaloWidth:1.4,frameGradient:.18,frameShadow:.5,frameShadowOffset:2.5,frameShadowBlur:4,iconColor:"#ffffff",iconHaloWidth:0}},{id:"crossing",type:"surface",weld:0,source:"points","source-layer":"crossings",minzoom:16.5,overlay:"roads",paint:{color:"#ffffff",opacity:.9,sideShade:.16},elevation:.09,bevel:.05,bevelDrop:.02,groundBy:{"landcover:wood":.7,"landcover:forest":.7,"landcover:grass":.5,"landcover:farmland":.5,"landcover:meadow":.5,"landcover:sand":.12,"landcover:beach":.12,"landcover:wetland":.15,"landcover:swamp":.15,"landuse:pitch":.35,"landuse:stadium":.35,"landuse:playground":.35,"landuse:track":.35,"landuse:swimming_pool":.35,"landuse:cemetery":.3,"landuse:grave_yard":.3,"park:park":.6}},{id:"poi-food",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,11],[18,12]]},iconSize:{stops:[[15,14.9],[18,17.6]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{textWeight:.35,color:"#f4882c",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#f4882c",frameHaloColor:"#ffffff",frameHaloWidth:1.2,frameGradient:.18,frameShadow:.5,frameShadowOffset:2.5,frameShadowBlur:4,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:16,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,11],[18,12]]},iconSize:{stops:[[15,14.9],[18,17.6]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{textWeight:.35,color:"#a269e7",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#a269e7",frameHaloColor:"#ffffff",frameHaloWidth:1.2,frameGradient:.18,frameShadow:.5,frameShadowOffset:2.5,frameShadowBlur:4,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,11],[18,12]]},iconSize:{stops:[[15,14.9],[18,17.6]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{textWeight:.35,color:"#4677e8",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#4677e8",frameHaloColor:"#ffffff",frameHaloWidth:1.2,frameGradient:.18,frameShadow:.5,frameShadowOffset:2.5,frameShadowBlur:4,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,11],[18,12]]},iconSize:{stops:[[15,14.9],[18,17.6]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{textWeight:.35,color:"#f86776",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#f86776",frameHaloColor:"#ffffff",frameHaloWidth:1.2,frameGradient:.18,frameShadow:.5,frameShadowOffset:2.5,frameShadowBlur:4,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","pharmacy","hospital","doctors","dentist","veterinary"]},{id:"poi-education",type:"symbol","source-layer":"poi",minzoom:16,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,11],[18,12]]},iconSize:{stops:[[15,14.9],[18,17.6]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{textWeight:.35,color:"#2ac1d4",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#2ac1d4",frameHaloColor:"#ffffff",frameHaloWidth:1.2,frameGradient:.18,frameShadow:.5,frameShadowOffset:2.5,frameShadowBlur:4,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,11],[18,12]]},iconSize:{stops:[[15,14.9],[18,17.6]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{textWeight:.35,color:"#cc5e3c",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#cc5e3c",frameHaloColor:"#ffffff",frameHaloWidth:1.2,frameGradient:.18,frameShadow:.5,frameShadowOffset:2.5,frameShadowBlur:4,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,11],[18,12]]},iconSize:{stops:[[15,14.9],[18,17.6]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{textWeight:.35,color:"#2db375",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#2db375",frameHaloColor:"#ffffff",frameHaloWidth:1.2,frameGradient:.18,frameShadow:.5,frameShadowOffset:2.5,frameShadowBlur:4,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:16,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,11],[18,12]]},iconSize:{stops:[[15,14.9],[18,17.6]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{textWeight:.35,color:"#a66fe8",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#a66fe8",frameHaloColor:"#ffffff",frameHaloWidth:1.2,frameGradient:.18,frameShadow:.5,frameShadowOffset:2.5,frameShadowBlur:4,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","lodging"]},{id:"poi-service",type:"symbol","source-layer":"poi",minzoom:17,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,11],[18,12]]},iconSize:{stops:[[15,14.9],[18,17.6]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{textWeight:.35,color:"#6e87bf",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#6e87bf",frameHaloColor:"#ffffff",frameHaloWidth:1.2,frameGradient:.18,frameShadow:.5,frameShadowOffset:2.5,frameShadowBlur:4,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:17,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,11],[18,12]]},iconSize:{stops:[[15,14.9],[18,17.6]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{textWeight:.35,color:"#4caaf3",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#4caaf3",frameHaloColor:"#ffffff",frameHaloWidth:1.2,frameGradient:.18,frameShadow:.5,frameShadowOffset:2.5,frameShadowBlur:4,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:"road-shield",type:"symbol","source-layer":"transportation_name",filter:["all",["has","ref"],["in","class","motorway","trunk","primary"]],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:{textWeight:.35,color:"#3a4048",haloColor:"#f7f3e8",haloWidth:.5,iconColor:"#f7f3e8",iconHaloColor:"#8a8172",iconHaloWidth:1.4}},{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:{textWeight:.35,color:"#3d7ea6",haloColor:"#ffffff",haloWidth:1.4}},{id:"place-label",type:"symbol","source-layer":"place",minzoom:4,filter:["all",["in","class","city","country"],["!in","name","\u0414\u0443\u0448\u0430\u043D\u0431\u0435","\u0425\u0443\u04B7\u0430\u043D\u0434","\u0425\u0443\u0434\u0436\u0430\u043D\u0434","\u0411\u043E\u0445\u0442\u0430\u0440","\u0425\u043E\u0440\u0443\u0493","\u0425\u043E\u0440\u043E\u0433"]],layout:{textField:["{name:ru}","{name}"],textSize:{stops:[[4,11],[7,13],[10,14],[14,16],[17,17]]},maxLineChars:16,priority:90},paint:{textWeight:.35,color:"#57544e",haloColor:"#ffffff",haloWidth:1.8}},{id:"place-capital",type:"symbol","source-layer":"place",minzoom:4,filter:["all",["==","class","city"],["in","name","\u0414\u0443\u0448\u0430\u043D\u0431\u0435","\u0425\u0443\u04B7\u0430\u043D\u0434","\u0425\u0443\u0434\u0436\u0430\u043D\u0434","\u0411\u043E\u0445\u0442\u0430\u0440","\u0425\u043E\u0440\u0443\u0493","\u0425\u043E\u0440\u043E\u0433"]],layout:{textField:["{name:ru}","{name}"],textSize:{stops:[[4,12],[7,14],[10,15],[14,17],[17,18]]},maxLineChars:16,priority:110},paint:{textWeight:.35,color:"#57544e",haloColor:"#ffffff",haloWidth:1.8}},{id:"place-label-minor",type:"symbol","source-layer":"place",minzoom:7.5,filter:["in","class","town"],layout:{textField:["{name:ru}","{name}"],textSize:{stops:[[7.5,10.5],[12,12.5],[16,14]]},maxLineChars:16,priority:70},paint:{textWeight:.35,color:{from:"place-label"},haloColor:{from:"place-label"},haloWidth:1.6}},{id:"place-label-local",type:"symbol","source-layer":"place",minzoom:10.5,filter:["in","class","village","hamlet","suburb","quarter","neighbourhood","isolated_dwelling","island"],layout:{textField:["{name:ru}","{name}"],textSize:{stops:[[10.5,10.5],[16,12.5]]},maxLineChars:16,priority:55},paint:{textWeight:.35,color:{from:"place-label"},haloColor:{from:"place-label"},haloWidth:1.6}},{id:"place-region",type:"symbol",source:"regions","source-layer":"regions",minzoom:4.5,layout:{textField:["{name:ru}","{name}"],textSize:{stops:[[4.5,11.5],[7,14],[10,16],[14,17]]},letterSpacing:.15,maxLineChars:14,priority:100},paint:{textWeight:.35,color:{from:"place-label"},haloColor:{from:"place-label"},haloWidth:2}},{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:{textWeight:.35,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:{textWeight:.35,color:"#57544e",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:{textWeight:.35,color:"#2d6ecb",haloColor:"#ffffff",haloWidth:1.6}}],sources:{regions:{type:"geojson",sourceLayer:"regions",data:{type:"FeatureCollection",features:[{type:"Feature",geometry:{type:"Point",coordinates:[72.9987,38.3503]},properties:{class:"state",name:"\u0412\u0438\u043B\u043E\u044F\u0442\u0438 \u041C\u0443\u0445\u0442\u043E\u0440\u0438 \u041A\u04EF\u04B3\u0438\u0441\u0442\u043E\u043D\u0438 \u0411\u0430\u0434\u0430\u0445\u0448\u043E\u043D","name:ru":"\u0413\u043E\u0440\u043D\u043E-\u0411\u0430\u0434\u0430\u0445\u0448\u0430\u043D\u0441\u043A\u0430\u044F \u0430\u0432\u0442\u043E\u043D\u043E\u043C\u043D\u0430\u044F \u043E\u0431\u043B\u0430\u0441\u0442\u044C","name:en":"Gorno-Badakhshan Autonomous Province"}},{type:"Feature",geometry:{type:"Point",coordinates:[69.9582,40.5242]},properties:{class:"state",name:"\u0412\u0438\u043B\u043E\u044F\u0442\u0438 \u0421\u0443\u0493\u0434","name:ru":"\u0421\u043E\u0433\u0434\u0438\u0439\u0441\u043A\u0430\u044F \u043E\u0431\u043B\u0430\u0441\u0442\u044C","name:en":"Sughd Province"}},{type:"Feature",geometry:{type:"Point",coordinates:[69.2633,37.8814]},properties:{class:"state",name:"\u0412\u0438\u043B\u043E\u044F\u0442\u0438 \u0425\u0430\u0442\u043B\u043E\u043D","name:ru":"\u0425\u0430\u0442\u043B\u043E\u043D\u0441\u043A\u0430\u044F \u043E\u0431\u043B\u0430\u0441\u0442\u044C","name:en":"Khatlon Province"}},{type:"Feature",geometry:{type:"Point",coordinates:[70.0873,38.9722]},properties:{class:"state",name:"\u041D\u043E\u04B3\u0438\u044F\u04B3\u043E\u0438 \u0442\u043E\u0431\u0435\u0438 \u04B7\u0443\u043C\u04B3\u0443\u0440\u04E3","name:ru":"\u0420\u0430\u0439\u043E\u043D\u044B \u0440\u0435\u0441\u043F\u0443\u0431\u043B\u0438\u043A\u0430\u043D\u0441\u043A\u043E\u0433\u043E \u043F\u043E\u0434\u0447\u0438\u043D\u0435\u043D\u0438\u044F","name:en":"Districts of Republican Subordination"}}]}},world:{url:"/tileserver/data/world/{z}/{x}/{y}.pbf",minzoom:0,maxzoom:6},indoor:{url:"/tileserver/data/indoor/{z}/{x}/{y}.pbf",minzoom:15,maxzoom:18},points:{url:"/tileserver/data/points/{z}/{x}/{y}.pbf",minzoom:13,maxzoom:16},closures:{url:"/tileserver/data/closures/{z}/{x}/{y}.pbf",minzoom:10,maxzoom:16}}};var Hf={version:1,name:"\u041E\u0431\u044A\u0451\u043C\u043D\u044B\u0439 \u0433\u043E\u0440\u043E\u0434",background:"#dbd8d4",light:{ambientColor:"#ffffff",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#ffffff",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#ffffff",fillIntensity:.18},layers:[{id:"world-landcover-wood",type:"fill",source:"world","source-layer":"landcover",maxzoom:7,filter:["in","class","wood","forest"],paint:{color:{from:"landcover-wood"}}},{id:"world-landcover-grass",type:"fill",source:"world","source-layer":"landcover",maxzoom:7,filter:["in","class","grass","farmland","meadow"],paint:{color:{from:"landcover-grass"}}},{id:"world-landcover-sand",type:"fill",source:"world","source-layer":"landcover",maxzoom:7,filter:["in","class","sand","beach"],paint:{color:{from:"landcover-sand"}}},{id:"world-landcover-ice",type:"fill",source:"world","source-layer":"landcover",maxzoom:7,filter:["in","class","ice","glacier"],paint:{color:{from:"landcover-ice"}}},{id:"world-water",type:"fill",source:"world","source-layer":"water",maxzoom:7,paint:{color:{from:"water"}}},{id:"world-boundary",type:"line",source:"world","source-layer":"boundary",maxzoom:7,paint:{color:{from:"boundary"},opacity:.7,width:{stops:[[0,.5],[6,1.1]]}}},{id:"landcover-wood",type:"surface",minzoom:7,"source-layer":"landcover",filter:["in","class","wood","forest"],paint:{color:"#c6dcb4",opacity:{stops:[[8,.5],[12,.85]]},material:"flat",sideShade:.16},elevation:.175,bevel:.125,bevelDrop:.038,cornerRadius:10,cornerSegments:4},{id:"landcover-grass",type:"surface",minzoom:7,"source-layer":"landcover",filter:["in","class","grass","farmland","meadow"],paint:{color:"#d9e6c6",opacity:{stops:[[8,.45],[12,.8]]},material:"flat",sideShade:.16},elevation:.125,bevel:.113,bevelDrop:.03,cornerRadius:8,cornerSegments:4},{id:"landcover-sand",type:"surface",minzoom:7,"source-layer":"landcover",filter:["in","class","sand","beach"],paint:{color:"#f2e7c8",material:"flat",sideShade:.16},elevation:.035,bevel:.15,bevelDrop:.02,cornerRadius:10,cornerSegments:4},{id:"landcover-ice",type:"fill",minzoom:7,"source-layer":"landcover",filter:["in","class","ice","glacier"],paint:{color:"#e6f2f7"}},{id:"landcover-wetland",type:"surface",minzoom:7,"source-layer":"landcover",filter:["in","class","wetland","swamp"],paint:{color:"#cfe0d4",material:"flat",sideShade:.16},elevation:.045,bevel:.125,bevelDrop:.02,cornerRadius:8,cornerSegments:4},{id:"landuse-residential",type:"surface","source-layer":"landuse",filter:["in","class","residential","suburb","neighbourhood","quarter"],paint:{color:"#d3d0cb",opacity:{stops:[[10,.4],[14,.7]]},material:"flat",sideShade:.16},cornerRadius:4,cornerSegments:3,elevation:.02,bevel:.1,bevelDrop:.02},{id:"landuse-industrial",type:"surface","source-layer":"landuse",filter:["in","class","industrial","quarry","railway","substation"],paint:{color:"#e7e0dd",material:"flat",sideShade:.16},cornerRadius:4,cornerSegments:3,elevation:.03,bevel:.1,bevelDrop:.02},{id:"landuse-civic",type:"surface","source-layer":"landuse",filter:["in","class","school","university","college","hospital","clinic","police","kindergarten","bus_station"],paint:{color:"#ece3d8",material:"flat",sideShade:.16},cornerRadius:4,cornerSegments:3,elevation:.055,bevel:.1,bevelDrop:.02},{id:"landuse-sport",type:"surface","source-layer":"landuse",filter:["in","class","pitch","stadium","playground","track","swimming_pool"],paint:{color:"#cfe3c4",material:"flat",sideShade:.16},elevation:.088,bevel:.1,bevelDrop:.025,cornerRadius:5,cornerSegments:3},{id:"landuse-cemetery",type:"surface","source-layer":"landuse",filter:["in","class","cemetery","grave_yard"],paint:{color:"#d6dfc8",material:"flat",sideShade:.16},elevation:.075,bevel:.1,bevelDrop:.025,cornerRadius:5,cornerSegments:3},{id:"landuse-parking",type:"surface","source-layer":"landuse",filter:["in","class","parking","fuel"],paint:{color:"#dddad5",material:"flat",sideShade:.16},cornerRadius:3,cornerSegments:3,elevation:.19,bevel:.1,bevelDrop:.02},{id:"park",type:"surface","source-layer":"park",paint:{color:"#cfe5bd",opacity:.75,material:"flat",sideShade:.16},elevation:.15,bevel:.125,bevelDrop:.038,cornerRadius:9,cornerSegments:4},{id:"aeroway-area",type:"surface","source-layer":"aeroway",filter:["in","class","aerodrome","apron","helipad"],paint:{color:"#e4e2e6",material:"flat",sideShade:.16},cornerRadius:5,cornerSegments:3,elevation:.065,bevel:.1,bevelDrop:.02},{id:"water",type:"surface",minzoom:7,"source-layer":"water",filter:["!in","class","swimming_pool"],paint:{color:"#a5cbe3",material:"water",materialScale:14,materialSpeed:1,sideShade:0},elevation:-0.087,bevel:.2,bevelDrop:.03,weld:0,cornerRadius:7,cornerSegments:4},{id:"water-pool",type:"surface","source-layer":"water",filter:["==","class","swimming_pool"],paint:{color:"#9fd3e8",material:"water",materialScale:8,materialSpeed:1,sideShade:0},elevation:-0.05,bevel:.1,bevelDrop:.02,cornerRadius:4,cornerSegments:3},{id:"waterway",type:"line","source-layer":"waterway",paint:{color:"#a5cbe3",width:{stops:[[8,.6],[12,1.4],[16,4],[19,11.5],[20,23],[21,46],[22,92]]},material:"water",materialScale:10,materialSpeed:1,elevation:-0.075}},{id:"aeroway-line",type:"line","source-layer":"aeroway",filter:["in","class","runway","taxiway"],paint:{color:"#d8d5da",width:{stops:[[10,1],[14,5],[18,24],[19,24],[20,48],[21,96],[22,192]]},material:"flat",elevation:.02}},{id:"road-bridge-outline-thin",type:"line",network:"roads","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","path","pedestrian","footway","steps","rail","transit"]],minzoom:14,paint:{elevation:.025,color:{from:"road-casing-major",darken:.2},width:{stops:[[14,2.5],[17,5],[19,9],[20,15],[21,28]]}}},{id:"road-casing-major",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","motorway","trunk","primary"],minzoom:5,paint:{color:"#d4ab68",width:{stops:[[6,1.6],[10,3.4],[14,8],[16,14],[18,30],[19,45],[20,90],[21,180],[22,360]]},elevation:.037,widthFromData:true,widthExtra:2.5}},{id:"road-casing-secondary",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","secondary","tertiary"],minzoom:9,paint:{color:{stops:[[16,"#c6bca6"],[18.5,"#d4ab68"]]},width:{stops:[[10,1.6],[14,5.5],[16,10],[18,22],[19,33],[20,66],[21,132],[22,264]]},elevation:.033,widthFromData:true,widthExtra:2}},{id:"road-casing-minor",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","minor","service","track"],minzoom:12,paint:{color:{stops:[[16,"#cdc4b2"],[18.5,"#d4ab68"]]},width:{stops:[[13,1.4],[16,6],[18,14],[19,22],[20,44],[21,88],[22,176]]},elevation:.028,widthFromData:true,widthExtra:1.5}},{id:"road-rail",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","rail","transit"],minzoom:10,paint:{color:"#b2a99e",width:{stops:[[10,.8],[14,1.8],[18,4],[19,5.5],[20,11],[21,22],[22,44]]},elevation:.03}},{id:"road-path-casing",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","path","pedestrian","footway","steps"],minzoom:14,paint:{color:{from:"road-casing-minor"},width:{stops:[[14,2.8],[17,4],[19,6],[20,10],[21,18],[22,34]]},material:"flat",elevation:.011}},{id:"road-path",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","path","pedestrian","footway","steps"],minzoom:14,paint:{color:"#bdb2a0",width:{stops:[[14,.8],[17,2],[19,4],[20,8],[21,16],[22,32]]},dashArray:[4,3],material:"flat",elevation:.013}},{id:"road-minor",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","minor","service","track"],minzoom:12,paint:{color:{stops:[[16,"#ffffff"],[18.5,"#ffdfa3"]]},width:{stops:[[13,.6],[16,4],[18,11],[19,18],[20,36],[21,72],[22,144]]},material:"flat",elevation:.035,widthFromData:true}},{id:"road-ramp",network:"roads",type:"line","source-layer":"transportation",filter:["all",["in","class","motorway","trunk","primary"],["has","ramp"]],minzoom:5,paint:{color:"#ffdfa3",width:{stops:[[6,.8],[10,2.2],[14,6],[16,11],[18,25],[19,38.5],[20,77],[21,154],[22,308]]},material:"flat",elevation:.045,widthFromData:true}},{id:"road-secondary",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","secondary","tertiary"],minzoom:9,paint:{color:{stops:[[16,"#ffffff"],[18.5,"#ffdfa3"]]},width:{stops:[[10,.8],[14,3.6],[16,7.5],[18,18],[19,28],[20,56],[21,112],[22,224]]},material:"flat",elevation:.04,widthFromData:true}},{id:"road-major",network:"roads",type:"line","source-layer":"transportation",filter:["all",["in","class","motorway","trunk","primary"],["!has","ramp"]],minzoom:5,paint:{color:"#ffdfa3",width:{stops:[[6,.8],[10,2.2],[14,6],[16,11],[18,25],[19,38.5],[20,77],[21,154],[22,308]]},material:"flat",elevation:.045,widthFromData:true}},{id:"road-lane-divider-major",network:"roads",type:"line","source-layer":"transportation",filter:["all",["!has","oneway"],["in","class","motorway","trunk","primary"]],minzoom:16.5,paint:{color:"#e3bd7f",width:{stops:[[16.5,.54],[17,.78],[18,1.4],[19,2.17],[20,4.34],[21,8.68],[22,17.36]]},dashArray:[7,18],material:"flat",elevation:.047}},{id:"road-lane-divider-secondary",network:"roads",type:"line","source-layer":"transportation",filter:["all",["!has","oneway"],["in","class","secondary","tertiary"]],minzoom:16.5,paint:{color:"#d8cfbc",width:{stops:[[16.5,.46],[17,.67],[18,1.2],[19,1.86],[20,3.72],[21,7.44],[22,14.88]]},dashArray:[7,18],material:"flat",elevation:.042}},{id:"boundary",type:"line",minzoom:7,"source-layer":"boundary",filter:["<=","admin_level",4],paint:{color:"#b3a6b8",opacity:.7,width:{stops:[[4,.7],[10,1.4],[16,2.4]]},dashArray:[6,4]}},{id:"building",type:"fill-extrusion","source-layer":"building",minzoom:15,paint:{color:"#ffffff",roofColor:"#f2f1f0",opacity:1,heightScale:{stops:[[15,0],[15.8,1]]},aoStrength:.18,tintVariation:0,windowColor:"#7f9ab5",windowFrameColor:"#e9e5dc",windowGlow:0,facadeDetail:1,floorHeight:3.2,roofVariation:.35},cornerRadius:1.6,cornerSegments:2},{id:"indoor-venue",type:"fill-extrusion",source:"indoor","source-layer":"area",filter:["all",["==","class","level"],["==","base",1]],minzoom:15,maxzoom:16,paint:{color:"#d8d3c8",roofColor:"#d9d3c7",opacity:1,aoStrength:.18,tintVariation:.06,windowColor:"#7f9ab5",windowFrameColor:"#e9e5dc",windowGlow:0,facadeDetail:1,floorHeight:3.2,roofVariation:.35}},{id:"road-closed-casing",type:"line",source:"closures","source-layer":"closures",minzoom:11,paint:{color:"#ffffff",width:{stops:[[11,4],[14,6],[17,10],[19,16],[20,32],[21,64],[22,128]]},opacity:.9},overlay:"roads"},{id:"road-closed",type:"line",source:"closures","source-layer":"closures",minzoom:11,paint:{color:"#d92b2b",width:{stops:[[11,2.5],[14,4],[17,7],[19,11],[20,22],[21,44],[22,88]]},dashArray:[5,4]},overlay:"roads"},{id:"traffic-signal",type:"symbol",source:"points","source-layer":"roadpoints",minzoom:17,filter:["==","kind","traffic_signals"],layout:{iconImage:"traffic_signals",allowOverlap:true,iconParts:["traffic_light_pole","traffic_light_body","traffic_light_red","traffic_light_amber","traffic_light_green"],offset:[0,-12],iconSize:{stops:[[17,17],[19,26]]},priority:3},paint:{color:"#5c6470",haloColor:"#ffffff",haloWidth:1.4,partColors:["#6a717c","#1c2026","#ff4d57","#f8cf2c","#12d370"],partHaloWidths:[1,1.3,0,0,0]}},{id:"housenumber",type:"symbol","source-layer":"housenumber",minzoom:17,layout:{ignorePlacement:true,placementGroup:"background-labels",textField:"{housenumber}",textSize:{stops:[[17,9],[19,11]]},maxLineChars:6,priority:-60},paint:{textWeight:.35,color:"#8c8478",haloColor:"#f5f3ee",haloWidth:1}},{id:"road-label-minor",type:"symbol","source-layer":"transportation_name",minzoom:15,filter:["!in","class","motorway","trunk","primary","secondary"],layout:{ignorePlacement:true,placementGroup:"background-labels",textField:["{name:ru}","{name}"],textPlacement:"line",symbolSpacing:900,textSize:{stops:[[15,10.5],[18,12]]},priority:15,abbreviate:true},paint:{textWeight:.35,color:{from:"road-label"},haloColor:{from:"road-label"},haloWidth:1.6}},{id:"road-label",type:"symbol","source-layer":"transportation_name",minzoom:12.5,filter:["in","class","motorway","trunk","primary","secondary"],layout:{ignorePlacement:true,placementGroup:"background-labels",textField:["{name:ru}","{name}"],textPlacement:"line",symbolSpacing:900,textSize:{stops:[[14,10],[18,13]]},priority:20,abbreviate:true},paint:{textWeight:.35,color:"#5c5646",haloColor:"#ffffff",haloWidth:1.6}},{id:"road-closed-end",type:"symbol",source:"closures","source-layer":"closure_ends",minzoom:13,layout:{iconImage:"road_closed",iconFrame:"circle",iconFrameScale:1.6,allowOverlap:true,iconSize:13,priority:6},paint:{color:"#d92b2b",frameColor:"#d92b2b",frameOpacity:1,frameHaloColor:"#ffffff",frameHaloWidth:1.4,frameGradient:.18,frameShadow:.5,frameShadowOffset:2.5,frameShadowBlur:4,iconColor:"#ffffff",iconHaloWidth:0}},{id:"crossing",type:"surface",weld:0,source:"points","source-layer":"crossings",minzoom:16.5,overlay:"roads",paint:{color:"#ffffff",opacity:.9,sideShade:.16,material:"flat"},elevation:.023,bevel:.013,bevelDrop:.005,groundBy:{"landcover:wood":.175,"landcover:forest":.175,"landcover:grass":.125,"landcover:farmland":.125,"landcover:meadow":.125,"landcover:sand":.035,"landcover:beach":.035,"landcover:wetland":.045,"landcover:swamp":.045,"landuse:residential":.02,"landuse:suburb":.02,"landuse:neighbourhood":.02,"landuse:quarter":.02,"landuse:industrial":.03,"landuse:quarry":.03,"landuse:railway":.03,"landuse:substation":.03,"landuse:school":.055,"landuse:university":.055,"landuse:college":.055,"landuse:hospital":.055,"landuse:clinic":.055,"landuse:police":.055,"landuse:kindergarten":.055,"landuse:bus_station":.055,"landuse:pitch":.088,"landuse:stadium":.088,"landuse:playground":.088,"landuse:track":.088,"landuse:swimming_pool":.088,"landuse:cemetery":.075,"landuse:grave_yard":.075,"landuse:parking":.19,"landuse:fuel":.19,"park:park":.15,"aeroway:aerodrome":.065,"aeroway:apron":.065,"aeroway:helipad":.065}},{id:"poi-food",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,11],[18,12]]},iconSize:{stops:[[15,14.9],[18,17.6]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{textWeight:.35,color:"#f4882c",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#f4882c",frameHaloColor:"#ffffff",frameHaloWidth:1.2,frameGradient:.18,frameShadow:.5,frameShadowOffset:2.5,frameShadowBlur:4,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:16,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,11],[18,12]]},iconSize:{stops:[[15,14.9],[18,17.6]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{textWeight:.35,color:"#a269e7",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#a269e7",frameHaloColor:"#ffffff",frameHaloWidth:1.2,frameGradient:.18,frameShadow:.5,frameShadowOffset:2.5,frameShadowBlur:4,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,11],[18,12]]},iconSize:{stops:[[15,14.9],[18,17.6]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{textWeight:.35,color:"#4677e8",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#4677e8",frameHaloColor:"#ffffff",frameHaloWidth:1.2,frameGradient:.18,frameShadow:.5,frameShadowOffset:2.5,frameShadowBlur:4,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,11],[18,12]]},iconSize:{stops:[[15,14.9],[18,17.6]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{textWeight:.35,color:"#f86776",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#f86776",frameHaloColor:"#ffffff",frameHaloWidth:1.2,frameGradient:.18,frameShadow:.5,frameShadowOffset:2.5,frameShadowBlur:4,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","pharmacy","hospital","doctors","dentist","veterinary"]},{id:"poi-education",type:"symbol","source-layer":"poi",minzoom:16,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,11],[18,12]]},iconSize:{stops:[[15,14.9],[18,17.6]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{textWeight:.35,color:"#2ac1d4",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#2ac1d4",frameHaloColor:"#ffffff",frameHaloWidth:1.2,frameGradient:.18,frameShadow:.5,frameShadowOffset:2.5,frameShadowBlur:4,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,11],[18,12]]},iconSize:{stops:[[15,14.9],[18,17.6]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{textWeight:.35,color:"#cc5e3c",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#cc5e3c",frameHaloColor:"#ffffff",frameHaloWidth:1.2,frameGradient:.18,frameShadow:.5,frameShadowOffset:2.5,frameShadowBlur:4,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,11],[18,12]]},iconSize:{stops:[[15,14.9],[18,17.6]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{textWeight:.35,color:"#2db375",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#2db375",frameHaloColor:"#ffffff",frameHaloWidth:1.2,frameGradient:.18,frameShadow:.5,frameShadowOffset:2.5,frameShadowBlur:4,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:16,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,11],[18,12]]},iconSize:{stops:[[15,14.9],[18,17.6]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{textWeight:.35,color:"#a66fe8",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#a66fe8",frameHaloColor:"#ffffff",frameHaloWidth:1.2,frameGradient:.18,frameShadow:.5,frameShadowOffset:2.5,frameShadowBlur:4,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","lodging"]},{id:"poi-service",type:"symbol","source-layer":"poi",minzoom:17,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,11],[18,12]]},iconSize:{stops:[[15,14.9],[18,17.6]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{textWeight:.35,color:"#6e87bf",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#6e87bf",frameHaloColor:"#ffffff",frameHaloWidth:1.2,frameGradient:.18,frameShadow:.5,frameShadowOffset:2.5,frameShadowBlur:4,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:17,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,11],[18,12]]},iconSize:{stops:[[15,14.9],[18,17.6]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{textWeight:.35,color:"#4caaf3",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#4caaf3",frameHaloColor:"#ffffff",frameHaloWidth:1.2,frameGradient:.18,frameShadow:.5,frameShadowOffset:2.5,frameShadowBlur:4,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:"road-shield",type:"symbol","source-layer":"transportation_name",filter:["all",["has","ref"],["in","class","motorway","trunk","primary"]],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:{textWeight:.35,color:"#3a4048",haloColor:"#f7f3e8",haloWidth:.5,iconColor:"#f7f3e8",iconHaloColor:"#8a8172",iconHaloWidth:1.4}},{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:{textWeight:.35,color:"#3d7ea6",haloColor:"#ffffff",haloWidth:1.4}},{id:"place-label",type:"symbol","source-layer":"place",minzoom:4,filter:["all",["in","class","city","country"],["!in","name","\u0414\u0443\u0448\u0430\u043D\u0431\u0435","\u0425\u0443\u04B7\u0430\u043D\u0434","\u0425\u0443\u0434\u0436\u0430\u043D\u0434","\u0411\u043E\u0445\u0442\u0430\u0440","\u0425\u043E\u0440\u0443\u0493","\u0425\u043E\u0440\u043E\u0433"]],layout:{textField:["{name:ru}","{name}"],textSize:{stops:[[4,11],[7,13],[10,14],[14,16],[17,17]]},maxLineChars:16,priority:90},paint:{textWeight:.35,color:"#57544e",haloColor:"#ffffff",haloWidth:1.8}},{id:"place-capital",type:"symbol","source-layer":"place",minzoom:4,filter:["all",["==","class","city"],["in","name","\u0414\u0443\u0448\u0430\u043D\u0431\u0435","\u0425\u0443\u04B7\u0430\u043D\u0434","\u0425\u0443\u0434\u0436\u0430\u043D\u0434","\u0411\u043E\u0445\u0442\u0430\u0440","\u0425\u043E\u0440\u0443\u0493","\u0425\u043E\u0440\u043E\u0433"]],layout:{textField:["{name:ru}","{name}"],textSize:{stops:[[4,12],[7,14],[10,15],[14,17],[17,18]]},maxLineChars:16,priority:110},paint:{textWeight:.35,color:"#57544e",haloColor:"#ffffff",haloWidth:1.8}},{id:"place-label-minor",type:"symbol","source-layer":"place",minzoom:7.5,filter:["in","class","town"],layout:{textField:["{name:ru}","{name}"],textSize:{stops:[[7.5,10.5],[12,12.5],[16,14]]},maxLineChars:16,priority:70},paint:{textWeight:.35,color:{from:"place-label"},haloColor:{from:"place-label"},haloWidth:1.6}},{id:"place-label-local",type:"symbol","source-layer":"place",minzoom:10.5,filter:["in","class","village","hamlet","suburb","quarter","neighbourhood","isolated_dwelling","island"],layout:{textField:["{name:ru}","{name}"],textSize:{stops:[[10.5,10.5],[16,12.5]]},maxLineChars:16,priority:55},paint:{textWeight:.35,color:{from:"place-label"},haloColor:{from:"place-label"},haloWidth:1.6}},{id:"place-region",type:"symbol",source:"regions","source-layer":"regions",minzoom:4.5,layout:{textField:["{name:ru}","{name}"],textSize:{stops:[[4.5,11.5],[7,14],[10,16],[14,17]]},letterSpacing:.15,maxLineChars:14,priority:100},paint:{textWeight:.35,color:{from:"place-label"},haloColor:{from:"place-label"},haloWidth:2}},{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:{textWeight:.35,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:{textWeight:.35,color:"#57544e",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:{textWeight:.35,color:"#2d6ecb",haloColor:"#ffffff",haloWidth:1.6}}],sources:{regions:{type:"geojson",sourceLayer:"regions",data:{type:"FeatureCollection",features:[{type:"Feature",geometry:{type:"Point",coordinates:[72.9987,38.3503]},properties:{class:"state",name:"\u0412\u0438\u043B\u043E\u044F\u0442\u0438 \u041C\u0443\u0445\u0442\u043E\u0440\u0438 \u041A\u04EF\u04B3\u0438\u0441\u0442\u043E\u043D\u0438 \u0411\u0430\u0434\u0430\u0445\u0448\u043E\u043D","name:ru":"\u0413\u043E\u0440\u043D\u043E-\u0411\u0430\u0434\u0430\u0445\u0448\u0430\u043D\u0441\u043A\u0430\u044F \u0430\u0432\u0442\u043E\u043D\u043E\u043C\u043D\u0430\u044F \u043E\u0431\u043B\u0430\u0441\u0442\u044C","name:en":"Gorno-Badakhshan Autonomous Province"}},{type:"Feature",geometry:{type:"Point",coordinates:[69.9582,40.5242]},properties:{class:"state",name:"\u0412\u0438\u043B\u043E\u044F\u0442\u0438 \u0421\u0443\u0493\u0434","name:ru":"\u0421\u043E\u0433\u0434\u0438\u0439\u0441\u043A\u0430\u044F \u043E\u0431\u043B\u0430\u0441\u0442\u044C","name:en":"Sughd Province"}},{type:"Feature",geometry:{type:"Point",coordinates:[69.2633,37.8814]},properties:{class:"state",name:"\u0412\u0438\u043B\u043E\u044F\u0442\u0438 \u0425\u0430\u0442\u043B\u043E\u043D","name:ru":"\u0425\u0430\u0442\u043B\u043E\u043D\u0441\u043A\u0430\u044F \u043E\u0431\u043B\u0430\u0441\u0442\u044C","name:en":"Khatlon Province"}},{type:"Feature",geometry:{type:"Point",coordinates:[70.0873,38.9722]},properties:{class:"state",name:"\u041D\u043E\u04B3\u0438\u044F\u04B3\u043E\u0438 \u0442\u043E\u0431\u0435\u0438 \u04B7\u0443\u043C\u04B3\u0443\u0440\u04E3","name:ru":"\u0420\u0430\u0439\u043E\u043D\u044B \u0440\u0435\u0441\u043F\u0443\u0431\u043B\u0438\u043A\u0430\u043D\u0441\u043A\u043E\u0433\u043E \u043F\u043E\u0434\u0447\u0438\u043D\u0435\u043D\u0438\u044F","name:en":"Districts of Republican Subordination"}}]}},world:{url:"/tileserver/data/world/{z}/{x}/{y}.pbf",minzoom:0,maxzoom:6},indoor:{url:"/tileserver/data/indoor/{z}/{x}/{y}.pbf",minzoom:15,maxzoom:18},points:{url:"/tileserver/data/points/{z}/{x}/{y}.pbf",minzoom:13,maxzoom:16},closures:{url:"/tileserver/data/closures/{z}/{x}/{y}.pbf",minzoom:10,maxzoom:16}}};var Of={version:1,name:"\u0420\u0435\u043B\u044C\u0435\u0444\u043D\u0430\u044F",background:"#dbd8d4",levelHeight:.5,light:{ambientColor:"#ffffff",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#ffffff",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#ffffff",fillIntensity:.18},layers:[{id:"world-landcover-wood",type:"fill",source:"world","source-layer":"landcover",maxzoom:7,filter:["in","class","wood","forest"],paint:{color:{from:"landcover-wood"}}},{id:"world-landcover-grass",type:"fill",source:"world","source-layer":"landcover",maxzoom:7,filter:["in","class","grass","farmland","meadow"],paint:{color:{from:"landcover-grass"}}},{id:"world-landcover-sand",type:"fill",source:"world","source-layer":"landcover",maxzoom:7,filter:["in","class","sand","beach"],paint:{color:{from:"landcover-sand"}}},{id:"world-landcover-ice",type:"fill",source:"world","source-layer":"landcover",maxzoom:7,filter:["in","class","ice","glacier"],paint:{color:{from:"landcover-ice"}}},{id:"world-water",type:"fill",source:"world","source-layer":"water",maxzoom:7,paint:{color:{from:"water"}}},{id:"world-boundary",type:"line",source:"world","source-layer":"boundary",maxzoom:7,paint:{color:{from:"boundary"},opacity:.7,width:{stops:[[0,.5],[6,1.1]]}}},{id:"landcover-wood",type:"fill",minzoom:7,"source-layer":"landcover",filter:["in","class","wood","forest"],paint:{color:"#c6dcb4",opacity:{stops:[[8,.5],[12,.85]]}}},{id:"landcover-grass",type:"fill",minzoom:7,"source-layer":"landcover",filter:["in","class","grass","farmland","meadow"],paint:{color:"#d9e6c6",opacity:{stops:[[8,.45],[12,.8]]}}},{id:"landcover-sand",type:"fill",minzoom:7,"source-layer":"landcover",filter:["in","class","sand","beach"],paint:{color:"#f2e7c8"}},{id:"landcover-ice",type:"fill",minzoom:7,"source-layer":"landcover",filter:["in","class","ice","glacier"],paint:{color:"#e6f2f7"}},{id:"landcover-wetland",type:"fill",minzoom:7,"source-layer":"landcover",filter:["in","class","wetland","swamp"],paint:{color:"#cfe0d4"}},{id:"landuse-residential",type:"fill","source-layer":"landuse",filter:["in","class","residential","suburb","neighbourhood","quarter"],paint:{color:"#d3d0cb",opacity:{stops:[[10,.4],[14,.7]]}}},{id:"landuse-industrial",type:"fill","source-layer":"landuse",filter:["in","class","industrial","quarry","railway","substation"],paint:{color:"#e7e0dd"}},{id:"landuse-civic",type:"fill","source-layer":"landuse",filter:["in","class","school","university","college","hospital","clinic","police","kindergarten","bus_station"],paint:{color:"#ece3d8"}},{id:"landuse-sport",type:"fill","source-layer":"landuse",filter:["in","class","pitch","stadium","playground","track","swimming_pool"],paint:{color:"#cfe3c4"}},{id:"landuse-cemetery",type:"fill","source-layer":"landuse",filter:["in","class","cemetery","grave_yard"],paint:{color:"#d6dfc8"}},{id:"landuse-parking",type:"fill","source-layer":"landuse",filter:["in","class","parking","fuel"],paint:{color:"#dddad5"}},{id:"park",type:"fill","source-layer":"park",paint:{color:"#cfe5bd",opacity:.75}},{id:"aeroway-area",type:"fill","source-layer":"aeroway",filter:["in","class","aerodrome","apron","helipad"],paint:{color:"#e4e2e6"}},{id:"water",type:"fill",minzoom:7,"source-layer":"water",filter:["!in","class","swimming_pool"],paint:{color:"#a5cbe3",material:"water",materialScale:14,materialSpeed:1}},{id:"water-pool",type:"fill","source-layer":"water",filter:["==","class","swimming_pool"],paint:{color:"#9fd3e8",material:"water",materialScale:8,materialSpeed:1}},{id:"waterway",type:"line","source-layer":"waterway",paint:{color:"#a5cbe3",width:{stops:[[8,.6],[12,1.4],[16,4],[19,11.5],[20,23],[21,46],[22,92]]},material:"water",materialScale:10,materialSpeed:1}},{id:"aeroway-line",type:"line","source-layer":"aeroway",filter:["in","class","runway","taxiway"],paint:{color:"#d8d5da",width:{stops:[[10,1],[14,5],[18,24],[19,24],[20,48],[21,96],[22,192]]}}},{id:"road-bridge-outline-thin",type:"line",network:"roads","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","path","pedestrian","footway","steps","rail","transit"]],minzoom:14,paint:{color:{from:"road-casing-major",darken:.2},width:{stops:[[14,2.5],[17,5],[19,9],[20,15],[21,28]]}}},{id:"road-casing-major",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","motorway","trunk","primary"],minzoom:5,paint:{elevation:.085,color:"#d4ab68",width:{stops:[[6,1.6],[10,3.4],[14,8],[16,14],[18,30],[19,45],[20,90],[21,180],[22,360]]},widthFromData:true,widthExtra:2.5}},{id:"road-casing-secondary",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","secondary","tertiary"],minzoom:9,paint:{elevation:.085,color:{stops:[[16,"#c6bca6"],[18.5,"#d4ab68"]]},width:{stops:[[10,1.6],[14,5.5],[16,10],[18,22],[19,33],[20,66],[21,132],[22,264]]},widthFromData:true,widthExtra:2}},{id:"road-casing-minor",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","minor","service","track"],minzoom:12,paint:{elevation:.085,color:{stops:[[16,"#cdc4b2"],[18.5,"#d4ab68"]]},width:{stops:[[13,1.4],[16,6],[18,14],[19,22],[20,44],[21,88],[22,176]]},widthFromData:true,widthExtra:1.5}},{id:"road-rail",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","rail","transit"],minzoom:10,paint:{color:"#b2a99e",width:{stops:[[10,.8],[14,1.8],[18,4],[19,5.5],[20,11],[21,22],[22,44]]}}},{id:"road-path",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","path","pedestrian","footway","steps"],minzoom:14,paint:{elevation:.17,color:"#bdb2a0",width:{stops:[[14,.8],[17,2],[19,4],[20,8],[21,16],[22,32]]},dashArray:[4,3]}},{id:"road-minor",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","minor","service","track"],minzoom:12,paint:{elevation:.09,color:{stops:[[16,"#ffffff"],[18.5,"#ffdfa3"]]},width:{stops:[[13,.6],[16,4],[18,11],[19,18],[20,36],[21,72],[22,144]]},widthFromData:true}},{id:"road-ramp",network:"roads",type:"line","source-layer":"transportation",filter:["all",["in","class","motorway","trunk","primary"],["has","ramp"]],minzoom:5,paint:{elevation:.09,color:"#ffdfa3",width:{stops:[[6,.8],[10,2.2],[14,6],[16,11],[18,25],[19,38.5],[20,77],[21,154],[22,308]]},widthFromData:true}},{id:"road-secondary",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","secondary","tertiary"],minzoom:9,paint:{elevation:.09,color:{stops:[[16,"#ffffff"],[18.5,"#ffdfa3"]]},width:{stops:[[10,.8],[14,3.6],[16,7.5],[18,18],[19,28],[20,56],[21,112],[22,224]]},widthFromData:true}},{id:"road-major",network:"roads",type:"line","source-layer":"transportation",filter:["all",["in","class","motorway","trunk","primary"],["!has","ramp"]],minzoom:5,paint:{elevation:.09,color:"#ffdfa3",width:{stops:[[6,.8],[10,2.2],[14,6],[16,11],[18,25],[19,38.5],[20,77],[21,154],[22,308]]},widthFromData:true}},{id:"road-lane-divider-major",network:"roads",type:"line","source-layer":"transportation",filter:["all",["!has","oneway"],["in","class","motorway","trunk","primary"]],minzoom:16.5,paint:{elevation:.095,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]}},{id:"road-lane-divider-secondary",network:"roads",type:"line","source-layer":"transportation",filter:["all",["!has","oneway"],["in","class","secondary","tertiary"]],minzoom:16.5,paint:{elevation:.095,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]}},{id:"boundary",type:"line",minzoom:7,"source-layer":"boundary",filter:["<=","admin_level",4],paint:{color:"#b3a6b8",opacity:.7,width:{stops:[[4,.7],[10,1.4],[16,2.4]]},dashArray:[6,4]}},{id:"building",type:"fill-extrusion","source-layer":"building",minzoom:15,paint:{color:"#ffffff",roofColor:"#f2f1f0",opacity:1,heightScale:{stops:[[15,0],[15.8,1]]},aoStrength:.18,tintVariation:0,windowColor:"#7f9ab5",windowFrameColor:"#e9e5dc",windowGlow:0,facadeDetail:1,floorHeight:3.2,roofVariation:.35}},{id:"indoor-venue",type:"fill-extrusion",source:"indoor","source-layer":"area",filter:["all",["==","class","level"],["==","base",1]],minzoom:15,maxzoom:16,paint:{color:"#d8d3c8",roofColor:"#d9d3c7",opacity:1,aoStrength:.18,tintVariation:.06,windowColor:"#7f9ab5",windowFrameColor:"#e9e5dc",windowGlow:0,facadeDetail:1,floorHeight:3.2,roofVariation:.35}},{id:"road-closed-casing",type:"line",source:"closures","source-layer":"closures",minzoom:11,paint:{color:"#ffffff",width:{stops:[[11,4],[14,6],[17,10],[19,16],[20,32],[21,64],[22,128]]},opacity:.9},overlay:"roads"},{id:"road-closed",type:"line",source:"closures","source-layer":"closures",minzoom:11,paint:{color:"#d92b2b",width:{stops:[[11,2.5],[14,4],[17,7],[19,11],[20,22],[21,44],[22,88]]},dashArray:[5,4]},overlay:"roads"},{id:"traffic-signal",type:"symbol",source:"points","source-layer":"roadpoints",minzoom:17,filter:["==","kind","traffic_signals"],layout:{iconImage:"traffic_signals",allowOverlap:true,iconParts:["traffic_light_pole","traffic_light_body","traffic_light_red","traffic_light_amber","traffic_light_green"],offset:[0,-12],iconSize:{stops:[[17,17],[19,26]]},priority:3},paint:{color:"#5c6470",haloColor:"#ffffff",haloWidth:1.4,partColors:["#6a717c","#1c2026","#ff4d57","#f8cf2c","#12d370"],partHaloWidths:[1,1.3,0,0,0]}},{id:"housenumber",type:"symbol","source-layer":"housenumber",minzoom:17,layout:{ignorePlacement:true,textField:"{housenumber}",textSize:{stops:[[17,9],[19,11]]},maxLineChars:6,priority:-60,placementGroup:"background-labels"},paint:{textWeight:.35,color:"#8c8478",haloColor:"#f5f3ee",haloWidth:1}},{id:"road-label-minor",type:"symbol","source-layer":"transportation_name",minzoom:15,filter:["!in","class","motorway","trunk","primary","secondary"],layout:{ignorePlacement:true,textField:["{name:ru}","{name}"],textPlacement:"line",symbolSpacing:900,textSize:{stops:[[15,10.5],[18,12]]},priority:15,abbreviate:true,placementGroup:"background-labels"},paint:{textWeight:.35,color:{from:"road-label"},haloColor:{from:"road-label"},haloWidth:1.6}},{id:"road-label",type:"symbol","source-layer":"transportation_name",minzoom:12.5,filter:["in","class","motorway","trunk","primary","secondary"],layout:{ignorePlacement:true,textField:["{name:ru}","{name}"],textPlacement:"line",symbolSpacing:900,textSize:{stops:[[14,10],[18,13]]},priority:20,abbreviate:true,placementGroup:"background-labels"},paint:{textWeight:.35,color:"#5c5646",haloColor:"#ffffff",haloWidth:1.6}},{id:"road-closed-end",type:"symbol",source:"closures","source-layer":"closure_ends",minzoom:13,layout:{iconImage:"road_closed",iconFrame:"circle",iconFrameScale:1.6,allowOverlap:true,iconSize:13,priority:6},paint:{color:"#d92b2b",frameColor:"#d92b2b",frameOpacity:1,frameHaloColor:"#ffffff",frameHaloWidth:1.4,frameGradient:.18,frameShadow:.5,frameShadowOffset:2.5,frameShadowBlur:4,iconColor:"#ffffff",iconHaloWidth:0}},{id:"crossing",type:"fill",source:"points","source-layer":"crossings",minzoom:16.5,overlay:"roads",paint:{color:"#ffffff",opacity:.9}},{id:"poi-food",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,11],[18,12]]},iconSize:{stops:[[15,14.9],[18,17.6]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{textWeight:.35,color:"#f4882c",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#f4882c",frameHaloColor:"#ffffff",frameHaloWidth:1.2,frameGradient:.18,frameShadow:.5,frameShadowOffset:2.5,frameShadowBlur:4,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:16,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,11],[18,12]]},iconSize:{stops:[[15,14.9],[18,17.6]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{textWeight:.35,color:"#a269e7",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#a269e7",frameHaloColor:"#ffffff",frameHaloWidth:1.2,frameGradient:.18,frameShadow:.5,frameShadowOffset:2.5,frameShadowBlur:4,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,11],[18,12]]},iconSize:{stops:[[15,14.9],[18,17.6]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{textWeight:.35,color:"#4677e8",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#4677e8",frameHaloColor:"#ffffff",frameHaloWidth:1.2,frameGradient:.18,frameShadow:.5,frameShadowOffset:2.5,frameShadowBlur:4,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,11],[18,12]]},iconSize:{stops:[[15,14.9],[18,17.6]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{textWeight:.35,color:"#f86776",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#f86776",frameHaloColor:"#ffffff",frameHaloWidth:1.2,frameGradient:.18,frameShadow:.5,frameShadowOffset:2.5,frameShadowBlur:4,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","pharmacy","hospital","doctors","dentist","veterinary"]},{id:"poi-education",type:"symbol","source-layer":"poi",minzoom:16,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,11],[18,12]]},iconSize:{stops:[[15,14.9],[18,17.6]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{textWeight:.35,color:"#2ac1d4",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#2ac1d4",frameHaloColor:"#ffffff",frameHaloWidth:1.2,frameGradient:.18,frameShadow:.5,frameShadowOffset:2.5,frameShadowBlur:4,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,11],[18,12]]},iconSize:{stops:[[15,14.9],[18,17.6]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{textWeight:.35,color:"#cc5e3c",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#cc5e3c",frameHaloColor:"#ffffff",frameHaloWidth:1.2,frameGradient:.18,frameShadow:.5,frameShadowOffset:2.5,frameShadowBlur:4,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,11],[18,12]]},iconSize:{stops:[[15,14.9],[18,17.6]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{textWeight:.35,color:"#2db375",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#2db375",frameHaloColor:"#ffffff",frameHaloWidth:1.2,frameGradient:.18,frameShadow:.5,frameShadowOffset:2.5,frameShadowBlur:4,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:16,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,11],[18,12]]},iconSize:{stops:[[15,14.9],[18,17.6]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{textWeight:.35,color:"#a66fe8",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#a66fe8",frameHaloColor:"#ffffff",frameHaloWidth:1.2,frameGradient:.18,frameShadow:.5,frameShadowOffset:2.5,frameShadowBlur:4,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","lodging"]},{id:"poi-service",type:"symbol","source-layer":"poi",minzoom:17,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,11],[18,12]]},iconSize:{stops:[[15,14.9],[18,17.6]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{textWeight:.35,color:"#6e87bf",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#6e87bf",frameHaloColor:"#ffffff",frameHaloWidth:1.2,frameGradient:.18,frameShadow:.5,frameShadowOffset:2.5,frameShadowBlur:4,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:17,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,11],[18,12]]},iconSize:{stops:[[15,14.9],[18,17.6]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{textWeight:.35,color:"#4caaf3",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#4caaf3",frameHaloColor:"#ffffff",frameHaloWidth:1.2,frameGradient:.18,frameShadow:.5,frameShadowOffset:2.5,frameShadowBlur:4,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:"road-shield",type:"symbol","source-layer":"transportation_name",filter:["all",["has","ref"],["in","class","motorway","trunk","primary"]],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:{textWeight:.35,color:"#3a4048",haloColor:"#f7f3e8",haloWidth:.5,iconColor:"#f7f3e8",iconHaloColor:"#8a8172",iconHaloWidth:1.4}},{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:{textWeight:.35,color:"#3d7ea6",haloColor:"#ffffff",haloWidth:1.4}},{id:"place-label",type:"symbol","source-layer":"place",minzoom:4,filter:["all",["in","class","city","country"],["!in","name","\u0414\u0443\u0448\u0430\u043D\u0431\u0435","\u0425\u0443\u04B7\u0430\u043D\u0434","\u0425\u0443\u0434\u0436\u0430\u043D\u0434","\u0411\u043E\u0445\u0442\u0430\u0440","\u0425\u043E\u0440\u0443\u0493","\u0425\u043E\u0440\u043E\u0433"]],layout:{textField:["{name:ru}","{name}"],textSize:{stops:[[4,11],[7,13],[10,14],[14,16],[17,17]]},maxLineChars:16,priority:90},paint:{textWeight:.35,color:"#57544e",haloColor:"#ffffff",haloWidth:1.8}},{id:"place-capital",type:"symbol","source-layer":"place",minzoom:4,filter:["all",["==","class","city"],["in","name","\u0414\u0443\u0448\u0430\u043D\u0431\u0435","\u0425\u0443\u04B7\u0430\u043D\u0434","\u0425\u0443\u0434\u0436\u0430\u043D\u0434","\u0411\u043E\u0445\u0442\u0430\u0440","\u0425\u043E\u0440\u0443\u0493","\u0425\u043E\u0440\u043E\u0433"]],layout:{textField:["{name:ru}","{name}"],textSize:{stops:[[4,12],[7,14],[10,15],[14,17],[17,18]]},maxLineChars:16,priority:110},paint:{textWeight:.35,color:"#57544e",haloColor:"#ffffff",haloWidth:1.8}},{id:"place-label-minor",type:"symbol","source-layer":"place",minzoom:7.5,filter:["in","class","town"],layout:{textField:["{name:ru}","{name}"],textSize:{stops:[[7.5,10.5],[12,12.5],[16,14]]},maxLineChars:16,priority:70},paint:{textWeight:.35,color:{from:"place-label"},haloColor:{from:"place-label"},haloWidth:1.6}},{id:"place-label-local",type:"symbol","source-layer":"place",minzoom:10.5,filter:["in","class","village","hamlet","suburb","quarter","neighbourhood","isolated_dwelling","island"],layout:{textField:["{name:ru}","{name}"],textSize:{stops:[[10.5,10.5],[16,12.5]]},maxLineChars:16,priority:55},paint:{textWeight:.35,color:{from:"place-label"},haloColor:{from:"place-label"},haloWidth:1.6}},{id:"place-region",type:"symbol",source:"regions","source-layer":"regions",minzoom:4.5,layout:{textField:["{name:ru}","{name}"],textSize:{stops:[[4.5,11.5],[7,14],[10,16],[14,17]]},letterSpacing:.15,maxLineChars:14,priority:100},paint:{textWeight:.35,color:{from:"place-label"},haloColor:{from:"place-label"},haloWidth:2}},{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:{textWeight:.35,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:{textWeight:.35,color:"#57544e",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:{textWeight:.35,color:"#2d6ecb",haloColor:"#ffffff",haloWidth:1.6}}],sources:{regions:{type:"geojson",sourceLayer:"regions",data:{type:"FeatureCollection",features:[{type:"Feature",geometry:{type:"Point",coordinates:[72.9987,38.3503]},properties:{class:"state",name:"\u0412\u0438\u043B\u043E\u044F\u0442\u0438 \u041C\u0443\u0445\u0442\u043E\u0440\u0438 \u041A\u04EF\u04B3\u0438\u0441\u0442\u043E\u043D\u0438 \u0411\u0430\u0434\u0430\u0445\u0448\u043E\u043D","name:ru":"\u0413\u043E\u0440\u043D\u043E-\u0411\u0430\u0434\u0430\u0445\u0448\u0430\u043D\u0441\u043A\u0430\u044F \u0430\u0432\u0442\u043E\u043D\u043E\u043C\u043D\u0430\u044F \u043E\u0431\u043B\u0430\u0441\u0442\u044C","name:en":"Gorno-Badakhshan Autonomous Province"}},{type:"Feature",geometry:{type:"Point",coordinates:[69.9582,40.5242]},properties:{class:"state",name:"\u0412\u0438\u043B\u043E\u044F\u0442\u0438 \u0421\u0443\u0493\u0434","name:ru":"\u0421\u043E\u0433\u0434\u0438\u0439\u0441\u043A\u0430\u044F \u043E\u0431\u043B\u0430\u0441\u0442\u044C","name:en":"Sughd Province"}},{type:"Feature",geometry:{type:"Point",coordinates:[69.2633,37.8814]},properties:{class:"state",name:"\u0412\u0438\u043B\u043E\u044F\u0442\u0438 \u0425\u0430\u0442\u043B\u043E\u043D","name:ru":"\u0425\u0430\u0442\u043B\u043E\u043D\u0441\u043A\u0430\u044F \u043E\u0431\u043B\u0430\u0441\u0442\u044C","name:en":"Khatlon Province"}},{type:"Feature",geometry:{type:"Point",coordinates:[70.0873,38.9722]},properties:{class:"state",name:"\u041D\u043E\u04B3\u0438\u044F\u04B3\u043E\u0438 \u0442\u043E\u0431\u0435\u0438 \u04B7\u0443\u043C\u04B3\u0443\u0440\u04E3","name:ru":"\u0420\u0430\u0439\u043E\u043D\u044B \u0440\u0435\u0441\u043F\u0443\u0431\u043B\u0438\u043A\u0430\u043D\u0441\u043A\u043E\u0433\u043E \u043F\u043E\u0434\u0447\u0438\u043D\u0435\u043D\u0438\u044F","name:en":"Districts of Republican Subordination"}}]}},world:{url:"/tileserver/data/world/{z}/{x}/{y}.pbf",minzoom:0,maxzoom:6},indoor:{url:"/tileserver/data/indoor/{z}/{x}/{y}.pbf",minzoom:15,maxzoom:18},points:{url:"/tileserver/data/points/{z}/{x}/{y}.pbf",minzoom:13,maxzoom:16},closures:{url:"/tileserver/data/closures/{z}/{x}/{y}.pbf",minzoom:10,maxzoom:16},terrain:{url:"/tileserver/data/terrain/{z}/{x}/{y}.webp",type:"raster-dem",encoding:"mapbox",minzoom:0,maxzoom:10}},terrain:{source:"terrain",exaggeration:1,tint:{low:"#bcd6ea",mid:"#cde0ab",high:"#ffd24a",range:[600,4600],tint:.7,shade:.85}}};var Gf={name:"\u041D\u043E\u0447\u043D\u0430\u044F",background:"#11151c",model3dKey:"night",light:{ambientColor:"#8fa3c4",ambientIntensity:.34,keyAzimuth:120,keyAltitude:55,keyColor:"#cfd8ea",keyIntensity:.3,fillAzimuth:300,fillAltitude:20,fillColor:"#4a5f86",fillIntensity:.22},paint:{"landcover-wood":{color:"#16261a"},"landcover-grass":{color:"#182619"},"landcover-sand":{color:"#2a2417"},"landcover-ice":{color:"#1b2730"},"landcover-wetland":{color:"#16242a"},"landuse-residential":{color:"#171b23"},"landuse-industrial":{color:"#1b1c20"},"landuse-civic":{color:"#1c1f28"},"landuse-sport":{color:"#16261c"},"landuse-cemetery":{color:"#182018"},"landuse-parking":{color:"#191d24"},park:{color:"#15271a"},"aeroway-area":{color:"#1b1e26"},water:{color:"#0f2438"},"water-pool":{color:"#123048"},waterway:{color:"#14304a"},"aeroway-line":{color:"#242833"},"road-casing-major":{color:"#2a2519"},"road-casing-secondary":{color:{stops:[[16,"#22262f"],[18.5,"#2a2519"]]}},"road-casing-minor":{color:{stops:[[16,"#1e222a"],[18.5,"#2a2519"]]}},"road-rail":{color:"#333842"},"road-path":{color:"#2a2e36"},"road-minor":{color:{stops:[[16,"#2f343d"],[18.5,"#6b5c3c"]]}},"road-secondary":{color:{stops:[[16,"#3c424d"],[18.5,"#6b5c3c"]]}},"road-ramp":{color:"#6b5c3c"},"road-major":{color:"#6b5c3c"},boundary:{color:"#4a3f52"},building:{color:"#232833",roofColor:"#2b313d",aoStrength:.3,tintVariation:.1,windowColor:"#8fb8e8",windowFrameColor:"#39424f",windowGlow:.35},housenumber:{color:"#5f6672",haloColor:"#12161d"},poi:{color:"#66a7d9",haloColor:"#12161d",haloWidth:1.3,frameColor:"#66a7d9",frameOpacity:1,frameHaloColor:"#12161d",iconColor:"#1b1b1b",iconHaloWidth:0},"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:"#a374dc",haloColor:"#12161d",haloWidth:1.3,frameColor:"#a374dc",frameOpacity:1,frameHaloColor:"#12161d",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-transport":{color:"#6487d8",haloColor:"#12161d",haloWidth:1.3,frameColor:"#6487d8",frameOpacity:1,frameHaloColor:"#12161d",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-health":{color:"#df808a",haloColor:"#12161d",haloWidth:1.3,frameColor:"#df808a",frameOpacity:1,frameHaloColor:"#12161d",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-education":{color:"#64cbd8",haloColor:"#12161d",haloWidth:1.3,frameColor:"#64cbd8",frameOpacity:1,frameHaloColor:"#12161d",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-culture":{color:"#d1836b",haloColor:"#12161d",haloWidth:1.3,frameColor:"#d1836b",frameOpacity:1,frameHaloColor:"#12161d",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-sport":{color:"#6ad2a2",haloColor:"#12161d",haloWidth:1.3,frameColor:"#6ad2a2",frameOpacity:1,frameHaloColor:"#12161d",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-lodging":{color:"#a779de",haloColor:"#12161d",haloWidth:1.3,frameColor:"#a779de",frameOpacity:1,frameHaloColor:"#12161d",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-service":{color:"#7c91c0",haloColor:"#12161d",haloWidth:1.3,frameColor:"#7c91c0",frameOpacity:1,frameHaloColor:"#12161d",iconColor:"#1b1b1b",iconHaloWidth:0},"building-entrance":{color:"#79a0d7",haloColor:"#12161d"},"indoor-shell":{color:"#3a4254",opacity:.97},"indoor-corridor":{color:"#363d4e"},"indoor-room":{color:"#414a5f"},"indoor-service":{color:"#535f79"},"indoor-shop":{color:"#5c4672"},"indoor-food":{color:"#725d46"},"indoor-wc":{color:"#466172"},"indoor-wall":{color:"#697183",roofColor:"#868c99",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#65548a",opacity:.95},"indoor-door":{color:"#c3ccd9",haloColor:"#12161d",haloWidth:1.3},"indoor-poi":{color:"#c3ccd9",haloColor:"#12161d",haloWidth:1.3},"indoor-name":{color:"#e2e7ee",haloColor:"#10141b",haloWidth:2}},sky:{skyColor:"#080d18",horizonColor:"#1b2436",fogRange:[2.34,8.77],fogIntensity:.9,spaceColor:"#02030a",atmosphereColor:"#3f6fa8",starIntensity:.8}};var zf={name:"\u0413\u0440\u0430\u0444\u0438\u0442",background:"#eeeeee",light:{ambientColor:"#ffffff",ambientIntensity:.55,keyAzimuth:120,keyAltitude:60,keyColor:"#ffffff",keyIntensity:.5,fillAzimuth:300,fillAltitude:25,fillColor:"#ffffff",fillIntensity:.16},paint:{"landcover-wood":{color:"#e2e2e2"},"landcover-grass":{color:"#e7e7e7"},"landcover-sand":{color:"#eaeaea"},"landcover-ice":{color:"#f0f0f0"},"landcover-wetland":{color:"#e4e4e4"},"landuse-residential":{color:"#e9e9e9"},"landuse-industrial":{color:"#e5e5e5"},"landuse-civic":{color:"#ebebeb"},"landuse-sport":{color:"#e4e4e4"},"landuse-cemetery":{color:"#e6e6e6"},"landuse-parking":{color:"#ececec"},park:{color:"#e3e3e3"},"aeroway-area":{color:"#e8e8e8"},water:{color:"#d4d4d4"},"water-pool":{color:"#d8d8d8"},waterway:{color:"#d4d4d4"},"aeroway-line":{color:"#dedede"},"road-casing-major":{color:"#c9c9c9"},"road-casing-secondary":{color:{stops:[[16,"#d2d2d2"],[18.5,"#c9c9c9"]]}},"road-casing-minor":{color:{stops:[[16,"#d8d8d8"],[18.5,"#c9c9c9"]]}},"road-rail":{color:"#c2c2c2"},"road-path":{color:"#d0d0d0"},"road-minor":{color:{stops:[[16,"#f7f7f7"],[18.5,"#ffffff"]]}},"road-secondary":{color:{stops:[[16,"#fbfbfb"],[18.5,"#ffffff"]]}},"road-ramp":{color:"#ffffff"},"road-major":{color:"#ffffff"},boundary:{color:"#b0b0b0"},building:{color:"#dcdcdc",roofColor:"#e0e0e0",aoStrength:.22,tintVariation:.05,windowColor:"#b7bcc2",windowFrameColor:"#f2f2f2",windowGlow:0},housenumber:{color:"#9a9a9a",haloColor:"#f4f4f4"},poi:{color:"#3c3c3c",haloColor:"#ffffff"},"road-label":{color:"#585858",haloColor:"#ffffff"},"water-label":{color:"#6e6e6e",haloColor:"#ffffff"},"place-label":{color:"#545454",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:"#545454",haloColor:"#ffffff"}},sky:{skyColor:"#8f96a0",horizonColor:"#d7dade",fogRange:[2.43,10.12],fogIntensity:.9,spaceColor:"#07080b",atmosphereColor:"#9aa3ad",starIntensity:.5}};var Wf={name:"\u041B\u0435\u0434\u044F\u043D\u0430\u044F",background:"#f5f3f0",light:{ambientColor:"#eaf6fb",ambientIntensity:.72,keyAzimuth:120,keyAltitude:45,keyColor:"#ffffff",keyIntensity:.36,fillAzimuth:300,fillAltitude:25,fillColor:"#cfe6f2",fillIntensity:.22},paint:{"landcover-wood":{color:"#b4ebb8"},"landcover-grass":{color:"#c2f0c3"},"landcover-sand":{color:"#f7efd6"},"landcover-ice":{color:"#eaf6fb"},"landcover-wetland":{color:"#d8eef0"},"landuse-residential":{color:"#ecf1fb"},"landuse-industrial":{color:"#eceef1"},"landuse-civic":{color:"#f6ecf9"},"landuse-sport":{color:"#c2f0c3"},"landuse-cemetery":{color:"#cdeccf"},"landuse-parking":{color:"#e6e7e9"},park:{color:"#c2f0c3"},"aeroway-area":{color:"#e6e9f2"},water:{color:"#90ddf6"},waterway:{color:"#90ddf6"},"aeroway-line":{color:"#f3f1ee"},"road-casing-major":{color:"#f0c24f"},"road-casing-secondary":{color:"#e8d7a4"},"road-casing-minor":{color:"#dbdbdd"},"road-rail":{color:"#c9c9cd"},"road-path":{color:"#ffffff",dashArray:null},"road-minor":{color:"#ffffff"},"road-secondary":{color:"#ffecba"},"road-ramp":{color:"#ffe49a"},"road-major":{color:"#ffd86b"},boundary:{color:"#c9a7d8"},building:{color:"#d5e4ef",roofColor:"#e9f0f6",aoStrength:0,tintVariation:0,seamStrength:0,windowColor:"#8fbcd8",windowFrameColor:"#d5e4ef",windowVariation:.6,windowGlow:0,ice:1},housenumber:{color:"#6f7a88",haloColor:"#ffffff",haloWidth:1.4},poi:{color:"#4caaf3",haloColor:"#ffffff",haloWidth:1.4},"road-label":{color:"#626e7e",haloColor:"#ffffff",haloWidth:1.4},"water-label":{color:"#35688d",haloColor:"#f7f7f7",haloWidth:1.4},"place-label":{color:"#4a5566",haloColor:"#ffffff",haloWidth:1.4},"poi-food":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#f4882c",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#a269e7",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#4677e8",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#f86776",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#2ac1d4",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#cc5e3c",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#2db375",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#a66fe8",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#6e87bf",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"water-pool":{color:"#90ddf6"},"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:"#4a5566",haloColor:"#ffffff",haloWidth:1.4},"building-entrance":{color:"#225aaa",haloColor:"#ffffff"},"road-bridge-outline-thin":{opacity:0},"road-lane-divider-major":{opacity:0},"road-lane-divider-secondary":{opacity:0},"road-path-casing":{color:"#dbdbdd"},crossing:{sideColor:"#c9c9cd",sideShade:.45}},sky:{skyColor:"#a9d8ee",horizonColor:"#eef4f7",fogRange:[2.6,12],fogIntensity:.82,spaceColor:"#0a1018",atmosphereColor:"#9fd0ff",starIntensity:.4}};var Nf={name:"\u0411\u043B\u0435\u0434\u043D\u0430\u044F",background:"#f7f6f3",light:{ambientColor:"#ffffff",ambientIntensity:.62,keyAzimuth:120,keyAltitude:65,keyColor:"#fffaf0",keyIntensity:.38,fillAzimuth:300,fillAltitude:25,fillColor:"#eef2f8",fillIntensity:.14},paint:{"landcover-wood":{color:"#e8efe2"},"landcover-grass":{color:"#edf2e6"},"landcover-sand":{color:"#f4eede"},"landcover-ice":{color:"#f0f5f7"},"landcover-wetland":{color:"#e8f0ec"},"landuse-residential":{color:"#f2f0ec"},"landuse-industrial":{color:"#f0edeb"},"landuse-civic":{color:"#f4efe9"},"landuse-sport":{color:"#e9f1e4"},"landuse-cemetery":{color:"#ecefe6"},"landuse-parking":{color:"#f3f1ed"},park:{color:"#e7f0df"},"aeroway-area":{color:"#f0f0f2"},water:{color:"#dce9f2"},"water-pool":{color:"#dcecf5"},waterway:{color:"#dce9f2"},"aeroway-line":{color:"#ebebee"},"road-casing-major":{color:"#efe4d2"},"road-casing-secondary":{color:{stops:[[16,"#eceae2"],[18.5,"#efe4d2"]]}},"road-casing-minor":{color:{stops:[[16,"#efedE6"],[18.5,"#efe4d2"]]}},"road-rail":{color:"#e0dcd6"},"road-path":{color:"#e6e2da"},"road-minor":{color:{stops:[[16,"#fdfcfa"],[18.5,"#fff8e8"]]}},"road-secondary":{color:{stops:[[16,"#ffffff"],[18.5,"#fff8e8"]]}},"road-ramp":{color:"#fff8e8"},"road-major":{color:"#fff8e8"},boundary:{color:"#cfc3d2"},building:{color:"#eae7e0",roofColor:"#ecE9e2",aoStrength:.14,tintVariation:.04,windowColor:"#c7d6e4",windowFrameColor:"#f6f7f9",windowGlow:0},housenumber:{color:"#a9a296",haloColor:"#fbfaf7"},poi:{color:"#6b6b6b",haloColor:"#ffffff"},"road-label":{color:"#8a8474",haloColor:"#ffffff"},"water-label":{color:"#7ea8c4",haloColor:"#ffffff"},"place-label":{color:"#55524c",haloColor:"#ffffff"},"poi-food":{color:"#6b6b6b",haloColor:"#ffffff",frameColor:"#6b6b6b",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{color:"#6b6b6b",haloColor:"#ffffff",frameColor:"#6b6b6b",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{color:"#6b6b6b",haloColor:"#ffffff",frameColor:"#6b6b6b",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{color:"#6b6b6b",haloColor:"#ffffff",frameColor:"#6b6b6b",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{color:"#6b6b6b",haloColor:"#ffffff",frameColor:"#6b6b6b",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{color:"#6b6b6b",haloColor:"#ffffff",frameColor:"#6b6b6b",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{color:"#6b6b6b",haloColor:"#ffffff",frameColor:"#6b6b6b",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{color:"#6b6b6b",haloColor:"#ffffff",frameColor:"#6b6b6b",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{color:"#6b6b6b",haloColor:"#ffffff",frameColor:"#6b6b6b",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"building-entrance":{color:"#564e4e",haloColor:"#ffffff"},"indoor-shell":{color:"#f4f3f0",opacity:.97},"indoor-corridor":{color:"#f8f7f6"},"indoor-room":{color:"#edece8"},"indoor-service":{color:"#dcd9d1"},"indoor-shop":{color:"#e0dae6"},"indoor-food":{color:"#e6e0da"},"indoor-wc":{color:"#dae1e6"},"indoor-wall":{color:"#cdcbc4",roofColor:"#e0dedb",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#ccc5d9",opacity:.95},"indoor-door":{color:"#6b6b6b",haloColor:"#ffffff"},"indoor-poi":{color:"#6b6b6b",haloColor:"#ffffff"},"indoor-name":{color:"#55524c",haloColor:"#ffffff"}},sky:{skyColor:"#c8dbee",horizonColor:"#eef2f6",fogRange:[2.52,12.15],fogIntensity:.85,spaceColor:"#0a1018",atmosphereColor:"#9fd0ff",starIntensity:.45}};var Vf={name:"\u0410\u0442\u043B\u0430\u0441, \u0434\u0435\u043D\u044C",background:"#F6F7F7",light:{ambientColor:"#ffffff",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#ffffff",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#ffffff",fillIntensity:.18},paint:{"landcover-wood":{color:"#A8CF91"},"landcover-grass":{color:"#C7EBA4"},"landcover-sand":{color:"#F0DFB9"},"landcover-ice":{color:"#E7F0EE"},"landcover-wetland":{color:"#B2DEB0"},"landuse-residential":{color:"#EFF1EC"},"landuse-industrial":{color:"#EDF1F1"},"landuse-civic":{color:"#E9E9F1"},"landuse-sport":{color:"#D2F1D8"},"landuse-cemetery":{color:"#EFF1EC"},"landuse-parking":{color:"#F1EEE1"},park:{color:"#BCE39F"},"aeroway-area":{color:"#CFD5D6"},water:{color:"#7FD3F5"},waterway:{color:"#7FD3F5"},"aeroway-line":{color:"#CFD5D6"},"road-casing-major":{color:"#A9B4C4"},"road-casing-secondary":{color:"#A9B4C4"},"road-casing-minor":{color:"#A9B4C4"},"road-rail":{color:"#86948F"},"road-path":{color:"#EDEBD6"},"road-minor":{color:"#BBC4C9"},"road-secondary":{color:"#C0C8D4"},"road-ramp":{color:"#C0C8D4"},"road-major":{color:"#C0C8D4"},boundary:{color:"#A99CAE"},building:{color:"#E3DBD5"},housenumber:{color:"#2e2e2e",haloColor:"#ffffff",haloWidth:1.4},poi:{color:"#4caaf3",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:"#f4882c",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#a269e7",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#4677e8",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#f86776",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#2ac1d4",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#cc5e3c",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#2db375",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#a66fe8",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#6e87bf",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"water-pool":{color:"#a7e1fd"},"indoor-shell":{color:"#f4f3f1",opacity:.97},"indoor-corridor":{color:"#f8f8f6"},"indoor-room":{color:"#eeece8"},"indoor-service":{color:"#ddd8d2"},"indoor-shop":{color:"#e0dae7"},"indoor-food":{color:"#e7e1da"},"indoor-wc":{color:"#dae2e7"},"indoor-wall":{color:"#cecac5",roofColor:"#e0dedc",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#ccc6d9",opacity:.95},"indoor-door":{color:"#586e84",haloColor:"#ffffff",haloWidth:1.4},"indoor-poi":{color:"#586e84",haloColor:"#ffffff",haloWidth:1.4},"indoor-name":{color:"#2e2e2e",haloColor:"#ffffff",haloWidth:1.4},"building-entrance":{color:"#225aaa",haloColor:"#ffffff"}},sky:{skyColor:"#91b8cb",horizonColor:"#dfd9d6",fogRange:[2.41,9.94],fogIntensity:.86,spaceColor:"#0e0b0a",atmosphereColor:"#5daad0",starIntensity:.38}};var Uf={name:"\u0410\u0442\u043B\u0430\u0441, \u043D\u043E\u0447\u044C",background:"#212937",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:"#315247"},"landcover-grass":{color:"#315248"},"landcover-sand":{color:"#2C4932"},"landcover-ice":{color:"#315152"},"landcover-wetland":{color:"#2F4E48"},"landuse-residential":{color:"#2F3844"},"landuse-industrial":{color:"#2F3744"},"landuse-civic":{color:"#2F3544"},"landuse-sport":{color:"#2F3B44"},"landuse-cemetery":{color:"#2F3844"},"landuse-parking":{color:"#2F3E44"},park:{color:"#315247"},"aeroway-area":{color:"#2D3941"},water:{color:"#0C2166"},"water-pool":{color:"#123048"},waterway:{color:"#0C2166"},"aeroway-line":{color:"#2D3941"},"road-casing-major":{color:"#333A52"},"road-casing-secondary":{color:"#333A52"},"road-casing-minor":{color:"#333A52"},"road-rail":{color:"#6C7B82"},"road-path":{color:"#626F5D"},"road-minor":{color:"#4B5D66"},"road-secondary":{color:"#535E85"},"road-ramp":{color:"#535E85"},"road-major":{color:"#535E85"},boundary:{color:"#6B5F78"},building:{color:"#333B4E"},housenumber:{color:"#5f6672",haloColor:"#12161d"},poi:{color:"#66a7d9",haloColor:"#12161d",haloWidth:1.3,frameColor:"#66a7d9",frameOpacity:1,frameHaloColor:"#12161d",iconColor:"#1b1b1b",iconHaloWidth:0},"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:"#a374dc",haloColor:"#12161d",haloWidth:1.3,frameColor:"#a374dc",frameOpacity:1,frameHaloColor:"#12161d",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-transport":{color:"#6487d8",haloColor:"#12161d",haloWidth:1.3,frameColor:"#6487d8",frameOpacity:1,frameHaloColor:"#12161d",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-health":{color:"#df808a",haloColor:"#12161d",haloWidth:1.3,frameColor:"#df808a",frameOpacity:1,frameHaloColor:"#12161d",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-education":{color:"#64cbd8",haloColor:"#12161d",haloWidth:1.3,frameColor:"#64cbd8",frameOpacity:1,frameHaloColor:"#12161d",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-culture":{color:"#d1836b",haloColor:"#12161d",haloWidth:1.3,frameColor:"#d1836b",frameOpacity:1,frameHaloColor:"#12161d",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-sport":{color:"#6ad2a2",haloColor:"#12161d",haloWidth:1.3,frameColor:"#6ad2a2",frameOpacity:1,frameHaloColor:"#12161d",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-lodging":{color:"#a779de",haloColor:"#12161d",haloWidth:1.3,frameColor:"#a779de",frameOpacity:1,frameHaloColor:"#12161d",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-service":{color:"#7c91c0",haloColor:"#12161d",haloWidth:1.3,frameColor:"#7c91c0",frameOpacity:1,frameHaloColor:"#12161d",iconColor:"#1b1b1b",iconHaloWidth:0},"building-entrance":{color:"#79a0d7",haloColor:"#12161d"},"indoor-shell":{color:"#3a4254",opacity:.97},"indoor-corridor":{color:"#363d4e"},"indoor-room":{color:"#414a5f"},"indoor-service":{color:"#535f79"},"indoor-shop":{color:"#5c4672"},"indoor-food":{color:"#725d46"},"indoor-wc":{color:"#466172"},"indoor-wall":{color:"#697183",roofColor:"#868c99",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#65548a",opacity:.95},"indoor-door":{color:"#c3ccd9",haloColor:"#12161d",haloWidth:1.3},"indoor-poi":{color:"#c3ccd9",haloColor:"#12161d",haloWidth:1.3},"indoor-name":{color:"#e2e7ee",haloColor:"#10141b",haloWidth:2}},sky:{skyColor:"#080d18",horizonColor:"#1b2436",fogRange:[2.34,8.77],fogIntensity:.9,spaceColor:"#02030a",atmosphereColor:"#3f6fa8",starIntensity:.8}};var Kf={"atlas-day":Vf,"atlas-night":Uf};var Xf={name:"\u041E\u0431\u044A\u0451\u043C\u043D\u0430\u044F",background:"#dfdbda",light:{ambientColor:"#ffffff",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#ffffff",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#ffffff",fillIntensity:.18},paint:{"landcover-wood":{color:"#9bda95"},"landcover-grass":{color:"#b2e6a8"},"landcover-sand":{color:"#efeac8"},"landcover-ice":{color:"#d5e8f1"},"landcover-wetland":{color:"#badbde"},"landuse-residential":{color:"#e4e1e0"},"landuse-industrial":{color:"#dadce7"},"landuse-civic":{color:"#ecdae0"},"landuse-sport":{color:"#bbeba2"},"landuse-cemetery":{color:"#c2e2bb"},"landuse-parking":{color:"#d6d4d4"},park:{color:"#b2e6a8"},"aeroway-area":{color:"#d6dbeb"},water:{color:"#94d8f9"},waterway:{color:"#94d8f9"},"aeroway-line":{color:"#dfdcd9"},"road-casing-major":{color:"#8997b3"},"road-casing-secondary":{color:{stops:[[16,"#9da7be"],[18.5,"#8997b3"]]}},"road-casing-minor":{color:{stops:[[16,"#9da7be"],[18.5,"#8997b3"]]}},"road-rail":{color:"#9e9e9e"},"road-path":{color:"#bbc1d3"},"road-minor":{color:{stops:[[16,"#bbc1d3"],[18.5,"#99abc2"]]}},"road-secondary":{color:{stops:[[16,"#bbc1d3"],[18.5,"#99abc2"]]}},"road-ramp":{color:"#99abc2"},"road-major":{color:"#99abc2"},boundary:{color:"#f66f91"},building:{color:"#ffffff",roofColor:"#f2f1f0",aoStrength:.19,tintVariation:0,windowColor:"#6b9ed1",windowFrameColor:"#eef0f4",windowGlow:0},housenumber:{color:"#2e2e2e",haloColor:"#ffffff",haloWidth:1.4},poi:{color:"#4caaf3",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:"#f4882c",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#a269e7",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#4677e8",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#f86776",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#2ac1d4",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#cc5e3c",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#2db375",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#a66fe8",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#6e87bf",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"water-pool":{color:"#a7e1fd"},"indoor-shell":{color:"#f4f3f1",opacity:.97},"indoor-corridor":{color:"#f8f8f6"},"indoor-room":{color:"#eeece8"},"indoor-service":{color:"#ddd8d2"},"indoor-shop":{color:"#e0dae7"},"indoor-food":{color:"#e7e1da"},"indoor-wc":{color:"#dae2e7"},"indoor-wall":{color:"#cecac5",roofColor:"#e0dedc",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#ccc6d9",opacity:.95},"indoor-door":{color:"#586e84",haloColor:"#ffffff",haloWidth:1.4},"indoor-poi":{color:"#586e84",haloColor:"#ffffff",haloWidth:1.4},"indoor-name":{color:"#2e2e2e",haloColor:"#ffffff",haloWidth:1.4},"building-entrance":{color:"#225aaa",haloColor:"#ffffff"}},sky:{skyColor:"#91b8cb",horizonColor:"#dfd9d6",fogRange:[2.41,9.94],fogIntensity:.86,spaceColor:"#0e0b0a",atmosphereColor:"#5daad0",starIntensity:.38}};var Jf={name:"\u041C\u0443\u043B\u044C\u0442\u044F\u0448\u043D\u0430\u044F",background:"#f7f3de",light:{ambientColor:"#f8f7f7",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#ffffff",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#dee8ed",fillIntensity:.18},paint:{"landcover-wood":{color:"#61d161"},"landcover-grass":{color:"#91e481"},"landcover-sand":{color:"#efeac8"},"landcover-ice":{color:"#c7dfeb"},"landcover-wetland":{color:"#9fccd1"},"landuse-residential":{color:"#f2ecd9"},"landuse-industrial":{color:"#d7d9e4"},"landuse-civic":{color:"#ead7dd"},"landuse-sport":{color:"#9fec79"},"landuse-cemetery":{color:"#a8d69f"},"landuse-parking":{color:"#dddcda"},park:{color:"#91e481"},"aeroway-area":{color:"#d6dbeb"},water:{color:"#71c8f4"},waterway:{color:"#71c8f4"},"aeroway-line":{color:"#f0ede9"},"road-casing-major":{color:"#ca6a16"},"road-casing-secondary":{color:{stops:[[16,"#5a6faf"],[18.5,"#ca6a16"]]}},"road-casing-minor":{color:{stops:[[16,"#5a6faf"],[18.5,"#ca6a16"]]}},"road-rail":{color:"#737373"},"road-path":{color:"#ffffff"},"road-minor":{color:{stops:[[16,"#ffffff"],[18.5,"#f8c662"]]}},"road-secondary":{color:{stops:[[16,"#ffffff"],[18.5,"#f8c662"]]}},"road-ramp":{color:"#f8c662"},"road-major":{color:"#f8c662"},boundary:{color:"#f6517a"},building:{color:"#f4dfc2",roofColor:"#f4dfc2",aoStrength:.19,tintVariation:.06,windowColor:"#5b9ee0",windowFrameColor:"#ffffff",windowGlow:0},housenumber:{color:"#222b59",haloColor:"#ffffff",haloWidth:1.4},poi:{color:"#f05a0f",haloColor:"#ffffff",haloWidth:1.4},"road-label":{color:"#222b59",haloColor:"#ffffff",haloWidth:1.4},"water-label":{color:"#35688d",haloColor:"#f7f7f7",haloWidth:1.4},"place-label":{color:"#222b59",haloColor:"#ffffff",haloWidth:1.4},"poi-food":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#c2681c",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#2f77c4",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#3b82a6",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#c24444",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#3f7f7a",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#8b5aa5",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#4f8b45",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#7a5fbf",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#59636e",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"water-pool":{color:"#80d1fa"},"indoor-shell":{color:"#ebe9e5",opacity:.97},"indoor-corridor":{color:"#efedea"},"indoor-room":{color:"#e5e1dc"},"indoor-service":{color:"#d4cec6"},"indoor-shop":{color:"#d6cede"},"indoor-food":{color:"#ded6ce"},"indoor-wc":{color:"#ced8de"},"indoor-wall":{color:"#c4c0ba",roofColor:"#d6d4d0",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#c1b9d1",opacity:.95},"indoor-door":{color:"#f05a0f",haloColor:"#ffffff",haloWidth:1.4},"indoor-poi":{color:"#f05a0f",haloColor:"#ffffff",haloWidth:1.4},"indoor-name":{color:"#222b59",haloColor:"#ffffff",haloWidth:1.4},"building-entrance":{color:"#225aaa",haloColor:"#ffffff"}},sky:{skyColor:"#8cb5c9",horizonColor:"#e8e2c7",fogRange:[2.41,9.92],fogIntensity:.86,spaceColor:"#131105",atmosphereColor:"#5ca9d0",starIntensity:.39}};var jf={name:"\u041A\u0438\u0431\u0435\u0440\u043F\u0430\u043D\u043A",background:"#120817",model3dKey:"night",light:{ambientColor:"#b279cf",ambientIntensity:.34,keyAzimuth:120,keyAltitude:55,keyColor:"#ff70d0",keyIntensity:.28,fillAzimuth:300,fillAltitude:25,fillColor:"#854770",fillIntensity:.22},paint:{"landcover-wood":{color:"#0c3728"},"landcover-grass":{color:"#104131"},"landcover-sand":{color:"#262417"},"landcover-ice":{color:"#74345f"},"landcover-wetland":{color:"#152223"},"landuse-residential":{color:"#170b1e"},"landuse-industrial":{color:"#171921"},"landuse-civic":{color:"#21171a"},"landuse-sport":{color:"#0c4529"},"landuse-cemetery":{color:"#151e1b"},"landuse-parking":{color:"#272428"},park:{color:"#104131"},"aeroway-area":{color:"#1a1c23"},water:{color:"#5f1145"},waterway:{color:"#711452"},"aeroway-line":{color:"#55493a"},"road-casing-major":{color:"#981662"},"road-casing-secondary":{color:{stops:[[16,"#6a1b6a"],[18.5,"#981662"]]}},"road-casing-minor":{color:{stops:[[16,"#6a1b6a"],[18.5,"#981662"]]}},"road-rail":{color:"#39acac"},"road-path":{color:"#12e2e2"},"road-minor":{color:{stops:[[16,"#12e2e2"],[18.5,"#f631a4"]]}},"road-secondary":{color:{stops:[[16,"#12e2e2"],[18.5,"#f631a4"]]}},"road-ramp":{color:"#f631a4"},"road-major":{color:"#f631a4"},boundary:{color:"#f53da8"},building:{color:"#311839",roofColor:"#9d2575",aoStrength:.29,tintVariation:.1,windowColor:"#84dcff",windowFrameColor:"#84dcff",windowGlow:.5},housenumber:{color:"#acf6f6",haloColor:"#110514",haloWidth:1.4},poi:{color:"#f6e95a",haloColor:"#110514",haloWidth:1.4},"road-label":{color:"#acf6f6",haloColor:"#110514",haloWidth:1.4},"water-label":{color:"#9fbcd1",haloColor:"#131b20",haloWidth:1.4},"place-label":{color:"#acf6f6",haloColor:"#110514",haloWidth:1.4},"poi-food":{color:"#d89964",haloColor:"#110514",haloWidth:1.4,frameColor:"#d89964",frameOpacity:1,frameHaloColor:"#110514",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-shop":{color:"#699cd4",haloColor:"#110514",haloWidth:1.4,frameColor:"#699cd4",frameOpacity:1,frameHaloColor:"#110514",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-transport":{color:"#75acc8",haloColor:"#110514",haloWidth:1.4,frameColor:"#75acc8",frameOpacity:1,frameHaloColor:"#110514",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-health":{color:"#ca7272",haloColor:"#110514",haloWidth:1.4,frameColor:"#ca7272",frameOpacity:1,frameHaloColor:"#110514",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-education":{color:"#81bbb7",haloColor:"#110514",haloWidth:1.4,frameColor:"#81bbb7",frameOpacity:1,frameHaloColor:"#110514",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-culture":{color:"#a684b8",haloColor:"#110514",haloWidth:1.4,frameColor:"#a684b8",frameOpacity:1,frameHaloColor:"#110514",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-sport":{color:"#89bb81",haloColor:"#110514",haloWidth:1.4,frameColor:"#89bb81",frameOpacity:1,frameHaloColor:"#110514",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-lodging":{color:"#8e79c3",haloColor:"#110514",haloWidth:1.4,frameColor:"#8e79c3",frameOpacity:1,frameHaloColor:"#110514",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-service":{color:"#959ea7",haloColor:"#110514",haloWidth:1.4,frameColor:"#959ea7",frameOpacity:1,frameHaloColor:"#110514",iconColor:"#1b1b1b",iconHaloWidth:0},"water-pool":{color:"#84135f"},"indoor-shell":{color:"#4c3752",opacity:.97},"indoor-corridor":{color:"#46334c"},"indoor-room":{color:"#553e5d"},"indoor-service":{color:"#6e5078"},"indoor-shop":{color:"#59446f"},"indoor-food":{color:"#6f5a44"},"indoor-wc":{color:"#445e6f"},"indoor-wall":{color:"#7b6681",roofColor:"#938298",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#635287",opacity:.95},"indoor-door":{color:"#f6e95a",haloColor:"#110514",haloWidth:1.4},"indoor-poi":{color:"#f6e95a",haloColor:"#110514",haloWidth:1.4},"indoor-name":{color:"#acf6f6",haloColor:"#110514",haloWidth:1.4},"building-entrance":{color:"#79a0d7",haloColor:"#110514"}},sky:{skyColor:"#180813",horizonColor:"#281831",fogRange:[2.34,8.77],fogIntensity:.9,spaceColor:"#060308",atmosphereColor:"#b5358b",starIntensity:.82}};var Yf={name:"\u0420\u0430\u0441\u0441\u0432\u0435\u0442",background:"#f4ebe1",light:{ambientColor:"#f8f7f7",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#ffe0c0",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#dee7ed",fillIntensity:.18},paint:{"landcover-wood":{color:"#a4db9f"},"landcover-grass":{color:"#bae7b1"},"landcover-sand":{color:"#efeac8"},"landcover-ice":{color:"#dbe7f0"},"landcover-wetland":{color:"#c1dee1"},"landuse-residential":{color:"#f5efeb"},"landuse-industrial":{color:"#d7d9e4"},"landuse-civic":{color:"#ead7dd"},"landuse-sport":{color:"#c1ecac"},"landuse-cemetery":{color:"#c8e5c2"},"landuse-parking":{color:"#dddbda"},park:{color:"#bae7b1"},"aeroway-area":{color:"#d6dbeb"},water:{color:"#a6d2f2"},waterway:{color:"#a6d2f2"},"aeroway-line":{color:"#f0ede9"},"road-casing-major":{color:"#92a1bf"},"road-casing-secondary":{color:{stops:[[16,"#a6afc9"],[18.5,"#92a1bf"]]}},"road-casing-minor":{color:{stops:[[16,"#a6afc9"],[18.5,"#92a1bf"]]}},"road-rail":{color:"#b5a49b"},"road-path":{color:"#c3c9df"},"road-minor":{color:{stops:[[16,"#c3c9df"],[18.5,"#a9b9d1"]]}},"road-secondary":{color:{stops:[[16,"#c3c9df"],[18.5,"#a9b9d1"]]}},"road-ramp":{color:"#a9b9d1"},"road-major":{color:"#a9b9d1"},boundary:{color:"#f584a1"},building:{color:"#f6ebdf",roofColor:"#fdede7",aoStrength:.19,tintVariation:.06,windowColor:"#6b9ed1",windowFrameColor:"#f0ece8",windowGlow:0},housenumber:{color:"#46332a",haloColor:"#fdfaf7",haloWidth:1.4},poi:{color:"#56738f",haloColor:"#fdfaf7",haloWidth:1.4},"road-label":{color:"#46332a",haloColor:"#fdfaf7",haloWidth:1.4},"water-label":{color:"#35688d",haloColor:"#f7f7f7",haloWidth:1.4},"place-label":{color:"#46332a",haloColor:"#fdfaf7",haloWidth:1.4},"poi-food":{haloColor:"#fdfaf7",haloWidth:1.4,frameColor:"#c2681c",frameOpacity:1,frameHaloColor:"#fdfaf7",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{haloColor:"#fdfaf7",haloWidth:1.4,frameColor:"#2f77c4",frameOpacity:1,frameHaloColor:"#fdfaf7",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{haloColor:"#fdfaf7",haloWidth:1.4,frameColor:"#3b82a6",frameOpacity:1,frameHaloColor:"#fdfaf7",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{haloColor:"#fdfaf7",haloWidth:1.4,frameColor:"#c24444",frameOpacity:1,frameHaloColor:"#fdfaf7",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{haloColor:"#fdfaf7",haloWidth:1.4,frameColor:"#3f7f7a",frameOpacity:1,frameHaloColor:"#fdfaf7",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{haloColor:"#fdfaf7",haloWidth:1.4,frameColor:"#8b5aa5",frameOpacity:1,frameHaloColor:"#fdfaf7",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{haloColor:"#fdfaf7",haloWidth:1.4,frameColor:"#4f8b45",frameOpacity:1,frameHaloColor:"#fdfaf7",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{haloColor:"#fdfaf7",haloWidth:1.4,frameColor:"#7a5fbf",frameOpacity:1,frameHaloColor:"#fdfaf7",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{haloColor:"#fdfaf7",haloWidth:1.4,frameColor:"#59636e",frameOpacity:1,frameHaloColor:"#fdfaf7",iconColor:"#ffffff",iconHaloWidth:0},"water-pool":{color:"#b9ddf7"},"indoor-shell":{color:"#f8f7f5",opacity:.97},"indoor-corridor":{color:"#fcfbfb"},"indoor-room":{color:"#f1efed"},"indoor-service":{color:"#e0dbd6"},"indoor-shop":{color:"#e4dfea"},"indoor-food":{color:"#eae4df"},"indoor-wc":{color:"#dfe5ea"},"indoor-wall":{color:"#d1cdc9",roofColor:"#e4e2e0",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#d0cbdc",opacity:.95},"indoor-door":{color:"#56738f",haloColor:"#fdfaf7",haloWidth:1.4},"indoor-poi":{color:"#56738f",haloColor:"#fdfaf7",haloWidth:1.4},"indoor-name":{color:"#46332a",haloColor:"#fdfaf7",haloWidth:1.4},"building-entrance":{color:"#225aaa",haloColor:"#fdfaf7"}},sky:{skyColor:"#8cb0c9",horizonColor:"#e4d7cb",fogRange:[2.41,9.92],fogIntensity:.86,spaceColor:"#120c07",atmosphereColor:"#5c9fd0",starIntensity:.39}};var Zf={name:"\u0421\u0443\u043C\u0435\u0440\u043A\u0438",background:"#d7cbc1",light:{ambientColor:"#ececeb",ambientIntensity:.46,keyAzimuth:120,keyAltitude:59,keyColor:"#ffcaa0",keyIntensity:.56,fillAzimuth:300,fillAltitude:25,fillColor:"#c7d0e1",fillIntensity:.19},paint:{"landcover-wood":{color:"#75af6a"},"landcover-grass":{color:"#94bd7f"},"landcover-sand":{color:"#efeac8"},"landcover-ice":{color:"#c1c8d7"},"landcover-wetland":{color:"#83bec3"},"landuse-residential":{color:"#d5cac3"},"landuse-industrial":{color:"#b3b7cc"},"landuse-civic":{color:"#d5aebb"},"landuse-sport":{color:"#91c775"},"landuse-cemetery":{color:"#9ac982"},"landuse-parking":{color:"#c0bcb9"},park:{color:"#94bd7f"},"aeroway-area":{color:"#d6dbeb"},water:{color:"#708bc2"},waterway:{color:"#708bc2"},"aeroway-line":{color:"#f0ede9"},"road-casing-major":{color:"#6a5b9a"},"road-casing-secondary":{color:{stops:[[16,"#7078a4"],[18.5,"#6a5b9a"]]}},"road-casing-minor":{color:{stops:[[16,"#7078a4"],[18.5,"#6a5b9a"]]}},"road-rail":{color:"#93796c"},"road-path":{color:"#8f94b7"},"road-minor":{color:{stops:[[16,"#8f94b7"],[18.5,"#8576b2"]]}},"road-secondary":{color:{stops:[[16,"#8f94b7"],[18.5,"#8576b2"]]}},"road-ramp":{color:"#8576b2"},"road-major":{color:"#8576b2"},boundary:{color:"#e05275"},building:{color:"#e0d1c2",roofColor:"#f1d6cb",aoStrength:.2,tintVariation:.07,windowColor:"#6b9ed1",windowFrameColor:"#efe6df",windowGlow:0},housenumber:{color:"#2c283e",haloColor:"#f5ebe0",haloWidth:1.4},poi:{color:"#64568f",haloColor:"#f5ebe0",haloWidth:1.4},"road-label":{color:"#2c283e",haloColor:"#f5ebe0",haloWidth:1.4},"water-label":{color:"#35688d",haloColor:"#f7f7f7",haloWidth:1.4},"place-label":{color:"#2c283e",haloColor:"#f5ebe0",haloWidth:1.4},"poi-food":{haloColor:"#f5ebe0",haloWidth:1.4,frameColor:"#c2681c",frameOpacity:1,frameHaloColor:"#f5ebe0",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{haloColor:"#f5ebe0",haloWidth:1.4,frameColor:"#2f77c4",frameOpacity:1,frameHaloColor:"#f5ebe0",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{haloColor:"#f5ebe0",haloWidth:1.4,frameColor:"#3b82a6",frameOpacity:1,frameHaloColor:"#f5ebe0",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{haloColor:"#f5ebe0",haloWidth:1.4,frameColor:"#c24444",frameOpacity:1,frameHaloColor:"#f5ebe0",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{haloColor:"#f5ebe0",haloWidth:1.4,frameColor:"#3f7f7a",frameOpacity:1,frameHaloColor:"#f5ebe0",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{haloColor:"#f5ebe0",haloWidth:1.4,frameColor:"#8b5aa5",frameOpacity:1,frameHaloColor:"#f5ebe0",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{haloColor:"#f5ebe0",haloWidth:1.4,frameColor:"#4f8b45",frameOpacity:1,frameHaloColor:"#f5ebe0",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{haloColor:"#f5ebe0",haloWidth:1.4,frameColor:"#7a5fbf",frameOpacity:1,frameHaloColor:"#f5ebe0",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{haloColor:"#f5ebe0",haloWidth:1.4,frameColor:"#59636e",frameOpacity:1,frameHaloColor:"#f5ebe0",iconColor:"#ffffff",iconHaloWidth:0},"water-pool":{color:"#7a94ca"},"indoor-shell":{color:"#e3deda",opacity:.97},"indoor-corridor":{color:"#e7e3df"},"indoor-room":{color:"#dcd7d1"},"indoor-service":{color:"#cbc3ba"},"indoor-shop":{color:"#ccc2d6"},"indoor-food":{color:"#d6ccc2"},"indoor-wc":{color:"#c2ced6"},"indoor-wall":{color:"#bbb5af",roofColor:"#cdc9c6",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#b6adc9",opacity:.95},"indoor-door":{color:"#64568f",haloColor:"#f5ebe0",haloWidth:1.4},"indoor-poi":{color:"#64568f",haloColor:"#f5ebe0",haloWidth:1.4},"indoor-name":{color:"#2c283e",haloColor:"#f5ebe0",haloWidth:1.4},"building-entrance":{haloColor:"#f5ebe0"}},sky:{skyColor:"#5675b3",horizonColor:"#c0b4aa",fogRange:[2.39,9.64],fogIntensity:.87,spaceColor:"#0e0b09",atmosphereColor:"#557dce",starIntensity:.45}};var qf={name:"\u0417\u0435\u043C\u043B\u044F",background:"#dbd1bd",light:{ambientColor:"#edecea",ambientIntensity:.46,keyAzimuth:120,keyAltitude:59,keyColor:"#fff2dc",keyIntensity:.56,fillAzimuth:300,fillAltitude:25,fillColor:"#c7d6e1",fillIntensity:.19},paint:{"landcover-wood":{color:"#50a136"},"landcover-grass":{color:"#8ac76b"},"landcover-sand":{color:"#efeac8"},"landcover-ice":{color:"#aec5d6"},"landcover-wetland":{color:"#7cbac0"},"landuse-residential":{color:"#ded5c4"},"landuse-industrial":{color:"#b3b7cc"},"landuse-civic":{color:"#d5aebb"},"landuse-sport":{color:"#86d161"},"landuse-cemetery":{color:"#94c67b"},"landuse-parking":{color:"#c0beb9"},park:{color:"#8ac76b"},"aeroway-area":{color:"#d6dbeb"},water:{color:"#3b91ce"},waterway:{color:"#4798d1"},"aeroway-line":{color:"#f0ede9"},"road-casing-major":{color:"#a47546"},"road-casing-secondary":{color:{stops:[[16,"#a79376"],[18.5,"#a47546"]]}},"road-casing-minor":{color:{stops:[[16,"#a79376"],[18.5,"#a47546"]]}},"road-rail":{color:"#877564"},"road-path":{color:"#c6bba9"},"road-minor":{color:{stops:[[16,"#c6bba9"],[18.5,"#cdaa7a"]]}},"road-secondary":{color:{stops:[[16,"#c6bba9"],[18.5,"#cdaa7a"]]}},"road-ramp":{color:"#cdaa7a"},"road-major":{color:"#cdaa7a"},boundary:{color:"#bf6a40"},building:{color:"#d4c5af",roofColor:"#d4c5af",aoStrength:.2,tintVariation:.07,windowColor:"#9fb0c0",windowFrameColor:"#eceae4",windowGlow:0},housenumber:{color:"#46382a",haloColor:"#f7f4ee",haloWidth:1.4},poi:{color:"#7c5c3c",haloColor:"#f7f4ee",haloWidth:1.4},"road-label":{color:"#46382a",haloColor:"#f7f4ee",haloWidth:1.4},"water-label":{color:"#35688d",haloColor:"#f7f7f7",haloWidth:1.4},"place-label":{color:"#46382a",haloColor:"#f7f4ee",haloWidth:1.4},"poi-food":{haloColor:"#f7f4ee",haloWidth:1.4,frameColor:"#c2681c",frameOpacity:1,frameHaloColor:"#f7f4ee",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{haloColor:"#f7f4ee",haloWidth:1.4,frameColor:"#2f77c4",frameOpacity:1,frameHaloColor:"#f7f4ee",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{haloColor:"#f7f4ee",haloWidth:1.4,frameColor:"#3b82a6",frameOpacity:1,frameHaloColor:"#f7f4ee",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{haloColor:"#f7f4ee",haloWidth:1.4,frameColor:"#c24444",frameOpacity:1,frameHaloColor:"#f7f4ee",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{haloColor:"#f7f4ee",haloWidth:1.4,frameColor:"#3f7f7a",frameOpacity:1,frameHaloColor:"#f7f4ee",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{haloColor:"#f7f4ee",haloWidth:1.4,frameColor:"#8b5aa5",frameOpacity:1,frameHaloColor:"#f7f4ee",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{haloColor:"#f7f4ee",haloWidth:1.4,frameColor:"#4f8b45",frameOpacity:1,frameHaloColor:"#f7f4ee",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{haloColor:"#f7f4ee",haloWidth:1.4,frameColor:"#7a5fbf",frameOpacity:1,frameHaloColor:"#f7f4ee",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{haloColor:"#f7f4ee",haloWidth:1.4,frameColor:"#59636e",frameOpacity:1,frameHaloColor:"#f7f4ee",iconColor:"#ffffff",iconHaloWidth:0},"water-pool":{color:"#4299d7"},"indoor-shell":{color:"#d6d0c8",opacity:.97},"indoor-corridor":{color:"#d9d5cd"},"indoor-room":{color:"#cfc9bf"},"indoor-service":{color:"#beb5a9"},"indoor-shop":{color:"#bcafca"},"indoor-food":{color:"#cabdaf"},"indoor-wc":{color:"#afbfca"},"indoor-wall":{color:"#ada79e",roofColor:"#bebbb5",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#a69bbc",opacity:.95},"indoor-door":{color:"#7c5c3c",haloColor:"#f7f4ee",haloWidth:1.4},"indoor-poi":{color:"#7c5c3c",haloColor:"#f7f4ee",haloWidth:1.4},"indoor-name":{color:"#46382a",haloColor:"#f7f4ee",haloWidth:1.4},"building-entrance":{haloColor:"#f7f4ee"}},sky:{skyColor:"#568db3",horizonColor:"#c4baa5",fogRange:[2.39,9.64],fogIntensity:.87,spaceColor:"#0f0c08",atmosphereColor:"#559cce",starIntensity:.45}};var Qf={name:"\u0424\u0443\u0442\u0443\u0440\u0438\u0437\u043C",background:"#0c0f1d",model3dKey:"night",light:{ambientColor:"#8590c7",ambientIntensity:.34,keyAzimuth:120,keyAltitude:55,keyColor:"#8ff0ff",keyIntensity:.28,fillAzimuth:300,fillAltitude:25,fillColor:"#477b85",fillIntensity:.22},paint:{"landcover-wood":{color:"#123026"},"landcover-grass":{color:"#18392e"},"landcover-sand":{color:"#2d2a1b"},"landcover-ice":{color:"#276672"},"landcover-wetland":{color:"#192829"},"landuse-residential":{color:"#111422"},"landuse-industrial":{color:"#1b1d27"},"landuse-civic":{color:"#271b1f"},"landuse-sport":{color:"#143d29"},"landuse-cemetery":{color:"#192420"},"landuse-parking":{color:"#292a2e"},park:{color:"#18392e"},"aeroway-area":{color:"#1e2129"},water:{color:"#055261"},waterway:{color:"#076a7e"},"aeroway-line":{color:"#55493a"},"road-casing-major":{color:"#8b238b"},"road-casing-secondary":{color:{stops:[[16,"#185662"],[18.5,"#8b238b"]]}},"road-casing-minor":{color:{stops:[[16,"#185662"],[18.5,"#8b238b"]]}},"road-rail":{color:"#8546a4"},"road-path":{color:"#22b6c3"},"road-minor":{color:{stops:[[16,"#22b6c3"],[18.5,"#e03ee0"]]}},"road-secondary":{color:{stops:[[16,"#22b6c3"],[18.5,"#e03ee0"]]}},"road-ramp":{color:"#e03ee0"},"road-major":{color:"#e03ee0"},boundary:{color:"#eb47eb"},building:{color:"#1e2b3e",roofColor:"#277686",aoStrength:.29,tintVariation:.1,windowColor:"#84dcff",windowFrameColor:"#bfe6ff",windowGlow:.5},housenumber:{color:"#c6edf1",haloColor:"#080a17",haloWidth:1.4},poi:{color:"#eb84eb",haloColor:"#080a17",haloWidth:1.4},"road-label":{color:"#c6edf1",haloColor:"#080a17",haloWidth:1.4},"water-label":{color:"#9fbcd1",haloColor:"#131b20",haloWidth:1.4},"place-label":{color:"#c6edf1",haloColor:"#080a17",haloWidth:1.4},"poi-food":{color:"#d89964",haloColor:"#080a17",haloWidth:1.4,frameColor:"#d89964",frameOpacity:1,frameHaloColor:"#080a17",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-shop":{color:"#699cd4",haloColor:"#080a17",haloWidth:1.4,frameColor:"#699cd4",frameOpacity:1,frameHaloColor:"#080a17",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-transport":{color:"#75acc8",haloColor:"#080a17",haloWidth:1.4,frameColor:"#75acc8",frameOpacity:1,frameHaloColor:"#080a17",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-health":{color:"#ca7272",haloColor:"#080a17",haloWidth:1.4,frameColor:"#ca7272",frameOpacity:1,frameHaloColor:"#080a17",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-education":{color:"#81bbb7",haloColor:"#080a17",haloWidth:1.4,frameColor:"#81bbb7",frameOpacity:1,frameHaloColor:"#080a17",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-culture":{color:"#a684b8",haloColor:"#080a17",haloWidth:1.4,frameColor:"#a684b8",frameOpacity:1,frameHaloColor:"#080a17",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-sport":{color:"#89bb81",haloColor:"#080a17",haloWidth:1.4,frameColor:"#89bb81",frameOpacity:1,frameHaloColor:"#080a17",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-lodging":{color:"#8e79c3",haloColor:"#080a17",haloWidth:1.4,frameColor:"#8e79c3",frameOpacity:1,frameHaloColor:"#080a17",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-service":{color:"#959ea7",haloColor:"#080a17",haloWidth:1.4,frameColor:"#959ea7",frameOpacity:1,frameHaloColor:"#080a17",iconColor:"#1b1b1b",iconHaloWidth:0},"water-pool":{color:"#027288"},"indoor-shell":{color:"#394556",opacity:.97},"indoor-corridor":{color:"#354050"},"indoor-room":{color:"#404d60"},"indoor-service":{color:"#52637b"},"indoor-shop":{color:"#5c4672"},"indoor-food":{color:"#725d46"},"indoor-wc":{color:"#466172"},"indoor-wall":{color:"#687485",roofColor:"#858e9a",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#66558a",opacity:.95},"indoor-door":{color:"#eb84eb",haloColor:"#080a17",haloWidth:1.4},"indoor-poi":{color:"#eb84eb",haloColor:"#080a17",haloWidth:1.4},"indoor-name":{color:"#c6edf1",haloColor:"#080a17",haloWidth:1.4},"building-entrance":{color:"#79a0d7",haloColor:"#080a17"}},sky:{skyColor:"#081619",horizonColor:"#1b1f30",fogRange:[2.34,8.79],fogIntensity:.9,spaceColor:"#030408",atmosphereColor:"#35a1b7",starIntensity:.81}};var $f={name:"\u0421\u0442\u0435\u043A\u043B\u043E \u043C\u044F\u0433\u043A\u043E\u0435",background:"#f2f5f7",light:{ambientColor:"#fbfbfb",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#ffffff",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#dee9ed",fillIntensity:.18},paint:{"landcover-wood":{color:"#bddbc3"},"landcover-grass":{color:"#d0ecda"},"landcover-sand":{color:"#efeac8"},"landcover-ice":{color:"#cbebdb"},"landcover-wetland":{color:"#d9ebed"},"landuse-residential":{color:"#f6f7f9"},"landuse-industrial":{color:"#e3e5ed"},"landuse-civic":{color:"#f1e4e8"},"landuse-sport":{color:"#cdefd4"},"landuse-cemetery":{color:"#dbf0e3"},"landuse-parking":{color:"#e4e6e7"},park:{color:"#ccead9"},"aeroway-area":{color:"#d6dbeb"},water:{color:"#b9e5f4"},waterway:{color:"#81c6e4"},"aeroway-line":{color:"#f0ede9"},"road-casing-major":{color:"#dabc95"},"road-casing-secondary":{color:{stops:[[16,"#d5cdb8"],[18.5,"#dabc95"]]}},"road-casing-minor":{color:{stops:[[16,"#cad1d8"],[18.5,"#dabc95"]]}},"road-rail":{color:"#a5a0b1"},"road-path":{color:"#9fbcad"},"road-minor":{color:{stops:[[16,"#ffffff"],[18.5,"#f8e5c3"]]}},"road-secondary":{color:{stops:[[16,"#fbf6ea"],[18.5,"#f8e5c3"]]}},"road-ramp":{color:"#f8e5c3"},"road-major":{color:"#f8e5c3"},boundary:{color:"#ce97c0"},building:{color:"#e5ebf0",roofColor:"#f7fbfd",aoStrength:.18,tintVariation:.06,windowColor:"#bcd4e8",windowFrameColor:"#dfe8f2",windowGlow:0},housenumber:{color:"#4e6779",haloColor:"#fbfdfe",haloWidth:1.4},poi:{color:"#4e6779",haloColor:"#fbfdfe",haloWidth:1.4},"road-label":{color:"#2f3f50",haloColor:"#fbfdfe",haloWidth:1.4},"water-label":{color:"#35688d",haloColor:"#f7f7f7",haloWidth:1.4},"place-label":{color:"#2f3f50",haloColor:"#fbfdfe",haloWidth:1.4},"poi-food":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#c2681c",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#2f77c4",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#3b82a6",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#c24444",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#3f7f7a",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#8b5aa5",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#4f8b45",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#7a5fbf",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#59636e",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"water-pool":{color:"#ceeef9"},"indoor-shell":{color:"#f5f7f8",opacity:.97},"indoor-corridor":{color:"#fbfbfc"},"indoor-room":{color:"#edeff1"},"indoor-service":{color:"#d6dce0"},"indoor-shop":{color:"#e4dfea"},"indoor-food":{color:"#eae4df"},"indoor-wc":{color:"#dfe5ea"},"indoor-wall":{color:"#c9ced1",roofColor:"#e0e2e4",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#d0cbdc",opacity:.95},"indoor-door":{color:"#4e6779",haloColor:"#fbfdfe",haloWidth:1.4},"indoor-poi":{color:"#4e6779",haloColor:"#fbfdfe",haloWidth:1.4},"indoor-name":{color:"#2f3f50",haloColor:"#fbfdfe",haloWidth:1.4},"building-entrance":{color:"#225aaa",haloColor:"#fbfdfe"}},sky:{skyColor:"#9fc5d2",horizonColor:"#dfe3e8",fogRange:[2.43,10.02],fogIntensity:.85,spaceColor:"#090c0f",atmosphereColor:"#5fb3d0",starIntensity:.37}};var eu={name:"\u0421\u0442\u0435\u043A\u043B\u043E",background:"#f2f5f7",light:{ambientColor:"#fbfbfb",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#ffffff",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#dee9ed",fillIntensity:.18},paint:{"landcover-wood":{color:"#b8e0cf"},"landcover-grass":{color:"#cbebdb"},"landcover-sand":{color:"#efeac8"},"landcover-ice":{color:"#e5f0f3"},"landcover-wetland":{color:"#d6e9eb"},"landuse-residential":{color:"#f6f7f9"},"landuse-industrial":{color:"#e3e5ed"},"landuse-civic":{color:"#f1e4e8"},"landuse-sport":{color:"#c8efd5"},"landuse-cemetery":{color:"#d8eee3"},"landuse-parking":{color:"#e4e6e7"},park:{color:"#cbebdb"},"aeroway-area":{color:"#d6dbeb"},water:{color:"#bee6f4"},waterway:{color:"#bee6f4"},"aeroway-line":{color:"#f0ede9"},"road-casing-major":{color:"#9dc7dd"},"road-casing-secondary":{color:{stops:[[16,"#bdcfdb"],[18.5,"#9dc7dd"]]}},"road-casing-minor":{color:{stops:[[16,"#bdcfdb"],[18.5,"#9dc7dd"]]}},"road-rail":{color:"#adb9c2"},"road-path":{color:"#d6e2eb"},"road-minor":{color:{stops:[[16,"#d6e2eb"],[18.5,"#b8daea"]]}},"road-secondary":{color:{stops:[[16,"#d6e2eb"],[18.5,"#b8daea"]]}},"road-ramp":{color:"#b8daea"},"road-major":{color:"#b8daea"},boundary:{color:"#e28dc6"},building:{color:"#e8eef3",roofColor:"#f4f8fb",aoStrength:.18,tintVariation:.06,windowColor:"#bcd4e8",windowFrameColor:"#dfe8f2",windowGlow:0},housenumber:{color:"#2d4053",haloColor:"#fbfdfe",haloWidth:1.4},poi:{color:"#457aa1",haloColor:"#fbfdfe",haloWidth:1.4},"road-label":{color:"#2d4053",haloColor:"#fbfdfe",haloWidth:1.4},"water-label":{color:"#35688d",haloColor:"#f7f7f7",haloWidth:1.4},"place-label":{color:"#2d4053",haloColor:"#fbfdfe",haloWidth:1.4},"poi-food":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#c2681c",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#2f77c4",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#3b82a6",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#c24444",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#3f7f7a",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#8b5aa5",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#4f8b45",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#7a5fbf",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#59636e",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"water-pool":{color:"#d3eff9"},"indoor-shell":{color:"#f5f7f8",opacity:.97},"indoor-corridor":{color:"#fbfbfc"},"indoor-room":{color:"#edeff1"},"indoor-service":{color:"#d6dce0"},"indoor-shop":{color:"#e4dfea"},"indoor-food":{color:"#eae4df"},"indoor-wc":{color:"#dfe5ea"},"indoor-wall":{color:"#c9ced1",roofColor:"#e0e2e4",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#d0cbdc",opacity:.95},"indoor-door":{color:"#457aa1",haloColor:"#fbfdfe",haloWidth:1.4},"indoor-poi":{color:"#457aa1",haloColor:"#fbfdfe",haloWidth:1.4},"indoor-name":{color:"#2d4053",haloColor:"#fbfdfe",haloWidth:1.4},"building-entrance":{color:"#225aaa",haloColor:"#fbfdfe"}},sky:{skyColor:"#9fc5d2",horizonColor:"#dfe3e8",fogRange:[2.43,10.02],fogIntensity:.85,spaceColor:"#090c10",atmosphereColor:"#5fb3d0",starIntensity:.37}};var tu={name:"\u0413\u0430\u0440\u043C\u043E\u043D\u0438\u044F \u0447\u0451\u0440\u043D\u0430\u044F",background:"#1a1a1a",model3dKey:"night",light:{ambientColor:"#a8a8a8",ambientIntensity:.34,keyAzimuth:120,keyAltitude:55,keyColor:"#cccccc",keyIntensity:.29,fillAzimuth:300,fillAltitude:25,fillColor:"#854747",fillIntensity:.22},paint:{"landcover-wood":{color:"#212121"},"landcover-grass":{color:"#292929"},"landcover-sand":{color:"#33301f"},"landcover-ice":{color:"#545454"},"landcover-wetland":{color:"#1d2e30"},"landuse-residential":{color:"#1f1f1f"},"landuse-industrial":{color:"#1f222d"},"landuse-civic":{color:"#2d1f24"},"landuse-sport":{color:"#2d2525"},"landuse-cemetery":{color:"#2a1d1d"},"landuse-parking":{color:"#332e2e"},park:{color:"#292929"},"aeroway-area":{color:"#23262f"},water:{color:"#383838"},waterway:{color:"#3d3d3d"},"aeroway-line":{color:"#55493a"},"road-casing-major":{color:"#525252"},"road-casing-secondary":{color:{stops:[[16,"#383838"],[18.5,"#525252"]]}},"road-casing-minor":{color:{stops:[[16,"#383838"],[18.5,"#525252"]]}},"road-rail":{color:"#595959"},"road-path":{color:"#525252"},"road-minor":{color:{stops:[[16,"#525252"],[18.5,"#757575"]]}},"road-secondary":{color:{stops:[[16,"#525252"],[18.5,"#757575"]]}},"road-ramp":{color:"#757575"},"road-major":{color:"#757575"},boundary:{color:"#808080"},building:{color:"#2e2e2e",roofColor:"#4f4f4f",aoStrength:.29,tintVariation:.1,windowColor:"#8fb8e8",windowFrameColor:"#c8ccd4",windowGlow:.36},housenumber:{color:"#d9d9d9",haloColor:"#0a0a0a",haloWidth:1.4},poi:{color:"#a3a3a3",haloColor:"#0a0a0a",haloWidth:1.4},"road-label":{color:"#d9d9d9",haloColor:"#0a0a0a",haloWidth:1.4},"water-label":{color:"#9fbcd1",haloColor:"#131b20",haloWidth:1.4},"place-label":{color:"#d9d9d9",haloColor:"#0a0a0a",haloWidth:1.4},"poi-food":{color:"#a3a3a3",haloColor:"#0a0a0a",haloWidth:1.4,frameColor:"#a3a3a3",frameOpacity:1,frameHaloColor:"#0a0a0a",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-shop":{color:"#a3a3a3",haloColor:"#0a0a0a",haloWidth:1.4,frameColor:"#a3a3a3",frameOpacity:1,frameHaloColor:"#0a0a0a",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-transport":{color:"#a3a3a3",haloColor:"#0a0a0a",haloWidth:1.4,frameColor:"#a3a3a3",frameOpacity:1,frameHaloColor:"#0a0a0a",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-health":{color:"#a3a3a3",haloColor:"#0a0a0a",haloWidth:1.4,frameColor:"#a3a3a3",frameOpacity:1,frameHaloColor:"#0a0a0a",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-education":{color:"#a3a3a3",haloColor:"#0a0a0a",haloWidth:1.4,frameColor:"#a3a3a3",frameOpacity:1,frameHaloColor:"#0a0a0a",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-culture":{color:"#a3a3a3",haloColor:"#0a0a0a",haloWidth:1.4,frameColor:"#a3a3a3",frameOpacity:1,frameHaloColor:"#0a0a0a",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-sport":{color:"#a3a3a3",haloColor:"#0a0a0a",haloWidth:1.4,frameColor:"#a3a3a3",frameOpacity:1,frameHaloColor:"#0a0a0a",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-lodging":{color:"#a3a3a3",haloColor:"#0a0a0a",haloWidth:1.4,frameColor:"#a3a3a3",frameOpacity:1,frameHaloColor:"#0a0a0a",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-service":{color:"#a3a3a3",haloColor:"#0a0a0a",haloWidth:1.4,frameColor:"#a3a3a3",frameOpacity:1,frameHaloColor:"#0a0a0a",iconColor:"#1b1b1b",iconHaloWidth:0},"water-pool":{color:"#4c4c4c"},"indoor-shell":{color:"#484848",opacity:.97},"indoor-corridor":{color:"#424242"},"indoor-room":{color:"#505050"},"indoor-service":{color:"#676767"},"indoor-shop":{color:"#5c4672"},"indoor-food":{color:"#725d46"},"indoor-wc":{color:"#466172"},"indoor-wall":{color:"#767676",roofColor:"#909090",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#66558a",opacity:.95},"indoor-door":{color:"#a3a3a3",haloColor:"#0a0a0a",haloWidth:1.4},"indoor-poi":{color:"#a3a3a3",haloColor:"#0a0a0a",haloWidth:1.4},"indoor-name":{color:"#d9d9d9",haloColor:"#0a0a0a",haloWidth:1.4},"building-entrance":{color:"#cac4c4",haloColor:"#0a0a0a"}},sky:{skyColor:"#190909",horizonColor:"#282828",fogRange:[2.34,8.79],fogIntensity:.9,spaceColor:"#060606",atmosphereColor:"#b83535",starIntensity:.8}};var ou={name:"\u0413\u0430\u0440\u043C\u043E\u043D\u0438\u044F \u0441\u0438\u043D\u044F\u044F",background:"#e3e9f2",light:{ambientColor:"#f7f7f7",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#eef4ff",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#dee5ed",fillIntensity:.18},paint:{"landcover-wood":{color:"#a1b8ce"},"landcover-grass":{color:"#bdccdb"},"landcover-sand":{color:"#efeac8"},"landcover-ice":{color:"#baccde"},"landcover-wetland":{color:"#c1dee1"},"landuse-residential":{color:"#ebeff4"},"landuse-industrial":{color:"#d7d9e4"},"landuse-civic":{color:"#ead7dd"},"landuse-sport":{color:"#b8d3e0"},"landuse-cemetery":{color:"#c2d4e5"},"landuse-parking":{color:"#dadbdd"},park:{color:"#bdccdb"},"aeroway-area":{color:"#d6dbeb"},water:{color:"#5799db"},waterway:{color:"#5f9edd"},"aeroway-line":{color:"#f0ede9"},"road-casing-major":{color:"#407fbf"},"road-casing-secondary":{color:{stops:[[16,"#80a1c6"],[18.5,"#407fbf"]]}},"road-casing-minor":{color:{stops:[[16,"#80a1c6"],[18.5,"#407fbf"]]}},"road-rail":{color:"#738dab"},"road-path":{color:"#b0c5dd"},"road-minor":{color:{stops:[[16,"#b0c5dd"],[18.5,"#71a3d6"]]}},"road-secondary":{color:{stops:[[16,"#b0c5dd"],[18.5,"#71a3d6"]]}},"road-ramp":{color:"#71a3d6"},"road-major":{color:"#71a3d6"},boundary:{color:"#478cd1"},building:{color:"#cfdae8",roofColor:"#e5edf6",aoStrength:.19,tintVariation:.06,windowColor:"#6b9ed1",windowFrameColor:"#e8eef6",windowGlow:0},housenumber:{color:"#1f395c",haloColor:"#fbfcfe",haloWidth:1.4},poi:{color:"#3e6da3",haloColor:"#fbfcfe",haloWidth:1.4},"road-label":{color:"#1f395c",haloColor:"#fbfcfe",haloWidth:1.4},"water-label":{color:"#35688d",haloColor:"#f7f7f7",haloWidth:1.4},"place-label":{color:"#1f395c",haloColor:"#fbfcfe",haloWidth:1.4},"poi-food":{haloColor:"#fbfcfe",haloWidth:1.4,frameColor:"#c2681c",frameOpacity:1,frameHaloColor:"#fbfcfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{haloColor:"#fbfcfe",haloWidth:1.4,frameColor:"#2f77c4",frameOpacity:1,frameHaloColor:"#fbfcfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{haloColor:"#fbfcfe",haloWidth:1.4,frameColor:"#3b82a6",frameOpacity:1,frameHaloColor:"#fbfcfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{haloColor:"#fbfcfe",haloWidth:1.4,frameColor:"#c24444",frameOpacity:1,frameHaloColor:"#fbfcfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{haloColor:"#fbfcfe",haloWidth:1.4,frameColor:"#3f7f7a",frameOpacity:1,frameHaloColor:"#fbfcfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{haloColor:"#fbfcfe",haloWidth:1.4,frameColor:"#8b5aa5",frameOpacity:1,frameHaloColor:"#fbfcfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{haloColor:"#fbfcfe",haloWidth:1.4,frameColor:"#4f8b45",frameOpacity:1,frameHaloColor:"#fbfcfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{haloColor:"#fbfcfe",haloWidth:1.4,frameColor:"#7a5fbf",frameOpacity:1,frameHaloColor:"#fbfcfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{haloColor:"#fbfcfe",haloWidth:1.4,frameColor:"#59636e",frameOpacity:1,frameHaloColor:"#fbfcfe",iconColor:"#ffffff",iconHaloWidth:0},"water-pool":{color:"#61a2e3"},"indoor-shell":{color:"#e6e8ec",opacity:.97},"indoor-corridor":{color:"#ebedf0"},"indoor-room":{color:"#dde1e5"},"indoor-service":{color:"#c6ccd4"},"indoor-shop":{color:"#d6cedf"},"indoor-food":{color:"#dfd7ce"},"indoor-wc":{color:"#ced8df"},"indoor-wall":{color:"#babfc5",roofColor:"#d1d4d7",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#c1bad1",opacity:.95},"indoor-door":{color:"#3e6da3",haloColor:"#fbfcfe",haloWidth:1.4},"indoor-poi":{color:"#3e6da3",haloColor:"#fbfcfe",haloWidth:1.4},"indoor-name":{color:"#1f395c",haloColor:"#fbfcfe",haloWidth:1.4},"building-entrance":{color:"#225aaa",haloColor:"#fbfcfe"}},sky:{skyColor:"#8cabc9",horizonColor:"#ced6e1",fogRange:[2.41,9.92],fogIntensity:.86,spaceColor:"#080b10",atmosphereColor:"#5c96d0",starIntensity:.39}};var ru={name:"\u0413\u0430\u0440\u043C\u043E\u043D\u0438\u044F \u0437\u0435\u043B\u0451\u043D\u0430\u044F",background:"#dfecdf",light:{ambientColor:"#f5f6f5",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#f0fff0",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#dcece7",fillIntensity:.18},paint:{"landcover-wood":{color:"#5ccc65"},"landcover-grass":{color:"#8cd98c"},"landcover-sand":{color:"#efeac8"},"landcover-ice":{color:"#bbd8ce"},"landcover-wetland":{color:"#9fccd1"},"landuse-residential":{color:"#e6efe6"},"landuse-industrial":{color:"#d1d4e0"},"landuse-civic":{color:"#e7d0d7"},"landuse-sport":{color:"#94e085"},"landuse-cemetery":{color:"#9fd69f"},"landuse-parking":{color:"#d4d8d4"},park:{color:"#8cd98c"},"aeroway-area":{color:"#d6dbeb"},water:{color:"#5ec9a6"},waterway:{color:"#66ccaa"},"aeroway-line":{color:"#f0ede9"},"road-casing-major":{color:"#44a754"},"road-casing-secondary":{color:{stops:[[16,"#7fbd7f"],[18.5,"#44a754"]]}},"road-casing-minor":{color:{stops:[[16,"#7fbd7f"],[18.5,"#44a754"]]}},"road-rail":{color:"#72a172"},"road-path":{color:"#afd4af"},"road-minor":{color:{stops:[[16,"#afd4af"],[18.5,"#64c474"]]}},"road-secondary":{color:{stops:[[16,"#afd4af"],[18.5,"#64c474"]]}},"road-ramp":{color:"#64c474"},"road-major":{color:"#64c474"},boundary:{color:"#39c668"},building:{color:"#cfe2cb",roofColor:"#dff1df",aoStrength:.19,tintVariation:.06,windowColor:"#6b9ed1",windowFrameColor:"#e8f0e8",windowGlow:0},housenumber:{color:"#1c4a24",haloColor:"#f8fcf8",haloWidth:1.4},poi:{color:"#358d44",haloColor:"#f8fcf8",haloWidth:1.4},"road-label":{color:"#1c4a24",haloColor:"#f8fcf8",haloWidth:1.4},"water-label":{color:"#35688d",haloColor:"#f7f7f7",haloWidth:1.4},"place-label":{color:"#1c4a24",haloColor:"#f8fcf8",haloWidth:1.4},"poi-food":{haloColor:"#f8fcf8",haloWidth:1.4,frameColor:"#c2681c",frameOpacity:1,frameHaloColor:"#f8fcf8",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{haloColor:"#f8fcf8",haloWidth:1.4,frameColor:"#2f77c4",frameOpacity:1,frameHaloColor:"#f8fcf8",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{haloColor:"#f8fcf8",haloWidth:1.4,frameColor:"#3b82a6",frameOpacity:1,frameHaloColor:"#f8fcf8",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{haloColor:"#f8fcf8",haloWidth:1.4,frameColor:"#c24444",frameOpacity:1,frameHaloColor:"#f8fcf8",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{haloColor:"#f8fcf8",haloWidth:1.4,frameColor:"#3f7f7a",frameOpacity:1,frameHaloColor:"#f8fcf8",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{haloColor:"#f8fcf8",haloWidth:1.4,frameColor:"#8b5aa5",frameOpacity:1,frameHaloColor:"#f8fcf8",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{haloColor:"#f8fcf8",haloWidth:1.4,frameColor:"#4f8b45",frameOpacity:1,frameHaloColor:"#f8fcf8",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{haloColor:"#f8fcf8",haloWidth:1.4,frameColor:"#7a5fbf",frameOpacity:1,frameHaloColor:"#f8fcf8",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{haloColor:"#f8fcf8",haloWidth:1.4,frameColor:"#59636e",frameOpacity:1,frameHaloColor:"#f8fcf8",iconColor:"#ffffff",iconHaloWidth:0},"water-pool":{color:"#67d1af"},"indoor-shell":{color:"#e1e8e0",opacity:.97},"indoor-corridor":{color:"#e6ece5"},"indoor-room":{color:"#d9e1d7"},"indoor-service":{color:"#c3d0c1"},"indoor-shop":{color:"#d1c8db"},"indoor-food":{color:"#dbd2c8"},"indoor-wc":{color:"#c8d4db"},"indoor-wall":{color:"#b7c0b5",roofColor:"#cdd2cc",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#bcb4cd",opacity:.95},"indoor-door":{color:"#358d44",haloColor:"#f8fcf8",haloWidth:1.4},"indoor-poi":{color:"#358d44",haloColor:"#f8fcf8",haloWidth:1.4},"indoor-name":{color:"#1c4a24",haloColor:"#f8fcf8",haloWidth:1.4},"building-entrance":{color:"#225aaa",haloColor:"#f8fcf8"}},sky:{skyColor:"#83c5af",horizonColor:"#cad9ca",fogRange:[2.41,9.87],fogIntensity:.86,spaceColor:"#090f09",atmosphereColor:"#5bcfa9",starIntensity:.4}};var nu={name:"\u041B\u0443\u043D\u043D\u0430\u044F",background:"#c8cbd0",light:{ambientColor:"#ebecec",ambientIntensity:.46,keyAzimuth:120,keyAltitude:59,keyColor:"#e8ecf2",keyIntensity:.56,fillAzimuth:300,fillAltitude:25,fillColor:"#c7d0e1",fillIntensity:.19},paint:{"landcover-wood":{color:"#a8abb3"},"landcover-grass":{color:"#b9bbc1"},"landcover-sand":{color:"#efeac8"},"landcover-ice":{color:"#cbcdd2"},"landcover-wetland":{color:"#acd4d7"},"landuse-residential":{color:"#ced0d4"},"landuse-industrial":{color:"#b3b7cc"},"landuse-civic":{color:"#d5aebb"},"landuse-sport":{color:"#b2bdc7"},"landuse-cemetery":{color:"#adbddc"},"landuse-parking":{color:"#b9bcc0"},park:{color:"#b9bbc1"},"aeroway-area":{color:"#d6dbeb"},water:{color:"#929aaa"},waterway:{color:"#929aaa"},"aeroway-line":{color:"#f0ede9"},"road-casing-major":{color:"#6c7689"},"road-casing-secondary":{color:{stops:[[16,"#848b9a"],[18.5,"#6c7689"]]}},"road-casing-minor":{color:{stops:[[16,"#848b9a"],[18.5,"#6c7689"]]}},"road-rail":{color:"#7e838b"},"road-path":{color:"#acb0b9"},"road-minor":{color:{stops:[[16,"#acb0b9"],[18.5,"#949ba8"]]}},"road-secondary":{color:{stops:[[16,"#acb0b9"],[18.5,"#949ba8"]]}},"road-ramp":{color:"#949ba8"},"road-major":{color:"#949ba8"},boundary:{color:"#6a7181"},building:{color:"#c8cbd0",roofColor:"#d9dbdd",aoStrength:.2,tintVariation:.07,windowColor:"#9fb0c0",windowFrameColor:"#cfd6e0",windowGlow:0},housenumber:{color:"#31363f",haloColor:"#f1f2f4",haloWidth:1.4},poi:{color:"#606876",haloColor:"#f1f2f4",haloWidth:1.4},"road-label":{color:"#31363f",haloColor:"#f1f2f4",haloWidth:1.4},"water-label":{color:"#35688d",haloColor:"#f7f7f7",haloWidth:1.4},"place-label":{color:"#31363f",haloColor:"#f1f2f4",haloWidth:1.4},"poi-food":{haloColor:"#f1f2f4",haloWidth:1.4,frameColor:"#c2681c",frameOpacity:1,frameHaloColor:"#f1f2f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{haloColor:"#f1f2f4",haloWidth:1.4,frameColor:"#2f77c4",frameOpacity:1,frameHaloColor:"#f1f2f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{haloColor:"#f1f2f4",haloWidth:1.4,frameColor:"#3b82a6",frameOpacity:1,frameHaloColor:"#f1f2f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{haloColor:"#f1f2f4",haloWidth:1.4,frameColor:"#c24444",frameOpacity:1,frameHaloColor:"#f1f2f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{haloColor:"#f1f2f4",haloWidth:1.4,frameColor:"#3f7f7a",frameOpacity:1,frameHaloColor:"#f1f2f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{haloColor:"#f1f2f4",haloWidth:1.4,frameColor:"#8b5aa5",frameOpacity:1,frameHaloColor:"#f1f2f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{haloColor:"#f1f2f4",haloWidth:1.4,frameColor:"#4f8b45",frameOpacity:1,frameHaloColor:"#f1f2f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{haloColor:"#f1f2f4",haloWidth:1.4,frameColor:"#7a5fbf",frameOpacity:1,frameHaloColor:"#f1f2f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{haloColor:"#f1f2f4",haloWidth:1.4,frameColor:"#59636e",frameOpacity:1,frameHaloColor:"#f1f2f4",iconColor:"#ffffff",iconHaloWidth:0},"water-pool":{color:"#9ca4b3"},"indoor-shell":{color:"#d6d9dc",opacity:.97},"indoor-corridor":{color:"#dbdde0"},"indoor-room":{color:"#ced1d5"},"indoor-service":{color:"#b9bcc3"},"indoor-shop":{color:"#c7bcd2"},"indoor-food":{color:"#d2c7bc"},"indoor-wc":{color:"#bcc9d2"},"indoor-wall":{color:"#acafb4",roofColor:"#c2c4c7",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#b1a7c5",opacity:.95},"indoor-door":{color:"#606876",haloColor:"#f1f2f4",haloWidth:1.4},"indoor-poi":{color:"#606876",haloColor:"#f1f2f4",haloWidth:1.4},"indoor-name":{color:"#31363f",haloColor:"#f1f2f4",haloWidth:1.4},"building-entrance":{haloColor:"#f1f2f4"}},sky:{skyColor:"#5675b3",horizonColor:"#b1b4b9",fogRange:[2.39,9.64],fogIntensity:.87,spaceColor:"#0a0b0c",atmosphereColor:"#557dce",starIntensity:.45}};var iu={name:"\u041C\u0430\u0442\u043E\u0432\u0430\u044F",background:"#e7e6e4",light:{ambientColor:"#f5f5f5",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#ffffff",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#dce6ec",fillIntensity:.18},paint:{"landcover-wood":{color:"#a3be9d"},"landcover-grass":{color:"#b3cbae"},"landcover-sand":{color:"#efeac8"},"landcover-ice":{color:"#d6dce0"},"landcover-wetland":{color:"#acd4d7"},"landuse-residential":{color:"#ecebe9"},"landuse-industrial":{color:"#d1d4e0"},"landuse-civic":{color:"#e7d0d7"},"landuse-sport":{color:"#b6d2a7"},"landuse-cemetery":{color:"#b5dcad"},"landuse-parking":{color:"#d8d6d4"},park:{color:"#b3cbae"},"aeroway-area":{color:"#d6dbeb"},water:{color:"#a6bbc9"},waterway:{color:"#a6bbc9"},"aeroway-line":{color:"#f0ede9"},"road-casing-major":{color:"#969fb0"},"road-casing-secondary":{color:{stops:[[16,"#abb0ba"],[18.5,"#969fb0"]]}},"road-casing-minor":{color:{stops:[[16,"#abb0ba"],[18.5,"#969fb0"]]}},"road-rail":{color:"#adadad"},"road-path":{color:"#c7cad1"},"road-minor":{color:{stops:[[16,"#c7cad1"],[18.5,"#aeb4c2"]]}},"road-secondary":{color:{stops:[[16,"#c7cad1"],[18.5,"#aeb4c2"]]}},"road-ramp":{color:"#aeb4c2"},"road-major":{color:"#aeb4c2"},boundary:{color:"#ca919f"},building:{color:"#dad6d2",roofColor:"#e3e0dd",aoStrength:.19,tintVariation:.06,windowColor:"#9fb0c0",windowFrameColor:"#f0f0f2",windowGlow:0},housenumber:{color:"#4d4742",haloColor:"#f6f5f4",haloWidth:1.4},poi:{color:"#707a8f",haloColor:"#f6f5f4",haloWidth:1.4},"road-label":{color:"#4d4742",haloColor:"#f6f5f4",haloWidth:1.4},"water-label":{color:"#35688d",haloColor:"#f7f7f7",haloWidth:1.4},"place-label":{color:"#4d4742",haloColor:"#f6f5f4",haloWidth:1.4},"poi-food":{haloColor:"#f6f5f4",haloWidth:1.4,frameColor:"#c2681c",frameOpacity:1,frameHaloColor:"#f6f5f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{haloColor:"#f6f5f4",haloWidth:1.4,frameColor:"#2f77c4",frameOpacity:1,frameHaloColor:"#f6f5f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{haloColor:"#f6f5f4",haloWidth:1.4,frameColor:"#3b82a6",frameOpacity:1,frameHaloColor:"#f6f5f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{haloColor:"#f6f5f4",haloWidth:1.4,frameColor:"#c24444",frameOpacity:1,frameHaloColor:"#f6f5f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{haloColor:"#f6f5f4",haloWidth:1.4,frameColor:"#3f7f7a",frameOpacity:1,frameHaloColor:"#f6f5f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{haloColor:"#f6f5f4",haloWidth:1.4,frameColor:"#8b5aa5",frameOpacity:1,frameHaloColor:"#f6f5f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{haloColor:"#f6f5f4",haloWidth:1.4,frameColor:"#4f8b45",frameOpacity:1,frameHaloColor:"#f6f5f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{haloColor:"#f6f5f4",haloWidth:1.4,frameColor:"#7a5fbf",frameOpacity:1,frameHaloColor:"#f6f5f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{haloColor:"#f6f5f4",haloWidth:1.4,frameColor:"#59636e",frameOpacity:1,frameHaloColor:"#f6f5f4",iconColor:"#ffffff",iconHaloWidth:0},"water-pool":{color:"#b3c6d2"},"indoor-shell":{color:"#e6e3e1",opacity:.97},"indoor-corridor":{color:"#eae8e6"},"indoor-room":{color:"#dfdcd8"},"indoor-service":{color:"#cdc8c2"},"indoor-shop":{color:"#d1c8da"},"indoor-food":{color:"#dad1c8"},"indoor-wc":{color:"#c8d3da"},"indoor-wall":{color:"#bebab6",roofColor:"#d1cecc",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#bbb3cd",opacity:.95},"indoor-door":{color:"#707a8f",haloColor:"#f6f5f4",haloWidth:1.4},"indoor-poi":{color:"#707a8f",haloColor:"#f6f5f4",haloWidth:1.4},"indoor-name":{color:"#4d4742",haloColor:"#f6f5f4",haloWidth:1.4},"building-entrance":{color:"#225aaa",haloColor:"#f6f5f4"}},sky:{skyColor:"#83abc5",horizonColor:"#d3d2d0",fogRange:[2.41,9.87],fogIntensity:.86,spaceColor:"#0d0c0b",atmosphereColor:"#5ba1cf",starIntensity:.4}};var au={name:"\u041C\u0438\u043D\u0438\u043C\u0430\u043B\u0438\u0437\u043C",background:"#f7f7f7",light:{ambientColor:"#fcfcfc",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#ffffff",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#dee7ed",fillIntensity:.18},paint:{"landcover-wood":{color:"#d6e1d6"},"landcover-grass":{color:"#e1eae1"},"landcover-sand":{color:"#efeac8"},"landcover-ice":{color:"#edf0f2"},"landcover-wetland":{color:"#e3f1f2"},"landuse-residential":{color:"#fafafa"},"landuse-industrial":{color:"#e7e8ef"},"landuse-civic":{color:"#f3e7eb"},"landuse-sport":{color:"#e1edde"},"landuse-cemetery":{color:"#e6f4e6"},"landuse-parking":{color:"#e9e7e7"},park:{color:"#e1eae1"},"aeroway-area":{color:"#d6dbeb"},water:{color:"#d7e2ea"},waterway:{color:"#d7e2ea"},"aeroway-line":{color:"#f0ede9"},"road-casing-major":{color:"#a3a3a3"},"road-casing-secondary":{color:{stops:[[16,"#b8b8b8"],[18.5,"#a3a3a3"]]}},"road-casing-minor":{color:{stops:[[16,"#b8b8b8"],[18.5,"#a3a3a3"]]}},"road-rail":{color:"#b3b3b3"},"road-path":{color:"#d1d1d1"},"road-minor":{color:{stops:[[16,"#d1d1d1"],[18.5,"#bdbdbd"]]}},"road-secondary":{color:{stops:[[16,"#d1d1d1"],[18.5,"#bdbdbd"]]}},"road-ramp":{color:"#bdbdbd"},"road-major":{color:"#bdbdbd"},boundary:{color:"#999999"},building:{color:"#ebebeb",roofColor:"#f2f2f2",aoStrength:.18,tintVariation:.06,windowColor:"#9fb0c0",windowFrameColor:"#f4f4f6",windowGlow:0},housenumber:{color:"#404040",haloColor:"#ffffff",haloWidth:1.4},poi:{color:"#737373",haloColor:"#ffffff",haloWidth:1.4},"road-label":{color:"#404040",haloColor:"#ffffff",haloWidth:1.4},"water-label":{color:"#35688d",haloColor:"#f7f7f7",haloWidth:1.4},"place-label":{color:"#404040",haloColor:"#ffffff",haloWidth:1.4},"poi-food":{color:"#737373",haloColor:"#ffffff",haloWidth:1.4,frameColor:"#737373",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{color:"#737373",haloColor:"#ffffff",haloWidth:1.4,frameColor:"#737373",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{color:"#737373",haloColor:"#ffffff",haloWidth:1.4,frameColor:"#737373",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{color:"#737373",haloColor:"#ffffff",haloWidth:1.4,frameColor:"#737373",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{color:"#737373",haloColor:"#ffffff",haloWidth:1.4,frameColor:"#737373",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{color:"#737373",haloColor:"#ffffff",haloWidth:1.4,frameColor:"#737373",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{color:"#737373",haloColor:"#ffffff",haloWidth:1.4,frameColor:"#737373",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{color:"#737373",haloColor:"#ffffff",haloWidth:1.4,frameColor:"#737373",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{color:"#737373",haloColor:"#ffffff",haloWidth:1.4,frameColor:"#737373",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"water-pool":{color:"#e8eff4"},"indoor-shell":{color:"#f7f7f7",opacity:.97},"indoor-corridor":{color:"#fbfbfb"},"indoor-room":{color:"#efefef"},"indoor-service":{color:"#dbdbdb"},"indoor-shop":{color:"#e4dfea"},"indoor-food":{color:"#eae4df"},"indoor-wc":{color:"#dfe5ea"},"indoor-wall":{color:"#cdcdcd",roofColor:"#e2e2e2",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#d0cbdc",opacity:.95},"indoor-door":{color:"#737373",haloColor:"#ffffff",haloWidth:1.4},"indoor-poi":{color:"#737373",haloColor:"#ffffff",haloWidth:1.4},"indoor-name":{color:"#404040",haloColor:"#ffffff",haloWidth:1.4},"building-entrance":{color:"#564e4e",haloColor:"#ffffff"}},sky:{skyColor:"#a4c0d4",horizonColor:"#e6e6e6",fogRange:[2.43,10.04],fogIntensity:.85,spaceColor:"#0d0d0d",atmosphereColor:"#5fa1d1",starIntensity:.37}};var su={name:"\u041E\u043A\u0435\u0430\u043D",background:"#d7e3ea",light:{ambientColor:"#f3f4f4",ambientIntensity:.47,keyAzimuth:120,keyAltitude:60,keyColor:"#e8f6ff",keyIntensity:.59,fillAzimuth:300,fillAltitude:25,fillColor:"#d8e4ea",fillIntensity:.18},paint:{"landcover-wood":{color:"#75c7c7"},"landcover-grass":{color:"#97d8d2"},"landcover-sand":{color:"#efeac8"},"landcover-ice":{color:"#accedf"},"landcover-wetland":{color:"#a5d0d4"},"landuse-residential":{color:"#dfe8ec"},"landuse-industrial":{color:"#cbcedc"},"landuse-civic":{color:"#e3c9d2"},"landuse-sport":{color:"#90dfcb"},"landuse-cemetery":{color:"#a6d9d4"},"landuse-parking":{color:"#cfd2d3"},park:{color:"#97d8d2"},"aeroway-area":{color:"#d6dbeb"},water:{color:"#30abe8"},waterway:{color:"#3eb0ea"},"aeroway-line":{color:"#f0ede9"},"road-casing-major":{color:"#47a3c2"},"road-casing-secondary":{color:{stops:[[16,"#8ab2c7"],[18.5,"#47a3c2"]]}},"road-casing-minor":{color:{stops:[[16,"#8ab2c7"],[18.5,"#47a3c2"]]}},"road-rail":{color:"#8a9ea8"},"road-path":{color:"#b8d3e0"},"road-minor":{color:{stops:[[16,"#b8d3e0"],[18.5,"#79c0d8"]]}},"road-secondary":{color:{stops:[[16,"#b8d3e0"],[18.5,"#79c0d8"]]}},"road-ramp":{color:"#79c0d8"},"road-major":{color:"#79c0d8"},boundary:{color:"#47bad1"},building:{color:"#d2dee4",roofColor:"#e7f0f3",aoStrength:.19,tintVariation:.06,windowColor:"#6b9ed1",windowFrameColor:"#e6f0f6",windowGlow:0},housenumber:{color:"#1f3c51",haloColor:"#f8fbfc",haloWidth:1.4},poi:{color:"#3b7b9b",haloColor:"#f8fbfc",haloWidth:1.4},"road-label":{color:"#1f3c51",haloColor:"#f8fbfc",haloWidth:1.4},"water-label":{color:"#35688d",haloColor:"#f7f7f7",haloWidth:1.4},"place-label":{color:"#1f3c51",haloColor:"#f8fbfc",haloWidth:1.4},"poi-food":{haloColor:"#f8fbfc",haloWidth:1.4,frameColor:"#c2681c",frameOpacity:1,frameHaloColor:"#f8fbfc",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{haloColor:"#f8fbfc",haloWidth:1.4,frameColor:"#2f77c4",frameOpacity:1,frameHaloColor:"#f8fbfc",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{haloColor:"#f8fbfc",haloWidth:1.4,frameColor:"#3b82a6",frameOpacity:1,frameHaloColor:"#f8fbfc",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{haloColor:"#f8fbfc",haloWidth:1.4,frameColor:"#c24444",frameOpacity:1,frameHaloColor:"#f8fbfc",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{haloColor:"#f8fbfc",haloWidth:1.4,frameColor:"#3f7f7a",frameOpacity:1,frameHaloColor:"#f8fbfc",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{haloColor:"#f8fbfc",haloWidth:1.4,frameColor:"#8b5aa5",frameOpacity:1,frameHaloColor:"#f8fbfc",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{haloColor:"#f8fbfc",haloWidth:1.4,frameColor:"#4f8b45",frameOpacity:1,frameHaloColor:"#f8fbfc",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{haloColor:"#f8fbfc",haloWidth:1.4,frameColor:"#7a5fbf",frameOpacity:1,frameHaloColor:"#f8fbfc",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{haloColor:"#f8fbfc",haloWidth:1.4,frameColor:"#59636e",frameOpacity:1,frameHaloColor:"#f8fbfc",iconColor:"#ffffff",iconHaloWidth:0},"water-pool":{color:"#38b3f1"},"indoor-shell":{color:"#e5e9eb",opacity:.97},"indoor-corridor":{color:"#eaeeef"},"indoor-room":{color:"#dce2e5"},"indoor-service":{color:"#c6cfd4"},"indoor-shop":{color:"#d6cede"},"indoor-food":{color:"#ded6ce"},"indoor-wc":{color:"#ced8de"},"indoor-wall":{color:"#bac1c4",roofColor:"#d0d4d6",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#c1b9d1",opacity:.95},"indoor-door":{color:"#3b7b9b",haloColor:"#f8fbfc",haloWidth:1.4},"indoor-poi":{color:"#3b7b9b",haloColor:"#f8fbfc",haloWidth:1.4},"indoor-name":{color:"#1f3c51",haloColor:"#f8fbfc",haloWidth:1.4},"building-entrance":{color:"#225aaa",haloColor:"#f8fbfc"}},sky:{skyColor:"#7aaac1",horizonColor:"#c1cfd6",fogRange:[2.41,9.82],fogIntensity:.86,spaceColor:"#080d0f",atmosphereColor:"#5aa8cf",starIntensity:.41}};var lu={name:"\u041F\u0440\u0435\u043C\u0438\u0443\u043C",background:"#211f1c",model3dKey:"night",light:{ambientColor:"#b0aaa4",ambientIntensity:.34,keyAzimuth:120,keyAltitude:55,keyColor:"#c8b48a",keyIntensity:.3,fillAzimuth:300,fillAltitude:25,fillColor:"#496887",fillIntensity:.22},paint:{"landcover-wood":{color:"#1b271b"},"landcover-grass":{color:"#232f23"},"landcover-sand":{color:"#393622"},"landcover-ice":{color:"#2d3d4c"},"landcover-wetland":{color:"#213436"},"landuse-residential":{color:"#272421"},"landuse-industrial":{color:"#242633"},"landuse-civic":{color:"#332429"},"landuse-sport":{color:"#22331f"},"landuse-cemetery":{color:"#213021"},"landuse-parking":{color:"#383633"},park:{color:"#232f23"},"aeroway-area":{color:"#272a35"},water:{color:"#16293b"},waterway:{color:"#1c334a"},"aeroway-line":{color:"#55493a"},"road-casing-major":{color:"#856e32"},"road-casing-secondary":{color:{stops:[[16,"#423b2e"],[18.5,"#856e32"]]}},"road-casing-minor":{color:{stops:[[16,"#423b2e"],[18.5,"#856e32"]]}},"road-rail":{color:"#6b6457"},"road-path":{color:"#5e5645"},"road-minor":{color:{stops:[[16,"#5e5645"],[18.5,"#bf9e4a"]]}},"road-secondary":{color:{stops:[[16,"#5e5645"],[18.5,"#bf9e4a"]]}},"road-ramp":{color:"#bf9e4a"},"road-major":{color:"#bf9e4a"},boundary:{color:"#d1aa47"},building:{color:"#443b2c",roofColor:"#726037",aoStrength:.29,tintVariation:.1,windowColor:"#8fb8e8",windowFrameColor:"#eef0f4",windowGlow:.36},housenumber:{color:"#eae3d7",haloColor:"#181410",haloWidth:1.4},poi:{color:"#d4bb7d",haloColor:"#181410",haloWidth:1.4},"road-label":{color:"#eae3d7",haloColor:"#181410",haloWidth:1.4},"water-label":{color:"#9fbcd1",haloColor:"#131b20",haloWidth:1.4},"place-label":{color:"#eae3d7",haloColor:"#181410",haloWidth:1.4},"poi-food":{color:"#d89964",haloColor:"#181410",haloWidth:1.4,frameColor:"#d89964",frameOpacity:1,frameHaloColor:"#181410",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-shop":{color:"#699cd4",haloColor:"#181410",haloWidth:1.4,frameColor:"#699cd4",frameOpacity:1,frameHaloColor:"#181410",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-transport":{color:"#75acc8",haloColor:"#181410",haloWidth:1.4,frameColor:"#75acc8",frameOpacity:1,frameHaloColor:"#181410",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-health":{color:"#ca7272",haloColor:"#181410",haloWidth:1.4,frameColor:"#ca7272",frameOpacity:1,frameHaloColor:"#181410",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-education":{color:"#81bbb7",haloColor:"#181410",haloWidth:1.4,frameColor:"#81bbb7",frameOpacity:1,frameHaloColor:"#181410",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-culture":{color:"#a684b8",haloColor:"#181410",haloWidth:1.4,frameColor:"#a684b8",frameOpacity:1,frameHaloColor:"#181410",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-sport":{color:"#89bb81",haloColor:"#181410",haloWidth:1.4,frameColor:"#89bb81",frameOpacity:1,frameHaloColor:"#181410",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-lodging":{color:"#8e79c3",haloColor:"#181410",haloWidth:1.4,frameColor:"#8e79c3",frameOpacity:1,frameHaloColor:"#181410",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-service":{color:"#959ea7",haloColor:"#181410",haloWidth:1.4,frameColor:"#959ea7",frameOpacity:1,frameHaloColor:"#181410",iconColor:"#1b1b1b",iconHaloWidth:0},"water-pool":{color:"#1c3752"},"indoor-shell":{color:"#564b39",opacity:.97},"indoor-corridor":{color:"#504635"},"indoor-room":{color:"#605440"},"indoor-service":{color:"#7b6c52"},"indoor-shop":{color:"#5c4672"},"indoor-food":{color:"#725d46"},"indoor-wc":{color:"#466172"},"indoor-wall":{color:"#857a68",roofColor:"#9a9285",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#66558a",opacity:.95},"indoor-door":{color:"#d4bb7d",haloColor:"#181410",haloWidth:1.4},"indoor-poi":{color:"#d4bb7d",haloColor:"#181410",haloWidth:1.4},"indoor-name":{color:"#eae3d7",haloColor:"#181410",haloWidth:1.4},"building-entrance":{color:"#79a0d7",haloColor:"#181410"}},sky:{skyColor:"#09121b",horizonColor:"#2c2a27",fogRange:[2.34,8.79],fogIntensity:.9,spaceColor:"#060606",atmosphereColor:"#3679b9",starIntensity:.79}};var cu={name:"\u0420\u0435\u0430\u043B\u0438\u0441\u0442\u0438\u0447\u043D\u0430\u044F",background:"#d6dac8",light:{ambientColor:"#eeeeed",ambientIntensity:.46,keyAzimuth:120,keyAltitude:59,keyColor:"#fff0d8",keyIntensity:.57,fillAzimuth:300,fillAltitude:25,fillColor:"#cbd9e3",fillIntensity:.18},paint:{"landcover-wood":{color:"#62a63f"},"landcover-grass":{color:"#8dbf69"},"landcover-sand":{color:"#efeac8"},"landcover-ice":{color:"#b4c9d7"},"landcover-wetland":{color:"#75b7bd"},"landuse-residential":{color:"#d6d1c2"},"landuse-industrial":{color:"#b9bdd0"},"landuse-civic":{color:"#d9b5c1"},"landuse-sport":{color:"#8bc95e"},"landuse-cemetery":{color:"#95c374"},"landuse-parking":{color:"#c3c5bf"},park:{color:"#8dbf69"},"aeroway-area":{color:"#d6dbeb"},water:{color:"#4d97cb"},waterway:{color:"#599ecf"},"aeroway-line":{color:"#f0ede9"},"road-casing-major":{color:"#856b47"},"road-casing-secondary":{color:{stops:[[16,"#766b60"],[18.5,"#856b47"]]}},"road-casing-minor":{color:{stops:[[16,"#766b60"],[18.5,"#856b47"]]}},"road-rail":{color:"#666666"},"road-path":{color:"#9c948b"},"road-minor":{color:{stops:[[16,"#9c948b"],[18.5,"#ccaa66"]]}},"road-secondary":{color:{stops:[[16,"#9c948b"],[18.5,"#ccaa66"]]}},"road-ramp":{color:"#ccaa66"},"road-major":{color:"#ccaa66"},boundary:{color:"#8a735c"},building:{color:"#cdc4b7",roofColor:"#cdc4b7",aoStrength:.2,tintVariation:.07,windowColor:"#9fb0c0",windowFrameColor:"#eceef2",windowGlow:0},housenumber:{color:"#3b332b",haloColor:"#f5f5f0",haloWidth:1.4},poi:{color:"#735c45",haloColor:"#f5f5f0",haloWidth:1.4},"road-label":{color:"#3b332b",haloColor:"#f5f5f0",haloWidth:1.4},"water-label":{color:"#35688d",haloColor:"#f7f7f7",haloWidth:1.4},"place-label":{color:"#3b332b",haloColor:"#f5f5f0",haloWidth:1.4},"poi-food":{haloColor:"#f5f5f0",haloWidth:1.4,frameColor:"#c2681c",frameOpacity:1,frameHaloColor:"#f5f5f0",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{haloColor:"#f5f5f0",haloWidth:1.4,frameColor:"#2f77c4",frameOpacity:1,frameHaloColor:"#f5f5f0",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{haloColor:"#f5f5f0",haloWidth:1.4,frameColor:"#3b82a6",frameOpacity:1,frameHaloColor:"#f5f5f0",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{haloColor:"#f5f5f0",haloWidth:1.4,frameColor:"#c24444",frameOpacity:1,frameHaloColor:"#f5f5f0",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{haloColor:"#f5f5f0",haloWidth:1.4,frameColor:"#3f7f7a",frameOpacity:1,frameHaloColor:"#f5f5f0",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{haloColor:"#f5f5f0",haloWidth:1.4,frameColor:"#8b5aa5",frameOpacity:1,frameHaloColor:"#f5f5f0",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{haloColor:"#f5f5f0",haloWidth:1.4,frameColor:"#4f8b45",frameOpacity:1,frameHaloColor:"#f5f5f0",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{haloColor:"#f5f5f0",haloWidth:1.4,frameColor:"#7a5fbf",frameOpacity:1,frameHaloColor:"#f5f5f0",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{haloColor:"#f5f5f0",haloWidth:1.4,frameColor:"#59636e",frameOpacity:1,frameHaloColor:"#f5f5f0",iconColor:"#ffffff",iconHaloWidth:0},"water-pool":{color:"#559fd3"},"indoor-shell":{color:"#d6d0c9",opacity:.97},"indoor-corridor":{color:"#dad5ce"},"indoor-room":{color:"#cfc9c0"},"indoor-service":{color:"#beb6a9"},"indoor-shop":{color:"#bdb0ca"},"indoor-food":{color:"#cabeb0"},"indoor-wc":{color:"#b0c0ca"},"indoor-wall":{color:"#ada79e",roofColor:"#bfbbb6",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#a69bbd",opacity:.95},"indoor-door":{color:"#735c45",haloColor:"#f5f5f0",haloWidth:1.4},"indoor-poi":{color:"#735c45",haloColor:"#f5f5f0",haloWidth:1.4},"indoor-name":{color:"#3b332b",haloColor:"#f5f5f0",haloWidth:1.4},"building-entrance":{haloColor:"#f5f5f0"}},sky:{skyColor:"#5f92b7",horizonColor:"#bfc4b1",fogRange:[2.39,9.68],fogIntensity:.87,spaceColor:"#0d0e09",atmosphereColor:"#569dce",starIntensity:.44}};var fu={name:"\u041A\u043E\u0441\u043C\u043E\u0441",background:"#0c0a1a",model3dKey:"night",light:{ambientColor:"#8c7fcb",ambientIntensity:.34,keyAzimuth:120,keyAltitude:55,keyColor:"#c0a8ff",keyIntensity:.28,fillAzimuth:300,fillAltitude:25,fillColor:"#475385",fillIntensity:.22},paint:{"landcover-wood":{color:"#241730"},"landcover-grass":{color:"#2e203c"},"landcover-sand":{color:"#292719"},"landcover-ice":{color:"#2e365b"},"landcover-wetland":{color:"#172526"},"landuse-residential":{color:"#110e20"},"landuse-industrial":{color:"#191b24"},"landuse-civic":{color:"#24191d"},"landuse-sport":{color:"#281c40"},"landuse-cemetery":{color:"#1c1721"},"landuse-parking":{color:"#27272b"},park:{color:"#2e203c"},"aeroway-area":{color:"#1c1f26"},water:{color:"#121c49"},waterway:{color:"#16225a"},"aeroway-line":{color:"#55493a"},"road-casing-major":{color:"#7e279b"},"road-casing-secondary":{color:{stops:[[16,"#3a2060"],[18.5,"#7e279b"]]}},"road-casing-minor":{color:{stops:[[16,"#3a2060"],[18.5,"#7e279b"]]}},"road-rail":{color:"#985298"},"road-path":{color:"#6b35b6"},"road-minor":{color:{stops:[[16,"#6b35b6"],[18.5,"#bf4ce6"]]}},"road-secondary":{color:{stops:[[16,"#6b35b6"],[18.5,"#bf4ce6"]]}},"road-ramp":{color:"#bf4ce6"},"road-major":{color:"#bf4ce6"},boundary:{color:"#ec51b8"},building:{color:"#2a2145",roofColor:"#7f30a6",aoStrength:.29,tintVariation:.1,windowColor:"#84dcff",windowFrameColor:"#9fb0d8",windowGlow:.5},housenumber:{color:"#dbd1f0",haloColor:"#080614",haloWidth:1.4},poi:{color:"#d186ea",haloColor:"#080614",haloWidth:1.4},"road-label":{color:"#dbd1f0",haloColor:"#080614",haloWidth:1.4},"water-label":{color:"#9fbcd1",haloColor:"#131b20",haloWidth:1.4},"place-label":{color:"#dbd1f0",haloColor:"#080614",haloWidth:1.4},"poi-food":{color:"#d89964",haloColor:"#080614",haloWidth:1.4,frameColor:"#d89964",frameOpacity:1,frameHaloColor:"#080614",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-shop":{color:"#699cd4",haloColor:"#080614",haloWidth:1.4,frameColor:"#699cd4",frameOpacity:1,frameHaloColor:"#080614",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-transport":{color:"#75acc8",haloColor:"#080614",haloWidth:1.4,frameColor:"#75acc8",frameOpacity:1,frameHaloColor:"#080614",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-health":{color:"#ca7272",haloColor:"#080614",haloWidth:1.4,frameColor:"#ca7272",frameOpacity:1,frameHaloColor:"#080614",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-education":{color:"#81bbb7",haloColor:"#080614",haloWidth:1.4,frameColor:"#81bbb7",frameOpacity:1,frameHaloColor:"#080614",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-culture":{color:"#a684b8",haloColor:"#080614",haloWidth:1.4,frameColor:"#a684b8",frameOpacity:1,frameHaloColor:"#080614",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-sport":{color:"#89bb81",haloColor:"#080614",haloWidth:1.4,frameColor:"#89bb81",frameOpacity:1,frameHaloColor:"#080614",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-lodging":{color:"#8e79c3",haloColor:"#080614",haloWidth:1.4,frameColor:"#8e79c3",frameOpacity:1,frameHaloColor:"#080614",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-service":{color:"#959ea7",haloColor:"#080614",haloWidth:1.4,frameColor:"#959ea7",frameOpacity:1,frameHaloColor:"#080614",iconColor:"#1b1b1b",iconHaloWidth:0},"water-pool":{color:"#152466"},"indoor-shell":{color:"#403956",opacity:.97},"indoor-corridor":{color:"#3c3550"},"indoor-room":{color:"#484060"},"indoor-service":{color:"#5c527b"},"indoor-shop":{color:"#5c4672"},"indoor-food":{color:"#725d46"},"indoor-wc":{color:"#466172"},"indoor-wall":{color:"#6f6885",roofColor:"#8a859a",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#66558a",opacity:.95},"indoor-door":{color:"#d186ea",haloColor:"#080614",haloWidth:1.4},"indoor-poi":{color:"#d186ea",haloColor:"#080614",haloWidth:1.4},"indoor-name":{color:"#dbd1f0",haloColor:"#080614",haloWidth:1.4},"building-entrance":{color:"#79a0d7",haloColor:"#080614"}},sky:{skyColor:"#080b18",horizonColor:"#1d1931",fogRange:[2.34,8.77],fogIntensity:.9,spaceColor:"#040308",atmosphereColor:"#354cb6",starIntensity:.82}};var uu={name:"\u0412\u0443\u043B\u043A\u0430\u043D",background:"#29211e",model3dKey:"night",light:{ambientColor:"#b6a6a1",ambientIntensity:.35,keyAzimuth:120,keyAltitude:55,keyColor:"#ffb070",keyIntensity:.29,fillAzimuth:300,fillAltitude:25,fillColor:"#8b604b",fillIntensity:.22},paint:{"landcover-wood":{color:"#31241c"},"landcover-grass":{color:"#392e22"},"landcover-sand":{color:"#403c26"},"landcover-ice":{color:"#aa6b4b"},"landcover-wetland":{color:"#243b3d"},"landuse-residential":{color:"#2f2623"},"landuse-industrial":{color:"#282b39"},"landuse-civic":{color:"#39282e"},"landuse-sport":{color:"#3e2e1e"},"landuse-cemetery":{color:"#362e26"},"landuse-parking":{color:"#3e3938"},park:{color:"#392e22"},"aeroway-area":{color:"#2b2f3b"},water:{color:"#8b3f18"},waterway:{color:"#9c461c"},"aeroway-line":{color:"#55493a"},"road-casing-major":{color:"#aa350e"},"road-casing-secondary":{color:{stops:[[16,"#712b14"],[18.5,"#aa350e"]]}},"road-casing-minor":{color:{stops:[[16,"#712b14"],[18.5,"#aa350e"]]}},"road-rail":{color:"#8f583d"},"road-path":{color:"#e65e19"},"road-minor":{color:{stops:[[16,"#e65e19"],[18.5,"#f98c1f"]]}},"road-secondary":{color:{stops:[[16,"#e65e19"],[18.5,"#f98c1f"]]}},"road-ramp":{color:"#f98c1f"},"road-major":{color:"#f98c1f"},boundary:{color:"#f48c25"},building:{color:"#422b24",roofColor:"#c1551f",aoStrength:.28,tintVariation:.09,windowColor:"#84dcff",windowFrameColor:"#d8b0a0",windowGlow:.5},housenumber:{color:"#f3e0ce",haloColor:"#150b09",haloWidth:1.4},poi:{color:"#f09e4c",haloColor:"#150b09",haloWidth:1.4},"road-label":{color:"#f3e0ce",haloColor:"#150b09",haloWidth:1.4},"water-label":{color:"#9fbcd1",haloColor:"#131b20",haloWidth:1.4},"place-label":{color:"#f3e0ce",haloColor:"#150b09",haloWidth:1.4},"poi-food":{color:"#d89964",haloColor:"#150b09",haloWidth:1.4,frameColor:"#d89964",frameOpacity:1,frameHaloColor:"#150b09",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-shop":{color:"#699cd4",haloColor:"#150b09",haloWidth:1.4,frameColor:"#699cd4",frameOpacity:1,frameHaloColor:"#150b09",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-transport":{color:"#75acc8",haloColor:"#150b09",haloWidth:1.4,frameColor:"#75acc8",frameOpacity:1,frameHaloColor:"#150b09",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-health":{color:"#ca7272",haloColor:"#150b09",haloWidth:1.4,frameColor:"#ca7272",frameOpacity:1,frameHaloColor:"#150b09",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-education":{color:"#81bbb7",haloColor:"#150b09",haloWidth:1.4,frameColor:"#81bbb7",frameOpacity:1,frameHaloColor:"#150b09",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-culture":{color:"#a684b8",haloColor:"#150b09",haloWidth:1.4,frameColor:"#a684b8",frameOpacity:1,frameHaloColor:"#150b09",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-sport":{color:"#89bb81",haloColor:"#150b09",haloWidth:1.4,frameColor:"#89bb81",frameOpacity:1,frameHaloColor:"#150b09",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-lodging":{color:"#8e79c3",haloColor:"#150b09",haloWidth:1.4,frameColor:"#8e79c3",frameOpacity:1,frameHaloColor:"#150b09",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-service":{color:"#959ea7",haloColor:"#150b09",haloWidth:1.4,frameColor:"#959ea7",frameOpacity:1,frameHaloColor:"#150b09",iconColor:"#1b1b1b",iconHaloWidth:0},"water-pool":{color:"#c2531a"},"indoor-shell":{color:"#564039",opacity:.97},"indoor-corridor":{color:"#503b35"},"indoor-room":{color:"#604840"},"indoor-service":{color:"#7b5c52"},"indoor-shop":{color:"#5c4672"},"indoor-food":{color:"#725d46"},"indoor-wc":{color:"#466172"},"indoor-wall":{color:"#856f68",roofColor:"#9a8a85",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#66558a",opacity:.95},"indoor-door":{color:"#f09e4c",haloColor:"#150b09",haloWidth:1.4},"indoor-poi":{color:"#f09e4c",haloColor:"#150b09",haloWidth:1.4},"indoor-name":{color:"#f3e0ce",haloColor:"#150b09",haloWidth:1.4},"building-entrance":{color:"#79a0d7",haloColor:"#150b09"}},sky:{skyColor:"#1c100a",horizonColor:"#312a27",fogRange:[2.34,8.8],fogIntensity:.9,spaceColor:"#070605",atmosphereColor:"#ba6336",starIntensity:.78}};var hu={name:"\u0411\u0435\u043B\u0430\u044F",background:"#f5f1f0",light:{ambientColor:"#fafafa",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#ffffff",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#dee8ed",fillIntensity:.18},paint:{"landcover-wood":{color:"#a7e2a2"},"landcover-grass":{color:"#b8ebad"},"landcover-sand":{color:"#efeac8"},"landcover-ice":{color:"#d7eaf4"},"landcover-wetland":{color:"#c1dee1"},"landuse-residential":{color:"#f6f4f4"},"landuse-industrial":{color:"#e0e2eb"},"landuse-civic":{color:"#efe1e6"},"landuse-sport":{color:"#c0f0a8"},"landuse-cemetery":{color:"#c8e5c2"},"landuse-parking":{color:"#e4e2e2"},park:{color:"#b8ebad"},"aeroway-area":{color:"#d6dbeb"},water:{color:"#99ddff"},waterway:{color:"#99ddff"},"aeroway-line":{color:"#f0ede9"},"road-casing-major":{color:"#94a0b8"},"road-casing-secondary":{color:{stops:[[16,"#a3adc2"],[18.5,"#94a0b8"]]}},"road-casing-minor":{color:{stops:[[16,"#a3adc2"],[18.5,"#94a0b8"]]}},"road-rail":{color:"#a6a6a6"},"road-path":{color:"#bfc6d9"},"road-minor":{color:{stops:[[16,"#bfc6d9"],[18.5,"#a1b0c4"]]}},"road-secondary":{color:{stops:[[16,"#bfc6d9"],[18.5,"#a1b0c4"]]}},"road-ramp":{color:"#a1b0c4"},"road-major":{color:"#a1b0c4"},boundary:{color:"#f87797"},building:{color:"#ffffff",roofColor:"#ffffff",aoStrength:.19,tintVariation:.06,windowColor:"#6b9ed1",windowFrameColor:"#ffffff",windowGlow:0},housenumber:{color:"#262626",haloColor:"#ffffff",haloWidth:1.4},poi:{color:"#586e84",haloColor:"#ffffff",haloWidth:1.4},"road-label":{color:"#262626",haloColor:"#ffffff",haloWidth:1.4},"water-label":{color:"#35688d",haloColor:"#f7f7f7",haloWidth:1.4},"place-label":{color:"#262626",haloColor:"#ffffff",haloWidth:1.4},"poi-food":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#c2681c",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#2f77c4",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#3b82a6",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#c24444",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#3f7f7a",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#8b5aa5",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#4f8b45",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#7a5fbf",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#59636e",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"water-pool":{color:"#b1e5ff"},"indoor-shell":{color:"#f7f7f7",opacity:.97},"indoor-corridor":{color:"#fbfbfb"},"indoor-room":{color:"#efefef"},"indoor-service":{color:"#dbdbdb"},"indoor-shop":{color:"#e4dfea"},"indoor-food":{color:"#eae4df"},"indoor-wc":{color:"#dfe5ea"},"indoor-wall":{color:"#cdcdcd",roofColor:"#e2e2e2",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#d0cbdc",opacity:.95},"indoor-door":{color:"#586e84",haloColor:"#ffffff",haloWidth:1.4},"indoor-poi":{color:"#586e84",haloColor:"#ffffff",haloWidth:1.4},"indoor-name":{color:"#262626",haloColor:"#ffffff",haloWidth:1.4},"building-entrance":{color:"#225aaa",haloColor:"#ffffff"}},sky:{skyColor:"#9bbecf",horizonColor:"#e5dfdc",fogRange:[2.43,9.99],fogIntensity:.85,spaceColor:"#0f0c0a",atmosphereColor:"#5eaad0",starIntensity:.38}};var du={"3d":Xf,cartoon:Jf,cyberpunk:jf,dawn:Yf,dusk:Zf,earth:qf,future:Qf,"glass-refined":$f,glass:eu,"harmony-black":tu,"harmony-blue":ou,"harmony-green":ru,lunar:nu,matte:iu,minimal:au,ocean:su,premium:lu,realistic:cu,space:fu,volcano:uu,white:hu};function wi(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 De="base",mu="\u241F",Ot=(n,e)=>n+"\u241F"+String(e);function F1(n){for(let e of n){if(e.type!=="line"||!e.yieldTo)continue;let t=n.find(o=>o.id===e.yieldTo);t?.type!=="surface"&&console.warn(`[osmgl] \u0441\u043B\u043E\u0439 \xAB${e.id}\xBB \u0443\u0441\u0442\u0443\u043F\u0430\u0435\u0442 \xAB${e.yieldTo}\xBB, \u0430 \u044D\u0442\u043E `+(t?`\u0441\u043B\u043E\u0439 \u0442\u0438\u043F\u0430 \xAB${t.type}\xBB \u2014 \u0443\u0441\u0442\u0443\u043F\u0438\u0442\u044C \u043C\u043E\u0436\u043D\u043E \u0442\u043E\u043B\u044C\u043A\u043E \u043F\u043E\u0432\u0435\u0440\u0445\u043D\u043E\u0441\u0442\u0438`:"\u043D\u0435 \u0441\u043B\u043E\u0439 \u044D\u0442\u043E\u0433\u043E \u0441\u0442\u0438\u043B\u044F"));}}var Xo=class{constructor(e=vi){this.splitValues={};this.spec=e,this.light={...ms,...e.light??{}},this.sky={...ds,...e.sky??{}},this.layers=e.layers.map(t=>({...t,paint:{...t.paint}})),F1(this.layers);}get background(){return Ve(this.spec.background??"#eceae4")}colorAt(e,t,o=[1,0,1,1]){let i=e.paint?.color;if(i&&typeof i=="object"&&"from"in i){let s=this.layers.find(f=>f.id===i.from)?.paint?.color,l=ht(s,t,o),c=1-Math.min(Math.max(i.darken??0,0),1);return [l[0]*c,l[1]*c,l[2]*c,l[3]]}return ht(i,t,o)}layerVisibleAt(e,t){return !(e.visible===false||e.minzoom!==void 0&&t<e.minzoom||e.maxzoom!==void 0&&t>=e.maxzoom)}workerPlan(e=De){return this.layers.filter(t=>t.type!=="raster").filter(t=>(t.source??De)===e).map(t=>({id:t.id,type:t.type,sourceLayer:t["source-layer"],filter:t.filter,minzoom:t.minzoom??0,maxzoom:t.maxzoom??24,...t.splitBy?{splitBy:t.splitBy}:{},...t.type==="line"&&t.network?{network:t.network}:{},...t.cornerRadius?{cornerRadius:t.cornerRadius,cornerSegments:t.cornerSegments}:{},...t.clipToTile?{clipToTile:true}:{},...t.groundBy?{groundBy:t.groundBy}:{},...t.type==="surface"?{elevation:t.elevation,base:t.base,bevel:t.bevel,bevelDrop:t.bevelDrop,weld:t.weld,...t.groundField===false?{groundField:false}:{},levelHeight:this.spec.levelHeight,...t.deck?{deck:t.deck}:{},...t.fromLines?{fromLines:true,width:t.width,widthExtra:t.widthExtra}:{}}:{},...t.type==="line"&&typeof t.paint?.elevation=="number"&&t.paint.elevation>0?{ground:true}:{},...I1(t),...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??De))]}bucketKeyFor(e){if(e.type==="raster"||!e.splitBy)return e.id;let t=this.splitValues[e.splitBy];return t===void 0?null:Ot(e.id,t)}sourceLayers(){return [...new Set(this.layers.flatMap(e=>e.type==="raster"?[]:[e["source-layer"]]))]}};function jt(n){if(n.type!=="fill"&&n.type!=="line"&&n.type!=="fill-extrusion")return null;let e=n.paint;if(!e)return null;let t=St(e.color)?e.color:void 0,o=St(e.opacity)?e.opacity:void 0,r=n.type==="line"&&St(e.width)?e.width:void 0;return t===void 0&&o===void 0&&r===void 0?null:(oi(t),oi(o),oi(r),{...t!==void 0?{color:t}:{},...o!==void 0?{opacity:o}:{},...r!==void 0?{width:r}:{},...t===void 0&&D1(e.color)?{base:e.color}:{}})}function I1(n){let e=jt(n);return e?{dataPaint:e}:{}}function D1(n){return n===void 0?false:typeof n=="string"||Array.isArray(n)?true:typeof n=="object"&&n!==null&&"stops"in n}var vi=Lf,T1=Of,k1=Rf,L1=Pf,R1=Hf;function P1(n,e,t){let o=/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i;if(typeof n!="string"||typeof e!="string")return n;let r=o.exec(n),i=o.exec(e);if(!r||!i)return n;let a=s=>{let l=Math.round(parseInt(r[s],16)*(1-t)+parseInt(i[s],16)*t);return Math.max(0,Math.min(255,l)).toString(16).padStart(2,"0")};return `#${a(1)}${a(2)}${a(3)}`}function Ci(n,e){if(typeof n!="string")return n;let t=/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i.exec(n);if(!t)return n;let o=r=>Math.round(parseInt(t[r],16)*e).toString(16).padStart(2,"0");return `#${o(1)}${o(2)}${o(3)}`}function ps(n,e,t,o){let r=n.paint?.building;return r?{...n,name:e,paint:{...n.paint,building:{...r,windowColor:Ci(r.color,t),windowGlow:0,...o}}}:{...n,name:e}}var bu=.93;function H1(n){let e=n.paint?.building;return e?{...n,paint:{...n.paint,building:{...e,windowFrameColor:Ci(e.color,bu)}}}:n}function O1(n){let e=n.paint,t=e?.building;if(!e||!t)return n;let o=t.color;if(typeof o!="string")return n;let r={ice:t.ice,aoStrength:t.aoStrength,tintVariation:t.tintVariation,seamStrength:t.seamStrength,roofVariation:t.roofVariation,windowFrameColor:t.windowFrameColor,facadeDetail:0},i=W1(n.background),a=(m,p)=>p<=1?Ci(m,p):P1(m,"#ffffff",p-1),s=o,l=a(o,i?1.05:.97),c=a(o,i?1.08:.96),f=a(c,i?1.18:1.1),u=a(o,i?.82:.94),h={...e};h["indoor-venue"]={...e["indoor-venue"]??{},...t},h["indoor-shell"]={...e["indoor-shell"]??{},color:u},h["indoor-wall"]={...e["indoor-wall"]??{},...r,color:c,roofColor:f},h["indoor-room"]={...e["indoor-room"]??{},...r,color:s},h["indoor-corridor"]={...e["indoor-corridor"]??{},...r,color:l},h["indoor-transportation"]={...e["indoor-transportation"]??{},...r,color:a(o,i?1.14:.93)};let d=pu("indoor-room");for(let m of ["indoor-shop","indoor-food","indoor-wc","indoor-service"]){let p=e[m]??{},{roofColor:b,...g}={...p,...r},y=pu(m);h[m]={...g,color:d&&y?z1(s,d,y,G1):s};}return {...n,paint:h}}var G1=.85;function pu(n){let e=vi.layers.find(t=>t.id===n)?.paint;return typeof e?.color=="string"?e.color:void 0}function z1(n,e,t,o){let r=/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i,i=r.exec(typeof n=="string"?n:""),a=r.exec(e),s=r.exec(t);if(!i||!a||!s)return n;let l=c=>{let f=Math.round(parseInt(i[c],16)+(parseInt(s[c],16)-parseInt(a[c],16))*o);return Math.max(0,Math.min(255,f)).toString(16).padStart(2,"0")};return `#${l(1)}${l(2)}${l(3)}`}function W1(n){let e=/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i.exec(typeof n=="string"?n:"");if(!e)return false;let[t,o,r]=[1,2,3].map(i=>parseInt(e[i],16)/255);return .2126*t+.7152*o+.0722*r<.45}function Bi(n){let e=n.paint?.building;return e?{...n,paint:{...n.paint,building:{...e,ice:1,seamStrength:0,windowFrameColor:Ci(e.color,bu)}}}:n}function N1(n){let e=n.paint?.building;return !e||typeof e.color!="string"?n:{...n,paint:{...n.paint,building:{...e,roofColor:e.color}}}}var je={day:{name:"\u0414\u043D\u0435\u0432\u043D\u0430\u044F"},night:Gf,mono:zf,pale:Nf,ice:Wf,...du,...Kf};je["3d"]=Bi(je["3d"]);je.night=Bi(je.night);je.ice=H1(je.ice);je["atlas-day"]=Bi(je["atlas-day"]);je["atlas-night"]=N1(Bi(je["atlas-night"]));je["3d-tone"]=ps(je["3d"],"\u0421\u0432\u0435\u0442\u043B\u0430\u044F, \u043E\u043A\u043D\u0430 \u0432 \u0442\u043E\u043D",1,{windowVariation:0,windowRecess:.12,windowRecessShade:0,seamStrength:0});je["night-tone"]=ps(je.night,"\u0422\u0451\u043C\u043D\u0430\u044F, \u043E\u043A\u043D\u0430 \u0432 \u0442\u043E\u043D",1,{windowVariation:1,seamStrength:0});je["ice-tone"]=ps(je.ice,"\u041B\u0435\u0434\u044F\u043D\u0430\u044F, \u043E\u043A\u043D\u0430 \u0432 \u0442\u043E\u043D",1,{windowVariation:0,windowRecess:.12,windowRecessShade:0,seamStrength:0});for(let n of Object.keys(je))je[n]=O1(je[n]);function Nr(n,e=vi){if(typeof n!="string")return wi(e,n);if(n==="day")return e;let t=je[n];return t?wi(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(je).join(", ")}`),e)}var Vr=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 gu(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 Ur=`
9
+ `);let i=e+(t?" ":"\u2502 ");n.left&&Va(n.left,i,false,o,r),n.right&&Va(n.right,i,true,o,r);}}var Wo=class{constructor(e=s0){this._root=null,this._size=0,this._comparator=e;}insert(e,t){return this._size++,this._root=Na(e,t,this._root,this._comparator)}add(e,t){let o=new Ht(e,t);this._root===null&&(o.left=o.right=null,this._size++,this._root=o);let r=this._comparator,i=ro(e,this._root,r),a=r(e,i.key);return a===0?this._root=i:(a<0?(o.left=i.left,o.right=i,i.left=null):a>0&&(o.right=i.right,o.left=i,i.right=null),this._size++,this._root=o),this._root}remove(e){this._root=this._remove(e,this._root,this._comparator);}_remove(e,t,o){let r;return t===null?null:(t=ro(e,t,o),o(e,t.key)===0?(t.left===null?r=t.right:(r=ro(e,t.left,o),r.right=t.right),this._size--,r):t)}pop(){let e=this._root;if(e){for(;e.left;)e=e.left;return this._root=ro(e.key,this._root,this._comparator),this._root=this._remove(e.key,this._root,this._comparator),{key:e.key,data:e.data}}return null}findStatic(e){let t=this._root,o=this._comparator;for(;t;){let r=o(e,t.key);if(r===0)return t;r<0?t=t.left:t=t.right;}return null}find(e){return this._root&&(this._root=ro(e,this._root,this._comparator),this._comparator(e,this._root.key)!==0)?null:this._root}contains(e){let t=this._root,o=this._comparator;for(;t;){let r=o(e,t.key);if(r===0)return true;r<0?t=t.left:t=t.right;}return false}forEach(e,t){let o=this._root,r=[],i=false;for(;!i;)o!==null?(r.push(o),o=o.left):r.length!==0?(o=r.pop(),e.call(t,o),o=o.right):i=true;return this}range(e,t,o,r){let i=[],a=this._comparator,s=this._root,l;for(;i.length!==0||s;)if(s)i.push(s),s=s.left;else {if(s=i.pop(),l=a(s.key,t),l>0)break;if(a(s.key,e)>=0&&o.call(r,s))return this;s=s.right;}return this}keys(){let e=[];return this.forEach(({key:t})=>{e.push(t);}),e}values(){let e=[];return this.forEach(({data:t})=>{e.push(t);}),e}min(){return this._root?this.minNode(this._root).key:null}max(){return this._root?this.maxNode(this._root).key:null}minNode(e=this._root){if(e)for(;e.left;)e=e.left;return e}maxNode(e=this._root){if(e)for(;e.right;)e=e.right;return e}at(e){let t=this._root,o=false,r=0,i=[];for(;!o;)if(t)i.push(t),t=t.left;else if(i.length>0){if(t=i.pop(),r===e)return t;r++,t=t.right;}else o=true;return null}next(e){let t=this._root,o=null;if(e.right){for(o=e.right;o.left;)o=o.left;return o}let r=this._comparator;for(;t;){let i=r(e.key,t.key);if(i===0)break;i<0?(o=t,t=t.left):t=t.right;}return o}prev(e){let t=this._root,o=null;if(e.left!==null){for(o=e.left;o.right;)o=o.right;return o}let r=this._comparator;for(;t;){let i=r(e.key,t.key);if(i===0)break;i<0?t=t.left:(o=t,t=t.right);}return o}clear(){return this._root=null,this._size=0,this}toList(){return f0(this._root)}load(e,t=[],o=false){let r=e.length,i=this._comparator;if(o&&Xa(e,t,0,r-1,i),this._root===null)this._root=Ua(e,t,0,r),this._size=r;else {let a=u0(this.toList(),c0(e,t),i);r=this._size+r,this._root=Ka({head:a},0,r);}return this}isEmpty(){return this._root===null}get size(){return this._size}get root(){return this._root}toString(e=t=>String(t.key)){let t=[];return Va(this._root,"",true,o=>t.push(o),e),t.join("")}update(e,t,o){let r=this._comparator,{left:i,right:a}=rf(e,this._root,r);r(e,t)<0?a=Na(t,o,a,r):i=Na(t,o,i,r),this._root=l0(i,a,r);}split(e){return rf(e,this._root,this._comparator)}*[Symbol.iterator](){let e=this._root,t=[],o=false;for(;!o;)e!==null?(t.push(e),e=e.left):t.length!==0?(e=t.pop(),yield e,e=e.right):o=true;}};function Ua(n,e,t,o){let r=o-t;if(r>0){let i=t+Math.floor(r/2),a=n[i],s=e[i],l=new Ht(a,s);return l.left=Ua(n,e,t,i),l.right=Ua(n,e,i+1,o),l}return null}function c0(n,e){let t=new Ht(null,null),o=t;for(let r=0;r<n.length;r++)o=o.next=new Ht(n[r],e[r]);return o.next=null,t.next}function f0(n){let e=n,t=[],o=false,r=new Ht(null,null),i=r;for(;!o;)e?(t.push(e),e=e.left):t.length>0?(e=i=i.next=t.pop(),e=e.right):o=true;return i.next=null,r.next}function Ka(n,e,t){let o=t-e;if(o>0){let r=e+Math.floor(o/2),i=Ka(n,e,r),a=n.head;return a.left=i,n.head=n.head.next,a.right=Ka(n,r+1,t),a}return null}function u0(n,e,t){let o=new Ht(null,null),r=o,i=n,a=e;for(;i!==null&&a!==null;)t(i.key,a.key)<0?(r.next=i,i=i.next):(r.next=a,a=a.next),r=r.next;return i!==null?r.next=i:a!==null&&(r.next=a),o.next}function Xa(n,e,t,o,r){if(t>=o)return;let i=n[t+o>>1],a=t-1,s=o+1;for(;;){do a++;while(r(n[a],i)<0);do s--;while(r(n[s],i)>0);if(a>=s)break;let l=n[a];n[a]=n[s],n[s]=l,l=e[a],e[a]=e[s],e[s]=l;}Xa(n,e,t,s,r),Xa(n,e,s+1,o,r);}var ze=11102230246251565e-32,tt=134217729,Tr=(3+8*ze)*ze;function vo(n,e,t,o,r){let i,a,s,l,c=e[0],f=o[0],u=0,h=0;f>c==f>-c?(i=c,c=e[++u]):(i=f,f=o[++h]);let d=0;if(u<n&&h<t)for(f>c==f>-c?(a=c+i,s=i-(a-c),c=e[++u]):(a=f+i,s=i-(a-f),f=o[++h]),i=a,s!==0&&(r[d++]=s);u<n&&h<t;)f>c==f>-c?(a=i+c,l=a-i,s=i-(a-l)+(c-l),c=e[++u]):(a=i+f,l=a-i,s=i-(a-l)+(f-l),f=o[++h]),i=a,s!==0&&(r[d++]=s);for(;u<n;)a=i+c,l=a-i,s=i-(a-l)+(c-l),c=e[++u],i=a,s!==0&&(r[d++]=s);for(;h<t;)a=i+f,l=a-i,s=i-(a-l)+(f-l),f=o[++h],i=a,s!==0&&(r[d++]=s);return (i!==0||d===0)&&(r[d++]=i),d}function kr(n,e){let t=e[0];for(let o=1;o<n;o++)t+=e[o];return t}function le(n){return new Float64Array(n)}var h0=(3+16*ze)*ze,d0=(2+12*ze)*ze,m0=(9+64*ze)*ze*ze,No=le(4),nf=le(8),af=le(12),sf=le(16),ft=le(4);function p0(n,e,t,o,r,i,a){let s,l,c,f,u,h,d,m,p,b,g,y,A,x,v,w,C,B,_=n-r,T=t-r,k=e-i,K=o-i;x=_*K,h=tt*_,d=h-(h-_),m=_-d,h=tt*K,p=h-(h-K),b=K-p,v=m*b-(x-d*p-m*p-d*b),w=k*T,h=tt*k,d=h-(h-k),m=k-d,h=tt*T,p=h-(h-T),b=T-p,C=m*b-(w-d*p-m*p-d*b),g=v-C,u=v-g,No[0]=v-(g+u)+(u-C),y=x+g,u=y-x,A=x-(y-u)+(g-u),g=A-w,u=A-g,No[1]=A-(g+u)+(u-w),B=y+g,u=B-y,No[2]=y-(B-u)+(g-u),No[3]=B;let P=kr(4,No),W=d0*a;if(P>=W||-P>=W||(u=n-_,s=n-(_+u)+(u-r),u=t-T,c=t-(T+u)+(u-r),u=e-k,l=e-(k+u)+(u-i),u=o-K,f=o-(K+u)+(u-i),s===0&&l===0&&c===0&&f===0)||(W=m0*a+Tr*Math.abs(P),P+=_*f+K*s-(k*c+T*l),P>=W||-P>=W))return P;x=s*K,h=tt*s,d=h-(h-s),m=s-d,h=tt*K,p=h-(h-K),b=K-p,v=m*b-(x-d*p-m*p-d*b),w=l*T,h=tt*l,d=h-(h-l),m=l-d,h=tt*T,p=h-(h-T),b=T-p,C=m*b-(w-d*p-m*p-d*b),g=v-C,u=v-g,ft[0]=v-(g+u)+(u-C),y=x+g,u=y-x,A=x-(y-u)+(g-u),g=A-w,u=A-g,ft[1]=A-(g+u)+(u-w),B=y+g,u=B-y,ft[2]=y-(B-u)+(g-u),ft[3]=B;let z=vo(4,No,4,ft,nf);x=_*f,h=tt*_,d=h-(h-_),m=_-d,h=tt*f,p=h-(h-f),b=f-p,v=m*b-(x-d*p-m*p-d*b),w=k*c,h=tt*k,d=h-(h-k),m=k-d,h=tt*c,p=h-(h-c),b=c-p,C=m*b-(w-d*p-m*p-d*b),g=v-C,u=v-g,ft[0]=v-(g+u)+(u-C),y=x+g,u=y-x,A=x-(y-u)+(g-u),g=A-w,u=A-g,ft[1]=A-(g+u)+(u-w),B=y+g,u=B-y,ft[2]=y-(B-u)+(g-u),ft[3]=B;let L=vo(z,nf,4,ft,af);x=s*f,h=tt*s,d=h-(h-s),m=s-d,h=tt*f,p=h-(h-f),b=f-p,v=m*b-(x-d*p-m*p-d*b),w=l*c,h=tt*l,d=h-(h-l),m=l-d,h=tt*c,p=h-(h-c),b=c-p,C=m*b-(w-d*p-m*p-d*b),g=v-C,u=v-g,ft[0]=v-(g+u)+(u-C),y=x+g,u=y-x,A=x-(y-u)+(g-u),g=A-w,u=A-g,ft[1]=A-(g+u)+(u-w),B=y+g,u=B-y,ft[2]=y-(B-u)+(g-u),ft[3]=B;let X=vo(L,af,4,ft,sf);return sf[X-1]}function Ja(n,e,t,o,r,i){let a=(e-i)*(t-r),s=(n-r)*(o-i),l=a-s,c=Math.abs(a+s);return Math.abs(l)>=h0*c?l:-p0(n,e,t,o,r,i,c)}var Lr=(n,e)=>n.ll.x<=e.x&&e.x<=n.ur.x&&n.ll.y<=e.y&&e.y<=n.ur.y,ja=(n,e)=>{if(e.ur.x<n.ll.x||n.ur.x<e.ll.x||e.ur.y<n.ll.y||n.ur.y<e.ll.y)return null;let t=n.ll.x<e.ll.x?e.ll.x:n.ll.x,o=n.ur.x<e.ur.x?n.ur.x:e.ur.x,r=n.ll.y<e.ll.y?e.ll.y:n.ll.y,i=n.ur.y<e.ur.y?n.ur.y:e.ur.y;return {ll:{x:t,y:r},ur:{x:o,y:i}}},no=Number.EPSILON;no===void 0&&(no=Math.pow(2,-52));var g0=no*no,cf=(n,e)=>{if(-no<n&&n<no&&-no<e&&e<no)return 0;let t=n-e;return t*t<g0*n*e?0:n<e?-1:1},Ya=class{constructor(){this.reset();}reset(){this.xRounder=new ai,this.yRounder=new ai;}round(e,t){return {x:this.xRounder.round(e),y:this.yRounder.round(t)}}},ai=class{constructor(){this.tree=new Wo,this.round(0);}round(e){let t=this.tree.add(e),o=this.tree.prev(t);if(o!==null&&cf(t.key,o.key)===0)return this.tree.remove(e),o.key;let r=this.tree.next(t);return r!==null&&cf(t.key,r.key)===0?(this.tree.remove(e),r.key):e}},Rr=new Ya,ii=(n,e)=>n.x*e.y-n.y*e.x,mf=(n,e)=>n.x*e.x+n.y*e.y,ff=(n,e,t)=>{let o=Ja(n.x,n.y,e.x,e.y,t.x,t.y);return o>0?-1:o<0?1:0},si=n=>Math.sqrt(mf(n,n)),y0=(n,e,t)=>{let o={x:e.x-n.x,y:e.y-n.y},r={x:t.x-n.x,y:t.y-n.y};return ii(r,o)/si(r)/si(o)},A0=(n,e,t)=>{let o={x:e.x-n.x,y:e.y-n.y},r={x:t.x-n.x,y:t.y-n.y};return mf(r,o)/si(r)/si(o)},uf=(n,e,t)=>e.y===0?null:{x:n.x+e.x/e.y*(t-n.y),y:t},hf=(n,e,t)=>e.x===0?null:{x:t,y:n.y+e.y/e.x*(t-n.x)},x0=(n,e,t,o)=>{if(e.x===0)return hf(t,o,n.x);if(o.x===0)return hf(n,e,t.x);if(e.y===0)return uf(t,o,n.y);if(o.y===0)return uf(n,e,t.y);let r=ii(e,o);if(r==0)return null;let i={x:t.x-n.x,y:t.y-n.y},a=ii(i,e)/r,s=ii(i,o)/r,l=n.x+s*e.x,c=t.x+a*o.x,f=n.y+s*e.y,u=t.y+a*o.y,h=(l+c)/2,d=(f+u)/2;return {x:h,y:d}},Ct=class n{static compare(e,t){let o=n.comparePoints(e.point,t.point);return o!==0?o:(e.point!==t.point&&e.link(t),e.isLeft!==t.isLeft?e.isLeft?1:-1:Vo.compare(e.segment,t.segment))}static comparePoints(e,t){return e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:e.y>t.y?1:0}constructor(e,t){e.events===void 0?e.events=[this]:e.events.push(this),this.point=e,this.isLeft=t;}link(e){if(e.point===this.point)throw new Error("Tried to link already linked events");let t=e.point.events;for(let o=0,r=t.length;o<r;o++){let i=t[o];this.point.events.push(i),i.point=this.point;}this.checkForConsuming();}checkForConsuming(){let e=this.point.events.length;for(let t=0;t<e;t++){let o=this.point.events[t];if(o.segment.consumedBy===void 0)for(let r=t+1;r<e;r++){let i=this.point.events[r];i.consumedBy===void 0&&o.otherSE.point.events===i.otherSE.point.events&&o.segment.consume(i.segment);}}}getAvailableLinkedEvents(){let e=[];for(let t=0,o=this.point.events.length;t<o;t++){let r=this.point.events[t];r!==this&&!r.segment.ringOut&&r.segment.isInResult()&&e.push(r);}return e}getLeftmostComparator(e){let t=new Map,o=r=>{let i=r.otherSE;t.set(r,{sine:y0(this.point,e.point,i.point),cosine:A0(this.point,e.point,i.point)});};return (r,i)=>{t.has(r)||o(r),t.has(i)||o(i);let{sine:a,cosine:s}=t.get(r),{sine:l,cosine:c}=t.get(i);return a>=0&&l>=0?s<c?1:s>c?-1:0:a<0&&l<0?s<c?-1:s>c?1:0:l<a?-1:l>a?1:0}}},w0=0,Vo=class n{static compare(e,t){let o=e.leftSE.point.x,r=t.leftSE.point.x,i=e.rightSE.point.x,a=t.rightSE.point.x;if(a<o)return 1;if(i<r)return -1;let s=e.leftSE.point.y,l=t.leftSE.point.y,c=e.rightSE.point.y,f=t.rightSE.point.y;if(o<r){if(l<s&&l<c)return 1;if(l>s&&l>c)return -1;let u=e.comparePoint(t.leftSE.point);if(u<0)return 1;if(u>0)return -1;let h=t.comparePoint(e.rightSE.point);return h!==0?h:-1}if(o>r){if(s<l&&s<f)return -1;if(s>l&&s>f)return 1;let u=t.comparePoint(e.leftSE.point);if(u!==0)return u;let h=e.comparePoint(t.rightSE.point);return h<0?1:h>0?-1:1}if(s<l)return -1;if(s>l)return 1;if(i<a){let u=t.comparePoint(e.rightSE.point);if(u!==0)return u}if(i>a){let u=e.comparePoint(t.rightSE.point);if(u<0)return 1;if(u>0)return -1}if(i!==a){let u=c-s,h=i-o,d=f-l,m=a-r;if(u>h&&d<m)return 1;if(u<h&&d>m)return -1}return i>a?1:i<a||c<f?-1:c>f?1:e.id<t.id?-1:e.id>t.id?1:0}constructor(e,t,o,r){this.id=++w0,this.leftSE=e,e.segment=this,e.otherSE=t,this.rightSE=t,t.segment=this,t.otherSE=e,this.rings=o,this.windings=r;}static fromRing(e,t,o){let r,i,a,s=Ct.comparePoints(e,t);if(s<0)r=e,i=t,a=1;else if(s>0)r=t,i=e,a=-1;else throw new Error(`Tried to create degenerate segment at [${e.x}, ${e.y}]`);let l=new Ct(r,true),c=new Ct(i,false);return new n(l,c,[o],[a])}replaceRightSE(e){this.rightSE=e,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE;}bbox(){let e=this.leftSE.point.y,t=this.rightSE.point.y;return {ll:{x:this.leftSE.point.x,y:e<t?e:t},ur:{x:this.rightSE.point.x,y:e>t?e:t}}}vector(){return {x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}isAnEndpoint(e){return e.x===this.leftSE.point.x&&e.y===this.leftSE.point.y||e.x===this.rightSE.point.x&&e.y===this.rightSE.point.y}comparePoint(e){if(this.isAnEndpoint(e))return 0;let t=this.leftSE.point,o=this.rightSE.point,r=this.vector();if(t.x===o.x)return e.x===t.x?0:e.x<t.x?1:-1;let i=(e.y-t.y)/r.y,a=t.x+i*r.x;if(e.x===a)return 0;let s=(e.x-t.x)/r.x,l=t.y+s*r.y;return e.y===l?0:e.y<l?-1:1}getIntersection(e){let t=this.bbox(),o=e.bbox(),r=ja(t,o);if(r===null)return null;let i=this.leftSE.point,a=this.rightSE.point,s=e.leftSE.point,l=e.rightSE.point,c=Lr(t,s)&&this.comparePoint(s)===0,f=Lr(o,i)&&e.comparePoint(i)===0,u=Lr(t,l)&&this.comparePoint(l)===0,h=Lr(o,a)&&e.comparePoint(a)===0;if(f&&c)return h&&!u?a:!h&&u?l:null;if(f)return u&&i.x===l.x&&i.y===l.y?null:i;if(c)return h&&a.x===s.x&&a.y===s.y?null:s;if(h&&u)return null;if(h)return a;if(u)return l;let d=x0(i,this.vector(),s,e.vector());return d===null||!Lr(r,d)?null:Rr.round(d.x,d.y)}split(e){let t=[],o=e.events!==void 0,r=new Ct(e,true),i=new Ct(e,false),a=this.rightSE;this.replaceRightSE(i),t.push(i),t.push(r);let s=new n(r,a,this.rings.slice(),this.windings.slice());return Ct.comparePoints(s.leftSE.point,s.rightSE.point)>0&&s.swapEvents(),Ct.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),o&&(r.checkForConsuming(),i.checkForConsuming()),t}swapEvents(){let e=this.rightSE;this.rightSE=this.leftSE,this.leftSE=e,this.leftSE.isLeft=true,this.rightSE.isLeft=false;for(let t=0,o=this.windings.length;t<o;t++)this.windings[t]*=-1;}consume(e){let t=this,o=e;for(;t.consumedBy;)t=t.consumedBy;for(;o.consumedBy;)o=o.consumedBy;let r=n.compare(t,o);if(r!==0){if(r>0){let i=t;t=o,o=i;}if(t.prev===o){let i=t;t=o,o=i;}for(let i=0,a=o.rings.length;i<a;i++){let s=o.rings[i],l=o.windings[i],c=t.rings.indexOf(s);c===-1?(t.rings.push(s),t.windings.push(l)):t.windings[c]+=l;}o.rings=null,o.windings=null,o.consumedBy=t,o.leftSE.consumedBy=t.leftSE,o.rightSE.consumedBy=t.rightSE;}}prevInResult(){return this._prevInResult!==void 0?this._prevInResult:(this.prev?this.prev.isInResult()?this._prevInResult=this.prev:this._prevInResult=this.prev.prevInResult():this._prevInResult=null,this._prevInResult)}beforeState(){if(this._beforeState!==void 0)return this._beforeState;if(!this.prev)this._beforeState={rings:[],windings:[],multiPolys:[]};else {let e=this.prev.consumedBy||this.prev;this._beforeState=e.afterState();}return this._beforeState}afterState(){if(this._afterState!==void 0)return this._afterState;let e=this.beforeState();this._afterState={rings:e.rings.slice(0),windings:e.windings.slice(0),multiPolys:[]};let t=this._afterState.rings,o=this._afterState.windings,r=this._afterState.multiPolys;for(let s=0,l=this.rings.length;s<l;s++){let c=this.rings[s],f=this.windings[s],u=t.indexOf(c);u===-1?(t.push(c),o.push(f)):o[u]+=f;}let i=[],a=[];for(let s=0,l=t.length;s<l;s++){if(o[s]===0)continue;let c=t[s],f=c.poly;if(a.indexOf(f)===-1)if(c.isExterior)i.push(f);else {a.indexOf(f)===-1&&a.push(f);let u=i.indexOf(c.poly);u!==-1&&i.splice(u,1);}}for(let s=0,l=i.length;s<l;s++){let c=i[s].multiPoly;r.indexOf(c)===-1&&r.push(c);}return this._afterState}isInResult(){if(this.consumedBy)return false;if(this._isInResult!==void 0)return this._isInResult;let e=this.beforeState().multiPolys,t=this.afterState().multiPolys;switch(It.type){case "union":{let o=e.length===0,r=t.length===0;this._isInResult=o!==r;break}case "intersection":{let o,r;e.length<t.length?(o=e.length,r=t.length):(o=t.length,r=e.length),this._isInResult=r===It.numMultiPolys&&o<r;break}case "xor":{let o=Math.abs(e.length-t.length);this._isInResult=o%2===1;break}case "difference":{let o=r=>r.length===1&&r[0].isSubject;this._isInResult=o(e)!==o(t);break}default:throw new Error(`Unrecognized operation type found ${It.type}`)}return this._isInResult}},li=class{constructor(e,t,o){if(!Array.isArray(e)||e.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=t,this.isExterior=o,this.segments=[],typeof e[0][0]!="number"||typeof e[0][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let r=Rr.round(e[0][0],e[0][1]);this.bbox={ll:{x:r.x,y:r.y},ur:{x:r.x,y:r.y}};let i=r;for(let a=1,s=e.length;a<s;a++){if(typeof e[a][0]!="number"||typeof e[a][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let l=Rr.round(e[a][0],e[a][1]);l.x===i.x&&l.y===i.y||(this.segments.push(Vo.fromRing(i,l,this)),l.x<this.bbox.ll.x&&(this.bbox.ll.x=l.x),l.y<this.bbox.ll.y&&(this.bbox.ll.y=l.y),l.x>this.bbox.ur.x&&(this.bbox.ur.x=l.x),l.y>this.bbox.ur.y&&(this.bbox.ur.y=l.y),i=l);}(r.x!==i.x||r.y!==i.y)&&this.segments.push(Vo.fromRing(i,r,this));}getSweepEvents(){let e=[];for(let t=0,o=this.segments.length;t<o;t++){let r=this.segments[t];e.push(r.leftSE),e.push(r.rightSE);}return e}},Za=class{constructor(e,t){if(!Array.isArray(e))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new li(e[0],this,true),this.bbox={ll:{x:this.exteriorRing.bbox.ll.x,y:this.exteriorRing.bbox.ll.y},ur:{x:this.exteriorRing.bbox.ur.x,y:this.exteriorRing.bbox.ur.y}},this.interiorRings=[];for(let o=1,r=e.length;o<r;o++){let i=new li(e[o],this,false);i.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=i.bbox.ll.x),i.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=i.bbox.ll.y),i.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=i.bbox.ur.x),i.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=i.bbox.ur.y),this.interiorRings.push(i);}this.multiPoly=t;}getSweepEvents(){let e=this.exteriorRing.getSweepEvents();for(let t=0,o=this.interiorRings.length;t<o;t++){let r=this.interiorRings[t].getSweepEvents();for(let i=0,a=r.length;i<a;i++)e.push(r[i]);}return e}},ci=class{constructor(e,t){if(!Array.isArray(e))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{typeof e[0][0][0]=="number"&&(e=[e]);}catch{}this.polys=[],this.bbox={ll:{x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY},ur:{x:Number.NEGATIVE_INFINITY,y:Number.NEGATIVE_INFINITY}};for(let o=0,r=e.length;o<r;o++){let i=new Za(e[o],this);i.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=i.bbox.ll.x),i.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=i.bbox.ll.y),i.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=i.bbox.ur.x),i.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=i.bbox.ur.y),this.polys.push(i);}this.isSubject=t;}getSweepEvents(){let e=[];for(let t=0,o=this.polys.length;t<o;t++){let r=this.polys[t].getSweepEvents();for(let i=0,a=r.length;i<a;i++)e.push(r[i]);}return e}},qa=class n{static factory(e){let t=[];for(let o=0,r=e.length;o<r;o++){let i=e[o];if(!i.isInResult()||i.ringOut)continue;let a=null,s=i.leftSE,l=i.rightSE,c=[s],f=s.point,u=[];for(;a=s,s=l,c.push(s),s.point!==f;)for(;;){let h=s.getAvailableLinkedEvents();if(h.length===0){let p=c[0].point,b=c[c.length-1].point;throw new Error(`Unable to complete output ring starting at [${p.x}, ${p.y}]. Last matching segment found ends at [${b.x}, ${b.y}].`)}if(h.length===1){l=h[0].otherSE;break}let d=null;for(let p=0,b=u.length;p<b;p++)if(u[p].point===s.point){d=p;break}if(d!==null){let p=u.splice(d)[0],b=c.splice(p.index);b.unshift(b[0].otherSE),t.push(new n(b.reverse()));continue}u.push({index:c.length,point:s.point});let m=s.getLeftmostComparator(a);l=h.sort(m)[0].otherSE;break}t.push(new n(c));}return t}constructor(e){this.events=e;for(let t=0,o=e.length;t<o;t++)e[t].segment.ringOut=this;this.poly=null;}getGeom(){let e=this.events[0].point,t=[e];for(let c=1,f=this.events.length-1;c<f;c++){let u=this.events[c].point,h=this.events[c+1].point;ff(u,e,h)!==0&&(t.push(u),e=u);}if(t.length===1)return null;let o=t[0],r=t[1];ff(o,e,r)===0&&t.shift(),t.push(t[0]);let i=this.isExteriorRing()?1:-1,a=this.isExteriorRing()?0:t.length-1,s=this.isExteriorRing()?t.length:-1,l=[];for(let c=a;c!=s;c+=i)l.push([t[c].x,t[c].y]);return l}isExteriorRing(){if(this._isExteriorRing===void 0){let e=this.enclosingRing();this._isExteriorRing=e?!e.isExteriorRing():true;}return this._isExteriorRing}enclosingRing(){return this._enclosingRing===void 0&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}_calcEnclosingRing(){let e=this.events[0];for(let r=1,i=this.events.length;r<i;r++){let a=this.events[r];Ct.compare(e,a)>0&&(e=a);}let t=e.segment.prevInResult(),o=t?t.prevInResult():null;for(;;){if(!t)return null;if(!o)return t.ringOut;if(o.ringOut!==t.ringOut)return o.ringOut.enclosingRing()!==t.ringOut?t.ringOut:t.ringOut.enclosingRing();t=o.prevInResult(),o=t?t.prevInResult():null;}}},fi=class{constructor(e){this.exteriorRing=e,e.poly=this,this.interiorRings=[];}addInterior(e){this.interiorRings.push(e),e.poly=this;}getGeom(){let e=[this.exteriorRing.getGeom()];if(e[0]===null)return null;for(let t=0,o=this.interiorRings.length;t<o;t++){let r=this.interiorRings[t].getGeom();r!==null&&e.push(r);}return e}},Qa=class{constructor(e){this.rings=e,this.polys=this._composePolys(e);}getGeom(){let e=[];for(let t=0,o=this.polys.length;t<o;t++){let r=this.polys[t].getGeom();r!==null&&e.push(r);}return e}_composePolys(e){let t=[];for(let o=0,r=e.length;o<r;o++){let i=e[o];if(!i.poly)if(i.isExteriorRing())t.push(new fi(i));else {let a=i.enclosingRing();a.poly||t.push(new fi(a)),a.poly.addInterior(i);}}return t}},$a=class{constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Vo.compare;this.queue=e,this.tree=new Wo(t),this.segments=[];}process(e){let t=e.segment,o=[];if(e.consumedBy)return e.isLeft?this.queue.remove(e.otherSE):this.tree.remove(t),o;let r=e.isLeft?this.tree.add(t):this.tree.find(t);if(!r)throw new Error(`Unable to find segment #${t.id} [${t.leftSE.point.x}, ${t.leftSE.point.y}] -> [${t.rightSE.point.x}, ${t.rightSE.point.y}] in SweepLine tree.`);let i=r,a=r,s,l;for(;s===void 0;)i=this.tree.prev(i),i===null?s=null:i.key.consumedBy===void 0&&(s=i.key);for(;l===void 0;)a=this.tree.next(a),a===null?l=null:a.key.consumedBy===void 0&&(l=a.key);if(e.isLeft){let c=null;if(s){let u=s.getIntersection(t);if(u!==null&&(t.isAnEndpoint(u)||(c=u),!s.isAnEndpoint(u))){let h=this._splitSafely(s,u);for(let d=0,m=h.length;d<m;d++)o.push(h[d]);}}let f=null;if(l){let u=l.getIntersection(t);if(u!==null&&(t.isAnEndpoint(u)||(f=u),!l.isAnEndpoint(u))){let h=this._splitSafely(l,u);for(let d=0,m=h.length;d<m;d++)o.push(h[d]);}}if(c!==null||f!==null){let u=null;c===null?u=f:f===null?u=c:u=Ct.comparePoints(c,f)<=0?c:f,this.queue.remove(t.rightSE),o.push(t.rightSE);let h=t.split(u);for(let d=0,m=h.length;d<m;d++)o.push(h[d]);}o.length>0?(this.tree.remove(t),o.push(e)):(this.segments.push(t),t.prev=s);}else {if(s&&l){let c=s.getIntersection(l);if(c!==null){if(!s.isAnEndpoint(c)){let f=this._splitSafely(s,c);for(let u=0,h=f.length;u<h;u++)o.push(f[u]);}if(!l.isAnEndpoint(c)){let f=this._splitSafely(l,c);for(let u=0,h=f.length;u<h;u++)o.push(f[u]);}}}this.tree.remove(t);}return o}_splitSafely(e,t){this.tree.remove(e);let o=e.rightSE;this.queue.remove(o);let r=e.split(t);return r.push(o),e.consumedBy===void 0&&this.tree.add(e),r}},df=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,v0=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6,es=class{run(e,t,o){It.type=e,Rr.reset();let r=[new ci(t,true)];for(let u=0,h=o.length;u<h;u++)r.push(new ci(o[u],false));if(It.numMultiPolys=r.length,It.type==="difference"){let u=r[0],h=1;for(;h<r.length;)ja(r[h].bbox,u.bbox)!==null?h++:r.splice(h,1);}if(It.type==="intersection")for(let u=0,h=r.length;u<h;u++){let d=r[u];for(let m=u+1,p=r.length;m<p;m++)if(ja(d.bbox,r[m].bbox)===null)return []}let i=new Wo(Ct.compare);for(let u=0,h=r.length;u<h;u++){let d=r[u].getSweepEvents();for(let m=0,p=d.length;m<p;m++)if(i.insert(d[m]),i.size>df)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big).")}let a=new $a(i),s=i.size,l=i.pop();for(;l;){let u=l.key;if(i.size===s){let d=u.segment;throw new Error(`Unable to pop() ${u.isLeft?"left":"right"} SweepEvent [${u.point.x}, ${u.point.y}] from segment #${d.id} [${d.leftSE.point.x}, ${d.leftSE.point.y}] -> [${d.rightSE.point.x}, ${d.rightSE.point.y}] from queue.`)}if(i.size>df)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big).");if(a.segments.length>v0)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments).");let h=a.process(u);for(let d=0,m=h.length;d<m;d++){let p=h[d];p.consumedBy===void 0&&i.insert(p);}s=i.size,l=i.pop();}Rr.reset();let c=qa.factory(a.segments);return new Qa(c).getGeom()}},It=new es,C0=function(n){for(var e=arguments.length,t=new Array(e>1?e-1:0),o=1;o<e;o++)t[o-1]=arguments[o];return It.run("union",n,t)},B0=function(n){for(var e=arguments.length,t=new Array(e>1?e-1:0),o=1;o<e;o++)t[o-1]=arguments[o];return It.run("intersection",n,t)},M0=function(n){for(var e=arguments.length,t=new Array(e>1?e-1:0),o=1;o<e;o++)t[o-1]=arguments[o];return It.run("xor",n,t)},_0=function(n){for(var e=arguments.length,t=new Array(e>1?e-1:0),o=1;o<e;o++)t[o-1]=arguments[o];return It.run("difference",n,t)},E0={union:C0,intersection:B0,xor:M0,difference:_0};var pf=Pr,Hr=pf.union??pf.default?.union??null;Hr||console.warn("[osmgl] polygon-clipping \u0431\u0435\u0437 union \u2014 \u043E\u0431\u044A\u0435\u0434\u0438\u043D\u0435\u043D\u0438\u0435 \u0444\u0438\u0433\u0443\u0440 \u0432\u044B\u043A\u043B\u044E\u0447\u0435\u043D\u043E");var ui=0,hi=0;function gf(n){for(let e of n)if(e.length>=2){ui=Math.round(e[0]),hi=Math.round(e[1]);return}ui=0,hi=0;}function di(n){let e=[];for(let t=0;t+1<n.length;t+=2)e.push([n[t]-ui,n[t+1]-hi]);return e}function mi(n){let e=[];for(let o of n)e.push(o[0]+ui,o[1]+hi);let t=e.length;return t>=4&&(e[0]!==e[t-2]||e[1]!==e[t-1])&&e.push(e[0],e[1]),e}function pi(n){if(!Hr)return [n];gf([n.outer]);let e=[di(n.outer),...n.holes.map(di)],t;try{t=Hr(e);}catch{return [n]}let o=[];for(let r of t??[])r?.length&&o.push({outer:mi(r[0]),holes:r.slice(1).map(mi),lift:n.lift,at:n.at});return o.length?o:[n]}function Uo(n,e,t=0){if(n.length<2)return n;let o=new Map;for(let i of n){let a=i.at?i:i.lift??0,s=o.get(a);s?s.push(i):o.set(a,[i]);}let r=[];for(let[i,a]of o){if(a.length<2){r.push(...a);continue}let s=typeof i=="number"?i:0;r.push(...S0(a,s,e,t));}return r}var ts=256;function S0(n,e,t,o=0){let r=n,i=o>0&&t?o:0;for(let a=0;a<32;a++){if(r.length<2)return r;if(r.length<=ts)return bf(r,e,t,i);let s=F0(r),l=[];for(let c=0;c<s.length;c+=ts)l.push(...bf(s.slice(c,c+ts),e,t,i));if(i=0,l.length>=r.length)return l;r=l;}return r}function F0(n){let e=1/0,t=1/0,o=-1/0,r=-1/0,i=n.map(c=>{let f=0,u=0,h=0;for(let p=0;p+1<c.outer.length;p+=2)f+=c.outer[p],u+=c.outer[p+1],h++;let d=h?f/h:0,m=h?u/h:0;return d<e&&(e=d),d>o&&(o=d),m<t&&(t=m),m>r&&(r=m),{s:c,cx:d,cy:m}}),a=o-e||1,s=r-t||1,l=c=>{let f=Math.max(0,Math.min(65535,Math.round(c*65535)));return f=(f|f<<8)&16711935,f=(f|f<<4)&252645135,f=(f|f<<2)&858993459,f=(f|f<<1)&1431655765,f};return i.map(c=>({s:c.s,key:l((c.cx-e)/a)|l((c.cy-t)/s)<<1})).sort((c,f)=>c.key-f.key).map(c=>c.s)}function bf(n,e,t,o=0){{let r=[],i=o>0&&t?n.map(c=>({outer:t(c.outer,-o)??c.outer,holes:c.holes.map(f=>t(f,o)??f)})):n;gf(i.map(c=>c.outer));let a=i.map(c=>[di(c.outer),...c.holes.map(di)]),s;try{if(!Hr)throw new Error("\u043D\u0435\u0442 union");s=Hr(a[0],...a.slice(1));}catch{return n}let l=s;if(!Array.isArray(l)||l.length===0)return n;for(let c of l){if(!c.length)continue;let f=mi(c[0]);if(f.length<8)continue;let u=[];for(let h=1;h<c.length;h++){let d=mi(c[h]);d.length>=8&&u.push(d);}r.push(e?{outer:f,holes:u,lift:e}:{outer:f,holes:u});}return r}}var I0=5,Jt=16,Bf=64,Mf=0,D0=1,yf=2,T0=3,Or=1,k0=.6;function L0(n,e,t,o){if(!e||!(e>0)||!(t>0))return [];let r=e/2/t,i=[];for(let a of n){let s=a.length>=8&&Math.abs(a[0]-a[a.length-2])<1e-6&&Math.abs(a[1]-a[a.length-1])<1e-6,l,c=a;if(o&&!s){let d=Array.from(a),m=Dr(d,{junctions:o.junctions,width:o.width,level:o.level,taper:o.reach});if(m.at){let p=o.extra/2/t,b=m.at;l=g=>b(g)/2/t+p,m.knots.length&&(c=of(d,m.knots));}}let f=zo(c,{halfWidth:r,metersPerUnit:t,closed:s,halfWidthAt:l});if(!f)continue;let u=f.outer,h=[];if(o&&!s){let d=a.length/2;for(let[m,p,b]of [[a[0],a[1],0],[a[d*2-2],a[d*2-1],-1]]){if(!P0(o,m,p))continue;let g=b===0?0:R0(c),y=l?l(g):r;h.push({x:m,y:p,r:y});}}i.push(h.length?{outer:u,holes:f.holes,caps:h}:{outer:u,holes:f.holes});}return i}function R0(n){let e=0;for(let t=0;t+3<n.length;t+=2)e+=Math.hypot(n[t+2]-n[t],n[t+3]-n[t+1]);return e}function P0(n,e,t){let o=oo(Math.round(e),Math.round(t))+(n.level+8)*4294967296;return (n.junctions.ends.get(o)??0)>1}function as(n,e,t,o){let r=o.metersPerUnit>0?o.metersPerUnit:.5,i=o.elevation,a=o.base??0,s=Math.max(o.bevel??0,0)/r,l=Math.max(o.bevelDrop??0,0),c=Math.max(o.cornerRadius??0,0)/r,f=Math.max(512,n.length*24),u=new ArrayBuffer(f*Jt),h={view:new DataView(u),bytes:new Uint8Array(u),offset:0,count:0,indices:[],extent:e,ensure(G){if(h.count+G<=f)return;f=Math.max(f*2,h.count+G);let Y=new ArrayBuffer(f*Jt);new Uint8Array(Y).set(h.bytes.subarray(0,h.offset)),u=Y,h.view=new DataView(Y),h.bytes=new Uint8Array(Y);}},d=o.widthOf?Fr(n):null,m=Math.max(o.widthExtra??0,0),p=Ir/r,b=G=>{if(!d)return;let Y=o.widthOf(G);if(!(!Y||!(Y>0)))return {junctions:d,width:Math.max(Y-m,0),extra:m,level:vt(G),reach:p}},g=[],y=[],A=new Map,x=o.widthOf?Wa(n,G=>et(t,G),o.widthOf):null,v=x?x.map(G=>({geometry:[G.pts],props:G.props,ids:G.ids})):[];if(!x)for(let G of n.features()){if(G.type!==3||!et(t,G.properties))continue;let Y=G.properties.osm_id,ie=typeof Y=="number"?Y:typeof Y=="string"?Number(Y):NaN;v.push({geometry:G.loadGeometry(),props:G.properties,ids:[Number.isFinite(ie)?ie:Number(G.id??0)]});}for(let G of v){let Y=x!==null,ie=o.liftAt?.(G.props)??null,ee=ie?0:o.liftBy?.(G.props)??0,ue=G.ids;for(let $ of Y?L0(G.geometry,o.widthOf(G.props),r,b(G.props)):Ao(G.geometry)){let Ae=Kt($,e,st(e));if(!Ae)continue;let ve=$.caps;g.push({...Ae,...ee?{lift:ee}:{},...ie?{at:ie}:{},...ve?{caps:ve}:{}}),y.push(ue);}}let w=new Set,C=Math.max(o.weld??k0,0),B=o.widthOf?g:Uo(g,(G,Y)=>rs(G,Y,e,w),C/r),_=C>0?B.map(G=>({...G,outer:Cf(G.outer,C/r,e),holes:G.holes.map(Y=>Cf(Y,C/r,e))})):B;for(let G of _){xf(G.outer,A);for(let Y of G.holes)xf(Y,A);}o.onShapes?.(_);let T=H0(_,g,y),k=new Set;for(let[G,Y]of A)Y>1&&k.add(G);if(_.some(G=>G.at)||new Set(_.map(G=>G.lift??0)).size>1){let G=(Y,ie,ee)=>{let ue=_[Y];return (ue.lift??0)+(ue.at?ue.at(ie,ee):0)};z0(_,(Y,ie,ee)=>i+G(Y,ie,ee),k,.5/r);}for(let G of _){let Y=G.caps;if(Y)for(let ie of Y)N0(G.outer,ie,k);}let P=[],W={radius:c,segments:o.cornerSegments,extent:e,margin:st(e),minCutRatio:0,maxChord:Dc/r},z=[];for(let G of _){let Y=h.indices.length,ie=P.length,ee=c>0?{outer:dt(G.outer,{...W,keep:wf(G.outer,k)}),holes:G.holes.map(Z=>dt(Z,{...W,keep:wf(Z,k)}))}:G,ue=s>0?rs(ee.outer,s,e,k):ee.outer,$=ee.holes.map(Z=>s>0?rs(Z,-s,e,k):Z),Ae=G.lift??0,ve=G.at,he=i+Ae,xe=Math.max(o.deck??0,0),de=a+Ae-(Ae>0||ve?xe:0),we=ve?Math.min(o.maxSegment||1/0,I0/r):o.maxSegment??0;vf(h,ue??ee.outer,$.map((Z,ce)=>Z??ee.holes[ce]),he,Mf,we,ve);let I=he,J=he-l;ue&&s>0&&l>0&&os(h,ue,ee.outer,I,J,D0,e,k,ve),(J!==de||ve)&&os(h,ee.outer,ee.outer,J,de,yf,e,k,ve);for(let Z of ee.holes)if((J!==de||ve)&&os(h,Z,Z,J,de,yf,e,k,ve),he<de){let ce=h.indices.length;vf(h,Z,[],de,T0,0,ve);for(let ae=ce;ae<h.indices.length;ae++)P.push(h.indices[ae]);h.indices.length=ce;}z.push(Y,h.indices.length,ie,P.length);}if(!h.indices.length&&!P.length)return null;let L=h.indices.length;for(let G=0;G<z.length;G+=4)z[G+2]+=L,z[G+3]+=L;let X=[];for(let G of T){X.push(G.length);for(let Y of G)X.push(Y);}let Q=new Uint32Array(L+P.length);return Q.set(h.indices,0),Q.set(P,L),{vertices:u.slice(0,h.offset),indices:Q.buffer,vertexCount:h.count,indexCount:Q.length,extent:e,capIndexOffset:L,shapeFeatures:new Float64Array(X).buffer,shapeRanges:new Uint32Array(z).buffer}}function H0(n,e,t){let o=n.map(()=>[]);if(!n.length)return o;let r=n.map(i=>Af(i.outer));for(let i=0;i<e.length;i++){let a=O0(e[i].outer);if(!a)continue;let s=-1;for(let l=0;l<n.length;l++){let c=r[l];if(a[0]<c[0]||a[0]>c[2]||a[1]<c[1]||a[1]>c[3]||!zr(n[l].outer,a[0],a[1]))continue;let f=false;for(let u of n[l].holes)if(zr(u,a[0],a[1])){f=true;break}if(!f){s=l;break}}if(s<0){let l=Af(e[i].outer),c=0;for(let f=0;f<n.length;f++){let u=r[f],h=Math.min(l[2],u[2])-Math.max(l[0],u[0]),d=Math.min(l[3],u[3])-Math.max(l[1],u[1]),m=h>0&&d>0?h*d:0;m>c&&(c=m,s=f);}}s<0&&(s=0);for(let l of t[i])o[s].includes(l)||o[s].push(l);}return o}function Af(n){let e=1/0,t=1/0,o=-1/0,r=-1/0;for(let i=0;i<n.length;i+=2)n[i]<e&&(e=n[i]),n[i]>o&&(o=n[i]),n[i+1]<t&&(t=n[i+1]),n[i+1]>r&&(r=n[i+1]);return [e,t,o,r]}function O0(n){let e=n.length/2-1;if(e<3)return null;let t=0;for(let r=0;r<e;r++){let i=(r+1)%e;t+=n[r*2]*n[i*2+1]-n[i*2]*n[r*2+1];}let o=t>0;for(let r=0;r<e;r++){let i=(r+e-1)%e*2,a=r*2,s=(r+1)%e*2,l=(n[a]-n[i])*(n[s+1]-n[i+1])-(n[a+1]-n[i+1])*(n[s]-n[i]);if(l===0||l>0!==o)continue;let c=(n[i]+n[a]+n[s])/3,f=(n[i+1]+n[a+1]+n[s+1])/3;if(zr(n,c,f))return [c,f]}return null}function zr(n,e,t){let o=false,r=n.length/2-1;for(let i=0,a=r-1;i<r;a=i++){let s=n[i*2],l=n[i*2+1],c=n[a*2],f=n[a*2+1];l>t!=f>t&&e<(c-s)*(t-l)/(f-l)+s&&(o=!o);}return o}var G0=Nn;function z0(n,e,t,o){if(n.length<2)return;let r=n.map(s=>{let l=1/0,c=1/0,f=-1/0,u=-1/0;for(let h=0;h<s.outer.length;h+=2)s.outer[h]<l&&(l=s.outer[h]),s.outer[h]>f&&(f=s.outer[h]),s.outer[h+1]<c&&(c=s.outer[h+1]),s.outer[h+1]>u&&(u=s.outer[h+1]);return {minX:l,minY:c,maxX:f,maxY:u}}),i=s=>{let l=n[s];return !!l.at||(l.lift??0)!==0},a=(s,l,c)=>{let f=r[s];if(l<f.minX||l>f.maxX||c<f.minY||c>f.maxY||!zr(n[s].outer,l,c))return false;for(let u of n[s].holes)if(zr(u,l,c))return false;return true};for(let s=0;s<n.length;s++)for(let l of [n[s].outer,...n[s].holes])for(let c=0;c+3<l.length;c+=2){let f=l[c+2]-l[c],u=l[c+3]-l[c+1],h=Math.hypot(f,u);if(h<1e-9)continue;let d=(l[c]+l[c+2])/2,m=(l[c+1]+l[c+3])/2,p=-u/h*o,b=f/h*o,g=a(s,d+p,m+b)?-1:1,y=d+p*g,A=m+b*g;for(let x=0;x<n.length;x++)if(!(x===s||!a(x,y,A))&&!(!i(s)&&!i(x))&&!(Math.abs(e(s,y,A)-e(x,y,A))>G0)){t.add(io(l[c],l[c+1],l[c+2],l[c+3]));break}}}function io(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 xf(n,e){for(let t=0;t+3<n.length;t+=2){let o=io(n[t],n[t+1],n[t+2],n[t+3]);e.set(o,(e.get(o)??0)+1);}}function wf(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=io(n[(r+t-1)%t*2],n[(r+t-1)%t*2+1],n[r*2],n[r*2+1]),a=io(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 Gr(n,e,t,o,r,i,a,s){let l=n.offset;return n.view.setFloat32(l,e,true),n.view.setFloat32(l+4,t,true),n.view.setInt16(l+8,W0(Math.round(o*Bf)),true),n.view.setInt8(l+10,is(Math.round(r*127))),n.view.setInt8(l+11,is(Math.round(i*127))),n.view.setInt8(l+12,is(Math.round(a*127))),n.bytes[l+13]=s,n.view.setInt8(l+14,e<=0?-Or:e>=n.extent?Or:0),n.view.setInt8(l+15,t<=0?-Or:t>=n.extent?Or:0),n.offset+=Jt,n.count++}function vf(n,e,t,o,r=Mf,i=0,a){let s=[],l=[];for(let h=0;h<e.length;h++)s.push(e[h]);for(let h of t){l.push(s.length/2);for(let d=0;d<h.length;d++)s.push(h[d]);}let c=ot(s,l.length?l:void 0,2);if(!c.length)return;let f=c;if(i>0){let h=[];Ha(s,c,0,i,h),f=h;}n.ensure(s.length/2);let u=n.count;for(let h=0;h<s.length;h+=2)Gr(n,s[h],s[h+1],a?o+a(s[h],s[h+1]):o,0,0,1,r);for(let h=0;h<f.length;h+=3)n.indices.push(u+f[h],u+f[h+2],u+f[h+1]);}function os(n,e,t,o,r,i,a,s,l,c){let f=Math.min(e.length,t.length)/2;if(!(f<3)){n.ensure((f-1)*4);for(let u=0;u<f-1;u++){let h=t[u*2],d=t[u*2+1],m=t[u*2+2],p=t[u*2+3];if(h===m&&d===p||ri(h,d,m,p,a,st(a))||s.has(io(h,d,m,p)))continue;let b=m-h,g=p-d,y=Math.hypot(b,g)||1,A=g/y,x=-b/y,v=o-r,w=Math.hypot(e[u*2]-h,e[u*2+1]-d)||0,C=0;if(w>1e-6&&v!==0){let X=1/Math.hypot(1,v/w);C=w/Math.hypot(w,v)*Math.sign(v),A*=X,x*=X;}let B=l?l(e[u*2],e[u*2+1]):0,_=l?l(e[u*2+2],e[u*2+3]):0,T=l,k=T?T(h,d):0,K=T?T(m,p):0,P=Gr(n,e[u*2],e[u*2+1],o+B,A,x,C,i),W=Gr(n,e[u*2+2],e[u*2+3],o+_,A,x,C,i),z=Gr(n,h,d,r+k,A,x,C,i),L=Gr(n,m,p,r+K,A,x,C,i);n.indices.push(z,W,L,z,P,W);}}}function rs(n,e,t,o){let r=n.length/2-1;if(r<3)return null;let i=[];for(let f=0;f<r;f++){let u=n[f*2],h=n[f*2+1],d=n[(f+r-1)%r*2],m=n[(f+r-1)%r*2+1],p=n[(f+1)%r*2],b=n[(f+1)%r*2+1],g=Math.hypot(u-d,h-m)||1,y=Math.hypot(p-u,b-h)||1,A=(h-m)/g,x=-(u-d)/g,v=(b-h)/y,w=-(p-u)/y,C=A+v,B=x+w,_=Math.hypot(C,B);if(_<1e-6){i.push(u,h);continue}C/=_,B/=_;let T=Math.min(1/Math.max(C*A+B*x,.35),3),k=u-C*e*T,K=h-B*e*T,P=io(d,m,u,h),W=io(u,h,p,b);if(o.has(P)||o.has(W)){i.push(u,h);continue}let z=-st(t),L=t+st(t);((Q,G)=>Q<=z||Q>=L||G<=z||G>=L)(u,h)&&(k=u,K=h),i.push(k,K);}i.push(i[0],i[1]);let a=Math.abs(ns(n)),s=ns(i);if(Math.sign(s)!==Math.sign(ns(n))||Math.abs(s)<a*.25)return null;let l=-st(t),c=t+st(t);for(let f=0;f<i.length;f+=2)i[f]=Math.max(l,Math.min(c,i[f])),i[f+1]=Math.max(l,Math.min(c,i[f+1]));return i}function ns(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 is=n=>n>127?127:n<-127?-127:n,W0=n=>n>32767?32767:n<-32768?-32768:n;function Cf(n,e,t){if(!(e>0))return n;let o=st(t),r=-o,i=t+o,a=n;for(let s=0;s<3;s++){let l=a.length/2-1;if(l<6)break;let c=new Array(l).fill(true),f=l;for(let h=0;h<l&&!(f<=5);h++){let d=a[h*2],m=a[h*2+1];if(d<=r||d>=i||m<=r||m>=i)continue;let p=(h+l-1)%l;for(;!c[p]&&p!==h;)p=(p+l-1)%l;let b=(h+1)%l;for(;!c[b]&&b!==h;)b=(b+1)%l;if(p===h||b===h)break;let g=a[p*2],y=a[p*2+1],A=a[b*2]-g,x=a[b*2+1]-y,v=Math.hypot(A,x);v<1e-6||Math.abs((d-g)*x-(m-y)*A)/v<e&&(c[h]=false,f--);}if(f===l)break;let u=[];for(let h=0;h<l;h++)c[h]&&u.push(a[h*2],a[h*2+1]);u.push(u[0],u[1]),a=u;}return a}function N0(n,e,t){let o=e.r*.8,r=e.r*1.2,i=(a,s)=>{let l=Math.hypot(a-e.x,s-e.y);return l>=o&&l<=r};for(let a=0;a+3<n.length;a+=2)!i(n[a],n[a+1])||!i(n[a+2],n[a+3])||t.add(io(n[a],n[a+1],n[a+2],n[a+3]));}var ao=8;function Ef(n){return n?St(n.color)||St(n.opacity)||St(n.width):false}var gi=class{constructor(e,t){this.spec=e;this.zoom=t;this.filled=0;this.r=0;this.g=0;this.b=0;this.a=1;this.width=0;this.capacity=1024,this.buffer=new ArrayBuffer(this.capacity*ao),this.view=new DataView(this.buffer),this.base=e.base!==void 0?ht(e.base,t,[1,0,1,1]):[1,0,1,1],this.setFeature({},null,void 0);}setFeature(e,t,o){let r={zoom:this.zoom,properties:e,id:t,geometryType:o},i=this.spec.color!==void 0?_r(this.spec.color,r):null,[a,s,l,c]=i??this.base,f=this.spec.opacity!==void 0?_f(to(this.spec.opacity,r),1):1;this.r=bi(a),this.g=bi(s),this.b=bi(l),this.a=bi(c*f),this.width=this.spec.width!==void 0?Math.max(_f(to(this.spec.width,r),0),0):0;}advanceTo(e){if(!(e<=this.filled)){this.ensure(e);for(let t=this.filled;t<e;t++){let o=t*ao;this.view.setUint8(o,Math.round(this.r*255)),this.view.setUint8(o+1,Math.round(this.g*255)),this.view.setUint8(o+2,Math.round(this.b*255)),this.view.setUint8(o+3,Math.round(this.a*255)),this.view.setFloat32(o+4,this.width,true);}this.filled=e;}}take(e){return this.advanceTo(e),this.buffer.slice(0,e*ao)}ensure(e){if(e<=this.capacity)return;this.capacity=Math.max(this.capacity*2,e);let t=new ArrayBuffer(this.capacity*ao);new Uint8Array(t).set(new Uint8Array(this.buffer,0,this.filled*ao)),this.buffer=t,this.view=new DataView(t);}};function Wr(n,e){return Ef(n)?new gi(n,e):void 0}var bi=n=>n<0?0:n>1?1:n;function _f(n,e){let t=typeof n=="number"?n:Number(n);return Number.isFinite(t)?t:e}var V0=100;function ss(n){return {shapes:[],cells:[],extent:0,metersPerTile:n}}function ls(n,e,t,o){if(!(t<=0)){n.extent=o;for(let r of e){let i=r.outer;if(i.length<6)continue;let a=1/0,s=1/0,l=-1/0,c=-1/0;for(let f=0;f<i.length;f+=2)i[f]<a&&(a=i[f]),i[f]>l&&(l=i[f]),i[f+1]<s&&(s=i[f+1]),i[f+1]>c&&(c=i[f+1]);n.shapes.push({outer:i,holes:r.holes,level:t,minX:a,minY:s,maxX:l,maxY:c});}n.cells=[];}}function U0(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=Ko(Math.floor(o.minX/e)),i=Ko(Math.floor(o.maxX/e)),a=Ko(Math.floor(o.minY/e)),s=Ko(Math.floor(o.maxY/e));for(let l=a;l<=s;l++)for(let c=r;c<=i;c++)n.cells[l*32+c].push(t);}}var Ff=n=>n.shapes.length===0;function yi(n,e,t){!n.cells.length&&n.shapes.length&&U0(n);let o=n.extent/32,r=n.cells[Ko(Math.floor(t/o))*32+Ko(Math.floor(e/o))];if(!r||!r.length)return 0;let i=0;for(let a of r){let s=n.shapes[a];if(s.level<=i||e<s.minX||e>s.maxX||t<s.minY||t>s.maxY||!Sf(s.outer,e,t))continue;let l=false;for(let c of s.holes)if(Sf(c,e,t)){l=true;break}l||(i=s.level);}return Math.min(Math.round(i*100),127)}function cs(n,e){let t=[],o=[],r=n.extent>0?n.metersPerTile/n.extent:0,i=r>0?2/r:0,a=yi(n,e[0],e[1]);t.push(e[0],e[1]),o.push(a);for(let s=0;s+3<e.length;s+=2){let l=e[s],c=e[s+1],f=e[s+2],u=e[s+3],h=yi(n,f,u);if(h!==a&&i>0){let d=Math.hypot(f-l,u-c),m=Math.min(Math.ceil(d/i),64),p=a;for(let b=1;b<m;b++){let g=b/m,y=l+(f-l)*g,A=c+(u-c)*g,x=yi(n,y,A);x!==p&&(t.push(y,A),o.push(x),p=x);}}t.push(f,u),o.push(h),a=h;}return {pts:t,levels:o}}var Ko=n=>n<0?0:n>31?31:n;function Sf(n,e,t){let o=false,r=n.length/2;for(let i=0,a=r-1;i<r;a=i++){let s=n[i*2],l=n[i*2+1],c=n[a*2],f=n[a*2+1];l>t!=f>t&&e<(c-s)*(t-l)/(f-l)+s&&(o=!o);}return o}var bt=24;function fs(n,e,t=0,o,r=0,i={}){let{level:a,paint:s}=i,l=Math.max(256,n.length*24),c=new ArrayBuffer(l*bt),f=new DataView(c),u=0,h=[],d=[],m=w=>{if(u+w<=l)return;l=Math.max(l*2,u+w);let C=new ArrayBuffer(l*bt);new Uint8Array(C).set(new Uint8Array(c,0,u*bt)),c=C,f=new DataView(C);},p=(w,C,B,_,T,k,K,P=0,W=0,z=0,L=0,X=0)=>{let Q=u*bt;return f.setInt16(Q,w,true),f.setInt16(Q+2,C,true),f.setInt16(Q+4,B,true),f.setInt16(Q+6,_,true),f.setInt8(Q+8,T),f.setInt8(Q+9,k),f.setInt8(Q+10,P),f.setInt8(Q+11,W),f.setFloat32(Q+12,K,true),f.setFloat32(Q+16,z,true),f.setInt16(Q+20,L,true),f.setInt16(Q+22,X,true),u++},b=0,g=0,y=r>0?Ir/r:0,A=y>0?Fr(n):null;for(let w of n.features()){if(w.type!==2&&w.type!==3||!et(e,w.properties)||a!==void 0&&vt(w.properties)!==a)continue;let C=w.properties.osm_id,B=typeof C=="number"?C:typeof C=="string"?Number(C):NaN;g=Number.isFinite(B)?B:Number(w.id??0);let _=w.properties.width;b=typeof _=="number"&&_>.5&&_<100?_:0;let T=i.liftAt?.(w.properties)??null;s?.setFeature(w.properties,w.id??null,w.type===3?"Polygon":"LineString");let k=w.type===3;for(let K of w.loadGeometry()){let P=t>0?X0(Df(K),t):Df(K);if(P.length<4)continue;let W=o&&!Ff(o)?cs(o,P):null,z=W?W.pts:P,L=W?.levels,X=z.length/2;if(X<2)continue;let Q=vt(w.properties),G=null,Y=b;if(A&&b>0&&!k){let ee=Dr(z,{junctions:A,width:b,level:Q,taper:y});if(Y=ee.width,ee.at){G=ee.at;let ue=ee.knots;if(ue.length){let $=K0(z,L,ue);z=$.pts,L=$.levels,X=z.length/2;}}}m((X-1)*4);let ie=0;for(let ee=0;ee<X-1;ee++){let ue=z[ee*2],$=z[ee*2+1],Ae=z[ee*2+2],ve=z[ee*2+3],he=Math.hypot(Ae-ue,ve-$);if(k&&j0(ue,$,Ae,ve,n.extent)){ie+=he;continue}let xe=J0(ue,$,Ae,ve,n.extent);if(!xe){ie+=he;continue}let[de,we,I,J]=xe,Z=Math.hypot(de-ue,we-$),ce=Math.hypot(I-de,J-we),ae=Math.hypot(Ae-I,ve-J),be=ie+Z,Se=L?L[ee]:0,F=L?L[ee+1]:0,U=T?If(T(de,we)):0,j=T?If(T(I,J)):0,R=G?G(be):Y,H=G?G(be+ce):Y,E=p(de,we,I,J,0,-1,be,Se,F,R,U,j),M=p(de,we,I,J,0,1,be,Se,F,R,U,j),S=p(de,we,I,J,1,1,be,Se,F,H,U,j),D=p(de,we,I,J,1,-1,be,Se,F,H,U,j);ie+=Z+ce+ae,h.push(E,M,S,E,S,D),d.push(g,g);}}s?.advanceTo(u);}if(!h.length)return null;let x=new Uint32Array(h),v=new Float64Array(d);return {vertices:c.slice(0,u*bt),indices:x.buffer,vertexCount:u,indexCount:x.length,featureIds:v.buffer,...s?{dataPaint:s.take(u)}:{}}}function If(n){return Math.max(-32768,Math.min(32767,Math.round(n*100)))}function K0(n,e,t){let o=[...t].sort((l,c)=>l-c),r=[n[0],n[1]],i=e?[e[0]]:void 0,a=0,s=0;for(let l=0;l+3<n.length;l+=2){let c=n[l],f=n[l+1],u=n[l+2],h=n[l+3],d=Math.hypot(u-c,h-f);for(;s<o.length&&o[s]<=a+.01;)s++;for(;s<o.length&&o[s]<a+d-.01;){let m=(o[s]-a)/d;r.push(c+(u-c)*m,f+(h-f)*m),i&&e&&i.push(Math.round(e[l/2]+(e[l/2+1]-e[l/2])*m)),s++;}a+=d,r.push(u,h),i&&e&&i.push(e[l/2+1]);}return {pts:r,levels:i}}function X0(n,e){let t=[];for(let o=0;o+3<n.length;o+=2){let r=n[o],i=n[o+1],a=n[o+2],s=n[o+3];t.push(r,i);let l=Math.min(64,Math.floor(Math.hypot(a-r,s-i)/e));for(let c=1;c<l;c++){let f=c/l;t.push(r+(a-r)*f,i+(s-i)*f);}}return t.push(n[n.length-2],n[n.length-1]),t}function Df(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 J0(n,e,t,o,r){let i=t-n,a=o-e,s=0,l=1,c=[[-i,n],[i,r-n],[-a,e],[a,r-e]];for(let[f,u]of c){if(f===0){if(u<0)return null;continue}let h=u/f;if(f<0){if(h>l)return null;h>s&&(s=h);}else {if(h<s)return null;h<l&&(l=h);}}return l-s<1e-6?null:[Math.round(n+i*s),Math.round(e+a*s),Math.round(n+i*l),Math.round(e+a*l)]}function j0(n,e,t,o,r){return n===t&&(n<=0||n>=r)?true:e===o&&(e<=0||e>=r)}function us(n,e){let t=new Le;for(let o of n.layers)o.type!=="line"||!o.yieldTo||n.layerVisibleAt(o,e)&&t.add(o.yieldTo);return t}function Ai(n,e,t){return n!=="loaded"&&n!=="empty"?false:e||!t}function hs(n,e=0){if(!n.length)return null;for(let r of n)if(!r.cut.some(Boolean))return [{outer:r.ring,holes:r.holes??[]}];if(n.length<2)return null;let t=Uo(n.map(r=>({outer:r.ring,holes:r.holes??[]}))),o=e>0?t.filter(r=>Tf(r.outer,e)):t;return o.length?e>0?o.map(r=>({outer:r.outer,holes:r.holes.filter(i=>Tf(i,e))})):o:null}function Tf(n,e){let t=0,o=0;for(let r=0;r+3<n.length;r+=2)t+=n[r]*n[r+3]-n[r+2]*n[r+1],o+=Math.hypot(n[r+2]-n[r],n[r+3]-n[r+1]);return o<=0?false:Math.abs(t)/o>=e}var so=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}};var xi=class{constructor(){this.meshes=new fe;this.stitched=new Le;this.hiddenByTile=new fe;this.changed=new Le;this.budget=0;this.pending=false;this.signature="";this.meshSig=new fe;this.cache=new fe;}update(e,t,o){let r=new fe,i=0,a="";for(let[m,p]of e.loadedTiles()){if(p.id.z!==o.zoom)continue;let b=p.data?.seams;if(b?.length){a+=m+";",i=p.data?.buckets?.[t]?.extent??i;for(let g of b){let y=r.get(g.osmId);y?y.push({seam:g,tile:p.id}):r.set(g.osmId,[{seam:g,tile:p.id}]);}}}if(a===this.signature)return false;this.signature=a,this.pending=false;let s=this.budget>0?this.budget:Number.MAX_SAFE_INTEGER,l=this.budget>0?this.budget:Number.MAX_SAFE_INTEGER;if(this.changed.clear(),this.stitched.clear(),this.hiddenByTile.clear(),!i||!r.size){for(let m of this.meshes.keys())this.changed.add(m);return this.meshes.clear(),this.meshSig.clear(),this.cache.clear(),true}let c=new fe,f=new fe,u=new fe,h=new Le,d=new fe;for(let[m,p]of r){h.add(m);let b=p.map(w=>w.tile.dataKey).sort().join(","),g=this.cache.get(m);if((!g||g.sig!==b)&&s<=0){if(this.pending=true,!g)continue}else if(!g||g.sig!==b){s--;let w=p[0].tile,C=p.map(({seam:T,tile:k})=>({ring:kf(T.outer,k,w,i),holes:T.holes.map(K=>kf(K,k,w,i)),cut:T.outerCut})),B=o.metersPerTile>0?.5*i/o.metersPerTile:0,_=hs(C,B);if(_?.length){let T=Z0(_,w,i);g={sig:b,shapes:_,owner:T,seam:p[0].seam,tiles:p.map(k=>k.tile.dataKey)},this.cache.set(m,g);}else if(!g)continue}let y=g.owner.dataKey,A=Math.floor((d.get(y)??0)/Y0);d.set(y,(d.get(y)??0)+g.shapes.length);let x=`${y}#${A}`;f.set(x,g.owner);let v=c.get(x)??[];for(let w of g.shapes)v.push({rings:{outer:w.outer,holes:w.holes},seam:g.seam});c.set(x,v),u.set(x,(u.get(x)??"")+m+":"+g.sig+";"),this.stitched.add(m);for(let w of [...g.tiles,...p.map(C=>C.tile.dataKey)]){let C=this.hiddenByTile.get(w);C?C.add(m):this.hiddenByTile.set(w,new Set([m]));}}for(let m of [...this.cache.keys()])h.has(m)||this.cache.delete(m);for(let[m,p]of c){let b=u.get(m);if(this.meshSig.get(m)===b&&this.meshes.has(m))continue;if(l<=0){this.pending=true;continue}l--;let g=Xc(p,i,{metersPerUnit:o.metersPerTile>0?o.metersPerTile/i:0,cornerRadius:o.cornerRadius,cornerSegments:o.cornerSegments});this.changed.add(m),g?(this.meshes.set(m,{tile:f.get(m),mesh:g}),this.meshSig.set(m,b)):(this.meshes.delete(m),this.meshSig.delete(m));}if(this.pending)this.signature="";else for(let m of [...this.meshes.keys()])c.has(m)||(this.meshes.delete(m),this.meshSig.delete(m),this.changed.add(m));return true}reset(){this.meshes.clear(),this.stitched.clear(),this.hiddenByTile.clear(),this.cache.clear();for(let e of this.meshSig.keys())this.changed.add(e);this.meshSig.clear(),this.signature="";}},Y0=12;function Z0(n,e,t){let o=-1/0,r=-1/0;for(let c of n)for(let f=0;f<c.outer.length;f+=2)c.outer[f]>o&&(o=c.outer[f]),c.outer[f+1]>r&&(r=c.outer[f+1]);if(!Number.isFinite(o))return e;let i=Math.ceil(o/t)-1,a=Math.ceil(r/t)-1;if(i===0&&a===0)return e;let s=i*t,l=a*t;for(let c of n)for(let f of [c.outer,...c.holes])for(let u=0;u<f.length;u+=2)f[u]-=s,f[u+1]-=l;return new so(e.z,e.x+i,e.y+a,e.wrap)}function kf(n,e,t,o){let r=(e.x-t.x)*o,i=(e.y-t.y)*o,a=new Array(n.length);for(let s=0;s<n.length;s+=2)a[s]=n[s]+r,a[s+1]=n[s+1]+i;return a}var ds={enabled:true,skyColor:"#7fb2e5",horizonColor:"#dfe6ee",fogRange:[2.43,10.1],fogIntensity:.92,fogVerticalRange:[35,220],spaceColor:"#05070f",atmosphereColor:"#79b8f5",starIntensity:.55,horizonBlend:.14},ms={ambientColor:"#ffffff",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#fff4e2",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#dce6f2",fillIntensity:.18};var Lf={version:1,name:"OSM 3D \u2014 \u0434\u043D\u0435\u0432\u043D\u043E\u0439",background:"#dbd8d4",levelHeight:1,light:{ambientColor:"#ffffff",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#ffffff",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#ffffff",fillIntensity:.18},layers:[{id:"world-landcover-wood",type:"fill",source:"world","source-layer":"landcover",maxzoom:7,filter:["in","class","wood","forest"],paint:{color:{from:"landcover-wood"}}},{id:"world-landcover-grass",type:"fill",source:"world","source-layer":"landcover",maxzoom:7,filter:["in","class","grass","farmland","meadow"],paint:{color:{from:"landcover-grass"}}},{id:"world-landcover-sand",type:"fill",source:"world","source-layer":"landcover",maxzoom:7,filter:["in","class","sand","beach"],paint:{color:{from:"landcover-sand"}}},{id:"world-landcover-ice",type:"fill",source:"world","source-layer":"landcover",maxzoom:7,filter:["in","class","ice","glacier"],paint:{color:{from:"landcover-ice"}}},{id:"world-water",type:"fill",source:"world","source-layer":"water",maxzoom:7,paint:{color:{from:"water"}}},{id:"world-boundary",type:"line",source:"world","source-layer":"boundary",maxzoom:7,paint:{color:{from:"boundary"},opacity:.7,width:{stops:[[0,.5],[6,1.1]]}}},{id:"landcover-wood",type:"surface",minzoom:7,"source-layer":"landcover",filter:["in","class","wood","forest"],elevation:.09,bevel:.12,bevelDrop:.09,paint:{color:"#c6dcb4",opacity:{stops:[[8,.5],[12,.85]]},material:"flat"}},{id:"landcover-grass",type:"surface",minzoom:7,"source-layer":"landcover",filter:["in","class","grass","farmland","meadow"],elevation:.06,bevel:.1,bevelDrop:.06,paint:{color:"#d9e6c6",opacity:{stops:[[8,.45],[12,.8]]},material:"flat"}},{id:"landcover-sand",type:"surface",minzoom:7,"source-layer":"landcover",filter:["in","class","sand","beach"],elevation:.03,bevel:.1,bevelDrop:.03,paint:{color:"#f2e7c8",material:"flat"}},{id:"landcover-ice",type:"surface",minzoom:7,"source-layer":"landcover",filter:["in","class","ice","glacier"],elevation:.03,bevel:.1,bevelDrop:.03,paint:{color:"#e6f2f7"}},{id:"landcover-wetland",type:"surface",minzoom:7,"source-layer":"landcover",filter:["in","class","wetland","swamp"],elevation:.03,bevel:.1,bevelDrop:.03,paint:{color:"#cfe0d4",material:"flat"}},{id:"landuse-residential",type:"surface","source-layer":"landuse",filter:["in","class","residential","suburb","neighbourhood","quarter"],elevation:.01,bevel:.08,bevelDrop:.01,paint:{color:"#d3d0cb",opacity:{stops:[[10,.4],[14,.7]]}}},{id:"landuse-industrial",type:"surface","source-layer":"landuse",filter:["in","class","industrial","quarry","railway","substation"],elevation:.02,bevel:.08,bevelDrop:.02,paint:{color:"#e7e0dd"}},{id:"landuse-civic",type:"surface","source-layer":"landuse",filter:["in","class","school","university","college","hospital","clinic","police","kindergarten","bus_station"],elevation:.03,bevel:.08,bevelDrop:.03,paint:{color:"#ece3d8"}},{id:"landuse-sport",type:"surface","source-layer":"landuse",filter:["in","class","pitch","stadium","playground","track","swimming_pool"],elevation:.07,bevel:.1,bevelDrop:.07,paint:{color:"#cfe3c4",material:"flat"}},{id:"landuse-cemetery",type:"surface","source-layer":"landuse",filter:["in","class","cemetery","grave_yard"],elevation:.06,bevel:.1,bevelDrop:.06,paint:{color:"#d6dfc8",material:"flat"}},{id:"landuse-parking",type:"surface","source-layer":"landuse",filter:["in","class","parking","fuel"],elevation:.05,bevel:.1,bevelDrop:.05,paint:{color:"#dddad5"}},{id:"park",type:"surface","source-layer":"park",elevation:.08,bevel:.12,bevelDrop:.08,paint:{color:"#cfe5bd",opacity:.75,material:"flat"}},{id:"aeroway-area",type:"surface","source-layer":"aeroway",filter:["in","class","aerodrome","apron","helipad"],elevation:.04,bevel:.1,bevelDrop:.04,paint:{color:"#e4e2e6"}},{id:"water",type:"surface",minzoom:7,"source-layer":"water",filter:["!in","class","swimming_pool"],elevation:-0.22,bevel:.6,paint:{color:"#a5cbe3",material:"water",materialScale:14,materialSpeed:1}},{id:"water-pool",type:"surface","source-layer":"water",filter:["==","class","swimming_pool"],elevation:-0.12,bevel:.3,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:"flat"}},{id:"road-bed",type:"surface","source-layer":"transportation",minzoom:16,filter:["in","class","motorway","trunk","primary","secondary","tertiary","minor","service","track"],fromLines:true,width:6,widthExtra:.9,deck:.5,elevation:.11,bevel:.12,bevelDrop:.11,weld:.6,paint:{color:{from:"road-casing-minor",darken:.07},sideShade:.24}},{id:"path-bed",type:"surface","source-layer":"transportation",minzoom:16.5,filter:["in","class","path","pedestrian","footway","steps"],fromLines:true,width:2.2,widthExtra:.3,deck:.25,elevation:.16,bevel:.08,bevelDrop:.16,weld:.4,paint:{color:{from:"road-path"},sideShade:.2}},{id:"road-bridge-outline-thin",type:"line",network:"roads","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","path","pedestrian","footway","steps","rail","transit"]],minzoom:14,paint:{color:{from:"road-casing-major",darken:.2},width:{stops:[[14,2.5],[17,5],[19,9],[20,15],[21,28]]}}},{id:"road-casing-major",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","motorway","trunk","primary"],minzoom:5,paint:{elevation:.085,color:"#d4ab68",width:{stops:[[6,1.6],[10,3.4],[14,8],[16,14],[18,30],[19,45],[20,90],[21,180],[22,360]]},widthFromData:true,widthExtra:2.5}},{id:"road-casing-secondary",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","secondary","tertiary"],minzoom:9,paint:{elevation:.085,color:{stops:[[16,"#c6bca6"],[18.5,"#d4ab68"]]},width:{stops:[[10,1.6],[14,5.5],[16,10],[18,22],[19,33],[20,66],[21,132],[22,264]]},widthFromData:true,widthExtra:2}},{id:"road-casing-minor",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","minor","service","track"],minzoom:12,paint:{elevation:.085,color:{stops:[[16,"#cdc4b2"],[18.5,"#d4ab68"]]},width:{stops:[[13,1.4],[16,6],[18,14],[19,22],[20,44],[21,88],[22,176]]},widthFromData:true,widthExtra:1.5}},{id:"road-rail",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","rail","transit"],minzoom:10,paint:{color:"#b2a99e",width:{stops:[[10,.8],[14,1.8],[18,4],[19,5.5],[20,11],[21,22],[22,44]]}}},{id:"road-path",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","path","pedestrian","footway","steps"],minzoom:14,paint:{elevation:.17,color:"#bdb2a0",width:{stops:[[14,.8],[17,2],[19,4],[20,8],[21,16],[22,32]]},dashArray:[4,3],material:"flat"}},{id:"road-minor",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","minor","service","track"],minzoom:12,paint:{elevation:.09,color:{stops:[[16,"#ffffff"],[18.5,"#ffdfa3"]]},width:{stops:[[13,.6],[16,4],[18,11],[19,18],[20,36],[21,72],[22,144]]},material:"flat",widthFromData:true}},{id:"road-ramp",network:"roads",type:"line","source-layer":"transportation",filter:["all",["in","class","motorway","trunk","primary"],["has","ramp"]],minzoom:5,paint:{elevation:.09,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",widthFromData:true}},{id:"road-secondary",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","secondary","tertiary"],minzoom:9,paint:{elevation:.09,color:{stops:[[16,"#ffffff"],[18.5,"#ffdfa3"]]},width:{stops:[[10,.8],[14,3.6],[16,7.5],[18,18],[19,28],[20,56],[21,112],[22,224]]},material:"flat",widthFromData:true}},{id:"road-major",network:"roads",type:"line","source-layer":"transportation",filter:["all",["in","class","motorway","trunk","primary"],["!has","ramp"]],minzoom:5,paint:{elevation:.09,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",widthFromData:true}},{id:"road-lane-divider-major",network:"roads",type:"line","source-layer":"transportation",filter:["all",["!has","oneway"],["in","class","motorway","trunk","primary"]],minzoom:16.5,paint:{elevation:.095,color:"#e3bd7f",width:{stops:[[16.5,.54],[17,.78],[18,1.4],[19,2.17],[20,4.34],[21,8.68],[22,17.36]]},dashArray:[7,18],material:"flat"}},{id:"road-lane-divider-secondary",network:"roads",type:"line","source-layer":"transportation",filter:["all",["!has","oneway"],["in","class","secondary","tertiary"]],minzoom:16.5,paint:{elevation:.095,color:"#d8cfbc",width:{stops:[[16.5,.46],[17,.67],[18,1.2],[19,1.86],[20,3.72],[21,7.44],[22,14.88]]},dashArray:[7,18],material:"flat"}},{id:"boundary",type:"line",minzoom:7,"source-layer":"boundary",filter:["<=","admin_level",4],paint:{color:"#b3a6b8",opacity:.7,width:{stops:[[4,.7],[10,1.4],[16,2.4]]},dashArray:[6,4]}},{id:"building-flat",type:"fill","source-layer":"building",minzoom:15,maxzoom:16,paint:{color:{from:"building",property:"roofColor"},opacity:1}},{id:"building",type:"fill-extrusion","source-layer":"building",minzoom:16,paint:{color:"#ffffff",roofColor:"#f2f1f0",opacity:1,heightScale:{stops:[[16,0],[16.8,1]]},aoStrength:.18,tintVariation:0,windowColor:"#7f9ab5",windowFrameColor:"#e9e5dc",windowGlow:0,facadeDetail:1,floorHeight:3.2,roofVariation:.35}},{id:"indoor-venue",type:"fill-extrusion",source:"indoor","source-layer":"area",filter:["all",["==","class","level"],["==","base",1]],minzoom:15,maxzoom:16,paint:{color:"#d8d3c8",roofColor:"#d9d3c7",opacity:1,aoStrength:.18,tintVariation:.06,windowColor:"#7f9ab5",windowFrameColor:"#e9e5dc",windowGlow:0,facadeDetail:1,floorHeight:3.2,roofVariation:.35}},{id:"road-closed-casing",type:"line",source:"closures","source-layer":"closures",minzoom:11,paint:{color:"#ffffff",width:{stops:[[11,4],[14,6],[17,10],[19,16],[20,32],[21,64],[22,128]]},opacity:.9},overlay:"roads"},{id:"road-closed",type:"line",source:"closures","source-layer":"closures",minzoom:11,paint:{color:"#d92b2b",width:{stops:[[11,2.5],[14,4],[17,7],[19,11],[20,22],[21,44],[22,88]]},dashArray:[5,4]},overlay:"roads"},{id:"traffic-signal",type:"symbol",source:"points","source-layer":"roadpoints",minzoom:17,filter:["==","kind","traffic_signals"],layout:{iconImage:"traffic_signals",allowOverlap:true,iconParts:["traffic_light_pole","traffic_light_body","traffic_light_red","traffic_light_amber","traffic_light_green"],offset:[0,-12],iconSize:{stops:[[17,17],[19,26]]},priority:3},paint:{color:"#5c6470",haloColor:"#ffffff",haloWidth:1.4,partColors:["#6a717c","#1c2026","#ff4d57","#f8cf2c","#12d370"],partHaloWidths:[1,1.3,0,0,0]}},{id:"housenumber",type:"symbol","source-layer":"housenumber",minzoom:17,layout:{ignorePlacement:true,placementGroup:"background-labels",textField:"{housenumber}",textSize:{stops:[[17,9],[19,11]]},maxLineChars:6,priority:-60},paint:{textWeight:.35,color:"#8c8478",haloColor:"#f5f3ee",haloWidth:1}},{id:"road-label-minor",type:"symbol","source-layer":"transportation_name",minzoom:15,filter:["!in","class","motorway","trunk","primary","secondary"],layout:{ignorePlacement:true,placementGroup:"background-labels",textField:["{name:ru}","{name}"],textPlacement:"line",symbolSpacing:900,textSize:{stops:[[15,10.5],[18,12]]},priority:15,abbreviate:true},paint:{textWeight:.35,color:{from:"road-label"},haloColor:{from:"road-label"},haloWidth:1.6}},{id:"road-label",type:"symbol","source-layer":"transportation_name",minzoom:12.5,filter:["in","class","motorway","trunk","primary","secondary"],layout:{ignorePlacement:true,placementGroup:"background-labels",textField:["{name:ru}","{name}"],textPlacement:"line",symbolSpacing:900,textSize:{stops:[[14,10],[18,13]]},priority:20,abbreviate:true},paint:{textWeight:.35,color:"#5c5646",haloColor:"#ffffff",haloWidth:1.6}},{id:"road-closed-end",type:"symbol",source:"closures","source-layer":"closure_ends",minzoom:13,layout:{iconImage:"road_closed",iconFrame:"circle",iconFrameScale:1.6,allowOverlap:true,iconSize:13,priority:6},paint:{color:"#d92b2b",frameColor:"#d92b2b",frameOpacity:1,frameHaloColor:"#ffffff",frameHaloWidth:1.4,frameGradient:.18,frameShadow:.5,frameShadowOffset:2.5,frameShadowBlur:4,iconColor:"#ffffff",iconHaloWidth:0}},{id:"crossing",type:"surface",source:"points","source-layer":"crossings",minzoom:16.5,overlay:"roads",elevation:.12,bevel:.04,bevelDrop:.02,paint:{color:"#ffffff",opacity:.9}},{id:"poi-food",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,11],[18,12]]},iconSize:{stops:[[15,14.9],[18,17.6]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{textWeight:.35,color:"#f4882c",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#f4882c",frameHaloColor:"#ffffff",frameHaloWidth:1.2,frameGradient:.18,frameShadow:.5,frameShadowOffset:2.5,frameShadowBlur:4,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:16,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,11],[18,12]]},iconSize:{stops:[[15,14.9],[18,17.6]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{textWeight:.35,color:"#a269e7",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#a269e7",frameHaloColor:"#ffffff",frameHaloWidth:1.2,frameGradient:.18,frameShadow:.5,frameShadowOffset:2.5,frameShadowBlur:4,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,11],[18,12]]},iconSize:{stops:[[15,14.9],[18,17.6]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{textWeight:.35,color:"#4677e8",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#4677e8",frameHaloColor:"#ffffff",frameHaloWidth:1.2,frameGradient:.18,frameShadow:.5,frameShadowOffset:2.5,frameShadowBlur:4,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,11],[18,12]]},iconSize:{stops:[[15,14.9],[18,17.6]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{textWeight:.35,color:"#f86776",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#f86776",frameHaloColor:"#ffffff",frameHaloWidth:1.2,frameGradient:.18,frameShadow:.5,frameShadowOffset:2.5,frameShadowBlur:4,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","pharmacy","hospital","doctors","dentist","veterinary"]},{id:"poi-education",type:"symbol","source-layer":"poi",minzoom:16,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,11],[18,12]]},iconSize:{stops:[[15,14.9],[18,17.6]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{textWeight:.35,color:"#2ac1d4",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#2ac1d4",frameHaloColor:"#ffffff",frameHaloWidth:1.2,frameGradient:.18,frameShadow:.5,frameShadowOffset:2.5,frameShadowBlur:4,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,11],[18,12]]},iconSize:{stops:[[15,14.9],[18,17.6]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{textWeight:.35,color:"#cc5e3c",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#cc5e3c",frameHaloColor:"#ffffff",frameHaloWidth:1.2,frameGradient:.18,frameShadow:.5,frameShadowOffset:2.5,frameShadowBlur:4,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,11],[18,12]]},iconSize:{stops:[[15,14.9],[18,17.6]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{textWeight:.35,color:"#2db375",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#2db375",frameHaloColor:"#ffffff",frameHaloWidth:1.2,frameGradient:.18,frameShadow:.5,frameShadowOffset:2.5,frameShadowBlur:4,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:16,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,11],[18,12]]},iconSize:{stops:[[15,14.9],[18,17.6]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{textWeight:.35,color:"#a66fe8",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#a66fe8",frameHaloColor:"#ffffff",frameHaloWidth:1.2,frameGradient:.18,frameShadow:.5,frameShadowOffset:2.5,frameShadowBlur:4,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","lodging"]},{id:"poi-service",type:"symbol","source-layer":"poi",minzoom:17,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,11],[18,12]]},iconSize:{stops:[[15,14.9],[18,17.6]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{textWeight:.35,color:"#6e87bf",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#6e87bf",frameHaloColor:"#ffffff",frameHaloWidth:1.2,frameGradient:.18,frameShadow:.5,frameShadowOffset:2.5,frameShadowBlur:4,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:17,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,11],[18,12]]},iconSize:{stops:[[15,14.9],[18,17.6]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{textWeight:.35,color:"#4caaf3",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#4caaf3",frameHaloColor:"#ffffff",frameHaloWidth:1.2,frameGradient:.18,frameShadow:.5,frameShadowOffset:2.5,frameShadowBlur:4,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:"road-shield",type:"symbol","source-layer":"transportation_name",filter:["all",["has","ref"],["in","class","motorway","trunk","primary"]],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:{textWeight:.35,color:"#3a4048",haloColor:"#f7f3e8",haloWidth:.5,iconColor:"#f7f3e8",iconHaloColor:"#8a8172",iconHaloWidth:1.4}},{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:{textWeight:.35,color:"#3d7ea6",haloColor:"#ffffff",haloWidth:1.4}},{id:"place-label",type:"symbol","source-layer":"place",minzoom:4,filter:["all",["in","class","city","country"],["!in","name","\u0414\u0443\u0448\u0430\u043D\u0431\u0435","\u0425\u0443\u04B7\u0430\u043D\u0434","\u0425\u0443\u0434\u0436\u0430\u043D\u0434","\u0411\u043E\u0445\u0442\u0430\u0440","\u0425\u043E\u0440\u0443\u0493","\u0425\u043E\u0440\u043E\u0433"]],layout:{textField:["{name:ru}","{name}"],textSize:{stops:[[4,11],[7,13],[10,14],[14,16],[17,17]]},maxLineChars:16,priority:90},paint:{textWeight:.35,color:"#57544e",haloColor:"#ffffff",haloWidth:1.8}},{id:"place-capital",type:"symbol","source-layer":"place",minzoom:4,filter:["all",["==","class","city"],["in","name","\u0414\u0443\u0448\u0430\u043D\u0431\u0435","\u0425\u0443\u04B7\u0430\u043D\u0434","\u0425\u0443\u0434\u0436\u0430\u043D\u0434","\u0411\u043E\u0445\u0442\u0430\u0440","\u0425\u043E\u0440\u0443\u0493","\u0425\u043E\u0440\u043E\u0433"]],layout:{textField:["{name:ru}","{name}"],textSize:{stops:[[4,12],[7,14],[10,15],[14,17],[17,18]]},maxLineChars:16,priority:110},paint:{textWeight:.35,color:"#57544e",haloColor:"#ffffff",haloWidth:1.8}},{id:"place-label-minor",type:"symbol","source-layer":"place",minzoom:7.5,filter:["in","class","town"],layout:{textField:["{name:ru}","{name}"],textSize:{stops:[[7.5,10.5],[12,12.5],[16,14]]},maxLineChars:16,priority:70},paint:{textWeight:.35,color:{from:"place-label"},haloColor:{from:"place-label"},haloWidth:1.6}},{id:"place-label-local",type:"symbol","source-layer":"place",minzoom:10.5,filter:["in","class","village","hamlet","suburb","quarter","neighbourhood","isolated_dwelling","island"],layout:{textField:["{name:ru}","{name}"],textSize:{stops:[[10.5,10.5],[16,12.5]]},maxLineChars:16,priority:55},paint:{textWeight:.35,color:{from:"place-label"},haloColor:{from:"place-label"},haloWidth:1.6}},{id:"place-region",type:"symbol",source:"regions","source-layer":"regions",minzoom:4.5,layout:{textField:["{name:ru}","{name}"],textSize:{stops:[[4.5,11.5],[7,14],[10,16],[14,17]]},letterSpacing:.15,maxLineChars:14,priority:100},paint:{textWeight:.35,color:{from:"place-label"},haloColor:{from:"place-label"},haloWidth:2}},{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:{textWeight:.35,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:{textWeight:.35,color:"#57544e",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:{textWeight:.35,color:"#2d6ecb",haloColor:"#ffffff",haloWidth:1.6}}],sources:{regions:{type:"geojson",sourceLayer:"regions",data:{type:"FeatureCollection",features:[{type:"Feature",geometry:{type:"Point",coordinates:[72.9987,38.3503]},properties:{class:"state",name:"\u0412\u0438\u043B\u043E\u044F\u0442\u0438 \u041C\u0443\u0445\u0442\u043E\u0440\u0438 \u041A\u04EF\u04B3\u0438\u0441\u0442\u043E\u043D\u0438 \u0411\u0430\u0434\u0430\u0445\u0448\u043E\u043D","name:ru":"\u0413\u043E\u0440\u043D\u043E-\u0411\u0430\u0434\u0430\u0445\u0448\u0430\u043D\u0441\u043A\u0430\u044F \u0430\u0432\u0442\u043E\u043D\u043E\u043C\u043D\u0430\u044F \u043E\u0431\u043B\u0430\u0441\u0442\u044C","name:en":"Gorno-Badakhshan Autonomous Province"}},{type:"Feature",geometry:{type:"Point",coordinates:[69.9582,40.5242]},properties:{class:"state",name:"\u0412\u0438\u043B\u043E\u044F\u0442\u0438 \u0421\u0443\u0493\u0434","name:ru":"\u0421\u043E\u0433\u0434\u0438\u0439\u0441\u043A\u0430\u044F \u043E\u0431\u043B\u0430\u0441\u0442\u044C","name:en":"Sughd Province"}},{type:"Feature",geometry:{type:"Point",coordinates:[69.2633,37.8814]},properties:{class:"state",name:"\u0412\u0438\u043B\u043E\u044F\u0442\u0438 \u0425\u0430\u0442\u043B\u043E\u043D","name:ru":"\u0425\u0430\u0442\u043B\u043E\u043D\u0441\u043A\u0430\u044F \u043E\u0431\u043B\u0430\u0441\u0442\u044C","name:en":"Khatlon Province"}},{type:"Feature",geometry:{type:"Point",coordinates:[70.0873,38.9722]},properties:{class:"state",name:"\u041D\u043E\u04B3\u0438\u044F\u04B3\u043E\u0438 \u0442\u043E\u0431\u0435\u0438 \u04B7\u0443\u043C\u04B3\u0443\u0440\u04E3","name:ru":"\u0420\u0430\u0439\u043E\u043D\u044B \u0440\u0435\u0441\u043F\u0443\u0431\u043B\u0438\u043A\u0430\u043D\u0441\u043A\u043E\u0433\u043E \u043F\u043E\u0434\u0447\u0438\u043D\u0435\u043D\u0438\u044F","name:en":"Districts of Republican Subordination"}}]}},world:{url:"/tileserver/data/world/{z}/{x}/{y}.pbf",minzoom:0,maxzoom:6},indoor:{url:"/tileserver/data/indoor/{z}/{x}/{y}.pbf",minzoom:15,maxzoom:18},points:{url:"/tileserver/data/points/{z}/{x}/{y}.pbf",minzoom:13,maxzoom:16},closures:{url:"/tileserver/data/closures/{z}/{x}/{y}.pbf",minzoom:10,maxzoom:16}}};var Rf={version:1,name:"\u041C\u044F\u0433\u043A\u0430\u044F \u0433\u0435\u043E\u043C\u0435\u0442\u0440\u0438\u044F",background:"#dbd8d4",light:{ambientColor:"#ffffff",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#ffffff",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#ffffff",fillIntensity:.18},layers:[{id:"world-landcover-wood",type:"fill",source:"world","source-layer":"landcover",maxzoom:7,filter:["in","class","wood","forest"],paint:{color:{from:"landcover-wood"}}},{id:"world-landcover-grass",type:"fill",source:"world","source-layer":"landcover",maxzoom:7,filter:["in","class","grass","farmland","meadow"],paint:{color:{from:"landcover-grass"}}},{id:"world-landcover-sand",type:"fill",source:"world","source-layer":"landcover",maxzoom:7,filter:["in","class","sand","beach"],paint:{color:{from:"landcover-sand"}}},{id:"world-landcover-ice",type:"fill",source:"world","source-layer":"landcover",maxzoom:7,filter:["in","class","ice","glacier"],paint:{color:{from:"landcover-ice"}}},{id:"world-water",type:"fill",source:"world","source-layer":"water",maxzoom:7,paint:{color:{from:"water"}}},{id:"world-boundary",type:"line",source:"world","source-layer":"boundary",maxzoom:7,paint:{color:{from:"boundary"},opacity:.7,width:{stops:[[0,.5],[6,1.1]]}}},{id:"landcover-wood",type:"fill",minzoom:7,"source-layer":"landcover",filter:["in","class","wood","forest"],paint:{color:"#c6dcb4",opacity:{stops:[[8,.5],[12,.85]]},material:"flat"},cornerRadius:10,cornerSegments:4},{id:"landcover-grass",type:"fill",minzoom:7,"source-layer":"landcover",filter:["in","class","grass","farmland","meadow"],paint:{color:"#d9e6c6",opacity:{stops:[[8,.45],[12,.8]]},material:"flat"},cornerRadius:8,cornerSegments:4},{id:"landcover-sand",type:"fill",minzoom:7,"source-layer":"landcover",filter:["in","class","sand","beach"],paint:{color:"#f2e7c8",material:"flat"},cornerRadius:10,cornerSegments:4},{id:"landcover-ice",type:"fill",minzoom:7,"source-layer":"landcover",filter:["in","class","ice","glacier"],paint:{color:"#e6f2f7"}},{id:"landcover-wetland",type:"fill",minzoom:7,"source-layer":"landcover",filter:["in","class","wetland","swamp"],paint:{color:"#cfe0d4",material:"flat"},cornerRadius:8,cornerSegments:4},{id:"landuse-residential",type:"fill","source-layer":"landuse",filter:["in","class","residential","suburb","neighbourhood","quarter"],paint:{color:"#d3d0cb",opacity:{stops:[[10,.4],[14,.7]]}},cornerRadius:4,cornerSegments:3},{id:"landuse-industrial",type:"fill","source-layer":"landuse",filter:["in","class","industrial","quarry","railway","substation"],paint:{color:"#e7e0dd"},cornerRadius:4,cornerSegments:3},{id:"landuse-civic",type:"fill","source-layer":"landuse",filter:["in","class","school","university","college","hospital","clinic","police","kindergarten","bus_station"],paint:{color:"#ece3d8"},cornerRadius:4,cornerSegments:3},{id:"landuse-sport",type:"fill","source-layer":"landuse",filter:["in","class","pitch","stadium","playground","track","swimming_pool"],paint:{color:"#cfe3c4",material:"flat"},cornerRadius:5,cornerSegments:3},{id:"landuse-cemetery",type:"fill","source-layer":"landuse",filter:["in","class","cemetery","grave_yard"],paint:{color:"#d6dfc8",material:"flat"},cornerRadius:5,cornerSegments:3},{id:"landuse-parking",type:"fill","source-layer":"landuse",filter:["in","class","parking","fuel"],paint:{color:"#dddad5"},cornerRadius:3,cornerSegments:3},{id:"park",type:"fill","source-layer":"park",paint:{color:"#cfe5bd",opacity:.75,material:"flat"},cornerRadius:9,cornerSegments:4},{id:"aeroway-area",type:"fill","source-layer":"aeroway",filter:["in","class","aerodrome","apron","helipad"],paint:{color:"#e4e2e6"},cornerRadius:5,cornerSegments:3},{id:"water",type:"fill",minzoom:7,"source-layer":"water",filter:["!in","class","swimming_pool"],paint:{color:"#a5cbe3",material:"water",materialScale:14,materialSpeed:1},cornerRadius:7,cornerSegments:4},{id:"water-pool",type:"fill","source-layer":"water",filter:["==","class","swimming_pool"],paint:{color:"#9fd3e8",material:"water",materialScale:8,materialSpeed:1},cornerRadius:4,cornerSegments:4},{id:"waterway",type:"line","source-layer":"waterway",paint:{color:"#a5cbe3",width:{stops:[[8,.6],[12,1.4],[16,4],[19,11.5],[20,23],[21,46],[22,92]]},material:"water",materialScale:10,materialSpeed:1}},{id:"aeroway-line",type:"line","source-layer":"aeroway",filter:["in","class","runway","taxiway"],paint:{color:"#d8d5da",width:{stops:[[10,1],[14,5],[18,24],[19,24],[20,48],[21,96],[22,192]]},material:"flat"}},{id:"road-bridge-outline-thin",type:"line",network:"roads","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","path","pedestrian","footway","steps","rail","transit"]],minzoom:14,paint:{color:{from:"road-casing-major",darken:.2},width:{stops:[[14,2.5],[17,5],[19,9],[20,15],[21,28]]}}},{id:"road-casing-major",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","motorway","trunk","primary"],minzoom:5,paint:{color:"#d4ab68",width:{stops:[[6,1.6],[10,3.4],[14,8],[16,14],[18,30],[19,45],[20,90],[21,180],[22,360]]},widthFromData:true,widthExtra:2.5}},{id:"road-casing-secondary",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","secondary","tertiary"],minzoom:9,paint:{color:{stops:[[16,"#c6bca6"],[18.5,"#d4ab68"]]},width:{stops:[[10,1.6],[14,5.5],[16,10],[18,22],[19,33],[20,66],[21,132],[22,264]]},widthFromData:true,widthExtra:2}},{id:"road-casing-minor",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","minor","service","track"],minzoom:12,paint:{color:{stops:[[16,"#cdc4b2"],[18.5,"#d4ab68"]]},width:{stops:[[13,1.4],[16,6],[18,14],[19,22],[20,44],[21,88],[22,176]]},widthFromData:true,widthExtra:1.5}},{id:"road-rail",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","rail","transit"],minzoom:10,paint:{color:"#b2a99e",width:{stops:[[10,.8],[14,1.8],[18,4],[19,5.5],[20,11],[21,22],[22,44]]}}},{id:"road-path",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","path","pedestrian","footway","steps"],minzoom:14,paint:{color:"#bdb2a0",width:{stops:[[14,.8],[17,2],[19,4],[20,8],[21,16],[22,32]]},dashArray:[4,3],material:"flat"}},{id:"road-minor",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","minor","service","track"],minzoom:12,paint:{color:{stops:[[16,"#ffffff"],[18.5,"#ffdfa3"]]},width:{stops:[[13,.6],[16,4],[18,11],[19,18],[20,36],[21,72],[22,144]]},material:"flat",widthFromData:true}},{id:"road-ramp",network:"roads",type:"line","source-layer":"transportation",filter:["all",["in","class","motorway","trunk","primary"],["has","ramp"]],minzoom:5,paint:{color:"#ffdfa3",width:{stops:[[6,.8],[10,2.2],[14,6],[16,11],[18,25],[19,38.5],[20,77],[21,154],[22,308]]},material:"flat",widthFromData:true}},{id:"road-secondary",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","secondary","tertiary"],minzoom:9,paint:{color:{stops:[[16,"#ffffff"],[18.5,"#ffdfa3"]]},width:{stops:[[10,.8],[14,3.6],[16,7.5],[18,18],[19,28],[20,56],[21,112],[22,224]]},material:"flat",widthFromData:true}},{id:"road-major",network:"roads",type:"line","source-layer":"transportation",filter:["all",["in","class","motorway","trunk","primary"],["!has","ramp"]],minzoom:5,paint:{color:"#ffdfa3",width:{stops:[[6,.8],[10,2.2],[14,6],[16,11],[18,25],[19,38.5],[20,77],[21,154],[22,308]]},material:"flat",widthFromData:true}},{id:"road-lane-divider-major",network:"roads",type:"line","source-layer":"transportation",filter:["all",["!has","oneway"],["in","class","motorway","trunk","primary"]],minzoom:16.5,paint:{color:"#e3bd7f",width:{stops:[[16.5,.54],[17,.78],[18,1.4],[19,2.17],[20,4.34],[21,8.68],[22,17.36]]},dashArray:[7,18],material:"flat"}},{id:"road-lane-divider-secondary",network:"roads",type:"line","source-layer":"transportation",filter:["all",["!has","oneway"],["in","class","secondary","tertiary"]],minzoom:16.5,paint:{color:"#d8cfbc",width:{stops:[[16.5,.46],[17,.67],[18,1.2],[19,1.86],[20,3.72],[21,7.44],[22,14.88]]},dashArray:[7,18],material:"flat"}},{id:"boundary",type:"line",minzoom:7,"source-layer":"boundary",filter:["<=","admin_level",4],paint:{color:"#b3a6b8",opacity:.7,width:{stops:[[4,.7],[10,1.4],[16,2.4]]},dashArray:[6,4]}},{id:"building-flat",type:"fill","source-layer":"building",minzoom:15,maxzoom:16,paint:{color:{from:"building",property:"roofColor"},opacity:1}},{id:"building",type:"fill-extrusion","source-layer":"building",minzoom:16,paint:{color:"#ffffff",roofColor:"#f2f1f0",opacity:1,heightScale:{stops:[[16,0],[16.8,1]]},aoStrength:.18,tintVariation:0,windowColor:"#7f9ab5",windowFrameColor:"#e9e5dc",windowGlow:0,facadeDetail:1,floorHeight:3.2,roofVariation:.35},cornerRadius:1.6,cornerSegments:2},{id:"indoor-venue",type:"fill-extrusion",source:"indoor","source-layer":"area",filter:["all",["==","class","level"],["==","base",1]],minzoom:15,maxzoom:16,paint:{color:"#d8d3c8",roofColor:"#d9d3c7",opacity:1,aoStrength:.18,tintVariation:.06,windowColor:"#7f9ab5",windowFrameColor:"#e9e5dc",windowGlow:0,facadeDetail:1,floorHeight:3.2,roofVariation:.35}},{id:"road-closed-casing",type:"line",source:"closures","source-layer":"closures",minzoom:11,paint:{color:"#ffffff",width:{stops:[[11,4],[14,6],[17,10],[19,16],[20,32],[21,64],[22,128]]},opacity:.9},overlay:"roads"},{id:"road-closed",type:"line",source:"closures","source-layer":"closures",minzoom:11,paint:{color:"#d92b2b",width:{stops:[[11,2.5],[14,4],[17,7],[19,11],[20,22],[21,44],[22,88]]},dashArray:[5,4]},overlay:"roads"},{id:"traffic-signal",type:"symbol",source:"points","source-layer":"roadpoints",minzoom:17,filter:["==","kind","traffic_signals"],layout:{iconImage:"traffic_signals",allowOverlap:true,iconParts:["traffic_light_pole","traffic_light_body","traffic_light_red","traffic_light_amber","traffic_light_green"],offset:[0,-12],iconSize:{stops:[[17,17],[19,26]]},priority:3},paint:{color:"#5c6470",haloColor:"#ffffff",haloWidth:1.4,partColors:["#6a717c","#1c2026","#ff4d57","#f8cf2c","#12d370"],partHaloWidths:[1,1.3,0,0,0]}},{id:"housenumber",type:"symbol","source-layer":"housenumber",minzoom:17,layout:{ignorePlacement:true,placementGroup:"background-labels",textField:"{housenumber}",textSize:{stops:[[17,9],[19,11]]},maxLineChars:6,priority:-60},paint:{textWeight:.35,color:"#8c8478",haloColor:"#f5f3ee",haloWidth:1}},{id:"road-label-minor",type:"symbol","source-layer":"transportation_name",minzoom:15,filter:["!in","class","motorway","trunk","primary","secondary"],layout:{ignorePlacement:true,placementGroup:"background-labels",textField:["{name:ru}","{name}"],textPlacement:"line",symbolSpacing:900,textSize:{stops:[[15,10.5],[18,12]]},priority:15,abbreviate:true},paint:{textWeight:.35,color:{from:"road-label"},haloColor:{from:"road-label"},haloWidth:1.6}},{id:"road-label",type:"symbol","source-layer":"transportation_name",minzoom:12.5,filter:["in","class","motorway","trunk","primary","secondary"],layout:{ignorePlacement:true,placementGroup:"background-labels",textField:["{name:ru}","{name}"],textPlacement:"line",symbolSpacing:900,textSize:{stops:[[14,10],[18,13]]},priority:20,abbreviate:true},paint:{textWeight:.35,color:"#5c5646",haloColor:"#ffffff",haloWidth:1.6}},{id:"road-closed-end",type:"symbol",source:"closures","source-layer":"closure_ends",minzoom:13,layout:{iconImage:"road_closed",iconFrame:"circle",iconFrameScale:1.6,allowOverlap:true,iconSize:13,priority:6},paint:{color:"#d92b2b",frameColor:"#d92b2b",frameOpacity:1,frameHaloColor:"#ffffff",frameHaloWidth:1.4,frameGradient:.18,frameShadow:.5,frameShadowOffset:2.5,frameShadowBlur:4,iconColor:"#ffffff",iconHaloWidth:0}},{id:"crossing",type:"fill",source:"points","source-layer":"crossings",minzoom:16.5,overlay:"roads",paint:{color:"#ffffff",opacity:.9}},{id:"poi-food",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,11],[18,12]]},iconSize:{stops:[[15,14.9],[18,17.6]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{textWeight:.35,color:"#f4882c",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#f4882c",frameHaloColor:"#ffffff",frameHaloWidth:1.2,frameGradient:.18,frameShadow:.5,frameShadowOffset:2.5,frameShadowBlur:4,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:16,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,11],[18,12]]},iconSize:{stops:[[15,14.9],[18,17.6]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{textWeight:.35,color:"#a269e7",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#a269e7",frameHaloColor:"#ffffff",frameHaloWidth:1.2,frameGradient:.18,frameShadow:.5,frameShadowOffset:2.5,frameShadowBlur:4,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,11],[18,12]]},iconSize:{stops:[[15,14.9],[18,17.6]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{textWeight:.35,color:"#4677e8",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#4677e8",frameHaloColor:"#ffffff",frameHaloWidth:1.2,frameGradient:.18,frameShadow:.5,frameShadowOffset:2.5,frameShadowBlur:4,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,11],[18,12]]},iconSize:{stops:[[15,14.9],[18,17.6]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{textWeight:.35,color:"#f86776",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#f86776",frameHaloColor:"#ffffff",frameHaloWidth:1.2,frameGradient:.18,frameShadow:.5,frameShadowOffset:2.5,frameShadowBlur:4,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","pharmacy","hospital","doctors","dentist","veterinary"]},{id:"poi-education",type:"symbol","source-layer":"poi",minzoom:16,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,11],[18,12]]},iconSize:{stops:[[15,14.9],[18,17.6]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{textWeight:.35,color:"#2ac1d4",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#2ac1d4",frameHaloColor:"#ffffff",frameHaloWidth:1.2,frameGradient:.18,frameShadow:.5,frameShadowOffset:2.5,frameShadowBlur:4,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,11],[18,12]]},iconSize:{stops:[[15,14.9],[18,17.6]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{textWeight:.35,color:"#cc5e3c",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#cc5e3c",frameHaloColor:"#ffffff",frameHaloWidth:1.2,frameGradient:.18,frameShadow:.5,frameShadowOffset:2.5,frameShadowBlur:4,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,11],[18,12]]},iconSize:{stops:[[15,14.9],[18,17.6]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{textWeight:.35,color:"#2db375",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#2db375",frameHaloColor:"#ffffff",frameHaloWidth:1.2,frameGradient:.18,frameShadow:.5,frameShadowOffset:2.5,frameShadowBlur:4,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:16,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,11],[18,12]]},iconSize:{stops:[[15,14.9],[18,17.6]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{textWeight:.35,color:"#a66fe8",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#a66fe8",frameHaloColor:"#ffffff",frameHaloWidth:1.2,frameGradient:.18,frameShadow:.5,frameShadowOffset:2.5,frameShadowBlur:4,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","lodging"]},{id:"poi-service",type:"symbol","source-layer":"poi",minzoom:17,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,11],[18,12]]},iconSize:{stops:[[15,14.9],[18,17.6]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{textWeight:.35,color:"#6e87bf",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#6e87bf",frameHaloColor:"#ffffff",frameHaloWidth:1.2,frameGradient:.18,frameShadow:.5,frameShadowOffset:2.5,frameShadowBlur:4,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:17,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,11],[18,12]]},iconSize:{stops:[[15,14.9],[18,17.6]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{textWeight:.35,color:"#4caaf3",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#4caaf3",frameHaloColor:"#ffffff",frameHaloWidth:1.2,frameGradient:.18,frameShadow:.5,frameShadowOffset:2.5,frameShadowBlur:4,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:"road-shield",type:"symbol","source-layer":"transportation_name",filter:["all",["has","ref"],["in","class","motorway","trunk","primary"]],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:{textWeight:.35,color:"#3a4048",haloColor:"#f7f3e8",haloWidth:.5,iconColor:"#f7f3e8",iconHaloColor:"#8a8172",iconHaloWidth:1.4}},{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:{textWeight:.35,color:"#3d7ea6",haloColor:"#ffffff",haloWidth:1.4}},{id:"place-label",type:"symbol","source-layer":"place",minzoom:4,filter:["all",["in","class","city","country"],["!in","name","\u0414\u0443\u0448\u0430\u043D\u0431\u0435","\u0425\u0443\u04B7\u0430\u043D\u0434","\u0425\u0443\u0434\u0436\u0430\u043D\u0434","\u0411\u043E\u0445\u0442\u0430\u0440","\u0425\u043E\u0440\u0443\u0493","\u0425\u043E\u0440\u043E\u0433"]],layout:{textField:["{name:ru}","{name}"],textSize:{stops:[[4,11],[7,13],[10,14],[14,16],[17,17]]},maxLineChars:16,priority:90},paint:{textWeight:.35,color:"#57544e",haloColor:"#ffffff",haloWidth:1.8}},{id:"place-capital",type:"symbol","source-layer":"place",minzoom:4,filter:["all",["==","class","city"],["in","name","\u0414\u0443\u0448\u0430\u043D\u0431\u0435","\u0425\u0443\u04B7\u0430\u043D\u0434","\u0425\u0443\u0434\u0436\u0430\u043D\u0434","\u0411\u043E\u0445\u0442\u0430\u0440","\u0425\u043E\u0440\u0443\u0493","\u0425\u043E\u0440\u043E\u0433"]],layout:{textField:["{name:ru}","{name}"],textSize:{stops:[[4,12],[7,14],[10,15],[14,17],[17,18]]},maxLineChars:16,priority:110},paint:{textWeight:.35,color:"#57544e",haloColor:"#ffffff",haloWidth:1.8}},{id:"place-label-minor",type:"symbol","source-layer":"place",minzoom:7.5,filter:["in","class","town"],layout:{textField:["{name:ru}","{name}"],textSize:{stops:[[7.5,10.5],[12,12.5],[16,14]]},maxLineChars:16,priority:70},paint:{textWeight:.35,color:{from:"place-label"},haloColor:{from:"place-label"},haloWidth:1.6}},{id:"place-label-local",type:"symbol","source-layer":"place",minzoom:10.5,filter:["in","class","village","hamlet","suburb","quarter","neighbourhood","isolated_dwelling","island"],layout:{textField:["{name:ru}","{name}"],textSize:{stops:[[10.5,10.5],[16,12.5]]},maxLineChars:16,priority:55},paint:{textWeight:.35,color:{from:"place-label"},haloColor:{from:"place-label"},haloWidth:1.6}},{id:"place-region",type:"symbol",source:"regions","source-layer":"regions",minzoom:4.5,layout:{textField:["{name:ru}","{name}"],textSize:{stops:[[4.5,11.5],[7,14],[10,16],[14,17]]},letterSpacing:.15,maxLineChars:14,priority:100},paint:{textWeight:.35,color:{from:"place-label"},haloColor:{from:"place-label"},haloWidth:2}},{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:{textWeight:.35,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:{textWeight:.35,color:"#57544e",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:{textWeight:.35,color:"#2d6ecb",haloColor:"#ffffff",haloWidth:1.6}}],sources:{regions:{type:"geojson",sourceLayer:"regions",data:{type:"FeatureCollection",features:[{type:"Feature",geometry:{type:"Point",coordinates:[72.9987,38.3503]},properties:{class:"state",name:"\u0412\u0438\u043B\u043E\u044F\u0442\u0438 \u041C\u0443\u0445\u0442\u043E\u0440\u0438 \u041A\u04EF\u04B3\u0438\u0441\u0442\u043E\u043D\u0438 \u0411\u0430\u0434\u0430\u0445\u0448\u043E\u043D","name:ru":"\u0413\u043E\u0440\u043D\u043E-\u0411\u0430\u0434\u0430\u0445\u0448\u0430\u043D\u0441\u043A\u0430\u044F \u0430\u0432\u0442\u043E\u043D\u043E\u043C\u043D\u0430\u044F \u043E\u0431\u043B\u0430\u0441\u0442\u044C","name:en":"Gorno-Badakhshan Autonomous Province"}},{type:"Feature",geometry:{type:"Point",coordinates:[69.9582,40.5242]},properties:{class:"state",name:"\u0412\u0438\u043B\u043E\u044F\u0442\u0438 \u0421\u0443\u0493\u0434","name:ru":"\u0421\u043E\u0433\u0434\u0438\u0439\u0441\u043A\u0430\u044F \u043E\u0431\u043B\u0430\u0441\u0442\u044C","name:en":"Sughd Province"}},{type:"Feature",geometry:{type:"Point",coordinates:[69.2633,37.8814]},properties:{class:"state",name:"\u0412\u0438\u043B\u043E\u044F\u0442\u0438 \u0425\u0430\u0442\u043B\u043E\u043D","name:ru":"\u0425\u0430\u0442\u043B\u043E\u043D\u0441\u043A\u0430\u044F \u043E\u0431\u043B\u0430\u0441\u0442\u044C","name:en":"Khatlon Province"}},{type:"Feature",geometry:{type:"Point",coordinates:[70.0873,38.9722]},properties:{class:"state",name:"\u041D\u043E\u04B3\u0438\u044F\u04B3\u043E\u0438 \u0442\u043E\u0431\u0435\u0438 \u04B7\u0443\u043C\u04B3\u0443\u0440\u04E3","name:ru":"\u0420\u0430\u0439\u043E\u043D\u044B \u0440\u0435\u0441\u043F\u0443\u0431\u043B\u0438\u043A\u0430\u043D\u0441\u043A\u043E\u0433\u043E \u043F\u043E\u0434\u0447\u0438\u043D\u0435\u043D\u0438\u044F","name:en":"Districts of Republican Subordination"}}]}},world:{url:"/tileserver/data/world/{z}/{x}/{y}.pbf",minzoom:0,maxzoom:6},indoor:{url:"/tileserver/data/indoor/{z}/{x}/{y}.pbf",minzoom:15,maxzoom:18},points:{url:"/tileserver/data/points/{z}/{x}/{y}.pbf",minzoom:13,maxzoom:16},closures:{url:"/tileserver/data/closures/{z}/{x}/{y}.pbf",minzoom:10,maxzoom:16}}};var Pf={version:1,name:"\u0420\u0435\u043B\u044C\u0435\u0444",background:"#dbd8d4",levelHeight:1,light:{ambientColor:"#ffffff",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#ffffff",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#ffffff",fillIntensity:.18},layers:[{id:"world-landcover-wood",type:"fill",source:"world","source-layer":"landcover",maxzoom:7,filter:["in","class","wood","forest"],paint:{color:{from:"landcover-wood"}}},{id:"world-landcover-grass",type:"fill",source:"world","source-layer":"landcover",maxzoom:7,filter:["in","class","grass","farmland","meadow"],paint:{color:{from:"landcover-grass"}}},{id:"world-landcover-sand",type:"fill",source:"world","source-layer":"landcover",maxzoom:7,filter:["in","class","sand","beach"],paint:{color:{from:"landcover-sand"}}},{id:"world-landcover-ice",type:"fill",source:"world","source-layer":"landcover",maxzoom:7,filter:["in","class","ice","glacier"],paint:{color:{from:"landcover-ice"}}},{id:"world-water",type:"fill",source:"world","source-layer":"water",maxzoom:7,paint:{color:{from:"water"}}},{id:"world-boundary",type:"line",source:"world","source-layer":"boundary",maxzoom:7,paint:{color:{from:"boundary"},opacity:.7,width:{stops:[[0,.5],[6,1.1]]}}},{id:"landcover-wood",type:"surface",minzoom:7,"source-layer":"landcover",filter:["in","class","wood","forest"],paint:{color:"#c6dcb4",opacity:{stops:[[8,.5],[12,.85]]},material:"flat",sideShade:.16},elevation:.7,bevel:.5,bevelDrop:.15,cornerRadius:10,cornerSegments:4},{id:"landcover-grass",type:"surface",minzoom:7,"source-layer":"landcover",filter:["in","class","grass","farmland","meadow"],paint:{color:"#d9e6c6",opacity:{stops:[[8,.45],[12,.8]]},material:"flat",sideShade:.16},elevation:.5,bevel:.45,bevelDrop:.12,cornerRadius:8,cornerSegments:4},{id:"landcover-sand",type:"surface",minzoom:7,"source-layer":"landcover",filter:["in","class","sand","beach"],paint:{color:"#f2e7c8",material:"flat",sideShade:.16},elevation:.12,bevel:.6,bevelDrop:.08,cornerRadius:10,cornerSegments:4},{id:"landcover-ice",type:"fill",minzoom:7,"source-layer":"landcover",filter:["in","class","ice","glacier"],paint:{color:"#e6f2f7"}},{id:"landcover-wetland",type:"surface",minzoom:7,"source-layer":"landcover",filter:["in","class","wetland","swamp"],paint:{color:"#cfe0d4",material:"flat",sideShade:.16},elevation:.15,bevel:.5,bevelDrop:.08,cornerRadius:8,cornerSegments:4},{id:"landuse-residential",type:"fill","source-layer":"landuse",filter:["in","class","residential","suburb","neighbourhood","quarter"],paint:{color:"#d3d0cb",opacity:{stops:[[10,.4],[14,.7]]}}},{id:"landuse-industrial",type:"fill","source-layer":"landuse",filter:["in","class","industrial","quarry","railway","substation"],paint:{color:"#e7e0dd"}},{id:"landuse-civic",type:"fill","source-layer":"landuse",filter:["in","class","school","university","college","hospital","clinic","police","kindergarten","bus_station"],paint:{color:"#ece3d8"}},{id:"landuse-sport",type:"surface","source-layer":"landuse",filter:["in","class","pitch","stadium","playground","track","swimming_pool"],paint:{color:"#cfe3c4",material:"flat",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:"flat",sideShade:.16},elevation:.3,bevel:.4,bevelDrop:.1,cornerRadius:5,cornerSegments:4},{id:"landuse-parking",type:"fill","source-layer":"landuse",filter:["in","class","parking","fuel"],paint:{color:"#dddad5"}},{id:"park",type:"surface","source-layer":"park",paint:{color:"#cfe5bd",opacity:.75,material:"flat",sideShade:.16},elevation:.6,bevel:.5,bevelDrop:.15,cornerRadius:9,cornerSegments:4},{id:"aeroway-area",type:"fill","source-layer":"aeroway",filter:["in","class","aerodrome","apron","helipad"],paint:{color:"#e4e2e6"}},{id:"water",type:"surface",minzoom:7,"source-layer":"water",filter:["!in","class","swimming_pool"],paint:{color:"#a5cbe3",material:"water",materialScale:14,materialSpeed:1,sideShade:0},elevation:-0.35,bevel:.8,bevelDrop:.12,weld:0,cornerRadius:7,cornerSegments:4},{id:"water-pool",type:"surface","source-layer":"water",filter:["==","class","swimming_pool"],paint:{color:"#9fd3e8",material:"water",materialScale:8,materialSpeed:1,sideShade:0},elevation:-0.2,bevel:.4,bevelDrop:.08,cornerRadius:4,cornerSegments:4},{id:"waterway",type:"line","source-layer":"waterway",paint:{color:"#a5cbe3",width:{stops:[[8,.6],[12,1.4],[16,4],[19,11.5],[20,23],[21,46],[22,92]]},material:"water",materialScale:10,materialSpeed:1,elevation:-0.3}},{id:"aeroway-line",type:"line","source-layer":"aeroway",filter:["in","class","runway","taxiway"],paint:{color:"#d8d5da",width:{stops:[[10,1],[14,5],[18,24],[19,24],[20,48],[21,96],[22,192]]},material:"flat",elevation:.08}},{id:"road-bed",type:"surface","source-layer":"transportation",minzoom:15,filter:["in","class","motorway","trunk","primary","secondary","tertiary","minor","service","track"],fromLines:true,width:6,widthExtra:.8,deck:.5,elevation:.12,bevel:.14,bevelDrop:.12,weld:.6,paint:{color:"#c9c3b7",material:"flat",sideShade:.18}},{id:"path-bed",type:"surface","source-layer":"transportation",minzoom:15.5,filter:["in","class","path","pedestrian","footway","steps"],fromLines:true,width:2.2,widthExtra:.3,deck:.25,elevation:.2,bevel:.09,bevelDrop:.2,weld:.4,paint:{color:"#ddd6c7",material:"flat",sideShade:.2}},{id:"road-bridge-outline-thin",type:"line",network:"roads","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","path","pedestrian","footway","steps","rail","transit"]],minzoom:14,paint:{elevation:.1,color:{from:"road-casing-major",darken:.2},width:{stops:[[14,2.5],[17,5],[19,9],[20,15],[21,28]]}}},{id:"road-casing-major",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","motorway","trunk","primary"],minzoom:5,paint:{color:"#d4ab68",width:{stops:[[6,1.6],[10,3.4],[14,8],[16,14],[18,30],[19,45],[20,90],[21,180],[22,360]]},elevation:.15,widthFromData:true,widthExtra:2.5}},{id:"road-casing-secondary",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","secondary","tertiary"],minzoom:9,paint:{color:{stops:[[16,"#c6bca6"],[18.5,"#d4ab68"]]},width:{stops:[[10,1.6],[14,5.5],[16,10],[18,22],[19,33],[20,66],[21,132],[22,264]]},elevation:.13,widthFromData:true,widthExtra:2}},{id:"road-casing-minor",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","minor","service","track"],minzoom:12,paint:{color:{stops:[[16,"#cdc4b2"],[18.5,"#d4ab68"]]},width:{stops:[[13,1.4],[16,6],[18,14],[19,22],[20,44],[21,88],[22,176]]},elevation:.11,widthFromData:true,widthExtra:1.5}},{id:"road-rail",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","rail","transit"],minzoom:10,paint:{color:"#b2a99e",width:{stops:[[10,.8],[14,1.8],[18,4],[19,5.5],[20,11],[21,22],[22,44]]},elevation:.12}},{id:"road-path",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","path","pedestrian","footway","steps"],minzoom:14,paint:{color:"#bdb2a0",width:{stops:[[14,.8],[17,2],[19,4],[20,8],[21,16],[22,32]]},dashArray:[4,3],material:"flat",elevation:.22}},{id:"road-minor",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","minor","service","track"],minzoom:12,paint:{color:{stops:[[16,"#ffffff"],[18.5,"#ffdfa3"]]},width:{stops:[[13,.6],[16,4],[18,11],[19,18],[20,36],[21,72],[22,144]]},material:"flat",elevation:.14,widthFromData:true}},{id:"road-ramp",network:"roads",type:"line","source-layer":"transportation",filter:["all",["in","class","motorway","trunk","primary"],["has","ramp"]],minzoom:5,paint:{color:"#ffdfa3",width:{stops:[[6,.8],[10,2.2],[14,6],[16,11],[18,25],[19,38.5],[20,77],[21,154],[22,308]]},material:"flat",elevation:.18,widthFromData:true}},{id:"road-secondary",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","secondary","tertiary"],minzoom:9,paint:{color:{stops:[[16,"#ffffff"],[18.5,"#ffdfa3"]]},width:{stops:[[10,.8],[14,3.6],[16,7.5],[18,18],[19,28],[20,56],[21,112],[22,224]]},material:"flat",elevation:.16,widthFromData:true}},{id:"road-major",network:"roads",type:"line","source-layer":"transportation",filter:["all",["in","class","motorway","trunk","primary"],["!has","ramp"]],minzoom:5,paint:{color:"#ffdfa3",width:{stops:[[6,.8],[10,2.2],[14,6],[16,11],[18,25],[19,38.5],[20,77],[21,154],[22,308]]},material:"flat",elevation:.18,widthFromData:true}},{id:"road-lane-divider-major",network:"roads",type:"line","source-layer":"transportation",filter:["all",["!has","oneway"],["in","class","motorway","trunk","primary"]],minzoom:16.5,paint:{color:"#e3bd7f",width:{stops:[[16.5,.54],[17,.78],[18,1.4],[19,2.17],[20,4.34],[21,8.68],[22,17.36]]},dashArray:[7,18],material:"flat",elevation:.182}},{id:"road-lane-divider-secondary",network:"roads",type:"line","source-layer":"transportation",filter:["all",["!has","oneway"],["in","class","secondary","tertiary"]],minzoom:16.5,paint:{color:"#d8cfbc",width:{stops:[[16.5,.46],[17,.67],[18,1.2],[19,1.86],[20,3.72],[21,7.44],[22,14.88]]},dashArray:[7,18],material:"flat",elevation:.162}},{id:"boundary",type:"line",minzoom:7,"source-layer":"boundary",filter:["<=","admin_level",4],paint:{color:"#b3a6b8",opacity:.7,width:{stops:[[4,.7],[10,1.4],[16,2.4]]},dashArray:[6,4]}},{id:"building-flat",type:"fill","source-layer":"building",minzoom:15,maxzoom:16,paint:{color:{from:"building",property:"roofColor"},opacity:1}},{id:"building",type:"fill-extrusion","source-layer":"building",minzoom:16,paint:{color:"#ffffff",roofColor:"#f2f1f0",opacity:1,heightScale:{stops:[[16,0],[16.8,1]]},aoStrength:.18,tintVariation:0,windowColor:"#7f9ab5",windowFrameColor:"#e9e5dc",windowGlow:0,facadeDetail:1,floorHeight:3.2,roofVariation:.35}},{id:"indoor-venue",type:"fill-extrusion",source:"indoor","source-layer":"area",filter:["all",["==","class","level"],["==","base",1]],minzoom:15,maxzoom:16,paint:{color:"#d8d3c8",roofColor:"#d9d3c7",opacity:1,aoStrength:.18,tintVariation:.06,windowColor:"#7f9ab5",windowFrameColor:"#e9e5dc",windowGlow:0,facadeDetail:1,floorHeight:3.2,roofVariation:.35}},{id:"road-closed-casing",type:"line",source:"closures","source-layer":"closures",minzoom:11,paint:{color:"#ffffff",width:{stops:[[11,4],[14,6],[17,10],[19,16],[20,32],[21,64],[22,128]]},opacity:.9},overlay:"roads"},{id:"road-closed",type:"line",source:"closures","source-layer":"closures",minzoom:11,paint:{color:"#d92b2b",width:{stops:[[11,2.5],[14,4],[17,7],[19,11],[20,22],[21,44],[22,88]]},dashArray:[5,4]},overlay:"roads"},{id:"traffic-signal",type:"symbol",source:"points","source-layer":"roadpoints",minzoom:17,filter:["==","kind","traffic_signals"],layout:{iconImage:"traffic_signals",allowOverlap:true,iconParts:["traffic_light_pole","traffic_light_body","traffic_light_red","traffic_light_amber","traffic_light_green"],offset:[0,-12],iconSize:{stops:[[17,17],[19,26]]},priority:3},paint:{color:"#5c6470",haloColor:"#ffffff",haloWidth:1.4,partColors:["#6a717c","#1c2026","#ff4d57","#f8cf2c","#12d370"],partHaloWidths:[1,1.3,0,0,0]}},{id:"housenumber",type:"symbol","source-layer":"housenumber",minzoom:17,layout:{ignorePlacement:true,placementGroup:"background-labels",textField:"{housenumber}",textSize:{stops:[[17,9],[19,11]]},maxLineChars:6,priority:-60},paint:{textWeight:.35,color:"#8c8478",haloColor:"#f5f3ee",haloWidth:1}},{id:"road-label-minor",type:"symbol","source-layer":"transportation_name",minzoom:15,filter:["!in","class","motorway","trunk","primary","secondary"],layout:{ignorePlacement:true,placementGroup:"background-labels",textField:["{name:ru}","{name}"],textPlacement:"line",symbolSpacing:900,textSize:{stops:[[15,10.5],[18,12]]},priority:15,abbreviate:true},paint:{textWeight:.35,color:{from:"road-label"},haloColor:{from:"road-label"},haloWidth:1.6}},{id:"road-label",type:"symbol","source-layer":"transportation_name",minzoom:12.5,filter:["in","class","motorway","trunk","primary","secondary"],layout:{ignorePlacement:true,placementGroup:"background-labels",textField:["{name:ru}","{name}"],textPlacement:"line",symbolSpacing:900,textSize:{stops:[[14,10],[18,13]]},priority:20,abbreviate:true},paint:{textWeight:.35,color:"#5c5646",haloColor:"#ffffff",haloWidth:1.6}},{id:"road-closed-end",type:"symbol",source:"closures","source-layer":"closure_ends",minzoom:13,layout:{iconImage:"road_closed",iconFrame:"circle",iconFrameScale:1.6,allowOverlap:true,iconSize:13,priority:6},paint:{color:"#d92b2b",frameColor:"#d92b2b",frameOpacity:1,frameHaloColor:"#ffffff",frameHaloWidth:1.4,frameGradient:.18,frameShadow:.5,frameShadowOffset:2.5,frameShadowBlur:4,iconColor:"#ffffff",iconHaloWidth:0}},{id:"crossing",type:"surface",weld:0,source:"points","source-layer":"crossings",minzoom:16.5,overlay:"roads",paint:{color:"#ffffff",opacity:.9,sideShade:.16},elevation:.09,bevel:.05,bevelDrop:.02,groundBy:{"landcover:wood":.7,"landcover:forest":.7,"landcover:grass":.5,"landcover:farmland":.5,"landcover:meadow":.5,"landcover:sand":.12,"landcover:beach":.12,"landcover:wetland":.15,"landcover:swamp":.15,"landuse:pitch":.35,"landuse:stadium":.35,"landuse:playground":.35,"landuse:track":.35,"landuse:swimming_pool":.35,"landuse:cemetery":.3,"landuse:grave_yard":.3,"park:park":.6}},{id:"poi-food",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,11],[18,12]]},iconSize:{stops:[[15,14.9],[18,17.6]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{textWeight:.35,color:"#f4882c",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#f4882c",frameHaloColor:"#ffffff",frameHaloWidth:1.2,frameGradient:.18,frameShadow:.5,frameShadowOffset:2.5,frameShadowBlur:4,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:16,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,11],[18,12]]},iconSize:{stops:[[15,14.9],[18,17.6]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{textWeight:.35,color:"#a269e7",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#a269e7",frameHaloColor:"#ffffff",frameHaloWidth:1.2,frameGradient:.18,frameShadow:.5,frameShadowOffset:2.5,frameShadowBlur:4,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,11],[18,12]]},iconSize:{stops:[[15,14.9],[18,17.6]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{textWeight:.35,color:"#4677e8",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#4677e8",frameHaloColor:"#ffffff",frameHaloWidth:1.2,frameGradient:.18,frameShadow:.5,frameShadowOffset:2.5,frameShadowBlur:4,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,11],[18,12]]},iconSize:{stops:[[15,14.9],[18,17.6]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{textWeight:.35,color:"#f86776",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#f86776",frameHaloColor:"#ffffff",frameHaloWidth:1.2,frameGradient:.18,frameShadow:.5,frameShadowOffset:2.5,frameShadowBlur:4,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","pharmacy","hospital","doctors","dentist","veterinary"]},{id:"poi-education",type:"symbol","source-layer":"poi",minzoom:16,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,11],[18,12]]},iconSize:{stops:[[15,14.9],[18,17.6]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{textWeight:.35,color:"#2ac1d4",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#2ac1d4",frameHaloColor:"#ffffff",frameHaloWidth:1.2,frameGradient:.18,frameShadow:.5,frameShadowOffset:2.5,frameShadowBlur:4,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,11],[18,12]]},iconSize:{stops:[[15,14.9],[18,17.6]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{textWeight:.35,color:"#cc5e3c",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#cc5e3c",frameHaloColor:"#ffffff",frameHaloWidth:1.2,frameGradient:.18,frameShadow:.5,frameShadowOffset:2.5,frameShadowBlur:4,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,11],[18,12]]},iconSize:{stops:[[15,14.9],[18,17.6]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{textWeight:.35,color:"#2db375",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#2db375",frameHaloColor:"#ffffff",frameHaloWidth:1.2,frameGradient:.18,frameShadow:.5,frameShadowOffset:2.5,frameShadowBlur:4,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:16,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,11],[18,12]]},iconSize:{stops:[[15,14.9],[18,17.6]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{textWeight:.35,color:"#a66fe8",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#a66fe8",frameHaloColor:"#ffffff",frameHaloWidth:1.2,frameGradient:.18,frameShadow:.5,frameShadowOffset:2.5,frameShadowBlur:4,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","lodging"]},{id:"poi-service",type:"symbol","source-layer":"poi",minzoom:17,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,11],[18,12]]},iconSize:{stops:[[15,14.9],[18,17.6]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{textWeight:.35,color:"#6e87bf",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#6e87bf",frameHaloColor:"#ffffff",frameHaloWidth:1.2,frameGradient:.18,frameShadow:.5,frameShadowOffset:2.5,frameShadowBlur:4,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:17,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,11],[18,12]]},iconSize:{stops:[[15,14.9],[18,17.6]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{textWeight:.35,color:"#4caaf3",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#4caaf3",frameHaloColor:"#ffffff",frameHaloWidth:1.2,frameGradient:.18,frameShadow:.5,frameShadowOffset:2.5,frameShadowBlur:4,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:"road-shield",type:"symbol","source-layer":"transportation_name",filter:["all",["has","ref"],["in","class","motorway","trunk","primary"]],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:{textWeight:.35,color:"#3a4048",haloColor:"#f7f3e8",haloWidth:.5,iconColor:"#f7f3e8",iconHaloColor:"#8a8172",iconHaloWidth:1.4}},{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:{textWeight:.35,color:"#3d7ea6",haloColor:"#ffffff",haloWidth:1.4}},{id:"place-label",type:"symbol","source-layer":"place",minzoom:4,filter:["all",["in","class","city","country"],["!in","name","\u0414\u0443\u0448\u0430\u043D\u0431\u0435","\u0425\u0443\u04B7\u0430\u043D\u0434","\u0425\u0443\u0434\u0436\u0430\u043D\u0434","\u0411\u043E\u0445\u0442\u0430\u0440","\u0425\u043E\u0440\u0443\u0493","\u0425\u043E\u0440\u043E\u0433"]],layout:{textField:["{name:ru}","{name}"],textSize:{stops:[[4,11],[7,13],[10,14],[14,16],[17,17]]},maxLineChars:16,priority:90},paint:{textWeight:.35,color:"#57544e",haloColor:"#ffffff",haloWidth:1.8}},{id:"place-capital",type:"symbol","source-layer":"place",minzoom:4,filter:["all",["==","class","city"],["in","name","\u0414\u0443\u0448\u0430\u043D\u0431\u0435","\u0425\u0443\u04B7\u0430\u043D\u0434","\u0425\u0443\u0434\u0436\u0430\u043D\u0434","\u0411\u043E\u0445\u0442\u0430\u0440","\u0425\u043E\u0440\u0443\u0493","\u0425\u043E\u0440\u043E\u0433"]],layout:{textField:["{name:ru}","{name}"],textSize:{stops:[[4,12],[7,14],[10,15],[14,17],[17,18]]},maxLineChars:16,priority:110},paint:{textWeight:.35,color:"#57544e",haloColor:"#ffffff",haloWidth:1.8}},{id:"place-label-minor",type:"symbol","source-layer":"place",minzoom:7.5,filter:["in","class","town"],layout:{textField:["{name:ru}","{name}"],textSize:{stops:[[7.5,10.5],[12,12.5],[16,14]]},maxLineChars:16,priority:70},paint:{textWeight:.35,color:{from:"place-label"},haloColor:{from:"place-label"},haloWidth:1.6}},{id:"place-label-local",type:"symbol","source-layer":"place",minzoom:10.5,filter:["in","class","village","hamlet","suburb","quarter","neighbourhood","isolated_dwelling","island"],layout:{textField:["{name:ru}","{name}"],textSize:{stops:[[10.5,10.5],[16,12.5]]},maxLineChars:16,priority:55},paint:{textWeight:.35,color:{from:"place-label"},haloColor:{from:"place-label"},haloWidth:1.6}},{id:"place-region",type:"symbol",source:"regions","source-layer":"regions",minzoom:4.5,layout:{textField:["{name:ru}","{name}"],textSize:{stops:[[4.5,11.5],[7,14],[10,16],[14,17]]},letterSpacing:.15,maxLineChars:14,priority:100},paint:{textWeight:.35,color:{from:"place-label"},haloColor:{from:"place-label"},haloWidth:2}},{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:{textWeight:.35,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:{textWeight:.35,color:"#57544e",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:{textWeight:.35,color:"#2d6ecb",haloColor:"#ffffff",haloWidth:1.6}}],sources:{regions:{type:"geojson",sourceLayer:"regions",data:{type:"FeatureCollection",features:[{type:"Feature",geometry:{type:"Point",coordinates:[72.9987,38.3503]},properties:{class:"state",name:"\u0412\u0438\u043B\u043E\u044F\u0442\u0438 \u041C\u0443\u0445\u0442\u043E\u0440\u0438 \u041A\u04EF\u04B3\u0438\u0441\u0442\u043E\u043D\u0438 \u0411\u0430\u0434\u0430\u0445\u0448\u043E\u043D","name:ru":"\u0413\u043E\u0440\u043D\u043E-\u0411\u0430\u0434\u0430\u0445\u0448\u0430\u043D\u0441\u043A\u0430\u044F \u0430\u0432\u0442\u043E\u043D\u043E\u043C\u043D\u0430\u044F \u043E\u0431\u043B\u0430\u0441\u0442\u044C","name:en":"Gorno-Badakhshan Autonomous Province"}},{type:"Feature",geometry:{type:"Point",coordinates:[69.9582,40.5242]},properties:{class:"state",name:"\u0412\u0438\u043B\u043E\u044F\u0442\u0438 \u0421\u0443\u0493\u0434","name:ru":"\u0421\u043E\u0433\u0434\u0438\u0439\u0441\u043A\u0430\u044F \u043E\u0431\u043B\u0430\u0441\u0442\u044C","name:en":"Sughd Province"}},{type:"Feature",geometry:{type:"Point",coordinates:[69.2633,37.8814]},properties:{class:"state",name:"\u0412\u0438\u043B\u043E\u044F\u0442\u0438 \u0425\u0430\u0442\u043B\u043E\u043D","name:ru":"\u0425\u0430\u0442\u043B\u043E\u043D\u0441\u043A\u0430\u044F \u043E\u0431\u043B\u0430\u0441\u0442\u044C","name:en":"Khatlon Province"}},{type:"Feature",geometry:{type:"Point",coordinates:[70.0873,38.9722]},properties:{class:"state",name:"\u041D\u043E\u04B3\u0438\u044F\u04B3\u043E\u0438 \u0442\u043E\u0431\u0435\u0438 \u04B7\u0443\u043C\u04B3\u0443\u0440\u04E3","name:ru":"\u0420\u0430\u0439\u043E\u043D\u044B \u0440\u0435\u0441\u043F\u0443\u0431\u043B\u0438\u043A\u0430\u043D\u0441\u043A\u043E\u0433\u043E \u043F\u043E\u0434\u0447\u0438\u043D\u0435\u043D\u0438\u044F","name:en":"Districts of Republican Subordination"}}]}},world:{url:"/tileserver/data/world/{z}/{x}/{y}.pbf",minzoom:0,maxzoom:6},indoor:{url:"/tileserver/data/indoor/{z}/{x}/{y}.pbf",minzoom:15,maxzoom:18},points:{url:"/tileserver/data/points/{z}/{x}/{y}.pbf",minzoom:13,maxzoom:16},closures:{url:"/tileserver/data/closures/{z}/{x}/{y}.pbf",minzoom:10,maxzoom:16}}};var Hf={version:1,name:"\u041E\u0431\u044A\u0451\u043C\u043D\u044B\u0439 \u0433\u043E\u0440\u043E\u0434",background:"#dbd8d4",light:{ambientColor:"#ffffff",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#ffffff",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#ffffff",fillIntensity:.18},layers:[{id:"world-landcover-wood",type:"fill",source:"world","source-layer":"landcover",maxzoom:7,filter:["in","class","wood","forest"],paint:{color:{from:"landcover-wood"}}},{id:"world-landcover-grass",type:"fill",source:"world","source-layer":"landcover",maxzoom:7,filter:["in","class","grass","farmland","meadow"],paint:{color:{from:"landcover-grass"}}},{id:"world-landcover-sand",type:"fill",source:"world","source-layer":"landcover",maxzoom:7,filter:["in","class","sand","beach"],paint:{color:{from:"landcover-sand"}}},{id:"world-landcover-ice",type:"fill",source:"world","source-layer":"landcover",maxzoom:7,filter:["in","class","ice","glacier"],paint:{color:{from:"landcover-ice"}}},{id:"world-water",type:"fill",source:"world","source-layer":"water",maxzoom:7,paint:{color:{from:"water"}}},{id:"world-boundary",type:"line",source:"world","source-layer":"boundary",maxzoom:7,paint:{color:{from:"boundary"},opacity:.7,width:{stops:[[0,.5],[6,1.1]]}}},{id:"landcover-wood",type:"surface",minzoom:7,"source-layer":"landcover",filter:["in","class","wood","forest"],paint:{color:"#c6dcb4",opacity:{stops:[[8,.5],[12,.85]]},material:"flat",sideShade:.16},elevation:.175,bevel:.125,bevelDrop:.038,cornerRadius:10,cornerSegments:4},{id:"landcover-grass",type:"surface",minzoom:7,"source-layer":"landcover",filter:["in","class","grass","farmland","meadow"],paint:{color:"#d9e6c6",opacity:{stops:[[8,.45],[12,.8]]},material:"flat",sideShade:.16},elevation:.125,bevel:.113,bevelDrop:.03,cornerRadius:8,cornerSegments:4},{id:"landcover-sand",type:"surface",minzoom:7,"source-layer":"landcover",filter:["in","class","sand","beach"],paint:{color:"#f2e7c8",material:"flat",sideShade:.16},elevation:.035,bevel:.15,bevelDrop:.02,cornerRadius:10,cornerSegments:4},{id:"landcover-ice",type:"fill",minzoom:7,"source-layer":"landcover",filter:["in","class","ice","glacier"],paint:{color:"#e6f2f7"}},{id:"landcover-wetland",type:"surface",minzoom:7,"source-layer":"landcover",filter:["in","class","wetland","swamp"],paint:{color:"#cfe0d4",material:"flat",sideShade:.16},elevation:.045,bevel:.125,bevelDrop:.02,cornerRadius:8,cornerSegments:4},{id:"landuse-residential",type:"surface","source-layer":"landuse",filter:["in","class","residential","suburb","neighbourhood","quarter"],paint:{color:"#d3d0cb",opacity:{stops:[[10,.4],[14,.7]]},material:"flat",sideShade:.16},cornerRadius:4,cornerSegments:3,elevation:.02,bevel:.1,bevelDrop:.02},{id:"landuse-industrial",type:"surface","source-layer":"landuse",filter:["in","class","industrial","quarry","railway","substation"],paint:{color:"#e7e0dd",material:"flat",sideShade:.16},cornerRadius:4,cornerSegments:3,elevation:.03,bevel:.1,bevelDrop:.02},{id:"landuse-civic",type:"surface","source-layer":"landuse",filter:["in","class","school","university","college","hospital","clinic","police","kindergarten","bus_station"],paint:{color:"#ece3d8",material:"flat",sideShade:.16},cornerRadius:4,cornerSegments:3,elevation:.055,bevel:.1,bevelDrop:.02},{id:"landuse-sport",type:"surface","source-layer":"landuse",filter:["in","class","pitch","stadium","playground","track","swimming_pool"],paint:{color:"#cfe3c4",material:"flat",sideShade:.16},elevation:.088,bevel:.1,bevelDrop:.025,cornerRadius:5,cornerSegments:3},{id:"landuse-cemetery",type:"surface","source-layer":"landuse",filter:["in","class","cemetery","grave_yard"],paint:{color:"#d6dfc8",material:"flat",sideShade:.16},elevation:.075,bevel:.1,bevelDrop:.025,cornerRadius:5,cornerSegments:3},{id:"landuse-parking",type:"surface","source-layer":"landuse",filter:["in","class","parking","fuel"],paint:{color:"#dddad5",material:"flat",sideShade:.16},cornerRadius:3,cornerSegments:3,elevation:.19,bevel:.1,bevelDrop:.02},{id:"park",type:"surface","source-layer":"park",paint:{color:"#cfe5bd",opacity:.75,material:"flat",sideShade:.16},elevation:.15,bevel:.125,bevelDrop:.038,cornerRadius:9,cornerSegments:4},{id:"aeroway-area",type:"surface","source-layer":"aeroway",filter:["in","class","aerodrome","apron","helipad"],paint:{color:"#e4e2e6",material:"flat",sideShade:.16},cornerRadius:5,cornerSegments:3,elevation:.065,bevel:.1,bevelDrop:.02},{id:"water",type:"surface",minzoom:7,"source-layer":"water",filter:["!in","class","swimming_pool"],paint:{color:"#a5cbe3",material:"water",materialScale:14,materialSpeed:1,sideShade:0},elevation:-0.087,bevel:.2,bevelDrop:.03,weld:0,cornerRadius:7,cornerSegments:4},{id:"water-pool",type:"surface","source-layer":"water",filter:["==","class","swimming_pool"],paint:{color:"#9fd3e8",material:"water",materialScale:8,materialSpeed:1,sideShade:0},elevation:-0.05,bevel:.1,bevelDrop:.02,cornerRadius:4,cornerSegments:3},{id:"waterway",type:"line","source-layer":"waterway",paint:{color:"#a5cbe3",width:{stops:[[8,.6],[12,1.4],[16,4],[19,11.5],[20,23],[21,46],[22,92]]},material:"water",materialScale:10,materialSpeed:1,elevation:-0.075}},{id:"aeroway-line",type:"line","source-layer":"aeroway",filter:["in","class","runway","taxiway"],paint:{color:"#d8d5da",width:{stops:[[10,1],[14,5],[18,24],[19,24],[20,48],[21,96],[22,192]]},material:"flat",elevation:.02}},{id:"road-bridge-outline-thin",type:"line",network:"roads","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","path","pedestrian","footway","steps","rail","transit"]],minzoom:14,paint:{elevation:.025,color:{from:"road-casing-major",darken:.2},width:{stops:[[14,2.5],[17,5],[19,9],[20,15],[21,28]]}}},{id:"road-casing-major",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","motorway","trunk","primary"],minzoom:5,paint:{color:"#d4ab68",width:{stops:[[6,1.6],[10,3.4],[14,8],[16,14],[18,30],[19,45],[20,90],[21,180],[22,360]]},elevation:.037,widthFromData:true,widthExtra:2.5}},{id:"road-casing-secondary",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","secondary","tertiary"],minzoom:9,paint:{color:{stops:[[16,"#c6bca6"],[18.5,"#d4ab68"]]},width:{stops:[[10,1.6],[14,5.5],[16,10],[18,22],[19,33],[20,66],[21,132],[22,264]]},elevation:.033,widthFromData:true,widthExtra:2}},{id:"road-casing-minor",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","minor","service","track"],minzoom:12,paint:{color:{stops:[[16,"#cdc4b2"],[18.5,"#d4ab68"]]},width:{stops:[[13,1.4],[16,6],[18,14],[19,22],[20,44],[21,88],[22,176]]},elevation:.028,widthFromData:true,widthExtra:1.5}},{id:"road-rail",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","rail","transit"],minzoom:10,paint:{color:"#b2a99e",width:{stops:[[10,.8],[14,1.8],[18,4],[19,5.5],[20,11],[21,22],[22,44]]},elevation:.03}},{id:"road-path-casing",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","path","pedestrian","footway","steps"],minzoom:14,paint:{color:{from:"road-casing-minor"},width:{stops:[[14,2.8],[17,4],[19,6],[20,10],[21,18],[22,34]]},material:"flat",elevation:.011}},{id:"road-path",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","path","pedestrian","footway","steps"],minzoom:14,paint:{color:"#bdb2a0",width:{stops:[[14,.8],[17,2],[19,4],[20,8],[21,16],[22,32]]},dashArray:[4,3],material:"flat",elevation:.013}},{id:"road-minor",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","minor","service","track"],minzoom:12,paint:{color:{stops:[[16,"#ffffff"],[18.5,"#ffdfa3"]]},width:{stops:[[13,.6],[16,4],[18,11],[19,18],[20,36],[21,72],[22,144]]},material:"flat",elevation:.035,widthFromData:true}},{id:"road-ramp",network:"roads",type:"line","source-layer":"transportation",filter:["all",["in","class","motorway","trunk","primary"],["has","ramp"]],minzoom:5,paint:{color:"#ffdfa3",width:{stops:[[6,.8],[10,2.2],[14,6],[16,11],[18,25],[19,38.5],[20,77],[21,154],[22,308]]},material:"flat",elevation:.045,widthFromData:true}},{id:"road-secondary",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","secondary","tertiary"],minzoom:9,paint:{color:{stops:[[16,"#ffffff"],[18.5,"#ffdfa3"]]},width:{stops:[[10,.8],[14,3.6],[16,7.5],[18,18],[19,28],[20,56],[21,112],[22,224]]},material:"flat",elevation:.04,widthFromData:true}},{id:"road-major",network:"roads",type:"line","source-layer":"transportation",filter:["all",["in","class","motorway","trunk","primary"],["!has","ramp"]],minzoom:5,paint:{color:"#ffdfa3",width:{stops:[[6,.8],[10,2.2],[14,6],[16,11],[18,25],[19,38.5],[20,77],[21,154],[22,308]]},material:"flat",elevation:.045,widthFromData:true}},{id:"road-lane-divider-major",network:"roads",type:"line","source-layer":"transportation",filter:["all",["!has","oneway"],["in","class","motorway","trunk","primary"]],minzoom:16.5,paint:{color:"#e3bd7f",width:{stops:[[16.5,.54],[17,.78],[18,1.4],[19,2.17],[20,4.34],[21,8.68],[22,17.36]]},dashArray:[7,18],material:"flat",elevation:.047}},{id:"road-lane-divider-secondary",network:"roads",type:"line","source-layer":"transportation",filter:["all",["!has","oneway"],["in","class","secondary","tertiary"]],minzoom:16.5,paint:{color:"#d8cfbc",width:{stops:[[16.5,.46],[17,.67],[18,1.2],[19,1.86],[20,3.72],[21,7.44],[22,14.88]]},dashArray:[7,18],material:"flat",elevation:.042}},{id:"boundary",type:"line",minzoom:7,"source-layer":"boundary",filter:["<=","admin_level",4],paint:{color:"#b3a6b8",opacity:.7,width:{stops:[[4,.7],[10,1.4],[16,2.4]]},dashArray:[6,4]}},{id:"building-flat",type:"fill","source-layer":"building",minzoom:15,maxzoom:16,paint:{color:{from:"building",property:"roofColor"},opacity:1}},{id:"building",type:"fill-extrusion","source-layer":"building",minzoom:16,paint:{color:"#ffffff",roofColor:"#f2f1f0",opacity:1,heightScale:{stops:[[16,0],[16.8,1]]},aoStrength:.18,tintVariation:0,windowColor:"#7f9ab5",windowFrameColor:"#e9e5dc",windowGlow:0,facadeDetail:1,floorHeight:3.2,roofVariation:.35},cornerRadius:1.6,cornerSegments:2},{id:"indoor-venue",type:"fill-extrusion",source:"indoor","source-layer":"area",filter:["all",["==","class","level"],["==","base",1]],minzoom:15,maxzoom:16,paint:{color:"#d8d3c8",roofColor:"#d9d3c7",opacity:1,aoStrength:.18,tintVariation:.06,windowColor:"#7f9ab5",windowFrameColor:"#e9e5dc",windowGlow:0,facadeDetail:1,floorHeight:3.2,roofVariation:.35}},{id:"road-closed-casing",type:"line",source:"closures","source-layer":"closures",minzoom:11,paint:{color:"#ffffff",width:{stops:[[11,4],[14,6],[17,10],[19,16],[20,32],[21,64],[22,128]]},opacity:.9},overlay:"roads"},{id:"road-closed",type:"line",source:"closures","source-layer":"closures",minzoom:11,paint:{color:"#d92b2b",width:{stops:[[11,2.5],[14,4],[17,7],[19,11],[20,22],[21,44],[22,88]]},dashArray:[5,4]},overlay:"roads"},{id:"traffic-signal",type:"symbol",source:"points","source-layer":"roadpoints",minzoom:17,filter:["==","kind","traffic_signals"],layout:{iconImage:"traffic_signals",allowOverlap:true,iconParts:["traffic_light_pole","traffic_light_body","traffic_light_red","traffic_light_amber","traffic_light_green"],offset:[0,-12],iconSize:{stops:[[17,17],[19,26]]},priority:3},paint:{color:"#5c6470",haloColor:"#ffffff",haloWidth:1.4,partColors:["#6a717c","#1c2026","#ff4d57","#f8cf2c","#12d370"],partHaloWidths:[1,1.3,0,0,0]}},{id:"housenumber",type:"symbol","source-layer":"housenumber",minzoom:17,layout:{ignorePlacement:true,placementGroup:"background-labels",textField:"{housenumber}",textSize:{stops:[[17,9],[19,11]]},maxLineChars:6,priority:-60},paint:{textWeight:.35,color:"#8c8478",haloColor:"#f5f3ee",haloWidth:1}},{id:"road-label-minor",type:"symbol","source-layer":"transportation_name",minzoom:15,filter:["!in","class","motorway","trunk","primary","secondary"],layout:{ignorePlacement:true,placementGroup:"background-labels",textField:["{name:ru}","{name}"],textPlacement:"line",symbolSpacing:900,textSize:{stops:[[15,10.5],[18,12]]},priority:15,abbreviate:true},paint:{textWeight:.35,color:{from:"road-label"},haloColor:{from:"road-label"},haloWidth:1.6}},{id:"road-label",type:"symbol","source-layer":"transportation_name",minzoom:12.5,filter:["in","class","motorway","trunk","primary","secondary"],layout:{ignorePlacement:true,placementGroup:"background-labels",textField:["{name:ru}","{name}"],textPlacement:"line",symbolSpacing:900,textSize:{stops:[[14,10],[18,13]]},priority:20,abbreviate:true},paint:{textWeight:.35,color:"#5c5646",haloColor:"#ffffff",haloWidth:1.6}},{id:"road-closed-end",type:"symbol",source:"closures","source-layer":"closure_ends",minzoom:13,layout:{iconImage:"road_closed",iconFrame:"circle",iconFrameScale:1.6,allowOverlap:true,iconSize:13,priority:6},paint:{color:"#d92b2b",frameColor:"#d92b2b",frameOpacity:1,frameHaloColor:"#ffffff",frameHaloWidth:1.4,frameGradient:.18,frameShadow:.5,frameShadowOffset:2.5,frameShadowBlur:4,iconColor:"#ffffff",iconHaloWidth:0}},{id:"crossing",type:"surface",weld:0,source:"points","source-layer":"crossings",minzoom:16.5,overlay:"roads",paint:{color:"#ffffff",opacity:.9,sideShade:.16,material:"flat"},elevation:.023,bevel:.013,bevelDrop:.005,groundBy:{"landcover:wood":.175,"landcover:forest":.175,"landcover:grass":.125,"landcover:farmland":.125,"landcover:meadow":.125,"landcover:sand":.035,"landcover:beach":.035,"landcover:wetland":.045,"landcover:swamp":.045,"landuse:residential":.02,"landuse:suburb":.02,"landuse:neighbourhood":.02,"landuse:quarter":.02,"landuse:industrial":.03,"landuse:quarry":.03,"landuse:railway":.03,"landuse:substation":.03,"landuse:school":.055,"landuse:university":.055,"landuse:college":.055,"landuse:hospital":.055,"landuse:clinic":.055,"landuse:police":.055,"landuse:kindergarten":.055,"landuse:bus_station":.055,"landuse:pitch":.088,"landuse:stadium":.088,"landuse:playground":.088,"landuse:track":.088,"landuse:swimming_pool":.088,"landuse:cemetery":.075,"landuse:grave_yard":.075,"landuse:parking":.19,"landuse:fuel":.19,"park:park":.15,"aeroway:aerodrome":.065,"aeroway:apron":.065,"aeroway:helipad":.065}},{id:"poi-food",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,11],[18,12]]},iconSize:{stops:[[15,14.9],[18,17.6]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{textWeight:.35,color:"#f4882c",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#f4882c",frameHaloColor:"#ffffff",frameHaloWidth:1.2,frameGradient:.18,frameShadow:.5,frameShadowOffset:2.5,frameShadowBlur:4,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:16,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,11],[18,12]]},iconSize:{stops:[[15,14.9],[18,17.6]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{textWeight:.35,color:"#a269e7",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#a269e7",frameHaloColor:"#ffffff",frameHaloWidth:1.2,frameGradient:.18,frameShadow:.5,frameShadowOffset:2.5,frameShadowBlur:4,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,11],[18,12]]},iconSize:{stops:[[15,14.9],[18,17.6]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{textWeight:.35,color:"#4677e8",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#4677e8",frameHaloColor:"#ffffff",frameHaloWidth:1.2,frameGradient:.18,frameShadow:.5,frameShadowOffset:2.5,frameShadowBlur:4,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,11],[18,12]]},iconSize:{stops:[[15,14.9],[18,17.6]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{textWeight:.35,color:"#f86776",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#f86776",frameHaloColor:"#ffffff",frameHaloWidth:1.2,frameGradient:.18,frameShadow:.5,frameShadowOffset:2.5,frameShadowBlur:4,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","pharmacy","hospital","doctors","dentist","veterinary"]},{id:"poi-education",type:"symbol","source-layer":"poi",minzoom:16,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,11],[18,12]]},iconSize:{stops:[[15,14.9],[18,17.6]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{textWeight:.35,color:"#2ac1d4",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#2ac1d4",frameHaloColor:"#ffffff",frameHaloWidth:1.2,frameGradient:.18,frameShadow:.5,frameShadowOffset:2.5,frameShadowBlur:4,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,11],[18,12]]},iconSize:{stops:[[15,14.9],[18,17.6]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{textWeight:.35,color:"#cc5e3c",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#cc5e3c",frameHaloColor:"#ffffff",frameHaloWidth:1.2,frameGradient:.18,frameShadow:.5,frameShadowOffset:2.5,frameShadowBlur:4,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,11],[18,12]]},iconSize:{stops:[[15,14.9],[18,17.6]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{textWeight:.35,color:"#2db375",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#2db375",frameHaloColor:"#ffffff",frameHaloWidth:1.2,frameGradient:.18,frameShadow:.5,frameShadowOffset:2.5,frameShadowBlur:4,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:16,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,11],[18,12]]},iconSize:{stops:[[15,14.9],[18,17.6]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{textWeight:.35,color:"#a66fe8",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#a66fe8",frameHaloColor:"#ffffff",frameHaloWidth:1.2,frameGradient:.18,frameShadow:.5,frameShadowOffset:2.5,frameShadowBlur:4,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","lodging"]},{id:"poi-service",type:"symbol","source-layer":"poi",minzoom:17,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,11],[18,12]]},iconSize:{stops:[[15,14.9],[18,17.6]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{textWeight:.35,color:"#6e87bf",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#6e87bf",frameHaloColor:"#ffffff",frameHaloWidth:1.2,frameGradient:.18,frameShadow:.5,frameShadowOffset:2.5,frameShadowBlur:4,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:17,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,11],[18,12]]},iconSize:{stops:[[15,14.9],[18,17.6]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{textWeight:.35,color:"#4caaf3",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#4caaf3",frameHaloColor:"#ffffff",frameHaloWidth:1.2,frameGradient:.18,frameShadow:.5,frameShadowOffset:2.5,frameShadowBlur:4,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:"road-shield",type:"symbol","source-layer":"transportation_name",filter:["all",["has","ref"],["in","class","motorway","trunk","primary"]],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:{textWeight:.35,color:"#3a4048",haloColor:"#f7f3e8",haloWidth:.5,iconColor:"#f7f3e8",iconHaloColor:"#8a8172",iconHaloWidth:1.4}},{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:{textWeight:.35,color:"#3d7ea6",haloColor:"#ffffff",haloWidth:1.4}},{id:"place-label",type:"symbol","source-layer":"place",minzoom:4,filter:["all",["in","class","city","country"],["!in","name","\u0414\u0443\u0448\u0430\u043D\u0431\u0435","\u0425\u0443\u04B7\u0430\u043D\u0434","\u0425\u0443\u0434\u0436\u0430\u043D\u0434","\u0411\u043E\u0445\u0442\u0430\u0440","\u0425\u043E\u0440\u0443\u0493","\u0425\u043E\u0440\u043E\u0433"]],layout:{textField:["{name:ru}","{name}"],textSize:{stops:[[4,11],[7,13],[10,14],[14,16],[17,17]]},maxLineChars:16,priority:90},paint:{textWeight:.35,color:"#57544e",haloColor:"#ffffff",haloWidth:1.8}},{id:"place-capital",type:"symbol","source-layer":"place",minzoom:4,filter:["all",["==","class","city"],["in","name","\u0414\u0443\u0448\u0430\u043D\u0431\u0435","\u0425\u0443\u04B7\u0430\u043D\u0434","\u0425\u0443\u0434\u0436\u0430\u043D\u0434","\u0411\u043E\u0445\u0442\u0430\u0440","\u0425\u043E\u0440\u0443\u0493","\u0425\u043E\u0440\u043E\u0433"]],layout:{textField:["{name:ru}","{name}"],textSize:{stops:[[4,12],[7,14],[10,15],[14,17],[17,18]]},maxLineChars:16,priority:110},paint:{textWeight:.35,color:"#57544e",haloColor:"#ffffff",haloWidth:1.8}},{id:"place-label-minor",type:"symbol","source-layer":"place",minzoom:7.5,filter:["in","class","town"],layout:{textField:["{name:ru}","{name}"],textSize:{stops:[[7.5,10.5],[12,12.5],[16,14]]},maxLineChars:16,priority:70},paint:{textWeight:.35,color:{from:"place-label"},haloColor:{from:"place-label"},haloWidth:1.6}},{id:"place-label-local",type:"symbol","source-layer":"place",minzoom:10.5,filter:["in","class","village","hamlet","suburb","quarter","neighbourhood","isolated_dwelling","island"],layout:{textField:["{name:ru}","{name}"],textSize:{stops:[[10.5,10.5],[16,12.5]]},maxLineChars:16,priority:55},paint:{textWeight:.35,color:{from:"place-label"},haloColor:{from:"place-label"},haloWidth:1.6}},{id:"place-region",type:"symbol",source:"regions","source-layer":"regions",minzoom:4.5,layout:{textField:["{name:ru}","{name}"],textSize:{stops:[[4.5,11.5],[7,14],[10,16],[14,17]]},letterSpacing:.15,maxLineChars:14,priority:100},paint:{textWeight:.35,color:{from:"place-label"},haloColor:{from:"place-label"},haloWidth:2}},{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:{textWeight:.35,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:{textWeight:.35,color:"#57544e",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:{textWeight:.35,color:"#2d6ecb",haloColor:"#ffffff",haloWidth:1.6}}],sources:{regions:{type:"geojson",sourceLayer:"regions",data:{type:"FeatureCollection",features:[{type:"Feature",geometry:{type:"Point",coordinates:[72.9987,38.3503]},properties:{class:"state",name:"\u0412\u0438\u043B\u043E\u044F\u0442\u0438 \u041C\u0443\u0445\u0442\u043E\u0440\u0438 \u041A\u04EF\u04B3\u0438\u0441\u0442\u043E\u043D\u0438 \u0411\u0430\u0434\u0430\u0445\u0448\u043E\u043D","name:ru":"\u0413\u043E\u0440\u043D\u043E-\u0411\u0430\u0434\u0430\u0445\u0448\u0430\u043D\u0441\u043A\u0430\u044F \u0430\u0432\u0442\u043E\u043D\u043E\u043C\u043D\u0430\u044F \u043E\u0431\u043B\u0430\u0441\u0442\u044C","name:en":"Gorno-Badakhshan Autonomous Province"}},{type:"Feature",geometry:{type:"Point",coordinates:[69.9582,40.5242]},properties:{class:"state",name:"\u0412\u0438\u043B\u043E\u044F\u0442\u0438 \u0421\u0443\u0493\u0434","name:ru":"\u0421\u043E\u0433\u0434\u0438\u0439\u0441\u043A\u0430\u044F \u043E\u0431\u043B\u0430\u0441\u0442\u044C","name:en":"Sughd Province"}},{type:"Feature",geometry:{type:"Point",coordinates:[69.2633,37.8814]},properties:{class:"state",name:"\u0412\u0438\u043B\u043E\u044F\u0442\u0438 \u0425\u0430\u0442\u043B\u043E\u043D","name:ru":"\u0425\u0430\u0442\u043B\u043E\u043D\u0441\u043A\u0430\u044F \u043E\u0431\u043B\u0430\u0441\u0442\u044C","name:en":"Khatlon Province"}},{type:"Feature",geometry:{type:"Point",coordinates:[70.0873,38.9722]},properties:{class:"state",name:"\u041D\u043E\u04B3\u0438\u044F\u04B3\u043E\u0438 \u0442\u043E\u0431\u0435\u0438 \u04B7\u0443\u043C\u04B3\u0443\u0440\u04E3","name:ru":"\u0420\u0430\u0439\u043E\u043D\u044B \u0440\u0435\u0441\u043F\u0443\u0431\u043B\u0438\u043A\u0430\u043D\u0441\u043A\u043E\u0433\u043E \u043F\u043E\u0434\u0447\u0438\u043D\u0435\u043D\u0438\u044F","name:en":"Districts of Republican Subordination"}}]}},world:{url:"/tileserver/data/world/{z}/{x}/{y}.pbf",minzoom:0,maxzoom:6},indoor:{url:"/tileserver/data/indoor/{z}/{x}/{y}.pbf",minzoom:15,maxzoom:18},points:{url:"/tileserver/data/points/{z}/{x}/{y}.pbf",minzoom:13,maxzoom:16},closures:{url:"/tileserver/data/closures/{z}/{x}/{y}.pbf",minzoom:10,maxzoom:16}}};var Of={version:1,name:"\u0420\u0435\u043B\u044C\u0435\u0444\u043D\u0430\u044F",background:"#dbd8d4",levelHeight:.5,light:{ambientColor:"#ffffff",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#ffffff",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#ffffff",fillIntensity:.18},layers:[{id:"world-landcover-wood",type:"fill",source:"world","source-layer":"landcover",maxzoom:7,filter:["in","class","wood","forest"],paint:{color:{from:"landcover-wood"}}},{id:"world-landcover-grass",type:"fill",source:"world","source-layer":"landcover",maxzoom:7,filter:["in","class","grass","farmland","meadow"],paint:{color:{from:"landcover-grass"}}},{id:"world-landcover-sand",type:"fill",source:"world","source-layer":"landcover",maxzoom:7,filter:["in","class","sand","beach"],paint:{color:{from:"landcover-sand"}}},{id:"world-landcover-ice",type:"fill",source:"world","source-layer":"landcover",maxzoom:7,filter:["in","class","ice","glacier"],paint:{color:{from:"landcover-ice"}}},{id:"world-water",type:"fill",source:"world","source-layer":"water",maxzoom:7,paint:{color:{from:"water"}}},{id:"world-boundary",type:"line",source:"world","source-layer":"boundary",maxzoom:7,paint:{color:{from:"boundary"},opacity:.7,width:{stops:[[0,.5],[6,1.1]]}}},{id:"landcover-wood",type:"fill",minzoom:7,"source-layer":"landcover",filter:["in","class","wood","forest"],paint:{color:"#c6dcb4",opacity:{stops:[[8,.5],[12,.85]]}}},{id:"landcover-grass",type:"fill",minzoom:7,"source-layer":"landcover",filter:["in","class","grass","farmland","meadow"],paint:{color:"#d9e6c6",opacity:{stops:[[8,.45],[12,.8]]}}},{id:"landcover-sand",type:"fill",minzoom:7,"source-layer":"landcover",filter:["in","class","sand","beach"],paint:{color:"#f2e7c8"}},{id:"landcover-ice",type:"fill",minzoom:7,"source-layer":"landcover",filter:["in","class","ice","glacier"],paint:{color:"#e6f2f7"}},{id:"landcover-wetland",type:"fill",minzoom:7,"source-layer":"landcover",filter:["in","class","wetland","swamp"],paint:{color:"#cfe0d4"}},{id:"landuse-residential",type:"fill","source-layer":"landuse",filter:["in","class","residential","suburb","neighbourhood","quarter"],paint:{color:"#d3d0cb",opacity:{stops:[[10,.4],[14,.7]]}}},{id:"landuse-industrial",type:"fill","source-layer":"landuse",filter:["in","class","industrial","quarry","railway","substation"],paint:{color:"#e7e0dd"}},{id:"landuse-civic",type:"fill","source-layer":"landuse",filter:["in","class","school","university","college","hospital","clinic","police","kindergarten","bus_station"],paint:{color:"#ece3d8"}},{id:"landuse-sport",type:"fill","source-layer":"landuse",filter:["in","class","pitch","stadium","playground","track","swimming_pool"],paint:{color:"#cfe3c4"}},{id:"landuse-cemetery",type:"fill","source-layer":"landuse",filter:["in","class","cemetery","grave_yard"],paint:{color:"#d6dfc8"}},{id:"landuse-parking",type:"fill","source-layer":"landuse",filter:["in","class","parking","fuel"],paint:{color:"#dddad5"}},{id:"park",type:"fill","source-layer":"park",paint:{color:"#cfe5bd",opacity:.75}},{id:"aeroway-area",type:"fill","source-layer":"aeroway",filter:["in","class","aerodrome","apron","helipad"],paint:{color:"#e4e2e6"}},{id:"water",type:"fill",minzoom:7,"source-layer":"water",filter:["!in","class","swimming_pool"],paint:{color:"#a5cbe3",material:"water",materialScale:14,materialSpeed:1}},{id:"water-pool",type:"fill","source-layer":"water",filter:["==","class","swimming_pool"],paint:{color:"#9fd3e8",material:"water",materialScale:8,materialSpeed:1}},{id:"waterway",type:"line","source-layer":"waterway",paint:{color:"#a5cbe3",width:{stops:[[8,.6],[12,1.4],[16,4],[19,11.5],[20,23],[21,46],[22,92]]},material:"water",materialScale:10,materialSpeed:1}},{id:"aeroway-line",type:"line","source-layer":"aeroway",filter:["in","class","runway","taxiway"],paint:{color:"#d8d5da",width:{stops:[[10,1],[14,5],[18,24],[19,24],[20,48],[21,96],[22,192]]}}},{id:"road-bridge-outline-thin",type:"line",network:"roads","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","path","pedestrian","footway","steps","rail","transit"]],minzoom:14,paint:{color:{from:"road-casing-major",darken:.2},width:{stops:[[14,2.5],[17,5],[19,9],[20,15],[21,28]]}}},{id:"road-casing-major",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","motorway","trunk","primary"],minzoom:5,paint:{elevation:.085,color:"#d4ab68",width:{stops:[[6,1.6],[10,3.4],[14,8],[16,14],[18,30],[19,45],[20,90],[21,180],[22,360]]},widthFromData:true,widthExtra:2.5}},{id:"road-casing-secondary",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","secondary","tertiary"],minzoom:9,paint:{elevation:.085,color:{stops:[[16,"#c6bca6"],[18.5,"#d4ab68"]]},width:{stops:[[10,1.6],[14,5.5],[16,10],[18,22],[19,33],[20,66],[21,132],[22,264]]},widthFromData:true,widthExtra:2}},{id:"road-casing-minor",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","minor","service","track"],minzoom:12,paint:{elevation:.085,color:{stops:[[16,"#cdc4b2"],[18.5,"#d4ab68"]]},width:{stops:[[13,1.4],[16,6],[18,14],[19,22],[20,44],[21,88],[22,176]]},widthFromData:true,widthExtra:1.5}},{id:"road-rail",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","rail","transit"],minzoom:10,paint:{color:"#b2a99e",width:{stops:[[10,.8],[14,1.8],[18,4],[19,5.5],[20,11],[21,22],[22,44]]}}},{id:"road-path",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","path","pedestrian","footway","steps"],minzoom:14,paint:{elevation:.17,color:"#bdb2a0",width:{stops:[[14,.8],[17,2],[19,4],[20,8],[21,16],[22,32]]},dashArray:[4,3]}},{id:"road-minor",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","minor","service","track"],minzoom:12,paint:{elevation:.09,color:{stops:[[16,"#ffffff"],[18.5,"#ffdfa3"]]},width:{stops:[[13,.6],[16,4],[18,11],[19,18],[20,36],[21,72],[22,144]]},widthFromData:true}},{id:"road-ramp",network:"roads",type:"line","source-layer":"transportation",filter:["all",["in","class","motorway","trunk","primary"],["has","ramp"]],minzoom:5,paint:{elevation:.09,color:"#ffdfa3",width:{stops:[[6,.8],[10,2.2],[14,6],[16,11],[18,25],[19,38.5],[20,77],[21,154],[22,308]]},widthFromData:true}},{id:"road-secondary",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","secondary","tertiary"],minzoom:9,paint:{elevation:.09,color:{stops:[[16,"#ffffff"],[18.5,"#ffdfa3"]]},width:{stops:[[10,.8],[14,3.6],[16,7.5],[18,18],[19,28],[20,56],[21,112],[22,224]]},widthFromData:true}},{id:"road-major",network:"roads",type:"line","source-layer":"transportation",filter:["all",["in","class","motorway","trunk","primary"],["!has","ramp"]],minzoom:5,paint:{elevation:.09,color:"#ffdfa3",width:{stops:[[6,.8],[10,2.2],[14,6],[16,11],[18,25],[19,38.5],[20,77],[21,154],[22,308]]},widthFromData:true}},{id:"road-lane-divider-major",network:"roads",type:"line","source-layer":"transportation",filter:["all",["!has","oneway"],["in","class","motorway","trunk","primary"]],minzoom:16.5,paint:{elevation:.095,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]}},{id:"road-lane-divider-secondary",network:"roads",type:"line","source-layer":"transportation",filter:["all",["!has","oneway"],["in","class","secondary","tertiary"]],minzoom:16.5,paint:{elevation:.095,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]}},{id:"boundary",type:"line",minzoom:7,"source-layer":"boundary",filter:["<=","admin_level",4],paint:{color:"#b3a6b8",opacity:.7,width:{stops:[[4,.7],[10,1.4],[16,2.4]]},dashArray:[6,4]}},{id:"building-flat",type:"fill","source-layer":"building",minzoom:15,maxzoom:16,paint:{color:{from:"building",property:"roofColor"},opacity:1}},{id:"building",type:"fill-extrusion","source-layer":"building",minzoom:16,paint:{color:"#ffffff",roofColor:"#f2f1f0",opacity:1,heightScale:{stops:[[16,0],[16.8,1]]},aoStrength:.18,tintVariation:0,windowColor:"#7f9ab5",windowFrameColor:"#e9e5dc",windowGlow:0,facadeDetail:1,floorHeight:3.2,roofVariation:.35}},{id:"indoor-venue",type:"fill-extrusion",source:"indoor","source-layer":"area",filter:["all",["==","class","level"],["==","base",1]],minzoom:15,maxzoom:16,paint:{color:"#d8d3c8",roofColor:"#d9d3c7",opacity:1,aoStrength:.18,tintVariation:.06,windowColor:"#7f9ab5",windowFrameColor:"#e9e5dc",windowGlow:0,facadeDetail:1,floorHeight:3.2,roofVariation:.35}},{id:"road-closed-casing",type:"line",source:"closures","source-layer":"closures",minzoom:11,paint:{color:"#ffffff",width:{stops:[[11,4],[14,6],[17,10],[19,16],[20,32],[21,64],[22,128]]},opacity:.9},overlay:"roads"},{id:"road-closed",type:"line",source:"closures","source-layer":"closures",minzoom:11,paint:{color:"#d92b2b",width:{stops:[[11,2.5],[14,4],[17,7],[19,11],[20,22],[21,44],[22,88]]},dashArray:[5,4]},overlay:"roads"},{id:"traffic-signal",type:"symbol",source:"points","source-layer":"roadpoints",minzoom:17,filter:["==","kind","traffic_signals"],layout:{iconImage:"traffic_signals",allowOverlap:true,iconParts:["traffic_light_pole","traffic_light_body","traffic_light_red","traffic_light_amber","traffic_light_green"],offset:[0,-12],iconSize:{stops:[[17,17],[19,26]]},priority:3},paint:{color:"#5c6470",haloColor:"#ffffff",haloWidth:1.4,partColors:["#6a717c","#1c2026","#ff4d57","#f8cf2c","#12d370"],partHaloWidths:[1,1.3,0,0,0]}},{id:"housenumber",type:"symbol","source-layer":"housenumber",minzoom:17,layout:{ignorePlacement:true,textField:"{housenumber}",textSize:{stops:[[17,9],[19,11]]},maxLineChars:6,priority:-60,placementGroup:"background-labels"},paint:{textWeight:.35,color:"#8c8478",haloColor:"#f5f3ee",haloWidth:1}},{id:"road-label-minor",type:"symbol","source-layer":"transportation_name",minzoom:15,filter:["!in","class","motorway","trunk","primary","secondary"],layout:{ignorePlacement:true,textField:["{name:ru}","{name}"],textPlacement:"line",symbolSpacing:900,textSize:{stops:[[15,10.5],[18,12]]},priority:15,abbreviate:true,placementGroup:"background-labels"},paint:{textWeight:.35,color:{from:"road-label"},haloColor:{from:"road-label"},haloWidth:1.6}},{id:"road-label",type:"symbol","source-layer":"transportation_name",minzoom:12.5,filter:["in","class","motorway","trunk","primary","secondary"],layout:{ignorePlacement:true,textField:["{name:ru}","{name}"],textPlacement:"line",symbolSpacing:900,textSize:{stops:[[14,10],[18,13]]},priority:20,abbreviate:true,placementGroup:"background-labels"},paint:{textWeight:.35,color:"#5c5646",haloColor:"#ffffff",haloWidth:1.6}},{id:"road-closed-end",type:"symbol",source:"closures","source-layer":"closure_ends",minzoom:13,layout:{iconImage:"road_closed",iconFrame:"circle",iconFrameScale:1.6,allowOverlap:true,iconSize:13,priority:6},paint:{color:"#d92b2b",frameColor:"#d92b2b",frameOpacity:1,frameHaloColor:"#ffffff",frameHaloWidth:1.4,frameGradient:.18,frameShadow:.5,frameShadowOffset:2.5,frameShadowBlur:4,iconColor:"#ffffff",iconHaloWidth:0}},{id:"crossing",type:"fill",source:"points","source-layer":"crossings",minzoom:16.5,overlay:"roads",paint:{color:"#ffffff",opacity:.9}},{id:"poi-food",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,11],[18,12]]},iconSize:{stops:[[15,14.9],[18,17.6]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{textWeight:.35,color:"#f4882c",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#f4882c",frameHaloColor:"#ffffff",frameHaloWidth:1.2,frameGradient:.18,frameShadow:.5,frameShadowOffset:2.5,frameShadowBlur:4,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:16,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,11],[18,12]]},iconSize:{stops:[[15,14.9],[18,17.6]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{textWeight:.35,color:"#a269e7",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#a269e7",frameHaloColor:"#ffffff",frameHaloWidth:1.2,frameGradient:.18,frameShadow:.5,frameShadowOffset:2.5,frameShadowBlur:4,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,11],[18,12]]},iconSize:{stops:[[15,14.9],[18,17.6]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{textWeight:.35,color:"#4677e8",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#4677e8",frameHaloColor:"#ffffff",frameHaloWidth:1.2,frameGradient:.18,frameShadow:.5,frameShadowOffset:2.5,frameShadowBlur:4,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,11],[18,12]]},iconSize:{stops:[[15,14.9],[18,17.6]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{textWeight:.35,color:"#f86776",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#f86776",frameHaloColor:"#ffffff",frameHaloWidth:1.2,frameGradient:.18,frameShadow:.5,frameShadowOffset:2.5,frameShadowBlur:4,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","pharmacy","hospital","doctors","dentist","veterinary"]},{id:"poi-education",type:"symbol","source-layer":"poi",minzoom:16,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,11],[18,12]]},iconSize:{stops:[[15,14.9],[18,17.6]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{textWeight:.35,color:"#2ac1d4",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#2ac1d4",frameHaloColor:"#ffffff",frameHaloWidth:1.2,frameGradient:.18,frameShadow:.5,frameShadowOffset:2.5,frameShadowBlur:4,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,11],[18,12]]},iconSize:{stops:[[15,14.9],[18,17.6]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{textWeight:.35,color:"#cc5e3c",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#cc5e3c",frameHaloColor:"#ffffff",frameHaloWidth:1.2,frameGradient:.18,frameShadow:.5,frameShadowOffset:2.5,frameShadowBlur:4,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,11],[18,12]]},iconSize:{stops:[[15,14.9],[18,17.6]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{textWeight:.35,color:"#2db375",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#2db375",frameHaloColor:"#ffffff",frameHaloWidth:1.2,frameGradient:.18,frameShadow:.5,frameShadowOffset:2.5,frameShadowBlur:4,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:16,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,11],[18,12]]},iconSize:{stops:[[15,14.9],[18,17.6]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{textWeight:.35,color:"#a66fe8",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#a66fe8",frameHaloColor:"#ffffff",frameHaloWidth:1.2,frameGradient:.18,frameShadow:.5,frameShadowOffset:2.5,frameShadowBlur:4,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","lodging"]},{id:"poi-service",type:"symbol","source-layer":"poi",minzoom:17,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,11],[18,12]]},iconSize:{stops:[[15,14.9],[18,17.6]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{textWeight:.35,color:"#6e87bf",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#6e87bf",frameHaloColor:"#ffffff",frameHaloWidth:1.2,frameGradient:.18,frameShadow:.5,frameShadowOffset:2.5,frameShadowBlur:4,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:17,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,11],[18,12]]},iconSize:{stops:[[15,14.9],[18,17.6]]},iconTextGap:3,maxLineChars:14,collisionPadding:12,iconFrame:"pin",iconFrameScale:1.45,iconPlacement:"auto"},paint:{textWeight:.35,color:"#4caaf3",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#4caaf3",frameHaloColor:"#ffffff",frameHaloWidth:1.2,frameGradient:.18,frameShadow:.5,frameShadowOffset:2.5,frameShadowBlur:4,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:"road-shield",type:"symbol","source-layer":"transportation_name",filter:["all",["has","ref"],["in","class","motorway","trunk","primary"]],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:{textWeight:.35,color:"#3a4048",haloColor:"#f7f3e8",haloWidth:.5,iconColor:"#f7f3e8",iconHaloColor:"#8a8172",iconHaloWidth:1.4}},{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:{textWeight:.35,color:"#3d7ea6",haloColor:"#ffffff",haloWidth:1.4}},{id:"place-label",type:"symbol","source-layer":"place",minzoom:4,filter:["all",["in","class","city","country"],["!in","name","\u0414\u0443\u0448\u0430\u043D\u0431\u0435","\u0425\u0443\u04B7\u0430\u043D\u0434","\u0425\u0443\u0434\u0436\u0430\u043D\u0434","\u0411\u043E\u0445\u0442\u0430\u0440","\u0425\u043E\u0440\u0443\u0493","\u0425\u043E\u0440\u043E\u0433"]],layout:{textField:["{name:ru}","{name}"],textSize:{stops:[[4,11],[7,13],[10,14],[14,16],[17,17]]},maxLineChars:16,priority:90},paint:{textWeight:.35,color:"#57544e",haloColor:"#ffffff",haloWidth:1.8}},{id:"place-capital",type:"symbol","source-layer":"place",minzoom:4,filter:["all",["==","class","city"],["in","name","\u0414\u0443\u0448\u0430\u043D\u0431\u0435","\u0425\u0443\u04B7\u0430\u043D\u0434","\u0425\u0443\u0434\u0436\u0430\u043D\u0434","\u0411\u043E\u0445\u0442\u0430\u0440","\u0425\u043E\u0440\u0443\u0493","\u0425\u043E\u0440\u043E\u0433"]],layout:{textField:["{name:ru}","{name}"],textSize:{stops:[[4,12],[7,14],[10,15],[14,17],[17,18]]},maxLineChars:16,priority:110},paint:{textWeight:.35,color:"#57544e",haloColor:"#ffffff",haloWidth:1.8}},{id:"place-label-minor",type:"symbol","source-layer":"place",minzoom:7.5,filter:["in","class","town"],layout:{textField:["{name:ru}","{name}"],textSize:{stops:[[7.5,10.5],[12,12.5],[16,14]]},maxLineChars:16,priority:70},paint:{textWeight:.35,color:{from:"place-label"},haloColor:{from:"place-label"},haloWidth:1.6}},{id:"place-label-local",type:"symbol","source-layer":"place",minzoom:10.5,filter:["in","class","village","hamlet","suburb","quarter","neighbourhood","isolated_dwelling","island"],layout:{textField:["{name:ru}","{name}"],textSize:{stops:[[10.5,10.5],[16,12.5]]},maxLineChars:16,priority:55},paint:{textWeight:.35,color:{from:"place-label"},haloColor:{from:"place-label"},haloWidth:1.6}},{id:"place-region",type:"symbol",source:"regions","source-layer":"regions",minzoom:4.5,layout:{textField:["{name:ru}","{name}"],textSize:{stops:[[4.5,11.5],[7,14],[10,16],[14,17]]},letterSpacing:.15,maxLineChars:14,priority:100},paint:{textWeight:.35,color:{from:"place-label"},haloColor:{from:"place-label"},haloWidth:2}},{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:{textWeight:.35,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:{textWeight:.35,color:"#57544e",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:{textWeight:.35,color:"#2d6ecb",haloColor:"#ffffff",haloWidth:1.6}}],sources:{regions:{type:"geojson",sourceLayer:"regions",data:{type:"FeatureCollection",features:[{type:"Feature",geometry:{type:"Point",coordinates:[72.9987,38.3503]},properties:{class:"state",name:"\u0412\u0438\u043B\u043E\u044F\u0442\u0438 \u041C\u0443\u0445\u0442\u043E\u0440\u0438 \u041A\u04EF\u04B3\u0438\u0441\u0442\u043E\u043D\u0438 \u0411\u0430\u0434\u0430\u0445\u0448\u043E\u043D","name:ru":"\u0413\u043E\u0440\u043D\u043E-\u0411\u0430\u0434\u0430\u0445\u0448\u0430\u043D\u0441\u043A\u0430\u044F \u0430\u0432\u0442\u043E\u043D\u043E\u043C\u043D\u0430\u044F \u043E\u0431\u043B\u0430\u0441\u0442\u044C","name:en":"Gorno-Badakhshan Autonomous Province"}},{type:"Feature",geometry:{type:"Point",coordinates:[69.9582,40.5242]},properties:{class:"state",name:"\u0412\u0438\u043B\u043E\u044F\u0442\u0438 \u0421\u0443\u0493\u0434","name:ru":"\u0421\u043E\u0433\u0434\u0438\u0439\u0441\u043A\u0430\u044F \u043E\u0431\u043B\u0430\u0441\u0442\u044C","name:en":"Sughd Province"}},{type:"Feature",geometry:{type:"Point",coordinates:[69.2633,37.8814]},properties:{class:"state",name:"\u0412\u0438\u043B\u043E\u044F\u0442\u0438 \u0425\u0430\u0442\u043B\u043E\u043D","name:ru":"\u0425\u0430\u0442\u043B\u043E\u043D\u0441\u043A\u0430\u044F \u043E\u0431\u043B\u0430\u0441\u0442\u044C","name:en":"Khatlon Province"}},{type:"Feature",geometry:{type:"Point",coordinates:[70.0873,38.9722]},properties:{class:"state",name:"\u041D\u043E\u04B3\u0438\u044F\u04B3\u043E\u0438 \u0442\u043E\u0431\u0435\u0438 \u04B7\u0443\u043C\u04B3\u0443\u0440\u04E3","name:ru":"\u0420\u0430\u0439\u043E\u043D\u044B \u0440\u0435\u0441\u043F\u0443\u0431\u043B\u0438\u043A\u0430\u043D\u0441\u043A\u043E\u0433\u043E \u043F\u043E\u0434\u0447\u0438\u043D\u0435\u043D\u0438\u044F","name:en":"Districts of Republican Subordination"}}]}},world:{url:"/tileserver/data/world/{z}/{x}/{y}.pbf",minzoom:0,maxzoom:6},indoor:{url:"/tileserver/data/indoor/{z}/{x}/{y}.pbf",minzoom:15,maxzoom:18},points:{url:"/tileserver/data/points/{z}/{x}/{y}.pbf",minzoom:13,maxzoom:16},closures:{url:"/tileserver/data/closures/{z}/{x}/{y}.pbf",minzoom:10,maxzoom:16},terrain:{url:"/tileserver/data/terrain/{z}/{x}/{y}.webp",type:"raster-dem",encoding:"mapbox",minzoom:0,maxzoom:10}},terrain:{source:"terrain",exaggeration:1,tint:{low:"#bcd6ea",mid:"#cde0ab",high:"#ffd24a",range:[600,4600],tint:.7,shade:.85}}};var Gf={name:"\u041D\u043E\u0447\u043D\u0430\u044F",background:"#11151c",model3dKey:"night",light:{ambientColor:"#8fa3c4",ambientIntensity:.34,keyAzimuth:120,keyAltitude:55,keyColor:"#cfd8ea",keyIntensity:.3,fillAzimuth:300,fillAltitude:20,fillColor:"#4a5f86",fillIntensity:.22},paint:{"landcover-wood":{color:"#16261a"},"landcover-grass":{color:"#182619"},"landcover-sand":{color:"#2a2417"},"landcover-ice":{color:"#1b2730"},"landcover-wetland":{color:"#16242a"},"landuse-residential":{color:"#171b23"},"landuse-industrial":{color:"#1b1c20"},"landuse-civic":{color:"#1c1f28"},"landuse-sport":{color:"#16261c"},"landuse-cemetery":{color:"#182018"},"landuse-parking":{color:"#191d24"},park:{color:"#15271a"},"aeroway-area":{color:"#1b1e26"},water:{color:"#0f2438"},"water-pool":{color:"#123048"},waterway:{color:"#14304a"},"aeroway-line":{color:"#242833"},"road-casing-major":{color:"#2a2519"},"road-casing-secondary":{color:{stops:[[16,"#22262f"],[18.5,"#2a2519"]]}},"road-casing-minor":{color:{stops:[[16,"#1e222a"],[18.5,"#2a2519"]]}},"road-rail":{color:"#333842"},"road-path":{color:"#2a2e36"},"road-minor":{color:{stops:[[16,"#2f343d"],[18.5,"#6b5c3c"]]}},"road-secondary":{color:{stops:[[16,"#3c424d"],[18.5,"#6b5c3c"]]}},"road-ramp":{color:"#6b5c3c"},"road-major":{color:"#6b5c3c"},boundary:{color:"#4a3f52"},building:{color:"#232833",roofColor:"#2b313d",aoStrength:.3,tintVariation:.1,windowColor:"#8fb8e8",windowFrameColor:"#39424f",windowGlow:.35},housenumber:{color:"#5f6672",haloColor:"#12161d"},poi:{color:"#66a7d9",haloColor:"#12161d",haloWidth:1.3,frameColor:"#66a7d9",frameOpacity:1,frameHaloColor:"#12161d",iconColor:"#1b1b1b",iconHaloWidth:0},"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:"#a374dc",haloColor:"#12161d",haloWidth:1.3,frameColor:"#a374dc",frameOpacity:1,frameHaloColor:"#12161d",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-transport":{color:"#6487d8",haloColor:"#12161d",haloWidth:1.3,frameColor:"#6487d8",frameOpacity:1,frameHaloColor:"#12161d",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-health":{color:"#df808a",haloColor:"#12161d",haloWidth:1.3,frameColor:"#df808a",frameOpacity:1,frameHaloColor:"#12161d",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-education":{color:"#64cbd8",haloColor:"#12161d",haloWidth:1.3,frameColor:"#64cbd8",frameOpacity:1,frameHaloColor:"#12161d",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-culture":{color:"#d1836b",haloColor:"#12161d",haloWidth:1.3,frameColor:"#d1836b",frameOpacity:1,frameHaloColor:"#12161d",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-sport":{color:"#6ad2a2",haloColor:"#12161d",haloWidth:1.3,frameColor:"#6ad2a2",frameOpacity:1,frameHaloColor:"#12161d",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-lodging":{color:"#a779de",haloColor:"#12161d",haloWidth:1.3,frameColor:"#a779de",frameOpacity:1,frameHaloColor:"#12161d",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-service":{color:"#7c91c0",haloColor:"#12161d",haloWidth:1.3,frameColor:"#7c91c0",frameOpacity:1,frameHaloColor:"#12161d",iconColor:"#1b1b1b",iconHaloWidth:0},"building-entrance":{color:"#79a0d7",haloColor:"#12161d"},"indoor-shell":{color:"#3a4254",opacity:.97},"indoor-corridor":{color:"#363d4e"},"indoor-room":{color:"#414a5f"},"indoor-service":{color:"#535f79"},"indoor-shop":{color:"#5c4672"},"indoor-food":{color:"#725d46"},"indoor-wc":{color:"#466172"},"indoor-wall":{color:"#697183",roofColor:"#868c99",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#65548a",opacity:.95},"indoor-door":{color:"#c3ccd9",haloColor:"#12161d",haloWidth:1.3},"indoor-poi":{color:"#c3ccd9",haloColor:"#12161d",haloWidth:1.3},"indoor-name":{color:"#e2e7ee",haloColor:"#10141b",haloWidth:2}},sky:{skyColor:"#080d18",horizonColor:"#1b2436",fogRange:[2.34,8.77],fogIntensity:.9,spaceColor:"#02030a",atmosphereColor:"#3f6fa8",starIntensity:.8}};var zf={name:"\u0413\u0440\u0430\u0444\u0438\u0442",background:"#eeeeee",light:{ambientColor:"#ffffff",ambientIntensity:.55,keyAzimuth:120,keyAltitude:60,keyColor:"#ffffff",keyIntensity:.5,fillAzimuth:300,fillAltitude:25,fillColor:"#ffffff",fillIntensity:.16},paint:{"landcover-wood":{color:"#e2e2e2"},"landcover-grass":{color:"#e7e7e7"},"landcover-sand":{color:"#eaeaea"},"landcover-ice":{color:"#f0f0f0"},"landcover-wetland":{color:"#e4e4e4"},"landuse-residential":{color:"#e9e9e9"},"landuse-industrial":{color:"#e5e5e5"},"landuse-civic":{color:"#ebebeb"},"landuse-sport":{color:"#e4e4e4"},"landuse-cemetery":{color:"#e6e6e6"},"landuse-parking":{color:"#ececec"},park:{color:"#e3e3e3"},"aeroway-area":{color:"#e8e8e8"},water:{color:"#d4d4d4"},"water-pool":{color:"#d8d8d8"},waterway:{color:"#d4d4d4"},"aeroway-line":{color:"#dedede"},"road-casing-major":{color:"#c9c9c9"},"road-casing-secondary":{color:{stops:[[16,"#d2d2d2"],[18.5,"#c9c9c9"]]}},"road-casing-minor":{color:{stops:[[16,"#d8d8d8"],[18.5,"#c9c9c9"]]}},"road-rail":{color:"#c2c2c2"},"road-path":{color:"#d0d0d0"},"road-minor":{color:{stops:[[16,"#f7f7f7"],[18.5,"#ffffff"]]}},"road-secondary":{color:{stops:[[16,"#fbfbfb"],[18.5,"#ffffff"]]}},"road-ramp":{color:"#ffffff"},"road-major":{color:"#ffffff"},boundary:{color:"#b0b0b0"},building:{color:"#dcdcdc",roofColor:"#e0e0e0",aoStrength:.22,tintVariation:.05,windowColor:"#b7bcc2",windowFrameColor:"#f2f2f2",windowGlow:0},housenumber:{color:"#9a9a9a",haloColor:"#f4f4f4"},poi:{color:"#3c3c3c",haloColor:"#ffffff"},"road-label":{color:"#585858",haloColor:"#ffffff"},"water-label":{color:"#6e6e6e",haloColor:"#ffffff"},"place-label":{color:"#545454",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:"#545454",haloColor:"#ffffff"}},sky:{skyColor:"#8f96a0",horizonColor:"#d7dade",fogRange:[2.43,10.12],fogIntensity:.9,spaceColor:"#07080b",atmosphereColor:"#9aa3ad",starIntensity:.5}};var Wf={name:"\u041B\u0435\u0434\u044F\u043D\u0430\u044F",background:"#f5f3f0",light:{ambientColor:"#eaf6fb",ambientIntensity:.72,keyAzimuth:120,keyAltitude:45,keyColor:"#ffffff",keyIntensity:.36,fillAzimuth:300,fillAltitude:25,fillColor:"#cfe6f2",fillIntensity:.22},paint:{"landcover-wood":{color:"#b4ebb8"},"landcover-grass":{color:"#c2f0c3"},"landcover-sand":{color:"#f7efd6"},"landcover-ice":{color:"#eaf6fb"},"landcover-wetland":{color:"#d8eef0"},"landuse-residential":{color:"#ecf1fb"},"landuse-industrial":{color:"#eceef1"},"landuse-civic":{color:"#f6ecf9"},"landuse-sport":{color:"#c2f0c3"},"landuse-cemetery":{color:"#cdeccf"},"landuse-parking":{color:"#e6e7e9"},park:{color:"#c2f0c3"},"aeroway-area":{color:"#e6e9f2"},water:{color:"#90ddf6"},waterway:{color:"#90ddf6"},"aeroway-line":{color:"#f3f1ee"},"road-casing-major":{color:"#f0c24f"},"road-casing-secondary":{color:"#e8d7a4"},"road-casing-minor":{color:"#dbdbdd"},"road-rail":{color:"#c9c9cd"},"road-path":{color:"#ffffff",dashArray:null},"road-minor":{color:"#ffffff"},"road-secondary":{color:"#ffecba"},"road-ramp":{color:"#ffe49a"},"road-major":{color:"#ffd86b"},boundary:{color:"#c9a7d8"},building:{color:"#d5e4ef",roofColor:"#e9f0f6",aoStrength:0,tintVariation:0,seamStrength:0,windowColor:"#8fbcd8",windowFrameColor:"#d5e4ef",windowVariation:.6,windowGlow:0,ice:1},housenumber:{color:"#6f7a88",haloColor:"#ffffff",haloWidth:1.4},poi:{color:"#4caaf3",haloColor:"#ffffff",haloWidth:1.4},"road-label":{color:"#626e7e",haloColor:"#ffffff",haloWidth:1.4},"water-label":{color:"#35688d",haloColor:"#f7f7f7",haloWidth:1.4},"place-label":{color:"#4a5566",haloColor:"#ffffff",haloWidth:1.4},"poi-food":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#f4882c",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#a269e7",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#4677e8",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#f86776",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#2ac1d4",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#cc5e3c",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#2db375",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#a66fe8",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#6e87bf",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"water-pool":{color:"#90ddf6"},"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:"#4a5566",haloColor:"#ffffff",haloWidth:1.4},"building-entrance":{color:"#225aaa",haloColor:"#ffffff"},"road-bridge-outline-thin":{opacity:0},"road-lane-divider-major":{opacity:0},"road-lane-divider-secondary":{opacity:0},"road-path-casing":{color:"#dbdbdd"},crossing:{sideColor:"#c9c9cd",sideShade:.45}},sky:{skyColor:"#a9d8ee",horizonColor:"#eef4f7",fogRange:[2.6,12],fogIntensity:.82,spaceColor:"#0a1018",atmosphereColor:"#9fd0ff",starIntensity:.4}};var Nf={name:"\u0411\u043B\u0435\u0434\u043D\u0430\u044F",background:"#f7f6f3",light:{ambientColor:"#ffffff",ambientIntensity:.62,keyAzimuth:120,keyAltitude:65,keyColor:"#fffaf0",keyIntensity:.38,fillAzimuth:300,fillAltitude:25,fillColor:"#eef2f8",fillIntensity:.14},paint:{"landcover-wood":{color:"#e8efe2"},"landcover-grass":{color:"#edf2e6"},"landcover-sand":{color:"#f4eede"},"landcover-ice":{color:"#f0f5f7"},"landcover-wetland":{color:"#e8f0ec"},"landuse-residential":{color:"#f2f0ec"},"landuse-industrial":{color:"#f0edeb"},"landuse-civic":{color:"#f4efe9"},"landuse-sport":{color:"#e9f1e4"},"landuse-cemetery":{color:"#ecefe6"},"landuse-parking":{color:"#f3f1ed"},park:{color:"#e7f0df"},"aeroway-area":{color:"#f0f0f2"},water:{color:"#dce9f2"},"water-pool":{color:"#dcecf5"},waterway:{color:"#dce9f2"},"aeroway-line":{color:"#ebebee"},"road-casing-major":{color:"#efe4d2"},"road-casing-secondary":{color:{stops:[[16,"#eceae2"],[18.5,"#efe4d2"]]}},"road-casing-minor":{color:{stops:[[16,"#efedE6"],[18.5,"#efe4d2"]]}},"road-rail":{color:"#e0dcd6"},"road-path":{color:"#e6e2da"},"road-minor":{color:{stops:[[16,"#fdfcfa"],[18.5,"#fff8e8"]]}},"road-secondary":{color:{stops:[[16,"#ffffff"],[18.5,"#fff8e8"]]}},"road-ramp":{color:"#fff8e8"},"road-major":{color:"#fff8e8"},boundary:{color:"#cfc3d2"},building:{color:"#eae7e0",roofColor:"#ecE9e2",aoStrength:.14,tintVariation:.04,windowColor:"#c7d6e4",windowFrameColor:"#f6f7f9",windowGlow:0},housenumber:{color:"#a9a296",haloColor:"#fbfaf7"},poi:{color:"#6b6b6b",haloColor:"#ffffff"},"road-label":{color:"#8a8474",haloColor:"#ffffff"},"water-label":{color:"#7ea8c4",haloColor:"#ffffff"},"place-label":{color:"#55524c",haloColor:"#ffffff"},"poi-food":{color:"#6b6b6b",haloColor:"#ffffff",frameColor:"#6b6b6b",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{color:"#6b6b6b",haloColor:"#ffffff",frameColor:"#6b6b6b",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{color:"#6b6b6b",haloColor:"#ffffff",frameColor:"#6b6b6b",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{color:"#6b6b6b",haloColor:"#ffffff",frameColor:"#6b6b6b",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{color:"#6b6b6b",haloColor:"#ffffff",frameColor:"#6b6b6b",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{color:"#6b6b6b",haloColor:"#ffffff",frameColor:"#6b6b6b",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{color:"#6b6b6b",haloColor:"#ffffff",frameColor:"#6b6b6b",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{color:"#6b6b6b",haloColor:"#ffffff",frameColor:"#6b6b6b",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{color:"#6b6b6b",haloColor:"#ffffff",frameColor:"#6b6b6b",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"building-entrance":{color:"#564e4e",haloColor:"#ffffff"},"indoor-shell":{color:"#f4f3f0",opacity:.97},"indoor-corridor":{color:"#f8f7f6"},"indoor-room":{color:"#edece8"},"indoor-service":{color:"#dcd9d1"},"indoor-shop":{color:"#e0dae6"},"indoor-food":{color:"#e6e0da"},"indoor-wc":{color:"#dae1e6"},"indoor-wall":{color:"#cdcbc4",roofColor:"#e0dedb",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#ccc5d9",opacity:.95},"indoor-door":{color:"#6b6b6b",haloColor:"#ffffff"},"indoor-poi":{color:"#6b6b6b",haloColor:"#ffffff"},"indoor-name":{color:"#55524c",haloColor:"#ffffff"}},sky:{skyColor:"#c8dbee",horizonColor:"#eef2f6",fogRange:[2.52,12.15],fogIntensity:.85,spaceColor:"#0a1018",atmosphereColor:"#9fd0ff",starIntensity:.45}};var Vf={name:"\u0410\u0442\u043B\u0430\u0441, \u0434\u0435\u043D\u044C",background:"#F6F7F7",light:{ambientColor:"#ffffff",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#ffffff",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#ffffff",fillIntensity:.18},paint:{"landcover-wood":{color:"#A8CF91"},"landcover-grass":{color:"#C7EBA4"},"landcover-sand":{color:"#F0DFB9"},"landcover-ice":{color:"#E7F0EE"},"landcover-wetland":{color:"#B2DEB0"},"landuse-residential":{color:"#EFF1EC"},"landuse-industrial":{color:"#EDF1F1"},"landuse-civic":{color:"#E9E9F1"},"landuse-sport":{color:"#D2F1D8"},"landuse-cemetery":{color:"#EFF1EC"},"landuse-parking":{color:"#F1EEE1"},park:{color:"#BCE39F"},"aeroway-area":{color:"#CFD5D6"},water:{color:"#7FD3F5"},waterway:{color:"#7FD3F5"},"aeroway-line":{color:"#CFD5D6"},"road-casing-major":{color:"#A9B4C4"},"road-casing-secondary":{color:"#A9B4C4"},"road-casing-minor":{color:"#A9B4C4"},"road-rail":{color:"#86948F"},"road-path":{color:"#EDEBD6"},"road-minor":{color:"#BBC4C9"},"road-secondary":{color:"#C0C8D4"},"road-ramp":{color:"#C0C8D4"},"road-major":{color:"#C0C8D4"},boundary:{color:"#A99CAE"},building:{color:"#E3DBD5"},housenumber:{color:"#2e2e2e",haloColor:"#ffffff",haloWidth:1.4},poi:{color:"#4caaf3",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:"#f4882c",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#a269e7",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#4677e8",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#f86776",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#2ac1d4",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#cc5e3c",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#2db375",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#a66fe8",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#6e87bf",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"water-pool":{color:"#a7e1fd"},"indoor-shell":{color:"#f4f3f1",opacity:.97},"indoor-corridor":{color:"#f8f8f6"},"indoor-room":{color:"#eeece8"},"indoor-service":{color:"#ddd8d2"},"indoor-shop":{color:"#e0dae7"},"indoor-food":{color:"#e7e1da"},"indoor-wc":{color:"#dae2e7"},"indoor-wall":{color:"#cecac5",roofColor:"#e0dedc",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#ccc6d9",opacity:.95},"indoor-door":{color:"#586e84",haloColor:"#ffffff",haloWidth:1.4},"indoor-poi":{color:"#586e84",haloColor:"#ffffff",haloWidth:1.4},"indoor-name":{color:"#2e2e2e",haloColor:"#ffffff",haloWidth:1.4},"building-entrance":{color:"#225aaa",haloColor:"#ffffff"}},sky:{skyColor:"#91b8cb",horizonColor:"#dfd9d6",fogRange:[2.41,9.94],fogIntensity:.86,spaceColor:"#0e0b0a",atmosphereColor:"#5daad0",starIntensity:.38}};var Uf={name:"\u0410\u0442\u043B\u0430\u0441, \u043D\u043E\u0447\u044C",background:"#212937",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:"#315247"},"landcover-grass":{color:"#315248"},"landcover-sand":{color:"#2C4932"},"landcover-ice":{color:"#315152"},"landcover-wetland":{color:"#2F4E48"},"landuse-residential":{color:"#2F3844"},"landuse-industrial":{color:"#2F3744"},"landuse-civic":{color:"#2F3544"},"landuse-sport":{color:"#2F3B44"},"landuse-cemetery":{color:"#2F3844"},"landuse-parking":{color:"#2F3E44"},park:{color:"#315247"},"aeroway-area":{color:"#2D3941"},water:{color:"#0C2166"},"water-pool":{color:"#123048"},waterway:{color:"#0C2166"},"aeroway-line":{color:"#2D3941"},"road-casing-major":{color:"#333A52"},"road-casing-secondary":{color:"#333A52"},"road-casing-minor":{color:"#333A52"},"road-rail":{color:"#6C7B82"},"road-path":{color:"#626F5D"},"road-minor":{color:"#4B5D66"},"road-secondary":{color:"#535E85"},"road-ramp":{color:"#535E85"},"road-major":{color:"#535E85"},boundary:{color:"#6B5F78"},building:{color:"#333B4E"},housenumber:{color:"#5f6672",haloColor:"#12161d"},poi:{color:"#66a7d9",haloColor:"#12161d",haloWidth:1.3,frameColor:"#66a7d9",frameOpacity:1,frameHaloColor:"#12161d",iconColor:"#1b1b1b",iconHaloWidth:0},"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:"#a374dc",haloColor:"#12161d",haloWidth:1.3,frameColor:"#a374dc",frameOpacity:1,frameHaloColor:"#12161d",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-transport":{color:"#6487d8",haloColor:"#12161d",haloWidth:1.3,frameColor:"#6487d8",frameOpacity:1,frameHaloColor:"#12161d",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-health":{color:"#df808a",haloColor:"#12161d",haloWidth:1.3,frameColor:"#df808a",frameOpacity:1,frameHaloColor:"#12161d",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-education":{color:"#64cbd8",haloColor:"#12161d",haloWidth:1.3,frameColor:"#64cbd8",frameOpacity:1,frameHaloColor:"#12161d",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-culture":{color:"#d1836b",haloColor:"#12161d",haloWidth:1.3,frameColor:"#d1836b",frameOpacity:1,frameHaloColor:"#12161d",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-sport":{color:"#6ad2a2",haloColor:"#12161d",haloWidth:1.3,frameColor:"#6ad2a2",frameOpacity:1,frameHaloColor:"#12161d",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-lodging":{color:"#a779de",haloColor:"#12161d",haloWidth:1.3,frameColor:"#a779de",frameOpacity:1,frameHaloColor:"#12161d",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-service":{color:"#7c91c0",haloColor:"#12161d",haloWidth:1.3,frameColor:"#7c91c0",frameOpacity:1,frameHaloColor:"#12161d",iconColor:"#1b1b1b",iconHaloWidth:0},"building-entrance":{color:"#79a0d7",haloColor:"#12161d"},"indoor-shell":{color:"#3a4254",opacity:.97},"indoor-corridor":{color:"#363d4e"},"indoor-room":{color:"#414a5f"},"indoor-service":{color:"#535f79"},"indoor-shop":{color:"#5c4672"},"indoor-food":{color:"#725d46"},"indoor-wc":{color:"#466172"},"indoor-wall":{color:"#697183",roofColor:"#868c99",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#65548a",opacity:.95},"indoor-door":{color:"#c3ccd9",haloColor:"#12161d",haloWidth:1.3},"indoor-poi":{color:"#c3ccd9",haloColor:"#12161d",haloWidth:1.3},"indoor-name":{color:"#e2e7ee",haloColor:"#10141b",haloWidth:2}},sky:{skyColor:"#080d18",horizonColor:"#1b2436",fogRange:[2.34,8.77],fogIntensity:.9,spaceColor:"#02030a",atmosphereColor:"#3f6fa8",starIntensity:.8}};var Kf={"atlas-day":Vf,"atlas-night":Uf};var Xf={name:"\u041E\u0431\u044A\u0451\u043C\u043D\u0430\u044F",background:"#dfdbda",light:{ambientColor:"#ffffff",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#ffffff",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#ffffff",fillIntensity:.18},paint:{"landcover-wood":{color:"#9bda95"},"landcover-grass":{color:"#b2e6a8"},"landcover-sand":{color:"#efeac8"},"landcover-ice":{color:"#d5e8f1"},"landcover-wetland":{color:"#badbde"},"landuse-residential":{color:"#e4e1e0"},"landuse-industrial":{color:"#dadce7"},"landuse-civic":{color:"#ecdae0"},"landuse-sport":{color:"#bbeba2"},"landuse-cemetery":{color:"#c2e2bb"},"landuse-parking":{color:"#d6d4d4"},park:{color:"#b2e6a8"},"aeroway-area":{color:"#d6dbeb"},water:{color:"#94d8f9"},waterway:{color:"#94d8f9"},"aeroway-line":{color:"#dfdcd9"},"road-casing-major":{color:"#8997b3"},"road-casing-secondary":{color:{stops:[[16,"#9da7be"],[18.5,"#8997b3"]]}},"road-casing-minor":{color:{stops:[[16,"#9da7be"],[18.5,"#8997b3"]]}},"road-rail":{color:"#9e9e9e"},"road-path":{color:"#bbc1d3"},"road-minor":{color:{stops:[[16,"#bbc1d3"],[18.5,"#99abc2"]]}},"road-secondary":{color:{stops:[[16,"#bbc1d3"],[18.5,"#99abc2"]]}},"road-ramp":{color:"#99abc2"},"road-major":{color:"#99abc2"},boundary:{color:"#f66f91"},building:{color:"#ffffff",roofColor:"#f2f1f0",aoStrength:.19,tintVariation:0,windowColor:"#6b9ed1",windowFrameColor:"#eef0f4",windowGlow:0},housenumber:{color:"#2e2e2e",haloColor:"#ffffff",haloWidth:1.4},poi:{color:"#4caaf3",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:"#f4882c",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#a269e7",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#4677e8",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#f86776",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#2ac1d4",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#cc5e3c",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#2db375",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#a66fe8",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#6e87bf",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"water-pool":{color:"#a7e1fd"},"indoor-shell":{color:"#f4f3f1",opacity:.97},"indoor-corridor":{color:"#f8f8f6"},"indoor-room":{color:"#eeece8"},"indoor-service":{color:"#ddd8d2"},"indoor-shop":{color:"#e0dae7"},"indoor-food":{color:"#e7e1da"},"indoor-wc":{color:"#dae2e7"},"indoor-wall":{color:"#cecac5",roofColor:"#e0dedc",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#ccc6d9",opacity:.95},"indoor-door":{color:"#586e84",haloColor:"#ffffff",haloWidth:1.4},"indoor-poi":{color:"#586e84",haloColor:"#ffffff",haloWidth:1.4},"indoor-name":{color:"#2e2e2e",haloColor:"#ffffff",haloWidth:1.4},"building-entrance":{color:"#225aaa",haloColor:"#ffffff"}},sky:{skyColor:"#91b8cb",horizonColor:"#dfd9d6",fogRange:[2.41,9.94],fogIntensity:.86,spaceColor:"#0e0b0a",atmosphereColor:"#5daad0",starIntensity:.38}};var Jf={name:"\u041C\u0443\u043B\u044C\u0442\u044F\u0448\u043D\u0430\u044F",background:"#f7f3de",light:{ambientColor:"#f8f7f7",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#ffffff",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#dee8ed",fillIntensity:.18},paint:{"landcover-wood":{color:"#61d161"},"landcover-grass":{color:"#91e481"},"landcover-sand":{color:"#efeac8"},"landcover-ice":{color:"#c7dfeb"},"landcover-wetland":{color:"#9fccd1"},"landuse-residential":{color:"#f2ecd9"},"landuse-industrial":{color:"#d7d9e4"},"landuse-civic":{color:"#ead7dd"},"landuse-sport":{color:"#9fec79"},"landuse-cemetery":{color:"#a8d69f"},"landuse-parking":{color:"#dddcda"},park:{color:"#91e481"},"aeroway-area":{color:"#d6dbeb"},water:{color:"#71c8f4"},waterway:{color:"#71c8f4"},"aeroway-line":{color:"#f0ede9"},"road-casing-major":{color:"#ca6a16"},"road-casing-secondary":{color:{stops:[[16,"#5a6faf"],[18.5,"#ca6a16"]]}},"road-casing-minor":{color:{stops:[[16,"#5a6faf"],[18.5,"#ca6a16"]]}},"road-rail":{color:"#737373"},"road-path":{color:"#ffffff"},"road-minor":{color:{stops:[[16,"#ffffff"],[18.5,"#f8c662"]]}},"road-secondary":{color:{stops:[[16,"#ffffff"],[18.5,"#f8c662"]]}},"road-ramp":{color:"#f8c662"},"road-major":{color:"#f8c662"},boundary:{color:"#f6517a"},building:{color:"#f4dfc2",roofColor:"#f4dfc2",aoStrength:.19,tintVariation:.06,windowColor:"#5b9ee0",windowFrameColor:"#ffffff",windowGlow:0},housenumber:{color:"#222b59",haloColor:"#ffffff",haloWidth:1.4},poi:{color:"#f05a0f",haloColor:"#ffffff",haloWidth:1.4},"road-label":{color:"#222b59",haloColor:"#ffffff",haloWidth:1.4},"water-label":{color:"#35688d",haloColor:"#f7f7f7",haloWidth:1.4},"place-label":{color:"#222b59",haloColor:"#ffffff",haloWidth:1.4},"poi-food":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#c2681c",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#2f77c4",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#3b82a6",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#c24444",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#3f7f7a",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#8b5aa5",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#4f8b45",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#7a5fbf",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#59636e",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"water-pool":{color:"#80d1fa"},"indoor-shell":{color:"#ebe9e5",opacity:.97},"indoor-corridor":{color:"#efedea"},"indoor-room":{color:"#e5e1dc"},"indoor-service":{color:"#d4cec6"},"indoor-shop":{color:"#d6cede"},"indoor-food":{color:"#ded6ce"},"indoor-wc":{color:"#ced8de"},"indoor-wall":{color:"#c4c0ba",roofColor:"#d6d4d0",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#c1b9d1",opacity:.95},"indoor-door":{color:"#f05a0f",haloColor:"#ffffff",haloWidth:1.4},"indoor-poi":{color:"#f05a0f",haloColor:"#ffffff",haloWidth:1.4},"indoor-name":{color:"#222b59",haloColor:"#ffffff",haloWidth:1.4},"building-entrance":{color:"#225aaa",haloColor:"#ffffff"}},sky:{skyColor:"#8cb5c9",horizonColor:"#e8e2c7",fogRange:[2.41,9.92],fogIntensity:.86,spaceColor:"#131105",atmosphereColor:"#5ca9d0",starIntensity:.39}};var jf={name:"\u041A\u0438\u0431\u0435\u0440\u043F\u0430\u043D\u043A",background:"#120817",model3dKey:"night",light:{ambientColor:"#b279cf",ambientIntensity:.34,keyAzimuth:120,keyAltitude:55,keyColor:"#ff70d0",keyIntensity:.28,fillAzimuth:300,fillAltitude:25,fillColor:"#854770",fillIntensity:.22},paint:{"landcover-wood":{color:"#0c3728"},"landcover-grass":{color:"#104131"},"landcover-sand":{color:"#262417"},"landcover-ice":{color:"#74345f"},"landcover-wetland":{color:"#152223"},"landuse-residential":{color:"#170b1e"},"landuse-industrial":{color:"#171921"},"landuse-civic":{color:"#21171a"},"landuse-sport":{color:"#0c4529"},"landuse-cemetery":{color:"#151e1b"},"landuse-parking":{color:"#272428"},park:{color:"#104131"},"aeroway-area":{color:"#1a1c23"},water:{color:"#5f1145"},waterway:{color:"#711452"},"aeroway-line":{color:"#55493a"},"road-casing-major":{color:"#981662"},"road-casing-secondary":{color:{stops:[[16,"#6a1b6a"],[18.5,"#981662"]]}},"road-casing-minor":{color:{stops:[[16,"#6a1b6a"],[18.5,"#981662"]]}},"road-rail":{color:"#39acac"},"road-path":{color:"#12e2e2"},"road-minor":{color:{stops:[[16,"#12e2e2"],[18.5,"#f631a4"]]}},"road-secondary":{color:{stops:[[16,"#12e2e2"],[18.5,"#f631a4"]]}},"road-ramp":{color:"#f631a4"},"road-major":{color:"#f631a4"},boundary:{color:"#f53da8"},building:{color:"#311839",roofColor:"#9d2575",aoStrength:.29,tintVariation:.1,windowColor:"#84dcff",windowFrameColor:"#84dcff",windowGlow:.5},housenumber:{color:"#acf6f6",haloColor:"#110514",haloWidth:1.4},poi:{color:"#f6e95a",haloColor:"#110514",haloWidth:1.4},"road-label":{color:"#acf6f6",haloColor:"#110514",haloWidth:1.4},"water-label":{color:"#9fbcd1",haloColor:"#131b20",haloWidth:1.4},"place-label":{color:"#acf6f6",haloColor:"#110514",haloWidth:1.4},"poi-food":{color:"#d89964",haloColor:"#110514",haloWidth:1.4,frameColor:"#d89964",frameOpacity:1,frameHaloColor:"#110514",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-shop":{color:"#699cd4",haloColor:"#110514",haloWidth:1.4,frameColor:"#699cd4",frameOpacity:1,frameHaloColor:"#110514",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-transport":{color:"#75acc8",haloColor:"#110514",haloWidth:1.4,frameColor:"#75acc8",frameOpacity:1,frameHaloColor:"#110514",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-health":{color:"#ca7272",haloColor:"#110514",haloWidth:1.4,frameColor:"#ca7272",frameOpacity:1,frameHaloColor:"#110514",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-education":{color:"#81bbb7",haloColor:"#110514",haloWidth:1.4,frameColor:"#81bbb7",frameOpacity:1,frameHaloColor:"#110514",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-culture":{color:"#a684b8",haloColor:"#110514",haloWidth:1.4,frameColor:"#a684b8",frameOpacity:1,frameHaloColor:"#110514",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-sport":{color:"#89bb81",haloColor:"#110514",haloWidth:1.4,frameColor:"#89bb81",frameOpacity:1,frameHaloColor:"#110514",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-lodging":{color:"#8e79c3",haloColor:"#110514",haloWidth:1.4,frameColor:"#8e79c3",frameOpacity:1,frameHaloColor:"#110514",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-service":{color:"#959ea7",haloColor:"#110514",haloWidth:1.4,frameColor:"#959ea7",frameOpacity:1,frameHaloColor:"#110514",iconColor:"#1b1b1b",iconHaloWidth:0},"water-pool":{color:"#84135f"},"indoor-shell":{color:"#4c3752",opacity:.97},"indoor-corridor":{color:"#46334c"},"indoor-room":{color:"#553e5d"},"indoor-service":{color:"#6e5078"},"indoor-shop":{color:"#59446f"},"indoor-food":{color:"#6f5a44"},"indoor-wc":{color:"#445e6f"},"indoor-wall":{color:"#7b6681",roofColor:"#938298",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#635287",opacity:.95},"indoor-door":{color:"#f6e95a",haloColor:"#110514",haloWidth:1.4},"indoor-poi":{color:"#f6e95a",haloColor:"#110514",haloWidth:1.4},"indoor-name":{color:"#acf6f6",haloColor:"#110514",haloWidth:1.4},"building-entrance":{color:"#79a0d7",haloColor:"#110514"}},sky:{skyColor:"#180813",horizonColor:"#281831",fogRange:[2.34,8.77],fogIntensity:.9,spaceColor:"#060308",atmosphereColor:"#b5358b",starIntensity:.82}};var Yf={name:"\u0420\u0430\u0441\u0441\u0432\u0435\u0442",background:"#f4ebe1",light:{ambientColor:"#f8f7f7",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#ffe0c0",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#dee7ed",fillIntensity:.18},paint:{"landcover-wood":{color:"#a4db9f"},"landcover-grass":{color:"#bae7b1"},"landcover-sand":{color:"#efeac8"},"landcover-ice":{color:"#dbe7f0"},"landcover-wetland":{color:"#c1dee1"},"landuse-residential":{color:"#f5efeb"},"landuse-industrial":{color:"#d7d9e4"},"landuse-civic":{color:"#ead7dd"},"landuse-sport":{color:"#c1ecac"},"landuse-cemetery":{color:"#c8e5c2"},"landuse-parking":{color:"#dddbda"},park:{color:"#bae7b1"},"aeroway-area":{color:"#d6dbeb"},water:{color:"#a6d2f2"},waterway:{color:"#a6d2f2"},"aeroway-line":{color:"#f0ede9"},"road-casing-major":{color:"#92a1bf"},"road-casing-secondary":{color:{stops:[[16,"#a6afc9"],[18.5,"#92a1bf"]]}},"road-casing-minor":{color:{stops:[[16,"#a6afc9"],[18.5,"#92a1bf"]]}},"road-rail":{color:"#b5a49b"},"road-path":{color:"#c3c9df"},"road-minor":{color:{stops:[[16,"#c3c9df"],[18.5,"#a9b9d1"]]}},"road-secondary":{color:{stops:[[16,"#c3c9df"],[18.5,"#a9b9d1"]]}},"road-ramp":{color:"#a9b9d1"},"road-major":{color:"#a9b9d1"},boundary:{color:"#f584a1"},building:{color:"#f6ebdf",roofColor:"#fdede7",aoStrength:.19,tintVariation:.06,windowColor:"#6b9ed1",windowFrameColor:"#f0ece8",windowGlow:0},housenumber:{color:"#46332a",haloColor:"#fdfaf7",haloWidth:1.4},poi:{color:"#56738f",haloColor:"#fdfaf7",haloWidth:1.4},"road-label":{color:"#46332a",haloColor:"#fdfaf7",haloWidth:1.4},"water-label":{color:"#35688d",haloColor:"#f7f7f7",haloWidth:1.4},"place-label":{color:"#46332a",haloColor:"#fdfaf7",haloWidth:1.4},"poi-food":{haloColor:"#fdfaf7",haloWidth:1.4,frameColor:"#c2681c",frameOpacity:1,frameHaloColor:"#fdfaf7",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{haloColor:"#fdfaf7",haloWidth:1.4,frameColor:"#2f77c4",frameOpacity:1,frameHaloColor:"#fdfaf7",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{haloColor:"#fdfaf7",haloWidth:1.4,frameColor:"#3b82a6",frameOpacity:1,frameHaloColor:"#fdfaf7",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{haloColor:"#fdfaf7",haloWidth:1.4,frameColor:"#c24444",frameOpacity:1,frameHaloColor:"#fdfaf7",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{haloColor:"#fdfaf7",haloWidth:1.4,frameColor:"#3f7f7a",frameOpacity:1,frameHaloColor:"#fdfaf7",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{haloColor:"#fdfaf7",haloWidth:1.4,frameColor:"#8b5aa5",frameOpacity:1,frameHaloColor:"#fdfaf7",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{haloColor:"#fdfaf7",haloWidth:1.4,frameColor:"#4f8b45",frameOpacity:1,frameHaloColor:"#fdfaf7",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{haloColor:"#fdfaf7",haloWidth:1.4,frameColor:"#7a5fbf",frameOpacity:1,frameHaloColor:"#fdfaf7",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{haloColor:"#fdfaf7",haloWidth:1.4,frameColor:"#59636e",frameOpacity:1,frameHaloColor:"#fdfaf7",iconColor:"#ffffff",iconHaloWidth:0},"water-pool":{color:"#b9ddf7"},"indoor-shell":{color:"#f8f7f5",opacity:.97},"indoor-corridor":{color:"#fcfbfb"},"indoor-room":{color:"#f1efed"},"indoor-service":{color:"#e0dbd6"},"indoor-shop":{color:"#e4dfea"},"indoor-food":{color:"#eae4df"},"indoor-wc":{color:"#dfe5ea"},"indoor-wall":{color:"#d1cdc9",roofColor:"#e4e2e0",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#d0cbdc",opacity:.95},"indoor-door":{color:"#56738f",haloColor:"#fdfaf7",haloWidth:1.4},"indoor-poi":{color:"#56738f",haloColor:"#fdfaf7",haloWidth:1.4},"indoor-name":{color:"#46332a",haloColor:"#fdfaf7",haloWidth:1.4},"building-entrance":{color:"#225aaa",haloColor:"#fdfaf7"}},sky:{skyColor:"#8cb0c9",horizonColor:"#e4d7cb",fogRange:[2.41,9.92],fogIntensity:.86,spaceColor:"#120c07",atmosphereColor:"#5c9fd0",starIntensity:.39}};var Zf={name:"\u0421\u0443\u043C\u0435\u0440\u043A\u0438",background:"#d7cbc1",light:{ambientColor:"#ececeb",ambientIntensity:.46,keyAzimuth:120,keyAltitude:59,keyColor:"#ffcaa0",keyIntensity:.56,fillAzimuth:300,fillAltitude:25,fillColor:"#c7d0e1",fillIntensity:.19},paint:{"landcover-wood":{color:"#75af6a"},"landcover-grass":{color:"#94bd7f"},"landcover-sand":{color:"#efeac8"},"landcover-ice":{color:"#c1c8d7"},"landcover-wetland":{color:"#83bec3"},"landuse-residential":{color:"#d5cac3"},"landuse-industrial":{color:"#b3b7cc"},"landuse-civic":{color:"#d5aebb"},"landuse-sport":{color:"#91c775"},"landuse-cemetery":{color:"#9ac982"},"landuse-parking":{color:"#c0bcb9"},park:{color:"#94bd7f"},"aeroway-area":{color:"#d6dbeb"},water:{color:"#708bc2"},waterway:{color:"#708bc2"},"aeroway-line":{color:"#f0ede9"},"road-casing-major":{color:"#6a5b9a"},"road-casing-secondary":{color:{stops:[[16,"#7078a4"],[18.5,"#6a5b9a"]]}},"road-casing-minor":{color:{stops:[[16,"#7078a4"],[18.5,"#6a5b9a"]]}},"road-rail":{color:"#93796c"},"road-path":{color:"#8f94b7"},"road-minor":{color:{stops:[[16,"#8f94b7"],[18.5,"#8576b2"]]}},"road-secondary":{color:{stops:[[16,"#8f94b7"],[18.5,"#8576b2"]]}},"road-ramp":{color:"#8576b2"},"road-major":{color:"#8576b2"},boundary:{color:"#e05275"},building:{color:"#e0d1c2",roofColor:"#f1d6cb",aoStrength:.2,tintVariation:.07,windowColor:"#6b9ed1",windowFrameColor:"#efe6df",windowGlow:0},housenumber:{color:"#2c283e",haloColor:"#f5ebe0",haloWidth:1.4},poi:{color:"#64568f",haloColor:"#f5ebe0",haloWidth:1.4},"road-label":{color:"#2c283e",haloColor:"#f5ebe0",haloWidth:1.4},"water-label":{color:"#35688d",haloColor:"#f7f7f7",haloWidth:1.4},"place-label":{color:"#2c283e",haloColor:"#f5ebe0",haloWidth:1.4},"poi-food":{haloColor:"#f5ebe0",haloWidth:1.4,frameColor:"#c2681c",frameOpacity:1,frameHaloColor:"#f5ebe0",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{haloColor:"#f5ebe0",haloWidth:1.4,frameColor:"#2f77c4",frameOpacity:1,frameHaloColor:"#f5ebe0",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{haloColor:"#f5ebe0",haloWidth:1.4,frameColor:"#3b82a6",frameOpacity:1,frameHaloColor:"#f5ebe0",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{haloColor:"#f5ebe0",haloWidth:1.4,frameColor:"#c24444",frameOpacity:1,frameHaloColor:"#f5ebe0",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{haloColor:"#f5ebe0",haloWidth:1.4,frameColor:"#3f7f7a",frameOpacity:1,frameHaloColor:"#f5ebe0",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{haloColor:"#f5ebe0",haloWidth:1.4,frameColor:"#8b5aa5",frameOpacity:1,frameHaloColor:"#f5ebe0",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{haloColor:"#f5ebe0",haloWidth:1.4,frameColor:"#4f8b45",frameOpacity:1,frameHaloColor:"#f5ebe0",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{haloColor:"#f5ebe0",haloWidth:1.4,frameColor:"#7a5fbf",frameOpacity:1,frameHaloColor:"#f5ebe0",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{haloColor:"#f5ebe0",haloWidth:1.4,frameColor:"#59636e",frameOpacity:1,frameHaloColor:"#f5ebe0",iconColor:"#ffffff",iconHaloWidth:0},"water-pool":{color:"#7a94ca"},"indoor-shell":{color:"#e3deda",opacity:.97},"indoor-corridor":{color:"#e7e3df"},"indoor-room":{color:"#dcd7d1"},"indoor-service":{color:"#cbc3ba"},"indoor-shop":{color:"#ccc2d6"},"indoor-food":{color:"#d6ccc2"},"indoor-wc":{color:"#c2ced6"},"indoor-wall":{color:"#bbb5af",roofColor:"#cdc9c6",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#b6adc9",opacity:.95},"indoor-door":{color:"#64568f",haloColor:"#f5ebe0",haloWidth:1.4},"indoor-poi":{color:"#64568f",haloColor:"#f5ebe0",haloWidth:1.4},"indoor-name":{color:"#2c283e",haloColor:"#f5ebe0",haloWidth:1.4},"building-entrance":{haloColor:"#f5ebe0"}},sky:{skyColor:"#5675b3",horizonColor:"#c0b4aa",fogRange:[2.39,9.64],fogIntensity:.87,spaceColor:"#0e0b09",atmosphereColor:"#557dce",starIntensity:.45}};var qf={name:"\u0417\u0435\u043C\u043B\u044F",background:"#dbd1bd",light:{ambientColor:"#edecea",ambientIntensity:.46,keyAzimuth:120,keyAltitude:59,keyColor:"#fff2dc",keyIntensity:.56,fillAzimuth:300,fillAltitude:25,fillColor:"#c7d6e1",fillIntensity:.19},paint:{"landcover-wood":{color:"#50a136"},"landcover-grass":{color:"#8ac76b"},"landcover-sand":{color:"#efeac8"},"landcover-ice":{color:"#aec5d6"},"landcover-wetland":{color:"#7cbac0"},"landuse-residential":{color:"#ded5c4"},"landuse-industrial":{color:"#b3b7cc"},"landuse-civic":{color:"#d5aebb"},"landuse-sport":{color:"#86d161"},"landuse-cemetery":{color:"#94c67b"},"landuse-parking":{color:"#c0beb9"},park:{color:"#8ac76b"},"aeroway-area":{color:"#d6dbeb"},water:{color:"#3b91ce"},waterway:{color:"#4798d1"},"aeroway-line":{color:"#f0ede9"},"road-casing-major":{color:"#a47546"},"road-casing-secondary":{color:{stops:[[16,"#a79376"],[18.5,"#a47546"]]}},"road-casing-minor":{color:{stops:[[16,"#a79376"],[18.5,"#a47546"]]}},"road-rail":{color:"#877564"},"road-path":{color:"#c6bba9"},"road-minor":{color:{stops:[[16,"#c6bba9"],[18.5,"#cdaa7a"]]}},"road-secondary":{color:{stops:[[16,"#c6bba9"],[18.5,"#cdaa7a"]]}},"road-ramp":{color:"#cdaa7a"},"road-major":{color:"#cdaa7a"},boundary:{color:"#bf6a40"},building:{color:"#d4c5af",roofColor:"#d4c5af",aoStrength:.2,tintVariation:.07,windowColor:"#9fb0c0",windowFrameColor:"#eceae4",windowGlow:0},housenumber:{color:"#46382a",haloColor:"#f7f4ee",haloWidth:1.4},poi:{color:"#7c5c3c",haloColor:"#f7f4ee",haloWidth:1.4},"road-label":{color:"#46382a",haloColor:"#f7f4ee",haloWidth:1.4},"water-label":{color:"#35688d",haloColor:"#f7f7f7",haloWidth:1.4},"place-label":{color:"#46382a",haloColor:"#f7f4ee",haloWidth:1.4},"poi-food":{haloColor:"#f7f4ee",haloWidth:1.4,frameColor:"#c2681c",frameOpacity:1,frameHaloColor:"#f7f4ee",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{haloColor:"#f7f4ee",haloWidth:1.4,frameColor:"#2f77c4",frameOpacity:1,frameHaloColor:"#f7f4ee",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{haloColor:"#f7f4ee",haloWidth:1.4,frameColor:"#3b82a6",frameOpacity:1,frameHaloColor:"#f7f4ee",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{haloColor:"#f7f4ee",haloWidth:1.4,frameColor:"#c24444",frameOpacity:1,frameHaloColor:"#f7f4ee",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{haloColor:"#f7f4ee",haloWidth:1.4,frameColor:"#3f7f7a",frameOpacity:1,frameHaloColor:"#f7f4ee",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{haloColor:"#f7f4ee",haloWidth:1.4,frameColor:"#8b5aa5",frameOpacity:1,frameHaloColor:"#f7f4ee",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{haloColor:"#f7f4ee",haloWidth:1.4,frameColor:"#4f8b45",frameOpacity:1,frameHaloColor:"#f7f4ee",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{haloColor:"#f7f4ee",haloWidth:1.4,frameColor:"#7a5fbf",frameOpacity:1,frameHaloColor:"#f7f4ee",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{haloColor:"#f7f4ee",haloWidth:1.4,frameColor:"#59636e",frameOpacity:1,frameHaloColor:"#f7f4ee",iconColor:"#ffffff",iconHaloWidth:0},"water-pool":{color:"#4299d7"},"indoor-shell":{color:"#d6d0c8",opacity:.97},"indoor-corridor":{color:"#d9d5cd"},"indoor-room":{color:"#cfc9bf"},"indoor-service":{color:"#beb5a9"},"indoor-shop":{color:"#bcafca"},"indoor-food":{color:"#cabdaf"},"indoor-wc":{color:"#afbfca"},"indoor-wall":{color:"#ada79e",roofColor:"#bebbb5",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#a69bbc",opacity:.95},"indoor-door":{color:"#7c5c3c",haloColor:"#f7f4ee",haloWidth:1.4},"indoor-poi":{color:"#7c5c3c",haloColor:"#f7f4ee",haloWidth:1.4},"indoor-name":{color:"#46382a",haloColor:"#f7f4ee",haloWidth:1.4},"building-entrance":{haloColor:"#f7f4ee"}},sky:{skyColor:"#568db3",horizonColor:"#c4baa5",fogRange:[2.39,9.64],fogIntensity:.87,spaceColor:"#0f0c08",atmosphereColor:"#559cce",starIntensity:.45}};var Qf={name:"\u0424\u0443\u0442\u0443\u0440\u0438\u0437\u043C",background:"#0c0f1d",model3dKey:"night",light:{ambientColor:"#8590c7",ambientIntensity:.34,keyAzimuth:120,keyAltitude:55,keyColor:"#8ff0ff",keyIntensity:.28,fillAzimuth:300,fillAltitude:25,fillColor:"#477b85",fillIntensity:.22},paint:{"landcover-wood":{color:"#123026"},"landcover-grass":{color:"#18392e"},"landcover-sand":{color:"#2d2a1b"},"landcover-ice":{color:"#276672"},"landcover-wetland":{color:"#192829"},"landuse-residential":{color:"#111422"},"landuse-industrial":{color:"#1b1d27"},"landuse-civic":{color:"#271b1f"},"landuse-sport":{color:"#143d29"},"landuse-cemetery":{color:"#192420"},"landuse-parking":{color:"#292a2e"},park:{color:"#18392e"},"aeroway-area":{color:"#1e2129"},water:{color:"#055261"},waterway:{color:"#076a7e"},"aeroway-line":{color:"#55493a"},"road-casing-major":{color:"#8b238b"},"road-casing-secondary":{color:{stops:[[16,"#185662"],[18.5,"#8b238b"]]}},"road-casing-minor":{color:{stops:[[16,"#185662"],[18.5,"#8b238b"]]}},"road-rail":{color:"#8546a4"},"road-path":{color:"#22b6c3"},"road-minor":{color:{stops:[[16,"#22b6c3"],[18.5,"#e03ee0"]]}},"road-secondary":{color:{stops:[[16,"#22b6c3"],[18.5,"#e03ee0"]]}},"road-ramp":{color:"#e03ee0"},"road-major":{color:"#e03ee0"},boundary:{color:"#eb47eb"},building:{color:"#1e2b3e",roofColor:"#277686",aoStrength:.29,tintVariation:.1,windowColor:"#84dcff",windowFrameColor:"#bfe6ff",windowGlow:.5},housenumber:{color:"#c6edf1",haloColor:"#080a17",haloWidth:1.4},poi:{color:"#eb84eb",haloColor:"#080a17",haloWidth:1.4},"road-label":{color:"#c6edf1",haloColor:"#080a17",haloWidth:1.4},"water-label":{color:"#9fbcd1",haloColor:"#131b20",haloWidth:1.4},"place-label":{color:"#c6edf1",haloColor:"#080a17",haloWidth:1.4},"poi-food":{color:"#d89964",haloColor:"#080a17",haloWidth:1.4,frameColor:"#d89964",frameOpacity:1,frameHaloColor:"#080a17",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-shop":{color:"#699cd4",haloColor:"#080a17",haloWidth:1.4,frameColor:"#699cd4",frameOpacity:1,frameHaloColor:"#080a17",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-transport":{color:"#75acc8",haloColor:"#080a17",haloWidth:1.4,frameColor:"#75acc8",frameOpacity:1,frameHaloColor:"#080a17",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-health":{color:"#ca7272",haloColor:"#080a17",haloWidth:1.4,frameColor:"#ca7272",frameOpacity:1,frameHaloColor:"#080a17",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-education":{color:"#81bbb7",haloColor:"#080a17",haloWidth:1.4,frameColor:"#81bbb7",frameOpacity:1,frameHaloColor:"#080a17",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-culture":{color:"#a684b8",haloColor:"#080a17",haloWidth:1.4,frameColor:"#a684b8",frameOpacity:1,frameHaloColor:"#080a17",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-sport":{color:"#89bb81",haloColor:"#080a17",haloWidth:1.4,frameColor:"#89bb81",frameOpacity:1,frameHaloColor:"#080a17",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-lodging":{color:"#8e79c3",haloColor:"#080a17",haloWidth:1.4,frameColor:"#8e79c3",frameOpacity:1,frameHaloColor:"#080a17",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-service":{color:"#959ea7",haloColor:"#080a17",haloWidth:1.4,frameColor:"#959ea7",frameOpacity:1,frameHaloColor:"#080a17",iconColor:"#1b1b1b",iconHaloWidth:0},"water-pool":{color:"#027288"},"indoor-shell":{color:"#394556",opacity:.97},"indoor-corridor":{color:"#354050"},"indoor-room":{color:"#404d60"},"indoor-service":{color:"#52637b"},"indoor-shop":{color:"#5c4672"},"indoor-food":{color:"#725d46"},"indoor-wc":{color:"#466172"},"indoor-wall":{color:"#687485",roofColor:"#858e9a",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#66558a",opacity:.95},"indoor-door":{color:"#eb84eb",haloColor:"#080a17",haloWidth:1.4},"indoor-poi":{color:"#eb84eb",haloColor:"#080a17",haloWidth:1.4},"indoor-name":{color:"#c6edf1",haloColor:"#080a17",haloWidth:1.4},"building-entrance":{color:"#79a0d7",haloColor:"#080a17"}},sky:{skyColor:"#081619",horizonColor:"#1b1f30",fogRange:[2.34,8.79],fogIntensity:.9,spaceColor:"#030408",atmosphereColor:"#35a1b7",starIntensity:.81}};var $f={name:"\u0421\u0442\u0435\u043A\u043B\u043E \u043C\u044F\u0433\u043A\u043E\u0435",background:"#f2f5f7",light:{ambientColor:"#fbfbfb",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#ffffff",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#dee9ed",fillIntensity:.18},paint:{"landcover-wood":{color:"#bddbc3"},"landcover-grass":{color:"#d0ecda"},"landcover-sand":{color:"#efeac8"},"landcover-ice":{color:"#cbebdb"},"landcover-wetland":{color:"#d9ebed"},"landuse-residential":{color:"#f6f7f9"},"landuse-industrial":{color:"#e3e5ed"},"landuse-civic":{color:"#f1e4e8"},"landuse-sport":{color:"#cdefd4"},"landuse-cemetery":{color:"#dbf0e3"},"landuse-parking":{color:"#e4e6e7"},park:{color:"#ccead9"},"aeroway-area":{color:"#d6dbeb"},water:{color:"#b9e5f4"},waterway:{color:"#81c6e4"},"aeroway-line":{color:"#f0ede9"},"road-casing-major":{color:"#dabc95"},"road-casing-secondary":{color:{stops:[[16,"#d5cdb8"],[18.5,"#dabc95"]]}},"road-casing-minor":{color:{stops:[[16,"#cad1d8"],[18.5,"#dabc95"]]}},"road-rail":{color:"#a5a0b1"},"road-path":{color:"#9fbcad"},"road-minor":{color:{stops:[[16,"#ffffff"],[18.5,"#f8e5c3"]]}},"road-secondary":{color:{stops:[[16,"#fbf6ea"],[18.5,"#f8e5c3"]]}},"road-ramp":{color:"#f8e5c3"},"road-major":{color:"#f8e5c3"},boundary:{color:"#ce97c0"},building:{color:"#e5ebf0",roofColor:"#f7fbfd",aoStrength:.18,tintVariation:.06,windowColor:"#bcd4e8",windowFrameColor:"#dfe8f2",windowGlow:0},housenumber:{color:"#4e6779",haloColor:"#fbfdfe",haloWidth:1.4},poi:{color:"#4e6779",haloColor:"#fbfdfe",haloWidth:1.4},"road-label":{color:"#2f3f50",haloColor:"#fbfdfe",haloWidth:1.4},"water-label":{color:"#35688d",haloColor:"#f7f7f7",haloWidth:1.4},"place-label":{color:"#2f3f50",haloColor:"#fbfdfe",haloWidth:1.4},"poi-food":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#c2681c",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#2f77c4",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#3b82a6",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#c24444",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#3f7f7a",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#8b5aa5",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#4f8b45",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#7a5fbf",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#59636e",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"water-pool":{color:"#ceeef9"},"indoor-shell":{color:"#f5f7f8",opacity:.97},"indoor-corridor":{color:"#fbfbfc"},"indoor-room":{color:"#edeff1"},"indoor-service":{color:"#d6dce0"},"indoor-shop":{color:"#e4dfea"},"indoor-food":{color:"#eae4df"},"indoor-wc":{color:"#dfe5ea"},"indoor-wall":{color:"#c9ced1",roofColor:"#e0e2e4",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#d0cbdc",opacity:.95},"indoor-door":{color:"#4e6779",haloColor:"#fbfdfe",haloWidth:1.4},"indoor-poi":{color:"#4e6779",haloColor:"#fbfdfe",haloWidth:1.4},"indoor-name":{color:"#2f3f50",haloColor:"#fbfdfe",haloWidth:1.4},"building-entrance":{color:"#225aaa",haloColor:"#fbfdfe"}},sky:{skyColor:"#9fc5d2",horizonColor:"#dfe3e8",fogRange:[2.43,10.02],fogIntensity:.85,spaceColor:"#090c0f",atmosphereColor:"#5fb3d0",starIntensity:.37}};var eu={name:"\u0421\u0442\u0435\u043A\u043B\u043E",background:"#f2f5f7",light:{ambientColor:"#fbfbfb",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#ffffff",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#dee9ed",fillIntensity:.18},paint:{"landcover-wood":{color:"#b8e0cf"},"landcover-grass":{color:"#cbebdb"},"landcover-sand":{color:"#efeac8"},"landcover-ice":{color:"#e5f0f3"},"landcover-wetland":{color:"#d6e9eb"},"landuse-residential":{color:"#f6f7f9"},"landuse-industrial":{color:"#e3e5ed"},"landuse-civic":{color:"#f1e4e8"},"landuse-sport":{color:"#c8efd5"},"landuse-cemetery":{color:"#d8eee3"},"landuse-parking":{color:"#e4e6e7"},park:{color:"#cbebdb"},"aeroway-area":{color:"#d6dbeb"},water:{color:"#bee6f4"},waterway:{color:"#bee6f4"},"aeroway-line":{color:"#f0ede9"},"road-casing-major":{color:"#9dc7dd"},"road-casing-secondary":{color:{stops:[[16,"#bdcfdb"],[18.5,"#9dc7dd"]]}},"road-casing-minor":{color:{stops:[[16,"#bdcfdb"],[18.5,"#9dc7dd"]]}},"road-rail":{color:"#adb9c2"},"road-path":{color:"#d6e2eb"},"road-minor":{color:{stops:[[16,"#d6e2eb"],[18.5,"#b8daea"]]}},"road-secondary":{color:{stops:[[16,"#d6e2eb"],[18.5,"#b8daea"]]}},"road-ramp":{color:"#b8daea"},"road-major":{color:"#b8daea"},boundary:{color:"#e28dc6"},building:{color:"#e8eef3",roofColor:"#f4f8fb",aoStrength:.18,tintVariation:.06,windowColor:"#bcd4e8",windowFrameColor:"#dfe8f2",windowGlow:0},housenumber:{color:"#2d4053",haloColor:"#fbfdfe",haloWidth:1.4},poi:{color:"#457aa1",haloColor:"#fbfdfe",haloWidth:1.4},"road-label":{color:"#2d4053",haloColor:"#fbfdfe",haloWidth:1.4},"water-label":{color:"#35688d",haloColor:"#f7f7f7",haloWidth:1.4},"place-label":{color:"#2d4053",haloColor:"#fbfdfe",haloWidth:1.4},"poi-food":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#c2681c",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#2f77c4",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#3b82a6",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#c24444",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#3f7f7a",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#8b5aa5",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#4f8b45",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#7a5fbf",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#59636e",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"water-pool":{color:"#d3eff9"},"indoor-shell":{color:"#f5f7f8",opacity:.97},"indoor-corridor":{color:"#fbfbfc"},"indoor-room":{color:"#edeff1"},"indoor-service":{color:"#d6dce0"},"indoor-shop":{color:"#e4dfea"},"indoor-food":{color:"#eae4df"},"indoor-wc":{color:"#dfe5ea"},"indoor-wall":{color:"#c9ced1",roofColor:"#e0e2e4",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#d0cbdc",opacity:.95},"indoor-door":{color:"#457aa1",haloColor:"#fbfdfe",haloWidth:1.4},"indoor-poi":{color:"#457aa1",haloColor:"#fbfdfe",haloWidth:1.4},"indoor-name":{color:"#2d4053",haloColor:"#fbfdfe",haloWidth:1.4},"building-entrance":{color:"#225aaa",haloColor:"#fbfdfe"}},sky:{skyColor:"#9fc5d2",horizonColor:"#dfe3e8",fogRange:[2.43,10.02],fogIntensity:.85,spaceColor:"#090c10",atmosphereColor:"#5fb3d0",starIntensity:.37}};var tu={name:"\u0413\u0430\u0440\u043C\u043E\u043D\u0438\u044F \u0447\u0451\u0440\u043D\u0430\u044F",background:"#1a1a1a",model3dKey:"night",light:{ambientColor:"#a8a8a8",ambientIntensity:.34,keyAzimuth:120,keyAltitude:55,keyColor:"#cccccc",keyIntensity:.29,fillAzimuth:300,fillAltitude:25,fillColor:"#854747",fillIntensity:.22},paint:{"landcover-wood":{color:"#212121"},"landcover-grass":{color:"#292929"},"landcover-sand":{color:"#33301f"},"landcover-ice":{color:"#545454"},"landcover-wetland":{color:"#1d2e30"},"landuse-residential":{color:"#1f1f1f"},"landuse-industrial":{color:"#1f222d"},"landuse-civic":{color:"#2d1f24"},"landuse-sport":{color:"#2d2525"},"landuse-cemetery":{color:"#2a1d1d"},"landuse-parking":{color:"#332e2e"},park:{color:"#292929"},"aeroway-area":{color:"#23262f"},water:{color:"#383838"},waterway:{color:"#3d3d3d"},"aeroway-line":{color:"#55493a"},"road-casing-major":{color:"#525252"},"road-casing-secondary":{color:{stops:[[16,"#383838"],[18.5,"#525252"]]}},"road-casing-minor":{color:{stops:[[16,"#383838"],[18.5,"#525252"]]}},"road-rail":{color:"#595959"},"road-path":{color:"#525252"},"road-minor":{color:{stops:[[16,"#525252"],[18.5,"#757575"]]}},"road-secondary":{color:{stops:[[16,"#525252"],[18.5,"#757575"]]}},"road-ramp":{color:"#757575"},"road-major":{color:"#757575"},boundary:{color:"#808080"},building:{color:"#2e2e2e",roofColor:"#4f4f4f",aoStrength:.29,tintVariation:.1,windowColor:"#8fb8e8",windowFrameColor:"#c8ccd4",windowGlow:.36},housenumber:{color:"#d9d9d9",haloColor:"#0a0a0a",haloWidth:1.4},poi:{color:"#a3a3a3",haloColor:"#0a0a0a",haloWidth:1.4},"road-label":{color:"#d9d9d9",haloColor:"#0a0a0a",haloWidth:1.4},"water-label":{color:"#9fbcd1",haloColor:"#131b20",haloWidth:1.4},"place-label":{color:"#d9d9d9",haloColor:"#0a0a0a",haloWidth:1.4},"poi-food":{color:"#a3a3a3",haloColor:"#0a0a0a",haloWidth:1.4,frameColor:"#a3a3a3",frameOpacity:1,frameHaloColor:"#0a0a0a",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-shop":{color:"#a3a3a3",haloColor:"#0a0a0a",haloWidth:1.4,frameColor:"#a3a3a3",frameOpacity:1,frameHaloColor:"#0a0a0a",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-transport":{color:"#a3a3a3",haloColor:"#0a0a0a",haloWidth:1.4,frameColor:"#a3a3a3",frameOpacity:1,frameHaloColor:"#0a0a0a",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-health":{color:"#a3a3a3",haloColor:"#0a0a0a",haloWidth:1.4,frameColor:"#a3a3a3",frameOpacity:1,frameHaloColor:"#0a0a0a",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-education":{color:"#a3a3a3",haloColor:"#0a0a0a",haloWidth:1.4,frameColor:"#a3a3a3",frameOpacity:1,frameHaloColor:"#0a0a0a",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-culture":{color:"#a3a3a3",haloColor:"#0a0a0a",haloWidth:1.4,frameColor:"#a3a3a3",frameOpacity:1,frameHaloColor:"#0a0a0a",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-sport":{color:"#a3a3a3",haloColor:"#0a0a0a",haloWidth:1.4,frameColor:"#a3a3a3",frameOpacity:1,frameHaloColor:"#0a0a0a",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-lodging":{color:"#a3a3a3",haloColor:"#0a0a0a",haloWidth:1.4,frameColor:"#a3a3a3",frameOpacity:1,frameHaloColor:"#0a0a0a",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-service":{color:"#a3a3a3",haloColor:"#0a0a0a",haloWidth:1.4,frameColor:"#a3a3a3",frameOpacity:1,frameHaloColor:"#0a0a0a",iconColor:"#1b1b1b",iconHaloWidth:0},"water-pool":{color:"#4c4c4c"},"indoor-shell":{color:"#484848",opacity:.97},"indoor-corridor":{color:"#424242"},"indoor-room":{color:"#505050"},"indoor-service":{color:"#676767"},"indoor-shop":{color:"#5c4672"},"indoor-food":{color:"#725d46"},"indoor-wc":{color:"#466172"},"indoor-wall":{color:"#767676",roofColor:"#909090",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#66558a",opacity:.95},"indoor-door":{color:"#a3a3a3",haloColor:"#0a0a0a",haloWidth:1.4},"indoor-poi":{color:"#a3a3a3",haloColor:"#0a0a0a",haloWidth:1.4},"indoor-name":{color:"#d9d9d9",haloColor:"#0a0a0a",haloWidth:1.4},"building-entrance":{color:"#cac4c4",haloColor:"#0a0a0a"}},sky:{skyColor:"#190909",horizonColor:"#282828",fogRange:[2.34,8.79],fogIntensity:.9,spaceColor:"#060606",atmosphereColor:"#b83535",starIntensity:.8}};var ou={name:"\u0413\u0430\u0440\u043C\u043E\u043D\u0438\u044F \u0441\u0438\u043D\u044F\u044F",background:"#e3e9f2",light:{ambientColor:"#f7f7f7",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#eef4ff",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#dee5ed",fillIntensity:.18},paint:{"landcover-wood":{color:"#a1b8ce"},"landcover-grass":{color:"#bdccdb"},"landcover-sand":{color:"#efeac8"},"landcover-ice":{color:"#baccde"},"landcover-wetland":{color:"#c1dee1"},"landuse-residential":{color:"#ebeff4"},"landuse-industrial":{color:"#d7d9e4"},"landuse-civic":{color:"#ead7dd"},"landuse-sport":{color:"#b8d3e0"},"landuse-cemetery":{color:"#c2d4e5"},"landuse-parking":{color:"#dadbdd"},park:{color:"#bdccdb"},"aeroway-area":{color:"#d6dbeb"},water:{color:"#5799db"},waterway:{color:"#5f9edd"},"aeroway-line":{color:"#f0ede9"},"road-casing-major":{color:"#407fbf"},"road-casing-secondary":{color:{stops:[[16,"#80a1c6"],[18.5,"#407fbf"]]}},"road-casing-minor":{color:{stops:[[16,"#80a1c6"],[18.5,"#407fbf"]]}},"road-rail":{color:"#738dab"},"road-path":{color:"#b0c5dd"},"road-minor":{color:{stops:[[16,"#b0c5dd"],[18.5,"#71a3d6"]]}},"road-secondary":{color:{stops:[[16,"#b0c5dd"],[18.5,"#71a3d6"]]}},"road-ramp":{color:"#71a3d6"},"road-major":{color:"#71a3d6"},boundary:{color:"#478cd1"},building:{color:"#cfdae8",roofColor:"#e5edf6",aoStrength:.19,tintVariation:.06,windowColor:"#6b9ed1",windowFrameColor:"#e8eef6",windowGlow:0},housenumber:{color:"#1f395c",haloColor:"#fbfcfe",haloWidth:1.4},poi:{color:"#3e6da3",haloColor:"#fbfcfe",haloWidth:1.4},"road-label":{color:"#1f395c",haloColor:"#fbfcfe",haloWidth:1.4},"water-label":{color:"#35688d",haloColor:"#f7f7f7",haloWidth:1.4},"place-label":{color:"#1f395c",haloColor:"#fbfcfe",haloWidth:1.4},"poi-food":{haloColor:"#fbfcfe",haloWidth:1.4,frameColor:"#c2681c",frameOpacity:1,frameHaloColor:"#fbfcfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{haloColor:"#fbfcfe",haloWidth:1.4,frameColor:"#2f77c4",frameOpacity:1,frameHaloColor:"#fbfcfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{haloColor:"#fbfcfe",haloWidth:1.4,frameColor:"#3b82a6",frameOpacity:1,frameHaloColor:"#fbfcfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{haloColor:"#fbfcfe",haloWidth:1.4,frameColor:"#c24444",frameOpacity:1,frameHaloColor:"#fbfcfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{haloColor:"#fbfcfe",haloWidth:1.4,frameColor:"#3f7f7a",frameOpacity:1,frameHaloColor:"#fbfcfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{haloColor:"#fbfcfe",haloWidth:1.4,frameColor:"#8b5aa5",frameOpacity:1,frameHaloColor:"#fbfcfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{haloColor:"#fbfcfe",haloWidth:1.4,frameColor:"#4f8b45",frameOpacity:1,frameHaloColor:"#fbfcfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{haloColor:"#fbfcfe",haloWidth:1.4,frameColor:"#7a5fbf",frameOpacity:1,frameHaloColor:"#fbfcfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{haloColor:"#fbfcfe",haloWidth:1.4,frameColor:"#59636e",frameOpacity:1,frameHaloColor:"#fbfcfe",iconColor:"#ffffff",iconHaloWidth:0},"water-pool":{color:"#61a2e3"},"indoor-shell":{color:"#e6e8ec",opacity:.97},"indoor-corridor":{color:"#ebedf0"},"indoor-room":{color:"#dde1e5"},"indoor-service":{color:"#c6ccd4"},"indoor-shop":{color:"#d6cedf"},"indoor-food":{color:"#dfd7ce"},"indoor-wc":{color:"#ced8df"},"indoor-wall":{color:"#babfc5",roofColor:"#d1d4d7",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#c1bad1",opacity:.95},"indoor-door":{color:"#3e6da3",haloColor:"#fbfcfe",haloWidth:1.4},"indoor-poi":{color:"#3e6da3",haloColor:"#fbfcfe",haloWidth:1.4},"indoor-name":{color:"#1f395c",haloColor:"#fbfcfe",haloWidth:1.4},"building-entrance":{color:"#225aaa",haloColor:"#fbfcfe"}},sky:{skyColor:"#8cabc9",horizonColor:"#ced6e1",fogRange:[2.41,9.92],fogIntensity:.86,spaceColor:"#080b10",atmosphereColor:"#5c96d0",starIntensity:.39}};var ru={name:"\u0413\u0430\u0440\u043C\u043E\u043D\u0438\u044F \u0437\u0435\u043B\u0451\u043D\u0430\u044F",background:"#dfecdf",light:{ambientColor:"#f5f6f5",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#f0fff0",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#dcece7",fillIntensity:.18},paint:{"landcover-wood":{color:"#5ccc65"},"landcover-grass":{color:"#8cd98c"},"landcover-sand":{color:"#efeac8"},"landcover-ice":{color:"#bbd8ce"},"landcover-wetland":{color:"#9fccd1"},"landuse-residential":{color:"#e6efe6"},"landuse-industrial":{color:"#d1d4e0"},"landuse-civic":{color:"#e7d0d7"},"landuse-sport":{color:"#94e085"},"landuse-cemetery":{color:"#9fd69f"},"landuse-parking":{color:"#d4d8d4"},park:{color:"#8cd98c"},"aeroway-area":{color:"#d6dbeb"},water:{color:"#5ec9a6"},waterway:{color:"#66ccaa"},"aeroway-line":{color:"#f0ede9"},"road-casing-major":{color:"#44a754"},"road-casing-secondary":{color:{stops:[[16,"#7fbd7f"],[18.5,"#44a754"]]}},"road-casing-minor":{color:{stops:[[16,"#7fbd7f"],[18.5,"#44a754"]]}},"road-rail":{color:"#72a172"},"road-path":{color:"#afd4af"},"road-minor":{color:{stops:[[16,"#afd4af"],[18.5,"#64c474"]]}},"road-secondary":{color:{stops:[[16,"#afd4af"],[18.5,"#64c474"]]}},"road-ramp":{color:"#64c474"},"road-major":{color:"#64c474"},boundary:{color:"#39c668"},building:{color:"#cfe2cb",roofColor:"#dff1df",aoStrength:.19,tintVariation:.06,windowColor:"#6b9ed1",windowFrameColor:"#e8f0e8",windowGlow:0},housenumber:{color:"#1c4a24",haloColor:"#f8fcf8",haloWidth:1.4},poi:{color:"#358d44",haloColor:"#f8fcf8",haloWidth:1.4},"road-label":{color:"#1c4a24",haloColor:"#f8fcf8",haloWidth:1.4},"water-label":{color:"#35688d",haloColor:"#f7f7f7",haloWidth:1.4},"place-label":{color:"#1c4a24",haloColor:"#f8fcf8",haloWidth:1.4},"poi-food":{haloColor:"#f8fcf8",haloWidth:1.4,frameColor:"#c2681c",frameOpacity:1,frameHaloColor:"#f8fcf8",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{haloColor:"#f8fcf8",haloWidth:1.4,frameColor:"#2f77c4",frameOpacity:1,frameHaloColor:"#f8fcf8",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{haloColor:"#f8fcf8",haloWidth:1.4,frameColor:"#3b82a6",frameOpacity:1,frameHaloColor:"#f8fcf8",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{haloColor:"#f8fcf8",haloWidth:1.4,frameColor:"#c24444",frameOpacity:1,frameHaloColor:"#f8fcf8",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{haloColor:"#f8fcf8",haloWidth:1.4,frameColor:"#3f7f7a",frameOpacity:1,frameHaloColor:"#f8fcf8",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{haloColor:"#f8fcf8",haloWidth:1.4,frameColor:"#8b5aa5",frameOpacity:1,frameHaloColor:"#f8fcf8",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{haloColor:"#f8fcf8",haloWidth:1.4,frameColor:"#4f8b45",frameOpacity:1,frameHaloColor:"#f8fcf8",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{haloColor:"#f8fcf8",haloWidth:1.4,frameColor:"#7a5fbf",frameOpacity:1,frameHaloColor:"#f8fcf8",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{haloColor:"#f8fcf8",haloWidth:1.4,frameColor:"#59636e",frameOpacity:1,frameHaloColor:"#f8fcf8",iconColor:"#ffffff",iconHaloWidth:0},"water-pool":{color:"#67d1af"},"indoor-shell":{color:"#e1e8e0",opacity:.97},"indoor-corridor":{color:"#e6ece5"},"indoor-room":{color:"#d9e1d7"},"indoor-service":{color:"#c3d0c1"},"indoor-shop":{color:"#d1c8db"},"indoor-food":{color:"#dbd2c8"},"indoor-wc":{color:"#c8d4db"},"indoor-wall":{color:"#b7c0b5",roofColor:"#cdd2cc",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#bcb4cd",opacity:.95},"indoor-door":{color:"#358d44",haloColor:"#f8fcf8",haloWidth:1.4},"indoor-poi":{color:"#358d44",haloColor:"#f8fcf8",haloWidth:1.4},"indoor-name":{color:"#1c4a24",haloColor:"#f8fcf8",haloWidth:1.4},"building-entrance":{color:"#225aaa",haloColor:"#f8fcf8"}},sky:{skyColor:"#83c5af",horizonColor:"#cad9ca",fogRange:[2.41,9.87],fogIntensity:.86,spaceColor:"#090f09",atmosphereColor:"#5bcfa9",starIntensity:.4}};var nu={name:"\u041B\u0443\u043D\u043D\u0430\u044F",background:"#c8cbd0",light:{ambientColor:"#ebecec",ambientIntensity:.46,keyAzimuth:120,keyAltitude:59,keyColor:"#e8ecf2",keyIntensity:.56,fillAzimuth:300,fillAltitude:25,fillColor:"#c7d0e1",fillIntensity:.19},paint:{"landcover-wood":{color:"#a8abb3"},"landcover-grass":{color:"#b9bbc1"},"landcover-sand":{color:"#efeac8"},"landcover-ice":{color:"#cbcdd2"},"landcover-wetland":{color:"#acd4d7"},"landuse-residential":{color:"#ced0d4"},"landuse-industrial":{color:"#b3b7cc"},"landuse-civic":{color:"#d5aebb"},"landuse-sport":{color:"#b2bdc7"},"landuse-cemetery":{color:"#adbddc"},"landuse-parking":{color:"#b9bcc0"},park:{color:"#b9bbc1"},"aeroway-area":{color:"#d6dbeb"},water:{color:"#929aaa"},waterway:{color:"#929aaa"},"aeroway-line":{color:"#f0ede9"},"road-casing-major":{color:"#6c7689"},"road-casing-secondary":{color:{stops:[[16,"#848b9a"],[18.5,"#6c7689"]]}},"road-casing-minor":{color:{stops:[[16,"#848b9a"],[18.5,"#6c7689"]]}},"road-rail":{color:"#7e838b"},"road-path":{color:"#acb0b9"},"road-minor":{color:{stops:[[16,"#acb0b9"],[18.5,"#949ba8"]]}},"road-secondary":{color:{stops:[[16,"#acb0b9"],[18.5,"#949ba8"]]}},"road-ramp":{color:"#949ba8"},"road-major":{color:"#949ba8"},boundary:{color:"#6a7181"},building:{color:"#c8cbd0",roofColor:"#d9dbdd",aoStrength:.2,tintVariation:.07,windowColor:"#9fb0c0",windowFrameColor:"#cfd6e0",windowGlow:0},housenumber:{color:"#31363f",haloColor:"#f1f2f4",haloWidth:1.4},poi:{color:"#606876",haloColor:"#f1f2f4",haloWidth:1.4},"road-label":{color:"#31363f",haloColor:"#f1f2f4",haloWidth:1.4},"water-label":{color:"#35688d",haloColor:"#f7f7f7",haloWidth:1.4},"place-label":{color:"#31363f",haloColor:"#f1f2f4",haloWidth:1.4},"poi-food":{haloColor:"#f1f2f4",haloWidth:1.4,frameColor:"#c2681c",frameOpacity:1,frameHaloColor:"#f1f2f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{haloColor:"#f1f2f4",haloWidth:1.4,frameColor:"#2f77c4",frameOpacity:1,frameHaloColor:"#f1f2f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{haloColor:"#f1f2f4",haloWidth:1.4,frameColor:"#3b82a6",frameOpacity:1,frameHaloColor:"#f1f2f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{haloColor:"#f1f2f4",haloWidth:1.4,frameColor:"#c24444",frameOpacity:1,frameHaloColor:"#f1f2f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{haloColor:"#f1f2f4",haloWidth:1.4,frameColor:"#3f7f7a",frameOpacity:1,frameHaloColor:"#f1f2f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{haloColor:"#f1f2f4",haloWidth:1.4,frameColor:"#8b5aa5",frameOpacity:1,frameHaloColor:"#f1f2f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{haloColor:"#f1f2f4",haloWidth:1.4,frameColor:"#4f8b45",frameOpacity:1,frameHaloColor:"#f1f2f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{haloColor:"#f1f2f4",haloWidth:1.4,frameColor:"#7a5fbf",frameOpacity:1,frameHaloColor:"#f1f2f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{haloColor:"#f1f2f4",haloWidth:1.4,frameColor:"#59636e",frameOpacity:1,frameHaloColor:"#f1f2f4",iconColor:"#ffffff",iconHaloWidth:0},"water-pool":{color:"#9ca4b3"},"indoor-shell":{color:"#d6d9dc",opacity:.97},"indoor-corridor":{color:"#dbdde0"},"indoor-room":{color:"#ced1d5"},"indoor-service":{color:"#b9bcc3"},"indoor-shop":{color:"#c7bcd2"},"indoor-food":{color:"#d2c7bc"},"indoor-wc":{color:"#bcc9d2"},"indoor-wall":{color:"#acafb4",roofColor:"#c2c4c7",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#b1a7c5",opacity:.95},"indoor-door":{color:"#606876",haloColor:"#f1f2f4",haloWidth:1.4},"indoor-poi":{color:"#606876",haloColor:"#f1f2f4",haloWidth:1.4},"indoor-name":{color:"#31363f",haloColor:"#f1f2f4",haloWidth:1.4},"building-entrance":{haloColor:"#f1f2f4"}},sky:{skyColor:"#5675b3",horizonColor:"#b1b4b9",fogRange:[2.39,9.64],fogIntensity:.87,spaceColor:"#0a0b0c",atmosphereColor:"#557dce",starIntensity:.45}};var iu={name:"\u041C\u0430\u0442\u043E\u0432\u0430\u044F",background:"#e7e6e4",light:{ambientColor:"#f5f5f5",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#ffffff",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#dce6ec",fillIntensity:.18},paint:{"landcover-wood":{color:"#a3be9d"},"landcover-grass":{color:"#b3cbae"},"landcover-sand":{color:"#efeac8"},"landcover-ice":{color:"#d6dce0"},"landcover-wetland":{color:"#acd4d7"},"landuse-residential":{color:"#ecebe9"},"landuse-industrial":{color:"#d1d4e0"},"landuse-civic":{color:"#e7d0d7"},"landuse-sport":{color:"#b6d2a7"},"landuse-cemetery":{color:"#b5dcad"},"landuse-parking":{color:"#d8d6d4"},park:{color:"#b3cbae"},"aeroway-area":{color:"#d6dbeb"},water:{color:"#a6bbc9"},waterway:{color:"#a6bbc9"},"aeroway-line":{color:"#f0ede9"},"road-casing-major":{color:"#969fb0"},"road-casing-secondary":{color:{stops:[[16,"#abb0ba"],[18.5,"#969fb0"]]}},"road-casing-minor":{color:{stops:[[16,"#abb0ba"],[18.5,"#969fb0"]]}},"road-rail":{color:"#adadad"},"road-path":{color:"#c7cad1"},"road-minor":{color:{stops:[[16,"#c7cad1"],[18.5,"#aeb4c2"]]}},"road-secondary":{color:{stops:[[16,"#c7cad1"],[18.5,"#aeb4c2"]]}},"road-ramp":{color:"#aeb4c2"},"road-major":{color:"#aeb4c2"},boundary:{color:"#ca919f"},building:{color:"#dad6d2",roofColor:"#e3e0dd",aoStrength:.19,tintVariation:.06,windowColor:"#9fb0c0",windowFrameColor:"#f0f0f2",windowGlow:0},housenumber:{color:"#4d4742",haloColor:"#f6f5f4",haloWidth:1.4},poi:{color:"#707a8f",haloColor:"#f6f5f4",haloWidth:1.4},"road-label":{color:"#4d4742",haloColor:"#f6f5f4",haloWidth:1.4},"water-label":{color:"#35688d",haloColor:"#f7f7f7",haloWidth:1.4},"place-label":{color:"#4d4742",haloColor:"#f6f5f4",haloWidth:1.4},"poi-food":{haloColor:"#f6f5f4",haloWidth:1.4,frameColor:"#c2681c",frameOpacity:1,frameHaloColor:"#f6f5f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{haloColor:"#f6f5f4",haloWidth:1.4,frameColor:"#2f77c4",frameOpacity:1,frameHaloColor:"#f6f5f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{haloColor:"#f6f5f4",haloWidth:1.4,frameColor:"#3b82a6",frameOpacity:1,frameHaloColor:"#f6f5f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{haloColor:"#f6f5f4",haloWidth:1.4,frameColor:"#c24444",frameOpacity:1,frameHaloColor:"#f6f5f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{haloColor:"#f6f5f4",haloWidth:1.4,frameColor:"#3f7f7a",frameOpacity:1,frameHaloColor:"#f6f5f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{haloColor:"#f6f5f4",haloWidth:1.4,frameColor:"#8b5aa5",frameOpacity:1,frameHaloColor:"#f6f5f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{haloColor:"#f6f5f4",haloWidth:1.4,frameColor:"#4f8b45",frameOpacity:1,frameHaloColor:"#f6f5f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{haloColor:"#f6f5f4",haloWidth:1.4,frameColor:"#7a5fbf",frameOpacity:1,frameHaloColor:"#f6f5f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{haloColor:"#f6f5f4",haloWidth:1.4,frameColor:"#59636e",frameOpacity:1,frameHaloColor:"#f6f5f4",iconColor:"#ffffff",iconHaloWidth:0},"water-pool":{color:"#b3c6d2"},"indoor-shell":{color:"#e6e3e1",opacity:.97},"indoor-corridor":{color:"#eae8e6"},"indoor-room":{color:"#dfdcd8"},"indoor-service":{color:"#cdc8c2"},"indoor-shop":{color:"#d1c8da"},"indoor-food":{color:"#dad1c8"},"indoor-wc":{color:"#c8d3da"},"indoor-wall":{color:"#bebab6",roofColor:"#d1cecc",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#bbb3cd",opacity:.95},"indoor-door":{color:"#707a8f",haloColor:"#f6f5f4",haloWidth:1.4},"indoor-poi":{color:"#707a8f",haloColor:"#f6f5f4",haloWidth:1.4},"indoor-name":{color:"#4d4742",haloColor:"#f6f5f4",haloWidth:1.4},"building-entrance":{color:"#225aaa",haloColor:"#f6f5f4"}},sky:{skyColor:"#83abc5",horizonColor:"#d3d2d0",fogRange:[2.41,9.87],fogIntensity:.86,spaceColor:"#0d0c0b",atmosphereColor:"#5ba1cf",starIntensity:.4}};var au={name:"\u041C\u0438\u043D\u0438\u043C\u0430\u043B\u0438\u0437\u043C",background:"#f7f7f7",light:{ambientColor:"#fcfcfc",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#ffffff",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#dee7ed",fillIntensity:.18},paint:{"landcover-wood":{color:"#d6e1d6"},"landcover-grass":{color:"#e1eae1"},"landcover-sand":{color:"#efeac8"},"landcover-ice":{color:"#edf0f2"},"landcover-wetland":{color:"#e3f1f2"},"landuse-residential":{color:"#fafafa"},"landuse-industrial":{color:"#e7e8ef"},"landuse-civic":{color:"#f3e7eb"},"landuse-sport":{color:"#e1edde"},"landuse-cemetery":{color:"#e6f4e6"},"landuse-parking":{color:"#e9e7e7"},park:{color:"#e1eae1"},"aeroway-area":{color:"#d6dbeb"},water:{color:"#d7e2ea"},waterway:{color:"#d7e2ea"},"aeroway-line":{color:"#f0ede9"},"road-casing-major":{color:"#a3a3a3"},"road-casing-secondary":{color:{stops:[[16,"#b8b8b8"],[18.5,"#a3a3a3"]]}},"road-casing-minor":{color:{stops:[[16,"#b8b8b8"],[18.5,"#a3a3a3"]]}},"road-rail":{color:"#b3b3b3"},"road-path":{color:"#d1d1d1"},"road-minor":{color:{stops:[[16,"#d1d1d1"],[18.5,"#bdbdbd"]]}},"road-secondary":{color:{stops:[[16,"#d1d1d1"],[18.5,"#bdbdbd"]]}},"road-ramp":{color:"#bdbdbd"},"road-major":{color:"#bdbdbd"},boundary:{color:"#999999"},building:{color:"#ebebeb",roofColor:"#f2f2f2",aoStrength:.18,tintVariation:.06,windowColor:"#9fb0c0",windowFrameColor:"#f4f4f6",windowGlow:0},housenumber:{color:"#404040",haloColor:"#ffffff",haloWidth:1.4},poi:{color:"#737373",haloColor:"#ffffff",haloWidth:1.4},"road-label":{color:"#404040",haloColor:"#ffffff",haloWidth:1.4},"water-label":{color:"#35688d",haloColor:"#f7f7f7",haloWidth:1.4},"place-label":{color:"#404040",haloColor:"#ffffff",haloWidth:1.4},"poi-food":{color:"#737373",haloColor:"#ffffff",haloWidth:1.4,frameColor:"#737373",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{color:"#737373",haloColor:"#ffffff",haloWidth:1.4,frameColor:"#737373",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{color:"#737373",haloColor:"#ffffff",haloWidth:1.4,frameColor:"#737373",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{color:"#737373",haloColor:"#ffffff",haloWidth:1.4,frameColor:"#737373",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{color:"#737373",haloColor:"#ffffff",haloWidth:1.4,frameColor:"#737373",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{color:"#737373",haloColor:"#ffffff",haloWidth:1.4,frameColor:"#737373",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{color:"#737373",haloColor:"#ffffff",haloWidth:1.4,frameColor:"#737373",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{color:"#737373",haloColor:"#ffffff",haloWidth:1.4,frameColor:"#737373",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{color:"#737373",haloColor:"#ffffff",haloWidth:1.4,frameColor:"#737373",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"water-pool":{color:"#e8eff4"},"indoor-shell":{color:"#f7f7f7",opacity:.97},"indoor-corridor":{color:"#fbfbfb"},"indoor-room":{color:"#efefef"},"indoor-service":{color:"#dbdbdb"},"indoor-shop":{color:"#e4dfea"},"indoor-food":{color:"#eae4df"},"indoor-wc":{color:"#dfe5ea"},"indoor-wall":{color:"#cdcdcd",roofColor:"#e2e2e2",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#d0cbdc",opacity:.95},"indoor-door":{color:"#737373",haloColor:"#ffffff",haloWidth:1.4},"indoor-poi":{color:"#737373",haloColor:"#ffffff",haloWidth:1.4},"indoor-name":{color:"#404040",haloColor:"#ffffff",haloWidth:1.4},"building-entrance":{color:"#564e4e",haloColor:"#ffffff"}},sky:{skyColor:"#a4c0d4",horizonColor:"#e6e6e6",fogRange:[2.43,10.04],fogIntensity:.85,spaceColor:"#0d0d0d",atmosphereColor:"#5fa1d1",starIntensity:.37}};var su={name:"\u041E\u043A\u0435\u0430\u043D",background:"#d7e3ea",light:{ambientColor:"#f3f4f4",ambientIntensity:.47,keyAzimuth:120,keyAltitude:60,keyColor:"#e8f6ff",keyIntensity:.59,fillAzimuth:300,fillAltitude:25,fillColor:"#d8e4ea",fillIntensity:.18},paint:{"landcover-wood":{color:"#75c7c7"},"landcover-grass":{color:"#97d8d2"},"landcover-sand":{color:"#efeac8"},"landcover-ice":{color:"#accedf"},"landcover-wetland":{color:"#a5d0d4"},"landuse-residential":{color:"#dfe8ec"},"landuse-industrial":{color:"#cbcedc"},"landuse-civic":{color:"#e3c9d2"},"landuse-sport":{color:"#90dfcb"},"landuse-cemetery":{color:"#a6d9d4"},"landuse-parking":{color:"#cfd2d3"},park:{color:"#97d8d2"},"aeroway-area":{color:"#d6dbeb"},water:{color:"#30abe8"},waterway:{color:"#3eb0ea"},"aeroway-line":{color:"#f0ede9"},"road-casing-major":{color:"#47a3c2"},"road-casing-secondary":{color:{stops:[[16,"#8ab2c7"],[18.5,"#47a3c2"]]}},"road-casing-minor":{color:{stops:[[16,"#8ab2c7"],[18.5,"#47a3c2"]]}},"road-rail":{color:"#8a9ea8"},"road-path":{color:"#b8d3e0"},"road-minor":{color:{stops:[[16,"#b8d3e0"],[18.5,"#79c0d8"]]}},"road-secondary":{color:{stops:[[16,"#b8d3e0"],[18.5,"#79c0d8"]]}},"road-ramp":{color:"#79c0d8"},"road-major":{color:"#79c0d8"},boundary:{color:"#47bad1"},building:{color:"#d2dee4",roofColor:"#e7f0f3",aoStrength:.19,tintVariation:.06,windowColor:"#6b9ed1",windowFrameColor:"#e6f0f6",windowGlow:0},housenumber:{color:"#1f3c51",haloColor:"#f8fbfc",haloWidth:1.4},poi:{color:"#3b7b9b",haloColor:"#f8fbfc",haloWidth:1.4},"road-label":{color:"#1f3c51",haloColor:"#f8fbfc",haloWidth:1.4},"water-label":{color:"#35688d",haloColor:"#f7f7f7",haloWidth:1.4},"place-label":{color:"#1f3c51",haloColor:"#f8fbfc",haloWidth:1.4},"poi-food":{haloColor:"#f8fbfc",haloWidth:1.4,frameColor:"#c2681c",frameOpacity:1,frameHaloColor:"#f8fbfc",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{haloColor:"#f8fbfc",haloWidth:1.4,frameColor:"#2f77c4",frameOpacity:1,frameHaloColor:"#f8fbfc",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{haloColor:"#f8fbfc",haloWidth:1.4,frameColor:"#3b82a6",frameOpacity:1,frameHaloColor:"#f8fbfc",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{haloColor:"#f8fbfc",haloWidth:1.4,frameColor:"#c24444",frameOpacity:1,frameHaloColor:"#f8fbfc",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{haloColor:"#f8fbfc",haloWidth:1.4,frameColor:"#3f7f7a",frameOpacity:1,frameHaloColor:"#f8fbfc",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{haloColor:"#f8fbfc",haloWidth:1.4,frameColor:"#8b5aa5",frameOpacity:1,frameHaloColor:"#f8fbfc",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{haloColor:"#f8fbfc",haloWidth:1.4,frameColor:"#4f8b45",frameOpacity:1,frameHaloColor:"#f8fbfc",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{haloColor:"#f8fbfc",haloWidth:1.4,frameColor:"#7a5fbf",frameOpacity:1,frameHaloColor:"#f8fbfc",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{haloColor:"#f8fbfc",haloWidth:1.4,frameColor:"#59636e",frameOpacity:1,frameHaloColor:"#f8fbfc",iconColor:"#ffffff",iconHaloWidth:0},"water-pool":{color:"#38b3f1"},"indoor-shell":{color:"#e5e9eb",opacity:.97},"indoor-corridor":{color:"#eaeeef"},"indoor-room":{color:"#dce2e5"},"indoor-service":{color:"#c6cfd4"},"indoor-shop":{color:"#d6cede"},"indoor-food":{color:"#ded6ce"},"indoor-wc":{color:"#ced8de"},"indoor-wall":{color:"#bac1c4",roofColor:"#d0d4d6",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#c1b9d1",opacity:.95},"indoor-door":{color:"#3b7b9b",haloColor:"#f8fbfc",haloWidth:1.4},"indoor-poi":{color:"#3b7b9b",haloColor:"#f8fbfc",haloWidth:1.4},"indoor-name":{color:"#1f3c51",haloColor:"#f8fbfc",haloWidth:1.4},"building-entrance":{color:"#225aaa",haloColor:"#f8fbfc"}},sky:{skyColor:"#7aaac1",horizonColor:"#c1cfd6",fogRange:[2.41,9.82],fogIntensity:.86,spaceColor:"#080d0f",atmosphereColor:"#5aa8cf",starIntensity:.41}};var lu={name:"\u041F\u0440\u0435\u043C\u0438\u0443\u043C",background:"#211f1c",model3dKey:"night",light:{ambientColor:"#b0aaa4",ambientIntensity:.34,keyAzimuth:120,keyAltitude:55,keyColor:"#c8b48a",keyIntensity:.3,fillAzimuth:300,fillAltitude:25,fillColor:"#496887",fillIntensity:.22},paint:{"landcover-wood":{color:"#1b271b"},"landcover-grass":{color:"#232f23"},"landcover-sand":{color:"#393622"},"landcover-ice":{color:"#2d3d4c"},"landcover-wetland":{color:"#213436"},"landuse-residential":{color:"#272421"},"landuse-industrial":{color:"#242633"},"landuse-civic":{color:"#332429"},"landuse-sport":{color:"#22331f"},"landuse-cemetery":{color:"#213021"},"landuse-parking":{color:"#383633"},park:{color:"#232f23"},"aeroway-area":{color:"#272a35"},water:{color:"#16293b"},waterway:{color:"#1c334a"},"aeroway-line":{color:"#55493a"},"road-casing-major":{color:"#856e32"},"road-casing-secondary":{color:{stops:[[16,"#423b2e"],[18.5,"#856e32"]]}},"road-casing-minor":{color:{stops:[[16,"#423b2e"],[18.5,"#856e32"]]}},"road-rail":{color:"#6b6457"},"road-path":{color:"#5e5645"},"road-minor":{color:{stops:[[16,"#5e5645"],[18.5,"#bf9e4a"]]}},"road-secondary":{color:{stops:[[16,"#5e5645"],[18.5,"#bf9e4a"]]}},"road-ramp":{color:"#bf9e4a"},"road-major":{color:"#bf9e4a"},boundary:{color:"#d1aa47"},building:{color:"#443b2c",roofColor:"#726037",aoStrength:.29,tintVariation:.1,windowColor:"#8fb8e8",windowFrameColor:"#eef0f4",windowGlow:.36},housenumber:{color:"#eae3d7",haloColor:"#181410",haloWidth:1.4},poi:{color:"#d4bb7d",haloColor:"#181410",haloWidth:1.4},"road-label":{color:"#eae3d7",haloColor:"#181410",haloWidth:1.4},"water-label":{color:"#9fbcd1",haloColor:"#131b20",haloWidth:1.4},"place-label":{color:"#eae3d7",haloColor:"#181410",haloWidth:1.4},"poi-food":{color:"#d89964",haloColor:"#181410",haloWidth:1.4,frameColor:"#d89964",frameOpacity:1,frameHaloColor:"#181410",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-shop":{color:"#699cd4",haloColor:"#181410",haloWidth:1.4,frameColor:"#699cd4",frameOpacity:1,frameHaloColor:"#181410",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-transport":{color:"#75acc8",haloColor:"#181410",haloWidth:1.4,frameColor:"#75acc8",frameOpacity:1,frameHaloColor:"#181410",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-health":{color:"#ca7272",haloColor:"#181410",haloWidth:1.4,frameColor:"#ca7272",frameOpacity:1,frameHaloColor:"#181410",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-education":{color:"#81bbb7",haloColor:"#181410",haloWidth:1.4,frameColor:"#81bbb7",frameOpacity:1,frameHaloColor:"#181410",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-culture":{color:"#a684b8",haloColor:"#181410",haloWidth:1.4,frameColor:"#a684b8",frameOpacity:1,frameHaloColor:"#181410",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-sport":{color:"#89bb81",haloColor:"#181410",haloWidth:1.4,frameColor:"#89bb81",frameOpacity:1,frameHaloColor:"#181410",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-lodging":{color:"#8e79c3",haloColor:"#181410",haloWidth:1.4,frameColor:"#8e79c3",frameOpacity:1,frameHaloColor:"#181410",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-service":{color:"#959ea7",haloColor:"#181410",haloWidth:1.4,frameColor:"#959ea7",frameOpacity:1,frameHaloColor:"#181410",iconColor:"#1b1b1b",iconHaloWidth:0},"water-pool":{color:"#1c3752"},"indoor-shell":{color:"#564b39",opacity:.97},"indoor-corridor":{color:"#504635"},"indoor-room":{color:"#605440"},"indoor-service":{color:"#7b6c52"},"indoor-shop":{color:"#5c4672"},"indoor-food":{color:"#725d46"},"indoor-wc":{color:"#466172"},"indoor-wall":{color:"#857a68",roofColor:"#9a9285",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#66558a",opacity:.95},"indoor-door":{color:"#d4bb7d",haloColor:"#181410",haloWidth:1.4},"indoor-poi":{color:"#d4bb7d",haloColor:"#181410",haloWidth:1.4},"indoor-name":{color:"#eae3d7",haloColor:"#181410",haloWidth:1.4},"building-entrance":{color:"#79a0d7",haloColor:"#181410"}},sky:{skyColor:"#09121b",horizonColor:"#2c2a27",fogRange:[2.34,8.79],fogIntensity:.9,spaceColor:"#060606",atmosphereColor:"#3679b9",starIntensity:.79}};var cu={name:"\u0420\u0435\u0430\u043B\u0438\u0441\u0442\u0438\u0447\u043D\u0430\u044F",background:"#d6dac8",light:{ambientColor:"#eeeeed",ambientIntensity:.46,keyAzimuth:120,keyAltitude:59,keyColor:"#fff0d8",keyIntensity:.57,fillAzimuth:300,fillAltitude:25,fillColor:"#cbd9e3",fillIntensity:.18},paint:{"landcover-wood":{color:"#62a63f"},"landcover-grass":{color:"#8dbf69"},"landcover-sand":{color:"#efeac8"},"landcover-ice":{color:"#b4c9d7"},"landcover-wetland":{color:"#75b7bd"},"landuse-residential":{color:"#d6d1c2"},"landuse-industrial":{color:"#b9bdd0"},"landuse-civic":{color:"#d9b5c1"},"landuse-sport":{color:"#8bc95e"},"landuse-cemetery":{color:"#95c374"},"landuse-parking":{color:"#c3c5bf"},park:{color:"#8dbf69"},"aeroway-area":{color:"#d6dbeb"},water:{color:"#4d97cb"},waterway:{color:"#599ecf"},"aeroway-line":{color:"#f0ede9"},"road-casing-major":{color:"#856b47"},"road-casing-secondary":{color:{stops:[[16,"#766b60"],[18.5,"#856b47"]]}},"road-casing-minor":{color:{stops:[[16,"#766b60"],[18.5,"#856b47"]]}},"road-rail":{color:"#666666"},"road-path":{color:"#9c948b"},"road-minor":{color:{stops:[[16,"#9c948b"],[18.5,"#ccaa66"]]}},"road-secondary":{color:{stops:[[16,"#9c948b"],[18.5,"#ccaa66"]]}},"road-ramp":{color:"#ccaa66"},"road-major":{color:"#ccaa66"},boundary:{color:"#8a735c"},building:{color:"#cdc4b7",roofColor:"#cdc4b7",aoStrength:.2,tintVariation:.07,windowColor:"#9fb0c0",windowFrameColor:"#eceef2",windowGlow:0},housenumber:{color:"#3b332b",haloColor:"#f5f5f0",haloWidth:1.4},poi:{color:"#735c45",haloColor:"#f5f5f0",haloWidth:1.4},"road-label":{color:"#3b332b",haloColor:"#f5f5f0",haloWidth:1.4},"water-label":{color:"#35688d",haloColor:"#f7f7f7",haloWidth:1.4},"place-label":{color:"#3b332b",haloColor:"#f5f5f0",haloWidth:1.4},"poi-food":{haloColor:"#f5f5f0",haloWidth:1.4,frameColor:"#c2681c",frameOpacity:1,frameHaloColor:"#f5f5f0",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{haloColor:"#f5f5f0",haloWidth:1.4,frameColor:"#2f77c4",frameOpacity:1,frameHaloColor:"#f5f5f0",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{haloColor:"#f5f5f0",haloWidth:1.4,frameColor:"#3b82a6",frameOpacity:1,frameHaloColor:"#f5f5f0",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{haloColor:"#f5f5f0",haloWidth:1.4,frameColor:"#c24444",frameOpacity:1,frameHaloColor:"#f5f5f0",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{haloColor:"#f5f5f0",haloWidth:1.4,frameColor:"#3f7f7a",frameOpacity:1,frameHaloColor:"#f5f5f0",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{haloColor:"#f5f5f0",haloWidth:1.4,frameColor:"#8b5aa5",frameOpacity:1,frameHaloColor:"#f5f5f0",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{haloColor:"#f5f5f0",haloWidth:1.4,frameColor:"#4f8b45",frameOpacity:1,frameHaloColor:"#f5f5f0",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{haloColor:"#f5f5f0",haloWidth:1.4,frameColor:"#7a5fbf",frameOpacity:1,frameHaloColor:"#f5f5f0",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{haloColor:"#f5f5f0",haloWidth:1.4,frameColor:"#59636e",frameOpacity:1,frameHaloColor:"#f5f5f0",iconColor:"#ffffff",iconHaloWidth:0},"water-pool":{color:"#559fd3"},"indoor-shell":{color:"#d6d0c9",opacity:.97},"indoor-corridor":{color:"#dad5ce"},"indoor-room":{color:"#cfc9c0"},"indoor-service":{color:"#beb6a9"},"indoor-shop":{color:"#bdb0ca"},"indoor-food":{color:"#cabeb0"},"indoor-wc":{color:"#b0c0ca"},"indoor-wall":{color:"#ada79e",roofColor:"#bfbbb6",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#a69bbd",opacity:.95},"indoor-door":{color:"#735c45",haloColor:"#f5f5f0",haloWidth:1.4},"indoor-poi":{color:"#735c45",haloColor:"#f5f5f0",haloWidth:1.4},"indoor-name":{color:"#3b332b",haloColor:"#f5f5f0",haloWidth:1.4},"building-entrance":{haloColor:"#f5f5f0"}},sky:{skyColor:"#5f92b7",horizonColor:"#bfc4b1",fogRange:[2.39,9.68],fogIntensity:.87,spaceColor:"#0d0e09",atmosphereColor:"#569dce",starIntensity:.44}};var fu={name:"\u041A\u043E\u0441\u043C\u043E\u0441",background:"#0c0a1a",model3dKey:"night",light:{ambientColor:"#8c7fcb",ambientIntensity:.34,keyAzimuth:120,keyAltitude:55,keyColor:"#c0a8ff",keyIntensity:.28,fillAzimuth:300,fillAltitude:25,fillColor:"#475385",fillIntensity:.22},paint:{"landcover-wood":{color:"#241730"},"landcover-grass":{color:"#2e203c"},"landcover-sand":{color:"#292719"},"landcover-ice":{color:"#2e365b"},"landcover-wetland":{color:"#172526"},"landuse-residential":{color:"#110e20"},"landuse-industrial":{color:"#191b24"},"landuse-civic":{color:"#24191d"},"landuse-sport":{color:"#281c40"},"landuse-cemetery":{color:"#1c1721"},"landuse-parking":{color:"#27272b"},park:{color:"#2e203c"},"aeroway-area":{color:"#1c1f26"},water:{color:"#121c49"},waterway:{color:"#16225a"},"aeroway-line":{color:"#55493a"},"road-casing-major":{color:"#7e279b"},"road-casing-secondary":{color:{stops:[[16,"#3a2060"],[18.5,"#7e279b"]]}},"road-casing-minor":{color:{stops:[[16,"#3a2060"],[18.5,"#7e279b"]]}},"road-rail":{color:"#985298"},"road-path":{color:"#6b35b6"},"road-minor":{color:{stops:[[16,"#6b35b6"],[18.5,"#bf4ce6"]]}},"road-secondary":{color:{stops:[[16,"#6b35b6"],[18.5,"#bf4ce6"]]}},"road-ramp":{color:"#bf4ce6"},"road-major":{color:"#bf4ce6"},boundary:{color:"#ec51b8"},building:{color:"#2a2145",roofColor:"#7f30a6",aoStrength:.29,tintVariation:.1,windowColor:"#84dcff",windowFrameColor:"#9fb0d8",windowGlow:.5},housenumber:{color:"#dbd1f0",haloColor:"#080614",haloWidth:1.4},poi:{color:"#d186ea",haloColor:"#080614",haloWidth:1.4},"road-label":{color:"#dbd1f0",haloColor:"#080614",haloWidth:1.4},"water-label":{color:"#9fbcd1",haloColor:"#131b20",haloWidth:1.4},"place-label":{color:"#dbd1f0",haloColor:"#080614",haloWidth:1.4},"poi-food":{color:"#d89964",haloColor:"#080614",haloWidth:1.4,frameColor:"#d89964",frameOpacity:1,frameHaloColor:"#080614",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-shop":{color:"#699cd4",haloColor:"#080614",haloWidth:1.4,frameColor:"#699cd4",frameOpacity:1,frameHaloColor:"#080614",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-transport":{color:"#75acc8",haloColor:"#080614",haloWidth:1.4,frameColor:"#75acc8",frameOpacity:1,frameHaloColor:"#080614",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-health":{color:"#ca7272",haloColor:"#080614",haloWidth:1.4,frameColor:"#ca7272",frameOpacity:1,frameHaloColor:"#080614",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-education":{color:"#81bbb7",haloColor:"#080614",haloWidth:1.4,frameColor:"#81bbb7",frameOpacity:1,frameHaloColor:"#080614",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-culture":{color:"#a684b8",haloColor:"#080614",haloWidth:1.4,frameColor:"#a684b8",frameOpacity:1,frameHaloColor:"#080614",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-sport":{color:"#89bb81",haloColor:"#080614",haloWidth:1.4,frameColor:"#89bb81",frameOpacity:1,frameHaloColor:"#080614",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-lodging":{color:"#8e79c3",haloColor:"#080614",haloWidth:1.4,frameColor:"#8e79c3",frameOpacity:1,frameHaloColor:"#080614",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-service":{color:"#959ea7",haloColor:"#080614",haloWidth:1.4,frameColor:"#959ea7",frameOpacity:1,frameHaloColor:"#080614",iconColor:"#1b1b1b",iconHaloWidth:0},"water-pool":{color:"#152466"},"indoor-shell":{color:"#403956",opacity:.97},"indoor-corridor":{color:"#3c3550"},"indoor-room":{color:"#484060"},"indoor-service":{color:"#5c527b"},"indoor-shop":{color:"#5c4672"},"indoor-food":{color:"#725d46"},"indoor-wc":{color:"#466172"},"indoor-wall":{color:"#6f6885",roofColor:"#8a859a",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#66558a",opacity:.95},"indoor-door":{color:"#d186ea",haloColor:"#080614",haloWidth:1.4},"indoor-poi":{color:"#d186ea",haloColor:"#080614",haloWidth:1.4},"indoor-name":{color:"#dbd1f0",haloColor:"#080614",haloWidth:1.4},"building-entrance":{color:"#79a0d7",haloColor:"#080614"}},sky:{skyColor:"#080b18",horizonColor:"#1d1931",fogRange:[2.34,8.77],fogIntensity:.9,spaceColor:"#040308",atmosphereColor:"#354cb6",starIntensity:.82}};var uu={name:"\u0412\u0443\u043B\u043A\u0430\u043D",background:"#29211e",model3dKey:"night",light:{ambientColor:"#b6a6a1",ambientIntensity:.35,keyAzimuth:120,keyAltitude:55,keyColor:"#ffb070",keyIntensity:.29,fillAzimuth:300,fillAltitude:25,fillColor:"#8b604b",fillIntensity:.22},paint:{"landcover-wood":{color:"#31241c"},"landcover-grass":{color:"#392e22"},"landcover-sand":{color:"#403c26"},"landcover-ice":{color:"#aa6b4b"},"landcover-wetland":{color:"#243b3d"},"landuse-residential":{color:"#2f2623"},"landuse-industrial":{color:"#282b39"},"landuse-civic":{color:"#39282e"},"landuse-sport":{color:"#3e2e1e"},"landuse-cemetery":{color:"#362e26"},"landuse-parking":{color:"#3e3938"},park:{color:"#392e22"},"aeroway-area":{color:"#2b2f3b"},water:{color:"#8b3f18"},waterway:{color:"#9c461c"},"aeroway-line":{color:"#55493a"},"road-casing-major":{color:"#aa350e"},"road-casing-secondary":{color:{stops:[[16,"#712b14"],[18.5,"#aa350e"]]}},"road-casing-minor":{color:{stops:[[16,"#712b14"],[18.5,"#aa350e"]]}},"road-rail":{color:"#8f583d"},"road-path":{color:"#e65e19"},"road-minor":{color:{stops:[[16,"#e65e19"],[18.5,"#f98c1f"]]}},"road-secondary":{color:{stops:[[16,"#e65e19"],[18.5,"#f98c1f"]]}},"road-ramp":{color:"#f98c1f"},"road-major":{color:"#f98c1f"},boundary:{color:"#f48c25"},building:{color:"#422b24",roofColor:"#c1551f",aoStrength:.28,tintVariation:.09,windowColor:"#84dcff",windowFrameColor:"#d8b0a0",windowGlow:.5},housenumber:{color:"#f3e0ce",haloColor:"#150b09",haloWidth:1.4},poi:{color:"#f09e4c",haloColor:"#150b09",haloWidth:1.4},"road-label":{color:"#f3e0ce",haloColor:"#150b09",haloWidth:1.4},"water-label":{color:"#9fbcd1",haloColor:"#131b20",haloWidth:1.4},"place-label":{color:"#f3e0ce",haloColor:"#150b09",haloWidth:1.4},"poi-food":{color:"#d89964",haloColor:"#150b09",haloWidth:1.4,frameColor:"#d89964",frameOpacity:1,frameHaloColor:"#150b09",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-shop":{color:"#699cd4",haloColor:"#150b09",haloWidth:1.4,frameColor:"#699cd4",frameOpacity:1,frameHaloColor:"#150b09",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-transport":{color:"#75acc8",haloColor:"#150b09",haloWidth:1.4,frameColor:"#75acc8",frameOpacity:1,frameHaloColor:"#150b09",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-health":{color:"#ca7272",haloColor:"#150b09",haloWidth:1.4,frameColor:"#ca7272",frameOpacity:1,frameHaloColor:"#150b09",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-education":{color:"#81bbb7",haloColor:"#150b09",haloWidth:1.4,frameColor:"#81bbb7",frameOpacity:1,frameHaloColor:"#150b09",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-culture":{color:"#a684b8",haloColor:"#150b09",haloWidth:1.4,frameColor:"#a684b8",frameOpacity:1,frameHaloColor:"#150b09",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-sport":{color:"#89bb81",haloColor:"#150b09",haloWidth:1.4,frameColor:"#89bb81",frameOpacity:1,frameHaloColor:"#150b09",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-lodging":{color:"#8e79c3",haloColor:"#150b09",haloWidth:1.4,frameColor:"#8e79c3",frameOpacity:1,frameHaloColor:"#150b09",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-service":{color:"#959ea7",haloColor:"#150b09",haloWidth:1.4,frameColor:"#959ea7",frameOpacity:1,frameHaloColor:"#150b09",iconColor:"#1b1b1b",iconHaloWidth:0},"water-pool":{color:"#c2531a"},"indoor-shell":{color:"#564039",opacity:.97},"indoor-corridor":{color:"#503b35"},"indoor-room":{color:"#604840"},"indoor-service":{color:"#7b5c52"},"indoor-shop":{color:"#5c4672"},"indoor-food":{color:"#725d46"},"indoor-wc":{color:"#466172"},"indoor-wall":{color:"#856f68",roofColor:"#9a8a85",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#66558a",opacity:.95},"indoor-door":{color:"#f09e4c",haloColor:"#150b09",haloWidth:1.4},"indoor-poi":{color:"#f09e4c",haloColor:"#150b09",haloWidth:1.4},"indoor-name":{color:"#f3e0ce",haloColor:"#150b09",haloWidth:1.4},"building-entrance":{color:"#79a0d7",haloColor:"#150b09"}},sky:{skyColor:"#1c100a",horizonColor:"#312a27",fogRange:[2.34,8.8],fogIntensity:.9,spaceColor:"#070605",atmosphereColor:"#ba6336",starIntensity:.78}};var hu={name:"\u0411\u0435\u043B\u0430\u044F",background:"#f5f1f0",light:{ambientColor:"#fafafa",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#ffffff",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#dee8ed",fillIntensity:.18},paint:{"landcover-wood":{color:"#a7e2a2"},"landcover-grass":{color:"#b8ebad"},"landcover-sand":{color:"#efeac8"},"landcover-ice":{color:"#d7eaf4"},"landcover-wetland":{color:"#c1dee1"},"landuse-residential":{color:"#f6f4f4"},"landuse-industrial":{color:"#e0e2eb"},"landuse-civic":{color:"#efe1e6"},"landuse-sport":{color:"#c0f0a8"},"landuse-cemetery":{color:"#c8e5c2"},"landuse-parking":{color:"#e4e2e2"},park:{color:"#b8ebad"},"aeroway-area":{color:"#d6dbeb"},water:{color:"#99ddff"},waterway:{color:"#99ddff"},"aeroway-line":{color:"#f0ede9"},"road-casing-major":{color:"#94a0b8"},"road-casing-secondary":{color:{stops:[[16,"#a3adc2"],[18.5,"#94a0b8"]]}},"road-casing-minor":{color:{stops:[[16,"#a3adc2"],[18.5,"#94a0b8"]]}},"road-rail":{color:"#a6a6a6"},"road-path":{color:"#bfc6d9"},"road-minor":{color:{stops:[[16,"#bfc6d9"],[18.5,"#a1b0c4"]]}},"road-secondary":{color:{stops:[[16,"#bfc6d9"],[18.5,"#a1b0c4"]]}},"road-ramp":{color:"#a1b0c4"},"road-major":{color:"#a1b0c4"},boundary:{color:"#f87797"},building:{color:"#ffffff",roofColor:"#ffffff",aoStrength:.19,tintVariation:.06,windowColor:"#6b9ed1",windowFrameColor:"#ffffff",windowGlow:0},housenumber:{color:"#262626",haloColor:"#ffffff",haloWidth:1.4},poi:{color:"#586e84",haloColor:"#ffffff",haloWidth:1.4},"road-label":{color:"#262626",haloColor:"#ffffff",haloWidth:1.4},"water-label":{color:"#35688d",haloColor:"#f7f7f7",haloWidth:1.4},"place-label":{color:"#262626",haloColor:"#ffffff",haloWidth:1.4},"poi-food":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#c2681c",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#2f77c4",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#3b82a6",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#c24444",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#3f7f7a",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#8b5aa5",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#4f8b45",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#7a5fbf",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#59636e",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"water-pool":{color:"#b1e5ff"},"indoor-shell":{color:"#f7f7f7",opacity:.97},"indoor-corridor":{color:"#fbfbfb"},"indoor-room":{color:"#efefef"},"indoor-service":{color:"#dbdbdb"},"indoor-shop":{color:"#e4dfea"},"indoor-food":{color:"#eae4df"},"indoor-wc":{color:"#dfe5ea"},"indoor-wall":{color:"#cdcdcd",roofColor:"#e2e2e2",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#d0cbdc",opacity:.95},"indoor-door":{color:"#586e84",haloColor:"#ffffff",haloWidth:1.4},"indoor-poi":{color:"#586e84",haloColor:"#ffffff",haloWidth:1.4},"indoor-name":{color:"#262626",haloColor:"#ffffff",haloWidth:1.4},"building-entrance":{color:"#225aaa",haloColor:"#ffffff"}},sky:{skyColor:"#9bbecf",horizonColor:"#e5dfdc",fogRange:[2.43,9.99],fogIntensity:.85,spaceColor:"#0f0c0a",atmosphereColor:"#5eaad0",starIntensity:.38}};var du={"3d":Xf,cartoon:Jf,cyberpunk:jf,dawn:Yf,dusk:Zf,earth:qf,future:Qf,"glass-refined":$f,glass:eu,"harmony-black":tu,"harmony-blue":ou,"harmony-green":ru,lunar:nu,matte:iu,minimal:au,ocean:su,premium:lu,realistic:cu,space:fu,volcano:uu,white:hu};function wi(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 De="base",mu="\u241F",Ot=(n,e)=>n+"\u241F"+String(e);function F1(n){for(let e of n){if(e.type!=="line"||!e.yieldTo)continue;let t=n.find(o=>o.id===e.yieldTo);t?.type!=="surface"&&console.warn(`[osmgl] \u0441\u043B\u043E\u0439 \xAB${e.id}\xBB \u0443\u0441\u0442\u0443\u043F\u0430\u0435\u0442 \xAB${e.yieldTo}\xBB, \u0430 \u044D\u0442\u043E `+(t?`\u0441\u043B\u043E\u0439 \u0442\u0438\u043F\u0430 \xAB${t.type}\xBB \u2014 \u0443\u0441\u0442\u0443\u043F\u0438\u0442\u044C \u043C\u043E\u0436\u043D\u043E \u0442\u043E\u043B\u044C\u043A\u043E \u043F\u043E\u0432\u0435\u0440\u0445\u043D\u043E\u0441\u0442\u0438`:"\u043D\u0435 \u0441\u043B\u043E\u0439 \u044D\u0442\u043E\u0433\u043E \u0441\u0442\u0438\u043B\u044F"));}}var Xo=class{constructor(e=vi){this.splitValues={};this.spec=e,this.light={...ms,...e.light??{}},this.sky={...ds,...e.sky??{}},this.layers=e.layers.map(t=>({...t,paint:{...t.paint}})),F1(this.layers);}lineLevelHeight(){return this.layers.some(t=>t.type==="surface"&&t.fromLines===true)?this.spec.levelHeight??0:0}get background(){return Ve(this.spec.background??"#eceae4")}colorAt(e,t,o=[1,0,1,1]){let i=e.paint?.color;if(i&&typeof i=="object"&&"from"in i){let s=this.layers.find(f=>f.id===i.from)?.paint?.[i.property??"color"],l=ht(s,t,o),c=1-Math.min(Math.max(i.darken??0,0),1);return [l[0]*c,l[1]*c,l[2]*c,l[3]]}return ht(i,t,o)}layerVisibleAt(e,t){return !(e.visible===false||e.minzoom!==void 0&&t<e.minzoom||e.maxzoom!==void 0&&t>=e.maxzoom)}workerPlan(e=De){return this.layers.filter(t=>t.type!=="raster").filter(t=>(t.source??De)===e).map(t=>({id:t.id,type:t.type,sourceLayer:t["source-layer"],filter:t.filter,minzoom:t.minzoom??0,maxzoom:t.maxzoom??24,...t.splitBy?{splitBy:t.splitBy}:{},...t.type==="line"&&t.network?{network:t.network}:{},...t.cornerRadius?{cornerRadius:t.cornerRadius,cornerSegments:t.cornerSegments}:{},...t.clipToTile?{clipToTile:true}:{},...t.groundBy?{groundBy:t.groundBy}:{},...t.type==="surface"?{elevation:t.elevation,base:t.base,bevel:t.bevel,bevelDrop:t.bevelDrop,weld:t.weld,...t.groundField===false?{groundField:false}:{},levelHeight:this.spec.levelHeight,...t.deck?{deck:t.deck}:{},...t.fromLines?{fromLines:true,width:t.width,widthExtra:t.widthExtra}:{}}:{},...t.type==="line"&&typeof t.paint?.elevation=="number"&&t.paint.elevation>0?{ground:true}:{},...I1(t),...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??De))]}bucketKeyFor(e){if(e.type==="raster"||!e.splitBy)return e.id;let t=this.splitValues[e.splitBy];return t===void 0?null:Ot(e.id,t)}sourceLayers(){return [...new Set(this.layers.flatMap(e=>e.type==="raster"?[]:[e["source-layer"]]))]}};function jt(n){if(n.type!=="fill"&&n.type!=="line"&&n.type!=="fill-extrusion")return null;let e=n.paint;if(!e)return null;let t=St(e.color)?e.color:void 0,o=St(e.opacity)?e.opacity:void 0,r=n.type==="line"&&St(e.width)?e.width:void 0;return t===void 0&&o===void 0&&r===void 0?null:(oi(t),oi(o),oi(r),{...t!==void 0?{color:t}:{},...o!==void 0?{opacity:o}:{},...r!==void 0?{width:r}:{},...t===void 0&&D1(e.color)?{base:e.color}:{}})}function I1(n){let e=jt(n);return e?{dataPaint:e}:{}}function D1(n){return n===void 0?false:typeof n=="string"||Array.isArray(n)?true:typeof n=="object"&&n!==null&&"stops"in n}var vi=Lf,T1=Of,k1=Rf,L1=Pf,R1=Hf;function P1(n,e,t){let o=/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i;if(typeof n!="string"||typeof e!="string")return n;let r=o.exec(n),i=o.exec(e);if(!r||!i)return n;let a=s=>{let l=Math.round(parseInt(r[s],16)*(1-t)+parseInt(i[s],16)*t);return Math.max(0,Math.min(255,l)).toString(16).padStart(2,"0")};return `#${a(1)}${a(2)}${a(3)}`}function Ci(n,e){if(typeof n!="string")return n;let t=/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i.exec(n);if(!t)return n;let o=r=>Math.round(parseInt(t[r],16)*e).toString(16).padStart(2,"0");return `#${o(1)}${o(2)}${o(3)}`}function ps(n,e,t,o){let r=n.paint?.building;return r?{...n,name:e,paint:{...n.paint,building:{...r,windowColor:Ci(r.color,t),windowGlow:0,...o}}}:{...n,name:e}}var bu=.93;function H1(n){let e=n.paint?.building;return e?{...n,paint:{...n.paint,building:{...e,windowFrameColor:Ci(e.color,bu)}}}:n}function O1(n){let e=n.paint,t=e?.building;if(!e||!t)return n;let o=t.color;if(typeof o!="string")return n;let r={ice:t.ice,aoStrength:t.aoStrength,tintVariation:t.tintVariation,seamStrength:t.seamStrength,roofVariation:t.roofVariation,windowFrameColor:t.windowFrameColor,facadeDetail:0},i=W1(n.background),a=(m,p)=>p<=1?Ci(m,p):P1(m,"#ffffff",p-1),s=o,l=a(o,i?1.05:.97),c=a(o,i?1.08:.96),f=a(c,i?1.18:1.1),u=a(o,i?.82:.94),h={...e};h["indoor-venue"]={...e["indoor-venue"]??{},...t},h["indoor-shell"]={...e["indoor-shell"]??{},color:u},h["indoor-wall"]={...e["indoor-wall"]??{},...r,color:c,roofColor:f},h["indoor-room"]={...e["indoor-room"]??{},...r,color:s},h["indoor-corridor"]={...e["indoor-corridor"]??{},...r,color:l},h["indoor-transportation"]={...e["indoor-transportation"]??{},...r,color:a(o,i?1.14:.93)};let d=pu("indoor-room");for(let m of ["indoor-shop","indoor-food","indoor-wc","indoor-service"]){let p=e[m]??{},{roofColor:b,...g}={...p,...r},y=pu(m);h[m]={...g,color:d&&y?z1(s,d,y,G1):s};}return {...n,paint:h}}var G1=.85;function pu(n){let e=vi.layers.find(t=>t.id===n)?.paint;return typeof e?.color=="string"?e.color:void 0}function z1(n,e,t,o){let r=/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i,i=r.exec(typeof n=="string"?n:""),a=r.exec(e),s=r.exec(t);if(!i||!a||!s)return n;let l=c=>{let f=Math.round(parseInt(i[c],16)+(parseInt(s[c],16)-parseInt(a[c],16))*o);return Math.max(0,Math.min(255,f)).toString(16).padStart(2,"0")};return `#${l(1)}${l(2)}${l(3)}`}function W1(n){let e=/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i.exec(typeof n=="string"?n:"");if(!e)return false;let[t,o,r]=[1,2,3].map(i=>parseInt(e[i],16)/255);return .2126*t+.7152*o+.0722*r<.45}function Bi(n){let e=n.paint?.building;return e?{...n,paint:{...n.paint,building:{...e,ice:1,seamStrength:0,windowFrameColor:Ci(e.color,bu)}}}:n}function N1(n){let e=n.paint?.building;return !e||typeof e.color!="string"?n:{...n,paint:{...n.paint,building:{...e,roofColor:e.color}}}}var je={day:{name:"\u0414\u043D\u0435\u0432\u043D\u0430\u044F"},night:Gf,mono:zf,pale:Nf,ice:Wf,...du,...Kf};je["3d"]=Bi(je["3d"]);je.night=Bi(je.night);je.ice=H1(je.ice);je["atlas-day"]=Bi(je["atlas-day"]);je["atlas-night"]=N1(Bi(je["atlas-night"]));je["3d-tone"]=ps(je["3d"],"\u0421\u0432\u0435\u0442\u043B\u0430\u044F, \u043E\u043A\u043D\u0430 \u0432 \u0442\u043E\u043D",1,{windowVariation:0,windowRecess:.12,windowRecessShade:0,seamStrength:0});je["night-tone"]=ps(je.night,"\u0422\u0451\u043C\u043D\u0430\u044F, \u043E\u043A\u043D\u0430 \u0432 \u0442\u043E\u043D",1,{windowVariation:1,seamStrength:0});je["ice-tone"]=ps(je.ice,"\u041B\u0435\u0434\u044F\u043D\u0430\u044F, \u043E\u043A\u043D\u0430 \u0432 \u0442\u043E\u043D",1,{windowVariation:0,windowRecess:.12,windowRecessShade:0,seamStrength:0});for(let n of Object.keys(je))je[n]=O1(je[n]);function Nr(n,e=vi){if(typeof n!="string")return wi(e,n);if(n==="day")return e;let t=je[n];return t?wi(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(je).join(", ")}`),e)}var Vr=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 gu(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 Ur=`
10
10
  uniform vec3 u_ambient_color;
11
11
  uniform float u_ambient_intensity;
12
12
  uniform vec3 u_key_dir; // \u043A\u0443\u0434\u0430 \u043B\u0435\u0442\u0438\u0442 \u0441\u0432\u0435\u0442 \u043A\u043B\u044E\u0447\u0435\u0432\u043E\u0433\u043E \u0438\u0441\u0442\u043E\u0447\u043D\u0438\u043A\u0430
@@ -2844,6 +2844,6 @@ void main() {
2844
2844
  if (color.a <= 0.001) discard;
2845
2845
  fragColor = color;
2846
2846
  }
2847
- `;var Mi=n=>n.kind==="symbol",Zu=n=>n.kind==="placement";function Zt(n,e,t,o){for(let r of n)for(let i=0;i+5<r.length;i+=6){let a=r[i],s=r[i+1],l=r[i+2],c=r[i+3],f=r[i+4],u=r[i+5];if(U1(e,t,a,s,l,c,f,u)||o>0&&(ws(e,t,a,s,l,c)<=o||ws(e,t,l,c,f,u)<=o||ws(e,t,f,u,a,s)<=o))return true}return false}function U1(n,e,t,o,r,i,a,s){let l=(n-r)*(o-i)-(t-r)*(e-i),c=(n-a)*(i-s)-(r-a)*(e-s),f=(n-t)*(s-o)-(a-t)*(e-o),u=l<0||c<0||f<0,h=l>0||c>0||f>0;return !(u&&h)}function ws(n,e,t,o,r,i){let a=r-t,s=i-o,l=a*a+s*s,c=l>0?Math.max(0,Math.min(1,((n-t)*a+(e-o)*s)/l)):0;return Math.hypot(n-(t+a*c),e-(o+s*c))}function vs(n,e){let t=new DataView(n.vertices),o=new Uint32Array(n.indices),r=e.bounds(),i=(r.maxX-r.minX)/n.extent,a=new Float64Array(o.length*2);for(let s=0;s<o.length;s++){let l=o[s]*Ft;a[s*2]=r.minX+t.getInt16(l,true)*i,a[s*2+1]=r.minY+t.getInt16(l+2,true)*i;}return a}function Cs(n,e,t){let o=new DataView(n.vertices),r=t.bounds(),i=(r.maxX-r.minX)/e,a=r.minX,s=r.minY,l=new Float64Array(n.indices.length*2);for(let c=0;c<n.indices.length;c++){let f=n.indices[c]*rt;l[c*2]=a+o.getInt16(f,true)*i,l[c*2+1]=s+o.getInt16(f+2,true)*i;}return l}var K1={stride:8,attribs:[{name:"a_pos",size:2,type:5126,offset:0}]},X1=40,J1=10.5,qu=2.5,j1=16,Y1=4,Z1=7,Xr=class{constructor(){this.vbo=null;this.ibo=null;this.vao=null;this.capacity=0;this.perArrow=0;this.indicesPerArrow=0;this.highlightFootprint=null;this.count=0;}render(e,t,o,r,i,a,s,l=false){this.count=0;let c=t.zoom,f=r.layers.filter(x=>x.type==="symbol"&&x.layout?.placement==="map"&&r.layerVisibleAt(x,c));if(!f.length)return;let u=t.center,h=Oe(u.lng),d=Ge(u.lat),m=t.worldSize>0?t.pixelsPerMeter/t.worldSize:0;if(!(m>0))return;let p=[];for(let x of f){let v=o.get(x.source??De);if(!v)continue;let w=r.bucketKeyFor(x);if(w===null)continue;let C=x.layout?.showFor==="highlight";if(C&&!this.highlightFootprint)continue;let B=m*1.5,T=x.layout?.arrowUnits==="meters"?m:1/t.worldSize,k=pe(x.layout?.arrowLength,c,X1)*T,K=pe(x.layout?.arrowWidth,c,J1)*T,P=pe(x.layout?.arrowOutline,c,qu)*T,W=pe(x.layout?.arrowGap,c,j1)*T,z=pe(x.layout?.arrowDotRadius,c,Y1)*T,L=pe(x.layout?.arrowDotGap,c,Z1)*T,X=Ms(k,K,z,W-L),Q=P>0?Ms(k,K,z,W-L,P).outline:null,G={layer:x,verts:[],shape:X};for(let Y of v.visibleTiles){let ee=v.getTile(Y)?.data?.buckets?.[w];if(!ee||!Mi(ee))continue;let ue=new Int16Array(ee.anchors),$=ee.rotations?new Int16Array(ee.rotations):null,Ae=Y.bounds(),ve=(Ae.maxX-Ae.minX)/ee.extent,he=Ae.minX,xe=Ae.minY;for(let de=0;de<ue.length/2;de++){let we=he+ue[de*2]*ve,I=xe+ue[de*2+1]*ve;if(C&&!Zt(this.highlightFootprint,we,I,B))continue;let J=($?$[de]:0)*Math.PI/180,Z=Math.sin(J),ce=-Math.cos(J),ae=we-h-Z*W,be=I-d-ce*W;Q&&_s(G,Q,ae,be,Z,ce),_s(G,X.outline,ae,be,Z,ce),this.count++;}}G.verts.length&&p.push(G);}if(!p.length)return;let b=p[0].shape,g=b.outline.length/2,y=[],A=[];for(let x of p){let v=y.length/2/g;for(let w of x.verts)y.push(w);A.push({layer:x.layer,first:v,count:x.verts.length/2/g});}if(this.ensureBuffers(e,y.length/2/g,b,a),!(!this.vao||!this.vbo)){this.vbo.update(new Uint8Array(new Float32Array(y).buffer)),i.use(),s?.(i),l&&i.setMat4("u_shadow_matrix",t.shadowObjectMatrix(h,d,0)),i.setMat4("u_matrix",t.objectMatrix(h,d,0)),e.setDepthTest(false),e.setDepthMask(false),e.setBlend("premultiplied"),e.setCull("none"),this.vao.bind();for(let x of A){let v=x.layer.paint,w=pe(v.opacity,c,1),C=k=>k&&typeof k=="object"&&"from"in k?void 0:k,B=ht(C(v.color),c,[.18,.45,.76,1]),_=ht(C(v.haloColor),c,[1,1,1,1]),T=pe(x.layer.layout?.arrowOutline,c,qu)>0;q1(e,i,x,_,B,w,T,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 Je(e,new Uint8Array(this.capacity*i*8),K1,true);let a=new Uint32Array(this.capacity*o.indices.length);for(let s=0;s<this.capacity;s++){let l=s*i;for(let c=0;c<o.indices.length;c++)a[s*o.indices.length+c]=l+o.indices[c];}this.ibo=new Ue(e,a),this.vao=new Ne(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 q1(n,e,t,o,r,i,a,s){let l=a?2:1;if(a){e.setVec4v("u_color",it([o[0],o[1],o[2],o[3]*i]));for(let c=0;c<t.count;c+=l)Qu(n,t.first+c,s);}e.setVec4v("u_color",it([r[0],r[1],r[2],r[3]*i]));for(let c=a?1:0;c<t.count;c+=l)Qu(n,t.first+c,s);}function Qu(n,e,t){n.gl.drawElements(n.gl.TRIANGLES,t,n.gl.UNSIGNED_INT,e*t*4);}var $u=4,Bs=12;function Ms(n,e,t,o,r=0){let i=n*.38,a=e*1.35,s=i*.3,l=e*.32,c=e/2,f=-n+l,u=[],h=(g,y)=>u.push(g,y);h(0,0),h(-i,a),h(-i+s,c),h(f,l);for(let g=1;g<$u;g++){let y=g/$u*Math.PI;h(f-Math.sin(y)*l,Math.cos(y)*l);}h(f,-l),h(-i+s,-c),h(-i,-a);let d=r>0?Q1(u,r):u,m=ot(u,void 0,2);if(t<=0)return {outline:d,indices:m};let p=d.length/2,b=t+r;for(let g=0;g<Bs;g++){let y=g/Bs*Math.PI*2;d.push(o+Math.cos(y)*b,Math.sin(y)*b);}for(let g=1;g<Bs-1;g++)m.push(p,p+g,p+g+1);return {outline:d,indices:m}}function Q1(n,e){let t=n.length/2,o=0;for(let a=0;a<t;a++){let s=(a+1)%t;o+=n[a*2]*n[s*2+1]-n[s*2]*n[a*2+1];}let r=o<0?-1:1,i=[];for(let a=0;a<t;a++){let s=n[(a+t-1)%t*2],l=n[(a+t-1)%t*2+1],c=n[a*2],f=n[a*2+1],u=n[(a+1)%t*2],h=n[(a+1)%t*2+1],d=Math.hypot(c-s,f-l)||1,m=Math.hypot(u-c,h-f)||1,p=r*(f-l)/d,b=-r*(c-s)/d,g=r*(h-f)/m,y=-r*(u-c)/m,A=p+g,x=b+y,v=Math.hypot(A,x);if(v<1e-9){i.push(c,f);continue}A/=v,x/=v;let w=Math.min(1/Math.max(A*p+x*b,.35),3);i.push(c+A*e*w,f+x*e*w);}return i}function _s(n,e,t,o,r,i){let a=-i,s=r;for(let l=0;l<e.length;l+=2){let c=e[l],f=e[l+1];n.verts.push(t+r*c+a*f,o+i*c+s*f);}}function $1(n,e,t,o,r,i=0,a=0){let s=t*Math.PI/180,l={verts:[]};return _s(l,Ms(o,r,i,a).outline,n,e,Math.sin(s),-Math.cos(s)),l.verts}var eb=5;function eh(n,e){let t=1/(1<<e),o=(1<<e)-1;return [(n.x&o)*t,(n.y&o)*t,t]}var _i=class{constructor(){this.anisotropy=0;this.anisotropyPname=0;this.anisotropyChecked=false;}render(e,t,o,r,i,a,s,l=false){if(!a.size)return;let c=i.layers.filter(f=>f.type==="raster"&&!!f.overlay===l&&i.layerVisibleAt(f,s));if(c.length){r.use(),e.setDepthTest(false),e.setDepthMask(false),e.setBlend("premultiplied"),e.setCull("none"),r.setInt("u_image",0);for(let f of c){let u=a.get(f.source);if(!u)continue;let h=pe(f.paint?.opacity,s,1);if(!(h<=.001)){r.setFloat("u_opacity",h),o.bind();for(let d of u.visibleTiles){let m=this.patchFor(e,u,d);m&&(e.bindTexture(0,m.texture),r.setVec3("u_uv_transform",m.uv[0],m.uv[1],m.uv[2]),r.setMat4("u_matrix",t.tileMatrix(d,1)),e.gl.drawElements(e.gl.TRIANGLES,6,e.gl.UNSIGNED_SHORT,0));}}}e.bindVAO(null);}}patchFor(e,t,o){let r=t.getTile(o),i=r&&r.state==="loaded"?this.textureFor(e,r):null;if(i)return {texture:i,uv:[0,0,1]};for(let a=1;a<=eb&&a<=o.z;a++){let s=o.scaledTo(o.z-a),l=t.getTile(s);if(!l||l.state!=="loaded")continue;let c=this.textureFor(e,l);if(c)return {texture:c,uv:eh(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 Ei=class{constructor(){this.shader=null;this.vao=null;this.vbo=null;this.textures=new Map;}render(e,t,o,r,i,a){if(!r.size)return;let s=o.layers.filter(u=>u.type==="raster"&&!!u.overlay===a&&r.has(u.source)&&o.layerVisibleAt(u,i));if(!s.length)return;let l=e.gl,c=this.ensureShader(e),f=this.ensureBuffers(e);c.use(),c.setInt("u_image",0),e.setDepthTest(false),e.setDepthMask(false),e.setBlend("premultiplied"),e.setCull("none"),f.bind();for(let u of s){let h=r.get(u.source);if(!h?.content)continue;let d=pe(u.paint?.opacity,i,1);if(d<=.001)continue;let m=this.textureFor(e,h);if(!m)continue;let[p,b]=h.corners[0],g=new Float32Array(16),y=[[0,0],[1,0],[1,1],[0,1]];for(let A=0;A<4;A++)g[A*4]=h.corners[A][0]-p,g[A*4+1]=h.corners[A][1]-b,g[A*4+2]=y[A][0],g[A*4+3]=y[A][1];this.vbo?.update(new Uint8Array(g.buffer)),e.bindTexture(0,m),c.setFloat("u_opacity",d),c.setMat4("u_matrix",t.objectMatrix(p,b,0)),l.drawElements(l.TRIANGLES,6,l.UNSIGNED_SHORT,0);}e.bindVAO(null);}destroy(e){for(let t of this.textures.values())e.gl.deleteTexture(t.texture);this.textures.clear(),this.vao?.destroy(),this.vbo?.destroy(),this.vao=null,this.vbo=null;}textureFor(e,t){let o=e.gl,r=t.content;if(!r)return null;let i=this.textures.get(t);if(!i){let a=o.createTexture();if(!a)return null;i={texture:a,version:-1},this.textures.set(t,i),e.bindTexture(0,a),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);}return (i.version!==t.version||t.live)&&(e.bindTexture(0,i.texture),o.pixelStorei(o.UNPACK_PREMULTIPLY_ALPHA_WEBGL,1),o.texImage2D(o.TEXTURE_2D,0,o.RGBA,o.RGBA,o.UNSIGNED_BYTE,r),o.pixelStorei(o.UNPACK_PREMULTIPLY_ALPHA_WEBGL,0),i.version=t.version),i.texture}ensureShader(e){return this.shader||(this.shader=new Ye(e,"media",Iu,Du)),this.shader}ensureBuffers(e){if(this.vao)return this.vao;let t={stride:16,attribs:[{name:"a_pos",size:2,type:5126,offset:0},{name:"a_uv",size:2,type:5126,offset:8}]};this.vbo=new Je(e,new Float32Array(16),t);let o=new Ue(e,new Uint16Array([0,1,2,0,2,3])),r=this.ensureShader(e),i=new Map;for(let a of t.attribs)i.set(a.name,r.attribLocation(a.name));return this.vao=new Ne(e,[{buffer:this.vbo,locations:i}],o),this.vao}};var tb="indoor-",Jr=class{constructor(){this.parts=null;this.stamp="";this.cache=new fe;this.box=null;this.hidden=new Le;this.collected=new Le;}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 h of t.layers){if(!h.id.startsWith(tb)||h.type!=="fill"||!t.layerVisibleAt(h,o))continue;let d=t.bucketKeyFor(h);d&&(r.push(d),i??(i=e.get(h.source??De)));}if(!r.length||!i){this.parts&&this.destroy();return}let a=r.join(",")+"|"+i.visibleTiles.map(h=>h.dataKey+(i.getTile(h)?.data?"+":"-")).join(",");if(a===this.stamp)return;this.stamp=a,this.free();let s=[],l=1/0,c=1/0,f=-1/0,u=-1/0;for(let h of i.visibleTiles){let d=i.getTile(h)?.data?.buckets;if(d)for(let m of r){let p=d[m];if(!p||p.kind!=="fill")continue;let b=vs(p,h);s.push(b);for(let g=0;g<b.length;g+=2)b[g]<l&&(l=b[g]),b[g]>f&&(f=b[g]),b[g+1]<c&&(c=b[g+1]),b[g+1]>u&&(u=b[g+1]);}}this.parts=s.length?s:null,this.box=s.length?[l,c,f,u]:null,this.hidden.clear(),this.collected.clear();}collectHidden(e,t){let o=this.parts;if(!o||!e.featureIds)return;let r=new Uint32Array(e.indices),i=new Float64Array(e.featureIds),a=new DataView(e.vertices),s=t.bounds(),l=(s.maxX-s.minX)/e.extent,c=this.box,f=new fe;for(let u=0;u*3<r.length;u++){let h=i[u];if(this.hidden.has(h))continue;let d=f.get(h);d||f.set(h,d=[1/0,1/0,-1/0,-1/0]);for(let m=0;m<3;m++){let p=r[u*3+m]*rt,b=a.getInt16(p,true),g=a.getInt16(p+2,true);b<d[0]&&(d[0]=b),g<d[1]&&(d[1]=g),b>d[2]&&(d[2]=b),g>d[3]&&(d[3]=g);}}for(let[u,h]of f){let d=s.minX+(h[0]+h[2])/2*l,m=s.minY+(h[1]+h[3])/2*l;c&&(d<c[0]||d>c[2]||m<c[1]||m>c[3])||Zt(o,d,m,0)&&this.hidden.add(u);}}destroy(){this.parts=null,this.hidden.clear(),this.collected.clear(),this.box=null,this.stamp="",this.free();}free(){this.cache.forEach(e=>{e?.vao.destroy(),e?.ibo.destroy();}),this.cache.clear();}prepare(e,t){if(!this.parts)return;let o=this.hidden.size;for(let r of e.visibleTiles){if(this.collected.has(r.dataKey))continue;let i=e.getTile(r)?.data?.buckets?.[t];!i||i.kind!=="fill-extrusion"||(this.collected.add(r.dataKey),this.collectHidden(i,r));}this.hidden.size!==o&&this.free();}indicesFor(e,t,o,r,i,a){if(!this.parts)return null;let s=this.cache.get(r.dataKey);if(s!==void 0)return s;let l=t.data?.buckets?.[o];if(!l)return null;let c=null;if(l.kind==="fill-extrusion"&&l.featureIds&&this.hidden.size){let f=new Uint32Array(l.indices),u=new Float64Array(l.featureIds),h=[];for(let d=0;d*3<f.length;d++)this.hidden.has(u[d])||h.push(f[d*3],f[d*3+1],f[d*3+2]);if(h.length<f.length){let d=new Ue(e,new Uint32Array(h));c={vao:new Ne(e,[{buffer:i,locations:a}],d),ibo:d,count:h.length};}}return this.cache.set(r.dataKey,c),c}};function Si(n){return n==="terrarium"?[256,1,1/256,32768]:[6553.6,25.6,.1,1e4]}var jr=class{constructor(e,t,o="mapbox"){if(e.length<t*t*4)throw new RangeError(`\u0442\u0430\u0439\u043B \u0440\u0435\u043B\u044C\u0435\u0444\u0430 ${t}\xD7${t} \u0442\u0440\u0435\u0431\u0443\u0435\u0442 ${t*t*4} \u0431\u0430\u0439\u0442, \u043F\u0440\u0438\u0448\u043B\u043E ${e.length}`);let[r,i,a,s]=Si(o),l=new Float32Array(t*t),c=1/0,f=-1/0;for(let u=0;u<l.length;u++){let h=u*4,d=e[h]*r+e[h+1]*i+e[h+2]*a-s;l[u]=d,d<c&&(c=d),d>f&&(f=d);}this.heights=l,this.size=t,this.min=c,this.max=f;}heightAt(e,t){let o=this.size,r=th(e*o-.5,0,o-1),i=th(t*o-.5,0,o-1),a=Math.floor(r),s=Math.floor(i),l=Math.min(a+1,o-1),c=Math.min(s+1,o-1),f=r-a,u=i-s,h=this.heights,d=h[s*o+a]*(1-f)+h[s*o+l]*f,m=h[c*o+a]*(1-f)+h[c*o+l]*f;return d*(1-u)+m*u}};function th(n,e,t){return n<e?e:n>t?t:n}function ob(n,e,t){let o=Math.pow(2,t),r=e.maxTiles??512,i=[],a=128;for(let s=0;s<o;s++)for(let l=0;l<o;l++){let c=new so(t,l,s),f=c.bounds(),u=(f.minX+f.maxX)/2,h=(f.minY+f.maxY)/2,d=[[u,h],[f.minX,f.minY],[f.maxX,f.minY],[f.minX,f.maxY],[f.maxX,f.maxY]],m=false;for(let[b,g]of d)if(n.isOnGlobeFront(ut(b),ct(g))){m=true;break}if(!m)continue;let p=false;for(let[b,g]of d){let y=n.localToPoint(n.globeLocal(b,g));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 qt(n,e){let t=Math.min(e.maxzoom,24),o=Math.max(0,Math.min(e.minzoom,t)),r=e.detailBias??1,i=e.maxTiles??512,a=512*r,s=Math.min(Math.round(n.zoom),t);if(s<o)return [];if(n.globeActive)return ob(n,e,s);let{min:l,max:c}=n.visibleWrapRange(),f=[],u=[];for(let d=l;d<=c;d++)u.push(new so(0,0,0,d));let h=0;for(;u.length&&!(++h>2e4||f.length>=i);){let d=u.pop();if(!n.isTileVisible(d))continue;if(d.z>=s){d.z>=o&&f.push(d);continue}if(n.tileScreenSize(d.z,n.distanceToTile(d))<=a&&d.z>=o){f.push(d);continue}for(let p of d.children())u.push(p);}return f.sort((d,m)=>n.distanceToTile(d)-n.distanceToTile(m)),f}var rb=64,oh=1024,rh=256,nb=2048,ib=192*1024*1024,ab=2,nh=5126,sb={stride:12,attribs:[{name:"a_pos",size:2,type:nh,offset:0},{name:"a_skirt",size:1,type:nh,offset:8}]},Es=class{constructor(e,t){this.ctx=e;this.size=t;this.key="";let o=e.gl,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 \u0440\u0435\u043B\u044C\u0435\u0444\u0430");this.texture=r,this.framebuffer=i,e.bindTexture(Yr,r),o.texImage2D(o.TEXTURE_2D,0,o.RGBA,t,t,0,o.RGBA,o.UNSIGNED_BYTE,null),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.bindFramebuffer(o.FRAMEBUFFER,i),o.framebufferTexture2D(o.FRAMEBUFFER,o.COLOR_ATTACHMENT0,o.TEXTURE_2D,r,0),o.bindFramebuffer(o.FRAMEBUFFER,null);}clear(e){let t=this.ctx.gl;this.ctx.bindFramebuffer(this.framebuffer),this.ctx.viewport(0,0,this.size,this.size),t.clearColor(e[0],e[1],e[2],1),t.clear(t.COLOR_BUFFER_BIT);}destroy(){this.ctx.gl.deleteTexture(this.texture),this.ctx.gl.deleteFramebuffer(this.framebuffer);}},Yr=5,Fi=class{constructor(){this.exaggeration=1;this.revision=0;this.source=null;this.empty=null;this.unsubscribe=null;this.current=[];this.lastCover=null;this.mesh=null;this.targets=new Map;}setSource(e){if(this.unsubscribe?.(),this.unsubscribe=null,this.source=e,this.revision++,!e)return;let t=()=>{this.revision++;};e.on("data",t),this.unsubscribe=()=>e.off("data",t);}get enabled(){return this.source!==null&&this.exaggeration!==0}apply(e,t,o){let r=this.enabled?this.demFor(o):null,i=r?this.textureFor(e,r.dem):null;if(e.bindTexture(Yr,i??this.emptyTexture(e)),t.setInt("u_terrain",Yr),!r||!i){t.setFloat("u_terrain_exaggeration",0),t.setVec4("u_terrain_uv",0,0,0,0),t.setVec4("u_terrain_unpack",0,0,0,0),t.setFloat("u_terrain_dim",1);return}let[a,s,l,c]=Si(this.source.encoding);t.setVec4("u_terrain_uv",r.uv[0],r.uv[1],r.uv[2],r.uv[3]),t.setVec4("u_terrain_unpack",a,s,l,c),t.setFloat("u_terrain_dim",r.dem.image?.width??1),t.setFloat("u_terrain_exaggeration",this.exaggeration);}demFor(e){let t=this.coverFor(e),o=t?this.tileFor(t):null;if(!t||!o||e.z<t.z)return this.tileFor(e);let r=e.z-t.z,i=1/(1<<r),a=(e.x-(t.x<<r))*i,s=(e.y-(t.y<<r))*i,[l,c,f,u]=o.uv;return {dem:o.dem,uv:[l*i,c*i,f+l*a,u+c*s]}}groundRange(){let e=1/0,t=-1/0;for(let o of this.current){let r=1<<o.z,i=this.heightAtMerc((o.x+.5)/r,(o.y+.5)/r);i<e&&(e=i),i>t&&(t=i);}return e<=t?[e,t]:[0,0]}covers(e){return this.coverFor(e)!==null}coverFor(e){for(let t of this.current)if(t.z<=e.z){let o=e.z-t.z;if(e.x>>o===t.x&&e.y>>o===t.y)return t}else {let o=t.z-e.z;if(t.x>>o===e.x&&t.y>>o===e.y)return t}return null}tileFor(e){let t=this.source;if(!t)return null;for(let o=e.z;o>=0;o--){let r=e.z-o,i=e.x>>r,a=e.y>>r,s=t.getTile({z:o,x:i,y:a,dataKey:`${o}/${i}/${a}`});if(!s||s.state!=="loaded"||!s.image)continue;let l=1/(1<<r),c=(e.x-(i<<r))*l,f=(e.y-(a<<r))*l;return {dem:s,uv:[l,l,c,f]}}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(Yr,i),r.texImage2D(r.TEXTURE_2D,0,r.RGBA,r.RGBA,r.UNSIGNED_BYTE,t.image),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.NEAREST),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,r.NEAREST),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);let a={handle:i,destroy:()=>r.deleteTexture(i)};return t.texture=a,i}emptyTexture(e){if(this.empty)return this.empty;let t=e.gl,o=t.createTexture();return e.bindTexture(Yr,o),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,1,1,0,t.RGBA,t.UNSIGNED_BYTE,new Uint8Array([0,0,0,255])),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.NEAREST),this.empty=o,o}heightAt(e,t){return this.heightAtMerc(Oe(e),Ge(t))}heightAtMerc(e,t){let o=this.source;if(!o||this.exaggeration===0)return 0;let r=this.coverForPoint(e,t);if(r){let s=this.tileFor(r),l=s?o.heights(s.dem):null;if(s&&l){let c=1<<r.z,[f,u,h,d]=s.uv,m=h+f*(e*c-r.x),p=d+u*(t*c-r.y);return l.heightAt(m,p)*this.exaggeration}}let i=null;for(let s of o.visibleTiles){let l=1<<s.z,c=e*l-s.x,f=t*l-s.y;if(c<0||c>=1||f<0||f>=1||i&&s.z<=i.z)continue;let u=o.getTile(s);!u||u.state!=="loaded"||(i={dem:u,z:s.z,tx:c,ty:f});}if(!i)return 0;let a=o.heights(i.dem);return a?a.heightAt(i.tx,i.ty)*this.exaggeration:0}coverForPoint(e,t){let o=this.lastCover;if(o&&this.inside(o,e,t))return o;for(let r of this.current)if(this.inside(r,e,t))return this.lastCover=r,r;return null}inside(e,t,o){let r=1<<e.z,i=t*r-e.x,a=o*r-e.y;return i>=0&&i<1&&a>=0&&a<1}tilesFor(e){return this.current=qt(e,{minzoom:0,maxzoom:22,detailBias:ab,maxTiles:48}),this.lastCover=null,this.current}sizesFor(e,t,o){let r=0;return t.map(i=>{let a=e.tileScreenSize(i.z,e.distanceToTile(i))*Math.min(Math.max(o,1),2),s=Math.min(nb,Math.max(rh,1<<Math.ceil(Math.log2(Math.max(a,1))))),l=this.targets.get(i.dataKey)?.size;for(l!==void 0&&a<=l*1.3&&a>=l*.3&&(s=l);s>rh&&r+s*s*4>ib;)s/=2;return r+=s*s*4,s})}meshOf(e,t){if(this.mesh)return this.mesh;let o=rb,r=[],i=[],a=(u,h)=>h*(o+1)+u;for(let u=0;u<=o;u++)for(let h=0;h<=o;h++)r.push(h/o,u/o,0);for(let u=0;u<o;u++)for(let h=0;h<o;h++)i.push(a(h,u),a(h,u+1),a(h+1,u+1)),i.push(a(h,u),a(h+1,u+1),a(h+1,u));let s=r.length/3;for(let u=0;u<=o;u++)r.push(u/o,0,1),r.push(u/o,1,1),r.push(0,u/o,1),r.push(1,u/o,1);let l=(u,h)=>s+u*4+h;for(let u=0;u<o;u++){let h=[[a(u,0),a(u+1,0),l(u,0),l(u+1,0)],[a(u+1,o),a(u,o),l(u+1,1),l(u,1)],[a(0,u+1),a(0,u),l(u+1,2),l(u,2)],[a(o,u),a(o,u+1),l(u,3),l(u+1,3)]];for(let[d,m,p,b]of h)i.push(d,m,b),i.push(d,b,p);}let c=new Je(e,new Float32Array(r),sb),f=new Ue(e,new Uint32Array(i));return this.mesh={vao:new Ne(e,[{buffer:c,locations:t}],f),count:i.length},this.mesh}targetOf(e){return this.targets.get(e)}targetFor(e,t,o=oh){let r=this.targets.get(t);return r&&r.size!==o&&(r.destroy(),this.targets.delete(t),r=void 0),r?{target:r,fresh:false}:(r=new Es(e,o),this.targets.set(t,r),{target:r,fresh:true})}keepOnly(e){for(let[t,o]of this.targets)e.has(t)||(o.destroy(),this.targets.delete(t));}get drapeSize(){return oh}skirtMeters(e){return Math.max(ho(Math.max(e,0))/32,4)}destroy(e){this.empty&&e.gl.deleteTexture(this.empty),this.empty=null;for(let t of this.targets.values())t.destroy();this.targets.clear(),this.mesh=null;}};var ih=35,lb=70,cb=.35,fb=.5,ub=1.1;function Jo(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=nt((n.pitch-ih)/(lb-ih),0,1),i=t.fogRange[0]*(1-cb*r)*o,a=t.fogRange[1]*(1-fb*r)*o,s=Math.min(1,t.fogIntensity+(1-t.fogIntensity)*Math.min(1,r*2)),l=s>=.995?a*ub:1/0;return {near:i,far:a,intensity:s,cutoff:l}}function Ss(n,e,t,o,r){let i=o.x/Math.max(n.width,1)*2-1,a=1-o.y/Math.max(n.height,1)*2,s=null,l=new Float64Array(16),c=[0,0,0,0],f=[0,0,0,0];for(let u of e.visibleTiles){let h=e.getTile(u),d=h&&sh(h,t);if(!d||!Rt(l,n.tileMatrix64(u,d.extent))||(Qe(c,l,[i,a,-1,1]),Qe(f,l,[i,a,1,1]),c[3]===0||f[3]===0))continue;let m=c[0]/c[3],p=c[1]/c[3],b=c[2]/c[3],g=f[0]/f[3]-m,y=f[1]/f[3]-p,A=f[2]/f[3]-b,x=db(d,m,p,ah(u,d.extent,m,p,b,g,y,A,r),g,y,A);x&&(!s||x.t<s.distance)&&(s={featureId:x.featureId,tile:u,layerId:t,distance:x.t});}return s}function ah(n,e,t,o,r,i,a,s,l){if(!l||Math.abs(s)<1e-9)return r;let c=1<<n.z,f=0;for(let u=0;u<2;u++){let h=(f-r)/s;if(!isFinite(h))break;let d=t+i*h,m=o+a*h;f=l((n.x+d/e)/c,(n.y+m/e)/c);}return r-f}function Fs(n,e,t,o,r){let i=o.x/Math.max(n.width,1)*2-1,a=1-o.y/Math.max(n.height,1)*2,s=null,l=new Float64Array(16),c=[0,0,0,0],f=[0,0,0,0];for(let u of e.visibleTiles){let h=e.getTile(u);if(h)for(let d of t){let m=h.data?.buckets?.[d];if(!m||m.kind!=="fill"||!m.featureIds||!Rt(l,n.tileMatrix64(u,m.extent))||(Qe(c,l,[i,a,-1,1]),Qe(f,l,[i,a,1,1]),c[3]===0||f[3]===0))continue;let p=c[0]/c[3],b=c[1]/c[3],g=f[2]/f[3]-c[2]/c[3];if(Math.abs(g)<1e-9)continue;let A=-ah(u,m.extent,p,b,c[2]/c[3],f[0]/f[3]-p,f[1]/f[3]-b,g,r)/g;if(A<0||A>1)continue;let x=p+(f[0]/f[3]-p)*A,v=b+(f[1]/f[3]-b)*A,w=hb(m,x,v);w!==null&&(!s||A<s.distance)&&(s={featureId:w,tile:u,layerId:d,distance:A});}}return s}function hb(n,e,t){let o=new DataView(n.vertices),r=new Uint32Array(n.indices),i=new Float64Array(n.featureIds),a=l=>o.getInt16(l*Ft,true),s=l=>o.getInt16(l*Ft+2,true);for(let l=0;l*3<r.length;l++){let c=r[l*3],f=r[l*3+1],u=r[l*3+2],h=a(c),d=s(c),m=a(f),p=s(f),b=a(u),g=s(u),y=(e-m)*(d-p)-(h-m)*(t-p),A=(e-b)*(p-g)-(m-b)*(t-g),x=(e-h)*(g-d)-(b-h)*(t-d),v=y<0||A<0||x<0,w=y>0||A>0||x>0;if(!(v&&w))return i[l]}return null}function sh(n,e){let t=n.data?.buckets?.[e];return !t||t.kind!=="fill-extrusion"||!t.featureIds?null:t}function db(n,e,t,o,r,i,a){let s=new DataView(n.vertices),l=new Uint32Array(n.indices),c=new Float64Array(n.featureIds),f=p=>s.getInt16(p*rt,true)/Xt,u=p=>s.getInt16(p*rt+2,true)/Xt,h=p=>s.getUint16(p*rt+4,true)/Go,d=1/0,m=-1;for(let p=0;p+2<l.length;p+=3){let b=l[p],g=l[p+1],y=l[p+2],A=f(b),x=u(b),v=h(b),w=f(g)-A,C=u(g)-x,B=h(g)-v,_=f(y)-A,T=u(y)-x,k=h(y)-v,K=i*k-a*T,P=a*_-r*k,W=r*T-i*_,z=w*K+C*P+B*W;if(z>-1e-9&&z<1e-9)continue;let L=1/z,X=e-A,Q=t-x,G=o-v,Y=(X*K+Q*P+G*W)*L;if(Y<0||Y>1)continue;let ie=Q*B-G*C,ee=G*w-X*B,ue=X*C-Q*w,$=(r*ie+i*ee+a*ue)*L;if($<0||Y+$>1)continue;let Ae=(_*ie+T*ee+k*ue)*L;Ae<0||Ae>1||Ae>=d||(d=Ae,m=c[p/3]??0);}return m>=0?{featureId:m,t:d}:null}function Ii(n,e,t){let o=sh(n,e);return o?Is(o,t):null}function Is(n,e){if(!n.featureIds)return null;let t=new Uint32Array(n.indices),o=new Float64Array(n.featureIds),r=[];for(let i=0;i+2<t.length;i+=3)o[i/3]===e&&r.push(t[i],t[i+1],t[i+2]);return r.length?{vertices:n.vertices,indices:new Uint32Array(r)}:null}var jo=24,Ds=8,mb=2,pb=12,Di=8,Ti=8;function Zr(n){let e=0;for(let d of n)e+=d.length/2;if(e<2)return null;let t=(Di+2)*2,o=e*t+n.length*(Ti+2)*2+8,r=e*(Di+2)*6+n.length*Ti*6+24,i=new ArrayBuffer(o*jo),a=new DataView(i),s=new Uint32Array(r),l=0,c=0,f=(d,m,p,b,g,y)=>{let A=l*jo;return a.setFloat32(A,d,true),a.setFloat32(A+4,m,true),a.setFloat32(A+8,p,true),a.setFloat32(A+12,b,true),a.setFloat32(A+16,g,true),a.setFloat32(A+20,y,true),l++},u=(d,m,p,b)=>{s[c++]=d,s[c++]=m,s[c++]=b,s[c++]=d,s[c++]=b,s[c++]=p;},h=(d,m,p,b,g,y,A)=>{let x=f(d,m,0,0,0,A),v=f(d,m,p,b,1,A);for(let w=1;w<=Ti;w++){let C=Math.PI*w/Ti,B=p*Math.cos(C)+g*Math.sin(C),_=b*Math.cos(C)+y*Math.sin(C),T=f(d,m,B,_,1,A);s[c++]=x,s[c++]=v,s[c++]=T,v=T;}};for(let d of n){let m=bb(d),p=m.length/2;if(p<2)continue;let b=new Float64Array(p-1),g=new Float64Array(p-1);for(let w=0;w<p-1;w++){let C=m[w*2+2]-m[w*2],B=m[w*2+3]-m[w*2+1],_=Math.hypot(C,B)||1;b[w]=C/_,g[w]=B/_;}let y=0,A=-1,x=-1;for(let w=0;w<p;w++){let C=m[w*2],B=m[w*2+1];w>0&&(y+=Math.hypot(C-m[w*2-2],B-m[w*2-1]));let _=w>0?w-1:0,T=w<p-1?w:p-2,k=-g[_],K=b[_],P=-g[T],W=b[T],z=k+P,L=K+W,X=Math.hypot(z,L);X>1e-9?(z/=X,L/=X):(z=k,L=K);let Q=z*P+L*W,G=Q>1e-6?1/Q:1/0,Y=Math.acos(Math.min(1,Math.max(-1,b[_]*b[T]+g[_]*g[T])));if(!(Y>pb*Math.PI/180)&&G<=mb){let ee=f(C,B,z*G,L*G,1,y),ue=f(C,B,-z*G,-L*G,-1,y);A>=0&&u(A,x,ee,ue),A=ee,x=ue;}else {let ee=Math.max(1,Math.min(Di,Math.ceil(Y/(Math.PI/Di)))),$=b[_]*g[T]-g[_]*b[T]>=0?1:-1,Ae=f(C,B,k,K,1,y),ve=f(C,B,-k,-K,-1,y);A>=0&&u(A,x,Ae,ve);for(let he=1;he<=ee;he++){let xe=$*Y*(he/ee),de=Math.cos(xe),we=Math.sin(xe),I=k*de-K*we,J=k*we+K*de,Z=f(C,B,I,J,1,y),ce=f(C,B,-I,-J,-1,y);u(Ae,ve,Z,ce),Ae=Z,ve=ce;}A=Ae,x=ve;}}let v=p-2;h(m[0],m[1],-g[0],b[0],-b[0],-g[0],0),h(m[(p-1)*2],m[(p-1)*2+1],-g[v],b[v],b[v],g[v],y);}return c?{vertices:i.slice(0,l*jo),indices:s.slice(0,c),vertexCount:l}:null}function Ts(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=ot(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 bb(n){let e=[];for(let t=0;t<n.length;t+=2){let o=n[t],r=n[t+1],i=e.length;i>=2&&e[i-2]===o&&e[i-1]===r||e.push(o,r);}return e}var Yo=5126,gb={stride:Ds,attribs:[{name:"a_pos",size:2,type:Yo,offset:0}]},Ls={stride:jo,attribs:[{name:"a_pos",size:2,type:Yo,offset:0},{name:"a_extrude",size:2,type:Yo,offset:8},{name:"a_side",size:1,type:Yo,offset:16},{name:"a_dist",size:1,type:Yo,offset:20}]},yb={stride:4,attribs:[{name:"a_ground",size:1,type:Yo,offset:0}]},ks=class{constructor(e,t,o){this.revision=e;this.ground=t;this.parts=o;}destroy(){for(let e of this.parts)e.vao.destroy(),e.vbo.destroy(),e.ibo.destroy(),e.gbo?.destroy();}},Ab=(n,e)=>[n[0],n[1],n[2],n[3]*e],qr=class{constructor(){this.elevationAt=null;this.elevationRevision=0;this.objects=[];this.markers=[];this.gpu=new fe;this.markerHost=null;}setMarkerHost(e){this.markerHost=e;for(let t of this.markers)t.attach(e);}add(e){this.objects.includes(e)||this.objects.push(e);}remove(e){let t=this.objects.indexOf(e);t<0||(this.objects.splice(t,1),this.gpu.get(e.id)?.destroy(),this.gpu.delete(e.id));}addMarker(e){this.markers.includes(e)||(this.markers.push(e),this.markerHost&&e.attach(this.markerHost));}removeMarker(e){let t=this.markers.indexOf(e);t<0||(this.markers.splice(t,1),e.detach());}get all(){return this.objects}get allMarkers(){return this.markers}get isEmpty(){return this.objects.length===0}updateMarkers(e){for(let t of this.markers)t.update(e);}render(e,t,o,r,i,a,s,l=false,c=false){if(!this.objects.length||c&&!this.objects.some(m=>m.ghostOpacity>0))return;this.objects.length>1&&this.objects.sort((m,p)=>m.zIndex-p.zIndex);let f=e.gl.drawingBufferWidth,u=t.width>0?f/t.width:1,h=t.worldSize*u,d=null;for(let m of this.objects){if(!m.visible)continue;let p=m.ghostOpacity;if(c&&p<=0)continue;let b=this.gpuFor(e,m,r,a);if(!b)continue;let g=l?t.shadowObjectMatrix(m.originX,m.originY,m.altitude):null,y=t.objectMatrix(m.originX,m.originY,m.altitude);for(let{part:A,vao:x,ibo:v}of b.parts){if(c&&(A.kind!=="line"||A.arrow))continue;let w=c?Ab(A.color,p):A.color;if(A.kind==="fill")d!==o&&(o.use(),s?.(o),d=o),o.setVec4v("u_color",it(w)),g&&o.setMat4("u_shadow_matrix",g),o.setMat4("u_matrix",y);else {d!==i&&(i.use(),s?.(i),d=i);let C=A.width/2*u,B=h>1e-9?1/h:1;if(i.setVec4v("u_color",it(w)),i.setFloat("u_half_width",C),i.setFloat("u_offset",(A.offset??0)*u),i.setFloat("u_aa",1),i.setFloat("u_units_per_px",B),i.setFloat("u_units_to_px",h),i.setInt("u_pattern",c?0:A.dashArray?1:A.arrow?2:0),A.dashArray){let[_,T]=A.dashArray;i.setVec2("u_dash",_*u,(_+T)*u);}if(A.arrow){i.setVec4v("u_arrow_color",it(A.arrowColor??[1,1,1,1]));let _=(A.arrowSize??5)*u;i.setVec3("u_arrow",(A.arrowPeriod??46)*u,Math.max(_*.4,1),Math.min(_,C*.72));}g&&i.setMat4("u_shadow_matrix",g),i.setMat4("u_matrix",y);}x.bind(),e.gl.drawElements(e.gl.TRIANGLES,v.count,v.type,0);}}e.bindVAO(null);}hitTest(e,t,o=4){let r=e.worldSize,i=this.elevationAt,a=(s,l,c)=>{let f=Oe(s),u=Ge(l);return e.worldPxToPoint(f*r,u*r,c+(i?i(f,u):0))};for(let s=this.objects.length-1;s>=0;s--){let l=this.objects[s];if(l.visible&&l.hitTest(t,a,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 s of a){let l=Pe(s);l.lng<t&&(t=l.lng),l.lng>r&&(r=l.lng),l.lat<o&&(o=l.lat),l.lat>i&&(i=l.lat);}return isFinite(t)?{west:t,south:o,east:r,north:i}:null}gpuFor(e,t,o,r){let i=this.elevationAt?this.elevationRevision:0,a=this.gpu.get(t.id);if(a&&a.revision===t.revision&&a.ground===i)return a;a?.destroy();let s=[];for(let c of t.build()){let f=c.kind==="fill"?gb:Ls,u=c.kind==="fill"?o:r,h=new Je(e,new Uint8Array(c.mesh.vertices),f),d=new Ue(e,c.mesh.indices),m=this.groundOf(t,c,f.stride),p=m?new Je(e,m,yb):null,b=[{buffer:h,locations:u}];p&&b.push({buffer:p,locations:u});let g=new Ne(e,b,d);s.push({part:c,vao:g,vbo:h,ibo:d,gbo:p});}let l=new ks(t.revision,i,s);return this.gpu.set(t.id,l),s.length?l:null}groundOf(e,t,o){let r=this.elevationAt;if(!r)return null;let i=new DataView(t.mesh.vertices),a=new Float32Array(t.mesh.vertexCount);for(let s=0;s<a.length;s++){let l=i.getFloat32(s*o,true)+e.originX,c=i.getFloat32(s*o+4,true)+e.originY;a[s]=r(l,c);}return a}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 ki=32,Cb=1179937895,Bb=1313821514,Mb=5130562,_b={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},Eb={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT4:16};async function Rs(n){let{json:e,bin:t}=dh(n),o=await Fb(e,t);return ph(e,t,o)}function Sb(n){let{json:e,bin:t}=dh(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 ph(e,t,null)}function dh(n){let e=new DataView(n);if(e.getUint32(0,true)!==Cb)throw new Error("[osmgl] \u044D\u0442\u043E \u043D\u0435 GLB: \u043D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0438\u0433\u043D\u0430\u0442\u0443\u0440\u0430");if(e.getUint32(4,true)!==2)throw new Error("[osmgl] \u043F\u043E\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044F \u0442\u043E\u043B\u044C\u043A\u043E glTF 2.0");let t=null,o=null,r=12;for(;r+8<=n.byteLength;){let i=e.getUint32(r,true),a=e.getUint32(r+4,true),s=r+8;a===Bb?t=JSON.parse(new TextDecoder().decode(new Uint8Array(n,s,i))):a===Mb&&(o=new Uint8Array(n,s,i)),r=s+i+(4-i%4)%4;}if(!t)throw new Error("[osmgl] \u0432 GLB \u043D\u0435\u0442 JSON-\u043A\u0443\u0441\u043A\u0430");return {json:t,bin:o??new Uint8Array(0)}}async function Fb(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(()=>(hh(),uh));await r.ready;let i=new Map;for(let a of o){let s=t[a].extensions.EXT_meshopt_compression,l=s.byteOffset??0,c=e.subarray(l,l+s.byteLength),f=new Uint8Array(s.count*s.byteStride);r.decodeGltfBuffer(f,s.count,s.byteStride,c,s.mode,s.filter??"NONE"),i.set(a,f);}return i}function mh(n){let e=Fe();if(n.matrix){for(let B=0;B<16;B++)e[B]=n.matrix[B];return e}Wt(e);let[t,o,r]=n.translation??[0,0,0],[i,a,s,l]=n.rotation??[0,0,0,1],[c,f,u]=n.scale??[1,1,1],h=i+i,d=a+a,m=s+s,p=i*h,b=i*d,g=i*m,y=a*d,A=a*m,x=s*m,v=l*h,w=l*d,C=l*m;return e[0]=(1-(y+x))*c,e[1]=(b+C)*c,e[2]=(g-w)*c,e[4]=(b-C)*f,e[5]=(1-(p+x))*f,e[6]=(A+v)*f,e[8]=(g+w)*u,e[9]=(A-v)*u,e[10]=(1-(p+y))*u,e[12]=t,e[13]=o,e[14]=r,e}var Ib={5120:127,5121:255,5122:32767,5123:65535};function Db(n){let e=n[0],t=n[1],o=n[2],r=n[4],i=n[5],a=n[6],s=n[8],l=n[9],c=n[10],f=e*(i*c-a*l)-r*(t*c-o*l)+s*(t*a-o*i);if(Math.abs(f)<1e-20)return [1,0,0,0,1,0,0,0,1];let u=1/f;return [(i*c-a*l)*u,(a*s-r*c)*u,(r*l-i*s)*u,(o*l-t*c)*u,(e*c-o*s)*u,(t*s-e*l)*u,(t*a-o*i)*u,(o*r-e*a)*u,(e*i-t*r)*u]}function ph(n,e,t){let o=B=>{let _=t?.get(B);if(_)return _;let T=n.bufferViews?.[B];if(!T)return null;let k=T.byteOffset??0;return e.subarray(k,k+T.byteLength)},r=[],i=[],a=[],s=[],l=[],c=[1/0,1/0,1/0],f=[-1/0,-1/0,-1/0],u=B=>{if(B===void 0)return null;let _=n.accessors?.[B];if(!_)return null;let T=Eb[_.type]??1,k=new Float64Array(_.count*T),K=_.bufferView!==void 0?n.bufferViews?.[_.bufferView]:void 0;if(!K||_.bufferView===void 0)return {data:k,components:T};let P=o(_.bufferView);if(!P)return {data:k,components:T};let W=_b[_.componentType]??4,z=K.extensions?.EXT_meshopt_compression,L=z?z.byteStride:K.byteStride,X=L&&L>0?L:W*T,Q=_.byteOffset??0,G=new DataView(P.buffer,P.byteOffset,P.byteLength),Y=_.normalized?Ib[_.componentType]??1:1;for(let ie=0;ie<_.count;ie++)for(let ee=0;ee<T;ee++){let ue=Q+ie*X+ee*W,$;switch(_.componentType){case 5120:$=G.getInt8(ue);break;case 5121:$=G.getUint8(ue);break;case 5122:$=G.getInt16(ue,true);break;case 5123:$=G.getUint16(ue,true);break;case 5125:$=G.getUint32(ue,true);break;default:$=G.getFloat32(ue,true);}k[ie*T+ee]=Y===1?$:Math.max($/Y,-1);}return {data:k,components:T}},h=(B,_,T=-1)=>{if(B.mode!==void 0&&B.mode!==4)return;let k=u(B.attributes.POSITION);if(!k)return;let K=u(B.attributes.NORMAL),P=u(B.attributes.TEXCOORD_0),W=u(B.indices),z=r.length/3,L=k.data.length/3,X=Db(_),G=(B.material!==void 0?n.materials?.[B.material]:void 0)?.pbrMetallicRoughness?.baseColorTexture?.extensions?.KHR_texture_transform,Y=G?{ox:G.offset?.[0]??0,oy:G.offset?.[1]??0,sx:G.scale?.[0]??1,sy:G.scale?.[1]??1,rot:G.rotation??0}:null;for(let we=0;we<L;we++){let I=k.data[we*3],J=k.data[we*3+1],Z=k.data[we*3+2],ce=_[0]*I+_[4]*J+_[8]*Z+_[12],ae=_[1]*I+_[5]*J+_[9]*Z+_[13],be=_[2]*I+_[6]*J+_[10]*Z+_[14];if(r.push(ce,ae,be),ce<c[0]&&(c[0]=ce),ae<c[1]&&(c[1]=ae),be<c[2]&&(c[2]=be),ce>f[0]&&(f[0]=ce),ae>f[1]&&(f[1]=ae),be>f[2]&&(f[2]=be),K){let U=K.data[we*3],j=K.data[we*3+1],R=K.data[we*3+2],H=X[0]*U+X[3]*j+X[6]*R,E=X[1]*U+X[4]*j+X[7]*R,M=X[2]*U+X[5]*j+X[8]*R,S=Math.hypot(H,E,M);S>1e-12?(H/=S,E/=S,M/=S):(H=0,E=1,M=0),i.push(H,E,M);}else i.push(0,1,0);let Se=P?P.data[we*2]:0,F=P?P.data[we*2+1]:0;if(Y){if(Y.rot!==0){let U=Math.cos(Y.rot),j=Math.sin(Y.rot),R=U*Se+j*F,H=-j*Se+U*F;Se=R,F=H;}Se=Se*Y.sx+Y.ox,F=F*Y.sy+Y.oy;}a.push(Se,F);}let ie=s.length;if(W)for(let we=0;we<W.data.length;we++)s.push(z+W.data[we]);else for(let we=0;we<L;we++)s.push(z+we);let ee=B.material!==void 0?n.materials?.[B.material]:void 0,ue=ee?.pbrMetallicRoughness,$=ue?.metallicFactor!==void 0||ue?.roughnessFactor!==void 0,Ae=ue?.baseColorFactor??[1,1,1,1],ve=ue?.baseColorTexture?.index,he=ve!==void 0?n.textures?.[ve]?.source:void 0,xe=ee?.emissiveFactor??[0,0,0],de=ee?.extensions?.KHR_materials_emissive_strength?.emissiveStrength??1;l.push({indexOffset:ie,indexCount:s.length-ie,baseColor:[Ae[0],Ae[1],Ae[2],Ae[3]??1],metallic:$?ue?.metallicFactor??1:0,roughness:$?ue?.roughnessFactor??1:1,emissive:[xe[0]*de,xe[1]*de,xe[2]*de],texture:he??-1,doubleSided:ee?.doubleSided===true,blend:ee?.alphaMode==="BLEND",alphaCutoff:ee?.alphaMode==="MASK"?ee.alphaCutoff??.5:.02,node:T});},d=n.skins?.length?null:Tb(n,u),m=d?d.nodes:null,p=(B,_,T,k)=>{let K=n.nodes?.[B];if(!K)return;let P=mh(K),W=Fe();at(W,_,P);let z=Fe(),L=k,X=m?.get(B);if(X?(X.parentNode=k,X.parent=T.slice(),Wt(z),L=B):at(z,T,P),K.mesh!==void 0)for(let G of n.meshes?.[K.mesh]?.primitives??[])h(G,z,L);let Q=K.extensions?.KHR_lights_punctual?.light;if(Q!==void 0){let G=n.extensions?.KHR_lights_punctual?.lights?.[Q],Y=G?.type;if(G&&(Y==="point"||Y==="spot"||Y==="directional")){let ie=-W[8],ee=-W[9],ue=-W[10],$=Math.hypot(ie,ee,ue)||1,Ae=G.spot?.innerConeAngle??0,ve=G.spot?.outerConeAngle??Math.PI/4;b.push({type:Y,color:[G.color?.[0]??1,G.color?.[1]??1,G.color?.[2]??1],intensity:G.intensity??1,range:G.range??0,position:[W[12],W[13],W[14]],direction:[ie/$,ee/$,ue/$],cosInner:Math.cos(Ae),cosOuter:Math.cos(ve)});}}for(let G of K.children??[])p(G,W,z,L);},b=[],g=Fe();Wt(g);let y=Fe();Wt(y);let A=n.scenes?.[n.scene??0]?.nodes??n.nodes?.map((B,_)=>_)??[];for(let B of A)p(B,g,y,-1);let x=[];for(let B of n.images??[]){if(B.bufferView===void 0){x.push(new Uint8Array(0));continue}let _=o(B.bufferView);x.push(_?_.slice():new Uint8Array(0));}let v=r.length/3,w=new ArrayBuffer(v*ki),C=new Float32Array(w);for(let B=0;B<v;B++){let _=B*8;C[_]=r[B*3],C[_+1]=r[B*3+1],C[_+2]=r[B*3+2],C[_+3]=i[B*3],C[_+4]=i[B*3+1],C[_+5]=i[B*3+2],C[_+6]=a[B*2],C[_+7]=a[B*2+1];}return isFinite(c[0])||(c[0]=c[1]=c[2]=0,f[0]=f[1]=f[2]=0),{vertices:w,indices:new Uint32Array(s),primitives:l,images:x,min:c,max:f,animation:d,lights:b}}function Tb(n,e){let t=n.animations?.[0];if(!t||!t.channels.length)return null;let o=new Map,r=0;for(let i of t.channels){let a=i.target.node,s=i.target.path;if(a===void 0||s!=="translation"&&s!=="rotation"&&s!=="scale")continue;let l=t.samplers[i.sampler];if(!l)continue;let c=e(l.input),f=e(l.output);if(!c||!f||!c.data.length)continue;let u=s==="rotation"?4:3,h=l.interpolation==="CUBICSPLINE",d=c.data.length,m=new Float32Array(d*u);for(let b=0;b<d;b++){let g=h?(b*3+1)*u:b*u;for(let y=0;y<u;y++)m[b*u+y]=f.data[g+y];}let p=o.get(a)??{parentNode:-1,parent:Wt(Fe()),base:kb(n.nodes?.[a]),channels:[]};p.channels.push({path:s,times:Float32Array.from(c.data),values:m,step:l.interpolation==="STEP"}),o.set(a,p),r=Math.max(r,c.data[d-1]);}return o.size?{duration:r||1,nodes:o}:null}function kb(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 Ps(n,e,t,o){let r=n.nodes.get(e);if(!r)return Wt(o);let i=Fe();Lb(r,t,i);let a=Fe();if(at(a,r.parent,i),r.parentNode<0)return bh(o,a);let s=Fe();return Ps(n,r.parentNode,t,s),at(o,s,a)}var bh=(n,e)=>{for(let t=0;t<16;t++)n[t]=e[t];return n};function Lb(n,e,t){let o=[...n.base.t],r=[...n.base.r],i=[...n.base.s];for(let a of n.channels){let s=a.times.length,l=a.path==="rotation"?4:3,c=0;for(;c<s-1&&a.times[c+1]<e;)c++;let f=Math.min(c+1,s-1),u=a.times[f]-a.times[c],h=a.step||u<=0?0:Math.min(Math.max((e-a.times[c])/u,0),1),d=c*l,m=f*l;if(a.path==="rotation"){let p=0;for(let y=0;y<4;y++)p+=a.values[d+y]*a.values[m+y];let b=p<0?-1:1,g=0;for(let y=0;y<4;y++)r[y]=a.values[d+y]*(1-h)+a.values[m+y]*b*h,g+=r[y]*r[y];g=Math.sqrt(g)||1;for(let y=0;y<4;y++)r[y]/=g;}else {let p=a.path==="translation"?o:i;for(let b=0;b<3;b++)p[b]=a.values[d+b]*(1-h)+a.values[m+b]*h;}}return bh(t,mh({translation:o,rotation:r,scale:i}))}var mt=5126,Rb=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),gh={stride:ki,attribs:[{name:"a_pos",size:3,type:mt,offset:0},{name:"a_normal",size:3,type:mt,offset:12},{name:"a_tex",size:2,type:mt,offset:24}]},Os=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);}},Hs=256,Li=41,yh={stride:Li*4,attribs:[{name:"a_i_m0",size:4,type:mt,offset:0,divisor:1},{name:"a_i_m1",size:4,type:mt,offset:16,divisor:1},{name:"a_i_m2",size:4,type:mt,offset:32,divisor:1},{name:"a_i_m3",size:4,type:mt,offset:48,divisor:1},{name:"a_i_s0",size:4,type:mt,offset:64,divisor:1},{name:"a_i_s1",size:4,type:mt,offset:80,divisor:1},{name:"a_i_s2",size:4,type:mt,offset:96,divisor:1},{name:"a_i_s3",size:4,type:mt,offset:112,divisor:1},{name:"a_i_n0",size:3,type:mt,offset:128,divisor:1},{name:"a_i_n1",size:3,type:mt,offset:140,divisor:1},{name:"a_i_n2",size:3,type:mt,offset:152,divisor:1}]},Qr=2,Zo=16,lo=class{constructor(){this.models=[];this.gpu=new fe;this.counted=new Set;this.instBuffer=null;this.instScratch=new Float32Array(Hs*Li);this.drawnInstanced=new Set;this.onLoaded=null;this.growDurationSec=.45;this.fadeDurationSec=.6;this.transitioning=false;this.depthTimeSec=0;this.lightPacks=new WeakMap;this.elevationAt=null;this.shadow32=new Float32Array(16);this.shadowNode32=new Float32Array(16);this.shadowNodeColor32=new Float32Array(16);}add(e){this.models.includes(e)||(this.models.push(e),e.isLoaded||e.load(()=>this.onLoaded?.()));}remove(e,t){let o=this.models.indexOf(e);if(o<0)return;this.models.splice(o,1);let r=this.gpu.get(e.url);r&&(this.counted.delete(e)&&r.users--,!(r.users>0)&&(t&&r.destroy(t),this.gpu.delete(e.url)));}get all(){return this.models}get hasTransitions(){return this.transitioning}get hasAnimated(){return this.models.some(e=>e.isAnimated)}get isEmpty(){return this.models.length===0}get readyCount(){return this.models.filter(e=>e.visible&&e.isLoaded).length}render(e,t,o,r,i,a,s=0,l){if(this.models.length){this.drawnInstanced.clear(),l&&this.renderInstanced(e,t,l.shader,l.locations,i,a),o.use(),i(o),o.setInt("u_base_texture",Qr);for(let c of this.models){if(this.drawnInstanced.has(c)||!this.inView(t,c))continue;let f=c.visible&&c.fade>0?this.gpuFor(e,c,r):null;if(!f||!c.mesh)continue;let u=c.fade<1;o.setFloat("u_opacity",c.fade);let h=c.matrixFor(t);o.setMat4("u_matrix",h),o.setMat3("u_normal_matrix",c.normalMatrix());let d=a?this.shadowMatrix(t,c):null;this.uploadLights(o,c.mesh);let m=c.cameraInModelSpace(t);o.setVec3("u_camera_model",m[0],m[1],m[2]),o.setFloat("u_reflect",1),f.vao.bind();for(let p of [false,true])if(!(u&&!p))for(let b of c.mesh.primitives){if(!u&&b.blend!==p)continue;o.setMat4("u_matrix",b.node>=0?c.matrixForNode(t,b.node,s):h),d&&o.setMat4("u_shadow_matrix",b.node>=0?this.shadowMatrixForNodeAt(t,c,b.node,s):d);let g=b.texture>=0?f.textures[b.texture]:null;o.setFloat("u_has_texture",g?1:0),o.setFloat("u_alpha_cutoff",b.alphaCutoff),g&&e.bindTexture(Qr,g),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 s=new fe;for(let c of this.models){if(!c.visible||c.fade<1||!c.mesh||!c.isLoaded||!this.inView(t,c)||c.mesh.primitives.some(u=>u.blend||u.node>=0))continue;let f=s.get(c.url);f?f.push(c):s.set(c.url,[c]);}let l=false;o.setFloat("u_reflect",0);for(let[,c]of s){if(c.length<2)continue;let f=this.gpuFor(e,c[0],r);if(!f||!c[0].mesh)continue;this.instBuffer||(this.instBuffer=new Je(e,this.instScratch,yh,true)),f.instVao||(f.instVao=new Ne(e,[{buffer:f.vbo,locations:r},{buffer:this.instBuffer,locations:r}],f.ibo)),l||(o.use(),i(o),o.setInt("u_base_texture",Qr),o.setFloat("u_opacity",1),l=true);let u=c[0].mesh;for(let h=0;h<c.length;h+=Hs){let d=Math.min(Hs,c.length-h);for(let m=0;m<d;m++){let p=c[h+m],b=m*Li;this.instScratch.set(p.matrixFor(t),b);let g=a?this.shadowMatrix(t,p):Rb;this.instScratch.set(g,b+16),this.instScratch.set(p.normalMatrix(),b+32),this.drawnInstanced.add(p);}this.instBuffer.update(this.instScratch.subarray(0,d*Li)),e.bindVAO(f.instVao.vao);for(let m of u.primitives){let p=m.texture>=0?f.textures[m.texture]:null;o.setFloat("u_has_texture",p?1:0),o.setFloat("u_alpha_cutoff",m.alphaCutoff),p&&e.bindTexture(Qr,p),o.setVec4v("u_base_color",m.baseColor),o.setVec3("u_emissive",m.emissive[0],m.emissive[1],m.emissive[2]),o.setFloat("u_metallic",m.metallic),o.setFloat("u_roughness",m.roughness),e.setCull(m.doubleSided?"none":"back"),e.setBlend("none"),e.setDepthMask(true),e.gl.drawElementsInstanced(e.gl.TRIANGLES,m.indexCount,e.gl.UNSIGNED_INT,m.indexOffset*4,d);}}}l&&e.bindVAO(null);}uploadLights(e,t){let o=this.lightPacks.get(t);if(!o){let r=t.lights.filter(f=>f.type!=="directional"),i=r.length<=Zo?r:[...r].sort((f,u)=>u.intensity-f.intensity).slice(0,Zo),a=new Float32Array(Zo*4),s=new Float32Array(Zo*4),l=new Float32Array(Zo*4),c=new Float32Array(Zo*4);i.forEach((f,u)=>{let h=u*4;a[h]=f.position[0],a[h+1]=f.position[1],a[h+2]=f.position[2],a[h+3]=f.range,s[h]=f.color[0]*f.intensity,s[h+1]=f.color[1]*f.intensity,s[h+2]=f.color[2]*f.intensity,s[h+3]=f.type==="spot"?1:0,l[h]=f.direction[0],l[h+1]=f.direction[1],l[h+2]=f.direction[2],c[h]=f.cosInner,c[h+1]=f.cosOuter;}),o={count:i.length,pos:a,color:s,dir:l,cone:c},this.lightPacks.set(t,o);}e.setInt("u_light_count",o.count),o.count!==0&&(e.setVec4Array("u_light_pos",o.pos),e.setVec4Array("u_light_color",o.color),e.setVec4Array("u_light_dir",o.dir),e.setVec4Array("u_light_cone",o.cone));}inView(e,t){if(!t.mesh)return false;let r=t.origin(),i=t.boundingRadiusM();return e.isSphereVisible(r.x,r.y,t.altitude+t.groundZ+i*.5,i)}advanceTransitions(){this.transitioning=false;for(let e of this.models){if(this.elevationAt){let t=e.origin();e.groundZ=this.elevationAt(t.x,t.y);}else e.groundZ!==0&&(e.groundZ=0);e.advanceGrow(this.growDurationSec)&&(this.transitioning=true),e.advanceFade(this.fadeDurationSec)&&(this.transitioning=true);}}renderDepth(e,t,o,r){if(this.models.length){o.use();for(let i of this.models){let a=i.visible&&i.fade>.5?this.gpuFor(e,i,r):null;if(!a||!i.mesh)continue;let s=this.shadowMatrix(t,i);o.setMat4("u_matrix",s),a.vao.bind();for(let l of i.mesh.primitives)l.blend||(o.setMat4("u_matrix",l.node>=0?this.shadowMatrixForNode(t,i,l.node):s),e.gl.drawElements(e.gl.TRIANGLES,l.indexCount,e.gl.UNSIGNED_INT,l.indexOffset*4));}e.bindVAO(null);}}shadowMatrix(e,t){let o=t.origin();return t.matrixInSpace(e.shadowObjectMatrix(o.x,o.y,t.altitude+t.groundZ),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+t.groundZ),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 Je(e,new Uint8Array(t.mesh.vertices),gh),s=new Ue(e,t.mesh.indices),l=new Ne(e,[{buffer:a,locations:o}],s),c=t.bitmaps.map(u=>{if(!u)return null;let h=i.createTexture();return h?(e.bindTexture(Qr,h),i.texImage2D(i.TEXTURE_2D,0,i.RGBA,i.RGBA,i.UNSIGNED_BYTE,u),i.generateMipmap(i.TEXTURE_2D),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,i.LINEAR_MIPMAP_LINEAR),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MAG_FILTER,i.LINEAR),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_S,i.REPEAT),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_T,i.REPEAT),h):null}),f=new Os(l,a,s,c);return f.users=1,this.counted.add(t),this.gpu.set(t.url,f),f}static get layout(){return gh}static get instanceLayout(){return yh}destroy(e){for(let t of this.gpu.values())t.destroy(e);this.gpu.clear(),this.models=[];}};var Gs=4,Ah=new Le;function xh(n){return e=>e.type==="line"&&pe(e.paint.elevation,n,0)>0}function Pb(n){Ah.has(n)||(Ah.add(n),console.warn(`[osmgl] ${n}`));}var Hb=.5,Ob=.01,Gb=300,zb=4,Ri=127,Wb=.5,Dt=128,wh=.004,en=5120,$r=5121,Qo=5122,vh=5123,$o=5126,Nb={stride:8,attribs:[{name:"a_pos",size:2,type:$o,offset:0}]},zs={stride:Ft,attribs:[{name:"a_pos",size:2,type:Qo,offset:0}]},Ch={stride:bt,attribs:[{name:"a_p0",size:2,type:Qo,offset:0},{name:"a_p1",size:2,type:Qo,offset:4},{name:"a_corner",size:2,type:en,offset:8},{name:"a_ground",size:2,type:en,offset:10},{name:"a_dist",size:1,type:$o,offset:12},{name:"a_width",size:1,type:$o,offset:16},{name:"a_lift",size:2,type:Qo,offset:20}]},Bh={stride:ao,attribs:[{name:"a_dcolor",size:4,type:$r,normalized:true,offset:0},{name:"a_dwidth",size:1,type:$o,offset:4}]},qo={stride:rt,attribs:[{name:"a_pos",size:2,type:Qo,offset:0},{name:"a_height",size:1,type:vh,offset:4},{name:"a_tint",size:1,type:$r,normalized:true,offset:6},{name:"a_ao",size:1,type:$r,normalized:true,offset:7},{name:"a_normal",size:3,type:en,normalized:true,offset:8},{name:"a_kind",size:1,type:$r,offset:11},{name:"a_wall",size:3,type:vh,offset:12}]},Vb={flat:0,water:1,foliage:2,sand:3,asphalt:4},Ub=[1,9,14,26,3],Mh={stride:Jt,attribs:[{name:"a_pos",size:2,type:$o,offset:0},{name:"a_level",size:1,type:Qo,offset:8},{name:"a_normal",size:3,type:en,normalized:true,offset:10},{name:"a_kind",size:1,type:$r,offset:13},{name:"a_bleed",size:2,type:en,offset:14}]},Pi=class{constructor(e,t,o,r,i,a,s=r,l=null){this.vao=e;this.buffer=t;this.ibo=o;this.indexCount=r;this.indexType=i;this.extent=a;this.capIndexOffset=s;this.dataBuffer=l;this.firstDrawTime=0;}destroy(){this.vao.destroy(),this.buffer.destroy(),this.dataBuffer?.destroy(),this.ibo.destroy();}},_h={enabled:false,resolution:1024,strength:.75,color:"#5a6b86",bias:.25};function Ws(n,e){if(n.z===e.z)return n.x===e.x&&n.y===e.y;if(n.z>e.z){let o=n.z-e.z;return n.x>>o===e.x&&n.y>>o===e.y}let t=e.z-n.z;return e.x>>t===n.x&&e.y>>t===n.y}var tn=class{constructor(){this.fill=null;this.surface=null;this.surfaceLocs=new fe;this.line=null;this.building=null;this.depth=null;this.groundShadow=null;this.sky=null;this.raster=null;this.rasterLayer=new _i;this.mediaLayer=new Ei;this.mediaSources=new fe;this.customLayers=[];this.globeBody=null;this.globeClip=null;this.globeMesh=null;this.quad=null;this.fillLocs=new fe;this.lineLocs=new fe;this.objectLine=null;this.objectLineLocs=new fe;this.buildingLocs=new fe;this.shadows={..._h};this.shadowTarget=null;this.shadowPlaceholder=null;this.fog=null;this.shadowActive=false;this.materialTime=0;this.materialAnimating=false;this.stencilIds=new fe;this.stampedHoles=new Le;this.yieldTargets=new Le;this.yieldSquares=new fe;this.yieldPass=false;this.yieldMarked=null;this.patternScale=1;this.debugTiles=false;this.cameraMeters=[0,0,0];this.dpr=1;this.detailScale=1;this.reliefScale=1;this.allowShadows=true;this.highlight=null;this.highlightGpu=new fe;this.highlightKey="";this.groundArrows=new Xr;this.highlightTris=new fe;this.fillHighlightGpu=new fe;this.fillHighlightKey="";this.footprintKey="";this.highlightFill=null;this.indoorMask=new Jr;this.terrain=new Fi;this.drapeTile=null;this.drapePending=false;this.terrainShader=null;this.terrainLocs=new fe;this.hiddenBuildings=new Set;this.seams=new xi;this.seamGpu=new fe;this.hiddenWithSeams=new fe;this.hiddenVenues=new Set;this.hiddenVenueLayer=null;this.hiddenCut=new fe;this.hiddenStamp="";this.bucketIdCache=new fe;this.surfaceCut=new fe;this.shadowDepthPerMeter=1;this.shadowTexelMeters=0;this.growDurationMs=350;this.symbols=null;this.objects=null;this.models=new lo;this.model=null;this.modelInstanced=null;this.modelDepth=null;this.modelLocs=new fe;this.modelInstLocs=new fe;this.uploadBudget=po("high").uploadBudget;this.uploadLeft=0;this.uploadDeferred=false;}get indoorOpen(){return this.indoorMask.active}syncHiddenStamp(){let e=r=>[...r].sort((i,a)=>i-a).join(","),t="";for(let[r,i]of this.seams.hiddenByTile)t+=`${r}=${e(i)};`;let o=e(this.hiddenBuildings)+"#"+e(this.hiddenVenues)+"#"+t;if(o!==this.hiddenStamp){this.hiddenStamp=o,this.hiddenWithSeams.clear();for(let[r,i]of this.seams.hiddenByTile){let a=new Set(this.hiddenBuildings);for(let s of i)a.add(s);this.hiddenWithSeams.set(r,a);}for(let r of this.hiddenCut.values())r?.vao.destroy(),r?.ibo.destroy();this.hiddenCut.clear();for(let r of this.surfaceCut.values())r?.vao.destroy(),r?.ibo.destroy();this.surfaceCut.clear();}}cutSurface(e,t,o,r,i,a){if(!a||!a.size)return null;let s=r+"|"+o,l=this.surfaceCut.get(s);if(l!==void 0&&(l===null||l.vbo===i))return l;l&&(l.vao.destroy(),l.ibo.destroy());let c=t.data?.buckets?.[o];if(!c||c.kind!=="surface"||!c.shapeFeatures||!c.shapeRanges)return null;let f=new Float64Array(c.shapeFeatures),u=new Uint32Array(c.shapeRanges),h=[],d=0;for(let v=0;v<f.length;d++){let w=f[v++],C=w>0;for(let B=0;B<w;B++)if(!a.has(f[v+B])){C=false;break}v+=w,C&&h.push(d);}if(!h.length)return this.surfaceCut.set(s,null),null;let m=new Uint32Array(c.indices),p=c.capIndexOffset??m.length,b=new Uint8Array(m.length);for(let v of h){for(let w=u[v*4];w<u[v*4+1];w++)b[w]=1;for(let w=u[v*4+2];w<u[v*4+3];w++)b[w]=1;}let g=[];for(let v=0;v<p;v++)b[v]||g.push(m[v]);let y=g.length;for(let v=p;v<m.length;v++)b[v]||g.push(m[v]);let A=new Ue(e,new Uint32Array(g)),x={vao:new Ne(e,[{buffer:i,locations:this.surfaceLocs}],A),ibo:A,vbo:i,mainCount:y,capCount:g.length-y};return this.surfaceCut.set(s,x),x}bucketIds(e,t,o){let r=this.bucketIdCache.get(e);if(r&&r.vbo===o)return r.ids;this.bucketIdCache.size>2e3&&this.bucketIdCache.clear();let i=new Set(new Float64Array(t));return this.bucketIdCache.set(e,{ids:i,vbo:o}),i}syncSeams(e,t,o){let r=e.get(De);if(!(!r||!r.visibleTiles.length))for(let i of t.layers){if(i.type!=="fill-extrusion"||(i.source??De)!==De||!t.layerVisibleAt(i,o))continue;let a=t.bucketKeyFor(i);if(a===null)continue;let s=i,l=r.visibleTiles[0].z;this.seams.update(r,a,{zoom:l,metersPerTile:ho(l),cornerRadius:s.cornerRadius,cornerSegments:s.cornerSegments})&&this.syncSeamGpu();return}}replacedIds(){return this.hiddenBuildings.size?this.hiddenBuildings:null}hiddenFor(e,t,o){return t?(o?this.hiddenWithSeams.get(o):void 0)??this.hiddenBuildings:e===this.hiddenVenueLayer?this.hiddenVenues:null}cutHidden(e,t,o,r,i,a,s=this.buildingLocs,l=null){if(!a||!a.size)return null;let c=r+"|"+o,f=this.hiddenCut.get(c);if(f!==void 0&&(f===null||f.vbo===i))return f;f&&(f.vao.destroy(),f.ibo.destroy());let u=t.data?.buckets?.[o];if(!u||!("featureIds"in u)||!u.featureIds)return null;let h=this.bucketIds(c,u.featureIds,i),[d,m]=a.size<h.size?[a,h]:[h,a],p=false;for(let x of d)if(m.has(x)){p=true;break}if(!p)return this.hiddenCut.set(c,null),null;let b=new Uint32Array(u.indices),g=new Float64Array(u.featureIds),y=[];for(let x=0;x*3<b.length;x++)a.has(g[x])||y.push(b[x*3],b[x*3+1],b[x*3+2]);let A=null;if(y.length<b.length){let x=new Ue(e,new Uint32Array(y));A={vao:new Ne(e,l?[{buffer:i,locations:s},{buffer:l,locations:s}]:[{buffer:i,locations:s}],x),ibo:x,count:y.length,vbo:i};}return this.hiddenCut.set(c,A),A}init(e){this.symbols?.init(e),this.fill=new Ye(e,"fill",Ou,Gu),this.surface=new Ye(e,"surface",Xu,Ju),this.line=new Ye(e,"line",zu,Wu),this.objectLine=new Ye(e,"objectLine",Nu,Vu),this.building=new Ye(e,"buildings",Uu,Ku),this.depth=new Ye(e,"depth",Cu,ys),this.groundShadow=new Ye(e,"groundShadow",Lu,Ru),this.terrainShader=new Ye(e,"terrain",Pu,Hu),this.terrainLocs=new fe;for(let i of ["a_pos","a_skirt"])this.terrainLocs.set(i,this.terrainShader.attribLocation(i));this.sky=new Ye(e,"sky",Su,Fu),this.raster=new Ye(e,"raster",Tu,ku),this.globeBody=new Ye(e,"globeBody",Au,xu),this.globeClip=new Ye(e,"globeClip",wu,vu),this.globeMesh=Kb(e,this.globeBody),this.model=new Ye(e,"model",Mu,xs),this.modelInstanced=new Ye(e,"model-instanced",_u,xs),this.modelDepth=new Ye(e,"modelDepth",Eu,ys);for(let i of lo.layout.attribs)this.modelLocs.set(i.name,this.model.attribLocation(i.name));for(let i of [...lo.layout.attribs,...lo.instanceLayout.attribs])this.modelInstLocs.set(i.name,this.modelInstanced.attribLocation(i.name));this.shadowPlaceholder=gu(e);let t=new fe([["a_pos",this.groundShadow.attribLocation("a_pos")]]),o=new Je(e,new Float32Array([0,0,1,0,1,1,0,1]),Nb),r=new Ue(e,new Uint16Array([0,1,2,0,2,3]));this.quad={vao:new Ne(e,[{buffer:o,locations:t}],r),vbo:o,ibo:r};for(let i of zs.attribs)this.fillLocs.set(i.name,this.fill.attribLocation(i.name));for(let i of Mh.attribs)this.surfaceLocs.set(i.name,this.surface.attribLocation(i.name));for(let i of Ch.attribs)this.lineLocs.set(i.name,this.line.attribLocation(i.name));for(let i of Ls.attribs)this.objectLineLocs.set(i.name,this.objectLine.attribLocation(i.name));this.objectLineLocs.set("a_ground",this.objectLine.attribLocation("a_ground")),this.fillLocs.set("a_ground",this.fill.attribLocation("a_ground"));for(let i of qo.attribs)this.buildingLocs.set(i.name,this.building.attribLocation(i.name));for(let[i,a]of [[this.fillLocs,this.fill],[this.lineLocs,this.line],[this.buildingLocs,this.building]])for(let s of Bh.attribs)i.set(s.name,a.attribLocation(s.name));}render(e,t,o,r,i,a=new fe){if(!this.fill||!this.line||!this.building)return false;let s=t.zoom,l=false;this.uploadLeft=this.uploadBudget,this.uploadDeferred=false,this.yieldTargets=us(r,s),this.yieldSquares.clear(),this.materialTime=i/1e3,this.materialAnimating=false,this.fog=Jo(t,r),this.patternScale=kn/Math.max(Mt(t.center.lat),1),this.dpr=t.width>0?e.gl.drawingBufferWidth/t.width:1;let c=Math.max(t.pixelsPerMeter,1e-9),f=t.cameraPositionPx;this.cameraMeters=[f[0]/c,f[1]/c,f[2]/c];let u=b=>o.get(b.source??De);this.syncHighlightFootprint(o,r),this.indoorMask.sync(o,r,s),this.symbols&&(this.symbols.elevationAt=this.terrain.enabled?(b,g)=>this.terrain.heightAtMerc(b,g):null),this.syncSeams(o,r,s),this.syncHiddenStamp(),this.objects&&(this.objects.elevationAt=this.terrain.enabled?(b,g)=>this.terrain.heightAtMerc(b,g):null,this.objects.elevationRevision=this.terrain.revision),this.models.elevationAt=this.terrain.enabled?(b,g)=>this.terrain.heightAtMerc(b,g):null,this.models.advanceTransitions(),this.renderShadowMap(e,t,o,r,i),this.drawSky(e,t,r),this.drawGlobeBody(e,t,r),this.raster&&this.quad&&(this.rasterLayer.render(e,t,this.quad.vao,this.raster,r,a,s),this.mediaLayer.render(e,t,r,this.mediaSources,s,false)),this.drawTileStencil(e,t,o),e.setDepthTest(t.globeActive),e.setDepthFunc("lequal"),e.setDepthMask(false),e.setBlend("premultiplied"),e.setCull("none"),this.terrain.enabled?this.drapeTerrain(e,t,o,r,u,s):this.drawFlatLayers(e,t,r,u,s),this.terrain.enabled||this.drawFillHighlight(e,t,o,r),this.groundArrows&&!this.terrain.enabled&&(this.groundArrows.highlightFootprint=this.highlightFootprint(),this.groundArrows.render(e,t,o,r,this.fill,this.fillLocs,b=>{this.applyFogUniforms(b,t,r),b.setVec4("u_globe",0,0,0,0),b.setInt("u_material",0),b.setFloat("u_elevation",0),b.setVec2("u_world_origin",0,0);},this.shadowActive)),this.terrain.enabled||this.drawGroundShadow(e,t,o,r),this.terrain.enabled||this.drawEarthDepth(e,t,o,r),e.setDepthTest(true),e.setDepthMask(true),e.setDepthFunc("lequal"),e.setCull("back");for(let b of r.layers){if(b.type!=="surface"||b.overlay||!r.layerVisibleAt(b,s))continue;let g=u(b);g&&(this.flattened(g,r,b)||this.drawSurface(e,t,g,r,b,s));}e.setStencilTest(false),e.setDepthMask(false),e.setBlend("premultiplied"),e.setCull("none"),e.setDepthTest(false);let h=xh(s),d=new Set,m=this.terrain.enabled;m||this.beginYield();for(let b of r.layers){if(m)break;if(b.type==="raster"||!h(b)||b.overlay||!r.layerVisibleAt(b,s))continue;let g=u(b);if(g){if(b.type==="line"&&b.network){if(d.has(b.network))continue;d.add(b.network),this.drawNetwork(e,t,r,u,b.network,s,y=>!y.overlay&&h(y)&&r.layerVisibleAt(y,s));continue}this.drawLine(e,t,g,r,b,s);}}this.endYield(e),this.drawOverlay(e,t,r,u,s,"roads"),e.setDepthTest(true),e.setDepthMask(true),e.setCull("back");for(let b of r.layers){if(b.type!=="fill-extrusion"||!r.layerVisibleAt(b,s))continue;let g=u(b);g&&(this.drawBuildings(e,t,g,r,b,s,i)&&(l=true),this.drawHighlight(e,t,g,r,b,s));}this.model&&!this.models.isEmpty&&(this.models.render(e,t,this.model,this.modelLocs,b=>{this.applyShadowUniforms(b),this.applyFogUniforms(b,t,r),this.applyLight(b,r);},this.shadowActive,i/1e3,this.modelInstanced?{shader:this.modelInstanced,locations:this.modelInstLocs}:void 0),(this.models.hasAnimated||this.models.hasTransitions)&&(l=true)),this.drawOverlay(e,t,r,u,s,"volume"),this.objects&&!this.objects.isEmpty&&(e.setDepthTest(true),e.setDepthFunc("lequal"),e.setDepthMask(false),e.setBlend("premultiplied"),e.setCull("none"),this.objects.render(e,t,this.fill,this.fillLocs,this.objectLine,this.objectLineLocs,b=>{this.applyFogUniforms(b,t,r),b.setVec4("u_globe",0,0,0,0),b.setInt("u_material",0),b.setFloat("u_elevation",0),b.setVec2("u_world_origin",0,0);},this.shadowActive),e.setDepthTest(false)),this.raster&&this.quad&&(this.rasterLayer.render(e,t,this.quad.vao,this.raster,r,a,s,true),this.mediaLayer.render(e,t,r,this.mediaSources,s,true));let p=this.terrain.enabled?[]:r.layers.filter(b=>b.type==="line"&&pe(b.paint.ghostOpacity,s,0)>.001&&r.layerVisibleAt(b,s));if(p.length){e.setDepthTest(true),e.setDepthFunc("greater"),e.setDepthMask(false),e.setBlend("premultiplied"),e.setCull("none");for(let b of p){let g=u(b);g&&this.drawLine(e,t,g,r,b,s,pe(b.paint.ghostOpacity,s,0));}e.setDepthFunc("lequal"),e.setDepthTest(false);}return this.objects&&!this.objects.isEmpty&&(e.setDepthTest(true),e.setDepthFunc("greater"),e.setDepthMask(false),e.setBlend("premultiplied"),e.setCull("none"),this.objects.render(e,t,this.fill,this.fillLocs,this.objectLine,this.objectLineLocs,b=>{this.applyFogUniforms(b,t,r),b.setVec4("u_globe",0,0,0,0),b.setInt("u_material",0),b.setFloat("u_elevation",0),b.setVec2("u_world_origin",0,0);},this.shadowActive,true),e.setDepthFunc("lequal"),e.setDepthTest(false)),this.symbols&&(this.symbols.highlightFootprint=this.highlightFootprint()),this.symbols?.render(e,t,o,r),e.bindVAO(null),l||this.materialAnimating||this.uploadDeferred||this.drapePending}renderShadowMap(e,t,o,r,i){if(this.shadowPlaceholder&&e.bindTexture(Gs,this.shadowPlaceholder),this.shadowActive=false,!this.shadows.enabled||!this.allowShadows||!this.depth)return;let a=r.layers.filter(d=>d.type==="fill-extrusion"&&!d.overlay&&r.layerVisibleAt(d,t.zoom));if(!a.length&&this.models.isEmpty)return;this.shadowTarget?this.shadowTarget.resize(this.shadows.resolution):this.shadowTarget=new Vr(e,this.shadows.resolution);let s=r.light,[l,c]=this.terrain.enabled?this.terrain.groundRange():[0,0];if(t.updateShadow(Bo(s.keyAzimuth,s.keyAltitude),Gb,l,c),!t.shadowReady)return;let f=this.shadowTarget;f.bind(),e.setDepthFunc("lequal"),e.setBlend("none"),e.setCull("none");let u=e.gl;u.enable(u.POLYGON_OFFSET_FILL),u.polygonOffset(2,4);let h=this.depth;h.use();for(let d of a){let m=o.get(d.source??De);if(!m)continue;let p=r.bucketKeyFor(d);if(p===null)continue;let b=pe(d.paint.heightScale,t.zoom,1);(d.source??De)===De&&this.indoorMask.prepare(m,p);for(let g of m.visibleTiles){if(!this.drawsTile(t,r,d,g))continue;let y=m.getTile(g),A=y&&this.bucketFor(e,y,p,qo,this.buildingLocs,"fill-extrusion");if(!A)continue;h.setFloat("u_height_scale",this.growScale(A,i,!m.warm)*b),this.applyTileScale(h,g,A.extent,e),h.setMat4("u_matrix",t.shadowTileMatrix(g,A.extent));let x=(d.source??De)===De,v=this.cutHidden(e,y,p,g.dataKey,A.buffer,this.hiddenFor(p,x,g.dataKey)),w=x?v??this.indoorMask.indicesFor(e,y,p,g,A.buffer,this.buildingLocs):v;w?(w.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,w.count,e.gl.UNSIGNED_INT,0)):(A.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,A.indexCount,A.indexType,0));}}if(this.seams.meshes.size){let d=a.find(m=>(m.source??De)===De);if(d){h.setFloat("u_height_scale",pe(d.paint.heightScale,t.zoom,1));for(let[m,{tile:p,mesh:b}]of this.seams.meshes){let g=this.seamBucket(e,m,b);h.setMat4("u_matrix",t.shadowTileMatrix(p,b.extent)),g.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,b.indexCount,e.gl.UNSIGNED_INT,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)),u.disable(u.POLYGON_OFFSET_FILL),e.bindFramebuffer(null),e.viewport(0,0,e.gl.drawingBufferWidth,e.gl.drawingBufferHeight),f.bindTexture(Gs),this.shadowDepthPerMeter=t.shadowDepthPerMeter(),this.shadowTexelMeters=Math.abs(t.shadowTexelWorldSize(f.size))/(t.pixelsPerMeter||1),this.shadowActive=true;}drawGlobeBody(e,t,o){if(!t.globeActive||!this.globeBody||!this.globeMesh)return;let r=this.globeBody;r.use(),this.applyGlobeUniforms(r,t,o),r.setMat4("u_matrix",t.localMatrix());let i=o.background;r.setVec3("u_body_color",i[0],i[1],i[2]),Tt(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(Qe(i,t.localProjMatrix,r),i[3]<=1e-6)return;let a=this.globeClip;a.use(),a.setFloat("u_center_depth",i[2]/i[3]),o.colorMask(false,false,false,false),e.setDepthTest(true),e.setDepthMask(true),e.setDepthFunc("always"),this.quad.vao.bind(),o.drawElements(o.TRIANGLES,6,o.UNSIGNED_SHORT,0),o.colorMask(true,true,true,true),e.bindVAO(null);}applyAtmosphere(e,t,o){let r=t.cameraRay();e.setVec3("u_cam_ray",r.axisElev,r.focal*this.dpr,t.height*this.dpr/2),e.setFloat("u_haze_exp",1/Math.max(o.sky.horizonBlend,.01));}skyBand(e,t){let o=e.horizonScreenY(),r=e.height*this.dpr/Math.max(At(e.fov),.001);return [(e.height-o)*this.dpr,Math.max(o,1)*this.dpr,Math.max(t.sky.horizonBlend*r,1)]}drawSky(e,t,o){if(!this.sky||!this.quad||!o.sky.enabled)return;let r=this.sky;r.use(),Tt(r,"u_sky_color",o.sky.skyColor),Tt(r,"u_horizon_color",o.sky.horizonColor),Xb(r,o.sky);let[i,a]=this.skyBand(t,o),s=Math.min(a*.5,t.height*this.dpr*.1);r.setVec3("u_sky_params",i,a,s),this.applyAtmosphere(r,t,o);let l=t.cameraRay();r.setVec3("u_cam_right",l.right[0],l.right[1],l.right[2]),r.setVec3("u_cam_up",l.up[0],l.up[1],l.up[2]),r.setVec3("u_cam_fwd",l.fwd[0],l.fwd[1],l.fwd[2]),r.setVec2("u_cam_center",t.width*this.dpr/2,t.height*this.dpr/2);let c=Bo(o.light.keyAzimuth,o.light.keyAltitude);r.setVec3("u_sun_dir",-c[0],-c[1],-c[2]),Tt(r,"u_sun_color",o.light.keyColor),r.setFloat("u_sun_glow",o.light.keyIntensity);let f=t.globeActive?1-t.globeFlatMix:0;if(r.setVec2("u_space",f,o.sky.starIntensity),f>.001){Tt(r,"u_space_color",o.sky.spaceColor),Tt(r,"u_atmo_color",o.sky.atmosphereColor);let u=t.globeDisc();r.setVec4("u_globe_disc",u.dir[0],u.dir[1],u.dir[2],u.angle);let[h,d,m,p]=t.localRayCorners();r.setVec3("u_ray_tl",h[0],h[1],h[2]),r.setVec3("u_ray_tr",d[0],d[1],d[2]),r.setVec3("u_ray_bl",m[0],m[1],m[2]),r.setVec3("u_ray_br",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,o){if(!t.globeActive){e.setVec4("u_globe",0,0,0,0);return}let r=t.globeBasis,i=t.worldSize;e.setVec4("u_globe",1,t.globeFlatMix,t.globeRadiusPx,i),e.setVec2("u_globe_center",t.centerPointPx.x/i,t.centerPointPx.y/i);let a=t.globeCamera();e.setVec4("u_globe_cam",a.dir[0],a.dir[1],a.dir[2],a.horizonCos);let s=Bo(o.light.keyAzimuth,o.light.keyAltitude);e.setVec3("u_globe_sun",-s[0],-s[1],-s[2]),e.setVec2("u_globe_light",.16,.14),e.setMat3("u_globe_basis",[r.east[0],r.south[0],r.up[0],r.east[1],r.south[1],r.up[1],r.east[2],r.south[2],r.up[2]]);}drawFlatLayers(e,t,o,r,i,a=false){let s=xh(i),l=new Set;for(let c of o.layers){if(this.drawCustomBefore(e,t,c.id),c.type==="raster"||c.type==="fill-extrusion"||c.type==="symbol"||c.overlay||s(c)&&!a||!o.layerVisibleAt(c,i))continue;let f=r(c);if(f){if(c.type==="line"&&c.network){if(l.has(c.network))continue;l.add(c.network),this.drawNetwork(e,t,o,r,c.network,i,u=>!u.overlay&&(a||!s(u))&&o.layerVisibleAt(u,i));continue}if(c.type==="surface"){if(!this.flattened(f,o,c))continue;this.drawFill(e,t,f,o,c,i);continue}c.type==="fill"?this.drawFill(e,t,f,o,c,i):this.drawLine(e,t,f,o,c,i);}}this.drawCustomRest(e,t,o);}drawCustomBefore(e,t,o){if(this.customLayers.length)for(let r of this.customLayers)r.before===o&&this.drawCustom(e,t,r.layer);}drawCustomRest(e,t,o){if(!this.customLayers.length)return;let r=new Set(o.layers.map(i=>i.id));for(let i of this.customLayers)i.before!==void 0&&r.has(i.before)||this.drawCustom(e,t,i.layer);}drawCustom(e,t,o){let r=e.gl;try{o.render(r,t.objectMatrix(0,0,0));}catch(i){console.warn(`[osmgl] \u0441\u0432\u043E\u0439 \u0441\u043B\u043E\u0439 \xAB${o.id}\xBB \u0443\u043F\u0430\u043B \u043F\u0440\u0438 \u043E\u0442\u0440\u0438\u0441\u043E\u0432\u043A\u0435:`,i instanceof Error?i.message:i);}e.resetState();}drapeTerrain(e,t,o,r,i,a){let s=o.get(De),l=this.terrainShader;if(!s||!l)return;let c=e.gl,f=r.background,u=this.terrain.tilesFor(t);if(!u.length)return;let h=this.terrain.sizesFor(t,u,this.dpr),d=0;this.drapePending=false;let m=Ws,p=Math.round(a*4)/4,b=new Set;for(let W=0;W<u.length;W++){let z=u[W],L=h[W];b.add(z.dataKey);let X=[p.toString()];for(let[ie,ee]of o)for(let ue of ee.visibleTiles)m(z,ue)&&X.push(`${ie}/${ue.dataKey}:${ee.getTile(ue)?.state??""}`);let Q=X.join(","),{target:G,fresh:Y}=this.terrain.targetFor(e,z.dataKey,L);if(G.key!==Q){if(d>=zb){Y&&G.clear(f),this.drapePending=true;continue}d++,G.key=Q,e.bindFramebuffer(G.framebuffer),e.viewport(0,0,L,L),c.clearColor(f[0],f[1],f[2],1),c.clear(c.COLOR_BUFFER_BIT),e.setDepthTest(false),e.setDepthMask(false),e.setBlend("premultiplied"),e.setCull("none"),e.setStencilTest(false),this.drapeTile={terrain:z},this.drawFlatLayers(e,t,r,i,a,true),this.drawFillHighlight(e,t,o,r),this.groundArrows&&(this.groundArrows.highlightFootprint=this.highlightFootprint(),this.groundArrows.render(e,t,o,r,this.fill,this.fillLocs,ie=>{this.applyFogUniforms(ie,t,r),ie.setVec4("u_globe",0,0,0,0),ie.setInt("u_material",0),ie.setFloat("u_elevation",0),ie.setVec2("u_world_origin",0,0);},this.shadowActive)),this.drawGroundShadow(e,t,o,r),this.drapeTile=null;}}this.terrain.keepOnly(b),e.bindFramebuffer(null),e.viewport(0,0,c.drawingBufferWidth,c.drawingBufferHeight),c.clearColor(f[0],f[1],f[2],1),l.use(),e.setDepthTest(true),e.setDepthFunc("lequal"),e.setDepthMask(true),e.setBlend("none"),e.setCull("none"),e.setStencilTest(false);let g=this.terrain.meshOf(e,this.terrainLocs);l.setInt("u_texture",0),this.applyFogUniforms(l,t,r);let y=r.spec.terrain?.tint,A=y?.low===void 0&&y?.high!==void 0,x=y?.high!==void 0,v=x?Ve(y.high)??[1,1,1,1]:[1,1,1,1],w=A?v:x?Ve(y.low)??[1,1,1,1]:[1,1,1,1],C=y?.mid?Ve(y.mid)??w:[0,1,2].map(W=>(w[W]+v[W])/2).concat(1),B=y?.range??[500,4e3],_=Math.min(Math.max((16-a)/3,0),1);l.setVec3("u_relief_low",w[0],w[1],w[2]),l.setVec3("u_relief_mid",C[0],C[1],C[2]),l.setVec3("u_relief_high",v[0],v[1],v[2]),l.setVec2("u_relief_range",B[0],B[1]),l.setVec3("u_relief_mix",(x?y.tint??.5:0)*_,(y?y.shade??.7:0)*(.35+.65*_),A?1:0);let T=r.light,[k,K,P]=Bo(T.keyAzimuth,T.keyAltitude);l.setVec3("u_relief_light",-k,-K,-P),g.vao.bind();for(let W of u){let z=this.terrain.targetOf(W.dataKey);z&&(this.terrain.apply(e,l,W),e.bindTexture(0,z.texture),l.setFloat("u_skirt",this.terrain.skirtMeters(W.z)),l.setFloat("u_tile_meters",ho(W.z)),l.setMat4("u_matrix",t.tileMatrix(W,1)),c.drawElements(c.TRIANGLES,g.count,c.UNSIGNED_INT,0));}e.bindVAO(null);}applyTileMatrix(e,t,o,r){if(this.drapeTile){let i=this.drapeTile.terrain,a=Math.pow(2,i.z-o.z),s=2*a/r,l=2*(o.x*a-i.x)-1,c=1-2*(o.y*a-i.y);e.setMat4("u_matrix",new Float32Array([s,0,0,0,0,-s,0,0,0,0,0,0,l,c,0,1]));return}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??Jo(t,o);if(r.intensity<=0){e.setVec3("u_fog_range",0,1,0),e.setVec2("u_fog_vertical",0,0),this.applyAtmosphere(e,t,o);return}Tt(e,"u_fog_color",o.sky.horizonColor),e.setVec3("u_fog_range",r.near,r.far,r.intensity);let[i,a]=o.sky.fogVerticalRange;e.setVec2("u_fog_vertical",i,a),this.applyAtmosphere(e,t,o);}drawsTile(e,t,o,r){if(this.drapeTile)return Ws(this.drapeTile.terrain,r);if(this.terrain.enabled&&!this.terrain.covers(r))return false;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,pe(i.paint.elevation,t.zoom,0)*this.reliefScale));let r=Math.max(Hb/Math.max(t.pixelsPerMeter,1e-9),Ob);return o-r}holesOf(e){return this.stampedHoles.size?e.holeTiles.filter(t=>this.stampedHoles.has(t.dataKey)):[]}clippedTiles(e){let t=this.holesOf(e);return t.length?[...t,...e.visibleTiles]:e.visibleTiles}beginYield(){this.yieldPass=true;}yieldFor(e,t,o){let r=o.yieldTo;if(!r||!this.yieldPass||this.drapeTile||t.globeActive)return false;let i=this.yieldSquares.get(r);return i?.length?(this.yieldMarked===r||(this.yieldMarked!==null&&this.clearYieldBit(e),this.stampYieldSquares(e,t,i),this.yieldMarked=r),true):false}endYield(e){this.yieldMarked!==null&&this.clearYieldBit(e),this.yieldMarked=null,this.yieldPass=false;}stampYieldSquares(e,t,o){if(!this.fill||!this.quad)return;let r=e.gl;e.setStencilTest(true),r.stencilMask(Dt),r.stencilFunc(r.ALWAYS,Dt,Dt),r.stencilOp(r.KEEP,r.KEEP,r.REPLACE),e.setColorMask(false);let i=this.fill;i.use(),i.setVec4("u_globe",0,0,0,0),i.setInt("u_material",0),i.setVec2("u_world_origin",0,0),i.setVec4("u_color",0,0,0,1),i.setFloat("u_elevation",0),this.quad.vao.bind();for(let a of o)i.setMat4("u_matrix",t.tileMatrix(a,1)),r.drawElements(r.TRIANGLES,6,r.UNSIGNED_SHORT,0);e.bindVAO(null),e.setColorMask(true),r.stencilOp(r.KEEP,r.KEEP,r.KEEP),r.stencilMask(255),e.setStencilTest(false);}clearYieldBit(e){e.gl.stencilMask(Dt),e.clear(null,false,true),e.gl.stencilMask(255);}clipLine(e,t,o){let r=this.stampedHoles.has(t.dataKey)&&!this.drapeTile?this.stencilIds.get(t.dataKey):void 0;if(r===void 0&&!o){e.setStencilTest(false);return}e.setStencilTest(true);let i=(r!==void 0?Ri:0)|(o?Dt:0);e.gl.stencilFunc(e.gl.EQUAL,r??0,i);}clipToTile(e,t){if(this.drapeTile){e.setStencilTest(false);return}let o=this.stencilIds.get(t.dataKey);e.setStencilTest(o!==void 0),o!==void 0&&e.gl.stencilFunc(e.gl.EQUAL,o,Ri);}drawTileStencil(e,t,o){if(this.stencilIds.clear(),this.stampedHoles.clear(),t.globeActive){e.gl.stencilMask(255),e.clear(null,false,true),e.setStencilTest(false);return}let r=o.get(De);if(!r||!this.fill||!this.quad)return;let i=r.holeTiles,a=i.length?[...i,...r.visibleTiles]:r.visibleTiles;if(!a.length||a.length>Ri)return;let s=e.gl;s.stencilMask(255),e.clear(null,false,true),e.setStencilTest(true),s.stencilOp(s.KEEP,s.KEEP,s.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 c=0;for(let f=0;f<a.length;f++){let u=a[f];c++,this.stencilIds.set(u.dataKey,c),f<i.length&&this.stampedHoles.add(u.dataKey),s.stencilFunc(s.ALWAYS,c,Ri),l.setMat4("u_matrix",t.tileMatrix(u,1)),s.drawElements(s.TRIANGLES,6,s.UNSIGNED_SHORT,0);}e.bindVAO(null),e.setColorMask(true),s.stencilOp(s.KEEP,s.KEEP,s.KEEP),e.setStencilTest(false);}drawEarthDepth(e,t,o,r){if(!this.fill||!this.quad||t.globeActive)return;let i=o.get(De);if(!i)return;let a=this.fill;a.use(),this.applyFogUniforms(a,t,r),a.setVec4("u_globe",0,0,0,0),a.setInt("u_material",0),a.setVec2("u_world_origin",0,0),a.setVec4("u_color",0,0,0,1),a.setFloat("u_elevation",0);let s=this.earthDepthLevel(r,t);e.gl.colorMask(false,false,false,false),e.setDepthTest(true),e.setDepthFunc("lequal"),e.setDepthMask(true),e.setCull("none"),e.gl.enable(e.gl.POLYGON_OFFSET_FILL),e.gl.polygonOffset(1,8),this.quad.vao.bind();let l=new Float32Array(16);for(let c of i.visibleTiles){let f=t.tileMatrix(c,1);l.set(f);for(let u=0;u<4;u++)l[12+u]+=s*f[8+u];a.setMat4("u_matrix",l),e.gl.drawElements(e.gl.TRIANGLES,6,e.gl.UNSIGNED_SHORT,0);}e.bindVAO(null),e.gl.disable(e.gl.POLYGON_OFFSET_FILL),e.gl.colorMask(true,true,true,true);}drawGroundShadow(e,t,o,r){if(!this.shadowActive||!this.groundShadow||!this.quad)return;let i=o.get(De);if(!i)return;let a=this.groundShadow;a.use(),this.applyShadowUniforms(a,true),this.applyFogUniforms(a,t,r);let s=r.light,[,,l]=Bo(s.keyAzimuth,s.keyAltitude),c=Math.max(-l,0),f=Ve(s.ambientColor),u=Ve(s.keyColor),h=[0,0,0];for(let d=0;d<3;d++){let m=f[d]*s.ambientIntensity,p=u[d]*s.keyIntensity*c;h[d]=m>0?m/(m+p):1;}a.setVec3("u_shadow_ground",h[0],h[1],h[2]),a.setFloat("u_ground_ndotl",c),e.setBlend("multiply"),e.setDepthTest(false),e.setDepthMask(false),e.setCull("none"),this.quad.vao.bind();for(let d of i.visibleTiles)this.drapeTile&&!Ws(this.drapeTile.terrain,d)||(a.setMat4("u_shadow_matrix",t.shadowTileMatrix(d,1)),this.applyTileMatrix(a,t,d,1),this.terrain.apply(e,a,d),e.gl.drawElements(e.gl.TRIANGLES,6,e.gl.UNSIGNED_SHORT,0));e.setBlend("premultiplied");}applyShadowUniforms(e,t=false){if(e.setInt("u_shadow_map",Gs),!this.shadowActive){e.setVec4("u_shadow_params",0,0,0,0);return}let o=this.shadowTarget?.size??1,i=(t?.25*this.shadowTexelMeters:Math.max(this.shadows.bias,1.5*this.shadowTexelMeters))*(this.shadowDepthPerMeter||1);e.setVec4("u_shadow_params",this.shadows.strength,1/o,i,1),e.setFloat("u_shadow_normal_offset",1.5*2/o);let a=Ve(this.shadows.color);e.setVec3("u_shadow_color",a[0],a[1],a[2]);}get shadowsActive(){return this.shadowActive}drawOverlay(e,t,o,r,i,a){let s=()=>{e.setDepthTest(false),e.setDepthMask(false),e.setBlend("premultiplied"),e.setCull("none");};s();for(let l of o.layers){if(l.type==="raster"||l.type==="symbol"||l.type==="fill-extrusion"||!l.overlay||(l.overlay===true?"volume":l.overlay)!==a||!o.layerVisibleAt(l,i))continue;let c=r(l);if(c){if(l.type==="surface"){this.flattened(c,o,l)?this.drawFill(e,t,c,o,l,i):this.drawSurface(e,t,c,o,l,i),s();continue}l.type==="fill"?this.drawFill(e,t,c,o,l,i):this.drawLine(e,t,c,o,l,i);}}}tileTint(e){let o=((e.x%3+3)%3*2+(e.y%2+2)%2)/6,r=i=>{let a=(i+o*6)%6;return 1-Math.max(0,Math.min(1,Math.min(a,4-a)))};return [r(5),r(3),r(1)]}applyTileScale(e,t,o,r){if(e.setFloat("u_extent",o),this.terrain.apply(r,e,t),this.debugTiles){let[c,f,u]=this.tileTint(t);e.setVec4("u_tile_tint",c,f,u,Wb);}else e.setVec4("u_tile_tint",0,0,0,0);let i=ho(t.z)/this.patternScale;e.setFloat("u_meters_per_unit",i/o);let[a,s]=Nl(t.z,t.x,t.y);e.setVec2("u_world_origin",a/this.patternScale,s/this.patternScale);let l=this.cameraMeters;e.setVec3("u_camera_local",l[0]-t.x*i,l[1]-t.y*i,l[2]);}applyMaterial(e,t,o){let r=t.paint&&"material"in t.paint?t.paint.material:void 0,i=this.detailScale<=0?0:Vb[r??"flat"]??0;if(e.setInt("u_material",i),i===0)return;let a=t.paint,s=pe(a.materialStrength,o,1)*this.detailScale,l=pe(a.materialScale,o,Ub[i]),c=pe(a.materialSpeed,o,i===1?1:0);e.setVec4("u_material_params",s,l,c,this.materialTime),c>0&&s>.004&&(this.materialAnimating=true);}drawFill(e,t,o,r,i,a){let s=this.fill,l=r.colorAt(i,a),c=pe(i.paint?.opacity,a,1);if(c<=.001)return;s.use(),this.applyFogUniforms(s,t,r),this.applyGlobeUniforms(s,t,r),this.applyLight(s,r),this.applyMaterial(s,i,a),s.setVec4v("u_color",it([l[0],l[1],l[2],l[3]*c])),s.setFloat("u_opacity",c);let f=jt(i)!==null,u=r.bucketKeyFor(i);if(u===null)return;let h=this.yieldTargets.has(i.id)?[]:null;for(let d of this.clippedTiles(o)){if(!this.drawsTile(t,r,i,d))continue;let m=o.getTile(d),p=m&&this.bucketFor(e,m,u,zs,this.fillLocs,"fill");if(h&&m&&Ai(m.state,!!p,!!m.data?.buckets?.[u])&&h.push(d),!p)continue;s.setFloat("u_data_color",f&&p.dataBuffer?1:0),this.clipToTile(e,d),this.shadowActive&&s.setMat4("u_shadow_matrix",t.shadowTileMatrix(d,p.extent)),this.applyTileScale(s,d,p.extent,e),this.applyTileMatrix(s,t,d,p.extent);let b=this.cutHidden(e,m,u,d.dataKey,p.buffer,this.replacedIds(),this.fillLocs,p.dataBuffer);b?(b.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,b.count,e.gl.UNSIGNED_INT,0)):(p.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,p.indexCount,p.indexType,0));}h&&this.yieldSquares.set(i.id,h),s.setFloat("u_data_color",0),e.setStencilTest(false);}drawLine(e,t,o,r,i,a,s=0,l){let c=this.line,f=r.colorAt(i,a),u=pe(i.paint.opacity,a,1)*(s||1),h=pe(i.paint.width,a,1);if(u<=.001||h<=.01&&!i.paint.widthMeters)return;let d=e.gl.drawingBufferWidth,m=e.gl.drawingBufferHeight,p=t.width>0?d/t.width:1,b=pe(i.paint.widthMeters,a,0),g=b>0?b*t.pixelsPerMeter*p/2:h/2*p,y=this.yieldFor(e,t,i);c.use();let A=i.depthTest===true&&this.yieldPass&&!this.drapeTile&&!t.globeActive;c.setFloat("u_depth_nudge",A?t.projZOffset*wh/(1-wh):0),A&&(e.setDepthTest(true),e.setDepthFunc("lequal"),e.setDepthMask(false)),this.applyShadowUniforms(c),this.applyFogUniforms(c,t,r),this.applyGlobeUniforms(c,t,r),this.applyLight(c,r),this.applyMaterial(c,i,a),c.setVec4v("u_color",it([f[0],f[1],f[2],f[3]*u])),c.setFloat("u_opacity",u);let x=jt(i);c.setFloat("u_center_w",t.cameraToCenterDistance);let v=pe(i.paint.offsetMeters,a,0),w=v!==0?v*t.pixelsPerMeter*p:pe(i.paint.offset,a,0)*p,C=Math.max(pe(i.paint.blur,a,0),0)*p,B=l!==void 0?Math.max(0,l)*(r.spec.levelHeight??0):0;c.setFloat("u_elevation",(pe(i.paint.elevation,a,0)+B)*this.reliefScale),c.setFloat("u_relief",this.reliefScale),c.setVec2("u_viewport",d,m);let _=i.paint.dashArray,T=i.paint.dashMeters,k=i.paint.arrow===true,K=i.paint.arrowStyle,P=k&&(K==="head"||K==="headOnly"),W=k&&K==="dash";if(c.setInt("u_pattern",W?5:_||T?1:K==="headOnly"&&k?4:P?3:k?2:0),T){let[L,X]=T,Q=t.pixelsPerMeter*p;c.setVec2("u_dash",L*Q,(L+X)*Q);}else if(_){let[L,X]=_;c.setVec2("u_dash",L*p,(L+X)*p);}if(k){let L=ht(i.paint.arrowColor,a,[1,1,1,1]);c.setVec4v("u_arrow_color",it(L));let X=pe(i.paint.arrowPeriod,a,46)*p,Q=pe(i.paint.arrowSize,a,5)*p;if(W){let G=pe(i.paint.arrowGap,a,24)*p,Y=Math.max(X-G,1),ie=Math.min(Q,Y),ee=pe(i.paint.arrowShaft,a,2)*p,ue=pe(i.paint.arrowHead,a,4)*p,$=pe(i.paint.arrowOutline,a,0)*p;c.setVec4("u_arrow",ee,ie,ue,Y),c.setVec2("u_dash",$,X);}else P?c.setVec4("u_arrow",X,Q,g,0):c.setVec4("u_arrow",X,Math.max(Q*.4,1),Math.min(Q,g*.72),0);}let z=r.bucketKeyFor(i);if(z!==null){for(let L of this.clippedTiles(o)){if(!this.drawsTile(t,r,i,L))continue;let X=o.getTile(L);if(!X)continue;this.clipLine(e,L,y);let Q=i.network?l!==void 0?[Ot(i.id,l)]:(X.data?.levels??[]).map(G=>Ot(i.id,G)):[z];for(let G of Q){let Y=this.bucketFor(e,X,G,Ch,this.lineLocs,"line");if(!Y)continue;let ie=Y.dataBuffer?x:null;c.setFloat("u_data_color",ie&&(ie.color!==void 0||ie.opacity!==void 0)?1:0),c.setFloat("u_data_width",ie&&ie.width!==void 0?1:0);let ee=L.bounds(),ue=(ee.maxX-ee.minX)*t.worldSize/Y.extent*p;c.setFloat("u_tile_to_px",ue);let $=ue>1e-6?1/ue:1;c.setFloat("u_half_width",g*$),c.setFloat("u_blur",C*$),c.setFloat("u_meters_to_units",t.pixelsPerMeter*$),c.setFloat("u_width_from_data",i.paint.widthFromData===true?1:0),c.setFloat("u_width_extra",pe(i.paint.widthExtra,a,0)*$),c.setFloat("u_offset",w*$),c.setFloat("u_tile_per_px",$),c.setFloat("u_px_to_units",p*$),this.applyTileScale(c,L,Y.extent,e),this.shadowActive&&c.setMat4("u_shadow_matrix",t.shadowTileMatrix(L,Y.extent)),this.applyTileMatrix(c,t,L,Y.extent);let Ae=this.cutHidden(e,X,G,L.dataKey,Y.buffer,this.replacedIds(),this.lineLocs,Y.dataBuffer);Ae?(Ae.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,Ae.count,e.gl.UNSIGNED_INT,0)):(Y.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,Y.indexCount,Y.indexType,0));}}c.setFloat("u_data_color",0),c.setFloat("u_data_width",0),e.setStencilTest(false),A&&e.setDepthTest(false);}}drawNetwork(e,t,o,r,i,a,s){let l=o.layers.filter(f=>f.type==="line"&&f.network===i&&s(f));if(!l.length)return;let c=new Set;for(let f of l){let u=r(f);if(u)for(let h of this.clippedTiles(u)){let d=u.getTile(h);for(let m of d?.data?.levels??[])c.add(m);}}if(c.size)for(let f of [...c].sort((u,h)=>u-h))for(let u of l){let h=r(u);h&&this.drawLine(e,t,h,o,u,a,0,f);}}drawHighlight(e,t,o,r,i,a){let s=this.highlight;if(!s||!this.building||s.layerId!==i.id)return;let l=`${i.id}/${s.featureId}`;this.highlightKey!==l&&(this.disposeHighlight(),this.highlightKey=l);let c=Ve(s.color)??[.31,.79,.5,1],f=this.building;f.use(),this.applyShadowUniforms(f),this.applyFogUniforms(f,t,r),this.applyLight(f,r),f.setVec4v("u_wall_color",[c[0],c[1],c[2],1]),f.setVec4v("u_roof_color",[c[0],c[1],c[2],1]),f.setFloat("u_opacity",s.opacity),f.setFloat("u_ao_strength",pe(i.paint.aoStrength,a,.4)),f.setFloat("u_tint_variation",0),f.setFloat("u_facade_detail",0),f.setFloat("u_ice",0),f.setFloat("u_window_glow",0),f.setFloat("u_roof_variation",0),f.setFloat("u_height_scale",pe(i.paint.heightScale,a,1)),e.setDepthFunc("lequal"),e.setDepthMask(false),e.setBlend("alpha");let u=e.gl;e.setStencilTest(true),u.stencilFunc(u.NOTEQUAL,Dt,Dt),u.stencilOp(u.KEEP,u.KEEP,u.REPLACE),u.stencilMask(Dt);let h=this.seams.stitched.has(s.featureId);h&&this.drawSeamHighlight(e,t,f,s.featureId);for(let d of h?[]:o.visibleTiles){let m=o.getTile(d);if(!m)continue;let p=m.data?.buckets?.[i.id];if(!p)continue;let b=d.dataKey,g=this.highlightGpu.get(b);if(g===void 0){let y=Ii(m,i.id,s.featureId);if(y){let A=new Je(e,new Uint8Array(y.vertices),qo),x=new Ue(e,y.indices);g={vao:new Ne(e,[{buffer:A,locations:this.buildingLocs}],x),vbo:A,ibo:x,count:y.indices.length};}else g=null;this.highlightGpu.set(b,g);}g&&(this.applyTileScale(f,d,p.extent,e),this.shadowActive&&f.setMat4("u_shadow_matrix",t.shadowTileMatrix(d,p.extent)),f.setMat4("u_matrix",t.tileMatrix(d,p.extent)),g.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,g.count,e.gl.UNSIGNED_INT,0));}e.setStencilTest(false),u.stencilOp(u.KEEP,u.KEEP,u.KEEP),u.stencilMask(255),e.setBlend("none"),e.setDepthMask(true);}refreshHighlight(){this.disposeHighlight();}disposeHighlight(){for(let e of this.highlightGpu.values())e&&(e.vao.destroy(),e.vbo.destroy(),e.ibo.destroy());this.highlightGpu.clear(),this.highlightTris.clear(),this.highlightKey="";}syncHighlightFootprint(e,t){let o=this.highlight;if(!o){this.highlightTris.size&&this.highlightTris.clear();return}let r=`${o.layerId}/${o.featureId}`;this.footprintKey!==r&&(this.highlightTris.clear(),this.footprintKey=r);let i=t.layers.find(l=>l.id===o.layerId),a=e.get(i?.source??De);if(!a)return;let s=new Le;for(let l of a.visibleTiles){if(s.add(l.dataKey),this.highlightTris.has(l.dataKey))continue;let c=a.getTile(l),f=c?.data?.buckets?.[o.layerId];if(!c||!f)continue;let u=Ii(c,o.layerId,o.featureId);u&&this.highlightTris.set(l.dataKey,Cs(u,f.extent,l));}for(let l of [...this.highlightTris.keys()])s.has(l)||this.highlightTris.delete(l);}drawFillHighlight(e,t,o,r){let i=this.highlightFill,a=this.fill;if(!i||!a)return;let s=r.layers.find(h=>h.id===i.layerId),l=s?o.get(s.source??De):void 0;if(!s||!l)return;let c=i.bucketKey,f=Ve(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",it([f[0],f[1],f[2],i.opacity])),e.setDepthTest(false),e.setDepthMask(false),e.setBlend("premultiplied"),e.setCull("none");let u=e.gl;e.setStencilTest(true),u.stencilFunc(u.NOTEQUAL,Dt,Dt),u.stencilOp(u.KEEP,u.KEEP,u.REPLACE),u.stencilMask(Dt);for(let h of l.visibleTiles){let d=l.getTile(h),m=d?.data?.buckets?.[c];if(!d||!m||m.kind!=="fill"||!m.featureIds)continue;let p=this.fillHighlightFor(e,m,h,i.featureId,c);p&&(a.setMat4("u_matrix",t.tileMatrix(h,m.extent)),p.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,p.count,e.gl.UNSIGNED_INT,0));}e.setStencilTest(false),u.stencilOp(u.KEEP,u.KEEP,u.KEEP),u.stencilMask(255),e.bindVAO(null);}fillHighlightFor(e,t,o,r,i){let a=`${i}/${r}/${o.dataKey}`;this.fillHighlightKey!==`${i}/${r}`&&(this.fillHighlightGpu.forEach(h=>{h?.vao.destroy(),h?.ibo.destroy(),h?.vbo.destroy();}),this.fillHighlightGpu.clear(),this.fillHighlightKey=`${i}/${r}`);let s=this.fillHighlightGpu.get(a);if(s!==void 0)return s;let l=new Uint32Array(t.indices),c=new Float64Array(t.featureIds),f=[];for(let h=0;h*3<l.length;h++)c[h]===r&&f.push(l[h*3],l[h*3+1],l[h*3+2]);let u=null;if(f.length){let h=new Je(e,new Uint8Array(t.vertices),zs),d=new Ue(e,new Uint32Array(f));u={vao:new Ne(e,[{buffer:h,locations:this.fillLocs}],d),vbo:h,ibo:d,count:f.length};}return this.fillHighlightGpu.set(a,u),u}highlightFootprint(){return this.highlight&&this.highlightTris.size?[...this.highlightTris.values()]:this.indoorMask.footprint()}drawSurface(e,t,o,r,i,a){let s=this.surface,l=r.colorAt(i,a,[.7,.8,.7,1]),c=pe(i.paint.opacity,a,1);if(c<=.001)return;s.use(),this.applyShadowUniforms(s),this.applyFogUniforms(s,t,r),this.applyGlobeUniforms(s,t,r),this.applyLight(s,r),this.applyMaterial(s,i,a),s.setVec4v("u_color",l),s.setFloat("u_opacity",c),s.setFloat("u_side_shade",pe(i.paint.sideShade,a,.12));let f=i.elevation<(i.base??0),u=i.paint.sideColor?r.colorAt({...i,paint:{...i.paint,color:i.paint.sideColor}},a,l):l;s.setVec3("u_side_color",u[0],u[1],u[2]),s.setFloat("u_side_light",pe(i.paint.sideLight,a,f?1:0)),s.setFloat("u_relief",this.reliefScale),s.setFloat("u_lift_tone",pe(i.paint.liftTone,a,0)),s.setFloat("u_lift_tone_from",i.elevation+Nn),s.setFloat("u_lift_tone_height",i.paint.liftToneHeight??r.spec.levelHeight??8);let h=r.bucketKeyFor(i);if(h===null)return;let d=c>=1&&!i.overlay;e.setDepthMask(d),e.setBlend(d?"none":"premultiplied"),e.setCull("none");let m=[],p=this.yieldTargets.has(i.id)?[]:null;for(let y of this.clippedTiles(o)){if(!this.drawsTile(t,r,i,y))continue;let A=o.getTile(y),x=A&&this.bucketFor(e,A,h,Mh,this.surfaceLocs,"surface");x&&m.push({id:y,bucket:x,cut:A?this.cutSurface(e,A,h,y.dataKey,x.buffer,this.replacedIds()):null}),p&&A&&Ai(A.state,!!x,!!A.data?.buckets?.[h])&&p.push(y);}p&&this.yieldSquares.set(i.id,p);let b=(y,A,x)=>{this.clipToTile(e,y),this.applyTileScale(s,y,A.extent,e),this.shadowActive&&s.setMat4("u_shadow_matrix",t.shadowTileMatrix(y,A.extent)),this.applyTileMatrix(s,t,y,A.extent),(x??A).vao.bind();},g=m.filter(({bucket:y,cut:A})=>A?A.capCount>0:y.capIndexOffset<y.indexCount);if(g.length){e.setColorMask(false),e.setDepthMask(true);for(let{id:y,bucket:A,cut:x}of g){b(y,A,x);let v=x?e.gl.UNSIGNED_INT:A.indexType,w=v===e.gl.UNSIGNED_INT?4:2;e.gl.drawElements(e.gl.TRIANGLES,x?x.capCount:A.indexCount-A.capIndexOffset,v,(x?x.mainCount:A.capIndexOffset)*w);}e.setColorMask(true),e.setDepthMask(d);}for(let{id:y,bucket:A,cut:x}of m)b(y,A,x),e.gl.drawElements(e.gl.TRIANGLES,x?x.mainCount:A.capIndexOffset,x?e.gl.UNSIGNED_INT:A.indexType,0);e.setCull("back"),e.setDepthMask(true),e.setBlend("none");}drawBuildings(e,t,o,r,i,a,s){let l=this.building,c=r.colorAt(i,a,[.86,.84,.8,1]),f=i.paint.roofColor?r.colorAt({...i,paint:{...i.paint,color:i.paint.roofColor}},a,c):c,u=pe(i.paint.opacity,a,1);if(u<=.001)return false;l.use(),this.applyShadowUniforms(l),this.applyFogUniforms(l,t,r),l.setVec4v("u_wall_color",c),l.setVec4v("u_roof_color",f),l.setFloat("u_opacity",u),l.setFloat("u_ao_strength",pe(i.paint.aoStrength,a,.4)),l.setFloat("u_tint_variation",pe(i.paint.tintVariation,a,.07));let h=jt(i)!==null,d=(v,w)=>i.paint[v]?r.colorAt({...i,paint:{...i.paint,color:i.paint[v]}},a,w):w,m=d("windowColor",[.62,.71,.8,1]),p=d("windowFrameColor",[c[0]*1.1,c[1]*1.1,c[2]*1.1,1]);l.setVec3("u_window_color",m[0],m[1],m[2]),l.setVec3("u_window_frame",p[0],p[1],p[2]),l.setFloat("u_facade_detail",pe(i.paint.facadeDetail,a,1)*this.detailScale),l.setFloat("u_window_glow",pe(i.paint.windowGlow,a,0)),l.setFloat("u_floor_height",pe(i.paint.floorHeight,a,3.2)),l.setFloat("u_window_variation",pe(i.paint.windowVariation,a,1)),l.setFloat("u_seam_strength",pe(i.paint.seamStrength,a,1)),l.setFloat("u_ice",pe(i.paint.ice,a,0)),l.setFloat("u_window_recess",pe(i.paint.windowRecess,a,.18)),l.setFloat("u_window_recess_shade",pe(i.paint.windowRecessShade,a,.16)),l.setFloat("u_plinth_height",pe(i.paint.plinthHeight,a,4)),l.setFloat("u_plinth_shade",pe(i.paint.plinthShade,a,.14)),l.setFloat("u_roof_variation",pe(i.paint.roofVariation,a,.3)),this.applyLight(l,r);let b=u>=1;e.setDepthMask(b),e.setBlend(b?"none":"premultiplied");let g=pe(i.paint.heightScale,a,1),y=false,A=r.bucketKeyFor(i);if(A===null)return y;let x=(i.source??De)===De;x&&this.indoorMask.prepare(o,A);for(let v of o.visibleTiles){if(!this.drawsTile(t,r,i,v))continue;let w=o.getTile(v),C=w&&this.bucketFor(e,w,A,qo,this.buildingLocs,"fill-extrusion");if(!C)continue;l.setFloat("u_data_color",h&&C.dataBuffer?1:0);let B=this.growScale(C,s,!o.warm);B<1&&(y=true),l.setFloat("u_height_scale",B*g),this.applyTileScale(l,v,C.extent,e),this.shadowActive&&l.setMat4("u_shadow_matrix",t.shadowTileMatrix(v,C.extent)),l.setMat4("u_matrix",t.tileMatrix(v,C.extent));let T=this.cutHidden(e,w,A,v.dataKey,C.buffer,this.hiddenFor(A,x,v.dataKey),this.buildingLocs,C.dataBuffer)??(w&&x?this.indoorMask.indicesFor(e,w,A,v,C.buffer,this.buildingLocs):null);T?(T.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,T.count,e.gl.UNSIGNED_INT,0)):(C.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,C.indexCount,C.indexType,0));}return x&&(l.setFloat("u_data_color",0),this.drawSeams(e,t,l,g)),l.setFloat("u_data_color",0),y}drawSeamHighlight(e,t,o,r){for(let[i,{tile:a,mesh:s}]of this.seams.meshes){let l=`${i}\u241F${r}`,c=this.highlightGpu.get(l);if(c===void 0){let f=Is(s,r);if(f){let u=new Je(e,new Uint8Array(f.vertices),qo),h=new Ue(e,f.indices);c={vao:new Ne(e,[{buffer:u,locations:this.buildingLocs}],h),vbo:u,ibo:h,count:f.indices.length};}else c=null;this.highlightGpu.set(l,c);}c&&(this.applyTileScale(o,a,s.extent,e),this.shadowActive&&o.setMat4("u_shadow_matrix",t.shadowTileMatrix(a,s.extent)),o.setMat4("u_matrix",t.tileMatrix(a,s.extent)),c.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,c.count,e.gl.UNSIGNED_INT,0));}}drawSeams(e,t,o,r){for(let[i,{tile:a,mesh:s}]of this.seams.meshes){let l=this.seamBucket(e,i,s);o.setFloat("u_height_scale",r),this.applyTileScale(o,a,s.extent,e),this.shadowActive&&o.setMat4("u_shadow_matrix",t.shadowTileMatrix(a,s.extent)),o.setMat4("u_matrix",t.tileMatrix(a,s.extent)),l.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,s.indexCount,e.gl.UNSIGNED_INT,0);}}seamBucket(e,t,o){let r=this.seamGpu.get(t);if(!r){let i=new Je(e,new Uint8Array(o.vertices),qo),a=new Ue(e,new Uint32Array(o.indices)),s=new Ne(e,[{buffer:i,locations:this.buildingLocs}],a);r=new Pi(s,i,a,o.indexCount,e.gl.UNSIGNED_INT,o.extent),this.seamGpu.set(t,r);}return r}syncSeamGpu(){for(let e of this.seams.changed){let t=this.seamGpu.get(e);t&&(t.destroy(),this.seamGpu.delete(e));for(let o of [...this.highlightGpu.keys()]){if(!o.startsWith(e+"\u241F"))continue;let r=this.highlightGpu.get(o);r&&(r.vao.destroy(),r.vbo.destroy(),r.ibo.destroy()),this.highlightGpu.delete(o);}}}growScale(e,t,o=true){if(e.firstDrawTime===0&&(e.firstDrawTime=t),!o||this.growDurationMs<=0)return 1;let r=(t-e.firstDrawTime)/this.growDurationMs;return r<1?Jb(Math.max(r,0)):1}applyLight(e,t){let o=t.light;Tt(e,"u_ambient_color",o.ambientColor),e.setFloat("u_ambient_intensity",o.ambientIntensity);let[r,i,a]=Bo(o.keyAzimuth,o.keyAltitude);e.setVec3("u_key_dir",r,i,a),Tt(e,"u_key_color",o.keyColor),e.setFloat("u_key_intensity",o.keyIntensity);let[s,l,c]=Bo(o.fillAzimuth,o.fillAltitude);e.setVec3("u_fill_dir",s,l,c),Tt(e,"u_fill_color",o.fillColor),e.setFloat("u_fill_intensity",o.fillIntensity);}flattened(e,t,o){let r=t.bucketKeyFor(o);if(r===null)return false;for(let i of e.visibleTiles){let a=e.getTile(i)?.data?.buckets?.[r];if(a)return a.kind==="fill"}return false}bucketFor(e,t,o,r,i,a){let s=t.buckets.get(o);if(s)return s;let l=t.data?.buckets?.[o];if(!l||l.kind==="symbol"||l.kind==="placement")return null;if(l.kind!==a)return Pb(`\u0441\u043B\u043E\u0439 ${o}: \u0432 \u0442\u0430\u0439\u043B\u0435 \u043C\u0435\u0448 \xAB${l.kind}\xBB, \u0430 \u0440\u0438\u0441\u0443\u044E\u0442 \u043A\u0430\u043A \xAB${a}\xBB \u2014 \u043F\u0440\u043E\u043F\u0443\u0449\u0435\u043D`),null;if(this.uploadLeft<=0)return this.uploadDeferred=true,null;this.uploadLeft-=l.vertices.byteLength+l.indices.byteLength;let c=new Je(e,new Uint8Array(l.vertices),r),f=new Ue(e,new Uint32Array(l.indices)),u=l.dataPaint?new Je(e,new Uint8Array(l.dataPaint),Bh):null,h=new Ne(e,u?[{buffer:c,locations:i},{buffer:u,locations:i}]:[{buffer:c,locations:i}],f),d=new Pi(h,c,f,f.count,f.type,l.extent,l.capIndexOffset??f.count,u);return t.buckets.set(o,d),d}destroy(e){this.disposeHighlight(),this.fill?.destroy(),this.surface?.destroy(),this.line?.destroy(),this.objectLine?.destroy(),this.building?.destroy(),this.symbols?.destroy(e),this.models.destroy(e.gl),this.shadowTarget?.destroy(),this.shadowTarget=null,this.shadowPlaceholder&&e.gl.deleteTexture(this.shadowPlaceholder),this.shadowPlaceholder=null,this.quad&&(this.quad.vao.destroy(),this.quad.vbo.destroy(),this.quad.ibo.destroy(),this.quad=null),this.globeMesh&&(this.globeMesh.vao.destroy(),this.globeMesh.vbo.destroy(),this.globeMesh.ibo.destroy(),this.globeMesh=null),this.fill=this.line=this.building=null,this.objectLine=null;}},Hi=new fe;function Kb(n,e){let r=new Float32Array(66306),i=0;for(let h=0;h<=128;h++){let d=(h/128-.5)*Math.PI;for(let m=0;m<=256;m++)r[i++]=m/256*2*Math.PI-Math.PI,r[i++]=d;}let a=new Uint16Array(256*128*6),s=0;for(let h=0;h<128;h++)for(let d=0;d<256;d++){let m=h*257+d,p=m+256+1;a[s++]=m,a[s++]=m+1,a[s++]=p,a[s++]=m+1,a[s++]=p+1,a[s++]=p;}let l={stride:8,attribs:[{name:"a_lnglat",size:2,type:$o,offset:0}]},c=new fe([["a_lnglat",e.attribLocation("a_lnglat")]]),f=new Je(n,r,l),u=new Ue(n,a);return {vao:new Ne(n,[{buffer:f,locations:c}],u),vbo:f,ibo:u,count:a.length}}function Xb(n,e){if(e.highColor){Tt(n,"u_high_color",e.highColor);return}let t=Hi.get(e.skyColor);t||(t=Ve(e.skyColor),Hi.set(e.skyColor,t)),n.setVec3("u_high_color",t[0]*.6,t[1]*.74,Math.min(1,t[2]*.99+.02));}function Tt(n,e,t){let o=Hi.get(t);o||(o=Ve(t),Hi.set(t,o)),n.setVec3(e,o[0],o[1],o[2]);}function Bo(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 Jb(n){let o=n-1;return 1+2.20158*o*o*o+1.20158*o*o}var Oi=1,on=class{constructor(e=1024){this.entries=new fe;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+Oi>this.size&&(this.shelfY+=this.shelfHeight+Oi,this.shelfX=0,this.shelfHeight=0),this.shelfY+r+Oi>this.size)return this.full||console.warn("[osmgl] \u0430\u0442\u043B\u0430\u0441 SDF \u0437\u0430\u043F\u043E\u043B\u043D\u0435\u043D, \u043D\u043E\u0432\u044B\u0435 \u0441\u0438\u043C\u0432\u043E\u043B\u044B \u043D\u0435 \u0434\u043E\u0431\u0430\u0432\u043B\u044F\u044E\u0442\u0441\u044F"),this.full=true,null;let a={x:this.shelfX,y:this.shelfY,width:o,height:r};for(let s=0;s<r;s++){let l=s*o,c=(a.y+s)*this.size+a.x;this.data.set(t.subarray(l,l+o),c);}return this.shelfX+=o+Oi,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 Gi=1,rn=class{constructor(e=1024){this.images=new fe;this.entries=new fe;this.texture=null;this.dirty=true;this.shelfX=0;this.shelfY=0;this.shelfHeight=0;this.full=false;this.version=0;this.size=e,this.data=new Uint8Array(e*e*4);}has(e){return this.images.has(e)}get(e){return this.images.get(e)}list(){return [...this.images.keys()]}add(e,t,o={}){return this.images.has(e)?false:(this.images.set(e,{id:e,width:t.width,height:t.height,data:t.data instanceof Uint8Array?t.data:new Uint8Array(t.data),pixelRatio:o.pixelRatio??1,sdf:o.sdf??false}),this.version++,true)}update(e,t,o={}){let r=this.images.get(e);return r?(this.images.set(e,{id:e,width:t.width,height:t.height,data:t.data instanceof Uint8Array?t.data:new Uint8Array(t.data),pixelRatio:o.pixelRatio??r.pixelRatio,sdf:o.sdf??r.sdf}),this.entries.delete(e),this.version++,true):false}remove(e){return this.images.delete(e)?(this.entries.delete(e),this.version++,true):false}entryFor(e){let t=this.entries.get(e);if(t)return t;let o=this.images.get(e);if(!o||this.full)return null;let{width:r,height:i}=o;if(r>this.size||i>this.size)return null;if(this.shelfX+r+Gi>this.size&&(this.shelfY+=this.shelfHeight+Gi,this.shelfX=0,this.shelfHeight=0),this.shelfY+i+Gi>this.size)return this.full||console.warn("[osmgl] \u0430\u0442\u043B\u0430\u0441 \u043A\u0430\u0440\u0442\u0438\u043D\u043E\u043A \u0437\u0430\u043F\u043E\u043B\u043D\u0435\u043D, \u043D\u043E\u0432\u044B\u0435 \u043D\u0435 \u0434\u043E\u0431\u0430\u0432\u043B\u044F\u044E\u0442\u0441\u044F"),this.full=true,null;let a=this.shelfX,s=this.shelfY;for(let c=0;c<i;c++){let f=c*r*4,u=((s+c)*this.size+a)*4;this.data.set(o.data.subarray(f,f+r*4),u);}this.shelfX+=r+Gi,this.shelfHeight=Math.max(this.shelfHeight,i),this.dirty=true;let l={x:a,y:s,width:r,height:i};return this.entries.set(e,l),l}bind(e,t){let o=e.gl;this.texture||(this.texture=o.createTexture(),e.bindTexture(t,this.texture),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),e.bindTexture(t,this.texture),this.dirty&&(o.pixelStorei(o.UNPACK_ALIGNMENT,4),o.texImage2D(o.TEXTURE_2D,0,o.RGBA,this.size,this.size,0,o.RGBA,o.UNSIGNED_BYTE,this.data),this.dirty=false);}destroy(e){this.texture&&e.gl.deleteTexture(this.texture),this.texture=null;}};var an=.75,tr=8,Ke=3,Gt=24,er=256,Eh=255,nn=class{constructor(e,t="Noto Sans Regular"){this.urlTemplate=e;this.fontstack=t;this.glyphs=new fe;this.loaded=new Le;this.inflight=new fe;}setUrl(e){e!==this.urlTemplate&&(this.urlTemplate=e,this.glyphs.clear(),this.loaded.clear());}get(e){return this.glyphs.get(e)}hasRange(e){return this.loaded.has(Math.floor(e/er))}needsLoad(e){for(let t of e){let o=t.codePointAt(0);if(o===void 0)continue;let r=Math.floor(o/er);if(r<=Eh&&!this.loaded.has(r))return true}return false}async ensure(e){let t=new Le;for(let o of e){let r=o.codePointAt(0);if(r===void 0)continue;let i=Math.floor(r/er);i>Eh||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*er}-${e*er+er-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 Sh(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 Sh(n){let e=new yo(n instanceof Uint8Array?n:new Uint8Array(n)),t=[];return e.readFields((o,r,i)=>{if(o!==1||!i)return;let a=i.readVarint()+i.pos;i.readFields((s,l,c)=>{if(s!==3||!c)return;let f=c.readVarint()+c.pos,u={id:0,bitmap:null,width:0,height:0,left:0,top:0,advance:0};c.readFields((h,d,m)=>{m&&(h===1?u.id=m.readVarint():h===2?u.bitmap=m.readBytes():h===3?u.width=m.readVarint():h===4?u.height=m.readVarint():h===5?u.left=m.readSVarint():h===6?u.top=m.readSVarint():h===7&&(u.advance=m.readVarint()));},null,f),t.push(u);},null,a);},null),t}var jb=.25,or=1e20;function Ns(n,e,t){let o=e+Ke*2,r=t+Ke*2,i=o*r,a=new Float64Array(i),s=new Float64Array(i);a.fill(or),s.fill(0);for(let c=0;c<t;c++)for(let f=0;f<e;f++){let u=n[c*e+f]/255,h=(c+Ke)*o+(f+Ke);if(u>=1)a[h]=0,s[h]=or;else if(u>0){let d=.5-u;a[h]=d>0?d*d:0,s[h]=d<0?d*d:0;}else a[h]=or,s[h]=0;}Fh(a,o,r),Fh(s,o,r);let l=new Uint8Array(i);for(let c=0;c<i;c++){let f=Math.sqrt(a[c])-Math.sqrt(s[c]);l[c]=Yb(Math.round(255-255*(f/tr+jb)));}return {data:l,width:o,height:r}}function Fh(n,e,t){let o=Math.max(e,t),r=new Float64Array(o),i=new Float64Array(o),a=new Int32Array(o),s=new Float64Array(o+1);for(let l=0;l<e;l++){for(let c=0;c<t;c++)r[c]=n[c*e+l];Ih(r,i,a,s,t);for(let c=0;c<t;c++)n[c*e+l]=i[c];}for(let l=0;l<t;l++){for(let c=0;c<e;c++)r[c]=n[l*e+c];Ih(r,i,a,s,e);for(let c=0;c<e;c++)n[l*e+c]=i[c];}}function Ih(n,e,t,o,r){t[0]=0,o[0]=-or,o[1]=or;for(let i=1,a=0;i<r;i++){let s=0;do{let l=t[a];s=(n[i]-n[l]+i*i-l*l)/(i-l)/2;}while(s<=o[a]&&--a>-1);a++,t[a]=i,o[a]=s,o[a+1]=or;}for(let i=0,a=0;i<r;i++){for(;o[a+1]<i;)a++;let s=t[a];e[i]=(i-s)*(i-s)+n[s];}}var Yb=n=>n<0?0:n>255?255:n;var Dh=48,sn=class{constructor(e={}){this.defs=e;this.sdfs=new fe;this.pending=new Le;this.failed=new Le;}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(Dh*(i>1?i:1))),s=Math.max(8,Math.round(Dh/(i<1?i:1))),l=await Zb(o,a,s);return this.sdfs.set(e,Ns(l,a,s)),!0}catch(o){return this.failed.add(e),console.warn(`[osmgl] \u0438\u043A\u043E\u043D\u043A\u0430 \xAB${e}\xBB \u043D\u0435 \u0440\u0430\u0441\u0442\u0435\u0440\u0438\u0437\u043E\u0432\u0430\u043B\u0430\u0441\u044C:`,o instanceof Error?o.message:o),false}finally{this.pending.delete(e);}}};async function Zb(n,e,t){let o=n.includes("width=")?n:n.replace("<svg",`<svg width="${e}" height="${t}"`),r=new Blob([o],{type:"image/svg+xml;charset=utf-8"}),i=URL.createObjectURL(r);try{let a=new Image;a.width=e,a.height=t,await new Promise((u,h)=>{a.onload=()=>u(),a.onerror=()=>h(new Error("\u043D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u0434\u0435\u043A\u043E\u0434\u0438\u0440\u043E\u0432\u0430\u0442\u044C SVG")),a.src=i;});let s=document.createElement("canvas");s.width=e,s.height=t;let l=s.getContext("2d",{willReadFrequently:!0});if(!l)throw new Error("\u043D\u0435\u0442 2D-\u043A\u043E\u043D\u0442\u0435\u043A\u0441\u0442\u0430");l.clearRect(0,0,e,t),l.drawImage(a,0,0,e,t);let c=l.getImageData(0,0,e,t).data,f=new Uint8ClampedArray(e*t);for(let u=0;u<f.length;u++)f[u]=c[u*4+3];return f}finally{URL.revokeObjectURL(i);}}var Mo={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>',"frame-pin":'<svg viewBox="0 0 20.6 24" xmlns="http://www.w3.org/2000/svg"><path d="M3.87 17.2A9.43 9.43 0 1 1 16.7 17.2L10.29 23.14Z"/></svg>',"frame-circle-soft":'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><circle cx="12" cy="12" r="7.2"/></svg>',"frame-pin-soft":'<svg viewBox="0 0 20.6 24" xmlns="http://www.w3.org/2000/svg"><path transform="translate(4.12 4.8) scale(0.6)" d="M3.87 17.2A9.43 9.43 0 1 1 16.7 17.2L10.29 23.14Z"/></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 8 24" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" d="M3 1h2a2.5 2.5 0 0 1 2.5 2.5v11.5A2.5 2.5 0 0 1 5 17.5h-.1v3.9a.9.9 0 0 1-1.8 0v-3.9H3A2.5 2.5 0 0 1 .5 15V3.5A2.5 2.5 0 0 1 3 1zm1 2.6a1.7 1.7 0 1 0 0 3.4 1.7 1.7 0 0 0 0-3.4zm0 4.5a1.7 1.7 0 1 0 0 3.4 1.7 1.7 0 0 0 0-3.4zm0 4.5a1.7 1.7 0 1 0 0 3.4 1.7 1.7 0 0 0 0-3.4z"/></svg>',traffic_light_pole:'<svg viewBox="0 0 8 24" xmlns="http://www.w3.org/2000/svg"><rect x="3.1" y="15.5" width="1.8" height="5.9" rx=".9"/></svg>',traffic_light_body:'<svg viewBox="0 0 8 24" xmlns="http://www.w3.org/2000/svg"><rect x=".5" y="1" width="7" height="16.5" rx="2.5"/></svg>',traffic_light_red:'<svg viewBox="0 0 8 24" xmlns="http://www.w3.org/2000/svg"><circle cx="4" cy="5.2" r="2"/></svg>',traffic_light_amber:'<svg viewBox="0 0 8 24" xmlns="http://www.w3.org/2000/svg"><circle cx="4" cy="9.7" r="2"/></svg>',traffic_light_green:'<svg viewBox="0 0 8 24" xmlns="http://www.w3.org/2000/svg"><circle cx="4" cy="14.2" r="2"/></svg>',road_closed:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M4 10.1h16v3.8H4z"/></svg>',gate:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M2 4h3v16H2V4zm17 0h3v16h-3V4zM6 8h12v2H6V8zm0 5h12v2H6v-2z"/></svg>',toilets:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M6 2a2 2 0 1 1 0 4 2 2 0 0 1 0-4zM4 7h4l2 7H8v8H4v-8H2l2-7zm12-5a2 2 0 1 1 0 4 2 2 0 0 1 0-4zm-3 5h6l1 8h-2v7h-4v-7h-2l1-8z"/></svg>',drinking_water:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2c4 5 6 8 6 11a6 6 0 0 1-12 0c0-3 2-6 6-11zm0 5c-2 3-3 4.6-3 6a3 3 0 0 0 6 0c0-1.4-1-3-3-6z"/></svg>',waste_basket:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M9 2h6l1 2h4v3H4V4h4l1-2zM5 8h14l-1 14H6L5 8zm4 3v8h2v-8H9zm4 0v8h2v-8h-2z"/></svg>',recycling:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2l4 7h-3v4h-2V9H8l4-7zM3 18l3-6 2 1-1.4 2.5H10v2H6.6L8 20l-2 1-3-3zm18 0-3 3-2-1 1.4-2.5H14v-2h3.4L16 13l2-1 3 6z"/></svg>',campsite:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2l9 18h-4l-5-10-5 10H3L12 2zm0 9 5 9H7l5-9z"/></svg>',shelter:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2l10 8-1.5 2L19 11v9H5v-9l-1.5 1L2 10l10-8zm0 3.5L7 9.5V18h10V9.5l-5-4z"/></svg>',fire_station:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M13 2c0 3-4 4-4 8 0 1 .4 2 1 2.6C9.4 11 10 9.5 11 9c0 2 3 3 3 6a3.5 3.5 0 0 1-1 2.5c2.5-.6 4-2.8 4-5.5 0-5-4-7-4-10zM7 15c0 4 2.5 7 5 7s5-3 5-7c0 2-1 3-2 3.5.3-.6.5-1.2.5-2 0-2.5-2-3.5-2.5-5.5-1 1-2 2.5-2 4 0 .8.2 1.5.6 2C10.2 17.5 9 16.5 9 15H7z"/></svg>',prison:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M3 3h2v18H3V3zm4 0h2v18H7V3zm4 0h2v18h-2V3zm4 0h2v18h-2V3zm4 0h2v18h-2V3zM2 10h20v2H2v-2z"/></svg>',cemetery:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2c3 0 5 2 5 5v13H7V7c0-3 2-5 5-5zm-1 3v2H9v2h2v7h2v-7h2V7h-2V5h-2zM5 21h14v2H5v-2z"/></svg>',basin:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M2 8c2 0 2 2 5 2s3-2 5-2 3 2 5 2 3-2 5-2v3c-2 0-2 2-5 2s-3-2-5-2-3 2-5 2-3-2-5-2V8zm0 7c2 0 2 2 5 2s3-2 5-2 3 2 5 2 3-2 5-2v3c-2 0-2 2-5 2s-3-2-5-2-3 2-5 2-3-2-5-2v-3z"/></svg>',"shield-2":'<svg viewBox="0 0 32 24" xmlns="http://www.w3.org/2000/svg"><rect x="1" y="3" width="30" height="18" rx="4"/></svg>',"shield-3":'<svg viewBox="0 0 41 24" xmlns="http://www.w3.org/2000/svg"><rect x="1" y="3" width="39" height="18" rx="4"/></svg>',"shield-4":'<svg viewBox="0 0 50 24" xmlns="http://www.w3.org/2000/svg"><rect x="1" y="3" width="48" height="18" rx="4"/></svg>',"shield-5":'<svg viewBox="0 0 59 24" xmlns="http://www.w3.org/2000/svg"><rect x="1" y="3" width="57" height="18" rx="4"/></svg>',"shield-6":'<svg viewBox="0 0 68 24" xmlns="http://www.w3.org/2000/svg"><rect x="1" y="3" width="66" height="18" rx="4"/></svg>',"shield-7":'<svg viewBox="0 0 77 24" xmlns="http://www.w3.org/2000/svg"><rect x="1" y="3" width="75" height="18" rx="4"/></svg>',"shield-8":'<svg viewBox="0 0 86 24" xmlns="http://www.w3.org/2000/svg"><rect x="1" y="3" width="84" height="18" rx="4"/></svg>'},qb={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(qb)){let t=Mo[e];t?Mo[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 Qb=1.2;function Vs(n,e,t=16,o=0){let r=$b(n,t),i=[],a=[],s=0;for(let f of r){let u=0,h=0;for(let d of f){let m=d.codePointAt(0);if(m===void 0)continue;let p=e.get(m);p&&(u+=p.advance,h++);}h>1&&(u+=o*(h-1)),a.push(u),u>s&&(s=u);}if(s===0)return null;let l=Gt*Qb,c=r.length*l;for(let f=0;f<r.length;f++){let u=-a[f]/2,h=-c/2+f*l+l/2;for(let d of r[f]){let m=d.codePointAt(0);if(m===void 0)continue;let p=e.get(m);p&&(p.width>0&&p.height>0&&p.bitmap&&i.push({glyph:p,x:u,y:h}),u+=p.advance+o);}}return i.length?{glyphs:i,width:s,height:c}:null}function $b(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)}var eg=[0,.25,-0.25,.5,-0.5,.75,-0.75,1,-1];function Us(n,e,t,o={}){if(n.length<2||!e.length||t<=0)return [];let r=ng(n),i=r[r.length-1];if(i<t)return [];let a=o.maxAngle??25,s=o.stableScale&&o.stableScale>0?o.stableScale:1,l=i*s,c=o.fontSize?o.fontSize*.6:t/e.length,f=(o.fontSize??0)*.85,u=[],h=o.spacing??250,d=h>0&&h-t<h*.25?t+h*.25:h;if(o.accept&&o.atList){let p=[];for(let b of o.atList){if(p.length>=24)break;if(b<0||b+t>i)continue;let g=zi(n,r,e,t,b,c,a,f);if(!g)continue;let y={glyphs:g,path:g.map(A=>({x:A.x,y:A.y})),at:b};o.accept(y)&&p.push(y);}return p}if(o.accept)return tg(n,r,e,t,d,c,a,f,o.accept,o.offset??0,o.keepAt??[]);if(d>0&&l>=t+d){let p=Math.min(Math.floor((l-t)/d)+1,24),b=t+d*(p-1),g=(l-b)/2;for(let y=0;y<p;y++,g+=d){let A=g/s,x=zi(n,r,e,t,A,c,a,f);x&&u.push({glyphs:x,path:x.map(v=>({x:v.x,y:v.y})),at:A});}if(u.length)return u}let m=(i-t)/2;for(let p of eg){let b=m+m*p,g=zi(n,r,e,t,b,c,a,f);if(g)return [{glyphs:g,path:g.map(y=>({x:y.x,y:y.y})),at:b}];if(m===0)break}return []}function tg(n,e,t,o,r,i,a,s,l,c,f){let u=e[e.length-1],h=Math.max(o/3,r/8,12),d=[],m=[],p=g=>{if(g<0||g+o>u)return false;for(let x of m)if(Math.abs(x-g)<r)return false;let y=zi(n,e,t,o,g,i,a,s);if(!y)return false;let A={glyphs:y,path:y.map(x=>({x:x.x,y:x.y})),at:g};return l(A)?(d.push(A),m.push(g),true):false};for(let g of f){if(d.length>=24)break;p(g-c);}let b=(-c%h+h)%h;for(let g=b;g+o<=u&&!(d.length>=24);g+=h)p(g);return d}function zi(n,e,t,o,r,i,a,s){if(r<0||r+o>e[e.length-1]||!og(n,e,r,r+o,i,a))return null;let l=ln(n,e,r),c=ln(n,e,r+o);if(!l||!c)return null;if(c.x>=l.x)return Th(n,e,t,r,s);let f=e[e.length-1];return Th([...n].reverse(),ig(e),t,f-(r+o),s)}function og(n,e,t,o,r,i){if(r<=0)return true;let a=[],s=0;for(let l=1;l+1<n.length;l++){let c=e[l];if(c<=t)continue;if(c>=o)break;let f=Math.atan2(n[l].y-n[l-1].y,n[l].x-n[l-1].x),u=Math.atan2(n[l+1].y-n[l].y,n[l+1].x-n[l].x),h=Math.abs((u-f)*180/Math.PI+540)%360-180,d=Math.abs(h);for(a.push({at:c,delta:d}),s+=d;a.length&&c-a[0].at>r;)s-=a.shift().delta;if(s>i)return false}return true}function Th(n,e,t,o,r){let i=[];for(let c of t){let f=kh(n,e,o+c.offset,c.width);if(!f)return null;i.push(f);}if(!i.length)return null;if(r<=0)return i;let a=[],s=o,l=0;for(let c=0;c<t.length;c++){if(c>0){let u=Math.abs(rg(i[c].angle,i[c-1].angle))*(Math.PI/180);l+=r*2*Math.tan(Math.min(u,Math.PI/3)/2);}s=o+t[c].offset+l;let f=kh(n,e,s,t[c].width);if(!f)return null;a.push(f);}return a}function kh(n,e,t,o){let r=ln(n,e,t+o/2);if(!r)return null;let i=ln(n,e,t),a=ln(n,e,t+o);if(!i||!a)return r;let s=a.x-i.x,l=a.y-i.y;return s===0&&l===0?r:{x:r.x,y:r.y,angle:Math.atan2(l,s)*180/Math.PI}}function rg(n,e){let t=n-e;for(;t>180;)t-=360;for(;t<=-180;)t+=360;return t}function ng(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 ig(n){let e=n[n.length-1];return n.map(t=>e-t).reverse()}function ln(n,e,t){if(t<0||t>e[e.length-1])return null;let o=1;for(;o<e.length-1&&e[o]<t;)o++;let r=e[o]-e[o-1];if(r<=0)return null;let i=(t-e[o-1])/r,a=n[o-1],s=n[o],l=s.x-a.x,c=s.y-a.y;return {x:a.x+l*i,y:a.y+c*i,angle:Math.atan2(c,l)*180/Math.PI}}var Xs=20,Lh={stride:Xs,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}]},sg=220,lg=.15;function Rh(n,e){if(!Number.isFinite(e.far))return 1;let t=Math.max(e.far-e.near,1),o=e.near+t*lg,r=(n-o)/Math.max(e.far-o,1);return r<=0?1:r>=1?0:1-r*r*(3-2*r)}var cn=192,co=64,Ks=2,cg=1.22,fg=128,ug=.7;function hg(n,e,t){let o=n.layout?.letterSpacing;if(o!==void 0)return pe(o,e,0)*Gt;let r=pe(n.paint?.haloWidth,e,0);return r<=0||t<=0?0:r*ug/(t/Gt)}var dg=256,mg=200,pg="frame-circle",bg="frame-pin",gg="frame-circle-soft",yg="frame-pin-soft",Ph=5/3,Ag=10.29/24;function xg(n,e,t,o,r){let i=-r,a=-r,s=o.width+r,l=o.height+r,c=[],f=0;for(let u=0;u+1<n.length;u++){let h=n[u],d=n[u+1],m=Math.hypot(d.x-h.x,d.y-h.y);if(Math.max(h.x,d.x)>=i&&Math.min(h.x,d.x)<=s&&Math.max(h.y,d.y)>=a&&Math.min(h.y,d.y)<=l&&m>0){let b=Math.max(0,Math.ceil((f-t)/e)),g=Math.floor((f+m)/e);for(let y=b;y<=g;y++){let A=y*e;if(A>=0&&c[c.length-1]!==A&&c.push(A),c.length>=wg)return c}}f+=m;}return c}var wg=32;function vg(n,e){let t=0,o=1/0,r=0;for(let i=0;i+1<n.length;i++){let a=n[i].x,s=n[i].y,l=n[i+1].x-a,c=n[i+1].y-s,f=Math.hypot(l,c);if(f>0){let u=Math.min(Math.max(((e.x-a)*l+(e.y-s)*c)/(f*f),0),1),h=Math.hypot(e.x-(a+l*u),e.y-(s+c*u));h<o&&(o=h,r=t+f*u);}t+=f;}return o<=50?r:null}function Vh(n){return !n.allowOverlap&&!n.ignorePlacement}function Hh(n){return Vh(n)||!n.allowOverlap&&n.placementGroup!==void 0}function Oh(n){return Vh(n)?void 0:n.placementGroup}function Gh(n,e){return e<=0?n:{x1:n.x1+e,y1:n.y1+e,x2:n.x2-e,y2:n.y2-e}}function zh(n){return n==="circle"?pg:n==="pin"?bg:null}function Cg(n){return n==="circle"?gg:n==="pin"?yg:null}var Bg=["left","right","top"];function Mg(n,e){return !e||n[0]===e||!n.includes(e)?n:[e,...n.filter(t=>t!==e)]}var rr=class rr{constructor(e,t){this.shader=null;this.locations=new fe;this.atlas=new on(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.missingImage=null;this.askedImages=new Set;this.images=new rn;this.highlightFootprint=null;this.elevationAt=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.lineAnchors=new fe;this.lastSide=new fe;this.lineAt=new fe;this.lineAtNow=new fe;this.sideNow=new fe;this.fog={near:0,far:1/0,intensity:0,cutoff:1/0};this.tr=null;this.shownAt=new fe;this.fading=false;this.styleOrder=new fe;this.layersById=new fe;this.glyphs=new nn(e,t),this.icons=new sn(Mo);}setGlyphsUrl(e){this.glyphs.setUrl(e);}setMissingImage(e){this.missingImage=e,this.askedImages.clear();}init(e){this.shader=new Ye(e,"symbol",ju,Yu);for(let t of Lh.attribs)this.locations.set(t.name,this.shader.attribLocation(t.name));}static keyOf(e){return `${e.layerId}|${e.text}|${e.mercX.toFixed(6)}|${e.mercY.toFixed(6)}`}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}rememberedAt(e,t,o){let r=this.lineAt.get(e),i=this.tr;if(!r||!r.length||!i)return [];let a=[];for(let s=0;s+1<r.length;s+=rr.LINE_MARK){let l=i.worldPxToPoint(r[s]*i.worldSize,r[s+1]*i.worldSize);if(!l)continue;let c=vg(t,l);c!==null&&a.push(Math.max(0,c-o/2));}return a}rememberAt(e,t){let o=this.tr;if(!o||!t.length)return;let r=this.lineAtNow.get(e);r||(r=[],this.lineAtNow.set(e,r));for(let i of t){let a=o.pointToWorldPx(i);r.push(a.x/o.worldSize,a.y/o.worldSize);}}withinLayout(e){let t=this.padding;return e.x2>t.left-cn&&e.y2>t.top-cn&&e.x1<this.viewport.width-t.right+cn&&e.y1<this.viewport.height-t.bottom+cn}depthFadeAt(e,t){let o=this.tr;if(!o||!Number.isFinite(this.fog.far))return 1;let r=o.pointToWorldPx({x:e,y:t}),[i,a,s]=o.cameraPositionPx;return Rh(Math.hypot(r.x-i,r.y-a,s),this.fog)}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)/sg;return r<1?(this.fading=true,r):1}order(e){let t=e.length,o=new Float64Array(t);for(let a=0;a<t;a++){let s=e[a];o[a]=s.priority+(this.stickyKeys.has(s.key)?mg:0);}let r=new Int32Array(t);for(let a=0;a<t;a++)r[a]=a;r.sort((a,s)=>{let l=o[s]-o[a];if(l!==0)return l;let c=e[a],f=e[s];return c.mercY!==f.mercY?c.mercY-f.mercY:c.mercX-f.mercX});let i=new Array(t);for(let a=0;a<t;a++)i[a]=e[r[a]];for(let a=0;a<t;a++)e[a]=i[a];}rememberPlaced(){this.stickyKeys=new Set(this.placed.map(o=>rr.keyOf(o)));let e=this.lastSide;this.lastSide=this.sideNow,e.clear(),this.sideNow=e;let t=this.lineAt;this.lineAt=this.lineAtNow,t.clear(),this.lineAtNow=t;for(let o of [...this.shownAt.keys()])this.stickyKeys.has(o)||this.shownAt.delete(o);}render(e,t,o,r){var d,m;let i=this.shader;if(this.placedCount=0,this.placed=[],this.viewport={width:t.width,height:t.height},this.tr=t,!i)return;let a=t.zoom,s=r.layers.filter(p=>p.type==="symbol"&&r.layerVisibleAt(p,a));if(!s.length)return;let l=this.collect(t,o,r,s);if(!l.length)return;this.now=performance.now(),this.fading=false,this.lineAnchors.clear(),this.order(l);let c=new fe,f=new fe,u=new fe;s.forEach((p,b)=>u.set(p.id,b)),this.layersById.clear();for(let p of r.layers)p.type==="symbol"&&this.layersById.set(p.id,p);let h=0;for(let p of l){let b=this.place(p,a,c);if(!b)continue;this.placed.push({layerId:p.layer.id,text:p.text,icon:p.icon,mercX:p.mercX,mercY:p.mercY,box:b.box,order:u.get(p.layer.id)??0});let g=f.get(p.layer.id);g||f.set(p.layer.id,g={layer:p.layer,verts:[],texs:[],iconVerts:[],iconTexs:[],imageVerts:[],imageTexs:[],frameVerts:[],frameTexs:[],shadowVerts:[],shadowTexs:[],partVerts:[],partTexs:[]}),g.verts.push(...b.verts),g.texs.push(...b.texs),g.iconVerts.push(...b.iconVerts),g.iconTexs.push(...b.iconTexs),g.imageVerts.push(...b.imageVerts),g.imageTexs.push(...b.imageTexs),g.frameVerts.push(...b.frameVerts),g.frameTexs.push(...b.frameTexs),g.shadowVerts.push(...b.shadowVerts),g.shadowTexs.push(...b.shadowTexs);for(let y=0;y<b.partVerts.length;y++)b.partVerts[y]?.length&&(((d=g.partVerts)[y]??(d[y]=[])).push(...b.partVerts[y]),((m=g.partTexs)[y]??(m[y]=[])).push(...b.partTexs[y]));h+=b.quads,this.placedCount++;}this.rememberPlaced(),this.fading&&this.onAssetsReady?.(),this.requestMissing(),h&&(this.styleOrder=u,this.draw(e,t,f,h,a));}collect(e,t,o,r){let i=[],a=cn,s=this.padding,l=Jo(e,o),c=l.far;this.fog=l;let[f,u,h]=e.cameraPositionPx;for(let d of r){let m=(d.layout?.priority??0)*dg,p=t.get(d.source??De);if(!p)continue;let b=d.layout?.showFor==="highlight",g=d.layout?.placement==="map",{shift:y,drop:A}=g?Kh(d,e.zoom,e.pixelsPerMeter):{shift:0,drop:0};if(b&&!this.highlightFootprint)continue;let x=e.worldSize>0?e.pixelsPerMeter/e.worldSize*1.5:0,v=o.bucketKeyFor(d);if(v!==null)for(let w of p.visibleTiles){let B=p.getTile(w)?.data?.buckets?.[v];if(!B||!Mi(B))continue;let _=new Int16Array(B.anchors),T=new Uint8Array(B.priorities),k=B.rotations?new Int16Array(B.rotations):null,K=B.lines?new Int16Array(B.lines):null,P=B.lineStarts?new Uint32Array(B.lineStarts):null,W=w.bounds(),z=e.worldSize,L=(W.maxX-W.minX)*z/B.extent,X=W.minX*z,Q=W.minY*z;for(let G=0;G<T.length;G++){let Y=X+_[G*2]*L,ie=Q+_[G*2+1]*L,ee=Math.hypot(Y-f,ie-u,h);if(c!==1/0&&ee>c||b&&!Zt(this.highlightFootprint,Y/z,ie/z,x))continue;let ue=Y,$=ie;if(g&&k){let J=k[G]*Math.PI/180,Z=y;ue-=Math.sin(J)*Z,$+=Math.cos(J)*Z;}let Ae=this.elevationAt?this.elevationAt(Y/z,ie/z):0,ve=e.worldPxToPoint(ue,$,Ae),he=K&&P?_g(e,K,P,G,X,Q,L,this.elevationAt):void 0,xe=d.layout?.textPlacement==="line";if(xe){if(!he)continue}else if(!ve||ve.x<s.left-a||ve.y<s.top-a||ve.x>e.width-s.right+a||ve.y>e.height-s.bottom+a)continue;let de=Y/z,we=ie/z,I=B.texts[G]??"";i.push({key:rr.keyOf({layerId:d.id,text:I,mercX:de,mercY:we}),layer:d,screenX:ve?ve.x:he[0].x,screenY:(ve?ve.y:he[0].y)+A,text:I,icon:B.icons[G]??"",priority:T[G]+m,rotate:Xh(d,k,G,e.bearing),mercX:de,mercY:we,depth:xe?1:Rh(ee,l),line:he});}}}return i}place(e,t,o){let r=e.layer.layout??{},i=e.key;if(this.hiddenKey!==null&&this.hiddenKey===i)return null;let a=this.fadeOf(i,this.now)*e.depth,s=this.hoverKey!==null&&this.hoverKey===i,l=pe(r.textSize,t,13),c=pe(r.iconSize,t,16),f=r.iconTextGap??5,[u,h]=r.offset??[0,0],d=r.placement==="map",m=null,p=null;if(e.icon&&!d&&this.images.has(e.icon)){let ne=this.images.get(e.icon);if(ne.sdf){let re=`image:${e.icon}`,se=this.atlas.get(re);if(!se){let me=new Uint8Array(ne.width*ne.height);for(let _e=0;_e<me.length;_e++)me[_e]=ne.data[_e*4+3];se=this.atlas.add(re,me,ne.width,ne.height)??void 0;}se&&(m=se);}else p=this.images.entryFor(e.icon),p&&(m=p);}if(e.icon&&!d&&!m&&!p){this.icons.isDefined(e.icon)||(this.missingImage&&!this.askedImages.has(e.icon)&&(this.askedImages.add(e.icon),this.missingImage(e.icon)),e.icon="dot");let ne=`icon:${e.icon}`,re=this.atlas.get(ne);if(!re){let se=this.icons.get(e.icon);se?re=this.atlas.add(ne,se.data,se.width,se.height)??void 0:this.pendingIcons.add(e.icon);}re&&(m=re);}let b=m&&!d?r.iconParts??[]:[],g=[];for(let ne of b){let re=`icon:${ne}`,se=this.atlas.get(re);if(!se){let me=this.icons.get(ne);me?se=this.atlas.add(re,me.data,me.width,me.height)??void 0:this.pendingIcons.add(ne);}g.push(se??null);}let y=g.length>0&&g.every(ne=>ne!==null),A=null,x=m?zh(r.iconFrame):null;if(x){let ne=`icon:${x}`,re=this.atlas.get(ne);if(!re){let se=this.icons.get(x);se?re=this.atlas.add(ne,se.data,se.width,se.height)??void 0:this.pendingIcons.add(x);}re&&(A=re);}let v=A?Math.max(r.iconFrameScale??1.6,1):1,w=A?c*v:0,C=A?w*(A.height-Ke*2)/Math.max(A.width-Ke*2,1):0,B=A&&r.iconFrame==="pin"?Ag:.5,_=null,T=A&&e.layer.paint.frameShadow!==void 0?Cg(r.iconFrame):null;if(T){let ne=`icon:${T}`,re=this.atlas.get(ne);if(!re){let se=this.icons.get(T);se?re=this.atlas.add(ne,se.data,se.width,se.height)??void 0:this.pendingIcons.add(T);}re&&(_=re);}let k=null;if(e.text&&(this.glyphs.needsLoad(e.text)&&this.pendingText.add(e.text),k=Vs(e.text,this.glyphs,r.textPlacement==="line"?Number.MAX_SAFE_INTEGER:r.maxLineChars??15,hg(e.layer,t,l)),!k&&!m)||!k&&!m)return null;let K=l/Gt,P=k?k.width*K:0,W=k?k.height*K:0,z=Ks+(r.collisionPadding??0),L=this.stickyKeys.has(i)?z-Ks:0;if(e.layer.layout?.textPlacement==="line")return k&&e.line?this.placeOnLine(e,k,K,W,o,a,L):null;let X=r.iconPlacement??"top",Q=X==="auto"&&m&&k?Mg(Bg,this.lastSide.get(i)):[X],G=m?m.width/Math.max(m.height,1):1,Y=null;for(let ne of Q){let re=ne==="behind"&&!!m&&!!k,se=ne==="top"&&!!m&&!!k,me=re?W+f*2:c,_e=m?me*G:0,Ce=Math.max(_e,w),Be=Math.max(me,C),ge=re?Math.max(_e,P+f*2):se?Math.max(Ce,P):Ce+(m&&k?f:0)+P,ye=re?Math.max(me,W):se?Be+f+W:Math.max(m?Be:0,W),Te=B===.5||!m?0:se?Be-ye/2:Be/2,Ie=m&&k&&!re&&!se?(ge/2-Ce/2)*(ne==="right"?-1:1):0,Ee=e.screenX+u+Ie,Me=e.screenY+h-Te,We={x1:Ee-ge/2-z,y1:Me-ye/2-z,x2:Ee+ge/2+z,y2:Me+ye/2+z};if(this.withinLayout(We)&&!(!r.allowOverlap&&Wh(o,Gh(We,L),r.placementGroup))){Y={behind:re,stacked:se,iconFirst:ne!=="right",iconW:_e,iconH:me,blockW:Ce,blockH:Be,totalW:ge,totalH:ye,cx:Ee,cy:Me,box:We},this.sideNow.set(i,ne);break}}if(!Y)return null;let{behind:ie,stacked:ee,iconFirst:ue,iconW:$,iconH:Ae,blockW:ve,blockH:he,totalW:xe,totalH:de,cx:we,cy:I,box:J}=Y;Hh(r)&&Nh(o,J,Oh(r));let Z=[],ce=[],ae=[],be=[],Se=[],F=[],U=[],j=[],R=[],H=[],E=[],M=[],S=0,D=we-xe/2,O=ee?(he+f)/2:0,N=he*(B-.5),q=1/0,V=1/0,te=-1/0,oe=-1/0;if(k){let ne=ee||ie?we:D+(m&&ue?ve+f:0)+P/2;for(let re of k.glyphs){let se=re.glyph,me=`g:${se.id}`,_e=this.atlas.get(me);if(!_e&&(!se.bitmap||(_e=this.atlas.add(me,se.bitmap,se.width+Ke*2,se.height+Ke*2)??void 0,!_e)))continue;let Ce=ne+(re.x+se.left-Ke)*K,Be=I+O+(re.y-se.top-Ke)*K,ge=_e.width*K,ye=_e.height*K;fn(Z,ce,Ce,Be,ge,ye,_e,0,a),S++;let Te=Ke*K;q=Math.min(q,Ce+Te),V=Math.min(V,Be+Te),te=Math.max(te,Ce+ge-Te),oe=Math.max(oe,Be+ye-Te);}if(m&&V<1/0&&!ie){let re=ee?I-de/2+he+f-V:I+N-(V+oe)/2;if(re!==0){for(let se=1;se<Z.length;se+=4)Z[se]+=re;V+=re,oe+=re;}}}if(m){let ne=s&&!ie?cg:1,re=$*ne,se=Ae*ne,_e=(ee?we-$/2:D+(ue?0:xe-ve)+(ve-$)/2)-(re-$)/2,Ce=(ee?I-de/2+(he-Ae)/2:I-Ae/2)+N-(se-Ae)/2;if(A){let ge=w*ne,ye=C*ne,Te=_e+re/2-ge/2,Ie=Ce+se/2-ye*B,Ee=Ke/Math.max(A.width-Ke*2,1)*ge,Me=Ke/Math.max(A.height-Ke*2,1)*ye;if(_){let We=ge*Ph,Re=ye*Ph,He=Te+ge/2-We/2,lt=Ie+ye/2-Re/2,qe=Ke/Math.max(_.width-Ke*2,1)*We,Bt=Ke/Math.max(_.height-Ke*2,1)*Re;fn(R,H,He-qe,lt-Bt,We+qe*2,Re+Bt*2,_,0,a),S++;}fn(U,j,Te-Ee,Ie-Me,ge+Ee*2,ye+Me*2,A,0,a),S++;}if(ie&&te>q){let ge=f*1.6,ye=f;re=(te-q+ge*2)*ne,se=(oe-V+ye*2)*ne,_e=q-ge,Ce=V-ye;}let Be=(ge,ye,Te,Ie=true)=>{let Ee=Ie?Ke/Math.max(ge.height-Ke*2,1)*se:0;fn(ye,Te,_e-Ee,Ce-Ee,re+Ee*2,se+Ee*2,ge,e.rotate,a),S++;};if(p)Be(p,Se,F,false);else if(y&&!ie)for(let ge=0;ge<g.length;ge++)Be(g[ge],E[ge]??(E[ge]=[]),M[ge]??(M[ge]=[]));else Be(m,ae,be);}return S?{verts:Z,texs:ce,iconVerts:ae,iconTexs:be,imageVerts:Se,imageTexs:F,frameVerts:U,frameTexs:j,shadowVerts:R,shadowTexs:H,partVerts:E,partTexs:M,quads:S,box:J}:null}placeOnLine(e,t,o,r,i,a,s){let l=e.line,c=t.glyphs.map(P=>({offset:(P.x+t.width/2)*o,width:Math.max(P.glyph.advance,1)*o})),f=c.length?c[c.length-1].offset+c[c.length-1].width:0,u=e.layer.layout??{},h=[],d=[],m=[],p=0,b=r/2+Ks,g=Math.max(u.symbolSpacing??250,f+1),y=`${e.layer.id}|${e.text}`,A=P=>{let W=P.path.map(Q=>({x1:Q.x-b,y1:Q.y-b,x2:Q.x+b,y2:Q.y+b})),z=this.lineAnchors.get(y);if(z&&g>0){let Q=P.path[P.path.length>>1];for(let G=0;G+1<z.length;G+=2)if(Math.hypot(Q.x-z[G],Q.y-z[G+1])<g)return false}for(let Q of W)if(!this.withinLayout(Q)||!u.allowOverlap&&Wh(i,Gh(Q,s),u.placementGroup))return false;if(Hh(u))for(let Q of W)Nh(i,Q,Oh(u));m.push(...W);let L=P.path[P.path.length>>1],X=this.lineAnchors.get(y);return X?X.push(L.x,L.y):this.lineAnchors.set(y,[L.x,L.y]),true},x=-1/0,v=1/0;for(let P of t.glyphs)P.glyph.height<=0||(x=Math.max(x,P.glyph.top),v=Math.min(v,P.glyph.top-P.glyph.height));let w=Number.isFinite(x)?(x+v)/2*o:0,C=xg(l,g,f,this.viewport,fg);if(!C.length)return null;let B=this.rememberedAt(e.key,l,f),_=Us(l,c,f,{fontSize:Gt*o,atList:B.length?B:C,accept:A});if(!_.length)return null;let T=this.lineAt.get(e.key);B.length&&T?this.lineAtNow.set(e.key,T):this.rememberAt(e.key,_.map(P=>P.path[P.path.length>>1]));for(let P of _){let W=P.path[P.path.length>>1]??P.glyphs[0],z=a*this.depthFadeAt(W.x,W.y);for(let L=0;L<t.glyphs.length;L++){let X=t.glyphs[L].glyph,Q=P.glyphs[L],G=`g:${X.id}`,Y=this.atlas.get(G);if(!Y&&(!X.bitmap||(Y=this.atlas.add(G,X.bitmap,X.width+Ke*2,X.height+Ke*2)??void 0,!Y)))continue;let ie=Y.width*o,ee=Y.height*o,ue=(X.height/2-X.top)*o+w,$=Q.angle*Math.PI/180;fn(h,d,Q.x-ie/2-Math.sin($)*ue,Q.y-ee/2+Math.cos($)*ue,ie,ee,Y,Q.angle,z),p++;}}if(!p)return null;let k=m.map(P=>(P.x1+P.x2)/2),K=m.map(P=>(P.y1+P.y2)/2);return {verts:h,texs:d,iconVerts:[],iconTexs:[],imageVerts:[],imageTexs:[],frameVerts:[],frameTexs:[],shadowVerts:[],shadowTexs:[],partVerts:[],partTexs:[],quads:p,box:{x1:Math.min(...k)-b,y1:Math.min(...K)-b,x2:Math.max(...k)+b,y2:Math.max(...K)+b}}}colorOf(e,t,o,r){if(e&&typeof e=="object"&&"from"in e){let i=e,a=this.layersById.get(i.from),s=ht(a?.paint?.[t],o,r),l=1-Math.min(Math.max(i.darken??0,0),1);return [s[0]*l,s[1]*l,s[2]*l,s[3]]}return ht(e,o,r)}inStyleOrder(e){return [...e.values()].sort((t,o)=>(this.styleOrder.get(t.layer.id)??0)-(this.styleOrder.get(o.layer.id)??0))}draw(e,t,o,r,i){let a=this.shader,s=e.gl;this.ensureBuffers(e,r);let l=this.vbo,c=this.vao;if(!l||!c||!this.ibo)return;let f=new ArrayBuffer(r*4*Xs),u=new Float32Array(f),h=new Uint16Array(f),d=[],m=0,p=(b,g,y,A,x)=>{let v=b.length/16;if(v){d.push({layer:y,role:A,first:m/4*6,count:v*6,part:x});for(let w=0;w<v*4;w++){let C=m*5;u[C]=b[w*4],u[C+1]=b[w*4+1],h[C*2+4]=g[w*2],h[C*2+5]=g[w*2+1],u[C+3]=b[w*4+2],u[C+4]=b[w*4+3],m++;}}};for(let b of this.inStyleOrder(o)){p(b.shadowVerts,b.shadowTexs,b.layer,"shadow"),p(b.frameVerts,b.frameTexs,b.layer,"frame");for(let g=0;g<b.partVerts.length;g++)p(b.partVerts[g]??[],b.partTexs[g]??[],b.layer,"part",g);p(b.iconVerts,b.iconTexs,b.layer,"icon"),p(b.imageVerts,b.imageTexs,b.layer,"image"),p(b.verts,b.texs,b.layer,"text");}l.update(new Uint8Array(f)),a.use(),this.atlas.bind(e,0),a.setInt("u_atlas",0),this.images.bind(e,1),a.setInt("u_images",1),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?s.drawingBufferWidth/t.width:1),e.setDepthTest(false),e.setDepthMask(false),e.setBlend("premultiplied"),e.setCull("none"),c.bind();for(let b of d){let g=b.layer.paint,y=pe(g.opacity,i,1),A=b.role==="image";a.setFloat("u_image_mode",A?1:0),a.setFloat("u_image_opacity",y),a.setFloat("u_atlas_size",A?this.images.size:this.atlas.size);let x=b.role==="icon",v=b.role==="frame";if(b.role==="shadow"){let L=pe(g.frameShadow,i,0);if(L>0){let X=this.colorOf(g.frameShadowColor??g.frameColor??g.haloColor??g.color,"haloColor",i,[.15,.15,.15,1]),Q=g.frameShadowColor!==void 0?1:.65;a.setVec2("u_px_offset",0,pe(g.frameShadowOffset,i,3)),a.setFloat("u_shadow_px",Math.max(pe(g.frameShadowBlur,i,6),.1)),a.setVec3("u_grad",0,0,0),a.setVec4v("u_color",it([X[0]*Q,X[1]*Q,X[2]*Q,L*X[3]*y])),s.drawElements(s.TRIANGLES,b.count,s.UNSIGNED_INT,b.first*4),a.setFloat("u_shadow_px",0),a.setVec2("u_px_offset",0,0);}continue}a.setVec2("u_px_offset",0,0),a.setFloat("u_shadow_px",0);let w=b.role==="part"?(b.layer.paint.partColors??[])[b.part??0]??b.layer.paint.iconColor??b.layer.paint.color:void 0,C=(L,X,Q)=>v?X??L??Q:x?L??Q:Q,B=this.colorOf(b.role==="part"?w:v?g.frameColor??g.haloColor??g.color:C(g.iconColor,void 0,g.color),v?"haloColor":"color",i,[.15,.15,.15,1]),_=v?g.frameHaloColor:C(g.iconHaloColor,void 0,g.haloColor),T=_===void 0&&v,k=this.colorOf(_??(v?g.iconColor??g.color:g.haloColor),T?"color":"haloColor",i,[1,1,1,1]);v&&g.frameHaloColor===void 0&&(k[3]*=.35),v&&(B[3]*=pe(g.frameOpacity,i,1));let K=pe(b.role==="part"?(g.partHaloWidths??[])[b.part??0]??0:v?g.frameHaloWidth??1.1:C(g.iconHaloWidth,void 0,g.haloWidth),i,b.role==="part"?0:1.2),P=pe(b.layer.layout?.textSize,i,13),W=b.role==="text"?pe(g.textWeight,i,0):0;a.setFloat("u_edge",W>0?an-W/(tr*(P/Gt)):an),a.setVec4v("u_color",it([B[0],B[1],B[2],B[3]*y])),a.setVec4v("u_halo_color",it([k[0],k[1],k[2],k[3]*y])),a.setFloat("u_halo",K/(tr*(P/Gt)));let z=v?pe(g.frameGradient,i,0):0;if(z>0){let L=this.frameEntryOf(b.layer);if(L){let X=this.atlas.size;a.setVec3("u_grad",L.y/X,(L.y+L.height)/X,z);}else a.setVec3("u_grad",0,0,0);}else a.setVec3("u_grad",0,0,0);s.drawElements(s.TRIANGLES,b.count,s.UNSIGNED_INT,b.first*4);}e.bindVAO(null);}frameEntryOf(e){let t=zh(e.layout?.iconFrame);return t?this.atlas.get(`icon:${t}`)??null: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 Je(e,new Uint8Array(this.capacityQuads*4*Xs),Lh,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 Ue(e,o),this.vao=new Ne(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;}};rr.LINE_MARK=2;var nr=rr;function fn(n,e,t,o,r,i,a,s=0,l=1){let c=i/Math.max(a.height,1);if(s){let f=s*Math.PI/180,u=Math.cos(f),h=Math.sin(f),d=t+r/2,m=o+i/2;for(let[p,b]of [[t,o],[t+r,o],[t+r,o+i],[t,o+i]]){let g=p-d,y=b-m;n.push(d+g*u-y*h,m+g*h+y*u,c,l);}}else n.push(t,o,c,l,t+r,o,c,l,t+r,o+i,c,l,t,o+i,c,l);e.push(a.x,a.y,a.x+a.width,a.y,a.x+a.width,a.y+a.height,a.x,a.y+a.height);}function _g(n,e,t,o,r,i,a,s){if(o+1>=t.length)return;let l=t[o],c=t[o+1],f=[];for(let u=l;u<c;u++){let h=r+e[u*2]*a,d=i+e[u*2+1]*a,m=s?s(h/n.worldSize,d/n.worldSize):0,p=n.worldPxToPoint(h,d,m);if(!p)break;f.push(p);}return f.length>=2?f:void 0}var Uh=(n,e)=>n*4096+e;function Wh(n,e,t){let o=Math.floor(e.x1/co),r=Math.floor(e.y1/co),i=Math.floor(e.x2/co),a=Math.floor(e.y2/co);for(let s=o;s<=i;s++)for(let l=r;l<=a;l++){let c=n.get(Uh(s,l));if(c){for(let f of c)if(!(f.group!==void 0&&f.group!==t)&&e.x1<f.x2&&e.x2>f.x1&&e.y1<f.y2&&e.y2>f.y1)return true}}return false}function Nh(n,e,t){let o=Math.floor(e.x1/co),r=Math.floor(e.y1/co),i=Math.floor(e.x2/co),a=Math.floor(e.y2/co);for(let s=o;s<=i;s++)for(let l=r;l<=a;l++){let c=Uh(s,l),f=n.get(c);f||n.set(c,f=[]),f.push(t===void 0?e:{...e,group:t});}}function Kh(n,e,t){let r=n.layout?.arrowUnits!=="meters"?1:t,i=pe(n.layout?.arrowLength,e,50)*r;return {shift:pe(n.layout?.arrowGap,e,20)*r+i/2,drop:i/2+(n.layout?.iconTextGap??4)}}function Xh(n,e,t,o){return !n.layout?.iconRotate||!e?0:e[t]-o}var fo=class{constructor(e,t){this.capacity=e;this.onEvict=t;this.map=new fe;}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 Eg=[["\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."]],Jh=new Map(Eg);function Js(n){let e=n.split(" ");if(e.length<2)return n;let t=false,o=e.map(i=>{let a=Jh.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=>Jh.get(i.toLowerCase())===void 0).length?n:o.join(" ")}function Ys(n,e){let t=[],o=[],r=[],i=[],a=[],s=e.textPlacement==="line",l=[],c=[],f=[];for(let u of n.features()){if(!et(e.filter,u.properties))continue;let h=u.loadGeometry(),d=Ig(u.type,h);if(!d)continue;let m=e.textField?js(e.textField,u.properties):"",p=m&&e.abbreviate?Js(m):m,b=e.iconImage?js(e.iconImage,u.properties):"";if(!(!p&&!b)){if(s){let g=Fg(u.type,h);if(!g)continue;f.push({text:p,line:g});continue}t.push(d[0],d[1]),o.push(p),r.push(b),i.push(Dg(u.properties)),a.push(e.iconRotate&&Math.round(Number(u.properties[e.iconRotate]??0))||0);}}if(s){for(let{text:u,line:h}of Sg(f)){c.push(l.length/2);for(let d of h)l.push(d);t.push(Math.round(h[0]),Math.round(h[1])),o.push(u),r.push(""),i.push(128),a.push(0);}c.push(l.length/2);}return o.length?{anchors:new Int16Array(t).buffer,texts:o,icons:r,priorities:new Uint8Array(i).buffer,rotations:new Int16Array(a).buffer,...s?{lines:new Int16Array(l).buffer,lineStarts:new Uint32Array(c).buffer}:{}}:null}function Sg(n){let e=[],t=new Map,o=new Map,r=(i,a,s)=>`${i}\u241F${a}\u241F${s}`;for(let{text:i,line:a}of n){let s=r(i,a[0],a[1]),l=r(i,a[a.length-2],a[a.length-1]),c=t.get(l),f=o.get(s);if(f!==void 0){let u=e[f];if(u.line.push(...a.slice(2)),o.delete(s),o.set(r(i,u.line[u.line.length-2],u.line[u.line.length-1]),f),c!==void 0&&c!==f){let h=e[c];u.line.push(...h.line.slice(2)),h.line=[],t.delete(l),o.set(r(i,u.line[u.line.length-2],u.line[u.line.length-1]),f);}continue}if(c!==void 0){let u=e[c];u.line.unshift(...a.slice(0,a.length-2)),t.delete(l),t.set(r(i,u.line[0],u.line[1]),c);continue}t.set(s,e.length),o.set(l,e.length),e.push({text:i,line:a});}return e.filter(i=>i.line.length>=4)}function Fg(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 Ig(n,e){if(!e.length)return null;if(n===1){let a=e[0];return a.length>=2?[a[0],a[1]]:null}if(n===2){let a=-1,s=0,l=0;for(let c of e)for(let f=0;f+3<c.length;f+=2){let u=c[f+2]-c[f],h=c[f+3]-c[f+1],d=u*u+h*h;d>a&&(a=d,s=c[f]+u/2,l=c[f+1]+h/2);}return a>0?[Math.round(s),Math.round(l)]:null}let t=1/0,o=1/0,r=-1/0,i=-1/0;for(let a of e)for(let s=0;s<a.length;s+=2)a[s]<t&&(t=a[s]),a[s]>r&&(r=a[s]),a[s+1]<o&&(o=a[s+1]),a[s+1]>i&&(i=a[s+1]);return isFinite(t)?[Math.round((t+r)/2),Math.round((o+i)/2)]:null}function Dg(n){let e=n.importance;if(typeof e=="number"&&isFinite(e))return Math.max(0,255-Math.min(Math.max(e,1),9)*20);let t=n.rank;return typeof t=="number"&&isFinite(t)?Math.max(0,255-Math.min(t,255)):128}function js(n,e){let t=Array.isArray(n)?n:[n];for(let o of t){let r=true,a=o.replace(/\{([^}]+)\}/g,(s,l)=>{let c=e[l];return c==null||c===""?(r=false,""):String(c)}).trim();if(r&&a)return a}return ""}function jh(n,e){let t=[],o=[];for(let r=0;r<n.length;r++){let i=n.feature(r);if(i.type===1&&et(e,i.properties))for(let a of i.loadGeometry())for(let s=0;s+1<a.length;s+=2)t.push(a[s],a[s+1]),o.push(i.properties);}return o.length?{anchors:Int16Array.from(t).buffer,props:o}:null}function Tg(){let n=typeof self<"u"?self.origin:void 0;return n&&n!=="null"&&!n.startsWith("blob:")?n+"/":void 0}function un(n,e){let t={},o=[],r={},i=new Set,a=[],l=e.plan.some(c=>c.type==="surface"&&(c.elevation??0)>0)&&e.plan.some(c=>c.type==="line"&&c.ground)?ss(e.metersPerTile):void 0;for(let c of e.plan){if(!Hg(c,e.zoom,e.sourceMaxZoom))continue;let f=n.layers[c.sourceLayer];if(!f)continue;let u=Og(e.zoom,f.extent);try{if(c.splitBy){let d=Gg(f,c.splitBy,c.filter);if(!d.length)continue;let m=r[c.splitBy]??(r[c.splitBy]=[]);for(let p of d){m.includes(p)||m.push(p);let b={...c,splitBy:void 0,filter:Wg(c.filter,c.splitBy,p)},g=Zs(b,f,u,e.metersPerTile,e.zoom,l,void 0,o,e.tile);g&&(t[Ot(c.id,p)]=g);}continue}if(c.network&&c.type==="line"){for(let d of zg(f,c.filter)){let m=Zs(c,f,u,e.metersPerTile,e.zoom,l,d,o,e.tile);m&&(t[Ot(c.id,d)]=m,i.add(d));}continue}let h=Zs(c,f,u,e.metersPerTile,e.zoom,l,void 0,o,e.tile);h&&(t[c.id]=h);}catch(h){a.push(`${c.id}: ${h instanceof Error?h.message:String(h)}`);}}return {buckets:t,seams:o,splits:r,levels:[...i].sort((c,f)=>c-f),failed:a}}async function Yh(n,e){let t=performance.now(),o=Tg(),r=await fetch(n.url,{signal:e,credentials:"same-origin",...o?{referrer:o}:{}}),i=(b,g,y,A,x=0)=>({type:"loaded",id:n.id,buckets:{},timing:{fetchMs:A,parseMs:x},diag:{status:b,bytes:g,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(),s=performance.now()-t;if(a.byteLength===0)return i(r.status,0,[],s);let l=performance.now(),c=new Ut(a),f=Object.keys(c.layers),{buckets:u,seams:h,splits:d,levels:m,failed:p}=un(c,n);return {type:"loaded",id:n.id,raw:a,buckets:u,...h.length?{seams:h}:{},...Object.keys(d).length?{splits:d}:{},...m.length?{levels:m}:{},timing:{fetchMs:s,parseMs:performance.now()-l},diag:{status:r.status,bytes:a.byteLength,layers:f,built:Object.keys(u).length,...p.length?{failed:p}:{}}}}function kg(n){return e=>{let t=e.lift,o=typeof t=="number"?t:typeof t=="string"?Number(t):NaN;return Number.isFinite(o)?Math.max(0,o):Math.max(0,vt(e))*n}}function Lg(n){let e=n.lift,t=typeof e=="number"?e:typeof e=="string"?Number(e):NaN;return !Number.isFinite(t)||t===0?null:()=>t}function Rg(n,e){return t=>{let o=t.width,r=typeof o=="number"?o:typeof o=="string"?Number(o):NaN,i=Number.isFinite(r)&&r>0?r:n??0;return i>0?i+(e??0):null}}function Pg(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 Hg(n,e,t){let o=e-1,r=e<t?e+1:24;return !(n.maxzoom<o||n.minzoom>r)}function Og(n,e){return n<=6?Math.max(64,e/24):0}function Zs(n,e,t,o,r,i,a,s,l){{let c=ba(l,e.extent);if(n.type==="fill"){let u=o>0?o/e.extent:0,h=n.cornerRadius&&u>0?{radius:n.cornerRadius/u,segments:n.cornerSegments,extent:e.extent,minCutRatio:0,maxChord:kc/u}:void 0,d=Oa(e,n.filter,t,h,n.clipToTile===true,e.extent,Wr(n.dataPaint,r));return d?{kind:"fill",...d,extent:e.extent}:null}if(n.type==="surface"){let u=as(e,e.extent,n.filter,{metersPerUnit:o>0?o/e.extent:0,maxSegment:t,elevation:n.elevation??0,base:n.base,bevel:n.bevel,weld:n.weld,bevelDrop:n.bevelDrop,cornerRadius:n.cornerRadius,cornerSegments:n.cornerSegments,...i&&!n.fromLines&&n.groundField!==false?{onShapes:h=>ls(i,h,n.elevation??0,e.extent)}:{},...n.groundBy?{liftBy:Pg(n.groundBy)}:{},...n.fromLines?{widthOf:Rg(n.width,n.widthExtra),widthExtra:n.widthExtra??0}:{},...n.deck?{deck:n.deck}:{},...n.levelHeight&&!n.groundBy?{liftBy:kg(n.levelHeight)}:{},liftAt:c});return u?{kind:"surface",...u}:null}if(n.type==="line"){let u=d=>c(d)??Lg(d),h=fs(e,n.filter,t,n.ground?i:void 0,o>0?o/e.extent:0,{level:a,paint:Wr(n.dataPaint,r),liftAt:u});return h?{kind:"line",...h,extent:e.extent}:null}if(n.type==="model"){let u=jh(e,n.filter);return u?{kind:"placement",...u,extent:e.extent}:null}if(n.type==="symbol"){let u=Ys(e,{filter:n.filter,textField:n.textField,iconImage:n.iconImage,iconRotate:n.iconRotate,textPlacement:n.textPlacement,abbreviate:n.abbreviate});return u?{kind:"symbol",...u,extent:e.extent}:null}let f=Ra(e,e.extent,n.filter,{metersPerUnit:o>0?o/e.extent:0,cornerRadius:n.cornerRadius,cornerSegments:n.cornerSegments,paint:Wr(n.dataPaint,r)},s);return f?{kind:"fill-extrusion",vertices:f.vertices,indices:f.indices,featureIds:f.featureIds,vertexCount:f.vertexCount,indexCount:f.indexCount,extent:f.extent,...f.dataPaint?{dataPaint:f.dataPaint}:{}}:null}}function Gg(n,e,t){let o=[];for(let r of n.features()){if(!et(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 zg(n,e){let t=[];for(let o of n.features()){if(!et(e,o.properties))continue;let r=vt(o.properties);t.includes(r)||t.push(r);}return t.sort((o,r)=>o-r)}function Wg(n,e,t){let o=["==",e,t];return n?["all",n,o]:o}var Wi=new Map;function Zh(n){let e=n.indexOf("://");if(e<=0)return null;let t=n.slice(0,e),o=Wi.get(t);return o?{scheme:t,handler:o}:null}function qh(n){let e=n.raw?.byteLength??0;for(let t of Object.values(n.buckets)){let o=t;for(let r of Object.values(o))(r instanceof ArrayBuffer||ArrayBuffer.isView(r))&&(e+=r.byteLength);}return e}var Ni=class{constructor(e){this.id=e;this.state="loading";this.data=null;this.error=null;this.requestId=0;this.failures=0;this.retryAt=0;this.buckets=new fe;this.bytesHeld=0;}get raw(){return this.data?.raw}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;}},Qh=6,Ng=600,Vg=1e4,Ug=24;function Kg(n,e){let t=e.parent();for(;t&&t.z>=n.z;){if(t.dataKey===n.dataKey)return true;t=t.parent();}return false}function Xg(n,e){let t=new Le;for(let r of e)t.add(r.dataKey);let o=0;for(let r of e){let i=r.parent(),a=false;for(;i&&i.z>n.z;){if(t.has(i.dataKey)){a=true;break}i=i.parent();}a||(o+=Math.pow(4,n.z-r.z));}return o>=1}var ir=class extends yt{constructor(t,o){super();this.pool=t;this.visible=[];this.holes=[];this.retryWake=1/0;this.warmed=false;this.version=0;this.transform=null;this.protocolAborts=new fe;this.opts={cacheSize:160,detailBias:1,maxTiles:512,rank:1,now:()=>performance.now(),...o},this.cache=new fo(this.opts.cacheSize,(r,i)=>{i.state==="loading"&&this.pool.abort(i.requestId),i.destroy();});}get plan(){return this.opts.plan}get maxzoom(){return this.opts.maxzoom}newTile(t){let o=new Ni(t);return this.cache.set(t.dataKey,o),o}acceptTile(t,o){this.cache.peek(t.id.dataKey)===t&&(t.data=o,t.bytesHeld=qh(o),t.state=Object.keys(o.buckets).length?"loaded":"empty",this.version++,this.emit("data",{tile:t}));}failTile(t,o){t.state="error",t.error=o,t.failures++,t.retryAt=this.now()+Math.min(Ng*Math.pow(2,t.failures-1),Vg),this.emit("error",{tile:t.id,message:o});}now(){return this.opts.now()}drawable(t){return !!t&&(t.state==="loaded"||t.state==="empty")}invalidate(){for(let[t,o]of this.cache.entries())o.state==="loading"&&this.pool.abort(o.requestId),o.destroy(),this.cache.delete(t);this.visible=[],this.holes=[],this.version++,this.emit("data",{tile:null});}setLodParams(t){t.detailBias!==void 0&&(this.opts.detailBias=t.detailBias),t.maxTiles!==void 0&&(this.opts.maxTiles=t.maxTiles);}setTransformRequest(t){this.transform=t;}get retainedBytes(){let t=0;for(let o of this.cache.values())t+=o.bytesHeld;return t}dropOldest(){let t=new Le;for(let o of this.visibleTiles)t.add(o.dataKey);for(let[o,r]of this.cache.entries()){if(t.has(o)||r.state==="loading")continue;let i=r.bytesHeld;return this.cache.delete(o),i}return -1}get visibleTiles(){return this.visible}get holeTiles(){return this.holes}get nextRetryIn(){return Number.isFinite(this.retryWake)?Math.max(0,this.retryWake-this.now()):1/0}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}loadedTiles(){return this.cache.entries()}get pendingCount(){let t=0;for(let o of this.cache.values())o.state==="loading"&&t++;return t}update(t){let o=qt(t,this.opts),r=new Le;for(let c of o)r.add(c.dataKey);for(let[c,f]of this.cache.entries())f.state==="loading"&&!r.has(c)&&(this.pool.abort(f.requestId),this.cache.delete(c));let i=Math.max(this.opts.cacheSize,r.size*2);this.cache.setCapacity(i);let a=this.opts.rank*1e9;this.retryWake=1/0;for(let c of o){let f=this.cache.get(c.dataKey);if(!f){this.loadTile(c,a+t.distanceToTile(c));continue}if(f.state==="error")if(this.now()>=f.retryAt){let u=f.failures;this.loadTile(c,a+t.distanceToTile(c));let h=this.cache.peek(c.dataKey);h&&(h.failures=u);}else this.retryWake=Math.min(this.retryWake,f.retryAt);}let s=this.coverFor(o),l=this.readyFor(o);(this.anyReady(s.tiles)||this.visible.length===0||!this.covers(o))&&(this.visible=s.tiles,this.holes=s.holes,l&&o.length&&(this.warmed=true));}coverFor(t){let o=m=>this.drawable(this.cache.peek(m.dataKey)),r=new fe,i=new fe,a=[];for(let m of t)o(m)?r.set(m.dataKey,m):a.push(m);let s=this.descendantsOf(a),l=[];for(let m of t)o(m)&&l.push(m);for(let[,m]of s)for(let p of m)l.push(p);let c=m=>l.some(p=>Kg(m,p)),f=m=>{let p=m.parent();for(let b=1;p&&b<=Qh;b++,p=p.parent())if(o(p))return p;return null};for(let m of a){let p=s.get(m.dataKey);if(p&&p.length){for(let A of p)r.set(A.dataKey,A),this.cache.get(A.dataKey);if(Xg(m,p))continue;let y=f(m);y&&i.set(y.dataKey,y);continue}let b=f(m);if(!b){r.set(m.dataKey,m);continue}let g=b;if(c(g)){i.set(g.dataKey,g);continue}r.set(g.dataKey,g);}let u=[];for(let[,m]of r){let p=m.parent(),b=false;for(let g=0;p&&g<=Qh;g++){if(r.has(p.dataKey)){b=true;break}p=p.parent();}b||(u.push(m),this.cache.get(m.dataKey));}let h=[],d=new Le;for(let m of u)d.add(m.dataKey);for(let[,m]of i)d.has(m.dataKey)||(h.push(m),this.cache.get(m.dataKey));return h.sort((m,p)=>m.z-p.z),{tiles:u,holes:h}}descendantsOf(t){let o=new fe;for(let i of t)o.set(i.dataKey,i);let r=new fe;if(!o.size)return r;for(let[i,a]of this.cache.entries()){if(!this.drawable(a))continue;let s=a.id.parent();for(let l=0;s&&l<Ug;l++){let c=o.get(s.dataKey);if(c){let f=r.get(c.dataKey);f?f.push(a.id):r.set(c.dataKey,[a.id]);break}s=s.parent();}}return r}anyReady(t){for(let o of t)if(this.drawable(this.cache.peek(o.dataKey)))return true;return t.length===0}readyFor(t){for(let o of t)if(!this.drawable(this.cache.peek(o.dataKey)))return false;return true}covers(t){let o=new Le;for(let r of this.visible)o.add(r.dataKey);for(let r of t){if(o.has(r.dataKey))continue;let i=r.parent(),a=false;for(let s=0;i&&s<4;s++){if(o.has(i.dataKey)){a=true;break}i=i.parent();}if(!a)for(let s of this.visible){let l=s.parent();for(let c=0;l&&c<4;c++){if(l.dataKey===r.dataKey){a=true;break}l=l.parent();}if(a)break}if(!a)return false}return true}deactivate(){for(let[t,o]of this.cache.entries())o.state==="loading"&&(this.pool.abort(o.requestId),this.cache.delete(t));this.visible=[],this.holes=[];}loadTile(t,o=0){let r=new Ni(t);this.cache.set(t.dataKey,r);let i=this.opts.url.replace("{z}",String(t.z)).replace("{x}",String(t.x)).replace("{y}",String(t.y)),a=this.transform?.(i,"tile")??i,s=Zh(a);if(s){let c=new AbortController;this.protocolAborts.set(t.dataKey,c),s.handler(a,c.signal).then(f=>{if(this.protocolAborts.delete(t.dataKey),this.cache.peek(t.dataKey)!==r)return;if(!f){r.state="empty",this.emit("data",{tile:r});return}let u=un(new Ut(f),{zoom:t.z,metersPerTile:fr(t.z,t.y),tile:{z:t.z,x:t.x,y:t.y},sourceMaxZoom:this.opts.maxzoom,plan:this.opts.plan});this.acceptTile(r,{type:"loaded",id:0,raw:f,buckets:u.buckets,...u.seams.length?{seams:u.seams}:{},...u.levels.length?{levels:u.levels}:{},timing:{fetchMs:0,parseMs:0},diag:{status:200,bytes:f.byteLength,layers:[],built:Object.keys(u.buckets).length}});}).catch(f=>{this.protocolAborts.delete(t.dataKey),this.cache.peek(t.dataKey)===r&&this.failTile(r,f instanceof Error?f.message:String(f));});return}let l=Jg(a);r.requestId=this.pool.load({url:l,zoom:t.z,metersPerTile:fr(t.z,t.y),tile:{z:t.z,x:t.x,y:t.y},sourceMaxZoom:this.opts.maxzoom,plan:this.opts.plan},c=>{if(this.cache.peek(t.dataKey)===r){if(c.type==="error"){if(c.aborted)return;this.failTile(r,c.message);}else r.data=c,r.bytesHeld=qh(c),r.state=Object.keys(c.buckets).length?"loaded":"empty",this.version++,c.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 ${c.diag.failed.join("; ")}`),this.emit("data",{tile:r});this.pendingCount===0&&this.emit("idle",void 0);}},o);}findReadyAncestor(t,o=5){let r=t.parent();for(let 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 Jg(n){if(typeof location>"u")return n;try{return new URL(n,location.href).href}catch{return n}}var Vi=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;}},hn=class extends yt{constructor(t){super();this.visible=[];this.aborts=new Map;this.transform=null;this.opts={cacheSize:128,detailBias:1,maxTiles:256,...t},this.cache=new fo(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=qt(t,this.opts);let o=new Le;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();}setLodParams(t){t.detailBias!==void 0&&(this.opts.detailBias=t.detailBias),t.maxTiles!==void 0&&(this.opts.maxTiles=t.maxTiles);}setTransformRequest(t){this.transform=t;}loadTile(t){let o=new Vi(t);this.cache.set(t.dataKey,o);let r=new AbortController;this.aborts.set(t.dataKey,r);let i=Ui(this.opts.url,t);this.fetchImage(this.transform?.(i,"raster")??i,r.signal).then(a=>{if(this.aborts.delete(t.dataKey),this.cache.peek(t.dataKey)!==o){a.close();return}o.image=a,o.state="loaded",this.emit("data",{tile:o});}).catch(a=>{this.aborts.delete(t.dataKey),!r.signal.aborted&&this.cache.peek(t.dataKey)===o&&(o.state="error",o.error=a instanceof Error?a.message:String(a),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 Ui(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 Ki=class{constructor(e){this.id=e;this.state="loading";this.image=null;this.dem=null;this.error=null;this.texture=null;}destroy(){this.texture?.destroy(),this.texture=null,this.image?.close(),this.image=null,this.dem=null;}},dn=class extends yt{constructor(t){super();this.visible=[];this.aborts=new Map;this.opts={cacheSize:128,detailBias:2,maxTiles:64,encoding:"mapbox",...t},this.cache=new fo(this.opts.cacheSize,(o,r)=>{this.aborts.get(o)?.abort(),this.aborts.delete(o),r.destroy();});}get encoding(){return this.opts.encoding}get visibleTiles(){return this.visible}getTile(t){return this.cache.peek(t.dataKey)}update(t){this.visible=qt(t,this.opts);let o=new Le;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);}heights(t){if(t.dem)return t.dem;if(!t.image)return null;let o=jg(t.image);if(!o)return null;try{t.dem=new jr(o,t.image.width,this.opts.encoding);}catch(r){t.dem=null,console.warn("[osmgl] \u0442\u0430\u0439\u043B \u0440\u0435\u043B\u044C\u0435\u0444\u0430 \u043D\u0435 \u0440\u0430\u0437\u043E\u0431\u0440\u0430\u043B\u0441\u044F:",r instanceof Error?r.message:r);}return t.dem}destroy(){for(let t of this.aborts.values())t.abort();this.aborts.clear(),this.cache.clear(),this.removeAllListeners();}loadTile(t){let o=new Ki(t);this.cache.set(t.dataKey,o);let r=new AbortController;this.aborts.set(t.dataKey,r),this.fetchImage(Ui(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 \u0440\u0435\u043B\u044C\u0435\u0444\u0430 ${r.status} ${r.statusText}`);return createImageBitmap(await r.blob(),{premultiplyAlpha:"none",colorSpaceConversion:"none"})}};function jg(n){if(typeof OffscreenCanvas>"u"&&typeof document>"u")return null;let{width:e,height:t}=n,r=(typeof OffscreenCanvas<"u"?new OffscreenCanvas(e,t):Object.assign(document.createElement("canvas"),{width:e,height:t})).getContext("2d");return r?(r.drawImage(n,0,0),r.getImageData(0,0,e,t).data):null}var mn=class extends yt{constructor(t){super();this.options=t;this.content=null;this.corners=[];this.version=0;this.video=null;this.kind=t.kind,this.animate=t.animate??t.kind!=="image",this.setCoordinates(t.coordinates),this.load();}get live(){return this.kind==="video"?!!this.video&&!this.video.paused&&!this.video.ended:this.kind==="canvas"&&this.animate}setCoordinates(t){return this.corners=t.map(o=>{let r=Pe(o);return [Oe(r.lng),Ge(r.lat)]}),this.version++,this.emit("data",{source:this}),this}getCoordinates(){return this.options.coordinates}async updateImage(t){return t.coordinates&&this.setCoordinates(t.coordinates),t.url&&(this.options.url=t.url,await this.load()),this}getVideo(){return this.video}play(){this.video?.play();}pause(){this.video?.pause();}setAnimate(t){this.animate=t;}destroy(){this.video?.pause(),this.video=null,this.content=null;}async load(){try{if(this.kind==="canvas"){let t=typeof this.options.canvas=="string"?document.getElementById(this.options.canvas):this.options.canvas??null;if(!t)throw new Error("canvas \u043D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D");this.content=t;}else if(this.kind==="video"){let t=document.createElement("video");t.crossOrigin="anonymous",t.loop=!0,t.muted=!0,t.playsInline=!0;let o=Array.isArray(this.options.url)?this.options.url:[this.options.url??""];for(let r of o){let i=document.createElement("source");i.src=r,t.appendChild(i);}await new Promise((r,i)=>{t.onloadeddata=()=>r(),t.onerror=()=>i(new Error("\u0432\u0438\u0434\u0435\u043E \u043D\u0435 \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u043B\u043E\u0441\u044C")),t.load();}),this.video=t,this.content=t,t.play();}else {let t=Array.isArray(this.options.url)?this.options.url[0]:this.options.url;if(!t)throw new Error("\u043D\u0435 \u0437\u0430\u0434\u0430\u043D \u0430\u0434\u0440\u0435\u0441 \u043A\u0430\u0440\u0442\u0438\u043D\u043A\u0438");let o=new Image;o.crossOrigin="anonymous",await new Promise((r,i)=>{o.onload=()=>r(),o.onerror=()=>i(new Error(`\u043A\u0430\u0440\u0442\u0438\u043D\u043A\u0430 ${t} \u043D\u0435 \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u043B\u0430\u0441\u044C`)),o.src=t;}),this.content=o;}this.version++,this.emit("data",{source:this});}catch(t){this.emit("error",{message:t instanceof Error?t.message:String(t)});}}};var pn=4096,bn=class extends ir{constructor(t,o={}){super(t,{...o,url:"",plan:o.plan??[],minzoom:o.minzoom??0,maxzoom:o.maxzoom??18});this.features=[];this.clusters=new Map;this.layerName=o.sourceLayer??"geojson",this.bufferUnits=o.buffer??pn/32,this.clusterOn=o.cluster??false,this.clusterRadiusPx=o.clusterRadius??50,this.clusterTopZoom=o.clusterMaxZoom??(o.maxzoom??18)-1,o.data&&this.setData(o.data);}async setData(t){let o=typeof t=="string"?await(await fetch(t)).json():t;this.features=Zg(o),this.clusters.clear(),this.invalidate();}get featureCount(){return this.features.length}loadTile(t){let o=this.newTile(t),r=this.clusterOn&&t.z<=this.clusterTopZoom?this.clustersFor(t.z):this.features,i=qg(r,t,this.bufferUnits);try{let a=un({layers:{[this.layerName]:i}},{zoom:t.z,metersPerTile:fr(t.z,t.y),tile:{z:t.z,x:t.x,y:t.y},sourceMaxZoom:this.maxzoom,plan:this.plan});this.acceptTile(o,{type:"loaded",id:0,buckets:a.buckets,...a.seams.length?{seams:a.seams}:{},...a.levels.length?{levels:a.levels}:{},timing:{fetchMs:0,parseMs:0},diag:{status:200,bytes:0,layers:[this.layerName],built:Object.keys(a.buckets).length}});}catch(a){this.failTile(o,a instanceof Error?a.message:String(a));}}clustersFor(t){let o=this.clusters.get(t);if(o)return o;let r=this.clusterRadiusPx/(512*Math.pow(2,t)),i=new Map,a=[];for(let l of this.features){if(l.type!==1){a.push(l);continue}let c=l.rings[0][0],f=l.rings[0][1],u=`${Math.floor(c/r)}\u241F${Math.floor(f/r)}`,h=i.get(u);h?(h.x+=c,h.y+=f,h.count++):i.set(u,{x:c,y:f,count:1,first:l});}let s=0;for(let l of i.values()){if(l.count===1){a.push(l.first);continue}let c=l.x/l.count,f=l.y/l.count;a.push({id:++s,type:1,properties:{cluster:true,cluster_id:s,point_count:l.count,point_count_abbreviated:Yg(l.count)},rings:[[c,f]],minX:c,minY:f,maxX:c,maxY:f});}return this.clusters.set(t,a),a}};function Yg(n){return n<1e3?String(n):n<1e4?`${Math.round(n/100)/10}k`:n<1e6?`${Math.round(n/1e3)}k`:`${Math.round(n/1e5)/10}M`}function Zg(n){let e=n.type==="FeatureCollection"?n.features:[n],t=[],o=0;for(let r of e){let i=r.geometry;if(!i)continue;let a=Number(r.id??++o),s={...r.properties??{}},l=(c,f)=>{let u=f.map(b=>{let g=[];for(let[y,A]of b)g.push(Oe(y),Ge(A));return g}).filter(b=>b.length>=2);if(!u.length)return;let h=1/0,d=1/0,m=-1/0,p=-1/0;for(let b of u)for(let g=0;g<b.length;g+=2)h=Math.min(h,b[g]),m=Math.max(m,b[g]),d=Math.min(d,b[g+1]),p=Math.max(p,b[g+1]);t.push({id:a,type:c,properties:s,rings:u,minX:h,minY:d,maxX:m,maxY:p});};switch(i.type){case "Point":l(1,[[i.coordinates]]);break;case "MultiPoint":l(1,[i.coordinates]);break;case "LineString":l(2,[i.coordinates]);break;case "MultiLineString":l(2,i.coordinates);break;case "Polygon":l(3,i.coordinates);break;case "MultiPolygon":for(let c of i.coordinates)l(3,c);break}}return t}function qg(n,e,t){let o=1<<e.z,r=t/pn/o,i=e.x/o-r,a=(e.x+1)/o+r,s=e.y/o-r,l=(e.y+1)/o+r,c=[];for(let f of n){if(f.maxX<i||f.minX>a||f.maxY<s||f.minY>l)continue;let u=[];for(let h of f.rings){let d=f.type===3?ey(h,i,s,a,l):f.type===2?ty(h,i,s,a,l):[h];for(let m of d){let p=[];for(let b=0;b<m.length;b+=2)p.push((m[b]*o-e.x)*pn,(m[b+1]*o-e.y)*pn);p.length>=2&&u.push(p);}}if(u.length){if(f.type===3)for(let h=0;h<u.length;h++){let d=Qg(u[h]),m=Fa(d),p=h===0;u[h]=m>0===p?d:$g(d);}c.push({id:f.id,type:f.type,properties:f.properties,rings:u});}}return {name:"geojson",extent:pn,length:c.length,*features(){for(let f of c)yield {id:f.id,type:f.type,properties:f.properties,loadGeometry:()=>f.rings};}}}function Qg(n){let e=n.length;return e>=4&&n[0]===n[e-2]&&n[1]===n[e-1]?n:[...n,n[0],n[1]]}function $g(n){let e=[];for(let t=n.length-2;t>=0;t-=2)e.push(n[t],n[t+1]);return e}function ey(n,e,t,o,r){let i=n,a=[[s=>s>=e,(s,l,c,f)=>Xi(s,l,c,f,(e-s)/(c-s))],[s=>s<=o,(s,l,c,f)=>Xi(s,l,c,f,(o-s)/(c-s))],[(s,l)=>l>=t,(s,l,c,f)=>Xi(s,l,c,f,(t-l)/(f-l))],[(s,l)=>l<=r,(s,l,c,f)=>Xi(s,l,c,f,(r-l)/(f-l))]];for(let[s,l]of a){let c=[];for(let f=0;f<i.length;f+=2){let u=i[f],h=i[f+1],d=(f+2)%i.length,m=i[d],p=i[d+1],b=s(u,h),g=s(m,p);if(b&&c.push(u,h),b!==g){let[y,A]=l(u,h,m,p);c.push(y,A);}}if(i=c,i.length<6)return []}return [i]}function Xi(n,e,t,o,r){let i=Number.isFinite(r)?Math.min(Math.max(r,0),1):0;return [n+(t-n)*i,e+(o-e)*i]}function ty(n,e,t,o,r){let i=[],a=[],s=(l,c)=>l>=e&&l<=o&&c>=t&&c<=r;for(let l=0;l+3<n.length;l+=2){let c=n[l],f=n[l+1],u=n[l+2],h=n[l+3],d=s(c,f),m=s(u,h);if(d&&m){a.length||a.push(c,f),a.push(u,h);continue}let p=oy(c,f,u,h,e,t,o,r);if(!p){a.length>=4&&i.push(a),a=[];continue}a.length||a.push(p[0],p[1]),a.push(p[2],p[3]),m||(a.length>=4&&i.push(a),a=[]);}return a.length>=4&&i.push(a),i}function oy(n,e,t,o,r,i,a,s){let l=0,c=1,f=t-n,u=o-e;for(let h=0;h<4;h++){let d=h===0?-f:h===1?f:h===2?-u:u,m=h===0?n-r:h===1?a-n:h===2?e-i:s-e;if(d===0){if(m<0)return null;continue}let p=m/d;if(d<0){if(p>c)return null;p>l&&(l=p);}else {if(p<l)return null;p<c&&(c=p);}}return [n+f*l,e+u*l,n+f*c,e+u*c]}var ry="osmgl-assets",ar="assets";var Ji=null;function ed(){return Ji||(Ji=new Promise(n=>{if(typeof indexedDB>"u")return n(null);try{let e=indexedDB.open(ry,1);e.onupgradeneeded=()=>{let t=e.result;t.objectStoreNames.contains(ar)||t.createObjectStore(ar,{keyPath:"key"});},e.onsuccess=()=>n(e.result),e.onerror=()=>n(null);}catch{n(null);}}),Ji)}function ny(n){return ed().then(e=>new Promise(t=>{if(!e)return t(null);try{let o=e.transaction(ar,"readonly").objectStore(ar).get(n);o.onsuccess=()=>t(o.result??null),o.onerror=()=>t(null);}catch{t(null);}}))}function iy(n){ed().then(e=>{if(e)try{e.transaction(ar,"readwrite").objectStore(ar).put(n);}catch{}});}var $h=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 ay(n,e,t){let o=await crypto.subtle.importKey("raw",$h(e),"AES-GCM",false,["decrypt"]);return crypto.subtle.decrypt({name:"AES-GCM",iv:$h(t),tagLength:128},o,n)}var gn=class{constructor(e){this.keys=new Map;this.variants=null;this.inflight=new Map;this.endpoint=e.endpoint.replace(/\/+$/,""),this.apiKey=e.apiKey??null;}withKey(e){return this.apiKey?e+(e.includes("?")?"&":"?")+"key="+encodeURIComponent(this.apiKey):e}loadVariants(){return this.variants??(this.variants=fetch(this.withKey(`${this.endpoint}/variants`),{credentials:"same-origin"}).then(e=>e.ok?e.json():{}).catch(()=>({}))),this.variants}async resolve(e,t){return t?(await this.loadVariants())[String(e)]?.[t]??e:e}async load(e,t,o="",r){let i=await this.resolve(e,o),a=`${i}:${t}`,s=this.inflight.get(a);if(s)return s;let l=this.fetchAsset(a,i,t,r).finally(()=>this.inflight.delete(a));return this.inflight.set(a,l),l}async fetchAsset(e,t,o,r){let i,a,s=await ny(e);if(s)i=s.bytes,a=s.encrypted;else {let c=await fetch(this.withKey(`${this.endpoint}/files/${t}/data?lod=${o}`),{signal:r,credentials:"same-origin"});if(!c.ok)throw new Error(`data ${c.status}`);a=(c.headers.get("X-Enc")??"none")!=="none",i=await c.arrayBuffer(),iy({key:e,bytes:i,encrypted:a,savedAt:Date.now()});}if(!a)return i;let l=await this.getKey(t,r);if(!l)throw new Error("\u043D\u0435\u0442 \u043A\u043B\u044E\u0447\u0430 \u0440\u0430\u0441\u0448\u0438\u0444\u0440\u043E\u0432\u043A\u0438");return ay(i,l.key,l.iv)}getKey(e,t){let o=this.keys.get(e);if(o)return o;let r=(async()=>{let i=await fetch(this.withKey(`${this.endpoint}/files/${e}/key`),{signal:t,credentials:"same-origin"});if(!i.ok)return null;let a=await i.json();return a.encrypted&&a.key&&a.iv?{key:a.key,iv:a.iv}:null})();return r.catch(()=>this.keys.delete(e)),this.keys.set(e,r),r}};var sy=1,yn=class{constructor(e){this.groundZ=0;this.mesh=null;this.bitmaps=[];this.error=null;this.loading=null;this.matrix=Fe();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-${sy++}`,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 Rs(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=Pe(this.coordinates);return {x:Oe(e.lng),y:Ge(e.lat)}}localMatrix(e){let t=this.effectiveScale(),o=t/Mt(e),r=[o,0,0,0,0,t*this.grow,0,o,0],i=c=>c*Math.PI/180,a=Qs(i(-this.rotation));this.rotationTiltX&&(a=uo(qs(i(this.rotationTiltX)),a)),this.rotationTiltZ&&(a=uo($s(i(this.rotationTiltZ)),a));let s=uo(r,a),l=this.matrix;return Wt(l),l[0]=s[0],l[1]=s[1],l[2]=s[2],l[4]=s[3],l[5]=s[4],l[6]=s[5],l[8]=s[6],l[9]=s[7],l[10]=s[8],l[15]=1,l}matrixInSpace(e,t){let o=Pe(this.coordinates),r=Fe();for(let a=0;a<16;a++)r[a]=e[a];let i=Fe();return at(i,r,this.localMatrix(o.lat)),Nt(t??this.matrix32,i)}cameraInModelSpace(e){let t=this.effectiveScale();if(!(t>0))return [0,0,0];let o=this.origin(),r=Pe(this.coordinates),i=Mt(r.lat),a=e.worldSize,s=e.cameraPositionPx,l=(s[0]/a-o.x)*i,c=(s[1]/a-o.y)*i,f=s[2]/e.pixelsPerMeter-(this.altitude+this.groundZ),u=l,h=f,d=c,m=b=>b*Math.PI/180,p=Qs(m(-this.rotation));return this.rotationTiltX&&(p=uo(qs(m(this.rotationTiltX)),p)),this.rotationTiltZ&&(p=uo($s(m(this.rotationTiltZ)),p)),[(p[0]*u+p[1]*h+p[2]*d)/t,(p[3]*u+p[4]*h+p[5]*d)/t,(p[6]*u+p[7]*h+p[8]*d)/t]}matrixFor(e){let t=this.origin();return this.matrixInSpace(e.objectMatrix(t.x,t.y,this.altitude+this.groundZ))}coversPoint(e,t){let o=this.mesh;if(!o)return false;let r=this.origin(),i=e-r.x,a=t-r.y,s=Pe(this.coordinates),l=this.localMatrix(s.lat),c=l[0],f=l[1],u=l[8],h=l[9],d=c*h-f*u;if(Math.abs(d)<1e-30)return false;let m=(i*h-a*u)/d,p=(c*a-f*i)/d,b=1.05,g=(o.min[0]+o.max[0])/2,y=(o.min[2]+o.max[2])/2,A=(o.max[0]-o.min[0])/2*b,x=(o.max[2]-o.min[2])/2*b;return Math.abs(m-g)<=A&&Math.abs(p-y)<=x}get isAnimated(){return this.mesh?.animation!=null}matrixForNode(e,t,o){let r=this.origin();return this.matrixInSpaceForNode(e.objectMatrix(r.x,r.y,this.altitude+this.groundZ),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=Fe();for(let u=0;u<16;u++)a[u]=e[u];let s=Pe(this.coordinates),l=Fe();at(l,a,this.localMatrix(s.lat));let c=Fe();Ps(i,t,i.duration>0?o%i.duration:0,c);let f=Fe();return at(f,l,c),Nt(r,f)}normalMatrix(){let e=i=>i*Math.PI/180,t=Qs(e(-this.rotation));this.rotationTiltX&&(t=uo(qs(e(this.rotationTiltX)),t)),this.rotationTiltZ&&(t=uo($s(e(this.rotationTiltZ)),t));let o=uo([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 uo(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 qs=n=>{let e=Math.cos(n),t=Math.sin(n);return [1,0,0,0,e,t,0,-t,e]},Qs=n=>{let e=Math.cos(n),t=Math.sin(n);return [e,0,-t,0,1,0,t,0,e]},$s=n=>{let e=Math.cos(n),t=Math.sin(n);return [e,t,0,-t,e,0,0,0,1]};var Yi=class{constructor(){this.hit=new fe;this.miss=new Le;this.stamp="";}find(e,t){if(!t)return null;let o=this.hit.get(e.id);if(o!==void 0)return o;let r=t.source.visibleTiles.map(i=>i.dataKey).join(",");if(r!==this.stamp&&(this.stamp=r,this.miss.clear()),this.miss.has(e.id))return null;for(let i of t.source.visibleTiles){let a=t.source.getTile(i)?.data?.buckets?.[t.key];if(!a||a.kind!=="fill-extrusion"||!a.featureIds)continue;let s=i.bounds();if(e.mercX<s.minX||e.mercX>s.maxX||e.mercY<s.minY||e.mercY>s.maxY)continue;let l=(e.mercX-s.minX)/(s.maxX-s.minX)*a.extent,c=(e.mercY-s.minY)/(s.maxY-s.minY)*a.extent,f=new Int16Array(a.vertices),u=new Uint32Array(a.indices),h=new Float64Array(a.featureIds),d=f.length/a.vertexCount;for(let m=0;m*3+2<u.length;m++){let p=u[m*3]*d,b=u[m*3+1]*d,g=u[m*3+2]*d;if(!my(l,c,f[p],f[p+1],f[b],f[b+1],f[g],f[g+1]))continue;let y=h[m];return this.hit.set(e.id,y),y}}return this.miss.add(e.id),null}clear(){this.hit.clear(),this.miss.clear(),this.stamp="";}},ly=14,cy=2e3,fy=4e3,td=160,uy=50,hy=4e3,el=6,Zi=class{constructor(e){this.wantKey="";this.modelKey="";this.entries=new fe;this.loading=0;this.pending=[];this.known=new fe;this.underBuilding=new Yi;this.underVenue=new Yi;this.tilesStamp="";this.rulesInScan=0;this.found=[];this.foundStamp="";this.sortedAt=null;this.budgetScale=1;this.addModel=null;this.lod=0;this.budget=td;this.replacedBuildings=new Le;this.replacedReal=new Le;this.replacedVenues=new Le;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 gn(e);}get models(){let e=[];for(let t of this.entries.values())e.push(t.model);return e}update(e,t,o,r,i,a,s){this.wantKey!==this.modelKey&&(this.modelKey=this.wantKey,this.clear(i));let l=e.layout??{},c=l.minZoom??ly,f=l.loadRadius??cy,u=Math.max(l.keepRadius??fy,f),h=l.fullBudget===true?1:Math.min(1,Math.max(.25,(o.zoom-c)/3)),d=Math.max(8,Math.round((l.budget??td)*this.budgetScale*h));this.budget=d,this.addModel=r;let m=l.maskReplaced!==false,p=performance.now();if(o.zoom<c){for(let L of [...this.entries.values()])L.model.retire(),L.model.grow<=0&&this.release(L,i);this.replacedBuildings.clear(),this.replacedReal.clear(),this.replacedVenues.clear();return}let b=o.center,g=l.fullDetail===true?0:this.lodFor(o.zoom,c);this.lod=g;let y="";for(let L of t.visibleTiles)y+=L.dataKey+(t.getTile(L)?.data?"+":"-");let A=this.rulesInScan;if(y!==this.tilesStamp){this.tilesStamp=y;let L=new Le;A=0;for(let X of t.visibleTiles){let Q=t.getTile(X)?.data?.buckets?.[e.id];if(!Q||!Zu(Q))continue;let G=new Int16Array(Q.anchors),Y=X.bounds(),ie=Y.maxX-Y.minX,ee=Y.maxY-Y.minY;for(let ue=0;ue<Q.props.length;ue++){let $=Q.props[ue],Ae=_o($.file,NaN);if(!Number.isFinite(Ae))continue;let ve=String($.kind??"model"),he=ve==="rule"?`t-${$.rid}-${$.oid}`:`m-${$.mid}`;if(L.has(he))continue;L.add(he),ve==="rule"&&A++;let xe=Y.minX+G[ue*2]/Q.extent*ie,de=Y.minY+G[ue*2+1]/Q.extent*ee,we=dy(xe,de);this.known.set(he,{id:he,fileId:Ae,lng:we.lng,lat:we.lat,mercX:xe,mercY:de,altitude:_o($.alt,0),scale:_o($.scale,1),rotation:_o($.rx,0),tiltX:_o($.rz,0),tiltZ:_o($.ry,0),kind:ve==="rule"?"rule":"model",target:od(ve==="rule"?$.oid:$.replaces),replaces:m?ve==="rule"?ji($.oid):String($.anchor??"replace")==="replace"?ji($.replaces_all).length?ji($.replaces_all):ji($.replaces):[]:[]});}}this.rulesInScan=A;}y!==this.foundStamp&&(this.foundStamp=y,this.found=[...this.known.values()],this.sortedAt=null);let x=this.found,v=new Le;for(let L of x)L.kind==="model"&&L.target!==null&&v.add(L.target);let w=111320,C=Math.cos(b.lat*Math.PI/180),B=L=>Math.hypot((L.lng-b.lng)*w*C,(L.lat-b.lat)*w);this.replacedBuildings.clear(),this.replacedReal.clear(),this.replacedVenues.clear();let _=new Le,T=[],k=0,K=0;(this.sortedAt===null||Math.hypot((b.lng-this.sortedAt.lng)*w*C,(b.lat-this.sortedAt.lat)*w)>uy)&&(x.sort((L,X)=>B(L)-B(X)),this.sortedAt={lng:b.lng,lat:b.lat});let W=0;for(let L of x){let X=B(L);if(X>u){k++;continue}if(L.kind==="rule"&&L.target!==null&&v.has(L.target)){let ie=this.entries.get(L.id);ie&&ie.model.retire();continue}let Q=this.entries.get(L.id);if(W>=d){K++,Q&&Q.model.retire();continue}W++,_.add(L.id);let G=()=>{if(!L.replaces.length)return;for(let ue of L.replaces){this.replacedBuildings.add(ue),this.replacedReal.add(ue);for(let $=0;$<10;$++)this.replacedBuildings.add(ue*10+$);}let ie=this.underBuilding.find(L,a);ie!==null&&this.replacedBuildings.add(ie);let ee=this.underVenue.find(L,s);ee!==null&&this.replacedVenues.add(ee);},Y=Q;if(Y){G(),Y.distance=X,Y.leftAt=0,Y.model.revive(),g<Y.lod&&!Y.upgrading&&this.loading<el&&this.upgrade(Y,g,r,i);continue}if(X>f){k++;continue}if(this.loading>=el){T.push(L),G();continue}G(),this.spawn(L,X,g,r);}for(let L of [...this.entries.values()])if(!_.has(L.placement.id)){if(L.leftAt===0){L.leftAt=p;continue}p-L.leftAt>hy&&L.model.retire();}for(let L of [...this.entries.values()])L.model.growTarget===0&&L.model.grow<=0&&this.release(L,i);if(this.known.size>4e3)for(let[L,X]of [...this.known.entries()])B(X)>u*3&&this.known.delete(L);let z=this.stats;z.found=x.length,z.kept=_.size,z.live=this.entries.size,z.tooFar=k,z.overBudget=K,z.queued=T.length,z.rules=A,z.loadingNow=this.loading,z.pendingNow=T.length,z.replaced=this.replacedReal.size,this.pending=T;}pump(){let e=this.addModel;if(this.stats.loadingNow=this.loading,this.stats.pendingNow=this.pending.length,!!e)for(;this.pending.length&&this.loading<el&&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 yn({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.replacedReal.clear(),this.replacedVenues.clear(),this.underBuilding.clear(),this.underVenue.clear();for(let t of Object.keys(this.stats))this.stats[t]=0;}},_o=(n,e)=>{let t=typeof n=="number"?n:Number(n);return Number.isFinite(t)?t:e},ji=n=>{if(n==null)return [];let e=[];for(let t of String(n).split(",")){let o=Number(t);Number.isFinite(o)&&o!==0&&e.push(o);}return e},od=n=>{let e=_o(n,NaN);return Number.isFinite(e)?e:null};function dy(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 my(n,e,t,o,r,i,a,s){let l=(n-r)*(o-i)-(t-r)*(e-i),c=(n-a)*(i-s)-(r-a)*(e-s),f=(n-t)*(s-o)-(a-t)*(e-o),u=l<0||c<0||f<0,h=l>0||c>0||f>0;return !(u&&h)}function py(n,e,t){return nd(n)?.get(e)?.get(t)??{}}var qi=new WeakMap;function nd(n){let e=qi.get(n);if(e!==void 0)return e;let t=n.raw;if(!t)return qi.set(n,null),null;let o=new Map;try{let r=new Ut(t);for(let[i,a]of Object.entries(r.layers)){let s=new Map;for(let l of a.features()){let c=l.properties.osm_id,f=Number(c??l.id??-1);f>=0&&s.set(f,{...l.properties});}o.set(i,s);}}catch{return qi.set(n,null),null}return qi.set(n,o),o}function by(n,e){return Array.isArray(n)?{x1:Math.min(n[0].x,n[1].x)-e,y1:Math.min(n[0].y,n[1].y)-e,x2:Math.max(n[0].x,n[1].x)+e,y2:Math.max(n[0].y,n[1].y)+e}:{x1:n.x-e,y1:n.y-e,x2:n.x+e,y2:n.y+e}}function tl(n,e,t,o,r,i){let a=r.tolerance??4,s=by(o,a),l=r.layers&&r.layers.length?new Set(r.layers):null,c=[],f=new Set;for(let u of t){if(l&&!l.has(u.id)||u.type==="raster"||u.visible===false)continue;let h=e.get(u.source??"base");if(!h)continue;let d="source-layer"in u?u["source-layer"]:"";for(let m of h.visibleTiles){let p=h.getTile(m);if(p?.data)for(let[b,g]of Object.entries(p.data.buckets)){if(b!==u.id&&!b.startsWith(u.id+"\u241F")||!("extent"in g)||!("kind"in g))continue;let y=Ay(n,m,g.extent,s);if(!y)continue;let A=gy(g,y);for(let x of A){let v=`${u.id}\u241F${x}`;f.has(v)||(f.add(v),c.push({id:x,source:u.source??"base",sourceLayer:d,layer:u.id,properties:py(p,d,x),state:i(u.source??"base",d,x),tile:m}));}}}}return c.reverse()}function gy(n,e){return n.kind==="surface"?yy(n,e):n.featureIds?n.kind==="line"?xy(n,e):n.kind==="fill-extrusion"?rd(n,e,(t,o)=>[t.getInt16(o*rt,true)/Xt,t.getInt16(o*rt+2,true)/Xt]):n.kind==="fill"?rd(n,e,(t,o)=>[t.getInt16(o*Ft,true),t.getInt16(o*Ft+2,true)]):[]:[]}function yy(n,e){if(!n.shapeRanges||!n.shapeFeatures)return [];let t=new DataView(n.vertices),o=new Uint32Array(n.indices),r=new Uint32Array(n.shapeRanges),i=new Float64Array(n.shapeFeatures),a=(e.x1+e.x2)/2,s=(e.y1+e.y2)/2,l=f=>[t.getFloat32(f*Jt,true),t.getFloat32(f*Jt+4,true)],c=new Set;for(let f=0;f*4+1<r.length;f++){let u=r[f*4],h=r[f*4+1],d=false;for(let b=u;b+2<h&&!d;b+=3){let[g,y]=l(o[b]),[A,x]=l(o[b+1]),[v,w]=l(o[b+2]);if(Math.max(g,A,v)<e.x1||Math.min(g,A,v)>e.x2||Math.max(y,x,w)<e.y1||Math.min(y,x,w)>e.y2)continue;let C=(a-A)*(y-x)-(g-A)*(s-x),B=(a-v)*(x-w)-(A-v)*(s-w),_=(a-g)*(w-y)-(v-g)*(s-y),T=C<0||B<0||_<0,k=C>0||B>0||_>0;d=!(T&&k);}if(!d)continue;let m=0;for(let b=0;b<f&&m<i.length;b++)m+=1+i[m];if(m>=i.length)break;let p=i[m];for(let b=0;b<p;b++)c.add(i[m+1+b]);}return [...c]}function Ay(n,e,t,o){let r=[{x:o.x1,y:o.y1},{x:o.x2,y:o.y1},{x:o.x1,y:o.y2},{x:o.x2,y:o.y2}],i=1<<e.z,a=1/0,s=1/0,l=-1/0,c=-1/0;for(let u of r){let h=n.pointToWorldPx(u),d=(h.x/n.worldSize*i-e.x)*t,m=(h.y/n.worldSize*i-e.y)*t;a=Math.min(a,d),l=Math.max(l,d),s=Math.min(s,m),c=Math.max(c,m);}let f=t/4;return l<-f||c<-f||a>t+f||s>t+f?null:{x1:a,y1:s,x2:l,y2:c}}function rd(n,e,t){let o=new DataView(n.vertices),r=new Uint32Array(n.indices),i=new Float64Array(n.featureIds),a=new Set,s=(e.x1+e.x2)/2,l=(e.y1+e.y2)/2;for(let c=0;c*3<r.length&&c<i.length;c++){let f=i[c];if(a.has(f))continue;let[u,h]=t(o,r[c*3]),[d,m]=t(o,r[c*3+1]),[p,b]=t(o,r[c*3+2]);if(Math.max(u,d,p)<e.x1||Math.min(u,d,p)>e.x2||Math.max(h,m,b)<e.y1||Math.min(h,m,b)>e.y2)continue;let g=(s-d)*(h-m)-(u-d)*(l-m),y=(s-p)*(m-b)-(d-p)*(l-b),A=(s-u)*(b-h)-(p-u)*(l-h),x=g<0||y<0||A<0,v=g>0||y>0||A>0;x&&v||a.add(f);}return [...a]}function xy(n,e){let t=new DataView(n.vertices),o=new Uint32Array(n.indices),r=new Float64Array(n.featureIds),i=new Set,a=(e.x1+e.x2)/2,s=(e.y1+e.y2)/2,l=Math.max(e.x2-e.x1,e.y2-e.y1)/2;for(let c=0;c*3<o.length&&c<r.length;c++){let f=r[c];if(i.has(f))continue;let u=o[c*3],h=t.getInt16(u*bt,true),d=t.getInt16(u*bt+2,true),m=t.getInt16(u*bt+4,true),p=t.getInt16(u*bt+6,true),b=m-h,g=p-d,y=b*b+g*g,A=y>0?Math.min(Math.max(((a-h)*b+(s-d)*g)/y,0),1):0,x=h+b*A,v=d+g*A;Math.hypot(a-x,s-v)<=l&&i.add(f);}return [...i]}function ol(n,e,t,o){let r=[],i=new Set;for(let a of n.visibleTiles){let s=n.getTile(a),l=s?nd(s):null;if(!(!s||!l)){for(let[c,f]of l)if(!(t.sourceLayer&&c!==t.sourceLayer))for(let[u,h]of f){if(t.filter&&!t.filter(h))continue;let d=`${c}\u241F${u}`;i.has(d)||(i.add(d),r.push({id:u,source:e,sourceLayer:c,layer:"",properties:h,state:o(e,c,u),tile:a}));}}}return r}var wy=200,vy={center:"translate(-50%, -50%)",top:"translate(-50%, 0)",bottom:"translate(-50%, -100%)",left:"translate(0, -50%)",right:"translate(-100%, -50%)"},An=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=vy[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??Cy),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=Pe(this._coordinates),o=e.worldSize,r=e.worldPxToPoint(Oe(t.lng)*o,Ge(t.lat)*o,this.altitude);if(!r){this.culled=true,this.applyVisibility();return}let i=wy;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";}},Cy='<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 xn=class extends An{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 rl='"use strict";(()=>{var fo=Object.create;var An=Object.defineProperty;var ho=Object.getOwnPropertyDescriptor;var mo=Object.getOwnPropertyNames;var po=Object.getPrototypeOf,bo=Object.prototype.hasOwnProperty;var go=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var xo=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of mo(t))!bo.call(e,o)&&o!==n&&An(e,o,{get:()=>t[o],enumerable:!(i=ho(t,o))||i.enumerable});return e};var yo=(e,t,n)=>(n=e!=null?fo(po(e)):{},xo(t||!e||!e.__esModule?An(n,"default",{value:e,enumerable:!0}):n,e));var Vr=go((dn,bn)=>{(function(e,t){typeof dn=="object"&&typeof bn<"u"?bn.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self,e.polygonClipping=t())})(dn,function(){"use strict";function e(M,a){var h={label:0,sent:function(){if(b[0]&1)throw b[1];return b[1]},trys:[],ops:[]},d,x,b,F;return F={next:R(0),throw:R(1),return:R(2)},typeof Symbol=="function"&&(F[Symbol.iterator]=function(){return this}),F;function R(k){return function(C){return I([k,C])}}function I(k){if(d)throw new TypeError("Generator is already executing.");for(;h;)try{if(d=1,x&&(b=k[0]&2?x.return:k[0]?x.throw||((b=x.return)&&b.call(x),0):x.next)&&!(b=b.call(x,k[1])).done)return b;switch(x=0,b&&(k=[k[0]&2,b.value]),k[0]){case 0:case 1:b=k;break;case 4:return h.label++,{value:k[1],done:!1};case 5:h.label++,x=k[1],k=[0];continue;case 7:k=h.ops.pop(),h.trys.pop();continue;default:if(b=h.trys,!(b=b.length>0&&b[b.length-1])&&(k[0]===6||k[0]===2)){h=0;continue}if(k[0]===3&&(!b||k[1]>b[0]&&k[1]<b[3])){h.label=k[1];break}if(k[0]===6&&h.label<b[1]){h.label=b[1],b=k;break}if(b&&h.label<b[2]){h.label=b[2],h.ops.push(k);break}b[2]&&h.ops.pop(),h.trys.pop();continue}k=a.call(M,h)}catch(C){k=[6,C],x=0}finally{d=b=0}if(k[0]&5)throw k[1];return{value:k[0]?k[1]:void 0,done:!0}}}var t=function(){function M(a,h){this.next=null,this.key=a,this.data=h,this.left=null,this.right=null}return M}();function n(M,a){return M>a?1:M<a?-1:0}function i(M,a,h){for(var d=new t(null,null),x=d,b=d;;){var F=h(M,a.key);if(F<0){if(a.left===null)break;if(h(M,a.left.key)<0){var R=a.left;if(a.left=R.right,R.right=a,a=R,a.left===null)break}b.left=a,b=a,a=a.left}else if(F>0){if(a.right===null)break;if(h(M,a.right.key)>0){var R=a.right;if(a.right=R.left,R.left=a,a=R,a.right===null)break}x.right=a,x=a,a=a.right}else break}return x.right=a.left,b.left=a.right,a.left=d.right,a.right=d.left,a}function o(M,a,h,d){var x=new t(M,a);if(h===null)return x.left=x.right=null,x;h=i(M,h,d);var b=d(M,h.key);return b<0?(x.left=h.left,x.right=h,h.left=null):b>=0&&(x.right=h.right,x.left=h,h.right=null),x}function r(M,a,h){var d=null,x=null;if(a){a=i(M,a,h);var b=h(a.key,M);b===0?(d=a.left,x=a.right):b<0?(x=a.right,a.right=null,d=a):(d=a.left,a.left=null,x=a)}return{left:d,right:x}}function s(M,a,h){return a===null?M:(M===null||(a=i(M.key,a,h),a.left=M),a)}function u(M,a,h,d,x){if(M){d(""+a+(h?"\\u2514\\u2500\\u2500 ":"\\u251C\\u2500\\u2500 ")+x(M)+`\n`);var b=a+(h?" ":"\\u2502 ");M.left&&u(M.left,b,!1,d,x),M.right&&u(M.right,b,!0,d,x)}}var l=function(){function M(a){a===void 0&&(a=n),this._root=null,this._size=0,this._comparator=a}return M.prototype.insert=function(a,h){return this._size++,this._root=o(a,h,this._root,this._comparator)},M.prototype.add=function(a,h){var d=new t(a,h);this._root===null&&(d.left=d.right=null,this._size++,this._root=d);var x=this._comparator,b=i(a,this._root,x),F=x(a,b.key);return F===0?this._root=b:(F<0?(d.left=b.left,d.right=b,b.left=null):F>0&&(d.right=b.right,d.left=b,b.right=null),this._size++,this._root=d),this._root},M.prototype.remove=function(a){this._root=this._remove(a,this._root,this._comparator)},M.prototype._remove=function(a,h,d){var x;if(h===null)return null;h=i(a,h,d);var b=d(a,h.key);return b===0?(h.left===null?x=h.right:(x=i(a,h.left,d),x.right=h.right),this._size--,x):h},M.prototype.pop=function(){var a=this._root;if(a){for(;a.left;)a=a.left;return this._root=i(a.key,this._root,this._comparator),this._root=this._remove(a.key,this._root,this._comparator),{key:a.key,data:a.data}}return null},M.prototype.findStatic=function(a){for(var h=this._root,d=this._comparator;h;){var x=d(a,h.key);if(x===0)return h;x<0?h=h.left:h=h.right}return null},M.prototype.find=function(a){return this._root&&(this._root=i(a,this._root,this._comparator),this._comparator(a,this._root.key)!==0)?null:this._root},M.prototype.contains=function(a){for(var h=this._root,d=this._comparator;h;){var x=d(a,h.key);if(x===0)return!0;x<0?h=h.left:h=h.right}return!1},M.prototype.forEach=function(a,h){for(var d=this._root,x=[],b=!1;!b;)d!==null?(x.push(d),d=d.left):x.length!==0?(d=x.pop(),a.call(h,d),d=d.right):b=!0;return this},M.prototype.range=function(a,h,d,x){for(var b=[],F=this._comparator,R=this._root,I;b.length!==0||R;)if(R)b.push(R),R=R.left;else{if(R=b.pop(),I=F(R.key,h),I>0)break;if(F(R.key,a)>=0&&d.call(x,R))return this;R=R.right}return this},M.prototype.keys=function(){var a=[];return this.forEach(function(h){var d=h.key;return a.push(d)}),a},M.prototype.values=function(){var a=[];return this.forEach(function(h){var d=h.data;return a.push(d)}),a},M.prototype.min=function(){return this._root?this.minNode(this._root).key:null},M.prototype.max=function(){return this._root?this.maxNode(this._root).key:null},M.prototype.minNode=function(a){if(a===void 0&&(a=this._root),a)for(;a.left;)a=a.left;return a},M.prototype.maxNode=function(a){if(a===void 0&&(a=this._root),a)for(;a.right;)a=a.right;return a},M.prototype.at=function(a){for(var h=this._root,d=!1,x=0,b=[];!d;)if(h)b.push(h),h=h.left;else if(b.length>0){if(h=b.pop(),x===a)return h;x++,h=h.right}else d=!0;return null},M.prototype.next=function(a){var h=this._root,d=null;if(a.right){for(d=a.right;d.left;)d=d.left;return d}for(var x=this._comparator;h;){var b=x(a.key,h.key);if(b===0)break;b<0?(d=h,h=h.left):h=h.right}return d},M.prototype.prev=function(a){var h=this._root,d=null;if(a.left!==null){for(d=a.left;d.right;)d=d.right;return d}for(var x=this._comparator;h;){var b=x(a.key,h.key);if(b===0)break;b<0?h=h.left:(d=h,h=h.right)}return d},M.prototype.clear=function(){return this._root=null,this._size=0,this},M.prototype.toList=function(){return p(this._root)},M.prototype.load=function(a,h,d){h===void 0&&(h=[]),d===void 0&&(d=!1);var x=a.length,b=this._comparator;if(d&&y(a,h,0,x-1,b),this._root===null)this._root=c(a,h,0,x),this._size=x;else{var F=g(this.toList(),f(a,h),b);x=this._size+x,this._root=m({head:F},0,x)}return this},M.prototype.isEmpty=function(){return this._root===null},Object.defineProperty(M.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(M.prototype,"root",{get:function(){return this._root},enumerable:!0,configurable:!0}),M.prototype.toString=function(a){a===void 0&&(a=function(d){return String(d.key)});var h=[];return u(this._root,"",!0,function(d){return h.push(d)},a),h.join("")},M.prototype.update=function(a,h,d){var x=this._comparator,b=r(a,this._root,x),F=b.left,R=b.right;x(a,h)<0?R=o(h,d,R,x):F=o(h,d,F,x),this._root=s(F,R,x)},M.prototype.split=function(a){return r(a,this._root,this._comparator)},M.prototype[Symbol.iterator]=function(){var a,h,d;return e(this,function(x){switch(x.label){case 0:a=this._root,h=[],d=!1,x.label=1;case 1:return d?[3,6]:a===null?[3,2]:(h.push(a),a=a.left,[3,5]);case 2:return h.length===0?[3,4]:(a=h.pop(),[4,a]);case 3:return x.sent(),a=a.right,[3,5];case 4:d=!0,x.label=5;case 5:return[3,1];case 6:return[2]}})},M}();function c(M,a,h,d){var x=d-h;if(x>0){var b=h+Math.floor(x/2),F=M[b],R=a[b],I=new t(F,R);return I.left=c(M,a,h,b),I.right=c(M,a,b+1,d),I}return null}function f(M,a){for(var h=new t(null,null),d=h,x=0;x<M.length;x++)d=d.next=new t(M[x],a[x]);return d.next=null,h.next}function p(M){for(var a=M,h=[],d=!1,x=new t(null,null),b=x;!d;)a?(h.push(a),a=a.left):h.length>0?(a=b=b.next=h.pop(),a=a.right):d=!0;return b.next=null,x.next}function m(M,a,h){var d=h-a;if(d>0){var x=a+Math.floor(d/2),b=m(M,a,x),F=M.head;return F.left=b,M.head=M.head.next,F.right=m(M,x+1,h),F}return null}function g(M,a,h){for(var d=new t(null,null),x=d,b=M,F=a;b!==null&&F!==null;)h(b.key,F.key)<0?(x.next=b,b=b.next):(x.next=F,F=F.next),x=x.next;return b!==null?x.next=b:F!==null&&(x.next=F),d.next}function y(M,a,h,d,x){if(!(h>=d)){for(var b=M[h+d>>1],F=h-1,R=d+1;;){do F++;while(x(M[F],b)<0);do R--;while(x(M[R],b)>0);if(F>=R)break;var I=M[F];M[F]=M[R],M[R]=I,I=a[F],a[F]=a[R],a[R]=I}y(M,a,h,R,x),y(M,a,R+1,d,x)}}let w=(M,a)=>M.ll.x<=a.x&&a.x<=M.ur.x&&M.ll.y<=a.y&&a.y<=M.ur.y,E=(M,a)=>{if(a.ur.x<M.ll.x||M.ur.x<a.ll.x||a.ur.y<M.ll.y||M.ur.y<a.ll.y)return null;let h=M.ll.x<a.ll.x?a.ll.x:M.ll.x,d=M.ur.x<a.ur.x?M.ur.x:a.ur.x,x=M.ll.y<a.ll.y?a.ll.y:M.ll.y,b=M.ur.y<a.ur.y?M.ur.y:a.ur.y;return{ll:{x:h,y:x},ur:{x:d,y:b}}},S=Number.EPSILON;S===void 0&&(S=Math.pow(2,-52));let B=S*S,L=(M,a)=>{if(-S<M&&M<S&&-S<a&&a<S)return 0;let h=M-a;return h*h<B*M*a?0:M<a?-1:1};class A{constructor(){this.reset()}reset(){this.xRounder=new U,this.yRounder=new U}round(a,h){return{x:this.xRounder.round(a),y:this.yRounder.round(h)}}}class U{constructor(){this.tree=new l,this.round(0)}round(a){let h=this.tree.add(a),d=this.tree.prev(h);if(d!==null&&L(h.key,d.key)===0)return this.tree.remove(a),d.key;let x=this.tree.next(h);return x!==null&&L(h.key,x.key)===0?(this.tree.remove(a),x.key):a}}let V=new A,D=11102230246251565e-32,j=134217729,O=(3+8*D)*D;function z(M,a,h,d,x){let b,F,R,I,k=a[0],C=d[0],v=0,P=0;C>k==C>-k?(b=k,k=a[++v]):(b=C,C=d[++P]);let _=0;if(v<M&&P<h)for(C>k==C>-k?(F=k+b,R=b-(F-k),k=a[++v]):(F=C+b,R=b-(F-C),C=d[++P]),b=F,R!==0&&(x[_++]=R);v<M&&P<h;)C>k==C>-k?(F=b+k,I=F-b,R=b-(F-I)+(k-I),k=a[++v]):(F=b+C,I=F-b,R=b-(F-I)+(C-I),C=d[++P]),b=F,R!==0&&(x[_++]=R);for(;v<M;)F=b+k,I=F-b,R=b-(F-I)+(k-I),k=a[++v],b=F,R!==0&&(x[_++]=R);for(;P<h;)F=b+C,I=F-b,R=b-(F-I)+(C-I),C=d[++P],b=F,R!==0&&(x[_++]=R);return(b!==0||_===0)&&(x[_++]=b),_}function G(M,a){let h=a[0];for(let d=1;d<M;d++)h+=a[d];return h}function te(M){return new Float64Array(M)}let ie=(3+16*D)*D,J=(2+12*D)*D,X=(9+64*D)*D*D,W=te(4),re=te(8),Q=te(12),T=te(16),N=te(4);function ee(M,a,h,d,x,b,F){let R,I,k,C,v,P,_,Y,H,q,K,ue,ge,ae,xe,ye,Fe,we,_e=M-x,Be=h-x,Te=a-b,Ce=d-b;ae=_e*Ce,P=j*_e,_=P-(P-_e),Y=_e-_,P=j*Ce,H=P-(P-Ce),q=Ce-H,xe=Y*q-(ae-_*H-Y*H-_*q),ye=Te*Be,P=j*Te,_=P-(P-Te),Y=Te-_,P=j*Be,H=P-(P-Be),q=Be-H,Fe=Y*q-(ye-_*H-Y*H-_*q),K=xe-Fe,v=xe-K,W[0]=xe-(K+v)+(v-Fe),ue=ae+K,v=ue-ae,ge=ae-(ue-v)+(K-v),K=ge-ye,v=ge-K,W[1]=ge-(K+v)+(v-ye),we=ue+K,v=we-ue,W[2]=ue-(we-v)+(K-v),W[3]=we;let Ge=G(4,W),lt=J*F;if(Ge>=lt||-Ge>=lt||(v=M-_e,R=M-(_e+v)+(v-x),v=h-Be,k=h-(Be+v)+(v-x),v=a-Te,I=a-(Te+v)+(v-b),v=d-Ce,C=d-(Ce+v)+(v-b),R===0&&I===0&&k===0&&C===0)||(lt=X*F+O*Math.abs(Ge),Ge+=_e*C+Ce*R-(Te*k+Be*I),Ge>=lt||-Ge>=lt))return Ge;ae=R*Ce,P=j*R,_=P-(P-R),Y=R-_,P=j*Ce,H=P-(P-Ce),q=Ce-H,xe=Y*q-(ae-_*H-Y*H-_*q),ye=I*Be,P=j*I,_=P-(P-I),Y=I-_,P=j*Be,H=P-(P-Be),q=Be-H,Fe=Y*q-(ye-_*H-Y*H-_*q),K=xe-Fe,v=xe-K,N[0]=xe-(K+v)+(v-Fe),ue=ae+K,v=ue-ae,ge=ae-(ue-v)+(K-v),K=ge-ye,v=ge-K,N[1]=ge-(K+v)+(v-ye),we=ue+K,v=we-ue,N[2]=ue-(we-v)+(K-v),N[3]=we;let lo=z(4,W,4,N,re);ae=_e*C,P=j*_e,_=P-(P-_e),Y=_e-_,P=j*C,H=P-(P-C),q=C-H,xe=Y*q-(ae-_*H-Y*H-_*q),ye=Te*k,P=j*Te,_=P-(P-Te),Y=Te-_,P=j*k,H=P-(P-k),q=k-H,Fe=Y*q-(ye-_*H-Y*H-_*q),K=xe-Fe,v=xe-K,N[0]=xe-(K+v)+(v-Fe),ue=ae+K,v=ue-ae,ge=ae-(ue-v)+(K-v),K=ge-ye,v=ge-K,N[1]=ge-(K+v)+(v-ye),we=ue+K,v=we-ue,N[2]=ue-(we-v)+(K-v),N[3]=we;let co=z(lo,re,4,N,Q);ae=R*C,P=j*R,_=P-(P-R),Y=R-_,P=j*C,H=P-(P-C),q=C-H,xe=Y*q-(ae-_*H-Y*H-_*q),ye=I*k,P=j*I,_=P-(P-I),Y=I-_,P=j*k,H=P-(P-k),q=k-H,Fe=Y*q-(ye-_*H-Y*H-_*q),K=xe-Fe,v=xe-K,N[0]=xe-(K+v)+(v-Fe),ue=ae+K,v=ue-ae,ge=ae-(ue-v)+(K-v),K=ge-ye,v=ge-K,N[1]=ge-(K+v)+(v-ye),we=ue+K,v=we-ue,N[2]=ue-(we-v)+(K-v),N[3]=we;let ao=z(co,Q,4,N,T);return T[ao-1]}function Z(M,a,h,d,x,b){let F=(a-b)*(h-x),R=(M-x)*(d-b),I=F-R,k=Math.abs(F+R);return Math.abs(I)>=ie*k?I:-ee(M,a,h,d,x,b,k)}let oe=(M,a)=>M.x*a.y-M.y*a.x,de=(M,a)=>M.x*a.x+M.y*a.y,be=(M,a,h)=>{let d=Z(M.x,M.y,a.x,a.y,h.x,h.y);return d>0?-1:d<0?1:0},se=M=>Math.sqrt(de(M,M)),Ie=(M,a,h)=>{let d={x:a.x-M.x,y:a.y-M.y},x={x:h.x-M.x,y:h.y-M.y};return oe(x,d)/se(x)/se(d)},Ne=(M,a,h)=>{let d={x:a.x-M.x,y:a.y-M.y},x={x:h.x-M.x,y:h.y-M.y};return de(x,d)/se(x)/se(d)},ce=(M,a,h)=>a.y===0?null:{x:M.x+a.x/a.y*(h-M.y),y:h},Me=(M,a,h)=>a.x===0?null:{x:h,y:M.y+a.y/a.x*(h-M.x)},Se=(M,a,h,d)=>{if(a.x===0)return Me(h,d,M.x);if(d.x===0)return Me(M,a,h.x);if(a.y===0)return ce(h,d,M.y);if(d.y===0)return ce(M,a,h.y);let x=oe(a,d);if(x==0)return null;let b={x:h.x-M.x,y:h.y-M.y},F=oe(b,a)/x,R=oe(b,d)/x,I=M.x+R*a.x,k=h.x+F*d.x,C=M.y+R*a.y,v=h.y+F*d.y,P=(I+k)/2,_=(C+v)/2;return{x:P,y:_}};class ne{static compare(a,h){let d=ne.comparePoints(a.point,h.point);return d!==0?d:(a.point!==h.point&&a.link(h),a.isLeft!==h.isLeft?a.isLeft?1:-1:me.compare(a.segment,h.segment))}static comparePoints(a,h){return a.x<h.x?-1:a.x>h.x?1:a.y<h.y?-1:a.y>h.y?1:0}constructor(a,h){a.events===void 0?a.events=[this]:a.events.push(this),this.point=a,this.isLeft=h}link(a){if(a.point===this.point)throw new Error("Tried to link already linked events");let h=a.point.events;for(let d=0,x=h.length;d<x;d++){let b=h[d];this.point.events.push(b),b.point=this.point}this.checkForConsuming()}checkForConsuming(){let a=this.point.events.length;for(let h=0;h<a;h++){let d=this.point.events[h];if(d.segment.consumedBy===void 0)for(let x=h+1;x<a;x++){let b=this.point.events[x];b.consumedBy===void 0&&d.otherSE.point.events===b.otherSE.point.events&&d.segment.consume(b.segment)}}}getAvailableLinkedEvents(){let a=[];for(let h=0,d=this.point.events.length;h<d;h++){let x=this.point.events[h];x!==this&&!x.segment.ringOut&&x.segment.isInResult()&&a.push(x)}return a}getLeftmostComparator(a){let h=new Map,d=x=>{let b=x.otherSE;h.set(x,{sine:Ie(this.point,a.point,b.point),cosine:Ne(this.point,a.point,b.point)})};return(x,b)=>{h.has(x)||d(x),h.has(b)||d(b);let{sine:F,cosine:R}=h.get(x),{sine:I,cosine:k}=h.get(b);return F>=0&&I>=0?R<k?1:R>k?-1:0:F<0&&I<0?R<k?-1:R>k?1:0:I<F?-1:I>F?1:0}}}let he=0;class me{static compare(a,h){let d=a.leftSE.point.x,x=h.leftSE.point.x,b=a.rightSE.point.x,F=h.rightSE.point.x;if(F<d)return 1;if(b<x)return-1;let R=a.leftSE.point.y,I=h.leftSE.point.y,k=a.rightSE.point.y,C=h.rightSE.point.y;if(d<x){if(I<R&&I<k)return 1;if(I>R&&I>k)return-1;let v=a.comparePoint(h.leftSE.point);if(v<0)return 1;if(v>0)return-1;let P=h.comparePoint(a.rightSE.point);return P!==0?P:-1}if(d>x){if(R<I&&R<C)return-1;if(R>I&&R>C)return 1;let v=h.comparePoint(a.leftSE.point);if(v!==0)return v;let P=a.comparePoint(h.rightSE.point);return P<0?1:P>0?-1:1}if(R<I)return-1;if(R>I)return 1;if(b<F){let v=h.comparePoint(a.rightSE.point);if(v!==0)return v}if(b>F){let v=a.comparePoint(h.rightSE.point);if(v<0)return 1;if(v>0)return-1}if(b!==F){let v=k-R,P=b-d,_=C-I,Y=F-x;if(v>P&&_<Y)return 1;if(v<P&&_>Y)return-1}return b>F?1:b<F||k<C?-1:k>C?1:a.id<h.id?-1:a.id>h.id?1:0}constructor(a,h,d,x){this.id=++he,this.leftSE=a,a.segment=this,a.otherSE=h,this.rightSE=h,h.segment=this,h.otherSE=a,this.rings=d,this.windings=x}static fromRing(a,h,d){let x,b,F,R=ne.comparePoints(a,h);if(R<0)x=a,b=h,F=1;else if(R>0)x=h,b=a,F=-1;else throw new Error(`Tried to create degenerate segment at [${a.x}, ${a.y}]`);let I=new ne(x,!0),k=new ne(b,!1);return new me(I,k,[d],[F])}replaceRightSE(a){this.rightSE=a,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}bbox(){let a=this.leftSE.point.y,h=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:a<h?a:h},ur:{x:this.rightSE.point.x,y:a>h?a:h}}}vector(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}isAnEndpoint(a){return a.x===this.leftSE.point.x&&a.y===this.leftSE.point.y||a.x===this.rightSE.point.x&&a.y===this.rightSE.point.y}comparePoint(a){if(this.isAnEndpoint(a))return 0;let h=this.leftSE.point,d=this.rightSE.point,x=this.vector();if(h.x===d.x)return a.x===h.x?0:a.x<h.x?1:-1;let b=(a.y-h.y)/x.y,F=h.x+b*x.x;if(a.x===F)return 0;let R=(a.x-h.x)/x.x,I=h.y+R*x.y;return a.y===I?0:a.y<I?-1:1}getIntersection(a){let h=this.bbox(),d=a.bbox(),x=E(h,d);if(x===null)return null;let b=this.leftSE.point,F=this.rightSE.point,R=a.leftSE.point,I=a.rightSE.point,k=w(h,R)&&this.comparePoint(R)===0,C=w(d,b)&&a.comparePoint(b)===0,v=w(h,I)&&this.comparePoint(I)===0,P=w(d,F)&&a.comparePoint(F)===0;if(C&&k)return P&&!v?F:!P&&v?I:null;if(C)return v&&b.x===I.x&&b.y===I.y?null:b;if(k)return P&&F.x===R.x&&F.y===R.y?null:R;if(P&&v)return null;if(P)return F;if(v)return I;let _=Se(b,this.vector(),R,a.vector());return _===null||!w(x,_)?null:V.round(_.x,_.y)}split(a){let h=[],d=a.events!==void 0,x=new ne(a,!0),b=new ne(a,!1),F=this.rightSE;this.replaceRightSE(b),h.push(b),h.push(x);let R=new me(x,F,this.rings.slice(),this.windings.slice());return ne.comparePoints(R.leftSE.point,R.rightSE.point)>0&&R.swapEvents(),ne.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),d&&(x.checkForConsuming(),b.checkForConsuming()),h}swapEvents(){let a=this.rightSE;this.rightSE=this.leftSE,this.leftSE=a,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(let h=0,d=this.windings.length;h<d;h++)this.windings[h]*=-1}consume(a){let h=this,d=a;for(;h.consumedBy;)h=h.consumedBy;for(;d.consumedBy;)d=d.consumedBy;let x=me.compare(h,d);if(x!==0){if(x>0){let b=h;h=d,d=b}if(h.prev===d){let b=h;h=d,d=b}for(let b=0,F=d.rings.length;b<F;b++){let R=d.rings[b],I=d.windings[b],k=h.rings.indexOf(R);k===-1?(h.rings.push(R),h.windings.push(I)):h.windings[k]+=I}d.rings=null,d.windings=null,d.consumedBy=h,d.leftSE.consumedBy=h.leftSE,d.rightSE.consumedBy=h.rightSE}}prevInResult(){return this._prevInResult!==void 0?this._prevInResult:(this.prev?this.prev.isInResult()?this._prevInResult=this.prev:this._prevInResult=this.prev.prevInResult():this._prevInResult=null,this._prevInResult)}beforeState(){if(this._beforeState!==void 0)return this._beforeState;if(!this.prev)this._beforeState={rings:[],windings:[],multiPolys:[]};else{let a=this.prev.consumedBy||this.prev;this._beforeState=a.afterState()}return this._beforeState}afterState(){if(this._afterState!==void 0)return this._afterState;let a=this.beforeState();this._afterState={rings:a.rings.slice(0),windings:a.windings.slice(0),multiPolys:[]};let h=this._afterState.rings,d=this._afterState.windings,x=this._afterState.multiPolys;for(let R=0,I=this.rings.length;R<I;R++){let k=this.rings[R],C=this.windings[R],v=h.indexOf(k);v===-1?(h.push(k),d.push(C)):d[v]+=C}let b=[],F=[];for(let R=0,I=h.length;R<I;R++){if(d[R]===0)continue;let k=h[R],C=k.poly;if(F.indexOf(C)===-1)if(k.isExterior)b.push(C);else{F.indexOf(C)===-1&&F.push(C);let v=b.indexOf(k.poly);v!==-1&&b.splice(v,1)}}for(let R=0,I=b.length;R<I;R++){let k=b[R].multiPoly;x.indexOf(k)===-1&&x.push(k)}return this._afterState}isInResult(){if(this.consumedBy)return!1;if(this._isInResult!==void 0)return this._isInResult;let a=this.beforeState().multiPolys,h=this.afterState().multiPolys;switch(Re.type){case"union":{let d=a.length===0,x=h.length===0;this._isInResult=d!==x;break}case"intersection":{let d,x;a.length<h.length?(d=a.length,x=h.length):(d=h.length,x=a.length),this._isInResult=x===Re.numMultiPolys&&d<x;break}case"xor":{let d=Math.abs(a.length-h.length);this._isInResult=d%2===1;break}case"difference":{let d=x=>x.length===1&&x[0].isSubject;this._isInResult=d(a)!==d(h);break}default:throw new Error(`Unrecognized operation type found ${Re.type}`)}return this._isInResult}}class Pe{constructor(a,h,d){if(!Array.isArray(a)||a.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=h,this.isExterior=d,this.segments=[],typeof a[0][0]!="number"||typeof a[0][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let x=V.round(a[0][0],a[0][1]);this.bbox={ll:{x:x.x,y:x.y},ur:{x:x.x,y:x.y}};let b=x;for(let F=1,R=a.length;F<R;F++){if(typeof a[F][0]!="number"||typeof a[F][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let I=V.round(a[F][0],a[F][1]);I.x===b.x&&I.y===b.y||(this.segments.push(me.fromRing(b,I,this)),I.x<this.bbox.ll.x&&(this.bbox.ll.x=I.x),I.y<this.bbox.ll.y&&(this.bbox.ll.y=I.y),I.x>this.bbox.ur.x&&(this.bbox.ur.x=I.x),I.y>this.bbox.ur.y&&(this.bbox.ur.y=I.y),b=I)}(x.x!==b.x||x.y!==b.y)&&this.segments.push(me.fromRing(b,x,this))}getSweepEvents(){let a=[];for(let h=0,d=this.segments.length;h<d;h++){let x=this.segments[h];a.push(x.leftSE),a.push(x.rightSE)}return a}}class Le{constructor(a,h){if(!Array.isArray(a))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new Pe(a[0],this,!0),this.bbox={ll:{x:this.exteriorRing.bbox.ll.x,y:this.exteriorRing.bbox.ll.y},ur:{x:this.exteriorRing.bbox.ur.x,y:this.exteriorRing.bbox.ur.y}},this.interiorRings=[];for(let d=1,x=a.length;d<x;d++){let b=new Pe(a[d],this,!1);b.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=b.bbox.ll.x),b.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=b.bbox.ll.y),b.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=b.bbox.ur.x),b.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=b.bbox.ur.y),this.interiorRings.push(b)}this.multiPoly=h}getSweepEvents(){let a=this.exteriorRing.getSweepEvents();for(let h=0,d=this.interiorRings.length;h<d;h++){let x=this.interiorRings[h].getSweepEvents();for(let b=0,F=x.length;b<F;b++)a.push(x[b])}return a}}class Oe{constructor(a,h){if(!Array.isArray(a))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{typeof a[0][0][0]=="number"&&(a=[a])}catch{}this.polys=[],this.bbox={ll:{x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY},ur:{x:Number.NEGATIVE_INFINITY,y:Number.NEGATIVE_INFINITY}};for(let d=0,x=a.length;d<x;d++){let b=new Le(a[d],this);b.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=b.bbox.ll.x),b.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=b.bbox.ll.y),b.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=b.bbox.ur.x),b.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=b.bbox.ur.y),this.polys.push(b)}this.isSubject=h}getSweepEvents(){let a=[];for(let h=0,d=this.polys.length;h<d;h++){let x=this.polys[h].getSweepEvents();for(let b=0,F=x.length;b<F;b++)a.push(x[b])}return a}}class Ee{static factory(a){let h=[];for(let d=0,x=a.length;d<x;d++){let b=a[d];if(!b.isInResult()||b.ringOut)continue;let F=null,R=b.leftSE,I=b.rightSE,k=[R],C=R.point,v=[];for(;F=R,R=I,k.push(R),R.point!==C;)for(;;){let P=R.getAvailableLinkedEvents();if(P.length===0){let H=k[0].point,q=k[k.length-1].point;throw new Error(`Unable to complete output ring starting at [${H.x}, ${H.y}]. Last matching segment found ends at [${q.x}, ${q.y}].`)}if(P.length===1){I=P[0].otherSE;break}let _=null;for(let H=0,q=v.length;H<q;H++)if(v[H].point===R.point){_=H;break}if(_!==null){let H=v.splice(_)[0],q=k.splice(H.index);q.unshift(q[0].otherSE),h.push(new Ee(q.reverse()));continue}v.push({index:k.length,point:R.point});let Y=R.getLeftmostComparator(F);I=P.sort(Y)[0].otherSE;break}h.push(new Ee(k))}return h}constructor(a){this.events=a;for(let h=0,d=a.length;h<d;h++)a[h].segment.ringOut=this;this.poly=null}getGeom(){let a=this.events[0].point,h=[a];for(let k=1,C=this.events.length-1;k<C;k++){let v=this.events[k].point,P=this.events[k+1].point;be(v,a,P)!==0&&(h.push(v),a=v)}if(h.length===1)return null;let d=h[0],x=h[1];be(d,a,x)===0&&h.shift(),h.push(h[0]);let b=this.isExteriorRing()?1:-1,F=this.isExteriorRing()?0:h.length-1,R=this.isExteriorRing()?h.length:-1,I=[];for(let k=F;k!=R;k+=b)I.push([h[k].x,h[k].y]);return I}isExteriorRing(){if(this._isExteriorRing===void 0){let a=this.enclosingRing();this._isExteriorRing=a?!a.isExteriorRing():!0}return this._isExteriorRing}enclosingRing(){return this._enclosingRing===void 0&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}_calcEnclosingRing(){let a=this.events[0];for(let x=1,b=this.events.length;x<b;x++){let F=this.events[x];ne.compare(a,F)>0&&(a=F)}let h=a.segment.prevInResult(),d=h?h.prevInResult():null;for(;;){if(!h)return null;if(!d)return h.ringOut;if(d.ringOut!==h.ringOut)return d.ringOut.enclosingRing()!==h.ringOut?h.ringOut:h.ringOut.enclosingRing();h=d.prevInResult(),d=h?h.prevInResult():null}}}class Ue{constructor(a){this.exteriorRing=a,a.poly=this,this.interiorRings=[]}addInterior(a){this.interiorRings.push(a),a.poly=this}getGeom(){let a=[this.exteriorRing.getGeom()];if(a[0]===null)return null;for(let h=0,d=this.interiorRings.length;h<d;h++){let x=this.interiorRings[h].getGeom();x!==null&&a.push(x)}return a}}class ze{constructor(a){this.rings=a,this.polys=this._composePolys(a)}getGeom(){let a=[];for(let h=0,d=this.polys.length;h<d;h++){let x=this.polys[h].getGeom();x!==null&&a.push(x)}return a}_composePolys(a){let h=[];for(let d=0,x=a.length;d<x;d++){let b=a[d];if(!b.poly)if(b.isExteriorRing())h.push(new Ue(b));else{let F=b.enclosingRing();F.poly||h.push(new Ue(F)),F.poly.addInterior(b)}}return h}}class We{constructor(a){let h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:me.compare;this.queue=a,this.tree=new l(h),this.segments=[]}process(a){let h=a.segment,d=[];if(a.consumedBy)return a.isLeft?this.queue.remove(a.otherSE):this.tree.remove(h),d;let x=a.isLeft?this.tree.add(h):this.tree.find(h);if(!x)throw new Error(`Unable to find segment #${h.id} [${h.leftSE.point.x}, ${h.leftSE.point.y}] -> [${h.rightSE.point.x}, ${h.rightSE.point.y}] in SweepLine tree.`);let b=x,F=x,R,I;for(;R===void 0;)b=this.tree.prev(b),b===null?R=null:b.key.consumedBy===void 0&&(R=b.key);for(;I===void 0;)F=this.tree.next(F),F===null?I=null:F.key.consumedBy===void 0&&(I=F.key);if(a.isLeft){let k=null;if(R){let v=R.getIntersection(h);if(v!==null&&(h.isAnEndpoint(v)||(k=v),!R.isAnEndpoint(v))){let P=this._splitSafely(R,v);for(let _=0,Y=P.length;_<Y;_++)d.push(P[_])}}let C=null;if(I){let v=I.getIntersection(h);if(v!==null&&(h.isAnEndpoint(v)||(C=v),!I.isAnEndpoint(v))){let P=this._splitSafely(I,v);for(let _=0,Y=P.length;_<Y;_++)d.push(P[_])}}if(k!==null||C!==null){let v=null;k===null?v=C:C===null?v=k:v=ne.comparePoints(k,C)<=0?k:C,this.queue.remove(h.rightSE),d.push(h.rightSE);let P=h.split(v);for(let _=0,Y=P.length;_<Y;_++)d.push(P[_])}d.length>0?(this.tree.remove(h),d.push(a)):(this.segments.push(h),h.prev=R)}else{if(R&&I){let k=R.getIntersection(I);if(k!==null){if(!R.isAnEndpoint(k)){let C=this._splitSafely(R,k);for(let v=0,P=C.length;v<P;v++)d.push(C[v])}if(!I.isAnEndpoint(k)){let C=this._splitSafely(I,k);for(let v=0,P=C.length;v<P;v++)d.push(C[v])}}}this.tree.remove(h)}return d}_splitSafely(a,h){this.tree.remove(a);let d=a.rightSE;this.queue.remove(d);let x=a.split(h);return x.push(d),a.consumedBy===void 0&&this.tree.add(a),x}}let ut=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,Rt=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6;class Yt{run(a,h,d){Re.type=a,V.reset();let x=[new Oe(h,!0)];for(let v=0,P=d.length;v<P;v++)x.push(new Oe(d[v],!1));if(Re.numMultiPolys=x.length,Re.type==="difference"){let v=x[0],P=1;for(;P<x.length;)E(x[P].bbox,v.bbox)!==null?P++:x.splice(P,1)}if(Re.type==="intersection")for(let v=0,P=x.length;v<P;v++){let _=x[v];for(let Y=v+1,H=x.length;Y<H;Y++)if(E(_.bbox,x[Y].bbox)===null)return[]}let b=new l(ne.compare);for(let v=0,P=x.length;v<P;v++){let _=x[v].getSweepEvents();for(let Y=0,H=_.length;Y<H;Y++)if(b.insert(_[Y]),b.size>ut)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big).")}let F=new We(b),R=b.size,I=b.pop();for(;I;){let v=I.key;if(b.size===R){let _=v.segment;throw new Error(`Unable to pop() ${v.isLeft?"left":"right"} SweepEvent [${v.point.x}, ${v.point.y}] from segment #${_.id} [${_.leftSE.point.x}, ${_.leftSE.point.y}] -> [${_.rightSE.point.x}, ${_.rightSE.point.y}] from queue.`)}if(b.size>ut)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big).");if(F.segments.length>Rt)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments).");let P=F.process(v);for(let _=0,Y=P.length;_<Y;_++){let H=P[_];H.consumedBy===void 0&&b.insert(H)}R=b.size,I=b.pop()}V.reset();let k=Ee.factory(F.segments);return new ze(k).getGeom()}}let Re=new Yt;var uo={union:function(M){for(var a=arguments.length,h=new Array(a>1?a-1:0),d=1;d<a;d++)h[d-1]=arguments[d];return Re.run("union",M,h)},intersection:function(M){for(var a=arguments.length,h=new Array(a>1?a-1:0),d=1;d<a;d++)h[d-1]=arguments[d];return Re.run("intersection",M,h)},xor:function(M){for(var a=arguments.length,h=new Array(a>1?a-1:0),d=1;d<a;d++)h[d-1]=arguments[d];return Re.run("xor",M,h)},difference:function(M){for(var a=arguments.length,h=new Array(a>1?a-1:0),d=1;d<a;d++)h[d-1]=arguments[d];return Re.run("difference",M,h)}};return uo})});var ht=new Set,$t=!1;function Xe(e,t,n=2){let i=t&&t.length,o=i?t[0]*n:e.length;ht.size&&ht.clear();let r=_n(e,0,o,n,!0),s=[];if(!r||r.next===r.prev)return s;let u=0,l=0,c=0;if(i&&(r=Ro(e,t,r,n)),e.length>80*n){u=e[0],l=e[1];let f=u,p=l;for(let m=n;m<o;m+=n){let g=e[m],y=e[m+1];g<u&&(u=g),y<l&&(l=y),g>f&&(f=g),y>p&&(p=y)}c=Math.max(f-u,p-l),c=c!==0?32767/c:0}return Wt(r,s,u,l,c),s}function _n(e,t,n,i,o){let r=null;if(o===Oo(e,t,n,i)>0)for(let s=t;s<n;s+=i)r=Ln(s/i|0,e[s],e[s+1],r);else for(let s=n-i;s>=t;s-=i)r=Ln(s/i|0,e[s],e[s+1],r);return r&&mt(r,r.next)&&(dt(r),r=r.next),r}function Ke(e,t=e){let n=t===e,i=e,o;do o=!1,i!==i.next&&(ht.size===0||!ht.has(i))&&(mt(i,i.next)||fe(i.prev,i,i.next)===0)?((n||i===t)&&(t=i.prev),$t=!0,dt(i),i=i.prev,o=!0):(n||i!==t)&&(i=i.next,o=!n);while(o||i!==t);return t}function Wt(e,t,n,i,o){o&&Lo(e,n,i,o);let r=e,s=!1;for(;e.prev!==e.next;){let u=e.prev,l=e.next;if(fe(u,e,l)<0&&(o?Mo(e,n,i,o):wo(e))){t.push(u.i,e.i,l.i),dt(e),e=l,r=l;continue}if(e=l,e===r){if($t=!1,e=Ke(e),$t){r=e;continue}if(!s){e=vo(e,t),r=e,s=!0;continue}So(e,t,n,i,o);break}}}function wo(e){let t=e.prev,n=e,i=e.next,o=t.x,r=n.x,s=i.x,u=t.y,l=n.y,c=i.y,f=Math.min(o,r,s),p=Math.min(u,l,c),m=Math.max(o,r,s),g=Math.max(u,l,c),y=i.next;for(;y!==t;){if(y.x>=f&&y.x<=m&&y.y>=p&&y.y<=g&&!(o===y.x&&u===y.y)&&At(o,u,r,l,s,c,y.x,y.y)&&fe(y.prev,y,y.next)>=0)return!1;y=y.next}return!0}function Mo(e,t,n,i){let o=e.prev,r=e,s=e.next,u=o.x,l=r.x,c=s.x,f=o.y,p=r.y,m=s.y,g=Math.min(u,l,c),y=Math.min(f,p,m),w=Math.max(u,l,c),E=Math.max(f,p,m),S=Jt(g,y,t,n,i),B=Jt(w,E,t,n,i),L=e.prevZ;for(;L&&L.z>=S;){if(L.x>=g&&L.x<=w&&L.y>=y&&L.y<=E&&L!==s&&!(u===L.x&&f===L.y)&&At(u,f,l,p,c,m,L.x,L.y)&&fe(L.prev,L,L.next)>=0)return!1;L=L.prevZ}let A=e.nextZ;for(;A&&A.z<=B;){if(A.x>=g&&A.x<=w&&A.y>=y&&A.y<=E&&A!==s&&!(u===A.x&&f===A.y)&&At(u,f,l,p,c,m,A.x,A.y)&&fe(A.prev,A,A.next)>=0)return!1;A=A.nextZ}return!0}function vo(e,t){let n=e,i=!1;do{let o=n.prev,r=n.next.next;Cn(o,n,n.next,r,!1)&&pt(o,r)&&pt(r,o)&&(t.push(o.i,n.i,r.i),dt(n),dt(n.next),n=e=r,i=!0),n=n.next}while(n!==e);return i?Ke(n):n}function So(e,t,n,i,o){let r=e;do{let s=r.next.next;for(;s!==r.prev;){if(r.i!==s.i&&To(r,s)){let u=Vn(r,s);r=Ke(r,r.next),u=Ke(u,u.next),Wt(r,t,n,i,o),Wt(u,t,n,i,o);return}s=s.next}r=r.next}while(r!==e)}var Zt=!1;function Ro(e,t,n,i){let o=[];for(let r=0,s=t.length;r<s;r++){let u=t[r]*i,l=r<s-1?t[r+1]*i:e.length,c=_n(e,u,l,i,!1);c===c.next&&ht.add(c),o.push(Bo(c))}o.sort(Eo),ko(e.length/i,t.length),Tn(n,n),Zt=!0;for(let r=0;r<o.length;r++)n=Fo(o[r],n);return Zt=!1,Ke(n)}function Eo(e,t){return e.x-t.x||e.y-t.y||(e.next.y-e.y)/(e.next.x-e.x)-(t.next.y-t.y)/(t.next.x-t.x)}function Fo(e,t){let n=Io(e,t);if(!n)return t;let i=Vn(n,e),o=i.next;return Tn(n,o.next),Ke(i,i.next),Ke(n,n.next)}var Bn=16,le=new Float64Array(0),kt=0,Kt=[],Qt=[];function ko(e,t){let n=Math.ceil((e+2*t)/Bn)+t+2;le.length<n*4&&(le=new Float64Array(n*4)),kt=0}function Tn(e,t){let n=e;do{let i=kt++;Kt[i]=n;let o=1/0,r=1/0,s=-1/0,u=-1/0,l=0;do{let f=n.next;n.z=i,n.x<o&&(o=n.x),n.x>s&&(s=n.x),n.y<r&&(r=n.y),n.y>u&&(u=n.y),f.x<o&&(o=f.x),f.x>s&&(s=f.x),f.y<r&&(r=f.y),f.y>u&&(u=f.y),n=f}while(++l<Bn&&n!==t);Qt[i]=n;let c=i*4;le[c]=o,le[c+1]=r,le[c+2]=s,le[c+3]=u}while(n!==t)}function Ao(e,t){let n=e.z*4;t.x<le[n]&&(le[n]=t.x),t.y<le[n+1]&&(le[n+1]=t.y),t.x>le[n+2]&&(le[n+2]=t.x),t.y>le[n+3]&&(le[n+3]=t.y)}function In(e){let t=Qt[e];for(;t.prev.next!==t;)t=t.next;return Qt[e]=t,t}function Pn(e){let t=Kt[e];for(;t.prev.next!==t;)t=t.next;return Kt[e]=t,t}function Io(e,t){let n=t,i=e.x,o=e.y,r=-1/0,s;if(mt(e,n))return n;for(let m=0,g=0;m<kt;m++,g+=4){if(o<le[g+1]||o>le[g+3]||le[g]>i||le[g+2]<=r)continue;let y=In(m);n=Pn(m);do{if(n.prev.next===n){if(mt(e,n.next))return n.next;if(o<=n.y&&o>=n.next.y&&n.next.y!==n.y){let w=n.x+(o-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(w<=i&&w>r&&(r=w,s=n.x<n.next.x?n:n.next,w===i))return s}}n=n.next}while(n!==y)}if(!s)return null;let u=s.x,l=s.y,c=Math.min(o,l),f=Math.max(o,l),p=1/0;for(let m=0,g=0;m<kt;m++,g+=4){if(le[g+2]<u||le[g]>i||le[g+3]<c||le[g+1]>f)continue;let y=In(m);n=Pn(m);do{if(n.prev.next===n&&i>=n.x&&n.x>=u&&i!==n.x&&At(o<l?i:r,o,u,l,o<l?r:i,o,n.x,n.y)){let w=Math.abs(o-n.y)/(i-n.x);(pt(n,e)||n.y===o&&n.next.y===o&&n.next.x>i)&&(w<p||w===p&&(n.x>s.x||n.x===s.x&&Po(s,n)))&&(s=n,p=w)}n=n.next}while(n!==y)}return s}function Po(e,t){return fe(e.prev,e,t.prev)<0&&fe(t.next,e,e.next)<0}var ke=[],ct=[],Ze=new Uint32Array(0),at=new Uint32Array(0),ft=new Uint32Array(256);function Lo(e,t,n,i){let o=e,r=0;do o.z=Jt(o.x,o.y,t,n,i),ke[r++]=o,o=o.next;while(o!==e);_o(r);let s=null;for(let u=0;u<r;u++){let l=ke[u];l.prevZ=s,s&&(s.nextZ=l),s=l}s.nextZ=null}function _o(e){if(e<=32){for(let t=1;t<e;t++){let n=ke[t],i=n.z,o=t-1;for(;o>=0&&ke[o].z>i;)ke[o+1]=ke[o],o--;ke[o+1]=n}return}Ze.length<e&&(Ze=new Uint32Array(e),at=new Uint32Array(e),ct=new Array(e));for(let t=0;t<e;t++)Ze[t]=ke[t].z;Et(e,ke,Ze,ct,at,0),Et(e,ct,at,ke,Ze,8),Et(e,ke,Ze,ct,at,16),Et(e,ct,at,ke,Ze,24)}function Et(e,t,n,i,o,r){ft.fill(0);for(let u=0;u<e;u++)ft[n[u]>>>r&255]++;let s=0;for(let u=0;u<256;u++){let l=ft[u];ft[u]=s,s+=l}for(let u=0;u<e;u++){let l=n[u],c=ft[l>>>r&255]++;i[c]=t[u],o[c]=l}}function Jt(e,t,n,i,o){return e=(e-n)*o|0,t=(t-i)*o|0,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,e|t<<1}function Bo(e){let t=e,n=e;do(t.x<n.x||t.x===n.x&&t.y<n.y)&&(n=t),t=t.next;while(t!==e);return n}function At(e,t,n,i,o,r,s,u){return(o-s)*(t-u)>=(e-s)*(r-u)&&(e-s)*(i-u)>=(n-s)*(t-u)&&(n-s)*(r-u)>=(o-s)*(i-u)}function To(e,t){let n=mt(e,t)&&fe(e.prev,e,e.next)>0&&fe(t.prev,t,t.next)>0;return e.next.i!==t.i&&(n||pt(e,t)&&pt(t,e)&&(fe(e.prev,e,t.prev)!==0||fe(e,t.prev,t)!==0))&&!Co(e,t)&&(n||Vo(e,t))}function fe(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function mt(e,t){return e.x===t.x&&e.y===t.y}function Cn(e,t,n,i,o=!0){let r=fe(e,t,n),s=fe(e,t,i),u=fe(n,i,e),l=fe(n,i,t);return(r>0&&s<0||r<0&&s>0)&&(u>0&&l<0||u<0&&l>0)?!0:o?!!(r===0&&Ft(e,n,t)||s===0&&Ft(e,i,t)||u===0&&Ft(n,e,i)||l===0&&Ft(n,t,i)):!1}function Ft(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function Co(e,t){let n=Math.min(e.x,t.x),i=Math.max(e.x,t.x),o=Math.min(e.y,t.y),r=Math.max(e.y,t.y),s=e;do{let u=s.next;if(s.x>i&&u.x>i||s.x<n&&u.x<n||s.y>r&&u.y>r||s.y<o&&u.y<o){s=u;continue}if(s.i!==e.i&&u.i!==e.i&&s.i!==t.i&&u.i!==t.i&&Cn(s,u,e,t))return!0;s=u}while(s!==e);return!1}function pt(e,t){return fe(e.prev,e,e.next)<0?fe(e,t,e.next)>=0&&fe(e,e.prev,t)>=0:fe(e,t,e.prev)<0||fe(e,e.next,t)<0}function Vo(e,t){let n=e,i=!1,o=(e.x+t.x)/2,r=(e.y+t.y)/2;do{let s=n.next;n.y>r!=s.y>r&&o<(s.x-n.x)*(r-n.y)/(s.y-n.y)+n.x&&(i=!i),n=s}while(n!==e);return i}function Vn(e,t){let n=qt(e.i,e.x,e.y),i=qt(t.i,t.x,t.y),o=e.next,r=t.prev;return e.next=t,t.prev=e,n.next=o,o.prev=n,i.next=n,n.prev=i,r.next=i,i.prev=r,i}function Ln(e,t,n,i){let o=qt(e,t,n);return i?(o.next=i.next,o.prev=i,i.next.prev=o,i.next=o):(o.prev=o,o.next=o),o}function dt(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ),Zt&&Ao(e.prev,e.next)}function qt(e,t,n){return{i:e,x:t,y:n,prev:null,next:null,z:0,prevZ:null,nextZ:null}}function Oo(e,t,n,i){let o=0;for(let r=t,s=n-i;r<n;r+=i)o+=(e[s]-e[r])*(e[r+1]+e[s+1]),s=r;return o}var On=23283064365386963e-26,Do=12,Dn=typeof TextDecoder>"u"?null:new TextDecoder("utf-8"),en=0,It=1,bt=2,Pt=5,gt=class{constructor(t=new Uint8Array(16)){this.buf=ArrayBuffer.isView(t)?t:new Uint8Array(t),this.dataView=new DataView(this.buf.buffer),this.pos=0,this.type=0,this.length=this.buf.length}readFields(t,n,i=this.length){for(;this.pos<i;){let o=this.readVarint(),r=o>>3,s=this.pos;this.type=o&7,t(r,n,this),this.pos===s&&this.skip(o)}return n}readMessage(t,n){return this.readFields(t,n,this.readVarint()+this.pos)}readFixed32(){let t=this.dataView.getUint32(this.pos,!0);return this.pos+=4,t}readSFixed32(){let t=this.dataView.getInt32(this.pos,!0);return this.pos+=4,t}readFixed64(){let t=this.dataView.getUint32(this.pos,!0)+this.dataView.getUint32(this.pos+4,!0)*4294967296;return this.pos+=8,t}readSFixed64(){let t=this.dataView.getUint32(this.pos,!0)+this.dataView.getInt32(this.pos+4,!0)*4294967296;return this.pos+=8,t}readFloat(){let t=this.dataView.getFloat32(this.pos,!0);return this.pos+=4,t}readDouble(){let t=this.dataView.getFloat64(this.pos,!0);return this.pos+=8,t}readVarint(t){let n=this.buf,i,o;return o=n[this.pos++],i=o&127,o<128||(o=n[this.pos++],i|=(o&127)<<7,o<128)||(o=n[this.pos++],i|=(o&127)<<14,o<128)||(o=n[this.pos++],i|=(o&127)<<21,o<128)?i:(o=n[this.pos],i|=(o&15)<<28,No(i,t,this))}readVarint64(){return this.readVarint(!0)}readSVarint(){let t=this.readVarint();return t%2===1?(t+1)/-2:t/2}readBoolean(){return!!this.readVarint()}readString(){let t=this.readVarint()+this.pos,n=this.pos;return this.pos=t,t-n>=Do&&Dn?Dn.decode(this.buf.subarray(n,t)):Jo(this.buf,n,t)}readBytes(){let t=this.readVarint()+this.pos,n=this.buf.subarray(this.pos,t);return this.pos=t,n}readPackedVarint(t=[],n){let i=this.readPackedEnd();for(;this.pos<i;)t.push(this.readVarint(n));return t}readPackedSVarint(t=[]){let n=this.readPackedEnd();for(;this.pos<n;)t.push(this.readSVarint());return t}readPackedBoolean(t=[]){let n=this.readPackedEnd();for(;this.pos<n;)t.push(this.readBoolean());return t}readPackedFloat(t=[]){let n=this.readPackedEnd();for(;this.pos<n;)t.push(this.readFloat());return t}readPackedDouble(t=[]){let n=this.readPackedEnd();for(;this.pos<n;)t.push(this.readDouble());return t}readPackedFixed32(t=[]){let n=this.readPackedEnd();for(;this.pos<n;)t.push(this.readFixed32());return t}readPackedSFixed32(t=[]){let n=this.readPackedEnd();for(;this.pos<n;)t.push(this.readSFixed32());return t}readPackedFixed64(t=[]){let n=this.readPackedEnd();for(;this.pos<n;)t.push(this.readFixed64());return t}readPackedSFixed64(t=[]){let n=this.readPackedEnd();for(;this.pos<n;)t.push(this.readSFixed64());return t}readPackedEnd(){return this.type===bt?this.readVarint()+this.pos:this.pos+1}skip(t){let n=t&7;if(n===en)for(;this.buf[this.pos++]>127;);else if(n===bt)this.pos=this.readVarint()+this.pos;else if(n===Pt)this.pos+=4;else if(n===It)this.pos+=8;else throw new Error(`Unimplemented type: ${n}`)}writeTag(t,n){this.writeVarint(t<<3|n)}realloc(t){let n=this.length||16;for(;n<this.pos+t;)n*=2;if(n!==this.length){let i=new Uint8Array(n);i.set(this.buf),this.buf=i,this.dataView=new DataView(i.buffer),this.length=n}}finish(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)}writeFixed32(t){this.realloc(4),this.dataView.setInt32(this.pos,t,!0),this.pos+=4}writeSFixed32(t){this.realloc(4),this.dataView.setInt32(this.pos,t,!0),this.pos+=4}writeFixed64(t){this.realloc(8),this.dataView.setInt32(this.pos,t&-1,!0),this.dataView.setInt32(this.pos+4,Math.floor(t*On),!0),this.pos+=8}writeSFixed64(t){this.realloc(8),this.dataView.setInt32(this.pos,t&-1,!0),this.dataView.setInt32(this.pos+4,Math.floor(t*On),!0),this.pos+=8}writeVarint(t){if(t=+t||0,t>268435455||t<0){Uo(t,this);return}this.realloc(4),this.buf[this.pos++]=t&127|(t>127?128:0),!(t<=127)&&(this.buf[this.pos++]=(t>>>=7)&127|(t>127?128:0),!(t<=127)&&(this.buf[this.pos++]=(t>>>=7)&127|(t>127?128:0),!(t<=127)&&(this.buf[this.pos++]=t>>>7&127)))}writeSVarint(t){this.writeVarint(t<0?-t*2-1:t*2)}writeBoolean(t){this.writeVarint(+t)}writeString(t){t=String(t),this.realloc(t.length*4),this.pos++;let n=this.pos;this.pos=qo(this.buf,t,this.pos);let i=this.pos-n;i>=128&&Nn(n,i,this),this.pos=n-1,this.writeVarint(i),this.pos+=i}writeFloat(t){this.realloc(4),this.dataView.setFloat32(this.pos,t,!0),this.pos+=4}writeDouble(t){this.realloc(8),this.dataView.setFloat64(this.pos,t,!0),this.pos+=8}writeBytes(t){let n=t.length;this.writeVarint(n),this.realloc(n);for(let i=0;i<n;i++)this.buf[this.pos++]=t[i]}writeRawMessage(t,n){this.pos++;let i=this.pos;t(n,this);let o=this.pos-i;o>=128&&Nn(i,o,this),this.pos=i-1,this.writeVarint(o),this.pos+=o}writeMessage(t,n,i){this.writeTag(t,bt),this.writeRawMessage(n,i)}writePackedVarint(t,n){n.length&&this.writeMessage(t,Ho,n)}writePackedSVarint(t,n){n.length&&this.writeMessage(t,zo,n)}writePackedBoolean(t,n){n.length&&this.writeMessage(t,$o,n)}writePackedFloat(t,n){n.length&&this.writeMessage(t,Xo,n)}writePackedDouble(t,n){n.length&&this.writeMessage(t,Yo,n)}writePackedFixed32(t,n){n.length&&this.writeMessage(t,Wo,n)}writePackedSFixed32(t,n){n.length&&this.writeMessage(t,Zo,n)}writePackedFixed64(t,n){n.length&&this.writeMessage(t,Ko,n)}writePackedSFixed64(t,n){n.length&&this.writeMessage(t,Qo,n)}writeBytesField(t,n){this.writeTag(t,bt),this.writeBytes(n)}writeFixed32Field(t,n){this.writeTag(t,Pt),this.writeFixed32(n)}writeSFixed32Field(t,n){this.writeTag(t,Pt),this.writeSFixed32(n)}writeFixed64Field(t,n){this.writeTag(t,It),this.writeFixed64(n)}writeSFixed64Field(t,n){this.writeTag(t,It),this.writeSFixed64(n)}writeVarintField(t,n){this.writeTag(t,en),this.writeVarint(n)}writeSVarintField(t,n){this.writeTag(t,en),this.writeSVarint(n)}writeStringField(t,n){this.writeTag(t,bt),this.writeString(n)}writeFloatField(t,n){this.writeTag(t,Pt),this.writeFloat(n)}writeDoubleField(t,n){this.writeTag(t,It),this.writeDouble(n)}writeBooleanField(t,n){this.writeVarintField(t,+n)}};function No(e,t,n){let i=n.buf,o,r;if(r=i[n.pos++],o=(r&112)>>4,r<128||(r=i[n.pos++],o|=(r&127)<<3,r<128)||(r=i[n.pos++],o|=(r&127)<<10,r<128)||(r=i[n.pos++],o|=(r&127)<<17,r<128)||(r=i[n.pos++],o|=(r&127)<<24,r<128)||(r=i[n.pos++],o|=(r&1)<<31,r<128))return et(e,o,t);throw new Error("Expected varint not more than 10 bytes")}function et(e,t,n){return n?t*4294967296+(e>>>0):(t>>>0)*4294967296+(e>>>0)}function Uo(e,t){let n,i;if(e>=0?(n=e%4294967296|0,i=e/4294967296|0):(n=~(-e%4294967296),i=~(-e/4294967296),n^4294967295?n=n+1|0:(n=0,i=i+1|0)),e>=18446744073709552e3||e<-18446744073709552e3)throw new Error("Given varint doesn\'t fit into 10 bytes");t.realloc(10),Go(n,i,t),jo(i,t)}function Go(e,t,n){n.buf[n.pos++]=e&127|128,e>>>=7,n.buf[n.pos++]=e&127|128,e>>>=7,n.buf[n.pos++]=e&127|128,e>>>=7,n.buf[n.pos++]=e&127|128,e>>>=7,n.buf[n.pos]=e&127}function jo(e,t){let n=(e&7)<<4;t.buf[t.pos++]|=n|((e>>>=3)?128:0),e&&(t.buf[t.pos++]=e&127|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=e&127|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=e&127|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=e&127|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=e&127)))))}function Nn(e,t,n){let i=t<=16383?1:t<=2097151?2:t<=268435455?3:Math.floor(Math.log(t)/(Math.LN2*7));n.realloc(i);for(let o=n.pos-1;o>=e;o--)n.buf[o+i]=n.buf[o]}function Ho(e,t){for(let n=0;n<e.length;n++)t.writeVarint(e[n])}function zo(e,t){for(let n=0;n<e.length;n++)t.writeSVarint(e[n])}function Xo(e,t){for(let n=0;n<e.length;n++)t.writeFloat(e[n])}function Yo(e,t){for(let n=0;n<e.length;n++)t.writeDouble(e[n])}function $o(e,t){for(let n=0;n<e.length;n++)t.writeBoolean(e[n])}function Wo(e,t){for(let n=0;n<e.length;n++)t.writeFixed32(e[n])}function Zo(e,t){for(let n=0;n<e.length;n++)t.writeSFixed32(e[n])}function Ko(e,t){for(let n=0;n<e.length;n++)t.writeFixed64(e[n])}function Qo(e,t){for(let n=0;n<e.length;n++)t.writeSFixed64(e[n])}function Jo(e,t,n){let i="",o=t;for(;o<n;){let r=e[o],s=null,u=r>239?4:r>223?3:r>191?2:1;if(o+u>n)break;let l,c,f;u===1?r<128&&(s=r):u===2?(l=e[o+1],(l&192)===128&&(s=(r&31)<<6|l&63,s<=127&&(s=null))):u===3?(l=e[o+1],c=e[o+2],(l&192)===128&&(c&192)===128&&(s=(r&15)<<12|(l&63)<<6|c&63,(s<=2047||s>=55296&&s<=57343)&&(s=null))):u===4&&(l=e[o+1],c=e[o+2],f=e[o+3],(l&192)===128&&(c&192)===128&&(f&192)===128&&(s=(r&15)<<18|(l&63)<<12|(c&63)<<6|f&63,(s<=65535||s>=1114112)&&(s=null))),s===null?(s=65533,u=1):s>65535&&(s-=65536,i+=String.fromCharCode(s>>>10&1023|55296),s=56320|s&1023),i+=String.fromCharCode(s),o+=u}return i}function qo(e,t,n){for(let i=0,o,r;i<t.length;i++){if(o=t.charCodeAt(i),o>55295&&o<57344)if(r)if(o<56320){e[n++]=239,e[n++]=191,e[n++]=189,r=o;continue}else o=r-55296<<10|o-56320|65536,r=null;else{o>56319||i+1===t.length?(e[n++]=239,e[n++]=191,e[n++]=189):r=o;continue}else r&&(e[n++]=239,e[n++]=191,e[n++]=189,r=null);o<128?e[n++]=o:(o<2048?e[n++]=o>>6|192:(o<65536?e[n++]=o>>12|224:(e[n++]=o>>18|240,e[n++]=o>>12&63|128),e[n++]=o>>6&63|128),e[n++]=o&63|128)}return n}var tn=class e{constructor(t,n,i,o){this.pbf=t;this.keys=n;this.values=i;this.extent=o;this.type=0;this.properties={};this.geomOffset=-1}static read(t,n,i,o,r){let s=new e(t,i,o,r);return t.readFields(ei,s,n),s}loadGeometry(){if(this.geomOffset<0)return[];let t=this.pbf,n=t.pos;t.pos=this.geomOffset;let i=t.readVarint()+t.pos,o=1,r=0,s=0,u=0,l=[],c=[];for(;t.pos<i;){if(r<=0){let f=t.readVarint();o=f&7,r=f>>3}if(r--,o===1||o===2)s+=t.readSVarint(),u+=t.readSVarint(),o===1&&(c.length&&l.push(c),c=[]),c.push(s,u);else if(o===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: ${o}`)}return c.length&&l.push(c),t.pos=n,l}bbox(){let t=this.loadGeometry(),n=1/0,i=1/0,o=-1/0,r=-1/0;for(let s of t)for(let u=0;u<s.length;u+=2)s[u]<n&&(n=s[u]),s[u]>o&&(o=s[u]),s[u+1]<i&&(i=s[u+1]),s[u+1]>r&&(r=s[u+1]);return[n,i,o,r]}};function ei(e,t,n){n&&(e===1?t.id=n.readVarint():e===2?ti(n,t):e===3?t.type=n.readVarint():e===4&&(t.geomOffset=n.pos,n.skip(2)))}function ti(e,t){let n=e.readVarint()+e.pos;for(;e.pos<n;){let i=t.keys[e.readVarint()],o=t.values[e.readVarint()];i!==void 0&&(t.properties[i]=o)}}var nn=class e{constructor(t){this.pbf=t;this.version=1;this.name="";this.extent=4096;this.featureOffsets=[];this.keys=[];this.values=[]}static read(t,n){let i=new e(t);return t.readFields(ni,i,n),i}get length(){return this.featureOffsets.length}feature(t){let n=this.pbf;n.pos=this.featureOffsets[t];let i=n.readVarint()+n.pos;return tn.read(n,i,this.keys,this.values,this.extent)}*features(){for(let t=0;t<this.featureOffsets.length;t++)yield this.feature(t)}};function ni(e,t,n){n&&(e===15?t.version=n.readVarint():e===1?t.name=n.readString():e===5?t.extent=n.readVarint():e===2?t.featureOffsets.push(n.pos):e===3?t.keys.push(n.readString()):e===4&&t.values.push(ri(n)))}function ri(e){let t=e.readVarint()+e.pos,n=null;for(;e.pos<t;){let i=e.readVarint()>>3;i===1?n=e.readString():i===2?n=e.readFloat():i===3?n=e.readDouble():i===4?n=e.readVarint64():i===5?n=e.readVarint():i===6?n=e.readSVarint():i===7?n=e.readBoolean():e.skip(i)}return n}var Lt=class{constructor(t){this.layers={};new gt(t instanceof Uint8Array?t:new Uint8Array(t)).readFields((i,o,r)=>{if(i===3&&r){let s=nn.read(r,r.readVarint()+r.pos);s.length&&(this.layers[s.name]=s)}},null)}};function tt(e){let t=[],n=null;for(let i of e){if(i.length<6)continue;let o=oi(i);o!==0&&(o>0?(n&&t.push(n),n={outer:i,holes:[]}):n&&n.holes.push(i))}return n&&t.push(n),t}function oi(e){let t=0;for(let n=0,i=e.length-2;n<e.length;i=n,n+=2)t+=(e[i]-e[n])*(e[n+1]+e[i+1]);return t/2}function Qe(e){let t=e.trim();if(t[0]==="#"){let i=t.slice(1);if(i.length===3||i.length===4){let o=i.split("").map(r=>parseInt(r+r,16)/255);return[o[0],o[1],o[2],o.length===4?o[3]:1]}if(i.length===6||i.length===8){let o=[];for(let r=0;r<i.length;r+=2)o.push(parseInt(i.slice(r,r+2),16)/255);return[o[0],o[1],o[2],o.length===4?o[3]:1]}}let n=t.match(/^rgba?\\(([^)]+)\\)$/i);if(n){let i=n[1].split(",").map(o=>parseFloat(o));if(i.length>=3)return[i[0]/255,i[1]/255,i[2]/255,i.length>3?i[3]:1]}return[1,0,1,1]}function Bt(e){return Array.isArray(e)&&typeof e[0]=="string"}var Un=new WeakMap;function nt(e,t){if(!Bt(e))return e;let n=Un.get(e);n||(n=Hn(e),Un.set(e,n));try{return n(t)}catch{return null}}var Gn=new WeakMap,ii=new Set(["get","has","id","geometry-type","properties","feature-state","within"]);function Je(e){if(!Array.isArray(e))return!1;let t=Gn.get(e);if(t!==void 0)return t;let n=typeof e[0]=="string"&&ii.has(e[0]);if(!n){for(let i of e)if(Je(i)){n=!0;break}}return Gn.set(e,n),n}function Tt(e,t){let n=nt(e,t);return typeof n=="string"?Qe(n):Ct(n)?[n.r,n.g,n.b,n.a]:null}function Ct(e){return!!e&&typeof e=="object"&&"r"in e&&"a"in e}function _t(e){if(Ct(e))return e;if(typeof e=="string"){let[t,n,i,o]=Qe(e);return{r:t,g:n,b:i,a:o}}return null}var $=e=>typeof e=="number"?e:Number(e),Ae=e=>e===null?"":Ct(e)?`rgba(${e.r},${e.g},${e.b},${e.a})`:typeof e=="string"?e:JSON.stringify(e),xt=e=>!(e===null||e===!1||e===0||e==="");function De(e,t){if(typeof e=="number"&&typeof t=="number")return e-t;let n=Ae(e),i=Ae(t);return n<i?-1:n>i?1:0}function Hn(e){let t=e[0],n=e.slice(1),i=r=>{let s=n[r];return Bt(s)?Hn(s):()=>s},o=n.map((r,s)=>i(s));switch(t){case"get":{let r=i(0),s=n.length>1?i(1):null;return u=>(s?s(u):u.properties)?.[Ae(r(u))]??null}case"has":{let r=i(0),s=n.length>1?i(1):null;return u=>{let l=s?s(u):u.properties;return!!l&&l[Ae(r(u))]!=null}}case"properties":return r=>r.properties??{};case"id":return r=>r.id??null;case"geometry-type":return r=>r.geometryType??null;case"feature-state":{let r=i(0);return s=>s.featureState?.[Ae(r(s))]??null}case"global-state":{let r=i(0);return s=>s.globalState?.[Ae(r(s))]??null}case"zoom":return r=>r.zoom??0;case"literal":return()=>n[0];case"array":return r=>o[o.length-1](r);case"to-string":return r=>Ae(o[0](r));case"to-number":return r=>{for(let s of o){let u=Number(s(r));if(Number.isFinite(u))return u}return 0};case"to-boolean":return r=>xt(o[0](r));case"to-color":return r=>_t(o[0](r))??null;case"typeof":return r=>{let s=o[0](r);return s===null?"null":Array.isArray(s)?"array":Ct(s)?"color":typeof s};case"rgb":case"rgba":return r=>({r:$(o[0](r))/255,g:$(o[1](r))/255,b:$(o[2](r))/255,a:o[3]?$(o[3](r)):1});case"to-rgba":return r=>{let s=_t(o[0](r));return s?[s.r*255,s.g*255,s.b*255,s.a]:null};case"case":return r=>{for(let s=0;s+1<o.length;s+=2)if(xt(o[s](r)))return o[s+1](r);return o.length%2===1?o[o.length-1](r):null};case"match":return r=>{let s=o[0](r);for(let u=1;u+1<o.length;u+=2){let l=n[u];if(Array.isArray(l)?l.some(f=>De(f,s)===0):De(l,s)===0)return o[u+1](r)}return o.length%2===0?o[o.length-1](r):null};case"coalesce":return r=>{for(let s of o){let u=s(r);if(u!=null)return u}return null};case"all":return r=>o.every(s=>xt(s(r)));case"any":return r=>o.some(s=>xt(s(r)));case"!":return r=>!xt(o[0](r));case"==":return r=>De(o[0](r),o[1](r))===0;case"!=":return r=>De(o[0](r),o[1](r))!==0;case"<":return r=>De(o[0](r),o[1](r))<0;case"<=":return r=>De(o[0](r),o[1](r))<=0;case">":return r=>De(o[0](r),o[1](r))>0;case">=":return r=>De(o[0](r),o[1](r))>=0;case"in":return r=>{let s=o[0](r),u=o[1](r);return typeof u=="string"?u.includes(Ae(s)):Array.isArray(u)&&u.some(l=>De(l,s)===0)};case"index-of":return r=>{let s=o[0](r),u=o[1](r);return typeof u=="string"?u.indexOf(Ae(s)):Array.isArray(u)?u.findIndex(l=>De(l,s)===0):-1};case"step":return r=>{let s=$(o[0](r)),u=o[1](r);for(let l=2;l+1<o.length&&s>=$(o[l](r));l+=2)u=o[l+1](r);return u};case"interpolate":case"interpolate-hcl":case"interpolate-lab":{let r=n[0],s=i(1),u=[];for(let l=2;l+1<n.length;l+=2)u.push({at:i(l),value:i(l+1)});return l=>{let c=$(s(l));if(!u.length)return null;if(c<=$(u[0].at(l)))return u[0].value(l);let f=u[u.length-1];if(c>=$(f.at(l)))return f.value(l);for(let p=1;p<u.length;p++){let m=$(u[p].at(l));if(c>m)continue;let g=$(u[p-1].at(l)),y=si(r,g,m,c);return zn(u[p-1].value(l),u[p].value(l),y)}return f.value(l)}}case"+":return r=>o.reduce((s,u)=>s+$(u(r)),0);case"*":return r=>o.reduce((s,u)=>s*$(u(r)),1);case"-":return r=>o.length===1?-$(o[0](r)):$(o[0](r))-$(o[1](r));case"/":return r=>$(o[0](r))/$(o[1](r));case"%":return r=>$(o[0](r))%$(o[1](r));case"^":return r=>Math.pow($(o[0](r)),$(o[1](r)));case"abs":return r=>Math.abs($(o[0](r)));case"ceil":return r=>Math.ceil($(o[0](r)));case"floor":return r=>Math.floor($(o[0](r)));case"round":return r=>Math.round($(o[0](r)));case"sqrt":return r=>Math.sqrt($(o[0](r)));case"ln":return r=>Math.log($(o[0](r)));case"ln2":return()=>Math.LN2;case"log10":return r=>Math.log10($(o[0](r)));case"log2":return r=>Math.log2($(o[0](r)));case"sin":return r=>Math.sin($(o[0](r)));case"cos":return r=>Math.cos($(o[0](r)));case"tan":return r=>Math.tan($(o[0](r)));case"asin":return r=>Math.asin($(o[0](r)));case"acos":return r=>Math.acos($(o[0](r)));case"atan":return r=>Math.atan($(o[0](r)));case"e":return()=>Math.E;case"pi":return()=>Math.PI;case"min":return r=>Math.min(...o.map(s=>$(s(r))));case"max":return r=>Math.max(...o.map(s=>$(s(r))));case"random":return r=>{let s=o.length>0?$(o[0](r)):0,u=o.length>1?$(o[1](r)):1;return s+Math.random()*(u-s)};case"concat":return r=>o.map(s=>Ae(s(r))).join("");case"downcase":return r=>Ae(o[0](r)).toLowerCase();case"upcase":return r=>Ae(o[0](r)).toUpperCase();case"length":return r=>{let s=o[0](r);return typeof s=="string"?[...s].length:Array.isArray(s)?s.length:0};case"at":return r=>{let s=$(o[0](r)),u=o[1](r);return Array.isArray(u)?u[s]??null:null};case"slice":return r=>{let s=o[0](r),u=$(o[1](r)),l=o.length>2?$(o[2](r)):void 0;return typeof s=="string"||Array.isArray(s)?s.slice(u,l):null};case"number-format":return r=>{let s=$(o[0](r)),u=n[1]??{};return new Intl.NumberFormat(u.locale??void 0,{minimumFractionDigits:u["min-fraction-digits"],maximumFractionDigits:u["max-fraction-digits"],currency:u.currency,style:u.currency?"currency":void 0}).format(s)};case"let":{let r=[],s=[];for(let l=0;l+1<n.length-1;l+=2)r.push(n[l]),s.push(i(l+1));let u=i(n.length-1);return l=>{let c={...l.vars};return r.forEach((f,p)=>{c[f]=s[p](l)}),u({...l,vars:c})}}case"var":{let r=n[0];return s=>s.vars?.[r]??null}case"within":{let r=n[0];return s=>{let u=s.point;if(!u||!r?.coordinates)return!1;let l=r.type==="MultiPolygon"?r.coordinates.flat():r.coordinates,c=!1;for(let f of l)for(let p=0,m=f.length-1;p<f.length;m=p++){let[g,y]=f[p],[w,E]=f[m];y>u[1]!=E>u[1]&&u[0]<(w-g)*(u[1]-y)/(E-y)+g&&(c=!c)}return c}}default:return()=>(jn.has(t)||(jn.add(t),console.warn(`[osmgl] \\u0432\\u044B\\u0440\\u0430\\u0436\\u0435\\u043D\\u0438\\u0435 \\xAB${t}\\xBB \\u043F\\u043E\\u043A\\u0430 \\u043D\\u0435 \\u043F\\u043E\\u0434\\u0434\\u0435\\u0440\\u0436\\u0430\\u043D\\u043E`)),null)}}var jn=new Set;function si(e,t,n,i){let o=n-t,r=o===0?0:(i-t)/o;if(!Array.isArray(e))return r;let s=e[0];if(s==="exponential"){let u=Number(e[1]??1);return u===1||o===0?r:(Math.pow(u,i-t)-1)/(Math.pow(u,o)-1)}if(s==="cubic-bezier"){let[,u,l,c,f]=e;return ui(u,l,c,f,r)}return r}function ui(e,t,n,i,o){let r=3*e,s=3*(n-e)-r,u=1-r-s,l=3*t,c=3*(i-t)-l,f=1-l-c,p=o;for(let m=0;m<8;m++){let g=((u*p+s)*p+r)*p-o;if(Math.abs(g)<1e-5)break;let y=(3*u*p+2*s)*p+r;if(Math.abs(y)<1e-6)break;p-=g/y}return((f*p+c)*p+l)*p}function zn(e,t,n){if(typeof e=="number"&&typeof t=="number")return e+(t-e)*n;let i=_t(e),o=_t(t);return i&&o?{r:i.r+(o.r-i.r)*n,g:i.g+(o.g-i.g)*n,b:i.b+(o.b-i.b)*n,a:i.a+(o.a-i.a)*n}:Array.isArray(e)&&Array.isArray(t)?e.map((r,s)=>zn(r,t[s]??r,n)):n<.5?e:t}var Yn={};function $n(e,t,n){if(e===void 0)return n;if(typeof e=="string")return Qe(e);if(Bt(e))return ci(e),Tt(e,{zoom:t,globalState:Yn})??n;let i=e.stops;return hi(i,t,(o,r,s)=>{let u=Qe(o),l=Qe(r);return[u[0]+(l[0]-u[0])*s,u[1]+(l[1]-u[1])*s,u[2]+(l[2]-u[2])*s,u[3]+(l[3]-u[3])*s]},n)}var Xn=new WeakSet,li=new WeakSet;function ci(e){li.has(e)||!Je(e)||Xn.has(e)||(Xn.add(e),console.warn("[osmgl] \\u0432\\u044B\\u0440\\u0430\\u0436\\u0435\\u043D\\u0438\\u0435 \\u0441\\u043C\\u043E\\u0442\\u0440\\u0438\\u0442 \\u043D\\u0430 \\u0444\\u0438\\u0447\\u0443, \\u0430 \\u044D\\u0442\\u043E \\u0437\\u043D\\u0430\\u0447\\u0435\\u043D\\u0438\\u0435 \\u0441\\u0447\\u0438\\u0442\\u0430\\u0435\\u0442\\u0441\\u044F \\u0440\\u0430\\u0437 \\u043D\\u0430 \\u0441\\u043B\\u043E\\u0439 \\u2014 \\u043E\\u043D\\u043E \\u0431\\u0443\\u0434\\u0435\\u0442 \\u0437\\u0430\\u043F\\u0430\\u0441\\u043D\\u044B\\u043C. \\u041D\\u0430 \\u0444\\u0438\\u0447\\u0435 \\u0441\\u0447\\u0438\\u0442\\u0430\\u044E\\u0442\\u0441\\u044F \\u0446\\u0432\\u0435\\u0442, \\u043F\\u0440\\u043E\\u0437\\u0440\\u0430\\u0447\\u043D\\u043E\\u0441\\u0442\\u044C \\u0438 \\u0448\\u0438\\u0440\\u0438\\u043D\\u0430 \\u043B\\u0438\\u043D\\u0438\\u0438; \\u0441\\u043C. porting/maplibre-api.md, \\u0444\\u0430\\u0437\\u0430 7\\u0431.",e))}function ai(e){let t=e[0];return fi.has(t)?t==="all"||t==="any"||t==="!"?!1:Array.isArray(e[1]):!0}var fi=new Set(["==","!=",">",">=","<","<=","in","!in","has","!has","all","any","!"]);function hi(e,t,n,i){if(!e.length)return i;if(t<=e[0][0])return n(e[0][1],e[0][1],0);let o=e[e.length-1];if(t>=o[0])return n(o[1],o[1],0);for(let r=1;r<e.length;r++){let[s,u]=e[r];if(t>s)continue;let[l,c]=e[r-1],f=s-l,p=f===0?0:(t-l)/f;return n(c,u,p)}return i}function pe(e,t,n){if(!e)return!0;let i=e[0];if(ai(e))return nt(e,{properties:t,id:n?.id??null,geometryType:n?.geometryType,featureState:n?.featureState,globalState:Yn})===!0;switch(i){case"all":return e.slice(1).every(o=>pe(o,t));case"any":return e.slice(1).some(o=>pe(o,t));case"!":return!pe(e[1],t);case"has":return t[e[1]]!=null;case"!has":return t[e[1]]==null;case"in":{let o=t[e[1]];return o==null?!1:e.slice(2).includes(o)}case"!in":{let o=t[e[1]];return o==null?!0:!e.slice(2).includes(o)}default:{let o=t[e[1]],r=e[2];if(o==null)return i==="!=";switch(i){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!0}}}}var mi=Math.PI/8,pi=.35,di=32,Zn=.25,Kn=.5,Qn=.07;function je(e,t){let n=t.radius;if(!(n>0))return e;let i=e.length/2-1;if(i<3)return e;let o=Math.max(2,Math.round(t.segments??4)),r=Math.max(t.minCutRatio??pi,0),s=t.extent,u=[];for(let l=0;l<i;l++){let c=e[l*2],f=e[l*2+1],p=e[(l+i-1)%i*2],m=e[(l+i-1)%i*2+1],g=e[(l+1)%i*2],y=e[(l+1)%i*2+1],w=c-p,E=f-m,S=g-c,B=y-f,L=Math.hypot(w,E),A=Math.hypot(S,B);if(L<1e-6||A<1e-6){u.push(c,f);continue}let U=w/L,V=E/L,D=S/A,j=B/A;if(t.keep?.[l]){u.push(c,f);continue}let O=U*D+V*j;if(O>.985){u.push(c,f);continue}if(s!==void 0&&(c<=0||c>=s||f<=0||f>=s)){u.push(c,f);continue}let z=Math.min(n,L*Wn,A*Wn);if(z<n*r){u.push(c,f);continue}let G=c-U*z,te=f-V*z,ie=c+D*z,J=f+j*z,X=Math.acos(Math.max(-1,Math.min(1,O))),W=Math.min(mi,Math.PI/2/o),re=Math.ceil(X/W-1e-6),Q=t.maxChord&&t.maxChord>0?Math.ceil(z/Math.tan(X/2)*X/t.maxChord):0,T=Math.max(1,Math.min(di,Math.max(Math.min(o,re),Q)));u.push(G,te);for(let N=1;N<T;N++){let ee=N/T,Z=1-ee;u.push(Z*Z*G+2*Z*ee*c+ee*ee*ie,Z*Z*te+2*Z*ee*f+ee*ee*J)}u.push(ie,J)}return u.length<6?e:(u.push(u[0],u[1]),u)}var Wn=.4;var ve=e=>e/64;function He(e,t,n=0){let i=Jn(e.outer,t,n);if(!i)return null;let o=[];for(let r of e.holes){let s=Jn(r,t,n);s&&o.push(s)}return{outer:i,holes:o}}function Jn(e,t,n){let i=[];for(let o=0;o<e.length-2;o+=2)i.push(e[o],e[o+1]);if(i.length<6)return null;for(let o=0;o<4;o++){let r=i;i=[];let s=r.length/2;if(s===0)return null;for(let u=0;u<s;u++){let l=r[u*2],c=r[u*2+1],f=r[(u+s-1)%s*2],p=r[(u+s-1)%s*2+1],m=qn(l,c,o,t,n),g=qn(f,p,o,t,n);if(m!==g){let y=bi(f,p,l,c,o,t,n),w=o===0?-n:o===1?t+n:f+(l-f)*y,E=o===2?-n:o===3?t+n:p+(c-p)*y;i.push(w,E)}m&&i.push(l,c)}}return i.length<6?null:(i.push(i[0],i[1]),i)}function qn(e,t,n,i,o){return n===0?e>=-o:n===1?e<=i+o:n===2?t>=-o:t<=i+o}function bi(e,t,n,i,o,r,s){return o===0?(-s-e)/(n-e):o===1?(r+s-e)/(n-e):o===2?(-s-t)/(i-t):(r+s-t)/(i-t)}function Vt(e,t,n,i,o,r=0){let s=-r,u=o+r;return e===s&&n===s||e===u&&n===u||t===s&&i===s||t===u&&i===u}function rn(e,t){for(let n=0;n<e.length;n+=2)if(e[n]<=0||e[n]>=t||e[n+1]<=0||e[n+1]>=t)return!0;return!1}var er=1,un=18,ln=32,tr=8,cr=65535/ln,gi=9,xi=1,yi=0,wi=1,Mi=2;var nr=0,vi=1,rr=2,Si=3,Ri=.47;function ar(e,t,n,i={},o){let r=i.metersPerUnit&&i.metersPerUnit>0?i.metersPerUnit:Ri,{b:s,ensure:u,take:l}=Ei(Math.max(1024,e.length*48));for(let c of e.features()){if(c.type!==3||!pe(n,c.properties))continue;let f=Yi(c.properties),p=$i(c.properties,f);if(f<=p)continue;let m=Zi(c.properties)??Number(c.id??0),g=Xi(m>>>0),y=zi(g,c.properties),w=Hi(c.properties,f);i.paint?.setFeature(c.properties,c.id??null,"Polygon");let E=tt(c.loadGeometry()),S=o?E.some(B=>{let L=He(B,t,ve(t));return L?rn(L.outer,t):!1}):!1;for(let B of E){if(o&&S){let L=Ji(B,t,f,p,m,g,y,w);L&&o.push(L)}Ki(s,B,u,{extent:t,metersPerUnit:r,height:f,minHeight:p,featureId:m,seed:g,tint:y,facade:w,props:c.properties,cornerRadius:i.cornerRadius??0,cornerSegments:i.cornerSegments,whole:!1})}i.paint?.advanceTo(s.vertexCount)}return l(t,i.paint)}function Ei(e){let t=e,n=new ArrayBuffer(t*un),i={verts:new DataView(n),vertsU8:new Uint8Array(n),vertOffset:0,vertexCount:0,indices:[],featureIds:[],ensure:()=>{}},o=s=>{if(i.vertexCount+s<=t)return;t=Math.max(t*2,i.vertexCount+s);let u=new ArrayBuffer(t*un);new Uint8Array(u).set(i.vertsU8.subarray(0,i.vertOffset)),n=u,i.verts=new DataView(u),i.vertsU8=new Uint8Array(u)};return i.ensure=o,{b:i,ensure:o,take:(s,u)=>{if(!i.indices.length)return null;let l=new Uint32Array(i.indices),c=new Float64Array(i.featureIds);return{vertices:n.slice(0,i.vertOffset),indices:l.buffer,featureIds:c.buffer,vertexCount:i.vertexCount,indexCount:l.length,extent:s,...u?{dataPaint:u.take(i.vertexCount)}:{}}}}}var cn=(e,t)=>e|t<<2,or=e=>Math.max(-32768,Math.min(32767,e)),on=e=>Math.max(0,Math.min(65535,Math.round(Math.min(e,cr)*ln)));function rt(e,t,n,i,o,r,s,u,l,c,f=0,p=0,m=0){let g=e.vertOffset;return e.verts.setInt16(g,or(Math.round(t*tr)),!0),e.verts.setInt16(g+2,or(Math.round(n*tr)),!0),e.verts.setUint16(g+4,Math.round(Math.min(i,cr)*ln),!0),e.vertsU8[g+6]=l,e.vertsU8[g+7]=u,e.verts.setInt8(g+8,sn(Math.round(o*127))),e.verts.setInt8(g+9,sn(Math.round(r*127))),e.verts.setInt8(g+10,sn(Math.round(s*127))),e.vertsU8[g+11]=c,e.verts.setUint16(g+12,on(f),!0),e.verts.setUint16(g+14,on(p),!0),e.verts.setUint16(g+16,on(m),!0),e.vertOffset+=un,e.vertexCount++}function ir(e,t,n,i,o,r,s,u,l,c){let f=t.length/2;if(f<3)return;let p=cn(yi,s),m=ki(t,u),g=i-n,y=new Float64Array(f*2),w=new Uint8Array(f);{let E=new Float64Array(f*2);for(let S=0;S<f-1;S++){let B=t[S*2+2]-t[S*2],L=t[S*2+3]-t[S*2+1],A=Math.hypot(B,L)||1;E[S*2]=L/A,E[S*2+1]=-B/A}for(let S=0;S<f-1;S++){let B=(S+f-2)%(f-1),L=E[B*2]*E[S*2]+E[B*2+1]*E[S*2+1],A=E[B*2]+E[S*2],U=E[B*2+1]+E[S*2+1],V=Math.hypot(A,U);L>.5&&V>1e-6&&(y[S*2]=A/V,y[S*2+1]=U/V,w[S]=1)}}for(let E=0;E<f-1;E++){let S=t[E*2],B=t[E*2+1],L=t[E*2+2],A=t[E*2+3];if(S===L&&B===A||c[E])continue;let U=L-S,V=A-B,D=Math.hypot(U,V)||1,j=V/D,O=-U/D,z=m.offset[E],G=m.width[E],te=[0,1];if(l){for(let J=0;J<l.length;J++)for(let X=J+1;X<l.length;X++){let W=qe(l[J],S,B)-qe(l[X],S,B),re=qe(l[J],L,A)-qe(l[X],L,A);if(W===re)continue;let Q=W/(W-re);Q>1e-4&&Q<1-1e-4&&te.push(Q)}te.sort((J,X)=>J-X)}let ie=(J,X)=>{if(!l)return i;let W=1/0;for(let re of l)W=Math.min(W,qe(re,J,X));return Math.max(i,W)};for(let J=0;J+1<te.length;J++){let X=te[J],W=te[J+1];if(W-X<1e-6)continue;let re=S+U*X,Q=B+V*X,T=S+U*W,N=B+V*W,ee=z+D*X*u,Z=z+D*W*u,oe=(E+1)%(f-1),de=w[E]?y[E*2]:j,be=w[E]?y[E*2+1]:O,se=w[oe]?y[oe*2]:j,Ie=w[oe]?y[oe*2+1]:O,Ne=j+(de-j)*(1-X),ce=O+(be-O)*(1-X),Me=j+(se-j)*W,Se=O+(Ie-O)*W,ne=Math.hypot(Ne,ce)||1,he=Math.hypot(Me,Se)||1,me=Ne/ne,Pe=ce/ne,Le=Me/he,Oe=Se/he;e.ensure(4);let Ee=rt(e,re,Q,n,me,Pe,0,0,r,p,ee,G,g),Ue=rt(e,T,N,n,Le,Oe,0,0,r,p,Z,G,g),ze=rt(e,re,Q,ie(re,Q),me,Pe,0,255,r,p,ee,G,g),We=rt(e,T,N,ie(T,N),Le,Oe,0,255,r,p,Z,G,g);e.indices.push(Ee,We,Ue,Ee,ze,We),e.featureIds.push(o,o)}}}var Fi=.9976;function ki(e,t){let n=e.length/2-1,i=[];for(let l=0;l<n;l++){let c=e[l*2+2]-e[l*2],f=e[l*2+3]-e[l*2+1],p=Math.hypot(c,f);i.push(p>0?{x:c/p,y:f/p,len:p*t}:{x:0,y:0,len:0})}let o=(l,c)=>i[l].len>0&&i[c].len>0&&i[l].x*i[c].x+i[l].y*i[c].y>=Fi,r=0;for(;r<n&&o((r-1+n)%n,r);)r++;r>=n&&(r=0);let s=new Array(n).fill(0),u=new Array(n).fill(0);for(let l=0;l<n;){let c=(r+l)%n,f=[c],p=i[c].len,m=l+1;for(;m<n;){let y=(r+m)%n;if(!o((r+m-1)%n,y))break;f.push(y),p+=i[y].len,m++}let g=0;for(let y of f)s[y]=g,u[y]=p,g+=i[y].len;l=m}return{offset:s,width:u}}function Ai(e,t,n,i,o,r,s){let u=[],l=[];for(let m=0;m<t.length;m++)u.push(t[m]);for(let m of n){l.push(u.length/2);for(let g=0;g<m.length;g++)u.push(m[g])}let c=Xe(u,l.length?l:void 0,2);if(!c.length)return;let f=cn(wi,s),p=e.vertexCount;for(let m=0;m<u.length;m+=2)rt(e,u[m],u[m+1],i,0,0,1,255,r,f);for(let m=0;m<c.length;m+=3)e.indices.push(p+c[m],p+c[m+2],p+c[m+1]),e.featureIds.push(o)}function Ii(e){let t=Pi(e);if(t.length<3)return null;let n=Math.abs(Li(e));if(n<=0)return null;let i=null,o=1/0;for(let r=0;r<t.length;r++){let s=(r+1)%t.length,u=t[s].x-t[r].x,l=t[s].y-t[r].y,c=Math.hypot(u,l);if(c<1e-6)continue;u/=c,l/=c;let f=1/0,p=-1/0,m=1/0,g=-1/0;for(let A of t){let U=A.x*u+A.y*l,V=-A.x*l+A.y*u;U<f&&(f=U),U>p&&(p=U),V<m&&(m=V),V>g&&(g=V)}let y=p-f,w=g-m,E=y*w;if(E<=0||E>=o)continue;o=E;let S=(f+p)/2,B=(m+g)/2,L=y>=w;i={cx:S*u-B*l,cy:S*l+B*u,ax:L?u:-l,ay:L?l:u,halfLong:(L?y:w)/2,halfShort:(L?w:y)/2,fill:n/E}}return i}function Pi(e){let t=[];for(let r=0;r<e.length-2;r+=2)t.push({x:e[r],y:e[r+1]});if(t.length<3)return t;t.sort((r,s)=>r.x===s.x?r.y-s.y:r.x-s.x);let n=(r,s,u)=>(s.x-r.x)*(u.y-r.y)-(s.y-r.y)*(u.x-r.x),i=[];for(let r of t){for(;i.length>=2&&n(i[i.length-2],i[i.length-1],r)<=0;)i.pop();i.push(r)}let o=[];for(let r=t.length-1;r>=0;r--){let s=t[r];for(;o.length>=2&&n(o[o.length-2],o[o.length-1],s)<=0;)o.pop();o.push(s)}return i.pop(),o.pop(),i.concat(o)}function Li(e){let t=0;for(let n=0;n<e.length-2;n+=2)t+=e[n]*e[n+3]-e[n+2]*e[n+1];return t/2}var _i=Math.tan(30*Math.PI/180),Bi=3.5,Ti=.9;function Ci(e,t,n,i,o){if(t.fill<.86)return null;let r=t.halfShort*2*o,s=t.halfLong*2*o,u=r*s,l=t.halfShort>0?t.halfLong/t.halfShort:99,c=Vi(e);if(!c){if(n>15||u>600||r<3)return null;let f=i%1e3/1e3;u<30?c=f<.5?"skillion":"gabled":l<1.25?c=f<.35?"pyramidal":"hipped":c=f<.8?"gabled":"hipped"}return c==="flat"?null:{shape:c}}function Vi(e){let t=String(e.roof_shape??e["roof:shape"]??"").toLowerCase();return t?t==="flat"?"flat":t==="skillion"||t==="lean_to"||t==="shed"?"skillion":t==="hipped"||t==="half-hipped"||t==="gambrel"?"hipped":t==="pyramidal"||t==="dome"||t==="conical"||t==="onion"?"pyramidal":t==="gabled"||t==="mansard"||t==="round"?"gabled":null:null}var qe=(e,t,n)=>e.a*t+e.b*n+e.c;function Oi(e,t,n,i){let o=e.length/2;if(o<3)return[];let r=[],s=u=>[e[u*2],e[u*2+1]];for(let u=0;u<o;u++){let[l,c]=s(u),[f,p]=s((u+o-1)%o),m=t*l+n*c+i,g=t*f+n*p+i;if(m<=0!=g<=0){let y=g/(g-m);r.push(f+(l-f)*y,p+(c-p)*y)}m<=0&&r.push(l,c)}return r}function Di(e,t){let n=.5/Math.max(t,1e-6),i=e.length/2-1;if(i<5)return e;let o=[],r=0;o.push(e[0],e[1]);for(let s=1;s<i;s++){let u=e[r*2],l=e[r*2+1],c=e[s*2],f=e[s*2+1],p=c-u,m=f-l,g=Math.hypot(p,m),y=g>1e-6;if(y){for(let w=r+1;w<s;w++)if(Math.abs((e[w*2]-u)*m-(e[w*2+1]-l)*p)/g>=n){y=!1;break}}y||(o.push(e[(s-1)*2],e[(s-1)*2+1]),r=s-1)}return o.length/2<3?e:(o.push(o[0],o[1]),o)}function fr(e,t,n){let{ax:i,ay:o,halfLong:r}=t;if(n==="skillion"){let l=-o,c=i;return[{a:l,b:c,c:-(l*t.cx+c*t.cy)+t.halfShort}]}let s=[],u=e.length/2-1;for(let l=0;l<u;l++){let c=e[l*2],f=e[l*2+1],p=e[(l+1)%u*2],m=e[(l+1)%u*2+1],g=p-c,y=m-f,w=Math.hypot(g,y);if(w<1e-6||n==="gabled"&&Math.abs((g*i+y*o)/w)<.86)continue;let E=-y/w,S=g/w;s.push({a:E,b:S,c:-(E*c+S*f)})}return!s.length&&r>0?fr(e,t,"hipped"):s}function Ni(e,t){let n=[];for(let o=0;o<t.length-2;o+=2)n.push(t[o],t[o+1]);if(n.length<6)return[];let i=[];for(let o=0;o<e.length;o++){let r=n;for(let s=0;s<e.length&&r.length>=6;s++)s!==o&&(r=Oi(r,e[o].a-e[s].a,e[o].b-e[s].b,e[o].c-e[s].c));i.push(r.length>=6?r:[])}return i}function Ui(e,t){let n=0;for(let i=0;i<t.length;i++){let o=t[i];for(let r=0;r<o.length;r+=2){let s=qe(e[i],o[r],o[r+1]);s>n&&(n=s)}}return n}function Gi(e,t,n){return e.map(i=>({a:i.a*t,b:i.b*t,c:i.c*t+n}))}function ji(e,t,n,i,o,r,s,u){let l=cn(Mi,s);for(let c=0;c<n.length;c++){let f=t[c];if(!f||f.length<6)continue;let p=Xe(f,void 0,2);if(!p.length)continue;let m=-n[c].a/u,g=-n[c].b/u,y=Math.hypot(m,g,1),w={x:m/y,y:g/y,z:1/y};e.ensure(f.length/2);let E=e.vertexCount;for(let S=0;S<f.length;S+=2){let B=Math.max(i,qe(n[c],f[S],f[S+1]));rt(e,f[S],f[S+1],B,w.x,w.y,w.z,255,r,l)}for(let S=0;S<p.length;S+=3)e.indices.push(E+p[S],E+p[S+2],E+p[S+1]),e.featureIds.push(o)}}function Hi(e,t){let n=String(e.class??"").toLowerCase();return n==="industrial"||n==="warehouse"||n==="hangar"||n==="construction"?Si:n==="commercial"||n==="office"||n==="retail"||n==="supermarket"?rr:n==="house"||n==="detached"||n==="garage"||n==="hut"||n==="shed"||t<=7?nr:t>=40?rr:vi}function zi(e,t){let n=String(t.class??""),i=128;return n==="industrial"||n==="warehouse"||n==="construction"?i=96:n==="commercial"||n==="office"||n==="retail"?i=150:(n==="apartments"||n==="residential"||n==="house")&&(i=134),Math.max(0,Math.min(255,i+(e%121-60)))}function Xi(e){let t=e>>>0;return t=(t>>>16^t)*73244475,t=(t>>>16^t)*73244475,t=t>>>16^t,t>>>0}function Yi(e){let t=ot(e.render_height)??ot(e.height)??Wi(e.levels??e.building_levels??e["building:levels"]);return t&&t>0?Math.max(t,xi):gi}function $i(e,t){let n=ot(e.render_min_height)??ot(e.min_height)??ot(e.base)??0;return n>0&&n<t?n:0}function Wi(e){let t=ot(e);return t&&t>0?t*3:null}function ot(e){if(typeof e=="number"&&isFinite(e))return e;if(typeof e=="string"){let t=parseFloat(e);if(isFinite(t))return t}return null}var sn=e=>e>127?127:e<-127?-127:e;function Zi(e){let t=e.osm_id;if(typeof t=="number"&&Number.isFinite(t))return t;if(typeof t=="string"){let n=Number(t);if(Number.isFinite(n))return n}return null}function sr(e,t){let n=e.length/2-1,i=new Array(Math.max(n,0)).fill(!1);if(n<3)return{ring:e,cut:i};let o=(s,u)=>s===0?1:s===t?2:u===0?3:u===t?4:0,r=e.slice();for(let s=0;s<n;s++){let u=e[s*2],l=e[s*2+1],c=o(u,l);if(!c)continue;let f=(s+n-1)%n,p=(s+1)%n,m=o(e[f*2],e[f*2+1])===c,g=o(e[p*2],e[p*2+1])===c;g&&(i[s]=!0);let y=m===g?-1:m?p:f;if(y<0)continue;let w=u-e[y*2],E=l-e[y*2+1],S=Math.hypot(w,E);S<1e-6||(r[s*2]=u+w/S*er,r[s*2+1]=l+E/S*er)}return r[n*2]=r[0],r[n*2+1]=r[1],{ring:r,cut:i}}function Ki(e,t,n,i){let{extent:o,metersPerUnit:r,height:s,minHeight:u,featureId:l,seed:c,tint:f,facade:p}=i,m=i.whole?t:He(t,o,ve(o));if(!m)return;let g=i.cornerRadius/r,y={radius:g,segments:i.cornerSegments,minCutRatio:0,maxChord:r>0?Kn/r:0,...i.whole?{}:{extent:o,margin:ve(o)}},w=g>0?{outer:je(m.outer,y),holes:m.holes.map(G=>je(G,y))}:m,E=i.whole?w:He(w,o);if(!E)return;let S=G=>({ring:G,cut:new Array(Math.max(G.length/2-1,0)).fill(!1)}),B=i.whole?S(E.outer):sr(E.outer,o),L=E.holes.map(G=>i.whole?S(G):sr(G,o)),A={outer:B.ring,holes:L.map(G=>G.ring)},U=i.whole?!0:rn(A.outer,o),V=A.outer.length/2+A.holes.reduce((G,te)=>G+te.length/2,0);n(V*5+32);let D=A.holes.length||U?null:Ii(A.outer),j=D?Ci(i.props,D,s,c,r):null,O=null,z=[];if(j&&D){let G=fr(Di(A.outer,r),D,j.shape);z=Ni(G,A.outer);let te=Ui(G,z);if(te>1e-6){let ie=Math.min(Math.max(te*r*_i,Ti),Bi);O=Gi(G,ie/te,s)}}ir(e,A.outer,u,s,l,f,p,r,O,B.cut);for(let G=0;G<A.holes.length;G++)ir(e,A.holes[G],u,s,l,f,p,r,null,L[G].cut);O?ji(e,z,O,s,l,f,p,r):Ai(e,A.outer,A.holes,s,l,f,p)}function Qi(e,t){let n=1/0,i=1/0,o=-1/0,r=-1/0;for(let s=0;s<e.length;s+=2)e[s]<n&&(n=e[s]),e[s]>o&&(o=e[s]),e[s+1]<i&&(i=e[s+1]),e[s+1]>r&&(r=e[s+1]);return o>0&&n<t&&r>0&&i<t}function ur(e,t){let n=ve(t),i=Math.max(e.length/2-1,0),o=new Array(i);for(let r=0;r<i;r++)o[r]=Vt(e[r*2],e[r*2+1],e[r*2+2],e[r*2+3],t,n);return o}function Ji(e,t,n,i,o,r,s,u){let l=He(e,t,ve(t));if(!l||!Qi(l.outer,t))return null;let c=ur(l.outer,t);return{osmId:o,height:n,minHeight:i,seed:r,tint:s,facade:u,outer:l.outer,holes:l.holes,outerCut:c,holeCuts:l.holes.map(f=>ur(f,t))}}var yt=8;function qi(e){return e?Je(e.color)||Je(e.opacity)||Je(e.width):!1}var an=class{constructor(t,n){this.spec=t;this.zoom=n;this.filled=0;this.r=0;this.g=0;this.b=0;this.a=1;this.width=0;this.capacity=1024,this.buffer=new ArrayBuffer(this.capacity*yt),this.view=new DataView(this.buffer),this.base=t.base!==void 0?$n(t.base,n,[1,0,1,1]):[1,0,1,1],this.setFeature({},null,void 0)}setFeature(t,n,i){let o={zoom:this.zoom,properties:t,id:n,geometryType:i},r=this.spec.color!==void 0?Tt(this.spec.color,o):null,[s,u,l,c]=r??this.base,f=this.spec.opacity!==void 0?hr(nt(this.spec.opacity,o),1):1;this.r=Ot(s),this.g=Ot(u),this.b=Ot(l),this.a=Ot(c*f),this.width=this.spec.width!==void 0?Math.max(hr(nt(this.spec.width,o),0),0):0}advanceTo(t){if(!(t<=this.filled)){this.ensure(t);for(let n=this.filled;n<t;n++){let i=n*yt;this.view.setUint8(i,Math.round(this.r*255)),this.view.setUint8(i+1,Math.round(this.g*255)),this.view.setUint8(i+2,Math.round(this.b*255)),this.view.setUint8(i+3,Math.round(this.a*255)),this.view.setFloat32(i+4,this.width,!0)}this.filled=t}}take(t){return this.advanceTo(t),this.buffer.slice(0,t*yt)}ensure(t){if(t<=this.capacity)return;this.capacity=Math.max(this.capacity*2,t);let n=new ArrayBuffer(this.capacity*yt);new Uint8Array(n).set(new Uint8Array(this.buffer,0,this.filled*yt)),this.buffer=n,this.view=new DataView(n)}};function Dt(e,t){return qi(e)?new an(e,t):void 0}var Ot=e=>e<0?0:e>1?1:e;function hr(e,t){let n=typeof e=="number"?e:Number(e);return Number.isFinite(n)?n:t}function fn(e,t,n,i,o){let r=i*i,s=[],u=f=>e[f*2],l=f=>e[f*2+1],c=(f,p)=>{let m=e.length/2;return e.push((u(f)+u(p))/2,(l(f)+l(p))/2),m};for(let f=0;f<t.length;f+=3){s.push([n+t[f],n+t[f+1],n+t[f+2]]);let p=0;for(;s.length&&!(++p>2e4);){let[m,g,y]=s.pop(),w=(u(m)-u(g))**2+(l(m)-l(g))**2,E=(u(g)-u(y))**2+(l(g)-l(y))**2,S=(u(y)-u(m))**2+(l(y)-l(m))**2,B=Math.max(w,E,S);if(B<=r){o.push(m,g,y);continue}if(B===w){let L=c(m,g);s.push([m,L,y],[L,g,y])}else if(B===E){let L=c(g,y);s.push([g,L,m],[L,y,m])}else{let L=c(y,m);s.push([y,L,g],[L,m,g])}}}}function mr(e,t,n=0,i,o=!1,r=4096,s){let u=[],l=[],c=[];for(let y of e.features()){if(y.type!==3||!pe(t,y.properties))continue;let w=y.properties.osm_id,E=typeof w=="number"?w:typeof w=="string"?Number(w):NaN,S=Number.isFinite(E)?E:Number(y.id??0);s?.setFeature(y.properties,y.id??null,"Polygon");for(let B of tt(y.loadGeometry())){let L=o?He(B,r):B;if(!L)continue;let A=[],U=[],V=i?je(L.outer,i):L.outer;for(let O=0;O<V.length;O++)A.push(V[O]);for(let O of L.holes){let z=i?je(O,i):O;U.push(A.length/2);for(let G=0;G<z.length;G++)A.push(z[G])}let D=Xe(A,U.length?U:void 0,2);if(!D.length)continue;let j=u.length/2;for(let O=0;O<A.length;O++)u.push(A[O]);if(n>0){let O=[];fn(u,D,j,n,O);for(let z=0;z<O.length;z+=3)l.push(O[z],O[z+2],O[z+1]),c.push(S);continue}for(let O=0;O<D.length;O+=3)l.push(j+D[O],j+D[O+2],j+D[O+1]),c.push(S)}s?.advanceTo(u.length/2)}if(!l.length)return null;let f=u.length/2,p=new Int16Array(u),m=new Uint32Array(l);return{featureIds:new Float64Array(c).buffer,vertices:p.buffer,indices:m.buffer,vertexCount:f,indexCount:m.length,...s?{dataPaint:s.take(f)}:{}}}function dr(e){return{shapes:[],cells:[],extent:0,metersPerTile:e}}function br(e,t,n,i){if(!(n<=0)){e.extent=i;for(let o of t){let r=o.outer;if(r.length<6)continue;let s=1/0,u=1/0,l=-1/0,c=-1/0;for(let f=0;f<r.length;f+=2)r[f]<s&&(s=r[f]),r[f]>l&&(l=r[f]),r[f+1]<u&&(u=r[f+1]),r[f+1]>c&&(c=r[f+1]);e.shapes.push({outer:r,holes:o.holes,level:n,minX:s,minY:u,maxX:l,maxY:c})}e.cells=[]}}function es(e){e.cells=Array.from({length:32*32},()=>[]);let t=e.extent/32;for(let n=0;n<e.shapes.length;n++){let i=e.shapes[n],o=it(Math.floor(i.minX/t)),r=it(Math.floor(i.maxX/t)),s=it(Math.floor(i.minY/t)),u=it(Math.floor(i.maxY/t));for(let l=s;l<=u;l++)for(let c=o;c<=r;c++)e.cells[l*32+c].push(n)}}var gr=e=>e.shapes.length===0;function hn(e,t,n){!e.cells.length&&e.shapes.length&&es(e);let i=e.extent/32,o=e.cells[it(Math.floor(n/i))*32+it(Math.floor(t/i))];if(!o||!o.length)return 0;let r=0;for(let s of o){let u=e.shapes[s];if(u.level<=r||t<u.minX||t>u.maxX||n<u.minY||n>u.maxY||!pr(u.outer,t,n))continue;let l=!1;for(let c of u.holes)if(pr(c,t,n)){l=!0;break}l||(r=u.level)}return Math.min(Math.round(r*100),127)}function xr(e,t){let n=[],i=[],o=e.extent>0?e.metersPerTile/e.extent:0,r=o>0?2/o:0,s=hn(e,t[0],t[1]);n.push(t[0],t[1]),i.push(s);for(let u=0;u+3<t.length;u+=2){let l=t[u],c=t[u+1],f=t[u+2],p=t[u+3],m=hn(e,f,p);if(m!==s&&r>0){let g=Math.hypot(f-l,p-c),y=Math.min(Math.ceil(g/r),64),w=s;for(let E=1;E<y;E++){let S=E/y,B=l+(f-l)*S,L=c+(p-c)*S,A=hn(e,B,L);A!==w&&(n.push(B,L),i.push(A),w=A)}}n.push(f,p),i.push(m),s=m}return{pts:n,levels:i}}var it=e=>e<0?0:e>31?31:e;function pr(e,t,n){let i=!1,o=e.length/2;for(let r=0,s=o-1;r<o;s=r++){let u=e[r*2],l=e[r*2+1],c=e[s*2],f=e[s*2+1];l>n!=f>n&&t<(c-u)*(n-l)/(f-l)+u&&(i=!i)}return i}function Sr(e,t){let n=t.halfWidth;if(!(n>0))return null;let i=ts(e);if(i.length<4)return null;let o=ns(n,t.metersPerUnit),r=[],s=i.length/2,u=new Float64Array(s);for(let w=1;w<s;w++)u[w]=u[w-1]+Math.hypot(i[w*2]-i[w*2-2],i[w*2+1]-i[w*2-1]);let l=t.halfWidthAt,c=l?w=>Math.max(l(w),0):()=>n,f=w=>c(u[(w%s+s)%s]),p=1/0;for(let w=0;w<s;w++)p=Math.min(p,f(w));if(t.closed===!0){let w=[],E=[];Nt(w,i,f,!0,o,!0),Nt(E,i,f,!1,o,!0);let S=[];for(let A of[w,E]){let U=yr(A);if(U.length<8)continue;U.push(U[0],U[1]);let V=vr(U,i,u,c,p);V&&V.length>=8&&S.push(V)}if(!S.length)return null;S.sort((A,U)=>Math.abs(wt(U))-Math.abs(wt(A)));let B=wt(S[0])<0?mn(S[0]):S[0],L=S.slice(1).map(A=>wt(A)>0?mn(A):A);return{outer:B,holes:L}}if(Nt(r,i,f,!0,o,!1),Nt(r,i,f,!1,o,!1),r.length<8)return null;let g=yr(r);if(g.length<8)return null;g.push(g[0],g[1]);let y=vr(g,i,u,c,p);return!y||y.length<8?null:{outer:wt(y)<0?mn(y):y,holes:[]}}function yr(e){let t=[];for(let i=0;i+1<e.length;i+=2){let o=t.length;o>=2&&Math.abs(t[o-2]-e[i])<1e-9&&Math.abs(t[o-1]-e[i+1])<1e-9||t.push(e[i],e[i+1])}let n=t.length;return n>=4&&Math.abs(t[0]-t[n-2])<1e-9&&Math.abs(t[1]-t[n-1])<1e-9&&(t.length=n-2),t}function wt(e){let t=0;for(let n=0;n+3<e.length;n+=2)t+=e[n]*e[n+3]-e[n+2]*e[n+1];return t/2}function mn(e){let t=[];for(let n=e.length-2;n>=0;n-=2)t.push(e[n],e[n+1]);return t}function ts(e){let t=[];for(let n=0;n+1<e.length;n+=2){let i=e[n],o=e[n+1],r=t.length;r>=2&&Math.abs(t[r-2]-i)<1e-6&&Math.abs(t[r-1]-o)<1e-6||t.push(i,o)}return t}function ns(e,t){let n=e*(t>0?t:.5),i=Math.ceil(Math.PI*n/1);return Math.max(2,Math.min(10,i))}function Nt(e,t,n,i,o,r){let s=t.length/2,u=c=>{let f=(c%s+s)%s;return[t[f*2],t[f*2+1]]},l=[];if(i)for(let c=0;c<s;c++)l.push(c);else for(let c=s-1;c>=0;c--)l.push(c);for(let c=0;c<l.length;c++){let f=l[c],p=c>0?l[c-1]:r?l[l.length-1]:-1,m=c+1<l.length?l[c+1]:r?l[0]:-1,[g,y]=u(f),w=n(f);if(!(w>0))continue;let E=p>=0?Mr(u(p),[g,y]):null,S=m>=0?Mr([g,y],u(m)):null;if(E&&S){let B=E[0]*S[1]-E[1]*S[0],A=1+(E[0]*S[0]+E[1]*S[1]),U=A>1e-6?w*Math.sqrt(2/A):1/0,V=wr(u(p),[g,y]),D=wr([g,y],u(m));B>0&&U<=w*2&&U<=Math.min(V,D)?e.push(g+(E[0]+S[0])*w/A,y+(E[1]+S[1])*w/A):pn(e,g,y,w,E,S,o)}else S?pn(e,g,y,w,[-S[1],S[0]],S,o):E&&pn(e,g,y,w,E,[E[1],-E[0]],o)}}function wr(e,t){return Math.hypot(t[0]-e[0],t[1]-e[1])}function Mr(e,t){let n=t[0]-e[0],i=t[1]-e[1],o=Math.hypot(n,i);return o>0?[-i/o,n/o]:null}function pn(e,t,n,i,o,r,s){let u=Math.atan2(o[1],o[0]),l=Math.atan2(r[1],r[0])-u;for(;l>Math.PI;)l-=2*Math.PI;for(;l<-Math.PI;)l+=2*Math.PI;let c=Math.max(1,Math.min(s,Math.ceil(Math.abs(l)/Math.PI*s)));for(let f=0;f<=c;f++){let p=u+l*f/c;e.push(t+Math.cos(p)*i,n+Math.sin(p)*i)}}function vr(e,t,n,i,o){let r=is(e);if(!r.length)return e;let s=[],u=[],l=e.length/2-1,c=[];for(let y=0;y<l;y++){s.push(e[y*2],e[y*2+1]),u.push(!1),c.length=0;for(let w of r)w.i===y&&c.push({t:w.t,x:w.x,y:w.y}),w.j===y&&c.push({t:w.u,x:w.x,y:w.y});if(c.length){c.sort((w,E)=>w.t-E.t);for(let w of c)s.push(w.x,w.y),u.push(!0)}}let f=u.length,p=u.indexOf(!0);if(p<0)return e;let m=[],g=0;for(let y=1;y<=f;y++){let w=(p+y)%f;if(!u[w])continue;let E=y;if(!rs(s,p,g,E,f,t,n,i,o))for(let S=g;S<=E;S++){let B=(p+S)%f,L=s[B*2],A=s[B*2+1],U=m.length;U>=2&&Math.abs(m[U-2]-L)<1e-9&&Math.abs(m[U-1]-A)<1e-9||m.push(L,A)}g=E}return m.length<6?e:(m.push(m[0],m[1]),m)}function rs(e,t,n,i,o,r,s,u,l){for(let c=n;c<=i;c++){let f=(t+c)%o;if(os(e[f*2],e[f*2+1],r,s,u,l))return!0}return!1}function os(e,t,n,i,o,r){let s=n.length/2-1,u=r*(1-.01),l=u*u,c=1/0,f=0,p=0;for(let S=0;S<s;S++){let B=n[S*2],L=n[S*2+1],A=n[S*2+2]-B,U=n[S*2+3]-L,V=A*A+U*U,D=V>0?Math.max(0,Math.min(1,((e-B)*A+(t-L)*U)/V)):0,j=e-(B+A*D),O=t-(L+U*D),z=j*j+O*O;if(z<l)return!0;z<c&&(c=z,f=S,p=D)}if(!(c<1/0))return!1;let m=n[f*2],g=n[f*2+1],y=n[f*2+2]-m,w=n[f*2+3]-g,E=o(i[f]+Math.hypot(y,w)*p)*(1-.01);return c<E*E}function is(e){let t=[],n=e.length/2-1;if(n<4)return t;let i=new Float64Array(n),o=new Float64Array(n),r=new Float64Array(n),s=new Float64Array(n),u=[];for(let l=0;l<n;l++){u.push(l);let c=e[l*2],f=e[l*2+2],p=e[l*2+1],m=e[l*2+3];i[l]=c<f?c:f,o[l]=c<f?f:c,r[l]=p<m?p:m,s[l]=p<m?m:p}u.sort((l,c)=>i[l]-i[c]);for(let l=0;l<u.length;l++){let c=u[l];for(let f=l+1;f<u.length;f++){let p=u[f];if(i[p]>o[c])break;let m=Math.abs(c-p);if(m<2||m===n-1||r[p]>s[c]||r[c]>s[p])continue;let g=c<p?c:p,y=c<p?p:c,w=ss(e[g*2],e[g*2+1],e[g*2+2],e[g*2+3],e[y*2],e[y*2+1],e[y*2+2],e[y*2+3]);w&&t.push({i:g,j:y,t:w[2],u:w[3],x:w[0],y:w[1]})}}return t}function ss(e,t,n,i,o,r,s,u){let l=n-e,c=i-t,f=s-o,p=u-r,m=l*p-c*f;if(Math.abs(m)<1e-12)return null;let g=((o-e)*p-(r-t)*f)/m,y=((o-e)*c-(r-t)*l)/m;return g<=1e-9||g>=1-1e-9||y<=1e-9||y>=1-1e-9?null:[e+l*g,t+c*g,g,y]}function Ve(e){let t=e.layer,n=typeof t=="number"?t:typeof t=="string"?Number(t):NaN;if(Number.isFinite(n)&&n!==0)return Math.max(-5,Math.min(5,Math.trunc(n)));let i=e.brunnel;return i==="bridge"?1:i==="tunnel"?-1:0}var Rr=new WeakMap,Ye=(e,t)=>(e+512)*65536+(t+512);function Fr(e,t,n,i,o){if(e===0||t<=0)return t;let r=8*4294967296,s=Math.max(o.raw.get(n+r)??0,o.raw.get(i+r)??0);return s>0&&t>s?s:t}function Ut(e){let t=Rr.get(e);if(t)return t;let n={width:new Map,ends:new Map,raw:new Map},i=[];for(let o of e.features()){if(o.type!==2)continue;let r=o.properties.width,s=typeof r=="number"&&r>.5&&r<100?r:0,u=Ve(o.properties);for(let l of o.loadGeometry()){if(l.length<4)continue;let c=Ye(Math.round(l[0]),Math.round(l[1])),f=Ye(Math.round(l[l.length-2]),Math.round(l[l.length-1]));for(let p of[c,f]){let m=p+(u+8)*4294967296;n.ends.set(m,(n.ends.get(m)??0)+1),s>0&&n.raw.set(m,Math.max(n.raw.get(m)??0,s))}i.push({h:c,t:f,lv:u,w:s})}}for(let o of i){let r=Fr(o.lv,o.w,o.h,o.t,n);if(!(r<=0))for(let s of[o.h,o.t]){let u=n.width.get(s);(u===void 0||r>u)&&n.width.set(s,r)}}return Rr.set(e,n),n}var Gt=12;function jt(e,t){let n=e.length/2,i=0;for(let g=0;g<n-1;g++)i+=Math.hypot(e[g*2+2]-e[g*2],e[g*2+3]-e[g*2+1]);let o=Ye(Math.round(e[0]),Math.round(e[1])),r=Ye(Math.round(e[n*2-2]),Math.round(e[n*2-1])),s=Fr(t.level,t.width,o,r,t.junctions),u=g=>Math.min(t.junctions.width.get(g)??0,s*2),l=u(o)-s,c=u(r)-s,f=Math.min(t.taper,i/2);if(!(f>0)||l<=0&&c<=0)return{width:s,at:null,total:i,knots:[]};let p=g=>{let y=0;return l>0&&g<f&&(y=l*(1-g/f)),c>0&&i-g<f&&(y=Math.max(y,c*(1-(i-g)/f))),s+y},m=[];for(let g of[f,i-f])g>.01&&g<i-.01&&m.push(g);return{width:s,at:p,total:i,knots:m}}function kr(e,t){let n=[...t].sort((s,u)=>s-u);if(!n.length)return e;let i=[e[0],e[1]],o=0,r=0;for(let s=0;s+3<e.length;s+=2){let u=e[s],l=e[s+1],c=e[s+2],f=e[s+3],p=Math.hypot(c-u,f-l);for(;r<n.length&&n[r]<=o+.01;)r++;for(;r<n.length&&n[r]<o+p-.01;){let m=(n[r]-o)/p;i.push(u+(c-u)*m,l+(f-l)*m),r++}o+=p,i.push(c,f)}return i}function Ar(e,t,n){let i=[];for(let l of e.features()){if(l.type!==2||!t(l.properties))continue;let c=n(l.properties);if(!c||!(c>0))continue;let f=l.properties.osm_id,p=typeof f=="number"?f:typeof f=="string"?Number(f):NaN,m=Number.isFinite(p)?p:Number(l.id??0),g=Ve(l.properties);for(let y of l.loadGeometry())y.length<4||i.push({pts:Array.from(y),props:l.properties,id:m,w:c,lv:g,used:!1})}let o=new Map,r=(l,c)=>c?Ye(Math.round(l[l.length-2]),Math.round(l[l.length-1])):Ye(Math.round(l[0]),Math.round(l[1]));i.forEach((l,c)=>{for(let f of[!1,!0]){let p=r(l.pts,f),m=o.get(p);m?m.push({piece:c,tail:f}):o.set(p,[{piece:c,tail:f}])}});let s=(l,c,f)=>{let p=o.get(l);if(!p||p.length!==2)return null;let m=p.filter(y=>!i[y.piece].used);if(m.length!==1)return null;let g=i[m[0].piece];return g.w===c&&g.lv===f?m[0]:null},u=[];for(let l=0;l<i.length;l++){let c=i[l];if(c.used)continue;c.used=!0;let f=c.pts.slice(),p=[c.id];for(let m=0;m<256;m++){let g=s(r(f,!0),c.w,c.lv);if(!g)break;let y=i[g.piece];y.used=!0;let w=g.tail?Er(y.pts):y.pts;for(let E=2;E<w.length;E+=2)f.push(w[E],w[E+1]);p.push(y.id)}for(let m=0;m<256;m++){let g=s(r(f,!1),c.w,c.lv);if(!g)break;let y=i[g.piece];y.used=!0;let w=g.tail?y.pts:Er(y.pts),E=[];for(let S=0;S+3<w.length;S+=2)E.push(w[S],w[S+1]);f=E.concat(f),p.push(y.id)}u.push({pts:f,props:c.props,ids:p})}return u}function Er(e){let t=[];for(let n=e.length-2;n>=0;n-=2)t.push(e[n],e[n+1]);return t}var Ir=85.051129;var us=e=>Math.max(-Ir,Math.min(Ir,e));function Pr(e){return(180+e)/360}function Lr(e){let t=us(e);return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))/360}var Tr=.25,ls="liftPath";function cs(e,t,n){if(typeof e!="string"||!e.length)return null;let i=Math.pow(2,t.z),o=[];for(let u of e.split("|")){let l=[],c=[],f=[];for(let p of u.split(";")){let m=p.split(",");if(m.length<3)continue;let g=Number(m[0]),y=Number(m[1]),w=Number(m[2]);!Number.isFinite(g)||!Number.isFinite(y)||!Number.isFinite(w)||(l.push((Pr(g)*i-t.x)*n),c.push((Lr(y)*i-t.y)*n),f.push(w))}l.length>=2&&o.push({xs:l,ys:c,hs:f})}if(!o.length)return null;if(o.length===1)return ms(o[0].xs,o[0].ys,o[0].hs);let r=o.map(u=>hs(u.xs,u.ys,u.hs)),s=as/fs(t,n);return(u,l)=>{let c=1/0,f=0,p=1/0,m=0;for(let L of r){let A=L(u,l);A.d<c?(p=c,m=f,c=A.d,f=A.h):A.d<p&&(p=A.d,m=A.h)}if(!Number.isFinite(p))return f;let g=Math.abs(f-m);if(g>=Br)return f;let y=Math.max(0,(g-_r)/(Br-_r)),w=s*(1-y*y*(3-2*y)),E=Math.sqrt(p)-Math.sqrt(c);if(E>=w)return f;let S=E/w,B=.5+.5*S*S*(3-2*S);return f*B+m*(1-B)}}var as=12,_r=2,Br=5;function fs(e,t){let n=Math.pow(2,e.z),i=Math.atan(Math.sinh(Math.PI*(1-2*(e.y+.5)/n)));return 40075016686e-3*Math.cos(i)/(n*t)}function hs(e,t,n){let i=e.length,o=new Array(i-1);for(let r=0;r+1<i;r++){let s=e[r+1]-e[r],u=t[r+1]-t[r];o[r]=s*s+u*u}return(r,s)=>{let u=1/0,l=n[0];for(let c=0;c+1<i;c++){let f=e[c+1]-e[c],p=t[c+1]-t[c],m=o[c]>1e-12?Math.max(0,Math.min(1,((r-e[c])*f+(s-t[c])*p)/o[c])):0,g=e[c]+f*m,y=t[c]+p*m,w=(r-g)*(r-g)+(s-y)*(s-y);w<u&&(u=w,l=n[c]+(n[c+1]-n[c])*m)}return{d:u,h:l}}}function ms(e,t,n){let i=e.length,o=new Array(i-1);for(let r=0;r+1<i;r++){let s=e[r+1]-e[r],u=t[r+1]-t[r];o[r]=s*s+u*u}return(r,s)=>{let u=1/0,l=n[0];for(let c=0;c+1<i;c++){let f=e[c+1]-e[c],p=t[c+1]-t[c],m=o[c]>1e-12?Math.max(0,Math.min(1,((r-e[c])*f+(s-t[c])*p)/o[c])):0,g=e[c]+f*m,y=t[c]+p*m,w=(r-g)*(r-g)+(s-y)*(s-y);w<u&&(u=w,l=n[c]+(n[c+1]-n[c])*m)}return l}}function Cr(e,t){let n=new Map;return i=>{if(!e)return null;let o=i[ls];if(typeof o!="string"||!o.length)return null;let r=n.get(o);if(r!==void 0)return r;let s=cs(o,e,t);return n.set(o,s),s}}var ps=yo(Vr(),1),Or=ps,xn=Or.union??Or.default?.union??null;xn||console.warn("[osmgl] polygon-clipping \\u0431\\u0435\\u0437 union \\u2014 \\u043E\\u0431\\u044A\\u0435\\u0434\\u0438\\u043D\\u0435\\u043D\\u0438\\u0435 \\u0444\\u0438\\u0433\\u0443\\u0440 \\u0432\\u044B\\u043A\\u043B\\u044E\\u0447\\u0435\\u043D\\u043E");var Ht=0,zt=0;function ds(e){for(let t of e)if(t.length>=2){Ht=Math.round(t[0]),zt=Math.round(t[1]);return}Ht=0,zt=0}function Dr(e){let t=[];for(let n=0;n+1<e.length;n+=2)t.push([e[n]-Ht,e[n+1]-zt]);return t}function Nr(e){let t=[];for(let i of e)t.push(i[0]+Ht,i[1]+zt);let n=t.length;return n>=4&&(t[0]!==t[n-2]||t[1]!==t[n-1])&&t.push(t[0],t[1]),t}function Gr(e,t,n=0){if(e.length<2)return e;let i=new Map;for(let r of e){let s=r.at?r:r.lift??0,u=i.get(s);u?u.push(r):i.set(s,[r])}let o=[];for(let[r,s]of i){if(s.length<2){o.push(...s);continue}let u=typeof r=="number"?r:0;o.push(...bs(s,u,t,n))}return o}var gn=256;function bs(e,t,n,i=0){let o=e,r=i>0&&n?i:0;for(let s=0;s<32;s++){if(o.length<2)return o;if(o.length<=gn)return Ur(o,t,n,r);let u=gs(o),l=[];for(let c=0;c<u.length;c+=gn)l.push(...Ur(u.slice(c,c+gn),t,n,r));if(r=0,l.length>=o.length)return l;o=l}return o}function gs(e){let t=1/0,n=1/0,i=-1/0,o=-1/0,r=e.map(c=>{let f=0,p=0,m=0;for(let w=0;w+1<c.outer.length;w+=2)f+=c.outer[w],p+=c.outer[w+1],m++;let g=m?f/m:0,y=m?p/m:0;return g<t&&(t=g),g>i&&(i=g),y<n&&(n=y),y>o&&(o=y),{s:c,cx:g,cy:y}}),s=i-t||1,u=o-n||1,l=c=>{let f=Math.max(0,Math.min(65535,Math.round(c*65535)));return f=(f|f<<8)&16711935,f=(f|f<<4)&252645135,f=(f|f<<2)&858993459,f=(f|f<<1)&1431655765,f};return r.map(c=>({s:c.s,key:l((c.cx-t)/s)|l((c.cy-n)/u)<<1})).sort((c,f)=>c.key-f.key).map(c=>c.s)}function Ur(e,t,n,i=0){{let o=[],r=i>0&&n?e.map(c=>({outer:n(c.outer,-i)??c.outer,holes:c.holes.map(f=>n(f,i)??f)})):e;ds(r.map(c=>c.outer));let s=r.map(c=>[Dr(c.outer),...c.holes.map(Dr)]),u;try{if(!xn)throw new Error("\\u043D\\u0435\\u0442 union");u=xn(s[0],...s.slice(1))}catch{return e}let l=u;if(!Array.isArray(l)||l.length===0)return e;for(let c of l){if(!c.length)continue;let f=Nr(c[0]);if(f.length<8)continue;let p=[];for(let m=1;m<c.length;m++){let g=Nr(c[m]);g.length>=8&&p.push(g)}o.push(t?{outer:f,holes:p,lift:t}:{outer:f,holes:p})}return o}}var xs=5,Sn=16,ys=64,Wr=0,ws=1,jr=2,Ms=3,Xt=1,vs=.6;function Ss(e,t,n,i){if(!t||!(t>0)||!(n>0))return[];let o=t/2/n,r=[];for(let s of e){let u=s.length>=8&&Math.abs(s[0]-s[s.length-2])<1e-6&&Math.abs(s[1]-s[s.length-1])<1e-6,l,c=s;if(i&&!u){let g=Array.from(s),y=jt(g,{junctions:i.junctions,width:i.width,level:i.level,taper:i.reach});if(y.at){let w=i.extra/2/n,E=y.at;l=S=>E(S)/2/n+w,y.knots.length&&(c=kr(g,y.knots))}}let f=Sr(c,{halfWidth:o,metersPerUnit:n,closed:u,halfWidthAt:l});if(!f)continue;let p=f.outer,m=[];if(i&&!u){let g=s.length/2;for(let[y,w,E]of[[s[0],s[1],0],[s[g*2-2],s[g*2-1],-1]]){if(!Es(i,y,w))continue;let S=E===0?0:Rs(c),B=l?l(S):o;m.push({x:y,y:w,r:B})}}r.push(m.length?{outer:p,holes:f.holes,caps:m}:{outer:p,holes:f.holes})}return r}function Rs(e){let t=0;for(let n=0;n+3<e.length;n+=2)t+=Math.hypot(e[n+2]-e[n],e[n+3]-e[n+1]);return t}function Es(e,t,n){let i=Ye(Math.round(t),Math.round(n))+(e.level+8)*4294967296;return(e.junctions.ends.get(i)??0)>1}function Zr(e,t,n,i){let o=i.metersPerUnit>0?i.metersPerUnit:.5,r=i.elevation,s=i.base??0,u=Math.max(i.bevel??0,0)/o,l=Math.max(i.bevelDrop??0,0),c=Math.max(i.cornerRadius??0,0)/o,f=Math.max(512,e.length*24),p=new ArrayBuffer(f*Sn),m={view:new DataView(p),bytes:new Uint8Array(p),offset:0,count:0,indices:[],extent:t,ensure(T){if(m.count+T<=f)return;f=Math.max(f*2,m.count+T);let N=new ArrayBuffer(f*Sn);new Uint8Array(N).set(m.bytes.subarray(0,m.offset)),p=N,m.view=new DataView(N),m.bytes=new Uint8Array(N)}},g=i.widthOf?Ut(e):null,y=Math.max(i.widthExtra??0,0),w=Gt/o,E=T=>{if(!g)return;let N=i.widthOf(T);if(!(!N||!(N>0)))return{junctions:g,width:Math.max(N-y,0),extra:y,level:Ve(T),reach:w}},S=[],B=[],L=new Map,A=i.widthOf?Ar(e,T=>pe(n,T),i.widthOf):null,U=A?A.map(T=>({geometry:[T.pts],props:T.props,ids:T.ids})):[];if(!A)for(let T of e.features()){if(T.type!==3||!pe(n,T.properties))continue;let N=T.properties.osm_id,ee=typeof N=="number"?N:typeof N=="string"?Number(N):NaN;U.push({geometry:T.loadGeometry(),props:T.properties,ids:[Number.isFinite(ee)?ee:Number(T.id??0)]})}for(let T of U){let N=A!==null,ee=i.liftAt?.(T.props)??null,Z=ee?0:i.liftBy?.(T.props)??0,oe=T.ids;for(let de of N?Ss(T.geometry,i.widthOf(T.props),o,E(T.props)):tt(T.geometry)){let be=He(de,t,ve(t));if(!be)continue;let se=de.caps;S.push({...be,...Z?{lift:Z}:{},...ee?{at:ee}:{},...se?{caps:se}:{}}),B.push(oe)}}let V=new Set,D=Math.max(i.weld??vs,0),j=i.widthOf?S:Gr(S,(T,N)=>wn(T,N,t,V),D/o),O=D>0?j.map(T=>({...T,outer:$r(T.outer,D/o,t),holes:T.holes.map(N=>$r(N,D/o,t))})):j;for(let T of O){zr(T.outer,L);for(let N of T.holes)zr(N,L)}i.onShapes?.(O);let z=Fs(O,S,B),G=new Set;for(let[T,N]of L)N>1&&G.add(T);if(O.some(T=>T.at)||new Set(O.map(T=>T.lift??0)).size>1){let T=(N,ee,Z)=>{let oe=O[N];return(oe.lift??0)+(oe.at?oe.at(ee,Z):0)};Is(O,(N,ee,Z)=>r+T(N,ee,Z),G,.5/o)}for(let T of O){let N=T.caps;if(N)for(let ee of N)Ls(T.outer,ee,G)}let ie=[],J={radius:c,segments:i.cornerSegments,extent:t,margin:ve(t),minCutRatio:0,maxChord:Zn/o},X=[];for(let T of O){let N=m.indices.length,ee=ie.length,Z=c>0?{outer:je(T.outer,{...J,keep:Xr(T.outer,G)}),holes:T.holes.map(he=>je(he,{...J,keep:Xr(he,G)}))}:T,oe=u>0?wn(Z.outer,u,t,G):Z.outer,de=Z.holes.map(he=>u>0?wn(he,-u,t,G):he),be=T.lift??0,se=T.at,Ie=r+be,Ne=Math.max(i.deck??0,0),ce=s+be-(be>0||se?Ne:0),Me=se?Math.min(i.maxSegment||1/0,xs/o):i.maxSegment??0;Yr(m,oe??Z.outer,de.map((he,me)=>he??Z.holes[me]),Ie,Wr,Me,se);let Se=Ie,ne=Ie-l;oe&&u>0&&l>0&&yn(m,oe,Z.outer,Se,ne,ws,t,G,se),(ne!==ce||se)&&yn(m,Z.outer,Z.outer,ne,ce,jr,t,G,se);for(let he of Z.holes)if((ne!==ce||se)&&yn(m,he,he,ne,ce,jr,t,G,se),Ie<ce){let me=m.indices.length;Yr(m,he,[],ce,Ms,0,se);for(let Pe=me;Pe<m.indices.length;Pe++)ie.push(m.indices[Pe]);m.indices.length=me}X.push(N,m.indices.length,ee,ie.length)}if(!m.indices.length&&!ie.length)return null;let W=m.indices.length;for(let T=0;T<X.length;T+=4)X[T+2]+=W,X[T+3]+=W;let re=[];for(let T of z){re.push(T.length);for(let N of T)re.push(N)}let Q=new Uint32Array(W+ie.length);return Q.set(m.indices,0),Q.set(ie,W),{vertices:p.slice(0,m.offset),indices:Q.buffer,vertexCount:m.count,indexCount:Q.length,extent:t,capIndexOffset:W,shapeFeatures:new Float64Array(re).buffer,shapeRanges:new Uint32Array(X).buffer}}function Fs(e,t,n){let i=e.map(()=>[]);if(!e.length)return i;let o=e.map(r=>Hr(r.outer));for(let r=0;r<t.length;r++){let s=ks(t[r].outer);if(!s)continue;let u=-1;for(let l=0;l<e.length;l++){let c=o[l];if(s[0]<c[0]||s[0]>c[2]||s[1]<c[1]||s[1]>c[3]||!vt(e[l].outer,s[0],s[1]))continue;let f=!1;for(let p of e[l].holes)if(vt(p,s[0],s[1])){f=!0;break}if(!f){u=l;break}}if(u<0){let l=Hr(t[r].outer),c=0;for(let f=0;f<e.length;f++){let p=o[f],m=Math.min(l[2],p[2])-Math.max(l[0],p[0]),g=Math.min(l[3],p[3])-Math.max(l[1],p[1]),y=m>0&&g>0?m*g:0;y>c&&(c=y,u=f)}}u<0&&(u=0);for(let l of n[r])i[u].includes(l)||i[u].push(l)}return i}function Hr(e){let t=1/0,n=1/0,i=-1/0,o=-1/0;for(let r=0;r<e.length;r+=2)e[r]<t&&(t=e[r]),e[r]>i&&(i=e[r]),e[r+1]<n&&(n=e[r+1]),e[r+1]>o&&(o=e[r+1]);return[t,n,i,o]}function ks(e){let t=e.length/2-1;if(t<3)return null;let n=0;for(let o=0;o<t;o++){let r=(o+1)%t;n+=e[o*2]*e[r*2+1]-e[r*2]*e[o*2+1]}let i=n>0;for(let o=0;o<t;o++){let r=(o+t-1)%t*2,s=o*2,u=(o+1)%t*2,l=(e[s]-e[r])*(e[u+1]-e[r+1])-(e[s+1]-e[r+1])*(e[u]-e[r]);if(l===0||l>0!==i)continue;let c=(e[r]+e[s]+e[u])/3,f=(e[r+1]+e[s+1]+e[u+1])/3;if(vt(e,c,f))return[c,f]}return null}function vt(e,t,n){let i=!1,o=e.length/2-1;for(let r=0,s=o-1;r<o;s=r++){let u=e[r*2],l=e[r*2+1],c=e[s*2],f=e[s*2+1];l>n!=f>n&&t<(c-u)*(n-l)/(f-l)+u&&(i=!i)}return i}var As=Tr;function Is(e,t,n,i){if(e.length<2)return;let o=e.map(u=>{let l=1/0,c=1/0,f=-1/0,p=-1/0;for(let m=0;m<u.outer.length;m+=2)u.outer[m]<l&&(l=u.outer[m]),u.outer[m]>f&&(f=u.outer[m]),u.outer[m+1]<c&&(c=u.outer[m+1]),u.outer[m+1]>p&&(p=u.outer[m+1]);return{minX:l,minY:c,maxX:f,maxY:p}}),r=u=>{let l=e[u];return!!l.at||(l.lift??0)!==0},s=(u,l,c)=>{let f=o[u];if(l<f.minX||l>f.maxX||c<f.minY||c>f.maxY||!vt(e[u].outer,l,c))return!1;for(let p of e[u].holes)if(vt(p,l,c))return!1;return!0};for(let u=0;u<e.length;u++)for(let l of[e[u].outer,...e[u].holes])for(let c=0;c+3<l.length;c+=2){let f=l[c+2]-l[c],p=l[c+3]-l[c+1],m=Math.hypot(f,p);if(m<1e-9)continue;let g=(l[c]+l[c+2])/2,y=(l[c+1]+l[c+3])/2,w=-p/m*i,E=f/m*i,S=s(u,g+w,y+E)?-1:1,B=g+w*S,L=y+E*S;for(let A=0;A<e.length;A++)if(!(A===u||!s(A,B,L))&&!(!r(u)&&!r(A))&&!(Math.abs(t(u,B,L)-t(A,B,L))>As)){n.add($e(l[c],l[c+1],l[c+2],l[c+3]));break}}}function $e(e,t,n,i){let o=`${Math.round(e*100)},${Math.round(t*100)}`,r=`${Math.round(n*100)},${Math.round(i*100)}`;return o<r?`${o}|${r}`:`${r}|${o}`}function zr(e,t){for(let n=0;n+3<e.length;n+=2){let i=$e(e[n],e[n+1],e[n+2],e[n+3]);t.set(i,(t.get(i)??0)+1)}}function Xr(e,t){if(!t.size)return;let n=e.length/2-1,i=new Array(n).fill(!1);for(let o=0;o<n;o++){let r=$e(e[(o+n-1)%n*2],e[(o+n-1)%n*2+1],e[o*2],e[o*2+1]),s=$e(e[o*2],e[o*2+1],e[(o+1)%n*2],e[(o+1)%n*2+1]);(t.has(r)||t.has(s))&&(i[o]=!0)}return i}function Mt(e,t,n,i,o,r,s,u){let l=e.offset;return e.view.setFloat32(l,t,!0),e.view.setFloat32(l+4,n,!0),e.view.setInt16(l+8,Ps(Math.round(i*ys)),!0),e.view.setInt8(l+10,vn(Math.round(o*127))),e.view.setInt8(l+11,vn(Math.round(r*127))),e.view.setInt8(l+12,vn(Math.round(s*127))),e.bytes[l+13]=u,e.view.setInt8(l+14,t<=0?-Xt:t>=e.extent?Xt:0),e.view.setInt8(l+15,n<=0?-Xt:n>=e.extent?Xt:0),e.offset+=Sn,e.count++}function Yr(e,t,n,i,o=Wr,r=0,s){let u=[],l=[];for(let m=0;m<t.length;m++)u.push(t[m]);for(let m of n){l.push(u.length/2);for(let g=0;g<m.length;g++)u.push(m[g])}let c=Xe(u,l.length?l:void 0,2);if(!c.length)return;let f=c;if(r>0){let m=[];fn(u,c,0,r,m),f=m}e.ensure(u.length/2);let p=e.count;for(let m=0;m<u.length;m+=2)Mt(e,u[m],u[m+1],s?i+s(u[m],u[m+1]):i,0,0,1,o);for(let m=0;m<f.length;m+=3)e.indices.push(p+f[m],p+f[m+2],p+f[m+1])}function yn(e,t,n,i,o,r,s,u,l,c){let f=Math.min(t.length,n.length)/2;if(!(f<3)){e.ensure((f-1)*4);for(let p=0;p<f-1;p++){let m=n[p*2],g=n[p*2+1],y=n[p*2+2],w=n[p*2+3];if(m===y&&g===w||Vt(m,g,y,w,s,ve(s))||u.has($e(m,g,y,w)))continue;let E=y-m,S=w-g,B=Math.hypot(E,S)||1,L=S/B,A=-E/B,U=i-o,V=Math.hypot(t[p*2]-m,t[p*2+1]-g)||0,D=0;if(V>1e-6&&U!==0){let re=1/Math.hypot(1,U/V);D=V/Math.hypot(V,U)*Math.sign(U),L*=re,A*=re}let j=l?l(t[p*2],t[p*2+1]):0,O=l?l(t[p*2+2],t[p*2+3]):0,z=c??l,G=z?z(m,g):0,te=z?z(y,w):0,ie=Mt(e,t[p*2],t[p*2+1],i+j,L,A,D,r),J=Mt(e,t[p*2+2],t[p*2+3],i+O,L,A,D,r),X=Mt(e,m,g,o+G,L,A,D,r),W=Mt(e,y,w,o+te,L,A,D,r);e.indices.push(X,J,W,X,ie,J)}}}function wn(e,t,n,i){let o=e.length/2-1;if(o<3)return null;let r=[];for(let f=0;f<o;f++){let p=e[f*2],m=e[f*2+1],g=e[(f+o-1)%o*2],y=e[(f+o-1)%o*2+1],w=e[(f+1)%o*2],E=e[(f+1)%o*2+1],S=Math.hypot(p-g,m-y)||1,B=Math.hypot(w-p,E-m)||1,L=(m-y)/S,A=-(p-g)/S,U=(E-m)/B,V=-(w-p)/B,D=L+U,j=A+V,O=Math.hypot(D,j);if(O<1e-6){r.push(p,m);continue}D/=O,j/=O;let z=Math.min(1/Math.max(D*L+j*A,.35),3),G=p-D*t*z,te=m-j*t*z,ie=$e(g,y,p,m),J=$e(p,m,w,E);if(i.has(ie)||i.has(J)){r.push(p,m);continue}let X=-ve(n),W=n+ve(n);((Q,T)=>Q<=X||Q>=W||T<=X||T>=W)(p,m)&&(G=p,te=m),r.push(G,te)}r.push(r[0],r[1]);let s=Math.abs(Mn(e)),u=Mn(r);if(Math.sign(u)!==Math.sign(Mn(e))||Math.abs(u)<s*.25)return null;let l=-ve(n),c=n+ve(n);for(let f=0;f<r.length;f+=2)r[f]=Math.max(l,Math.min(c,r[f])),r[f+1]=Math.max(l,Math.min(c,r[f+1]));return r}function Mn(e){let t=0;for(let n=0;n<e.length-2;n+=2)t+=e[n]*e[n+3]-e[n+2]*e[n+1];return t/2}var vn=e=>e>127?127:e<-127?-127:e,Ps=e=>e>32767?32767:e<-32768?-32768:e;function $r(e,t,n){if(!(t>0))return e;let i=ve(n),o=-i,r=n+i,s=e;for(let u=0;u<3;u++){let l=s.length/2-1;if(l<6)break;let c=new Array(l).fill(!0),f=l;for(let m=0;m<l&&!(f<=5);m++){let g=s[m*2],y=s[m*2+1];if(g<=o||g>=r||y<=o||y>=r)continue;let w=(m+l-1)%l;for(;!c[w]&&w!==m;)w=(w+l-1)%l;let E=(m+1)%l;for(;!c[E]&&E!==m;)E=(E+1)%l;if(w===m||E===m)break;let S=s[w*2],B=s[w*2+1],L=s[E*2]-S,A=s[E*2+1]-B,U=Math.hypot(L,A);U<1e-6||Math.abs((g-S)*A-(y-B)*L)/U<t&&(c[m]=!1,f--)}if(f===l)break;let p=[];for(let m=0;m<l;m++)c[m]&&p.push(s[m*2],s[m*2+1]);p.push(p[0],p[1]),s=p}return s}function Ls(e,t,n){let i=t.r*.8,o=t.r*1.2,r=(s,u)=>{let l=Math.hypot(s-t.x,u-t.y);return l>=i&&l<=o};for(let s=0;s+3<e.length;s+=2)!r(e[s],e[s+1])||!r(e[s+2],e[s+3])||n.add($e(e[s],e[s+1],e[s+2],e[s+3]))}var St=24;function Jr(e,t,n=0,i,o=0,r={}){let{level:s,paint:u}=r,l=Math.max(256,e.length*24),c=new ArrayBuffer(l*St),f=new DataView(c),p=0,m=[],g=[],y=V=>{if(p+V<=l)return;l=Math.max(l*2,p+V);let D=new ArrayBuffer(l*St);new Uint8Array(D).set(new Uint8Array(c,0,p*St)),c=D,f=new DataView(D)},w=(V,D,j,O,z,G,te,ie=0,J=0,X=0,W=0,re=0)=>{let Q=p*St;return f.setInt16(Q,V,!0),f.setInt16(Q+2,D,!0),f.setInt16(Q+4,j,!0),f.setInt16(Q+6,O,!0),f.setInt8(Q+8,z),f.setInt8(Q+9,G),f.setInt8(Q+10,ie),f.setInt8(Q+11,J),f.setFloat32(Q+12,te,!0),f.setFloat32(Q+16,X,!0),f.setInt16(Q+20,W,!0),f.setInt16(Q+22,re,!0),p++},E=0,S=0,B=o>0?Gt/o:0,L=B>0?Ut(e):null;for(let V of e.features()){if(V.type!==2&&V.type!==3||!pe(t,V.properties)||s!==void 0&&Ve(V.properties)!==s)continue;let D=V.properties.osm_id,j=typeof D=="number"?D:typeof D=="string"?Number(D):NaN;S=Number.isFinite(j)?j:Number(V.id??0);let O=V.properties.width;E=typeof O=="number"&&O>.5&&O<100?O:0;let z=r.liftAt?.(V.properties)??null;u?.setFeature(V.properties,V.id??null,V.type===3?"Polygon":"LineString");let G=V.type===3;for(let te of V.loadGeometry()){let ie=n>0?Bs(Qr(te),n):Qr(te);if(ie.length<4)continue;let J=i&&!gr(i)?xr(i,ie):null,X=J?J.pts:ie,W=J?.levels,re=X.length/2;if(re<2)continue;let Q=Ve(V.properties),T=null,N=E;if(L&&E>0&&!G){let Z=jt(X,{junctions:L,width:E,level:Q,taper:B});if(N=Z.width,Z.at){T=Z.at;let oe=Z.knots;if(oe.length){let de=_s(X,W,oe);X=de.pts,W=de.levels,re=X.length/2}}}y((re-1)*4);let ee=0;for(let Z=0;Z<re-1;Z++){let oe=X[Z*2],de=X[Z*2+1],be=X[Z*2+2],se=X[Z*2+3],Ie=Math.hypot(be-oe,se-de);if(G&&Cs(oe,de,be,se,e.extent)){ee+=Ie;continue}let Ne=Ts(oe,de,be,se,e.extent);if(!Ne){ee+=Ie;continue}let[ce,Me,Se,ne]=Ne,he=Math.hypot(ce-oe,Me-de),me=Math.hypot(Se-ce,ne-Me),Pe=Math.hypot(be-Se,se-ne),Le=ee+he,Oe=W?W[Z]:0,Ee=W?W[Z+1]:0,Ue=z?Kr(z(ce,Me)):0,ze=z?Kr(z(Se,ne)):0,We=T?T(Le):N,ut=T?T(Le+me):N,Rt=w(ce,Me,Se,ne,0,-1,Le,Oe,Ee,We,Ue,ze),Yt=w(ce,Me,Se,ne,0,1,Le,Oe,Ee,We,Ue,ze),Re=w(ce,Me,Se,ne,1,1,Le,Oe,Ee,ut,Ue,ze),kn=w(ce,Me,Se,ne,1,-1,Le,Oe,Ee,ut,Ue,ze);ee+=he+me+Pe,m.push(Rt,Yt,Re,Rt,Re,kn),g.push(S,S)}}u?.advanceTo(p)}if(!m.length)return null;let A=new Uint32Array(m),U=new Float64Array(g);return{vertices:c.slice(0,p*St),indices:A.buffer,vertexCount:p,indexCount:A.length,featureIds:U.buffer,...u?{dataPaint:u.take(p)}:{}}}function Kr(e){return Math.max(-32768,Math.min(32767,Math.round(e*100)))}function _s(e,t,n){let i=[...n].sort((l,c)=>l-c),o=[e[0],e[1]],r=t?[t[0]]:void 0,s=0,u=0;for(let l=0;l+3<e.length;l+=2){let c=e[l],f=e[l+1],p=e[l+2],m=e[l+3],g=Math.hypot(p-c,m-f);for(;u<i.length&&i[u]<=s+.01;)u++;for(;u<i.length&&i[u]<s+g-.01;){let y=(i[u]-s)/g;o.push(c+(p-c)*y,f+(m-f)*y),r&&t&&r.push(Math.round(t[l/2]+(t[l/2+1]-t[l/2])*y)),u++}s+=g,o.push(p,m),r&&t&&r.push(t[l/2+1])}return{pts:o,levels:r}}function Bs(e,t){let n=[];for(let i=0;i+3<e.length;i+=2){let o=e[i],r=e[i+1],s=e[i+2],u=e[i+3];n.push(o,r);let l=Math.min(64,Math.floor(Math.hypot(s-o,u-r)/t));for(let c=1;c<l;c++){let f=c/l;n.push(o+(s-o)*f,r+(u-r)*f)}}return n.push(e[e.length-2],e[e.length-1]),n}function Qr(e){let t=[];for(let n=0;n<e.length;n+=2){let i=e[n],o=e[n+1],r=t.length;r>=2&&t[r-2]===i&&t[r-1]===o||t.push(i,o)}return t}function Ts(e,t,n,i,o){let r=n-e,s=i-t,u=0,l=1,c=[[-r,e],[r,o-e],[-s,t],[s,o-t]];for(let[f,p]of c){if(f===0){if(p<0)return null;continue}let m=p/f;if(f<0){if(m>l)return null;m>u&&(u=m)}else{if(m<u)return null;m<l&&(l=m)}}return l-u<1e-6?null:[Math.round(e+r*u),Math.round(t+s*u),Math.round(e+r*l),Math.round(t+s*l)]}function Cs(e,t,n,i,o){return e===n&&(e<=0||e>=o)?!0:t===i&&(t<=0||t>=o)}var Vs=[["\\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."]],qr=new Map(Vs);function eo(e){let t=e.split(" ");if(t.length<2)return e;let n=!1,i=t.map(r=>{let s=qr.get(r.toLowerCase());return s?(n=!0,r[0]===r[0].toUpperCase()?s[0].toUpperCase()+s.slice(1):s):r});return!n||!t.filter(r=>qr.get(r.toLowerCase())===void 0).length?e:i.join(" ")}function no(e,t){let n=[],i=[],o=[],r=[],s=[],u=t.textPlacement==="line",l=[],c=[],f=[];for(let p of e.features()){if(!pe(t.filter,p.properties))continue;let m=p.loadGeometry(),g=Ns(p.type,m);if(!g)continue;let y=t.textField?to(t.textField,p.properties):"",w=y&&t.abbreviate?eo(y):y,E=t.iconImage?to(t.iconImage,p.properties):"";if(!(!w&&!E)){if(u){let S=Ds(p.type,m);if(!S)continue;f.push({text:w,line:S});continue}n.push(g[0],g[1]),i.push(w),o.push(E),r.push(Us(p.properties)),s.push(t.iconRotate&&Math.round(Number(p.properties[t.iconRotate]??0))||0)}}if(u){for(let{text:p,line:m}of Os(f)){c.push(l.length/2);for(let g of m)l.push(g);n.push(Math.round(m[0]),Math.round(m[1])),i.push(p),o.push(""),r.push(128),s.push(0)}c.push(l.length/2)}return i.length?{anchors:new Int16Array(n).buffer,texts:i,icons:o,priorities:new Uint8Array(r).buffer,rotations:new Int16Array(s).buffer,...u?{lines:new Int16Array(l).buffer,lineStarts:new Uint32Array(c).buffer}:{}}:null}function Os(e){let t=[],n=new Map,i=new Map,o=(r,s,u)=>`${r}\\u241F${s}\\u241F${u}`;for(let{text:r,line:s}of e){let u=o(r,s[0],s[1]),l=o(r,s[s.length-2],s[s.length-1]),c=n.get(l),f=i.get(u);if(f!==void 0){let p=t[f];if(p.line.push(...s.slice(2)),i.delete(u),i.set(o(r,p.line[p.line.length-2],p.line[p.line.length-1]),f),c!==void 0&&c!==f){let m=t[c];p.line.push(...m.line.slice(2)),m.line=[],n.delete(l),i.set(o(r,p.line[p.line.length-2],p.line[p.line.length-1]),f)}continue}if(c!==void 0){let p=t[c];p.line.unshift(...s.slice(0,s.length-2)),n.delete(l),n.set(o(r,p.line[0],p.line[1]),c);continue}n.set(u,t.length),i.set(l,t.length),t.push({text:r,line:s})}return t.filter(r=>r.line.length>=4)}function Ds(e,t){if(e!==2)return null;let n=null,i=0;for(let o of t){if(o.length<4)continue;let r=0;for(let s=0;s+3<o.length;s+=2)r+=Math.hypot(o[s+2]-o[s],o[s+3]-o[s+1]);r>i&&(i=r,n=o)}return n}function Ns(e,t){if(!t.length)return null;if(e===1){let s=t[0];return s.length>=2?[s[0],s[1]]:null}if(e===2){let s=-1,u=0,l=0;for(let c of t)for(let f=0;f+3<c.length;f+=2){let p=c[f+2]-c[f],m=c[f+3]-c[f+1],g=p*p+m*m;g>s&&(s=g,u=c[f]+p/2,l=c[f+1]+m/2)}return s>0?[Math.round(u),Math.round(l)]:null}let n=1/0,i=1/0,o=-1/0,r=-1/0;for(let s of t)for(let u=0;u<s.length;u+=2)s[u]<n&&(n=s[u]),s[u]>o&&(o=s[u]),s[u+1]<i&&(i=s[u+1]),s[u+1]>r&&(r=s[u+1]);return isFinite(n)?[Math.round((n+o)/2),Math.round((i+r)/2)]:null}function Us(e){let t=e.importance;if(typeof t=="number"&&isFinite(t))return Math.max(0,255-Math.min(Math.max(t,1),9)*20);let n=e.rank;return typeof n=="number"&&isFinite(n)?Math.max(0,255-Math.min(n,255)):128}function to(e,t){let n=Array.isArray(e)?e:[e];for(let i of n){let o=!0,s=i.replace(/\\{([^}]+)\\}/g,(u,l)=>{let c=t[l];return c==null||c===""?(o=!1,""):String(c)}).trim();if(o&&s)return s}return""}function ro(e,t){let n=[],i=[];for(let o=0;o<e.length;o++){let r=e.feature(o);if(r.type===1&&pe(t,r.properties))for(let s of r.loadGeometry())for(let u=0;u+1<s.length;u+=2)n.push(s[u],s[u+1]),i.push(r.properties)}return i.length?{anchors:Int16Array.from(n).buffer,props:i}:null}var Gs="\\u241F",Rn=(e,t)=>e+Gs+String(t);function js(){let e=typeof self<"u"?self.origin:void 0;return e&&e!=="null"&&!e.startsWith("blob:")?e+"/":void 0}function Hs(e,t){let n={},i=[],o={},r=new Set,s=[],l=t.plan.some(c=>c.type==="surface"&&(c.elevation??0)>0)&&t.plan.some(c=>c.type==="line"&&c.ground)?dr(t.metersPerTile):void 0;for(let c of t.plan){if(!Ws(c,t.zoom,t.sourceMaxZoom))continue;let f=e.layers[c.sourceLayer];if(!f)continue;let p=Zs(t.zoom,f.extent);try{if(c.splitBy){let g=Ks(f,c.splitBy,c.filter);if(!g.length)continue;let y=o[c.splitBy]??(o[c.splitBy]=[]);for(let w of g){y.includes(w)||y.push(w);let E={...c,splitBy:void 0,filter:Js(c.filter,c.splitBy,w)},S=En(E,f,p,t.metersPerTile,t.zoom,l,void 0,i,t.tile);S&&(n[Rn(c.id,w)]=S)}continue}if(c.network&&c.type==="line"){for(let g of Qs(f,c.filter)){let y=En(c,f,p,t.metersPerTile,t.zoom,l,g,i,t.tile);y&&(n[Rn(c.id,g)]=y,r.add(g))}continue}let m=En(c,f,p,t.metersPerTile,t.zoom,l,void 0,i,t.tile);m&&(n[c.id]=m)}catch(m){s.push(`${c.id}: ${m instanceof Error?m.message:String(m)}`)}}return{buckets:n,seams:i,splits:o,levels:[...r].sort((c,f)=>c-f),failed:s}}async function oo(e,t){let n=performance.now(),i=js(),o=await fetch(e.url,{signal:t,credentials:"same-origin",...i?{referrer:i}:{}}),r=(E,S,B,L,A=0)=>({type:"loaded",id:e.id,buckets:{},timing:{fetchMs:L,parseMs:A},diag:{status:E,bytes:S,layers:B,built:0}});if(!o.ok){if(o.status===404||o.status===204)return r(o.status,0,[],performance.now()-n);throw new Error(`HTTP ${o.status} \\u0434\\u043B\\u044F ${e.url}`)}let s=await o.arrayBuffer(),u=performance.now()-n;if(s.byteLength===0)return r(o.status,0,[],u);let l=performance.now(),c=new Lt(s),f=Object.keys(c.layers),{buckets:p,seams:m,splits:g,levels:y,failed:w}=Hs(c,e);return{type:"loaded",id:e.id,raw:s,buckets:p,...m.length?{seams:m}:{},...Object.keys(g).length?{splits:g}:{},...y.length?{levels:y}:{},timing:{fetchMs:u,parseMs:performance.now()-l},diag:{status:o.status,bytes:s.byteLength,layers:f,built:Object.keys(p).length,...w.length?{failed:w}:{}}}}function zs(e){return t=>{let n=t.lift,i=typeof n=="number"?n:typeof n=="string"?Number(n):NaN;return Number.isFinite(i)?Math.max(0,i):Math.max(0,Ve(t))*e}}function Xs(e){let t=e.lift,n=typeof t=="number"?t:typeof t=="string"?Number(t):NaN;return!Number.isFinite(n)||n===0?null:()=>n}function Ys(e,t){return n=>{let i=n.width,o=typeof i=="number"?i:typeof i=="string"?Number(i):NaN,r=Number.isFinite(o)&&o>0?o:e??0;return r>0?r+(t??0):null}}function $s(e){return t=>{let n=t.on;if(typeof n!="string"||!n)return 0;let i=0;for(let o of n.split(",")){let r=e[o];typeof r=="number"&&r>i&&(i=r)}return i}}function Ws(e,t,n){let i=t-1,o=t<n?t+1:24;return!(e.maxzoom<i||e.minzoom>o)}function Zs(e,t){return e<=6?Math.max(64,t/24):0}function En(e,t,n,i,o,r,s,u,l){{let c=Cr(l,t.extent);if(e.type==="fill"){let p=i>0?i/t.extent:0,m=e.cornerRadius&&p>0?{radius:e.cornerRadius/p,segments:e.cornerSegments,extent:t.extent,minCutRatio:0,maxChord:Qn/p}:void 0,g=mr(t,e.filter,n,m,e.clipToTile===!0,t.extent,Dt(e.dataPaint,o));return g?{kind:"fill",...g,extent:t.extent}:null}if(e.type==="surface"){let p=Zr(t,t.extent,e.filter,{metersPerUnit:i>0?i/t.extent:0,maxSegment:n,elevation:e.elevation??0,base:e.base,bevel:e.bevel,weld:e.weld,bevelDrop:e.bevelDrop,cornerRadius:e.cornerRadius,cornerSegments:e.cornerSegments,...r&&!e.fromLines&&e.groundField!==!1?{onShapes:m=>br(r,m,e.elevation??0,t.extent)}:{},...e.groundBy?{liftBy:$s(e.groundBy)}:{},...e.fromLines?{widthOf:Ys(e.width,e.widthExtra),widthExtra:e.widthExtra??0}:{},...e.deck?{deck:e.deck}:{},...e.levelHeight&&!e.groundBy?{liftBy:zs(e.levelHeight)}:{},liftAt:c});return p?{kind:"surface",...p}:null}if(e.type==="line"){let p=g=>c(g)??Xs(g),m=Jr(t,e.filter,n,e.ground?r:void 0,i>0?i/t.extent:0,{level:s,paint:Dt(e.dataPaint,o),liftAt:p});return m?{kind:"line",...m,extent:t.extent}:null}if(e.type==="model"){let p=ro(t,e.filter);return p?{kind:"placement",...p,extent:t.extent}:null}if(e.type==="symbol"){let p=no(t,{filter:e.filter,textField:e.textField,iconImage:e.iconImage,iconRotate:e.iconRotate,textPlacement:e.textPlacement,abbreviate:e.abbreviate});return p?{kind:"symbol",...p,extent:t.extent}:null}let f=ar(t,t.extent,e.filter,{metersPerUnit:i>0?i/t.extent:0,cornerRadius:e.cornerRadius,cornerSegments:e.cornerSegments,paint:Dt(e.dataPaint,o)},u);return f?{kind:"fill-extrusion",vertices:f.vertices,indices:f.indices,featureIds:f.featureIds,vertexCount:f.vertexCount,indexCount:f.indexCount,extent:f.extent,...f.dataPaint?{dataPaint:f.dataPaint}:{}}:null}}function Ks(e,t,n){let i=[];for(let o of e.features()){if(!pe(n,o.properties))continue;let r=o.properties[t];typeof r!="string"&&typeof r!="number"||i.includes(r)||i.push(r)}return i.sort((o,r)=>typeof o=="number"&&typeof r=="number"?o-r:String(o).localeCompare(String(r))),i}function Qs(e,t){let n=[];for(let i of e.features()){if(!pe(t,i.properties))continue;let o=Ve(i.properties);n.includes(o)||n.push(o)}return n.sort((i,o)=>i-o)}function Js(e,t,n){let i=["==",t,n];return e?["all",e,i]:i}var qs=e=>e.kind==="symbol",eu=e=>e.kind==="placement";function io(e){let t=[];e.raw&&t.push(e.raw);for(let n of Object.values(e.buckets)){if(eu(n)){t.push(n.anchors);continue}if(qs(n)){t.push(n.anchors,n.priorities),n.lines&&t.push(n.lines),n.lineStarts&&t.push(n.lineStarts);continue}t.push(n.vertices,n.indices),n.featureIds&&t.push(n.featureIds),n.dataPaint&&t.push(n.dataPaint),n.shapeFeatures&&t.push(n.shapeFeatures),n.shapeRanges&&t.push(n.shapeRanges)}return t}var so=Map;var st=new so,Fn=self;Fn.onmessage=e=>{let t=e.data;if(t.type==="abort"){st.get(t.id)?.abort(),st.delete(t.id);return}let n=new AbortController;st.set(t.id,n),oo(t,n.signal).then(i=>{st.has(t.id)&&(st.delete(t.id),Fn.postMessage(i,io(i)))}).catch(i=>{let o=n.signal.aborted;st.delete(t.id);let r={type:"error",id:t.id,message:i instanceof Error?i.message:String(i),aborted:o};Fn.postMessage(r)})};})();\n';var By=2,Qi=class{constructor(e=nl()){this.workers=[];this.blobUrl=null;this.pending=new fe;this.queue=new fe;this.busy=[];this.nextId=1;this.mainThreadAborts=new fe;this.destroyed=false;try{let t=new Blob([rl],{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,this.busy=new Array(this.workers.length).fill(0);}get size(){return this.workers.length}load(e,t,o=0){let r=this.nextId++,i={type:"load",id:r,...e};if(!this.usingWorkers){let a=new AbortController;return this.mainThreadAborts.set(r,a),Yh(i,a.signal).then(s=>{this.mainThreadAborts.has(r)&&(this.mainThreadAborts.delete(r),t(s));}).catch(s=>{let l=a.signal.aborted;this.mainThreadAborts.delete(r),t({type:"error",id:r,message:s instanceof Error?s.message:String(s),aborted:l});}),r}return this.queue.set(r,{message:i,resolve:t,priority:o}),this.pump(),r}pump(){for(;;){if(!this.queue.size)return;let e=-1;for(let r=0;r<this.busy.length;r++)this.busy[r]>=By||(e<0||this.busy[r]<this.busy[e])&&(e=r);if(e<0)return;let t=-1,o=null;for(let[r,i]of this.queue.entries())o&&i.priority>=o.priority||(t=r,o=i);if(!o)return;this.queue.delete(t),this.busy[e]++,this.pending.set(t,{resolve:o.resolve,workerIndex:e}),this.workers[e].postMessage(o.message);}}abort(e){if(!this.usingWorkers){this.mainThreadAborts.get(e)?.abort(),this.mainThreadAborts.delete(e);return}if(this.queue.delete(e))return;let t=this.pending.get(e);if(!t)return;this.pending.delete(e);let o={type:"abort",id:e};this.workers[t.workerIndex].postMessage(o),this.busy[t.workerIndex]--,this.pump();}onMessage(e){if(this.destroyed)return;let t=this.pending.get(e.id);t&&(this.pending.delete(e.id),this.busy[t.workerIndex]--,this.pump(),t.resolve(e));}disposeWorkers(){for(let e of this.workers)e.terminate();this.workers=[],this.blobUrl&&URL.revokeObjectURL(this.blobUrl),this.blobUrl=null;}destroy(){this.destroyed=true;for(let e of this.mainThreadAborts.values())e.abort();this.mainThreadAborts.clear(),this.pending.clear(),this.queue.clear(),this.busy=[],this.disposeWorkers();}};function nl(){let n=typeof navigator<"u"&&navigator.hardwareConcurrency||4;return Math.max(1,Math.min(n-1,6))}function id(n){return Math.max(0,Math.ceil((n*Math.LN2+Math.log(512/360/.5))/Math.LN10))}function il(n,e){let t=id(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 al(n,e){let t=n.replace(/^#/,"");if(!t)return null;if(e){let l=t.split("&").map(c=>c.split("=")).find(([c])=>c===e);if(!l||l.length<2)return null;t=l[1];}let o=t.split("/");if(o.length<3)return null;let r=Number(o[0]),i=Number(o[1]),a=Number(o[2]);if(!isFinite(r)||!isFinite(i)||!isFinite(a)||Math.abs(i)>90||Math.abs(a)>180)return null;let s={center:{lng:a,lat:i},zoom:r};return o.length>3&&isFinite(Number(o[3]))&&(s.bearing=Number(o[3])),o.length>4&&isFinite(Number(o[4]))&&(s.pitch=Number(o[4])),s}function ad(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());}function My(n,e,t,o){if(n.length<2)return [];let r=-o,i=-o,a=e+o,s=t+o,l=h=>h.x>=r&&h.x<=a&&h.y>=i&&h.y<=s,c=[],f=[],u=()=>{f.length>=2&&c.push(f),f=[];};for(let h=0;h+1<n.length;h++){let d=n[h],m=n[h+1],p=l(d),b=l(m);if(p&&b){f.length||f.push(d),f.push(m);continue}let g=_y(d,m,r,i,a,s);if(!g){u();continue}f.length||f.push(g[0]),f.push(g[1]),b||u();}return u(),c}function _y(n,e,t,o,r,i){let a=e.x-n.x,s=e.y-n.y,l=0,c=1,f=[[-a,n.x-t],[a,r-n.x],[-s,n.y-o],[s,i-n.y]];for(let[u,h]of f){if(u===0){if(h<0)return null;continue}let d=h/u;if(u<0){if(d>c)return null;d>l&&(l=d);}else {if(d<l)return null;d<c&&(c=d);}}return [{x:n.x+a*l,y:n.y+s*l},{x:n.x+a*c,y:n.y+s*c}]}var Ey=64,Qt=n=>`<svg viewBox="0 0 64 64" width="64" height="64" xmlns="http://www.w3.org/2000/svg">${n}</svg>`,$i=n=>Qt('<circle cx="32" cy="32" r="30" fill="#ffffff"/><circle cx="32" cy="32" r="26" fill="none" stroke="#c8102e" stroke-width="8"/>'+n),sl=n=>Qt('<circle cx="32" cy="32" r="30" fill="#0053a0"/>'+n),wn=n=>Qt('<path d="M32 4 61 56H3z" fill="#ffffff" stroke="#c8102e" stroke-width="7" stroke-linejoin="round"/>'+n),ll=(n,e="#0053a0")=>Qt(`<rect x="3" y="3" width="58" height="58" rx="6" fill="${e}"/>`+n),Sy={"sign-stop":Qt('<path d="M20.7 2h22.6L59 17.7v22.6L43.3 56H20.7L5 40.3V17.7z" fill="#c8102e"/><path d="M20.7 2h22.6L59 17.7v22.6L43.3 56H20.7L5 40.3V17.7z" fill="none" stroke="#ffffff" stroke-width="3"/><text x="32" y="36" font-family="Arial, Helvetica, sans-serif" font-size="17" font-weight="700" fill="#ffffff" text-anchor="middle">STOP</text>'),"sign-give-way":Qt('<path d="M32 58 3 6h58z" fill="#ffffff" stroke="#c8102e" stroke-width="7" stroke-linejoin="round"/>'),"sign-priority":Qt('<path d="M32 3 61 32 32 61 3 32z" fill="#ffffff"/><path d="M32 13 51 32 32 51 13 32z" fill="#ffd400"/>'),"sign-no-entry":Qt('<circle cx="32" cy="32" r="30" fill="#c8102e"/><rect x="11" y="27" width="42" height="10" rx="2" fill="#ffffff"/>'),"sign-no-traffic":$i('<line x1="14" y1="50" x2="50" y2="14" stroke="#c8102e" stroke-width="8" stroke-linecap="round"/>'),"sign-speed-40":$i('<text x="32" y="41" font-family="Arial, Helvetica, sans-serif" font-size="26" font-weight="700" fill="#1a1a1a" text-anchor="middle">40</text>'),"sign-speed-60":$i('<text x="32" y="41" font-family="Arial, Helvetica, sans-serif" font-size="26" font-weight="700" fill="#1a1a1a" text-anchor="middle">60</text>'),"sign-no-parking":Qt('<circle cx="32" cy="32" r="30" fill="#0053a0"/><circle cx="32" cy="32" r="26" fill="none" stroke="#c8102e" stroke-width="7"/><line x1="14" y1="50" x2="50" y2="14" stroke="#c8102e" stroke-width="7" stroke-linecap="round"/>'),"sign-roundabout":sl('<g fill="none" stroke="#ffffff" stroke-width="5" stroke-linecap="round"><path d="M32 16a16 16 0 1 1-13.9 8"/></g><path d="M14 18l8 8-11 2z" fill="#ffffff"/>'),"sign-straight":sl('<path d="M32 12 46 30h-8v22h-12V30h-8z" fill="#ffffff"/>'),"sign-keep-right":sl('<path d="M44 20v18H30v10l-14-14 14-14v10h6V20z" fill="#ffffff" transform="rotate(-45 32 32)"/>'),"sign-crossing":ll('<path d="M32 12 54 52H10z" fill="#ffffff"/><path d="M31 22a3.2 3.2 0 1 0 0-6.4 3.2 3.2 0 0 0 0 6.4z" fill="#1a1a1a"/><path d="M29 24h4l4 9-3 1-2-4v6l4 8h-4l-3-6-3 6h-4l5-10v-8l-3 5-3-1z" fill="#1a1a1a"/>'),"sign-parking":ll('<text x="32" y="45" font-family="Arial, Helvetica, sans-serif" font-size="38" font-weight="700" fill="#ffffff" text-anchor="middle">P</text>'),"sign-living-street":ll('<path d="M14 34 32 20l18 14v2H14z" fill="#ffffff"/><rect x="19" y="36" width="26" height="10" rx="3" fill="#ffffff"/><circle cx="25" cy="47" r="3" fill="#ffffff"/><circle cx="39" cy="47" r="3" fill="#ffffff"/>'),"sign-traffic-signals":wn('<rect x="26" y="22" width="12" height="28" rx="4" fill="#1a1a1a"/><circle cx="32" cy="28" r="3.4" fill="#e03131"/><circle cx="32" cy="36" r="3.4" fill="#f2c14b"/><circle cx="32" cy="44" r="3.4" fill="#37b24d"/>'),"sign-crossing-ahead":wn('<path d="M31 27a3 3 0 1 0 0-6 3 3 0 0 0 0 6z" fill="#1a1a1a"/><path d="M29 29h4l4 8-2.6 1.2L32 34v5l4 9h-4l-3-6-3 6h-4l5-10v-7l-2.6 4.6L22 34z" fill="#1a1a1a"/>'),"sign-level-crossing":wn('<path d="M20 44 44 24M20 24l24 20" stroke="#1a1a1a" stroke-width="5" stroke-linecap="round"/>'),"sign-hump":wn('<path d="M18 44c0-9 6-14 14-14s14 5 14 14z" fill="#1a1a1a"/>'),"sign-roadworks":wn('<path d="M28 20h8v6h-8z" fill="#1a1a1a"/><path d="M24 30h16l4 18H20z" fill="#1a1a1a"/>')};function Fy(n){let e=String(Math.round(n)),t=e.length>2?21:26;return $i(`<text x="32" y="41" font-family="Arial, Helvetica, sans-serif" font-size="${t}" font-weight="700" fill="#1a1a1a" text-anchor="middle">${e}</text>`)}function cl(n,e={}){let t=e.length??4.5,o=e.shaft??.45,r=e.head??1.6,i=e.headLength??1.4,a=e.branch??1.5,s=o/2,l=t/2,c=-t/2,f=l-i,u=()=>[c,-s,f,-s,f,-r/2,l,0,f,r/2,f,s,c,s,c,-s],h=(d,m)=>{let p=a,b=0,g=8,y=[m,-d*s];for(let A=0;A<=g;A++){let x=-Math.PI/2+Math.PI/2*(A/g);y.push(b+Math.cos(x)*(p+s),d*(p+Math.sin(x)*(p+s)));}y.push(b+p+r/2,d*p),y.push(b+p,d*(p+i)),y.push(b+p-r/2,d*p);for(let A=g;A>=0;A--){let x=-Math.PI/2+Math.PI/2*(A/g);y.push(b+Math.cos(x)*(p-s),d*(p+Math.sin(x)*(p-s)));}return y.push(m,d*s),y.push(m,-d*s),y};switch(n){case "straight":return [u()];case "left":return [h(-1,c)];case "right":return [h(1,c)];case "straight-left":case "straight-right":{let d=n==="straight-right"?1:-1;return [u(),h(d,c)]}case "u-turn":{let d=a,m=f-d,p=[],b=14;for(let y=0;y<=b;y++){let A=-Math.PI/2+Math.PI*y/b;p.push(m+Math.cos(A)*(d+s),Math.sin(A)*(d+s));}for(let y=b;y>=0;y--){let A=-Math.PI/2+Math.PI*y/b;p.push(m+Math.cos(A)*(d-s),Math.sin(A)*(d-s));}p.push(p[0],p[1]);let g=[m,-d-r/2,m-i,-d,m,-d+r/2,m,-d-r/2];return [ea(c,m,-s,s),p,g]}}}function Iy(n,e=4,t=.4,o=.6){let r=[],i=t+o,a=Math.max(Math.floor((n-t)/i)+1,1),s=(a-1)*i;for(let l=0;l<a;l++){let c=-s/2+l*i;r.push(ea(-e/2,e/2,c-t/2,c+t/2));}return r}function Dy(n,e=.4){return [ea(-e/2,e/2,-n/2,n/2)]}function Ty(n,e=.4,t=2){let o=[],r=n/2;for(let i of [1,-1])for(let a=-n;a<=n;a+=t){let s=ky(ea(-n,n,a-e/2,a+e/2),i*Math.PI/4),l=Ly(s,r);l&&o.push(l);}return o}function ea(n,e,t,o){return [n,t,e,t,e,o,n,o,n,t]}function ky(n,e){let t=Math.cos(e),o=Math.sin(e),r=[];for(let i=0;i+1<n.length;i+=2)r.push(n[i]*t-n[i+1]*o,n[i]*o+n[i+1]*t);return r}function Ly(n,e){let t=n.slice(),o=[[1,0,e],[-1,0,e],[0,1,e],[0,-1,e]];for(let[r,i,a]of o){let s=[],l=t.length/2;for(let c=0;c<l;c++){let f=t[c*2],u=t[c*2+1],h=t[(c+1)%l*2],d=t[(c+1)%l*2+1],m=r*f+i*u-a,p=r*h+i*d-a;if(m<=0&&s.push(f,u),m<=0!=p<=0){let b=m/(m-p);s.push(f+(h-f)*b,u+(d-u)*b);}}if(t=s,t.length<6)return null}return t.push(t[0],t[1]),t}function fl(n,e,t,o,r,i=r){let a=Math.cos(e),s=Math.sin(e),l=[];for(let c=0;c+1<n.length;c+=2){let f=n[c]*a-n[c+1]*s,u=n[c]*s+n[c+1]*a;l.push(t+f*r,o+u*i);}return l}var Eo=.25,Ry=20*Math.PI/180;function Py(n,e={}){let t=[],o=new Map,r=(f,u)=>Math.round(f/Eo)+","+Math.round(u/Eo),i=(f,u)=>{let h=r(f,u),d=o.get(h);if(d!==void 0)return d;let m=t.length;return t.push({x:f,y:u,rays:[],degree:0,crossing:false}),o.set(h,m),m},a=[];n.forEach((f,u)=>{let h=f.pts.length/2;if(h<2){a.push([-1,-1]);return}let d=f.pts[0],m=f.pts[1],p=f.pts[h*2-2],b=f.pts[h*2-1],g=i(d,m),y=i(p,b);a.push([g,y]);let A=f.level??0;t[g].rays.push({axis:u,atTail:false,level:A,width:f.width,cls:f.cls??"",oneway:!!f.oneway,angle:Math.atan2(f.pts[3]-m,f.pts[2]-d)}),t[y].rays.push({axis:u,atTail:true,level:A,width:f.width,cls:f.cls??"",oneway:!!f.oneway,angle:Math.atan2(f.pts[h*2-3]-b,f.pts[h*2-4]-p)});});for(let f of t){f.rays.sort((d,m)=>d.angle-m.angle),f.degree=f.rays.length;let u=new Map;for(let d of f.rays)u.set(d.level,(u.get(d.level)??0)+1);let h=0;for(let d of u.values())h=Math.max(h,d);f.crossing=h>=3;}let s=Uy(Oy(n,a,t),e.ringMax??Gy),l=e.smooth??0,c=e.refine??0;if(l>0||c>0){let f=e.maxSmooth??25;for(let u of s){let h=u.head===u.tail&&u.pts.length>=8,d=h?Xy(u.pts):u.pts;if(c>0){let m=e.densify??0;m>0&&(d=Da(d,m)),d=Po(d,c);}l>0&&(d=Er(d,Math.min(u.width*l,f))),u.pts=h?Jy(d,u.pts):d;}}return {nodes:t,ends:a,chains:s,clearance(f,u){return this.clearanceAt(f,u.angle,u.level,[u.axis])},nodeWidth(f,u){let h=t[f];if(!h)return 0;let d=0;for(let m of h.rays)m.level===u&&m.width>d&&(d=m.width);return d},clearanceAt(f,u,h,d){let m=t[f];if(!m||!m.crossing)return 0;let p=0;for(let b of m.rays){if(d.includes(b.axis)||b.level!==h)continue;let g=Math.abs(Hy(b.angle-u));if(g>Math.PI/2&&(g=Math.PI-g),g<Ry)continue;let y=b.width/2/Math.sin(g);y>p&&(p=y);}return p}}}function Hy(n){let e=n;for(;e<=-Math.PI;)e+=Math.PI*2;for(;e>Math.PI;)e-=Math.PI*2;return e}function Oy(n,e,t){let o=new Array(n.length).fill(false),r=(s,l)=>Math.abs(s.width-l.width)<.01&&(s.level??0)===(l.level??0)&&(s.cls??"")===(l.cls??"")&&!!s.oneway==!!l.oneway,i=(s,l)=>{let c=t[s];if(!c)return null;let f=n[l].level??0;if(c.rays.some(d=>d.level!==f))return null;let u=c.rays.filter(d=>d.level===f);if(u.length!==2)return null;let h=u.find(d=>d.axis!==l);return !h||o[h.axis]?null:r(n[l],n[h.axis])?h:null},a=[];for(let s=0;s<n.length;s++){if(o[s]||n[s].pts.length<4)continue;o[s]=true;let l=n[s].pts.slice(),c=[s],f=e[s][0],u=e[s][1];for(let d=0;d<4096;d++){let m=i(u,c[c.length-1]);if(!m)break;o[m.axis]=true;let p=m.atTail?cd(n[m.axis].pts):n[m.axis].pts;for(let b=2;b<p.length;b+=2)l.push(p[b],p[b+1]);u=m.atTail?e[m.axis][0]:e[m.axis][1],c.push(m.axis);}for(let d=0;d<4096;d++){let m=i(f,c[0]);if(!m)break;o[m.axis]=true;let p=m.atTail?n[m.axis].pts:cd(n[m.axis].pts),b=[];for(let g=0;g+3<p.length;g+=2)b.push(p[g],p[g+1]);l=b.concat(l),f=m.atTail?e[m.axis][0]:e[m.axis][1],c.unshift(m.axis);}let h=n[s];a.push({pts:l,axes:c,head:f,tail:u,width:h.width,level:h.level??0,oneway:!!h.oneway,lanes:h.lanes??0,cls:h.cls??""});}return a}var Gy=400,zy=.88,Wy=12,Ny=400;function Vy(n){let e=0;for(let t=2;t+1<n.length;t+=2)e+=Math.hypot(n[t]-n[t-2],n[t+1]-n[t-1]);return e}function Uy(n,e){if(!(e>0)||n.length<2)return n;let t=new Map,o=new Float64Array(n.length);for(let l=0;l<n.length;l++){let c=n[l];if(o[l]=Vy(c.pts),c.head!==c.tail)for(let f of [c.head,c.tail]){let u=t.get(f);u?u.push(l):t.set(f,[l]);}}let r=new Uint8Array(n.length),i=[];for(let l=0;l<n.length;l++){if(r[l]||n[l].head===n[l].tail||o[l]>e)continue;let c=n[l].head,f=null,u=zy,h=[{node:n[l].tail,path:[l],total:o[l]}],d=0;for(;h.length&&!(d++>Ny);){let m=h.pop();if(!(m.path.length>=Wy))for(let p of t.get(m.node)??[]){if(r[p]||m.path.includes(p))continue;let b=n[p];if(b.level!==n[l].level)continue;let g=m.total+o[p];if(g>e)continue;let y=b.head===m.node?b.tail:b.head,A=[...m.path,p];if(y!==c){h.push({node:y,path:A,total:g});continue}let x=sd(n,A,c);if(!x)continue;let v=Ky(x,g);v>u&&(u=v,f=A);}}if(f){for(let m of f)r[m]=1;i.push(f);}}if(!i.length)return n;let a=[],s=new Uint8Array(n.length);for(let l of i)for(let c of l)s[c]=1;for(let l=0;l<n.length;l++)s[l]||a.push(n[l]);for(let l of i){let c=n[l[0]].head,f=sd(n,l,c);if(!f){for(let h of l)a.push(n[h]);continue}let u=n[l[0]];for(let h of l)n[h].width>u.width&&(u=n[h]);a.push({pts:f,axes:l.flatMap(h=>n[h].axes),width:u.width,level:u.level,oneway:u.oneway,lanes:u.lanes,cls:u.cls,head:c,tail:c});}return a}function sd(n,e,t){let o=[],r=t;for(let a of e){let s=n[a],l=s.head===r;if(!l&&s.tail!==r)return null;let c=s.pts;if(l){for(let f=o.length?2:0;f+1<c.length;f+=2)o.push(c[f],c[f+1]);r=s.tail;}else {for(let f=c.length-(o.length?4:2);f>=0;f-=2)o.push(c[f],c[f+1]);r=s.head;}}if(o.length<8)return null;let i=o.length;return (o[0]!==o[i-2]||o[1]!==o[i-1])&&o.push(o[0],o[1]),o}function Ky(n,e){if(!(e>0))return 0;let t=0;for(let r=0;r+3<n.length;r+=2)t+=n[r]*n[r+3]-n[r+2]*n[r+1];let o=Math.abs(t/2);return 4*Math.PI*o/(e*e)}var ld=40;function Xy(n){let e=n.length/2,t=[],o=[],r=0;for(let a=e-1;a>0&&r<ld;a--)r+=Math.hypot(n[a*2]-n[a*2-2],n[a*2+1]-n[a*2-1]),t.unshift(n[a*2-2],n[a*2-1]);let i=0;for(let a=0;a+1<e&&i<ld;a++)i+=Math.hypot(n[a*2+2]-n[a*2],n[a*2+3]-n[a*2+1]),o.push(n[a*2+2],n[a*2+3]);return [...t,...n,...o]}function Jy(n,e){let t=e.length/2,o=e[0],r=e[1],i=e[t*2-2],a=e[t*2-1],s=(h,d,m,p)=>{let b=m,g=1/0;for(let y=m;y<=p;y++){let A=Math.hypot(n[y*2]-h,n[y*2+1]-d);A<g&&(g=A,b=y);}return b},l=n.length/2,c=s(o,r,0,Math.floor(l/2)),f=s(i,a,Math.floor(l/2),l-1);if(f-c<3)return e;let u=n.slice(c*2,(f+1)*2);return u[u.length-2]=u[0],u[u.length-1]=u[1],u}function cd(n){let e=[];for(let t=n.length-2;t>=0;t-=2)e.push(n[t],n[t+1]);return e}var jy=Math.sin(25*Math.PI/180);function Yy(n,e,t){if(!(e>0))return n;let o=(f,u)=>Math.round(f/Eo)+","+Math.round(u/Eo),r=new Map;for(let f of n){let u=f.pts.length/2;if(!(u<2))for(let[h,d]of [[f.pts[0],f.pts[1]],[f.pts[u*2-2],f.pts[u*2-1]]]){let m=o(h,d);r.set(m,(r.get(m)??0)+1);}}let i=Math.max(e*4,20),a=new Map;n.forEach((f,u)=>{for(let h=0;h+3<f.pts.length;h+=2){let d=Math.floor(Math.min(f.pts[h],f.pts[h+2])/i),m=Math.floor(Math.max(f.pts[h],f.pts[h+2])/i),p=Math.floor(Math.min(f.pts[h+1],f.pts[h+3])/i),b=Math.floor(Math.max(f.pts[h+1],f.pts[h+3])/i);for(let g=d;g<=m;g++)for(let y=p;y<=b;y++){let A=g+","+y,x=a.get(A);x||a.set(A,x=[]),x.push(u,h>>1);}}});let s=n.map(f=>f.pts.slice()),l=new Map;n.forEach((f,u)=>{let h=f.pts.length/2;if(!(h<2))for(let d of [true,false]){let m=d?f.pts[0]:f.pts[h*2-2],p=d?f.pts[1]:f.pts[h*2-1];if((r.get(o(m,p))??0)>1)continue;let b=a.get(Math.floor(m/i)+","+Math.floor(p/i));if(!b)continue;let g=d?f.pts[2]:f.pts[h*2-4],y=d?f.pts[3]:f.pts[h*2-3],A=Math.hypot(m-g,p-y)||1,x=(m-g)/A,v=(p-y)/A,w=1/0,C=-1,B=0,_=0,T=0,k=0;for(let z=0;z<b.length;z+=2){let L=b[z],X=b[z+1];if(L===u||(n[L].level??0)!==(f.level??0))continue;let Q=n[L].pts,G=Q[X*2],Y=Q[X*2+1],ie=Q[X*2+2]-G,ee=Q[X*2+3]-Y,ue=ie*ie+ee*ee;if(ue<1e-12||Math.abs(x*ee-v*ie)/Math.sqrt(ue)<jy)continue;let $=Math.max(0,Math.min(1,((m-G)*ie+(p-Y)*ee)/ue)),Ae=Math.hypot(G+ie*$-m,Y+ee*$-p);Ae<w&&(w=Ae,C=L,B=X,_=$,T=G+ie*$,k=Y+ee*$);}if(C<0||w>e||t&&!t(u,d,C,T,k))continue;let K=n[C].pts.length/2,P=B===0&&_<1e-6,W=B===K-2&&_>1-1e-6;if(!P&&!W){let z=l.get(C);z||l.set(C,z=[]),z.push({seg:B,t:_,x:T,y:k});}d?(s[u][0]=T,s[u][1]=k):(s[u][h*2-2]=T,s[u][h*2-1]=k);}});let c=[];return n.forEach((f,u)=>{let h=l.get(u);if(!h){c.push({...f,pts:s[u]});return}h.sort((b,g)=>b.seg-g.seg||b.t-g.t);let d=s[u],m=[d[0],d[1]],p=0;for(let b=0;b+3<d.length;b+=2){let g=b>>1;for(;p<h.length&&h[p].seg===g;){let{x:y,y:A}=h[p++],x=m[m.length-2],v=m[m.length-1];Math.hypot(y-x,A-v)>1e-6&&m.push(y,A),m.length>=4&&c.push({...f,pts:m}),m=[y,A];}m.push(d[b+2],d[b+3]);}m.length>=4&&c.push({...f,pts:m});}),c}function Zy(n,e,t=1.5){if(!(e>0))return n;let o=(a,s)=>Math.round(a/Eo)+","+Math.round(s/Eo),r=n.map(a=>({...a,pts:a.pts.slice()})),i=new Map;return r.forEach((a,s)=>{let l=a.pts.length/2;if(!(l<2))for(let c of [0,l-1]){let f=o(a.pts[2*c],a.pts[2*c+1]),u=i.get(f);u||i.set(f,u=[]),u.push([s,c]);}}),r.forEach((a,s)=>{let l=a.pts,c=l.length/2;if(c<6||Math.hypot(l[0]-l[2*c-2],l[1]-l[2*c-1])>Eo)return;let f=0,u=0,h=0,d=0;for(let he=0;he+1<c;he++)f+=Math.hypot(l[2*he+2]-l[2*he],l[2*he+3]-l[2*he+1]),u+=l[2*he]*l[2*he+3]-l[2*he+2]*l[2*he+1],h+=l[2*he],d+=l[2*he+1];if(u/=2,f>e||4*Math.PI*Math.abs(u)/(f*f)<qy)return;h/=c-1,d/=c-1;let m=0,p=0,b=0,g=0,y=0,A=0,x=0,v=0,w=0;for(let he=0;he+1<c;he++){let xe=l[2*he]-h,de=l[2*he+1]-d;m+=xe*xe,p+=de*de,b+=xe*de,g+=xe,y+=de,A+=xe*xe*xe,x+=de*de*de,v+=xe*de*de,w+=de*xe*xe;}let C=m*p-b*b;if(Math.abs(C)<1e-9)return;let B=(A+v)/2,_=(x+w)/2,T=(B*p-_*b)/C,k=(_*m-B*b)/C,K=h+T,P=d+k,W=c-1,z=Math.sqrt(T*T+k*k+(m+p)/W-2*(T*g+k*y)/W);if(!(z>1))return;let L=0;for(let he=0;he+1<c;he++)L=Math.max(L,Math.abs(Math.hypot(l[2*he]-K,l[2*he+1]-P)-z)/z);if(L>Qy)return;let X=u>0,Q=Math.atan2(l[1]-P,l[0]-K),G=he=>{let xe=X?he-Q:Q-he;for(;xe<0;)xe+=Math.PI*2;for(;xe>=Math.PI*2;)xe-=Math.PI*2;return xe},Y=[];for(let he=1;he+1<c;he++){let xe=(i.get(o(l[2*he],l[2*he+1]))??[]).filter(([de])=>de!==s);xe.length&&Y.push({t:G(Math.atan2(l[2*he+1]-P,l[2*he]-K)),moves:xe});}let ie=(i.get(o(l[0],l[1]))??[]).filter(([he])=>he!==s),ee=Math.max(24,Math.ceil(Math.PI*2*z/t)),ue=[];for(let he=0;he<ee;he++)ue.push(he/ee*Math.PI*2);for(let he of Y)ue.push(he.t);ue.sort((he,xe)=>he-xe);let $=he=>{let xe=X?Q+he:Q-he;return [K+z*Math.cos(xe),P+z*Math.sin(xe)]},Ae=[];for(let he of ue){let xe=Ae.length?[Ae[Ae.length-2],Ae[Ae.length-1]]:null,[de,we]=$(he);xe&&Math.hypot(de-xe[0],we-xe[1])<.05||Ae.push(de,we);}Ae.push(Ae[0],Ae[1]),r[s].pts=Ae;let ve=(he,xe,de)=>{for(let[we,I]of he)r[we].pts[2*I]=xe,r[we].pts[2*I+1]=de;};for(let he of Y)ve(he.moves,...$(he.t));ve(ie,Ae[0],Ae[1]);}),r}var qy=.85,Qy=.15;var $y={edgeInset:.2,centreGap:.22,minWidth:6,skipClasses:["service","track"],crossingClasses:["motorway","trunk","primary","secondary"],setback:1,minPiece:6,zebraDepth:4,zebraStep:1.05,zebra:true,keepOut:()=>false,crossingAt:()=>null,throughStop:true,axes:[],maxGrow:1.6,taper:12};function e2(n,e={}){let t={...$y,...e},o=[];for(let r=0;r<n.chains.length;r++){let i=n.chains[r];if(i.width<t.minWidth||t.skipClasses.includes(i.cls)||i.level<0)continue;let a=i.pts.length/2,s=Math.atan2(i.pts[3]-i.pts[1],i.pts[2]-i.pts[0]),l=Math.atan2(i.pts[a*2-3]-i.pts[a*2-1],i.pts[a*2-4]-i.pts[a*2-2]),c=n.clearanceAt(i.head,s,i.level,i.axes),f=n.clearanceAt(i.tail,l,i.level,i.axes),u=t.axes[r],h=u&&u.length>=4?u:i.pts,d=i2(h,c>0?c+t.setback:0,f>0?f+t.setback:0),m=n2(d,(P,W)=>t.keepOut(P,W,i),t.setback);if(m.length<4||vn(m)<t.minPiece)continue;let p=P=>{let W=P<0?0:m.length-2,z=P<0?0:d.length-2;return Math.hypot(m[W]-d[z],m[W+1]-d[z+1])<.5},b=P=>{let W=n.nodeWidth(P,i.level),L=n.nodes[P]&&!n.nodes[P].crossing&&n.nodes[P].degree===2?W:Math.min(W,i.width*t.maxGrow);return Math.max(L/2-i.width/2,0)},g=b(i.head),y=b(i.tail),A=vn(h),x=P=>Math.min(Math.max(t.taper,P*r2),A/2),v=x(g),w=x(y),C=c>0?c+t.setback:0,B=P=>{let W=C+P,z=0;return g>0&&W<v&&(z=g*(1-W/v)),y>0&&A-W<w&&(z=Math.max(z,y*(1-(A-W)/w))),i.width/2+z},_=(P,W)=>{P.length>=4&&o.push({kind:W,pts:P,cls:i.cls,level:i.level,chain:r});};if(_(ul(m,P=>-(B(P)-t.edgeInset)),"edge"),_(ul(m,P=>B(P)-t.edgeInset),"edge"),i.oneway||(_(hl(m,-t.centreGap),"centre"),_(hl(m,t.centreGap),"centre")),i.lanes>=2){let P=i.width/i.lanes;for(let W=1;W<i.lanes;W++){let z=-i.width/2+W*P;if(!i.oneway&&Math.abs(z)<P/2)continue;let L=z/(i.width/2);_(ul(m,X=>L*B(X)),"lane");}}let T=(P,W)=>{let z=n.nodes[P];if(!z)return false;for(let L of z.rays){if(i.axes.includes(L.axis)||L.level!==i.level)continue;let X=Math.abs(md(L.angle-W));if(X>Math.PI/2&&(X=Math.PI-X),X>=t2)return true}return false},k=(P,W)=>{let z=n.nodes[P];if(!z)return false;let L=z.rays.filter(Y=>!i.axes.includes(Y.axis)&&Y.level===i.level);if(L.length!==2)return false;let X=dd(i.cls),[Q,G]=L.map(Y=>dd(Y.cls));return X>Q&&X>G?false:Q>X||G>X?Q>X&&G<=X||G>X&&Q<=X:L.some(Y=>Math.abs(md(Y.angle-W))>Math.PI-o2)},K=(P,W)=>t.throughStop||!k(P,W);if(t.crossingClasses.includes(i.cls)){let P=(z,L)=>{let X=t.crossingAt(i,r,z);return X===null?null:X-L},W=f>0?f+t.setback:0;c>0&&p(-1)&&T(i.head,s)&&o.push(...fd(m,i,r,t,-1,P(i.head,C),K(i.head,s))),f>0&&p(1)&&T(i.tail,l)&&o.push(...fd(m,i,r,t,1,P(i.tail,W),K(i.tail,l)));}}return o}function fd(n,e,t,o,r,i,a=true){let s=[],l=e.width/2-o.edgeInset,c=(b,g)=>{s.push({kind:g,pts:b,cls:e.cls,level:e.level,chain:t});},f=o.zebraDepth/2+.6,u=i===null?f:i,h=u+o.zebraDepth/2+2.4;if((u<0||vn(n)<h+2)&&(u=f,h=u+o.zebraDepth/2+2.4,vn(n)<h+2))return s;if(a){let b=ud(n,h,r);c([...ta(b,e.oneway?-l:o.centreGap+.1,0),...ta(b,l,0)],"stop");}if(!o.zebra)return s;let d=ud(n,u,r),m=Math.max(Math.floor((e.width-.6)/o.zebraStep),2),p=(m-1)*o.zebraStep;for(let b=0;b<m;b++){let g=-p/2+b*o.zebraStep;c([...ta(d,g,-o.zebraDepth/2),...ta(d,g,o.zebraDepth/2)],"zebra");}return s}function ud(n,e,t){let o=t>0?Cn(n):n,r=e,i=0;for(;i+3<o.length;i+=2){let h=Math.hypot(o[i+2]-o[i],o[i+3]-o[i+1]);if(h>r)break;r-=h;}let a=o[i],s=o[i+1],l=o[i+2]??a,c=o[i+3]??s,f=Math.hypot(l-a,c-s)||1,u=Math.min(r/f,1);return {x:a+(l-a)*u,y:s+(c-s)*u,dx:-(l-a)/f,dy:-(c-s)/f}}function ta(n,e,t){return [n.x+n.dy*e+n.dx*t,n.y-n.dx*e+n.dy*t]}var t2=35*Math.PI/180,hd=["motorway","trunk","primary","secondary","tertiary","unclassified","residential","living_street","service"],dd=n=>{let e=hd.indexOf(n);return e<0?hd.length:e},o2=30*Math.PI/180,r2=15;function ul(n,e){let t=n.length/2;if(t<2)return [];let o=[0];for(let i=1;i<t;i++)o.push(o[i-1]+Math.hypot(n[i*2]-n[i*2-2],n[i*2+1]-n[i*2-1]));let r=[];for(let i=0;i<t;i++){let a=hl(n.slice(Math.max(0,i-1)*2,Math.min(t,i+2)*2),e(o[i])),s=i===0?0:1;r.push(a[s*2],a[s*2+1]);}return r}function hl(n,e){let t=n.length/2,o=[];for(let r=0;r<t;r++){let i=n[Math.max(r-1,0)*2],a=n[Math.max(r-1,0)*2+1],s=n[r*2],l=n[r*2+1],c=n[Math.min(r+1,t-1)*2],f=n[Math.min(r+1,t-1)*2+1],u=Math.hypot(s-i,l-a),h=Math.hypot(c-s,f-l),d=u>0?(s-i)/u:(c-s)/(h||1),m=u>0?(l-a)/u:(f-l)/(h||1),p=h>0?(c-s)/h:d,b=h>0?(f-l)/h:m,g=d+p,y=m+b,A=Math.hypot(g,y);A<1e-6?(g=d,y=m):(g/=A,y/=A);let x=Math.max(g*d+y*m,.2),v=e/x;o.push(s+y*v,l-g*v);}return o}function n2(n,e,t){if(n.length<4)return n;let o=.5,r=i=>{if(i.length<4||!e(i[0],i[1]))return i;let a=vn(i),s=0,l=0,c=0,f=Math.hypot(i[2]-i[0],i[3]-i[1]);for(;s<a;){for(s+=o;s>c+f&&l+5<i.length;)c+=f,l+=2,f=Math.hypot(i[l+2]-i[l],i[l+3]-i[l+1]);let u=f>0?Math.min((s-c)/f,1):0,h=i[l]+(i[l+2]-i[l])*u,d=i[l+1]+(i[l+3]-i[l+1])*u;if(!e(h,d))return dl(i,Math.min(s+t,a))}return []};return Cn(r(Cn(r(n))))}function i2(n,e,t){let o=dl(n,e);return Cn(dl(Cn(o),t))}function dl(n,e){if(e<=0||n.length<4)return n;let t=e;for(let o=0;o+3<n.length;o+=2){let r=Math.hypot(n[o+2]-n[o],n[o+3]-n[o+1]);if(r>t){let i=t/r;return [n[o]+(n[o+2]-n[o])*i,n[o+1]+(n[o+3]-n[o+1])*i,...n.slice(o+2)]}t-=r;}return []}function vn(n){let e=0;for(let t=0;t+3<n.length;t+=2)e+=Math.hypot(n[t+2]-n[t],n[t+3]-n[t+1]);return e}function Cn(n){let e=[];for(let t=n.length-2;t>=0;t-=2)e.push(n[t],n[t+1]);return e}function md(n){let e=n;for(;e<=-Math.PI;)e+=Math.PI*2;for(;e>Math.PI;)e-=Math.PI*2;return e}var a2={classes:["motorway","trunk","primary","secondary","tertiary"],setback:14,length:5,minApproach:25,straightAngle:35*Math.PI/180,maxAngle:150*Math.PI/180,blocked:()=>false,retreat:7};function s2(n,e={}){let t={...a2,...e},o=[];for(let r=0;r<n.chains.length;r++){let i=n.chains[r];if(!t.classes.includes(i.cls)||i.lanes<1||i.level<0||pd(i.pts)<t.minApproach)continue;let a=i.oneway?[{node:i.tail,dir:1}]:[{node:i.tail,dir:1},{node:i.head,dir:-1}];for(let s of a){let l=f2(i.pts,s.dir),c=l2(n,s.node,l,i,t);if(!c.length)continue;let f=n.clearanceAt(s.node,l+Math.PI,i.level,i.axes);if(f<=0)continue;let u=c2(c,i.lanes,i.oneway);if(!u.length)continue;let h=null,d=0;for(let y=0;y<3;y++){d=f+t.setback+y*t.retreat;let A=u2(i.pts,d,s.dir);if(!A)break;if(!t.blocked(A.x,A.y)){h=A;break}}if(!h)continue;let m=s.dir===1?Math.max(0,pd(i.pts)-d):d,b=(i.oneway?i.width:i.width/2)/u.length,g=i.oneway?-i.width/2:0;u.forEach((y,A)=>{let x=g+b*(A+.5),v=h.x+h.nx*x,w=h.y+h.ny*x;for(let C of cl(y,{length:t.length}))o.push({kind:y,pts:fl(C,h.angle,v,w,1,1),cls:i.cls,level:i.level,chain:r,at:m});});}}return o}function l2(n,e,t,o,r){let i=n.nodes[e];if(!i||!i.crossing)return [];let a=new Set;for(let l of i.rays){if(o.axes.includes(l.axis)||l.level!==o.level||l.oneway&&l.atTail)continue;let c=h2(l.angle-t),f=Math.abs(c);f>r.maxAngle||(f<=r.straightAngle?a.add("straight"):c>0?a.add("left"):a.add("right"));}return ["left","straight","right"].filter(l=>a.has(l))}function c2(n,e,t){let o=Math.max(t?e:Math.floor(e/2),1);if(o<1)return [];let r=n.includes("left"),i=n.includes("right"),a=n.includes("straight");if(o===1)return a&&i?["straight-right"]:a&&r?["straight-left"]:r&&i?["straight-left"]:r?["left"]:i?["right"]:["straight"];let s=new Array(o).fill("straight");if(r&&(s[0]=a&&o===2?"straight-left":"left"),i&&(s[o-1]=a&&o===2&&r||a?"straight-right":"right"),!a)for(let l=0;l<o;l++)s[l]==="straight"&&(s[l]=r&&(!i||l<o/2)?"left":"right");return s}function f2(n,e){let t=n.length/2;return e>0?Math.atan2(n[t*2-1]-n[t*2-3],n[t*2-2]-n[t*2-4]):Math.atan2(n[1]-n[3],n[0]-n[2])}function u2(n,e,t){let o=t>0?d2(n):n,r=e,i=0;for(;i+3<o.length;i+=2){let m=Math.hypot(o[i+2]-o[i],o[i+3]-o[i+1]);if(m>r)break;r-=m;}if(i+3>=o.length)return null;let a=o[i],s=o[i+1],l=o[i+2],c=o[i+3],f=Math.hypot(l-a,c-s)||1,u=Math.min(r/f,1),h=-(l-a)/f,d=-(c-s)/f;return {x:a+(l-a)*u,y:s+(c-s)*u,angle:Math.atan2(d,h),nx:d,ny:-h}}function h2(n){let e=n;for(;e<=-Math.PI;)e+=Math.PI*2;for(;e>Math.PI;)e-=Math.PI*2;return e}function pd(n){let e=0;for(let t=0;t+3<n.length;t+=2)e+=Math.hypot(n[t+2]-n[t],n[t+3]-n[t+1]);return e}function d2(n){let e=[];for(let t=n.length-2;t>=0;t-=2)e.push(n[t],n[t+1]);return e}function ml(n,e,t=24){let o=n.length/2;if(o<3||!(e>0))return n;let r=n.slice(),i=n.slice(),a=e;for(let s=0;s<t;s++){let l=0,c=r.slice();for(let f=1;f<o-1;f++){let u=r[f*2-2],h=r[f*2-1],d=r[f*2],m=r[f*2+1],p=r[f*2+2],b=r[f*2+3],g=Math.hypot(d-u,m-h),y=Math.hypot(p-d,b-m),A=Math.hypot(p-u,b-h),x=Math.abs((d-u)*(b-h)-(m-h)*(p-u));if(x<1e-9||g<1e-9||y<1e-9)continue;let v=g*y*A/(2*x);if(v>=e)continue;l=Math.max(l,e-v);let w=Math.min(.5,1-v/e),C=(u+p)/2,B=(h+b)/2,_=d+(C-d)*w,T=m+(B-m)*w,k=_-i[f*2],K=T-i[f*2+1],P=Math.hypot(k,K);P>a&&(_=i[f*2]+k/P*a,T=i[f*2+1]+K/P*a),c[f*2]=_,c[f*2+1]=T;}if(r.splice(0,r.length,...c),l<e*.01)break}return r}function gd(n,e,t=30,o=1/0){let r=n.length/2;if(r<3||!(e>0))return n;let i=n.slice(),a=n.slice();for(let s=0;s<t;s++){let l=0,c=i.slice();for(let f=1;f<r-1;f++){let u=i[f*2-2],h=i[f*2-1],d=i[f*2],m=i[f*2+1],p=i[f*2+2],b=i[f*2+3],g=Math.hypot(d-u,m-h),y=Math.hypot(p-d,b-m);if(g<1e-9||y<1e-9)continue;let A=((d-u)*(p-d)+(m-h)*(b-m))/(g*y),x=Math.acos(Math.max(-1,Math.min(1,A)));if(x<=e)continue;l=Math.max(l,x-e);let v=Math.min(.6,(x-e)/Math.PI+.15),w=d+((u+p)/2-d)*v,C=m+((h+b)/2-m)*v,B=w-a[f*2],_=C-a[f*2+1],T=Math.hypot(B,_);T>o&&(w=a[f*2]+B/T*o,C=a[f*2+1]+_/T*o),c[f*2]=w,c[f*2+1]=C;}if(i.splice(0,i.length,...c),l<.01)break}return i}function Bn(n,e,t={}){if(n.length<4||!(e>0))return null;let o=t.safety??1.15,r=t.iterations??40,i=t.maxTurn??Math.PI/6,a=ml(n,e*o,r),s=Er(a,e*1.3,12),l=ml(s,e*o,r),c=gd(l,i,r,e*2),f=c.length/2,u=[],h=[],d=new Float64Array(f);for(let p=1;p<f;p++)d[p]=d[p-1]+Math.hypot(c[p*2]-c[p*2-2],c[p*2+1]-c[p*2-1]);let m=t.halfAt;for(let p=0;p<f;p++){let b=c[Math.max(p-1,0)*2],g=c[Math.max(p-1,0)*2+1],y=c[p*2],A=c[p*2+1],x=c[Math.min(p+1,f-1)*2],v=c[Math.min(p+1,f-1)*2+1],w=Math.hypot(y-b,A-g),C=Math.hypot(x-y,v-A),B=w>1e-9?(y-b)/w:(x-y)/Math.max(C,1e-9),_=w>1e-9?(A-g)/w:(v-A)/Math.max(C,1e-9),T=C>1e-9?(x-y)/C:B,k=C>1e-9?(v-A)/C:_,K=B+T,P=_+k,W=Math.hypot(K,P);W<1e-9?(K=B,P=_):(K/=W,P/=W);let z=Math.max(K*B+P*_,.5),L=(m?Math.max(m(d[p]),.01):e)/z;u.push(y-P*L,A+K*L),h.push(y+P*L,A-K*L);}return {left:u,centre:c,right:h}}function pl(n,e){let t=n.length/2-1;if(t<3||!(e>0))return null;let o=[],r=[],i=[];for(let a=0;a<t;a++){let s=(a+t-1)%t,l=(a+1)%t,c=n[s*2],f=n[s*2+1],u=n[a*2],h=n[a*2+1],d=n[l*2],m=n[l*2+1],p=Math.hypot(u-c,h-f),b=Math.hypot(d-u,m-h);if(p<1e-9||b<1e-9)continue;let g=(u-c)/p,y=(h-f)/p,A=(d-u)/b,x=(m-h)/b,v=g+A,w=y+x,C=Math.hypot(v,w);C<1e-9?(v=g,w=y):(v/=C,w/=C);let B=Math.max(v*g+w*y,.5),_=e/B;i.push(u,h),o.push(u-w*_,h+v*_),r.push(u+w*_,h-v*_);}if(i.length<6)return null;for(let a of [o,i,r])a.push(a[0],a[1]);return {left:o,centre:i,right:r}}function bl(n,e,t=8,o=false,r=false){let{left:i,centre:a,right:s}=n,l=[];for(let c=0;c+1<s.length;c+=2)l.push(s[c],s[c+1]);r||bd(l,a[a.length-2],a[a.length-1],s[s.length-2],s[s.length-1],i[i.length-2],i[i.length-1],e,t);for(let c=i.length-2;c>=0;c-=2)l.push(i[c],i[c+1]);return o||bd(l,a[0],a[1],i[0],i[1],s[0],s[1],e,t),l.push(l[0],l[1]),l}function bd(n,e,t,o,r,i,a,s,l){let c=Math.hypot(o-e,r-t),f=Math.hypot(i-e,a-t),u=c>1e-6&&f>1e-6?(c+f)/2:s,h=Math.atan2(r-t,o-e),m=Math.atan2(a-t,i-e)-h;for(;m<=0;)m+=Math.PI*2;let p=Math.max(2,Math.round(m/Math.PI*l));for(let b=1;b<p;b++){let g=h+m*b/p;n.push(e+Math.cos(g)*u,t+Math.sin(g)*u);}}var m2={taper:12,maxGrow:1.6,cornerRadius:6,widthExtra:0,cluster:40,tolerance:.1,trim:false,edges:false,merge:false,mergeClasses:false,apart:()=>false,fillet:0};function p2(n,e={}){let t={...m2,...e},o=[];for(let r=0;r<n.chains.length;r++){let i=n.chains[r],a=i.width+t.widthExtra,s=a/2,l=C=>{let B=n.nodeWidth(C,i.level)+t.widthExtra,T=n.nodes[C]&&!n.nodes[C].crossing&&n.nodes[C].degree===2?B:Math.min(B,a*t.maxGrow);return Math.max(T/2-s,0)},c=l(i.head),f=l(i.tail),u=oa(i.pts),h=C=>Math.min(Math.max(t.taper,C*S2),u/2),d=h(c),m=h(f),p=c>0||f>0?C=>{let B=0;return c>0&&C<d&&(B=c*(1-C/d)),f>0&&u-C<m&&(B=Math.max(B,f*(1-(u-C)/m))),s+B}:void 0,b=i.pts,g=null,y=null;if(t.trim&&t.edges){let C=b.length,B=Math.atan2(b[3]-b[1],b[2]-b[0]),_=Math.atan2(b[C-3]-b[C-1],b[C-4]-b[C-2]);g=xl(n,i.head,B,i,t),y=xl(n,i.tail,_,i,t);}else if(t.trim){let C=b.length/2,B=Math.atan2(b[3]-b[1],b[2]-b[0]),_=Math.atan2(b[C*2-3]-b[C*2-1],b[C*2-4]-b[C*2-2]),T=Bd(n,i.head,B,i),k=Bd(n,i.tail,_,i);if(T>0||k>0){let K=F2(b,T,k);K.length>=4&&oa(K)>2&&(b=K);}}let A=t.edges?b:_2(b,s*.33),x=p?T2(A,[d,u-m]):A,v=i.head===i.tail&&i.pts.length>=8&&B2(i.pts,s);if(t.edges&&v){let C=pl(i.pts,s);if(C){let B=So(C.left),_=So(C.right),T=Math.abs(B)>=Math.abs(_)?C.left:C.right,k=T===C.left?C.right:C.left,K=So(T)<0?yl(T):T,P=So(k)>0?yl(k):k;o.push({kind:"carriageway",chain:r,outer:K,holes:[P],cls:i.cls,level:i.level,width:a,edges:C,head:i.head,tail:i.tail});continue}}if(t.edges&&!v){for(let C of [x]){let B=Bn(C,s,{halfAt:p});if(!B)continue;if(g||y){let k=W=>{let z=W;return g&&(z=Cd(z,g,true)),y&&(z=Cd(z,y,false)),z},K={left:k(B.left),centre:k(B.centre),right:k(B.right)},P=Math.abs(oa(K.left)-oa(K.right));K.left.length>=4&&K.centre.length>=4&&K.right.length>=4&&P<a*4&&(B=K);}let _=p?p(u):s,T=bl(B,Math.max(_,s),8,!!g,!!y);if(wl(T)){for(let k of pi({outer:T,holes:[]}))o.push({kind:"carriageway",chain:r,outer:k.outer,holes:k.holes,cls:i.cls,level:i.level,width:a,edges:B,head:i.head,tail:i.tail});continue}o.push({kind:"carriageway",chain:r,outer:T,holes:[],cls:i.cls,level:i.level,width:a,edges:B,head:i.head,tail:i.tail});}continue}let w=v?[x]:M2(x,Math.PI*.8);for(let C of w){let B=zo(C,{halfWidth:s+Math.max(c,f),halfWidthAt:p,metersPerUnit:1,closed:v});if(!B)continue;let _=B.outer;if(wl(_)){for(let T of pi({outer:B.outer,holes:B.holes}))o.push({kind:"carriageway",chain:r,outer:T.outer,holes:T.holes,cls:i.cls,level:i.level,width:a});continue}o.push({kind:"carriageway",chain:r,outer:_,holes:B.holes,cls:i.cls,level:i.level,width:a});}}for(let r of x2(n,t))o.push(r);for(let r of A2(n,t))o.push(r);return t.merge?b2(o,t):o}function b2(n,e){let t=new Map,o=[];for(let r of n){if(r.level!==0||e.apart(r)){o.push(r);continue}let i=e.mergeClasses?String(r.level):r.level+"|"+r.cls,a=t.get(i);a?a.push(r):t.set(i,[r]);}for(let r of t.values()){if(r.length<2){o.push(...r);continue}let i=Uo(r.map(c=>({outer:c.outer,holes:c.holes}))),a=r[0];for(let c of r)c.width>a.width&&(a=c);let s=[];for(let c of r)c.edges&&c.chain!==void 0&&s.push({chain:c.chain,edges:c.edges});let l=true;for(let c of i){let f=Po(dt(vd(wd(c.outer),e.tolerance),{radius:e.cornerRadius,segments:8,minCutRatio:0}),1);o.push({kind:"carriageway",outer:f,holes:c.holes.filter(u=>Math.abs(So(u))>=E2).map(u=>Po(dt(vd(wd(u),e.tolerance),{radius:e.cornerRadius,segments:8,minCutRatio:0}),1)),cls:a.cls,level:a.level,width:a.width,sourceEdges:l&&s.length?s:void 0}),l=false;}}return o}var yd=.8,g2=35*Math.PI/180,y2=150*Math.PI/180;function A2(n,e){let t=[];if(!(e.fillet>0))return t;let o=new Map;for(let r of n.chains)for(let i of r.axes)o.set(i,r);for(let r=0;r<n.nodes.length;r++){let i=n.nodes[r];if(!i.crossing)continue;let a=new Map;for(let s of i.rays){let l=a.get(s.level);l?l.push(s):a.set(s.level,[s]);}for(let s of a.values()){if(s.length<2)continue;let l=(c,f)=>{let u=c.width+e.widthExtra,h=n.nodeWidth(r,c.level)+e.widthExtra,d=Math.max(Math.min(h,u*e.maxGrow),u)/2;return !(e.taper>0)||f>=e.taper?u/2:u/2+(d-u/2)*(1-f/e.taper)};for(let c=0;c<s.length;c++){let f=s[c],u=s[(c+1)%s.length],h=u.angle-f.angle;for(;h<=0;)h+=Math.PI*2;for(;h>Math.PI*2;)h-=Math.PI*2;if(h<g2||h>y2)continue;let d=xd(i.x,i.y,f,u,l(f,1/0),l(u,1/0),h,e);if(d&&(d=xd(i.x,i.y,f,u,l(f,d.awayA),l(u,d.awayB),h,e)),d){let m=Ad(o.get(f.axis),d.touchA,l(f,d.awayA)),p=Ad(o.get(u.axis),d.touchB,l(u,d.awayB));m&&p&&t.push({...d,nodes:[r]});}}}}return t}function Ad(n,e,t){if(!n)return false;let o=n.pts,r=1/0;for(let i=0;i+3<o.length;i+=2){let a=o[i+2]-o[i],s=o[i+3]-o[i+1],l=a*a+s*s,c=l>0?Math.max(0,Math.min(1,((e[0]-o[i])*a+(e[1]-o[i+1])*s)/l)):0,f=Math.hypot(e[0]-(o[i]+a*c),e[1]-(o[i+1]+s*c));f<r&&(r=f);}return r<=t+.5}function xd(n,e,t,o,r,i,a,s){let l=Math.cos(t.angle),c=Math.sin(t.angle),f=Math.cos(o.angle),u=Math.sin(o.angle),h=n-c*r,d=e+l*r,m=n+u*i,p=e-f*i,b=l*u-c*f;if(Math.abs(b)<1e-6)return null;let g=((m-h)*u-(p-d)*f)/b,y=((m-h)*c-(p-d)*l)/b;if(!(g>0)||!(y>0))return null;let A=h+l*g,x=d+c*g;if(Math.hypot(A-n,x-e)>Math.max(r,i)*2)return null;let v=a/2,w=Math.max(r,i)*1.5,C=Math.min(s.fillet,Math.min(r,i)*1.6,w*Math.tan(v));if(C<1)return null;let B=C/Math.tan(v),_=l+f,T=c+u,k=Math.hypot(_,T);if(k<1e-9)return null;_/=k,T/=k;let K=A+_*C/Math.sin(v),P=x+T*C/Math.sin(v),W=A+l*B,z=x+c*B,L=A+f*B,X=x+u*B,Q=Math.atan2(z-P,W-K),Y=Math.atan2(X-P,L-K)-Q;for(;Y>Math.PI;)Y-=Math.PI*2;for(;Y<-Math.PI;)Y+=Math.PI*2;let ie=r*yd,ee=i*yd,ue=W+c*ie,$=z-l*ie,Ae=L-u*ee,ve=X+f*ee,he=Al(n-c*(r-ie),e+l*(r-ie),l,c,n+u*(i-ee),e-f*(i-ee),f,u);if(!he)return null;let xe=he[0],de=he[1],we=[ue,$,W,z],I=Math.max(3,Math.round(Math.abs(Y)/(8*Math.PI/180)));for(let ce=1;ce<I;ce++){let ae=Q+Y*ce/I;we.push(K+Math.cos(ae)*C,P+Math.sin(ae)*C);}we.push(L,X,Ae,ve,xe,de,ue,$);let J=So(we)<0?yl(we):we,Z=t.width>=o.width?t:o;return {kind:"fillet",outer:J,holes:[],cls:Z.cls,level:Z.level,width:Z.width+s.widthExtra,awayA:Math.hypot(W-n,z-e),awayB:Math.hypot(L-n,X-e),touchA:[W,z],touchB:[L,X]}}function x2(n,e){let t=[],o=new Map;for(let r=0;r<n.nodes.length;r++){let i=n.nodes[r];if(!i.crossing)continue;let a=new Map;for(let s of i.rays)a.set(s.level,(a.get(s.level)??0)+1);for(let[s,l]of a){if(l<3)continue;let c=o.get(s);c?c.push(r):o.set(s,[r]);}}for(let[r,i]of o)for(let a of v2(n,i,r,e.cluster)){let s=C2(n,a,r,e);s&&t.push(s);}return t}var w2=1.5;function v2(n,e,t,o){let r=new Map;for(let l of e)r.set(l,l);let i=l=>{let c=l;for(;r.get(c)!==c;)c=r.get(c);return c},a=(l,c)=>{let f=i(l),u=i(c);f!==u&&r.set(f,u);};for(let l of n.chains){if(!r.has(l.head)||!r.has(l.tail)||l.head===l.tail)continue;let c=n.nodes[l.head],f=n.nodes[l.tail],u=Math.hypot(c.x-f.x,c.y-f.y);u>o||u>(n.nodeWidth(l.head,t)+n.nodeWidth(l.tail,t))/2*w2||a(l.head,l.tail);}let s=new Map;for(let l of e){let c=i(l),f=s.get(c);f?f.push(l):s.set(c,[l]);}return [...s.values()]}function C2(n,e,t,o){let r=new Set(e),i=(y,A)=>{for(let x of n.chains){if(!x.axes.includes(A))continue;let v=x.head===y?x.tail:x.head===y||x.tail===y?x.head:-1;if(v>=0&&r.has(v))return true}return false},a=[],s=0,l=0;for(let y of e){let A=n.nodes[y];s+=A.x,l+=A.y;for(let x of A.rays){if(x.level!==t||e.length>1&&i(y,x.axis))continue;let v={axes:[x.axis],level:t,width:x.width},w=xl(n,y,x.angle,v,o),C=(x.width+o.widthExtra)/2,B=Math.max(n.clearanceAt(y,x.angle,t,[x.axis]),C);if(w){let _=Math.cos(x.angle),T=Math.sin(x.angle);for(let k of [1,-1]){let K=A.x-T*C*k,P=A.y+_*C*k,W=Al(K,P,_,T,w.x,w.y,w.dx,w.dy);if(!W)continue;let z=(W[0]-K)*_+(W[1]-P)*T;z>B&&z<B*2+C&&(B=z);}}a.push({x:A.x,y:A.y,angle:x.angle,half:C,cls:x.cls,width:x.width+o.widthExtra,reach:B});}}if(a.length<3)return null;s/=e.length,l/=e.length,a.sort((y,A)=>Math.atan2(y.y+Math.sin(y.angle)-l,y.x+Math.cos(y.angle)-s)-Math.atan2(A.y+Math.sin(A.angle)-l,A.x+Math.cos(A.angle)-s));let c="",f=0;for(let y of a)y.width>f&&(f=y.width,c=y.cls);let u=[],h=a.length;for(let y=0;y<h;y++){let A=a[y],x=a[(y+1)%h],v=Math.cos(A.angle),w=Math.sin(A.angle),C=Math.cos(x.angle),B=Math.sin(x.angle),_=A.x+v*A.reach,T=A.y+w*A.reach;u.push(_+w*A.half,T-v*A.half),u.push(_-w*A.half,T+v*A.half);let k=A.x-w*A.half,K=A.y+v*A.half,P=x.x+B*x.half,W=x.y-C*x.half,z=Al(k,K,v,w,P,W,C,B);if(z){let L=gl(z[0]-s,z[1]-l),X=gl(u[u.length-2]-s,u[u.length-1]-l),Q=gl(x.x+C*x.reach+B*x.half-s,x.y+B*x.reach-C*x.half-l);L>Math.min(X,Q)&&L<=Math.max(X,Q)*1.15&&u.push(z[0],z[1]);}}if(u.length<6)return null;let d=D2(u);if(d.length<6)return null;d.push(d[0],d[1]);let m=1/0;for(let y of a)m=Math.min(m,y.width);let p=Math.min(o.cornerRadius,m/2),b=dt(d,{radius:p,segments:10}),g=b.length>=8?b:d;if(wl(g)){let y=pi({outer:g,holes:[]}),A=null,x=0;for(let v of y){let w=Math.abs(So(v.outer));w>x&&(x=w,A=v);}if(A)return {kind:"junction",outer:A.outer,holes:A.holes,cls:c,level:t,width:f,nodes:e}}return {kind:"junction",outer:g,holes:[],cls:c,level:t,width:f,nodes:e}}function wd(n){let o=Array.from(n);for(let r=0;r<8;r++){let i=o.length/2-1;if(i<4)break;let a=new Array(i).fill(true),s=0;for(let c=0;c<i;c++){if(!a[c])continue;let f=(c+i-1)%i;for(;!a[f]&&f!==c;)f=(f+i-1)%i;let u=(c+1)%i;for(;!a[u]&&u!==c;)u=(u+1)%i;if(f===c||u===c)break;let h=o[f*2],d=o[f*2+1],m=o[c*2],p=o[c*2+1],b=o[u*2],g=o[u*2+1],y=Math.abs((m-h)*(g-d)-(p-d)*(b-h)),A=Math.hypot(b-h,g-d),x=A>1e-9?y/A:Math.hypot(m-h,p-d),v=x<.02,w=A<.6&&x>A*3;(v||w)&&i-s>3&&(a[c]=false,s++);}if(!s)break;let l=[];for(let c=0;c<i;c++)a[c]&&l.push(o[c*2],o[c*2+1]);l.push(l[0],l[1]),o=l;}return o}function vd(n,e){if(!(e>0))return n;let t=Array.from(n);for(let o=0;o<4;o++){let r=t.length/2-1;if(r<8)break;let i=new Array(r).fill(true),a=0;for(let l=0;l<r;l++){if(!i[l])continue;let c=(l+r-1)%r;for(;!i[c]&&c!==l;)c=(c+r-1)%r;let f=(l+1)%r;for(;!i[f]&&f!==l;)f=(f+1)%r;if(c===l||f===l)break;let u=t[c*2],h=t[c*2+1],d=t[l*2],m=t[l*2+1],p=t[f*2],b=t[f*2+1],g=Math.hypot(p-u,b-h);if(g<1e-9)continue;Math.abs((d-u)*(b-h)-(m-h)*(p-u))/g<e&&r-a>8&&(i[l]=false,a++);}if(!a)break;let s=[];for(let l=0;l<r;l++)i[l]&&s.push(t[l*2],t[l*2+1]);s.push(s[0],s[1]),t=s;}return t}function yl(n){let e=[];for(let t=n.length-2;t>=0;t-=2)e.push(n[t],n[t+1]);return e}function B2(n,e){let t=n.length/2;if(t<4)return false;let o=new Float64Array(t);for(let a=1;a<t;a++)o[a]=o[a-1]+Math.hypot(n[a*2]-n[a*2-2],n[a*2+1]-n[a*2-1]);let r=o[t-1],i=e*4;if(r<i*2)return false;for(let a=0;a<t;a++)for(let s=a+1;s<t;s++){let l=o[s]-o[a];if(l<i||r-l<i)continue;if(Math.hypot(n[a*2]-n[s*2],n[a*2+1]-n[s*2+1])<e*2)return false}return true}function So(n){let e=0;for(let t=0;t+3<n.length;t+=2)e+=n[t]*n[t+3]-n[t+2]*n[t+1];return e/2}function M2(n,e){let t=n.length/2;if(t<4)return [n];let o=[],r=0,i=0;for(let a=1;a+1<t;a++){let s=Math.atan2(n[a*2+1]-n[a*2-1],n[a*2]-n[a*2-2]),c=Math.atan2(n[a*2+3]-n[a*2+1],n[a*2+2]-n[a*2])-s;for(;c>Math.PI;)c-=Math.PI*2;for(;c<-Math.PI;)c+=Math.PI*2;i+=Math.abs(c),i>=e&&a-r>=2&&(o.push(n.slice(r*2,(a+1)*2)),r=a,i=0);}return o.length?(t-r>=2&&o.push(n.slice(r*2)),o):[n]}function _2(n,e){let t=n.length/2;if(t<3||!(e>0))return n;let o=[n[0],n[1]];for(let r=1;r<t-1;r++){let i=o[o.length-2],a=o[o.length-1],s=n[r*2],l=n[r*2+1];if(Math.hypot(s-i,l-a)>=e){o.push(s,l);continue}let c=n[r*2+2],f=n[r*2+3],u=c-i,h=f-a,d=Math.hypot(u,h);(d>1e-9?Math.abs((s-i)*h-(l-a)*u)/d:0)>e*.5&&o.push(s,l);}return o.push(n[t*2-2],n[t*2-1]),o}function Al(n,e,t,o,r,i,a,s){let l=t*s-o*a;if(Math.abs(l)<1e-9)return null;let c=((r-n)*s-(i-e)*a)/l;return [n+t*c,e+o*c]}var gl=(n,e)=>Math.hypot(n,e);function _d(n,e,t){for(let o of n.rays){if(t.axes.includes(o.axis)||o.level!==t.level||o.width<t.width*.8)continue;let r=Math.abs(o.angle-e)%(Math.PI*2);if(r>Math.PI&&(r=Math.PI*2-r),r>Math.PI/2&&(r=Math.PI-r),r<Ed)return true}return false}var E2=4,S2=15,Ed=20*Math.PI/180;function xl(n,e,t,o,r){let i=n.nodes[e];if(!i||!i.crossing||_d(i,t,o))return null;let a=0,s=0;for(let b of i.rays){if(o.axes.includes(b.axis)||b.level!==o.level)continue;let g=Math.abs(b.angle-t)%(Math.PI*2);g>Math.PI&&(g=Math.PI*2-g),g>Math.PI/2&&(g=Math.PI-g),!(g<Ed)&&b.width>a&&(a=b.width,s=b.angle);}if(a<o.width*1.05)return null;let l=n.clearanceAt(e,t,o.level,o.axes);if(!(l>0))return null;let c=Math.cos(s),f=Math.sin(s),u=-f,h=c;u*Math.cos(t)+h*Math.sin(t)<0&&(u=-u,h=-h);let d=Math.max((a+r.widthExtra)/2-1,0),m=Math.cos(t)*u+Math.sin(t)*h;return !(m>1e-6)||d/m>l*1.5+2?null:{x:i.x+u*d,y:i.y+h*d,dx:c,dy:f,limit:l+o.width*2}}function Cd(n,e,t){if(n.length<4)return n;let o=t?n:ra(n),r=(s,l)=>(s-e.x)*e.dy-(l-e.y)*e.dx,i=r(o[0],o[1]);if(i<0)return n;let a=0;for(let s=0;s+3<o.length;s+=2){let l=r(o[s+2],o[s+3]);if(i===0||i<0!=l<0){let c=i===l?0:i/(i-l),f=o[s]+(o[s+2]-o[s])*c,u=o[s+1]+(o[s+3]-o[s+1])*c,h=[f,u,...o.slice(s+2)];return h.length<4?n:t?h:ra(h)}if(a+=Math.hypot(o[s+2]-o[s],o[s+3]-o[s+1]),a>e.limit)return n;i=l;}return n}function Bd(n,e,t,o){let r=n.nodes[e];if(!r||!r.crossing||_d(r,t,o))return 0;let i=0;for(let s of r.rays)o.axes.includes(s.axis)||s.level===o.level&&s.width>i&&(i=s.width);if(i<o.width*1.05)return 0;let a=n.clearanceAt(e,t,o.level,o.axes);return Math.max(a-1,0)}function F2(n,e,t){let o=Md(n,e);return ra(Md(ra(o),t))}function Md(n,e){if(e<=0||n.length<4)return n;let t=e;for(let o=0;o+3<n.length;o+=2){let r=Math.hypot(n[o+2]-n[o],n[o+3]-n[o+1]);if(r>t){let i=t/r;return [n[o]+(n[o+2]-n[o])*i,n[o+1]+(n[o+3]-n[o+1])*i,...n.slice(o+2)]}t-=r;}return []}function ra(n){let e=[];for(let t=n.length-2;t>=0;t-=2)e.push(n[t],n[t+1]);return e}function wl(n){let e=n.length/2-1;if(e<4)return false;let t=e>400?Math.ceil(e/400):1;for(let o=0;o<e;o+=t){let r=n[o*2],i=n[o*2+1],a=n[o*2+2],s=n[o*2+3];for(let l=o+2*t;l<e;l+=t)if(!(o===0&&l>=e-t)&&I2(r,i,a,s,n[l*2],n[l*2+1],n[l*2+2],n[l*2+3]))return true}return false}function I2(n,e,t,o,r,i,a,s){let l=(d,m,p,b,g,y)=>{let A=(p-d)*(y-m)-(b-m)*(g-d);return Math.abs(A)<1e-9?0:A},c=l(r,i,a,s,n,e),f=l(r,i,a,s,t,o),u=l(n,e,t,o,r,i),h=l(n,e,t,o,a,s);return (c>0&&f<0||c<0&&f>0)&&(u>0&&h<0||u<0&&h>0)}function D2(n){let e=[];for(let o=0;o+1<n.length;o+=2){let r=e.length;r>=2&&Math.hypot(n[o]-e[r-2],n[o+1]-e[r-1])<.05||e.push(n[o],n[o+1]);}let t=e.length;return t>=4&&Math.hypot(e[0]-e[t-2],e[1]-e[t-1])<.05&&(e.length=t-2),e}function T2(n,e){let t=[...e].filter(a=>a>.01).sort((a,s)=>a-s);if(!t.length)return n;let o=[n[0],n[1]],r=0,i=0;for(let a=0;a+3<n.length;a+=2){let s=n[a],l=n[a+1],c=n[a+2],f=n[a+3],u=Math.hypot(c-s,f-l);for(;i<t.length&&t[i]<=r+.01;)i++;for(;i<t.length&&t[i]<r+u-.01;){let h=(t[i]-r)/u;o.push(s+(c-s)*h,l+(f-l)*h),i++;}r+=u,o.push(c,f);}return o}function oa(n){let e=0;for(let t=0;t+3<n.length;t+=2)e+=Math.hypot(n[t+2]-n[t],n[t+3]-n[t+1]);return e}var k2={levelHeight:8,maxGrade:.06,clearance:0,step:5,alignGap:2,iterations:200},L2=1.5;function Sd(n){return n<=0?0:n>=1?1:n*n*(3-2*n)}function R2(n,e={}){let t={...k2,...e},o=n.chains,r=n.nodes,i=o.map(p=>{let b=0;for(let g=0;g+3<p.pts.length;g+=2)b+=Math.hypot(p.pts[g+2]-p.pts[g],p.pts[g+3]-p.pts[g+1]);return b}),a=new Float64Array(r.length),s=new Float64Array(r.length);for(let p=0;p<o.length;p++){let b=o[p];if(b.level<=0)continue;let g=b.level*t.levelHeight;for(let y of [b.head,b.tail])a[y]<g&&(a[y]=g,s[y]=g);}let l=t.maxGrade/L2,c=r.map(()=>[]);for(let p=0;p<o.length;p++)c[o[p].head].push(p),o[p].tail!==o[p].head&&c[o[p].tail].push(p);let f=[];for(let p=0;p<r.length;p++)a[p]>0&&f.push(p);let u=new Uint8Array(r.length);for(;f.length;){let p=0;for(let g=1;g<f.length;g++)a[f[g]]>a[f[p]]&&(p=g);let b=f[p];if(f[p]=f[f.length-1],f.pop(),!u[b]){u[b]=1;for(let g of c[b]){let y=o[g],A=y.head===b?y.tail:y.head;if(A===b)continue;let x=a[b]-i[g]*l;x>a[A]&&(a[A]=x,s[A]=s[b],u[A]||f.push(A));}}}let h=o.map((p,b)=>{let g=p.level>0?p.level*t.levelHeight:0,y=Math.max(a[p.head],g),A=Math.max(a[p.tail],g),x=Math.max(s[p.head],s[p.tail],y,A,g);return {top:g,head:y,tail:A,peak:x,total:i[b]}}),d=(p,b)=>{let g=h[p];if(!g||g.peak<=0)return 0;let y=Math.max(0,b),A=Math.max(g.top,g.head-y*l,g.tail-Math.max(0,g.total-y)*l,0);return g.peak*Sd(A/g.peak)},m={node:p=>{let b=a[p]??0,g=s[p]||b;return g>0?g*Sd(b/g):0},at:d,length:p=>i[p]??0,flat:p=>{let b=h[p];return !!b&&b.top===0&&b.head<=0&&b.tail<=0},grade:p=>{let b=h[p];if(!b||b.total<=0)return 0;let g=0,y=Math.max(b.total/200,.5);for(let A=0;A+y<=b.total;A+=y)g=Math.max(g,Math.abs(d(p,A+y)-d(p,A))/y);return g}};return t.clearance>0?W2(n,m,t):m}var P2=1,Fd=.2,H2=.04,na=.5,O2=.5,Id=3,G2=.94,z2=12;function W2(n,e,t){let o=n.chains,r=n.nodes,i=o.length,a=o.map((I,J)=>e.length(J)),s=o.map(I=>{let J=new Float64Array(I.pts.length/2);for(let Z=1;Z<J.length;Z++)J[Z]=J[Z-1]+Math.hypot(I.pts[2*Z]-I.pts[2*Z-2],I.pts[2*Z+1]-I.pts[2*Z-1]);return J}),l=new Float64Array(i);for(let I=0;I<i;I++){let J=a[I];for(let Z=0;l[I]=Math.max(l[I],e.at(I,Math.min(Z,J))),!(Z>=J);Z+=t.step);}let c=I=>l[I]>.01||o[I].level!==0,f=Math.max(t.step*10,1),u=new Map,h=(I,J)=>(I+1e6)*2e6+(J+1e6),d=(I,J,Z,ce,ae)=>{let be=Math.floor(Math.min(I,Z)/f),Se=Math.floor(Math.max(I,Z)/f),F=Math.floor(Math.min(J,ce)/f),U=Math.floor(Math.max(J,ce)/f);for(let j=be;j<=Se;j++)for(let R=F;R<=U;R++)ae(h(j,R));},m=(I,J)=>{let Z=o[J].pts;for(let ce=0;ce+3<Z.length;ce+=2)d(Z[ce],Z[ce+1],Z[ce+2],Z[ce+3],ae=>{let be=I.get(ae);be||I.set(ae,be=[]),be.push(J,ce>>1);});};for(let I=0;I<i;I++)c(I)&&m(u,I);let p=[],b=new Set;for(let I=0;I<i;I++){let J=o[I].pts;for(let Z=0;Z+3<J.length;Z+=2){let ce=J[Z],ae=J[Z+1],be=J[Z+2],Se=J[Z+3];d(ce,ae,be,Se,F=>{let U=u.get(F);if(U)for(let j=0;j<U.length;j+=2){let R=U[j];if(R===I||c(I)&&I<R)continue;let H=U[j+1],E=o[R].pts,M=E[2*H],S=E[2*H+1],D=E[2*H+2],O=E[2*H+3],N=D-M,q=O-S,V=be-ce,te=Se-ae,oe=N*te-q*V;if(Math.abs(oe)<1e-12)continue;let ne=((ce-M)*te-(ae-S)*V)/oe,re=((ce-M)*q-(ae-S)*N)/oe;if(ne<0||ne>1||re<0||re>1)continue;let se=s[R][H]+ne*Math.hypot(N,q),me=s[I][Z>>1]+re*Math.hypot(V,te);if(se<na||se>a[R]-na||me<na||me>a[I]-na)continue;let _e=`${R}:${H}:${I}:${Z}`;b.has(_e)||(b.add(_e),p.push({a:R,da:se,b:I,db:me}));}});}}let g=[];for(let I of p){let J=o[I.a].level,Z=o[I.b].level,ce;if(J!==Z)ce=J>Z;else {let ae=e.at(I.a,I.da)-e.at(I.b,I.db);if(Math.abs(ae)<O2)continue;ce=ae>0;}g.push(ce?{up:I.a,dUp:I.da,lo:I.b,dLo:I.db}:{up:I.b,dUp:I.db,lo:I.a,dLo:I.da});}let y=(I,J)=>{let Z=o[I].pts,ce=s[I],ae=0;for(;ae+2<ce.length&&ce[ae+1]<J;)ae++;let be=ce[ae+1]-ce[ae]||1,Se=Math.min(1,Math.max(0,(J-ce[ae])/be)),F=Z[2*ae+2]-Z[2*ae],U=Z[2*ae+3]-Z[2*ae+1],j=Math.hypot(F,U)||1;return [Z[2*ae]+F*Se,Z[2*ae+1]+U*Se,F/j,U/j]},A=(I,J,Z,ce,ae,be,Se)=>{let F=I.get(h(Math.floor(Z/f),Math.floor(ce/f)));if(!F)return null;let U=o[J],j=-1,R=1/0,H=0;for(let E=0;E<F.length;E+=2){let M=F[E];if(M===J||o[M].level!==U.level||!Se(M))continue;let S=F[E+1],D=o[M].pts,O=D[2*S],N=D[2*S+1],q=D[2*S+2]-O,V=D[2*S+3]-N,te=Math.hypot(q,V);if(te<1e-9||Math.abs((q*ae+V*be)/te)<G2)continue;let oe=Math.min(1,Math.max(0,((Z-O)*q+(ce-N)*V)/(te*te))),ne=Math.hypot(O+q*oe-Z,N+V*oe-ce),re=(U.width+o[M].width)/2+t.alignGap;ne>re||ne>=R||(j=M,R=ne,H=s[M][S]+oe*te);}return j<0?null:[j,H]},x=new Uint8Array(i);for(let I=0;I<i;I++)c(I)&&(x[I]=1);for(let I of g)x[I.up]=x[I.lo]=1;for(let I=0;I<i;I++){if(x[I])continue;let J=a[I];for(let Z=0;Z<=J&&!x[I];Z+=t.step){let[ce,ae,be,Se]=y(I,Z),F=A(u,I,ce,ae,be,Se,()=>true);F&&Math.abs(e.at(I,Z)-e.at(F[0],F[1]))<Id&&(x[I]=1);}}let v=o.map(()=>[]);for(let I of g)v[I.up].push(I.dUp),v[I.lo].push(I.dLo);let w=new Int32Array(i).fill(-1),C=new Int32Array(i),B=[];for(let I=0;I<i;I++){if(!x[I])continue;let J=a[I],Z=[],ce=Math.max(1,Math.ceil(J/t.step));for(let ae=0;ae<=ce;ae++){let be=J*ae/ce;ae>0&&ae<ce&&v[I].some(F=>Math.abs(F-be)<t.step*.4)||Z.push(be);}for(let ae of v[I])Z.push(ae);Z.sort((ae,be)=>ae-be),w[I]=B.length;for(let ae of Z)B.length>w[I]&&ae-B[B.length-1]<1e-6||B.push(ae);C[I]=B.length-w[I];}let _=B.length,T={d:Float64Array.from(B),h:new Float64Array(_)},k=new Float64Array(_),K=new Float64Array(_),P=new Float64Array(_),W=new Int32Array(_);for(let I=0;I<i;I++){if(w[I]<0)continue;let J=o[I];for(let Z=w[I];Z<w[I]+C[I];Z++)k[Z]=T.h[Z]=e.at(I,T.d[Z]),K[Z]=J.level>0?Fd:P2,P[Z]=Math.min(0,J.level*t.levelHeight),W[Z]=I;}let z=(I,J)=>{let Z=w[I],ce=w[I]+C[I]-1;for(;Z<ce;){let ae=Z+ce>>1;T.d[ae]<J?Z=ae+1:ce=ae;}return Z>w[I]&&J-T.d[Z-1]<T.d[Z]-J&&Z--,Z},L=r.map(()=>[]),X=new Uint8Array(r.length);for(let I=0;I<i;I++){let J=o[I];if(w[I]<0){X[J.head]=X[J.tail]=1;continue}L[J.head].push(w[I]),L[J.tail].push(w[I]+C[I]-1);}let Q=[];for(let I=0;I<r.length;I++)if(L[I].length&&(Q.push(I),X[I]))for(let J of L[I])K[J]=0;let G=new Uint8Array(_);for(let I of Q)for(let J of L[I])G[J]=1;let Y=g.map(I=>[z(I.up,I.dUp),z(I.lo,I.dLo)]),ie=new Map;for(let I=0;I<i;I++)w[I]>=0&&m(ie,I);let ee=[],ue=[];for(let I=0;I<i;I++)if(!(w[I]<0))for(let J=w[I];J<w[I]+C[I];J++){if(G[J])continue;let[Z,ce,ae,be]=y(I,T.d[J]),Se=A(ie,I,Z,ce,ae,be,j=>j>I);if(!Se)continue;let F=z(Se[0],Se[1]);if(G[F])continue;let U=Math.abs(k[J]-k[F])/Id;U>=1||(ee.push(J,F),ue.push(1-U*U));}let $=T.h,Ae=()=>{for(let[I,J]of Y){let Z=t.clearance-($[I]-$[J]);if(Z<=0)continue;let ce=K[I],ae=K[J];if(ce+ae===0)continue;let be=Z*ae/(ce+ae);$[J]-be<P[J]&&(be=Math.max(0,$[J]-P[J])),$[J]-=be,ce>0&&($[I]+=Z-be);}},ve=()=>{for(let I of Q){let J=L[I];if(J.length<2&&!X[I])continue;if(X[I]){for(let ae of J)$[ae]=k[ae];continue}let Z=0,ce=0;for(let ae of J){let be=1/K[ae];Z+=$[ae]*be,ce+=be;}for(let ae of J)$[ae]=Z/ce;}},he=()=>{for(let I=0;I<i;I++)if(!(w[I]<0))for(let J=w[I];J+1<w[I]+C[I];J++){let Z=t.maxGrade*(T.d[J+1]-T.d[J]),ce=$[J+1]-$[J],ae=Math.abs(ce)-Z;if(ae<=0)continue;let be=K[J],Se=K[J+1];if(be+Se===0)continue;let F=Math.sign(ce);$[J]+=F*ae*be/(be+Se),$[J+1]-=F*ae*Se/(be+Se);}},xe=()=>{for(let I=0;I<ee.length;I+=2){let J=ee[I],Z=ee[I+1],ce=K[J],ae=K[Z];if(ce+ae===0)continue;let be=($[Z]-$[J])*.5*ue[I>>1];$[J]+=be*ce/(ce+ae),$[Z]-=be*ae/(ce+ae);}},de=()=>{for(let I=0;I<_;I++)$[I]<P[I]&&($[I]=P[I]);};for(let I=0;I<t.iterations;I++){if(I<t.iterations*3/4)for(let J=0;J<_;J++)$[J]+=H2*(K[J]===Fd?3:1)*(k[J]-$[J])*(K[J]>0?1:0);xe(),he(),Ae(),ve(),de();}for(let I=0;I<z2;I++){for(let J=0;J<i;J++){if(w[J]<0)continue;let Z=w[J],ce=w[J]+C[J]-1,ae=$[Z];for(let be=Z+1;be<ce;be++){let Se=$[be];K[be]>0&&($[be]=Se+.25*(ae+$[be+1]-2*Se)),ae=Se;}}he(),Ae(),ve(),de();}return {node:I=>{let J=L[I];return J&&J.length?$[J[0]]:e.node(I)},at:(I,J)=>{let Z=w[I];if(Z===void 0||Z<0)return e.at(I,J);let ce=Z+C[I]-1;if(J<=T.d[Z])return $[Z];if(J>=T.d[ce])return $[ce];let ae=Z,be=ce;for(;be-ae>1;){let F=ae+be>>1;T.d[F]<=J?ae=F:be=F;}let Se=T.d[be]-T.d[ae]||1;return $[ae]+($[be]-$[ae])*(J-T.d[ae])/Se},length:I=>a[I]??0,flat:I=>{let J=w[I];if(J===void 0||J<0)return e.flat(I);if(o[I].level>0)return false;for(let Z=J;Z<J+C[I];Z++)if(Math.abs($[Z])>.001)return false;return true},grade:I=>{let J=w[I];if(J===void 0||J<0)return e.grade(I);let Z=0;for(let ce=J;ce+1<J+C[I];ce++){let ae=T.d[ce+1]-T.d[ce];ae>1e-6&&(Z=Math.max(Z,Math.abs($[ce+1]-$[ce])/ae));}return Z}}}var Dd=Pr,sr=Dd.union??Dd.default?.union??null,Io=0,Mn=1,lr=2,_n=3,En=4,zd=5,N2={widthExtra:.9,kerbRadius:8,elevation:.28,deck:1.4,step:2,minCut:.5,kerbWidth:.3,kerbHeight:.15,clusterLink:40,fillGap:1.5,islands:true,outline:false},Td=.6,V2=20,U2=25,K2=60,X2=1,J2=30*Math.PI/180,j2=45*Math.PI/180,kd=1.5,Y2=.5,Ld=.03,Z2=.6,Rd=.25,ia=Math.PI*.94,q2=.5,Pd=4,Hd=800,Q2=.6,$2=2.5,eA=.8;function Od(n){let e=[];for(let u=0;u<n.length;u+=2)e.push([n[u],n[u+1]]);let t=tA(e);if(t){let[u,h,d]=t,m=Math.max(48,Math.ceil(Math.PI*2*d/.3)),p=[];for(let b=0;b<m;b++){let g=Math.PI*2*b/m;p.push(u+d*Math.cos(g),h+d*Math.sin(g));}return p}let o=u=>{if(u.length<3)return u;let[h,d]=u[0],[m,p]=u[u.length-1],b=m-h,g=p-d,y=Math.hypot(b,g)||1,A=0,x=0;for(let C=1;C+1<u.length;C++){let B=Math.abs((u[C][0]-h)*g-(u[C][1]-d)*b)/y;B>A&&(A=B,x=C);}if(A<=Q2)return [u[0],u[u.length-1]];let v=o(u.slice(0,x+1)),w=o(u.slice(x));return [...v.slice(0,-1),...w]},r=0,i=0;for(let u=1;u<e.length;u++){let h=Math.hypot(e[u][0]-e[0][0],e[u][1]-e[0][1]);h>r&&(r=h,i=u);}let a=o(e.slice(0,i+1)),s=o([...e.slice(i),e[0]]);e=[...a.slice(0,-1),...s.slice(0,-1)];for(let u=0;u<4&&e.length>3;u++){let h=[];for(let d=0;d<e.length;d++){let m=e[(d-1+e.length)%e.length],p=e[d],b=e[(d+1)%e.length],g=m[0]-p[0],y=m[1]-p[1],A=b[0]-p[0],x=b[1]-p[1],v=Math.hypot(g,y),w=Math.hypot(A,x);Math.acos(Math.max(-1,Math.min(1,(g*A+y*x)/(v*w||1))))<25*Math.PI/180&&Math.min(v,w)<3&&e.length-(d-h.length)>3||h.push(p);}if(h.length===e.length)break;e=h;}if(e.length<3)return null;let l=0;for(let u=0;u<e.length;u++){let[h,d]=e[u],[m,p]=e[(u+1)%e.length];l+=h*p-m*d;}l<0&&e.reverse();for(let u=0;u<4&&e.length>3;u++){let h=[];for(let d=0;d<e.length;d++){let m=e[d],p=e[(d+1)%e.length];if(Math.hypot(p[0]-m[0],p[1]-m[1])<eA&&e.length-(e.length-h.length-(e.length-d))>3&&d+1<e.length){h.push([(m[0]+p[0])/2,(m[1]+p[1])/2]),d++;continue}h.push(m);}if(h.length===e.length||h.length<3)break;e=h;}let c=[],f=e.length;for(let u=0;u<f;u++){let h=e[(u-1+f)%f],d=e[u],m=e[(u+1)%f],p=Math.hypot(h[0]-d[0],h[1]-d[1]),b=Math.hypot(m[0]-d[0],m[1]-d[1]);if(p<1e-6||b<1e-6)continue;let g=(h[0]-d[0])/p,y=(h[1]-d[1])/p,A=(m[0]-d[0])/b,x=(m[1]-d[1])/b,v=Math.acos(Math.max(-1,Math.min(1,g*A+y*x)));if(v>Math.PI-.05){c.push(d[0],d[1]);continue}let w=Math.tan(v/2),C=Math.min($2/w,.45*p,.45*b),B=C*w,_=g+A,T=y+x,k=Math.hypot(_,T)||1;_/=k,T/=k;let K=d[0]+_*B/Math.sin(v/2),P=d[1]+T*B/Math.sin(v/2),W=d[0]+g*C,z=d[1]+y*C,L=d[0]+A*C,X=d[1]+x*C,Q=Math.atan2(z-P,W-K),G=Math.atan2(X-P,L-K)-Q;for(;G>Math.PI;)G-=Math.PI*2;for(;G<-Math.PI;)G+=Math.PI*2;let Y=Math.max(2,Math.ceil(Math.abs(G)/(Math.PI/16)),Math.ceil(Math.abs(G)*B/.3));for(let ie=0;ie<=Y;ie++){let ee=Q+G*ie/Y;c.push(K+B*Math.cos(ee),P+B*Math.sin(ee));}}return c.length>=6?c:null}function tA(n){let e=n.length;if(e<8)return null;let t=0,o=0,r=0,i=0;for(let v=0;v<e;v++){let[w,C]=n[v],[B,_]=n[(v+1)%e];t+=Math.hypot(B-w,_-C),o+=w*_-B*C,r+=w,i+=C;}if(o=Math.abs(o)/2,4*Math.PI*o/(t*t)<.85)return null;r/=e,i/=e;let a=0,s=0,l=0,c=0,f=0,u=0,h=0;for(let[v,w]of n){let C=v-r,B=w-i;a+=C*C,s+=B*B,l+=C*B,c+=C*C*C,f+=B*B*B,u+=C*B*B,h+=B*C*C;}let d=a*s-l*l;if(Math.abs(d)<1e-9)return null;let m=(c+u)/2,p=(f+h)/2,b=(m*s-p*l)/d,g=(p*a-m*l)/d,y=Math.sqrt(b*b+g*g+(a+s)/e),A=r+b,x=i+g;for(let[v,w]of n)if(Math.abs(Math.hypot(v-A,w-x)-y)>y*.1)return null;return [A,x,y]}function oA(n,e){if(!sr||!n.length)return [];try{return sr(...n)}catch{}let t=l=>Math.round(l*100)/100,o=n.map(l=>l.map(c=>{let f=[];for(let[u,h]of c){let d=[t(u),t(h)],m=f[f.length-1];(!m||m[0]!==d[0]||m[1]!==d[1])&&f.push(d);}return f.length&&(f[0][0]!==f[f.length-1][0]||f[0][1]!==f[f.length-1][1])&&f.push(f[0]),f}).filter(c=>c.length>=4)).filter(l=>l.length>0);try{return sr(...o)}catch{}let r=0,i=(l,c)=>{try{return sr(l,c)}catch{return r++,[...l,...c]}},a=(l,c)=>{if(l.length===1)return l;if(!c)try{return sr(...l)}catch{}let f=l.length>>1;return i(a(l.slice(0,f),false),a(l.slice(f),false))},s=o.length?a(o,true):[];return e(r),s}var Fo=1,Gd=60;function rA(n,e,t={}){let o={...N2,...t},r=n.chains,i=n.nodes,a=[];for(let F=0;F<r.length;F++){if(o.skip?.(F))continue;let U=r[F],j=U.width/2+o.widthExtra,R=U.pts.length/2,H=new Set;for(let D of U.axes)for(let O of n.ends[D]??[])O>=0&&O!==U.head&&O!==U.tail&&i[O].degree>=3&&H.add(O);let E=[];for(let D of H){let O=1/0,N=-1;for(let q=1;q+1<R;q++){let V=Math.hypot(U.pts[2*q]-i[D].x,U.pts[2*q+1]-i[D].y);V<O&&(O=V,N=q);}N>0&&O<.5&&E.push({k:N,node:D});}E.sort((D,O)=>D.k-O.k);let M=new Float64Array(R);for(let D=1;D<R;D++)M[D]=M[D-1]+Math.hypot(U.pts[2*D]-U.pts[2*D-2],U.pts[2*D+1]-U.pts[2*D-1]);let S=[{k:0,node:U.head},...E,{k:R-1,node:U.tail}];for(let D=0;D+1<S.length;D++){let O=S[D],N=S[D+1];if(N.k<=O.k)continue;let q=U.pts.slice(2*O.k,2*N.k+2),V=Bn(q,j);if(!V||V.centre.length<4)continue;let te=V.centre.length/2,oe=new Float64Array(te);for(let re=1;re<te;re++)oe[re]=oe[re-1]+Math.hypot(V.centre[2*re]-V.centre[2*re-2],V.centre[2*re+1]-V.centre[2*re-1]);let ne=oe[te-1];ne<.5||a.push({id:a.length,chain:F,centre:V.centre,left:V.left,right:V.right,along:oe,total:ne,graphTotal:M[N.k]-M[O.k],graphFrom:M[O.k],pts:q,head:O.node,tail:N.node,half:j,cutHead:o.minCut,cutTail:o.minCut,inner:false});}}{let F=new Map;for(let H of a)for(let[E,M]of [[H.head,true],[H.tail,false]]){let S=F.get(E);S||F.set(E,S=[]),S.push({rib:H,atHead:M});}let U=new Map,j=H=>{let E=H.rib.centre,M=E.length/2,S=H.atHead?0:M-1,D=S;for(;D>=0&&D<M&&Math.hypot(E[2*D]-E[2*S],E[2*D+1]-E[2*S+1])<3;)D+=H.atHead?1:-1;D=Math.max(0,Math.min(M-1,D));let O=E[2*D]-E[2*S],N=E[2*D+1]-E[2*S+1],q=Math.hypot(O,N)||1;return {x:E[2*S],y:E[2*S+1],dx:O/q,dy:N/q}};for(let H of F.values())if(!(H.length<2))for(let E of H){let M=j(E);for(let S of H){if(S===E||S.rib===E.rib||S.rib.half>=E.rib.half-.05)continue;let D=j(S);if(-(M.dx*D.dx+M.dy*D.dy)<Math.cos(J2)||H.some(_e=>_e!==E&&_e!==S&&_e.rib.half>S.rib.half+.05&&(()=>{let Ce=j(_e);return -(Ce.dx*D.dx+Ce.dy*D.dy)>-(M.dx*D.dx+M.dy*D.dy)})()))continue;let N=[M.x-M.dy*E.rib.half,M.y+M.dx*E.rib.half],q=[M.x+M.dy*E.rib.half,M.y-M.dx*E.rib.half],V=-D.dy,te=D.dx,oe=Math.max(S.rib.half,(q[0]-D.x)*V+(q[1]-D.y)*te),ne=Math.max(S.rib.half,-((N[0]-D.x)*V+(N[1]-D.y)*te));for(let _e of H){if(_e===S||_e===E)continue;let Ce=j(_e);if(Ce.dx*D.dx+Ce.dy*D.dy<Math.cos(j2))continue;D.dx*Ce.dy-D.dy*Ce.dx>0?oe=S.rib.half:ne=S.rib.half;}let re=Math.max(oe,ne)-S.rib.half;if(re<.05)continue;let se={span:Math.min(K2,Math.max(V2,re*U2)),...oe>S.rib.half+.05?{left:oe}:{},...ne>S.rib.half+.05?{right:ne}:{}},me=U.get(S.rib)??{};S.atHead?me.head=se:me.tail=se,U.set(S.rib,me);}}let R=H=>H>=1?0:H<=0?1:1-H*H*(3-2*H);for(let[H,E]of U){let M=H.total,S=(oe,ne)=>{let re=H.half;if(E.head){let se=ne?E.head.left:E.head.right;se!==void 0&&(re+=(se-H.half)*R(oe/Math.min(E.head.span,M*.8)));}if(E.tail){let se=ne?E.tail.right:E.tail.left;se!==void 0&&(re+=(se-H.half)*R((M-oe)/Math.min(E.tail.span,M*.8)));}return re},D=H.centre,O=[D[0],D[1]],N=[0];for(let oe=0;oe+3<D.length;oe+=2){let ne=D[oe],re=D[oe+1],se=D[oe+2],me=D[oe+3],_e=Math.hypot(se-ne,me-re),Ce=Math.max(1,Math.ceil(_e/X2));for(let Be=1;Be<=Ce;Be++)O.push(ne+(se-ne)*Be/Ce,re+(me-re)*Be/Ce),N.push(H.along[oe>>1]+_e*Be/Ce);}let q=O.length/2;if(q<2)continue;let V=[],te=[];for(let oe=0;oe<q;oe++){let ne=Math.max(0,oe-1),re=Math.min(q-1,oe+1),se=O[2*re]-O[2*ne],me=O[2*re+1]-O[2*ne+1],_e=Math.hypot(se,me)||1;se/=_e,me/=_e;let Ce=S(N[oe],true),Be=S(N[oe],false);V.push(O[2*oe]-me*Ce,O[2*oe+1]+se*Ce),te.push(O[2*oe]+me*Be,O[2*oe+1]-se*Be);}H.centre=O,H.left=V,H.right=te,H.along=Float64Array.from(N),H.total=N[q-1];}}let s=(F,U)=>{let j=F.along,R=0,H=j.length-1;for(;H-R>1;){let V=R+H>>1;j[V]<=U?R=V:H=V;}let E=j[R+1]-j[R]||1,M=Math.min(1,Math.max(0,(U-j[R])/E)),S=(V,te)=>V[2*R+te]+(V[2*R+2+te]-V[2*R+te])*M,D=F.centre[2*R+2]-F.centre[2*R],O=F.centre[2*R+3]-F.centre[2*R+1],N=Math.hypot(D,O)||1,q=e.at(F.chain,F.graphFrom+U/F.total*F.graphTotal);return {d:U,cx:S(F.centre,0),cy:S(F.centre,1),lx:S(F.left,0),ly:S(F.left,1),rx:S(F.right,0),ry:S(F.right,1),tx:D/N,ty:O/N,h:q,z:q+o.elevation}},l=[];for(let F of a)for(let U of [true,false]){let j=Math.min(3,F.total/3),R=s(F,U?0:F.total),H=s(F,U?j:F.total-j),E=H.cx-R.cx,M=H.cy-R.cy,S=Math.hypot(E,M)||1;E/=S,M/=S,l.push({rib:F,atHead:U,node:U?F.head:F.tail,dx:E,dy:M,ox:R.cx,oy:R.cy,order:0});}let c=i.map((F,U)=>U),f=F=>c[F]===F?F:c[F]=f(c[F]),u=new Map,h=()=>{u=new Map;for(let F of l){if(F.rib.inner)continue;let U=f(F.node),j=u.get(U);j||u.set(U,j=[]),j.push(F);}for(let F of u.values()){let U=0,j=0;for(let H of F)U+=H.ox,j+=H.oy;U/=F.length,j/=F.length;let R=0;for(let H of F)R=Math.max(R,Math.hypot(H.ox-U,H.oy-j));R+=20;for(let H of F)H.order=Math.atan2(H.oy+H.dy*R-j,H.ox+H.dx*R-U);F.sort((H,E)=>H.order-E.order);}},d=(F,U)=>{let j=Math.atan2(U.dy,U.dx)-Math.atan2(F.dy,F.dx);for(;j<0;)j+=Math.PI*2;for(;j>=Math.PI*2;)j-=Math.PI*2;return j},m=new Map,p=(F,U)=>`${F.rib.id}${F.atHead?"h":"t"}|${U.rib.id}${U.atHead?"h":"t"}`,b=()=>{m=new Map;for(let R of a)R.cutHead=o.minCut,R.cutTail=o.minCut;let F=(R,H)=>{!(H>0)||H>Gd||(R.atHead?R.rib.cutHead=Math.max(R.rib.cutHead,H):R.rib.cutTail=Math.max(R.rib.cutTail,H));},U=(R,H)=>{let E=R.rib,M=R.atHead===H?E.left:E.right,S=E.along.length,D=[],O=[];for(let N=0;N<S;N++){let q=R.atHead?N:S-1-N,V=R.atHead?E.along[q]:E.total-E.along[q];if(D.push(M[2*q],M[2*q+1]),O.push(V),V>Gd)break}return {xs:D,ds:O}},j=(R,H)=>{let E=U(R,true),M=U(H,false),S=1/0,D=0,O=0,N=0,q=0,V=0,te=0,oe=0,ne=0;for(let me=0;me+1<E.ds.length;me++){let _e=E.xs[2*me],Ce=E.xs[2*me+1],Be=E.xs[2*me+2]-_e,ge=E.xs[2*me+3]-Ce;for(let ye=0;ye+1<M.ds.length;ye++){let Te=M.xs[2*ye],Ie=M.xs[2*ye+1],Ee=M.xs[2*ye+2]-Te,Me=M.xs[2*ye+3]-Ie,We=Be*Me-ge*Ee;if(Math.abs(We)<1e-12)continue;let Re=((Te-_e)*Me-(Ie-Ce)*Ee)/We,He=((Te-_e)*ge-(Ie-Ce)*Be)/We;if(Re<0||Re>1||He<0||He>1)continue;let lt=E.ds[me]+Re*(E.ds[me+1]-E.ds[me]),qe=M.ds[ye]+He*(M.ds[ye+1]-M.ds[ye]);if(lt+qe>=S)continue;S=lt+qe,D=lt,O=qe,oe=_e+Be*Re,ne=Ce+ge*Re;let Bt=Math.hypot(Be,ge)||1,Xe=Math.hypot(Ee,Me)||1;N=Be/Bt,q=ge/Bt,V=Ee/Xe,te=Me/Xe;}}if(!Number.isFinite(S))return false;let re=Math.acos(Math.max(-1,Math.min(1,N*V+q*te)));if(re<=.05||re>=ia)return false;let se=o.kerbRadius/Math.tan(re/2);return m.set(p(R,H),{a:R,b:H,x:oe,y:ne,ux:N,uy:q,vx:V,vy:te,dA:D,dB:O,t:se}),F(R,D+se),F(H,O+se),true};for(let R of u.values())if(!(R.length<2))for(let H=0;H<R.length;H++){let E=R[H],M=R[(H+1)%R.length],S=d(E,M);if(S<=.05||S>=ia||j(E,M))continue;let D=E.ox-E.dy*E.rib.half,O=E.oy+E.dx*E.rib.half,N=M.ox+M.dy*M.rib.half,q=M.oy-M.dx*M.rib.half,V=E.dx*M.dy-E.dy*M.dx;if(Math.abs(V)<1e-9)continue;let te=((N-D)*M.dy-(q-O)*M.dx)/V,oe=((N-D)*E.dy-(q-O)*E.dx)/V,ne=o.kerbRadius/Math.tan(S/2);te>-E.rib.half&&oe>-M.rib.half&&m.set(p(E,M),{a:E,b:M,x:D+E.dx*te,y:O+E.dy*te,ux:E.dx,uy:E.dy,vx:M.dx,vy:M.dy,dA:Math.max(0,te),dB:Math.max(0,oe),t:ne}),F(E,te+ne),F(M,oe+ne);}},g=0;h(),b();for(let F=0;F<4&&o.clusterLink>0;F++){let U=false;for(let j of a){if(j.inner||j.total>o.clusterLink)continue;let R=f(j.head),H=f(j.tail),E=(u.get(R)?.length??0)>1,M=(u.get(H)?.length??0)>1;if(!E||!M||R!==H&&j.cutHead+j.cutTail<j.total*.9)continue;let S=D=>Math.max(0,...(u.get(D)??[]).filter(O=>O.rib!==j).map(O=>O.rib.half));j.total>S(R)+S(H)-q2||(j.inner=true,g++,R!==H&&(c[R]=H),U=true);}if(!U)break;h(),b();}let y=a.map(F=>[F.cutHead,F.cutTail]),A=new Map;for(let F of m.values())for(let[U,j]of [[F.a,F.dA],[F.b,F.dB]]){let R=A.get(U.rib)??[o.minCut,o.minCut],H=U.atHead?0:1;R[H]=Math.max(R[H],j),A.set(U.rib,R);}for(let F of a){if(F.inner)continue;let U=F.total*.9;if(F.cutHead+F.cutTail<=U)continue;let[j,R]=A.get(F)??[o.minCut,o.minCut],H=Math.min(j,F.cutHead),E=Math.min(R,F.cutTail);if(H+E>=U){let O=U/(H+E);F.cutHead=H*O,F.cutTail=E*O;continue}let M=F.cutHead-H,S=F.cutTail-E,D=(U-H-E)/(M+S||1);F.cutHead=H+M*D,F.cutTail=E+S*D;}for(let F=0;F<2;F++){let U=R=>R.atHead?R.rib.cutHead:R.rib.cutTail;for(let R of m.values())R.t=Math.max(0,Math.min(R.t,U(R.a)-R.dA,U(R.b)-R.dB));let j=new Map;for(let R of a)j.set(R,[o.minCut,o.minCut]);for(let R of m.values())for(let[H,E]of [[R.a,R.dA+R.t],[R.b,R.dB+R.t]]){let M=j.get(H.rib),S=H.atHead?0:1;M[S]=Math.max(M[S],Math.min(E,U(H)));}for(let[R,[H,E]]of j)R.inner||(R.cutHead=H,R.cutTail=E);}let x=0,v=new Map;for(let F=0;F<i.length;F++){let U=f(F);v.set(U,(v.get(U)??0)+1);}for(let[F,U]of u)U.length>1&&(v.get(F)??1)>1&&x++;let w=a.map(F=>{if(F.inner)return null;let U=F.cutHead,j=F.total-F.cutTail;if(j-U<.1)return null;let R=[U];for(let E=0;E<F.along.length;E++)F.along[E]>U+.05&&F.along[E]<j-.05&&R.push(F.along[E]);let H=Math.ceil((j-U)/o.step);for(let E=1;E<H;E++)R.push(U+(j-U)*E/H);return R.push(j),R.sort((E,M)=>E-M),R.filter((E,M)=>M===0||E-R[M-1]>.02).map(E=>s(F,E))}),C=F=>{let U=w[F.rib.id];return U?F.atHead?U[0]:U[U.length-1]:null},B=[],_=new Map;for(let[F,U]of u){let j=U.filter(H=>C(H));if(j.length<2)continue;let R=[];for(let H=0;H<j.length;H++){let E=j[H],M=j[(H+1)%j.length],S=C(E),D=C(M),O=E.atHead?[S.rx,S.ry]:[S.lx,S.ly],N=E.atHead?[S.lx,S.ly]:[S.rx,S.ry],q=M.atHead?[D.rx,D.ry]:[D.lx,D.ly],V=E.atHead?[S.tx,S.ty]:[-S.tx,-S.ty],te=M.atHead?[D.tx,D.ty]:[-D.tx,-D.ty],oe=T(E.rib,O[0],O[1],S.cx,S.cy),ne=T(E.rib,N[0],N[1],S.cx,S.cy);R.push({x:O[0],y:O[1],z:S.z,h:S.h,outer:false,ix:oe[0],iy:oe[1]}),R.push({x:N[0],y:N[1],z:S.z,h:S.h,outer:true,ix:ne[0],iy:ne[1],start:true,ribs:[E.rib.id,M.rib.id]});let re=q[0]-N[0],se=q[1]-N[1],me=Math.hypot(re,se),_e=m.get(p(E,M)),Ce=ye=>({z:S.z+(D.z-S.z)*ye,h:S.h+(D.h-S.h)*ye}),Be=(ye,Te,Ie)=>{let Ee=ye.rib,Me=s(Ee,ye.atHead?Te:Ee.total-Te),We=ye.atHead===Ie,Re=ye.atHead?Me.tx:-Me.tx,He=ye.atHead?Me.ty:-Me.ty;return {x:We?Me.lx:Me.rx,y:We?Me.ly:Me.ry,tx:Re,ty:He}},ge=ye=>ye.atHead?ye.rib.cutHead:ye.rib.cutTail;if(_e&&me>.05){let ye=Math.min(_e.dA+_e.t,ge(E)),Te=Math.min(_e.dB+_e.t,ge(M)),Ie=[];for(let Xe=ge(E)-Fo;Xe>ye+.05;Xe-=Fo){let kt=Be(E,Xe,true);Ie.push([kt.x,kt.y]);}let Ee=Be(E,ye,true),Me=Be(M,Te,false);Math.hypot(Ee.x-N[0],Ee.y-N[1])>.05&&Ie.push([Ee.x,Ee.y]);let We=Me.x-Ee.x,Re=Me.y-Ee.y,He=Math.hypot(We,Re);if(He>.05){let Xe=Math.acos(Math.max(-1,Math.min(1,-Ee.tx*Me.tx-Ee.ty*Me.ty))),kt=Xe>.05?4/3*Math.tan(Xe/4)*He/(2*Math.sin(Xe/2)):He/3,Pl=[Ee.x-Ee.tx*kt,Ee.y-Ee.ty*kt],Hl=[Me.x-Me.tx*kt,Me.y-Me.ty*kt],Ol=Math.max(3,Math.ceil(Xe/(Math.PI/24)));for(let sa=1;sa<Ol;sa++){let pt=sa/Ol,gt=1-pt;Ie.push([gt*gt*gt*Ee.x+3*gt*gt*pt*Pl[0]+3*gt*pt*pt*Hl[0]+pt*pt*pt*Me.x,gt*gt*gt*Ee.y+3*gt*gt*pt*Pl[1]+3*gt*pt*pt*Hl[1]+pt*pt*pt*Me.y]);}}Math.hypot(Me.x-q[0],Me.y-q[1])>.05&&Ie.push([Me.x,Me.y]);for(let Xe=Te+Fo;Xe<ge(M)-.05;Xe+=Fo){let kt=Be(M,Xe,false);Ie.push([kt.x,kt.y]);}let lt=0,qe=N;for(let Xe of Ie)lt+=Math.hypot(Xe[0]-qe[0],Xe[1]-qe[1]),qe=Xe;lt+=Math.hypot(q[0]-qe[0],q[1]-qe[1]);let Bt=0;qe=N;for(let Xe of Ie)Bt+=Math.hypot(Xe[0]-qe[0],Xe[1]-qe[1]),qe=Xe,R.push({x:Xe[0],y:Xe[1],...Ce(lt>0?Bt/lt:0),outer:true});}else if(me>.05&&d(E,M)>=ia){let ye=[];for(let Me=ge(E)-Fo;Me>.05;Me-=Fo){let We=Be(E,Me,true);ye.push([We.x,We.y]);}for(let Me=0;Me<ge(M)-.05;Me+=Fo){let We=Be(M,Me,false);ye.push([We.x,We.y]);}let Te=0,Ie=N;for(let Me of ye)Te+=Math.hypot(Me[0]-Ie[0],Me[1]-Ie[1]),Ie=Me;Te+=Math.hypot(q[0]-Ie[0],q[1]-Ie[1]);let Ee=0;Ie=N;for(let Me of ye)Ee+=Math.hypot(Me[0]-Ie[0],Me[1]-Ie[1]),Ie=Me,R.push({x:Me[0],y:Me[1],...Ce(Te>0?Ee/Te:0),outer:true});}else if(me>.05){let ye=d(E,M),Te=null,Ie=null,Ee=Math.max(4,Math.ceil(me/1.5)),Me=-V[0]*te[1]+V[1]*te[0];if(ye>.05&&ye<ia&&Math.abs(Me)>1e-9){let We=(re*te[1]-se*te[0])/Me,Re=(re*V[1]-se*V[0])/Me;if(We>0&&Re>0){let He=Math.acos(Math.max(-1,Math.min(1,-V[0]*te[0]-V[1]*te[1]))),lt=He>.001?4/3*Math.tan(He/4)/Math.tan(He/2):2/3,qe=Math.max(We*lt,me/3),Bt=Math.max(Re*lt,me/3);Te=[N[0]-V[0]*qe,N[1]-V[1]*qe],Ie=[q[0]-te[0]*Bt,q[1]-te[1]*Bt],Ee=Math.max(3,Math.ceil(He/(Math.PI/24)));}}if(!Te||!Ie){let We=Math.max(-1,Math.min(1,-V[0]*te[0]-V[1]*te[1])),Re=Math.acos(We),He=Re>.05?4/3*Math.tan(Re/4)*me/(2*Math.sin(Re/2)):me/3;Te=[N[0]-V[0]*He,N[1]-V[1]*He],Ie=[q[0]-te[0]*He,q[1]-te[1]*He],Ee=Math.max(Ee,Math.ceil(Re/(Math.PI/24)));}for(let We=1;We<Ee;We++){let Re=We/Ee,He=1-Re,lt=He*He*He*N[0]+3*He*He*Re*Te[0]+3*He*Re*Re*Ie[0]+Re*Re*Re*q[0],qe=He*He*He*N[1]+3*He*He*Re*Te[1]+3*He*Re*Re*Ie[1]+Re*Re*Re*q[1];R.push({x:lt,y:qe,z:S.z+(D.z-S.z)*Re,h:S.h+(D.h-S.h)*Re,outer:true});}}}R.length>=3&&(_.set(F,B.length),B.push(R));}function T(F,U,j,R,H){let E=Math.min(.45,o.kerbWidth/F.half);return [U+(R-U)*E,j+(H-j)*E]}let k=12,K=new Map,P=[],W=[],z=(F,U)=>(F+1e6)*2e6+(U+1e6),L=(F,U,j,R,H,E,M,S)=>{let D=W.length;P.push(U,j,R,H,E,M,S),W.push(F);let O=Math.floor(Math.min(U,R,E)/k),N=Math.floor(Math.max(U,R,E)/k),q=Math.floor(Math.min(j,H,M)/k),V=Math.floor(Math.max(j,H,M)/k);for(let te=O;te<=N;te++)for(let oe=q;oe<=V;oe++){let ne=z(te,oe),re=K.get(ne);re||K.set(ne,re=[]),re.push(D);}},X=(F,U,j,R=-1)=>{let H=typeof R=="number"?null:R,E=K.get(z(Math.floor(F/k),Math.floor(U/k)));if(!E)return false;for(let M of E){if(H?H.includes(W[M]):W[M]===R)continue;let S=M*7;if(Math.abs(P[S+6]-j)>Z2)continue;let D=P[S],O=P[S+1],N=P[S+2],q=P[S+3],V=P[S+4],te=P[S+5],oe=(N-D)*(U-O)-(q-O)*(F-D),ne=(V-N)*(U-q)-(te-q)*(F-N),re=(D-V)*(U-te)-(O-te)*(F-V);if(oe>=0&&ne>=0&&re>=0||oe<=0&&ne<=0&&re<=0)return true}return false};w.forEach((F,U)=>{if(F)for(let j=0;j+1<F.length;j++){let R=F[j],H=F[j+1],E=(R.z+H.z)/2;L(U,R.lx,R.ly,R.rx,R.ry,H.rx,H.ry,E),L(U,R.lx,R.ly,H.rx,H.ry,H.lx,H.ly,E);}});let Q=B.map((F,U)=>{let j=[];for(let H of F)j.push(H.x,H.y);let R=ot(j);for(let H=0;H<R.length;H+=3){let[E,M,S]=[F[R[H]],F[R[H+1]],F[R[H+2]]];L(-2-U,E.x,E.y,M.x,M.y,S.x,S.y,(E.z+M.z+S.z)/3);}return R}),G=0;o.fillGap>0&&w.forEach((F,U)=>{if(!F||F.length<3)return;let j=[];for(let R=1;R+1<F.length;R++){let H=F[R];for(let E of [0,1]){let M=E===0?H.lx:H.rx,S=E===0?H.ly:H.ry,D=M-H.cx,O=S-H.cy,N=Math.hypot(D,O)||1;if(D/=N,O/=N,!X(M+D*.05,S+O*.05,H.z,U)){for(let q=Rd;q<=o.fillGap+1e-9;q+=Rd)if(X(M+D*q,S+O*q,H.z,U)){j.push([R,E,q/2+.05]);break}}}}for(let[R,H,E]of j){let M=F[R];if(H===0){let S=M.lx-M.cx,D=M.ly-M.cy,O=Math.hypot(S,D)||1;M.lx+=S/O*E,M.ly+=D/O*E;}else {let S=M.rx-M.cx,D=M.ry-M.cy,O=Math.hypot(S,D)||1;M.rx+=S/O*E,M.ry+=D/O*E;}G++;}});let Y=[],ie=0,ee=null,ue=null;if(sr&&(o.islands||o.outline)){let F=[],U=E=>Math.abs(E)<.05,j=E=>{let M=E.map(N=>!U(N.h)),S=[];for(let N=0;N<E.length;N++){if(!M[N])continue;let q=N;for(;q+1<E.length&&M[q+1];)q++;S.push([Math.max(0,N-1),Math.min(E.length-1,q+1)]),N=q;}let D=[],O=0;for(let[N,q]of S)N-O>=1&&D.push([O,N]),O=q;return E.length-1-O>=1&&D.push([O,E.length-1]),S.length?{raised:S,flat:D}:{raised:S,flat:[[0,E.length-1]]}},R=(E,M,S)=>{let D=[];for(let O=M;O<=S;O++)D.push([E[O].lx,E[O].ly]);for(let O=S;O>=M;O--)D.push([E[O].rx,E[O].ry]);return D.push(D[0]),D};if(w.forEach(E=>{if(!(!E||E.length<2))for(let[M,S]of j(E).flat)F.push([R(E,M,S)]);}),B.forEach(E=>{if(!E.every(S=>U(S.h)))return;let M=E.map(S=>[S.x,S.y]);M.push(M[0]),F.push([M]);}),o.outline){ue=[];let E=new Map;for(let[M,S]of u)E.set(M,S.filter(D=>C(D)).length);w.forEach((M,S)=>{if(!M||M.length<2||M.every(O=>U(O.h)))return;for(let[O,N]of j(M).raised){let q=R(M,O,N),V=[];for(let oe=0;oe+1<q.length;oe++)V.push(q[oe][0],q[oe][1]);let te=[];for(let oe=O;oe<=N;oe++)te.push(M[oe].cx,M[oe].cy,M[oe].h);ue.push({outer:V,profile:te});}let D=a[S];for(let O of [true,false]){if((E.get(f(O?D.head:D.tail))??0)>1)continue;let N=O?M[0]:M[M.length-1];if(U(N.h))continue;let[q,V]=O?[N.lx,N.ly]:[N.rx,N.ry],te=q-N.cx,oe=V-N.cy,ne=Math.max(8,Math.ceil(Math.PI*Math.hypot(te,oe)/.5)),re=[];for(let se=0;se<=ne;se++){let me=Math.PI*se/ne;re.push(N.cx+te*Math.cos(me)-oe*Math.sin(me),N.cy+te*Math.sin(me)+oe*Math.cos(me));}ue.push({outer:re,profile:[N.cx,N.cy,N.h,q,V,N.h]});}}),B.forEach(M=>{if(M.every(O=>U(O.h)))return;let S=[],D=[];for(let O of M)S.push(O.x,O.y),D.push(O.x,O.y,O.h);D.push(M[0].x,M[0].y,M[0].h),ue.push({outer:S,profile:D});});}if(o.outline){let E=new Map;for(let[M,S]of u)E.set(M,S.filter(D=>C(D)).length);w.forEach((M,S)=>{if(!M)return;let D=a[S];for(let O of [true,false]){if((E.get(f(O?D.head:D.tail))??0)>1)continue;let N=O?M[0]:M[M.length-1];if(!U(N.h))continue;let[q,V]=O?[N.lx,N.ly]:[N.rx,N.ry],te=q-N.cx,oe=V-N.cy,ne=Math.max(8,Math.ceil(Math.PI*Math.hypot(te,oe)/.5)),re=[];for(let se=0;se<=ne;se++){let me=Math.PI*se/ne;re.push([N.cx+te*Math.cos(me)-oe*Math.sin(me),N.cy+te*Math.sin(me)+oe*Math.cos(me)]);}re.push(re[0]),F.push([re]);}});}let H=oA(F,E=>{ie+=E;});for(let E of H)for(let M=1;M<E.length;M++){let S=E[M],D=0;for(let O=0;O+1<S.length;O++)D+=S[O][0]*S[O+1][1]-S[O+1][0]*S[O][1];D=Math.abs(D)/2,!(D<Pd||D>Hd)&&Y.push(S.map(([O,N])=>[O,N]));}if(o.outline){let E=D=>{let O=0;for(let N=0;N<D.length;N+=2){let q=(N+2)%D.length;O+=D[N]*D[q+1]-D[q]*D[N+1];}return O/2},M=D=>{let O=[];for(let N=0;N+1<D.length;N++)O.push(D[N][0],D[N][1]);return O},S=D=>{let O=[];for(let N=D.length-2;N>=0;N-=2)O.push(D[N],D[N+1]);return O};ee=H.map(D=>{let O=M(D[0]);E(O)<0&&(O=S(O));let N=D.slice(1).map(q=>{let V=M(q),te=Math.abs(E(V));return o.islands&&te>=Pd&&te<=Hd&&(V=Od(V)??V),E(V)>0?S(V):V});return {outer:O,holes:N}});}Y.forEach((E,M)=>{let S=[];for(let O=0;O+1<E.length;O++)S.push(E[O][0],E[O][1]);let D=ot(S);for(let O=0;O<D.length;O+=3){let N=D[O],q=D[O+1],V=D[O+2];L(-1e5-M,S[2*N],S[2*N+1],S[2*q],S[2*q+1],S[2*V],S[2*V+1],o.elevation);}});}let $=[],Ae=[],ve=[],he=[],xe=[],de=(F,U,j,R,H,E,M,S)=>($.push(F,U,j),Ae.push(R,H,E),ve.push(M),he.push(S),$.length/3-1),we=F=>{let U=F-o.elevation-o.deck;return U>.05?U:0},I=(F,U)=>{for(let j=0;j+1<F.length;j++){let[R,H,E,M]=F[j],[S,D,O,N]=F[j+1],q=D-H,V=-(S-R),te=Math.hypot(q,V);if(te<1e-9)continue;q/=te,V/=te,U||(q=-q,V=-V);let oe=de(R,H,E,q,V,0,Mn,M),ne=de(S,D,O,q,V,0,Mn,N),re=de(S,D,we(O),q,V,0,Mn,N),se=de(R,H,we(E),q,V,0,Mn,M);xe.push(oe,ne,re,oe,re,se);}},J=0,Z=(F,U,j,R=-1,H=[])=>{let E=F[0],M=F[F.length-1],S=(V,te)=>H.length>0&&(Math.hypot(V-E[0],te-E[1])<kd||Math.hypot(V-M[0],te-M[1])<kd),D=[R,...H],O=[],N=null,q=(V,te,oe)=>[V[0]+(te[0]-V[0])*oe,V[1]+(te[1]-V[1])*oe,V[2]+(te[2]-V[2])*oe,V[3]+(te[3]-V[3])*oe];for(let V=0;V+1<F.length;V++){let te=F[V],oe=F[V+1],ne=oe[1]-te[1],re=-(oe[0]-te[0]),se=Math.hypot(ne,re);if(se<1e-9)continue;ne/=se,re/=se,j||(ne=-ne,re=-re);let me=Be=>{let ge=q(te,oe,Be),ye=S(ge[0],ge[1])?D:R;return !X(ge[0]+ne*Td,ge[1]+re*Td,ge[2],ye)&&!X(ge[0]-ne*.02,ge[1]-re*.02,ge[2],ye)},_e=me(.02)&&me(.5)&&me(.98),Ce=_e?1:Math.max(1,Math.ceil(se/Y2));for(let Be=0;Be<Ce;Be++){let ge=Be/Ce,ye=(Be+1)/Ce,Te=(ge+ye)/2;if(!(_e||me(Te))){J++,N&&(O.push(N),N=null);continue}N||(N={outer:[q(te,oe,ge)],inner:[q(U[V],U[V+1],ge)]}),N.outer.push(q(te,oe,ye)),N.inner.push(q(U[V],U[V+1],ye));}}N&&O.push(N);for(let V of O){let te=ce(V.outer,V.inner);ae(te.map(oe=>V.outer[oe]),te.map(oe=>V.inner[oe]),j);}},ce=(F,U)=>{let j=[0],R=0,H=(E,M,S)=>{let D=S[0]-M[0],O=S[1]-M[1],N=D*D+O*O,q=N>0?Math.max(0,Math.min(1,((E[0]-M[0])*D+(E[1]-M[1])*O)/N)):0,V=Math.hypot(M[0]+D*q-E[0],M[1]+O*q-E[1]),te=Math.abs(M[2]+(S[2]-M[2])*q-E[2]);return Math.max(V,te)};for(let E=2;E<F.length;E++){let M=true;for(let S=R+1;S<E&&M;S++)(H(F[S],F[R],F[E])>Ld||H(U[S],U[R],U[E])>Ld)&&(M=false);M||(j.push(E-1),R=E-1);}return F.length>1&&j.push(F.length-1),j},ae=(F,U,j)=>{let R=o.kerbWidth>0?o.kerbHeight:0;for(let H=0;H+1<F.length;H++){let[E,M,S,D]=F[H],[O,N,q,V]=F[H+1],te=N-M,oe=-(O-E),ne=Math.hypot(te,oe);if(ne<1e-9||(te/=ne,oe/=ne,j||(te=-te,oe=-oe),I([[E,M,S+R,D],[O,N,q+R,V]],j),!(o.kerbWidth>0)))continue;let[re,se]=U[H],[me,_e]=U[H+1],Ce=de(E,M,S+R,0,0,1,_n,D),Be=de(O,N,q+R,0,0,1,_n,V),ge=de(me,_e,q+R,0,0,1,_n,V),ye=de(re,se,S+R,0,0,1,_n,D);xe.push(Ce,Be,ge,Ce,ge,ye);let Te=de(re,se,S+R,-te,-oe,0,En,D),Ie=de(me,_e,q+R,-te,-oe,0,En,V),Ee=de(me,_e,q,-te,-oe,0,En,V),Me=de(re,se,S,-te,-oe,0,En,D);xe.push(Te,Ie,Ee,Te,Ee,Me);}},be=new Map;for(let[F,U]of u)be.set(F,U.filter(j=>C(j)).length);let Se=0;return w.forEach((F,U)=>{if(!F)return;let j=a[U];Se++;let R=[];for(let M=0;M<F.length;M++){let S=F[M],D=F[Math.max(0,M-1)],O=F[Math.min(F.length-1,M+1)],N=O.d-D.d||1,q=(O.z-D.z)/N,V=-q*S.tx,te=-q*S.ty,oe=1,ne=Math.hypot(V,te,oe);V/=ne,te/=ne,oe/=ne,R.push(de(S.lx,S.ly,S.z,V,te,oe,Io,S.h),de(S.rx,S.ry,S.z,V,te,oe,Io,S.h));}for(let M=0;M+1<F.length;M++){let S=R[2*M],D=R[2*M+1],O=R[2*M+2],N=R[2*M+3];xe.push(S,D,N,S,N,O);}let H=[j.head,j.tail].map(M=>_.get(f(M))).filter(M=>M!==void 0).map(M=>-2-M);Z(F.map(M=>[M.lx,M.ly,M.z,M.h]),F.map(M=>[...T(j,M.lx,M.ly,M.cx,M.cy),M.z,M.h]),false,U,H),Z(F.map(M=>[M.rx,M.ry,M.z,M.h]),F.map(M=>[...T(j,M.rx,M.ry,M.cx,M.cy),M.z,M.h]),true,U,H);let E=[];for(let M of F)E.push(de(M.lx,M.ly,we(M.z),0,0,-1,lr,M.h),de(M.rx,M.ry,we(M.z),0,0,-1,lr,M.h));for(let M=0;M+1<F.length;M++){if(we(F[M].z)<=0&&we(F[M+1].z)<=0)continue;let S=E[2*M],D=E[2*M+1],O=E[2*M+2],N=E[2*M+3];xe.push(S,N,D,S,O,N);}for(let M of [true,false]){let S=M?j.head:j.tail;if((be.get(f(S))??0)>1)continue;let D=M?F[0]:F[F.length-1],[O,N]=M?[D.lx,D.ly]:[D.rx,D.ry],q=O-D.cx,V=N-D.cy,te=Math.hypot(q,V),oe=Math.max(6,Math.ceil(Math.PI*te/.8)),ne=[];for(let Ce=0;Ce<=oe;Ce++){let Be=Math.PI*Ce/oe,ge=Math.cos(Be),ye=Math.sin(Be);ne.push([D.cx+q*ge-V*ye,D.cy+q*ye+V*ge,D.z,D.h]);}let re=de(D.cx,D.cy,D.z,0,0,1,Io,D.h),se=ne.map(([Ce,Be,ge,ye])=>de(Ce,Be,ge,0,0,1,Io,ye));for(let Ce=0;Ce+1<se.length;Ce++)xe.push(re,se[Ce],se[Ce+1]);if(we(D.z)>0){let Ce=de(D.cx,D.cy,we(D.z),0,0,-1,lr,D.h),Be=ne.map(([ge,ye,Te,Ie])=>de(ge,ye,we(Te),0,0,-1,lr,Ie));for(let ge=0;ge+1<Be.length;ge++)xe.push(Ce,Be[ge+1],Be[ge]);}let me=te>0?Math.max(0,1-o.kerbWidth/te):0,_e=ne.map(([Ce,Be,ge,ye])=>[D.cx+(Ce-D.cx)*me,D.cy+(Be-D.cy)*me,ge,ye]);Z(ne,_e,true,U);}}),B.forEach((F,U)=>{let j=Q[U],R=F.map(S=>de(S.x,S.y,S.z,0,0,1,Io,S.h)),H=F.some(S=>we(S.z)>0),E=H?F.map(S=>de(S.x,S.y,we(S.z),0,0,-1,lr,S.h)):[];for(let S=0;S<j.length;S+=3)xe.push(R[j[S]],R[j[S+1]],R[j[S+2]]),H&&xe.push(E[j[S]],E[j[S+2]],E[j[S+1]]);let M=F.length;for(let S=0;S<M;S++){let D=F[S];if(D.ix!==void 0)continue;let O=F[(S-1+M)%M],N=F[(S+1)%M],q=[-(D.y-O.y),D.x-O.x],V=[-(N.y-D.y),N.x-D.x],te=Math.hypot(q[0],q[1])||1,oe=Math.hypot(V[0],V[1])||1,ne=q[0]/te+V[0]/oe,re=q[1]/te+V[1]/oe,se=Math.hypot(ne,re)||1;ne/=se,re/=se;let me=Math.max(.5,ne*(V[0]/oe)+re*(V[1]/oe));D.ix=D.x+ne*o.kerbWidth/me,D.iy=D.y+re*o.kerbWidth/me;}for(let S=0;S<M;S++){let D=F[S];if(!D.start)continue;let O=[D];for(let N=1;N<M;N++){let q=F[(S+N)%M];if(O.push(q),!q.outer)break}Z(O.map(N=>[N.x,N.y,N.z,N.h]),O.map(N=>[N.ix,N.iy,N.z,N.h]),true,-2-U,D.ribs??[]);}}),Y.forEach(F=>{let U=[];for(let V=0;V+1<F.length;V++)U.push(F[V][0],F[V][1]);let j=o.elevation,R=ot(U),H=[];for(let V=0;V<U.length;V+=2)H.push(de(U[V],U[V+1],j,0,0,1,Io,0));for(let V=0;V<R.length;V+=3)xe.push(H[R[V]],H[R[V+1]],H[R[V+2]]);let E=Od(U);if(!E)return;let M=j+o.kerbHeight-.01,S=ot(E),D=[];for(let V=0;V<E.length;V+=2)D.push(de(E[V],E[V+1],M,0,0,1,zd,0));for(let V=0;V<S.length;V+=3)xe.push(D[S[V]],D[S[V+1]],D[S[V+2]]);let O=E.length/2,N=[],q=[];for(let V=0;V<=O;V++){let te=V%O,oe=E[2*((te-1+O)%O)],ne=E[2*((te-1+O)%O)+1],re=E[2*te],se=E[2*te+1],me=E[2*((te+1)%O)],_e=E[2*((te+1)%O)+1],Ce=[-(se-ne),re-oe],Be=[-(_e-se),me-re],ge=Math.hypot(Ce[0],Ce[1])||1,ye=Math.hypot(Be[0],Be[1])||1,Te=Ce[0]/ge+Be[0]/ye,Ie=Ce[1]/ge+Be[1]/ye,Ee=Math.hypot(Te,Ie)||1;Te/=Ee,Ie/=Ee;let Me=Math.max(.5,Te*(Be[0]/ye)+Ie*(Be[1]/ye));N.push([re,se,j,0]),q.push([re+Te*o.kerbWidth/Me,se+Ie*o.kerbWidth/Me,j,0]);}ae(N,q,true);}),{positions:Float64Array.from($),normals:Float32Array.from(Ae),part:Uint8Array.from(ve),height:Float32Array.from(he),indices:Uint32Array.from(xe),ribbons:Se,patches:B.length,clusters:x,links:g,filled:G,islands:Y.length,unionFailures:ie,...ee?{outline:ee}:{},...ue?{raised:ue}:{},kerbSkipped:J,cuts:Float32Array.from(a.flatMap(F=>[F.chain,F.total,F.cutHead,F.cutTail,y[F.id][0],y[F.id][1]]))}}var nA=.06,iA=24,aA=.8;function sA(n,e){let t=n,o=e.metersPerUnit>0?e.metersPerUnit:.5,r=cA(t),i=Math.max(e.height,0);if(!(i>0)||!(r>0))return {heightAt:()=>i,rampIn:0,rampOut:0,knots:[],total:r};let a=Math.max(e.maxGrade??.06,.005),s=1.5*i/a/o,l=e.rampStart!==false,c=e.rampEnd!==false,f=l?s:0,u=c?s:0,h=f+u;h>r&&h>0&&(f=f/h*r,u=u/h*r);let d=p=>{if(p<=0)return l?0:i;if(p>=r)return c?0:i;let b=1;return f>0&&p<f&&(b=Math.min(b,Nd(p/f))),u>0&&r-p<u&&(b=Math.min(b,Nd((r-p)/u))),i*b},m=[];for(let[p,b]of [[0,f],[r,-u]])if(Math.abs(b)>0)for(let g=1;g<=Wd;g++){let y=p+b*g/Wd;y>.01&&y<r-.01&&m.push(y);}return m.sort((p,b)=>p-b),{heightAt:d,rampIn:f,rampOut:u,knots:m,total:r}}var Wd=8;function lA(n,e,t){let o=n,r=t.metersPerUnit>0?t.metersPerUnit:.5,i=Math.max(t.spacing??24,1)/r,a=Math.max(t.minHeight??.8,0),s=Math.max(t.deck,0),l=e.total;if(!(l>i*.5))return [];let c=[],f=l/2,u=Math.floor(l/i),h=f-(u-1)*i/2;for(let d=0;d<u;d++){let m=h+d*i;if(m<=0||m>=l)continue;let p=e.heightAt(m)-s;if(p<a)continue;let b=fA(o,m);b&&c.push({x:b.x,y:b.y,angle:b.angle,height:p,at:m});}return c}function cA(n){let e=0;for(let t=0;t+3<n.length;t+=2)e+=Math.hypot(n[t+2]-n[t],n[t+3]-n[t+1]);return e}function fA(n,e){let t=0;for(let o=0;o+3<n.length;o+=2){let r=n[o+2]-n[o],i=n[o+3]-n[o+1],a=Math.hypot(r,i);if(!(a<=0)){if(t+a>=e){let s=(e-t)/a;return {x:n[o]+r*s,y:n[o+1]+i*s,angle:Math.atan2(i,r)}}t+=a;}}return null}function Nd(n){let e=n<0?0:n>1?1:n;return e*e*(3-2*e)}var vl=class{constructor(e={}){this.options=e;this.group=null;this.needle=null;this.map=null;this.onMove=()=>this.syncCompass();}getDefaultPosition(){return "top-right"}onAdd(e){let t=e;this.map=t;let o=[];if(this.options.showZoom!==false&&(o.push(Vt("+","\u041F\u0440\u0438\u0431\u043B\u0438\u0437\u0438\u0442\u044C",()=>t.zoomIn())),o.push(Vt("\u2212","\u041E\u0442\u0434\u0430\u043B\u0438\u0442\u044C",()=>t.zoomOut()))),this.options.showCompass!==false){let r=Vt("","\u041F\u043E\u0432\u0435\u0440\u043D\u0443\u0442\u044C \u043D\u0430 \u0441\u0435\u0432\u0435\u0440",()=>t.resetNorthPitch()),i=document.createElement("span");i.style.cssText="display:block;width:0;height:0;border:6px solid transparent;border-bottom:12px solid #e03131;transform-origin:50% 75%",r.appendChild(i),this.needle=i,o.push(r);}return this.group=To(...o),t.on("move",this.onMove),this.syncCompass(),this.group}onRemove(e){e.off("move",this.onMove),this.group=null,this.needle=null,this.map=null;}syncCompass(){if(!this.needle||!this.map)return;let e=this.map.getBearing(),t=this.options.visualizePitch?this.map.getPitch():0;this.needle.style.transform=`rotate(${-e}deg) scaleY(${Math.cos(t*Math.PI/180).toFixed(3)})`;}},Cl=class{constructor(e={}){this.options=e;this.element=null;this.map=null;this.onMove=()=>this.sync();}getDefaultPosition(){return "bottom-left"}onAdd(e){let t=e;this.map=t;let o=document.createElement("div");return o.className="osmgl-ctrl-scale",o.style.cssText=["box-sizing:border-box;background:rgba(255,255,255,.75);border:2px solid #333;border-top:none","font:11px/1.6 system-ui,sans-serif;color:#333;padding:0 5px;text-align:center;white-space:nowrap"].join(";"),this.element=o,t.on("move",this.onMove),this.sync(),o}onRemove(e){e.off("move",this.onMove),this.element=null,this.map=null;}setUnit(e){this.options.unit=e,this.sync();}sync(){let e=this.element,t=this.map;if(!e||!t)return;let o=this.options.maxWidth??100,r=t.getCenter().lat,a=40075016686e-3*Math.cos(r*Math.PI/180)/(512*Math.pow(2,t.getZoom()))*o,s=this.options.unit??"metric",l,c;if(s==="imperial"){let f=a*3.2808;if(f>5280){let u=Sn(f/5280);l=`${u} mi`,c=u*5280/f;}else {let u=Sn(f);l=`${u} ft`,c=u/f;}}else if(s==="nautical"){let f=Sn(a/1852);l=`${f} nm`,c=f*1852/a;}else if(a>=1e3){let f=Sn(a/1e3);l=`${f} \u043A\u043C`,c=f*1e3/a;}else {let f=Sn(a);l=`${f} \u043C`,c=f/a;}e.style.width=`${Math.round(o*c)}px`,e.textContent=l;}};function Sn(n){let e=Math.pow(10,Math.floor(Math.log10(n))),t=n/e;return (t>=5?5:t>=3?3:t>=2?2:1)*e}var Bl=class{constructor(e={}){this.options=e;}getDefaultPosition(){return "bottom-right"}onAdd(){let e=this.options.customAttribution,t=Array.isArray(e)?e.join(" | "):e??"\xA9 OpenStreetMap contributors",o=document.createElement("div");if(o.className="osmgl-ctrl-attrib",o.style.cssText="background:rgba(255,255,255,.8);border-radius:4px;font:11px/1.8 system-ui,sans-serif;color:#333;padding:0 6px",o.innerHTML=t,this.options.compact){let r=Vt("i","\u0418\u0441\u0442\u043E\u0447\u043D\u0438\u043A\u0438 \u0434\u0430\u043D\u043D\u044B\u0445",()=>{o.style.display=o.style.display==="none"?"block":"none";});r.style.borderRadius="50%";let i=document.createElement("div");return i.style.cssText="display:flex;align-items:center;gap:4px",o.style.display="none",i.append(o,r),i}return o}onRemove(){}},Ml=class{constructor(e={}){this.options=e;this.target=null;}getDefaultPosition(){return "top-right"}onAdd(e){let t=e;return this.target=this.options.container??t.getContainer(),To(Vt("\u26F6","\u0412\u043E \u0432\u0435\u0441\u044C \u044D\u043A\u0440\u0430\u043D",()=>{document.fullscreenElement?document.exitFullscreen():this.target?.requestFullscreen();}))}onRemove(){this.target=null;}},_l=class{constructor(e={}){this.options=e;this.watchId=null;this.map=null;}getDefaultPosition(){return "top-right"}onAdd(e){this.map=e;let t=Vt("\u25CE","\u041C\u043E\u0451 \u043C\u0435\u0441\u0442\u043E\u043F\u043E\u043B\u043E\u0436\u0435\u043D\u0438\u0435",()=>this.locate());return To(t)}onRemove(){this.watchId!==null&&navigator.geolocation.clearWatch(this.watchId),this.watchId=null,this.map=null;}locate(){if(!navigator.geolocation)return;let e=this.options.positionOptions??{enableHighAccuracy:true,timeout:1e4},t=o=>{this.map?.easeTo({center:{lng:o.coords.longitude,lat:o.coords.latitude},zoom:this.options.fitBoundsOptions?.zoom??16,duration:800});};this.options.trackUserLocation?(this.watchId!==null&&navigator.geolocation.clearWatch(this.watchId),this.watchId=navigator.geolocation.watchPosition(t,void 0,e)):navigator.geolocation.getCurrentPosition(t,void 0,e);}},El=class{constructor(e){this.options=e;this.button=null;this.saved=null;}getDefaultPosition(){return "top-right"}onAdd(e){let t=e;return this.button=Vt("\u26F0","\u0420\u0435\u043B\u044C\u0435\u0444",()=>{t.getTerrain()?(this.saved=t.getTerrain(),t.setTerrain(null)):t.setTerrain(this.saved??{source:this.options.source,exaggeration:this.options.exaggeration??1});}),To(this.button)}onRemove(){this.button=null;}},Sl=class{getDefaultPosition(){return "top-right"}onAdd(e){let t=e;return To(Vt("\u{1F310}","\u0413\u043B\u043E\u0431\u0443\u0441",()=>{t.setProjection(t.getProjection()==="globe"?"mercator":"globe");}))}onRemove(){}},Fl=class{constructor(e={}){this.options=e;}getDefaultPosition(){return "bottom-left"}onAdd(){let e=document.createElement("a");if(e.href=this.options.href??"https://www.openstreetmap.org/",e.target="_blank",e.rel="noopener",e.style.cssText="display:block;background:rgba(255,255,255,.8);border-radius:4px;padding:2px 6px;font:11px/1.6 system-ui,sans-serif;color:#333;text-decoration:none",this.options.src){let t=document.createElement("img");t.src=this.options.src,t.alt=this.options.label??"\u043B\u043E\u0433\u043E\u0442\u0438\u043F",t.style.cssText="display:block;height:18px",e.appendChild(t);}else e.textContent=this.options.label??"OpenStreetMap";return e}onRemove(){}};var uA=1,Fn=class{constructor(e){this.originX=0;this.originY=0;this._revision=0;this.id=e.id??`obj-${uA++}`,this.zIndex=e.zIndex??0,this.altitude=e.altitude??0,this.visible=e.visible!==false,this.userData=e.userData??{},this.paint=e;}get ghostOpacity(){return this.paint.ghostOpacity??0}get revision(){return this._revision}invalidate(){this._revision++;}setPaint(e){return Object.assign(this.paint,e),this.invalidate(),this}setOriginFromCoords(e){let t=1/0,o=1/0,r=-1/0,i=-1/0;for(let a of e)for(let s of a){let l=Pe(s),c=Oe(l.lng),f=Ge(l.lat);c<t&&(t=c),c>r&&(r=c),f<o&&(o=f),f>i&&(i=f);}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=Pe(o);t.push(Oe(r.lng)-this.originX,Ge(r.lat)-this.originY);}return t}color(e,t){let o=Ve(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}},Dl=class extends Fn{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=Zr([this.toLocal(this.coordinates)]);if(!e)return [];let t=this.paint.width??6,o=[],r=this.paint.strokeWidth??0;r>0&&o.push({kind:"line",mesh:e,color:this.color("strokeColor","#ffffff"),width:t+r*2,offset:this.paint.offset});let i=this.colorRuns();if(!i.length)return o.push(this.linePaint({kind:"line",mesh:e,color:this.color("color","#2f6df6"),width:t})),o;let a=this.paint.opacity??1;for(let s of i){let l=Zr([this.toLocal(this.coordinates.slice(s.from,s.to+1))]);if(!l)continue;let c=Ve(s.color);o.push(this.linePaint({kind:"line",mesh:l,color:[c[0],c[1],c[2],c[3]*a],width:t}));}return o}colorRuns(){if(this.segments.length===0||this.coordinates.length<2)return [];let e=this.coordinates.length-1,t=this.segments.filter(r=>Number.isInteger(r.at)&&r.at>=0&&r.at<e).sort((r,i)=>r.at-i.at);if(!t.length)return [];let o=[];for(let r=0;r<t.length;r++){let i=r===0?0:t[r].at,a=r+1<t.length?t[r+1].at:e;a>i&&o.push({from:i,to:a,color:t[r].color});}return o}hitTest(e,t,o){let r=(this.paint.width??6)/2+(this.paint.strokeWidth??0)+o,i=kl(this.coordinates,this.altitude,t);for(let a=0;a+1<i.length;a++)if(Vd(e,i[a],i[a+1])<=r)return true;return false}},aa=class extends Fn{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=Ts(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(Il(a))),i=Zr(r);i&&e.push(this.linePaint({kind:"line",mesh:i,color:this.color("strokeColor","#2f6df6"),width:o}));}return e}hitTest(e,t){let o=kl(Il(this.coordinates[0]??[]),this.altitude,t);if(!Ll(e,o))return false;for(let r=1;r<this.coordinates.length;r++)if(Ll(e,kl(Il(this.coordinates[r]),this.altitude,t)))return false;return true}},Tl=class extends aa{constructor(e){super({...e,coordinates:[hA(e.center,e.radius,e.segments)]});}};function hA(n,e,t){let o=Pe(n),r=e/Mt(o.lat),i=Oe(o.lng),a=Ge(o.lat),s=Math.max(12,t??Math.min(128,Math.round(24+e/20))),l=[];for(let c=0;c<s;c++){let f=c/s*Math.PI*2;l.push([ut(i+Math.cos(f)*r),ct(a+Math.sin(f)*r)]);}return l}function kl(n,e,t){let o=[];for(let r of n){let i=Pe(r),a=t(i.lng,i.lat,e);a&&o.push(a);}return o}function Il(n){if(n.length<2)return n;let e=Pe(n[0]),t=Pe(n[n.length-1]);return e.lng===t.lng&&e.lat===t.lat?n:[...n,n[0]]}function Vd(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 Ll(n,e){let t=false;for(let o=0,r=e.length-1;o<e.length;r=o++){let i=e[o].x,a=e[o].y,s=e[r].x,l=e[r].y;a>n.y!=l>n.y&&n.x<(s-i)*(n.y-a)/(l-a)+i&&(t=!t);}return t}var Ud="objects3d",cr="level",dA=32,mA=100,pA=250,Kd=(n,e,t)=>`${n}\u241F${e}\u241F${t}`;function bA(n){return new Promise((e,t)=>{let o=new Image;o.crossOrigin="anonymous",o.onload=()=>e(o),o.onerror=()=>t(new Error(`\u043D\u0435 \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u043B\u0430\u0441\u044C \u043A\u0430\u0440\u0442\u0438\u043D\u043A\u0430 ${n}`)),o.src=n;})}function Xd(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 gA(n){if(n.type==="surface"&&(n.deck??0)>0)return 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 Rl=class extends yt{constructor(t){super();this.options=t;this.transform=new dr;this.ctx=null;this.sources=new fe;this.rasterSources=new fe;this.demSources=new fe;this.renderer=new tn;this.objects=new qr;this.markerHost=null;this.gestures=null;this.resizeObserver=null;this.frameHandle=0;this.retryTimer=0;this.retryTimerAt=1/0;this.needsRepaint=true;this.padding={top:0,right:0,bottom:0,left:0};this.animation=null;this.ready=false;this.destroyed=false;this.pixelRatio=1;this.layerEdits=[];this.featureStates=new fe;this.centerClamped=true;this.spriteUrl=null;this.extraSprites=new fe;this.spriteImages=new fe;this.glyphsUrl="";this.mediaSources=new fe;this.transformRequest=null;this.cameraUpdate=null;this.transformConstrain=null;this.zoomSnap=0;this.bearingSnap=7;this.objects3d=null;this.objects3dEnabled=true;this.lastFrameAt=0;this.continuousFrames=0;this.onHashChange=null;this.lastMoveEmit=0;this.lastIndoorKey="";this.inCameraHooks=false;this.groundAt=(t,o)=>this.renderer.terrain.heightAtMerc(t,o);this.writingHash=false;this.hashTimer=0;this.layerOverrides=new fe;this.autoIndoorLevel=true;this.debugFB=null;let o=typeof t.container=="string"?document.getElementById(t.container):t.container;if(!o)throw new Error(`[osmgl] \u043A\u043E\u043D\u0442\u0435\u0439\u043D\u0435\u0440 \u043D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D: ${String(t.container)}`);this.container=o,this.qualityAuto=(t.quality??"auto")==="auto";let r=this.qualityAuto?Un(Kn()):t.quality;this.governor=new br(r,r,dA,mA),this.quality=po(r),this.densityQuality=this.quality,this.maxPixelRatio=t.maxPixelRatio??this.quality.maxPixelRatio,this._style=new Xo(t.theme?Nr(t.theme,t.style):t.style),this.background=t.background?Ve(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),this.controls=new Wn(this.container);let a=()=>this.gestures,s={...pa,...t.gestures??{}};this.handlers={dragPan:new Et(a,"dragPan",s.dragPan),dragRotate:new Et(a,"dragRotate",s.dragRotate),scrollZoom:new Et(a,"scrollZoom",s.scrollZoom),doubleClickZoom:new Et(a,"doubleClickZoom",s.doubleClickZoom),touchZoomRotate:new Et(a,"touchZoomRotate",s.touchZoomRotate),touchPitch:new Et(a,"touchPitch",s.touchPitch),keyboard:new Et(a,"keyboard",s.keyboard),boxZoom:new mr(this.canvas,this.container,(c,f)=>{this.fitScreenCoordinates(c,f,this.transform.bearing,{duration:400});}),cooperative:new pr(this.canvas,this.container,c=>{this.gestures?.setOptions({scrollZoom:c});})},t.cooperativeGestures&&this.handlers.cooperative.enable();let l=this.transform;l.minZoom=t.minZoom??0,l.maxZoom=t.maxZoom??22,l.maxPitch=t.maxPitch??75,l.projection=t.projection??"mercator",l.center=Pe(t.center??[0,0]),l.zoom=t.zoom??2,l.bearing=t.bearing??0,l.pitch=t.pitch??0,this.hashName=typeof t.hash=="string"?t.hash:void 0,t.hash&&this.applyHash(false),this.pool=new Qi(t.workerCount??Math.min(nl(),this.quality.maxWorkers)),this.initGL(),this.applyRendererQuality(this.quality),this.initSource(),this.initInput(),this.initResize(),this.measureRefresh(),queueMicrotask(()=>{this.destroyed||(this.ready=true,this.emit("load",void 0),this.triggerRepaint());});}measureRefresh(){if(typeof requestAnimationFrame!="function")return;let t=[],o=r=>{if(this.destroyed)return;if(t.push(r),t.length<12){requestAnimationFrame(o);return}let i=1/0;for(let a=1;a<t.length;a++)i=Math.min(i,t[a]-t[a-1]);this.governor.setRefresh(i);};requestAnimationFrame(o);}initGL(){let t=this.canvas.getContext("webgl2",{alpha:false,antialias:this.quality.antialias,depth:true,stencil:true,preserveDrawingBuffer:false,powerPreference:"high-performance",failIfMajorPerformanceCaveat:false});if(!t)throw new Error("[osmgl] WebGL2 \u043D\u0435\u0434\u043E\u0441\u0442\u0443\u043F\u0435\u043D \u0432 \u044D\u0442\u043E\u043C \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435");this.ctx=new Tn(t),this.glyphsUrl=this.options.fonts??"/tileserver/fonts/{fontstack}/{range}.pbf";let o=new nr(this.glyphsUrl,this.options.fontstack);this.options.icons&&o.icons.setIcons({...Mo,...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(De,{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);this.syncTerrain();let t=this.options.objects3d;if(t){this.objects3d=new Zi({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:Ud,type:"model",sourceLayer:t.sourceLayer??"model3d",minzoom:0,maxzoom:24}}sourceDrawn(t,o){for(let r of this._style.layers)if(r.type!=="raster"&&(r.source??De)===t&&this._style.layerVisibleAt(r,o))return true;return t===this.objects3dSource&&this.objects3dEnabled?o>=(this.options.objects3d?.layout?.minZoom??0):false}planFor(t,o=this._style){let r=o.workerPlan(t),i=t===this.objects3dSource?[...r,this.objects3dPlan()]:r;return this.quality.simpleGeometry?i.map(gA):i}updateObjects3D(){let t=this.objects3d,o=this.objects3dSource;if(!t||!o)return;let r=this.sources.get(o);if(!r)return;if(!this.objects3dEnabled){t.models.length&&t.clear(s=>this.renderer.models.remove(s,this.ctx?.gl)),this.renderer.hiddenBuildings=t.replacedBuildings,this.renderer.hiddenVenues=t.replacedVenues,this.renderer.hiddenVenueLayer=null;return}let i=this.venuesForMask();t.update({id:Ud,"source-layer":this.options.objects3d.sourceLayer??"model3d",layout:this.options.objects3d.layout},r,this.transform,s=>this.renderer.models.add(s),s=>this.renderer.models.remove(s,this.ctx?.gl),this.buildingsForMask(),i),this.renderer.hiddenBuildings=t.replacedBuildings,this.renderer.hiddenVenues=t.replacedVenues,this.renderer.hiddenVenueLayer=i?.key??null;let a=this.renderer.indoorMask.footprint();if(a){let s=this.transform.worldSize>0?this.transform.pixelsPerMeter/this.transform.worldSize*1.5:0;for(let l of t.models){let c=l.origin();l.setHidden(Zt(a,c.x,c.y,s));}}else for(let s of t.models)s.setHidden(false);}buildingsForMask(){let t=this.sources.get(De);if(!t)return null;for(let o of this._style.layers){if(o.type!=="fill-extrusion"||(o.source??De)!==De)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===cr&&t.add(o.source??De);for(let o of this._style.layers){if(o.type!=="fill-extrusion"||"splitBy"in o&&o.splitBy)continue;let r=o.source??De;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}syncTerrain(){let t=this._style.spec.terrain,o=t?this.demSources.get(t.source)??null:null;this.renderer.terrain.setSource(o),this.renderer.terrain.exaggeration=t?.exaggeration??1,this.transform.elevationAt=this.renderer.terrain.enabled?this.groundAt:null;}addSource(t,o){if(this.sources.get(t)?.destroy(),this.sources.delete(t),this.rasterSources.get(t)?.destroy(),this.rasterSources.delete(t),this.demSources.get(t)?.destroy(),this.demSources.delete(t),this.mediaSources.get(t)?.destroy(),this.mediaSources.delete(t),o.type==="raster-dem"){let i=new dn({url:o.url??"",encoding:o.encoding??"mapbox",minzoom:o.minzoom??0,maxzoom:o.maxzoom??10});return i.on("data",()=>this.triggerRepaint()),i.on("error",({message:a})=>this.emit("error",{message:a})),this.demSources.set(t,i),this.syncTerrain(),this.triggerRepaint(),this}if(o.type==="image"||o.type==="video"||o.type==="canvas"){let i=new mn({kind:o.type,url:o.url,canvas:o.canvas,coordinates:o.coordinates,animate:o.animate});return i.on("data",()=>this.triggerRepaint()),i.on("error",({message:a})=>this.emit("error",{message:a})),this.mediaSources.set(t,i),this.renderer.mediaSources=this.mediaSources,this.triggerRepaint(),this}if(o.type==="geojson"){let i=new bn(this.pool,{data:o.data,sourceLayer:o.sourceLayer,cluster:o.cluster,clusterRadius:o.clusterRadius,clusterMaxZoom:o.clusterMaxZoom,minzoom:o.minzoom??0,maxzoom:o.maxzoom??18,cacheSize:this.quality.tileCacheSize,plan:this.planFor(t)});return i.on("data",()=>this.triggerRepaint()),i.on("error",({message:a})=>this.emit("error",{message:a})),this.sources.set(t,i),this.triggerRepaint(),this}if(o.type==="raster"){let i=new hn({url:o.url??"",minzoom:o.minzoom??0,maxzoom:o.maxzoom??19,cacheSize:this.quality.tileCacheSize*2});return i.setTransformRequest(this.transformRequest),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 ir(this.pool,{url:o.url??"",minzoom:o.minzoom??0,maxzoom:o.maxzoom??14,cacheSize:this.quality.tileCacheSize*2,plan:this.planFor(t),rank:t===De?0:1});return r.setTransformRequest(this.transformRequest),r.on("data",()=>this.triggerRepaint()),r.on("error",({message:i})=>{this.emit("error",{message:i}),this.triggerRepaint();}),t===De&&r.on("idle",()=>this.emit("idle",void 0)),this.sources.set(t,r),this.triggerRepaint(),this}initInput(){this.gestures=new zn(this.canvas,this.transform,t=>{this.animation=null,t==="zoom"&&this.emit("zoom",void 0),this.emitMove(),this.triggerRepaint();},()=>this.emit("moveend",void 0),this.options.gestures),this.initClicks(),this.initHash();}initClicks(){let t=null;this.canvas.addEventListener("pointerdown",r=>{r.button===0&&(t={x:r.clientX,y:r.clientY,t:performance.now()});}),this.canvas.addEventListener("pointerup",r=>{let i=t;if(t=null,r.button!==0||!i||Math.hypot(r.clientX-i.x,r.clientY-i.y)>4||performance.now()-i.t>500)return;let a=this.canvas.getBoundingClientRect(),s={x:r.clientX-a.left,y:r.clientY-a.top},l=this.objects.hitTest(this.transform,s),c=l?null:this.queryRoom(s),f=l||c?null:this.queryBuilding(s);this.options.highlightBuildings!==false&&(this.setHighlight(f),this.setRoomHighlight(c));for(let u of this.getPopups())u.closeOnClick&&this.removePopup(u);this.emit("click",{point:s,lngLat:this.transform.unproject(s),object:l,building:f,symbol:this.querySymbol(s,4)});}),this.canvas.addEventListener("dblclick",r=>{let i=this.pointOf(r);this.emit("dblclick",{point:i,lngLat:this.transform.unproject(i)});}),this.canvas.addEventListener("contextmenu",r=>{r.preventDefault();let i=this.pointOf(r);this.emit("contextmenu",{point:i,lngLat:this.transform.unproject(i)});});let o=0;this.canvas.addEventListener("pointermove",r=>{if(r.pointerType==="touch")return;let i=performance.now();if(i-o<16)return;o=i;let a=this.pointOf(r),s=this.querySymbol(a);this.setSymbolHover(s),this.emit("mousemove",{point:a,lngLat:this.transform.unproject(a),object:this.objects.hitTest(this.transform,a),symbol:s});});}pointOf(t){let o=this.canvas.getBoundingClientRect();return {x:t.clientX-o.left,y:t.clientY-o.top}}initResize(){this.resizeObserver=new ResizeObserver(()=>this.resize()),this.resizeObserver.observe(this.container),this.resize();}resize(){if(this.destroyed)return;let t=this.container.clientWidth||1,o=this.container.clientHeight||1,r=Aa(t,o,Math.min(window.devicePixelRatio||1,this.maxPixelRatio),this.densityQuality);this.pixelRatio=r,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=Pe(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=Pe(t.center)),t.zoom!==void 0&&(o.zoom=t.zoom),t.bearing!==void 0&&(o.bearing=t.bearing),t.pitch!==void 0&&(o.pitch=t.pitch),this.animation=null,this.afterCameraChange()}easeTo(t){let o=t.duration??0;if(o<=0)return this.jumpTo(t);let r=this.transform,i={center:r.center,zoom:r.zoom,bearing:r.bearing,pitch:r.pitch},s={center:t.center!==void 0?Pe(t.center):r.center,zoom:t.zoom??r.zoom,bearing:i.bearing+$t((t.bearing??r.bearing)-i.bearing),pitch:t.pitch??r.pitch};return this.animation={start:performance.now(),duration:o,from:i,to:s},this.triggerRepaint(),this}flyTo(t){let o=this.transform,r={center:o.center,zoom:o.zoom,bearing:o.bearing,pitch:o.pitch},a={center:t.center!==void 0?Pe(t.center):o.center,zoom:t.zoom??o.zoom,bearing:r.bearing+$t((t.bearing??o.bearing)-r.bearing),pitch:t.pitch??o.pitch},s=eo(r.zoom),l=(Oe(a.center.lng)-Oe(r.center.lng))*s,c=(Ge(a.center.lat)-Ge(r.center.lat))*s,f=Math.hypot(l,c),u=Math.max(o.width,o.height),h=u*Math.pow(2,r.zoom-a.zoom),d=1.42,m=d*d,p,b=null;if(f<1e-6){let y=Math.log(h/u);p=Math.abs(y)/d,b=A=>({u:0,w:u*Math.exp(d*Math.sign(y)*A)});}else {let y=B=>{let _=B===0?u:h,T=B===0?h:u;return (T*T-_*_+(B===0?1:-1)*m*m*f*f)/(2*_*m*f)},A=B=>Math.log(-y(B)+Math.sqrt(y(B)*y(B)+1)),x=A(0);p=(A(1)-x)/d;let w=B=>(Math.exp(B)+Math.exp(-B))/2,C=B=>(Math.exp(2*B)-1)/(Math.exp(2*B)+1);b=B=>{let _=d*B+x;return {u:u*w(x)*C(_)/m-u*Math.sinh(x)/m,w:u*w(x)/w(_)}};}if(!Number.isFinite(p)||p<=0)return this.jumpTo(t);let g=t.duration??Math.min(3e3,p/1.2*1e3);return this.animation={start:performance.now(),duration:g,from:r,to:a,fly:{S:p,u1:f,curve:b,w0:u}},this.triggerRepaint(),this}setPadding(t){return this.padding=Xd(t),this.renderer.symbols&&(this.renderer.symbols.padding=this.padding),this.triggerRepaint(),this}getPadding(){return {...this.padding}}getBounds(){let t=this.transform,o=new Do;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=ca(t,{width:r.width,height:r.height,bearing:o.bearing??r.bearing,padding:o.padding!==void 0?Xd(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)}panBy(t,o={}){let r=this.transform.unproject({x:this.transform.width/2+t[0],y:this.transform.height/2+t[1]});return this.panTo(r,o)}panTo(t,o={}){return this.easeTo({...o,center:t,duration:o.duration??500})}zoomTo(t,o={}){return this.easeTo({...o,zoom:t,duration:o.duration??300})}zoomIn(t={}){return this.zoomTo(this.snapZoom(this.transform.zoom+1),t)}zoomOut(t={}){return this.zoomTo(this.snapZoom(this.transform.zoom-1),t)}rotateTo(t,o={}){return this.easeTo({...o,bearing:t,duration:o.duration??500})}resetNorth(t={}){return this.rotateTo(0,{...t,duration:t.duration??1e3})}resetNorthPitch(t={}){return this.easeTo({...t,bearing:0,pitch:0,duration:t.duration??1e3})}snapToNorth(t={}){return Math.abs($t(this.transform.bearing))<=this.bearingSnap?this.resetNorth(t):this}stop(){return this.animation=null,this}isEasing(){return this.animation!==null}isMoving(){return this.isEasing()||(this.gestures?.moving??false)}isZooming(){let t=this.animation;return t!==null&&t.from.zoom!==t.to.zoom||(this.gestures?.zooming??false)}isRotating(){let t=this.animation;return t!==null&&t.from.bearing!==t.to.bearing||(this.gestures?.rotating??false)}getMinZoom(){return this.transform.minZoom}setMinZoom(t){return this.transform.minZoom=t,this.transform.zoom=this.transform.zoom,this.afterCameraChange()}getMaxZoom(){return this.transform.maxZoom}setMaxZoom(t){return this.transform.maxZoom=t,this.transform.zoom=this.transform.zoom,this.afterCameraChange()}getMinPitch(){return this.transform.minPitch}setMinPitch(t){return this.transform.minPitch=t,this.transform.pitch=this.transform.pitch,this.afterCameraChange()}getMaxPitch(){return this.transform.maxPitch}setMaxPitch(t){return this.transform.maxPitch=t,this.transform.pitch=this.transform.pitch,this.afterCameraChange()}getMaxBounds(){return this.transform.maxBounds}setMaxBounds(t){return this.transform.maxBounds=t,this.transform.center=this.transform.center,this.afterCameraChange()}getZoomSnap(){return this.zoomSnap}setZoomSnap(t){return this.zoomSnap=Math.max(t,0),this}getVerticalFieldOfView(){return this.transform.fov}setVerticalFieldOfView(t){return this.transform.fov=t,this.afterCameraChange()}getCenterElevation(){return this.transform.centerElevation}setCenterElevation(t){return this.transform.centerElevation=t,this.afterCameraChange()}getCameraTargetElevation(){return this.transform.centerElevation}getContainer(){return this.container}getCanvas(){return this.canvas}getCanvasContainer(){return this.canvas.parentElement??this.container}getPixelRatio(){return this.pixelRatio}setPixelRatio(t){return this.maxPixelRatio=t>0?t:window.devicePixelRatio||1,this.resize(),this}redraw(){return this.triggerRepaint(),this}remove(){this.destroy();}loaded(){return this.isLoaded&&this.areTilesLoaded()}areTilesLoaded(){for(let t of this.sources.keys())if(this.sourceDrawn(t,this.transform.zoom)&&!this.isSourceLoaded(t))return false;return true}isSourceLoaded(t){let o=this.sources.get(t);if(!o)return false;for(let r of o.visibleTiles)if(o.getTile(r)?.state==="loading")return false;return true}fitScreenCoordinates(t,o,r=this.transform.bearing,i={}){let a=Do.from([this.transform.unproject(t),this.transform.unproject(o)]);return this.fitBounds(a,{...i,bearing:r})}calculateCameraOptionsFromTo(t,o,r,i=0){let a=this.transform,s=Pe(t),l=Pe(r),c=y=>1/(40075016686e-3*Math.max(Math.abs(Math.cos(y*Math.PI/180)),1e-6)),f=Oe(l.lng)-Oe(s.lng),u=Ge(l.lat)-Ge(s.lat),h=i*c(l.lat)-o*c(s.lat),d=Math.hypot(f,u,h);if(d===0)return {center:l,zoom:a.zoom,bearing:a.bearing,pitch:a.pitch,elevation:i};let m=Math.hypot(f,u),p=Math.log2(a.cameraToCenterDistance/d/512),b=Math.atan2(f,-u)*180/Math.PI,g=Math.acos(Math.min(m/d,1))*180/Math.PI;return g=h<0?90-g:90+g,{center:l,zoom:p,bearing:b,pitch:g,elevation:i}}trimTileMemory(){let t=this.quality.tileMemoryBudget;if(t<=0)return;let o=0;for(let r of this.sources.values())o+=r.retainedBytes;for(;o>t;){let r=[...this.sources.values()].sort((a,s)=>s.retainedBytes-a.retainedBytes),i=false;for(let a of r){let s=a.dropOldest();if(!(s<0)){o-=s,i=true;break}}if(!i)return}}snapZoom(t){return this.zoomSnap<=0?t:Math.round(t/this.zoomSnap)*this.zoomSnap}stepAnimation(t){let o=this.animation;if(!o)return false;let r=nt((t-o.start)/o.duration,0,1),i=o.fly?r:Dn(r),a=this.transform,s=Pe(o.from.center),l=Pe(o.to.center);if(o.fly){let{u:c,w:f}=o.fly.curve(o.fly.S*r),u=o.fly.u1>1e-6?nt(c/o.fly.u1,0,1):r;return a.center={lng:s.lng+(l.lng-s.lng)*u,lat:s.lat+(l.lat-s.lat)*u},a.zoom=o.from.zoom+Math.log2(o.fly.w0/f),a.bearing=o.from.bearing+(o.to.bearing-o.from.bearing)*Dn(r),a.pitch=o.from.pitch+(o.to.pitch-o.from.pitch)*Dn(r),r>=1&&(a.center=l,a.zoom=o.to.zoom),this.emitMove(),r>=1?(this.animation=null,this.emit("moveend",void 0),false):true}return a.center={lng:s.lng+(l.lng-s.lng)*i,lat:s.lat+(l.lat-s.lat)*i},a.zoom=o.from.zoom+(o.to.zoom-o.from.zoom)*i,a.bearing=o.from.bearing+(o.to.bearing-o.from.bearing)*i,a.pitch=o.from.pitch+(o.to.pitch-o.from.pitch)*i,this.emitMove(),r>=1?(this.animation=null,this.emit("moveend",void 0),false):true}afterCameraChange(){return this.applyCameraHooks(),this.emitMove(),this.triggerRepaint(),this}applyCameraHooks(){if(!this.inCameraHooks&&!(!this.cameraUpdate&&!this.transformConstrain)){this.inCameraHooks=true;try{let t=this.transform;if(this.cameraUpdate){let o=this.cameraUpdate({center:t.center,zoom:t.zoom,bearing:t.bearing,pitch:t.pitch});o&&(o.center!==void 0&&(t.center=Pe(o.center)),o.zoom!==void 0&&(t.zoom=o.zoom),o.bearing!==void 0&&(t.bearing=o.bearing),o.pitch!==void 0&&(t.pitch=o.pitch));}if(this.transformConstrain){let o=this.transformConstrain({center:t.center,zoom:t.zoom});o&&(o.center!==void 0&&(t.center=Pe(o.center)),o.zoom!==void 0&&(t.zoom=o.zoom));}}finally{this.inCameraHooks=false;}}}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(Pe(t),o)}unproject(t){return this.transform.unproject(t)}get style(){return this._style}setStyle(t){let o=this._style,r=new Xo(this.applyLayerEdits(t));Object.assign(r.splitValues,o.splitValues),this._style=r,this.applyLayerOverrides();for(let[i,a]of this.sources.entries()){let s=JSON.stringify(o.workerPlan(i)),l=JSON.stringify(r.workerPlan(i));s!==l&&a.setPlan(this.planFor(i,r));}return this.syncTerrain(),this.objects3d?.setModelKey(t.model3dKey??""),this.triggerRepaint(),this}addLayer(t,o){if(t.type==="custom"){let r=t;return this.renderer.customLayers.some(i=>i.layer.id===r.id)?this:(this.renderer.customLayers.push({layer:r,before:o}),this.ctx&&r.onAdd?.(this,this.ctx.gl),this.triggerRepaint(),this)}return this.layerEdits.push({kind:"add",layer:t,before:o}),this.setStyle(this._style.spec)}removeLayer(t){let o=this.renderer.customLayers.findIndex(r=>r.layer.id===t);if(o>=0){let[r]=this.renderer.customLayers.splice(o,1);return this.ctx&&r.layer.onRemove?.(this,this.ctx.gl),this.triggerRepaint(),this}return this.layerEdits.push({kind:"remove",id:t}),this.layerOverrides.delete(t),this.setStyle(this._style.spec)}moveLayer(t,o){return this.layerEdits.push({kind:"move",id:t,before:o}),this.setStyle(this._style.spec)}getLayer(t){return this._style.spec.layers.find(o=>o.id===t)??this.renderer.customLayers.find(o=>o.layer.id===t)?.layer}getLayersOrder(){return this._style.spec.layers.map(t=>t.id)}setLayerZoomRange(t,o,r){return this.layerEdits.push({kind:"zoom",id:t,minzoom:o,maxzoom:r}),this.setStyle(this._style.spec)}getFilter(t){let o=this.getLayer(t);return o&&"filter"in o?o.filter:void 0}setFilter(t,o){return this.layerEdits.push({kind:"filter",id:t,filter:o}),this.setStyle(this._style.spec)}getStyle(){return structuredClone(this._style.spec)}isStyleLoaded(){return true}getLight(){return this._style.light}setTerrain(t){let o={...this._style.spec};return t?o.terrain=t:delete o.terrain,this.setStyle(o),this}getTerrain(){return this._style.spec.terrain??null}getSource(t){return this.sources.get(t)??this.rasterSources.get(t)??this.demSources.get(t)??this.mediaSources.get(t)}removeSource(t){let o=this.sources.get(t);o&&(o.destroy(),this.sources.delete(t));let r=this.rasterSources.get(t);r&&(r.destroy(),this.rasterSources.delete(t));let i=this.demSources.get(t);i&&(this.demSources.delete(t),this.syncTerrain());let a=this.mediaSources.get(t);return a&&(a.destroy(),this.mediaSources.delete(t)),(o||r||i||a)&&this.triggerRepaint(),this}refreshTiles(t){return this.refreshSource(t)}getRoll(){return this.transform.roll}setRoll(t){return this.transform.roll=t,this.afterCameraChange()}applyLayerEdits(t){if(!this.layerEdits.length)return t;let o=[...t.layers],r=i=>i===void 0?o.length:o.findIndex(a=>a.id===i);for(let i of this.layerEdits){if(i.kind==="add"){let s=structuredClone(i.layer),l=o.findIndex(c=>c.id===s.id);if(l>=0)o[l]=s;else {let c=r(i.before);o.splice(c<0?o.length:c,0,s);}continue}let a=o.findIndex(s=>s.id===i.id);if(!(a<0)){if(i.kind==="remove")o.splice(a,1);else if(i.kind==="move"){let[s]=o.splice(a,1),l=r(i.before);o.splice(l<0?o.length:l,0,s);}else if(i.kind==="zoom"){let s={...o[a]};i.minzoom===void 0?delete s.minzoom:s.minzoom=i.minzoom,i.maxzoom===void 0?delete s.maxzoom:s.maxzoom=i.maxzoom,o[a]=s;}else if(i.kind==="filter"){let s={...o[a]};i.filter===void 0||i.filter===null?delete s.filter:s.filter=i.filter,o[a]=s;}}}return {...t,layers:o}}queryRenderedFeatures(t,o={}){let r=t??[{x:0,y:0},{x:this.transform.width,y:this.transform.height}];return tl(this.transform,this.sources,this._style.layers,r,o,(i,a,s)=>this.featureStateOf(i,a,s))}querySourceFeatures(t,o={}){let r=this.sources.get(t);return r?ol(r,t,o,(i,a,s)=>this.featureStateOf(i,a,s)):[]}setFeatureState(t,o){let r=Kd(t.source,t.sourceLayer??"",t.id);return this.featureStates.set(r,{...this.featureStates.get(r)??{},...o}),this.triggerRepaint(),this}getFeatureState(t){return this.featureStateOf(t.source,t.sourceLayer??"",t.id)}removeFeatureState(t,o){let r=`${t.source}\u241F${t.sourceLayer??""}\u241F`;if(t.id===void 0)for(let i of [...this.featureStates.keys()])i.startsWith(r)&&this.featureStates.delete(i);else if(o===void 0)this.featureStates.delete(r+t.id);else {let i=this.featureStates.get(r+t.id);i&&delete i[o];}return this.triggerRepaint(),this}queryTerrainElevation(t){if(!this.renderer.terrain.enabled)return null;let o=Pe(t);return this.renderer.terrain.heightAt(o.lng,o.lat)}setCenterClampedToGround(t){return this.centerClamped=t,this.triggerRepaint(),this}getCenterClampedToGround(){return this.centerClamped}featureStateOf(t,o,r){let i=this.featureStates.get(Kd(t,o,r));return i?{...i}:{}}addImage(t,o,r={}){let i=this.renderer.symbols?.images;return i?i.add(t,o,r)?(this.triggerRepaint(),this):(console.warn(`[osmgl] \u043A\u0430\u0440\u0442\u0438\u043D\u043A\u0430 \xAB${t}\xBB \u0443\u0436\u0435 \u0435\u0441\u0442\u044C \u2014 \u0434\u043B\u044F \u0437\u0430\u043C\u0435\u043D\u044B \u043D\u0443\u0436\u0435\u043D updateImage`),this):this}updateImage(t,o,r={}){return this.renderer.symbols?.images.update(t,o,r)&&this.triggerRepaint(),this}removeImage(t){return this.renderer.symbols?.images.remove(t)&&this.triggerRepaint(),this}hasImage(t){return this.renderer.symbols?.images.has(t)??false}getImage(t){return this.renderer.symbols?.images.get(t)}listImages(){return this.renderer.symbols?.images.list()??[]}setMissingStyleImageResolver(t){return this.renderer.symbols?.setMissingImage(t),this}async setSprite(t){for(let[o,r]of [...this.spriteImages])r===""&&this.removeImage(o);return this.spriteImages.clear(),this.spriteUrl=t,t&&await this.loadSprite("",t),this}getSprite(){let t=this.spriteUrl?[{id:"",url:this.spriteUrl}]:[];for(let[o,r]of this.extraSprites)t.push({id:o,url:r});return t}async addSprite(t,o){return this.extraSprites.set(t,o),await this.loadSprite(t,o),this}removeSprite(t){for(let[o,r]of [...this.spriteImages])r===t&&(this.removeImage(o),this.spriteImages.delete(o));return this.extraSprites.delete(t),this}getGlyphs(){return this.glyphsUrl}setGlyphs(t){return this.glyphsUrl=t,this.renderer.symbols?.setGlyphsUrl(t),this.triggerRepaint(),this}async loadSprite(t,o){let r=Math.min(Math.round(window.devicePixelRatio||1),2),i=r>1?`@${r}x`:"";try{let[a,s]=await Promise.all([fetch(`${o}${i}.json`).then(f=>f.json()),bA(`${o}${i}.png`)]),l=document.createElement("canvas");l.width=s.width,l.height=s.height;let c=l.getContext("2d",{willReadFrequently:!0});if(!c)return;c.drawImage(s,0,0);for(let[f,u]of Object.entries(a)){if(u.width<=0||u.height<=0)continue;let h=c.getImageData(u.x,u.y,u.width,u.height),d=t?`${t}:${f}`:f,m={width:u.width,height:u.height,data:h.data},p={pixelRatio:u.pixelRatio??r,sdf:u.sdf??!1};this.hasImage(d)?this.updateImage(d,m,p):this.addImage(d,m,p),this.spriteImages.set(d,t);}this.triggerRepaint();}catch(a){console.warn(`[osmgl] \u0441\u043F\u0440\u0430\u0439\u0442 \xAB${o}\xBB \u043D\u0435 \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u043B\u0441\u044F:`,a instanceof Error?a.message:a);}}addControl(t,o){return this.controls.add(t,this,o),this}removeControl(t){return this.controls.remove(t,this),this}hasControl(t){return this.controls.has(t)}get dragPan(){return this.handlers.dragPan}get dragRotate(){return this.handlers.dragRotate}get scrollZoom(){return this.handlers.scrollZoom}get doubleClickZoom(){return this.handlers.doubleClickZoom}get touchZoomRotate(){return this.handlers.touchZoomRotate}get touchPitch(){return this.handlers.touchPitch}get keyboard(){return this.handlers.keyboard}get boxZoom(){return this.handlers.boxZoom}get cooperativeGestures(){return this.handlers.cooperative}static addProtocol(t,o){Wi.set(t,o);}static removeProtocol(t){Wi.delete(t);}setTransformRequest(t){this.transformRequest=t;for(let o of this.sources.values())o.setTransformRequest(t);for(let o of this.rasterSources.values())o.setTransformRequest(t);return this}setTransformCameraUpdate(t){return this.cameraUpdate=t,this}setTransformConstrain(t){return this.transformConstrain=t,this}setSourceTileLodParams(t,o){let r=this.sources.get(t)??this.rasterSources.get(t);return r?(r.setLodParams(o),this.triggerRepaint(),this):this}setGlobalStateProperty(t,o){return o==null?delete xo[t]:xo[t]=o,this.triggerRepaint(),this}getGlobalState(){return {...xo}}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(t){return this.transform.renderWorldCopies=t,this.triggerRepaint(),this}setTheme(t){return this.setStyle(Nr(t,this.options.style))}setBaseStyle(t,o){this.options.style=t;for(let[r,i]of Object.entries(t.sources??{}))this.sources.has(r)||this.rasterSources.has(r)||this.demSources.has(r)||this.addSource(r,i);return this.setStyle(o===void 0?t:Nr(o,t)),this.syncTerrain(),this}static get themes(){return Object.keys(je)}static get themeList(){return Object.entries(je).map(([t,o])=>({id:t,name:o.name||t}))}setLayoutProperty(t,o,r){let i=this._style.layers.find(s=>s.id===t);if(!i)return console.warn(`[osmgl] \u0441\u043B\u043E\u0439 \u0441\u0442\u0438\u043B\u044F "${t}" \u043D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D`),this;let a=i.layout??(i.layout={});if(a[o]=r,this.rememberOverride(t,{layout:{[o]:r}}),o==="textField"||o==="iconImage"||o==="splitBy")for(let[s,l]of this.sources)l.setPlan(this.planFor(s));return this.triggerRepaint(),this}setPaintProperty(t,o,r){let i=this._style.layers.find(s=>s.id===t);if(!i)return console.warn(`[osmgl] \u0441\u043B\u043E\u0439 \u0441\u0442\u0438\u043B\u044F "${t}" \u043D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D`),this;let a=JSON.stringify(jt(i)??null);if(i.paint[o]=r,this.rememberOverride(t,{paint:{[o]:r}}),JSON.stringify(jt(i)??null)!==a)for(let[s,l]of this.sources)l.setPlan(this.planFor(s));return this.triggerRepaint(),this}setDebugTiles(t){return this.renderer.debugTiles=t,this.triggerRepaint(),this}setShadows(t){let o=typeof t=="boolean"?{enabled:t}:t;return Object.assign(this.renderer.shadows,o),this.triggerRepaint(),this}querySymbol(t,o=2){let r=this.renderer.symbols?.querySymbol(t,o);return r?{layerId:r.layerId,text:r.text,icon:r.icon,lngLat:{lng:ut(r.mercX),lat:ct(r.mercY)},key:nr.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??De);if(!i)continue;let a=Ss(this.transform,i,r.id,t,this.groundAt);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 fe,i;for(let s of this._style.layers){if(s.type!=="fill"||!s.id.startsWith("indoor-")||s.id==="indoor-shell"||!this._style.layerVisibleAt(s,this.transform.zoom))continue;let l=this._style.bucketKeyFor(s);l&&(o.push(l),r.set(l,s.id),i??(i=this.sources.get(s.source??De)));}if(!i||!o.length)return null;let a=Fs(this.transform,i,o,t,this.groundAt);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=il({center:t.center,zoom:t.zoom,bearing:t.bearing,pitch:t.pitch},this.hashName);this.writingHash=true,ad("#"+o),setTimeout(()=>this.writingHash=false,0);}applyHash(t){if(typeof window>"u")return;let o=al(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"?Un(Kn()):t;return this.governor.reset(o,o),this.applyQuality(po(o)),this}getQuality(){return {auto:this.qualityAuto,profile:{...this.quality},pixelRatio:this.transform.width>0?this.canvas.width/this.transform.width:1}}applyRendererQuality(t){this.renderer.detailScale=t.detail,this.renderer.uploadBudget=t.uploadBudget,this.renderer.seams.budget=t.seamBudget,this.renderer.allowShadows=t.allowShadows;}applyQuality(t,o=false){let r=this.quality.simpleGeometry,i=o?r:t.simpleGeometry;if(this.quality={...t,simpleGeometry:i},this.objects3d&&(this.objects3d.budgetScale=t.modelBudget),r!==i)for(let[a,s]of this.sources.entries())s.setPlan(this.planFor(a));o||(this.densityQuality=t,this.options.maxPixelRatio===void 0&&(this.maxPixelRatio=t.maxPixelRatio)),this.applyRendererQuality(t),this.renderer.shadows.resolution!==t.shadowMapSize&&this.setShadows({resolution:t.shadowMapSize});for(let a of this.sources.values())a.setCoverOptions({detailBias:t.detailBias,maxTiles:t.maxTiles});this.resize();}checkFrameBudget(t){if(!this.qualityAuto)return;let o=this.governor.frame(t,this.sum(i=>i.pendingCount)>0);if(!o)return;let r=`${(o.share*100).toFixed(0)}%`;console.info(o.direction==="down"?`[osmgl] \u0442\u044F\u0436\u0451\u043B\u044B\u0445 \u043A\u0430\u0434\u0440\u043E\u0432 ${r} \u2014 \u043A\u0430\u0447\u0435\u0441\u0442\u0432\u043E \u043F\u043E\u043D\u0438\u0436\u0435\u043D\u043E \u0434\u043E \xAB${o.to}\xBB (\u043F\u043B\u043E\u0442\u043D\u043E\u0441\u0442\u044C \u0431\u0443\u0444\u0435\u0440\u0430 \u043F\u0440\u0435\u0436\u043D\u044F\u044F, \u043F\u043E\u0442\u043E\u043B\u043E\u043A \xAB${this.governor.limit}\xBB)`:`[osmgl] \u043A\u0430\u0434\u0440\u044B \u0443\u043A\u043B\u0430\u0434\u044B\u0432\u0430\u044E\u0442\u0441\u044F \u0432 \u0431\u044E\u0434\u0436\u0435\u0442 \u2014 \u043A\u0430\u0447\u0435\u0441\u0442\u0432\u043E \u043F\u043E\u0434\u043D\u044F\u0442\u043E \u0434\u043E \xAB${o.to}\xBB`),this.applyQuality(po(o.to),true);}getShadows(){return {...this.renderer.shadows}}setSky(t){let o=typeof t=="boolean"?{enabled:t}:t;return Object.assign(this._style.sky,o),this.triggerRepaint(),this}getSky(){return {...this._style.sky}}setLight(t){return Object.assign(this._style.light,t),this.triggerRepaint(),this}setLayerVisible(t,o){let r=this._style.layers.find(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=Ve(t),this.triggerRepaint(),this}getIndoorLevels(){let t=[];for(let[o,r]of this.sources.entries())if(this._style.layers.some(i=>(i.source??De)===o&&"splitBy"in i&&i.splitBy===cr))for(let i of r.splitValues(cr)){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[cr];return typeof t=="number"?t:null}setIndoorLevel(t){return t===null?delete this._style.splitValues[cr]:this._style.splitValues[cr]=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 xn)}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,hr):o.maxPitch,a=o.zoom<r,s=o.pitch>i;return a||s?this.easeTo({zoom:a?r:o.zoom,pitch:s?i:o.pitch,duration:600}):(this.emit("move",void 0),this.triggerRepaint()),this}getProjection(){return this.transform.projection}refreshSource(t){return this.sources.get(t)?.reload(),this.rasterSources.get(t)?.reload(),this.triggerRepaint(),this}refresh(){for(let t of this.sources.values())t.reload();for(let t of this.rasterSources.values())t.reload();return this.renderer.refreshHighlight(),this.triggerRepaint(),this}sum(t){let o=0;for(let r of this.sources.values())o+=t(r);return o}getStats(){return {pendingTiles:this.sum(t=>t.pendingCount),visibleTiles:this.sum(t=>t.visibleTiles.length),labels:this.renderer.symbols?.placedCount??0,models:this.renderer.models.readyCount,workers:this.pool.usingWorkers?this.pool.size:0,renderer:this.ctx?.caps.rendererName??"\u043D\u0435\u0442 \u043A\u043E\u043D\u0442\u0435\u043A\u0441\u0442\u0430"}}triggerRepaint(){this.destroyed||(this.needsRepaint=true,!this.frameHandle&&(this.frameHandle=requestAnimationFrame(t=>{this.frameHandle=0,this.renderFrame(t);})));}debugFloatPixels(t,o,r,i){let a=this.ctx;if(!a||!a.caps.colorBufferFloat)return null;let s=a.gl,l=this.canvas.width,c=this.canvas.height,f=!!s.getExtension("EXT_float_blend"),u=f?s.RGBA32F:s.RGBA16F,h=f?s.FLOAT:s.HALF_FLOAT;if(this.debugFB&&(this.debugFB.w!==l||this.debugFB.h!==c)&&(s.deleteFramebuffer(this.debugFB.fb),s.deleteTexture(this.debugFB.tex),s.deleteRenderbuffer(this.debugFB.rb),this.debugFB=null),!this.debugFB){let d=s.createTexture(),m=s.createFramebuffer(),p=s.createRenderbuffer();if(!d||!m||!p)return null;s.bindTexture(s.TEXTURE_2D,d),s.texImage2D(s.TEXTURE_2D,0,u,l,c,0,s.RGBA,h,null),s.texParameteri(s.TEXTURE_2D,s.TEXTURE_MIN_FILTER,s.NEAREST),s.texParameteri(s.TEXTURE_2D,s.TEXTURE_MAG_FILTER,s.NEAREST),s.bindTexture(s.TEXTURE_2D,null),s.bindRenderbuffer(s.RENDERBUFFER,p),s.renderbufferStorage(s.RENDERBUFFER,s.DEPTH24_STENCIL8,l,c),s.bindRenderbuffer(s.RENDERBUFFER,null),s.bindFramebuffer(s.FRAMEBUFFER,m),s.framebufferTexture2D(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0,s.TEXTURE_2D,d,0),s.framebufferRenderbuffer(s.FRAMEBUFFER,s.DEPTH_STENCIL_ATTACHMENT,s.RENDERBUFFER,p);let b=s.checkFramebufferStatus(s.FRAMEBUFFER);if(s.bindFramebuffer(s.FRAMEBUFFER,null),a.invalidateState(),b!==s.FRAMEBUFFER_COMPLETE)return null;this.debugFB={fb:m,tex:d,rb:p,w:l,h:c};}a.screen=this.debugFB.fb;try{this.renderFrame(performance.now()),a.bindFramebuffer(this.debugFB.fb);let d=new Float32Array(r*i*4);return s.readPixels(t,o,r,i,s.RGBA,s.FLOAT,d),{data:d,format:f?"rgba32f":"rgba16f"}}finally{a.screen=null,this.triggerRepaint();}}renderFrame(t){if(this.destroyed||!this.ctx)return;let o=performance.now();this.needsRepaint=false;let r=this.stepAnimation(t),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,m]of this.sources)this.sourceDrawn(d,this.transform.zoom)?m.update(this.transform):m.deactivate();this.trimTileMemory(),this.updateObjects3D();for(let[d,m]of this.rasterSources)this.rasterLayerVisible(d)&&m.update(this.transform);if(this.renderer.terrain.enabled){for(let b of this.demSources.values())b.update(this.transform);let d=this.transform.center,m=this.centerClamped?this.renderer.terrain.heightAt(d.lng,d.lat):this.transform.centerElevation,p=this.transform.centerElevation;this.transform.centerElevation=Math.abs(m-p)<.5?m:p+(m-p)*.25;}else this.transform.centerElevation!==0&&(this.transform.centerElevation=0);this.syncIndoor(),this.objects.updateMarkers(this.transform);let a=(this.sources.size>0||this.rasterSources.size>0)&&this.renderer.render(i,this.transform,this.sources,this._style,t,this.rasterSources),s=performance.now()-o,l=r||a||this.needsRepaint,c=this.lastFrameAt>0?t-this.lastFrameAt:0,f=c>0&&c<pA,u=f?c:0;this.continuousFrames=f?this.continuousFrames+1:0;let h=this.continuousFrames>1?c:s;this.lastFrameAt=t,this.checkFrameBudget(h),this.emit("render",{frameMs:s,intervalMs:u}),l&&this.triggerRepaint(),this.scheduleRetryWake(t);}scheduleRetryWake(t){let o=1/0;for(let i of this.sources.values())o=Math.min(o,i.nextRetryIn);if(!Number.isFinite(o))return;let r=t+o;r>=this.retryTimerAt||(this.retryTimer&&clearTimeout(this.retryTimer),this.retryTimerAt=r,this.retryTimer=setTimeout(()=>{this.retryTimer=0,this.retryTimerAt=1/0,this.triggerRepaint();},o));}stopFrameLoop(){this.frameHandle&&cancelAnimationFrame(this.frameHandle),this.frameHandle=0,this.retryTimer&&clearTimeout(this.retryTimer),this.retryTimer=0,this.retryTimerAt=1/0;}get isLoaded(){return this.ready}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();for(let t of this.demSources.values())t.destroy();this.demSources.clear(),this.objects.destroy(),this.controls.destroy(this),this.handlers.boxZoom.destroy(),this.handlers.cooperative.destroy(),this.markerHost?.remove(),this.pool.destroy(),this.ctx&&this.renderer.destroy(this.ctx),this.removeAllListeners(),this.canvas.remove();}}},WE=Rl;
2847
+ `;var Mi=n=>n.kind==="symbol",Zu=n=>n.kind==="placement";function Zt(n,e,t,o){for(let r of n)for(let i=0;i+5<r.length;i+=6){let a=r[i],s=r[i+1],l=r[i+2],c=r[i+3],f=r[i+4],u=r[i+5];if(U1(e,t,a,s,l,c,f,u)||o>0&&(ws(e,t,a,s,l,c)<=o||ws(e,t,l,c,f,u)<=o||ws(e,t,f,u,a,s)<=o))return true}return false}function U1(n,e,t,o,r,i,a,s){let l=(n-r)*(o-i)-(t-r)*(e-i),c=(n-a)*(i-s)-(r-a)*(e-s),f=(n-t)*(s-o)-(a-t)*(e-o),u=l<0||c<0||f<0,h=l>0||c>0||f>0;return !(u&&h)}function ws(n,e,t,o,r,i){let a=r-t,s=i-o,l=a*a+s*s,c=l>0?Math.max(0,Math.min(1,((n-t)*a+(e-o)*s)/l)):0;return Math.hypot(n-(t+a*c),e-(o+s*c))}function vs(n,e){let t=new DataView(n.vertices),o=new Uint32Array(n.indices),r=e.bounds(),i=(r.maxX-r.minX)/n.extent,a=new Float64Array(o.length*2);for(let s=0;s<o.length;s++){let l=o[s]*Ft;a[s*2]=r.minX+t.getInt16(l,true)*i,a[s*2+1]=r.minY+t.getInt16(l+2,true)*i;}return a}function Cs(n,e,t){let o=new DataView(n.vertices),r=t.bounds(),i=(r.maxX-r.minX)/e,a=r.minX,s=r.minY,l=new Float64Array(n.indices.length*2);for(let c=0;c<n.indices.length;c++){let f=n.indices[c]*rt;l[c*2]=a+o.getInt16(f,true)*i,l[c*2+1]=s+o.getInt16(f+2,true)*i;}return l}var K1={stride:8,attribs:[{name:"a_pos",size:2,type:5126,offset:0}]},X1=40,J1=10.5,qu=2.5,j1=16,Y1=4,Z1=7,Xr=class{constructor(){this.vbo=null;this.ibo=null;this.vao=null;this.capacity=0;this.perArrow=0;this.indicesPerArrow=0;this.highlightFootprint=null;this.count=0;}render(e,t,o,r,i,a,s,l=false){this.count=0;let c=t.zoom,f=r.layers.filter(x=>x.type==="symbol"&&x.layout?.placement==="map"&&r.layerVisibleAt(x,c));if(!f.length)return;let u=t.center,h=Oe(u.lng),d=Ge(u.lat),m=t.worldSize>0?t.pixelsPerMeter/t.worldSize:0;if(!(m>0))return;let p=[];for(let x of f){let v=o.get(x.source??De);if(!v)continue;let w=r.bucketKeyFor(x);if(w===null)continue;let C=x.layout?.showFor==="highlight";if(C&&!this.highlightFootprint)continue;let B=m*1.5,T=x.layout?.arrowUnits==="meters"?m:1/t.worldSize,k=pe(x.layout?.arrowLength,c,X1)*T,K=pe(x.layout?.arrowWidth,c,J1)*T,P=pe(x.layout?.arrowOutline,c,qu)*T,W=pe(x.layout?.arrowGap,c,j1)*T,z=pe(x.layout?.arrowDotRadius,c,Y1)*T,L=pe(x.layout?.arrowDotGap,c,Z1)*T,X=Ms(k,K,z,W-L),Q=P>0?Ms(k,K,z,W-L,P).outline:null,G={layer:x,verts:[],shape:X};for(let Y of v.visibleTiles){let ee=v.getTile(Y)?.data?.buckets?.[w];if(!ee||!Mi(ee))continue;let ue=new Int16Array(ee.anchors),$=ee.rotations?new Int16Array(ee.rotations):null,Ae=Y.bounds(),ve=(Ae.maxX-Ae.minX)/ee.extent,he=Ae.minX,xe=Ae.minY;for(let de=0;de<ue.length/2;de++){let we=he+ue[de*2]*ve,I=xe+ue[de*2+1]*ve;if(C&&!Zt(this.highlightFootprint,we,I,B))continue;let J=($?$[de]:0)*Math.PI/180,Z=Math.sin(J),ce=-Math.cos(J),ae=we-h-Z*W,be=I-d-ce*W;Q&&_s(G,Q,ae,be,Z,ce),_s(G,X.outline,ae,be,Z,ce),this.count++;}}G.verts.length&&p.push(G);}if(!p.length)return;let b=p[0].shape,g=b.outline.length/2,y=[],A=[];for(let x of p){let v=y.length/2/g;for(let w of x.verts)y.push(w);A.push({layer:x.layer,first:v,count:x.verts.length/2/g});}if(this.ensureBuffers(e,y.length/2/g,b,a),!(!this.vao||!this.vbo)){this.vbo.update(new Uint8Array(new Float32Array(y).buffer)),i.use(),s?.(i),l&&i.setMat4("u_shadow_matrix",t.shadowObjectMatrix(h,d,0)),i.setMat4("u_matrix",t.objectMatrix(h,d,0)),e.setDepthTest(false),e.setDepthMask(false),e.setBlend("premultiplied"),e.setCull("none"),this.vao.bind();for(let x of A){let v=x.layer.paint,w=pe(v.opacity,c,1),C=k=>k&&typeof k=="object"&&"from"in k?void 0:k,B=ht(C(v.color),c,[.18,.45,.76,1]),_=ht(C(v.haloColor),c,[1,1,1,1]),T=pe(x.layer.layout?.arrowOutline,c,qu)>0;q1(e,i,x,_,B,w,T,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 Je(e,new Uint8Array(this.capacity*i*8),K1,true);let a=new Uint32Array(this.capacity*o.indices.length);for(let s=0;s<this.capacity;s++){let l=s*i;for(let c=0;c<o.indices.length;c++)a[s*o.indices.length+c]=l+o.indices[c];}this.ibo=new Ue(e,a),this.vao=new Ne(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 q1(n,e,t,o,r,i,a,s){let l=a?2:1;if(a){e.setVec4v("u_color",it([o[0],o[1],o[2],o[3]*i]));for(let c=0;c<t.count;c+=l)Qu(n,t.first+c,s);}e.setVec4v("u_color",it([r[0],r[1],r[2],r[3]*i]));for(let c=a?1:0;c<t.count;c+=l)Qu(n,t.first+c,s);}function Qu(n,e,t){n.gl.drawElements(n.gl.TRIANGLES,t,n.gl.UNSIGNED_INT,e*t*4);}var $u=4,Bs=12;function Ms(n,e,t,o,r=0){let i=n*.38,a=e*1.35,s=i*.3,l=e*.32,c=e/2,f=-n+l,u=[],h=(g,y)=>u.push(g,y);h(0,0),h(-i,a),h(-i+s,c),h(f,l);for(let g=1;g<$u;g++){let y=g/$u*Math.PI;h(f-Math.sin(y)*l,Math.cos(y)*l);}h(f,-l),h(-i+s,-c),h(-i,-a);let d=r>0?Q1(u,r):u,m=ot(u,void 0,2);if(t<=0)return {outline:d,indices:m};let p=d.length/2,b=t+r;for(let g=0;g<Bs;g++){let y=g/Bs*Math.PI*2;d.push(o+Math.cos(y)*b,Math.sin(y)*b);}for(let g=1;g<Bs-1;g++)m.push(p,p+g,p+g+1);return {outline:d,indices:m}}function Q1(n,e){let t=n.length/2,o=0;for(let a=0;a<t;a++){let s=(a+1)%t;o+=n[a*2]*n[s*2+1]-n[s*2]*n[a*2+1];}let r=o<0?-1:1,i=[];for(let a=0;a<t;a++){let s=n[(a+t-1)%t*2],l=n[(a+t-1)%t*2+1],c=n[a*2],f=n[a*2+1],u=n[(a+1)%t*2],h=n[(a+1)%t*2+1],d=Math.hypot(c-s,f-l)||1,m=Math.hypot(u-c,h-f)||1,p=r*(f-l)/d,b=-r*(c-s)/d,g=r*(h-f)/m,y=-r*(u-c)/m,A=p+g,x=b+y,v=Math.hypot(A,x);if(v<1e-9){i.push(c,f);continue}A/=v,x/=v;let w=Math.min(1/Math.max(A*p+x*b,.35),3);i.push(c+A*e*w,f+x*e*w);}return i}function _s(n,e,t,o,r,i){let a=-i,s=r;for(let l=0;l<e.length;l+=2){let c=e[l],f=e[l+1];n.verts.push(t+r*c+a*f,o+i*c+s*f);}}function $1(n,e,t,o,r,i=0,a=0){let s=t*Math.PI/180,l={verts:[]};return _s(l,Ms(o,r,i,a).outline,n,e,Math.sin(s),-Math.cos(s)),l.verts}var eb=5;function eh(n,e){let t=1/(1<<e),o=(1<<e)-1;return [(n.x&o)*t,(n.y&o)*t,t]}var _i=class{constructor(){this.anisotropy=0;this.anisotropyPname=0;this.anisotropyChecked=false;}render(e,t,o,r,i,a,s,l=false){if(!a.size)return;let c=i.layers.filter(f=>f.type==="raster"&&!!f.overlay===l&&i.layerVisibleAt(f,s));if(c.length){r.use(),e.setDepthTest(false),e.setDepthMask(false),e.setBlend("premultiplied"),e.setCull("none"),r.setInt("u_image",0);for(let f of c){let u=a.get(f.source);if(!u)continue;let h=pe(f.paint?.opacity,s,1);if(!(h<=.001)){r.setFloat("u_opacity",h),o.bind();for(let d of u.visibleTiles){let m=this.patchFor(e,u,d);m&&(e.bindTexture(0,m.texture),r.setVec3("u_uv_transform",m.uv[0],m.uv[1],m.uv[2]),r.setMat4("u_matrix",t.tileMatrix(d,1)),e.gl.drawElements(e.gl.TRIANGLES,6,e.gl.UNSIGNED_SHORT,0));}}}e.bindVAO(null);}}patchFor(e,t,o){let r=t.getTile(o),i=r&&r.state==="loaded"?this.textureFor(e,r):null;if(i)return {texture:i,uv:[0,0,1]};for(let a=1;a<=eb&&a<=o.z;a++){let s=o.scaledTo(o.z-a),l=t.getTile(s);if(!l||l.state!=="loaded")continue;let c=this.textureFor(e,l);if(c)return {texture:c,uv:eh(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 Ei=class{constructor(){this.shader=null;this.vao=null;this.vbo=null;this.textures=new Map;}render(e,t,o,r,i,a){if(!r.size)return;let s=o.layers.filter(u=>u.type==="raster"&&!!u.overlay===a&&r.has(u.source)&&o.layerVisibleAt(u,i));if(!s.length)return;let l=e.gl,c=this.ensureShader(e),f=this.ensureBuffers(e);c.use(),c.setInt("u_image",0),e.setDepthTest(false),e.setDepthMask(false),e.setBlend("premultiplied"),e.setCull("none"),f.bind();for(let u of s){let h=r.get(u.source);if(!h?.content)continue;let d=pe(u.paint?.opacity,i,1);if(d<=.001)continue;let m=this.textureFor(e,h);if(!m)continue;let[p,b]=h.corners[0],g=new Float32Array(16),y=[[0,0],[1,0],[1,1],[0,1]];for(let A=0;A<4;A++)g[A*4]=h.corners[A][0]-p,g[A*4+1]=h.corners[A][1]-b,g[A*4+2]=y[A][0],g[A*4+3]=y[A][1];this.vbo?.update(new Uint8Array(g.buffer)),e.bindTexture(0,m),c.setFloat("u_opacity",d),c.setMat4("u_matrix",t.objectMatrix(p,b,0)),l.drawElements(l.TRIANGLES,6,l.UNSIGNED_SHORT,0);}e.bindVAO(null);}destroy(e){for(let t of this.textures.values())e.gl.deleteTexture(t.texture);this.textures.clear(),this.vao?.destroy(),this.vbo?.destroy(),this.vao=null,this.vbo=null;}textureFor(e,t){let o=e.gl,r=t.content;if(!r)return null;let i=this.textures.get(t);if(!i){let a=o.createTexture();if(!a)return null;i={texture:a,version:-1},this.textures.set(t,i),e.bindTexture(0,a),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);}return (i.version!==t.version||t.live)&&(e.bindTexture(0,i.texture),o.pixelStorei(o.UNPACK_PREMULTIPLY_ALPHA_WEBGL,1),o.texImage2D(o.TEXTURE_2D,0,o.RGBA,o.RGBA,o.UNSIGNED_BYTE,r),o.pixelStorei(o.UNPACK_PREMULTIPLY_ALPHA_WEBGL,0),i.version=t.version),i.texture}ensureShader(e){return this.shader||(this.shader=new Ye(e,"media",Iu,Du)),this.shader}ensureBuffers(e){if(this.vao)return this.vao;let t={stride:16,attribs:[{name:"a_pos",size:2,type:5126,offset:0},{name:"a_uv",size:2,type:5126,offset:8}]};this.vbo=new Je(e,new Float32Array(16),t);let o=new Ue(e,new Uint16Array([0,1,2,0,2,3])),r=this.ensureShader(e),i=new Map;for(let a of t.attribs)i.set(a.name,r.attribLocation(a.name));return this.vao=new Ne(e,[{buffer:this.vbo,locations:i}],o),this.vao}};var tb="indoor-",Jr=class{constructor(){this.parts=null;this.stamp="";this.cache=new fe;this.box=null;this.hidden=new Le;this.collected=new Le;}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 h of t.layers){if(!h.id.startsWith(tb)||h.type!=="fill"||!t.layerVisibleAt(h,o))continue;let d=t.bucketKeyFor(h);d&&(r.push(d),i??(i=e.get(h.source??De)));}if(!r.length||!i){this.parts&&this.destroy();return}let a=r.join(",")+"|"+i.visibleTiles.map(h=>h.dataKey+(i.getTile(h)?.data?"+":"-")).join(",");if(a===this.stamp)return;this.stamp=a,this.free();let s=[],l=1/0,c=1/0,f=-1/0,u=-1/0;for(let h of i.visibleTiles){let d=i.getTile(h)?.data?.buckets;if(d)for(let m of r){let p=d[m];if(!p||p.kind!=="fill")continue;let b=vs(p,h);s.push(b);for(let g=0;g<b.length;g+=2)b[g]<l&&(l=b[g]),b[g]>f&&(f=b[g]),b[g+1]<c&&(c=b[g+1]),b[g+1]>u&&(u=b[g+1]);}}this.parts=s.length?s:null,this.box=s.length?[l,c,f,u]:null,this.hidden.clear(),this.collected.clear();}collectHidden(e,t){let o=this.parts;if(!o||!e.featureIds)return;let r=new Uint32Array(e.indices),i=new Float64Array(e.featureIds),a=new DataView(e.vertices),s=t.bounds(),l=(s.maxX-s.minX)/e.extent,c=this.box,f=new fe;for(let u=0;u*3<r.length;u++){let h=i[u];if(this.hidden.has(h))continue;let d=f.get(h);d||f.set(h,d=[1/0,1/0,-1/0,-1/0]);for(let m=0;m<3;m++){let p=r[u*3+m]*rt,b=a.getInt16(p,true),g=a.getInt16(p+2,true);b<d[0]&&(d[0]=b),g<d[1]&&(d[1]=g),b>d[2]&&(d[2]=b),g>d[3]&&(d[3]=g);}}for(let[u,h]of f){let d=s.minX+(h[0]+h[2])/2*l,m=s.minY+(h[1]+h[3])/2*l;c&&(d<c[0]||d>c[2]||m<c[1]||m>c[3])||Zt(o,d,m,0)&&this.hidden.add(u);}}destroy(){this.parts=null,this.hidden.clear(),this.collected.clear(),this.box=null,this.stamp="",this.free();}free(){this.cache.forEach(e=>{e?.vao.destroy(),e?.ibo.destroy();}),this.cache.clear();}prepare(e,t){if(!this.parts)return;let o=this.hidden.size;for(let r of e.visibleTiles){if(this.collected.has(r.dataKey))continue;let i=e.getTile(r)?.data?.buckets?.[t];!i||i.kind!=="fill-extrusion"||(this.collected.add(r.dataKey),this.collectHidden(i,r));}this.hidden.size!==o&&this.free();}indicesFor(e,t,o,r,i,a){if(!this.parts)return null;let s=this.cache.get(r.dataKey);if(s!==void 0)return s;let l=t.data?.buckets?.[o];if(!l)return null;let c=null;if(l.kind==="fill-extrusion"&&l.featureIds&&this.hidden.size){let f=new Uint32Array(l.indices),u=new Float64Array(l.featureIds),h=[];for(let d=0;d*3<f.length;d++)this.hidden.has(u[d])||h.push(f[d*3],f[d*3+1],f[d*3+2]);if(h.length<f.length){let d=new Ue(e,new Uint32Array(h));c={vao:new Ne(e,[{buffer:i,locations:a}],d),ibo:d,count:h.length};}}return this.cache.set(r.dataKey,c),c}};function Si(n){return n==="terrarium"?[256,1,1/256,32768]:[6553.6,25.6,.1,1e4]}var jr=class{constructor(e,t,o="mapbox"){if(e.length<t*t*4)throw new RangeError(`\u0442\u0430\u0439\u043B \u0440\u0435\u043B\u044C\u0435\u0444\u0430 ${t}\xD7${t} \u0442\u0440\u0435\u0431\u0443\u0435\u0442 ${t*t*4} \u0431\u0430\u0439\u0442, \u043F\u0440\u0438\u0448\u043B\u043E ${e.length}`);let[r,i,a,s]=Si(o),l=new Float32Array(t*t),c=1/0,f=-1/0;for(let u=0;u<l.length;u++){let h=u*4,d=e[h]*r+e[h+1]*i+e[h+2]*a-s;l[u]=d,d<c&&(c=d),d>f&&(f=d);}this.heights=l,this.size=t,this.min=c,this.max=f;}heightAt(e,t){let o=this.size,r=th(e*o-.5,0,o-1),i=th(t*o-.5,0,o-1),a=Math.floor(r),s=Math.floor(i),l=Math.min(a+1,o-1),c=Math.min(s+1,o-1),f=r-a,u=i-s,h=this.heights,d=h[s*o+a]*(1-f)+h[s*o+l]*f,m=h[c*o+a]*(1-f)+h[c*o+l]*f;return d*(1-u)+m*u}};function th(n,e,t){return n<e?e:n>t?t:n}function ob(n,e,t){let o=Math.pow(2,t),r=e.maxTiles??512,i=[],a=128;for(let s=0;s<o;s++)for(let l=0;l<o;l++){let c=new so(t,l,s),f=c.bounds(),u=(f.minX+f.maxX)/2,h=(f.minY+f.maxY)/2,d=[[u,h],[f.minX,f.minY],[f.maxX,f.minY],[f.minX,f.maxY],[f.maxX,f.maxY]],m=false;for(let[b,g]of d)if(n.isOnGlobeFront(ut(b),ct(g))){m=true;break}if(!m)continue;let p=false;for(let[b,g]of d){let y=n.localToPoint(n.globeLocal(b,g));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 qt(n,e){let t=Math.min(e.maxzoom,24),o=Math.max(0,Math.min(e.minzoom,t)),r=e.detailBias??1,i=e.maxTiles??512,a=512*r,s=Math.min(Math.round(n.zoom),t);if(s<o)return [];if(n.globeActive)return ob(n,e,s);let{min:l,max:c}=n.visibleWrapRange(),f=[],u=[];for(let d=l;d<=c;d++)u.push(new so(0,0,0,d));let h=0;for(;u.length&&!(++h>2e4||f.length>=i);){let d=u.pop();if(!n.isTileVisible(d))continue;if(d.z>=s){d.z>=o&&f.push(d);continue}if(n.tileScreenSize(d.z,n.distanceToTile(d))<=a&&d.z>=o){f.push(d);continue}for(let p of d.children())u.push(p);}return f.sort((d,m)=>n.distanceToTile(d)-n.distanceToTile(m)),f}var rb=64,oh=1024,rh=256,nb=2048,ib=192*1024*1024,ab=2,nh=5126,sb={stride:12,attribs:[{name:"a_pos",size:2,type:nh,offset:0},{name:"a_skirt",size:1,type:nh,offset:8}]},Es=class{constructor(e,t){this.ctx=e;this.size=t;this.key="";let o=e.gl,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 \u0440\u0435\u043B\u044C\u0435\u0444\u0430");this.texture=r,this.framebuffer=i,e.bindTexture(Yr,r),o.texImage2D(o.TEXTURE_2D,0,o.RGBA,t,t,0,o.RGBA,o.UNSIGNED_BYTE,null),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.bindFramebuffer(o.FRAMEBUFFER,i),o.framebufferTexture2D(o.FRAMEBUFFER,o.COLOR_ATTACHMENT0,o.TEXTURE_2D,r,0),o.bindFramebuffer(o.FRAMEBUFFER,null);}clear(e){let t=this.ctx.gl;this.ctx.bindFramebuffer(this.framebuffer),this.ctx.viewport(0,0,this.size,this.size),t.clearColor(e[0],e[1],e[2],1),t.clear(t.COLOR_BUFFER_BIT);}destroy(){this.ctx.gl.deleteTexture(this.texture),this.ctx.gl.deleteFramebuffer(this.framebuffer);}},Yr=5,Fi=class{constructor(){this.exaggeration=1;this.revision=0;this.source=null;this.empty=null;this.unsubscribe=null;this.current=[];this.lastCover=null;this.mesh=null;this.targets=new Map;}setSource(e){if(this.unsubscribe?.(),this.unsubscribe=null,this.source=e,this.revision++,!e)return;let t=()=>{this.revision++;};e.on("data",t),this.unsubscribe=()=>e.off("data",t);}get enabled(){return this.source!==null&&this.exaggeration!==0}apply(e,t,o){let r=this.enabled?this.demFor(o):null,i=r?this.textureFor(e,r.dem):null;if(e.bindTexture(Yr,i??this.emptyTexture(e)),t.setInt("u_terrain",Yr),!r||!i){t.setFloat("u_terrain_exaggeration",0),t.setVec4("u_terrain_uv",0,0,0,0),t.setVec4("u_terrain_unpack",0,0,0,0),t.setFloat("u_terrain_dim",1);return}let[a,s,l,c]=Si(this.source.encoding);t.setVec4("u_terrain_uv",r.uv[0],r.uv[1],r.uv[2],r.uv[3]),t.setVec4("u_terrain_unpack",a,s,l,c),t.setFloat("u_terrain_dim",r.dem.image?.width??1),t.setFloat("u_terrain_exaggeration",this.exaggeration);}demFor(e){let t=this.coverFor(e),o=t?this.tileFor(t):null;if(!t||!o||e.z<t.z)return this.tileFor(e);let r=e.z-t.z,i=1/(1<<r),a=(e.x-(t.x<<r))*i,s=(e.y-(t.y<<r))*i,[l,c,f,u]=o.uv;return {dem:o.dem,uv:[l*i,c*i,f+l*a,u+c*s]}}groundRange(){let e=1/0,t=-1/0;for(let o of this.current){let r=1<<o.z,i=this.heightAtMerc((o.x+.5)/r,(o.y+.5)/r);i<e&&(e=i),i>t&&(t=i);}return e<=t?[e,t]:[0,0]}covers(e){return this.coverFor(e)!==null}coverFor(e){for(let t of this.current)if(t.z<=e.z){let o=e.z-t.z;if(e.x>>o===t.x&&e.y>>o===t.y)return t}else {let o=t.z-e.z;if(t.x>>o===e.x&&t.y>>o===e.y)return t}return null}tileFor(e){let t=this.source;if(!t)return null;for(let o=e.z;o>=0;o--){let r=e.z-o,i=e.x>>r,a=e.y>>r,s=t.getTile({z:o,x:i,y:a,dataKey:`${o}/${i}/${a}`});if(!s||s.state!=="loaded"||!s.image)continue;let l=1/(1<<r),c=(e.x-(i<<r))*l,f=(e.y-(a<<r))*l;return {dem:s,uv:[l,l,c,f]}}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(Yr,i),r.texImage2D(r.TEXTURE_2D,0,r.RGBA,r.RGBA,r.UNSIGNED_BYTE,t.image),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.NEAREST),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,r.NEAREST),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);let a={handle:i,destroy:()=>r.deleteTexture(i)};return t.texture=a,i}emptyTexture(e){if(this.empty)return this.empty;let t=e.gl,o=t.createTexture();return e.bindTexture(Yr,o),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,1,1,0,t.RGBA,t.UNSIGNED_BYTE,new Uint8Array([0,0,0,255])),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.NEAREST),this.empty=o,o}heightAt(e,t){return this.heightAtMerc(Oe(e),Ge(t))}heightAtMerc(e,t){let o=this.source;if(!o||this.exaggeration===0)return 0;let r=this.coverForPoint(e,t);if(r){let s=this.tileFor(r),l=s?o.heights(s.dem):null;if(s&&l){let c=1<<r.z,[f,u,h,d]=s.uv,m=h+f*(e*c-r.x),p=d+u*(t*c-r.y);return l.heightAt(m,p)*this.exaggeration}}let i=null;for(let s of o.visibleTiles){let l=1<<s.z,c=e*l-s.x,f=t*l-s.y;if(c<0||c>=1||f<0||f>=1||i&&s.z<=i.z)continue;let u=o.getTile(s);!u||u.state!=="loaded"||(i={dem:u,z:s.z,tx:c,ty:f});}if(!i)return 0;let a=o.heights(i.dem);return a?a.heightAt(i.tx,i.ty)*this.exaggeration:0}coverForPoint(e,t){let o=this.lastCover;if(o&&this.inside(o,e,t))return o;for(let r of this.current)if(this.inside(r,e,t))return this.lastCover=r,r;return null}inside(e,t,o){let r=1<<e.z,i=t*r-e.x,a=o*r-e.y;return i>=0&&i<1&&a>=0&&a<1}tilesFor(e){return this.current=qt(e,{minzoom:0,maxzoom:22,detailBias:ab,maxTiles:48}),this.lastCover=null,this.current}sizesFor(e,t,o){let r=0;return t.map(i=>{let a=e.tileScreenSize(i.z,e.distanceToTile(i))*Math.min(Math.max(o,1),2),s=Math.min(nb,Math.max(rh,1<<Math.ceil(Math.log2(Math.max(a,1))))),l=this.targets.get(i.dataKey)?.size;for(l!==void 0&&a<=l*1.3&&a>=l*.3&&(s=l);s>rh&&r+s*s*4>ib;)s/=2;return r+=s*s*4,s})}meshOf(e,t){if(this.mesh)return this.mesh;let o=rb,r=[],i=[],a=(u,h)=>h*(o+1)+u;for(let u=0;u<=o;u++)for(let h=0;h<=o;h++)r.push(h/o,u/o,0);for(let u=0;u<o;u++)for(let h=0;h<o;h++)i.push(a(h,u),a(h,u+1),a(h+1,u+1)),i.push(a(h,u),a(h+1,u+1),a(h+1,u));let s=r.length/3;for(let u=0;u<=o;u++)r.push(u/o,0,1),r.push(u/o,1,1),r.push(0,u/o,1),r.push(1,u/o,1);let l=(u,h)=>s+u*4+h;for(let u=0;u<o;u++){let h=[[a(u,0),a(u+1,0),l(u,0),l(u+1,0)],[a(u+1,o),a(u,o),l(u+1,1),l(u,1)],[a(0,u+1),a(0,u),l(u+1,2),l(u,2)],[a(o,u),a(o,u+1),l(u,3),l(u+1,3)]];for(let[d,m,p,b]of h)i.push(d,m,b),i.push(d,b,p);}let c=new Je(e,new Float32Array(r),sb),f=new Ue(e,new Uint32Array(i));return this.mesh={vao:new Ne(e,[{buffer:c,locations:t}],f),count:i.length},this.mesh}targetOf(e){return this.targets.get(e)}targetFor(e,t,o=oh){let r=this.targets.get(t);return r&&r.size!==o&&(r.destroy(),this.targets.delete(t),r=void 0),r?{target:r,fresh:false}:(r=new Es(e,o),this.targets.set(t,r),{target:r,fresh:true})}keepOnly(e){for(let[t,o]of this.targets)e.has(t)||(o.destroy(),this.targets.delete(t));}get drapeSize(){return oh}skirtMeters(e){return Math.max(ho(Math.max(e,0))/32,4)}destroy(e){this.empty&&e.gl.deleteTexture(this.empty),this.empty=null;for(let t of this.targets.values())t.destroy();this.targets.clear(),this.mesh=null;}};var ih=35,lb=70,cb=.35,fb=.5,ub=1.1;function Jo(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=nt((n.pitch-ih)/(lb-ih),0,1),i=t.fogRange[0]*(1-cb*r)*o,a=t.fogRange[1]*(1-fb*r)*o,s=Math.min(1,t.fogIntensity+(1-t.fogIntensity)*Math.min(1,r*2)),l=s>=.995?a*ub:1/0;return {near:i,far:a,intensity:s,cutoff:l}}function Ss(n,e,t,o,r){let i=o.x/Math.max(n.width,1)*2-1,a=1-o.y/Math.max(n.height,1)*2,s=null,l=new Float64Array(16),c=[0,0,0,0],f=[0,0,0,0];for(let u of e.visibleTiles){let h=e.getTile(u),d=h&&sh(h,t);if(!d||!Rt(l,n.tileMatrix64(u,d.extent))||(Qe(c,l,[i,a,-1,1]),Qe(f,l,[i,a,1,1]),c[3]===0||f[3]===0))continue;let m=c[0]/c[3],p=c[1]/c[3],b=c[2]/c[3],g=f[0]/f[3]-m,y=f[1]/f[3]-p,A=f[2]/f[3]-b,x=db(d,m,p,ah(u,d.extent,m,p,b,g,y,A,r),g,y,A);x&&(!s||x.t<s.distance)&&(s={featureId:x.featureId,tile:u,layerId:t,distance:x.t});}return s}function ah(n,e,t,o,r,i,a,s,l){if(!l||Math.abs(s)<1e-9)return r;let c=1<<n.z,f=0;for(let u=0;u<2;u++){let h=(f-r)/s;if(!isFinite(h))break;let d=t+i*h,m=o+a*h;f=l((n.x+d/e)/c,(n.y+m/e)/c);}return r-f}function Fs(n,e,t,o,r){let i=o.x/Math.max(n.width,1)*2-1,a=1-o.y/Math.max(n.height,1)*2,s=null,l=new Float64Array(16),c=[0,0,0,0],f=[0,0,0,0];for(let u of e.visibleTiles){let h=e.getTile(u);if(h)for(let d of t){let m=h.data?.buckets?.[d];if(!m||m.kind!=="fill"||!m.featureIds||!Rt(l,n.tileMatrix64(u,m.extent))||(Qe(c,l,[i,a,-1,1]),Qe(f,l,[i,a,1,1]),c[3]===0||f[3]===0))continue;let p=c[0]/c[3],b=c[1]/c[3],g=f[2]/f[3]-c[2]/c[3];if(Math.abs(g)<1e-9)continue;let A=-ah(u,m.extent,p,b,c[2]/c[3],f[0]/f[3]-p,f[1]/f[3]-b,g,r)/g;if(A<0||A>1)continue;let x=p+(f[0]/f[3]-p)*A,v=b+(f[1]/f[3]-b)*A,w=hb(m,x,v);w!==null&&(!s||A<s.distance)&&(s={featureId:w,tile:u,layerId:d,distance:A});}}return s}function hb(n,e,t){let o=new DataView(n.vertices),r=new Uint32Array(n.indices),i=new Float64Array(n.featureIds),a=l=>o.getInt16(l*Ft,true),s=l=>o.getInt16(l*Ft+2,true);for(let l=0;l*3<r.length;l++){let c=r[l*3],f=r[l*3+1],u=r[l*3+2],h=a(c),d=s(c),m=a(f),p=s(f),b=a(u),g=s(u),y=(e-m)*(d-p)-(h-m)*(t-p),A=(e-b)*(p-g)-(m-b)*(t-g),x=(e-h)*(g-d)-(b-h)*(t-d),v=y<0||A<0||x<0,w=y>0||A>0||x>0;if(!(v&&w))return i[l]}return null}function sh(n,e){let t=n.data?.buckets?.[e];return !t||t.kind!=="fill-extrusion"||!t.featureIds?null:t}function db(n,e,t,o,r,i,a){let s=new DataView(n.vertices),l=new Uint32Array(n.indices),c=new Float64Array(n.featureIds),f=p=>s.getInt16(p*rt,true)/Xt,u=p=>s.getInt16(p*rt+2,true)/Xt,h=p=>s.getUint16(p*rt+4,true)/Go,d=1/0,m=-1;for(let p=0;p+2<l.length;p+=3){let b=l[p],g=l[p+1],y=l[p+2],A=f(b),x=u(b),v=h(b),w=f(g)-A,C=u(g)-x,B=h(g)-v,_=f(y)-A,T=u(y)-x,k=h(y)-v,K=i*k-a*T,P=a*_-r*k,W=r*T-i*_,z=w*K+C*P+B*W;if(z>-1e-9&&z<1e-9)continue;let L=1/z,X=e-A,Q=t-x,G=o-v,Y=(X*K+Q*P+G*W)*L;if(Y<0||Y>1)continue;let ie=Q*B-G*C,ee=G*w-X*B,ue=X*C-Q*w,$=(r*ie+i*ee+a*ue)*L;if($<0||Y+$>1)continue;let Ae=(_*ie+T*ee+k*ue)*L;Ae<0||Ae>1||Ae>=d||(d=Ae,m=c[p/3]??0);}return m>=0?{featureId:m,t:d}:null}function Ii(n,e,t){let o=sh(n,e);return o?Is(o,t):null}function Is(n,e){if(!n.featureIds)return null;let t=new Uint32Array(n.indices),o=new Float64Array(n.featureIds),r=[];for(let i=0;i+2<t.length;i+=3)o[i/3]===e&&r.push(t[i],t[i+1],t[i+2]);return r.length?{vertices:n.vertices,indices:new Uint32Array(r)}:null}var jo=24,Ds=8,mb=2,pb=12,Di=8,Ti=8;function Zr(n){let e=0;for(let d of n)e+=d.length/2;if(e<2)return null;let t=(Di+2)*2,o=e*t+n.length*(Ti+2)*2+8,r=e*(Di+2)*6+n.length*Ti*6+24,i=new ArrayBuffer(o*jo),a=new DataView(i),s=new Uint32Array(r),l=0,c=0,f=(d,m,p,b,g,y)=>{let A=l*jo;return a.setFloat32(A,d,true),a.setFloat32(A+4,m,true),a.setFloat32(A+8,p,true),a.setFloat32(A+12,b,true),a.setFloat32(A+16,g,true),a.setFloat32(A+20,y,true),l++},u=(d,m,p,b)=>{s[c++]=d,s[c++]=m,s[c++]=b,s[c++]=d,s[c++]=b,s[c++]=p;},h=(d,m,p,b,g,y,A)=>{let x=f(d,m,0,0,0,A),v=f(d,m,p,b,1,A);for(let w=1;w<=Ti;w++){let C=Math.PI*w/Ti,B=p*Math.cos(C)+g*Math.sin(C),_=b*Math.cos(C)+y*Math.sin(C),T=f(d,m,B,_,1,A);s[c++]=x,s[c++]=v,s[c++]=T,v=T;}};for(let d of n){let m=bb(d),p=m.length/2;if(p<2)continue;let b=new Float64Array(p-1),g=new Float64Array(p-1);for(let w=0;w<p-1;w++){let C=m[w*2+2]-m[w*2],B=m[w*2+3]-m[w*2+1],_=Math.hypot(C,B)||1;b[w]=C/_,g[w]=B/_;}let y=0,A=-1,x=-1;for(let w=0;w<p;w++){let C=m[w*2],B=m[w*2+1];w>0&&(y+=Math.hypot(C-m[w*2-2],B-m[w*2-1]));let _=w>0?w-1:0,T=w<p-1?w:p-2,k=-g[_],K=b[_],P=-g[T],W=b[T],z=k+P,L=K+W,X=Math.hypot(z,L);X>1e-9?(z/=X,L/=X):(z=k,L=K);let Q=z*P+L*W,G=Q>1e-6?1/Q:1/0,Y=Math.acos(Math.min(1,Math.max(-1,b[_]*b[T]+g[_]*g[T])));if(!(Y>pb*Math.PI/180)&&G<=mb){let ee=f(C,B,z*G,L*G,1,y),ue=f(C,B,-z*G,-L*G,-1,y);A>=0&&u(A,x,ee,ue),A=ee,x=ue;}else {let ee=Math.max(1,Math.min(Di,Math.ceil(Y/(Math.PI/Di)))),$=b[_]*g[T]-g[_]*b[T]>=0?1:-1,Ae=f(C,B,k,K,1,y),ve=f(C,B,-k,-K,-1,y);A>=0&&u(A,x,Ae,ve);for(let he=1;he<=ee;he++){let xe=$*Y*(he/ee),de=Math.cos(xe),we=Math.sin(xe),I=k*de-K*we,J=k*we+K*de,Z=f(C,B,I,J,1,y),ce=f(C,B,-I,-J,-1,y);u(Ae,ve,Z,ce),Ae=Z,ve=ce;}A=Ae,x=ve;}}let v=p-2;h(m[0],m[1],-g[0],b[0],-b[0],-g[0],0),h(m[(p-1)*2],m[(p-1)*2+1],-g[v],b[v],b[v],g[v],y);}return c?{vertices:i.slice(0,l*jo),indices:s.slice(0,c),vertexCount:l}:null}function Ts(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=ot(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 bb(n){let e=[];for(let t=0;t<n.length;t+=2){let o=n[t],r=n[t+1],i=e.length;i>=2&&e[i-2]===o&&e[i-1]===r||e.push(o,r);}return e}var Yo=5126,gb={stride:Ds,attribs:[{name:"a_pos",size:2,type:Yo,offset:0}]},Ls={stride:jo,attribs:[{name:"a_pos",size:2,type:Yo,offset:0},{name:"a_extrude",size:2,type:Yo,offset:8},{name:"a_side",size:1,type:Yo,offset:16},{name:"a_dist",size:1,type:Yo,offset:20}]},yb={stride:4,attribs:[{name:"a_ground",size:1,type:Yo,offset:0}]},ks=class{constructor(e,t,o){this.revision=e;this.ground=t;this.parts=o;}destroy(){for(let e of this.parts)e.vao.destroy(),e.vbo.destroy(),e.ibo.destroy(),e.gbo?.destroy();}},Ab=(n,e)=>[n[0],n[1],n[2],n[3]*e],qr=class{constructor(){this.elevationAt=null;this.elevationRevision=0;this.objects=[];this.markers=[];this.gpu=new fe;this.markerHost=null;}setMarkerHost(e){this.markerHost=e;for(let t of this.markers)t.attach(e);}add(e){this.objects.includes(e)||this.objects.push(e);}remove(e){let t=this.objects.indexOf(e);t<0||(this.objects.splice(t,1),this.gpu.get(e.id)?.destroy(),this.gpu.delete(e.id));}addMarker(e){this.markers.includes(e)||(this.markers.push(e),this.markerHost&&e.attach(this.markerHost));}removeMarker(e){let t=this.markers.indexOf(e);t<0||(this.markers.splice(t,1),e.detach());}get all(){return this.objects}get allMarkers(){return this.markers}get isEmpty(){return this.objects.length===0}updateMarkers(e){for(let t of this.markers)t.update(e);}render(e,t,o,r,i,a,s,l=false,c=false){if(!this.objects.length||c&&!this.objects.some(m=>m.ghostOpacity>0))return;this.objects.length>1&&this.objects.sort((m,p)=>m.zIndex-p.zIndex);let f=e.gl.drawingBufferWidth,u=t.width>0?f/t.width:1,h=t.worldSize*u,d=null;for(let m of this.objects){if(!m.visible)continue;let p=m.ghostOpacity;if(c&&p<=0)continue;let b=this.gpuFor(e,m,r,a);if(!b)continue;let g=l?t.shadowObjectMatrix(m.originX,m.originY,m.altitude):null,y=t.objectMatrix(m.originX,m.originY,m.altitude);for(let{part:A,vao:x,ibo:v}of b.parts){if(c&&(A.kind!=="line"||A.arrow))continue;let w=c?Ab(A.color,p):A.color;if(A.kind==="fill")d!==o&&(o.use(),s?.(o),d=o),o.setVec4v("u_color",it(w)),g&&o.setMat4("u_shadow_matrix",g),o.setMat4("u_matrix",y);else {d!==i&&(i.use(),s?.(i),d=i);let C=A.width/2*u,B=h>1e-9?1/h:1;if(i.setVec4v("u_color",it(w)),i.setFloat("u_half_width",C),i.setFloat("u_offset",(A.offset??0)*u),i.setFloat("u_aa",1),i.setFloat("u_units_per_px",B),i.setFloat("u_units_to_px",h),i.setInt("u_pattern",c?0:A.dashArray?1:A.arrow?2:0),A.dashArray){let[_,T]=A.dashArray;i.setVec2("u_dash",_*u,(_+T)*u);}if(A.arrow){i.setVec4v("u_arrow_color",it(A.arrowColor??[1,1,1,1]));let _=(A.arrowSize??5)*u;i.setVec3("u_arrow",(A.arrowPeriod??46)*u,Math.max(_*.4,1),Math.min(_,C*.72));}g&&i.setMat4("u_shadow_matrix",g),i.setMat4("u_matrix",y);}x.bind(),e.gl.drawElements(e.gl.TRIANGLES,v.count,v.type,0);}}e.bindVAO(null);}hitTest(e,t,o=4){let r=e.worldSize,i=this.elevationAt,a=(s,l,c)=>{let f=Oe(s),u=Ge(l);return e.worldPxToPoint(f*r,u*r,c+(i?i(f,u):0))};for(let s=this.objects.length-1;s>=0;s--){let l=this.objects[s];if(l.visible&&l.hitTest(t,a,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 s of a){let l=Pe(s);l.lng<t&&(t=l.lng),l.lng>r&&(r=l.lng),l.lat<o&&(o=l.lat),l.lat>i&&(i=l.lat);}return isFinite(t)?{west:t,south:o,east:r,north:i}:null}gpuFor(e,t,o,r){let i=this.elevationAt?this.elevationRevision:0,a=this.gpu.get(t.id);if(a&&a.revision===t.revision&&a.ground===i)return a;a?.destroy();let s=[];for(let c of t.build()){let f=c.kind==="fill"?gb:Ls,u=c.kind==="fill"?o:r,h=new Je(e,new Uint8Array(c.mesh.vertices),f),d=new Ue(e,c.mesh.indices),m=this.groundOf(t,c,f.stride),p=m?new Je(e,m,yb):null,b=[{buffer:h,locations:u}];p&&b.push({buffer:p,locations:u});let g=new Ne(e,b,d);s.push({part:c,vao:g,vbo:h,ibo:d,gbo:p});}let l=new ks(t.revision,i,s);return this.gpu.set(t.id,l),s.length?l:null}groundOf(e,t,o){let r=this.elevationAt;if(!r)return null;let i=new DataView(t.mesh.vertices),a=new Float32Array(t.mesh.vertexCount);for(let s=0;s<a.length;s++){let l=i.getFloat32(s*o,true)+e.originX,c=i.getFloat32(s*o+4,true)+e.originY;a[s]=r(l,c);}return a}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 ki=32,Cb=1179937895,Bb=1313821514,Mb=5130562,_b={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},Eb={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT4:16};async function Rs(n){let{json:e,bin:t}=dh(n),o=await Fb(e,t);return ph(e,t,o)}function Sb(n){let{json:e,bin:t}=dh(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 ph(e,t,null)}function dh(n){let e=new DataView(n);if(e.getUint32(0,true)!==Cb)throw new Error("[osmgl] \u044D\u0442\u043E \u043D\u0435 GLB: \u043D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0438\u0433\u043D\u0430\u0442\u0443\u0440\u0430");if(e.getUint32(4,true)!==2)throw new Error("[osmgl] \u043F\u043E\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044F \u0442\u043E\u043B\u044C\u043A\u043E glTF 2.0");let t=null,o=null,r=12;for(;r+8<=n.byteLength;){let i=e.getUint32(r,true),a=e.getUint32(r+4,true),s=r+8;a===Bb?t=JSON.parse(new TextDecoder().decode(new Uint8Array(n,s,i))):a===Mb&&(o=new Uint8Array(n,s,i)),r=s+i+(4-i%4)%4;}if(!t)throw new Error("[osmgl] \u0432 GLB \u043D\u0435\u0442 JSON-\u043A\u0443\u0441\u043A\u0430");return {json:t,bin:o??new Uint8Array(0)}}async function Fb(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(()=>(hh(),uh));await r.ready;let i=new Map;for(let a of o){let s=t[a].extensions.EXT_meshopt_compression,l=s.byteOffset??0,c=e.subarray(l,l+s.byteLength),f=new Uint8Array(s.count*s.byteStride);r.decodeGltfBuffer(f,s.count,s.byteStride,c,s.mode,s.filter??"NONE"),i.set(a,f);}return i}function mh(n){let e=Fe();if(n.matrix){for(let B=0;B<16;B++)e[B]=n.matrix[B];return e}Wt(e);let[t,o,r]=n.translation??[0,0,0],[i,a,s,l]=n.rotation??[0,0,0,1],[c,f,u]=n.scale??[1,1,1],h=i+i,d=a+a,m=s+s,p=i*h,b=i*d,g=i*m,y=a*d,A=a*m,x=s*m,v=l*h,w=l*d,C=l*m;return e[0]=(1-(y+x))*c,e[1]=(b+C)*c,e[2]=(g-w)*c,e[4]=(b-C)*f,e[5]=(1-(p+x))*f,e[6]=(A+v)*f,e[8]=(g+w)*u,e[9]=(A-v)*u,e[10]=(1-(p+y))*u,e[12]=t,e[13]=o,e[14]=r,e}var Ib={5120:127,5121:255,5122:32767,5123:65535};function Db(n){let e=n[0],t=n[1],o=n[2],r=n[4],i=n[5],a=n[6],s=n[8],l=n[9],c=n[10],f=e*(i*c-a*l)-r*(t*c-o*l)+s*(t*a-o*i);if(Math.abs(f)<1e-20)return [1,0,0,0,1,0,0,0,1];let u=1/f;return [(i*c-a*l)*u,(a*s-r*c)*u,(r*l-i*s)*u,(o*l-t*c)*u,(e*c-o*s)*u,(t*s-e*l)*u,(t*a-o*i)*u,(o*r-e*a)*u,(e*i-t*r)*u]}function ph(n,e,t){let o=B=>{let _=t?.get(B);if(_)return _;let T=n.bufferViews?.[B];if(!T)return null;let k=T.byteOffset??0;return e.subarray(k,k+T.byteLength)},r=[],i=[],a=[],s=[],l=[],c=[1/0,1/0,1/0],f=[-1/0,-1/0,-1/0],u=B=>{if(B===void 0)return null;let _=n.accessors?.[B];if(!_)return null;let T=Eb[_.type]??1,k=new Float64Array(_.count*T),K=_.bufferView!==void 0?n.bufferViews?.[_.bufferView]:void 0;if(!K||_.bufferView===void 0)return {data:k,components:T};let P=o(_.bufferView);if(!P)return {data:k,components:T};let W=_b[_.componentType]??4,z=K.extensions?.EXT_meshopt_compression,L=z?z.byteStride:K.byteStride,X=L&&L>0?L:W*T,Q=_.byteOffset??0,G=new DataView(P.buffer,P.byteOffset,P.byteLength),Y=_.normalized?Ib[_.componentType]??1:1;for(let ie=0;ie<_.count;ie++)for(let ee=0;ee<T;ee++){let ue=Q+ie*X+ee*W,$;switch(_.componentType){case 5120:$=G.getInt8(ue);break;case 5121:$=G.getUint8(ue);break;case 5122:$=G.getInt16(ue,true);break;case 5123:$=G.getUint16(ue,true);break;case 5125:$=G.getUint32(ue,true);break;default:$=G.getFloat32(ue,true);}k[ie*T+ee]=Y===1?$:Math.max($/Y,-1);}return {data:k,components:T}},h=(B,_,T=-1)=>{if(B.mode!==void 0&&B.mode!==4)return;let k=u(B.attributes.POSITION);if(!k)return;let K=u(B.attributes.NORMAL),P=u(B.attributes.TEXCOORD_0),W=u(B.indices),z=r.length/3,L=k.data.length/3,X=Db(_),G=(B.material!==void 0?n.materials?.[B.material]:void 0)?.pbrMetallicRoughness?.baseColorTexture?.extensions?.KHR_texture_transform,Y=G?{ox:G.offset?.[0]??0,oy:G.offset?.[1]??0,sx:G.scale?.[0]??1,sy:G.scale?.[1]??1,rot:G.rotation??0}:null;for(let we=0;we<L;we++){let I=k.data[we*3],J=k.data[we*3+1],Z=k.data[we*3+2],ce=_[0]*I+_[4]*J+_[8]*Z+_[12],ae=_[1]*I+_[5]*J+_[9]*Z+_[13],be=_[2]*I+_[6]*J+_[10]*Z+_[14];if(r.push(ce,ae,be),ce<c[0]&&(c[0]=ce),ae<c[1]&&(c[1]=ae),be<c[2]&&(c[2]=be),ce>f[0]&&(f[0]=ce),ae>f[1]&&(f[1]=ae),be>f[2]&&(f[2]=be),K){let U=K.data[we*3],j=K.data[we*3+1],R=K.data[we*3+2],H=X[0]*U+X[3]*j+X[6]*R,E=X[1]*U+X[4]*j+X[7]*R,M=X[2]*U+X[5]*j+X[8]*R,S=Math.hypot(H,E,M);S>1e-12?(H/=S,E/=S,M/=S):(H=0,E=1,M=0),i.push(H,E,M);}else i.push(0,1,0);let Se=P?P.data[we*2]:0,F=P?P.data[we*2+1]:0;if(Y){if(Y.rot!==0){let U=Math.cos(Y.rot),j=Math.sin(Y.rot),R=U*Se+j*F,H=-j*Se+U*F;Se=R,F=H;}Se=Se*Y.sx+Y.ox,F=F*Y.sy+Y.oy;}a.push(Se,F);}let ie=s.length;if(W)for(let we=0;we<W.data.length;we++)s.push(z+W.data[we]);else for(let we=0;we<L;we++)s.push(z+we);let ee=B.material!==void 0?n.materials?.[B.material]:void 0,ue=ee?.pbrMetallicRoughness,$=ue?.metallicFactor!==void 0||ue?.roughnessFactor!==void 0,Ae=ue?.baseColorFactor??[1,1,1,1],ve=ue?.baseColorTexture?.index,he=ve!==void 0?n.textures?.[ve]?.source:void 0,xe=ee?.emissiveFactor??[0,0,0],de=ee?.extensions?.KHR_materials_emissive_strength?.emissiveStrength??1;l.push({indexOffset:ie,indexCount:s.length-ie,baseColor:[Ae[0],Ae[1],Ae[2],Ae[3]??1],metallic:$?ue?.metallicFactor??1:0,roughness:$?ue?.roughnessFactor??1:1,emissive:[xe[0]*de,xe[1]*de,xe[2]*de],texture:he??-1,doubleSided:ee?.doubleSided===true,blend:ee?.alphaMode==="BLEND",alphaCutoff:ee?.alphaMode==="MASK"?ee.alphaCutoff??.5:.02,node:T});},d=n.skins?.length?null:Tb(n,u),m=d?d.nodes:null,p=(B,_,T,k)=>{let K=n.nodes?.[B];if(!K)return;let P=mh(K),W=Fe();at(W,_,P);let z=Fe(),L=k,X=m?.get(B);if(X?(X.parentNode=k,X.parent=T.slice(),Wt(z),L=B):at(z,T,P),K.mesh!==void 0)for(let G of n.meshes?.[K.mesh]?.primitives??[])h(G,z,L);let Q=K.extensions?.KHR_lights_punctual?.light;if(Q!==void 0){let G=n.extensions?.KHR_lights_punctual?.lights?.[Q],Y=G?.type;if(G&&(Y==="point"||Y==="spot"||Y==="directional")){let ie=-W[8],ee=-W[9],ue=-W[10],$=Math.hypot(ie,ee,ue)||1,Ae=G.spot?.innerConeAngle??0,ve=G.spot?.outerConeAngle??Math.PI/4;b.push({type:Y,color:[G.color?.[0]??1,G.color?.[1]??1,G.color?.[2]??1],intensity:G.intensity??1,range:G.range??0,position:[W[12],W[13],W[14]],direction:[ie/$,ee/$,ue/$],cosInner:Math.cos(Ae),cosOuter:Math.cos(ve)});}}for(let G of K.children??[])p(G,W,z,L);},b=[],g=Fe();Wt(g);let y=Fe();Wt(y);let A=n.scenes?.[n.scene??0]?.nodes??n.nodes?.map((B,_)=>_)??[];for(let B of A)p(B,g,y,-1);let x=[];for(let B of n.images??[]){if(B.bufferView===void 0){x.push(new Uint8Array(0));continue}let _=o(B.bufferView);x.push(_?_.slice():new Uint8Array(0));}let v=r.length/3,w=new ArrayBuffer(v*ki),C=new Float32Array(w);for(let B=0;B<v;B++){let _=B*8;C[_]=r[B*3],C[_+1]=r[B*3+1],C[_+2]=r[B*3+2],C[_+3]=i[B*3],C[_+4]=i[B*3+1],C[_+5]=i[B*3+2],C[_+6]=a[B*2],C[_+7]=a[B*2+1];}return isFinite(c[0])||(c[0]=c[1]=c[2]=0,f[0]=f[1]=f[2]=0),{vertices:w,indices:new Uint32Array(s),primitives:l,images:x,min:c,max:f,animation:d,lights:b}}function Tb(n,e){let t=n.animations?.[0];if(!t||!t.channels.length)return null;let o=new Map,r=0;for(let i of t.channels){let a=i.target.node,s=i.target.path;if(a===void 0||s!=="translation"&&s!=="rotation"&&s!=="scale")continue;let l=t.samplers[i.sampler];if(!l)continue;let c=e(l.input),f=e(l.output);if(!c||!f||!c.data.length)continue;let u=s==="rotation"?4:3,h=l.interpolation==="CUBICSPLINE",d=c.data.length,m=new Float32Array(d*u);for(let b=0;b<d;b++){let g=h?(b*3+1)*u:b*u;for(let y=0;y<u;y++)m[b*u+y]=f.data[g+y];}let p=o.get(a)??{parentNode:-1,parent:Wt(Fe()),base:kb(n.nodes?.[a]),channels:[]};p.channels.push({path:s,times:Float32Array.from(c.data),values:m,step:l.interpolation==="STEP"}),o.set(a,p),r=Math.max(r,c.data[d-1]);}return o.size?{duration:r||1,nodes:o}:null}function kb(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 Ps(n,e,t,o){let r=n.nodes.get(e);if(!r)return Wt(o);let i=Fe();Lb(r,t,i);let a=Fe();if(at(a,r.parent,i),r.parentNode<0)return bh(o,a);let s=Fe();return Ps(n,r.parentNode,t,s),at(o,s,a)}var bh=(n,e)=>{for(let t=0;t<16;t++)n[t]=e[t];return n};function Lb(n,e,t){let o=[...n.base.t],r=[...n.base.r],i=[...n.base.s];for(let a of n.channels){let s=a.times.length,l=a.path==="rotation"?4:3,c=0;for(;c<s-1&&a.times[c+1]<e;)c++;let f=Math.min(c+1,s-1),u=a.times[f]-a.times[c],h=a.step||u<=0?0:Math.min(Math.max((e-a.times[c])/u,0),1),d=c*l,m=f*l;if(a.path==="rotation"){let p=0;for(let y=0;y<4;y++)p+=a.values[d+y]*a.values[m+y];let b=p<0?-1:1,g=0;for(let y=0;y<4;y++)r[y]=a.values[d+y]*(1-h)+a.values[m+y]*b*h,g+=r[y]*r[y];g=Math.sqrt(g)||1;for(let y=0;y<4;y++)r[y]/=g;}else {let p=a.path==="translation"?o:i;for(let b=0;b<3;b++)p[b]=a.values[d+b]*(1-h)+a.values[m+b]*h;}}return bh(t,mh({translation:o,rotation:r,scale:i}))}var mt=5126,Rb=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),gh={stride:ki,attribs:[{name:"a_pos",size:3,type:mt,offset:0},{name:"a_normal",size:3,type:mt,offset:12},{name:"a_tex",size:2,type:mt,offset:24}]},Os=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);}},Hs=256,Li=41,yh={stride:Li*4,attribs:[{name:"a_i_m0",size:4,type:mt,offset:0,divisor:1},{name:"a_i_m1",size:4,type:mt,offset:16,divisor:1},{name:"a_i_m2",size:4,type:mt,offset:32,divisor:1},{name:"a_i_m3",size:4,type:mt,offset:48,divisor:1},{name:"a_i_s0",size:4,type:mt,offset:64,divisor:1},{name:"a_i_s1",size:4,type:mt,offset:80,divisor:1},{name:"a_i_s2",size:4,type:mt,offset:96,divisor:1},{name:"a_i_s3",size:4,type:mt,offset:112,divisor:1},{name:"a_i_n0",size:3,type:mt,offset:128,divisor:1},{name:"a_i_n1",size:3,type:mt,offset:140,divisor:1},{name:"a_i_n2",size:3,type:mt,offset:152,divisor:1}]},Qr=2,Zo=16,lo=class{constructor(){this.models=[];this.gpu=new fe;this.counted=new Set;this.instBuffer=null;this.instScratch=new Float32Array(Hs*Li);this.drawnInstanced=new Set;this.onLoaded=null;this.growDurationSec=.45;this.fadeDurationSec=.6;this.transitioning=false;this.depthTimeSec=0;this.lightPacks=new WeakMap;this.elevationAt=null;this.shadow32=new Float32Array(16);this.shadowNode32=new Float32Array(16);this.shadowNodeColor32=new Float32Array(16);}add(e){this.models.includes(e)||(this.models.push(e),e.isLoaded||e.load(()=>this.onLoaded?.()));}remove(e,t){let o=this.models.indexOf(e);if(o<0)return;this.models.splice(o,1);let r=this.gpu.get(e.url);r&&(this.counted.delete(e)&&r.users--,!(r.users>0)&&(t&&r.destroy(t),this.gpu.delete(e.url)));}get all(){return this.models}get hasTransitions(){return this.transitioning}get hasAnimated(){return this.models.some(e=>e.isAnimated)}get isEmpty(){return this.models.length===0}get readyCount(){return this.models.filter(e=>e.visible&&e.isLoaded).length}render(e,t,o,r,i,a,s=0,l){if(this.models.length){this.drawnInstanced.clear(),l&&this.renderInstanced(e,t,l.shader,l.locations,i,a),o.use(),i(o),o.setInt("u_base_texture",Qr);for(let c of this.models){if(this.drawnInstanced.has(c)||!this.inView(t,c))continue;let f=c.visible&&c.fade>0?this.gpuFor(e,c,r):null;if(!f||!c.mesh)continue;let u=c.fade<1;o.setFloat("u_opacity",c.fade);let h=c.matrixFor(t);o.setMat4("u_matrix",h),o.setMat3("u_normal_matrix",c.normalMatrix());let d=a?this.shadowMatrix(t,c):null;this.uploadLights(o,c.mesh);let m=c.cameraInModelSpace(t);o.setVec3("u_camera_model",m[0],m[1],m[2]),o.setFloat("u_reflect",1),f.vao.bind();for(let p of [false,true])if(!(u&&!p))for(let b of c.mesh.primitives){if(!u&&b.blend!==p)continue;o.setMat4("u_matrix",b.node>=0?c.matrixForNode(t,b.node,s):h),d&&o.setMat4("u_shadow_matrix",b.node>=0?this.shadowMatrixForNodeAt(t,c,b.node,s):d);let g=b.texture>=0?f.textures[b.texture]:null;o.setFloat("u_has_texture",g?1:0),o.setFloat("u_alpha_cutoff",b.alphaCutoff),g&&e.bindTexture(Qr,g),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 s=new fe;for(let c of this.models){if(!c.visible||c.fade<1||!c.mesh||!c.isLoaded||!this.inView(t,c)||c.mesh.primitives.some(u=>u.blend||u.node>=0))continue;let f=s.get(c.url);f?f.push(c):s.set(c.url,[c]);}let l=false;o.setFloat("u_reflect",0);for(let[,c]of s){if(c.length<2)continue;let f=this.gpuFor(e,c[0],r);if(!f||!c[0].mesh)continue;this.instBuffer||(this.instBuffer=new Je(e,this.instScratch,yh,true)),f.instVao||(f.instVao=new Ne(e,[{buffer:f.vbo,locations:r},{buffer:this.instBuffer,locations:r}],f.ibo)),l||(o.use(),i(o),o.setInt("u_base_texture",Qr),o.setFloat("u_opacity",1),l=true);let u=c[0].mesh;for(let h=0;h<c.length;h+=Hs){let d=Math.min(Hs,c.length-h);for(let m=0;m<d;m++){let p=c[h+m],b=m*Li;this.instScratch.set(p.matrixFor(t),b);let g=a?this.shadowMatrix(t,p):Rb;this.instScratch.set(g,b+16),this.instScratch.set(p.normalMatrix(),b+32),this.drawnInstanced.add(p);}this.instBuffer.update(this.instScratch.subarray(0,d*Li)),e.bindVAO(f.instVao.vao);for(let m of u.primitives){let p=m.texture>=0?f.textures[m.texture]:null;o.setFloat("u_has_texture",p?1:0),o.setFloat("u_alpha_cutoff",m.alphaCutoff),p&&e.bindTexture(Qr,p),o.setVec4v("u_base_color",m.baseColor),o.setVec3("u_emissive",m.emissive[0],m.emissive[1],m.emissive[2]),o.setFloat("u_metallic",m.metallic),o.setFloat("u_roughness",m.roughness),e.setCull(m.doubleSided?"none":"back"),e.setBlend("none"),e.setDepthMask(true),e.gl.drawElementsInstanced(e.gl.TRIANGLES,m.indexCount,e.gl.UNSIGNED_INT,m.indexOffset*4,d);}}}l&&e.bindVAO(null);}uploadLights(e,t){let o=this.lightPacks.get(t);if(!o){let r=t.lights.filter(f=>f.type!=="directional"),i=r.length<=Zo?r:[...r].sort((f,u)=>u.intensity-f.intensity).slice(0,Zo),a=new Float32Array(Zo*4),s=new Float32Array(Zo*4),l=new Float32Array(Zo*4),c=new Float32Array(Zo*4);i.forEach((f,u)=>{let h=u*4;a[h]=f.position[0],a[h+1]=f.position[1],a[h+2]=f.position[2],a[h+3]=f.range,s[h]=f.color[0]*f.intensity,s[h+1]=f.color[1]*f.intensity,s[h+2]=f.color[2]*f.intensity,s[h+3]=f.type==="spot"?1:0,l[h]=f.direction[0],l[h+1]=f.direction[1],l[h+2]=f.direction[2],c[h]=f.cosInner,c[h+1]=f.cosOuter;}),o={count:i.length,pos:a,color:s,dir:l,cone:c},this.lightPacks.set(t,o);}e.setInt("u_light_count",o.count),o.count!==0&&(e.setVec4Array("u_light_pos",o.pos),e.setVec4Array("u_light_color",o.color),e.setVec4Array("u_light_dir",o.dir),e.setVec4Array("u_light_cone",o.cone));}inView(e,t){if(!t.mesh)return false;let r=t.origin(),i=t.boundingRadiusM();return e.isSphereVisible(r.x,r.y,t.altitude+t.groundZ+i*.5,i)}advanceTransitions(){this.transitioning=false;for(let e of this.models){if(this.elevationAt){let t=e.origin();e.groundZ=this.elevationAt(t.x,t.y);}else e.groundZ!==0&&(e.groundZ=0);e.advanceGrow(this.growDurationSec)&&(this.transitioning=true),e.advanceFade(this.fadeDurationSec)&&(this.transitioning=true);}}renderDepth(e,t,o,r){if(this.models.length){o.use();for(let i of this.models){let a=i.visible&&i.fade>.5?this.gpuFor(e,i,r):null;if(!a||!i.mesh)continue;let s=this.shadowMatrix(t,i);o.setMat4("u_matrix",s),a.vao.bind();for(let l of i.mesh.primitives)l.blend||(o.setMat4("u_matrix",l.node>=0?this.shadowMatrixForNode(t,i,l.node):s),e.gl.drawElements(e.gl.TRIANGLES,l.indexCount,e.gl.UNSIGNED_INT,l.indexOffset*4));}e.bindVAO(null);}}shadowMatrix(e,t){let o=t.origin();return t.matrixInSpace(e.shadowObjectMatrix(o.x,o.y,t.altitude+t.groundZ),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+t.groundZ),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 Je(e,new Uint8Array(t.mesh.vertices),gh),s=new Ue(e,t.mesh.indices),l=new Ne(e,[{buffer:a,locations:o}],s),c=t.bitmaps.map(u=>{if(!u)return null;let h=i.createTexture();return h?(e.bindTexture(Qr,h),i.texImage2D(i.TEXTURE_2D,0,i.RGBA,i.RGBA,i.UNSIGNED_BYTE,u),i.generateMipmap(i.TEXTURE_2D),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,i.LINEAR_MIPMAP_LINEAR),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MAG_FILTER,i.LINEAR),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_S,i.REPEAT),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_T,i.REPEAT),h):null}),f=new Os(l,a,s,c);return f.users=1,this.counted.add(t),this.gpu.set(t.url,f),f}static get layout(){return gh}static get instanceLayout(){return yh}destroy(e){for(let t of this.gpu.values())t.destroy(e);this.gpu.clear(),this.models=[];}};var Gs=4,Ah=new Le;function xh(n){return e=>e.type==="line"&&pe(e.paint.elevation,n,0)>0}function Pb(n){Ah.has(n)||(Ah.add(n),console.warn(`[osmgl] ${n}`));}var Hb=.5,Ob=.01,Gb=300,zb=4,Ri=127,Wb=.5,Dt=128,wh=.004,en=5120,$r=5121,Qo=5122,vh=5123,$o=5126,Nb={stride:8,attribs:[{name:"a_pos",size:2,type:$o,offset:0}]},zs={stride:Ft,attribs:[{name:"a_pos",size:2,type:Qo,offset:0}]},Ch={stride:bt,attribs:[{name:"a_p0",size:2,type:Qo,offset:0},{name:"a_p1",size:2,type:Qo,offset:4},{name:"a_corner",size:2,type:en,offset:8},{name:"a_ground",size:2,type:en,offset:10},{name:"a_dist",size:1,type:$o,offset:12},{name:"a_width",size:1,type:$o,offset:16},{name:"a_lift",size:2,type:Qo,offset:20}]},Bh={stride:ao,attribs:[{name:"a_dcolor",size:4,type:$r,normalized:true,offset:0},{name:"a_dwidth",size:1,type:$o,offset:4}]},qo={stride:rt,attribs:[{name:"a_pos",size:2,type:Qo,offset:0},{name:"a_height",size:1,type:vh,offset:4},{name:"a_tint",size:1,type:$r,normalized:true,offset:6},{name:"a_ao",size:1,type:$r,normalized:true,offset:7},{name:"a_normal",size:3,type:en,normalized:true,offset:8},{name:"a_kind",size:1,type:$r,offset:11},{name:"a_wall",size:3,type:vh,offset:12}]},Vb={flat:0,water:1,foliage:2,sand:3,asphalt:4},Ub=[1,9,14,26,3],Mh={stride:Jt,attribs:[{name:"a_pos",size:2,type:$o,offset:0},{name:"a_level",size:1,type:Qo,offset:8},{name:"a_normal",size:3,type:en,normalized:true,offset:10},{name:"a_kind",size:1,type:$r,offset:13},{name:"a_bleed",size:2,type:en,offset:14}]},Pi=class{constructor(e,t,o,r,i,a,s=r,l=null){this.vao=e;this.buffer=t;this.ibo=o;this.indexCount=r;this.indexType=i;this.extent=a;this.capIndexOffset=s;this.dataBuffer=l;this.firstDrawTime=0;}destroy(){this.vao.destroy(),this.buffer.destroy(),this.dataBuffer?.destroy(),this.ibo.destroy();}},_h={enabled:false,resolution:1024,strength:.75,color:"#5a6b86",bias:.25};function Ws(n,e){if(n.z===e.z)return n.x===e.x&&n.y===e.y;if(n.z>e.z){let o=n.z-e.z;return n.x>>o===e.x&&n.y>>o===e.y}let t=e.z-n.z;return e.x>>t===n.x&&e.y>>t===n.y}var tn=class{constructor(){this.fill=null;this.surface=null;this.surfaceLocs=new fe;this.line=null;this.building=null;this.depth=null;this.groundShadow=null;this.sky=null;this.raster=null;this.rasterLayer=new _i;this.mediaLayer=new Ei;this.mediaSources=new fe;this.customLayers=[];this.globeBody=null;this.globeClip=null;this.globeMesh=null;this.quad=null;this.fillLocs=new fe;this.lineLocs=new fe;this.objectLine=null;this.objectLineLocs=new fe;this.buildingLocs=new fe;this.shadows={..._h};this.shadowTarget=null;this.shadowPlaceholder=null;this.fog=null;this.shadowActive=false;this.materialTime=0;this.materialAnimating=false;this.stencilIds=new fe;this.stampedHoles=new Le;this.yieldTargets=new Le;this.yieldSquares=new fe;this.yieldPass=false;this.yieldMarked=null;this.patternScale=1;this.debugTiles=false;this.cameraMeters=[0,0,0];this.dpr=1;this.detailScale=1;this.reliefScale=1;this.allowShadows=true;this.highlight=null;this.highlightGpu=new fe;this.highlightKey="";this.groundArrows=new Xr;this.highlightTris=new fe;this.fillHighlightGpu=new fe;this.fillHighlightKey="";this.footprintKey="";this.highlightFill=null;this.indoorMask=new Jr;this.terrain=new Fi;this.drapeTile=null;this.drapePending=false;this.terrainShader=null;this.terrainLocs=new fe;this.hiddenBuildings=new Set;this.seams=new xi;this.seamGpu=new fe;this.hiddenWithSeams=new fe;this.hiddenVenues=new Set;this.hiddenVenueLayer=null;this.hiddenCut=new fe;this.hiddenStamp="";this.bucketIdCache=new fe;this.surfaceCut=new fe;this.shadowDepthPerMeter=1;this.shadowTexelMeters=0;this.growDurationMs=350;this.symbols=null;this.objects=null;this.models=new lo;this.model=null;this.modelInstanced=null;this.modelDepth=null;this.modelLocs=new fe;this.modelInstLocs=new fe;this.uploadBudget=po("high").uploadBudget;this.uploadLeft=0;this.uploadDeferred=false;}get indoorOpen(){return this.indoorMask.active}syncHiddenStamp(){let e=r=>[...r].sort((i,a)=>i-a).join(","),t="";for(let[r,i]of this.seams.hiddenByTile)t+=`${r}=${e(i)};`;let o=e(this.hiddenBuildings)+"#"+e(this.hiddenVenues)+"#"+t;if(o!==this.hiddenStamp){this.hiddenStamp=o,this.hiddenWithSeams.clear();for(let[r,i]of this.seams.hiddenByTile){let a=new Set(this.hiddenBuildings);for(let s of i)a.add(s);this.hiddenWithSeams.set(r,a);}for(let r of this.hiddenCut.values())r?.vao.destroy(),r?.ibo.destroy();this.hiddenCut.clear();for(let r of this.surfaceCut.values())r?.vao.destroy(),r?.ibo.destroy();this.surfaceCut.clear();}}cutSurface(e,t,o,r,i,a){if(!a||!a.size)return null;let s=r+"|"+o,l=this.surfaceCut.get(s);if(l!==void 0&&(l===null||l.vbo===i))return l;l&&(l.vao.destroy(),l.ibo.destroy());let c=t.data?.buckets?.[o];if(!c||c.kind!=="surface"||!c.shapeFeatures||!c.shapeRanges)return null;let f=new Float64Array(c.shapeFeatures),u=new Uint32Array(c.shapeRanges),h=[],d=0;for(let v=0;v<f.length;d++){let w=f[v++],C=w>0;for(let B=0;B<w;B++)if(!a.has(f[v+B])){C=false;break}v+=w,C&&h.push(d);}if(!h.length)return this.surfaceCut.set(s,null),null;let m=new Uint32Array(c.indices),p=c.capIndexOffset??m.length,b=new Uint8Array(m.length);for(let v of h){for(let w=u[v*4];w<u[v*4+1];w++)b[w]=1;for(let w=u[v*4+2];w<u[v*4+3];w++)b[w]=1;}let g=[];for(let v=0;v<p;v++)b[v]||g.push(m[v]);let y=g.length;for(let v=p;v<m.length;v++)b[v]||g.push(m[v]);let A=new Ue(e,new Uint32Array(g)),x={vao:new Ne(e,[{buffer:i,locations:this.surfaceLocs}],A),ibo:A,vbo:i,mainCount:y,capCount:g.length-y};return this.surfaceCut.set(s,x),x}bucketIds(e,t,o){let r=this.bucketIdCache.get(e);if(r&&r.vbo===o)return r.ids;this.bucketIdCache.size>2e3&&this.bucketIdCache.clear();let i=new Set(new Float64Array(t));return this.bucketIdCache.set(e,{ids:i,vbo:o}),i}syncSeams(e,t,o){let r=e.get(De);if(!(!r||!r.visibleTiles.length))for(let i of t.layers){if(i.type!=="fill-extrusion"||(i.source??De)!==De||!t.layerVisibleAt(i,o))continue;let a=t.bucketKeyFor(i);if(a===null)continue;let s=i,l=r.visibleTiles[0].z;this.seams.update(r,a,{zoom:l,metersPerTile:ho(l),cornerRadius:s.cornerRadius,cornerSegments:s.cornerSegments})&&this.syncSeamGpu();return}}replacedIds(){return this.hiddenBuildings.size?this.hiddenBuildings:null}hiddenFor(e,t,o){return t?(o?this.hiddenWithSeams.get(o):void 0)??this.hiddenBuildings:e===this.hiddenVenueLayer?this.hiddenVenues:null}cutHidden(e,t,o,r,i,a,s=this.buildingLocs,l=null){if(!a||!a.size)return null;let c=r+"|"+o,f=this.hiddenCut.get(c);if(f!==void 0&&(f===null||f.vbo===i))return f;f&&(f.vao.destroy(),f.ibo.destroy());let u=t.data?.buckets?.[o];if(!u||!("featureIds"in u)||!u.featureIds)return null;let h=this.bucketIds(c,u.featureIds,i),[d,m]=a.size<h.size?[a,h]:[h,a],p=false;for(let x of d)if(m.has(x)){p=true;break}if(!p)return this.hiddenCut.set(c,null),null;let b=new Uint32Array(u.indices),g=new Float64Array(u.featureIds),y=[];for(let x=0;x*3<b.length;x++)a.has(g[x])||y.push(b[x*3],b[x*3+1],b[x*3+2]);let A=null;if(y.length<b.length){let x=new Ue(e,new Uint32Array(y));A={vao:new Ne(e,l?[{buffer:i,locations:s},{buffer:l,locations:s}]:[{buffer:i,locations:s}],x),ibo:x,count:y.length,vbo:i};}return this.hiddenCut.set(c,A),A}init(e){this.symbols?.init(e),this.fill=new Ye(e,"fill",Ou,Gu),this.surface=new Ye(e,"surface",Xu,Ju),this.line=new Ye(e,"line",zu,Wu),this.objectLine=new Ye(e,"objectLine",Nu,Vu),this.building=new Ye(e,"buildings",Uu,Ku),this.depth=new Ye(e,"depth",Cu,ys),this.groundShadow=new Ye(e,"groundShadow",Lu,Ru),this.terrainShader=new Ye(e,"terrain",Pu,Hu),this.terrainLocs=new fe;for(let i of ["a_pos","a_skirt"])this.terrainLocs.set(i,this.terrainShader.attribLocation(i));this.sky=new Ye(e,"sky",Su,Fu),this.raster=new Ye(e,"raster",Tu,ku),this.globeBody=new Ye(e,"globeBody",Au,xu),this.globeClip=new Ye(e,"globeClip",wu,vu),this.globeMesh=Kb(e,this.globeBody),this.model=new Ye(e,"model",Mu,xs),this.modelInstanced=new Ye(e,"model-instanced",_u,xs),this.modelDepth=new Ye(e,"modelDepth",Eu,ys);for(let i of lo.layout.attribs)this.modelLocs.set(i.name,this.model.attribLocation(i.name));for(let i of [...lo.layout.attribs,...lo.instanceLayout.attribs])this.modelInstLocs.set(i.name,this.modelInstanced.attribLocation(i.name));this.shadowPlaceholder=gu(e);let t=new fe([["a_pos",this.groundShadow.attribLocation("a_pos")]]),o=new Je(e,new Float32Array([0,0,1,0,1,1,0,1]),Nb),r=new Ue(e,new Uint16Array([0,1,2,0,2,3]));this.quad={vao:new Ne(e,[{buffer:o,locations:t}],r),vbo:o,ibo:r};for(let i of zs.attribs)this.fillLocs.set(i.name,this.fill.attribLocation(i.name));for(let i of Mh.attribs)this.surfaceLocs.set(i.name,this.surface.attribLocation(i.name));for(let i of Ch.attribs)this.lineLocs.set(i.name,this.line.attribLocation(i.name));for(let i of Ls.attribs)this.objectLineLocs.set(i.name,this.objectLine.attribLocation(i.name));this.objectLineLocs.set("a_ground",this.objectLine.attribLocation("a_ground")),this.fillLocs.set("a_ground",this.fill.attribLocation("a_ground"));for(let i of qo.attribs)this.buildingLocs.set(i.name,this.building.attribLocation(i.name));for(let[i,a]of [[this.fillLocs,this.fill],[this.lineLocs,this.line],[this.buildingLocs,this.building]])for(let s of Bh.attribs)i.set(s.name,a.attribLocation(s.name));}render(e,t,o,r,i,a=new fe){if(!this.fill||!this.line||!this.building)return false;let s=t.zoom,l=false;this.uploadLeft=this.uploadBudget,this.uploadDeferred=false,this.yieldTargets=us(r,s),this.yieldSquares.clear(),this.materialTime=i/1e3,this.materialAnimating=false,this.fog=Jo(t,r),this.patternScale=kn/Math.max(Mt(t.center.lat),1),this.dpr=t.width>0?e.gl.drawingBufferWidth/t.width:1;let c=Math.max(t.pixelsPerMeter,1e-9),f=t.cameraPositionPx;this.cameraMeters=[f[0]/c,f[1]/c,f[2]/c];let u=b=>o.get(b.source??De);this.syncHighlightFootprint(o,r),this.indoorMask.sync(o,r,s),this.symbols&&(this.symbols.elevationAt=this.terrain.enabled?(b,g)=>this.terrain.heightAtMerc(b,g):null),this.syncSeams(o,r,s),this.syncHiddenStamp(),this.objects&&(this.objects.elevationAt=this.terrain.enabled?(b,g)=>this.terrain.heightAtMerc(b,g):null,this.objects.elevationRevision=this.terrain.revision),this.models.elevationAt=this.terrain.enabled?(b,g)=>this.terrain.heightAtMerc(b,g):null,this.models.advanceTransitions(),this.renderShadowMap(e,t,o,r,i),this.drawSky(e,t,r),this.drawGlobeBody(e,t,r),this.raster&&this.quad&&(this.rasterLayer.render(e,t,this.quad.vao,this.raster,r,a,s),this.mediaLayer.render(e,t,r,this.mediaSources,s,false)),this.drawTileStencil(e,t,o),e.setDepthTest(t.globeActive),e.setDepthFunc("lequal"),e.setDepthMask(false),e.setBlend("premultiplied"),e.setCull("none"),this.terrain.enabled?this.drapeTerrain(e,t,o,r,u,s):this.drawFlatLayers(e,t,r,u,s),this.terrain.enabled||this.drawFillHighlight(e,t,o,r),this.groundArrows&&!this.terrain.enabled&&(this.groundArrows.highlightFootprint=this.highlightFootprint(),this.groundArrows.render(e,t,o,r,this.fill,this.fillLocs,b=>{this.applyFogUniforms(b,t,r),b.setVec4("u_globe",0,0,0,0),b.setInt("u_material",0),b.setFloat("u_elevation",0),b.setVec2("u_world_origin",0,0);},this.shadowActive)),this.terrain.enabled||this.drawGroundShadow(e,t,o,r),this.terrain.enabled||this.drawEarthDepth(e,t,o,r),e.setDepthTest(true),e.setDepthMask(true),e.setDepthFunc("lequal"),e.setCull("back");for(let b of r.layers){if(b.type!=="surface"||b.overlay||!r.layerVisibleAt(b,s))continue;let g=u(b);g&&(this.flattened(g,r,b)||this.drawSurface(e,t,g,r,b,s));}e.setStencilTest(false),e.setDepthMask(false),e.setBlend("premultiplied"),e.setCull("none"),e.setDepthTest(false);let h=xh(s),d=new Set,m=this.terrain.enabled;m||this.beginYield();for(let b of r.layers){if(m)break;if(b.type==="raster"||!h(b)||b.overlay||!r.layerVisibleAt(b,s))continue;let g=u(b);if(g){if(b.type==="line"&&b.network){if(d.has(b.network))continue;d.add(b.network),this.drawNetwork(e,t,r,u,b.network,s,y=>!y.overlay&&h(y)&&r.layerVisibleAt(y,s));continue}this.drawLine(e,t,g,r,b,s);}}this.endYield(e),this.drawOverlay(e,t,r,u,s,"roads"),e.setDepthTest(true),e.setDepthMask(true),e.setCull("back");for(let b of r.layers){if(b.type!=="fill-extrusion"||!r.layerVisibleAt(b,s))continue;let g=u(b);g&&(this.drawBuildings(e,t,g,r,b,s,i)&&(l=true),this.drawHighlight(e,t,g,r,b,s));}this.model&&!this.models.isEmpty&&(this.models.render(e,t,this.model,this.modelLocs,b=>{this.applyShadowUniforms(b),this.applyFogUniforms(b,t,r),this.applyLight(b,r);},this.shadowActive,i/1e3,this.modelInstanced?{shader:this.modelInstanced,locations:this.modelInstLocs}:void 0),(this.models.hasAnimated||this.models.hasTransitions)&&(l=true)),this.drawOverlay(e,t,r,u,s,"volume"),this.objects&&!this.objects.isEmpty&&(e.setDepthTest(true),e.setDepthFunc("lequal"),e.setDepthMask(false),e.setBlend("premultiplied"),e.setCull("none"),this.objects.render(e,t,this.fill,this.fillLocs,this.objectLine,this.objectLineLocs,b=>{this.applyFogUniforms(b,t,r),b.setVec4("u_globe",0,0,0,0),b.setInt("u_material",0),b.setFloat("u_elevation",0),b.setVec2("u_world_origin",0,0);},this.shadowActive),e.setDepthTest(false)),this.raster&&this.quad&&(this.rasterLayer.render(e,t,this.quad.vao,this.raster,r,a,s,true),this.mediaLayer.render(e,t,r,this.mediaSources,s,true));let p=this.terrain.enabled?[]:r.layers.filter(b=>b.type==="line"&&pe(b.paint.ghostOpacity,s,0)>.001&&r.layerVisibleAt(b,s));if(p.length){e.setDepthTest(true),e.setDepthFunc("greater"),e.setDepthMask(false),e.setBlend("premultiplied"),e.setCull("none");for(let b of p){let g=u(b);g&&this.drawLine(e,t,g,r,b,s,pe(b.paint.ghostOpacity,s,0));}e.setDepthFunc("lequal"),e.setDepthTest(false);}return this.objects&&!this.objects.isEmpty&&(e.setDepthTest(true),e.setDepthFunc("greater"),e.setDepthMask(false),e.setBlend("premultiplied"),e.setCull("none"),this.objects.render(e,t,this.fill,this.fillLocs,this.objectLine,this.objectLineLocs,b=>{this.applyFogUniforms(b,t,r),b.setVec4("u_globe",0,0,0,0),b.setInt("u_material",0),b.setFloat("u_elevation",0),b.setVec2("u_world_origin",0,0);},this.shadowActive,true),e.setDepthFunc("lequal"),e.setDepthTest(false)),this.symbols&&(this.symbols.highlightFootprint=this.highlightFootprint()),this.symbols?.render(e,t,o,r),e.bindVAO(null),l||this.materialAnimating||this.uploadDeferred||this.drapePending}renderShadowMap(e,t,o,r,i){if(this.shadowPlaceholder&&e.bindTexture(Gs,this.shadowPlaceholder),this.shadowActive=false,!this.shadows.enabled||!this.allowShadows||!this.depth)return;let a=r.layers.filter(d=>d.type==="fill-extrusion"&&!d.overlay&&r.layerVisibleAt(d,t.zoom));if(!a.length&&this.models.isEmpty)return;this.shadowTarget?this.shadowTarget.resize(this.shadows.resolution):this.shadowTarget=new Vr(e,this.shadows.resolution);let s=r.light,[l,c]=this.terrain.enabled?this.terrain.groundRange():[0,0];if(t.updateShadow(Bo(s.keyAzimuth,s.keyAltitude),Gb,l,c),!t.shadowReady)return;let f=this.shadowTarget;f.bind(),e.setDepthFunc("lequal"),e.setBlend("none"),e.setCull("none");let u=e.gl;u.enable(u.POLYGON_OFFSET_FILL),u.polygonOffset(2,4);let h=this.depth;h.use();for(let d of a){let m=o.get(d.source??De);if(!m)continue;let p=r.bucketKeyFor(d);if(p===null)continue;let b=pe(d.paint.heightScale,t.zoom,1);(d.source??De)===De&&this.indoorMask.prepare(m,p);for(let g of m.visibleTiles){if(!this.drawsTile(t,r,d,g))continue;let y=m.getTile(g),A=y&&this.bucketFor(e,y,p,qo,this.buildingLocs,"fill-extrusion");if(!A)continue;h.setFloat("u_height_scale",this.growScale(A,i,!m.warm)*b),this.applyTileScale(h,g,A.extent,e),h.setMat4("u_matrix",t.shadowTileMatrix(g,A.extent));let x=(d.source??De)===De,v=this.cutHidden(e,y,p,g.dataKey,A.buffer,this.hiddenFor(p,x,g.dataKey)),w=x?v??this.indoorMask.indicesFor(e,y,p,g,A.buffer,this.buildingLocs):v;w?(w.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,w.count,e.gl.UNSIGNED_INT,0)):(A.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,A.indexCount,A.indexType,0));}}if(this.seams.meshes.size){let d=a.find(m=>(m.source??De)===De);if(d){h.setFloat("u_height_scale",pe(d.paint.heightScale,t.zoom,1));for(let[m,{tile:p,mesh:b}]of this.seams.meshes){let g=this.seamBucket(e,m,b);h.setMat4("u_matrix",t.shadowTileMatrix(p,b.extent)),g.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,b.indexCount,e.gl.UNSIGNED_INT,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)),u.disable(u.POLYGON_OFFSET_FILL),e.bindFramebuffer(null),e.viewport(0,0,e.gl.drawingBufferWidth,e.gl.drawingBufferHeight),f.bindTexture(Gs),this.shadowDepthPerMeter=t.shadowDepthPerMeter(),this.shadowTexelMeters=Math.abs(t.shadowTexelWorldSize(f.size))/(t.pixelsPerMeter||1),this.shadowActive=true;}drawGlobeBody(e,t,o){if(!t.globeActive||!this.globeBody||!this.globeMesh)return;let r=this.globeBody;r.use(),this.applyGlobeUniforms(r,t,o),r.setMat4("u_matrix",t.localMatrix());let i=o.background;r.setVec3("u_body_color",i[0],i[1],i[2]),Tt(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(Qe(i,t.localProjMatrix,r),i[3]<=1e-6)return;let a=this.globeClip;a.use(),a.setFloat("u_center_depth",i[2]/i[3]),o.colorMask(false,false,false,false),e.setDepthTest(true),e.setDepthMask(true),e.setDepthFunc("always"),this.quad.vao.bind(),o.drawElements(o.TRIANGLES,6,o.UNSIGNED_SHORT,0),o.colorMask(true,true,true,true),e.bindVAO(null);}applyAtmosphere(e,t,o){let r=t.cameraRay();e.setVec3("u_cam_ray",r.axisElev,r.focal*this.dpr,t.height*this.dpr/2),e.setFloat("u_haze_exp",1/Math.max(o.sky.horizonBlend,.01));}skyBand(e,t){let o=e.horizonScreenY(),r=e.height*this.dpr/Math.max(At(e.fov),.001);return [(e.height-o)*this.dpr,Math.max(o,1)*this.dpr,Math.max(t.sky.horizonBlend*r,1)]}drawSky(e,t,o){if(!this.sky||!this.quad||!o.sky.enabled)return;let r=this.sky;r.use(),Tt(r,"u_sky_color",o.sky.skyColor),Tt(r,"u_horizon_color",o.sky.horizonColor),Xb(r,o.sky);let[i,a]=this.skyBand(t,o),s=Math.min(a*.5,t.height*this.dpr*.1);r.setVec3("u_sky_params",i,a,s),this.applyAtmosphere(r,t,o);let l=t.cameraRay();r.setVec3("u_cam_right",l.right[0],l.right[1],l.right[2]),r.setVec3("u_cam_up",l.up[0],l.up[1],l.up[2]),r.setVec3("u_cam_fwd",l.fwd[0],l.fwd[1],l.fwd[2]),r.setVec2("u_cam_center",t.width*this.dpr/2,t.height*this.dpr/2);let c=Bo(o.light.keyAzimuth,o.light.keyAltitude);r.setVec3("u_sun_dir",-c[0],-c[1],-c[2]),Tt(r,"u_sun_color",o.light.keyColor),r.setFloat("u_sun_glow",o.light.keyIntensity);let f=t.globeActive?1-t.globeFlatMix:0;if(r.setVec2("u_space",f,o.sky.starIntensity),f>.001){Tt(r,"u_space_color",o.sky.spaceColor),Tt(r,"u_atmo_color",o.sky.atmosphereColor);let u=t.globeDisc();r.setVec4("u_globe_disc",u.dir[0],u.dir[1],u.dir[2],u.angle);let[h,d,m,p]=t.localRayCorners();r.setVec3("u_ray_tl",h[0],h[1],h[2]),r.setVec3("u_ray_tr",d[0],d[1],d[2]),r.setVec3("u_ray_bl",m[0],m[1],m[2]),r.setVec3("u_ray_br",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,o){if(!t.globeActive){e.setVec4("u_globe",0,0,0,0);return}let r=t.globeBasis,i=t.worldSize;e.setVec4("u_globe",1,t.globeFlatMix,t.globeRadiusPx,i),e.setVec2("u_globe_center",t.centerPointPx.x/i,t.centerPointPx.y/i);let a=t.globeCamera();e.setVec4("u_globe_cam",a.dir[0],a.dir[1],a.dir[2],a.horizonCos);let s=Bo(o.light.keyAzimuth,o.light.keyAltitude);e.setVec3("u_globe_sun",-s[0],-s[1],-s[2]),e.setVec2("u_globe_light",.16,.14),e.setMat3("u_globe_basis",[r.east[0],r.south[0],r.up[0],r.east[1],r.south[1],r.up[1],r.east[2],r.south[2],r.up[2]]);}drawFlatLayers(e,t,o,r,i,a=false){let s=xh(i),l=new Set;for(let c of o.layers){if(this.drawCustomBefore(e,t,c.id),c.type==="raster"||c.type==="fill-extrusion"||c.type==="symbol"||c.overlay||s(c)&&!a||!o.layerVisibleAt(c,i))continue;let f=r(c);if(f){if(c.type==="line"&&c.network){if(l.has(c.network))continue;l.add(c.network),this.drawNetwork(e,t,o,r,c.network,i,u=>!u.overlay&&(a||!s(u))&&o.layerVisibleAt(u,i));continue}if(c.type==="surface"){if(!this.flattened(f,o,c))continue;this.drawFill(e,t,f,o,c,i);continue}c.type==="fill"?this.drawFill(e,t,f,o,c,i):this.drawLine(e,t,f,o,c,i);}}this.drawCustomRest(e,t,o);}drawCustomBefore(e,t,o){if(this.customLayers.length)for(let r of this.customLayers)r.before===o&&this.drawCustom(e,t,r.layer);}drawCustomRest(e,t,o){if(!this.customLayers.length)return;let r=new Set(o.layers.map(i=>i.id));for(let i of this.customLayers)i.before!==void 0&&r.has(i.before)||this.drawCustom(e,t,i.layer);}drawCustom(e,t,o){let r=e.gl;try{o.render(r,t.objectMatrix(0,0,0));}catch(i){console.warn(`[osmgl] \u0441\u0432\u043E\u0439 \u0441\u043B\u043E\u0439 \xAB${o.id}\xBB \u0443\u043F\u0430\u043B \u043F\u0440\u0438 \u043E\u0442\u0440\u0438\u0441\u043E\u0432\u043A\u0435:`,i instanceof Error?i.message:i);}e.resetState();}drapeTerrain(e,t,o,r,i,a){let s=o.get(De),l=this.terrainShader;if(!s||!l)return;let c=e.gl,f=r.background,u=this.terrain.tilesFor(t);if(!u.length)return;let h=this.terrain.sizesFor(t,u,this.dpr),d=0;this.drapePending=false;let m=Ws,p=Math.round(a*4)/4,b=new Set;for(let W=0;W<u.length;W++){let z=u[W],L=h[W];b.add(z.dataKey);let X=[p.toString()];for(let[ie,ee]of o)for(let ue of ee.visibleTiles)m(z,ue)&&X.push(`${ie}/${ue.dataKey}:${ee.getTile(ue)?.state??""}`);let Q=X.join(","),{target:G,fresh:Y}=this.terrain.targetFor(e,z.dataKey,L);if(G.key!==Q){if(d>=zb){Y&&G.clear(f),this.drapePending=true;continue}d++,G.key=Q,e.bindFramebuffer(G.framebuffer),e.viewport(0,0,L,L),c.clearColor(f[0],f[1],f[2],1),c.clear(c.COLOR_BUFFER_BIT),e.setDepthTest(false),e.setDepthMask(false),e.setBlend("premultiplied"),e.setCull("none"),e.setStencilTest(false),this.drapeTile={terrain:z},this.drawFlatLayers(e,t,r,i,a,true),this.drawFillHighlight(e,t,o,r),this.groundArrows&&(this.groundArrows.highlightFootprint=this.highlightFootprint(),this.groundArrows.render(e,t,o,r,this.fill,this.fillLocs,ie=>{this.applyFogUniforms(ie,t,r),ie.setVec4("u_globe",0,0,0,0),ie.setInt("u_material",0),ie.setFloat("u_elevation",0),ie.setVec2("u_world_origin",0,0);},this.shadowActive)),this.drawGroundShadow(e,t,o,r),this.drapeTile=null;}}this.terrain.keepOnly(b),e.bindFramebuffer(null),e.viewport(0,0,c.drawingBufferWidth,c.drawingBufferHeight),c.clearColor(f[0],f[1],f[2],1),l.use(),e.setDepthTest(true),e.setDepthFunc("lequal"),e.setDepthMask(true),e.setBlend("none"),e.setCull("none"),e.setStencilTest(false);let g=this.terrain.meshOf(e,this.terrainLocs);l.setInt("u_texture",0),this.applyFogUniforms(l,t,r);let y=r.spec.terrain?.tint,A=y?.low===void 0&&y?.high!==void 0,x=y?.high!==void 0,v=x?Ve(y.high)??[1,1,1,1]:[1,1,1,1],w=A?v:x?Ve(y.low)??[1,1,1,1]:[1,1,1,1],C=y?.mid?Ve(y.mid)??w:[0,1,2].map(W=>(w[W]+v[W])/2).concat(1),B=y?.range??[500,4e3],_=Math.min(Math.max((16-a)/3,0),1);l.setVec3("u_relief_low",w[0],w[1],w[2]),l.setVec3("u_relief_mid",C[0],C[1],C[2]),l.setVec3("u_relief_high",v[0],v[1],v[2]),l.setVec2("u_relief_range",B[0],B[1]),l.setVec3("u_relief_mix",(x?y.tint??.5:0)*_,(y?y.shade??.7:0)*(.35+.65*_),A?1:0);let T=r.light,[k,K,P]=Bo(T.keyAzimuth,T.keyAltitude);l.setVec3("u_relief_light",-k,-K,-P),g.vao.bind();for(let W of u){let z=this.terrain.targetOf(W.dataKey);z&&(this.terrain.apply(e,l,W),e.bindTexture(0,z.texture),l.setFloat("u_skirt",this.terrain.skirtMeters(W.z)),l.setFloat("u_tile_meters",ho(W.z)),l.setMat4("u_matrix",t.tileMatrix(W,1)),c.drawElements(c.TRIANGLES,g.count,c.UNSIGNED_INT,0));}e.bindVAO(null);}applyTileMatrix(e,t,o,r){if(this.drapeTile){let i=this.drapeTile.terrain,a=Math.pow(2,i.z-o.z),s=2*a/r,l=2*(o.x*a-i.x)-1,c=1-2*(o.y*a-i.y);e.setMat4("u_matrix",new Float32Array([s,0,0,0,0,-s,0,0,0,0,0,0,l,c,0,1]));return}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??Jo(t,o);if(r.intensity<=0){e.setVec3("u_fog_range",0,1,0),e.setVec2("u_fog_vertical",0,0),this.applyAtmosphere(e,t,o);return}Tt(e,"u_fog_color",o.sky.horizonColor),e.setVec3("u_fog_range",r.near,r.far,r.intensity);let[i,a]=o.sky.fogVerticalRange;e.setVec2("u_fog_vertical",i,a),this.applyAtmosphere(e,t,o);}drawsTile(e,t,o,r){if(this.drapeTile)return Ws(this.drapeTile.terrain,r);if(this.terrain.enabled&&!this.terrain.covers(r))return false;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,pe(i.paint.elevation,t.zoom,0)*this.reliefScale));let r=Math.max(Hb/Math.max(t.pixelsPerMeter,1e-9),Ob);return o-r}holesOf(e){return this.stampedHoles.size?e.holeTiles.filter(t=>this.stampedHoles.has(t.dataKey)):[]}clippedTiles(e){let t=this.holesOf(e);return t.length?[...t,...e.visibleTiles]:e.visibleTiles}beginYield(){this.yieldPass=true;}yieldFor(e,t,o){let r=o.yieldTo;if(!r||!this.yieldPass||this.drapeTile||t.globeActive)return false;let i=this.yieldSquares.get(r);return i?.length?(this.yieldMarked===r||(this.yieldMarked!==null&&this.clearYieldBit(e),this.stampYieldSquares(e,t,i),this.yieldMarked=r),true):false}endYield(e){this.yieldMarked!==null&&this.clearYieldBit(e),this.yieldMarked=null,this.yieldPass=false;}stampYieldSquares(e,t,o){if(!this.fill||!this.quad)return;let r=e.gl;e.setStencilTest(true),r.stencilMask(Dt),r.stencilFunc(r.ALWAYS,Dt,Dt),r.stencilOp(r.KEEP,r.KEEP,r.REPLACE),e.setColorMask(false);let i=this.fill;i.use(),i.setVec4("u_globe",0,0,0,0),i.setInt("u_material",0),i.setVec2("u_world_origin",0,0),i.setVec4("u_color",0,0,0,1),i.setFloat("u_elevation",0),this.quad.vao.bind();for(let a of o)i.setMat4("u_matrix",t.tileMatrix(a,1)),r.drawElements(r.TRIANGLES,6,r.UNSIGNED_SHORT,0);e.bindVAO(null),e.setColorMask(true),r.stencilOp(r.KEEP,r.KEEP,r.KEEP),r.stencilMask(255),e.setStencilTest(false);}clearYieldBit(e){e.gl.stencilMask(Dt),e.clear(null,false,true),e.gl.stencilMask(255);}clipLine(e,t,o){let r=this.stampedHoles.has(t.dataKey)&&!this.drapeTile?this.stencilIds.get(t.dataKey):void 0;if(r===void 0&&!o){e.setStencilTest(false);return}e.setStencilTest(true);let i=(r!==void 0?Ri:0)|(o?Dt:0);e.gl.stencilFunc(e.gl.EQUAL,r??0,i);}clipToTile(e,t){if(this.drapeTile){e.setStencilTest(false);return}let o=this.stencilIds.get(t.dataKey);e.setStencilTest(o!==void 0),o!==void 0&&e.gl.stencilFunc(e.gl.EQUAL,o,Ri);}drawTileStencil(e,t,o){if(this.stencilIds.clear(),this.stampedHoles.clear(),t.globeActive){e.gl.stencilMask(255),e.clear(null,false,true),e.setStencilTest(false);return}let r=o.get(De);if(!r||!this.fill||!this.quad)return;let i=r.holeTiles,a=i.length?[...i,...r.visibleTiles]:r.visibleTiles;if(!a.length||a.length>Ri)return;let s=e.gl;s.stencilMask(255),e.clear(null,false,true),e.setStencilTest(true),s.stencilOp(s.KEEP,s.KEEP,s.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 c=0;for(let f=0;f<a.length;f++){let u=a[f];c++,this.stencilIds.set(u.dataKey,c),f<i.length&&this.stampedHoles.add(u.dataKey),s.stencilFunc(s.ALWAYS,c,Ri),l.setMat4("u_matrix",t.tileMatrix(u,1)),s.drawElements(s.TRIANGLES,6,s.UNSIGNED_SHORT,0);}e.bindVAO(null),e.setColorMask(true),s.stencilOp(s.KEEP,s.KEEP,s.KEEP),e.setStencilTest(false);}drawEarthDepth(e,t,o,r){if(!this.fill||!this.quad||t.globeActive)return;let i=o.get(De);if(!i)return;let a=this.fill;a.use(),this.applyFogUniforms(a,t,r),a.setVec4("u_globe",0,0,0,0),a.setInt("u_material",0),a.setVec2("u_world_origin",0,0),a.setVec4("u_color",0,0,0,1),a.setFloat("u_elevation",0);let s=this.earthDepthLevel(r,t);e.gl.colorMask(false,false,false,false),e.setDepthTest(true),e.setDepthFunc("lequal"),e.setDepthMask(true),e.setCull("none"),e.gl.enable(e.gl.POLYGON_OFFSET_FILL),e.gl.polygonOffset(1,8),this.quad.vao.bind();let l=new Float32Array(16);for(let c of i.visibleTiles){let f=t.tileMatrix(c,1);l.set(f);for(let u=0;u<4;u++)l[12+u]+=s*f[8+u];a.setMat4("u_matrix",l),e.gl.drawElements(e.gl.TRIANGLES,6,e.gl.UNSIGNED_SHORT,0);}e.bindVAO(null),e.gl.disable(e.gl.POLYGON_OFFSET_FILL),e.gl.colorMask(true,true,true,true);}drawGroundShadow(e,t,o,r){if(!this.shadowActive||!this.groundShadow||!this.quad)return;let i=o.get(De);if(!i)return;let a=this.groundShadow;a.use(),this.applyShadowUniforms(a,true),this.applyFogUniforms(a,t,r);let s=r.light,[,,l]=Bo(s.keyAzimuth,s.keyAltitude),c=Math.max(-l,0),f=Ve(s.ambientColor),u=Ve(s.keyColor),h=[0,0,0];for(let d=0;d<3;d++){let m=f[d]*s.ambientIntensity,p=u[d]*s.keyIntensity*c;h[d]=m>0?m/(m+p):1;}a.setVec3("u_shadow_ground",h[0],h[1],h[2]),a.setFloat("u_ground_ndotl",c),e.setBlend("multiply"),e.setDepthTest(false),e.setDepthMask(false),e.setCull("none"),this.quad.vao.bind();for(let d of i.visibleTiles)this.drapeTile&&!Ws(this.drapeTile.terrain,d)||(a.setMat4("u_shadow_matrix",t.shadowTileMatrix(d,1)),this.applyTileMatrix(a,t,d,1),this.terrain.apply(e,a,d),e.gl.drawElements(e.gl.TRIANGLES,6,e.gl.UNSIGNED_SHORT,0));e.setBlend("premultiplied");}applyShadowUniforms(e,t=false){if(e.setInt("u_shadow_map",Gs),!this.shadowActive){e.setVec4("u_shadow_params",0,0,0,0);return}let o=this.shadowTarget?.size??1,i=(t?.25*this.shadowTexelMeters:Math.max(this.shadows.bias,1.5*this.shadowTexelMeters))*(this.shadowDepthPerMeter||1);e.setVec4("u_shadow_params",this.shadows.strength,1/o,i,1),e.setFloat("u_shadow_normal_offset",1.5*2/o);let a=Ve(this.shadows.color);e.setVec3("u_shadow_color",a[0],a[1],a[2]);}get shadowsActive(){return this.shadowActive}drawOverlay(e,t,o,r,i,a){let s=()=>{e.setDepthTest(false),e.setDepthMask(false),e.setBlend("premultiplied"),e.setCull("none");};s();for(let l of o.layers){if(l.type==="raster"||l.type==="symbol"||l.type==="fill-extrusion"||!l.overlay||(l.overlay===true?"volume":l.overlay)!==a||!o.layerVisibleAt(l,i))continue;let c=r(l);if(c){if(l.type==="surface"){this.flattened(c,o,l)?this.drawFill(e,t,c,o,l,i):this.drawSurface(e,t,c,o,l,i),s();continue}l.type==="fill"?this.drawFill(e,t,c,o,l,i):this.drawLine(e,t,c,o,l,i);}}}tileTint(e){let o=((e.x%3+3)%3*2+(e.y%2+2)%2)/6,r=i=>{let a=(i+o*6)%6;return 1-Math.max(0,Math.min(1,Math.min(a,4-a)))};return [r(5),r(3),r(1)]}applyTileScale(e,t,o,r){if(e.setFloat("u_extent",o),this.terrain.apply(r,e,t),this.debugTiles){let[c,f,u]=this.tileTint(t);e.setVec4("u_tile_tint",c,f,u,Wb);}else e.setVec4("u_tile_tint",0,0,0,0);let i=ho(t.z)/this.patternScale;e.setFloat("u_meters_per_unit",i/o);let[a,s]=Nl(t.z,t.x,t.y);e.setVec2("u_world_origin",a/this.patternScale,s/this.patternScale);let l=this.cameraMeters;e.setVec3("u_camera_local",l[0]-t.x*i,l[1]-t.y*i,l[2]);}applyMaterial(e,t,o){let r=t.paint&&"material"in t.paint?t.paint.material:void 0,i=this.detailScale<=0?0:Vb[r??"flat"]??0;if(e.setInt("u_material",i),i===0)return;let a=t.paint,s=pe(a.materialStrength,o,1)*this.detailScale,l=pe(a.materialScale,o,Ub[i]),c=pe(a.materialSpeed,o,i===1?1:0);e.setVec4("u_material_params",s,l,c,this.materialTime),c>0&&s>.004&&(this.materialAnimating=true);}drawFill(e,t,o,r,i,a){let s=this.fill,l=r.colorAt(i,a),c=pe(i.paint?.opacity,a,1);if(c<=.001)return;s.use(),this.applyFogUniforms(s,t,r),this.applyGlobeUniforms(s,t,r),this.applyLight(s,r),this.applyMaterial(s,i,a),s.setVec4v("u_color",it([l[0],l[1],l[2],l[3]*c])),s.setFloat("u_opacity",c);let f=jt(i)!==null,u=r.bucketKeyFor(i);if(u===null)return;let h=this.yieldTargets.has(i.id)?[]:null;for(let d of this.clippedTiles(o)){if(!this.drawsTile(t,r,i,d))continue;let m=o.getTile(d),p=m&&this.bucketFor(e,m,u,zs,this.fillLocs,"fill");if(h&&m&&Ai(m.state,!!p,!!m.data?.buckets?.[u])&&h.push(d),!p)continue;s.setFloat("u_data_color",f&&p.dataBuffer?1:0),this.clipToTile(e,d),this.shadowActive&&s.setMat4("u_shadow_matrix",t.shadowTileMatrix(d,p.extent)),this.applyTileScale(s,d,p.extent,e),this.applyTileMatrix(s,t,d,p.extent);let b=this.cutHidden(e,m,u,d.dataKey,p.buffer,this.replacedIds(),this.fillLocs,p.dataBuffer);b?(b.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,b.count,e.gl.UNSIGNED_INT,0)):(p.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,p.indexCount,p.indexType,0));}h&&this.yieldSquares.set(i.id,h),s.setFloat("u_data_color",0),e.setStencilTest(false);}drawLine(e,t,o,r,i,a,s=0,l){let c=this.line,f=r.colorAt(i,a),u=pe(i.paint.opacity,a,1)*(s||1),h=pe(i.paint.width,a,1);if(u<=.001||h<=.01&&!i.paint.widthMeters)return;let d=e.gl.drawingBufferWidth,m=e.gl.drawingBufferHeight,p=t.width>0?d/t.width:1,b=pe(i.paint.widthMeters,a,0),g=b>0?b*t.pixelsPerMeter*p/2:h/2*p,y=this.yieldFor(e,t,i);c.use();let A=i.depthTest===true&&this.yieldPass&&!this.drapeTile&&!t.globeActive;c.setFloat("u_depth_nudge",A?t.projZOffset*wh/(1-wh):0),A&&(e.setDepthTest(true),e.setDepthFunc("lequal"),e.setDepthMask(false)),this.applyShadowUniforms(c),this.applyFogUniforms(c,t,r),this.applyGlobeUniforms(c,t,r),this.applyLight(c,r),this.applyMaterial(c,i,a),c.setVec4v("u_color",it([f[0],f[1],f[2],f[3]*u])),c.setFloat("u_opacity",u);let x=jt(i);c.setFloat("u_center_w",t.cameraToCenterDistance);let v=pe(i.paint.offsetMeters,a,0),w=v!==0?v*t.pixelsPerMeter*p:pe(i.paint.offset,a,0)*p,C=Math.max(pe(i.paint.blur,a,0),0)*p,B=l!==void 0?Math.max(0,l)*r.lineLevelHeight():0;c.setFloat("u_elevation",(pe(i.paint.elevation,a,0)+B)*this.reliefScale),c.setFloat("u_relief",this.reliefScale),c.setVec2("u_viewport",d,m);let _=i.paint.dashArray,T=i.paint.dashMeters,k=i.paint.arrow===true,K=i.paint.arrowStyle,P=k&&(K==="head"||K==="headOnly"),W=k&&K==="dash";if(c.setInt("u_pattern",W?5:_||T?1:K==="headOnly"&&k?4:P?3:k?2:0),T){let[L,X]=T,Q=t.pixelsPerMeter*p;c.setVec2("u_dash",L*Q,(L+X)*Q);}else if(_){let[L,X]=_;c.setVec2("u_dash",L*p,(L+X)*p);}if(k){let L=ht(i.paint.arrowColor,a,[1,1,1,1]);c.setVec4v("u_arrow_color",it(L));let X=pe(i.paint.arrowPeriod,a,46)*p,Q=pe(i.paint.arrowSize,a,5)*p;if(W){let G=pe(i.paint.arrowGap,a,24)*p,Y=Math.max(X-G,1),ie=Math.min(Q,Y),ee=pe(i.paint.arrowShaft,a,2)*p,ue=pe(i.paint.arrowHead,a,4)*p,$=pe(i.paint.arrowOutline,a,0)*p;c.setVec4("u_arrow",ee,ie,ue,Y),c.setVec2("u_dash",$,X);}else P?c.setVec4("u_arrow",X,Q,g,0):c.setVec4("u_arrow",X,Math.max(Q*.4,1),Math.min(Q,g*.72),0);}let z=r.bucketKeyFor(i);if(z!==null){for(let L of this.clippedTiles(o)){if(!this.drawsTile(t,r,i,L))continue;let X=o.getTile(L);if(!X)continue;this.clipLine(e,L,y);let Q=i.network?l!==void 0?[Ot(i.id,l)]:(X.data?.levels??[]).map(G=>Ot(i.id,G)):[z];for(let G of Q){let Y=this.bucketFor(e,X,G,Ch,this.lineLocs,"line");if(!Y)continue;let ie=Y.dataBuffer?x:null;c.setFloat("u_data_color",ie&&(ie.color!==void 0||ie.opacity!==void 0)?1:0),c.setFloat("u_data_width",ie&&ie.width!==void 0?1:0);let ee=L.bounds(),ue=(ee.maxX-ee.minX)*t.worldSize/Y.extent*p;c.setFloat("u_tile_to_px",ue);let $=ue>1e-6?1/ue:1;c.setFloat("u_half_width",g*$),c.setFloat("u_blur",C*$),c.setFloat("u_meters_to_units",t.pixelsPerMeter*$),c.setFloat("u_width_from_data",i.paint.widthFromData===true?1:0),c.setFloat("u_width_extra",pe(i.paint.widthExtra,a,0)*$),c.setFloat("u_offset",w*$),c.setFloat("u_tile_per_px",$),c.setFloat("u_px_to_units",p*$),this.applyTileScale(c,L,Y.extent,e),this.shadowActive&&c.setMat4("u_shadow_matrix",t.shadowTileMatrix(L,Y.extent)),this.applyTileMatrix(c,t,L,Y.extent);let Ae=this.cutHidden(e,X,G,L.dataKey,Y.buffer,this.replacedIds(),this.lineLocs,Y.dataBuffer);Ae?(Ae.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,Ae.count,e.gl.UNSIGNED_INT,0)):(Y.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,Y.indexCount,Y.indexType,0));}}c.setFloat("u_data_color",0),c.setFloat("u_data_width",0),e.setStencilTest(false),A&&e.setDepthTest(false);}}drawNetwork(e,t,o,r,i,a,s){let l=o.layers.filter(f=>f.type==="line"&&f.network===i&&s(f));if(!l.length)return;let c=new Set;for(let f of l){let u=r(f);if(u)for(let h of this.clippedTiles(u)){let d=u.getTile(h);for(let m of d?.data?.levels??[])c.add(m);}}if(c.size)for(let f of [...c].sort((u,h)=>u-h))for(let u of l){let h=r(u);h&&this.drawLine(e,t,h,o,u,a,0,f);}}drawHighlight(e,t,o,r,i,a){let s=this.highlight;if(!s||!this.building||s.layerId!==i.id)return;let l=`${i.id}/${s.featureId}`;this.highlightKey!==l&&(this.disposeHighlight(),this.highlightKey=l);let c=Ve(s.color)??[.31,.79,.5,1],f=this.building;f.use(),this.applyShadowUniforms(f),this.applyFogUniforms(f,t,r),this.applyLight(f,r),f.setVec4v("u_wall_color",[c[0],c[1],c[2],1]),f.setVec4v("u_roof_color",[c[0],c[1],c[2],1]),f.setFloat("u_opacity",s.opacity),f.setFloat("u_ao_strength",pe(i.paint.aoStrength,a,.4)),f.setFloat("u_tint_variation",0),f.setFloat("u_facade_detail",0),f.setFloat("u_ice",0),f.setFloat("u_window_glow",0),f.setFloat("u_roof_variation",0),f.setFloat("u_height_scale",pe(i.paint.heightScale,a,1)),e.setDepthFunc("lequal"),e.setDepthMask(false),e.setBlend("alpha");let u=e.gl;e.setStencilTest(true),u.stencilFunc(u.NOTEQUAL,Dt,Dt),u.stencilOp(u.KEEP,u.KEEP,u.REPLACE),u.stencilMask(Dt);let h=this.seams.stitched.has(s.featureId);h&&this.drawSeamHighlight(e,t,f,s.featureId);for(let d of h?[]:o.visibleTiles){let m=o.getTile(d);if(!m)continue;let p=m.data?.buckets?.[i.id];if(!p)continue;let b=d.dataKey,g=this.highlightGpu.get(b);if(g===void 0){let y=Ii(m,i.id,s.featureId);if(y){let A=new Je(e,new Uint8Array(y.vertices),qo),x=new Ue(e,y.indices);g={vao:new Ne(e,[{buffer:A,locations:this.buildingLocs}],x),vbo:A,ibo:x,count:y.indices.length};}else g=null;this.highlightGpu.set(b,g);}g&&(this.applyTileScale(f,d,p.extent,e),this.shadowActive&&f.setMat4("u_shadow_matrix",t.shadowTileMatrix(d,p.extent)),f.setMat4("u_matrix",t.tileMatrix(d,p.extent)),g.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,g.count,e.gl.UNSIGNED_INT,0));}e.setStencilTest(false),u.stencilOp(u.KEEP,u.KEEP,u.KEEP),u.stencilMask(255),e.setBlend("none"),e.setDepthMask(true);}refreshHighlight(){this.disposeHighlight();}disposeHighlight(){for(let e of this.highlightGpu.values())e&&(e.vao.destroy(),e.vbo.destroy(),e.ibo.destroy());this.highlightGpu.clear(),this.highlightTris.clear(),this.highlightKey="";}syncHighlightFootprint(e,t){let o=this.highlight;if(!o){this.highlightTris.size&&this.highlightTris.clear();return}let r=`${o.layerId}/${o.featureId}`;this.footprintKey!==r&&(this.highlightTris.clear(),this.footprintKey=r);let i=t.layers.find(l=>l.id===o.layerId),a=e.get(i?.source??De);if(!a)return;let s=new Le;for(let l of a.visibleTiles){if(s.add(l.dataKey),this.highlightTris.has(l.dataKey))continue;let c=a.getTile(l),f=c?.data?.buckets?.[o.layerId];if(!c||!f)continue;let u=Ii(c,o.layerId,o.featureId);u&&this.highlightTris.set(l.dataKey,Cs(u,f.extent,l));}for(let l of [...this.highlightTris.keys()])s.has(l)||this.highlightTris.delete(l);}drawFillHighlight(e,t,o,r){let i=this.highlightFill,a=this.fill;if(!i||!a)return;let s=r.layers.find(h=>h.id===i.layerId),l=s?o.get(s.source??De):void 0;if(!s||!l)return;let c=i.bucketKey,f=Ve(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",it([f[0],f[1],f[2],i.opacity])),e.setDepthTest(false),e.setDepthMask(false),e.setBlend("premultiplied"),e.setCull("none");let u=e.gl;e.setStencilTest(true),u.stencilFunc(u.NOTEQUAL,Dt,Dt),u.stencilOp(u.KEEP,u.KEEP,u.REPLACE),u.stencilMask(Dt);for(let h of l.visibleTiles){let d=l.getTile(h),m=d?.data?.buckets?.[c];if(!d||!m||m.kind!=="fill"||!m.featureIds)continue;let p=this.fillHighlightFor(e,m,h,i.featureId,c);p&&(a.setMat4("u_matrix",t.tileMatrix(h,m.extent)),p.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,p.count,e.gl.UNSIGNED_INT,0));}e.setStencilTest(false),u.stencilOp(u.KEEP,u.KEEP,u.KEEP),u.stencilMask(255),e.bindVAO(null);}fillHighlightFor(e,t,o,r,i){let a=`${i}/${r}/${o.dataKey}`;this.fillHighlightKey!==`${i}/${r}`&&(this.fillHighlightGpu.forEach(h=>{h?.vao.destroy(),h?.ibo.destroy(),h?.vbo.destroy();}),this.fillHighlightGpu.clear(),this.fillHighlightKey=`${i}/${r}`);let s=this.fillHighlightGpu.get(a);if(s!==void 0)return s;let l=new Uint32Array(t.indices),c=new Float64Array(t.featureIds),f=[];for(let h=0;h*3<l.length;h++)c[h]===r&&f.push(l[h*3],l[h*3+1],l[h*3+2]);let u=null;if(f.length){let h=new Je(e,new Uint8Array(t.vertices),zs),d=new Ue(e,new Uint32Array(f));u={vao:new Ne(e,[{buffer:h,locations:this.fillLocs}],d),vbo:h,ibo:d,count:f.length};}return this.fillHighlightGpu.set(a,u),u}highlightFootprint(){return this.highlight&&this.highlightTris.size?[...this.highlightTris.values()]:this.indoorMask.footprint()}drawSurface(e,t,o,r,i,a){let s=this.surface,l=r.colorAt(i,a,[.7,.8,.7,1]),c=pe(i.paint.opacity,a,1);if(c<=.001)return;s.use(),this.applyShadowUniforms(s),this.applyFogUniforms(s,t,r),this.applyGlobeUniforms(s,t,r),this.applyLight(s,r),this.applyMaterial(s,i,a),s.setVec4v("u_color",l),s.setFloat("u_opacity",c),s.setFloat("u_side_shade",pe(i.paint.sideShade,a,.12));let f=i.elevation<(i.base??0),u=i.paint.sideColor?r.colorAt({...i,paint:{...i.paint,color:i.paint.sideColor}},a,l):l;s.setVec3("u_side_color",u[0],u[1],u[2]),s.setFloat("u_side_light",pe(i.paint.sideLight,a,f?1:0)),s.setFloat("u_relief",this.reliefScale),s.setFloat("u_lift_tone",pe(i.paint.liftTone,a,0)),s.setFloat("u_lift_tone_from",i.elevation+Nn),s.setFloat("u_lift_tone_height",i.paint.liftToneHeight??r.spec.levelHeight??8);let h=r.bucketKeyFor(i);if(h===null)return;let d=c>=1&&!i.overlay;e.setDepthMask(d),e.setBlend(d?"none":"premultiplied"),e.setCull("none");let m=[],p=this.yieldTargets.has(i.id)?[]:null;for(let y of this.clippedTiles(o)){if(!this.drawsTile(t,r,i,y))continue;let A=o.getTile(y),x=A&&this.bucketFor(e,A,h,Mh,this.surfaceLocs,"surface");x&&m.push({id:y,bucket:x,cut:A?this.cutSurface(e,A,h,y.dataKey,x.buffer,this.replacedIds()):null}),p&&A&&Ai(A.state,!!x,!!A.data?.buckets?.[h])&&p.push(y);}p&&this.yieldSquares.set(i.id,p);let b=(y,A,x)=>{this.clipToTile(e,y),this.applyTileScale(s,y,A.extent,e),this.shadowActive&&s.setMat4("u_shadow_matrix",t.shadowTileMatrix(y,A.extent)),this.applyTileMatrix(s,t,y,A.extent),(x??A).vao.bind();},g=m.filter(({bucket:y,cut:A})=>A?A.capCount>0:y.capIndexOffset<y.indexCount);if(g.length){e.setColorMask(false),e.setDepthMask(true);for(let{id:y,bucket:A,cut:x}of g){b(y,A,x);let v=x?e.gl.UNSIGNED_INT:A.indexType,w=v===e.gl.UNSIGNED_INT?4:2;e.gl.drawElements(e.gl.TRIANGLES,x?x.capCount:A.indexCount-A.capIndexOffset,v,(x?x.mainCount:A.capIndexOffset)*w);}e.setColorMask(true),e.setDepthMask(d);}for(let{id:y,bucket:A,cut:x}of m)b(y,A,x),e.gl.drawElements(e.gl.TRIANGLES,x?x.mainCount:A.capIndexOffset,x?e.gl.UNSIGNED_INT:A.indexType,0);e.setCull("back"),e.setDepthMask(true),e.setBlend("none");}drawBuildings(e,t,o,r,i,a,s){let l=this.building,c=r.colorAt(i,a,[.86,.84,.8,1]),f=i.paint.roofColor?r.colorAt({...i,paint:{...i.paint,color:i.paint.roofColor}},a,c):c,u=pe(i.paint.opacity,a,1);if(u<=.001)return false;l.use(),this.applyShadowUniforms(l),this.applyFogUniforms(l,t,r),l.setVec4v("u_wall_color",c),l.setVec4v("u_roof_color",f),l.setFloat("u_opacity",u),l.setFloat("u_ao_strength",pe(i.paint.aoStrength,a,.4)),l.setFloat("u_tint_variation",pe(i.paint.tintVariation,a,.07));let h=jt(i)!==null,d=(v,w)=>i.paint[v]?r.colorAt({...i,paint:{...i.paint,color:i.paint[v]}},a,w):w,m=d("windowColor",[.62,.71,.8,1]),p=d("windowFrameColor",[c[0]*1.1,c[1]*1.1,c[2]*1.1,1]);l.setVec3("u_window_color",m[0],m[1],m[2]),l.setVec3("u_window_frame",p[0],p[1],p[2]),l.setFloat("u_facade_detail",pe(i.paint.facadeDetail,a,1)*this.detailScale),l.setFloat("u_window_glow",pe(i.paint.windowGlow,a,0)),l.setFloat("u_floor_height",pe(i.paint.floorHeight,a,3.2)),l.setFloat("u_window_variation",pe(i.paint.windowVariation,a,1)),l.setFloat("u_seam_strength",pe(i.paint.seamStrength,a,1)),l.setFloat("u_ice",pe(i.paint.ice,a,0)),l.setFloat("u_window_recess",pe(i.paint.windowRecess,a,.18)),l.setFloat("u_window_recess_shade",pe(i.paint.windowRecessShade,a,.16)),l.setFloat("u_plinth_height",pe(i.paint.plinthHeight,a,4)),l.setFloat("u_plinth_shade",pe(i.paint.plinthShade,a,.14)),l.setFloat("u_roof_variation",pe(i.paint.roofVariation,a,.3)),this.applyLight(l,r);let b=u>=1;e.setDepthMask(b),e.setBlend(b?"none":"premultiplied");let g=pe(i.paint.heightScale,a,1),y=false,A=r.bucketKeyFor(i);if(A===null)return y;let x=(i.source??De)===De;x&&this.indoorMask.prepare(o,A);for(let v of o.visibleTiles){if(!this.drawsTile(t,r,i,v))continue;let w=o.getTile(v),C=w&&this.bucketFor(e,w,A,qo,this.buildingLocs,"fill-extrusion");if(!C)continue;l.setFloat("u_data_color",h&&C.dataBuffer?1:0);let B=this.growScale(C,s,!o.warm);B<1&&(y=true),l.setFloat("u_height_scale",B*g),this.applyTileScale(l,v,C.extent,e),this.shadowActive&&l.setMat4("u_shadow_matrix",t.shadowTileMatrix(v,C.extent)),l.setMat4("u_matrix",t.tileMatrix(v,C.extent));let T=this.cutHidden(e,w,A,v.dataKey,C.buffer,this.hiddenFor(A,x,v.dataKey),this.buildingLocs,C.dataBuffer)??(w&&x?this.indoorMask.indicesFor(e,w,A,v,C.buffer,this.buildingLocs):null);T?(T.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,T.count,e.gl.UNSIGNED_INT,0)):(C.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,C.indexCount,C.indexType,0));}return x&&(l.setFloat("u_data_color",0),this.drawSeams(e,t,l,g)),l.setFloat("u_data_color",0),y}drawSeamHighlight(e,t,o,r){for(let[i,{tile:a,mesh:s}]of this.seams.meshes){let l=`${i}\u241F${r}`,c=this.highlightGpu.get(l);if(c===void 0){let f=Is(s,r);if(f){let u=new Je(e,new Uint8Array(f.vertices),qo),h=new Ue(e,f.indices);c={vao:new Ne(e,[{buffer:u,locations:this.buildingLocs}],h),vbo:u,ibo:h,count:f.indices.length};}else c=null;this.highlightGpu.set(l,c);}c&&(this.applyTileScale(o,a,s.extent,e),this.shadowActive&&o.setMat4("u_shadow_matrix",t.shadowTileMatrix(a,s.extent)),o.setMat4("u_matrix",t.tileMatrix(a,s.extent)),c.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,c.count,e.gl.UNSIGNED_INT,0));}}drawSeams(e,t,o,r){for(let[i,{tile:a,mesh:s}]of this.seams.meshes){let l=this.seamBucket(e,i,s);o.setFloat("u_height_scale",r),this.applyTileScale(o,a,s.extent,e),this.shadowActive&&o.setMat4("u_shadow_matrix",t.shadowTileMatrix(a,s.extent)),o.setMat4("u_matrix",t.tileMatrix(a,s.extent)),l.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,s.indexCount,e.gl.UNSIGNED_INT,0);}}seamBucket(e,t,o){let r=this.seamGpu.get(t);if(!r){let i=new Je(e,new Uint8Array(o.vertices),qo),a=new Ue(e,new Uint32Array(o.indices)),s=new Ne(e,[{buffer:i,locations:this.buildingLocs}],a);r=new Pi(s,i,a,o.indexCount,e.gl.UNSIGNED_INT,o.extent),this.seamGpu.set(t,r);}return r}syncSeamGpu(){for(let e of this.seams.changed){let t=this.seamGpu.get(e);t&&(t.destroy(),this.seamGpu.delete(e));for(let o of [...this.highlightGpu.keys()]){if(!o.startsWith(e+"\u241F"))continue;let r=this.highlightGpu.get(o);r&&(r.vao.destroy(),r.vbo.destroy(),r.ibo.destroy()),this.highlightGpu.delete(o);}}}growScale(e,t,o=true){if(e.firstDrawTime===0&&(e.firstDrawTime=t),!o||this.growDurationMs<=0)return 1;let r=(t-e.firstDrawTime)/this.growDurationMs;return r<1?Jb(Math.max(r,0)):1}applyLight(e,t){let o=t.light;Tt(e,"u_ambient_color",o.ambientColor),e.setFloat("u_ambient_intensity",o.ambientIntensity);let[r,i,a]=Bo(o.keyAzimuth,o.keyAltitude);e.setVec3("u_key_dir",r,i,a),Tt(e,"u_key_color",o.keyColor),e.setFloat("u_key_intensity",o.keyIntensity);let[s,l,c]=Bo(o.fillAzimuth,o.fillAltitude);e.setVec3("u_fill_dir",s,l,c),Tt(e,"u_fill_color",o.fillColor),e.setFloat("u_fill_intensity",o.fillIntensity);}flattened(e,t,o){let r=t.bucketKeyFor(o);if(r===null)return false;for(let i of e.visibleTiles){let a=e.getTile(i)?.data?.buckets?.[r];if(a)return a.kind==="fill"}return false}bucketFor(e,t,o,r,i,a){let s=t.buckets.get(o);if(s)return s;let l=t.data?.buckets?.[o];if(!l||l.kind==="symbol"||l.kind==="placement")return null;if(l.kind!==a)return Pb(`\u0441\u043B\u043E\u0439 ${o}: \u0432 \u0442\u0430\u0439\u043B\u0435 \u043C\u0435\u0448 \xAB${l.kind}\xBB, \u0430 \u0440\u0438\u0441\u0443\u044E\u0442 \u043A\u0430\u043A \xAB${a}\xBB \u2014 \u043F\u0440\u043E\u043F\u0443\u0449\u0435\u043D`),null;if(this.uploadLeft<=0)return this.uploadDeferred=true,null;this.uploadLeft-=l.vertices.byteLength+l.indices.byteLength;let c=new Je(e,new Uint8Array(l.vertices),r),f=new Ue(e,new Uint32Array(l.indices)),u=l.dataPaint?new Je(e,new Uint8Array(l.dataPaint),Bh):null,h=new Ne(e,u?[{buffer:c,locations:i},{buffer:u,locations:i}]:[{buffer:c,locations:i}],f),d=new Pi(h,c,f,f.count,f.type,l.extent,l.capIndexOffset??f.count,u);return t.buckets.set(o,d),d}destroy(e){this.disposeHighlight(),this.fill?.destroy(),this.surface?.destroy(),this.line?.destroy(),this.objectLine?.destroy(),this.building?.destroy(),this.symbols?.destroy(e),this.models.destroy(e.gl),this.shadowTarget?.destroy(),this.shadowTarget=null,this.shadowPlaceholder&&e.gl.deleteTexture(this.shadowPlaceholder),this.shadowPlaceholder=null,this.quad&&(this.quad.vao.destroy(),this.quad.vbo.destroy(),this.quad.ibo.destroy(),this.quad=null),this.globeMesh&&(this.globeMesh.vao.destroy(),this.globeMesh.vbo.destroy(),this.globeMesh.ibo.destroy(),this.globeMesh=null),this.fill=this.line=this.building=null,this.objectLine=null;}},Hi=new fe;function Kb(n,e){let r=new Float32Array(66306),i=0;for(let h=0;h<=128;h++){let d=(h/128-.5)*Math.PI;for(let m=0;m<=256;m++)r[i++]=m/256*2*Math.PI-Math.PI,r[i++]=d;}let a=new Uint16Array(256*128*6),s=0;for(let h=0;h<128;h++)for(let d=0;d<256;d++){let m=h*257+d,p=m+256+1;a[s++]=m,a[s++]=m+1,a[s++]=p,a[s++]=m+1,a[s++]=p+1,a[s++]=p;}let l={stride:8,attribs:[{name:"a_lnglat",size:2,type:$o,offset:0}]},c=new fe([["a_lnglat",e.attribLocation("a_lnglat")]]),f=new Je(n,r,l),u=new Ue(n,a);return {vao:new Ne(n,[{buffer:f,locations:c}],u),vbo:f,ibo:u,count:a.length}}function Xb(n,e){if(e.highColor){Tt(n,"u_high_color",e.highColor);return}let t=Hi.get(e.skyColor);t||(t=Ve(e.skyColor),Hi.set(e.skyColor,t)),n.setVec3("u_high_color",t[0]*.6,t[1]*.74,Math.min(1,t[2]*.99+.02));}function Tt(n,e,t){let o=Hi.get(t);o||(o=Ve(t),Hi.set(t,o)),n.setVec3(e,o[0],o[1],o[2]);}function Bo(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 Jb(n){let o=n-1;return 1+2.20158*o*o*o+1.20158*o*o}var Oi=1,on=class{constructor(e=1024){this.entries=new fe;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+Oi>this.size&&(this.shelfY+=this.shelfHeight+Oi,this.shelfX=0,this.shelfHeight=0),this.shelfY+r+Oi>this.size)return this.full||console.warn("[osmgl] \u0430\u0442\u043B\u0430\u0441 SDF \u0437\u0430\u043F\u043E\u043B\u043D\u0435\u043D, \u043D\u043E\u0432\u044B\u0435 \u0441\u0438\u043C\u0432\u043E\u043B\u044B \u043D\u0435 \u0434\u043E\u0431\u0430\u0432\u043B\u044F\u044E\u0442\u0441\u044F"),this.full=true,null;let a={x:this.shelfX,y:this.shelfY,width:o,height:r};for(let s=0;s<r;s++){let l=s*o,c=(a.y+s)*this.size+a.x;this.data.set(t.subarray(l,l+o),c);}return this.shelfX+=o+Oi,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 Gi=1,rn=class{constructor(e=1024){this.images=new fe;this.entries=new fe;this.texture=null;this.dirty=true;this.shelfX=0;this.shelfY=0;this.shelfHeight=0;this.full=false;this.version=0;this.size=e,this.data=new Uint8Array(e*e*4);}has(e){return this.images.has(e)}get(e){return this.images.get(e)}list(){return [...this.images.keys()]}add(e,t,o={}){return this.images.has(e)?false:(this.images.set(e,{id:e,width:t.width,height:t.height,data:t.data instanceof Uint8Array?t.data:new Uint8Array(t.data),pixelRatio:o.pixelRatio??1,sdf:o.sdf??false}),this.version++,true)}update(e,t,o={}){let r=this.images.get(e);return r?(this.images.set(e,{id:e,width:t.width,height:t.height,data:t.data instanceof Uint8Array?t.data:new Uint8Array(t.data),pixelRatio:o.pixelRatio??r.pixelRatio,sdf:o.sdf??r.sdf}),this.entries.delete(e),this.version++,true):false}remove(e){return this.images.delete(e)?(this.entries.delete(e),this.version++,true):false}entryFor(e){let t=this.entries.get(e);if(t)return t;let o=this.images.get(e);if(!o||this.full)return null;let{width:r,height:i}=o;if(r>this.size||i>this.size)return null;if(this.shelfX+r+Gi>this.size&&(this.shelfY+=this.shelfHeight+Gi,this.shelfX=0,this.shelfHeight=0),this.shelfY+i+Gi>this.size)return this.full||console.warn("[osmgl] \u0430\u0442\u043B\u0430\u0441 \u043A\u0430\u0440\u0442\u0438\u043D\u043E\u043A \u0437\u0430\u043F\u043E\u043B\u043D\u0435\u043D, \u043D\u043E\u0432\u044B\u0435 \u043D\u0435 \u0434\u043E\u0431\u0430\u0432\u043B\u044F\u044E\u0442\u0441\u044F"),this.full=true,null;let a=this.shelfX,s=this.shelfY;for(let c=0;c<i;c++){let f=c*r*4,u=((s+c)*this.size+a)*4;this.data.set(o.data.subarray(f,f+r*4),u);}this.shelfX+=r+Gi,this.shelfHeight=Math.max(this.shelfHeight,i),this.dirty=true;let l={x:a,y:s,width:r,height:i};return this.entries.set(e,l),l}bind(e,t){let o=e.gl;this.texture||(this.texture=o.createTexture(),e.bindTexture(t,this.texture),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),e.bindTexture(t,this.texture),this.dirty&&(o.pixelStorei(o.UNPACK_ALIGNMENT,4),o.texImage2D(o.TEXTURE_2D,0,o.RGBA,this.size,this.size,0,o.RGBA,o.UNSIGNED_BYTE,this.data),this.dirty=false);}destroy(e){this.texture&&e.gl.deleteTexture(this.texture),this.texture=null;}};var an=.75,tr=8,Ke=3,Gt=24,er=256,Eh=255,nn=class{constructor(e,t="Noto Sans Regular"){this.urlTemplate=e;this.fontstack=t;this.glyphs=new fe;this.loaded=new Le;this.inflight=new fe;}setUrl(e){e!==this.urlTemplate&&(this.urlTemplate=e,this.glyphs.clear(),this.loaded.clear());}get(e){return this.glyphs.get(e)}hasRange(e){return this.loaded.has(Math.floor(e/er))}needsLoad(e){for(let t of e){let o=t.codePointAt(0);if(o===void 0)continue;let r=Math.floor(o/er);if(r<=Eh&&!this.loaded.has(r))return true}return false}async ensure(e){let t=new Le;for(let o of e){let r=o.codePointAt(0);if(r===void 0)continue;let i=Math.floor(r/er);i>Eh||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*er}-${e*er+er-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 Sh(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 Sh(n){let e=new yo(n instanceof Uint8Array?n:new Uint8Array(n)),t=[];return e.readFields((o,r,i)=>{if(o!==1||!i)return;let a=i.readVarint()+i.pos;i.readFields((s,l,c)=>{if(s!==3||!c)return;let f=c.readVarint()+c.pos,u={id:0,bitmap:null,width:0,height:0,left:0,top:0,advance:0};c.readFields((h,d,m)=>{m&&(h===1?u.id=m.readVarint():h===2?u.bitmap=m.readBytes():h===3?u.width=m.readVarint():h===4?u.height=m.readVarint():h===5?u.left=m.readSVarint():h===6?u.top=m.readSVarint():h===7&&(u.advance=m.readVarint()));},null,f),t.push(u);},null,a);},null),t}var jb=.25,or=1e20;function Ns(n,e,t){let o=e+Ke*2,r=t+Ke*2,i=o*r,a=new Float64Array(i),s=new Float64Array(i);a.fill(or),s.fill(0);for(let c=0;c<t;c++)for(let f=0;f<e;f++){let u=n[c*e+f]/255,h=(c+Ke)*o+(f+Ke);if(u>=1)a[h]=0,s[h]=or;else if(u>0){let d=.5-u;a[h]=d>0?d*d:0,s[h]=d<0?d*d:0;}else a[h]=or,s[h]=0;}Fh(a,o,r),Fh(s,o,r);let l=new Uint8Array(i);for(let c=0;c<i;c++){let f=Math.sqrt(a[c])-Math.sqrt(s[c]);l[c]=Yb(Math.round(255-255*(f/tr+jb)));}return {data:l,width:o,height:r}}function Fh(n,e,t){let o=Math.max(e,t),r=new Float64Array(o),i=new Float64Array(o),a=new Int32Array(o),s=new Float64Array(o+1);for(let l=0;l<e;l++){for(let c=0;c<t;c++)r[c]=n[c*e+l];Ih(r,i,a,s,t);for(let c=0;c<t;c++)n[c*e+l]=i[c];}for(let l=0;l<t;l++){for(let c=0;c<e;c++)r[c]=n[l*e+c];Ih(r,i,a,s,e);for(let c=0;c<e;c++)n[l*e+c]=i[c];}}function Ih(n,e,t,o,r){t[0]=0,o[0]=-or,o[1]=or;for(let i=1,a=0;i<r;i++){let s=0;do{let l=t[a];s=(n[i]-n[l]+i*i-l*l)/(i-l)/2;}while(s<=o[a]&&--a>-1);a++,t[a]=i,o[a]=s,o[a+1]=or;}for(let i=0,a=0;i<r;i++){for(;o[a+1]<i;)a++;let s=t[a];e[i]=(i-s)*(i-s)+n[s];}}var Yb=n=>n<0?0:n>255?255:n;var Dh=48,sn=class{constructor(e={}){this.defs=e;this.sdfs=new fe;this.pending=new Le;this.failed=new Le;}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(Dh*(i>1?i:1))),s=Math.max(8,Math.round(Dh/(i<1?i:1))),l=await Zb(o,a,s);return this.sdfs.set(e,Ns(l,a,s)),!0}catch(o){return this.failed.add(e),console.warn(`[osmgl] \u0438\u043A\u043E\u043D\u043A\u0430 \xAB${e}\xBB \u043D\u0435 \u0440\u0430\u0441\u0442\u0435\u0440\u0438\u0437\u043E\u0432\u0430\u043B\u0430\u0441\u044C:`,o instanceof Error?o.message:o),false}finally{this.pending.delete(e);}}};async function Zb(n,e,t){let o=n.includes("width=")?n:n.replace("<svg",`<svg width="${e}" height="${t}"`),r=new Blob([o],{type:"image/svg+xml;charset=utf-8"}),i=URL.createObjectURL(r);try{let a=new Image;a.width=e,a.height=t,await new Promise((u,h)=>{a.onload=()=>u(),a.onerror=()=>h(new Error("\u043D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u0434\u0435\u043A\u043E\u0434\u0438\u0440\u043E\u0432\u0430\u0442\u044C SVG")),a.src=i;});let s=document.createElement("canvas");s.width=e,s.height=t;let l=s.getContext("2d",{willReadFrequently:!0});if(!l)throw new Error("\u043D\u0435\u0442 2D-\u043A\u043E\u043D\u0442\u0435\u043A\u0441\u0442\u0430");l.clearRect(0,0,e,t),l.drawImage(a,0,0,e,t);let c=l.getImageData(0,0,e,t).data,f=new Uint8ClampedArray(e*t);for(let u=0;u<f.length;u++)f[u]=c[u*4+3];return f}finally{URL.revokeObjectURL(i);}}var Mo={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>',"frame-pin":'<svg viewBox="0 0 20.6 24" xmlns="http://www.w3.org/2000/svg"><path d="M3.87 17.2A9.43 9.43 0 1 1 16.7 17.2L10.29 23.14Z"/></svg>',"frame-circle-soft":'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><circle cx="12" cy="12" r="7.2"/></svg>',"frame-pin-soft":'<svg viewBox="0 0 20.6 24" xmlns="http://www.w3.org/2000/svg"><path transform="translate(4.12 4.8) scale(0.6)" d="M3.87 17.2A9.43 9.43 0 1 1 16.7 17.2L10.29 23.14Z"/></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 8 24" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" d="M3 1h2a2.5 2.5 0 0 1 2.5 2.5v11.5A2.5 2.5 0 0 1 5 17.5h-.1v3.9a.9.9 0 0 1-1.8 0v-3.9H3A2.5 2.5 0 0 1 .5 15V3.5A2.5 2.5 0 0 1 3 1zm1 2.6a1.7 1.7 0 1 0 0 3.4 1.7 1.7 0 0 0 0-3.4zm0 4.5a1.7 1.7 0 1 0 0 3.4 1.7 1.7 0 0 0 0-3.4zm0 4.5a1.7 1.7 0 1 0 0 3.4 1.7 1.7 0 0 0 0-3.4z"/></svg>',traffic_light_pole:'<svg viewBox="0 0 8 24" xmlns="http://www.w3.org/2000/svg"><rect x="3.1" y="15.5" width="1.8" height="5.9" rx=".9"/></svg>',traffic_light_body:'<svg viewBox="0 0 8 24" xmlns="http://www.w3.org/2000/svg"><rect x=".5" y="1" width="7" height="16.5" rx="2.5"/></svg>',traffic_light_red:'<svg viewBox="0 0 8 24" xmlns="http://www.w3.org/2000/svg"><circle cx="4" cy="5.2" r="2"/></svg>',traffic_light_amber:'<svg viewBox="0 0 8 24" xmlns="http://www.w3.org/2000/svg"><circle cx="4" cy="9.7" r="2"/></svg>',traffic_light_green:'<svg viewBox="0 0 8 24" xmlns="http://www.w3.org/2000/svg"><circle cx="4" cy="14.2" r="2"/></svg>',road_closed:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M4 10.1h16v3.8H4z"/></svg>',gate:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M2 4h3v16H2V4zm17 0h3v16h-3V4zM6 8h12v2H6V8zm0 5h12v2H6v-2z"/></svg>',toilets:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M6 2a2 2 0 1 1 0 4 2 2 0 0 1 0-4zM4 7h4l2 7H8v8H4v-8H2l2-7zm12-5a2 2 0 1 1 0 4 2 2 0 0 1 0-4zm-3 5h6l1 8h-2v7h-4v-7h-2l1-8z"/></svg>',drinking_water:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2c4 5 6 8 6 11a6 6 0 0 1-12 0c0-3 2-6 6-11zm0 5c-2 3-3 4.6-3 6a3 3 0 0 0 6 0c0-1.4-1-3-3-6z"/></svg>',waste_basket:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M9 2h6l1 2h4v3H4V4h4l1-2zM5 8h14l-1 14H6L5 8zm4 3v8h2v-8H9zm4 0v8h2v-8h-2z"/></svg>',recycling:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2l4 7h-3v4h-2V9H8l4-7zM3 18l3-6 2 1-1.4 2.5H10v2H6.6L8 20l-2 1-3-3zm18 0-3 3-2-1 1.4-2.5H14v-2h3.4L16 13l2-1 3 6z"/></svg>',campsite:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2l9 18h-4l-5-10-5 10H3L12 2zm0 9 5 9H7l5-9z"/></svg>',shelter:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2l10 8-1.5 2L19 11v9H5v-9l-1.5 1L2 10l10-8zm0 3.5L7 9.5V18h10V9.5l-5-4z"/></svg>',fire_station:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M13 2c0 3-4 4-4 8 0 1 .4 2 1 2.6C9.4 11 10 9.5 11 9c0 2 3 3 3 6a3.5 3.5 0 0 1-1 2.5c2.5-.6 4-2.8 4-5.5 0-5-4-7-4-10zM7 15c0 4 2.5 7 5 7s5-3 5-7c0 2-1 3-2 3.5.3-.6.5-1.2.5-2 0-2.5-2-3.5-2.5-5.5-1 1-2 2.5-2 4 0 .8.2 1.5.6 2C10.2 17.5 9 16.5 9 15H7z"/></svg>',prison:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M3 3h2v18H3V3zm4 0h2v18H7V3zm4 0h2v18h-2V3zm4 0h2v18h-2V3zm4 0h2v18h-2V3zM2 10h20v2H2v-2z"/></svg>',cemetery:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2c3 0 5 2 5 5v13H7V7c0-3 2-5 5-5zm-1 3v2H9v2h2v7h2v-7h2V7h-2V5h-2zM5 21h14v2H5v-2z"/></svg>',basin:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M2 8c2 0 2 2 5 2s3-2 5-2 3 2 5 2 3-2 5-2v3c-2 0-2 2-5 2s-3-2-5-2-3 2-5 2-3-2-5-2V8zm0 7c2 0 2 2 5 2s3-2 5-2 3 2 5 2 3-2 5-2v3c-2 0-2 2-5 2s-3-2-5-2-3 2-5 2-3-2-5-2v-3z"/></svg>',"shield-2":'<svg viewBox="0 0 32 24" xmlns="http://www.w3.org/2000/svg"><rect x="1" y="3" width="30" height="18" rx="4"/></svg>',"shield-3":'<svg viewBox="0 0 41 24" xmlns="http://www.w3.org/2000/svg"><rect x="1" y="3" width="39" height="18" rx="4"/></svg>',"shield-4":'<svg viewBox="0 0 50 24" xmlns="http://www.w3.org/2000/svg"><rect x="1" y="3" width="48" height="18" rx="4"/></svg>',"shield-5":'<svg viewBox="0 0 59 24" xmlns="http://www.w3.org/2000/svg"><rect x="1" y="3" width="57" height="18" rx="4"/></svg>',"shield-6":'<svg viewBox="0 0 68 24" xmlns="http://www.w3.org/2000/svg"><rect x="1" y="3" width="66" height="18" rx="4"/></svg>',"shield-7":'<svg viewBox="0 0 77 24" xmlns="http://www.w3.org/2000/svg"><rect x="1" y="3" width="75" height="18" rx="4"/></svg>',"shield-8":'<svg viewBox="0 0 86 24" xmlns="http://www.w3.org/2000/svg"><rect x="1" y="3" width="84" height="18" rx="4"/></svg>'},qb={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(qb)){let t=Mo[e];t?Mo[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 Qb=1.2;function Vs(n,e,t=16,o=0){let r=$b(n,t),i=[],a=[],s=0;for(let f of r){let u=0,h=0;for(let d of f){let m=d.codePointAt(0);if(m===void 0)continue;let p=e.get(m);p&&(u+=p.advance,h++);}h>1&&(u+=o*(h-1)),a.push(u),u>s&&(s=u);}if(s===0)return null;let l=Gt*Qb,c=r.length*l;for(let f=0;f<r.length;f++){let u=-a[f]/2,h=-c/2+f*l+l/2;for(let d of r[f]){let m=d.codePointAt(0);if(m===void 0)continue;let p=e.get(m);p&&(p.width>0&&p.height>0&&p.bitmap&&i.push({glyph:p,x:u,y:h}),u+=p.advance+o);}}return i.length?{glyphs:i,width:s,height:c}:null}function $b(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)}var eg=[0,.25,-0.25,.5,-0.5,.75,-0.75,1,-1];function Us(n,e,t,o={}){if(n.length<2||!e.length||t<=0)return [];let r=ng(n),i=r[r.length-1];if(i<t)return [];let a=o.maxAngle??25,s=o.stableScale&&o.stableScale>0?o.stableScale:1,l=i*s,c=o.fontSize?o.fontSize*.6:t/e.length,f=(o.fontSize??0)*.85,u=[],h=o.spacing??250,d=h>0&&h-t<h*.25?t+h*.25:h;if(o.accept&&o.atList){let p=[];for(let b of o.atList){if(p.length>=24)break;if(b<0||b+t>i)continue;let g=zi(n,r,e,t,b,c,a,f);if(!g)continue;let y={glyphs:g,path:g.map(A=>({x:A.x,y:A.y})),at:b};o.accept(y)&&p.push(y);}return p}if(o.accept)return tg(n,r,e,t,d,c,a,f,o.accept,o.offset??0,o.keepAt??[]);if(d>0&&l>=t+d){let p=Math.min(Math.floor((l-t)/d)+1,24),b=t+d*(p-1),g=(l-b)/2;for(let y=0;y<p;y++,g+=d){let A=g/s,x=zi(n,r,e,t,A,c,a,f);x&&u.push({glyphs:x,path:x.map(v=>({x:v.x,y:v.y})),at:A});}if(u.length)return u}let m=(i-t)/2;for(let p of eg){let b=m+m*p,g=zi(n,r,e,t,b,c,a,f);if(g)return [{glyphs:g,path:g.map(y=>({x:y.x,y:y.y})),at:b}];if(m===0)break}return []}function tg(n,e,t,o,r,i,a,s,l,c,f){let u=e[e.length-1],h=Math.max(o/3,r/8,12),d=[],m=[],p=g=>{if(g<0||g+o>u)return false;for(let x of m)if(Math.abs(x-g)<r)return false;let y=zi(n,e,t,o,g,i,a,s);if(!y)return false;let A={glyphs:y,path:y.map(x=>({x:x.x,y:x.y})),at:g};return l(A)?(d.push(A),m.push(g),true):false};for(let g of f){if(d.length>=24)break;p(g-c);}let b=(-c%h+h)%h;for(let g=b;g+o<=u&&!(d.length>=24);g+=h)p(g);return d}function zi(n,e,t,o,r,i,a,s){if(r<0||r+o>e[e.length-1]||!og(n,e,r,r+o,i,a))return null;let l=ln(n,e,r),c=ln(n,e,r+o);if(!l||!c)return null;if(c.x>=l.x)return Th(n,e,t,r,s);let f=e[e.length-1];return Th([...n].reverse(),ig(e),t,f-(r+o),s)}function og(n,e,t,o,r,i){if(r<=0)return true;let a=[],s=0;for(let l=1;l+1<n.length;l++){let c=e[l];if(c<=t)continue;if(c>=o)break;let f=Math.atan2(n[l].y-n[l-1].y,n[l].x-n[l-1].x),u=Math.atan2(n[l+1].y-n[l].y,n[l+1].x-n[l].x),h=Math.abs((u-f)*180/Math.PI+540)%360-180,d=Math.abs(h);for(a.push({at:c,delta:d}),s+=d;a.length&&c-a[0].at>r;)s-=a.shift().delta;if(s>i)return false}return true}function Th(n,e,t,o,r){let i=[];for(let c of t){let f=kh(n,e,o+c.offset,c.width);if(!f)return null;i.push(f);}if(!i.length)return null;if(r<=0)return i;let a=[],s=o,l=0;for(let c=0;c<t.length;c++){if(c>0){let u=Math.abs(rg(i[c].angle,i[c-1].angle))*(Math.PI/180);l+=r*2*Math.tan(Math.min(u,Math.PI/3)/2);}s=o+t[c].offset+l;let f=kh(n,e,s,t[c].width);if(!f)return null;a.push(f);}return a}function kh(n,e,t,o){let r=ln(n,e,t+o/2);if(!r)return null;let i=ln(n,e,t),a=ln(n,e,t+o);if(!i||!a)return r;let s=a.x-i.x,l=a.y-i.y;return s===0&&l===0?r:{x:r.x,y:r.y,angle:Math.atan2(l,s)*180/Math.PI}}function rg(n,e){let t=n-e;for(;t>180;)t-=360;for(;t<=-180;)t+=360;return t}function ng(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 ig(n){let e=n[n.length-1];return n.map(t=>e-t).reverse()}function ln(n,e,t){if(t<0||t>e[e.length-1])return null;let o=1;for(;o<e.length-1&&e[o]<t;)o++;let r=e[o]-e[o-1];if(r<=0)return null;let i=(t-e[o-1])/r,a=n[o-1],s=n[o],l=s.x-a.x,c=s.y-a.y;return {x:a.x+l*i,y:a.y+c*i,angle:Math.atan2(c,l)*180/Math.PI}}var Xs=20,Lh={stride:Xs,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}]},sg=220,lg=.15;function Rh(n,e){if(!Number.isFinite(e.far))return 1;let t=Math.max(e.far-e.near,1),o=e.near+t*lg,r=(n-o)/Math.max(e.far-o,1);return r<=0?1:r>=1?0:1-r*r*(3-2*r)}var cn=192,co=64,Ks=2,cg=1.22,fg=128,ug=.7;function hg(n,e,t){let o=n.layout?.letterSpacing;if(o!==void 0)return pe(o,e,0)*Gt;let r=pe(n.paint?.haloWidth,e,0);return r<=0||t<=0?0:r*ug/(t/Gt)}var dg=256,mg=200,pg="frame-circle",bg="frame-pin",gg="frame-circle-soft",yg="frame-pin-soft",Ph=5/3,Ag=10.29/24;function xg(n,e,t,o,r){let i=-r,a=-r,s=o.width+r,l=o.height+r,c=[],f=0;for(let u=0;u+1<n.length;u++){let h=n[u],d=n[u+1],m=Math.hypot(d.x-h.x,d.y-h.y);if(Math.max(h.x,d.x)>=i&&Math.min(h.x,d.x)<=s&&Math.max(h.y,d.y)>=a&&Math.min(h.y,d.y)<=l&&m>0){let b=Math.max(0,Math.ceil((f-t)/e)),g=Math.floor((f+m)/e);for(let y=b;y<=g;y++){let A=y*e;if(A>=0&&c[c.length-1]!==A&&c.push(A),c.length>=wg)return c}}f+=m;}return c}var wg=32;function vg(n,e){let t=0,o=1/0,r=0;for(let i=0;i+1<n.length;i++){let a=n[i].x,s=n[i].y,l=n[i+1].x-a,c=n[i+1].y-s,f=Math.hypot(l,c);if(f>0){let u=Math.min(Math.max(((e.x-a)*l+(e.y-s)*c)/(f*f),0),1),h=Math.hypot(e.x-(a+l*u),e.y-(s+c*u));h<o&&(o=h,r=t+f*u);}t+=f;}return o<=50?r:null}function Vh(n){return !n.allowOverlap&&!n.ignorePlacement}function Hh(n){return Vh(n)||!n.allowOverlap&&n.placementGroup!==void 0}function Oh(n){return Vh(n)?void 0:n.placementGroup}function Gh(n,e){return e<=0?n:{x1:n.x1+e,y1:n.y1+e,x2:n.x2-e,y2:n.y2-e}}function zh(n){return n==="circle"?pg:n==="pin"?bg:null}function Cg(n){return n==="circle"?gg:n==="pin"?yg:null}var Bg=["left","right","top"];function Mg(n,e){return !e||n[0]===e||!n.includes(e)?n:[e,...n.filter(t=>t!==e)]}var rr=class rr{constructor(e,t){this.shader=null;this.locations=new fe;this.atlas=new on(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.missingImage=null;this.askedImages=new Set;this.images=new rn;this.highlightFootprint=null;this.elevationAt=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.lineAnchors=new fe;this.lastSide=new fe;this.lineAt=new fe;this.lineAtNow=new fe;this.sideNow=new fe;this.fog={near:0,far:1/0,intensity:0,cutoff:1/0};this.tr=null;this.shownAt=new fe;this.fading=false;this.styleOrder=new fe;this.layersById=new fe;this.glyphs=new nn(e,t),this.icons=new sn(Mo);}setGlyphsUrl(e){this.glyphs.setUrl(e);}setMissingImage(e){this.missingImage=e,this.askedImages.clear();}init(e){this.shader=new Ye(e,"symbol",ju,Yu);for(let t of Lh.attribs)this.locations.set(t.name,this.shader.attribLocation(t.name));}static keyOf(e){return `${e.layerId}|${e.text}|${e.mercX.toFixed(6)}|${e.mercY.toFixed(6)}`}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}rememberedAt(e,t,o){let r=this.lineAt.get(e),i=this.tr;if(!r||!r.length||!i)return [];let a=[];for(let s=0;s+1<r.length;s+=rr.LINE_MARK){let l=i.worldPxToPoint(r[s]*i.worldSize,r[s+1]*i.worldSize);if(!l)continue;let c=vg(t,l);c!==null&&a.push(Math.max(0,c-o/2));}return a}rememberAt(e,t){let o=this.tr;if(!o||!t.length)return;let r=this.lineAtNow.get(e);r||(r=[],this.lineAtNow.set(e,r));for(let i of t){let a=o.pointToWorldPx(i);r.push(a.x/o.worldSize,a.y/o.worldSize);}}withinLayout(e){let t=this.padding;return e.x2>t.left-cn&&e.y2>t.top-cn&&e.x1<this.viewport.width-t.right+cn&&e.y1<this.viewport.height-t.bottom+cn}depthFadeAt(e,t){let o=this.tr;if(!o||!Number.isFinite(this.fog.far))return 1;let r=o.pointToWorldPx({x:e,y:t}),[i,a,s]=o.cameraPositionPx;return Rh(Math.hypot(r.x-i,r.y-a,s),this.fog)}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)/sg;return r<1?(this.fading=true,r):1}order(e){let t=e.length,o=new Float64Array(t);for(let a=0;a<t;a++){let s=e[a];o[a]=s.priority+(this.stickyKeys.has(s.key)?mg:0);}let r=new Int32Array(t);for(let a=0;a<t;a++)r[a]=a;r.sort((a,s)=>{let l=o[s]-o[a];if(l!==0)return l;let c=e[a],f=e[s];return c.mercY!==f.mercY?c.mercY-f.mercY:c.mercX-f.mercX});let i=new Array(t);for(let a=0;a<t;a++)i[a]=e[r[a]];for(let a=0;a<t;a++)e[a]=i[a];}rememberPlaced(){this.stickyKeys=new Set(this.placed.map(o=>rr.keyOf(o)));let e=this.lastSide;this.lastSide=this.sideNow,e.clear(),this.sideNow=e;let t=this.lineAt;this.lineAt=this.lineAtNow,t.clear(),this.lineAtNow=t;for(let o of [...this.shownAt.keys()])this.stickyKeys.has(o)||this.shownAt.delete(o);}render(e,t,o,r){var d,m;let i=this.shader;if(this.placedCount=0,this.placed=[],this.viewport={width:t.width,height:t.height},this.tr=t,!i)return;let a=t.zoom,s=r.layers.filter(p=>p.type==="symbol"&&r.layerVisibleAt(p,a));if(!s.length)return;let l=this.collect(t,o,r,s);if(!l.length)return;this.now=performance.now(),this.fading=false,this.lineAnchors.clear(),this.order(l);let c=new fe,f=new fe,u=new fe;s.forEach((p,b)=>u.set(p.id,b)),this.layersById.clear();for(let p of r.layers)p.type==="symbol"&&this.layersById.set(p.id,p);let h=0;for(let p of l){let b=this.place(p,a,c);if(!b)continue;this.placed.push({layerId:p.layer.id,text:p.text,icon:p.icon,mercX:p.mercX,mercY:p.mercY,box:b.box,order:u.get(p.layer.id)??0});let g=f.get(p.layer.id);g||f.set(p.layer.id,g={layer:p.layer,verts:[],texs:[],iconVerts:[],iconTexs:[],imageVerts:[],imageTexs:[],frameVerts:[],frameTexs:[],shadowVerts:[],shadowTexs:[],partVerts:[],partTexs:[]}),g.verts.push(...b.verts),g.texs.push(...b.texs),g.iconVerts.push(...b.iconVerts),g.iconTexs.push(...b.iconTexs),g.imageVerts.push(...b.imageVerts),g.imageTexs.push(...b.imageTexs),g.frameVerts.push(...b.frameVerts),g.frameTexs.push(...b.frameTexs),g.shadowVerts.push(...b.shadowVerts),g.shadowTexs.push(...b.shadowTexs);for(let y=0;y<b.partVerts.length;y++)b.partVerts[y]?.length&&(((d=g.partVerts)[y]??(d[y]=[])).push(...b.partVerts[y]),((m=g.partTexs)[y]??(m[y]=[])).push(...b.partTexs[y]));h+=b.quads,this.placedCount++;}this.rememberPlaced(),this.fading&&this.onAssetsReady?.(),this.requestMissing(),h&&(this.styleOrder=u,this.draw(e,t,f,h,a));}collect(e,t,o,r){let i=[],a=cn,s=this.padding,l=Jo(e,o),c=l.far;this.fog=l;let[f,u,h]=e.cameraPositionPx;for(let d of r){let m=(d.layout?.priority??0)*dg,p=t.get(d.source??De);if(!p)continue;let b=d.layout?.showFor==="highlight",g=d.layout?.placement==="map",{shift:y,drop:A}=g?Kh(d,e.zoom,e.pixelsPerMeter):{shift:0,drop:0};if(b&&!this.highlightFootprint)continue;let x=e.worldSize>0?e.pixelsPerMeter/e.worldSize*1.5:0,v=o.bucketKeyFor(d);if(v!==null)for(let w of p.visibleTiles){let B=p.getTile(w)?.data?.buckets?.[v];if(!B||!Mi(B))continue;let _=new Int16Array(B.anchors),T=new Uint8Array(B.priorities),k=B.rotations?new Int16Array(B.rotations):null,K=B.lines?new Int16Array(B.lines):null,P=B.lineStarts?new Uint32Array(B.lineStarts):null,W=w.bounds(),z=e.worldSize,L=(W.maxX-W.minX)*z/B.extent,X=W.minX*z,Q=W.minY*z;for(let G=0;G<T.length;G++){let Y=X+_[G*2]*L,ie=Q+_[G*2+1]*L,ee=Math.hypot(Y-f,ie-u,h);if(c!==1/0&&ee>c||b&&!Zt(this.highlightFootprint,Y/z,ie/z,x))continue;let ue=Y,$=ie;if(g&&k){let J=k[G]*Math.PI/180,Z=y;ue-=Math.sin(J)*Z,$+=Math.cos(J)*Z;}let Ae=this.elevationAt?this.elevationAt(Y/z,ie/z):0,ve=e.worldPxToPoint(ue,$,Ae),he=K&&P?_g(e,K,P,G,X,Q,L,this.elevationAt):void 0,xe=d.layout?.textPlacement==="line";if(xe){if(!he)continue}else if(!ve||ve.x<s.left-a||ve.y<s.top-a||ve.x>e.width-s.right+a||ve.y>e.height-s.bottom+a)continue;let de=Y/z,we=ie/z,I=B.texts[G]??"";i.push({key:rr.keyOf({layerId:d.id,text:I,mercX:de,mercY:we}),layer:d,screenX:ve?ve.x:he[0].x,screenY:(ve?ve.y:he[0].y)+A,text:I,icon:B.icons[G]??"",priority:T[G]+m,rotate:Xh(d,k,G,e.bearing),mercX:de,mercY:we,depth:xe?1:Rh(ee,l),line:he});}}}return i}place(e,t,o){let r=e.layer.layout??{},i=e.key;if(this.hiddenKey!==null&&this.hiddenKey===i)return null;let a=this.fadeOf(i,this.now)*e.depth,s=this.hoverKey!==null&&this.hoverKey===i,l=pe(r.textSize,t,13),c=pe(r.iconSize,t,16),f=r.iconTextGap??5,[u,h]=r.offset??[0,0],d=r.placement==="map",m=null,p=null;if(e.icon&&!d&&this.images.has(e.icon)){let ne=this.images.get(e.icon);if(ne.sdf){let re=`image:${e.icon}`,se=this.atlas.get(re);if(!se){let me=new Uint8Array(ne.width*ne.height);for(let _e=0;_e<me.length;_e++)me[_e]=ne.data[_e*4+3];se=this.atlas.add(re,me,ne.width,ne.height)??void 0;}se&&(m=se);}else p=this.images.entryFor(e.icon),p&&(m=p);}if(e.icon&&!d&&!m&&!p){this.icons.isDefined(e.icon)||(this.missingImage&&!this.askedImages.has(e.icon)&&(this.askedImages.add(e.icon),this.missingImage(e.icon)),e.icon="dot");let ne=`icon:${e.icon}`,re=this.atlas.get(ne);if(!re){let se=this.icons.get(e.icon);se?re=this.atlas.add(ne,se.data,se.width,se.height)??void 0:this.pendingIcons.add(e.icon);}re&&(m=re);}let b=m&&!d?r.iconParts??[]:[],g=[];for(let ne of b){let re=`icon:${ne}`,se=this.atlas.get(re);if(!se){let me=this.icons.get(ne);me?se=this.atlas.add(re,me.data,me.width,me.height)??void 0:this.pendingIcons.add(ne);}g.push(se??null);}let y=g.length>0&&g.every(ne=>ne!==null),A=null,x=m?zh(r.iconFrame):null;if(x){let ne=`icon:${x}`,re=this.atlas.get(ne);if(!re){let se=this.icons.get(x);se?re=this.atlas.add(ne,se.data,se.width,se.height)??void 0:this.pendingIcons.add(x);}re&&(A=re);}let v=A?Math.max(r.iconFrameScale??1.6,1):1,w=A?c*v:0,C=A?w*(A.height-Ke*2)/Math.max(A.width-Ke*2,1):0,B=A&&r.iconFrame==="pin"?Ag:.5,_=null,T=A&&e.layer.paint.frameShadow!==void 0?Cg(r.iconFrame):null;if(T){let ne=`icon:${T}`,re=this.atlas.get(ne);if(!re){let se=this.icons.get(T);se?re=this.atlas.add(ne,se.data,se.width,se.height)??void 0:this.pendingIcons.add(T);}re&&(_=re);}let k=null;if(e.text&&(this.glyphs.needsLoad(e.text)&&this.pendingText.add(e.text),k=Vs(e.text,this.glyphs,r.textPlacement==="line"?Number.MAX_SAFE_INTEGER:r.maxLineChars??15,hg(e.layer,t,l)),!k&&!m)||!k&&!m)return null;let K=l/Gt,P=k?k.width*K:0,W=k?k.height*K:0,z=Ks+(r.collisionPadding??0),L=this.stickyKeys.has(i)?z-Ks:0;if(e.layer.layout?.textPlacement==="line")return k&&e.line?this.placeOnLine(e,k,K,W,o,a,L):null;let X=r.iconPlacement??"top",Q=X==="auto"&&m&&k?Mg(Bg,this.lastSide.get(i)):[X],G=m?m.width/Math.max(m.height,1):1,Y=null;for(let ne of Q){let re=ne==="behind"&&!!m&&!!k,se=ne==="top"&&!!m&&!!k,me=re?W+f*2:c,_e=m?me*G:0,Ce=Math.max(_e,w),Be=Math.max(me,C),ge=re?Math.max(_e,P+f*2):se?Math.max(Ce,P):Ce+(m&&k?f:0)+P,ye=re?Math.max(me,W):se?Be+f+W:Math.max(m?Be:0,W),Te=B===.5||!m?0:se?Be-ye/2:Be/2,Ie=m&&k&&!re&&!se?(ge/2-Ce/2)*(ne==="right"?-1:1):0,Ee=e.screenX+u+Ie,Me=e.screenY+h-Te,We={x1:Ee-ge/2-z,y1:Me-ye/2-z,x2:Ee+ge/2+z,y2:Me+ye/2+z};if(this.withinLayout(We)&&!(!r.allowOverlap&&Wh(o,Gh(We,L),r.placementGroup))){Y={behind:re,stacked:se,iconFirst:ne!=="right",iconW:_e,iconH:me,blockW:Ce,blockH:Be,totalW:ge,totalH:ye,cx:Ee,cy:Me,box:We},this.sideNow.set(i,ne);break}}if(!Y)return null;let{behind:ie,stacked:ee,iconFirst:ue,iconW:$,iconH:Ae,blockW:ve,blockH:he,totalW:xe,totalH:de,cx:we,cy:I,box:J}=Y;Hh(r)&&Nh(o,J,Oh(r));let Z=[],ce=[],ae=[],be=[],Se=[],F=[],U=[],j=[],R=[],H=[],E=[],M=[],S=0,D=we-xe/2,O=ee?(he+f)/2:0,N=he*(B-.5),q=1/0,V=1/0,te=-1/0,oe=-1/0;if(k){let ne=ee||ie?we:D+(m&&ue?ve+f:0)+P/2;for(let re of k.glyphs){let se=re.glyph,me=`g:${se.id}`,_e=this.atlas.get(me);if(!_e&&(!se.bitmap||(_e=this.atlas.add(me,se.bitmap,se.width+Ke*2,se.height+Ke*2)??void 0,!_e)))continue;let Ce=ne+(re.x+se.left-Ke)*K,Be=I+O+(re.y-se.top-Ke)*K,ge=_e.width*K,ye=_e.height*K;fn(Z,ce,Ce,Be,ge,ye,_e,0,a),S++;let Te=Ke*K;q=Math.min(q,Ce+Te),V=Math.min(V,Be+Te),te=Math.max(te,Ce+ge-Te),oe=Math.max(oe,Be+ye-Te);}if(m&&V<1/0&&!ie){let re=ee?I-de/2+he+f-V:I+N-(V+oe)/2;if(re!==0){for(let se=1;se<Z.length;se+=4)Z[se]+=re;V+=re,oe+=re;}}}if(m){let ne=s&&!ie?cg:1,re=$*ne,se=Ae*ne,_e=(ee?we-$/2:D+(ue?0:xe-ve)+(ve-$)/2)-(re-$)/2,Ce=(ee?I-de/2+(he-Ae)/2:I-Ae/2)+N-(se-Ae)/2;if(A){let ge=w*ne,ye=C*ne,Te=_e+re/2-ge/2,Ie=Ce+se/2-ye*B,Ee=Ke/Math.max(A.width-Ke*2,1)*ge,Me=Ke/Math.max(A.height-Ke*2,1)*ye;if(_){let We=ge*Ph,Re=ye*Ph,He=Te+ge/2-We/2,lt=Ie+ye/2-Re/2,qe=Ke/Math.max(_.width-Ke*2,1)*We,Bt=Ke/Math.max(_.height-Ke*2,1)*Re;fn(R,H,He-qe,lt-Bt,We+qe*2,Re+Bt*2,_,0,a),S++;}fn(U,j,Te-Ee,Ie-Me,ge+Ee*2,ye+Me*2,A,0,a),S++;}if(ie&&te>q){let ge=f*1.6,ye=f;re=(te-q+ge*2)*ne,se=(oe-V+ye*2)*ne,_e=q-ge,Ce=V-ye;}let Be=(ge,ye,Te,Ie=true)=>{let Ee=Ie?Ke/Math.max(ge.height-Ke*2,1)*se:0;fn(ye,Te,_e-Ee,Ce-Ee,re+Ee*2,se+Ee*2,ge,e.rotate,a),S++;};if(p)Be(p,Se,F,false);else if(y&&!ie)for(let ge=0;ge<g.length;ge++)Be(g[ge],E[ge]??(E[ge]=[]),M[ge]??(M[ge]=[]));else Be(m,ae,be);}return S?{verts:Z,texs:ce,iconVerts:ae,iconTexs:be,imageVerts:Se,imageTexs:F,frameVerts:U,frameTexs:j,shadowVerts:R,shadowTexs:H,partVerts:E,partTexs:M,quads:S,box:J}:null}placeOnLine(e,t,o,r,i,a,s){let l=e.line,c=t.glyphs.map(P=>({offset:(P.x+t.width/2)*o,width:Math.max(P.glyph.advance,1)*o})),f=c.length?c[c.length-1].offset+c[c.length-1].width:0,u=e.layer.layout??{},h=[],d=[],m=[],p=0,b=r/2+Ks,g=Math.max(u.symbolSpacing??250,f+1),y=`${e.layer.id}|${e.text}`,A=P=>{let W=P.path.map(Q=>({x1:Q.x-b,y1:Q.y-b,x2:Q.x+b,y2:Q.y+b})),z=this.lineAnchors.get(y);if(z&&g>0){let Q=P.path[P.path.length>>1];for(let G=0;G+1<z.length;G+=2)if(Math.hypot(Q.x-z[G],Q.y-z[G+1])<g)return false}for(let Q of W)if(!this.withinLayout(Q)||!u.allowOverlap&&Wh(i,Gh(Q,s),u.placementGroup))return false;if(Hh(u))for(let Q of W)Nh(i,Q,Oh(u));m.push(...W);let L=P.path[P.path.length>>1],X=this.lineAnchors.get(y);return X?X.push(L.x,L.y):this.lineAnchors.set(y,[L.x,L.y]),true},x=-1/0,v=1/0;for(let P of t.glyphs)P.glyph.height<=0||(x=Math.max(x,P.glyph.top),v=Math.min(v,P.glyph.top-P.glyph.height));let w=Number.isFinite(x)?(x+v)/2*o:0,C=xg(l,g,f,this.viewport,fg);if(!C.length)return null;let B=this.rememberedAt(e.key,l,f),_=Us(l,c,f,{fontSize:Gt*o,atList:B.length?B:C,accept:A});if(!_.length)return null;let T=this.lineAt.get(e.key);B.length&&T?this.lineAtNow.set(e.key,T):this.rememberAt(e.key,_.map(P=>P.path[P.path.length>>1]));for(let P of _){let W=P.path[P.path.length>>1]??P.glyphs[0],z=a*this.depthFadeAt(W.x,W.y);for(let L=0;L<t.glyphs.length;L++){let X=t.glyphs[L].glyph,Q=P.glyphs[L],G=`g:${X.id}`,Y=this.atlas.get(G);if(!Y&&(!X.bitmap||(Y=this.atlas.add(G,X.bitmap,X.width+Ke*2,X.height+Ke*2)??void 0,!Y)))continue;let ie=Y.width*o,ee=Y.height*o,ue=(X.height/2-X.top)*o+w,$=Q.angle*Math.PI/180;fn(h,d,Q.x-ie/2-Math.sin($)*ue,Q.y-ee/2+Math.cos($)*ue,ie,ee,Y,Q.angle,z),p++;}}if(!p)return null;let k=m.map(P=>(P.x1+P.x2)/2),K=m.map(P=>(P.y1+P.y2)/2);return {verts:h,texs:d,iconVerts:[],iconTexs:[],imageVerts:[],imageTexs:[],frameVerts:[],frameTexs:[],shadowVerts:[],shadowTexs:[],partVerts:[],partTexs:[],quads:p,box:{x1:Math.min(...k)-b,y1:Math.min(...K)-b,x2:Math.max(...k)+b,y2:Math.max(...K)+b}}}colorOf(e,t,o,r){if(e&&typeof e=="object"&&"from"in e){let i=e,a=this.layersById.get(i.from),s=ht(a?.paint?.[t],o,r),l=1-Math.min(Math.max(i.darken??0,0),1);return [s[0]*l,s[1]*l,s[2]*l,s[3]]}return ht(e,o,r)}inStyleOrder(e){return [...e.values()].sort((t,o)=>(this.styleOrder.get(t.layer.id)??0)-(this.styleOrder.get(o.layer.id)??0))}draw(e,t,o,r,i){let a=this.shader,s=e.gl;this.ensureBuffers(e,r);let l=this.vbo,c=this.vao;if(!l||!c||!this.ibo)return;let f=new ArrayBuffer(r*4*Xs),u=new Float32Array(f),h=new Uint16Array(f),d=[],m=0,p=(b,g,y,A,x)=>{let v=b.length/16;if(v){d.push({layer:y,role:A,first:m/4*6,count:v*6,part:x});for(let w=0;w<v*4;w++){let C=m*5;u[C]=b[w*4],u[C+1]=b[w*4+1],h[C*2+4]=g[w*2],h[C*2+5]=g[w*2+1],u[C+3]=b[w*4+2],u[C+4]=b[w*4+3],m++;}}};for(let b of this.inStyleOrder(o)){p(b.shadowVerts,b.shadowTexs,b.layer,"shadow"),p(b.frameVerts,b.frameTexs,b.layer,"frame");for(let g=0;g<b.partVerts.length;g++)p(b.partVerts[g]??[],b.partTexs[g]??[],b.layer,"part",g);p(b.iconVerts,b.iconTexs,b.layer,"icon"),p(b.imageVerts,b.imageTexs,b.layer,"image"),p(b.verts,b.texs,b.layer,"text");}l.update(new Uint8Array(f)),a.use(),this.atlas.bind(e,0),a.setInt("u_atlas",0),this.images.bind(e,1),a.setInt("u_images",1),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?s.drawingBufferWidth/t.width:1),e.setDepthTest(false),e.setDepthMask(false),e.setBlend("premultiplied"),e.setCull("none"),c.bind();for(let b of d){let g=b.layer.paint,y=pe(g.opacity,i,1),A=b.role==="image";a.setFloat("u_image_mode",A?1:0),a.setFloat("u_image_opacity",y),a.setFloat("u_atlas_size",A?this.images.size:this.atlas.size);let x=b.role==="icon",v=b.role==="frame";if(b.role==="shadow"){let L=pe(g.frameShadow,i,0);if(L>0){let X=this.colorOf(g.frameShadowColor??g.frameColor??g.haloColor??g.color,"haloColor",i,[.15,.15,.15,1]),Q=g.frameShadowColor!==void 0?1:.65;a.setVec2("u_px_offset",0,pe(g.frameShadowOffset,i,3)),a.setFloat("u_shadow_px",Math.max(pe(g.frameShadowBlur,i,6),.1)),a.setVec3("u_grad",0,0,0),a.setVec4v("u_color",it([X[0]*Q,X[1]*Q,X[2]*Q,L*X[3]*y])),s.drawElements(s.TRIANGLES,b.count,s.UNSIGNED_INT,b.first*4),a.setFloat("u_shadow_px",0),a.setVec2("u_px_offset",0,0);}continue}a.setVec2("u_px_offset",0,0),a.setFloat("u_shadow_px",0);let w=b.role==="part"?(b.layer.paint.partColors??[])[b.part??0]??b.layer.paint.iconColor??b.layer.paint.color:void 0,C=(L,X,Q)=>v?X??L??Q:x?L??Q:Q,B=this.colorOf(b.role==="part"?w:v?g.frameColor??g.haloColor??g.color:C(g.iconColor,void 0,g.color),v?"haloColor":"color",i,[.15,.15,.15,1]),_=v?g.frameHaloColor:C(g.iconHaloColor,void 0,g.haloColor),T=_===void 0&&v,k=this.colorOf(_??(v?g.iconColor??g.color:g.haloColor),T?"color":"haloColor",i,[1,1,1,1]);v&&g.frameHaloColor===void 0&&(k[3]*=.35),v&&(B[3]*=pe(g.frameOpacity,i,1));let K=pe(b.role==="part"?(g.partHaloWidths??[])[b.part??0]??0:v?g.frameHaloWidth??1.1:C(g.iconHaloWidth,void 0,g.haloWidth),i,b.role==="part"?0:1.2),P=pe(b.layer.layout?.textSize,i,13),W=b.role==="text"?pe(g.textWeight,i,0):0;a.setFloat("u_edge",W>0?an-W/(tr*(P/Gt)):an),a.setVec4v("u_color",it([B[0],B[1],B[2],B[3]*y])),a.setVec4v("u_halo_color",it([k[0],k[1],k[2],k[3]*y])),a.setFloat("u_halo",K/(tr*(P/Gt)));let z=v?pe(g.frameGradient,i,0):0;if(z>0){let L=this.frameEntryOf(b.layer);if(L){let X=this.atlas.size;a.setVec3("u_grad",L.y/X,(L.y+L.height)/X,z);}else a.setVec3("u_grad",0,0,0);}else a.setVec3("u_grad",0,0,0);s.drawElements(s.TRIANGLES,b.count,s.UNSIGNED_INT,b.first*4);}e.bindVAO(null);}frameEntryOf(e){let t=zh(e.layout?.iconFrame);return t?this.atlas.get(`icon:${t}`)??null: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 Je(e,new Uint8Array(this.capacityQuads*4*Xs),Lh,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 Ue(e,o),this.vao=new Ne(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;}};rr.LINE_MARK=2;var nr=rr;function fn(n,e,t,o,r,i,a,s=0,l=1){let c=i/Math.max(a.height,1);if(s){let f=s*Math.PI/180,u=Math.cos(f),h=Math.sin(f),d=t+r/2,m=o+i/2;for(let[p,b]of [[t,o],[t+r,o],[t+r,o+i],[t,o+i]]){let g=p-d,y=b-m;n.push(d+g*u-y*h,m+g*h+y*u,c,l);}}else n.push(t,o,c,l,t+r,o,c,l,t+r,o+i,c,l,t,o+i,c,l);e.push(a.x,a.y,a.x+a.width,a.y,a.x+a.width,a.y+a.height,a.x,a.y+a.height);}function _g(n,e,t,o,r,i,a,s){if(o+1>=t.length)return;let l=t[o],c=t[o+1],f=[];for(let u=l;u<c;u++){let h=r+e[u*2]*a,d=i+e[u*2+1]*a,m=s?s(h/n.worldSize,d/n.worldSize):0,p=n.worldPxToPoint(h,d,m);if(!p)break;f.push(p);}return f.length>=2?f:void 0}var Uh=(n,e)=>n*4096+e;function Wh(n,e,t){let o=Math.floor(e.x1/co),r=Math.floor(e.y1/co),i=Math.floor(e.x2/co),a=Math.floor(e.y2/co);for(let s=o;s<=i;s++)for(let l=r;l<=a;l++){let c=n.get(Uh(s,l));if(c){for(let f of c)if(!(f.group!==void 0&&f.group!==t)&&e.x1<f.x2&&e.x2>f.x1&&e.y1<f.y2&&e.y2>f.y1)return true}}return false}function Nh(n,e,t){let o=Math.floor(e.x1/co),r=Math.floor(e.y1/co),i=Math.floor(e.x2/co),a=Math.floor(e.y2/co);for(let s=o;s<=i;s++)for(let l=r;l<=a;l++){let c=Uh(s,l),f=n.get(c);f||n.set(c,f=[]),f.push(t===void 0?e:{...e,group:t});}}function Kh(n,e,t){let r=n.layout?.arrowUnits!=="meters"?1:t,i=pe(n.layout?.arrowLength,e,50)*r;return {shift:pe(n.layout?.arrowGap,e,20)*r+i/2,drop:i/2+(n.layout?.iconTextGap??4)}}function Xh(n,e,t,o){return !n.layout?.iconRotate||!e?0:e[t]-o}var fo=class{constructor(e,t){this.capacity=e;this.onEvict=t;this.map=new fe;}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 Eg=[["\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."]],Jh=new Map(Eg);function Js(n){let e=n.split(" ");if(e.length<2)return n;let t=false,o=e.map(i=>{let a=Jh.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=>Jh.get(i.toLowerCase())===void 0).length?n:o.join(" ")}function Ys(n,e){let t=[],o=[],r=[],i=[],a=[],s=e.textPlacement==="line",l=[],c=[],f=[];for(let u of n.features()){if(!et(e.filter,u.properties))continue;let h=u.loadGeometry(),d=Ig(u.type,h);if(!d)continue;let m=e.textField?js(e.textField,u.properties):"",p=m&&e.abbreviate?Js(m):m,b=e.iconImage?js(e.iconImage,u.properties):"";if(!(!p&&!b)){if(s){let g=Fg(u.type,h);if(!g)continue;f.push({text:p,line:g});continue}t.push(d[0],d[1]),o.push(p),r.push(b),i.push(Dg(u.properties)),a.push(e.iconRotate&&Math.round(Number(u.properties[e.iconRotate]??0))||0);}}if(s){for(let{text:u,line:h}of Sg(f)){c.push(l.length/2);for(let d of h)l.push(d);t.push(Math.round(h[0]),Math.round(h[1])),o.push(u),r.push(""),i.push(128),a.push(0);}c.push(l.length/2);}return o.length?{anchors:new Int16Array(t).buffer,texts:o,icons:r,priorities:new Uint8Array(i).buffer,rotations:new Int16Array(a).buffer,...s?{lines:new Int16Array(l).buffer,lineStarts:new Uint32Array(c).buffer}:{}}:null}function Sg(n){let e=[],t=new Map,o=new Map,r=(i,a,s)=>`${i}\u241F${a}\u241F${s}`;for(let{text:i,line:a}of n){let s=r(i,a[0],a[1]),l=r(i,a[a.length-2],a[a.length-1]),c=t.get(l),f=o.get(s);if(f!==void 0){let u=e[f];if(u.line.push(...a.slice(2)),o.delete(s),o.set(r(i,u.line[u.line.length-2],u.line[u.line.length-1]),f),c!==void 0&&c!==f){let h=e[c];u.line.push(...h.line.slice(2)),h.line=[],t.delete(l),o.set(r(i,u.line[u.line.length-2],u.line[u.line.length-1]),f);}continue}if(c!==void 0){let u=e[c];u.line.unshift(...a.slice(0,a.length-2)),t.delete(l),t.set(r(i,u.line[0],u.line[1]),c);continue}t.set(s,e.length),o.set(l,e.length),e.push({text:i,line:a});}return e.filter(i=>i.line.length>=4)}function Fg(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 Ig(n,e){if(!e.length)return null;if(n===1){let a=e[0];return a.length>=2?[a[0],a[1]]:null}if(n===2){let a=-1,s=0,l=0;for(let c of e)for(let f=0;f+3<c.length;f+=2){let u=c[f+2]-c[f],h=c[f+3]-c[f+1],d=u*u+h*h;d>a&&(a=d,s=c[f]+u/2,l=c[f+1]+h/2);}return a>0?[Math.round(s),Math.round(l)]:null}let t=1/0,o=1/0,r=-1/0,i=-1/0;for(let a of e)for(let s=0;s<a.length;s+=2)a[s]<t&&(t=a[s]),a[s]>r&&(r=a[s]),a[s+1]<o&&(o=a[s+1]),a[s+1]>i&&(i=a[s+1]);return isFinite(t)?[Math.round((t+r)/2),Math.round((o+i)/2)]:null}function Dg(n){let e=n.importance;if(typeof e=="number"&&isFinite(e))return Math.max(0,255-Math.min(Math.max(e,1),9)*20);let t=n.rank;return typeof t=="number"&&isFinite(t)?Math.max(0,255-Math.min(t,255)):128}function js(n,e){let t=Array.isArray(n)?n:[n];for(let o of t){let r=true,a=o.replace(/\{([^}]+)\}/g,(s,l)=>{let c=e[l];return c==null||c===""?(r=false,""):String(c)}).trim();if(r&&a)return a}return ""}function jh(n,e){let t=[],o=[];for(let r=0;r<n.length;r++){let i=n.feature(r);if(i.type===1&&et(e,i.properties))for(let a of i.loadGeometry())for(let s=0;s+1<a.length;s+=2)t.push(a[s],a[s+1]),o.push(i.properties);}return o.length?{anchors:Int16Array.from(t).buffer,props:o}:null}function Tg(){let n=typeof self<"u"?self.origin:void 0;return n&&n!=="null"&&!n.startsWith("blob:")?n+"/":void 0}function un(n,e){let t={},o=[],r={},i=new Set,a=[],l=e.plan.some(c=>c.type==="surface"&&(c.elevation??0)>0)&&e.plan.some(c=>c.type==="line"&&c.ground)?ss(e.metersPerTile):void 0;for(let c of e.plan){if(!Hg(c,e.zoom,e.sourceMaxZoom))continue;let f=n.layers[c.sourceLayer];if(!f)continue;let u=Og(e.zoom,f.extent);try{if(c.splitBy){let d=Gg(f,c.splitBy,c.filter);if(!d.length)continue;let m=r[c.splitBy]??(r[c.splitBy]=[]);for(let p of d){m.includes(p)||m.push(p);let b={...c,splitBy:void 0,filter:Wg(c.filter,c.splitBy,p)},g=Zs(b,f,u,e.metersPerTile,e.zoom,l,void 0,o,e.tile);g&&(t[Ot(c.id,p)]=g);}continue}if(c.network&&c.type==="line"){for(let d of zg(f,c.filter)){let m=Zs(c,f,u,e.metersPerTile,e.zoom,l,d,o,e.tile);m&&(t[Ot(c.id,d)]=m,i.add(d));}continue}let h=Zs(c,f,u,e.metersPerTile,e.zoom,l,void 0,o,e.tile);h&&(t[c.id]=h);}catch(h){a.push(`${c.id}: ${h instanceof Error?h.message:String(h)}`);}}return {buckets:t,seams:o,splits:r,levels:[...i].sort((c,f)=>c-f),failed:a}}async function Yh(n,e){let t=performance.now(),o=Tg(),r=await fetch(n.url,{signal:e,credentials:"same-origin",...o?{referrer:o}:{}}),i=(b,g,y,A,x=0)=>({type:"loaded",id:n.id,buckets:{},timing:{fetchMs:A,parseMs:x},diag:{status:b,bytes:g,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(),s=performance.now()-t;if(a.byteLength===0)return i(r.status,0,[],s);let l=performance.now(),c=new Ut(a),f=Object.keys(c.layers),{buckets:u,seams:h,splits:d,levels:m,failed:p}=un(c,n);return {type:"loaded",id:n.id,raw:a,buckets:u,...h.length?{seams:h}:{},...Object.keys(d).length?{splits:d}:{},...m.length?{levels:m}:{},timing:{fetchMs:s,parseMs:performance.now()-l},diag:{status:r.status,bytes:a.byteLength,layers:f,built:Object.keys(u).length,...p.length?{failed:p}:{}}}}function kg(n){return e=>{let t=e.lift,o=typeof t=="number"?t:typeof t=="string"?Number(t):NaN;return Number.isFinite(o)?Math.max(0,o):Math.max(0,vt(e))*n}}function Lg(n){let e=n.lift,t=typeof e=="number"?e:typeof e=="string"?Number(e):NaN;return !Number.isFinite(t)||t===0?null:()=>t}function Rg(n,e){return t=>{let o=t.width,r=typeof o=="number"?o:typeof o=="string"?Number(o):NaN,i=Number.isFinite(r)&&r>0?r:n??0;return i>0?i+(e??0):null}}function Pg(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 Hg(n,e,t){let o=e-1,r=e<t?e+1:24;return !(n.maxzoom<o||n.minzoom>r)}function Og(n,e){return n<=6?Math.max(64,e/24):0}function Zs(n,e,t,o,r,i,a,s,l){{let c=ba(l,e.extent);if(n.type==="fill"){let u=o>0?o/e.extent:0,h=n.cornerRadius&&u>0?{radius:n.cornerRadius/u,segments:n.cornerSegments,extent:e.extent,minCutRatio:0,maxChord:kc/u}:void 0,d=Oa(e,n.filter,t,h,n.clipToTile===true,e.extent,Wr(n.dataPaint,r));return d?{kind:"fill",...d,extent:e.extent}:null}if(n.type==="surface"){let u=as(e,e.extent,n.filter,{metersPerUnit:o>0?o/e.extent:0,maxSegment:t,elevation:n.elevation??0,base:n.base,bevel:n.bevel,weld:n.weld,bevelDrop:n.bevelDrop,cornerRadius:n.cornerRadius,cornerSegments:n.cornerSegments,...i&&!n.fromLines&&n.groundField!==false?{onShapes:h=>ls(i,h,n.elevation??0,e.extent)}:{},...n.groundBy?{liftBy:Pg(n.groundBy)}:{},...n.fromLines?{widthOf:Rg(n.width,n.widthExtra),widthExtra:n.widthExtra??0}:{},...n.deck?{deck:n.deck}:{},...n.levelHeight&&!n.groundBy?{liftBy:kg(n.levelHeight)}:{},liftAt:c});return u?{kind:"surface",...u}:null}if(n.type==="line"){let u=d=>c(d)??Lg(d),h=fs(e,n.filter,t,n.ground?i:void 0,o>0?o/e.extent:0,{level:a,paint:Wr(n.dataPaint,r),liftAt:u});return h?{kind:"line",...h,extent:e.extent}:null}if(n.type==="model"){let u=jh(e,n.filter);return u?{kind:"placement",...u,extent:e.extent}:null}if(n.type==="symbol"){let u=Ys(e,{filter:n.filter,textField:n.textField,iconImage:n.iconImage,iconRotate:n.iconRotate,textPlacement:n.textPlacement,abbreviate:n.abbreviate});return u?{kind:"symbol",...u,extent:e.extent}:null}let f=Ra(e,e.extent,n.filter,{metersPerUnit:o>0?o/e.extent:0,cornerRadius:n.cornerRadius,cornerSegments:n.cornerSegments,paint:Wr(n.dataPaint,r)},s);return f?{kind:"fill-extrusion",vertices:f.vertices,indices:f.indices,featureIds:f.featureIds,vertexCount:f.vertexCount,indexCount:f.indexCount,extent:f.extent,...f.dataPaint?{dataPaint:f.dataPaint}:{}}:null}}function Gg(n,e,t){let o=[];for(let r of n.features()){if(!et(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 zg(n,e){let t=[];for(let o of n.features()){if(!et(e,o.properties))continue;let r=vt(o.properties);t.includes(r)||t.push(r);}return t.sort((o,r)=>o-r)}function Wg(n,e,t){let o=["==",e,t];return n?["all",n,o]:o}var Wi=new Map;function Zh(n){let e=n.indexOf("://");if(e<=0)return null;let t=n.slice(0,e),o=Wi.get(t);return o?{scheme:t,handler:o}:null}function qh(n){let e=n.raw?.byteLength??0;for(let t of Object.values(n.buckets)){let o=t;for(let r of Object.values(o))(r instanceof ArrayBuffer||ArrayBuffer.isView(r))&&(e+=r.byteLength);}return e}var Ni=class{constructor(e){this.id=e;this.state="loading";this.data=null;this.error=null;this.requestId=0;this.failures=0;this.retryAt=0;this.buckets=new fe;this.bytesHeld=0;}get raw(){return this.data?.raw}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;}},Qh=6,Ng=600,Vg=1e4,Ug=24;function Kg(n,e){let t=e.parent();for(;t&&t.z>=n.z;){if(t.dataKey===n.dataKey)return true;t=t.parent();}return false}function Xg(n,e){let t=new Le;for(let r of e)t.add(r.dataKey);let o=0;for(let r of e){let i=r.parent(),a=false;for(;i&&i.z>n.z;){if(t.has(i.dataKey)){a=true;break}i=i.parent();}a||(o+=Math.pow(4,n.z-r.z));}return o>=1}var ir=class extends yt{constructor(t,o){super();this.pool=t;this.visible=[];this.holes=[];this.retryWake=1/0;this.warmed=false;this.version=0;this.transform=null;this.protocolAborts=new fe;this.opts={cacheSize:160,detailBias:1,maxTiles:512,rank:1,now:()=>performance.now(),...o},this.cache=new fo(this.opts.cacheSize,(r,i)=>{i.state==="loading"&&this.pool.abort(i.requestId),i.destroy();});}get plan(){return this.opts.plan}get maxzoom(){return this.opts.maxzoom}newTile(t){let o=new Ni(t);return this.cache.set(t.dataKey,o),o}acceptTile(t,o){this.cache.peek(t.id.dataKey)===t&&(t.data=o,t.bytesHeld=qh(o),t.state=Object.keys(o.buckets).length?"loaded":"empty",this.version++,this.emit("data",{tile:t}));}failTile(t,o){t.state="error",t.error=o,t.failures++,t.retryAt=this.now()+Math.min(Ng*Math.pow(2,t.failures-1),Vg),this.emit("error",{tile:t.id,message:o});}now(){return this.opts.now()}drawable(t){return !!t&&(t.state==="loaded"||t.state==="empty")}invalidate(){for(let[t,o]of this.cache.entries())o.state==="loading"&&this.pool.abort(o.requestId),o.destroy(),this.cache.delete(t);this.visible=[],this.holes=[],this.version++,this.emit("data",{tile:null});}setLodParams(t){t.detailBias!==void 0&&(this.opts.detailBias=t.detailBias),t.maxTiles!==void 0&&(this.opts.maxTiles=t.maxTiles);}setTransformRequest(t){this.transform=t;}get retainedBytes(){let t=0;for(let o of this.cache.values())t+=o.bytesHeld;return t}dropOldest(){let t=new Le;for(let o of this.visibleTiles)t.add(o.dataKey);for(let[o,r]of this.cache.entries()){if(t.has(o)||r.state==="loading")continue;let i=r.bytesHeld;return this.cache.delete(o),i}return -1}get visibleTiles(){return this.visible}get holeTiles(){return this.holes}get nextRetryIn(){return Number.isFinite(this.retryWake)?Math.max(0,this.retryWake-this.now()):1/0}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}loadedTiles(){return this.cache.entries()}get pendingCount(){let t=0;for(let o of this.cache.values())o.state==="loading"&&t++;return t}update(t){let o=qt(t,this.opts),r=new Le;for(let c of o)r.add(c.dataKey);for(let[c,f]of this.cache.entries())f.state==="loading"&&!r.has(c)&&(this.pool.abort(f.requestId),this.cache.delete(c));let i=Math.max(this.opts.cacheSize,r.size*2);this.cache.setCapacity(i);let a=this.opts.rank*1e9;this.retryWake=1/0;for(let c of o){let f=this.cache.get(c.dataKey);if(!f){this.loadTile(c,a+t.distanceToTile(c));continue}if(f.state==="error")if(this.now()>=f.retryAt){let u=f.failures;this.loadTile(c,a+t.distanceToTile(c));let h=this.cache.peek(c.dataKey);h&&(h.failures=u);}else this.retryWake=Math.min(this.retryWake,f.retryAt);}let s=this.coverFor(o),l=this.readyFor(o);(this.anyReady(s.tiles)||this.visible.length===0||!this.covers(o))&&(this.visible=s.tiles,this.holes=s.holes,l&&o.length&&(this.warmed=true));}coverFor(t){let o=m=>this.drawable(this.cache.peek(m.dataKey)),r=new fe,i=new fe,a=[];for(let m of t)o(m)?r.set(m.dataKey,m):a.push(m);let s=this.descendantsOf(a),l=[];for(let m of t)o(m)&&l.push(m);for(let[,m]of s)for(let p of m)l.push(p);let c=m=>l.some(p=>Kg(m,p)),f=m=>{let p=m.parent();for(let b=1;p&&b<=Qh;b++,p=p.parent())if(o(p))return p;return null};for(let m of a){let p=s.get(m.dataKey);if(p&&p.length){for(let A of p)r.set(A.dataKey,A),this.cache.get(A.dataKey);if(Xg(m,p))continue;let y=f(m);y&&i.set(y.dataKey,y);continue}let b=f(m);if(!b){r.set(m.dataKey,m);continue}let g=b;if(c(g)){i.set(g.dataKey,g);continue}r.set(g.dataKey,g);}let u=[];for(let[,m]of r){let p=m.parent(),b=false;for(let g=0;p&&g<=Qh;g++){if(r.has(p.dataKey)){b=true;break}p=p.parent();}b||(u.push(m),this.cache.get(m.dataKey));}let h=[],d=new Le;for(let m of u)d.add(m.dataKey);for(let[,m]of i)d.has(m.dataKey)||(h.push(m),this.cache.get(m.dataKey));return h.sort((m,p)=>m.z-p.z),{tiles:u,holes:h}}descendantsOf(t){let o=new fe;for(let i of t)o.set(i.dataKey,i);let r=new fe;if(!o.size)return r;for(let[i,a]of this.cache.entries()){if(!this.drawable(a))continue;let s=a.id.parent();for(let l=0;s&&l<Ug;l++){let c=o.get(s.dataKey);if(c){let f=r.get(c.dataKey);f?f.push(a.id):r.set(c.dataKey,[a.id]);break}s=s.parent();}}return r}anyReady(t){for(let o of t)if(this.drawable(this.cache.peek(o.dataKey)))return true;return t.length===0}readyFor(t){for(let o of t)if(!this.drawable(this.cache.peek(o.dataKey)))return false;return true}covers(t){let o=new Le;for(let r of this.visible)o.add(r.dataKey);for(let r of t){if(o.has(r.dataKey))continue;let i=r.parent(),a=false;for(let s=0;i&&s<4;s++){if(o.has(i.dataKey)){a=true;break}i=i.parent();}if(!a)for(let s of this.visible){let l=s.parent();for(let c=0;l&&c<4;c++){if(l.dataKey===r.dataKey){a=true;break}l=l.parent();}if(a)break}if(!a)return false}return true}deactivate(){for(let[t,o]of this.cache.entries())o.state==="loading"&&(this.pool.abort(o.requestId),this.cache.delete(t));this.visible=[],this.holes=[];}loadTile(t,o=0){let r=new Ni(t);this.cache.set(t.dataKey,r);let i=this.opts.url.replace("{z}",String(t.z)).replace("{x}",String(t.x)).replace("{y}",String(t.y)),a=this.transform?.(i,"tile")??i,s=Zh(a);if(s){let c=new AbortController;this.protocolAborts.set(t.dataKey,c),s.handler(a,c.signal).then(f=>{if(this.protocolAborts.delete(t.dataKey),this.cache.peek(t.dataKey)!==r)return;if(!f){r.state="empty",this.emit("data",{tile:r});return}let u=un(new Ut(f),{zoom:t.z,metersPerTile:fr(t.z,t.y),tile:{z:t.z,x:t.x,y:t.y},sourceMaxZoom:this.opts.maxzoom,plan:this.opts.plan});this.acceptTile(r,{type:"loaded",id:0,raw:f,buckets:u.buckets,...u.seams.length?{seams:u.seams}:{},...u.levels.length?{levels:u.levels}:{},timing:{fetchMs:0,parseMs:0},diag:{status:200,bytes:f.byteLength,layers:[],built:Object.keys(u.buckets).length}});}).catch(f=>{this.protocolAborts.delete(t.dataKey),this.cache.peek(t.dataKey)===r&&this.failTile(r,f instanceof Error?f.message:String(f));});return}let l=Jg(a);r.requestId=this.pool.load({url:l,zoom:t.z,metersPerTile:fr(t.z,t.y),tile:{z:t.z,x:t.x,y:t.y},sourceMaxZoom:this.opts.maxzoom,plan:this.opts.plan},c=>{if(this.cache.peek(t.dataKey)===r){if(c.type==="error"){if(c.aborted)return;this.failTile(r,c.message);}else r.data=c,r.bytesHeld=qh(c),r.state=Object.keys(c.buckets).length?"loaded":"empty",this.version++,c.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 ${c.diag.failed.join("; ")}`),this.emit("data",{tile:r});this.pendingCount===0&&this.emit("idle",void 0);}},o);}findReadyAncestor(t,o=5){let r=t.parent();for(let 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 Jg(n){if(typeof location>"u")return n;try{return new URL(n,location.href).href}catch{return n}}var Vi=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;}},hn=class extends yt{constructor(t){super();this.visible=[];this.aborts=new Map;this.transform=null;this.opts={cacheSize:128,detailBias:1,maxTiles:256,...t},this.cache=new fo(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=qt(t,this.opts);let o=new Le;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();}setLodParams(t){t.detailBias!==void 0&&(this.opts.detailBias=t.detailBias),t.maxTiles!==void 0&&(this.opts.maxTiles=t.maxTiles);}setTransformRequest(t){this.transform=t;}loadTile(t){let o=new Vi(t);this.cache.set(t.dataKey,o);let r=new AbortController;this.aborts.set(t.dataKey,r);let i=Ui(this.opts.url,t);this.fetchImage(this.transform?.(i,"raster")??i,r.signal).then(a=>{if(this.aborts.delete(t.dataKey),this.cache.peek(t.dataKey)!==o){a.close();return}o.image=a,o.state="loaded",this.emit("data",{tile:o});}).catch(a=>{this.aborts.delete(t.dataKey),!r.signal.aborted&&this.cache.peek(t.dataKey)===o&&(o.state="error",o.error=a instanceof Error?a.message:String(a),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 Ui(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 Ki=class{constructor(e){this.id=e;this.state="loading";this.image=null;this.dem=null;this.error=null;this.texture=null;}destroy(){this.texture?.destroy(),this.texture=null,this.image?.close(),this.image=null,this.dem=null;}},dn=class extends yt{constructor(t){super();this.visible=[];this.aborts=new Map;this.opts={cacheSize:128,detailBias:2,maxTiles:64,encoding:"mapbox",...t},this.cache=new fo(this.opts.cacheSize,(o,r)=>{this.aborts.get(o)?.abort(),this.aborts.delete(o),r.destroy();});}get encoding(){return this.opts.encoding}get visibleTiles(){return this.visible}getTile(t){return this.cache.peek(t.dataKey)}update(t){this.visible=qt(t,this.opts);let o=new Le;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);}heights(t){if(t.dem)return t.dem;if(!t.image)return null;let o=jg(t.image);if(!o)return null;try{t.dem=new jr(o,t.image.width,this.opts.encoding);}catch(r){t.dem=null,console.warn("[osmgl] \u0442\u0430\u0439\u043B \u0440\u0435\u043B\u044C\u0435\u0444\u0430 \u043D\u0435 \u0440\u0430\u0437\u043E\u0431\u0440\u0430\u043B\u0441\u044F:",r instanceof Error?r.message:r);}return t.dem}destroy(){for(let t of this.aborts.values())t.abort();this.aborts.clear(),this.cache.clear(),this.removeAllListeners();}loadTile(t){let o=new Ki(t);this.cache.set(t.dataKey,o);let r=new AbortController;this.aborts.set(t.dataKey,r),this.fetchImage(Ui(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 \u0440\u0435\u043B\u044C\u0435\u0444\u0430 ${r.status} ${r.statusText}`);return createImageBitmap(await r.blob(),{premultiplyAlpha:"none",colorSpaceConversion:"none"})}};function jg(n){if(typeof OffscreenCanvas>"u"&&typeof document>"u")return null;let{width:e,height:t}=n,r=(typeof OffscreenCanvas<"u"?new OffscreenCanvas(e,t):Object.assign(document.createElement("canvas"),{width:e,height:t})).getContext("2d");return r?(r.drawImage(n,0,0),r.getImageData(0,0,e,t).data):null}var mn=class extends yt{constructor(t){super();this.options=t;this.content=null;this.corners=[];this.version=0;this.video=null;this.kind=t.kind,this.animate=t.animate??t.kind!=="image",this.setCoordinates(t.coordinates),this.load();}get live(){return this.kind==="video"?!!this.video&&!this.video.paused&&!this.video.ended:this.kind==="canvas"&&this.animate}setCoordinates(t){return this.corners=t.map(o=>{let r=Pe(o);return [Oe(r.lng),Ge(r.lat)]}),this.version++,this.emit("data",{source:this}),this}getCoordinates(){return this.options.coordinates}async updateImage(t){return t.coordinates&&this.setCoordinates(t.coordinates),t.url&&(this.options.url=t.url,await this.load()),this}getVideo(){return this.video}play(){this.video?.play();}pause(){this.video?.pause();}setAnimate(t){this.animate=t;}destroy(){this.video?.pause(),this.video=null,this.content=null;}async load(){try{if(this.kind==="canvas"){let t=typeof this.options.canvas=="string"?document.getElementById(this.options.canvas):this.options.canvas??null;if(!t)throw new Error("canvas \u043D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D");this.content=t;}else if(this.kind==="video"){let t=document.createElement("video");t.crossOrigin="anonymous",t.loop=!0,t.muted=!0,t.playsInline=!0;let o=Array.isArray(this.options.url)?this.options.url:[this.options.url??""];for(let r of o){let i=document.createElement("source");i.src=r,t.appendChild(i);}await new Promise((r,i)=>{t.onloadeddata=()=>r(),t.onerror=()=>i(new Error("\u0432\u0438\u0434\u0435\u043E \u043D\u0435 \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u043B\u043E\u0441\u044C")),t.load();}),this.video=t,this.content=t,t.play();}else {let t=Array.isArray(this.options.url)?this.options.url[0]:this.options.url;if(!t)throw new Error("\u043D\u0435 \u0437\u0430\u0434\u0430\u043D \u0430\u0434\u0440\u0435\u0441 \u043A\u0430\u0440\u0442\u0438\u043D\u043A\u0438");let o=new Image;o.crossOrigin="anonymous",await new Promise((r,i)=>{o.onload=()=>r(),o.onerror=()=>i(new Error(`\u043A\u0430\u0440\u0442\u0438\u043D\u043A\u0430 ${t} \u043D\u0435 \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u043B\u0430\u0441\u044C`)),o.src=t;}),this.content=o;}this.version++,this.emit("data",{source:this});}catch(t){this.emit("error",{message:t instanceof Error?t.message:String(t)});}}};var pn=4096,bn=class extends ir{constructor(t,o={}){super(t,{...o,url:"",plan:o.plan??[],minzoom:o.minzoom??0,maxzoom:o.maxzoom??18});this.features=[];this.clusters=new Map;this.layerName=o.sourceLayer??"geojson",this.bufferUnits=o.buffer??pn/32,this.clusterOn=o.cluster??false,this.clusterRadiusPx=o.clusterRadius??50,this.clusterTopZoom=o.clusterMaxZoom??(o.maxzoom??18)-1,o.data&&this.setData(o.data);}async setData(t){let o=typeof t=="string"?await(await fetch(t)).json():t;this.features=Zg(o),this.clusters.clear(),this.invalidate();}get featureCount(){return this.features.length}loadTile(t){let o=this.newTile(t),r=this.clusterOn&&t.z<=this.clusterTopZoom?this.clustersFor(t.z):this.features,i=qg(r,t,this.bufferUnits);try{let a=un({layers:{[this.layerName]:i}},{zoom:t.z,metersPerTile:fr(t.z,t.y),tile:{z:t.z,x:t.x,y:t.y},sourceMaxZoom:this.maxzoom,plan:this.plan});this.acceptTile(o,{type:"loaded",id:0,buckets:a.buckets,...a.seams.length?{seams:a.seams}:{},...a.levels.length?{levels:a.levels}:{},timing:{fetchMs:0,parseMs:0},diag:{status:200,bytes:0,layers:[this.layerName],built:Object.keys(a.buckets).length}});}catch(a){this.failTile(o,a instanceof Error?a.message:String(a));}}clustersFor(t){let o=this.clusters.get(t);if(o)return o;let r=this.clusterRadiusPx/(512*Math.pow(2,t)),i=new Map,a=[];for(let l of this.features){if(l.type!==1){a.push(l);continue}let c=l.rings[0][0],f=l.rings[0][1],u=`${Math.floor(c/r)}\u241F${Math.floor(f/r)}`,h=i.get(u);h?(h.x+=c,h.y+=f,h.count++):i.set(u,{x:c,y:f,count:1,first:l});}let s=0;for(let l of i.values()){if(l.count===1){a.push(l.first);continue}let c=l.x/l.count,f=l.y/l.count;a.push({id:++s,type:1,properties:{cluster:true,cluster_id:s,point_count:l.count,point_count_abbreviated:Yg(l.count)},rings:[[c,f]],minX:c,minY:f,maxX:c,maxY:f});}return this.clusters.set(t,a),a}};function Yg(n){return n<1e3?String(n):n<1e4?`${Math.round(n/100)/10}k`:n<1e6?`${Math.round(n/1e3)}k`:`${Math.round(n/1e5)/10}M`}function Zg(n){let e=n.type==="FeatureCollection"?n.features:[n],t=[],o=0;for(let r of e){let i=r.geometry;if(!i)continue;let a=Number(r.id??++o),s={...r.properties??{}},l=(c,f)=>{let u=f.map(b=>{let g=[];for(let[y,A]of b)g.push(Oe(y),Ge(A));return g}).filter(b=>b.length>=2);if(!u.length)return;let h=1/0,d=1/0,m=-1/0,p=-1/0;for(let b of u)for(let g=0;g<b.length;g+=2)h=Math.min(h,b[g]),m=Math.max(m,b[g]),d=Math.min(d,b[g+1]),p=Math.max(p,b[g+1]);t.push({id:a,type:c,properties:s,rings:u,minX:h,minY:d,maxX:m,maxY:p});};switch(i.type){case "Point":l(1,[[i.coordinates]]);break;case "MultiPoint":l(1,[i.coordinates]);break;case "LineString":l(2,[i.coordinates]);break;case "MultiLineString":l(2,i.coordinates);break;case "Polygon":l(3,i.coordinates);break;case "MultiPolygon":for(let c of i.coordinates)l(3,c);break}}return t}function qg(n,e,t){let o=1<<e.z,r=t/pn/o,i=e.x/o-r,a=(e.x+1)/o+r,s=e.y/o-r,l=(e.y+1)/o+r,c=[];for(let f of n){if(f.maxX<i||f.minX>a||f.maxY<s||f.minY>l)continue;let u=[];for(let h of f.rings){let d=f.type===3?ey(h,i,s,a,l):f.type===2?ty(h,i,s,a,l):[h];for(let m of d){let p=[];for(let b=0;b<m.length;b+=2)p.push((m[b]*o-e.x)*pn,(m[b+1]*o-e.y)*pn);p.length>=2&&u.push(p);}}if(u.length){if(f.type===3)for(let h=0;h<u.length;h++){let d=Qg(u[h]),m=Fa(d),p=h===0;u[h]=m>0===p?d:$g(d);}c.push({id:f.id,type:f.type,properties:f.properties,rings:u});}}return {name:"geojson",extent:pn,length:c.length,*features(){for(let f of c)yield {id:f.id,type:f.type,properties:f.properties,loadGeometry:()=>f.rings};}}}function Qg(n){let e=n.length;return e>=4&&n[0]===n[e-2]&&n[1]===n[e-1]?n:[...n,n[0],n[1]]}function $g(n){let e=[];for(let t=n.length-2;t>=0;t-=2)e.push(n[t],n[t+1]);return e}function ey(n,e,t,o,r){let i=n,a=[[s=>s>=e,(s,l,c,f)=>Xi(s,l,c,f,(e-s)/(c-s))],[s=>s<=o,(s,l,c,f)=>Xi(s,l,c,f,(o-s)/(c-s))],[(s,l)=>l>=t,(s,l,c,f)=>Xi(s,l,c,f,(t-l)/(f-l))],[(s,l)=>l<=r,(s,l,c,f)=>Xi(s,l,c,f,(r-l)/(f-l))]];for(let[s,l]of a){let c=[];for(let f=0;f<i.length;f+=2){let u=i[f],h=i[f+1],d=(f+2)%i.length,m=i[d],p=i[d+1],b=s(u,h),g=s(m,p);if(b&&c.push(u,h),b!==g){let[y,A]=l(u,h,m,p);c.push(y,A);}}if(i=c,i.length<6)return []}return [i]}function Xi(n,e,t,o,r){let i=Number.isFinite(r)?Math.min(Math.max(r,0),1):0;return [n+(t-n)*i,e+(o-e)*i]}function ty(n,e,t,o,r){let i=[],a=[],s=(l,c)=>l>=e&&l<=o&&c>=t&&c<=r;for(let l=0;l+3<n.length;l+=2){let c=n[l],f=n[l+1],u=n[l+2],h=n[l+3],d=s(c,f),m=s(u,h);if(d&&m){a.length||a.push(c,f),a.push(u,h);continue}let p=oy(c,f,u,h,e,t,o,r);if(!p){a.length>=4&&i.push(a),a=[];continue}a.length||a.push(p[0],p[1]),a.push(p[2],p[3]),m||(a.length>=4&&i.push(a),a=[]);}return a.length>=4&&i.push(a),i}function oy(n,e,t,o,r,i,a,s){let l=0,c=1,f=t-n,u=o-e;for(let h=0;h<4;h++){let d=h===0?-f:h===1?f:h===2?-u:u,m=h===0?n-r:h===1?a-n:h===2?e-i:s-e;if(d===0){if(m<0)return null;continue}let p=m/d;if(d<0){if(p>c)return null;p>l&&(l=p);}else {if(p<l)return null;p<c&&(c=p);}}return [n+f*l,e+u*l,n+f*c,e+u*c]}var ry="osmgl-assets",ar="assets";var Ji=null;function ed(){return Ji||(Ji=new Promise(n=>{if(typeof indexedDB>"u")return n(null);try{let e=indexedDB.open(ry,1);e.onupgradeneeded=()=>{let t=e.result;t.objectStoreNames.contains(ar)||t.createObjectStore(ar,{keyPath:"key"});},e.onsuccess=()=>n(e.result),e.onerror=()=>n(null);}catch{n(null);}}),Ji)}function ny(n){return ed().then(e=>new Promise(t=>{if(!e)return t(null);try{let o=e.transaction(ar,"readonly").objectStore(ar).get(n);o.onsuccess=()=>t(o.result??null),o.onerror=()=>t(null);}catch{t(null);}}))}function iy(n){ed().then(e=>{if(e)try{e.transaction(ar,"readwrite").objectStore(ar).put(n);}catch{}});}var $h=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 ay(n,e,t){let o=await crypto.subtle.importKey("raw",$h(e),"AES-GCM",false,["decrypt"]);return crypto.subtle.decrypt({name:"AES-GCM",iv:$h(t),tagLength:128},o,n)}var gn=class{constructor(e){this.keys=new Map;this.variants=null;this.inflight=new Map;this.endpoint=e.endpoint.replace(/\/+$/,""),this.apiKey=e.apiKey??null;}withKey(e){return this.apiKey?e+(e.includes("?")?"&":"?")+"key="+encodeURIComponent(this.apiKey):e}loadVariants(){return this.variants??(this.variants=fetch(this.withKey(`${this.endpoint}/variants`),{credentials:"same-origin"}).then(e=>e.ok?e.json():{}).catch(()=>({}))),this.variants}async resolve(e,t){return t?(await this.loadVariants())[String(e)]?.[t]??e:e}async load(e,t,o="",r){let i=await this.resolve(e,o),a=`${i}:${t}`,s=this.inflight.get(a);if(s)return s;let l=this.fetchAsset(a,i,t,r).finally(()=>this.inflight.delete(a));return this.inflight.set(a,l),l}async fetchAsset(e,t,o,r){let i,a,s=await ny(e);if(s)i=s.bytes,a=s.encrypted;else {let c=await fetch(this.withKey(`${this.endpoint}/files/${t}/data?lod=${o}`),{signal:r,credentials:"same-origin"});if(!c.ok)throw new Error(`data ${c.status}`);a=(c.headers.get("X-Enc")??"none")!=="none",i=await c.arrayBuffer(),iy({key:e,bytes:i,encrypted:a,savedAt:Date.now()});}if(!a)return i;let l=await this.getKey(t,r);if(!l)throw new Error("\u043D\u0435\u0442 \u043A\u043B\u044E\u0447\u0430 \u0440\u0430\u0441\u0448\u0438\u0444\u0440\u043E\u0432\u043A\u0438");return ay(i,l.key,l.iv)}getKey(e,t){let o=this.keys.get(e);if(o)return o;let r=(async()=>{let i=await fetch(this.withKey(`${this.endpoint}/files/${e}/key`),{signal:t,credentials:"same-origin"});if(!i.ok)return null;let a=await i.json();return a.encrypted&&a.key&&a.iv?{key:a.key,iv:a.iv}:null})();return r.catch(()=>this.keys.delete(e)),this.keys.set(e,r),r}};var sy=1,yn=class{constructor(e){this.groundZ=0;this.mesh=null;this.bitmaps=[];this.error=null;this.loading=null;this.matrix=Fe();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-${sy++}`,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 Rs(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=Pe(this.coordinates);return {x:Oe(e.lng),y:Ge(e.lat)}}localMatrix(e){let t=this.effectiveScale(),o=t/Mt(e),r=[o,0,0,0,0,t*this.grow,0,o,0],i=c=>c*Math.PI/180,a=Qs(i(-this.rotation));this.rotationTiltX&&(a=uo(qs(i(this.rotationTiltX)),a)),this.rotationTiltZ&&(a=uo($s(i(this.rotationTiltZ)),a));let s=uo(r,a),l=this.matrix;return Wt(l),l[0]=s[0],l[1]=s[1],l[2]=s[2],l[4]=s[3],l[5]=s[4],l[6]=s[5],l[8]=s[6],l[9]=s[7],l[10]=s[8],l[15]=1,l}matrixInSpace(e,t){let o=Pe(this.coordinates),r=Fe();for(let a=0;a<16;a++)r[a]=e[a];let i=Fe();return at(i,r,this.localMatrix(o.lat)),Nt(t??this.matrix32,i)}cameraInModelSpace(e){let t=this.effectiveScale();if(!(t>0))return [0,0,0];let o=this.origin(),r=Pe(this.coordinates),i=Mt(r.lat),a=e.worldSize,s=e.cameraPositionPx,l=(s[0]/a-o.x)*i,c=(s[1]/a-o.y)*i,f=s[2]/e.pixelsPerMeter-(this.altitude+this.groundZ),u=l,h=f,d=c,m=b=>b*Math.PI/180,p=Qs(m(-this.rotation));return this.rotationTiltX&&(p=uo(qs(m(this.rotationTiltX)),p)),this.rotationTiltZ&&(p=uo($s(m(this.rotationTiltZ)),p)),[(p[0]*u+p[1]*h+p[2]*d)/t,(p[3]*u+p[4]*h+p[5]*d)/t,(p[6]*u+p[7]*h+p[8]*d)/t]}matrixFor(e){let t=this.origin();return this.matrixInSpace(e.objectMatrix(t.x,t.y,this.altitude+this.groundZ))}coversPoint(e,t){let o=this.mesh;if(!o)return false;let r=this.origin(),i=e-r.x,a=t-r.y,s=Pe(this.coordinates),l=this.localMatrix(s.lat),c=l[0],f=l[1],u=l[8],h=l[9],d=c*h-f*u;if(Math.abs(d)<1e-30)return false;let m=(i*h-a*u)/d,p=(c*a-f*i)/d,b=1.05,g=(o.min[0]+o.max[0])/2,y=(o.min[2]+o.max[2])/2,A=(o.max[0]-o.min[0])/2*b,x=(o.max[2]-o.min[2])/2*b;return Math.abs(m-g)<=A&&Math.abs(p-y)<=x}get isAnimated(){return this.mesh?.animation!=null}matrixForNode(e,t,o){let r=this.origin();return this.matrixInSpaceForNode(e.objectMatrix(r.x,r.y,this.altitude+this.groundZ),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=Fe();for(let u=0;u<16;u++)a[u]=e[u];let s=Pe(this.coordinates),l=Fe();at(l,a,this.localMatrix(s.lat));let c=Fe();Ps(i,t,i.duration>0?o%i.duration:0,c);let f=Fe();return at(f,l,c),Nt(r,f)}normalMatrix(){let e=i=>i*Math.PI/180,t=Qs(e(-this.rotation));this.rotationTiltX&&(t=uo(qs(e(this.rotationTiltX)),t)),this.rotationTiltZ&&(t=uo($s(e(this.rotationTiltZ)),t));let o=uo([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 uo(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 qs=n=>{let e=Math.cos(n),t=Math.sin(n);return [1,0,0,0,e,t,0,-t,e]},Qs=n=>{let e=Math.cos(n),t=Math.sin(n);return [e,0,-t,0,1,0,t,0,e]},$s=n=>{let e=Math.cos(n),t=Math.sin(n);return [e,t,0,-t,e,0,0,0,1]};var Yi=class{constructor(){this.hit=new fe;this.miss=new Le;this.stamp="";}find(e,t){if(!t)return null;let o=this.hit.get(e.id);if(o!==void 0)return o;let r=t.source.visibleTiles.map(i=>i.dataKey).join(",");if(r!==this.stamp&&(this.stamp=r,this.miss.clear()),this.miss.has(e.id))return null;for(let i of t.source.visibleTiles){let a=t.source.getTile(i)?.data?.buckets?.[t.key];if(!a||a.kind!=="fill-extrusion"||!a.featureIds)continue;let s=i.bounds();if(e.mercX<s.minX||e.mercX>s.maxX||e.mercY<s.minY||e.mercY>s.maxY)continue;let l=(e.mercX-s.minX)/(s.maxX-s.minX)*a.extent,c=(e.mercY-s.minY)/(s.maxY-s.minY)*a.extent,f=new Int16Array(a.vertices),u=new Uint32Array(a.indices),h=new Float64Array(a.featureIds),d=f.length/a.vertexCount;for(let m=0;m*3+2<u.length;m++){let p=u[m*3]*d,b=u[m*3+1]*d,g=u[m*3+2]*d;if(!my(l,c,f[p],f[p+1],f[b],f[b+1],f[g],f[g+1]))continue;let y=h[m];return this.hit.set(e.id,y),y}}return this.miss.add(e.id),null}clear(){this.hit.clear(),this.miss.clear(),this.stamp="";}},ly=14,cy=2e3,fy=4e3,td=160,uy=50,hy=4e3,el=6,Zi=class{constructor(e){this.wantKey="";this.modelKey="";this.entries=new fe;this.loading=0;this.pending=[];this.known=new fe;this.underBuilding=new Yi;this.underVenue=new Yi;this.tilesStamp="";this.rulesInScan=0;this.found=[];this.foundStamp="";this.sortedAt=null;this.budgetScale=1;this.addModel=null;this.lod=0;this.budget=td;this.replacedBuildings=new Le;this.replacedReal=new Le;this.replacedVenues=new Le;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 gn(e);}get models(){let e=[];for(let t of this.entries.values())e.push(t.model);return e}update(e,t,o,r,i,a,s){this.wantKey!==this.modelKey&&(this.modelKey=this.wantKey,this.clear(i));let l=e.layout??{},c=l.minZoom??ly,f=l.loadRadius??cy,u=Math.max(l.keepRadius??fy,f),h=l.fullBudget===true?1:Math.min(1,Math.max(.25,(o.zoom-c)/3)),d=Math.max(8,Math.round((l.budget??td)*this.budgetScale*h));this.budget=d,this.addModel=r;let m=l.maskReplaced!==false,p=performance.now();if(o.zoom<c){for(let L of [...this.entries.values()])L.model.retire(),L.model.grow<=0&&this.release(L,i);this.replacedBuildings.clear(),this.replacedReal.clear(),this.replacedVenues.clear();return}let b=o.center,g=l.fullDetail===true?0:this.lodFor(o.zoom,c);this.lod=g;let y="";for(let L of t.visibleTiles)y+=L.dataKey+(t.getTile(L)?.data?"+":"-");let A=this.rulesInScan;if(y!==this.tilesStamp){this.tilesStamp=y;let L=new Le;A=0;for(let X of t.visibleTiles){let Q=t.getTile(X)?.data?.buckets?.[e.id];if(!Q||!Zu(Q))continue;let G=new Int16Array(Q.anchors),Y=X.bounds(),ie=Y.maxX-Y.minX,ee=Y.maxY-Y.minY;for(let ue=0;ue<Q.props.length;ue++){let $=Q.props[ue],Ae=_o($.file,NaN);if(!Number.isFinite(Ae))continue;let ve=String($.kind??"model"),he=ve==="rule"?`t-${$.rid}-${$.oid}`:`m-${$.mid}`;if(L.has(he))continue;L.add(he),ve==="rule"&&A++;let xe=Y.minX+G[ue*2]/Q.extent*ie,de=Y.minY+G[ue*2+1]/Q.extent*ee,we=dy(xe,de);this.known.set(he,{id:he,fileId:Ae,lng:we.lng,lat:we.lat,mercX:xe,mercY:de,altitude:_o($.alt,0),scale:_o($.scale,1),rotation:_o($.rx,0),tiltX:_o($.rz,0),tiltZ:_o($.ry,0),kind:ve==="rule"?"rule":"model",target:od(ve==="rule"?$.oid:$.replaces),replaces:m?ve==="rule"?ji($.oid):String($.anchor??"replace")==="replace"?ji($.replaces_all).length?ji($.replaces_all):ji($.replaces):[]:[]});}}this.rulesInScan=A;}y!==this.foundStamp&&(this.foundStamp=y,this.found=[...this.known.values()],this.sortedAt=null);let x=this.found,v=new Le;for(let L of x)L.kind==="model"&&L.target!==null&&v.add(L.target);let w=111320,C=Math.cos(b.lat*Math.PI/180),B=L=>Math.hypot((L.lng-b.lng)*w*C,(L.lat-b.lat)*w);this.replacedBuildings.clear(),this.replacedReal.clear(),this.replacedVenues.clear();let _=new Le,T=[],k=0,K=0;(this.sortedAt===null||Math.hypot((b.lng-this.sortedAt.lng)*w*C,(b.lat-this.sortedAt.lat)*w)>uy)&&(x.sort((L,X)=>B(L)-B(X)),this.sortedAt={lng:b.lng,lat:b.lat});let W=0;for(let L of x){let X=B(L);if(X>u){k++;continue}if(L.kind==="rule"&&L.target!==null&&v.has(L.target)){let ie=this.entries.get(L.id);ie&&ie.model.retire();continue}let Q=this.entries.get(L.id);if(W>=d){K++,Q&&Q.model.retire();continue}W++,_.add(L.id);let G=()=>{if(!L.replaces.length)return;for(let ue of L.replaces){this.replacedBuildings.add(ue),this.replacedReal.add(ue);for(let $=0;$<10;$++)this.replacedBuildings.add(ue*10+$);}let ie=this.underBuilding.find(L,a);ie!==null&&this.replacedBuildings.add(ie);let ee=this.underVenue.find(L,s);ee!==null&&this.replacedVenues.add(ee);},Y=Q;if(Y){G(),Y.distance=X,Y.leftAt=0,Y.model.revive(),g<Y.lod&&!Y.upgrading&&this.loading<el&&this.upgrade(Y,g,r,i);continue}if(X>f){k++;continue}if(this.loading>=el){T.push(L),G();continue}G(),this.spawn(L,X,g,r);}for(let L of [...this.entries.values()])if(!_.has(L.placement.id)){if(L.leftAt===0){L.leftAt=p;continue}p-L.leftAt>hy&&L.model.retire();}for(let L of [...this.entries.values()])L.model.growTarget===0&&L.model.grow<=0&&this.release(L,i);if(this.known.size>4e3)for(let[L,X]of [...this.known.entries()])B(X)>u*3&&this.known.delete(L);let z=this.stats;z.found=x.length,z.kept=_.size,z.live=this.entries.size,z.tooFar=k,z.overBudget=K,z.queued=T.length,z.rules=A,z.loadingNow=this.loading,z.pendingNow=T.length,z.replaced=this.replacedReal.size,this.pending=T;}pump(){let e=this.addModel;if(this.stats.loadingNow=this.loading,this.stats.pendingNow=this.pending.length,!!e)for(;this.pending.length&&this.loading<el&&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 yn({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.replacedReal.clear(),this.replacedVenues.clear(),this.underBuilding.clear(),this.underVenue.clear();for(let t of Object.keys(this.stats))this.stats[t]=0;}},_o=(n,e)=>{let t=typeof n=="number"?n:Number(n);return Number.isFinite(t)?t:e},ji=n=>{if(n==null)return [];let e=[];for(let t of String(n).split(",")){let o=Number(t);Number.isFinite(o)&&o!==0&&e.push(o);}return e},od=n=>{let e=_o(n,NaN);return Number.isFinite(e)?e:null};function dy(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 my(n,e,t,o,r,i,a,s){let l=(n-r)*(o-i)-(t-r)*(e-i),c=(n-a)*(i-s)-(r-a)*(e-s),f=(n-t)*(s-o)-(a-t)*(e-o),u=l<0||c<0||f<0,h=l>0||c>0||f>0;return !(u&&h)}function py(n,e,t){return nd(n)?.get(e)?.get(t)??{}}var qi=new WeakMap;function nd(n){let e=qi.get(n);if(e!==void 0)return e;let t=n.raw;if(!t)return qi.set(n,null),null;let o=new Map;try{let r=new Ut(t);for(let[i,a]of Object.entries(r.layers)){let s=new Map;for(let l of a.features()){let c=l.properties.osm_id,f=Number(c??l.id??-1);f>=0&&s.set(f,{...l.properties});}o.set(i,s);}}catch{return qi.set(n,null),null}return qi.set(n,o),o}function by(n,e){return Array.isArray(n)?{x1:Math.min(n[0].x,n[1].x)-e,y1:Math.min(n[0].y,n[1].y)-e,x2:Math.max(n[0].x,n[1].x)+e,y2:Math.max(n[0].y,n[1].y)+e}:{x1:n.x-e,y1:n.y-e,x2:n.x+e,y2:n.y+e}}function tl(n,e,t,o,r,i){let a=r.tolerance??4,s=by(o,a),l=r.layers&&r.layers.length?new Set(r.layers):null,c=[],f=new Set;for(let u of t){if(l&&!l.has(u.id)||u.type==="raster"||u.visible===false)continue;let h=e.get(u.source??"base");if(!h)continue;let d="source-layer"in u?u["source-layer"]:"";for(let m of h.visibleTiles){let p=h.getTile(m);if(p?.data)for(let[b,g]of Object.entries(p.data.buckets)){if(b!==u.id&&!b.startsWith(u.id+"\u241F")||!("extent"in g)||!("kind"in g))continue;let y=Ay(n,m,g.extent,s);if(!y)continue;let A=gy(g,y);for(let x of A){let v=`${u.id}\u241F${x}`;f.has(v)||(f.add(v),c.push({id:x,source:u.source??"base",sourceLayer:d,layer:u.id,properties:py(p,d,x),state:i(u.source??"base",d,x),tile:m}));}}}}return c.reverse()}function gy(n,e){return n.kind==="surface"?yy(n,e):n.featureIds?n.kind==="line"?xy(n,e):n.kind==="fill-extrusion"?rd(n,e,(t,o)=>[t.getInt16(o*rt,true)/Xt,t.getInt16(o*rt+2,true)/Xt]):n.kind==="fill"?rd(n,e,(t,o)=>[t.getInt16(o*Ft,true),t.getInt16(o*Ft+2,true)]):[]:[]}function yy(n,e){if(!n.shapeRanges||!n.shapeFeatures)return [];let t=new DataView(n.vertices),o=new Uint32Array(n.indices),r=new Uint32Array(n.shapeRanges),i=new Float64Array(n.shapeFeatures),a=(e.x1+e.x2)/2,s=(e.y1+e.y2)/2,l=f=>[t.getFloat32(f*Jt,true),t.getFloat32(f*Jt+4,true)],c=new Set;for(let f=0;f*4+1<r.length;f++){let u=r[f*4],h=r[f*4+1],d=false;for(let b=u;b+2<h&&!d;b+=3){let[g,y]=l(o[b]),[A,x]=l(o[b+1]),[v,w]=l(o[b+2]);if(Math.max(g,A,v)<e.x1||Math.min(g,A,v)>e.x2||Math.max(y,x,w)<e.y1||Math.min(y,x,w)>e.y2)continue;let C=(a-A)*(y-x)-(g-A)*(s-x),B=(a-v)*(x-w)-(A-v)*(s-w),_=(a-g)*(w-y)-(v-g)*(s-y),T=C<0||B<0||_<0,k=C>0||B>0||_>0;d=!(T&&k);}if(!d)continue;let m=0;for(let b=0;b<f&&m<i.length;b++)m+=1+i[m];if(m>=i.length)break;let p=i[m];for(let b=0;b<p;b++)c.add(i[m+1+b]);}return [...c]}function Ay(n,e,t,o){let r=[{x:o.x1,y:o.y1},{x:o.x2,y:o.y1},{x:o.x1,y:o.y2},{x:o.x2,y:o.y2}],i=1<<e.z,a=1/0,s=1/0,l=-1/0,c=-1/0;for(let u of r){let h=n.pointToWorldPx(u),d=(h.x/n.worldSize*i-e.x)*t,m=(h.y/n.worldSize*i-e.y)*t;a=Math.min(a,d),l=Math.max(l,d),s=Math.min(s,m),c=Math.max(c,m);}let f=t/4;return l<-f||c<-f||a>t+f||s>t+f?null:{x1:a,y1:s,x2:l,y2:c}}function rd(n,e,t){let o=new DataView(n.vertices),r=new Uint32Array(n.indices),i=new Float64Array(n.featureIds),a=new Set,s=(e.x1+e.x2)/2,l=(e.y1+e.y2)/2;for(let c=0;c*3<r.length&&c<i.length;c++){let f=i[c];if(a.has(f))continue;let[u,h]=t(o,r[c*3]),[d,m]=t(o,r[c*3+1]),[p,b]=t(o,r[c*3+2]);if(Math.max(u,d,p)<e.x1||Math.min(u,d,p)>e.x2||Math.max(h,m,b)<e.y1||Math.min(h,m,b)>e.y2)continue;let g=(s-d)*(h-m)-(u-d)*(l-m),y=(s-p)*(m-b)-(d-p)*(l-b),A=(s-u)*(b-h)-(p-u)*(l-h),x=g<0||y<0||A<0,v=g>0||y>0||A>0;x&&v||a.add(f);}return [...a]}function xy(n,e){let t=new DataView(n.vertices),o=new Uint32Array(n.indices),r=new Float64Array(n.featureIds),i=new Set,a=(e.x1+e.x2)/2,s=(e.y1+e.y2)/2,l=Math.max(e.x2-e.x1,e.y2-e.y1)/2;for(let c=0;c*3<o.length&&c<r.length;c++){let f=r[c];if(i.has(f))continue;let u=o[c*3],h=t.getInt16(u*bt,true),d=t.getInt16(u*bt+2,true),m=t.getInt16(u*bt+4,true),p=t.getInt16(u*bt+6,true),b=m-h,g=p-d,y=b*b+g*g,A=y>0?Math.min(Math.max(((a-h)*b+(s-d)*g)/y,0),1):0,x=h+b*A,v=d+g*A;Math.hypot(a-x,s-v)<=l&&i.add(f);}return [...i]}function ol(n,e,t,o){let r=[],i=new Set;for(let a of n.visibleTiles){let s=n.getTile(a),l=s?nd(s):null;if(!(!s||!l)){for(let[c,f]of l)if(!(t.sourceLayer&&c!==t.sourceLayer))for(let[u,h]of f){if(t.filter&&!t.filter(h))continue;let d=`${c}\u241F${u}`;i.has(d)||(i.add(d),r.push({id:u,source:e,sourceLayer:c,layer:"",properties:h,state:o(e,c,u),tile:a}));}}}return r}var wy=200,vy={center:"translate(-50%, -50%)",top:"translate(-50%, 0)",bottom:"translate(-50%, -100%)",left:"translate(0, -50%)",right:"translate(-100%, -50%)"},An=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=vy[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??Cy),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=Pe(this._coordinates),o=e.worldSize,r=e.worldPxToPoint(Oe(t.lng)*o,Ge(t.lat)*o,this.altitude);if(!r){this.culled=true,this.applyVisibility();return}let i=wy;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";}},Cy='<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 xn=class extends An{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 rl='"use strict";(()=>{var fo=Object.create;var An=Object.defineProperty;var ho=Object.getOwnPropertyDescriptor;var mo=Object.getOwnPropertyNames;var po=Object.getPrototypeOf,bo=Object.prototype.hasOwnProperty;var go=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var xo=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of mo(t))!bo.call(e,o)&&o!==n&&An(e,o,{get:()=>t[o],enumerable:!(i=ho(t,o))||i.enumerable});return e};var yo=(e,t,n)=>(n=e!=null?fo(po(e)):{},xo(t||!e||!e.__esModule?An(n,"default",{value:e,enumerable:!0}):n,e));var Vr=go((dn,bn)=>{(function(e,t){typeof dn=="object"&&typeof bn<"u"?bn.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self,e.polygonClipping=t())})(dn,function(){"use strict";function e(M,a){var h={label:0,sent:function(){if(b[0]&1)throw b[1];return b[1]},trys:[],ops:[]},d,x,b,F;return F={next:R(0),throw:R(1),return:R(2)},typeof Symbol=="function"&&(F[Symbol.iterator]=function(){return this}),F;function R(k){return function(C){return I([k,C])}}function I(k){if(d)throw new TypeError("Generator is already executing.");for(;h;)try{if(d=1,x&&(b=k[0]&2?x.return:k[0]?x.throw||((b=x.return)&&b.call(x),0):x.next)&&!(b=b.call(x,k[1])).done)return b;switch(x=0,b&&(k=[k[0]&2,b.value]),k[0]){case 0:case 1:b=k;break;case 4:return h.label++,{value:k[1],done:!1};case 5:h.label++,x=k[1],k=[0];continue;case 7:k=h.ops.pop(),h.trys.pop();continue;default:if(b=h.trys,!(b=b.length>0&&b[b.length-1])&&(k[0]===6||k[0]===2)){h=0;continue}if(k[0]===3&&(!b||k[1]>b[0]&&k[1]<b[3])){h.label=k[1];break}if(k[0]===6&&h.label<b[1]){h.label=b[1],b=k;break}if(b&&h.label<b[2]){h.label=b[2],h.ops.push(k);break}b[2]&&h.ops.pop(),h.trys.pop();continue}k=a.call(M,h)}catch(C){k=[6,C],x=0}finally{d=b=0}if(k[0]&5)throw k[1];return{value:k[0]?k[1]:void 0,done:!0}}}var t=function(){function M(a,h){this.next=null,this.key=a,this.data=h,this.left=null,this.right=null}return M}();function n(M,a){return M>a?1:M<a?-1:0}function i(M,a,h){for(var d=new t(null,null),x=d,b=d;;){var F=h(M,a.key);if(F<0){if(a.left===null)break;if(h(M,a.left.key)<0){var R=a.left;if(a.left=R.right,R.right=a,a=R,a.left===null)break}b.left=a,b=a,a=a.left}else if(F>0){if(a.right===null)break;if(h(M,a.right.key)>0){var R=a.right;if(a.right=R.left,R.left=a,a=R,a.right===null)break}x.right=a,x=a,a=a.right}else break}return x.right=a.left,b.left=a.right,a.left=d.right,a.right=d.left,a}function o(M,a,h,d){var x=new t(M,a);if(h===null)return x.left=x.right=null,x;h=i(M,h,d);var b=d(M,h.key);return b<0?(x.left=h.left,x.right=h,h.left=null):b>=0&&(x.right=h.right,x.left=h,h.right=null),x}function r(M,a,h){var d=null,x=null;if(a){a=i(M,a,h);var b=h(a.key,M);b===0?(d=a.left,x=a.right):b<0?(x=a.right,a.right=null,d=a):(d=a.left,a.left=null,x=a)}return{left:d,right:x}}function s(M,a,h){return a===null?M:(M===null||(a=i(M.key,a,h),a.left=M),a)}function u(M,a,h,d,x){if(M){d(""+a+(h?"\\u2514\\u2500\\u2500 ":"\\u251C\\u2500\\u2500 ")+x(M)+`\n`);var b=a+(h?" ":"\\u2502 ");M.left&&u(M.left,b,!1,d,x),M.right&&u(M.right,b,!0,d,x)}}var l=function(){function M(a){a===void 0&&(a=n),this._root=null,this._size=0,this._comparator=a}return M.prototype.insert=function(a,h){return this._size++,this._root=o(a,h,this._root,this._comparator)},M.prototype.add=function(a,h){var d=new t(a,h);this._root===null&&(d.left=d.right=null,this._size++,this._root=d);var x=this._comparator,b=i(a,this._root,x),F=x(a,b.key);return F===0?this._root=b:(F<0?(d.left=b.left,d.right=b,b.left=null):F>0&&(d.right=b.right,d.left=b,b.right=null),this._size++,this._root=d),this._root},M.prototype.remove=function(a){this._root=this._remove(a,this._root,this._comparator)},M.prototype._remove=function(a,h,d){var x;if(h===null)return null;h=i(a,h,d);var b=d(a,h.key);return b===0?(h.left===null?x=h.right:(x=i(a,h.left,d),x.right=h.right),this._size--,x):h},M.prototype.pop=function(){var a=this._root;if(a){for(;a.left;)a=a.left;return this._root=i(a.key,this._root,this._comparator),this._root=this._remove(a.key,this._root,this._comparator),{key:a.key,data:a.data}}return null},M.prototype.findStatic=function(a){for(var h=this._root,d=this._comparator;h;){var x=d(a,h.key);if(x===0)return h;x<0?h=h.left:h=h.right}return null},M.prototype.find=function(a){return this._root&&(this._root=i(a,this._root,this._comparator),this._comparator(a,this._root.key)!==0)?null:this._root},M.prototype.contains=function(a){for(var h=this._root,d=this._comparator;h;){var x=d(a,h.key);if(x===0)return!0;x<0?h=h.left:h=h.right}return!1},M.prototype.forEach=function(a,h){for(var d=this._root,x=[],b=!1;!b;)d!==null?(x.push(d),d=d.left):x.length!==0?(d=x.pop(),a.call(h,d),d=d.right):b=!0;return this},M.prototype.range=function(a,h,d,x){for(var b=[],F=this._comparator,R=this._root,I;b.length!==0||R;)if(R)b.push(R),R=R.left;else{if(R=b.pop(),I=F(R.key,h),I>0)break;if(F(R.key,a)>=0&&d.call(x,R))return this;R=R.right}return this},M.prototype.keys=function(){var a=[];return this.forEach(function(h){var d=h.key;return a.push(d)}),a},M.prototype.values=function(){var a=[];return this.forEach(function(h){var d=h.data;return a.push(d)}),a},M.prototype.min=function(){return this._root?this.minNode(this._root).key:null},M.prototype.max=function(){return this._root?this.maxNode(this._root).key:null},M.prototype.minNode=function(a){if(a===void 0&&(a=this._root),a)for(;a.left;)a=a.left;return a},M.prototype.maxNode=function(a){if(a===void 0&&(a=this._root),a)for(;a.right;)a=a.right;return a},M.prototype.at=function(a){for(var h=this._root,d=!1,x=0,b=[];!d;)if(h)b.push(h),h=h.left;else if(b.length>0){if(h=b.pop(),x===a)return h;x++,h=h.right}else d=!0;return null},M.prototype.next=function(a){var h=this._root,d=null;if(a.right){for(d=a.right;d.left;)d=d.left;return d}for(var x=this._comparator;h;){var b=x(a.key,h.key);if(b===0)break;b<0?(d=h,h=h.left):h=h.right}return d},M.prototype.prev=function(a){var h=this._root,d=null;if(a.left!==null){for(d=a.left;d.right;)d=d.right;return d}for(var x=this._comparator;h;){var b=x(a.key,h.key);if(b===0)break;b<0?h=h.left:(d=h,h=h.right)}return d},M.prototype.clear=function(){return this._root=null,this._size=0,this},M.prototype.toList=function(){return p(this._root)},M.prototype.load=function(a,h,d){h===void 0&&(h=[]),d===void 0&&(d=!1);var x=a.length,b=this._comparator;if(d&&y(a,h,0,x-1,b),this._root===null)this._root=c(a,h,0,x),this._size=x;else{var F=g(this.toList(),f(a,h),b);x=this._size+x,this._root=m({head:F},0,x)}return this},M.prototype.isEmpty=function(){return this._root===null},Object.defineProperty(M.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(M.prototype,"root",{get:function(){return this._root},enumerable:!0,configurable:!0}),M.prototype.toString=function(a){a===void 0&&(a=function(d){return String(d.key)});var h=[];return u(this._root,"",!0,function(d){return h.push(d)},a),h.join("")},M.prototype.update=function(a,h,d){var x=this._comparator,b=r(a,this._root,x),F=b.left,R=b.right;x(a,h)<0?R=o(h,d,R,x):F=o(h,d,F,x),this._root=s(F,R,x)},M.prototype.split=function(a){return r(a,this._root,this._comparator)},M.prototype[Symbol.iterator]=function(){var a,h,d;return e(this,function(x){switch(x.label){case 0:a=this._root,h=[],d=!1,x.label=1;case 1:return d?[3,6]:a===null?[3,2]:(h.push(a),a=a.left,[3,5]);case 2:return h.length===0?[3,4]:(a=h.pop(),[4,a]);case 3:return x.sent(),a=a.right,[3,5];case 4:d=!0,x.label=5;case 5:return[3,1];case 6:return[2]}})},M}();function c(M,a,h,d){var x=d-h;if(x>0){var b=h+Math.floor(x/2),F=M[b],R=a[b],I=new t(F,R);return I.left=c(M,a,h,b),I.right=c(M,a,b+1,d),I}return null}function f(M,a){for(var h=new t(null,null),d=h,x=0;x<M.length;x++)d=d.next=new t(M[x],a[x]);return d.next=null,h.next}function p(M){for(var a=M,h=[],d=!1,x=new t(null,null),b=x;!d;)a?(h.push(a),a=a.left):h.length>0?(a=b=b.next=h.pop(),a=a.right):d=!0;return b.next=null,x.next}function m(M,a,h){var d=h-a;if(d>0){var x=a+Math.floor(d/2),b=m(M,a,x),F=M.head;return F.left=b,M.head=M.head.next,F.right=m(M,x+1,h),F}return null}function g(M,a,h){for(var d=new t(null,null),x=d,b=M,F=a;b!==null&&F!==null;)h(b.key,F.key)<0?(x.next=b,b=b.next):(x.next=F,F=F.next),x=x.next;return b!==null?x.next=b:F!==null&&(x.next=F),d.next}function y(M,a,h,d,x){if(!(h>=d)){for(var b=M[h+d>>1],F=h-1,R=d+1;;){do F++;while(x(M[F],b)<0);do R--;while(x(M[R],b)>0);if(F>=R)break;var I=M[F];M[F]=M[R],M[R]=I,I=a[F],a[F]=a[R],a[R]=I}y(M,a,h,R,x),y(M,a,R+1,d,x)}}let w=(M,a)=>M.ll.x<=a.x&&a.x<=M.ur.x&&M.ll.y<=a.y&&a.y<=M.ur.y,E=(M,a)=>{if(a.ur.x<M.ll.x||M.ur.x<a.ll.x||a.ur.y<M.ll.y||M.ur.y<a.ll.y)return null;let h=M.ll.x<a.ll.x?a.ll.x:M.ll.x,d=M.ur.x<a.ur.x?M.ur.x:a.ur.x,x=M.ll.y<a.ll.y?a.ll.y:M.ll.y,b=M.ur.y<a.ur.y?M.ur.y:a.ur.y;return{ll:{x:h,y:x},ur:{x:d,y:b}}},S=Number.EPSILON;S===void 0&&(S=Math.pow(2,-52));let B=S*S,L=(M,a)=>{if(-S<M&&M<S&&-S<a&&a<S)return 0;let h=M-a;return h*h<B*M*a?0:M<a?-1:1};class A{constructor(){this.reset()}reset(){this.xRounder=new U,this.yRounder=new U}round(a,h){return{x:this.xRounder.round(a),y:this.yRounder.round(h)}}}class U{constructor(){this.tree=new l,this.round(0)}round(a){let h=this.tree.add(a),d=this.tree.prev(h);if(d!==null&&L(h.key,d.key)===0)return this.tree.remove(a),d.key;let x=this.tree.next(h);return x!==null&&L(h.key,x.key)===0?(this.tree.remove(a),x.key):a}}let V=new A,D=11102230246251565e-32,j=134217729,O=(3+8*D)*D;function z(M,a,h,d,x){let b,F,R,I,k=a[0],C=d[0],v=0,P=0;C>k==C>-k?(b=k,k=a[++v]):(b=C,C=d[++P]);let _=0;if(v<M&&P<h)for(C>k==C>-k?(F=k+b,R=b-(F-k),k=a[++v]):(F=C+b,R=b-(F-C),C=d[++P]),b=F,R!==0&&(x[_++]=R);v<M&&P<h;)C>k==C>-k?(F=b+k,I=F-b,R=b-(F-I)+(k-I),k=a[++v]):(F=b+C,I=F-b,R=b-(F-I)+(C-I),C=d[++P]),b=F,R!==0&&(x[_++]=R);for(;v<M;)F=b+k,I=F-b,R=b-(F-I)+(k-I),k=a[++v],b=F,R!==0&&(x[_++]=R);for(;P<h;)F=b+C,I=F-b,R=b-(F-I)+(C-I),C=d[++P],b=F,R!==0&&(x[_++]=R);return(b!==0||_===0)&&(x[_++]=b),_}function G(M,a){let h=a[0];for(let d=1;d<M;d++)h+=a[d];return h}function te(M){return new Float64Array(M)}let ie=(3+16*D)*D,J=(2+12*D)*D,X=(9+64*D)*D*D,W=te(4),re=te(8),Q=te(12),T=te(16),N=te(4);function ee(M,a,h,d,x,b,F){let R,I,k,C,v,P,_,Y,H,q,K,ue,ge,ae,xe,ye,Fe,we,_e=M-x,Be=h-x,Te=a-b,Ce=d-b;ae=_e*Ce,P=j*_e,_=P-(P-_e),Y=_e-_,P=j*Ce,H=P-(P-Ce),q=Ce-H,xe=Y*q-(ae-_*H-Y*H-_*q),ye=Te*Be,P=j*Te,_=P-(P-Te),Y=Te-_,P=j*Be,H=P-(P-Be),q=Be-H,Fe=Y*q-(ye-_*H-Y*H-_*q),K=xe-Fe,v=xe-K,W[0]=xe-(K+v)+(v-Fe),ue=ae+K,v=ue-ae,ge=ae-(ue-v)+(K-v),K=ge-ye,v=ge-K,W[1]=ge-(K+v)+(v-ye),we=ue+K,v=we-ue,W[2]=ue-(we-v)+(K-v),W[3]=we;let Ge=G(4,W),lt=J*F;if(Ge>=lt||-Ge>=lt||(v=M-_e,R=M-(_e+v)+(v-x),v=h-Be,k=h-(Be+v)+(v-x),v=a-Te,I=a-(Te+v)+(v-b),v=d-Ce,C=d-(Ce+v)+(v-b),R===0&&I===0&&k===0&&C===0)||(lt=X*F+O*Math.abs(Ge),Ge+=_e*C+Ce*R-(Te*k+Be*I),Ge>=lt||-Ge>=lt))return Ge;ae=R*Ce,P=j*R,_=P-(P-R),Y=R-_,P=j*Ce,H=P-(P-Ce),q=Ce-H,xe=Y*q-(ae-_*H-Y*H-_*q),ye=I*Be,P=j*I,_=P-(P-I),Y=I-_,P=j*Be,H=P-(P-Be),q=Be-H,Fe=Y*q-(ye-_*H-Y*H-_*q),K=xe-Fe,v=xe-K,N[0]=xe-(K+v)+(v-Fe),ue=ae+K,v=ue-ae,ge=ae-(ue-v)+(K-v),K=ge-ye,v=ge-K,N[1]=ge-(K+v)+(v-ye),we=ue+K,v=we-ue,N[2]=ue-(we-v)+(K-v),N[3]=we;let lo=z(4,W,4,N,re);ae=_e*C,P=j*_e,_=P-(P-_e),Y=_e-_,P=j*C,H=P-(P-C),q=C-H,xe=Y*q-(ae-_*H-Y*H-_*q),ye=Te*k,P=j*Te,_=P-(P-Te),Y=Te-_,P=j*k,H=P-(P-k),q=k-H,Fe=Y*q-(ye-_*H-Y*H-_*q),K=xe-Fe,v=xe-K,N[0]=xe-(K+v)+(v-Fe),ue=ae+K,v=ue-ae,ge=ae-(ue-v)+(K-v),K=ge-ye,v=ge-K,N[1]=ge-(K+v)+(v-ye),we=ue+K,v=we-ue,N[2]=ue-(we-v)+(K-v),N[3]=we;let co=z(lo,re,4,N,Q);ae=R*C,P=j*R,_=P-(P-R),Y=R-_,P=j*C,H=P-(P-C),q=C-H,xe=Y*q-(ae-_*H-Y*H-_*q),ye=I*k,P=j*I,_=P-(P-I),Y=I-_,P=j*k,H=P-(P-k),q=k-H,Fe=Y*q-(ye-_*H-Y*H-_*q),K=xe-Fe,v=xe-K,N[0]=xe-(K+v)+(v-Fe),ue=ae+K,v=ue-ae,ge=ae-(ue-v)+(K-v),K=ge-ye,v=ge-K,N[1]=ge-(K+v)+(v-ye),we=ue+K,v=we-ue,N[2]=ue-(we-v)+(K-v),N[3]=we;let ao=z(co,Q,4,N,T);return T[ao-1]}function Z(M,a,h,d,x,b){let F=(a-b)*(h-x),R=(M-x)*(d-b),I=F-R,k=Math.abs(F+R);return Math.abs(I)>=ie*k?I:-ee(M,a,h,d,x,b,k)}let oe=(M,a)=>M.x*a.y-M.y*a.x,de=(M,a)=>M.x*a.x+M.y*a.y,be=(M,a,h)=>{let d=Z(M.x,M.y,a.x,a.y,h.x,h.y);return d>0?-1:d<0?1:0},se=M=>Math.sqrt(de(M,M)),Ie=(M,a,h)=>{let d={x:a.x-M.x,y:a.y-M.y},x={x:h.x-M.x,y:h.y-M.y};return oe(x,d)/se(x)/se(d)},Ne=(M,a,h)=>{let d={x:a.x-M.x,y:a.y-M.y},x={x:h.x-M.x,y:h.y-M.y};return de(x,d)/se(x)/se(d)},ce=(M,a,h)=>a.y===0?null:{x:M.x+a.x/a.y*(h-M.y),y:h},Me=(M,a,h)=>a.x===0?null:{x:h,y:M.y+a.y/a.x*(h-M.x)},Se=(M,a,h,d)=>{if(a.x===0)return Me(h,d,M.x);if(d.x===0)return Me(M,a,h.x);if(a.y===0)return ce(h,d,M.y);if(d.y===0)return ce(M,a,h.y);let x=oe(a,d);if(x==0)return null;let b={x:h.x-M.x,y:h.y-M.y},F=oe(b,a)/x,R=oe(b,d)/x,I=M.x+R*a.x,k=h.x+F*d.x,C=M.y+R*a.y,v=h.y+F*d.y,P=(I+k)/2,_=(C+v)/2;return{x:P,y:_}};class ne{static compare(a,h){let d=ne.comparePoints(a.point,h.point);return d!==0?d:(a.point!==h.point&&a.link(h),a.isLeft!==h.isLeft?a.isLeft?1:-1:me.compare(a.segment,h.segment))}static comparePoints(a,h){return a.x<h.x?-1:a.x>h.x?1:a.y<h.y?-1:a.y>h.y?1:0}constructor(a,h){a.events===void 0?a.events=[this]:a.events.push(this),this.point=a,this.isLeft=h}link(a){if(a.point===this.point)throw new Error("Tried to link already linked events");let h=a.point.events;for(let d=0,x=h.length;d<x;d++){let b=h[d];this.point.events.push(b),b.point=this.point}this.checkForConsuming()}checkForConsuming(){let a=this.point.events.length;for(let h=0;h<a;h++){let d=this.point.events[h];if(d.segment.consumedBy===void 0)for(let x=h+1;x<a;x++){let b=this.point.events[x];b.consumedBy===void 0&&d.otherSE.point.events===b.otherSE.point.events&&d.segment.consume(b.segment)}}}getAvailableLinkedEvents(){let a=[];for(let h=0,d=this.point.events.length;h<d;h++){let x=this.point.events[h];x!==this&&!x.segment.ringOut&&x.segment.isInResult()&&a.push(x)}return a}getLeftmostComparator(a){let h=new Map,d=x=>{let b=x.otherSE;h.set(x,{sine:Ie(this.point,a.point,b.point),cosine:Ne(this.point,a.point,b.point)})};return(x,b)=>{h.has(x)||d(x),h.has(b)||d(b);let{sine:F,cosine:R}=h.get(x),{sine:I,cosine:k}=h.get(b);return F>=0&&I>=0?R<k?1:R>k?-1:0:F<0&&I<0?R<k?-1:R>k?1:0:I<F?-1:I>F?1:0}}}let he=0;class me{static compare(a,h){let d=a.leftSE.point.x,x=h.leftSE.point.x,b=a.rightSE.point.x,F=h.rightSE.point.x;if(F<d)return 1;if(b<x)return-1;let R=a.leftSE.point.y,I=h.leftSE.point.y,k=a.rightSE.point.y,C=h.rightSE.point.y;if(d<x){if(I<R&&I<k)return 1;if(I>R&&I>k)return-1;let v=a.comparePoint(h.leftSE.point);if(v<0)return 1;if(v>0)return-1;let P=h.comparePoint(a.rightSE.point);return P!==0?P:-1}if(d>x){if(R<I&&R<C)return-1;if(R>I&&R>C)return 1;let v=h.comparePoint(a.leftSE.point);if(v!==0)return v;let P=a.comparePoint(h.rightSE.point);return P<0?1:P>0?-1:1}if(R<I)return-1;if(R>I)return 1;if(b<F){let v=h.comparePoint(a.rightSE.point);if(v!==0)return v}if(b>F){let v=a.comparePoint(h.rightSE.point);if(v<0)return 1;if(v>0)return-1}if(b!==F){let v=k-R,P=b-d,_=C-I,Y=F-x;if(v>P&&_<Y)return 1;if(v<P&&_>Y)return-1}return b>F?1:b<F||k<C?-1:k>C?1:a.id<h.id?-1:a.id>h.id?1:0}constructor(a,h,d,x){this.id=++he,this.leftSE=a,a.segment=this,a.otherSE=h,this.rightSE=h,h.segment=this,h.otherSE=a,this.rings=d,this.windings=x}static fromRing(a,h,d){let x,b,F,R=ne.comparePoints(a,h);if(R<0)x=a,b=h,F=1;else if(R>0)x=h,b=a,F=-1;else throw new Error(`Tried to create degenerate segment at [${a.x}, ${a.y}]`);let I=new ne(x,!0),k=new ne(b,!1);return new me(I,k,[d],[F])}replaceRightSE(a){this.rightSE=a,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}bbox(){let a=this.leftSE.point.y,h=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:a<h?a:h},ur:{x:this.rightSE.point.x,y:a>h?a:h}}}vector(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}isAnEndpoint(a){return a.x===this.leftSE.point.x&&a.y===this.leftSE.point.y||a.x===this.rightSE.point.x&&a.y===this.rightSE.point.y}comparePoint(a){if(this.isAnEndpoint(a))return 0;let h=this.leftSE.point,d=this.rightSE.point,x=this.vector();if(h.x===d.x)return a.x===h.x?0:a.x<h.x?1:-1;let b=(a.y-h.y)/x.y,F=h.x+b*x.x;if(a.x===F)return 0;let R=(a.x-h.x)/x.x,I=h.y+R*x.y;return a.y===I?0:a.y<I?-1:1}getIntersection(a){let h=this.bbox(),d=a.bbox(),x=E(h,d);if(x===null)return null;let b=this.leftSE.point,F=this.rightSE.point,R=a.leftSE.point,I=a.rightSE.point,k=w(h,R)&&this.comparePoint(R)===0,C=w(d,b)&&a.comparePoint(b)===0,v=w(h,I)&&this.comparePoint(I)===0,P=w(d,F)&&a.comparePoint(F)===0;if(C&&k)return P&&!v?F:!P&&v?I:null;if(C)return v&&b.x===I.x&&b.y===I.y?null:b;if(k)return P&&F.x===R.x&&F.y===R.y?null:R;if(P&&v)return null;if(P)return F;if(v)return I;let _=Se(b,this.vector(),R,a.vector());return _===null||!w(x,_)?null:V.round(_.x,_.y)}split(a){let h=[],d=a.events!==void 0,x=new ne(a,!0),b=new ne(a,!1),F=this.rightSE;this.replaceRightSE(b),h.push(b),h.push(x);let R=new me(x,F,this.rings.slice(),this.windings.slice());return ne.comparePoints(R.leftSE.point,R.rightSE.point)>0&&R.swapEvents(),ne.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),d&&(x.checkForConsuming(),b.checkForConsuming()),h}swapEvents(){let a=this.rightSE;this.rightSE=this.leftSE,this.leftSE=a,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(let h=0,d=this.windings.length;h<d;h++)this.windings[h]*=-1}consume(a){let h=this,d=a;for(;h.consumedBy;)h=h.consumedBy;for(;d.consumedBy;)d=d.consumedBy;let x=me.compare(h,d);if(x!==0){if(x>0){let b=h;h=d,d=b}if(h.prev===d){let b=h;h=d,d=b}for(let b=0,F=d.rings.length;b<F;b++){let R=d.rings[b],I=d.windings[b],k=h.rings.indexOf(R);k===-1?(h.rings.push(R),h.windings.push(I)):h.windings[k]+=I}d.rings=null,d.windings=null,d.consumedBy=h,d.leftSE.consumedBy=h.leftSE,d.rightSE.consumedBy=h.rightSE}}prevInResult(){return this._prevInResult!==void 0?this._prevInResult:(this.prev?this.prev.isInResult()?this._prevInResult=this.prev:this._prevInResult=this.prev.prevInResult():this._prevInResult=null,this._prevInResult)}beforeState(){if(this._beforeState!==void 0)return this._beforeState;if(!this.prev)this._beforeState={rings:[],windings:[],multiPolys:[]};else{let a=this.prev.consumedBy||this.prev;this._beforeState=a.afterState()}return this._beforeState}afterState(){if(this._afterState!==void 0)return this._afterState;let a=this.beforeState();this._afterState={rings:a.rings.slice(0),windings:a.windings.slice(0),multiPolys:[]};let h=this._afterState.rings,d=this._afterState.windings,x=this._afterState.multiPolys;for(let R=0,I=this.rings.length;R<I;R++){let k=this.rings[R],C=this.windings[R],v=h.indexOf(k);v===-1?(h.push(k),d.push(C)):d[v]+=C}let b=[],F=[];for(let R=0,I=h.length;R<I;R++){if(d[R]===0)continue;let k=h[R],C=k.poly;if(F.indexOf(C)===-1)if(k.isExterior)b.push(C);else{F.indexOf(C)===-1&&F.push(C);let v=b.indexOf(k.poly);v!==-1&&b.splice(v,1)}}for(let R=0,I=b.length;R<I;R++){let k=b[R].multiPoly;x.indexOf(k)===-1&&x.push(k)}return this._afterState}isInResult(){if(this.consumedBy)return!1;if(this._isInResult!==void 0)return this._isInResult;let a=this.beforeState().multiPolys,h=this.afterState().multiPolys;switch(Re.type){case"union":{let d=a.length===0,x=h.length===0;this._isInResult=d!==x;break}case"intersection":{let d,x;a.length<h.length?(d=a.length,x=h.length):(d=h.length,x=a.length),this._isInResult=x===Re.numMultiPolys&&d<x;break}case"xor":{let d=Math.abs(a.length-h.length);this._isInResult=d%2===1;break}case"difference":{let d=x=>x.length===1&&x[0].isSubject;this._isInResult=d(a)!==d(h);break}default:throw new Error(`Unrecognized operation type found ${Re.type}`)}return this._isInResult}}class Pe{constructor(a,h,d){if(!Array.isArray(a)||a.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=h,this.isExterior=d,this.segments=[],typeof a[0][0]!="number"||typeof a[0][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let x=V.round(a[0][0],a[0][1]);this.bbox={ll:{x:x.x,y:x.y},ur:{x:x.x,y:x.y}};let b=x;for(let F=1,R=a.length;F<R;F++){if(typeof a[F][0]!="number"||typeof a[F][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let I=V.round(a[F][0],a[F][1]);I.x===b.x&&I.y===b.y||(this.segments.push(me.fromRing(b,I,this)),I.x<this.bbox.ll.x&&(this.bbox.ll.x=I.x),I.y<this.bbox.ll.y&&(this.bbox.ll.y=I.y),I.x>this.bbox.ur.x&&(this.bbox.ur.x=I.x),I.y>this.bbox.ur.y&&(this.bbox.ur.y=I.y),b=I)}(x.x!==b.x||x.y!==b.y)&&this.segments.push(me.fromRing(b,x,this))}getSweepEvents(){let a=[];for(let h=0,d=this.segments.length;h<d;h++){let x=this.segments[h];a.push(x.leftSE),a.push(x.rightSE)}return a}}class Le{constructor(a,h){if(!Array.isArray(a))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new Pe(a[0],this,!0),this.bbox={ll:{x:this.exteriorRing.bbox.ll.x,y:this.exteriorRing.bbox.ll.y},ur:{x:this.exteriorRing.bbox.ur.x,y:this.exteriorRing.bbox.ur.y}},this.interiorRings=[];for(let d=1,x=a.length;d<x;d++){let b=new Pe(a[d],this,!1);b.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=b.bbox.ll.x),b.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=b.bbox.ll.y),b.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=b.bbox.ur.x),b.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=b.bbox.ur.y),this.interiorRings.push(b)}this.multiPoly=h}getSweepEvents(){let a=this.exteriorRing.getSweepEvents();for(let h=0,d=this.interiorRings.length;h<d;h++){let x=this.interiorRings[h].getSweepEvents();for(let b=0,F=x.length;b<F;b++)a.push(x[b])}return a}}class Oe{constructor(a,h){if(!Array.isArray(a))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{typeof a[0][0][0]=="number"&&(a=[a])}catch{}this.polys=[],this.bbox={ll:{x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY},ur:{x:Number.NEGATIVE_INFINITY,y:Number.NEGATIVE_INFINITY}};for(let d=0,x=a.length;d<x;d++){let b=new Le(a[d],this);b.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=b.bbox.ll.x),b.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=b.bbox.ll.y),b.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=b.bbox.ur.x),b.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=b.bbox.ur.y),this.polys.push(b)}this.isSubject=h}getSweepEvents(){let a=[];for(let h=0,d=this.polys.length;h<d;h++){let x=this.polys[h].getSweepEvents();for(let b=0,F=x.length;b<F;b++)a.push(x[b])}return a}}class Ee{static factory(a){let h=[];for(let d=0,x=a.length;d<x;d++){let b=a[d];if(!b.isInResult()||b.ringOut)continue;let F=null,R=b.leftSE,I=b.rightSE,k=[R],C=R.point,v=[];for(;F=R,R=I,k.push(R),R.point!==C;)for(;;){let P=R.getAvailableLinkedEvents();if(P.length===0){let H=k[0].point,q=k[k.length-1].point;throw new Error(`Unable to complete output ring starting at [${H.x}, ${H.y}]. Last matching segment found ends at [${q.x}, ${q.y}].`)}if(P.length===1){I=P[0].otherSE;break}let _=null;for(let H=0,q=v.length;H<q;H++)if(v[H].point===R.point){_=H;break}if(_!==null){let H=v.splice(_)[0],q=k.splice(H.index);q.unshift(q[0].otherSE),h.push(new Ee(q.reverse()));continue}v.push({index:k.length,point:R.point});let Y=R.getLeftmostComparator(F);I=P.sort(Y)[0].otherSE;break}h.push(new Ee(k))}return h}constructor(a){this.events=a;for(let h=0,d=a.length;h<d;h++)a[h].segment.ringOut=this;this.poly=null}getGeom(){let a=this.events[0].point,h=[a];for(let k=1,C=this.events.length-1;k<C;k++){let v=this.events[k].point,P=this.events[k+1].point;be(v,a,P)!==0&&(h.push(v),a=v)}if(h.length===1)return null;let d=h[0],x=h[1];be(d,a,x)===0&&h.shift(),h.push(h[0]);let b=this.isExteriorRing()?1:-1,F=this.isExteriorRing()?0:h.length-1,R=this.isExteriorRing()?h.length:-1,I=[];for(let k=F;k!=R;k+=b)I.push([h[k].x,h[k].y]);return I}isExteriorRing(){if(this._isExteriorRing===void 0){let a=this.enclosingRing();this._isExteriorRing=a?!a.isExteriorRing():!0}return this._isExteriorRing}enclosingRing(){return this._enclosingRing===void 0&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}_calcEnclosingRing(){let a=this.events[0];for(let x=1,b=this.events.length;x<b;x++){let F=this.events[x];ne.compare(a,F)>0&&(a=F)}let h=a.segment.prevInResult(),d=h?h.prevInResult():null;for(;;){if(!h)return null;if(!d)return h.ringOut;if(d.ringOut!==h.ringOut)return d.ringOut.enclosingRing()!==h.ringOut?h.ringOut:h.ringOut.enclosingRing();h=d.prevInResult(),d=h?h.prevInResult():null}}}class Ue{constructor(a){this.exteriorRing=a,a.poly=this,this.interiorRings=[]}addInterior(a){this.interiorRings.push(a),a.poly=this}getGeom(){let a=[this.exteriorRing.getGeom()];if(a[0]===null)return null;for(let h=0,d=this.interiorRings.length;h<d;h++){let x=this.interiorRings[h].getGeom();x!==null&&a.push(x)}return a}}class ze{constructor(a){this.rings=a,this.polys=this._composePolys(a)}getGeom(){let a=[];for(let h=0,d=this.polys.length;h<d;h++){let x=this.polys[h].getGeom();x!==null&&a.push(x)}return a}_composePolys(a){let h=[];for(let d=0,x=a.length;d<x;d++){let b=a[d];if(!b.poly)if(b.isExteriorRing())h.push(new Ue(b));else{let F=b.enclosingRing();F.poly||h.push(new Ue(F)),F.poly.addInterior(b)}}return h}}class We{constructor(a){let h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:me.compare;this.queue=a,this.tree=new l(h),this.segments=[]}process(a){let h=a.segment,d=[];if(a.consumedBy)return a.isLeft?this.queue.remove(a.otherSE):this.tree.remove(h),d;let x=a.isLeft?this.tree.add(h):this.tree.find(h);if(!x)throw new Error(`Unable to find segment #${h.id} [${h.leftSE.point.x}, ${h.leftSE.point.y}] -> [${h.rightSE.point.x}, ${h.rightSE.point.y}] in SweepLine tree.`);let b=x,F=x,R,I;for(;R===void 0;)b=this.tree.prev(b),b===null?R=null:b.key.consumedBy===void 0&&(R=b.key);for(;I===void 0;)F=this.tree.next(F),F===null?I=null:F.key.consumedBy===void 0&&(I=F.key);if(a.isLeft){let k=null;if(R){let v=R.getIntersection(h);if(v!==null&&(h.isAnEndpoint(v)||(k=v),!R.isAnEndpoint(v))){let P=this._splitSafely(R,v);for(let _=0,Y=P.length;_<Y;_++)d.push(P[_])}}let C=null;if(I){let v=I.getIntersection(h);if(v!==null&&(h.isAnEndpoint(v)||(C=v),!I.isAnEndpoint(v))){let P=this._splitSafely(I,v);for(let _=0,Y=P.length;_<Y;_++)d.push(P[_])}}if(k!==null||C!==null){let v=null;k===null?v=C:C===null?v=k:v=ne.comparePoints(k,C)<=0?k:C,this.queue.remove(h.rightSE),d.push(h.rightSE);let P=h.split(v);for(let _=0,Y=P.length;_<Y;_++)d.push(P[_])}d.length>0?(this.tree.remove(h),d.push(a)):(this.segments.push(h),h.prev=R)}else{if(R&&I){let k=R.getIntersection(I);if(k!==null){if(!R.isAnEndpoint(k)){let C=this._splitSafely(R,k);for(let v=0,P=C.length;v<P;v++)d.push(C[v])}if(!I.isAnEndpoint(k)){let C=this._splitSafely(I,k);for(let v=0,P=C.length;v<P;v++)d.push(C[v])}}}this.tree.remove(h)}return d}_splitSafely(a,h){this.tree.remove(a);let d=a.rightSE;this.queue.remove(d);let x=a.split(h);return x.push(d),a.consumedBy===void 0&&this.tree.add(a),x}}let ut=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,Rt=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6;class Yt{run(a,h,d){Re.type=a,V.reset();let x=[new Oe(h,!0)];for(let v=0,P=d.length;v<P;v++)x.push(new Oe(d[v],!1));if(Re.numMultiPolys=x.length,Re.type==="difference"){let v=x[0],P=1;for(;P<x.length;)E(x[P].bbox,v.bbox)!==null?P++:x.splice(P,1)}if(Re.type==="intersection")for(let v=0,P=x.length;v<P;v++){let _=x[v];for(let Y=v+1,H=x.length;Y<H;Y++)if(E(_.bbox,x[Y].bbox)===null)return[]}let b=new l(ne.compare);for(let v=0,P=x.length;v<P;v++){let _=x[v].getSweepEvents();for(let Y=0,H=_.length;Y<H;Y++)if(b.insert(_[Y]),b.size>ut)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big).")}let F=new We(b),R=b.size,I=b.pop();for(;I;){let v=I.key;if(b.size===R){let _=v.segment;throw new Error(`Unable to pop() ${v.isLeft?"left":"right"} SweepEvent [${v.point.x}, ${v.point.y}] from segment #${_.id} [${_.leftSE.point.x}, ${_.leftSE.point.y}] -> [${_.rightSE.point.x}, ${_.rightSE.point.y}] from queue.`)}if(b.size>ut)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big).");if(F.segments.length>Rt)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments).");let P=F.process(v);for(let _=0,Y=P.length;_<Y;_++){let H=P[_];H.consumedBy===void 0&&b.insert(H)}R=b.size,I=b.pop()}V.reset();let k=Ee.factory(F.segments);return new ze(k).getGeom()}}let Re=new Yt;var uo={union:function(M){for(var a=arguments.length,h=new Array(a>1?a-1:0),d=1;d<a;d++)h[d-1]=arguments[d];return Re.run("union",M,h)},intersection:function(M){for(var a=arguments.length,h=new Array(a>1?a-1:0),d=1;d<a;d++)h[d-1]=arguments[d];return Re.run("intersection",M,h)},xor:function(M){for(var a=arguments.length,h=new Array(a>1?a-1:0),d=1;d<a;d++)h[d-1]=arguments[d];return Re.run("xor",M,h)},difference:function(M){for(var a=arguments.length,h=new Array(a>1?a-1:0),d=1;d<a;d++)h[d-1]=arguments[d];return Re.run("difference",M,h)}};return uo})});var ht=new Set,$t=!1;function Xe(e,t,n=2){let i=t&&t.length,o=i?t[0]*n:e.length;ht.size&&ht.clear();let r=_n(e,0,o,n,!0),s=[];if(!r||r.next===r.prev)return s;let u=0,l=0,c=0;if(i&&(r=Ro(e,t,r,n)),e.length>80*n){u=e[0],l=e[1];let f=u,p=l;for(let m=n;m<o;m+=n){let g=e[m],y=e[m+1];g<u&&(u=g),y<l&&(l=y),g>f&&(f=g),y>p&&(p=y)}c=Math.max(f-u,p-l),c=c!==0?32767/c:0}return Wt(r,s,u,l,c),s}function _n(e,t,n,i,o){let r=null;if(o===Oo(e,t,n,i)>0)for(let s=t;s<n;s+=i)r=Ln(s/i|0,e[s],e[s+1],r);else for(let s=n-i;s>=t;s-=i)r=Ln(s/i|0,e[s],e[s+1],r);return r&&mt(r,r.next)&&(dt(r),r=r.next),r}function Ke(e,t=e){let n=t===e,i=e,o;do o=!1,i!==i.next&&(ht.size===0||!ht.has(i))&&(mt(i,i.next)||fe(i.prev,i,i.next)===0)?((n||i===t)&&(t=i.prev),$t=!0,dt(i),i=i.prev,o=!0):(n||i!==t)&&(i=i.next,o=!n);while(o||i!==t);return t}function Wt(e,t,n,i,o){o&&Lo(e,n,i,o);let r=e,s=!1;for(;e.prev!==e.next;){let u=e.prev,l=e.next;if(fe(u,e,l)<0&&(o?Mo(e,n,i,o):wo(e))){t.push(u.i,e.i,l.i),dt(e),e=l,r=l;continue}if(e=l,e===r){if($t=!1,e=Ke(e),$t){r=e;continue}if(!s){e=vo(e,t),r=e,s=!0;continue}So(e,t,n,i,o);break}}}function wo(e){let t=e.prev,n=e,i=e.next,o=t.x,r=n.x,s=i.x,u=t.y,l=n.y,c=i.y,f=Math.min(o,r,s),p=Math.min(u,l,c),m=Math.max(o,r,s),g=Math.max(u,l,c),y=i.next;for(;y!==t;){if(y.x>=f&&y.x<=m&&y.y>=p&&y.y<=g&&!(o===y.x&&u===y.y)&&At(o,u,r,l,s,c,y.x,y.y)&&fe(y.prev,y,y.next)>=0)return!1;y=y.next}return!0}function Mo(e,t,n,i){let o=e.prev,r=e,s=e.next,u=o.x,l=r.x,c=s.x,f=o.y,p=r.y,m=s.y,g=Math.min(u,l,c),y=Math.min(f,p,m),w=Math.max(u,l,c),E=Math.max(f,p,m),S=Jt(g,y,t,n,i),B=Jt(w,E,t,n,i),L=e.prevZ;for(;L&&L.z>=S;){if(L.x>=g&&L.x<=w&&L.y>=y&&L.y<=E&&L!==s&&!(u===L.x&&f===L.y)&&At(u,f,l,p,c,m,L.x,L.y)&&fe(L.prev,L,L.next)>=0)return!1;L=L.prevZ}let A=e.nextZ;for(;A&&A.z<=B;){if(A.x>=g&&A.x<=w&&A.y>=y&&A.y<=E&&A!==s&&!(u===A.x&&f===A.y)&&At(u,f,l,p,c,m,A.x,A.y)&&fe(A.prev,A,A.next)>=0)return!1;A=A.nextZ}return!0}function vo(e,t){let n=e,i=!1;do{let o=n.prev,r=n.next.next;Cn(o,n,n.next,r,!1)&&pt(o,r)&&pt(r,o)&&(t.push(o.i,n.i,r.i),dt(n),dt(n.next),n=e=r,i=!0),n=n.next}while(n!==e);return i?Ke(n):n}function So(e,t,n,i,o){let r=e;do{let s=r.next.next;for(;s!==r.prev;){if(r.i!==s.i&&To(r,s)){let u=Vn(r,s);r=Ke(r,r.next),u=Ke(u,u.next),Wt(r,t,n,i,o),Wt(u,t,n,i,o);return}s=s.next}r=r.next}while(r!==e)}var Zt=!1;function Ro(e,t,n,i){let o=[];for(let r=0,s=t.length;r<s;r++){let u=t[r]*i,l=r<s-1?t[r+1]*i:e.length,c=_n(e,u,l,i,!1);c===c.next&&ht.add(c),o.push(Bo(c))}o.sort(Eo),ko(e.length/i,t.length),Tn(n,n),Zt=!0;for(let r=0;r<o.length;r++)n=Fo(o[r],n);return Zt=!1,Ke(n)}function Eo(e,t){return e.x-t.x||e.y-t.y||(e.next.y-e.y)/(e.next.x-e.x)-(t.next.y-t.y)/(t.next.x-t.x)}function Fo(e,t){let n=Io(e,t);if(!n)return t;let i=Vn(n,e),o=i.next;return Tn(n,o.next),Ke(i,i.next),Ke(n,n.next)}var Bn=16,le=new Float64Array(0),kt=0,Kt=[],Qt=[];function ko(e,t){let n=Math.ceil((e+2*t)/Bn)+t+2;le.length<n*4&&(le=new Float64Array(n*4)),kt=0}function Tn(e,t){let n=e;do{let i=kt++;Kt[i]=n;let o=1/0,r=1/0,s=-1/0,u=-1/0,l=0;do{let f=n.next;n.z=i,n.x<o&&(o=n.x),n.x>s&&(s=n.x),n.y<r&&(r=n.y),n.y>u&&(u=n.y),f.x<o&&(o=f.x),f.x>s&&(s=f.x),f.y<r&&(r=f.y),f.y>u&&(u=f.y),n=f}while(++l<Bn&&n!==t);Qt[i]=n;let c=i*4;le[c]=o,le[c+1]=r,le[c+2]=s,le[c+3]=u}while(n!==t)}function Ao(e,t){let n=e.z*4;t.x<le[n]&&(le[n]=t.x),t.y<le[n+1]&&(le[n+1]=t.y),t.x>le[n+2]&&(le[n+2]=t.x),t.y>le[n+3]&&(le[n+3]=t.y)}function In(e){let t=Qt[e];for(;t.prev.next!==t;)t=t.next;return Qt[e]=t,t}function Pn(e){let t=Kt[e];for(;t.prev.next!==t;)t=t.next;return Kt[e]=t,t}function Io(e,t){let n=t,i=e.x,o=e.y,r=-1/0,s;if(mt(e,n))return n;for(let m=0,g=0;m<kt;m++,g+=4){if(o<le[g+1]||o>le[g+3]||le[g]>i||le[g+2]<=r)continue;let y=In(m);n=Pn(m);do{if(n.prev.next===n){if(mt(e,n.next))return n.next;if(o<=n.y&&o>=n.next.y&&n.next.y!==n.y){let w=n.x+(o-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(w<=i&&w>r&&(r=w,s=n.x<n.next.x?n:n.next,w===i))return s}}n=n.next}while(n!==y)}if(!s)return null;let u=s.x,l=s.y,c=Math.min(o,l),f=Math.max(o,l),p=1/0;for(let m=0,g=0;m<kt;m++,g+=4){if(le[g+2]<u||le[g]>i||le[g+3]<c||le[g+1]>f)continue;let y=In(m);n=Pn(m);do{if(n.prev.next===n&&i>=n.x&&n.x>=u&&i!==n.x&&At(o<l?i:r,o,u,l,o<l?r:i,o,n.x,n.y)){let w=Math.abs(o-n.y)/(i-n.x);(pt(n,e)||n.y===o&&n.next.y===o&&n.next.x>i)&&(w<p||w===p&&(n.x>s.x||n.x===s.x&&Po(s,n)))&&(s=n,p=w)}n=n.next}while(n!==y)}return s}function Po(e,t){return fe(e.prev,e,t.prev)<0&&fe(t.next,e,e.next)<0}var ke=[],ct=[],Ze=new Uint32Array(0),at=new Uint32Array(0),ft=new Uint32Array(256);function Lo(e,t,n,i){let o=e,r=0;do o.z=Jt(o.x,o.y,t,n,i),ke[r++]=o,o=o.next;while(o!==e);_o(r);let s=null;for(let u=0;u<r;u++){let l=ke[u];l.prevZ=s,s&&(s.nextZ=l),s=l}s.nextZ=null}function _o(e){if(e<=32){for(let t=1;t<e;t++){let n=ke[t],i=n.z,o=t-1;for(;o>=0&&ke[o].z>i;)ke[o+1]=ke[o],o--;ke[o+1]=n}return}Ze.length<e&&(Ze=new Uint32Array(e),at=new Uint32Array(e),ct=new Array(e));for(let t=0;t<e;t++)Ze[t]=ke[t].z;Et(e,ke,Ze,ct,at,0),Et(e,ct,at,ke,Ze,8),Et(e,ke,Ze,ct,at,16),Et(e,ct,at,ke,Ze,24)}function Et(e,t,n,i,o,r){ft.fill(0);for(let u=0;u<e;u++)ft[n[u]>>>r&255]++;let s=0;for(let u=0;u<256;u++){let l=ft[u];ft[u]=s,s+=l}for(let u=0;u<e;u++){let l=n[u],c=ft[l>>>r&255]++;i[c]=t[u],o[c]=l}}function Jt(e,t,n,i,o){return e=(e-n)*o|0,t=(t-i)*o|0,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,e|t<<1}function Bo(e){let t=e,n=e;do(t.x<n.x||t.x===n.x&&t.y<n.y)&&(n=t),t=t.next;while(t!==e);return n}function At(e,t,n,i,o,r,s,u){return(o-s)*(t-u)>=(e-s)*(r-u)&&(e-s)*(i-u)>=(n-s)*(t-u)&&(n-s)*(r-u)>=(o-s)*(i-u)}function To(e,t){let n=mt(e,t)&&fe(e.prev,e,e.next)>0&&fe(t.prev,t,t.next)>0;return e.next.i!==t.i&&(n||pt(e,t)&&pt(t,e)&&(fe(e.prev,e,t.prev)!==0||fe(e,t.prev,t)!==0))&&!Co(e,t)&&(n||Vo(e,t))}function fe(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function mt(e,t){return e.x===t.x&&e.y===t.y}function Cn(e,t,n,i,o=!0){let r=fe(e,t,n),s=fe(e,t,i),u=fe(n,i,e),l=fe(n,i,t);return(r>0&&s<0||r<0&&s>0)&&(u>0&&l<0||u<0&&l>0)?!0:o?!!(r===0&&Ft(e,n,t)||s===0&&Ft(e,i,t)||u===0&&Ft(n,e,i)||l===0&&Ft(n,t,i)):!1}function Ft(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function Co(e,t){let n=Math.min(e.x,t.x),i=Math.max(e.x,t.x),o=Math.min(e.y,t.y),r=Math.max(e.y,t.y),s=e;do{let u=s.next;if(s.x>i&&u.x>i||s.x<n&&u.x<n||s.y>r&&u.y>r||s.y<o&&u.y<o){s=u;continue}if(s.i!==e.i&&u.i!==e.i&&s.i!==t.i&&u.i!==t.i&&Cn(s,u,e,t))return!0;s=u}while(s!==e);return!1}function pt(e,t){return fe(e.prev,e,e.next)<0?fe(e,t,e.next)>=0&&fe(e,e.prev,t)>=0:fe(e,t,e.prev)<0||fe(e,e.next,t)<0}function Vo(e,t){let n=e,i=!1,o=(e.x+t.x)/2,r=(e.y+t.y)/2;do{let s=n.next;n.y>r!=s.y>r&&o<(s.x-n.x)*(r-n.y)/(s.y-n.y)+n.x&&(i=!i),n=s}while(n!==e);return i}function Vn(e,t){let n=qt(e.i,e.x,e.y),i=qt(t.i,t.x,t.y),o=e.next,r=t.prev;return e.next=t,t.prev=e,n.next=o,o.prev=n,i.next=n,n.prev=i,r.next=i,i.prev=r,i}function Ln(e,t,n,i){let o=qt(e,t,n);return i?(o.next=i.next,o.prev=i,i.next.prev=o,i.next=o):(o.prev=o,o.next=o),o}function dt(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ),Zt&&Ao(e.prev,e.next)}function qt(e,t,n){return{i:e,x:t,y:n,prev:null,next:null,z:0,prevZ:null,nextZ:null}}function Oo(e,t,n,i){let o=0;for(let r=t,s=n-i;r<n;r+=i)o+=(e[s]-e[r])*(e[r+1]+e[s+1]),s=r;return o}var On=23283064365386963e-26,Do=12,Dn=typeof TextDecoder>"u"?null:new TextDecoder("utf-8"),en=0,It=1,bt=2,Pt=5,gt=class{constructor(t=new Uint8Array(16)){this.buf=ArrayBuffer.isView(t)?t:new Uint8Array(t),this.dataView=new DataView(this.buf.buffer),this.pos=0,this.type=0,this.length=this.buf.length}readFields(t,n,i=this.length){for(;this.pos<i;){let o=this.readVarint(),r=o>>3,s=this.pos;this.type=o&7,t(r,n,this),this.pos===s&&this.skip(o)}return n}readMessage(t,n){return this.readFields(t,n,this.readVarint()+this.pos)}readFixed32(){let t=this.dataView.getUint32(this.pos,!0);return this.pos+=4,t}readSFixed32(){let t=this.dataView.getInt32(this.pos,!0);return this.pos+=4,t}readFixed64(){let t=this.dataView.getUint32(this.pos,!0)+this.dataView.getUint32(this.pos+4,!0)*4294967296;return this.pos+=8,t}readSFixed64(){let t=this.dataView.getUint32(this.pos,!0)+this.dataView.getInt32(this.pos+4,!0)*4294967296;return this.pos+=8,t}readFloat(){let t=this.dataView.getFloat32(this.pos,!0);return this.pos+=4,t}readDouble(){let t=this.dataView.getFloat64(this.pos,!0);return this.pos+=8,t}readVarint(t){let n=this.buf,i,o;return o=n[this.pos++],i=o&127,o<128||(o=n[this.pos++],i|=(o&127)<<7,o<128)||(o=n[this.pos++],i|=(o&127)<<14,o<128)||(o=n[this.pos++],i|=(o&127)<<21,o<128)?i:(o=n[this.pos],i|=(o&15)<<28,No(i,t,this))}readVarint64(){return this.readVarint(!0)}readSVarint(){let t=this.readVarint();return t%2===1?(t+1)/-2:t/2}readBoolean(){return!!this.readVarint()}readString(){let t=this.readVarint()+this.pos,n=this.pos;return this.pos=t,t-n>=Do&&Dn?Dn.decode(this.buf.subarray(n,t)):Jo(this.buf,n,t)}readBytes(){let t=this.readVarint()+this.pos,n=this.buf.subarray(this.pos,t);return this.pos=t,n}readPackedVarint(t=[],n){let i=this.readPackedEnd();for(;this.pos<i;)t.push(this.readVarint(n));return t}readPackedSVarint(t=[]){let n=this.readPackedEnd();for(;this.pos<n;)t.push(this.readSVarint());return t}readPackedBoolean(t=[]){let n=this.readPackedEnd();for(;this.pos<n;)t.push(this.readBoolean());return t}readPackedFloat(t=[]){let n=this.readPackedEnd();for(;this.pos<n;)t.push(this.readFloat());return t}readPackedDouble(t=[]){let n=this.readPackedEnd();for(;this.pos<n;)t.push(this.readDouble());return t}readPackedFixed32(t=[]){let n=this.readPackedEnd();for(;this.pos<n;)t.push(this.readFixed32());return t}readPackedSFixed32(t=[]){let n=this.readPackedEnd();for(;this.pos<n;)t.push(this.readSFixed32());return t}readPackedFixed64(t=[]){let n=this.readPackedEnd();for(;this.pos<n;)t.push(this.readFixed64());return t}readPackedSFixed64(t=[]){let n=this.readPackedEnd();for(;this.pos<n;)t.push(this.readSFixed64());return t}readPackedEnd(){return this.type===bt?this.readVarint()+this.pos:this.pos+1}skip(t){let n=t&7;if(n===en)for(;this.buf[this.pos++]>127;);else if(n===bt)this.pos=this.readVarint()+this.pos;else if(n===Pt)this.pos+=4;else if(n===It)this.pos+=8;else throw new Error(`Unimplemented type: ${n}`)}writeTag(t,n){this.writeVarint(t<<3|n)}realloc(t){let n=this.length||16;for(;n<this.pos+t;)n*=2;if(n!==this.length){let i=new Uint8Array(n);i.set(this.buf),this.buf=i,this.dataView=new DataView(i.buffer),this.length=n}}finish(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)}writeFixed32(t){this.realloc(4),this.dataView.setInt32(this.pos,t,!0),this.pos+=4}writeSFixed32(t){this.realloc(4),this.dataView.setInt32(this.pos,t,!0),this.pos+=4}writeFixed64(t){this.realloc(8),this.dataView.setInt32(this.pos,t&-1,!0),this.dataView.setInt32(this.pos+4,Math.floor(t*On),!0),this.pos+=8}writeSFixed64(t){this.realloc(8),this.dataView.setInt32(this.pos,t&-1,!0),this.dataView.setInt32(this.pos+4,Math.floor(t*On),!0),this.pos+=8}writeVarint(t){if(t=+t||0,t>268435455||t<0){Uo(t,this);return}this.realloc(4),this.buf[this.pos++]=t&127|(t>127?128:0),!(t<=127)&&(this.buf[this.pos++]=(t>>>=7)&127|(t>127?128:0),!(t<=127)&&(this.buf[this.pos++]=(t>>>=7)&127|(t>127?128:0),!(t<=127)&&(this.buf[this.pos++]=t>>>7&127)))}writeSVarint(t){this.writeVarint(t<0?-t*2-1:t*2)}writeBoolean(t){this.writeVarint(+t)}writeString(t){t=String(t),this.realloc(t.length*4),this.pos++;let n=this.pos;this.pos=qo(this.buf,t,this.pos);let i=this.pos-n;i>=128&&Nn(n,i,this),this.pos=n-1,this.writeVarint(i),this.pos+=i}writeFloat(t){this.realloc(4),this.dataView.setFloat32(this.pos,t,!0),this.pos+=4}writeDouble(t){this.realloc(8),this.dataView.setFloat64(this.pos,t,!0),this.pos+=8}writeBytes(t){let n=t.length;this.writeVarint(n),this.realloc(n);for(let i=0;i<n;i++)this.buf[this.pos++]=t[i]}writeRawMessage(t,n){this.pos++;let i=this.pos;t(n,this);let o=this.pos-i;o>=128&&Nn(i,o,this),this.pos=i-1,this.writeVarint(o),this.pos+=o}writeMessage(t,n,i){this.writeTag(t,bt),this.writeRawMessage(n,i)}writePackedVarint(t,n){n.length&&this.writeMessage(t,Ho,n)}writePackedSVarint(t,n){n.length&&this.writeMessage(t,zo,n)}writePackedBoolean(t,n){n.length&&this.writeMessage(t,$o,n)}writePackedFloat(t,n){n.length&&this.writeMessage(t,Xo,n)}writePackedDouble(t,n){n.length&&this.writeMessage(t,Yo,n)}writePackedFixed32(t,n){n.length&&this.writeMessage(t,Wo,n)}writePackedSFixed32(t,n){n.length&&this.writeMessage(t,Zo,n)}writePackedFixed64(t,n){n.length&&this.writeMessage(t,Ko,n)}writePackedSFixed64(t,n){n.length&&this.writeMessage(t,Qo,n)}writeBytesField(t,n){this.writeTag(t,bt),this.writeBytes(n)}writeFixed32Field(t,n){this.writeTag(t,Pt),this.writeFixed32(n)}writeSFixed32Field(t,n){this.writeTag(t,Pt),this.writeSFixed32(n)}writeFixed64Field(t,n){this.writeTag(t,It),this.writeFixed64(n)}writeSFixed64Field(t,n){this.writeTag(t,It),this.writeSFixed64(n)}writeVarintField(t,n){this.writeTag(t,en),this.writeVarint(n)}writeSVarintField(t,n){this.writeTag(t,en),this.writeSVarint(n)}writeStringField(t,n){this.writeTag(t,bt),this.writeString(n)}writeFloatField(t,n){this.writeTag(t,Pt),this.writeFloat(n)}writeDoubleField(t,n){this.writeTag(t,It),this.writeDouble(n)}writeBooleanField(t,n){this.writeVarintField(t,+n)}};function No(e,t,n){let i=n.buf,o,r;if(r=i[n.pos++],o=(r&112)>>4,r<128||(r=i[n.pos++],o|=(r&127)<<3,r<128)||(r=i[n.pos++],o|=(r&127)<<10,r<128)||(r=i[n.pos++],o|=(r&127)<<17,r<128)||(r=i[n.pos++],o|=(r&127)<<24,r<128)||(r=i[n.pos++],o|=(r&1)<<31,r<128))return et(e,o,t);throw new Error("Expected varint not more than 10 bytes")}function et(e,t,n){return n?t*4294967296+(e>>>0):(t>>>0)*4294967296+(e>>>0)}function Uo(e,t){let n,i;if(e>=0?(n=e%4294967296|0,i=e/4294967296|0):(n=~(-e%4294967296),i=~(-e/4294967296),n^4294967295?n=n+1|0:(n=0,i=i+1|0)),e>=18446744073709552e3||e<-18446744073709552e3)throw new Error("Given varint doesn\'t fit into 10 bytes");t.realloc(10),Go(n,i,t),jo(i,t)}function Go(e,t,n){n.buf[n.pos++]=e&127|128,e>>>=7,n.buf[n.pos++]=e&127|128,e>>>=7,n.buf[n.pos++]=e&127|128,e>>>=7,n.buf[n.pos++]=e&127|128,e>>>=7,n.buf[n.pos]=e&127}function jo(e,t){let n=(e&7)<<4;t.buf[t.pos++]|=n|((e>>>=3)?128:0),e&&(t.buf[t.pos++]=e&127|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=e&127|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=e&127|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=e&127|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=e&127)))))}function Nn(e,t,n){let i=t<=16383?1:t<=2097151?2:t<=268435455?3:Math.floor(Math.log(t)/(Math.LN2*7));n.realloc(i);for(let o=n.pos-1;o>=e;o--)n.buf[o+i]=n.buf[o]}function Ho(e,t){for(let n=0;n<e.length;n++)t.writeVarint(e[n])}function zo(e,t){for(let n=0;n<e.length;n++)t.writeSVarint(e[n])}function Xo(e,t){for(let n=0;n<e.length;n++)t.writeFloat(e[n])}function Yo(e,t){for(let n=0;n<e.length;n++)t.writeDouble(e[n])}function $o(e,t){for(let n=0;n<e.length;n++)t.writeBoolean(e[n])}function Wo(e,t){for(let n=0;n<e.length;n++)t.writeFixed32(e[n])}function Zo(e,t){for(let n=0;n<e.length;n++)t.writeSFixed32(e[n])}function Ko(e,t){for(let n=0;n<e.length;n++)t.writeFixed64(e[n])}function Qo(e,t){for(let n=0;n<e.length;n++)t.writeSFixed64(e[n])}function Jo(e,t,n){let i="",o=t;for(;o<n;){let r=e[o],s=null,u=r>239?4:r>223?3:r>191?2:1;if(o+u>n)break;let l,c,f;u===1?r<128&&(s=r):u===2?(l=e[o+1],(l&192)===128&&(s=(r&31)<<6|l&63,s<=127&&(s=null))):u===3?(l=e[o+1],c=e[o+2],(l&192)===128&&(c&192)===128&&(s=(r&15)<<12|(l&63)<<6|c&63,(s<=2047||s>=55296&&s<=57343)&&(s=null))):u===4&&(l=e[o+1],c=e[o+2],f=e[o+3],(l&192)===128&&(c&192)===128&&(f&192)===128&&(s=(r&15)<<18|(l&63)<<12|(c&63)<<6|f&63,(s<=65535||s>=1114112)&&(s=null))),s===null?(s=65533,u=1):s>65535&&(s-=65536,i+=String.fromCharCode(s>>>10&1023|55296),s=56320|s&1023),i+=String.fromCharCode(s),o+=u}return i}function qo(e,t,n){for(let i=0,o,r;i<t.length;i++){if(o=t.charCodeAt(i),o>55295&&o<57344)if(r)if(o<56320){e[n++]=239,e[n++]=191,e[n++]=189,r=o;continue}else o=r-55296<<10|o-56320|65536,r=null;else{o>56319||i+1===t.length?(e[n++]=239,e[n++]=191,e[n++]=189):r=o;continue}else r&&(e[n++]=239,e[n++]=191,e[n++]=189,r=null);o<128?e[n++]=o:(o<2048?e[n++]=o>>6|192:(o<65536?e[n++]=o>>12|224:(e[n++]=o>>18|240,e[n++]=o>>12&63|128),e[n++]=o>>6&63|128),e[n++]=o&63|128)}return n}var tn=class e{constructor(t,n,i,o){this.pbf=t;this.keys=n;this.values=i;this.extent=o;this.type=0;this.properties={};this.geomOffset=-1}static read(t,n,i,o,r){let s=new e(t,i,o,r);return t.readFields(ei,s,n),s}loadGeometry(){if(this.geomOffset<0)return[];let t=this.pbf,n=t.pos;t.pos=this.geomOffset;let i=t.readVarint()+t.pos,o=1,r=0,s=0,u=0,l=[],c=[];for(;t.pos<i;){if(r<=0){let f=t.readVarint();o=f&7,r=f>>3}if(r--,o===1||o===2)s+=t.readSVarint(),u+=t.readSVarint(),o===1&&(c.length&&l.push(c),c=[]),c.push(s,u);else if(o===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: ${o}`)}return c.length&&l.push(c),t.pos=n,l}bbox(){let t=this.loadGeometry(),n=1/0,i=1/0,o=-1/0,r=-1/0;for(let s of t)for(let u=0;u<s.length;u+=2)s[u]<n&&(n=s[u]),s[u]>o&&(o=s[u]),s[u+1]<i&&(i=s[u+1]),s[u+1]>r&&(r=s[u+1]);return[n,i,o,r]}};function ei(e,t,n){n&&(e===1?t.id=n.readVarint():e===2?ti(n,t):e===3?t.type=n.readVarint():e===4&&(t.geomOffset=n.pos,n.skip(2)))}function ti(e,t){let n=e.readVarint()+e.pos;for(;e.pos<n;){let i=t.keys[e.readVarint()],o=t.values[e.readVarint()];i!==void 0&&(t.properties[i]=o)}}var nn=class e{constructor(t){this.pbf=t;this.version=1;this.name="";this.extent=4096;this.featureOffsets=[];this.keys=[];this.values=[]}static read(t,n){let i=new e(t);return t.readFields(ni,i,n),i}get length(){return this.featureOffsets.length}feature(t){let n=this.pbf;n.pos=this.featureOffsets[t];let i=n.readVarint()+n.pos;return tn.read(n,i,this.keys,this.values,this.extent)}*features(){for(let t=0;t<this.featureOffsets.length;t++)yield this.feature(t)}};function ni(e,t,n){n&&(e===15?t.version=n.readVarint():e===1?t.name=n.readString():e===5?t.extent=n.readVarint():e===2?t.featureOffsets.push(n.pos):e===3?t.keys.push(n.readString()):e===4&&t.values.push(ri(n)))}function ri(e){let t=e.readVarint()+e.pos,n=null;for(;e.pos<t;){let i=e.readVarint()>>3;i===1?n=e.readString():i===2?n=e.readFloat():i===3?n=e.readDouble():i===4?n=e.readVarint64():i===5?n=e.readVarint():i===6?n=e.readSVarint():i===7?n=e.readBoolean():e.skip(i)}return n}var Lt=class{constructor(t){this.layers={};new gt(t instanceof Uint8Array?t:new Uint8Array(t)).readFields((i,o,r)=>{if(i===3&&r){let s=nn.read(r,r.readVarint()+r.pos);s.length&&(this.layers[s.name]=s)}},null)}};function tt(e){let t=[],n=null;for(let i of e){if(i.length<6)continue;let o=oi(i);o!==0&&(o>0?(n&&t.push(n),n={outer:i,holes:[]}):n&&n.holes.push(i))}return n&&t.push(n),t}function oi(e){let t=0;for(let n=0,i=e.length-2;n<e.length;i=n,n+=2)t+=(e[i]-e[n])*(e[n+1]+e[i+1]);return t/2}function Qe(e){let t=e.trim();if(t[0]==="#"){let i=t.slice(1);if(i.length===3||i.length===4){let o=i.split("").map(r=>parseInt(r+r,16)/255);return[o[0],o[1],o[2],o.length===4?o[3]:1]}if(i.length===6||i.length===8){let o=[];for(let r=0;r<i.length;r+=2)o.push(parseInt(i.slice(r,r+2),16)/255);return[o[0],o[1],o[2],o.length===4?o[3]:1]}}let n=t.match(/^rgba?\\(([^)]+)\\)$/i);if(n){let i=n[1].split(",").map(o=>parseFloat(o));if(i.length>=3)return[i[0]/255,i[1]/255,i[2]/255,i.length>3?i[3]:1]}return[1,0,1,1]}function Bt(e){return Array.isArray(e)&&typeof e[0]=="string"}var Un=new WeakMap;function nt(e,t){if(!Bt(e))return e;let n=Un.get(e);n||(n=Hn(e),Un.set(e,n));try{return n(t)}catch{return null}}var Gn=new WeakMap,ii=new Set(["get","has","id","geometry-type","properties","feature-state","within"]);function Je(e){if(!Array.isArray(e))return!1;let t=Gn.get(e);if(t!==void 0)return t;let n=typeof e[0]=="string"&&ii.has(e[0]);if(!n){for(let i of e)if(Je(i)){n=!0;break}}return Gn.set(e,n),n}function Tt(e,t){let n=nt(e,t);return typeof n=="string"?Qe(n):Ct(n)?[n.r,n.g,n.b,n.a]:null}function Ct(e){return!!e&&typeof e=="object"&&"r"in e&&"a"in e}function _t(e){if(Ct(e))return e;if(typeof e=="string"){let[t,n,i,o]=Qe(e);return{r:t,g:n,b:i,a:o}}return null}var $=e=>typeof e=="number"?e:Number(e),Ae=e=>e===null?"":Ct(e)?`rgba(${e.r},${e.g},${e.b},${e.a})`:typeof e=="string"?e:JSON.stringify(e),xt=e=>!(e===null||e===!1||e===0||e==="");function De(e,t){if(typeof e=="number"&&typeof t=="number")return e-t;let n=Ae(e),i=Ae(t);return n<i?-1:n>i?1:0}function Hn(e){let t=e[0],n=e.slice(1),i=r=>{let s=n[r];return Bt(s)?Hn(s):()=>s},o=n.map((r,s)=>i(s));switch(t){case"get":{let r=i(0),s=n.length>1?i(1):null;return u=>(s?s(u):u.properties)?.[Ae(r(u))]??null}case"has":{let r=i(0),s=n.length>1?i(1):null;return u=>{let l=s?s(u):u.properties;return!!l&&l[Ae(r(u))]!=null}}case"properties":return r=>r.properties??{};case"id":return r=>r.id??null;case"geometry-type":return r=>r.geometryType??null;case"feature-state":{let r=i(0);return s=>s.featureState?.[Ae(r(s))]??null}case"global-state":{let r=i(0);return s=>s.globalState?.[Ae(r(s))]??null}case"zoom":return r=>r.zoom??0;case"literal":return()=>n[0];case"array":return r=>o[o.length-1](r);case"to-string":return r=>Ae(o[0](r));case"to-number":return r=>{for(let s of o){let u=Number(s(r));if(Number.isFinite(u))return u}return 0};case"to-boolean":return r=>xt(o[0](r));case"to-color":return r=>_t(o[0](r))??null;case"typeof":return r=>{let s=o[0](r);return s===null?"null":Array.isArray(s)?"array":Ct(s)?"color":typeof s};case"rgb":case"rgba":return r=>({r:$(o[0](r))/255,g:$(o[1](r))/255,b:$(o[2](r))/255,a:o[3]?$(o[3](r)):1});case"to-rgba":return r=>{let s=_t(o[0](r));return s?[s.r*255,s.g*255,s.b*255,s.a]:null};case"case":return r=>{for(let s=0;s+1<o.length;s+=2)if(xt(o[s](r)))return o[s+1](r);return o.length%2===1?o[o.length-1](r):null};case"match":return r=>{let s=o[0](r);for(let u=1;u+1<o.length;u+=2){let l=n[u];if(Array.isArray(l)?l.some(f=>De(f,s)===0):De(l,s)===0)return o[u+1](r)}return o.length%2===0?o[o.length-1](r):null};case"coalesce":return r=>{for(let s of o){let u=s(r);if(u!=null)return u}return null};case"all":return r=>o.every(s=>xt(s(r)));case"any":return r=>o.some(s=>xt(s(r)));case"!":return r=>!xt(o[0](r));case"==":return r=>De(o[0](r),o[1](r))===0;case"!=":return r=>De(o[0](r),o[1](r))!==0;case"<":return r=>De(o[0](r),o[1](r))<0;case"<=":return r=>De(o[0](r),o[1](r))<=0;case">":return r=>De(o[0](r),o[1](r))>0;case">=":return r=>De(o[0](r),o[1](r))>=0;case"in":return r=>{let s=o[0](r),u=o[1](r);return typeof u=="string"?u.includes(Ae(s)):Array.isArray(u)&&u.some(l=>De(l,s)===0)};case"index-of":return r=>{let s=o[0](r),u=o[1](r);return typeof u=="string"?u.indexOf(Ae(s)):Array.isArray(u)?u.findIndex(l=>De(l,s)===0):-1};case"step":return r=>{let s=$(o[0](r)),u=o[1](r);for(let l=2;l+1<o.length&&s>=$(o[l](r));l+=2)u=o[l+1](r);return u};case"interpolate":case"interpolate-hcl":case"interpolate-lab":{let r=n[0],s=i(1),u=[];for(let l=2;l+1<n.length;l+=2)u.push({at:i(l),value:i(l+1)});return l=>{let c=$(s(l));if(!u.length)return null;if(c<=$(u[0].at(l)))return u[0].value(l);let f=u[u.length-1];if(c>=$(f.at(l)))return f.value(l);for(let p=1;p<u.length;p++){let m=$(u[p].at(l));if(c>m)continue;let g=$(u[p-1].at(l)),y=si(r,g,m,c);return zn(u[p-1].value(l),u[p].value(l),y)}return f.value(l)}}case"+":return r=>o.reduce((s,u)=>s+$(u(r)),0);case"*":return r=>o.reduce((s,u)=>s*$(u(r)),1);case"-":return r=>o.length===1?-$(o[0](r)):$(o[0](r))-$(o[1](r));case"/":return r=>$(o[0](r))/$(o[1](r));case"%":return r=>$(o[0](r))%$(o[1](r));case"^":return r=>Math.pow($(o[0](r)),$(o[1](r)));case"abs":return r=>Math.abs($(o[0](r)));case"ceil":return r=>Math.ceil($(o[0](r)));case"floor":return r=>Math.floor($(o[0](r)));case"round":return r=>Math.round($(o[0](r)));case"sqrt":return r=>Math.sqrt($(o[0](r)));case"ln":return r=>Math.log($(o[0](r)));case"ln2":return()=>Math.LN2;case"log10":return r=>Math.log10($(o[0](r)));case"log2":return r=>Math.log2($(o[0](r)));case"sin":return r=>Math.sin($(o[0](r)));case"cos":return r=>Math.cos($(o[0](r)));case"tan":return r=>Math.tan($(o[0](r)));case"asin":return r=>Math.asin($(o[0](r)));case"acos":return r=>Math.acos($(o[0](r)));case"atan":return r=>Math.atan($(o[0](r)));case"e":return()=>Math.E;case"pi":return()=>Math.PI;case"min":return r=>Math.min(...o.map(s=>$(s(r))));case"max":return r=>Math.max(...o.map(s=>$(s(r))));case"random":return r=>{let s=o.length>0?$(o[0](r)):0,u=o.length>1?$(o[1](r)):1;return s+Math.random()*(u-s)};case"concat":return r=>o.map(s=>Ae(s(r))).join("");case"downcase":return r=>Ae(o[0](r)).toLowerCase();case"upcase":return r=>Ae(o[0](r)).toUpperCase();case"length":return r=>{let s=o[0](r);return typeof s=="string"?[...s].length:Array.isArray(s)?s.length:0};case"at":return r=>{let s=$(o[0](r)),u=o[1](r);return Array.isArray(u)?u[s]??null:null};case"slice":return r=>{let s=o[0](r),u=$(o[1](r)),l=o.length>2?$(o[2](r)):void 0;return typeof s=="string"||Array.isArray(s)?s.slice(u,l):null};case"number-format":return r=>{let s=$(o[0](r)),u=n[1]??{};return new Intl.NumberFormat(u.locale??void 0,{minimumFractionDigits:u["min-fraction-digits"],maximumFractionDigits:u["max-fraction-digits"],currency:u.currency,style:u.currency?"currency":void 0}).format(s)};case"let":{let r=[],s=[];for(let l=0;l+1<n.length-1;l+=2)r.push(n[l]),s.push(i(l+1));let u=i(n.length-1);return l=>{let c={...l.vars};return r.forEach((f,p)=>{c[f]=s[p](l)}),u({...l,vars:c})}}case"var":{let r=n[0];return s=>s.vars?.[r]??null}case"within":{let r=n[0];return s=>{let u=s.point;if(!u||!r?.coordinates)return!1;let l=r.type==="MultiPolygon"?r.coordinates.flat():r.coordinates,c=!1;for(let f of l)for(let p=0,m=f.length-1;p<f.length;m=p++){let[g,y]=f[p],[w,E]=f[m];y>u[1]!=E>u[1]&&u[0]<(w-g)*(u[1]-y)/(E-y)+g&&(c=!c)}return c}}default:return()=>(jn.has(t)||(jn.add(t),console.warn(`[osmgl] \\u0432\\u044B\\u0440\\u0430\\u0436\\u0435\\u043D\\u0438\\u0435 \\xAB${t}\\xBB \\u043F\\u043E\\u043A\\u0430 \\u043D\\u0435 \\u043F\\u043E\\u0434\\u0434\\u0435\\u0440\\u0436\\u0430\\u043D\\u043E`)),null)}}var jn=new Set;function si(e,t,n,i){let o=n-t,r=o===0?0:(i-t)/o;if(!Array.isArray(e))return r;let s=e[0];if(s==="exponential"){let u=Number(e[1]??1);return u===1||o===0?r:(Math.pow(u,i-t)-1)/(Math.pow(u,o)-1)}if(s==="cubic-bezier"){let[,u,l,c,f]=e;return ui(u,l,c,f,r)}return r}function ui(e,t,n,i,o){let r=3*e,s=3*(n-e)-r,u=1-r-s,l=3*t,c=3*(i-t)-l,f=1-l-c,p=o;for(let m=0;m<8;m++){let g=((u*p+s)*p+r)*p-o;if(Math.abs(g)<1e-5)break;let y=(3*u*p+2*s)*p+r;if(Math.abs(y)<1e-6)break;p-=g/y}return((f*p+c)*p+l)*p}function zn(e,t,n){if(typeof e=="number"&&typeof t=="number")return e+(t-e)*n;let i=_t(e),o=_t(t);return i&&o?{r:i.r+(o.r-i.r)*n,g:i.g+(o.g-i.g)*n,b:i.b+(o.b-i.b)*n,a:i.a+(o.a-i.a)*n}:Array.isArray(e)&&Array.isArray(t)?e.map((r,s)=>zn(r,t[s]??r,n)):n<.5?e:t}var Yn={};function $n(e,t,n){if(e===void 0)return n;if(typeof e=="string")return Qe(e);if(Bt(e))return ci(e),Tt(e,{zoom:t,globalState:Yn})??n;let i=e.stops;return hi(i,t,(o,r,s)=>{let u=Qe(o),l=Qe(r);return[u[0]+(l[0]-u[0])*s,u[1]+(l[1]-u[1])*s,u[2]+(l[2]-u[2])*s,u[3]+(l[3]-u[3])*s]},n)}var Xn=new WeakSet,li=new WeakSet;function ci(e){li.has(e)||!Je(e)||Xn.has(e)||(Xn.add(e),console.warn("[osmgl] \\u0432\\u044B\\u0440\\u0430\\u0436\\u0435\\u043D\\u0438\\u0435 \\u0441\\u043C\\u043E\\u0442\\u0440\\u0438\\u0442 \\u043D\\u0430 \\u0444\\u0438\\u0447\\u0443, \\u0430 \\u044D\\u0442\\u043E \\u0437\\u043D\\u0430\\u0447\\u0435\\u043D\\u0438\\u0435 \\u0441\\u0447\\u0438\\u0442\\u0430\\u0435\\u0442\\u0441\\u044F \\u0440\\u0430\\u0437 \\u043D\\u0430 \\u0441\\u043B\\u043E\\u0439 \\u2014 \\u043E\\u043D\\u043E \\u0431\\u0443\\u0434\\u0435\\u0442 \\u0437\\u0430\\u043F\\u0430\\u0441\\u043D\\u044B\\u043C. \\u041D\\u0430 \\u0444\\u0438\\u0447\\u0435 \\u0441\\u0447\\u0438\\u0442\\u0430\\u044E\\u0442\\u0441\\u044F \\u0446\\u0432\\u0435\\u0442, \\u043F\\u0440\\u043E\\u0437\\u0440\\u0430\\u0447\\u043D\\u043E\\u0441\\u0442\\u044C \\u0438 \\u0448\\u0438\\u0440\\u0438\\u043D\\u0430 \\u043B\\u0438\\u043D\\u0438\\u0438; \\u0441\\u043C. porting/maplibre-api.md, \\u0444\\u0430\\u0437\\u0430 7\\u0431.",e))}function ai(e){let t=e[0];return fi.has(t)?t==="all"||t==="any"||t==="!"?!1:Array.isArray(e[1]):!0}var fi=new Set(["==","!=",">",">=","<","<=","in","!in","has","!has","all","any","!"]);function hi(e,t,n,i){if(!e.length)return i;if(t<=e[0][0])return n(e[0][1],e[0][1],0);let o=e[e.length-1];if(t>=o[0])return n(o[1],o[1],0);for(let r=1;r<e.length;r++){let[s,u]=e[r];if(t>s)continue;let[l,c]=e[r-1],f=s-l,p=f===0?0:(t-l)/f;return n(c,u,p)}return i}function pe(e,t,n){if(!e)return!0;let i=e[0];if(ai(e))return nt(e,{properties:t,id:n?.id??null,geometryType:n?.geometryType,featureState:n?.featureState,globalState:Yn})===!0;switch(i){case"all":return e.slice(1).every(o=>pe(o,t));case"any":return e.slice(1).some(o=>pe(o,t));case"!":return!pe(e[1],t);case"has":return t[e[1]]!=null;case"!has":return t[e[1]]==null;case"in":{let o=t[e[1]];return o==null?!1:e.slice(2).includes(o)}case"!in":{let o=t[e[1]];return o==null?!0:!e.slice(2).includes(o)}default:{let o=t[e[1]],r=e[2];if(o==null)return i==="!=";switch(i){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!0}}}}var mi=Math.PI/8,pi=.35,di=32,Zn=.25,Kn=.5,Qn=.07;function je(e,t){let n=t.radius;if(!(n>0))return e;let i=e.length/2-1;if(i<3)return e;let o=Math.max(2,Math.round(t.segments??4)),r=Math.max(t.minCutRatio??pi,0),s=t.extent,u=[];for(let l=0;l<i;l++){let c=e[l*2],f=e[l*2+1],p=e[(l+i-1)%i*2],m=e[(l+i-1)%i*2+1],g=e[(l+1)%i*2],y=e[(l+1)%i*2+1],w=c-p,E=f-m,S=g-c,B=y-f,L=Math.hypot(w,E),A=Math.hypot(S,B);if(L<1e-6||A<1e-6){u.push(c,f);continue}let U=w/L,V=E/L,D=S/A,j=B/A;if(t.keep?.[l]){u.push(c,f);continue}let O=U*D+V*j;if(O>.985){u.push(c,f);continue}if(s!==void 0&&(c<=0||c>=s||f<=0||f>=s)){u.push(c,f);continue}let z=Math.min(n,L*Wn,A*Wn);if(z<n*r){u.push(c,f);continue}let G=c-U*z,te=f-V*z,ie=c+D*z,J=f+j*z,X=Math.acos(Math.max(-1,Math.min(1,O))),W=Math.min(mi,Math.PI/2/o),re=Math.ceil(X/W-1e-6),Q=t.maxChord&&t.maxChord>0?Math.ceil(z/Math.tan(X/2)*X/t.maxChord):0,T=Math.max(1,Math.min(di,Math.max(Math.min(o,re),Q)));u.push(G,te);for(let N=1;N<T;N++){let ee=N/T,Z=1-ee;u.push(Z*Z*G+2*Z*ee*c+ee*ee*ie,Z*Z*te+2*Z*ee*f+ee*ee*J)}u.push(ie,J)}return u.length<6?e:(u.push(u[0],u[1]),u)}var Wn=.4;var ve=e=>e/64;function He(e,t,n=0){let i=Jn(e.outer,t,n);if(!i)return null;let o=[];for(let r of e.holes){let s=Jn(r,t,n);s&&o.push(s)}return{outer:i,holes:o}}function Jn(e,t,n){let i=[];for(let o=0;o<e.length-2;o+=2)i.push(e[o],e[o+1]);if(i.length<6)return null;for(let o=0;o<4;o++){let r=i;i=[];let s=r.length/2;if(s===0)return null;for(let u=0;u<s;u++){let l=r[u*2],c=r[u*2+1],f=r[(u+s-1)%s*2],p=r[(u+s-1)%s*2+1],m=qn(l,c,o,t,n),g=qn(f,p,o,t,n);if(m!==g){let y=bi(f,p,l,c,o,t,n),w=o===0?-n:o===1?t+n:f+(l-f)*y,E=o===2?-n:o===3?t+n:p+(c-p)*y;i.push(w,E)}m&&i.push(l,c)}}return i.length<6?null:(i.push(i[0],i[1]),i)}function qn(e,t,n,i,o){return n===0?e>=-o:n===1?e<=i+o:n===2?t>=-o:t<=i+o}function bi(e,t,n,i,o,r,s){return o===0?(-s-e)/(n-e):o===1?(r+s-e)/(n-e):o===2?(-s-t)/(i-t):(r+s-t)/(i-t)}function Vt(e,t,n,i,o,r=0){let s=-r,u=o+r;return e===s&&n===s||e===u&&n===u||t===s&&i===s||t===u&&i===u}function rn(e,t){for(let n=0;n<e.length;n+=2)if(e[n]<=0||e[n]>=t||e[n+1]<=0||e[n+1]>=t)return!0;return!1}var er=1,un=18,ln=32,tr=8,cr=65535/ln,gi=9,xi=1,yi=0,wi=1,Mi=2;var nr=0,vi=1,rr=2,Si=3,Ri=.47;function ar(e,t,n,i={},o){let r=i.metersPerUnit&&i.metersPerUnit>0?i.metersPerUnit:Ri,{b:s,ensure:u,take:l}=Ei(Math.max(1024,e.length*48));for(let c of e.features()){if(c.type!==3||!pe(n,c.properties))continue;let f=Yi(c.properties),p=$i(c.properties,f);if(f<=p)continue;let m=Zi(c.properties)??Number(c.id??0),g=Xi(m>>>0),y=zi(g,c.properties),w=Hi(c.properties,f);i.paint?.setFeature(c.properties,c.id??null,"Polygon");let E=tt(c.loadGeometry()),S=o?E.some(B=>{let L=He(B,t,ve(t));return L?rn(L.outer,t):!1}):!1;for(let B of E){if(o&&S){let L=Ji(B,t,f,p,m,g,y,w);L&&o.push(L)}Ki(s,B,u,{extent:t,metersPerUnit:r,height:f,minHeight:p,featureId:m,seed:g,tint:y,facade:w,props:c.properties,cornerRadius:i.cornerRadius??0,cornerSegments:i.cornerSegments,whole:!1})}i.paint?.advanceTo(s.vertexCount)}return l(t,i.paint)}function Ei(e){let t=e,n=new ArrayBuffer(t*un),i={verts:new DataView(n),vertsU8:new Uint8Array(n),vertOffset:0,vertexCount:0,indices:[],featureIds:[],ensure:()=>{}},o=s=>{if(i.vertexCount+s<=t)return;t=Math.max(t*2,i.vertexCount+s);let u=new ArrayBuffer(t*un);new Uint8Array(u).set(i.vertsU8.subarray(0,i.vertOffset)),n=u,i.verts=new DataView(u),i.vertsU8=new Uint8Array(u)};return i.ensure=o,{b:i,ensure:o,take:(s,u)=>{if(!i.indices.length)return null;let l=new Uint32Array(i.indices),c=new Float64Array(i.featureIds);return{vertices:n.slice(0,i.vertOffset),indices:l.buffer,featureIds:c.buffer,vertexCount:i.vertexCount,indexCount:l.length,extent:s,...u?{dataPaint:u.take(i.vertexCount)}:{}}}}}var cn=(e,t)=>e|t<<2,or=e=>Math.max(-32768,Math.min(32767,e)),on=e=>Math.max(0,Math.min(65535,Math.round(Math.min(e,cr)*ln)));function rt(e,t,n,i,o,r,s,u,l,c,f=0,p=0,m=0){let g=e.vertOffset;return e.verts.setInt16(g,or(Math.round(t*tr)),!0),e.verts.setInt16(g+2,or(Math.round(n*tr)),!0),e.verts.setUint16(g+4,Math.round(Math.min(i,cr)*ln),!0),e.vertsU8[g+6]=l,e.vertsU8[g+7]=u,e.verts.setInt8(g+8,sn(Math.round(o*127))),e.verts.setInt8(g+9,sn(Math.round(r*127))),e.verts.setInt8(g+10,sn(Math.round(s*127))),e.vertsU8[g+11]=c,e.verts.setUint16(g+12,on(f),!0),e.verts.setUint16(g+14,on(p),!0),e.verts.setUint16(g+16,on(m),!0),e.vertOffset+=un,e.vertexCount++}function ir(e,t,n,i,o,r,s,u,l,c){let f=t.length/2;if(f<3)return;let p=cn(yi,s),m=ki(t,u),g=i-n,y=new Float64Array(f*2),w=new Uint8Array(f);{let E=new Float64Array(f*2);for(let S=0;S<f-1;S++){let B=t[S*2+2]-t[S*2],L=t[S*2+3]-t[S*2+1],A=Math.hypot(B,L)||1;E[S*2]=L/A,E[S*2+1]=-B/A}for(let S=0;S<f-1;S++){let B=(S+f-2)%(f-1),L=E[B*2]*E[S*2]+E[B*2+1]*E[S*2+1],A=E[B*2]+E[S*2],U=E[B*2+1]+E[S*2+1],V=Math.hypot(A,U);L>.5&&V>1e-6&&(y[S*2]=A/V,y[S*2+1]=U/V,w[S]=1)}}for(let E=0;E<f-1;E++){let S=t[E*2],B=t[E*2+1],L=t[E*2+2],A=t[E*2+3];if(S===L&&B===A||c[E])continue;let U=L-S,V=A-B,D=Math.hypot(U,V)||1,j=V/D,O=-U/D,z=m.offset[E],G=m.width[E],te=[0,1];if(l){for(let J=0;J<l.length;J++)for(let X=J+1;X<l.length;X++){let W=qe(l[J],S,B)-qe(l[X],S,B),re=qe(l[J],L,A)-qe(l[X],L,A);if(W===re)continue;let Q=W/(W-re);Q>1e-4&&Q<1-1e-4&&te.push(Q)}te.sort((J,X)=>J-X)}let ie=(J,X)=>{if(!l)return i;let W=1/0;for(let re of l)W=Math.min(W,qe(re,J,X));return Math.max(i,W)};for(let J=0;J+1<te.length;J++){let X=te[J],W=te[J+1];if(W-X<1e-6)continue;let re=S+U*X,Q=B+V*X,T=S+U*W,N=B+V*W,ee=z+D*X*u,Z=z+D*W*u,oe=(E+1)%(f-1),de=w[E]?y[E*2]:j,be=w[E]?y[E*2+1]:O,se=w[oe]?y[oe*2]:j,Ie=w[oe]?y[oe*2+1]:O,Ne=j+(de-j)*(1-X),ce=O+(be-O)*(1-X),Me=j+(se-j)*W,Se=O+(Ie-O)*W,ne=Math.hypot(Ne,ce)||1,he=Math.hypot(Me,Se)||1,me=Ne/ne,Pe=ce/ne,Le=Me/he,Oe=Se/he;e.ensure(4);let Ee=rt(e,re,Q,n,me,Pe,0,0,r,p,ee,G,g),Ue=rt(e,T,N,n,Le,Oe,0,0,r,p,Z,G,g),ze=rt(e,re,Q,ie(re,Q),me,Pe,0,255,r,p,ee,G,g),We=rt(e,T,N,ie(T,N),Le,Oe,0,255,r,p,Z,G,g);e.indices.push(Ee,We,Ue,Ee,ze,We),e.featureIds.push(o,o)}}}var Fi=.9976;function ki(e,t){let n=e.length/2-1,i=[];for(let l=0;l<n;l++){let c=e[l*2+2]-e[l*2],f=e[l*2+3]-e[l*2+1],p=Math.hypot(c,f);i.push(p>0?{x:c/p,y:f/p,len:p*t}:{x:0,y:0,len:0})}let o=(l,c)=>i[l].len>0&&i[c].len>0&&i[l].x*i[c].x+i[l].y*i[c].y>=Fi,r=0;for(;r<n&&o((r-1+n)%n,r);)r++;r>=n&&(r=0);let s=new Array(n).fill(0),u=new Array(n).fill(0);for(let l=0;l<n;){let c=(r+l)%n,f=[c],p=i[c].len,m=l+1;for(;m<n;){let y=(r+m)%n;if(!o((r+m-1)%n,y))break;f.push(y),p+=i[y].len,m++}let g=0;for(let y of f)s[y]=g,u[y]=p,g+=i[y].len;l=m}return{offset:s,width:u}}function Ai(e,t,n,i,o,r,s){let u=[],l=[];for(let m=0;m<t.length;m++)u.push(t[m]);for(let m of n){l.push(u.length/2);for(let g=0;g<m.length;g++)u.push(m[g])}let c=Xe(u,l.length?l:void 0,2);if(!c.length)return;let f=cn(wi,s),p=e.vertexCount;for(let m=0;m<u.length;m+=2)rt(e,u[m],u[m+1],i,0,0,1,255,r,f);for(let m=0;m<c.length;m+=3)e.indices.push(p+c[m],p+c[m+2],p+c[m+1]),e.featureIds.push(o)}function Ii(e){let t=Pi(e);if(t.length<3)return null;let n=Math.abs(Li(e));if(n<=0)return null;let i=null,o=1/0;for(let r=0;r<t.length;r++){let s=(r+1)%t.length,u=t[s].x-t[r].x,l=t[s].y-t[r].y,c=Math.hypot(u,l);if(c<1e-6)continue;u/=c,l/=c;let f=1/0,p=-1/0,m=1/0,g=-1/0;for(let A of t){let U=A.x*u+A.y*l,V=-A.x*l+A.y*u;U<f&&(f=U),U>p&&(p=U),V<m&&(m=V),V>g&&(g=V)}let y=p-f,w=g-m,E=y*w;if(E<=0||E>=o)continue;o=E;let S=(f+p)/2,B=(m+g)/2,L=y>=w;i={cx:S*u-B*l,cy:S*l+B*u,ax:L?u:-l,ay:L?l:u,halfLong:(L?y:w)/2,halfShort:(L?w:y)/2,fill:n/E}}return i}function Pi(e){let t=[];for(let r=0;r<e.length-2;r+=2)t.push({x:e[r],y:e[r+1]});if(t.length<3)return t;t.sort((r,s)=>r.x===s.x?r.y-s.y:r.x-s.x);let n=(r,s,u)=>(s.x-r.x)*(u.y-r.y)-(s.y-r.y)*(u.x-r.x),i=[];for(let r of t){for(;i.length>=2&&n(i[i.length-2],i[i.length-1],r)<=0;)i.pop();i.push(r)}let o=[];for(let r=t.length-1;r>=0;r--){let s=t[r];for(;o.length>=2&&n(o[o.length-2],o[o.length-1],s)<=0;)o.pop();o.push(s)}return i.pop(),o.pop(),i.concat(o)}function Li(e){let t=0;for(let n=0;n<e.length-2;n+=2)t+=e[n]*e[n+3]-e[n+2]*e[n+1];return t/2}var _i=Math.tan(30*Math.PI/180),Bi=3.5,Ti=.9;function Ci(e,t,n,i,o){if(t.fill<.86)return null;let r=t.halfShort*2*o,s=t.halfLong*2*o,u=r*s,l=t.halfShort>0?t.halfLong/t.halfShort:99,c=Vi(e);if(!c){if(n>15||u>600||r<3)return null;let f=i%1e3/1e3;u<30?c=f<.5?"skillion":"gabled":l<1.25?c=f<.35?"pyramidal":"hipped":c=f<.8?"gabled":"hipped"}return c==="flat"?null:{shape:c}}function Vi(e){let t=String(e.roof_shape??e["roof:shape"]??"").toLowerCase();return t?t==="flat"?"flat":t==="skillion"||t==="lean_to"||t==="shed"?"skillion":t==="hipped"||t==="half-hipped"||t==="gambrel"?"hipped":t==="pyramidal"||t==="dome"||t==="conical"||t==="onion"?"pyramidal":t==="gabled"||t==="mansard"||t==="round"?"gabled":null:null}var qe=(e,t,n)=>e.a*t+e.b*n+e.c;function Oi(e,t,n,i){let o=e.length/2;if(o<3)return[];let r=[],s=u=>[e[u*2],e[u*2+1]];for(let u=0;u<o;u++){let[l,c]=s(u),[f,p]=s((u+o-1)%o),m=t*l+n*c+i,g=t*f+n*p+i;if(m<=0!=g<=0){let y=g/(g-m);r.push(f+(l-f)*y,p+(c-p)*y)}m<=0&&r.push(l,c)}return r}function Di(e,t){let n=.5/Math.max(t,1e-6),i=e.length/2-1;if(i<5)return e;let o=[],r=0;o.push(e[0],e[1]);for(let s=1;s<i;s++){let u=e[r*2],l=e[r*2+1],c=e[s*2],f=e[s*2+1],p=c-u,m=f-l,g=Math.hypot(p,m),y=g>1e-6;if(y){for(let w=r+1;w<s;w++)if(Math.abs((e[w*2]-u)*m-(e[w*2+1]-l)*p)/g>=n){y=!1;break}}y||(o.push(e[(s-1)*2],e[(s-1)*2+1]),r=s-1)}return o.length/2<3?e:(o.push(o[0],o[1]),o)}function fr(e,t,n){let{ax:i,ay:o,halfLong:r}=t;if(n==="skillion"){let l=-o,c=i;return[{a:l,b:c,c:-(l*t.cx+c*t.cy)+t.halfShort}]}let s=[],u=e.length/2-1;for(let l=0;l<u;l++){let c=e[l*2],f=e[l*2+1],p=e[(l+1)%u*2],m=e[(l+1)%u*2+1],g=p-c,y=m-f,w=Math.hypot(g,y);if(w<1e-6||n==="gabled"&&Math.abs((g*i+y*o)/w)<.86)continue;let E=-y/w,S=g/w;s.push({a:E,b:S,c:-(E*c+S*f)})}return!s.length&&r>0?fr(e,t,"hipped"):s}function Ni(e,t){let n=[];for(let o=0;o<t.length-2;o+=2)n.push(t[o],t[o+1]);if(n.length<6)return[];let i=[];for(let o=0;o<e.length;o++){let r=n;for(let s=0;s<e.length&&r.length>=6;s++)s!==o&&(r=Oi(r,e[o].a-e[s].a,e[o].b-e[s].b,e[o].c-e[s].c));i.push(r.length>=6?r:[])}return i}function Ui(e,t){let n=0;for(let i=0;i<t.length;i++){let o=t[i];for(let r=0;r<o.length;r+=2){let s=qe(e[i],o[r],o[r+1]);s>n&&(n=s)}}return n}function Gi(e,t,n){return e.map(i=>({a:i.a*t,b:i.b*t,c:i.c*t+n}))}function ji(e,t,n,i,o,r,s,u){let l=cn(Mi,s);for(let c=0;c<n.length;c++){let f=t[c];if(!f||f.length<6)continue;let p=Xe(f,void 0,2);if(!p.length)continue;let m=-n[c].a/u,g=-n[c].b/u,y=Math.hypot(m,g,1),w={x:m/y,y:g/y,z:1/y};e.ensure(f.length/2);let E=e.vertexCount;for(let S=0;S<f.length;S+=2){let B=Math.max(i,qe(n[c],f[S],f[S+1]));rt(e,f[S],f[S+1],B,w.x,w.y,w.z,255,r,l)}for(let S=0;S<p.length;S+=3)e.indices.push(E+p[S],E+p[S+2],E+p[S+1]),e.featureIds.push(o)}}function Hi(e,t){let n=String(e.class??"").toLowerCase();return n==="industrial"||n==="warehouse"||n==="hangar"||n==="construction"?Si:n==="commercial"||n==="office"||n==="retail"||n==="supermarket"?rr:n==="house"||n==="detached"||n==="garage"||n==="hut"||n==="shed"||t<=7?nr:t>=40?rr:vi}function zi(e,t){let n=String(t.class??""),i=128;return n==="industrial"||n==="warehouse"||n==="construction"?i=96:n==="commercial"||n==="office"||n==="retail"?i=150:(n==="apartments"||n==="residential"||n==="house")&&(i=134),Math.max(0,Math.min(255,i+(e%121-60)))}function Xi(e){let t=e>>>0;return t=(t>>>16^t)*73244475,t=(t>>>16^t)*73244475,t=t>>>16^t,t>>>0}function Yi(e){let t=ot(e.render_height)??ot(e.height)??Wi(e.levels??e.building_levels??e["building:levels"]);return t&&t>0?Math.max(t,xi):gi}function $i(e,t){let n=ot(e.render_min_height)??ot(e.min_height)??ot(e.base)??0;return n>0&&n<t?n:0}function Wi(e){let t=ot(e);return t&&t>0?t*3:null}function ot(e){if(typeof e=="number"&&isFinite(e))return e;if(typeof e=="string"){let t=parseFloat(e);if(isFinite(t))return t}return null}var sn=e=>e>127?127:e<-127?-127:e;function Zi(e){let t=e.osm_id;if(typeof t=="number"&&Number.isFinite(t))return t;if(typeof t=="string"){let n=Number(t);if(Number.isFinite(n))return n}return null}function sr(e,t){let n=e.length/2-1,i=new Array(Math.max(n,0)).fill(!1);if(n<3)return{ring:e,cut:i};let o=(s,u)=>s===0?1:s===t?2:u===0?3:u===t?4:0,r=e.slice();for(let s=0;s<n;s++){let u=e[s*2],l=e[s*2+1],c=o(u,l);if(!c)continue;let f=(s+n-1)%n,p=(s+1)%n,m=o(e[f*2],e[f*2+1])===c,g=o(e[p*2],e[p*2+1])===c;g&&(i[s]=!0);let y=m===g?-1:m?p:f;if(y<0)continue;let w=u-e[y*2],E=l-e[y*2+1],S=Math.hypot(w,E);S<1e-6||(r[s*2]=u+w/S*er,r[s*2+1]=l+E/S*er)}return r[n*2]=r[0],r[n*2+1]=r[1],{ring:r,cut:i}}function Ki(e,t,n,i){let{extent:o,metersPerUnit:r,height:s,minHeight:u,featureId:l,seed:c,tint:f,facade:p}=i,m=i.whole?t:He(t,o,ve(o));if(!m)return;let g=i.cornerRadius/r,y={radius:g,segments:i.cornerSegments,minCutRatio:0,maxChord:r>0?Kn/r:0,...i.whole?{}:{extent:o,margin:ve(o)}},w=g>0?{outer:je(m.outer,y),holes:m.holes.map(G=>je(G,y))}:m,E=i.whole?w:He(w,o);if(!E)return;let S=G=>({ring:G,cut:new Array(Math.max(G.length/2-1,0)).fill(!1)}),B=i.whole?S(E.outer):sr(E.outer,o),L=E.holes.map(G=>i.whole?S(G):sr(G,o)),A={outer:B.ring,holes:L.map(G=>G.ring)},U=i.whole?!0:rn(A.outer,o),V=A.outer.length/2+A.holes.reduce((G,te)=>G+te.length/2,0);n(V*5+32);let D=A.holes.length||U?null:Ii(A.outer),j=D?Ci(i.props,D,s,c,r):null,O=null,z=[];if(j&&D){let G=fr(Di(A.outer,r),D,j.shape);z=Ni(G,A.outer);let te=Ui(G,z);if(te>1e-6){let ie=Math.min(Math.max(te*r*_i,Ti),Bi);O=Gi(G,ie/te,s)}}ir(e,A.outer,u,s,l,f,p,r,O,B.cut);for(let G=0;G<A.holes.length;G++)ir(e,A.holes[G],u,s,l,f,p,r,null,L[G].cut);O?ji(e,z,O,s,l,f,p,r):Ai(e,A.outer,A.holes,s,l,f,p)}function Qi(e,t){let n=1/0,i=1/0,o=-1/0,r=-1/0;for(let s=0;s<e.length;s+=2)e[s]<n&&(n=e[s]),e[s]>o&&(o=e[s]),e[s+1]<i&&(i=e[s+1]),e[s+1]>r&&(r=e[s+1]);return o>0&&n<t&&r>0&&i<t}function ur(e,t){let n=ve(t),i=Math.max(e.length/2-1,0),o=new Array(i);for(let r=0;r<i;r++)o[r]=Vt(e[r*2],e[r*2+1],e[r*2+2],e[r*2+3],t,n);return o}function Ji(e,t,n,i,o,r,s,u){let l=He(e,t,ve(t));if(!l||!Qi(l.outer,t))return null;let c=ur(l.outer,t);return{osmId:o,height:n,minHeight:i,seed:r,tint:s,facade:u,outer:l.outer,holes:l.holes,outerCut:c,holeCuts:l.holes.map(f=>ur(f,t))}}var yt=8;function qi(e){return e?Je(e.color)||Je(e.opacity)||Je(e.width):!1}var an=class{constructor(t,n){this.spec=t;this.zoom=n;this.filled=0;this.r=0;this.g=0;this.b=0;this.a=1;this.width=0;this.capacity=1024,this.buffer=new ArrayBuffer(this.capacity*yt),this.view=new DataView(this.buffer),this.base=t.base!==void 0?$n(t.base,n,[1,0,1,1]):[1,0,1,1],this.setFeature({},null,void 0)}setFeature(t,n,i){let o={zoom:this.zoom,properties:t,id:n,geometryType:i},r=this.spec.color!==void 0?Tt(this.spec.color,o):null,[s,u,l,c]=r??this.base,f=this.spec.opacity!==void 0?hr(nt(this.spec.opacity,o),1):1;this.r=Ot(s),this.g=Ot(u),this.b=Ot(l),this.a=Ot(c*f),this.width=this.spec.width!==void 0?Math.max(hr(nt(this.spec.width,o),0),0):0}advanceTo(t){if(!(t<=this.filled)){this.ensure(t);for(let n=this.filled;n<t;n++){let i=n*yt;this.view.setUint8(i,Math.round(this.r*255)),this.view.setUint8(i+1,Math.round(this.g*255)),this.view.setUint8(i+2,Math.round(this.b*255)),this.view.setUint8(i+3,Math.round(this.a*255)),this.view.setFloat32(i+4,this.width,!0)}this.filled=t}}take(t){return this.advanceTo(t),this.buffer.slice(0,t*yt)}ensure(t){if(t<=this.capacity)return;this.capacity=Math.max(this.capacity*2,t);let n=new ArrayBuffer(this.capacity*yt);new Uint8Array(n).set(new Uint8Array(this.buffer,0,this.filled*yt)),this.buffer=n,this.view=new DataView(n)}};function Dt(e,t){return qi(e)?new an(e,t):void 0}var Ot=e=>e<0?0:e>1?1:e;function hr(e,t){let n=typeof e=="number"?e:Number(e);return Number.isFinite(n)?n:t}function fn(e,t,n,i,o){let r=i*i,s=[],u=f=>e[f*2],l=f=>e[f*2+1],c=(f,p)=>{let m=e.length/2;return e.push((u(f)+u(p))/2,(l(f)+l(p))/2),m};for(let f=0;f<t.length;f+=3){s.push([n+t[f],n+t[f+1],n+t[f+2]]);let p=0;for(;s.length&&!(++p>2e4);){let[m,g,y]=s.pop(),w=(u(m)-u(g))**2+(l(m)-l(g))**2,E=(u(g)-u(y))**2+(l(g)-l(y))**2,S=(u(y)-u(m))**2+(l(y)-l(m))**2,B=Math.max(w,E,S);if(B<=r){o.push(m,g,y);continue}if(B===w){let L=c(m,g);s.push([m,L,y],[L,g,y])}else if(B===E){let L=c(g,y);s.push([g,L,m],[L,y,m])}else{let L=c(y,m);s.push([y,L,g],[L,m,g])}}}}function mr(e,t,n=0,i,o=!1,r=4096,s){let u=[],l=[],c=[];for(let y of e.features()){if(y.type!==3||!pe(t,y.properties))continue;let w=y.properties.osm_id,E=typeof w=="number"?w:typeof w=="string"?Number(w):NaN,S=Number.isFinite(E)?E:Number(y.id??0);s?.setFeature(y.properties,y.id??null,"Polygon");for(let B of tt(y.loadGeometry())){let L=o?He(B,r):B;if(!L)continue;let A=[],U=[],V=i?je(L.outer,i):L.outer;for(let O=0;O<V.length;O++)A.push(V[O]);for(let O of L.holes){let z=i?je(O,i):O;U.push(A.length/2);for(let G=0;G<z.length;G++)A.push(z[G])}let D=Xe(A,U.length?U:void 0,2);if(!D.length)continue;let j=u.length/2;for(let O=0;O<A.length;O++)u.push(A[O]);if(n>0){let O=[];fn(u,D,j,n,O);for(let z=0;z<O.length;z+=3)l.push(O[z],O[z+2],O[z+1]),c.push(S);continue}for(let O=0;O<D.length;O+=3)l.push(j+D[O],j+D[O+2],j+D[O+1]),c.push(S)}s?.advanceTo(u.length/2)}if(!l.length)return null;let f=u.length/2,p=new Int16Array(u),m=new Uint32Array(l);return{featureIds:new Float64Array(c).buffer,vertices:p.buffer,indices:m.buffer,vertexCount:f,indexCount:m.length,...s?{dataPaint:s.take(f)}:{}}}function dr(e){return{shapes:[],cells:[],extent:0,metersPerTile:e}}function br(e,t,n,i){if(!(n<=0)){e.extent=i;for(let o of t){let r=o.outer;if(r.length<6)continue;let s=1/0,u=1/0,l=-1/0,c=-1/0;for(let f=0;f<r.length;f+=2)r[f]<s&&(s=r[f]),r[f]>l&&(l=r[f]),r[f+1]<u&&(u=r[f+1]),r[f+1]>c&&(c=r[f+1]);e.shapes.push({outer:r,holes:o.holes,level:n,minX:s,minY:u,maxX:l,maxY:c})}e.cells=[]}}function es(e){e.cells=Array.from({length:32*32},()=>[]);let t=e.extent/32;for(let n=0;n<e.shapes.length;n++){let i=e.shapes[n],o=it(Math.floor(i.minX/t)),r=it(Math.floor(i.maxX/t)),s=it(Math.floor(i.minY/t)),u=it(Math.floor(i.maxY/t));for(let l=s;l<=u;l++)for(let c=o;c<=r;c++)e.cells[l*32+c].push(n)}}var gr=e=>e.shapes.length===0;function hn(e,t,n){!e.cells.length&&e.shapes.length&&es(e);let i=e.extent/32,o=e.cells[it(Math.floor(n/i))*32+it(Math.floor(t/i))];if(!o||!o.length)return 0;let r=0;for(let s of o){let u=e.shapes[s];if(u.level<=r||t<u.minX||t>u.maxX||n<u.minY||n>u.maxY||!pr(u.outer,t,n))continue;let l=!1;for(let c of u.holes)if(pr(c,t,n)){l=!0;break}l||(r=u.level)}return Math.min(Math.round(r*100),127)}function xr(e,t){let n=[],i=[],o=e.extent>0?e.metersPerTile/e.extent:0,r=o>0?2/o:0,s=hn(e,t[0],t[1]);n.push(t[0],t[1]),i.push(s);for(let u=0;u+3<t.length;u+=2){let l=t[u],c=t[u+1],f=t[u+2],p=t[u+3],m=hn(e,f,p);if(m!==s&&r>0){let g=Math.hypot(f-l,p-c),y=Math.min(Math.ceil(g/r),64),w=s;for(let E=1;E<y;E++){let S=E/y,B=l+(f-l)*S,L=c+(p-c)*S,A=hn(e,B,L);A!==w&&(n.push(B,L),i.push(A),w=A)}}n.push(f,p),i.push(m),s=m}return{pts:n,levels:i}}var it=e=>e<0?0:e>31?31:e;function pr(e,t,n){let i=!1,o=e.length/2;for(let r=0,s=o-1;r<o;s=r++){let u=e[r*2],l=e[r*2+1],c=e[s*2],f=e[s*2+1];l>n!=f>n&&t<(c-u)*(n-l)/(f-l)+u&&(i=!i)}return i}function Sr(e,t){let n=t.halfWidth;if(!(n>0))return null;let i=ts(e);if(i.length<4)return null;let o=ns(n,t.metersPerUnit),r=[],s=i.length/2,u=new Float64Array(s);for(let w=1;w<s;w++)u[w]=u[w-1]+Math.hypot(i[w*2]-i[w*2-2],i[w*2+1]-i[w*2-1]);let l=t.halfWidthAt,c=l?w=>Math.max(l(w),0):()=>n,f=w=>c(u[(w%s+s)%s]),p=1/0;for(let w=0;w<s;w++)p=Math.min(p,f(w));if(t.closed===!0){let w=[],E=[];Nt(w,i,f,!0,o,!0),Nt(E,i,f,!1,o,!0);let S=[];for(let A of[w,E]){let U=yr(A);if(U.length<8)continue;U.push(U[0],U[1]);let V=vr(U,i,u,c,p);V&&V.length>=8&&S.push(V)}if(!S.length)return null;S.sort((A,U)=>Math.abs(wt(U))-Math.abs(wt(A)));let B=wt(S[0])<0?mn(S[0]):S[0],L=S.slice(1).map(A=>wt(A)>0?mn(A):A);return{outer:B,holes:L}}if(Nt(r,i,f,!0,o,!1),Nt(r,i,f,!1,o,!1),r.length<8)return null;let g=yr(r);if(g.length<8)return null;g.push(g[0],g[1]);let y=vr(g,i,u,c,p);return!y||y.length<8?null:{outer:wt(y)<0?mn(y):y,holes:[]}}function yr(e){let t=[];for(let i=0;i+1<e.length;i+=2){let o=t.length;o>=2&&Math.abs(t[o-2]-e[i])<1e-9&&Math.abs(t[o-1]-e[i+1])<1e-9||t.push(e[i],e[i+1])}let n=t.length;return n>=4&&Math.abs(t[0]-t[n-2])<1e-9&&Math.abs(t[1]-t[n-1])<1e-9&&(t.length=n-2),t}function wt(e){let t=0;for(let n=0;n+3<e.length;n+=2)t+=e[n]*e[n+3]-e[n+2]*e[n+1];return t/2}function mn(e){let t=[];for(let n=e.length-2;n>=0;n-=2)t.push(e[n],e[n+1]);return t}function ts(e){let t=[];for(let n=0;n+1<e.length;n+=2){let i=e[n],o=e[n+1],r=t.length;r>=2&&Math.abs(t[r-2]-i)<1e-6&&Math.abs(t[r-1]-o)<1e-6||t.push(i,o)}return t}function ns(e,t){let n=e*(t>0?t:.5),i=Math.ceil(Math.PI*n/1);return Math.max(2,Math.min(10,i))}function Nt(e,t,n,i,o,r){let s=t.length/2,u=c=>{let f=(c%s+s)%s;return[t[f*2],t[f*2+1]]},l=[];if(i)for(let c=0;c<s;c++)l.push(c);else for(let c=s-1;c>=0;c--)l.push(c);for(let c=0;c<l.length;c++){let f=l[c],p=c>0?l[c-1]:r?l[l.length-1]:-1,m=c+1<l.length?l[c+1]:r?l[0]:-1,[g,y]=u(f),w=n(f);if(!(w>0))continue;let E=p>=0?Mr(u(p),[g,y]):null,S=m>=0?Mr([g,y],u(m)):null;if(E&&S){let B=E[0]*S[1]-E[1]*S[0],A=1+(E[0]*S[0]+E[1]*S[1]),U=A>1e-6?w*Math.sqrt(2/A):1/0,V=wr(u(p),[g,y]),D=wr([g,y],u(m));B>0&&U<=w*2&&U<=Math.min(V,D)?e.push(g+(E[0]+S[0])*w/A,y+(E[1]+S[1])*w/A):pn(e,g,y,w,E,S,o)}else S?pn(e,g,y,w,[-S[1],S[0]],S,o):E&&pn(e,g,y,w,E,[E[1],-E[0]],o)}}function wr(e,t){return Math.hypot(t[0]-e[0],t[1]-e[1])}function Mr(e,t){let n=t[0]-e[0],i=t[1]-e[1],o=Math.hypot(n,i);return o>0?[-i/o,n/o]:null}function pn(e,t,n,i,o,r,s){let u=Math.atan2(o[1],o[0]),l=Math.atan2(r[1],r[0])-u;for(;l>Math.PI;)l-=2*Math.PI;for(;l<-Math.PI;)l+=2*Math.PI;let c=Math.max(1,Math.min(s,Math.ceil(Math.abs(l)/Math.PI*s)));for(let f=0;f<=c;f++){let p=u+l*f/c;e.push(t+Math.cos(p)*i,n+Math.sin(p)*i)}}function vr(e,t,n,i,o){let r=is(e);if(!r.length)return e;let s=[],u=[],l=e.length/2-1,c=[];for(let y=0;y<l;y++){s.push(e[y*2],e[y*2+1]),u.push(!1),c.length=0;for(let w of r)w.i===y&&c.push({t:w.t,x:w.x,y:w.y}),w.j===y&&c.push({t:w.u,x:w.x,y:w.y});if(c.length){c.sort((w,E)=>w.t-E.t);for(let w of c)s.push(w.x,w.y),u.push(!0)}}let f=u.length,p=u.indexOf(!0);if(p<0)return e;let m=[],g=0;for(let y=1;y<=f;y++){let w=(p+y)%f;if(!u[w])continue;let E=y;if(!rs(s,p,g,E,f,t,n,i,o))for(let S=g;S<=E;S++){let B=(p+S)%f,L=s[B*2],A=s[B*2+1],U=m.length;U>=2&&Math.abs(m[U-2]-L)<1e-9&&Math.abs(m[U-1]-A)<1e-9||m.push(L,A)}g=E}return m.length<6?e:(m.push(m[0],m[1]),m)}function rs(e,t,n,i,o,r,s,u,l){for(let c=n;c<=i;c++){let f=(t+c)%o;if(os(e[f*2],e[f*2+1],r,s,u,l))return!0}return!1}function os(e,t,n,i,o,r){let s=n.length/2-1,u=r*(1-.01),l=u*u,c=1/0,f=0,p=0;for(let S=0;S<s;S++){let B=n[S*2],L=n[S*2+1],A=n[S*2+2]-B,U=n[S*2+3]-L,V=A*A+U*U,D=V>0?Math.max(0,Math.min(1,((e-B)*A+(t-L)*U)/V)):0,j=e-(B+A*D),O=t-(L+U*D),z=j*j+O*O;if(z<l)return!0;z<c&&(c=z,f=S,p=D)}if(!(c<1/0))return!1;let m=n[f*2],g=n[f*2+1],y=n[f*2+2]-m,w=n[f*2+3]-g,E=o(i[f]+Math.hypot(y,w)*p)*(1-.01);return c<E*E}function is(e){let t=[],n=e.length/2-1;if(n<4)return t;let i=new Float64Array(n),o=new Float64Array(n),r=new Float64Array(n),s=new Float64Array(n),u=[];for(let l=0;l<n;l++){u.push(l);let c=e[l*2],f=e[l*2+2],p=e[l*2+1],m=e[l*2+3];i[l]=c<f?c:f,o[l]=c<f?f:c,r[l]=p<m?p:m,s[l]=p<m?m:p}u.sort((l,c)=>i[l]-i[c]);for(let l=0;l<u.length;l++){let c=u[l];for(let f=l+1;f<u.length;f++){let p=u[f];if(i[p]>o[c])break;let m=Math.abs(c-p);if(m<2||m===n-1||r[p]>s[c]||r[c]>s[p])continue;let g=c<p?c:p,y=c<p?p:c,w=ss(e[g*2],e[g*2+1],e[g*2+2],e[g*2+3],e[y*2],e[y*2+1],e[y*2+2],e[y*2+3]);w&&t.push({i:g,j:y,t:w[2],u:w[3],x:w[0],y:w[1]})}}return t}function ss(e,t,n,i,o,r,s,u){let l=n-e,c=i-t,f=s-o,p=u-r,m=l*p-c*f;if(Math.abs(m)<1e-12)return null;let g=((o-e)*p-(r-t)*f)/m,y=((o-e)*c-(r-t)*l)/m;return g<=1e-9||g>=1-1e-9||y<=1e-9||y>=1-1e-9?null:[e+l*g,t+c*g,g,y]}function Ve(e){let t=e.layer,n=typeof t=="number"?t:typeof t=="string"?Number(t):NaN;if(Number.isFinite(n)&&n!==0)return Math.max(-5,Math.min(5,Math.trunc(n)));let i=e.brunnel;return i==="bridge"?1:i==="tunnel"?-1:0}var Rr=new WeakMap,Ye=(e,t)=>(e+512)*65536+(t+512);function Fr(e,t,n,i,o){if(e===0||t<=0)return t;let r=8*4294967296,s=Math.max(o.raw.get(n+r)??0,o.raw.get(i+r)??0);return s>0&&t>s?s:t}function Ut(e){let t=Rr.get(e);if(t)return t;let n={width:new Map,ends:new Map,raw:new Map},i=[];for(let o of e.features()){if(o.type!==2)continue;let r=o.properties.width,s=typeof r=="number"&&r>.5&&r<100?r:0,u=Ve(o.properties);for(let l of o.loadGeometry()){if(l.length<4)continue;let c=Ye(Math.round(l[0]),Math.round(l[1])),f=Ye(Math.round(l[l.length-2]),Math.round(l[l.length-1]));for(let p of[c,f]){let m=p+(u+8)*4294967296;n.ends.set(m,(n.ends.get(m)??0)+1),s>0&&n.raw.set(m,Math.max(n.raw.get(m)??0,s))}i.push({h:c,t:f,lv:u,w:s})}}for(let o of i){let r=Fr(o.lv,o.w,o.h,o.t,n);if(!(r<=0))for(let s of[o.h,o.t]){let u=n.width.get(s);(u===void 0||r>u)&&n.width.set(s,r)}}return Rr.set(e,n),n}var Gt=12;function jt(e,t){let n=e.length/2,i=0;for(let g=0;g<n-1;g++)i+=Math.hypot(e[g*2+2]-e[g*2],e[g*2+3]-e[g*2+1]);let o=Ye(Math.round(e[0]),Math.round(e[1])),r=Ye(Math.round(e[n*2-2]),Math.round(e[n*2-1])),s=Fr(t.level,t.width,o,r,t.junctions),u=g=>Math.min(t.junctions.width.get(g)??0,s*2),l=u(o)-s,c=u(r)-s,f=Math.min(t.taper,i/2);if(!(f>0)||l<=0&&c<=0)return{width:s,at:null,total:i,knots:[]};let p=g=>{let y=0;return l>0&&g<f&&(y=l*(1-g/f)),c>0&&i-g<f&&(y=Math.max(y,c*(1-(i-g)/f))),s+y},m=[];for(let g of[f,i-f])g>.01&&g<i-.01&&m.push(g);return{width:s,at:p,total:i,knots:m}}function kr(e,t){let n=[...t].sort((s,u)=>s-u);if(!n.length)return e;let i=[e[0],e[1]],o=0,r=0;for(let s=0;s+3<e.length;s+=2){let u=e[s],l=e[s+1],c=e[s+2],f=e[s+3],p=Math.hypot(c-u,f-l);for(;r<n.length&&n[r]<=o+.01;)r++;for(;r<n.length&&n[r]<o+p-.01;){let m=(n[r]-o)/p;i.push(u+(c-u)*m,l+(f-l)*m),r++}o+=p,i.push(c,f)}return i}function Ar(e,t,n){let i=[];for(let l of e.features()){if(l.type!==2||!t(l.properties))continue;let c=n(l.properties);if(!c||!(c>0))continue;let f=l.properties.osm_id,p=typeof f=="number"?f:typeof f=="string"?Number(f):NaN,m=Number.isFinite(p)?p:Number(l.id??0),g=Ve(l.properties);for(let y of l.loadGeometry())y.length<4||i.push({pts:Array.from(y),props:l.properties,id:m,w:c,lv:g,used:!1})}let o=new Map,r=(l,c)=>c?Ye(Math.round(l[l.length-2]),Math.round(l[l.length-1])):Ye(Math.round(l[0]),Math.round(l[1]));i.forEach((l,c)=>{for(let f of[!1,!0]){let p=r(l.pts,f),m=o.get(p);m?m.push({piece:c,tail:f}):o.set(p,[{piece:c,tail:f}])}});let s=(l,c,f)=>{let p=o.get(l);if(!p||p.length!==2)return null;let m=p.filter(y=>!i[y.piece].used);if(m.length!==1)return null;let g=i[m[0].piece];return g.w===c&&g.lv===f?m[0]:null},u=[];for(let l=0;l<i.length;l++){let c=i[l];if(c.used)continue;c.used=!0;let f=c.pts.slice(),p=[c.id];for(let m=0;m<256;m++){let g=s(r(f,!0),c.w,c.lv);if(!g)break;let y=i[g.piece];y.used=!0;let w=g.tail?Er(y.pts):y.pts;for(let E=2;E<w.length;E+=2)f.push(w[E],w[E+1]);p.push(y.id)}for(let m=0;m<256;m++){let g=s(r(f,!1),c.w,c.lv);if(!g)break;let y=i[g.piece];y.used=!0;let w=g.tail?y.pts:Er(y.pts),E=[];for(let S=0;S+3<w.length;S+=2)E.push(w[S],w[S+1]);f=E.concat(f),p.push(y.id)}u.push({pts:f,props:c.props,ids:p})}return u}function Er(e){let t=[];for(let n=e.length-2;n>=0;n-=2)t.push(e[n],e[n+1]);return t}var Ir=85.051129;var us=e=>Math.max(-Ir,Math.min(Ir,e));function Pr(e){return(180+e)/360}function Lr(e){let t=us(e);return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))/360}var Tr=.25,ls="liftPath";function cs(e,t,n){if(typeof e!="string"||!e.length)return null;let i=Math.pow(2,t.z),o=[];for(let u of e.split("|")){let l=[],c=[],f=[];for(let p of u.split(";")){let m=p.split(",");if(m.length<3)continue;let g=Number(m[0]),y=Number(m[1]),w=Number(m[2]);!Number.isFinite(g)||!Number.isFinite(y)||!Number.isFinite(w)||(l.push((Pr(g)*i-t.x)*n),c.push((Lr(y)*i-t.y)*n),f.push(w))}l.length>=2&&o.push({xs:l,ys:c,hs:f})}if(!o.length)return null;if(o.length===1)return ms(o[0].xs,o[0].ys,o[0].hs);let r=o.map(u=>hs(u.xs,u.ys,u.hs)),s=as/fs(t,n);return(u,l)=>{let c=1/0,f=0,p=1/0,m=0;for(let L of r){let A=L(u,l);A.d<c?(p=c,m=f,c=A.d,f=A.h):A.d<p&&(p=A.d,m=A.h)}if(!Number.isFinite(p))return f;let g=Math.abs(f-m);if(g>=Br)return f;let y=Math.max(0,(g-_r)/(Br-_r)),w=s*(1-y*y*(3-2*y)),E=Math.sqrt(p)-Math.sqrt(c);if(E>=w)return f;let S=E/w,B=.5+.5*S*S*(3-2*S);return f*B+m*(1-B)}}var as=12,_r=2,Br=5;function fs(e,t){let n=Math.pow(2,e.z),i=Math.atan(Math.sinh(Math.PI*(1-2*(e.y+.5)/n)));return 40075016686e-3*Math.cos(i)/(n*t)}function hs(e,t,n){let i=e.length,o=new Array(i-1);for(let r=0;r+1<i;r++){let s=e[r+1]-e[r],u=t[r+1]-t[r];o[r]=s*s+u*u}return(r,s)=>{let u=1/0,l=n[0];for(let c=0;c+1<i;c++){let f=e[c+1]-e[c],p=t[c+1]-t[c],m=o[c]>1e-12?Math.max(0,Math.min(1,((r-e[c])*f+(s-t[c])*p)/o[c])):0,g=e[c]+f*m,y=t[c]+p*m,w=(r-g)*(r-g)+(s-y)*(s-y);w<u&&(u=w,l=n[c]+(n[c+1]-n[c])*m)}return{d:u,h:l}}}function ms(e,t,n){let i=e.length,o=new Array(i-1);for(let r=0;r+1<i;r++){let s=e[r+1]-e[r],u=t[r+1]-t[r];o[r]=s*s+u*u}return(r,s)=>{let u=1/0,l=n[0];for(let c=0;c+1<i;c++){let f=e[c+1]-e[c],p=t[c+1]-t[c],m=o[c]>1e-12?Math.max(0,Math.min(1,((r-e[c])*f+(s-t[c])*p)/o[c])):0,g=e[c]+f*m,y=t[c]+p*m,w=(r-g)*(r-g)+(s-y)*(s-y);w<u&&(u=w,l=n[c]+(n[c+1]-n[c])*m)}return l}}function Cr(e,t){let n=new Map;return i=>{if(!e)return null;let o=i[ls];if(typeof o!="string"||!o.length)return null;let r=n.get(o);if(r!==void 0)return r;let s=cs(o,e,t);return n.set(o,s),s}}var ps=yo(Vr(),1),Or=ps,xn=Or.union??Or.default?.union??null;xn||console.warn("[osmgl] polygon-clipping \\u0431\\u0435\\u0437 union \\u2014 \\u043E\\u0431\\u044A\\u0435\\u0434\\u0438\\u043D\\u0435\\u043D\\u0438\\u0435 \\u0444\\u0438\\u0433\\u0443\\u0440 \\u0432\\u044B\\u043A\\u043B\\u044E\\u0447\\u0435\\u043D\\u043E");var Ht=0,zt=0;function ds(e){for(let t of e)if(t.length>=2){Ht=Math.round(t[0]),zt=Math.round(t[1]);return}Ht=0,zt=0}function Dr(e){let t=[];for(let n=0;n+1<e.length;n+=2)t.push([e[n]-Ht,e[n+1]-zt]);return t}function Nr(e){let t=[];for(let i of e)t.push(i[0]+Ht,i[1]+zt);let n=t.length;return n>=4&&(t[0]!==t[n-2]||t[1]!==t[n-1])&&t.push(t[0],t[1]),t}function Gr(e,t,n=0){if(e.length<2)return e;let i=new Map;for(let r of e){let s=r.at?r:r.lift??0,u=i.get(s);u?u.push(r):i.set(s,[r])}let o=[];for(let[r,s]of i){if(s.length<2){o.push(...s);continue}let u=typeof r=="number"?r:0;o.push(...bs(s,u,t,n))}return o}var gn=256;function bs(e,t,n,i=0){let o=e,r=i>0&&n?i:0;for(let s=0;s<32;s++){if(o.length<2)return o;if(o.length<=gn)return Ur(o,t,n,r);let u=gs(o),l=[];for(let c=0;c<u.length;c+=gn)l.push(...Ur(u.slice(c,c+gn),t,n,r));if(r=0,l.length>=o.length)return l;o=l}return o}function gs(e){let t=1/0,n=1/0,i=-1/0,o=-1/0,r=e.map(c=>{let f=0,p=0,m=0;for(let w=0;w+1<c.outer.length;w+=2)f+=c.outer[w],p+=c.outer[w+1],m++;let g=m?f/m:0,y=m?p/m:0;return g<t&&(t=g),g>i&&(i=g),y<n&&(n=y),y>o&&(o=y),{s:c,cx:g,cy:y}}),s=i-t||1,u=o-n||1,l=c=>{let f=Math.max(0,Math.min(65535,Math.round(c*65535)));return f=(f|f<<8)&16711935,f=(f|f<<4)&252645135,f=(f|f<<2)&858993459,f=(f|f<<1)&1431655765,f};return r.map(c=>({s:c.s,key:l((c.cx-t)/s)|l((c.cy-n)/u)<<1})).sort((c,f)=>c.key-f.key).map(c=>c.s)}function Ur(e,t,n,i=0){{let o=[],r=i>0&&n?e.map(c=>({outer:n(c.outer,-i)??c.outer,holes:c.holes.map(f=>n(f,i)??f)})):e;ds(r.map(c=>c.outer));let s=r.map(c=>[Dr(c.outer),...c.holes.map(Dr)]),u;try{if(!xn)throw new Error("\\u043D\\u0435\\u0442 union");u=xn(s[0],...s.slice(1))}catch{return e}let l=u;if(!Array.isArray(l)||l.length===0)return e;for(let c of l){if(!c.length)continue;let f=Nr(c[0]);if(f.length<8)continue;let p=[];for(let m=1;m<c.length;m++){let g=Nr(c[m]);g.length>=8&&p.push(g)}o.push(t?{outer:f,holes:p,lift:t}:{outer:f,holes:p})}return o}}var xs=5,Sn=16,ys=64,Wr=0,ws=1,jr=2,Ms=3,Xt=1,vs=.6;function Ss(e,t,n,i){if(!t||!(t>0)||!(n>0))return[];let o=t/2/n,r=[];for(let s of e){let u=s.length>=8&&Math.abs(s[0]-s[s.length-2])<1e-6&&Math.abs(s[1]-s[s.length-1])<1e-6,l,c=s;if(i&&!u){let g=Array.from(s),y=jt(g,{junctions:i.junctions,width:i.width,level:i.level,taper:i.reach});if(y.at){let w=i.extra/2/n,E=y.at;l=S=>E(S)/2/n+w,y.knots.length&&(c=kr(g,y.knots))}}let f=Sr(c,{halfWidth:o,metersPerUnit:n,closed:u,halfWidthAt:l});if(!f)continue;let p=f.outer,m=[];if(i&&!u){let g=s.length/2;for(let[y,w,E]of[[s[0],s[1],0],[s[g*2-2],s[g*2-1],-1]]){if(!Es(i,y,w))continue;let S=E===0?0:Rs(c),B=l?l(S):o;m.push({x:y,y:w,r:B})}}r.push(m.length?{outer:p,holes:f.holes,caps:m}:{outer:p,holes:f.holes})}return r}function Rs(e){let t=0;for(let n=0;n+3<e.length;n+=2)t+=Math.hypot(e[n+2]-e[n],e[n+3]-e[n+1]);return t}function Es(e,t,n){let i=Ye(Math.round(t),Math.round(n))+(e.level+8)*4294967296;return(e.junctions.ends.get(i)??0)>1}function Zr(e,t,n,i){let o=i.metersPerUnit>0?i.metersPerUnit:.5,r=i.elevation,s=i.base??0,u=Math.max(i.bevel??0,0)/o,l=Math.max(i.bevelDrop??0,0),c=Math.max(i.cornerRadius??0,0)/o,f=Math.max(512,e.length*24),p=new ArrayBuffer(f*Sn),m={view:new DataView(p),bytes:new Uint8Array(p),offset:0,count:0,indices:[],extent:t,ensure(T){if(m.count+T<=f)return;f=Math.max(f*2,m.count+T);let N=new ArrayBuffer(f*Sn);new Uint8Array(N).set(m.bytes.subarray(0,m.offset)),p=N,m.view=new DataView(N),m.bytes=new Uint8Array(N)}},g=i.widthOf?Ut(e):null,y=Math.max(i.widthExtra??0,0),w=Gt/o,E=T=>{if(!g)return;let N=i.widthOf(T);if(!(!N||!(N>0)))return{junctions:g,width:Math.max(N-y,0),extra:y,level:Ve(T),reach:w}},S=[],B=[],L=new Map,A=i.widthOf?Ar(e,T=>pe(n,T),i.widthOf):null,U=A?A.map(T=>({geometry:[T.pts],props:T.props,ids:T.ids})):[];if(!A)for(let T of e.features()){if(T.type!==3||!pe(n,T.properties))continue;let N=T.properties.osm_id,ee=typeof N=="number"?N:typeof N=="string"?Number(N):NaN;U.push({geometry:T.loadGeometry(),props:T.properties,ids:[Number.isFinite(ee)?ee:Number(T.id??0)]})}for(let T of U){let N=A!==null,ee=i.liftAt?.(T.props)??null,Z=ee?0:i.liftBy?.(T.props)??0,oe=T.ids;for(let de of N?Ss(T.geometry,i.widthOf(T.props),o,E(T.props)):tt(T.geometry)){let be=He(de,t,ve(t));if(!be)continue;let se=de.caps;S.push({...be,...Z?{lift:Z}:{},...ee?{at:ee}:{},...se?{caps:se}:{}}),B.push(oe)}}let V=new Set,D=Math.max(i.weld??vs,0),j=i.widthOf?S:Gr(S,(T,N)=>wn(T,N,t,V),D/o),O=D>0?j.map(T=>({...T,outer:$r(T.outer,D/o,t),holes:T.holes.map(N=>$r(N,D/o,t))})):j;for(let T of O){zr(T.outer,L);for(let N of T.holes)zr(N,L)}i.onShapes?.(O);let z=Fs(O,S,B),G=new Set;for(let[T,N]of L)N>1&&G.add(T);if(O.some(T=>T.at)||new Set(O.map(T=>T.lift??0)).size>1){let T=(N,ee,Z)=>{let oe=O[N];return(oe.lift??0)+(oe.at?oe.at(ee,Z):0)};Is(O,(N,ee,Z)=>r+T(N,ee,Z),G,.5/o)}for(let T of O){let N=T.caps;if(N)for(let ee of N)Ls(T.outer,ee,G)}let ie=[],J={radius:c,segments:i.cornerSegments,extent:t,margin:ve(t),minCutRatio:0,maxChord:Zn/o},X=[];for(let T of O){let N=m.indices.length,ee=ie.length,Z=c>0?{outer:je(T.outer,{...J,keep:Xr(T.outer,G)}),holes:T.holes.map(he=>je(he,{...J,keep:Xr(he,G)}))}:T,oe=u>0?wn(Z.outer,u,t,G):Z.outer,de=Z.holes.map(he=>u>0?wn(he,-u,t,G):he),be=T.lift??0,se=T.at,Ie=r+be,Ne=Math.max(i.deck??0,0),ce=s+be-(be>0||se?Ne:0),Me=se?Math.min(i.maxSegment||1/0,xs/o):i.maxSegment??0;Yr(m,oe??Z.outer,de.map((he,me)=>he??Z.holes[me]),Ie,Wr,Me,se);let Se=Ie,ne=Ie-l;oe&&u>0&&l>0&&yn(m,oe,Z.outer,Se,ne,ws,t,G,se),(ne!==ce||se)&&yn(m,Z.outer,Z.outer,ne,ce,jr,t,G,se);for(let he of Z.holes)if((ne!==ce||se)&&yn(m,he,he,ne,ce,jr,t,G,se),Ie<ce){let me=m.indices.length;Yr(m,he,[],ce,Ms,0,se);for(let Pe=me;Pe<m.indices.length;Pe++)ie.push(m.indices[Pe]);m.indices.length=me}X.push(N,m.indices.length,ee,ie.length)}if(!m.indices.length&&!ie.length)return null;let W=m.indices.length;for(let T=0;T<X.length;T+=4)X[T+2]+=W,X[T+3]+=W;let re=[];for(let T of z){re.push(T.length);for(let N of T)re.push(N)}let Q=new Uint32Array(W+ie.length);return Q.set(m.indices,0),Q.set(ie,W),{vertices:p.slice(0,m.offset),indices:Q.buffer,vertexCount:m.count,indexCount:Q.length,extent:t,capIndexOffset:W,shapeFeatures:new Float64Array(re).buffer,shapeRanges:new Uint32Array(X).buffer}}function Fs(e,t,n){let i=e.map(()=>[]);if(!e.length)return i;let o=e.map(r=>Hr(r.outer));for(let r=0;r<t.length;r++){let s=ks(t[r].outer);if(!s)continue;let u=-1;for(let l=0;l<e.length;l++){let c=o[l];if(s[0]<c[0]||s[0]>c[2]||s[1]<c[1]||s[1]>c[3]||!vt(e[l].outer,s[0],s[1]))continue;let f=!1;for(let p of e[l].holes)if(vt(p,s[0],s[1])){f=!0;break}if(!f){u=l;break}}if(u<0){let l=Hr(t[r].outer),c=0;for(let f=0;f<e.length;f++){let p=o[f],m=Math.min(l[2],p[2])-Math.max(l[0],p[0]),g=Math.min(l[3],p[3])-Math.max(l[1],p[1]),y=m>0&&g>0?m*g:0;y>c&&(c=y,u=f)}}u<0&&(u=0);for(let l of n[r])i[u].includes(l)||i[u].push(l)}return i}function Hr(e){let t=1/0,n=1/0,i=-1/0,o=-1/0;for(let r=0;r<e.length;r+=2)e[r]<t&&(t=e[r]),e[r]>i&&(i=e[r]),e[r+1]<n&&(n=e[r+1]),e[r+1]>o&&(o=e[r+1]);return[t,n,i,o]}function ks(e){let t=e.length/2-1;if(t<3)return null;let n=0;for(let o=0;o<t;o++){let r=(o+1)%t;n+=e[o*2]*e[r*2+1]-e[r*2]*e[o*2+1]}let i=n>0;for(let o=0;o<t;o++){let r=(o+t-1)%t*2,s=o*2,u=(o+1)%t*2,l=(e[s]-e[r])*(e[u+1]-e[r+1])-(e[s+1]-e[r+1])*(e[u]-e[r]);if(l===0||l>0!==i)continue;let c=(e[r]+e[s]+e[u])/3,f=(e[r+1]+e[s+1]+e[u+1])/3;if(vt(e,c,f))return[c,f]}return null}function vt(e,t,n){let i=!1,o=e.length/2-1;for(let r=0,s=o-1;r<o;s=r++){let u=e[r*2],l=e[r*2+1],c=e[s*2],f=e[s*2+1];l>n!=f>n&&t<(c-u)*(n-l)/(f-l)+u&&(i=!i)}return i}var As=Tr;function Is(e,t,n,i){if(e.length<2)return;let o=e.map(u=>{let l=1/0,c=1/0,f=-1/0,p=-1/0;for(let m=0;m<u.outer.length;m+=2)u.outer[m]<l&&(l=u.outer[m]),u.outer[m]>f&&(f=u.outer[m]),u.outer[m+1]<c&&(c=u.outer[m+1]),u.outer[m+1]>p&&(p=u.outer[m+1]);return{minX:l,minY:c,maxX:f,maxY:p}}),r=u=>{let l=e[u];return!!l.at||(l.lift??0)!==0},s=(u,l,c)=>{let f=o[u];if(l<f.minX||l>f.maxX||c<f.minY||c>f.maxY||!vt(e[u].outer,l,c))return!1;for(let p of e[u].holes)if(vt(p,l,c))return!1;return!0};for(let u=0;u<e.length;u++)for(let l of[e[u].outer,...e[u].holes])for(let c=0;c+3<l.length;c+=2){let f=l[c+2]-l[c],p=l[c+3]-l[c+1],m=Math.hypot(f,p);if(m<1e-9)continue;let g=(l[c]+l[c+2])/2,y=(l[c+1]+l[c+3])/2,w=-p/m*i,E=f/m*i,S=s(u,g+w,y+E)?-1:1,B=g+w*S,L=y+E*S;for(let A=0;A<e.length;A++)if(!(A===u||!s(A,B,L))&&!(!r(u)&&!r(A))&&!(Math.abs(t(u,B,L)-t(A,B,L))>As)){n.add($e(l[c],l[c+1],l[c+2],l[c+3]));break}}}function $e(e,t,n,i){let o=`${Math.round(e*100)},${Math.round(t*100)}`,r=`${Math.round(n*100)},${Math.round(i*100)}`;return o<r?`${o}|${r}`:`${r}|${o}`}function zr(e,t){for(let n=0;n+3<e.length;n+=2){let i=$e(e[n],e[n+1],e[n+2],e[n+3]);t.set(i,(t.get(i)??0)+1)}}function Xr(e,t){if(!t.size)return;let n=e.length/2-1,i=new Array(n).fill(!1);for(let o=0;o<n;o++){let r=$e(e[(o+n-1)%n*2],e[(o+n-1)%n*2+1],e[o*2],e[o*2+1]),s=$e(e[o*2],e[o*2+1],e[(o+1)%n*2],e[(o+1)%n*2+1]);(t.has(r)||t.has(s))&&(i[o]=!0)}return i}function Mt(e,t,n,i,o,r,s,u){let l=e.offset;return e.view.setFloat32(l,t,!0),e.view.setFloat32(l+4,n,!0),e.view.setInt16(l+8,Ps(Math.round(i*ys)),!0),e.view.setInt8(l+10,vn(Math.round(o*127))),e.view.setInt8(l+11,vn(Math.round(r*127))),e.view.setInt8(l+12,vn(Math.round(s*127))),e.bytes[l+13]=u,e.view.setInt8(l+14,t<=0?-Xt:t>=e.extent?Xt:0),e.view.setInt8(l+15,n<=0?-Xt:n>=e.extent?Xt:0),e.offset+=Sn,e.count++}function Yr(e,t,n,i,o=Wr,r=0,s){let u=[],l=[];for(let m=0;m<t.length;m++)u.push(t[m]);for(let m of n){l.push(u.length/2);for(let g=0;g<m.length;g++)u.push(m[g])}let c=Xe(u,l.length?l:void 0,2);if(!c.length)return;let f=c;if(r>0){let m=[];fn(u,c,0,r,m),f=m}e.ensure(u.length/2);let p=e.count;for(let m=0;m<u.length;m+=2)Mt(e,u[m],u[m+1],s?i+s(u[m],u[m+1]):i,0,0,1,o);for(let m=0;m<f.length;m+=3)e.indices.push(p+f[m],p+f[m+2],p+f[m+1])}function yn(e,t,n,i,o,r,s,u,l,c){let f=Math.min(t.length,n.length)/2;if(!(f<3)){e.ensure((f-1)*4);for(let p=0;p<f-1;p++){let m=n[p*2],g=n[p*2+1],y=n[p*2+2],w=n[p*2+3];if(m===y&&g===w||Vt(m,g,y,w,s,ve(s))||u.has($e(m,g,y,w)))continue;let E=y-m,S=w-g,B=Math.hypot(E,S)||1,L=S/B,A=-E/B,U=i-o,V=Math.hypot(t[p*2]-m,t[p*2+1]-g)||0,D=0;if(V>1e-6&&U!==0){let re=1/Math.hypot(1,U/V);D=V/Math.hypot(V,U)*Math.sign(U),L*=re,A*=re}let j=l?l(t[p*2],t[p*2+1]):0,O=l?l(t[p*2+2],t[p*2+3]):0,z=c??l,G=z?z(m,g):0,te=z?z(y,w):0,ie=Mt(e,t[p*2],t[p*2+1],i+j,L,A,D,r),J=Mt(e,t[p*2+2],t[p*2+3],i+O,L,A,D,r),X=Mt(e,m,g,o+G,L,A,D,r),W=Mt(e,y,w,o+te,L,A,D,r);e.indices.push(X,J,W,X,ie,J)}}}function wn(e,t,n,i){let o=e.length/2-1;if(o<3)return null;let r=[];for(let f=0;f<o;f++){let p=e[f*2],m=e[f*2+1],g=e[(f+o-1)%o*2],y=e[(f+o-1)%o*2+1],w=e[(f+1)%o*2],E=e[(f+1)%o*2+1],S=Math.hypot(p-g,m-y)||1,B=Math.hypot(w-p,E-m)||1,L=(m-y)/S,A=-(p-g)/S,U=(E-m)/B,V=-(w-p)/B,D=L+U,j=A+V,O=Math.hypot(D,j);if(O<1e-6){r.push(p,m);continue}D/=O,j/=O;let z=Math.min(1/Math.max(D*L+j*A,.35),3),G=p-D*t*z,te=m-j*t*z,ie=$e(g,y,p,m),J=$e(p,m,w,E);if(i.has(ie)||i.has(J)){r.push(p,m);continue}let X=-ve(n),W=n+ve(n);((Q,T)=>Q<=X||Q>=W||T<=X||T>=W)(p,m)&&(G=p,te=m),r.push(G,te)}r.push(r[0],r[1]);let s=Math.abs(Mn(e)),u=Mn(r);if(Math.sign(u)!==Math.sign(Mn(e))||Math.abs(u)<s*.25)return null;let l=-ve(n),c=n+ve(n);for(let f=0;f<r.length;f+=2)r[f]=Math.max(l,Math.min(c,r[f])),r[f+1]=Math.max(l,Math.min(c,r[f+1]));return r}function Mn(e){let t=0;for(let n=0;n<e.length-2;n+=2)t+=e[n]*e[n+3]-e[n+2]*e[n+1];return t/2}var vn=e=>e>127?127:e<-127?-127:e,Ps=e=>e>32767?32767:e<-32768?-32768:e;function $r(e,t,n){if(!(t>0))return e;let i=ve(n),o=-i,r=n+i,s=e;for(let u=0;u<3;u++){let l=s.length/2-1;if(l<6)break;let c=new Array(l).fill(!0),f=l;for(let m=0;m<l&&!(f<=5);m++){let g=s[m*2],y=s[m*2+1];if(g<=o||g>=r||y<=o||y>=r)continue;let w=(m+l-1)%l;for(;!c[w]&&w!==m;)w=(w+l-1)%l;let E=(m+1)%l;for(;!c[E]&&E!==m;)E=(E+1)%l;if(w===m||E===m)break;let S=s[w*2],B=s[w*2+1],L=s[E*2]-S,A=s[E*2+1]-B,U=Math.hypot(L,A);U<1e-6||Math.abs((g-S)*A-(y-B)*L)/U<t&&(c[m]=!1,f--)}if(f===l)break;let p=[];for(let m=0;m<l;m++)c[m]&&p.push(s[m*2],s[m*2+1]);p.push(p[0],p[1]),s=p}return s}function Ls(e,t,n){let i=t.r*.8,o=t.r*1.2,r=(s,u)=>{let l=Math.hypot(s-t.x,u-t.y);return l>=i&&l<=o};for(let s=0;s+3<e.length;s+=2)!r(e[s],e[s+1])||!r(e[s+2],e[s+3])||n.add($e(e[s],e[s+1],e[s+2],e[s+3]))}var St=24;function Jr(e,t,n=0,i,o=0,r={}){let{level:s,paint:u}=r,l=Math.max(256,e.length*24),c=new ArrayBuffer(l*St),f=new DataView(c),p=0,m=[],g=[],y=V=>{if(p+V<=l)return;l=Math.max(l*2,p+V);let D=new ArrayBuffer(l*St);new Uint8Array(D).set(new Uint8Array(c,0,p*St)),c=D,f=new DataView(D)},w=(V,D,j,O,z,G,te,ie=0,J=0,X=0,W=0,re=0)=>{let Q=p*St;return f.setInt16(Q,V,!0),f.setInt16(Q+2,D,!0),f.setInt16(Q+4,j,!0),f.setInt16(Q+6,O,!0),f.setInt8(Q+8,z),f.setInt8(Q+9,G),f.setInt8(Q+10,ie),f.setInt8(Q+11,J),f.setFloat32(Q+12,te,!0),f.setFloat32(Q+16,X,!0),f.setInt16(Q+20,W,!0),f.setInt16(Q+22,re,!0),p++},E=0,S=0,B=o>0?Gt/o:0,L=B>0?Ut(e):null;for(let V of e.features()){if(V.type!==2&&V.type!==3||!pe(t,V.properties)||s!==void 0&&Ve(V.properties)!==s)continue;let D=V.properties.osm_id,j=typeof D=="number"?D:typeof D=="string"?Number(D):NaN;S=Number.isFinite(j)?j:Number(V.id??0);let O=V.properties.width;E=typeof O=="number"&&O>.5&&O<100?O:0;let z=r.liftAt?.(V.properties)??null;u?.setFeature(V.properties,V.id??null,V.type===3?"Polygon":"LineString");let G=V.type===3;for(let te of V.loadGeometry()){let ie=n>0?Bs(Qr(te),n):Qr(te);if(ie.length<4)continue;let J=i&&!gr(i)?xr(i,ie):null,X=J?J.pts:ie,W=J?.levels,re=X.length/2;if(re<2)continue;let Q=Ve(V.properties),T=null,N=E;if(L&&E>0&&!G){let Z=jt(X,{junctions:L,width:E,level:Q,taper:B});if(N=Z.width,Z.at){T=Z.at;let oe=Z.knots;if(oe.length){let de=_s(X,W,oe);X=de.pts,W=de.levels,re=X.length/2}}}y((re-1)*4);let ee=0;for(let Z=0;Z<re-1;Z++){let oe=X[Z*2],de=X[Z*2+1],be=X[Z*2+2],se=X[Z*2+3],Ie=Math.hypot(be-oe,se-de);if(G&&Cs(oe,de,be,se,e.extent)){ee+=Ie;continue}let Ne=Ts(oe,de,be,se,e.extent);if(!Ne){ee+=Ie;continue}let[ce,Me,Se,ne]=Ne,he=Math.hypot(ce-oe,Me-de),me=Math.hypot(Se-ce,ne-Me),Pe=Math.hypot(be-Se,se-ne),Le=ee+he,Oe=W?W[Z]:0,Ee=W?W[Z+1]:0,Ue=z?Kr(z(ce,Me)):0,ze=z?Kr(z(Se,ne)):0,We=T?T(Le):N,ut=T?T(Le+me):N,Rt=w(ce,Me,Se,ne,0,-1,Le,Oe,Ee,We,Ue,ze),Yt=w(ce,Me,Se,ne,0,1,Le,Oe,Ee,We,Ue,ze),Re=w(ce,Me,Se,ne,1,1,Le,Oe,Ee,ut,Ue,ze),kn=w(ce,Me,Se,ne,1,-1,Le,Oe,Ee,ut,Ue,ze);ee+=he+me+Pe,m.push(Rt,Yt,Re,Rt,Re,kn),g.push(S,S)}}u?.advanceTo(p)}if(!m.length)return null;let A=new Uint32Array(m),U=new Float64Array(g);return{vertices:c.slice(0,p*St),indices:A.buffer,vertexCount:p,indexCount:A.length,featureIds:U.buffer,...u?{dataPaint:u.take(p)}:{}}}function Kr(e){return Math.max(-32768,Math.min(32767,Math.round(e*100)))}function _s(e,t,n){let i=[...n].sort((l,c)=>l-c),o=[e[0],e[1]],r=t?[t[0]]:void 0,s=0,u=0;for(let l=0;l+3<e.length;l+=2){let c=e[l],f=e[l+1],p=e[l+2],m=e[l+3],g=Math.hypot(p-c,m-f);for(;u<i.length&&i[u]<=s+.01;)u++;for(;u<i.length&&i[u]<s+g-.01;){let y=(i[u]-s)/g;o.push(c+(p-c)*y,f+(m-f)*y),r&&t&&r.push(Math.round(t[l/2]+(t[l/2+1]-t[l/2])*y)),u++}s+=g,o.push(p,m),r&&t&&r.push(t[l/2+1])}return{pts:o,levels:r}}function Bs(e,t){let n=[];for(let i=0;i+3<e.length;i+=2){let o=e[i],r=e[i+1],s=e[i+2],u=e[i+3];n.push(o,r);let l=Math.min(64,Math.floor(Math.hypot(s-o,u-r)/t));for(let c=1;c<l;c++){let f=c/l;n.push(o+(s-o)*f,r+(u-r)*f)}}return n.push(e[e.length-2],e[e.length-1]),n}function Qr(e){let t=[];for(let n=0;n<e.length;n+=2){let i=e[n],o=e[n+1],r=t.length;r>=2&&t[r-2]===i&&t[r-1]===o||t.push(i,o)}return t}function Ts(e,t,n,i,o){let r=n-e,s=i-t,u=0,l=1,c=[[-r,e],[r,o-e],[-s,t],[s,o-t]];for(let[f,p]of c){if(f===0){if(p<0)return null;continue}let m=p/f;if(f<0){if(m>l)return null;m>u&&(u=m)}else{if(m<u)return null;m<l&&(l=m)}}return l-u<1e-6?null:[Math.round(e+r*u),Math.round(t+s*u),Math.round(e+r*l),Math.round(t+s*l)]}function Cs(e,t,n,i,o){return e===n&&(e<=0||e>=o)?!0:t===i&&(t<=0||t>=o)}var Vs=[["\\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."]],qr=new Map(Vs);function eo(e){let t=e.split(" ");if(t.length<2)return e;let n=!1,i=t.map(r=>{let s=qr.get(r.toLowerCase());return s?(n=!0,r[0]===r[0].toUpperCase()?s[0].toUpperCase()+s.slice(1):s):r});return!n||!t.filter(r=>qr.get(r.toLowerCase())===void 0).length?e:i.join(" ")}function no(e,t){let n=[],i=[],o=[],r=[],s=[],u=t.textPlacement==="line",l=[],c=[],f=[];for(let p of e.features()){if(!pe(t.filter,p.properties))continue;let m=p.loadGeometry(),g=Ns(p.type,m);if(!g)continue;let y=t.textField?to(t.textField,p.properties):"",w=y&&t.abbreviate?eo(y):y,E=t.iconImage?to(t.iconImage,p.properties):"";if(!(!w&&!E)){if(u){let S=Ds(p.type,m);if(!S)continue;f.push({text:w,line:S});continue}n.push(g[0],g[1]),i.push(w),o.push(E),r.push(Us(p.properties)),s.push(t.iconRotate&&Math.round(Number(p.properties[t.iconRotate]??0))||0)}}if(u){for(let{text:p,line:m}of Os(f)){c.push(l.length/2);for(let g of m)l.push(g);n.push(Math.round(m[0]),Math.round(m[1])),i.push(p),o.push(""),r.push(128),s.push(0)}c.push(l.length/2)}return i.length?{anchors:new Int16Array(n).buffer,texts:i,icons:o,priorities:new Uint8Array(r).buffer,rotations:new Int16Array(s).buffer,...u?{lines:new Int16Array(l).buffer,lineStarts:new Uint32Array(c).buffer}:{}}:null}function Os(e){let t=[],n=new Map,i=new Map,o=(r,s,u)=>`${r}\\u241F${s}\\u241F${u}`;for(let{text:r,line:s}of e){let u=o(r,s[0],s[1]),l=o(r,s[s.length-2],s[s.length-1]),c=n.get(l),f=i.get(u);if(f!==void 0){let p=t[f];if(p.line.push(...s.slice(2)),i.delete(u),i.set(o(r,p.line[p.line.length-2],p.line[p.line.length-1]),f),c!==void 0&&c!==f){let m=t[c];p.line.push(...m.line.slice(2)),m.line=[],n.delete(l),i.set(o(r,p.line[p.line.length-2],p.line[p.line.length-1]),f)}continue}if(c!==void 0){let p=t[c];p.line.unshift(...s.slice(0,s.length-2)),n.delete(l),n.set(o(r,p.line[0],p.line[1]),c);continue}n.set(u,t.length),i.set(l,t.length),t.push({text:r,line:s})}return t.filter(r=>r.line.length>=4)}function Ds(e,t){if(e!==2)return null;let n=null,i=0;for(let o of t){if(o.length<4)continue;let r=0;for(let s=0;s+3<o.length;s+=2)r+=Math.hypot(o[s+2]-o[s],o[s+3]-o[s+1]);r>i&&(i=r,n=o)}return n}function Ns(e,t){if(!t.length)return null;if(e===1){let s=t[0];return s.length>=2?[s[0],s[1]]:null}if(e===2){let s=-1,u=0,l=0;for(let c of t)for(let f=0;f+3<c.length;f+=2){let p=c[f+2]-c[f],m=c[f+3]-c[f+1],g=p*p+m*m;g>s&&(s=g,u=c[f]+p/2,l=c[f+1]+m/2)}return s>0?[Math.round(u),Math.round(l)]:null}let n=1/0,i=1/0,o=-1/0,r=-1/0;for(let s of t)for(let u=0;u<s.length;u+=2)s[u]<n&&(n=s[u]),s[u]>o&&(o=s[u]),s[u+1]<i&&(i=s[u+1]),s[u+1]>r&&(r=s[u+1]);return isFinite(n)?[Math.round((n+o)/2),Math.round((i+r)/2)]:null}function Us(e){let t=e.importance;if(typeof t=="number"&&isFinite(t))return Math.max(0,255-Math.min(Math.max(t,1),9)*20);let n=e.rank;return typeof n=="number"&&isFinite(n)?Math.max(0,255-Math.min(n,255)):128}function to(e,t){let n=Array.isArray(e)?e:[e];for(let i of n){let o=!0,s=i.replace(/\\{([^}]+)\\}/g,(u,l)=>{let c=t[l];return c==null||c===""?(o=!1,""):String(c)}).trim();if(o&&s)return s}return""}function ro(e,t){let n=[],i=[];for(let o=0;o<e.length;o++){let r=e.feature(o);if(r.type===1&&pe(t,r.properties))for(let s of r.loadGeometry())for(let u=0;u+1<s.length;u+=2)n.push(s[u],s[u+1]),i.push(r.properties)}return i.length?{anchors:Int16Array.from(n).buffer,props:i}:null}var Gs="\\u241F",Rn=(e,t)=>e+Gs+String(t);function js(){let e=typeof self<"u"?self.origin:void 0;return e&&e!=="null"&&!e.startsWith("blob:")?e+"/":void 0}function Hs(e,t){let n={},i=[],o={},r=new Set,s=[],l=t.plan.some(c=>c.type==="surface"&&(c.elevation??0)>0)&&t.plan.some(c=>c.type==="line"&&c.ground)?dr(t.metersPerTile):void 0;for(let c of t.plan){if(!Ws(c,t.zoom,t.sourceMaxZoom))continue;let f=e.layers[c.sourceLayer];if(!f)continue;let p=Zs(t.zoom,f.extent);try{if(c.splitBy){let g=Ks(f,c.splitBy,c.filter);if(!g.length)continue;let y=o[c.splitBy]??(o[c.splitBy]=[]);for(let w of g){y.includes(w)||y.push(w);let E={...c,splitBy:void 0,filter:Js(c.filter,c.splitBy,w)},S=En(E,f,p,t.metersPerTile,t.zoom,l,void 0,i,t.tile);S&&(n[Rn(c.id,w)]=S)}continue}if(c.network&&c.type==="line"){for(let g of Qs(f,c.filter)){let y=En(c,f,p,t.metersPerTile,t.zoom,l,g,i,t.tile);y&&(n[Rn(c.id,g)]=y,r.add(g))}continue}let m=En(c,f,p,t.metersPerTile,t.zoom,l,void 0,i,t.tile);m&&(n[c.id]=m)}catch(m){s.push(`${c.id}: ${m instanceof Error?m.message:String(m)}`)}}return{buckets:n,seams:i,splits:o,levels:[...r].sort((c,f)=>c-f),failed:s}}async function oo(e,t){let n=performance.now(),i=js(),o=await fetch(e.url,{signal:t,credentials:"same-origin",...i?{referrer:i}:{}}),r=(E,S,B,L,A=0)=>({type:"loaded",id:e.id,buckets:{},timing:{fetchMs:L,parseMs:A},diag:{status:E,bytes:S,layers:B,built:0}});if(!o.ok){if(o.status===404||o.status===204)return r(o.status,0,[],performance.now()-n);throw new Error(`HTTP ${o.status} \\u0434\\u043B\\u044F ${e.url}`)}let s=await o.arrayBuffer(),u=performance.now()-n;if(s.byteLength===0)return r(o.status,0,[],u);let l=performance.now(),c=new Lt(s),f=Object.keys(c.layers),{buckets:p,seams:m,splits:g,levels:y,failed:w}=Hs(c,e);return{type:"loaded",id:e.id,raw:s,buckets:p,...m.length?{seams:m}:{},...Object.keys(g).length?{splits:g}:{},...y.length?{levels:y}:{},timing:{fetchMs:u,parseMs:performance.now()-l},diag:{status:o.status,bytes:s.byteLength,layers:f,built:Object.keys(p).length,...w.length?{failed:w}:{}}}}function zs(e){return t=>{let n=t.lift,i=typeof n=="number"?n:typeof n=="string"?Number(n):NaN;return Number.isFinite(i)?Math.max(0,i):Math.max(0,Ve(t))*e}}function Xs(e){let t=e.lift,n=typeof t=="number"?t:typeof t=="string"?Number(t):NaN;return!Number.isFinite(n)||n===0?null:()=>n}function Ys(e,t){return n=>{let i=n.width,o=typeof i=="number"?i:typeof i=="string"?Number(i):NaN,r=Number.isFinite(o)&&o>0?o:e??0;return r>0?r+(t??0):null}}function $s(e){return t=>{let n=t.on;if(typeof n!="string"||!n)return 0;let i=0;for(let o of n.split(",")){let r=e[o];typeof r=="number"&&r>i&&(i=r)}return i}}function Ws(e,t,n){let i=t-1,o=t<n?t+1:24;return!(e.maxzoom<i||e.minzoom>o)}function Zs(e,t){return e<=6?Math.max(64,t/24):0}function En(e,t,n,i,o,r,s,u,l){{let c=Cr(l,t.extent);if(e.type==="fill"){let p=i>0?i/t.extent:0,m=e.cornerRadius&&p>0?{radius:e.cornerRadius/p,segments:e.cornerSegments,extent:t.extent,minCutRatio:0,maxChord:Qn/p}:void 0,g=mr(t,e.filter,n,m,e.clipToTile===!0,t.extent,Dt(e.dataPaint,o));return g?{kind:"fill",...g,extent:t.extent}:null}if(e.type==="surface"){let p=Zr(t,t.extent,e.filter,{metersPerUnit:i>0?i/t.extent:0,maxSegment:n,elevation:e.elevation??0,base:e.base,bevel:e.bevel,weld:e.weld,bevelDrop:e.bevelDrop,cornerRadius:e.cornerRadius,cornerSegments:e.cornerSegments,...r&&!e.fromLines&&e.groundField!==!1?{onShapes:m=>br(r,m,e.elevation??0,t.extent)}:{},...e.groundBy?{liftBy:$s(e.groundBy)}:{},...e.fromLines?{widthOf:Ys(e.width,e.widthExtra),widthExtra:e.widthExtra??0}:{},...e.deck?{deck:e.deck}:{},...e.levelHeight&&!e.groundBy?{liftBy:zs(e.levelHeight)}:{},liftAt:c});return p?{kind:"surface",...p}:null}if(e.type==="line"){let p=g=>c(g)??Xs(g),m=Jr(t,e.filter,n,e.ground?r:void 0,i>0?i/t.extent:0,{level:s,paint:Dt(e.dataPaint,o),liftAt:p});return m?{kind:"line",...m,extent:t.extent}:null}if(e.type==="model"){let p=ro(t,e.filter);return p?{kind:"placement",...p,extent:t.extent}:null}if(e.type==="symbol"){let p=no(t,{filter:e.filter,textField:e.textField,iconImage:e.iconImage,iconRotate:e.iconRotate,textPlacement:e.textPlacement,abbreviate:e.abbreviate});return p?{kind:"symbol",...p,extent:t.extent}:null}let f=ar(t,t.extent,e.filter,{metersPerUnit:i>0?i/t.extent:0,cornerRadius:e.cornerRadius,cornerSegments:e.cornerSegments,paint:Dt(e.dataPaint,o)},u);return f?{kind:"fill-extrusion",vertices:f.vertices,indices:f.indices,featureIds:f.featureIds,vertexCount:f.vertexCount,indexCount:f.indexCount,extent:f.extent,...f.dataPaint?{dataPaint:f.dataPaint}:{}}:null}}function Ks(e,t,n){let i=[];for(let o of e.features()){if(!pe(n,o.properties))continue;let r=o.properties[t];typeof r!="string"&&typeof r!="number"||i.includes(r)||i.push(r)}return i.sort((o,r)=>typeof o=="number"&&typeof r=="number"?o-r:String(o).localeCompare(String(r))),i}function Qs(e,t){let n=[];for(let i of e.features()){if(!pe(t,i.properties))continue;let o=Ve(i.properties);n.includes(o)||n.push(o)}return n.sort((i,o)=>i-o)}function Js(e,t,n){let i=["==",t,n];return e?["all",e,i]:i}var qs=e=>e.kind==="symbol",eu=e=>e.kind==="placement";function io(e){let t=[];e.raw&&t.push(e.raw);for(let n of Object.values(e.buckets)){if(eu(n)){t.push(n.anchors);continue}if(qs(n)){t.push(n.anchors,n.priorities),n.lines&&t.push(n.lines),n.lineStarts&&t.push(n.lineStarts);continue}t.push(n.vertices,n.indices),n.featureIds&&t.push(n.featureIds),n.dataPaint&&t.push(n.dataPaint),n.shapeFeatures&&t.push(n.shapeFeatures),n.shapeRanges&&t.push(n.shapeRanges)}return t}var so=Map;var st=new so,Fn=self;Fn.onmessage=e=>{let t=e.data;if(t.type==="abort"){st.get(t.id)?.abort(),st.delete(t.id);return}let n=new AbortController;st.set(t.id,n),oo(t,n.signal).then(i=>{st.has(t.id)&&(st.delete(t.id),Fn.postMessage(i,io(i)))}).catch(i=>{let o=n.signal.aborted;st.delete(t.id);let r={type:"error",id:t.id,message:i instanceof Error?i.message:String(i),aborted:o};Fn.postMessage(r)})};})();\n';var By=2,Qi=class{constructor(e=nl()){this.workers=[];this.blobUrl=null;this.pending=new fe;this.queue=new fe;this.busy=[];this.nextId=1;this.mainThreadAborts=new fe;this.destroyed=false;try{let t=new Blob([rl],{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,this.busy=new Array(this.workers.length).fill(0);}get size(){return this.workers.length}load(e,t,o=0){let r=this.nextId++,i={type:"load",id:r,...e};if(!this.usingWorkers){let a=new AbortController;return this.mainThreadAborts.set(r,a),Yh(i,a.signal).then(s=>{this.mainThreadAborts.has(r)&&(this.mainThreadAborts.delete(r),t(s));}).catch(s=>{let l=a.signal.aborted;this.mainThreadAborts.delete(r),t({type:"error",id:r,message:s instanceof Error?s.message:String(s),aborted:l});}),r}return this.queue.set(r,{message:i,resolve:t,priority:o}),this.pump(),r}pump(){for(;;){if(!this.queue.size)return;let e=-1;for(let r=0;r<this.busy.length;r++)this.busy[r]>=By||(e<0||this.busy[r]<this.busy[e])&&(e=r);if(e<0)return;let t=-1,o=null;for(let[r,i]of this.queue.entries())o&&i.priority>=o.priority||(t=r,o=i);if(!o)return;this.queue.delete(t),this.busy[e]++,this.pending.set(t,{resolve:o.resolve,workerIndex:e}),this.workers[e].postMessage(o.message);}}abort(e){if(!this.usingWorkers){this.mainThreadAborts.get(e)?.abort(),this.mainThreadAborts.delete(e);return}if(this.queue.delete(e))return;let t=this.pending.get(e);if(!t)return;this.pending.delete(e);let o={type:"abort",id:e};this.workers[t.workerIndex].postMessage(o),this.busy[t.workerIndex]--,this.pump();}onMessage(e){if(this.destroyed)return;let t=this.pending.get(e.id);t&&(this.pending.delete(e.id),this.busy[t.workerIndex]--,this.pump(),t.resolve(e));}disposeWorkers(){for(let e of this.workers)e.terminate();this.workers=[],this.blobUrl&&URL.revokeObjectURL(this.blobUrl),this.blobUrl=null;}destroy(){this.destroyed=true;for(let e of this.mainThreadAborts.values())e.abort();this.mainThreadAborts.clear(),this.pending.clear(),this.queue.clear(),this.busy=[],this.disposeWorkers();}};function nl(){let n=typeof navigator<"u"&&navigator.hardwareConcurrency||4;return Math.max(1,Math.min(n-1,6))}function id(n){return Math.max(0,Math.ceil((n*Math.LN2+Math.log(512/360/.5))/Math.LN10))}function il(n,e){let t=id(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 al(n,e){let t=n.replace(/^#/,"");if(!t)return null;if(e){let l=t.split("&").map(c=>c.split("=")).find(([c])=>c===e);if(!l||l.length<2)return null;t=l[1];}let o=t.split("/");if(o.length<3)return null;let r=Number(o[0]),i=Number(o[1]),a=Number(o[2]);if(!isFinite(r)||!isFinite(i)||!isFinite(a)||Math.abs(i)>90||Math.abs(a)>180)return null;let s={center:{lng:a,lat:i},zoom:r};return o.length>3&&isFinite(Number(o[3]))&&(s.bearing=Number(o[3])),o.length>4&&isFinite(Number(o[4]))&&(s.pitch=Number(o[4])),s}function ad(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());}function My(n,e,t,o){if(n.length<2)return [];let r=-o,i=-o,a=e+o,s=t+o,l=h=>h.x>=r&&h.x<=a&&h.y>=i&&h.y<=s,c=[],f=[],u=()=>{f.length>=2&&c.push(f),f=[];};for(let h=0;h+1<n.length;h++){let d=n[h],m=n[h+1],p=l(d),b=l(m);if(p&&b){f.length||f.push(d),f.push(m);continue}let g=_y(d,m,r,i,a,s);if(!g){u();continue}f.length||f.push(g[0]),f.push(g[1]),b||u();}return u(),c}function _y(n,e,t,o,r,i){let a=e.x-n.x,s=e.y-n.y,l=0,c=1,f=[[-a,n.x-t],[a,r-n.x],[-s,n.y-o],[s,i-n.y]];for(let[u,h]of f){if(u===0){if(h<0)return null;continue}let d=h/u;if(u<0){if(d>c)return null;d>l&&(l=d);}else {if(d<l)return null;d<c&&(c=d);}}return [{x:n.x+a*l,y:n.y+s*l},{x:n.x+a*c,y:n.y+s*c}]}var Ey=64,Qt=n=>`<svg viewBox="0 0 64 64" width="64" height="64" xmlns="http://www.w3.org/2000/svg">${n}</svg>`,$i=n=>Qt('<circle cx="32" cy="32" r="30" fill="#ffffff"/><circle cx="32" cy="32" r="26" fill="none" stroke="#c8102e" stroke-width="8"/>'+n),sl=n=>Qt('<circle cx="32" cy="32" r="30" fill="#0053a0"/>'+n),wn=n=>Qt('<path d="M32 4 61 56H3z" fill="#ffffff" stroke="#c8102e" stroke-width="7" stroke-linejoin="round"/>'+n),ll=(n,e="#0053a0")=>Qt(`<rect x="3" y="3" width="58" height="58" rx="6" fill="${e}"/>`+n),Sy={"sign-stop":Qt('<path d="M20.7 2h22.6L59 17.7v22.6L43.3 56H20.7L5 40.3V17.7z" fill="#c8102e"/><path d="M20.7 2h22.6L59 17.7v22.6L43.3 56H20.7L5 40.3V17.7z" fill="none" stroke="#ffffff" stroke-width="3"/><text x="32" y="36" font-family="Arial, Helvetica, sans-serif" font-size="17" font-weight="700" fill="#ffffff" text-anchor="middle">STOP</text>'),"sign-give-way":Qt('<path d="M32 58 3 6h58z" fill="#ffffff" stroke="#c8102e" stroke-width="7" stroke-linejoin="round"/>'),"sign-priority":Qt('<path d="M32 3 61 32 32 61 3 32z" fill="#ffffff"/><path d="M32 13 51 32 32 51 13 32z" fill="#ffd400"/>'),"sign-no-entry":Qt('<circle cx="32" cy="32" r="30" fill="#c8102e"/><rect x="11" y="27" width="42" height="10" rx="2" fill="#ffffff"/>'),"sign-no-traffic":$i('<line x1="14" y1="50" x2="50" y2="14" stroke="#c8102e" stroke-width="8" stroke-linecap="round"/>'),"sign-speed-40":$i('<text x="32" y="41" font-family="Arial, Helvetica, sans-serif" font-size="26" font-weight="700" fill="#1a1a1a" text-anchor="middle">40</text>'),"sign-speed-60":$i('<text x="32" y="41" font-family="Arial, Helvetica, sans-serif" font-size="26" font-weight="700" fill="#1a1a1a" text-anchor="middle">60</text>'),"sign-no-parking":Qt('<circle cx="32" cy="32" r="30" fill="#0053a0"/><circle cx="32" cy="32" r="26" fill="none" stroke="#c8102e" stroke-width="7"/><line x1="14" y1="50" x2="50" y2="14" stroke="#c8102e" stroke-width="7" stroke-linecap="round"/>'),"sign-roundabout":sl('<g fill="none" stroke="#ffffff" stroke-width="5" stroke-linecap="round"><path d="M32 16a16 16 0 1 1-13.9 8"/></g><path d="M14 18l8 8-11 2z" fill="#ffffff"/>'),"sign-straight":sl('<path d="M32 12 46 30h-8v22h-12V30h-8z" fill="#ffffff"/>'),"sign-keep-right":sl('<path d="M44 20v18H30v10l-14-14 14-14v10h6V20z" fill="#ffffff" transform="rotate(-45 32 32)"/>'),"sign-crossing":ll('<path d="M32 12 54 52H10z" fill="#ffffff"/><path d="M31 22a3.2 3.2 0 1 0 0-6.4 3.2 3.2 0 0 0 0 6.4z" fill="#1a1a1a"/><path d="M29 24h4l4 9-3 1-2-4v6l4 8h-4l-3-6-3 6h-4l5-10v-8l-3 5-3-1z" fill="#1a1a1a"/>'),"sign-parking":ll('<text x="32" y="45" font-family="Arial, Helvetica, sans-serif" font-size="38" font-weight="700" fill="#ffffff" text-anchor="middle">P</text>'),"sign-living-street":ll('<path d="M14 34 32 20l18 14v2H14z" fill="#ffffff"/><rect x="19" y="36" width="26" height="10" rx="3" fill="#ffffff"/><circle cx="25" cy="47" r="3" fill="#ffffff"/><circle cx="39" cy="47" r="3" fill="#ffffff"/>'),"sign-traffic-signals":wn('<rect x="26" y="22" width="12" height="28" rx="4" fill="#1a1a1a"/><circle cx="32" cy="28" r="3.4" fill="#e03131"/><circle cx="32" cy="36" r="3.4" fill="#f2c14b"/><circle cx="32" cy="44" r="3.4" fill="#37b24d"/>'),"sign-crossing-ahead":wn('<path d="M31 27a3 3 0 1 0 0-6 3 3 0 0 0 0 6z" fill="#1a1a1a"/><path d="M29 29h4l4 8-2.6 1.2L32 34v5l4 9h-4l-3-6-3 6h-4l5-10v-7l-2.6 4.6L22 34z" fill="#1a1a1a"/>'),"sign-level-crossing":wn('<path d="M20 44 44 24M20 24l24 20" stroke="#1a1a1a" stroke-width="5" stroke-linecap="round"/>'),"sign-hump":wn('<path d="M18 44c0-9 6-14 14-14s14 5 14 14z" fill="#1a1a1a"/>'),"sign-roadworks":wn('<path d="M28 20h8v6h-8z" fill="#1a1a1a"/><path d="M24 30h16l4 18H20z" fill="#1a1a1a"/>')};function Fy(n){let e=String(Math.round(n)),t=e.length>2?21:26;return $i(`<text x="32" y="41" font-family="Arial, Helvetica, sans-serif" font-size="${t}" font-weight="700" fill="#1a1a1a" text-anchor="middle">${e}</text>`)}function cl(n,e={}){let t=e.length??4.5,o=e.shaft??.45,r=e.head??1.6,i=e.headLength??1.4,a=e.branch??1.5,s=o/2,l=t/2,c=-t/2,f=l-i,u=()=>[c,-s,f,-s,f,-r/2,l,0,f,r/2,f,s,c,s,c,-s],h=(d,m)=>{let p=a,b=0,g=8,y=[m,-d*s];for(let A=0;A<=g;A++){let x=-Math.PI/2+Math.PI/2*(A/g);y.push(b+Math.cos(x)*(p+s),d*(p+Math.sin(x)*(p+s)));}y.push(b+p+r/2,d*p),y.push(b+p,d*(p+i)),y.push(b+p-r/2,d*p);for(let A=g;A>=0;A--){let x=-Math.PI/2+Math.PI/2*(A/g);y.push(b+Math.cos(x)*(p-s),d*(p+Math.sin(x)*(p-s)));}return y.push(m,d*s),y.push(m,-d*s),y};switch(n){case "straight":return [u()];case "left":return [h(-1,c)];case "right":return [h(1,c)];case "straight-left":case "straight-right":{let d=n==="straight-right"?1:-1;return [u(),h(d,c)]}case "u-turn":{let d=a,m=f-d,p=[],b=14;for(let y=0;y<=b;y++){let A=-Math.PI/2+Math.PI*y/b;p.push(m+Math.cos(A)*(d+s),Math.sin(A)*(d+s));}for(let y=b;y>=0;y--){let A=-Math.PI/2+Math.PI*y/b;p.push(m+Math.cos(A)*(d-s),Math.sin(A)*(d-s));}p.push(p[0],p[1]);let g=[m,-d-r/2,m-i,-d,m,-d+r/2,m,-d-r/2];return [ea(c,m,-s,s),p,g]}}}function Iy(n,e=4,t=.4,o=.6){let r=[],i=t+o,a=Math.max(Math.floor((n-t)/i)+1,1),s=(a-1)*i;for(let l=0;l<a;l++){let c=-s/2+l*i;r.push(ea(-e/2,e/2,c-t/2,c+t/2));}return r}function Dy(n,e=.4){return [ea(-e/2,e/2,-n/2,n/2)]}function Ty(n,e=.4,t=2){let o=[],r=n/2;for(let i of [1,-1])for(let a=-n;a<=n;a+=t){let s=ky(ea(-n,n,a-e/2,a+e/2),i*Math.PI/4),l=Ly(s,r);l&&o.push(l);}return o}function ea(n,e,t,o){return [n,t,e,t,e,o,n,o,n,t]}function ky(n,e){let t=Math.cos(e),o=Math.sin(e),r=[];for(let i=0;i+1<n.length;i+=2)r.push(n[i]*t-n[i+1]*o,n[i]*o+n[i+1]*t);return r}function Ly(n,e){let t=n.slice(),o=[[1,0,e],[-1,0,e],[0,1,e],[0,-1,e]];for(let[r,i,a]of o){let s=[],l=t.length/2;for(let c=0;c<l;c++){let f=t[c*2],u=t[c*2+1],h=t[(c+1)%l*2],d=t[(c+1)%l*2+1],m=r*f+i*u-a,p=r*h+i*d-a;if(m<=0&&s.push(f,u),m<=0!=p<=0){let b=m/(m-p);s.push(f+(h-f)*b,u+(d-u)*b);}}if(t=s,t.length<6)return null}return t.push(t[0],t[1]),t}function fl(n,e,t,o,r,i=r){let a=Math.cos(e),s=Math.sin(e),l=[];for(let c=0;c+1<n.length;c+=2){let f=n[c]*a-n[c+1]*s,u=n[c]*s+n[c+1]*a;l.push(t+f*r,o+u*i);}return l}var Eo=.25,Ry=20*Math.PI/180;function Py(n,e={}){let t=[],o=new Map,r=(f,u)=>Math.round(f/Eo)+","+Math.round(u/Eo),i=(f,u)=>{let h=r(f,u),d=o.get(h);if(d!==void 0)return d;let m=t.length;return t.push({x:f,y:u,rays:[],degree:0,crossing:false}),o.set(h,m),m},a=[];n.forEach((f,u)=>{let h=f.pts.length/2;if(h<2){a.push([-1,-1]);return}let d=f.pts[0],m=f.pts[1],p=f.pts[h*2-2],b=f.pts[h*2-1],g=i(d,m),y=i(p,b);a.push([g,y]);let A=f.level??0;t[g].rays.push({axis:u,atTail:false,level:A,width:f.width,cls:f.cls??"",oneway:!!f.oneway,angle:Math.atan2(f.pts[3]-m,f.pts[2]-d)}),t[y].rays.push({axis:u,atTail:true,level:A,width:f.width,cls:f.cls??"",oneway:!!f.oneway,angle:Math.atan2(f.pts[h*2-3]-b,f.pts[h*2-4]-p)});});for(let f of t){f.rays.sort((d,m)=>d.angle-m.angle),f.degree=f.rays.length;let u=new Map;for(let d of f.rays)u.set(d.level,(u.get(d.level)??0)+1);let h=0;for(let d of u.values())h=Math.max(h,d);f.crossing=h>=3;}let s=Uy(Oy(n,a,t),e.ringMax??Gy),l=e.smooth??0,c=e.refine??0;if(l>0||c>0){let f=e.maxSmooth??25;for(let u of s){let h=u.head===u.tail&&u.pts.length>=8,d=h?Xy(u.pts):u.pts;if(c>0){let m=e.densify??0;m>0&&(d=Da(d,m)),d=Po(d,c);}l>0&&(d=Er(d,Math.min(u.width*l,f))),u.pts=h?Jy(d,u.pts):d;}}return {nodes:t,ends:a,chains:s,clearance(f,u){return this.clearanceAt(f,u.angle,u.level,[u.axis])},nodeWidth(f,u){let h=t[f];if(!h)return 0;let d=0;for(let m of h.rays)m.level===u&&m.width>d&&(d=m.width);return d},clearanceAt(f,u,h,d){let m=t[f];if(!m||!m.crossing)return 0;let p=0;for(let b of m.rays){if(d.includes(b.axis)||b.level!==h)continue;let g=Math.abs(Hy(b.angle-u));if(g>Math.PI/2&&(g=Math.PI-g),g<Ry)continue;let y=b.width/2/Math.sin(g);y>p&&(p=y);}return p}}}function Hy(n){let e=n;for(;e<=-Math.PI;)e+=Math.PI*2;for(;e>Math.PI;)e-=Math.PI*2;return e}function Oy(n,e,t){let o=new Array(n.length).fill(false),r=(s,l)=>Math.abs(s.width-l.width)<.01&&(s.level??0)===(l.level??0)&&(s.cls??"")===(l.cls??"")&&!!s.oneway==!!l.oneway,i=(s,l)=>{let c=t[s];if(!c)return null;let f=n[l].level??0;if(c.rays.some(d=>d.level!==f))return null;let u=c.rays.filter(d=>d.level===f);if(u.length!==2)return null;let h=u.find(d=>d.axis!==l);return !h||o[h.axis]?null:r(n[l],n[h.axis])?h:null},a=[];for(let s=0;s<n.length;s++){if(o[s]||n[s].pts.length<4)continue;o[s]=true;let l=n[s].pts.slice(),c=[s],f=e[s][0],u=e[s][1];for(let d=0;d<4096;d++){let m=i(u,c[c.length-1]);if(!m)break;o[m.axis]=true;let p=m.atTail?cd(n[m.axis].pts):n[m.axis].pts;for(let b=2;b<p.length;b+=2)l.push(p[b],p[b+1]);u=m.atTail?e[m.axis][0]:e[m.axis][1],c.push(m.axis);}for(let d=0;d<4096;d++){let m=i(f,c[0]);if(!m)break;o[m.axis]=true;let p=m.atTail?n[m.axis].pts:cd(n[m.axis].pts),b=[];for(let g=0;g+3<p.length;g+=2)b.push(p[g],p[g+1]);l=b.concat(l),f=m.atTail?e[m.axis][0]:e[m.axis][1],c.unshift(m.axis);}let h=n[s];a.push({pts:l,axes:c,head:f,tail:u,width:h.width,level:h.level??0,oneway:!!h.oneway,lanes:h.lanes??0,cls:h.cls??""});}return a}var Gy=400,zy=.88,Wy=12,Ny=400;function Vy(n){let e=0;for(let t=2;t+1<n.length;t+=2)e+=Math.hypot(n[t]-n[t-2],n[t+1]-n[t-1]);return e}function Uy(n,e){if(!(e>0)||n.length<2)return n;let t=new Map,o=new Float64Array(n.length);for(let l=0;l<n.length;l++){let c=n[l];if(o[l]=Vy(c.pts),c.head!==c.tail)for(let f of [c.head,c.tail]){let u=t.get(f);u?u.push(l):t.set(f,[l]);}}let r=new Uint8Array(n.length),i=[];for(let l=0;l<n.length;l++){if(r[l]||n[l].head===n[l].tail||o[l]>e)continue;let c=n[l].head,f=null,u=zy,h=[{node:n[l].tail,path:[l],total:o[l]}],d=0;for(;h.length&&!(d++>Ny);){let m=h.pop();if(!(m.path.length>=Wy))for(let p of t.get(m.node)??[]){if(r[p]||m.path.includes(p))continue;let b=n[p];if(b.level!==n[l].level)continue;let g=m.total+o[p];if(g>e)continue;let y=b.head===m.node?b.tail:b.head,A=[...m.path,p];if(y!==c){h.push({node:y,path:A,total:g});continue}let x=sd(n,A,c);if(!x)continue;let v=Ky(x,g);v>u&&(u=v,f=A);}}if(f){for(let m of f)r[m]=1;i.push(f);}}if(!i.length)return n;let a=[],s=new Uint8Array(n.length);for(let l of i)for(let c of l)s[c]=1;for(let l=0;l<n.length;l++)s[l]||a.push(n[l]);for(let l of i){let c=n[l[0]].head,f=sd(n,l,c);if(!f){for(let h of l)a.push(n[h]);continue}let u=n[l[0]];for(let h of l)n[h].width>u.width&&(u=n[h]);a.push({pts:f,axes:l.flatMap(h=>n[h].axes),width:u.width,level:u.level,oneway:u.oneway,lanes:u.lanes,cls:u.cls,head:c,tail:c});}return a}function sd(n,e,t){let o=[],r=t;for(let a of e){let s=n[a],l=s.head===r;if(!l&&s.tail!==r)return null;let c=s.pts;if(l){for(let f=o.length?2:0;f+1<c.length;f+=2)o.push(c[f],c[f+1]);r=s.tail;}else {for(let f=c.length-(o.length?4:2);f>=0;f-=2)o.push(c[f],c[f+1]);r=s.head;}}if(o.length<8)return null;let i=o.length;return (o[0]!==o[i-2]||o[1]!==o[i-1])&&o.push(o[0],o[1]),o}function Ky(n,e){if(!(e>0))return 0;let t=0;for(let r=0;r+3<n.length;r+=2)t+=n[r]*n[r+3]-n[r+2]*n[r+1];let o=Math.abs(t/2);return 4*Math.PI*o/(e*e)}var ld=40;function Xy(n){let e=n.length/2,t=[],o=[],r=0;for(let a=e-1;a>0&&r<ld;a--)r+=Math.hypot(n[a*2]-n[a*2-2],n[a*2+1]-n[a*2-1]),t.unshift(n[a*2-2],n[a*2-1]);let i=0;for(let a=0;a+1<e&&i<ld;a++)i+=Math.hypot(n[a*2+2]-n[a*2],n[a*2+3]-n[a*2+1]),o.push(n[a*2+2],n[a*2+3]);return [...t,...n,...o]}function Jy(n,e){let t=e.length/2,o=e[0],r=e[1],i=e[t*2-2],a=e[t*2-1],s=(h,d,m,p)=>{let b=m,g=1/0;for(let y=m;y<=p;y++){let A=Math.hypot(n[y*2]-h,n[y*2+1]-d);A<g&&(g=A,b=y);}return b},l=n.length/2,c=s(o,r,0,Math.floor(l/2)),f=s(i,a,Math.floor(l/2),l-1);if(f-c<3)return e;let u=n.slice(c*2,(f+1)*2);return u[u.length-2]=u[0],u[u.length-1]=u[1],u}function cd(n){let e=[];for(let t=n.length-2;t>=0;t-=2)e.push(n[t],n[t+1]);return e}var jy=Math.sin(25*Math.PI/180);function Yy(n,e,t){if(!(e>0))return n;let o=(f,u)=>Math.round(f/Eo)+","+Math.round(u/Eo),r=new Map;for(let f of n){let u=f.pts.length/2;if(!(u<2))for(let[h,d]of [[f.pts[0],f.pts[1]],[f.pts[u*2-2],f.pts[u*2-1]]]){let m=o(h,d);r.set(m,(r.get(m)??0)+1);}}let i=Math.max(e*4,20),a=new Map;n.forEach((f,u)=>{for(let h=0;h+3<f.pts.length;h+=2){let d=Math.floor(Math.min(f.pts[h],f.pts[h+2])/i),m=Math.floor(Math.max(f.pts[h],f.pts[h+2])/i),p=Math.floor(Math.min(f.pts[h+1],f.pts[h+3])/i),b=Math.floor(Math.max(f.pts[h+1],f.pts[h+3])/i);for(let g=d;g<=m;g++)for(let y=p;y<=b;y++){let A=g+","+y,x=a.get(A);x||a.set(A,x=[]),x.push(u,h>>1);}}});let s=n.map(f=>f.pts.slice()),l=new Map;n.forEach((f,u)=>{let h=f.pts.length/2;if(!(h<2))for(let d of [true,false]){let m=d?f.pts[0]:f.pts[h*2-2],p=d?f.pts[1]:f.pts[h*2-1];if((r.get(o(m,p))??0)>1)continue;let b=a.get(Math.floor(m/i)+","+Math.floor(p/i));if(!b)continue;let g=d?f.pts[2]:f.pts[h*2-4],y=d?f.pts[3]:f.pts[h*2-3],A=Math.hypot(m-g,p-y)||1,x=(m-g)/A,v=(p-y)/A,w=1/0,C=-1,B=0,_=0,T=0,k=0;for(let z=0;z<b.length;z+=2){let L=b[z],X=b[z+1];if(L===u||(n[L].level??0)!==(f.level??0))continue;let Q=n[L].pts,G=Q[X*2],Y=Q[X*2+1],ie=Q[X*2+2]-G,ee=Q[X*2+3]-Y,ue=ie*ie+ee*ee;if(ue<1e-12||Math.abs(x*ee-v*ie)/Math.sqrt(ue)<jy)continue;let $=Math.max(0,Math.min(1,((m-G)*ie+(p-Y)*ee)/ue)),Ae=Math.hypot(G+ie*$-m,Y+ee*$-p);Ae<w&&(w=Ae,C=L,B=X,_=$,T=G+ie*$,k=Y+ee*$);}if(C<0||w>e||t&&!t(u,d,C,T,k))continue;let K=n[C].pts.length/2,P=B===0&&_<1e-6,W=B===K-2&&_>1-1e-6;if(!P&&!W){let z=l.get(C);z||l.set(C,z=[]),z.push({seg:B,t:_,x:T,y:k});}d?(s[u][0]=T,s[u][1]=k):(s[u][h*2-2]=T,s[u][h*2-1]=k);}});let c=[];return n.forEach((f,u)=>{let h=l.get(u);if(!h){c.push({...f,pts:s[u]});return}h.sort((b,g)=>b.seg-g.seg||b.t-g.t);let d=s[u],m=[d[0],d[1]],p=0;for(let b=0;b+3<d.length;b+=2){let g=b>>1;for(;p<h.length&&h[p].seg===g;){let{x:y,y:A}=h[p++],x=m[m.length-2],v=m[m.length-1];Math.hypot(y-x,A-v)>1e-6&&m.push(y,A),m.length>=4&&c.push({...f,pts:m}),m=[y,A];}m.push(d[b+2],d[b+3]);}m.length>=4&&c.push({...f,pts:m});}),c}function Zy(n,e,t=1.5){if(!(e>0))return n;let o=(a,s)=>Math.round(a/Eo)+","+Math.round(s/Eo),r=n.map(a=>({...a,pts:a.pts.slice()})),i=new Map;return r.forEach((a,s)=>{let l=a.pts.length/2;if(!(l<2))for(let c of [0,l-1]){let f=o(a.pts[2*c],a.pts[2*c+1]),u=i.get(f);u||i.set(f,u=[]),u.push([s,c]);}}),r.forEach((a,s)=>{let l=a.pts,c=l.length/2;if(c<6||Math.hypot(l[0]-l[2*c-2],l[1]-l[2*c-1])>Eo)return;let f=0,u=0,h=0,d=0;for(let he=0;he+1<c;he++)f+=Math.hypot(l[2*he+2]-l[2*he],l[2*he+3]-l[2*he+1]),u+=l[2*he]*l[2*he+3]-l[2*he+2]*l[2*he+1],h+=l[2*he],d+=l[2*he+1];if(u/=2,f>e||4*Math.PI*Math.abs(u)/(f*f)<qy)return;h/=c-1,d/=c-1;let m=0,p=0,b=0,g=0,y=0,A=0,x=0,v=0,w=0;for(let he=0;he+1<c;he++){let xe=l[2*he]-h,de=l[2*he+1]-d;m+=xe*xe,p+=de*de,b+=xe*de,g+=xe,y+=de,A+=xe*xe*xe,x+=de*de*de,v+=xe*de*de,w+=de*xe*xe;}let C=m*p-b*b;if(Math.abs(C)<1e-9)return;let B=(A+v)/2,_=(x+w)/2,T=(B*p-_*b)/C,k=(_*m-B*b)/C,K=h+T,P=d+k,W=c-1,z=Math.sqrt(T*T+k*k+(m+p)/W-2*(T*g+k*y)/W);if(!(z>1))return;let L=0;for(let he=0;he+1<c;he++)L=Math.max(L,Math.abs(Math.hypot(l[2*he]-K,l[2*he+1]-P)-z)/z);if(L>Qy)return;let X=u>0,Q=Math.atan2(l[1]-P,l[0]-K),G=he=>{let xe=X?he-Q:Q-he;for(;xe<0;)xe+=Math.PI*2;for(;xe>=Math.PI*2;)xe-=Math.PI*2;return xe},Y=[];for(let he=1;he+1<c;he++){let xe=(i.get(o(l[2*he],l[2*he+1]))??[]).filter(([de])=>de!==s);xe.length&&Y.push({t:G(Math.atan2(l[2*he+1]-P,l[2*he]-K)),moves:xe});}let ie=(i.get(o(l[0],l[1]))??[]).filter(([he])=>he!==s),ee=Math.max(24,Math.ceil(Math.PI*2*z/t)),ue=[];for(let he=0;he<ee;he++)ue.push(he/ee*Math.PI*2);for(let he of Y)ue.push(he.t);ue.sort((he,xe)=>he-xe);let $=he=>{let xe=X?Q+he:Q-he;return [K+z*Math.cos(xe),P+z*Math.sin(xe)]},Ae=[];for(let he of ue){let xe=Ae.length?[Ae[Ae.length-2],Ae[Ae.length-1]]:null,[de,we]=$(he);xe&&Math.hypot(de-xe[0],we-xe[1])<.05||Ae.push(de,we);}Ae.push(Ae[0],Ae[1]),r[s].pts=Ae;let ve=(he,xe,de)=>{for(let[we,I]of he)r[we].pts[2*I]=xe,r[we].pts[2*I+1]=de;};for(let he of Y)ve(he.moves,...$(he.t));ve(ie,Ae[0],Ae[1]);}),r}var qy=.85,Qy=.15;var $y={edgeInset:.2,centreGap:.22,minWidth:6,skipClasses:["service","track"],crossingClasses:["motorway","trunk","primary","secondary"],setback:1,minPiece:6,zebraDepth:4,zebraStep:1.05,zebra:true,keepOut:()=>false,crossingAt:()=>null,throughStop:true,axes:[],maxGrow:1.6,taper:12};function e2(n,e={}){let t={...$y,...e},o=[];for(let r=0;r<n.chains.length;r++){let i=n.chains[r];if(i.width<t.minWidth||t.skipClasses.includes(i.cls)||i.level<0)continue;let a=i.pts.length/2,s=Math.atan2(i.pts[3]-i.pts[1],i.pts[2]-i.pts[0]),l=Math.atan2(i.pts[a*2-3]-i.pts[a*2-1],i.pts[a*2-4]-i.pts[a*2-2]),c=n.clearanceAt(i.head,s,i.level,i.axes),f=n.clearanceAt(i.tail,l,i.level,i.axes),u=t.axes[r],h=u&&u.length>=4?u:i.pts,d=i2(h,c>0?c+t.setback:0,f>0?f+t.setback:0),m=n2(d,(P,W)=>t.keepOut(P,W,i),t.setback);if(m.length<4||vn(m)<t.minPiece)continue;let p=P=>{let W=P<0?0:m.length-2,z=P<0?0:d.length-2;return Math.hypot(m[W]-d[z],m[W+1]-d[z+1])<.5},b=P=>{let W=n.nodeWidth(P,i.level),L=n.nodes[P]&&!n.nodes[P].crossing&&n.nodes[P].degree===2?W:Math.min(W,i.width*t.maxGrow);return Math.max(L/2-i.width/2,0)},g=b(i.head),y=b(i.tail),A=vn(h),x=P=>Math.min(Math.max(t.taper,P*r2),A/2),v=x(g),w=x(y),C=c>0?c+t.setback:0,B=P=>{let W=C+P,z=0;return g>0&&W<v&&(z=g*(1-W/v)),y>0&&A-W<w&&(z=Math.max(z,y*(1-(A-W)/w))),i.width/2+z},_=(P,W)=>{P.length>=4&&o.push({kind:W,pts:P,cls:i.cls,level:i.level,chain:r});};if(_(ul(m,P=>-(B(P)-t.edgeInset)),"edge"),_(ul(m,P=>B(P)-t.edgeInset),"edge"),i.oneway||(_(hl(m,-t.centreGap),"centre"),_(hl(m,t.centreGap),"centre")),i.lanes>=2){let P=i.width/i.lanes;for(let W=1;W<i.lanes;W++){let z=-i.width/2+W*P;if(!i.oneway&&Math.abs(z)<P/2)continue;let L=z/(i.width/2);_(ul(m,X=>L*B(X)),"lane");}}let T=(P,W)=>{let z=n.nodes[P];if(!z)return false;for(let L of z.rays){if(i.axes.includes(L.axis)||L.level!==i.level)continue;let X=Math.abs(md(L.angle-W));if(X>Math.PI/2&&(X=Math.PI-X),X>=t2)return true}return false},k=(P,W)=>{let z=n.nodes[P];if(!z)return false;let L=z.rays.filter(Y=>!i.axes.includes(Y.axis)&&Y.level===i.level);if(L.length!==2)return false;let X=dd(i.cls),[Q,G]=L.map(Y=>dd(Y.cls));return X>Q&&X>G?false:Q>X||G>X?Q>X&&G<=X||G>X&&Q<=X:L.some(Y=>Math.abs(md(Y.angle-W))>Math.PI-o2)},K=(P,W)=>t.throughStop||!k(P,W);if(t.crossingClasses.includes(i.cls)){let P=(z,L)=>{let X=t.crossingAt(i,r,z);return X===null?null:X-L},W=f>0?f+t.setback:0;c>0&&p(-1)&&T(i.head,s)&&o.push(...fd(m,i,r,t,-1,P(i.head,C),K(i.head,s))),f>0&&p(1)&&T(i.tail,l)&&o.push(...fd(m,i,r,t,1,P(i.tail,W),K(i.tail,l)));}}return o}function fd(n,e,t,o,r,i,a=true){let s=[],l=e.width/2-o.edgeInset,c=(b,g)=>{s.push({kind:g,pts:b,cls:e.cls,level:e.level,chain:t});},f=o.zebraDepth/2+.6,u=i===null?f:i,h=u+o.zebraDepth/2+2.4;if((u<0||vn(n)<h+2)&&(u=f,h=u+o.zebraDepth/2+2.4,vn(n)<h+2))return s;if(a){let b=ud(n,h,r);c([...ta(b,e.oneway?-l:o.centreGap+.1,0),...ta(b,l,0)],"stop");}if(!o.zebra)return s;let d=ud(n,u,r),m=Math.max(Math.floor((e.width-.6)/o.zebraStep),2),p=(m-1)*o.zebraStep;for(let b=0;b<m;b++){let g=-p/2+b*o.zebraStep;c([...ta(d,g,-o.zebraDepth/2),...ta(d,g,o.zebraDepth/2)],"zebra");}return s}function ud(n,e,t){let o=t>0?Cn(n):n,r=e,i=0;for(;i+3<o.length;i+=2){let h=Math.hypot(o[i+2]-o[i],o[i+3]-o[i+1]);if(h>r)break;r-=h;}let a=o[i],s=o[i+1],l=o[i+2]??a,c=o[i+3]??s,f=Math.hypot(l-a,c-s)||1,u=Math.min(r/f,1);return {x:a+(l-a)*u,y:s+(c-s)*u,dx:-(l-a)/f,dy:-(c-s)/f}}function ta(n,e,t){return [n.x+n.dy*e+n.dx*t,n.y-n.dx*e+n.dy*t]}var t2=35*Math.PI/180,hd=["motorway","trunk","primary","secondary","tertiary","unclassified","residential","living_street","service"],dd=n=>{let e=hd.indexOf(n);return e<0?hd.length:e},o2=30*Math.PI/180,r2=15;function ul(n,e){let t=n.length/2;if(t<2)return [];let o=[0];for(let i=1;i<t;i++)o.push(o[i-1]+Math.hypot(n[i*2]-n[i*2-2],n[i*2+1]-n[i*2-1]));let r=[];for(let i=0;i<t;i++){let a=hl(n.slice(Math.max(0,i-1)*2,Math.min(t,i+2)*2),e(o[i])),s=i===0?0:1;r.push(a[s*2],a[s*2+1]);}return r}function hl(n,e){let t=n.length/2,o=[];for(let r=0;r<t;r++){let i=n[Math.max(r-1,0)*2],a=n[Math.max(r-1,0)*2+1],s=n[r*2],l=n[r*2+1],c=n[Math.min(r+1,t-1)*2],f=n[Math.min(r+1,t-1)*2+1],u=Math.hypot(s-i,l-a),h=Math.hypot(c-s,f-l),d=u>0?(s-i)/u:(c-s)/(h||1),m=u>0?(l-a)/u:(f-l)/(h||1),p=h>0?(c-s)/h:d,b=h>0?(f-l)/h:m,g=d+p,y=m+b,A=Math.hypot(g,y);A<1e-6?(g=d,y=m):(g/=A,y/=A);let x=Math.max(g*d+y*m,.2),v=e/x;o.push(s+y*v,l-g*v);}return o}function n2(n,e,t){if(n.length<4)return n;let o=.5,r=i=>{if(i.length<4||!e(i[0],i[1]))return i;let a=vn(i),s=0,l=0,c=0,f=Math.hypot(i[2]-i[0],i[3]-i[1]);for(;s<a;){for(s+=o;s>c+f&&l+5<i.length;)c+=f,l+=2,f=Math.hypot(i[l+2]-i[l],i[l+3]-i[l+1]);let u=f>0?Math.min((s-c)/f,1):0,h=i[l]+(i[l+2]-i[l])*u,d=i[l+1]+(i[l+3]-i[l+1])*u;if(!e(h,d))return dl(i,Math.min(s+t,a))}return []};return Cn(r(Cn(r(n))))}function i2(n,e,t){let o=dl(n,e);return Cn(dl(Cn(o),t))}function dl(n,e){if(e<=0||n.length<4)return n;let t=e;for(let o=0;o+3<n.length;o+=2){let r=Math.hypot(n[o+2]-n[o],n[o+3]-n[o+1]);if(r>t){let i=t/r;return [n[o]+(n[o+2]-n[o])*i,n[o+1]+(n[o+3]-n[o+1])*i,...n.slice(o+2)]}t-=r;}return []}function vn(n){let e=0;for(let t=0;t+3<n.length;t+=2)e+=Math.hypot(n[t+2]-n[t],n[t+3]-n[t+1]);return e}function Cn(n){let e=[];for(let t=n.length-2;t>=0;t-=2)e.push(n[t],n[t+1]);return e}function md(n){let e=n;for(;e<=-Math.PI;)e+=Math.PI*2;for(;e>Math.PI;)e-=Math.PI*2;return e}var a2={classes:["motorway","trunk","primary","secondary","tertiary"],setback:14,length:5,minApproach:25,straightAngle:35*Math.PI/180,maxAngle:150*Math.PI/180,blocked:()=>false,retreat:7};function s2(n,e={}){let t={...a2,...e},o=[];for(let r=0;r<n.chains.length;r++){let i=n.chains[r];if(!t.classes.includes(i.cls)||i.lanes<1||i.level<0||pd(i.pts)<t.minApproach)continue;let a=i.oneway?[{node:i.tail,dir:1}]:[{node:i.tail,dir:1},{node:i.head,dir:-1}];for(let s of a){let l=f2(i.pts,s.dir),c=l2(n,s.node,l,i,t);if(!c.length)continue;let f=n.clearanceAt(s.node,l+Math.PI,i.level,i.axes);if(f<=0)continue;let u=c2(c,i.lanes,i.oneway);if(!u.length)continue;let h=null,d=0;for(let y=0;y<3;y++){d=f+t.setback+y*t.retreat;let A=u2(i.pts,d,s.dir);if(!A)break;if(!t.blocked(A.x,A.y)){h=A;break}}if(!h)continue;let m=s.dir===1?Math.max(0,pd(i.pts)-d):d,b=(i.oneway?i.width:i.width/2)/u.length,g=i.oneway?-i.width/2:0;u.forEach((y,A)=>{let x=g+b*(A+.5),v=h.x+h.nx*x,w=h.y+h.ny*x;for(let C of cl(y,{length:t.length}))o.push({kind:y,pts:fl(C,h.angle,v,w,1,1),cls:i.cls,level:i.level,chain:r,at:m});});}}return o}function l2(n,e,t,o,r){let i=n.nodes[e];if(!i||!i.crossing)return [];let a=new Set;for(let l of i.rays){if(o.axes.includes(l.axis)||l.level!==o.level||l.oneway&&l.atTail)continue;let c=h2(l.angle-t),f=Math.abs(c);f>r.maxAngle||(f<=r.straightAngle?a.add("straight"):c>0?a.add("left"):a.add("right"));}return ["left","straight","right"].filter(l=>a.has(l))}function c2(n,e,t){let o=Math.max(t?e:Math.floor(e/2),1);if(o<1)return [];let r=n.includes("left"),i=n.includes("right"),a=n.includes("straight");if(o===1)return a&&i?["straight-right"]:a&&r?["straight-left"]:r&&i?["straight-left"]:r?["left"]:i?["right"]:["straight"];let s=new Array(o).fill("straight");if(r&&(s[0]=a&&o===2?"straight-left":"left"),i&&(s[o-1]=a&&o===2&&r||a?"straight-right":"right"),!a)for(let l=0;l<o;l++)s[l]==="straight"&&(s[l]=r&&(!i||l<o/2)?"left":"right");return s}function f2(n,e){let t=n.length/2;return e>0?Math.atan2(n[t*2-1]-n[t*2-3],n[t*2-2]-n[t*2-4]):Math.atan2(n[1]-n[3],n[0]-n[2])}function u2(n,e,t){let o=t>0?d2(n):n,r=e,i=0;for(;i+3<o.length;i+=2){let m=Math.hypot(o[i+2]-o[i],o[i+3]-o[i+1]);if(m>r)break;r-=m;}if(i+3>=o.length)return null;let a=o[i],s=o[i+1],l=o[i+2],c=o[i+3],f=Math.hypot(l-a,c-s)||1,u=Math.min(r/f,1),h=-(l-a)/f,d=-(c-s)/f;return {x:a+(l-a)*u,y:s+(c-s)*u,angle:Math.atan2(d,h),nx:d,ny:-h}}function h2(n){let e=n;for(;e<=-Math.PI;)e+=Math.PI*2;for(;e>Math.PI;)e-=Math.PI*2;return e}function pd(n){let e=0;for(let t=0;t+3<n.length;t+=2)e+=Math.hypot(n[t+2]-n[t],n[t+3]-n[t+1]);return e}function d2(n){let e=[];for(let t=n.length-2;t>=0;t-=2)e.push(n[t],n[t+1]);return e}function ml(n,e,t=24){let o=n.length/2;if(o<3||!(e>0))return n;let r=n.slice(),i=n.slice(),a=e;for(let s=0;s<t;s++){let l=0,c=r.slice();for(let f=1;f<o-1;f++){let u=r[f*2-2],h=r[f*2-1],d=r[f*2],m=r[f*2+1],p=r[f*2+2],b=r[f*2+3],g=Math.hypot(d-u,m-h),y=Math.hypot(p-d,b-m),A=Math.hypot(p-u,b-h),x=Math.abs((d-u)*(b-h)-(m-h)*(p-u));if(x<1e-9||g<1e-9||y<1e-9)continue;let v=g*y*A/(2*x);if(v>=e)continue;l=Math.max(l,e-v);let w=Math.min(.5,1-v/e),C=(u+p)/2,B=(h+b)/2,_=d+(C-d)*w,T=m+(B-m)*w,k=_-i[f*2],K=T-i[f*2+1],P=Math.hypot(k,K);P>a&&(_=i[f*2]+k/P*a,T=i[f*2+1]+K/P*a),c[f*2]=_,c[f*2+1]=T;}if(r.splice(0,r.length,...c),l<e*.01)break}return r}function gd(n,e,t=30,o=1/0){let r=n.length/2;if(r<3||!(e>0))return n;let i=n.slice(),a=n.slice();for(let s=0;s<t;s++){let l=0,c=i.slice();for(let f=1;f<r-1;f++){let u=i[f*2-2],h=i[f*2-1],d=i[f*2],m=i[f*2+1],p=i[f*2+2],b=i[f*2+3],g=Math.hypot(d-u,m-h),y=Math.hypot(p-d,b-m);if(g<1e-9||y<1e-9)continue;let A=((d-u)*(p-d)+(m-h)*(b-m))/(g*y),x=Math.acos(Math.max(-1,Math.min(1,A)));if(x<=e)continue;l=Math.max(l,x-e);let v=Math.min(.6,(x-e)/Math.PI+.15),w=d+((u+p)/2-d)*v,C=m+((h+b)/2-m)*v,B=w-a[f*2],_=C-a[f*2+1],T=Math.hypot(B,_);T>o&&(w=a[f*2]+B/T*o,C=a[f*2+1]+_/T*o),c[f*2]=w,c[f*2+1]=C;}if(i.splice(0,i.length,...c),l<.01)break}return i}function Bn(n,e,t={}){if(n.length<4||!(e>0))return null;let o=t.safety??1.15,r=t.iterations??40,i=t.maxTurn??Math.PI/6,a=ml(n,e*o,r),s=Er(a,e*1.3,12),l=ml(s,e*o,r),c=gd(l,i,r,e*2),f=c.length/2,u=[],h=[],d=new Float64Array(f);for(let p=1;p<f;p++)d[p]=d[p-1]+Math.hypot(c[p*2]-c[p*2-2],c[p*2+1]-c[p*2-1]);let m=t.halfAt;for(let p=0;p<f;p++){let b=c[Math.max(p-1,0)*2],g=c[Math.max(p-1,0)*2+1],y=c[p*2],A=c[p*2+1],x=c[Math.min(p+1,f-1)*2],v=c[Math.min(p+1,f-1)*2+1],w=Math.hypot(y-b,A-g),C=Math.hypot(x-y,v-A),B=w>1e-9?(y-b)/w:(x-y)/Math.max(C,1e-9),_=w>1e-9?(A-g)/w:(v-A)/Math.max(C,1e-9),T=C>1e-9?(x-y)/C:B,k=C>1e-9?(v-A)/C:_,K=B+T,P=_+k,W=Math.hypot(K,P);W<1e-9?(K=B,P=_):(K/=W,P/=W);let z=Math.max(K*B+P*_,.5),L=(m?Math.max(m(d[p]),.01):e)/z;u.push(y-P*L,A+K*L),h.push(y+P*L,A-K*L);}return {left:u,centre:c,right:h}}function pl(n,e){let t=n.length/2-1;if(t<3||!(e>0))return null;let o=[],r=[],i=[];for(let a=0;a<t;a++){let s=(a+t-1)%t,l=(a+1)%t,c=n[s*2],f=n[s*2+1],u=n[a*2],h=n[a*2+1],d=n[l*2],m=n[l*2+1],p=Math.hypot(u-c,h-f),b=Math.hypot(d-u,m-h);if(p<1e-9||b<1e-9)continue;let g=(u-c)/p,y=(h-f)/p,A=(d-u)/b,x=(m-h)/b,v=g+A,w=y+x,C=Math.hypot(v,w);C<1e-9?(v=g,w=y):(v/=C,w/=C);let B=Math.max(v*g+w*y,.5),_=e/B;i.push(u,h),o.push(u-w*_,h+v*_),r.push(u+w*_,h-v*_);}if(i.length<6)return null;for(let a of [o,i,r])a.push(a[0],a[1]);return {left:o,centre:i,right:r}}function bl(n,e,t=8,o=false,r=false){let{left:i,centre:a,right:s}=n,l=[];for(let c=0;c+1<s.length;c+=2)l.push(s[c],s[c+1]);r||bd(l,a[a.length-2],a[a.length-1],s[s.length-2],s[s.length-1],i[i.length-2],i[i.length-1],e,t);for(let c=i.length-2;c>=0;c-=2)l.push(i[c],i[c+1]);return o||bd(l,a[0],a[1],i[0],i[1],s[0],s[1],e,t),l.push(l[0],l[1]),l}function bd(n,e,t,o,r,i,a,s,l){let c=Math.hypot(o-e,r-t),f=Math.hypot(i-e,a-t),u=c>1e-6&&f>1e-6?(c+f)/2:s,h=Math.atan2(r-t,o-e),m=Math.atan2(a-t,i-e)-h;for(;m<=0;)m+=Math.PI*2;let p=Math.max(2,Math.round(m/Math.PI*l));for(let b=1;b<p;b++){let g=h+m*b/p;n.push(e+Math.cos(g)*u,t+Math.sin(g)*u);}}var m2={taper:12,maxGrow:1.6,cornerRadius:6,widthExtra:0,cluster:40,tolerance:.1,trim:false,edges:false,merge:false,mergeClasses:false,apart:()=>false,fillet:0};function p2(n,e={}){let t={...m2,...e},o=[];for(let r=0;r<n.chains.length;r++){let i=n.chains[r],a=i.width+t.widthExtra,s=a/2,l=C=>{let B=n.nodeWidth(C,i.level)+t.widthExtra,T=n.nodes[C]&&!n.nodes[C].crossing&&n.nodes[C].degree===2?B:Math.min(B,a*t.maxGrow);return Math.max(T/2-s,0)},c=l(i.head),f=l(i.tail),u=oa(i.pts),h=C=>Math.min(Math.max(t.taper,C*S2),u/2),d=h(c),m=h(f),p=c>0||f>0?C=>{let B=0;return c>0&&C<d&&(B=c*(1-C/d)),f>0&&u-C<m&&(B=Math.max(B,f*(1-(u-C)/m))),s+B}:void 0,b=i.pts,g=null,y=null;if(t.trim&&t.edges){let C=b.length,B=Math.atan2(b[3]-b[1],b[2]-b[0]),_=Math.atan2(b[C-3]-b[C-1],b[C-4]-b[C-2]);g=xl(n,i.head,B,i,t),y=xl(n,i.tail,_,i,t);}else if(t.trim){let C=b.length/2,B=Math.atan2(b[3]-b[1],b[2]-b[0]),_=Math.atan2(b[C*2-3]-b[C*2-1],b[C*2-4]-b[C*2-2]),T=Bd(n,i.head,B,i),k=Bd(n,i.tail,_,i);if(T>0||k>0){let K=F2(b,T,k);K.length>=4&&oa(K)>2&&(b=K);}}let A=t.edges?b:_2(b,s*.33),x=p?T2(A,[d,u-m]):A,v=i.head===i.tail&&i.pts.length>=8&&B2(i.pts,s);if(t.edges&&v){let C=pl(i.pts,s);if(C){let B=So(C.left),_=So(C.right),T=Math.abs(B)>=Math.abs(_)?C.left:C.right,k=T===C.left?C.right:C.left,K=So(T)<0?yl(T):T,P=So(k)>0?yl(k):k;o.push({kind:"carriageway",chain:r,outer:K,holes:[P],cls:i.cls,level:i.level,width:a,edges:C,head:i.head,tail:i.tail});continue}}if(t.edges&&!v){for(let C of [x]){let B=Bn(C,s,{halfAt:p});if(!B)continue;if(g||y){let k=W=>{let z=W;return g&&(z=Cd(z,g,true)),y&&(z=Cd(z,y,false)),z},K={left:k(B.left),centre:k(B.centre),right:k(B.right)},P=Math.abs(oa(K.left)-oa(K.right));K.left.length>=4&&K.centre.length>=4&&K.right.length>=4&&P<a*4&&(B=K);}let _=p?p(u):s,T=bl(B,Math.max(_,s),8,!!g,!!y);if(wl(T)){for(let k of pi({outer:T,holes:[]}))o.push({kind:"carriageway",chain:r,outer:k.outer,holes:k.holes,cls:i.cls,level:i.level,width:a,edges:B,head:i.head,tail:i.tail});continue}o.push({kind:"carriageway",chain:r,outer:T,holes:[],cls:i.cls,level:i.level,width:a,edges:B,head:i.head,tail:i.tail});}continue}let w=v?[x]:M2(x,Math.PI*.8);for(let C of w){let B=zo(C,{halfWidth:s+Math.max(c,f),halfWidthAt:p,metersPerUnit:1,closed:v});if(!B)continue;let _=B.outer;if(wl(_)){for(let T of pi({outer:B.outer,holes:B.holes}))o.push({kind:"carriageway",chain:r,outer:T.outer,holes:T.holes,cls:i.cls,level:i.level,width:a});continue}o.push({kind:"carriageway",chain:r,outer:_,holes:B.holes,cls:i.cls,level:i.level,width:a});}}for(let r of x2(n,t))o.push(r);for(let r of A2(n,t))o.push(r);return t.merge?b2(o,t):o}function b2(n,e){let t=new Map,o=[];for(let r of n){if(r.level!==0||e.apart(r)){o.push(r);continue}let i=e.mergeClasses?String(r.level):r.level+"|"+r.cls,a=t.get(i);a?a.push(r):t.set(i,[r]);}for(let r of t.values()){if(r.length<2){o.push(...r);continue}let i=Uo(r.map(c=>({outer:c.outer,holes:c.holes}))),a=r[0];for(let c of r)c.width>a.width&&(a=c);let s=[];for(let c of r)c.edges&&c.chain!==void 0&&s.push({chain:c.chain,edges:c.edges});let l=true;for(let c of i){let f=Po(dt(vd(wd(c.outer),e.tolerance),{radius:e.cornerRadius,segments:8,minCutRatio:0}),1);o.push({kind:"carriageway",outer:f,holes:c.holes.filter(u=>Math.abs(So(u))>=E2).map(u=>Po(dt(vd(wd(u),e.tolerance),{radius:e.cornerRadius,segments:8,minCutRatio:0}),1)),cls:a.cls,level:a.level,width:a.width,sourceEdges:l&&s.length?s:void 0}),l=false;}}return o}var yd=.8,g2=35*Math.PI/180,y2=150*Math.PI/180;function A2(n,e){let t=[];if(!(e.fillet>0))return t;let o=new Map;for(let r of n.chains)for(let i of r.axes)o.set(i,r);for(let r=0;r<n.nodes.length;r++){let i=n.nodes[r];if(!i.crossing)continue;let a=new Map;for(let s of i.rays){let l=a.get(s.level);l?l.push(s):a.set(s.level,[s]);}for(let s of a.values()){if(s.length<2)continue;let l=(c,f)=>{let u=c.width+e.widthExtra,h=n.nodeWidth(r,c.level)+e.widthExtra,d=Math.max(Math.min(h,u*e.maxGrow),u)/2;return !(e.taper>0)||f>=e.taper?u/2:u/2+(d-u/2)*(1-f/e.taper)};for(let c=0;c<s.length;c++){let f=s[c],u=s[(c+1)%s.length],h=u.angle-f.angle;for(;h<=0;)h+=Math.PI*2;for(;h>Math.PI*2;)h-=Math.PI*2;if(h<g2||h>y2)continue;let d=xd(i.x,i.y,f,u,l(f,1/0),l(u,1/0),h,e);if(d&&(d=xd(i.x,i.y,f,u,l(f,d.awayA),l(u,d.awayB),h,e)),d){let m=Ad(o.get(f.axis),d.touchA,l(f,d.awayA)),p=Ad(o.get(u.axis),d.touchB,l(u,d.awayB));m&&p&&t.push({...d,nodes:[r]});}}}}return t}function Ad(n,e,t){if(!n)return false;let o=n.pts,r=1/0;for(let i=0;i+3<o.length;i+=2){let a=o[i+2]-o[i],s=o[i+3]-o[i+1],l=a*a+s*s,c=l>0?Math.max(0,Math.min(1,((e[0]-o[i])*a+(e[1]-o[i+1])*s)/l)):0,f=Math.hypot(e[0]-(o[i]+a*c),e[1]-(o[i+1]+s*c));f<r&&(r=f);}return r<=t+.5}function xd(n,e,t,o,r,i,a,s){let l=Math.cos(t.angle),c=Math.sin(t.angle),f=Math.cos(o.angle),u=Math.sin(o.angle),h=n-c*r,d=e+l*r,m=n+u*i,p=e-f*i,b=l*u-c*f;if(Math.abs(b)<1e-6)return null;let g=((m-h)*u-(p-d)*f)/b,y=((m-h)*c-(p-d)*l)/b;if(!(g>0)||!(y>0))return null;let A=h+l*g,x=d+c*g;if(Math.hypot(A-n,x-e)>Math.max(r,i)*2)return null;let v=a/2,w=Math.max(r,i)*1.5,C=Math.min(s.fillet,Math.min(r,i)*1.6,w*Math.tan(v));if(C<1)return null;let B=C/Math.tan(v),_=l+f,T=c+u,k=Math.hypot(_,T);if(k<1e-9)return null;_/=k,T/=k;let K=A+_*C/Math.sin(v),P=x+T*C/Math.sin(v),W=A+l*B,z=x+c*B,L=A+f*B,X=x+u*B,Q=Math.atan2(z-P,W-K),Y=Math.atan2(X-P,L-K)-Q;for(;Y>Math.PI;)Y-=Math.PI*2;for(;Y<-Math.PI;)Y+=Math.PI*2;let ie=r*yd,ee=i*yd,ue=W+c*ie,$=z-l*ie,Ae=L-u*ee,ve=X+f*ee,he=Al(n-c*(r-ie),e+l*(r-ie),l,c,n+u*(i-ee),e-f*(i-ee),f,u);if(!he)return null;let xe=he[0],de=he[1],we=[ue,$,W,z],I=Math.max(3,Math.round(Math.abs(Y)/(8*Math.PI/180)));for(let ce=1;ce<I;ce++){let ae=Q+Y*ce/I;we.push(K+Math.cos(ae)*C,P+Math.sin(ae)*C);}we.push(L,X,Ae,ve,xe,de,ue,$);let J=So(we)<0?yl(we):we,Z=t.width>=o.width?t:o;return {kind:"fillet",outer:J,holes:[],cls:Z.cls,level:Z.level,width:Z.width+s.widthExtra,awayA:Math.hypot(W-n,z-e),awayB:Math.hypot(L-n,X-e),touchA:[W,z],touchB:[L,X]}}function x2(n,e){let t=[],o=new Map;for(let r=0;r<n.nodes.length;r++){let i=n.nodes[r];if(!i.crossing)continue;let a=new Map;for(let s of i.rays)a.set(s.level,(a.get(s.level)??0)+1);for(let[s,l]of a){if(l<3)continue;let c=o.get(s);c?c.push(r):o.set(s,[r]);}}for(let[r,i]of o)for(let a of v2(n,i,r,e.cluster)){let s=C2(n,a,r,e);s&&t.push(s);}return t}var w2=1.5;function v2(n,e,t,o){let r=new Map;for(let l of e)r.set(l,l);let i=l=>{let c=l;for(;r.get(c)!==c;)c=r.get(c);return c},a=(l,c)=>{let f=i(l),u=i(c);f!==u&&r.set(f,u);};for(let l of n.chains){if(!r.has(l.head)||!r.has(l.tail)||l.head===l.tail)continue;let c=n.nodes[l.head],f=n.nodes[l.tail],u=Math.hypot(c.x-f.x,c.y-f.y);u>o||u>(n.nodeWidth(l.head,t)+n.nodeWidth(l.tail,t))/2*w2||a(l.head,l.tail);}let s=new Map;for(let l of e){let c=i(l),f=s.get(c);f?f.push(l):s.set(c,[l]);}return [...s.values()]}function C2(n,e,t,o){let r=new Set(e),i=(y,A)=>{for(let x of n.chains){if(!x.axes.includes(A))continue;let v=x.head===y?x.tail:x.head===y||x.tail===y?x.head:-1;if(v>=0&&r.has(v))return true}return false},a=[],s=0,l=0;for(let y of e){let A=n.nodes[y];s+=A.x,l+=A.y;for(let x of A.rays){if(x.level!==t||e.length>1&&i(y,x.axis))continue;let v={axes:[x.axis],level:t,width:x.width},w=xl(n,y,x.angle,v,o),C=(x.width+o.widthExtra)/2,B=Math.max(n.clearanceAt(y,x.angle,t,[x.axis]),C);if(w){let _=Math.cos(x.angle),T=Math.sin(x.angle);for(let k of [1,-1]){let K=A.x-T*C*k,P=A.y+_*C*k,W=Al(K,P,_,T,w.x,w.y,w.dx,w.dy);if(!W)continue;let z=(W[0]-K)*_+(W[1]-P)*T;z>B&&z<B*2+C&&(B=z);}}a.push({x:A.x,y:A.y,angle:x.angle,half:C,cls:x.cls,width:x.width+o.widthExtra,reach:B});}}if(a.length<3)return null;s/=e.length,l/=e.length,a.sort((y,A)=>Math.atan2(y.y+Math.sin(y.angle)-l,y.x+Math.cos(y.angle)-s)-Math.atan2(A.y+Math.sin(A.angle)-l,A.x+Math.cos(A.angle)-s));let c="",f=0;for(let y of a)y.width>f&&(f=y.width,c=y.cls);let u=[],h=a.length;for(let y=0;y<h;y++){let A=a[y],x=a[(y+1)%h],v=Math.cos(A.angle),w=Math.sin(A.angle),C=Math.cos(x.angle),B=Math.sin(x.angle),_=A.x+v*A.reach,T=A.y+w*A.reach;u.push(_+w*A.half,T-v*A.half),u.push(_-w*A.half,T+v*A.half);let k=A.x-w*A.half,K=A.y+v*A.half,P=x.x+B*x.half,W=x.y-C*x.half,z=Al(k,K,v,w,P,W,C,B);if(z){let L=gl(z[0]-s,z[1]-l),X=gl(u[u.length-2]-s,u[u.length-1]-l),Q=gl(x.x+C*x.reach+B*x.half-s,x.y+B*x.reach-C*x.half-l);L>Math.min(X,Q)&&L<=Math.max(X,Q)*1.15&&u.push(z[0],z[1]);}}if(u.length<6)return null;let d=D2(u);if(d.length<6)return null;d.push(d[0],d[1]);let m=1/0;for(let y of a)m=Math.min(m,y.width);let p=Math.min(o.cornerRadius,m/2),b=dt(d,{radius:p,segments:10}),g=b.length>=8?b:d;if(wl(g)){let y=pi({outer:g,holes:[]}),A=null,x=0;for(let v of y){let w=Math.abs(So(v.outer));w>x&&(x=w,A=v);}if(A)return {kind:"junction",outer:A.outer,holes:A.holes,cls:c,level:t,width:f,nodes:e}}return {kind:"junction",outer:g,holes:[],cls:c,level:t,width:f,nodes:e}}function wd(n){let o=Array.from(n);for(let r=0;r<8;r++){let i=o.length/2-1;if(i<4)break;let a=new Array(i).fill(true),s=0;for(let c=0;c<i;c++){if(!a[c])continue;let f=(c+i-1)%i;for(;!a[f]&&f!==c;)f=(f+i-1)%i;let u=(c+1)%i;for(;!a[u]&&u!==c;)u=(u+1)%i;if(f===c||u===c)break;let h=o[f*2],d=o[f*2+1],m=o[c*2],p=o[c*2+1],b=o[u*2],g=o[u*2+1],y=Math.abs((m-h)*(g-d)-(p-d)*(b-h)),A=Math.hypot(b-h,g-d),x=A>1e-9?y/A:Math.hypot(m-h,p-d),v=x<.02,w=A<.6&&x>A*3;(v||w)&&i-s>3&&(a[c]=false,s++);}if(!s)break;let l=[];for(let c=0;c<i;c++)a[c]&&l.push(o[c*2],o[c*2+1]);l.push(l[0],l[1]),o=l;}return o}function vd(n,e){if(!(e>0))return n;let t=Array.from(n);for(let o=0;o<4;o++){let r=t.length/2-1;if(r<8)break;let i=new Array(r).fill(true),a=0;for(let l=0;l<r;l++){if(!i[l])continue;let c=(l+r-1)%r;for(;!i[c]&&c!==l;)c=(c+r-1)%r;let f=(l+1)%r;for(;!i[f]&&f!==l;)f=(f+1)%r;if(c===l||f===l)break;let u=t[c*2],h=t[c*2+1],d=t[l*2],m=t[l*2+1],p=t[f*2],b=t[f*2+1],g=Math.hypot(p-u,b-h);if(g<1e-9)continue;Math.abs((d-u)*(b-h)-(m-h)*(p-u))/g<e&&r-a>8&&(i[l]=false,a++);}if(!a)break;let s=[];for(let l=0;l<r;l++)i[l]&&s.push(t[l*2],t[l*2+1]);s.push(s[0],s[1]),t=s;}return t}function yl(n){let e=[];for(let t=n.length-2;t>=0;t-=2)e.push(n[t],n[t+1]);return e}function B2(n,e){let t=n.length/2;if(t<4)return false;let o=new Float64Array(t);for(let a=1;a<t;a++)o[a]=o[a-1]+Math.hypot(n[a*2]-n[a*2-2],n[a*2+1]-n[a*2-1]);let r=o[t-1],i=e*4;if(r<i*2)return false;for(let a=0;a<t;a++)for(let s=a+1;s<t;s++){let l=o[s]-o[a];if(l<i||r-l<i)continue;if(Math.hypot(n[a*2]-n[s*2],n[a*2+1]-n[s*2+1])<e*2)return false}return true}function So(n){let e=0;for(let t=0;t+3<n.length;t+=2)e+=n[t]*n[t+3]-n[t+2]*n[t+1];return e/2}function M2(n,e){let t=n.length/2;if(t<4)return [n];let o=[],r=0,i=0;for(let a=1;a+1<t;a++){let s=Math.atan2(n[a*2+1]-n[a*2-1],n[a*2]-n[a*2-2]),c=Math.atan2(n[a*2+3]-n[a*2+1],n[a*2+2]-n[a*2])-s;for(;c>Math.PI;)c-=Math.PI*2;for(;c<-Math.PI;)c+=Math.PI*2;i+=Math.abs(c),i>=e&&a-r>=2&&(o.push(n.slice(r*2,(a+1)*2)),r=a,i=0);}return o.length?(t-r>=2&&o.push(n.slice(r*2)),o):[n]}function _2(n,e){let t=n.length/2;if(t<3||!(e>0))return n;let o=[n[0],n[1]];for(let r=1;r<t-1;r++){let i=o[o.length-2],a=o[o.length-1],s=n[r*2],l=n[r*2+1];if(Math.hypot(s-i,l-a)>=e){o.push(s,l);continue}let c=n[r*2+2],f=n[r*2+3],u=c-i,h=f-a,d=Math.hypot(u,h);(d>1e-9?Math.abs((s-i)*h-(l-a)*u)/d:0)>e*.5&&o.push(s,l);}return o.push(n[t*2-2],n[t*2-1]),o}function Al(n,e,t,o,r,i,a,s){let l=t*s-o*a;if(Math.abs(l)<1e-9)return null;let c=((r-n)*s-(i-e)*a)/l;return [n+t*c,e+o*c]}var gl=(n,e)=>Math.hypot(n,e);function _d(n,e,t){for(let o of n.rays){if(t.axes.includes(o.axis)||o.level!==t.level||o.width<t.width*.8)continue;let r=Math.abs(o.angle-e)%(Math.PI*2);if(r>Math.PI&&(r=Math.PI*2-r),r>Math.PI/2&&(r=Math.PI-r),r<Ed)return true}return false}var E2=4,S2=15,Ed=20*Math.PI/180;function xl(n,e,t,o,r){let i=n.nodes[e];if(!i||!i.crossing||_d(i,t,o))return null;let a=0,s=0;for(let b of i.rays){if(o.axes.includes(b.axis)||b.level!==o.level)continue;let g=Math.abs(b.angle-t)%(Math.PI*2);g>Math.PI&&(g=Math.PI*2-g),g>Math.PI/2&&(g=Math.PI-g),!(g<Ed)&&b.width>a&&(a=b.width,s=b.angle);}if(a<o.width*1.05)return null;let l=n.clearanceAt(e,t,o.level,o.axes);if(!(l>0))return null;let c=Math.cos(s),f=Math.sin(s),u=-f,h=c;u*Math.cos(t)+h*Math.sin(t)<0&&(u=-u,h=-h);let d=Math.max((a+r.widthExtra)/2-1,0),m=Math.cos(t)*u+Math.sin(t)*h;return !(m>1e-6)||d/m>l*1.5+2?null:{x:i.x+u*d,y:i.y+h*d,dx:c,dy:f,limit:l+o.width*2}}function Cd(n,e,t){if(n.length<4)return n;let o=t?n:ra(n),r=(s,l)=>(s-e.x)*e.dy-(l-e.y)*e.dx,i=r(o[0],o[1]);if(i<0)return n;let a=0;for(let s=0;s+3<o.length;s+=2){let l=r(o[s+2],o[s+3]);if(i===0||i<0!=l<0){let c=i===l?0:i/(i-l),f=o[s]+(o[s+2]-o[s])*c,u=o[s+1]+(o[s+3]-o[s+1])*c,h=[f,u,...o.slice(s+2)];return h.length<4?n:t?h:ra(h)}if(a+=Math.hypot(o[s+2]-o[s],o[s+3]-o[s+1]),a>e.limit)return n;i=l;}return n}function Bd(n,e,t,o){let r=n.nodes[e];if(!r||!r.crossing||_d(r,t,o))return 0;let i=0;for(let s of r.rays)o.axes.includes(s.axis)||s.level===o.level&&s.width>i&&(i=s.width);if(i<o.width*1.05)return 0;let a=n.clearanceAt(e,t,o.level,o.axes);return Math.max(a-1,0)}function F2(n,e,t){let o=Md(n,e);return ra(Md(ra(o),t))}function Md(n,e){if(e<=0||n.length<4)return n;let t=e;for(let o=0;o+3<n.length;o+=2){let r=Math.hypot(n[o+2]-n[o],n[o+3]-n[o+1]);if(r>t){let i=t/r;return [n[o]+(n[o+2]-n[o])*i,n[o+1]+(n[o+3]-n[o+1])*i,...n.slice(o+2)]}t-=r;}return []}function ra(n){let e=[];for(let t=n.length-2;t>=0;t-=2)e.push(n[t],n[t+1]);return e}function wl(n){let e=n.length/2-1;if(e<4)return false;let t=e>400?Math.ceil(e/400):1;for(let o=0;o<e;o+=t){let r=n[o*2],i=n[o*2+1],a=n[o*2+2],s=n[o*2+3];for(let l=o+2*t;l<e;l+=t)if(!(o===0&&l>=e-t)&&I2(r,i,a,s,n[l*2],n[l*2+1],n[l*2+2],n[l*2+3]))return true}return false}function I2(n,e,t,o,r,i,a,s){let l=(d,m,p,b,g,y)=>{let A=(p-d)*(y-m)-(b-m)*(g-d);return Math.abs(A)<1e-9?0:A},c=l(r,i,a,s,n,e),f=l(r,i,a,s,t,o),u=l(n,e,t,o,r,i),h=l(n,e,t,o,a,s);return (c>0&&f<0||c<0&&f>0)&&(u>0&&h<0||u<0&&h>0)}function D2(n){let e=[];for(let o=0;o+1<n.length;o+=2){let r=e.length;r>=2&&Math.hypot(n[o]-e[r-2],n[o+1]-e[r-1])<.05||e.push(n[o],n[o+1]);}let t=e.length;return t>=4&&Math.hypot(e[0]-e[t-2],e[1]-e[t-1])<.05&&(e.length=t-2),e}function T2(n,e){let t=[...e].filter(a=>a>.01).sort((a,s)=>a-s);if(!t.length)return n;let o=[n[0],n[1]],r=0,i=0;for(let a=0;a+3<n.length;a+=2){let s=n[a],l=n[a+1],c=n[a+2],f=n[a+3],u=Math.hypot(c-s,f-l);for(;i<t.length&&t[i]<=r+.01;)i++;for(;i<t.length&&t[i]<r+u-.01;){let h=(t[i]-r)/u;o.push(s+(c-s)*h,l+(f-l)*h),i++;}r+=u,o.push(c,f);}return o}function oa(n){let e=0;for(let t=0;t+3<n.length;t+=2)e+=Math.hypot(n[t+2]-n[t],n[t+3]-n[t+1]);return e}var k2={levelHeight:8,maxGrade:.06,clearance:0,step:5,alignGap:2,iterations:200},L2=1.5;function Sd(n){return n<=0?0:n>=1?1:n*n*(3-2*n)}function R2(n,e={}){let t={...k2,...e},o=n.chains,r=n.nodes,i=o.map(p=>{let b=0;for(let g=0;g+3<p.pts.length;g+=2)b+=Math.hypot(p.pts[g+2]-p.pts[g],p.pts[g+3]-p.pts[g+1]);return b}),a=new Float64Array(r.length),s=new Float64Array(r.length);for(let p=0;p<o.length;p++){let b=o[p];if(b.level<=0)continue;let g=b.level*t.levelHeight;for(let y of [b.head,b.tail])a[y]<g&&(a[y]=g,s[y]=g);}let l=t.maxGrade/L2,c=r.map(()=>[]);for(let p=0;p<o.length;p++)c[o[p].head].push(p),o[p].tail!==o[p].head&&c[o[p].tail].push(p);let f=[];for(let p=0;p<r.length;p++)a[p]>0&&f.push(p);let u=new Uint8Array(r.length);for(;f.length;){let p=0;for(let g=1;g<f.length;g++)a[f[g]]>a[f[p]]&&(p=g);let b=f[p];if(f[p]=f[f.length-1],f.pop(),!u[b]){u[b]=1;for(let g of c[b]){let y=o[g],A=y.head===b?y.tail:y.head;if(A===b)continue;let x=a[b]-i[g]*l;x>a[A]&&(a[A]=x,s[A]=s[b],u[A]||f.push(A));}}}let h=o.map((p,b)=>{let g=p.level>0?p.level*t.levelHeight:0,y=Math.max(a[p.head],g),A=Math.max(a[p.tail],g),x=Math.max(s[p.head],s[p.tail],y,A,g);return {top:g,head:y,tail:A,peak:x,total:i[b]}}),d=(p,b)=>{let g=h[p];if(!g||g.peak<=0)return 0;let y=Math.max(0,b),A=Math.max(g.top,g.head-y*l,g.tail-Math.max(0,g.total-y)*l,0);return g.peak*Sd(A/g.peak)},m={node:p=>{let b=a[p]??0,g=s[p]||b;return g>0?g*Sd(b/g):0},at:d,length:p=>i[p]??0,flat:p=>{let b=h[p];return !!b&&b.top===0&&b.head<=0&&b.tail<=0},grade:p=>{let b=h[p];if(!b||b.total<=0)return 0;let g=0,y=Math.max(b.total/200,.5);for(let A=0;A+y<=b.total;A+=y)g=Math.max(g,Math.abs(d(p,A+y)-d(p,A))/y);return g}};return t.clearance>0?W2(n,m,t):m}var P2=1,Fd=.2,H2=.04,na=.5,O2=.5,Id=3,G2=.94,z2=12;function W2(n,e,t){let o=n.chains,r=n.nodes,i=o.length,a=o.map((I,J)=>e.length(J)),s=o.map(I=>{let J=new Float64Array(I.pts.length/2);for(let Z=1;Z<J.length;Z++)J[Z]=J[Z-1]+Math.hypot(I.pts[2*Z]-I.pts[2*Z-2],I.pts[2*Z+1]-I.pts[2*Z-1]);return J}),l=new Float64Array(i);for(let I=0;I<i;I++){let J=a[I];for(let Z=0;l[I]=Math.max(l[I],e.at(I,Math.min(Z,J))),!(Z>=J);Z+=t.step);}let c=I=>l[I]>.01||o[I].level!==0,f=Math.max(t.step*10,1),u=new Map,h=(I,J)=>(I+1e6)*2e6+(J+1e6),d=(I,J,Z,ce,ae)=>{let be=Math.floor(Math.min(I,Z)/f),Se=Math.floor(Math.max(I,Z)/f),F=Math.floor(Math.min(J,ce)/f),U=Math.floor(Math.max(J,ce)/f);for(let j=be;j<=Se;j++)for(let R=F;R<=U;R++)ae(h(j,R));},m=(I,J)=>{let Z=o[J].pts;for(let ce=0;ce+3<Z.length;ce+=2)d(Z[ce],Z[ce+1],Z[ce+2],Z[ce+3],ae=>{let be=I.get(ae);be||I.set(ae,be=[]),be.push(J,ce>>1);});};for(let I=0;I<i;I++)c(I)&&m(u,I);let p=[],b=new Set;for(let I=0;I<i;I++){let J=o[I].pts;for(let Z=0;Z+3<J.length;Z+=2){let ce=J[Z],ae=J[Z+1],be=J[Z+2],Se=J[Z+3];d(ce,ae,be,Se,F=>{let U=u.get(F);if(U)for(let j=0;j<U.length;j+=2){let R=U[j];if(R===I||c(I)&&I<R)continue;let H=U[j+1],E=o[R].pts,M=E[2*H],S=E[2*H+1],D=E[2*H+2],O=E[2*H+3],N=D-M,q=O-S,V=be-ce,te=Se-ae,oe=N*te-q*V;if(Math.abs(oe)<1e-12)continue;let ne=((ce-M)*te-(ae-S)*V)/oe,re=((ce-M)*q-(ae-S)*N)/oe;if(ne<0||ne>1||re<0||re>1)continue;let se=s[R][H]+ne*Math.hypot(N,q),me=s[I][Z>>1]+re*Math.hypot(V,te);if(se<na||se>a[R]-na||me<na||me>a[I]-na)continue;let _e=`${R}:${H}:${I}:${Z}`;b.has(_e)||(b.add(_e),p.push({a:R,da:se,b:I,db:me}));}});}}let g=[];for(let I of p){let J=o[I.a].level,Z=o[I.b].level,ce;if(J!==Z)ce=J>Z;else {let ae=e.at(I.a,I.da)-e.at(I.b,I.db);if(Math.abs(ae)<O2)continue;ce=ae>0;}g.push(ce?{up:I.a,dUp:I.da,lo:I.b,dLo:I.db}:{up:I.b,dUp:I.db,lo:I.a,dLo:I.da});}let y=(I,J)=>{let Z=o[I].pts,ce=s[I],ae=0;for(;ae+2<ce.length&&ce[ae+1]<J;)ae++;let be=ce[ae+1]-ce[ae]||1,Se=Math.min(1,Math.max(0,(J-ce[ae])/be)),F=Z[2*ae+2]-Z[2*ae],U=Z[2*ae+3]-Z[2*ae+1],j=Math.hypot(F,U)||1;return [Z[2*ae]+F*Se,Z[2*ae+1]+U*Se,F/j,U/j]},A=(I,J,Z,ce,ae,be,Se)=>{let F=I.get(h(Math.floor(Z/f),Math.floor(ce/f)));if(!F)return null;let U=o[J],j=-1,R=1/0,H=0;for(let E=0;E<F.length;E+=2){let M=F[E];if(M===J||o[M].level!==U.level||!Se(M))continue;let S=F[E+1],D=o[M].pts,O=D[2*S],N=D[2*S+1],q=D[2*S+2]-O,V=D[2*S+3]-N,te=Math.hypot(q,V);if(te<1e-9||Math.abs((q*ae+V*be)/te)<G2)continue;let oe=Math.min(1,Math.max(0,((Z-O)*q+(ce-N)*V)/(te*te))),ne=Math.hypot(O+q*oe-Z,N+V*oe-ce),re=(U.width+o[M].width)/2+t.alignGap;ne>re||ne>=R||(j=M,R=ne,H=s[M][S]+oe*te);}return j<0?null:[j,H]},x=new Uint8Array(i);for(let I=0;I<i;I++)c(I)&&(x[I]=1);for(let I of g)x[I.up]=x[I.lo]=1;for(let I=0;I<i;I++){if(x[I])continue;let J=a[I];for(let Z=0;Z<=J&&!x[I];Z+=t.step){let[ce,ae,be,Se]=y(I,Z),F=A(u,I,ce,ae,be,Se,()=>true);F&&Math.abs(e.at(I,Z)-e.at(F[0],F[1]))<Id&&(x[I]=1);}}let v=o.map(()=>[]);for(let I of g)v[I.up].push(I.dUp),v[I.lo].push(I.dLo);let w=new Int32Array(i).fill(-1),C=new Int32Array(i),B=[];for(let I=0;I<i;I++){if(!x[I])continue;let J=a[I],Z=[],ce=Math.max(1,Math.ceil(J/t.step));for(let ae=0;ae<=ce;ae++){let be=J*ae/ce;ae>0&&ae<ce&&v[I].some(F=>Math.abs(F-be)<t.step*.4)||Z.push(be);}for(let ae of v[I])Z.push(ae);Z.sort((ae,be)=>ae-be),w[I]=B.length;for(let ae of Z)B.length>w[I]&&ae-B[B.length-1]<1e-6||B.push(ae);C[I]=B.length-w[I];}let _=B.length,T={d:Float64Array.from(B),h:new Float64Array(_)},k=new Float64Array(_),K=new Float64Array(_),P=new Float64Array(_),W=new Int32Array(_);for(let I=0;I<i;I++){if(w[I]<0)continue;let J=o[I];for(let Z=w[I];Z<w[I]+C[I];Z++)k[Z]=T.h[Z]=e.at(I,T.d[Z]),K[Z]=J.level>0?Fd:P2,P[Z]=Math.min(0,J.level*t.levelHeight),W[Z]=I;}let z=(I,J)=>{let Z=w[I],ce=w[I]+C[I]-1;for(;Z<ce;){let ae=Z+ce>>1;T.d[ae]<J?Z=ae+1:ce=ae;}return Z>w[I]&&J-T.d[Z-1]<T.d[Z]-J&&Z--,Z},L=r.map(()=>[]),X=new Uint8Array(r.length);for(let I=0;I<i;I++){let J=o[I];if(w[I]<0){X[J.head]=X[J.tail]=1;continue}L[J.head].push(w[I]),L[J.tail].push(w[I]+C[I]-1);}let Q=[];for(let I=0;I<r.length;I++)if(L[I].length&&(Q.push(I),X[I]))for(let J of L[I])K[J]=0;let G=new Uint8Array(_);for(let I of Q)for(let J of L[I])G[J]=1;let Y=g.map(I=>[z(I.up,I.dUp),z(I.lo,I.dLo)]),ie=new Map;for(let I=0;I<i;I++)w[I]>=0&&m(ie,I);let ee=[],ue=[];for(let I=0;I<i;I++)if(!(w[I]<0))for(let J=w[I];J<w[I]+C[I];J++){if(G[J])continue;let[Z,ce,ae,be]=y(I,T.d[J]),Se=A(ie,I,Z,ce,ae,be,j=>j>I);if(!Se)continue;let F=z(Se[0],Se[1]);if(G[F])continue;let U=Math.abs(k[J]-k[F])/Id;U>=1||(ee.push(J,F),ue.push(1-U*U));}let $=T.h,Ae=()=>{for(let[I,J]of Y){let Z=t.clearance-($[I]-$[J]);if(Z<=0)continue;let ce=K[I],ae=K[J];if(ce+ae===0)continue;let be=Z*ae/(ce+ae);$[J]-be<P[J]&&(be=Math.max(0,$[J]-P[J])),$[J]-=be,ce>0&&($[I]+=Z-be);}},ve=()=>{for(let I of Q){let J=L[I];if(J.length<2&&!X[I])continue;if(X[I]){for(let ae of J)$[ae]=k[ae];continue}let Z=0,ce=0;for(let ae of J){let be=1/K[ae];Z+=$[ae]*be,ce+=be;}for(let ae of J)$[ae]=Z/ce;}},he=()=>{for(let I=0;I<i;I++)if(!(w[I]<0))for(let J=w[I];J+1<w[I]+C[I];J++){let Z=t.maxGrade*(T.d[J+1]-T.d[J]),ce=$[J+1]-$[J],ae=Math.abs(ce)-Z;if(ae<=0)continue;let be=K[J],Se=K[J+1];if(be+Se===0)continue;let F=Math.sign(ce);$[J]+=F*ae*be/(be+Se),$[J+1]-=F*ae*Se/(be+Se);}},xe=()=>{for(let I=0;I<ee.length;I+=2){let J=ee[I],Z=ee[I+1],ce=K[J],ae=K[Z];if(ce+ae===0)continue;let be=($[Z]-$[J])*.5*ue[I>>1];$[J]+=be*ce/(ce+ae),$[Z]-=be*ae/(ce+ae);}},de=()=>{for(let I=0;I<_;I++)$[I]<P[I]&&($[I]=P[I]);};for(let I=0;I<t.iterations;I++){if(I<t.iterations*3/4)for(let J=0;J<_;J++)$[J]+=H2*(K[J]===Fd?3:1)*(k[J]-$[J])*(K[J]>0?1:0);xe(),he(),Ae(),ve(),de();}for(let I=0;I<z2;I++){for(let J=0;J<i;J++){if(w[J]<0)continue;let Z=w[J],ce=w[J]+C[J]-1,ae=$[Z];for(let be=Z+1;be<ce;be++){let Se=$[be];K[be]>0&&($[be]=Se+.25*(ae+$[be+1]-2*Se)),ae=Se;}}he(),Ae(),ve(),de();}return {node:I=>{let J=L[I];return J&&J.length?$[J[0]]:e.node(I)},at:(I,J)=>{let Z=w[I];if(Z===void 0||Z<0)return e.at(I,J);let ce=Z+C[I]-1;if(J<=T.d[Z])return $[Z];if(J>=T.d[ce])return $[ce];let ae=Z,be=ce;for(;be-ae>1;){let F=ae+be>>1;T.d[F]<=J?ae=F:be=F;}let Se=T.d[be]-T.d[ae]||1;return $[ae]+($[be]-$[ae])*(J-T.d[ae])/Se},length:I=>a[I]??0,flat:I=>{let J=w[I];if(J===void 0||J<0)return e.flat(I);if(o[I].level>0)return false;for(let Z=J;Z<J+C[I];Z++)if(Math.abs($[Z])>.001)return false;return true},grade:I=>{let J=w[I];if(J===void 0||J<0)return e.grade(I);let Z=0;for(let ce=J;ce+1<J+C[I];ce++){let ae=T.d[ce+1]-T.d[ce];ae>1e-6&&(Z=Math.max(Z,Math.abs($[ce+1]-$[ce])/ae));}return Z}}}var Dd=Pr,sr=Dd.union??Dd.default?.union??null,Io=0,Mn=1,lr=2,_n=3,En=4,zd=5,N2={widthExtra:.9,kerbRadius:8,elevation:.28,deck:1.4,step:2,minCut:.5,kerbWidth:.3,kerbHeight:.15,clusterLink:40,fillGap:1.5,islands:true,outline:false},Td=.6,V2=20,U2=25,K2=60,X2=1,J2=30*Math.PI/180,j2=45*Math.PI/180,kd=1.5,Y2=.5,Ld=.03,Z2=.6,Rd=.25,ia=Math.PI*.94,q2=.5,Pd=4,Hd=800,Q2=.6,$2=2.5,eA=.8;function Od(n){let e=[];for(let u=0;u<n.length;u+=2)e.push([n[u],n[u+1]]);let t=tA(e);if(t){let[u,h,d]=t,m=Math.max(48,Math.ceil(Math.PI*2*d/.3)),p=[];for(let b=0;b<m;b++){let g=Math.PI*2*b/m;p.push(u+d*Math.cos(g),h+d*Math.sin(g));}return p}let o=u=>{if(u.length<3)return u;let[h,d]=u[0],[m,p]=u[u.length-1],b=m-h,g=p-d,y=Math.hypot(b,g)||1,A=0,x=0;for(let C=1;C+1<u.length;C++){let B=Math.abs((u[C][0]-h)*g-(u[C][1]-d)*b)/y;B>A&&(A=B,x=C);}if(A<=Q2)return [u[0],u[u.length-1]];let v=o(u.slice(0,x+1)),w=o(u.slice(x));return [...v.slice(0,-1),...w]},r=0,i=0;for(let u=1;u<e.length;u++){let h=Math.hypot(e[u][0]-e[0][0],e[u][1]-e[0][1]);h>r&&(r=h,i=u);}let a=o(e.slice(0,i+1)),s=o([...e.slice(i),e[0]]);e=[...a.slice(0,-1),...s.slice(0,-1)];for(let u=0;u<4&&e.length>3;u++){let h=[];for(let d=0;d<e.length;d++){let m=e[(d-1+e.length)%e.length],p=e[d],b=e[(d+1)%e.length],g=m[0]-p[0],y=m[1]-p[1],A=b[0]-p[0],x=b[1]-p[1],v=Math.hypot(g,y),w=Math.hypot(A,x);Math.acos(Math.max(-1,Math.min(1,(g*A+y*x)/(v*w||1))))<25*Math.PI/180&&Math.min(v,w)<3&&e.length-(d-h.length)>3||h.push(p);}if(h.length===e.length)break;e=h;}if(e.length<3)return null;let l=0;for(let u=0;u<e.length;u++){let[h,d]=e[u],[m,p]=e[(u+1)%e.length];l+=h*p-m*d;}l<0&&e.reverse();for(let u=0;u<4&&e.length>3;u++){let h=[];for(let d=0;d<e.length;d++){let m=e[d],p=e[(d+1)%e.length];if(Math.hypot(p[0]-m[0],p[1]-m[1])<eA&&e.length-(e.length-h.length-(e.length-d))>3&&d+1<e.length){h.push([(m[0]+p[0])/2,(m[1]+p[1])/2]),d++;continue}h.push(m);}if(h.length===e.length||h.length<3)break;e=h;}let c=[],f=e.length;for(let u=0;u<f;u++){let h=e[(u-1+f)%f],d=e[u],m=e[(u+1)%f],p=Math.hypot(h[0]-d[0],h[1]-d[1]),b=Math.hypot(m[0]-d[0],m[1]-d[1]);if(p<1e-6||b<1e-6)continue;let g=(h[0]-d[0])/p,y=(h[1]-d[1])/p,A=(m[0]-d[0])/b,x=(m[1]-d[1])/b,v=Math.acos(Math.max(-1,Math.min(1,g*A+y*x)));if(v>Math.PI-.05){c.push(d[0],d[1]);continue}let w=Math.tan(v/2),C=Math.min($2/w,.45*p,.45*b),B=C*w,_=g+A,T=y+x,k=Math.hypot(_,T)||1;_/=k,T/=k;let K=d[0]+_*B/Math.sin(v/2),P=d[1]+T*B/Math.sin(v/2),W=d[0]+g*C,z=d[1]+y*C,L=d[0]+A*C,X=d[1]+x*C,Q=Math.atan2(z-P,W-K),G=Math.atan2(X-P,L-K)-Q;for(;G>Math.PI;)G-=Math.PI*2;for(;G<-Math.PI;)G+=Math.PI*2;let Y=Math.max(2,Math.ceil(Math.abs(G)/(Math.PI/16)),Math.ceil(Math.abs(G)*B/.3));for(let ie=0;ie<=Y;ie++){let ee=Q+G*ie/Y;c.push(K+B*Math.cos(ee),P+B*Math.sin(ee));}}return c.length>=6?c:null}function tA(n){let e=n.length;if(e<8)return null;let t=0,o=0,r=0,i=0;for(let v=0;v<e;v++){let[w,C]=n[v],[B,_]=n[(v+1)%e];t+=Math.hypot(B-w,_-C),o+=w*_-B*C,r+=w,i+=C;}if(o=Math.abs(o)/2,4*Math.PI*o/(t*t)<.85)return null;r/=e,i/=e;let a=0,s=0,l=0,c=0,f=0,u=0,h=0;for(let[v,w]of n){let C=v-r,B=w-i;a+=C*C,s+=B*B,l+=C*B,c+=C*C*C,f+=B*B*B,u+=C*B*B,h+=B*C*C;}let d=a*s-l*l;if(Math.abs(d)<1e-9)return null;let m=(c+u)/2,p=(f+h)/2,b=(m*s-p*l)/d,g=(p*a-m*l)/d,y=Math.sqrt(b*b+g*g+(a+s)/e),A=r+b,x=i+g;for(let[v,w]of n)if(Math.abs(Math.hypot(v-A,w-x)-y)>y*.1)return null;return [A,x,y]}function oA(n,e){if(!sr||!n.length)return [];try{return sr(...n)}catch{}let t=l=>Math.round(l*100)/100,o=n.map(l=>l.map(c=>{let f=[];for(let[u,h]of c){let d=[t(u),t(h)],m=f[f.length-1];(!m||m[0]!==d[0]||m[1]!==d[1])&&f.push(d);}return f.length&&(f[0][0]!==f[f.length-1][0]||f[0][1]!==f[f.length-1][1])&&f.push(f[0]),f}).filter(c=>c.length>=4)).filter(l=>l.length>0);try{return sr(...o)}catch{}let r=0,i=(l,c)=>{try{return sr(l,c)}catch{return r++,[...l,...c]}},a=(l,c)=>{if(l.length===1)return l;if(!c)try{return sr(...l)}catch{}let f=l.length>>1;return i(a(l.slice(0,f),false),a(l.slice(f),false))},s=o.length?a(o,true):[];return e(r),s}var Fo=1,Gd=60;function rA(n,e,t={}){let o={...N2,...t},r=n.chains,i=n.nodes,a=[];for(let F=0;F<r.length;F++){if(o.skip?.(F))continue;let U=r[F],j=U.width/2+o.widthExtra,R=U.pts.length/2,H=new Set;for(let D of U.axes)for(let O of n.ends[D]??[])O>=0&&O!==U.head&&O!==U.tail&&i[O].degree>=3&&H.add(O);let E=[];for(let D of H){let O=1/0,N=-1;for(let q=1;q+1<R;q++){let V=Math.hypot(U.pts[2*q]-i[D].x,U.pts[2*q+1]-i[D].y);V<O&&(O=V,N=q);}N>0&&O<.5&&E.push({k:N,node:D});}E.sort((D,O)=>D.k-O.k);let M=new Float64Array(R);for(let D=1;D<R;D++)M[D]=M[D-1]+Math.hypot(U.pts[2*D]-U.pts[2*D-2],U.pts[2*D+1]-U.pts[2*D-1]);let S=[{k:0,node:U.head},...E,{k:R-1,node:U.tail}];for(let D=0;D+1<S.length;D++){let O=S[D],N=S[D+1];if(N.k<=O.k)continue;let q=U.pts.slice(2*O.k,2*N.k+2),V=Bn(q,j);if(!V||V.centre.length<4)continue;let te=V.centre.length/2,oe=new Float64Array(te);for(let re=1;re<te;re++)oe[re]=oe[re-1]+Math.hypot(V.centre[2*re]-V.centre[2*re-2],V.centre[2*re+1]-V.centre[2*re-1]);let ne=oe[te-1];ne<.5||a.push({id:a.length,chain:F,centre:V.centre,left:V.left,right:V.right,along:oe,total:ne,graphTotal:M[N.k]-M[O.k],graphFrom:M[O.k],pts:q,head:O.node,tail:N.node,half:j,cutHead:o.minCut,cutTail:o.minCut,inner:false});}}{let F=new Map;for(let H of a)for(let[E,M]of [[H.head,true],[H.tail,false]]){let S=F.get(E);S||F.set(E,S=[]),S.push({rib:H,atHead:M});}let U=new Map,j=H=>{let E=H.rib.centre,M=E.length/2,S=H.atHead?0:M-1,D=S;for(;D>=0&&D<M&&Math.hypot(E[2*D]-E[2*S],E[2*D+1]-E[2*S+1])<3;)D+=H.atHead?1:-1;D=Math.max(0,Math.min(M-1,D));let O=E[2*D]-E[2*S],N=E[2*D+1]-E[2*S+1],q=Math.hypot(O,N)||1;return {x:E[2*S],y:E[2*S+1],dx:O/q,dy:N/q}};for(let H of F.values())if(!(H.length<2))for(let E of H){let M=j(E);for(let S of H){if(S===E||S.rib===E.rib||S.rib.half>=E.rib.half-.05)continue;let D=j(S);if(-(M.dx*D.dx+M.dy*D.dy)<Math.cos(J2)||H.some(_e=>_e!==E&&_e!==S&&_e.rib.half>S.rib.half+.05&&(()=>{let Ce=j(_e);return -(Ce.dx*D.dx+Ce.dy*D.dy)>-(M.dx*D.dx+M.dy*D.dy)})()))continue;let N=[M.x-M.dy*E.rib.half,M.y+M.dx*E.rib.half],q=[M.x+M.dy*E.rib.half,M.y-M.dx*E.rib.half],V=-D.dy,te=D.dx,oe=Math.max(S.rib.half,(q[0]-D.x)*V+(q[1]-D.y)*te),ne=Math.max(S.rib.half,-((N[0]-D.x)*V+(N[1]-D.y)*te));for(let _e of H){if(_e===S||_e===E)continue;let Ce=j(_e);if(Ce.dx*D.dx+Ce.dy*D.dy<Math.cos(j2))continue;D.dx*Ce.dy-D.dy*Ce.dx>0?oe=S.rib.half:ne=S.rib.half;}let re=Math.max(oe,ne)-S.rib.half;if(re<.05)continue;let se={span:Math.min(K2,Math.max(V2,re*U2)),...oe>S.rib.half+.05?{left:oe}:{},...ne>S.rib.half+.05?{right:ne}:{}},me=U.get(S.rib)??{};S.atHead?me.head=se:me.tail=se,U.set(S.rib,me);}}let R=H=>H>=1?0:H<=0?1:1-H*H*(3-2*H);for(let[H,E]of U){let M=H.total,S=(oe,ne)=>{let re=H.half;if(E.head){let se=ne?E.head.left:E.head.right;se!==void 0&&(re+=(se-H.half)*R(oe/Math.min(E.head.span,M*.8)));}if(E.tail){let se=ne?E.tail.right:E.tail.left;se!==void 0&&(re+=(se-H.half)*R((M-oe)/Math.min(E.tail.span,M*.8)));}return re},D=H.centre,O=[D[0],D[1]],N=[0];for(let oe=0;oe+3<D.length;oe+=2){let ne=D[oe],re=D[oe+1],se=D[oe+2],me=D[oe+3],_e=Math.hypot(se-ne,me-re),Ce=Math.max(1,Math.ceil(_e/X2));for(let Be=1;Be<=Ce;Be++)O.push(ne+(se-ne)*Be/Ce,re+(me-re)*Be/Ce),N.push(H.along[oe>>1]+_e*Be/Ce);}let q=O.length/2;if(q<2)continue;let V=[],te=[];for(let oe=0;oe<q;oe++){let ne=Math.max(0,oe-1),re=Math.min(q-1,oe+1),se=O[2*re]-O[2*ne],me=O[2*re+1]-O[2*ne+1],_e=Math.hypot(se,me)||1;se/=_e,me/=_e;let Ce=S(N[oe],true),Be=S(N[oe],false);V.push(O[2*oe]-me*Ce,O[2*oe+1]+se*Ce),te.push(O[2*oe]+me*Be,O[2*oe+1]-se*Be);}H.centre=O,H.left=V,H.right=te,H.along=Float64Array.from(N),H.total=N[q-1];}}let s=(F,U)=>{let j=F.along,R=0,H=j.length-1;for(;H-R>1;){let V=R+H>>1;j[V]<=U?R=V:H=V;}let E=j[R+1]-j[R]||1,M=Math.min(1,Math.max(0,(U-j[R])/E)),S=(V,te)=>V[2*R+te]+(V[2*R+2+te]-V[2*R+te])*M,D=F.centre[2*R+2]-F.centre[2*R],O=F.centre[2*R+3]-F.centre[2*R+1],N=Math.hypot(D,O)||1,q=e.at(F.chain,F.graphFrom+U/F.total*F.graphTotal);return {d:U,cx:S(F.centre,0),cy:S(F.centre,1),lx:S(F.left,0),ly:S(F.left,1),rx:S(F.right,0),ry:S(F.right,1),tx:D/N,ty:O/N,h:q,z:q+o.elevation}},l=[];for(let F of a)for(let U of [true,false]){let j=Math.min(3,F.total/3),R=s(F,U?0:F.total),H=s(F,U?j:F.total-j),E=H.cx-R.cx,M=H.cy-R.cy,S=Math.hypot(E,M)||1;E/=S,M/=S,l.push({rib:F,atHead:U,node:U?F.head:F.tail,dx:E,dy:M,ox:R.cx,oy:R.cy,order:0});}let c=i.map((F,U)=>U),f=F=>c[F]===F?F:c[F]=f(c[F]),u=new Map,h=()=>{u=new Map;for(let F of l){if(F.rib.inner)continue;let U=f(F.node),j=u.get(U);j||u.set(U,j=[]),j.push(F);}for(let F of u.values()){let U=0,j=0;for(let H of F)U+=H.ox,j+=H.oy;U/=F.length,j/=F.length;let R=0;for(let H of F)R=Math.max(R,Math.hypot(H.ox-U,H.oy-j));R+=20;for(let H of F)H.order=Math.atan2(H.oy+H.dy*R-j,H.ox+H.dx*R-U);F.sort((H,E)=>H.order-E.order);}},d=(F,U)=>{let j=Math.atan2(U.dy,U.dx)-Math.atan2(F.dy,F.dx);for(;j<0;)j+=Math.PI*2;for(;j>=Math.PI*2;)j-=Math.PI*2;return j},m=new Map,p=(F,U)=>`${F.rib.id}${F.atHead?"h":"t"}|${U.rib.id}${U.atHead?"h":"t"}`,b=()=>{m=new Map;for(let R of a)R.cutHead=o.minCut,R.cutTail=o.minCut;let F=(R,H)=>{!(H>0)||H>Gd||(R.atHead?R.rib.cutHead=Math.max(R.rib.cutHead,H):R.rib.cutTail=Math.max(R.rib.cutTail,H));},U=(R,H)=>{let E=R.rib,M=R.atHead===H?E.left:E.right,S=E.along.length,D=[],O=[];for(let N=0;N<S;N++){let q=R.atHead?N:S-1-N,V=R.atHead?E.along[q]:E.total-E.along[q];if(D.push(M[2*q],M[2*q+1]),O.push(V),V>Gd)break}return {xs:D,ds:O}},j=(R,H)=>{let E=U(R,true),M=U(H,false),S=1/0,D=0,O=0,N=0,q=0,V=0,te=0,oe=0,ne=0;for(let me=0;me+1<E.ds.length;me++){let _e=E.xs[2*me],Ce=E.xs[2*me+1],Be=E.xs[2*me+2]-_e,ge=E.xs[2*me+3]-Ce;for(let ye=0;ye+1<M.ds.length;ye++){let Te=M.xs[2*ye],Ie=M.xs[2*ye+1],Ee=M.xs[2*ye+2]-Te,Me=M.xs[2*ye+3]-Ie,We=Be*Me-ge*Ee;if(Math.abs(We)<1e-12)continue;let Re=((Te-_e)*Me-(Ie-Ce)*Ee)/We,He=((Te-_e)*ge-(Ie-Ce)*Be)/We;if(Re<0||Re>1||He<0||He>1)continue;let lt=E.ds[me]+Re*(E.ds[me+1]-E.ds[me]),qe=M.ds[ye]+He*(M.ds[ye+1]-M.ds[ye]);if(lt+qe>=S)continue;S=lt+qe,D=lt,O=qe,oe=_e+Be*Re,ne=Ce+ge*Re;let Bt=Math.hypot(Be,ge)||1,Xe=Math.hypot(Ee,Me)||1;N=Be/Bt,q=ge/Bt,V=Ee/Xe,te=Me/Xe;}}if(!Number.isFinite(S))return false;let re=Math.acos(Math.max(-1,Math.min(1,N*V+q*te)));if(re<=.05||re>=ia)return false;let se=o.kerbRadius/Math.tan(re/2);return m.set(p(R,H),{a:R,b:H,x:oe,y:ne,ux:N,uy:q,vx:V,vy:te,dA:D,dB:O,t:se}),F(R,D+se),F(H,O+se),true};for(let R of u.values())if(!(R.length<2))for(let H=0;H<R.length;H++){let E=R[H],M=R[(H+1)%R.length],S=d(E,M);if(S<=.05||S>=ia||j(E,M))continue;let D=E.ox-E.dy*E.rib.half,O=E.oy+E.dx*E.rib.half,N=M.ox+M.dy*M.rib.half,q=M.oy-M.dx*M.rib.half,V=E.dx*M.dy-E.dy*M.dx;if(Math.abs(V)<1e-9)continue;let te=((N-D)*M.dy-(q-O)*M.dx)/V,oe=((N-D)*E.dy-(q-O)*E.dx)/V,ne=o.kerbRadius/Math.tan(S/2);te>-E.rib.half&&oe>-M.rib.half&&m.set(p(E,M),{a:E,b:M,x:D+E.dx*te,y:O+E.dy*te,ux:E.dx,uy:E.dy,vx:M.dx,vy:M.dy,dA:Math.max(0,te),dB:Math.max(0,oe),t:ne}),F(E,te+ne),F(M,oe+ne);}},g=0;h(),b();for(let F=0;F<4&&o.clusterLink>0;F++){let U=false;for(let j of a){if(j.inner||j.total>o.clusterLink)continue;let R=f(j.head),H=f(j.tail),E=(u.get(R)?.length??0)>1,M=(u.get(H)?.length??0)>1;if(!E||!M||R!==H&&j.cutHead+j.cutTail<j.total*.9)continue;let S=D=>Math.max(0,...(u.get(D)??[]).filter(O=>O.rib!==j).map(O=>O.rib.half));j.total>S(R)+S(H)-q2||(j.inner=true,g++,R!==H&&(c[R]=H),U=true);}if(!U)break;h(),b();}let y=a.map(F=>[F.cutHead,F.cutTail]),A=new Map;for(let F of m.values())for(let[U,j]of [[F.a,F.dA],[F.b,F.dB]]){let R=A.get(U.rib)??[o.minCut,o.minCut],H=U.atHead?0:1;R[H]=Math.max(R[H],j),A.set(U.rib,R);}for(let F of a){if(F.inner)continue;let U=F.total*.9;if(F.cutHead+F.cutTail<=U)continue;let[j,R]=A.get(F)??[o.minCut,o.minCut],H=Math.min(j,F.cutHead),E=Math.min(R,F.cutTail);if(H+E>=U){let O=U/(H+E);F.cutHead=H*O,F.cutTail=E*O;continue}let M=F.cutHead-H,S=F.cutTail-E,D=(U-H-E)/(M+S||1);F.cutHead=H+M*D,F.cutTail=E+S*D;}for(let F=0;F<2;F++){let U=R=>R.atHead?R.rib.cutHead:R.rib.cutTail;for(let R of m.values())R.t=Math.max(0,Math.min(R.t,U(R.a)-R.dA,U(R.b)-R.dB));let j=new Map;for(let R of a)j.set(R,[o.minCut,o.minCut]);for(let R of m.values())for(let[H,E]of [[R.a,R.dA+R.t],[R.b,R.dB+R.t]]){let M=j.get(H.rib),S=H.atHead?0:1;M[S]=Math.max(M[S],Math.min(E,U(H)));}for(let[R,[H,E]]of j)R.inner||(R.cutHead=H,R.cutTail=E);}let x=0,v=new Map;for(let F=0;F<i.length;F++){let U=f(F);v.set(U,(v.get(U)??0)+1);}for(let[F,U]of u)U.length>1&&(v.get(F)??1)>1&&x++;let w=a.map(F=>{if(F.inner)return null;let U=F.cutHead,j=F.total-F.cutTail;if(j-U<.1)return null;let R=[U];for(let E=0;E<F.along.length;E++)F.along[E]>U+.05&&F.along[E]<j-.05&&R.push(F.along[E]);let H=Math.ceil((j-U)/o.step);for(let E=1;E<H;E++)R.push(U+(j-U)*E/H);return R.push(j),R.sort((E,M)=>E-M),R.filter((E,M)=>M===0||E-R[M-1]>.02).map(E=>s(F,E))}),C=F=>{let U=w[F.rib.id];return U?F.atHead?U[0]:U[U.length-1]:null},B=[],_=new Map;for(let[F,U]of u){let j=U.filter(H=>C(H));if(j.length<2)continue;let R=[];for(let H=0;H<j.length;H++){let E=j[H],M=j[(H+1)%j.length],S=C(E),D=C(M),O=E.atHead?[S.rx,S.ry]:[S.lx,S.ly],N=E.atHead?[S.lx,S.ly]:[S.rx,S.ry],q=M.atHead?[D.rx,D.ry]:[D.lx,D.ly],V=E.atHead?[S.tx,S.ty]:[-S.tx,-S.ty],te=M.atHead?[D.tx,D.ty]:[-D.tx,-D.ty],oe=T(E.rib,O[0],O[1],S.cx,S.cy),ne=T(E.rib,N[0],N[1],S.cx,S.cy);R.push({x:O[0],y:O[1],z:S.z,h:S.h,outer:false,ix:oe[0],iy:oe[1]}),R.push({x:N[0],y:N[1],z:S.z,h:S.h,outer:true,ix:ne[0],iy:ne[1],start:true,ribs:[E.rib.id,M.rib.id]});let re=q[0]-N[0],se=q[1]-N[1],me=Math.hypot(re,se),_e=m.get(p(E,M)),Ce=ye=>({z:S.z+(D.z-S.z)*ye,h:S.h+(D.h-S.h)*ye}),Be=(ye,Te,Ie)=>{let Ee=ye.rib,Me=s(Ee,ye.atHead?Te:Ee.total-Te),We=ye.atHead===Ie,Re=ye.atHead?Me.tx:-Me.tx,He=ye.atHead?Me.ty:-Me.ty;return {x:We?Me.lx:Me.rx,y:We?Me.ly:Me.ry,tx:Re,ty:He}},ge=ye=>ye.atHead?ye.rib.cutHead:ye.rib.cutTail;if(_e&&me>.05){let ye=Math.min(_e.dA+_e.t,ge(E)),Te=Math.min(_e.dB+_e.t,ge(M)),Ie=[];for(let Xe=ge(E)-Fo;Xe>ye+.05;Xe-=Fo){let kt=Be(E,Xe,true);Ie.push([kt.x,kt.y]);}let Ee=Be(E,ye,true),Me=Be(M,Te,false);Math.hypot(Ee.x-N[0],Ee.y-N[1])>.05&&Ie.push([Ee.x,Ee.y]);let We=Me.x-Ee.x,Re=Me.y-Ee.y,He=Math.hypot(We,Re);if(He>.05){let Xe=Math.acos(Math.max(-1,Math.min(1,-Ee.tx*Me.tx-Ee.ty*Me.ty))),kt=Xe>.05?4/3*Math.tan(Xe/4)*He/(2*Math.sin(Xe/2)):He/3,Pl=[Ee.x-Ee.tx*kt,Ee.y-Ee.ty*kt],Hl=[Me.x-Me.tx*kt,Me.y-Me.ty*kt],Ol=Math.max(3,Math.ceil(Xe/(Math.PI/24)));for(let sa=1;sa<Ol;sa++){let pt=sa/Ol,gt=1-pt;Ie.push([gt*gt*gt*Ee.x+3*gt*gt*pt*Pl[0]+3*gt*pt*pt*Hl[0]+pt*pt*pt*Me.x,gt*gt*gt*Ee.y+3*gt*gt*pt*Pl[1]+3*gt*pt*pt*Hl[1]+pt*pt*pt*Me.y]);}}Math.hypot(Me.x-q[0],Me.y-q[1])>.05&&Ie.push([Me.x,Me.y]);for(let Xe=Te+Fo;Xe<ge(M)-.05;Xe+=Fo){let kt=Be(M,Xe,false);Ie.push([kt.x,kt.y]);}let lt=0,qe=N;for(let Xe of Ie)lt+=Math.hypot(Xe[0]-qe[0],Xe[1]-qe[1]),qe=Xe;lt+=Math.hypot(q[0]-qe[0],q[1]-qe[1]);let Bt=0;qe=N;for(let Xe of Ie)Bt+=Math.hypot(Xe[0]-qe[0],Xe[1]-qe[1]),qe=Xe,R.push({x:Xe[0],y:Xe[1],...Ce(lt>0?Bt/lt:0),outer:true});}else if(me>.05&&d(E,M)>=ia){let ye=[];for(let Me=ge(E)-Fo;Me>.05;Me-=Fo){let We=Be(E,Me,true);ye.push([We.x,We.y]);}for(let Me=0;Me<ge(M)-.05;Me+=Fo){let We=Be(M,Me,false);ye.push([We.x,We.y]);}let Te=0,Ie=N;for(let Me of ye)Te+=Math.hypot(Me[0]-Ie[0],Me[1]-Ie[1]),Ie=Me;Te+=Math.hypot(q[0]-Ie[0],q[1]-Ie[1]);let Ee=0;Ie=N;for(let Me of ye)Ee+=Math.hypot(Me[0]-Ie[0],Me[1]-Ie[1]),Ie=Me,R.push({x:Me[0],y:Me[1],...Ce(Te>0?Ee/Te:0),outer:true});}else if(me>.05){let ye=d(E,M),Te=null,Ie=null,Ee=Math.max(4,Math.ceil(me/1.5)),Me=-V[0]*te[1]+V[1]*te[0];if(ye>.05&&ye<ia&&Math.abs(Me)>1e-9){let We=(re*te[1]-se*te[0])/Me,Re=(re*V[1]-se*V[0])/Me;if(We>0&&Re>0){let He=Math.acos(Math.max(-1,Math.min(1,-V[0]*te[0]-V[1]*te[1]))),lt=He>.001?4/3*Math.tan(He/4)/Math.tan(He/2):2/3,qe=Math.max(We*lt,me/3),Bt=Math.max(Re*lt,me/3);Te=[N[0]-V[0]*qe,N[1]-V[1]*qe],Ie=[q[0]-te[0]*Bt,q[1]-te[1]*Bt],Ee=Math.max(3,Math.ceil(He/(Math.PI/24)));}}if(!Te||!Ie){let We=Math.max(-1,Math.min(1,-V[0]*te[0]-V[1]*te[1])),Re=Math.acos(We),He=Re>.05?4/3*Math.tan(Re/4)*me/(2*Math.sin(Re/2)):me/3;Te=[N[0]-V[0]*He,N[1]-V[1]*He],Ie=[q[0]-te[0]*He,q[1]-te[1]*He],Ee=Math.max(Ee,Math.ceil(Re/(Math.PI/24)));}for(let We=1;We<Ee;We++){let Re=We/Ee,He=1-Re,lt=He*He*He*N[0]+3*He*He*Re*Te[0]+3*He*Re*Re*Ie[0]+Re*Re*Re*q[0],qe=He*He*He*N[1]+3*He*He*Re*Te[1]+3*He*Re*Re*Ie[1]+Re*Re*Re*q[1];R.push({x:lt,y:qe,z:S.z+(D.z-S.z)*Re,h:S.h+(D.h-S.h)*Re,outer:true});}}}R.length>=3&&(_.set(F,B.length),B.push(R));}function T(F,U,j,R,H){let E=Math.min(.45,o.kerbWidth/F.half);return [U+(R-U)*E,j+(H-j)*E]}let k=12,K=new Map,P=[],W=[],z=(F,U)=>(F+1e6)*2e6+(U+1e6),L=(F,U,j,R,H,E,M,S)=>{let D=W.length;P.push(U,j,R,H,E,M,S),W.push(F);let O=Math.floor(Math.min(U,R,E)/k),N=Math.floor(Math.max(U,R,E)/k),q=Math.floor(Math.min(j,H,M)/k),V=Math.floor(Math.max(j,H,M)/k);for(let te=O;te<=N;te++)for(let oe=q;oe<=V;oe++){let ne=z(te,oe),re=K.get(ne);re||K.set(ne,re=[]),re.push(D);}},X=(F,U,j,R=-1)=>{let H=typeof R=="number"?null:R,E=K.get(z(Math.floor(F/k),Math.floor(U/k)));if(!E)return false;for(let M of E){if(H?H.includes(W[M]):W[M]===R)continue;let S=M*7;if(Math.abs(P[S+6]-j)>Z2)continue;let D=P[S],O=P[S+1],N=P[S+2],q=P[S+3],V=P[S+4],te=P[S+5],oe=(N-D)*(U-O)-(q-O)*(F-D),ne=(V-N)*(U-q)-(te-q)*(F-N),re=(D-V)*(U-te)-(O-te)*(F-V);if(oe>=0&&ne>=0&&re>=0||oe<=0&&ne<=0&&re<=0)return true}return false};w.forEach((F,U)=>{if(F)for(let j=0;j+1<F.length;j++){let R=F[j],H=F[j+1],E=(R.z+H.z)/2;L(U,R.lx,R.ly,R.rx,R.ry,H.rx,H.ry,E),L(U,R.lx,R.ly,H.rx,H.ry,H.lx,H.ly,E);}});let Q=B.map((F,U)=>{let j=[];for(let H of F)j.push(H.x,H.y);let R=ot(j);for(let H=0;H<R.length;H+=3){let[E,M,S]=[F[R[H]],F[R[H+1]],F[R[H+2]]];L(-2-U,E.x,E.y,M.x,M.y,S.x,S.y,(E.z+M.z+S.z)/3);}return R}),G=0;o.fillGap>0&&w.forEach((F,U)=>{if(!F||F.length<3)return;let j=[];for(let R=1;R+1<F.length;R++){let H=F[R];for(let E of [0,1]){let M=E===0?H.lx:H.rx,S=E===0?H.ly:H.ry,D=M-H.cx,O=S-H.cy,N=Math.hypot(D,O)||1;if(D/=N,O/=N,!X(M+D*.05,S+O*.05,H.z,U)){for(let q=Rd;q<=o.fillGap+1e-9;q+=Rd)if(X(M+D*q,S+O*q,H.z,U)){j.push([R,E,q/2+.05]);break}}}}for(let[R,H,E]of j){let M=F[R];if(H===0){let S=M.lx-M.cx,D=M.ly-M.cy,O=Math.hypot(S,D)||1;M.lx+=S/O*E,M.ly+=D/O*E;}else {let S=M.rx-M.cx,D=M.ry-M.cy,O=Math.hypot(S,D)||1;M.rx+=S/O*E,M.ry+=D/O*E;}G++;}});let Y=[],ie=0,ee=null,ue=null;if(sr&&(o.islands||o.outline)){let F=[],U=E=>Math.abs(E)<.05,j=E=>{let M=E.map(N=>!U(N.h)),S=[];for(let N=0;N<E.length;N++){if(!M[N])continue;let q=N;for(;q+1<E.length&&M[q+1];)q++;S.push([Math.max(0,N-1),Math.min(E.length-1,q+1)]),N=q;}let D=[],O=0;for(let[N,q]of S)N-O>=1&&D.push([O,N]),O=q;return E.length-1-O>=1&&D.push([O,E.length-1]),S.length?{raised:S,flat:D}:{raised:S,flat:[[0,E.length-1]]}},R=(E,M,S)=>{let D=[];for(let O=M;O<=S;O++)D.push([E[O].lx,E[O].ly]);for(let O=S;O>=M;O--)D.push([E[O].rx,E[O].ry]);return D.push(D[0]),D};if(w.forEach(E=>{if(!(!E||E.length<2))for(let[M,S]of j(E).flat)F.push([R(E,M,S)]);}),B.forEach(E=>{if(!E.every(S=>U(S.h)))return;let M=E.map(S=>[S.x,S.y]);M.push(M[0]),F.push([M]);}),o.outline){ue=[];let E=new Map;for(let[M,S]of u)E.set(M,S.filter(D=>C(D)).length);w.forEach((M,S)=>{if(!M||M.length<2||M.every(O=>U(O.h)))return;for(let[O,N]of j(M).raised){let q=R(M,O,N),V=[];for(let oe=0;oe+1<q.length;oe++)V.push(q[oe][0],q[oe][1]);let te=[];for(let oe=O;oe<=N;oe++)te.push(M[oe].cx,M[oe].cy,M[oe].h);ue.push({outer:V,profile:te});}let D=a[S];for(let O of [true,false]){if((E.get(f(O?D.head:D.tail))??0)>1)continue;let N=O?M[0]:M[M.length-1];if(U(N.h))continue;let[q,V]=O?[N.lx,N.ly]:[N.rx,N.ry],te=q-N.cx,oe=V-N.cy,ne=Math.max(8,Math.ceil(Math.PI*Math.hypot(te,oe)/.5)),re=[];for(let se=0;se<=ne;se++){let me=Math.PI*se/ne;re.push(N.cx+te*Math.cos(me)-oe*Math.sin(me),N.cy+te*Math.sin(me)+oe*Math.cos(me));}ue.push({outer:re,profile:[N.cx,N.cy,N.h,q,V,N.h]});}}),B.forEach(M=>{if(M.every(O=>U(O.h)))return;let S=[],D=[];for(let O of M)S.push(O.x,O.y),D.push(O.x,O.y,O.h);D.push(M[0].x,M[0].y,M[0].h),ue.push({outer:S,profile:D});});}if(o.outline){let E=new Map;for(let[M,S]of u)E.set(M,S.filter(D=>C(D)).length);w.forEach((M,S)=>{if(!M)return;let D=a[S];for(let O of [true,false]){if((E.get(f(O?D.head:D.tail))??0)>1)continue;let N=O?M[0]:M[M.length-1];if(!U(N.h))continue;let[q,V]=O?[N.lx,N.ly]:[N.rx,N.ry],te=q-N.cx,oe=V-N.cy,ne=Math.max(8,Math.ceil(Math.PI*Math.hypot(te,oe)/.5)),re=[];for(let se=0;se<=ne;se++){let me=Math.PI*se/ne;re.push([N.cx+te*Math.cos(me)-oe*Math.sin(me),N.cy+te*Math.sin(me)+oe*Math.cos(me)]);}re.push(re[0]),F.push([re]);}});}let H=oA(F,E=>{ie+=E;});for(let E of H)for(let M=1;M<E.length;M++){let S=E[M],D=0;for(let O=0;O+1<S.length;O++)D+=S[O][0]*S[O+1][1]-S[O+1][0]*S[O][1];D=Math.abs(D)/2,!(D<Pd||D>Hd)&&Y.push(S.map(([O,N])=>[O,N]));}if(o.outline){let E=D=>{let O=0;for(let N=0;N<D.length;N+=2){let q=(N+2)%D.length;O+=D[N]*D[q+1]-D[q]*D[N+1];}return O/2},M=D=>{let O=[];for(let N=0;N+1<D.length;N++)O.push(D[N][0],D[N][1]);return O},S=D=>{let O=[];for(let N=D.length-2;N>=0;N-=2)O.push(D[N],D[N+1]);return O};ee=H.map(D=>{let O=M(D[0]);E(O)<0&&(O=S(O));let N=D.slice(1).map(q=>{let V=M(q),te=Math.abs(E(V));return o.islands&&te>=Pd&&te<=Hd&&(V=Od(V)??V),E(V)>0?S(V):V});return {outer:O,holes:N}});}Y.forEach((E,M)=>{let S=[];for(let O=0;O+1<E.length;O++)S.push(E[O][0],E[O][1]);let D=ot(S);for(let O=0;O<D.length;O+=3){let N=D[O],q=D[O+1],V=D[O+2];L(-1e5-M,S[2*N],S[2*N+1],S[2*q],S[2*q+1],S[2*V],S[2*V+1],o.elevation);}});}let $=[],Ae=[],ve=[],he=[],xe=[],de=(F,U,j,R,H,E,M,S)=>($.push(F,U,j),Ae.push(R,H,E),ve.push(M),he.push(S),$.length/3-1),we=F=>{let U=F-o.elevation-o.deck;return U>.05?U:0},I=(F,U)=>{for(let j=0;j+1<F.length;j++){let[R,H,E,M]=F[j],[S,D,O,N]=F[j+1],q=D-H,V=-(S-R),te=Math.hypot(q,V);if(te<1e-9)continue;q/=te,V/=te,U||(q=-q,V=-V);let oe=de(R,H,E,q,V,0,Mn,M),ne=de(S,D,O,q,V,0,Mn,N),re=de(S,D,we(O),q,V,0,Mn,N),se=de(R,H,we(E),q,V,0,Mn,M);xe.push(oe,ne,re,oe,re,se);}},J=0,Z=(F,U,j,R=-1,H=[])=>{let E=F[0],M=F[F.length-1],S=(V,te)=>H.length>0&&(Math.hypot(V-E[0],te-E[1])<kd||Math.hypot(V-M[0],te-M[1])<kd),D=[R,...H],O=[],N=null,q=(V,te,oe)=>[V[0]+(te[0]-V[0])*oe,V[1]+(te[1]-V[1])*oe,V[2]+(te[2]-V[2])*oe,V[3]+(te[3]-V[3])*oe];for(let V=0;V+1<F.length;V++){let te=F[V],oe=F[V+1],ne=oe[1]-te[1],re=-(oe[0]-te[0]),se=Math.hypot(ne,re);if(se<1e-9)continue;ne/=se,re/=se,j||(ne=-ne,re=-re);let me=Be=>{let ge=q(te,oe,Be),ye=S(ge[0],ge[1])?D:R;return !X(ge[0]+ne*Td,ge[1]+re*Td,ge[2],ye)&&!X(ge[0]-ne*.02,ge[1]-re*.02,ge[2],ye)},_e=me(.02)&&me(.5)&&me(.98),Ce=_e?1:Math.max(1,Math.ceil(se/Y2));for(let Be=0;Be<Ce;Be++){let ge=Be/Ce,ye=(Be+1)/Ce,Te=(ge+ye)/2;if(!(_e||me(Te))){J++,N&&(O.push(N),N=null);continue}N||(N={outer:[q(te,oe,ge)],inner:[q(U[V],U[V+1],ge)]}),N.outer.push(q(te,oe,ye)),N.inner.push(q(U[V],U[V+1],ye));}}N&&O.push(N);for(let V of O){let te=ce(V.outer,V.inner);ae(te.map(oe=>V.outer[oe]),te.map(oe=>V.inner[oe]),j);}},ce=(F,U)=>{let j=[0],R=0,H=(E,M,S)=>{let D=S[0]-M[0],O=S[1]-M[1],N=D*D+O*O,q=N>0?Math.max(0,Math.min(1,((E[0]-M[0])*D+(E[1]-M[1])*O)/N)):0,V=Math.hypot(M[0]+D*q-E[0],M[1]+O*q-E[1]),te=Math.abs(M[2]+(S[2]-M[2])*q-E[2]);return Math.max(V,te)};for(let E=2;E<F.length;E++){let M=true;for(let S=R+1;S<E&&M;S++)(H(F[S],F[R],F[E])>Ld||H(U[S],U[R],U[E])>Ld)&&(M=false);M||(j.push(E-1),R=E-1);}return F.length>1&&j.push(F.length-1),j},ae=(F,U,j)=>{let R=o.kerbWidth>0?o.kerbHeight:0;for(let H=0;H+1<F.length;H++){let[E,M,S,D]=F[H],[O,N,q,V]=F[H+1],te=N-M,oe=-(O-E),ne=Math.hypot(te,oe);if(ne<1e-9||(te/=ne,oe/=ne,j||(te=-te,oe=-oe),I([[E,M,S+R,D],[O,N,q+R,V]],j),!(o.kerbWidth>0)))continue;let[re,se]=U[H],[me,_e]=U[H+1],Ce=de(E,M,S+R,0,0,1,_n,D),Be=de(O,N,q+R,0,0,1,_n,V),ge=de(me,_e,q+R,0,0,1,_n,V),ye=de(re,se,S+R,0,0,1,_n,D);xe.push(Ce,Be,ge,Ce,ge,ye);let Te=de(re,se,S+R,-te,-oe,0,En,D),Ie=de(me,_e,q+R,-te,-oe,0,En,V),Ee=de(me,_e,q,-te,-oe,0,En,V),Me=de(re,se,S,-te,-oe,0,En,D);xe.push(Te,Ie,Ee,Te,Ee,Me);}},be=new Map;for(let[F,U]of u)be.set(F,U.filter(j=>C(j)).length);let Se=0;return w.forEach((F,U)=>{if(!F)return;let j=a[U];Se++;let R=[];for(let M=0;M<F.length;M++){let S=F[M],D=F[Math.max(0,M-1)],O=F[Math.min(F.length-1,M+1)],N=O.d-D.d||1,q=(O.z-D.z)/N,V=-q*S.tx,te=-q*S.ty,oe=1,ne=Math.hypot(V,te,oe);V/=ne,te/=ne,oe/=ne,R.push(de(S.lx,S.ly,S.z,V,te,oe,Io,S.h),de(S.rx,S.ry,S.z,V,te,oe,Io,S.h));}for(let M=0;M+1<F.length;M++){let S=R[2*M],D=R[2*M+1],O=R[2*M+2],N=R[2*M+3];xe.push(S,D,N,S,N,O);}let H=[j.head,j.tail].map(M=>_.get(f(M))).filter(M=>M!==void 0).map(M=>-2-M);Z(F.map(M=>[M.lx,M.ly,M.z,M.h]),F.map(M=>[...T(j,M.lx,M.ly,M.cx,M.cy),M.z,M.h]),false,U,H),Z(F.map(M=>[M.rx,M.ry,M.z,M.h]),F.map(M=>[...T(j,M.rx,M.ry,M.cx,M.cy),M.z,M.h]),true,U,H);let E=[];for(let M of F)E.push(de(M.lx,M.ly,we(M.z),0,0,-1,lr,M.h),de(M.rx,M.ry,we(M.z),0,0,-1,lr,M.h));for(let M=0;M+1<F.length;M++){if(we(F[M].z)<=0&&we(F[M+1].z)<=0)continue;let S=E[2*M],D=E[2*M+1],O=E[2*M+2],N=E[2*M+3];xe.push(S,N,D,S,O,N);}for(let M of [true,false]){let S=M?j.head:j.tail;if((be.get(f(S))??0)>1)continue;let D=M?F[0]:F[F.length-1],[O,N]=M?[D.lx,D.ly]:[D.rx,D.ry],q=O-D.cx,V=N-D.cy,te=Math.hypot(q,V),oe=Math.max(6,Math.ceil(Math.PI*te/.8)),ne=[];for(let Ce=0;Ce<=oe;Ce++){let Be=Math.PI*Ce/oe,ge=Math.cos(Be),ye=Math.sin(Be);ne.push([D.cx+q*ge-V*ye,D.cy+q*ye+V*ge,D.z,D.h]);}let re=de(D.cx,D.cy,D.z,0,0,1,Io,D.h),se=ne.map(([Ce,Be,ge,ye])=>de(Ce,Be,ge,0,0,1,Io,ye));for(let Ce=0;Ce+1<se.length;Ce++)xe.push(re,se[Ce],se[Ce+1]);if(we(D.z)>0){let Ce=de(D.cx,D.cy,we(D.z),0,0,-1,lr,D.h),Be=ne.map(([ge,ye,Te,Ie])=>de(ge,ye,we(Te),0,0,-1,lr,Ie));for(let ge=0;ge+1<Be.length;ge++)xe.push(Ce,Be[ge+1],Be[ge]);}let me=te>0?Math.max(0,1-o.kerbWidth/te):0,_e=ne.map(([Ce,Be,ge,ye])=>[D.cx+(Ce-D.cx)*me,D.cy+(Be-D.cy)*me,ge,ye]);Z(ne,_e,true,U);}}),B.forEach((F,U)=>{let j=Q[U],R=F.map(S=>de(S.x,S.y,S.z,0,0,1,Io,S.h)),H=F.some(S=>we(S.z)>0),E=H?F.map(S=>de(S.x,S.y,we(S.z),0,0,-1,lr,S.h)):[];for(let S=0;S<j.length;S+=3)xe.push(R[j[S]],R[j[S+1]],R[j[S+2]]),H&&xe.push(E[j[S]],E[j[S+2]],E[j[S+1]]);let M=F.length;for(let S=0;S<M;S++){let D=F[S];if(D.ix!==void 0)continue;let O=F[(S-1+M)%M],N=F[(S+1)%M],q=[-(D.y-O.y),D.x-O.x],V=[-(N.y-D.y),N.x-D.x],te=Math.hypot(q[0],q[1])||1,oe=Math.hypot(V[0],V[1])||1,ne=q[0]/te+V[0]/oe,re=q[1]/te+V[1]/oe,se=Math.hypot(ne,re)||1;ne/=se,re/=se;let me=Math.max(.5,ne*(V[0]/oe)+re*(V[1]/oe));D.ix=D.x+ne*o.kerbWidth/me,D.iy=D.y+re*o.kerbWidth/me;}for(let S=0;S<M;S++){let D=F[S];if(!D.start)continue;let O=[D];for(let N=1;N<M;N++){let q=F[(S+N)%M];if(O.push(q),!q.outer)break}Z(O.map(N=>[N.x,N.y,N.z,N.h]),O.map(N=>[N.ix,N.iy,N.z,N.h]),true,-2-U,D.ribs??[]);}}),Y.forEach(F=>{let U=[];for(let V=0;V+1<F.length;V++)U.push(F[V][0],F[V][1]);let j=o.elevation,R=ot(U),H=[];for(let V=0;V<U.length;V+=2)H.push(de(U[V],U[V+1],j,0,0,1,Io,0));for(let V=0;V<R.length;V+=3)xe.push(H[R[V]],H[R[V+1]],H[R[V+2]]);let E=Od(U);if(!E)return;let M=j+o.kerbHeight-.01,S=ot(E),D=[];for(let V=0;V<E.length;V+=2)D.push(de(E[V],E[V+1],M,0,0,1,zd,0));for(let V=0;V<S.length;V+=3)xe.push(D[S[V]],D[S[V+1]],D[S[V+2]]);let O=E.length/2,N=[],q=[];for(let V=0;V<=O;V++){let te=V%O,oe=E[2*((te-1+O)%O)],ne=E[2*((te-1+O)%O)+1],re=E[2*te],se=E[2*te+1],me=E[2*((te+1)%O)],_e=E[2*((te+1)%O)+1],Ce=[-(se-ne),re-oe],Be=[-(_e-se),me-re],ge=Math.hypot(Ce[0],Ce[1])||1,ye=Math.hypot(Be[0],Be[1])||1,Te=Ce[0]/ge+Be[0]/ye,Ie=Ce[1]/ge+Be[1]/ye,Ee=Math.hypot(Te,Ie)||1;Te/=Ee,Ie/=Ee;let Me=Math.max(.5,Te*(Be[0]/ye)+Ie*(Be[1]/ye));N.push([re,se,j,0]),q.push([re+Te*o.kerbWidth/Me,se+Ie*o.kerbWidth/Me,j,0]);}ae(N,q,true);}),{positions:Float64Array.from($),normals:Float32Array.from(Ae),part:Uint8Array.from(ve),height:Float32Array.from(he),indices:Uint32Array.from(xe),ribbons:Se,patches:B.length,clusters:x,links:g,filled:G,islands:Y.length,unionFailures:ie,...ee?{outline:ee}:{},...ue?{raised:ue}:{},kerbSkipped:J,cuts:Float32Array.from(a.flatMap(F=>[F.chain,F.total,F.cutHead,F.cutTail,y[F.id][0],y[F.id][1]]))}}var nA=.06,iA=24,aA=.8;function sA(n,e){let t=n,o=e.metersPerUnit>0?e.metersPerUnit:.5,r=cA(t),i=Math.max(e.height,0);if(!(i>0)||!(r>0))return {heightAt:()=>i,rampIn:0,rampOut:0,knots:[],total:r};let a=Math.max(e.maxGrade??.06,.005),s=1.5*i/a/o,l=e.rampStart!==false,c=e.rampEnd!==false,f=l?s:0,u=c?s:0,h=f+u;h>r&&h>0&&(f=f/h*r,u=u/h*r);let d=p=>{if(p<=0)return l?0:i;if(p>=r)return c?0:i;let b=1;return f>0&&p<f&&(b=Math.min(b,Nd(p/f))),u>0&&r-p<u&&(b=Math.min(b,Nd((r-p)/u))),i*b},m=[];for(let[p,b]of [[0,f],[r,-u]])if(Math.abs(b)>0)for(let g=1;g<=Wd;g++){let y=p+b*g/Wd;y>.01&&y<r-.01&&m.push(y);}return m.sort((p,b)=>p-b),{heightAt:d,rampIn:f,rampOut:u,knots:m,total:r}}var Wd=8;function lA(n,e,t){let o=n,r=t.metersPerUnit>0?t.metersPerUnit:.5,i=Math.max(t.spacing??24,1)/r,a=Math.max(t.minHeight??.8,0),s=Math.max(t.deck,0),l=e.total;if(!(l>i*.5))return [];let c=[],f=l/2,u=Math.floor(l/i),h=f-(u-1)*i/2;for(let d=0;d<u;d++){let m=h+d*i;if(m<=0||m>=l)continue;let p=e.heightAt(m)-s;if(p<a)continue;let b=fA(o,m);b&&c.push({x:b.x,y:b.y,angle:b.angle,height:p,at:m});}return c}function cA(n){let e=0;for(let t=0;t+3<n.length;t+=2)e+=Math.hypot(n[t+2]-n[t],n[t+3]-n[t+1]);return e}function fA(n,e){let t=0;for(let o=0;o+3<n.length;o+=2){let r=n[o+2]-n[o],i=n[o+3]-n[o+1],a=Math.hypot(r,i);if(!(a<=0)){if(t+a>=e){let s=(e-t)/a;return {x:n[o]+r*s,y:n[o+1]+i*s,angle:Math.atan2(i,r)}}t+=a;}}return null}function Nd(n){let e=n<0?0:n>1?1:n;return e*e*(3-2*e)}var vl=class{constructor(e={}){this.options=e;this.group=null;this.needle=null;this.map=null;this.onMove=()=>this.syncCompass();}getDefaultPosition(){return "top-right"}onAdd(e){let t=e;this.map=t;let o=[];if(this.options.showZoom!==false&&(o.push(Vt("+","\u041F\u0440\u0438\u0431\u043B\u0438\u0437\u0438\u0442\u044C",()=>t.zoomIn())),o.push(Vt("\u2212","\u041E\u0442\u0434\u0430\u043B\u0438\u0442\u044C",()=>t.zoomOut()))),this.options.showCompass!==false){let r=Vt("","\u041F\u043E\u0432\u0435\u0440\u043D\u0443\u0442\u044C \u043D\u0430 \u0441\u0435\u0432\u0435\u0440",()=>t.resetNorthPitch()),i=document.createElement("span");i.style.cssText="display:block;width:0;height:0;border:6px solid transparent;border-bottom:12px solid #e03131;transform-origin:50% 75%",r.appendChild(i),this.needle=i,o.push(r);}return this.group=To(...o),t.on("move",this.onMove),this.syncCompass(),this.group}onRemove(e){e.off("move",this.onMove),this.group=null,this.needle=null,this.map=null;}syncCompass(){if(!this.needle||!this.map)return;let e=this.map.getBearing(),t=this.options.visualizePitch?this.map.getPitch():0;this.needle.style.transform=`rotate(${-e}deg) scaleY(${Math.cos(t*Math.PI/180).toFixed(3)})`;}},Cl=class{constructor(e={}){this.options=e;this.element=null;this.map=null;this.onMove=()=>this.sync();}getDefaultPosition(){return "bottom-left"}onAdd(e){let t=e;this.map=t;let o=document.createElement("div");return o.className="osmgl-ctrl-scale",o.style.cssText=["box-sizing:border-box;background:rgba(255,255,255,.75);border:2px solid #333;border-top:none","font:11px/1.6 system-ui,sans-serif;color:#333;padding:0 5px;text-align:center;white-space:nowrap"].join(";"),this.element=o,t.on("move",this.onMove),this.sync(),o}onRemove(e){e.off("move",this.onMove),this.element=null,this.map=null;}setUnit(e){this.options.unit=e,this.sync();}sync(){let e=this.element,t=this.map;if(!e||!t)return;let o=this.options.maxWidth??100,r=t.getCenter().lat,a=40075016686e-3*Math.cos(r*Math.PI/180)/(512*Math.pow(2,t.getZoom()))*o,s=this.options.unit??"metric",l,c;if(s==="imperial"){let f=a*3.2808;if(f>5280){let u=Sn(f/5280);l=`${u} mi`,c=u*5280/f;}else {let u=Sn(f);l=`${u} ft`,c=u/f;}}else if(s==="nautical"){let f=Sn(a/1852);l=`${f} nm`,c=f*1852/a;}else if(a>=1e3){let f=Sn(a/1e3);l=`${f} \u043A\u043C`,c=f*1e3/a;}else {let f=Sn(a);l=`${f} \u043C`,c=f/a;}e.style.width=`${Math.round(o*c)}px`,e.textContent=l;}};function Sn(n){let e=Math.pow(10,Math.floor(Math.log10(n))),t=n/e;return (t>=5?5:t>=3?3:t>=2?2:1)*e}var Bl=class{constructor(e={}){this.options=e;}getDefaultPosition(){return "bottom-right"}onAdd(){let e=this.options.customAttribution,t=Array.isArray(e)?e.join(" | "):e??"\xA9 OpenStreetMap contributors",o=document.createElement("div");if(o.className="osmgl-ctrl-attrib",o.style.cssText="background:rgba(255,255,255,.8);border-radius:4px;font:11px/1.8 system-ui,sans-serif;color:#333;padding:0 6px",o.innerHTML=t,this.options.compact){let r=Vt("i","\u0418\u0441\u0442\u043E\u0447\u043D\u0438\u043A\u0438 \u0434\u0430\u043D\u043D\u044B\u0445",()=>{o.style.display=o.style.display==="none"?"block":"none";});r.style.borderRadius="50%";let i=document.createElement("div");return i.style.cssText="display:flex;align-items:center;gap:4px",o.style.display="none",i.append(o,r),i}return o}onRemove(){}},Ml=class{constructor(e={}){this.options=e;this.target=null;}getDefaultPosition(){return "top-right"}onAdd(e){let t=e;return this.target=this.options.container??t.getContainer(),To(Vt("\u26F6","\u0412\u043E \u0432\u0435\u0441\u044C \u044D\u043A\u0440\u0430\u043D",()=>{document.fullscreenElement?document.exitFullscreen():this.target?.requestFullscreen();}))}onRemove(){this.target=null;}},_l=class{constructor(e={}){this.options=e;this.watchId=null;this.map=null;}getDefaultPosition(){return "top-right"}onAdd(e){this.map=e;let t=Vt("\u25CE","\u041C\u043E\u0451 \u043C\u0435\u0441\u0442\u043E\u043F\u043E\u043B\u043E\u0436\u0435\u043D\u0438\u0435",()=>this.locate());return To(t)}onRemove(){this.watchId!==null&&navigator.geolocation.clearWatch(this.watchId),this.watchId=null,this.map=null;}locate(){if(!navigator.geolocation)return;let e=this.options.positionOptions??{enableHighAccuracy:true,timeout:1e4},t=o=>{this.map?.easeTo({center:{lng:o.coords.longitude,lat:o.coords.latitude},zoom:this.options.fitBoundsOptions?.zoom??16,duration:800});};this.options.trackUserLocation?(this.watchId!==null&&navigator.geolocation.clearWatch(this.watchId),this.watchId=navigator.geolocation.watchPosition(t,void 0,e)):navigator.geolocation.getCurrentPosition(t,void 0,e);}},El=class{constructor(e){this.options=e;this.button=null;this.saved=null;}getDefaultPosition(){return "top-right"}onAdd(e){let t=e;return this.button=Vt("\u26F0","\u0420\u0435\u043B\u044C\u0435\u0444",()=>{t.getTerrain()?(this.saved=t.getTerrain(),t.setTerrain(null)):t.setTerrain(this.saved??{source:this.options.source,exaggeration:this.options.exaggeration??1});}),To(this.button)}onRemove(){this.button=null;}},Sl=class{getDefaultPosition(){return "top-right"}onAdd(e){let t=e;return To(Vt("\u{1F310}","\u0413\u043B\u043E\u0431\u0443\u0441",()=>{t.setProjection(t.getProjection()==="globe"?"mercator":"globe");}))}onRemove(){}},Fl=class{constructor(e={}){this.options=e;}getDefaultPosition(){return "bottom-left"}onAdd(){let e=document.createElement("a");if(e.href=this.options.href??"https://www.openstreetmap.org/",e.target="_blank",e.rel="noopener",e.style.cssText="display:block;background:rgba(255,255,255,.8);border-radius:4px;padding:2px 6px;font:11px/1.6 system-ui,sans-serif;color:#333;text-decoration:none",this.options.src){let t=document.createElement("img");t.src=this.options.src,t.alt=this.options.label??"\u043B\u043E\u0433\u043E\u0442\u0438\u043F",t.style.cssText="display:block;height:18px",e.appendChild(t);}else e.textContent=this.options.label??"OpenStreetMap";return e}onRemove(){}};var uA=1,Fn=class{constructor(e){this.originX=0;this.originY=0;this._revision=0;this.id=e.id??`obj-${uA++}`,this.zIndex=e.zIndex??0,this.altitude=e.altitude??0,this.visible=e.visible!==false,this.userData=e.userData??{},this.paint=e;}get ghostOpacity(){return this.paint.ghostOpacity??0}get revision(){return this._revision}invalidate(){this._revision++;}setPaint(e){return Object.assign(this.paint,e),this.invalidate(),this}setOriginFromCoords(e){let t=1/0,o=1/0,r=-1/0,i=-1/0;for(let a of e)for(let s of a){let l=Pe(s),c=Oe(l.lng),f=Ge(l.lat);c<t&&(t=c),c>r&&(r=c),f<o&&(o=f),f>i&&(i=f);}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=Pe(o);t.push(Oe(r.lng)-this.originX,Ge(r.lat)-this.originY);}return t}color(e,t){let o=Ve(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}},Dl=class extends Fn{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=Zr([this.toLocal(this.coordinates)]);if(!e)return [];let t=this.paint.width??6,o=[],r=this.paint.strokeWidth??0;r>0&&o.push({kind:"line",mesh:e,color:this.color("strokeColor","#ffffff"),width:t+r*2,offset:this.paint.offset});let i=this.colorRuns();if(!i.length)return o.push(this.linePaint({kind:"line",mesh:e,color:this.color("color","#2f6df6"),width:t})),o;let a=this.paint.opacity??1;for(let s of i){let l=Zr([this.toLocal(this.coordinates.slice(s.from,s.to+1))]);if(!l)continue;let c=Ve(s.color);o.push(this.linePaint({kind:"line",mesh:l,color:[c[0],c[1],c[2],c[3]*a],width:t}));}return o}colorRuns(){if(this.segments.length===0||this.coordinates.length<2)return [];let e=this.coordinates.length-1,t=this.segments.filter(r=>Number.isInteger(r.at)&&r.at>=0&&r.at<e).sort((r,i)=>r.at-i.at);if(!t.length)return [];let o=[];for(let r=0;r<t.length;r++){let i=r===0?0:t[r].at,a=r+1<t.length?t[r+1].at:e;a>i&&o.push({from:i,to:a,color:t[r].color});}return o}hitTest(e,t,o){let r=(this.paint.width??6)/2+(this.paint.strokeWidth??0)+o,i=kl(this.coordinates,this.altitude,t);for(let a=0;a+1<i.length;a++)if(Vd(e,i[a],i[a+1])<=r)return true;return false}},aa=class extends Fn{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=Ts(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(Il(a))),i=Zr(r);i&&e.push(this.linePaint({kind:"line",mesh:i,color:this.color("strokeColor","#2f6df6"),width:o}));}return e}hitTest(e,t){let o=kl(Il(this.coordinates[0]??[]),this.altitude,t);if(!Ll(e,o))return false;for(let r=1;r<this.coordinates.length;r++)if(Ll(e,kl(Il(this.coordinates[r]),this.altitude,t)))return false;return true}},Tl=class extends aa{constructor(e){super({...e,coordinates:[hA(e.center,e.radius,e.segments)]});}};function hA(n,e,t){let o=Pe(n),r=e/Mt(o.lat),i=Oe(o.lng),a=Ge(o.lat),s=Math.max(12,t??Math.min(128,Math.round(24+e/20))),l=[];for(let c=0;c<s;c++){let f=c/s*Math.PI*2;l.push([ut(i+Math.cos(f)*r),ct(a+Math.sin(f)*r)]);}return l}function kl(n,e,t){let o=[];for(let r of n){let i=Pe(r),a=t(i.lng,i.lat,e);a&&o.push(a);}return o}function Il(n){if(n.length<2)return n;let e=Pe(n[0]),t=Pe(n[n.length-1]);return e.lng===t.lng&&e.lat===t.lat?n:[...n,n[0]]}function Vd(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 Ll(n,e){let t=false;for(let o=0,r=e.length-1;o<e.length;r=o++){let i=e[o].x,a=e[o].y,s=e[r].x,l=e[r].y;a>n.y!=l>n.y&&n.x<(s-i)*(n.y-a)/(l-a)+i&&(t=!t);}return t}var Ud="objects3d",cr="level",dA=32,mA=100,pA=250,Kd=(n,e,t)=>`${n}\u241F${e}\u241F${t}`;function bA(n){return new Promise((e,t)=>{let o=new Image;o.crossOrigin="anonymous",o.onload=()=>e(o),o.onerror=()=>t(new Error(`\u043D\u0435 \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u043B\u0430\u0441\u044C \u043A\u0430\u0440\u0442\u0438\u043D\u043A\u0430 ${n}`)),o.src=n;})}function Xd(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 gA(n){if(n.type==="surface"&&(n.deck??0)>0)return 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 Rl=class extends yt{constructor(t){super();this.options=t;this.transform=new dr;this.ctx=null;this.sources=new fe;this.rasterSources=new fe;this.demSources=new fe;this.renderer=new tn;this.objects=new qr;this.markerHost=null;this.gestures=null;this.resizeObserver=null;this.frameHandle=0;this.retryTimer=0;this.retryTimerAt=1/0;this.needsRepaint=true;this.padding={top:0,right:0,bottom:0,left:0};this.animation=null;this.ready=false;this.destroyed=false;this.pixelRatio=1;this.layerEdits=[];this.featureStates=new fe;this.centerClamped=true;this.spriteUrl=null;this.extraSprites=new fe;this.spriteImages=new fe;this.glyphsUrl="";this.mediaSources=new fe;this.transformRequest=null;this.cameraUpdate=null;this.transformConstrain=null;this.zoomSnap=0;this.bearingSnap=7;this.objects3d=null;this.objects3dEnabled=true;this.lastFrameAt=0;this.continuousFrames=0;this.onHashChange=null;this.lastMoveEmit=0;this.lastIndoorKey="";this.inCameraHooks=false;this.groundAt=(t,o)=>this.renderer.terrain.heightAtMerc(t,o);this.writingHash=false;this.hashTimer=0;this.layerOverrides=new fe;this.autoIndoorLevel=true;this.debugFB=null;let o=typeof t.container=="string"?document.getElementById(t.container):t.container;if(!o)throw new Error(`[osmgl] \u043A\u043E\u043D\u0442\u0435\u0439\u043D\u0435\u0440 \u043D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D: ${String(t.container)}`);this.container=o,this.qualityAuto=(t.quality??"auto")==="auto";let r=this.qualityAuto?Un(Kn()):t.quality;this.governor=new br(r,r,dA,mA),this.quality=po(r),this.densityQuality=this.quality,this.maxPixelRatio=t.maxPixelRatio??this.quality.maxPixelRatio,this._style=new Xo(t.theme?Nr(t.theme,t.style):t.style),this.background=t.background?Ve(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),this.controls=new Wn(this.container);let a=()=>this.gestures,s={...pa,...t.gestures??{}};this.handlers={dragPan:new Et(a,"dragPan",s.dragPan),dragRotate:new Et(a,"dragRotate",s.dragRotate),scrollZoom:new Et(a,"scrollZoom",s.scrollZoom),doubleClickZoom:new Et(a,"doubleClickZoom",s.doubleClickZoom),touchZoomRotate:new Et(a,"touchZoomRotate",s.touchZoomRotate),touchPitch:new Et(a,"touchPitch",s.touchPitch),keyboard:new Et(a,"keyboard",s.keyboard),boxZoom:new mr(this.canvas,this.container,(c,f)=>{this.fitScreenCoordinates(c,f,this.transform.bearing,{duration:400});}),cooperative:new pr(this.canvas,this.container,c=>{this.gestures?.setOptions({scrollZoom:c});})},t.cooperativeGestures&&this.handlers.cooperative.enable();let l=this.transform;l.minZoom=t.minZoom??0,l.maxZoom=t.maxZoom??22,l.maxPitch=t.maxPitch??75,l.projection=t.projection??"mercator",l.center=Pe(t.center??[0,0]),l.zoom=t.zoom??2,l.bearing=t.bearing??0,l.pitch=t.pitch??0,this.hashName=typeof t.hash=="string"?t.hash:void 0,t.hash&&this.applyHash(false),this.pool=new Qi(t.workerCount??Math.min(nl(),this.quality.maxWorkers)),this.initGL(),this.applyRendererQuality(this.quality),this.initSource(),this.initInput(),this.initResize(),this.measureRefresh(),queueMicrotask(()=>{this.destroyed||(this.ready=true,this.emit("load",void 0),this.triggerRepaint());});}measureRefresh(){if(typeof requestAnimationFrame!="function")return;let t=[],o=r=>{if(this.destroyed)return;if(t.push(r),t.length<12){requestAnimationFrame(o);return}let i=1/0;for(let a=1;a<t.length;a++)i=Math.min(i,t[a]-t[a-1]);this.governor.setRefresh(i);};requestAnimationFrame(o);}initGL(){let t=this.canvas.getContext("webgl2",{alpha:false,antialias:this.quality.antialias,depth:true,stencil:true,preserveDrawingBuffer:false,powerPreference:"high-performance",failIfMajorPerformanceCaveat:false});if(!t)throw new Error("[osmgl] WebGL2 \u043D\u0435\u0434\u043E\u0441\u0442\u0443\u043F\u0435\u043D \u0432 \u044D\u0442\u043E\u043C \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435");this.ctx=new Tn(t),this.glyphsUrl=this.options.fonts??"/tileserver/fonts/{fontstack}/{range}.pbf";let o=new nr(this.glyphsUrl,this.options.fontstack);this.options.icons&&o.icons.setIcons({...Mo,...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(De,{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);this.syncTerrain();let t=this.options.objects3d;if(t){this.objects3d=new Zi({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:Ud,type:"model",sourceLayer:t.sourceLayer??"model3d",minzoom:0,maxzoom:24}}sourceDrawn(t,o){for(let r of this._style.layers)if(r.type!=="raster"&&(r.source??De)===t&&this._style.layerVisibleAt(r,o))return true;return t===this.objects3dSource&&this.objects3dEnabled?o>=(this.options.objects3d?.layout?.minZoom??0):false}planFor(t,o=this._style){let r=o.workerPlan(t),i=t===this.objects3dSource?[...r,this.objects3dPlan()]:r;return this.quality.simpleGeometry?i.map(gA):i}updateObjects3D(){let t=this.objects3d,o=this.objects3dSource;if(!t||!o)return;let r=this.sources.get(o);if(!r)return;if(!this.objects3dEnabled){t.models.length&&t.clear(s=>this.renderer.models.remove(s,this.ctx?.gl)),this.renderer.hiddenBuildings=t.replacedBuildings,this.renderer.hiddenVenues=t.replacedVenues,this.renderer.hiddenVenueLayer=null;return}let i=this.venuesForMask();t.update({id:Ud,"source-layer":this.options.objects3d.sourceLayer??"model3d",layout:this.options.objects3d.layout},r,this.transform,s=>this.renderer.models.add(s),s=>this.renderer.models.remove(s,this.ctx?.gl),this.buildingsForMask(),i),this.renderer.hiddenBuildings=t.replacedBuildings,this.renderer.hiddenVenues=t.replacedVenues,this.renderer.hiddenVenueLayer=i?.key??null;let a=this.renderer.indoorMask.footprint();if(a){let s=this.transform.worldSize>0?this.transform.pixelsPerMeter/this.transform.worldSize*1.5:0;for(let l of t.models){let c=l.origin();l.setHidden(Zt(a,c.x,c.y,s));}}else for(let s of t.models)s.setHidden(false);}buildingsForMask(){let t=this.sources.get(De);if(!t)return null;for(let o of this._style.layers){if(o.type!=="fill-extrusion"||(o.source??De)!==De)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===cr&&t.add(o.source??De);for(let o of this._style.layers){if(o.type!=="fill-extrusion"||"splitBy"in o&&o.splitBy)continue;let r=o.source??De;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}syncTerrain(){let t=this._style.spec.terrain,o=t?this.demSources.get(t.source)??null:null;this.renderer.terrain.setSource(o),this.renderer.terrain.exaggeration=t?.exaggeration??1,this.transform.elevationAt=this.renderer.terrain.enabled?this.groundAt:null;}addSource(t,o){if(this.sources.get(t)?.destroy(),this.sources.delete(t),this.rasterSources.get(t)?.destroy(),this.rasterSources.delete(t),this.demSources.get(t)?.destroy(),this.demSources.delete(t),this.mediaSources.get(t)?.destroy(),this.mediaSources.delete(t),o.type==="raster-dem"){let i=new dn({url:o.url??"",encoding:o.encoding??"mapbox",minzoom:o.minzoom??0,maxzoom:o.maxzoom??10});return i.on("data",()=>this.triggerRepaint()),i.on("error",({message:a})=>this.emit("error",{message:a})),this.demSources.set(t,i),this.syncTerrain(),this.triggerRepaint(),this}if(o.type==="image"||o.type==="video"||o.type==="canvas"){let i=new mn({kind:o.type,url:o.url,canvas:o.canvas,coordinates:o.coordinates,animate:o.animate});return i.on("data",()=>this.triggerRepaint()),i.on("error",({message:a})=>this.emit("error",{message:a})),this.mediaSources.set(t,i),this.renderer.mediaSources=this.mediaSources,this.triggerRepaint(),this}if(o.type==="geojson"){let i=new bn(this.pool,{data:o.data,sourceLayer:o.sourceLayer,cluster:o.cluster,clusterRadius:o.clusterRadius,clusterMaxZoom:o.clusterMaxZoom,minzoom:o.minzoom??0,maxzoom:o.maxzoom??18,cacheSize:this.quality.tileCacheSize,plan:this.planFor(t)});return i.on("data",()=>this.triggerRepaint()),i.on("error",({message:a})=>this.emit("error",{message:a})),this.sources.set(t,i),this.triggerRepaint(),this}if(o.type==="raster"){let i=new hn({url:o.url??"",minzoom:o.minzoom??0,maxzoom:o.maxzoom??19,cacheSize:this.quality.tileCacheSize*2});return i.setTransformRequest(this.transformRequest),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 ir(this.pool,{url:o.url??"",minzoom:o.minzoom??0,maxzoom:o.maxzoom??14,cacheSize:this.quality.tileCacheSize*2,plan:this.planFor(t),rank:t===De?0:1});return r.setTransformRequest(this.transformRequest),r.on("data",()=>this.triggerRepaint()),r.on("error",({message:i})=>{this.emit("error",{message:i}),this.triggerRepaint();}),t===De&&r.on("idle",()=>this.emit("idle",void 0)),this.sources.set(t,r),this.triggerRepaint(),this}initInput(){this.gestures=new zn(this.canvas,this.transform,t=>{this.animation=null,t==="zoom"&&this.emit("zoom",void 0),this.emitMove(),this.triggerRepaint();},()=>this.emit("moveend",void 0),this.options.gestures),this.initClicks(),this.initHash();}initClicks(){let t=null;this.canvas.addEventListener("pointerdown",r=>{r.button===0&&(t={x:r.clientX,y:r.clientY,t:performance.now()});}),this.canvas.addEventListener("pointerup",r=>{let i=t;if(t=null,r.button!==0||!i||Math.hypot(r.clientX-i.x,r.clientY-i.y)>4||performance.now()-i.t>500)return;let a=this.canvas.getBoundingClientRect(),s={x:r.clientX-a.left,y:r.clientY-a.top},l=this.objects.hitTest(this.transform,s),c=l?null:this.queryRoom(s),f=l||c?null:this.queryBuilding(s);this.options.highlightBuildings!==false&&(this.setHighlight(f),this.setRoomHighlight(c));for(let u of this.getPopups())u.closeOnClick&&this.removePopup(u);this.emit("click",{point:s,lngLat:this.transform.unproject(s),object:l,building:f,symbol:this.querySymbol(s,4)});}),this.canvas.addEventListener("dblclick",r=>{let i=this.pointOf(r);this.emit("dblclick",{point:i,lngLat:this.transform.unproject(i)});}),this.canvas.addEventListener("contextmenu",r=>{r.preventDefault();let i=this.pointOf(r);this.emit("contextmenu",{point:i,lngLat:this.transform.unproject(i)});});let o=0;this.canvas.addEventListener("pointermove",r=>{if(r.pointerType==="touch")return;let i=performance.now();if(i-o<16)return;o=i;let a=this.pointOf(r),s=this.querySymbol(a);this.setSymbolHover(s),this.emit("mousemove",{point:a,lngLat:this.transform.unproject(a),object:this.objects.hitTest(this.transform,a),symbol:s});});}pointOf(t){let o=this.canvas.getBoundingClientRect();return {x:t.clientX-o.left,y:t.clientY-o.top}}initResize(){this.resizeObserver=new ResizeObserver(()=>this.resize()),this.resizeObserver.observe(this.container),this.resize();}resize(){if(this.destroyed)return;let t=this.container.clientWidth||1,o=this.container.clientHeight||1,r=Aa(t,o,Math.min(window.devicePixelRatio||1,this.maxPixelRatio),this.densityQuality);this.pixelRatio=r,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=Pe(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=Pe(t.center)),t.zoom!==void 0&&(o.zoom=t.zoom),t.bearing!==void 0&&(o.bearing=t.bearing),t.pitch!==void 0&&(o.pitch=t.pitch),this.animation=null,this.afterCameraChange()}easeTo(t){let o=t.duration??0;if(o<=0)return this.jumpTo(t);let r=this.transform,i={center:r.center,zoom:r.zoom,bearing:r.bearing,pitch:r.pitch},s={center:t.center!==void 0?Pe(t.center):r.center,zoom:t.zoom??r.zoom,bearing:i.bearing+$t((t.bearing??r.bearing)-i.bearing),pitch:t.pitch??r.pitch};return this.animation={start:performance.now(),duration:o,from:i,to:s},this.triggerRepaint(),this}flyTo(t){let o=this.transform,r={center:o.center,zoom:o.zoom,bearing:o.bearing,pitch:o.pitch},a={center:t.center!==void 0?Pe(t.center):o.center,zoom:t.zoom??o.zoom,bearing:r.bearing+$t((t.bearing??o.bearing)-r.bearing),pitch:t.pitch??o.pitch},s=eo(r.zoom),l=(Oe(a.center.lng)-Oe(r.center.lng))*s,c=(Ge(a.center.lat)-Ge(r.center.lat))*s,f=Math.hypot(l,c),u=Math.max(o.width,o.height),h=u*Math.pow(2,r.zoom-a.zoom),d=1.42,m=d*d,p,b=null;if(f<1e-6){let y=Math.log(h/u);p=Math.abs(y)/d,b=A=>({u:0,w:u*Math.exp(d*Math.sign(y)*A)});}else {let y=B=>{let _=B===0?u:h,T=B===0?h:u;return (T*T-_*_+(B===0?1:-1)*m*m*f*f)/(2*_*m*f)},A=B=>Math.log(-y(B)+Math.sqrt(y(B)*y(B)+1)),x=A(0);p=(A(1)-x)/d;let w=B=>(Math.exp(B)+Math.exp(-B))/2,C=B=>(Math.exp(2*B)-1)/(Math.exp(2*B)+1);b=B=>{let _=d*B+x;return {u:u*w(x)*C(_)/m-u*Math.sinh(x)/m,w:u*w(x)/w(_)}};}if(!Number.isFinite(p)||p<=0)return this.jumpTo(t);let g=t.duration??Math.min(3e3,p/1.2*1e3);return this.animation={start:performance.now(),duration:g,from:r,to:a,fly:{S:p,u1:f,curve:b,w0:u}},this.triggerRepaint(),this}setPadding(t){return this.padding=Xd(t),this.renderer.symbols&&(this.renderer.symbols.padding=this.padding),this.triggerRepaint(),this}getPadding(){return {...this.padding}}getBounds(){let t=this.transform,o=new Do;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=ca(t,{width:r.width,height:r.height,bearing:o.bearing??r.bearing,padding:o.padding!==void 0?Xd(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)}panBy(t,o={}){let r=this.transform.unproject({x:this.transform.width/2+t[0],y:this.transform.height/2+t[1]});return this.panTo(r,o)}panTo(t,o={}){return this.easeTo({...o,center:t,duration:o.duration??500})}zoomTo(t,o={}){return this.easeTo({...o,zoom:t,duration:o.duration??300})}zoomIn(t={}){return this.zoomTo(this.snapZoom(this.transform.zoom+1),t)}zoomOut(t={}){return this.zoomTo(this.snapZoom(this.transform.zoom-1),t)}rotateTo(t,o={}){return this.easeTo({...o,bearing:t,duration:o.duration??500})}resetNorth(t={}){return this.rotateTo(0,{...t,duration:t.duration??1e3})}resetNorthPitch(t={}){return this.easeTo({...t,bearing:0,pitch:0,duration:t.duration??1e3})}snapToNorth(t={}){return Math.abs($t(this.transform.bearing))<=this.bearingSnap?this.resetNorth(t):this}stop(){return this.animation=null,this}isEasing(){return this.animation!==null}isMoving(){return this.isEasing()||(this.gestures?.moving??false)}isZooming(){let t=this.animation;return t!==null&&t.from.zoom!==t.to.zoom||(this.gestures?.zooming??false)}isRotating(){let t=this.animation;return t!==null&&t.from.bearing!==t.to.bearing||(this.gestures?.rotating??false)}getMinZoom(){return this.transform.minZoom}setMinZoom(t){return this.transform.minZoom=t,this.transform.zoom=this.transform.zoom,this.afterCameraChange()}getMaxZoom(){return this.transform.maxZoom}setMaxZoom(t){return this.transform.maxZoom=t,this.transform.zoom=this.transform.zoom,this.afterCameraChange()}getMinPitch(){return this.transform.minPitch}setMinPitch(t){return this.transform.minPitch=t,this.transform.pitch=this.transform.pitch,this.afterCameraChange()}getMaxPitch(){return this.transform.maxPitch}setMaxPitch(t){return this.transform.maxPitch=t,this.transform.pitch=this.transform.pitch,this.afterCameraChange()}getMaxBounds(){return this.transform.maxBounds}setMaxBounds(t){return this.transform.maxBounds=t,this.transform.center=this.transform.center,this.afterCameraChange()}getZoomSnap(){return this.zoomSnap}setZoomSnap(t){return this.zoomSnap=Math.max(t,0),this}getVerticalFieldOfView(){return this.transform.fov}setVerticalFieldOfView(t){return this.transform.fov=t,this.afterCameraChange()}getCenterElevation(){return this.transform.centerElevation}setCenterElevation(t){return this.transform.centerElevation=t,this.afterCameraChange()}getCameraTargetElevation(){return this.transform.centerElevation}getContainer(){return this.container}getCanvas(){return this.canvas}getCanvasContainer(){return this.canvas.parentElement??this.container}getPixelRatio(){return this.pixelRatio}setPixelRatio(t){return this.maxPixelRatio=t>0?t:window.devicePixelRatio||1,this.resize(),this}redraw(){return this.triggerRepaint(),this}remove(){this.destroy();}loaded(){return this.isLoaded&&this.areTilesLoaded()}areTilesLoaded(){for(let t of this.sources.keys())if(this.sourceDrawn(t,this.transform.zoom)&&!this.isSourceLoaded(t))return false;return true}isSourceLoaded(t){let o=this.sources.get(t);if(!o)return false;for(let r of o.visibleTiles)if(o.getTile(r)?.state==="loading")return false;return true}fitScreenCoordinates(t,o,r=this.transform.bearing,i={}){let a=Do.from([this.transform.unproject(t),this.transform.unproject(o)]);return this.fitBounds(a,{...i,bearing:r})}calculateCameraOptionsFromTo(t,o,r,i=0){let a=this.transform,s=Pe(t),l=Pe(r),c=y=>1/(40075016686e-3*Math.max(Math.abs(Math.cos(y*Math.PI/180)),1e-6)),f=Oe(l.lng)-Oe(s.lng),u=Ge(l.lat)-Ge(s.lat),h=i*c(l.lat)-o*c(s.lat),d=Math.hypot(f,u,h);if(d===0)return {center:l,zoom:a.zoom,bearing:a.bearing,pitch:a.pitch,elevation:i};let m=Math.hypot(f,u),p=Math.log2(a.cameraToCenterDistance/d/512),b=Math.atan2(f,-u)*180/Math.PI,g=Math.acos(Math.min(m/d,1))*180/Math.PI;return g=h<0?90-g:90+g,{center:l,zoom:p,bearing:b,pitch:g,elevation:i}}trimTileMemory(){let t=this.quality.tileMemoryBudget;if(t<=0)return;let o=0;for(let r of this.sources.values())o+=r.retainedBytes;for(;o>t;){let r=[...this.sources.values()].sort((a,s)=>s.retainedBytes-a.retainedBytes),i=false;for(let a of r){let s=a.dropOldest();if(!(s<0)){o-=s,i=true;break}}if(!i)return}}snapZoom(t){return this.zoomSnap<=0?t:Math.round(t/this.zoomSnap)*this.zoomSnap}stepAnimation(t){let o=this.animation;if(!o)return false;let r=nt((t-o.start)/o.duration,0,1),i=o.fly?r:Dn(r),a=this.transform,s=Pe(o.from.center),l=Pe(o.to.center);if(o.fly){let{u:c,w:f}=o.fly.curve(o.fly.S*r),u=o.fly.u1>1e-6?nt(c/o.fly.u1,0,1):r;return a.center={lng:s.lng+(l.lng-s.lng)*u,lat:s.lat+(l.lat-s.lat)*u},a.zoom=o.from.zoom+Math.log2(o.fly.w0/f),a.bearing=o.from.bearing+(o.to.bearing-o.from.bearing)*Dn(r),a.pitch=o.from.pitch+(o.to.pitch-o.from.pitch)*Dn(r),r>=1&&(a.center=l,a.zoom=o.to.zoom),this.emitMove(),r>=1?(this.animation=null,this.emit("moveend",void 0),false):true}return a.center={lng:s.lng+(l.lng-s.lng)*i,lat:s.lat+(l.lat-s.lat)*i},a.zoom=o.from.zoom+(o.to.zoom-o.from.zoom)*i,a.bearing=o.from.bearing+(o.to.bearing-o.from.bearing)*i,a.pitch=o.from.pitch+(o.to.pitch-o.from.pitch)*i,this.emitMove(),r>=1?(this.animation=null,this.emit("moveend",void 0),false):true}afterCameraChange(){return this.applyCameraHooks(),this.emitMove(),this.triggerRepaint(),this}applyCameraHooks(){if(!this.inCameraHooks&&!(!this.cameraUpdate&&!this.transformConstrain)){this.inCameraHooks=true;try{let t=this.transform;if(this.cameraUpdate){let o=this.cameraUpdate({center:t.center,zoom:t.zoom,bearing:t.bearing,pitch:t.pitch});o&&(o.center!==void 0&&(t.center=Pe(o.center)),o.zoom!==void 0&&(t.zoom=o.zoom),o.bearing!==void 0&&(t.bearing=o.bearing),o.pitch!==void 0&&(t.pitch=o.pitch));}if(this.transformConstrain){let o=this.transformConstrain({center:t.center,zoom:t.zoom});o&&(o.center!==void 0&&(t.center=Pe(o.center)),o.zoom!==void 0&&(t.zoom=o.zoom));}}finally{this.inCameraHooks=false;}}}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(Pe(t),o)}unproject(t){return this.transform.unproject(t)}get style(){return this._style}setStyle(t){let o=this._style,r=new Xo(this.applyLayerEdits(t));Object.assign(r.splitValues,o.splitValues),this._style=r,this.applyLayerOverrides();for(let[i,a]of this.sources.entries()){let s=JSON.stringify(o.workerPlan(i)),l=JSON.stringify(r.workerPlan(i));s!==l&&a.setPlan(this.planFor(i,r));}return this.syncTerrain(),this.objects3d?.setModelKey(t.model3dKey??""),this.triggerRepaint(),this}addLayer(t,o){if(t.type==="custom"){let r=t;return this.renderer.customLayers.some(i=>i.layer.id===r.id)?this:(this.renderer.customLayers.push({layer:r,before:o}),this.ctx&&r.onAdd?.(this,this.ctx.gl),this.triggerRepaint(),this)}return this.layerEdits.push({kind:"add",layer:t,before:o}),this.setStyle(this._style.spec)}removeLayer(t){let o=this.renderer.customLayers.findIndex(r=>r.layer.id===t);if(o>=0){let[r]=this.renderer.customLayers.splice(o,1);return this.ctx&&r.layer.onRemove?.(this,this.ctx.gl),this.triggerRepaint(),this}return this.layerEdits.push({kind:"remove",id:t}),this.layerOverrides.delete(t),this.setStyle(this._style.spec)}moveLayer(t,o){return this.layerEdits.push({kind:"move",id:t,before:o}),this.setStyle(this._style.spec)}getLayer(t){return this._style.spec.layers.find(o=>o.id===t)??this.renderer.customLayers.find(o=>o.layer.id===t)?.layer}getLayersOrder(){return this._style.spec.layers.map(t=>t.id)}setLayerZoomRange(t,o,r){return this.layerEdits.push({kind:"zoom",id:t,minzoom:o,maxzoom:r}),this.setStyle(this._style.spec)}getFilter(t){let o=this.getLayer(t);return o&&"filter"in o?o.filter:void 0}setFilter(t,o){return this.layerEdits.push({kind:"filter",id:t,filter:o}),this.setStyle(this._style.spec)}getStyle(){return structuredClone(this._style.spec)}isStyleLoaded(){return true}getLight(){return this._style.light}setTerrain(t){let o={...this._style.spec};return t?o.terrain=t:delete o.terrain,this.setStyle(o),this}getTerrain(){return this._style.spec.terrain??null}getSource(t){return this.sources.get(t)??this.rasterSources.get(t)??this.demSources.get(t)??this.mediaSources.get(t)}removeSource(t){let o=this.sources.get(t);o&&(o.destroy(),this.sources.delete(t));let r=this.rasterSources.get(t);r&&(r.destroy(),this.rasterSources.delete(t));let i=this.demSources.get(t);i&&(this.demSources.delete(t),this.syncTerrain());let a=this.mediaSources.get(t);return a&&(a.destroy(),this.mediaSources.delete(t)),(o||r||i||a)&&this.triggerRepaint(),this}refreshTiles(t){return this.refreshSource(t)}getRoll(){return this.transform.roll}setRoll(t){return this.transform.roll=t,this.afterCameraChange()}applyLayerEdits(t){if(!this.layerEdits.length)return t;let o=[...t.layers],r=i=>i===void 0?o.length:o.findIndex(a=>a.id===i);for(let i of this.layerEdits){if(i.kind==="add"){let s=structuredClone(i.layer),l=o.findIndex(c=>c.id===s.id);if(l>=0)o[l]=s;else {let c=r(i.before);o.splice(c<0?o.length:c,0,s);}continue}let a=o.findIndex(s=>s.id===i.id);if(!(a<0)){if(i.kind==="remove")o.splice(a,1);else if(i.kind==="move"){let[s]=o.splice(a,1),l=r(i.before);o.splice(l<0?o.length:l,0,s);}else if(i.kind==="zoom"){let s={...o[a]};i.minzoom===void 0?delete s.minzoom:s.minzoom=i.minzoom,i.maxzoom===void 0?delete s.maxzoom:s.maxzoom=i.maxzoom,o[a]=s;}else if(i.kind==="filter"){let s={...o[a]};i.filter===void 0||i.filter===null?delete s.filter:s.filter=i.filter,o[a]=s;}}}return {...t,layers:o}}queryRenderedFeatures(t,o={}){let r=t??[{x:0,y:0},{x:this.transform.width,y:this.transform.height}];return tl(this.transform,this.sources,this._style.layers,r,o,(i,a,s)=>this.featureStateOf(i,a,s))}querySourceFeatures(t,o={}){let r=this.sources.get(t);return r?ol(r,t,o,(i,a,s)=>this.featureStateOf(i,a,s)):[]}setFeatureState(t,o){let r=Kd(t.source,t.sourceLayer??"",t.id);return this.featureStates.set(r,{...this.featureStates.get(r)??{},...o}),this.triggerRepaint(),this}getFeatureState(t){return this.featureStateOf(t.source,t.sourceLayer??"",t.id)}removeFeatureState(t,o){let r=`${t.source}\u241F${t.sourceLayer??""}\u241F`;if(t.id===void 0)for(let i of [...this.featureStates.keys()])i.startsWith(r)&&this.featureStates.delete(i);else if(o===void 0)this.featureStates.delete(r+t.id);else {let i=this.featureStates.get(r+t.id);i&&delete i[o];}return this.triggerRepaint(),this}queryTerrainElevation(t){if(!this.renderer.terrain.enabled)return null;let o=Pe(t);return this.renderer.terrain.heightAt(o.lng,o.lat)}setCenterClampedToGround(t){return this.centerClamped=t,this.triggerRepaint(),this}getCenterClampedToGround(){return this.centerClamped}featureStateOf(t,o,r){let i=this.featureStates.get(Kd(t,o,r));return i?{...i}:{}}addImage(t,o,r={}){let i=this.renderer.symbols?.images;return i?i.add(t,o,r)?(this.triggerRepaint(),this):(console.warn(`[osmgl] \u043A\u0430\u0440\u0442\u0438\u043D\u043A\u0430 \xAB${t}\xBB \u0443\u0436\u0435 \u0435\u0441\u0442\u044C \u2014 \u0434\u043B\u044F \u0437\u0430\u043C\u0435\u043D\u044B \u043D\u0443\u0436\u0435\u043D updateImage`),this):this}updateImage(t,o,r={}){return this.renderer.symbols?.images.update(t,o,r)&&this.triggerRepaint(),this}removeImage(t){return this.renderer.symbols?.images.remove(t)&&this.triggerRepaint(),this}hasImage(t){return this.renderer.symbols?.images.has(t)??false}getImage(t){return this.renderer.symbols?.images.get(t)}listImages(){return this.renderer.symbols?.images.list()??[]}setMissingStyleImageResolver(t){return this.renderer.symbols?.setMissingImage(t),this}async setSprite(t){for(let[o,r]of [...this.spriteImages])r===""&&this.removeImage(o);return this.spriteImages.clear(),this.spriteUrl=t,t&&await this.loadSprite("",t),this}getSprite(){let t=this.spriteUrl?[{id:"",url:this.spriteUrl}]:[];for(let[o,r]of this.extraSprites)t.push({id:o,url:r});return t}async addSprite(t,o){return this.extraSprites.set(t,o),await this.loadSprite(t,o),this}removeSprite(t){for(let[o,r]of [...this.spriteImages])r===t&&(this.removeImage(o),this.spriteImages.delete(o));return this.extraSprites.delete(t),this}getGlyphs(){return this.glyphsUrl}setGlyphs(t){return this.glyphsUrl=t,this.renderer.symbols?.setGlyphsUrl(t),this.triggerRepaint(),this}async loadSprite(t,o){let r=Math.min(Math.round(window.devicePixelRatio||1),2),i=r>1?`@${r}x`:"";try{let[a,s]=await Promise.all([fetch(`${o}${i}.json`).then(f=>f.json()),bA(`${o}${i}.png`)]),l=document.createElement("canvas");l.width=s.width,l.height=s.height;let c=l.getContext("2d",{willReadFrequently:!0});if(!c)return;c.drawImage(s,0,0);for(let[f,u]of Object.entries(a)){if(u.width<=0||u.height<=0)continue;let h=c.getImageData(u.x,u.y,u.width,u.height),d=t?`${t}:${f}`:f,m={width:u.width,height:u.height,data:h.data},p={pixelRatio:u.pixelRatio??r,sdf:u.sdf??!1};this.hasImage(d)?this.updateImage(d,m,p):this.addImage(d,m,p),this.spriteImages.set(d,t);}this.triggerRepaint();}catch(a){console.warn(`[osmgl] \u0441\u043F\u0440\u0430\u0439\u0442 \xAB${o}\xBB \u043D\u0435 \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u043B\u0441\u044F:`,a instanceof Error?a.message:a);}}addControl(t,o){return this.controls.add(t,this,o),this}removeControl(t){return this.controls.remove(t,this),this}hasControl(t){return this.controls.has(t)}get dragPan(){return this.handlers.dragPan}get dragRotate(){return this.handlers.dragRotate}get scrollZoom(){return this.handlers.scrollZoom}get doubleClickZoom(){return this.handlers.doubleClickZoom}get touchZoomRotate(){return this.handlers.touchZoomRotate}get touchPitch(){return this.handlers.touchPitch}get keyboard(){return this.handlers.keyboard}get boxZoom(){return this.handlers.boxZoom}get cooperativeGestures(){return this.handlers.cooperative}static addProtocol(t,o){Wi.set(t,o);}static removeProtocol(t){Wi.delete(t);}setTransformRequest(t){this.transformRequest=t;for(let o of this.sources.values())o.setTransformRequest(t);for(let o of this.rasterSources.values())o.setTransformRequest(t);return this}setTransformCameraUpdate(t){return this.cameraUpdate=t,this}setTransformConstrain(t){return this.transformConstrain=t,this}setSourceTileLodParams(t,o){let r=this.sources.get(t)??this.rasterSources.get(t);return r?(r.setLodParams(o),this.triggerRepaint(),this):this}setGlobalStateProperty(t,o){return o==null?delete xo[t]:xo[t]=o,this.triggerRepaint(),this}getGlobalState(){return {...xo}}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(t){return this.transform.renderWorldCopies=t,this.triggerRepaint(),this}setTheme(t){return this.setStyle(Nr(t,this.options.style))}setBaseStyle(t,o){this.options.style=t;for(let[r,i]of Object.entries(t.sources??{}))this.sources.has(r)||this.rasterSources.has(r)||this.demSources.has(r)||this.addSource(r,i);return this.setStyle(o===void 0?t:Nr(o,t)),this.syncTerrain(),this}static get themes(){return Object.keys(je)}static get themeList(){return Object.entries(je).map(([t,o])=>({id:t,name:o.name||t}))}setLayoutProperty(t,o,r){let i=this._style.layers.find(s=>s.id===t);if(!i)return console.warn(`[osmgl] \u0441\u043B\u043E\u0439 \u0441\u0442\u0438\u043B\u044F "${t}" \u043D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D`),this;let a=i.layout??(i.layout={});if(a[o]=r,this.rememberOverride(t,{layout:{[o]:r}}),o==="textField"||o==="iconImage"||o==="splitBy")for(let[s,l]of this.sources)l.setPlan(this.planFor(s));return this.triggerRepaint(),this}setPaintProperty(t,o,r){let i=this._style.layers.find(s=>s.id===t);if(!i)return console.warn(`[osmgl] \u0441\u043B\u043E\u0439 \u0441\u0442\u0438\u043B\u044F "${t}" \u043D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D`),this;let a=JSON.stringify(jt(i)??null);if(i.paint[o]=r,this.rememberOverride(t,{paint:{[o]:r}}),JSON.stringify(jt(i)??null)!==a)for(let[s,l]of this.sources)l.setPlan(this.planFor(s));return this.triggerRepaint(),this}setDebugTiles(t){return this.renderer.debugTiles=t,this.triggerRepaint(),this}setShadows(t){let o=typeof t=="boolean"?{enabled:t}:t;return Object.assign(this.renderer.shadows,o),this.triggerRepaint(),this}querySymbol(t,o=2){let r=this.renderer.symbols?.querySymbol(t,o);return r?{layerId:r.layerId,text:r.text,icon:r.icon,lngLat:{lng:ut(r.mercX),lat:ct(r.mercY)},key:nr.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??De);if(!i)continue;let a=Ss(this.transform,i,r.id,t,this.groundAt);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 fe,i;for(let s of this._style.layers){if(s.type!=="fill"||!s.id.startsWith("indoor-")||s.id==="indoor-shell"||!this._style.layerVisibleAt(s,this.transform.zoom))continue;let l=this._style.bucketKeyFor(s);l&&(o.push(l),r.set(l,s.id),i??(i=this.sources.get(s.source??De)));}if(!i||!o.length)return null;let a=Fs(this.transform,i,o,t,this.groundAt);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=il({center:t.center,zoom:t.zoom,bearing:t.bearing,pitch:t.pitch},this.hashName);this.writingHash=true,ad("#"+o),setTimeout(()=>this.writingHash=false,0);}applyHash(t){if(typeof window>"u")return;let o=al(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"?Un(Kn()):t;return this.governor.reset(o,o),this.applyQuality(po(o)),this}getQuality(){return {auto:this.qualityAuto,profile:{...this.quality},pixelRatio:this.transform.width>0?this.canvas.width/this.transform.width:1}}applyRendererQuality(t){this.renderer.detailScale=t.detail,this.renderer.uploadBudget=t.uploadBudget,this.renderer.seams.budget=t.seamBudget,this.renderer.allowShadows=t.allowShadows;}applyQuality(t,o=false){let r=this.quality.simpleGeometry,i=o?r:t.simpleGeometry;if(this.quality={...t,simpleGeometry:i},this.objects3d&&(this.objects3d.budgetScale=t.modelBudget),r!==i)for(let[a,s]of this.sources.entries())s.setPlan(this.planFor(a));o||(this.densityQuality=t,this.options.maxPixelRatio===void 0&&(this.maxPixelRatio=t.maxPixelRatio)),this.applyRendererQuality(t),this.renderer.shadows.resolution!==t.shadowMapSize&&this.setShadows({resolution:t.shadowMapSize});for(let a of this.sources.values())a.setCoverOptions({detailBias:t.detailBias,maxTiles:t.maxTiles});this.resize();}checkFrameBudget(t){if(!this.qualityAuto)return;let o=this.governor.frame(t,this.sum(i=>i.pendingCount)>0);if(!o)return;let r=`${(o.share*100).toFixed(0)}%`;console.info(o.direction==="down"?`[osmgl] \u0442\u044F\u0436\u0451\u043B\u044B\u0445 \u043A\u0430\u0434\u0440\u043E\u0432 ${r} \u2014 \u043A\u0430\u0447\u0435\u0441\u0442\u0432\u043E \u043F\u043E\u043D\u0438\u0436\u0435\u043D\u043E \u0434\u043E \xAB${o.to}\xBB (\u043F\u043B\u043E\u0442\u043D\u043E\u0441\u0442\u044C \u0431\u0443\u0444\u0435\u0440\u0430 \u043F\u0440\u0435\u0436\u043D\u044F\u044F, \u043F\u043E\u0442\u043E\u043B\u043E\u043A \xAB${this.governor.limit}\xBB)`:`[osmgl] \u043A\u0430\u0434\u0440\u044B \u0443\u043A\u043B\u0430\u0434\u044B\u0432\u0430\u044E\u0442\u0441\u044F \u0432 \u0431\u044E\u0434\u0436\u0435\u0442 \u2014 \u043A\u0430\u0447\u0435\u0441\u0442\u0432\u043E \u043F\u043E\u0434\u043D\u044F\u0442\u043E \u0434\u043E \xAB${o.to}\xBB`),this.applyQuality(po(o.to),true);}getShadows(){return {...this.renderer.shadows}}setSky(t){let o=typeof t=="boolean"?{enabled:t}:t;return Object.assign(this._style.sky,o),this.triggerRepaint(),this}getSky(){return {...this._style.sky}}setLight(t){return Object.assign(this._style.light,t),this.triggerRepaint(),this}setLayerVisible(t,o){let r=this._style.layers.find(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=Ve(t),this.triggerRepaint(),this}getIndoorLevels(){let t=[];for(let[o,r]of this.sources.entries())if(this._style.layers.some(i=>(i.source??De)===o&&"splitBy"in i&&i.splitBy===cr))for(let i of r.splitValues(cr)){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[cr];return typeof t=="number"?t:null}setIndoorLevel(t){return t===null?delete this._style.splitValues[cr]:this._style.splitValues[cr]=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 xn)}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,hr):o.maxPitch,a=o.zoom<r,s=o.pitch>i;return a||s?this.easeTo({zoom:a?r:o.zoom,pitch:s?i:o.pitch,duration:600}):(this.emit("move",void 0),this.triggerRepaint()),this}getProjection(){return this.transform.projection}refreshSource(t){return this.sources.get(t)?.reload(),this.rasterSources.get(t)?.reload(),this.triggerRepaint(),this}refresh(){for(let t of this.sources.values())t.reload();for(let t of this.rasterSources.values())t.reload();return this.renderer.refreshHighlight(),this.triggerRepaint(),this}sum(t){let o=0;for(let r of this.sources.values())o+=t(r);return o}getStats(){return {pendingTiles:this.sum(t=>t.pendingCount),visibleTiles:this.sum(t=>t.visibleTiles.length),labels:this.renderer.symbols?.placedCount??0,models:this.renderer.models.readyCount,workers:this.pool.usingWorkers?this.pool.size:0,renderer:this.ctx?.caps.rendererName??"\u043D\u0435\u0442 \u043A\u043E\u043D\u0442\u0435\u043A\u0441\u0442\u0430"}}triggerRepaint(){this.destroyed||(this.needsRepaint=true,!this.frameHandle&&(this.frameHandle=requestAnimationFrame(t=>{this.frameHandle=0,this.renderFrame(t);})));}debugFloatPixels(t,o,r,i){let a=this.ctx;if(!a||!a.caps.colorBufferFloat)return null;let s=a.gl,l=this.canvas.width,c=this.canvas.height,f=!!s.getExtension("EXT_float_blend"),u=f?s.RGBA32F:s.RGBA16F,h=f?s.FLOAT:s.HALF_FLOAT;if(this.debugFB&&(this.debugFB.w!==l||this.debugFB.h!==c)&&(s.deleteFramebuffer(this.debugFB.fb),s.deleteTexture(this.debugFB.tex),s.deleteRenderbuffer(this.debugFB.rb),this.debugFB=null),!this.debugFB){let d=s.createTexture(),m=s.createFramebuffer(),p=s.createRenderbuffer();if(!d||!m||!p)return null;s.bindTexture(s.TEXTURE_2D,d),s.texImage2D(s.TEXTURE_2D,0,u,l,c,0,s.RGBA,h,null),s.texParameteri(s.TEXTURE_2D,s.TEXTURE_MIN_FILTER,s.NEAREST),s.texParameteri(s.TEXTURE_2D,s.TEXTURE_MAG_FILTER,s.NEAREST),s.bindTexture(s.TEXTURE_2D,null),s.bindRenderbuffer(s.RENDERBUFFER,p),s.renderbufferStorage(s.RENDERBUFFER,s.DEPTH24_STENCIL8,l,c),s.bindRenderbuffer(s.RENDERBUFFER,null),s.bindFramebuffer(s.FRAMEBUFFER,m),s.framebufferTexture2D(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0,s.TEXTURE_2D,d,0),s.framebufferRenderbuffer(s.FRAMEBUFFER,s.DEPTH_STENCIL_ATTACHMENT,s.RENDERBUFFER,p);let b=s.checkFramebufferStatus(s.FRAMEBUFFER);if(s.bindFramebuffer(s.FRAMEBUFFER,null),a.invalidateState(),b!==s.FRAMEBUFFER_COMPLETE)return null;this.debugFB={fb:m,tex:d,rb:p,w:l,h:c};}a.screen=this.debugFB.fb;try{this.renderFrame(performance.now()),a.bindFramebuffer(this.debugFB.fb);let d=new Float32Array(r*i*4);return s.readPixels(t,o,r,i,s.RGBA,s.FLOAT,d),{data:d,format:f?"rgba32f":"rgba16f"}}finally{a.screen=null,this.triggerRepaint();}}renderFrame(t){if(this.destroyed||!this.ctx)return;let o=performance.now();this.needsRepaint=false;let r=this.stepAnimation(t),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,m]of this.sources)this.sourceDrawn(d,this.transform.zoom)?m.update(this.transform):m.deactivate();this.trimTileMemory(),this.updateObjects3D();for(let[d,m]of this.rasterSources)this.rasterLayerVisible(d)&&m.update(this.transform);if(this.renderer.terrain.enabled){for(let b of this.demSources.values())b.update(this.transform);let d=this.transform.center,m=this.centerClamped?this.renderer.terrain.heightAt(d.lng,d.lat):this.transform.centerElevation,p=this.transform.centerElevation;this.transform.centerElevation=Math.abs(m-p)<.5?m:p+(m-p)*.25;}else this.transform.centerElevation!==0&&(this.transform.centerElevation=0);this.syncIndoor(),this.objects.updateMarkers(this.transform);let a=(this.sources.size>0||this.rasterSources.size>0)&&this.renderer.render(i,this.transform,this.sources,this._style,t,this.rasterSources),s=performance.now()-o,l=r||a||this.needsRepaint,c=this.lastFrameAt>0?t-this.lastFrameAt:0,f=c>0&&c<pA,u=f?c:0;this.continuousFrames=f?this.continuousFrames+1:0;let h=this.continuousFrames>1?c:s;this.lastFrameAt=t,this.checkFrameBudget(h),this.emit("render",{frameMs:s,intervalMs:u}),l&&this.triggerRepaint(),this.scheduleRetryWake(t);}scheduleRetryWake(t){let o=1/0;for(let i of this.sources.values())o=Math.min(o,i.nextRetryIn);if(!Number.isFinite(o))return;let r=t+o;r>=this.retryTimerAt||(this.retryTimer&&clearTimeout(this.retryTimer),this.retryTimerAt=r,this.retryTimer=setTimeout(()=>{this.retryTimer=0,this.retryTimerAt=1/0,this.triggerRepaint();},o));}stopFrameLoop(){this.frameHandle&&cancelAnimationFrame(this.frameHandle),this.frameHandle=0,this.retryTimer&&clearTimeout(this.retryTimer),this.retryTimer=0,this.retryTimerAt=1/0;}get isLoaded(){return this.ready}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();for(let t of this.demSources.values())t.destroy();this.demSources.clear(),this.objects.destroy(),this.controls.destroy(this),this.handlers.boxZoom.destroy(),this.handlers.cooperative.destroy(),this.markerHost?.remove(),this.pool.destroy(),this.ctx&&this.renderer.destroy(this.ctx),this.removeAllListeners(),this.canvas.remove();}}},WE=Rl;
2848
2848
  exports.AssetLoader=gn;exports.AttributionControl=Bl;exports.BASE_SOURCE=De;exports.BUILDING_HEIGHT_SCALE=Go;exports.BUILDING_POS_SCALE=Xt;exports.BUILDING_VERTEX_STRIDE=rt;exports.BoxZoomHandler=mr;exports.CITY_STYLE=R1;exports.Circle=Tl;exports.CooperativeGesturesHandler=pr;exports.DATA_PAINT_STRIDE=ao;exports.DEFAULT_ICONS=Mo;exports.DEFAULT_LIGHT=ms;exports.DEFAULT_SHADOWS=_h;exports.DEFAULT_SKY=ds;exports.DEFAULT_STYLE=vi;exports.DemSource=dn;exports.DemTile=jr;exports.DemTileEntry=Ki;exports.DepthTarget=Vr;exports.EARTH_CIRCUMFERENCE=kn;exports.FILL_VERTEX_STRIDE=Ft;exports.FeaturePaint=gi;exports.FullscreenControl=Ml;exports.GLOBE_MAX_PITCH=hr;exports.GLOBE_ZOOM_MAX=mo;exports.GLOBE_ZOOM_MIN=Pn;exports.GLYPH_BORDER=Ke;exports.GLYPH_SIZE=Gt;exports.GROUND_SCALE=V0;exports.GeoJSONSource=bn;exports.GeolocateControl=_l;exports.GeomType=Lo;exports.GestureHandler=Et;exports.GlobeControl=Sl;exports.GlyphSource=nn;exports.GroundArrows=Xr;exports.IconSource=sn;exports.ImageManager=rn;exports.IndoorMask=Jr;exports.LEVEL_LIMIT=a0;exports.LINE_VERTEX_STRIDE=bt;exports.LayerRenderer=tn;exports.LngLatBounds=Do;exports.LogoControl=Fl;exports.MAX_GRADE=nA;exports.MAX_LATITUDE=Wl;exports.MESH_BOTTOM=lr;exports.MESH_ISLAND=zd;exports.MESH_KERB_SIDE=En;exports.MESH_KERB_TOP=_n;exports.MESH_SIDE=Mn;exports.MESH_TOP=Io;exports.MIN_PIER_HEIGHT_METERS=aA;exports.MODEL_VERTEX_STRIDE=ki;exports.Map=Rl;exports.MapObject=Fn;exports.Marker=An;exports.MediaSource=mn;exports.Model=yn;exports.ModelLayer=lo;exports.NavigationControl=vl;exports.ObjectManager=qr;exports.PIER_SPACING_METERS=iA;exports.Polygon=aa;exports.Polyline=Dl;exports.Popup=xn;exports.QualityGovernor=br;exports.RELIEF_STYLE=L1;exports.ROAD_SIGNS=Sy;exports.RUNTIME_FILL_STRIDE=Ds;exports.RUNTIME_LINE_STRIDE=jo;exports.RasterSource=hn;exports.RasterTile=Vi;exports.SDF_EDGE=an;exports.SDF_PX=tr;exports.SIGN_SIZE=Ey;exports.SOFT_STYLE=k1;exports.SPLIT_SEP=mu;exports.SURFACE_CUT_BLEED=Or;exports.SURFACE_LEVEL_SCALE=Bf;exports.SURFACE_VERTEX_STRIDE=Jt;exports.ScaleControl=Cl;exports.SdfAtlas=on;exports.Style=Xo;exports.SymbolRenderer=nr;exports.TAPER_METERS=Ir;exports.TERRAIN_STYLE=T1;exports.THEMES=je;exports.TILE_SIZE=zt;exports.TerrainControl=El;exports.TileID=so;exports.Transform=dr;exports.VectorTile=Ut;exports.VectorTileFeature=Qn;exports.VectorTileLayer=$n;exports.abbreviateStreet=Js;exports.addGround=ls;exports.altitudeFromMercatorZ=MA;exports.applyTheme=wi;exports.arrowLabelOffset=Kh;exports.arrowVertices=$1;exports.bridgePiers=lA;exports.bridgeProfile=sA;exports.buildRoadGraph=Py;exports.buildRuntimeFill=Ts;exports.buildRuntimeLine=Zr;exports.cameraForBounds=ca;exports.chainAxes=Wa;exports.circumferenceAtLatitude=Mt;exports.clampLat=Ln;exports.clampPixelRatio=Aa;exports.classifyRenderer=ac;exports.clipLineToRect=My;exports.coordinateDigits=id;exports.coveringTiles=qt;exports.createGround=ss;exports.cutMargin=st;exports.default=WE;exports.densifyLine=Da;exports.deviceHints=Kn;exports.distToSegment=Vd;exports.evaluateColor=ht;exports.evaluateExpression=to;exports.evaluateNumber=pe;exports.expressionColor=_r;exports.expressionNumber=Ia;exports.extractFeature=Ii;exports.featureDrivenPaint=jt;exports.featureLevel=vt;exports.fillFootprint=vs;exports.fogPlanes=Jo;exports.footprintOf=Cs;exports.formatHash=il;exports.generateBuildings=Ra;exports.generateFill=Oa;exports.generateLine=fs;exports.generateSurface=as;exports.generateSymbols=Ys;exports.globeBasis=da;exports.globeFlatMix=On;exports.globeRadius=Hn;exports.globeToLocal=jl;exports.groundAt=yi;exports.iconRotation=Xh;exports.insideFootprint=Zt;exports.isExpression=Ro;exports.junctionIndex=Fr;exports.laneArrow=cl;exports.laneGuides=s2;exports.latFromMercatorY=ct;exports.liftFields=ba;exports.lngFromMercatorX=ut;exports.lngLatToUnit=Gn;exports.makeFeaturePaint=Wr;exports.matchesFilter=et;exports.mercatorMetersPerTile=ho;exports.mercatorX=Oe;exports.mercatorY=Ge;exports.mercatorZFromAltitude=la;exports.metersPerPixel=EA;exports.metersPerTile=fr;exports.needsDataPaint=Ef;exports.nextQualityDown=xa;exports.parseGlb=Sb;exports.parseGlbAsync=Rs;exports.parseGlyphs=Sh;exports.parseHash=al;exports.parseLift=nc;exports.patchUV=eh;exports.pickBuilding=Ss;exports.pickFill=Fs;exports.pitchIntent=tc;exports.pixelsPerMeter=_A;exports.placeAlongLine=Us;exports.placeMarking=fl;exports.pointInRing=Ll;exports.qualityFor=Un;exports.qualityProfile=po;exports.queryRendered=tl;exports.querySource=ol;exports.raySphere=ma;exports.refineLine=Po;exports.relaxAngle=gd;exports.relaxCurvature=ml;exports.resolveTemplate=js;exports.ribbonFromEdges=bl;exports.ribbonRing=$p;exports.ribbonShape=zo;exports.ringEdges=pl;exports.roadEdges=Bn;exports.roadHeights=R2;exports.roadMarkings=e2;exports.roadMesh=rA;exports.roadSurfaces=p2;exports.roundLine=Er;exports.roundRing=dt;exports.roundRings=Zy;exports.sdfFromAlpha=Ns;exports.shapeText=Vs;exports.snapRoadEnds=Yy;exports.speedSign=Fy;exports.splitBucketKey=Ot;exports.splitByGround=cs;exports.splitPolygons=Ao;exports.squareClosed=Ai;exports.stitchPieces=hs;exports.stopLine=Dy;exports.styleWithTheme=Nr;exports.taperedWidth=Dr;exports.tileOriginMeters=Nl;exports.tileUrl=Ui;exports.toLngLat=Pe;exports.unitToLngLat=ha;exports.unpackVector=Si;exports.waffle=Ty;exports.worldSize=eo;exports.yieldTargetsOf=us;exports.zebra=Iy;Object.defineProperty(exports,'__esModule',{value:true});return exports;})({});//# sourceMappingURL=osmgl.global.js.map
2849
2849
  //# sourceMappingURL=osmgl.global.js.map