@mappedin/mappedin-js 6.0.1-alpha.2 → 6.0.1-alpha.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/lib/esm/GLTFExporter-CJKR5WGG.js +1 -0
- package/lib/esm/GLTFLoader-H7ZE3A4X.js +1 -0
- package/lib/esm/{PerformanceController-VMCH7DPO.js → PerformanceController-WFRTDYOP.js} +1 -1
- package/lib/esm/{browser-G6HNHS3R.js → browser-7NYRKP6F.js} +1 -1
- package/lib/esm/chunk-2X6TZZIR.js +1 -0
- package/lib/esm/chunk-AIIHKMIL.js +1 -0
- package/lib/esm/chunk-IKFT423T.js +1 -0
- package/lib/esm/chunk-ZIBVJYLJ.js +1 -0
- package/lib/esm/index.css +1 -1
- package/lib/esm/index.d.ts +1685 -928
- package/lib/esm/index.js +1 -1
- package/lib/esm/outdoor-context-OKBFJPVG.js +1 -0
- package/lib/esm/outdoor-context-v4-SVGMPV2P.js +1 -0
- package/lib/index.css +1 -1
- package/package.json +13 -6
- package/CHANGELOG.md +0 -54
- package/lib/esm/GLTFExporter-6MY3TTW5.js +0 -1
- package/lib/esm/chunk-ISNJUESV.js +0 -1
- package/lib/esm/chunk-SVP2SCIT.js +0 -1
- package/lib/esm/chunk-VSBVGSLC.js +0 -1
- package/lib/esm/outdoor-context-HUI6WIRE.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as uw,b as Oy}from"./chunk-ISNJUESV.js";import{a as d}from"./chunk-VSBVGSLC.js";import{a as u,c as Ft,d as _i,e as ae}from"./chunk-J5IUISYU.js";var Pe=Ft((dE,Vy)=>{"use strict";d();Vy.exports=vi;function vi(r,e){this.x=r,this.y=e}u(vi,"Point");vi.prototype={clone:function(){return new vi(this.x,this.y)},add:function(r){return this.clone()._add(r)},sub:function(r){return this.clone()._sub(r)},multByPoint:function(r){return this.clone()._multByPoint(r)},divByPoint:function(r){return this.clone()._divByPoint(r)},mult:function(r){return this.clone()._mult(r)},div:function(r){return this.clone()._div(r)},rotate:function(r){return this.clone()._rotate(r)},rotateAround:function(r,e){return this.clone()._rotateAround(r,e)},matMult:function(r){return this.clone()._matMult(r)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(r){return this.x===r.x&&this.y===r.y},dist:function(r){return Math.sqrt(this.distSqr(r))},distSqr:function(r){var e=r.x-this.x,t=r.y-this.y;return e*e+t*t},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(r){return Math.atan2(this.y-r.y,this.x-r.x)},angleWith:function(r){return this.angleWithSep(r.x,r.y)},angleWithSep:function(r,e){return Math.atan2(this.x*e-this.y*r,this.x*r+this.y*e)},_matMult:function(r){var e=r[0]*this.x+r[1]*this.y,t=r[2]*this.x+r[3]*this.y;return this.x=e,this.y=t,this},_add:function(r){return this.x+=r.x,this.y+=r.y,this},_sub:function(r){return this.x-=r.x,this.y-=r.y,this},_mult:function(r){return this.x*=r,this.y*=r,this},_div:function(r){return this.x/=r,this.y/=r,this},_multByPoint:function(r){return this.x*=r.x,this.y*=r.y,this},_divByPoint:function(r){return this.x/=r.x,this.y/=r.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var r=this.y;return this.y=this.x,this.x=-r,this},_rotate:function(r){var e=Math.cos(r),t=Math.sin(r),i=e*this.x-t*this.y,n=t*this.x+e*this.y;return this.x=i,this.y=n,this},_rotateAround:function(r,e){var t=Math.cos(r),i=Math.sin(r),n=e.x+t*(this.x-e.x)-i*(this.y-e.y),a=e.y+i*(this.x-e.x)+t*(this.y-e.y);return this.x=n,this.y=a,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}};vi.convert=function(r){return r instanceof vi?r:Array.isArray(r)?new vi(r[0],r[1]):r}});var gc=Ft((xE,Ny)=>{"use strict";d();Ny.exports=Uy;function Uy(r,e,t,i){this.cx=3*r,this.bx=3*(t-r)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*e,this.by=3*(i-e)-this.cy,this.ay=1-this.cy-this.by,this.p1x=r,this.p1y=e,this.p2x=t,this.p2y=i}u(Uy,"UnitBezier");Uy.prototype={sampleCurveX:function(r){return((this.ax*r+this.bx)*r+this.cx)*r},sampleCurveY:function(r){return((this.ay*r+this.by)*r+this.cy)*r},sampleCurveDerivativeX:function(r){return(3*this.ax*r+2*this.bx)*r+this.cx},solveCurveX:function(r,e){if(e===void 0&&(e=1e-6),r<0)return 0;if(r>1)return 1;for(var t=r,i=0;i<8;i++){var n=this.sampleCurveX(t)-r;if(Math.abs(n)<e)return t;var a=this.sampleCurveDerivativeX(t);if(Math.abs(a)<1e-6)break;t=t-n/a}var o=0,s=1;for(t=r,i=0;i<20&&(n=this.sampleCurveX(t),!(Math.abs(n-r)<e));i++)r>n?o=t:s=t,t=(s-o)*.5+o;return t},solve:function(r,e){return this.sampleCurveY(this.solveCurveX(r,e))}}});var vx=Ft((NL,Rh)=>{d();function AS(r,e){var t,i,n,a,o,s,l,c,p,h;for(t=r.length&3,i=r.length-t,n=e,o=3432918353,l=461845907,h=0;h<i;)p=r.charCodeAt(h)&255|(r.charCodeAt(++h)&255)<<8|(r.charCodeAt(++h)&255)<<16|(r.charCodeAt(++h)&255)<<24,++h,p=(p&65535)*o+(((p>>>16)*o&65535)<<16)&4294967295,p=p<<15|p>>>17,p=(p&65535)*l+(((p>>>16)*l&65535)<<16)&4294967295,n^=p,n=n<<13|n>>>19,a=(n&65535)*5+(((n>>>16)*5&65535)<<16)&4294967295,n=(a&65535)+27492+(((a>>>16)+58964&65535)<<16);switch(p=0,t){case 3:p^=(r.charCodeAt(h+2)&255)<<16;case 2:p^=(r.charCodeAt(h+1)&255)<<8;case 1:p^=r.charCodeAt(h)&255,p=(p&65535)*o+(((p>>>16)*o&65535)<<16)&4294967295,p=p<<15|p>>>17,p=(p&65535)*l+(((p>>>16)*l&65535)<<16)&4294967295,n^=p}return n^=r.length,n^=n>>>16,n=(n&65535)*2246822507+(((n>>>16)*2246822507&65535)<<16)&4294967295,n^=n>>>13,n=(n&65535)*3266489909+(((n>>>16)*3266489909&65535)<<16)&4294967295,n^=n>>>16,n>>>0}u(AS,"murmurhash3_32_gc");typeof Rh<"u"&&(Rh.exports=AS)});var wx=Ft((jL,Oh)=>{d();function IS(r,e){for(var t=r.length,i=e^t,n=0,a;t>=4;)a=r.charCodeAt(n)&255|(r.charCodeAt(++n)&255)<<8|(r.charCodeAt(++n)&255)<<16|(r.charCodeAt(++n)&255)<<24,a=(a&65535)*1540483477+(((a>>>16)*1540483477&65535)<<16),a^=a>>>24,a=(a&65535)*1540483477+(((a>>>16)*1540483477&65535)<<16),i=(i&65535)*1540483477+(((i>>>16)*1540483477&65535)<<16)^a,t-=4,++n;switch(t){case 3:i^=(r.charCodeAt(n+2)&255)<<16;case 2:i^=(r.charCodeAt(n+1)&255)<<8;case 1:i^=r.charCodeAt(n)&255,i=(i&65535)*1540483477+(((i>>>16)*1540483477&65535)<<16)}return i^=i>>>13,i=(i&65535)*1540483477+(((i>>>16)*1540483477&65535)<<16),i^=i>>>15,i>>>0}u(IS,"murmurhash2_32_gc");typeof Oh!==void 0&&(Oh.exports=IS)});var Vh=Ft((ZL,Es)=>{d();var Sx=vx(),MS=wx();Es.exports=Sx;Es.exports.murmur3=Sx;Es.exports.murmur2=MS});var gf=Ft((E3,zb)=>{"use strict";d();var UI=Pe();zb.exports=Ji;function Ji(r,e,t,i,n){this.properties={},this.extent=t,this.type=0,this._pbf=r,this._geometry=-1,this._keys=i,this._values=n,r.readFields(NI,this,e)}u(Ji,"VectorTileFeature");function NI(r,e,t){r==1?e.id=t.readVarint():r==2?GI(t,e):r==3?e.type=t.readVarint():r==4&&(e._geometry=t.pos)}u(NI,"readFeature");function GI(r,e){for(var t=r.readVarint()+r.pos;r.pos<t;){var i=e._keys[r.readVarint()],n=e._values[r.readVarint()];e.properties[i]=n}}u(GI,"readTag");Ji.types=["Unknown","Point","LineString","Polygon"];Ji.prototype.loadGeometry=function(){var r=this._pbf;r.pos=this._geometry;for(var e=r.readVarint()+r.pos,t=1,i=0,n=0,a=0,o=[],s;r.pos<e;){if(i<=0){var l=r.readVarint();t=l&7,i=l>>3}if(i--,t===1||t===2)n+=r.readSVarint(),a+=r.readSVarint(),t===1&&(s&&o.push(s),s=[]),s.push(new UI(n,a));else if(t===7)s&&s.push(s[0].clone());else throw new Error("unknown command "+t)}return s&&o.push(s),o};Ji.prototype.bbox=function(){var r=this._pbf;r.pos=this._geometry;for(var e=r.readVarint()+r.pos,t=1,i=0,n=0,a=0,o=1/0,s=-1/0,l=1/0,c=-1/0;r.pos<e;){if(i<=0){var p=r.readVarint();t=p&7,i=p>>3}if(i--,t===1||t===2)n+=r.readSVarint(),a+=r.readSVarint(),n<o&&(o=n),n>s&&(s=n),a<l&&(l=a),a>c&&(c=a);else if(t!==7)throw new Error("unknown command "+t)}return[o,l,s,c]};Ji.prototype.toGeoJSON=function(r,e,t){var i=this.extent*Math.pow(2,t),n=this.extent*r,a=this.extent*e,o=this.loadGeometry(),s=Ji.types[this.type],l,c;function p(m){for(var g=0;g<m.length;g++){var y=m[g],x=180-(y.y+a)*360/i;m[g]=[(y.x+n)*360/i-180,360/Math.PI*Math.atan(Math.exp(x*Math.PI/180))-90]}}switch(u(p,"project"),this.type){case 1:var h=[];for(l=0;l<o.length;l++)h[l]=o[l][0];o=h,p(o);break;case 2:for(l=0;l<o.length;l++)p(o[l]);break;case 3:for(o=qI(o),l=0;l<o.length;l++)for(c=0;c<o[l].length;c++)p(o[l][c]);break}o.length===1?o=o[0]:s="Multi"+s;var f={type:"Feature",geometry:{type:s,coordinates:o},properties:this.properties};return"id"in this&&(f.id=this.id),f};function qI(r){var e=r.length;if(e<=1)return[r];for(var t=[],i,n,a=0;a<e;a++){var o=jI(r[a]);o!==0&&(n===void 0&&(n=o<0),n===o<0?(i&&t.push(i),i=[r[a]]):i.push(r[a]))}return i&&t.push(i),t}u(qI,"classifyRings");function jI(r){for(var e=0,t=0,i=r.length,n=i-1,a,o;t<i;n=t++)a=r[t],o=r[n],e+=(o.x-a.x)*(a.y+o.y);return e}u(jI,"signedArea")});var xf=Ft((D3,Bb)=>{"use strict";d();var $I=gf();Bb.exports=Fb;function Fb(r,e){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=r,this._keys=[],this._values=[],this._features=[],r.readFields(HI,this,e),this.length=this._features.length}u(Fb,"VectorTileLayer");function HI(r,e,t){r===15?e.version=t.readVarint():r===1?e.name=t.readString():r===5?e.extent=t.readVarint():r===2?e._features.push(t.pos):r===3?e._keys.push(t.readString()):r===4&&e._values.push(ZI(t))}u(HI,"readLayer");function ZI(r){for(var e=null,t=r.readVarint()+r.pos;r.pos<t;){var i=r.readVarint()>>3;e=i===1?r.readString():i===2?r.readFloat():i===3?r.readDouble():i===4?r.readVarint64():i===5?r.readVarint():i===6?r.readSVarint():i===7?r.readBoolean():null}return e}u(ZI,"readValueMessage");Fb.prototype.feature=function(r){if(r<0||r>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[r];var e=this._pbf.readVarint()+this._pbf.pos;return new $I(this._pbf,e,this.extent,this._keys,this._values)}});var Ob=Ft((B3,Rb)=>{"use strict";d();var WI=xf();Rb.exports=XI;function XI(r,e){this.layers=r.readFields(KI,{},e)}u(XI,"VectorTile");function KI(r,e,t){if(r===3){var i=new WI(t,t.readVarint()+t.pos);i.length&&(e[i.name]=i)}}u(KI,"readTile")});var ka=Ft((V3,$s)=>{d();$s.exports.VectorTile=Ob();$s.exports.VectorTileFeature=gf();$s.exports.VectorTileLayer=xf()});var o_=Ft(Mf=>{d();Mf.read=function(r,e,t,i,n){var a,o,s=n*8-i-1,l=(1<<s)-1,c=l>>1,p=-7,h=t?n-1:0,f=t?-1:1,m=r[e+h];for(h+=f,a=m&(1<<-p)-1,m>>=-p,p+=s;p>0;a=a*256+r[e+h],h+=f,p-=8);for(o=a&(1<<-p)-1,a>>=-p,p+=i;p>0;o=o*256+r[e+h],h+=f,p-=8);if(a===0)a=1-c;else{if(a===l)return o?NaN:(m?-1:1)*(1/0);o=o+Math.pow(2,i),a=a-c}return(m?-1:1)*o*Math.pow(2,a-i)};Mf.write=function(r,e,t,i,n,a){var o,s,l,c=a*8-n-1,p=(1<<c)-1,h=p>>1,f=n===23?Math.pow(2,-24)-Math.pow(2,-77):0,m=i?0:a-1,g=i?1:-1,y=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,o=p):(o=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-o))<1&&(o--,l*=2),o+h>=1?e+=f/l:e+=f*Math.pow(2,1-h),e*l>=2&&(o++,l/=2),o+h>=p?(s=0,o=p):o+h>=1?(s=(e*l-1)*Math.pow(2,n),o=o+h):(s=e*Math.pow(2,h-1)*Math.pow(2,n),o=0));n>=8;r[t+m]=s&255,m+=g,s/=256,n-=8);for(o=o<<n|s,c+=n;c>0;r[t+m]=o&255,m+=g,o/=256,c-=8);r[t+m-g]|=y*128}});var Ef=Ft((jR,p_)=>{"use strict";d();p_.exports=Ie;var Ks=o_();function Ie(r){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(r)?r:new Uint8Array(r||0),this.pos=0,this.type=0,this.length=this.buf.length}u(Ie,"Pbf");Ie.Varint=0;Ie.Fixed64=1;Ie.Bytes=2;Ie.Fixed32=5;var Cf=65536*65536,s_=1/Cf,dM=12,c_=typeof TextDecoder>"u"?null:new TextDecoder("utf8");Ie.prototype={destroy:function(){this.buf=null},readFields:function(r,e,t){for(t=t||this.length;this.pos<t;){var i=this.readVarint(),n=i>>3,a=this.pos;this.type=i&7,r(n,e,this),this.pos===a&&this.skip(i)}return e},readMessage:function(r,e){return this.readFields(r,e,this.readVarint()+this.pos)},readFixed32:function(){var r=Ys(this.buf,this.pos);return this.pos+=4,r},readSFixed32:function(){var r=u_(this.buf,this.pos);return this.pos+=4,r},readFixed64:function(){var r=Ys(this.buf,this.pos)+Ys(this.buf,this.pos+4)*Cf;return this.pos+=8,r},readSFixed64:function(){var r=Ys(this.buf,this.pos)+u_(this.buf,this.pos+4)*Cf;return this.pos+=8,r},readFloat:function(){var r=Ks.read(this.buf,this.pos,!0,23,4);return this.pos+=4,r},readDouble:function(){var r=Ks.read(this.buf,this.pos,!0,52,8);return this.pos+=8,r},readVarint:function(r){var e=this.buf,t,i;return i=e[this.pos++],t=i&127,i<128||(i=e[this.pos++],t|=(i&127)<<7,i<128)||(i=e[this.pos++],t|=(i&127)<<14,i<128)||(i=e[this.pos++],t|=(i&127)<<21,i<128)?t:(i=e[this.pos],t|=(i&15)<<28,yM(t,r,this))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var r=this.readVarint();return r%2===1?(r+1)/-2:r/2},readBoolean:function(){return!!this.readVarint()},readString:function(){var r=this.readVarint()+this.pos,e=this.pos;return this.pos=r,r-e>=dM&&c_?EM(this.buf,e,r):CM(this.buf,e,r)},readBytes:function(){var r=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,r);return this.pos=r,e},readPackedVarint:function(r,e){if(this.type!==Ie.Bytes)return r.push(this.readVarint(e));var t=ar(this);for(r=r||[];this.pos<t;)r.push(this.readVarint(e));return r},readPackedSVarint:function(r){if(this.type!==Ie.Bytes)return r.push(this.readSVarint());var e=ar(this);for(r=r||[];this.pos<e;)r.push(this.readSVarint());return r},readPackedBoolean:function(r){if(this.type!==Ie.Bytes)return r.push(this.readBoolean());var e=ar(this);for(r=r||[];this.pos<e;)r.push(this.readBoolean());return r},readPackedFloat:function(r){if(this.type!==Ie.Bytes)return r.push(this.readFloat());var e=ar(this);for(r=r||[];this.pos<e;)r.push(this.readFloat());return r},readPackedDouble:function(r){if(this.type!==Ie.Bytes)return r.push(this.readDouble());var e=ar(this);for(r=r||[];this.pos<e;)r.push(this.readDouble());return r},readPackedFixed32:function(r){if(this.type!==Ie.Bytes)return r.push(this.readFixed32());var e=ar(this);for(r=r||[];this.pos<e;)r.push(this.readFixed32());return r},readPackedSFixed32:function(r){if(this.type!==Ie.Bytes)return r.push(this.readSFixed32());var e=ar(this);for(r=r||[];this.pos<e;)r.push(this.readSFixed32());return r},readPackedFixed64:function(r){if(this.type!==Ie.Bytes)return r.push(this.readFixed64());var e=ar(this);for(r=r||[];this.pos<e;)r.push(this.readFixed64());return r},readPackedSFixed64:function(r){if(this.type!==Ie.Bytes)return r.push(this.readSFixed64());var e=ar(this);for(r=r||[];this.pos<e;)r.push(this.readSFixed64());return r},skip:function(r){var e=r&7;if(e===Ie.Varint)for(;this.buf[this.pos++]>127;);else if(e===Ie.Bytes)this.pos=this.readVarint()+this.pos;else if(e===Ie.Fixed32)this.pos+=4;else if(e===Ie.Fixed64)this.pos+=8;else throw new Error("Unimplemented type: "+e)},writeTag:function(r,e){this.writeVarint(r<<3|e)},realloc:function(r){for(var e=this.length||16;e<this.pos+r;)e*=2;if(e!==this.length){var t=new Uint8Array(e);t.set(this.buf),this.buf=t,this.length=e}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(r){this.realloc(4),en(this.buf,r,this.pos),this.pos+=4},writeSFixed32:function(r){this.realloc(4),en(this.buf,r,this.pos),this.pos+=4},writeFixed64:function(r){this.realloc(8),en(this.buf,r&-1,this.pos),en(this.buf,Math.floor(r*s_),this.pos+4),this.pos+=8},writeSFixed64:function(r){this.realloc(8),en(this.buf,r&-1,this.pos),en(this.buf,Math.floor(r*s_),this.pos+4),this.pos+=8},writeVarint:function(r){if(r=+r||0,r>268435455||r<0){gM(r,this);return}this.realloc(4),this.buf[this.pos++]=r&127|(r>127?128:0),!(r<=127)&&(this.buf[this.pos++]=(r>>>=7)&127|(r>127?128:0),!(r<=127)&&(this.buf[this.pos++]=(r>>>=7)&127|(r>127?128:0),!(r<=127)&&(this.buf[this.pos++]=r>>>7&127)))},writeSVarint:function(r){this.writeVarint(r<0?-r*2-1:r*2)},writeBoolean:function(r){this.writeVarint(!!r)},writeString:function(r){r=String(r),this.realloc(r.length*4),this.pos++;var e=this.pos;this.pos=kM(this.buf,r,this.pos);var t=this.pos-e;t>=128&&l_(e,t,this),this.pos=e-1,this.writeVarint(t),this.pos+=t},writeFloat:function(r){this.realloc(4),Ks.write(this.buf,r,this.pos,!0,23,4),this.pos+=4},writeDouble:function(r){this.realloc(8),Ks.write(this.buf,r,this.pos,!0,52,8),this.pos+=8},writeBytes:function(r){var e=r.length;this.writeVarint(e),this.realloc(e);for(var t=0;t<e;t++)this.buf[this.pos++]=r[t]},writeRawMessage:function(r,e){this.pos++;var t=this.pos;r(e,this);var i=this.pos-t;i>=128&&l_(t,i,this),this.pos=t-1,this.writeVarint(i),this.pos+=i},writeMessage:function(r,e,t){this.writeTag(r,Ie.Bytes),this.writeRawMessage(e,t)},writePackedVarint:function(r,e){e.length&&this.writeMessage(r,_M,e)},writePackedSVarint:function(r,e){e.length&&this.writeMessage(r,vM,e)},writePackedBoolean:function(r,e){e.length&&this.writeMessage(r,PM,e)},writePackedFloat:function(r,e){e.length&&this.writeMessage(r,wM,e)},writePackedDouble:function(r,e){e.length&&this.writeMessage(r,SM,e)},writePackedFixed32:function(r,e){e.length&&this.writeMessage(r,TM,e)},writePackedSFixed32:function(r,e){e.length&&this.writeMessage(r,AM,e)},writePackedFixed64:function(r,e){e.length&&this.writeMessage(r,IM,e)},writePackedSFixed64:function(r,e){e.length&&this.writeMessage(r,MM,e)},writeBytesField:function(r,e){this.writeTag(r,Ie.Bytes),this.writeBytes(e)},writeFixed32Field:function(r,e){this.writeTag(r,Ie.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(r,e){this.writeTag(r,Ie.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(r,e){this.writeTag(r,Ie.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(r,e){this.writeTag(r,Ie.Fixed64),this.writeSFixed64(e)},writeVarintField:function(r,e){this.writeTag(r,Ie.Varint),this.writeVarint(e)},writeSVarintField:function(r,e){this.writeTag(r,Ie.Varint),this.writeSVarint(e)},writeStringField:function(r,e){this.writeTag(r,Ie.Bytes),this.writeString(e)},writeFloatField:function(r,e){this.writeTag(r,Ie.Fixed32),this.writeFloat(e)},writeDoubleField:function(r,e){this.writeTag(r,Ie.Fixed64),this.writeDouble(e)},writeBooleanField:function(r,e){this.writeVarintField(r,!!e)}};function yM(r,e,t){var i=t.buf,n,a;if(a=i[t.pos++],n=(a&112)>>4,a<128||(a=i[t.pos++],n|=(a&127)<<3,a<128)||(a=i[t.pos++],n|=(a&127)<<10,a<128)||(a=i[t.pos++],n|=(a&127)<<17,a<128)||(a=i[t.pos++],n|=(a&127)<<24,a<128)||(a=i[t.pos++],n|=(a&1)<<31,a<128))return Qi(r,n,e);throw new Error("Expected varint not more than 10 bytes")}u(yM,"readVarintRemainder");function ar(r){return r.type===Ie.Bytes?r.readVarint()+r.pos:r.pos+1}u(ar,"readPackedEnd");function Qi(r,e,t){return t?e*4294967296+(r>>>0):(e>>>0)*4294967296+(r>>>0)}u(Qi,"toNum");function gM(r,e){var t,i;if(r>=0?(t=r%4294967296|0,i=r/4294967296|0):(t=~(-r%4294967296),i=~(-r/4294967296),t^4294967295?t=t+1|0:(t=0,i=i+1|0)),r>=18446744073709552e3||r<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");e.realloc(10),xM(t,i,e),bM(i,e)}u(gM,"writeBigVarint");function xM(r,e,t){t.buf[t.pos++]=r&127|128,r>>>=7,t.buf[t.pos++]=r&127|128,r>>>=7,t.buf[t.pos++]=r&127|128,r>>>=7,t.buf[t.pos++]=r&127|128,r>>>=7,t.buf[t.pos]=r&127}u(xM,"writeBigVarintLow");function bM(r,e){var t=(r&7)<<4;e.buf[e.pos++]|=t|((r>>>=3)?128:0),r&&(e.buf[e.pos++]=r&127|((r>>>=7)?128:0),r&&(e.buf[e.pos++]=r&127|((r>>>=7)?128:0),r&&(e.buf[e.pos++]=r&127|((r>>>=7)?128:0),r&&(e.buf[e.pos++]=r&127|((r>>>=7)?128:0),r&&(e.buf[e.pos++]=r&127)))))}u(bM,"writeBigVarintHigh");function l_(r,e,t){var i=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(Math.LN2*7));t.realloc(i);for(var n=t.pos-1;n>=r;n--)t.buf[n+i]=t.buf[n]}u(l_,"makeRoomForExtraLength");function _M(r,e){for(var t=0;t<r.length;t++)e.writeVarint(r[t])}u(_M,"writePackedVarint");function vM(r,e){for(var t=0;t<r.length;t++)e.writeSVarint(r[t])}u(vM,"writePackedSVarint");function wM(r,e){for(var t=0;t<r.length;t++)e.writeFloat(r[t])}u(wM,"writePackedFloat");function SM(r,e){for(var t=0;t<r.length;t++)e.writeDouble(r[t])}u(SM,"writePackedDouble");function PM(r,e){for(var t=0;t<r.length;t++)e.writeBoolean(r[t])}u(PM,"writePackedBoolean");function TM(r,e){for(var t=0;t<r.length;t++)e.writeFixed32(r[t])}u(TM,"writePackedFixed32");function AM(r,e){for(var t=0;t<r.length;t++)e.writeSFixed32(r[t])}u(AM,"writePackedSFixed32");function IM(r,e){for(var t=0;t<r.length;t++)e.writeFixed64(r[t])}u(IM,"writePackedFixed64");function MM(r,e){for(var t=0;t<r.length;t++)e.writeSFixed64(r[t])}u(MM,"writePackedSFixed64");function Ys(r,e){return(r[e]|r[e+1]<<8|r[e+2]<<16)+r[e+3]*16777216}u(Ys,"readUInt32");function en(r,e,t){r[t]=e,r[t+1]=e>>>8,r[t+2]=e>>>16,r[t+3]=e>>>24}u(en,"writeInt32");function u_(r,e){return(r[e]|r[e+1]<<8|r[e+2]<<16)+(r[e+3]<<24)}u(u_,"readInt32");function CM(r,e,t){for(var i="",n=e;n<t;){var a=r[n],o=null,s=a>239?4:a>223?3:a>191?2:1;if(n+s>t)break;var l,c,p;s===1?a<128&&(o=a):s===2?(l=r[n+1],(l&192)===128&&(o=(a&31)<<6|l&63,o<=127&&(o=null))):s===3?(l=r[n+1],c=r[n+2],(l&192)===128&&(c&192)===128&&(o=(a&15)<<12|(l&63)<<6|c&63,(o<=2047||o>=55296&&o<=57343)&&(o=null))):s===4&&(l=r[n+1],c=r[n+2],p=r[n+3],(l&192)===128&&(c&192)===128&&(p&192)===128&&(o=(a&15)<<18|(l&63)<<12|(c&63)<<6|p&63,(o<=65535||o>=1114112)&&(o=null))),o===null?(o=65533,s=1):o>65535&&(o-=65536,i+=String.fromCharCode(o>>>10&1023|55296),o=56320|o&1023),i+=String.fromCharCode(o),n+=s}return i}u(CM,"readUtf8");function EM(r,e,t){return c_.decode(r.subarray(e,t))}u(EM,"readUtf8TextDecoder");function kM(r,e,t){for(var i=0,n,a;i<e.length;i++){if(n=e.charCodeAt(i),n>55295&&n<57344)if(a)if(n<56320){r[t++]=239,r[t++]=191,r[t++]=189,a=n;continue}else n=a-55296<<10|n-56320|65536,a=null;else{n>56319||i+1===e.length?(r[t++]=239,r[t++]=191,r[t++]=189):a=n;continue}else a&&(r[t++]=239,r[t++]=191,r[t++]=189,a=null);n<128?r[t++]=n:(n<2048?r[t++]=n>>6|192:(n<65536?r[t++]=n>>12|224:(r[t++]=n>>18|240,r[t++]=n>>12&63|128),r[t++]=n>>6&63|128),r[t++]=n&63|128)}return t}u(kM,"writeUtf8")});d();var po={name:"@packages/outdoor-context",private:!0,description:"BSD licensed community fork of mapbox-gl, a WebGL interactive maps library",version:"3.2.0",main:"dist/maplibre-gl.js",style:"dist/maplibre-gl.css",license:"BSD-3-Clause",funding:"https://github.com/maplibre/maplibre-gl-js?sponsor=1",repository:{type:"git",url:"git://github.com/maplibre/maplibre-gl-js.git"},types:"dist/maplibre-gl.d.ts",type:"module",dependencies:{"@mapbox/geojson-rewind":"^0.5.2","@mapbox/jsonlint-lines-primitives":"^2.0.2","@mapbox/point-geometry":"^0.1.0","@mapbox/tiny-sdf":"^2.0.6","@mapbox/unitbezier":"^0.0.1","@mapbox/vector-tile":"^1.3.1","@mapbox/whoots-js":"^3.1.0","@maplibre/maplibre-gl-style-spec":"^19.2.2","@types/geojson":"^7946.0.10","@types/mapbox__point-geometry":"^0.1.2","@types/mapbox__vector-tile":"^1.3.0","@types/pbf":"^3.0.2",earcut:"^2.2.4","geojson-vt":"^3.2.1","gl-matrix":"^3.4.3","global-prefix":"^3.0.0",kdbush:"^4.0.2","murmurhash-js":"^1.0.0",pbf:"^3.2.1",potpack:"^2.0.0",quickselect:"^2.0.0",supercluster:"^8.0.1",tinyqueue:"^2.0.3","vt-pbf":"^3.1.3"},devDependencies:{"@mapbox/mapbox-gl-rtl-text":"^0.2.3","@mapbox/mvt-fixtures":"^3.10.0","@rollup/plugin-commonjs":"^25.0.3","@rollup/plugin-json":"^6.0.0","@rollup/plugin-node-resolve":"^15.1.0","@rollup/plugin-replace":"^5.0.2","@rollup/plugin-strip":"^3.0.2","@rollup/plugin-terser":"^0.4.3","@rollup/plugin-typescript":"^11.1.2","@types/benchmark":"^2.1.2","@types/cssnano":"^5.0.0","@types/d3":"^7.4.0","@types/diff":"^5.0.3","@types/earcut":"^2.1.1","@types/eslint":"^8.44.0","@types/gl":"^6.0.2","@types/glob":"^8.1.0","@types/jest":"^29.5.3","@types/jsdom":"^21.1.1","@types/minimist":"^1.2.2","@types/murmurhash-js":"^1.0.4","@types/nise":"^1.4.1","@types/node":"^20.4.2","@types/offscreencanvas":"^2019.7.0","@types/pixelmatch":"^5.2.4","@types/pngjs":"^6.0.1","@types/react":"^18.2.15","@types/react-dom":"^18.2.6","@types/request":"^2.48.8","@types/shuffle-seed":"^1.1.0","@types/supercluster":"^7.1.0","@types/window-or-global":"^1.0.4","@typescript-eslint/eslint-plugin":"^5.61.0","@typescript-eslint/parser":"^5.62.0",address:"^1.2.2",benchmark:"^2.1.4",canvas:"^2.11.2",cssnano:"^6.0.1",d3:"^7.8.5","d3-queue":"^3.0.7","devtools-protocol":"^0.0.1170846",diff:"^5.1.0","dts-bundle-generator":"^8.0.1",eslint:"^8.45.0","eslint-config-mourner":"^3.0.0","eslint-plugin-html":"^7.1.0","eslint-plugin-import":"^2.27.5","eslint-plugin-jest":"^27.2.3","eslint-plugin-tsdoc":"0.2.17","eslint-plugin-react":"^7.32.2",expect:"^29.5.0",gl:"^6.0.2",glob:"^10.3.3","is-builtin-module":"^3.2.1",jest:"^29.6.1","jest-canvas-mock":"^2.5.2","jest-environment-jsdom":"^29.6.1",jsdom:"^22.1.0","json-stringify-pretty-compact":"^4.0.0",minimist:"^1.2.8","mock-geolocation":"^1.0.11",nise:"^5.1.4","node-plantuml":"^0.9.0","npm-font-open-sans":"^1.1.0","npm-run-all":"^4.1.5","pdf-merger-js":"^4.3.0",pixelmatch:"^5.3.0",pngjs:"^7.0.0",postcss:"^8.4.26","postcss-cli":"^10.1.0","postcss-inline-svg":"^6.0.0","pretty-bytes":"^6.1.1",puppeteer:"^20.8.2",react:"^18.2.0","react-dom":"^18.2.0",rollup:"^3.26.2","rollup-plugin-sourcemaps":"^0.6.3",rw:"^1.3.3",semver:"^7.5.4","shuffle-seed":"^1.1.6","source-map-explorer":"^2.5.3",st:"^3.0.0",stylelint:"^15.10.1","stylelint-config-standard":"^34.0.0","ts-jest":"^29.1.1","ts-node":"^10.9.1",tslib:"^2.6.0",typedoc:"^0.24.8","typedoc-plugin-markdown":"^3.15.3","typedoc-plugin-missing-exports":"^2.0.0",typescript:"^5.1.6"},overrides:{"postcss-inline-svg":{"css-select":"^5.1.0","dom-serializer":"^2.0.0",htmlparser2:"^8.0.1","postcss-value-parser":"^4.2.0"}},scripts:{"generate-dist-package":"npm run tsnode build/generate-dist-package.js","generate-shaders":"npm run tsnode build/generate-shaders.ts","generate-struct-arrays":"npm run tsnode build/generate-struct-arrays.ts","generate-style-code":"npm run tsnode build/generate-style-code.ts","generate-typings":"npm run tsnode build/generate-typings.ts","generate-docs":"typedoc && npm run tsnode build/generate-docs.ts","generate-images":"npm run tsnode build/generate-doc-images.ts","build-dist":"run-p --print-label generate-typings build-dev build-prod build-csp build-csp-dev build-css","build-dev":"rollup --configPlugin @rollup/plugin-typescript -c --environment BUILD:dev","watch-dev":"rollup --configPlugin @rollup/plugin-typescript -c --environment BUILD:dev --watch","build-prod":"rollup --configPlugin @rollup/plugin-typescript -c --environment BUILD:production","build-csp":"rollup --configPlugin @rollup/plugin-typescript -c rollup.config.csp.ts","build-csp-dev":"rollup --configPlugin @rollup/plugin-typescript -c rollup.config.csp.ts --environment BUILD:dev","build-css":"postcss -o dist/maplibre-gl.css src/css/maplibre-gl.css","build-diagrams":"cd docs/diagrams; ls *.plantuml | xargs -I {} puml generate --svg {} -o {}.svg","watch-css":"postcss --watch -o dist/maplibre-gl.css src/css/maplibre-gl.css","build-benchmarks":"npm run build-dev && rollup --configPlugin @rollup/plugin-typescript -c test/bench/rollup_config_benchmarks.ts","watch-benchmarks":"rollup --configPlugin @rollup/plugin-typescript -c test/bench/rollup_config_benchmarks.ts --watch","start-server":"st --no-cache -H 0.0.0.0 --port 9966 .",start:"run-p watch-css watch-dev start-server","start-bench":"run-p watch-css watch-benchmarks start-server",lint:"eslint --cache --ext .ts,.tsx,.js,.html --ignore-path .gitignore .","lint-css":"stylelint src/css/maplibre-gl.css",test:"run-p lint lint-css test-render jest",jest:"jest","jest-ci":"jest --reporters=github-actions --reporters=summary","test-build":"jest --selectProjects=build","test-integration":"jest --selectProjects=integration","test-render":"npm run tsnode test/integration/render/run_render_tests.ts","test-unit":"jest --selectProjects=unit","test-watch-roots":"jest --watch",codegen:"run-p generate-dist-package generate-style-code generate-struct-arrays generate-shaders",benchmark:"npm run tsnode test/bench/run-benchmarks.ts","gl-stats":"npm run tsnode test/bench/gl-stats.ts",prepare:"npm run codegen",typecheck:"tsc --noEmit && tsc --project tsconfig.dist.json",tsnode:"node --experimental-loader=ts-node/esm --no-warnings"},files:["build/","dist/*","src/"],engines:{npm:">=8.1.0",node:">=16.14.0"}};d();d();var jy=ae(Pe(),1),$y=ae(gc(),1);function Hy(r){if(r<=0)return 0;if(r>=1)return 1;let e=r*r,t=e*r;return 4*(r<.5?t:3*(r-e)+t-.75)}u(Hy,"easeCubicInOut");function bc(r,e,t,i){let n=new $y.default(r,e,t,i);return function(a){return n.solve(a)}}u(bc,"bezier");var _c=bc(.25,.1,.25,1);function Te(r,e,t){return Math.min(t,Math.max(e,r))}u(Te,"clamp");function Yt(r,e,t){let i=t-e,n=((r-e)%i+i)%i+e;return n===e?t:n}u(Yt,"wrap");function ho(r,e,t){if(!r.length)return t(null,[]);let i=r.length,n=new Array(r.length),a=null;r.forEach((o,s)=>{e(o,(l,c)=>{l&&(a=l),n[s]=c,--i===0&&t(a,n)})})}u(ho,"asyncAll");function Zy(r,e){let t=[];for(let i in r)i in e||t.push(i);return t}u(Zy,"keysDifference");function R(r,...e){for(let t of e)for(let i in t)r[i]=t[i];return r}u(R,"extend");function Bt(r,e){let t={};for(let i=0;i<e.length;i++){let n=e[i];n in r&&(t[n]=r[n])}return t}u(Bt,"pick");var pw=1;function fo(){return pw++}u(fo,"uniqueId");function Wy(r){return Math.log(r)/Math.LN2%1===0}u(Wy,"isPowerOfTwo");function Xy(r){return r<=1?1:Math.pow(2,Math.ceil(Math.log(r)/Math.LN2))}u(Xy,"nextPowerOfTwo");function Tn(r,e,t){let i={};for(let n in r)i[n]=e.call(t||this,r[n],n,r);return i}u(Tn,"mapObject");function mo(r,e,t){let i={};for(let n in r)e.call(t||this,r[n],n,r)&&(i[n]=r[n]);return i}u(mo,"filterObject");function Kt(r,e){if(Array.isArray(r)){if(!Array.isArray(e)||r.length!==e.length)return!1;for(let t=0;t<r.length;t++)if(!Kt(r[t],e[t]))return!1;return!0}if(typeof r=="object"&&r!==null&&e!==null){if(typeof e!="object"||Object.keys(r).length!==Object.keys(e).length)return!1;for(let i in r)if(!Kt(r[i],e[i]))return!1;return!0}return r===e}u(Kt,"deepEqual");function ut(r){return Array.isArray(r)?r.map(ut):typeof r=="object"&&r?Tn(r,ut):r}u(ut,"clone");function Ky(r,e){for(let t=0;t<r.length;t++)if(e.indexOf(r[t])>=0)return!0;return!1}u(Ky,"arraysIntersect");var Gy={};function Ce(r){Gy[r]||(typeof console<"u"&&console.warn(r),Gy[r]=!0)}u(Ce,"warnOnce");function Jt(r,e,t){return(t.y-r.y)*(e.x-r.x)>(e.y-r.y)*(t.x-r.x)}u(Jt,"isCounterClockwise");function Yy(r,e,t,i){let n=e.y-r.y,a=e.x-r.x,o=i.y-t.y,s=i.x-t.x,l=o*a-s*n;if(l===0)return null;let c=r.y-t.y,p=r.x-t.x,h=(s*c-o*p)/l;return new jy.default(r.x+h*a,r.y+h*n)}u(Yy,"findLineIntersection");function Jy(r){let e=0;for(let t=0,i=r.length,n=i-1,a,o;t<i;n=t++)a=r[t],o=r[n],e+=(o.x-a.x)*(a.y+o.y);return e}u(Jy,"calculateSignedArea");function Qy([r,e,t]){return e+=90,e*=Math.PI/180,t*=Math.PI/180,{x:r*Math.cos(e)*Math.sin(t),y:r*Math.sin(e)*Math.sin(t),z:r*Math.cos(t)}}u(Qy,"sphericalToCartesian");function ct(){return typeof WorkerGlobalScope<"u"&&typeof self<"u"&&self instanceof WorkerGlobalScope}u(ct,"isWorker");function eg(r){let e=/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,t={};if(r.replace(e,(i,n,a,o)=>{let s=a||o;return t[n]=s?s.toLowerCase():!0,""}),t["max-age"]){let i=parseInt(t["max-age"],10);isNaN(i)?delete t["max-age"]:t["max-age"]=i}return t}u(eg,"parseCacheControl");var xc=null;function qr(r){if(xc==null){let e=r.navigator?r.navigator.userAgent:null;xc=!!r.safari||!!(e&&(/\b(iPad|iPhone|iPod)\b/.test(e)||e.match("Safari")&&!e.match("Chrome")))}return xc}u(qr,"isSafari");function Ct(r){return typeof ImageBitmap<"u"&&r instanceof ImageBitmap}u(Ct,"isImageBitmap");function tg(r,e){let t=new Blob([new Uint8Array(r)],{type:"image/png"});createImageBitmap(t).then(i=>{e(null,i)}).catch(i=>{e(new Error("Could not load image because of ".concat(i.message,". Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.")))})}u(tg,"arrayBufferToImageBitmap");var qy="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";function rg(r,e){let t=new Image;t.onload=()=>{e(null,t),URL.revokeObjectURL(t.src),t.onload=null,window.requestAnimationFrame(()=>{t.src=qy})},t.onerror=()=>e(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."));let i=new Blob([new Uint8Array(r)],{type:"image/png"});t.src=r.byteLength?URL.createObjectURL(i):qy}u(rg,"arrayBufferToImage");d();var hw=typeof performance<"u"&&performance&&performance.now?performance.now.bind(performance):Date.now.bind(Date),yo,vc,ne={now:hw,frame(r){let e=requestAnimationFrame(r);return{cancel:()=>cancelAnimationFrame(e)}},getImageData(r,e=0){return this.getImageCanvasContext(r).getImageData(-e,-e,r.width+2*e,r.height+2*e)},getImageCanvasContext(r){let e=window.document.createElement("canvas"),t=e.getContext("2d",{willReadFrequently:!0});if(!t)throw new Error("failed to create canvas 2d context");return e.width=r.width,e.height=r.height,t.drawImage(r,0,0,r.width,r.height),t},resolveURL(r){return yo||(yo=document.createElement("a")),yo.href=r,yo.href},hardwareConcurrency:typeof navigator<"u"&&navigator.hardwareConcurrency||4,get prefersReducedMotion(){return matchMedia?(vc==null&&(vc=matchMedia("(prefers-reduced-motion: reduce)")),vc.matches):!1}};d();var wc=ae(Pe(),1);var Be=class Be{static testProp(e){if(!Be.docStyle)return e[0];for(let t=0;t<e.length;t++)if(e[t]in Be.docStyle)return e[t];return e[0]}static create(e,t,i){let n=window.document.createElement(e);return t!==void 0&&(n.className=t),i&&i.appendChild(n),n}static createNS(e,t){return window.document.createElementNS(e,t)}static disableDrag(){Be.docStyle&&Be.selectProp&&(Be.userSelect=Be.docStyle[Be.selectProp],Be.docStyle[Be.selectProp]="none")}static enableDrag(){Be.docStyle&&Be.selectProp&&(Be.docStyle[Be.selectProp]=Be.userSelect)}static setTransform(e,t){e.style[Be.transformProp]=t}static addEventListener(e,t,i,n={}){"passive"in n?e.addEventListener(t,i,n):e.addEventListener(t,i,n.capture)}static removeEventListener(e,t,i,n={}){"passive"in n?e.removeEventListener(t,i,n):e.removeEventListener(t,i,n.capture)}static suppressClickInternal(e){e.preventDefault(),e.stopPropagation(),window.removeEventListener("click",Be.suppressClickInternal,!0)}static suppressClick(){window.addEventListener("click",Be.suppressClickInternal,!0),window.setTimeout(()=>{window.removeEventListener("click",Be.suppressClickInternal,!0)},0)}static mousePos(e,t){let i=e.getBoundingClientRect();return new wc.default(t.clientX-i.left-e.clientLeft,t.clientY-i.top-e.clientTop)}static touchPos(e,t){let i=e.getBoundingClientRect(),n=[];for(let a=0;a<t.length;a++)n.push(new wc.default(t[a].clientX-i.left-e.clientLeft,t[a].clientY-i.top-e.clientTop));return n}static mouseButton(e){return e.button}static remove(e){e.parentNode&&e.parentNode.removeChild(e)}};u(Be,"DOM"),Be.docStyle=typeof window<"u"&&window.document&&window.document.documentElement.style,Be.selectProp=Be.testProp(["userSelect","MozUserSelect","WebkitUserSelect","msUserSelect"]),Be.transformProp=Be.testProp(["transform","WebkitTransform"]);var B=Be;d();d();var it={MAX_PARALLEL_IMAGE_REQUESTS:16,MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:8,MAX_TILE_CACHE_ZOOM_LEVELS:5,REGISTERED_PROTOCOLS:{},WORKER_URL:""};var Tc=class Tc extends Error{constructor(t,i,n,a){super("AJAXError: ".concat(i," (").concat(t,"): ").concat(n));this.status=t,this.statusText=i,this.url=n,this.body=a}};u(Tc,"AJAXError");var hr=Tc,go=ct()?()=>self.worker&&self.worker.referrer:()=>(window.location.protocol==="blob:"?window.parent:window).location.href,Sc=u(r=>it.REGISTERED_PROTOCOLS[r.substring(0,r.indexOf("://"))],"getProtocolAction"),fw=u(r=>/^file:/.test(r)||/^file:/.test(go())&&!/^\w+:/.test(r),"isFileURL");function ig(r,e){let t=new AbortController,i=new Request(r.url,{method:r.method||"GET",body:r.body,credentials:r.credentials,headers:r.headers,referrer:go(),signal:t.signal}),n=!1,a=!1;r.type==="json"&&i.headers.set("Accept","application/json");let o=u((l,c,p)=>{if(!a){if(l&&l.message!=="SecurityError"&&Ce(l),c&&p)return s(c);fetch(i).then(h=>h.ok?s(h):h.blob().then(f=>e(new hr(h.status,h.statusText,r.url,f)))).catch(h=>{h.code!==20&&e(new Error(h.message))})}},"validateOrFetch"),s=u(l=>{(r.type==="arrayBuffer"||r.type==="image"?l.arrayBuffer():r.type==="json"?l.json():l.text()).then(c=>{a||(n=!0,e(null,c,l.headers.get("Cache-Control"),l.headers.get("Expires")))}).catch(c=>{a||e(new Error(c.message))})},"finishRequest");return o(null,null),{cancel:()=>{a=!0,n||t.abort()}}}u(ig,"makeFetchRequest");function mw(r,e){let t=new XMLHttpRequest;t.open(r.method||"GET",r.url,!0),(r.type==="arrayBuffer"||r.type==="image")&&(t.responseType="arraybuffer");for(let i in r.headers)t.setRequestHeader(i,r.headers[i]);return r.type==="json"&&(t.responseType="text",t.setRequestHeader("Accept","application/json")),t.withCredentials=r.credentials==="include",t.onerror=()=>{e(new Error(t.statusText))},t.onload=()=>{if((t.status>=200&&t.status<300||t.status===0)&&t.response!==null){let i=t.response;if(r.type==="json")try{i=JSON.parse(t.response)}catch(n){return e(n)}e(null,i,t.getResponseHeader("Cache-Control"),t.getResponseHeader("Expires"))}else{let i=new Blob([t.response],{type:t.getResponseHeader("Content-Type")});e(new hr(t.status,t.statusText,r.url,i))}},t.send(r.body),{cancel:()=>t.abort()}}u(mw,"makeXMLHttpRequest");var wi=u(function(r,e){if(/:\/\//.test(r.url)&&!/^https?:|^file:/.test(r.url)){if(ct()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",r,e);if(!ct())return(Sc(r.url)||ig)(r,e)}if(!fw(r.url)){if(fetch&&Request&&AbortController&&Object.prototype.hasOwnProperty.call(Request.prototype,"signal"))return ig(r,e);if(ct()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",r,e,void 0,!0)}return mw(r,e)},"makeRequest"),fr=u(function(r,e){return wi(R(r,{type:"json"}),e)},"getJSON"),xo=u(function(r,e){return wi(R(r,{type:"arrayBuffer"}),e)},"getArrayBuffer");function Pc(r){if(!r||r.indexOf("://")<=0||r.indexOf("data:image/")===0||r.indexOf("blob:")===0)return!0;let e=new URL(r),t=window.location;return e.protocol===t.protocol&&e.host===t.host}u(Pc,"sameOrigin");var ng=u(function(r,e){let t=window.document.createElement("video");t.muted=!0,t.onloadstart=function(){e(null,t)};for(let i=0;i<r.length;i++){let n=window.document.createElement("source");Pc(r[i])||(t.crossOrigin="Anonymous"),n.src=r[i],t.appendChild(n)}return{cancel:()=>{}}},"getVideo");d();d();var In={supported:!1,testSupport:dw},An,Ac=!1,Si,ag=!1;typeof document<"u"&&(Si=document.createElement("img"),Si.onload=function(){An&&og(An),An=null,ag=!0},Si.onerror=function(){Ac=!0,An=null},Si.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");function dw(r){Ac||!Si||(ag?og(r):An=r)}u(dw,"testSupport");function og(r){let e=r.createTexture();r.bindTexture(r.TEXTURE_2D,e);try{if(r.texImage2D(r.TEXTURE_2D,0,r.RGBA,r.RGBA,r.UNSIGNED_BYTE,Si),r.isContextLost())return;In.supported=!0}catch{}r.deleteTexture(e),Ac=!0}u(og,"testWebpTextureUpload");var ot;(g=>{let r,e,t,i;g.resetRequestQueue=u(()=>{r=[],e=0,t=0,i={}},"resetRequestQueue"),g.addThrottleControl=u(y=>{let x=t++;return i[x]=y,x},"addThrottleControl"),g.removeThrottleControl=u(y=>{delete i[y],f()},"removeThrottleControl");let s=u(()=>{let y=Object.keys(i),x=!1;if(y.length>0){for(let b of y)if(x=i[b](),x)break}return x},"isThrottled");g.getImage=u((y,x,b=!0)=>{In.supported&&(y.headers||(y.headers={}),y.headers.accept="image/webp,*/*");let _={requestParameters:y,supportImageRefresh:b,callback:x,cancelled:!1,completed:!1,cancel:()=>{!_.completed&&!_.cancelled&&(_.cancelled=!0,_.innerRequest&&(_.innerRequest.cancel(),e--),f())}};return r.push(_),f(),_},"getImage");let c=u((y,x)=>{typeof createImageBitmap=="function"?tg(y,x):rg(y,x)},"arrayBufferToCanvasImageSource"),p=u(y=>{let{requestParameters:x,supportImageRefresh:b,callback:_}=y;return R(x,{type:"image"}),(b===!1&&!ct()&&!Sc(x.url)&&(!x.headers||Object.keys(x.headers).reduce((P,T)=>P&&T==="accept",!0))?m:wi)(x,(P,T,A,L)=>{h(y,_,P,T,A,L)})},"doImageRequest"),h=u((y,x,b,_,v,S)=>{b?x(b):_ instanceof HTMLImageElement||_ instanceof ImageBitmap?x(null,_):_&&c(_,u((T,A)=>{T!=null?x(T):A!=null&&x(null,A,{cacheControl:v,expires:S})},"decoratedCallback")),y.cancelled||(y.completed=!0,e--,f())},"onImageResponse"),f=u(()=>{let y=s()?it.MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:it.MAX_PARALLEL_IMAGE_REQUESTS;for(let x=e;x<y&&r.length>0;x++){let b=r.shift();if(b.cancelled){x--;continue}let _=p(b);e++,b.innerRequest=_}},"processQueue"),m=u((y,x)=>{let b=new Image,_=y.url,v=!1,S=y.credentials;return S&&S==="include"?b.crossOrigin="use-credentials":(S&&S==="same-origin"||!Pc(_))&&(b.crossOrigin="anonymous"),b.fetchPriority="high",b.onload=()=>{x(null,b),b.onerror=b.onload=null},b.onerror=()=>{v||x(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.")),b.onerror=b.onload=null},b.src=_,{cancel:()=>{v=!0,b.src=""}}},"getImageUsingHtmlImage")})(ot||(ot={}));ot.resetRequestQueue();d();var Ic=class Ic{constructor(e){this._transformRequestFn=e}transformRequest(e,t){return this._transformRequestFn?this._transformRequestFn(e,t)||{url:e}:{url:e}}normalizeSpriteURL(e,t,i){let n=gw(e);return n.path+="".concat(t).concat(i),xw(n)}setTransformRequest(e){this._transformRequestFn=e}};u(Ic,"RequestManager");var bo=Ic,yw=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function gw(r){let e=r.match(yw);if(!e)throw new Error('Unable to parse URL "'.concat(r,'"'));return{protocol:e[1],authority:e[2],path:e[3]||"/",params:e[4]?e[4].split("&"):[]}}u(gw,"parseUrl");function xw(r){let e=r.params.length?"?".concat(r.params.join("&")):"";return"".concat(r.protocol,"://").concat(r.authority).concat(r.path).concat(e)}u(xw,"formatUrl");d();d();function sg(r,e,t){t[r]&&t[r].indexOf(e)!==-1||(t[r]=t[r]||[],t[r].push(e))}u(sg,"_addEventListener");function Mc(r,e,t){if(t&&t[r]){let i=t[r].indexOf(e);i!==-1&&t[r].splice(i,1)}}u(Mc,"_removeEventListener");var Cc=class Cc{constructor(e,t={}){R(this,t),this.type=e}};u(Cc,"Event");var z=Cc,Ec=class Ec extends z{constructor(t,i={}){super("error",R({error:t},i))}};u(Ec,"ErrorEvent");var Z=Ec,kc=class kc{on(e,t){return this._listeners=this._listeners||{},sg(e,t,this._listeners),this}off(e,t){return Mc(e,t,this._listeners),Mc(e,t,this._oneTimeListeners),this}once(e,t){return t?(this._oneTimeListeners=this._oneTimeListeners||{},sg(e,t,this._oneTimeListeners),this):new Promise(i=>this.once(e,i))}fire(e,t){typeof e=="string"&&(e=new z(e,t||{}));let i=e.type;if(this.listens(i)){e.target=this;let n=this._listeners&&this._listeners[i]?this._listeners[i].slice():[];for(let s of n)s.call(this,e);let a=this._oneTimeListeners&&this._oneTimeListeners[i]?this._oneTimeListeners[i].slice():[];for(let s of a)Mc(i,s,this._oneTimeListeners),s.call(this,e);let o=this._eventedParent;o&&(R(e,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),o.fire(e))}else e instanceof Z&&console.error(e.error);return this}listens(e){return this._listeners&&this._listeners[e]&&this._listeners[e].length>0||this._oneTimeListeners&&this._oneTimeListeners[e]&&this._oneTimeListeners[e].length>0||this._eventedParent&&this._eventedParent.listens(e)}setEventedParent(e,t){return this._eventedParent=e,this._eventedParentData=t,this}};u(kc,"Evented");var de=kc;d();d();d();d();var Pg=ae(gc(),1);var bw=8,_w={version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},light:{type:"light"},terrain:{type:"terrain"},sources:{required:!0,type:"sources"},sprite:{type:"sprite"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},vw={"*":{type:"source"}},ww=["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],Sw={type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},Pw={type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},Tw={type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{}},default:"mapbox"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},Aw={type:{required:!0,type:"enum",values:{geojson:{}}},data:{required:!0,type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"*"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},Iw={type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},Mw={type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},Cw={id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},Ew=["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],kw={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},Lw={"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},Dw={"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},zw={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},Fw={"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},Bw={"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image",{"!":"icon-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"padding",default:[2],units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},"viewport-glyph":{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-variable-anchor-offset":{type:"variableAnchorOffsetCollection",requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field",{"!":"text-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},Rw={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},Ow={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},Vw={type:"array",value:"*"},Uw={type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{},within:{}}},Nw={type:"enum",values:{Point:{},LineString:{},Polygon:{}}},Gw={type:"array",minimum:0,maximum:24,value:["number","color"],length:2},qw={type:"array",value:"*",minimum:1},jw={anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},$w={source:{type:"string",required:!0},exaggeration:{type:"number",minimum:0,default:1}},Hw=["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],Zw={"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},Ww={"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},Xw={"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},Kw={"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},Yw={"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},Jw={"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},Qw={"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},e2={"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},t2={duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},r2={"*":{type:"string"}},M={$version:bw,$root:_w,sources:vw,source:ww,source_vector:Sw,source_raster:Pw,source_raster_dem:Tw,source_geojson:Aw,source_video:Iw,source_image:Mw,layer:Cw,layout:Ew,layout_background:kw,layout_fill:Lw,layout_circle:Dw,layout_heatmap:zw,"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:Fw,layout_symbol:Bw,layout_raster:Rw,layout_hillshade:Ow,filter:Vw,filter_operator:Uw,geometry_type:Nw,function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:Gw,expression:qw,light:jw,terrain:$w,paint:Hw,paint_fill:Zw,"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:Ww,paint_circle:Xw,paint_heatmap:Kw,paint_symbol:Yw,paint_raster:Jw,paint_hillshade:Qw,paint_background:e2,transition:t2,"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:r2},i2=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function n2(r,e){let t={};for(let i in r)i!=="ref"&&(t[i]=r[i]);return i2.forEach(i=>{i in e&&(t[i]=e[i])}),t}u(n2,"deref");function Kc(r){r=r.slice();let e=Object.create(null);for(let t=0;t<r.length;t++)e[r[t].id]=r[t];for(let t=0;t<r.length;t++)"ref"in r[t]&&(r[t]=n2(r[t],e[r[t].ref]));return r}u(Kc,"derefLayers");function Oe(r,e){if(Array.isArray(r)){if(!Array.isArray(e)||r.length!==e.length)return!1;for(let t=0;t<r.length;t++)if(!Oe(r[t],e[t]))return!1;return!0}if(typeof r=="object"&&r!==null&&e!==null){if(typeof e!="object"||Object.keys(r).length!==Object.keys(e).length)return!1;for(let i in r)if(!Oe(r[i],e[i]))return!1;return!0}return r===e}u(Oe,"deepEqual");var Ae={setStyle:"setStyle",addLayer:"addLayer",removeLayer:"removeLayer",setPaintProperty:"setPaintProperty",setLayoutProperty:"setLayoutProperty",setFilter:"setFilter",addSource:"addSource",removeSource:"removeSource",setGeoJSONSourceData:"setGeoJSONSourceData",setLayerZoomRange:"setLayerZoomRange",setLayerProperty:"setLayerProperty",setCenter:"setCenter",setZoom:"setZoom",setBearing:"setBearing",setPitch:"setPitch",setSprite:"setSprite",setGlyphs:"setGlyphs",setTransition:"setTransition",setLight:"setLight"};function Tg(r,e,t){t.push({command:Ae.addSource,args:[r,e[r]]})}u(Tg,"addSource");function Ag(r,e,t){e.push({command:Ae.removeSource,args:[r]}),t[r]=!0}u(Ag,"removeSource");function a2(r,e,t,i){Ag(r,t,i),Tg(r,e,t)}u(a2,"updateSource");function o2(r,e,t){let i;for(i in r[t])if(Object.prototype.hasOwnProperty.call(r[t],i)&&i!=="data"&&!Oe(r[t][i],e[t][i]))return!1;for(i in e[t])if(Object.prototype.hasOwnProperty.call(e[t],i)&&i!=="data"&&!Oe(r[t][i],e[t][i]))return!1;return!0}u(o2,"canUpdateGeoJSON");function s2(r,e,t,i){r=r||{},e=e||{};let n;for(n in r)Object.prototype.hasOwnProperty.call(r,n)&&(Object.prototype.hasOwnProperty.call(e,n)||Ag(n,t,i));for(n in e)Object.prototype.hasOwnProperty.call(e,n)&&(Object.prototype.hasOwnProperty.call(r,n)?Oe(r[n],e[n])||(r[n].type==="geojson"&&e[n].type==="geojson"&&o2(r,e,n)?t.push({command:Ae.setGeoJSONSourceData,args:[n,e[n].data]}):a2(n,e,t,i)):Tg(n,e,t))}u(s2,"diffSources");function _o(r,e,t,i,n,a){r=r||{},e=e||{};let o;for(o in r)Object.prototype.hasOwnProperty.call(r,o)&&(Oe(r[o],e[o])||t.push({command:a,args:[i,o,e[o],n]}));for(o in e)!Object.prototype.hasOwnProperty.call(e,o)||Object.prototype.hasOwnProperty.call(r,o)||Oe(r[o],e[o])||t.push({command:a,args:[i,o,e[o],n]})}u(_o,"diffLayerPropertyChanges");function lg(r){return r.id}u(lg,"pluckId");function ug(r,e){return r[e.id]=e,r}u(ug,"indexById");function l2(r,e,t){r=r||[],e=e||[];let i=r.map(lg),n=e.map(lg),a=r.reduce(ug,{}),o=e.reduce(ug,{}),s=i.slice(),l=Object.create(null),c,p,h,f,m,g,y;for(c=0,p=0;c<i.length;c++)h=i[c],Object.prototype.hasOwnProperty.call(o,h)?p++:(t.push({command:Ae.removeLayer,args:[h]}),s.splice(s.indexOf(h,p),1));for(c=0,p=0;c<n.length;c++)h=n[n.length-1-c],s[s.length-1-c]!==h&&(Object.prototype.hasOwnProperty.call(a,h)?(t.push({command:Ae.removeLayer,args:[h]}),s.splice(s.lastIndexOf(h,s.length-p),1)):p++,g=s[s.length-c],t.push({command:Ae.addLayer,args:[o[h],g]}),s.splice(s.length-c,0,h),l[h]=!0);for(c=0;c<n.length;c++)if(h=n[c],f=a[h],m=o[h],!(l[h]||Oe(f,m))){if(!Oe(f.source,m.source)||!Oe(f["source-layer"],m["source-layer"])||!Oe(f.type,m.type)){t.push({command:Ae.removeLayer,args:[h]}),g=s[s.lastIndexOf(h)+1],t.push({command:Ae.addLayer,args:[m,g]});continue}_o(f.layout,m.layout,t,h,null,Ae.setLayoutProperty),_o(f.paint,m.paint,t,h,null,Ae.setPaintProperty),Oe(f.filter,m.filter)||t.push({command:Ae.setFilter,args:[h,m.filter]}),(!Oe(f.minzoom,m.minzoom)||!Oe(f.maxzoom,m.maxzoom))&&t.push({command:Ae.setLayerZoomRange,args:[h,m.minzoom,m.maxzoom]});for(y in f)Object.prototype.hasOwnProperty.call(f,y)&&(y==="layout"||y==="paint"||y==="filter"||y==="metadata"||y==="minzoom"||y==="maxzoom"||(y.indexOf("paint.")===0?_o(f[y],m[y],t,h,y.slice(6),Ae.setPaintProperty):Oe(f[y],m[y])||t.push({command:Ae.setLayerProperty,args:[h,y,m[y]]})));for(y in m)!Object.prototype.hasOwnProperty.call(m,y)||Object.prototype.hasOwnProperty.call(f,y)||y==="layout"||y==="paint"||y==="filter"||y==="metadata"||y==="minzoom"||y==="maxzoom"||(y.indexOf("paint.")===0?_o(f[y],m[y],t,h,y.slice(6),Ae.setPaintProperty):Oe(f[y],m[y])||t.push({command:Ae.setLayerProperty,args:[h,y,m[y]]}))}}u(l2,"diffLayers");function Ig(r,e){if(!r)return[{command:Ae.setStyle,args:[e]}];let t=[];try{if(!Oe(r.version,e.version))return[{command:Ae.setStyle,args:[e]}];Oe(r.center,e.center)||t.push({command:Ae.setCenter,args:[e.center]}),Oe(r.zoom,e.zoom)||t.push({command:Ae.setZoom,args:[e.zoom]}),Oe(r.bearing,e.bearing)||t.push({command:Ae.setBearing,args:[e.bearing]}),Oe(r.pitch,e.pitch)||t.push({command:Ae.setPitch,args:[e.pitch]}),Oe(r.sprite,e.sprite)||t.push({command:Ae.setSprite,args:[e.sprite]}),Oe(r.glyphs,e.glyphs)||t.push({command:Ae.setGlyphs,args:[e.glyphs]}),Oe(r.transition,e.transition)||t.push({command:Ae.setTransition,args:[e.transition]}),Oe(r.light,e.light)||t.push({command:Ae.setLight,args:[e.light]});let i={},n=[];s2(r.sources,e.sources,n,i);let a=[];r.layers&&r.layers.forEach(o=>{i[o.source]?t.push({command:Ae.removeLayer,args:[o.id]}):a.push(o)}),t=t.concat(n),l2(a,e.layers,t)}catch(i){console.warn("Unable to compute style diff:",i),t=[{command:Ae.setStyle,args:[e]}]}return t}u(Ig,"diffStyles");var sp=class sp{constructor(e,t,i,n){this.message=(e?"".concat(e,": "):"")+i,n&&(this.identifier=n),t!=null&&t.__line__&&(this.line=t.__line__)}};u(sp,"ValidationError");var N=sp;function ki(r,...e){for(let t of e)for(let i in t)r[i]=t[i];return r}u(ki,"extendBy");var lp=class lp extends Error{constructor(e,t){super(t),this.message=t,this.key=e}};u(lp,"ExpressionParsingError");var Et=lp,Bo=class Bo{constructor(e,t=[]){this.parent=e,this.bindings={};for(let[i,n]of t)this.bindings[i]=n}concat(e){return new Bo(this,e)}get(e){if(this.bindings[e])return this.bindings[e];if(this.parent)return this.parent.get(e);throw new Error("".concat(e," not found in scope."))}has(e){return this.bindings[e]?!0:this.parent?this.parent.has(e):!1}};u(Bo,"Scope");var Vc=Bo,zi={kind:"null"},j={kind:"number"},ce={kind:"string"},oe={kind:"boolean"},Lt={kind:"color"},Ci={kind:"object"},se={kind:"value"},u2={kind:"error"},ts={kind:"collator"},Fi={kind:"formatted"},rs={kind:"padding"},Hn={kind:"resolvedImage"},is={kind:"variableAnchorOffsetCollection"};function vt(r,e){return{kind:"array",itemType:r,N:e}}u(vt,"array$1");function Ue(r){if(r.kind==="array"){let e=Ue(r.itemType);return typeof r.N=="number"?"array<".concat(e,", ").concat(r.N,">"):r.itemType.kind==="value"?"array":"array<".concat(e,">")}else return r.kind}u(Ue,"toString$1");var c2=[zi,j,ce,oe,Lt,Fi,Ci,vt(se),rs,Hn,is];function Rn(r,e){if(e.kind==="error")return null;if(r.kind==="array"){if(e.kind==="array"&&(e.N===0&&e.itemType.kind==="value"||!Rn(r.itemType,e.itemType))&&(typeof r.N!="number"||r.N===e.N))return null}else{if(r.kind===e.kind)return null;if(r.kind==="value"){for(let t of c2)if(!Rn(t,e))return null}}return"Expected ".concat(Ue(r)," but found ").concat(Ue(e)," instead.")}u(Rn,"checkSubtype");function Yc(r,e){return e.some(t=>t.kind===r.kind)}u(Yc,"isValidType");function On(r,e){return e.some(t=>t==="null"?r===null:t==="array"?Array.isArray(r):t==="object"?r&&!Array.isArray(r)&&typeof r=="object":t===typeof r)}u(On,"isValidNativeType");function Mn(r,e){return r.kind==="array"&&e.kind==="array"?r.itemType.kind===e.itemType.kind&&typeof r.N=="number":r.kind===e.kind}u(Mn,"verifyType");var Mg=.96422,Cg=1,Eg=.82521,kg=4/29,Ei=6/29,Lg=3*Ei*Ei,p2=Ei*Ei*Ei,h2=Math.PI/180,f2=180/Math.PI;function Dg(r){return r=r%360,r<0&&(r+=360),r}u(Dg,"constrainAngle");function zg([r,e,t,i]){r=Lc(r),e=Lc(e),t=Lc(t);let n,a,o=Dc((.2225045*r+.7168786*e+.0606169*t)/Cg);r===e&&e===t?n=a=o:(n=Dc((.4360747*r+.3850649*e+.1430804*t)/Mg),a=Dc((.0139322*r+.0971045*e+.7141733*t)/Eg));let s=116*o-16;return[s<0?0:s,500*(n-o),200*(o-a),i]}u(zg,"rgbToLab");function Lc(r){return r<=.04045?r/12.92:Math.pow((r+.055)/1.055,2.4)}u(Lc,"rgb2xyz");function Dc(r){return r>p2?Math.pow(r,1/3):r/Lg+kg}u(Dc,"xyz2lab");function Fg([r,e,t,i]){let n=(r+16)/116,a=isNaN(e)?n:n+e/500,o=isNaN(t)?n:n-t/200;return n=Cg*Fc(n),a=Mg*Fc(a),o=Eg*Fc(o),[zc(3.1338561*a-1.6168667*n-.4906146*o),zc(-.9787684*a+1.9161415*n+.033454*o),zc(.0719453*a-.2289914*n+1.4052427*o),i]}u(Fg,"labToRgb");function zc(r){return r=r<=.00304?12.92*r:1.055*Math.pow(r,1/2.4)-.055,r<0?0:r>1?1:r}u(zc,"xyz2rgb");function Fc(r){return r>Ei?r*r*r:Lg*(r-kg)}u(Fc,"lab2xyz");function m2(r){let[e,t,i,n]=zg(r),a=Math.sqrt(t*t+i*i);return[Math.round(a*1e4)?Dg(Math.atan2(i,t)*f2):NaN,a,e,n]}u(m2,"rgbToHcl");function d2([r,e,t,i]){return r=isNaN(r)?0:r*h2,Fg([t,Math.cos(r)*e,Math.sin(r)*e,i])}u(d2,"hclToRgb");function y2([r,e,t,i]){r=Dg(r),e/=100,t/=100;function n(a){let o=(a+r/30)%12,s=e*Math.min(t,1-t);return t-s*Math.max(-1,Math.min(o-3,9-o,1))}return u(n,"f"),[n(0),n(8),n(4),i]}u(y2,"hslToRgb");function g2(r){if(r=r.toLowerCase().trim(),r==="transparent")return[0,0,0,0];let e=x2[r];if(e){let[n,a,o]=e;return[n/255,a/255,o/255,1]}if(r.startsWith("#")&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(r)){let a=r.length<6?1:2,o=1;return[vo(r.slice(o,o+=a)),vo(r.slice(o,o+=a)),vo(r.slice(o,o+=a)),vo(r.slice(o,o+a)||"ff")]}if(r.startsWith("rgb")){let n=/^rgba?\(\s*([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/,a=r.match(n);if(a){let[o,s,l,c,p,h,f,m,g,y,x,b]=a,_=[c||" ",f||" ",y].join("");if(_===" "||_===" /"||_===",,"||_===",,,"){let v=[l,h,g].join(""),S=v==="%%%"?100:v===""?255:0;if(S){let P=[Pi(+s/S,0,1),Pi(+p/S,0,1),Pi(+m/S,0,1),x?cg(+x,b):1];if(pg(P))return P}}return}}let t=/^hsla?\(\s*([\de.+-]+)(?:deg)?(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/,i=r.match(t);if(i){let[n,a,o,s,l,c,p,h,f]=i,m=[o||" ",l||" ",p].join("");if(m===" "||m===" /"||m===",,"||m===",,,"){let g=[+a,Pi(+s,0,100),Pi(+c,0,100),h?cg(+h,f):1];if(pg(g))return y2(g)}}}u(g2,"parseCssColor");function vo(r){return parseInt(r.padEnd(2,r),16)/255}u(vo,"parseHex");function cg(r,e){return Pi(e?r/100:r,0,1)}u(cg,"parseAlpha");function Pi(r,e,t){return Math.min(Math.max(e,r),t)}u(Pi,"clamp");function pg(r){return!r.some(Number.isNaN)}u(pg,"validateNumbers");var x2={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},kn=class kn{constructor(e,t,i,n=1,a=!0){this.r=e,this.g=t,this.b=i,this.a=n,a||(this.r*=n,this.g*=n,this.b*=n,n||this.overwriteGetter("rgb",[e,t,i,n]))}static parse(e){if(e instanceof kn)return e;if(typeof e!="string")return;let t=g2(e);if(t)return new kn(...t,!1)}get rgb(){let{r:e,g:t,b:i,a:n}=this,a=n||1/0;return this.overwriteGetter("rgb",[e/a,t/a,i/a,n])}get hcl(){return this.overwriteGetter("hcl",m2(this.rgb))}get lab(){return this.overwriteGetter("lab",zg(this.rgb))}overwriteGetter(e,t){return Object.defineProperty(this,e,{value:t}),t}toString(){let[e,t,i,n]=this.rgb;return"rgba(".concat([e,t,i].map(a=>Math.round(a*255)).join(","),",").concat(n,")")}};u(kn,"Color");var K=kn;K.black=new K(0,0,0,1);K.white=new K(1,1,1,1);K.transparent=new K(0,0,0,0);K.red=new K(1,0,0,1);var up=class up{constructor(e,t,i){e?this.sensitivity=t?"variant":"case":this.sensitivity=t?"accent":"base",this.locale=i,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(e,t){return this.collator.compare(e,t)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}};u(up,"Collator");var Vn=up,cp=class cp{constructor(e,t,i,n,a){this.text=e,this.image=t,this.scale=i,this.fontStack=n,this.textColor=a}};u(cp,"FormattedSection");var Un=cp,Ai=class Ai{constructor(e){this.sections=e}static fromString(e){return new Ai([new Un(e,null,null,null,null)])}isEmpty(){return this.sections.length===0?!0:!this.sections.some(e=>e.text.length!==0||e.image&&e.image.name.length!==0)}static factory(e){return e instanceof Ai?e:Ai.fromString(e)}toString(){return this.sections.length===0?"":this.sections.map(e=>e.text).join("")}};u(Ai,"Formatted");var St=Ai,Ii=class Ii{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof Ii)return e;if(typeof e=="number")return new Ii([e,e,e,e]);if(Array.isArray(e)&&!(e.length<1||e.length>4)){for(let t of e)if(typeof t!="number")return;switch(e.length){case 1:e=[e[0],e[0],e[0],e[0]];break;case 2:e=[e[0],e[1],e[0],e[1]];break;case 3:e=[e[0],e[1],e[2],e[1]];break}return new Ii(e)}}toString(){return JSON.stringify(this.values)}};u(Ii,"Padding");var Ot=Ii,b2=new Set(["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"]),Ln=class Ln{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof Ln)return e;if(!(!Array.isArray(e)||e.length<1||e.length%2!==0)){for(let t=0;t<e.length;t+=2){let i=e[t],n=e[t+1];if(typeof i!="string"||!b2.has(i)||!Array.isArray(n)||n.length!==2||typeof n[0]!="number"||typeof n[1]!="number")return}return new Ln(e)}}toString(){return JSON.stringify(this.values)}};u(Ln,"VariableAnchorOffsetCollection");var Qt=Ln,Ro=class Ro{constructor(e){this.name=e.name,this.available=e.available}toString(){return this.name}static fromString(e){return e?new Ro({name:e,available:!1}):null}};u(Ro,"ResolvedImage");var pt=Ro;function Bg(r,e,t,i){if(!(typeof r=="number"&&r>=0&&r<=255&&typeof e=="number"&&e>=0&&e<=255&&typeof t=="number"&&t>=0&&t<=255)){let n=typeof i=="number"?[r,e,t,i]:[r,e,t];return"Invalid rgba value [".concat(n.join(", "),"]: 'r', 'g', and 'b' must be between 0 and 255.")}return typeof i>"u"||typeof i=="number"&&i>=0&&i<=1?null:"Invalid rgba value [".concat([r,e,t,i].join(", "),"]: 'a' must be between 0 and 1.")}u(Bg,"validateRGBA");function To(r){if(r===null||typeof r=="string"||typeof r=="boolean"||typeof r=="number"||r instanceof K||r instanceof Vn||r instanceof St||r instanceof Ot||r instanceof Qt||r instanceof pt)return!0;if(Array.isArray(r)){for(let e of r)if(!To(e))return!1;return!0}else if(typeof r=="object"){for(let e in r)if(!To(r[e]))return!1;return!0}else return!1}u(To,"isValue");function We(r){if(r===null)return zi;if(typeof r=="string")return ce;if(typeof r=="boolean")return oe;if(typeof r=="number")return j;if(r instanceof K)return Lt;if(r instanceof Vn)return ts;if(r instanceof St)return Fi;if(r instanceof Ot)return rs;if(r instanceof Qt)return is;if(r instanceof pt)return Hn;if(Array.isArray(r)){let e=r.length,t;for(let i of r){let n=We(i);if(!t)t=n;else{if(t===n)continue;t=se;break}}return vt(t||se,e)}else return Ci}u(We,"typeOf");function Cn(r){let e=typeof r;return r===null?"":e==="string"||e==="number"||e==="boolean"?String(r):r instanceof K||r instanceof St||r instanceof Ot||r instanceof Qt||r instanceof pt?r.toString():JSON.stringify(r)}u(Cn,"toString");var Oo=class Oo{constructor(e,t){this.type=e,this.value=t}static parse(e,t){if(e.length!==2)return t.error("'literal' expression requires exactly one argument, but found ".concat(e.length-1," instead."));if(!To(e[1]))return t.error("invalid value");let i=e[1],n=We(i),a=t.expectedType;return n.kind==="array"&&n.N===0&&a&&a.kind==="array"&&(typeof a.N!="number"||a.N===0)&&(n=a),new Oo(n,i)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}};u(Oo,"Literal");var yr=Oo,pp=class pp{constructor(e){this.name="ExpressionEvaluationError",this.message=e}toJSON(){return this.message}};u(pp,"RuntimeError");var Ne=pp,wo={string:ce,number:j,boolean:oe,object:Ci},Vo=class Vo{constructor(e,t){this.type=e,this.args=t}static parse(e,t){if(e.length<2)return t.error("Expected at least one argument.");let i=1,n,a=e[0];if(a==="array"){let s;if(e.length>2){let c=e[1];if(typeof c!="string"||!(c in wo)||c==="object")return t.error('The item type argument of "array" must be one of string, number, boolean',1);s=wo[c],i++}else s=se;let l;if(e.length>3){if(e[2]!==null&&(typeof e[2]!="number"||e[2]<0||e[2]!==Math.floor(e[2])))return t.error('The length argument to "array" must be a positive integer literal',2);l=e[2],i++}n=vt(s,l)}else{if(!wo[a])throw new Error("Types doesn't contain name = ".concat(a));n=wo[a]}let o=[];for(;i<e.length;i++){let s=t.parse(e[i],i,se);if(!s)return null;o.push(s)}return new Vo(n,o)}evaluate(e){for(let t=0;t<this.args.length;t++){let i=this.args[t].evaluate(e);if(Rn(this.type,We(i))){if(t===this.args.length-1)throw new Ne("Expected value to be of type ".concat(Ue(this.type),", but found ").concat(Ue(We(i))," instead."))}else return i}throw new Error}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}};u(Vo,"Assertion");var Rt=Vo,hg={"to-boolean":oe,"to-color":Lt,"to-number":j,"to-string":ce},Uo=class Uo{constructor(e,t){this.type=e,this.args=t}static parse(e,t){if(e.length<2)return t.error("Expected at least one argument.");let i=e[0];if(!hg[i])throw new Error("Can't parse ".concat(i," as it is not part of the known types"));if((i==="to-boolean"||i==="to-string")&&e.length!==2)return t.error("Expected one argument.");let n=hg[i],a=[];for(let o=1;o<e.length;o++){let s=t.parse(e[o],o,se);if(!s)return null;a.push(s)}return new Uo(n,a)}evaluate(e){switch(this.type.kind){case"boolean":return!!this.args[0].evaluate(e);case"color":{let t,i;for(let n of this.args){if(t=n.evaluate(e),i=null,t instanceof K)return t;if(typeof t=="string"){let a=e.parseColor(t);if(a)return a}else if(Array.isArray(t)&&(t.length<3||t.length>4?i="Invalid rbga value ".concat(JSON.stringify(t),": expected an array containing either three or four numeric values."):i=Bg(t[0],t[1],t[2],t[3]),!i))return new K(t[0]/255,t[1]/255,t[2]/255,t[3])}throw new Ne(i||"Could not parse color from value '".concat(typeof t=="string"?t:JSON.stringify(t),"'"))}case"padding":{let t;for(let i of this.args){t=i.evaluate(e);let n=Ot.parse(t);if(n)return n}throw new Ne("Could not parse padding from value '".concat(typeof t=="string"?t:JSON.stringify(t),"'"))}case"variableAnchorOffsetCollection":{let t;for(let i of this.args){t=i.evaluate(e);let n=Qt.parse(t);if(n)return n}throw new Ne("Could not parse variableAnchorOffsetCollection from value '".concat(typeof t=="string"?t:JSON.stringify(t),"'"))}case"number":{let t=null;for(let i of this.args){if(t=i.evaluate(e),t===null)return 0;let n=Number(t);if(!isNaN(n))return n}throw new Ne("Could not convert ".concat(JSON.stringify(t)," to number."))}case"formatted":return St.fromString(Cn(this.args[0].evaluate(e)));case"resolvedImage":return pt.fromString(Cn(this.args[0].evaluate(e)));default:return Cn(this.args[0].evaluate(e))}}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}};u(Uo,"Coercion");var mr=Uo,_2=["Unknown","Point","LineString","Polygon"],hp=class hp{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null}id(){return this.feature&&"id"in this.feature?this.feature.id:null}geometryType(){return this.feature?typeof this.feature.type=="number"?_2[this.feature.type]:this.feature.type:null}geometry(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null}canonicalID(){return this.canonical}properties(){return this.feature&&this.feature.properties||{}}parseColor(e){let t=this._parseColorCache[e];return t||(t=this._parseColorCache[e]=K.parse(e)),t}};u(hp,"EvaluationContext");var Ao=hp,No=class No{constructor(e,t,i=[],n,a=new Vc,o=[]){this.registry=e,this.path=i,this.key=i.map(s=>"[".concat(s,"]")).join(""),this.scope=a,this.errors=o,this.expectedType=n,this._isConstant=t}parse(e,t,i,n,a={}){return t?this.concat(t,i,n)._parse(e,a):this._parse(e,a)}_parse(e,t){(e===null||typeof e=="string"||typeof e=="boolean"||typeof e=="number")&&(e=["literal",e]);function i(n,a,o){return o==="assert"?new Rt(a,[n]):o==="coerce"?new mr(a,[n]):n}if(u(i,"annotate"),Array.isArray(e)){if(e.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');let n=e[0];if(typeof n!="string")return this.error("Expression name must be a string, but found ".concat(typeof n,' instead. If you wanted a literal array, use ["literal", [...]].'),0),null;let a=this.registry[n];if(a){let o=a.parse(e,this);if(!o)return null;if(this.expectedType){let s=this.expectedType,l=o.type;if((s.kind==="string"||s.kind==="number"||s.kind==="boolean"||s.kind==="object"||s.kind==="array")&&l.kind==="value")o=i(o,s,t.typeAnnotation||"assert");else if((s.kind==="color"||s.kind==="formatted"||s.kind==="resolvedImage")&&(l.kind==="value"||l.kind==="string"))o=i(o,s,t.typeAnnotation||"coerce");else if(s.kind==="padding"&&(l.kind==="value"||l.kind==="number"||l.kind==="array"))o=i(o,s,t.typeAnnotation||"coerce");else if(s.kind==="variableAnchorOffsetCollection"&&(l.kind==="value"||l.kind==="array"))o=i(o,s,t.typeAnnotation||"coerce");else if(this.checkSubtype(s,l))return null}if(!(o instanceof yr)&&o.type.kind!=="resolvedImage"&&this._isConstant(o)){let s=new Ao;try{o=new yr(o.type,o.evaluate(s))}catch(l){return this.error(l.message),null}}return o}return this.error('Unknown expression "'.concat(n,'". If you wanted a literal array, use ["literal", [...]].'),0)}else return typeof e>"u"?this.error("'undefined' value invalid. Use null instead."):typeof e=="object"?this.error('Bare objects invalid. Use ["literal", {...}] instead.'):this.error("Expected an array, but found ".concat(typeof e," instead."))}concat(e,t,i){let n=typeof e=="number"?this.path.concat(e):this.path,a=i?this.scope.concat(i):this.scope;return new No(this.registry,this._isConstant,n,t||null,a,this.errors)}error(e,...t){let i="".concat(this.key).concat(t.map(n=>"[".concat(n,"]")).join(""));this.errors.push(new Et(i,e))}checkSubtype(e,t){let i=Rn(e,t);return i&&this.error(i),i}};u(No,"ParsingContext");var Io=No,Go=class Go{constructor(e,t,i){this.type=ts,this.locale=i,this.caseSensitive=e,this.diacriticSensitive=t}static parse(e,t){if(e.length!==2)return t.error("Expected one argument.");let i=e[1];if(typeof i!="object"||Array.isArray(i))return t.error("Collator options argument must be an object.");let n=t.parse(i["case-sensitive"]===void 0?!1:i["case-sensitive"],1,oe);if(!n)return null;let a=t.parse(i["diacritic-sensitive"]===void 0?!1:i["diacritic-sensitive"],1,oe);if(!a)return null;let o=null;return i.locale&&(o=t.parse(i.locale,1,ce),!o)?null:new Go(n,a,o)}evaluate(e){return new Vn(this.caseSensitive.evaluate(e),this.diacriticSensitive.evaluate(e),this.locale?this.locale.evaluate(e):null)}eachChild(e){e(this.caseSensitive),e(this.diacriticSensitive),this.locale&&e(this.locale)}outputDefined(){return!1}};u(Go,"CollatorExpression");var Mo=Go,dr=8192;function Jc(r,e){r[0]=Math.min(r[0],e[0]),r[1]=Math.min(r[1],e[1]),r[2]=Math.max(r[2],e[0]),r[3]=Math.max(r[3],e[1])}u(Jc,"updateBBox");function v2(r){return(180+r)/360}u(v2,"mercatorXfromLng");function w2(r){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+r*Math.PI/360)))/360}u(w2,"mercatorYfromLat");function Co(r,e){return!(r[0]<=e[0]||r[2]>=e[2]||r[1]<=e[1]||r[3]>=e[3])}u(Co,"boxWithinBox");function S2(r,e){let t=v2(r[0]),i=w2(r[1]),n=Math.pow(2,e.z);return[Math.round(t*n*dr),Math.round(i*n*dr)]}u(S2,"getTileCoordinates");function P2(r,e,t){let i=r[0]-e[0],n=r[1]-e[1],a=r[0]-t[0],o=r[1]-t[1];return i*o-a*n===0&&i*a<=0&&n*o<=0}u(P2,"onBoundary");function T2(r,e,t){return e[1]>r[1]!=t[1]>r[1]&&r[0]<(t[0]-e[0])*(r[1]-e[1])/(t[1]-e[1])+e[0]}u(T2,"rayIntersect");function Qc(r,e){let t=!1;for(let i=0,n=e.length;i<n;i++){let a=e[i];for(let o=0,s=a.length;o<s-1;o++){if(P2(r,a[o],a[o+1]))return!1;T2(r,a[o],a[o+1])&&(t=!t)}}return t}u(Qc,"pointWithinPolygon");function A2(r,e){for(let t=0;t<e.length;t++)if(Qc(r,e[t]))return!0;return!1}u(A2,"pointWithinPolygons");function I2(r,e){return r[0]*e[1]-r[1]*e[0]}u(I2,"perp");function fg(r,e,t,i){let n=r[0]-t[0],a=r[1]-t[1],o=e[0]-t[0],s=e[1]-t[1],l=i[0]-t[0],c=i[1]-t[1],p=n*c-l*a,h=o*c-l*s;return p>0&&h<0||p<0&&h>0}u(fg,"twoSided");function M2(r,e,t,i){let n=[e[0]-r[0],e[1]-r[1]],a=[i[0]-t[0],i[1]-t[1]];return I2(a,n)===0?!1:!!(fg(r,e,t,i)&&fg(t,i,r,e))}u(M2,"lineIntersectLine");function C2(r,e,t){for(let i of t)for(let n=0;n<i.length-1;++n)if(M2(r,e,i[n],i[n+1]))return!0;return!1}u(C2,"lineIntersectPolygon");function Rg(r,e){for(let t=0;t<r.length;++t)if(!Qc(r[t],e))return!1;for(let t=0;t<r.length-1;++t)if(C2(r[t],r[t+1],e))return!1;return!0}u(Rg,"lineStringWithinPolygon");function E2(r,e){for(let t=0;t<e.length;t++)if(Rg(r,e[t]))return!0;return!1}u(E2,"lineStringWithinPolygons");function ep(r,e,t){let i=[];for(let n=0;n<r.length;n++){let a=[];for(let o=0;o<r[n].length;o++){let s=S2(r[n][o],t);Jc(e,s),a.push(s)}i.push(a)}return i}u(ep,"getTilePolygon");function Og(r,e,t){let i=[];for(let n=0;n<r.length;n++){let a=ep(r[n],e,t);i.push(a)}return i}u(Og,"getTilePolygons");function Vg(r,e,t,i){if(r[0]<t[0]||r[0]>t[2]){let n=i*.5,a=r[0]-t[0]>n?-i:t[0]-r[0]>n?i:0;a===0&&(a=r[0]-t[2]>n?-i:t[2]-r[0]>n?i:0),r[0]+=a}Jc(e,r)}u(Vg,"updatePoint");function k2(r){r[0]=r[1]=1/0,r[2]=r[3]=-1/0}u(k2,"resetBBox");function mg(r,e,t,i){let n=Math.pow(2,i.z)*dr,a=[i.x*dr,i.y*dr],o=[];for(let s of r)for(let l of s){let c=[l.x+a[0],l.y+a[1]];Vg(c,e,t,n),o.push(c)}return o}u(mg,"getTilePoints");function dg(r,e,t,i){let n=Math.pow(2,i.z)*dr,a=[i.x*dr,i.y*dr],o=[];for(let s of r){let l=[];for(let c of s){let p=[c.x+a[0],c.y+a[1]];Jc(e,p),l.push(p)}o.push(l)}if(e[2]-e[0]<=n/2){k2(e);for(let s of o)for(let l of s)Vg(l,e,t,n)}return o}u(dg,"getTileLines");function L2(r,e){let t=[1/0,1/0,-1/0,-1/0],i=[1/0,1/0,-1/0,-1/0],n=r.canonicalID();if(e.type==="Polygon"){let a=ep(e.coordinates,i,n),o=mg(r.geometry(),t,i,n);if(!Co(t,i))return!1;for(let s of o)if(!Qc(s,a))return!1}if(e.type==="MultiPolygon"){let a=Og(e.coordinates,i,n),o=mg(r.geometry(),t,i,n);if(!Co(t,i))return!1;for(let s of o)if(!A2(s,a))return!1}return!0}u(L2,"pointsWithinPolygons");function D2(r,e){let t=[1/0,1/0,-1/0,-1/0],i=[1/0,1/0,-1/0,-1/0],n=r.canonicalID();if(e.type==="Polygon"){let a=ep(e.coordinates,i,n),o=dg(r.geometry(),t,i,n);if(!Co(t,i))return!1;for(let s of o)if(!Rg(s,a))return!1}if(e.type==="MultiPolygon"){let a=Og(e.coordinates,i,n),o=dg(r.geometry(),t,i,n);if(!Co(t,i))return!1;for(let s of o)if(!E2(s,a))return!1}return!0}u(D2,"linesWithinPolygons");var Mi=class Mi{constructor(e,t){this.type=oe,this.geojson=e,this.geometries=t}static parse(e,t){if(e.length!==2)return t.error("'within' expression requires exactly one argument, but found ".concat(e.length-1," instead."));if(To(e[1])){let i=e[1];if(i.type==="FeatureCollection")for(let n=0;n<i.features.length;++n){let a=i.features[n].geometry.type;if(a==="Polygon"||a==="MultiPolygon")return new Mi(i,i.features[n].geometry)}else if(i.type==="Feature"){let n=i.geometry.type;if(n==="Polygon"||n==="MultiPolygon")return new Mi(i,i.geometry)}else if(i.type==="Polygon"||i.type==="MultiPolygon")return new Mi(i,i)}return t.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(e){if(e.geometry()!=null&&e.canonicalID()!=null){if(e.geometryType()==="Point")return L2(e,this.geometries);if(e.geometryType()==="LineString")return D2(e,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}};u(Mi,"Within");var Nn=Mi,qo=class qo{constructor(e,t){this.type=t.type,this.name=e,this.boundExpression=t}static parse(e,t){if(e.length!==2||typeof e[1]!="string")return t.error("'var' expression requires exactly one string literal argument.");let i=e[1];return t.scope.has(i)?new qo(i,t.scope.get(i)):t.error('Unknown variable "'.concat(i,'". Make sure "').concat(i,'" has been bound in an enclosing "let" expression before using it.'),1)}evaluate(e){return this.boundExpression.evaluate(e)}eachChild(){}outputDefined(){return!1}};u(qo,"Var");var Eo=qo,$r=class $r{constructor(e,t,i,n){this.name=e,this.type=t,this._evaluate=i,this.args=n}evaluate(e){return this._evaluate(e,this.args)}eachChild(e){this.args.forEach(e)}outputDefined(){return!1}static parse(e,t){let i=e[0],n=$r.definitions[i];if(!n)return t.error('Unknown expression "'.concat(i,'". If you wanted a literal array, use ["literal", [...]].'),0);let a=Array.isArray(n)?n[0]:n.type,o=Array.isArray(n)?[[n[1],n[2]]]:n.overloads,s=o.filter(([c])=>!Array.isArray(c)||c.length===e.length-1),l=null;for(let[c,p]of s){l=new Io(t.registry,ko,t.path,null,t.scope);let h=[],f=!1;for(let m=1;m<e.length;m++){let g=e[m],y=Array.isArray(c)?c[m-1]:c.type,x=l.parse(g,1+h.length,y);if(!x){f=!0;break}h.push(x)}if(!f){if(Array.isArray(c)&&c.length!==h.length){l.error("Expected ".concat(c.length," arguments, but found ").concat(h.length," instead."));continue}for(let m=0;m<h.length;m++){let g=Array.isArray(c)?c[m]:c.type,y=h[m];l.concat(m+1).checkSubtype(g,y.type)}if(l.errors.length===0)return new $r(i,a,p,h)}}if(s.length===1)t.errors.push(...l.errors);else{let p=(s.length?s:o).map(([f])=>z2(f)).join(" | "),h=[];for(let f=1;f<e.length;f++){let m=t.parse(e[f],1+h.length);if(!m)return null;h.push(Ue(m.type))}t.error("Expected arguments of type ".concat(p,", but found (").concat(h.join(", "),") instead."))}return null}static register(e,t){$r.definitions=t;for(let i in t)e[i]=$r}};u($r,"CompoundExpression");var qt=$r;function z2(r){return Array.isArray(r)?"(".concat(r.map(Ue).join(", "),")"):"(".concat(Ue(r.type),"...)")}u(z2,"stringifySignature");function ko(r){if(r instanceof Eo)return ko(r.boundExpression);if(r instanceof qt&&r.name==="error")return!1;if(r instanceof Mo)return!1;if(r instanceof Nn)return!1;let e=r instanceof mr||r instanceof Rt,t=!0;return r.eachChild(i=>{e?t=t&&ko(i):t=t&&i instanceof yr}),t?ns(r)&&as(r,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"]):!1}u(ko,"isExpressionConstant");function ns(r){if(r instanceof qt){if(r.name==="get"&&r.args.length===1)return!1;if(r.name==="feature-state")return!1;if(r.name==="has"&&r.args.length===1)return!1;if(r.name==="properties"||r.name==="geometry-type"||r.name==="id")return!1;if(/^filter-/.test(r.name))return!1}if(r instanceof Nn)return!1;let e=!0;return r.eachChild(t=>{e&&!ns(t)&&(e=!1)}),e}u(ns,"isFeatureConstant");function Gn(r){if(r instanceof qt&&r.name==="feature-state")return!1;let e=!0;return r.eachChild(t=>{e&&!Gn(t)&&(e=!1)}),e}u(Gn,"isStateConstant");function as(r,e){if(r instanceof qt&&e.indexOf(r.name)>=0)return!1;let t=!0;return r.eachChild(i=>{t&&!as(i,e)&&(t=!1)}),t}u(as,"isGlobalPropertyConstant");function os(r,e){let t=r.length-1,i=0,n=t,a=0,o,s;for(;i<=n;)if(a=Math.floor((i+n)/2),o=r[a],s=r[a+1],o<=e){if(a===t||e<s)return a;i=a+1}else if(o>e)n=a-1;else throw new Ne("Input is not a number.");return 0}u(os,"findStopLessThanOrEqualTo");var jo=class jo{constructor(e,t,i){this.type=e,this.input=t,this.labels=[],this.outputs=[];for(let[n,a]of i)this.labels.push(n),this.outputs.push(a)}static parse(e,t){if(e.length-1<4)return t.error("Expected at least 4 arguments, but found only ".concat(e.length-1,"."));if((e.length-1)%2!==0)return t.error("Expected an even number of arguments.");let i=t.parse(e[1],1,j);if(!i)return null;let n=[],a=null;t.expectedType&&t.expectedType.kind!=="value"&&(a=t.expectedType);for(let o=1;o<e.length;o+=2){let s=o===1?-1/0:e[o],l=e[o+1],c=o,p=o+1;if(typeof s!="number")return t.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',c);if(n.length&&n[n.length-1][0]>=s)return t.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',c);let h=t.parse(l,p,a);if(!h)return null;a=a||h.type,n.push([s,h])}return new jo(a,i,n)}evaluate(e){let t=this.labels,i=this.outputs;if(t.length===1)return i[0].evaluate(e);let n=this.input.evaluate(e);if(n<=t[0])return i[0].evaluate(e);let a=t.length;if(n>=t[a-1])return i[a-1].evaluate(e);let o=os(t,n);return i[o].evaluate(e)}eachChild(e){e(this.input);for(let t of this.outputs)e(t)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}};u(jo,"Step");var Li=jo;function F2(r){return r==="rgb"||r==="hcl"||r==="lab"}u(F2,"isSupportedInterpolationColorSpace");function Hr(r,e,t){return r+t*(e-r)}u(Hr,"number");function B2(r,e,t,i="rgb"){switch(i){case"rgb":{let[n,a,o,s]=Lo(r.rgb,e.rgb,t);return new K(n,a,o,s,!1)}case"hcl":{let[n,a,o,s]=r.hcl,[l,c,p,h]=e.hcl,f,m;if(!isNaN(n)&&!isNaN(l)){let _=l-n;l>n&&_>180?_-=360:l<n&&n-l>180&&(_+=360),f=n+t*_}else isNaN(n)?isNaN(l)?f=NaN:(f=l,(o===1||o===0)&&(m=c)):(f=n,(p===1||p===0)&&(m=a));let[g,y,x,b]=d2([f,m!=null?m:Hr(a,c,t),Hr(o,p,t),Hr(s,h,t)]);return new K(g,y,x,b,!1)}case"lab":{let[n,a,o,s]=Fg(Lo(r.lab,e.lab,t));return new K(n,a,o,s,!1)}}}u(B2,"color");function Lo(r,e,t){return r.map((i,n)=>Hr(i,e[n],t))}u(Lo,"array");function R2(r,e,t){return new Ot(Lo(r.values,e.values,t))}u(R2,"padding");function O2(r,e,t){let i=r.values,n=e.values;if(i.length!==n.length)throw new Ne("Cannot interpolate values of different length. from: ".concat(r.toString(),", to: ").concat(e.toString()));let a=[];for(let o=0;o<i.length;o+=2){if(i[o]!==n[o])throw new Ne("Cannot interpolate values containing mismatched anchors. from[".concat(o,"]: ").concat(i[o],", to[").concat(o,"]: ").concat(n[o]));a.push(i[o]);let[s,l]=i[o+1],[c,p]=n[o+1];a.push([Hr(s,c,t),Hr(l,p,t)])}return new Qt(a)}u(O2,"variableAnchorOffsetCollection");var ke={number:Hr,color:B2,array:Lo,padding:R2,variableAnchorOffsetCollection:O2},Dn=class Dn{constructor(e,t,i,n,a){this.type=e,this.operator=t,this.interpolation=i,this.input=n,this.labels=[],this.outputs=[];for(let[o,s]of a)this.labels.push(o),this.outputs.push(s)}static interpolationFactor(e,t,i,n){let a=0;if(e.name==="exponential")a=Bc(t,e.base,i,n);else if(e.name==="linear")a=Bc(t,1,i,n);else if(e.name==="cubic-bezier"){let o=e.controlPoints;a=new Pg.default(o[0],o[1],o[2],o[3]).solve(Bc(t,1,i,n))}return a}static parse(e,t){let[i,n,a,...o]=e;if(!Array.isArray(n)||n.length===0)return t.error("Expected an interpolation type expression.",1);if(n[0]==="linear")n={name:"linear"};else if(n[0]==="exponential"){let c=n[1];if(typeof c!="number")return t.error("Exponential interpolation requires a numeric base.",1,1);n={name:"exponential",base:c}}else if(n[0]==="cubic-bezier"){let c=n.slice(1);if(c.length!==4||c.some(p=>typeof p!="number"||p<0||p>1))return t.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);n={name:"cubic-bezier",controlPoints:c}}else return t.error("Unknown interpolation type ".concat(String(n[0])),1,0);if(e.length-1<4)return t.error("Expected at least 4 arguments, but found only ".concat(e.length-1,"."));if((e.length-1)%2!==0)return t.error("Expected an even number of arguments.");if(a=t.parse(a,2,j),!a)return null;let s=[],l=null;i==="interpolate-hcl"||i==="interpolate-lab"?l=Lt:t.expectedType&&t.expectedType.kind!=="value"&&(l=t.expectedType);for(let c=0;c<o.length;c+=2){let p=o[c],h=o[c+1],f=c+3,m=c+4;if(typeof p!="number")return t.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',f);if(s.length&&s[s.length-1][0]>=p)return t.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',f);let g=t.parse(h,m,l);if(!g)return null;l=l||g.type,s.push([p,g])}return!Mn(l,j)&&!Mn(l,Lt)&&!Mn(l,rs)&&!Mn(l,is)&&!Mn(l,vt(j))?t.error("Type ".concat(Ue(l)," is not interpolatable.")):new Dn(l,i,n,a,s)}evaluate(e){let t=this.labels,i=this.outputs;if(t.length===1)return i[0].evaluate(e);let n=this.input.evaluate(e);if(n<=t[0])return i[0].evaluate(e);let a=t.length;if(n>=t[a-1])return i[a-1].evaluate(e);let o=os(t,n),s=t[o],l=t[o+1],c=Dn.interpolationFactor(this.interpolation,n,s,l),p=i[o].evaluate(e),h=i[o+1].evaluate(e);switch(this.operator){case"interpolate":return ke[this.type.kind](p,h,c);case"interpolate-hcl":return ke.color(p,h,c,"hcl");case"interpolate-lab":return ke.color(p,h,c,"lab")}}eachChild(e){e(this.input);for(let t of this.outputs)e(t)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}};u(Dn,"Interpolate");var wt=Dn;function Bc(r,e,t,i){let n=i-t,a=r-t;return n===0?0:e===1?a/n:(Math.pow(e,a)-1)/(Math.pow(e,n)-1)}u(Bc,"exponentialInterpolation");var zn=class zn{constructor(e,t){this.type=e,this.args=t}static parse(e,t){if(e.length<2)return t.error("Expectected at least one argument.");let i=null,n=t.expectedType;n&&n.kind!=="value"&&(i=n);let a=[];for(let s of e.slice(1)){let l=t.parse(s,1+a.length,i,void 0,{typeAnnotation:"omit"});if(!l)return null;i=i||l.type,a.push(l)}if(!i)throw new Error("No output type");return n&&a.some(s=>Rn(n,s.type))?new zn(se,a):new zn(i,a)}evaluate(e){let t=null,i=0,n;for(let a of this.args)if(i++,t=a.evaluate(e),t&&t instanceof pt&&!t.available&&(n||(n=t.name),t=null,i===this.args.length&&(t=n)),t!==null)break;return t}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}};u(zn,"Coalesce");var Do=zn,$o=class $o{constructor(e,t){this.type=t.type,this.bindings=[].concat(e),this.result=t}evaluate(e){return this.result.evaluate(e)}eachChild(e){for(let t of this.bindings)e(t[1]);e(this.result)}static parse(e,t){if(e.length<4)return t.error("Expected at least 3 arguments, but found ".concat(e.length-1," instead."));let i=[];for(let a=1;a<e.length-1;a+=2){let o=e[a];if(typeof o!="string")return t.error("Expected string, but found ".concat(typeof o," instead."),a);if(/[^a-zA-Z0-9_]/.test(o))return t.error("Variable names must contain only alphanumeric characters or '_'.",a);let s=t.parse(e[a+1],a+1);if(!s)return null;i.push([o,s])}let n=t.parse(e[e.length-1],e.length-1,t.expectedType,i);return n?new $o(i,n):null}outputDefined(){return this.result.outputDefined()}};u($o,"Let");var zo=$o,Ho=class Ho{constructor(e,t,i){this.type=e,this.index=t,this.input=i}static parse(e,t){if(e.length!==3)return t.error("Expected 2 arguments, but found ".concat(e.length-1," instead."));let i=t.parse(e[1],1,j),n=t.parse(e[2],2,vt(t.expectedType||se));if(!i||!n)return null;let a=n.type;return new Ho(a.itemType,i,n)}evaluate(e){let t=this.index.evaluate(e),i=this.input.evaluate(e);if(t<0)throw new Ne("Array index out of bounds: ".concat(t," < 0."));if(t>=i.length)throw new Ne("Array index out of bounds: ".concat(t," > ").concat(i.length-1,"."));if(t!==Math.floor(t))throw new Ne("Array index must be an integer, but found ".concat(t," instead."));return i[t]}eachChild(e){e(this.index),e(this.input)}outputDefined(){return!1}};u(Ho,"At");var Uc=Ho,Zo=class Zo{constructor(e,t){this.type=oe,this.needle=e,this.haystack=t}static parse(e,t){if(e.length!==3)return t.error("Expected 2 arguments, but found ".concat(e.length-1," instead."));let i=t.parse(e[1],1,se),n=t.parse(e[2],2,se);return!i||!n?null:Yc(i.type,[oe,ce,j,zi,se])?new Zo(i,n):t.error("Expected first argument to be of type boolean, string, number or null, but found ".concat(Ue(i.type)," instead"))}evaluate(e){let t=this.needle.evaluate(e),i=this.haystack.evaluate(e);if(!i)return!1;if(!On(t,["boolean","string","number","null"]))throw new Ne("Expected first argument to be of type boolean, string, number or null, but found ".concat(Ue(We(t))," instead."));if(!On(i,["string","array"]))throw new Ne("Expected second argument to be of type array or string, but found ".concat(Ue(We(i))," instead."));return i.indexOf(t)>=0}eachChild(e){e(this.needle),e(this.haystack)}outputDefined(){return!0}};u(Zo,"In");var Nc=Zo,Fn=class Fn{constructor(e,t,i){this.type=j,this.needle=e,this.haystack=t,this.fromIndex=i}static parse(e,t){if(e.length<=2||e.length>=5)return t.error("Expected 3 or 4 arguments, but found ".concat(e.length-1," instead."));let i=t.parse(e[1],1,se),n=t.parse(e[2],2,se);if(!i||!n)return null;if(!Yc(i.type,[oe,ce,j,zi,se]))return t.error("Expected first argument to be of type boolean, string, number or null, but found ".concat(Ue(i.type)," instead"));if(e.length===4){let a=t.parse(e[3],3,j);return a?new Fn(i,n,a):null}else return new Fn(i,n)}evaluate(e){let t=this.needle.evaluate(e),i=this.haystack.evaluate(e);if(!On(t,["boolean","string","number","null"]))throw new Ne("Expected first argument to be of type boolean, string, number or null, but found ".concat(Ue(We(t))," instead."));if(!On(i,["string","array"]))throw new Ne("Expected second argument to be of type array or string, but found ".concat(Ue(We(i))," instead."));if(this.fromIndex){let n=this.fromIndex.evaluate(e);return i.indexOf(t,n)}return i.indexOf(t)}eachChild(e){e(this.needle),e(this.haystack),this.fromIndex&&e(this.fromIndex)}outputDefined(){return!1}};u(Fn,"IndexOf");var Gc=Fn,Wo=class Wo{constructor(e,t,i,n,a,o){this.inputType=e,this.type=t,this.input=i,this.cases=n,this.outputs=a,this.otherwise=o}static parse(e,t){if(e.length<5)return t.error("Expected at least 4 arguments, but found only ".concat(e.length-1,"."));if(e.length%2!==1)return t.error("Expected an even number of arguments.");let i,n;t.expectedType&&t.expectedType.kind!=="value"&&(n=t.expectedType);let a={},o=[];for(let c=2;c<e.length-1;c+=2){let p=e[c],h=e[c+1];Array.isArray(p)||(p=[p]);let f=t.concat(c);if(p.length===0)return f.error("Expected at least one branch label.");for(let g of p){if(typeof g!="number"&&typeof g!="string")return f.error("Branch labels must be numbers or strings.");if(typeof g=="number"&&Math.abs(g)>Number.MAX_SAFE_INTEGER)return f.error("Branch labels must be integers no larger than ".concat(Number.MAX_SAFE_INTEGER,"."));if(typeof g=="number"&&Math.floor(g)!==g)return f.error("Numeric branch labels must be integer values.");if(!i)i=We(g);else if(f.checkSubtype(i,We(g)))return null;if(typeof a[String(g)]<"u")return f.error("Branch labels must be unique.");a[String(g)]=o.length}let m=t.parse(h,c,n);if(!m)return null;n=n||m.type,o.push(m)}let s=t.parse(e[1],1,se);if(!s)return null;let l=t.parse(e[e.length-1],e.length-1,n);return!l||s.type.kind!=="value"&&t.concat(1).checkSubtype(i,s.type)?null:new Wo(i,n,s,a,o,l)}evaluate(e){let t=this.input.evaluate(e);return(We(t)===this.inputType&&this.outputs[this.cases[t]]||this.otherwise).evaluate(e)}eachChild(e){e(this.input),this.outputs.forEach(e),e(this.otherwise)}outputDefined(){return this.outputs.every(e=>e.outputDefined())&&this.otherwise.outputDefined()}};u(Wo,"Match");var qc=Wo,Xo=class Xo{constructor(e,t,i){this.type=e,this.branches=t,this.otherwise=i}static parse(e,t){if(e.length<4)return t.error("Expected at least 3 arguments, but found only ".concat(e.length-1,"."));if(e.length%2!==0)return t.error("Expected an odd number of arguments.");let i;t.expectedType&&t.expectedType.kind!=="value"&&(i=t.expectedType);let n=[];for(let o=1;o<e.length-1;o+=2){let s=t.parse(e[o],o,oe);if(!s)return null;let l=t.parse(e[o+1],o+1,i);if(!l)return null;n.push([s,l]),i=i||l.type}let a=t.parse(e[e.length-1],e.length-1,i);if(!a)return null;if(!i)throw new Error("Can't infer output type");return new Xo(i,n,a)}evaluate(e){for(let[t,i]of this.branches)if(t.evaluate(e))return i.evaluate(e);return this.otherwise.evaluate(e)}eachChild(e){for(let[t,i]of this.branches)e(t),e(i);e(this.otherwise)}outputDefined(){return this.branches.every(([e,t])=>t.outputDefined())&&this.otherwise.outputDefined()}};u(Xo,"Case");var jc=Xo,Bn=class Bn{constructor(e,t,i,n){this.type=e,this.input=t,this.beginIndex=i,this.endIndex=n}static parse(e,t){if(e.length<=2||e.length>=5)return t.error("Expected 3 or 4 arguments, but found ".concat(e.length-1," instead."));let i=t.parse(e[1],1,se),n=t.parse(e[2],2,j);if(!i||!n)return null;if(!Yc(i.type,[vt(se),ce,se]))return t.error("Expected first argument to be of type array or string, but found ".concat(Ue(i.type)," instead"));if(e.length===4){let a=t.parse(e[3],3,j);return a?new Bn(i.type,i,n,a):null}else return new Bn(i.type,i,n)}evaluate(e){let t=this.input.evaluate(e),i=this.beginIndex.evaluate(e);if(!On(t,["string","array"]))throw new Ne("Expected first argument to be of type array or string, but found ".concat(Ue(We(t))," instead."));if(this.endIndex){let n=this.endIndex.evaluate(e);return t.slice(i,n)}return t.slice(i)}eachChild(e){e(this.input),e(this.beginIndex),this.endIndex&&e(this.endIndex)}outputDefined(){return!1}};u(Bn,"Slice");var $c=Bn;function yg(r,e){return r==="=="||r==="!="?e.kind==="boolean"||e.kind==="string"||e.kind==="number"||e.kind==="null"||e.kind==="value":e.kind==="string"||e.kind==="number"||e.kind==="value"}u(yg,"isComparableType");function V2(r,e,t){return e===t}u(V2,"eq");function U2(r,e,t){return e!==t}u(U2,"neq");function N2(r,e,t){return e<t}u(N2,"lt");function G2(r,e,t){return e>t}u(G2,"gt");function q2(r,e,t){return e<=t}u(q2,"lteq");function j2(r,e,t){return e>=t}u(j2,"gteq");function Ug(r,e,t,i){return i.compare(e,t)===0}u(Ug,"eqCollate");function $2(r,e,t,i){return!Ug(r,e,t,i)}u($2,"neqCollate");function H2(r,e,t,i){return i.compare(e,t)<0}u(H2,"ltCollate");function Z2(r,e,t,i){return i.compare(e,t)>0}u(Z2,"gtCollate");function W2(r,e,t,i){return i.compare(e,t)<=0}u(W2,"lteqCollate");function X2(r,e,t,i){return i.compare(e,t)>=0}u(X2,"gteqCollate");function Bi(r,e,t){var n;let i=r!=="=="&&r!=="!=";return n=class{constructor(o,s,l){this.type=oe,this.lhs=o,this.rhs=s,this.collator=l,this.hasUntypedArgument=o.type.kind==="value"||s.type.kind==="value"}static parse(o,s){if(o.length!==3&&o.length!==4)return s.error("Expected two or three arguments.");let l=o[0],c=s.parse(o[1],1,se);if(!c)return null;if(!yg(l,c.type))return s.concat(1).error('"'.concat(l,"\" comparisons are not supported for type '").concat(Ue(c.type),"'."));let p=s.parse(o[2],2,se);if(!p)return null;if(!yg(l,p.type))return s.concat(2).error('"'.concat(l,"\" comparisons are not supported for type '").concat(Ue(p.type),"'."));if(c.type.kind!==p.type.kind&&c.type.kind!=="value"&&p.type.kind!=="value")return s.error("Cannot compare types '".concat(Ue(c.type),"' and '").concat(Ue(p.type),"'."));i&&(c.type.kind==="value"&&p.type.kind!=="value"?c=new Rt(p.type,[c]):c.type.kind!=="value"&&p.type.kind==="value"&&(p=new Rt(c.type,[p])));let h=null;if(o.length===4){if(c.type.kind!=="string"&&p.type.kind!=="string"&&c.type.kind!=="value"&&p.type.kind!=="value")return s.error("Cannot use collator to compare non-string types.");if(h=s.parse(o[3],3,ts),!h)return null}return new n(c,p,h)}evaluate(o){let s=this.lhs.evaluate(o),l=this.rhs.evaluate(o);if(i&&this.hasUntypedArgument){let c=We(s),p=We(l);if(c.kind!==p.kind||!(c.kind==="string"||c.kind==="number"))throw new Ne('Expected arguments for "'.concat(r,'" to be (string, string) or (number, number), but found (').concat(c.kind,", ").concat(p.kind,") instead."))}if(this.collator&&!i&&this.hasUntypedArgument){let c=We(s),p=We(l);if(c.kind!=="string"||p.kind!=="string")return e(o,s,l)}return this.collator?t(o,s,l,this.collator.evaluate(o)):e(o,s,l)}eachChild(o){o(this.lhs),o(this.rhs),this.collator&&o(this.collator)}outputDefined(){return!0}},u(n,"Comparison"),n}u(Bi,"makeComparison");var K2=Bi("==",V2,Ug),Y2=Bi("!=",U2,$2),J2=Bi("<",N2,H2),Q2=Bi(">",G2,Z2),eS=Bi("<=",q2,W2),tS=Bi(">=",j2,X2),Ko=class Ko{constructor(e,t,i,n,a){this.type=ce,this.number=e,this.locale=t,this.currency=i,this.minFractionDigits=n,this.maxFractionDigits=a}static parse(e,t){if(e.length!==3)return t.error("Expected two arguments.");let i=t.parse(e[1],1,j);if(!i)return null;let n=e[2];if(typeof n!="object"||Array.isArray(n))return t.error("NumberFormat options argument must be an object.");let a=null;if(n.locale&&(a=t.parse(n.locale,1,ce),!a))return null;let o=null;if(n.currency&&(o=t.parse(n.currency,1,ce),!o))return null;let s=null;if(n["min-fraction-digits"]&&(s=t.parse(n["min-fraction-digits"],1,j),!s))return null;let l=null;return n["max-fraction-digits"]&&(l=t.parse(n["max-fraction-digits"],1,j),!l)?null:new Ko(i,a,o,s,l)}evaluate(e){return new Intl.NumberFormat(this.locale?this.locale.evaluate(e):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(e):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(e):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(e):void 0}).format(this.number.evaluate(e))}eachChild(e){e(this.number),this.locale&&e(this.locale),this.currency&&e(this.currency),this.minFractionDigits&&e(this.minFractionDigits),this.maxFractionDigits&&e(this.maxFractionDigits)}outputDefined(){return!1}};u(Ko,"NumberFormat");var Hc=Ko,Yo=class Yo{constructor(e){this.type=Fi,this.sections=e}static parse(e,t){if(e.length<2)return t.error("Expected at least one argument.");let i=e[1];if(!Array.isArray(i)&&typeof i=="object")return t.error("First argument must be an image or text section.");let n=[],a=!1;for(let o=1;o<=e.length-1;++o){let s=e[o];if(a&&typeof s=="object"&&!Array.isArray(s)){a=!1;let l=null;if(s["font-scale"]&&(l=t.parse(s["font-scale"],1,j),!l))return null;let c=null;if(s["text-font"]&&(c=t.parse(s["text-font"],1,vt(ce)),!c))return null;let p=null;if(s["text-color"]&&(p=t.parse(s["text-color"],1,Lt),!p))return null;let h=n[n.length-1];h.scale=l,h.font=c,h.textColor=p}else{let l=t.parse(e[o],1,se);if(!l)return null;let c=l.type.kind;if(c!=="string"&&c!=="value"&&c!=="null"&&c!=="resolvedImage")return t.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");a=!0,n.push({content:l,scale:null,font:null,textColor:null})}}return new Yo(n)}evaluate(e){let t=u(i=>{let n=i.content.evaluate(e);return We(n)===Hn?new Un("",n,null,null,null):new Un(Cn(n),null,i.scale?i.scale.evaluate(e):null,i.font?i.font.evaluate(e).join(","):null,i.textColor?i.textColor.evaluate(e):null)},"evaluateSection");return new St(this.sections.map(t))}eachChild(e){for(let t of this.sections)e(t.content),t.scale&&e(t.scale),t.font&&e(t.font),t.textColor&&e(t.textColor)}outputDefined(){return!1}};u(Yo,"FormatExpression");var qn=Yo,Jo=class Jo{constructor(e){this.type=Hn,this.input=e}static parse(e,t){if(e.length!==2)return t.error("Expected two arguments.");let i=t.parse(e[1],1,ce);return i?new Jo(i):t.error("No image name provided.")}evaluate(e){let t=this.input.evaluate(e),i=pt.fromString(t);return i&&e.availableImages&&(i.available=e.availableImages.indexOf(t)>-1),i}eachChild(e){e(this.input)}outputDefined(){return!1}};u(Jo,"ImageExpression");var Zc=Jo,Qo=class Qo{constructor(e){this.type=j,this.input=e}static parse(e,t){if(e.length!==2)return t.error("Expected 1 argument, but found ".concat(e.length-1," instead."));let i=t.parse(e[1],1);return i?i.type.kind!=="array"&&i.type.kind!=="string"&&i.type.kind!=="value"?t.error("Expected argument of type string or array, but found ".concat(Ue(i.type)," instead.")):new Qo(i):null}evaluate(e){let t=this.input.evaluate(e);if(typeof t=="string")return t.length;if(Array.isArray(t))return t.length;throw new Ne("Expected value to be of type string or array, but found ".concat(Ue(We(t))," instead."))}eachChild(e){e(this.input)}outputDefined(){return!1}};u(Qo,"Length");var Wc=Qo,Kr={"==":K2,"!=":Y2,">":Q2,"<":J2,">=":tS,"<=":eS,array:Rt,at:Uc,boolean:Rt,case:jc,coalesce:Do,collator:Mo,format:qn,image:Zc,in:Nc,"index-of":Gc,interpolate:wt,"interpolate-hcl":wt,"interpolate-lab":wt,length:Wc,let:zo,literal:yr,match:qc,number:Rt,"number-format":Hc,object:Rt,slice:$c,step:Li,string:Rt,"to-boolean":mr,"to-color":mr,"to-number":mr,"to-string":mr,var:Eo,within:Nn};function gg(r,[e,t,i,n]){e=e.evaluate(r),t=t.evaluate(r),i=i.evaluate(r);let a=n?n.evaluate(r):1,o=Bg(e,t,i,a);if(o)throw new Ne(o);return new K(e/255,t/255,i/255,a,!1)}u(gg,"rgba");function xg(r,e){return r in e}u(xg,"has");function Rc(r,e){let t=e[r];return typeof t>"u"?null:t}u(Rc,"get");function rS(r,e,t,i){for(;t<=i;){let n=t+i>>1;if(e[n]===r)return!0;e[n]>r?i=n-1:t=n+1}return!1}u(rS,"binarySearch");function jr(r){return{type:r}}u(jr,"varargs");qt.register(Kr,{error:[u2,[ce],(r,[e])=>{throw new Ne(e.evaluate(r))}],typeof:[ce,[se],(r,[e])=>Ue(We(e.evaluate(r)))],"to-rgba":[vt(j,4),[Lt],(r,[e])=>{let[t,i,n,a]=e.evaluate(r).rgb;return[t*255,i*255,n*255,a]}],rgb:[Lt,[j,j,j],gg],rgba:[Lt,[j,j,j,j],gg],has:{type:oe,overloads:[[[ce],(r,[e])=>xg(e.evaluate(r),r.properties())],[[ce,Ci],(r,[e,t])=>xg(e.evaluate(r),t.evaluate(r))]]},get:{type:se,overloads:[[[ce],(r,[e])=>Rc(e.evaluate(r),r.properties())],[[ce,Ci],(r,[e,t])=>Rc(e.evaluate(r),t.evaluate(r))]]},"feature-state":[se,[ce],(r,[e])=>Rc(e.evaluate(r),r.featureState||{})],properties:[Ci,[],r=>r.properties()],"geometry-type":[ce,[],r=>r.geometryType()],id:[se,[],r=>r.id()],zoom:[j,[],r=>r.globals.zoom],"heatmap-density":[j,[],r=>r.globals.heatmapDensity||0],"line-progress":[j,[],r=>r.globals.lineProgress||0],accumulated:[se,[],r=>r.globals.accumulated===void 0?null:r.globals.accumulated],"+":[j,jr(j),(r,e)=>{let t=0;for(let i of e)t+=i.evaluate(r);return t}],"*":[j,jr(j),(r,e)=>{let t=1;for(let i of e)t*=i.evaluate(r);return t}],"-":{type:j,overloads:[[[j,j],(r,[e,t])=>e.evaluate(r)-t.evaluate(r)],[[j],(r,[e])=>-e.evaluate(r)]]},"/":[j,[j,j],(r,[e,t])=>e.evaluate(r)/t.evaluate(r)],"%":[j,[j,j],(r,[e,t])=>e.evaluate(r)%t.evaluate(r)],ln2:[j,[],()=>Math.LN2],pi:[j,[],()=>Math.PI],e:[j,[],()=>Math.E],"^":[j,[j,j],(r,[e,t])=>Math.pow(e.evaluate(r),t.evaluate(r))],sqrt:[j,[j],(r,[e])=>Math.sqrt(e.evaluate(r))],log10:[j,[j],(r,[e])=>Math.log(e.evaluate(r))/Math.LN10],ln:[j,[j],(r,[e])=>Math.log(e.evaluate(r))],log2:[j,[j],(r,[e])=>Math.log(e.evaluate(r))/Math.LN2],sin:[j,[j],(r,[e])=>Math.sin(e.evaluate(r))],cos:[j,[j],(r,[e])=>Math.cos(e.evaluate(r))],tan:[j,[j],(r,[e])=>Math.tan(e.evaluate(r))],asin:[j,[j],(r,[e])=>Math.asin(e.evaluate(r))],acos:[j,[j],(r,[e])=>Math.acos(e.evaluate(r))],atan:[j,[j],(r,[e])=>Math.atan(e.evaluate(r))],min:[j,jr(j),(r,e)=>Math.min(...e.map(t=>t.evaluate(r)))],max:[j,jr(j),(r,e)=>Math.max(...e.map(t=>t.evaluate(r)))],abs:[j,[j],(r,[e])=>Math.abs(e.evaluate(r))],round:[j,[j],(r,[e])=>{let t=e.evaluate(r);return t<0?-Math.round(-t):Math.round(t)}],floor:[j,[j],(r,[e])=>Math.floor(e.evaluate(r))],ceil:[j,[j],(r,[e])=>Math.ceil(e.evaluate(r))],"filter-==":[oe,[ce,se],(r,[e,t])=>r.properties()[e.value]===t.value],"filter-id-==":[oe,[se],(r,[e])=>r.id()===e.value],"filter-type-==":[oe,[ce],(r,[e])=>r.geometryType()===e.value],"filter-<":[oe,[ce,se],(r,[e,t])=>{let i=r.properties()[e.value],n=t.value;return typeof i==typeof n&&i<n}],"filter-id-<":[oe,[se],(r,[e])=>{let t=r.id(),i=e.value;return typeof t==typeof i&&t<i}],"filter->":[oe,[ce,se],(r,[e,t])=>{let i=r.properties()[e.value],n=t.value;return typeof i==typeof n&&i>n}],"filter-id->":[oe,[se],(r,[e])=>{let t=r.id(),i=e.value;return typeof t==typeof i&&t>i}],"filter-<=":[oe,[ce,se],(r,[e,t])=>{let i=r.properties()[e.value],n=t.value;return typeof i==typeof n&&i<=n}],"filter-id-<=":[oe,[se],(r,[e])=>{let t=r.id(),i=e.value;return typeof t==typeof i&&t<=i}],"filter->=":[oe,[ce,se],(r,[e,t])=>{let i=r.properties()[e.value],n=t.value;return typeof i==typeof n&&i>=n}],"filter-id->=":[oe,[se],(r,[e])=>{let t=r.id(),i=e.value;return typeof t==typeof i&&t>=i}],"filter-has":[oe,[se],(r,[e])=>e.value in r.properties()],"filter-has-id":[oe,[],r=>r.id()!==null&&r.id()!==void 0],"filter-type-in":[oe,[vt(ce)],(r,[e])=>e.value.indexOf(r.geometryType())>=0],"filter-id-in":[oe,[vt(se)],(r,[e])=>e.value.indexOf(r.id())>=0],"filter-in-small":[oe,[ce,vt(se)],(r,[e,t])=>t.value.indexOf(r.properties()[e.value])>=0],"filter-in-large":[oe,[ce,vt(se)],(r,[e,t])=>rS(r.properties()[e.value],t.value,0,t.value.length-1)],all:{type:oe,overloads:[[[oe,oe],(r,[e,t])=>e.evaluate(r)&&t.evaluate(r)],[jr(oe),(r,e)=>{for(let t of e)if(!t.evaluate(r))return!1;return!0}]]},any:{type:oe,overloads:[[[oe,oe],(r,[e,t])=>e.evaluate(r)||t.evaluate(r)],[jr(oe),(r,e)=>{for(let t of e)if(t.evaluate(r))return!0;return!1}]]},"!":[oe,[oe],(r,[e])=>!e.evaluate(r)],"is-supported-script":[oe,[ce],(r,[e])=>{let t=r.globals&&r.globals.isSupportedScript;return t?t(e.evaluate(r)):!0}],upcase:[ce,[ce],(r,[e])=>e.evaluate(r).toUpperCase()],downcase:[ce,[ce],(r,[e])=>e.evaluate(r).toLowerCase()],concat:[ce,jr(se),(r,e)=>e.map(t=>Cn(t.evaluate(r))).join("")],"resolved-locale":[ce,[ts],(r,[e])=>e.evaluate(r).resolvedLocale()]});function Xc(r){return{result:"success",value:r}}u(Xc,"success");function Ti(r){return{result:"error",value:r}}u(Ti,"error");function gr(r){return r["property-type"]==="data-driven"||r["property-type"]==="cross-faded-data-driven"}u(gr,"supportsPropertyExpression");function Ng(r){return!!r.expression&&r.expression.parameters.indexOf("zoom")>-1}u(Ng,"supportsZoomExpression");function tp(r){return!!r.expression&&r.expression.interpolated}u(tp,"supportsInterpolation");function _e(r){return r instanceof Number?"number":r instanceof String?"string":r instanceof Boolean?"boolean":Array.isArray(r)?"array":r===null?"null":typeof r}u(_e,"getType");function ss(r){return typeof r=="object"&&r!==null&&!Array.isArray(r)}u(ss,"isFunction");function iS(r){return r}u(iS,"identityFunction");function Gg(r,e){let t=e.type==="color",i=r.stops&&typeof r.stops[0][0]=="object",n=i||r.property!==void 0,a=i||!n,o=r.type||(tp(e)?"exponential":"interval");if(t||e.type==="padding"){let p=t?K.parse:Ot.parse;r=ki({},r),r.stops&&(r.stops=r.stops.map(h=>[h[0],p(h[1])])),r.default?r.default=p(r.default):r.default=p(e.default)}if(r.colorSpace&&!F2(r.colorSpace))throw new Error('Unknown color space: "'.concat(r.colorSpace,'"'));let s,l,c;if(o==="exponential")s=bg;else if(o==="interval")s=aS;else if(o==="categorical"){s=nS,l=Object.create(null);for(let p of r.stops)l[p[0]]=p[1];c=typeof r.stops[0][0]}else if(o==="identity")s=oS;else throw new Error('Unknown function type "'.concat(o,'"'));if(i){let p={},h=[];for(let g=0;g<r.stops.length;g++){let y=r.stops[g],x=y[0].zoom;p[x]===void 0&&(p[x]={zoom:x,type:r.type,property:r.property,default:r.default,stops:[]},h.push(x)),p[x].stops.push([y[0].value,y[1]])}let f=[];for(let g of h)f.push([p[g].zoom,Gg(p[g],e)]);let m={name:"linear"};return{kind:"composite",interpolationType:m,interpolationFactor:wt.interpolationFactor.bind(void 0,m),zoomStops:f.map(g=>g[0]),evaluate({zoom:g},y){return bg({stops:f,base:r.base},e,g).evaluate(g,y)}}}else if(a){let p=o==="exponential"?{name:"exponential",base:r.base!==void 0?r.base:1}:null;return{kind:"camera",interpolationType:p,interpolationFactor:wt.interpolationFactor.bind(void 0,p),zoomStops:r.stops.map(h=>h[0]),evaluate:({zoom:h})=>s(r,e,h,l,c)}}else return{kind:"source",evaluate(p,h){let f=h&&h.properties?h.properties[r.property]:void 0;return f===void 0?Zn(r.default,e.default):s(r,e,f,l,c)}}}u(Gg,"createFunction");function Zn(r,e,t){if(r!==void 0)return r;if(e!==void 0)return e;if(t!==void 0)return t}u(Zn,"coalesce$1");function nS(r,e,t,i,n){let a=typeof t===n?i[t]:void 0;return Zn(a,r.default,e.default)}u(nS,"evaluateCategoricalFunction");function aS(r,e,t){if(_e(t)!=="number")return Zn(r.default,e.default);let i=r.stops.length;if(i===1||t<=r.stops[0][0])return r.stops[0][1];if(t>=r.stops[i-1][0])return r.stops[i-1][1];let n=os(r.stops.map(a=>a[0]),t);return r.stops[n][1]}u(aS,"evaluateIntervalFunction");function bg(r,e,t){let i=r.base!==void 0?r.base:1;if(_e(t)!=="number")return Zn(r.default,e.default);let n=r.stops.length;if(n===1||t<=r.stops[0][0])return r.stops[0][1];if(t>=r.stops[n-1][0])return r.stops[n-1][1];let a=os(r.stops.map(p=>p[0]),t),o=sS(t,i,r.stops[a][0],r.stops[a+1][0]),s=r.stops[a][1],l=r.stops[a+1][1],c=ke[e.type]||iS;return typeof s.evaluate=="function"?{evaluate(...p){let h=s.evaluate.apply(void 0,p),f=l.evaluate.apply(void 0,p);if(!(h===void 0||f===void 0))return c(h,f,o,r.colorSpace)}}:c(s,l,o,r.colorSpace)}u(bg,"evaluateExponentialFunction");function oS(r,e,t){switch(e.type){case"color":t=K.parse(t);break;case"formatted":t=St.fromString(t.toString());break;case"resolvedImage":t=pt.fromString(t.toString());break;case"padding":t=Ot.parse(t);break;default:_e(t)!==e.type&&(e.type!=="enum"||!e.values[t])&&(t=void 0)}return Zn(t,r.default,e.default)}u(oS,"evaluateIdentityFunction");function sS(r,e,t,i){let n=i-t,a=r-t;return n===0?0:e===1?a/n:(Math.pow(e,a)-1)/(Math.pow(e,n)-1)}u(sS,"interpolationFactor");var fp=class fp{constructor(e,t){this.expression=e,this._warningHistory={},this._evaluator=new Ao,this._defaultValue=t?uS(t):null,this._enumValues=t&&t.type==="enum"?t.values:null}evaluateWithoutErrorHandling(e,t,i,n,a,o){return this._evaluator.globals=e,this._evaluator.feature=t,this._evaluator.featureState=i,this._evaluator.canonical=n,this._evaluator.availableImages=a||null,this._evaluator.formattedSection=o,this.expression.evaluate(this._evaluator)}evaluate(e,t,i,n,a,o){this._evaluator.globals=e,this._evaluator.feature=t||null,this._evaluator.featureState=i||null,this._evaluator.canonical=n,this._evaluator.availableImages=a||null,this._evaluator.formattedSection=o||null;try{let s=this.expression.evaluate(this._evaluator);if(s==null||typeof s=="number"&&s!==s)return this._defaultValue;if(this._enumValues&&!(s in this._enumValues))throw new Ne("Expected value to be one of ".concat(Object.keys(this._enumValues).map(l=>JSON.stringify(l)).join(", "),", but found ").concat(JSON.stringify(s)," instead."));return s}catch(s){return this._warningHistory[s.message]||(this._warningHistory[s.message]=!0,typeof console<"u"&&console.warn(s.message)),this._defaultValue}}};u(fp,"StyleExpression");var Zr=fp;function Wn(r){return Array.isArray(r)&&r.length>0&&typeof r[0]=="string"&&r[0]in Kr}u(Wn,"isExpression");function rp(r,e){let t=new Io(Kr,ko,[],e?lS(e):void 0),i=t.parse(r,void 0,void 0,void 0,e&&e.type==="string"?{typeAnnotation:"coerce"}:void 0);return i?Xc(new Zr(i,e)):Ti(t.errors)}u(rp,"createExpression");var mp=class mp{constructor(e,t){this.kind=e,this._styleExpression=t,this.isStateDependent=e!=="constant"&&!Gn(t.expression)}evaluateWithoutErrorHandling(e,t,i,n,a,o){return this._styleExpression.evaluateWithoutErrorHandling(e,t,i,n,a,o)}evaluate(e,t,i,n,a,o){return this._styleExpression.evaluate(e,t,i,n,a,o)}};u(mp,"ZoomConstantExpression");var xr=mp,dp=class dp{constructor(e,t,i,n){this.kind=e,this.zoomStops=i,this._styleExpression=t,this.isStateDependent=e!=="camera"&&!Gn(t.expression),this.interpolationType=n}evaluateWithoutErrorHandling(e,t,i,n,a,o){return this._styleExpression.evaluateWithoutErrorHandling(e,t,i,n,a,o)}evaluate(e,t,i,n,a,o){return this._styleExpression.evaluate(e,t,i,n,a,o)}interpolationFactor(e,t,i){return this.interpolationType?wt.interpolationFactor(this.interpolationType,e,t,i):0}};u(dp,"ZoomDependentExpression");var br=dp;function qg(r,e){let t=rp(r,e);if(t.result==="error")return t;let i=t.value.expression,n=ns(i);if(!n&&!gr(e))return Ti([new Et("","data expressions not supported")]);let a=as(i,["zoom"]);if(!a&&!Ng(e))return Ti([new Et("","zoom expressions not supported")]);let o=Po(i);if(!o&&!a)return Ti([new Et("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]);if(o instanceof Et)return Ti([o]);if(o instanceof wt&&!tp(e))return Ti([new Et("",'"interpolate" expressions cannot be used with this property')]);if(!o)return Xc(n?new xr("constant",t.value):new xr("source",t.value));let s=o instanceof wt?o.interpolation:void 0;return Xc(n?new br("camera",t.value,o.labels,s):new br("composite",t.value,o.labels,s))}u(qg,"createPropertyExpression");var es=class es{constructor(e,t){this._parameters=e,this._specification=t,ki(this,Gg(this._parameters,this._specification))}static deserialize(e){return new es(e._parameters,e._specification)}static serialize(e){return{_parameters:e._parameters,_specification:e._specification}}};u(es,"StylePropertyFunction");var jn=es;function jg(r,e){if(ss(r))return new jn(r,e);if(Wn(r)){let t=qg(r,e);if(t.result==="error")throw new Error(t.value.map(i=>"".concat(i.key,": ").concat(i.message)).join(", "));return t.value}else{let t=r;return e.type==="color"&&typeof r=="string"?t=K.parse(r):e.type==="padding"&&(typeof r=="number"||Array.isArray(r))?t=Ot.parse(r):e.type==="variableAnchorOffsetCollection"&&Array.isArray(r)&&(t=Qt.parse(r)),{kind:"constant",evaluate:()=>t}}}u(jg,"normalizePropertyExpression");function Po(r){let e=null;if(r instanceof zo)e=Po(r.result);else if(r instanceof Do){for(let t of r.args)if(e=Po(t),e)break}else(r instanceof Li||r instanceof wt)&&r.input instanceof qt&&r.input.name==="zoom"&&(e=r);return e instanceof Et||r.eachChild(t=>{let i=Po(t);i instanceof Et?e=i:!e&&i?e=new Et("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):e&&i&&e!==i&&(e=new Et("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),e}u(Po,"findZoomCurve");function lS(r){let e={color:Lt,string:ce,number:j,enum:ce,boolean:oe,formatted:Fi,padding:rs,resolvedImage:Hn,variableAnchorOffsetCollection:is};return r.type==="array"?vt(e[r.value]||se,r.length):e[r.type]}u(lS,"getExpectedType");function uS(r){return r.type==="color"&&ss(r.default)?new K(0,0,0,0):r.type==="color"?K.parse(r.default)||null:r.type==="padding"?Ot.parse(r.default)||null:r.type==="variableAnchorOffsetCollection"?Qt.parse(r.default)||null:r.default===void 0?null:r.default}u(uS,"getDefaultValue");function ip(r){if(r===!0||r===!1)return!0;if(!Array.isArray(r)||r.length===0)return!1;switch(r[0]){case"has":return r.length>=2&&r[1]!=="$id"&&r[1]!=="$type";case"in":return r.length>=3&&(typeof r[1]!="string"||Array.isArray(r[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return r.length!==3||Array.isArray(r[1])||Array.isArray(r[2]);case"any":case"all":for(let e of r.slice(1))if(!ip(e)&&typeof e!="boolean")return!1;return!0;default:return!0}}u(ip,"isExpressionFilter");var cS={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function Xn(r){if(r==null)return{filter:()=>!0,needGeometry:!1};ip(r)||(r=Fo(r));let e=rp(r,cS);if(e.result==="error")throw new Error(e.value.map(t=>"".concat(t.key,": ").concat(t.message)).join(", "));{let t=$g(r);return{filter:(i,n,a)=>e.value.evaluate(i,n,{},a),needGeometry:t}}}u(Xn,"createFilter");function pS(r,e){return r<e?-1:r>e?1:0}u(pS,"compare");function $g(r){if(!Array.isArray(r))return!1;if(r[0]==="within")return!0;for(let e=1;e<r.length;e++)if($g(r[e]))return!0;return!1}u($g,"geometryNeeded");function Fo(r){if(!r)return!0;let e=r[0];return r.length<=1?e!=="any":e==="=="?Oc(r[1],r[2],"=="):e==="!="?So(Oc(r[1],r[2],"==")):e==="<"||e===">"||e==="<="||e===">="?Oc(r[1],r[2],e):e==="any"?hS(r.slice(1)):e==="all"?["all"].concat(r.slice(1).map(Fo)):e==="none"?["all"].concat(r.slice(1).map(Fo).map(So)):e==="in"?_g(r[1],r.slice(2)):e==="!in"?So(_g(r[1],r.slice(2))):e==="has"?vg(r[1]):e==="!has"?So(vg(r[1])):e==="within"?r:!0}u(Fo,"convertFilter$1");function Oc(r,e,t){switch(r){case"$type":return["filter-type-".concat(t),e];case"$id":return["filter-id-".concat(t),e];default:return["filter-".concat(t),r,e]}}u(Oc,"convertComparisonOp$1");function hS(r){return["any"].concat(r.map(Fo))}u(hS,"convertDisjunctionOp");function _g(r,e){if(e.length===0)return!1;switch(r){case"$type":return["filter-type-in",["literal",e]];case"$id":return["filter-id-in",["literal",e]];default:return e.length>200&&!e.some(t=>typeof t!=typeof e[0])?["filter-in-large",r,["literal",e.sort(pS)]]:["filter-in-small",r,["literal",e]]}}u(_g,"convertInOp$1");function vg(r){switch(r){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",r]}}u(vg,"convertHasOp$1");function So(r){return["!",r]}u(So,"convertNegation");function Hg(){let r={},e=M.$version;for(let t in M.$root){let i=M.$root[t];if(i.required){let n=null;t==="version"?n=e:i.type==="array"?n=[]:n={},n!=null&&(r[t]=n)}}return r}u(Hg,"emptyStyle");function Zg(r){let e=r.key,t=r.value;return t?[new N(e,t,"constants have been deprecated as of v8")]:[]}u(Zg,"validateConstants");function Ze(r){return r instanceof Number||r instanceof String||r instanceof Boolean?r.valueOf():r}u(Ze,"unbundle");function Wr(r){if(Array.isArray(r))return r.map(Wr);if(r instanceof Object&&!(r instanceof Number||r instanceof String||r instanceof Boolean)){let e={};for(let t in r)e[t]=Wr(r[t]);return e}return Ze(r)}u(Wr,"deepUnbundle");function kt(r){let e=r.key,t=r.value,i=r.valueSpec||{},n=r.objectElementValidators||{},a=r.style,o=r.styleSpec,s=r.validateSpec,l=[],c=_e(t);if(c!=="object")return[new N(e,t,"object expected, ".concat(c," found"))];for(let p in t){let h=p.split(".")[0],f=i[h]||i["*"],m;if(n[h])m=n[h];else if(i[h])m=s;else if(n["*"])m=n["*"];else if(i["*"])m=s;else{l.push(new N(e,t[p],'unknown property "'.concat(p,'"')));continue}l=l.concat(m({key:(e&&"".concat(e,"."))+p,value:t[p],valueSpec:f,style:a,styleSpec:o,object:t,objectKey:p,validateSpec:s},t))}for(let p in i)n[p]||i[p].required&&i[p].default===void 0&&t[p]===void 0&&l.push(new N(e,t,'missing required property "'.concat(p,'"')));return l}u(kt,"validateObject");function np(r){let e=r.value,t=r.valueSpec,i=r.validateSpec,n=r.style,a=r.styleSpec,o=r.key,s=r.arrayElementValidator||i;if(_e(e)!=="array")return[new N(o,e,"array expected, ".concat(_e(e)," found"))];if(t.length&&e.length!==t.length)return[new N(o,e,"array length ".concat(t.length," expected, length ").concat(e.length," found"))];if(t["min-length"]&&e.length<t["min-length"])return[new N(o,e,"array length at least ".concat(t["min-length"]," expected, length ").concat(e.length," found"))];let l={type:t.value,values:t.values};a.$version<7&&(l.function=t.function),_e(t.value)==="object"&&(l=t.value);let c=[];for(let p=0;p<e.length;p++)c=c.concat(s({array:e,arrayIndex:p,value:e[p],valueSpec:l,validateSpec:r.validateSpec,style:n,styleSpec:a,key:"".concat(o,"[").concat(p,"]")}));return c}u(np,"validateArray");function ap(r){let e=r.key,t=r.value,i=r.valueSpec,n=_e(t);return n==="number"&&t!==t&&(n="NaN"),n!=="number"?[new N(e,t,"number expected, ".concat(n," found"))]:"minimum"in i&&t<i.minimum?[new N(e,t,"".concat(t," is less than the minimum value ").concat(i.minimum))]:"maximum"in i&&t>i.maximum?[new N(e,t,"".concat(t," is greater than the maximum value ").concat(i.maximum))]:[]}u(ap,"validateNumber");function Wg(r){let e=r.valueSpec,t=Ze(r.value.type),i,n={},a,o,s=t!=="categorical"&&r.value.property===void 0,l=!s,c=_e(r.value.stops)==="array"&&_e(r.value.stops[0])==="array"&&_e(r.value.stops[0][0])==="object",p=kt({key:r.key,value:r.value,valueSpec:r.styleSpec.function,validateSpec:r.validateSpec,style:r.style,styleSpec:r.styleSpec,objectElementValidators:{stops:h,default:g}});return t==="identity"&&s&&p.push(new N(r.key,r.value,'missing required property "property"')),t!=="identity"&&!r.value.stops&&p.push(new N(r.key,r.value,'missing required property "stops"')),t==="exponential"&&r.valueSpec.expression&&!tp(r.valueSpec)&&p.push(new N(r.key,r.value,"exponential functions not supported")),r.styleSpec.$version>=8&&(l&&!gr(r.valueSpec)?p.push(new N(r.key,r.value,"property functions not supported")):s&&!Ng(r.valueSpec)&&p.push(new N(r.key,r.value,"zoom functions not supported"))),(t==="categorical"||c)&&r.value.property===void 0&&p.push(new N(r.key,r.value,'"property" property is required')),p;function h(y){if(t==="identity")return[new N(y.key,y.value,'identity function may not have a "stops" property')];let x=[],b=y.value;return x=x.concat(np({key:y.key,value:b,valueSpec:y.valueSpec,validateSpec:y.validateSpec,style:y.style,styleSpec:y.styleSpec,arrayElementValidator:f})),_e(b)==="array"&&b.length===0&&x.push(new N(y.key,b,"array must have at least one stop")),x}u(h,"validateFunctionStops");function f(y){let x=[],b=y.value,_=y.key;if(_e(b)!=="array")return[new N(_,b,"array expected, ".concat(_e(b)," found"))];if(b.length!==2)return[new N(_,b,"array length 2 expected, length ".concat(b.length," found"))];if(c){if(_e(b[0])!=="object")return[new N(_,b,"object expected, ".concat(_e(b[0])," found"))];if(b[0].zoom===void 0)return[new N(_,b,"object stop key must have zoom")];if(b[0].value===void 0)return[new N(_,b,"object stop key must have value")];if(o&&o>Ze(b[0].zoom))return[new N(_,b[0].zoom,"stop zoom values must appear in ascending order")];Ze(b[0].zoom)!==o&&(o=Ze(b[0].zoom),a=void 0,n={}),x=x.concat(kt({key:"".concat(_,"[0]"),value:b[0],valueSpec:{zoom:{}},validateSpec:y.validateSpec,style:y.style,styleSpec:y.styleSpec,objectElementValidators:{zoom:ap,value:m}}))}else x=x.concat(m({key:"".concat(_,"[0]"),value:b[0],valueSpec:{},validateSpec:y.validateSpec,style:y.style,styleSpec:y.styleSpec},b));return Wn(Wr(b[1]))?x.concat([new N("".concat(_,"[1]"),b[1],"expressions are not allowed in function stops.")]):x.concat(y.validateSpec({key:"".concat(_,"[1]"),value:b[1],valueSpec:e,validateSpec:y.validateSpec,style:y.style,styleSpec:y.styleSpec}))}u(f,"validateFunctionStop");function m(y,x){let b=_e(y.value),_=Ze(y.value),v=y.value!==null?y.value:x;if(!i)i=b;else if(b!==i)return[new N(y.key,v,"".concat(b," stop domain type must match previous stop domain type ").concat(i))];if(b!=="number"&&b!=="string"&&b!=="boolean")return[new N(y.key,v,"stop domain value must be a number, string, or boolean")];if(b!=="number"&&t!=="categorical"){let S="number expected, ".concat(b," found");return gr(e)&&t===void 0&&(S+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new N(y.key,v,S)]}return t==="categorical"&&b==="number"&&(!isFinite(_)||Math.floor(_)!==_)?[new N(y.key,v,"integer expected, found ".concat(_))]:t!=="categorical"&&b==="number"&&a!==void 0&&_<a?[new N(y.key,v,"stop domain values must appear in ascending order")]:(a=_,t==="categorical"&&_ in n?[new N(y.key,v,"stop domain values must be unique")]:(n[_]=!0,[]))}u(m,"validateStopDomainValue");function g(y){return y.validateSpec({key:y.key,value:y.value,valueSpec:e,validateSpec:y.validateSpec,style:y.style,styleSpec:y.styleSpec})}u(g,"validateFunctionDefault")}u(Wg,"validateFunction");function Di(r){let e=(r.expressionContext==="property"?qg:rp)(Wr(r.value),r.valueSpec);if(e.result==="error")return e.value.map(i=>new N("".concat(r.key).concat(i.key),r.value,i.message));let t=e.value.expression||e.value._styleExpression.expression;if(r.expressionContext==="property"&&r.propertyKey==="text-font"&&!t.outputDefined())return[new N(r.key,r.value,'Invalid data expression for "'.concat(r.propertyKey,'". Output values must be contained as literals within the expression.'))];if(r.expressionContext==="property"&&r.propertyType==="layout"&&!Gn(t))return[new N(r.key,r.value,'"feature-state" data expressions are not supported with layout properties.')];if(r.expressionContext==="filter"&&!Gn(t))return[new N(r.key,r.value,'"feature-state" data expressions are not supported with filters.')];if(r.expressionContext&&r.expressionContext.indexOf("cluster")===0){if(!as(t,["zoom","feature-state"]))return[new N(r.key,r.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(r.expressionContext==="cluster-initial"&&!ns(t))return[new N(r.key,r.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}u(Di,"validateExpression");function fS(r){let e=r.value,t=r.key,i=_e(e);return i!=="boolean"?[new N(t,e,"boolean expected, ".concat(i," found"))]:[]}u(fS,"validateBoolean");function mS(r){let e=r.key,t=r.value,i=_e(t);return i!=="string"?[new N(e,t,"color expected, ".concat(i," found"))]:K.parse(String(t))?[]:[new N(e,t,'color expected, "'.concat(t,'" found'))]}u(mS,"validateColor");function $n(r){let e=r.key,t=r.value,i=r.valueSpec,n=[];return Array.isArray(i.values)?i.values.indexOf(Ze(t))===-1&&n.push(new N(e,t,"expected one of [".concat(i.values.join(", "),"], ").concat(JSON.stringify(t)," found"))):Object.keys(i.values).indexOf(Ze(t))===-1&&n.push(new N(e,t,"expected one of [".concat(Object.keys(i.values).join(", "),"], ").concat(JSON.stringify(t)," found"))),n}u($n,"validateEnum");function op(r){return ip(Wr(r.value))?Di(ki({},r,{expressionContext:"filter",valueSpec:{value:"boolean"}})):Xg(r)}u(op,"validateFilter");function Xg(r){let e=r.value,t=r.key;if(_e(e)!=="array")return[new N(t,e,"array expected, ".concat(_e(e)," found"))];let i=r.styleSpec,n,a=[];if(e.length<1)return[new N(t,e,"filter array must have at least 1 element")];switch(a=a.concat($n({key:"".concat(t,"[0]"),value:e[0],valueSpec:i.filter_operator,style:r.style,styleSpec:r.styleSpec})),Ze(e[0])){case"<":case"<=":case">":case">=":e.length>=2&&Ze(e[1])==="$type"&&a.push(new N(t,e,'"$type" cannot be use with operator "'.concat(e[0],'"')));case"==":case"!=":e.length!==3&&a.push(new N(t,e,'filter array for operator "'.concat(e[0],'" must have 3 elements')));case"in":case"!in":e.length>=2&&(n=_e(e[1]),n!=="string"&&a.push(new N("".concat(t,"[1]"),e[1],"string expected, ".concat(n," found"))));for(let o=2;o<e.length;o++)n=_e(e[o]),Ze(e[1])==="$type"?a=a.concat($n({key:"".concat(t,"[").concat(o,"]"),value:e[o],valueSpec:i.geometry_type,style:r.style,styleSpec:r.styleSpec})):n!=="string"&&n!=="number"&&n!=="boolean"&&a.push(new N("".concat(t,"[").concat(o,"]"),e[o],"string, number, or boolean expected, ".concat(n," found")));break;case"any":case"all":case"none":for(let o=1;o<e.length;o++)a=a.concat(Xg({key:"".concat(t,"[").concat(o,"]"),value:e[o],style:r.style,styleSpec:r.styleSpec}));break;case"has":case"!has":n=_e(e[1]),e.length!==2?a.push(new N(t,e,'filter array for "'.concat(e[0],'" operator must have 2 elements'))):n!=="string"&&a.push(new N("".concat(t,"[1]"),e[1],"string expected, ".concat(n," found")));break;case"within":n=_e(e[1]),e.length!==2?a.push(new N(t,e,'filter array for "'.concat(e[0],'" operator must have 2 elements'))):n!=="object"&&a.push(new N("".concat(t,"[1]"),e[1],"object expected, ".concat(n," found")));break}return a}u(Xg,"validateNonExpressionFilter");function Kg(r,e){let t=r.key,i=r.validateSpec,n=r.style,a=r.styleSpec,o=r.value,s=r.objectKey,l=a["".concat(e,"_").concat(r.layerType)];if(!l)return[];let c=s.match(/^(.*)-transition$/);if(e==="paint"&&c&&l[c[1]]&&l[c[1]].transition)return i({key:t,value:o,valueSpec:a.transition,style:n,styleSpec:a});let p=r.valueSpec||l[s];if(!p)return[new N(t,o,'unknown property "'.concat(s,'"'))];let h;if(_e(o)==="string"&&gr(p)&&!p.tokens&&(h=/^{([^}]+)}$/.exec(o)))return[new N(t,o,'"'.concat(s,'" does not support interpolation syntax\n')+'Use an identity property function instead: `{ "type": "identity", "property": '.concat(JSON.stringify(h[1])," }`."))];let f=[];return r.layerType==="symbol"&&(s==="text-field"&&n&&!n.glyphs&&f.push(new N(t,o,'use of "text-field" requires a style "glyphs" property')),s==="text-font"&&ss(Wr(o))&&Ze(o.type)==="identity"&&f.push(new N(t,o,'"text-font" does not support identity functions'))),f.concat(i({key:r.key,value:o,valueSpec:p,style:n,styleSpec:a,expressionContext:"property",propertyType:e,propertyKey:s}))}u(Kg,"validateProperty");function Yg(r){return Kg(r,"paint")}u(Yg,"validatePaintProperty");function Jg(r){return Kg(r,"layout")}u(Jg,"validateLayoutProperty");function Qg(r){let e=[],t=r.value,i=r.key,n=r.style,a=r.styleSpec;!t.type&&!t.ref&&e.push(new N(i,t,'either "type" or "ref" is required'));let o=Ze(t.type),s=Ze(t.ref);if(t.id){let l=Ze(t.id);for(let c=0;c<r.arrayIndex;c++){let p=n.layers[c];Ze(p.id)===l&&e.push(new N(i,t.id,'duplicate layer id "'.concat(t.id,'", previously used at line ').concat(p.id.__line__)))}}if("ref"in t){["type","source","source-layer","filter","layout"].forEach(c=>{c in t&&e.push(new N(i,t[c],'"'.concat(c,'" is prohibited for ref layers')))});let l;n.layers.forEach(c=>{Ze(c.id)===s&&(l=c)}),l?l.ref?e.push(new N(i,t.ref,"ref cannot reference another ref layer")):o=Ze(l.type):e.push(new N(i,t.ref,'ref layer "'.concat(s,'" not found')))}else if(o!=="background")if(!t.source)e.push(new N(i,t,'missing required property "source"'));else{let l=n.sources&&n.sources[t.source],c=l&&Ze(l.type);l?c==="vector"&&o==="raster"?e.push(new N(i,t.source,'layer "'.concat(t.id,'" requires a raster source'))):c==="raster"&&o!=="raster"?e.push(new N(i,t.source,'layer "'.concat(t.id,'" requires a vector source'))):c==="vector"&&!t["source-layer"]?e.push(new N(i,t,'layer "'.concat(t.id,'" must specify a "source-layer"'))):c==="raster-dem"&&o!=="hillshade"?e.push(new N(i,t.source,"raster-dem source can only be used with layer type 'hillshade'.")):o==="line"&&t.paint&&t.paint["line-gradient"]&&(c!=="geojson"||!l.lineMetrics)&&e.push(new N(i,t,'layer "'.concat(t.id,'" specifies a line-gradient, which requires a GeoJSON source with `lineMetrics` enabled.'))):e.push(new N(i,t.source,'source "'.concat(t.source,'" not found')))}return e=e.concat(kt({key:i,value:t,valueSpec:a.layer,style:r.style,styleSpec:r.styleSpec,validateSpec:r.validateSpec,objectElementValidators:{"*"(){return[]},type(){return r.validateSpec({key:"".concat(i,".type"),value:t.type,valueSpec:a.layer.type,style:r.style,styleSpec:r.styleSpec,validateSpec:r.validateSpec,object:t,objectKey:"type"})},filter:op,layout(l){return kt({layer:t,key:l.key,value:l.value,style:l.style,styleSpec:l.styleSpec,validateSpec:l.validateSpec,objectElementValidators:{"*"(c){return Jg(ki({layerType:o},c))}}})},paint(l){return kt({layer:t,key:l.key,value:l.value,style:l.style,styleSpec:l.styleSpec,validateSpec:l.validateSpec,objectElementValidators:{"*"(c){return Yg(ki({layerType:o},c))}}})}}})),e}u(Qg,"validateLayer");function Xr(r){let e=r.value,t=r.key,i=_e(e);return i!=="string"?[new N(t,e,"string expected, ".concat(i," found"))]:[]}u(Xr,"validateString");var wg={promoteId:dS};function ex(r){let e=r.value,t=r.key,i=r.styleSpec,n=r.style,a=r.validateSpec;if(!e.type)return[new N(t,e,'"type" is required')];let o=Ze(e.type),s;switch(o){case"vector":case"raster":case"raster-dem":return s=kt({key:t,value:e,valueSpec:i["source_".concat(o.replace("-","_"))],style:r.style,styleSpec:i,objectElementValidators:wg,validateSpec:a}),s;case"geojson":if(s=kt({key:t,value:e,valueSpec:i.source_geojson,style:n,styleSpec:i,validateSpec:a,objectElementValidators:wg}),e.cluster)for(let l in e.clusterProperties){let[c,p]=e.clusterProperties[l],h=typeof c=="string"?[c,["accumulated"],["get",l]]:c;s.push(...Di({key:"".concat(t,".").concat(l,".map"),value:p,validateSpec:a,expressionContext:"cluster-map"})),s.push(...Di({key:"".concat(t,".").concat(l,".reduce"),value:h,validateSpec:a,expressionContext:"cluster-reduce"}))}return s;case"video":return kt({key:t,value:e,valueSpec:i.source_video,style:n,validateSpec:a,styleSpec:i});case"image":return kt({key:t,value:e,valueSpec:i.source_image,style:n,validateSpec:a,styleSpec:i});case"canvas":return[new N(t,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return $n({key:"".concat(t,".type"),value:e.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:n,validateSpec:a,styleSpec:i})}}u(ex,"validateSource");function dS({key:r,value:e}){if(_e(e)==="string")return Xr({key:r,value:e});{let t=[];for(let i in e)t.push(...Xr({key:"".concat(r,".").concat(i),value:e[i]}));return t}}u(dS,"validatePromoteId");function tx(r){let e=r.value,t=r.styleSpec,i=t.light,n=r.style,a=[],o=_e(e);if(e===void 0)return a;if(o!=="object")return a=a.concat([new N("light",e,"object expected, ".concat(o," found"))]),a;for(let s in e){let l=s.match(/^(.*)-transition$/);l&&i[l[1]]&&i[l[1]].transition?a=a.concat(r.validateSpec({key:s,value:e[s],valueSpec:t.transition,validateSpec:r.validateSpec,style:n,styleSpec:t})):i[s]?a=a.concat(r.validateSpec({key:s,value:e[s],valueSpec:i[s],validateSpec:r.validateSpec,style:n,styleSpec:t})):a=a.concat([new N(s,e[s],'unknown property "'.concat(s,'"'))])}return a}u(tx,"validateLight");function rx(r){let e=r.value,t=r.styleSpec,i=t.terrain,n=r.style,a=[],o=_e(e);if(e===void 0)return a;if(o!=="object")return a=a.concat([new N("terrain",e,"object expected, ".concat(o," found"))]),a;for(let s in e)i[s]?a=a.concat(r.validateSpec({key:s,value:e[s],valueSpec:i[s],validateSpec:r.validateSpec,style:n,styleSpec:t})):a=a.concat([new N(s,e[s],'unknown property "'.concat(s,'"'))]);return a}u(rx,"validateTerrain");function yS(r){return Xr(r).length===0?[]:Di(r)}u(yS,"validateFormatted");function gS(r){return Xr(r).length===0?[]:Di(r)}u(gS,"validateImage");function xS(r){let e=r.key,t=r.value;if(_e(t)==="array"){if(t.length<1||t.length>4)return[new N(e,t,"padding requires 1 to 4 values; ".concat(t.length," values found"))];let n={type:"number"},a=[];for(let o=0;o<t.length;o++)a=a.concat(r.validateSpec({key:"".concat(e,"[").concat(o,"]"),value:t[o],validateSpec:r.validateSpec,valueSpec:n}));return a}else return ap({key:e,value:t,valueSpec:{}})}u(xS,"validatePadding");function bS(r){let e=r.key,t=r.value,i=_e(t),n=r.styleSpec;if(i!=="array"||t.length<1||t.length%2!==0)return[new N(e,t,"variableAnchorOffsetCollection requires a non-empty array of even length")];let a=[];for(let o=0;o<t.length;o+=2)a=a.concat($n({key:"".concat(e,"[").concat(o,"]"),value:t[o],valueSpec:n.layout_symbol["text-anchor"]})),a=a.concat(np({key:"".concat(e,"[").concat(o+1,"]"),value:t[o+1],valueSpec:{length:2,value:"number"},validateSpec:r.validateSpec,style:r.style,styleSpec:n}));return a}u(bS,"validateVariableAnchorOffsetCollection");function ix(r){let e=[],t=r.value,i=r.key;if(Array.isArray(t)){let n=[],a=[];for(let o in t){t[o].id&&n.includes(t[o].id)&&e.push(new N(i,t,"all the sprites' ids must be unique, but ".concat(t[o].id," is duplicated"))),n.push(t[o].id),t[o].url&&a.includes(t[o].url)&&e.push(new N(i,t,"all the sprites' URLs must be unique, but ".concat(t[o].url," is duplicated"))),a.push(t[o].url);let s={id:{type:"string",required:!0},url:{type:"string",required:!0}};e=e.concat(kt({key:"".concat(i,"[").concat(o,"]"),value:t[o],valueSpec:s,validateSpec:r.validateSpec}))}return e}else return Xr({key:i,value:t})}u(ix,"validateSprite");var Sg={"*"(){return[]},array:np,boolean:fS,number:ap,color:mS,constants:Zg,enum:$n,filter:op,function:Wg,layer:Qg,object:kt,source:ex,light:tx,terrain:rx,string:Xr,formatted:yS,resolvedImage:gS,padding:xS,variableAnchorOffsetCollection:bS,sprite:ix};function En(r){let e=r.value,t=r.valueSpec,i=r.styleSpec;return r.validateSpec=En,t.expression&&ss(Ze(e))?Wg(r):t.expression&&Wn(Wr(e))?Di(r):t.type&&Sg[t.type]?Sg[t.type](r):kt(ki({},r,{valueSpec:t.type?i[t.type]:t}))}u(En,"validate");function nx(r){let e=r.value,t=r.key,i=Xr(r);return i.length||(e.indexOf("{fontstack}")===-1&&i.push(new N(t,e,'"glyphs" url must include a "{fontstack}" token')),e.indexOf("{range}")===-1&&i.push(new N(t,e,'"glyphs" url must include a "{range}" token'))),i}u(nx,"validateGlyphsUrl");function Vt(r,e=M){let t=[];return t=t.concat(En({key:"",value:r,valueSpec:e.$root,styleSpec:e,style:r,validateSpec:En,objectElementValidators:{glyphs:nx,"*"(){return[]}}})),r.constants&&(t=t.concat(Zg({key:"constants",value:r.constants,style:r,styleSpec:e,validateSpec:En}))),ax(t)}u(Vt,"validateStyleMin");Vt.source=tr(er(ex));Vt.sprite=tr(er(ix));Vt.glyphs=tr(er(nx));Vt.light=tr(er(tx));Vt.terrain=tr(er(rx));Vt.layer=tr(er(Qg));Vt.filter=tr(er(op));Vt.paintProperty=tr(er(Yg));Vt.layoutProperty=tr(er(Jg));function er(r){return function(e){return r({...e,validateSpec:En})}}u(er,"injectValidateSpec");function ax(r){return[].concat(r).sort((e,t)=>e.line-t.line)}u(ax,"sortErrors");function tr(r){return function(...e){return ax(r.apply(this,e))}}u(tr,"wrapCleanErrors");d();var qe=Vt,ok=qe.source,ox=qe.light,sk=qe.terrain,lk=qe.filter,sx=qe.paintProperty,lx=qe.layoutProperty;function Ri(r,e){let t=!1;if(e&&e.length)for(let i of e)r.fire(new Z(new Error(i.message))),t=!0;return t}u(Ri,"emitValidationErrors");d();d();d();var ls=class ls{constructor(e,t,i){let n=this.cells=[];if(e instanceof ArrayBuffer){this.arrayBuffer=e;let o=new Int32Array(this.arrayBuffer);e=o[0],t=o[1],i=o[2],this.d=t+2*i;for(let c=0;c<this.d*this.d;c++){let p=o[3+c],h=o[3+c+1];n.push(p===h?null:o.subarray(p,h))}let s=o[3+n.length],l=o[3+n.length+1];this.keys=o.subarray(s,l),this.bboxes=o.subarray(l),this.insert=this._insertReadonly}else{this.d=t+2*i;for(let o=0;o<this.d*this.d;o++)n.push([]);this.keys=[],this.bboxes=[]}this.n=t,this.extent=e,this.padding=i,this.scale=t/e,this.uid=0;let a=i/t*e;this.min=-a,this.max=e+a}insert(e,t,i,n,a){this._forEachCell(t,i,n,a,this._insertCell,this.uid++,void 0,void 0),this.keys.push(e),this.bboxes.push(t),this.bboxes.push(i),this.bboxes.push(n),this.bboxes.push(a)}_insertReadonly(){throw new Error("Cannot insert into a GridIndex created from an ArrayBuffer.")}_insertCell(e,t,i,n,a,o){this.cells[a].push(o)}query(e,t,i,n,a){let o=this.min,s=this.max;if(e<=o&&t<=o&&s<=i&&s<=n&&!a)return Array.prototype.slice.call(this.keys);{let l=[],c={};return this._forEachCell(e,t,i,n,this._queryCell,l,c,a),l}}_queryCell(e,t,i,n,a,o,s,l){let c=this.cells[a];if(c!==null){let p=this.keys,h=this.bboxes;for(let f=0;f<c.length;f++){let m=c[f];if(s[m]===void 0){let g=m*4;(l?l(h[g+0],h[g+1],h[g+2],h[g+3]):e<=h[g+2]&&t<=h[g+3]&&i>=h[g+0]&&n>=h[g+1])?(s[m]=!0,o.push(p[m])):s[m]=!1}}}}_forEachCell(e,t,i,n,a,o,s,l){let c=this._convertToCellCoord(e),p=this._convertToCellCoord(t),h=this._convertToCellCoord(i),f=this._convertToCellCoord(n);for(let m=c;m<=h;m++)for(let g=p;g<=f;g++){let y=this.d*g+m;if(!(l&&!l(this._convertFromCellCoord(m),this._convertFromCellCoord(g),this._convertFromCellCoord(m+1),this._convertFromCellCoord(g+1)))&&a.call(this,e,t,i,n,y,o,s,l))return}}_convertFromCellCoord(e){return(e-this.padding)/this.scale}_convertToCellCoord(e){return Math.max(0,Math.min(this.d-1,Math.floor(e*this.scale)+this.padding))}toArrayBuffer(){if(this.arrayBuffer)return this.arrayBuffer;let e=this.cells,t=3+this.cells.length+1+1,i=0;for(let o=0;o<this.cells.length;o++)i+=this.cells[o].length;let n=new Int32Array(t+i+this.keys.length+this.bboxes.length);n[0]=this.extent,n[1]=this.n,n[2]=this.padding;let a=t;for(let o=0;o<e.length;o++){let s=e[o];n[3+o]=a,n.set(s,a),a+=s.length}return n[3+e.length]=a,n.set(this.keys,a),a+=this.keys.length,n[3+e.length+1]=a,n.set(this.bboxes,a),a+=this.bboxes.length,n.buffer}static serialize(e,t){let i=e.toArrayBuffer();return t&&t.push(i),{buffer:i}}static deserialize(e){return new ls(e.buffer)}};u(ls,"TransferableGridIndex");var Yr=ls;var _r={};function G(r,e,t={}){if(_r[r])throw new Error("".concat(r," is already registered."));Object.defineProperty(e,"_classRegistryKey",{value:r,writeable:!1}),_r[r]={klass:e,omit:t.omit||[],shallow:t.shallow||[]}}u(G,"register");G("Object",Object);G("TransferableGridIndex",Yr);G("Color",K);G("Error",Error);G("AJAXError",hr);G("ResolvedImage",pt);G("StylePropertyFunction",jn);G("StyleExpression",Zr,{omit:["_evaluator"]});G("ZoomDependentExpression",br);G("ZoomConstantExpression",xr);G("CompoundExpression",qt,{omit:["_evaluate"]});for(let r in Kr)Kr[r]._classRegistryKey||G("Expression_".concat(r),Kr[r]);function ux(r){return r&&typeof ArrayBuffer<"u"&&(r instanceof ArrayBuffer||r.constructor&&r.constructor.name==="ArrayBuffer")}u(ux,"isArrayBuffer");function Oi(r,e){if(r==null||typeof r=="boolean"||typeof r=="number"||typeof r=="string"||r instanceof Boolean||r instanceof Number||r instanceof String||r instanceof Date||r instanceof RegExp||r instanceof Blob)return r;if(ux(r)||Ct(r))return e&&e.push(r),r;if(ArrayBuffer.isView(r)){let t=r;return e&&e.push(t.buffer),t}if(r instanceof ImageData)return e&&e.push(r.data.buffer),r;if(Array.isArray(r)){let t=[];for(let i of r)t.push(Oi(i,e));return t}if(typeof r=="object"){let t=r.constructor,i=t._classRegistryKey;if(!i)throw new Error("can't serialize object of unregistered class");if(!_r[i])throw new Error("".concat(i," is not registered."));let n=t.serialize?t.serialize(r,e):{};if(t.serialize){if(e&&n===e[e.length-1])throw new Error("statically serialized object won't survive transfer of $name property")}else{for(let a in r){if(!r.hasOwnProperty(a)||_r[i].omit.indexOf(a)>=0)continue;let o=r[a];n[a]=_r[i].shallow.indexOf(a)>=0?o:Oi(o,e)}r instanceof Error&&(n.message=r.message)}if(n.$name)throw new Error("$name property is reserved for worker serialization logic.");return i!=="Object"&&(n.$name=i),n}throw new Error("can't serialize object of type ".concat(typeof r))}u(Oi,"serialize");function Vi(r){if(r==null||typeof r=="boolean"||typeof r=="number"||typeof r=="string"||r instanceof Boolean||r instanceof Number||r instanceof String||r instanceof Date||r instanceof RegExp||r instanceof Blob||ux(r)||Ct(r)||ArrayBuffer.isView(r)||r instanceof ImageData)return r;if(Array.isArray(r))return r.map(Vi);if(typeof r=="object"){let e=r.$name||"Object";if(!_r[e])throw new Error("can't deserialize unregistered class ".concat(e));let{klass:t}=_r[e];if(!t)throw new Error("can't deserialize unregistered class ".concat(e));if(t.deserialize)return t.deserialize(r);let i=Object.create(t.prototype);for(let n of Object.keys(r)){if(n==="$name")continue;let a=r[n];i[n]=_r[e].shallow.indexOf(n)>=0?a:Vi(a)}return i}throw new Error("can't deserialize object of type ".concat(typeof r))}u(Vi,"deserialize");d();d();var yp=class yp{constructor(){this.first=!0}update(e,t){let i=Math.floor(e);return this.first?(this.first=!1,this.lastIntegerZoom=i,this.lastIntegerZoomTime=0,this.lastZoom=e,this.lastFloorZoom=i,!0):(this.lastFloorZoom>i?(this.lastIntegerZoom=i+1,this.lastIntegerZoomTime=t):this.lastFloorZoom<i&&(this.lastIntegerZoom=i,this.lastIntegerZoomTime=t),e!==this.lastZoom?(this.lastZoom=e,this.lastFloorZoom=i,!0):!1)}};u(yp,"ZoomHistory");var Ui=yp;d();d();var pe={"Latin-1 Supplement":r=>r>=128&&r<=255,Arabic:r=>r>=1536&&r<=1791,"Arabic Supplement":r=>r>=1872&&r<=1919,"Arabic Extended-A":r=>r>=2208&&r<=2303,"Hangul Jamo":r=>r>=4352&&r<=4607,"Unified Canadian Aboriginal Syllabics":r=>r>=5120&&r<=5759,Khmer:r=>r>=6016&&r<=6143,"Unified Canadian Aboriginal Syllabics Extended":r=>r>=6320&&r<=6399,"General Punctuation":r=>r>=8192&&r<=8303,"Letterlike Symbols":r=>r>=8448&&r<=8527,"Number Forms":r=>r>=8528&&r<=8591,"Miscellaneous Technical":r=>r>=8960&&r<=9215,"Control Pictures":r=>r>=9216&&r<=9279,"Optical Character Recognition":r=>r>=9280&&r<=9311,"Enclosed Alphanumerics":r=>r>=9312&&r<=9471,"Geometric Shapes":r=>r>=9632&&r<=9727,"Miscellaneous Symbols":r=>r>=9728&&r<=9983,"Miscellaneous Symbols and Arrows":r=>r>=11008&&r<=11263,"CJK Radicals Supplement":r=>r>=11904&&r<=12031,"Kangxi Radicals":r=>r>=12032&&r<=12255,"Ideographic Description Characters":r=>r>=12272&&r<=12287,"CJK Symbols and Punctuation":r=>r>=12288&&r<=12351,Hiragana:r=>r>=12352&&r<=12447,Katakana:r=>r>=12448&&r<=12543,Bopomofo:r=>r>=12544&&r<=12591,"Hangul Compatibility Jamo":r=>r>=12592&&r<=12687,Kanbun:r=>r>=12688&&r<=12703,"Bopomofo Extended":r=>r>=12704&&r<=12735,"CJK Strokes":r=>r>=12736&&r<=12783,"Katakana Phonetic Extensions":r=>r>=12784&&r<=12799,"Enclosed CJK Letters and Months":r=>r>=12800&&r<=13055,"CJK Compatibility":r=>r>=13056&&r<=13311,"CJK Unified Ideographs Extension A":r=>r>=13312&&r<=19903,"Yijing Hexagram Symbols":r=>r>=19904&&r<=19967,"CJK Unified Ideographs":r=>r>=19968&&r<=40959,"Yi Syllables":r=>r>=40960&&r<=42127,"Yi Radicals":r=>r>=42128&&r<=42191,"Hangul Jamo Extended-A":r=>r>=43360&&r<=43391,"Hangul Syllables":r=>r>=44032&&r<=55215,"Hangul Jamo Extended-B":r=>r>=55216&&r<=55295,"Private Use Area":r=>r>=57344&&r<=63743,"CJK Compatibility Ideographs":r=>r>=63744&&r<=64255,"Arabic Presentation Forms-A":r=>r>=64336&&r<=65023,"Vertical Forms":r=>r>=65040&&r<=65055,"CJK Compatibility Forms":r=>r>=65072&&r<=65103,"Small Form Variants":r=>r>=65104&&r<=65135,"Arabic Presentation Forms-B":r=>r>=65136&&r<=65279,"Halfwidth and Fullwidth Forms":r=>r>=65280&&r<=65519};function gp(r){for(let e of r)if(cx(e.charCodeAt(0)))return!0;return!1}u(gp,"allowsVerticalWritingMode");function cx(r){return r===746||r===747?!0:r<4352?!1:!!(pe["Bopomofo Extended"](r)||pe.Bopomofo(r)||pe["CJK Compatibility Forms"](r)&&!(r>=65097&&r<=65103)||pe["CJK Compatibility Ideographs"](r)||pe["CJK Compatibility"](r)||pe["CJK Radicals Supplement"](r)||pe["CJK Strokes"](r)||pe["CJK Symbols and Punctuation"](r)&&!(r>=12296&&r<=12305)&&!(r>=12308&&r<=12319)&&r!==12336||pe["CJK Unified Ideographs Extension A"](r)||pe["CJK Unified Ideographs"](r)||pe["Enclosed CJK Letters and Months"](r)||pe["Hangul Compatibility Jamo"](r)||pe["Hangul Jamo Extended-A"](r)||pe["Hangul Jamo Extended-B"](r)||pe["Hangul Jamo"](r)||pe["Hangul Syllables"](r)||pe.Hiragana(r)||pe["Ideographic Description Characters"](r)||pe.Kanbun(r)||pe["Kangxi Radicals"](r)||pe["Katakana Phonetic Extensions"](r)||pe.Katakana(r)&&r!==12540||pe["Halfwidth and Fullwidth Forms"](r)&&r!==65288&&r!==65289&&r!==65293&&!(r>=65306&&r<=65310)&&r!==65339&&r!==65341&&r!==65343&&!(r>=65371&&r<=65503)&&r!==65507&&!(r>=65512&&r<=65519)||pe["Small Form Variants"](r)&&!(r>=65112&&r<=65118)&&!(r>=65123&&r<=65126)||pe["Unified Canadian Aboriginal Syllabics"](r)||pe["Unified Canadian Aboriginal Syllabics Extended"](r)||pe["Vertical Forms"](r)||pe["Yijing Hexagram Symbols"](r)||pe["Yi Syllables"](r)||pe["Yi Radicals"](r))}u(cx,"charHasUprightVerticalOrientation");function px(r){return r>=1424&&r<=2303||pe["Arabic Presentation Forms-A"](r)||pe["Arabic Presentation Forms-B"](r)}u(px,"charInRTLScript");function _S(r,e){return!(!e&&px(r)||r>=2304&&r<=3583||r>=3840&&r<=4255||pe.Khmer(r))}u(_S,"charInSupportedScript");function hx(r){for(let e of r)if(px(e.charCodeAt(0)))return!0;return!1}u(hx,"stringContainsRTLText");function fx(r,e){for(let t of r)if(!_S(t.charCodeAt(0),e))return!1;return!0}u(fx,"isStringInSupportedScript");d();var Ut={unavailable:"unavailable",deferred:"deferred",loading:"loading",loaded:"loaded",error:"error"},xp=null,ht=Ut.unavailable,vr=null,_p=u(function(r){r&&typeof r=="string"&&r.indexOf("NetworkError")>-1&&(ht=Ut.error),xp&&xp(r)},"triggerPluginCompletionEvent");function bp(){us.fire(new z("pluginStateChange",{pluginStatus:ht,pluginURL:vr}))}u(bp,"sendPluginStateToWorker");var us=new de,Kn=u(function(){return ht},"getRTLTextPluginStatus"),mx=u(function(r){return r({pluginStatus:ht,pluginURL:vr}),us.on("pluginStateChange",r),r},"registerForPluginStateChange");var dx=u(function(r,e,t=!1){if(ht===Ut.deferred||ht===Ut.loading||ht===Ut.loaded)throw new Error("setRTLTextPlugin cannot be called multiple times.");vr=ne.resolveURL(r),ht=Ut.deferred,xp=e,bp(),t||yx()},"setRTLTextPlugin"),yx=u(function(){if(ht!==Ut.deferred||!vr)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");ht=Ut.loading,bp(),vr&&xo({url:vr},r=>{r?_p(r):(ht=Ut.loaded,bp())})},"downloadRTLTextPlugin"),ft={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded(){return ht===Ut.loaded||ft.applyArabicShaping!=null},isLoading(){return ht===Ut.loading},setState(r){if(!ct())throw new Error("Cannot set the state of the rtl-text-plugin when not in the web-worker context");ht=r.pluginStatus,vr=r.pluginURL},isParsed(){if(!ct())throw new Error("rtl-text-plugin is only parsed on the worker-threads");return ft.applyArabicShaping!=null&&ft.processBidirectionalText!=null&&ft.processStyledBidirectionalText!=null},getPluginURL(){if(!ct())throw new Error("rtl-text-plugin url can only be queried from the worker threads");return vr}},gx=u(function(){!ft.isLoading()&&!ft.isLoaded()&&Kn()==="deferred"&&yx()},"lazyLoadRTLTextPlugin");var vp=class vp{constructor(e,t){this.zoom=e,t?(this.now=t.now,this.fadeDuration=t.fadeDuration,this.zoomHistory=t.zoomHistory,this.transition=t.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new Ui,this.transition={})}isSupportedScript(e){return fx(e,ft.isLoaded())}crossFadingFactor(){return this.fadeDuration===0?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)}getCrossfadeParameters(){let e=this.zoom,t=e-Math.floor(e),i=this.crossFadingFactor();return e>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:t+(1-t)*i}:{fromScale:.5,toScale:1,t:1-(1-i)*t}}};u(vp,"EvaluationParameters");var ye=vp;var wp=class wp{constructor(e,t){this.property=e,this.value=t,this.expression=jg(t===void 0?e.specification.default:t,e.specification)}isDataDriven(){return this.expression.kind==="source"||this.expression.kind==="composite"}possiblyEvaluate(e,t,i){return this.property.possiblyEvaluate(this,e,t,i)}};u(wp,"PropertyValue");var Ni=wp,Sp=class Sp{constructor(e){this.property=e,this.value=new Ni(e,void 0)}transitioned(e,t){return new cs(this.property,this.value,t,R({},e.transition,this.transition),e.now)}untransitioned(){return new cs(this.property,this.value,null,{},0)}};u(Sp,"TransitionablePropertyValue");var Yn=Sp,Pp=class Pp{constructor(e){this._properties=e,this._values=Object.create(e.defaultTransitionablePropertyValues)}getValue(e){return ut(this._values[e].value.value)}setValue(e,t){Object.prototype.hasOwnProperty.call(this._values,e)||(this._values[e]=new Yn(this._values[e].property)),this._values[e].value=new Ni(this._values[e].property,t===null?void 0:ut(t))}getTransition(e){return ut(this._values[e].transition)}setTransition(e,t){Object.prototype.hasOwnProperty.call(this._values,e)||(this._values[e]=new Yn(this._values[e].property)),this._values[e].transition=ut(t)||void 0}serialize(){let e={};for(let t of Object.keys(this._values)){let i=this.getValue(t);i!==void 0&&(e[t]=i);let n=this.getTransition(t);n!==void 0&&(e["".concat(t,"-transition")]=n)}return e}transitioned(e,t){let i=new ps(this._properties);for(let n of Object.keys(this._values))i._values[n]=this._values[n].transitioned(e,t._values[n]);return i}untransitioned(){let e=new ps(this._properties);for(let t of Object.keys(this._values))e._values[t]=this._values[t].untransitioned();return e}};u(Pp,"Transitionable");var Gi=Pp,Tp=class Tp{constructor(e,t,i,n,a){this.property=e,this.value=t,this.begin=a+n.delay||0,this.end=this.begin+n.duration||0,e.specification.transition&&(n.delay||n.duration)&&(this.prior=i)}possiblyEvaluate(e,t,i){let n=e.now||0,a=this.value.possiblyEvaluate(e,t,i),o=this.prior;if(o){if(n>this.end)return this.prior=null,a;if(this.value.isDataDriven())return this.prior=null,a;if(n<this.begin)return o.possiblyEvaluate(e,t,i);{let s=(n-this.begin)/(this.end-this.begin);return this.property.interpolate(o.possiblyEvaluate(e,t,i),a,Hy(s))}}else return a}};u(Tp,"TransitioningPropertyValue");var cs=Tp,Ap=class Ap{constructor(e){this._properties=e,this._values=Object.create(e.defaultTransitioningPropertyValues)}possiblyEvaluate(e,t,i){let n=new wr(this._properties);for(let a of Object.keys(this._values))n._values[a]=this._values[a].possiblyEvaluate(e,t,i);return n}hasTransition(){for(let e of Object.keys(this._values))if(this._values[e].prior)return!0;return!1}};u(Ap,"Transitioning");var ps=Ap,Ip=class Ip{constructor(e){this._properties=e,this._values=Object.create(e.defaultPropertyValues)}getValue(e){return ut(this._values[e].value)}setValue(e,t){this._values[e]=new Ni(this._values[e].property,t===null?void 0:ut(t))}serialize(){let e={};for(let t of Object.keys(this._values)){let i=this.getValue(t);i!==void 0&&(e[t]=i)}return e}possiblyEvaluate(e,t,i){let n=new wr(this._properties);for(let a of Object.keys(this._values))n._values[a]=this._values[a].possiblyEvaluate(e,t,i);return n}};u(Ip,"Layout");var hs=Ip,Mp=class Mp{constructor(e,t,i){this.property=e,this.value=t,this.parameters=i}isConstant(){return this.value.kind==="constant"}constantOr(e){return this.value.kind==="constant"?this.value.value:e}evaluate(e,t,i,n){return this.property.evaluate(this.value,this.parameters,e,t,i,n)}};u(Mp,"PossiblyEvaluatedPropertyValue");var at=Mp,Cp=class Cp{constructor(e){this._properties=e,this._values=Object.create(e.defaultPossiblyEvaluatedValues)}get(e){return this._values[e]}};u(Cp,"PossiblyEvaluated");var wr=Cp,Ep=class Ep{constructor(e){this.specification=e}possiblyEvaluate(e,t){if(e.isDataDriven())throw new Error("Value should not be data driven");return e.expression.evaluate(t)}interpolate(e,t,i){let n=this.specification.type,a=ke[n];return a?a(e,t,i):e}};u(Ep,"DataConstantProperty");var $=Ep,kp=class kp{constructor(e,t){this.specification=e,this.overrides=t}possiblyEvaluate(e,t,i,n){return e.expression.kind==="constant"||e.expression.kind==="camera"?new at(this,{kind:"constant",value:e.expression.evaluate(t,null,{},i,n)},t):new at(this,e.expression,t)}interpolate(e,t,i){if(e.value.kind!=="constant"||t.value.kind!=="constant")return e;if(e.value.value===void 0||t.value.value===void 0)return new at(this,{kind:"constant",value:void 0},e.parameters);let n=this.specification.type,a=ke[n];if(a){let o=a(e.value.value,t.value.value,i);return new at(this,{kind:"constant",value:o},e.parameters)}else return e}evaluate(e,t,i,n,a,o){return e.kind==="constant"?e.value:e.evaluate(t,i,n,a,o)}};u(kp,"DataDrivenProperty");var W=kp,Lp=class Lp extends W{possiblyEvaluate(e,t,i,n){if(e.value===void 0)return new at(this,{kind:"constant",value:void 0},t);if(e.expression.kind==="constant"){let a=e.expression.evaluate(t,null,{},i,n),s=e.property.specification.type==="resolvedImage"&&typeof a!="string"?a.name:a,l=this._calculate(s,s,s,t);return new at(this,{kind:"constant",value:l},t)}else if(e.expression.kind==="camera"){let a=this._calculate(e.expression.evaluate({zoom:t.zoom-1}),e.expression.evaluate({zoom:t.zoom}),e.expression.evaluate({zoom:t.zoom+1}),t);return new at(this,{kind:"constant",value:a},t)}else return new at(this,e.expression,t)}evaluate(e,t,i,n,a,o){if(e.kind==="source"){let s=e.evaluate(t,i,n,a,o);return this._calculate(s,s,s,t)}else return e.kind==="composite"?this._calculate(e.evaluate({zoom:Math.floor(t.zoom)-1},i,n),e.evaluate({zoom:Math.floor(t.zoom)},i,n),e.evaluate({zoom:Math.floor(t.zoom)+1},i,n),t):e.value}_calculate(e,t,i,n){return n.zoom>n.zoomHistory.lastIntegerZoom?{from:e,to:t}:{from:i,to:t}}interpolate(e){return e}};u(Lp,"CrossFadedDataDrivenProperty");var rr=Lp,Dp=class Dp{constructor(e){this.specification=e}possiblyEvaluate(e,t,i,n){if(e.value!==void 0)if(e.expression.kind==="constant"){let a=e.expression.evaluate(t,null,{},i,n);return this._calculate(a,a,a,t)}else return this._calculate(e.expression.evaluate(new ye(Math.floor(t.zoom-1),t)),e.expression.evaluate(new ye(Math.floor(t.zoom),t)),e.expression.evaluate(new ye(Math.floor(t.zoom+1),t)),t)}_calculate(e,t,i,n){return n.zoom>n.zoomHistory.lastIntegerZoom?{from:e,to:t}:{from:i,to:t}}interpolate(e){return e}};u(Dp,"CrossFadedProperty");var Jr=Dp,zp=class zp{constructor(e){this.specification=e}possiblyEvaluate(e,t,i,n){return!!e.expression.evaluate(t,null,{},i,n)}interpolate(){return!1}};u(zp,"ColorRampProperty");var Qr=zp,Fp=class Fp{constructor(e){this.properties=e,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(let t in e){let i=e[t];i.specification.overridable&&this.overridableProperties.push(t);let n=this.defaultPropertyValues[t]=new Ni(i,void 0),a=this.defaultTransitionablePropertyValues[t]=new Yn(i);this.defaultTransitioningPropertyValues[t]=a.untransitioned(),this.defaultPossiblyEvaluatedValues[t]=n.possiblyEvaluate({})}}};u(Fp,"Properties");var Re=Fp;G("DataDrivenProperty",W);G("DataConstantProperty",$);G("CrossFadedDataDrivenProperty",rr);G("CrossFadedProperty",Jr);G("ColorRampProperty",Qr);var fs="-transition",Bp=class Bp extends de{constructor(t,i){super();if(this.id=t.id,this.type=t.type,this._featureFilter={filter:()=>!0,needGeometry:!1},t.type!=="custom"&&(t=t,this.metadata=t.metadata,this.minzoom=t.minzoom,this.maxzoom=t.maxzoom,t.type!=="background"&&(this.source=t.source,this.sourceLayer=t["source-layer"],this.filter=t.filter),i.layout&&(this._unevaluatedLayout=new hs(i.layout)),i.paint)){this._transitionablePaint=new Gi(i.paint);for(let n in t.paint)this.setPaintProperty(n,t.paint[n],{validate:!1});for(let n in t.layout)this.setLayoutProperty(n,t.layout[n],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new wr(i.paint)}}getCrossfadeParameters(){return this._crossfadeParameters}getLayoutProperty(t){return t==="visibility"?this.visibility:this._unevaluatedLayout.getValue(t)}setLayoutProperty(t,i,n={}){if(i!=null){let a="layers.".concat(this.id,".layout.").concat(t);if(this._validate(lx,a,t,i,n))return}if(t==="visibility"){this.visibility=i;return}this._unevaluatedLayout.setValue(t,i)}getPaintProperty(t){return t.endsWith(fs)?this._transitionablePaint.getTransition(t.slice(0,-fs.length)):this._transitionablePaint.getValue(t)}setPaintProperty(t,i,n={}){if(i!=null){let a="layers.".concat(this.id,".paint.").concat(t);if(this._validate(sx,a,t,i,n))return!1}if(t.endsWith(fs))return this._transitionablePaint.setTransition(t.slice(0,-fs.length),i||void 0),!1;{let a=this._transitionablePaint._values[t],o=a.property.specification["property-type"]==="cross-faded-data-driven",s=a.value.isDataDriven(),l=a.value;this._transitionablePaint.setValue(t,i),this._handleSpecialPaintPropertyUpdate(t);let c=this._transitionablePaint._values[t].value;return c.isDataDriven()||s||o||this._handleOverridablePaintPropertyUpdate(t,l,c)}}_handleSpecialPaintPropertyUpdate(t){}_handleOverridablePaintPropertyUpdate(t,i,n){return!1}isHidden(t){return this.minzoom&&t<this.minzoom||this.maxzoom&&t>=this.maxzoom?!0:this.visibility==="none"}updateTransitions(t){this._transitioningPaint=this._transitionablePaint.transitioned(t,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculate(t,i){t.getCrossfadeParameters&&(this._crossfadeParameters=t.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(t,void 0,i)),this.paint=this._transitioningPaint.possiblyEvaluate(t,void 0,i)}serialize(){let t={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout&&this._unevaluatedLayout.serialize(),paint:this._transitionablePaint&&this._transitionablePaint.serialize()};return this.visibility&&(t.layout=t.layout||{},t.layout.visibility=this.visibility),mo(t,(i,n)=>i!==void 0&&!(n==="layout"&&!Object.keys(i).length)&&!(n==="paint"&&!Object.keys(i).length))}_validate(t,i,n,a,o={}){return o&&o.validate===!1?!1:Ri(this,t.call(qe,{key:i,layerType:this.type,objectKey:n,value:a,styleSpec:M,style:{glyphs:!0,sprite:!0}}))}is3D(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(let t in this.paint._values){let i=this.paint.get(t);if(!(!(i instanceof at)||!gr(i.property.specification))&&(i.value.kind==="source"||i.value.kind==="composite")&&i.value.isStateDependent)return!0}return!1}};u(Bp,"StyleLayer");var je=Bp;d();d();d();var vS={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array},Rp=class Rp{constructor(e,t){this._structArray=e,this._pos1=t*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}};u(Rp,"Struct");var ei=Rp,wS=128,SS=5,Op=class Op{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(e,t){return e._trim(),t&&(e.isTransferred=!0,t.push(e.arrayBuffer)),{length:e.length,arrayBuffer:e.arrayBuffer}}static deserialize(e){let t=Object.create(this.prototype);return t.arrayBuffer=e.arrayBuffer,t.length=e.length,t.capacity=e.arrayBuffer.byteLength/t.bytesPerElement,t._refreshViews(),t}_trim(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())}clear(){this.length=0}resize(e){this.reserve(e),this.length=e}reserve(e){if(e>this.capacity){this.capacity=Math.max(e,Math.floor(this.capacity*SS),wS),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);let t=this.uint8;this._refreshViews(),t&&this.uint8.set(t)}}_refreshViews(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")}};u(Op,"StructArray");var Ve=Op;function ve(r,e=1){let t=0,i=0,n=r.map(o=>{let s=PS(o.type),l=t=xx(t,Math.max(e,s)),c=o.components||1;return i=Math.max(i,s),t+=s*c,{name:o.name,type:o.type,components:c,offset:l}}),a=xx(t,Math.max(i,e));return{members:n,size:a,alignment:e}}u(ve,"createLayout");function PS(r){return vS[r].BYTES_PER_ELEMENT}u(PS,"sizeOf");function xx(r,e){return Math.ceil(r/e)*e}u(xx,"align");var bx=ae(Pe(),1);var Vp=class Vp extends Ve{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,i){let n=this.length;return this.resize(n+1),this.emplace(n,t,i)}emplace(t,i,n){let a=t*2;return this.int16[a+0]=i,this.int16[a+1]=n,t}};u(Vp,"StructArrayLayout2i4");var ti=Vp;ti.prototype.bytesPerElement=4;G("StructArrayLayout2i4",ti);var Up=class Up extends Ve{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,i,n){let a=this.length;return this.resize(a+1),this.emplace(a,t,i,n)}emplace(t,i,n,a){let o=t*3;return this.int16[o+0]=i,this.int16[o+1]=n,this.int16[o+2]=a,t}};u(Up,"StructArrayLayout3i6");var qi=Up;qi.prototype.bytesPerElement=6;G("StructArrayLayout3i6",qi);var Np=class Np extends Ve{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,i,n,a){let o=this.length;return this.resize(o+1),this.emplace(o,t,i,n,a)}emplace(t,i,n,a,o){let s=t*4;return this.int16[s+0]=i,this.int16[s+1]=n,this.int16[s+2]=a,this.int16[s+3]=o,t}};u(Np,"StructArrayLayout4i8");var Jn=Np;Jn.prototype.bytesPerElement=8;G("StructArrayLayout4i8",Jn);var Gp=class Gp extends Ve{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,i,n,a,o,s){let l=this.length;return this.resize(l+1),this.emplace(l,t,i,n,a,o,s)}emplace(t,i,n,a,o,s,l){let c=t*6;return this.int16[c+0]=i,this.int16[c+1]=n,this.int16[c+2]=a,this.int16[c+3]=o,this.int16[c+4]=s,this.int16[c+5]=l,t}};u(Gp,"StructArrayLayout2i4i12");var Qn=Gp;Qn.prototype.bytesPerElement=12;G("StructArrayLayout2i4i12",Qn);var qp=class qp extends Ve{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,i,n,a,o,s){let l=this.length;return this.resize(l+1),this.emplace(l,t,i,n,a,o,s)}emplace(t,i,n,a,o,s,l){let c=t*4,p=t*8;return this.int16[c+0]=i,this.int16[c+1]=n,this.uint8[p+4]=a,this.uint8[p+5]=o,this.uint8[p+6]=s,this.uint8[p+7]=l,t}};u(qp,"StructArrayLayout2i4ub8");var ea=qp;ea.prototype.bytesPerElement=8;G("StructArrayLayout2i4ub8",ea);var jp=class jp extends Ve{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,i){let n=this.length;return this.resize(n+1),this.emplace(n,t,i)}emplace(t,i,n){let a=t*2;return this.float32[a+0]=i,this.float32[a+1]=n,t}};u(jp,"StructArrayLayout2f8");var Sr=jp;Sr.prototype.bytesPerElement=8;G("StructArrayLayout2f8",Sr);var $p=class $p extends Ve{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,i,n,a,o,s,l,c,p,h){let f=this.length;return this.resize(f+1),this.emplace(f,t,i,n,a,o,s,l,c,p,h)}emplace(t,i,n,a,o,s,l,c,p,h,f){let m=t*10;return this.uint16[m+0]=i,this.uint16[m+1]=n,this.uint16[m+2]=a,this.uint16[m+3]=o,this.uint16[m+4]=s,this.uint16[m+5]=l,this.uint16[m+6]=c,this.uint16[m+7]=p,this.uint16[m+8]=h,this.uint16[m+9]=f,t}};u($p,"StructArrayLayout10ui20");var ta=$p;ta.prototype.bytesPerElement=20;G("StructArrayLayout10ui20",ta);var Hp=class Hp extends Ve{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,i,n,a,o,s,l,c,p,h,f,m){let g=this.length;return this.resize(g+1),this.emplace(g,t,i,n,a,o,s,l,c,p,h,f,m)}emplace(t,i,n,a,o,s,l,c,p,h,f,m,g){let y=t*12;return this.int16[y+0]=i,this.int16[y+1]=n,this.int16[y+2]=a,this.int16[y+3]=o,this.uint16[y+4]=s,this.uint16[y+5]=l,this.uint16[y+6]=c,this.uint16[y+7]=p,this.int16[y+8]=h,this.int16[y+9]=f,this.int16[y+10]=m,this.int16[y+11]=g,t}};u(Hp,"StructArrayLayout4i4ui4i24");var ra=Hp;ra.prototype.bytesPerElement=24;G("StructArrayLayout4i4ui4i24",ra);var Zp=class Zp extends Ve{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,i,n){let a=this.length;return this.resize(a+1),this.emplace(a,t,i,n)}emplace(t,i,n,a){let o=t*3;return this.float32[o+0]=i,this.float32[o+1]=n,this.float32[o+2]=a,t}};u(Zp,"StructArrayLayout3f12");var ia=Zp;ia.prototype.bytesPerElement=12;G("StructArrayLayout3f12",ia);var Wp=class Wp extends Ve{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(t){let i=this.length;return this.resize(i+1),this.emplace(i,t)}emplace(t,i){let n=t*1;return this.uint32[n+0]=i,t}};u(Wp,"StructArrayLayout1ul4");var na=Wp;na.prototype.bytesPerElement=4;G("StructArrayLayout1ul4",na);var Xp=class Xp extends Ve{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,i,n,a,o,s,l,c,p){let h=this.length;return this.resize(h+1),this.emplace(h,t,i,n,a,o,s,l,c,p)}emplace(t,i,n,a,o,s,l,c,p,h){let f=t*10,m=t*5;return this.int16[f+0]=i,this.int16[f+1]=n,this.int16[f+2]=a,this.int16[f+3]=o,this.int16[f+4]=s,this.int16[f+5]=l,this.uint32[m+3]=c,this.uint16[f+8]=p,this.uint16[f+9]=h,t}};u(Xp,"StructArrayLayout6i1ul2ui20");var aa=Xp;aa.prototype.bytesPerElement=20;G("StructArrayLayout6i1ul2ui20",aa);var Kp=class Kp extends Ve{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,i,n,a,o,s){let l=this.length;return this.resize(l+1),this.emplace(l,t,i,n,a,o,s)}emplace(t,i,n,a,o,s,l){let c=t*6;return this.int16[c+0]=i,this.int16[c+1]=n,this.int16[c+2]=a,this.int16[c+3]=o,this.int16[c+4]=s,this.int16[c+5]=l,t}};u(Kp,"StructArrayLayout2i2i2i12");var oa=Kp;oa.prototype.bytesPerElement=12;G("StructArrayLayout2i2i2i12",oa);var Yp=class Yp extends Ve{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,i,n,a,o){let s=this.length;return this.resize(s+1),this.emplace(s,t,i,n,a,o)}emplace(t,i,n,a,o,s){let l=t*4,c=t*8;return this.float32[l+0]=i,this.float32[l+1]=n,this.float32[l+2]=a,this.int16[c+6]=o,this.int16[c+7]=s,t}};u(Yp,"StructArrayLayout2f1f2i16");var sa=Yp;sa.prototype.bytesPerElement=16;G("StructArrayLayout2f1f2i16",sa);var Jp=class Jp extends Ve{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,i,n,a){let o=this.length;return this.resize(o+1),this.emplace(o,t,i,n,a)}emplace(t,i,n,a,o){let s=t*12,l=t*3;return this.uint8[s+0]=i,this.uint8[s+1]=n,this.float32[l+1]=a,this.float32[l+2]=o,t}};u(Jp,"StructArrayLayout2ub2f12");var la=Jp;la.prototype.bytesPerElement=12;G("StructArrayLayout2ub2f12",la);var Qp=class Qp extends Ve{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,i,n){let a=this.length;return this.resize(a+1),this.emplace(a,t,i,n)}emplace(t,i,n,a){let o=t*3;return this.uint16[o+0]=i,this.uint16[o+1]=n,this.uint16[o+2]=a,t}};u(Qp,"StructArrayLayout3ui6");var ji=Qp;ji.prototype.bytesPerElement=6;G("StructArrayLayout3ui6",ji);var eh=class eh extends Ve{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,i,n,a,o,s,l,c,p,h,f,m,g,y,x,b,_){let v=this.length;return this.resize(v+1),this.emplace(v,t,i,n,a,o,s,l,c,p,h,f,m,g,y,x,b,_)}emplace(t,i,n,a,o,s,l,c,p,h,f,m,g,y,x,b,_,v){let S=t*24,P=t*12,T=t*48;return this.int16[S+0]=i,this.int16[S+1]=n,this.uint16[S+2]=a,this.uint16[S+3]=o,this.uint32[P+2]=s,this.uint32[P+3]=l,this.uint32[P+4]=c,this.uint16[S+10]=p,this.uint16[S+11]=h,this.uint16[S+12]=f,this.float32[P+7]=m,this.float32[P+8]=g,this.uint8[T+36]=y,this.uint8[T+37]=x,this.uint8[T+38]=b,this.uint32[P+10]=_,this.int16[S+22]=v,t}};u(eh,"StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48");var ua=eh;ua.prototype.bytesPerElement=48;G("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",ua);var th=class th extends Ve{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,i,n,a,o,s,l,c,p,h,f,m,g,y,x,b,_,v,S,P,T,A,L,C,I,D,F,k){let E=this.length;return this.resize(E+1),this.emplace(E,t,i,n,a,o,s,l,c,p,h,f,m,g,y,x,b,_,v,S,P,T,A,L,C,I,D,F,k)}emplace(t,i,n,a,o,s,l,c,p,h,f,m,g,y,x,b,_,v,S,P,T,A,L,C,I,D,F,k,E){let O=t*34,X=t*17;return this.int16[O+0]=i,this.int16[O+1]=n,this.int16[O+2]=a,this.int16[O+3]=o,this.int16[O+4]=s,this.int16[O+5]=l,this.int16[O+6]=c,this.int16[O+7]=p,this.uint16[O+8]=h,this.uint16[O+9]=f,this.uint16[O+10]=m,this.uint16[O+11]=g,this.uint16[O+12]=y,this.uint16[O+13]=x,this.uint16[O+14]=b,this.uint16[O+15]=_,this.uint16[O+16]=v,this.uint16[O+17]=S,this.uint16[O+18]=P,this.uint16[O+19]=T,this.uint16[O+20]=A,this.uint16[O+21]=L,this.uint16[O+22]=C,this.uint32[X+12]=I,this.float32[X+13]=D,this.float32[X+14]=F,this.float32[X+15]=k,this.float32[X+16]=E,t}};u(th,"StructArrayLayout8i15ui1ul4f68");var ca=th;ca.prototype.bytesPerElement=68;G("StructArrayLayout8i15ui1ul4f68",ca);var rh=class rh extends Ve{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t){let i=this.length;return this.resize(i+1),this.emplace(i,t)}emplace(t,i){let n=t*1;return this.float32[n+0]=i,t}};u(rh,"StructArrayLayout1f4");var ri=rh;ri.prototype.bytesPerElement=4;G("StructArrayLayout1f4",ri);var ih=class ih extends Ve{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,i,n){let a=this.length;return this.resize(a+1),this.emplace(a,t,i,n)}emplace(t,i,n,a){let o=t*2,s=t*4;return this.uint32[o+0]=i,this.uint16[s+2]=n,this.uint16[s+3]=a,t}};u(ih,"StructArrayLayout1ul2ui8");var pa=ih;pa.prototype.bytesPerElement=8;G("StructArrayLayout1ul2ui8",pa);var nh=class nh extends Ve{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,i){let n=this.length;return this.resize(n+1),this.emplace(n,t,i)}emplace(t,i,n){let a=t*2;return this.uint16[a+0]=i,this.uint16[a+1]=n,t}};u(nh,"StructArrayLayout2ui4");var ha=nh;ha.prototype.bytesPerElement=4;G("StructArrayLayout2ui4",ha);var ah=class ah extends Ve{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t){let i=this.length;return this.resize(i+1),this.emplace(i,t)}emplace(t,i){let n=t*1;return this.uint16[n+0]=i,t}};u(ah,"StructArrayLayout1ui2");var fa=ah;fa.prototype.bytesPerElement=2;G("StructArrayLayout1ui2",fa);var oh=class oh extends Ve{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,i,n,a){let o=this.length;return this.resize(o+1),this.emplace(o,t,i,n,a)}emplace(t,i,n,a,o){let s=t*4;return this.float32[s+0]=i,this.float32[s+1]=n,this.float32[s+2]=a,this.float32[s+3]=o,t}};u(oh,"StructArrayLayout4f16");var $i=oh;$i.prototype.bytesPerElement=16;G("StructArrayLayout4f16",$i);var sh=class sh extends ei{get anchorPointX(){return this._structArray.int16[this._pos2+0]}get anchorPointY(){return this._structArray.int16[this._pos2+1]}get x1(){return this._structArray.int16[this._pos2+2]}get y1(){return this._structArray.int16[this._pos2+3]}get x2(){return this._structArray.int16[this._pos2+4]}get y2(){return this._structArray.int16[this._pos2+5]}get featureIndex(){return this._structArray.uint32[this._pos4+3]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+8]}get bucketIndex(){return this._structArray.uint16[this._pos2+9]}get anchorPoint(){return new bx.default(this.anchorPointX,this.anchorPointY)}};u(sh,"CollisionBoxStruct");var ms=sh;ms.prototype.size=20;var lh=class lh extends aa{get(e){return new ms(this,e)}};u(lh,"CollisionBoxArray");var ma=lh;G("CollisionBoxArray",ma);var uh=class uh extends ei{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get glyphStartIndex(){return this._structArray.uint16[this._pos2+2]}get numGlyphs(){return this._structArray.uint16[this._pos2+3]}get vertexStartIndex(){return this._structArray.uint32[this._pos4+2]}get lineStartIndex(){return this._structArray.uint32[this._pos4+3]}get lineLength(){return this._structArray.uint32[this._pos4+4]}get segment(){return this._structArray.uint16[this._pos2+10]}get lowerSize(){return this._structArray.uint16[this._pos2+11]}get upperSize(){return this._structArray.uint16[this._pos2+12]}get lineOffsetX(){return this._structArray.float32[this._pos4+7]}get lineOffsetY(){return this._structArray.float32[this._pos4+8]}get writingMode(){return this._structArray.uint8[this._pos1+36]}get placedOrientation(){return this._structArray.uint8[this._pos1+37]}set placedOrientation(t){this._structArray.uint8[this._pos1+37]=t}get hidden(){return this._structArray.uint8[this._pos1+38]}set hidden(t){this._structArray.uint8[this._pos1+38]=t}get crossTileID(){return this._structArray.uint32[this._pos4+10]}set crossTileID(t){this._structArray.uint32[this._pos4+10]=t}get associatedIconIndex(){return this._structArray.int16[this._pos2+22]}};u(uh,"PlacedSymbolStruct");var ds=uh;ds.prototype.size=48;var ch=class ch extends ua{get(e){return new ds(this,e)}};u(ch,"PlacedSymbolArray");var da=ch;G("PlacedSymbolArray",da);var ph=class ph extends ei{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get rightJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+2]}get centerJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+3]}get leftJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+4]}get verticalPlacedTextSymbolIndex(){return this._structArray.int16[this._pos2+5]}get placedIconSymbolIndex(){return this._structArray.int16[this._pos2+6]}get verticalPlacedIconSymbolIndex(){return this._structArray.int16[this._pos2+7]}get key(){return this._structArray.uint16[this._pos2+8]}get textBoxStartIndex(){return this._structArray.uint16[this._pos2+9]}get textBoxEndIndex(){return this._structArray.uint16[this._pos2+10]}get verticalTextBoxStartIndex(){return this._structArray.uint16[this._pos2+11]}get verticalTextBoxEndIndex(){return this._structArray.uint16[this._pos2+12]}get iconBoxStartIndex(){return this._structArray.uint16[this._pos2+13]}get iconBoxEndIndex(){return this._structArray.uint16[this._pos2+14]}get verticalIconBoxStartIndex(){return this._structArray.uint16[this._pos2+15]}get verticalIconBoxEndIndex(){return this._structArray.uint16[this._pos2+16]}get featureIndex(){return this._structArray.uint16[this._pos2+17]}get numHorizontalGlyphVertices(){return this._structArray.uint16[this._pos2+18]}get numVerticalGlyphVertices(){return this._structArray.uint16[this._pos2+19]}get numIconVertices(){return this._structArray.uint16[this._pos2+20]}get numVerticalIconVertices(){return this._structArray.uint16[this._pos2+21]}get useRuntimeCollisionCircles(){return this._structArray.uint16[this._pos2+22]}get crossTileID(){return this._structArray.uint32[this._pos4+12]}set crossTileID(t){this._structArray.uint32[this._pos4+12]=t}get textBoxScale(){return this._structArray.float32[this._pos4+13]}get textOffset0(){return this._structArray.float32[this._pos4+14]}get textOffset1(){return this._structArray.float32[this._pos4+15]}get collisionCircleDiameter(){return this._structArray.float32[this._pos4+16]}};u(ph,"SymbolInstanceStruct");var ys=ph;ys.prototype.size=68;var hh=class hh extends ca{get(e){return new ys(this,e)}};u(hh,"SymbolInstanceArray");var ya=hh;G("SymbolInstanceArray",ya);var fh=class fh extends ri{getoffsetX(e){return this.float32[e*1+0]}};u(fh,"GlyphOffsetArray");var ga=fh;G("GlyphOffsetArray",ga);var mh=class mh extends qi{getx(e){return this.int16[e*3+0]}gety(e){return this.int16[e*3+1]}gettileUnitDistanceFromAnchor(e){return this.int16[e*3+2]}};u(mh,"SymbolLineVertexArray");var xa=mh;G("SymbolLineVertexArray",xa);var dh=class dh extends ei{get featureIndex(){return this._structArray.uint32[this._pos4+0]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+2]}get bucketIndex(){return this._structArray.uint16[this._pos2+3]}};u(dh,"FeatureIndexStruct");var gs=dh;gs.prototype.size=8;var yh=class yh extends pa{get(e){return new gs(this,e)}};u(yh,"FeatureIndexArray");var ba=yh;G("FeatureIndexArray",ba);var gh=class gh extends ti{};u(gh,"PosArray");var Pr=gh,xh=class xh extends qi{};u(xh,"Pos3dArray");var xs=xh,bh=class bh extends Jn{};u(bh,"RasterBoundsArray");var Hi=bh,_h=class _h extends ti{};u(_h,"CircleLayoutArray");var bs=_h,vh=class vh extends ti{};u(vh,"FillLayoutArray");var _s=vh,wh=class wh extends Qn{};u(wh,"FillExtrusionLayoutArray");var vs=wh;var Sh=class Sh extends ea{};u(Sh,"LineLayoutArray");var ws=Sh,Ph=class Ph extends Sr{};u(Ph,"LineExtLayoutArray");var Ss=Ph,Th=class Th extends ta{};u(Th,"PatternLayoutArray");var ir=Th,Ah=class Ah extends ra{};u(Ah,"SymbolLayoutArray");var Ps=Ah,Ih=class Ih extends ia{};u(Ih,"SymbolDynamicLayoutArray");var Ts=Ih,Mh=class Mh extends na{};u(Mh,"SymbolOpacityArray");var As=Mh,Ch=class Ch extends oa{};u(Ch,"CollisionBoxLayoutArray");var _a=Ch,Eh=class Eh extends sa{};u(Eh,"CollisionCircleLayoutArray");var Is=Eh,kh=class kh extends la{};u(kh,"CollisionVertexArray");var Ms=kh,Lh=class Lh extends ji{};u(Lh,"QuadTriangleArray");var Cs=Lh,Dh=class Dh extends ji{};u(Dh,"TriangleIndexArray");var nt=Dh,zh=class zh extends ha{};u(zh,"LineIndexArray");var Tr=zh,Fh=class Fh extends fa{};u(Fh,"LineStripIndexArray");var va=Fh;d();var TS=ve([{name:"a_pos",components:2,type:"Int16"}],4);var{members:_x,size:TL,alignment:AL}=TS;d();var ii=class ii{constructor(e=[]){this.segments=e}prepareSegment(e,t,i,n){let a=this.segments[this.segments.length-1];return e>ii.MAX_VERTEX_ARRAY_LENGTH&&Ce("Max vertices per segment is ".concat(ii.MAX_VERTEX_ARRAY_LENGTH,": bucket requested ").concat(e)),(!a||a.vertexLength+e>ii.MAX_VERTEX_ARRAY_LENGTH||a.sortKey!==n)&&(a={vertexOffset:t.length,primitiveOffset:i.length,vertexLength:0,primitiveLength:0},n!==void 0&&(a.sortKey=n),this.segments.push(a)),a}get(){return this.segments}destroy(){for(let e of this.segments)for(let t in e.vaos)e.vaos[t].destroy()}static simpleSegment(e,t,i,n){return new ii([{vertexOffset:e,primitiveOffset:t,vertexLength:i,primitiveLength:n,vaos:{},sortKey:0}])}};u(ii,"SegmentVector");var me=ii;me.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1;G("SegmentVector",me);d();d();function Bh(r,e){return r=Te(Math.floor(r),0,255),e=Te(Math.floor(e),0,255),256*r+e}u(Bh,"packUint8ToFloat");d();var wa=ve([{name:"a_pattern_from",components:4,type:"Uint16"},{name:"a_pattern_to",components:4,type:"Uint16"},{name:"a_pixel_ratio_from",components:1,type:"Uint16"},{name:"a_pixel_ratio_to",components:1,type:"Uint16"}]);d();var Tx=ae(Vh(),1);var Ls=class Ls{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(e,t,i,n){this.ids.push(Px(e)),this.positions.push(t,i,n)}getPositions(e){if(!this.indexed)throw new Error("Trying to get index, but feature positions are not indexed");let t=Px(e),i=0,n=this.ids.length-1;for(;i<n;){let o=i+n>>1;this.ids[o]>=t?n=o:i=o+1}let a=[];for(;this.ids[i]===t;){let o=this.positions[3*i],s=this.positions[3*i+1],l=this.positions[3*i+2];a.push({index:o,start:s,end:l}),i++}return a}static serialize(e,t){let i=new Float64Array(e.ids),n=new Uint32Array(e.positions);return Uh(i,n,0,i.length-1),t&&t.push(i.buffer,n.buffer),{ids:i,positions:n}}static deserialize(e){let t=new Ls;return t.ids=e.ids,t.positions=e.positions,t.indexed=!0,t}};u(Ls,"FeaturePositionMap");var Sa=Ls;function Px(r){let e=+r;return!isNaN(e)&&e<=Number.MAX_SAFE_INTEGER?e:(0,Tx.default)(String(r))}u(Px,"getNumericId");function Uh(r,e,t,i){for(;t<i;){let n=r[t+i>>1],a=t-1,o=i+1;for(;;){do a++;while(r[a]<n);do o--;while(r[o]>n);if(a>=o)break;ks(r,a,o),ks(e,3*a,3*o),ks(e,3*a+1,3*o+1),ks(e,3*a+2,3*o+2)}o-t<i-o?(Uh(r,e,t,o),t=o+1):(Uh(r,e,o+1,i),i=o)}}u(Uh,"sort");function ks(r,e,t){let i=r[e];r[e]=r[t],r[t]=i}u(ks,"swap");G("FeaturePositionMap",Sa);d();var Nh=class Nh{constructor(e,t){this.gl=e.gl,this.location=t}};u(Nh,"Uniform");var nr=Nh,Gh=class Gh extends nr{constructor(e,t){super(e,t),this.current=0}set(e){this.current!==e&&(this.current=e,this.gl.uniform1i(this.location,e))}};u(Gh,"Uniform1i");var Y=Gh,qh=class qh extends nr{constructor(e,t){super(e,t),this.current=0}set(e){this.current!==e&&(this.current=e,this.gl.uniform1f(this.location,e))}};u(qh,"Uniform1f");var U=qh,jh=class jh extends nr{constructor(e,t){super(e,t),this.current=[0,0]}set(e){(e[0]!==this.current[0]||e[1]!==this.current[1])&&(this.current=e,this.gl.uniform2f(this.location,e[0],e[1]))}};u(jh,"Uniform2f");var ee=jh,$h=class $h extends nr{constructor(e,t){super(e,t),this.current=[0,0,0]}set(e){(e[0]!==this.current[0]||e[1]!==this.current[1]||e[2]!==this.current[2])&&(this.current=e,this.gl.uniform3f(this.location,e[0],e[1],e[2]))}};u($h,"Uniform3f");var st=$h,Hh=class Hh extends nr{constructor(e,t){super(e,t),this.current=[0,0,0,0]}set(e){(e[0]!==this.current[0]||e[1]!==this.current[1]||e[2]!==this.current[2]||e[3]!==this.current[3])&&(this.current=e,this.gl.uniform4f(this.location,e[0],e[1],e[2],e[3]))}};u(Hh,"Uniform4f");var Ar=Hh,Zh=class Zh extends nr{constructor(e,t){super(e,t),this.current=K.transparent}set(e){(e.r!==this.current.r||e.g!==this.current.g||e.b!==this.current.b||e.a!==this.current.a)&&(this.current=e,this.gl.uniform4f(this.location,e.r,e.g,e.b,e.a))}};u(Zh,"UniformColor");var Dt=Zh,CS=new Float32Array(16),Wh=class Wh extends nr{constructor(e,t){super(e,t),this.current=CS}set(e){if(e[12]!==this.current[12]||e[0]!==this.current[0]){this.current=e,this.gl.uniformMatrix4fv(this.location,!1,e);return}for(let t=1;t<16;t++)if(e[t]!==this.current[t]){this.current=e,this.gl.uniformMatrix4fv(this.location,!1,e);break}}};u(Wh,"UniformMatrix4f");var te=Wh;function Xh(r){return[Bh(255*r.r,255*r.g),Bh(255*r.b,255*r.a)]}u(Xh,"packColor");var Kh=class Kh{constructor(e,t,i){this.value=e,this.uniformNames=t.map(n=>"u_".concat(n)),this.type=i}setUniform(e,t,i){e.set(i.constantOr(this.value))}getBinding(e,t,i){return this.type==="color"?new Dt(e,t):new U(e,t)}};u(Kh,"ConstantBinder");var ni=Kh,Yh=class Yh{constructor(e,t){this.uniformNames=t.map(i=>"u_".concat(i)),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1}setConstantPatternPositions(e,t){this.pixelRatioFrom=t.pixelRatio,this.pixelRatioTo=e.pixelRatio,this.patternFrom=t.tlbr,this.patternTo=e.tlbr}setUniform(e,t,i,n){let a=n==="u_pattern_to"?this.patternTo:n==="u_pattern_from"?this.patternFrom:n==="u_pixel_ratio_to"?this.pixelRatioTo:n==="u_pixel_ratio_from"?this.pixelRatioFrom:null;a&&e.set(a)}getBinding(e,t,i){return i.substr(0,9)==="u_pattern"?new Ar(e,t):new U(e,t)}};u(Yh,"CrossFadedConstantBinder");var Ir=Yh,Jh=class Jh{constructor(e,t,i,n){this.expression=e,this.type=i,this.maxValue=0,this.paintVertexAttributes=t.map(a=>({name:"a_".concat(a),type:"Float32",components:i==="color"?2:1,offset:0})),this.paintVertexArray=new n}populatePaintArray(e,t,i,n,a){let o=this.paintVertexArray.length,s=this.expression.evaluate(new ye(0),t,{},n,[],a);this.paintVertexArray.resize(e),this._setPaintValue(o,e,s)}updatePaintArray(e,t,i,n){let a=this.expression.evaluate({zoom:0},i,n);this._setPaintValue(e,t,a)}_setPaintValue(e,t,i){if(this.type==="color"){let n=Xh(i);for(let a=e;a<t;a++)this.paintVertexArray.emplace(a,n[0],n[1])}else{for(let n=e;n<t;n++)this.paintVertexArray.emplace(n,i);this.maxValue=Math.max(this.maxValue,Math.abs(i))}}upload(e){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=e.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}};u(Jh,"SourceExpressionBinder");var Nt=Jh,Qh=class Qh{constructor(e,t,i,n,a,o){this.expression=e,this.uniformNames=t.map(s=>"u_".concat(s,"_t")),this.type=i,this.useIntegerZoom=n,this.zoom=a,this.maxValue=0,this.paintVertexAttributes=t.map(s=>({name:"a_".concat(s),type:"Float32",components:i==="color"?4:2,offset:0})),this.paintVertexArray=new o}populatePaintArray(e,t,i,n,a){let o=this.expression.evaluate(new ye(this.zoom),t,{},n,[],a),s=this.expression.evaluate(new ye(this.zoom+1),t,{},n,[],a),l=this.paintVertexArray.length;this.paintVertexArray.resize(e),this._setPaintValue(l,e,o,s)}updatePaintArray(e,t,i,n){let a=this.expression.evaluate({zoom:this.zoom},i,n),o=this.expression.evaluate({zoom:this.zoom+1},i,n);this._setPaintValue(e,t,a,o)}_setPaintValue(e,t,i,n){if(this.type==="color"){let a=Xh(i),o=Xh(n);for(let s=e;s<t;s++)this.paintVertexArray.emplace(s,a[0],a[1],o[0],o[1])}else{for(let a=e;a<t;a++)this.paintVertexArray.emplace(a,i,n);this.maxValue=Math.max(this.maxValue,Math.abs(i),Math.abs(n))}}upload(e){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=e.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}setUniform(e,t){let i=this.useIntegerZoom?Math.floor(t.zoom):t.zoom,n=Te(this.expression.interpolationFactor(i,this.zoom,this.zoom+1),0,1);e.set(n)}getBinding(e,t,i){return new U(e,t)}};u(Qh,"CompositeExpressionBinder");var Pt=Qh,ef=class ef{constructor(e,t,i,n,a,o){this.expression=e,this.type=t,this.useIntegerZoom=i,this.zoom=n,this.layerId=o,this.zoomInPaintVertexArray=new a,this.zoomOutPaintVertexArray=new a}populatePaintArray(e,t,i){let n=this.zoomInPaintVertexArray.length;this.zoomInPaintVertexArray.resize(e),this.zoomOutPaintVertexArray.resize(e),this._setPaintValues(n,e,t.patterns&&t.patterns[this.layerId],i)}updatePaintArray(e,t,i,n,a){this._setPaintValues(e,t,i.patterns&&i.patterns[this.layerId],a)}_setPaintValues(e,t,i,n){if(!n||!i)return;let{min:a,mid:o,max:s}=i,l=n[a],c=n[o],p=n[s];if(!(!l||!c||!p))for(let h=e;h<t;h++)this.zoomInPaintVertexArray.emplace(h,c.tl[0],c.tl[1],c.br[0],c.br[1],l.tl[0],l.tl[1],l.br[0],l.br[1],c.pixelRatio,l.pixelRatio),this.zoomOutPaintVertexArray.emplace(h,c.tl[0],c.tl[1],c.br[0],c.br[1],p.tl[0],p.tl[1],p.br[0],p.br[1],c.pixelRatio,p.pixelRatio)}upload(e){this.zoomInPaintVertexArray&&this.zoomInPaintVertexArray.arrayBuffer&&this.zoomOutPaintVertexArray&&this.zoomOutPaintVertexArray.arrayBuffer&&(this.zoomInPaintVertexBuffer=e.createVertexBuffer(this.zoomInPaintVertexArray,wa.members,this.expression.isStateDependent),this.zoomOutPaintVertexBuffer=e.createVertexBuffer(this.zoomOutPaintVertexArray,wa.members,this.expression.isStateDependent))}destroy(){this.zoomOutPaintVertexBuffer&&this.zoomOutPaintVertexBuffer.destroy(),this.zoomInPaintVertexBuffer&&this.zoomInPaintVertexBuffer.destroy()}};u(ef,"CrossFadedCompositeBinder");var jt=ef,tf=class tf{constructor(e,t,i){this.binders={},this._buffers=[];let n=[];for(let a in e.paint._values){if(!i(a))continue;let o=e.paint.get(a);if(!(o instanceof at)||!gr(o.property.specification))continue;let s=ES(a,e.type),l=o.value,c=o.property.specification.type,p=o.property.useIntegerZoom,h=o.property.specification["property-type"],f=h==="cross-faded"||h==="cross-faded-data-driven";if(l.kind==="constant")this.binders[a]=f?new Ir(l.value,s):new ni(l.value,s,c),n.push("/u_".concat(a));else if(l.kind==="source"||f){let m=Ax(a,c,"source");this.binders[a]=f?new jt(l,c,p,t,m,e.id):new Nt(l,s,c,m),n.push("/a_".concat(a))}else{let m=Ax(a,c,"composite");this.binders[a]=new Pt(l,s,c,p,t,m),n.push("/z_".concat(a))}}this.cacheKey=n.sort().join("")}getMaxValue(e){let t=this.binders[e];return t instanceof Nt||t instanceof Pt?t.maxValue:0}populatePaintArrays(e,t,i,n,a){for(let o in this.binders){let s=this.binders[o];(s instanceof Nt||s instanceof Pt||s instanceof jt)&&s.populatePaintArray(e,t,i,n,a)}}setConstantPatternPositions(e,t){for(let i in this.binders){let n=this.binders[i];n instanceof Ir&&n.setConstantPatternPositions(e,t)}}updatePaintArrays(e,t,i,n,a){let o=!1;for(let s in e){let l=t.getPositions(s);for(let c of l){let p=i.feature(c.index);for(let h in this.binders){let f=this.binders[h];if((f instanceof Nt||f instanceof Pt||f instanceof jt)&&f.expression.isStateDependent===!0){let m=n.paint.get(h);f.expression=m.value,f.updatePaintArray(c.start,c.end,p,e[s],a),o=!0}}}}return o}defines(){let e=[];for(let t in this.binders){let i=this.binders[t];(i instanceof ni||i instanceof Ir)&&e.push(...i.uniformNames.map(n=>"#define HAS_UNIFORM_".concat(n)))}return e}getBinderAttributes(){let e=[];for(let t in this.binders){let i=this.binders[t];if(i instanceof Nt||i instanceof Pt)for(let n=0;n<i.paintVertexAttributes.length;n++)e.push(i.paintVertexAttributes[n].name);else if(i instanceof jt)for(let n=0;n<wa.members.length;n++)e.push(wa.members[n].name)}return e}getBinderUniforms(){let e=[];for(let t in this.binders){let i=this.binders[t];if(i instanceof ni||i instanceof Ir||i instanceof Pt)for(let n of i.uniformNames)e.push(n)}return e}getPaintVertexBuffers(){return this._buffers}getUniforms(e,t){let i=[];for(let n in this.binders){let a=this.binders[n];if(a instanceof ni||a instanceof Ir||a instanceof Pt){for(let o of a.uniformNames)if(t[o]){let s=a.getBinding(e,t[o],o);i.push({name:o,property:n,binding:s})}}}return i}setUniforms(e,t,i,n){for(let{name:a,property:o,binding:s}of t)this.binders[o].setUniform(s,n,i.get(o),a)}updatePaintBuffers(e){this._buffers=[];for(let t in this.binders){let i=this.binders[t];if(e&&i instanceof jt){let n=e.fromScale===2?i.zoomInPaintVertexBuffer:i.zoomOutPaintVertexBuffer;n&&this._buffers.push(n)}else(i instanceof Nt||i instanceof Pt)&&i.paintVertexBuffer&&this._buffers.push(i.paintVertexBuffer)}}upload(e){for(let t in this.binders){let i=this.binders[t];(i instanceof Nt||i instanceof Pt||i instanceof jt)&&i.upload(e)}this.updatePaintBuffers()}destroy(){for(let e in this.binders){let t=this.binders[e];(t instanceof Nt||t instanceof Pt||t instanceof jt)&&t.destroy()}}};u(tf,"ProgramConfiguration");var Ds=tf,rf=class rf{constructor(e,t,i=()=>!0){this.programConfigurations={};for(let n of e)this.programConfigurations[n.id]=new Ds(n,t,i);this.needsUpload=!1,this._featureMap=new Sa,this._bufferOffset=0}populatePaintArrays(e,t,i,n,a,o){for(let s in this.programConfigurations)this.programConfigurations[s].populatePaintArrays(e,t,n,a,o);t.id!==void 0&&this._featureMap.add(t.id,i,this._bufferOffset,e),this._bufferOffset=e,this.needsUpload=!0}updatePaintArrays(e,t,i,n){for(let a of i)this.needsUpload=this.programConfigurations[a.id].updatePaintArrays(e,this._featureMap,t,a,n)||this.needsUpload}get(e){return this.programConfigurations[e]}upload(e){if(this.needsUpload){for(let t in this.programConfigurations)this.programConfigurations[t].upload(e);this.needsUpload=!1}}destroy(){for(let e in this.programConfigurations)this.programConfigurations[e].destroy()}};u(rf,"ProgramConfigurationSet");var mt=rf;function ES(r,e){return{"text-opacity":["opacity"],"icon-opacity":["opacity"],"text-color":["fill_color"],"icon-color":["fill_color"],"text-halo-color":["halo_color"],"icon-halo-color":["halo_color"],"text-halo-blur":["halo_blur"],"icon-halo-blur":["halo_blur"],"text-halo-width":["halo_width"],"icon-halo-width":["halo_width"],"line-gap-width":["gapwidth"],"line-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-extrusion-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"]}[r]||[r.replace("".concat(e,"-"),"").replace(/-/g,"_")]}u(ES,"paintAttributeNames");function kS(r){return{"line-pattern":{source:ir,composite:ir},"fill-pattern":{source:ir,composite:ir},"fill-extrusion-pattern":{source:ir,composite:ir}}[r]}u(kS,"getLayoutException");function Ax(r,e,t){let i={color:{source:Sr,composite:$i},number:{source:ri,composite:Sr}},n=kS(r);return n&&n[t]||i[e][t]}u(Ax,"layoutType");G("ConstantBinder",ni);G("CrossFadedConstantBinder",Ir);G("SourceExpressionBinder",Nt);G("CrossFadedCompositeBinder",jt);G("CompositeExpressionBinder",Pt);G("ProgramConfiguration",Ds,{omit:["_buffers"]});G("ProgramConfigurationSet",mt);d();d();d();var LS=15,nf=Math.pow(2,LS-1)-1,Ix=-nf-1;function dt(r){let e=8192/r.extent,t=r.loadGeometry();for(let i=0;i<t.length;i++){let n=t[i];for(let a=0;a<n.length;a++){let o=n[a],s=Math.round(o.x*e),l=Math.round(o.y*e);o.x=Te(s,Ix,nf),o.y=Te(l,Ix,nf),(s<o.x||s>o.x+1||l<o.y||l>o.y+1)&&Ce("Geometry exceeds allowed extent, reduce your vector tile buffer size")}}return t}u(dt,"loadGeometry");d();function yt(r,e){return{type:r.type,id:r.id,properties:r.properties,geometry:e?dt(r):[]}}u(yt,"toEvaluationFeature");function zs(r,e,t,i,n){r.emplaceBack(e*2+(i+1)/2,t*2+(n+1)/2)}u(zs,"addCircleVertex");var af=class af{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(t=>t.id),this.index=e.index,this.hasPattern=!1,this.layoutVertexArray=new bs,this.indexArray=new nt,this.segments=new me,this.programConfigurations=new mt(e.layers,e.zoom),this.stateDependentLayerIds=this.layers.filter(t=>t.isStateDependent()).map(t=>t.id)}populate(e,t,i){let n=this.layers[0],a=[],o=null,s=!1;n.type==="circle"&&(o=n.layout.get("circle-sort-key"),s=!o.isConstant());for(let{feature:l,id:c,index:p,sourceLayerIndex:h}of e){let f=this.layers[0]._featureFilter.needGeometry,m=yt(l,f);if(!this.layers[0]._featureFilter.filter(new ye(this.zoom),m,i))continue;let g=s?o.evaluate(m,{},i):void 0,y={id:c,properties:l.properties,type:l.type,sourceLayerIndex:h,index:p,geometry:f?m.geometry:dt(l),patterns:{},sortKey:g};a.push(y)}s&&a.sort((l,c)=>l.sortKey-c.sortKey);for(let l of a){let{geometry:c,index:p,sourceLayerIndex:h}=l,f=e[p].feature;this.addFeature(l,c,p,i),t.featureIndex.insert(f,c,p,h,this.index)}}update(e,t,i){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,t,this.stateDependentLayers,i)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,_x),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(e,t,i,n){for(let a of t)for(let o of a){let s=o.x,l=o.y;if(s<0||s>=8192||l<0||l>=8192)continue;let c=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,e.sortKey),p=c.vertexLength;zs(this.layoutVertexArray,s,l,-1,-1),zs(this.layoutVertexArray,s,l,1,-1),zs(this.layoutVertexArray,s,l,1,1),zs(this.layoutVertexArray,s,l,-1,1),this.indexArray.emplaceBack(p,p+1,p+2),this.indexArray.emplaceBack(p,p+3,p+2),c.vertexLength+=4,c.primitiveLength+=2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,i,{},n)}};u(af,"CircleBucket");var ai=af;G("CircleBucket",ai,{omit:["layers"]});d();var Pa=ae(Pe(),1);function Fs(r,e){for(let t=0;t<r.length;t++)if(Zi(e,r[t]))return!0;for(let t=0;t<e.length;t++)if(Zi(r,e[t]))return!0;return!!sf(r,e)}u(Fs,"polygonIntersectsPolygon");function Cx(r,e,t){return!!(Zi(r,e)||of(e,r,t))}u(Cx,"polygonIntersectsBufferedPoint");function Bs(r,e){if(r.length===1)return Mx(e,r[0]);for(let t=0;t<e.length;t++){let i=e[t];for(let n=0;n<i.length;n++)if(Zi(r,i[n]))return!0}for(let t=0;t<r.length;t++)if(Mx(e,r[t]))return!0;for(let t=0;t<e.length;t++)if(sf(r,e[t]))return!0;return!1}u(Bs,"polygonIntersectsMultiPolygon");function Ex(r,e,t){for(let i=0;i<e.length;i++){let n=e[i];if(r.length>=3){for(let a=0;a<n.length;a++)if(Zi(r,n[a]))return!0}if(DS(r,n,t))return!0}return!1}u(Ex,"polygonIntersectsBufferedMultiLine");function DS(r,e,t){if(r.length>1){if(sf(r,e))return!0;for(let i=0;i<e.length;i++)if(of(e[i],r,t))return!0}for(let i=0;i<r.length;i++)if(of(r[i],e,t))return!0;return!1}u(DS,"lineIntersectsBufferedLine");function sf(r,e){if(r.length===0||e.length===0)return!1;for(let t=0;t<r.length-1;t++){let i=r[t],n=r[t+1];for(let a=0;a<e.length-1;a++){let o=e[a],s=e[a+1];if(zS(i,n,o,s))return!0}}return!1}u(sf,"lineIntersectsLine");function zS(r,e,t,i){return Jt(r,t,i)!==Jt(e,t,i)&&Jt(r,e,t)!==Jt(r,e,i)}u(zS,"lineSegmentIntersectsLineSegment");function of(r,e,t){let i=t*t;if(e.length===1)return r.distSqr(e[0])<i;for(let n=1;n<e.length;n++){let a=e[n-1],o=e[n];if(kx(r,a,o)<i)return!0}return!1}u(of,"pointIntersectsBufferedLine");function kx(r,e,t){let i=e.distSqr(t);if(i===0)return r.distSqr(e);let n=((r.x-e.x)*(t.x-e.x)+(r.y-e.y)*(t.y-e.y))/i;return n<0?r.distSqr(e):n>1?r.distSqr(t):r.distSqr(t.sub(e)._mult(n)._add(e))}u(kx,"distToSegmentSquared");function Mx(r,e){let t=!1,i,n,a;for(let o=0;o<r.length;o++){i=r[o];for(let s=0,l=i.length-1;s<i.length;l=s++)n=i[s],a=i[l],n.y>e.y!=a.y>e.y&&e.x<(a.x-n.x)*(e.y-n.y)/(a.y-n.y)+n.x&&(t=!t)}return t}u(Mx,"multiPolygonContainsPoint");function Zi(r,e){let t=!1;for(let i=0,n=r.length-1;i<r.length;n=i++){let a=r[i],o=r[n];a.y>e.y!=o.y>e.y&&e.x<(o.x-a.x)*(e.y-a.y)/(o.y-a.y)+a.x&&(t=!t)}return t}u(Zi,"polygonContainsPoint");function Lx(r,e,t,i,n){for(let o of r)if(e<=o.x&&t<=o.y&&i>=o.x&&n>=o.y)return!0;let a=[new Pa.default(e,t),new Pa.default(e,n),new Pa.default(i,n),new Pa.default(i,t)];if(r.length>2){for(let o of a)if(Zi(r,o))return!0}for(let o=0;o<r.length-1;o++){let s=r[o],l=r[o+1];if(FS(s,l,a))return!0}return!1}u(Lx,"polygonIntersectsBox");function FS(r,e,t){let i=t[0],n=t[2];if(r.x<i.x&&e.x<i.x||r.x>n.x&&e.x>n.x||r.y<i.y&&e.y<i.y||r.y>n.y&&e.y>n.y)return!1;let a=Jt(r,e,t[0]);return a!==Jt(r,e,t[1])||a!==Jt(r,e,t[2])||a!==Jt(r,e,t[3])}u(FS,"edgeIntersectsBox");d();var Rs=ae(Pe(),1);function oi(r,e,t){let i=e.paint.get(r).value;return i.kind==="constant"?i.value:t.programConfigurations.get(e.id).getMaxValue(r)}u(oi,"getMaximumPaintValue");function Mr(r){return Math.sqrt(r[0]*r[0]+r[1]*r[1])}u(Mr,"translateDistance");function Cr(r,e,t,i,n){if(!e[0]&&!e[1])return r;let a=Rs.default.convert(e)._mult(n);t==="viewport"&&a._rotate(-i);let o=[];for(let s=0;s<r.length;s++){let l=r[s];o.push(l.sub(a))}return o}u(Cr,"translate");function Dx(r,e){let t=[];for(let i=0;i<r.length;i++){let n=r[i],a=[];for(let o=0;o<n.length;o++){let s=n[o-1],l=n[o],c=n[o+1],p=o===0?new Rs.default(0,0):l.sub(s)._unit()._perp(),h=o===n.length-1?new Rs.default(0,0):c.sub(l)._unit()._perp(),f=p._add(h)._unit(),m=f.x*h.x+f.y*h.y;m!==0&&f._mult(1/m),a.push(f._mult(e)._add(l))}t.push(a)}return t}u(Dx,"offsetLine");d();var zx,RS=u(()=>zx=zx||new Re({"circle-sort-key":new W(M.layout_circle["circle-sort-key"])}),"getLayout"),Fx,OS=u(()=>Fx=Fx||new Re({"circle-radius":new W(M.paint_circle["circle-radius"]),"circle-color":new W(M.paint_circle["circle-color"]),"circle-blur":new W(M.paint_circle["circle-blur"]),"circle-opacity":new W(M.paint_circle["circle-opacity"]),"circle-translate":new $(M.paint_circle["circle-translate"]),"circle-translate-anchor":new $(M.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new $(M.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new $(M.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new W(M.paint_circle["circle-stroke-width"]),"circle-stroke-color":new W(M.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new W(M.paint_circle["circle-stroke-opacity"])}),"getPaint"),Bx={get paint(){return OS()},get layout(){return RS()}};d();d();var ie=1e-6,we=typeof Float32Array<"u"?Float32Array:Array,$t=Math.random;var sz=Math.PI/180;Math.hypot||(Math.hypot=function(){for(var r=0,e=arguments.length;e--;)r+=arguments[e]*arguments[e];return Math.sqrt(r)});var Ta={};_i(Ta,{LDU:()=>tP,add:()=>rP,adjoint:()=>ZS,clone:()=>US,copy:()=>NS,create:()=>VS,determinant:()=>WS,equals:()=>nP,exactEquals:()=>iP,frob:()=>eP,fromRotation:()=>YS,fromScaling:()=>JS,fromValues:()=>qS,identity:()=>GS,invert:()=>HS,mul:()=>sP,multiply:()=>Rx,multiplyScalar:()=>aP,multiplyScalarAndAdd:()=>oP,rotate:()=>XS,scale:()=>KS,set:()=>jS,str:()=>QS,sub:()=>lP,subtract:()=>Ox,transpose:()=>$S});d();function VS(){var r=new we(4);return we!=Float32Array&&(r[1]=0,r[2]=0),r[0]=1,r[3]=1,r}u(VS,"create");function US(r){var e=new we(4);return e[0]=r[0],e[1]=r[1],e[2]=r[2],e[3]=r[3],e}u(US,"clone");function NS(r,e){return r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r}u(NS,"copy");function GS(r){return r[0]=1,r[1]=0,r[2]=0,r[3]=1,r}u(GS,"identity");function qS(r,e,t,i){var n=new we(4);return n[0]=r,n[1]=e,n[2]=t,n[3]=i,n}u(qS,"fromValues");function jS(r,e,t,i,n){return r[0]=e,r[1]=t,r[2]=i,r[3]=n,r}u(jS,"set");function $S(r,e){if(r===e){var t=e[1];r[1]=e[2],r[2]=t}else r[0]=e[0],r[1]=e[2],r[2]=e[1],r[3]=e[3];return r}u($S,"transpose");function HS(r,e){var t=e[0],i=e[1],n=e[2],a=e[3],o=t*a-n*i;return o?(o=1/o,r[0]=a*o,r[1]=-i*o,r[2]=-n*o,r[3]=t*o,r):null}u(HS,"invert");function ZS(r,e){var t=e[0];return r[0]=e[3],r[1]=-e[1],r[2]=-e[2],r[3]=t,r}u(ZS,"adjoint");function WS(r){return r[0]*r[3]-r[2]*r[1]}u(WS,"determinant");function Rx(r,e,t){var i=e[0],n=e[1],a=e[2],o=e[3],s=t[0],l=t[1],c=t[2],p=t[3];return r[0]=i*s+a*l,r[1]=n*s+o*l,r[2]=i*c+a*p,r[3]=n*c+o*p,r}u(Rx,"multiply");function XS(r,e,t){var i=e[0],n=e[1],a=e[2],o=e[3],s=Math.sin(t),l=Math.cos(t);return r[0]=i*l+a*s,r[1]=n*l+o*s,r[2]=i*-s+a*l,r[3]=n*-s+o*l,r}u(XS,"rotate");function KS(r,e,t){var i=e[0],n=e[1],a=e[2],o=e[3],s=t[0],l=t[1];return r[0]=i*s,r[1]=n*s,r[2]=a*l,r[3]=o*l,r}u(KS,"scale");function YS(r,e){var t=Math.sin(e),i=Math.cos(e);return r[0]=i,r[1]=t,r[2]=-t,r[3]=i,r}u(YS,"fromRotation");function JS(r,e){return r[0]=e[0],r[1]=0,r[2]=0,r[3]=e[1],r}u(JS,"fromScaling");function QS(r){return"mat2("+r[0]+", "+r[1]+", "+r[2]+", "+r[3]+")"}u(QS,"str");function eP(r){return Math.hypot(r[0],r[1],r[2],r[3])}u(eP,"frob");function tP(r,e,t,i){return r[2]=i[2]/i[0],t[0]=i[0],t[1]=i[1],t[3]=i[3]-r[2]*t[1],[r,e,t]}u(tP,"LDU");function rP(r,e,t){return r[0]=e[0]+t[0],r[1]=e[1]+t[1],r[2]=e[2]+t[2],r[3]=e[3]+t[3],r}u(rP,"add");function Ox(r,e,t){return r[0]=e[0]-t[0],r[1]=e[1]-t[1],r[2]=e[2]-t[2],r[3]=e[3]-t[3],r}u(Ox,"subtract");function iP(r,e){return r[0]===e[0]&&r[1]===e[1]&&r[2]===e[2]&&r[3]===e[3]}u(iP,"exactEquals");function nP(r,e){var t=r[0],i=r[1],n=r[2],a=r[3],o=e[0],s=e[1],l=e[2],c=e[3];return Math.abs(t-o)<=ie*Math.max(1,Math.abs(t),Math.abs(o))&&Math.abs(i-s)<=ie*Math.max(1,Math.abs(i),Math.abs(s))&&Math.abs(n-l)<=ie*Math.max(1,Math.abs(n),Math.abs(l))&&Math.abs(a-c)<=ie*Math.max(1,Math.abs(a),Math.abs(c))}u(nP,"equals");function aP(r,e,t){return r[0]=e[0]*t,r[1]=e[1]*t,r[2]=e[2]*t,r[3]=e[3]*t,r}u(aP,"multiplyScalar");function oP(r,e,t,i){return r[0]=e[0]+t[0]*i,r[1]=e[1]+t[1]*i,r[2]=e[2]+t[2]*i,r[3]=e[3]+t[3]*i,r}u(oP,"multiplyScalarAndAdd");var sP=Rx,lP=Ox;var Aa={};_i(Aa,{add:()=>LP,adjoint:()=>xP,clone:()=>pP,copy:()=>hP,create:()=>uP,determinant:()=>bP,equals:()=>BP,exactEquals:()=>FP,frob:()=>kP,fromMat2d:()=>AP,fromMat4:()=>cP,fromQuat:()=>IP,fromRotation:()=>PP,fromScaling:()=>TP,fromTranslation:()=>SP,fromValues:()=>fP,identity:()=>dP,invert:()=>gP,mul:()=>RP,multiply:()=>Vx,multiplyScalar:()=>DP,multiplyScalarAndAdd:()=>zP,normalFromMat4:()=>MP,projection:()=>CP,rotate:()=>vP,scale:()=>wP,set:()=>mP,str:()=>EP,sub:()=>OP,subtract:()=>Ux,translate:()=>_P,transpose:()=>yP});d();function uP(){var r=new we(9);return we!=Float32Array&&(r[1]=0,r[2]=0,r[3]=0,r[5]=0,r[6]=0,r[7]=0),r[0]=1,r[4]=1,r[8]=1,r}u(uP,"create");function cP(r,e){return r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[4],r[4]=e[5],r[5]=e[6],r[6]=e[8],r[7]=e[9],r[8]=e[10],r}u(cP,"fromMat4");function pP(r){var e=new we(9);return e[0]=r[0],e[1]=r[1],e[2]=r[2],e[3]=r[3],e[4]=r[4],e[5]=r[5],e[6]=r[6],e[7]=r[7],e[8]=r[8],e}u(pP,"clone");function hP(r,e){return r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r[4]=e[4],r[5]=e[5],r[6]=e[6],r[7]=e[7],r[8]=e[8],r}u(hP,"copy");function fP(r,e,t,i,n,a,o,s,l){var c=new we(9);return c[0]=r,c[1]=e,c[2]=t,c[3]=i,c[4]=n,c[5]=a,c[6]=o,c[7]=s,c[8]=l,c}u(fP,"fromValues");function mP(r,e,t,i,n,a,o,s,l,c){return r[0]=e,r[1]=t,r[2]=i,r[3]=n,r[4]=a,r[5]=o,r[6]=s,r[7]=l,r[8]=c,r}u(mP,"set");function dP(r){return r[0]=1,r[1]=0,r[2]=0,r[3]=0,r[4]=1,r[5]=0,r[6]=0,r[7]=0,r[8]=1,r}u(dP,"identity");function yP(r,e){if(r===e){var t=e[1],i=e[2],n=e[5];r[1]=e[3],r[2]=e[6],r[3]=t,r[5]=e[7],r[6]=i,r[7]=n}else r[0]=e[0],r[1]=e[3],r[2]=e[6],r[3]=e[1],r[4]=e[4],r[5]=e[7],r[6]=e[2],r[7]=e[5],r[8]=e[8];return r}u(yP,"transpose");function gP(r,e){var t=e[0],i=e[1],n=e[2],a=e[3],o=e[4],s=e[5],l=e[6],c=e[7],p=e[8],h=p*o-s*c,f=-p*a+s*l,m=c*a-o*l,g=t*h+i*f+n*m;return g?(g=1/g,r[0]=h*g,r[1]=(-p*i+n*c)*g,r[2]=(s*i-n*o)*g,r[3]=f*g,r[4]=(p*t-n*l)*g,r[5]=(-s*t+n*a)*g,r[6]=m*g,r[7]=(-c*t+i*l)*g,r[8]=(o*t-i*a)*g,r):null}u(gP,"invert");function xP(r,e){var t=e[0],i=e[1],n=e[2],a=e[3],o=e[4],s=e[5],l=e[6],c=e[7],p=e[8];return r[0]=o*p-s*c,r[1]=n*c-i*p,r[2]=i*s-n*o,r[3]=s*l-a*p,r[4]=t*p-n*l,r[5]=n*a-t*s,r[6]=a*c-o*l,r[7]=i*l-t*c,r[8]=t*o-i*a,r}u(xP,"adjoint");function bP(r){var e=r[0],t=r[1],i=r[2],n=r[3],a=r[4],o=r[5],s=r[6],l=r[7],c=r[8];return e*(c*a-o*l)+t*(-c*n+o*s)+i*(l*n-a*s)}u(bP,"determinant");function Vx(r,e,t){var i=e[0],n=e[1],a=e[2],o=e[3],s=e[4],l=e[5],c=e[6],p=e[7],h=e[8],f=t[0],m=t[1],g=t[2],y=t[3],x=t[4],b=t[5],_=t[6],v=t[7],S=t[8];return r[0]=f*i+m*o+g*c,r[1]=f*n+m*s+g*p,r[2]=f*a+m*l+g*h,r[3]=y*i+x*o+b*c,r[4]=y*n+x*s+b*p,r[5]=y*a+x*l+b*h,r[6]=_*i+v*o+S*c,r[7]=_*n+v*s+S*p,r[8]=_*a+v*l+S*h,r}u(Vx,"multiply");function _P(r,e,t){var i=e[0],n=e[1],a=e[2],o=e[3],s=e[4],l=e[5],c=e[6],p=e[7],h=e[8],f=t[0],m=t[1];return r[0]=i,r[1]=n,r[2]=a,r[3]=o,r[4]=s,r[5]=l,r[6]=f*i+m*o+c,r[7]=f*n+m*s+p,r[8]=f*a+m*l+h,r}u(_P,"translate");function vP(r,e,t){var i=e[0],n=e[1],a=e[2],o=e[3],s=e[4],l=e[5],c=e[6],p=e[7],h=e[8],f=Math.sin(t),m=Math.cos(t);return r[0]=m*i+f*o,r[1]=m*n+f*s,r[2]=m*a+f*l,r[3]=m*o-f*i,r[4]=m*s-f*n,r[5]=m*l-f*a,r[6]=c,r[7]=p,r[8]=h,r}u(vP,"rotate");function wP(r,e,t){var i=t[0],n=t[1];return r[0]=i*e[0],r[1]=i*e[1],r[2]=i*e[2],r[3]=n*e[3],r[4]=n*e[4],r[5]=n*e[5],r[6]=e[6],r[7]=e[7],r[8]=e[8],r}u(wP,"scale");function SP(r,e){return r[0]=1,r[1]=0,r[2]=0,r[3]=0,r[4]=1,r[5]=0,r[6]=e[0],r[7]=e[1],r[8]=1,r}u(SP,"fromTranslation");function PP(r,e){var t=Math.sin(e),i=Math.cos(e);return r[0]=i,r[1]=t,r[2]=0,r[3]=-t,r[4]=i,r[5]=0,r[6]=0,r[7]=0,r[8]=1,r}u(PP,"fromRotation");function TP(r,e){return r[0]=e[0],r[1]=0,r[2]=0,r[3]=0,r[4]=e[1],r[5]=0,r[6]=0,r[7]=0,r[8]=1,r}u(TP,"fromScaling");function AP(r,e){return r[0]=e[0],r[1]=e[1],r[2]=0,r[3]=e[2],r[4]=e[3],r[5]=0,r[6]=e[4],r[7]=e[5],r[8]=1,r}u(AP,"fromMat2d");function IP(r,e){var t=e[0],i=e[1],n=e[2],a=e[3],o=t+t,s=i+i,l=n+n,c=t*o,p=i*o,h=i*s,f=n*o,m=n*s,g=n*l,y=a*o,x=a*s,b=a*l;return r[0]=1-h-g,r[3]=p-b,r[6]=f+x,r[1]=p+b,r[4]=1-c-g,r[7]=m-y,r[2]=f-x,r[5]=m+y,r[8]=1-c-h,r}u(IP,"fromQuat");function MP(r,e){var t=e[0],i=e[1],n=e[2],a=e[3],o=e[4],s=e[5],l=e[6],c=e[7],p=e[8],h=e[9],f=e[10],m=e[11],g=e[12],y=e[13],x=e[14],b=e[15],_=t*s-i*o,v=t*l-n*o,S=t*c-a*o,P=i*l-n*s,T=i*c-a*s,A=n*c-a*l,L=p*y-h*g,C=p*x-f*g,I=p*b-m*g,D=h*x-f*y,F=h*b-m*y,k=f*b-m*x,E=_*k-v*F+S*D+P*I-T*C+A*L;return E?(E=1/E,r[0]=(s*k-l*F+c*D)*E,r[1]=(l*I-o*k-c*C)*E,r[2]=(o*F-s*I+c*L)*E,r[3]=(n*F-i*k-a*D)*E,r[4]=(t*k-n*I+a*C)*E,r[5]=(i*I-t*F-a*L)*E,r[6]=(y*A-x*T+b*P)*E,r[7]=(x*S-g*A-b*v)*E,r[8]=(g*T-y*S+b*_)*E,r):null}u(MP,"normalFromMat4");function CP(r,e,t){return r[0]=2/e,r[1]=0,r[2]=0,r[3]=0,r[4]=-2/t,r[5]=0,r[6]=-1,r[7]=1,r[8]=1,r}u(CP,"projection");function EP(r){return"mat3("+r[0]+", "+r[1]+", "+r[2]+", "+r[3]+", "+r[4]+", "+r[5]+", "+r[6]+", "+r[7]+", "+r[8]+")"}u(EP,"str");function kP(r){return Math.hypot(r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8])}u(kP,"frob");function LP(r,e,t){return r[0]=e[0]+t[0],r[1]=e[1]+t[1],r[2]=e[2]+t[2],r[3]=e[3]+t[3],r[4]=e[4]+t[4],r[5]=e[5]+t[5],r[6]=e[6]+t[6],r[7]=e[7]+t[7],r[8]=e[8]+t[8],r}u(LP,"add");function Ux(r,e,t){return r[0]=e[0]-t[0],r[1]=e[1]-t[1],r[2]=e[2]-t[2],r[3]=e[3]-t[3],r[4]=e[4]-t[4],r[5]=e[5]-t[5],r[6]=e[6]-t[6],r[7]=e[7]-t[7],r[8]=e[8]-t[8],r}u(Ux,"subtract");function DP(r,e,t){return r[0]=e[0]*t,r[1]=e[1]*t,r[2]=e[2]*t,r[3]=e[3]*t,r[4]=e[4]*t,r[5]=e[5]*t,r[6]=e[6]*t,r[7]=e[7]*t,r[8]=e[8]*t,r}u(DP,"multiplyScalar");function zP(r,e,t,i){return r[0]=e[0]+t[0]*i,r[1]=e[1]+t[1]*i,r[2]=e[2]+t[2]*i,r[3]=e[3]+t[3]*i,r[4]=e[4]+t[4]*i,r[5]=e[5]+t[5]*i,r[6]=e[6]+t[6]*i,r[7]=e[7]+t[7]*i,r[8]=e[8]+t[8]*i,r}u(zP,"multiplyScalarAndAdd");function FP(r,e){return r[0]===e[0]&&r[1]===e[1]&&r[2]===e[2]&&r[3]===e[3]&&r[4]===e[4]&&r[5]===e[5]&&r[6]===e[6]&&r[7]===e[7]&&r[8]===e[8]}u(FP,"exactEquals");function BP(r,e){var t=r[0],i=r[1],n=r[2],a=r[3],o=r[4],s=r[5],l=r[6],c=r[7],p=r[8],h=e[0],f=e[1],m=e[2],g=e[3],y=e[4],x=e[5],b=e[6],_=e[7],v=e[8];return Math.abs(t-h)<=ie*Math.max(1,Math.abs(t),Math.abs(h))&&Math.abs(i-f)<=ie*Math.max(1,Math.abs(i),Math.abs(f))&&Math.abs(n-m)<=ie*Math.max(1,Math.abs(n),Math.abs(m))&&Math.abs(a-g)<=ie*Math.max(1,Math.abs(a),Math.abs(g))&&Math.abs(o-y)<=ie*Math.max(1,Math.abs(o),Math.abs(y))&&Math.abs(s-x)<=ie*Math.max(1,Math.abs(s),Math.abs(x))&&Math.abs(l-b)<=ie*Math.max(1,Math.abs(l),Math.abs(b))&&Math.abs(c-_)<=ie*Math.max(1,Math.abs(c),Math.abs(_))&&Math.abs(p-v)<=ie*Math.max(1,Math.abs(p),Math.abs(v))}u(BP,"equals");var RP=Vx,OP=Ux;var q={};_i(q,{add:()=>wT,adjoint:()=>HP,clone:()=>UP,copy:()=>NP,create:()=>VP,determinant:()=>ZP,equals:()=>AT,exactEquals:()=>TT,frob:()=>vT,fromQuat:()=>pT,fromQuat2:()=>oT,fromRotation:()=>rT,fromRotationTranslation:()=>qx,fromRotationTranslationScale:()=>uT,fromRotationTranslationScaleOrigin:()=>cT,fromScaling:()=>tT,fromTranslation:()=>eT,fromValues:()=>GP,fromXRotation:()=>iT,fromYRotation:()=>nT,fromZRotation:()=>aT,frustum:()=>hT,getRotation:()=>lT,getScaling:()=>jx,getTranslation:()=>sT,identity:()=>Nx,invert:()=>$P,lookAt:()=>xT,mul:()=>IT,multiply:()=>Gx,multiplyScalar:()=>ST,multiplyScalarAndAdd:()=>PT,ortho:()=>yT,orthoNO:()=>Hx,orthoZO:()=>gT,perspective:()=>fT,perspectiveFromFieldOfView:()=>dT,perspectiveNO:()=>$x,perspectiveZO:()=>mT,rotate:()=>KP,rotateX:()=>YP,rotateY:()=>JP,rotateZ:()=>QP,scale:()=>XP,set:()=>qP,str:()=>_T,sub:()=>MT,subtract:()=>Zx,targetTo:()=>bT,translate:()=>WP,transpose:()=>jP});d();function VP(){var r=new we(16);return we!=Float32Array&&(r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[11]=0,r[12]=0,r[13]=0,r[14]=0),r[0]=1,r[5]=1,r[10]=1,r[15]=1,r}u(VP,"create");function UP(r){var e=new we(16);return e[0]=r[0],e[1]=r[1],e[2]=r[2],e[3]=r[3],e[4]=r[4],e[5]=r[5],e[6]=r[6],e[7]=r[7],e[8]=r[8],e[9]=r[9],e[10]=r[10],e[11]=r[11],e[12]=r[12],e[13]=r[13],e[14]=r[14],e[15]=r[15],e}u(UP,"clone");function NP(r,e){return r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r[4]=e[4],r[5]=e[5],r[6]=e[6],r[7]=e[7],r[8]=e[8],r[9]=e[9],r[10]=e[10],r[11]=e[11],r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15],r}u(NP,"copy");function GP(r,e,t,i,n,a,o,s,l,c,p,h,f,m,g,y){var x=new we(16);return x[0]=r,x[1]=e,x[2]=t,x[3]=i,x[4]=n,x[5]=a,x[6]=o,x[7]=s,x[8]=l,x[9]=c,x[10]=p,x[11]=h,x[12]=f,x[13]=m,x[14]=g,x[15]=y,x}u(GP,"fromValues");function qP(r,e,t,i,n,a,o,s,l,c,p,h,f,m,g,y,x){return r[0]=e,r[1]=t,r[2]=i,r[3]=n,r[4]=a,r[5]=o,r[6]=s,r[7]=l,r[8]=c,r[9]=p,r[10]=h,r[11]=f,r[12]=m,r[13]=g,r[14]=y,r[15]=x,r}u(qP,"set");function Nx(r){return r[0]=1,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=1,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=1,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r}u(Nx,"identity");function jP(r,e){if(r===e){var t=e[1],i=e[2],n=e[3],a=e[6],o=e[7],s=e[11];r[1]=e[4],r[2]=e[8],r[3]=e[12],r[4]=t,r[6]=e[9],r[7]=e[13],r[8]=i,r[9]=a,r[11]=e[14],r[12]=n,r[13]=o,r[14]=s}else r[0]=e[0],r[1]=e[4],r[2]=e[8],r[3]=e[12],r[4]=e[1],r[5]=e[5],r[6]=e[9],r[7]=e[13],r[8]=e[2],r[9]=e[6],r[10]=e[10],r[11]=e[14],r[12]=e[3],r[13]=e[7],r[14]=e[11],r[15]=e[15];return r}u(jP,"transpose");function $P(r,e){var t=e[0],i=e[1],n=e[2],a=e[3],o=e[4],s=e[5],l=e[6],c=e[7],p=e[8],h=e[9],f=e[10],m=e[11],g=e[12],y=e[13],x=e[14],b=e[15],_=t*s-i*o,v=t*l-n*o,S=t*c-a*o,P=i*l-n*s,T=i*c-a*s,A=n*c-a*l,L=p*y-h*g,C=p*x-f*g,I=p*b-m*g,D=h*x-f*y,F=h*b-m*y,k=f*b-m*x,E=_*k-v*F+S*D+P*I-T*C+A*L;return E?(E=1/E,r[0]=(s*k-l*F+c*D)*E,r[1]=(n*F-i*k-a*D)*E,r[2]=(y*A-x*T+b*P)*E,r[3]=(f*T-h*A-m*P)*E,r[4]=(l*I-o*k-c*C)*E,r[5]=(t*k-n*I+a*C)*E,r[6]=(x*S-g*A-b*v)*E,r[7]=(p*A-f*S+m*v)*E,r[8]=(o*F-s*I+c*L)*E,r[9]=(i*I-t*F-a*L)*E,r[10]=(g*T-y*S+b*_)*E,r[11]=(h*S-p*T-m*_)*E,r[12]=(s*C-o*D-l*L)*E,r[13]=(t*D-i*C+n*L)*E,r[14]=(y*v-g*P-x*_)*E,r[15]=(p*P-h*v+f*_)*E,r):null}u($P,"invert");function HP(r,e){var t=e[0],i=e[1],n=e[2],a=e[3],o=e[4],s=e[5],l=e[6],c=e[7],p=e[8],h=e[9],f=e[10],m=e[11],g=e[12],y=e[13],x=e[14],b=e[15];return r[0]=s*(f*b-m*x)-h*(l*b-c*x)+y*(l*m-c*f),r[1]=-(i*(f*b-m*x)-h*(n*b-a*x)+y*(n*m-a*f)),r[2]=i*(l*b-c*x)-s*(n*b-a*x)+y*(n*c-a*l),r[3]=-(i*(l*m-c*f)-s*(n*m-a*f)+h*(n*c-a*l)),r[4]=-(o*(f*b-m*x)-p*(l*b-c*x)+g*(l*m-c*f)),r[5]=t*(f*b-m*x)-p*(n*b-a*x)+g*(n*m-a*f),r[6]=-(t*(l*b-c*x)-o*(n*b-a*x)+g*(n*c-a*l)),r[7]=t*(l*m-c*f)-o*(n*m-a*f)+p*(n*c-a*l),r[8]=o*(h*b-m*y)-p*(s*b-c*y)+g*(s*m-c*h),r[9]=-(t*(h*b-m*y)-p*(i*b-a*y)+g*(i*m-a*h)),r[10]=t*(s*b-c*y)-o*(i*b-a*y)+g*(i*c-a*s),r[11]=-(t*(s*m-c*h)-o*(i*m-a*h)+p*(i*c-a*s)),r[12]=-(o*(h*x-f*y)-p*(s*x-l*y)+g*(s*f-l*h)),r[13]=t*(h*x-f*y)-p*(i*x-n*y)+g*(i*f-n*h),r[14]=-(t*(s*x-l*y)-o*(i*x-n*y)+g*(i*l-n*s)),r[15]=t*(s*f-l*h)-o*(i*f-n*h)+p*(i*l-n*s),r}u(HP,"adjoint");function ZP(r){var e=r[0],t=r[1],i=r[2],n=r[3],a=r[4],o=r[5],s=r[6],l=r[7],c=r[8],p=r[9],h=r[10],f=r[11],m=r[12],g=r[13],y=r[14],x=r[15],b=e*o-t*a,_=e*s-i*a,v=e*l-n*a,S=t*s-i*o,P=t*l-n*o,T=i*l-n*s,A=c*g-p*m,L=c*y-h*m,C=c*x-f*m,I=p*y-h*g,D=p*x-f*g,F=h*x-f*y;return b*F-_*D+v*I+S*C-P*L+T*A}u(ZP,"determinant");function Gx(r,e,t){var i=e[0],n=e[1],a=e[2],o=e[3],s=e[4],l=e[5],c=e[6],p=e[7],h=e[8],f=e[9],m=e[10],g=e[11],y=e[12],x=e[13],b=e[14],_=e[15],v=t[0],S=t[1],P=t[2],T=t[3];return r[0]=v*i+S*s+P*h+T*y,r[1]=v*n+S*l+P*f+T*x,r[2]=v*a+S*c+P*m+T*b,r[3]=v*o+S*p+P*g+T*_,v=t[4],S=t[5],P=t[6],T=t[7],r[4]=v*i+S*s+P*h+T*y,r[5]=v*n+S*l+P*f+T*x,r[6]=v*a+S*c+P*m+T*b,r[7]=v*o+S*p+P*g+T*_,v=t[8],S=t[9],P=t[10],T=t[11],r[8]=v*i+S*s+P*h+T*y,r[9]=v*n+S*l+P*f+T*x,r[10]=v*a+S*c+P*m+T*b,r[11]=v*o+S*p+P*g+T*_,v=t[12],S=t[13],P=t[14],T=t[15],r[12]=v*i+S*s+P*h+T*y,r[13]=v*n+S*l+P*f+T*x,r[14]=v*a+S*c+P*m+T*b,r[15]=v*o+S*p+P*g+T*_,r}u(Gx,"multiply");function WP(r,e,t){var i=t[0],n=t[1],a=t[2],o,s,l,c,p,h,f,m,g,y,x,b;return e===r?(r[12]=e[0]*i+e[4]*n+e[8]*a+e[12],r[13]=e[1]*i+e[5]*n+e[9]*a+e[13],r[14]=e[2]*i+e[6]*n+e[10]*a+e[14],r[15]=e[3]*i+e[7]*n+e[11]*a+e[15]):(o=e[0],s=e[1],l=e[2],c=e[3],p=e[4],h=e[5],f=e[6],m=e[7],g=e[8],y=e[9],x=e[10],b=e[11],r[0]=o,r[1]=s,r[2]=l,r[3]=c,r[4]=p,r[5]=h,r[6]=f,r[7]=m,r[8]=g,r[9]=y,r[10]=x,r[11]=b,r[12]=o*i+p*n+g*a+e[12],r[13]=s*i+h*n+y*a+e[13],r[14]=l*i+f*n+x*a+e[14],r[15]=c*i+m*n+b*a+e[15]),r}u(WP,"translate");function XP(r,e,t){var i=t[0],n=t[1],a=t[2];return r[0]=e[0]*i,r[1]=e[1]*i,r[2]=e[2]*i,r[3]=e[3]*i,r[4]=e[4]*n,r[5]=e[5]*n,r[6]=e[6]*n,r[7]=e[7]*n,r[8]=e[8]*a,r[9]=e[9]*a,r[10]=e[10]*a,r[11]=e[11]*a,r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15],r}u(XP,"scale");function KP(r,e,t,i){var n=i[0],a=i[1],o=i[2],s=Math.hypot(n,a,o),l,c,p,h,f,m,g,y,x,b,_,v,S,P,T,A,L,C,I,D,F,k,E,O;return s<ie?null:(s=1/s,n*=s,a*=s,o*=s,l=Math.sin(t),c=Math.cos(t),p=1-c,h=e[0],f=e[1],m=e[2],g=e[3],y=e[4],x=e[5],b=e[6],_=e[7],v=e[8],S=e[9],P=e[10],T=e[11],A=n*n*p+c,L=a*n*p+o*l,C=o*n*p-a*l,I=n*a*p-o*l,D=a*a*p+c,F=o*a*p+n*l,k=n*o*p+a*l,E=a*o*p-n*l,O=o*o*p+c,r[0]=h*A+y*L+v*C,r[1]=f*A+x*L+S*C,r[2]=m*A+b*L+P*C,r[3]=g*A+_*L+T*C,r[4]=h*I+y*D+v*F,r[5]=f*I+x*D+S*F,r[6]=m*I+b*D+P*F,r[7]=g*I+_*D+T*F,r[8]=h*k+y*E+v*O,r[9]=f*k+x*E+S*O,r[10]=m*k+b*E+P*O,r[11]=g*k+_*E+T*O,e!==r&&(r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15]),r)}u(KP,"rotate");function YP(r,e,t){var i=Math.sin(t),n=Math.cos(t),a=e[4],o=e[5],s=e[6],l=e[7],c=e[8],p=e[9],h=e[10],f=e[11];return e!==r&&(r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15]),r[4]=a*n+c*i,r[5]=o*n+p*i,r[6]=s*n+h*i,r[7]=l*n+f*i,r[8]=c*n-a*i,r[9]=p*n-o*i,r[10]=h*n-s*i,r[11]=f*n-l*i,r}u(YP,"rotateX");function JP(r,e,t){var i=Math.sin(t),n=Math.cos(t),a=e[0],o=e[1],s=e[2],l=e[3],c=e[8],p=e[9],h=e[10],f=e[11];return e!==r&&(r[4]=e[4],r[5]=e[5],r[6]=e[6],r[7]=e[7],r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15]),r[0]=a*n-c*i,r[1]=o*n-p*i,r[2]=s*n-h*i,r[3]=l*n-f*i,r[8]=a*i+c*n,r[9]=o*i+p*n,r[10]=s*i+h*n,r[11]=l*i+f*n,r}u(JP,"rotateY");function QP(r,e,t){var i=Math.sin(t),n=Math.cos(t),a=e[0],o=e[1],s=e[2],l=e[3],c=e[4],p=e[5],h=e[6],f=e[7];return e!==r&&(r[8]=e[8],r[9]=e[9],r[10]=e[10],r[11]=e[11],r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15]),r[0]=a*n+c*i,r[1]=o*n+p*i,r[2]=s*n+h*i,r[3]=l*n+f*i,r[4]=c*n-a*i,r[5]=p*n-o*i,r[6]=h*n-s*i,r[7]=f*n-l*i,r}u(QP,"rotateZ");function eT(r,e){return r[0]=1,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=1,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=1,r[11]=0,r[12]=e[0],r[13]=e[1],r[14]=e[2],r[15]=1,r}u(eT,"fromTranslation");function tT(r,e){return r[0]=e[0],r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=e[1],r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=e[2],r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r}u(tT,"fromScaling");function rT(r,e,t){var i=t[0],n=t[1],a=t[2],o=Math.hypot(i,n,a),s,l,c;return o<ie?null:(o=1/o,i*=o,n*=o,a*=o,s=Math.sin(e),l=Math.cos(e),c=1-l,r[0]=i*i*c+l,r[1]=n*i*c+a*s,r[2]=a*i*c-n*s,r[3]=0,r[4]=i*n*c-a*s,r[5]=n*n*c+l,r[6]=a*n*c+i*s,r[7]=0,r[8]=i*a*c+n*s,r[9]=n*a*c-i*s,r[10]=a*a*c+l,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r)}u(rT,"fromRotation");function iT(r,e){var t=Math.sin(e),i=Math.cos(e);return r[0]=1,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=i,r[6]=t,r[7]=0,r[8]=0,r[9]=-t,r[10]=i,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r}u(iT,"fromXRotation");function nT(r,e){var t=Math.sin(e),i=Math.cos(e);return r[0]=i,r[1]=0,r[2]=-t,r[3]=0,r[4]=0,r[5]=1,r[6]=0,r[7]=0,r[8]=t,r[9]=0,r[10]=i,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r}u(nT,"fromYRotation");function aT(r,e){var t=Math.sin(e),i=Math.cos(e);return r[0]=i,r[1]=t,r[2]=0,r[3]=0,r[4]=-t,r[5]=i,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=1,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r}u(aT,"fromZRotation");function qx(r,e,t){var i=e[0],n=e[1],a=e[2],o=e[3],s=i+i,l=n+n,c=a+a,p=i*s,h=i*l,f=i*c,m=n*l,g=n*c,y=a*c,x=o*s,b=o*l,_=o*c;return r[0]=1-(m+y),r[1]=h+_,r[2]=f-b,r[3]=0,r[4]=h-_,r[5]=1-(p+y),r[6]=g+x,r[7]=0,r[8]=f+b,r[9]=g-x,r[10]=1-(p+m),r[11]=0,r[12]=t[0],r[13]=t[1],r[14]=t[2],r[15]=1,r}u(qx,"fromRotationTranslation");function oT(r,e){var t=new we(3),i=-e[0],n=-e[1],a=-e[2],o=e[3],s=e[4],l=e[5],c=e[6],p=e[7],h=i*i+n*n+a*a+o*o;return h>0?(t[0]=(s*o+p*i+l*a-c*n)*2/h,t[1]=(l*o+p*n+c*i-s*a)*2/h,t[2]=(c*o+p*a+s*n-l*i)*2/h):(t[0]=(s*o+p*i+l*a-c*n)*2,t[1]=(l*o+p*n+c*i-s*a)*2,t[2]=(c*o+p*a+s*n-l*i)*2),qx(r,e,t),r}u(oT,"fromQuat2");function sT(r,e){return r[0]=e[12],r[1]=e[13],r[2]=e[14],r}u(sT,"getTranslation");function jx(r,e){var t=e[0],i=e[1],n=e[2],a=e[4],o=e[5],s=e[6],l=e[8],c=e[9],p=e[10];return r[0]=Math.hypot(t,i,n),r[1]=Math.hypot(a,o,s),r[2]=Math.hypot(l,c,p),r}u(jx,"getScaling");function lT(r,e){var t=new we(3);jx(t,e);var i=1/t[0],n=1/t[1],a=1/t[2],o=e[0]*i,s=e[1]*n,l=e[2]*a,c=e[4]*i,p=e[5]*n,h=e[6]*a,f=e[8]*i,m=e[9]*n,g=e[10]*a,y=o+p+g,x=0;return y>0?(x=Math.sqrt(y+1)*2,r[3]=.25*x,r[0]=(h-m)/x,r[1]=(f-l)/x,r[2]=(s-c)/x):o>p&&o>g?(x=Math.sqrt(1+o-p-g)*2,r[3]=(h-m)/x,r[0]=.25*x,r[1]=(s+c)/x,r[2]=(f+l)/x):p>g?(x=Math.sqrt(1+p-o-g)*2,r[3]=(f-l)/x,r[0]=(s+c)/x,r[1]=.25*x,r[2]=(h+m)/x):(x=Math.sqrt(1+g-o-p)*2,r[3]=(s-c)/x,r[0]=(f+l)/x,r[1]=(h+m)/x,r[2]=.25*x),r}u(lT,"getRotation");function uT(r,e,t,i){var n=e[0],a=e[1],o=e[2],s=e[3],l=n+n,c=a+a,p=o+o,h=n*l,f=n*c,m=n*p,g=a*c,y=a*p,x=o*p,b=s*l,_=s*c,v=s*p,S=i[0],P=i[1],T=i[2];return r[0]=(1-(g+x))*S,r[1]=(f+v)*S,r[2]=(m-_)*S,r[3]=0,r[4]=(f-v)*P,r[5]=(1-(h+x))*P,r[6]=(y+b)*P,r[7]=0,r[8]=(m+_)*T,r[9]=(y-b)*T,r[10]=(1-(h+g))*T,r[11]=0,r[12]=t[0],r[13]=t[1],r[14]=t[2],r[15]=1,r}u(uT,"fromRotationTranslationScale");function cT(r,e,t,i,n){var a=e[0],o=e[1],s=e[2],l=e[3],c=a+a,p=o+o,h=s+s,f=a*c,m=a*p,g=a*h,y=o*p,x=o*h,b=s*h,_=l*c,v=l*p,S=l*h,P=i[0],T=i[1],A=i[2],L=n[0],C=n[1],I=n[2],D=(1-(y+b))*P,F=(m+S)*P,k=(g-v)*P,E=(m-S)*T,O=(1-(f+b))*T,X=(x+_)*T,H=(g+v)*A,fe=(x-_)*A,J=(1-(f+y))*A;return r[0]=D,r[1]=F,r[2]=k,r[3]=0,r[4]=E,r[5]=O,r[6]=X,r[7]=0,r[8]=H,r[9]=fe,r[10]=J,r[11]=0,r[12]=t[0]+L-(D*L+E*C+H*I),r[13]=t[1]+C-(F*L+O*C+fe*I),r[14]=t[2]+I-(k*L+X*C+J*I),r[15]=1,r}u(cT,"fromRotationTranslationScaleOrigin");function pT(r,e){var t=e[0],i=e[1],n=e[2],a=e[3],o=t+t,s=i+i,l=n+n,c=t*o,p=i*o,h=i*s,f=n*o,m=n*s,g=n*l,y=a*o,x=a*s,b=a*l;return r[0]=1-h-g,r[1]=p+b,r[2]=f-x,r[3]=0,r[4]=p-b,r[5]=1-c-g,r[6]=m+y,r[7]=0,r[8]=f+x,r[9]=m-y,r[10]=1-c-h,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r}u(pT,"fromQuat");function hT(r,e,t,i,n,a,o){var s=1/(t-e),l=1/(n-i),c=1/(a-o);return r[0]=a*2*s,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=a*2*l,r[6]=0,r[7]=0,r[8]=(t+e)*s,r[9]=(n+i)*l,r[10]=(o+a)*c,r[11]=-1,r[12]=0,r[13]=0,r[14]=o*a*2*c,r[15]=0,r}u(hT,"frustum");function $x(r,e,t,i,n){var a=1/Math.tan(e/2),o;return r[0]=a/t,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=a,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[11]=-1,r[12]=0,r[13]=0,r[15]=0,n!=null&&n!==1/0?(o=1/(i-n),r[10]=(n+i)*o,r[14]=2*n*i*o):(r[10]=-1,r[14]=-2*i),r}u($x,"perspectiveNO");var fT=$x;function mT(r,e,t,i,n){var a=1/Math.tan(e/2),o;return r[0]=a/t,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=a,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[11]=-1,r[12]=0,r[13]=0,r[15]=0,n!=null&&n!==1/0?(o=1/(i-n),r[10]=n*o,r[14]=n*i*o):(r[10]=-1,r[14]=-i),r}u(mT,"perspectiveZO");function dT(r,e,t,i){var n=Math.tan(e.upDegrees*Math.PI/180),a=Math.tan(e.downDegrees*Math.PI/180),o=Math.tan(e.leftDegrees*Math.PI/180),s=Math.tan(e.rightDegrees*Math.PI/180),l=2/(o+s),c=2/(n+a);return r[0]=l,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=c,r[6]=0,r[7]=0,r[8]=-((o-s)*l*.5),r[9]=(n-a)*c*.5,r[10]=i/(t-i),r[11]=-1,r[12]=0,r[13]=0,r[14]=i*t/(t-i),r[15]=0,r}u(dT,"perspectiveFromFieldOfView");function Hx(r,e,t,i,n,a,o){var s=1/(e-t),l=1/(i-n),c=1/(a-o);return r[0]=-2*s,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=-2*l,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=2*c,r[11]=0,r[12]=(e+t)*s,r[13]=(n+i)*l,r[14]=(o+a)*c,r[15]=1,r}u(Hx,"orthoNO");var yT=Hx;function gT(r,e,t,i,n,a,o){var s=1/(e-t),l=1/(i-n),c=1/(a-o);return r[0]=-2*s,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=-2*l,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=c,r[11]=0,r[12]=(e+t)*s,r[13]=(n+i)*l,r[14]=a*c,r[15]=1,r}u(gT,"orthoZO");function xT(r,e,t,i){var n,a,o,s,l,c,p,h,f,m,g=e[0],y=e[1],x=e[2],b=i[0],_=i[1],v=i[2],S=t[0],P=t[1],T=t[2];return Math.abs(g-S)<ie&&Math.abs(y-P)<ie&&Math.abs(x-T)<ie?Nx(r):(p=g-S,h=y-P,f=x-T,m=1/Math.hypot(p,h,f),p*=m,h*=m,f*=m,n=_*f-v*h,a=v*p-b*f,o=b*h-_*p,m=Math.hypot(n,a,o),m?(m=1/m,n*=m,a*=m,o*=m):(n=0,a=0,o=0),s=h*o-f*a,l=f*n-p*o,c=p*a-h*n,m=Math.hypot(s,l,c),m?(m=1/m,s*=m,l*=m,c*=m):(s=0,l=0,c=0),r[0]=n,r[1]=s,r[2]=p,r[3]=0,r[4]=a,r[5]=l,r[6]=h,r[7]=0,r[8]=o,r[9]=c,r[10]=f,r[11]=0,r[12]=-(n*g+a*y+o*x),r[13]=-(s*g+l*y+c*x),r[14]=-(p*g+h*y+f*x),r[15]=1,r)}u(xT,"lookAt");function bT(r,e,t,i){var n=e[0],a=e[1],o=e[2],s=i[0],l=i[1],c=i[2],p=n-t[0],h=a-t[1],f=o-t[2],m=p*p+h*h+f*f;m>0&&(m=1/Math.sqrt(m),p*=m,h*=m,f*=m);var g=l*f-c*h,y=c*p-s*f,x=s*h-l*p;return m=g*g+y*y+x*x,m>0&&(m=1/Math.sqrt(m),g*=m,y*=m,x*=m),r[0]=g,r[1]=y,r[2]=x,r[3]=0,r[4]=h*x-f*y,r[5]=f*g-p*x,r[6]=p*y-h*g,r[7]=0,r[8]=p,r[9]=h,r[10]=f,r[11]=0,r[12]=n,r[13]=a,r[14]=o,r[15]=1,r}u(bT,"targetTo");function _T(r){return"mat4("+r[0]+", "+r[1]+", "+r[2]+", "+r[3]+", "+r[4]+", "+r[5]+", "+r[6]+", "+r[7]+", "+r[8]+", "+r[9]+", "+r[10]+", "+r[11]+", "+r[12]+", "+r[13]+", "+r[14]+", "+r[15]+")"}u(_T,"str");function vT(r){return Math.hypot(r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],r[9],r[10],r[11],r[12],r[13],r[14],r[15])}u(vT,"frob");function wT(r,e,t){return r[0]=e[0]+t[0],r[1]=e[1]+t[1],r[2]=e[2]+t[2],r[3]=e[3]+t[3],r[4]=e[4]+t[4],r[5]=e[5]+t[5],r[6]=e[6]+t[6],r[7]=e[7]+t[7],r[8]=e[8]+t[8],r[9]=e[9]+t[9],r[10]=e[10]+t[10],r[11]=e[11]+t[11],r[12]=e[12]+t[12],r[13]=e[13]+t[13],r[14]=e[14]+t[14],r[15]=e[15]+t[15],r}u(wT,"add");function Zx(r,e,t){return r[0]=e[0]-t[0],r[1]=e[1]-t[1],r[2]=e[2]-t[2],r[3]=e[3]-t[3],r[4]=e[4]-t[4],r[5]=e[5]-t[5],r[6]=e[6]-t[6],r[7]=e[7]-t[7],r[8]=e[8]-t[8],r[9]=e[9]-t[9],r[10]=e[10]-t[10],r[11]=e[11]-t[11],r[12]=e[12]-t[12],r[13]=e[13]-t[13],r[14]=e[14]-t[14],r[15]=e[15]-t[15],r}u(Zx,"subtract");function ST(r,e,t){return r[0]=e[0]*t,r[1]=e[1]*t,r[2]=e[2]*t,r[3]=e[3]*t,r[4]=e[4]*t,r[5]=e[5]*t,r[6]=e[6]*t,r[7]=e[7]*t,r[8]=e[8]*t,r[9]=e[9]*t,r[10]=e[10]*t,r[11]=e[11]*t,r[12]=e[12]*t,r[13]=e[13]*t,r[14]=e[14]*t,r[15]=e[15]*t,r}u(ST,"multiplyScalar");function PT(r,e,t,i){return r[0]=e[0]+t[0]*i,r[1]=e[1]+t[1]*i,r[2]=e[2]+t[2]*i,r[3]=e[3]+t[3]*i,r[4]=e[4]+t[4]*i,r[5]=e[5]+t[5]*i,r[6]=e[6]+t[6]*i,r[7]=e[7]+t[7]*i,r[8]=e[8]+t[8]*i,r[9]=e[9]+t[9]*i,r[10]=e[10]+t[10]*i,r[11]=e[11]+t[11]*i,r[12]=e[12]+t[12]*i,r[13]=e[13]+t[13]*i,r[14]=e[14]+t[14]*i,r[15]=e[15]+t[15]*i,r}u(PT,"multiplyScalarAndAdd");function TT(r,e){return r[0]===e[0]&&r[1]===e[1]&&r[2]===e[2]&&r[3]===e[3]&&r[4]===e[4]&&r[5]===e[5]&&r[6]===e[6]&&r[7]===e[7]&&r[8]===e[8]&&r[9]===e[9]&&r[10]===e[10]&&r[11]===e[11]&&r[12]===e[12]&&r[13]===e[13]&&r[14]===e[14]&&r[15]===e[15]}u(TT,"exactEquals");function AT(r,e){var t=r[0],i=r[1],n=r[2],a=r[3],o=r[4],s=r[5],l=r[6],c=r[7],p=r[8],h=r[9],f=r[10],m=r[11],g=r[12],y=r[13],x=r[14],b=r[15],_=e[0],v=e[1],S=e[2],P=e[3],T=e[4],A=e[5],L=e[6],C=e[7],I=e[8],D=e[9],F=e[10],k=e[11],E=e[12],O=e[13],X=e[14],H=e[15];return Math.abs(t-_)<=ie*Math.max(1,Math.abs(t),Math.abs(_))&&Math.abs(i-v)<=ie*Math.max(1,Math.abs(i),Math.abs(v))&&Math.abs(n-S)<=ie*Math.max(1,Math.abs(n),Math.abs(S))&&Math.abs(a-P)<=ie*Math.max(1,Math.abs(a),Math.abs(P))&&Math.abs(o-T)<=ie*Math.max(1,Math.abs(o),Math.abs(T))&&Math.abs(s-A)<=ie*Math.max(1,Math.abs(s),Math.abs(A))&&Math.abs(l-L)<=ie*Math.max(1,Math.abs(l),Math.abs(L))&&Math.abs(c-C)<=ie*Math.max(1,Math.abs(c),Math.abs(C))&&Math.abs(p-I)<=ie*Math.max(1,Math.abs(p),Math.abs(I))&&Math.abs(h-D)<=ie*Math.max(1,Math.abs(h),Math.abs(D))&&Math.abs(f-F)<=ie*Math.max(1,Math.abs(f),Math.abs(F))&&Math.abs(m-k)<=ie*Math.max(1,Math.abs(m),Math.abs(k))&&Math.abs(g-E)<=ie*Math.max(1,Math.abs(g),Math.abs(E))&&Math.abs(y-O)<=ie*Math.max(1,Math.abs(y),Math.abs(O))&&Math.abs(x-X)<=ie*Math.max(1,Math.abs(x),Math.abs(X))&&Math.abs(b-H)<=ie*Math.max(1,Math.abs(b),Math.abs(H))}u(AT,"equals");var IT=Gx,MT=Zx;var gt={};_i(gt,{add:()=>DT,angle:()=>tA,bezier:()=>ZT,ceil:()=>zT,clone:()=>CT,copy:()=>kT,create:()=>Wx,cross:()=>jT,dist:()=>uA,distance:()=>Qx,div:()=>lA,divide:()=>Jx,dot:()=>rb,equals:()=>aA,exactEquals:()=>nA,floor:()=>FT,forEach:()=>fA,fromValues:()=>ET,hermite:()=>HT,inverse:()=>GT,len:()=>pA,length:()=>Xx,lerp:()=>$T,max:()=>RT,min:()=>BT,mul:()=>sA,multiply:()=>Yx,negate:()=>NT,normalize:()=>qT,random:()=>WT,rotateX:()=>JT,rotateY:()=>QT,rotateZ:()=>eA,round:()=>OT,scale:()=>VT,scaleAndAdd:()=>UT,set:()=>LT,sqrDist:()=>cA,sqrLen:()=>hA,squaredDistance:()=>eb,squaredLength:()=>tb,str:()=>iA,sub:()=>oA,subtract:()=>Kx,transformMat3:()=>KT,transformMat4:()=>XT,transformQuat:()=>YT,zero:()=>rA});d();function Wx(){var r=new we(3);return we!=Float32Array&&(r[0]=0,r[1]=0,r[2]=0),r}u(Wx,"create");function CT(r){var e=new we(3);return e[0]=r[0],e[1]=r[1],e[2]=r[2],e}u(CT,"clone");function Xx(r){var e=r[0],t=r[1],i=r[2];return Math.hypot(e,t,i)}u(Xx,"length");function ET(r,e,t){var i=new we(3);return i[0]=r,i[1]=e,i[2]=t,i}u(ET,"fromValues");function kT(r,e){return r[0]=e[0],r[1]=e[1],r[2]=e[2],r}u(kT,"copy");function LT(r,e,t,i){return r[0]=e,r[1]=t,r[2]=i,r}u(LT,"set");function DT(r,e,t){return r[0]=e[0]+t[0],r[1]=e[1]+t[1],r[2]=e[2]+t[2],r}u(DT,"add");function Kx(r,e,t){return r[0]=e[0]-t[0],r[1]=e[1]-t[1],r[2]=e[2]-t[2],r}u(Kx,"subtract");function Yx(r,e,t){return r[0]=e[0]*t[0],r[1]=e[1]*t[1],r[2]=e[2]*t[2],r}u(Yx,"multiply");function Jx(r,e,t){return r[0]=e[0]/t[0],r[1]=e[1]/t[1],r[2]=e[2]/t[2],r}u(Jx,"divide");function zT(r,e){return r[0]=Math.ceil(e[0]),r[1]=Math.ceil(e[1]),r[2]=Math.ceil(e[2]),r}u(zT,"ceil");function FT(r,e){return r[0]=Math.floor(e[0]),r[1]=Math.floor(e[1]),r[2]=Math.floor(e[2]),r}u(FT,"floor");function BT(r,e,t){return r[0]=Math.min(e[0],t[0]),r[1]=Math.min(e[1],t[1]),r[2]=Math.min(e[2],t[2]),r}u(BT,"min");function RT(r,e,t){return r[0]=Math.max(e[0],t[0]),r[1]=Math.max(e[1],t[1]),r[2]=Math.max(e[2],t[2]),r}u(RT,"max");function OT(r,e){return r[0]=Math.round(e[0]),r[1]=Math.round(e[1]),r[2]=Math.round(e[2]),r}u(OT,"round");function VT(r,e,t){return r[0]=e[0]*t,r[1]=e[1]*t,r[2]=e[2]*t,r}u(VT,"scale");function UT(r,e,t,i){return r[0]=e[0]+t[0]*i,r[1]=e[1]+t[1]*i,r[2]=e[2]+t[2]*i,r}u(UT,"scaleAndAdd");function Qx(r,e){var t=e[0]-r[0],i=e[1]-r[1],n=e[2]-r[2];return Math.hypot(t,i,n)}u(Qx,"distance");function eb(r,e){var t=e[0]-r[0],i=e[1]-r[1],n=e[2]-r[2];return t*t+i*i+n*n}u(eb,"squaredDistance");function tb(r){var e=r[0],t=r[1],i=r[2];return e*e+t*t+i*i}u(tb,"squaredLength");function NT(r,e){return r[0]=-e[0],r[1]=-e[1],r[2]=-e[2],r}u(NT,"negate");function GT(r,e){return r[0]=1/e[0],r[1]=1/e[1],r[2]=1/e[2],r}u(GT,"inverse");function qT(r,e){var t=e[0],i=e[1],n=e[2],a=t*t+i*i+n*n;return a>0&&(a=1/Math.sqrt(a)),r[0]=e[0]*a,r[1]=e[1]*a,r[2]=e[2]*a,r}u(qT,"normalize");function rb(r,e){return r[0]*e[0]+r[1]*e[1]+r[2]*e[2]}u(rb,"dot");function jT(r,e,t){var i=e[0],n=e[1],a=e[2],o=t[0],s=t[1],l=t[2];return r[0]=n*l-a*s,r[1]=a*o-i*l,r[2]=i*s-n*o,r}u(jT,"cross");function $T(r,e,t,i){var n=e[0],a=e[1],o=e[2];return r[0]=n+i*(t[0]-n),r[1]=a+i*(t[1]-a),r[2]=o+i*(t[2]-o),r}u($T,"lerp");function HT(r,e,t,i,n,a){var o=a*a,s=o*(2*a-3)+1,l=o*(a-2)+a,c=o*(a-1),p=o*(3-2*a);return r[0]=e[0]*s+t[0]*l+i[0]*c+n[0]*p,r[1]=e[1]*s+t[1]*l+i[1]*c+n[1]*p,r[2]=e[2]*s+t[2]*l+i[2]*c+n[2]*p,r}u(HT,"hermite");function ZT(r,e,t,i,n,a){var o=1-a,s=o*o,l=a*a,c=s*o,p=3*a*s,h=3*l*o,f=l*a;return r[0]=e[0]*c+t[0]*p+i[0]*h+n[0]*f,r[1]=e[1]*c+t[1]*p+i[1]*h+n[1]*f,r[2]=e[2]*c+t[2]*p+i[2]*h+n[2]*f,r}u(ZT,"bezier");function WT(r,e){e=e||1;var t=$t()*2*Math.PI,i=$t()*2-1,n=Math.sqrt(1-i*i)*e;return r[0]=Math.cos(t)*n,r[1]=Math.sin(t)*n,r[2]=i*e,r}u(WT,"random");function XT(r,e,t){var i=e[0],n=e[1],a=e[2],o=t[3]*i+t[7]*n+t[11]*a+t[15];return o=o||1,r[0]=(t[0]*i+t[4]*n+t[8]*a+t[12])/o,r[1]=(t[1]*i+t[5]*n+t[9]*a+t[13])/o,r[2]=(t[2]*i+t[6]*n+t[10]*a+t[14])/o,r}u(XT,"transformMat4");function KT(r,e,t){var i=e[0],n=e[1],a=e[2];return r[0]=i*t[0]+n*t[3]+a*t[6],r[1]=i*t[1]+n*t[4]+a*t[7],r[2]=i*t[2]+n*t[5]+a*t[8],r}u(KT,"transformMat3");function YT(r,e,t){var i=t[0],n=t[1],a=t[2],o=t[3],s=e[0],l=e[1],c=e[2],p=n*c-a*l,h=a*s-i*c,f=i*l-n*s,m=n*f-a*h,g=a*p-i*f,y=i*h-n*p,x=o*2;return p*=x,h*=x,f*=x,m*=2,g*=2,y*=2,r[0]=s+p+m,r[1]=l+h+g,r[2]=c+f+y,r}u(YT,"transformQuat");function JT(r,e,t,i){var n=[],a=[];return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],a[0]=n[0],a[1]=n[1]*Math.cos(i)-n[2]*Math.sin(i),a[2]=n[1]*Math.sin(i)+n[2]*Math.cos(i),r[0]=a[0]+t[0],r[1]=a[1]+t[1],r[2]=a[2]+t[2],r}u(JT,"rotateX");function QT(r,e,t,i){var n=[],a=[];return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],a[0]=n[2]*Math.sin(i)+n[0]*Math.cos(i),a[1]=n[1],a[2]=n[2]*Math.cos(i)-n[0]*Math.sin(i),r[0]=a[0]+t[0],r[1]=a[1]+t[1],r[2]=a[2]+t[2],r}u(QT,"rotateY");function eA(r,e,t,i){var n=[],a=[];return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],a[0]=n[0]*Math.cos(i)-n[1]*Math.sin(i),a[1]=n[0]*Math.sin(i)+n[1]*Math.cos(i),a[2]=n[2],r[0]=a[0]+t[0],r[1]=a[1]+t[1],r[2]=a[2]+t[2],r}u(eA,"rotateZ");function tA(r,e){var t=r[0],i=r[1],n=r[2],a=e[0],o=e[1],s=e[2],l=Math.sqrt(t*t+i*i+n*n),c=Math.sqrt(a*a+o*o+s*s),p=l*c,h=p&&rb(r,e)/p;return Math.acos(Math.min(Math.max(h,-1),1))}u(tA,"angle");function rA(r){return r[0]=0,r[1]=0,r[2]=0,r}u(rA,"zero");function iA(r){return"vec3("+r[0]+", "+r[1]+", "+r[2]+")"}u(iA,"str");function nA(r,e){return r[0]===e[0]&&r[1]===e[1]&&r[2]===e[2]}u(nA,"exactEquals");function aA(r,e){var t=r[0],i=r[1],n=r[2],a=e[0],o=e[1],s=e[2];return Math.abs(t-a)<=ie*Math.max(1,Math.abs(t),Math.abs(a))&&Math.abs(i-o)<=ie*Math.max(1,Math.abs(i),Math.abs(o))&&Math.abs(n-s)<=ie*Math.max(1,Math.abs(n),Math.abs(s))}u(aA,"equals");var oA=Kx,sA=Yx,lA=Jx,uA=Qx,cA=eb,pA=Xx,hA=tb,fA=function(){var r=Wx();return function(e,t,i,n,a,o){var s,l;for(t||(t=3),i||(i=0),n?l=Math.min(n*t+i,e.length):l=e.length,s=i;s<l;s+=t)r[0]=e[s],r[1]=e[s+1],r[2]=e[s+2],a(r,r,o),e[s]=r[0],e[s+1]=r[1],e[s+2]=r[2];return e}}();var Xe={};_i(Xe,{add:()=>xA,ceil:()=>bA,clone:()=>mA,copy:()=>yA,create:()=>ib,cross:()=>EA,dist:()=>GA,distance:()=>sb,div:()=>NA,divide:()=>ob,dot:()=>CA,equals:()=>OA,exactEquals:()=>RA,floor:()=>_A,forEach:()=>HA,fromValues:()=>dA,inverse:()=>IA,len:()=>jA,length:()=>ub,lerp:()=>kA,max:()=>wA,min:()=>vA,mul:()=>UA,multiply:()=>ab,negate:()=>AA,normalize:()=>MA,random:()=>LA,round:()=>SA,scale:()=>PA,scaleAndAdd:()=>TA,set:()=>gA,sqrDist:()=>qA,sqrLen:()=>$A,squaredDistance:()=>lb,squaredLength:()=>cb,str:()=>BA,sub:()=>VA,subtract:()=>nb,transformMat4:()=>DA,transformQuat:()=>zA,zero:()=>FA});d();function ib(){var r=new we(4);return we!=Float32Array&&(r[0]=0,r[1]=0,r[2]=0,r[3]=0),r}u(ib,"create");function mA(r){var e=new we(4);return e[0]=r[0],e[1]=r[1],e[2]=r[2],e[3]=r[3],e}u(mA,"clone");function dA(r,e,t,i){var n=new we(4);return n[0]=r,n[1]=e,n[2]=t,n[3]=i,n}u(dA,"fromValues");function yA(r,e){return r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r}u(yA,"copy");function gA(r,e,t,i,n){return r[0]=e,r[1]=t,r[2]=i,r[3]=n,r}u(gA,"set");function xA(r,e,t){return r[0]=e[0]+t[0],r[1]=e[1]+t[1],r[2]=e[2]+t[2],r[3]=e[3]+t[3],r}u(xA,"add");function nb(r,e,t){return r[0]=e[0]-t[0],r[1]=e[1]-t[1],r[2]=e[2]-t[2],r[3]=e[3]-t[3],r}u(nb,"subtract");function ab(r,e,t){return r[0]=e[0]*t[0],r[1]=e[1]*t[1],r[2]=e[2]*t[2],r[3]=e[3]*t[3],r}u(ab,"multiply");function ob(r,e,t){return r[0]=e[0]/t[0],r[1]=e[1]/t[1],r[2]=e[2]/t[2],r[3]=e[3]/t[3],r}u(ob,"divide");function bA(r,e){return r[0]=Math.ceil(e[0]),r[1]=Math.ceil(e[1]),r[2]=Math.ceil(e[2]),r[3]=Math.ceil(e[3]),r}u(bA,"ceil");function _A(r,e){return r[0]=Math.floor(e[0]),r[1]=Math.floor(e[1]),r[2]=Math.floor(e[2]),r[3]=Math.floor(e[3]),r}u(_A,"floor");function vA(r,e,t){return r[0]=Math.min(e[0],t[0]),r[1]=Math.min(e[1],t[1]),r[2]=Math.min(e[2],t[2]),r[3]=Math.min(e[3],t[3]),r}u(vA,"min");function wA(r,e,t){return r[0]=Math.max(e[0],t[0]),r[1]=Math.max(e[1],t[1]),r[2]=Math.max(e[2],t[2]),r[3]=Math.max(e[3],t[3]),r}u(wA,"max");function SA(r,e){return r[0]=Math.round(e[0]),r[1]=Math.round(e[1]),r[2]=Math.round(e[2]),r[3]=Math.round(e[3]),r}u(SA,"round");function PA(r,e,t){return r[0]=e[0]*t,r[1]=e[1]*t,r[2]=e[2]*t,r[3]=e[3]*t,r}u(PA,"scale");function TA(r,e,t,i){return r[0]=e[0]+t[0]*i,r[1]=e[1]+t[1]*i,r[2]=e[2]+t[2]*i,r[3]=e[3]+t[3]*i,r}u(TA,"scaleAndAdd");function sb(r,e){var t=e[0]-r[0],i=e[1]-r[1],n=e[2]-r[2],a=e[3]-r[3];return Math.hypot(t,i,n,a)}u(sb,"distance");function lb(r,e){var t=e[0]-r[0],i=e[1]-r[1],n=e[2]-r[2],a=e[3]-r[3];return t*t+i*i+n*n+a*a}u(lb,"squaredDistance");function ub(r){var e=r[0],t=r[1],i=r[2],n=r[3];return Math.hypot(e,t,i,n)}u(ub,"length");function cb(r){var e=r[0],t=r[1],i=r[2],n=r[3];return e*e+t*t+i*i+n*n}u(cb,"squaredLength");function AA(r,e){return r[0]=-e[0],r[1]=-e[1],r[2]=-e[2],r[3]=-e[3],r}u(AA,"negate");function IA(r,e){return r[0]=1/e[0],r[1]=1/e[1],r[2]=1/e[2],r[3]=1/e[3],r}u(IA,"inverse");function MA(r,e){var t=e[0],i=e[1],n=e[2],a=e[3],o=t*t+i*i+n*n+a*a;return o>0&&(o=1/Math.sqrt(o)),r[0]=t*o,r[1]=i*o,r[2]=n*o,r[3]=a*o,r}u(MA,"normalize");function CA(r,e){return r[0]*e[0]+r[1]*e[1]+r[2]*e[2]+r[3]*e[3]}u(CA,"dot");function EA(r,e,t,i){var n=t[0]*i[1]-t[1]*i[0],a=t[0]*i[2]-t[2]*i[0],o=t[0]*i[3]-t[3]*i[0],s=t[1]*i[2]-t[2]*i[1],l=t[1]*i[3]-t[3]*i[1],c=t[2]*i[3]-t[3]*i[2],p=e[0],h=e[1],f=e[2],m=e[3];return r[0]=h*c-f*l+m*s,r[1]=-(p*c)+f*o-m*a,r[2]=p*l-h*o+m*n,r[3]=-(p*s)+h*a-f*n,r}u(EA,"cross");function kA(r,e,t,i){var n=e[0],a=e[1],o=e[2],s=e[3];return r[0]=n+i*(t[0]-n),r[1]=a+i*(t[1]-a),r[2]=o+i*(t[2]-o),r[3]=s+i*(t[3]-s),r}u(kA,"lerp");function LA(r,e){e=e||1;var t,i,n,a,o,s;do t=$t()*2-1,i=$t()*2-1,o=t*t+i*i;while(o>=1);do n=$t()*2-1,a=$t()*2-1,s=n*n+a*a;while(s>=1);var l=Math.sqrt((1-o)/s);return r[0]=e*t,r[1]=e*i,r[2]=e*n*l,r[3]=e*a*l,r}u(LA,"random");function DA(r,e,t){var i=e[0],n=e[1],a=e[2],o=e[3];return r[0]=t[0]*i+t[4]*n+t[8]*a+t[12]*o,r[1]=t[1]*i+t[5]*n+t[9]*a+t[13]*o,r[2]=t[2]*i+t[6]*n+t[10]*a+t[14]*o,r[3]=t[3]*i+t[7]*n+t[11]*a+t[15]*o,r}u(DA,"transformMat4");function zA(r,e,t){var i=e[0],n=e[1],a=e[2],o=t[0],s=t[1],l=t[2],c=t[3],p=c*i+s*a-l*n,h=c*n+l*i-o*a,f=c*a+o*n-s*i,m=-o*i-s*n-l*a;return r[0]=p*c+m*-o+h*-l-f*-s,r[1]=h*c+m*-s+f*-o-p*-l,r[2]=f*c+m*-l+p*-s-h*-o,r[3]=e[3],r}u(zA,"transformQuat");function FA(r){return r[0]=0,r[1]=0,r[2]=0,r[3]=0,r}u(FA,"zero");function BA(r){return"vec4("+r[0]+", "+r[1]+", "+r[2]+", "+r[3]+")"}u(BA,"str");function RA(r,e){return r[0]===e[0]&&r[1]===e[1]&&r[2]===e[2]&&r[3]===e[3]}u(RA,"exactEquals");function OA(r,e){var t=r[0],i=r[1],n=r[2],a=r[3],o=e[0],s=e[1],l=e[2],c=e[3];return Math.abs(t-o)<=ie*Math.max(1,Math.abs(t),Math.abs(o))&&Math.abs(i-s)<=ie*Math.max(1,Math.abs(i),Math.abs(s))&&Math.abs(n-l)<=ie*Math.max(1,Math.abs(n),Math.abs(l))&&Math.abs(a-c)<=ie*Math.max(1,Math.abs(a),Math.abs(c))}u(OA,"equals");var VA=nb,UA=ab,NA=ob,GA=sb,qA=lb,jA=ub,$A=cb,HA=function(){var r=ib();return function(e,t,i,n,a,o){var s,l;for(t||(t=4),i||(i=0),n?l=Math.min(n*t+i,e.length):l=e.length,s=i;s<l;s+=t)r[0]=e[s],r[1]=e[s+1],r[2]=e[s+2],r[3]=e[s+3],a(r,r,o),e[s]=r[0],e[s+1]=r[1],e[s+2]=r[2],e[s+3]=r[3];return e}}();var Xi={};_i(Xi,{add:()=>YA,angle:()=>gI,ceil:()=>JA,clone:()=>ZA,copy:()=>XA,create:()=>pb,cross:()=>uI,dist:()=>AI,distance:()=>db,div:()=>TI,divide:()=>mb,dot:()=>lI,equals:()=>vI,exactEquals:()=>_I,floor:()=>QA,forEach:()=>CI,fromValues:()=>WA,inverse:()=>oI,len:()=>wI,length:()=>gb,lerp:()=>cI,max:()=>tI,min:()=>eI,mul:()=>PI,multiply:()=>fb,negate:()=>aI,normalize:()=>sI,random:()=>pI,rotate:()=>yI,round:()=>rI,scale:()=>iI,scaleAndAdd:()=>nI,set:()=>KA,sqrDist:()=>II,sqrLen:()=>MI,squaredDistance:()=>yb,squaredLength:()=>xb,str:()=>bI,sub:()=>SI,subtract:()=>hb,transformMat2:()=>hI,transformMat2d:()=>fI,transformMat3:()=>mI,transformMat4:()=>dI,zero:()=>xI});d();function pb(){var r=new we(2);return we!=Float32Array&&(r[0]=0,r[1]=0),r}u(pb,"create");function ZA(r){var e=new we(2);return e[0]=r[0],e[1]=r[1],e}u(ZA,"clone");function WA(r,e){var t=new we(2);return t[0]=r,t[1]=e,t}u(WA,"fromValues");function XA(r,e){return r[0]=e[0],r[1]=e[1],r}u(XA,"copy");function KA(r,e,t){return r[0]=e,r[1]=t,r}u(KA,"set");function YA(r,e,t){return r[0]=e[0]+t[0],r[1]=e[1]+t[1],r}u(YA,"add");function hb(r,e,t){return r[0]=e[0]-t[0],r[1]=e[1]-t[1],r}u(hb,"subtract");function fb(r,e,t){return r[0]=e[0]*t[0],r[1]=e[1]*t[1],r}u(fb,"multiply");function mb(r,e,t){return r[0]=e[0]/t[0],r[1]=e[1]/t[1],r}u(mb,"divide");function JA(r,e){return r[0]=Math.ceil(e[0]),r[1]=Math.ceil(e[1]),r}u(JA,"ceil");function QA(r,e){return r[0]=Math.floor(e[0]),r[1]=Math.floor(e[1]),r}u(QA,"floor");function eI(r,e,t){return r[0]=Math.min(e[0],t[0]),r[1]=Math.min(e[1],t[1]),r}u(eI,"min");function tI(r,e,t){return r[0]=Math.max(e[0],t[0]),r[1]=Math.max(e[1],t[1]),r}u(tI,"max");function rI(r,e){return r[0]=Math.round(e[0]),r[1]=Math.round(e[1]),r}u(rI,"round");function iI(r,e,t){return r[0]=e[0]*t,r[1]=e[1]*t,r}u(iI,"scale");function nI(r,e,t,i){return r[0]=e[0]+t[0]*i,r[1]=e[1]+t[1]*i,r}u(nI,"scaleAndAdd");function db(r,e){var t=e[0]-r[0],i=e[1]-r[1];return Math.hypot(t,i)}u(db,"distance");function yb(r,e){var t=e[0]-r[0],i=e[1]-r[1];return t*t+i*i}u(yb,"squaredDistance");function gb(r){var e=r[0],t=r[1];return Math.hypot(e,t)}u(gb,"length");function xb(r){var e=r[0],t=r[1];return e*e+t*t}u(xb,"squaredLength");function aI(r,e){return r[0]=-e[0],r[1]=-e[1],r}u(aI,"negate");function oI(r,e){return r[0]=1/e[0],r[1]=1/e[1],r}u(oI,"inverse");function sI(r,e){var t=e[0],i=e[1],n=t*t+i*i;return n>0&&(n=1/Math.sqrt(n)),r[0]=e[0]*n,r[1]=e[1]*n,r}u(sI,"normalize");function lI(r,e){return r[0]*e[0]+r[1]*e[1]}u(lI,"dot");function uI(r,e,t){var i=e[0]*t[1]-e[1]*t[0];return r[0]=r[1]=0,r[2]=i,r}u(uI,"cross");function cI(r,e,t,i){var n=e[0],a=e[1];return r[0]=n+i*(t[0]-n),r[1]=a+i*(t[1]-a),r}u(cI,"lerp");function pI(r,e){e=e||1;var t=$t()*2*Math.PI;return r[0]=Math.cos(t)*e,r[1]=Math.sin(t)*e,r}u(pI,"random");function hI(r,e,t){var i=e[0],n=e[1];return r[0]=t[0]*i+t[2]*n,r[1]=t[1]*i+t[3]*n,r}u(hI,"transformMat2");function fI(r,e,t){var i=e[0],n=e[1];return r[0]=t[0]*i+t[2]*n+t[4],r[1]=t[1]*i+t[3]*n+t[5],r}u(fI,"transformMat2d");function mI(r,e,t){var i=e[0],n=e[1];return r[0]=t[0]*i+t[3]*n+t[6],r[1]=t[1]*i+t[4]*n+t[7],r}u(mI,"transformMat3");function dI(r,e,t){var i=e[0],n=e[1];return r[0]=t[0]*i+t[4]*n+t[12],r[1]=t[1]*i+t[5]*n+t[13],r}u(dI,"transformMat4");function yI(r,e,t,i){var n=e[0]-t[0],a=e[1]-t[1],o=Math.sin(i),s=Math.cos(i);return r[0]=n*s-a*o+t[0],r[1]=n*o+a*s+t[1],r}u(yI,"rotate");function gI(r,e){var t=r[0],i=r[1],n=e[0],a=e[1],o=Math.sqrt(t*t+i*i)*Math.sqrt(n*n+a*a),s=o&&(t*n+i*a)/o;return Math.acos(Math.min(Math.max(s,-1),1))}u(gI,"angle");function xI(r){return r[0]=0,r[1]=0,r}u(xI,"zero");function bI(r){return"vec2("+r[0]+", "+r[1]+")"}u(bI,"str");function _I(r,e){return r[0]===e[0]&&r[1]===e[1]}u(_I,"exactEquals");function vI(r,e){var t=r[0],i=r[1],n=e[0],a=e[1];return Math.abs(t-n)<=ie*Math.max(1,Math.abs(t),Math.abs(n))&&Math.abs(i-a)<=ie*Math.max(1,Math.abs(i),Math.abs(a))}u(vI,"equals");var wI=gb,SI=hb,PI=fb,TI=mb,AI=db,II=yb,MI=xb,CI=function(){var r=pb();return function(e,t,i,n,a,o){var s,l;for(t||(t=2),i||(i=0),n?l=Math.min(n*t+i,e.length):l=e.length,s=i;s<l;s+=t)r[0]=e[s],r[1]=e[s+1],a(r,r,o),e[s]=r[0],e[s+1]=r[1];return e}}();var bb=ae(Pe(),1);var lf=class lf extends je{constructor(t){super(t,Bx)}createBucket(t){return new ai(t)}queryRadius(t){let i=t;return oi("circle-radius",this,i)+oi("circle-stroke-width",this,i)+Mr(this.paint.get("circle-translate"))}queryIntersectsFeature(t,i,n,a,o,s,l,c){let p=Cr(t,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),s.angle,l),h=this.paint.get("circle-radius").evaluate(i,n),f=this.paint.get("circle-stroke-width").evaluate(i,n),m=h+f,g=this.paint.get("circle-pitch-alignment")==="map",y=g?p:EI(p,c),x=g?m*l:m;for(let b of a)for(let _ of b){let v=g?_:_b(_,c),S=x,P=Xe.transformMat4([],[_.x,_.y,0,1],c);if(this.paint.get("circle-pitch-scale")==="viewport"&&this.paint.get("circle-pitch-alignment")==="map"?S*=P[3]/s.cameraToCenterDistance:this.paint.get("circle-pitch-scale")==="map"&&this.paint.get("circle-pitch-alignment")==="viewport"&&(S*=s.cameraToCenterDistance/P[3]),Cx(y,v,S))return!0}return!1}};u(lf,"CircleStyleLayer");var Os=lf;function _b(r,e){let t=Xe.transformMat4([],[r.x,r.y,0,1],e);return new bb.default(t[0]/t[3],t[1]/t[3])}u(_b,"projectPoint");function EI(r,e){return r.map(t=>_b(t,e))}u(EI,"projectQueryGeometry");d();d();var uf=class uf extends ai{};u(uf,"HeatmapBucket");var Ia=uf;G("HeatmapBucket",Ia,{omit:["layers"]});d();var vb,kI=u(()=>vb=vb||new Re({"heatmap-radius":new W(M.paint_heatmap["heatmap-radius"]),"heatmap-weight":new W(M.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new $(M.paint_heatmap["heatmap-intensity"]),"heatmap-color":new Qr(M.paint_heatmap["heatmap-color"]),"heatmap-opacity":new $(M.paint_heatmap["heatmap-opacity"])}),"getPaint"),wb={get paint(){return kI()}};d();d();function cf(r,{width:e,height:t},i,n){if(!n)n=new Uint8Array(e*t*i);else if(n instanceof Uint8ClampedArray)n=new Uint8Array(n.buffer);else if(n.length!==e*t*i)throw new RangeError("mismatched image size. expected: ".concat(n.length," but got: ").concat(e*t*i));return r.width=e,r.height=t,r.data=n,r}u(cf,"createImage");function Sb(r,{width:e,height:t},i){if(e===r.width&&t===r.height)return;let n=cf({},{width:e,height:t},i);pf(r,n,{x:0,y:0},{x:0,y:0},{width:Math.min(r.width,e),height:Math.min(r.height,t)},i),r.width=e,r.height=t,r.data=n.data}u(Sb,"resizeImage");function pf(r,e,t,i,n,a){if(n.width===0||n.height===0)return e;if(n.width>r.width||n.height>r.height||t.x>r.width-n.width||t.y>r.height-n.height)throw new RangeError("out of range source coordinates for image copy");if(n.width>e.width||n.height>e.height||i.x>e.width-n.width||i.y>e.height-n.height)throw new RangeError("out of range destination coordinates for image copy");let o=r.data,s=e.data;if(o===s)throw new Error("srcData equals dstData, so image is already copied");for(let l=0;l<n.height;l++){let c=((t.y+l)*r.width+t.x)*a,p=((i.y+l)*e.width+i.x)*a;for(let h=0;h<n.width*a;h++)s[p+h]=o[c+h]}return e}u(pf,"copyImage");var Vs=class Vs{constructor(e,t){cf(this,e,1,t)}resize(e){Sb(this,e,1)}clone(){return new Vs({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(e,t,i,n,a){pf(e,t,i,n,a,1)}};u(Vs,"AlphaImage");var si=Vs,Us=class Us{constructor(e,t){cf(this,e,4,t)}resize(e){Sb(this,e,4)}replace(e,t){t?this.data.set(e):e instanceof Uint8ClampedArray?this.data=new Uint8Array(e.buffer):this.data=e}clone(){return new Us({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(e,t,i,n,a){pf(e,t,i,n,a,4)}};u(Us,"RGBAImage");var Ee=Us;G("AlphaImage",si);G("RGBAImage",Ee);function Ns(r){let e={},t=r.resolution||256,i=r.clips?r.clips.length:1,n=r.image||new Ee({width:t,height:i});if(!Wy(t))throw new Error("width is not a power of 2 - ".concat(t));let a=u((o,s,l)=>{e[r.evaluationKey]=l;let c=r.expression.evaluate(e);n.data[o+s+0]=Math.floor(c.r*255/c.a),n.data[o+s+1]=Math.floor(c.g*255/c.a),n.data[o+s+2]=Math.floor(c.b*255/c.a),n.data[o+s+3]=Math.floor(c.a*255)},"renderPixel");if(r.clips)for(let o=0,s=0;o<i;++o,s+=t*4)for(let l=0,c=0;l<t;l++,c+=4){let p=l/(t-1),{start:h,end:f}=r.clips[o],m=h*(1-p)+f*p;a(s,c,m)}else for(let o=0,s=0;o<t;o++,s+=4){let l=o/(t-1);a(0,s,l)}return n}u(Ns,"renderColorRamp");var hf=class hf extends je{constructor(t){super(t,wb);this._updateColorRamp()}createBucket(t){return new Ia(t)}_handleSpecialPaintPropertyUpdate(t){t==="heatmap-color"&&this._updateColorRamp()}_updateColorRamp(){let t=this._transitionablePaint._values["heatmap-color"].value.expression;this.colorRamp=Ns({expression:t,evaluationKey:"heatmapDensity",image:this.colorRamp}),this.colorRampTexture=null}resize(){this.heatmapFbo&&(this.heatmapFbo.destroy(),this.heatmapFbo=null)}queryRadius(){return 0}queryIntersectsFeature(){return!1}hasOffscreenPass(){return this.paint.get("heatmap-opacity")!==0&&this.visibility!=="none"}};u(hf,"HeatmapStyleLayer");var Gs=hf;d();d();var Pb,LI=u(()=>Pb=Pb||new Re({"hillshade-illumination-direction":new $(M.paint_hillshade["hillshade-illumination-direction"]),"hillshade-illumination-anchor":new $(M.paint_hillshade["hillshade-illumination-anchor"]),"hillshade-exaggeration":new $(M.paint_hillshade["hillshade-exaggeration"]),"hillshade-shadow-color":new $(M.paint_hillshade["hillshade-shadow-color"]),"hillshade-highlight-color":new $(M.paint_hillshade["hillshade-highlight-color"]),"hillshade-accent-color":new $(M.paint_hillshade["hillshade-accent-color"])}),"getPaint"),Tb={get paint(){return LI()}};var ff=class ff extends je{constructor(t){super(t,Tb)}hasOffscreenPass(){return this.paint.get("hillshade-exaggeration")!==0&&this.visibility!=="none"}};u(ff,"HillshadeStyleLayer");var qs=ff;d();d();d();var DI=ve([{name:"a_pos",components:2,type:"Int16"}],4);var{members:Ab,size:kF,alignment:LF}=DI;var Mb=ae(Oy(),1);d();d();function mf(r,e,t,i,n){Ib(r,e,t||0,i||r.length-1,n||zI)}u(mf,"quickselect");function Ib(r,e,t,i,n){for(;i>t;){if(i-t>600){var a=i-t+1,o=e-t+1,s=Math.log(a),l=.5*Math.exp(2*s/3),c=.5*Math.sqrt(s*l*(a-l)/a)*(o-a/2<0?-1:1),p=Math.max(t,Math.floor(e-o*l/a+c)),h=Math.min(i,Math.floor(e+(a-o)*l/a+c));Ib(r,e,p,h,n)}var f=r[e],m=t,g=i;for(Ma(r,t,e),n(r[i],f)>0&&Ma(r,t,i);m<g;){for(Ma(r,m,g),m++,g--;n(r[m],f)<0;)m++;for(;n(r[g],f)>0;)g--}n(r[t],f)===0?Ma(r,t,g):(g++,Ma(r,g,i)),g<=e&&(t=g+1),e<=g&&(i=g-1)}}u(Ib,"quickselectStep");function Ma(r,e,t){var i=r[e];r[e]=r[t],r[t]=i}u(Ma,"swap");function zI(r,e){return r<e?-1:r>e?1:0}u(zI,"defaultCompare");function Ca(r,e){let t=r.length;if(t<=1)return[r];let i=[],n,a;for(let o=0;o<t;o++){let s=Jy(r[o]);s!==0&&(r[o].area=Math.abs(s),a===void 0&&(a=s<0),a===s<0?(n&&i.push(n),n=[r[o]]):n.push(r[o]))}if(n&&i.push(n),e>1)for(let o=0;o<i.length;o++)i[o].length<=e||(mf(i[o],e,1,i[o].length-1,FI),i[o]=i[o].slice(0,e));return i}u(Ca,"classifyRings");function FI(r,e){return e.area-r.area}u(FI,"compareAreas");d();function Ki(r,e,t){let i=t.patternDependencies,n=!1;for(let a of e){let o=a.paint.get("".concat(r,"-pattern"));o.isConstant()||(n=!0);let s=o.constantOr(null);s&&(n=!0,i[s.to]=!0,i[s.from]=!0)}return n}u(Ki,"hasPattern");function Yi(r,e,t,i,n){let a=n.patternDependencies;for(let o of e){let l=o.paint.get("".concat(r,"-pattern")).value;if(l.kind!=="constant"){let c=l.evaluate({zoom:i-1},t,{},n.availableImages),p=l.evaluate({zoom:i},t,{},n.availableImages),h=l.evaluate({zoom:i+1},t,{},n.availableImages);c=c&&c.name?c.name:c,p=p&&p.name?p.name:p,h=h&&h.name?h.name:h,a[c]=!0,a[p]=!0,a[h]=!0,t.patterns[o.id]={min:c,mid:p,max:h}}}return t}u(Yi,"addPatternDependencies");var BI=500,df=class df{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(t=>t.id),this.index=e.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new _s,this.indexArray=new nt,this.indexArray2=new Tr,this.programConfigurations=new mt(e.layers,e.zoom),this.segments=new me,this.segments2=new me,this.stateDependentLayerIds=this.layers.filter(t=>t.isStateDependent()).map(t=>t.id)}populate(e,t,i){this.hasPattern=Ki("fill",this.layers,t);let n=this.layers[0].layout.get("fill-sort-key"),a=!n.isConstant(),o=[];for(let{feature:s,id:l,index:c,sourceLayerIndex:p}of e){let h=this.layers[0]._featureFilter.needGeometry,f=yt(s,h);if(!this.layers[0]._featureFilter.filter(new ye(this.zoom),f,i))continue;let m=a?n.evaluate(f,{},i,t.availableImages):void 0,g={id:l,properties:s.properties,type:s.type,sourceLayerIndex:p,index:c,geometry:h?f.geometry:dt(s),patterns:{},sortKey:m};o.push(g)}a&&o.sort((s,l)=>s.sortKey-l.sortKey);for(let s of o){let{geometry:l,index:c,sourceLayerIndex:p}=s;if(this.hasPattern){let f=Yi("fill",this.layers,s,this.zoom,t);this.patternFeatures.push(f)}else this.addFeature(s,l,c,i,{});let h=e[c].feature;t.featureIndex.insert(h,l,c,p,this.index)}}update(e,t,i){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,t,this.stateDependentLayers,i)}addFeatures(e,t,i){for(let n of this.patternFeatures)this.addFeature(n,n.geometry,n.index,t,i)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Ab),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.indexBuffer2=e.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())}addFeature(e,t,i,n,a){for(let o of Ca(t,BI)){let s=0;for(let m of o)s+=m.length;let l=this.segments.prepareSegment(s,this.layoutVertexArray,this.indexArray),c=l.vertexLength,p=[],h=[];for(let m of o){if(m.length===0)continue;m!==o[0]&&h.push(p.length/2);let g=this.segments2.prepareSegment(m.length,this.layoutVertexArray,this.indexArray2),y=g.vertexLength;this.layoutVertexArray.emplaceBack(m[0].x,m[0].y),this.indexArray2.emplaceBack(y+m.length-1,y),p.push(m[0].x),p.push(m[0].y);for(let x=1;x<m.length;x++)this.layoutVertexArray.emplaceBack(m[x].x,m[x].y),this.indexArray2.emplaceBack(y+x-1,y+x),p.push(m[x].x),p.push(m[x].y);g.vertexLength+=m.length,g.primitiveLength+=m.length}let f=(0,Mb.default)(p,h);for(let m=0;m<f.length;m+=3)this.indexArray.emplaceBack(c+f[m],c+f[m+1],c+f[m+2]);l.vertexLength+=s,l.primitiveLength+=f.length/3}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,i,a,n)}};u(df,"FillBucket");var Ea=df;G("FillBucket",Ea,{omit:["layers","patternFeatures"]});d();var Cb,RI=u(()=>Cb=Cb||new Re({"fill-sort-key":new W(M.layout_fill["fill-sort-key"])}),"getLayout"),Eb,OI=u(()=>Eb=Eb||new Re({"fill-antialias":new $(M.paint_fill["fill-antialias"]),"fill-opacity":new W(M.paint_fill["fill-opacity"]),"fill-color":new W(M.paint_fill["fill-color"]),"fill-outline-color":new W(M.paint_fill["fill-outline-color"]),"fill-translate":new $(M.paint_fill["fill-translate"]),"fill-translate-anchor":new $(M.paint_fill["fill-translate-anchor"]),"fill-pattern":new rr(M.paint_fill["fill-pattern"])}),"getPaint"),kb={get paint(){return OI()},get layout(){return RI()}};var yf=class yf extends je{constructor(t){super(t,kb)}recalculate(t,i){super.recalculate(t,i);let n=this.paint._values["fill-outline-color"];n.value.kind==="constant"&&n.value.value===void 0&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])}createBucket(t){return new Ea(t)}queryRadius(){return Mr(this.paint.get("fill-translate"))}queryIntersectsFeature(t,i,n,a,o,s,l){let c=Cr(t,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),s.angle,l);return Bs(c,a)}isTileClipped(){return!0}};u(yf,"FillStyleLayer");var js=yf;d();d();d();var VI=ve([{name:"a_pos",components:2,type:"Int16"},{name:"a_normal_ed",components:4,type:"Int16"}],4),Lb=ve([{name:"a_centroid",components:2,type:"Int16"}],4);var{members:Db,size:A3,alignment:I3}=VI;var Vb=ae(Oy(),1),Ub=ae(ka(),1);var YI=Ub.default.VectorTileFeature.types,JI=500,bf=Math.pow(2,13);function La(r,e,t,i,n,a,o,s){r.emplaceBack(e,t,Math.floor(i*bf)*2+o,n*bf*2,a*bf*2,Math.round(s))}u(La,"addVertex");var _f=class _f{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(t=>t.id),this.index=e.index,this.hasPattern=!1,this.layoutVertexArray=new vs,this.centroidVertexArray=new Pr,this.indexArray=new nt,this.programConfigurations=new mt(e.layers,e.zoom),this.segments=new me,this.stateDependentLayerIds=this.layers.filter(t=>t.isStateDependent()).map(t=>t.id)}populate(e,t,i){this.features=[],this.hasPattern=Ki("fill-extrusion",this.layers,t);for(let{feature:n,id:a,index:o,sourceLayerIndex:s}of e){let l=this.layers[0]._featureFilter.needGeometry,c=yt(n,l);if(!this.layers[0]._featureFilter.filter(new ye(this.zoom),c,i))continue;let p={id:a,sourceLayerIndex:s,index:o,geometry:l?c.geometry:dt(n),properties:n.properties,type:n.type,patterns:{}};this.hasPattern?this.features.push(Yi("fill-extrusion",this.layers,p,this.zoom,t)):this.addFeature(p,p.geometry,o,i,{}),t.featureIndex.insert(n,p.geometry,o,s,this.index,!0)}}addFeatures(e,t,i){for(let n of this.features){let{geometry:a}=n;this.addFeature(n,a,n.index,t,i)}}update(e,t,i){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,t,this.stateDependentLayers,i)}isEmpty(){return this.layoutVertexArray.length===0&&this.centroidVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Db),this.centroidVertexBuffer=e.createVertexBuffer(this.centroidVertexArray,Lb.members,!0),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.centroidVertexBuffer.destroy())}addFeature(e,t,i,n,a){let o={x:0,y:0,vertexCount:0};for(let s of Ca(t,JI)){let l=0;for(let g of s)l+=g.length;let c=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray);for(let g of s){if(g.length===0||eM(g))continue;let y=0;for(let x=0;x<g.length;x++){let b=g[x];if(x>=1){let _=g[x-1];if(!QI(b,_)){c.vertexLength+4>me.MAX_VERTEX_ARRAY_LENGTH&&(c=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));let v=b.sub(_)._perp()._unit(),S=_.dist(b);y+S>32768&&(y=0),La(this.layoutVertexArray,b.x,b.y,v.x,v.y,0,0,y),La(this.layoutVertexArray,b.x,b.y,v.x,v.y,0,1,y),o.x+=2*b.x,o.y+=2*b.y,o.vertexCount+=2,y+=S,La(this.layoutVertexArray,_.x,_.y,v.x,v.y,0,0,y),La(this.layoutVertexArray,_.x,_.y,v.x,v.y,0,1,y),o.x+=2*_.x,o.y+=2*_.y,o.vertexCount+=2;let P=c.vertexLength;this.indexArray.emplaceBack(P,P+2,P+1),this.indexArray.emplaceBack(P+1,P+2,P+3),c.vertexLength+=4,c.primitiveLength+=2}}}}if(c.vertexLength+l>me.MAX_VERTEX_ARRAY_LENGTH&&(c=this.segments.prepareSegment(l,this.layoutVertexArray,this.indexArray)),YI[e.type]!=="Polygon")continue;let p=[],h=[],f=c.vertexLength;for(let g of s)if(g.length!==0){g!==s[0]&&h.push(p.length/2);for(let y=0;y<g.length;y++){let x=g[y];La(this.layoutVertexArray,x.x,x.y,0,0,1,1,0),o.x+=x.x,o.y+=x.y,o.vertexCount+=1,p.push(x.x),p.push(x.y)}}let m=(0,Vb.default)(p,h);for(let g=0;g<m.length;g+=3)this.indexArray.emplaceBack(f+m[g],f+m[g+2],f+m[g+1]);c.primitiveLength+=m.length/3,c.vertexLength+=l}for(let s=0;s<o.vertexCount;s++)this.centroidVertexArray.emplaceBack(Math.floor(o.x/o.vertexCount),Math.floor(o.y/o.vertexCount));this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,i,a,n)}};u(_f,"FillExtrusionBucket");var Da=_f;G("FillExtrusionBucket",Da,{omit:["layers","features"]});function QI(r,e){return r.x===e.x&&(r.x<0||r.x>8192)||r.y===e.y&&(r.y<0||r.y>8192)}u(QI,"isBoundaryEdge");function eM(r){return r.every(e=>e.x<0)||r.every(e=>e.x>8192)||r.every(e=>e.y<0)||r.every(e=>e.y>8192)}u(eM,"isEntirelyOutside");d();var Nb,tM=u(()=>Nb=Nb||new Re({"fill-extrusion-opacity":new $(M["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new W(M["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new $(M["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new $(M["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new rr(M["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new W(M["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new W(M["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new $(M["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])}),"getPaint"),Gb={get paint(){return tM()}};var Hs=ae(Pe(),1);var vf=class vf extends je{constructor(t){super(t,Gb)}createBucket(t){return new Da(t)}queryRadius(){return Mr(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}queryIntersectsFeature(t,i,n,a,o,s,l,c){let p=Cr(t,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),s.angle,l),h=this.paint.get("fill-extrusion-height").evaluate(i,n),f=this.paint.get("fill-extrusion-base").evaluate(i,n),m=nM(p,c,s,0),g=iM(a,f,h,c),y=g[0],x=g[1];return rM(y,x,m)}};u(vf,"FillExtrusionStyleLayer");var Zs=vf;function za(r,e){return r.x*e.x+r.y*e.y}u(za,"dot");function qb(r,e){if(r.length===1){let t=0,i=e[t++],n;for(;!n||i.equals(n);)if(n=e[t++],!n)return 1/0;for(;t<e.length;t++){let a=e[t],o=r[0],s=n.sub(i),l=a.sub(i),c=o.sub(i),p=za(s,s),h=za(s,l),f=za(l,l),m=za(c,s),g=za(c,l),y=p*f-h*h,x=(f*m-h*g)/y,b=(p*g-h*m)/y,_=1-x-b,v=i.z*_+n.z*x+a.z*b;if(isFinite(v))return v}return 1/0}else{let t=1/0;for(let i of e)t=Math.min(t,i.z);return t}}u(qb,"getIntersectionDistance");function rM(r,e,t){let i=1/0;Bs(t,e)&&(i=qb(t,e[0]));for(let n=0;n<e.length;n++){let a=e[n],o=r[n];for(let s=0;s<a.length-1;s++){let l=a[s],c=a[s+1],p=o[s],h=o[s+1],f=[l,c,h,p,l];Fs(t,f)&&(i=Math.min(i,qb(t,f)))}}return i===1/0?!1:i}u(rM,"checkIntersection");function iM(r,e,t,i){let n=[],a=[],o=i[8]*e,s=i[9]*e,l=i[10]*e,c=i[11]*e,p=i[8]*t,h=i[9]*t,f=i[10]*t,m=i[11]*t;for(let g of r){let y=[],x=[];for(let b of g){let _=b.x,v=b.y,S=i[0]*_+i[4]*v+i[12],P=i[1]*_+i[5]*v+i[13],T=i[2]*_+i[6]*v+i[14],A=i[3]*_+i[7]*v+i[15],L=S+o,C=P+s,I=T+l,D=A+c,F=S+p,k=P+h,E=T+f,O=A+m,X=new Hs.default(L/D,C/D);X.z=I/D,y.push(X);let H=new Hs.default(F/O,k/O);H.z=E/O,x.push(H)}n.push(y),a.push(x)}return[n,a]}u(iM,"projectExtrusion");function nM(r,e,t,i){let n=[];for(let a of r){let o=[a.x,a.y,i,1];Xe.transformMat4(o,o,e),n.push(new Hs.default(o[0]/o[3],o[1]/o[3]))}return n}u(nM,"projectQueryGeometry");d();d();d();var aM=ve([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}],4),{members:jb,size:SB,alignment:PB}=aM;d();var oM=ve([{name:"a_uv_x",components:1,type:"Float32"},{name:"a_split_index",components:1,type:"Float32"}]),{members:$b,size:MB,alignment:CB}=oM;var Wb=ae(ka(),1);var sM=Wb.default.VectorTileFeature.types,Hb=63,lM=Math.cos(75/2*(Math.PI/180)),uM=15,cM=20,pM=15,Xb=1/2,Zb=Math.pow(2,pM-1)/Xb,wf=class wf{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(t=>t.id),this.index=e.index,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach(t=>{this.gradients[t.id]={}}),this.layoutVertexArray=new ws,this.layoutVertexArray2=new Ss,this.indexArray=new nt,this.programConfigurations=new mt(e.layers,e.zoom),this.segments=new me,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter(t=>t.isStateDependent()).map(t=>t.id)}populate(e,t,i){this.hasPattern=Ki("line",this.layers,t);let n=this.layers[0].layout.get("line-sort-key"),a=!n.isConstant(),o=[];for(let{feature:s,id:l,index:c,sourceLayerIndex:p}of e){let h=this.layers[0]._featureFilter.needGeometry,f=yt(s,h);if(!this.layers[0]._featureFilter.filter(new ye(this.zoom),f,i))continue;let m=a?n.evaluate(f,{},i):void 0,g={id:l,properties:s.properties,type:s.type,sourceLayerIndex:p,index:c,geometry:h?f.geometry:dt(s),patterns:{},sortKey:m};o.push(g)}a&&o.sort((s,l)=>s.sortKey-l.sortKey);for(let s of o){let{geometry:l,index:c,sourceLayerIndex:p}=s;if(this.hasPattern){let f=Yi("line",this.layers,s,this.zoom,t);this.patternFeatures.push(f)}else this.addFeature(s,l,c,i,{});let h=e[c].feature;t.featureIndex.insert(h,l,c,p,this.index)}}update(e,t,i){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,t,this.stateDependentLayers,i)}addFeatures(e,t,i){for(let n of this.patternFeatures)this.addFeature(n,n.geometry,n.index,t,i)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexArray2.length!==0&&(this.layoutVertexBuffer2=e.createVertexBuffer(this.layoutVertexArray2,$b)),this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,jb),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(e){if(e.properties&&Object.prototype.hasOwnProperty.call(e.properties,"mapbox_clip_start")&&Object.prototype.hasOwnProperty.call(e.properties,"mapbox_clip_end")){let t=+e.properties.mapbox_clip_start,i=+e.properties.mapbox_clip_end;return{start:t,end:i}}}addFeature(e,t,i,n,a){let o=this.layers[0].layout,s=o.get("line-join").evaluate(e,{}),l=o.get("line-cap"),c=o.get("line-miter-limit"),p=o.get("line-round-limit");this.lineClips=this.lineFeatureClips(e);for(let h of t)this.addLine(h,e,s,l,c,p);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,i,a,n)}addLine(e,t,i,n,a,o){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(let b=0;b<e.length-1;b++)this.totalDistance+=e[b].dist(e[b+1]);this.updateScaledDistance(),this.maxLineLength=Math.max(this.maxLineLength,this.totalDistance)}let s=sM[t.type]==="Polygon",l=e.length;for(;l>=2&&e[l-1].equals(e[l-2]);)l--;let c=0;for(;c<l-1&&e[c].equals(e[c+1]);)c++;if(l<(s?3:2))return;i==="bevel"&&(a=1.05);let p=this.overscaling<=16?uM*8192/(512*this.overscaling):0,h=this.segments.prepareSegment(l*10,this.layoutVertexArray,this.indexArray),f,m,g,y,x;this.e1=this.e2=-1,s&&(f=e[l-2],x=e[c].sub(f)._unit()._perp());for(let b=c;b<l;b++){if(g=b===l-1?s?e[c+1]:void 0:e[b+1],g&&e[b].equals(g))continue;x&&(y=x),f&&(m=f),f=e[b],x=g?g.sub(f)._unit()._perp():y,y=y||x;let _=y.add(x);(_.x!==0||_.y!==0)&&_._unit();let v=y.x*x.x+y.y*x.y,S=_.x*x.x+_.y*x.y,P=S!==0?1/S:1/0,T=2*Math.sqrt(2-2*S),A=S<lM&&m&&g,L=y.x*x.y-y.y*x.x>0;if(A&&b>c){let D=f.dist(m);if(D>2*p){let F=f.sub(f.sub(m)._mult(p/D)._round());this.updateDistance(m,F),this.addCurrentVertex(F,y,0,0,h),m=F}}let C=m&&g,I=C?i:s?"butt":n;if(C&&I==="round"&&(P<o?I="miter":P<=2&&(I="fakeround")),I==="miter"&&P>a&&(I="bevel"),I==="bevel"&&(P>2&&(I="flipbevel"),P<a&&(I="miter")),m&&this.updateDistance(m,f),I==="miter")_._mult(P),this.addCurrentVertex(f,_,0,0,h);else if(I==="flipbevel"){if(P>100)_=x.mult(-1);else{let D=P*y.add(x).mag()/y.sub(x).mag();_._perp()._mult(D*(L?-1:1))}this.addCurrentVertex(f,_,0,0,h),this.addCurrentVertex(f,_.mult(-1),0,0,h)}else if(I==="bevel"||I==="fakeround"){let D=-Math.sqrt(P*P-1),F=L?D:0,k=L?0:D;if(m&&this.addCurrentVertex(f,y,F,k,h),I==="fakeround"){let E=Math.round(T*180/Math.PI/cM);for(let O=1;O<E;O++){let X=O/E;if(X!==.5){let fe=X-.5,J=1.0904+v*(-3.2452+v*(3.55645-v*1.43519)),Qe=.848013+v*(-1.06021+v*.215638);X=X+X*fe*(X-1)*(J*fe*fe+Qe)}let H=x.sub(y)._mult(X)._add(y)._unit()._mult(L?-1:1);this.addHalfVertex(f,H.x,H.y,!1,L,0,h)}}g&&this.addCurrentVertex(f,x,-F,-k,h)}else if(I==="butt")this.addCurrentVertex(f,_,0,0,h);else if(I==="square"){let D=m?1:-1;this.addCurrentVertex(f,_,D,D,h)}else I==="round"&&(m&&(this.addCurrentVertex(f,y,0,0,h),this.addCurrentVertex(f,y,1,1,h,!0)),g&&(this.addCurrentVertex(f,x,-1,-1,h,!0),this.addCurrentVertex(f,x,0,0,h)));if(A&&b<l-1){let D=f.dist(g);if(D>2*p){let F=f.add(g.sub(f)._mult(p/D)._round());this.updateDistance(f,F),this.addCurrentVertex(F,x,0,0,h),f=F}}}}addCurrentVertex(e,t,i,n,a,o=!1){let s=t.x+t.y*i,l=t.y-t.x*i,c=-t.x+t.y*n,p=-t.y-t.x*n;this.addHalfVertex(e,s,l,o,!1,i,a),this.addHalfVertex(e,c,p,o,!0,-n,a),this.distance>Zb/2&&this.totalDistance===0&&(this.distance=0,this.updateScaledDistance(),this.addCurrentVertex(e,t,i,n,a,o))}addHalfVertex({x:e,y:t},i,n,a,o,s,l){let p=(this.lineClips?this.scaledDistance*(Zb-1):this.scaledDistance)*Xb;if(this.layoutVertexArray.emplaceBack((e<<1)+(a?1:0),(t<<1)+(o?1:0),Math.round(Hb*i)+128,Math.round(Hb*n)+128,(s===0?0:s<0?-1:1)+1|(p&63)<<2,p>>6),this.lineClips){let f=this.scaledDistance-this.lineClips.start,m=this.lineClips.end-this.lineClips.start,g=f/m;this.layoutVertexArray2.emplaceBack(g,this.lineClipsArray.length)}let h=l.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,h),l.primitiveLength++),o?this.e2=h:this.e1=h}updateScaledDistance(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance}updateDistance(e,t){this.distance+=e.dist(t),this.updateScaledDistance()}};u(wf,"LineBucket");var Fa=wf;G("LineBucket",Fa,{omit:["layers","patternFeatures"]});d();var Kb,hM=u(()=>Kb=Kb||new Re({"line-cap":new $(M.layout_line["line-cap"]),"line-join":new W(M.layout_line["line-join"]),"line-miter-limit":new $(M.layout_line["line-miter-limit"]),"line-round-limit":new $(M.layout_line["line-round-limit"]),"line-sort-key":new W(M.layout_line["line-sort-key"])}),"getLayout"),Yb,fM=u(()=>Yb=Yb||new Re({"line-opacity":new W(M.paint_line["line-opacity"]),"line-color":new W(M.paint_line["line-color"]),"line-translate":new $(M.paint_line["line-translate"]),"line-translate-anchor":new $(M.paint_line["line-translate-anchor"]),"line-width":new W(M.paint_line["line-width"]),"line-gap-width":new W(M.paint_line["line-gap-width"]),"line-offset":new W(M.paint_line["line-offset"]),"line-blur":new W(M.paint_line["line-blur"]),"line-dasharray":new Jr(M.paint_line["line-dasharray"]),"line-pattern":new rr(M.paint_line["line-pattern"]),"line-gradient":new Qr(M.paint_line["line-gradient"])}),"getPaint"),Sf={get paint(){return fM()},get layout(){return hM()}};var Tf=class Tf extends W{possiblyEvaluate(t,i){return i=new ye(Math.floor(i.zoom),{now:i.now,fadeDuration:i.fadeDuration,zoomHistory:i.zoomHistory,transition:i.transition}),super.possiblyEvaluate(t,i)}evaluate(t,i,n,a){return i=R({},i,{zoom:Math.floor(i.zoom)}),super.evaluate(t,i,n,a)}};u(Tf,"LineFloorwidthProperty");var Pf=Tf,Ws,Af=class Af extends je{constructor(t){super(t,Sf);this.gradientVersion=0,Ws||(Ws=new Pf(Sf.paint.properties["line-width"].specification),Ws.useIntegerZoom=!0)}_handleSpecialPaintPropertyUpdate(t){if(t==="line-gradient"){let i=this._transitionablePaint._values["line-gradient"].value.expression;this.stepInterpolant=i._styleExpression.expression instanceof Li,this.gradientVersion=(this.gradientVersion+1)%Number.MAX_SAFE_INTEGER}}gradientExpression(){return this._transitionablePaint._values["line-gradient"].value.expression}recalculate(t,i){super.recalculate(t,i),this.paint._values["line-floorwidth"]=Ws.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,t)}createBucket(t){return new Fa(t)}queryRadius(t){let i=t,n=Jb(oi("line-width",this,i),oi("line-gap-width",this,i)),a=oi("line-offset",this,i);return n/2+Math.abs(a)+Mr(this.paint.get("line-translate"))}queryIntersectsFeature(t,i,n,a,o,s,l){let c=Cr(t,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),s.angle,l),p=l/2*Jb(this.paint.get("line-width").evaluate(i,n),this.paint.get("line-gap-width").evaluate(i,n)),h=this.paint.get("line-offset").evaluate(i,n);return h&&(a=Dx(a,h*l)),Ex(c,a,p)}isTileClipped(){return!0}};u(Af,"LineStyleLayer");var Xs=Af;function Jb(r,e){return e>0?e+2*r:r}u(Jb,"getLineWidth");d();d();d();var Qb=ve([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),e_=ve([{name:"a_projected_pos",components:3,type:"Float32"}],4),bR=ve([{name:"a_fade_opacity",components:1,type:"Uint32"}],4),t_=ve([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}]),_R=ve([{type:"Int16",name:"anchorPointX"},{type:"Int16",name:"anchorPointY"},{type:"Int16",name:"x1"},{type:"Int16",name:"y1"},{type:"Int16",name:"x2"},{type:"Int16",name:"y2"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"}]),If=ve([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),r_=ve([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4),vR=ve([{name:"triangle",components:3,type:"Uint16"}]),wR=ve([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Uint16",name:"glyphStartIndex"},{type:"Uint16",name:"numGlyphs"},{type:"Uint32",name:"vertexStartIndex"},{type:"Uint32",name:"lineStartIndex"},{type:"Uint32",name:"lineLength"},{type:"Uint16",name:"segment"},{type:"Uint16",name:"lowerSize"},{type:"Uint16",name:"upperSize"},{type:"Float32",name:"lineOffsetX"},{type:"Float32",name:"lineOffsetY"},{type:"Uint8",name:"writingMode"},{type:"Uint8",name:"placedOrientation"},{type:"Uint8",name:"hidden"},{type:"Uint32",name:"crossTileID"},{type:"Int16",name:"associatedIconIndex"}]),SR=ve([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Int16",name:"rightJustifiedTextSymbolIndex"},{type:"Int16",name:"centerJustifiedTextSymbolIndex"},{type:"Int16",name:"leftJustifiedTextSymbolIndex"},{type:"Int16",name:"verticalPlacedTextSymbolIndex"},{type:"Int16",name:"placedIconSymbolIndex"},{type:"Int16",name:"verticalPlacedIconSymbolIndex"},{type:"Uint16",name:"key"},{type:"Uint16",name:"textBoxStartIndex"},{type:"Uint16",name:"textBoxEndIndex"},{type:"Uint16",name:"verticalTextBoxStartIndex"},{type:"Uint16",name:"verticalTextBoxEndIndex"},{type:"Uint16",name:"iconBoxStartIndex"},{type:"Uint16",name:"iconBoxEndIndex"},{type:"Uint16",name:"verticalIconBoxStartIndex"},{type:"Uint16",name:"verticalIconBoxEndIndex"},{type:"Uint16",name:"featureIndex"},{type:"Uint16",name:"numHorizontalGlyphVertices"},{type:"Uint16",name:"numVerticalGlyphVertices"},{type:"Uint16",name:"numIconVertices"},{type:"Uint16",name:"numVerticalIconVertices"},{type:"Uint16",name:"useRuntimeCollisionCircles"},{type:"Uint32",name:"crossTileID"},{type:"Float32",name:"textBoxScale"},{type:"Float32",components:2,name:"textOffset"},{type:"Float32",name:"collisionCircleDiameter"}]),PR=ve([{type:"Float32",name:"offsetX"}]),TR=ve([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]);var Oa=ae(Pe(),1);d();function mM(r,e,t){let i=e.layout.get("text-transform").evaluate(t,{});return i==="uppercase"?r=r.toLocaleUpperCase():i==="lowercase"&&(r=r.toLocaleLowerCase()),ft.applyArabicShaping&&(r=ft.applyArabicShaping(r)),r}u(mM,"transformTextInternal");function i_(r,e,t){return r.sections.forEach(i=>{i.text=mM(i.text,e,t)}),r}u(i_,"transformText");d();function n_(r){let e={},t={},i=[],n=0;function a(c){i.push(r[c]),n++}u(a,"add");function o(c,p,h){let f=t[c];return delete t[c],t[p]=f,i[f].geometry[0].pop(),i[f].geometry[0]=i[f].geometry[0].concat(h[0]),f}u(o,"mergeFromRight");function s(c,p,h){let f=e[p];return delete e[p],e[c]=f,i[f].geometry[0].shift(),i[f].geometry[0]=h[0].concat(i[f].geometry[0]),f}u(s,"mergeFromLeft");function l(c,p,h){let f=h?p[0][p[0].length-1]:p[0][0];return"".concat(c,":").concat(f.x,":").concat(f.y)}u(l,"getKey");for(let c=0;c<r.length;c++){let p=r[c],h=p.geometry,f=p.text?p.text.toString():null;if(!f){a(c);continue}let m=l(f,h),g=l(f,h,!0);if(m in t&&g in e&&t[m]!==e[g]){let y=s(m,g,h),x=o(m,g,i[y].geometry);delete e[m],delete t[g],t[l(f,i[x].geometry,!0)]=x,i[y].geometry=null}else m in t?o(m,g,h):g in e?s(m,g,h):(a(c),e[m]=n-1,t[g]=n-1)}return i.filter(c=>c.geometry)}u(n_,"mergeLines");d();d();var a_={"!":"\uFE15","#":"\uFF03",$:"\uFF04","%":"\uFF05","&":"\uFF06","(":"\uFE35",")":"\uFE36","*":"\uFF0A","+":"\uFF0B",",":"\uFE10","-":"\uFE32",".":"\u30FB","/":"\uFF0F",":":"\uFE13",";":"\uFE14","<":"\uFE3F","=":"\uFF1D",">":"\uFE40","?":"\uFE16","@":"\uFF20","[":"\uFE47","\\":"\uFF3C","]":"\uFE48","^":"\uFF3E",_:"\uFE33","`":"\uFF40","{":"\uFE37","|":"\u2015","}":"\uFE38","~":"\uFF5E","\xA2":"\uFFE0","\xA3":"\uFFE1","\xA5":"\uFFE5","\xA6":"\uFFE4","\xAC":"\uFFE2","\xAF":"\uFFE3","\u2013":"\uFE32","\u2014":"\uFE31","\u2018":"\uFE43","\u2019":"\uFE44","\u201C":"\uFE41","\u201D":"\uFE42","\u2026":"\uFE19","\u2027":"\u30FB","\u20A9":"\uFFE6","\u3001":"\uFE11","\u3002":"\uFE12","\u3008":"\uFE3F","\u3009":"\uFE40","\u300A":"\uFE3D","\u300B":"\uFE3E","\u300C":"\uFE41","\u300D":"\uFE42","\u300E":"\uFE43","\u300F":"\uFE44","\u3010":"\uFE3B","\u3011":"\uFE3C","\u3014":"\uFE39","\u3015":"\uFE3A","\u3016":"\uFE17","\u3017":"\uFE18","\uFF01":"\uFE15","\uFF08":"\uFE35","\uFF09":"\uFE36","\uFF0C":"\uFE10","\uFF0D":"\uFE32","\uFF0E":"\u30FB","\uFF1A":"\uFE13","\uFF1B":"\uFE14","\uFF1C":"\uFE3F","\uFF1E":"\uFE40","\uFF1F":"\uFE16","\uFF3B":"\uFE47","\uFF3D":"\uFE48","\uFF3F":"\uFE33","\uFF5B":"\uFE37","\uFF5C":"\u2015","\uFF5D":"\uFE38","\uFF5F":"\uFE35","\uFF60":"\uFE36","\uFF61":"\uFE12","\uFF62":"\uFE41","\uFF63":"\uFE42"};d();var li=24;d();var f_=ae(Ef(),1);var h_=3;function LM(r,e,t){r===1&&t.readMessage(DM,e)}u(LM,"readFontstacks");function DM(r,e,t){if(r===3){let{id:i,bitmap:n,width:a,height:o,left:s,top:l,advance:c}=t.readMessage(zM,{});e.push({id:i,bitmap:new si({width:a+2*h_,height:o+2*h_},n),metrics:{width:a,height:o,left:s,top:l,advance:c}})}}u(DM,"readFontstack");function zM(r,e,t){r===1?e.id=t.readVarint():r===2?e.bitmap=t.readBytes():r===3?e.width=t.readVarint():r===4?e.height=t.readVarint():r===5?e.left=t.readSVarint():r===6?e.top=t.readSVarint():r===7&&(e.advance=t.readVarint())}u(zM,"readGlyph");function m_(r){return new f_.default(r).readFields(LM,[])}u(m_,"parseGlyphPbf");d();d();function Ba(r){let e=0,t=0;for(let s of r)e+=s.w*s.h,t=Math.max(t,s.w);r.sort((s,l)=>l.h-s.h);let n=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(e/.95)),t),h:1/0}],a=0,o=0;for(let s of r)for(let l=n.length-1;l>=0;l--){let c=n[l];if(!(s.w>c.w||s.h>c.h)){if(s.x=c.x,s.y=c.y,o=Math.max(o,s.y+s.h),a=Math.max(a,s.x+s.w),s.w===c.w&&s.h===c.h){let p=n.pop();l<n.length&&(n[l]=p)}else s.h===c.h?(c.x+=s.w,c.w-=s.w):s.w===c.w?(c.y+=s.h,c.h-=s.h):(n.push({x:c.x+s.w,y:c.y,w:c.w-s.w,h:s.h}),c.y+=s.h,c.h-=s.h);break}}return{w:a,h:o,fill:e/(a*o)||0}}u(Ba,"potpack");var xt=1;var Lf=class Lf{constructor(e,{pixelRatio:t,version:i,stretchX:n,stretchY:a,content:o}){this.paddedRect=e,this.pixelRatio=t,this.stretchX=n,this.stretchY=a,this.content=o,this.version=i}get tl(){return[this.paddedRect.x+xt,this.paddedRect.y+xt]}get br(){return[this.paddedRect.x+this.paddedRect.w-xt,this.paddedRect.y+this.paddedRect.h-xt]}get tlbr(){return this.tl.concat(this.br)}get displaySize(){return[(this.paddedRect.w-xt*2)/this.pixelRatio,(this.paddedRect.h-xt*2)/this.pixelRatio]}};u(Lf,"ImagePosition");var tn=Lf,Df=class Df{constructor(e,t){let i={},n={};this.haveRenderCallbacks=[];let a=[];this.addImages(e,i,a),this.addImages(t,n,a);let{w:o,h:s}=Ba(a),l=new Ee({width:o||1,height:s||1});for(let c in e){let p=e[c],h=i[c].paddedRect;Ee.copy(p.data,l,{x:0,y:0},{x:h.x+xt,y:h.y+xt},p.data)}for(let c in t){let p=t[c],h=n[c].paddedRect,f=h.x+xt,m=h.y+xt,g=p.data.width,y=p.data.height;Ee.copy(p.data,l,{x:0,y:0},{x:f,y:m},p.data),Ee.copy(p.data,l,{x:0,y:y-1},{x:f,y:m-1},{width:g,height:1}),Ee.copy(p.data,l,{x:0,y:0},{x:f,y:m+y},{width:g,height:1}),Ee.copy(p.data,l,{x:g-1,y:0},{x:f-1,y:m},{width:1,height:y}),Ee.copy(p.data,l,{x:0,y:0},{x:f+g,y:m},{width:1,height:y})}this.image=l,this.iconPositions=i,this.patternPositions=n}addImages(e,t,i){for(let n in e){let a=e[n],o={x:0,y:0,w:a.data.width+2*xt,h:a.data.height+2*xt};i.push(o),t[n]=new tn(o,a),a.hasRenderCallback&&this.haveRenderCallbacks.push(n)}}patchUpdatedImages(e,t){e.dispatchRenderCallbacks(this.haveRenderCallbacks);for(let i in e.updatedImages)this.patchUpdatedImage(this.iconPositions[i],e.getImage(i),t),this.patchUpdatedImage(this.patternPositions[i],e.getImage(i),t)}patchUpdatedImage(e,t,i){if(!e||!t||e.version===t.version)return;e.version=t.version;let[n,a]=e.tl;i.update(t.data,void 0,{x:n,y:a})}};u(Df,"ImageAtlas");var kf=Df;G("ImagePosition",tn);G("ImageAtlas",kf);var ui=(n=>(n[n.none=0]="none",n[n.horizontal=1]="horizontal",n[n.vertical=2]="vertical",n[n.horizontalOnly=3]="horizontalOnly",n))(ui||{});function Js(r){let e=.5,t=.5;switch(r){case"right":case"top-right":case"bottom-right":e=1;break;case"left":case"top-left":case"bottom-left":e=0;break}switch(r){case"bottom":case"bottom-right":case"bottom-left":t=1;break;case"top":case"top-right":case"top-left":t=0;break}return{horizontalAlign:e,verticalAlign:t}}u(Js,"getAnchorAlignment");var g_=ae(ka(),1);d();var d_=255,Ra=128,Qs=d_*Ra;function zf(r,e){let{expression:t}=e;if(t.kind==="constant")return{kind:"constant",layoutSize:t.evaluate(new ye(r+1))};if(t.kind==="source")return{kind:"source"};{let{zoomStops:i,interpolationType:n}=t,a=0;for(;a<i.length&&i[a]<=r;)a++;a=Math.max(0,a-1);let o=a;for(;o<i.length&&i[o]<r+1;)o++;o=Math.min(i.length-1,o);let s=i[a],l=i[o];if(t.kind==="composite")return{kind:"composite",minZoom:s,maxZoom:l,interpolationType:n};let c=t.evaluate(new ye(s)),p=t.evaluate(new ye(l));return{kind:"camera",minZoom:s,maxZoom:l,minSize:c,maxSize:p,interpolationType:n}}}u(zf,"getSizeData");function rn(r,{uSize:e,uSizeT:t},{lowerSize:i,upperSize:n}){return r.kind==="source"?i/Ra:r.kind==="composite"?ke.number(i/Ra,n/Ra,t):e}u(rn,"evaluateSizeForFeature");function ci(r,e){let t=0,i=0;if(r.kind==="constant")i=r.layoutSize;else if(r.kind!=="source"){let{interpolationType:n,minZoom:a,maxZoom:o}=r,s=n?Te(wt.interpolationFactor(n,e,a,o),0,1):0;r.kind==="camera"?i=ke.number(r.minSize,r.maxSize,s):t=s}return{uSizeT:t,uSize:i}}u(ci,"evaluateSizeForZoom");d();function nn(r,e,t){let i="never",n=r.get(e);return n?i=n:r.get(t)&&(i="always"),i}u(nn,"getOverlapMode");var BM=g_.default.VectorTileFeature.types,RM=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function el(r,e,t,i,n,a,o,s,l,c,p,h,f){let m=s?Math.min(Qs,Math.round(s[0])):0,g=s?Math.min(Qs,Math.round(s[1])):0;r.emplaceBack(e,t,Math.round(i*32),Math.round(n*32),a,o,(m<<1)+(l?1:0),g,c*16,p*16,h*256,f*256)}u(el,"addVertex");function pi(r,e,t){r.emplaceBack(e.x,e.y,t),r.emplaceBack(e.x,e.y,t),r.emplaceBack(e.x,e.y,t),r.emplaceBack(e.x,e.y,t)}u(pi,"addDynamicAttributes");function OM(r){for(let e of r.sections)if(hx(e.text))return!0;return!1}u(OM,"containsRTLText");var Ff=class Ff{constructor(e){this.layoutVertexArray=new Ps,this.indexArray=new nt,this.programConfigurations=e,this.segments=new me,this.dynamicLayoutVertexArray=new Ts,this.opacityVertexArray=new As,this.hasVisibleVertices=!1,this.placedSymbolArray=new da}isEmpty(){return this.layoutVertexArray.length===0&&this.indexArray.length===0&&this.dynamicLayoutVertexArray.length===0&&this.opacityVertexArray.length===0}upload(e,t,i,n){this.isEmpty()||(i&&(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Qb.members),this.indexBuffer=e.createIndexBuffer(this.indexArray,t),this.dynamicLayoutVertexBuffer=e.createVertexBuffer(this.dynamicLayoutVertexArray,e_.members,!0),this.opacityVertexBuffer=e.createVertexBuffer(this.opacityVertexArray,RM,!0),this.opacityVertexBuffer.itemSize=1),(i||n)&&this.programConfigurations.upload(e))}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy())}};u(Ff,"SymbolBuffers");var Va=Ff;G("SymbolBuffers",Va);var Bf=class Bf{constructor(e,t,i){this.layoutVertexArray=new e,this.layoutAttributes=t,this.indexArray=new i,this.segments=new me,this.collisionVertexArray=new Ms}upload(e){this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=e.createVertexBuffer(this.collisionVertexArray,t_.members,!0)}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy())}};u(Bf,"CollisionBuffers");var Ua=Bf;G("CollisionBuffers",Ua);var Rf=class Rf{constructor(e){this.collisionBoxArray=e.collisionBoxArray,this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(l=>l.id),this.index=e.index,this.pixelRatio=e.pixelRatio,this.sourceLayerIndex=e.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=q.identity([]),this.placementViewportMatrix=q.identity([]);let i=this.layers[0]._unevaluatedLayout._values;this.textSizeData=zf(this.zoom,i["text-size"]),this.iconSizeData=zf(this.zoom,i["icon-size"]);let n=this.layers[0].layout,a=n.get("symbol-sort-key"),o=n.get("symbol-z-order");this.canOverlap=nn(n,"text-overlap","text-allow-overlap")!=="never"||nn(n,"icon-overlap","icon-allow-overlap")!=="never"||n.get("text-ignore-placement")||n.get("icon-ignore-placement"),this.sortFeaturesByKey=o!=="viewport-y"&&!a.isConstant();let s=o==="viewport-y"||o==="auto"&&!this.sortFeaturesByKey;this.sortFeaturesByY=s&&this.canOverlap,n.get("symbol-placement")==="point"&&(this.writingModes=n.get("text-writing-mode").map(l=>ui[l])),this.stateDependentLayerIds=this.layers.filter(l=>l.isStateDependent()).map(l=>l.id),this.sourceID=e.sourceID}createArrays(){this.text=new Va(new mt(this.layers,this.zoom,e=>/^text/.test(e))),this.icon=new Va(new mt(this.layers,this.zoom,e=>/^icon/.test(e))),this.glyphOffsetArray=new ga,this.lineVertexArray=new xa,this.symbolInstances=new ya}calculateGlyphDependencies(e,t,i,n,a){for(let o=0;o<e.length;o++)if(t[e.charCodeAt(o)]=!0,(i||n)&&a){let s=a_[e.charAt(o)];s&&(t[s.charCodeAt(0)]=!0)}}populate(e,t,i){let n=this.layers[0],a=n.layout,o=a.get("text-font"),s=a.get("text-field"),l=a.get("icon-image"),c=(s.value.kind!=="constant"||s.value.value instanceof St&&!s.value.value.isEmpty()||s.value.value.toString().length>0)&&(o.value.kind!=="constant"||o.value.value.length>0),p=l.value.kind!=="constant"||!!l.value.value||Object.keys(l.parameters).length>0,h=a.get("symbol-sort-key");if(this.features=[],!c&&!p)return;let f=t.iconDependencies,m=t.glyphDependencies,g=t.availableImages,y=new ye(this.zoom);for(let{feature:x,id:b,index:_,sourceLayerIndex:v}of e){let S=n._featureFilter.needGeometry,P=yt(x,S);if(!n._featureFilter.filter(y,P,i))continue;S||(P.geometry=dt(x));let T;if(c){let I=n.getValueAndResolveTokens("text-field",P,i,g),D=St.factory(I);OM(D)&&(this.hasRTLText=!0),(!this.hasRTLText||Kn()==="unavailable"||this.hasRTLText&&ft.isParsed())&&(T=i_(D,n,P))}let A;if(p){let I=n.getValueAndResolveTokens("icon-image",P,i,g);I instanceof pt?A=I:A=pt.fromString(I)}if(!T&&!A)continue;let L=this.sortFeaturesByKey?h.evaluate(P,{},i):void 0,C={id:b,text:T,icon:A,index:_,sourceLayerIndex:v,geometry:P.geometry,properties:x.properties,type:BM[x.type],sortKey:L};if(this.features.push(C),A&&(f[A.name]=!0),T){let I=o.evaluate(P,{},i).join(","),D=a.get("text-rotation-alignment")!=="viewport"&&a.get("symbol-placement")!=="point";this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(2)>=0;for(let F of T.sections)if(F.image)f[F.image.name]=!0;else{let k=gp(T.toString()),E=F.fontStack||I,O=m[E]=m[E]||{};this.calculateGlyphDependencies(F.text,O,D,this.allowVerticalPlacement,k)}}}a.get("symbol-placement")==="line"&&(this.features=n_(this.features)),this.sortFeaturesByKey&&this.features.sort((x,b)=>x.sortKey-b.sortKey)}update(e,t,i){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(e,t,this.layers,i),this.icon.programConfigurations.updatePaintArrays(e,t,this.layers,i))}isEmpty(){return this.symbolInstances.length===0&&!this.hasRTLText}uploadPending(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload}upload(e){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(e),this.iconCollisionBox.upload(e)),this.text.upload(e,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(e,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0}destroyDebugData(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()}destroy(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()}addToLineVertexArray(e,t){let i=this.lineVertexArray.length;if(e.segment!==void 0){let n=e.dist(t[e.segment+1]),a=e.dist(t[e.segment]),o={};for(let s=e.segment+1;s<t.length;s++)o[s]={x:t[s].x,y:t[s].y,tileUnitDistanceFromAnchor:n},s<t.length-1&&(n+=t[s+1].dist(t[s]));for(let s=e.segment||0;s>=0;s--)o[s]={x:t[s].x,y:t[s].y,tileUnitDistanceFromAnchor:a},s>0&&(a+=t[s-1].dist(t[s]));for(let s=0;s<t.length;s++){let l=o[s];this.lineVertexArray.emplaceBack(l.x,l.y,l.tileUnitDistanceFromAnchor)}}return{lineStartIndex:i,lineLength:this.lineVertexArray.length-i}}addSymbols(e,t,i,n,a,o,s,l,c,p,h,f){let m=e.indexArray,g=e.layoutVertexArray,y=e.segments.prepareSegment(4*t.length,g,m,this.canOverlap?o.sortKey:void 0),x=this.glyphOffsetArray.length,b=y.vertexLength,_=this.allowVerticalPlacement&&s===2?Math.PI/2:0,v=o.text&&o.text.sections;for(let S=0;S<t.length;S++){let{tl:P,tr:T,bl:A,br:L,tex:C,pixelOffsetTL:I,pixelOffsetBR:D,minFontScaleX:F,minFontScaleY:k,glyphOffset:E,isSDF:O,sectionIndex:X}=t[S],H=y.vertexLength,fe=E[1];el(g,l.x,l.y,P.x,fe+P.y,C.x,C.y,i,O,I.x,I.y,F,k),el(g,l.x,l.y,T.x,fe+T.y,C.x+C.w,C.y,i,O,D.x,I.y,F,k),el(g,l.x,l.y,A.x,fe+A.y,C.x,C.y+C.h,i,O,I.x,D.y,F,k),el(g,l.x,l.y,L.x,fe+L.y,C.x+C.w,C.y+C.h,i,O,D.x,D.y,F,k),pi(e.dynamicLayoutVertexArray,l,_),m.emplaceBack(H,H+1,H+2),m.emplaceBack(H+1,H+2,H+3),y.vertexLength+=4,y.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(E[0]),(S===t.length-1||X!==t[S+1].sectionIndex)&&e.programConfigurations.populatePaintArrays(g.length,o,o.index,{},f,v&&v[X])}e.placedSymbolArray.emplaceBack(l.x,l.y,x,this.glyphOffsetArray.length-x,b,c,p,l.segment,i?i[0]:0,i?i[1]:0,n[0],n[1],s,0,!1,0,h)}_addCollisionDebugVertex(e,t,i,n,a,o){return t.emplaceBack(0,0),e.emplaceBack(i.x,i.y,n,a,Math.round(o.x),Math.round(o.y))}addCollisionDebugVertices(e,t,i,n,a,o,s){let l=a.segments.prepareSegment(4,a.layoutVertexArray,a.indexArray),c=l.vertexLength,p=a.layoutVertexArray,h=a.collisionVertexArray,f=s.anchorX,m=s.anchorY;this._addCollisionDebugVertex(p,h,o,f,m,new Oa.default(e,t)),this._addCollisionDebugVertex(p,h,o,f,m,new Oa.default(i,t)),this._addCollisionDebugVertex(p,h,o,f,m,new Oa.default(i,n)),this._addCollisionDebugVertex(p,h,o,f,m,new Oa.default(e,n)),l.vertexLength+=4;let g=a.indexArray;g.emplaceBack(c,c+1),g.emplaceBack(c+1,c+2),g.emplaceBack(c+2,c+3),g.emplaceBack(c+3,c),l.primitiveLength+=4}addDebugCollisionBoxes(e,t,i,n){for(let a=e;a<t;a++){let o=this.collisionBoxArray.get(a),s=o.x1,l=o.y1,c=o.x2,p=o.y2;this.addCollisionDebugVertices(s,l,c,p,n?this.textCollisionBox:this.iconCollisionBox,o.anchorPoint,i)}}generateCollisionDebugBuffers(){this.hasDebugData()&&this.destroyDebugData(),this.textCollisionBox=new Ua(_a,If.members,Tr),this.iconCollisionBox=new Ua(_a,If.members,Tr);for(let e=0;e<this.symbolInstances.length;e++){let t=this.symbolInstances.get(e);this.addDebugCollisionBoxes(t.textBoxStartIndex,t.textBoxEndIndex,t,!0),this.addDebugCollisionBoxes(t.verticalTextBoxStartIndex,t.verticalTextBoxEndIndex,t,!0),this.addDebugCollisionBoxes(t.iconBoxStartIndex,t.iconBoxEndIndex,t,!1),this.addDebugCollisionBoxes(t.verticalIconBoxStartIndex,t.verticalIconBoxEndIndex,t,!1)}}_deserializeCollisionBoxesForSymbol(e,t,i,n,a,o,s,l,c){let p={};for(let h=t;h<i;h++){let f=e.get(h);p.textBox={x1:f.x1,y1:f.y1,x2:f.x2,y2:f.y2,anchorPointX:f.anchorPointX,anchorPointY:f.anchorPointY},p.textFeatureIndex=f.featureIndex;break}for(let h=n;h<a;h++){let f=e.get(h);p.verticalTextBox={x1:f.x1,y1:f.y1,x2:f.x2,y2:f.y2,anchorPointX:f.anchorPointX,anchorPointY:f.anchorPointY},p.verticalTextFeatureIndex=f.featureIndex;break}for(let h=o;h<s;h++){let f=e.get(h);p.iconBox={x1:f.x1,y1:f.y1,x2:f.x2,y2:f.y2,anchorPointX:f.anchorPointX,anchorPointY:f.anchorPointY},p.iconFeatureIndex=f.featureIndex;break}for(let h=l;h<c;h++){let f=e.get(h);p.verticalIconBox={x1:f.x1,y1:f.y1,x2:f.x2,y2:f.y2,anchorPointX:f.anchorPointX,anchorPointY:f.anchorPointY},p.verticalIconFeatureIndex=f.featureIndex;break}return p}deserializeCollisionBoxes(e){this.collisionArrays=[];for(let t=0;t<this.symbolInstances.length;t++){let i=this.symbolInstances.get(t);this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(e,i.textBoxStartIndex,i.textBoxEndIndex,i.verticalTextBoxStartIndex,i.verticalTextBoxEndIndex,i.iconBoxStartIndex,i.iconBoxEndIndex,i.verticalIconBoxStartIndex,i.verticalIconBoxEndIndex))}}hasTextData(){return this.text.segments.get().length>0}hasIconData(){return this.icon.segments.get().length>0}hasDebugData(){return this.textCollisionBox&&this.iconCollisionBox}hasTextCollisionBoxData(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0}hasIconCollisionBoxData(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0}addIndicesForPlacedSymbol(e,t){let i=e.placedSymbolArray.get(t),n=i.vertexStartIndex+i.numGlyphs*4;for(let a=i.vertexStartIndex;a<n;a+=4)e.indexArray.emplaceBack(a,a+1,a+2),e.indexArray.emplaceBack(a+1,a+2,a+3)}getSortedSymbolIndexes(e){if(this.sortedAngle===e&&this.symbolInstanceIndexes!==void 0)return this.symbolInstanceIndexes;let t=Math.sin(e),i=Math.cos(e),n=[],a=[],o=[];for(let s=0;s<this.symbolInstances.length;++s){o.push(s);let l=this.symbolInstances.get(s);n.push(Math.round(t*l.anchorX+i*l.anchorY)|0),a.push(l.featureIndex)}return o.sort((s,l)=>n[s]-n[l]||a[l]-a[s]),o}addToSortKeyRanges(e,t){let i=this.sortKeyRanges[this.sortKeyRanges.length-1];i&&i.sortKey===t?i.symbolInstanceEnd=e+1:this.sortKeyRanges.push({sortKey:t,symbolInstanceStart:e,symbolInstanceEnd:e+1})}sortFeatures(e){if(this.sortFeaturesByY&&this.sortedAngle!==e&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(e),this.sortedAngle=e,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(let t of this.symbolInstanceIndexes){let i=this.symbolInstances.get(t);this.featureSortOrder.push(i.featureIndex),[i.rightJustifiedTextSymbolIndex,i.centerJustifiedTextSymbolIndex,i.leftJustifiedTextSymbolIndex].forEach((n,a,o)=>{n>=0&&o.indexOf(n)===a&&this.addIndicesForPlacedSymbol(this.text,n)}),i.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,i.verticalPlacedTextSymbolIndex),i.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,i.placedIconSymbolIndex),i.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,i.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}};u(Rf,"SymbolBucket");var Gt=Rf;G("SymbolBucket",Gt,{omit:["layers","collisionBoxArray","features","compareText"]});Gt.MAX_GLYPHS=65535;Gt.addDynamicAttributes=pi;d();function x_(r,e){return e.replace(/{([^{}]+)}/g,(t,i)=>i in r?String(r[i]):"")}u(x_,"resolveTokens");d();var b_,VM=u(()=>b_=b_||new Re({"symbol-placement":new $(M.layout_symbol["symbol-placement"]),"symbol-spacing":new $(M.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new $(M.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new W(M.layout_symbol["symbol-sort-key"]),"symbol-z-order":new $(M.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new $(M.layout_symbol["icon-allow-overlap"]),"icon-overlap":new $(M.layout_symbol["icon-overlap"]),"icon-ignore-placement":new $(M.layout_symbol["icon-ignore-placement"]),"icon-optional":new $(M.layout_symbol["icon-optional"]),"icon-rotation-alignment":new $(M.layout_symbol["icon-rotation-alignment"]),"icon-size":new W(M.layout_symbol["icon-size"]),"icon-text-fit":new $(M.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new $(M.layout_symbol["icon-text-fit-padding"]),"icon-image":new W(M.layout_symbol["icon-image"]),"icon-rotate":new W(M.layout_symbol["icon-rotate"]),"icon-padding":new W(M.layout_symbol["icon-padding"]),"icon-keep-upright":new $(M.layout_symbol["icon-keep-upright"]),"icon-offset":new W(M.layout_symbol["icon-offset"]),"icon-anchor":new W(M.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new $(M.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new $(M.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new $(M.layout_symbol["text-rotation-alignment"]),"text-field":new W(M.layout_symbol["text-field"]),"text-font":new W(M.layout_symbol["text-font"]),"text-size":new W(M.layout_symbol["text-size"]),"text-max-width":new W(M.layout_symbol["text-max-width"]),"text-line-height":new $(M.layout_symbol["text-line-height"]),"text-letter-spacing":new W(M.layout_symbol["text-letter-spacing"]),"text-justify":new W(M.layout_symbol["text-justify"]),"text-radial-offset":new W(M.layout_symbol["text-radial-offset"]),"text-variable-anchor":new $(M.layout_symbol["text-variable-anchor"]),"text-variable-anchor-offset":new W(M.layout_symbol["text-variable-anchor-offset"]),"text-anchor":new W(M.layout_symbol["text-anchor"]),"text-max-angle":new $(M.layout_symbol["text-max-angle"]),"text-writing-mode":new $(M.layout_symbol["text-writing-mode"]),"text-rotate":new W(M.layout_symbol["text-rotate"]),"text-padding":new $(M.layout_symbol["text-padding"]),"text-keep-upright":new $(M.layout_symbol["text-keep-upright"]),"text-transform":new W(M.layout_symbol["text-transform"]),"text-offset":new W(M.layout_symbol["text-offset"]),"text-allow-overlap":new $(M.layout_symbol["text-allow-overlap"]),"text-overlap":new $(M.layout_symbol["text-overlap"]),"text-ignore-placement":new $(M.layout_symbol["text-ignore-placement"]),"text-optional":new $(M.layout_symbol["text-optional"])}),"getLayout"),__,UM=u(()=>__=__||new Re({"icon-opacity":new W(M.paint_symbol["icon-opacity"]),"icon-color":new W(M.paint_symbol["icon-color"]),"icon-halo-color":new W(M.paint_symbol["icon-halo-color"]),"icon-halo-width":new W(M.paint_symbol["icon-halo-width"]),"icon-halo-blur":new W(M.paint_symbol["icon-halo-blur"]),"icon-translate":new $(M.paint_symbol["icon-translate"]),"icon-translate-anchor":new $(M.paint_symbol["icon-translate-anchor"]),"text-opacity":new W(M.paint_symbol["text-opacity"]),"text-color":new W(M.paint_symbol["text-color"],{runtimeType:Lt,getOverride:r=>r.textColor,hasOverride:r=>!!r.textColor}),"text-halo-color":new W(M.paint_symbol["text-halo-color"]),"text-halo-width":new W(M.paint_symbol["text-halo-width"]),"text-halo-blur":new W(M.paint_symbol["text-halo-blur"]),"text-translate":new $(M.paint_symbol["text-translate"]),"text-translate-anchor":new $(M.paint_symbol["text-translate-anchor"])}),"getPaint"),tl={get paint(){return UM()},get layout(){return VM()}};d();var Of=class Of{constructor(e){if(e.property.overrides===void 0)throw new Error("overrides must be provided to instantiate FormatSectionOverride class");this.type=e.property.overrides?e.property.overrides.runtimeType:zi,this.defaultValue=e}evaluate(e){if(e.formattedSection){let t=this.defaultValue.property.overrides;if(t&&t.hasOverride(e.formattedSection))return t.getOverride(e.formattedSection)}return e.feature&&e.featureState?this.defaultValue.evaluate(e.feature,e.featureState):this.defaultValue.property.specification.default}eachChild(e){if(!this.defaultValue.isConstant()){let t=this.defaultValue.value;e(t._styleExpression.expression)}}outputDefined(){return!1}serialize(){return null}};u(Of,"FormatSectionOverride");var Na=Of;G("FormatSectionOverride",Na,{omit:["defaultValue"]});var Ga=class Ga extends je{constructor(t){super(t,tl)}recalculate(t,i){if(super.recalculate(t,i),this.layout.get("icon-rotation-alignment")==="auto"&&(this.layout.get("symbol-placement")!=="point"?this.layout._values["icon-rotation-alignment"]="map":this.layout._values["icon-rotation-alignment"]="viewport"),this.layout.get("text-rotation-alignment")==="auto"&&(this.layout.get("symbol-placement")!=="point"?this.layout._values["text-rotation-alignment"]="map":this.layout._values["text-rotation-alignment"]="viewport"),this.layout.get("text-pitch-alignment")==="auto"&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")==="map"?"map":"viewport"),this.layout.get("icon-pitch-alignment")==="auto"&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),this.layout.get("symbol-placement")==="point"){let n=this.layout.get("text-writing-mode");if(n){let a=[];for(let o of n)a.indexOf(o)<0&&a.push(o);this.layout._values["text-writing-mode"]=a}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()}getValueAndResolveTokens(t,i,n,a){let o=this.layout.get(t).evaluate(i,{},n,a),s=this._unevaluatedLayout._values[t];return!s.isDataDriven()&&!Wn(s.value)&&o?x_(i.properties,o):o}createBucket(t){return new Gt(t)}queryRadius(){return 0}queryIntersectsFeature(){throw new Error("Should take a different path in FeatureIndex")}_setPaintOverrides(){for(let t of tl.paint.overridableProperties){if(!Ga.hasPaintOverride(this.layout,t))continue;let i=this.paint.get(t),n=new Na(i),a=new Zr(n,i.property.specification),o=null;i.value.kind==="constant"||i.value.kind==="source"?o=new xr("source",a):o=new br("composite",a,i.value.zoomStops),this.paint._values[t]=new at(i.property,o,i.parameters)}}_handleOverridablePaintPropertyUpdate(t,i,n){return!this.layout||i.isDataDriven()||n.isDataDriven()?!1:Ga.hasPaintOverride(this.layout,t)}static hasPaintOverride(t,i){let n=t.get("text-field"),a=tl.paint.properties[i],o=!1,s=u(l=>{for(let c of l)if(a.overrides&&a.overrides.hasOverride(c)){o=!0;return}},"checkSections");if(n.value.kind==="constant"&&n.value.value instanceof St)s(n.value.value.sections);else if(n.value.kind==="source"){let l=u(p=>{if(!o)if(p instanceof yr&&We(p.value)===Fi){let h=p.value;s(h.sections)}else p instanceof qn?s(p.sections):p.eachChild(l)},"checkExpression"),c=n.value;c._styleExpression&&l(c._styleExpression.expression)}return o}};u(Ga,"SymbolStyleLayer");var rl=Ga;d();d();var v_,NM=u(()=>v_=v_||new Re({"background-color":new $(M.paint_background["background-color"]),"background-pattern":new Jr(M.paint_background["background-pattern"]),"background-opacity":new $(M.paint_background["background-opacity"])}),"getPaint"),w_={get paint(){return NM()}};var Vf=class Vf extends je{constructor(t){super(t,w_)}};u(Vf,"BackgroundStyleLayer");var il=Vf;d();d();var S_,GM=u(()=>S_=S_||new Re({"raster-opacity":new $(M.paint_raster["raster-opacity"]),"raster-hue-rotate":new $(M.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new $(M.paint_raster["raster-brightness-min"]),"raster-brightness-max":new $(M.paint_raster["raster-brightness-max"]),"raster-saturation":new $(M.paint_raster["raster-saturation"]),"raster-contrast":new $(M.paint_raster["raster-contrast"]),"raster-resampling":new $(M.paint_raster["raster-resampling"]),"raster-fade-duration":new $(M.paint_raster["raster-fade-duration"])}),"getPaint"),P_={get paint(){return GM()}};var Uf=class Uf extends je{constructor(t){super(t,P_)}};u(Uf,"RasterStyleLayer");var nl=Uf;d();function T_(r){let e=[],t=r.id;return t===void 0&&e.push({message:"layers.".concat(t,': missing required property "id"')}),r.render===void 0&&e.push({message:"layers.".concat(t,': missing required method "render"')}),r.renderingMode&&r.renderingMode!=="2d"&&r.renderingMode!=="3d"&&e.push({message:"layers.".concat(t,': property "renderingMode" must be either "2d" or "3d"')}),e}u(T_,"validateCustomStyleLayer");var Nf=class Nf extends je{constructor(t){super(t,{});this.onAdd=u(t=>{this.implementation.onAdd&&this.implementation.onAdd(t,t.painter.context.gl)},"onAdd");this.onRemove=u(t=>{this.implementation.onRemove&&this.implementation.onRemove(t,t.painter.context.gl)},"onRemove");this.implementation=t}is3D(){return this.implementation.renderingMode==="3d"}hasOffscreenPass(){return this.implementation.prerender!==void 0}recalculate(){}updateTransitions(){}hasTransition(){return!1}serialize(){throw new Error("Custom layers cannot be serialized")}};u(Nf,"CustomStyleLayer");var al=Nf;function ol(r){if(r.type==="custom")return new al(r);switch(r.type){case"background":return new il(r);case"circle":return new Os(r);case"fill":return new js(r);case"fill-extrusion":return new Zs(r);case"heatmap":return new Gs(r);case"hillshade":return new qs(r);case"line":return new Xs(r);case"raster":return new nl(r);case"symbol":return new rl(r)}}u(ol,"createStyleLayer");d();d();function an(r){let e=[];if(typeof r=="string")e.push({id:"default",url:r});else if(r&&r.length>0){let t=[];for(let{id:i,url:n}of r){let a="".concat(i).concat(n);t.indexOf(a)===-1&&(t.push(a),e.push({id:i,url:n}))}}return e}u(an,"coerceSpriteToArray");function I_(r,e,t,i){let n=an(r),a=n.length,o=t>1?"@2x":"",s={},l={},c={};for(let{id:p,url:h}of n){let f=e.transformRequest(e.normalizeSpriteURL(h,o,".json"),"SpriteJSON"),m="".concat(p,"_").concat(f.url);s[m]=fr(f,(x,b)=>{delete s[m],l[p]=b,A_(i,l,c,x,a)});let g=e.transformRequest(e.normalizeSpriteURL(h,o,".png"),"SpriteImage"),y="".concat(p,"_").concat(g.url);s[y]=ot.getImage(g,(x,b)=>{delete s[y],c[p]=b,A_(i,l,c,x,a)})}return{cancel(){for(let p of Object.values(s))p.cancel()}}}u(I_,"loadSprite");function A_(r,e,t,i,n){if(i){r(i);return}if(n!==Object.values(e).length||n!==Object.values(t).length)return;let a={};for(let o in e){a[o]={};let s=ne.getImageCanvasContext(t[o]),l=e[o];for(let c in l){let{width:p,height:h,x:f,y:m,sdf:g,pixelRatio:y,stretchX:x,stretchY:b,content:_}=l[c],v={width:p,height:h,x:f,y:m,context:s};a[o][c]={data:null,pixelRatio:y,sdf:g,stretchX:x,stretchY:b,content:_,spriteData:v}}}r(null,a)}u(A_,"doOnceCompleted");d();d();var Gf=class Gf{constructor(e,t,i,n){this.context=e,this.format=i,this.texture=e.gl.createTexture(),this.update(t,n)}update(e,t,i){let{width:n,height:a}=e,o=(!this.size||this.size[0]!==n||this.size[1]!==a)&&!i,{context:s}=this,{gl:l}=s;if(this.useMipmap=!!(t&&t.useMipmap),l.bindTexture(l.TEXTURE_2D,this.texture),s.pixelStoreUnpackFlipY.set(!1),s.pixelStoreUnpack.set(1),s.pixelStoreUnpackPremultiplyAlpha.set(this.format===l.RGBA&&(!t||t.premultiply!==!1)),o)this.size=[n,a],e instanceof HTMLImageElement||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement||e instanceof ImageData||Ct(e)?l.texImage2D(l.TEXTURE_2D,0,this.format,this.format,l.UNSIGNED_BYTE,e):l.texImage2D(l.TEXTURE_2D,0,this.format,n,a,0,this.format,l.UNSIGNED_BYTE,e.data);else{let{x:c,y:p}=i||{x:0,y:0};e instanceof HTMLImageElement||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement||e instanceof ImageData||Ct(e)?l.texSubImage2D(l.TEXTURE_2D,0,c,p,l.RGBA,l.UNSIGNED_BYTE,e):l.texSubImage2D(l.TEXTURE_2D,0,c,p,n,a,l.RGBA,l.UNSIGNED_BYTE,e.data)}this.useMipmap&&this.isSizePowerOfTwo()&&l.generateMipmap(l.TEXTURE_2D)}bind(e,t,i){let{context:n}=this,{gl:a}=n;a.bindTexture(a.TEXTURE_2D,this.texture),i===a.LINEAR_MIPMAP_NEAREST&&!this.isSizePowerOfTwo()&&(i=a.LINEAR),e!==this.filter&&(a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MAG_FILTER,e),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MIN_FILTER,i||e),this.filter=e),t!==this.wrap&&(a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_S,t),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_T,t),this.wrap=t)}isSizePowerOfTwo(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1===0}destroy(){let{gl:e}=this.context;e.deleteTexture(this.texture),this.texture=null}};u(Gf,"Texture");var be=Gf;d();function M_(r){let{userImage:e}=r;return e&&e.render&&e.render()?(r.data.replace(new Uint8Array(e.data.buffer)),!0):!1}u(M_,"renderStyleImage");var sl=1,qf=class qf extends de{constructor(){super();this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new Ee({width:1,height:1}),this.dirty=!0}isLoaded(){return this.loaded}setLoaded(t){if(this.loaded!==t&&(this.loaded=t,t)){for(let{ids:i,callback:n}of this.requestors)this._notify(i,n);this.requestors=[]}}getImage(t){let i=this.images[t];if(i&&!i.data&&i.spriteData){let n=i.spriteData;i.data=new Ee({width:n.width,height:n.height},n.context.getImageData(n.x,n.y,n.width,n.height).data),i.spriteData=null}return i}addImage(t,i){if(this.images[t])throw new Error("Image id ".concat(t," already exist, use updateImage instead"));this._validate(t,i)&&(this.images[t]=i)}_validate(t,i){let n=!0,a=i.data||i.spriteData;return this._validateStretch(i.stretchX,a&&a.width)||(this.fire(new Z(new Error('Image "'.concat(t,'" has invalid "stretchX" value')))),n=!1),this._validateStretch(i.stretchY,a&&a.height)||(this.fire(new Z(new Error('Image "'.concat(t,'" has invalid "stretchY" value')))),n=!1),this._validateContent(i.content,i)||(this.fire(new Z(new Error('Image "'.concat(t,'" has invalid "content" value')))),n=!1),n}_validateStretch(t,i){if(!t)return!0;let n=0;for(let a of t){if(a[0]<n||a[1]<a[0]||i<a[1])return!1;n=a[1]}return!0}_validateContent(t,i){if(!t)return!0;if(t.length!==4)return!1;let n=i.spriteData,a=n&&n.width||i.data.width,o=n&&n.height||i.data.height;return!(t[0]<0||a<t[0]||t[1]<0||o<t[1]||t[2]<0||a<t[2]||t[3]<0||o<t[3]||t[2]<t[0]||t[3]<t[1])}updateImage(t,i,n=!0){let a=this.getImage(t);if(n&&(a.data.width!==i.data.width||a.data.height!==i.data.height))throw new Error("size mismatch between old image (".concat(a.data.width,"x").concat(a.data.height,") and new image (").concat(i.data.width,"x").concat(i.data.height,")."));i.version=a.version+1,this.images[t]=i,this.updatedImages[t]=!0}removeImage(t){let i=this.images[t];delete this.images[t],delete this.patterns[t],i.userImage&&i.userImage.onRemove&&i.userImage.onRemove()}listImages(){return Object.keys(this.images)}getImages(t,i){let n=!0;if(!this.isLoaded())for(let a of t)this.images[a]||(n=!1);this.isLoaded()||n?this._notify(t,i):this.requestors.push({ids:t,callback:i})}_notify(t,i){let n={};for(let a of t){let o=this.getImage(a);o||(this.fire(new z("styleimagemissing",{id:a})),o=this.getImage(a)),o?n[a]={data:o.data.clone(),pixelRatio:o.pixelRatio,sdf:o.sdf,version:o.version,stretchX:o.stretchX,stretchY:o.stretchY,content:o.content,hasRenderCallback:!!(o.userImage&&o.userImage.render)}:Ce('Image "'.concat(a,'" could not be loaded. Please make sure you have added the image with map.addImage() or a "sprite" property in your style. You can provide missing images by listening for the "styleimagemissing" map event.'))}i(null,n)}getPixelSize(){let{width:t,height:i}=this.atlasImage;return{width:t,height:i}}getPattern(t){let i=this.patterns[t],n=this.getImage(t);if(!n)return null;if(i&&i.position.version===n.version)return i.position;if(i)i.position.version=n.version;else{let a=n.data.width+sl*2,o=n.data.height+sl*2,s={w:a,h:o,x:0,y:0},l=new tn(s,n);this.patterns[t]={bin:s,position:l}}return this._updatePatternAtlas(),this.patterns[t].position}bind(t){let i=t.gl;this.atlasTexture?this.dirty&&(this.atlasTexture.update(this.atlasImage),this.dirty=!1):this.atlasTexture=new be(t,this.atlasImage,i.RGBA),this.atlasTexture.bind(i.LINEAR,i.CLAMP_TO_EDGE)}_updatePatternAtlas(){let t=[];for(let o in this.patterns)t.push(this.patterns[o].bin);let{w:i,h:n}=Ba(t),a=this.atlasImage;a.resize({width:i||1,height:n||1});for(let o in this.patterns){let{bin:s}=this.patterns[o],l=s.x+sl,c=s.y+sl,p=this.getImage(o).data,h=p.width,f=p.height;Ee.copy(p,a,{x:0,y:0},{x:l,y:c},{width:h,height:f}),Ee.copy(p,a,{x:0,y:f-1},{x:l,y:c-1},{width:h,height:1}),Ee.copy(p,a,{x:0,y:0},{x:l,y:c+f},{width:h,height:1}),Ee.copy(p,a,{x:h-1,y:0},{x:l-1,y:c},{width:1,height:f}),Ee.copy(p,a,{x:0,y:0},{x:l+h,y:c},{width:1,height:f})}this.dirty=!0}beginFrame(){this.callbackDispatchedThisFrame={}}dispatchRenderCallbacks(t){for(let i of t){if(this.callbackDispatchedThisFrame[i])continue;this.callbackDispatchedThisFrame[i]=!0;let n=this.getImage(i);n||Ce('Image with ID: "'.concat(i,'" was not found')),M_(n)&&this.updateImage(i,n)}}};u(qf,"ImageManager");var ll=qf;d();d();function C_(r,e,t,i,n){let a=e*256,o=a+255,s=i.transformRequest(t.replace("{fontstack}",r).replace("{range}","".concat(a,"-").concat(o)),"Glyphs");xo(s,(l,c)=>{if(l)n(l);else if(c){let p={};for(let h of m_(c))p[h.id]=h;n(null,p)}})}u(C_,"loadGlyphRange");d();var jf=class jf{constructor({fontSize:e=24,buffer:t=3,radius:i=8,cutoff:n=.25,fontFamily:a="sans-serif",fontWeight:o="normal",fontStyle:s="normal"}={}){this.buffer=t,this.cutoff=n,this.radius=i;let l=this.size=e+t*4,c=this._createCanvas(l),p=this.ctx=c.getContext("2d",{willReadFrequently:!0});p.font="".concat(s," ").concat(o," ").concat(e,"px ").concat(a),p.textBaseline="alphabetic",p.textAlign="left",p.fillStyle="black",this.gridOuter=new Float64Array(l*l),this.gridInner=new Float64Array(l*l),this.f=new Float64Array(l),this.z=new Float64Array(l+1),this.v=new Uint16Array(l)}_createCanvas(e){let t=document.createElement("canvas");return t.width=t.height=e,t}draw(e){let{width:t,actualBoundingBoxAscent:i,actualBoundingBoxDescent:n,actualBoundingBoxLeft:a,actualBoundingBoxRight:o}=this.ctx.measureText(e),s=Math.ceil(i),l=0,c=Math.max(0,Math.min(this.size-this.buffer,Math.ceil(o-a))),p=Math.min(this.size-this.buffer,s+Math.ceil(n)),h=c+2*this.buffer,f=p+2*this.buffer,m=Math.max(h*f,0),g=new Uint8ClampedArray(m),y={data:g,width:h,height:f,glyphWidth:c,glyphHeight:p,glyphTop:s,glyphLeft:l,glyphAdvance:t};if(c===0||p===0)return y;let{ctx:x,buffer:b,gridInner:_,gridOuter:v}=this;x.clearRect(b,b,c,p),x.fillText(e,b,b+s);let S=x.getImageData(b,b,c,p);v.fill(1e20,0,m),_.fill(0,0,m);for(let P=0;P<p;P++)for(let T=0;T<c;T++){let A=S.data[4*(P*c+T)+3]/255;if(A===0)continue;let L=(P+b)*h+T+b;if(A===1)v[L]=0,_[L]=1e20;else{let C=.5-A;v[L]=C>0?C*C:0,_[L]=C<0?C*C:0}}E_(v,0,0,h,f,h,this.f,this.v,this.z),E_(_,b,b,c,p,h,this.f,this.v,this.z);for(let P=0;P<m;P++){let T=Math.sqrt(v[P])-Math.sqrt(_[P]);g[P]=Math.round(255-255*(T/this.radius+this.cutoff))}return y}};u(jf,"TinySDF");var qa=jf;function E_(r,e,t,i,n,a,o,s,l){for(let c=e;c<e+i;c++)k_(r,t*a+c,a,n,o,s,l);for(let c=t;c<t+n;c++)k_(r,c*a+e,1,i,o,s,l)}u(E_,"edt");function k_(r,e,t,i,n,a,o){a[0]=0,o[0]=-1e20,o[1]=1e20,n[0]=r[e];for(let s=1,l=0,c=0;s<i;s++){n[s]=r[e+s*t];let p=s*s;do{let h=a[l];c=(n[s]-n[h]+p-h*h)/(s-h)/2}while(c<=o[l]&&--l>-1);l++,a[l]=s,o[l]=c,o[l+1]=1e20}for(let s=0,l=0;s<i;s++){for(;o[l+1]<s;)l++;let c=a[l],p=s-c;r[e+s*t]=n[c]+p*p}}u(k_,"edt1d");var hi=class hi{constructor(e,t){this.requestManager=e,this.localIdeographFontFamily=t,this.entries={}}setURL(e){this.url=e}getGlyphs(e,t){let i=[];for(let n in e)for(let a of e[n])i.push({stack:n,id:a});ho(i,({stack:n,id:a},o)=>{let s=this.entries[n];s||(s=this.entries[n]={glyphs:{},requests:{},ranges:{}});let l=s.glyphs[a];if(l!==void 0){o(null,{stack:n,id:a,glyph:l});return}if(l=this._tinySDF(s,n,a),l){s.glyphs[a]=l,o(null,{stack:n,id:a,glyph:l});return}let c=Math.floor(a/256);if(c*256>65535){o(new Error("glyphs > 65535 not supported"));return}if(s.ranges[c]){o(null,{stack:n,id:a,glyph:l});return}if(!this.url){o(new Error("glyphsUrl is not set"));return}let p=s.requests[c];p||(p=s.requests[c]=[],hi.loadGlyphRange(n,c,this.url,this.requestManager,(h,f)=>{if(f){for(let m in f)this._doesCharSupportLocalGlyph(+m)||(s.glyphs[+m]=f[+m]);s.ranges[c]=!0}for(let m of p)m(h,f);delete s.requests[c]})),p.push((h,f)=>{h?o(h):f&&o(null,{stack:n,id:a,glyph:f[a]||null})})},(n,a)=>{if(n)t(n);else if(a){let o={};for(let{stack:s,id:l,glyph:c}of a)(o[s]||(o[s]={}))[l]=c&&{id:c.id,bitmap:c.bitmap.clone(),metrics:c.metrics};t(null,o)}})}_doesCharSupportLocalGlyph(e){return!!this.localIdeographFontFamily&&(pe["CJK Unified Ideographs"](e)||pe["Hangul Syllables"](e)||pe.Hiragana(e)||pe.Katakana(e))}_tinySDF(e,t,i){let n=this.localIdeographFontFamily;if(!n||!this._doesCharSupportLocalGlyph(i))return;let a=e.tinySDF;if(!a){let l="400";/bold/i.test(t)?l="900":/medium/i.test(t)?l="500":/light/i.test(t)&&(l="200"),a=e.tinySDF=new hi.TinySDF({fontSize:24,buffer:3,radius:8,cutoff:.25,fontFamily:n,fontWeight:l})}let o=a.draw(String.fromCharCode(i)),s=27;return{id:i,bitmap:new si({width:o.width||30,height:o.height||30},o.data),metrics:{width:o.glyphWidth||24,height:o.glyphHeight||24,left:o.glyphLeft||0,top:o.glyphTop-s||-8,advance:o.glyphAdvance||24}}}};u(hi,"GlyphManager"),hi.loadGlyphRange=C_,hi.TinySDF=qa;var ul=hi;d();var Zf=class Zf{constructor(){this.specification=M.light.position}possiblyEvaluate(e,t){return Qy(e.expression.evaluate(t))}interpolate(e,t,i){return{x:ke.number(e.x,t.x,i),y:ke.number(e.y,t.y,i),z:ke.number(e.z,t.z,i)}}};u(Zf,"LightPositionProperty");var Hf=Zf,L_="-transition",$f,Wf=class Wf extends de{constructor(t){super();$f=$f||new Re({anchor:new $(M.light.anchor),position:new Hf,color:new $(M.light.color),intensity:new $(M.light.intensity)}),this._transitionable=new Gi($f),this.setLight(t),this._transitioning=this._transitionable.untransitioned()}getLight(){return this._transitionable.serialize()}setLight(t,i={}){if(!this._validate(ox,t,i))for(let n in t){let a=t[n];n.endsWith(L_)?this._transitionable.setTransition(n.slice(0,-L_.length),a):this._transitionable.setValue(n,a)}}updateTransitions(t){this._transitioning=this._transitionable.transitioned(t,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(t){this.properties=this._transitioning.possiblyEvaluate(t)}_validate(t,i,n){return n&&n.validate===!1?!1:Ri(this,t.call(qe,R({value:i,style:{glyphs:!0,sprite:!0},styleSpec:M})))}};u(Wf,"Light");var cl=Wf;d();var Xf=class Xf{constructor(e,t){this.width=e,this.height=t,this.nextRow=0,this.data=new Uint8Array(this.width*this.height),this.dashEntry={}}getDash(e,t){let i=e.join(",")+String(t);return this.dashEntry[i]||(this.dashEntry[i]=this.addDash(e,t)),this.dashEntry[i]}getDashRanges(e,t,i){let n=e.length%2===1,a=[],o=n?-e[e.length-1]*i:0,s=e[0]*i,l=!0;a.push({left:o,right:s,isDash:l,zeroLength:e[0]===0});let c=e[0];for(let p=1;p<e.length;p++){l=!l;let h=e[p];o=c*i,c+=h,s=c*i,a.push({left:o,right:s,isDash:l,zeroLength:h===0})}return a}addRoundDash(e,t,i){let n=t/2;for(let a=-i;a<=i;a++){let o=this.nextRow+i+a,s=this.width*o,l=0,c=e[l];for(let p=0;p<this.width;p++){p/c.right>1&&(c=e[++l]);let h=Math.abs(p-c.left),f=Math.abs(p-c.right),m=Math.min(h,f),g,y=a/i*(n+1);if(c.isDash){let x=n-Math.abs(y);g=Math.sqrt(m*m+x*x)}else g=n-Math.sqrt(m*m+y*y);this.data[s+p]=Math.max(0,Math.min(255,g+128))}}}addRegularDash(e){for(let s=e.length-1;s>=0;--s){let l=e[s],c=e[s+1];l.zeroLength?e.splice(s,1):c&&c.isDash===l.isDash&&(c.left=l.left,e.splice(s,1))}let t=e[0],i=e[e.length-1];t.isDash===i.isDash&&(t.left=i.left-this.width,i.right=t.right+this.width);let n=this.width*this.nextRow,a=0,o=e[a];for(let s=0;s<this.width;s++){s/o.right>1&&(o=e[++a]);let l=Math.abs(s-o.left),c=Math.abs(s-o.right),p=Math.min(l,c),h=o.isDash?p:-p;this.data[n+s]=Math.max(0,Math.min(255,h+128))}}addDash(e,t){let i=t?7:0,n=2*i+1;if(this.nextRow+n>this.height)return Ce("LineAtlas out of space"),null;let a=0;for(let s=0;s<e.length;s++)a+=e[s];if(a!==0){let s=this.width/a,l=this.getDashRanges(e,this.width,s);t?this.addRoundDash(l,s,i):this.addRegularDash(l)}let o={y:(this.nextRow+i+.5)/this.height,height:2*i/this.height,width:a};return this.nextRow+=n,this.dirty=!0,o}bind(e){let t=e.gl;this.texture?(t.bindTexture(t.TEXTURE_2D,this.texture),this.dirty&&(this.dirty=!1,t.texSubImage2D(t.TEXTURE_2D,0,0,0,this.width,this.height,t.ALPHA,t.UNSIGNED_BYTE,this.data))):(this.texture=t.createTexture(),t.bindTexture(t.TEXTURE_2D,this.texture),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.REPEAT),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.REPEAT),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texImage2D(t.TEXTURE_2D,0,t.ALPHA,this.width,this.height,0,t.ALPHA,t.UNSIGNED_BYTE,this.data))}};u(Xf,"LineAtlas");var pl=Xf;d();d();d();var Kf=class Kf{constructor(e){this._callback=e,this._triggered=!1,typeof MessageChannel<"u"&&(this._channel=new MessageChannel,this._channel.port2.onmessage=()=>{this._triggered=!1,this._callback()})}trigger(){this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout(()=>{this._triggered=!1,this._callback()},0))}remove(){delete this._channel,this._callback=()=>{}}};u(Kf,"ThrottledInvoker");var hl=Kf;var Yf=class Yf{constructor(e,t,i){this.receive=u(e=>{let t=e.data,i=t.id;if(i&&!(t.targetMapId&&this.mapId!==t.targetMapId))if(t.type==="<cancel>"){delete this.tasks[i];let n=this.cancelCallbacks[i];delete this.cancelCallbacks[i],n&&n()}else ct()||t.mustQueue?(this.tasks[i]=t,this.taskQueue.push(i),this.invoker.trigger()):this.processTask(i,t)},"receive");this.process=u(()=>{if(!this.taskQueue.length)return;let e=this.taskQueue.shift(),t=this.tasks[e];delete this.tasks[e],this.taskQueue.length&&this.invoker.trigger(),t&&this.processTask(e,t)},"process");this.target=e,this.parent=t,this.mapId=i,this.callbacks={},this.tasks={},this.taskQueue=[],this.cancelCallbacks={},this.invoker=new hl(this.process),this.target.addEventListener("message",this.receive,!1),this.globalScope=ct()?e:window}send(e,t,i,n,a=!1){let o=Math.round(Math.random()*1e18).toString(36).substring(0,10);i&&(this.callbacks[o]=i);let s=qr(this.globalScope)?void 0:[];return this.target.postMessage({id:o,type:e,hasCallback:!!i,targetMapId:n,mustQueue:a,sourceMapId:this.mapId,data:Oi(t,s)},s),{cancel:()=>{i&&delete this.callbacks[o],this.target.postMessage({id:o,type:"<cancel>",targetMapId:n,sourceMapId:this.mapId})}}}processTask(e,t){if(t.type==="<response>"){let i=this.callbacks[e];delete this.callbacks[e],i&&(t.error?i(Vi(t.error)):i(null,Vi(t.data)))}else{let i=!1,n=qr(this.globalScope)?void 0:[],a=t.hasCallback?(l,c)=>{i=!0,delete this.cancelCallbacks[e],this.target.postMessage({id:e,type:"<response>",sourceMapId:this.mapId,error:l?Oi(l):null,data:Oi(c,n)},n)}:l=>{i=!0},o=null,s=Vi(t.data);if(this.parent[t.type])o=this.parent[t.type](t.sourceMapId,s,a);else if(this.parent.getWorkerSource){let l=t.type.split(".");o=this.parent.getWorkerSource(t.sourceMapId,l[0],s.source)[l[1]](s,a)}else a(new Error("Could not find function ".concat(t.type)));!i&&o&&o.cancel&&(this.cancelCallbacks[e]=o.cancel)}}remove(){this.invoker.remove(),this.target.removeEventListener("message",this.receive,!1)}};u(Yf,"Actor");var fl=Yf;var ml=class ml{constructor(e,t,i){this.workerPool=e,this.actors=[],this.currentActor=0,this.id=i;let n=this.workerPool.acquire(i);for(let a=0;a<n.length;a++){let o=n[a],s=new ml.Actor(o,t,i);s.name="Worker ".concat(a),this.actors.push(s)}if(!this.actors.length)throw new Error("No actors found")}broadcast(e,t,i){i=i||function(){},ho(this.actors,(n,a)=>{n.send(e,t,a)},i)}getActor(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]}remove(e=!0){this.actors.forEach(t=>{t.remove()}),this.actors=[],e&&this.workerPool.release(this.id)}};u(ml,"Dispatcher");var ja=ml;ja.Actor=fl;d();d();d();function dl(r,e,t){let i=u(function(n,a){if(n)return t(n);if(a){let o=Bt(R(a,r),["tiles","minzoom","maxzoom","attribution","bounds","scheme","tileSize","encoding"]);a.vector_layers&&(o.vectorLayers=a.vector_layers,o.vectorLayerIds=o.vectorLayers.map(s=>s.id)),t(null,o)}},"loaded");return r.url?fr(e.transformRequest(r.url,"Source"),i):ne.frame(()=>i(null,r))}u(dl,"loadTileJson");d();d();d();var mi=63710088e-1,fi=class fi{constructor(e,t){if(isNaN(e)||isNaN(t))throw new Error("Invalid LngLat object: (".concat(e,", ").concat(t,")"));if(this.lng=+e,this.lat=+t,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new fi(Yt(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return"LngLat(".concat(this.lng,", ").concat(this.lat,")")}distanceTo(e){let t=Math.PI/180,i=this.lat*t,n=e.lat*t,a=Math.sin(i)*Math.sin(n)+Math.cos(i)*Math.cos(n)*Math.cos((e.lng-this.lng)*t);return mi*Math.acos(Math.min(a,1))}static convert(e){if(e instanceof fi)return e;if(Array.isArray(e)&&(e.length===2||e.length===3))return new fi(Number(e[0]),Number(e[1]));if(!Array.isArray(e)&&typeof e=="object"&&e!==null)return new fi(Number("lng"in e?e.lng:e.lon),Number(e.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: <lng>, lat: <lat>}, an object {lon: <lng>, lat: <lat>}, or an array of [<lng>, <lat>]")}};u(fi,"LngLat");var re=fi;var Er=class Er{constructor(e,t){e&&(t?this.setSouthWest(e).setNorthEast(t):Array.isArray(e)&&(e.length===4?this.setSouthWest([e[0],e[1]]).setNorthEast([e[2],e[3]]):this.setSouthWest(e[0]).setNorthEast(e[1])))}setNorthEast(e){return this._ne=e instanceof re?new re(e.lng,e.lat):re.convert(e),this}setSouthWest(e){return this._sw=e instanceof re?new re(e.lng,e.lat):re.convert(e),this}extend(e){let t=this._sw,i=this._ne,n,a;if(e instanceof re)n=e,a=e;else if(e instanceof Er){if(n=e._sw,a=e._ne,!n||!a)return this}else{if(Array.isArray(e))if(e.length===4||e.every(Array.isArray)){let o=e;return this.extend(Er.convert(o))}else{let o=e;return this.extend(re.convert(o))}else if(e&&("lng"in e||"lon"in e)&&"lat"in e)return this.extend(re.convert(e));return this}return!t&&!i?(this._sw=new re(n.lng,n.lat),this._ne=new re(a.lng,a.lat)):(t.lng=Math.min(n.lng,t.lng),t.lat=Math.min(n.lat,t.lat),i.lng=Math.max(a.lng,i.lng),i.lat=Math.max(a.lat,i.lat)),this}getCenter(){return new re((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)}getSouthWest(){return this._sw}getNorthEast(){return this._ne}getNorthWest(){return new re(this.getWest(),this.getNorth())}getSouthEast(){return new re(this.getEast(),this.getSouth())}getWest(){return this._sw.lng}getSouth(){return this._sw.lat}getEast(){return this._ne.lng}getNorth(){return this._ne.lat}toArray(){return[this._sw.toArray(),this._ne.toArray()]}toString(){return"LngLatBounds(".concat(this._sw.toString(),", ").concat(this._ne.toString(),")")}isEmpty(){return!(this._sw&&this._ne)}contains(e){let{lng:t,lat:i}=re.convert(e),n=this._sw.lat<=i&&i<=this._ne.lat,a=this._sw.lng<=t&&t<=this._ne.lng;return this._sw.lng>this._ne.lng&&(a=this._sw.lng>=t&&t>=this._ne.lng),n&&a}static convert(e){return e instanceof Er||!e?e:new Er(e)}static fromLngLat(e,t=0){let n=360*t/40075017,a=n/Math.cos(Math.PI/180*e.lat);return new Er(new re(e.lng-a,e.lat-n),new re(e.lng+a,e.lat+n))}};u(Er,"LngLatBounds");var lt=Er;d();var D_=2*Math.PI*mi;function z_(r){return D_*Math.cos(r*Math.PI/180)}u(z_,"circumferenceAtLatitude");function kr(r){return(180+r)/360}u(kr,"mercatorXfromLng");function Lr(r){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+r*Math.PI/360)))/360}u(Lr,"mercatorYfromLat");function Qf(r,e){return r/z_(e)}u(Qf,"mercatorZfromAltitude");function qM(r){return r*360-180}u(qM,"lngFromMercatorX");function Jf(r){let e=180-r*360;return 360/Math.PI*Math.atan(Math.exp(e*Math.PI/180))-90}u(Jf,"latFromMercatorY");function jM(r,e){return r*z_(Jf(e))}u(jM,"altitudeFromMercatorZ");function $M(r){return 1/Math.cos(r*Math.PI/180)}u($M,"mercatorScale");var yl=class yl{constructor(e,t,i=0){this.x=+e,this.y=+t,this.z=+i}static fromLngLat(e,t=0){let i=re.convert(e);return new yl(kr(i.lng),Lr(i.lat),Qf(t,i.lat))}toLngLat(){return new re(qM(this.x),Jf(this.y))}toAltitude(){return jM(this.z,this.y)}meterInMercatorCoordinateUnits(){return 1/D_*$M(Jf(this.y))}};u(yl,"MercatorCoordinate");var ze=yl;var em=class em{constructor(e,t,i){this.bounds=lt.convert(this.validateBounds(e)),this.minzoom=t||0,this.maxzoom=i||24}validateBounds(e){return!Array.isArray(e)||e.length!==4?[-180,-90,180,90]:[Math.max(-180,e[0]),Math.max(-90,e[1]),Math.min(180,e[2]),Math.min(90,e[3])]}contains(e){let t=Math.pow(2,e.z),i={minX:Math.floor(kr(this.bounds.getWest())*t),minY:Math.floor(Lr(this.bounds.getNorth())*t),maxX:Math.ceil(kr(this.bounds.getEast())*t),maxY:Math.ceil(Lr(this.bounds.getSouth())*t)};return e.x>=i.minX&&e.x<i.maxX&&e.y>=i.minY&&e.y<i.maxY}};u(em,"TileBounds");var on=em;var tm=class tm extends de{constructor(t,i,n,a){super();this.load=u(()=>{this._loaded=!1,this.fire(new z("dataloading",{dataType:"source"})),this._tileJSONRequest=dl(this._options,this.map._requestManager,(t,i)=>{this._tileJSONRequest=null,this._loaded=!0,this.map.style.sourceCaches[this.id].clearTiles(),t?this.fire(new Z(t)):i&&(R(this,i),i.bounds&&(this.tileBounds=new on(i.bounds,this.minzoom,this.maxzoom)),this.fire(new z("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new z("data",{dataType:"source",sourceDataType:"content"})))})},"load");this.serialize=u(()=>R({},this._options),"serialize");if(this.id=t,this.dispatcher=n,this.type="vector",this.minzoom=0,this.maxzoom=22,this.scheme="xyz",this.tileSize=512,this.reparseOverscaled=!0,this.isTileClipped=!0,this._loaded=!1,R(this,Bt(i,["url","scheme","tileSize","promoteId"])),this._options=R({type:"vector"},i),this._collectResourceTiming=i.collectResourceTiming,this.tileSize!==512)throw new Error("vector tile sources must have a tileSize of 512");this.setEventedParent(a)}loaded(){return this._loaded}hasTile(t){return!this.tileBounds||this.tileBounds.contains(t.canonical)}onAdd(t){this.map=t,this.load()}setSourceProperty(t){this._tileJSONRequest&&this._tileJSONRequest.cancel(),t(),this.load()}setTiles(t){return this.setSourceProperty(()=>{this._options.tiles=t}),this}setUrl(t){return this.setSourceProperty(()=>{this.url=t,this._options.url=t}),this}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)}loadTile(t,i){let n=t.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),a={request:this.map._requestManager.transformRequest(n,"Tile"),uid:t.uid,tileID:t.tileID,zoom:t.tileID.overscaledZ,tileSize:this.tileSize*t.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};a.request.collectResourceTiming=this._collectResourceTiming,!t.actor||t.state==="expired"?(t.actor=this.dispatcher.getActor(),t.request=t.actor.send("loadTile",a,o.bind(this))):t.state==="loading"?t.reloadCallback=i:t.request=t.actor.send("reloadTile",a,o.bind(this));function o(s,l){if(delete t.request,t.aborted)return i(null);if(s&&s.status!==404)return i(s);l&&l.resourceTiming&&(t.resourceTiming=l.resourceTiming),this.map._refreshExpiredTiles&&l&&t.setExpiryData(l),t.loadVectorData(l,this.map.painter),i(null),t.reloadCallback&&(this.loadTile(t,t.reloadCallback),t.reloadCallback=null)}u(o,"done")}abortTile(t){t.request&&(t.request.cancel(),delete t.request),t.actor&&t.actor.send("abortTile",{uid:t.uid,type:this.type,source:this.id},void 0)}unloadTile(t){t.unloadVectorData(),t.actor&&t.actor.send("removeTile",{uid:t.uid,type:this.type,source:this.id},void 0)}hasTransition(){return!1}};u(tm,"VectorTileSource");var sn=tm;d();var rm=class rm extends de{constructor(t,i,n,a){super();this.id=t,this.dispatcher=n,this.setEventedParent(a),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=R({type:"raster"},i),R(this,Bt(i,["url","scheme","tileSize"]))}load(){this._loaded=!1,this.fire(new z("dataloading",{dataType:"source"})),this._tileJSONRequest=dl(this._options,this.map._requestManager,(t,i)=>{this._tileJSONRequest=null,this._loaded=!0,t?this.fire(new Z(t)):i&&(R(this,i),i.bounds&&(this.tileBounds=new on(i.bounds,this.minzoom,this.maxzoom)),this.fire(new z("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new z("data",{dataType:"source",sourceDataType:"content"})))})}loaded(){return this._loaded}onAdd(t){this.map=t,this.load()}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)}serialize(){return R({},this._options)}hasTile(t){return!this.tileBounds||this.tileBounds.contains(t.canonical)}loadTile(t,i){let n=t.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme);t.request=ot.getImage(this.map._requestManager.transformRequest(n,"Tile"),(a,o,s)=>{if(delete t.request,t.aborted)t.state="unloaded",i(null);else if(a)t.state="errored",i(a);else if(o){this.map._refreshExpiredTiles&&s&&t.setExpiryData(s);let l=this.map.painter.context,c=l.gl;t.texture=this.map.painter.getTileTexture(o.width),t.texture?t.texture.update(o,{useMipmap:!0}):(t.texture=new be(l,o,c.RGBA,{useMipmap:!0}),t.texture.bind(c.LINEAR,c.CLAMP_TO_EDGE,c.LINEAR_MIPMAP_NEAREST),l.extTextureFilterAnisotropic&&c.texParameterf(c.TEXTURE_2D,l.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,l.extTextureFilterAnisotropicMax)),t.state="loaded",i(null)}},this.map._refreshExpiredTiles)}abortTile(t,i){t.request&&(t.request.cancel(),delete t.request),i()}unloadTile(t,i){t.texture&&this.map.painter.saveTileTexture(t.texture),i()}hasTransition(){return!1}};u(rm,"RasterTileSource");var Dr=rm;d();d();var im;function F_(){return im==null&&(im=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")&&typeof createImageBitmap=="function"),im}u(F_,"offscreenCanvasSupported");d();d();function R_(r,e,t){e=Math.pow(2,t)-e-1;var i=B_(r*256,e*256,t),n=B_((r+1)*256,(e+1)*256,t);return i[0]+","+i[1]+","+n[0]+","+n[1]}u(R_,"getTileBBox");function B_(r,e,t){var i=2*Math.PI*6378137/256/Math.pow(2,t),n=r*i-2*Math.PI*6378137/2,a=e*i-2*Math.PI*6378137/2;return[n,a]}u(B_,"getMercCoords");var O_=ae(Pe(),1);var nm=class nm{constructor(e,t,i){if(e<0||e>25||i<0||i>=Math.pow(2,e)||t<0||t>=Math.pow(2,e))throw new Error("x=".concat(t,", y=").concat(i,", z=").concat(e," outside of bounds. 0<=x<").concat(Math.pow(2,e),", 0<=y<").concat(Math.pow(2,e)," 0<=z<=25 "));this.z=e,this.x=t,this.y=i,this.key=$a(0,e,e,t,i)}equals(e){return this.z===e.z&&this.x===e.x&&this.y===e.y}url(e,t,i){let n=R_(this.x,this.y,this.z),a=HM(this.z,this.x,this.y);return e[(this.x+this.y)%e.length].replace(/{prefix}/g,(this.x%16).toString(16)+(this.y%16).toString(16)).replace(/{z}/g,String(this.z)).replace(/{x}/g,String(this.x)).replace(/{y}/g,String(i==="tms"?Math.pow(2,this.z)-this.y-1:this.y)).replace(/{ratio}/g,t>1?"@2x":"").replace(/{quadkey}/g,a).replace(/{bbox-epsg-3857}/g,n)}isChildOf(e){let t=this.z-e.z;return t>0&&e.x===this.x>>t&&e.y===this.y>>t}getTilePoint(e){let t=Math.pow(2,this.z);return new O_.default((e.x*t-this.x)*8192,(e.y*t-this.y)*8192)}toString(){return"".concat(this.z,"/").concat(this.x,"/").concat(this.y)}};u(nm,"CanonicalTileID");var ln=nm,am=class am{constructor(e,t){this.wrap=e,this.canonical=t,this.key=$a(e,t.z,t.z,t.x,t.y)}};u(am,"UnwrappedTileID");var un=am,Tt=class Tt{constructor(e,t,i,n,a){if(e<i)throw new Error("overscaledZ should be >= z; overscaledZ = ".concat(e,"; z = ").concat(i));this.overscaledZ=e,this.wrap=t,this.canonical=new ln(i,+n,+a),this.key=$a(t,e,i,n,a)}clone(){return new Tt(this.overscaledZ,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)}equals(e){return this.overscaledZ===e.overscaledZ&&this.wrap===e.wrap&&this.canonical.equals(e.canonical)}scaledTo(e){if(e>this.overscaledZ)throw new Error("targetZ > this.overscaledZ; targetZ = ".concat(e,"; overscaledZ = ").concat(this.overscaledZ));let t=this.canonical.z-e;return e>this.canonical.z?new Tt(e,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new Tt(e,this.wrap,e,this.canonical.x>>t,this.canonical.y>>t)}calculateScaledKey(e,t){if(e>this.overscaledZ)throw new Error("targetZ > this.overscaledZ; targetZ = ".concat(e,"; overscaledZ = ").concat(this.overscaledZ));let i=this.canonical.z-e;return e>this.canonical.z?$a(this.wrap*+t,e,this.canonical.z,this.canonical.x,this.canonical.y):$a(this.wrap*+t,e,e,this.canonical.x>>i,this.canonical.y>>i)}isChildOf(e){if(e.wrap!==this.wrap)return!1;let t=this.canonical.z-e.canonical.z;return e.overscaledZ===0||e.overscaledZ<this.overscaledZ&&e.canonical.x===this.canonical.x>>t&&e.canonical.y===this.canonical.y>>t}children(e){if(this.overscaledZ>=e)return[new Tt(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];let t=this.canonical.z+1,i=this.canonical.x*2,n=this.canonical.y*2;return[new Tt(t,this.wrap,t,i,n),new Tt(t,this.wrap,t,i+1,n),new Tt(t,this.wrap,t,i,n+1),new Tt(t,this.wrap,t,i+1,n+1)]}isLessThan(e){return this.wrap<e.wrap?!0:this.wrap>e.wrap?!1:this.overscaledZ<e.overscaledZ?!0:this.overscaledZ>e.overscaledZ?!1:this.canonical.x<e.canonical.x?!0:this.canonical.x>e.canonical.x?!1:this.canonical.y<e.canonical.y}wrapped(){return new Tt(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)}unwrapTo(e){return new Tt(this.overscaledZ,e,this.canonical.z,this.canonical.x,this.canonical.y)}overscaleFactor(){return Math.pow(2,this.overscaledZ-this.canonical.z)}toUnwrapped(){return new un(this.wrap,this.canonical)}toString(){return"".concat(this.overscaledZ,"/").concat(this.canonical.x,"/").concat(this.canonical.y)}getTilePoint(e){return this.canonical.getTilePoint(new ze(e.x-this.wrap,e.y))}};u(Tt,"OverscaledTileID");var rt=Tt;function $a(r,e,t,i,n){r*=2,r<0&&(r=r*-1-1);let a=1<<t;return(a*a*r+a*n+i).toString(36)+t.toString(36)+e.toString(36)}u($a,"calculateKey");function HM(r,e,t){let i="",n;for(let a=r;a>0;a--)n=1<<a-1,i+=(e&n?1:0)+(t&n?2:0);return i}u(HM,"getQuadkey");G("CanonicalTileID",ln);G("OverscaledTileID",rt,{omit:["posMatrix"]});d();var sm=class sm{constructor(e,t,i){if(this.uid=e,t.height!==t.width)throw new RangeError("DEM tiles must be square");if(i&&i!=="mapbox"&&i!=="terrarium"){Ce('"'.concat(i,'" is not a valid encoding type. Valid types include "mapbox" and "terrarium".'));return}this.stride=t.height;let n=this.dim=t.height-2;this.data=new Uint32Array(t.data.buffer),this.encoding=i||"mapbox";for(let a=0;a<n;a++)this.data[this._idx(-1,a)]=this.data[this._idx(0,a)],this.data[this._idx(n,a)]=this.data[this._idx(n-1,a)],this.data[this._idx(a,-1)]=this.data[this._idx(a,0)],this.data[this._idx(a,n)]=this.data[this._idx(a,n-1)];this.data[this._idx(-1,-1)]=this.data[this._idx(0,0)],this.data[this._idx(n,-1)]=this.data[this._idx(n-1,0)],this.data[this._idx(-1,n)]=this.data[this._idx(0,n-1)],this.data[this._idx(n,n)]=this.data[this._idx(n-1,n-1)],this.min=Number.MAX_SAFE_INTEGER,this.max=Number.MIN_SAFE_INTEGER;for(let a=0;a<n;a++)for(let o=0;o<n;o++){let s=this.get(a,o);s>this.max&&(this.max=s),s<this.min&&(this.min=s)}}get(e,t){let i=new Uint8Array(this.data.buffer),n=this._idx(e,t)*4;return(this.encoding==="terrarium"?this._unpackTerrarium:this._unpackMapbox)(i[n],i[n+1],i[n+2])}getUnpackVector(){return this.encoding==="terrarium"?[256,1,1/256,32768]:[6553.6,25.6,.1,1e4]}_idx(e,t){if(e<-1||e>=this.dim+1||t<-1||t>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(t+1)*this.stride+(e+1)}_unpackMapbox(e,t,i){return(e*256*256+t*256+i)/10-1e4}_unpackTerrarium(e,t,i){return e*256+t+i/256-32768}getPixels(){return new Ee({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))}backfillBorder(e,t,i){if(this.dim!==e.dim)throw new Error("dem dimension mismatch");let n=t*this.dim,a=t*this.dim+this.dim,o=i*this.dim,s=i*this.dim+this.dim;switch(t){case-1:n=a-1;break;case 1:a=n+1;break}switch(i){case-1:o=s-1;break;case 1:s=o+1;break}let l=-t*this.dim,c=-i*this.dim;for(let p=o;p<s;p++)for(let h=n;h<a;h++)this.data[this._idx(h,p)]=e.data[this._idx(h+l,p+c)]}};u(sm,"DEMData");var om=sm;G("DEMData",om);var lm=class lm extends Dr{constructor(t,i,n,a){super(t,i,n,a);this.type="raster-dem",this.maxzoom=22,this._options=R({type:"raster-dem"},i),this.encoding=i.encoding||"mapbox"}serialize(){return{type:"raster-dem",url:this.url,tileSize:this.tileSize,tiles:this.tiles,bounds:this.bounds,encoding:this.encoding}}loadTile(t,i){let n=t.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme);t.request=ot.getImage(this.map._requestManager.transformRequest(n,"Tile"),a.bind(this),this.map._refreshExpiredTiles),t.neighboringTiles=this._getNeighboringTiles(t.tileID);function a(s,l){if(delete t.request,t.aborted)t.state="unloaded",i(null);else if(s)t.state="errored",i(s);else if(l){this.map._refreshExpiredTiles&&t.setExpiryData(l),delete l.cacheControl,delete l.expires;let p=Ct(l)&&F_()?l:ne.getImageData(l,1),h={uid:t.uid,coord:t.tileID,source:this.id,rawImageData:p,encoding:this.encoding};(!t.actor||t.state==="expired")&&(t.actor=this.dispatcher.getActor(),t.actor.send("loadDEMTile",h,o.bind(this)))}}u(a,"imageLoaded");function o(s,l){s&&(t.state="errored",i(s)),l&&(t.dem=l,t.needsHillshadePrepare=!0,t.needsTerrainPrepare=!0,t.state="loaded",i(null))}u(o,"done")}_getNeighboringTiles(t){let i=t.canonical,n=Math.pow(2,i.z),a=(i.x-1+n)%n,o=i.x===0?t.wrap-1:t.wrap,s=(i.x+1+n)%n,l=i.x+1===n?t.wrap+1:t.wrap,c={};return c[new rt(t.overscaledZ,o,i.z,a,i.y).key]={backfilled:!1},c[new rt(t.overscaledZ,l,i.z,s,i.y).key]={backfilled:!1},i.y>0&&(c[new rt(t.overscaledZ,o,i.z,a,i.y-1).key]={backfilled:!1},c[new rt(t.overscaledZ,t.wrap,i.z,i.x,i.y-1).key]={backfilled:!1},c[new rt(t.overscaledZ,l,i.z,s,i.y-1).key]={backfilled:!1}),i.y+1<n&&(c[new rt(t.overscaledZ,o,i.z,a,i.y+1).key]={backfilled:!1},c[new rt(t.overscaledZ,t.wrap,i.z,i.x,i.y+1).key]={backfilled:!1},c[new rt(t.overscaledZ,l,i.z,s,i.y+1).key]={backfilled:!1}),c}unloadTile(t){t.demTexture&&this.map.painter.saveTileTexture(t.demTexture),t.fbo&&(t.fbo.destroy(),delete t.fbo),t.dem&&delete t.dem,delete t.neighboringTiles,t.state="unloaded",t.actor&&t.actor.send("removeDEMTile",{uid:t.uid,source:this.id})}};u(lm,"RasterDEMTileSource");var cn=lm;d();var um=class um extends de{constructor(t,i,n,a){super();this.load=u(()=>{this._updateWorkerData()},"load");this.serialize=u(()=>R({},this._options,{type:this.type,data:this._data}),"serialize");this.id=t,this.type="geojson",this.minzoom=0,this.maxzoom=18,this.tileSize=512,this.isTileClipped=!0,this.reparseOverscaled=!0,this._removed=!1,this._pendingLoads=0,this.actor=n.getActor(),this.setEventedParent(a),this._data=i.data,this._options=R({},i),this._collectResourceTiming=i.collectResourceTiming,i.maxzoom!==void 0&&(this.maxzoom=i.maxzoom),i.type&&(this.type=i.type),i.attribution&&(this.attribution=i.attribution),this.promoteId=i.promoteId;let o=8192/this.tileSize;this.workerOptions=R({source:this.id,cluster:i.cluster||!1,geojsonVtOptions:{buffer:(i.buffer!==void 0?i.buffer:128)*o,tolerance:(i.tolerance!==void 0?i.tolerance:.375)*o,extent:8192,maxZoom:this.maxzoom,lineMetrics:i.lineMetrics||!1,generateId:i.generateId||!1},superclusterOptions:{maxZoom:i.clusterMaxZoom!==void 0?i.clusterMaxZoom:this.maxzoom-1,minPoints:Math.max(2,i.clusterMinPoints||2),extent:8192,radius:(i.clusterRadius||50)*o,log:!1,generateId:i.generateId||!1},clusterProperties:i.clusterProperties,filter:i.filter},i.workerOptions),typeof this.promoteId=="string"&&(this.workerOptions.promoteId=this.promoteId)}onAdd(t){this.map=t,this.load()}setData(t){return this._data=t,this._updateWorkerData(),this}updateData(t){return this._updateWorkerData(t),this}setClusterOptions(t){return this.workerOptions.cluster=t.cluster,t&&(t.clusterRadius!==void 0&&(this.workerOptions.superclusterOptions.radius=t.clusterRadius),t.clusterMaxZoom!==void 0&&(this.workerOptions.superclusterOptions.maxZoom=t.clusterMaxZoom)),this._updateWorkerData(),this}getClusterExpansionZoom(t,i){return this.actor.send("geojson.getClusterExpansionZoom",{clusterId:t,source:this.id},i),this}getClusterChildren(t,i){return this.actor.send("geojson.getClusterChildren",{clusterId:t,source:this.id},i),this}getClusterLeaves(t,i,n,a){return this.actor.send("geojson.getClusterLeaves",{source:this.id,clusterId:t,limit:i,offset:n},a),this}_updateWorkerData(t){let i=R({},this.workerOptions);t?i.dataDiff=t:typeof this._data=="string"?(i.request=this.map._requestManager.transformRequest(ne.resolveURL(this._data),"Source"),i.request.collectResourceTiming=this._collectResourceTiming):i.data=JSON.stringify(this._data),this._pendingLoads++,this.fire(new z("dataloading",{dataType:"source"})),this.actor.send("".concat(this.type,".loadData"),i,(n,a)=>{if(this._pendingLoads--,this._removed||a&&a.abandoned){this.fire(new z("dataabort",{dataType:"source"}));return}let o=null;if(a&&a.resourceTiming&&a.resourceTiming[this.id]&&(o=a.resourceTiming[this.id].slice(0)),n){this.fire(new Z(n));return}let s={dataType:"source"};this._collectResourceTiming&&o&&o.length>0&&R(s,{resourceTiming:o}),this.fire(new z("data",{...s,sourceDataType:"metadata"})),this.fire(new z("data",{...s,sourceDataType:"content"}))})}loaded(){return this._pendingLoads===0}loadTile(t,i){let n=t.actor?"reloadTile":"loadTile";t.actor=this.actor;let a={type:this.type,uid:t.uid,tileID:t.tileID,zoom:t.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};t.request=this.actor.send(n,a,(o,s)=>(delete t.request,t.unloadVectorData(),t.aborted?i(null):o?i(o):(t.loadVectorData(s,this.map.painter,n==="reloadTile"),i(null))))}abortTile(t){t.request&&(t.request.cancel(),delete t.request),t.aborted=!0}unloadTile(t){t.unloadVectorData(),this.actor.send("removeTile",{uid:t.uid,type:this.type,source:this.id})}onRemove(){this._removed=!0,this.actor.send("removeSource",{type:this.type,source:this.id})}hasTransition(){return!1}};u(um,"GeoJSONSource");var pn=um;d();d();d();var zr=ve([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]);var cm=class cm extends de{constructor(t,i,n,a){super();this.load=u((t,i)=>{this._loaded=!1,this.fire(new z("dataloading",{dataType:"source"})),this.url=this.options.url,this._request=ot.getImage(this.map._requestManager.transformRequest(this.url,"Image"),(n,a)=>{this._request=null,this._loaded=!0,n?this.fire(new Z(n)):a&&(this.image=a,t&&(this.coordinates=t),i&&i(),this._finishLoading())})},"load");this.prepare=u(()=>{if(Object.keys(this.tiles).length===0||!this.image)return;let t=this.map.painter.context,i=t.gl;this.boundsBuffer||(this.boundsBuffer=t.createVertexBuffer(this._boundsArray,zr.members)),this.boundsSegments||(this.boundsSegments=me.simpleSegment(0,0,4,2)),this.texture||(this.texture=new be(t,this.image,i.RGBA),this.texture.bind(i.LINEAR,i.CLAMP_TO_EDGE));let n=!1;for(let a in this.tiles){let o=this.tiles[a];o.state!=="loaded"&&(o.state="loaded",o.texture=this.texture,n=!0)}n&&this.fire(new z("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))},"prepare");this.serialize=u(()=>({type:"image",url:this.options.url,coordinates:this.coordinates}),"serialize");this.id=t,this.dispatcher=n,this.coordinates=i.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(a),this.options=i}loaded(){return this._loaded}updateImage(t){return t.url?(this._request&&(this._request.cancel(),this._request=null),this.options.url=t.url,this.load(t.coordinates,()=>{this.texture=null}),this):this}_finishLoading(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new z("data",{dataType:"source",sourceDataType:"metadata"})))}onAdd(t){this.map=t,this.load()}onRemove(){this._request&&(this._request.cancel(),this._request=null)}setCoordinates(t){this.coordinates=t;let i=t.map(ze.fromLngLat);this.tileID=ZM(i),this.minzoom=this.maxzoom=this.tileID.z;let n=i.map(a=>this.tileID.getTilePoint(a)._round());return this._boundsArray=new Hi,this._boundsArray.emplaceBack(n[0].x,n[0].y,0,0),this._boundsArray.emplaceBack(n[1].x,n[1].y,8192,0),this._boundsArray.emplaceBack(n[3].x,n[3].y,0,8192),this._boundsArray.emplaceBack(n[2].x,n[2].y,8192,8192),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire(new z("data",{dataType:"source",sourceDataType:"content"})),this}loadTile(t,i){this.tileID&&this.tileID.equals(t.tileID.canonical)?(this.tiles[String(t.tileID.wrap)]=t,t.buckets={},i(null)):(t.state="errored",i(null))}hasTransition(){return!1}};u(cm,"ImageSource");var At=cm;function ZM(r){let e=1/0,t=1/0,i=-1/0,n=-1/0;for(let p of r)e=Math.min(e,p.x),t=Math.min(t,p.y),i=Math.max(i,p.x),n=Math.max(n,p.y);let a=i-e,o=n-t,s=Math.max(a,o),l=Math.max(0,Math.floor(-Math.log(s)/Math.LN2)),c=Math.pow(2,l);return new ln(l,Math.floor((e+i)/2*c),Math.floor((t+n)/2*c))}u(ZM,"getCoordinatesCenterTileID");var pm=class pm extends At{constructor(t,i,n,a){super(t,i,n,a);this.load=u(()=>{this._loaded=!1;let t=this.options;this.urls=[];for(let i of t.urls)this.urls.push(this.map._requestManager.transformRequest(i,"Source").url);ng(this.urls,(i,n)=>{this._loaded=!0,i?this.fire(new Z(i)):n&&(this.video=n,this.video.loop=!0,this.video.addEventListener("playing",()=>{this.map.triggerRepaint()}),this.map&&this.video.play(),this._finishLoading())})},"load");this.prepare=u(()=>{if(Object.keys(this.tiles).length===0||this.video.readyState<2)return;let t=this.map.painter.context,i=t.gl;this.boundsBuffer||(this.boundsBuffer=t.createVertexBuffer(this._boundsArray,zr.members)),this.boundsSegments||(this.boundsSegments=me.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(i.LINEAR,i.CLAMP_TO_EDGE),i.texSubImage2D(i.TEXTURE_2D,0,0,0,i.RGBA,i.UNSIGNED_BYTE,this.video)):(this.texture=new be(t,this.video,i.RGBA),this.texture.bind(i.LINEAR,i.CLAMP_TO_EDGE));let n=!1;for(let a in this.tiles){let o=this.tiles[a];o.state!=="loaded"&&(o.state="loaded",o.texture=this.texture,n=!0)}n&&this.fire(new z("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))},"prepare");this.serialize=u(()=>({type:"video",urls:this.urls,coordinates:this.coordinates}),"serialize");this.roundZoom=!0,this.type="video",this.options=i}pause(){this.video&&this.video.pause()}play(){this.video&&this.video.play()}seek(t){if(this.video){let i=this.video.seekable;t<i.start(0)||t>i.end(0)?this.fire(new Z(new N("sources.".concat(this.id),null,"Playback for this video can be set only between the ".concat(i.start(0)," and ").concat(i.end(0),"-second mark.")))):this.video.currentTime=t}}getVideo(){return this.video}onAdd(t){this.map||(this.map=t,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))}hasTransition(){return this.video&&!this.video.paused}};u(pm,"VideoSource");var hn=pm;d();var hm=class hm extends At{constructor(t,i,n,a){super(t,i,n,a);this.load=u(()=>{if(this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof HTMLCanvasElement?this.options.canvas:document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()){this.fire(new Z(new Error("Canvas dimensions cannot be less than or equal to zero.")));return}this.play=function(){this._playing=!0,this.map.triggerRepaint()},this.pause=function(){this._playing&&(this.prepare(),this._playing=!1)},this._finishLoading()},"load");this.prepare=u(()=>{let t=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,t=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,t=!0),this._hasInvalidDimensions()||Object.keys(this.tiles).length===0)return;let i=this.map.painter.context,n=i.gl;this.boundsBuffer||(this.boundsBuffer=i.createVertexBuffer(this._boundsArray,zr.members)),this.boundsSegments||(this.boundsSegments=me.simpleSegment(0,0,4,2)),this.texture?(t||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new be(i,this.canvas,n.RGBA,{premultiply:!0});let a=!1;for(let o in this.tiles){let s=this.tiles[o];s.state!=="loaded"&&(s.state="loaded",s.texture=this.texture,a=!0)}a&&this.fire(new z("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))},"prepare");this.serialize=u(()=>({type:"canvas",coordinates:this.coordinates}),"serialize");i.coordinates?(!Array.isArray(i.coordinates)||i.coordinates.length!==4||i.coordinates.some(o=>!Array.isArray(o)||o.length!==2||o.some(s=>typeof s!="number")))&&this.fire(new Z(new N("sources.".concat(t),null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new Z(new N("sources.".concat(t),null,'missing required property "coordinates"'))),i.animate&&typeof i.animate!="boolean"&&this.fire(new Z(new N("sources.".concat(t),null,'optional "animate" property must be a boolean value'))),i.canvas?typeof i.canvas!="string"&&!(i.canvas instanceof HTMLCanvasElement)&&this.fire(new Z(new N("sources.".concat(t),null,'"canvas" must be either a string representing the ID of the canvas element from which to read, or an HTMLCanvasElement instance'))):this.fire(new Z(new N("sources.".concat(t),null,'missing required property "canvas"'))),this.options=i,this.animate=i.animate!==void 0?i.animate:!0}getCanvas(){return this.canvas}onAdd(t){this.map=t,this.load(),this.canvas&&this.animate&&this.play()}onRemove(){this.pause()}hasTransition(){return this._playing}_hasInvalidDimensions(){for(let t of[this.canvas.width,this.canvas.height])if(isNaN(t)||t<=0)return!0;return!1}};u(hm,"CanvasSource");var fn=hm;var V_={},U_=u((r,e,t,i)=>{let n=fm(e.type),a=new n(r,e,t,i);if(a.id!==r)throw new Error("Expected Source id to be ".concat(r," instead of ").concat(a.id));return a},"create"),fm=u(r=>{switch(r){case"geojson":return pn;case"image":return At;case"raster":return Dr;case"raster-dem":return cn;case"vector":return sn;case"video":return hn;case"canvas":return fn}return V_[r]},"getSourceType"),N_=u((r,e)=>{V_[r]=e},"setSourceType");d();function WM(r,e){let t=q.create();return q.translate(t,t,[1,1,0]),q.scale(t,t,[r.width*.5,r.height*.5,1]),q.multiply(t,t,r.calculatePosMatrix(e.toUnwrapped()))}u(WM,"getPixelPosMatrix");function XM(r,e,t){if(r)for(let i of r){let n=e[i];if(n&&n.source===t&&n.type==="fill-extrusion")return!0}else for(let i in e){let n=e[i];if(n.source===t&&n.type==="fill-extrusion")return!0}return!1}u(XM,"queryIncludes3DLayer");function G_(r,e,t,i,n,a){let o=XM(n&&n.layers,e,r.id),s=a.maxPitchScaleFactor(),l=r.tilesIn(i,s,o);l.sort($_);let c=[];for(let h of l)c.push({wrappedTileID:h.tileID.wrapped().key,queryResults:h.tile.queryRenderedFeatures(e,t,r._state,h.queryGeometry,h.cameraQueryGeometry,h.scale,n,a,s,WM(r.transform,h.tileID))});let p=KM(c);for(let h in p)p[h].forEach(f=>{let m=f.feature,g=r.getFeatureState(m.layer["source-layer"],m.id);m.source=m.layer.source,m.layer["source-layer"]&&(m.sourceLayer=m.layer["source-layer"]),m.state=g});return p}u(G_,"queryRenderedFeatures");function q_(r,e,t,i,n,a,o){let s={},l=a.queryRenderedSymbols(i),c=[];for(let p of Object.keys(l).map(Number))c.push(o[p]);c.sort($_);for(let p of c){let h=p.featureIndex.lookupSymbolFeatures(l[p.bucketInstanceId],e,p.bucketIndex,p.sourceLayerIndex,n.filter,n.layers,n.availableImages,r);for(let f in h){let m=s[f]=s[f]||[],g=h[f];g.sort((y,x)=>{let b=p.featureSortOrder;if(b){let _=b.indexOf(y.featureIndex);return b.indexOf(x.featureIndex)-_}else return x.featureIndex-y.featureIndex});for(let y of g)m.push(y)}}for(let p in s)s[p].forEach(h=>{let f=h.feature,m=r[p],y=t[m.source].getFeatureState(f.layer["source-layer"],f.id);f.source=f.layer.source,f.layer["source-layer"]&&(f.sourceLayer=f.layer["source-layer"]),f.state=y});return s}u(q_,"queryRenderedSymbols");function j_(r,e){let t=r.getRenderableIds().map(a=>r.getTileByID(a)),i=[],n={};for(let a=0;a<t.length;a++){let o=t[a],s=o.tileID.canonical.key;n[s]||(n[s]=!0,o.querySourceFeatures(i,e))}return i}u(j_,"querySourceFeatures");function $_(r,e){let t=r.tileID,i=e.tileID;return t.overscaledZ-i.overscaledZ||t.canonical.y-i.canonical.y||t.wrap-i.wrap||t.canonical.x-i.canonical.x}u($_,"sortTilesIn");function KM(r){let e={},t={};for(let i of r){let n=i.queryResults,a=i.wrappedTileID,o=t[a]=t[a]||{};for(let s in n){let l=n[s],c=o[s]=o[s]||{},p=e[s]=e[s]||[];for(let h of l)c[h.featureIndex]||(c[h.featureIndex]=!0,p.push(h))}}return e}u(KM,"mergeRenderedFeatureLayers");d();d();d();function H_(r,e){let t={};if(!e)return t;for(let i of r){let n=i.layerIds.map(a=>e.getLayer(a)).filter(Boolean);if(n.length!==0){i.layers=n,i.stateDependentLayerIds&&(i.stateDependentLayers=i.stateDependentLayerIds.map(a=>n.filter(o=>o.id===a)[0]));for(let a of n)t[a.id]=i}}return t}u(H_,"deserialize");d();d();var mm=class mm{constructor(e){this._stringToNumber={},this._numberToString=[];for(let t=0;t<e.length;t++){let i=e[t];this._stringToNumber[i]=t,this._numberToString[t]=i}}encode(e){return this._stringToNumber[e]}decode(e){if(e>=this._numberToString.length)throw new Error("Out of bounds. Index requested n=".concat(e," can't be >= this._numberToString.length ").concat(this._numberToString.length));return this._numberToString[e]}};u(mm,"DictionaryCoder");var gl=mm;var X_=ae(ka(),1),K_=ae(Ef(),1);d();var dm=class dm{constructor(e,t,i,n,a){this.type="Feature",this._vectorTileFeature=e,e._z=t,e._x=i,e._y=n,this.properties=e.properties,this.id=a}get geometry(){return this._geometry===void 0&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z).geometry),this._geometry}set geometry(e){this._geometry=e}toJSON(){let e={geometry:this.geometry};for(let t in this)t==="_geometry"||t==="_vectorTileFeature"||(e[t]=this[t]);return e}};u(dm,"GeoJSONFeature");var mn=dm;var gm=class gm{constructor(e,t){this.tileID=e,this.x=e.canonical.x,this.y=e.canonical.y,this.z=e.canonical.z,this.grid=new Yr(8192,16,0),this.grid3D=new Yr(8192,16,0),this.featureIndexArray=new ba,this.promoteId=t}insert(e,t,i,n,a,o){let s=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(i,n,a);let l=o?this.grid3D:this.grid;for(let c=0;c<t.length;c++){let p=t[c],h=[1/0,1/0,-1/0,-1/0];for(let f=0;f<p.length;f++){let m=p[f];h[0]=Math.min(h[0],m.x),h[1]=Math.min(h[1],m.y),h[2]=Math.max(h[2],m.x),h[3]=Math.max(h[3],m.y)}h[0]<8192&&h[1]<8192&&h[2]>=0&&h[3]>=0&&l.insert(s,h[0],h[1],h[2],h[3])}}loadVTLayers(){return this.vtLayers||(this.vtLayers=new X_.default.VectorTile(new K_.default(this.rawTileData)).layers,this.sourceLayerCoder=new gl(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers}query(e,t,i,n){this.loadVTLayers();let a=e.params||{},o=8192/e.tileSize/e.scale,s=Xn(a.filter),l=e.queryGeometry,c=e.queryPadding*o,p=W_(l),h=this.grid.query(p.minX-c,p.minY-c,p.maxX+c,p.maxY+c),f=W_(e.cameraQueryGeometry),m=this.grid3D.query(f.minX-c,f.minY-c,f.maxX+c,f.maxY+c,(x,b,_,v)=>Lx(e.cameraQueryGeometry,x-c,b-c,_+c,v+c));for(let x of m)h.push(x);h.sort(YM);let g={},y;for(let x=0;x<h.length;x++){let b=h[x];if(b===y)continue;y=b;let _=this.featureIndexArray.get(b),v=null;this.loadMatchingFeature(g,_.bucketIndex,_.sourceLayerIndex,_.featureIndex,s,a.layers,a.availableImages,t,i,n,(S,P,T)=>(v||(v=dt(S)),P.queryIntersectsFeature(l,S,T,v,this.z,e.transform,o,e.pixelPosMatrix)))}return g}loadMatchingFeature(e,t,i,n,a,o,s,l,c,p,h){let f=this.bucketLayerIDs[t];if(o&&!Ky(o,f))return;let m=this.sourceLayerCoder.decode(i),y=this.vtLayers[m].feature(n);if(a.needGeometry){let b=yt(y,!0);if(!a.filter(new ye(this.tileID.overscaledZ),b,this.tileID.canonical))return}else if(!a.filter(new ye(this.tileID.overscaledZ),y))return;let x=this.getId(y,m);for(let b=0;b<f.length;b++){let _=f[b];if(o&&o.indexOf(_)<0)continue;let v=l[_];if(!v)continue;let S={};x&&p&&(S=p.getState(v.sourceLayer||"_geojsonTileLayer",x));let P=R({},c[_]);P.paint=Z_(P.paint,v.paint,y,S,s),P.layout=Z_(P.layout,v.layout,y,S,s);let T=!h||h(y,v,S);if(!T)continue;let A=new mn(y,this.z,this.x,this.y,x);A.layer=P;let L=e[_];L===void 0&&(L=e[_]=[]),L.push({featureIndex:n,feature:A,intersectionZ:T})}}lookupSymbolFeatures(e,t,i,n,a,o,s,l){let c={};this.loadVTLayers();let p=Xn(a);for(let h of e)this.loadMatchingFeature(c,i,n,h,p,o,s,l,t);return c}hasLayer(e){for(let t of this.bucketLayerIDs)for(let i of t)if(e===i)return!0;return!1}getId(e,t){let i=e.id;if(this.promoteId){let n=typeof this.promoteId=="string"?this.promoteId:this.promoteId[t];i=e.properties[n],typeof i=="boolean"&&(i=Number(i))}return i}};u(gm,"FeatureIndex");var ym=gm;G("FeatureIndex",ym,{omit:["rawTileData","sourceLayerCoder"]});function Z_(r,e,t,i,n){return Tn(r,(a,o)=>{let s=e instanceof wr?e.get(o):null;return s&&s.evaluate?s.evaluate(t,i,n):s})}u(Z_,"evaluateProperties");function W_(r){let e=1/0,t=1/0,i=-1/0,n=-1/0;for(let a of r)e=Math.min(e,a.x),t=Math.min(t,a.y),i=Math.max(i,a.x),n=Math.max(n,a.y);return{minX:e,minY:t,maxX:i,maxY:n}}u(W_,"getBounds");function YM(r,e){return e-r}u(YM,"topDownFeatureComparator");var JM=3e4,xm=class xm{constructor(e,t){this.timeAdded=0;this.fadeEndTime=0;this.tileID=e,this.uid=fo(),this.uses=0,this.tileSize=t,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.rtt=[],this.rttCoords={},this.expiredRequestCount=0,this.state="loading"}registerFadeDuration(e){let t=e+this.timeAdded;t<this.fadeEndTime||(this.fadeEndTime=t)}wasRequested(){return this.state==="errored"||this.state==="loaded"||this.state==="reloading"}clearTextures(e){this.demTexture&&e.saveTileTexture(this.demTexture),this.demTexture=null}loadVectorData(e,t,i){if(this.hasData()&&this.unloadVectorData(),this.state="loaded",!e){this.collisionBoxArray=new ma;return}e.featureIndex&&(this.latestFeatureIndex=e.featureIndex,e.rawTileData?(this.latestRawTileData=e.rawTileData,this.latestFeatureIndex.rawTileData=e.rawTileData):this.latestRawTileData&&(this.latestFeatureIndex.rawTileData=this.latestRawTileData)),this.collisionBoxArray=e.collisionBoxArray,this.buckets=H_(e.buckets,t.style),this.hasSymbolBuckets=!1;for(let n in this.buckets){let a=this.buckets[n];if(a instanceof Gt)if(this.hasSymbolBuckets=!0,i)a.justReloaded=!0;else break}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(let n in this.buckets){let a=this.buckets[n];if(a instanceof Gt&&a.hasRTLText){this.hasRTLText=!0,gx();break}}this.queryPadding=0;for(let n in this.buckets){let a=this.buckets[n];this.queryPadding=Math.max(this.queryPadding,t.style.getLayer(n).queryRadius(a))}e.imageAtlas&&(this.imageAtlas=e.imageAtlas),e.glyphAtlasImage&&(this.glyphAtlasImage=e.glyphAtlasImage)}unloadVectorData(){for(let e in this.buckets)this.buckets[e].destroy();this.buckets={},this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.imageAtlas&&(this.imageAtlas=null),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.latestFeatureIndex=null,this.state="unloaded"}getBucket(e){return this.buckets[e.id]}upload(e){for(let i in this.buckets){let n=this.buckets[i];n.uploadPending()&&n.upload(e)}let t=e.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new be(e,this.imageAtlas.image,t.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new be(e,this.glyphAtlasImage,t.ALPHA),this.glyphAtlasImage=null)}prepare(e){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(e,this.imageAtlasTexture)}queryRenderedFeatures(e,t,i,n,a,o,s,l,c,p){return!this.latestFeatureIndex||!this.latestFeatureIndex.rawTileData?{}:this.latestFeatureIndex.query({queryGeometry:n,cameraQueryGeometry:a,scale:o,tileSize:this.tileSize,pixelPosMatrix:p,transform:l,params:s,queryPadding:this.queryPadding*c},e,t,i)}querySourceFeatures(e,t){let i=this.latestFeatureIndex;if(!i||!i.rawTileData)return;let n=i.loadVTLayers(),a=t&&t.sourceLayer?t.sourceLayer:"",o=n._geojsonTileLayer||n[a];if(!o)return;let s=Xn(t&&t.filter),{z:l,x:c,y:p}=this.tileID.canonical,h={z:l,x:c,y:p};for(let f=0;f<o.length;f++){let m=o.feature(f);if(s.needGeometry){let x=yt(m,!0);if(!s.filter(new ye(this.tileID.overscaledZ),x,this.tileID.canonical))continue}else if(!s.filter(new ye(this.tileID.overscaledZ),m))continue;let g=i.getId(m,a),y=new mn(m,l,c,p,g);y.tile=h,e.push(y)}}hasData(){return this.state==="loaded"||this.state==="reloading"||this.state==="expired"}patternsLoaded(){return this.imageAtlas&&!!Object.keys(this.imageAtlas.patternPositions).length}setExpiryData(e){let t=this.expirationTime;if(e.cacheControl){let i=eg(e.cacheControl);i["max-age"]&&(this.expirationTime=Date.now()+i["max-age"]*1e3)}else e.expires&&(this.expirationTime=new Date(e.expires).getTime());if(this.expirationTime){let i=Date.now(),n=!1;if(this.expirationTime>i)n=!1;else if(!t)n=!0;else if(this.expirationTime<t)n=!0;else{let a=this.expirationTime-t;a?this.expirationTime=i+Math.max(a,JM):n=!0}n?(this.expiredRequestCount++,this.state="expired"):this.expiredRequestCount=0}}getExpiryTimeout(){if(this.expirationTime)return this.expiredRequestCount?1e3*(1<<Math.min(this.expiredRequestCount-1,31)):Math.min(this.expirationTime-new Date().getTime(),Math.pow(2,31)-1)}setFeatureState(e,t){if(!this.latestFeatureIndex||!this.latestFeatureIndex.rawTileData||Object.keys(e).length===0)return;let i=this.latestFeatureIndex.loadVTLayers();for(let n in this.buckets){if(!t.style.hasLayer(n))continue;let a=this.buckets[n],o=a.layers[0].sourceLayer||"_geojsonTileLayer",s=i[o],l=e[o];if(!s||!l||Object.keys(l).length===0)continue;a.update(l,s,this.imageAtlas&&this.imageAtlas.patternPositions||{});let c=t&&t.style&&t.style.getLayer(n);c&&(this.queryPadding=Math.max(this.queryPadding,c.queryRadius(a)))}}holdingForFade(){return this.symbolFadeHoldUntil!==void 0}symbolFadeFinished(){return!this.symbolFadeHoldUntil||this.symbolFadeHoldUntil<ne.now()}clearFadeHold(){this.symbolFadeHoldUntil=void 0}setHoldDuration(e){this.symbolFadeHoldUntil=ne.now()+e}setDependencies(e,t){let i={};for(let n of t)i[n]=!0;this.dependencies[e]=i}hasDependency(e,t){for(let i of e){let n=this.dependencies[i];if(n){for(let a of t)if(n[a])return!0}}return!1}};u(xm,"Tile");var dn=xm;d();var bm=class bm{constructor(e,t){this.max=e,this.onRemove=t,this.reset()}reset(){for(let e in this.data)for(let t of this.data[e])t.timeout&&clearTimeout(t.timeout),this.onRemove(t.value);return this.data={},this.order=[],this}add(e,t,i){let n=e.wrapped().key;this.data[n]===void 0&&(this.data[n]=[]);let a={value:t,timeout:void 0};if(i!==void 0&&(a.timeout=setTimeout(()=>{this.remove(e,a)},i)),this.data[n].push(a),this.order.push(n),this.order.length>this.max){let o=this._getAndRemoveByKey(this.order[0]);o&&this.onRemove(o)}return this}has(e){return e.wrapped().key in this.data}getAndRemove(e){return this.has(e)?this._getAndRemoveByKey(e.wrapped().key):null}_getAndRemoveByKey(e){let t=this.data[e].shift();return t.timeout&&clearTimeout(t.timeout),this.data[e].length===0&&delete this.data[e],this.order.splice(this.order.indexOf(e),1),t.value}getByKey(e){let t=this.data[e];return t?t[0].value:null}get(e){return this.has(e)?this.data[e.wrapped().key][0].value:null}remove(e,t){if(!this.has(e))return this;let i=e.wrapped().key,n=t===void 0?0:this.data[i].indexOf(t),a=this.data[i][n];return this.data[i].splice(n,1),a.timeout&&clearTimeout(a.timeout),this.data[i].length===0&&delete this.data[i],this.onRemove(a.value),this.order.splice(this.order.indexOf(i),1),this}setMaxSize(e){for(this.max=e;this.order.length>this.max;){let t=this._getAndRemoveByKey(this.order[0]);t&&this.onRemove(t)}return this}filter(e){let t=[];for(let i in this.data)for(let n of this.data[i])e(n.value)||t.push(n);for(let i of t)this.remove(i.value.tileID,i)}};u(bm,"TileCache");var xl=bm;var vm=ae(Pe(),1);d();var _m=class _m{constructor(){this.state={},this.stateChanges={},this.deletedStates={}}updateState(e,t,i){let n=String(t);if(this.stateChanges[e]=this.stateChanges[e]||{},this.stateChanges[e][n]=this.stateChanges[e][n]||{},R(this.stateChanges[e][n],i),this.deletedStates[e]===null){this.deletedStates[e]={};for(let a in this.state[e])a!==n&&(this.deletedStates[e][a]=null)}else if(this.deletedStates[e]&&this.deletedStates[e][n]===null){this.deletedStates[e][n]={};for(let o in this.state[e][n])i[o]||(this.deletedStates[e][n][o]=null)}else for(let o in i)this.deletedStates[e]&&this.deletedStates[e][n]&&this.deletedStates[e][n][o]===null&&delete this.deletedStates[e][n][o]}removeFeatureState(e,t,i){if(this.deletedStates[e]===null)return;let a=String(t);if(this.deletedStates[e]=this.deletedStates[e]||{},i&&t!==void 0)this.deletedStates[e][a]!==null&&(this.deletedStates[e][a]=this.deletedStates[e][a]||{},this.deletedStates[e][a][i]=null);else if(t!==void 0)if(this.stateChanges[e]&&this.stateChanges[e][a]){this.deletedStates[e][a]={};for(i in this.stateChanges[e][a])this.deletedStates[e][a][i]=null}else this.deletedStates[e][a]=null;else this.deletedStates[e]=null}getState(e,t){let i=String(t),n=this.state[e]||{},a=this.stateChanges[e]||{},o=R({},n[i],a[i]);if(this.deletedStates[e]===null)return{};if(this.deletedStates[e]){let s=this.deletedStates[e][t];if(s===null)return{};for(let l in s)delete o[l]}return o}initializeTileState(e,t){e.setFeatureState(this.state,t)}coalesceChanges(e,t){let i={};for(let n in this.stateChanges){this.state[n]=this.state[n]||{};let a={};for(let o in this.stateChanges[n])this.state[n][o]||(this.state[n][o]={}),R(this.state[n][o],this.stateChanges[n][o]),a[o]=this.state[n][o];i[n]=a}for(let n in this.deletedStates){this.state[n]=this.state[n]||{};let a={};if(this.deletedStates[n]===null)for(let o in this.state[n])a[o]={},this.state[n][o]={};else for(let o in this.deletedStates[n]){if(this.deletedStates[n][o]===null)this.state[n][o]={};else for(let l of Object.keys(this.deletedStates[n][o]))delete this.state[n][o][l];a[o]=this.state[n][o]}i[n]=i[n]||{},R(i[n],a)}if(this.stateChanges={},this.deletedStates={},Object.keys(i).length!==0)for(let n in e)e[n].setFeatureState(i,t)}};u(_m,"SourceFeatureState");var bl=_m;var di=class di extends de{constructor(t,i,n){super();this.id=t,this.dispatcher=n,this.on("data",a=>{a.dataType==="source"&&a.sourceDataType==="metadata"&&(this._sourceLoaded=!0),this._sourceLoaded&&!this._paused&&a.dataType==="source"&&a.sourceDataType==="content"&&(this.reload(),this.transform&&this.update(this.transform,this.terrain),this._didEmitContent=!0)}),this.on("dataloading",()=>{this._sourceErrored=!1}),this.on("error",()=>{this._sourceErrored=this._source.loaded()}),this._source=U_(t,i,n,this),this._tiles={},this._cache=new xl(0,this._unloadTile.bind(this)),this._timers={},this._cacheTimers={},this._maxTileCacheSize=null,this._maxTileCacheZoomLevels=null,this._loadedParentTiles={},this._coveredTiles={},this._state=new bl,this._didEmitContent=!1,this._updated=!1}onAdd(t){this.map=t,this._maxTileCacheSize=t?t._maxTileCacheSize:null,this._maxTileCacheZoomLevels=t?t._maxTileCacheZoomLevels:null,this._source&&this._source.onAdd&&this._source.onAdd(t)}onRemove(t){this.clearTiles(),this._source&&this._source.onRemove&&this._source.onRemove(t)}loaded(){if(this._sourceErrored)return!0;if(!this._sourceLoaded||!this._source.loaded())return!1;if((this.used!==void 0||this.usedForTerrain!==void 0)&&!this.used&&!this.usedForTerrain)return!0;if(!this._updated)return!1;for(let t in this._tiles){let i=this._tiles[t];if(i.state!=="loaded"&&i.state!=="errored")return!1}return!0}getSource(){return this._source}pause(){this._paused=!0}resume(){if(!this._paused)return;let t=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,t&&this.reload(),this.transform&&this.update(this.transform,this.terrain)}_loadTile(t,i){return this._source.loadTile(t,i)}_unloadTile(t){if(this._source.unloadTile)return this._source.unloadTile(t,()=>{})}_abortTile(t){this._source.abortTile&&this._source.abortTile(t,()=>{}),this._source.fire(new z("dataabort",{tile:t,coord:t.tileID,dataType:"source"}))}serialize(){return this._source.serialize()}prepare(t){this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null);for(let i in this._tiles){let n=this._tiles[i];n.upload(t),n.prepare(this.map.style.imageManager)}}getIds(){return Object.values(this._tiles).map(t=>t.tileID).sort(Y_).map(t=>t.key)}getRenderableIds(t){let i=[];for(let n in this._tiles)this._isIdRenderable(n,t)&&i.push(this._tiles[n]);return t?i.sort((n,a)=>{let o=n.tileID,s=a.tileID,l=new vm.default(o.canonical.x,o.canonical.y)._rotate(this.transform.angle),c=new vm.default(s.canonical.x,s.canonical.y)._rotate(this.transform.angle);return o.overscaledZ-s.overscaledZ||c.y-l.y||c.x-l.x}).map(n=>n.tileID.key):i.map(n=>n.tileID).sort(Y_).map(n=>n.key)}hasRenderableParent(t){let i=this.findLoadedParent(t,0);return i?this._isIdRenderable(i.tileID.key):!1}_isIdRenderable(t,i){return this._tiles[t]&&this._tiles[t].hasData()&&!this._coveredTiles[t]&&(i||!this._tiles[t].holdingForFade())}reload(){if(this._paused){this._shouldReloadOnResume=!0;return}this._cache.reset();for(let t in this._tiles)this._tiles[t].state!=="errored"&&this._reloadTile(t,"reloading")}_reloadTile(t,i){let n=this._tiles[t];n&&(n.state!=="loading"&&(n.state=i),this._loadTile(n,this._tileLoaded.bind(this,n,t,i)))}_tileLoaded(t,i,n,a){if(a){t.state="errored",a.status!==404?this._source.fire(new Z(a,{tile:t})):this.update(this.transform,this.terrain);return}t.timeAdded=ne.now(),n==="expired"&&(t.refreshedUponExpiration=!0),this._setTileReloadTimer(i,t),this.getSource().type==="raster-dem"&&t.dem&&this._backfillDEM(t),this._state.initializeTileState(t,this.map?this.map.painter:null),t.aborted||this._source.fire(new z("data",{dataType:"source",tile:t,coord:t.tileID}))}_backfillDEM(t){let i=this.getRenderableIds();for(let a=0;a<i.length;a++){let o=i[a];if(t.neighboringTiles&&t.neighboringTiles[o]){let s=this.getTileByID(o);n(t,s),n(s,t)}}function n(a,o){a.needsHillshadePrepare=!0,a.needsTerrainPrepare=!0;let s=o.tileID.canonical.x-a.tileID.canonical.x,l=o.tileID.canonical.y-a.tileID.canonical.y,c=Math.pow(2,a.tileID.canonical.z),p=o.tileID.key;s===0&&l===0||Math.abs(l)>1||(Math.abs(s)>1&&(Math.abs(s+c)===1?s+=c:Math.abs(s-c)===1&&(s-=c)),!(!o.dem||!a.dem)&&(a.dem.backfillBorder(o.dem,s,l),a.neighboringTiles&&a.neighboringTiles[p]&&(a.neighboringTiles[p].backfilled=!0)))}u(n,"fillBorder")}getTile(t){return this.getTileByID(t.key)}getTileByID(t){return this._tiles[t]}_retainLoadedChildren(t,i,n,a){for(let o in this._tiles){let s=this._tiles[o];if(a[o]||!s.hasData()||s.tileID.overscaledZ<=i||s.tileID.overscaledZ>n)continue;let l=s.tileID;for(;s&&s.tileID.overscaledZ>i+1;){let p=s.tileID.scaledTo(s.tileID.overscaledZ-1);s=this._tiles[p.key],s&&s.hasData()&&(l=p)}let c=l;for(;c.overscaledZ>i;)if(c=c.scaledTo(c.overscaledZ-1),t[c.key]){a[l.key]=l;break}}}findLoadedParent(t,i){if(t.key in this._loadedParentTiles){let n=this._loadedParentTiles[t.key];return n&&n.tileID.overscaledZ>=i?n:null}for(let n=t.overscaledZ-1;n>=i;n--){let a=t.scaledTo(n),o=this._getLoadedTile(a);if(o)return o}}_getLoadedTile(t){let i=this._tiles[t.key];return i&&i.hasData()?i:this._cache.getByKey(t.wrapped().key)}updateCacheSize(t){let i=Math.ceil(t.width/this._source.tileSize)+1,n=Math.ceil(t.height/this._source.tileSize)+1,a=i*n,o=this._maxTileCacheZoomLevels===null?it.MAX_TILE_CACHE_ZOOM_LEVELS:this._maxTileCacheZoomLevels,s=Math.floor(a*o),l=typeof this._maxTileCacheSize=="number"?Math.min(this._maxTileCacheSize,s):s;this._cache.setMaxSize(l)}handleWrapJump(t){let i=this._prevLng===void 0?t:this._prevLng,a=(t-i)/360,o=Math.round(a);if(this._prevLng=t,o){let s={};for(let l in this._tiles){let c=this._tiles[l];c.tileID=c.tileID.unwrapTo(c.tileID.wrap+o),s[c.tileID.key]=c}this._tiles=s;for(let l in this._timers)clearTimeout(this._timers[l]),delete this._timers[l];for(let l in this._tiles){let c=this._tiles[l];this._setTileReloadTimer(l,c)}}}update(t,i){if(this.transform=t,this.terrain=i,!this._sourceLoaded||this._paused)return;this.updateCacheSize(t),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={};let n;!this.used&&!this.usedForTerrain?n=[]:this._source.tileID?n=t.getVisibleUnwrappedCoordinates(this._source.tileID).map(h=>new rt(h.canonical.z,h.wrap,h.canonical.z,h.canonical.x,h.canonical.y)):(n=t.coveringTiles({tileSize:this.usedForTerrain?this.tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this.usedForTerrain?!1:this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled,terrain:i}),this._source.hasTile&&(n=n.filter(h=>this._source.hasTile(h))));let a=t.coveringZoomLevel(this._source),o=Math.max(a-di.maxOverzooming,this._source.minzoom),s=Math.max(a+di.maxUnderzooming,this._source.minzoom);if(this.usedForTerrain){let h={};for(let f of n)if(f.canonical.z>this._source.minzoom){let m=f.scaledTo(f.canonical.z-1);h[m.key]=m;let g=f.scaledTo(Math.max(this._source.minzoom,Math.min(f.canonical.z,5)));h[g.key]=g}n=n.concat(Object.values(h))}let l=n.length===0&&!this._updated&&this._didEmitContent;this._updated=!0,l&&this.fire(new z("data",{sourceDataType:"idle",dataType:"source",sourceId:this.id}));let c=this._updateRetainedTiles(n,a);if(J_(this._source.type)){let h={},f={},m=Object.keys(c),g=ne.now();for(let y of m){let x=c[y],b=this._tiles[y];if(!b||b.fadeEndTime!==0&&b.fadeEndTime<=g)continue;let _=this.findLoadedParent(x,o);_&&(this._addTile(_.tileID),h[_.tileID.key]=_.tileID),f[y]=x}this._retainLoadedChildren(f,a,s,c);for(let y in h)c[y]||(this._coveredTiles[y]=!0,c[y]=h[y]);if(i){let y={},x={};for(let b of n)this._tiles[b.key].hasData()?y[b.key]=b:x[b.key]=b;for(let b in x){let _=x[b].children(this._source.maxzoom);this._tiles[_[0].key]&&this._tiles[_[1].key]&&this._tiles[_[2].key]&&this._tiles[_[3].key]&&(y[_[0].key]=c[_[0].key]=_[0],y[_[1].key]=c[_[1].key]=_[1],y[_[2].key]=c[_[2].key]=_[2],y[_[3].key]=c[_[3].key]=_[3],delete x[b])}for(let b in x){let _=this.findLoadedParent(x[b],this._source.minzoom);if(_){y[_.tileID.key]=c[_.tileID.key]=_.tileID;for(let v in y)y[v].isChildOf(_.tileID)&&delete y[v]}}for(let b in this._tiles)y[b]||(this._coveredTiles[b]=!0)}}for(let h in c)this._tiles[h].clearFadeHold();let p=Zy(this._tiles,c);for(let h of p){let f=this._tiles[h];f.hasSymbolBuckets&&!f.holdingForFade()?f.setHoldDuration(this.map._fadeDuration):(!f.hasSymbolBuckets||f.symbolFadeFinished())&&this._removeTile(h)}this._updateLoadedParentTileCache()}releaseSymbolFadeTiles(){for(let t in this._tiles)this._tiles[t].holdingForFade()&&this._removeTile(t)}_updateRetainedTiles(t,i){let n={},a={},o=Math.max(i-di.maxOverzooming,this._source.minzoom),s=Math.max(i+di.maxUnderzooming,this._source.minzoom),l={};for(let c of t){let p=this._addTile(c);n[c.key]=c,!p.hasData()&&i<this._source.maxzoom&&(l[c.key]=c)}this._retainLoadedChildren(l,i,s,n);for(let c of t){let p=this._tiles[c.key];if(p.hasData())continue;if(i+1>this._source.maxzoom){let f=c.children(this._source.maxzoom)[0],m=this.getTile(f);if(m&&m.hasData()){n[f.key]=f;continue}}else{let f=c.children(this._source.maxzoom);if(n[f[0].key]&&n[f[1].key]&&n[f[2].key]&&n[f[3].key])continue}let h=p.wasRequested();for(let f=c.overscaledZ-1;f>=o;--f){let m=c.scaledTo(f);if(a[m.key])break;if(a[m.key]=!0,p=this.getTile(m),!p&&h&&(p=this._addTile(m)),p){let g=p.hasData();if((h||g)&&(n[m.key]=m),h=p.wasRequested(),g)break}}}return n}_updateLoadedParentTileCache(){this._loadedParentTiles={};for(let t in this._tiles){let i=[],n,a=this._tiles[t].tileID;for(;a.overscaledZ>0;){if(a.key in this._loadedParentTiles){n=this._loadedParentTiles[a.key];break}i.push(a.key);let o=a.scaledTo(a.overscaledZ-1);if(n=this._getLoadedTile(o),n)break;a=o}for(let o of i)this._loadedParentTiles[o]=n}}_addTile(t){let i=this._tiles[t.key];if(i)return i;i=this._cache.getAndRemove(t),i&&(this._setTileReloadTimer(t.key,i),i.tileID=t,this._state.initializeTileState(i,this.map?this.map.painter:null),this._cacheTimers[t.key]&&(clearTimeout(this._cacheTimers[t.key]),delete this._cacheTimers[t.key],this._setTileReloadTimer(t.key,i)));let n=i;return i||(i=new dn(t,this._source.tileSize*t.overscaleFactor()),this._loadTile(i,this._tileLoaded.bind(this,i,t.key,i.state))),i.uses++,this._tiles[t.key]=i,n||this._source.fire(new z("dataloading",{tile:i,coord:i.tileID,dataType:"source"})),i}_setTileReloadTimer(t,i){t in this._timers&&(clearTimeout(this._timers[t]),delete this._timers[t]);let n=i.getExpiryTimeout();n&&(this._timers[t]=setTimeout(()=>{this._reloadTile(t,"expired"),delete this._timers[t]},n))}_removeTile(t){let i=this._tiles[t];i&&(i.uses--,delete this._tiles[t],this._timers[t]&&(clearTimeout(this._timers[t]),delete this._timers[t]),!(i.uses>0)&&(i.hasData()&&i.state!=="reloading"?this._cache.add(i.tileID,i,i.getExpiryTimeout()):(i.aborted=!0,this._abortTile(i),this._unloadTile(i))))}clearTiles(){this._shouldReloadOnResume=!1,this._paused=!1;for(let t in this._tiles)this._removeTile(t);this._cache.reset()}tilesIn(t,i,n){let a=[],o=this.transform;if(!o)return a;let s=n?o.getCameraQueryGeometry(t):t,l=t.map(y=>o.pointCoordinate(y,this.terrain)),c=s.map(y=>o.pointCoordinate(y,this.terrain)),p=this.getIds(),h=1/0,f=1/0,m=-1/0,g=-1/0;for(let y of c)h=Math.min(h,y.x),f=Math.min(f,y.y),m=Math.max(m,y.x),g=Math.max(g,y.y);for(let y=0;y<p.length;y++){let x=this._tiles[p[y]];if(x.holdingForFade())continue;let b=x.tileID,_=Math.pow(2,o.zoom-x.tileID.overscaledZ),v=i*x.queryPadding*8192/x.tileSize/_,S=[b.getTilePoint(new ze(h,f)),b.getTilePoint(new ze(m,g))];if(S[0].x-v<8192&&S[0].y-v<8192&&S[1].x+v>=0&&S[1].y+v>=0){let P=l.map(A=>b.getTilePoint(A)),T=c.map(A=>b.getTilePoint(A));a.push({tile:x,tileID:b,queryGeometry:P,cameraQueryGeometry:T,scale:_})}}return a}getVisibleCoordinates(t){let i=this.getRenderableIds(t).map(n=>this._tiles[n].tileID);for(let n of i)n.posMatrix=this.transform.calculatePosMatrix(n.toUnwrapped());return i}hasTransition(){if(this._source.hasTransition())return!0;if(J_(this._source.type)){let t=ne.now();for(let i in this._tiles)if(this._tiles[i].fadeEndTime>=t)return!0}return!1}setFeatureState(t,i,n){t=t||"_geojsonTileLayer",this._state.updateState(t,i,n)}removeFeatureState(t,i,n){t=t||"_geojsonTileLayer",this._state.removeFeatureState(t,i,n)}getFeatureState(t,i){return t=t||"_geojsonTileLayer",this._state.getState(t,i)}setDependencies(t,i,n){let a=this._tiles[t];a&&a.setDependencies(i,n)}reloadTilesForDependencies(t,i){for(let n in this._tiles)this._tiles[n].hasDependency(t,i)&&this._reloadTile(n,"reloading");this._cache.filter(n=>!n.hasDependency(t,i))}};u(di,"SourceCache");var or=di;or.maxOverzooming=10;or.maxUnderzooming=3;function Y_(r,e){let t=Math.abs(r.wrap*2)-+(r.wrap<0),i=Math.abs(e.wrap*2)-+(e.wrap<0);return r.overscaledZ-e.overscaledZ||i-t||e.canonical.y-r.canonical.y||e.canonical.x-r.canonical.x}u(Y_,"compareTileId");function J_(r){return r==="raster"||r==="image"||r==="video"}u(J_,"isRasterType");d();d();d();d();var Q_='(()=>{var Tf=Object.create;var da=Object.defineProperty;var Ef=Object.getOwnPropertyDescriptor;var Ff=Object.getOwnPropertyNames;var Mf=Object.getPrototypeOf,Lf=Object.prototype.hasOwnProperty;var we=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),sl=(e,t)=>{for(var r in t)da(e,r,{get:t[r],enumerable:!0})},Df=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Ff(t))!Lf.call(e,i)&&i!==r&&da(e,i,{get:()=>t[i],enumerable:!(n=Ef(t,i))||n.enumerable});return e};var Z=(e,t,r)=>(r=e!=null?Tf(Mf(e)):{},Df(t||!e||!e.__esModule?da(r,"default",{value:e,enumerable:!0}):r,e));var he=we((Kx,ll)=>{"use strict";ll.exports=rr;function rr(e,t){this.x=e,this.y=t}rr.prototype={clone:function(){return new rr(this.x,this.y)},add:function(e){return this.clone()._add(e)},sub:function(e){return this.clone()._sub(e)},multByPoint:function(e){return this.clone()._multByPoint(e)},divByPoint:function(e){return this.clone()._divByPoint(e)},mult:function(e){return this.clone()._mult(e)},div:function(e){return this.clone()._div(e)},rotate:function(e){return this.clone()._rotate(e)},rotateAround:function(e,t){return this.clone()._rotateAround(e,t)},matMult:function(e){return this.clone()._matMult(e)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(e){return this.x===e.x&&this.y===e.y},dist:function(e){return Math.sqrt(this.distSqr(e))},distSqr:function(e){var t=e.x-this.x,r=e.y-this.y;return t*t+r*r},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(e){return Math.atan2(this.y-e.y,this.x-e.x)},angleWith:function(e){return this.angleWithSep(e.x,e.y)},angleWithSep:function(e,t){return Math.atan2(this.x*t-this.y*e,this.x*e+this.y*t)},_matMult:function(e){var t=e[0]*this.x+e[1]*this.y,r=e[2]*this.x+e[3]*this.y;return this.x=t,this.y=r,this},_add:function(e){return this.x+=e.x,this.y+=e.y,this},_sub:function(e){return this.x-=e.x,this.y-=e.y,this},_mult:function(e){return this.x*=e,this.y*=e,this},_div:function(e){return this.x/=e,this.y/=e,this},_multByPoint:function(e){return this.x*=e.x,this.y*=e.y,this},_divByPoint:function(e){return this.x/=e.x,this.y/=e.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var e=this.y;return this.y=this.x,this.x=-e,this},_rotate:function(e){var t=Math.cos(e),r=Math.sin(e),n=t*this.x-r*this.y,i=r*this.x+t*this.y;return this.x=n,this.y=i,this},_rotateAround:function(e,t){var r=Math.cos(e),n=Math.sin(e),i=t.x+r*(this.x-t.x)-n*(this.y-t.y),o=t.y+n*(this.x-t.x)+r*(this.y-t.y);return this.x=i,this.y=o,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}};rr.convert=function(e){return e instanceof rr?e:Array.isArray(e)?new rr(e[0],e[1]):e}});var ga=we((Yx,cl)=>{"use strict";cl.exports=ul;function ul(e,t,r,n){this.cx=3*e,this.bx=3*(r-e)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*t,this.by=3*(n-t)-this.cy,this.ay=1-this.cy-this.by,this.p1x=e,this.p1y=t,this.p2x=r,this.p2y=n}ul.prototype={sampleCurveX:function(e){return((this.ax*e+this.bx)*e+this.cx)*e},sampleCurveY:function(e){return((this.ay*e+this.by)*e+this.cy)*e},sampleCurveDerivativeX:function(e){return(3*this.ax*e+2*this.bx)*e+this.cx},solveCurveX:function(e,t){if(t===void 0&&(t=1e-6),e<0)return 0;if(e>1)return 1;for(var r=e,n=0;n<8;n++){var i=this.sampleCurveX(r)-e;if(Math.abs(i)<t)return r;var o=this.sampleCurveDerivativeX(r);if(Math.abs(o)<1e-6)break;r=r-i/o}var a=0,s=1;for(r=e,n=0;n<20&&(i=this.sampleCurveX(r),!(Math.abs(i-e)<t));n++)e>i?a=r:s=r,r=(s-a)*.5+a;return r},solve:function(e,t){return this.sampleCurveY(this.solveCurveX(e,t))}}});var Du=we((w0,es)=>{function Jm(e,t){var r,n,i,o,a,s,l,u,c,p;for(r=e.length&3,n=e.length-r,i=t,a=3432918353,l=461845907,p=0;p<n;)c=e.charCodeAt(p)&255|(e.charCodeAt(++p)&255)<<8|(e.charCodeAt(++p)&255)<<16|(e.charCodeAt(++p)&255)<<24,++p,c=(c&65535)*a+(((c>>>16)*a&65535)<<16)&4294967295,c=c<<15|c>>>17,c=(c&65535)*l+(((c>>>16)*l&65535)<<16)&4294967295,i^=c,i=i<<13|i>>>19,o=(i&65535)*5+(((i>>>16)*5&65535)<<16)&4294967295,i=(o&65535)+27492+(((o>>>16)+58964&65535)<<16);switch(c=0,r){case 3:c^=(e.charCodeAt(p+2)&255)<<16;case 2:c^=(e.charCodeAt(p+1)&255)<<8;case 1:c^=e.charCodeAt(p)&255,c=(c&65535)*a+(((c>>>16)*a&65535)<<16)&4294967295,c=c<<15|c>>>17,c=(c&65535)*l+(((c>>>16)*l&65535)<<16)&4294967295,i^=c}return i^=e.length,i^=i>>>16,i=(i&65535)*2246822507+(((i>>>16)*2246822507&65535)<<16)&4294967295,i^=i>>>13,i=(i&65535)*3266489909+(((i>>>16)*3266489909&65535)<<16)&4294967295,i^=i>>>16,i>>>0}typeof es<"u"&&(es.exports=Jm)});var Vu=we((A0,ts)=>{function Wm(e,t){for(var r=e.length,n=t^r,i=0,o;r>=4;)o=e.charCodeAt(i)&255|(e.charCodeAt(++i)&255)<<8|(e.charCodeAt(++i)&255)<<16|(e.charCodeAt(++i)&255)<<24,o=(o&65535)*1540483477+(((o>>>16)*1540483477&65535)<<16),o^=o>>>24,o=(o&65535)*1540483477+(((o>>>16)*1540483477&65535)<<16),n=(n&65535)*1540483477+(((n>>>16)*1540483477&65535)<<16)^o,r-=4,++i;switch(r){case 3:n^=(e.charCodeAt(i+2)&255)<<16;case 2:n^=(e.charCodeAt(i+1)&255)<<8;case 1:n^=e.charCodeAt(i)&255,n=(n&65535)*1540483477+(((n>>>16)*1540483477&65535)<<16)}return n^=n>>>13,n=(n&65535)*1540483477+(((n>>>16)*1540483477&65535)<<16),n^=n>>>15,n>>>0}typeof ts!==void 0&&(ts.exports=Wm)});var rs=we((_0,fo)=>{var Bu=Du(),Hm=Vu();fo.exports=Bu;fo.exports.murmur3=Bu;fo.exports.murmur2=Hm});var hs=we((g1,ms)=>{"use strict";ms.exports=Io;ms.exports.default=Io;function Io(e,t,r){r=r||2;var n=t&&t.length,i=n?t[0]*r:e.length,o=Sc(e,0,i,r,!0),a=[];if(!o||o.next===o.prev)return a;var s,l,u,c,p,f,y;if(n&&(o=Vd(e,t,o,r)),e.length>80*r){s=u=e[0],l=c=e[1];for(var m=r;m<i;m+=r)p=e[m],f=e[m+1],p<s&&(s=p),f<l&&(l=f),p>u&&(u=p),f>c&&(c=f);y=Math.max(u-s,c-l),y=y!==0?32767/y:0}return Bn(o,a,r,s,l,y,0),a}function Sc(e,t,r,n,i){var o,a;if(i===ys(e,t,r,n)>0)for(o=t;o<r;o+=n)a=Pc(o,e[o],e[o+1],a);else for(o=r-n;o>=t;o-=n)a=Pc(o,e[o],e[o+1],a);return a&&Co(a,a.next)&&(Rn(a),a=a.next),a}function Ht(e,t){if(!e)return e;t||(t=e);var r=e,n;do if(n=!1,!r.steiner&&(Co(r,r.next)||se(r.prev,r,r.next)===0)){if(Rn(r),r=t=r.prev,r===r.next)break;n=!0}else r=r.next;while(n||r!==t);return t}function Bn(e,t,r,n,i,o,a){if(e){!a&&o&&Nd(e,n,i,o);for(var s=e,l,u;e.prev!==e.next;){if(l=e.prev,u=e.next,o?Md(e,n,i,o):Fd(e)){t.push(l.i/r|0),t.push(e.i/r|0),t.push(u.i/r|0),Rn(e),e=u.next,s=u.next;continue}if(e=u,e===s){a?a===1?(e=Ld(Ht(e),t,r),Bn(e,t,r,n,i,o,2)):a===2&&Dd(e,t,r,n,i,o):Bn(Ht(e),t,r,n,i,o,1);break}}}}function Fd(e){var t=e.prev,r=e,n=e.next;if(se(t,r,n)>=0)return!1;for(var i=t.x,o=r.x,a=n.x,s=t.y,l=r.y,u=n.y,c=i<o?i<a?i:a:o<a?o:a,p=s<l?s<u?s:u:l<u?l:u,f=i>o?i>a?i:a:o>a?o:a,y=s>l?s>u?s:u:l>u?l:u,m=n.next;m!==t;){if(m.x>=c&&m.x<=f&&m.y>=p&&m.y<=y&&Pr(i,s,o,l,a,u,m.x,m.y)&&se(m.prev,m,m.next)>=0)return!1;m=m.next}return!0}function Md(e,t,r,n){var i=e.prev,o=e,a=e.next;if(se(i,o,a)>=0)return!1;for(var s=i.x,l=o.x,u=a.x,c=i.y,p=o.y,f=a.y,y=s<l?s<u?s:u:l<u?l:u,m=c<p?c<f?c:f:p<f?p:f,h=s>l?s>u?s:u:l>u?l:u,d=c>p?c>f?c:f:p>f?p:f,g=ps(y,m,t,r,n),v=ps(h,d,t,r,n),b=e.prevZ,x=e.nextZ;b&&b.z>=g&&x&&x.z<=v;){if(b.x>=y&&b.x<=h&&b.y>=m&&b.y<=d&&b!==i&&b!==a&&Pr(s,c,l,p,u,f,b.x,b.y)&&se(b.prev,b,b.next)>=0||(b=b.prevZ,x.x>=y&&x.x<=h&&x.y>=m&&x.y<=d&&x!==i&&x!==a&&Pr(s,c,l,p,u,f,x.x,x.y)&&se(x.prev,x,x.next)>=0))return!1;x=x.nextZ}for(;b&&b.z>=g;){if(b.x>=y&&b.x<=h&&b.y>=m&&b.y<=d&&b!==i&&b!==a&&Pr(s,c,l,p,u,f,b.x,b.y)&&se(b.prev,b,b.next)>=0)return!1;b=b.prevZ}for(;x&&x.z<=v;){if(x.x>=y&&x.x<=h&&x.y>=m&&x.y<=d&&x!==i&&x!==a&&Pr(s,c,l,p,u,f,x.x,x.y)&&se(x.prev,x,x.next)>=0)return!1;x=x.nextZ}return!0}function Ld(e,t,r){var n=e;do{var i=n.prev,o=n.next.next;!Co(i,o)&&wc(i,n,n.next,o)&&zn(i,o)&&zn(o,i)&&(t.push(i.i/r|0),t.push(n.i/r|0),t.push(o.i/r|0),Rn(n),Rn(n.next),n=e=o),n=n.next}while(n!==e);return Ht(n)}function Dd(e,t,r,n,i,o){var a=e;do{for(var s=a.next.next;s!==a.prev;){if(a.i!==s.i&&Gd(a,s)){var l=Ac(a,s);a=Ht(a,a.next),l=Ht(l,l.next),Bn(a,t,r,n,i,o,0),Bn(l,t,r,n,i,o,0);return}s=s.next}a=a.next}while(a!==e)}function Vd(e,t,r,n){var i=[],o,a,s,l,u;for(o=0,a=t.length;o<a;o++)s=t[o]*n,l=o<a-1?t[o+1]*n:e.length,u=Sc(e,s,l,n,!1),u===u.next&&(u.steiner=!0),i.push($d(u));for(i.sort(Bd),o=0;o<i.length;o++)r=zd(i[o],r);return r}function Bd(e,t){return e.x-t.x}function zd(e,t){var r=Rd(e,t);if(!r)return t;var n=Ac(r,e);return Ht(n,n.next),Ht(r,r.next)}function Rd(e,t){var r=t,n=e.x,i=e.y,o=-1/0,a;do{if(i<=r.y&&i>=r.next.y&&r.next.y!==r.y){var s=r.x+(i-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(s<=n&&s>o&&(o=s,a=r.x<r.next.x?r:r.next,s===n))return a}r=r.next}while(r!==t);if(!a)return null;var l=a,u=a.x,c=a.y,p=1/0,f;r=a;do n>=r.x&&r.x>=u&&n!==r.x&&Pr(i<c?n:o,i,u,c,i<c?o:n,i,r.x,r.y)&&(f=Math.abs(i-r.y)/(n-r.x),zn(r,e)&&(f<p||f===p&&(r.x>a.x||r.x===a.x&&Od(a,r)))&&(a=r,p=f)),r=r.next;while(r!==l);return a}function Od(e,t){return se(e.prev,e,t.prev)<0&&se(t.next,e,e.next)<0}function Nd(e,t,r,n){var i=e;do i.z===0&&(i.z=ps(i.x,i.y,t,r,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next;while(i!==e);i.prevZ.nextZ=null,i.prevZ=null,Ud(i)}function Ud(e){var t,r,n,i,o,a,s,l,u=1;do{for(r=e,e=null,o=null,a=0;r;){for(a++,n=r,s=0,t=0;t<u&&(s++,n=n.nextZ,!!n);t++);for(l=u;s>0||l>0&&n;)s!==0&&(l===0||!n||r.z<=n.z)?(i=r,r=r.nextZ,s--):(i=n,n=n.nextZ,l--),o?o.nextZ=i:e=i,i.prevZ=o,o=i;r=n}o.nextZ=null,u*=2}while(a>1);return e}function ps(e,t,r,n,i){return e=(e-r)*i|0,t=(t-n)*i|0,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,e|t<<1}function $d(e){var t=e,r=e;do(t.x<r.x||t.x===r.x&&t.y<r.y)&&(r=t),t=t.next;while(t!==e);return r}function Pr(e,t,r,n,i,o,a,s){return(i-a)*(t-s)>=(e-a)*(o-s)&&(e-a)*(n-s)>=(r-a)*(t-s)&&(r-a)*(o-s)>=(i-a)*(n-s)}function Gd(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!qd(e,t)&&(zn(e,t)&&zn(t,e)&&jd(e,t)&&(se(e.prev,e,t.prev)||se(e,t.prev,t))||Co(e,t)&&se(e.prev,e,e.next)>0&&se(t.prev,t,t.next)>0)}function se(e,t,r){return(t.y-e.y)*(r.x-t.x)-(t.x-e.x)*(r.y-t.y)}function Co(e,t){return e.x===t.x&&e.y===t.y}function wc(e,t,r,n){var i=_o(se(e,t,r)),o=_o(se(e,t,n)),a=_o(se(r,n,e)),s=_o(se(r,n,t));return!!(i!==o&&a!==s||i===0&&Ao(e,r,t)||o===0&&Ao(e,n,t)||a===0&&Ao(r,e,n)||s===0&&Ao(r,t,n))}function Ao(e,t,r){return t.x<=Math.max(e.x,r.x)&&t.x>=Math.min(e.x,r.x)&&t.y<=Math.max(e.y,r.y)&&t.y>=Math.min(e.y,r.y)}function _o(e){return e>0?1:e<0?-1:0}function qd(e,t){var r=e;do{if(r.i!==e.i&&r.next.i!==e.i&&r.i!==t.i&&r.next.i!==t.i&&wc(r,r.next,e,t))return!0;r=r.next}while(r!==e);return!1}function zn(e,t){return se(e.prev,e,e.next)<0?se(e,t,e.next)>=0&&se(e,e.prev,t)>=0:se(e,t,e.prev)<0||se(e,e.next,t)<0}function jd(e,t){var r=e,n=!1,i=(e.x+t.x)/2,o=(e.y+t.y)/2;do r.y>o!=r.next.y>o&&r.next.y!==r.y&&i<(r.next.x-r.x)*(o-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next;while(r!==e);return n}function Ac(e,t){var r=new fs(e.i,e.x,e.y),n=new fs(t.i,t.x,t.y),i=e.next,o=t.prev;return e.next=t,t.prev=e,r.next=i,i.prev=r,n.next=r,r.prev=n,o.next=n,n.prev=o,n}function Pc(e,t,r,n){var i=new fs(e,t,r);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function Rn(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)}function fs(e,t,r){this.i=e,this.x=t,this.y=r,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}Io.deviation=function(e,t,r,n){var i=t&&t.length,o=i?t[0]*r:e.length,a=Math.abs(ys(e,0,o,r));if(i)for(var s=0,l=t.length;s<l;s++){var u=t[s]*r,c=s<l-1?t[s+1]*r:e.length;a-=Math.abs(ys(e,u,c,r))}var p=0;for(s=0;s<n.length;s+=3){var f=n[s]*r,y=n[s+1]*r,m=n[s+2]*r;p+=Math.abs((e[f]-e[m])*(e[y+1]-e[f+1])-(e[f]-e[y])*(e[m+1]-e[f+1]))}return a===0&&p===0?0:Math.abs((p-a)/a)};function ys(e,t,r,n){for(var i=0,o=t,a=r-n;o<r;o+=n)i+=(e[a]-e[o])*(e[o+1]+e[a+1]),a=o;return i}Io.flatten=function(e){for(var t=e[0][0].length,r={vertices:[],holes:[],dimensions:t},n=0,i=0;i<e.length;i++){for(var o=0;o<e[i].length;o++)for(var a=0;a<t;a++)r.vertices.push(e[i][o][a]);i>0&&(n+=e[i-1].length,r.holes.push(n))}return r}});var gs=we((eP,Mc)=>{"use strict";var Xd=he();Mc.exports=_r;function _r(e,t,r,n,i){this.properties={},this.extent=r,this.type=0,this._pbf=e,this._geometry=-1,this._keys=n,this._values=i,e.readFields(Qd,this,t)}function Qd(e,t,r){e==1?t.id=r.readVarint():e==2?eg(r,t):e==3?t.type=r.readVarint():e==4&&(t._geometry=r.pos)}function eg(e,t){for(var r=e.readVarint()+e.pos;e.pos<r;){var n=t._keys[e.readVarint()],i=t._values[e.readVarint()];t.properties[n]=i}}_r.types=["Unknown","Point","LineString","Polygon"];_r.prototype.loadGeometry=function(){var e=this._pbf;e.pos=this._geometry;for(var t=e.readVarint()+e.pos,r=1,n=0,i=0,o=0,a=[],s;e.pos<t;){if(n<=0){var l=e.readVarint();r=l&7,n=l>>3}if(n--,r===1||r===2)i+=e.readSVarint(),o+=e.readSVarint(),r===1&&(s&&a.push(s),s=[]),s.push(new Xd(i,o));else if(r===7)s&&s.push(s[0].clone());else throw new Error("unknown command "+r)}return s&&a.push(s),a};_r.prototype.bbox=function(){var e=this._pbf;e.pos=this._geometry;for(var t=e.readVarint()+e.pos,r=1,n=0,i=0,o=0,a=1/0,s=-1/0,l=1/0,u=-1/0;e.pos<t;){if(n<=0){var c=e.readVarint();r=c&7,n=c>>3}if(n--,r===1||r===2)i+=e.readSVarint(),o+=e.readSVarint(),i<a&&(a=i),i>s&&(s=i),o<l&&(l=o),o>u&&(u=o);else if(r!==7)throw new Error("unknown command "+r)}return[a,l,s,u]};_r.prototype.toGeoJSON=function(e,t,r){var n=this.extent*Math.pow(2,r),i=this.extent*e,o=this.extent*t,a=this.loadGeometry(),s=_r.types[this.type],l,u;function c(y){for(var m=0;m<y.length;m++){var h=y[m],d=180-(h.y+o)*360/n;y[m]=[(h.x+i)*360/n-180,360/Math.PI*Math.atan(Math.exp(d*Math.PI/180))-90]}}switch(this.type){case 1:var p=[];for(l=0;l<a.length;l++)p[l]=a[l][0];a=p,c(a);break;case 2:for(l=0;l<a.length;l++)c(a[l]);break;case 3:for(a=tg(a),l=0;l<a.length;l++)for(u=0;u<a[l].length;u++)c(a[l][u]);break}a.length===1?a=a[0]:s="Multi"+s;var f={type:"Feature",geometry:{type:s,coordinates:a},properties:this.properties};return"id"in this&&(f.id=this.id),f};function tg(e){var t=e.length;if(t<=1)return[e];for(var r=[],n,i,o=0;o<t;o++){var a=rg(e[o]);a!==0&&(i===void 0&&(i=a<0),i===a<0?(n&&r.push(n),n=[e[o]]):n.push(e[o]))}return n&&r.push(n),r}function rg(e){for(var t=0,r=0,n=e.length,i=n-1,o,a;r<n;i=r++)o=e[r],a=e[i],t+=(a.x-o.x)*(o.y+a.y);return t}});var xs=we((tP,Dc)=>{"use strict";var ng=gs();Dc.exports=Lc;function Lc(e,t){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=e,this._keys=[],this._values=[],this._features=[],e.readFields(ig,this,t),this.length=this._features.length}function ig(e,t,r){e===15?t.version=r.readVarint():e===1?t.name=r.readString():e===5?t.extent=r.readVarint():e===2?t._features.push(r.pos):e===3?t._keys.push(r.readString()):e===4&&t._values.push(og(r))}function og(e){for(var t=null,r=e.readVarint()+e.pos;e.pos<r;){var n=e.readVarint()>>3;t=n===1?e.readString():n===2?e.readFloat():n===3?e.readDouble():n===4?e.readVarint64():n===5?e.readVarint():n===6?e.readSVarint():n===7?e.readBoolean():null}return t}Lc.prototype.feature=function(e){if(e<0||e>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[e];var t=this._pbf.readVarint()+this._pbf.pos;return new ng(this._pbf,t,this.extent,this._keys,this._values)}});var Bc=we((rP,Vc)=>{"use strict";var ag=xs();Vc.exports=sg;function sg(e,t){this.layers=e.readFields(lg,{},t)}function lg(e,t,r){if(e===3){var n=new ag(r,r.readVarint()+r.pos);n.length&&(t[n.name]=n)}}});var It=we((nP,To)=>{To.exports.VectorTile=Bc();To.exports.VectorTileFeature=gs();To.exports.VectorTileLayer=xs()});var np=we(ws=>{ws.read=function(e,t,r,n,i){var o,a,s=i*8-n-1,l=(1<<s)-1,u=l>>1,c=-7,p=r?i-1:0,f=r?-1:1,y=e[t+p];for(p+=f,o=y&(1<<-c)-1,y>>=-c,c+=s;c>0;o=o*256+e[t+p],p+=f,c-=8);for(a=o&(1<<-c)-1,o>>=-c,c+=n;c>0;a=a*256+e[t+p],p+=f,c-=8);if(o===0)o=1-u;else{if(o===l)return a?NaN:(y?-1:1)*(1/0);a=a+Math.pow(2,n),o=o-u}return(y?-1:1)*a*Math.pow(2,o-n)};ws.write=function(e,t,r,n,i,o){var a,s,l,u=o*8-i-1,c=(1<<u)-1,p=c>>1,f=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,y=n?0:o-1,m=n?1:-1,h=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=c):(a=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-a))<1&&(a--,l*=2),a+p>=1?t+=f/l:t+=f*Math.pow(2,1-p),t*l>=2&&(a++,l/=2),a+p>=c?(s=0,a=c):a+p>=1?(s=(t*l-1)*Math.pow(2,i),a=a+p):(s=t*Math.pow(2,p-1)*Math.pow(2,i),a=0));i>=8;e[r+y]=s&255,y+=m,s/=256,i-=8);for(a=a<<i|s,u+=i;u>0;e[r+y]=a&255,y+=m,a/=256,u-=8);e[r+y-m]|=h*128}});var $n=we((RS,lp)=>{"use strict";lp.exports=J;var Do=np();function J(e){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(e)?e:new Uint8Array(e||0),this.pos=0,this.type=0,this.length=this.buf.length}J.Varint=0;J.Fixed64=1;J.Bytes=2;J.Fixed32=5;var As=65536*65536,ip=1/As,Cg=12,sp=typeof TextDecoder>"u"?null:new TextDecoder("utf8");J.prototype={destroy:function(){this.buf=null},readFields:function(e,t,r){for(r=r||this.length;this.pos<r;){var n=this.readVarint(),i=n>>3,o=this.pos;this.type=n&7,e(i,t,this),this.pos===o&&this.skip(n)}return t},readMessage:function(e,t){return this.readFields(e,t,this.readVarint()+this.pos)},readFixed32:function(){var e=Vo(this.buf,this.pos);return this.pos+=4,e},readSFixed32:function(){var e=ap(this.buf,this.pos);return this.pos+=4,e},readFixed64:function(){var e=Vo(this.buf,this.pos)+Vo(this.buf,this.pos+4)*As;return this.pos+=8,e},readSFixed64:function(){var e=Vo(this.buf,this.pos)+ap(this.buf,this.pos+4)*As;return this.pos+=8,e},readFloat:function(){var e=Do.read(this.buf,this.pos,!0,23,4);return this.pos+=4,e},readDouble:function(){var e=Do.read(this.buf,this.pos,!0,52,8);return this.pos+=8,e},readVarint:function(e){var t=this.buf,r,n;return n=t[this.pos++],r=n&127,n<128||(n=t[this.pos++],r|=(n&127)<<7,n<128)||(n=t[this.pos++],r|=(n&127)<<14,n<128)||(n=t[this.pos++],r|=(n&127)<<21,n<128)?r:(n=t[this.pos],r|=(n&15)<<28,kg(r,e,this))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var e=this.readVarint();return e%2===1?(e+1)/-2:e/2},readBoolean:function(){return!!this.readVarint()},readString:function(){var e=this.readVarint()+this.pos,t=this.pos;return this.pos=e,e-t>=Cg&&sp?$g(this.buf,t,e):Ug(this.buf,t,e)},readBytes:function(){var e=this.readVarint()+this.pos,t=this.buf.subarray(this.pos,e);return this.pos=e,t},readPackedVarint:function(e,t){if(this.type!==J.Bytes)return e.push(this.readVarint(t));var r=ut(this);for(e=e||[];this.pos<r;)e.push(this.readVarint(t));return e},readPackedSVarint:function(e){if(this.type!==J.Bytes)return e.push(this.readSVarint());var t=ut(this);for(e=e||[];this.pos<t;)e.push(this.readSVarint());return e},readPackedBoolean:function(e){if(this.type!==J.Bytes)return e.push(this.readBoolean());var t=ut(this);for(e=e||[];this.pos<t;)e.push(this.readBoolean());return e},readPackedFloat:function(e){if(this.type!==J.Bytes)return e.push(this.readFloat());var t=ut(this);for(e=e||[];this.pos<t;)e.push(this.readFloat());return e},readPackedDouble:function(e){if(this.type!==J.Bytes)return e.push(this.readDouble());var t=ut(this);for(e=e||[];this.pos<t;)e.push(this.readDouble());return e},readPackedFixed32:function(e){if(this.type!==J.Bytes)return e.push(this.readFixed32());var t=ut(this);for(e=e||[];this.pos<t;)e.push(this.readFixed32());return e},readPackedSFixed32:function(e){if(this.type!==J.Bytes)return e.push(this.readSFixed32());var t=ut(this);for(e=e||[];this.pos<t;)e.push(this.readSFixed32());return e},readPackedFixed64:function(e){if(this.type!==J.Bytes)return e.push(this.readFixed64());var t=ut(this);for(e=e||[];this.pos<t;)e.push(this.readFixed64());return e},readPackedSFixed64:function(e){if(this.type!==J.Bytes)return e.push(this.readSFixed64());var t=ut(this);for(e=e||[];this.pos<t;)e.push(this.readSFixed64());return e},skip:function(e){var t=e&7;if(t===J.Varint)for(;this.buf[this.pos++]>127;);else if(t===J.Bytes)this.pos=this.readVarint()+this.pos;else if(t===J.Fixed32)this.pos+=4;else if(t===J.Fixed64)this.pos+=8;else throw new Error("Unimplemented type: "+t)},writeTag:function(e,t){this.writeVarint(e<<3|t)},realloc:function(e){for(var t=this.length||16;t<this.pos+e;)t*=2;if(t!==this.length){var r=new Uint8Array(t);r.set(this.buf),this.buf=r,this.length=t}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(e){this.realloc(4),kr(this.buf,e,this.pos),this.pos+=4},writeSFixed32:function(e){this.realloc(4),kr(this.buf,e,this.pos),this.pos+=4},writeFixed64:function(e){this.realloc(8),kr(this.buf,e&-1,this.pos),kr(this.buf,Math.floor(e*ip),this.pos+4),this.pos+=8},writeSFixed64:function(e){this.realloc(8),kr(this.buf,e&-1,this.pos),kr(this.buf,Math.floor(e*ip),this.pos+4),this.pos+=8},writeVarint:function(e){if(e=+e||0,e>268435455||e<0){Tg(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:function(e){this.writeVarint(e<0?-e*2-1:e*2)},writeBoolean:function(e){this.writeVarint(!!e)},writeString:function(e){e=String(e),this.realloc(e.length*4),this.pos++;var t=this.pos;this.pos=Gg(this.buf,e,this.pos);var r=this.pos-t;r>=128&&op(t,r,this),this.pos=t-1,this.writeVarint(r),this.pos+=r},writeFloat:function(e){this.realloc(4),Do.write(this.buf,e,this.pos,!0,23,4),this.pos+=4},writeDouble:function(e){this.realloc(8),Do.write(this.buf,e,this.pos,!0,52,8),this.pos+=8},writeBytes:function(e){var t=e.length;this.writeVarint(t),this.realloc(t);for(var r=0;r<t;r++)this.buf[this.pos++]=e[r]},writeRawMessage:function(e,t){this.pos++;var r=this.pos;e(t,this);var n=this.pos-r;n>=128&&op(r,n,this),this.pos=r-1,this.writeVarint(n),this.pos+=n},writeMessage:function(e,t,r){this.writeTag(e,J.Bytes),this.writeRawMessage(t,r)},writePackedVarint:function(e,t){t.length&&this.writeMessage(e,Mg,t)},writePackedSVarint:function(e,t){t.length&&this.writeMessage(e,Lg,t)},writePackedBoolean:function(e,t){t.length&&this.writeMessage(e,Bg,t)},writePackedFloat:function(e,t){t.length&&this.writeMessage(e,Dg,t)},writePackedDouble:function(e,t){t.length&&this.writeMessage(e,Vg,t)},writePackedFixed32:function(e,t){t.length&&this.writeMessage(e,zg,t)},writePackedSFixed32:function(e,t){t.length&&this.writeMessage(e,Rg,t)},writePackedFixed64:function(e,t){t.length&&this.writeMessage(e,Og,t)},writePackedSFixed64:function(e,t){t.length&&this.writeMessage(e,Ng,t)},writeBytesField:function(e,t){this.writeTag(e,J.Bytes),this.writeBytes(t)},writeFixed32Field:function(e,t){this.writeTag(e,J.Fixed32),this.writeFixed32(t)},writeSFixed32Field:function(e,t){this.writeTag(e,J.Fixed32),this.writeSFixed32(t)},writeFixed64Field:function(e,t){this.writeTag(e,J.Fixed64),this.writeFixed64(t)},writeSFixed64Field:function(e,t){this.writeTag(e,J.Fixed64),this.writeSFixed64(t)},writeVarintField:function(e,t){this.writeTag(e,J.Varint),this.writeVarint(t)},writeSVarintField:function(e,t){this.writeTag(e,J.Varint),this.writeSVarint(t)},writeStringField:function(e,t){this.writeTag(e,J.Bytes),this.writeString(t)},writeFloatField:function(e,t){this.writeTag(e,J.Fixed32),this.writeFloat(t)},writeDoubleField:function(e,t){this.writeTag(e,J.Fixed64),this.writeDouble(t)},writeBooleanField:function(e,t){this.writeVarintField(e,!!t)}};function kg(e,t,r){var n=r.buf,i,o;if(o=n[r.pos++],i=(o&112)>>4,o<128||(o=n[r.pos++],i|=(o&127)<<3,o<128)||(o=n[r.pos++],i|=(o&127)<<10,o<128)||(o=n[r.pos++],i|=(o&127)<<17,o<128)||(o=n[r.pos++],i|=(o&127)<<24,o<128)||(o=n[r.pos++],i|=(o&1)<<31,o<128))return Cr(e,i,t);throw new Error("Expected varint not more than 10 bytes")}function ut(e){return e.type===J.Bytes?e.readVarint()+e.pos:e.pos+1}function Cr(e,t,r){return r?t*4294967296+(e>>>0):(t>>>0)*4294967296+(e>>>0)}function Tg(e,t){var r,n;if(e>=0?(r=e%4294967296|0,n=e/4294967296|0):(r=~(-e%4294967296),n=~(-e/4294967296),r^4294967295?r=r+1|0:(r=0,n=n+1|0)),e>=18446744073709552e3||e<-18446744073709552e3)throw new Error("Given varint doesn\'t fit into 10 bytes");t.realloc(10),Eg(r,n,t),Fg(n,t)}function Eg(e,t,r){r.buf[r.pos++]=e&127|128,e>>>=7,r.buf[r.pos++]=e&127|128,e>>>=7,r.buf[r.pos++]=e&127|128,e>>>=7,r.buf[r.pos++]=e&127|128,e>>>=7,r.buf[r.pos]=e&127}function Fg(e,t){var r=(e&7)<<4;t.buf[t.pos++]|=r|((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 op(e,t,r){var n=t<=16383?1:t<=2097151?2:t<=268435455?3:Math.floor(Math.log(t)/(Math.LN2*7));r.realloc(n);for(var i=r.pos-1;i>=e;i--)r.buf[i+n]=r.buf[i]}function Mg(e,t){for(var r=0;r<e.length;r++)t.writeVarint(e[r])}function Lg(e,t){for(var r=0;r<e.length;r++)t.writeSVarint(e[r])}function Dg(e,t){for(var r=0;r<e.length;r++)t.writeFloat(e[r])}function Vg(e,t){for(var r=0;r<e.length;r++)t.writeDouble(e[r])}function Bg(e,t){for(var r=0;r<e.length;r++)t.writeBoolean(e[r])}function zg(e,t){for(var r=0;r<e.length;r++)t.writeFixed32(e[r])}function Rg(e,t){for(var r=0;r<e.length;r++)t.writeSFixed32(e[r])}function Og(e,t){for(var r=0;r<e.length;r++)t.writeFixed64(e[r])}function Ng(e,t){for(var r=0;r<e.length;r++)t.writeSFixed64(e[r])}function Vo(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16)+e[t+3]*16777216}function kr(e,t,r){e[r]=t,e[r+1]=t>>>8,e[r+2]=t>>>16,e[r+3]=t>>>24}function ap(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16)+(e[t+3]<<24)}function Ug(e,t,r){for(var n="",i=t;i<r;){var o=e[i],a=null,s=o>239?4:o>223?3:o>191?2:1;if(i+s>r)break;var l,u,c;s===1?o<128&&(a=o):s===2?(l=e[i+1],(l&192)===128&&(a=(o&31)<<6|l&63,a<=127&&(a=null))):s===3?(l=e[i+1],u=e[i+2],(l&192)===128&&(u&192)===128&&(a=(o&15)<<12|(l&63)<<6|u&63,(a<=2047||a>=55296&&a<=57343)&&(a=null))):s===4&&(l=e[i+1],u=e[i+2],c=e[i+3],(l&192)===128&&(u&192)===128&&(c&192)===128&&(a=(o&15)<<18|(l&63)<<12|(u&63)<<6|c&63,(a<=65535||a>=1114112)&&(a=null))),a===null?(a=65533,s=1):a>65535&&(a-=65536,n+=String.fromCharCode(a>>>10&1023|55296),a=56320|a&1023),n+=String.fromCharCode(a),i+=s}return n}function $g(e,t,r){return sp.decode(e.subarray(t,r))}function Gg(e,t,r){for(var n=0,i,o;n<t.length;n++){if(i=t.charCodeAt(n),i>55295&&i<57344)if(o)if(i<56320){e[r++]=239,e[r++]=191,e[r++]=189,o=i;continue}else i=o-55296<<10|i-56320|65536,o=null;else{i>56319||n+1===t.length?(e[r++]=239,e[r++]=191,e[r++]=189):o=i;continue}else o&&(e[r++]=239,e[r++]=191,e[r++]=189,o=null);i<128?e[r++]=i:(i<2048?e[r++]=i>>6|192:(i<65536?e[r++]=i>>12|224:(e[r++]=i>>18|240,e[r++]=i>>12&63|128),e[r++]=i>>6&63|128),e[r++]=i&63|128)}return r}});var nf=we((k_,rf)=>{rf.exports=na;function na(e,t){var r=e&&e.type,n;if(r==="FeatureCollection")for(n=0;n<e.features.length;n++)na(e.features[n],t);else if(r==="GeometryCollection")for(n=0;n<e.geometries.length;n++)na(e.geometries[n],t);else if(r==="Feature")na(e.geometry,t);else if(r==="Polygon")ef(e.coordinates,t);else if(r==="MultiPolygon")for(n=0;n<e.coordinates.length;n++)ef(e.coordinates[n],t);return e}function ef(e,t){if(e.length!==0){tf(e[0],t);for(var r=1;r<e.length;r++)tf(e[r],!t)}}function tf(e,t){for(var r=0,n=0,i=0,o=e.length,a=o-1;i<o;a=i++){var s=(e[i][0]-e[a][0])*(e[a][1]+e[i][1]),l=r+s;n+=Math.abs(r)>=Math.abs(s)?r-l+s:s-l+r,r=l}r+n>=0!=!!t&&e.reverse()}});var lf=we((F_,sf)=>{"use strict";var Ix=he(),Cx=It().VectorTileFeature;sf.exports=af;function af(e,t){this.options=t||{},this.features=e,this.length=e.length}af.prototype.feature=function(e){return new oa(this.features[e],this.options.extent)};function oa(e,t){this.id=typeof e.id=="number"?e.id:void 0,this.type=e.type,this.rawGeometry=e.type===1?[e.geometry]:e.geometry,this.properties=e.tags,this.extent=t||4096}oa.prototype.loadGeometry=function(){var e=this.rawGeometry;this.geometry=[];for(var t=0;t<e.length;t++){for(var r=e[t],n=[],i=0;i<r.length;i++)n.push(new Ix(r[i][0],r[i][1]));this.geometry.push(n)}return this.geometry};oa.prototype.bbox=function(){this.geometry||this.loadGeometry();for(var e=this.geometry,t=1/0,r=-1/0,n=1/0,i=-1/0,o=0;o<e.length;o++)for(var a=e[o],s=0;s<a.length;s++){var l=a[s];t=Math.min(t,l.x),r=Math.max(r,l.x),n=Math.min(n,l.y),i=Math.max(i,l.y)}return[t,n,r,i]};oa.prototype.toGeoJSON=Cx.prototype.toGeoJSON});var pf=we((M_,oi)=>{var kx=$n(),cf=lf();oi.exports=Us;oi.exports.fromVectorTileJs=Us;oi.exports.fromGeojsonVt=Tx;oi.exports.GeoJSONWrapper=cf;function Us(e){var t=new kx;return Ex(e,t),t.finish()}function Tx(e,t){t=t||{};var r={};for(var n in e)r[n]=new cf(e[n].features,t),r[n].name=n,r[n].version=t.version,r[n].extent=t.extent;return Us({layers:r})}function Ex(e,t){for(var r in e.layers)t.writeMessage(3,Fx,e.layers[r])}function Fx(e,t){t.writeVarintField(15,e.version||1),t.writeStringField(1,e.name||""),t.writeVarintField(5,e.extent||4096);var r,n={keys:[],values:[],keycache:{},valuecache:{}};for(r=0;r<e.length;r++)n.feature=e.feature(r),t.writeMessage(2,Mx,n);var i=n.keys;for(r=0;r<i.length;r++)t.writeStringField(3,i[r]);var o=n.values;for(r=0;r<o.length;r++)t.writeMessage(4,Vx,o[r])}function Mx(e,t){var r=e.feature;r.id!==void 0&&t.writeVarintField(1,r.id),t.writeMessage(2,Lx,e),t.writeVarintField(3,r.type),t.writeMessage(4,Dx,r)}function Lx(e,t){var r=e.feature,n=e.keys,i=e.values,o=e.keycache,a=e.valuecache;for(var s in r.properties){var l=r.properties[s],u=o[s];if(l!==null){typeof u>"u"&&(n.push(s),u=n.length-1,o[s]=u),t.writeVarint(u);var c=typeof l;c!=="string"&&c!=="boolean"&&c!=="number"&&(l=JSON.stringify(l));var p=c+":"+l,f=a[p];typeof f>"u"&&(i.push(l),f=i.length-1,a[p]=f),t.writeVarint(f)}}}function Ns(e,t){return(t<<3)+(e&7)}function uf(e){return e<<1^e>>31}function Dx(e,t){for(var r=e.loadGeometry(),n=e.type,i=0,o=0,a=r.length,s=0;s<a;s++){var l=r[s],u=1;n===1&&(u=l.length),t.writeVarint(Ns(1,u));for(var c=n===3?l.length-1:l.length,p=0;p<c;p++){p===1&&n!==1&&t.writeVarint(Ns(2,c-1));var f=l[p].x-i,y=l[p].y-o;t.writeVarint(uf(f)),t.writeVarint(uf(y)),i+=f,o+=y}n===3&&t.writeVarint(Ns(7,1))}}function Vx(e,t){var r=typeof e;r==="string"?t.writeStringField(1,e):r==="boolean"?t.writeBooleanField(7,e):r==="number"&&(e%1!==0?t.writeDoubleField(3,e):e<0?t.writeSVarintField(6,e):t.writeVarintField(5,e))}});var Vf=Z(he(),1),fl=Z(ga(),1);function yl(e){if(e<=0)return 0;if(e>=1)return 1;let t=e*e,r=t*e;return 4*(e<.5?r:3*(e-t)+r-.75)}function Bf(e,t,r,n){let i=new fl.default(e,t,r,n);return function(o){return i.solve(o)}}var Xx=Bf(.25,.1,.25,1);function rt(e,t,r){return Math.min(r,Math.max(t,e))}function ml(e,t,r){let n=r-t,i=((e-t)%n+n)%n+t;return i===t?r:i}function Ae(e,...t){for(let r of t)for(let n in r)e[n]=r[n];return e}function hl(e){return Math.log(e)/Math.LN2%1===0}function Rr(e,t,r){let n={};for(let i in e)n[i]=t.call(r||this,e[i],i,e);return n}function dl(e,t,r){let n={};for(let i in e)t.call(r||this,e[i],i,e)&&(n[i]=e[i]);return n}function tt(e){return Array.isArray(e)?e.map(tt):typeof e=="object"&&e?Rr(e,tt):e}function gl(e,t){for(let r=0;r<e.length;r++)if(t.indexOf(e[r])>=0)return!0;return!1}var pl={};function ce(e){pl[e]||(typeof console<"u"&&console.warn(e),pl[e]=!0)}function nt(e,t,r){return(r.y-e.y)*(t.x-e.x)>(t.y-e.y)*(r.x-e.x)}function xl(e){let t=0;for(let r=0,n=e.length,i=n-1,o,a;r<n;i=r++)o=e[r],a=e[i],t+=(a.x-o.x)*(o.y+a.y);return t}function Ie(){return typeof WorkerGlobalScope<"u"&&typeof self<"u"&&self instanceof WorkerGlobalScope}var xa=null;function ba(e){if(xa==null){let t=e.navigator?e.navigator.userAgent:null;xa=!!e.safari||!!(t&&(/\\b(iPad|iPhone|iPod)\\b/.test(t)||t.match("Safari")&&!t.match("Chrome")))}return xa}function Or(e){return typeof ImageBitmap<"u"&&e instanceof ImageBitmap}var Ft=class e{constructor(t,r,n){let i=this.cells=[];if(t instanceof ArrayBuffer){this.arrayBuffer=t;let a=new Int32Array(this.arrayBuffer);t=a[0],r=a[1],n=a[2],this.d=r+2*n;for(let u=0;u<this.d*this.d;u++){let c=a[3+u],p=a[3+u+1];i.push(c===p?null:a.subarray(c,p))}let s=a[3+i.length],l=a[3+i.length+1];this.keys=a.subarray(s,l),this.bboxes=a.subarray(l),this.insert=this._insertReadonly}else{this.d=r+2*n;for(let a=0;a<this.d*this.d;a++)i.push([]);this.keys=[],this.bboxes=[]}this.n=r,this.extent=t,this.padding=n,this.scale=r/t,this.uid=0;let o=n/r*t;this.min=-o,this.max=t+o}insert(t,r,n,i,o){this._forEachCell(r,n,i,o,this._insertCell,this.uid++,void 0,void 0),this.keys.push(t),this.bboxes.push(r),this.bboxes.push(n),this.bboxes.push(i),this.bboxes.push(o)}_insertReadonly(){throw new Error("Cannot insert into a GridIndex created from an ArrayBuffer.")}_insertCell(t,r,n,i,o,a){this.cells[o].push(a)}query(t,r,n,i,o){let a=this.min,s=this.max;if(t<=a&&r<=a&&s<=n&&s<=i&&!o)return Array.prototype.slice.call(this.keys);{let l=[],u={};return this._forEachCell(t,r,n,i,this._queryCell,l,u,o),l}}_queryCell(t,r,n,i,o,a,s,l){let u=this.cells[o];if(u!==null){let c=this.keys,p=this.bboxes;for(let f=0;f<u.length;f++){let y=u[f];if(s[y]===void 0){let m=y*4;(l?l(p[m+0],p[m+1],p[m+2],p[m+3]):t<=p[m+2]&&r<=p[m+3]&&n>=p[m+0]&&i>=p[m+1])?(s[y]=!0,a.push(c[y])):s[y]=!1}}}}_forEachCell(t,r,n,i,o,a,s,l){let u=this._convertToCellCoord(t),c=this._convertToCellCoord(r),p=this._convertToCellCoord(n),f=this._convertToCellCoord(i);for(let y=u;y<=p;y++)for(let m=c;m<=f;m++){let h=this.d*m+y;if(!(l&&!l(this._convertFromCellCoord(y),this._convertFromCellCoord(m),this._convertFromCellCoord(y+1),this._convertFromCellCoord(m+1)))&&o.call(this,t,r,n,i,h,a,s,l))return}}_convertFromCellCoord(t){return(t-this.padding)/this.scale}_convertToCellCoord(t){return Math.max(0,Math.min(this.d-1,Math.floor(t*this.scale)+this.padding))}toArrayBuffer(){if(this.arrayBuffer)return this.arrayBuffer;let t=this.cells,r=3+this.cells.length+1+1,n=0;for(let a=0;a<this.cells.length;a++)n+=this.cells[a].length;let i=new Int32Array(r+n+this.keys.length+this.bboxes.length);i[0]=this.extent,i[1]=this.n,i[2]=this.padding;let o=r;for(let a=0;a<t.length;a++){let s=t[a];i[3+a]=o,i.set(s,o),o+=s.length}return i[3+t.length]=o,i.set(this.keys,o),o+=this.keys.length,i[3+t.length+1]=o,i.set(this.bboxes,o),o+=this.bboxes.length,i.buffer}static serialize(t,r){let n=t.toArrayBuffer();return r&&r.push(n),{buffer:n}}static deserialize(t){return new e(t.buffer)}};var Ll=Z(ga(),1),zf=8,Rf={version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},light:{type:"light"},terrain:{type:"terrain"},sources:{required:!0,type:"sources"},sprite:{type:"sprite"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},Of={"*":{type:"source"}},Nf=["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],Uf={type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},$f={type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},Gf={type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{}},default:"mapbox"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},qf={type:{required:!0,type:"enum",values:{geojson:{}}},data:{required:!0,type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"*"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},jf={type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},Zf={type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},Jf={id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},Wf=["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],Hf={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},Kf={"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},Yf={"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},Xf={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},Qf={"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},ey={"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image",{"!":"icon-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"padding",default:[2],units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},"viewport-glyph":{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-variable-anchor-offset":{type:"variableAnchorOffsetCollection",requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field",{"!":"text-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},ty={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},ry={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},ny={type:"array",value:"*"},iy={type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{},within:{}}},oy={type:"enum",values:{Point:{},LineString:{},Polygon:{}}},ay={type:"array",minimum:0,maximum:24,value:["number","color"],length:2},sy={type:"array",value:"*",minimum:1},ly={anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},uy={source:{type:"string",required:!0},exaggeration:{type:"number",minimum:0,default:1}},cy=["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],py={"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},fy={"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},yy={"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},my={"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},hy={"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},dy={"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},gy={"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},xy={"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},by={duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},vy={"*":{type:"string"}},S={$version:zf,$root:Rf,sources:Of,source:Nf,source_vector:Uf,source_raster:$f,source_raster_dem:Gf,source_geojson:qf,source_video:jf,source_image:Zf,layer:Jf,layout:Wf,layout_background:Hf,layout_fill:Kf,layout_circle:Yf,layout_heatmap:Xf,"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:Qf,layout_symbol:ey,layout_raster:ty,layout_hillshade:ry,filter:ny,filter_operator:iy,geometry_type:oy,function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:ay,expression:sy,light:ly,terrain:uy,paint:cy,paint_fill:py,"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:fy,paint_circle:yy,paint_heatmap:my,paint_symbol:hy,paint_raster:dy,paint_hillshade:gy,paint_background:xy,transition:by,"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:vy},Py=["type","source","source-layer","minzoom","maxzoom","filter","layout"];var D=class{constructor(t,r,n,i){this.message=(t?"".concat(t,": "):"")+n,i&&(this.identifier=i),r!=null&&r.__line__&&(this.line=r.__line__)}};function sr(e,...t){for(let r of t)for(let n in r)e[n]=r[n];return e}var Ve=class extends Error{constructor(t,r){super(r),this.message=r,this.key=t}},Ca=class e{constructor(t,r=[]){this.parent=t,this.bindings={};for(let[n,i]of r)this.bindings[n]=i}concat(t){return new e(this,t)}get(t){if(this.bindings[t])return this.bindings[t];if(this.parent)return this.parent.get(t);throw new Error("".concat(t," not found in scope."))}has(t){return this.bindings[t]?!0:this.parent?this.parent.has(t):!1}},cr={kind:"null"},L={kind:"number"},G={kind:"string"},U={kind:"boolean"},ze={kind:"color"},or={kind:"object"},$={kind:"value"},Sy={kind:"error"},Fi={kind:"collator"},pr={kind:"formatted"},Mi={kind:"padding"},Xr={kind:"resolvedImage"},Li={kind:"variableAnchorOffsetCollection"};function Fe(e,t){return{kind:"array",itemType:e,N:t}}function ne(e){if(e.kind==="array"){let t=ne(e.itemType);return typeof e.N=="number"?"array<".concat(t,", ").concat(e.N,">"):e.itemType.kind==="value"?"array":"array<".concat(t,">")}else return e.kind}var wy=[cr,L,G,U,ze,pr,or,Fe($),Mi,Xr,Li];function Gr(e,t){if(t.kind==="error")return null;if(e.kind==="array"){if(t.kind==="array"&&(t.N===0&&t.itemType.kind==="value"||!Gr(e.itemType,t.itemType))&&(typeof e.N!="number"||e.N===t.N))return null}else{if(e.kind===t.kind)return null;if(e.kind==="value"){for(let r of wy)if(!Gr(r,t))return null}}return"Expected ".concat(ne(e)," but found ").concat(ne(t)," instead.")}function Oa(e,t){return t.some(r=>r.kind===e.kind)}function qr(e,t){return t.some(r=>r==="null"?e===null:r==="array"?Array.isArray(e):r==="object"?e&&!Array.isArray(e)&&typeof e=="object":r===typeof e)}function Nr(e,t){return e.kind==="array"&&t.kind==="array"?e.itemType.kind===t.itemType.kind&&typeof e.N=="number":e.kind===t.kind}var Dl=.96422,Vl=1,Bl=.82521,zl=4/29,ar=6/29,Rl=3*ar*ar,Ay=ar*ar*ar,_y=Math.PI/180,Iy=180/Math.PI;function Ol(e){return e=e%360,e<0&&(e+=360),e}function Nl([e,t,r,n]){e=va(e),t=va(t),r=va(r);let i,o,a=Pa((.2225045*e+.7168786*t+.0606169*r)/Vl);e===t&&t===r?i=o=a:(i=Pa((.4360747*e+.3850649*t+.1430804*r)/Dl),o=Pa((.0139322*e+.0971045*t+.7141733*r)/Bl));let s=116*a-16;return[s<0?0:s,500*(i-a),200*(a-o),n]}function va(e){return e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function Pa(e){return e>Ay?Math.pow(e,1/3):e/Rl+zl}function Ul([e,t,r,n]){let i=(e+16)/116,o=isNaN(t)?i:i+t/500,a=isNaN(r)?i:i-r/200;return i=Vl*wa(i),o=Dl*wa(o),a=Bl*wa(a),[Sa(3.1338561*o-1.6168667*i-.4906146*a),Sa(-.9787684*o+1.9161415*i+.033454*a),Sa(.0719453*o-.2289914*i+1.4052427*a),n]}function Sa(e){return e=e<=.00304?12.92*e:1.055*Math.pow(e,1/2.4)-.055,e<0?0:e>1?1:e}function wa(e){return e>ar?e*e*e:Rl*(e-zl)}function Cy(e){let[t,r,n,i]=Nl(e),o=Math.sqrt(r*r+n*n);return[Math.round(o*1e4)?Ol(Math.atan2(n,r)*Iy):NaN,o,t,i]}function ky([e,t,r,n]){return e=isNaN(e)?0:e*_y,Ul([r,Math.cos(e)*t,Math.sin(e)*t,n])}function Ty([e,t,r,n]){e=Ol(e),t/=100,r/=100;function i(o){let a=(o+e/30)%12,s=t*Math.min(r,1-r);return r-s*Math.max(-1,Math.min(a-3,9-a,1))}return[i(0),i(8),i(4),n]}function Ey(e){if(e=e.toLowerCase().trim(),e==="transparent")return[0,0,0,0];let t=Fy[e];if(t){let[i,o,a]=t;return[i/255,o/255,a/255,1]}if(e.startsWith("#")&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(e)){let o=e.length<6?1:2,a=1;return[di(e.slice(a,a+=o)),di(e.slice(a,a+=o)),di(e.slice(a,a+=o)),di(e.slice(a,a+o)||"ff")]}if(e.startsWith("rgb")){let i=/^rgba?\\(\\s*([\\de.+-]+)(%)?(?:\\s+|\\s*(,)\\s*)([\\de.+-]+)(%)?(?:\\s+|\\s*(,)\\s*)([\\de.+-]+)(%)?(?:\\s*([,\\/])\\s*([\\de.+-]+)(%)?)?\\s*\\)$/,o=e.match(i);if(o){let[a,s,l,u,c,p,f,y,m,h,d,g]=o,v=[u||" ",f||" ",h].join("");if(v===" "||v===" /"||v===",,"||v===",,,"){let b=[l,p,m].join(""),x=b==="%%%"?100:b===""?255:0;if(x){let P=[nr(+s/x,0,1),nr(+c/x,0,1),nr(+y/x,0,1),d?bl(+d,g):1];if(vl(P))return P}}return}}let r=/^hsla?\\(\\s*([\\de.+-]+)(?:deg)?(?:\\s+|\\s*(,)\\s*)([\\de.+-]+)%(?:\\s+|\\s*(,)\\s*)([\\de.+-]+)%(?:\\s*([,\\/])\\s*([\\de.+-]+)(%)?)?\\s*\\)$/,n=e.match(r);if(n){let[i,o,a,s,l,u,c,p,f]=n,y=[a||" ",l||" ",c].join("");if(y===" "||y===" /"||y===",,"||y===",,,"){let m=[+o,nr(+s,0,100),nr(+u,0,100),p?bl(+p,f):1];if(vl(m))return Ty(m)}}}function di(e){return parseInt(e.padEnd(2,e),16)/255}function bl(e,t){return nr(t?e/100:e,0,1)}function nr(e,t,r){return Math.min(Math.max(t,e),r)}function vl(e){return!e.some(Number.isNaN)}var Fy={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},W=class e{constructor(t,r,n,i=1,o=!0){this.r=t,this.g=r,this.b=n,this.a=i,o||(this.r*=i,this.g*=i,this.b*=i,i||this.overwriteGetter("rgb",[t,r,n,i]))}static parse(t){if(t instanceof e)return t;if(typeof t!="string")return;let r=Ey(t);if(r)return new e(...r,!1)}get rgb(){let{r:t,g:r,b:n,a:i}=this,o=i||1/0;return this.overwriteGetter("rgb",[t/o,r/o,n/o,i])}get hcl(){return this.overwriteGetter("hcl",Cy(this.rgb))}get lab(){return this.overwriteGetter("lab",Nl(this.rgb))}overwriteGetter(t,r){return Object.defineProperty(this,t,{value:r}),r}toString(){let[t,r,n,i]=this.rgb;return"rgba(".concat([t,r,n].map(o=>Math.round(o*255)).join(","),",").concat(i,")")}};W.black=new W(0,0,0,1);W.white=new W(1,1,1,1);W.transparent=new W(0,0,0,0);W.red=new W(1,0,0,1);var jr=class{constructor(t,r,n){t?this.sensitivity=r?"variant":"case":this.sensitivity=r?"accent":"base",this.locale=n,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(t,r){return this.collator.compare(t,r)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}},Zr=class{constructor(t,r,n,i,o){this.text=t,this.image=r,this.scale=n,this.fontStack=i,this.textColor=o}},Me=class e{constructor(t){this.sections=t}static fromString(t){return new e([new Zr(t,null,null,null,null)])}isEmpty(){return this.sections.length===0?!0:!this.sections.some(t=>t.text.length!==0||t.image&&t.image.name.length!==0)}static factory(t){return t instanceof e?t:e.fromString(t)}toString(){return this.sections.length===0?"":this.sections.map(t=>t.text).join("")}},je=class e{constructor(t){this.values=t.slice()}static parse(t){if(t instanceof e)return t;if(typeof t=="number")return new e([t,t,t,t]);if(Array.isArray(t)&&!(t.length<1||t.length>4)){for(let r of t)if(typeof r!="number")return;switch(t.length){case 1:t=[t[0],t[0],t[0],t[0]];break;case 2:t=[t[0],t[1],t[0],t[1]];break;case 3:t=[t[0],t[1],t[2],t[1]];break}return new e(t)}}toString(){return JSON.stringify(this.values)}},My=new Set(["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"]),it=class e{constructor(t){this.values=t.slice()}static parse(t){if(t instanceof e)return t;if(!(!Array.isArray(t)||t.length<1||t.length%2!==0)){for(let r=0;r<t.length;r+=2){let n=t[r],i=t[r+1];if(typeof n!="string"||!My.has(n)||!Array.isArray(i)||i.length!==2||typeof i[0]!="number"||typeof i[1]!="number")return}return new e(t)}}toString(){return JSON.stringify(this.values)}},Ce=class e{constructor(t){this.name=t.name,this.available=t.available}toString(){return this.name}static fromString(t){return t?new e({name:t,available:!1}):null}};function $l(e,t,r,n){if(!(typeof e=="number"&&e>=0&&e<=255&&typeof t=="number"&&t>=0&&t<=255&&typeof r=="number"&&r>=0&&r<=255)){let i=typeof n=="number"?[e,t,r,n]:[e,t,r];return"Invalid rgba value [".concat(i.join(", "),"]: \'r\', \'g\', and \'b\' must be between 0 and 255.")}return typeof n>"u"||typeof n=="number"&&n>=0&&n<=1?null:"Invalid rgba value [".concat([e,t,r,n].join(", "),"]: \'a\' must be between 0 and 1.")}function vi(e){if(e===null||typeof e=="string"||typeof e=="boolean"||typeof e=="number"||e instanceof W||e instanceof jr||e instanceof Me||e instanceof je||e instanceof it||e instanceof Ce)return!0;if(Array.isArray(e)){for(let t of e)if(!vi(t))return!1;return!0}else if(typeof e=="object"){for(let t in e)if(!vi(e[t]))return!1;return!0}else return!1}function fe(e){if(e===null)return cr;if(typeof e=="string")return G;if(typeof e=="boolean")return U;if(typeof e=="number")return L;if(e instanceof W)return ze;if(e instanceof jr)return Fi;if(e instanceof Me)return pr;if(e instanceof je)return Mi;if(e instanceof it)return Li;if(e instanceof Ce)return Xr;if(Array.isArray(e)){let t=e.length,r;for(let n of e){let i=fe(n);if(!r)r=i;else{if(r===i)continue;r=$;break}}return Fe(r||$,t)}else return or}function Ur(e){let t=typeof e;return e===null?"":t==="string"||t==="number"||t==="boolean"?String(e):e instanceof W||e instanceof Me||e instanceof je||e instanceof it||e instanceof Ce?e.toString():JSON.stringify(e)}var mt=class e{constructor(t,r){this.type=t,this.value=r}static parse(t,r){if(t.length!==2)return r.error("\'literal\' expression requires exactly one argument, but found ".concat(t.length-1," instead."));if(!vi(t[1]))return r.error("invalid value");let n=t[1],i=fe(n),o=r.expectedType;return i.kind==="array"&&i.N===0&&o&&o.kind==="array"&&(typeof o.N!="number"||o.N===0)&&(i=o),new e(i,n)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}},oe=class{constructor(t){this.name="ExpressionEvaluationError",this.message=t}toJSON(){return this.message}},gi={string:G,number:L,boolean:U,object:or},Ge=class e{constructor(t,r){this.type=t,this.args=r}static parse(t,r){if(t.length<2)return r.error("Expected at least one argument.");let n=1,i,o=t[0];if(o==="array"){let s;if(t.length>2){let u=t[1];if(typeof u!="string"||!(u in gi)||u==="object")return r.error(\'The item type argument of "array" must be one of string, number, boolean\',1);s=gi[u],n++}else s=$;let l;if(t.length>3){if(t[2]!==null&&(typeof t[2]!="number"||t[2]<0||t[2]!==Math.floor(t[2])))return r.error(\'The length argument to "array" must be a positive integer literal\',2);l=t[2],n++}i=Fe(s,l)}else{if(!gi[o])throw new Error("Types doesn\'t contain name = ".concat(o));i=gi[o]}let a=[];for(;n<t.length;n++){let s=r.parse(t[n],n,$);if(!s)return null;a.push(s)}return new e(i,a)}evaluate(t){for(let r=0;r<this.args.length;r++){let n=this.args[r].evaluate(t);if(Gr(this.type,fe(n))){if(r===this.args.length-1)throw new oe("Expected value to be of type ".concat(ne(this.type),", but found ").concat(ne(fe(n))," instead."))}else return n}throw new Error}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every(t=>t.outputDefined())}},Pl={"to-boolean":U,"to-color":ze,"to-number":L,"to-string":G},ft=class e{constructor(t,r){this.type=t,this.args=r}static parse(t,r){if(t.length<2)return r.error("Expected at least one argument.");let n=t[0];if(!Pl[n])throw new Error("Can\'t parse ".concat(n," as it is not part of the known types"));if((n==="to-boolean"||n==="to-string")&&t.length!==2)return r.error("Expected one argument.");let i=Pl[n],o=[];for(let a=1;a<t.length;a++){let s=r.parse(t[a],a,$);if(!s)return null;o.push(s)}return new e(i,o)}evaluate(t){switch(this.type.kind){case"boolean":return!!this.args[0].evaluate(t);case"color":{let r,n;for(let i of this.args){if(r=i.evaluate(t),n=null,r instanceof W)return r;if(typeof r=="string"){let o=t.parseColor(r);if(o)return o}else if(Array.isArray(r)&&(r.length<3||r.length>4?n="Invalid rbga value ".concat(JSON.stringify(r),": expected an array containing either three or four numeric values."):n=$l(r[0],r[1],r[2],r[3]),!n))return new W(r[0]/255,r[1]/255,r[2]/255,r[3])}throw new oe(n||"Could not parse color from value \'".concat(typeof r=="string"?r:JSON.stringify(r),"\'"))}case"padding":{let r;for(let n of this.args){r=n.evaluate(t);let i=je.parse(r);if(i)return i}throw new oe("Could not parse padding from value \'".concat(typeof r=="string"?r:JSON.stringify(r),"\'"))}case"variableAnchorOffsetCollection":{let r;for(let n of this.args){r=n.evaluate(t);let i=it.parse(r);if(i)return i}throw new oe("Could not parse variableAnchorOffsetCollection from value \'".concat(typeof r=="string"?r:JSON.stringify(r),"\'"))}case"number":{let r=null;for(let n of this.args){if(r=n.evaluate(t),r===null)return 0;let i=Number(r);if(!isNaN(i))return i}throw new oe("Could not convert ".concat(JSON.stringify(r)," to number."))}case"formatted":return Me.fromString(Ur(this.args[0].evaluate(t)));case"resolvedImage":return Ce.fromString(Ur(this.args[0].evaluate(t)));default:return Ur(this.args[0].evaluate(t))}}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every(t=>t.outputDefined())}},Ly=["Unknown","Point","LineString","Polygon"],Pi=class{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null}id(){return this.feature&&"id"in this.feature?this.feature.id:null}geometryType(){return this.feature?typeof this.feature.type=="number"?Ly[this.feature.type]:this.feature.type:null}geometry(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null}canonicalID(){return this.canonical}properties(){return this.feature&&this.feature.properties||{}}parseColor(t){let r=this._parseColorCache[t];return r||(r=this._parseColorCache[t]=W.parse(t)),r}},Si=class e{constructor(t,r,n=[],i,o=new Ca,a=[]){this.registry=t,this.path=n,this.key=n.map(s=>"[".concat(s,"]")).join(""),this.scope=o,this.errors=a,this.expectedType=i,this._isConstant=r}parse(t,r,n,i,o={}){return r?this.concat(r,n,i)._parse(t,o):this._parse(t,o)}_parse(t,r){(t===null||typeof t=="string"||typeof t=="boolean"||typeof t=="number")&&(t=["literal",t]);function n(i,o,a){return a==="assert"?new Ge(o,[i]):a==="coerce"?new ft(o,[i]):i}if(Array.isArray(t)){if(t.length===0)return this.error(\'Expected an array with at least one element. If you wanted a literal array, use ["literal", []].\');let i=t[0];if(typeof i!="string")return this.error("Expression name must be a string, but found ".concat(typeof i,\' instead. If you wanted a literal array, use ["literal", [...]].\'),0),null;let o=this.registry[i];if(o){let a=o.parse(t,this);if(!a)return null;if(this.expectedType){let s=this.expectedType,l=a.type;if((s.kind==="string"||s.kind==="number"||s.kind==="boolean"||s.kind==="object"||s.kind==="array")&&l.kind==="value")a=n(a,s,r.typeAnnotation||"assert");else if((s.kind==="color"||s.kind==="formatted"||s.kind==="resolvedImage")&&(l.kind==="value"||l.kind==="string"))a=n(a,s,r.typeAnnotation||"coerce");else if(s.kind==="padding"&&(l.kind==="value"||l.kind==="number"||l.kind==="array"))a=n(a,s,r.typeAnnotation||"coerce");else if(s.kind==="variableAnchorOffsetCollection"&&(l.kind==="value"||l.kind==="array"))a=n(a,s,r.typeAnnotation||"coerce");else if(this.checkSubtype(s,l))return null}if(!(a instanceof mt)&&a.type.kind!=="resolvedImage"&&this._isConstant(a)){let s=new Pi;try{a=new mt(a.type,a.evaluate(s))}catch(l){return this.error(l.message),null}}return a}return this.error(\'Unknown expression "\'.concat(i,\'". If you wanted a literal array, use ["literal", [...]].\'),0)}else return typeof t>"u"?this.error("\'undefined\' value invalid. Use null instead."):typeof t=="object"?this.error(\'Bare objects invalid. Use ["literal", {...}] instead.\'):this.error("Expected an array, but found ".concat(typeof t," instead."))}concat(t,r,n){let i=typeof t=="number"?this.path.concat(t):this.path,o=n?this.scope.concat(n):this.scope;return new e(this.registry,this._isConstant,i,r||null,o,this.errors)}error(t,...r){let n="".concat(this.key).concat(r.map(i=>"[".concat(i,"]")).join(""));this.errors.push(new Ve(n,t))}checkSubtype(t,r){let n=Gr(t,r);return n&&this.error(n),n}},wi=class e{constructor(t,r,n){this.type=Fi,this.locale=n,this.caseSensitive=t,this.diacriticSensitive=r}static parse(t,r){if(t.length!==2)return r.error("Expected one argument.");let n=t[1];if(typeof n!="object"||Array.isArray(n))return r.error("Collator options argument must be an object.");let i=r.parse(n["case-sensitive"]===void 0?!1:n["case-sensitive"],1,U);if(!i)return null;let o=r.parse(n["diacritic-sensitive"]===void 0?!1:n["diacritic-sensitive"],1,U);if(!o)return null;let a=null;return n.locale&&(a=r.parse(n.locale,1,G),!a)?null:new e(i,o,a)}evaluate(t){return new jr(this.caseSensitive.evaluate(t),this.diacriticSensitive.evaluate(t),this.locale?this.locale.evaluate(t):null)}eachChild(t){t(this.caseSensitive),t(this.diacriticSensitive),this.locale&&t(this.locale)}outputDefined(){return!1}},yt=8192;function Na(e,t){e[0]=Math.min(e[0],t[0]),e[1]=Math.min(e[1],t[1]),e[2]=Math.max(e[2],t[0]),e[3]=Math.max(e[3],t[1])}function Dy(e){return(180+e)/360}function Vy(e){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+e*Math.PI/360)))/360}function Ai(e,t){return!(e[0]<=t[0]||e[2]>=t[2]||e[1]<=t[1]||e[3]>=t[3])}function By(e,t){let r=Dy(e[0]),n=Vy(e[1]),i=Math.pow(2,t.z);return[Math.round(r*i*yt),Math.round(n*i*yt)]}function zy(e,t,r){let n=e[0]-t[0],i=e[1]-t[1],o=e[0]-r[0],a=e[1]-r[1];return n*a-o*i===0&&n*o<=0&&i*a<=0}function Ry(e,t,r){return t[1]>e[1]!=r[1]>e[1]&&e[0]<(r[0]-t[0])*(e[1]-t[1])/(r[1]-t[1])+t[0]}function Ua(e,t){let r=!1;for(let n=0,i=t.length;n<i;n++){let o=t[n];for(let a=0,s=o.length;a<s-1;a++){if(zy(e,o[a],o[a+1]))return!1;Ry(e,o[a],o[a+1])&&(r=!r)}}return r}function Oy(e,t){for(let r=0;r<t.length;r++)if(Ua(e,t[r]))return!0;return!1}function Ny(e,t){return e[0]*t[1]-e[1]*t[0]}function Sl(e,t,r,n){let i=e[0]-r[0],o=e[1]-r[1],a=t[0]-r[0],s=t[1]-r[1],l=n[0]-r[0],u=n[1]-r[1],c=i*u-l*o,p=a*u-l*s;return c>0&&p<0||c<0&&p>0}function Uy(e,t,r,n){let i=[t[0]-e[0],t[1]-e[1]],o=[n[0]-r[0],n[1]-r[1]];return Ny(o,i)===0?!1:!!(Sl(e,t,r,n)&&Sl(r,n,e,t))}function $y(e,t,r){for(let n of r)for(let i=0;i<n.length-1;++i)if(Uy(e,t,n[i],n[i+1]))return!0;return!1}function Gl(e,t){for(let r=0;r<e.length;++r)if(!Ua(e[r],t))return!1;for(let r=0;r<e.length-1;++r)if($y(e[r],e[r+1],t))return!1;return!0}function Gy(e,t){for(let r=0;r<t.length;r++)if(Gl(e,t[r]))return!0;return!1}function $a(e,t,r){let n=[];for(let i=0;i<e.length;i++){let o=[];for(let a=0;a<e[i].length;a++){let s=By(e[i][a],r);Na(t,s),o.push(s)}n.push(o)}return n}function ql(e,t,r){let n=[];for(let i=0;i<e.length;i++){let o=$a(e[i],t,r);n.push(o)}return n}function jl(e,t,r,n){if(e[0]<r[0]||e[0]>r[2]){let i=n*.5,o=e[0]-r[0]>i?-n:r[0]-e[0]>i?n:0;o===0&&(o=e[0]-r[2]>i?-n:r[2]-e[0]>i?n:0),e[0]+=o}Na(t,e)}function qy(e){e[0]=e[1]=1/0,e[2]=e[3]=-1/0}function wl(e,t,r,n){let i=Math.pow(2,n.z)*yt,o=[n.x*yt,n.y*yt],a=[];for(let s of e)for(let l of s){let u=[l.x+o[0],l.y+o[1]];jl(u,t,r,i),a.push(u)}return a}function Al(e,t,r,n){let i=Math.pow(2,n.z)*yt,o=[n.x*yt,n.y*yt],a=[];for(let s of e){let l=[];for(let u of s){let c=[u.x+o[0],u.y+o[1]];Na(t,c),l.push(c)}a.push(l)}if(t[2]-t[0]<=i/2){qy(t);for(let s of a)for(let l of s)jl(l,t,r,i)}return a}function jy(e,t){let r=[1/0,1/0,-1/0,-1/0],n=[1/0,1/0,-1/0,-1/0],i=e.canonicalID();if(t.type==="Polygon"){let o=$a(t.coordinates,n,i),a=wl(e.geometry(),r,n,i);if(!Ai(r,n))return!1;for(let s of a)if(!Ua(s,o))return!1}if(t.type==="MultiPolygon"){let o=ql(t.coordinates,n,i),a=wl(e.geometry(),r,n,i);if(!Ai(r,n))return!1;for(let s of a)if(!Oy(s,o))return!1}return!0}function Zy(e,t){let r=[1/0,1/0,-1/0,-1/0],n=[1/0,1/0,-1/0,-1/0],i=e.canonicalID();if(t.type==="Polygon"){let o=$a(t.coordinates,n,i),a=Al(e.geometry(),r,n,i);if(!Ai(r,n))return!1;for(let s of a)if(!Gl(s,o))return!1}if(t.type==="MultiPolygon"){let o=ql(t.coordinates,n,i),a=Al(e.geometry(),r,n,i);if(!Ai(r,n))return!1;for(let s of a)if(!Gy(s,o))return!1}return!0}var Jr=class e{constructor(t,r){this.type=U,this.geojson=t,this.geometries=r}static parse(t,r){if(t.length!==2)return r.error("\'within\' expression requires exactly one argument, but found ".concat(t.length-1," instead."));if(vi(t[1])){let n=t[1];if(n.type==="FeatureCollection")for(let i=0;i<n.features.length;++i){let o=n.features[i].geometry.type;if(o==="Polygon"||o==="MultiPolygon")return new e(n,n.features[i].geometry)}else if(n.type==="Feature"){let i=n.geometry.type;if(i==="Polygon"||i==="MultiPolygon")return new e(n,n.geometry)}else if(n.type==="Polygon"||n.type==="MultiPolygon")return new e(n,n)}return r.error("\'within\' expression requires valid geojson object that contains polygon geometry type.")}evaluate(t){if(t.geometry()!=null&&t.canonicalID()!=null){if(t.geometryType()==="Point")return jy(t,this.geometries);if(t.geometryType()==="LineString")return Zy(t,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}},_i=class e{constructor(t,r){this.type=r.type,this.name=t,this.boundExpression=r}static parse(t,r){if(t.length!==2||typeof t[1]!="string")return r.error("\'var\' expression requires exactly one string literal argument.");let n=t[1];return r.scope.has(n)?new e(n,r.scope.get(n)):r.error(\'Unknown variable "\'.concat(n,\'". Make sure "\').concat(n,\'" has been bound in an enclosing "let" expression before using it.\'),1)}evaluate(t){return this.boundExpression.evaluate(t)}eachChild(){}outputDefined(){return!1}},Ye=class e{constructor(t,r,n,i){this.name=t,this.type=r,this._evaluate=n,this.args=i}evaluate(t){return this._evaluate(t,this.args)}eachChild(t){this.args.forEach(t)}outputDefined(){return!1}static parse(t,r){let n=t[0],i=e.definitions[n];if(!i)return r.error(\'Unknown expression "\'.concat(n,\'". If you wanted a literal array, use ["literal", [...]].\'),0);let o=Array.isArray(i)?i[0]:i.type,a=Array.isArray(i)?[[i[1],i[2]]]:i.overloads,s=a.filter(([u])=>!Array.isArray(u)||u.length===t.length-1),l=null;for(let[u,c]of s){l=new Si(r.registry,Ii,r.path,null,r.scope);let p=[],f=!1;for(let y=1;y<t.length;y++){let m=t[y],h=Array.isArray(u)?u[y-1]:u.type,d=l.parse(m,1+p.length,h);if(!d){f=!0;break}p.push(d)}if(!f){if(Array.isArray(u)&&u.length!==p.length){l.error("Expected ".concat(u.length," arguments, but found ").concat(p.length," instead."));continue}for(let y=0;y<p.length;y++){let m=Array.isArray(u)?u[y]:u.type,h=p[y];l.concat(y+1).checkSubtype(m,h.type)}if(l.errors.length===0)return new e(n,o,c,p)}}if(s.length===1)r.errors.push(...l.errors);else{let c=(s.length?s:a).map(([f])=>Jy(f)).join(" | "),p=[];for(let f=1;f<t.length;f++){let y=r.parse(t[f],1+p.length);if(!y)return null;p.push(ne(y.type))}r.error("Expected arguments of type ".concat(c,", but found (").concat(p.join(", "),") instead."))}return null}static register(t,r){e.definitions=r;for(let n in r)t[n]=e}};function Jy(e){return Array.isArray(e)?"(".concat(e.map(ne).join(", "),")"):"(".concat(ne(e.type),"...)")}function Ii(e){if(e instanceof _i)return Ii(e.boundExpression);if(e instanceof Ye&&e.name==="error")return!1;if(e instanceof wi)return!1;if(e instanceof Jr)return!1;let t=e instanceof ft||e instanceof Ge,r=!0;return e.eachChild(n=>{t?r=r&&Ii(n):r=r&&n instanceof mt}),r?Di(e)&&Vi(e,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"]):!1}function Di(e){if(e instanceof Ye){if(e.name==="get"&&e.args.length===1)return!1;if(e.name==="feature-state")return!1;if(e.name==="has"&&e.args.length===1)return!1;if(e.name==="properties"||e.name==="geometry-type"||e.name==="id")return!1;if(/^filter-/.test(e.name))return!1}if(e instanceof Jr)return!1;let t=!0;return e.eachChild(r=>{t&&!Di(r)&&(t=!1)}),t}function Wr(e){if(e instanceof Ye&&e.name==="feature-state")return!1;let t=!0;return e.eachChild(r=>{t&&!Wr(r)&&(t=!1)}),t}function Vi(e,t){if(e instanceof Ye&&t.indexOf(e.name)>=0)return!1;let r=!0;return e.eachChild(n=>{r&&!Vi(n,t)&&(r=!1)}),r}function Bi(e,t){let r=e.length-1,n=0,i=r,o=0,a,s;for(;n<=i;)if(o=Math.floor((n+i)/2),a=e[o],s=e[o+1],a<=t){if(o===r||t<s)return o;n=o+1}else if(a>t)i=o-1;else throw new oe("Input is not a number.");return 0}var lr=class e{constructor(t,r,n){this.type=t,this.input=r,this.labels=[],this.outputs=[];for(let[i,o]of n)this.labels.push(i),this.outputs.push(o)}static parse(t,r){if(t.length-1<4)return r.error("Expected at least 4 arguments, but found only ".concat(t.length-1,"."));if((t.length-1)%2!==0)return r.error("Expected an even number of arguments.");let n=r.parse(t[1],1,L);if(!n)return null;let i=[],o=null;r.expectedType&&r.expectedType.kind!=="value"&&(o=r.expectedType);for(let a=1;a<t.length;a+=2){let s=a===1?-1/0:t[a],l=t[a+1],u=a,c=a+1;if(typeof s!="number")return r.error(\'Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.\',u);if(i.length&&i[i.length-1][0]>=s)return r.error(\'Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.\',u);let p=r.parse(l,c,o);if(!p)return null;o=o||p.type,i.push([s,p])}return new e(o,n,i)}evaluate(t){let r=this.labels,n=this.outputs;if(r.length===1)return n[0].evaluate(t);let i=this.input.evaluate(t);if(i<=r[0])return n[0].evaluate(t);let o=r.length;if(i>=r[o-1])return n[o-1].evaluate(t);let a=Bi(r,i);return n[a].evaluate(t)}eachChild(t){t(this.input);for(let r of this.outputs)t(r)}outputDefined(){return this.outputs.every(t=>t.outputDefined())}};function Wy(e){return e==="rgb"||e==="hcl"||e==="lab"}function Lt(e,t,r){return e+r*(t-e)}function Hy(e,t,r,n="rgb"){switch(n){case"rgb":{let[i,o,a,s]=Ci(e.rgb,t.rgb,r);return new W(i,o,a,s,!1)}case"hcl":{let[i,o,a,s]=e.hcl,[l,u,c,p]=t.hcl,f,y;if(!isNaN(i)&&!isNaN(l)){let v=l-i;l>i&&v>180?v-=360:l<i&&i-l>180&&(v+=360),f=i+r*v}else isNaN(i)?isNaN(l)?f=NaN:(f=l,(a===1||a===0)&&(y=u)):(f=i,(c===1||c===0)&&(y=o));let[m,h,d,g]=ky([f,y!=null?y:Lt(o,u,r),Lt(a,c,r),Lt(s,p,r)]);return new W(m,h,d,g,!1)}case"lab":{let[i,o,a,s]=Ul(Ci(e.lab,t.lab,r));return new W(i,o,a,s,!1)}}}function Ci(e,t,r){return e.map((n,i)=>Lt(n,t[i],r))}function Ky(e,t,r){return new je(Ci(e.values,t.values,r))}function Yy(e,t,r){let n=e.values,i=t.values;if(n.length!==i.length)throw new oe("Cannot interpolate values of different length. from: ".concat(e.toString(),", to: ").concat(t.toString()));let o=[];for(let a=0;a<n.length;a+=2){if(n[a]!==i[a])throw new oe("Cannot interpolate values containing mismatched anchors. from[".concat(a,"]: ").concat(n[a],", to[").concat(a,"]: ").concat(i[a]));o.push(n[a]);let[s,l]=n[a+1],[u,c]=i[a+1];o.push([Lt(s,u,r),Lt(l,c,r)])}return new it(o)}var Re={number:Lt,color:Hy,array:Ci,padding:Ky,variableAnchorOffsetCollection:Yy},qe=class e{constructor(t,r,n,i,o){this.type=t,this.operator=r,this.interpolation=n,this.input=i,this.labels=[],this.outputs=[];for(let[a,s]of o)this.labels.push(a),this.outputs.push(s)}static interpolationFactor(t,r,n,i){let o=0;if(t.name==="exponential")o=Aa(r,t.base,n,i);else if(t.name==="linear")o=Aa(r,1,n,i);else if(t.name==="cubic-bezier"){let a=t.controlPoints;o=new Ll.default(a[0],a[1],a[2],a[3]).solve(Aa(r,1,n,i))}return o}static parse(t,r){let[n,i,o,...a]=t;if(!Array.isArray(i)||i.length===0)return r.error("Expected an interpolation type expression.",1);if(i[0]==="linear")i={name:"linear"};else if(i[0]==="exponential"){let u=i[1];if(typeof u!="number")return r.error("Exponential interpolation requires a numeric base.",1,1);i={name:"exponential",base:u}}else if(i[0]==="cubic-bezier"){let u=i.slice(1);if(u.length!==4||u.some(c=>typeof c!="number"||c<0||c>1))return r.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);i={name:"cubic-bezier",controlPoints:u}}else return r.error("Unknown interpolation type ".concat(String(i[0])),1,0);if(t.length-1<4)return r.error("Expected at least 4 arguments, but found only ".concat(t.length-1,"."));if((t.length-1)%2!==0)return r.error("Expected an even number of arguments.");if(o=r.parse(o,2,L),!o)return null;let s=[],l=null;n==="interpolate-hcl"||n==="interpolate-lab"?l=ze:r.expectedType&&r.expectedType.kind!=="value"&&(l=r.expectedType);for(let u=0;u<a.length;u+=2){let c=a[u],p=a[u+1],f=u+3,y=u+4;if(typeof c!="number")return r.error(\'Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.\',f);if(s.length&&s[s.length-1][0]>=c)return r.error(\'Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.\',f);let m=r.parse(p,y,l);if(!m)return null;l=l||m.type,s.push([c,m])}return!Nr(l,L)&&!Nr(l,ze)&&!Nr(l,Mi)&&!Nr(l,Li)&&!Nr(l,Fe(L))?r.error("Type ".concat(ne(l)," is not interpolatable.")):new e(l,n,i,o,s)}evaluate(t){let r=this.labels,n=this.outputs;if(r.length===1)return n[0].evaluate(t);let i=this.input.evaluate(t);if(i<=r[0])return n[0].evaluate(t);let o=r.length;if(i>=r[o-1])return n[o-1].evaluate(t);let a=Bi(r,i),s=r[a],l=r[a+1],u=e.interpolationFactor(this.interpolation,i,s,l),c=n[a].evaluate(t),p=n[a+1].evaluate(t);switch(this.operator){case"interpolate":return Re[this.type.kind](c,p,u);case"interpolate-hcl":return Re.color(c,p,u,"hcl");case"interpolate-lab":return Re.color(c,p,u,"lab")}}eachChild(t){t(this.input);for(let r of this.outputs)t(r)}outputDefined(){return this.outputs.every(t=>t.outputDefined())}};function Aa(e,t,r,n){let i=n-r,o=e-r;return i===0?0:t===1?o/i:(Math.pow(t,o)-1)/(Math.pow(t,i)-1)}var ki=class e{constructor(t,r){this.type=t,this.args=r}static parse(t,r){if(t.length<2)return r.error("Expectected at least one argument.");let n=null,i=r.expectedType;i&&i.kind!=="value"&&(n=i);let o=[];for(let s of t.slice(1)){let l=r.parse(s,1+o.length,n,void 0,{typeAnnotation:"omit"});if(!l)return null;n=n||l.type,o.push(l)}if(!n)throw new Error("No output type");return i&&o.some(s=>Gr(i,s.type))?new e($,o):new e(n,o)}evaluate(t){let r=null,n=0,i;for(let o of this.args)if(n++,r=o.evaluate(t),r&&r instanceof Ce&&!r.available&&(i||(i=r.name),r=null,n===this.args.length&&(r=i)),r!==null)break;return r}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every(t=>t.outputDefined())}},Ti=class e{constructor(t,r){this.type=r.type,this.bindings=[].concat(t),this.result=r}evaluate(t){return this.result.evaluate(t)}eachChild(t){for(let r of this.bindings)t(r[1]);t(this.result)}static parse(t,r){if(t.length<4)return r.error("Expected at least 3 arguments, but found ".concat(t.length-1," instead."));let n=[];for(let o=1;o<t.length-1;o+=2){let a=t[o];if(typeof a!="string")return r.error("Expected string, but found ".concat(typeof a," instead."),o);if(/[^a-zA-Z0-9_]/.test(a))return r.error("Variable names must contain only alphanumeric characters or \'_\'.",o);let s=r.parse(t[o+1],o+1);if(!s)return null;n.push([a,s])}let i=r.parse(t[t.length-1],t.length-1,r.expectedType,n);return i?new e(n,i):null}outputDefined(){return this.result.outputDefined()}},ka=class e{constructor(t,r,n){this.type=t,this.index=r,this.input=n}static parse(t,r){if(t.length!==3)return r.error("Expected 2 arguments, but found ".concat(t.length-1," instead."));let n=r.parse(t[1],1,L),i=r.parse(t[2],2,Fe(r.expectedType||$));if(!n||!i)return null;let o=i.type;return new e(o.itemType,n,i)}evaluate(t){let r=this.index.evaluate(t),n=this.input.evaluate(t);if(r<0)throw new oe("Array index out of bounds: ".concat(r," < 0."));if(r>=n.length)throw new oe("Array index out of bounds: ".concat(r," > ").concat(n.length-1,"."));if(r!==Math.floor(r))throw new oe("Array index must be an integer, but found ".concat(r," instead."));return n[r]}eachChild(t){t(this.index),t(this.input)}outputDefined(){return!1}},Ta=class e{constructor(t,r){this.type=U,this.needle=t,this.haystack=r}static parse(t,r){if(t.length!==3)return r.error("Expected 2 arguments, but found ".concat(t.length-1," instead."));let n=r.parse(t[1],1,$),i=r.parse(t[2],2,$);return!n||!i?null:Oa(n.type,[U,G,L,cr,$])?new e(n,i):r.error("Expected first argument to be of type boolean, string, number or null, but found ".concat(ne(n.type)," instead"))}evaluate(t){let r=this.needle.evaluate(t),n=this.haystack.evaluate(t);if(!n)return!1;if(!qr(r,["boolean","string","number","null"]))throw new oe("Expected first argument to be of type boolean, string, number or null, but found ".concat(ne(fe(r))," instead."));if(!qr(n,["string","array"]))throw new oe("Expected second argument to be of type array or string, but found ".concat(ne(fe(n))," instead."));return n.indexOf(r)>=0}eachChild(t){t(this.needle),t(this.haystack)}outputDefined(){return!0}},Ea=class e{constructor(t,r,n){this.type=L,this.needle=t,this.haystack=r,this.fromIndex=n}static parse(t,r){if(t.length<=2||t.length>=5)return r.error("Expected 3 or 4 arguments, but found ".concat(t.length-1," instead."));let n=r.parse(t[1],1,$),i=r.parse(t[2],2,$);if(!n||!i)return null;if(!Oa(n.type,[U,G,L,cr,$]))return r.error("Expected first argument to be of type boolean, string, number or null, but found ".concat(ne(n.type)," instead"));if(t.length===4){let o=r.parse(t[3],3,L);return o?new e(n,i,o):null}else return new e(n,i)}evaluate(t){let r=this.needle.evaluate(t),n=this.haystack.evaluate(t);if(!qr(r,["boolean","string","number","null"]))throw new oe("Expected first argument to be of type boolean, string, number or null, but found ".concat(ne(fe(r))," instead."));if(!qr(n,["string","array"]))throw new oe("Expected second argument to be of type array or string, but found ".concat(ne(fe(n))," instead."));if(this.fromIndex){let i=this.fromIndex.evaluate(t);return n.indexOf(r,i)}return n.indexOf(r)}eachChild(t){t(this.needle),t(this.haystack),this.fromIndex&&t(this.fromIndex)}outputDefined(){return!1}},Fa=class e{constructor(t,r,n,i,o,a){this.inputType=t,this.type=r,this.input=n,this.cases=i,this.outputs=o,this.otherwise=a}static parse(t,r){if(t.length<5)return r.error("Expected at least 4 arguments, but found only ".concat(t.length-1,"."));if(t.length%2!==1)return r.error("Expected an even number of arguments.");let n,i;r.expectedType&&r.expectedType.kind!=="value"&&(i=r.expectedType);let o={},a=[];for(let u=2;u<t.length-1;u+=2){let c=t[u],p=t[u+1];Array.isArray(c)||(c=[c]);let f=r.concat(u);if(c.length===0)return f.error("Expected at least one branch label.");for(let m of c){if(typeof m!="number"&&typeof m!="string")return f.error("Branch labels must be numbers or strings.");if(typeof m=="number"&&Math.abs(m)>Number.MAX_SAFE_INTEGER)return f.error("Branch labels must be integers no larger than ".concat(Number.MAX_SAFE_INTEGER,"."));if(typeof m=="number"&&Math.floor(m)!==m)return f.error("Numeric branch labels must be integer values.");if(!n)n=fe(m);else if(f.checkSubtype(n,fe(m)))return null;if(typeof o[String(m)]<"u")return f.error("Branch labels must be unique.");o[String(m)]=a.length}let y=r.parse(p,u,i);if(!y)return null;i=i||y.type,a.push(y)}let s=r.parse(t[1],1,$);if(!s)return null;let l=r.parse(t[t.length-1],t.length-1,i);return!l||s.type.kind!=="value"&&r.concat(1).checkSubtype(n,s.type)?null:new e(n,i,s,o,a,l)}evaluate(t){let r=this.input.evaluate(t);return(fe(r)===this.inputType&&this.outputs[this.cases[r]]||this.otherwise).evaluate(t)}eachChild(t){t(this.input),this.outputs.forEach(t),t(this.otherwise)}outputDefined(){return this.outputs.every(t=>t.outputDefined())&&this.otherwise.outputDefined()}},Ma=class e{constructor(t,r,n){this.type=t,this.branches=r,this.otherwise=n}static parse(t,r){if(t.length<4)return r.error("Expected at least 3 arguments, but found only ".concat(t.length-1,"."));if(t.length%2!==0)return r.error("Expected an odd number of arguments.");let n;r.expectedType&&r.expectedType.kind!=="value"&&(n=r.expectedType);let i=[];for(let a=1;a<t.length-1;a+=2){let s=r.parse(t[a],a,U);if(!s)return null;let l=r.parse(t[a+1],a+1,n);if(!l)return null;i.push([s,l]),n=n||l.type}let o=r.parse(t[t.length-1],t.length-1,n);if(!o)return null;if(!n)throw new Error("Can\'t infer output type");return new e(n,i,o)}evaluate(t){for(let[r,n]of this.branches)if(r.evaluate(t))return n.evaluate(t);return this.otherwise.evaluate(t)}eachChild(t){for(let[r,n]of this.branches)t(r),t(n);t(this.otherwise)}outputDefined(){return this.branches.every(([t,r])=>r.outputDefined())&&this.otherwise.outputDefined()}},La=class e{constructor(t,r,n,i){this.type=t,this.input=r,this.beginIndex=n,this.endIndex=i}static parse(t,r){if(t.length<=2||t.length>=5)return r.error("Expected 3 or 4 arguments, but found ".concat(t.length-1," instead."));let n=r.parse(t[1],1,$),i=r.parse(t[2],2,L);if(!n||!i)return null;if(!Oa(n.type,[Fe($),G,$]))return r.error("Expected first argument to be of type array or string, but found ".concat(ne(n.type)," instead"));if(t.length===4){let o=r.parse(t[3],3,L);return o?new e(n.type,n,i,o):null}else return new e(n.type,n,i)}evaluate(t){let r=this.input.evaluate(t),n=this.beginIndex.evaluate(t);if(!qr(r,["string","array"]))throw new oe("Expected first argument to be of type array or string, but found ".concat(ne(fe(r))," instead."));if(this.endIndex){let i=this.endIndex.evaluate(t);return r.slice(n,i)}return r.slice(n)}eachChild(t){t(this.input),t(this.beginIndex),this.endIndex&&t(this.endIndex)}outputDefined(){return!1}};function _l(e,t){return e==="=="||e==="!="?t.kind==="boolean"||t.kind==="string"||t.kind==="number"||t.kind==="null"||t.kind==="value":t.kind==="string"||t.kind==="number"||t.kind==="value"}function Xy(e,t,r){return t===r}function Qy(e,t,r){return t!==r}function em(e,t,r){return t<r}function tm(e,t,r){return t>r}function rm(e,t,r){return t<=r}function nm(e,t,r){return t>=r}function Zl(e,t,r,n){return n.compare(t,r)===0}function im(e,t,r,n){return!Zl(e,t,r,n)}function om(e,t,r,n){return n.compare(t,r)<0}function am(e,t,r,n){return n.compare(t,r)>0}function sm(e,t,r,n){return n.compare(t,r)<=0}function lm(e,t,r,n){return n.compare(t,r)>=0}function fr(e,t,r){let n=e!=="=="&&e!=="!=";return class Jl{constructor(o,a,s){this.type=U,this.lhs=o,this.rhs=a,this.collator=s,this.hasUntypedArgument=o.type.kind==="value"||a.type.kind==="value"}static parse(o,a){if(o.length!==3&&o.length!==4)return a.error("Expected two or three arguments.");let s=o[0],l=a.parse(o[1],1,$);if(!l)return null;if(!_l(s,l.type))return a.concat(1).error(\'"\'.concat(s,"\\" comparisons are not supported for type \'").concat(ne(l.type),"\'."));let u=a.parse(o[2],2,$);if(!u)return null;if(!_l(s,u.type))return a.concat(2).error(\'"\'.concat(s,"\\" comparisons are not supported for type \'").concat(ne(u.type),"\'."));if(l.type.kind!==u.type.kind&&l.type.kind!=="value"&&u.type.kind!=="value")return a.error("Cannot compare types \'".concat(ne(l.type),"\' and \'").concat(ne(u.type),"\'."));n&&(l.type.kind==="value"&&u.type.kind!=="value"?l=new Ge(u.type,[l]):l.type.kind!=="value"&&u.type.kind==="value"&&(u=new Ge(l.type,[u])));let c=null;if(o.length===4){if(l.type.kind!=="string"&&u.type.kind!=="string"&&l.type.kind!=="value"&&u.type.kind!=="value")return a.error("Cannot use collator to compare non-string types.");if(c=a.parse(o[3],3,Fi),!c)return null}return new Jl(l,u,c)}evaluate(o){let a=this.lhs.evaluate(o),s=this.rhs.evaluate(o);if(n&&this.hasUntypedArgument){let l=fe(a),u=fe(s);if(l.kind!==u.kind||!(l.kind==="string"||l.kind==="number"))throw new oe(\'Expected arguments for "\'.concat(e,\'" to be (string, string) or (number, number), but found (\').concat(l.kind,", ").concat(u.kind,") instead."))}if(this.collator&&!n&&this.hasUntypedArgument){let l=fe(a),u=fe(s);if(l.kind!=="string"||u.kind!=="string")return t(o,a,s)}return this.collator?r(o,a,s,this.collator.evaluate(o)):t(o,a,s)}eachChild(o){o(this.lhs),o(this.rhs),this.collator&&o(this.collator)}outputDefined(){return!0}}}var um=fr("==",Xy,Zl),cm=fr("!=",Qy,im),pm=fr("<",em,om),fm=fr(">",tm,am),ym=fr("<=",rm,sm),mm=fr(">=",nm,lm),Da=class e{constructor(t,r,n,i,o){this.type=G,this.number=t,this.locale=r,this.currency=n,this.minFractionDigits=i,this.maxFractionDigits=o}static parse(t,r){if(t.length!==3)return r.error("Expected two arguments.");let n=r.parse(t[1],1,L);if(!n)return null;let i=t[2];if(typeof i!="object"||Array.isArray(i))return r.error("NumberFormat options argument must be an object.");let o=null;if(i.locale&&(o=r.parse(i.locale,1,G),!o))return null;let a=null;if(i.currency&&(a=r.parse(i.currency,1,G),!a))return null;let s=null;if(i["min-fraction-digits"]&&(s=r.parse(i["min-fraction-digits"],1,L),!s))return null;let l=null;return i["max-fraction-digits"]&&(l=r.parse(i["max-fraction-digits"],1,L),!l)?null:new e(n,o,a,s,l)}evaluate(t){return new Intl.NumberFormat(this.locale?this.locale.evaluate(t):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(t):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(t):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(t):void 0}).format(this.number.evaluate(t))}eachChild(t){t(this.number),this.locale&&t(this.locale),this.currency&&t(this.currency),this.minFractionDigits&&t(this.minFractionDigits),this.maxFractionDigits&&t(this.maxFractionDigits)}outputDefined(){return!1}},Hr=class e{constructor(t){this.type=pr,this.sections=t}static parse(t,r){if(t.length<2)return r.error("Expected at least one argument.");let n=t[1];if(!Array.isArray(n)&&typeof n=="object")return r.error("First argument must be an image or text section.");let i=[],o=!1;for(let a=1;a<=t.length-1;++a){let s=t[a];if(o&&typeof s=="object"&&!Array.isArray(s)){o=!1;let l=null;if(s["font-scale"]&&(l=r.parse(s["font-scale"],1,L),!l))return null;let u=null;if(s["text-font"]&&(u=r.parse(s["text-font"],1,Fe(G)),!u))return null;let c=null;if(s["text-color"]&&(c=r.parse(s["text-color"],1,ze),!c))return null;let p=i[i.length-1];p.scale=l,p.font=u,p.textColor=c}else{let l=r.parse(t[a],1,$);if(!l)return null;let u=l.type.kind;if(u!=="string"&&u!=="value"&&u!=="null"&&u!=="resolvedImage")return r.error("Formatted text type must be \'string\', \'value\', \'image\' or \'null\'.");o=!0,i.push({content:l,scale:null,font:null,textColor:null})}}return new e(i)}evaluate(t){let r=n=>{let i=n.content.evaluate(t);return fe(i)===Xr?new Zr("",i,null,null,null):new Zr(Ur(i),null,n.scale?n.scale.evaluate(t):null,n.font?n.font.evaluate(t).join(","):null,n.textColor?n.textColor.evaluate(t):null)};return new Me(this.sections.map(r))}eachChild(t){for(let r of this.sections)t(r.content),r.scale&&t(r.scale),r.font&&t(r.font),r.textColor&&t(r.textColor)}outputDefined(){return!1}},Va=class e{constructor(t){this.type=Xr,this.input=t}static parse(t,r){if(t.length!==2)return r.error("Expected two arguments.");let n=r.parse(t[1],1,G);return n?new e(n):r.error("No image name provided.")}evaluate(t){let r=this.input.evaluate(t),n=Ce.fromString(r);return n&&t.availableImages&&(n.available=t.availableImages.indexOf(r)>-1),n}eachChild(t){t(this.input)}outputDefined(){return!1}},Ba=class e{constructor(t){this.type=L,this.input=t}static parse(t,r){if(t.length!==2)return r.error("Expected 1 argument, but found ".concat(t.length-1," instead."));let n=r.parse(t[1],1);return n?n.type.kind!=="array"&&n.type.kind!=="string"&&n.type.kind!=="value"?r.error("Expected argument of type string or array, but found ".concat(ne(n.type)," instead.")):new e(n):null}evaluate(t){let r=this.input.evaluate(t);if(typeof r=="string")return r.length;if(Array.isArray(r))return r.length;throw new oe("Expected value to be of type string or array, but found ".concat(ne(fe(r))," instead."))}eachChild(t){t(this.input)}outputDefined(){return!1}},zt={"==":um,"!=":cm,">":fm,"<":pm,">=":mm,"<=":ym,array:Ge,at:ka,boolean:Ge,case:Ma,coalesce:ki,collator:wi,format:Hr,image:Va,in:Ta,"index-of":Ea,interpolate:qe,"interpolate-hcl":qe,"interpolate-lab":qe,length:Ba,let:Ti,literal:mt,match:Fa,number:Ge,"number-format":Da,object:Ge,slice:La,step:lr,string:Ge,"to-boolean":ft,"to-color":ft,"to-number":ft,"to-string":ft,var:_i,within:Jr};function Il(e,[t,r,n,i]){t=t.evaluate(e),r=r.evaluate(e),n=n.evaluate(e);let o=i?i.evaluate(e):1,a=$l(t,r,n,o);if(a)throw new oe(a);return new W(t/255,r/255,n/255,o,!1)}function Cl(e,t){return e in t}function _a(e,t){let r=t[e];return typeof r>"u"?null:r}function hm(e,t,r,n){for(;r<=n;){let i=r+n>>1;if(t[i]===e)return!0;t[i]>e?n=i-1:r=i+1}return!1}function Mt(e){return{type:e}}Ye.register(zt,{error:[Sy,[G],(e,[t])=>{throw new oe(t.evaluate(e))}],typeof:[G,[$],(e,[t])=>ne(fe(t.evaluate(e)))],"to-rgba":[Fe(L,4),[ze],(e,[t])=>{let[r,n,i,o]=t.evaluate(e).rgb;return[r*255,n*255,i*255,o]}],rgb:[ze,[L,L,L],Il],rgba:[ze,[L,L,L,L],Il],has:{type:U,overloads:[[[G],(e,[t])=>Cl(t.evaluate(e),e.properties())],[[G,or],(e,[t,r])=>Cl(t.evaluate(e),r.evaluate(e))]]},get:{type:$,overloads:[[[G],(e,[t])=>_a(t.evaluate(e),e.properties())],[[G,or],(e,[t,r])=>_a(t.evaluate(e),r.evaluate(e))]]},"feature-state":[$,[G],(e,[t])=>_a(t.evaluate(e),e.featureState||{})],properties:[or,[],e=>e.properties()],"geometry-type":[G,[],e=>e.geometryType()],id:[$,[],e=>e.id()],zoom:[L,[],e=>e.globals.zoom],"heatmap-density":[L,[],e=>e.globals.heatmapDensity||0],"line-progress":[L,[],e=>e.globals.lineProgress||0],accumulated:[$,[],e=>e.globals.accumulated===void 0?null:e.globals.accumulated],"+":[L,Mt(L),(e,t)=>{let r=0;for(let n of t)r+=n.evaluate(e);return r}],"*":[L,Mt(L),(e,t)=>{let r=1;for(let n of t)r*=n.evaluate(e);return r}],"-":{type:L,overloads:[[[L,L],(e,[t,r])=>t.evaluate(e)-r.evaluate(e)],[[L],(e,[t])=>-t.evaluate(e)]]},"/":[L,[L,L],(e,[t,r])=>t.evaluate(e)/r.evaluate(e)],"%":[L,[L,L],(e,[t,r])=>t.evaluate(e)%r.evaluate(e)],ln2:[L,[],()=>Math.LN2],pi:[L,[],()=>Math.PI],e:[L,[],()=>Math.E],"^":[L,[L,L],(e,[t,r])=>Math.pow(t.evaluate(e),r.evaluate(e))],sqrt:[L,[L],(e,[t])=>Math.sqrt(t.evaluate(e))],log10:[L,[L],(e,[t])=>Math.log(t.evaluate(e))/Math.LN10],ln:[L,[L],(e,[t])=>Math.log(t.evaluate(e))],log2:[L,[L],(e,[t])=>Math.log(t.evaluate(e))/Math.LN2],sin:[L,[L],(e,[t])=>Math.sin(t.evaluate(e))],cos:[L,[L],(e,[t])=>Math.cos(t.evaluate(e))],tan:[L,[L],(e,[t])=>Math.tan(t.evaluate(e))],asin:[L,[L],(e,[t])=>Math.asin(t.evaluate(e))],acos:[L,[L],(e,[t])=>Math.acos(t.evaluate(e))],atan:[L,[L],(e,[t])=>Math.atan(t.evaluate(e))],min:[L,Mt(L),(e,t)=>Math.min(...t.map(r=>r.evaluate(e)))],max:[L,Mt(L),(e,t)=>Math.max(...t.map(r=>r.evaluate(e)))],abs:[L,[L],(e,[t])=>Math.abs(t.evaluate(e))],round:[L,[L],(e,[t])=>{let r=t.evaluate(e);return r<0?-Math.round(-r):Math.round(r)}],floor:[L,[L],(e,[t])=>Math.floor(t.evaluate(e))],ceil:[L,[L],(e,[t])=>Math.ceil(t.evaluate(e))],"filter-==":[U,[G,$],(e,[t,r])=>e.properties()[t.value]===r.value],"filter-id-==":[U,[$],(e,[t])=>e.id()===t.value],"filter-type-==":[U,[G],(e,[t])=>e.geometryType()===t.value],"filter-<":[U,[G,$],(e,[t,r])=>{let n=e.properties()[t.value],i=r.value;return typeof n==typeof i&&n<i}],"filter-id-<":[U,[$],(e,[t])=>{let r=e.id(),n=t.value;return typeof r==typeof n&&r<n}],"filter->":[U,[G,$],(e,[t,r])=>{let n=e.properties()[t.value],i=r.value;return typeof n==typeof i&&n>i}],"filter-id->":[U,[$],(e,[t])=>{let r=e.id(),n=t.value;return typeof r==typeof n&&r>n}],"filter-<=":[U,[G,$],(e,[t,r])=>{let n=e.properties()[t.value],i=r.value;return typeof n==typeof i&&n<=i}],"filter-id-<=":[U,[$],(e,[t])=>{let r=e.id(),n=t.value;return typeof r==typeof n&&r<=n}],"filter->=":[U,[G,$],(e,[t,r])=>{let n=e.properties()[t.value],i=r.value;return typeof n==typeof i&&n>=i}],"filter-id->=":[U,[$],(e,[t])=>{let r=e.id(),n=t.value;return typeof r==typeof n&&r>=n}],"filter-has":[U,[$],(e,[t])=>t.value in e.properties()],"filter-has-id":[U,[],e=>e.id()!==null&&e.id()!==void 0],"filter-type-in":[U,[Fe(G)],(e,[t])=>t.value.indexOf(e.geometryType())>=0],"filter-id-in":[U,[Fe($)],(e,[t])=>t.value.indexOf(e.id())>=0],"filter-in-small":[U,[G,Fe($)],(e,[t,r])=>r.value.indexOf(e.properties()[t.value])>=0],"filter-in-large":[U,[G,Fe($)],(e,[t,r])=>hm(e.properties()[t.value],r.value,0,r.value.length-1)],all:{type:U,overloads:[[[U,U],(e,[t,r])=>t.evaluate(e)&&r.evaluate(e)],[Mt(U),(e,t)=>{for(let r of t)if(!r.evaluate(e))return!1;return!0}]]},any:{type:U,overloads:[[[U,U],(e,[t,r])=>t.evaluate(e)||r.evaluate(e)],[Mt(U),(e,t)=>{for(let r of t)if(r.evaluate(e))return!0;return!1}]]},"!":[U,[U],(e,[t])=>!t.evaluate(e)],"is-supported-script":[U,[G],(e,[t])=>{let r=e.globals&&e.globals.isSupportedScript;return r?r(t.evaluate(e)):!0}],upcase:[G,[G],(e,[t])=>t.evaluate(e).toUpperCase()],downcase:[G,[G],(e,[t])=>t.evaluate(e).toLowerCase()],concat:[G,Mt($),(e,t)=>t.map(r=>Ur(r.evaluate(e))).join("")],"resolved-locale":[G,[Fi],(e,[t])=>t.evaluate(e).resolvedLocale()]});function za(e){return{result:"success",value:e}}function ir(e){return{result:"error",value:e}}function ht(e){return e["property-type"]==="data-driven"||e["property-type"]==="cross-faded-data-driven"}function Wl(e){return!!e.expression&&e.expression.parameters.indexOf("zoom")>-1}function Ga(e){return!!e.expression&&e.expression.interpolated}function j(e){return e instanceof Number?"number":e instanceof String?"string":e instanceof Boolean?"boolean":Array.isArray(e)?"array":e===null?"null":typeof e}function zi(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function dm(e){return e}function Hl(e,t){let r=t.type==="color",n=e.stops&&typeof e.stops[0][0]=="object",i=n||e.property!==void 0,o=n||!i,a=e.type||(Ga(t)?"exponential":"interval");if(r||t.type==="padding"){let c=r?W.parse:je.parse;e=sr({},e),e.stops&&(e.stops=e.stops.map(p=>[p[0],c(p[1])])),e.default?e.default=c(e.default):e.default=c(t.default)}if(e.colorSpace&&!Wy(e.colorSpace))throw new Error(\'Unknown color space: "\'.concat(e.colorSpace,\'"\'));let s,l,u;if(a==="exponential")s=kl;else if(a==="interval")s=xm;else if(a==="categorical"){s=gm,l=Object.create(null);for(let c of e.stops)l[c[0]]=c[1];u=typeof e.stops[0][0]}else if(a==="identity")s=bm;else throw new Error(\'Unknown function type "\'.concat(a,\'"\'));if(n){let c={},p=[];for(let m=0;m<e.stops.length;m++){let h=e.stops[m],d=h[0].zoom;c[d]===void 0&&(c[d]={zoom:d,type:e.type,property:e.property,default:e.default,stops:[]},p.push(d)),c[d].stops.push([h[0].value,h[1]])}let f=[];for(let m of p)f.push([c[m].zoom,Hl(c[m],t)]);let y={name:"linear"};return{kind:"composite",interpolationType:y,interpolationFactor:qe.interpolationFactor.bind(void 0,y),zoomStops:f.map(m=>m[0]),evaluate({zoom:m},h){return kl({stops:f,base:e.base},t,m).evaluate(m,h)}}}else if(o){let c=a==="exponential"?{name:"exponential",base:e.base!==void 0?e.base:1}:null;return{kind:"camera",interpolationType:c,interpolationFactor:qe.interpolationFactor.bind(void 0,c),zoomStops:e.stops.map(p=>p[0]),evaluate:({zoom:p})=>s(e,t,p,l,u)}}else return{kind:"source",evaluate(c,p){let f=p&&p.properties?p.properties[e.property]:void 0;return f===void 0?Qr(e.default,t.default):s(e,t,f,l,u)}}}function Qr(e,t,r){if(e!==void 0)return e;if(t!==void 0)return t;if(r!==void 0)return r}function gm(e,t,r,n,i){let o=typeof r===i?n[r]:void 0;return Qr(o,e.default,t.default)}function xm(e,t,r){if(j(r)!=="number")return Qr(e.default,t.default);let n=e.stops.length;if(n===1||r<=e.stops[0][0])return e.stops[0][1];if(r>=e.stops[n-1][0])return e.stops[n-1][1];let i=Bi(e.stops.map(o=>o[0]),r);return e.stops[i][1]}function kl(e,t,r){let n=e.base!==void 0?e.base:1;if(j(r)!=="number")return Qr(e.default,t.default);let i=e.stops.length;if(i===1||r<=e.stops[0][0])return e.stops[0][1];if(r>=e.stops[i-1][0])return e.stops[i-1][1];let o=Bi(e.stops.map(c=>c[0]),r),a=vm(r,n,e.stops[o][0],e.stops[o+1][0]),s=e.stops[o][1],l=e.stops[o+1][1],u=Re[t.type]||dm;return typeof s.evaluate=="function"?{evaluate(...c){let p=s.evaluate.apply(void 0,c),f=l.evaluate.apply(void 0,c);if(!(p===void 0||f===void 0))return u(p,f,a,e.colorSpace)}}:u(s,l,a,e.colorSpace)}function bm(e,t,r){switch(t.type){case"color":r=W.parse(r);break;case"formatted":r=Me.fromString(r.toString());break;case"resolvedImage":r=Ce.fromString(r.toString());break;case"padding":r=je.parse(r);break;default:j(r)!==t.type&&(t.type!=="enum"||!t.values[r])&&(r=void 0)}return Qr(r,e.default,t.default)}function vm(e,t,r,n){let i=n-r,o=e-r;return i===0?0:t===1?o/i:(Math.pow(t,o)-1)/(Math.pow(t,i)-1)}var Dt=class{constructor(t,r){this.expression=t,this._warningHistory={},this._evaluator=new Pi,this._defaultValue=r?Sm(r):null,this._enumValues=r&&r.type==="enum"?r.values:null}evaluateWithoutErrorHandling(t,r,n,i,o,a){return this._evaluator.globals=t,this._evaluator.feature=r,this._evaluator.featureState=n,this._evaluator.canonical=i,this._evaluator.availableImages=o||null,this._evaluator.formattedSection=a,this.expression.evaluate(this._evaluator)}evaluate(t,r,n,i,o,a){this._evaluator.globals=t,this._evaluator.feature=r||null,this._evaluator.featureState=n||null,this._evaluator.canonical=i,this._evaluator.availableImages=o||null,this._evaluator.formattedSection=a||null;try{let s=this.expression.evaluate(this._evaluator);if(s==null||typeof s=="number"&&s!==s)return this._defaultValue;if(this._enumValues&&!(s in this._enumValues))throw new oe("Expected value to be one of ".concat(Object.keys(this._enumValues).map(l=>JSON.stringify(l)).join(", "),", but found ").concat(JSON.stringify(s)," instead."));return s}catch(s){return this._warningHistory[s.message]||(this._warningHistory[s.message]=!0,typeof console<"u"&&console.warn(s.message)),this._defaultValue}}};function en(e){return Array.isArray(e)&&e.length>0&&typeof e[0]=="string"&&e[0]in zt}function Rt(e,t){let r=new Si(zt,Ii,[],t?Pm(t):void 0),n=r.parse(e,void 0,void 0,void 0,t&&t.type==="string"?{typeAnnotation:"coerce"}:void 0);return n?za(new Dt(n,t)):ir(r.errors)}var dt=class{constructor(t,r){this.kind=t,this._styleExpression=r,this.isStateDependent=t!=="constant"&&!Wr(r.expression)}evaluateWithoutErrorHandling(t,r,n,i,o,a){return this._styleExpression.evaluateWithoutErrorHandling(t,r,n,i,o,a)}evaluate(t,r,n,i,o,a){return this._styleExpression.evaluate(t,r,n,i,o,a)}},gt=class{constructor(t,r,n,i){this.kind=t,this.zoomStops=n,this._styleExpression=r,this.isStateDependent=t!=="camera"&&!Wr(r.expression),this.interpolationType=i}evaluateWithoutErrorHandling(t,r,n,i,o,a){return this._styleExpression.evaluateWithoutErrorHandling(t,r,n,i,o,a)}evaluate(t,r,n,i,o,a){return this._styleExpression.evaluate(t,r,n,i,o,a)}interpolationFactor(t,r,n){return this.interpolationType?qe.interpolationFactor(this.interpolationType,t,r,n):0}};function Kl(e,t){let r=Rt(e,t);if(r.result==="error")return r;let n=r.value.expression,i=Di(n);if(!i&&!ht(t))return ir([new Ve("","data expressions not supported")]);let o=Vi(n,["zoom"]);if(!o&&!Wl(t))return ir([new Ve("","zoom expressions not supported")]);let a=bi(n);if(!a&&!o)return ir([new Ve("",\'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.\')]);if(a instanceof Ve)return ir([a]);if(a instanceof qe&&!Ga(t))return ir([new Ve("",\'"interpolate" expressions cannot be used with this property\')]);if(!a)return za(i?new dt("constant",r.value):new dt("source",r.value));let s=a instanceof qe?a.interpolation:void 0;return za(i?new gt("camera",r.value,a.labels,s):new gt("composite",r.value,a.labels,s))}var Kr=class e{constructor(t,r){this._parameters=t,this._specification=r,sr(this,Hl(this._parameters,this._specification))}static deserialize(t){return new e(t._parameters,t._specification)}static serialize(t){return{_parameters:t._parameters,_specification:t._specification}}};function Yl(e,t){if(zi(e))return new Kr(e,t);if(en(e)){let r=Kl(e,t);if(r.result==="error")throw new Error(r.value.map(n=>"".concat(n.key,": ").concat(n.message)).join(", "));return r.value}else{let r=e;return t.type==="color"&&typeof e=="string"?r=W.parse(e):t.type==="padding"&&(typeof e=="number"||Array.isArray(e))?r=je.parse(e):t.type==="variableAnchorOffsetCollection"&&Array.isArray(e)&&(r=it.parse(e)),{kind:"constant",evaluate:()=>r}}}function bi(e){let t=null;if(e instanceof Ti)t=bi(e.result);else if(e instanceof ki){for(let r of e.args)if(t=bi(r),t)break}else(e instanceof lr||e instanceof qe)&&e.input instanceof Ye&&e.input.name==="zoom"&&(t=e);return t instanceof Ve||e.eachChild(r=>{let n=bi(r);n instanceof Ve?t=n:!t&&n?t=new Ve("",\'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.\'):t&&n&&t!==n&&(t=new Ve("",\'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.\'))}),t}function Pm(e){let t={color:ze,string:G,number:L,enum:G,boolean:U,formatted:pr,padding:Mi,resolvedImage:Xr,variableAnchorOffsetCollection:Li};return e.type==="array"?Fe(t[e.value]||$,e.length):t[e.type]}function Sm(e){return e.type==="color"&&zi(e.default)?new W(0,0,0,0):e.type==="color"?W.parse(e.default)||null:e.type==="padding"?je.parse(e.default)||null:e.type==="variableAnchorOffsetCollection"?it.parse(e.default)||null:e.default===void 0?null:e.default}function qa(e){if(e===!0||e===!1)return!0;if(!Array.isArray(e)||e.length===0)return!1;switch(e[0]){case"has":return e.length>=2&&e[1]!=="$id"&&e[1]!=="$type";case"in":return e.length>=3&&(typeof e[1]!="string"||Array.isArray(e[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return e.length!==3||Array.isArray(e[1])||Array.isArray(e[2]);case"any":case"all":for(let t of e.slice(1))if(!qa(t)&&typeof t!="boolean")return!1;return!0;default:return!0}}var wm={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function tn(e){if(e==null)return{filter:()=>!0,needGeometry:!1};qa(e)||(e=Ei(e));let t=Rt(e,wm);if(t.result==="error")throw new Error(t.value.map(r=>"".concat(r.key,": ").concat(r.message)).join(", "));{let r=Xl(e);return{filter:(n,i,o)=>t.value.evaluate(n,i,{},o),needGeometry:r}}}function Am(e,t){return e<t?-1:e>t?1:0}function Xl(e){if(!Array.isArray(e))return!1;if(e[0]==="within")return!0;for(let t=1;t<e.length;t++)if(Xl(e[t]))return!0;return!1}function Ei(e){if(!e)return!0;let t=e[0];return e.length<=1?t!=="any":t==="=="?Ia(e[1],e[2],"=="):t==="!="?xi(Ia(e[1],e[2],"==")):t==="<"||t===">"||t==="<="||t===">="?Ia(e[1],e[2],t):t==="any"?_m(e.slice(1)):t==="all"?["all"].concat(e.slice(1).map(Ei)):t==="none"?["all"].concat(e.slice(1).map(Ei).map(xi)):t==="in"?Tl(e[1],e.slice(2)):t==="!in"?xi(Tl(e[1],e.slice(2))):t==="has"?El(e[1]):t==="!has"?xi(El(e[1])):t==="within"?e:!0}function Ia(e,t,r){switch(e){case"$type":return["filter-type-".concat(r),t];case"$id":return["filter-id-".concat(r),t];default:return["filter-".concat(r),e,t]}}function _m(e){return["any"].concat(e.map(Ei))}function Tl(e,t){if(t.length===0)return!1;switch(e){case"$type":return["filter-type-in",["literal",t]];case"$id":return["filter-id-in",["literal",t]];default:return t.length>200&&!t.some(r=>typeof r!=typeof t[0])?["filter-in-large",e,["literal",t.sort(Am)]]:["filter-in-small",e,["literal",t]]}}function El(e){switch(e){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",e]}}function xi(e){return["!",e]}function Ra(e){let t=typeof e;if(t==="number"||t==="boolean"||t==="string"||e===void 0||e===null)return JSON.stringify(e);if(Array.isArray(e)){let i="[";for(let o of e)i+="".concat(Ra(o),",");return"".concat(i,"]")}let r=Object.keys(e).sort(),n="{";for(let i=0;i<r.length;i++)n+="".concat(JSON.stringify(r[i]),":").concat(Ra(e[r[i]]),",");return"".concat(n,"}")}function Im(e){let t="";for(let r of Py)t+="/".concat(Ra(e[r]));return t}function Ql(e,t){let r={};for(let i=0;i<e.length;i++){let o=t&&t[e[i].id]||Im(e[i]);t&&(t[e[i].id]=o);let a=r[o];a||(a=r[o]=[]),a.push(e[i])}let n=[];for(let i in r)n.push(r[i]);return n}function eu(e){let t=e.key,r=e.value;return r?[new D(t,r,"constants have been deprecated as of v8")]:[]}function pe(e){return e instanceof Number||e instanceof String||e instanceof Boolean?e.valueOf():e}function Vt(e){if(Array.isArray(e))return e.map(Vt);if(e instanceof Object&&!(e instanceof Number||e instanceof String||e instanceof Boolean)){let t={};for(let r in e)t[r]=Vt(e[r]);return t}return pe(e)}function Be(e){let t=e.key,r=e.value,n=e.valueSpec||{},i=e.objectElementValidators||{},o=e.style,a=e.styleSpec,s=e.validateSpec,l=[],u=j(r);if(u!=="object")return[new D(t,r,"object expected, ".concat(u," found"))];for(let c in r){let p=c.split(".")[0],f=n[p]||n["*"],y;if(i[p])y=i[p];else if(n[p])y=s;else if(i["*"])y=i["*"];else if(n["*"])y=s;else{l.push(new D(t,r[c],\'unknown property "\'.concat(c,\'"\')));continue}l=l.concat(y({key:(t&&"".concat(t,"."))+c,value:r[c],valueSpec:f,style:o,styleSpec:a,object:r,objectKey:c,validateSpec:s},r))}for(let c in n)i[c]||n[c].required&&n[c].default===void 0&&r[c]===void 0&&l.push(new D(t,r,\'missing required property "\'.concat(c,\'"\')));return l}function ja(e){let t=e.value,r=e.valueSpec,n=e.validateSpec,i=e.style,o=e.styleSpec,a=e.key,s=e.arrayElementValidator||n;if(j(t)!=="array")return[new D(a,t,"array expected, ".concat(j(t)," found"))];if(r.length&&t.length!==r.length)return[new D(a,t,"array length ".concat(r.length," expected, length ").concat(t.length," found"))];if(r["min-length"]&&t.length<r["min-length"])return[new D(a,t,"array length at least ".concat(r["min-length"]," expected, length ").concat(t.length," found"))];let l={type:r.value,values:r.values};o.$version<7&&(l.function=r.function),j(r.value)==="object"&&(l=r.value);let u=[];for(let c=0;c<t.length;c++)u=u.concat(s({array:t,arrayIndex:c,value:t[c],valueSpec:l,validateSpec:e.validateSpec,style:i,styleSpec:o,key:"".concat(a,"[").concat(c,"]")}));return u}function Za(e){let t=e.key,r=e.value,n=e.valueSpec,i=j(r);return i==="number"&&r!==r&&(i="NaN"),i!=="number"?[new D(t,r,"number expected, ".concat(i," found"))]:"minimum"in n&&r<n.minimum?[new D(t,r,"".concat(r," is less than the minimum value ").concat(n.minimum))]:"maximum"in n&&r>n.maximum?[new D(t,r,"".concat(r," is greater than the maximum value ").concat(n.maximum))]:[]}function tu(e){let t=e.valueSpec,r=pe(e.value.type),n,i={},o,a,s=r!=="categorical"&&e.value.property===void 0,l=!s,u=j(e.value.stops)==="array"&&j(e.value.stops[0])==="array"&&j(e.value.stops[0][0])==="object",c=Be({key:e.key,value:e.value,valueSpec:e.styleSpec.function,validateSpec:e.validateSpec,style:e.style,styleSpec:e.styleSpec,objectElementValidators:{stops:p,default:m}});return r==="identity"&&s&&c.push(new D(e.key,e.value,\'missing required property "property"\')),r!=="identity"&&!e.value.stops&&c.push(new D(e.key,e.value,\'missing required property "stops"\')),r==="exponential"&&e.valueSpec.expression&&!Ga(e.valueSpec)&&c.push(new D(e.key,e.value,"exponential functions not supported")),e.styleSpec.$version>=8&&(l&&!ht(e.valueSpec)?c.push(new D(e.key,e.value,"property functions not supported")):s&&!Wl(e.valueSpec)&&c.push(new D(e.key,e.value,"zoom functions not supported"))),(r==="categorical"||u)&&e.value.property===void 0&&c.push(new D(e.key,e.value,\'"property" property is required\')),c;function p(h){if(r==="identity")return[new D(h.key,h.value,\'identity function may not have a "stops" property\')];let d=[],g=h.value;return d=d.concat(ja({key:h.key,value:g,valueSpec:h.valueSpec,validateSpec:h.validateSpec,style:h.style,styleSpec:h.styleSpec,arrayElementValidator:f})),j(g)==="array"&&g.length===0&&d.push(new D(h.key,g,"array must have at least one stop")),d}function f(h){let d=[],g=h.value,v=h.key;if(j(g)!=="array")return[new D(v,g,"array expected, ".concat(j(g)," found"))];if(g.length!==2)return[new D(v,g,"array length 2 expected, length ".concat(g.length," found"))];if(u){if(j(g[0])!=="object")return[new D(v,g,"object expected, ".concat(j(g[0])," found"))];if(g[0].zoom===void 0)return[new D(v,g,"object stop key must have zoom")];if(g[0].value===void 0)return[new D(v,g,"object stop key must have value")];if(a&&a>pe(g[0].zoom))return[new D(v,g[0].zoom,"stop zoom values must appear in ascending order")];pe(g[0].zoom)!==a&&(a=pe(g[0].zoom),o=void 0,i={}),d=d.concat(Be({key:"".concat(v,"[0]"),value:g[0],valueSpec:{zoom:{}},validateSpec:h.validateSpec,style:h.style,styleSpec:h.styleSpec,objectElementValidators:{zoom:Za,value:y}}))}else d=d.concat(y({key:"".concat(v,"[0]"),value:g[0],valueSpec:{},validateSpec:h.validateSpec,style:h.style,styleSpec:h.styleSpec},g));return en(Vt(g[1]))?d.concat([new D("".concat(v,"[1]"),g[1],"expressions are not allowed in function stops.")]):d.concat(h.validateSpec({key:"".concat(v,"[1]"),value:g[1],valueSpec:t,validateSpec:h.validateSpec,style:h.style,styleSpec:h.styleSpec}))}function y(h,d){let g=j(h.value),v=pe(h.value),b=h.value!==null?h.value:d;if(!n)n=g;else if(g!==n)return[new D(h.key,b,"".concat(g," stop domain type must match previous stop domain type ").concat(n))];if(g!=="number"&&g!=="string"&&g!=="boolean")return[new D(h.key,b,"stop domain value must be a number, string, or boolean")];if(g!=="number"&&r!=="categorical"){let x="number expected, ".concat(g," found");return ht(t)&&r===void 0&&(x+=\'\\nIf you intended to use a categorical function, specify `"type": "categorical"`.\'),[new D(h.key,b,x)]}return r==="categorical"&&g==="number"&&(!isFinite(v)||Math.floor(v)!==v)?[new D(h.key,b,"integer expected, found ".concat(v))]:r!=="categorical"&&g==="number"&&o!==void 0&&v<o?[new D(h.key,b,"stop domain values must appear in ascending order")]:(o=v,r==="categorical"&&v in i?[new D(h.key,b,"stop domain values must be unique")]:(i[v]=!0,[]))}function m(h){return h.validateSpec({key:h.key,value:h.value,valueSpec:t,validateSpec:h.validateSpec,style:h.style,styleSpec:h.styleSpec})}}function ur(e){let t=(e.expressionContext==="property"?Kl:Rt)(Vt(e.value),e.valueSpec);if(t.result==="error")return t.value.map(n=>new D("".concat(e.key).concat(n.key),e.value,n.message));let r=t.value.expression||t.value._styleExpression.expression;if(e.expressionContext==="property"&&e.propertyKey==="text-font"&&!r.outputDefined())return[new D(e.key,e.value,\'Invalid data expression for "\'.concat(e.propertyKey,\'". Output values must be contained as literals within the expression.\'))];if(e.expressionContext==="property"&&e.propertyType==="layout"&&!Wr(r))return[new D(e.key,e.value,\'"feature-state" data expressions are not supported with layout properties.\')];if(e.expressionContext==="filter"&&!Wr(r))return[new D(e.key,e.value,\'"feature-state" data expressions are not supported with filters.\')];if(e.expressionContext&&e.expressionContext.indexOf("cluster")===0){if(!Vi(r,["zoom","feature-state"]))return[new D(e.key,e.value,\'"zoom" and "feature-state" expressions are not supported with cluster properties.\')];if(e.expressionContext==="cluster-initial"&&!Di(r))return[new D(e.key,e.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function Cm(e){let t=e.value,r=e.key,n=j(t);return n!=="boolean"?[new D(r,t,"boolean expected, ".concat(n," found"))]:[]}function km(e){let t=e.key,r=e.value,n=j(r);return n!=="string"?[new D(t,r,"color expected, ".concat(n," found"))]:W.parse(String(r))?[]:[new D(t,r,\'color expected, "\'.concat(r,\'" found\'))]}function Yr(e){let t=e.key,r=e.value,n=e.valueSpec,i=[];return Array.isArray(n.values)?n.values.indexOf(pe(r))===-1&&i.push(new D(t,r,"expected one of [".concat(n.values.join(", "),"], ").concat(JSON.stringify(r)," found"))):Object.keys(n.values).indexOf(pe(r))===-1&&i.push(new D(t,r,"expected one of [".concat(Object.keys(n.values).join(", "),"], ").concat(JSON.stringify(r)," found"))),i}function Ja(e){return qa(Vt(e.value))?ur(sr({},e,{expressionContext:"filter",valueSpec:{value:"boolean"}})):ru(e)}function ru(e){let t=e.value,r=e.key;if(j(t)!=="array")return[new D(r,t,"array expected, ".concat(j(t)," found"))];let n=e.styleSpec,i,o=[];if(t.length<1)return[new D(r,t,"filter array must have at least 1 element")];switch(o=o.concat(Yr({key:"".concat(r,"[0]"),value:t[0],valueSpec:n.filter_operator,style:e.style,styleSpec:e.styleSpec})),pe(t[0])){case"<":case"<=":case">":case">=":t.length>=2&&pe(t[1])==="$type"&&o.push(new D(r,t,\'"$type" cannot be use with operator "\'.concat(t[0],\'"\')));case"==":case"!=":t.length!==3&&o.push(new D(r,t,\'filter array for operator "\'.concat(t[0],\'" must have 3 elements\')));case"in":case"!in":t.length>=2&&(i=j(t[1]),i!=="string"&&o.push(new D("".concat(r,"[1]"),t[1],"string expected, ".concat(i," found"))));for(let a=2;a<t.length;a++)i=j(t[a]),pe(t[1])==="$type"?o=o.concat(Yr({key:"".concat(r,"[").concat(a,"]"),value:t[a],valueSpec:n.geometry_type,style:e.style,styleSpec:e.styleSpec})):i!=="string"&&i!=="number"&&i!=="boolean"&&o.push(new D("".concat(r,"[").concat(a,"]"),t[a],"string, number, or boolean expected, ".concat(i," found")));break;case"any":case"all":case"none":for(let a=1;a<t.length;a++)o=o.concat(ru({key:"".concat(r,"[").concat(a,"]"),value:t[a],style:e.style,styleSpec:e.styleSpec}));break;case"has":case"!has":i=j(t[1]),t.length!==2?o.push(new D(r,t,\'filter array for "\'.concat(t[0],\'" operator must have 2 elements\'))):i!=="string"&&o.push(new D("".concat(r,"[1]"),t[1],"string expected, ".concat(i," found")));break;case"within":i=j(t[1]),t.length!==2?o.push(new D(r,t,\'filter array for "\'.concat(t[0],\'" operator must have 2 elements\'))):i!=="object"&&o.push(new D("".concat(r,"[1]"),t[1],"object expected, ".concat(i," found")));break}return o}function nu(e,t){let r=e.key,n=e.validateSpec,i=e.style,o=e.styleSpec,a=e.value,s=e.objectKey,l=o["".concat(t,"_").concat(e.layerType)];if(!l)return[];let u=s.match(/^(.*)-transition$/);if(t==="paint"&&u&&l[u[1]]&&l[u[1]].transition)return n({key:r,value:a,valueSpec:o.transition,style:i,styleSpec:o});let c=e.valueSpec||l[s];if(!c)return[new D(r,a,\'unknown property "\'.concat(s,\'"\'))];let p;if(j(a)==="string"&&ht(c)&&!c.tokens&&(p=/^{([^}]+)}$/.exec(a)))return[new D(r,a,\'"\'.concat(s,\'" does not support interpolation syntax\\n\')+\'Use an identity property function instead: `{ "type": "identity", "property": \'.concat(JSON.stringify(p[1])," }`."))];let f=[];return e.layerType==="symbol"&&(s==="text-field"&&i&&!i.glyphs&&f.push(new D(r,a,\'use of "text-field" requires a style "glyphs" property\')),s==="text-font"&&zi(Vt(a))&&pe(a.type)==="identity"&&f.push(new D(r,a,\'"text-font" does not support identity functions\'))),f.concat(n({key:e.key,value:a,valueSpec:c,style:i,styleSpec:o,expressionContext:"property",propertyType:t,propertyKey:s}))}function iu(e){return nu(e,"paint")}function ou(e){return nu(e,"layout")}function au(e){let t=[],r=e.value,n=e.key,i=e.style,o=e.styleSpec;!r.type&&!r.ref&&t.push(new D(n,r,\'either "type" or "ref" is required\'));let a=pe(r.type),s=pe(r.ref);if(r.id){let l=pe(r.id);for(let u=0;u<e.arrayIndex;u++){let c=i.layers[u];pe(c.id)===l&&t.push(new D(n,r.id,\'duplicate layer id "\'.concat(r.id,\'", previously used at line \').concat(c.id.__line__)))}}if("ref"in r){["type","source","source-layer","filter","layout"].forEach(u=>{u in r&&t.push(new D(n,r[u],\'"\'.concat(u,\'" is prohibited for ref layers\')))});let l;i.layers.forEach(u=>{pe(u.id)===s&&(l=u)}),l?l.ref?t.push(new D(n,r.ref,"ref cannot reference another ref layer")):a=pe(l.type):t.push(new D(n,r.ref,\'ref layer "\'.concat(s,\'" not found\')))}else if(a!=="background")if(!r.source)t.push(new D(n,r,\'missing required property "source"\'));else{let l=i.sources&&i.sources[r.source],u=l&&pe(l.type);l?u==="vector"&&a==="raster"?t.push(new D(n,r.source,\'layer "\'.concat(r.id,\'" requires a raster source\'))):u==="raster"&&a!=="raster"?t.push(new D(n,r.source,\'layer "\'.concat(r.id,\'" requires a vector source\'))):u==="vector"&&!r["source-layer"]?t.push(new D(n,r,\'layer "\'.concat(r.id,\'" must specify a "source-layer"\'))):u==="raster-dem"&&a!=="hillshade"?t.push(new D(n,r.source,"raster-dem source can only be used with layer type \'hillshade\'.")):a==="line"&&r.paint&&r.paint["line-gradient"]&&(u!=="geojson"||!l.lineMetrics)&&t.push(new D(n,r,\'layer "\'.concat(r.id,\'" specifies a line-gradient, which requires a GeoJSON source with `lineMetrics` enabled.\'))):t.push(new D(n,r.source,\'source "\'.concat(r.source,\'" not found\')))}return t=t.concat(Be({key:n,value:r,valueSpec:o.layer,style:e.style,styleSpec:e.styleSpec,validateSpec:e.validateSpec,objectElementValidators:{"*"(){return[]},type(){return e.validateSpec({key:"".concat(n,".type"),value:r.type,valueSpec:o.layer.type,style:e.style,styleSpec:e.styleSpec,validateSpec:e.validateSpec,object:r,objectKey:"type"})},filter:Ja,layout(l){return Be({layer:r,key:l.key,value:l.value,style:l.style,styleSpec:l.styleSpec,validateSpec:l.validateSpec,objectElementValidators:{"*"(u){return ou(sr({layerType:a},u))}}})},paint(l){return Be({layer:r,key:l.key,value:l.value,style:l.style,styleSpec:l.styleSpec,validateSpec:l.validateSpec,objectElementValidators:{"*"(u){return iu(sr({layerType:a},u))}}})}}})),t}function Bt(e){let t=e.value,r=e.key,n=j(t);return n!=="string"?[new D(r,t,"string expected, ".concat(n," found"))]:[]}var Fl={promoteId:Tm};function su(e){let t=e.value,r=e.key,n=e.styleSpec,i=e.style,o=e.validateSpec;if(!t.type)return[new D(r,t,\'"type" is required\')];let a=pe(t.type),s;switch(a){case"vector":case"raster":case"raster-dem":return s=Be({key:r,value:t,valueSpec:n["source_".concat(a.replace("-","_"))],style:e.style,styleSpec:n,objectElementValidators:Fl,validateSpec:o}),s;case"geojson":if(s=Be({key:r,value:t,valueSpec:n.source_geojson,style:i,styleSpec:n,validateSpec:o,objectElementValidators:Fl}),t.cluster)for(let l in t.clusterProperties){let[u,c]=t.clusterProperties[l],p=typeof u=="string"?[u,["accumulated"],["get",l]]:u;s.push(...ur({key:"".concat(r,".").concat(l,".map"),value:c,validateSpec:o,expressionContext:"cluster-map"})),s.push(...ur({key:"".concat(r,".").concat(l,".reduce"),value:p,validateSpec:o,expressionContext:"cluster-reduce"}))}return s;case"video":return Be({key:r,value:t,valueSpec:n.source_video,style:i,validateSpec:o,styleSpec:n});case"image":return Be({key:r,value:t,valueSpec:n.source_image,style:i,validateSpec:o,styleSpec:n});case"canvas":return[new D(r,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return Yr({key:"".concat(r,".type"),value:t.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:i,validateSpec:o,styleSpec:n})}}function Tm({key:e,value:t}){if(j(t)==="string")return Bt({key:e,value:t});{let r=[];for(let n in t)r.push(...Bt({key:"".concat(e,".").concat(n),value:t[n]}));return r}}function lu(e){let t=e.value,r=e.styleSpec,n=r.light,i=e.style,o=[],a=j(t);if(t===void 0)return o;if(a!=="object")return o=o.concat([new D("light",t,"object expected, ".concat(a," found"))]),o;for(let s in t){let l=s.match(/^(.*)-transition$/);l&&n[l[1]]&&n[l[1]].transition?o=o.concat(e.validateSpec({key:s,value:t[s],valueSpec:r.transition,validateSpec:e.validateSpec,style:i,styleSpec:r})):n[s]?o=o.concat(e.validateSpec({key:s,value:t[s],valueSpec:n[s],validateSpec:e.validateSpec,style:i,styleSpec:r})):o=o.concat([new D(s,t[s],\'unknown property "\'.concat(s,\'"\'))])}return o}function uu(e){let t=e.value,r=e.styleSpec,n=r.terrain,i=e.style,o=[],a=j(t);if(t===void 0)return o;if(a!=="object")return o=o.concat([new D("terrain",t,"object expected, ".concat(a," found"))]),o;for(let s in t)n[s]?o=o.concat(e.validateSpec({key:s,value:t[s],valueSpec:n[s],validateSpec:e.validateSpec,style:i,styleSpec:r})):o=o.concat([new D(s,t[s],\'unknown property "\'.concat(s,\'"\'))]);return o}function Em(e){return Bt(e).length===0?[]:ur(e)}function Fm(e){return Bt(e).length===0?[]:ur(e)}function Mm(e){let t=e.key,r=e.value;if(j(r)==="array"){if(r.length<1||r.length>4)return[new D(t,r,"padding requires 1 to 4 values; ".concat(r.length," values found"))];let i={type:"number"},o=[];for(let a=0;a<r.length;a++)o=o.concat(e.validateSpec({key:"".concat(t,"[").concat(a,"]"),value:r[a],validateSpec:e.validateSpec,valueSpec:i}));return o}else return Za({key:t,value:r,valueSpec:{}})}function Lm(e){let t=e.key,r=e.value,n=j(r),i=e.styleSpec;if(n!=="array"||r.length<1||r.length%2!==0)return[new D(t,r,"variableAnchorOffsetCollection requires a non-empty array of even length")];let o=[];for(let a=0;a<r.length;a+=2)o=o.concat(Yr({key:"".concat(t,"[").concat(a,"]"),value:r[a],valueSpec:i.layout_symbol["text-anchor"]})),o=o.concat(ja({key:"".concat(t,"[").concat(a+1,"]"),value:r[a+1],valueSpec:{length:2,value:"number"},validateSpec:e.validateSpec,style:e.style,styleSpec:i}));return o}function cu(e){let t=[],r=e.value,n=e.key;if(Array.isArray(r)){let i=[],o=[];for(let a in r){r[a].id&&i.includes(r[a].id)&&t.push(new D(n,r,"all the sprites\' ids must be unique, but ".concat(r[a].id," is duplicated"))),i.push(r[a].id),r[a].url&&o.includes(r[a].url)&&t.push(new D(n,r,"all the sprites\' URLs must be unique, but ".concat(r[a].url," is duplicated"))),o.push(r[a].url);let s={id:{type:"string",required:!0},url:{type:"string",required:!0}};t=t.concat(Be({key:"".concat(n,"[").concat(a,"]"),value:r[a],valueSpec:s,validateSpec:e.validateSpec}))}return t}else return Bt({key:n,value:r})}var Ml={"*"(){return[]},array:ja,boolean:Cm,number:Za,color:km,constants:eu,enum:Yr,filter:Ja,function:tu,layer:au,object:Be,source:su,light:lu,terrain:uu,string:Bt,formatted:Em,resolvedImage:Fm,padding:Mm,variableAnchorOffsetCollection:Lm,sprite:cu};function $r(e){let t=e.value,r=e.valueSpec,n=e.styleSpec;return e.validateSpec=$r,r.expression&&zi(pe(t))?tu(e):r.expression&&en(Vt(t))?ur(e):r.type&&Ml[r.type]?Ml[r.type](e):Be(sr({},e,{valueSpec:r.type?n[r.type]:r}))}function pu(e){let t=e.value,r=e.key,n=Bt(e);return n.length||(t.indexOf("{fontstack}")===-1&&n.push(new D(r,t,\'"glyphs" url must include a "{fontstack}" token\')),t.indexOf("{range}")===-1&&n.push(new D(r,t,\'"glyphs" url must include a "{range}" token\'))),n}function Ze(e,t=S){let r=[];return r=r.concat($r({key:"",value:e,valueSpec:t.$root,styleSpec:t,style:e,validateSpec:$r,objectElementValidators:{glyphs:pu,"*"(){return[]}}})),e.constants&&(r=r.concat(eu({key:"constants",value:e.constants,style:e,styleSpec:t,validateSpec:$r}))),fu(r)}Ze.source=at(ot(su));Ze.sprite=at(ot(cu));Ze.glyphs=at(ot(pu));Ze.light=at(ot(lu));Ze.terrain=at(ot(uu));Ze.layer=at(ot(au));Ze.filter=at(ot(Ja));Ze.paintProperty=at(ot(iu));Ze.layoutProperty=at(ot(ou));function ot(e){return function(t){return e({...t,validateSpec:$r})}}function fu(e){return[].concat(e).sort((t,r)=>t.line-r.line)}function at(e){return function(...t){return fu(e.apply(this,t))}}var yu={MAX_PARALLEL_IMAGE_REQUESTS:16,MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:8,MAX_TILE_CACHE_ZOOM_LEVELS:5,REGISTERED_PROTOCOLS:{},WORKER_URL:""};var yr=class extends Error{constructor(r,n,i,o){super("AJAXError: ".concat(n," (").concat(r,"): ").concat(i));this.status=r,this.statusText=n,this.url=i,this.body=o}},hu=Ie()?()=>self.worker&&self.worker.referrer:()=>(window.location.protocol==="blob:"?window.parent:window).location.href,Dm=e=>yu.REGISTERED_PROTOCOLS[e.substring(0,e.indexOf("://"))],Vm=e=>/^file:/.test(e)||/^file:/.test(hu())&&!/^\\w+:/.test(e);function mu(e,t){let r=new AbortController,n=new Request(e.url,{method:e.method||"GET",body:e.body,credentials:e.credentials,headers:e.headers,referrer:hu(),signal:r.signal}),i=!1,o=!1;e.type==="json"&&n.headers.set("Accept","application/json");let a=(l,u,c)=>{if(!o){if(l&&l.message!=="SecurityError"&&ce(l),u&&c)return s(u);fetch(n).then(p=>p.ok?s(p):p.blob().then(f=>t(new yr(p.status,p.statusText,e.url,f)))).catch(p=>{p.code!==20&&t(new Error(p.message))})}},s=l=>{(e.type==="arrayBuffer"||e.type==="image"?l.arrayBuffer():e.type==="json"?l.json():l.text()).then(u=>{o||(i=!0,t(null,u,l.headers.get("Cache-Control"),l.headers.get("Expires")))}).catch(u=>{o||t(new Error(u.message))})};return a(null,null),{cancel:()=>{o=!0,i||r.abort()}}}function Bm(e,t){let r=new XMLHttpRequest;r.open(e.method||"GET",e.url,!0),(e.type==="arrayBuffer"||e.type==="image")&&(r.responseType="arraybuffer");for(let n in e.headers)r.setRequestHeader(n,e.headers[n]);return e.type==="json"&&(r.responseType="text",r.setRequestHeader("Accept","application/json")),r.withCredentials=e.credentials==="include",r.onerror=()=>{t(new Error(r.statusText))},r.onload=()=>{if((r.status>=200&&r.status<300||r.status===0)&&r.response!==null){let n=r.response;if(e.type==="json")try{n=JSON.parse(r.response)}catch(i){return t(i)}t(null,n,r.getResponseHeader("Cache-Control"),r.getResponseHeader("Expires"))}else{let n=new Blob([r.response],{type:r.getResponseHeader("Content-Type")});t(new yr(r.status,r.statusText,e.url,n))}},r.send(e.body),{cancel:()=>r.abort()}}var du=function(e,t){if(/:\\/\\//.test(e.url)&&!/^https?:|^file:/.test(e.url)){if(Ie()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",e,t);if(!Ie())return(Dm(e.url)||mu)(e,t)}if(!Vm(e.url)){if(fetch&&Request&&AbortController&&Object.prototype.hasOwnProperty.call(Request.prototype,"signal"))return mu(e,t);if(Ie()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",e,t,void 0,!0)}return Bm(e,t)},gu=function(e,t){return du(Ae(e,{type:"json"}),t)},Wa=function(e,t){return du(Ae(e,{type:"arrayBuffer"}),t)};var xt={};function k(e,t,r={}){if(xt[e])throw new Error("".concat(e," is already registered."));Object.defineProperty(t,"_classRegistryKey",{value:e,writeable:!1}),xt[e]={klass:t,omit:r.omit||[],shallow:r.shallow||[]}}k("Object",Object);k("TransferableGridIndex",Ft);k("Color",W);k("Error",Error);k("AJAXError",yr);k("ResolvedImage",Ce);k("StylePropertyFunction",Kr);k("StyleExpression",Dt,{omit:["_evaluator"]});k("ZoomDependentExpression",gt);k("ZoomConstantExpression",dt);k("CompoundExpression",Ye,{omit:["_evaluate"]});for(let e in zt)zt[e]._classRegistryKey||k("Expression_".concat(e),zt[e]);function xu(e){return e&&typeof ArrayBuffer<"u"&&(e instanceof ArrayBuffer||e.constructor&&e.constructor.name==="ArrayBuffer")}function mr(e,t){if(e==null||typeof e=="boolean"||typeof e=="number"||typeof e=="string"||e instanceof Boolean||e instanceof Number||e instanceof String||e instanceof Date||e instanceof RegExp||e instanceof Blob)return e;if(xu(e)||Or(e))return t&&t.push(e),e;if(ArrayBuffer.isView(e)){let r=e;return t&&t.push(r.buffer),r}if(e instanceof ImageData)return t&&t.push(e.data.buffer),e;if(Array.isArray(e)){let r=[];for(let n of e)r.push(mr(n,t));return r}if(typeof e=="object"){let r=e.constructor,n=r._classRegistryKey;if(!n)throw new Error("can\'t serialize object of unregistered class");if(!xt[n])throw new Error("".concat(n," is not registered."));let i=r.serialize?r.serialize(e,t):{};if(r.serialize){if(t&&i===t[t.length-1])throw new Error("statically serialized object won\'t survive transfer of $name property")}else{for(let o in e){if(!e.hasOwnProperty(o)||xt[n].omit.indexOf(o)>=0)continue;let a=e[o];i[o]=xt[n].shallow.indexOf(o)>=0?a:mr(a,t)}e instanceof Error&&(i.message=e.message)}if(i.$name)throw new Error("$name property is reserved for worker serialization logic.");return n!=="Object"&&(i.$name=n),i}throw new Error("can\'t serialize object of type ".concat(typeof e))}function hr(e){if(e==null||typeof e=="boolean"||typeof e=="number"||typeof e=="string"||e instanceof Boolean||e instanceof Number||e instanceof String||e instanceof Date||e instanceof RegExp||e instanceof Blob||xu(e)||Or(e)||ArrayBuffer.isView(e)||e instanceof ImageData)return e;if(Array.isArray(e))return e.map(hr);if(typeof e=="object"){let t=e.$name||"Object";if(!xt[t])throw new Error("can\'t deserialize unregistered class ".concat(t));let{klass:r}=xt[t];if(!r)throw new Error("can\'t deserialize unregistered class ".concat(t));if(r.deserialize)return r.deserialize(e);let n=Object.create(r.prototype);for(let i of Object.keys(e)){if(i==="$name")continue;let o=e[i];n[i]=xt[t].shallow.indexOf(i)>=0?o:hr(o)}return n}throw new Error("can\'t deserialize object of type ".concat(typeof e))}var Ri=class{constructor(t){this._callback=t,this._triggered=!1,typeof MessageChannel<"u"&&(this._channel=new MessageChannel,this._channel.port2.onmessage=()=>{this._triggered=!1,this._callback()})}trigger(){this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout(()=>{this._triggered=!1,this._callback()},0))}remove(){delete this._channel,this._callback=()=>{}}};var Oi=class{constructor(t,r,n){this.receive=t=>{let r=t.data,n=r.id;if(n&&!(r.targetMapId&&this.mapId!==r.targetMapId))if(r.type==="<cancel>"){delete this.tasks[n];let i=this.cancelCallbacks[n];delete this.cancelCallbacks[n],i&&i()}else Ie()||r.mustQueue?(this.tasks[n]=r,this.taskQueue.push(n),this.invoker.trigger()):this.processTask(n,r)};this.process=()=>{if(!this.taskQueue.length)return;let t=this.taskQueue.shift(),r=this.tasks[t];delete this.tasks[t],this.taskQueue.length&&this.invoker.trigger(),r&&this.processTask(t,r)};this.target=t,this.parent=r,this.mapId=n,this.callbacks={},this.tasks={},this.taskQueue=[],this.cancelCallbacks={},this.invoker=new Ri(this.process),this.target.addEventListener("message",this.receive,!1),this.globalScope=Ie()?t:window}send(t,r,n,i,o=!1){let a=Math.round(Math.random()*1e18).toString(36).substring(0,10);n&&(this.callbacks[a]=n);let s=ba(this.globalScope)?void 0:[];return this.target.postMessage({id:a,type:t,hasCallback:!!n,targetMapId:i,mustQueue:o,sourceMapId:this.mapId,data:mr(r,s)},s),{cancel:()=>{n&&delete this.callbacks[a],this.target.postMessage({id:a,type:"<cancel>",targetMapId:i,sourceMapId:this.mapId})}}}processTask(t,r){if(r.type==="<response>"){let n=this.callbacks[t];delete this.callbacks[t],n&&(r.error?n(hr(r.error)):n(null,hr(r.data)))}else{let n=!1,i=ba(this.globalScope)?void 0:[],o=r.hasCallback?(l,u)=>{n=!0,delete this.cancelCallbacks[t],this.target.postMessage({id:t,type:"<response>",sourceMapId:this.mapId,error:l?mr(l):null,data:mr(u,i)},i)}:l=>{n=!0},a=null,s=hr(r.data);if(this.parent[r.type])a=this.parent[r.type](r.sourceMapId,s,o);else if(this.parent.getWorkerSource){let l=r.type.split(".");a=this.parent.getWorkerSource(r.sourceMapId,l[0],s.source)[l[1]](s,o)}else o(new Error("Could not find function ".concat(r.type)));!n&&a&&a.cancel&&(this.cancelCallbacks[t]=a.cancel)}}remove(){this.invoker.remove(),this.target.removeEventListener("message",this.receive,!1)}};function bu(e,t,r){r[e]&&r[e].indexOf(t)!==-1||(r[e]=r[e]||[],r[e].push(t))}function Ha(e,t,r){if(r&&r[e]){let n=r[e].indexOf(t);n!==-1&&r[e].splice(n,1)}}var rn=class{constructor(t,r={}){Ae(this,r),this.type=t}},nn=class extends rn{constructor(r,n={}){super("error",Ae({error:r},n))}},dr=class{on(t,r){return this._listeners=this._listeners||{},bu(t,r,this._listeners),this}off(t,r){return Ha(t,r,this._listeners),Ha(t,r,this._oneTimeListeners),this}once(t,r){return r?(this._oneTimeListeners=this._oneTimeListeners||{},bu(t,r,this._oneTimeListeners),this):new Promise(n=>this.once(t,n))}fire(t,r){typeof t=="string"&&(t=new rn(t,r||{}));let n=t.type;if(this.listens(n)){t.target=this;let i=this._listeners&&this._listeners[n]?this._listeners[n].slice():[];for(let s of i)s.call(this,t);let o=this._oneTimeListeners&&this._oneTimeListeners[n]?this._oneTimeListeners[n].slice():[];for(let s of o)Ha(n,s,this._oneTimeListeners),s.call(this,t);let a=this._eventedParent;a&&(Ae(t,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),a.fire(t))}else t instanceof nn&&console.error(t.error);return this}listens(t){return this._listeners&&this._listeners[t]&&this._listeners[t].length>0||this._oneTimeListeners&&this._oneTimeListeners[t]&&this._oneTimeListeners[t].length>0||this._eventedParent&&this._eventedParent.listens(t)}setEventedParent(t,r){return this._eventedParent=t,this._eventedParentData=r,this}};var bt=Ze,vb=bt.source,Pb=bt.light,Sb=bt.terrain,wb=bt.filter,vu=bt.paintProperty,Pu=bt.layoutProperty;function Su(e,t){let r=!1;if(t&&t.length)for(let n of t)e.fire(new nn(new Error(n.message))),r=!0;return r}var Ni=class{constructor(){this.first=!0}update(t,r){let n=Math.floor(t);return this.first?(this.first=!1,this.lastIntegerZoom=n,this.lastIntegerZoomTime=0,this.lastZoom=t,this.lastFloorZoom=n,!0):(this.lastFloorZoom>n?(this.lastIntegerZoom=n+1,this.lastIntegerZoomTime=r):this.lastFloorZoom<n&&(this.lastIntegerZoom=n,this.lastIntegerZoomTime=r),t!==this.lastZoom?(this.lastZoom=t,this.lastFloorZoom=n,!0):!1)}};var V={"Latin-1 Supplement":e=>e>=128&&e<=255,Arabic:e=>e>=1536&&e<=1791,"Arabic Supplement":e=>e>=1872&&e<=1919,"Arabic Extended-A":e=>e>=2208&&e<=2303,"Hangul Jamo":e=>e>=4352&&e<=4607,"Unified Canadian Aboriginal Syllabics":e=>e>=5120&&e<=5759,Khmer:e=>e>=6016&&e<=6143,"Unified Canadian Aboriginal Syllabics Extended":e=>e>=6320&&e<=6399,"General Punctuation":e=>e>=8192&&e<=8303,"Letterlike Symbols":e=>e>=8448&&e<=8527,"Number Forms":e=>e>=8528&&e<=8591,"Miscellaneous Technical":e=>e>=8960&&e<=9215,"Control Pictures":e=>e>=9216&&e<=9279,"Optical Character Recognition":e=>e>=9280&&e<=9311,"Enclosed Alphanumerics":e=>e>=9312&&e<=9471,"Geometric Shapes":e=>e>=9632&&e<=9727,"Miscellaneous Symbols":e=>e>=9728&&e<=9983,"Miscellaneous Symbols and Arrows":e=>e>=11008&&e<=11263,"CJK Radicals Supplement":e=>e>=11904&&e<=12031,"Kangxi Radicals":e=>e>=12032&&e<=12255,"Ideographic Description Characters":e=>e>=12272&&e<=12287,"CJK Symbols and Punctuation":e=>e>=12288&&e<=12351,Hiragana:e=>e>=12352&&e<=12447,Katakana:e=>e>=12448&&e<=12543,Bopomofo:e=>e>=12544&&e<=12591,"Hangul Compatibility Jamo":e=>e>=12592&&e<=12687,Kanbun:e=>e>=12688&&e<=12703,"Bopomofo Extended":e=>e>=12704&&e<=12735,"CJK Strokes":e=>e>=12736&&e<=12783,"Katakana Phonetic Extensions":e=>e>=12784&&e<=12799,"Enclosed CJK Letters and Months":e=>e>=12800&&e<=13055,"CJK Compatibility":e=>e>=13056&&e<=13311,"CJK Unified Ideographs Extension A":e=>e>=13312&&e<=19903,"Yijing Hexagram Symbols":e=>e>=19904&&e<=19967,"CJK Unified Ideographs":e=>e>=19968&&e<=40959,"Yi Syllables":e=>e>=40960&&e<=42127,"Yi Radicals":e=>e>=42128&&e<=42191,"Hangul Jamo Extended-A":e=>e>=43360&&e<=43391,"Hangul Syllables":e=>e>=44032&&e<=55215,"Hangul Jamo Extended-B":e=>e>=55216&&e<=55295,"Private Use Area":e=>e>=57344&&e<=63743,"CJK Compatibility Ideographs":e=>e>=63744&&e<=64255,"Arabic Presentation Forms-A":e=>e>=64336&&e<=65023,"Vertical Forms":e=>e>=65040&&e<=65055,"CJK Compatibility Forms":e=>e>=65072&&e<=65103,"Small Form Variants":e=>e>=65104&&e<=65135,"Arabic Presentation Forms-B":e=>e>=65136&&e<=65279,"Halfwidth and Fullwidth Forms":e=>e>=65280&&e<=65519};function on(e){for(let t of e)if(Ui(t.charCodeAt(0)))return!0;return!1}function wu(e){for(let t of e)if(!zm(t.charCodeAt(0)))return!1;return!0}function zm(e){return!(V.Arabic(e)||V["Arabic Supplement"](e)||V["Arabic Extended-A"](e)||V["Arabic Presentation Forms-A"](e)||V["Arabic Presentation Forms-B"](e))}function Au(e){return e<11904?!1:!!(V["Bopomofo Extended"](e)||V.Bopomofo(e)||V["CJK Compatibility Forms"](e)||V["CJK Compatibility Ideographs"](e)||V["CJK Compatibility"](e)||V["CJK Radicals Supplement"](e)||V["CJK Strokes"](e)||V["CJK Symbols and Punctuation"](e)||V["CJK Unified Ideographs Extension A"](e)||V["CJK Unified Ideographs"](e)||V["Enclosed CJK Letters and Months"](e)||V["Halfwidth and Fullwidth Forms"](e)||V.Hiragana(e)||V["Ideographic Description Characters"](e)||V["Kangxi Radicals"](e)||V["Katakana Phonetic Extensions"](e)||V.Katakana(e)||V["Vertical Forms"](e)||V["Yi Radicals"](e)||V["Yi Syllables"](e))}function Ui(e){return e===746||e===747?!0:e<4352?!1:!!(V["Bopomofo Extended"](e)||V.Bopomofo(e)||V["CJK Compatibility Forms"](e)&&!(e>=65097&&e<=65103)||V["CJK Compatibility Ideographs"](e)||V["CJK Compatibility"](e)||V["CJK Radicals Supplement"](e)||V["CJK Strokes"](e)||V["CJK Symbols and Punctuation"](e)&&!(e>=12296&&e<=12305)&&!(e>=12308&&e<=12319)&&e!==12336||V["CJK Unified Ideographs Extension A"](e)||V["CJK Unified Ideographs"](e)||V["Enclosed CJK Letters and Months"](e)||V["Hangul Compatibility Jamo"](e)||V["Hangul Jamo Extended-A"](e)||V["Hangul Jamo Extended-B"](e)||V["Hangul Jamo"](e)||V["Hangul Syllables"](e)||V.Hiragana(e)||V["Ideographic Description Characters"](e)||V.Kanbun(e)||V["Kangxi Radicals"](e)||V["Katakana Phonetic Extensions"](e)||V.Katakana(e)&&e!==12540||V["Halfwidth and Fullwidth Forms"](e)&&e!==65288&&e!==65289&&e!==65293&&!(e>=65306&&e<=65310)&&e!==65339&&e!==65341&&e!==65343&&!(e>=65371&&e<=65503)&&e!==65507&&!(e>=65512&&e<=65519)||V["Small Form Variants"](e)&&!(e>=65112&&e<=65118)&&!(e>=65123&&e<=65126)||V["Unified Canadian Aboriginal Syllabics"](e)||V["Unified Canadian Aboriginal Syllabics Extended"](e)||V["Vertical Forms"](e)||V["Yijing Hexagram Symbols"](e)||V["Yi Syllables"](e)||V["Yi Radicals"](e))}function Rm(e){return!!(V["Latin-1 Supplement"](e)&&(e===167||e===169||e===174||e===177||e===188||e===189||e===190||e===215||e===247)||V["General Punctuation"](e)&&(e===8214||e===8224||e===8225||e===8240||e===8241||e===8251||e===8252||e===8258||e===8263||e===8264||e===8265||e===8273)||V["Letterlike Symbols"](e)||V["Number Forms"](e)||V["Miscellaneous Technical"](e)&&(e>=8960&&e<=8967||e>=8972&&e<=8991||e>=8996&&e<=9e3||e===9003||e>=9085&&e<=9114||e>=9150&&e<=9165||e===9167||e>=9169&&e<=9179||e>=9186&&e<=9215)||V["Control Pictures"](e)&&e!==9251||V["Optical Character Recognition"](e)||V["Enclosed Alphanumerics"](e)||V["Geometric Shapes"](e)||V["Miscellaneous Symbols"](e)&&!(e>=9754&&e<=9759)||V["Miscellaneous Symbols and Arrows"](e)&&(e>=11026&&e<=11055||e>=11088&&e<=11097||e>=11192&&e<=11243)||V["CJK Symbols and Punctuation"](e)||V.Katakana(e)||V["Private Use Area"](e)||V["CJK Compatibility Forms"](e)||V["Small Form Variants"](e)||V["Halfwidth and Fullwidth Forms"](e)||e===8734||e===8756||e===8757||e>=9984&&e<=10087||e>=10102&&e<=10131||e===65532||e===65533)}function Ka(e){return!(Ui(e)||Rm(e))}function _u(e){return V.Arabic(e)||V["Arabic Supplement"](e)||V["Arabic Extended-A"](e)||V["Arabic Presentation Forms-A"](e)||V["Arabic Presentation Forms-B"](e)}function Iu(e){return e>=1424&&e<=2303||V["Arabic Presentation Forms-A"](e)||V["Arabic Presentation Forms-B"](e)}function Om(e,t){return!(!t&&Iu(e)||e>=2304&&e<=3583||e>=3840&&e<=4255||V.Khmer(e))}function Cu(e){for(let t of e)if(Iu(t.charCodeAt(0)))return!0;return!1}function ku(e,t){for(let r of e)if(!Om(r.charCodeAt(0),t))return!1;return!0}var Nm=typeof performance<"u"&&performance&&performance.now?performance.now.bind(performance):Date.now.bind(Date),$i,Ya,Um={now:Nm,frame(e){let t=requestAnimationFrame(e);return{cancel:()=>cancelAnimationFrame(t)}},getImageData(e,t=0){return this.getImageCanvasContext(e).getImageData(-t,-t,e.width+2*t,e.height+2*t)},getImageCanvasContext(e){let t=window.document.createElement("canvas"),r=t.getContext("2d",{willReadFrequently:!0});if(!r)throw new Error("failed to create canvas 2d context");return t.width=e.width,t.height=e.height,r.drawImage(e,0,0,e.width,e.height),r},resolveURL(e){return $i||($i=document.createElement("a")),$i.href=e,$i.href},hardwareConcurrency:typeof navigator<"u"&&navigator.hardwareConcurrency||4,get prefersReducedMotion(){return matchMedia?(Ya==null&&(Ya=matchMedia("(prefers-reduced-motion: reduce)")),Ya.matches):!1}};var Xa={unavailable:"unavailable",deferred:"deferred",loading:"loading",loaded:"loaded",error:"error"};var Gi=Xa.unavailable,Tu=null;var Db=new dr,Eu=function(){return Gi};var ae={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded(){return Gi===Xa.loaded||ae.applyArabicShaping!=null},isLoading(){return Gi===Xa.loading},setState(e){if(!Ie())throw new Error("Cannot set the state of the rtl-text-plugin when not in the web-worker context");Gi=e.pluginStatus,Tu=e.pluginURL},isParsed(){if(!Ie())throw new Error("rtl-text-plugin is only parsed on the worker-threads");return ae.applyArabicShaping!=null&&ae.processBidirectionalText!=null&&ae.processStyledBidirectionalText!=null},getPluginURL(){if(!Ie())throw new Error("rtl-text-plugin url can only be queried from the worker threads");return Tu}};var q=class{constructor(t,r){this.zoom=t,r?(this.now=r.now,this.fadeDuration=r.fadeDuration,this.zoomHistory=r.zoomHistory,this.transition=r.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new Ni,this.transition={})}isSupportedScript(t){return ku(t,ae.isLoaded())}crossFadingFactor(){return this.fadeDuration===0?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)}getCrossfadeParameters(){let t=this.zoom,r=t-Math.floor(t),n=this.crossFadingFactor();return t>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:r+(1-r)*n}:{fromScale:.5,toScale:1,t:1-(1-n)*r}}};var gr=class{constructor(t,r){this.property=t,this.value=r,this.expression=Yl(r===void 0?t.specification.default:r,t.specification)}isDataDriven(){return this.expression.kind==="source"||this.expression.kind==="composite"}possiblyEvaluate(t,r,n){return this.property.possiblyEvaluate(this,t,r,n)}},an=class{constructor(t){this.property=t,this.value=new gr(t,void 0)}transitioned(t,r){return new ji(this.property,this.value,r,Ae({},t.transition,this.transition),t.now)}untransitioned(){return new ji(this.property,this.value,null,{},0)}},qi=class{constructor(t){this._properties=t,this._values=Object.create(t.defaultTransitionablePropertyValues)}getValue(t){return tt(this._values[t].value.value)}setValue(t,r){Object.prototype.hasOwnProperty.call(this._values,t)||(this._values[t]=new an(this._values[t].property)),this._values[t].value=new gr(this._values[t].property,r===null?void 0:tt(r))}getTransition(t){return tt(this._values[t].transition)}setTransition(t,r){Object.prototype.hasOwnProperty.call(this._values,t)||(this._values[t]=new an(this._values[t].property)),this._values[t].transition=tt(r)||void 0}serialize(){let t={};for(let r of Object.keys(this._values)){let n=this.getValue(r);n!==void 0&&(t[r]=n);let i=this.getTransition(r);i!==void 0&&(t["".concat(r,"-transition")]=i)}return t}transitioned(t,r){let n=new Zi(this._properties);for(let i of Object.keys(this._values))n._values[i]=this._values[i].transitioned(t,r._values[i]);return n}untransitioned(){let t=new Zi(this._properties);for(let r of Object.keys(this._values))t._values[r]=this._values[r].untransitioned();return t}},ji=class{constructor(t,r,n,i,o){this.property=t,this.value=r,this.begin=o+i.delay||0,this.end=this.begin+i.duration||0,t.specification.transition&&(i.delay||i.duration)&&(this.prior=n)}possiblyEvaluate(t,r,n){let i=t.now||0,o=this.value.possiblyEvaluate(t,r,n),a=this.prior;if(a){if(i>this.end)return this.prior=null,o;if(this.value.isDataDriven())return this.prior=null,o;if(i<this.begin)return a.possiblyEvaluate(t,r,n);{let s=(i-this.begin)/(this.end-this.begin);return this.property.interpolate(a.possiblyEvaluate(t,r,n),o,yl(s))}}else return o}},Zi=class{constructor(t){this._properties=t,this._values=Object.create(t.defaultTransitioningPropertyValues)}possiblyEvaluate(t,r,n){let i=new vt(this._properties);for(let o of Object.keys(this._values))i._values[o]=this._values[o].possiblyEvaluate(t,r,n);return i}hasTransition(){for(let t of Object.keys(this._values))if(this._values[t].prior)return!0;return!1}},Ji=class{constructor(t){this._properties=t,this._values=Object.create(t.defaultPropertyValues)}getValue(t){return tt(this._values[t].value)}setValue(t,r){this._values[t]=new gr(this._values[t].property,r===null?void 0:tt(r))}serialize(){let t={};for(let r of Object.keys(this._values)){let n=this.getValue(r);n!==void 0&&(t[r]=n)}return t}possiblyEvaluate(t,r,n){let i=new vt(this._properties);for(let o of Object.keys(this._values))i._values[o]=this._values[o].possiblyEvaluate(t,r,n);return i}},be=class{constructor(t,r,n){this.property=t,this.value=r,this.parameters=n}isConstant(){return this.value.kind==="constant"}constantOr(t){return this.value.kind==="constant"?this.value.value:t}evaluate(t,r,n,i){return this.property.evaluate(this.value,this.parameters,t,r,n,i)}},vt=class{constructor(t){this._properties=t,this._values=Object.create(t.defaultPossiblyEvaluatedValues)}get(t){return this._values[t]}},z=class{constructor(t){this.specification=t}possiblyEvaluate(t,r){if(t.isDataDriven())throw new Error("Value should not be data driven");return t.expression.evaluate(r)}interpolate(t,r,n){let i=this.specification.type,o=Re[i];return o?o(t,r,n):t}},R=class{constructor(t,r){this.specification=t,this.overrides=r}possiblyEvaluate(t,r,n,i){return t.expression.kind==="constant"||t.expression.kind==="camera"?new be(this,{kind:"constant",value:t.expression.evaluate(r,null,{},n,i)},r):new be(this,t.expression,r)}interpolate(t,r,n){if(t.value.kind!=="constant"||r.value.kind!=="constant")return t;if(t.value.value===void 0||r.value.value===void 0)return new be(this,{kind:"constant",value:void 0},t.parameters);let i=this.specification.type,o=Re[i];if(o){let a=o(t.value.value,r.value.value,n);return new be(this,{kind:"constant",value:a},t.parameters)}else return t}evaluate(t,r,n,i,o,a){return t.kind==="constant"?t.value:t.evaluate(r,n,i,o,a)}},st=class extends R{possiblyEvaluate(t,r,n,i){if(t.value===void 0)return new be(this,{kind:"constant",value:void 0},r);if(t.expression.kind==="constant"){let o=t.expression.evaluate(r,null,{},n,i),s=t.property.specification.type==="resolvedImage"&&typeof o!="string"?o.name:o,l=this._calculate(s,s,s,r);return new be(this,{kind:"constant",value:l},r)}else if(t.expression.kind==="camera"){let o=this._calculate(t.expression.evaluate({zoom:r.zoom-1}),t.expression.evaluate({zoom:r.zoom}),t.expression.evaluate({zoom:r.zoom+1}),r);return new be(this,{kind:"constant",value:o},r)}else return new be(this,t.expression,r)}evaluate(t,r,n,i,o,a){if(t.kind==="source"){let s=t.evaluate(r,n,i,o,a);return this._calculate(s,s,s,r)}else return t.kind==="composite"?this._calculate(t.evaluate({zoom:Math.floor(r.zoom)-1},n,i),t.evaluate({zoom:Math.floor(r.zoom)},n,i),t.evaluate({zoom:Math.floor(r.zoom)+1},n,i),r):t.value}_calculate(t,r,n,i){return i.zoom>i.zoomHistory.lastIntegerZoom?{from:t,to:r}:{from:n,to:r}}interpolate(t){return t}},Ot=class{constructor(t){this.specification=t}possiblyEvaluate(t,r,n,i){if(t.value!==void 0)if(t.expression.kind==="constant"){let o=t.expression.evaluate(r,null,{},n,i);return this._calculate(o,o,o,r)}else return this._calculate(t.expression.evaluate(new q(Math.floor(r.zoom-1),r)),t.expression.evaluate(new q(Math.floor(r.zoom),r)),t.expression.evaluate(new q(Math.floor(r.zoom+1),r)),r)}_calculate(t,r,n,i){return i.zoom>i.zoomHistory.lastIntegerZoom?{from:t,to:r}:{from:n,to:r}}interpolate(t){return t}},Nt=class{constructor(t){this.specification=t}possiblyEvaluate(t,r,n,i){return!!t.expression.evaluate(r,null,{},n,i)}interpolate(){return!1}},ie=class{constructor(t){this.properties=t,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(let r in t){let n=t[r];n.specification.overridable&&this.overridableProperties.push(r);let i=this.defaultPropertyValues[r]=new gr(n,void 0),o=this.defaultTransitionablePropertyValues[r]=new an(n);this.defaultTransitioningPropertyValues[r]=o.untransitioned(),this.defaultPossiblyEvaluatedValues[r]=i.possiblyEvaluate({})}}};k("DataDrivenProperty",R);k("DataConstantProperty",z);k("CrossFadedDataDrivenProperty",st);k("CrossFadedProperty",Ot);k("ColorRampProperty",Nt);var Wi="-transition",le=class extends dr{constructor(r,n){super();if(this.id=r.id,this.type=r.type,this._featureFilter={filter:()=>!0,needGeometry:!1},r.type!=="custom"&&(r=r,this.metadata=r.metadata,this.minzoom=r.minzoom,this.maxzoom=r.maxzoom,r.type!=="background"&&(this.source=r.source,this.sourceLayer=r["source-layer"],this.filter=r.filter),n.layout&&(this._unevaluatedLayout=new Ji(n.layout)),n.paint)){this._transitionablePaint=new qi(n.paint);for(let i in r.paint)this.setPaintProperty(i,r.paint[i],{validate:!1});for(let i in r.layout)this.setLayoutProperty(i,r.layout[i],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new vt(n.paint)}}getCrossfadeParameters(){return this._crossfadeParameters}getLayoutProperty(r){return r==="visibility"?this.visibility:this._unevaluatedLayout.getValue(r)}setLayoutProperty(r,n,i={}){if(n!=null){let o="layers.".concat(this.id,".layout.").concat(r);if(this._validate(Pu,o,r,n,i))return}if(r==="visibility"){this.visibility=n;return}this._unevaluatedLayout.setValue(r,n)}getPaintProperty(r){return r.endsWith(Wi)?this._transitionablePaint.getTransition(r.slice(0,-Wi.length)):this._transitionablePaint.getValue(r)}setPaintProperty(r,n,i={}){if(n!=null){let o="layers.".concat(this.id,".paint.").concat(r);if(this._validate(vu,o,r,n,i))return!1}if(r.endsWith(Wi))return this._transitionablePaint.setTransition(r.slice(0,-Wi.length),n||void 0),!1;{let o=this._transitionablePaint._values[r],a=o.property.specification["property-type"]==="cross-faded-data-driven",s=o.value.isDataDriven(),l=o.value;this._transitionablePaint.setValue(r,n),this._handleSpecialPaintPropertyUpdate(r);let u=this._transitionablePaint._values[r].value;return u.isDataDriven()||s||a||this._handleOverridablePaintPropertyUpdate(r,l,u)}}_handleSpecialPaintPropertyUpdate(r){}_handleOverridablePaintPropertyUpdate(r,n,i){return!1}isHidden(r){return this.minzoom&&r<this.minzoom||this.maxzoom&&r>=this.maxzoom?!0:this.visibility==="none"}updateTransitions(r){this._transitioningPaint=this._transitionablePaint.transitioned(r,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculate(r,n){r.getCrossfadeParameters&&(this._crossfadeParameters=r.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(r,void 0,n)),this.paint=this._transitioningPaint.possiblyEvaluate(r,void 0,n)}serialize(){let r={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout&&this._unevaluatedLayout.serialize(),paint:this._transitionablePaint&&this._transitionablePaint.serialize()};return this.visibility&&(r.layout=r.layout||{},r.layout.visibility=this.visibility),dl(r,(n,i)=>n!==void 0&&!(i==="layout"&&!Object.keys(n).length)&&!(i==="paint"&&!Object.keys(n).length))}_validate(r,n,i,o,a={}){return a&&a.validate===!1?!1:Su(this,r.call(bt,{key:n,layerType:this.type,objectKey:i,value:o,styleSpec:S,style:{glyphs:!0,sprite:!0}}))}is3D(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(let r in this.paint._values){let n=this.paint.get(r);if(!(!(n instanceof be)||!ht(n.property.specification))&&(n.value.kind==="source"||n.value.kind==="composite")&&n.value.isStateDependent)return!0}return!1}};var $m={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array},Ut=class{constructor(t,r){this._structArray=t,this._pos1=r*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}},Gm=128,qm=5,te=class{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(t,r){return t._trim(),r&&(t.isTransferred=!0,r.push(t.arrayBuffer)),{length:t.length,arrayBuffer:t.arrayBuffer}}static deserialize(t){let r=Object.create(this.prototype);return r.arrayBuffer=t.arrayBuffer,r.length=t.length,r.capacity=t.arrayBuffer.byteLength/r.bytesPerElement,r._refreshViews(),r}_trim(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())}clear(){this.length=0}resize(t){this.reserve(t),this.length=t}reserve(t){if(t>this.capacity){this.capacity=Math.max(t,Math.floor(this.capacity*qm),Gm),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);let r=this.uint8;this._refreshViews(),r&&this.uint8.set(r)}}_refreshViews(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")}};function ee(e,t=1){let r=0,n=0,i=e.map(a=>{let s=jm(a.type),l=r=Fu(r,Math.max(t,s)),u=a.components||1;return n=Math.max(n,s),r+=s*u,{name:a.name,type:a.type,components:u,offset:l}}),o=Fu(r,Math.max(n,t));return{members:i,size:o,alignment:t}}function jm(e){return $m[e].BYTES_PER_ELEMENT}function Fu(e,t){return Math.ceil(e/t)*t}var Mu=Z(he(),1),$t=class extends te{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(r,n){let i=this.length;return this.resize(i+1),this.emplace(i,r,n)}emplace(r,n,i){let o=r*2;return this.int16[o+0]=n,this.int16[o+1]=i,r}};$t.prototype.bytesPerElement=4;k("StructArrayLayout2i4",$t);var sn=class extends te{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(r,n,i){let o=this.length;return this.resize(o+1),this.emplace(o,r,n,i)}emplace(r,n,i,o){let a=r*3;return this.int16[a+0]=n,this.int16[a+1]=i,this.int16[a+2]=o,r}};sn.prototype.bytesPerElement=6;k("StructArrayLayout3i6",sn);var Hi=class extends te{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(r,n,i,o){let a=this.length;return this.resize(a+1),this.emplace(a,r,n,i,o)}emplace(r,n,i,o,a){let s=r*4;return this.int16[s+0]=n,this.int16[s+1]=i,this.int16[s+2]=o,this.int16[s+3]=a,r}};Hi.prototype.bytesPerElement=8;k("StructArrayLayout4i8",Hi);var ln=class extends te{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(r,n,i,o,a,s){let l=this.length;return this.resize(l+1),this.emplace(l,r,n,i,o,a,s)}emplace(r,n,i,o,a,s,l){let u=r*6;return this.int16[u+0]=n,this.int16[u+1]=i,this.int16[u+2]=o,this.int16[u+3]=a,this.int16[u+4]=s,this.int16[u+5]=l,r}};ln.prototype.bytesPerElement=12;k("StructArrayLayout2i4i12",ln);var un=class extends te{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(r,n,i,o,a,s){let l=this.length;return this.resize(l+1),this.emplace(l,r,n,i,o,a,s)}emplace(r,n,i,o,a,s,l){let u=r*4,c=r*8;return this.int16[u+0]=n,this.int16[u+1]=i,this.uint8[c+4]=o,this.uint8[c+5]=a,this.uint8[c+6]=s,this.uint8[c+7]=l,r}};un.prototype.bytesPerElement=8;k("StructArrayLayout2i4ub8",un);var Pt=class extends te{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(r,n){let i=this.length;return this.resize(i+1),this.emplace(i,r,n)}emplace(r,n,i){let o=r*2;return this.float32[o+0]=n,this.float32[o+1]=i,r}};Pt.prototype.bytesPerElement=8;k("StructArrayLayout2f8",Pt);var cn=class extends te{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(r,n,i,o,a,s,l,u,c,p){let f=this.length;return this.resize(f+1),this.emplace(f,r,n,i,o,a,s,l,u,c,p)}emplace(r,n,i,o,a,s,l,u,c,p,f){let y=r*10;return this.uint16[y+0]=n,this.uint16[y+1]=i,this.uint16[y+2]=o,this.uint16[y+3]=a,this.uint16[y+4]=s,this.uint16[y+5]=l,this.uint16[y+6]=u,this.uint16[y+7]=c,this.uint16[y+8]=p,this.uint16[y+9]=f,r}};cn.prototype.bytesPerElement=20;k("StructArrayLayout10ui20",cn);var pn=class extends te{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(r,n,i,o,a,s,l,u,c,p,f,y){let m=this.length;return this.resize(m+1),this.emplace(m,r,n,i,o,a,s,l,u,c,p,f,y)}emplace(r,n,i,o,a,s,l,u,c,p,f,y,m){let h=r*12;return this.int16[h+0]=n,this.int16[h+1]=i,this.int16[h+2]=o,this.int16[h+3]=a,this.uint16[h+4]=s,this.uint16[h+5]=l,this.uint16[h+6]=u,this.uint16[h+7]=c,this.int16[h+8]=p,this.int16[h+9]=f,this.int16[h+10]=y,this.int16[h+11]=m,r}};pn.prototype.bytesPerElement=24;k("StructArrayLayout4i4ui4i24",pn);var fn=class extends te{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(r,n,i){let o=this.length;return this.resize(o+1),this.emplace(o,r,n,i)}emplace(r,n,i,o){let a=r*3;return this.float32[a+0]=n,this.float32[a+1]=i,this.float32[a+2]=o,r}};fn.prototype.bytesPerElement=12;k("StructArrayLayout3f12",fn);var yn=class extends te{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(r){let n=this.length;return this.resize(n+1),this.emplace(n,r)}emplace(r,n){let i=r*1;return this.uint32[i+0]=n,r}};yn.prototype.bytesPerElement=4;k("StructArrayLayout1ul4",yn);var mn=class extends te{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(r,n,i,o,a,s,l,u,c){let p=this.length;return this.resize(p+1),this.emplace(p,r,n,i,o,a,s,l,u,c)}emplace(r,n,i,o,a,s,l,u,c,p){let f=r*10,y=r*5;return this.int16[f+0]=n,this.int16[f+1]=i,this.int16[f+2]=o,this.int16[f+3]=a,this.int16[f+4]=s,this.int16[f+5]=l,this.uint32[y+3]=u,this.uint16[f+8]=c,this.uint16[f+9]=p,r}};mn.prototype.bytesPerElement=20;k("StructArrayLayout6i1ul2ui20",mn);var hn=class extends te{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(r,n,i,o,a,s){let l=this.length;return this.resize(l+1),this.emplace(l,r,n,i,o,a,s)}emplace(r,n,i,o,a,s,l){let u=r*6;return this.int16[u+0]=n,this.int16[u+1]=i,this.int16[u+2]=o,this.int16[u+3]=a,this.int16[u+4]=s,this.int16[u+5]=l,r}};hn.prototype.bytesPerElement=12;k("StructArrayLayout2i2i2i12",hn);var Ki=class extends te{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(r,n,i,o,a){let s=this.length;return this.resize(s+1),this.emplace(s,r,n,i,o,a)}emplace(r,n,i,o,a,s){let l=r*4,u=r*8;return this.float32[l+0]=n,this.float32[l+1]=i,this.float32[l+2]=o,this.int16[u+6]=a,this.int16[u+7]=s,r}};Ki.prototype.bytesPerElement=16;k("StructArrayLayout2f1f2i16",Ki);var dn=class extends te{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(r,n,i,o){let a=this.length;return this.resize(a+1),this.emplace(a,r,n,i,o)}emplace(r,n,i,o,a){let s=r*12,l=r*3;return this.uint8[s+0]=n,this.uint8[s+1]=i,this.float32[l+1]=o,this.float32[l+2]=a,r}};dn.prototype.bytesPerElement=12;k("StructArrayLayout2ub2f12",dn);var gn=class extends te{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(r,n,i){let o=this.length;return this.resize(o+1),this.emplace(o,r,n,i)}emplace(r,n,i,o){let a=r*3;return this.uint16[a+0]=n,this.uint16[a+1]=i,this.uint16[a+2]=o,r}};gn.prototype.bytesPerElement=6;k("StructArrayLayout3ui6",gn);var xn=class extends te{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(r,n,i,o,a,s,l,u,c,p,f,y,m,h,d,g,v){let b=this.length;return this.resize(b+1),this.emplace(b,r,n,i,o,a,s,l,u,c,p,f,y,m,h,d,g,v)}emplace(r,n,i,o,a,s,l,u,c,p,f,y,m,h,d,g,v,b){let x=r*24,P=r*12,w=r*48;return this.int16[x+0]=n,this.int16[x+1]=i,this.uint16[x+2]=o,this.uint16[x+3]=a,this.uint32[P+2]=s,this.uint32[P+3]=l,this.uint32[P+4]=u,this.uint16[x+10]=c,this.uint16[x+11]=p,this.uint16[x+12]=f,this.float32[P+7]=y,this.float32[P+8]=m,this.uint8[w+36]=h,this.uint8[w+37]=d,this.uint8[w+38]=g,this.uint32[P+10]=v,this.int16[x+22]=b,r}};xn.prototype.bytesPerElement=48;k("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",xn);var bn=class extends te{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(r,n,i,o,a,s,l,u,c,p,f,y,m,h,d,g,v,b,x,P,w,A,T,I,E,_,F,M){let B=this.length;return this.resize(B+1),this.emplace(B,r,n,i,o,a,s,l,u,c,p,f,y,m,h,d,g,v,b,x,P,w,A,T,I,E,_,F,M)}emplace(r,n,i,o,a,s,l,u,c,p,f,y,m,h,d,g,v,b,x,P,w,A,T,I,E,_,F,M,B){let C=r*34,O=r*17;return this.int16[C+0]=n,this.int16[C+1]=i,this.int16[C+2]=o,this.int16[C+3]=a,this.int16[C+4]=s,this.int16[C+5]=l,this.int16[C+6]=u,this.int16[C+7]=c,this.uint16[C+8]=p,this.uint16[C+9]=f,this.uint16[C+10]=y,this.uint16[C+11]=m,this.uint16[C+12]=h,this.uint16[C+13]=d,this.uint16[C+14]=g,this.uint16[C+15]=v,this.uint16[C+16]=b,this.uint16[C+17]=x,this.uint16[C+18]=P,this.uint16[C+19]=w,this.uint16[C+20]=A,this.uint16[C+21]=T,this.uint16[C+22]=I,this.uint32[O+12]=E,this.float32[O+13]=_,this.float32[O+14]=F,this.float32[O+15]=M,this.float32[O+16]=B,r}};bn.prototype.bytesPerElement=68;k("StructArrayLayout8i15ui1ul4f68",bn);var Gt=class extends te{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(r){let n=this.length;return this.resize(n+1),this.emplace(n,r)}emplace(r,n){let i=r*1;return this.float32[i+0]=n,r}};Gt.prototype.bytesPerElement=4;k("StructArrayLayout1f4",Gt);var vn=class extends te{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(r,n,i){let o=this.length;return this.resize(o+1),this.emplace(o,r,n,i)}emplace(r,n,i,o){let a=r*2,s=r*4;return this.uint32[a+0]=n,this.uint16[s+2]=i,this.uint16[s+3]=o,r}};vn.prototype.bytesPerElement=8;k("StructArrayLayout1ul2ui8",vn);var Pn=class extends te{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(r,n){let i=this.length;return this.resize(i+1),this.emplace(i,r,n)}emplace(r,n,i){let o=r*2;return this.uint16[o+0]=n,this.uint16[o+1]=i,r}};Pn.prototype.bytesPerElement=4;k("StructArrayLayout2ui4",Pn);var Yi=class extends te{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(r){let n=this.length;return this.resize(n+1),this.emplace(n,r)}emplace(r,n){let i=r*1;return this.uint16[i+0]=n,r}};Yi.prototype.bytesPerElement=2;k("StructArrayLayout1ui2",Yi);var xr=class extends te{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(r,n,i,o){let a=this.length;return this.resize(a+1),this.emplace(a,r,n,i,o)}emplace(r,n,i,o,a){let s=r*4;return this.float32[s+0]=n,this.float32[s+1]=i,this.float32[s+2]=o,this.float32[s+3]=a,r}};xr.prototype.bytesPerElement=16;k("StructArrayLayout4f16",xr);var Xi=class extends Ut{get anchorPointX(){return this._structArray.int16[this._pos2+0]}get anchorPointY(){return this._structArray.int16[this._pos2+1]}get x1(){return this._structArray.int16[this._pos2+2]}get y1(){return this._structArray.int16[this._pos2+3]}get x2(){return this._structArray.int16[this._pos2+4]}get y2(){return this._structArray.int16[this._pos2+5]}get featureIndex(){return this._structArray.uint32[this._pos4+3]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+8]}get bucketIndex(){return this._structArray.uint16[this._pos2+9]}get anchorPoint(){return new Mu.default(this.anchorPointX,this.anchorPointY)}};Xi.prototype.size=20;var Sn=class extends mn{get(t){return new Xi(this,t)}};k("CollisionBoxArray",Sn);var Qi=class extends Ut{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get glyphStartIndex(){return this._structArray.uint16[this._pos2+2]}get numGlyphs(){return this._structArray.uint16[this._pos2+3]}get vertexStartIndex(){return this._structArray.uint32[this._pos4+2]}get lineStartIndex(){return this._structArray.uint32[this._pos4+3]}get lineLength(){return this._structArray.uint32[this._pos4+4]}get segment(){return this._structArray.uint16[this._pos2+10]}get lowerSize(){return this._structArray.uint16[this._pos2+11]}get upperSize(){return this._structArray.uint16[this._pos2+12]}get lineOffsetX(){return this._structArray.float32[this._pos4+7]}get lineOffsetY(){return this._structArray.float32[this._pos4+8]}get writingMode(){return this._structArray.uint8[this._pos1+36]}get placedOrientation(){return this._structArray.uint8[this._pos1+37]}set placedOrientation(r){this._structArray.uint8[this._pos1+37]=r}get hidden(){return this._structArray.uint8[this._pos1+38]}set hidden(r){this._structArray.uint8[this._pos1+38]=r}get crossTileID(){return this._structArray.uint32[this._pos4+10]}set crossTileID(r){this._structArray.uint32[this._pos4+10]=r}get associatedIconIndex(){return this._structArray.int16[this._pos2+22]}};Qi.prototype.size=48;var wn=class extends xn{get(t){return new Qi(this,t)}};k("PlacedSymbolArray",wn);var eo=class extends Ut{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get rightJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+2]}get centerJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+3]}get leftJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+4]}get verticalPlacedTextSymbolIndex(){return this._structArray.int16[this._pos2+5]}get placedIconSymbolIndex(){return this._structArray.int16[this._pos2+6]}get verticalPlacedIconSymbolIndex(){return this._structArray.int16[this._pos2+7]}get key(){return this._structArray.uint16[this._pos2+8]}get textBoxStartIndex(){return this._structArray.uint16[this._pos2+9]}get textBoxEndIndex(){return this._structArray.uint16[this._pos2+10]}get verticalTextBoxStartIndex(){return this._structArray.uint16[this._pos2+11]}get verticalTextBoxEndIndex(){return this._structArray.uint16[this._pos2+12]}get iconBoxStartIndex(){return this._structArray.uint16[this._pos2+13]}get iconBoxEndIndex(){return this._structArray.uint16[this._pos2+14]}get verticalIconBoxStartIndex(){return this._structArray.uint16[this._pos2+15]}get verticalIconBoxEndIndex(){return this._structArray.uint16[this._pos2+16]}get featureIndex(){return this._structArray.uint16[this._pos2+17]}get numHorizontalGlyphVertices(){return this._structArray.uint16[this._pos2+18]}get numVerticalGlyphVertices(){return this._structArray.uint16[this._pos2+19]}get numIconVertices(){return this._structArray.uint16[this._pos2+20]}get numVerticalIconVertices(){return this._structArray.uint16[this._pos2+21]}get useRuntimeCollisionCircles(){return this._structArray.uint16[this._pos2+22]}get crossTileID(){return this._structArray.uint32[this._pos4+12]}set crossTileID(r){this._structArray.uint32[this._pos4+12]=r}get textBoxScale(){return this._structArray.float32[this._pos4+13]}get textOffset0(){return this._structArray.float32[this._pos4+14]}get textOffset1(){return this._structArray.float32[this._pos4+15]}get collisionCircleDiameter(){return this._structArray.float32[this._pos4+16]}};eo.prototype.size=68;var An=class extends bn{get(t){return new eo(this,t)}};k("SymbolInstanceArray",An);var _n=class extends Gt{getoffsetX(t){return this.float32[t*1+0]}};k("GlyphOffsetArray",_n);var In=class extends sn{getx(t){return this.int16[t*3+0]}gety(t){return this.int16[t*3+1]}gettileUnitDistanceFromAnchor(t){return this.int16[t*3+2]}};k("SymbolLineVertexArray",In);var to=class extends Ut{get featureIndex(){return this._structArray.uint32[this._pos4+0]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+2]}get bucketIndex(){return this._structArray.uint16[this._pos2+3]}};to.prototype.size=8;var Cn=class extends vn{get(t){return new to(this,t)}};k("FeatureIndexArray",Cn);var ro=class extends $t{};var no=class extends $t{},io=class extends $t{},oo=class extends ln{};var ao=class extends un{},so=class extends Pt{},lt=class extends cn{},lo=class extends pn{},uo=class extends fn{},co=class extends yn{},kn=class extends hn{};var po=class extends dn{};var Le=class extends gn{},St=class extends Pn{};var Zm=ee([{name:"a_pos",components:2,type:"Int16"}],4);var{members:Lu,size:y0,alignment:m0}=Zm;var me=class e{constructor(t=[]){this.segments=t}prepareSegment(t,r,n,i){let o=this.segments[this.segments.length-1];return t>e.MAX_VERTEX_ARRAY_LENGTH&&ce("Max vertices per segment is ".concat(e.MAX_VERTEX_ARRAY_LENGTH,": bucket requested ").concat(t)),(!o||o.vertexLength+t>e.MAX_VERTEX_ARRAY_LENGTH||o.sortKey!==i)&&(o={vertexOffset:r.length,primitiveOffset:n.length,vertexLength:0,primitiveLength:0},i!==void 0&&(o.sortKey=i),this.segments.push(o)),o}get(){return this.segments}destroy(){for(let t of this.segments)for(let r in t.vaos)t.vaos[r].destroy()}static simpleSegment(t,r,n,i){return new e([{vertexOffset:t,primitiveOffset:r,vertexLength:n,primitiveLength:i,vaos:{},sortKey:0}])}};me.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1;k("SegmentVector",me);function Qa(e,t){return e=rt(Math.floor(e),0,255),t=rt(Math.floor(t),0,255),256*e+t}var Tn=ee([{name:"a_pattern_from",components:4,type:"Uint16"},{name:"a_pattern_to",components:4,type:"Uint16"},{name:"a_pixel_ratio_from",components:1,type:"Uint16"},{name:"a_pixel_ratio_to",components:1,type:"Uint16"}]);var Ru=Z(rs(),1);var En=class e{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(t,r,n,i){this.ids.push(zu(t)),this.positions.push(r,n,i)}getPositions(t){if(!this.indexed)throw new Error("Trying to get index, but feature positions are not indexed");let r=zu(t),n=0,i=this.ids.length-1;for(;n<i;){let a=n+i>>1;this.ids[a]>=r?i=a:n=a+1}let o=[];for(;this.ids[n]===r;){let a=this.positions[3*n],s=this.positions[3*n+1],l=this.positions[3*n+2];o.push({index:a,start:s,end:l}),n++}return o}static serialize(t,r){let n=new Float64Array(t.ids),i=new Uint32Array(t.positions);return ns(n,i,0,n.length-1),r&&r.push(n.buffer,i.buffer),{ids:n,positions:i}}static deserialize(t){let r=new e;return r.ids=t.ids,r.positions=t.positions,r.indexed=!0,r}};function zu(e){let t=+e;return!isNaN(t)&&t<=Number.MAX_SAFE_INTEGER?t:(0,Ru.default)(String(e))}function ns(e,t,r,n){for(;r<n;){let i=e[r+n>>1],o=r-1,a=n+1;for(;;){do o++;while(e[o]<i);do a--;while(e[a]>i);if(o>=a)break;yo(e,o,a),yo(t,3*o,3*a),yo(t,3*o+1,3*a+1),yo(t,3*o+2,3*a+2)}a-r<n-a?(ns(e,t,r,a),r=a+1):(ns(e,t,a+1,n),n=a)}}function yo(e,t,r){let n=e[t];e[t]=e[r],e[r]=n}k("FeaturePositionMap",En);var Fn=class{constructor(t,r){this.gl=t.gl,this.location=r}};var br=class extends Fn{constructor(t,r){super(t,r),this.current=0}set(t){this.current!==t&&(this.current=t,this.gl.uniform1f(this.location,t))}};var mo=class extends Fn{constructor(t,r){super(t,r),this.current=[0,0,0,0]}set(t){(t[0]!==this.current[0]||t[1]!==this.current[1]||t[2]!==this.current[2]||t[3]!==this.current[3])&&(this.current=t,this.gl.uniform4f(this.location,t[0],t[1],t[2],t[3]))}},ho=class extends Fn{constructor(t,r){super(t,r),this.current=W.transparent}set(t){(t.r!==this.current.r||t.g!==this.current.g||t.b!==this.current.b||t.a!==this.current.a)&&(this.current=t,this.gl.uniform4f(this.location,t.r,t.g,t.b,t.a))}},T0=new Float32Array(16);function is(e){return[Qa(255*e.r,255*e.g),Qa(255*e.b,255*e.a)]}var qt=class{constructor(t,r,n){this.value=t,this.uniformNames=r.map(i=>"u_".concat(i)),this.type=n}setUniform(t,r,n){t.set(n.constantOr(this.value))}getBinding(t,r,n){return this.type==="color"?new ho(t,r):new br(t,r)}},wt=class{constructor(t,r){this.uniformNames=r.map(n=>"u_".concat(n)),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1}setConstantPatternPositions(t,r){this.pixelRatioFrom=r.pixelRatio,this.pixelRatioTo=t.pixelRatio,this.patternFrom=r.tlbr,this.patternTo=t.tlbr}setUniform(t,r,n,i){let o=i==="u_pattern_to"?this.patternTo:i==="u_pattern_from"?this.patternFrom:i==="u_pixel_ratio_to"?this.pixelRatioTo:i==="u_pixel_ratio_from"?this.pixelRatioFrom:null;o&&t.set(o)}getBinding(t,r,n){return n.substr(0,9)==="u_pattern"?new mo(t,r):new br(t,r)}},Je=class{constructor(t,r,n,i){this.expression=t,this.type=n,this.maxValue=0,this.paintVertexAttributes=r.map(o=>({name:"a_".concat(o),type:"Float32",components:n==="color"?2:1,offset:0})),this.paintVertexArray=new i}populatePaintArray(t,r,n,i,o){let a=this.paintVertexArray.length,s=this.expression.evaluate(new q(0),r,{},i,[],o);this.paintVertexArray.resize(t),this._setPaintValue(a,t,s)}updatePaintArray(t,r,n,i){let o=this.expression.evaluate({zoom:0},n,i);this._setPaintValue(t,r,o)}_setPaintValue(t,r,n){if(this.type==="color"){let i=is(n);for(let o=t;o<r;o++)this.paintVertexArray.emplace(o,i[0],i[1])}else{for(let i=t;i<r;i++)this.paintVertexArray.emplace(i,n);this.maxValue=Math.max(this.maxValue,Math.abs(n))}}upload(t){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=t.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}},De=class{constructor(t,r,n,i,o,a){this.expression=t,this.uniformNames=r.map(s=>"u_".concat(s,"_t")),this.type=n,this.useIntegerZoom=i,this.zoom=o,this.maxValue=0,this.paintVertexAttributes=r.map(s=>({name:"a_".concat(s),type:"Float32",components:n==="color"?4:2,offset:0})),this.paintVertexArray=new a}populatePaintArray(t,r,n,i,o){let a=this.expression.evaluate(new q(this.zoom),r,{},i,[],o),s=this.expression.evaluate(new q(this.zoom+1),r,{},i,[],o),l=this.paintVertexArray.length;this.paintVertexArray.resize(t),this._setPaintValue(l,t,a,s)}updatePaintArray(t,r,n,i){let o=this.expression.evaluate({zoom:this.zoom},n,i),a=this.expression.evaluate({zoom:this.zoom+1},n,i);this._setPaintValue(t,r,o,a)}_setPaintValue(t,r,n,i){if(this.type==="color"){let o=is(n),a=is(i);for(let s=t;s<r;s++)this.paintVertexArray.emplace(s,o[0],o[1],a[0],a[1])}else{for(let o=t;o<r;o++)this.paintVertexArray.emplace(o,n,i);this.maxValue=Math.max(this.maxValue,Math.abs(n),Math.abs(i))}}upload(t){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=t.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}setUniform(t,r){let n=this.useIntegerZoom?Math.floor(r.zoom):r.zoom,i=rt(this.expression.interpolationFactor(n,this.zoom,this.zoom+1),0,1);t.set(i)}getBinding(t,r,n){return new br(t,r)}},Xe=class{constructor(t,r,n,i,o,a){this.expression=t,this.type=r,this.useIntegerZoom=n,this.zoom=i,this.layerId=a,this.zoomInPaintVertexArray=new o,this.zoomOutPaintVertexArray=new o}populatePaintArray(t,r,n){let i=this.zoomInPaintVertexArray.length;this.zoomInPaintVertexArray.resize(t),this.zoomOutPaintVertexArray.resize(t),this._setPaintValues(i,t,r.patterns&&r.patterns[this.layerId],n)}updatePaintArray(t,r,n,i,o){this._setPaintValues(t,r,n.patterns&&n.patterns[this.layerId],o)}_setPaintValues(t,r,n,i){if(!i||!n)return;let{min:o,mid:a,max:s}=n,l=i[o],u=i[a],c=i[s];if(!(!l||!u||!c))for(let p=t;p<r;p++)this.zoomInPaintVertexArray.emplace(p,u.tl[0],u.tl[1],u.br[0],u.br[1],l.tl[0],l.tl[1],l.br[0],l.br[1],u.pixelRatio,l.pixelRatio),this.zoomOutPaintVertexArray.emplace(p,u.tl[0],u.tl[1],u.br[0],u.br[1],c.tl[0],c.tl[1],c.br[0],c.br[1],u.pixelRatio,c.pixelRatio)}upload(t){this.zoomInPaintVertexArray&&this.zoomInPaintVertexArray.arrayBuffer&&this.zoomOutPaintVertexArray&&this.zoomOutPaintVertexArray.arrayBuffer&&(this.zoomInPaintVertexBuffer=t.createVertexBuffer(this.zoomInPaintVertexArray,Tn.members,this.expression.isStateDependent),this.zoomOutPaintVertexBuffer=t.createVertexBuffer(this.zoomOutPaintVertexArray,Tn.members,this.expression.isStateDependent))}destroy(){this.zoomOutPaintVertexBuffer&&this.zoomOutPaintVertexBuffer.destroy(),this.zoomInPaintVertexBuffer&&this.zoomInPaintVertexBuffer.destroy()}},go=class{constructor(t,r,n){this.binders={},this._buffers=[];let i=[];for(let o in t.paint._values){if(!n(o))continue;let a=t.paint.get(o);if(!(a instanceof be)||!ht(a.property.specification))continue;let s=Km(o,t.type),l=a.value,u=a.property.specification.type,c=a.property.useIntegerZoom,p=a.property.specification["property-type"],f=p==="cross-faded"||p==="cross-faded-data-driven";if(l.kind==="constant")this.binders[o]=f?new wt(l.value,s):new qt(l.value,s,u),i.push("/u_".concat(o));else if(l.kind==="source"||f){let y=Ou(o,u,"source");this.binders[o]=f?new Xe(l,u,c,r,y,t.id):new Je(l,s,u,y),i.push("/a_".concat(o))}else{let y=Ou(o,u,"composite");this.binders[o]=new De(l,s,u,c,r,y),i.push("/z_".concat(o))}}this.cacheKey=i.sort().join("")}getMaxValue(t){let r=this.binders[t];return r instanceof Je||r instanceof De?r.maxValue:0}populatePaintArrays(t,r,n,i,o){for(let a in this.binders){let s=this.binders[a];(s instanceof Je||s instanceof De||s instanceof Xe)&&s.populatePaintArray(t,r,n,i,o)}}setConstantPatternPositions(t,r){for(let n in this.binders){let i=this.binders[n];i instanceof wt&&i.setConstantPatternPositions(t,r)}}updatePaintArrays(t,r,n,i,o){let a=!1;for(let s in t){let l=r.getPositions(s);for(let u of l){let c=n.feature(u.index);for(let p in this.binders){let f=this.binders[p];if((f instanceof Je||f instanceof De||f instanceof Xe)&&f.expression.isStateDependent===!0){let y=i.paint.get(p);f.expression=y.value,f.updatePaintArray(u.start,u.end,c,t[s],o),a=!0}}}}return a}defines(){let t=[];for(let r in this.binders){let n=this.binders[r];(n instanceof qt||n instanceof wt)&&t.push(...n.uniformNames.map(i=>"#define HAS_UNIFORM_".concat(i)))}return t}getBinderAttributes(){let t=[];for(let r in this.binders){let n=this.binders[r];if(n instanceof Je||n instanceof De)for(let i=0;i<n.paintVertexAttributes.length;i++)t.push(n.paintVertexAttributes[i].name);else if(n instanceof Xe)for(let i=0;i<Tn.members.length;i++)t.push(Tn.members[i].name)}return t}getBinderUniforms(){let t=[];for(let r in this.binders){let n=this.binders[r];if(n instanceof qt||n instanceof wt||n instanceof De)for(let i of n.uniformNames)t.push(i)}return t}getPaintVertexBuffers(){return this._buffers}getUniforms(t,r){let n=[];for(let i in this.binders){let o=this.binders[i];if(o instanceof qt||o instanceof wt||o instanceof De){for(let a of o.uniformNames)if(r[a]){let s=o.getBinding(t,r[a],a);n.push({name:a,property:i,binding:s})}}}return n}setUniforms(t,r,n,i){for(let{name:o,property:a,binding:s}of r)this.binders[a].setUniform(s,i,n.get(a),o)}updatePaintBuffers(t){this._buffers=[];for(let r in this.binders){let n=this.binders[r];if(t&&n instanceof Xe){let i=t.fromScale===2?n.zoomInPaintVertexBuffer:n.zoomOutPaintVertexBuffer;i&&this._buffers.push(i)}else(n instanceof Je||n instanceof De)&&n.paintVertexBuffer&&this._buffers.push(n.paintVertexBuffer)}}upload(t){for(let r in this.binders){let n=this.binders[r];(n instanceof Je||n instanceof De||n instanceof Xe)&&n.upload(t)}this.updatePaintBuffers()}destroy(){for(let t in this.binders){let r=this.binders[t];(r instanceof Je||r instanceof De||r instanceof Xe)&&r.destroy()}}},ke=class{constructor(t,r,n=()=>!0){this.programConfigurations={};for(let i of t)this.programConfigurations[i.id]=new go(i,r,n);this.needsUpload=!1,this._featureMap=new En,this._bufferOffset=0}populatePaintArrays(t,r,n,i,o,a){for(let s in this.programConfigurations)this.programConfigurations[s].populatePaintArrays(t,r,i,o,a);r.id!==void 0&&this._featureMap.add(r.id,n,this._bufferOffset,t),this._bufferOffset=t,this.needsUpload=!0}updatePaintArrays(t,r,n,i){for(let o of n)this.needsUpload=this.programConfigurations[o.id].updatePaintArrays(t,this._featureMap,r,o,i)||this.needsUpload}get(t){return this.programConfigurations[t]}upload(t){if(this.needsUpload){for(let r in this.programConfigurations)this.programConfigurations[r].upload(t);this.needsUpload=!1}}destroy(){for(let t in this.programConfigurations)this.programConfigurations[t].destroy()}};function Km(e,t){return{"text-opacity":["opacity"],"icon-opacity":["opacity"],"text-color":["fill_color"],"icon-color":["fill_color"],"text-halo-color":["halo_color"],"icon-halo-color":["halo_color"],"text-halo-blur":["halo_blur"],"icon-halo-blur":["halo_blur"],"text-halo-width":["halo_width"],"icon-halo-width":["halo_width"],"line-gap-width":["gapwidth"],"line-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-extrusion-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"]}[e]||[e.replace("".concat(t,"-"),"").replace(/-/g,"_")]}function Ym(e){return{"line-pattern":{source:lt,composite:lt},"fill-pattern":{source:lt,composite:lt},"fill-extrusion-pattern":{source:lt,composite:lt}}[e]}function Ou(e,t,r){let n={color:{source:Pt,composite:xr},number:{source:Gt,composite:Pt}},i=Ym(e);return i&&i[r]||n[t][r]}k("ConstantBinder",qt);k("CrossFadedConstantBinder",wt);k("SourceExpressionBinder",Je);k("CrossFadedCompositeBinder",Xe);k("CompositeExpressionBinder",De);k("ProgramConfiguration",go,{omit:["_buffers"]});k("ProgramConfigurationSet",ke);var Xm=15,os=Math.pow(2,Xm-1)-1,Nu=-os-1;function Te(e){let t=8192/e.extent,r=e.loadGeometry();for(let n=0;n<r.length;n++){let i=r[n];for(let o=0;o<i.length;o++){let a=i[o],s=Math.round(a.x*t),l=Math.round(a.y*t);a.x=rt(s,Nu,os),a.y=rt(l,Nu,os),(s<a.x||s>a.x+1||l<a.y||l>a.y+1)&&ce("Geometry exceeds allowed extent, reduce your vector tile buffer size")}}return r}function Oe(e,t){return{type:e.type,id:e.id,properties:e.properties,geometry:t?Te(e):[]}}function xo(e,t,r,n,i){e.emplaceBack(t*2+(n+1)/2,r*2+(i+1)/2)}var jt=class{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(r=>r.id),this.index=t.index,this.hasPattern=!1,this.layoutVertexArray=new no,this.indexArray=new Le,this.segments=new me,this.programConfigurations=new ke(t.layers,t.zoom),this.stateDependentLayerIds=this.layers.filter(r=>r.isStateDependent()).map(r=>r.id)}populate(t,r,n){let i=this.layers[0],o=[],a=null,s=!1;i.type==="circle"&&(a=i.layout.get("circle-sort-key"),s=!a.isConstant());for(let{feature:l,id:u,index:c,sourceLayerIndex:p}of t){let f=this.layers[0]._featureFilter.needGeometry,y=Oe(l,f);if(!this.layers[0]._featureFilter.filter(new q(this.zoom),y,n))continue;let m=s?a.evaluate(y,{},n):void 0,h={id:u,properties:l.properties,type:l.type,sourceLayerIndex:p,index:c,geometry:f?y.geometry:Te(l),patterns:{},sortKey:m};o.push(h)}s&&o.sort((l,u)=>l.sortKey-u.sortKey);for(let l of o){let{geometry:u,index:c,sourceLayerIndex:p}=l,f=t[c].feature;this.addFeature(l,u,c,n),r.featureIndex.insert(f,u,c,p,this.index)}}update(t,r,n){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,r,this.stateDependentLayers,n)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Lu),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(t,r,n,i){for(let o of r)for(let a of o){let s=a.x,l=a.y;if(s<0||s>=8192||l<0||l>=8192)continue;let u=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,t.sortKey),c=u.vertexLength;xo(this.layoutVertexArray,s,l,-1,-1),xo(this.layoutVertexArray,s,l,1,-1),xo(this.layoutVertexArray,s,l,1,1),xo(this.layoutVertexArray,s,l,-1,1),this.indexArray.emplaceBack(c,c+1,c+2),this.indexArray.emplaceBack(c,c+3,c+2),u.vertexLength+=4,u.primitiveLength+=2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,n,{},i)}};k("CircleBucket",jt,{omit:["layers"]});var Mn=Z(he(),1);function $u(e,t){for(let r=0;r<e.length;r++)if(vr(t,e[r]))return!0;for(let r=0;r<t.length;r++)if(vr(e,t[r]))return!0;return!!ss(e,t)}function Gu(e,t,r){return!!(vr(e,t)||as(t,e,r))}function bo(e,t){if(e.length===1)return Uu(t,e[0]);for(let r=0;r<t.length;r++){let n=t[r];for(let i=0;i<n.length;i++)if(vr(e,n[i]))return!0}for(let r=0;r<e.length;r++)if(Uu(t,e[r]))return!0;for(let r=0;r<t.length;r++)if(ss(e,t[r]))return!0;return!1}function qu(e,t,r){for(let n=0;n<t.length;n++){let i=t[n];if(e.length>=3){for(let o=0;o<i.length;o++)if(vr(e,i[o]))return!0}if(Qm(e,i,r))return!0}return!1}function Qm(e,t,r){if(e.length>1){if(ss(e,t))return!0;for(let n=0;n<t.length;n++)if(as(t[n],e,r))return!0}for(let n=0;n<e.length;n++)if(as(e[n],t,r))return!0;return!1}function ss(e,t){if(e.length===0||t.length===0)return!1;for(let r=0;r<e.length-1;r++){let n=e[r],i=e[r+1];for(let o=0;o<t.length-1;o++){let a=t[o],s=t[o+1];if(eh(n,i,a,s))return!0}}return!1}function eh(e,t,r,n){return nt(e,r,n)!==nt(t,r,n)&&nt(e,t,r)!==nt(e,t,n)}function as(e,t,r){let n=r*r;if(t.length===1)return e.distSqr(t[0])<n;for(let i=1;i<t.length;i++){let o=t[i-1],a=t[i];if(ls(e,o,a)<n)return!0}return!1}function ls(e,t,r){let n=t.distSqr(r);if(n===0)return e.distSqr(t);let i=((e.x-t.x)*(r.x-t.x)+(e.y-t.y)*(r.y-t.y))/n;return i<0?e.distSqr(t):i>1?e.distSqr(r):e.distSqr(r.sub(t)._mult(i)._add(t))}function Uu(e,t){let r=!1,n,i,o;for(let a=0;a<e.length;a++){n=e[a];for(let s=0,l=n.length-1;s<n.length;l=s++)i=n[s],o=n[l],i.y>t.y!=o.y>t.y&&t.x<(o.x-i.x)*(t.y-i.y)/(o.y-i.y)+i.x&&(r=!r)}return r}function vr(e,t){let r=!1;for(let n=0,i=e.length-1;n<e.length;i=n++){let o=e[n],a=e[i];o.y>t.y!=a.y>t.y&&t.x<(a.x-o.x)*(t.y-o.y)/(a.y-o.y)+o.x&&(r=!r)}return r}function ju(e,t,r,n,i){for(let a of e)if(t<=a.x&&r<=a.y&&n>=a.x&&i>=a.y)return!0;let o=[new Mn.default(t,r),new Mn.default(t,i),new Mn.default(n,i),new Mn.default(n,r)];if(e.length>2){for(let a of o)if(vr(e,a))return!0}for(let a=0;a<e.length-1;a++){let s=e[a],l=e[a+1];if(th(s,l,o))return!0}return!1}function th(e,t,r){let n=r[0],i=r[2];if(e.x<n.x&&t.x<n.x||e.x>i.x&&t.x>i.x||e.y<n.y&&t.y<n.y||e.y>i.y&&t.y>i.y)return!1;let o=nt(e,t,r[0]);return o!==nt(e,t,r[1])||o!==nt(e,t,r[2])||o!==nt(e,t,r[3])}var vo=Z(he(),1);function Zt(e,t,r){let n=t.paint.get(e).value;return n.kind==="constant"?n.value:r.programConfigurations.get(t.id).getMaxValue(e)}function At(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1])}function _t(e,t,r,n,i){if(!t[0]&&!t[1])return e;let o=vo.default.convert(t)._mult(i);r==="viewport"&&o._rotate(-n);let a=[];for(let s=0;s<e.length;s++){let l=e[s];a.push(l.sub(o))}return a}function Zu(e,t){let r=[];for(let n=0;n<e.length;n++){let i=e[n],o=[];for(let a=0;a<i.length;a++){let s=i[a-1],l=i[a],u=i[a+1],c=a===0?new vo.default(0,0):l.sub(s)._unit()._perp(),p=a===i.length-1?new vo.default(0,0):u.sub(l)._unit()._perp(),f=c._add(p)._unit(),y=f.x*p.x+f.y*p.y;y!==0&&f._mult(1/y),o.push(f._mult(t)._add(l))}r.push(o)}return r}var Ju,rh=()=>Ju=Ju||new ie({"circle-sort-key":new R(S.layout_circle["circle-sort-key"])}),Wu,nh=()=>Wu=Wu||new ie({"circle-radius":new R(S.paint_circle["circle-radius"]),"circle-color":new R(S.paint_circle["circle-color"]),"circle-blur":new R(S.paint_circle["circle-blur"]),"circle-opacity":new R(S.paint_circle["circle-opacity"]),"circle-translate":new z(S.paint_circle["circle-translate"]),"circle-translate-anchor":new z(S.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new z(S.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new z(S.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new R(S.paint_circle["circle-stroke-width"]),"circle-stroke-color":new R(S.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new R(S.paint_circle["circle-stroke-opacity"])}),Hu={get paint(){return nh()},get layout(){return rh()}};var X=1e-6,Ne=typeof Float32Array<"u"?Float32Array:Array,Ln=Math.random;var Pv=Math.PI/180;Math.hypot||(Math.hypot=function(){for(var e=0,t=arguments.length;t--;)e+=arguments[t]*arguments[t];return Math.sqrt(e)});var Dn={};sl(Dn,{add:()=>Uh,adjoint:()=>ph,clone:()=>oh,copy:()=>ah,create:()=>ih,determinant:()=>fh,equals:()=>jh,exactEquals:()=>qh,frob:()=>Nh,fromQuat:()=>Eh,fromQuat2:()=>_h,fromRotation:()=>Ph,fromRotationTranslation:()=>Qu,fromRotationTranslationScale:()=>kh,fromRotationTranslationScaleOrigin:()=>Th,fromScaling:()=>vh,fromTranslation:()=>bh,fromValues:()=>sh,fromXRotation:()=>Sh,fromYRotation:()=>wh,fromZRotation:()=>Ah,frustum:()=>Fh,getRotation:()=>Ch,getScaling:()=>ec,getTranslation:()=>Ih,identity:()=>Yu,invert:()=>ch,lookAt:()=>zh,mul:()=>Zh,multiply:()=>Xu,multiplyScalar:()=>$h,multiplyScalarAndAdd:()=>Gh,ortho:()=>Vh,orthoNO:()=>rc,orthoZO:()=>Bh,perspective:()=>Mh,perspectiveFromFieldOfView:()=>Dh,perspectiveNO:()=>tc,perspectiveZO:()=>Lh,rotate:()=>hh,rotateX:()=>dh,rotateY:()=>gh,rotateZ:()=>xh,scale:()=>mh,set:()=>lh,str:()=>Oh,sub:()=>Jh,subtract:()=>nc,targetTo:()=>Rh,translate:()=>yh,transpose:()=>uh});function ih(){var e=new Ne(16);return Ne!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0),e[0]=1,e[5]=1,e[10]=1,e[15]=1,e}function oh(e){var t=new Ne(16);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function ah(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function sh(e,t,r,n,i,o,a,s,l,u,c,p,f,y,m,h){var d=new Ne(16);return d[0]=e,d[1]=t,d[2]=r,d[3]=n,d[4]=i,d[5]=o,d[6]=a,d[7]=s,d[8]=l,d[9]=u,d[10]=c,d[11]=p,d[12]=f,d[13]=y,d[14]=m,d[15]=h,d}function lh(e,t,r,n,i,o,a,s,l,u,c,p,f,y,m,h,d){return e[0]=t,e[1]=r,e[2]=n,e[3]=i,e[4]=o,e[5]=a,e[6]=s,e[7]=l,e[8]=u,e[9]=c,e[10]=p,e[11]=f,e[12]=y,e[13]=m,e[14]=h,e[15]=d,e}function Yu(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function uh(e,t){if(e===t){var r=t[1],n=t[2],i=t[3],o=t[6],a=t[7],s=t[11];e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=r,e[6]=t[9],e[7]=t[13],e[8]=n,e[9]=o,e[11]=t[14],e[12]=i,e[13]=a,e[14]=s}else e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15];return e}function ch(e,t){var r=t[0],n=t[1],i=t[2],o=t[3],a=t[4],s=t[5],l=t[6],u=t[7],c=t[8],p=t[9],f=t[10],y=t[11],m=t[12],h=t[13],d=t[14],g=t[15],v=r*s-n*a,b=r*l-i*a,x=r*u-o*a,P=n*l-i*s,w=n*u-o*s,A=i*u-o*l,T=c*h-p*m,I=c*d-f*m,E=c*g-y*m,_=p*d-f*h,F=p*g-y*h,M=f*g-y*d,B=v*M-b*F+x*_+P*E-w*I+A*T;return B?(B=1/B,e[0]=(s*M-l*F+u*_)*B,e[1]=(i*F-n*M-o*_)*B,e[2]=(h*A-d*w+g*P)*B,e[3]=(f*w-p*A-y*P)*B,e[4]=(l*E-a*M-u*I)*B,e[5]=(r*M-i*E+o*I)*B,e[6]=(d*x-m*A-g*b)*B,e[7]=(c*A-f*x+y*b)*B,e[8]=(a*F-s*E+u*T)*B,e[9]=(n*E-r*F-o*T)*B,e[10]=(m*w-h*x+g*v)*B,e[11]=(p*x-c*w-y*v)*B,e[12]=(s*I-a*_-l*T)*B,e[13]=(r*_-n*I+i*T)*B,e[14]=(h*b-m*P-d*v)*B,e[15]=(c*P-p*b+f*v)*B,e):null}function ph(e,t){var r=t[0],n=t[1],i=t[2],o=t[3],a=t[4],s=t[5],l=t[6],u=t[7],c=t[8],p=t[9],f=t[10],y=t[11],m=t[12],h=t[13],d=t[14],g=t[15];return e[0]=s*(f*g-y*d)-p*(l*g-u*d)+h*(l*y-u*f),e[1]=-(n*(f*g-y*d)-p*(i*g-o*d)+h*(i*y-o*f)),e[2]=n*(l*g-u*d)-s*(i*g-o*d)+h*(i*u-o*l),e[3]=-(n*(l*y-u*f)-s*(i*y-o*f)+p*(i*u-o*l)),e[4]=-(a*(f*g-y*d)-c*(l*g-u*d)+m*(l*y-u*f)),e[5]=r*(f*g-y*d)-c*(i*g-o*d)+m*(i*y-o*f),e[6]=-(r*(l*g-u*d)-a*(i*g-o*d)+m*(i*u-o*l)),e[7]=r*(l*y-u*f)-a*(i*y-o*f)+c*(i*u-o*l),e[8]=a*(p*g-y*h)-c*(s*g-u*h)+m*(s*y-u*p),e[9]=-(r*(p*g-y*h)-c*(n*g-o*h)+m*(n*y-o*p)),e[10]=r*(s*g-u*h)-a*(n*g-o*h)+m*(n*u-o*s),e[11]=-(r*(s*y-u*p)-a*(n*y-o*p)+c*(n*u-o*s)),e[12]=-(a*(p*d-f*h)-c*(s*d-l*h)+m*(s*f-l*p)),e[13]=r*(p*d-f*h)-c*(n*d-i*h)+m*(n*f-i*p),e[14]=-(r*(s*d-l*h)-a*(n*d-i*h)+m*(n*l-i*s)),e[15]=r*(s*f-l*p)-a*(n*f-i*p)+c*(n*l-i*s),e}function fh(e){var t=e[0],r=e[1],n=e[2],i=e[3],o=e[4],a=e[5],s=e[6],l=e[7],u=e[8],c=e[9],p=e[10],f=e[11],y=e[12],m=e[13],h=e[14],d=e[15],g=t*a-r*o,v=t*s-n*o,b=t*l-i*o,x=r*s-n*a,P=r*l-i*a,w=n*l-i*s,A=u*m-c*y,T=u*h-p*y,I=u*d-f*y,E=c*h-p*m,_=c*d-f*m,F=p*d-f*h;return g*F-v*_+b*E+x*I-P*T+w*A}function Xu(e,t,r){var n=t[0],i=t[1],o=t[2],a=t[3],s=t[4],l=t[5],u=t[6],c=t[7],p=t[8],f=t[9],y=t[10],m=t[11],h=t[12],d=t[13],g=t[14],v=t[15],b=r[0],x=r[1],P=r[2],w=r[3];return e[0]=b*n+x*s+P*p+w*h,e[1]=b*i+x*l+P*f+w*d,e[2]=b*o+x*u+P*y+w*g,e[3]=b*a+x*c+P*m+w*v,b=r[4],x=r[5],P=r[6],w=r[7],e[4]=b*n+x*s+P*p+w*h,e[5]=b*i+x*l+P*f+w*d,e[6]=b*o+x*u+P*y+w*g,e[7]=b*a+x*c+P*m+w*v,b=r[8],x=r[9],P=r[10],w=r[11],e[8]=b*n+x*s+P*p+w*h,e[9]=b*i+x*l+P*f+w*d,e[10]=b*o+x*u+P*y+w*g,e[11]=b*a+x*c+P*m+w*v,b=r[12],x=r[13],P=r[14],w=r[15],e[12]=b*n+x*s+P*p+w*h,e[13]=b*i+x*l+P*f+w*d,e[14]=b*o+x*u+P*y+w*g,e[15]=b*a+x*c+P*m+w*v,e}function yh(e,t,r){var n=r[0],i=r[1],o=r[2],a,s,l,u,c,p,f,y,m,h,d,g;return t===e?(e[12]=t[0]*n+t[4]*i+t[8]*o+t[12],e[13]=t[1]*n+t[5]*i+t[9]*o+t[13],e[14]=t[2]*n+t[6]*i+t[10]*o+t[14],e[15]=t[3]*n+t[7]*i+t[11]*o+t[15]):(a=t[0],s=t[1],l=t[2],u=t[3],c=t[4],p=t[5],f=t[6],y=t[7],m=t[8],h=t[9],d=t[10],g=t[11],e[0]=a,e[1]=s,e[2]=l,e[3]=u,e[4]=c,e[5]=p,e[6]=f,e[7]=y,e[8]=m,e[9]=h,e[10]=d,e[11]=g,e[12]=a*n+c*i+m*o+t[12],e[13]=s*n+p*i+h*o+t[13],e[14]=l*n+f*i+d*o+t[14],e[15]=u*n+y*i+g*o+t[15]),e}function mh(e,t,r){var n=r[0],i=r[1],o=r[2];return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*i,e[5]=t[5]*i,e[6]=t[6]*i,e[7]=t[7]*i,e[8]=t[8]*o,e[9]=t[9]*o,e[10]=t[10]*o,e[11]=t[11]*o,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function hh(e,t,r,n){var i=n[0],o=n[1],a=n[2],s=Math.hypot(i,o,a),l,u,c,p,f,y,m,h,d,g,v,b,x,P,w,A,T,I,E,_,F,M,B,C;return s<X?null:(s=1/s,i*=s,o*=s,a*=s,l=Math.sin(r),u=Math.cos(r),c=1-u,p=t[0],f=t[1],y=t[2],m=t[3],h=t[4],d=t[5],g=t[6],v=t[7],b=t[8],x=t[9],P=t[10],w=t[11],A=i*i*c+u,T=o*i*c+a*l,I=a*i*c-o*l,E=i*o*c-a*l,_=o*o*c+u,F=a*o*c+i*l,M=i*a*c+o*l,B=o*a*c-i*l,C=a*a*c+u,e[0]=p*A+h*T+b*I,e[1]=f*A+d*T+x*I,e[2]=y*A+g*T+P*I,e[3]=m*A+v*T+w*I,e[4]=p*E+h*_+b*F,e[5]=f*E+d*_+x*F,e[6]=y*E+g*_+P*F,e[7]=m*E+v*_+w*F,e[8]=p*M+h*B+b*C,e[9]=f*M+d*B+x*C,e[10]=y*M+g*B+P*C,e[11]=m*M+v*B+w*C,t!==e&&(e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e)}function dh(e,t,r){var n=Math.sin(r),i=Math.cos(r),o=t[4],a=t[5],s=t[6],l=t[7],u=t[8],c=t[9],p=t[10],f=t[11];return t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=o*i+u*n,e[5]=a*i+c*n,e[6]=s*i+p*n,e[7]=l*i+f*n,e[8]=u*i-o*n,e[9]=c*i-a*n,e[10]=p*i-s*n,e[11]=f*i-l*n,e}function gh(e,t,r){var n=Math.sin(r),i=Math.cos(r),o=t[0],a=t[1],s=t[2],l=t[3],u=t[8],c=t[9],p=t[10],f=t[11];return t!==e&&(e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=o*i-u*n,e[1]=a*i-c*n,e[2]=s*i-p*n,e[3]=l*i-f*n,e[8]=o*n+u*i,e[9]=a*n+c*i,e[10]=s*n+p*i,e[11]=l*n+f*i,e}function xh(e,t,r){var n=Math.sin(r),i=Math.cos(r),o=t[0],a=t[1],s=t[2],l=t[3],u=t[4],c=t[5],p=t[6],f=t[7];return t!==e&&(e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=o*i+u*n,e[1]=a*i+c*n,e[2]=s*i+p*n,e[3]=l*i+f*n,e[4]=u*i-o*n,e[5]=c*i-a*n,e[6]=p*i-s*n,e[7]=f*i-l*n,e}function bh(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=t[0],e[13]=t[1],e[14]=t[2],e[15]=1,e}function vh(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t[1],e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t[2],e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function Ph(e,t,r){var n=r[0],i=r[1],o=r[2],a=Math.hypot(n,i,o),s,l,u;return a<X?null:(a=1/a,n*=a,i*=a,o*=a,s=Math.sin(t),l=Math.cos(t),u=1-l,e[0]=n*n*u+l,e[1]=i*n*u+o*s,e[2]=o*n*u-i*s,e[3]=0,e[4]=n*i*u-o*s,e[5]=i*i*u+l,e[6]=o*i*u+n*s,e[7]=0,e[8]=n*o*u+i*s,e[9]=i*o*u-n*s,e[10]=o*o*u+l,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e)}function Sh(e,t){var r=Math.sin(t),n=Math.cos(t);return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=n,e[6]=r,e[7]=0,e[8]=0,e[9]=-r,e[10]=n,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function wh(e,t){var r=Math.sin(t),n=Math.cos(t);return e[0]=n,e[1]=0,e[2]=-r,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=r,e[9]=0,e[10]=n,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function Ah(e,t){var r=Math.sin(t),n=Math.cos(t);return e[0]=n,e[1]=r,e[2]=0,e[3]=0,e[4]=-r,e[5]=n,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function Qu(e,t,r){var n=t[0],i=t[1],o=t[2],a=t[3],s=n+n,l=i+i,u=o+o,c=n*s,p=n*l,f=n*u,y=i*l,m=i*u,h=o*u,d=a*s,g=a*l,v=a*u;return e[0]=1-(y+h),e[1]=p+v,e[2]=f-g,e[3]=0,e[4]=p-v,e[5]=1-(c+h),e[6]=m+d,e[7]=0,e[8]=f+g,e[9]=m-d,e[10]=1-(c+y),e[11]=0,e[12]=r[0],e[13]=r[1],e[14]=r[2],e[15]=1,e}function _h(e,t){var r=new Ne(3),n=-t[0],i=-t[1],o=-t[2],a=t[3],s=t[4],l=t[5],u=t[6],c=t[7],p=n*n+i*i+o*o+a*a;return p>0?(r[0]=(s*a+c*n+l*o-u*i)*2/p,r[1]=(l*a+c*i+u*n-s*o)*2/p,r[2]=(u*a+c*o+s*i-l*n)*2/p):(r[0]=(s*a+c*n+l*o-u*i)*2,r[1]=(l*a+c*i+u*n-s*o)*2,r[2]=(u*a+c*o+s*i-l*n)*2),Qu(e,t,r),e}function Ih(e,t){return e[0]=t[12],e[1]=t[13],e[2]=t[14],e}function ec(e,t){var r=t[0],n=t[1],i=t[2],o=t[4],a=t[5],s=t[6],l=t[8],u=t[9],c=t[10];return e[0]=Math.hypot(r,n,i),e[1]=Math.hypot(o,a,s),e[2]=Math.hypot(l,u,c),e}function Ch(e,t){var r=new Ne(3);ec(r,t);var n=1/r[0],i=1/r[1],o=1/r[2],a=t[0]*n,s=t[1]*i,l=t[2]*o,u=t[4]*n,c=t[5]*i,p=t[6]*o,f=t[8]*n,y=t[9]*i,m=t[10]*o,h=a+c+m,d=0;return h>0?(d=Math.sqrt(h+1)*2,e[3]=.25*d,e[0]=(p-y)/d,e[1]=(f-l)/d,e[2]=(s-u)/d):a>c&&a>m?(d=Math.sqrt(1+a-c-m)*2,e[3]=(p-y)/d,e[0]=.25*d,e[1]=(s+u)/d,e[2]=(f+l)/d):c>m?(d=Math.sqrt(1+c-a-m)*2,e[3]=(f-l)/d,e[0]=(s+u)/d,e[1]=.25*d,e[2]=(p+y)/d):(d=Math.sqrt(1+m-a-c)*2,e[3]=(s-u)/d,e[0]=(f+l)/d,e[1]=(p+y)/d,e[2]=.25*d),e}function kh(e,t,r,n){var i=t[0],o=t[1],a=t[2],s=t[3],l=i+i,u=o+o,c=a+a,p=i*l,f=i*u,y=i*c,m=o*u,h=o*c,d=a*c,g=s*l,v=s*u,b=s*c,x=n[0],P=n[1],w=n[2];return e[0]=(1-(m+d))*x,e[1]=(f+b)*x,e[2]=(y-v)*x,e[3]=0,e[4]=(f-b)*P,e[5]=(1-(p+d))*P,e[6]=(h+g)*P,e[7]=0,e[8]=(y+v)*w,e[9]=(h-g)*w,e[10]=(1-(p+m))*w,e[11]=0,e[12]=r[0],e[13]=r[1],e[14]=r[2],e[15]=1,e}function Th(e,t,r,n,i){var o=t[0],a=t[1],s=t[2],l=t[3],u=o+o,c=a+a,p=s+s,f=o*u,y=o*c,m=o*p,h=a*c,d=a*p,g=s*p,v=l*u,b=l*c,x=l*p,P=n[0],w=n[1],A=n[2],T=i[0],I=i[1],E=i[2],_=(1-(h+g))*P,F=(y+x)*P,M=(m-b)*P,B=(y-x)*w,C=(1-(f+g))*w,O=(d+v)*w,N=(m+b)*A,K=(d-v)*A,Y=(1-(f+h))*A;return e[0]=_,e[1]=F,e[2]=M,e[3]=0,e[4]=B,e[5]=C,e[6]=O,e[7]=0,e[8]=N,e[9]=K,e[10]=Y,e[11]=0,e[12]=r[0]+T-(_*T+B*I+N*E),e[13]=r[1]+I-(F*T+C*I+K*E),e[14]=r[2]+E-(M*T+O*I+Y*E),e[15]=1,e}function Eh(e,t){var r=t[0],n=t[1],i=t[2],o=t[3],a=r+r,s=n+n,l=i+i,u=r*a,c=n*a,p=n*s,f=i*a,y=i*s,m=i*l,h=o*a,d=o*s,g=o*l;return e[0]=1-p-m,e[1]=c+g,e[2]=f-d,e[3]=0,e[4]=c-g,e[5]=1-u-m,e[6]=y+h,e[7]=0,e[8]=f+d,e[9]=y-h,e[10]=1-u-p,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function Fh(e,t,r,n,i,o,a){var s=1/(r-t),l=1/(i-n),u=1/(o-a);return e[0]=o*2*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=o*2*l,e[6]=0,e[7]=0,e[8]=(r+t)*s,e[9]=(i+n)*l,e[10]=(a+o)*u,e[11]=-1,e[12]=0,e[13]=0,e[14]=a*o*2*u,e[15]=0,e}function tc(e,t,r,n,i){var o=1/Math.tan(t/2),a;return e[0]=o/r,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=o,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,i!=null&&i!==1/0?(a=1/(n-i),e[10]=(i+n)*a,e[14]=2*i*n*a):(e[10]=-1,e[14]=-2*n),e}var Mh=tc;function Lh(e,t,r,n,i){var o=1/Math.tan(t/2),a;return e[0]=o/r,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=o,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,i!=null&&i!==1/0?(a=1/(n-i),e[10]=i*a,e[14]=i*n*a):(e[10]=-1,e[14]=-n),e}function Dh(e,t,r,n){var i=Math.tan(t.upDegrees*Math.PI/180),o=Math.tan(t.downDegrees*Math.PI/180),a=Math.tan(t.leftDegrees*Math.PI/180),s=Math.tan(t.rightDegrees*Math.PI/180),l=2/(a+s),u=2/(i+o);return e[0]=l,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=u,e[6]=0,e[7]=0,e[8]=-((a-s)*l*.5),e[9]=(i-o)*u*.5,e[10]=n/(r-n),e[11]=-1,e[12]=0,e[13]=0,e[14]=n*r/(r-n),e[15]=0,e}function rc(e,t,r,n,i,o,a){var s=1/(t-r),l=1/(n-i),u=1/(o-a);return e[0]=-2*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*l,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*u,e[11]=0,e[12]=(t+r)*s,e[13]=(i+n)*l,e[14]=(a+o)*u,e[15]=1,e}var Vh=rc;function Bh(e,t,r,n,i,o,a){var s=1/(t-r),l=1/(n-i),u=1/(o-a);return e[0]=-2*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*l,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=u,e[11]=0,e[12]=(t+r)*s,e[13]=(i+n)*l,e[14]=o*u,e[15]=1,e}function zh(e,t,r,n){var i,o,a,s,l,u,c,p,f,y,m=t[0],h=t[1],d=t[2],g=n[0],v=n[1],b=n[2],x=r[0],P=r[1],w=r[2];return Math.abs(m-x)<X&&Math.abs(h-P)<X&&Math.abs(d-w)<X?Yu(e):(c=m-x,p=h-P,f=d-w,y=1/Math.hypot(c,p,f),c*=y,p*=y,f*=y,i=v*f-b*p,o=b*c-g*f,a=g*p-v*c,y=Math.hypot(i,o,a),y?(y=1/y,i*=y,o*=y,a*=y):(i=0,o=0,a=0),s=p*a-f*o,l=f*i-c*a,u=c*o-p*i,y=Math.hypot(s,l,u),y?(y=1/y,s*=y,l*=y,u*=y):(s=0,l=0,u=0),e[0]=i,e[1]=s,e[2]=c,e[3]=0,e[4]=o,e[5]=l,e[6]=p,e[7]=0,e[8]=a,e[9]=u,e[10]=f,e[11]=0,e[12]=-(i*m+o*h+a*d),e[13]=-(s*m+l*h+u*d),e[14]=-(c*m+p*h+f*d),e[15]=1,e)}function Rh(e,t,r,n){var i=t[0],o=t[1],a=t[2],s=n[0],l=n[1],u=n[2],c=i-r[0],p=o-r[1],f=a-r[2],y=c*c+p*p+f*f;y>0&&(y=1/Math.sqrt(y),c*=y,p*=y,f*=y);var m=l*f-u*p,h=u*c-s*f,d=s*p-l*c;return y=m*m+h*h+d*d,y>0&&(y=1/Math.sqrt(y),m*=y,h*=y,d*=y),e[0]=m,e[1]=h,e[2]=d,e[3]=0,e[4]=p*d-f*h,e[5]=f*m-c*d,e[6]=c*h-p*m,e[7]=0,e[8]=c,e[9]=p,e[10]=f,e[11]=0,e[12]=i,e[13]=o,e[14]=a,e[15]=1,e}function Oh(e){return"mat4("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+", "+e[4]+", "+e[5]+", "+e[6]+", "+e[7]+", "+e[8]+", "+e[9]+", "+e[10]+", "+e[11]+", "+e[12]+", "+e[13]+", "+e[14]+", "+e[15]+")"}function Nh(e){return Math.hypot(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])}function Uh(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e[3]=t[3]+r[3],e[4]=t[4]+r[4],e[5]=t[5]+r[5],e[6]=t[6]+r[6],e[7]=t[7]+r[7],e[8]=t[8]+r[8],e[9]=t[9]+r[9],e[10]=t[10]+r[10],e[11]=t[11]+r[11],e[12]=t[12]+r[12],e[13]=t[13]+r[13],e[14]=t[14]+r[14],e[15]=t[15]+r[15],e}function nc(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e[3]=t[3]-r[3],e[4]=t[4]-r[4],e[5]=t[5]-r[5],e[6]=t[6]-r[6],e[7]=t[7]-r[7],e[8]=t[8]-r[8],e[9]=t[9]-r[9],e[10]=t[10]-r[10],e[11]=t[11]-r[11],e[12]=t[12]-r[12],e[13]=t[13]-r[13],e[14]=t[14]-r[14],e[15]=t[15]-r[15],e}function $h(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e[4]=t[4]*r,e[5]=t[5]*r,e[6]=t[6]*r,e[7]=t[7]*r,e[8]=t[8]*r,e[9]=t[9]*r,e[10]=t[10]*r,e[11]=t[11]*r,e[12]=t[12]*r,e[13]=t[13]*r,e[14]=t[14]*r,e[15]=t[15]*r,e}function Gh(e,t,r,n){return e[0]=t[0]+r[0]*n,e[1]=t[1]+r[1]*n,e[2]=t[2]+r[2]*n,e[3]=t[3]+r[3]*n,e[4]=t[4]+r[4]*n,e[5]=t[5]+r[5]*n,e[6]=t[6]+r[6]*n,e[7]=t[7]+r[7]*n,e[8]=t[8]+r[8]*n,e[9]=t[9]+r[9]*n,e[10]=t[10]+r[10]*n,e[11]=t[11]+r[11]*n,e[12]=t[12]+r[12]*n,e[13]=t[13]+r[13]*n,e[14]=t[14]+r[14]*n,e[15]=t[15]+r[15]*n,e}function qh(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[11]===t[11]&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[15]===t[15]}function jh(e,t){var r=e[0],n=e[1],i=e[2],o=e[3],a=e[4],s=e[5],l=e[6],u=e[7],c=e[8],p=e[9],f=e[10],y=e[11],m=e[12],h=e[13],d=e[14],g=e[15],v=t[0],b=t[1],x=t[2],P=t[3],w=t[4],A=t[5],T=t[6],I=t[7],E=t[8],_=t[9],F=t[10],M=t[11],B=t[12],C=t[13],O=t[14],N=t[15];return Math.abs(r-v)<=X*Math.max(1,Math.abs(r),Math.abs(v))&&Math.abs(n-b)<=X*Math.max(1,Math.abs(n),Math.abs(b))&&Math.abs(i-x)<=X*Math.max(1,Math.abs(i),Math.abs(x))&&Math.abs(o-P)<=X*Math.max(1,Math.abs(o),Math.abs(P))&&Math.abs(a-w)<=X*Math.max(1,Math.abs(a),Math.abs(w))&&Math.abs(s-A)<=X*Math.max(1,Math.abs(s),Math.abs(A))&&Math.abs(l-T)<=X*Math.max(1,Math.abs(l),Math.abs(T))&&Math.abs(u-I)<=X*Math.max(1,Math.abs(u),Math.abs(I))&&Math.abs(c-E)<=X*Math.max(1,Math.abs(c),Math.abs(E))&&Math.abs(p-_)<=X*Math.max(1,Math.abs(p),Math.abs(_))&&Math.abs(f-F)<=X*Math.max(1,Math.abs(f),Math.abs(F))&&Math.abs(y-M)<=X*Math.max(1,Math.abs(y),Math.abs(M))&&Math.abs(m-B)<=X*Math.max(1,Math.abs(m),Math.abs(B))&&Math.abs(h-C)<=X*Math.max(1,Math.abs(h),Math.abs(C))&&Math.abs(d-O)<=X*Math.max(1,Math.abs(d),Math.abs(O))&&Math.abs(g-N)<=X*Math.max(1,Math.abs(g),Math.abs(N))}var Zh=Xu,Jh=nc;var Jt={};sl(Jt,{add:()=>Xh,ceil:()=>Qh,clone:()=>Wh,copy:()=>Kh,create:()=>ic,cross:()=>cd,dist:()=>Sd,distance:()=>lc,div:()=>Pd,divide:()=>sc,dot:()=>ud,equals:()=>xd,exactEquals:()=>gd,floor:()=>ed,forEach:()=>Id,fromValues:()=>Hh,inverse:()=>sd,len:()=>Ad,length:()=>cc,lerp:()=>pd,max:()=>rd,min:()=>td,mul:()=>vd,multiply:()=>ac,negate:()=>ad,normalize:()=>ld,random:()=>fd,round:()=>nd,scale:()=>id,scaleAndAdd:()=>od,set:()=>Yh,sqrDist:()=>wd,sqrLen:()=>_d,squaredDistance:()=>uc,squaredLength:()=>pc,str:()=>dd,sub:()=>bd,subtract:()=>oc,transformMat4:()=>yd,transformQuat:()=>md,zero:()=>hd});function ic(){var e=new Ne(4);return Ne!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0,e[3]=0),e}function Wh(e){var t=new Ne(4);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}function Hh(e,t,r,n){var i=new Ne(4);return i[0]=e,i[1]=t,i[2]=r,i[3]=n,i}function Kh(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}function Yh(e,t,r,n,i){return e[0]=t,e[1]=r,e[2]=n,e[3]=i,e}function Xh(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e[3]=t[3]+r[3],e}function oc(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e[3]=t[3]-r[3],e}function ac(e,t,r){return e[0]=t[0]*r[0],e[1]=t[1]*r[1],e[2]=t[2]*r[2],e[3]=t[3]*r[3],e}function sc(e,t,r){return e[0]=t[0]/r[0],e[1]=t[1]/r[1],e[2]=t[2]/r[2],e[3]=t[3]/r[3],e}function Qh(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e[2]=Math.ceil(t[2]),e[3]=Math.ceil(t[3]),e}function ed(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e[2]=Math.floor(t[2]),e[3]=Math.floor(t[3]),e}function td(e,t,r){return e[0]=Math.min(t[0],r[0]),e[1]=Math.min(t[1],r[1]),e[2]=Math.min(t[2],r[2]),e[3]=Math.min(t[3],r[3]),e}function rd(e,t,r){return e[0]=Math.max(t[0],r[0]),e[1]=Math.max(t[1],r[1]),e[2]=Math.max(t[2],r[2]),e[3]=Math.max(t[3],r[3]),e}function nd(e,t){return e[0]=Math.round(t[0]),e[1]=Math.round(t[1]),e[2]=Math.round(t[2]),e[3]=Math.round(t[3]),e}function id(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e}function od(e,t,r,n){return e[0]=t[0]+r[0]*n,e[1]=t[1]+r[1]*n,e[2]=t[2]+r[2]*n,e[3]=t[3]+r[3]*n,e}function lc(e,t){var r=t[0]-e[0],n=t[1]-e[1],i=t[2]-e[2],o=t[3]-e[3];return Math.hypot(r,n,i,o)}function uc(e,t){var r=t[0]-e[0],n=t[1]-e[1],i=t[2]-e[2],o=t[3]-e[3];return r*r+n*n+i*i+o*o}function cc(e){var t=e[0],r=e[1],n=e[2],i=e[3];return Math.hypot(t,r,n,i)}function pc(e){var t=e[0],r=e[1],n=e[2],i=e[3];return t*t+r*r+n*n+i*i}function ad(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=-t[3],e}function sd(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e[3]=1/t[3],e}function ld(e,t){var r=t[0],n=t[1],i=t[2],o=t[3],a=r*r+n*n+i*i+o*o;return a>0&&(a=1/Math.sqrt(a)),e[0]=r*a,e[1]=n*a,e[2]=i*a,e[3]=o*a,e}function ud(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}function cd(e,t,r,n){var i=r[0]*n[1]-r[1]*n[0],o=r[0]*n[2]-r[2]*n[0],a=r[0]*n[3]-r[3]*n[0],s=r[1]*n[2]-r[2]*n[1],l=r[1]*n[3]-r[3]*n[1],u=r[2]*n[3]-r[3]*n[2],c=t[0],p=t[1],f=t[2],y=t[3];return e[0]=p*u-f*l+y*s,e[1]=-(c*u)+f*a-y*o,e[2]=c*l-p*a+y*i,e[3]=-(c*s)+p*o-f*i,e}function pd(e,t,r,n){var i=t[0],o=t[1],a=t[2],s=t[3];return e[0]=i+n*(r[0]-i),e[1]=o+n*(r[1]-o),e[2]=a+n*(r[2]-a),e[3]=s+n*(r[3]-s),e}function fd(e,t){t=t||1;var r,n,i,o,a,s;do r=Ln()*2-1,n=Ln()*2-1,a=r*r+n*n;while(a>=1);do i=Ln()*2-1,o=Ln()*2-1,s=i*i+o*o;while(s>=1);var l=Math.sqrt((1-a)/s);return e[0]=t*r,e[1]=t*n,e[2]=t*i*l,e[3]=t*o*l,e}function yd(e,t,r){var n=t[0],i=t[1],o=t[2],a=t[3];return e[0]=r[0]*n+r[4]*i+r[8]*o+r[12]*a,e[1]=r[1]*n+r[5]*i+r[9]*o+r[13]*a,e[2]=r[2]*n+r[6]*i+r[10]*o+r[14]*a,e[3]=r[3]*n+r[7]*i+r[11]*o+r[15]*a,e}function md(e,t,r){var n=t[0],i=t[1],o=t[2],a=r[0],s=r[1],l=r[2],u=r[3],c=u*n+s*o-l*i,p=u*i+l*n-a*o,f=u*o+a*i-s*n,y=-a*n-s*i-l*o;return e[0]=c*u+y*-a+p*-l-f*-s,e[1]=p*u+y*-s+f*-a-c*-l,e[2]=f*u+y*-l+c*-s-p*-a,e[3]=t[3],e}function hd(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=0,e}function dd(e){return"vec4("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+")"}function gd(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]}function xd(e,t){var r=e[0],n=e[1],i=e[2],o=e[3],a=t[0],s=t[1],l=t[2],u=t[3];return Math.abs(r-a)<=X*Math.max(1,Math.abs(r),Math.abs(a))&&Math.abs(n-s)<=X*Math.max(1,Math.abs(n),Math.abs(s))&&Math.abs(i-l)<=X*Math.max(1,Math.abs(i),Math.abs(l))&&Math.abs(o-u)<=X*Math.max(1,Math.abs(o),Math.abs(u))}var bd=oc,vd=ac,Pd=sc,Sd=lc,wd=uc,Ad=cc,_d=pc,Id=function(){var e=ic();return function(t,r,n,i,o,a){var s,l;for(r||(r=4),n||(n=0),i?l=Math.min(i*r+n,t.length):l=t.length,s=n;s<l;s+=r)e[0]=t[s],e[1]=t[s+1],e[2]=t[s+2],e[3]=t[s+3],o(e,e,a),t[s]=e[0],t[s+1]=e[1],t[s+2]=e[2],t[s+3]=e[3];return t}}();var fc=Z(he(),1),Po=class extends le{constructor(r){super(r,Hu)}createBucket(r){return new jt(r)}queryRadius(r){let n=r;return Zt("circle-radius",this,n)+Zt("circle-stroke-width",this,n)+At(this.paint.get("circle-translate"))}queryIntersectsFeature(r,n,i,o,a,s,l,u){let c=_t(r,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),s.angle,l),p=this.paint.get("circle-radius").evaluate(n,i),f=this.paint.get("circle-stroke-width").evaluate(n,i),y=p+f,m=this.paint.get("circle-pitch-alignment")==="map",h=m?c:Cd(c,u),d=m?y*l:y;for(let g of o)for(let v of g){let b=m?v:yc(v,u),x=d,P=Jt.transformMat4([],[v.x,v.y,0,1],u);if(this.paint.get("circle-pitch-scale")==="viewport"&&this.paint.get("circle-pitch-alignment")==="map"?x*=P[3]/s.cameraToCenterDistance:this.paint.get("circle-pitch-scale")==="map"&&this.paint.get("circle-pitch-alignment")==="viewport"&&(x*=s.cameraToCenterDistance/P[3]),Gu(h,b,x))return!0}return!1}};function yc(e,t){let r=Jt.transformMat4([],[e.x,e.y,0,1],t);return new fc.default(r[0]/r[3],r[1]/r[3])}function Cd(e,t){return e.map(r=>yc(r,t))}var Vn=class extends jt{};k("HeatmapBucket",Vn,{omit:["layers"]});var mc,kd=()=>mc=mc||new ie({"heatmap-radius":new R(S.paint_heatmap["heatmap-radius"]),"heatmap-weight":new R(S.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new z(S.paint_heatmap["heatmap-intensity"]),"heatmap-color":new Nt(S.paint_heatmap["heatmap-color"]),"heatmap-opacity":new z(S.paint_heatmap["heatmap-opacity"])}),hc={get paint(){return kd()}};function us(e,{width:t,height:r},n,i){if(!i)i=new Uint8Array(t*r*n);else if(i instanceof Uint8ClampedArray)i=new Uint8Array(i.buffer);else if(i.length!==t*r*n)throw new RangeError("mismatched image size. expected: ".concat(i.length," but got: ").concat(t*r*n));return e.width=t,e.height=r,e.data=i,e}function dc(e,{width:t,height:r},n){if(t===e.width&&r===e.height)return;let i=us({},{width:t,height:r},n);cs(e,i,{x:0,y:0},{x:0,y:0},{width:Math.min(e.width,t),height:Math.min(e.height,r)},n),e.width=t,e.height=r,e.data=i.data}function cs(e,t,r,n,i,o){if(i.width===0||i.height===0)return t;if(i.width>e.width||i.height>e.height||r.x>e.width-i.width||r.y>e.height-i.height)throw new RangeError("out of range source coordinates for image copy");if(i.width>t.width||i.height>t.height||n.x>t.width-i.width||n.y>t.height-i.height)throw new RangeError("out of range destination coordinates for image copy");let a=e.data,s=t.data;if(a===s)throw new Error("srcData equals dstData, so image is already copied");for(let l=0;l<i.height;l++){let u=((r.y+l)*e.width+r.x)*o,c=((n.y+l)*t.width+n.x)*o;for(let p=0;p<i.width*o;p++)s[c+p]=a[u+p]}return t}var Wt=class e{constructor(t,r){us(this,t,1,r)}resize(t){dc(this,t,1)}clone(){return new e({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(t,r,n,i,o){cs(t,r,n,i,o,1)}},de=class e{constructor(t,r){us(this,t,4,r)}resize(t){dc(this,t,4)}replace(t,r){r?this.data.set(t):t instanceof Uint8ClampedArray?this.data=new Uint8Array(t.buffer):this.data=t}clone(){return new e({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(t,r,n,i,o){cs(t,r,n,i,o,4)}};k("AlphaImage",Wt);k("RGBAImage",de);function gc(e){let t={},r=e.resolution||256,n=e.clips?e.clips.length:1,i=e.image||new de({width:r,height:n});if(!hl(r))throw new Error("width is not a power of 2 - ".concat(r));let o=(a,s,l)=>{t[e.evaluationKey]=l;let u=e.expression.evaluate(t);i.data[a+s+0]=Math.floor(u.r*255/u.a),i.data[a+s+1]=Math.floor(u.g*255/u.a),i.data[a+s+2]=Math.floor(u.b*255/u.a),i.data[a+s+3]=Math.floor(u.a*255)};if(e.clips)for(let a=0,s=0;a<n;++a,s+=r*4)for(let l=0,u=0;l<r;l++,u+=4){let c=l/(r-1),{start:p,end:f}=e.clips[a],y=p*(1-c)+f*c;o(s,u,y)}else for(let a=0,s=0;a<r;a++,s+=4){let l=a/(r-1);o(0,s,l)}return i}var So=class extends le{constructor(r){super(r,hc);this._updateColorRamp()}createBucket(r){return new Vn(r)}_handleSpecialPaintPropertyUpdate(r){r==="heatmap-color"&&this._updateColorRamp()}_updateColorRamp(){let r=this._transitionablePaint._values["heatmap-color"].value.expression;this.colorRamp=gc({expression:r,evaluationKey:"heatmapDensity",image:this.colorRamp}),this.colorRampTexture=null}resize(){this.heatmapFbo&&(this.heatmapFbo.destroy(),this.heatmapFbo=null)}queryRadius(){return 0}queryIntersectsFeature(){return!1}hasOffscreenPass(){return this.paint.get("heatmap-opacity")!==0&&this.visibility!=="none"}};var xc,Td=()=>xc=xc||new ie({"hillshade-illumination-direction":new z(S.paint_hillshade["hillshade-illumination-direction"]),"hillshade-illumination-anchor":new z(S.paint_hillshade["hillshade-illumination-anchor"]),"hillshade-exaggeration":new z(S.paint_hillshade["hillshade-exaggeration"]),"hillshade-shadow-color":new z(S.paint_hillshade["hillshade-shadow-color"]),"hillshade-highlight-color":new z(S.paint_hillshade["hillshade-highlight-color"]),"hillshade-accent-color":new z(S.paint_hillshade["hillshade-accent-color"])}),bc={get paint(){return Td()}};var wo=class extends le{constructor(r){super(r,bc)}hasOffscreenPass(){return this.paint.get("hillshade-exaggeration")!==0&&this.visibility!=="none"}};var Ed=ee([{name:"a_pos",components:2,type:"Int16"}],4);var{members:vc,size:m1,alignment:h1}=Ed;var Ic=Z(hs(),1);function ds(e,t,r,n,i){_c(e,t,r||0,n||e.length-1,i||Zd)}function _c(e,t,r,n,i){for(;n>r;){if(n-r>600){var o=n-r+1,a=t-r+1,s=Math.log(o),l=.5*Math.exp(2*s/3),u=.5*Math.sqrt(s*l*(o-l)/o)*(a-o/2<0?-1:1),c=Math.max(r,Math.floor(t-a*l/o+u)),p=Math.min(n,Math.floor(t+(o-a)*l/o+u));_c(e,t,c,p,i)}var f=e[t],y=r,m=n;for(On(e,r,t),i(e[n],f)>0&&On(e,r,n);y<m;){for(On(e,y,m),y++,m--;i(e[y],f)<0;)y++;for(;i(e[m],f)>0;)m--}i(e[r],f)===0?On(e,r,m):(m++,On(e,m,n)),m<=t&&(r=m+1),t<=m&&(n=m-1)}}function On(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function Zd(e,t){return e<t?-1:e>t?1:0}function Sr(e,t){let r=e.length;if(r<=1)return[e];let n=[],i,o;for(let a=0;a<r;a++){let s=xl(e[a]);s!==0&&(e[a].area=Math.abs(s),o===void 0&&(o=s<0),o===s<0?(i&&n.push(i),i=[e[a]]):i.push(e[a]))}if(i&&n.push(i),t>1)for(let a=0;a<n.length;a++)n[a].length<=t||(ds(n[a],t,1,n[a].length-1,Jd),n[a]=n[a].slice(0,t));return n}function Jd(e,t){return t.area-e.area}function wr(e,t,r){let n=r.patternDependencies,i=!1;for(let o of t){let a=o.paint.get("".concat(e,"-pattern"));a.isConstant()||(i=!0);let s=a.constantOr(null);s&&(i=!0,n[s.to]=!0,n[s.from]=!0)}return i}function Ar(e,t,r,n,i){let o=i.patternDependencies;for(let a of t){let l=a.paint.get("".concat(e,"-pattern")).value;if(l.kind!=="constant"){let u=l.evaluate({zoom:n-1},r,{},i.availableImages),c=l.evaluate({zoom:n},r,{},i.availableImages),p=l.evaluate({zoom:n+1},r,{},i.availableImages);u=u&&u.name?u.name:u,c=c&&c.name?c.name:c,p=p&&p.name?p.name:p,o[u]=!0,o[c]=!0,o[p]=!0,r.patterns[a.id]={min:u,mid:c,max:p}}}return r}var Wd=500,Kt=class{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(r=>r.id),this.index=t.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new io,this.indexArray=new Le,this.indexArray2=new St,this.programConfigurations=new ke(t.layers,t.zoom),this.segments=new me,this.segments2=new me,this.stateDependentLayerIds=this.layers.filter(r=>r.isStateDependent()).map(r=>r.id)}populate(t,r,n){this.hasPattern=wr("fill",this.layers,r);let i=this.layers[0].layout.get("fill-sort-key"),o=!i.isConstant(),a=[];for(let{feature:s,id:l,index:u,sourceLayerIndex:c}of t){let p=this.layers[0]._featureFilter.needGeometry,f=Oe(s,p);if(!this.layers[0]._featureFilter.filter(new q(this.zoom),f,n))continue;let y=o?i.evaluate(f,{},n,r.availableImages):void 0,m={id:l,properties:s.properties,type:s.type,sourceLayerIndex:c,index:u,geometry:p?f.geometry:Te(s),patterns:{},sortKey:y};a.push(m)}o&&a.sort((s,l)=>s.sortKey-l.sortKey);for(let s of a){let{geometry:l,index:u,sourceLayerIndex:c}=s;if(this.hasPattern){let f=Ar("fill",this.layers,s,this.zoom,r);this.patternFeatures.push(f)}else this.addFeature(s,l,u,n,{});let p=t[u].feature;r.featureIndex.insert(p,l,u,c,this.index)}}update(t,r,n){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,r,this.stateDependentLayers,n)}addFeatures(t,r,n){for(let i of this.patternFeatures)this.addFeature(i,i.geometry,i.index,r,n)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,vc),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.indexBuffer2=t.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(t),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())}addFeature(t,r,n,i,o){for(let a of Sr(r,Wd)){let s=0;for(let y of a)s+=y.length;let l=this.segments.prepareSegment(s,this.layoutVertexArray,this.indexArray),u=l.vertexLength,c=[],p=[];for(let y of a){if(y.length===0)continue;y!==a[0]&&p.push(c.length/2);let m=this.segments2.prepareSegment(y.length,this.layoutVertexArray,this.indexArray2),h=m.vertexLength;this.layoutVertexArray.emplaceBack(y[0].x,y[0].y),this.indexArray2.emplaceBack(h+y.length-1,h),c.push(y[0].x),c.push(y[0].y);for(let d=1;d<y.length;d++)this.layoutVertexArray.emplaceBack(y[d].x,y[d].y),this.indexArray2.emplaceBack(h+d-1,h+d),c.push(y[d].x),c.push(y[d].y);m.vertexLength+=y.length,m.primitiveLength+=y.length}let f=(0,Ic.default)(c,p);for(let y=0;y<f.length;y+=3)this.indexArray.emplaceBack(u+f[y],u+f[y+1],u+f[y+2]);l.vertexLength+=s,l.primitiveLength+=f.length/3}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,n,o,i)}};k("FillBucket",Kt,{omit:["layers","patternFeatures"]});var Cc,Hd=()=>Cc=Cc||new ie({"fill-sort-key":new R(S.layout_fill["fill-sort-key"])}),kc,Kd=()=>kc=kc||new ie({"fill-antialias":new z(S.paint_fill["fill-antialias"]),"fill-opacity":new R(S.paint_fill["fill-opacity"]),"fill-color":new R(S.paint_fill["fill-color"]),"fill-outline-color":new R(S.paint_fill["fill-outline-color"]),"fill-translate":new z(S.paint_fill["fill-translate"]),"fill-translate-anchor":new z(S.paint_fill["fill-translate-anchor"]),"fill-pattern":new st(S.paint_fill["fill-pattern"])}),Tc={get paint(){return Kd()},get layout(){return Hd()}};var ko=class extends le{constructor(r){super(r,Tc)}recalculate(r,n){super.recalculate(r,n);let i=this.paint._values["fill-outline-color"];i.value.kind==="constant"&&i.value.value===void 0&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])}createBucket(r){return new Kt(r)}queryRadius(){return At(this.paint.get("fill-translate"))}queryIntersectsFeature(r,n,i,o,a,s,l){let u=_t(r,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),s.angle,l);return bo(u,o)}isTileClipped(){return!0}};var Yd=ee([{name:"a_pos",components:2,type:"Int16"},{name:"a_normal_ed",components:4,type:"Int16"}],4),Ec=ee([{name:"a_centroid",components:2,type:"Int16"}],4);var{members:Fc,size:Y1,alignment:X1}=Yd;var zc=Z(hs(),1),Rc=Z(It(),1);var ug=Rc.default.VectorTileFeature.types,cg=500,bs=Math.pow(2,13);function Nn(e,t,r,n,i,o,a,s){e.emplaceBack(t,r,Math.floor(n*bs)*2+a,i*bs*2,o*bs*2,Math.round(s))}var Yt=class{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(r=>r.id),this.index=t.index,this.hasPattern=!1,this.layoutVertexArray=new oo,this.centroidVertexArray=new ro,this.indexArray=new Le,this.programConfigurations=new ke(t.layers,t.zoom),this.segments=new me,this.stateDependentLayerIds=this.layers.filter(r=>r.isStateDependent()).map(r=>r.id)}populate(t,r,n){this.features=[],this.hasPattern=wr("fill-extrusion",this.layers,r);for(let{feature:i,id:o,index:a,sourceLayerIndex:s}of t){let l=this.layers[0]._featureFilter.needGeometry,u=Oe(i,l);if(!this.layers[0]._featureFilter.filter(new q(this.zoom),u,n))continue;let c={id:o,sourceLayerIndex:s,index:a,geometry:l?u.geometry:Te(i),properties:i.properties,type:i.type,patterns:{}};this.hasPattern?this.features.push(Ar("fill-extrusion",this.layers,c,this.zoom,r)):this.addFeature(c,c.geometry,a,n,{}),r.featureIndex.insert(i,c.geometry,a,s,this.index,!0)}}addFeatures(t,r,n){for(let i of this.features){let{geometry:o}=i;this.addFeature(i,o,i.index,r,n)}}update(t,r,n){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,r,this.stateDependentLayers,n)}isEmpty(){return this.layoutVertexArray.length===0&&this.centroidVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Fc),this.centroidVertexBuffer=t.createVertexBuffer(this.centroidVertexArray,Ec.members,!0),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.centroidVertexBuffer.destroy())}addFeature(t,r,n,i,o){let a={x:0,y:0,vertexCount:0};for(let s of Sr(r,cg)){let l=0;for(let m of s)l+=m.length;let u=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray);for(let m of s){if(m.length===0||fg(m))continue;let h=0;for(let d=0;d<m.length;d++){let g=m[d];if(d>=1){let v=m[d-1];if(!pg(g,v)){u.vertexLength+4>me.MAX_VERTEX_ARRAY_LENGTH&&(u=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));let b=g.sub(v)._perp()._unit(),x=v.dist(g);h+x>32768&&(h=0),Nn(this.layoutVertexArray,g.x,g.y,b.x,b.y,0,0,h),Nn(this.layoutVertexArray,g.x,g.y,b.x,b.y,0,1,h),a.x+=2*g.x,a.y+=2*g.y,a.vertexCount+=2,h+=x,Nn(this.layoutVertexArray,v.x,v.y,b.x,b.y,0,0,h),Nn(this.layoutVertexArray,v.x,v.y,b.x,b.y,0,1,h),a.x+=2*v.x,a.y+=2*v.y,a.vertexCount+=2;let P=u.vertexLength;this.indexArray.emplaceBack(P,P+2,P+1),this.indexArray.emplaceBack(P+1,P+2,P+3),u.vertexLength+=4,u.primitiveLength+=2}}}}if(u.vertexLength+l>me.MAX_VERTEX_ARRAY_LENGTH&&(u=this.segments.prepareSegment(l,this.layoutVertexArray,this.indexArray)),ug[t.type]!=="Polygon")continue;let c=[],p=[],f=u.vertexLength;for(let m of s)if(m.length!==0){m!==s[0]&&p.push(c.length/2);for(let h=0;h<m.length;h++){let d=m[h];Nn(this.layoutVertexArray,d.x,d.y,0,0,1,1,0),a.x+=d.x,a.y+=d.y,a.vertexCount+=1,c.push(d.x),c.push(d.y)}}let y=(0,zc.default)(c,p);for(let m=0;m<y.length;m+=3)this.indexArray.emplaceBack(f+y[m],f+y[m+2],f+y[m+1]);u.primitiveLength+=y.length/3,u.vertexLength+=l}for(let s=0;s<a.vertexCount;s++)this.centroidVertexArray.emplaceBack(Math.floor(a.x/a.vertexCount),Math.floor(a.y/a.vertexCount));this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,n,o,i)}};k("FillExtrusionBucket",Yt,{omit:["layers","features"]});function pg(e,t){return e.x===t.x&&(e.x<0||e.x>8192)||e.y===t.y&&(e.y<0||e.y>8192)}function fg(e){return e.every(t=>t.x<0)||e.every(t=>t.x>8192)||e.every(t=>t.y<0)||e.every(t=>t.y>8192)}var Oc,yg=()=>Oc=Oc||new ie({"fill-extrusion-opacity":new z(S["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new R(S["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new z(S["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new z(S["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new st(S["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new R(S["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new R(S["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new z(S["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])}),Nc={get paint(){return yg()}};var Eo=Z(he(),1);var Fo=class extends le{constructor(r){super(r,Nc)}createBucket(r){return new Yt(r)}queryRadius(){return At(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}queryIntersectsFeature(r,n,i,o,a,s,l,u){let c=_t(r,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),s.angle,l),p=this.paint.get("fill-extrusion-height").evaluate(n,i),f=this.paint.get("fill-extrusion-base").evaluate(n,i),y=dg(c,u,s,0),m=hg(o,f,p,u),h=m[0],d=m[1];return mg(h,d,y)}};function Un(e,t){return e.x*t.x+e.y*t.y}function Uc(e,t){if(e.length===1){let r=0,n=t[r++],i;for(;!i||n.equals(i);)if(i=t[r++],!i)return 1/0;for(;r<t.length;r++){let o=t[r],a=e[0],s=i.sub(n),l=o.sub(n),u=a.sub(n),c=Un(s,s),p=Un(s,l),f=Un(l,l),y=Un(u,s),m=Un(u,l),h=c*f-p*p,d=(f*y-p*m)/h,g=(c*m-p*y)/h,v=1-d-g,b=n.z*v+i.z*d+o.z*g;if(isFinite(b))return b}return 1/0}else{let r=1/0;for(let n of t)r=Math.min(r,n.z);return r}}function mg(e,t,r){let n=1/0;bo(r,t)&&(n=Uc(r,t[0]));for(let i=0;i<t.length;i++){let o=t[i],a=e[i];for(let s=0;s<o.length-1;s++){let l=o[s],u=o[s+1],c=a[s],p=a[s+1],f=[l,u,p,c,l];$u(r,f)&&(n=Math.min(n,Uc(r,f)))}}return n===1/0?!1:n}function hg(e,t,r,n){let i=[],o=[],a=n[8]*t,s=n[9]*t,l=n[10]*t,u=n[11]*t,c=n[8]*r,p=n[9]*r,f=n[10]*r,y=n[11]*r;for(let m of e){let h=[],d=[];for(let g of m){let v=g.x,b=g.y,x=n[0]*v+n[4]*b+n[12],P=n[1]*v+n[5]*b+n[13],w=n[2]*v+n[6]*b+n[14],A=n[3]*v+n[7]*b+n[15],T=x+a,I=P+s,E=w+l,_=A+u,F=x+c,M=P+p,B=w+f,C=A+y,O=new Eo.default(T/_,I/_);O.z=E/_,h.push(O);let N=new Eo.default(F/C,M/C);N.z=B/C,d.push(N)}i.push(h),o.push(d)}return[i,o]}function dg(e,t,r,n){let i=[];for(let o of e){let a=[o.x,o.y,n,1];Jt.transformMat4(a,a,t),i.push(new Eo.default(a[0]/a[3],a[1]/a[3]))}return i}var gg=ee([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}],4),{members:$c,size:DP,alignment:VP}=gg;var xg=ee([{name:"a_uv_x",components:1,type:"Float32"},{name:"a_split_index",components:1,type:"Float32"}]),{members:Gc,size:RP,alignment:OP}=xg;var Zc=Z(It(),1);var bg=Zc.default.VectorTileFeature.types,qc=63,vg=Math.cos(75/2*(Math.PI/180)),Pg=15,Sg=20,wg=15,Jc=1/2,jc=Math.pow(2,wg-1)/Jc,Xt=class{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(r=>r.id),this.index=t.index,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach(r=>{this.gradients[r.id]={}}),this.layoutVertexArray=new ao,this.layoutVertexArray2=new so,this.indexArray=new Le,this.programConfigurations=new ke(t.layers,t.zoom),this.segments=new me,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter(r=>r.isStateDependent()).map(r=>r.id)}populate(t,r,n){this.hasPattern=wr("line",this.layers,r);let i=this.layers[0].layout.get("line-sort-key"),o=!i.isConstant(),a=[];for(let{feature:s,id:l,index:u,sourceLayerIndex:c}of t){let p=this.layers[0]._featureFilter.needGeometry,f=Oe(s,p);if(!this.layers[0]._featureFilter.filter(new q(this.zoom),f,n))continue;let y=o?i.evaluate(f,{},n):void 0,m={id:l,properties:s.properties,type:s.type,sourceLayerIndex:c,index:u,geometry:p?f.geometry:Te(s),patterns:{},sortKey:y};a.push(m)}o&&a.sort((s,l)=>s.sortKey-l.sortKey);for(let s of a){let{geometry:l,index:u,sourceLayerIndex:c}=s;if(this.hasPattern){let f=Ar("line",this.layers,s,this.zoom,r);this.patternFeatures.push(f)}else this.addFeature(s,l,u,n,{});let p=t[u].feature;r.featureIndex.insert(p,l,u,c,this.index)}}update(t,r,n){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,r,this.stateDependentLayers,n)}addFeatures(t,r,n){for(let i of this.patternFeatures)this.addFeature(i,i.geometry,i.index,r,n)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexArray2.length!==0&&(this.layoutVertexBuffer2=t.createVertexBuffer(this.layoutVertexArray2,Gc)),this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,$c),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(t){if(t.properties&&Object.prototype.hasOwnProperty.call(t.properties,"mapbox_clip_start")&&Object.prototype.hasOwnProperty.call(t.properties,"mapbox_clip_end")){let r=+t.properties.mapbox_clip_start,n=+t.properties.mapbox_clip_end;return{start:r,end:n}}}addFeature(t,r,n,i,o){let a=this.layers[0].layout,s=a.get("line-join").evaluate(t,{}),l=a.get("line-cap"),u=a.get("line-miter-limit"),c=a.get("line-round-limit");this.lineClips=this.lineFeatureClips(t);for(let p of r)this.addLine(p,t,s,l,u,c);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,n,o,i)}addLine(t,r,n,i,o,a){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(let g=0;g<t.length-1;g++)this.totalDistance+=t[g].dist(t[g+1]);this.updateScaledDistance(),this.maxLineLength=Math.max(this.maxLineLength,this.totalDistance)}let s=bg[r.type]==="Polygon",l=t.length;for(;l>=2&&t[l-1].equals(t[l-2]);)l--;let u=0;for(;u<l-1&&t[u].equals(t[u+1]);)u++;if(l<(s?3:2))return;n==="bevel"&&(o=1.05);let c=this.overscaling<=16?Pg*8192/(512*this.overscaling):0,p=this.segments.prepareSegment(l*10,this.layoutVertexArray,this.indexArray),f,y,m,h,d;this.e1=this.e2=-1,s&&(f=t[l-2],d=t[u].sub(f)._unit()._perp());for(let g=u;g<l;g++){if(m=g===l-1?s?t[u+1]:void 0:t[g+1],m&&t[g].equals(m))continue;d&&(h=d),f&&(y=f),f=t[g],d=m?m.sub(f)._unit()._perp():h,h=h||d;let v=h.add(d);(v.x!==0||v.y!==0)&&v._unit();let b=h.x*d.x+h.y*d.y,x=v.x*d.x+v.y*d.y,P=x!==0?1/x:1/0,w=2*Math.sqrt(2-2*x),A=x<vg&&y&&m,T=h.x*d.y-h.y*d.x>0;if(A&&g>u){let _=f.dist(y);if(_>2*c){let F=f.sub(f.sub(y)._mult(c/_)._round());this.updateDistance(y,F),this.addCurrentVertex(F,h,0,0,p),y=F}}let I=y&&m,E=I?n:s?"butt":i;if(I&&E==="round"&&(P<a?E="miter":P<=2&&(E="fakeround")),E==="miter"&&P>o&&(E="bevel"),E==="bevel"&&(P>2&&(E="flipbevel"),P<o&&(E="miter")),y&&this.updateDistance(y,f),E==="miter")v._mult(P),this.addCurrentVertex(f,v,0,0,p);else if(E==="flipbevel"){if(P>100)v=d.mult(-1);else{let _=P*h.add(d).mag()/h.sub(d).mag();v._perp()._mult(_*(T?-1:1))}this.addCurrentVertex(f,v,0,0,p),this.addCurrentVertex(f,v.mult(-1),0,0,p)}else if(E==="bevel"||E==="fakeround"){let _=-Math.sqrt(P*P-1),F=T?_:0,M=T?0:_;if(y&&this.addCurrentVertex(f,h,F,M,p),E==="fakeround"){let B=Math.round(w*180/Math.PI/Sg);for(let C=1;C<B;C++){let O=C/B;if(O!==.5){let K=O-.5,Y=1.0904+b*(-3.2452+b*(3.55645-b*1.43519)),Q=.848013+b*(-1.06021+b*.215638);O=O+O*K*(O-1)*(Y*K*K+Q)}let N=d.sub(h)._mult(O)._add(h)._unit()._mult(T?-1:1);this.addHalfVertex(f,N.x,N.y,!1,T,0,p)}}m&&this.addCurrentVertex(f,d,-F,-M,p)}else if(E==="butt")this.addCurrentVertex(f,v,0,0,p);else if(E==="square"){let _=y?1:-1;this.addCurrentVertex(f,v,_,_,p)}else E==="round"&&(y&&(this.addCurrentVertex(f,h,0,0,p),this.addCurrentVertex(f,h,1,1,p,!0)),m&&(this.addCurrentVertex(f,d,-1,-1,p,!0),this.addCurrentVertex(f,d,0,0,p)));if(A&&g<l-1){let _=f.dist(m);if(_>2*c){let F=f.add(m.sub(f)._mult(c/_)._round());this.updateDistance(f,F),this.addCurrentVertex(F,d,0,0,p),f=F}}}}addCurrentVertex(t,r,n,i,o,a=!1){let s=r.x+r.y*n,l=r.y-r.x*n,u=-r.x+r.y*i,c=-r.y-r.x*i;this.addHalfVertex(t,s,l,a,!1,n,o),this.addHalfVertex(t,u,c,a,!0,-i,o),this.distance>jc/2&&this.totalDistance===0&&(this.distance=0,this.updateScaledDistance(),this.addCurrentVertex(t,r,n,i,o,a))}addHalfVertex({x:t,y:r},n,i,o,a,s,l){let c=(this.lineClips?this.scaledDistance*(jc-1):this.scaledDistance)*Jc;if(this.layoutVertexArray.emplaceBack((t<<1)+(o?1:0),(r<<1)+(a?1:0),Math.round(qc*n)+128,Math.round(qc*i)+128,(s===0?0:s<0?-1:1)+1|(c&63)<<2,c>>6),this.lineClips){let f=this.scaledDistance-this.lineClips.start,y=this.lineClips.end-this.lineClips.start,m=f/y;this.layoutVertexArray2.emplaceBack(m,this.lineClipsArray.length)}let p=l.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,p),l.primitiveLength++),a?this.e2=p:this.e1=p}updateScaledDistance(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance}updateDistance(t,r){this.distance+=t.dist(r),this.updateScaledDistance()}};k("LineBucket",Xt,{omit:["layers","patternFeatures"]});var Wc,Ag=()=>Wc=Wc||new ie({"line-cap":new z(S.layout_line["line-cap"]),"line-join":new R(S.layout_line["line-join"]),"line-miter-limit":new z(S.layout_line["line-miter-limit"]),"line-round-limit":new z(S.layout_line["line-round-limit"]),"line-sort-key":new R(S.layout_line["line-sort-key"])}),Hc,_g=()=>Hc=Hc||new ie({"line-opacity":new R(S.paint_line["line-opacity"]),"line-color":new R(S.paint_line["line-color"]),"line-translate":new z(S.paint_line["line-translate"]),"line-translate-anchor":new z(S.paint_line["line-translate-anchor"]),"line-width":new R(S.paint_line["line-width"]),"line-gap-width":new R(S.paint_line["line-gap-width"]),"line-offset":new R(S.paint_line["line-offset"]),"line-blur":new R(S.paint_line["line-blur"]),"line-dasharray":new Ot(S.paint_line["line-dasharray"]),"line-pattern":new st(S.paint_line["line-pattern"]),"line-gradient":new Nt(S.paint_line["line-gradient"])}),vs={get paint(){return _g()},get layout(){return Ag()}};var Ps=class extends R{possiblyEvaluate(r,n){return n=new q(Math.floor(n.zoom),{now:n.now,fadeDuration:n.fadeDuration,zoomHistory:n.zoomHistory,transition:n.transition}),super.possiblyEvaluate(r,n)}evaluate(r,n,i,o){return n=Ae({},n,{zoom:Math.floor(n.zoom)}),super.evaluate(r,n,i,o)}},Mo,Lo=class extends le{constructor(r){super(r,vs);this.gradientVersion=0,Mo||(Mo=new Ps(vs.paint.properties["line-width"].specification),Mo.useIntegerZoom=!0)}_handleSpecialPaintPropertyUpdate(r){if(r==="line-gradient"){let n=this._transitionablePaint._values["line-gradient"].value.expression;this.stepInterpolant=n._styleExpression.expression instanceof lr,this.gradientVersion=(this.gradientVersion+1)%Number.MAX_SAFE_INTEGER}}gradientExpression(){return this._transitionablePaint._values["line-gradient"].value.expression}recalculate(r,n){super.recalculate(r,n),this.paint._values["line-floorwidth"]=Mo.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,r)}createBucket(r){return new Xt(r)}queryRadius(r){let n=r,i=Kc(Zt("line-width",this,n),Zt("line-gap-width",this,n)),o=Zt("line-offset",this,n);return i/2+Math.abs(o)+At(this.paint.get("line-translate"))}queryIntersectsFeature(r,n,i,o,a,s,l){let u=_t(r,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),s.angle,l),c=l/2*Kc(this.paint.get("line-width").evaluate(n,i),this.paint.get("line-gap-width").evaluate(n,i)),p=this.paint.get("line-offset").evaluate(n,i);return p&&(o=Zu(o,p*l)),qu(u,o,c)}isTileClipped(){return!0}};function Kc(e,t){return t>0?t+2*e:e}var Yc=ee([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),Xc=ee([{name:"a_projected_pos",components:3,type:"Float32"}],4),SS=ee([{name:"a_fade_opacity",components:1,type:"Uint32"}],4),Qc=ee([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}]),wS=ee([{type:"Int16",name:"anchorPointX"},{type:"Int16",name:"anchorPointY"},{type:"Int16",name:"x1"},{type:"Int16",name:"y1"},{type:"Int16",name:"x2"},{type:"Int16",name:"y2"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"}]),Ss=ee([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),AS=ee([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4),_S=ee([{name:"triangle",components:3,type:"Uint16"}]),IS=ee([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Uint16",name:"glyphStartIndex"},{type:"Uint16",name:"numGlyphs"},{type:"Uint32",name:"vertexStartIndex"},{type:"Uint32",name:"lineStartIndex"},{type:"Uint32",name:"lineLength"},{type:"Uint16",name:"segment"},{type:"Uint16",name:"lowerSize"},{type:"Uint16",name:"upperSize"},{type:"Float32",name:"lineOffsetX"},{type:"Float32",name:"lineOffsetY"},{type:"Uint8",name:"writingMode"},{type:"Uint8",name:"placedOrientation"},{type:"Uint8",name:"hidden"},{type:"Uint32",name:"crossTileID"},{type:"Int16",name:"associatedIconIndex"}]),CS=ee([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Int16",name:"rightJustifiedTextSymbolIndex"},{type:"Int16",name:"centerJustifiedTextSymbolIndex"},{type:"Int16",name:"leftJustifiedTextSymbolIndex"},{type:"Int16",name:"verticalPlacedTextSymbolIndex"},{type:"Int16",name:"placedIconSymbolIndex"},{type:"Int16",name:"verticalPlacedIconSymbolIndex"},{type:"Uint16",name:"key"},{type:"Uint16",name:"textBoxStartIndex"},{type:"Uint16",name:"textBoxEndIndex"},{type:"Uint16",name:"verticalTextBoxStartIndex"},{type:"Uint16",name:"verticalTextBoxEndIndex"},{type:"Uint16",name:"iconBoxStartIndex"},{type:"Uint16",name:"iconBoxEndIndex"},{type:"Uint16",name:"verticalIconBoxStartIndex"},{type:"Uint16",name:"verticalIconBoxEndIndex"},{type:"Uint16",name:"featureIndex"},{type:"Uint16",name:"numHorizontalGlyphVertices"},{type:"Uint16",name:"numVerticalGlyphVertices"},{type:"Uint16",name:"numIconVertices"},{type:"Uint16",name:"numVerticalIconVertices"},{type:"Uint16",name:"useRuntimeCollisionCircles"},{type:"Uint32",name:"crossTileID"},{type:"Float32",name:"textBoxScale"},{type:"Float32",components:2,name:"textOffset"},{type:"Float32",name:"collisionCircleDiameter"}]),kS=ee([{type:"Float32",name:"offsetX"}]),TS=ee([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]);var Jn=Z(he(),1);function Ig(e,t,r){let n=t.layout.get("text-transform").evaluate(r,{});return n==="uppercase"?e=e.toLocaleUpperCase():n==="lowercase"&&(e=e.toLocaleLowerCase()),ae.applyArabicShaping&&(e=ae.applyArabicShaping(e)),e}function ep(e,t,r){return e.sections.forEach(n=>{n.text=Ig(n.text,t,r)}),e}function tp(e){let t={},r={},n=[],i=0;function o(u){n.push(e[u]),i++}function a(u,c,p){let f=r[u];return delete r[u],r[c]=f,n[f].geometry[0].pop(),n[f].geometry[0]=n[f].geometry[0].concat(p[0]),f}function s(u,c,p){let f=t[c];return delete t[c],t[u]=f,n[f].geometry[0].shift(),n[f].geometry[0]=p[0].concat(n[f].geometry[0]),f}function l(u,c,p){let f=p?c[0][c[0].length-1]:c[0][0];return"".concat(u,":").concat(f.x,":").concat(f.y)}for(let u=0;u<e.length;u++){let c=e[u],p=c.geometry,f=c.text?c.text.toString():null;if(!f){o(u);continue}let y=l(f,p),m=l(f,p,!0);if(y in r&&m in t&&r[y]!==t[m]){let h=s(y,m,p),d=a(y,m,n[h].geometry);delete t[y],delete r[m],r[l(f,n[d].geometry,!0)]=d,n[h].geometry=null}else y in r?a(y,m,p):m in t?s(y,m,p):(o(u),t[y]=i-1,r[m]=i-1)}return n.filter(u=>u.geometry)}var Ir={"!":"\\uFE15","#":"\\uFF03",$:"\\uFF04","%":"\\uFF05","&":"\\uFF06","(":"\\uFE35",")":"\\uFE36","*":"\\uFF0A","+":"\\uFF0B",",":"\\uFE10","-":"\\uFE32",".":"\\u30FB","/":"\\uFF0F",":":"\\uFE13",";":"\\uFE14","<":"\\uFE3F","=":"\\uFF1D",">":"\\uFE40","?":"\\uFE16","@":"\\uFF20","[":"\\uFE47","\\\\":"\\uFF3C","]":"\\uFE48","^":"\\uFF3E",_:"\\uFE33","`":"\\uFF40","{":"\\uFE37","|":"\\u2015","}":"\\uFE38","~":"\\uFF5E","\\xA2":"\\uFFE0","\\xA3":"\\uFFE1","\\xA5":"\\uFFE5","\\xA6":"\\uFFE4","\\xAC":"\\uFFE2","\\xAF":"\\uFFE3","\\u2013":"\\uFE32","\\u2014":"\\uFE31","\\u2018":"\\uFE43","\\u2019":"\\uFE44","\\u201C":"\\uFE41","\\u201D":"\\uFE42","\\u2026":"\\uFE19","\\u2027":"\\u30FB","\\u20A9":"\\uFFE6","\\u3001":"\\uFE11","\\u3002":"\\uFE12","\\u3008":"\\uFE3F","\\u3009":"\\uFE40","\\u300A":"\\uFE3D","\\u300B":"\\uFE3E","\\u300C":"\\uFE41","\\u300D":"\\uFE42","\\u300E":"\\uFE43","\\u300F":"\\uFE44","\\u3010":"\\uFE3B","\\u3011":"\\uFE3C","\\u3014":"\\uFE39","\\u3015":"\\uFE3A","\\u3016":"\\uFE17","\\u3017":"\\uFE18","\\uFF01":"\\uFE15","\\uFF08":"\\uFE35","\\uFF09":"\\uFE36","\\uFF0C":"\\uFE10","\\uFF0D":"\\uFE32","\\uFF0E":"\\u30FB","\\uFF1A":"\\uFE13","\\uFF1B":"\\uFE14","\\uFF1C":"\\uFE3F","\\uFF1E":"\\uFE40","\\uFF1F":"\\uFE16","\\uFF3B":"\\uFE47","\\uFF3D":"\\uFE48","\\uFF3F":"\\uFE33","\\uFF5B":"\\uFE37","\\uFF5C":"\\u2015","\\uFF5D":"\\uFE38","\\uFF5F":"\\uFE35","\\uFF60":"\\uFE36","\\uFF61":"\\uFE12","\\uFF62":"\\uFE41","\\uFF63":"\\uFE42"};function rp(e){let t="";for(let r=0;r<e.length;r++){let n=e.charCodeAt(r+1)||null,i=e.charCodeAt(r-1)||null;(!n||!Ka(n)||Ir[e[r+1]])&&(!i||!Ka(i)||Ir[e[r-1]])&&Ir[e[r]]?t+=Ir[e[r]]:t+=e[r]}return t}var ue=24;var qg=Z($n(),1),jg=3;var Bo=jg;function Gn(e){let t=0,r=0;for(let s of e)t+=s.w*s.h,r=Math.max(r,s.w);e.sort((s,l)=>l.h-s.h);let i=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(t/.95)),r),h:1/0}],o=0,a=0;for(let s of e)for(let l=i.length-1;l>=0;l--){let u=i[l];if(!(s.w>u.w||s.h>u.h)){if(s.x=u.x,s.y=u.y,a=Math.max(a,s.y+s.h),o=Math.max(o,s.x+s.w),s.w===u.w&&s.h===u.h){let c=i.pop();l<i.length&&(i[l]=c)}else s.h===u.h?(u.x+=s.w,u.w-=s.w):s.w===u.w?(u.y+=s.h,u.h-=s.h):(i.push({x:u.x+s.w,y:u.y,w:u.w-s.w,h:s.h}),u.y+=s.h,u.h-=s.h);break}}return{w:o,h:a,fill:t/(o*a)||0}}var ge=1;var zo=class{constructor(t,{pixelRatio:r,version:n,stretchX:i,stretchY:o,content:a}){this.paddedRect=t,this.pixelRatio=r,this.stretchX=i,this.stretchY=o,this.content=a,this.version=n}get tl(){return[this.paddedRect.x+ge,this.paddedRect.y+ge]}get br(){return[this.paddedRect.x+this.paddedRect.w-ge,this.paddedRect.y+this.paddedRect.h-ge]}get tlbr(){return this.tl.concat(this.br)}get displaySize(){return[(this.paddedRect.w-ge*2)/this.pixelRatio,(this.paddedRect.h-ge*2)/this.pixelRatio]}},qn=class{constructor(t,r){let n={},i={};this.haveRenderCallbacks=[];let o=[];this.addImages(t,n,o),this.addImages(r,i,o);let{w:a,h:s}=Gn(o),l=new de({width:a||1,height:s||1});for(let u in t){let c=t[u],p=n[u].paddedRect;de.copy(c.data,l,{x:0,y:0},{x:p.x+ge,y:p.y+ge},c.data)}for(let u in r){let c=r[u],p=i[u].paddedRect,f=p.x+ge,y=p.y+ge,m=c.data.width,h=c.data.height;de.copy(c.data,l,{x:0,y:0},{x:f,y},c.data),de.copy(c.data,l,{x:0,y:h-1},{x:f,y:y-1},{width:m,height:1}),de.copy(c.data,l,{x:0,y:0},{x:f,y:y+h},{width:m,height:1}),de.copy(c.data,l,{x:m-1,y:0},{x:f-1,y},{width:1,height:h}),de.copy(c.data,l,{x:0,y:0},{x:f+m,y},{width:1,height:h})}this.image=l,this.iconPositions=n,this.patternPositions=i}addImages(t,r,n){for(let i in t){let o=t[i],a={x:0,y:0,w:o.data.width+2*ge,h:o.data.height+2*ge};n.push(a),r[i]=new zo(a,o),o.hasRenderCallback&&this.haveRenderCallbacks.push(i)}}patchUpdatedImages(t,r){t.dispatchRenderCallbacks(this.haveRenderCallbacks);for(let n in t.updatedImages)this.patchUpdatedImage(this.iconPositions[n],t.getImage(n),r),this.patchUpdatedImage(this.patternPositions[n],t.getImage(n),r)}patchUpdatedImage(t,r,n){if(!t||!r||t.version===r.version)return;t.version=r.version;let[i,o]=t.tl;n.update(r.data,void 0,{x:i,y:o})}};k("ImagePosition",zo);k("ImageAtlas",qn);var No=(i=>(i[i.none=0]="none",i[i.horizontal=1]="horizontal",i[i.vertical=2]="vertical",i[i.horizontalOnly=3]="horizontalOnly",i))(No||{}),Tr=-17;function Zg(e){for(let t of e)if(t.positionedGlyphs.length!==0)return!1;return!0}var up=57344,cp=63743,Ro=class e{constructor(){this.scale=1,this.fontStack="",this.imageName=null}static forText(t,r){let n=new e;return n.scale=t||1,n.fontStack=r,n}static forImage(t){let r=new e;return r.imageName=t,r}},jn=class e{constructor(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null}static fromFeature(t,r){let n=new e;for(let i=0;i<t.sections.length;i++){let o=t.sections[i];o.image?n.addImageSection(o):n.addTextSection(o,r)}return n}length(){return this.text.length}getSection(t){return this.sections[this.sectionIndex[t]]}getSectionIndex(t){return this.sectionIndex[t]}getCharCode(t){return this.text.charCodeAt(t)}verticalizePunctuation(){this.text=rp(this.text)}trim(){let t=0;for(let n=0;n<this.text.length&&Oo[this.text.charCodeAt(n)];n++)t++;let r=this.text.length;for(let n=this.text.length-1;n>=0&&n>=t&&Oo[this.text.charCodeAt(n)];n--)r--;this.text=this.text.substring(t,r),this.sectionIndex=this.sectionIndex.slice(t,r)}substring(t,r){let n=new e;return n.text=this.text.substring(t,r),n.sectionIndex=this.sectionIndex.slice(t,r),n.sections=this.sections,n}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce((t,r)=>Math.max(t,this.sections[r].scale),0)}addTextSection(t,r){this.text+=t.text,this.sections.push(Ro.forText(t.scale,t.fontStack||r));let n=this.sections.length-1;for(let i=0;i<t.text.length;++i)this.sectionIndex.push(n)}addImageSection(t){let r=t.image?t.image.name:"";if(r.length===0){ce("Can\'t add FormattedSection with an empty image.");return}let n=this.getNextImageSectionCharCode();if(!n){ce("Reached maximum number of images ".concat(cp-up+2));return}this.text+=String.fromCharCode(n),this.sections.push(Ro.forImage(r)),this.sectionIndex.push(this.sections.length-1)}getNextImageSectionCharCode(){return this.imageSectionID?this.imageSectionID>=cp?null:++this.imageSectionID:(this.imageSectionID=up,this.imageSectionID)}};function Jg(e,t){let r=[],n=e.text,i=0;for(let o of t)r.push(e.substring(i,o)),i=o;return i<n.length&&r.push(e.substring(i,n.length)),r}function Zn(e,t,r,n,i,o,a,s,l,u,c,p,f,y,m,h){let d=jn.fromFeature(e,i);p===2&&d.verticalizePunctuation();let g,{processBidirectionalText:v,processStyledBidirectionalText:b}=ae;if(v&&d.sections.length===1){g=[];let w=v(d.toString(),_s(d,u,o,t,n,y,m));for(let A of w){let T=new jn;T.text=A,T.sections=d.sections;for(let I=0;I<A.length;I++)T.sectionIndex.push(0);g.push(T)}}else if(b){g=[];let w=b(d.text,d.sectionIndex,_s(d,u,o,t,n,y,m));for(let A of w){let T=new jn;T.text=A[0],T.sectionIndex=A[1],T.sections=d.sections,g.push(T)}}else g=Jg(d,_s(d,u,o,t,n,y,m));let x=[],P={positionedLines:x,text:d.toString(),top:c[1],bottom:c[1],left:c[0],right:c[0],writingMode:p,iconsInText:!1,verticalizable:!1};return Yg(P,t,r,n,g,a,s,l,p,u,f,h),Zg(x)?!1:P}var Oo={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},Wg={10:!0,32:!0,38:!0,40:!0,41:!0,43:!0,45:!0,47:!0,173:!0,183:!0,8203:!0,8208:!0,8211:!0,8231:!0};function yp(e,t,r,n,i,o){if(t.imageName){let a=n[t.imageName];return a?a.displaySize[0]*t.scale*ue/o+i:0}else{let a=r[t.fontStack],s=a&&a[e];return s?s.metrics.advance*t.scale+i:0}}function Hg(e,t,r,n,i,o){let a=0;for(let l=0;l<e.length();l++){let u=e.getSection(l);a+=yp(e.getCharCode(l),u,n,i,t,o)}let s=Math.max(1,Math.ceil(a/r));return a/s}function pp(e,t,r,n){let i=Math.pow(e-t,2);return n?e<t?i/2:i*2:i+Math.abs(r)*r}function Kg(e,t,r){let n=0;return e===10&&(n-=1e4),r&&(n+=150),(e===40||e===65288)&&(n+=50),(t===41||t===65289)&&(n+=50),n}function fp(e,t,r,n,i,o){let a=null,s=pp(t,r,i,o);for(let l of n){let u=t-l.x,c=pp(u,r,i,o)+l.badness;c<=s&&(a=l,s=c)}return{index:e,x:t,priorBreak:a,badness:s}}function mp(e){return e?mp(e.priorBreak).concat(e.index):[]}function _s(e,t,r,n,i,o,a){if(o!=="point")return[];if(!e)return[];let s=[],l=Hg(e,t,r,n,i,a),u=e.text.indexOf("\\u200B")>=0,c=0;for(let p=0;p<e.length();p++){let f=e.getSection(p),y=e.getCharCode(p);if(Oo[y]||(c+=yp(y,f,n,i,t,a)),p<e.length()-1){let m=Au(y);(Wg[y]||m||f.imageName)&&s.push(fp(p+1,c,l,s,Kg(y,e.getCharCode(p+1),m&&u),!1))}}return mp(fp(e.length(),c,l,s,0,!0))}function hp(e){let t=.5,r=.5;switch(e){case"right":case"top-right":case"bottom-right":t=1;break;case"left":case"top-left":case"bottom-left":t=0;break}switch(e){case"bottom":case"bottom-right":case"bottom-left":r=1;break;case"top":case"top-right":case"top-left":r=0;break}return{horizontalAlign:t,verticalAlign:r}}function Yg(e,t,r,n,i,o,a,s,l,u,c,p){let f=0,y=Tr,m=0,h=0,d=s==="right"?1:s==="left"?0:.5,g=0;for(let P of i){P.trim();let w=P.getMaxScale(),A=(w-1)*ue,T={positionedGlyphs:[],lineOffset:0};e.positionedLines[g]=T;let I=T.positionedGlyphs,E=0;if(!P.length()){y+=o,++g;continue}for(let F=0;F<P.length();F++){let M=P.getSection(F),B=P.getSectionIndex(F),C=P.getCharCode(F),O=0,N=null,K=null,Y=null,Q=ue,ye=!(l===1||!c&&!Ui(C)||c&&(Oo[C]||_u(C)));if(M.imageName){let _e=n[M.imageName];if(!_e)continue;Y=M.imageName,e.iconsInText=e.iconsInText||!0,K=_e.paddedRect;let re=_e.displaySize;M.scale=M.scale*ue/p,N={width:re[0],height:re[1],left:ge,top:-Bo,advance:ye?re[1]:re[0]};let Pe=ue-re[1]*M.scale;O=A+Pe,Q=N.advance;let $e=ye?re[0]*M.scale-ue*w:re[1]*M.scale-ue*w;$e>0&&$e>E&&(E=$e)}else{let _e=r[M.fontStack],re=_e&&_e[C];if(re&&re.rect)K=re.rect,N=re.metrics;else{let Pe=t[M.fontStack],$e=Pe&&Pe[C];if(!$e)continue;N=$e.metrics}O=(w-M.scale)*ue}ye?(e.verticalizable=!0,I.push({glyph:C,imageName:Y,x:f,y:y+O,vertical:ye,scale:M.scale,fontStack:M.fontStack,sectionIndex:B,metrics:N,rect:K}),f+=Q*M.scale+u):(I.push({glyph:C,imageName:Y,x:f,y:y+O,vertical:ye,scale:M.scale,fontStack:M.fontStack,sectionIndex:B,metrics:N,rect:K}),f+=N.advance*M.scale+u)}if(I.length!==0){let F=f-u;m=Math.max(F,m),Xg(I,0,I.length-1,d,E)}f=0;let _=o*w+E;T.lineOffset=Math.max(E,A),y+=_,h=Math.max(_,h),++g}let v=y-Tr,{horizontalAlign:b,verticalAlign:x}=hp(a);Qg(e.positionedLines,d,b,x,m,h,o,v,i.length),e.top+=-x*v,e.bottom=e.top+v,e.left+=-b*m,e.right=e.left+m}function Xg(e,t,r,n,i){if(!n&&!i)return;let o=e[r],a=o.metrics.advance*o.scale,s=(e[r].x+a)*n;for(let l=t;l<=r;l++)e[l].x-=s,e[l].y+=i}function Qg(e,t,r,n,i,o,a,s,l){let u=(t-r)*i,c=0;o!==a?c=-s*n-Tr:c=(-n*l+.5)*a;for(let p of e)for(let f of p.positionedGlyphs)f.x+=u,f.y+=c}function dp(e,t,r){let{horizontalAlign:n,verticalAlign:i}=hp(r),o=t[0],a=t[1],s=o-e.displaySize[0]*n,l=s+e.displaySize[0],u=a-e.displaySize[1]*i,c=u+e.displaySize[1];return{image:e,top:u,bottom:c,left:s,right:l}}function Is(e,t,r,n,i,o){let a=e.image,s;if(a.content){let d=a.content,g=a.pixelRatio||1;s=[d[0]/g,d[1]/g,a.displaySize[0]-d[2]/g,a.displaySize[1]-d[3]/g]}let l=t.left*o,u=t.right*o,c,p,f,y;r==="width"||r==="both"?(y=i[0]+l-n[3],p=i[0]+u+n[1]):(y=i[0]+(l+u-a.displaySize[0])/2,p=y+a.displaySize[0]);let m=t.top*o,h=t.bottom*o;return r==="height"||r==="both"?(c=i[1]+m-n[0],f=i[1]+h+n[2]):(c=i[1]+(m+h-a.displaySize[1])/2,f=c+a.displaySize[1]),{image:a,top:c,right:p,bottom:f,left:y,collisionPadding:s}}var gp=Z(It(),1);var Er=255,Ct=128,Qe=Er*Ct;function Cs(e,t){let{expression:r}=t;if(r.kind==="constant")return{kind:"constant",layoutSize:r.evaluate(new q(e+1))};if(r.kind==="source")return{kind:"source"};{let{zoomStops:n,interpolationType:i}=r,o=0;for(;o<n.length&&n[o]<=e;)o++;o=Math.max(0,o-1);let a=o;for(;a<n.length&&n[a]<e+1;)a++;a=Math.min(n.length-1,a);let s=n[o],l=n[a];if(r.kind==="composite")return{kind:"composite",minZoom:s,maxZoom:l,interpolationType:i};let u=r.evaluate(new q(s)),c=r.evaluate(new q(l));return{kind:"camera",minZoom:s,maxZoom:l,minSize:u,maxSize:c,interpolationType:i}}}function ks(e,t,r){let n="never",i=e.get(t);return i?n=i:e.get(r)&&(n="always"),n}var ex=gp.default.VectorTileFeature.types,tx=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function Uo(e,t,r,n,i,o,a,s,l,u,c,p,f){let y=s?Math.min(Qe,Math.round(s[0])):0,m=s?Math.min(Qe,Math.round(s[1])):0;e.emplaceBack(t,r,Math.round(n*32),Math.round(i*32),o,a,(y<<1)+(l?1:0),m,u*16,c*16,p*256,f*256)}function xp(e,t,r){e.emplaceBack(t.x,t.y,r),e.emplaceBack(t.x,t.y,r),e.emplaceBack(t.x,t.y,r),e.emplaceBack(t.x,t.y,r)}function rx(e){for(let t of e.sections)if(Cu(t.text))return!0;return!1}var Wn=class{constructor(t){this.layoutVertexArray=new lo,this.indexArray=new Le,this.programConfigurations=t,this.segments=new me,this.dynamicLayoutVertexArray=new uo,this.opacityVertexArray=new co,this.hasVisibleVertices=!1,this.placedSymbolArray=new wn}isEmpty(){return this.layoutVertexArray.length===0&&this.indexArray.length===0&&this.dynamicLayoutVertexArray.length===0&&this.opacityVertexArray.length===0}upload(t,r,n,i){this.isEmpty()||(n&&(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Yc.members),this.indexBuffer=t.createIndexBuffer(this.indexArray,r),this.dynamicLayoutVertexBuffer=t.createVertexBuffer(this.dynamicLayoutVertexArray,Xc.members,!0),this.opacityVertexBuffer=t.createVertexBuffer(this.opacityVertexArray,tx,!0),this.opacityVertexBuffer.itemSize=1),(n||i)&&this.programConfigurations.upload(t))}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy())}};k("SymbolBuffers",Wn);var Hn=class{constructor(t,r,n){this.layoutVertexArray=new t,this.layoutAttributes=r,this.indexArray=new n,this.segments=new me,this.collisionVertexArray=new po}upload(t){this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=t.createVertexBuffer(this.collisionVertexArray,Qc.members,!0)}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy())}};k("CollisionBuffers",Hn);var We=class{constructor(t){this.collisionBoxArray=t.collisionBoxArray,this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(l=>l.id),this.index=t.index,this.pixelRatio=t.pixelRatio,this.sourceLayerIndex=t.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=Dn.identity([]),this.placementViewportMatrix=Dn.identity([]);let n=this.layers[0]._unevaluatedLayout._values;this.textSizeData=Cs(this.zoom,n["text-size"]),this.iconSizeData=Cs(this.zoom,n["icon-size"]);let i=this.layers[0].layout,o=i.get("symbol-sort-key"),a=i.get("symbol-z-order");this.canOverlap=ks(i,"text-overlap","text-allow-overlap")!=="never"||ks(i,"icon-overlap","icon-allow-overlap")!=="never"||i.get("text-ignore-placement")||i.get("icon-ignore-placement"),this.sortFeaturesByKey=a!=="viewport-y"&&!o.isConstant();let s=a==="viewport-y"||a==="auto"&&!this.sortFeaturesByKey;this.sortFeaturesByY=s&&this.canOverlap,i.get("symbol-placement")==="point"&&(this.writingModes=i.get("text-writing-mode").map(l=>No[l])),this.stateDependentLayerIds=this.layers.filter(l=>l.isStateDependent()).map(l=>l.id),this.sourceID=t.sourceID}createArrays(){this.text=new Wn(new ke(this.layers,this.zoom,t=>/^text/.test(t))),this.icon=new Wn(new ke(this.layers,this.zoom,t=>/^icon/.test(t))),this.glyphOffsetArray=new _n,this.lineVertexArray=new In,this.symbolInstances=new An}calculateGlyphDependencies(t,r,n,i,o){for(let a=0;a<t.length;a++)if(r[t.charCodeAt(a)]=!0,(n||i)&&o){let s=Ir[t.charAt(a)];s&&(r[s.charCodeAt(0)]=!0)}}populate(t,r,n){let i=this.layers[0],o=i.layout,a=o.get("text-font"),s=o.get("text-field"),l=o.get("icon-image"),u=(s.value.kind!=="constant"||s.value.value instanceof Me&&!s.value.value.isEmpty()||s.value.value.toString().length>0)&&(a.value.kind!=="constant"||a.value.value.length>0),c=l.value.kind!=="constant"||!!l.value.value||Object.keys(l.parameters).length>0,p=o.get("symbol-sort-key");if(this.features=[],!u&&!c)return;let f=r.iconDependencies,y=r.glyphDependencies,m=r.availableImages,h=new q(this.zoom);for(let{feature:d,id:g,index:v,sourceLayerIndex:b}of t){let x=i._featureFilter.needGeometry,P=Oe(d,x);if(!i._featureFilter.filter(h,P,n))continue;x||(P.geometry=Te(d));let w;if(u){let E=i.getValueAndResolveTokens("text-field",P,n,m),_=Me.factory(E);rx(_)&&(this.hasRTLText=!0),(!this.hasRTLText||Eu()==="unavailable"||this.hasRTLText&&ae.isParsed())&&(w=ep(_,i,P))}let A;if(c){let E=i.getValueAndResolveTokens("icon-image",P,n,m);E instanceof Ce?A=E:A=Ce.fromString(E)}if(!w&&!A)continue;let T=this.sortFeaturesByKey?p.evaluate(P,{},n):void 0,I={id:g,text:w,icon:A,index:v,sourceLayerIndex:b,geometry:P.geometry,properties:d.properties,type:ex[d.type],sortKey:T};if(this.features.push(I),A&&(f[A.name]=!0),w){let E=a.evaluate(P,{},n).join(","),_=o.get("text-rotation-alignment")!=="viewport"&&o.get("symbol-placement")!=="point";this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(2)>=0;for(let F of w.sections)if(F.image)f[F.image.name]=!0;else{let M=on(w.toString()),B=F.fontStack||E,C=y[B]=y[B]||{};this.calculateGlyphDependencies(F.text,C,_,this.allowVerticalPlacement,M)}}}o.get("symbol-placement")==="line"&&(this.features=tp(this.features)),this.sortFeaturesByKey&&this.features.sort((d,g)=>d.sortKey-g.sortKey)}update(t,r,n){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(t,r,this.layers,n),this.icon.programConfigurations.updatePaintArrays(t,r,this.layers,n))}isEmpty(){return this.symbolInstances.length===0&&!this.hasRTLText}uploadPending(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload}upload(t){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(t),this.iconCollisionBox.upload(t)),this.text.upload(t,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(t,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0}destroyDebugData(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()}destroy(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()}addToLineVertexArray(t,r){let n=this.lineVertexArray.length;if(t.segment!==void 0){let i=t.dist(r[t.segment+1]),o=t.dist(r[t.segment]),a={};for(let s=t.segment+1;s<r.length;s++)a[s]={x:r[s].x,y:r[s].y,tileUnitDistanceFromAnchor:i},s<r.length-1&&(i+=r[s+1].dist(r[s]));for(let s=t.segment||0;s>=0;s--)a[s]={x:r[s].x,y:r[s].y,tileUnitDistanceFromAnchor:o},s>0&&(o+=r[s-1].dist(r[s]));for(let s=0;s<r.length;s++){let l=a[s];this.lineVertexArray.emplaceBack(l.x,l.y,l.tileUnitDistanceFromAnchor)}}return{lineStartIndex:n,lineLength:this.lineVertexArray.length-n}}addSymbols(t,r,n,i,o,a,s,l,u,c,p,f){let y=t.indexArray,m=t.layoutVertexArray,h=t.segments.prepareSegment(4*r.length,m,y,this.canOverlap?a.sortKey:void 0),d=this.glyphOffsetArray.length,g=h.vertexLength,v=this.allowVerticalPlacement&&s===2?Math.PI/2:0,b=a.text&&a.text.sections;for(let x=0;x<r.length;x++){let{tl:P,tr:w,bl:A,br:T,tex:I,pixelOffsetTL:E,pixelOffsetBR:_,minFontScaleX:F,minFontScaleY:M,glyphOffset:B,isSDF:C,sectionIndex:O}=r[x],N=h.vertexLength,K=B[1];Uo(m,l.x,l.y,P.x,K+P.y,I.x,I.y,n,C,E.x,E.y,F,M),Uo(m,l.x,l.y,w.x,K+w.y,I.x+I.w,I.y,n,C,_.x,E.y,F,M),Uo(m,l.x,l.y,A.x,K+A.y,I.x,I.y+I.h,n,C,E.x,_.y,F,M),Uo(m,l.x,l.y,T.x,K+T.y,I.x+I.w,I.y+I.h,n,C,_.x,_.y,F,M),xp(t.dynamicLayoutVertexArray,l,v),y.emplaceBack(N,N+1,N+2),y.emplaceBack(N+1,N+2,N+3),h.vertexLength+=4,h.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(B[0]),(x===r.length-1||O!==r[x+1].sectionIndex)&&t.programConfigurations.populatePaintArrays(m.length,a,a.index,{},f,b&&b[O])}t.placedSymbolArray.emplaceBack(l.x,l.y,d,this.glyphOffsetArray.length-d,g,u,c,l.segment,n?n[0]:0,n?n[1]:0,i[0],i[1],s,0,!1,0,p)}_addCollisionDebugVertex(t,r,n,i,o,a){return r.emplaceBack(0,0),t.emplaceBack(n.x,n.y,i,o,Math.round(a.x),Math.round(a.y))}addCollisionDebugVertices(t,r,n,i,o,a,s){let l=o.segments.prepareSegment(4,o.layoutVertexArray,o.indexArray),u=l.vertexLength,c=o.layoutVertexArray,p=o.collisionVertexArray,f=s.anchorX,y=s.anchorY;this._addCollisionDebugVertex(c,p,a,f,y,new Jn.default(t,r)),this._addCollisionDebugVertex(c,p,a,f,y,new Jn.default(n,r)),this._addCollisionDebugVertex(c,p,a,f,y,new Jn.default(n,i)),this._addCollisionDebugVertex(c,p,a,f,y,new Jn.default(t,i)),l.vertexLength+=4;let m=o.indexArray;m.emplaceBack(u,u+1),m.emplaceBack(u+1,u+2),m.emplaceBack(u+2,u+3),m.emplaceBack(u+3,u),l.primitiveLength+=4}addDebugCollisionBoxes(t,r,n,i){for(let o=t;o<r;o++){let a=this.collisionBoxArray.get(o),s=a.x1,l=a.y1,u=a.x2,c=a.y2;this.addCollisionDebugVertices(s,l,u,c,i?this.textCollisionBox:this.iconCollisionBox,a.anchorPoint,n)}}generateCollisionDebugBuffers(){this.hasDebugData()&&this.destroyDebugData(),this.textCollisionBox=new Hn(kn,Ss.members,St),this.iconCollisionBox=new Hn(kn,Ss.members,St);for(let t=0;t<this.symbolInstances.length;t++){let r=this.symbolInstances.get(t);this.addDebugCollisionBoxes(r.textBoxStartIndex,r.textBoxEndIndex,r,!0),this.addDebugCollisionBoxes(r.verticalTextBoxStartIndex,r.verticalTextBoxEndIndex,r,!0),this.addDebugCollisionBoxes(r.iconBoxStartIndex,r.iconBoxEndIndex,r,!1),this.addDebugCollisionBoxes(r.verticalIconBoxStartIndex,r.verticalIconBoxEndIndex,r,!1)}}_deserializeCollisionBoxesForSymbol(t,r,n,i,o,a,s,l,u){let c={};for(let p=r;p<n;p++){let f=t.get(p);c.textBox={x1:f.x1,y1:f.y1,x2:f.x2,y2:f.y2,anchorPointX:f.anchorPointX,anchorPointY:f.anchorPointY},c.textFeatureIndex=f.featureIndex;break}for(let p=i;p<o;p++){let f=t.get(p);c.verticalTextBox={x1:f.x1,y1:f.y1,x2:f.x2,y2:f.y2,anchorPointX:f.anchorPointX,anchorPointY:f.anchorPointY},c.verticalTextFeatureIndex=f.featureIndex;break}for(let p=a;p<s;p++){let f=t.get(p);c.iconBox={x1:f.x1,y1:f.y1,x2:f.x2,y2:f.y2,anchorPointX:f.anchorPointX,anchorPointY:f.anchorPointY},c.iconFeatureIndex=f.featureIndex;break}for(let p=l;p<u;p++){let f=t.get(p);c.verticalIconBox={x1:f.x1,y1:f.y1,x2:f.x2,y2:f.y2,anchorPointX:f.anchorPointX,anchorPointY:f.anchorPointY},c.verticalIconFeatureIndex=f.featureIndex;break}return c}deserializeCollisionBoxes(t){this.collisionArrays=[];for(let r=0;r<this.symbolInstances.length;r++){let n=this.symbolInstances.get(r);this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(t,n.textBoxStartIndex,n.textBoxEndIndex,n.verticalTextBoxStartIndex,n.verticalTextBoxEndIndex,n.iconBoxStartIndex,n.iconBoxEndIndex,n.verticalIconBoxStartIndex,n.verticalIconBoxEndIndex))}}hasTextData(){return this.text.segments.get().length>0}hasIconData(){return this.icon.segments.get().length>0}hasDebugData(){return this.textCollisionBox&&this.iconCollisionBox}hasTextCollisionBoxData(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0}hasIconCollisionBoxData(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0}addIndicesForPlacedSymbol(t,r){let n=t.placedSymbolArray.get(r),i=n.vertexStartIndex+n.numGlyphs*4;for(let o=n.vertexStartIndex;o<i;o+=4)t.indexArray.emplaceBack(o,o+1,o+2),t.indexArray.emplaceBack(o+1,o+2,o+3)}getSortedSymbolIndexes(t){if(this.sortedAngle===t&&this.symbolInstanceIndexes!==void 0)return this.symbolInstanceIndexes;let r=Math.sin(t),n=Math.cos(t),i=[],o=[],a=[];for(let s=0;s<this.symbolInstances.length;++s){a.push(s);let l=this.symbolInstances.get(s);i.push(Math.round(r*l.anchorX+n*l.anchorY)|0),o.push(l.featureIndex)}return a.sort((s,l)=>i[s]-i[l]||o[l]-o[s]),a}addToSortKeyRanges(t,r){let n=this.sortKeyRanges[this.sortKeyRanges.length-1];n&&n.sortKey===r?n.symbolInstanceEnd=t+1:this.sortKeyRanges.push({sortKey:r,symbolInstanceStart:t,symbolInstanceEnd:t+1})}sortFeatures(t){if(this.sortFeaturesByY&&this.sortedAngle!==t&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(t),this.sortedAngle=t,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(let r of this.symbolInstanceIndexes){let n=this.symbolInstances.get(r);this.featureSortOrder.push(n.featureIndex),[n.rightJustifiedTextSymbolIndex,n.centerJustifiedTextSymbolIndex,n.leftJustifiedTextSymbolIndex].forEach((i,o,a)=>{i>=0&&a.indexOf(i)===o&&this.addIndicesForPlacedSymbol(this.text,i)}),n.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,n.verticalPlacedTextSymbolIndex),n.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,n.placedIconSymbolIndex),n.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,n.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}};k("SymbolBucket",We,{omit:["layers","collisionBoxArray","features","compareText"]});We.MAX_GLYPHS=65535;We.addDynamicAttributes=xp;function bp(e,t){return t.replace(/{([^{}]+)}/g,(r,n)=>n in e?String(e[n]):"")}var vp,nx=()=>vp=vp||new ie({"symbol-placement":new z(S.layout_symbol["symbol-placement"]),"symbol-spacing":new z(S.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new z(S.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new R(S.layout_symbol["symbol-sort-key"]),"symbol-z-order":new z(S.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new z(S.layout_symbol["icon-allow-overlap"]),"icon-overlap":new z(S.layout_symbol["icon-overlap"]),"icon-ignore-placement":new z(S.layout_symbol["icon-ignore-placement"]),"icon-optional":new z(S.layout_symbol["icon-optional"]),"icon-rotation-alignment":new z(S.layout_symbol["icon-rotation-alignment"]),"icon-size":new R(S.layout_symbol["icon-size"]),"icon-text-fit":new z(S.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new z(S.layout_symbol["icon-text-fit-padding"]),"icon-image":new R(S.layout_symbol["icon-image"]),"icon-rotate":new R(S.layout_symbol["icon-rotate"]),"icon-padding":new R(S.layout_symbol["icon-padding"]),"icon-keep-upright":new z(S.layout_symbol["icon-keep-upright"]),"icon-offset":new R(S.layout_symbol["icon-offset"]),"icon-anchor":new R(S.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new z(S.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new z(S.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new z(S.layout_symbol["text-rotation-alignment"]),"text-field":new R(S.layout_symbol["text-field"]),"text-font":new R(S.layout_symbol["text-font"]),"text-size":new R(S.layout_symbol["text-size"]),"text-max-width":new R(S.layout_symbol["text-max-width"]),"text-line-height":new z(S.layout_symbol["text-line-height"]),"text-letter-spacing":new R(S.layout_symbol["text-letter-spacing"]),"text-justify":new R(S.layout_symbol["text-justify"]),"text-radial-offset":new R(S.layout_symbol["text-radial-offset"]),"text-variable-anchor":new z(S.layout_symbol["text-variable-anchor"]),"text-variable-anchor-offset":new R(S.layout_symbol["text-variable-anchor-offset"]),"text-anchor":new R(S.layout_symbol["text-anchor"]),"text-max-angle":new z(S.layout_symbol["text-max-angle"]),"text-writing-mode":new z(S.layout_symbol["text-writing-mode"]),"text-rotate":new R(S.layout_symbol["text-rotate"]),"text-padding":new z(S.layout_symbol["text-padding"]),"text-keep-upright":new z(S.layout_symbol["text-keep-upright"]),"text-transform":new R(S.layout_symbol["text-transform"]),"text-offset":new R(S.layout_symbol["text-offset"]),"text-allow-overlap":new z(S.layout_symbol["text-allow-overlap"]),"text-overlap":new z(S.layout_symbol["text-overlap"]),"text-ignore-placement":new z(S.layout_symbol["text-ignore-placement"]),"text-optional":new z(S.layout_symbol["text-optional"])}),Pp,ix=()=>Pp=Pp||new ie({"icon-opacity":new R(S.paint_symbol["icon-opacity"]),"icon-color":new R(S.paint_symbol["icon-color"]),"icon-halo-color":new R(S.paint_symbol["icon-halo-color"]),"icon-halo-width":new R(S.paint_symbol["icon-halo-width"]),"icon-halo-blur":new R(S.paint_symbol["icon-halo-blur"]),"icon-translate":new z(S.paint_symbol["icon-translate"]),"icon-translate-anchor":new z(S.paint_symbol["icon-translate-anchor"]),"text-opacity":new R(S.paint_symbol["text-opacity"]),"text-color":new R(S.paint_symbol["text-color"],{runtimeType:ze,getOverride:e=>e.textColor,hasOverride:e=>!!e.textColor}),"text-halo-color":new R(S.paint_symbol["text-halo-color"]),"text-halo-width":new R(S.paint_symbol["text-halo-width"]),"text-halo-blur":new R(S.paint_symbol["text-halo-blur"]),"text-translate":new z(S.paint_symbol["text-translate"]),"text-translate-anchor":new z(S.paint_symbol["text-translate-anchor"])}),$o={get paint(){return ix()},get layout(){return nx()}};var Kn=class{constructor(t){if(t.property.overrides===void 0)throw new Error("overrides must be provided to instantiate FormatSectionOverride class");this.type=t.property.overrides?t.property.overrides.runtimeType:cr,this.defaultValue=t}evaluate(t){if(t.formattedSection){let r=this.defaultValue.property.overrides;if(r&&r.hasOverride(t.formattedSection))return r.getOverride(t.formattedSection)}return t.feature&&t.featureState?this.defaultValue.evaluate(t.feature,t.featureState):this.defaultValue.property.specification.default}eachChild(t){if(!this.defaultValue.isConstant()){let r=this.defaultValue.value;t(r._styleExpression.expression)}}outputDefined(){return!1}serialize(){return null}};k("FormatSectionOverride",Kn,{omit:["defaultValue"]});var Go=class e extends le{constructor(r){super(r,$o)}recalculate(r,n){if(super.recalculate(r,n),this.layout.get("icon-rotation-alignment")==="auto"&&(this.layout.get("symbol-placement")!=="point"?this.layout._values["icon-rotation-alignment"]="map":this.layout._values["icon-rotation-alignment"]="viewport"),this.layout.get("text-rotation-alignment")==="auto"&&(this.layout.get("symbol-placement")!=="point"?this.layout._values["text-rotation-alignment"]="map":this.layout._values["text-rotation-alignment"]="viewport"),this.layout.get("text-pitch-alignment")==="auto"&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")==="map"?"map":"viewport"),this.layout.get("icon-pitch-alignment")==="auto"&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),this.layout.get("symbol-placement")==="point"){let i=this.layout.get("text-writing-mode");if(i){let o=[];for(let a of i)o.indexOf(a)<0&&o.push(a);this.layout._values["text-writing-mode"]=o}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()}getValueAndResolveTokens(r,n,i,o){let a=this.layout.get(r).evaluate(n,{},i,o),s=this._unevaluatedLayout._values[r];return!s.isDataDriven()&&!en(s.value)&&a?bp(n.properties,a):a}createBucket(r){return new We(r)}queryRadius(){return 0}queryIntersectsFeature(){throw new Error("Should take a different path in FeatureIndex")}_setPaintOverrides(){for(let r of $o.paint.overridableProperties){if(!e.hasPaintOverride(this.layout,r))continue;let n=this.paint.get(r),i=new Kn(n),o=new Dt(i,n.property.specification),a=null;n.value.kind==="constant"||n.value.kind==="source"?a=new dt("source",o):a=new gt("composite",o,n.value.zoomStops),this.paint._values[r]=new be(n.property,a,n.parameters)}}_handleOverridablePaintPropertyUpdate(r,n,i){return!this.layout||n.isDataDriven()||i.isDataDriven()?!1:e.hasPaintOverride(this.layout,r)}static hasPaintOverride(r,n){let i=r.get("text-field"),o=$o.paint.properties[n],a=!1,s=l=>{for(let u of l)if(o.overrides&&o.overrides.hasOverride(u)){a=!0;return}};if(i.value.kind==="constant"&&i.value.value instanceof Me)s(i.value.value.sections);else if(i.value.kind==="source"){let l=c=>{if(!a)if(c instanceof mt&&fe(c.value)===pr){let p=c.value;s(p.sections)}else c instanceof Hr?s(c.sections):c.eachChild(l)},u=i.value;u._styleExpression&&l(u._styleExpression.expression)}return a}};function Sp(e,t,r,n=1){let i=e.get("icon-padding").evaluate(t,{},r),o=i&&i.values;return[o[0]*n,o[1]*n,o[2]*n,o[3]*n]}var wp,ox=()=>wp=wp||new ie({"background-color":new z(S.paint_background["background-color"]),"background-pattern":new Ot(S.paint_background["background-pattern"]),"background-opacity":new z(S.paint_background["background-opacity"])}),Ap={get paint(){return ox()}};var qo=class extends le{constructor(r){super(r,Ap)}};var _p,ax=()=>_p=_p||new ie({"raster-opacity":new z(S.paint_raster["raster-opacity"]),"raster-hue-rotate":new z(S.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new z(S.paint_raster["raster-brightness-min"]),"raster-brightness-max":new z(S.paint_raster["raster-brightness-max"]),"raster-saturation":new z(S.paint_raster["raster-saturation"]),"raster-contrast":new z(S.paint_raster["raster-contrast"]),"raster-resampling":new z(S.paint_raster["raster-resampling"]),"raster-fade-duration":new z(S.paint_raster["raster-fade-duration"])}),Ip={get paint(){return ax()}};var jo=class extends le{constructor(r){super(r,Ip)}};var Zo=class extends le{constructor(r){super(r,{});this.onAdd=r=>{this.implementation.onAdd&&this.implementation.onAdd(r,r.painter.context.gl)};this.onRemove=r=>{this.implementation.onRemove&&this.implementation.onRemove(r,r.painter.context.gl)};this.implementation=r}is3D(){return this.implementation.renderingMode==="3d"}hasOffscreenPass(){return this.implementation.prerender!==void 0}recalculate(){}updateTransitions(){}hasTransition(){return!1}serialize(){throw new Error("Custom layers cannot be serialized")}};function Cp(e){if(e.type==="custom")return new Zo(e);switch(e.type){case"background":return new qo(e);case"circle":return new Po(e);case"fill":return new ko(e);case"fill-extrusion":return new Fo(e);case"heatmap":return new So(e);case"hillshade":return new wo(e);case"line":return new Lo(e);case"raster":return new jo(e);case"symbol":return new Go(e)}}var Jo=class{constructor(t){this.keyCache={},t&&this.replace(t)}replace(t){this._layerConfigs={},this._layers={},this.update(t,[])}update(t,r){for(let i of t){this._layerConfigs[i.id]=i;let o=this._layers[i.id]=Cp(i);o._featureFilter=tn(o.filter),this.keyCache[i.id]&&delete this.keyCache[i.id]}for(let i of r)delete this.keyCache[i],delete this._layerConfigs[i],delete this._layers[i];this.familiesBySource={};let n=Ql(Object.values(this._layerConfigs),this.keyCache);for(let i of n){let o=i.map(p=>this._layers[p.id]),a=o[0];if(a.visibility==="none")continue;let s=a.source||"",l=this.familiesBySource[s];l||(l=this.familiesBySource[s]={});let u=a.sourceLayer||"_geojsonTileLayer",c=l[u];c||(c=l[u]=[]),c.push(o)}}};var Xp=Z(It(),1),Qp=Z($n(),1);var Fr=class{constructor(t){this._stringToNumber={},this._numberToString=[];for(let r=0;r<t.length;r++){let n=t[r];this._stringToNumber[n]=r,this._numberToString[r]=n}}encode(t){return this._stringToNumber[t]}decode(t){if(t>=this._numberToString.length)throw new Error("Out of bounds. Index requested n=".concat(t," can\'t be >= this._numberToString.length ").concat(this._numberToString.length));return this._numberToString[t]}};var Ep=Z(It(),1),Fp=Z($n(),1);var Wo=class{constructor(t,r,n,i,o){this.type="Feature",this._vectorTileFeature=t,t._z=r,t._x=n,t._y=i,this.properties=t.properties,this.id=o}get geometry(){return this._geometry===void 0&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z).geometry),this._geometry}set geometry(t){this._geometry=t}toJSON(){let t={geometry:this.geometry};for(let r in this)r==="_geometry"||r==="_vectorTileFeature"||(t[r]=this[r]);return t}};var Yn=class{constructor(t,r){this.tileID=t,this.x=t.canonical.x,this.y=t.canonical.y,this.z=t.canonical.z,this.grid=new Ft(8192,16,0),this.grid3D=new Ft(8192,16,0),this.featureIndexArray=new Cn,this.promoteId=r}insert(t,r,n,i,o,a){let s=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(n,i,o);let l=a?this.grid3D:this.grid;for(let u=0;u<r.length;u++){let c=r[u],p=[1/0,1/0,-1/0,-1/0];for(let f=0;f<c.length;f++){let y=c[f];p[0]=Math.min(p[0],y.x),p[1]=Math.min(p[1],y.y),p[2]=Math.max(p[2],y.x),p[3]=Math.max(p[3],y.y)}p[0]<8192&&p[1]<8192&&p[2]>=0&&p[3]>=0&&l.insert(s,p[0],p[1],p[2],p[3])}}loadVTLayers(){return this.vtLayers||(this.vtLayers=new Ep.default.VectorTile(new Fp.default(this.rawTileData)).layers,this.sourceLayerCoder=new Fr(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers}query(t,r,n,i){this.loadVTLayers();let o=t.params||{},a=8192/t.tileSize/t.scale,s=tn(o.filter),l=t.queryGeometry,u=t.queryPadding*a,c=Tp(l),p=this.grid.query(c.minX-u,c.minY-u,c.maxX+u,c.maxY+u),f=Tp(t.cameraQueryGeometry),y=this.grid3D.query(f.minX-u,f.minY-u,f.maxX+u,f.maxY+u,(d,g,v,b)=>ju(t.cameraQueryGeometry,d-u,g-u,v+u,b+u));for(let d of y)p.push(d);p.sort(sx);let m={},h;for(let d=0;d<p.length;d++){let g=p[d];if(g===h)continue;h=g;let v=this.featureIndexArray.get(g),b=null;this.loadMatchingFeature(m,v.bucketIndex,v.sourceLayerIndex,v.featureIndex,s,o.layers,o.availableImages,r,n,i,(x,P,w)=>(b||(b=Te(x)),P.queryIntersectsFeature(l,x,w,b,this.z,t.transform,a,t.pixelPosMatrix)))}return m}loadMatchingFeature(t,r,n,i,o,a,s,l,u,c,p){let f=this.bucketLayerIDs[r];if(a&&!gl(a,f))return;let y=this.sourceLayerCoder.decode(n),h=this.vtLayers[y].feature(i);if(o.needGeometry){let g=Oe(h,!0);if(!o.filter(new q(this.tileID.overscaledZ),g,this.tileID.canonical))return}else if(!o.filter(new q(this.tileID.overscaledZ),h))return;let d=this.getId(h,y);for(let g=0;g<f.length;g++){let v=f[g];if(a&&a.indexOf(v)<0)continue;let b=l[v];if(!b)continue;let x={};d&&c&&(x=c.getState(b.sourceLayer||"_geojsonTileLayer",d));let P=Ae({},u[v]);P.paint=kp(P.paint,b.paint,h,x,s),P.layout=kp(P.layout,b.layout,h,x,s);let w=!p||p(h,b,x);if(!w)continue;let A=new Wo(h,this.z,this.x,this.y,d);A.layer=P;let T=t[v];T===void 0&&(T=t[v]=[]),T.push({featureIndex:i,feature:A,intersectionZ:w})}}lookupSymbolFeatures(t,r,n,i,o,a,s,l){let u={};this.loadVTLayers();let c=tn(o);for(let p of t)this.loadMatchingFeature(u,n,i,p,c,a,s,l,r);return u}hasLayer(t){for(let r of this.bucketLayerIDs)for(let n of r)if(t===n)return!0;return!1}getId(t,r){let n=t.id;if(this.promoteId){let i=typeof this.promoteId=="string"?this.promoteId:this.promoteId[r];n=t.properties[i],typeof n=="boolean"&&(n=Number(n))}return n}};k("FeatureIndex",Yn,{omit:["rawTileData","sourceLayerCoder"]});function kp(e,t,r,n,i){return Rr(e,(o,a)=>{let s=t instanceof vt?t.get(a):null;return s&&s.evaluate?s.evaluate(r,n,i):s})}function Tp(e){let t=1/0,r=1/0,n=-1/0,i=-1/0;for(let o of e)t=Math.min(t,o.x),r=Math.min(r,o.y),n=Math.max(n,o.x),i=Math.max(i,o.y);return{minX:t,minY:r,maxX:n,maxY:i}}function sx(e,t){return t-e}var Mp=Z(he(),1);var et=class e extends Mp.default{constructor(r,n,i,o){super(r,n);this.angle=i,o!==void 0&&(this.segment=o)}clone(){return new e(this.x,this.y,this.angle,this.segment)}};k("Anchor",et);function Ts(e,t,r,n,i){if(t.segment===void 0||r===0)return!0;let o=t,a=t.segment+1,s=0;for(;s>-r/2;){if(a--,a<0)return!1;s-=e[a].dist(o),o=e[a]}s+=e[a].dist(e[a+1]),a++;let l=[],u=0;for(;s<r/2;){let c=e[a-1],p=e[a],f=e[a+1];if(!f)return!1;let y=c.angleTo(p)-p.angleTo(f);for(y=Math.abs((y+3*Math.PI)%(Math.PI*2)-Math.PI),l.push({distance:s,angleDelta:y}),u+=y;s-l[0].distance>n;)u-=l.shift().angleDelta;if(u>i)return!1;a++,s+=p.dist(f)}return!0}function Lp(e){let t=0;for(let r=0;r<e.length-1;r++)t+=e[r].dist(e[r+1]);return t}function Dp(e,t,r){return e?3/5*t*r:0}function Vp(e,t){return Math.max(e?e.right-e.left:0,t?t.right-t.left:0)}function Bp(e,t,r,n,i,o){let a=Dp(r,i,o),s=Vp(r,n)*o,l=0,u=Lp(e)/2;for(let c=0;c<e.length-1;c++){let p=e[c],f=e[c+1],y=p.dist(f);if(l+y>u){let m=(u-l)/y,h=Re.number(p.x,f.x,m),d=Re.number(p.y,f.y,m),g=new et(h,d,f.angleTo(p),c);return g._round(),!a||Ts(e,g,s,a,t)?g:void 0}l+=y}}function zp(e,t,r,n,i,o,a,s,l){let u=Dp(n,o,a),c=Vp(n,i),p=c*a,f=e[0].x===0||e[0].x===l||e[0].y===0||e[0].y===l;t-p<t/4&&(t=p+t/4);let y=o*2,m=f?t/2*s%t:(c/2+y)*a*s%t;return Rp(e,m,t,u,r,p,f,!1,l)}function Rp(e,t,r,n,i,o,a,s,l){let u=o/2,c=Lp(e),p=0,f=t-r,y=[];for(let m=0;m<e.length-1;m++){let h=e[m],d=e[m+1],g=h.dist(d),v=d.angleTo(h);for(;f+r<p+g;){f+=r;let b=(f-p)/g,x=Re.number(h.x,d.x,b),P=Re.number(h.y,d.y,b);if(x>=0&&x<l&&P>=0&&P<l&&f-u>=0&&f+u<=c){let w=new et(x,P,v,m);w._round(),(!n||Ts(e,w,o,n,i))&&y.push(w)}}p+=g}return!s&&!y.length&&!a&&(y=Rp(e,p/2,r,n,i,o,a,!0,l)),y}var ct=Z(he(),1);function Op(e,t,r,n,i){let o=[];for(let a=0;a<e.length;a++){let s=e[a],l;for(let u=0;u<s.length-1;u++){let c=s[u],p=s[u+1];c.x<t&&p.x<t||(c.x<t?c=new ct.default(t,c.y+(p.y-c.y)*((t-c.x)/(p.x-c.x)))._round():p.x<t&&(p=new ct.default(t,c.y+(p.y-c.y)*((t-c.x)/(p.x-c.x)))._round()),!(c.y<r&&p.y<r)&&(c.y<r?c=new ct.default(c.x+(p.x-c.x)*((r-c.y)/(p.y-c.y)),r)._round():p.y<r&&(p=new ct.default(c.x+(p.x-c.x)*((r-c.y)/(p.y-c.y)),r)._round()),!(c.x>=n&&p.x>=n)&&(c.x>=n?c=new ct.default(n,c.y+(p.y-c.y)*((n-c.x)/(p.x-c.x)))._round():p.x>=n&&(p=new ct.default(n,c.y+(p.y-c.y)*((n-c.x)/(p.x-c.x)))._round()),!(c.y>=i&&p.y>=i)&&(c.y>=i?c=new ct.default(c.x+(p.x-c.x)*((i-c.y)/(p.y-c.y)),i)._round():p.y>=i&&(p=new ct.default(c.x+(p.x-c.x)*((i-c.y)/(p.y-c.y)),i)._round()),(!l||!c.equals(l[l.length-1]))&&(l=[c],o.push(l)),l.push(p)))))}}return o}var ve=Z(he(),1);var Mr=ge;function Es(e,t,r,n){let i=[],o=e.image,a=o.pixelRatio,s=o.paddedRect.w-2*Mr,l=o.paddedRect.h-2*Mr,u=e.right-e.left,c=e.bottom-e.top,p=o.stretchX||[[0,s]],f=o.stretchY||[[0,l]],y=(_,F)=>_+F[1]-F[0],m=p.reduce(y,0),h=f.reduce(y,0),d=s-m,g=l-h,v=0,b=m,x=0,P=h,w=0,A=d,T=0,I=g;if(o.content&&n){let _=o.content;v=Ho(p,0,_[0]),x=Ho(f,0,_[1]),b=Ho(p,_[0],_[2]),P=Ho(f,_[1],_[3]),w=_[0]-v,T=_[1]-x,A=_[2]-_[0]-b,I=_[3]-_[1]-P}let E=(_,F,M,B)=>{let C=Ko(_.stretch-v,b,u,e.left),O=Yo(_.fixed-w,A,_.stretch,m),N=Ko(F.stretch-x,P,c,e.top),K=Yo(F.fixed-T,I,F.stretch,h),Y=Ko(M.stretch-v,b,u,e.left),Q=Yo(M.fixed-w,A,M.stretch,m),ye=Ko(B.stretch-x,P,c,e.top),_e=Yo(B.fixed-T,I,B.stretch,h),re=new ve.default(C,N),Pe=new ve.default(Y,N),$e=new ve.default(Y,ye),fi=new ve.default(C,ye),ya=new ve.default(O/a,K/a),ma=new ve.default(Q/a,_e/a),zr=t*Math.PI/180;if(zr){let xe=Math.sin(zr),He=Math.cos(zr),Ke=[He,-xe,xe,He];re._matMult(Ke),Pe._matMult(Ke),fi._matMult(Ke),$e._matMult(Ke)}let yi=_.stretch+_.fixed,ha=M.stretch+M.fixed,mi=F.stretch+F.fixed,Ee=B.stretch+B.fixed,tr={x:o.paddedRect.x+Mr+yi,y:o.paddedRect.y+Mr+mi,w:ha-yi,h:Ee-mi},hi=A/a/u,Se=I/a/c;return{tl:re,tr:Pe,bl:fi,br:$e,tex:tr,writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:ya,pixelOffsetBR:ma,minFontScaleX:hi,minFontScaleY:Se,isSDF:r}};if(!n||!o.stretchX&&!o.stretchY)i.push(E({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:s+1},{fixed:0,stretch:l+1}));else{let _=Np(p,d,m),F=Np(f,g,h);for(let M=0;M<_.length-1;M++){let B=_[M],C=_[M+1];for(let O=0;O<F.length-1;O++){let N=F[O],K=F[O+1];i.push(E(B,N,C,K))}}}return i}function Ho(e,t,r){let n=0;for(let i of e)n+=Math.max(t,Math.min(r,i[1]))-Math.max(t,Math.min(r,i[0]));return n}function Np(e,t,r){let n=[{fixed:-Mr,stretch:0}];for(let[i,o]of e){let a=n[n.length-1];n.push({fixed:i-a.stretch,stretch:a.stretch}),n.push({fixed:i-a.stretch,stretch:a.stretch+(o-i)})}return n.push({fixed:t+Mr,stretch:r}),n}function Ko(e,t,r,n){return e/t*r+n}function Yo(e,t,r,n){return e-t*r/n}function Up(e,t,r,n,i,o,a,s){let l=n.layout.get("text-rotate").evaluate(o,{})*Math.PI/180,u=[];for(let c of t.positionedLines)for(let p of c.positionedGlyphs){if(!p.rect)continue;let f=p.rect||{},m=Bo+1,h=!0,d=1,g=0,v=(i||s)&&p.vertical,b=p.metrics.advance*p.scale/2;if(s&&t.verticalizable){let Y=(p.scale-1)*ue,Q=(ue-p.metrics.width*p.scale)/2;g=c.lineOffset/2-(p.imageName?-Q:Y)}if(p.imageName){let Y=a[p.imageName];h=Y.sdf,d=Y.pixelRatio,m=ge/d}let x=i?[p.x+b,p.y]:[0,0],P=i?[0,0]:[p.x+b+r[0],p.y+r[1]-g],w=[0,0];v&&(w=P,P=[0,0]);let A=(p.metrics.left-m)*p.scale-b+P[0],T=(-p.metrics.top-m)*p.scale+P[1],I=A+f.w*p.scale/d,E=T+f.h*p.scale/d,_=new ve.default(A,T),F=new ve.default(I,T),M=new ve.default(A,E),B=new ve.default(I,E);if(v){let Y=new ve.default(-b,b-Tr),Q=-Math.PI/2,ye=ue/2-b,_e=p.imageName?ye:0,re=new ve.default(5-Tr-ye,-_e),Pe=new ve.default(...w);_._rotateAround(Q,Y)._add(re)._add(Pe),F._rotateAround(Q,Y)._add(re)._add(Pe),M._rotateAround(Q,Y)._add(re)._add(Pe),B._rotateAround(Q,Y)._add(re)._add(Pe)}if(l){let Y=Math.sin(l),Q=Math.cos(l),ye=[Q,-Y,Y,Q];_._matMult(ye),F._matMult(ye),M._matMult(ye),B._matMult(ye)}let C=new ve.default(0,0),O=new ve.default(0,0),N=0,K=0;u.push({tl:_,tr:F,bl:M,br:B,tex:f,writingMode:t.writingMode,glyphOffset:x,sectionIndex:p.sectionIndex,isSDF:h,pixelOffsetTL:C,pixelOffsetBR:O,minFontScaleX:N,minFontScaleY:K})}return u}var Xn=Z(he(),1),Qt=class{constructor(t,r,n,i,o,a,s,l,u,c){if(this.boxStartIndex=t.length,u){let p=a.top,f=a.bottom,y=a.collisionPadding;y&&(p-=y[1],f+=y[3]);let m=f-p;m>0&&(m=Math.max(10,m),this.circleDiameter=m)}else{let p=a.top*s-l[0],f=a.bottom*s+l[2],y=a.left*s-l[3],m=a.right*s+l[1],h=a.collisionPadding;if(h&&(y-=h[0]*s,p-=h[1]*s,m+=h[2]*s,f+=h[3]*s),c){let d=new Xn.default(y,p),g=new Xn.default(m,p),v=new Xn.default(y,f),b=new Xn.default(m,f),x=c*Math.PI/180;d._rotate(x),g._rotate(x),v._rotate(x),b._rotate(x),y=Math.min(d.x,g.x,v.x,b.x),m=Math.max(d.x,g.x,v.x,b.x),p=Math.min(d.y,g.y,v.y,b.y),f=Math.max(d.y,g.y,v.y,b.y)}t.emplaceBack(r.x,r.y,y,p,m,f,n,i,o)}this.boxEndIndex=t.length}};var Qn=class{constructor(t=[],r=lx){if(this.data=t,this.length=this.data.length,this.compare=r,this.length>0)for(let n=(this.length>>1)-1;n>=0;n--)this._down(n)}push(t){this.data.push(t),this.length++,this._up(this.length-1)}pop(){if(this.length===0)return;let t=this.data[0],r=this.data.pop();return this.length--,this.length>0&&(this.data[0]=r,this._down(0)),t}peek(){return this.data[0]}_up(t){let{data:r,compare:n}=this,i=r[t];for(;t>0;){let o=t-1>>1,a=r[o];if(n(i,a)>=0)break;r[t]=a,t=o}r[t]=i}_down(t){let{data:r,compare:n}=this,i=this.length>>1,o=r[t];for(;t<i;){let a=(t<<1)+1,s=r[a],l=a+1;if(l<this.length&&n(r[l],s)<0&&(a=l,s=r[l]),n(s,o)>=0)break;r[t]=s,t=a}r[t]=o}};function lx(e,t){return e<t?-1:e>t?1:0}var Fs=Z(he(),1);function $p(e,t=1,r=!1){let n=1/0,i=1/0,o=-1/0,a=-1/0,s=e[0];for(let h=0;h<s.length;h++){let d=s[h];(!h||d.x<n)&&(n=d.x),(!h||d.y<i)&&(i=d.y),(!h||d.x>o)&&(o=d.x),(!h||d.y>a)&&(a=d.y)}let l=o-n,u=a-i,c=Math.min(l,u),p=c/2,f=new Qn([],ux);if(c===0)return new Fs.default(n,i);for(let h=n;h<o;h+=c)for(let d=i;d<a;d+=c)f.push(new Lr(h+p,d+p,p,e));let y=px(e),m=f.length;for(;f.length;){let h=f.pop();(h.d>y.d||!y.d)&&(y=h,r&&console.log("found best %d after %d probes",Math.round(1e4*h.d)/1e4,m)),!(h.max-y.d<=t)&&(p=h.h/2,f.push(new Lr(h.p.x-p,h.p.y-p,p,e)),f.push(new Lr(h.p.x+p,h.p.y-p,p,e)),f.push(new Lr(h.p.x-p,h.p.y+p,p,e)),f.push(new Lr(h.p.x+p,h.p.y+p,p,e)),m+=4)}return r&&(console.log("num probes: ".concat(m)),console.log("best distance: ".concat(y.d))),y.p}function ux(e,t){return t.max-e.max}function Lr(e,t,r,n){this.p=new Fs.default(e,t),this.h=r,this.d=cx(this.p,n),this.max=this.d+this.h*Math.SQRT2}function cx(e,t){let r=!1,n=1/0;for(let i=0;i<t.length;i++){let o=t[i];for(let a=0,s=o.length,l=s-1;a<s;l=a++){let u=o[a],c=o[l];u.y>e.y!=c.y>e.y&&e.x<(c.x-u.x)*(e.y-u.y)/(c.y-u.y)+u.x&&(r=!r),n=Math.min(n,ls(e,u,c))}}return(r?1:-1)*Math.sqrt(n)}function px(e){let t=0,r=0,n=0,i=e[0];for(let o=0,a=i.length,s=a-1;o<a;s=o++){let l=i[o],u=i[s],c=l.x*u.y-u.x*l.y;r+=(l.x+u.x)*c,n+=(l.y+u.y)*c,t+=c*3}return new Lr(r/t,n/t,0,e)}var Ms=Z(rs(),1);var Dr=7,Ls=Number.POSITIVE_INFINITY;function fx(e,t){function r(i,o){let a=0,s=0;o<0&&(o=0);let l=o/Math.sqrt(2);switch(i){case"top-right":case"top-left":s=l-Dr;break;case"bottom-right":case"bottom-left":s=-l+Dr;break;case"bottom":s=-o+Dr;break;case"top":s=o-Dr;break}switch(i){case"top-right":case"bottom-right":a=-l;break;case"top-left":case"bottom-left":a=l;break;case"left":a=o;break;case"right":a=-o;break}return[a,s]}function n(i,o,a){let s=0,l=0;switch(o=Math.abs(o),a=Math.abs(a),i){case"top-right":case"top-left":case"top":l=a-Dr;break;case"bottom-right":case"bottom-left":case"bottom":l=-a+Dr;break}switch(i){case"top-right":case"bottom-right":case"right":s=-o;break;case"top-left":case"bottom-left":case"left":s=o;break}return[s,l]}return t[1]!==Ls?n(e,t[0],t[1]):r(e,t[0])}function jp(e){e.bucket.createArrays();let t=512*e.bucket.overscaling;e.bucket.tilePixelRatio=8192/t,e.bucket.compareText={},e.bucket.iconsNeedLinear=!1;let r=e.bucket.layers[0].layout,n=e.bucket.layers[0]._unevaluatedLayout._values,i={layoutIconSize:n["icon-size"].possiblyEvaluate(new q(e.bucket.zoom+1),e.canonical),layoutTextSize:n["text-size"].possiblyEvaluate(new q(e.bucket.zoom+1),e.canonical),textMaxSize:n["text-size"].possiblyEvaluate(new q(18))};if(e.bucket.textSizeData.kind==="composite"){let{minZoom:u,maxZoom:c}=e.bucket.textSizeData;i.compositeTextSizes=[n["text-size"].possiblyEvaluate(new q(u),e.canonical),n["text-size"].possiblyEvaluate(new q(c),e.canonical)]}if(e.bucket.iconSizeData.kind==="composite"){let{minZoom:u,maxZoom:c}=e.bucket.iconSizeData;i.compositeIconSizes=[n["icon-size"].possiblyEvaluate(new q(u),e.canonical),n["icon-size"].possiblyEvaluate(new q(c),e.canonical)]}let o=r.get("text-line-height")*ue,a=r.get("text-rotation-alignment")!=="viewport"&&r.get("symbol-placement")!=="point",s=r.get("text-keep-upright"),l=r.get("text-size");for(let u of e.bucket.features){let c=r.get("text-font").evaluate(u,{},e.canonical).join(","),p=l.evaluate(u,{},e.canonical),f=i.layoutTextSize.evaluate(u,{},e.canonical),y=i.layoutIconSize.evaluate(u,{},e.canonical),m={horizontal:{},vertical:void 0},h=u.text,d=[0,0];if(h){let x=h.toString(),P=r.get("text-letter-spacing").evaluate(u,{},e.canonical)*ue,w=wu(x)?P:0,A=r.get("text-anchor").evaluate(u,{},e.canonical),T=r.get("text-variable-anchor");if(!T){let M=r.get("text-radial-offset").evaluate(u,{},e.canonical);M?d=fx(A,[M*ue,Ls]):d=r.get("text-offset").evaluate(u,{},e.canonical).map(B=>B*ue)}let I=a?"center":r.get("text-justify").evaluate(u,{},e.canonical),E=r.get("symbol-placement"),_=E==="point"?r.get("text-max-width").evaluate(u,{},e.canonical)*ue:0,F=()=>{e.bucket.allowVerticalPlacement&&on(x)&&(m.vertical=Zn(h,e.glyphMap,e.glyphPositions,e.imagePositions,c,_,o,A,"left",w,d,2,!0,E,f,p))};if(!a&&T){let M=I==="auto"?T.map(C=>Gp(C)):[I],B=!1;for(let C=0;C<M.length;C++){let O=M[C];if(!m.horizontal[O])if(B)m.horizontal[O]=m.horizontal[0];else{let N=Zn(h,e.glyphMap,e.glyphPositions,e.imagePositions,c,_,o,"center",O,w,d,1,!1,E,f,p);N&&(m.horizontal[O]=N,B=N.positionedLines.length===1)}}F()}else{I==="auto"&&(I=Gp(A));let M=Zn(h,e.glyphMap,e.glyphPositions,e.imagePositions,c,_,o,A,I,w,d,1,!1,E,f,p);M&&(m.horizontal[I]=M),F(),on(x)&&a&&s&&(m.vertical=Zn(h,e.glyphMap,e.glyphPositions,e.imagePositions,c,_,o,A,I,w,d,2,!1,E,f,p))}}let g,v=!1;if(u.icon&&u.icon.name){let x=e.imageMap[u.icon.name];x&&(g=dp(e.imagePositions[u.icon.name],r.get("icon-offset").evaluate(u,{},e.canonical),r.get("icon-anchor").evaluate(u,{},e.canonical)),v=!!x.sdf,e.bucket.sdfIcons===void 0?e.bucket.sdfIcons=v:e.bucket.sdfIcons!==v&&ce("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),(x.pixelRatio!==e.bucket.pixelRatio||r.get("icon-rotate").constantOr(1)!==0)&&(e.bucket.iconsNeedLinear=!0))}let b=Zp(m.horizontal)||m.vertical;e.bucket.iconsInText=b?b.iconsInText:!1,(b||g)&&yx(e.bucket,u,m,g,e.imageMap,i,f,y,d,v,e.canonical)}e.showCollisionBoxes&&e.bucket.generateCollisionDebugBuffers()}function Gp(e){switch(e){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function yx(e,t,r,n,i,o,a,s,l,u,c){let p=o.textMaxSize.evaluate(t,{});p===void 0&&(p=a);let f=e.layers[0].layout,y=f.get("icon-offset").evaluate(t,{},c),m=Zp(r.horizontal),h=24,d=a/h,g=e.tilePixelRatio*d,v=e.tilePixelRatio*p/h,b=e.tilePixelRatio*s,x=e.tilePixelRatio*f.get("symbol-spacing"),P=f.get("text-padding")*e.tilePixelRatio,w=Sp(f,t,c,e.tilePixelRatio),A=f.get("text-max-angle")/180*Math.PI,T=f.get("text-rotation-alignment")!=="viewport"&&f.get("symbol-placement")!=="point",I=f.get("icon-rotation-alignment")==="map"&&f.get("symbol-placement")!=="point",E=f.get("symbol-placement"),_=x/2,F=f.get("icon-text-fit"),M;n&&F!=="none"&&(e.allowVerticalPlacement&&r.vertical&&(M=Is(n,r.vertical,F,f.get("icon-text-fit-padding"),y,d)),m&&(n=Is(n,m,F,f.get("icon-text-fit-padding"),y,d)));let B=(C,O)=>{O.x<0||O.x>=8192||O.y<0||O.y>=8192||mx(e,O,C,r,n,i,M,e.layers[0],e.collisionBoxArray,t.index,t.sourceLayerIndex,e.index,g,[P,P,P,P],T,l,b,w,I,y,t,o,u,c,a)};if(E==="line")for(let C of Op(t.geometry,0,0,8192,8192)){let O=zp(C,x,A,r.vertical||m,n,h,v,e.overscaling,8192);for(let N of O){let K=m;(!K||!hx(e,K.text,_,N))&&B(C,N)}}else if(E==="line-center"){for(let C of t.geometry)if(C.length>1){let O=Bp(C,A,r.vertical||m,n,h,v);O&&B(C,O)}}else if(t.type==="Polygon")for(let C of Sr(t.geometry,0)){let O=$p(C,16);B(C[0],new et(O.x,O.y,0))}else if(t.type==="LineString")for(let C of t.geometry)B(C,new et(C[0].x,C[0].y,0));else if(t.type==="Point")for(let C of t.geometry)for(let O of C)B([O],new et(O.x,O.y,0))}function qp(e,t,r,n,i,o,a,s,l,u,c,p,f,y,m){let h=Up(t,r,s,i,o,a,n,e.allowVerticalPlacement),d=e.textSizeData,g=null;d.kind==="source"?(g=[Ct*i.layout.get("text-size").evaluate(a,{})],g[0]>Qe&&ce("".concat(e.layerIds[0],\': Value for "text-size" is >= \').concat(Er,\'. Reduce your "text-size".\'))):d.kind==="composite"&&(g=[Ct*y.compositeTextSizes[0].evaluate(a,{},m),Ct*y.compositeTextSizes[1].evaluate(a,{},m)],(g[0]>Qe||g[1]>Qe)&&ce("".concat(e.layerIds[0],\': Value for "text-size" is >= \').concat(Er,\'. Reduce your "text-size".\'))),e.addSymbols(e.text,h,g,s,o,a,u,t,l.lineStartIndex,l.lineLength,f,m);for(let v of c)p[v]=e.text.placedSymbolArray.length-1;return h.length*4}function Zp(e){for(let t in e)return e[t];return null}function mx(e,t,r,n,i,o,a,s,l,u,c,p,f,y,m,h,d,g,v,b,x,P,w,A,T){let I=e.addToLineVertexArray(t,r),E,_,F,M,B=0,C=0,O=0,N=0,K=-1,Y=-1,Q={},ye=(0,Ms.default)(""),_e=0,re=0;if(s._unevaluatedLayout.getValue("text-radial-offset")===void 0?[_e,re]=s.layout.get("text-offset").evaluate(x,{},A).map(Se=>Se*ue):(_e=s.layout.get("text-radial-offset").evaluate(x,{},A)*ue,re=Ls),e.allowVerticalPlacement&&n.vertical){let xe=s.layout.get("text-rotate").evaluate(x,{},A)+90,He=n.vertical;F=new Qt(l,t,u,c,p,He,f,y,m,xe),a&&(M=new Qt(l,t,u,c,p,a,d,g,m,xe))}if(i){let Se=s.layout.get("icon-rotate").evaluate(x,{}),xe=s.layout.get("icon-text-fit")!=="none",He=Es(i,Se,w,xe),Ke=a?Es(a,Se,w,xe):void 0;_=new Qt(l,t,u,c,p,i,d,g,!1,Se),B=He.length*4;let al=e.iconSizeData,Et=null;al.kind==="source"?(Et=[Ct*s.layout.get("icon-size").evaluate(x,{})],Et[0]>Qe&&ce("".concat(e.layerIds[0],\': Value for "icon-size" is >= \').concat(Er,\'. Reduce your "icon-size".\'))):al.kind==="composite"&&(Et=[Ct*P.compositeIconSizes[0].evaluate(x,{},A),Ct*P.compositeIconSizes[1].evaluate(x,{},A)],(Et[0]>Qe||Et[1]>Qe)&&ce("".concat(e.layerIds[0],\': Value for "icon-size" is >= \').concat(Er,\'. Reduce your "icon-size".\'))),e.addSymbols(e.icon,He,Et,b,v,x,0,t,I.lineStartIndex,I.lineLength,-1,A),K=e.icon.placedSymbolArray.length-1,Ke&&(C=Ke.length*4,e.addSymbols(e.icon,Ke,Et,b,v,x,2,t,I.lineStartIndex,I.lineLength,-1,A),Y=e.icon.placedSymbolArray.length-1)}let Pe=Object.keys(n.horizontal);for(let Se of Pe){let xe=n.horizontal[Se];if(!E){ye=(0,Ms.default)(xe.text);let Ke=s.layout.get("text-rotate").evaluate(x,{},A);E=new Qt(l,t,u,c,p,xe,f,y,m,Ke)}let He=xe.positionedLines.length===1;if(O+=qp(e,t,xe,o,s,m,x,h,I,n.vertical?1:3,He?Pe:[Se],Q,K,P,A),He)break}n.vertical&&(N+=qp(e,t,n.vertical,o,s,m,x,h,I,2,["vertical"],Q,Y,P,A));let $e=E?E.boxStartIndex:e.collisionBoxArray.length,fi=E?E.boxEndIndex:e.collisionBoxArray.length,ya=F?F.boxStartIndex:e.collisionBoxArray.length,ma=F?F.boxEndIndex:e.collisionBoxArray.length,zr=_?_.boxStartIndex:e.collisionBoxArray.length,yi=_?_.boxEndIndex:e.collisionBoxArray.length,ha=M?M.boxStartIndex:e.collisionBoxArray.length,mi=M?M.boxEndIndex:e.collisionBoxArray.length,Ee=-1,tr=(Se,xe)=>Se&&Se.circleDiameter?Math.max(Se.circleDiameter,xe):xe;Ee=tr(E,Ee),Ee=tr(F,Ee),Ee=tr(_,Ee),Ee=tr(M,Ee);let hi=Ee>-1?1:0;hi&&(Ee*=T/ue),e.glyphOffsetArray.length>=We.MAX_GLYPHS&&ce("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),x.sortKey!==void 0&&e.addToSortKeyRanges(e.symbolInstances.length,x.sortKey),e.symbolInstances.emplaceBack(t.x,t.y,Q.right>=0?Q.right:-1,Q.center>=0?Q.center:-1,Q.left>=0?Q.left:-1,Q.vertical||-1,K,Y,ye,$e,fi,ya,ma,zr,yi,ha,mi,u,O,N,B,C,hi,0,f,_e,re,Ee)}function hx(e,t,r,n){let i=e.compareText;if(!(t in i))i[t]=[];else{let o=i[t];for(let a=o.length-1;a>=0;a--)if(n.dist(o[a])<r)return!0}return i[t].push(n),!1}var Xo=1,ei=class{constructor(t){let r={},n=[];for(let s in t){let l=t[s],u=r[s]={};for(let c in l){let p=l[+c];if(!p||p.bitmap.width===0||p.bitmap.height===0)continue;let f={x:0,y:0,w:p.bitmap.width+2*Xo,h:p.bitmap.height+2*Xo};n.push(f),u[c]={rect:f,metrics:p.metrics}}}let{w:i,h:o}=Gn(n),a=new Wt({width:i||1,height:o||1});for(let s in t){let l=t[s];for(let u in l){let c=l[+u];if(!c||c.bitmap.width===0||c.bitmap.height===0)continue;let p=r[s][u].rect;Wt.copy(c.bitmap,a,{x:0,y:0},{x:p.x+Xo,y:p.y+Xo},c.bitmap)}}this.image=a,this.positions=r}};k("GlyphAtlas",ei);function Wp(e,t,r){t=Math.pow(2,r)-t-1;var n=Jp(e*256,t*256,r),i=Jp((e+1)*256,(t+1)*256,r);return n[0]+","+n[1]+","+i[0]+","+i[1]}function Jp(e,t,r){var n=2*Math.PI*6378137/256/Math.pow(2,r),i=e*n-2*Math.PI*6378137/2,o=t*n-2*Math.PI*6378137/2;return[i,o]}var Yp=Z(he(),1);var Ds=63710088e-1,ti=class e{constructor(t,r){if(isNaN(t)||isNaN(r))throw new Error("Invalid LngLat object: (".concat(t,", ").concat(r,")"));if(this.lng=+t,this.lat=+r,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new e(ml(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return"LngLat(".concat(this.lng,", ").concat(this.lat,")")}distanceTo(t){let r=Math.PI/180,n=this.lat*r,i=t.lat*r,o=Math.sin(n)*Math.sin(i)+Math.cos(n)*Math.cos(i)*Math.cos((t.lng-this.lng)*r);return Ds*Math.acos(Math.min(o,1))}static convert(t){if(t instanceof e)return t;if(Array.isArray(t)&&(t.length===2||t.length===3))return new e(Number(t[0]),Number(t[1]));if(!Array.isArray(t)&&typeof t=="object"&&t!==null)return new e(Number("lng"in t?t.lng:t.lon),Number(t.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: <lng>, lat: <lat>}, an object {lon: <lng>, lat: <lat>}, or an array of [<lng>, <lat>]")}};var Hp=2*Math.PI*Ds;function Kp(e){return Hp*Math.cos(e*Math.PI/180)}function dx(e){return(180+e)/360}function gx(e){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+e*Math.PI/360)))/360}function xx(e,t){return e/Kp(t)}function bx(e){return e*360-180}function Vs(e){let t=180-e*360;return 360/Math.PI*Math.atan(Math.exp(t*Math.PI/180))-90}function vx(e,t){return e*Kp(Vs(t))}function Px(e){return 1/Math.cos(e*Math.PI/180)}var Qo=class e{constructor(t,r,n=0){this.x=+t,this.y=+r,this.z=+n}static fromLngLat(t,r=0){let n=ti.convert(t);return new e(dx(n.lng),gx(n.lat),xx(r,n.lat))}toLngLat(){return new ti(bx(this.x),Vs(this.y))}toAltitude(){return vx(this.z,this.y)}meterInMercatorCoordinateUnits(){return 1/Hp*Px(Vs(this.y))}};var ea=class{constructor(t,r,n){if(t<0||t>25||n<0||n>=Math.pow(2,t)||r<0||r>=Math.pow(2,t))throw new Error("x=".concat(r,", y=").concat(n,", z=").concat(t," outside of bounds. 0<=x<").concat(Math.pow(2,t),", 0<=y<").concat(Math.pow(2,t)," 0<=z<=25 "));this.z=t,this.x=r,this.y=n,this.key=ri(0,t,t,r,n)}equals(t){return this.z===t.z&&this.x===t.x&&this.y===t.y}url(t,r,n){let i=Wp(this.x,this.y,this.z),o=Sx(this.z,this.x,this.y);return t[(this.x+this.y)%t.length].replace(/{prefix}/g,(this.x%16).toString(16)+(this.y%16).toString(16)).replace(/{z}/g,String(this.z)).replace(/{x}/g,String(this.x)).replace(/{y}/g,String(n==="tms"?Math.pow(2,this.z)-this.y-1:this.y)).replace(/{ratio}/g,r>1?"@2x":"").replace(/{quadkey}/g,o).replace(/{bbox-epsg-3857}/g,i)}isChildOf(t){let r=this.z-t.z;return r>0&&t.x===this.x>>r&&t.y===this.y>>r}getTilePoint(t){let r=Math.pow(2,this.z);return new Yp.default((t.x*r-this.x)*8192,(t.y*r-this.y)*8192)}toString(){return"".concat(this.z,"/").concat(this.x,"/").concat(this.y)}},Bs=class{constructor(t,r){this.wrap=t,this.canonical=r,this.key=ri(t,r.z,r.z,r.x,r.y)}},ni=class e{constructor(t,r,n,i,o){if(t<n)throw new Error("overscaledZ should be >= z; overscaledZ = ".concat(t,"; z = ").concat(n));this.overscaledZ=t,this.wrap=r,this.canonical=new ea(n,+i,+o),this.key=ri(r,t,n,i,o)}clone(){return new e(this.overscaledZ,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)}equals(t){return this.overscaledZ===t.overscaledZ&&this.wrap===t.wrap&&this.canonical.equals(t.canonical)}scaledTo(t){if(t>this.overscaledZ)throw new Error("targetZ > this.overscaledZ; targetZ = ".concat(t,"; overscaledZ = ").concat(this.overscaledZ));let r=this.canonical.z-t;return t>this.canonical.z?new e(t,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new e(t,this.wrap,t,this.canonical.x>>r,this.canonical.y>>r)}calculateScaledKey(t,r){if(t>this.overscaledZ)throw new Error("targetZ > this.overscaledZ; targetZ = ".concat(t,"; overscaledZ = ").concat(this.overscaledZ));let n=this.canonical.z-t;return t>this.canonical.z?ri(this.wrap*+r,t,this.canonical.z,this.canonical.x,this.canonical.y):ri(this.wrap*+r,t,t,this.canonical.x>>n,this.canonical.y>>n)}isChildOf(t){if(t.wrap!==this.wrap)return!1;let r=this.canonical.z-t.canonical.z;return t.overscaledZ===0||t.overscaledZ<this.overscaledZ&&t.canonical.x===this.canonical.x>>r&&t.canonical.y===this.canonical.y>>r}children(t){if(this.overscaledZ>=t)return[new e(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];let r=this.canonical.z+1,n=this.canonical.x*2,i=this.canonical.y*2;return[new e(r,this.wrap,r,n,i),new e(r,this.wrap,r,n+1,i),new e(r,this.wrap,r,n,i+1),new e(r,this.wrap,r,n+1,i+1)]}isLessThan(t){return this.wrap<t.wrap?!0:this.wrap>t.wrap?!1:this.overscaledZ<t.overscaledZ?!0:this.overscaledZ>t.overscaledZ?!1:this.canonical.x<t.canonical.x?!0:this.canonical.x>t.canonical.x?!1:this.canonical.y<t.canonical.y}wrapped(){return new e(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)}unwrapTo(t){return new e(this.overscaledZ,t,this.canonical.z,this.canonical.x,this.canonical.y)}overscaleFactor(){return Math.pow(2,this.overscaledZ-this.canonical.z)}toUnwrapped(){return new Bs(this.wrap,this.canonical)}toString(){return"".concat(this.overscaledZ,"/").concat(this.canonical.x,"/").concat(this.canonical.y)}getTilePoint(t){return this.canonical.getTilePoint(new Qo(t.x-this.wrap,t.y))}};function ri(e,t,r,n,i){e*=2,e<0&&(e=e*-1-1);let o=1<<r;return(o*o*e+o*i+n).toString(36)+r.toString(36)+t.toString(36)}function Sx(e,t,r){let n="",i;for(let o=e;o>0;o--)i=1<<o-1,n+=(t&i?1:0)+(r&i?2:0);return n}k("CanonicalTileID",ea);k("OverscaledTileID",ni,{omit:["posMatrix"]});var ta=class{constructor(t){this.tileID=new ni(t.tileID.overscaledZ,t.tileID.wrap,t.tileID.canonical.z,t.tileID.canonical.x,t.tileID.canonical.y),this.uid=t.uid,this.zoom=t.zoom,this.pixelRatio=t.pixelRatio,this.tileSize=t.tileSize,this.source=t.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=t.showCollisionBoxes,this.collectResourceTiming=!!t.collectResourceTiming,this.returnDependencies=!!t.returnDependencies,this.promoteId=t.promoteId,this.inFlightDependencies=[],this.dependencySentinel=-1}parse(t,r,n,i,o){this.status="parsing",this.data=t,this.collisionBoxArray=new Sn;let a=new Fr(Object.keys(t.layers).sort()),s=new Yn(this.tileID,this.promoteId);s.bucketLayerIDs=[];let l={},u={featureIndex:s,iconDependencies:{},patternDependencies:{},glyphDependencies:{},availableImages:n},c=r.familiesBySource[this.source];for(let x in c){let P=t.layers[x];if(!P)continue;P.version===1&&ce(\'Vector tile source "\'.concat(this.source,\'" layer "\').concat(x,\'" \')+"does not use vector tile spec v2 and therefore may have some rendering errors.");let w=a.encode(x),A=[];for(let T=0;T<P.length;T++){let I=P.feature(T),E=s.getId(I,x);A.push({feature:I,id:E,index:T,sourceLayerIndex:w})}for(let T of c[x]){let I=T[0];if(I.source!==this.source&&ce("layer.source = ".concat(I.source," does not equal this.source = ").concat(this.source)),I.minzoom&&this.zoom<Math.floor(I.minzoom)||I.maxzoom&&this.zoom>=I.maxzoom||I.visibility==="none")continue;zs(T,this.zoom,n),(l[I.id]=I.createBucket({index:s.bucketLayerIDs.length,layers:T,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:w,sourceID:this.source})).populate(A,u,this.tileID.canonical),s.bucketLayerIDs.push(T.map(_=>_.id))}}let p,f,y,m,h=Rr(u.glyphDependencies,x=>Object.keys(x).map(Number));this.inFlightDependencies.forEach(x=>x==null?void 0:x.cancel()),this.inFlightDependencies=[];let d=++this.dependencySentinel;Object.keys(h).length?this.inFlightDependencies.push(i.send("getGlyphs",{uid:this.uid,stacks:h,source:this.source,tileID:this.tileID,type:"glyphs"},(x,P)=>{d===this.dependencySentinel&&(p||(p=x,f=P,b.call(this)))})):f={};let g=Object.keys(u.iconDependencies);g.length?this.inFlightDependencies.push(i.send("getImages",{icons:g,source:this.source,tileID:this.tileID,type:"icons"},(x,P)=>{d===this.dependencySentinel&&(p||(p=x,y=P,b.call(this)))})):y={};let v=Object.keys(u.patternDependencies);v.length?this.inFlightDependencies.push(i.send("getImages",{icons:v,source:this.source,tileID:this.tileID,type:"patterns"},(x,P)=>{d===this.dependencySentinel&&(p||(p=x,m=P,b.call(this)))})):m={},b.call(this);function b(){if(p)return o(p);if(f&&y&&m){let x=new ei(f),P=new qn(y,m);for(let w in l){let A=l[w];A instanceof We?(zs(A.layers,this.zoom,n),jp({bucket:A,glyphMap:f,glyphPositions:x.positions,imageMap:y,imagePositions:P.iconPositions,showCollisionBoxes:this.showCollisionBoxes,canonical:this.tileID.canonical})):A.hasPattern&&(A instanceof Xt||A instanceof Kt||A instanceof Yt)&&(zs(A.layers,this.zoom,n),A.addFeatures(u,this.tileID.canonical,P.patternPositions))}this.status="done",o(null,{buckets:Object.values(l).filter(w=>!w.isEmpty()),featureIndex:s,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:x.image,imageAtlas:P,glyphMap:this.returnDependencies?f:null,iconMap:this.returnDependencies?y:null,glyphPositions:this.returnDependencies?x.positions:null})}}}};function zs(e,t,r){let n=new q(t);for(let i of e)i.recalculate(n,r)}var wx=60,f_=1e3/wx;var Vr=class{constructor(t){this._marks={start:[t.url,"start"].join("#"),end:[t.url,"end"].join("#"),measure:t.url.toString()},performance.mark(this._marks.start)}finish(){performance.mark(this._marks.end);let t=performance.getEntriesByName(this._marks.measure);return t.length===0&&(performance.measure(this._marks.measure,this._marks.start,this._marks.end),t=performance.getEntriesByName(this._marks.measure),performance.clearMarks(this._marks.start),performance.clearMarks(this._marks.end),performance.clearMeasures(this._marks.measure)),t}};function Ax(e,t){let r=Wa(e.request,(n,i,o,a)=>{n?t(n):i&&t(null,{vectorTile:new Xp.default.VectorTile(new Qp.default(i)),rawData:i,cacheControl:o,expires:a})});return()=>{r.cancel(),t()}}var Br=class{constructor(t,r,n,i){this.actor=t,this.layerIndex=r,this.availableImages=n,this.loadVectorData=i||Ax,this.loading={},this.loaded={}}loadTile(t,r){let n=t.uid;this.loading||(this.loading={});let i=t&&t.request&&t.request.collectResourceTiming?new Vr(t.request):!1,o=this.loading[n]=new ta(t);o.abort=this.loadVectorData(t,(a,s)=>{if(delete this.loading[n],a||!s)return o.status="done",this.loaded[n]=o,r(a);let l=s.rawData,u={};s.expires&&(u.expires=s.expires),s.cacheControl&&(u.cacheControl=s.cacheControl);let c={};if(i){let p=i.finish();p&&(c.resourceTiming=JSON.parse(JSON.stringify(p)))}o.vectorTile=s.vectorTile,o.parse(s.vectorTile,this.layerIndex,this.availableImages,this.actor,(p,f)=>{if(p||!f)return r(p);r(null,Ae({rawTileData:l.slice(0)},f,u,c))}),this.loaded=this.loaded||{},this.loaded[n]=o})}reloadTile(t,r){let n=this.loaded,i=t.uid,o=this;if(n&&n[i]){let a=n[i];a.showCollisionBoxes=t.showCollisionBoxes,a.status==="parsing"?a.parse(a.vectorTile,this.layerIndex,this.availableImages,this.actor,r):a.status==="done"&&(a.vectorTile?a.parse(a.vectorTile,this.layerIndex,this.availableImages,this.actor,r):r())}}abortTile(t,r){let n=this.loading,i=t.uid;n&&n[i]&&n[i].abort&&(n[i].abort(),delete n[i]),r()}removeTile(t,r){let n=this.loaded,i=t.uid;n&&n[i]&&delete n[i],r()}};var ii=class{constructor(t,r,n){if(this.uid=t,r.height!==r.width)throw new RangeError("DEM tiles must be square");if(n&&n!=="mapbox"&&n!=="terrarium"){ce(\'"\'.concat(n,\'" is not a valid encoding type. Valid types include "mapbox" and "terrarium".\'));return}this.stride=r.height;let i=this.dim=r.height-2;this.data=new Uint32Array(r.data.buffer),this.encoding=n||"mapbox";for(let o=0;o<i;o++)this.data[this._idx(-1,o)]=this.data[this._idx(0,o)],this.data[this._idx(i,o)]=this.data[this._idx(i-1,o)],this.data[this._idx(o,-1)]=this.data[this._idx(o,0)],this.data[this._idx(o,i)]=this.data[this._idx(o,i-1)];this.data[this._idx(-1,-1)]=this.data[this._idx(0,0)],this.data[this._idx(i,-1)]=this.data[this._idx(i-1,0)],this.data[this._idx(-1,i)]=this.data[this._idx(0,i-1)],this.data[this._idx(i,i)]=this.data[this._idx(i-1,i-1)],this.min=Number.MAX_SAFE_INTEGER,this.max=Number.MIN_SAFE_INTEGER;for(let o=0;o<i;o++)for(let a=0;a<i;a++){let s=this.get(o,a);s>this.max&&(this.max=s),s<this.min&&(this.min=s)}}get(t,r){let n=new Uint8Array(this.data.buffer),i=this._idx(t,r)*4;return(this.encoding==="terrarium"?this._unpackTerrarium:this._unpackMapbox)(n[i],n[i+1],n[i+2])}getUnpackVector(){return this.encoding==="terrarium"?[256,1,1/256,32768]:[6553.6,25.6,.1,1e4]}_idx(t,r){if(t<-1||t>=this.dim+1||r<-1||r>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(r+1)*this.stride+(t+1)}_unpackMapbox(t,r,n){return(t*256*256+r*256+n)/10-1e4}_unpackTerrarium(t,r,n){return t*256+r+n/256-32768}getPixels(){return new de({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))}backfillBorder(t,r,n){if(this.dim!==t.dim)throw new Error("dem dimension mismatch");let i=r*this.dim,o=r*this.dim+this.dim,a=n*this.dim,s=n*this.dim+this.dim;switch(r){case-1:i=o-1;break;case 1:o=i+1;break}switch(n){case-1:a=s-1;break;case 1:s=a+1;break}let l=-r*this.dim,u=-n*this.dim;for(let c=a;c<s;c++)for(let p=i;p<o;p++)this.data[this._idx(p,c)]=t.data[this._idx(p+l,c+u)]}};k("DEMData",ii);var ra=class{constructor(){this.loaded={}}loadTile(t,r){let{uid:n,encoding:i,rawImageData:o}=t,a=Or(o)?this.getImageData(o):o,s=new ii(n,a,i);this.loaded=this.loaded||{},this.loaded[n]=s,r(null,s)}getImageData(t){(!this.offscreenCanvas||!this.offscreenCanvasContext)&&(this.offscreenCanvas=new OffscreenCanvas(t.width,t.height),this.offscreenCanvasContext=this.offscreenCanvas.getContext("2d",{willReadFrequently:!0})),this.offscreenCanvas.width=t.width,this.offscreenCanvas.height=t.height,this.offscreenCanvasContext.drawImage(t,0,0,t.width,t.height);let r=this.offscreenCanvasContext.getImageData(-1,-1,t.width+2,t.height+2);return this.offscreenCanvasContext.clearRect(0,0,this.offscreenCanvas.width,this.offscreenCanvas.height),new de({width:r.width,height:r.height},r.data)}removeTile(t){let r=this.loaded,n=t.uid;r&&r[n]&&delete r[n]}};var Cf=Z(nf(),1);var Rs=Z(he(),1),of=Z(It(),1);var _x=of.default.VectorTileFeature.prototype.toGeoJSON,Os=class{constructor(t){this._feature=t,this.extent=8192,this.type=t.type,this.properties=t.tags,"id"in t&&!isNaN(t.id)&&(this.id=parseInt(t.id,10))}loadGeometry(){if(this._feature.type===1){let t=[];for(let r of this._feature.geometry)t.push([new Rs.default(r[0],r[1])]);return t}else{let t=[];for(let r of this._feature.geometry){let n=[];for(let i of r)n.push(new Rs.default(i[0],i[1]));t.push(n)}return t}}toGeoJSON(t,r,n){return _x.call(this,t,r,n)}},ia=class{constructor(t){this.layers={_geojsonTileLayer:this},this.name="_geojsonTileLayer",this.extent=8192,this.length=t.length,this._features=t}feature(t){return new Os(this._features[t])}};var kf=Z(pf(),1);var ff=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],$s=1,ai=8,li=class e{static from(t){if(!(t instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");let[r,n]=new Uint8Array(t,0,2);if(r!==219)throw new Error("Data does not appear to be in a KDBush format.");let i=n>>4;if(i!==$s)throw new Error("Got v".concat(i," data when expected v").concat($s,"."));let o=ff[n&15];if(!o)throw new Error("Unrecognized array type.");let[a]=new Uint16Array(t,2,1),[s]=new Uint32Array(t,4,1);return new e(s,a,o,t)}constructor(t,r=64,n=Float64Array,i){if(isNaN(t)||t<0)throw new Error("Unpexpected numItems value: ".concat(t,"."));this.numItems=+t,this.nodeSize=Math.min(Math.max(+r,2),65535),this.ArrayType=n,this.IndexArrayType=t<65536?Uint16Array:Uint32Array;let o=ff.indexOf(this.ArrayType),a=t*2*this.ArrayType.BYTES_PER_ELEMENT,s=t*this.IndexArrayType.BYTES_PER_ELEMENT,l=(8-s%8)%8;if(o<0)throw new Error("Unexpected typed array class: ".concat(n,"."));i&&i instanceof ArrayBuffer?(this.data=i,this.ids=new this.IndexArrayType(this.data,ai,t),this.coords=new this.ArrayType(this.data,ai+s+l,t*2),this._pos=t*2,this._finished=!0):(this.data=new ArrayBuffer(ai+a+s+l),this.ids=new this.IndexArrayType(this.data,ai,t),this.coords=new this.ArrayType(this.data,ai+s+l,t*2),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,($s<<4)+o]),new Uint16Array(this.data,2,1)[0]=r,new Uint32Array(this.data,4,1)[0]=t)}add(t,r){let n=this._pos>>1;return this.ids[n]=n,this.coords[this._pos++]=t,this.coords[this._pos++]=r,n}finish(){let t=this._pos>>1;if(t!==this.numItems)throw new Error("Added ".concat(t," items when expected ").concat(this.numItems,"."));return qs(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(t,r,n,i){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");let{ids:o,coords:a,nodeSize:s}=this,l=[0,o.length-1,0],u=[];for(;l.length;){let c=l.pop()||0,p=l.pop()||0,f=l.pop()||0;if(p-f<=s){for(let d=f;d<=p;d++){let g=a[2*d],v=a[2*d+1];g>=t&&g<=n&&v>=r&&v<=i&&u.push(o[d])}continue}let y=f+p>>1,m=a[2*y],h=a[2*y+1];m>=t&&m<=n&&h>=r&&h<=i&&u.push(o[y]),(c===0?t<=m:r<=h)&&(l.push(f),l.push(y-1),l.push(1-c)),(c===0?n>=m:i>=h)&&(l.push(y+1),l.push(p),l.push(1-c))}return u}within(t,r,n){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");let{ids:i,coords:o,nodeSize:a}=this,s=[0,i.length-1,0],l=[],u=n*n;for(;s.length;){let c=s.pop()||0,p=s.pop()||0,f=s.pop()||0;if(p-f<=a){for(let d=f;d<=p;d++)yf(o[2*d],o[2*d+1],t,r)<=u&&l.push(i[d]);continue}let y=f+p>>1,m=o[2*y],h=o[2*y+1];yf(m,h,t,r)<=u&&l.push(i[y]),(c===0?t-n<=m:r-n<=h)&&(s.push(f),s.push(y-1),s.push(1-c)),(c===0?t+n>=m:r+n>=h)&&(s.push(y+1),s.push(p),s.push(1-c))}return l}};function qs(e,t,r,n,i,o){if(i-n<=r)return;let a=n+i>>1;mf(e,t,a,n,i,o),qs(e,t,r,n,a-1,1-o),qs(e,t,r,a+1,i,1-o)}function mf(e,t,r,n,i,o){for(;i>n;){if(i-n>600){let u=i-n+1,c=r-n+1,p=Math.log(u),f=.5*Math.exp(2*p/3),y=.5*Math.sqrt(p*f*(u-f)/u)*(c-u/2<0?-1:1),m=Math.max(n,Math.floor(r-c*f/u+y)),h=Math.min(i,Math.floor(r+(u-c)*f/u+y));mf(e,t,r,m,h,o)}let a=t[2*r+o],s=n,l=i;for(si(e,t,n,r),t[2*i+o]>a&&si(e,t,n,i);s<l;){for(si(e,t,s,l),s++,l--;t[2*s+o]<a;)s++;for(;t[2*l+o]>a;)l--}t[2*n+o]===a?si(e,t,n,l):(l++,si(e,t,l,i)),l<=r&&(n=l+1),r<=l&&(i=l-1)}}function si(e,t,r,n){Gs(e,r,n),Gs(t,2*r,2*n),Gs(t,2*r+1,2*n+1)}function Gs(e,t,r){let n=e[t];e[t]=e[r],e[r]=n}function yf(e,t,r,n){let i=e-r,o=t-n;return i*i+o*o}var Bx={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:e=>e},hf=Math.fround||(e=>t=>(e[0]=+t,e[0]))(new Float32Array(1)),er=2,Tt=3,js=4,kt=5,gf=6,ui=class{constructor(t){this.options=Object.assign(Object.create(Bx),t),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(t){let{log:r,minZoom:n,maxZoom:i}=this.options;r&&console.time("total time");let o="prepare ".concat(t.length," points");r&&console.time(o),this.points=t;let a=[];for(let l=0;l<t.length;l++){let u=t[l];if(!u.geometry)continue;let[c,p]=u.geometry.coordinates,f=hf(aa(c)),y=hf(sa(p));a.push(f,y,1/0,l,-1,1),this.options.reduce&&a.push(0)}let s=this.trees[i+1]=this._createTree(a);r&&console.timeEnd(o);for(let l=i;l>=n;l--){let u=+Date.now();s=this.trees[l]=this._createTree(this._cluster(s,l)),r&&console.log("z%d: %d clusters in %dms",l,s.numItems,+Date.now()-u)}return r&&console.timeEnd("total time"),this}getClusters(t,r){let n=((t[0]+180)%360+360)%360-180,i=Math.max(-90,Math.min(90,t[1])),o=t[2]===180?180:((t[2]+180)%360+360)%360-180,a=Math.max(-90,Math.min(90,t[3]));if(t[2]-t[0]>=360)n=-180,o=180;else if(n>o){let p=this.getClusters([n,i,180,a],r),f=this.getClusters([-180,i,o,a],r);return p.concat(f)}let s=this.trees[this._limitZoom(r)],l=s.range(aa(n),sa(a),aa(o),sa(i)),u=s.data,c=[];for(let p of l){let f=this.stride*p;c.push(u[f+kt]>1?df(u,f,this.clusterProps):this.points[u[f+Tt]])}return c}getChildren(t){let r=this._getOriginId(t),n=this._getOriginZoom(t),i="No cluster with the specified id.",o=this.trees[n];if(!o)throw new Error(i);let a=o.data;if(r*this.stride>=a.length)throw new Error(i);let s=this.options.radius/(this.options.extent*Math.pow(2,n-1)),l=a[r*this.stride],u=a[r*this.stride+1],c=o.within(l,u,s),p=[];for(let f of c){let y=f*this.stride;a[y+js]===t&&p.push(a[y+kt]>1?df(a,y,this.clusterProps):this.points[a[y+Tt]])}if(p.length===0)throw new Error(i);return p}getLeaves(t,r,n){r=r||10,n=n||0;let i=[];return this._appendLeaves(i,t,r,n,0),i}getTile(t,r,n){let i=this.trees[this._limitZoom(t)],o=Math.pow(2,t),{extent:a,radius:s}=this.options,l=s/a,u=(n-l)/o,c=(n+1+l)/o,p={features:[]};return this._addTileFeatures(i.range((r-l)/o,u,(r+1+l)/o,c),i.data,r,n,o,p),r===0&&this._addTileFeatures(i.range(1-l/o,u,1,c),i.data,o,n,o,p),r===o-1&&this._addTileFeatures(i.range(0,u,l/o,c),i.data,-1,n,o,p),p.features.length?p:null}getClusterExpansionZoom(t){let r=this._getOriginZoom(t)-1;for(;r<=this.options.maxZoom;){let n=this.getChildren(t);if(r++,n.length!==1)break;t=n[0].properties.cluster_id}return r}_appendLeaves(t,r,n,i,o){let a=this.getChildren(r);for(let s of a){let l=s.properties;if(l&&l.cluster?o+l.point_count<=i?o+=l.point_count:o=this._appendLeaves(t,l.cluster_id,n,i,o):o<i?o++:t.push(s),t.length===n)break}return o}_createTree(t){let r=new li(t.length/this.stride|0,this.options.nodeSize,Float32Array);for(let n=0;n<t.length;n+=this.stride)r.add(t[n],t[n+1]);return r.finish(),r.data=t,r}_addTileFeatures(t,r,n,i,o,a){for(let s of t){let l=s*this.stride,u=r[l+kt]>1,c,p,f;if(u)c=xf(r,l,this.clusterProps),p=r[l],f=r[l+1];else{let h=this.points[r[l+Tt]];c=h.properties;let[d,g]=h.geometry.coordinates;p=aa(d),f=sa(g)}let y={type:1,geometry:[[Math.round(this.options.extent*(p*o-n)),Math.round(this.options.extent*(f*o-i))]],tags:c},m;u||this.options.generateId?m=r[l+Tt]:m=this.points[r[l+Tt]].id,m!==void 0&&(y.id=m),a.features.push(y)}}_limitZoom(t){return Math.max(this.options.minZoom,Math.min(Math.floor(+t),this.options.maxZoom+1))}_cluster(t,r){let{radius:n,extent:i,reduce:o,minPoints:a}=this.options,s=n/(i*Math.pow(2,r)),l=t.data,u=[],c=this.stride;for(let p=0;p<l.length;p+=c){if(l[p+er]<=r)continue;l[p+er]=r;let f=l[p],y=l[p+1],m=t.within(l[p],l[p+1],s),h=l[p+kt],d=h;for(let g of m){let v=g*c;l[v+er]>r&&(d+=l[v+kt])}if(d>h&&d>=a){let g=f*h,v=y*h,b,x=-1,P=((p/c|0)<<5)+(r+1)+this.points.length;for(let w of m){let A=w*c;if(l[A+er]<=r)continue;l[A+er]=r;let T=l[A+kt];g+=l[A]*T,v+=l[A+1]*T,l[A+js]=P,o&&(b||(b=this._map(l,p,!0),x=this.clusterProps.length,this.clusterProps.push(b)),o(b,this._map(l,A)))}l[p+js]=P,u.push(g/d,v/d,1/0,P,-1,d),o&&u.push(x)}else{for(let g=0;g<c;g++)u.push(l[p+g]);if(d>1)for(let g of m){let v=g*c;if(!(l[v+er]<=r)){l[v+er]=r;for(let b=0;b<c;b++)u.push(l[v+b])}}}}return u}_getOriginId(t){return t-this.points.length>>5}_getOriginZoom(t){return(t-this.points.length)%32}_map(t,r,n){if(t[r+kt]>1){let a=this.clusterProps[t[r+gf]];return n?Object.assign({},a):a}let i=this.points[t[r+Tt]].properties,o=this.options.map(i);return n&&o===i?Object.assign({},o):o}};function df(e,t,r){return{type:"Feature",id:e[t+Tt],properties:xf(e,t,r),geometry:{type:"Point",coordinates:[zx(e[t]),Rx(e[t+1])]}}}function xf(e,t,r){let n=e[t+kt],i=n>=1e4?"".concat(Math.round(n/1e3),"k"):n>=1e3?"".concat(Math.round(n/100)/10,"k"):n,o=e[t+gf],a=o===-1?{}:Object.assign({},r[o]);return Object.assign(a,{cluster:!0,cluster_id:e[t+Tt],point_count:n,point_count_abbreviated:i})}function aa(e){return e/360+.5}function sa(e){let t=Math.sin(e*Math.PI/180),r=.5-.25*Math.log((1+t)/(1-t))/Math.PI;return r<0?0:r>1?1:r}function zx(e){return(e-.5)*360}function Rx(e){let t=(180-e*360)*Math.PI/180;return 360*Math.atan(Math.exp(t))/Math.PI-90}function ci(e,t,r,n){for(var i=n,o=r-t>>1,a=r-t,s,l=e[t],u=e[t+1],c=e[r],p=e[r+1],f=t+3;f<r;f+=3){var y=Ox(e[f],e[f+1],l,u,c,p);if(y>i)s=f,i=y;else if(y===i){var m=Math.abs(f-o);m<a&&(s=f,a=m)}}i>n&&(s-t>3&&ci(e,t,s,n),e[s+2]=i,r-s>3&&ci(e,s,r,n))}function Ox(e,t,r,n,i,o){var a=i-r,s=o-n;if(a!==0||s!==0){var l=((e-r)*a+(t-n)*s)/(a*a+s*s);l>1?(r=i,n=o):l>0&&(r+=a*l,n+=s*l)}return a=e-r,s=t-n,a*a+s*s}function pt(e,t,r,n){var i={id:typeof e>"u"?null:e,type:t,geometry:r,tags:n,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return Nx(i),i}function Nx(e){var t=e.geometry,r=e.type;if(r==="Point"||r==="MultiPoint"||r==="LineString")Zs(e,t);else if(r==="Polygon"||r==="MultiLineString")for(var n=0;n<t.length;n++)Zs(e,t[n]);else if(r==="MultiPolygon")for(n=0;n<t.length;n++)for(var i=0;i<t[n].length;i++)Zs(e,t[n][i])}function Zs(e,t){for(var r=0;r<t.length;r+=3)e.minX=Math.min(e.minX,t[r]),e.minY=Math.min(e.minY,t[r+1]),e.maxX=Math.max(e.maxX,t[r]),e.maxY=Math.max(e.maxY,t[r+1])}function Hs(e,t){var r=[];if(e.type==="FeatureCollection")for(var n=0;n<e.features.length;n++)la(r,e.features[n],t,n);else e.type==="Feature"?la(r,e,t):la(r,{geometry:e},t);return r}function la(e,t,r,n){if(t.geometry){var i=t.geometry.coordinates,o=t.geometry.type,a=Math.pow(r.tolerance/((1<<r.maxZoom)*r.extent),2),s=[],l=t.id;if(r.promoteId?l=t.properties[r.promoteId]:r.generateId&&(l=n||0),o==="Point")bf(i,s);else if(o==="MultiPoint")for(var u=0;u<i.length;u++)bf(i[u],s);else if(o==="LineString")Ws(i,s,a,!1);else if(o==="MultiLineString")if(r.lineMetrics){for(u=0;u<i.length;u++)s=[],Ws(i[u],s,a,!1),e.push(pt(l,"LineString",s,t.properties));return}else Js(i,s,a,!1);else if(o==="Polygon")Js(i,s,a,!0);else if(o==="MultiPolygon")for(u=0;u<i.length;u++){var c=[];Js(i[u],c,a,!0),s.push(c)}else if(o==="GeometryCollection"){for(u=0;u<t.geometry.geometries.length;u++)la(e,{id:l,geometry:t.geometry.geometries[u],properties:t.properties},r,n);return}else throw new Error("Input data is not a valid GeoJSON object.");e.push(pt(l,o,s,t.properties))}}function bf(e,t){t.push(vf(e[0])),t.push(Pf(e[1])),t.push(0)}function Ws(e,t,r,n){for(var i,o,a=0,s=0;s<e.length;s++){var l=vf(e[s][0]),u=Pf(e[s][1]);t.push(l),t.push(u),t.push(0),s>0&&(n?a+=(i*u-l*o)/2:a+=Math.sqrt(Math.pow(l-i,2)+Math.pow(u-o,2))),i=l,o=u}var c=t.length-3;t[2]=1,ci(t,0,c,r),t[c+2]=1,t.size=Math.abs(a),t.start=0,t.end=t.size}function Js(e,t,r,n){for(var i=0;i<e.length;i++){var o=[];Ws(e[i],o,r,n),t.push(o)}}function vf(e){return e/360+.5}function Pf(e){var t=Math.sin(e*Math.PI/180),r=.5-.25*Math.log((1+t)/(1-t))/Math.PI;return r<0?0:r>1?1:r}function Ue(e,t,r,n,i,o,a,s){if(r/=t,n/=t,o>=r&&a<n)return e;if(a<r||o>=n)return null;for(var l=[],u=0;u<e.length;u++){var c=e[u],p=c.geometry,f=c.type,y=i===0?c.minX:c.minY,m=i===0?c.maxX:c.maxY;if(y>=r&&m<n){l.push(c);continue}else if(m<r||y>=n)continue;var h=[];if(f==="Point"||f==="MultiPoint")Ux(p,h,r,n,i);else if(f==="LineString")wf(p,h,r,n,i,!1,s.lineMetrics);else if(f==="MultiLineString")Ks(p,h,r,n,i,!1);else if(f==="Polygon")Ks(p,h,r,n,i,!0);else if(f==="MultiPolygon")for(var d=0;d<p.length;d++){var g=[];Ks(p[d],g,r,n,i,!0),g.length&&h.push(g)}if(h.length){if(s.lineMetrics&&f==="LineString"){for(d=0;d<h.length;d++)l.push(pt(c.id,f,h[d],c.tags));continue}(f==="LineString"||f==="MultiLineString")&&(h.length===1?(f="LineString",h=h[0]):f="MultiLineString"),(f==="Point"||f==="MultiPoint")&&(f=h.length===3?"Point":"MultiPoint"),l.push(pt(c.id,f,h,c.tags))}}return l.length?l:null}function Ux(e,t,r,n,i){for(var o=0;o<e.length;o+=3){var a=e[o+i];a>=r&&a<=n&&(t.push(e[o]),t.push(e[o+1]),t.push(e[o+2]))}}function wf(e,t,r,n,i,o,a){for(var s=Sf(e),l=i===0?$x:Gx,u=e.start,c,p,f=0;f<e.length-3;f+=3){var y=e[f],m=e[f+1],h=e[f+2],d=e[f+3],g=e[f+4],v=i===0?y:m,b=i===0?d:g,x=!1;a&&(c=Math.sqrt(Math.pow(y-d,2)+Math.pow(m-g,2))),v<r?b>r&&(p=l(s,y,m,d,g,r),a&&(s.start=u+c*p)):v>n?b<n&&(p=l(s,y,m,d,g,n),a&&(s.start=u+c*p)):Ys(s,y,m,h),b<r&&v>=r&&(p=l(s,y,m,d,g,r),x=!0),b>n&&v<=n&&(p=l(s,y,m,d,g,n),x=!0),!o&&x&&(a&&(s.end=u+c*p),t.push(s),s=Sf(e)),a&&(u+=c)}var P=e.length-3;y=e[P],m=e[P+1],h=e[P+2],v=i===0?y:m,v>=r&&v<=n&&Ys(s,y,m,h),P=s.length-3,o&&P>=3&&(s[P]!==s[0]||s[P+1]!==s[1])&&Ys(s,s[0],s[1],s[2]),s.length&&t.push(s)}function Sf(e){var t=[];return t.size=e.size,t.start=e.start,t.end=e.end,t}function Ks(e,t,r,n,i,o){for(var a=0;a<e.length;a++)wf(e[a],t,r,n,i,o,!1)}function Ys(e,t,r,n){e.push(t),e.push(r),e.push(n)}function $x(e,t,r,n,i,o){var a=(o-t)/(n-t);return e.push(o),e.push(r+(i-r)*a),e.push(1),a}function Gx(e,t,r,n,i,o){var a=(o-r)/(i-r);return e.push(t+(n-t)*a),e.push(o),e.push(1),a}function Qs(e,t){var r=t.buffer/t.extent,n=e,i=Ue(e,1,-1-r,r,0,-1,2,t),o=Ue(e,1,1-r,2+r,0,-1,2,t);return(i||o)&&(n=Ue(e,1,-r,1+r,0,-1,2,t)||[],i&&(n=Af(i,1).concat(n)),o&&(n=n.concat(Af(o,-1)))),n}function Af(e,t){for(var r=[],n=0;n<e.length;n++){var i=e[n],o=i.type,a;if(o==="Point"||o==="MultiPoint"||o==="LineString")a=Xs(i.geometry,t);else if(o==="MultiLineString"||o==="Polygon"){a=[];for(var s=0;s<i.geometry.length;s++)a.push(Xs(i.geometry[s],t))}else if(o==="MultiPolygon")for(a=[],s=0;s<i.geometry.length;s++){for(var l=[],u=0;u<i.geometry[s].length;u++)l.push(Xs(i.geometry[s][u],t));a.push(l)}r.push(pt(i.id,o,a,i.tags))}return r}function Xs(e,t){var r=[];r.size=e.size,e.start!==void 0&&(r.start=e.start,r.end=e.end);for(var n=0;n<e.length;n+=3)r.push(e[n]+t,e[n+1],e[n+2]);return r}function ua(e,t){if(e.transformed)return e;var r=1<<e.z,n=e.x,i=e.y,o,a,s;for(o=0;o<e.features.length;o++){var l=e.features[o],u=l.geometry,c=l.type;if(l.geometry=[],c===1)for(a=0;a<u.length;a+=2)l.geometry.push(_f(u[a],u[a+1],t,r,n,i));else for(a=0;a<u.length;a++){var p=[];for(s=0;s<u[a].length;s+=2)p.push(_f(u[a][s],u[a][s+1],t,r,n,i));l.geometry.push(p)}}return e.transformed=!0,e}function _f(e,t,r,n,i,o){return[Math.round(r*(e*n-i)),Math.round(r*(t*n-o))]}function tl(e,t,r,n,i){for(var o=t===i.maxZoom?0:i.tolerance/((1<<t)*i.extent),a={features:[],numPoints:0,numSimplified:0,numFeatures:0,source:null,x:r,y:n,z:t,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0},s=0;s<e.length;s++){a.numFeatures++,qx(a,e[s],o,i);var l=e[s].minX,u=e[s].minY,c=e[s].maxX,p=e[s].maxY;l<a.minX&&(a.minX=l),u<a.minY&&(a.minY=u),c>a.maxX&&(a.maxX=c),p>a.maxY&&(a.maxY=p)}return a}function qx(e,t,r,n){var i=t.geometry,o=t.type,a=[];if(o==="Point"||o==="MultiPoint")for(var s=0;s<i.length;s+=3)a.push(i[s]),a.push(i[s+1]),e.numPoints++,e.numSimplified++;else if(o==="LineString")el(a,i,e,r,!1,!1);else if(o==="MultiLineString"||o==="Polygon")for(s=0;s<i.length;s++)el(a,i[s],e,r,o==="Polygon",s===0);else if(o==="MultiPolygon")for(var l=0;l<i.length;l++){var u=i[l];for(s=0;s<u.length;s++)el(a,u[s],e,r,!0,s===0)}if(a.length){var c=t.tags||null;if(o==="LineString"&&n.lineMetrics){c={};for(var p in t.tags)c[p]=t.tags[p];c.mapbox_clip_start=i.start/i.size,c.mapbox_clip_end=i.end/i.size}var f={geometry:a,type:o==="Polygon"||o==="MultiPolygon"?3:o==="LineString"||o==="MultiLineString"?2:1,tags:c};t.id!==null&&(f.id=t.id),e.features.push(f)}}function el(e,t,r,n,i,o){var a=n*n;if(n>0&&t.size<(i?a:n)){r.numPoints+=t.length/3;return}for(var s=[],l=0;l<t.length;l+=3)(n===0||t[l+2]>a)&&(r.numSimplified++,s.push(t[l]),s.push(t[l+1])),r.numPoints++;i&&jx(s,o),e.push(s)}function jx(e,t){for(var r=0,n=0,i=e.length,o=i-2;n<i;o=n,n+=2)r+=(e[n]-e[o])*(e[n+1]+e[o+1]);if(r>0===t)for(n=0,i=e.length;n<i/2;n+=2){var a=e[n],s=e[n+1];e[n]=e[i-2-n],e[n+1]=e[i-1-n],e[i-2-n]=a,e[i-1-n]=s}}function nl(e,t){return new ca(e,t)}function ca(e,t){t=this.options=Zx(Object.create(this.options),t);var r=t.debug;if(r&&console.time("preprocess data"),t.maxZoom<0||t.maxZoom>24)throw new Error("maxZoom should be in the 0-24 range");if(t.promoteId&&t.generateId)throw new Error("promoteId and generateId cannot be used together.");var n=Hs(e,t);this.tiles={},this.tileCoords=[],r&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",t.indexMaxZoom,t.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),n=Qs(n,t),n.length&&this.splitTile(n,0,0,0),r&&(n.length&&console.log("features: %d, points: %d",this.tiles[0].numFeatures,this.tiles[0].numPoints),console.timeEnd("generate tiles"),console.log("tiles generated:",this.total,JSON.stringify(this.stats)))}ca.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0};ca.prototype.splitTile=function(e,t,r,n,i,o,a){for(var s=[e,t,r,n],l=this.options,u=l.debug;s.length;){n=s.pop(),r=s.pop(),t=s.pop(),e=s.pop();var c=1<<t,p=rl(t,r,n),f=this.tiles[p];if(!f&&(u>1&&console.time("creation"),f=this.tiles[p]=tl(e,t,r,n,l),this.tileCoords.push({z:t,x:r,y:n}),u)){u>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",t,r,n,f.numFeatures,f.numPoints,f.numSimplified),console.timeEnd("creation"));var y="z"+t;this.stats[y]=(this.stats[y]||0)+1,this.total++}if(f.source=e,i){if(t===l.maxZoom||t===i)continue;var m=1<<i-t;if(r!==Math.floor(o/m)||n!==Math.floor(a/m))continue}else if(t===l.indexMaxZoom||f.numPoints<=l.indexMaxPoints)continue;if(f.source=null,e.length!==0){u>1&&console.time("clipping");var h=.5*l.buffer/l.extent,d=.5-h,g=.5+h,v=1+h,b,x,P,w,A,T;b=x=P=w=null,A=Ue(e,c,r-h,r+g,0,f.minX,f.maxX,l),T=Ue(e,c,r+d,r+v,0,f.minX,f.maxX,l),e=null,A&&(b=Ue(A,c,n-h,n+g,1,f.minY,f.maxY,l),x=Ue(A,c,n+d,n+v,1,f.minY,f.maxY,l),A=null),T&&(P=Ue(T,c,n-h,n+g,1,f.minY,f.maxY,l),w=Ue(T,c,n+d,n+v,1,f.minY,f.maxY,l),T=null),u>1&&console.timeEnd("clipping"),s.push(b||[],t+1,r*2,n*2),s.push(x||[],t+1,r*2,n*2+1),s.push(P||[],t+1,r*2+1,n*2),s.push(w||[],t+1,r*2+1,n*2+1)}}};ca.prototype.getTile=function(e,t,r){var n=this.options,i=n.extent,o=n.debug;if(e<0||e>24)return null;var a=1<<e;t=(t%a+a)%a;var s=rl(e,t,r);if(this.tiles[s])return ua(this.tiles[s],i);o>1&&console.log("drilling down to z%d-%d-%d",e,t,r);for(var l=e,u=t,c=r,p;!p&&l>0;)l--,u=Math.floor(u/2),c=Math.floor(c/2),p=this.tiles[rl(l,u,c)];return!p||!p.source?null:(o>1&&console.log("found parent tile z%d-%d-%d",l,u,c),o>1&&console.time("drilling down"),this.splitTile(p.source,l,u,c,e,t,r),o>1&&console.timeEnd("drilling down"),this.tiles[s]?ua(this.tiles[s],i):null)};function rl(e,t,r){return((1<<e)*r+t)*32+e}function Zx(e,t){for(var r in t)e[r]=t[r];return e}function pi(e,t){return t?e.properties[t]:e.id}function il(e,t){if(e==null)return!0;if(e.type==="Feature")return pi(e,t)!=null;if(e.type==="FeatureCollection"){let r=new Set;for(let n of e.features){let i=pi(n,t);if(i==null||r.has(i))return!1;r.add(i)}return!0}return!1}function ol(e,t){let r=new Map;if(e!=null)if(e.type==="Feature")r.set(pi(e,t),e);else for(let n of e.features)r.set(pi(n,t),n);return r}function If(e,t,r){var n,i,o,a;if(t.removeAll&&e.clear(),t.remove)for(let s of t.remove)e.delete(s);if(t.add)for(let s of t.add){let l=pi(s,r);l!=null&&e.set(l,s)}if(t.update)for(let s of t.update){let l=e.get(s.id);if(l==null)continue;let u=s.newGeometry||s.removeAllProperties,c=!s.removeAllProperties&&(((n=s.removeProperties)==null?void 0:n.length)>0||((i=s.addOrUpdateProperties)==null?void 0:i.length)>0);if((u||c)&&(l={...l},e.set(s.id,l),c&&(l.properties={...l.properties})),s.newGeometry&&(l.geometry=s.newGeometry),s.removeAllProperties)l.properties={};else if(((o=s.removeProperties)==null?void 0:o.length)>0)for(let p of s.removeProperties)Object.prototype.hasOwnProperty.call(l.properties,p)&&delete l.properties[p];if(((a=s.addOrUpdateProperties)==null?void 0:a.length)>0)for(let{key:p,value:f}of s.addOrUpdateProperties)l.properties[p]=f}}function Jx(e,t){let r=e.tileID.canonical;if(!this._geoJSONIndex)return t(null,null);let n=this._geoJSONIndex.getTile(r.z,r.x,r.y);if(!n)return t(null,null);let i=new ia(n.features),o=(0,kf.default)(i);(o.byteOffset!==0||o.byteLength!==o.buffer.byteLength)&&(o=new Uint8Array(o)),t(null,{vectorTile:i,rawData:o.buffer})}var pa=class extends Br{constructor(r,n,i,o){super(r,n,i,Jx);this._dataUpdateable=new Map;this.loadGeoJSON=(r,n)=>{let{promoteId:i}=r;if(r.request)return gu(r.request,(o,a,s,l)=>{this._dataUpdateable=il(a,i)?ol(a,i):void 0,n(o,a,s,l)});if(typeof r.data=="string")try{let o=JSON.parse(r.data);this._dataUpdateable=il(o,i)?ol(o,i):void 0,n(null,o)}catch{n(new Error("Input data given to \'".concat(r.source,"\' is not a valid GeoJSON object.")))}else r.dataDiff?this._dataUpdateable?(If(this._dataUpdateable,r.dataDiff,i),n(null,{type:"FeatureCollection",features:Array.from(this._dataUpdateable.values())})):n(new Error("Cannot update existing geojson data in ".concat(r.source))):n(new Error("Input data given to \'".concat(r.source,"\' is not a valid GeoJSON object.")));return{cancel:()=>{}}};o&&(this.loadGeoJSON=o)}loadData(r,n){var o;(o=this._pendingRequest)==null||o.cancel(),this._pendingCallback&&this._pendingCallback(null,{abandoned:!0});let i=r&&r.request&&r.request.collectResourceTiming?new Vr(r.request):!1;this._pendingCallback=n,this._pendingRequest=this.loadGeoJSON(r,(a,s)=>{if(delete this._pendingCallback,delete this._pendingRequest,a||!s)return n(a);if(typeof s!="object")return n(new Error("Input data given to \'".concat(r.source,"\' is not a valid GeoJSON object.")));{(0,Cf.default)(s,!0);try{if(r.filter){let u=Rt(r.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if(u.result==="error")throw new Error(u.value.map(p=>"".concat(p.key,": ").concat(p.message)).join(", "));s={type:"FeatureCollection",features:s.features.filter(p=>u.value.evaluate({zoom:0},p))}}this._geoJSONIndex=r.cluster?new ui(Wx(r)).load(s.features):nl(s,r.geojsonVtOptions)}catch(u){return n(u)}this.loaded={};let l={};if(i){let u=i.finish();u&&(l.resourceTiming={},l.resourceTiming[r.source]=JSON.parse(JSON.stringify(u)))}n(null,l)}})}reloadTile(r,n){let i=this.loaded,o=r.uid;return i&&i[o]?super.reloadTile(r,n):this.loadTile(r,n)}removeSource(r,n){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),n()}getClusterExpansionZoom(r,n){try{n(null,this._geoJSONIndex.getClusterExpansionZoom(r.clusterId))}catch(i){n(i)}}getClusterChildren(r,n){try{n(null,this._geoJSONIndex.getChildren(r.clusterId))}catch(i){n(i)}}getClusterLeaves(r,n){try{n(null,this._geoJSONIndex.getLeaves(r.clusterId,r.limit,r.offset))}catch(i){n(i)}}};function Wx({superclusterOptions:e,clusterProperties:t}){if(!t||!e)return e;let r={},n={},i={accumulated:null,zoom:0},o={properties:null},a=Object.keys(t);for(let s of a){let[l,u]=t[s],c=Rt(u),p=Rt(typeof l=="string"?[l,["accumulated"],["get",s]]:l);r[s]=c.value,n[s]=p.value}return e.map=s=>{o.properties=s;let l={};for(let u of a)l[u]=r[u].evaluate(i,o);return l},e.reduce=(s,l)=>{o.properties=l;for(let u of a)i.accumulated=s[u],s[u]=n[u].evaluate(i,o)},e}var fa=class{constructor(t){this.self=t,this.actor=new Oi(t,this),this.layerIndexes={},this.availableImages={},this.workerSourceTypes={vector:Br,geojson:pa},this.workerSources={},this.demWorkerSources={},this.self.registerWorkerSource=(r,n)=>{if(this.workerSourceTypes[r])throw new Error(\'Worker source with name "\'.concat(r,\'" already registered.\'));this.workerSourceTypes[r]=n},this.self.registerRTLTextPlugin=r=>{if(ae.isParsed())throw new Error("RTL text plugin already registered.");ae.applyArabicShaping=r.applyArabicShaping,ae.processBidirectionalText=r.processBidirectionalText,ae.processStyledBidirectionalText=r.processStyledBidirectionalText}}setReferrer(t,r){this.referrer=r}setImages(t,r,n){this.availableImages[t]=r;for(let i in this.workerSources[t]){let o=this.workerSources[t][i];for(let a in o)o[a].availableImages=r}n()}setLayers(t,r,n){this.getLayerIndex(t).replace(r),n()}updateLayers(t,r,n){this.getLayerIndex(t).update(r.layers,r.removedIds),n()}loadTile(t,r,n){this.getWorkerSource(t,r.type,r.source).loadTile(r,n)}loadDEMTile(t,r,n){this.getDEMWorkerSource(t,r.source).loadTile(r,n)}reloadTile(t,r,n){this.getWorkerSource(t,r.type,r.source).reloadTile(r,n)}abortTile(t,r,n){this.getWorkerSource(t,r.type,r.source).abortTile(r,n)}removeTile(t,r,n){this.getWorkerSource(t,r.type,r.source).removeTile(r,n)}removeDEMTile(t,r){this.getDEMWorkerSource(t,r.source).removeTile(r)}removeSource(t,r,n){if(!this.workerSources[t]||!this.workerSources[t][r.type]||!this.workerSources[t][r.type][r.source])return;let i=this.workerSources[t][r.type][r.source];delete this.workerSources[t][r.type][r.source],i.removeSource!==void 0?i.removeSource(r,n):n()}loadWorkerSource(t,r,n){try{this.self.importScripts(r.url),n()}catch(i){n(i.toString())}}syncRTLPluginState(t,r,n){try{ae.setState(r);let i=ae.getPluginURL();if(ae.isLoaded()&&!ae.isParsed()&&i!=null){this.self.importScripts(i);let o=ae.isParsed(),a=o?void 0:new Error("RTL Text Plugin failed to import scripts from ".concat(i));n(a,o)}}catch(i){n(i.toString())}}getAvailableImages(t){let r=this.availableImages[t];return r||(r=[]),r}getLayerIndex(t){let r=this.layerIndexes[t];return r||(r=this.layerIndexes[t]=new Jo),r}getWorkerSource(t,r,n){if(this.workerSources[t]||(this.workerSources[t]={}),this.workerSources[t][r]||(this.workerSources[t][r]={}),!this.workerSources[t][r][n]){let i={send:(o,a,s)=>{this.actor.send(o,a,s,t)}};this.workerSources[t][r][n]=new this.workerSourceTypes[r](i,this.getLayerIndex(t),this.getAvailableImages(t))}return this.workerSources[t][r][n]}getDEMWorkerSource(t,r){return this.demWorkerSources[t]||(this.demWorkerSources[t]={}),this.demWorkerSources[t][r]||(this.demWorkerSources[t][r]=new ra),this.demWorkerSources[t][r]}};Ie()&&(self.worker=new fa(self));})();\n/*! Bundled license information:\n\nieee754/index.js:\n (*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> *)\n*/\n';var QM=u(()=>URL.createObjectURL(new Blob([Q_],{type:"text/javascript"})),"getWorkerURL");function ev(){return new Worker(QM())}u(ev,"workerFactory");var vl="mapboxgl_preloaded_worker_pool",_l=class _l{constructor(){this.active={}}acquire(e){if(!this.workers)for(this.workers=[];this.workers.length<_l.workerCount;)this.workers.push(ev());return this.active[e]=!0,this.workers.slice()}release(e){delete this.active[e],this.numActive()===0&&(this.workers.forEach(t=>{t.terminate()}),this.workers=null)}isPreloaded(){return!!this.active[vl]}numActive(){return Object.keys(this.active).length}};u(_l,"WorkerPool");var Fr=_l,eC=Math.floor(ne.hardwareConcurrency/2);Fr.workerCount=qr(globalThis)?Math.max(Math.min(eC,3),1):1;var Ha;function wm(){return Ha||(Ha=new Fr),Ha}u(wm,"getGlobalWorkerPool");function tv(){wm().acquire(vl)}u(tv,"prewarm");function rv(){let r=Ha;r&&(r.isPreloaded()&&r.numActive()===1?(r.release(vl),Ha=null):console.warn("Could not clear WebWorkers since there are active Map instances that still reference it. The pre-warmed WebWorker pool can only be cleared when all map instances have been removed with map.remove()"))}u(rv,"clearPrewarmedResources");d();d();d();var Zt=ae(Pe(),1);d();var sr=ae(Pe(),1);function Sm(r,e,t,i,n){let a=[];for(let o=0;o<r.length;o++){let s=r[o],l;for(let c=0;c<s.length-1;c++){let p=s[c],h=s[c+1];p.x<e&&h.x<e||(p.x<e?p=new sr.default(e,p.y+(h.y-p.y)*((e-p.x)/(h.x-p.x)))._round():h.x<e&&(h=new sr.default(e,p.y+(h.y-p.y)*((e-p.x)/(h.x-p.x)))._round()),!(p.y<t&&h.y<t)&&(p.y<t?p=new sr.default(p.x+(h.x-p.x)*((t-p.y)/(h.y-p.y)),t)._round():h.y<t&&(h=new sr.default(p.x+(h.x-p.x)*((t-p.y)/(h.y-p.y)),t)._round()),!(p.x>=i&&h.x>=i)&&(p.x>=i?p=new sr.default(i,p.y+(h.y-p.y)*((i-p.x)/(h.x-p.x)))._round():h.x>=i&&(h=new sr.default(i,p.y+(h.y-p.y)*((i-p.x)/(h.x-p.x)))._round()),!(p.y>=n&&h.y>=n)&&(p.y>=n?p=new sr.default(p.x+(h.x-p.x)*((n-p.y)/(h.y-p.y)),n)._round():h.y>=n&&(h=new sr.default(p.x+(h.x-p.x)*((n-p.y)/(h.y-p.y)),n)._round()),(!l||!p.equals(l[l.length-1]))&&(l=[p],a.push(l)),l.push(h)))))}}return a}u(Sm,"clipLine");d();var Pm=class Pm{constructor(e,t){this.reset(e,t)}reset(e,t){this.points=e||[],this._distances=[0];for(let i=1;i<this.points.length;i++)this._distances[i]=this._distances[i-1]+this.points[i].dist(this.points[i-1]);this.length=this._distances[this._distances.length-1],this.padding=Math.min(t||0,this.length*.5),this.paddedLength=this.length-this.padding*2}lerp(e){if(this.points.length===1)return this.points[0];e=Te(e,0,1);let t=1,i=this._distances[t],n=e*this.paddedLength+this.padding;for(;i<n&&t<this._distances.length;)i=this._distances[++t];let a=t-1,o=this._distances[a],s=i-o,l=s>0?(n-o)/s:0;return this.points[a].mult(1-l).add(this.points[t].mult(l))}};u(Pm,"PathInterpolator");var wl=Pm;d();function Sl(r,e){let t=!0;return r==="always"||(r==="never"||e==="never")&&(t=!1),t}u(Sl,"overlapAllowed");var Tm=class Tm{constructor(e,t,i){let n=this.boxCells=[],a=this.circleCells=[];this.xCellCount=Math.ceil(e/i),this.yCellCount=Math.ceil(t/i);for(let o=0;o<this.xCellCount*this.yCellCount;o++)n.push([]),a.push([]);this.circleKeys=[],this.boxKeys=[],this.bboxes=[],this.circles=[],this.width=e,this.height=t,this.xScale=this.xCellCount/e,this.yScale=this.yCellCount/t,this.boxUid=0,this.circleUid=0}keysLength(){return this.boxKeys.length+this.circleKeys.length}insert(e,t,i,n,a){this._forEachCell(t,i,n,a,this._insertBoxCell,this.boxUid++),this.boxKeys.push(e),this.bboxes.push(t),this.bboxes.push(i),this.bboxes.push(n),this.bboxes.push(a)}insertCircle(e,t,i,n){this._forEachCell(t-n,i-n,t+n,i+n,this._insertCircleCell,this.circleUid++),this.circleKeys.push(e),this.circles.push(t),this.circles.push(i),this.circles.push(n)}_insertBoxCell(e,t,i,n,a,o){this.boxCells[a].push(o)}_insertCircleCell(e,t,i,n,a,o){this.circleCells[a].push(o)}_query(e,t,i,n,a,o,s){if(i<0||e>this.width||n<0||t>this.height)return[];let l=[];if(e<=0&&t<=0&&this.width<=i&&this.height<=n){if(a)return[{key:null,x1:e,y1:t,x2:i,y2:n}];for(let c=0;c<this.boxKeys.length;c++)l.push({key:this.boxKeys[c],x1:this.bboxes[c*4],y1:this.bboxes[c*4+1],x2:this.bboxes[c*4+2],y2:this.bboxes[c*4+3]});for(let c=0;c<this.circleKeys.length;c++){let p=this.circles[c*3],h=this.circles[c*3+1],f=this.circles[c*3+2];l.push({key:this.circleKeys[c],x1:p-f,y1:h-f,x2:p+f,y2:h+f})}}else{let c={hitTest:a,overlapMode:o,seenUids:{box:{},circle:{}}};this._forEachCell(e,t,i,n,this._queryCell,l,c,s)}return l}query(e,t,i,n){return this._query(e,t,i,n,!1,null)}hitTest(e,t,i,n,a,o){return this._query(e,t,i,n,!0,a,o).length>0}hitTestCircle(e,t,i,n,a){let o=e-i,s=e+i,l=t-i,c=t+i;if(s<0||o>this.width||c<0||l>this.height)return!1;let p=[],h={hitTest:!0,overlapMode:n,circle:{x:e,y:t,radius:i},seenUids:{box:{},circle:{}}};return this._forEachCell(o,l,s,c,this._queryCellCircle,p,h,a),p.length>0}_queryCell(e,t,i,n,a,o,s,l){let{seenUids:c,hitTest:p,overlapMode:h}=s,f=this.boxCells[a];if(f!==null){let g=this.bboxes;for(let y of f)if(!c.box[y]){c.box[y]=!0;let x=y*4,b=this.boxKeys[y];if(e<=g[x+2]&&t<=g[x+3]&&i>=g[x+0]&&n>=g[x+1]&&(!l||l(b))&&(!p||!Sl(h,b.overlapMode))&&(o.push({key:b,x1:g[x],y1:g[x+1],x2:g[x+2],y2:g[x+3]}),p))return!0}}let m=this.circleCells[a];if(m!==null){let g=this.circles;for(let y of m)if(!c.circle[y]){c.circle[y]=!0;let x=y*3,b=this.circleKeys[y];if(this._circleAndRectCollide(g[x],g[x+1],g[x+2],e,t,i,n)&&(!l||l(b))&&(!p||!Sl(h,b.overlapMode))){let _=g[x],v=g[x+1],S=g[x+2];if(o.push({key:b,x1:_-S,y1:v-S,x2:_+S,y2:v+S}),p)return!0}}}return!1}_queryCellCircle(e,t,i,n,a,o,s,l){let{circle:c,seenUids:p,overlapMode:h}=s,f=this.boxCells[a];if(f!==null){let g=this.bboxes;for(let y of f)if(!p.box[y]){p.box[y]=!0;let x=y*4,b=this.boxKeys[y];if(this._circleAndRectCollide(c.x,c.y,c.radius,g[x+0],g[x+1],g[x+2],g[x+3])&&(!l||l(b))&&!Sl(h,b.overlapMode))return o.push(!0),!0}}let m=this.circleCells[a];if(m!==null){let g=this.circles;for(let y of m)if(!p.circle[y]){p.circle[y]=!0;let x=y*3,b=this.circleKeys[y];if(this._circlesCollide(g[x],g[x+1],g[x+2],c.x,c.y,c.radius)&&(!l||l(b))&&!Sl(h,b.overlapMode))return o.push(!0),!0}}}_forEachCell(e,t,i,n,a,o,s,l){let c=this._convertToXCellCoord(e),p=this._convertToYCellCoord(t),h=this._convertToXCellCoord(i),f=this._convertToYCellCoord(n);for(let m=c;m<=h;m++)for(let g=p;g<=f;g++){let y=this.xCellCount*g+m;if(a.call(this,e,t,i,n,y,o,s,l))return}}_convertToXCellCoord(e){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(e*this.xScale)))}_convertToYCellCoord(e){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(e*this.yScale)))}_circlesCollide(e,t,i,n,a,o){let s=n-e,l=a-t,c=i+o;return c*c>s*s+l*l}_circleAndRectCollide(e,t,i,n,a,o,s){let l=(o-n)/2,c=Math.abs(e-(n+l));if(c>l+i)return!1;let p=(s-a)/2,h=Math.abs(t-(a+p));if(h>p+i)return!1;if(c<=l||h<=p)return!0;let f=c-l,m=h-p;return f*f+m*m<=i*i}};u(Tm,"GridIndex");var Za=Tm;d();var yn=ae(Pe(),1);function Wa(r,e,t,i,n){let a=q.create();return e?(q.scale(a,a,[1/n,1/n,1]),t||q.rotateZ(a,a,i.angle)):q.multiply(a,i.labelPlaneMatrix,r),a}u(Wa,"getLabelPlaneMatrix");function Tl(r,e,t,i,n){if(e){let a=q.clone(r);return q.scale(a,a,[n,n,1]),t||q.rotateZ(a,a,-i.angle),a}else return i.glCoordMatrix}u(Tl,"getGlCoordMatrix");function bt(r,e,t){let i;t?(i=[r.x,r.y,t(r.x,r.y),1],Xe.transformMat4(i,i,e)):(i=[r.x,r.y,0,1],Al(i,i,e));let n=i[3];return{point:new yn.default(i[0]/n,i[1]/n),signedDistanceFromCamera:n}}u(bt,"project");function Xa(r,e){return .5+.5*(r/e)}u(Xa,"getPerspectiveRatio");function tC(r,e){let t=r[0]/r[3],i=r[1]/r[3];return t>=-e[0]&&t<=e[0]&&i>=-e[1]&&i<=e[1]}u(tC,"isVisible");function av(r,e,t,i,n,a,o,s,l,c){let p=i?r.textSizeData:r.iconSizeData,h=ci(p,t.transform.zoom),f=[256/t.width*2+1,256/t.height*2+1],m=i?r.text.dynamicLayoutVertexArray:r.icon.dynamicLayoutVertexArray;m.clear();let g=r.lineVertexArray,y=i?r.text.placedSymbolArray:r.icon.placedSymbolArray,x=t.transform.width/t.transform.height,b=!1;for(let _=0;_<y.length;_++){let v=y.get(_);if(v.hidden||v.writingMode===2&&!b){yi(v.numGlyphs,m);continue}b=!1;let S;if(c?(S=[v.anchorX,v.anchorY,c(v.anchorX,v.anchorY),1],Xe.transformMat4(S,S,e)):(S=[v.anchorX,v.anchorY,0,1],Al(S,S,e)),!tC(S,f)){yi(v.numGlyphs,m);continue}let P=S[3],T=Xa(t.transform.cameraToCenterDistance,P),A=rn(p,h,v),L=o?A/T:A*T,C=new yn.default(v.anchorX,v.anchorY),I=bt(C,n,c).point,D={projections:{},offsets:{}},F=nv(v,L,!1,s,e,n,a,r.glyphOffsetArray,g,m,I,C,D,x,l,c);b=F.useVertical,(F.notEnoughRoom||b||F.needsFlipping&&nv(v,L,!0,s,e,n,a,r.glyphOffsetArray,g,m,I,C,D,x,l,c).notEnoughRoom)&&yi(v.numGlyphs,m)}i?r.text.dynamicLayoutVertexBuffer.updateData(m):r.icon.dynamicLayoutVertexBuffer.updateData(m)}u(av,"updateLineLabels");function Mm(r,e,t,i,n,a,o,s,l,c,p,h,f){let m=s.glyphStartIndex+s.numGlyphs,g=s.lineStartIndex,y=s.lineStartIndex+s.lineLength,x=e.getoffsetX(s.glyphStartIndex),b=e.getoffsetX(m-1),_=Pl(r*x,t,i,n,a,o,s.segment,g,y,l,c,p,h,f);if(!_)return null;let v=Pl(r*b,t,i,n,a,o,s.segment,g,y,l,c,p,h,f);return v?{first:_,last:v}:null}u(Mm,"placeFirstAndLastGlyph");function iv(r,e,t,i){if(r===1){let n=Math.abs(t.y-e.y),a=Math.abs(t.x-e.x)*i;if(n>a)return{useVertical:!0}}return(r===2?e.y<t.y:e.x>t.x)?{needsFlipping:!0}:null}u(iv,"requiresOrientationChange");function nv(r,e,t,i,n,a,o,s,l,c,p,h,f,m,g,y){let x=e/24,b=r.lineOffsetX*x,_=r.lineOffsetY*x,v;if(r.numGlyphs>1){let S=r.glyphStartIndex+r.numGlyphs,P=r.lineStartIndex,T=r.lineStartIndex+r.lineLength,A=Mm(x,s,b,_,t,p,h,r,l,a,f,g,y);if(!A)return{notEnoughRoom:!0};let L=bt(A.first.point,o,y).point,C=bt(A.last.point,o,y).point;if(i&&!t){let I=iv(r.writingMode,L,C,m);if(I)return I}v=[A.first];for(let I=r.glyphStartIndex+1;I<S-1;I++)v.push(Pl(x*s.getoffsetX(I),b,_,t,p,h,r.segment,P,T,l,a,f,g,y));v.push(A.last)}else{if(i&&!t){let P=bt(h,n,y).point,T=r.lineStartIndex+r.segment+1,A=new yn.default(l.getx(T),l.gety(T)),L=bt(A,n,y),C=L.signedDistanceFromCamera>0?L.point:ov(h,A,P,1,n,y),I=iv(r.writingMode,P,C,m);if(I)return I}let S=Pl(x*s.getoffsetX(r.glyphStartIndex),b,_,t,p,h,r.segment,r.lineStartIndex,r.lineStartIndex+r.lineLength,l,a,f,g,y);if(!S)return{notEnoughRoom:!0};v=[S]}for(let S of v)pi(c,S.point,S.angle);return{}}u(nv,"placeGlyphsAlongLine");function ov(r,e,t,i,n,a){let o=bt(r.add(r.sub(e)._unit()),n,a).point,s=t.sub(o);return t.add(s._mult(i/s.mag()))}u(ov,"projectTruncatedLineSegment");function Am(r,e){let{projectionCache:t,lineVertexArray:i,labelPlaneMatrix:n,tileAnchorPoint:a,distanceFromAnchor:o,getElevation:s,previousVertex:l,direction:c,absOffsetX:p}=e;if(t.projections[r])return t.projections[r];let h=new yn.default(i.getx(r),i.gety(r)),f=bt(h,n,s);if(f.signedDistanceFromCamera>0)return t.projections[r]=f.point,f.point;let m=r-c,g=o===0?a:new yn.default(i.getx(m),i.gety(m));return ov(g,h,l,p-o+1,n,s)}u(Am,"projectVertexToViewport");function Im(r,e,t){return r._unit()._perp()._mult(e*t)}u(Im,"transformToOffsetNormal");function rC(r,e,t,i,n,a,o,s){let{projectionCache:l,direction:c}=s;if(l.offsets[r])return l.offsets[r];let p=t.add(e);if(r+c<i||r+c>=n)return l.offsets[r]=p,p;let h=Am(r+c,s),f=Im(h.sub(t),o,c),m=t.add(f),g=h.add(f);return l.offsets[r]=Yy(a,p,m,g)||p,l.offsets[r]}u(rC,"findOffsetIntersectionPoint");function Pl(r,e,t,i,n,a,o,s,l,c,p,h,f,m){let g=i?r-e:r+e,y=g>0?1:-1,x=0;i&&(y*=-1,x=Math.PI),y<0&&(x+=Math.PI);let b=y>0?s+o:s+o+1,_=n,v=n,S,P,T=0,A=0,L=Math.abs(g),C=[],I;for(;T+A<=L;){if(b+=y,b<s||b>=l)return null;T+=A,v=_,P=S;let E={projectionCache:h,lineVertexArray:c,labelPlaneMatrix:p,tileAnchorPoint:a,distanceFromAnchor:T,getElevation:m,previousVertex:v,direction:y,absOffsetX:L};if(_=Am(b,E),t===0)C.push(v),I=_.sub(v);else{let O,X=_.sub(v);if(X.mag()===0){let H=Am(b+y,E);O=Im(H.sub(_),t,y)}else O=Im(X,t,y);P||(P=v.add(O)),S=rC(b,O,_,s,l,P,t,E),C.push(P),I=S.sub(P)}A=I.mag()}let D=(L-T)/A,F=I._mult(D)._add(P||v),k=x+Math.atan2(_.y-v.y,_.x-v.x);return C.push(F),{point:F,angle:f?k:0,path:C}}u(Pl,"placeGlyphAlongLine");var iC=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function yi(r,e){for(let t=0;t<r;t++){let i=e.length;e.resize(i+4),e.float32.set(iC,i*3)}}u(yi,"hideGlyphs");function Al(r,e,t){let i=e[0],n=e[1];return r[0]=t[0]*i+t[4]*n+t[12],r[1]=t[1]*i+t[5]*n+t[13],r[3]=t[3]*i+t[7]*n+t[15],r}u(Al,"xyTransformMat4");var Ye=100,Em=class Em{constructor(e,t=new Za(e.width+2*Ye,e.height+2*Ye,25),i=new Za(e.width+2*Ye,e.height+2*Ye,25)){this.transform=e,this.grid=t,this.ignoredGrid=i,this.pitchfactor=Math.cos(e._pitch)*e.cameraToCenterDistance,this.screenRightBoundary=e.width+Ye,this.screenBottomBoundary=e.height+Ye,this.gridRightBoundary=e.width+2*Ye,this.gridBottomBoundary=e.height+2*Ye,this.perspectiveRatioCutoff=.6}placeCollisionBox(e,t,i,n,a,o){let s=this.projectAndGetPerspectiveRatio(n,e.anchorPointX,e.anchorPointY,o),l=i*s.perspectiveRatio,c=e.x1*l+s.point.x,p=e.y1*l+s.point.y,h=e.x2*l+s.point.x,f=e.y2*l+s.point.y;return!this.isInsideGrid(c,p,h,f)||t!=="always"&&this.grid.hitTest(c,p,h,f,t,a)||s.perspectiveRatio<this.perspectiveRatioCutoff?{box:[],offscreen:!1}:{box:[c,p,h,f],offscreen:this.isOffscreen(c,p,h,f)}}placeCollisionCircles(e,t,i,n,a,o,s,l,c,p,h,f,m,g){let y=[],x=new Zt.default(t.anchorX,t.anchorY),b=bt(x,o,g),_=Xa(this.transform.cameraToCenterDistance,b.signedDistanceFromCamera),S=(p?a/_:a*_)/li,P=bt(x,s,g).point,T={projections:{},offsets:{}},A=t.lineOffsetX*S,L=t.lineOffsetY*S,C=Mm(S,n,A,L,!1,P,x,t,i,s,T,!1,g),I=!1,D=!1,F=!0;if(C){let k=f*.5*_+m,E=new Zt.default(-Ye,-Ye),O=new Zt.default(this.screenRightBoundary,this.screenBottomBoundary),X=new wl,H=C.first,fe=C.last,J=[];for(let ue=H.path.length-1;ue>=1;ue--)J.push(H.path[ue]);for(let ue=1;ue<fe.path.length;ue++)J.push(fe.path[ue]);let Qe=k*2.5;if(l){let ue=J.map(Me=>bt(Me,l,g));ue.some(Me=>Me.signedDistanceFromCamera<=0)?J=[]:J=ue.map(Me=>Me.point)}let Je=[];if(J.length>0){let ue=J[0].clone(),Me=J[0].clone();for(let et=1;et<J.length;et++)ue.x=Math.min(ue.x,J[et].x),ue.y=Math.min(ue.y,J[et].y),Me.x=Math.max(Me.x,J[et].x),Me.y=Math.max(Me.y,J[et].y);ue.x>=E.x&&Me.x<=O.x&&ue.y>=E.y&&Me.y<=O.y?Je=[J]:Me.x<E.x||ue.x>O.x||Me.y<E.y||ue.y>O.y?Je=[]:Je=Sm([J],E.x,E.y,O.x,O.y)}for(let ue of Je){X.reset(ue,k*.25);let Me=0;X.length<=.5*k?Me=1:Me=Math.ceil(X.paddedLength/Qe)+1;for(let et=0;et<Me;et++){let ur=et/Math.max(Me-1,1),cr=X.lerp(ur),zt=cr.x+Ye,Xt=cr.y+Ye;y.push(zt,Xt,k,0);let Nr=zt-k,tt=Xt-k,He=zt+k,ge=Xt+k;if(F=F&&this.isOffscreen(Nr,tt,He,ge),D=D||this.isInsideGrid(Nr,tt,He,ge),e!=="always"&&this.grid.hitTestCircle(zt,Xt,k,e,h)&&(I=!0,!c))return{circles:[],offscreen:!1,collisionDetected:I}}}}return{circles:!c&&I||!D||_<this.perspectiveRatioCutoff?[]:y,offscreen:F,collisionDetected:I}}queryRenderedSymbols(e){if(e.length===0||this.grid.keysLength()===0&&this.ignoredGrid.keysLength()===0)return{};let t=[],i=1/0,n=1/0,a=-1/0,o=-1/0;for(let p of e){let h=new Zt.default(p.x+Ye,p.y+Ye);i=Math.min(i,h.x),n=Math.min(n,h.y),a=Math.max(a,h.x),o=Math.max(o,h.y),t.push(h)}let s=this.grid.query(i,n,a,o).concat(this.ignoredGrid.query(i,n,a,o)),l={},c={};for(let p of s){let h=p.key;if(l[h.bucketInstanceId]===void 0&&(l[h.bucketInstanceId]={}),l[h.bucketInstanceId][h.featureIndex])continue;let f=[new Zt.default(p.x1,p.y1),new Zt.default(p.x2,p.y1),new Zt.default(p.x2,p.y2),new Zt.default(p.x1,p.y2)];Fs(t,f)&&(l[h.bucketInstanceId][h.featureIndex]=!0,c[h.bucketInstanceId]===void 0&&(c[h.bucketInstanceId]=[]),c[h.bucketInstanceId].push(h.featureIndex))}return c}insertCollisionBox(e,t,i,n,a,o){let s=i?this.ignoredGrid:this.grid,l={bucketInstanceId:n,featureIndex:a,collisionGroupID:o,overlapMode:t};s.insert(l,e[0],e[1],e[2],e[3])}insertCollisionCircles(e,t,i,n,a,o){let s=i?this.ignoredGrid:this.grid,l={bucketInstanceId:n,featureIndex:a,collisionGroupID:o,overlapMode:t};for(let c=0;c<e.length;c+=4)s.insertCircle(l,e[c],e[c+1],e[c+2])}projectAndGetPerspectiveRatio(e,t,i,n){let a;return n?(a=[t,i,n(t,i),1],Xe.transformMat4(a,a,e)):(a=[t,i,0,1],Al(a,a,e)),{point:new Zt.default((a[0]/a[3]+1)/2*this.transform.width+Ye,(-a[1]/a[3]+1)/2*this.transform.height+Ye),perspectiveRatio:.5+.5*(this.transform.cameraToCenterDistance/a[3])}}isOffscreen(e,t,i,n){return i<Ye||e>=this.screenRightBoundary||n<Ye||t>this.screenBottomBoundary}isInsideGrid(e,t,i,n){return i>=0&&e<this.gridRightBoundary&&n>=0&&t<this.gridBottomBoundary}getViewportMatrix(){let e=q.identity([]);return q.translate(e,e,[-Ye,-Ye,0]),e}};u(Em,"CollisionIndex");var Il=Em;d();d();var sv=ae(Pe(),1);var Ml=class Ml extends sv.default{constructor(t,i,n,a){super(t,i);this.angle=n,a!==void 0&&(this.segment=a)}clone(){return new Ml(this.x,this.y,this.angle,this.segment)}};u(Ml,"Anchor");var Ka=Ml;G("Anchor",Ka);d();d();d();var nC=ae(Pe(),1);d();var aC=ae(Pe(),1);d();var oC=ae(uw(),1),sC=ae(Pe(),1);var lC=ae(Vh(),1);var gn=7,uC=Number.POSITIVE_INFINITY;function Cl(r,e){function t(n,a){let o=0,s=0;a<0&&(a=0);let l=a/Math.sqrt(2);switch(n){case"top-right":case"top-left":s=l-gn;break;case"bottom-right":case"bottom-left":s=-l+gn;break;case"bottom":s=-a+gn;break;case"top":s=a-gn;break}switch(n){case"top-right":case"bottom-right":o=-l;break;case"top-left":case"bottom-left":o=l;break;case"left":o=a;break;case"right":o=-a;break}return[o,s]}u(t,"fromRadialOffset");function i(n,a,o){let s=0,l=0;switch(a=Math.abs(a),o=Math.abs(o),n){case"top-right":case"top-left":case"top":l=o-gn;break;case"bottom-right":case"bottom-left":case"bottom":l=-o+gn;break}switch(n){case"top-right":case"bottom-right":case"right":s=-a;break;case"top-left":case"bottom-left":case"left":s=a;break}return[s,l]}return u(i,"fromTextOffset"),e[1]!==uC?i(r,e[0],e[1]):t(r,e[0])}u(Cl,"evaluateVariableOffset");function lv(r){switch(r){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}u(lv,"getAnchorJustification");d();function Ke(r,e,t){return e*(8192/(r.tileSize*Math.pow(2,t-r.tileID.overscaledZ)))}u(Ke,"pixelsToTileUnits");var zl=ae(Pe(),1);var Fm=class Fm{constructor(e,t,i,n){e?this.opacity=Math.max(0,Math.min(1,e.opacity+(e.placed?t:-t))):this.opacity=n&&i?1:0,this.placed=i}isHidden(){return this.opacity===0&&!this.placed}};u(Fm,"OpacityState");var kl=Fm,Bm=class Bm{constructor(e,t,i,n,a){this.text=new kl(e?e.text:null,t,i,a),this.icon=new kl(e?e.icon:null,t,n,a)}isHidden(){return this.text.isHidden()&&this.icon.isHidden()}};u(Bm,"JointOpacityState");var gi=Bm,Rm=class Rm{constructor(e,t,i){this.text=e,this.icon=t,this.skipFade=i}};u(Rm,"JointPlacement");var Ll=Rm,Om=class Om{constructor(){this.invProjMatrix=q.create(),this.viewportMatrix=q.create(),this.circles=[]}};u(Om,"CollisionCircleArray");var Lm=Om,Vm=class Vm{constructor(e,t,i,n,a){this.bucketInstanceId=e,this.featureIndex=t,this.sourceLayerIndex=i,this.bucketIndex=n,this.tileID=a}};u(Vm,"RetainedQueryData");var Dm=Vm,Um=class Um{constructor(e){this.crossSourceCollisions=e,this.maxGroupID=0,this.collisionGroups={}}get(e){if(this.crossSourceCollisions)return{ID:0,predicate:null};if(!this.collisionGroups[e]){let t=++this.maxGroupID;this.collisionGroups[e]={ID:t,predicate:i=>i.collisionGroupID===t}}return this.collisionGroups[e]}};u(Um,"CollisionGroups");var zm=Um;function uv(r,e,t,i,n){let{horizontalAlign:a,verticalAlign:o}=Js(r),s=-(a-.5)*e,l=-(o-.5)*t,c=Cl(r,i);return new zl.default(s+c[0]*n,l+c[1]*n)}u(uv,"calculateVariableLayoutShift");function km(r,e,t,i,n,a){let{x1:o,x2:s,y1:l,y2:c,anchorPointX:p,anchorPointY:h}=r,f=new zl.default(e,t);return i&&f._rotate(n?a:-a),{x1:o+f.x,y1:l+f.y,x2:s+f.x,y2:c+f.y,anchorPointX:p,anchorPointY:h}}u(km,"shiftVariableCollisionBox");var Nm=class Nm{constructor(e,t,i,n,a){this.transform=e.clone(),this.terrain=t,this.collisionIndex=new Il(this.transform),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=i,this.retainedQueryData={},this.collisionGroups=new zm(n),this.collisionCircleArrays={},this.prevPlacement=a,a&&(a.prevPlacement=void 0),this.placedOrientations={}}getBucketParts(e,t,i,n){let a=i.getBucket(t),o=i.latestFeatureIndex;if(!a||!o||t.id!==a.layerIds[0])return;let s=i.collisionBoxArray,l=a.layers[0].layout,c=Math.pow(2,this.transform.zoom-i.tileID.overscaledZ),p=i.tileSize/8192,h=this.transform.calculatePosMatrix(i.tileID.toUnwrapped()),f=l.get("text-pitch-alignment")==="map",m=l.get("text-rotation-alignment")==="map",g=Ke(i,1,this.transform.zoom),y=Wa(h,f,m,this.transform,g),x=null;if(f){let _=Tl(h,f,m,this.transform,g);x=q.multiply([],this.transform.labelPlaneMatrix,_)}this.retainedQueryData[a.bucketInstanceId]=new Dm(a.bucketInstanceId,o,a.sourceLayerIndex,a.index,i.tileID);let b={bucket:a,layout:l,posMatrix:h,textLabelPlaneMatrix:y,labelToScreenMatrix:x,scale:c,textPixelRatio:p,holdingForFade:i.holdingForFade(),collisionBoxArray:s,partiallyEvaluatedTextSize:ci(a.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(a.sourceID)};if(n)for(let _ of a.sortKeyRanges){let{sortKey:v,symbolInstanceStart:S,symbolInstanceEnd:P}=_;e.push({sortKey:v,symbolInstanceStart:S,symbolInstanceEnd:P,parameters:b})}else e.push({symbolInstanceStart:0,symbolInstanceEnd:a.symbolInstances.length,parameters:b})}attemptAnchorPlacement(e,t,i,n,a,o,s,l,c,p,h,f,m,g,y,x){let b=[f.textOffset0,f.textOffset1],_=uv(e,i,n,b,a),v=this.collisionIndex.placeCollisionBox(km(t,_.x,_.y,o,s,this.transform.angle),h,l,c,p.predicate,x);if(!(y&&this.collisionIndex.placeCollisionBox(km(y,_.x,_.y,o,s,this.transform.angle),h,l,c,p.predicate,x).box.length===0)&&v.box.length>0){let S;if(this.prevPlacement&&this.prevPlacement.variableOffsets[f.crossTileID]&&this.prevPlacement.placements[f.crossTileID]&&this.prevPlacement.placements[f.crossTileID].text&&(S=this.prevPlacement.variableOffsets[f.crossTileID].anchor),f.crossTileID===0)throw new Error("symbolInstance.crossTileID can't be 0");return this.variableOffsets[f.crossTileID]={textOffset:b,width:i,height:n,anchor:e,textBoxScale:a,prevAnchor:S},this.markUsedJustification(m,e,f,g),m.allowVerticalPlacement&&(this.markUsedOrientation(m,g,f),this.placedOrientations[f.crossTileID]=g),{shift:_,placedGlyphBoxes:v}}}placeLayerBucketPart(e,t,i){let{bucket:n,layout:a,posMatrix:o,textLabelPlaneMatrix:s,labelToScreenMatrix:l,textPixelRatio:c,holdingForFade:p,collisionBoxArray:h,partiallyEvaluatedTextSize:f,collisionGroup:m}=e.parameters,g=a.get("text-optional"),y=a.get("icon-optional"),x=nn(a,"text-overlap","text-allow-overlap"),b=x==="always",_=nn(a,"icon-overlap","icon-allow-overlap"),v=_==="always",S=a.get("text-rotation-alignment")==="map",P=a.get("text-pitch-alignment")==="map",T=a.get("icon-text-fit")!=="none",A=a.get("symbol-z-order")==="viewport-y",L=b&&(v||!n.hasIconData()||y),C=v&&(b||!n.hasTextData()||g);!n.collisionArrays&&h&&n.deserializeCollisionBoxes(h);let I=this.retainedQueryData[n.bucketInstanceId].tileID,D=this.terrain?(k,E)=>this.terrain.getElevation(I,k,E):null,F=u((k,E)=>{if(t[k.crossTileID])return;if(p){this.placements[k.crossTileID]=new Ll(!1,!1,!1);return}let O=!1,X=!1,H=!0,fe=null,J={box:null,offscreen:null},Qe={box:null,offscreen:null},Je=null,ue=null,Me=null,et=0,ur=0,cr=0;E.textFeatureIndex?et=E.textFeatureIndex:k.useRuntimeCollisionCircles&&(et=k.featureIndex),E.verticalTextFeatureIndex&&(ur=E.verticalTextFeatureIndex);let zt=E.textBox;if(zt){let tt=u(ge=>{let _t=1;if(n.allowVerticalPlacement&&!ge&&this.prevPlacement){let It=this.prevPlacement.placedOrientations[k.crossTileID];It&&(this.placedOrientations[k.crossTileID]=It,_t=It,this.markUsedOrientation(n,_t,k))}return _t},"updatePreviousOrientationIfNotPlaced"),He=u((ge,_t)=>{if(n.allowVerticalPlacement&&k.numVerticalGlyphVertices>0&&E.verticalTextBox){for(let It of n.writingModes)if(It===2?(J=_t(),Qe=J):J=ge(),J&&J.box&&J.box.length)break}else J=ge()},"placeTextForPlacementModes");if(a.get("text-variable-anchor")){let ge=a.get("text-variable-anchor");if(this.prevPlacement&&this.prevPlacement.variableOffsets[k.crossTileID]){let Fe=this.prevPlacement.variableOffsets[k.crossTileID];ge.indexOf(Fe.anchor)>0&&(ge=ge.filter(Gr=>Gr!==Fe.anchor),ge.unshift(Fe.anchor))}let _t=u((Fe,Gr,dc)=>{let rw=Fe.x2-Fe.x1,iw=Fe.y2-Fe.y1,nw=k.textBoxScale,aw=T&&_==="never"?Gr:null,Pn={box:[],offscreen:!1},ow=x!=="never"?ge.length*2:ge.length;for(let co=0;co<ow;++co){let sw=ge[co%ge.length],lw=co>=ge.length?x:"never",yc=this.attemptAnchorPlacement(sw,Fe,rw,iw,nw,S,P,c,o,m,lw,k,n,dc,aw,D);if(yc&&(Pn=yc.placedGlyphBoxes,Pn&&Pn.box&&Pn.box.length)){O=!0,fe=yc.shift;break}}return Pn},"placeBoxForVariableAnchors");He(u(()=>_t(zt,E.iconBox,1),"placeHorizontal"),u(()=>{let Fe=E.verticalTextBox,Gr=J&&J.box&&J.box.length;return n.allowVerticalPlacement&&!Gr&&k.numVerticalGlyphVertices>0&&Fe?_t(Fe,E.verticalIconBox,2):{box:null,offscreen:null}},"placeVertical")),J&&(O=J.box,H=J.offscreen);let Mt=tt(J&&J.box);if(!O&&this.prevPlacement){let Fe=this.prevPlacement.variableOffsets[k.crossTileID];Fe&&(this.variableOffsets[k.crossTileID]=Fe,this.markUsedJustification(n,Fe.anchor,k,Mt))}}else{let ge=u((pr,Mt)=>{let Fe=this.collisionIndex.placeCollisionBox(pr,x,c,o,m.predicate,D);return Fe&&Fe.box&&Fe.box.length&&(this.markUsedOrientation(n,Mt,k),this.placedOrientations[k.crossTileID]=Mt),Fe},"placeBox");He(u(()=>ge(zt,1),"placeHorizontal"),u(()=>{let pr=E.verticalTextBox;return n.allowVerticalPlacement&&k.numVerticalGlyphVertices>0&&pr?ge(pr,2):{box:null,offscreen:null}},"placeVertical")),tt(J&&J.box&&J.box.length)}}if(Je=J,O=Je&&Je.box&&Je.box.length>0,H=Je&&Je.offscreen,k.useRuntimeCollisionCircles){let tt=n.text.placedSymbolArray.get(k.centerJustifiedTextSymbolIndex),He=rn(n.textSizeData,f,tt),ge=a.get("text-padding"),_t=k.collisionCircleDiameter;ue=this.collisionIndex.placeCollisionCircles(x,tt,n.lineVertexArray,n.glyphOffsetArray,He,o,s,l,i,P,m.predicate,_t,ge,D),ue.circles.length&&ue.collisionDetected&&!i&&Ce("Collisions detected, but collision boxes are not shown"),O=b||ue.circles.length>0&&!ue.collisionDetected,H=H&&ue.offscreen}if(E.iconFeatureIndex&&(cr=E.iconFeatureIndex),E.iconBox){let tt=u(He=>{let ge=T&&fe?km(He,fe.x,fe.y,S,P,this.transform.angle):He;return this.collisionIndex.placeCollisionBox(ge,_,c,o,m.predicate,D)},"placeIconFeature");Qe&&Qe.box&&Qe.box.length&&E.verticalIconBox?(Me=tt(E.verticalIconBox),X=Me.box.length>0):(Me=tt(E.iconBox),X=Me.box.length>0),H=H&&Me.offscreen}let Xt=g||k.numHorizontalGlyphVertices===0&&k.numVerticalGlyphVertices===0,Nr=y||k.numIconVertices===0;if(!Xt&&!Nr?X=O=X&&O:Nr?Xt||(X=X&&O):O=X&&O,O&&Je&&Je.box&&(Qe&&Qe.box&&ur?this.collisionIndex.insertCollisionBox(Je.box,x,a.get("text-ignore-placement"),n.bucketInstanceId,ur,m.ID):this.collisionIndex.insertCollisionBox(Je.box,x,a.get("text-ignore-placement"),n.bucketInstanceId,et,m.ID)),X&&Me&&this.collisionIndex.insertCollisionBox(Me.box,_,a.get("icon-ignore-placement"),n.bucketInstanceId,cr,m.ID),ue&&(O&&this.collisionIndex.insertCollisionCircles(ue.circles,x,a.get("text-ignore-placement"),n.bucketInstanceId,et,m.ID),i)){let tt=n.bucketInstanceId,He=this.collisionCircleArrays[tt];He===void 0&&(He=this.collisionCircleArrays[tt]=new Lm);for(let ge=0;ge<ue.circles.length;ge+=4)He.circles.push(ue.circles[ge+0]),He.circles.push(ue.circles[ge+1]),He.circles.push(ue.circles[ge+2]),He.circles.push(ue.collisionDetected?1:0)}if(k.crossTileID===0)throw new Error("symbolInstance.crossTileID can't be 0");if(n.bucketInstanceId===0)throw new Error("bucket.bucketInstanceId can't be 0");this.placements[k.crossTileID]=new Ll(O||L,X||C,H||n.justReloaded),t[k.crossTileID]=!0},"placeSymbol");if(A){if(e.symbolInstanceStart!==0)throw new Error("bucket.bucketInstanceId should be 0");let k=n.getSortedSymbolIndexes(this.transform.angle);for(let E=k.length-1;E>=0;--E){let O=k[E];F(n.symbolInstances.get(O),n.collisionArrays[O])}}else for(let k=e.symbolInstanceStart;k<e.symbolInstanceEnd;k++)F(n.symbolInstances.get(k),n.collisionArrays[k]);if(i&&n.bucketInstanceId in this.collisionCircleArrays){let k=this.collisionCircleArrays[n.bucketInstanceId];q.invert(k.invProjMatrix,o),k.viewportMatrix=this.collisionIndex.getViewportMatrix()}n.justReloaded=!1}markUsedJustification(e,t,i,n){let a={left:i.leftJustifiedTextSymbolIndex,center:i.centerJustifiedTextSymbolIndex,right:i.rightJustifiedTextSymbolIndex},o;n===2?o=i.verticalPlacedTextSymbolIndex:o=a[lv(t)];let s=[i.leftJustifiedTextSymbolIndex,i.centerJustifiedTextSymbolIndex,i.rightJustifiedTextSymbolIndex,i.verticalPlacedTextSymbolIndex];for(let l of s)l>=0&&(o>=0&&l!==o?e.text.placedSymbolArray.get(l).crossTileID=0:e.text.placedSymbolArray.get(l).crossTileID=i.crossTileID)}markUsedOrientation(e,t,i){let n=t===1||t===3?t:0,a=t===2?t:0,o=[i.leftJustifiedTextSymbolIndex,i.centerJustifiedTextSymbolIndex,i.rightJustifiedTextSymbolIndex];for(let s of o)e.text.placedSymbolArray.get(s).placedOrientation=n;i.verticalPlacedTextSymbolIndex&&(e.text.placedSymbolArray.get(i.verticalPlacedTextSymbolIndex).placedOrientation=a)}commit(e){this.commitTime=e,this.zoomAtLastRecencyCheck=this.transform.zoom;let t=this.prevPlacement,i=!1;this.prevZoomAdjustment=t?t.zoomAdjustment(this.transform.zoom):0;let n=t?t.symbolFadeChange(e):1,a=t?t.opacities:{},o=t?t.variableOffsets:{},s=t?t.placedOrientations:{};for(let l in this.placements){let c=this.placements[l],p=a[l];p?(this.opacities[l]=new gi(p,n,c.text,c.icon),i=i||c.text!==p.text.placed||c.icon!==p.icon.placed):(this.opacities[l]=new gi(null,n,c.text,c.icon,c.skipFade),i=i||c.text||c.icon)}for(let l in a){let c=a[l];if(!this.opacities[l]){let p=new gi(c,n,!1,!1);p.isHidden()||(this.opacities[l]=p,i=i||c.text.placed||c.icon.placed)}}for(let l in o)!this.variableOffsets[l]&&this.opacities[l]&&!this.opacities[l].isHidden()&&(this.variableOffsets[l]=o[l]);for(let l in s)!this.placedOrientations[l]&&this.opacities[l]&&!this.opacities[l].isHidden()&&(this.placedOrientations[l]=s[l]);if(t&&t.lastPlacementChangeTime===void 0)throw new Error("Last placement time for previous placement is not defined");i?this.lastPlacementChangeTime=e:typeof this.lastPlacementChangeTime!="number"&&(this.lastPlacementChangeTime=t?t.lastPlacementChangeTime:e)}updateLayerOpacities(e,t){let i={};for(let n of t){let a=n.getBucket(e);a&&n.latestFeatureIndex&&e.id===a.layerIds[0]&&this.updateBucketOpacities(a,i,n.collisionBoxArray)}}updateBucketOpacities(e,t,i){e.hasTextData()&&(e.text.opacityVertexArray.clear(),e.text.hasVisibleVertices=!1),e.hasIconData()&&(e.icon.opacityVertexArray.clear(),e.icon.hasVisibleVertices=!1),e.hasIconCollisionBoxData()&&e.iconCollisionBox.collisionVertexArray.clear(),e.hasTextCollisionBoxData()&&e.textCollisionBox.collisionVertexArray.clear();let n=e.layers[0].layout,a=new gi(null,0,!1,!1,!0),o=n.get("text-allow-overlap"),s=n.get("icon-allow-overlap"),l=n.get("text-variable-anchor"),c=n.get("text-rotation-alignment")==="map",p=n.get("text-pitch-alignment")==="map",h=n.get("icon-text-fit")!=="none",f=new gi(null,0,o&&(s||!e.hasIconData()||n.get("icon-optional")),s&&(o||!e.hasTextData()||n.get("text-optional")),!0);!e.collisionArrays&&i&&(e.hasIconCollisionBoxData()||e.hasTextCollisionBoxData())&&e.deserializeCollisionBoxes(i);let m=u((g,y,x)=>{for(let b=0;b<y/4;b++)g.opacityVertexArray.emplaceBack(x);g.hasVisibleVertices=g.hasVisibleVertices||x!==Ya},"addOpacities");for(let g=0;g<e.symbolInstances.length;g++){let y=e.symbolInstances.get(g),{numHorizontalGlyphVertices:x,numVerticalGlyphVertices:b,crossTileID:_}=y,v=t[_],S=this.opacities[_];v?S=a:S||(S=f,this.opacities[_]=S),t[_]=!0;let P=x>0||b>0,T=y.numIconVertices>0,A=this.placedOrientations[y.crossTileID],L=A===2,C=A===1||A===3;if(P){let I=cv(S.text),D=L?Ya:I;m(e.text,x,D);let F=C?Ya:I;m(e.text,b,F);let k=S.text.isHidden();[y.rightJustifiedTextSymbolIndex,y.centerJustifiedTextSymbolIndex,y.leftJustifiedTextSymbolIndex].forEach(X=>{X>=0&&(e.text.placedSymbolArray.get(X).hidden=k||L?1:0)}),y.verticalPlacedTextSymbolIndex>=0&&(e.text.placedSymbolArray.get(y.verticalPlacedTextSymbolIndex).hidden=k||C?1:0);let E=this.variableOffsets[y.crossTileID];E&&this.markUsedJustification(e,E.anchor,y,A);let O=this.placedOrientations[y.crossTileID];O&&(this.markUsedJustification(e,"left",y,O),this.markUsedOrientation(e,O,y))}if(T){let I=cv(S.icon),D=!(h&&y.verticalPlacedIconSymbolIndex&&L);if(y.placedIconSymbolIndex>=0){let F=D?I:Ya;m(e.icon,y.numIconVertices,F),e.icon.placedSymbolArray.get(y.placedIconSymbolIndex).hidden=S.icon.isHidden()}if(y.verticalPlacedIconSymbolIndex>=0){let F=D?Ya:I;m(e.icon,y.numVerticalIconVertices,F),e.icon.placedSymbolArray.get(y.verticalPlacedIconSymbolIndex).hidden=S.icon.isHidden()}}if(e.hasIconCollisionBoxData()||e.hasTextCollisionBoxData()){let I=e.collisionArrays[g];if(I){let D=new zl.default(0,0);if(I.textBox||I.verticalTextBox){let k=!0;if(l){let E=this.variableOffsets[_];E?(D=uv(E.anchor,E.width,E.height,E.textOffset,E.textBoxScale),c&&D._rotate(p?this.transform.angle:-this.transform.angle)):k=!1}I.textBox&&El(e.textCollisionBox.collisionVertexArray,S.text.placed,!k||L,D.x,D.y),I.verticalTextBox&&El(e.textCollisionBox.collisionVertexArray,S.text.placed,!k||C,D.x,D.y)}let F=!!(!C&&I.verticalIconBox);I.iconBox&&El(e.iconCollisionBox.collisionVertexArray,S.icon.placed,F,h?D.x:0,h?D.y:0),I.verticalIconBox&&El(e.iconCollisionBox.collisionVertexArray,S.icon.placed,!F,h?D.x:0,h?D.y:0)}}}if(e.sortFeatures(this.transform.angle),this.retainedQueryData[e.bucketInstanceId]&&(this.retainedQueryData[e.bucketInstanceId].featureSortOrder=e.featureSortOrder),e.hasTextData()&&e.text.opacityVertexBuffer&&e.text.opacityVertexBuffer.updateData(e.text.opacityVertexArray),e.hasIconData()&&e.icon.opacityVertexBuffer&&e.icon.opacityVertexBuffer.updateData(e.icon.opacityVertexArray),e.hasIconCollisionBoxData()&&e.iconCollisionBox.collisionVertexBuffer&&e.iconCollisionBox.collisionVertexBuffer.updateData(e.iconCollisionBox.collisionVertexArray),e.hasTextCollisionBoxData()&&e.textCollisionBox.collisionVertexBuffer&&e.textCollisionBox.collisionVertexBuffer.updateData(e.textCollisionBox.collisionVertexArray),e.text.opacityVertexArray.length!==e.text.layoutVertexArray.length/4)throw new Error("bucket.text.opacityVertexArray.length (= ".concat(e.text.opacityVertexArray.length,") !== bucket.text.layoutVertexArray.length (= ").concat(e.text.layoutVertexArray.length,") / 4"));if(e.icon.opacityVertexArray.length!==e.icon.layoutVertexArray.length/4)throw new Error("bucket.icon.opacityVertexArray.length (= ".concat(e.icon.opacityVertexArray.length,") !== bucket.icon.layoutVertexArray.length (= ").concat(e.icon.layoutVertexArray.length,") / 4"));if(e.bucketInstanceId in this.collisionCircleArrays){let g=this.collisionCircleArrays[e.bucketInstanceId];e.placementInvProjMatrix=g.invProjMatrix,e.placementViewportMatrix=g.viewportMatrix,e.collisionCircleArray=g.circles,delete this.collisionCircleArrays[e.bucketInstanceId]}}symbolFadeChange(e){return this.fadeDuration===0?1:(e-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment}zoomAdjustment(e){return Math.max(0,(this.transform.zoom-e)/1.5)}hasTransitions(e){return this.stale||e-this.lastPlacementChangeTime<this.fadeDuration}stillRecent(e,t){let i=this.zoomAtLastRecencyCheck===t?1-this.zoomAdjustment(t):1;return this.zoomAtLastRecencyCheck=t,this.commitTime+this.fadeDuration*i>e}setStale(){this.stale=!0}};u(Nm,"Placement");var Dl=Nm;function El(r,e,t,i,n){r.emplaceBack(e?1:0,t?1:0,i||0,n||0),r.emplaceBack(e?1:0,t?1:0,i||0,n||0),r.emplaceBack(e?1:0,t?1:0,i||0,n||0),r.emplaceBack(e?1:0,t?1:0,i||0,n||0)}u(El,"updateCollisionVertices");var cC=Math.pow(2,25),pC=Math.pow(2,24),hC=Math.pow(2,17),fC=Math.pow(2,16),mC=Math.pow(2,9),dC=Math.pow(2,8),yC=Math.pow(2,1);function cv(r){if(r.opacity===0&&!r.placed)return 0;if(r.opacity===1&&r.placed)return 4294967295;let e=r.placed?1:0,t=Math.floor(r.opacity*127);return t*cC+e*pC+t*hC+e*fC+t*mC+e*dC+t*yC+e}u(cv,"packOpacity");var Ya=0;var qm=class qm{constructor(e){this._sortAcrossTiles=e.layout.get("symbol-z-order")!=="viewport-y"&&!e.layout.get("symbol-sort-key").isConstant(),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]}continuePlacement(e,t,i,n,a){let o=this._bucketParts;for(;this._currentTileIndex<e.length;){let s=e[this._currentTileIndex];if(t.getBucketParts(o,n,s,this._sortAcrossTiles),this._currentTileIndex++,a())return!0}for(this._sortAcrossTiles&&(this._sortAcrossTiles=!1,o.sort((s,l)=>s.sortKey-l.sortKey));this._currentPartIndex<o.length;){let s=o[this._currentPartIndex];if(t.placeLayerBucketPart(s,this._seenCrossTileIDs,i),this._currentPartIndex++,a())return!0}return!1}};u(qm,"LayerPlacement");var Gm=qm,jm=class jm{constructor(e,t,i,n,a,o,s,l){this.placement=new Dl(e,t,o,s,l),this._currentPlacementIndex=i.length-1,this._forceFullPlacement=n,this._showCollisionBoxes=a,this._done=!1}isDone(){return this._done}continuePlacement(e,t,i){let n=ne.now(),a=u(()=>this._forceFullPlacement?!1:ne.now()-n>2,"shouldPausePlacement");for(;this._currentPlacementIndex>=0;){let o=e[this._currentPlacementIndex],s=t[o],l=this.placement.collisionIndex.transform.zoom;if(s.type==="symbol"&&(!s.minzoom||s.minzoom<=l)&&(!s.maxzoom||s.maxzoom>l)){if(this._inProgressLayer||(this._inProgressLayer=new Gm(s)),this._inProgressLayer.continuePlacement(i[s.source],this.placement,this._showCollisionBoxes,s,a))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0}commit(e){return this.placement.commit(e),this.placement}};u(jm,"PauseablePlacement");var Fl=jm;d();d();var pv=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],$m=1,Ja=8,Bl=class Bl{static from(e){if(!(e instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");let[t,i]=new Uint8Array(e,0,2);if(t!==219)throw new Error("Data does not appear to be in a KDBush format.");let n=i>>4;if(n!==$m)throw new Error("Got v".concat(n," data when expected v").concat($m,"."));let a=pv[i&15];if(!a)throw new Error("Unrecognized array type.");let[o]=new Uint16Array(e,2,1),[s]=new Uint32Array(e,4,1);return new Bl(s,o,a,e)}constructor(e,t=64,i=Float64Array,n){if(isNaN(e)||e<0)throw new Error("Unpexpected numItems value: ".concat(e,"."));this.numItems=+e,this.nodeSize=Math.min(Math.max(+t,2),65535),this.ArrayType=i,this.IndexArrayType=e<65536?Uint16Array:Uint32Array;let a=pv.indexOf(this.ArrayType),o=e*2*this.ArrayType.BYTES_PER_ELEMENT,s=e*this.IndexArrayType.BYTES_PER_ELEMENT,l=(8-s%8)%8;if(a<0)throw new Error("Unexpected typed array class: ".concat(i,"."));n&&n instanceof ArrayBuffer?(this.data=n,this.ids=new this.IndexArrayType(this.data,Ja,e),this.coords=new this.ArrayType(this.data,Ja+s+l,e*2),this._pos=e*2,this._finished=!0):(this.data=new ArrayBuffer(Ja+o+s+l),this.ids=new this.IndexArrayType(this.data,Ja,e),this.coords=new this.ArrayType(this.data,Ja+s+l,e*2),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,($m<<4)+a]),new Uint16Array(this.data,2,1)[0]=t,new Uint32Array(this.data,4,1)[0]=e)}add(e,t){let i=this._pos>>1;return this.ids[i]=i,this.coords[this._pos++]=e,this.coords[this._pos++]=t,i}finish(){let e=this._pos>>1;if(e!==this.numItems)throw new Error("Added ".concat(e," items when expected ").concat(this.numItems,"."));return Zm(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(e,t,i,n){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");let{ids:a,coords:o,nodeSize:s}=this,l=[0,a.length-1,0],c=[];for(;l.length;){let p=l.pop()||0,h=l.pop()||0,f=l.pop()||0;if(h-f<=s){for(let x=f;x<=h;x++){let b=o[2*x],_=o[2*x+1];b>=e&&b<=i&&_>=t&&_<=n&&c.push(a[x])}continue}let m=f+h>>1,g=o[2*m],y=o[2*m+1];g>=e&&g<=i&&y>=t&&y<=n&&c.push(a[m]),(p===0?e<=g:t<=y)&&(l.push(f),l.push(m-1),l.push(1-p)),(p===0?i>=g:n>=y)&&(l.push(m+1),l.push(h),l.push(1-p))}return c}within(e,t,i){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");let{ids:n,coords:a,nodeSize:o}=this,s=[0,n.length-1,0],l=[],c=i*i;for(;s.length;){let p=s.pop()||0,h=s.pop()||0,f=s.pop()||0;if(h-f<=o){for(let x=f;x<=h;x++)hv(a[2*x],a[2*x+1],e,t)<=c&&l.push(n[x]);continue}let m=f+h>>1,g=a[2*m],y=a[2*m+1];hv(g,y,e,t)<=c&&l.push(n[m]),(p===0?e-i<=g:t-i<=y)&&(s.push(f),s.push(m-1),s.push(1-p)),(p===0?e+i>=g:t+i>=y)&&(s.push(m+1),s.push(h),s.push(1-p))}return l}};u(Bl,"KDBush");var eo=Bl;function Zm(r,e,t,i,n,a){if(n-i<=t)return;let o=i+n>>1;fv(r,e,o,i,n,a),Zm(r,e,t,i,o-1,1-a),Zm(r,e,t,o+1,n,1-a)}u(Zm,"sort");function fv(r,e,t,i,n,a){for(;n>i;){if(n-i>600){let c=n-i+1,p=t-i+1,h=Math.log(c),f=.5*Math.exp(2*h/3),m=.5*Math.sqrt(h*f*(c-f)/c)*(p-c/2<0?-1:1),g=Math.max(i,Math.floor(t-p*f/c+m)),y=Math.min(n,Math.floor(t+(c-p)*f/c+m));fv(r,e,t,g,y,a)}let o=e[2*t+a],s=i,l=n;for(Qa(r,e,i,t),e[2*n+a]>o&&Qa(r,e,i,n);s<l;){for(Qa(r,e,s,l),s++,l--;e[2*s+a]<o;)s++;for(;e[2*l+a]>o;)l--}e[2*i+a]===o?Qa(r,e,i,l):(l++,Qa(r,e,l,n)),l<=t&&(i=l+1),t<=l&&(n=l-1)}}u(fv,"select");function Qa(r,e,t,i){Hm(r,t,i),Hm(e,2*t,2*i),Hm(e,2*t+1,2*i+1)}u(Qa,"swapItem");function Hm(r,e,t){let i=r[e];r[e]=r[t],r[t]=i}u(Hm,"swap");function hv(r,e,t,i){let n=r-t,a=e-i;return n*n+a*a}u(hv,"sqDist");var to=512/8192/2,gC=128,Ym=class Ym{constructor(e,t,i){this.tileID=e;this.bucketInstanceId=i;this._symbolsByKey={};let n=new Map;for(let a=0;a<t.length;a++){let o=t.get(a),s=o.key,l=n.get(s);l?l.push(o):n.set(s,[o])}for(let[a,o]of n){let s=o.map(p=>({x:Math.floor(p.anchorX*to),y:Math.floor(p.anchorY*to)})),l=o.map(p=>p.crossTileID),c={positions:s,crossTileIDs:l};if(c.positions.length>gC){let p=new eo(c.positions.length,16,Uint16Array);for(let{x:h,y:f}of c.positions)p.add(h,f);p.finish(),delete c.positions,c.index=p}this._symbolsByKey[a]=c}}getScaledCoordinates(e,t){let{x:i,y:n,z:a}=this.tileID.canonical,{x:o,y:s,z:l}=t.canonical,c=l-a,p=to/Math.pow(2,c),h=(o*8192+e.anchorX)*p,f=(s*8192+e.anchorY)*p,m=i*8192*to,g=n*8192*to;return{x:Math.floor(h-m),y:Math.floor(f-g)}}findMatches(e,t,i){let n=this.tileID.canonical.z<t.canonical.z?1:Math.pow(2,this.tileID.canonical.z-t.canonical.z);for(let a=0;a<e.length;a++){let o=e.get(a);if(o.crossTileID)continue;let s=this._symbolsByKey[o.key];if(!s)continue;let l=this.getScaledCoordinates(o,t);if(s.index){let c=s.index.range(l.x-n,l.y-n,l.x+n,l.y+n).sort();for(let p of c){let h=s.crossTileIDs[p];if(!i[h]){i[h]=!0,o.crossTileID=h;break}}}else if(s.positions)for(let c=0;c<s.positions.length;c++){let p=s.positions[c],h=s.crossTileIDs[c];if(Math.abs(p.x-l.x)<=n&&Math.abs(p.y-l.y)<=n&&!i[h]){i[h]=!0,o.crossTileID=h;break}}}}getCrossTileIDsLists(){return Object.values(this._symbolsByKey).map(({crossTileIDs:e})=>e)}};u(Ym,"TileLayerIndex");var Wm=Ym,Jm=class Jm{constructor(){this.maxCrossTileID=0}generate(){return++this.maxCrossTileID}};u(Jm,"CrossTileIDs");var Xm=Jm,Qm=class Qm{constructor(){this.indexes={},this.usedCrossTileIDs={},this.lng=0}handleWrapJump(e){let t=Math.round((e-this.lng)/360);if(t!==0)for(let i in this.indexes){let n=this.indexes[i],a={};for(let o in n){let s=n[o];s.tileID=s.tileID.unwrapTo(s.tileID.wrap+t),a[s.tileID.key]=s}this.indexes[i]=a}this.lng=e}addBucket(e,t,i){if(this.indexes[e.overscaledZ]&&this.indexes[e.overscaledZ][e.key]){if(this.indexes[e.overscaledZ][e.key].bucketInstanceId===t.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(e.overscaledZ,this.indexes[e.overscaledZ][e.key])}for(let a=0;a<t.symbolInstances.length;a++){let o=t.symbolInstances.get(a);o.crossTileID=0}this.usedCrossTileIDs[e.overscaledZ]||(this.usedCrossTileIDs[e.overscaledZ]={});let n=this.usedCrossTileIDs[e.overscaledZ];for(let a in this.indexes){let o=this.indexes[a];if(Number(a)>e.overscaledZ)for(let s in o){let l=o[s];l.tileID.isChildOf(e)&&l.findMatches(t.symbolInstances,e,n)}else{let s=e.scaledTo(Number(a)),l=o[s.key];l&&l.findMatches(t.symbolInstances,e,n)}}for(let a=0;a<t.symbolInstances.length;a++){let o=t.symbolInstances.get(a);o.crossTileID||(o.crossTileID=i.generate(),n[o.crossTileID]=!0)}return this.indexes[e.overscaledZ]===void 0&&(this.indexes[e.overscaledZ]={}),this.indexes[e.overscaledZ][e.key]=new Wm(e,t.symbolInstances,t.bucketInstanceId),!0}removeBucketCrossTileIDs(e,t){for(let i of t.getCrossTileIDsLists())for(let n of i)delete this.usedCrossTileIDs[e][n]}removeStaleBuckets(e){let t=!1;for(let i in this.indexes){let n=this.indexes[i];for(let a in n)e[n[a].bucketInstanceId]||(this.removeBucketCrossTileIDs(i,n[a]),delete n[a],t=!0)}return t}};u(Qm,"CrossTileSymbolLayerIndex");var Km=Qm,ed=class ed{constructor(){this.layerIndexes={},this.crossTileIDs=new Xm,this.maxBucketInstanceId=0,this.bucketsInCurrentPlacement={}}addLayer(e,t,i){let n=this.layerIndexes[e.id];n===void 0&&(n=this.layerIndexes[e.id]=new Km);let a=!1,o={};n.handleWrapJump(i);for(let s of t){let l=s.getBucket(e);!l||e.id!==l.layerIds[0]||(l.bucketInstanceId||(l.bucketInstanceId=++this.maxBucketInstanceId),n.addBucket(s.tileID,l,this.crossTileIDs)&&(a=!0),o[l.bucketInstanceId]=!0)}return n.removeStaleBuckets(o)&&(a=!0),a}pruneUnusedLayers(e){let t={};e.forEach(i=>{t[i]=!0});for(let i in this.layerIndexes)t[i]||delete this.layerIndexes[i]}};u(ed,"CrossTileSymbolIndex");var xn=ed;var Rl=u((r,e)=>Ri(r,e&&e.filter(t=>t.identifier!=="source.canvas")),"emitValidationErrors"),xC=Bt(Ae,["addLayer","removeLayer","setPaintProperty","setLayoutProperty","setFilter","addSource","removeSource","setLayerZoomRange","setLight","setTransition","setGeoJSONSourceData","setGlyphs","setSprite"]),bC=Bt(Ae,["setCenter","setZoom","setBearing","setPitch"]),_C=Hg(),Ol=class Ol extends de{constructor(t,i={}){super();this.map=t,this.dispatcher=new ja(wm(),this,t._getMapId()),this.imageManager=new ll,this.imageManager.setEventedParent(this),this.glyphManager=new ul(t._requestManager,i.localIdeographFontFamily),this.lineAtlas=new pl(256,512),this.crossTileSymbolIndex=new xn,this._spritesImagesIds={},this._layers={},this._order=[],this.sourceCaches={},this.zoomHistory=new Ui,this._loaded=!1,this._availableImages=[],this._resetUpdates(),this.dispatcher.broadcast("setReferrer",go());let n=this;this._rtlTextPluginCallback=Ol.registerForPluginStateChange(a=>{let o={pluginStatus:a.pluginStatus,pluginURL:a.pluginURL};n.dispatcher.broadcast("syncRTLPluginState",o,(s,l)=>{if(_p(s),l&&l.every(p=>p))for(let p in n.sourceCaches){let h=n.sourceCaches[p].getSource().type;(h==="vector"||h==="geojson")&&n.sourceCaches[p].reload()}})}),this.on("data",a=>{if(a.dataType!=="source"||a.sourceDataType!=="metadata")return;let o=this.sourceCaches[a.sourceId];if(!o)return;let s=o.getSource();if(!(!s||!s.vectorLayerIds))for(let l in this._layers){let c=this._layers[l];c.source===s.id&&this._validateLayer(c)}})}loadURL(t,i={},n){this.fire(new z("dataloading",{dataType:"style"})),i.validate=typeof i.validate=="boolean"?i.validate:!0;let a=this.map._requestManager.transformRequest(t,"Style");this._request=fr(a,(o,s)=>{this._request=null,o?this.fire(new Z(o)):s&&this._load(s,i,n)})}loadJSON(t,i={},n){this.fire(new z("dataloading",{dataType:"style"})),this._request=ne.frame(()=>{this._request=null,i.validate=i.validate!==!1,this._load(t,i,n)})}loadEmpty(){this.fire(new z("dataloading",{dataType:"style"})),this._load(_C,{validate:!1})}_load(t,i,n){let a=i.transformStyle?i.transformStyle(n,t):t;if(!(i.validate&&Rl(this,qe(a)))){this._loaded=!0,this.stylesheet=a;for(let o in a.sources)this.addSource(o,a.sources[o],{validate:!1});a.sprite?this._loadSprite(a.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(a.glyphs),this._createLayers(),this.light=new cl(this.stylesheet.light),this.map.setTerrain(this.stylesheet.terrain),this.fire(new z("data",{dataType:"style"})),this.fire(new z("style.load"))}}_createLayers(){let t=Kc(this.stylesheet.layers);this.dispatcher.broadcast("setLayers",t),this._order=t.map(i=>i.id),this._layers={},this._serializedLayers=null;for(let i of t){let n=ol(i);n.setEventedParent(this,{layer:{id:i.id}}),this._layers[i.id]=n}}_loadSprite(t,i=!1,n=void 0){this.imageManager.setLoaded(!1),this._spriteRequest=I_(t,this.map._requestManager,this.map.getPixelRatio(),(a,o)=>{if(this._spriteRequest=null,a)this.fire(new Z(a));else if(o)for(let s in o){this._spritesImagesIds[s]=[];let l=this._spritesImagesIds[s]?this._spritesImagesIds[s].filter(c=>!(c in o)):[];for(let c of l)this.imageManager.removeImage(c),this._changedImages[c]=!0;for(let c in o[s]){let p=s==="default"?c:"".concat(s,":").concat(c);this._spritesImagesIds[s].push(p),p in this.imageManager.images?this.imageManager.updateImage(p,o[s][c],!1):this.imageManager.addImage(p,o[s][c]),i&&(this._changedImages[p]=!0)}}this.imageManager.setLoaded(!0),this._availableImages=this.imageManager.listImages(),i&&(this._changed=!0),this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new z("data",{dataType:"style"})),n&&n(a)})}_unloadSprite(){for(let t of Object.values(this._spritesImagesIds).flat())this.imageManager.removeImage(t),this._changedImages[t]=!0;this._spritesImagesIds={},this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new z("data",{dataType:"style"}))}_validateLayer(t){let i=this.sourceCaches[t.source];if(!i)return;let n=t.sourceLayer;if(!n)return;let a=i.getSource();(a.type==="geojson"||a.vectorLayerIds&&a.vectorLayerIds.indexOf(n)===-1)&&this.fire(new Z(new Error('Source layer "'.concat(n,'" ')+'does not exist on source "'.concat(a.id,'" ')+'as specified by style layer "'.concat(t.id,'".'))))}loaded(){if(!this._loaded||Object.keys(this._updatedSources).length)return!1;for(let t in this.sourceCaches)if(!this.sourceCaches[t].loaded())return!1;return!!this.imageManager.isLoaded()}_serializeByIds(t){let i=this._serializedAllLayers();if(!t||t.length===0)return Object.values(i);let n=[];for(let a of t)i[a]&&n.push(i[a]);return n}_serializedAllLayers(){let t=this._serializedLayers;if(t)return t;t=this._serializedLayers={};let i=Object.keys(this._layers);for(let n of i){let a=this._layers[n];a.type!=="custom"&&(t[n]=a.serialize())}return t}hasTransitions(){if(this.light&&this.light.hasTransition())return!0;for(let t in this.sourceCaches)if(this.sourceCaches[t].hasTransition())return!0;for(let t in this._layers)if(this._layers[t].hasTransition())return!0;return!1}_checkLoaded(){if(!this._loaded)throw new Error("Style is not done loading.")}update(t){if(!this._loaded)return;let i=this._changed;if(this._changed){let a=Object.keys(this._updatedLayers),o=Object.keys(this._removedLayers);(a.length||o.length)&&this._updateWorkerLayers(a,o);for(let s in this._updatedSources){let l=this._updatedSources[s];if(l==="reload")this._reloadSource(s);else if(l==="clear")this._clearSource(s);else throw new Error("Invalid action ".concat(l))}this._updateTilesForChangedImages(),this._updateTilesForChangedGlyphs();for(let s in this._updatedPaintProps)this._layers[s].updateTransitions(t);this.light.updateTransitions(t),this._resetUpdates()}let n={};for(let a in this.sourceCaches){let o=this.sourceCaches[a];n[a]=o.used,o.used=!1}for(let a of this._order){let o=this._layers[a];o.recalculate(t,this._availableImages),!o.isHidden(t.zoom)&&o.source&&(this.sourceCaches[o.source].used=!0)}for(let a in n){let o=this.sourceCaches[a];n[a]!==o.used&&o.fire(new z("data",{sourceDataType:"visibility",dataType:"source",sourceId:a}))}this.light.recalculate(t),this.z=t.zoom,i&&this.fire(new z("data",{dataType:"style"}))}_updateTilesForChangedImages(){let t=Object.keys(this._changedImages);if(t.length){for(let i in this.sourceCaches)this.sourceCaches[i].reloadTilesForDependencies(["icons","patterns"],t);this._changedImages={}}}_updateTilesForChangedGlyphs(){if(this._glyphsDidChange){for(let t in this.sourceCaches)this.sourceCaches[t].reloadTilesForDependencies(["glyphs"],[""]);this._glyphsDidChange=!1}}_updateWorkerLayers(t,i){this.dispatcher.broadcast("updateLayers",{layers:this._serializeByIds(t),removedIds:i})}_resetUpdates(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={},this._glyphsDidChange=!1}setState(t,i={}){this._checkLoaded();let n=this.serialize();if(t=i.transformStyle?i.transformStyle(n,t):t,Rl(this,qe(t)))return!1;t=ut(t),t.layers=Kc(t.layers);let a=Ig(n,t).filter(s=>!(s.command in bC));if(a.length===0)return!1;let o=a.filter(s=>!(s.command in xC));if(o.length>0)throw new Error("Unimplemented: ".concat(o.map(s=>s.command).join(", "),"."));for(let s of a)s.command!=="setTransition"&&this[s.command].apply(this,s.args);return this.stylesheet=t,!0}addImage(t,i){if(this.getImage(t))return this.fire(new Z(new Error('An image named "'.concat(t,'" already exists.'))));this.imageManager.addImage(t,i),this._afterImageUpdated(t)}updateImage(t,i){this.imageManager.updateImage(t,i)}getImage(t){return this.imageManager.getImage(t)}removeImage(t){if(!this.getImage(t))return this.fire(new Z(new Error('An image named "'.concat(t,'" does not exist.'))));this.imageManager.removeImage(t),this._afterImageUpdated(t)}_afterImageUpdated(t){this._availableImages=this.imageManager.listImages(),this._changedImages[t]=!0,this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new z("data",{dataType:"style"}))}listImages(){return this._checkLoaded(),this.imageManager.listImages()}addSource(t,i,n={}){if(this._checkLoaded(),this.sourceCaches[t]!==void 0)throw new Error('Source "'.concat(t,'" already exists.'));if(!i.type)throw new Error("The type property must be defined, but only the following properties were given: ".concat(Object.keys(i).join(", "),"."));if(["vector","raster","geojson","video","image"].indexOf(i.type)>=0&&this._validate(qe.source,"sources.".concat(t),i,null,n))return;this.map&&this.map._collectResourceTiming&&(i.collectResourceTiming=!0);let s=this.sourceCaches[t]=new or(t,i,this.dispatcher);s.style=this,s.setEventedParent(this,()=>({isSourceLoaded:s.loaded(),source:s.serialize(),sourceId:t})),s.onAdd(this.map),this._changed=!0}removeSource(t){if(this._checkLoaded(),this.sourceCaches[t]===void 0)throw new Error("There is no source with this ID");for(let n in this._layers)if(this._layers[n].source===t)return this.fire(new Z(new Error('Source "'.concat(t,'" cannot be removed while layer "').concat(n,'" is using it.'))));let i=this.sourceCaches[t];delete this.sourceCaches[t],delete this._updatedSources[t],i.fire(new z("data",{sourceDataType:"metadata",dataType:"source",sourceId:t})),i.setEventedParent(null),i.onRemove(this.map),this._changed=!0}setGeoJSONSourceData(t,i){if(this._checkLoaded(),this.sourceCaches[t]===void 0)throw new Error("There is no source with this ID=".concat(t));let n=this.sourceCaches[t].getSource();if(n.type!=="geojson")throw new Error("geojsonSource.type is ".concat(n.type,", which is !== 'geojson"));n.setData(i),this._changed=!0}getSource(t){return this.sourceCaches[t]&&this.sourceCaches[t].getSource()}addLayer(t,i,n={}){this._checkLoaded();let a=t.id;if(this.getLayer(a)){this.fire(new Z(new Error('Layer "'.concat(a,'" already exists on this map.'))));return}let o;if(t.type==="custom"){if(Rl(this,T_(t)))return;o=ol(t)}else{if(typeof t.source=="object"&&(this.addSource(a,t.source),t=ut(t),t=R(t,{source:a})),this._validate(qe.layer,"layers.".concat(a),t,{arrayIndex:-1},n))return;o=ol(t),this._validateLayer(o),o.setEventedParent(this,{layer:{id:a}})}let s=i?this._order.indexOf(i):this._order.length;if(i&&s===-1){this.fire(new Z(new Error('Cannot add layer "'.concat(a,'" before non-existing layer "').concat(i,'".'))));return}if(this._order.splice(s,0,a),this._layerOrderChanged=!0,this._layers[a]=o,this._removedLayers[a]&&o.source&&o.type!=="custom"){let l=this._removedLayers[a];delete this._removedLayers[a],l.type!==o.type?this._updatedSources[o.source]="clear":(this._updatedSources[o.source]="reload",this.sourceCaches[o.source].pause())}this._updateLayer(o),o.onAdd&&o.onAdd(this.map)}moveLayer(t,i){if(this._checkLoaded(),this._changed=!0,!this._layers[t]){this.fire(new Z(new Error("The layer '".concat(t,"' does not exist in the map's style and cannot be moved."))));return}if(t===i)return;let a=this._order.indexOf(t);this._order.splice(a,1);let o=i?this._order.indexOf(i):this._order.length;if(i&&o===-1){this.fire(new Z(new Error('Cannot move layer "'.concat(t,'" before non-existing layer "').concat(i,'".'))));return}this._order.splice(o,0,t),this._layerOrderChanged=!0}removeLayer(t){this._checkLoaded();let i=this._layers[t];if(!i){this.fire(new Z(new Error('Cannot remove non-existing layer "'.concat(t,'".'))));return}i.setEventedParent(null);let n=this._order.indexOf(t);this._order.splice(n,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[t]=i,delete this._layers[t],this._serializedLayers&&delete this._serializedLayers[t],delete this._updatedLayers[t],delete this._updatedPaintProps[t],i.onRemove&&i.onRemove(this.map)}getLayer(t){return this._layers[t]}hasLayer(t){return t in this._layers}setLayerZoomRange(t,i,n){this._checkLoaded();let a=this.getLayer(t);if(!a){this.fire(new Z(new Error('Cannot set the zoom range of non-existing layer "'.concat(t,'".'))));return}a.minzoom===i&&a.maxzoom===n||(i!=null&&(a.minzoom=i),n!=null&&(a.maxzoom=n),this._updateLayer(a))}setFilter(t,i,n={}){this._checkLoaded();let a=this.getLayer(t);if(!a){this.fire(new Z(new Error('Cannot filter non-existing layer "'.concat(t,'".'))));return}if(!Kt(a.filter,i)){if(i==null){a.filter=void 0,this._updateLayer(a);return}this._validate(qe.filter,"layers.".concat(a.id,".filter"),i,null,n)||(a.filter=ut(i),this._updateLayer(a))}}getFilter(t){return ut(this.getLayer(t).filter)}setLayoutProperty(t,i,n,a={}){this._checkLoaded();let o=this.getLayer(t);if(!o){this.fire(new Z(new Error('Cannot style non-existing layer "'.concat(t,'".'))));return}Kt(o.getLayoutProperty(i),n)||(o.setLayoutProperty(i,n,a),this._updateLayer(o))}getLayoutProperty(t,i){let n=this.getLayer(t);if(!n){this.fire(new Z(new Error('Cannot get style of non-existing layer "'.concat(t,'".'))));return}return n.getLayoutProperty(i)}setPaintProperty(t,i,n,a={}){this._checkLoaded();let o=this.getLayer(t);if(!o){this.fire(new Z(new Error('Cannot style non-existing layer "'.concat(t,'".'))));return}if(Kt(o.getPaintProperty(i),n))return;o.setPaintProperty(i,n,a)&&this._updateLayer(o),this._changed=!0,this._updatedPaintProps[t]=!0}getPaintProperty(t,i){return this.getLayer(t).getPaintProperty(i)}setFeatureState(t,i){this._checkLoaded();let n=t.source,a=t.sourceLayer,o=this.sourceCaches[n];if(o===void 0){this.fire(new Z(new Error("The source '".concat(n,"' does not exist in the map's style."))));return}let s=o.getSource().type;if(s==="geojson"&&a){this.fire(new Z(new Error("GeoJSON sources cannot have a sourceLayer parameter.")));return}if(s==="vector"&&!a){this.fire(new Z(new Error("The sourceLayer parameter must be provided for vector source types.")));return}t.id===void 0&&this.fire(new Z(new Error("The feature id parameter must be provided."))),o.setFeatureState(a,t.id,i)}removeFeatureState(t,i){this._checkLoaded();let n=t.source,a=this.sourceCaches[n];if(a===void 0){this.fire(new Z(new Error("The source '".concat(n,"' does not exist in the map's style."))));return}let o=a.getSource().type,s=o==="vector"?t.sourceLayer:void 0;if(o==="vector"&&!s){this.fire(new Z(new Error("The sourceLayer parameter must be provided for vector source types.")));return}if(i&&typeof t.id!="string"&&typeof t.id!="number"){this.fire(new Z(new Error("A feature id is required to remove its specific state property.")));return}a.removeFeatureState(s,t.id,i)}getFeatureState(t){this._checkLoaded();let i=t.source,n=t.sourceLayer,a=this.sourceCaches[i];if(a===void 0){this.fire(new Z(new Error("The source '".concat(i,"' does not exist in the map's style."))));return}if(a.getSource().type==="vector"&&!n){this.fire(new Z(new Error("The sourceLayer parameter must be provided for vector source types.")));return}return t.id===void 0&&this.fire(new Z(new Error("The feature id parameter must be provided."))),a.getFeatureState(n,t.id)}getTransition(){return R({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)}serialize(){if(!this._loaded)return;let t=Tn(this.sourceCaches,a=>a.serialize()),i=this._serializeByIds(this._order),n=this.stylesheet;return mo({version:n.version,name:n.name,metadata:n.metadata,light:n.light,center:n.center,zoom:n.zoom,bearing:n.bearing,pitch:n.pitch,sprite:n.sprite,glyphs:n.glyphs,transition:n.transition,sources:t,layers:i},a=>a!==void 0)}_updateLayer(t){this._updatedLayers[t.id]=!0,t.source&&!this._updatedSources[t.source]&&this.sourceCaches[t.source].getSource().type!=="raster"&&(this._updatedSources[t.source]="reload",this.sourceCaches[t.source].pause()),this._serializedLayers=null,this._changed=!0}_flattenAndSortRenderedFeatures(t){let i=u(s=>this._layers[s].type==="fill-extrusion","isLayer3D"),n={},a=[];for(let s=this._order.length-1;s>=0;s--){let l=this._order[s];if(i(l)){n[l]=s;for(let c of t){let p=c[l];if(p)for(let h of p)a.push(h)}}}a.sort((s,l)=>l.intersectionZ-s.intersectionZ);let o=[];for(let s=this._order.length-1;s>=0;s--){let l=this._order[s];if(i(l))for(let c=a.length-1;c>=0;c--){let p=a[c].feature;if(n[p.layer.id]<s)break;o.push(p),a.pop()}else for(let c of t){let p=c[l];if(p)for(let h of p)o.push(h.feature)}}return o}queryRenderedFeatures(t,i,n){i&&i.filter&&this._validate(qe.filter,"queryRenderedFeatures.filter",i.filter,null,i);let a={};if(i&&i.layers){if(!Array.isArray(i.layers))return this.fire(new Z(new Error("parameters.layers must be an Array."))),[];for(let l of i.layers){let c=this._layers[l];if(!c)return this.fire(new Z(new Error("The layer '".concat(l,"' does not exist in the map's style and cannot be queried for features.")))),[];a[c.source]=!0}}let o=[];i.availableImages=this._availableImages;let s=this._serializedAllLayers();for(let l in this.sourceCaches)i.layers&&!a[l]||o.push(G_(this.sourceCaches[l],this._layers,s,t,i,n));return this.placement&&o.push(q_(this._layers,s,this.sourceCaches,t,i,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(o)}querySourceFeatures(t,i){i&&i.filter&&this._validate(qe.filter,"querySourceFeatures.filter",i.filter,null,i);let n=this.sourceCaches[t];return n?j_(n,i):[]}addSourceType(t,i,n){if(fm(t))return n(new Error('A source type called "'.concat(t,'" already exists.')));if(N_(t,i),!i.workerSourceURL)return n(null,null);this.dispatcher.broadcast("loadWorkerSource",{name:t,url:i.workerSourceURL},n)}getLight(){return this.light.getLight()}setLight(t,i={}){this._checkLoaded();let n=this.light.getLight(),a=!1;for(let s in t)if(!Kt(t[s],n[s])){a=!0;break}if(!a)return;let o={now:ne.now(),transition:R({duration:300,delay:0},this.stylesheet.transition)};this.light.setLight(t,i),this.light.updateTransitions(o)}_validate(t,i,n,a,o={}){return o&&o.validate===!1?!1:Rl(this,t.call(qe,R({key:i,style:this.serialize(),value:n,styleSpec:M},a)))}_remove(t=!0){this._request&&(this._request.cancel(),this._request=null),this._spriteRequest&&(this._spriteRequest.cancel(),this._spriteRequest=null),us.off("pluginStateChange",this._rtlTextPluginCallback);for(let i in this._layers)this._layers[i].setEventedParent(null);for(let i in this.sourceCaches){let n=this.sourceCaches[i];n.setEventedParent(null),n.onRemove(this.map)}this.imageManager.setEventedParent(null),this.setEventedParent(null),this.dispatcher.remove(t)}_clearSource(t){this.sourceCaches[t].clearTiles()}_reloadSource(t){this.sourceCaches[t].resume(),this.sourceCaches[t].reload()}_updateSources(t){for(let i in this.sourceCaches)this.sourceCaches[i].update(t,this.map.terrain)}_generateCollisionBoxes(){for(let t in this.sourceCaches)this._reloadSource(t)}_updatePlacement(t,i,n,a,o=!1){let s=!1,l=!1,c={};for(let h of this._order){let f=this._layers[h];if(f.type!=="symbol")continue;if(!c[f.source]){let g=this.sourceCaches[f.source];c[f.source]=g.getRenderableIds(!0).map(y=>g.getTileByID(y)).sort((y,x)=>x.tileID.overscaledZ-y.tileID.overscaledZ||(y.tileID.isLessThan(x.tileID)?-1:1))}let m=this.crossTileSymbolIndex.addLayer(f,c[f.source],t.center.lng);s=s||m}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),o=o||this._layerOrderChanged||n===0,(o||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(ne.now(),t.zoom))&&(this.pauseablePlacement=new Fl(t,this.map.terrain,this._order,o,i,n,a,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,c),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(ne.now()),l=!0),s&&this.pauseablePlacement.placement.setStale()),l||s)for(let h of this._order){let f=this._layers[h];f.type==="symbol"&&this.placement.updateLayerOpacities(f,c[f.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(ne.now())}_releaseSymbolFadeTiles(){for(let t in this.sourceCaches)this.sourceCaches[t].releaseSymbolFadeTiles()}getImages(t,i,n){this.imageManager.getImages(i.icons,n),this._updateTilesForChangedImages();let a=this.sourceCaches[i.source];a&&a.setDependencies(i.tileID.key,i.type,i.icons)}getGlyphs(t,i,n){this.glyphManager.getGlyphs(i.stacks,n);let a=this.sourceCaches[i.source];a&&a.setDependencies(i.tileID.key,i.type,[""])}getResource(t,i,n){return wi(i,n)}getGlyphsUrl(){return this.stylesheet.glyphs||null}setGlyphs(t,i={}){this._checkLoaded(),!(t&&this._validate(qe.glyphs,"glyphs",t,null,i))&&(this._glyphsDidChange=!0,this.stylesheet.glyphs=t,this.glyphManager.entries={},this.glyphManager.setURL(t))}addSprite(t,i,n={},a){this._checkLoaded();let o=[{id:t,url:i}],s=[...an(this.stylesheet.sprite),...o];this._validate(qe.sprite,"sprite",s,null,n)||(this.stylesheet.sprite=s,this._loadSprite(o,!0,a))}removeSprite(t){this._checkLoaded();let i=an(this.stylesheet.sprite);if(!i.find(n=>n.id===t)){this.fire(new Z(new Error('Sprite "'.concat(t,"\" doesn't exists on this map."))));return}if(this._spritesImagesIds[t])for(let n of this._spritesImagesIds[t])this.imageManager.removeImage(n),this._changedImages[n]=!0;i.splice(i.findIndex(n=>n.id===t),1),this.stylesheet.sprite=i.length>0?i:void 0,delete this._spritesImagesIds[t],this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new z("data",{dataType:"style"}))}getSprite(){return an(this.stylesheet.sprite)}setSprite(t,i={},n){this._checkLoaded(),!(t&&this._validate(qe.sprite,"sprite",t,null,i))&&(this.stylesheet.sprite=t,t?this._loadSprite(t,!0,n):(this._unloadSprite(),n&&n(null)))}};u(Ol,"Style");var Br=Ol;Br.registerForPluginStateChange=mx;d();d();var Vl=ve([{name:"a_pos",type:"Int16",components:2}]);d();d();var mv="#ifdef GL_ES\nprecision mediump float;\n#else\n#if !defined(lowp)\n#define lowp\n#endif\n#if !defined(mediump)\n#define mediump\n#endif\n#if !defined(highp)\n#define highp\n#endif\n#endif\n";d();var dv="#ifdef GL_ES\nprecision highp float;\n#else\n#if !defined(lowp)\n#define lowp\n#endif\n#if !defined(mediump)\n#define mediump\n#endif\n#if !defined(highp)\n#define highp\n#endif\n#endif\nvec2 unpack_float(const float packedValue) {int packedIntValue=int(packedValue);int v0=packedIntValue/256;return vec2(v0,packedIntValue-v0*256);}vec2 unpack_opacity(const float packedOpacity) {int intOpacity=int(packedOpacity)/2;return vec2(float(intOpacity)/127.0,mod(packedOpacity,2.0));}vec4 decode_color(const vec2 encodedColor) {return vec4(unpack_float(encodedColor[0])/255.0,unpack_float(encodedColor[1])/255.0\n);}float unpack_mix_vec2(const vec2 packedValue,const float t) {return mix(packedValue[0],packedValue[1],t);}vec4 unpack_mix_color(const vec4 packedColors,const float t) {vec4 minColor=decode_color(vec2(packedColors[0],packedColors[1]));vec4 maxColor=decode_color(vec2(packedColors[2],packedColors[3]));return mix(minColor,maxColor,t);}vec2 get_pattern_pos(const vec2 pixel_coord_upper,const vec2 pixel_coord_lower,const vec2 pattern_size,const float tile_units_to_pixels,const vec2 pos) {vec2 offset=mod(mod(mod(pixel_coord_upper,pattern_size)*256.0,pattern_size)*256.0+pixel_coord_lower,pattern_size);return (tile_units_to_pixels*pos+offset)/pattern_size;}\n#ifdef TERRAIN3D\nuniform sampler2D u_terrain;uniform float u_terrain_dim;uniform mat4 u_terrain_matrix;uniform vec4 u_terrain_unpack;uniform float u_terrain_exaggeration;uniform highp sampler2D u_depth;\n#endif\nconst highp vec4 bitSh=vec4(256.*256.*256.,256.*256.,256.,1.);const highp vec4 bitShifts=vec4(1.)/bitSh;highp float unpack(highp vec4 color) {return dot(color,bitShifts);}highp float depthOpacity(vec3 frag) {\n#ifdef TERRAIN3D\nhighp float d=unpack(texture2D(u_depth,frag.xy*0.5+0.5))+0.0001-frag.z;return 1.0-max(0.0,min(1.0,-d*500.0));\n#else\nreturn 1.0;\n#endif\n}float calculate_visibility(vec4 pos) {\n#ifdef TERRAIN3D\nvec3 frag=pos.xyz/pos.w;highp float d=depthOpacity(frag);if (d > 0.95) return 1.0;return (d+depthOpacity(frag+vec3(0.0,0.01,0.0)))/2.0;\n#else\nreturn 1.0;\n#endif\n}float ele(vec2 pos) {\n#ifdef TERRAIN3D\nvec4 rgb=(texture2D(u_terrain,pos)*255.0)*u_terrain_unpack;return rgb.r+rgb.g+rgb.b-u_terrain_unpack.a;\n#else\nreturn 0.0;\n#endif\n}float get_elevation(vec2 pos) {\n#ifdef TERRAIN3D\nvec2 coord=(u_terrain_matrix*vec4(pos,0.0,1.0)).xy*u_terrain_dim+1.0;vec2 f=fract(coord);vec2 c=(floor(coord)+0.5)/(u_terrain_dim+2.0);float d=1.0/(u_terrain_dim+2.0);float tl=ele(c);float tr=ele(c+vec2(d,0.0));float bl=ele(c+vec2(0.0,d));float br=ele(c+vec2(d,d));float elevation=mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y);return elevation*u_terrain_exaggeration;\n#else\nreturn 0.0;\n#endif\n}";d();var yv="uniform vec4 u_color;uniform float u_opacity;void main() {gl_FragColor=u_color*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}";d();var gv="attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}";d();var xv="uniform vec2 u_pattern_tl_a;uniform vec2 u_pattern_br_a;uniform vec2 u_pattern_tl_b;uniform vec2 u_pattern_br_b;uniform vec2 u_texsize;uniform float u_mix;uniform float u_opacity;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(u_pattern_tl_a/u_texsize,u_pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(u_pattern_tl_b/u_texsize,u_pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_mix)*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}";d();var bv="uniform mat4 u_matrix;uniform vec2 u_pattern_size_a;uniform vec2 u_pattern_size_b;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_scale_a;uniform float u_scale_b;uniform float u_tile_units_to_pixels;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_a*u_pattern_size_a,u_tile_units_to_pixels,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_b*u_pattern_size_b,u_tile_units_to_pixels,a_pos);}";d();var _v="varying vec3 v_data;varying float v_visibility;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize mediump float radius\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize highp vec4 stroke_color\n#pragma mapbox: initialize mediump float stroke_width\n#pragma mapbox: initialize lowp float stroke_opacity\nvec2 extrude=v_data.xy;float extrude_length=length(extrude);lowp float antialiasblur=v_data.z;float antialiased_blur=-max(blur,antialiasblur);float opacity_t=smoothstep(0.0,antialiased_blur,extrude_length-1.0);float color_t=stroke_width < 0.01 ? 0.0 : smoothstep(antialiased_blur,0.0,extrude_length-radius/(radius+stroke_width));gl_FragColor=v_visibility*opacity_t*mix(color*opacity,stroke_color*stroke_opacity,color_t);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}";d();var vv="uniform mat4 u_matrix;uniform bool u_scale_with_map;uniform bool u_pitch_with_map;uniform vec2 u_extrude_scale;uniform lowp float u_device_pixel_ratio;uniform highp float u_camera_to_center_distance;attribute vec2 a_pos;varying vec3 v_data;varying float v_visibility;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\nvoid main(void) {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize mediump float radius\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize highp vec4 stroke_color\n#pragma mapbox: initialize mediump float stroke_width\n#pragma mapbox: initialize lowp float stroke_opacity\nvec2 extrude=vec2(mod(a_pos,2.0)*2.0-1.0);vec2 circle_center=floor(a_pos*0.5);float ele=get_elevation(circle_center);v_visibility=calculate_visibility(u_matrix*vec4(circle_center,ele,1.0));if (u_pitch_with_map) {vec2 corner_position=circle_center;if (u_scale_with_map) {corner_position+=extrude*(radius+stroke_width)*u_extrude_scale;} else {vec4 projected_center=u_matrix*vec4(circle_center,0,1);corner_position+=extrude*(radius+stroke_width)*u_extrude_scale*(projected_center.w/u_camera_to_center_distance);}gl_Position=u_matrix*vec4(corner_position,ele,1);} else {gl_Position=u_matrix*vec4(circle_center,ele,1);if (u_scale_with_map) {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*u_camera_to_center_distance;} else {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*gl_Position.w;}}lowp float antialiasblur=1.0/u_device_pixel_ratio/(radius+stroke_width);v_data=vec3(extrude.x,extrude.y,antialiasblur);}";d();var wv="void main() {gl_FragColor=vec4(1.0);}";d();var Sv="attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}";d();var Pv="uniform highp float u_intensity;varying vec2 v_extrude;\n#pragma mapbox: define highp float weight\n#define GAUSS_COEF 0.3989422804014327\nvoid main() {\n#pragma mapbox: initialize highp float weight\nfloat d=-0.5*3.0*3.0*dot(v_extrude,v_extrude);float val=weight*u_intensity*GAUSS_COEF*exp(d);gl_FragColor=vec4(val,1.0,1.0,1.0);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}";d();var Tv="uniform mat4 u_matrix;uniform float u_extrude_scale;uniform float u_opacity;uniform float u_intensity;attribute vec2 a_pos;varying vec2 v_extrude;\n#pragma mapbox: define highp float weight\n#pragma mapbox: define mediump float radius\nconst highp float ZERO=1.0/255.0/16.0;\n#define GAUSS_COEF 0.3989422804014327\nvoid main(void) {\n#pragma mapbox: initialize highp float weight\n#pragma mapbox: initialize mediump float radius\nvec2 unscaled_extrude=vec2(mod(a_pos,2.0)*2.0-1.0);float S=sqrt(-2.0*log(ZERO/weight/u_intensity/GAUSS_COEF))/3.0;v_extrude=S*unscaled_extrude;vec2 extrude=v_extrude*radius*u_extrude_scale;vec4 pos=vec4(floor(a_pos*0.5)+extrude,0,1);gl_Position=u_matrix*pos;}";d();var Av="uniform sampler2D u_image;uniform sampler2D u_color_ramp;uniform float u_opacity;varying vec2 v_pos;void main() {float t=texture2D(u_image,v_pos).r;vec4 color=texture2D(u_color_ramp,vec2(t,0.5));gl_FragColor=color*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(0.0);\n#endif\n}";d();var Iv="uniform mat4 u_matrix;uniform vec2 u_world;attribute vec2 a_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos*u_world,0,1);v_pos.x=a_pos.x;v_pos.y=1.0-a_pos.y;}";d();var Mv="varying float v_placed;varying float v_notUsed;void main() {float alpha=0.5;gl_FragColor=vec4(1.0,0.0,0.0,1.0)*alpha;if (v_placed > 0.5) {gl_FragColor=vec4(0.0,0.0,1.0,0.5)*alpha;}if (v_notUsed > 0.5) {gl_FragColor*=.1;}}";d();var Cv="attribute vec2 a_pos;attribute vec2 a_anchor_pos;attribute vec2 a_extrude;attribute vec2 a_placed;attribute vec2 a_shift;uniform mat4 u_matrix;uniform vec2 u_extrude_scale;uniform float u_camera_to_center_distance;varying float v_placed;varying float v_notUsed;void main() {vec4 projectedPoint=u_matrix*vec4(a_anchor_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);gl_Position=u_matrix*vec4(a_pos,get_elevation(a_pos),1.0);gl_Position.xy+=(a_extrude+a_shift)*u_extrude_scale*gl_Position.w*collision_perspective_ratio;v_placed=a_placed.x;v_notUsed=a_placed.y;}";d();var Ev="varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;void main() {float alpha=0.5*min(v_perspective_ratio,1.0);float stroke_radius=0.9*max(v_perspective_ratio,1.0);float distance_to_center=length(v_extrude);float distance_to_edge=abs(distance_to_center-v_radius);float opacity_t=smoothstep(-stroke_radius,0.0,-distance_to_edge);vec4 color=mix(vec4(0.0,0.0,1.0,0.5),vec4(1.0,0.0,0.0,1.0),v_collision);gl_FragColor=color*alpha*opacity_t;}";d();var kv="attribute vec2 a_pos;attribute float a_radius;attribute vec2 a_flags;uniform mat4 u_matrix;uniform mat4 u_inv_matrix;uniform vec2 u_viewport_size;uniform float u_camera_to_center_distance;varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;vec3 toTilePosition(vec2 screenPos) {vec4 rayStart=u_inv_matrix*vec4(screenPos,-1.0,1.0);vec4 rayEnd =u_inv_matrix*vec4(screenPos, 1.0,1.0);rayStart.xyz/=rayStart.w;rayEnd.xyz /=rayEnd.w;highp float t=(0.0-rayStart.z)/(rayEnd.z-rayStart.z);return mix(rayStart.xyz,rayEnd.xyz,t);}void main() {vec2 quadCenterPos=a_pos;float radius=a_radius;float collision=a_flags.x;float vertexIdx=a_flags.y;vec2 quadVertexOffset=vec2(mix(-1.0,1.0,float(vertexIdx >=2.0)),mix(-1.0,1.0,float(vertexIdx >=1.0 && vertexIdx <=2.0)));vec2 quadVertexExtent=quadVertexOffset*radius;vec3 tilePos=toTilePosition(quadCenterPos);vec4 clipPos=u_matrix*vec4(tilePos,1.0);highp float camera_to_anchor_distance=clipPos.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);float padding_factor=1.2;v_radius=radius;v_extrude=quadVertexExtent*padding_factor;v_perspective_ratio=collision_perspective_ratio;v_collision=collision;gl_Position=vec4(clipPos.xyz/clipPos.w,1.0)+vec4(quadVertexExtent*padding_factor/u_viewport_size*2.0,0.0,0.0);}";d();var Lv="uniform highp vec4 u_color;uniform sampler2D u_overlay;varying vec2 v_uv;void main() {vec4 overlay_color=texture2D(u_overlay,v_uv);gl_FragColor=mix(u_color,overlay_color,overlay_color.a);}";d();var Dv="attribute vec2 a_pos;varying vec2 v_uv;uniform mat4 u_matrix;uniform float u_overlay_scale;void main() {v_uv=a_pos/8192.0;gl_Position=u_matrix*vec4(a_pos*u_overlay_scale,get_elevation(a_pos),1);}";d();var zv="#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\ngl_FragColor=color*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}";d();var Fv="attribute vec2 a_pos;uniform mat4 u_matrix;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=u_matrix*vec4(a_pos,0,1);}";d();var Bv="varying vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=outline_color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}";d();var Rv="attribute vec2 a_pos;uniform mat4 u_matrix;uniform vec2 u_world;varying vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=u_matrix*vec4(a_pos,0,1);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}";d();var Ov="uniform vec2 u_texsize;uniform sampler2D u_image;uniform float u_fade;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=mix(color1,color2,u_fade)*alpha*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}";d();var Vv="uniform mat4 u_matrix;uniform vec2 u_world;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;gl_Position=u_matrix*vec4(a_pos,0,1);vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,a_pos);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}";d();var Uv="#ifdef GL_ES\nprecision highp float;\n#endif\nuniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_fade)*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}";d();var Nv="uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileZoomRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileZoomRatio,a_pos);}";d();var Gv="varying vec4 v_color;void main() {gl_FragColor=v_color;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}";d();var qv="uniform mat4 u_matrix;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;uniform float u_vertical_gradient;uniform lowp float u_opacity;attribute vec2 a_pos;attribute vec4 a_normal_ed;\n#ifdef TERRAIN3D\nattribute vec2 a_centroid;\n#endif\nvarying vec4 v_color;\n#pragma mapbox: define highp float base\n#pragma mapbox: define highp float height\n#pragma mapbox: define highp vec4 color\nvoid main() {\n#pragma mapbox: initialize highp float base\n#pragma mapbox: initialize highp float height\n#pragma mapbox: initialize highp vec4 color\nvec3 normal=a_normal_ed.xyz;\n#ifdef TERRAIN3D\nfloat height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_offset=height_terrain3d_offset-(base > 0.0 ? 0.0 : 10.0);\n#else\nfloat height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0;\n#endif\nbase=max(0.0,base)+base_terrain3d_offset;height=max(0.0,height)+height_terrain3d_offset;float t=mod(normal.x,2.0);gl_Position=u_matrix*vec4(a_pos,t > 0.0 ? height : base,1);float colorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;v_color=vec4(0.0,0.0,0.0,1.0);vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;float directional=clamp(dot(normal/16384.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_color.r+=clamp(color.r*directional*u_lightcolor.r,mix(0.0,0.3,1.0-u_lightcolor.r),1.0);v_color.g+=clamp(color.g*directional*u_lightcolor.g,mix(0.0,0.3,1.0-u_lightcolor.g),1.0);v_color.b+=clamp(color.b*directional*u_lightcolor.b,mix(0.0,0.3,1.0-u_lightcolor.b),1.0);v_color*=u_opacity;}";d();var jv="uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);vec4 mixedColor=mix(color1,color2,u_fade);gl_FragColor=mixedColor*v_lighting;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}";d();var $v="uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_height_factor;uniform vec3 u_scale;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;attribute vec2 a_pos;attribute vec4 a_normal_ed;\n#ifdef TERRAIN3D\nattribute vec2 a_centroid;\n#endif\nvarying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec3 normal=a_normal_ed.xyz;float edgedistance=a_normal_ed.w;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;\n#ifdef TERRAIN3D\nfloat height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_offset=height_terrain3d_offset-(base > 0.0 ? 0.0 : 10.0);\n#else\nfloat height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0;\n#endif\nbase=max(0.0,base)+base_terrain3d_offset;height=max(0.0,height)+height_terrain3d_offset;float t=mod(normal.x,2.0);float z=t > 0.0 ? height : base;gl_Position=u_matrix*vec4(a_pos,z,1);vec2 pos=normal.x==1.0 && normal.y==0.0 && normal.z==16384.0\n? a_pos\n: vec2(edgedistance,z*u_height_factor);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,pos);v_lighting=vec4(0.0,0.0,0.0,1.0);float directional=clamp(dot(normal/16383.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_lighting.rgb+=clamp(directional*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_lighting*=u_opacity;}";d();var Hv="#ifdef GL_ES\nprecision highp float;\n#endif\nuniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;uniform vec4 u_unpack;float getElevation(vec2 coord,float bias) {vec4 data=texture2D(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack)/4.0;}void main() {vec2 epsilon=1.0/u_dimension;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y),0.0);float b=getElevation(v_pos+vec2(0,-epsilon.y),0.0);float c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y),0.0);float d=getElevation(v_pos+vec2(-epsilon.x,0),0.0);float e=getElevation(v_pos,0.0);float f=getElevation(v_pos+vec2(epsilon.x,0),0.0);float g=getElevation(v_pos+vec2(-epsilon.x,epsilon.y),0.0);float h=getElevation(v_pos+vec2(0,epsilon.y),0.0);float i=getElevation(v_pos+vec2(epsilon.x,epsilon.y),0.0);float exaggerationFactor=u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;float exaggeration=u_zoom < 15.0 ? (u_zoom-15.0)*exaggerationFactor : 0.0;vec2 deriv=vec2((c+f+f+i)-(a+d+d+g),(g+h+h+i)-(a+b+b+c))/pow(2.0,exaggeration+(19.2562-u_zoom));gl_FragColor=clamp(vec4(deriv.x/2.0+0.5,deriv.y/2.0+0.5,1.0,1.0),0.0,1.0);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}";d();var Zv="uniform mat4 u_matrix;uniform vec2 u_dimension;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);highp vec2 epsilon=1.0/u_dimension;float scale=(u_dimension.x-2.0)/u_dimension.x;v_pos=(a_texture_pos/8192.0)*scale+epsilon;}";d();var Wv="uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_latrange;uniform vec2 u_light;uniform vec4 u_shadow;uniform vec4 u_highlight;uniform vec4 u_accent;\n#define PI 3.141592653589793\nvoid main() {vec4 pixel=texture2D(u_image,v_pos);vec2 deriv=((pixel.rg*2.0)-1.0);float scaleFactor=cos(radians((u_latrange[0]-u_latrange[1])*(1.0-v_pos.y)+u_latrange[1]));float slope=atan(1.25*length(deriv)/scaleFactor);float aspect=deriv.x !=0.0 ? atan(deriv.y,-deriv.x) : PI/2.0*(deriv.y > 0.0 ? 1.0 :-1.0);float intensity=u_light.x;float azimuth=u_light.y+PI;float base=1.875-intensity*1.75;float maxValue=0.5*PI;float scaledSlope=intensity !=0.5 ? ((pow(base,slope)-1.0)/(pow(base,maxValue)-1.0))*maxValue : slope;float accent=cos(scaledSlope);vec4 accent_color=(1.0-accent)*u_accent*clamp(intensity*2.0,0.0,1.0);float shade=abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);vec4 shade_color=mix(u_shadow,u_highlight,shade)*sin(scaledSlope)*clamp(intensity*2.0,0.0,1.0);gl_FragColor=accent_color*(1.0-shade_color.a)+shade_color;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}";d();var Xv="uniform mat4 u_matrix;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=a_texture_pos/8192.0;}";d();var Kv="uniform lowp float u_device_pixel_ratio;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}";d();var Yv="\n#define scale 0.015873016\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform vec2 u_units_to_pixels;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp float v_linesofar;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;v_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*2.0;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;\n#ifdef TERRAIN3D\nv_gamma_scale=1.0;\n#else\nfloat extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\n#endif\nv_width2=vec2(outset,inset);}";d();var Jv="uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;varying highp vec2 v_uv;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);vec4 color=texture2D(u_image,v_uv);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}";d();var Qv="\n#define scale 0.015873016\nattribute vec2 a_pos_normal;attribute vec4 a_data;attribute float a_uv_x;attribute float a_split_index;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;uniform float u_image_height;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp vec2 v_uv;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;highp float texel_height=1.0/u_image_height;highp float half_texel_height=0.5*texel_height;v_uv=vec2(a_uv_x,a_split_index*texel_height-half_texel_height);vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;\n#ifdef TERRAIN3D\nv_gamma_scale=1.0;\n#else\nfloat extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\n#endif\nv_width2=vec2(outset,inset);}";d();var e0="#ifdef GL_ES\nprecision highp float;\n#endif\nuniform lowp float u_device_pixel_ratio;uniform vec2 u_texsize;uniform float u_fade;uniform mediump vec3 u_scale;uniform sampler2D u_image;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;vec2 pattern_size_a=vec2(display_size_a.x*fromScale/tileZoomRatio,display_size_a.y);vec2 pattern_size_b=vec2(display_size_b.x*toScale/tileZoomRatio,display_size_b.y);float aspect_a=display_size_a.y/v_width;float aspect_b=display_size_b.y/v_width;float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float x_a=mod(v_linesofar/pattern_size_a.x*aspect_a,1.0);float x_b=mod(v_linesofar/pattern_size_b.x*aspect_b,1.0);float y=0.5*v_normal.y+0.5;vec2 texel_size=1.0/u_texsize;vec2 pos_a=mix(pattern_tl_a*texel_size-texel_size,pattern_br_a*texel_size+texel_size,vec2(x_a,y));vec2 pos_b=mix(pattern_tl_b*texel_size-texel_size,pattern_br_b*texel_size+texel_size,vec2(x_b,y));vec4 color=mix(texture2D(u_image,pos_a),texture2D(u_image,pos_b),u_fade);gl_FragColor=color*alpha*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}";d();var t0="\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform vec2 u_units_to_pixels;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;\n#ifdef TERRAIN3D\nv_gamma_scale=1.0;\n#else\nfloat extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\n#endif\nv_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;}";d();var r0="uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;uniform float u_sdfgamma;uniform float u_mix;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float sdfdist_a=texture2D(u_image,v_tex_a).a;float sdfdist_b=texture2D(u_image,v_tex_b).a;float sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);alpha*=smoothstep(0.5-u_sdfgamma/floorwidth,0.5+u_sdfgamma/floorwidth,sdfdist);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}";d();var i0="\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_patternscale_a;uniform float u_tex_y_a;uniform vec2 u_patternscale_b;uniform float u_tex_y_b;uniform vec2 u_units_to_pixels;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;\n#ifdef TERRAIN3D\nv_gamma_scale=1.0;\n#else\nfloat extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\n#endif\nv_tex_a=vec2(a_linesofar*u_patternscale_a.x/floorwidth,normal.y*u_patternscale_a.y+u_tex_y_a);v_tex_b=vec2(a_linesofar*u_patternscale_b.x/floorwidth,normal.y*u_patternscale_b.y+u_tex_y_b);v_width2=vec2(outset,inset);}";d();var n0="uniform float u_fade_t;uniform float u_opacity;uniform sampler2D u_image0;uniform sampler2D u_image1;varying vec2 v_pos0;varying vec2 v_pos1;uniform float u_brightness_low;uniform float u_brightness_high;uniform float u_saturation_factor;uniform float u_contrast_factor;uniform vec3 u_spin_weights;void main() {vec4 color0=texture2D(u_image0,v_pos0);vec4 color1=texture2D(u_image1,v_pos1);if (color0.a > 0.0) {color0.rgb=color0.rgb/color0.a;}if (color1.a > 0.0) {color1.rgb=color1.rgb/color1.a;}vec4 color=mix(color0,color1,u_fade_t);color.a*=u_opacity;vec3 rgb=color.rgb;rgb=vec3(dot(rgb,u_spin_weights.xyz),dot(rgb,u_spin_weights.zxy),dot(rgb,u_spin_weights.yzx));float average=(color.r+color.g+color.b)/3.0;rgb+=(average-rgb)*u_saturation_factor;rgb=(rgb-0.5)*u_contrast_factor+0.5;vec3 u_high_vec=vec3(u_brightness_low,u_brightness_low,u_brightness_low);vec3 u_low_vec=vec3(u_brightness_high,u_brightness_high,u_brightness_high);gl_FragColor=vec4(mix(u_high_vec,u_low_vec,rgb)*color.a,color.a);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}";d();var a0="uniform mat4 u_matrix;uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform float u_buffer_scale;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos0;varying vec2 v_pos1;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos0=(((a_texture_pos/8192.0)-0.5)/u_buffer_scale )+0.5;v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;}";d();var o0="uniform sampler2D u_texture;varying vec2 v_tex;varying float v_fade_opacity;\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nlowp float alpha=opacity*v_fade_opacity;gl_FragColor=texture2D(u_texture,v_tex)*alpha;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}";d();var s0="const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform highp float u_camera_to_center_distance;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform float u_fade_change;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform vec2 u_texsize;varying vec2 v_tex;varying float v_fade_opacity;\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;vec2 a_minFontScale=a_pixeloffset.zw/256.0;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,ele,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),ele,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,ele,1.0);float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*max(a_minFontScale,fontScale)+a_pxoffset/16.0),z,1.0);v_tex=a_tex/u_texsize;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float visibility=calculate_visibility(projectedPoint);v_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));}";d();var l0="#define SDF_PX 8.0\nuniform bool u_is_halo;uniform sampler2D u_texture;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;uniform bool u_is_text;varying vec2 v_data0;varying vec3 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nfloat EDGE_GAMMA=0.105/u_device_pixel_ratio;vec2 tex=v_data0.xy;float gamma_scale=v_data1.x;float size=v_data1.y;float fade_opacity=v_data1[2];float fontScale=u_is_text ? size/24.0 : size;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}";d();var u0="const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;varying vec2 v_data0;varying vec3 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,ele,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),ele,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,ele,1.0);float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset),z,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float visibility=calculate_visibility(projectedPoint);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,interpolated_fade_opacity);}";d();var c0="#define SDF_PX 8.0\n#define SDF 1.0\n#define ICON 0.0\nuniform bool u_is_halo;uniform sampler2D u_texture;uniform sampler2D u_texture_icon;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;varying vec4 v_data0;varying vec4 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nfloat fade_opacity=v_data1[2];if (v_data1.w==ICON) {vec2 tex_icon=v_data0.zw;lowp float alpha=opacity*fade_opacity;gl_FragColor=texture2D(u_texture_icon,tex_icon)*alpha;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\nreturn;}vec2 tex=v_data0.xy;float EDGE_GAMMA=0.105/u_device_pixel_ratio;float gamma_scale=v_data1.x;float size=v_data1.y;float fontScale=size/24.0;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}";d();var p0="const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec2 u_texsize_icon;varying vec4 v_data0;varying vec4 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);float is_sdf=a_size[0]-2.0*a_size_min;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,ele,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),ele,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,ele,1.0);float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale),z,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float visibility=calculate_visibility(projectedPoint);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));v_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec4(gamma_scale,size,interpolated_fade_opacity,is_sdf);}";d();var h0="varying float v_depth;const highp vec4 bitSh=vec4(256.*256.*256.,256.*256.,256.,1.);const highp vec4 bitMsk=vec4(0.,vec3(1./256.0));highp vec4 pack(highp float value) {highp vec4 comp=fract(value*bitSh);comp-=comp.xxyz*bitMsk;return comp;}void main() {gl_FragColor=pack(v_depth);}";d();var f0="precision mediump float;uniform sampler2D u_texture;uniform float u_terrain_coords_id;varying vec2 v_texture_pos;void main() {vec4 rgba=texture2D(u_texture,v_texture_pos);gl_FragColor=vec4(rgba.r,rgba.g,rgba.b,u_terrain_coords_id);}";d();var m0="uniform sampler2D u_texture;varying vec2 v_texture_pos;void main() {gl_FragColor=texture2D(u_texture,v_texture_pos);}";d();var Ul="attribute vec3 a_pos3d;uniform mat4 u_matrix;uniform float u_ele_delta;varying vec2 v_texture_pos;varying float v_depth;void main() {float extent=8192.0;float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;v_texture_pos=a_pos3d.xy/extent;gl_Position=u_matrix*vec4(a_pos3d.xy,get_elevation(a_pos3d.xy)-ele_delta,1.0);v_depth=gl_Position.z/gl_Position.w;}";var xi={prelude:Le(mv,dv),background:Le(yv,gv),backgroundPattern:Le(xv,bv),circle:Le(_v,vv),clippingMask:Le(wv,Sv),heatmap:Le(Pv,Tv),heatmapTexture:Le(Av,Iv),collisionBox:Le(Mv,Cv),collisionCircle:Le(Ev,kv),debug:Le(Lv,Dv),fill:Le(zv,Fv),fillOutline:Le(Bv,Rv),fillOutlinePattern:Le(Ov,Vv),fillPattern:Le(Uv,Nv),fillExtrusion:Le(Gv,qv),fillExtrusionPattern:Le(jv,$v),hillshadePrepare:Le(Hv,Zv),hillshade:Le(Wv,Xv),line:Le(Kv,Yv),lineGradient:Le(Jv,Qv),linePattern:Le(e0,t0),lineSDF:Le(r0,i0),raster:Le(n0,a0),symbolIcon:Le(o0,s0),symbolSDF:Le(l0,u0),symbolTextAndIcon:Le(c0,p0),terrain:Le(m0,Ul),terrainDepth:Le(h0,Ul),terrainCoords:Le(f0,Ul)};function Le(r,e){let t=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,i=e.match(/attribute ([\w]+) ([\w]+)/g),n=r.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),a=e.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),o=a?a.concat(n):n,s={};return r=r.replace(t,(l,c,p,h,f)=>(s[f]=!0,c==="define"?"\n#ifndef HAS_UNIFORM_u_".concat(f,"\nvarying ").concat(p," ").concat(h," ").concat(f,";\n#else\nuniform ").concat(p," ").concat(h," u_").concat(f,";\n#endif\n"):"\n#ifdef HAS_UNIFORM_u_".concat(f,"\n ").concat(p," ").concat(h," ").concat(f," = u_").concat(f,";\n#endif\n"))),e=e.replace(t,(l,c,p,h,f)=>{let m=h==="float"?"vec2":"vec4",g=f.match(/color/)?"color":m;return s[f]?c==="define"?"\n#ifndef HAS_UNIFORM_u_".concat(f,"\nuniform lowp float u_").concat(f,"_t;\nattribute ").concat(p," ").concat(m," a_").concat(f,";\nvarying ").concat(p," ").concat(h," ").concat(f,";\n#else\nuniform ").concat(p," ").concat(h," u_").concat(f,";\n#endif\n"):g==="vec4"?"\n#ifndef HAS_UNIFORM_u_".concat(f,"\n ").concat(f," = a_").concat(f,";\n#else\n ").concat(p," ").concat(h," ").concat(f," = u_").concat(f,";\n#endif\n"):"\n#ifndef HAS_UNIFORM_u_".concat(f,"\n ").concat(f," = unpack_mix_").concat(g,"(a_").concat(f,", u_").concat(f,"_t);\n#else\n ").concat(p," ").concat(h," ").concat(f," = u_").concat(f,";\n#endif\n"):c==="define"?"\n#ifndef HAS_UNIFORM_u_".concat(f,"\nuniform lowp float u_").concat(f,"_t;\nattribute ").concat(p," ").concat(m," a_").concat(f,";\n#else\nuniform ").concat(p," ").concat(h," u_").concat(f,";\n#endif\n"):g==="vec4"?"\n#ifndef HAS_UNIFORM_u_".concat(f,"\n ").concat(p," ").concat(h," ").concat(f," = a_").concat(f,";\n#else\n ").concat(p," ").concat(h," ").concat(f," = u_").concat(f,";\n#endif\n"):"\n#ifndef HAS_UNIFORM_u_".concat(f,"\n ").concat(p," ").concat(h," ").concat(f," = unpack_mix_").concat(g,"(a_").concat(f,", u_").concat(f,"_t);\n#else\n ").concat(p," ").concat(h," ").concat(f," = u_").concat(f,";\n#endif\n")}),{fragmentSource:r,vertexSource:e,staticAttributes:i,staticUniforms:o}}u(Le,"compile");d();d();var td=class td{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null}bind(e,t,i,n,a,o,s,l,c){this.context=e;let p=this.boundPaintVertexBuffers.length!==n.length;for(let f=0;!p&&f<n.length;f++)this.boundPaintVertexBuffers[f]!==n[f]&&(p=!0);!this.vao||this.boundProgram!==t||this.boundLayoutVertexBuffer!==i||p||this.boundIndexBuffer!==a||this.boundVertexOffset!==o||this.boundDynamicVertexBuffer!==s||this.boundDynamicVertexBuffer2!==l||this.boundDynamicVertexBuffer3!==c?this.freshBind(t,i,n,a,o,s,l,c):(e.bindVertexArray.set(this.vao),s&&s.bind(),a&&a.dynamicDraw&&a.bind(),l&&l.bind(),c&&c.bind())}freshBind(e,t,i,n,a,o,s,l){let c=e.numAttributes,p=this.context,h=p.gl;this.vao&&this.destroy(),this.vao=p.createVertexArray(),p.bindVertexArray.set(this.vao),this.boundProgram=e,this.boundLayoutVertexBuffer=t,this.boundPaintVertexBuffers=i,this.boundIndexBuffer=n,this.boundVertexOffset=a,this.boundDynamicVertexBuffer=o,this.boundDynamicVertexBuffer2=s,this.boundDynamicVertexBuffer3=l,t.enableAttributes(h,e);for(let f of i)f.enableAttributes(h,e);o&&o.enableAttributes(h,e),s&&s.enableAttributes(h,e),l&&l.enableAttributes(h,e),t.bind(),t.setVertexAttribPointers(h,e,a);for(let f of i)f.bind(),f.setVertexAttribPointers(h,e,a);o&&(o.bind(),o.setVertexAttribPointers(h,e,a)),n&&n.bind(),s&&(s.bind(),s.setVertexAttribPointers(h,e,a)),l&&(l.bind(),l.setVertexAttribPointers(h,e,a)),p.currentNumAttributes=c}destroy(){this.vao&&(this.context.deleteVertexArray(this.vao),this.vao=null)}};u(td,"VertexArrayObject");var Nl=td;d();var d0=u((r,e)=>({u_depth:new Y(r,e.u_depth),u_terrain:new Y(r,e.u_terrain),u_terrain_dim:new U(r,e.u_terrain_dim),u_terrain_matrix:new te(r,e.u_terrain_matrix),u_terrain_unpack:new Ar(r,e.u_terrain_unpack),u_terrain_exaggeration:new U(r,e.u_terrain_exaggeration)}),"terrainPreludeUniforms"),y0=u((r,e)=>({u_matrix:new te(r,e.u_matrix),u_texture:new Y(r,e.u_texture),u_ele_delta:new U(r,e.u_ele_delta)}),"terrainUniforms"),g0=u((r,e)=>({u_matrix:new te(r,e.u_matrix),u_ele_delta:new U(r,e.u_ele_delta)}),"terrainDepthUniforms"),x0=u((r,e)=>({u_matrix:new te(r,e.u_matrix),u_texture:new Y(r,e.u_texture),u_terrain_coords_id:new U(r,e.u_terrain_coords_id),u_ele_delta:new U(r,e.u_ele_delta)}),"terrainCoordsUniforms"),b0=u((r,e)=>({u_matrix:r,u_texture:0,u_ele_delta:e}),"terrainUniformValues"),_0=u((r,e)=>({u_matrix:r,u_ele_delta:e}),"terrainDepthUniformValues"),v0=u((r,e,t)=>({u_matrix:r,u_terrain_coords_id:e/255,u_texture:0,u_ele_delta:t}),"terrainCoordsUniformValues");function rd(r){let e=[];for(let t=0;t<r.length;t++){if(r[t]===null)continue;let i=r[t].split(" ");e.push(i.pop())}return e}u(rd,"getTokenizedAttributesAndUniforms");var id=class id{constructor(e,t,i,n,a,o){let s=e.gl;this.program=s.createProgram();let l=rd(t.staticAttributes),c=i?i.getBinderAttributes():[],p=l.concat(c),h=xi.prelude.staticUniforms?rd(xi.prelude.staticUniforms):[],f=t.staticUniforms?rd(t.staticUniforms):[],m=i?i.getBinderUniforms():[],g=h.concat(f).concat(m),y=[];for(let T of g)y.indexOf(T)<0&&y.push(T);let x=i?i.defines():[];a&&x.push("#define OVERDRAW_INSPECTOR;"),o&&x.push("#define TERRAIN3D;");let b=x.concat(xi.prelude.fragmentSource,t.fragmentSource).join("\n"),_=x.concat(xi.prelude.vertexSource,t.vertexSource).join("\n"),v=s.createShader(s.FRAGMENT_SHADER);if(s.isContextLost()){this.failedToCreate=!0;return}s.shaderSource(v,b),s.compileShader(v),s.attachShader(this.program,v);let S=s.createShader(s.VERTEX_SHADER);if(s.isContextLost()){this.failedToCreate=!0;return}s.shaderSource(S,_),s.compileShader(S),s.attachShader(this.program,S),this.attributes={};let P={};this.numAttributes=p.length;for(let T=0;T<this.numAttributes;T++)p[T]&&(s.bindAttribLocation(this.program,T,p[T]),this.attributes[p[T]]=T);s.linkProgram(this.program),s.deleteShader(S),s.deleteShader(v);for(let T=0;T<y.length;T++){let A=y[T];if(A&&!P[A]){let L=s.getUniformLocation(this.program,A);L&&(P[A]=L)}}this.fixedUniforms=n(e,P),this.terrainUniforms=d0(e,P),this.binderUniforms=i?i.getUniforms(e,P):[]}draw(e,t,i,n,a,o,s,l,c,p,h,f,m,g,y,x,b,_){let v=e.gl;if(this.failedToCreate)return;e.program.set(this.program),e.setDepthMode(i),e.setStencilMode(n),e.setColorMode(a),e.setCullFace(o);for(let P in this.fixedUniforms)this.fixedUniforms[P].set(s[P]);y&&y.setUniforms(e,this.binderUniforms,m,{zoom:g});let S=0;switch(t){case v.LINES:S=2;break;case v.TRIANGLES:S=3;break;case v.LINE_STRIP:S=1;break}for(let P of f.get()){let T=P.vaos||(P.vaos={});(T[c]||(T[c]=new Nl)).bind(e,this,p,y?y.getPaintVertexBuffers():[],h,P.vertexOffset,x,b,_),v.drawElements(t,P.primitiveLength*S,v.UNSIGNED_SHORT,P.primitiveOffset*S*2)}}};u(id,"Program");var Gl=id;d();d();d();function ql(r,e,t){let i=1/Ke(t,1,e.transform.tileZoom),n=Math.pow(2,t.tileID.overscaledZ),a=t.tileSize*Math.pow(2,e.transform.tileZoom)/n,o=a*(t.tileID.canonical.x+t.tileID.wrap*n),s=a*t.tileID.canonical.y;return{u_image:0,u_texsize:t.imageAtlasTexture.size,u_scale:[i,r.fromScale,r.toScale],u_fade:r.t,u_pixel_coord_upper:[o>>16,s>>16],u_pixel_coord_lower:[o&65535,s&65535]}}u(ql,"patternUniformValues");function w0(r,e,t,i){let n=t.imageManager.getPattern(r.from.toString()),a=t.imageManager.getPattern(r.to.toString()),{width:o,height:s}=t.imageManager.getPixelSize(),l=Math.pow(2,i.tileID.overscaledZ),c=i.tileSize*Math.pow(2,t.transform.tileZoom)/l,p=c*(i.tileID.canonical.x+i.tileID.wrap*l),h=c*i.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:n.tl,u_pattern_br_a:n.br,u_pattern_tl_b:a.tl,u_pattern_br_b:a.br,u_texsize:[o,s],u_mix:e.t,u_pattern_size_a:n.displaySize,u_pattern_size_b:a.displaySize,u_scale_a:e.fromScale,u_scale_b:e.toScale,u_tile_units_to_pixels:1/Ke(i,1,t.transform.tileZoom),u_pixel_coord_upper:[p>>16,h>>16],u_pixel_coord_lower:[p&65535,h&65535]}}u(w0,"bgPatternUniformValues");var S0=u((r,e)=>({u_matrix:new te(r,e.u_matrix),u_lightpos:new st(r,e.u_lightpos),u_lightintensity:new U(r,e.u_lightintensity),u_lightcolor:new st(r,e.u_lightcolor),u_vertical_gradient:new U(r,e.u_vertical_gradient),u_opacity:new U(r,e.u_opacity)}),"fillExtrusionUniforms"),P0=u((r,e)=>({u_matrix:new te(r,e.u_matrix),u_lightpos:new st(r,e.u_lightpos),u_lightintensity:new U(r,e.u_lightintensity),u_lightcolor:new st(r,e.u_lightcolor),u_vertical_gradient:new U(r,e.u_vertical_gradient),u_height_factor:new U(r,e.u_height_factor),u_image:new Y(r,e.u_image),u_texsize:new ee(r,e.u_texsize),u_pixel_coord_upper:new ee(r,e.u_pixel_coord_upper),u_pixel_coord_lower:new ee(r,e.u_pixel_coord_lower),u_scale:new st(r,e.u_scale),u_fade:new U(r,e.u_fade),u_opacity:new U(r,e.u_opacity)}),"fillExtrusionPatternUniforms"),nd=u((r,e,t,i)=>{let n=e.style.light,a=n.properties.get("position"),o=[a.x,a.y,a.z],s=Aa.create();n.properties.get("anchor")==="viewport"&&Aa.fromRotation(s,-e.transform.angle),gt.transformMat3(o,o,s);let l=n.properties.get("color");return{u_matrix:r,u_lightpos:o,u_lightintensity:n.properties.get("intensity"),u_lightcolor:[l.r,l.g,l.b],u_vertical_gradient:+t,u_opacity:i}},"fillExtrusionUniformValues"),T0=u((r,e,t,i,n,a,o)=>R(nd(r,e,t,i),ql(a,e,o),{u_height_factor:-Math.pow(2,n.overscaledZ)/o.tileSize/8}),"fillExtrusionPatternUniformValues");d();var A0=u((r,e)=>({u_matrix:new te(r,e.u_matrix)}),"fillUniforms"),I0=u((r,e)=>({u_matrix:new te(r,e.u_matrix),u_image:new Y(r,e.u_image),u_texsize:new ee(r,e.u_texsize),u_pixel_coord_upper:new ee(r,e.u_pixel_coord_upper),u_pixel_coord_lower:new ee(r,e.u_pixel_coord_lower),u_scale:new st(r,e.u_scale),u_fade:new U(r,e.u_fade)}),"fillPatternUniforms"),M0=u((r,e)=>({u_matrix:new te(r,e.u_matrix),u_world:new ee(r,e.u_world)}),"fillOutlineUniforms"),C0=u((r,e)=>({u_matrix:new te(r,e.u_matrix),u_world:new ee(r,e.u_world),u_image:new Y(r,e.u_image),u_texsize:new ee(r,e.u_texsize),u_pixel_coord_upper:new ee(r,e.u_pixel_coord_upper),u_pixel_coord_lower:new ee(r,e.u_pixel_coord_lower),u_scale:new st(r,e.u_scale),u_fade:new U(r,e.u_fade)}),"fillOutlinePatternUniforms"),ad=u(r=>({u_matrix:r}),"fillUniformValues"),od=u((r,e,t,i)=>R(ad(r),ql(t,e,i)),"fillPatternUniformValues"),E0=u((r,e)=>({u_matrix:r,u_world:e}),"fillOutlineUniformValues"),k0=u((r,e,t,i,n)=>R(od(r,e,t,i),{u_world:n}),"fillOutlinePatternUniformValues");d();var L0=u((r,e)=>({u_camera_to_center_distance:new U(r,e.u_camera_to_center_distance),u_scale_with_map:new Y(r,e.u_scale_with_map),u_pitch_with_map:new Y(r,e.u_pitch_with_map),u_extrude_scale:new ee(r,e.u_extrude_scale),u_device_pixel_ratio:new U(r,e.u_device_pixel_ratio),u_matrix:new te(r,e.u_matrix)}),"circleUniforms"),D0=u((r,e,t,i)=>{let n=r.transform,a,o;if(i.paint.get("circle-pitch-alignment")==="map"){let s=Ke(t,1,n.zoom);a=!0,o=[s,s]}else a=!1,o=n.pixelsToGLUnits;return{u_camera_to_center_distance:n.cameraToCenterDistance,u_scale_with_map:+(i.paint.get("circle-pitch-scale")==="map"),u_matrix:r.translatePosMatrix(e.posMatrix,t,i.paint.get("circle-translate"),i.paint.get("circle-translate-anchor")),u_pitch_with_map:+a,u_device_pixel_ratio:r.pixelRatio,u_extrude_scale:o}},"circleUniformValues");d();var z0=u((r,e)=>({u_matrix:new te(r,e.u_matrix),u_camera_to_center_distance:new U(r,e.u_camera_to_center_distance),u_pixels_to_tile_units:new U(r,e.u_pixels_to_tile_units),u_extrude_scale:new ee(r,e.u_extrude_scale),u_overscale_factor:new U(r,e.u_overscale_factor)}),"collisionUniforms"),F0=u((r,e)=>({u_matrix:new te(r,e.u_matrix),u_inv_matrix:new te(r,e.u_inv_matrix),u_camera_to_center_distance:new U(r,e.u_camera_to_center_distance),u_viewport_size:new ee(r,e.u_viewport_size)}),"collisionCircleUniforms"),B0=u((r,e,t)=>{let i=Ke(t,1,e.zoom),n=Math.pow(2,e.zoom-t.tileID.overscaledZ),a=t.tileID.overscaleFactor();return{u_matrix:r,u_camera_to_center_distance:e.cameraToCenterDistance,u_pixels_to_tile_units:i,u_extrude_scale:[e.pixelsToGLUnits[0]/(i*n),e.pixelsToGLUnits[1]/(i*n)],u_overscale_factor:a}},"collisionUniformValues"),R0=u((r,e,t)=>({u_matrix:r,u_inv_matrix:e,u_camera_to_center_distance:t.cameraToCenterDistance,u_viewport_size:[t.width,t.height]}),"collisionCircleUniformValues");d();var O0=u((r,e)=>({u_color:new Dt(r,e.u_color),u_matrix:new te(r,e.u_matrix),u_overlay:new Y(r,e.u_overlay),u_overlay_scale:new U(r,e.u_overlay_scale)}),"debugUniforms"),sd=u((r,e,t=1)=>({u_matrix:r,u_color:e,u_overlay:0,u_overlay_scale:t}),"debugUniformValues");d();var V0=u((r,e)=>({u_matrix:new te(r,e.u_matrix)}),"clippingMaskUniforms"),ld=u(r=>({u_matrix:r}),"clippingMaskUniformValues");d();var U0=u((r,e)=>({u_extrude_scale:new U(r,e.u_extrude_scale),u_intensity:new U(r,e.u_intensity),u_matrix:new te(r,e.u_matrix)}),"heatmapUniforms"),N0=u((r,e)=>({u_matrix:new te(r,e.u_matrix),u_world:new ee(r,e.u_world),u_image:new Y(r,e.u_image),u_color_ramp:new Y(r,e.u_color_ramp),u_opacity:new U(r,e.u_opacity)}),"heatmapTextureUniforms"),G0=u((r,e,t,i)=>({u_matrix:r,u_extrude_scale:Ke(e,1,t),u_intensity:i}),"heatmapUniformValues"),q0=u((r,e,t,i)=>{let n=q.create();q.ortho(n,0,r.width,r.height,0,0,1);let a=r.context.gl;return{u_matrix:n,u_world:[a.drawingBufferWidth,a.drawingBufferHeight],u_image:t,u_color_ramp:i,u_opacity:e.paint.get("heatmap-opacity")}},"heatmapTextureUniformValues");d();var j0=u((r,e)=>({u_matrix:new te(r,e.u_matrix),u_image:new Y(r,e.u_image),u_latrange:new ee(r,e.u_latrange),u_light:new ee(r,e.u_light),u_shadow:new Dt(r,e.u_shadow),u_highlight:new Dt(r,e.u_highlight),u_accent:new Dt(r,e.u_accent)}),"hillshadeUniforms"),$0=u((r,e)=>({u_matrix:new te(r,e.u_matrix),u_image:new Y(r,e.u_image),u_dimension:new ee(r,e.u_dimension),u_zoom:new U(r,e.u_zoom),u_unpack:new Ar(r,e.u_unpack)}),"hillshadePrepareUniforms"),H0=u((r,e,t,i)=>{let n=t.paint.get("hillshade-shadow-color"),a=t.paint.get("hillshade-highlight-color"),o=t.paint.get("hillshade-accent-color"),s=t.paint.get("hillshade-illumination-direction")*(Math.PI/180);t.paint.get("hillshade-illumination-anchor")==="viewport"&&(s-=r.transform.angle);let l=!r.options.moving;return{u_matrix:i?i.posMatrix:r.transform.calculatePosMatrix(e.tileID.toUnwrapped(),l),u_image:0,u_latrange:vC(r,e.tileID),u_light:[t.paint.get("hillshade-exaggeration"),s],u_shadow:n,u_highlight:a,u_accent:o}},"hillshadeUniformValues"),Z0=u((r,e)=>{let t=e.stride,i=q.create();return q.ortho(i,0,8192,-8192,0,0,1),q.translate(i,i,[0,-8192,0]),{u_matrix:i,u_image:1,u_dimension:[t,t],u_zoom:r.overscaledZ,u_unpack:e.getUnpackVector()}},"hillshadeUniformPrepareValues");function vC(r,e){let t=Math.pow(2,e.canonical.z),i=e.canonical.y;return[new ze(0,i/t).toLngLat().lat,new ze(0,(i+1)/t).toLngLat().lat]}u(vC,"getTileLatRange");d();var W0=u((r,e)=>({u_matrix:new te(r,e.u_matrix),u_ratio:new U(r,e.u_ratio),u_device_pixel_ratio:new U(r,e.u_device_pixel_ratio),u_units_to_pixels:new ee(r,e.u_units_to_pixels)}),"lineUniforms"),X0=u((r,e)=>({u_matrix:new te(r,e.u_matrix),u_ratio:new U(r,e.u_ratio),u_device_pixel_ratio:new U(r,e.u_device_pixel_ratio),u_units_to_pixels:new ee(r,e.u_units_to_pixels),u_image:new Y(r,e.u_image),u_image_height:new U(r,e.u_image_height)}),"lineGradientUniforms"),K0=u((r,e)=>({u_matrix:new te(r,e.u_matrix),u_texsize:new ee(r,e.u_texsize),u_ratio:new U(r,e.u_ratio),u_device_pixel_ratio:new U(r,e.u_device_pixel_ratio),u_image:new Y(r,e.u_image),u_units_to_pixels:new ee(r,e.u_units_to_pixels),u_scale:new st(r,e.u_scale),u_fade:new U(r,e.u_fade)}),"linePatternUniforms"),Y0=u((r,e)=>({u_matrix:new te(r,e.u_matrix),u_ratio:new U(r,e.u_ratio),u_device_pixel_ratio:new U(r,e.u_device_pixel_ratio),u_units_to_pixels:new ee(r,e.u_units_to_pixels),u_patternscale_a:new ee(r,e.u_patternscale_a),u_patternscale_b:new ee(r,e.u_patternscale_b),u_sdfgamma:new U(r,e.u_sdfgamma),u_image:new Y(r,e.u_image),u_tex_y_a:new U(r,e.u_tex_y_a),u_tex_y_b:new U(r,e.u_tex_y_b),u_mix:new U(r,e.u_mix)}),"lineSDFUniforms"),jl=u((r,e,t,i)=>{let n=r.transform;return{u_matrix:r1(r,e,t,i),u_ratio:1/Ke(e,1,n.zoom),u_device_pixel_ratio:r.pixelRatio,u_units_to_pixels:[1/n.pixelsToGLUnits[0],1/n.pixelsToGLUnits[1]]}},"lineUniformValues"),J0=u((r,e,t,i,n)=>R(jl(r,e,t,n),{u_image:0,u_image_height:i}),"lineGradientUniformValues"),Q0=u((r,e,t,i,n)=>{let a=r.transform,o=t1(e,a);return{u_matrix:r1(r,e,t,n),u_texsize:e.imageAtlasTexture.size,u_ratio:1/Ke(e,1,a.zoom),u_device_pixel_ratio:r.pixelRatio,u_image:0,u_scale:[o,i.fromScale,i.toScale],u_fade:i.t,u_units_to_pixels:[1/a.pixelsToGLUnits[0],1/a.pixelsToGLUnits[1]]}},"linePatternUniformValues"),e1=u((r,e,t,i,n,a)=>{let o=r.transform,s=r.lineAtlas,l=t1(e,o),c=t.layout.get("line-cap")==="round",p=s.getDash(i.from,c),h=s.getDash(i.to,c),f=p.width*n.fromScale,m=h.width*n.toScale;return R(jl(r,e,t,a),{u_patternscale_a:[l/f,-p.height/2],u_patternscale_b:[l/m,-h.height/2],u_sdfgamma:s.width/(Math.min(f,m)*256*r.pixelRatio)/2,u_image:0,u_tex_y_a:p.y,u_tex_y_b:h.y,u_mix:n.t})},"lineSDFUniformValues");function t1(r,e){return 1/Ke(r,1,e.tileZoom)}u(t1,"calculateTileRatio");function r1(r,e,t,i){return r.translatePosMatrix(i?i.posMatrix:e.tileID.posMatrix,e,t.paint.get("line-translate"),t.paint.get("line-translate-anchor"))}u(r1,"calculateMatrix");d();var i1=u((r,e)=>({u_matrix:new te(r,e.u_matrix),u_tl_parent:new ee(r,e.u_tl_parent),u_scale_parent:new U(r,e.u_scale_parent),u_buffer_scale:new U(r,e.u_buffer_scale),u_fade_t:new U(r,e.u_fade_t),u_opacity:new U(r,e.u_opacity),u_image0:new Y(r,e.u_image0),u_image1:new Y(r,e.u_image1),u_brightness_low:new U(r,e.u_brightness_low),u_brightness_high:new U(r,e.u_brightness_high),u_saturation_factor:new U(r,e.u_saturation_factor),u_contrast_factor:new U(r,e.u_contrast_factor),u_spin_weights:new st(r,e.u_spin_weights)}),"rasterUniforms"),n1=u((r,e,t,i,n)=>({u_matrix:r,u_tl_parent:e,u_scale_parent:t,u_buffer_scale:1,u_fade_t:i.mix,u_opacity:i.opacity*n.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:n.paint.get("raster-brightness-min"),u_brightness_high:n.paint.get("raster-brightness-max"),u_saturation_factor:PC(n.paint.get("raster-saturation")),u_contrast_factor:SC(n.paint.get("raster-contrast")),u_spin_weights:wC(n.paint.get("raster-hue-rotate"))}),"rasterUniformValues");function wC(r){r*=Math.PI/180;let e=Math.sin(r),t=Math.cos(r);return[(2*t+1)/3,(-Math.sqrt(3)*e-t+1)/3,(Math.sqrt(3)*e-t+1)/3]}u(wC,"spinWeights");function SC(r){return r>0?1/(1-r):1+r}u(SC,"contrastFactor");function PC(r){return r>0?1-1/(1.001-r):-r}u(PC,"saturationFactor");d();var a1=u((r,e)=>({u_is_size_zoom_constant:new Y(r,e.u_is_size_zoom_constant),u_is_size_feature_constant:new Y(r,e.u_is_size_feature_constant),u_size_t:new U(r,e.u_size_t),u_size:new U(r,e.u_size),u_camera_to_center_distance:new U(r,e.u_camera_to_center_distance),u_pitch:new U(r,e.u_pitch),u_rotate_symbol:new Y(r,e.u_rotate_symbol),u_aspect_ratio:new U(r,e.u_aspect_ratio),u_fade_change:new U(r,e.u_fade_change),u_matrix:new te(r,e.u_matrix),u_label_plane_matrix:new te(r,e.u_label_plane_matrix),u_coord_matrix:new te(r,e.u_coord_matrix),u_is_text:new Y(r,e.u_is_text),u_pitch_with_map:new Y(r,e.u_pitch_with_map),u_texsize:new ee(r,e.u_texsize),u_texture:new Y(r,e.u_texture)}),"symbolIconUniforms"),o1=u((r,e)=>({u_is_size_zoom_constant:new Y(r,e.u_is_size_zoom_constant),u_is_size_feature_constant:new Y(r,e.u_is_size_feature_constant),u_size_t:new U(r,e.u_size_t),u_size:new U(r,e.u_size),u_camera_to_center_distance:new U(r,e.u_camera_to_center_distance),u_pitch:new U(r,e.u_pitch),u_rotate_symbol:new Y(r,e.u_rotate_symbol),u_aspect_ratio:new U(r,e.u_aspect_ratio),u_fade_change:new U(r,e.u_fade_change),u_matrix:new te(r,e.u_matrix),u_label_plane_matrix:new te(r,e.u_label_plane_matrix),u_coord_matrix:new te(r,e.u_coord_matrix),u_is_text:new Y(r,e.u_is_text),u_pitch_with_map:new Y(r,e.u_pitch_with_map),u_texsize:new ee(r,e.u_texsize),u_texture:new Y(r,e.u_texture),u_gamma_scale:new U(r,e.u_gamma_scale),u_device_pixel_ratio:new U(r,e.u_device_pixel_ratio),u_is_halo:new Y(r,e.u_is_halo)}),"symbolSDFUniforms"),s1=u((r,e)=>({u_is_size_zoom_constant:new Y(r,e.u_is_size_zoom_constant),u_is_size_feature_constant:new Y(r,e.u_is_size_feature_constant),u_size_t:new U(r,e.u_size_t),u_size:new U(r,e.u_size),u_camera_to_center_distance:new U(r,e.u_camera_to_center_distance),u_pitch:new U(r,e.u_pitch),u_rotate_symbol:new Y(r,e.u_rotate_symbol),u_aspect_ratio:new U(r,e.u_aspect_ratio),u_fade_change:new U(r,e.u_fade_change),u_matrix:new te(r,e.u_matrix),u_label_plane_matrix:new te(r,e.u_label_plane_matrix),u_coord_matrix:new te(r,e.u_coord_matrix),u_is_text:new Y(r,e.u_is_text),u_pitch_with_map:new Y(r,e.u_pitch_with_map),u_texsize:new ee(r,e.u_texsize),u_texsize_icon:new ee(r,e.u_texsize_icon),u_texture:new Y(r,e.u_texture),u_texture_icon:new Y(r,e.u_texture_icon),u_gamma_scale:new U(r,e.u_gamma_scale),u_device_pixel_ratio:new U(r,e.u_device_pixel_ratio),u_is_halo:new Y(r,e.u_is_halo)}),"symbolTextAndIconUniforms"),ud=u((r,e,t,i,n,a,o,s,l,c)=>{let p=n.transform;return{u_is_size_zoom_constant:+(r==="constant"||r==="source"),u_is_size_feature_constant:+(r==="constant"||r==="camera"),u_size_t:e?e.uSizeT:0,u_size:e?e.uSize:0,u_camera_to_center_distance:p.cameraToCenterDistance,u_pitch:p.pitch/360*2*Math.PI,u_rotate_symbol:+t,u_aspect_ratio:p.width/p.height,u_fade_change:n.options.fadeDuration?n.symbolFadeChange:1,u_matrix:a,u_label_plane_matrix:o,u_coord_matrix:s,u_is_text:+l,u_pitch_with_map:+i,u_texsize:c,u_texture:0}},"symbolIconUniformValues"),cd=u((r,e,t,i,n,a,o,s,l,c,p)=>{let h=n.transform;return R(ud(r,e,t,i,n,a,o,s,l,c),{u_gamma_scale:i?Math.cos(h._pitch)*h.cameraToCenterDistance:1,u_device_pixel_ratio:n.pixelRatio,u_is_halo:+p})},"symbolSDFUniformValues"),l1=u((r,e,t,i,n,a,o,s,l,c)=>R(cd(r,e,t,i,n,a,o,s,!0,l,!0),{u_texsize_icon:c,u_texture_icon:1}),"symbolTextAndIconUniformValues");d();var u1=u((r,e)=>({u_matrix:new te(r,e.u_matrix),u_opacity:new U(r,e.u_opacity),u_color:new Dt(r,e.u_color)}),"backgroundUniforms"),c1=u((r,e)=>({u_matrix:new te(r,e.u_matrix),u_opacity:new U(r,e.u_opacity),u_image:new Y(r,e.u_image),u_pattern_tl_a:new ee(r,e.u_pattern_tl_a),u_pattern_br_a:new ee(r,e.u_pattern_br_a),u_pattern_tl_b:new ee(r,e.u_pattern_tl_b),u_pattern_br_b:new ee(r,e.u_pattern_br_b),u_texsize:new ee(r,e.u_texsize),u_mix:new U(r,e.u_mix),u_pattern_size_a:new ee(r,e.u_pattern_size_a),u_pattern_size_b:new ee(r,e.u_pattern_size_b),u_scale_a:new U(r,e.u_scale_a),u_scale_b:new U(r,e.u_scale_b),u_pixel_coord_upper:new ee(r,e.u_pixel_coord_upper),u_pixel_coord_lower:new ee(r,e.u_pixel_coord_lower),u_tile_units_to_pixels:new U(r,e.u_tile_units_to_pixels)}),"backgroundPatternUniforms"),p1=u((r,e,t)=>({u_matrix:r,u_opacity:e,u_color:t}),"backgroundUniformValues"),h1=u((r,e,t,i,n,a)=>R(w0(i,a,t,n),{u_matrix:r,u_opacity:e}),"backgroundPatternUniformValues");var f1={fillExtrusion:S0,fillExtrusionPattern:P0,fill:A0,fillPattern:I0,fillOutline:M0,fillOutlinePattern:C0,circle:L0,collisionBox:z0,collisionCircle:F0,debug:O0,clippingMask:V0,heatmap:U0,heatmapTexture:N0,hillshade:j0,hillshadePrepare:$0,line:W0,lineGradient:X0,linePattern:K0,lineSDF:Y0,raster:i1,symbolIcon:a1,symbolSDF:o1,symbolTextAndIcon:s1,background:u1,backgroundPattern:c1,terrain:y0,terrainDepth:g0,terrainCoords:x0};d();d();var pd=class pd{constructor(e,t,i){this.context=e;let n=e.gl;this.buffer=n.createBuffer(),this.dynamicDraw=!!i,this.context.unbindVAO(),e.bindElementBuffer.set(this.buffer),n.bufferData(n.ELEMENT_ARRAY_BUFFER,t.arrayBuffer,this.dynamicDraw?n.DYNAMIC_DRAW:n.STATIC_DRAW),this.dynamicDraw||delete t.arrayBuffer}bind(){this.context.bindElementBuffer.set(this.buffer)}updateData(e){let t=this.context.gl;if(!this.dynamicDraw)throw new Error("Attempted to update data while not in dynamic mode.");this.context.unbindVAO(),this.bind(),t.bufferSubData(t.ELEMENT_ARRAY_BUFFER,0,e.arrayBuffer)}destroy(){let e=this.context.gl;this.buffer&&(e.deleteBuffer(this.buffer),delete this.buffer)}};u(pd,"IndexBuffer");var $l=pd;d();var TC={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"},hd=class hd{constructor(e,t,i,n){this.length=t.length,this.attributes=i,this.itemSize=t.bytesPerElement,this.dynamicDraw=n,this.context=e;let a=e.gl;this.buffer=a.createBuffer(),e.bindVertexBuffer.set(this.buffer),a.bufferData(a.ARRAY_BUFFER,t.arrayBuffer,this.dynamicDraw?a.DYNAMIC_DRAW:a.STATIC_DRAW),this.dynamicDraw||delete t.arrayBuffer}bind(){this.context.bindVertexBuffer.set(this.buffer)}updateData(e){if(e.length!==this.length)throw new Error("Length of new data is ".concat(e.length,", which doesn't match current length of ").concat(this.length));let t=this.context.gl;this.bind(),t.bufferSubData(t.ARRAY_BUFFER,0,e.arrayBuffer)}enableAttributes(e,t){for(let i=0;i<this.attributes.length;i++){let n=this.attributes[i],a=t.attributes[n.name];a!==void 0&&e.enableVertexAttribArray(a)}}setVertexAttribPointers(e,t,i){for(let n=0;n<this.attributes.length;n++){let a=this.attributes[n],o=t.attributes[a.name];o!==void 0&&e.vertexAttribPointer(o,a.components,e[TC[a.type]],!1,this.itemSize,a.offset+this.itemSize*(i||0))}}destroy(){let e=this.context.gl;this.buffer&&(e.deleteBuffer(this.buffer),delete this.buffer)}};u(hd,"VertexBuffer");var Hl=hd;d();d();d();var fd=new WeakMap;function bn(r){if(fd.has(r))return fd.get(r);{let e=r.getParameter(r.VERSION).startsWith("WebGL 2.0");return fd.set(r,e),e}}u(bn,"isWebGL2");var md=class md{constructor(e){this.gl=e.gl,this.default=this.getDefault(),this.current=this.default,this.dirty=!1}get(){return this.current}set(e){}getDefault(){return this.default}setDefault(){this.set(this.default)}};u(md,"BaseValue");var xe=md,dd=class dd extends xe{getDefault(){return K.transparent}set(e){let t=this.current;e.r===t.r&&e.g===t.g&&e.b===t.b&&e.a===t.a&&!this.dirty||(this.gl.clearColor(e.r,e.g,e.b,e.a),this.current=e,this.dirty=!1)}};u(dd,"ClearColor");var Zl=dd,yd=class yd extends xe{getDefault(){return 1}set(e){e===this.current&&!this.dirty||(this.gl.clearDepth(e),this.current=e,this.dirty=!1)}};u(yd,"ClearDepth");var Wl=yd,gd=class gd extends xe{getDefault(){return 0}set(e){e===this.current&&!this.dirty||(this.gl.clearStencil(e),this.current=e,this.dirty=!1)}};u(gd,"ClearStencil");var Xl=gd,xd=class xd extends xe{getDefault(){return[!0,!0,!0,!0]}set(e){let t=this.current;e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&!this.dirty||(this.gl.colorMask(e[0],e[1],e[2],e[3]),this.current=e,this.dirty=!1)}};u(xd,"ColorMask");var Kl=xd,bd=class bd extends xe{getDefault(){return!0}set(e){e===this.current&&!this.dirty||(this.gl.depthMask(e),this.current=e,this.dirty=!1)}};u(bd,"DepthMask");var Yl=bd,_d=class _d extends xe{getDefault(){return 255}set(e){e===this.current&&!this.dirty||(this.gl.stencilMask(e),this.current=e,this.dirty=!1)}};u(_d,"StencilMask");var Jl=_d,vd=class vd extends xe{getDefault(){return{func:this.gl.ALWAYS,ref:0,mask:255}}set(e){let t=this.current;e.func===t.func&&e.ref===t.ref&&e.mask===t.mask&&!this.dirty||(this.gl.stencilFunc(e.func,e.ref,e.mask),this.current=e,this.dirty=!1)}};u(vd,"StencilFunc");var Ql=vd,wd=class wd extends xe{getDefault(){let e=this.gl;return[e.KEEP,e.KEEP,e.KEEP]}set(e){let t=this.current;e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&!this.dirty||(this.gl.stencilOp(e[0],e[1],e[2]),this.current=e,this.dirty=!1)}};u(wd,"StencilOp");var eu=wd,Sd=class Sd extends xe{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;let t=this.gl;e?t.enable(t.STENCIL_TEST):t.disable(t.STENCIL_TEST),this.current=e,this.dirty=!1}};u(Sd,"StencilTest");var tu=Sd,Pd=class Pd extends xe{getDefault(){return[0,1]}set(e){let t=this.current;e[0]===t[0]&&e[1]===t[1]&&!this.dirty||(this.gl.depthRange(e[0],e[1]),this.current=e,this.dirty=!1)}};u(Pd,"DepthRange");var ru=Pd,Td=class Td extends xe{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;let t=this.gl;e?t.enable(t.DEPTH_TEST):t.disable(t.DEPTH_TEST),this.current=e,this.dirty=!1}};u(Td,"DepthTest");var iu=Td,Ad=class Ad extends xe{getDefault(){return this.gl.LESS}set(e){e===this.current&&!this.dirty||(this.gl.depthFunc(e),this.current=e,this.dirty=!1)}};u(Ad,"DepthFunc");var nu=Ad,Id=class Id extends xe{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;let t=this.gl;e?t.enable(t.BLEND):t.disable(t.BLEND),this.current=e,this.dirty=!1}};u(Id,"Blend");var au=Id,Md=class Md extends xe{getDefault(){let e=this.gl;return[e.ONE,e.ZERO]}set(e){let t=this.current;e[0]===t[0]&&e[1]===t[1]&&!this.dirty||(this.gl.blendFunc(e[0],e[1]),this.current=e,this.dirty=!1)}};u(Md,"BlendFunc");var ou=Md,Cd=class Cd extends xe{getDefault(){return K.transparent}set(e){let t=this.current;e.r===t.r&&e.g===t.g&&e.b===t.b&&e.a===t.a&&!this.dirty||(this.gl.blendColor(e.r,e.g,e.b,e.a),this.current=e,this.dirty=!1)}};u(Cd,"BlendColor");var su=Cd,Ed=class Ed extends xe{getDefault(){return this.gl.FUNC_ADD}set(e){e===this.current&&!this.dirty||(this.gl.blendEquation(e),this.current=e,this.dirty=!1)}};u(Ed,"BlendEquation");var lu=Ed,kd=class kd extends xe{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;let t=this.gl;e?t.enable(t.CULL_FACE):t.disable(t.CULL_FACE),this.current=e,this.dirty=!1}};u(kd,"CullFace");var uu=kd,Ld=class Ld extends xe{getDefault(){return this.gl.BACK}set(e){e===this.current&&!this.dirty||(this.gl.cullFace(e),this.current=e,this.dirty=!1)}};u(Ld,"CullFaceSide");var cu=Ld,Dd=class Dd extends xe{getDefault(){return this.gl.CCW}set(e){e===this.current&&!this.dirty||(this.gl.frontFace(e),this.current=e,this.dirty=!1)}};u(Dd,"FrontFace");var pu=Dd,zd=class zd extends xe{getDefault(){return null}set(e){e===this.current&&!this.dirty||(this.gl.useProgram(e),this.current=e,this.dirty=!1)}};u(zd,"ProgramValue");var hu=zd,Fd=class Fd extends xe{getDefault(){return this.gl.TEXTURE0}set(e){e===this.current&&!this.dirty||(this.gl.activeTexture(e),this.current=e,this.dirty=!1)}};u(Fd,"ActiveTextureUnit");var fu=Fd,Bd=class Bd extends xe{getDefault(){let e=this.gl;return[0,0,e.drawingBufferWidth,e.drawingBufferHeight]}set(e){let t=this.current;e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&!this.dirty||(this.gl.viewport(e[0],e[1],e[2],e[3]),this.current=e,this.dirty=!1)}};u(Bd,"Viewport");var mu=Bd,Rd=class Rd extends xe{getDefault(){return null}set(e){if(e===this.current&&!this.dirty)return;let t=this.gl;t.bindFramebuffer(t.FRAMEBUFFER,e),this.current=e,this.dirty=!1}};u(Rd,"BindFramebuffer");var du=Rd,Od=class Od extends xe{getDefault(){return null}set(e){if(e===this.current&&!this.dirty)return;let t=this.gl;t.bindRenderbuffer(t.RENDERBUFFER,e),this.current=e,this.dirty=!1}};u(Od,"BindRenderbuffer");var yu=Od,Vd=class Vd extends xe{getDefault(){return null}set(e){if(e===this.current&&!this.dirty)return;let t=this.gl;t.bindTexture(t.TEXTURE_2D,e),this.current=e,this.dirty=!1}};u(Vd,"BindTexture");var gu=Vd,Ud=class Ud extends xe{getDefault(){return null}set(e){if(e===this.current&&!this.dirty)return;let t=this.gl;t.bindBuffer(t.ARRAY_BUFFER,e),this.current=e,this.dirty=!1}};u(Ud,"BindVertexBuffer");var xu=Ud,Nd=class Nd extends xe{getDefault(){return null}set(e){let t=this.gl;t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,e),this.current=e,this.dirty=!1}};u(Nd,"BindElementBuffer");var bu=Nd,Gd=class Gd extends xe{getDefault(){return null}set(e){var i;if(e===this.current&&!this.dirty)return;let t=this.gl;bn(t)?t.bindVertexArray(e):(i=t.getExtension("OES_vertex_array_object"))==null||i.bindVertexArrayOES(e),this.current=e,this.dirty=!1}};u(Gd,"BindVertexArray");var _u=Gd,qd=class qd extends xe{getDefault(){return 4}set(e){if(e===this.current&&!this.dirty)return;let t=this.gl;t.pixelStorei(t.UNPACK_ALIGNMENT,e),this.current=e,this.dirty=!1}};u(qd,"PixelStoreUnpack");var vu=qd,jd=class jd extends xe{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;let t=this.gl;t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e),this.current=e,this.dirty=!1}};u(jd,"PixelStoreUnpackPremultiplyAlpha");var wu=jd,$d=class $d extends xe{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;let t=this.gl;t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,e),this.current=e,this.dirty=!1}};u($d,"PixelStoreUnpackFlipY");var Su=$d,Hd=class Hd extends xe{constructor(t,i){super(t);this.context=t,this.parent=i}getDefault(){return null}};u(Hd,"FramebufferAttachment");var ro=Hd,Zd=class Zd extends ro{setDirty(){this.dirty=!0}set(e){if(e===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);let t=this.gl;t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,e,0),this.current=e,this.dirty=!1}};u(Zd,"ColorAttachment");var Pu=Zd,Wd=class Wd extends ro{set(e){if(e===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);let t=this.gl;t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_ATTACHMENT,t.RENDERBUFFER,e),this.current=e,this.dirty=!1}};u(Wd,"DepthAttachment");var Tu=Wd,Xd=class Xd extends ro{set(e){if(e===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);let t=this.gl;t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_STENCIL_ATTACHMENT,t.RENDERBUFFER,e),this.current=e,this.dirty=!1}};u(Xd,"DepthStencilAttachment");var Au=Xd;var Kd=class Kd{constructor(e,t,i,n,a){this.context=e,this.width=t,this.height=i;let o=e.gl,s=this.framebuffer=o.createFramebuffer();if(this.colorAttachment=new Pu(e,s),n)this.depthAttachment=a?new Au(e,s):new Tu(e,s);else if(a)throw new Error("Stencil cannot be setted without depth");if(o.checkFramebufferStatus(o.FRAMEBUFFER)!==o.FRAMEBUFFER_COMPLETE)throw new Error("Framebuffer is not complete")}destroy(){let e=this.context.gl,t=this.colorAttachment.get();if(t&&e.deleteTexture(t),this.depthAttachment){let i=this.depthAttachment.get();i&&e.deleteRenderbuffer(i)}e.deleteFramebuffer(this.framebuffer)}};u(Kd,"Framebuffer");var Iu=Kd;d();var AC=0,m1=1,IC=771,Yd=class Yd{constructor(e,t,i){this.blendFunction=e,this.blendColor=t,this.mask=i}};u(Yd,"ColorMode");var De=Yd;De.Replace=[m1,AC];De.disabled=new De(De.Replace,K.transparent,[!1,!1,!1,!1]);De.unblended=new De(De.Replace,K.transparent,[!0,!0,!0,!0]);De.alphaBlended=new De([m1,IC],K.transparent,[!0,!0,!0,!0]);var Jd=class Jd{constructor(e){var t,i;if(this.gl=e,this.clearColor=new Zl(this),this.clearDepth=new Wl(this),this.clearStencil=new Xl(this),this.colorMask=new Kl(this),this.depthMask=new Yl(this),this.stencilMask=new Jl(this),this.stencilFunc=new Ql(this),this.stencilOp=new eu(this),this.stencilTest=new tu(this),this.depthRange=new ru(this),this.depthTest=new iu(this),this.depthFunc=new nu(this),this.blend=new au(this),this.blendFunc=new ou(this),this.blendColor=new su(this),this.blendEquation=new lu(this),this.cullFace=new uu(this),this.cullFaceSide=new cu(this),this.frontFace=new pu(this),this.program=new hu(this),this.activeTexture=new fu(this),this.viewport=new mu(this),this.bindFramebuffer=new du(this),this.bindRenderbuffer=new yu(this),this.bindTexture=new gu(this),this.bindVertexBuffer=new xu(this),this.bindElementBuffer=new bu(this),this.bindVertexArray=new _u(this),this.pixelStoreUnpack=new vu(this),this.pixelStoreUnpackPremultiplyAlpha=new wu(this),this.pixelStoreUnpackFlipY=new Su(this),this.extTextureFilterAnisotropic=e.getExtension("EXT_texture_filter_anisotropic")||e.getExtension("MOZ_EXT_texture_filter_anisotropic")||e.getExtension("WEBKIT_EXT_texture_filter_anisotropic"),this.extTextureFilterAnisotropic&&(this.extTextureFilterAnisotropicMax=e.getParameter(this.extTextureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT)),this.maxTextureSize=e.getParameter(e.MAX_TEXTURE_SIZE),bn(e)){this.HALF_FLOAT=e.HALF_FLOAT;let n=e.getExtension("EXT_color_buffer_half_float");this.RGBA16F=(t=e.RGBA16F)!=null?t:n==null?void 0:n.RGBA16F_EXT,this.RGB16F=(i=e.RGB16F)!=null?i:n==null?void 0:n.RGB16F_EXT,e.getExtension("EXT_color_buffer_float")}else{e.getExtension("EXT_color_buffer_half_float"),e.getExtension("OES_texture_half_float_linear");let n=e.getExtension("OES_texture_half_float");this.HALF_FLOAT=n==null?void 0:n.HALF_FLOAT_OES}}setDefault(){this.unbindVAO(),this.clearColor.setDefault(),this.clearDepth.setDefault(),this.clearStencil.setDefault(),this.colorMask.setDefault(),this.depthMask.setDefault(),this.stencilMask.setDefault(),this.stencilFunc.setDefault(),this.stencilOp.setDefault(),this.stencilTest.setDefault(),this.depthRange.setDefault(),this.depthTest.setDefault(),this.depthFunc.setDefault(),this.blend.setDefault(),this.blendFunc.setDefault(),this.blendColor.setDefault(),this.blendEquation.setDefault(),this.cullFace.setDefault(),this.cullFaceSide.setDefault(),this.frontFace.setDefault(),this.program.setDefault(),this.activeTexture.setDefault(),this.bindFramebuffer.setDefault(),this.pixelStoreUnpack.setDefault(),this.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.pixelStoreUnpackFlipY.setDefault()}setDirty(){this.clearColor.dirty=!0,this.clearDepth.dirty=!0,this.clearStencil.dirty=!0,this.colorMask.dirty=!0,this.depthMask.dirty=!0,this.stencilMask.dirty=!0,this.stencilFunc.dirty=!0,this.stencilOp.dirty=!0,this.stencilTest.dirty=!0,this.depthRange.dirty=!0,this.depthTest.dirty=!0,this.depthFunc.dirty=!0,this.blend.dirty=!0,this.blendFunc.dirty=!0,this.blendColor.dirty=!0,this.blendEquation.dirty=!0,this.cullFace.dirty=!0,this.cullFaceSide.dirty=!0,this.frontFace.dirty=!0,this.program.dirty=!0,this.activeTexture.dirty=!0,this.viewport.dirty=!0,this.bindFramebuffer.dirty=!0,this.bindRenderbuffer.dirty=!0,this.bindTexture.dirty=!0,this.bindVertexBuffer.dirty=!0,this.bindElementBuffer.dirty=!0,this.bindVertexArray.dirty=!0,this.pixelStoreUnpack.dirty=!0,this.pixelStoreUnpackPremultiplyAlpha.dirty=!0,this.pixelStoreUnpackFlipY.dirty=!0}createIndexBuffer(e,t){return new $l(this,e,t)}createVertexBuffer(e,t,i){return new Hl(this,e,t,i)}createRenderbuffer(e,t,i){let n=this.gl,a=n.createRenderbuffer();return this.bindRenderbuffer.set(a),n.renderbufferStorage(n.RENDERBUFFER,e,t,i),this.bindRenderbuffer.set(null),a}createFramebuffer(e,t,i,n){return new Iu(this,e,t,i,n)}clear({color:e,depth:t,stencil:i}){let n=this.gl,a=0;e&&(a|=n.COLOR_BUFFER_BIT,this.clearColor.set(e),this.colorMask.set([!0,!0,!0,!0])),typeof t<"u"&&(a|=n.DEPTH_BUFFER_BIT,this.depthRange.set([0,1]),this.clearDepth.set(t),this.depthMask.set(!0)),typeof i<"u"&&(a|=n.STENCIL_BUFFER_BIT,this.clearStencil.set(i),this.stencilMask.set(255)),n.clear(a)}setCullFace(e){e.enable===!1?this.cullFace.set(!1):(this.cullFace.set(!0),this.cullFaceSide.set(e.mode),this.frontFace.set(e.frontFace))}setDepthMode(e){e.func===this.gl.ALWAYS&&!e.mask?this.depthTest.set(!1):(this.depthTest.set(!0),this.depthFunc.set(e.func),this.depthMask.set(e.mask),this.depthRange.set(e.range))}setStencilMode(e){e.test.func===this.gl.ALWAYS&&!e.mask?this.stencilTest.set(!1):(this.stencilTest.set(!0),this.stencilMask.set(e.mask),this.stencilOp.set([e.fail,e.depthFail,e.pass]),this.stencilFunc.set({func:e.test.func,ref:e.ref,mask:e.test.mask}))}setColorMode(e){Kt(e.blendFunction,De.Replace)?this.blend.set(!1):(this.blend.set(!0),this.blendFunc.set(e.blendFunction),this.blendColor.set(e.blendColor)),this.colorMask.set(e.mask)}createVertexArray(){var e;return bn(this.gl)?this.gl.createVertexArray():(e=this.gl.getExtension("OES_vertex_array_object"))==null?void 0:e.createVertexArrayOES()}deleteVertexArray(e){var t;return bn(this.gl)?this.gl.deleteVertexArray(e):(t=this.gl.getExtension("OES_vertex_array_object"))==null?void 0:t.deleteVertexArrayOES(e)}unbindVAO(){this.bindVertexArray.set(null)}};u(Jd,"Context");var Mu=Jd;d();var Qd=class Qd{constructor(e,t,i){this.func=e,this.mask=t,this.range=i}};u(Qd,"DepthMode");var Q=Qd;Q.ReadOnly=!1;Q.ReadWrite=!0;Q.disabled=new Q(519,Q.ReadOnly,[0,1]);d();var ey=class ey{constructor(e,t,i,n,a,o){this.test=e,this.ref=t,this.mask=i,this.fail=n,this.depthFail=a,this.pass=o}};u(ey,"StencilMode");var he=ey;he.disabled=new he({func:519,mask:0},0,0,7680,7680,7680);d();var ty=class ty{constructor(e,t,i){this.enable=e,this.mode=t,this.frontFace=i}};u(ty,"CullFaceMode");var le=ty;le.disabled=new le(!1,1029,2305);le.backCCW=new le(!0,1029,2305);d();var iy=ae(Pe(),1);d();var Cu;function ry(r,e,t,i,n,a,o){let s=r.context,l=s.gl,c=r.useProgram("collisionBox"),p=[],h=0,f=0;for(let _=0;_<i.length;_++){let v=i[_],S=e.getTile(v),P=S.getBucket(t);if(!P)continue;let T=v.posMatrix;(n[0]!==0||n[1]!==0)&&(T=r.translatePosMatrix(v.posMatrix,S,n,a));let A=o?P.textCollisionBox:P.iconCollisionBox,L=P.collisionCircleArray;if(L.length>0){let C=q.create(),I=T;q.mul(C,P.placementInvProjMatrix,r.transform.glCoordMatrix),q.mul(C,C,P.placementViewportMatrix),p.push({circleArray:L,circleOffset:f,transform:I,invTransform:C,coord:v}),h+=L.length/4,f=h}A&&c.draw(s,l.LINES,Q.disabled,he.disabled,r.colorModeForRenderPass(),le.disabled,B0(T,r.transform,S),r.style.map.terrain&&r.style.map.terrain.getTerrainData(v),t.id,A.layoutVertexBuffer,A.indexBuffer,A.segments,null,r.transform.zoom,null,null,A.collisionVertexBuffer)}if(!o||!p.length)return;let m=r.useProgram("collisionCircle"),g=new Is;g.resize(h*4),g._trim();let y=0;for(let _ of p)for(let v=0;v<_.circleArray.length/4;v++){let S=v*4,P=_.circleArray[S+0],T=_.circleArray[S+1],A=_.circleArray[S+2],L=_.circleArray[S+3];g.emplace(y++,P,T,A,L,0),g.emplace(y++,P,T,A,L,1),g.emplace(y++,P,T,A,L,2),g.emplace(y++,P,T,A,L,3)}(!Cu||Cu.length<h*2)&&(Cu=MC(h));let x=s.createIndexBuffer(Cu,!0),b=s.createVertexBuffer(g,r_.members,!0);for(let _ of p){let v=R0(_.transform,_.invTransform,r.transform);m.draw(s,l.TRIANGLES,Q.disabled,he.disabled,r.colorModeForRenderPass(),le.disabled,v,r.style.map.terrain&&r.style.map.terrain.getTerrainData(_.coord),t.id,b,x,me.simpleSegment(0,_.circleOffset*2,_.circleArray.length,_.circleArray.length/2),null,r.transform.zoom,null,null,null)}b.destroy(),x.destroy()}u(ry,"drawCollisionDebug");function MC(r){let e=r*2,t=new Cs;t.resize(e),t._trim();for(let i=0;i<e;i++){let n=i*6;t.uint16[n+0]=i*4+0,t.uint16[n+1]=i*4+1,t.uint16[n+2]=i*4+2,t.uint16[n+3]=i*4+2,t.uint16[n+4]=i*4+3,t.uint16[n+5]=i*4+0}return t}u(MC,"createQuadTriangles");var CC=q.identity(new Float32Array(16));function g1(r,e,t,i,n){if(r.renderPass!=="translucent")return;let a=he.disabled,o=r.colorModeForRenderPass();t.layout.get("text-variable-anchor")&&kC(i,r,t,e,t.layout.get("text-rotation-alignment"),t.layout.get("text-pitch-alignment"),n),t.paint.get("icon-opacity").constantOr(1)!==0&&d1(r,e,t,i,!1,t.paint.get("icon-translate"),t.paint.get("icon-translate-anchor"),t.layout.get("icon-rotation-alignment"),t.layout.get("icon-pitch-alignment"),t.layout.get("icon-keep-upright"),a,o),t.paint.get("text-opacity").constantOr(1)!==0&&d1(r,e,t,i,!0,t.paint.get("text-translate"),t.paint.get("text-translate-anchor"),t.layout.get("text-rotation-alignment"),t.layout.get("text-pitch-alignment"),t.layout.get("text-keep-upright"),a,o),e.map.showCollisionBoxes&&(ry(r,e,t,i,t.paint.get("text-translate"),t.paint.get("text-translate-anchor"),!0),ry(r,e,t,i,t.paint.get("icon-translate"),t.paint.get("icon-translate-anchor"),!1))}u(g1,"drawSymbols");function EC(r,e,t,i,n,a){let{horizontalAlign:o,verticalAlign:s}=Js(r),l=-(o-.5)*e,c=-(s-.5)*t,p=Cl(r,i);return new iy.default((l/n+p[0])*a,(c/n+p[1])*a)}u(EC,"calculateVariableRenderShift");function kC(r,e,t,i,n,a,o){let s=e.transform,l=n==="map",c=a==="map";for(let p of r){let h=i.getTile(p),f=h.getBucket(t);if(!f||!f.text||!f.text.segments.get().length)continue;let m=f.textSizeData,g=ci(m,s.zoom),y=Ke(h,1,e.transform.zoom),x=Wa(p.posMatrix,c,l,e.transform,y),b=t.layout.get("icon-text-fit")!=="none"&&f.hasIconData();if(g){let _=Math.pow(2,s.zoom-h.tileID.overscaledZ),v=e.style.map.terrain?(S,P)=>e.style.map.terrain.getElevation(p,S,P):null;LC(f,l,c,o,s,x,p.posMatrix,_,g,b,v)}}}u(kC,"updateVariableAnchors");function LC(r,e,t,i,n,a,o,s,l,c,p){let h=r.text.placedSymbolArray,f=r.text.dynamicLayoutVertexArray,m=r.icon.dynamicLayoutVertexArray,g={};f.clear();for(let y=0;y<h.length;y++){let x=h.get(y),b=r.allowVerticalPlacement&&!x.placedOrientation,_=!x.hidden&&x.crossTileID&&!b?i[x.crossTileID]:null;if(!_)yi(x.numGlyphs,f);else{let v=new iy.default(x.anchorX,x.anchorY),S=bt(v,t?o:a,p),P=Xa(n.cameraToCenterDistance,S.signedDistanceFromCamera),T=rn(r.textSizeData,l,x)*P/li;t&&(T*=r.tilePixelRatio/s);let{width:A,height:L,anchor:C,textOffset:I,textBoxScale:D}=_,F=EC(C,A,L,I,D,T),k=t?bt(v.add(F),a,p).point:S.point.add(e?F.rotate(-n.angle):F),E=r.allowVerticalPlacement&&x.placedOrientation===2?Math.PI/2:0;for(let O=0;O<x.numGlyphs;O++)pi(f,k,E);c&&x.associatedIconIndex>=0&&(g[x.associatedIconIndex]={shiftedAnchor:k,angle:E})}}if(c){m.clear();let y=r.icon.placedSymbolArray;for(let x=0;x<y.length;x++){let b=y.get(x);if(b.hidden)yi(b.numGlyphs,m);else{let _=g[x];if(!_)yi(b.numGlyphs,m);else for(let v=0;v<b.numGlyphs;v++)pi(m,_.shiftedAnchor,_.angle)}}r.icon.dynamicLayoutVertexBuffer.updateData(m)}r.text.dynamicLayoutVertexBuffer.updateData(f)}u(LC,"updateVariableAnchorsForBucket");function DC(r,e,t){return t.iconsInText&&e?"symbolTextAndIcon":r?"symbolSDF":"symbolIcon"}u(DC,"getSymbolProgramName");function d1(r,e,t,i,n,a,o,s,l,c,p,h){let f=r.context,m=f.gl,g=r.transform,y=s==="map",x=l==="map",b=s!=="viewport"&&t.layout.get("symbol-placement")!=="point",_=y&&!x&&!b,v=!t.layout.get("symbol-sort-key").isConstant(),S=!1,P=r.depthModeForSublayer(0,Q.ReadOnly),T=t.layout.get("text-variable-anchor"),A=[];for(let L of i){let C=e.getTile(L),I=C.getBucket(t);if(!I)continue;let D=n?I.text:I.icon;if(!D||!D.segments.get().length||!D.hasVisibleVertices)continue;let F=D.programConfigurations.get(t.id),k=n||I.sdfIcons,E=n?I.textSizeData:I.iconSizeData,O=x||g.pitch!==0,X=r.useProgram(DC(k,n,I),F),H=ci(E,g.zoom),fe=r.style.map.terrain&&r.style.map.terrain.getTerrainData(L),J,Qe=[0,0],Je,ue,Me=null,et;if(n){if(Je=C.glyphAtlasTexture,ue=m.LINEAR,J=C.glyphAtlasTexture.size,I.iconsInText){Qe=C.imageAtlasTexture.size,Me=C.imageAtlasTexture;let Mt=E.kind==="composite"||E.kind==="camera";et=O||r.options.rotating||r.options.zooming||Mt?m.LINEAR:m.NEAREST}}else{let Mt=t.layout.get("icon-size").constantOr(0)!==1||I.iconsNeedLinear;Je=C.imageAtlasTexture,ue=k||r.options.rotating||r.options.zooming||Mt||O?m.LINEAR:m.NEAREST,J=C.imageAtlasTexture.size}let ur=Ke(C,1,r.transform.zoom),cr=Wa(L.posMatrix,x,y,r.transform,ur),zt=Tl(L.posMatrix,x,y,r.transform,ur),Xt=T&&I.hasTextData(),Nr=t.layout.get("icon-text-fit")!=="none"&&Xt&&I.hasIconData();if(b){let Mt=r.style.map.terrain?(Gr,dc)=>r.style.map.terrain.getElevation(L,Gr,dc):null,Fe=t.layout.get("text-rotation-alignment")==="map";av(I,L.posMatrix,r,n,cr,zt,x,c,Fe,Mt)}let tt=r.translatePosMatrix(L.posMatrix,C,a,o),He=b||n&&T||Nr?CC:cr,ge=r.translatePosMatrix(zt,C,a,o,!0),_t=k&&t.paint.get(n?"text-halo-width":"icon-halo-width").constantOr(1)!==0,It;k?I.iconsInText?It=l1(E.kind,H,_,x,r,tt,He,ge,J,Qe):It=cd(E.kind,H,_,x,r,tt,He,ge,n,J,!0):It=ud(E.kind,H,_,x,r,tt,He,ge,n,J);let pr={program:X,buffers:D,uniformValues:It,atlasTexture:Je,atlasTextureIcon:Me,atlasInterpolation:ue,atlasInterpolationIcon:et,isSDF:k,hasHalo:_t};if(v&&I.canOverlap){S=!0;let Mt=D.segments.get();for(let Fe of Mt)A.push({segments:new me([Fe]),sortKey:Fe.sortKey,state:pr,terrainData:fe})}else A.push({segments:D.segments,sortKey:0,state:pr,terrainData:fe})}S&&A.sort((L,C)=>L.sortKey-C.sortKey);for(let L of A){let C=L.state;if(f.activeTexture.set(m.TEXTURE0),C.atlasTexture.bind(C.atlasInterpolation,m.CLAMP_TO_EDGE),C.atlasTextureIcon&&(f.activeTexture.set(m.TEXTURE1),C.atlasTextureIcon&&C.atlasTextureIcon.bind(C.atlasInterpolationIcon,m.CLAMP_TO_EDGE)),C.isSDF){let I=C.uniformValues;C.hasHalo&&(I.u_is_halo=1,y1(C.buffers,L.segments,t,r,C.program,P,p,h,I,L.terrainData)),I.u_is_halo=0}y1(C.buffers,L.segments,t,r,C.program,P,p,h,C.uniformValues,L.terrainData)}}u(d1,"drawLayerSymbols");function y1(r,e,t,i,n,a,o,s,l,c){let p=i.context,h=p.gl;n.draw(p,h.TRIANGLES,a,o,s,le.disabled,l,c,t.id,r.layoutVertexBuffer,r.indexBuffer,e,t.paint,i.transform.zoom,r.programConfigurations.get(t.id),r.dynamicLayoutVertexBuffer,r.opacityVertexBuffer)}u(y1,"drawSymbolElements");d();function x1(r,e,t,i){if(r.renderPass!=="translucent")return;let n=t.paint.get("circle-opacity"),a=t.paint.get("circle-stroke-width"),o=t.paint.get("circle-stroke-opacity"),s=!t.layout.get("circle-sort-key").isConstant();if(n.constantOr(1)===0&&(a.constantOr(1)===0||o.constantOr(1)===0))return;let l=r.context,c=l.gl,p=r.depthModeForSublayer(0,Q.ReadOnly),h=he.disabled,f=r.colorModeForRenderPass(),m=[];for(let g=0;g<i.length;g++){let y=i[g],x=e.getTile(y),b=x.getBucket(t);if(!b)continue;let _=b.programConfigurations.get(t.id),v=r.useProgram("circle",_),S=b.layoutVertexBuffer,P=b.indexBuffer,T=r.style.map.terrain&&r.style.map.terrain.getTerrainData(y),A=D0(r,y,x,t),L={programConfiguration:_,program:v,layoutVertexBuffer:S,indexBuffer:P,uniformValues:A,terrainData:T};if(s){let C=b.segments.get();for(let I of C)m.push({segments:new me([I]),sortKey:I.sortKey,state:L})}else m.push({segments:b.segments,sortKey:0,state:L})}s&&m.sort((g,y)=>g.sortKey-y.sortKey);for(let g of m){let{programConfiguration:y,program:x,layoutVertexBuffer:b,indexBuffer:_,uniformValues:v,terrainData:S}=g.state,P=g.segments;x.draw(l,c.TRIANGLES,p,h,f,le.disabled,v,S,t.id,b,_,P,t.paint,r.transform.zoom,y)}}u(x1,"drawCircles");d();function b1(r,e,t,i){if(t.paint.get("heatmap-opacity")!==0)if(r.renderPass==="offscreen"){let n=r.context,a=n.gl,o=he.disabled,s=new De([a.ONE,a.ONE],K.transparent,[!0,!0,!0,!0]);zC(n,r,t),n.clear({color:K.transparent});for(let l=0;l<i.length;l++){let c=i[l];if(e.hasRenderableParent(c))continue;let p=e.getTile(c),h=p.getBucket(t);if(!h)continue;let f=h.programConfigurations.get(t.id),m=r.useProgram("heatmap",f),{zoom:g}=r.transform;m.draw(n,a.TRIANGLES,Q.disabled,o,s,le.disabled,G0(c.posMatrix,p,g,t.paint.get("heatmap-intensity")),null,t.id,h.layoutVertexBuffer,h.indexBuffer,h.segments,t.paint,r.transform.zoom,f)}n.viewport.set([0,0,r.width,r.height])}else r.renderPass==="translucent"&&(r.context.setColorMode(r.colorModeForRenderPass()),BC(r,t))}u(b1,"drawHeatmap");function zC(r,e,t){let i=r.gl;r.activeTexture.set(i.TEXTURE1),r.viewport.set([0,0,e.width/4,e.height/4]);let n=t.heatmapFbo;if(n)i.bindTexture(i.TEXTURE_2D,n.colorAttachment.get()),r.bindFramebuffer.set(n.framebuffer);else{let a=i.createTexture();i.bindTexture(i.TEXTURE_2D,a),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_S,i.CLAMP_TO_EDGE),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_T,i.CLAMP_TO_EDGE),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,i.LINEAR),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MAG_FILTER,i.LINEAR),n=t.heatmapFbo=r.createFramebuffer(e.width/4,e.height/4,!1,!1),FC(r,e,a,n)}}u(zC,"bindFramebuffer");function FC(r,e,t,i){var s,l;let n=r.gl,a=(s=r.HALF_FLOAT)!=null?s:n.UNSIGNED_BYTE,o=(l=r.RGBA16F)!=null?l:n.RGBA;n.texImage2D(n.TEXTURE_2D,0,o,e.width/4,e.height/4,0,n.RGBA,a,null),i.colorAttachment.set(t)}u(FC,"bindTextureToFramebuffer");function BC(r,e){let t=r.context,i=t.gl,n=e.heatmapFbo;if(!n)return;t.activeTexture.set(i.TEXTURE0),i.bindTexture(i.TEXTURE_2D,n.colorAttachment.get()),t.activeTexture.set(i.TEXTURE1);let a=e.colorRampTexture;a||(a=e.colorRampTexture=new be(t,e.colorRamp,i.RGBA)),a.bind(i.LINEAR,i.CLAMP_TO_EDGE),r.useProgram("heatmapTexture").draw(t,i.TRIANGLES,Q.disabled,he.disabled,r.colorModeForRenderPass(),le.disabled,q0(r,e,0,1),null,e.id,r.viewportBuffer,r.quadTriangleIndexBuffer,r.viewportSegments,e.paint,r.transform.zoom)}u(BC,"renderTextureToMap");d();function _1(r,e,t,i){if(r.renderPass!=="translucent")return;let n=t.paint.get("line-opacity"),a=t.paint.get("line-width");if(n.constantOr(1)===0||a.constantOr(1)===0)return;let o=r.depthModeForSublayer(0,Q.ReadOnly),s=r.colorModeForRenderPass(),l=t.paint.get("line-dasharray"),c=t.paint.get("line-pattern"),p=c.constantOr(1),h=t.paint.get("line-gradient"),f=t.getCrossfadeParameters(),m=p?"linePattern":l?"lineSDF":h?"lineGradient":"line",g=r.context,y=g.gl,x=!0;for(let b of i){let _=e.getTile(b);if(p&&!_.patternsLoaded())continue;let v=_.getBucket(t);if(!v)continue;let S=v.programConfigurations.get(t.id),P=r.context.program.get(),T=r.useProgram(m,S),A=x||T.program!==P,L=r.style.map.terrain&&r.style.map.terrain.getTerrainData(b),C=c.constantOr(null);if(C&&_.imageAtlas){let F=_.imageAtlas,k=F.patternPositions[C.to.toString()],E=F.patternPositions[C.from.toString()];k&&E&&S.setConstantPatternPositions(k,E)}let I=L?b:null,D=p?Q0(r,_,t,f,I):l?e1(r,_,t,l,f,I):h?J0(r,_,t,v.lineClipsArray.length,I):jl(r,_,t,I);if(p)g.activeTexture.set(y.TEXTURE0),_.imageAtlasTexture.bind(y.LINEAR,y.CLAMP_TO_EDGE),S.updatePaintBuffers(f);else if(l&&(A||r.lineAtlas.dirty))g.activeTexture.set(y.TEXTURE0),r.lineAtlas.bind(g);else if(h){let F=v.gradients[t.id],k=F.texture;if(t.gradientVersion!==F.version){let E=256;if(t.stepInterpolant){let O=e.getSource().maxzoom,X=b.canonical.z===O?Math.ceil(1<<r.transform.maxZoom-b.canonical.z):1,J=v.maxLineLength/8192*1024*X;E=Te(Xy(J),256,g.maxTextureSize)}F.gradient=Ns({expression:t.gradientExpression(),evaluationKey:"lineProgress",resolution:E,image:F.gradient||void 0,clips:v.lineClipsArray}),F.texture?F.texture.update(F.gradient):F.texture=new be(g,F.gradient,y.RGBA),F.version=t.gradientVersion,k=F.texture}g.activeTexture.set(y.TEXTURE0),k.bind(t.stepInterpolant?y.NEAREST:y.LINEAR,y.CLAMP_TO_EDGE)}T.draw(g,y.TRIANGLES,o,r.stencilModeForClipping(b),s,le.disabled,D,L,t.id,v.layoutVertexBuffer,v.indexBuffer,v.segments,t.paint,r.transform.zoom,S,v.layoutVertexBuffer2),x=!1}}u(_1,"drawLine");d();d();function Eu(r,e,t,i,n){if(!t||!i||!i.imageAtlas)return;let a=i.imageAtlas.patternPositions,o=a[t.to.toString()],s=a[t.from.toString()];if(!o||!s){let l=n.getPaintProperty(e);o=a[l],s=a[l]}o&&s&&r.setConstantPatternPositions(o,s)}u(Eu,"updatePatternPositionsInProgram");function w1(r,e,t,i){let n=t.paint.get("fill-color"),a=t.paint.get("fill-opacity");if(a.constantOr(1)===0)return;let o=r.colorModeForRenderPass(),s=t.paint.get("fill-pattern"),l=r.opaquePassEnabledForLayer()&&!s.constantOr(1)&&n.constantOr(K.transparent).a===1&&a.constantOr(0)===1?"opaque":"translucent";if(r.renderPass===l){let c=r.depthModeForSublayer(1,r.renderPass==="opaque"?Q.ReadWrite:Q.ReadOnly);v1(r,e,t,i,c,o,!1)}if(r.renderPass==="translucent"&&t.paint.get("fill-antialias")){let c=r.depthModeForSublayer(t.getPaintProperty("fill-outline-color")?2:0,Q.ReadOnly);v1(r,e,t,i,c,o,!0)}}u(w1,"drawFill");function v1(r,e,t,i,n,a,o){let s=r.context.gl,l="fill-pattern",c=t.paint.get(l),p=c&&c.constantOr(1),h=t.getCrossfadeParameters(),f,m,g,y,x;o?(m=p&&!t.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",f=s.LINES):(m=p?"fillPattern":"fill",f=s.TRIANGLES);let b=c.constantOr(null);for(let _ of i){let v=e.getTile(_);if(p&&!v.patternsLoaded())continue;let S=v.getBucket(t);if(!S)continue;let P=S.programConfigurations.get(t.id),T=r.useProgram(m,P),A=r.style.map.terrain&&r.style.map.terrain.getTerrainData(_);p&&(r.context.activeTexture.set(s.TEXTURE0),v.imageAtlasTexture.bind(s.LINEAR,s.CLAMP_TO_EDGE),P.updatePaintBuffers(h)),Eu(P,l,b,v,t);let L=A?_:null,C=L?L.posMatrix:_.posMatrix,I=r.translatePosMatrix(C,v,t.paint.get("fill-translate"),t.paint.get("fill-translate-anchor"));if(!o)y=S.indexBuffer,x=S.segments,g=p?od(I,r,h,v):ad(I);else{y=S.indexBuffer2,x=S.segments2;let D=[s.drawingBufferWidth,s.drawingBufferHeight];g=m==="fillOutlinePattern"&&p?k0(I,r,h,v,D):E0(I,D)}T.draw(r.context,f,n,r.stencilModeForClipping(_),a,le.disabled,g,A,t.id,S.layoutVertexBuffer,y,x,t.paint,r.transform.zoom,P)}}u(v1,"drawFillTiles");d();function S1(r,e,t,i){let n=t.paint.get("fill-extrusion-opacity");if(n!==0&&r.renderPass==="translucent"){let a=new Q(r.context.gl.LEQUAL,Q.ReadWrite,r.depthRangeFor3D);if(n===1&&!t.paint.get("fill-extrusion-pattern").constantOr(1)){let o=r.colorModeForRenderPass();ny(r,e,t,i,a,he.disabled,o)}else ny(r,e,t,i,a,he.disabled,De.disabled),ny(r,e,t,i,a,r.stencilModeFor3D(),r.colorModeForRenderPass())}}u(S1,"drawFillExtrusion");function ny(r,e,t,i,n,a,o){let s=r.context,l=s.gl,c="fill-extrusion-pattern",p=t.paint.get(c),h=p.constantOr(1),f=t.getCrossfadeParameters(),m=t.paint.get("fill-extrusion-opacity"),g=p.constantOr(null);for(let y of i){let x=e.getTile(y),b=x.getBucket(t);if(!b)continue;let _=r.style.map.terrain&&r.style.map.terrain.getTerrainData(y),v=b.programConfigurations.get(t.id),S=r.useProgram(h?"fillExtrusionPattern":"fillExtrusion",v);h&&(r.context.activeTexture.set(l.TEXTURE0),x.imageAtlasTexture.bind(l.LINEAR,l.CLAMP_TO_EDGE),v.updatePaintBuffers(f)),Eu(v,c,g,x,t);let P=r.translatePosMatrix(y.posMatrix,x,t.paint.get("fill-extrusion-translate"),t.paint.get("fill-extrusion-translate-anchor")),T=t.paint.get("fill-extrusion-vertical-gradient"),A=h?T0(P,r,T,m,y,f,x):nd(P,r,T,m);S.draw(s,s.gl.TRIANGLES,n,a,o,le.backCCW,A,_,t.id,b.layoutVertexBuffer,b.indexBuffer,b.segments,t.paint,r.transform.zoom,v,r.style.map.terrain&&b.centroidVertexBuffer)}}u(ny,"drawExtrusionTiles");d();function P1(r,e,t,i){if(r.renderPass!=="offscreen"&&r.renderPass!=="translucent")return;let n=r.context,a=r.depthModeForSublayer(0,Q.ReadOnly),o=r.colorModeForRenderPass(),[s,l]=r.renderPass==="translucent"?r.stencilConfigForOverlap(i):[{},i];for(let c of l){let p=e.getTile(c);typeof p.needsHillshadePrepare<"u"&&p.needsHillshadePrepare&&r.renderPass==="offscreen"?OC(r,p,t,a,he.disabled,o):r.renderPass==="translucent"&&RC(r,c,p,t,a,s[c.overscaledZ],o)}n.viewport.set([0,0,r.width,r.height])}u(P1,"drawHillshade");function RC(r,e,t,i,n,a,o){let s=r.context,l=s.gl,c=t.fbo;if(!c)return;let p=r.useProgram("hillshade"),h=r.style.map.terrain&&r.style.map.terrain.getTerrainData(e);s.activeTexture.set(l.TEXTURE0),l.bindTexture(l.TEXTURE_2D,c.colorAttachment.get());let f=h?e:null;p.draw(s,l.TRIANGLES,n,a,o,le.disabled,H0(r,t,i,f),h,i.id,r.rasterBoundsBuffer,r.quadTriangleIndexBuffer,r.rasterBoundsSegments)}u(RC,"renderHillshade");function OC(r,e,t,i,n,a){let o=r.context,s=o.gl,l=e.dem;if(l&&l.data){let c=l.dim,p=l.stride,h=l.getPixels();if(o.activeTexture.set(s.TEXTURE1),o.pixelStoreUnpackPremultiplyAlpha.set(!1),e.demTexture=e.demTexture||r.getTileTexture(p),e.demTexture){let m=e.demTexture;m.update(h,{premultiply:!1}),m.bind(s.NEAREST,s.CLAMP_TO_EDGE)}else e.demTexture=new be(o,h,s.RGBA,{premultiply:!1}),e.demTexture.bind(s.NEAREST,s.CLAMP_TO_EDGE);o.activeTexture.set(s.TEXTURE0);let f=e.fbo;if(!f){let m=new be(o,{width:c,height:c,data:null},s.RGBA);m.bind(s.LINEAR,s.CLAMP_TO_EDGE),f=e.fbo=o.createFramebuffer(c,c,!0,!1),f.colorAttachment.set(m.texture)}o.bindFramebuffer.set(f.framebuffer),o.viewport.set([0,0,c,c]),r.useProgram("hillshadePrepare").draw(o,s.TRIANGLES,i,n,a,le.disabled,Z0(e.tileID,l),null,t.id,r.rasterBoundsBuffer,r.quadTriangleIndexBuffer,r.rasterBoundsSegments),e.needsHillshadePrepare=!1}}u(OC,"prepareHillshade");d();function T1(r,e,t,i){if(r.renderPass!=="translucent"||t.paint.get("raster-opacity")===0||!i.length)return;let n=r.context,a=n.gl,o=e.getSource(),s=r.useProgram("raster"),l=r.colorModeForRenderPass(),[c,p]=o instanceof At?[{},i]:r.stencilConfigForOverlap(i),h=p[p.length-1].overscaledZ,f=!r.options.moving;for(let m of p){let g=r.depthModeForSublayer(m.overscaledZ-h,t.paint.get("raster-opacity")===1?Q.ReadWrite:Q.ReadOnly,a.LESS),y=e.getTile(m);y.registerFadeDuration(t.paint.get("raster-fade-duration"));let x=e.findLoadedParent(m,0),b=VC(y,x,e,t,r.transform,r.style.map.terrain),_,v,S=t.paint.get("raster-resampling")==="nearest"?a.NEAREST:a.LINEAR;n.activeTexture.set(a.TEXTURE0),y.texture.bind(S,a.CLAMP_TO_EDGE,a.LINEAR_MIPMAP_NEAREST),n.activeTexture.set(a.TEXTURE1),x?(x.texture.bind(S,a.CLAMP_TO_EDGE,a.LINEAR_MIPMAP_NEAREST),_=Math.pow(2,x.tileID.overscaledZ-y.tileID.overscaledZ),v=[y.tileID.canonical.x*_%1,y.tileID.canonical.y*_%1]):y.texture.bind(S,a.CLAMP_TO_EDGE,a.LINEAR_MIPMAP_NEAREST);let P=r.style.map.terrain&&r.style.map.terrain.getTerrainData(m),T=P?m:null,A=T?T.posMatrix:r.transform.calculatePosMatrix(m.toUnwrapped(),f),L=n1(A,v||[0,0],_||1,b,t);o instanceof At?s.draw(n,a.TRIANGLES,g,he.disabled,l,le.disabled,L,P,t.id,o.boundsBuffer,r.quadTriangleIndexBuffer,o.boundsSegments):s.draw(n,a.TRIANGLES,g,c[m.overscaledZ],l,le.disabled,L,P,t.id,r.rasterBoundsBuffer,r.quadTriangleIndexBuffer,r.rasterBoundsSegments)}}u(T1,"drawRaster");function VC(r,e,t,i,n,a){let o=i.paint.get("raster-fade-duration");if(!a&&o>0){let s=ne.now(),l=(s-r.timeAdded)/o,c=e?(s-e.timeAdded)/o:-1,p=t.getSource(),h=n.coveringZoomLevel({tileSize:p.tileSize,roundZoom:p.roundZoom}),f=!e||Math.abs(e.tileID.overscaledZ-h)>Math.abs(r.tileID.overscaledZ-h),m=f&&r.refreshedUponExpiration?1:Te(f?l:1-c,0,1);return r.refreshedUponExpiration&&l>=1&&(r.refreshedUponExpiration=!1),e?{opacity:1,mix:1-m}:{opacity:m,mix:0}}else return{opacity:1,mix:0}}u(VC,"getFadeValues");d();function A1(r,e,t,i){let n=t.paint.get("background-color"),a=t.paint.get("background-opacity");if(a===0)return;let o=r.context,s=o.gl,l=r.transform,c=l.tileSize,p=t.paint.get("background-pattern");if(r.isPatternMissing(p))return;let h=!p&&n.a===1&&a===1&&r.opaquePassEnabledForLayer()?"opaque":"translucent";if(r.renderPass!==h)return;let f=he.disabled,m=r.depthModeForSublayer(0,h==="opaque"?Q.ReadWrite:Q.ReadOnly),g=r.colorModeForRenderPass(),y=r.useProgram(p?"backgroundPattern":"background"),x=i||l.coveringTiles({tileSize:c,terrain:r.style.map.terrain});p&&(o.activeTexture.set(s.TEXTURE0),r.imageManager.bind(r.context));let b=t.getCrossfadeParameters();for(let _ of x){let v=i?_.posMatrix:r.transform.calculatePosMatrix(_.toUnwrapped()),S=p?h1(v,a,r,p,{tileID:_,tileSize:c},b):p1(v,a,n),P=r.style.map.terrain&&r.style.map.terrain.getTerrainData(_);y.draw(o,s.TRIANGLES,m,f,g,le.disabled,S,P,t.id,r.tileExtentBuffer,r.quadTriangleIndexBuffer,r.tileExtentSegments)}}u(A1,"drawBackground");d();var UC=new K(1,0,0,1),NC=new K(0,1,0,1),GC=new K(0,0,1,1),qC=new K(1,0,1,1),jC=new K(0,1,1,1);function C1(r){let e=r.transform.padding,t=3;I1(r,r.transform.height-(e.top||0),t,UC),I1(r,e.bottom||0,t,NC),M1(r,e.left||0,t,GC),M1(r,r.transform.width-(e.right||0),t,qC);let i=r.transform.centerPoint;$C(r,i.x,r.transform.height-i.y,jC)}u(C1,"drawDebugPadding");function $C(r,e,t,i){ku(r,e-2/2,t-20/2,2,20,i),ku(r,e-20/2,t-2/2,20,2,i)}u($C,"drawCrosshair");function I1(r,e,t,i){ku(r,0,e+t/2,r.transform.width,t,i)}u(I1,"drawHorizontalLine");function M1(r,e,t,i){ku(r,e-t/2,0,t,r.transform.height,i)}u(M1,"drawVerticalLine");function ku(r,e,t,i,n,a){let o=r.context,s=o.gl;s.enable(s.SCISSOR_TEST),s.scissor(e*r.pixelRatio,t*r.pixelRatio,i*r.pixelRatio,n*r.pixelRatio),o.clear({color:a}),s.disable(s.SCISSOR_TEST)}u(ku,"drawDebugSSRect");function E1(r,e,t){for(let i=0;i<t.length;i++)HC(r,e,t[i])}u(E1,"drawDebug");function HC(r,e,t){let i=r.context,n=i.gl,a=t.posMatrix,o=r.useProgram("debug"),s=Q.disabled,l=he.disabled,c=r.colorModeForRenderPass(),p="$debug",h=r.style.map.terrain&&r.style.map.terrain.getTerrainData(t);i.activeTexture.set(n.TEXTURE0);let f=e.getTileByID(t.key).latestRawTileData,m=f&&f.byteLength||0,g=Math.floor(m/1024),y=e.getTile(t).tileSize,x=512/Math.min(y,512)*(t.overscaledZ/r.transform.zoom)*.5,b=t.canonical.toString();t.overscaledZ!==t.canonical.z&&(b+=" => ".concat(t.overscaledZ));let _="".concat(b," ").concat(g,"kB");ZC(r,_),o.draw(i,n.TRIANGLES,s,l,De.alphaBlended,le.disabled,sd(a,K.transparent,x),null,p,r.debugBuffer,r.quadTriangleIndexBuffer,r.debugSegments),o.draw(i,n.LINE_STRIP,s,l,c,le.disabled,sd(a,K.red),h,p,r.debugBuffer,r.tileBorderIndexBuffer,r.debugSegments)}u(HC,"drawDebugTile");function ZC(r,e){r.initDebugOverlayCanvas();let t=r.debugOverlayCanvas,i=r.context.gl,n=r.debugOverlayCanvas.getContext("2d");n.clearRect(0,0,t.width,t.height),n.shadowColor="white",n.shadowBlur=2,n.lineWidth=1.5,n.strokeStyle="white",n.textBaseline="top",n.font="bold 36px Open Sans, sans-serif",n.fillText(e,5,5),n.strokeText(e,5,5),r.debugOverlayTexture.update(t),r.debugOverlayTexture.bind(i.LINEAR,i.CLAMP_TO_EDGE)}u(ZC,"drawTextToOverlay");function k1(r,e){let t=null,n=Object.values(r._layers).flatMap(l=>l.source&&!l.isHidden(e)?[r.sourceCaches[l.source]]:[]),a=n.filter(l=>l.getSource().type==="vector"),o=n.filter(l=>l.getSource().type!=="vector"),s=u(l=>{(!t||t.getSource().maxzoom<l.getSource().maxzoom)&&(t=l)},"considerSource");return a.forEach(l=>s(l)),t||o.forEach(l=>s(l)),t}u(k1,"selectDebugSource");d();function L1(r,e,t){let i=r.context,n=t.implementation;if(r.renderPass==="offscreen"){let a=n.prerender;a&&(r.setCustomLayerDefaults(),i.setColorMode(r.colorModeForRenderPass()),a.call(n,i.gl,r.transform.customLayerMatrix()),i.setDirty(),r.setBaseState())}else if(r.renderPass==="translucent"){r.setCustomLayerDefaults(),i.setColorMode(r.colorModeForRenderPass()),i.setStencilMode(he.disabled);let a=n.renderingMode==="3d"?new Q(r.context.gl.LEQUAL,Q.ReadWrite,r.depthRangeFor3D):r.depthModeForSublayer(0,Q.ReadOnly);i.setDepthMode(a),n.render(i.gl,r.transform.customLayerMatrix()),i.setDirty(),r.setBaseState(),i.bindFramebuffer.set(null)}}u(L1,"drawCustom");d();function D1(r,e){let t=r.context,i=t.gl,n=De.unblended,a=new Q(i.LEQUAL,Q.ReadWrite,[0,1]),o=e.getTerrainMesh(),s=e.sourceCache.getRenderableTiles(),l=r.useProgram("terrainDepth");t.bindFramebuffer.set(e.getFramebuffer("depth").framebuffer),t.viewport.set([0,0,r.width/devicePixelRatio,r.height/devicePixelRatio]),t.clear({color:K.transparent,depth:1});for(let c of s){let p=e.getTerrainData(c.tileID),h=r.transform.calculatePosMatrix(c.tileID.toUnwrapped()),f=_0(h,e.getMeshFrameDelta(r.transform.zoom));l.draw(t,i.TRIANGLES,a,he.disabled,n,le.backCCW,f,p,"terrain",o.vertexBuffer,o.indexBuffer,o.segments)}t.bindFramebuffer.set(null),t.viewport.set([0,0,r.width,r.height])}u(D1,"drawDepth");function z1(r,e){let t=r.context,i=t.gl,n=De.unblended,a=new Q(i.LEQUAL,Q.ReadWrite,[0,1]),o=e.getTerrainMesh(),s=e.getCoordsTexture(),l=e.sourceCache.getRenderableTiles(),c=r.useProgram("terrainCoords");t.bindFramebuffer.set(e.getFramebuffer("coords").framebuffer),t.viewport.set([0,0,r.width/devicePixelRatio,r.height/devicePixelRatio]),t.clear({color:K.transparent,depth:1}),e.coordsIndex=[];for(let p of l){let h=e.getTerrainData(p.tileID);t.activeTexture.set(i.TEXTURE0),i.bindTexture(i.TEXTURE_2D,s.texture);let f=r.transform.calculatePosMatrix(p.tileID.toUnwrapped()),m=v0(f,255-e.coordsIndex.length,e.getMeshFrameDelta(r.transform.zoom));c.draw(t,i.TRIANGLES,a,he.disabled,n,le.backCCW,m,h,"terrain",o.vertexBuffer,o.indexBuffer,o.segments),e.coordsIndex.push(p.tileID.key)}t.bindFramebuffer.set(null),t.viewport.set([0,0,r.width,r.height])}u(z1,"drawCoords");function ay(r,e,t){let i=r.context,n=i.gl,a=r.colorModeForRenderPass(),o=new Q(n.LEQUAL,Q.ReadWrite,r.depthRangeFor3D),s=r.useProgram("terrain"),l=e.getTerrainMesh();i.bindFramebuffer.set(null),i.viewport.set([0,0,r.width,r.height]);for(let c of t){let p=r.renderToTexture.getTexture(c),h=e.getTerrainData(c.tileID);i.activeTexture.set(n.TEXTURE0),n.bindTexture(n.TEXTURE_2D,p.texture);let f=r.transform.calculatePosMatrix(c.tileID.toUnwrapped()),m=b0(f,e.getMeshFrameDelta(r.transform.zoom));s.draw(i,n.TRIANGLES,o,he.disabled,a,le.backCCW,m,h,"terrain",l.vertexBuffer,l.indexBuffer,l.segments)}}u(ay,"drawTerrain");var oy=class oy{constructor(e,t){this.context=new Mu(e),this.transform=t,this._tileTextures={},this.terrainFacilitator={dirty:!0,matrix:q.create(),renderTime:0},this.setup(),this.numSublayers=or.maxUnderzooming+or.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new xn}resize(e,t,i){if(this.width=Math.floor(e*i),this.height=Math.floor(t*i),this.pixelRatio=i,this.context.viewport.set([0,0,this.width,this.height]),this.setupRemoteFrameRendering(this.width,this.height),this.style)for(let n of this.style._order)this.style._layers[n].resize()}setup(){let e=this.context,t=new Pr;t.emplaceBack(0,0),t.emplaceBack(8192,0),t.emplaceBack(0,8192),t.emplaceBack(8192,8192),this.tileExtentBuffer=e.createVertexBuffer(t,Vl.members),this.tileExtentSegments=me.simpleSegment(0,0,4,2);let i=new Pr;i.emplaceBack(0,0),i.emplaceBack(8192,0),i.emplaceBack(0,8192),i.emplaceBack(8192,8192),this.debugBuffer=e.createVertexBuffer(i,Vl.members),this.debugSegments=me.simpleSegment(0,0,4,5);let n=new Hi;n.emplaceBack(0,0,0,0),n.emplaceBack(8192,0,8192,0),n.emplaceBack(0,8192,0,8192),n.emplaceBack(8192,8192,8192,8192),this.rasterBoundsBuffer=e.createVertexBuffer(n,zr.members),this.rasterBoundsSegments=me.simpleSegment(0,0,4,2);let a=new Pr;a.emplaceBack(0,0),a.emplaceBack(1,0),a.emplaceBack(0,1),a.emplaceBack(1,1),this.viewportBuffer=e.createVertexBuffer(a,Vl.members),this.viewportSegments=me.simpleSegment(0,0,4,2);let o=new va;o.emplaceBack(0),o.emplaceBack(1),o.emplaceBack(3),o.emplaceBack(2),o.emplaceBack(0),this.tileBorderIndexBuffer=e.createIndexBuffer(o);let s=new nt;s.emplaceBack(0,1,2),s.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=e.createIndexBuffer(s);let l=this.context.gl;this.stencilClearMode=new he({func:l.ALWAYS,mask:0},0,255,l.ZERO,l.ZERO,l.ZERO),this.setupRemoteFrameRendering(this.width,this.height)}setupRemoteFrameRendering(e,t){if(e==null||t==null)return;let i=this.context.gl;i.bindFramebuffer(i.FRAMEBUFFER,null),this.webGLRenderTargetFrameBuffer&&(i.deleteFramebuffer(this.webGLRenderTargetFrameBuffer),i.deleteRenderbuffer(this.webGLRenderTargetRenderBuffer),i.deleteTexture(this.webGLRenderTargetTexture)),this.webGLRenderTargetFrameBuffer=i.createFramebuffer(),this.webGLRenderTargetRenderBuffer=i.createRenderbuffer(),i.bindFramebuffer(i.FRAMEBUFFER,this.webGLRenderTargetFrameBuffer),this.webGLRenderTargetTexture=i.createTexture(),i.bindTexture(i.TEXTURE_2D,this.webGLRenderTargetTexture),i.texImage2D(i.TEXTURE_2D,0,i.RGBA,e,t,0,i.RGBA,i.UNSIGNED_BYTE,null),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,i.LINEAR),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MAG_FILTER,i.LINEAR),i.framebufferTexture2D(i.FRAMEBUFFER,i.COLOR_ATTACHMENT0,i.TEXTURE_2D,this.webGLRenderTargetTexture,0),i.bindRenderbuffer(i.RENDERBUFFER,this.webGLRenderTargetRenderBuffer),i.renderbufferStorage(i.RENDERBUFFER,i.DEPTH_STENCIL,e,t),i.framebufferRenderbuffer(i.FRAMEBUFFER,i.DEPTH_STENCIL_ATTACHMENT,i.RENDERBUFFER,this.webGLRenderTargetRenderBuffer),i.checkFramebufferStatus(i.FRAMEBUFFER)!==i.FRAMEBUFFER_COMPLETE&&console.error("Framebuffer is not complete")}clearStencil(){let e=this.context,t=e.gl;this.nextStencilID=1,this.currentStencilSource=void 0;let i=q.create();q.ortho(i,0,this.width,this.height,0,0,1),q.scale(i,i,[t.drawingBufferWidth,t.drawingBufferHeight,0]),this.useProgram("clippingMask").draw(e,t.TRIANGLES,Q.disabled,this.stencilClearMode,De.disabled,le.disabled,ld(i),null,"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}_renderTileClippingMasks(e,t){if(this.currentStencilSource===e.source||!e.isTileClipped()||!t||!t.length)return;this.currentStencilSource=e.source;let i=this.context,n=i.gl;this.nextStencilID+t.length>256&&this.clearStencil(),i.setColorMode(De.disabled),i.setDepthMode(Q.disabled);let a=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(let o of t){let s=this._tileClippingMaskIDs[o.key]=this.nextStencilID++,l=this.style.map.terrain&&this.style.map.terrain.getTerrainData(o);a.draw(i,n.TRIANGLES,Q.disabled,new he({func:n.ALWAYS,mask:0},s,255,n.KEEP,n.KEEP,n.REPLACE),De.disabled,le.disabled,ld(o.posMatrix),l,"$clipping",this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();let e=this.nextStencilID++,t=this.context.gl;return new he({func:t.NOTEQUAL,mask:255},e,255,t.KEEP,t.KEEP,t.REPLACE)}stencilModeForClipping(e){let t=this.context.gl;return new he({func:t.EQUAL,mask:255},this._tileClippingMaskIDs[e.key],0,t.KEEP,t.KEEP,t.REPLACE)}stencilConfigForOverlap(e){let t=this.context.gl,i=e.sort((o,s)=>s.overscaledZ-o.overscaledZ),n=i[i.length-1].overscaledZ,a=i[0].overscaledZ-n+1;if(a>1){this.currentStencilSource=void 0,this.nextStencilID+a>256&&this.clearStencil();let o={};for(let s=0;s<a;s++)o[s+n]=new he({func:t.GEQUAL,mask:255},s+this.nextStencilID,255,t.KEEP,t.KEEP,t.REPLACE);return this.nextStencilID+=a,[o,i]}return[{[n]:he.disabled},i]}colorModeForRenderPass(){let e=this.context.gl;return this._showOverdrawInspector?new De([e.CONSTANT_COLOR,e.ONE],new K(.125,.125,.125,0),[!0,!0,!0,!0]):this.renderPass==="opaque"?De.unblended:De.alphaBlended}depthModeForSublayer(e,t,i){if(!this.opaquePassEnabledForLayer())return Q.disabled;let n=1-((1+this.currentLayer)*this.numSublayers+e)*this.depthEpsilon;return new Q(i||this.context.gl.LEQUAL,t,[n,n])}opaquePassEnabledForLayer(){return this.currentLayer<this.opaquePassCutoff}render(e,t){this.style=e,this.options=t,this.lineAtlas=e.lineAtlas,this.imageManager=e.imageManager,this.glyphManager=e.glyphManager,this.symbolFadeChange=e.placement.symbolFadeChange(ne.now()),this.imageManager.beginFrame();let i=this.style._order,n=this.style.sourceCaches,a={},o={},s={};for(let l in n){let c=n[l];c.used&&c.prepare(this.context),a[l]=c.getVisibleCoordinates(),o[l]=a[l].slice().reverse(),s[l]=c.getVisibleCoordinates(!0).reverse()}this.opaquePassCutoff=1/0;for(let l=0;l<i.length;l++){let c=i[l];if(this.style._layers[c].is3D()){this.opaquePassCutoff=l;break}}if(this.renderToTexture){this.renderToTexture.prepareForRender(this.style,this.transform.zoom),this.opaquePassCutoff=0;let l=this.style.map.terrain.sourceCache.tilesAfterTime(this.terrainFacilitator.renderTime);(this.terrainFacilitator.dirty||!q.equals(this.terrainFacilitator.matrix,this.transform.projMatrix)||l.length)&&(q.copy(this.terrainFacilitator.matrix,this.transform.projMatrix),this.terrainFacilitator.renderTime=Date.now(),this.terrainFacilitator.dirty=!1,D1(this,this.style.map.terrain),z1(this,this.style.map.terrain))}this.renderPass="offscreen";for(let l of i){let c=this.style._layers[l];if(!c.hasOffscreenPass()||c.isHidden(this.transform.zoom))continue;let p=o[c.source];c.type!=="custom"&&!p.length||this.renderLayer(this,n[c.source],c,p)}if(this.context.bindFramebuffer.set(this.webGLRenderTargetFrameBuffer),this.context.clear({color:t.showOverdrawInspector?K.black:K.transparent,depth:1}),this.clearStencil(),this._showOverdrawInspector=t.showOverdrawInspector,this.depthRangeFor3D=[0,1-(e._order.length+2)*this.numSublayers*this.depthEpsilon],!this.renderToTexture)for(this.renderPass="opaque",this.currentLayer=i.length-1;this.currentLayer>=0;this.currentLayer--){let l=this.style._layers[i[this.currentLayer]],c=n[l.source],p=a[l.source];this._renderTileClippingMasks(l,p),this.renderLayer(this,c,l,p)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayer<i.length;this.currentLayer++){let l=this.style._layers[i[this.currentLayer]],c=n[l.source];if(this.renderToTexture&&this.renderToTexture.renderLayer(l))continue;let p=(l.type==="symbol"?s:o)[l.source];this._renderTileClippingMasks(l,a[l.source]),this.renderLayer(this,c,l,p)}if(this.options.showTileBoundaries){let l=k1(this.style,this.transform.zoom);l&&E1(this,l,l.getVisibleCoordinates())}this.options.showPadding&&C1(this),this.context.setDefault(),this.setCustomLayerDefaults(),this.context.gl.bindFramebuffer(this.context.gl.FRAMEBUFFER,null)}renderLayer(e,t,i,n){if(!i.isHidden(this.transform.zoom)&&!(i.type!=="background"&&i.type!=="custom"&&!(n||[]).length))switch(this.id=i.id,i.type){case"symbol":g1(e,t,i,n,this.style.placement.variableOffsets);break;case"circle":x1(e,t,i,n);break;case"heatmap":b1(e,t,i,n);break;case"line":_1(e,t,i,n);break;case"fill":w1(e,t,i,n);break;case"fill-extrusion":S1(e,t,i,n);break;case"hillshade":P1(e,t,i,n);break;case"raster":T1(e,t,i,n);break;case"background":A1(e,t,i,n);break;case"custom":L1(e,t,i);break}}translatePosMatrix(e,t,i,n,a){if(!i[0]&&!i[1])return e;let o=a?n==="map"?this.transform.angle:0:n==="viewport"?-this.transform.angle:0;if(o){let c=Math.sin(o),p=Math.cos(o);i=[i[0]*p-i[1]*c,i[0]*c+i[1]*p]}let s=[a?i[0]:Ke(t,i[0],this.transform.zoom),a?i[1]:Ke(t,i[1],this.transform.zoom),0],l=new Float32Array(16);return q.translate(l,e,s),l}saveTileTexture(e){let t=this._tileTextures[e.size[0]];t?t.push(e):this._tileTextures[e.size[0]]=[e]}getTileTexture(e){let t=this._tileTextures[e];return t&&t.length>0?t.pop():null}isPatternMissing(e){if(!e)return!1;if(!e.from||!e.to)return!0;let t=this.imageManager.getPattern(e.from.toString()),i=this.imageManager.getPattern(e.to.toString());return!t||!i}useProgram(e,t){this.cache=this.cache||{};let i=e+(t?t.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"")+(this.style.map.terrain?"/terrain":"");return this.cache[i]||(this.cache[i]=new Gl(this.context,xi[e],t,f1[e],this._showOverdrawInspector,this.style.map.terrain)),this.cache[i]}setCustomLayerDefaults(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()}setBaseState(){let e=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(e.FUNC_ADD)}initDebugOverlayCanvas(){if(this.debugOverlayCanvas==null){this.debugOverlayCanvas=document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512;let e=this.context.gl;this.debugOverlayTexture=new be(this.context,this.debugOverlayCanvas,e.RGBA)}}destroy(){this.debugOverlayTexture&&this.debugOverlayTexture.destroy()}overLimit(){let{drawingBufferWidth:e,drawingBufferHeight:t}=this.context.gl;return this.width!==e||this.height!==t}};u(oy,"Painter");var Lu=oy;d();var Ge=ae(Pe(),1);d();var zu=class zu{constructor(e,t){this.points=e;this.planes=t}static fromInvProjectionMatrix(e,t,i){let n=[[-1,1,-1,1],[1,1,-1,1],[1,-1,-1,1],[-1,-1,-1,1],[-1,1,1,1],[1,1,1,1],[1,-1,1,1],[-1,-1,1,1]],a=Math.pow(2,i),o=n.map(c=>{c=Xe.transformMat4([],c,e);let p=1/c[3]/t*a;return Xe.mul(c,c,[p,p,1/c[3],p])}),l=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map(c=>{let p=gt.sub([],o[c[0]],o[c[1]]),h=gt.sub([],o[c[2]],o[c[1]]),f=gt.normalize([],gt.cross([],p,h)),m=-gt.dot(f,o[c[1]]);return f.concat(m)});return new zu(o,l)}};u(zu,"Frustum");var Du=zu,Fu=class Fu{constructor(e,t){this.min=e,this.max=t,this.center=gt.scale([],gt.add([],this.min,this.max),.5)}quadrant(e){let t=[e%2===0,e<2],i=gt.clone(this.min),n=gt.clone(this.max);for(let a=0;a<t.length;a++)i[a]=t[a]?this.min[a]:this.center[a],n[a]=t[a]?this.center[a]:this.max[a];return n[2]=this.max[2],new Fu(i,n)}distanceX(e){return Math.max(Math.min(this.max[0],e[0]),this.min[0])-e[0]}distanceY(e){return Math.max(Math.min(this.max[1],e[1]),this.min[1])-e[1]}intersects(e){let t=[[this.min[0],this.min[1],this.min[2],1],[this.max[0],this.min[1],this.min[2],1],[this.max[0],this.max[1],this.min[2],1],[this.min[0],this.max[1],this.min[2],1],[this.min[0],this.min[1],this.max[2],1],[this.max[0],this.min[1],this.max[2],1],[this.max[0],this.max[1],this.max[2],1],[this.min[0],this.max[1],this.max[2],1]],i=!0;for(let n=0;n<e.planes.length;n++){let a=e.planes[n],o=0;for(let s=0;s<t.length;s++)Xe.dot(a,t[s])>=0&&o++;if(o===0)return 0;o!==t.length&&(i=!1)}if(i)return 2;for(let n=0;n<3;n++){let a=Number.MAX_VALUE,o=-Number.MAX_VALUE;for(let s=0;s<e.points.length;s++){let l=e.points[s][n]-this.min[n];a=Math.min(a,l),o=Math.max(o,l)}if(o<0||a>this.max[n]-this.min[n])return 0}return 1}};u(Fu,"Aabb");var io=Fu;d();var F1=ae(Pe(),1);var Ru=class Ru{constructor(e=0,t=0,i=0,n=0){if(isNaN(e)||e<0||isNaN(t)||t<0||isNaN(i)||i<0||isNaN(n)||n<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=e,this.bottom=t,this.left=i,this.right=n}interpolate(e,t,i){return t.top!=null&&e.top!=null&&(this.top=ke.number(e.top,t.top,i)),t.bottom!=null&&e.bottom!=null&&(this.bottom=ke.number(e.bottom,t.bottom,i)),t.left!=null&&e.left!=null&&(this.left=ke.number(e.left,t.left,i)),t.right!=null&&e.right!=null&&(this.right=ke.number(e.right,t.right,i)),this}getCenter(e,t){let i=Te((this.left+e-this.right)/2,0,e),n=Te((this.top+t-this.bottom)/2,0,t);return new F1.default(i,n)}equals(e){return this.top===e.top&&this.bottom===e.bottom&&this.left===e.left&&this.right===e.right}clone(){return new Ru(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}};u(Ru,"EdgeInsets");var Bu=Ru;var Vu=class Vu{constructor(e,t,i,n,a){this.tileSize=512,this.maxValidLatitude=85.051129,this.freezeElevation=!1,this._renderWorldCopies=a===void 0?!0:!!a,this._minZoom=e||0,this._maxZoom=t||22,this._minPitch=i==null?0:i,this._maxPitch=n==null?60:n,this.setMaxBounds(),this.width=0,this.height=0,this._center=new re(0,0),this._elevation=0,this.zoom=0,this.angle=0,this._fov=.698132,this._pitch=0,this._unmodified=!0,this._edgeInsets=new Bu,this._posMatrixCache={},this._alignedPosMatrixCache={}}clone(){let e=new Vu(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return e.apply(this),e}apply(e){this.tileSize=e.tileSize,this.latRange=e.latRange,this.width=e.width,this.height=e.height,this._center=e._center,this._elevation=e._elevation,this.zoom=e.zoom,this.angle=e.angle,this._fov=e._fov,this._pitch=e._pitch,this._unmodified=e._unmodified,this._edgeInsets=e._edgeInsets.clone(),this._calcMatrices()}get minZoom(){return this._minZoom}set minZoom(e){this._minZoom!==e&&(this._minZoom=e,this.zoom=Math.max(this.zoom,e))}get maxZoom(){return this._maxZoom}set maxZoom(e){this._maxZoom!==e&&(this._maxZoom=e,this.zoom=Math.min(this.zoom,e))}get minPitch(){return this._minPitch}set minPitch(e){this._minPitch!==e&&(this._minPitch=e,this.pitch=Math.max(this.pitch,e))}get maxPitch(){return this._maxPitch}set maxPitch(e){this._maxPitch!==e&&(this._maxPitch=e,this.pitch=Math.min(this.pitch,e))}get renderWorldCopies(){return this._renderWorldCopies}set renderWorldCopies(e){e===void 0?e=!0:e===null&&(e=!1),this._renderWorldCopies=e}get worldSize(){return this.tileSize*this.scale}get centerOffset(){return this.centerPoint._sub(this.size._div(2))}get size(){return new Ge.default(this.width,this.height)}get bearing(){return-this.angle/Math.PI*180}set bearing(e){let t=-Yt(e,-180,180)*Math.PI/180;this.angle!==t&&(this._unmodified=!1,this.angle=t,this._calcMatrices(),this.rotationMatrix=Ta.create(),Ta.rotate(this.rotationMatrix,this.rotationMatrix,this.angle))}get pitch(){return this._pitch/Math.PI*180}set pitch(e){let t=Te(e,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==t&&(this._unmodified=!1,this._pitch=t,this._calcMatrices())}get fov(){return this._fov/Math.PI*180}set fov(e){e=Math.max(.01,Math.min(60,e)),this._fov!==e&&(this._unmodified=!1,this._fov=e/180*Math.PI,this._calcMatrices())}get zoom(){return this._zoom}set zoom(e){let t=Math.min(Math.max(e,this.minZoom),this.maxZoom);this._zoom!==t&&(this._unmodified=!1,this._zoom=t,this.tileZoom=Math.max(0,Math.floor(t)),this.scale=this.zoomScale(t),this._constrain(),this._calcMatrices())}get center(){return this._center}set center(e){e.lat===this._center.lat&&e.lng===this._center.lng||(this._unmodified=!1,this._center=e,this._constrain(),this._calcMatrices())}get elevation(){return this._elevation}set elevation(e){e!==this._elevation&&(this._elevation=e,this._constrain(),this._calcMatrices())}get padding(){return this._edgeInsets.toJSON()}set padding(e){this._edgeInsets.equals(e)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,e,1),this._calcMatrices())}get centerPoint(){return this._edgeInsets.getCenter(this.width,this.height)}isPaddingEqual(e){return this._edgeInsets.equals(e)}interpolatePadding(e,t,i){this._unmodified=!1,this._edgeInsets.interpolate(e,t,i),this._constrain(),this._calcMatrices()}coveringZoomLevel(e){let t=(e.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/e.tileSize));return Math.max(0,t)}getVisibleUnwrappedCoordinates(e){let t=[new un(0,e)];if(this._renderWorldCopies){let i=this.pointCoordinate(new Ge.default(0,0)),n=this.pointCoordinate(new Ge.default(this.width,0)),a=this.pointCoordinate(new Ge.default(this.width,this.height)),o=this.pointCoordinate(new Ge.default(0,this.height)),s=Math.floor(Math.min(i.x,n.x,a.x,o.x)),l=Math.floor(Math.max(i.x,n.x,a.x,o.x)),c=1;for(let p=s-c;p<=l+c;p++)p!==0&&t.push(new un(p,e))}return t}coveringTiles(e){var b,_;let t=this.coveringZoomLevel(e),i=t;if(e.minzoom!==void 0&&t<e.minzoom)return[];e.maxzoom!==void 0&&t>e.maxzoom&&(t=e.maxzoom);let n=this.pointCoordinate(this.getCameraPoint()),a=ze.fromLngLat(this.center),o=Math.pow(2,t),s=[o*n.x,o*n.y,0],l=[o*a.x,o*a.y,0],c=Du.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,t),p=e.minzoom||0;!e.terrain&&this.pitch<=60&&this._edgeInsets.top<.1&&(p=t);let h=e.terrain?2/Math.min(this.tileSize,e.tileSize)*this.tileSize:3,f=u(v=>({aabb:new io([v*o,0,0],[(v+1)*o,o,0]),zoom:0,x:0,y:0,wrap:v,fullyVisible:!1}),"newRootTile"),m=[],g=[],y=t,x=e.reparseOverscaled?i:t;if(this._renderWorldCopies)for(let v=1;v<=3;v++)m.push(f(-v)),m.push(f(v));for(m.push(f(0));m.length>0;){let v=m.pop(),S=v.x,P=v.y,T=v.fullyVisible;if(!T){let F=v.aabb.intersects(c);if(F===0)continue;T=F===2}let A=e.terrain?s:l,L=v.aabb.distanceX(A),C=v.aabb.distanceY(A),I=Math.max(Math.abs(L),Math.abs(C)),D=h+(1<<y-v.zoom)-2;if(v.zoom===y||I>D&&v.zoom>=p){let F=y-v.zoom,k=s[0]-.5-(S<<F),E=s[1]-.5-(P<<F);g.push({tileID:new rt(v.zoom===y?x:v.zoom,v.wrap,v.zoom,S,P),distanceSq:Xi.sqrLen([l[0]-.5-S,l[1]-.5-P]),tileDistanceToCamera:Math.sqrt(k*k+E*E)});continue}for(let F=0;F<4;F++){let k=(S<<1)+F%2,E=(P<<1)+(F>>1),O=v.zoom+1,X=v.aabb.quadrant(F);if(e.terrain){let H=new rt(O,v.wrap,O,k,E),fe=e.terrain.getMinMaxElevation(H),J=(b=fe.minElevation)!=null?b:this.elevation,Qe=(_=fe.maxElevation)!=null?_:this.elevation;X=new io([X.min[0],X.min[1],J],[X.max[0],X.max[1],Qe])}m.push({aabb:X,zoom:O,x:k,y:E,wrap:v.wrap,fullyVisible:T})}}return g.sort((v,S)=>v.distanceSq-S.distanceSq).map(v=>v.tileID)}resize(e,t){this.width=e,this.height=t,this.pixelsToGLUnits=[2/e,-2/t],this._constrain(),this._calcMatrices()}get unmodified(){return this._unmodified}zoomScale(e){return Math.pow(2,e)}scaleZoom(e){return Math.log(e)/Math.LN2}project(e){let t=Te(e.lat,-this.maxValidLatitude,this.maxValidLatitude);return new Ge.default(kr(e.lng)*this.worldSize,Lr(t)*this.worldSize)}calculateZMercatorFromAltitude(e){let{lat:t}=this.center,i=mi,n=this.tileSize,a=t*Math.PI/180,s=e+i,l=Math.cos(a)*2*Math.PI*i/(n*Math.pow(2,20)),c=s/l,p=Math.log2(n/c);return Math.abs(p)}unproject(e){return new ze(e.x/this.worldSize,e.y/this.worldSize).toLngLat()}get point(){return this.project(this.center)}updateElevation(e){this.freezeElevation||(this.elevation=this.getElevation())}getElevation(e,t){let i=ze.fromLngLat(e.wrap()),n=(1<<this.tileZoom)*8192,a=i.x*n,o=i.y*n,s=Math.floor(a/8192),l=Math.floor(o/8192),c=new rt(this.tileZoom,0,this.tileZoom,s,l);return t.getElevation(c,a%8192,o%8192,8192)}getCameraPosition(){let e=this.pointLocation(this.getCameraPoint()),t=Math.cos(this._pitch)*this.cameraToCenterDistance/this._pixelPerMeter;return{lngLat:e,altitude:t+this.elevation}}recalculateZoom(e){let t=this.pointLocation(this.centerPoint,e),i=this.getElevation(t,e);if(!(this.elevation-i))return;let a=this.getCameraPosition(),o=ze.fromLngLat(a.lngLat,a.altitude),s=ze.fromLngLat(t,i),l=o.x-s.x,c=o.y-s.y,p=o.z-s.z,h=Math.sqrt(l*l+c*c+p*p),f=this.scaleZoom(this.cameraToCenterDistance/h/this.tileSize);this._elevation=i,this._center=t,this.zoom=f}setLocationAtPoint(e,t){let i=this.pointCoordinate(t),n=this.pointCoordinate(this.centerPoint),a=this.locationCoordinate(e),o=new ze(a.x-(i.x-n.x),a.y-(i.y-n.y));this.center=this.coordinateLocation(o),this._renderWorldCopies&&(this.center=this.center.wrap())}locationPoint(e,t){return t?this.coordinatePoint(this.locationCoordinate(e),this.getElevation(e,t),this.pixelMatrix3D):this.coordinatePoint(this.locationCoordinate(e))}pointLocation(e,t){return this.coordinateLocation(this.pointCoordinate(e,t))}locationCoordinate(e){return ze.fromLngLat(e)}coordinateLocation(e){return e&&e.toLngLat()}pointCoordinate(e,t){if(t){let y=t.pointCoordinate(e);if(y!=null)return y}let i=0,n=[e.x,e.y,0,1],a=[e.x,e.y,1,1];Xe.transformMat4(n,n,this.pixelMatrixInverse),Xe.transformMat4(a,a,this.pixelMatrixInverse);let o=n[3],s=a[3],l=n[0]/o,c=a[0]/s,p=n[1]/o,h=a[1]/s,f=n[2]/o,m=a[2]/s,g=f===m?0:(i-f)/(m-f);return new ze(ke.number(l,c,g)/this.worldSize,ke.number(p,h,g)/this.worldSize)}coordinatePoint(e,t=0,i=this.pixelMatrix){let n=[e.x*this.worldSize,e.y*this.worldSize,t,1];return Xe.transformMat4(n,n,i),new Ge.default(n[0]/n[3],n[1]/n[3])}getBounds(){let e=Math.max(0,this.height/2-this.getHorizon());return new lt().extend(this.pointLocation(new Ge.default(0,e))).extend(this.pointLocation(new Ge.default(this.width,e))).extend(this.pointLocation(new Ge.default(this.width,this.height))).extend(this.pointLocation(new Ge.default(0,this.height)))}getMaxBounds(){return!this.latRange||this.latRange.length!==2||!this.lngRange||this.lngRange.length!==2?null:new lt([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]])}getHorizon(){return Math.tan(Math.PI/2-this._pitch)*this.cameraToCenterDistance*.85}setMaxBounds(e){e?(this.lngRange=[e.getWest(),e.getEast()],this.latRange=[e.getSouth(),e.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-this.maxValidLatitude,this.maxValidLatitude])}calculatePosMatrix(e,t=!1){let i=e.key,n=t?this._alignedPosMatrixCache:this._posMatrixCache;if(n[i])return n[i];let a=e.canonical,o=this.worldSize/this.zoomScale(a.z),s=a.x+Math.pow(2,a.z)*e.wrap,l=q.identity(new Float64Array(16));return q.translate(l,l,[s*o,a.y*o,0]),q.scale(l,l,[o/8192,o/8192,1]),q.multiply(l,t?this.alignedProjMatrix:this.projMatrix,l),n[i]=new Float32Array(l),n[i]}customLayerMatrix(){return this.mercatorMatrix.slice()}_constrain(){if(!this.center||!this.width||!this.height||this._constraining)return;this._constraining=!0;let e=-90,t=90,i=-180,n=180,a,o,s,l,c=this.size,p=this._unmodified;if(this.latRange){let m=this.latRange;e=Lr(m[1])*this.worldSize,t=Lr(m[0])*this.worldSize,a=t-e<c.y?c.y/(t-e):0}if(this.lngRange){let m=this.lngRange;i=Yt(kr(m[0])*this.worldSize,0,this.worldSize),n=Yt(kr(m[1])*this.worldSize,0,this.worldSize),n<i&&(n+=this.worldSize),o=n-i<c.x?c.x/(n-i):0}let h=this.point,f=Math.max(o||0,a||0);if(f){this.center=this.unproject(new Ge.default(o?(n+i)/2:h.x,a?(t+e)/2:h.y)),this.zoom+=this.scaleZoom(f),this._unmodified=p,this._constraining=!1;return}if(this.latRange){let m=h.y,g=c.y/2;m-g<e&&(l=e+g),m+g>t&&(l=t-g)}if(this.lngRange){let m=(i+n)/2,g=Yt(h.x,m-this.worldSize/2,m+this.worldSize/2),y=c.x/2;g-y<i&&(s=i+y),g+y>n&&(s=n-y)}(s!==void 0||l!==void 0)&&(this.center=this.unproject(new Ge.default(s!==void 0?s:h.x,l!==void 0?l:h.y)).wrap()),this._unmodified=p,this._constraining=!1}_calcMatrices(){if(!this.height)return;let e=this._fov/2,t=this.centerOffset,i=this.point.x,n=this.point.y;this.cameraToCenterDistance=.5/Math.tan(e)*this.height,this._pixelPerMeter=Qf(1,this.center.lat)*this.worldSize;let a=q.identity(new Float64Array(16));q.scale(a,a,[this.width/2,-this.height/2,1]),q.translate(a,a,[1,-1,0]),this.labelPlaneMatrix=a,a=q.identity(new Float64Array(16)),q.scale(a,a,[1,-1,1]),q.translate(a,a,[-1,-1,0]),q.scale(a,a,[2/this.width,2/this.height,1]),this.glCoordMatrix=a,this.cameraToSeaLevelDistance=this.cameraToCenterDistance+this._elevation*this._pixelPerMeter/Math.cos(this._pitch);let o=this._elevation<0?this.cameraToCenterDistance:this.cameraToSeaLevelDistance,s=Math.PI/2+this._pitch,l=this._fov*(.5+t.y/this.height),c=Math.sin(l)*o/Math.sin(Te(Math.PI-s-l,.01,Math.PI-.01)),p=this.getHorizon(),f=2*Math.atan(p/this.cameraToCenterDistance)*(.5+t.y/(p*2)),m=Math.sin(f)*o/Math.sin(Te(Math.PI-s-f,.01,Math.PI-.01)),g=Math.min(c,m),y=(Math.cos(Math.PI/2-this._pitch)*g+o)*1.01,x=this.height/50;a=new Float64Array(16),q.perspective(a,this._fov,this.width/this.height,x,y),a[8]=-t.x*2/this.width,a[9]=t.y*2/this.height,q.scale(a,a,[1,-1,1]),q.translate(a,a,[0,0,-this.cameraToCenterDistance]),q.rotateX(a,a,this._pitch),q.rotateZ(a,a,this.angle),q.translate(a,a,[-i,-n,0]),this.mercatorMatrix=q.scale([],a,[this.worldSize,this.worldSize,this.worldSize]),q.scale(a,a,[1,1,this._pixelPerMeter]),this.pixelMatrix=q.multiply(new Float64Array(16),this.labelPlaneMatrix,a),q.translate(a,a,[0,0,-this.elevation]),this.projMatrix=a,this.invProjMatrix=q.invert([],a),this.pixelMatrix3D=q.multiply(new Float64Array(16),this.labelPlaneMatrix,a);let b=this.width%2/2,_=this.height%2/2,v=Math.cos(this.angle),S=Math.sin(this.angle),P=i-Math.round(i)+v*b+S*_,T=n-Math.round(n)+v*_+S*b,A=new Float64Array(a);if(q.translate(A,A,[P>.5?P-1:P,T>.5?T-1:T,0]),this.alignedProjMatrix=A,a=q.invert(new Float64Array(16),this.pixelMatrix),!a)throw new Error("failed to invert matrix");this.pixelMatrixInverse=a,this._posMatrixCache={},this._alignedPosMatrixCache={}}maxPitchScaleFactor(){if(!this.pixelMatrixInverse)return 1;let e=this.pointCoordinate(new Ge.default(0,0)),t=[e.x*this.worldSize,e.y*this.worldSize,0,1];return Xe.transformMat4(t,t,this.pixelMatrix)[3]/this.cameraToCenterDistance}getCameraPoint(){let e=this._pitch,t=Math.tan(e)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new Ge.default(0,t))}getCameraQueryGeometry(e){let t=this.getCameraPoint();if(e.length===1)return[e[0],t];{let i=t.x,n=t.y,a=t.x,o=t.y;for(let s of e)i=Math.min(i,s.x),n=Math.min(n,s.y),a=Math.max(a,s.x),o=Math.max(o,s.y);return[new Ge.default(i,n),new Ge.default(a,n),new Ge.default(a,o),new Ge.default(i,o),new Ge.default(i,n)]}}setCameraPosition(e){let{lng:t,lat:i,altitude:n,pitch:a,bearing:o}=e,s=a*(Math.PI/180),l=.5/Math.tan(this._fov/2)*this.height,c=Math.abs(Math.cos(s)*l),h=2*Math.PI*6378137*Math.abs(Math.cos(i*(Math.PI/180))),f=c/n*h,m=Math.tan(s)*l,g=new Ge.default(this.width/2,this.height/2+m),y=new re(t,i);this.zoom=Math.log(f/this.tileSize)/Math.LN2,this.pitch=a,this.bearing=o,this.setLocationAtPoint(y,g)}getCameraAltitude(){let e=this._pitch,t=Math.cos(e)*this.cameraToCenterDistance,i=Math.tan(e)*this.cameraToCenterDistance,n=this.pointLocation(this.centerPoint.add(new Ge.default(0,i))),a=2*Math.PI*6378137,o=this.worldSize/(a*Math.abs(Math.cos(n.lat*(Math.PI/180))));return t/o}};u(Vu,"Transform");var Ou=Vu;d();d();function B1(r,e){let t=!1,i=null,n=u(()=>{i=null,t&&(r(),i=setTimeout(n,e),t=!1)},"later");return()=>(t=!0,i||n(),i)}u(B1,"throttle");var sy=class sy{constructor(e){this._getCurrentHash=u(()=>{let e=window.location.hash.replace("#","");if(this._hashName){let t;return e.split("&").map(i=>i.split("=")).forEach(i=>{i[0]===this._hashName&&(t=i)}),(t&&t[1]||"").split("/")}return e.split("/")},"_getCurrentHash");this._onHashChange=u(()=>{let e=this._getCurrentHash();if(e.length>=3&&!e.some(t=>isNaN(t))){let t=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(e[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+e[2],+e[1]],zoom:+e[0],bearing:t,pitch:+(e[4]||0)}),!0}return!1},"_onHashChange");this._updateHashUnthrottled=u(()=>{let e=window.location.href.replace(/(#.+)?$/,this.getHashString());try{window.history.replaceState(window.history.state,null,e)}catch{}},"_updateHashUnthrottled");this._updateHash=B1(this._updateHashUnthrottled,30*1e3/100);this._hashName=e&&encodeURIComponent(e)}addTo(e){return this._map=e,addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this}remove(){return removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),clearTimeout(this._updateHash()),delete this._map,this}getHashString(e){let t=this._map.getCenter(),i=Math.round(this._map.getZoom()*100)/100,n=Math.ceil((i*Math.LN2+Math.log(512/360/.5))/Math.LN10),a=Math.pow(10,n),o=Math.round(t.lng*a)/a,s=Math.round(t.lat*a)/a,l=this._map.getBearing(),c=this._map.getPitch(),p="";if(e?p+="/".concat(o,"/").concat(s,"/").concat(i):p+="".concat(i,"/").concat(s,"/").concat(o),(l||c)&&(p+="/".concat(Math.round(l*10)/10)),c&&(p+="/".concat(Math.round(c))),this._hashName){let h=this._hashName,f=!1,m=window.location.hash.slice(1).split("&").map(g=>{let y=g.split("=")[0];return y===h?(f=!0,"".concat(y,"=").concat(p)):g}).filter(g=>g);return f||m.push("".concat(h,"=").concat(p)),"#".concat(m.join("&"))}return"#".concat(p)}};u(sy,"Hash");var Uu=sy;d();d();var R1=ae(Pe(),1);var ju={linearity:.3,easing:bc(0,0,.3,1)},WC=R({deceleration:2500,maxSpeed:1400},ju),XC=R({deceleration:20,maxSpeed:1400},ju),KC=R({deceleration:1e3,maxSpeed:360},ju),YC=R({deceleration:1e3,maxSpeed:90},ju),ly=class ly{constructor(e){this._map=e,this.clear()}clear(){this._inertiaBuffer=[]}record(e){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:ne.now(),settings:e})}_drainInertiaBuffer(){let e=this._inertiaBuffer,t=ne.now(),i=160;for(;e.length>0&&t-e[0].time>i;)e.shift()}_onMoveEnd(e){if(this._drainInertiaBuffer(),this._inertiaBuffer.length<2)return;let t={zoom:0,bearing:0,pitch:0,pan:new R1.default(0,0),pinchAround:void 0,around:void 0};for(let{settings:o}of this._inertiaBuffer)t.zoom+=o.zoomDelta||0,t.bearing+=o.bearingDelta||0,t.pitch+=o.pitchDelta||0,o.panDelta&&t.pan._add(o.panDelta),o.around&&(t.around=o.around),o.pinchAround&&(t.pinchAround=o.pinchAround);let n=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,a={};if(t.pan.mag()){let o=Gu(t.pan.mag(),n,R({},WC,e||{}));a.offset=t.pan.mult(o.amount/t.pan.mag()),a.center=this._map.transform.center,Nu(a,o)}if(t.zoom){let o=Gu(t.zoom,n,XC);a.zoom=this._map.transform.zoom+o.amount,Nu(a,o)}if(t.bearing){let o=Gu(t.bearing,n,KC);a.bearing=this._map.transform.bearing+Te(o.amount,-179,179),Nu(a,o)}if(t.pitch){let o=Gu(t.pitch,n,YC);a.pitch=this._map.transform.pitch+o.amount,Nu(a,o)}if(a.zoom||a.bearing){let o=t.pinchAround===void 0?t.around:t.pinchAround;a.around=o?this._map.unproject(o):this._map.getCenter()}return this.clear(),R(a,{noMoveStart:!0})}};u(ly,"HandlerInertia");var qu=ly;function Nu(r,e){(!r.duration||r.duration<e.duration)&&(r.duration=e.duration,r.easing=e.easing)}u(Nu,"extendDuration");function Gu(r,e,t){let{maxSpeed:i,linearity:n,deceleration:a}=t,o=Te(r*n/(e/1e3),-i,i),s=Math.abs(o)/(a*n);return{easing:t.easing,duration:s*1e3,amount:o*(s/2)}}u(Gu,"calculateEasing");var O1=ae(Pe(),1);var $u=u(r=>r.zoom||r.drag||r.pitch||r.rotate,"isMoving"),py=class py extends z{};u(py,"RenderFrameEvent");var cy=py;function uy(r){return r.panDelta&&r.panDelta.mag()||r.zoomDelta||r.bearingDelta||r.pitchDelta}u(uy,"hasChange");var hy=class hy{constructor(e,t){this.handleWindowEvent=u(e=>{this.handleEvent(e,"".concat(e.type,"Window"))},"handleWindowEvent");this.handleEvent=u((e,t)=>{if(e.type==="blur"){this.stop(!0);return}this._updatingCamera=!0;let i=e.type==="renderFrame"?void 0:e,n={needsRenderFrame:!1},a={},o={},s=e.touches,l=s?this._getMapTouches(s):void 0,c=l?B.touchPos(this._el,l):B.mousePos(this._el,e);for(let{handlerName:f,handler:m,allowed:g}of this._handlers){if(!m.isEnabled())continue;let y;this._blockedByActive(o,g,f)?m.reset():m[t||e.type]&&(y=m[t||e.type](e,c,l),this.mergeHandlerResult(n,a,y,f,i),y&&y.needsRenderFrame&&this._triggerRenderFrame()),(y||m.isActive())&&(o[f]=m)}let p={};for(let f in this._previousActiveHandlers)o[f]||(p[f]=i);this._previousActiveHandlers=o,(Object.keys(p).length||uy(n))&&(this._changes.push([n,a,p]),this._triggerRenderFrame()),(Object.keys(o).length||uy(n))&&this._map._stop(!0),this._updatingCamera=!1;let{cameraAnimation:h}=n;h&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],h(this._map))},"handleEvent");this._map=e,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new qu(e),this._bearingSnap=t.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={};let i=this._el;this._listeners=[[i,"touchstart",{passive:!0}],[i,"touchmove",{passive:!1}],[i,"touchend",void 0],[i,"touchcancel",void 0],[i,"mousedown",void 0],[i,"mousemove",void 0],[i,"mouseup",void 0],[document,"mousemove",{capture:!0}],[document,"mouseup",void 0],[i,"mouseover",void 0],[i,"mouseout",void 0],[i,"dblclick",void 0],[i,"click",void 0],[i,"keydown",{capture:!1}],[i,"keyup",void 0],[i,"wheel",{passive:!1}],[i,"contextmenu",void 0],[window,"blur",void 0]]}destroy(){}_addDefaultHandlers(e){}_add(e,t,i){this._handlers.push({handlerName:e,handler:t,allowed:i}),this._handlersById[e]=t}stop(e){if(!this._updatingCamera){for(let{handler:t}of this._handlers)t.reset();this._inertia.clear(),this._fireEvents({},{},e),this._changes=[]}}isActive(){for(let{handler:e}of this._handlers)if(e.isActive())return!0;return!1}isZooming(){return!!this._eventsInProgress.zoom||!1}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return!!$u(this._eventsInProgress)||this.isZooming()}_blockedByActive(e,t,i){for(let n in e)if(n!==i&&(!t||t.indexOf(n)<0))return!0;return!1}_getMapTouches(e){let t=[];for(let i of e){let n=i.target;this._el.contains(n)&&t.push(i)}return t}mergeHandlerResult(e,t,i,n,a){if(!i)return;R(e,i);let o={handlerName:n,originalEvent:i.originalEvent||a};i.zoomDelta!==void 0&&(t.zoom=o),i.panDelta!==void 0&&(t.drag=o),i.pitchDelta!==void 0&&(t.pitch=o),i.bearingDelta!==void 0&&(t.rotate=o)}_applyChanges(){let e={},t={},i={};for(let[n,a,o]of this._changes)n.panDelta&&(e.panDelta=(e.panDelta||new O1.default(0,0))._add(n.panDelta)),n.zoomDelta&&(e.zoomDelta=(e.zoomDelta||0)+n.zoomDelta),n.bearingDelta&&(e.bearingDelta=(e.bearingDelta||0)+n.bearingDelta),n.pitchDelta&&(e.pitchDelta=(e.pitchDelta||0)+n.pitchDelta),n.around!==void 0&&(e.around=n.around),n.pinchAround!==void 0&&(e.pinchAround=n.pinchAround),n.noInertia&&(e.noInertia=n.noInertia),R(t,a),R(i,o);this._updateMapTransform(e,t,i),this._changes=[]}_updateMapTransform(e,t,i){let n=this._map,a=n._getTransformForUpdate(),o=n.terrain;if(!uy(e)&&!(o&&this._terrainMovement))return this._fireEvents(t,i,!0);let{panDelta:s,zoomDelta:l,bearingDelta:c,pitchDelta:p,around:h,pinchAround:f}=e;f!==void 0&&(h=f),n._stop(!0),h=h||n.transform.centerPoint;let m=a.pointLocation(s?h.sub(s):h);c&&(a.bearing+=c),p&&(a.pitch+=p),l&&(a.zoom+=l),o?!this._terrainMovement&&(t.drag||t.zoom)?(this._terrainMovement=!0,a.freezeElevation=!0,a.setLocationAtPoint(m,h),this._map.once("moveend",()=>{a.freezeElevation=!1,this._terrainMovement=!1,a.recalculateZoom(n.terrain)})):t.drag&&this._terrainMovement?a.center=a.pointLocation(a.centerPoint.sub(s)):a.setLocationAtPoint(m,h):a.setLocationAtPoint(m,h),n._applyUpdatedTransform(a),this._map._update(),e.noInertia||this._inertia.record(e),this._fireEvents(t,i,!0)}_fireEvents(e,t,i){let n=$u(this._eventsInProgress),a=$u(e),o={};for(let p in e){let{originalEvent:h}=e[p];this._eventsInProgress[p]||(o["".concat(p,"start")]=h),this._eventsInProgress[p]=e[p]}!n&&a&&this._fireEvent("movestart",a.originalEvent);for(let p in o)this._fireEvent(p,o[p]);a&&this._fireEvent("move",a.originalEvent);for(let p in e){let{originalEvent:h}=e[p];this._fireEvent(p,h)}let s={},l;for(let p in this._eventsInProgress){let{handlerName:h,originalEvent:f}=this._eventsInProgress[p];this._handlersById[h].isActive()||(delete this._eventsInProgress[p],l=t[h]||f,s["".concat(p,"end")]=l)}for(let p in s)this._fireEvent(p,s[p]);let c=$u(this._eventsInProgress);if(i&&(n||a)&&!c){this._updatingCamera=!0;let p=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),h=u(f=>f!==0&&-this._bearingSnap<f&&f<this._bearingSnap,"shouldSnapToNorth");p?(h(p.bearing||this._map.getBearing())&&(p.bearing=0),p.freezeElevation=!0,this._map.easeTo(p,{originalEvent:l})):(this._map.fire(new z("moveend",{originalEvent:l})),h(this._map.getBearing())&&this._map.resetNorth()),this._updatingCamera=!1}}_fireEvent(e,t){this._map.fire(new z(e,t?{originalEvent:t}:{}))}_requestFrame(){return this._map.triggerRepaint(),this._map._renderTaskQueue.add(e=>{delete this._frameId,this.handleEvent(new cy("renderFrame",{timeStamp:e})),this._applyChanges()})}_triggerRenderFrame(){this._frameId===void 0&&(this._frameId=this._requestFrame())}};u(hy,"HandlerManager");var Hu=hy;d();var Wt=ae(Pe(),1);var fy=class fy extends de{constructor(t,i){super();this._renderFrameCallback=u(()=>{let t=Math.min((ne.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(t)),t<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},"_renderFrameCallback");this._moving=!1,this._zooming=!1,this.transform=t,this._bearingSnap=i.bearingSnap,this.on("moveend",()=>{delete this._requestedCameraState})}getCenter(){return new re(this.transform.center.lng,this.transform.center.lat)}setCenter(t,i){return this.jumpTo({center:t},i)}panBy(t,i,n){return t=Wt.default.convert(t).mult(-1),this.panTo(this.transform.center,R({offset:t},i),n)}panTo(t,i,n){return this.easeTo(R({center:t},i),n)}getZoom(){return this.transform.zoom}setZoom(t,i){return this.jumpTo({zoom:t},i),this}zoomTo(t,i,n){return this.easeTo(R({zoom:t},i),n)}zoomIn(t,i){return this.zoomTo(this.getZoom()+1,t,i),this}zoomOut(t,i){return this.zoomTo(this.getZoom()-1,t,i),this}getBearing(){return this.transform.bearing}setBearing(t,i){return this.jumpTo({bearing:t},i),this}getPadding(){return this.transform.padding}setPadding(t,i){return this.jumpTo({padding:t},i),this}rotateTo(t,i,n){return this.easeTo(R({bearing:t},i),n)}resetNorth(t,i){return this.rotateTo(0,R({duration:1e3},t),i),this}resetNorthPitch(t,i){return this.easeTo(R({bearing:0,pitch:0,duration:1e3},t),i),this}snapToNorth(t,i){return Math.abs(this.getBearing())<this._bearingSnap?this.resetNorth(t,i):this}getPitch(){return this.transform.pitch}setPitch(t,i){return this.jumpTo({pitch:t},i),this}cameraForBounds(t,i){t=lt.convert(t);let n=i&&i.bearing||0;return this._cameraForBoxAndBearing(t.getNorthWest(),t.getSouthEast(),n,i)}_cameraForBoxAndBearing(t,i,n,a){let o={top:0,bottom:0,right:0,left:0};if(a=R({padding:o,offset:[0,0],maxZoom:this.transform.maxZoom},a),typeof a.padding=="number"){let D=a.padding;a.padding={top:D,bottom:D,right:D,left:D}}a.padding=R(o,a.padding);let s=this.transform,l=s.padding,c=s.project(re.convert(t)),p=s.project(re.convert(i)),h=c.rotate(-n*Math.PI/180),f=p.rotate(-n*Math.PI/180),m=new Wt.default(Math.max(h.x,f.x),Math.max(h.y,f.y)),g=new Wt.default(Math.min(h.x,f.x),Math.min(h.y,f.y)),y=m.sub(g),x=(s.width-(l.left+l.right+a.padding.left+a.padding.right))/y.x,b=(s.height-(l.top+l.bottom+a.padding.top+a.padding.bottom))/y.y;if(b<0||x<0){Ce("Map cannot fit within canvas with the given bounds, padding, and/or offset.");return}let _=Math.min(s.scaleZoom(s.scale*Math.min(x,b)),a.maxZoom),v=Wt.default.convert(a.offset),S=(a.padding.left-a.padding.right)/2,P=(a.padding.top-a.padding.bottom)/2,A=new Wt.default(S,P).rotate(n*Math.PI/180),C=v.add(A).mult(s.scale/s.zoomScale(_));return{center:s.unproject(c.add(p).div(2).sub(C)),zoom:_,bearing:n}}fitBounds(t,i,n){return this._fitInternal(this.cameraForBounds(t,i),i,n)}fitScreenCoordinates(t,i,n,a,o){return this._fitInternal(this._cameraForBoxAndBearing(this.transform.pointLocation(Wt.default.convert(t)),this.transform.pointLocation(Wt.default.convert(i)),n,a),a,o)}_fitInternal(t,i,n){return t?(i=R(t,i),delete i.padding,i.linear?this.easeTo(i,n):this.flyTo(i,n)):this}jumpTo(t,i){this.stop();let n=this._getTransformForUpdate(),a=!1,o=!1,s=!1;return"zoom"in t&&n.zoom!==+t.zoom&&(a=!0,n.zoom=+t.zoom),t.center!==void 0&&(n.center=re.convert(t.center)),"bearing"in t&&n.bearing!==+t.bearing&&(o=!0,n.bearing=+t.bearing),"pitch"in t&&n.pitch!==+t.pitch&&(s=!0,n.pitch=+t.pitch),t.padding!=null&&!n.isPaddingEqual(t.padding)&&(n.padding=t.padding),this._applyUpdatedTransform(n),this.fire(new z("movestart",i)).fire(new z("move",i)),a&&this.fire(new z("zoomstart",i)).fire(new z("zoom",i)).fire(new z("zoomend",i)),o&&this.fire(new z("rotatestart",i)).fire(new z("rotate",i)).fire(new z("rotateend",i)),s&&this.fire(new z("pitchstart",i)).fire(new z("pitch",i)).fire(new z("pitchend",i)),this.fire(new z("moveend",i))}calculateCameraOptionsFromTo(t,i,n,a=0){let o=ze.fromLngLat(t,i),s=ze.fromLngLat(n,a),l=s.x-o.x,c=s.y-o.y,p=s.z-o.z,h=Math.hypot(l,c,p);if(h===0)throw new Error("Can't calculate camera options with same From and To");let f=Math.hypot(l,c),m=this.transform.scaleZoom(this.transform.cameraToCenterDistance/h/this.transform.tileSize),g=Math.atan2(l,-c)*180/Math.PI,y=Math.acos(f/h)*180/Math.PI;return y=p<0?90-y:90+y,{center:s.toLngLat(),zoom:m,pitch:y,bearing:g}}easeTo(t,i){this._stop(!1,t.easeId),t=R({offset:[0,0],duration:500,easing:_c},t),(t.animate===!1||!t.essential&&ne.prefersReducedMotion)&&(t.duration=0);let n=this._getTransformForUpdate(),a=this.getZoom(),o=this.getBearing(),s=this.getPitch(),l=this.getPadding(),c="zoom"in t?+t.zoom:a,p="bearing"in t?this._normalizeBearing(t.bearing,o):o,h="pitch"in t?+t.pitch:s,f="padding"in t?t.padding:n.padding;console.log("aaaa",c),console.log("new zoom",c);let m=Wt.default.convert(t.offset),g=n.centerPoint.add(m),y=n.pointLocation(g),x=re.convert(t.center||y);this._normalizeCenter(x);let b=n.project(y),_=n.project(x).sub(b),v=n.zoomScale(c-a),S,P;t.around&&(S=re.convert(t.around),P=n.locationPoint(S));let T={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching};return this._zooming=this._zooming||c!==a,this._rotating=this._rotating||o!==p,this._pitching=this._pitching||h!==s,this._padding=!n.isPaddingEqual(f),this._easeId=t.easeId,this._prepareEase(i,t.noMoveStart,T),this.terrain&&this._prepareElevation(x),this._ease(A=>{if(this._zooming&&(n.zoom=ke.number(a,c,A)),this._rotating&&(n.bearing=ke.number(o,p,A)),this._pitching&&(n.pitch=Te(ke.number(s,h,A),this.transform.minPitch,this.transform.maxPitch)),this._padding&&(n.interpolatePadding(l,f,A),g=n.centerPoint.add(m)),this.terrain&&!t.freezeElevation&&this._updateElevation(A),S)n.setLocationAtPoint(S,P);else{let L=n.zoomScale(n.zoom-a),C=c>a?Math.min(2,v):Math.max(.5,v),I=Math.pow(C,1-A),D=n.unproject(b.add(_.mult(A*I)).mult(L));n.setLocationAtPoint(n.renderWorldCopies?D.wrap():D,g)}this._applyUpdatedTransform(n),this._fireMoveEvents(i)},A=>{this.terrain&&this._finalizeElevation(),this._afterEase(i,A)},t),this}_prepareEase(t,i,n={}){this._moving=!0,!i&&!n.moving&&this.fire(new z("movestart",t)),this._zooming&&!n.zooming&&this.fire(new z("zoomstart",t)),this._rotating&&!n.rotating&&this.fire(new z("rotatestart",t)),this._pitching&&!n.pitching&&this.fire(new z("pitchstart",t))}_prepareElevation(t){this._elevationCenter=t,this._elevationStart=this.transform.elevation,this._elevationTarget=this.transform.getElevation(t,this.terrain),this.transform.freezeElevation=!0}_updateElevation(t){let i=this.transform.getElevation(this._elevationCenter,this.terrain);if(t<1&&i!==this._elevationTarget){let n=this._elevationTarget-this._elevationStart,a=(i-(n*t+this._elevationStart))/(1-t);this._elevationStart+=t*(n-a),this._elevationTarget=i}this.transform.elevation=ke.number(this._elevationStart,this._elevationTarget,t)}_finalizeElevation(){this.transform.freezeElevation=!1,this.transform.recalculateZoom(this.terrain)}_getTransformForUpdate(){return this.transformCameraUpdate?(this._requestedCameraState||(this._requestedCameraState=this.transform.clone()),this._requestedCameraState):this.transform}_applyUpdatedTransform(t){if(!this.transformCameraUpdate)return;let i=t.clone(),{center:n,zoom:a,pitch:o,bearing:s,elevation:l}=this.transformCameraUpdate(i);n&&(i.center=n),a!==void 0&&(i.zoom=a),o!==void 0&&(i.pitch=o),s!==void 0&&(i.bearing=s),l!==void 0&&(i.elevation=l),this.transform.apply(i)}_fireMoveEvents(t){this.fire(new z("move",t)),this._zooming&&this.fire(new z("zoom",t)),this._rotating&&this.fire(new z("rotate",t)),this._pitching&&this.fire(new z("pitch",t))}_afterEase(t,i){if(this._easeId&&i&&this._easeId===i)return;delete this._easeId;let n=this._zooming,a=this._rotating,o=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,n&&this.fire(new z("zoomend",t)),a&&this.fire(new z("rotateend",t)),o&&this.fire(new z("pitchend",t)),this.fire(new z("moveend",t))}flyTo(t,i){if(!t.essential&&ne.prefersReducedMotion){let H=Bt(t,["center","zoom","bearing","pitch","around"]);return this.jumpTo(H,i)}this.stop(),t=R({offset:[0,0],speed:1.2,curve:1.42,easing:_c},t);let n=this._getTransformForUpdate(),a=this.getZoom(),o=this.getBearing(),s=this.getPitch(),l=this.getPadding(),c="zoom"in t?Te(+t.zoom,n.minZoom,n.maxZoom):a,p="bearing"in t?this._normalizeBearing(t.bearing,o):o,h="pitch"in t?+t.pitch:s,f="padding"in t?t.padding:n.padding,m=n.zoomScale(c-a),g=Wt.default.convert(t.offset),y=n.centerPoint.add(g),x=n.pointLocation(y),b=re.convert(t.center||x);this._normalizeCenter(b);let _=n.project(x),v=n.project(b).sub(_),S=t.curve,P=Math.max(n.width,n.height),T=P/m,A=v.mag();if("minZoom"in t){let H=Te(Math.min(t.minZoom,a,c),n.minZoom,n.maxZoom),fe=P/n.zoomScale(H-a);S=Math.sqrt(fe/A*2)}let L=S*S;function C(H){let fe=(T*T-P*P+(H?-1:1)*L*L*A*A)/(2*(H?T:P)*L*A);return Math.log(Math.sqrt(fe*fe+1)-fe)}u(C,"zoomOutFactor");function I(H){return(Math.exp(H)-Math.exp(-H))/2}u(I,"sinh");function D(H){return(Math.exp(H)+Math.exp(-H))/2}u(D,"cosh");function F(H){return I(H)/D(H)}u(F,"tanh");let k=C(!1),E=u(function(H){return D(k)/D(k+S*H)},"w"),O=u(function(H){return P*((D(k)*F(k+S*H)-I(k))/L)/A},"u"),X=(C(!0)-k)/S;if(Math.abs(A)<1e-6||!isFinite(X)){if(Math.abs(P-T)<1e-6)return this.easeTo(t,i);let H=T<P?-1:1;X=Math.abs(Math.log(T/P))/S,O=u(function(){return 0},"u"),E=u(function(fe){return Math.exp(H*S*fe)},"w")}if("duration"in t)t.duration=+t.duration;else{let H="screenSpeed"in t?+t.screenSpeed/S:+t.speed;t.duration=1e3*X/H}return t.maxDuration&&t.duration>t.maxDuration&&(t.duration=0),this._zooming=!0,this._rotating=o!==p,this._pitching=h!==s,this._padding=!n.isPaddingEqual(f),this._prepareEase(i,!1),this.terrain&&this._prepareElevation(b),this._ease(H=>{let fe=H*X,J=1/E(fe);n.zoom=H===1?c:a+n.scaleZoom(J),this._rotating&&(n.bearing=ke.number(o,p,H)),this._pitching&&(n.pitch=ke.number(s,h,H)),this._padding&&(n.interpolatePadding(l,f,H),y=n.centerPoint.add(g)),this.terrain&&!t.freezeElevation&&this._updateElevation(H);let Qe=H===1?b:n.unproject(_.add(v.mult(O(fe))).mult(J));n.setLocationAtPoint(n.renderWorldCopies?Qe.wrap():Qe,y),this._applyUpdatedTransform(n),this._fireMoveEvents(i)},()=>{this.terrain&&this._finalizeElevation(),this._afterEase(i)},t),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_stop(t,i){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){let n=this._onEaseEnd;delete this._onEaseEnd,n.call(this,i)}if(!t){let n=this.handlers;n&&n.stop(!1)}return this}_ease(t,i,n){n.animate===!1||n.duration===0?(t(1),i()):(this._easeStart=ne.now(),this._easeOptions=n,this._onEaseFrame=t,this._onEaseEnd=i,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_normalizeBearing(t,i){t=Yt(t,-180,180);let n=Math.abs(t-i);return Math.abs(t-360-i)<n&&(t-=360),Math.abs(t+360-i)<n&&(t+=360),t}_normalizeCenter(t){let i=this.transform;if(!i.renderWorldCopies||i.lngRange)return;let n=t.lng-i.center.lng;t.lng+=n>180?-360:n<-180?360:0}queryTerrainElevation(t){return this.terrain?this.transform.getElevation(re.convert(t),this.terrain)-this.transform.elevation:null}};u(fy,"Camera");var Zu=fy;var lr=ae(Pe(),1);d();var my=class my{constructor(e={}){this._toggleAttribution=u(()=>{this._container.classList.contains("outdoor-compact")&&(this._container.classList.contains("outdoor-compact-show")?(this._container.setAttribute("open",""),this._container.classList.remove("outdoor-compact-show")):(this._container.classList.add("outdoor-compact-show"),this._container.removeAttribute("open")))},"_toggleAttribution");this._updateData=u(e=>{e&&(e.sourceDataType==="metadata"||e.sourceDataType==="visibility"||e.dataType==="style"||e.type==="terrain")&&this._updateAttributions()},"_updateData");this._updateCompact=u(()=>{this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact===!1?this._container.setAttribute("open",""):!this._container.classList.contains("outdoor-compact")&&!this._container.classList.contains("outdoor-attrib-empty")&&(this._container.setAttribute("open",""),this._container.classList.add("outdoor-compact","outdoor-compact-show")):(this._container.setAttribute("open",""),this._container.classList.contains("outdoor-compact")&&this._container.classList.remove("outdoor-compact","outdoor-compact-show"))},"_updateCompact");this._updateCompactMinimize=u(()=>{this._container.classList.contains("outdoor-compact")&&this._container.classList.contains("outdoor-compact-show")&&this._container.classList.remove("outdoor-compact-show")},"_updateCompactMinimize");this.options=e,this.position=this.options.position||this.getDefaultPosition()}getDefaultPosition(){return"bottom-right"}onAdd(e){return this._map=e,this._compact=this.options&&this.options.compact,this._container=B.create("details","outdoor-ctrl-attrib outdoor-ctrl-attrib-".concat(this.position)),this._compactButton=B.create("summary","outdoor-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=B.create("div","outdoor-ctrl-attrib-inner",this._container),this._updateAttributions(),this._updateCompact(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("terrain",this._updateData),this._map.on("resize",this._updateCompact),this._map.on("drag",this._updateCompactMinimize),this._attributions=[],this._container}onRemove(){B.remove(this._container),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("terrain",this._updateData),this._map.off("resize",this._updateCompact),this._map.off("drag",this._updateCompactMinimize),this._map=void 0,this._compact=void 0,this._attribHTML=void 0}_setElementTitle(e,t){let i=this._map._getUIString("AttributionControl.".concat(t));e.title=i,e.setAttribute("aria-label",i)}get attributions(){return[...this._attributions]}_updateAttributions(){if(!this._map.style)return;let e=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?e=e.concat(this.options.customAttribution.map(n=>typeof n!="string"?"":n)):typeof this.options.customAttribution=="string"&&e.push(this.options.customAttribution)),this._map.style.stylesheet){let n=this._map.style.stylesheet;this.styleOwner=n.owner,this.styleId=n.id}let t=this._map.style.sourceCaches;for(let n in t){let a=t[n];if(a.used||a.usedForTerrain){let o=a.getSource();o.attribution&&e.indexOf(o.attribution)<0&&e.push(o.attribution)}}e=e.filter(n=>String(n).trim()),e.sort((n,a)=>n.length-a.length),e=e.filter((n,a)=>{for(let o=a+1;o<e.length;o++)if(e[o].indexOf(n)>=0)return!1;return!0}),this._attributions=e;let i=e.join(" | ");i!==this._attribHTML&&(this._attribHTML=i,e.length?(this._innerContainer.innerHTML=i,this._container.classList.remove("outdoor-attrib-empty")):this._container.classList.add("outdoor-attrib-empty"),this._updateCompact(),this._editLink=null)}show(){this._container.classList.remove("outdoor-ctrl-attrib-hide")}hide(){this._container.classList.add("outdoor-ctrl-attrib-hide")}setPosition(e){this._container.classList.remove("outdoor-ctrl-attrib-".concat(this.position)),this.position=e,this._container.classList.add("outdoor-ctrl-attrib-".concat(this.position))}};u(my,"AttributionControl");var _n=my;d();var dy=class dy{constructor(e={}){this._updateCompact=u(()=>{let e=this._container.children;if(e.length){let t=e[0];this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact!==!1&&t.classList.add("maplibregl-compact"):t.classList.remove("maplibregl-compact")}},"_updateCompact");this.options=e}getDefaultPosition(){return"bottom-left"}onAdd(e){this._map=e,this._compact=this.options&&this.options.compact,this._container=B.create("div","maplibregl-ctrl");let t=B.create("a","maplibregl-ctrl-logo");return t.target="_blank",t.rel="noopener nofollow",t.href="https://maplibre.org/",t.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),t.setAttribute("rel","noopener nofollow"),this._container.appendChild(t),this._container.style.display="block",this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}onRemove(){B.remove(this._container),this._map.off("resize",this._updateCompact),this._map=void 0,this._compact=void 0}};u(dy,"LogoControl");var vn=dy;d();var JC=ae(Pe(),1);var yy=class yy extends z{constructor(t,i,n,a={}){let o=B.mousePos(i.getCanvasContainer(),n),s=i.unproject(o);super(t,R({point:o,lngLat:s,originalEvent:n},a));this._defaultPrevented=!1,this.target=i}preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}};u(yy,"MapMouseEvent");var wn=yy;d();var gy=class gy{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(e){let t=++this._id;return this._queue.push({callback:e,id:t,cancelled:!1}),t}remove(e){let t=this._currentlyRunning,i=t?this._queue.concat(t):this._queue;for(let n of i)if(n.id===e){n.cancelled=!0;return}}run(e=0){if(this._currentlyRunning)throw new Error("Attempting to run(), but is already running.");let t=this._currentlyRunning=this._queue;this._queue=[];for(let i of t)if(!i.cancelled&&(i.callback(e),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}};u(gy,"TaskQueue");var Wu=gy;d();var Ku=(i=>(i.create="create",i.load="load",i.fullLoad="fullLoad",i))(Ku||{}),Xu=null,no=[],QC=60,xy=1e3/QC,by="loadTime",_y="fullLoadTime",Rr={mark(r){performance.mark(r)},frame(r){let e=r;if(Xu!=null){let t=e-Xu;no.push(t)}Xu=e},clearMetrics(){Xu=null,no=[],performance.clearMeasures(by),performance.clearMeasures(_y);for(let r in Ku)performance.clearMarks(Ku[r])},getPerformanceMetrics(){performance.measure(by,"create","load"),performance.measure(_y,"create","fullLoad");let r=performance.getEntriesByName(by)[0].duration,e=performance.getEntriesByName(_y)[0].duration,t=no.length,n=1/(no.reduce((s,l)=>s+l,0)/t/1e3),a=no.filter(s=>s>xy).reduce((s,l)=>s+(l-xy)/xy,0),o=a/(t+a)*100;return{loadTime:r,fullLoadTime:e,fps:n,percentDroppedFrames:o,totalFrames:t}}};d();var V1={"AttributionControl.ToggleAttribution":"Toggle attribution","AttributionControl.MapFeedback":"Map feedback","FullscreenControl.Enter":"Enter fullscreen","FullscreenControl.Exit":"Exit fullscreen","GeolocateControl.FindMyLocation":"Find my location","GeolocateControl.LocationNotAvailable":"Location not available","LogoControl.Title":"Mapbox logo","NavigationControl.ResetBearing":"Reset bearing to north","NavigationControl.ZoomIn":"Zoom in","NavigationControl.ZoomOut":"Zoom out","ScaleControl.Feet":"ft","ScaleControl.Meters":"m","ScaleControl.Kilometers":"km","ScaleControl.Miles":"mi","ScaleControl.NauticalMiles":"nm","TerrainControl.enableTerrain":"Enable terrain","TerrainControl.disableTerrain":"Disable terrain"};d();d();var U1=ve([{name:"a_pos3d",type:"Int16",components:3}]);d();var vy=class vy extends de{constructor(t){super();this.sourceCache=t,this._tiles={},this._renderableTilesKeys=[],this._sourceTileCache={},this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.deltaZoom=1,t.usedForTerrain=!0,t.tileSize=this.tileSize*2**this.deltaZoom}destruct(){this.sourceCache.usedForTerrain=!1,this.sourceCache.tileSize=null}update(t,i){this.sourceCache.update(t,i),this._renderableTilesKeys=[];let n={};for(let a of t.coveringTiles({tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,reparseOverscaled:!1,terrain:i}))n[a.key]=!0,this._renderableTilesKeys.push(a.key),this._tiles[a.key]||(a.posMatrix=new Float64Array(16),q.ortho(a.posMatrix,0,8192,0,8192,0,1),this._tiles[a.key]=new dn(a,this.tileSize));for(let a in this._tiles)n[a]||delete this._tiles[a]}freeRtt(t){for(let i in this._tiles){let n=this._tiles[i];(!t||n.tileID.equals(t)||n.tileID.isChildOf(t)||t.isChildOf(n.tileID))&&(n.rtt=[])}}getRenderableTiles(){return this._renderableTilesKeys.map(t=>this.getTileByID(t))}getTileByID(t){return this._tiles[t]}getTerrainCoords(t){let i={};for(let n of this._renderableTilesKeys){let a=this._tiles[n].tileID;if(a.canonical.equals(t.canonical)){let o=t.clone();o.posMatrix=new Float64Array(16),q.ortho(o.posMatrix,0,8192,0,8192,0,1),i[n]=o}else if(a.canonical.isChildOf(t.canonical)){let o=t.clone();o.posMatrix=new Float64Array(16);let s=a.canonical.z-t.canonical.z,l=a.canonical.x-(a.canonical.x>>s<<s),c=a.canonical.y-(a.canonical.y>>s<<s),p=8192>>s;q.ortho(o.posMatrix,0,p,0,p,0,1),q.translate(o.posMatrix,o.posMatrix,[-l*p,-c*p,0]),i[n]=o}else if(t.canonical.isChildOf(a.canonical)){let o=t.clone();o.posMatrix=new Float64Array(16);let s=t.canonical.z-a.canonical.z,l=t.canonical.x-(t.canonical.x>>s<<s),c=t.canonical.y-(t.canonical.y>>s<<s),p=8192>>s;q.ortho(o.posMatrix,0,8192,0,8192,0,1),q.translate(o.posMatrix,o.posMatrix,[l*p,c*p,0]),q.scale(o.posMatrix,o.posMatrix,[1/2**s,1/2**s,0]),i[n]=o}}return i}getSourceTile(t,i){let n=this.sourceCache._source,a=t.overscaledZ-this.deltaZoom;if(a>n.maxzoom&&(a=n.maxzoom),a<n.minzoom)return null;this._sourceTileCache[t.key]||(this._sourceTileCache[t.key]=t.scaledTo(a).key);let o=this.sourceCache.getTileByID(this._sourceTileCache[t.key]);if(!(o&&o.dem)&&i)for(;a>=n.minzoom&&!(o&&o.dem);)o=this.sourceCache.getTileByID(t.scaledTo(a--).key);return o}tilesAfterTime(t=Date.now()){return Object.values(this._tiles).filter(i=>i.timeAdded>=t)}};u(vy,"TerrainSourceCache");var Yu=vy;var wy=class wy{constructor(e,t,i){this.painter=e,this.sourceCache=new Yu(t),this.options=i,this.exaggeration=typeof i.exaggeration=="number"?i.exaggeration:1,this.qualityFactor=2,this.meshSize=128,this._demMatrixCache={},this.coordsIndex=[],this._coordsTextureSize=1024}getDEMElevation(e,t,i,n=8192){var m;if(!(t>=0&&t<n&&i>=0&&i<n))return 0;let a=this.getTerrainData(e),o=(m=a.tile)==null?void 0:m.dem;if(!o)return 0;let s=Xi.transformMat4([],[t/n*8192,i/n*8192],a.u_terrain_matrix),l=[s[0]*o.dim,s[1]*o.dim],c=Math.floor(l[0]),p=Math.floor(l[1]),h=l[0]-c,f=l[1]-p;return o.get(c,p)*(1-h)*(1-f)+o.get(c+1,p)*h*(1-f)+o.get(c,p+1)*(1-h)*f+o.get(c+1,p+1)*h*f}getElevation(e,t,i,n=8192){return this.getDEMElevation(e,t,i,n)*this.exaggeration}getTerrainData(e){if(!this._emptyDemTexture){let n=this.painter.context,a=new Ee({width:1,height:1},new Uint8Array(1*4));this._emptyDepthTexture=new be(n,a,n.gl.RGBA,{premultiply:!1}),this._emptyDemUnpack=[0,0,0,0],this._emptyDemTexture=new be(n,new Ee({width:1,height:1}),n.gl.RGBA,{premultiply:!1}),this._emptyDemTexture.bind(n.gl.NEAREST,n.gl.CLAMP_TO_EDGE),this._emptyDemMatrix=q.identity([])}let t=this.sourceCache.getSourceTile(e,!0);if(t&&t.dem&&(!t.demTexture||t.needsTerrainPrepare)){let n=this.painter.context;t.demTexture=this.painter.getTileTexture(t.dem.stride),t.demTexture?t.demTexture.update(t.dem.getPixels(),{premultiply:!1}):t.demTexture=new be(n,t.dem.getPixels(),n.gl.RGBA,{premultiply:!1}),t.demTexture.bind(n.gl.NEAREST,n.gl.CLAMP_TO_EDGE),t.needsTerrainPrepare=!1}let i=t&&t+t.tileID.key+e.key;if(i&&!this._demMatrixCache[i]){let n=this.sourceCache.sourceCache._source.maxzoom,a=e.canonical.z-t.tileID.canonical.z;e.overscaledZ>e.canonical.z&&(e.canonical.z>=n?a=e.canonical.z-n:Ce("cannot calculate elevation if elevation maxzoom > source.maxzoom"));let o=e.canonical.x-(e.canonical.x>>a<<a),s=e.canonical.y-(e.canonical.y>>a<<a),l=q.fromScaling(new Float64Array(16),[1/(8192<<a),1/(8192<<a),0]);q.translate(l,l,[o*8192,s*8192,0]),this._demMatrixCache[e.key]={matrix:l,coord:e}}return{u_depth:2,u_terrain:3,u_terrain_dim:t&&t.dem&&t.dem.dim||1,u_terrain_matrix:i?this._demMatrixCache[e.key].matrix:this._emptyDemMatrix,u_terrain_unpack:t&&t.dem&&t.dem.getUnpackVector()||this._emptyDemUnpack,u_terrain_exaggeration:this.exaggeration,texture:(t&&t.demTexture||this._emptyDemTexture).texture,depthTexture:(this._fboDepthTexture||this._emptyDepthTexture).texture,tile:t}}getFramebuffer(e){let t=this.painter,i=t.width/devicePixelRatio,n=t.height/devicePixelRatio;return this._fbo&&(this._fbo.width!==i||this._fbo.height!==n)&&(this._fbo.destroy(),this._fboCoordsTexture.destroy(),this._fboDepthTexture.destroy(),delete this._fbo,delete this._fboDepthTexture,delete this._fboCoordsTexture),this._fboCoordsTexture||(this._fboCoordsTexture=new be(t.context,{width:i,height:n,data:null},t.context.gl.RGBA,{premultiply:!1}),this._fboCoordsTexture.bind(t.context.gl.NEAREST,t.context.gl.CLAMP_TO_EDGE)),this._fboDepthTexture||(this._fboDepthTexture=new be(t.context,{width:i,height:n,data:null},t.context.gl.RGBA,{premultiply:!1}),this._fboDepthTexture.bind(t.context.gl.NEAREST,t.context.gl.CLAMP_TO_EDGE)),this._fbo||(this._fbo=t.context.createFramebuffer(i,n,!0,!1),this._fbo.depthAttachment.set(t.context.createRenderbuffer(t.context.gl.DEPTH_COMPONENT16,i,n))),this._fbo.colorAttachment.set(e==="coords"?this._fboCoordsTexture.texture:this._fboDepthTexture.texture),this._fbo}getCoordsTexture(){let e=this.painter.context;if(this._coordsTexture)return this._coordsTexture;let t=new Uint8Array(this._coordsTextureSize*this._coordsTextureSize*4);for(let a=0,o=0;a<this._coordsTextureSize;a++)for(let s=0;s<this._coordsTextureSize;s++,o+=4)t[o+0]=s&255,t[o+1]=a&255,t[o+2]=s>>8<<4|a>>8,t[o+3]=0;let i=new Ee({width:this._coordsTextureSize,height:this._coordsTextureSize},new Uint8Array(t.buffer)),n=new be(e,i,e.gl.RGBA,{premultiply:!1});return n.bind(e.gl.NEAREST,e.gl.CLAMP_TO_EDGE),this._coordsTexture=n,n}pointCoordinate(e){let t=new Uint8Array(4),i=this.painter.context,n=i.gl;i.bindFramebuffer.set(this.getFramebuffer("coords").framebuffer),n.readPixels(e.x,this.painter.height/devicePixelRatio-e.y-1,1,1,n.RGBA,n.UNSIGNED_BYTE,t),i.bindFramebuffer.set(null);let a=t[0]+(t[2]>>4<<8),o=t[1]+((t[2]&15)<<8),s=this.coordsIndex[255-t[3]],l=s&&this.sourceCache.getTileByID(s);if(!l)return null;let c=this._coordsTextureSize,p=(1<<l.tileID.canonical.z)*c;return new ze((l.tileID.canonical.x*c+a)/p,(l.tileID.canonical.y*c+o)/p,this.getElevation(l.tileID,a,o,c))}getTerrainMesh(){if(this._mesh)return this._mesh;let e=this.painter.context,t=new xs,i=new nt,n=this.meshSize,a=8192/n,o=n*n;for(let h=0;h<=n;h++)for(let f=0;f<=n;f++)t.emplaceBack(f*a,h*a,0);for(let h=0;h<o;h+=n+1)for(let f=0;f<n;f++)i.emplaceBack(f+h,n+f+h+1,n+f+h+2),i.emplaceBack(f+h,n+f+h+2,f+h+1);let s=t.length,l=s+(n+1)*2;for(let h of[0,1])for(let f=0;f<=n;f++)for(let m of[0,1])t.emplaceBack(f*a,h*8192,m);for(let h=0;h<n*2;h+=2)i.emplaceBack(l+h,l+h+1,l+h+3),i.emplaceBack(l+h,l+h+3,l+h+2),i.emplaceBack(s+h,s+h+3,s+h+1),i.emplaceBack(s+h,s+h+2,s+h+3);let c=t.length,p=c+(n+1)*2;for(let h of[0,1])for(let f=0;f<=n;f++)for(let m of[0,1])t.emplaceBack(h*8192,f*a,m);for(let h=0;h<n*2;h+=2)i.emplaceBack(c+h,c+h+1,c+h+3),i.emplaceBack(c+h,c+h+3,c+h+2),i.emplaceBack(p+h,p+h+3,p+h+1),i.emplaceBack(p+h,p+h+2,p+h+3);return this._mesh={indexBuffer:e.createIndexBuffer(i),vertexBuffer:e.createVertexBuffer(t,U1.members),segments:me.simpleSegment(0,0,t.length,i.length)},this._mesh}getMeshFrameDelta(e){return 2*Math.PI*mi/Math.pow(2,e)/5}getMinMaxElevation(e){let t=this.getTerrainData(e).tile,i={minElevation:null,maxElevation:null};return t&&t.dem&&(i.minElevation=t.dem.min*this.exaggeration,i.maxElevation=t.dem.max*this.exaggeration),i}};u(wy,"Terrain");var Ju=wy;d();d();var Sy=class Sy{constructor(e,t,i){this._context=e;this._size=t;this._tileSize=i;this._objects=[],this._recentlyUsed=[],this._stamp=0}destruct(){for(let e of this._objects)e.texture.destroy(),e.fbo.destroy()}_createObject(e){let t=this._context.createFramebuffer(this._tileSize,this._tileSize,!0,!0),i=new be(this._context,{width:this._tileSize,height:this._tileSize,data:null},this._context.gl.RGBA);return i.bind(this._context.gl.LINEAR,this._context.gl.CLAMP_TO_EDGE),t.depthAttachment.set(this._context.createRenderbuffer(this._context.gl.DEPTH_STENCIL,this._tileSize,this._tileSize)),t.colorAttachment.set(i.texture),{id:e,fbo:t,texture:i,stamp:-1,inUse:!1}}getObjectForId(e){return this._objects[e]}useObject(e){e.inUse=!0,this._recentlyUsed=this._recentlyUsed.filter(t=>e.id!==t),this._recentlyUsed.push(e.id)}stampObject(e){e.stamp=++this._stamp}getOrCreateFreeObject(){for(let t of this._recentlyUsed)if(!this._objects[t].inUse)return this._objects[t];if(this._objects.length>=this._size)throw new Error("No free RenderPool available, call freeAllObjects() required!");let e=this._createObject(this._objects.length);return this._objects.push(e),e}freeObject(e){e.inUse=!1}freeAllObjects(){for(let e of this._objects)this.freeObject(e)}isFull(){return this._objects.length<this._size?!1:this._objects.some(e=>!e.inUse)===!1}};u(Sy,"RenderPool");var Qu=Sy;var Sn={background:!0,fill:!0,line:!0,raster:!0,hillshade:!0},Py=class Py{constructor(e,t){this.painter=e,this.terrain=t,this.pool=new Qu(e.context,30,t.sourceCache.tileSize*t.qualityFactor)}destruct(){this.pool.destruct()}getTexture(e){return this.pool.getObjectForId(e.rtt[this._stacks.length-1].id).texture}prepareForRender(e,t){this._stacks=[],this._prevType=null,this._rttTiles=[],this._renderableTiles=this.terrain.sourceCache.getRenderableTiles(),this._renderableLayerIds=e._order.filter(i=>!e._layers[i].isHidden(t)),this._coordsDescendingInv={};for(let i in e.sourceCaches){this._coordsDescendingInv[i]={};let n=e.sourceCaches[i].getVisibleCoordinates();for(let a of n){let o=this.terrain.sourceCache.getTerrainCoords(a);for(let s in o)this._coordsDescendingInv[i][s]||(this._coordsDescendingInv[i][s]=[]),this._coordsDescendingInv[i][s].push(o[s])}}this._coordsDescendingInvStr={};for(let i of e._order){let n=e._layers[i],a=n.source;if(Sn[n.type]&&!this._coordsDescendingInvStr[a]){this._coordsDescendingInvStr[a]={};for(let o in this._coordsDescendingInv[a])this._coordsDescendingInvStr[a][o]=this._coordsDescendingInv[a][o].map(s=>s.key).sort().join()}}for(let i of this._renderableTiles)for(let n in this._coordsDescendingInvStr){let a=this._coordsDescendingInvStr[n][i.tileID.key];a&&a!==i.rttCoords[n]&&(i.rtt=[])}}renderLayer(e){if(e.isHidden(this.painter.transform.zoom))return!1;let t=e.type,i=this.painter,n=this._renderableLayerIds[this._renderableLayerIds.length-1]===e.id;if(Sn[t]&&((!this._prevType||!Sn[this._prevType])&&this._stacks.push([]),this._prevType=t,this._stacks[this._stacks.length-1].push(e.id),!n))return!0;if(Sn[this._prevType]||Sn[t]&&n){this._prevType=t;let a=this._stacks.length-1,o=this._stacks[a]||[];for(let s of this._renderableTiles){if(this.pool.isFull()&&(ay(this.painter,this.terrain,this._rttTiles),this._rttTiles=[],this.pool.freeAllObjects()),this._rttTiles.push(s),s.rtt[a]){let c=this.pool.getObjectForId(s.rtt[a].id);if(c.stamp===s.rtt[a].stamp){this.pool.useObject(c);continue}}let l=this.pool.getOrCreateFreeObject();this.pool.useObject(l),this.pool.stampObject(l),s.rtt[a]={id:l.id,stamp:l.stamp},i.context.bindFramebuffer.set(l.fbo.framebuffer),i.context.clear({color:K.transparent,stencil:0}),i.currentStencilSource=void 0;for(let c=0;c<o.length;c++){let p=i.style._layers[o[c]],h=p.source?this._coordsDescendingInv[p.source][s.tileID.key]:[s.tileID];i.context.viewport.set([0,0,l.fbo.width,l.fbo.height]),i._renderTileClippingMasks(p,h),i.renderLayer(i,i.style.sourceCaches[p.source],p,h),p.source&&(s.rttCoords[p.source]=this._coordsDescendingInvStr[p.source][s.tileID.key])}}return ay(this.painter,this.terrain,this._rttTiles),this._rttTiles=[],this.pool.freeAllObjects(),Sn[t]}return!1}};u(Py,"RenderToTexture");var ec=Py;var eE=po.version,rc=-2,N1=22,Or=0,G1=90,tc=90,tE={center:[0,0],zoom:0,bearing:0,pitch:0,minZoom:rc,maxZoom:N1,minPitch:Or,maxPitch:G1,interactive:!0,scrollZoom:!0,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,touchPitch:!0,cooperativeGestures:void 0,bearingSnap:7,clickTolerance:3,pitchWithRotate:!0,hash:!1,attributionControl:!0,maplibreLogo:!1,failIfMajorPerformanceCaveat:!1,preserveDrawingBuffer:!1,trackResize:!0,renderWorldCopies:!0,refreshExpiredTiles:!0,maxTileCacheSize:null,maxTileCacheZoomLevels:it.MAX_TILE_CACHE_ZOOM_LEVELS,localIdeographFontFamily:"sans-serif",transformRequest:null,transformCameraUpdate:null,fadeDuration:300,crossSourceCollisions:!0,validateStyle:!0,maxCanvasSize:[4096,4096]},Ty=class Ty extends Zu{constructor(t){if(Rr.mark("create"),t=R({},tE,t),t.minZoom!=null&&t.maxZoom!=null&&t.minZoom>t.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(t.minPitch!=null&&t.maxPitch!=null&&t.minPitch>t.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(t.minPitch!=null&&t.minPitch<Or)throw new Error("minPitch must be greater than or equal to ".concat(Or));if(t.maxPitch!=null&&t.maxPitch>tc)throw new Error("maxPitch must be less than or equal to ".concat(tc));let i=new Ou(t.minZoom,t.maxZoom,t.minPitch,t.maxPitch,t.renderWorldCopies);super(i,{bearingSnap:t.bearingSnap});this._cooperativeGesturesOnWheel=u(t=>{this._onCooperativeGesture(t,t[this._metaKey],1)},"_cooperativeGesturesOnWheel");this._contextLost=u(t=>{t.preventDefault(),this._frame&&(this._frame.cancel(),this._frame=null),this.fire(new z("webglcontextlost",{originalEvent:t}))},"_contextLost");this._contextRestored=u(t=>{this._setupPainter(),this.resize(),this._update(),this.fire(new z("webglcontextrestored",{originalEvent:t}))},"_contextRestored");this._onMapScroll=u(t=>{if(t.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1},"_onMapScroll");this._onWindowOnline=u(()=>{this._update()},"_onWindowOnline");if(this._interactive=t.interactive,this._cooperativeGestures=t.cooperativeGestures,this._metaKey=navigator.platform.indexOf("Mac")===0?"metaKey":"ctrlKey",this._maxTileCacheSize=t.maxTileCacheSize,this._maxTileCacheZoomLevels=t.maxTileCacheZoomLevels,this._failIfMajorPerformanceCaveat=t.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=t.preserveDrawingBuffer,this._antialias=t.antialias,this._trackResize=t.trackResize,this._bearingSnap=t.bearingSnap,this._refreshExpiredTiles=t.refreshExpiredTiles,this._fadeDuration=t.fadeDuration,this._crossSourceCollisions=t.crossSourceCollisions,this._crossFadingFactor=1,this._collectResourceTiming=t.collectResourceTiming,this._renderTaskQueue=new Wu,this._controls=[],this._mapId=fo(),this._locale=R({},V1,t.locale),this._clickTolerance=t.clickTolerance,this._overridePixelRatio=t.pixelRatio,this._maxCanvasSize=t.maxCanvasSize,this.transformCameraUpdate=t.transformCameraUpdate,this._imageQueueHandle=ot.addThrottleControl(()=>this.isMoving()),this._requestManager=new bo(t.transformRequest),this._canvas=t.canvas,this._canvasContainer=t.canvasContainer,typeof t.container=="string"){if(this._container=document.getElementById(t.container),!this._container)throw new Error("Container '".concat(t.container,"' not found."))}else if(t.container instanceof HTMLElement)this._container=t.container;else throw new Error("Invalid type: 'container' must be a String or HTMLElement.");if(t.maxBounds&&this.setMaxBounds(t.maxBounds),this._setupContainer(),this._setupPainter(),this.on("move",()=>this._update(!1)),this.on("moveend",()=>this._update(!1)),this.on("zoom",()=>this._update(!0)),this.on("terrain",()=>{this.painter.terrainFacilitator.dirty=!0,this._update(!0)}),this.once("idle",()=>{this._idleTriggered=!0}),typeof window<"u"){addEventListener("online",this._onWindowOnline,!1);let a=!1;this._resizeObserver=new ResizeObserver(o=>{if(!a){a=!0;return}this._trackResize&&this.resize(o)._update()}),this._resizeObserver.observe(this._container)}this.handlers=new Hu(this,t),this._cooperativeGestures&&this._setupCooperativeGestures();let n=typeof t.hash=="string"&&t.hash||void 0;this._hash=t.hash&&new Uu(n).addTo(this),(!this._hash||!this._hash._onHashChange())&&(this.jumpTo({center:t.center,zoom:t.zoom,bearing:t.bearing,pitch:t.pitch}),t.bounds&&(this.resize(),this.fitBounds(t.bounds,R({},t.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=t.localIdeographFontFamily,this._validateStyle=t.validateStyle,t.style&&this.setStyle(t.style,{localIdeographFontFamily:t.localIdeographFontFamily}),t.attributionControl&&this.addControl(new _n({customAttribution:t.customAttribution})),t.maplibreLogo&&this.addControl(new vn,t.logoPosition),this.on("style.load",()=>{this.transform.unmodified&&this.jumpTo(this.style.stylesheet)}),this.on("data",a=>{this._update(a.dataType==="style"),this.fire(new z("".concat(a.dataType,"data"),a))}),this.on("dataloading",a=>{this.fire(new z("".concat(a.dataType,"dataloading"),a))}),this.on("dataabort",a=>{this.fire(new z("sourcedataabort",a))})}_getMapId(){return this._mapId}addControl(t,i){return i===void 0&&(t.getDefaultPosition?i=t.getDefaultPosition():i="top-right"),!t||!t.onAdd?this.fire(new Z(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods."))):this}removeControl(t){if(!t||!t.onRemove)return this.fire(new Z(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));let i=this._controls.indexOf(t);return i>-1&&this._controls.splice(i,1),t.onRemove(this),this}hasControl(t){return this._controls.indexOf(t)>-1}calculateCameraOptionsFromTo(t,i,n,a){return a==null&&this.terrain&&(a=this.transform.getElevation(n,this.terrain)),super.calculateCameraOptionsFromTo(t,i,n,a)}resize(t){var l;let i=this._containerDimensions(),n=i[0],a=i[1],o=this._getClampedPixelRatio(n,a);if(this.painter.resize(n,a,o),this.painter.overLimit()){let c=this.painter.context.gl;this._maxCanvasSize=[c.drawingBufferWidth,c.drawingBufferHeight];let p=this._getClampedPixelRatio(n,a);this._resizeCanvas(n,a,p),this.painter.resize(n,a,p)}this.transform.resize(n,a),(l=this._requestedCameraState)==null||l.resize(n,a);let s=!this._moving;return s&&(this.stop(),this.fire(new z("movestart",t)).fire(new z("move",t))),this.fire(new z("resize",t)),s&&this.fire(new z("moveend",t)),this}_getClampedPixelRatio(t,i){let{0:n,1:a}=this._maxCanvasSize,o=this.getPixelRatio(),s=t*o,l=i*o,c=s>n?n/s:1,p=l>a?a/l:1;return Math.min(c,p)*o}getPixelRatio(){var t;return(t=this._overridePixelRatio)!=null?t:devicePixelRatio}setPixelRatio(t){this._overridePixelRatio=t,this.resize()}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()}setMaxBounds(t){return this.transform.setMaxBounds(lt.convert(t)),this._update()}setMinZoom(t){if(t=t==null?rc:t,t>=rc&&t<=this.transform.maxZoom)return this.transform.minZoom=t,this._update(),this.getZoom()<t&&this.setZoom(t),this;throw new Error("minZoom must be between ".concat(rc," and the current maxZoom, inclusive"))}getMinZoom(){return this.transform.minZoom}setMaxZoom(t){if(t=t==null?N1:t,t>=this.transform.minZoom)return this.transform.maxZoom=t,this._update(),this.getZoom()>t&&this.setZoom(t),this;throw new Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this.transform.maxZoom}setMinPitch(t){if(t=t==null?Or:t,t<Or)throw new Error("minPitch must be greater than or equal to ".concat(Or));if(t>=Or&&t<=this.transform.maxPitch)return this.transform.minPitch=t,this._update(),this.getPitch()<t&&this.setPitch(t),this;throw new Error("minPitch must be between ".concat(Or," and the current maxPitch, inclusive"))}getMinPitch(){return this.transform.minPitch}setMaxPitch(t){if(t=t==null?G1:t,t>tc)throw new Error("maxPitch must be less than or equal to ".concat(tc));if(t>=this.transform.minPitch)return this.transform.maxPitch=t,this._update(),this.getPitch()>t&&this.setPitch(t),this;throw new Error("maxPitch must be greater than the current minPitch")}getMaxPitch(){return this.transform.maxPitch}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(t){return this.transform.renderWorldCopies=t,this._update()}getCooperativeGestures(){return this._cooperativeGestures}setCooperativeGestures(t){return this._cooperativeGestures=t,this._cooperativeGestures?this._setupCooperativeGestures():this._destroyCooperativeGestures(),this}project(t){return this.transform.locationPoint(re.convert(t),this.style&&this.terrain)}unproject(t){return this.transform.pointLocation(lr.default.convert(t),this.terrain)}isMoving(){var t;return this._moving||((t=this.handlers)==null?void 0:t.isMoving())}isZooming(){return this._zooming||!1}isRotating(){var t;return this._rotating||((t=this.handlers)==null?void 0:t.isRotating())}_createDelegatedListener(t,i,n){if(t==="mouseenter"||t==="mouseover"){let a=!1;return{layer:i,listener:n,delegates:{mousemove:u(l=>{let c=this.getLayer(i)?this.queryRenderedFeatures(l.point,{layers:[i]}):[];c.length?a||(a=!0,n.call(this,new wn(t,this,l.originalEvent,{features:c}))):a=!1},"mousemove"),mouseout:u(()=>{a=!1},"mouseout")}}}else if(t==="mouseleave"||t==="mouseout"){let a=!1;return{layer:i,listener:n,delegates:{mousemove:u(l=>{(this.getLayer(i)?this.queryRenderedFeatures(l.point,{layers:[i]}):[]).length?a=!0:a&&(a=!1,n.call(this,new wn(t,this,l.originalEvent)))},"mousemove"),mouseout:u(l=>{a&&(a=!1,n.call(this,new wn(t,this,l.originalEvent)))},"mouseout")}}}else{let a=u(o=>{let s=this.getLayer(i)?this.queryRenderedFeatures(o.point,{layers:[i]}):[];s.length&&(o.features=s,n.call(this,o),delete o.features)},"delegate");return{layer:i,listener:n,delegates:{[t]:a}}}}on(t,i,n){if(n===void 0)return super.on(t,i);let a=this._createDelegatedListener(t,i,n);this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[t]=this._delegatedListeners[t]||[],this._delegatedListeners[t].push(a);for(let o in a.delegates)this.on(o,a.delegates[o]);return this}once(t,i,n){if(n===void 0)return super.once(t,i);let a=this._createDelegatedListener(t,i,n);for(let o in a.delegates)this.once(o,a.delegates[o]);return this}off(t,i,n){if(n===void 0)return super.off(t,i);let a=u(o=>{let s=o[t];for(let l=0;l<s.length;l++){let c=s[l];if(c.layer===i&&c.listener===n){for(let p in c.delegates)this.off(p,c.delegates[p]);return s.splice(l,1),this}}},"removeDelegatedListener");return this._delegatedListeners&&this._delegatedListeners[t]&&a(this._delegatedListeners),this}queryRenderedFeatures(t,i){if(!this.style)return[];let n,a=t instanceof lr.default||Array.isArray(t),o=a?t:[[0,0],[this.transform.width,this.transform.height]];if(i=i||(a?{}:t)||{},o instanceof lr.default||typeof o[0]=="number")n=[lr.default.convert(o)];else{let s=lr.default.convert(o[0]),l=lr.default.convert(o[1]);n=[s,new lr.default(l.x,s.y),l,new lr.default(s.x,l.y),s]}return this.style.queryRenderedFeatures(n,i,this.transform)}querySourceFeatures(t,i){return this.style.querySourceFeatures(t,i)}setStyle(t,i){return i=R({},{localIdeographFontFamily:this._localIdeographFontFamily,validate:this._validateStyle},i),i.diff!==!1&&i.localIdeographFontFamily===this._localIdeographFontFamily&&this.style&&t?(this._diffStyle(t,i),this):(this._localIdeographFontFamily=i.localIdeographFontFamily,this._updateStyle(t,i))}setTransformRequest(t){return this._requestManager.setTransformRequest(t),this}_getUIString(t){let i=this._locale[t];if(i==null)throw new Error("Missing UI string '".concat(t,"'"));return i}_updateStyle(t,i){if(i.transformStyle&&this.style&&!this.style._loaded){this.style.once("style.load",()=>this._updateStyle(t,i));return}let n=this.style&&i.transformStyle?this.style.serialize():void 0;if(this.style&&(this.style.setEventedParent(null),this.style._remove(!t)),t)this.style=new Br(this,i||{});else return delete this.style,this;return this.style.setEventedParent(this,{style:this.style}),typeof t=="string"?this.style.loadURL(t,i,n):this.style.loadJSON(t,i,n),this}_lazyInitEmptyStyle(){this.style||(this.style=new Br(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}_diffStyle(t,i){if(typeof t=="string"){let n=t,a=this._requestManager.transformRequest(n,"Style");fr(a,(o,s)=>{o?this.fire(new Z(o)):s&&this._updateDiff(s,i)})}else typeof t=="object"&&this._updateDiff(t,i)}_updateDiff(t,i){try{this.style.setState(t,i)&&this._update(!0)}catch(n){Ce("Unable to perform style diff: ".concat(n.message||n.error||n,". Rebuilding the style from scratch.")),this._updateStyle(t,i)}}getStyle(){if(this.style)return this.style.serialize()}isStyleLoaded(){return this.style?this.style.loaded():Ce("There is no style added to the map.")}addSource(t,i){return this._lazyInitEmptyStyle(),this.style.addSource(t,i),this._update(!0)}isSourceLoaded(t){let i=this.style&&this.style.sourceCaches[t];if(i===void 0){this.fire(new Z(new Error("There is no source with ID '".concat(t,"'"))));return}return i.loaded()}setTerrain(t){if(this.style._checkLoaded(),this._terrainDataCallback&&this.style.off("data",this._terrainDataCallback),!t)this.terrain&&this.terrain.sourceCache.destruct(),this.terrain=null,this.painter.renderToTexture&&this.painter.renderToTexture.destruct(),this.painter.renderToTexture=null,this.transform.updateElevation(this.terrain);else{let i=this.style.sourceCaches[t.source];if(!i)throw new Error("cannot load terrain, because there exists no source with ID: ".concat(t.source));for(let n in this.style._layers){let a=this.style._layers[n];a.type==="hillshade"&&a.source===t.source&&Ce("You are using the same source for a hillshade layer and for 3D terrain. Please consider using two separate sources to improve rendering quality.")}this.terrain=new Ju(this.painter,i,t),this.painter.renderToTexture=new ec(this.painter,this.terrain),this.transform.updateElevation(this.terrain),this._terrainDataCallback=n=>{n.dataType==="style"?this.terrain.sourceCache.freeRtt():n.dataType==="source"&&n.tile&&(n.sourceId===t.source&&this.transform.updateElevation(this.terrain),this.terrain.sourceCache.freeRtt(n.tile.tileID))},this.style.on("data",this._terrainDataCallback)}return this.fire(new z("terrain",{terrain:t})),this}getTerrain(){return this.terrain&&this.terrain.options}areTilesLoaded(){let t=this.style&&this.style.sourceCaches;for(let i in t){let a=t[i]._tiles;for(let o in a){let s=a[o];if(!(s.state==="loaded"||s.state==="errored"))return!1}}return!0}addSourceType(t,i,n){return this._lazyInitEmptyStyle(),this.style.addSourceType(t,i,n)}removeSource(t){return this.style.removeSource(t),this._update(!0)}getSource(t){return this.style.getSource(t)}addImage(t,i,n={}){let{pixelRatio:a=1,sdf:o=!1,stretchX:s,stretchY:l,content:c}=n;this._lazyInitEmptyStyle();let p=0;if(i instanceof HTMLImageElement||Ct(i)){let{width:h,height:f,data:m}=ne.getImageData(i);this.style.addImage(t,{data:new Ee({width:h,height:f},m),pixelRatio:a,stretchX:s,stretchY:l,content:c,sdf:o,version:p})}else{if(i.width===void 0||i.height===void 0)return this.fire(new Z(new Error("Invalid arguments to map.addImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));{let{width:h,height:f,data:m}=i,g=i;return this.style.addImage(t,{data:new Ee({width:h,height:f},new Uint8Array(m)),pixelRatio:a,stretchX:s,stretchY:l,content:c,sdf:o,version:p,userImage:g}),g.onAdd&&g.onAdd(this,t),this}}}updateImage(t,i){let n=this.style.getImage(t);if(!n)return this.fire(new Z(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));let a=i instanceof HTMLImageElement||Ct(i)?ne.getImageData(i):i,{width:o,height:s,data:l}=a;if(o===void 0||s===void 0)return this.fire(new Z(new Error("Invalid arguments to map.updateImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));if(o!==n.data.width||s!==n.data.height)return this.fire(new Z(new Error("The width and height of the updated image must be that same as the previous version of the image")));let c=!(i instanceof HTMLImageElement||Ct(i));return n.data.replace(l,c),this.style.updateImage(t,n),this}getImage(t){return this.style.getImage(t)}hasImage(t){return t?!!this.style.getImage(t):(this.fire(new Z(new Error("Missing required image id"))),!1)}removeImage(t){this.style.removeImage(t)}loadImage(t,i){ot.getImage(this._requestManager.transformRequest(t,"Image"),i)}listImages(){return this.style.listImages()}addLayer(t,i){return this._lazyInitEmptyStyle(),this.style.addLayer(t,i),this._update(!0)}moveLayer(t,i){return this.style.moveLayer(t,i),this._update(!0)}removeLayer(t){return this.style.removeLayer(t),this._update(!0)}getLayer(t){return this.style.getLayer(t)}setLayerZoomRange(t,i,n){return this.style.setLayerZoomRange(t,i,n),this._update(!0)}setFilter(t,i,n={}){return this.style.setFilter(t,i,n),this._update(!0)}getFilter(t){return this.style.getFilter(t)}setPaintProperty(t,i,n,a={}){return this.style.setPaintProperty(t,i,n,a),this._update(!0)}getPaintProperty(t,i){return this.style.getPaintProperty(t,i)}setLayoutProperty(t,i,n,a={}){return this.style.setLayoutProperty(t,i,n,a),this._update(!0)}getLayoutProperty(t,i){return this.style.getLayoutProperty(t,i)}setGlyphs(t,i={}){return this._lazyInitEmptyStyle(),this.style.setGlyphs(t,i),this._update(!0)}getGlyphs(){return this.style.getGlyphsUrl()}addSprite(t,i,n={}){return this._lazyInitEmptyStyle(),this.style.addSprite(t,i,n,a=>{a||this._update(!0)}),this}removeSprite(t){return this._lazyInitEmptyStyle(),this.style.removeSprite(t),this._update(!0)}getSprite(){return this.style.getSprite()}setSprite(t,i={}){return this._lazyInitEmptyStyle(),this.style.setSprite(t,i,n=>{n||this._update(!0)}),this}setLight(t,i={}){return this._lazyInitEmptyStyle(),this.style.setLight(t,i),this._update(!0)}getLight(){return this.style.getLight()}setFeatureState(t,i){return this.style.setFeatureState(t,i),this._update()}removeFeatureState(t,i){return this.style.removeFeatureState(t,i),this._update()}getFeatureState(t){return this.style.getFeatureState(t)}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}_containerDimensions(){let t=0,i=0;return this._container&&(t=this._container.clientWidth||400,i=this._container.clientHeight||300),[t,i]}_setupContainer(){let t=this._container,i=this._containerDimensions(),n=this._getClampedPixelRatio(i[0],i[1]);this._resizeCanvas(i[0],i[1],n)}_setupCooperativeGestures(){let t=this._container;this._cooperativeGesturesScreen=B.create("div","maplibregl-cooperative-gesture-screen",t);let i=typeof this._cooperativeGestures!="boolean"&&this._cooperativeGestures.windowsHelpText?this._cooperativeGestures.windowsHelpText:"Use Ctrl + scroll to zoom the map";navigator.platform.indexOf("Mac")===0&&(i=typeof this._cooperativeGestures!="boolean"&&this._cooperativeGestures.macHelpText?this._cooperativeGestures.macHelpText:"Use \u2318 + scroll to zoom the map");let n=typeof this._cooperativeGestures!="boolean"&&this._cooperativeGestures.mobileHelpText?this._cooperativeGestures.mobileHelpText:"Use two fingers to move the map";this._cooperativeGesturesScreen.innerHTML='\n <div class="maplibregl-desktop-message">'.concat(i,'</div>\n <div class="maplibregl-mobile-message">').concat(n,"</div>\n "),this._cooperativeGesturesScreen.setAttribute("aria-hidden","true"),this._canvasContainer.addEventListener("wheel",this._cooperativeGesturesOnWheel,!1),this._canvasContainer.classList.add("maplibregl-cooperative-gestures")}_destroyCooperativeGestures(){B.remove(this._cooperativeGesturesScreen),this._canvasContainer.removeEventListener("wheel",this._cooperativeGesturesOnWheel,!1),this._canvasContainer.classList.remove("maplibregl-cooperative-gestures")}_resizeCanvas(t,i,n){}_setupPainter(){let t={alpha:!0,stencil:!0,depth:!0,failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1},i=null;this._canvas.addEventListener("webglcontextcreationerror",a=>{i={requestedAttributes:t},a&&(i.statusMessage=a.statusMessage,i.type=a.type)},{once:!0});let n=this._canvas.getContext("webgl2",t)||this._canvas.getContext("webgl",t);if(!n){let a="Failed to initialize WebGL";throw i?(i.message=a,new Error(JSON.stringify(i))):new Error(a)}this.painter=new Lu(n,this.transform),In.testSupport(n)}_onCooperativeGesture(t,i,n){return!i&&n<2&&(this._cooperativeGesturesScreen.classList.add("maplibregl-show"),setTimeout(()=>{this._cooperativeGesturesScreen.classList.remove("maplibregl-show")},100)),!1}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}_update(t){return!this.style||!this.style._loaded?this:(this._styleDirty=this._styleDirty||t,this._sourcesDirty=!0,this.triggerRepaint(),this)}_requestRenderFrame(t){return this._update(),this._renderTaskQueue.add(t)}_cancelRenderFrame(t){this._renderTaskQueue.remove(t)}_render(t){let i=this._idleTriggered?this._fadeDuration:0;if(this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(t),this._removed)return;let n=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;let o=this.transform.zoom,s=ne.now();this.style.zoomHistory.update(o,s);let l=new ye(o,{now:s,fadeDuration:i,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),c=l.crossFadingFactor();(c!==1||c!==this._crossFadingFactor)&&(n=!0,this._crossFadingFactor=c),this.style.update(l)}this.style&&this._sourcesDirty&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this.terrain&&this.terrain.sourceCache.update(this.transform,this.terrain),this.transform.updateElevation(this.terrain),this._placementDirty=this.style&&this.style._updatePlacement(this.painter.transform,this.showCollisionBoxes,i,this._crossSourceCollisions),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:!1,zooming:!1,moving:!1,fadeDuration:i,showPadding:this.showPadding}),this.fire(new z("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,Rr.mark("load"),this.fire(new z("load"))),this.style&&(this.style.hasTransitions()||n)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles();let a=this._sourcesDirty||this._styleDirty||this._placementDirty;return a||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new z("idle")),this._loaded&&!this._fullyLoaded&&!a&&(this._fullyLoaded=!0,Rr.mark("fullLoad")),this._fullyLoaded=!0,this}redraw(){return this.style&&(this._frame&&(this._frame.cancel(),this._frame=null),this._render(0)),this}remove(){var i;this._hash&&this._hash.remove();for(let n of this._controls)n.onRemove(this);this._controls=[],this._frame&&(this._frame.cancel(),this._frame=null),this._renderTaskQueue.clear(),this.painter.destroy(),this.handlers.destroy(),delete this.handlers,this.setStyle(null),typeof window<"u"&&removeEventListener("online",this._onWindowOnline,!1),ot.removeThrottleControl(this._imageQueueHandle),(i=this._resizeObserver)==null||i.disconnect();let t=this.painter.context.gl.getExtension("WEBGL_lose_context");t&&t.loseContext(),this._canvas.removeEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.removeEventListener("webglcontextlost",this._contextLost,!1),B.remove(this._canvasContainer),B.remove(this._controlContainer),this._cooperativeGestures&&this._destroyCooperativeGestures(),this._container.classList.remove("maplibregl-map"),Rr.clearMetrics(),this._removed=!0,this.fire(new z("remove"))}triggerRepaintSync(){this._render(performance.now())}triggerRepaint(){this.style&&!this._frame&&(this._frame=ne.frame(t=>{Rr.frame(t),this._frame=null,this._render(t)}))}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(t){this._showTileBoundaries!==t&&(this._showTileBoundaries=t,this._update())}get showPadding(){return!!this._showPadding}set showPadding(t){this._showPadding!==t&&(this._showPadding=t,this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(t){this._showCollisionBoxes!==t&&(this._showCollisionBoxes=t,t?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(t){this._showOverdrawInspector!==t&&(this._showOverdrawInspector=t,this._update())}get repaint(){return!!this._repaint}set repaint(t){this._repaint!==t&&(this._repaint=t,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(t){this._vertices=t,this._update()}get version(){return eE}getCameraTargetElevation(){return this.transform.elevation}};u(Ty,"Map");var ic=Ty;d();d();d();var Ay=class Ay{constructor(e){this._enabled=!!e.enable,this._moveStateManager=e.moveStateManager,this._clickTolerance=e.clickTolerance||1,this._moveFunction=e.move,this._activateOnStart=!!e.activateOnStart,e.assignEvents(this),this.reset()}reset(e){this._active=!1,this._moved=!1,delete this._lastPoint,this._moveStateManager.endMove(e)}_move(...e){let t=this._moveFunction(...e);if(t.bearingDelta||t.pitchDelta||t.around||t.panDelta)return this._active=!0,t}dragStart(e,t){!this.isEnabled()||this._lastPoint||this._moveStateManager.isValidStartEvent(e)&&(this._moveStateManager.startMove(e),this._lastPoint=t.length?t[0]:t,this._activateOnStart&&this._lastPoint&&(this._active=!0))}dragMove(e,t){if(!this.isEnabled())return;let i=this._lastPoint;if(!i)return;if(e.preventDefault(),!this._moveStateManager.isValidMoveEvent(e)){this.reset(e);return}let n=t.length?t[0]:t;if(!(!this._moved&&n.dist(i)<this._clickTolerance))return this._moved=!0,this._lastPoint=n,this._move(i,n)}dragEnd(e){!this.isEnabled()||!this._lastPoint||this._moveStateManager.isValidEndEvent(e)&&(this._moved&&B.suppressClick(),this.reset(e))}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}getClickTolerance(){return this._clickTolerance}};u(Ay,"DragHandler");var Vr=Ay;d();var rE=0,iE=2,nE={[rE]:1,[iE]:2};function aE(r,e){let t=nE[e];return r.buttons===void 0||(r.buttons&t)!==t}u(aE,"buttonNoLongerPressed");var Iy=class Iy{constructor(e){this._correctEvent=e.checkCorrectEvent}startMove(e){let t=B.mouseButton(e);this._eventButton=t}endMove(e){delete this._eventButton}isValidStartEvent(e){return this._correctEvent(e)}isValidMoveEvent(e){return!aE(e,this._eventButton)}isValidEndEvent(e){return B.mouseButton(e)===this._eventButton}};u(Iy,"MouseMoveStateManager");var ao=Iy,My=class My{constructor(){this._firstTouch=void 0}_isOneFingerTouch(e){return e.targetTouches.length===1}_isSameTouchEvent(e){return e.targetTouches[0].identifier===this._firstTouch}startMove(e){let t=e.targetTouches[0].identifier;this._firstTouch=t}endMove(e){delete this._firstTouch}isValidStartEvent(e){return this._isOneFingerTouch(e)}isValidMoveEvent(e){return this._isOneFingerTouch(e)&&this._isSameTouchEvent(e)}isValidEndEvent(e){return this._isOneFingerTouch(e)&&this._isSameTouchEvent(e)}};u(My,"OneFingerTouchMoveStateManager");var oo=My;var q1=0,j1=2,$1=u(r=>{r.mousedown=r.dragStart,r.mousemoveWindow=r.dragMove,r.mouseup=r.dragEnd,r.contextmenu=function(e){e.preventDefault()}},"assignEvents");var H1=u(({enable:r,clickTolerance:e,bearingDegreesPerPixelMoved:t=.8})=>{let i=new ao({checkCorrectEvent:n=>B.mouseButton(n)===q1&&n.ctrlKey||B.mouseButton(n)===j1});return new Vr({clickTolerance:e,move:(n,a)=>({bearingDelta:(a.x-n.x)*t}),moveStateManager:i,enable:r,assignEvents:$1})},"generateMouseRotationHandler"),Z1=u(({enable:r,clickTolerance:e,pitchDegreesPerPixelMoved:t=-.5})=>{let i=new ao({checkCorrectEvent:n=>B.mouseButton(n)===q1&&n.ctrlKey||B.mouseButton(n)===j1});return new Vr({clickTolerance:e,move:(n,a)=>({pitchDelta:(a.y-n.y)*t}),moveStateManager:i,enable:r,assignEvents:$1})},"generateMousePitchHandler");d();var W1=u(r=>{r.touchstart=r.dragStart,r.touchmoveWindow=r.dragMove,r.touchend=r.dragEnd},"assignEvents"),X1=u(({enable:r,clickTolerance:e,bearingDegreesPerPixelMoved:t=.8})=>{let i=new oo;return new Vr({clickTolerance:e,move:(n,a)=>({bearingDelta:(a.x-n.x)*t}),moveStateManager:i,enable:r,assignEvents:W1})},"generateOneFingerTouchRotationHandler"),K1=u(({enable:r,clickTolerance:e,pitchDegreesPerPixelMoved:t=-.5})=>{let i=new oo;return new Vr({clickTolerance:e,move:(n,a)=>({pitchDelta:(a.y-n.y)*t}),moveStateManager:i,enable:r,assignEvents:W1})},"generateOneFingerTouchPitchHandler");var oE={showCompass:!0,showZoom:!0,visualizePitch:!1},Ey=class Ey{constructor(e){this._updateZoomButtons=u(()=>{let e=this._map.getZoom(),t=e===this._map.getMaxZoom(),i=e===this._map.getMinZoom();this._zoomInButton.disabled=t,this._zoomOutButton.disabled=i,this._zoomInButton.setAttribute("aria-disabled",t.toString()),this._zoomOutButton.setAttribute("aria-disabled",i.toString())},"_updateZoomButtons");this._rotateCompassArrow=u(()=>{let e=this.options.visualizePitch?"scale(".concat(1/Math.pow(Math.cos(this._map.transform.pitch*(Math.PI/180)),.5),") rotateX(").concat(this._map.transform.pitch,"deg) rotateZ(").concat(this._map.transform.angle*(180/Math.PI),"deg)"):"rotate(".concat(this._map.transform.angle*(180/Math.PI),"deg)");this._compassIcon.style.transform=e},"_rotateCompassArrow");this._setButtonTitle=u((e,t)=>{let i=this._map._getUIString("NavigationControl.".concat(t));e.title=i,e.setAttribute("aria-label",i)},"_setButtonTitle");this.options=R({},oE,e),this._container=B.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._container.addEventListener("contextmenu",t=>t.preventDefault()),this.options.showZoom&&(this._zoomInButton=this._createButton("maplibregl-ctrl-zoom-in",t=>this._map.zoomIn({},{originalEvent:t})),B.create("span","maplibregl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden","true"),this._zoomOutButton=this._createButton("maplibregl-ctrl-zoom-out",t=>this._map.zoomOut({},{originalEvent:t})),B.create("span","maplibregl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(this._compass=this._createButton("maplibregl-ctrl-compass",t=>{this.options.visualizePitch?this._map.resetNorthPitch({},{originalEvent:t}):this._map.resetNorth({},{originalEvent:t})}),this._compassIcon=B.create("span","maplibregl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}onAdd(e){return this._map=e,this.options.showZoom&&(this._setButtonTitle(this._zoomInButton,"ZoomIn"),this._setButtonTitle(this._zoomOutButton,"ZoomOut"),this._map.on("zoom",this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this._setButtonTitle(this._compass,"ResetBearing"),this.options.visualizePitch&&this._map.on("pitch",this._rotateCompassArrow),this._map.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new Cy(this._map,this._compass,this.options.visualizePitch)),this._container}onRemove(){B.remove(this._container),this.options.showZoom&&this._map.off("zoom",this._updateZoomButtons),this.options.showCompass&&(this.options.visualizePitch&&this._map.off("pitch",this._rotateCompassArrow),this._map.off("rotate",this._rotateCompassArrow),this._handler.off(),delete this._handler),delete this._map}_createButton(e,t){let i=B.create("button",e,this._container);return i.type="button",i.addEventListener("click",t),i}};u(Ey,"NavigationControl");var nc=Ey,ky=class ky{constructor(e,t,i=!1){this.mousedown=u(e=>{this.startMouse(R({},e,{ctrlKey:!0,preventDefault:()=>e.preventDefault()}),B.mousePos(this.element,e)),B.addEventListener(window,"mousemove",this.mousemove),B.addEventListener(window,"mouseup",this.mouseup)},"mousedown");this.mousemove=u(e=>{this.moveMouse(e,B.mousePos(this.element,e))},"mousemove");this.mouseup=u(e=>{this.mouseRotate.dragEnd(e),this.mousePitch&&this.mousePitch.dragEnd(e),this.offTemp()},"mouseup");this.touchstart=u(e=>{e.targetTouches.length!==1?this.reset():(this._startPos=this._lastPos=B.touchPos(this.element,e.targetTouches)[0],this.startTouch(e,this._startPos),B.addEventListener(window,"touchmove",this.touchmove,{passive:!1}),B.addEventListener(window,"touchend",this.touchend))},"touchstart");this.touchmove=u(e=>{e.targetTouches.length!==1?this.reset():(this._lastPos=B.touchPos(this.element,e.targetTouches)[0],this.moveTouch(e,this._lastPos))},"touchmove");this.touchend=u(e=>{e.targetTouches.length===0&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)<this._clickTolerance&&this.element.click(),delete this._startPos,delete this._lastPos,this.offTemp()},"touchend");this.reset=u(()=>{this.mouseRotate.reset(),this.mousePitch&&this.mousePitch.reset(),this.touchRotate.reset(),this.touchPitch&&this.touchPitch.reset(),delete this._startPos,delete this._lastPos,this.offTemp()},"reset");this._clickTolerance=10;let n=e.dragRotate._mouseRotate.getClickTolerance(),a=e.dragRotate._mousePitch.getClickTolerance();this.element=t,this.mouseRotate=H1({clickTolerance:n,enable:!0}),this.touchRotate=X1({clickTolerance:n,enable:!0}),this.map=e,i&&(this.mousePitch=Z1({clickTolerance:a,enable:!0}),this.touchPitch=K1({clickTolerance:a,enable:!0})),B.addEventListener(t,"mousedown",this.mousedown),B.addEventListener(t,"touchstart",this.touchstart,{passive:!1}),B.addEventListener(t,"touchcancel",this.reset)}startMouse(e,t){this.mouseRotate.dragStart(e,t),this.mousePitch&&this.mousePitch.dragStart(e,t),B.disableDrag()}startTouch(e,t){this.touchRotate.dragStart(e,t),this.touchPitch&&this.touchPitch.dragStart(e,t),B.disableDrag()}moveMouse(e,t){let i=this.map,{bearingDelta:n}=this.mouseRotate.dragMove(e,t)||{};if(n&&i.setBearing(i.getBearing()+n),this.mousePitch){let{pitchDelta:a}=this.mousePitch.dragMove(e,t)||{};a&&i.setPitch(i.getPitch()+a)}}moveTouch(e,t){let i=this.map,{bearingDelta:n}=this.touchRotate.dragMove(e,t)||{};if(n&&i.setBearing(i.getBearing()+n),this.touchPitch){let{pitchDelta:a}=this.touchPitch.dragMove(e,t)||{};a&&i.setPitch(i.getPitch()+a)}}off(){let e=this.element;B.removeEventListener(e,"mousedown",this.mousedown),B.removeEventListener(e,"touchstart",this.touchstart,{passive:!1}),B.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),B.removeEventListener(window,"touchend",this.touchend),B.removeEventListener(e,"touchcancel",this.reset),this.offTemp()}offTemp(){B.enableDrag(),B.removeEventListener(window,"mousemove",this.mousemove),B.removeEventListener(window,"mouseup",this.mouseup),B.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),B.removeEventListener(window,"touchend",this.touchend)}};u(ky,"MouseRotateWrapper");var Cy=ky;d();d();var Ur;function Y1(r,e=!1){Ur!==void 0&&!e?r(Ur):window.navigator.permissions!==void 0?window.navigator.permissions.query({name:"geolocation"}).then(t=>{Ur=t.state!=="denied",r(Ur)}).catch(()=>{Ur=!!window.navigator.geolocation,r(Ur)}):(Ur=!!window.navigator.geolocation,r(Ur))}u(Y1,"checkGeolocationSupport");d();var sc=ae(Pe(),1);d();function ac(r,e,t){if(r=new re(r.lng,r.lat),e){let i=new re(r.lng-360,r.lat),n=new re(r.lng+360,r.lat),a=t.locationPoint(r).distSqr(e);t.locationPoint(i).distSqr(e)<a?r=i:t.locationPoint(n).distSqr(e)<a&&(r=n)}for(;Math.abs(r.lng-t.center.lng)>180;){let i=t.locationPoint(r);if(i.x>=0&&i.y>=0&&i.x<=t.width&&i.y<=t.height)break;r.lng>t.center.lng?r.lng-=360:r.lng+=360}return r}u(ac,"smartWrap");d();var so={center:"translate(-50%,-50%)",top:"translate(-50%,0)","top-left":"translate(0,0)","top-right":"translate(-100%,0)",bottom:"translate(-50%,-100%)","bottom-left":"translate(0,-100%)","bottom-right":"translate(-100%,-100%)",left:"translate(0,-50%)",right:"translate(-100%,-50%)"};function oc(r,e,t){let i=r.classList;for(let n in so)i.remove("maplibregl-".concat(t,"-anchor-").concat(n));i.add("maplibregl-".concat(t,"-anchor-").concat(e))}u(oc,"applyAnchorClass");var Ly=class Ly extends de{constructor(t){super();this._onKeyPress=u(t=>{let i=t.code,n=t.charCode||t.keyCode;(i==="Space"||i==="Enter"||n===32||n===13)&&this.togglePopup()},"_onKeyPress");this._onMapClick=u(t=>{let i=t.originalEvent.target,n=this._element;this._popup&&(i===n||n.contains(i))&&this.togglePopup()},"_onMapClick");this._update=u(t=>{if(!this._map)return;this._map.transform.renderWorldCopies&&(this._lngLat=ac(this._lngLat,this._pos,this._map.transform)),this._pos=this._map.project(this._lngLat)._add(this._offset);let i="";this._rotationAlignment==="viewport"||this._rotationAlignment==="auto"?i="rotateZ(".concat(this._rotation,"deg)"):this._rotationAlignment==="map"&&(i="rotateZ(".concat(this._rotation-this._map.getBearing(),"deg)"));let n="";this._pitchAlignment==="viewport"||this._pitchAlignment==="auto"?n="rotateX(0deg)":this._pitchAlignment==="map"&&(n="rotateX(".concat(this._map.getPitch(),"deg)")),(!t||t.type==="moveend")&&(this._pos=this._pos.round()),B.setTransform(this._element,"".concat(so[this._anchor]," translate(").concat(this._pos.x,"px, ").concat(this._pos.y,"px) ").concat(n," ").concat(i)),this._map.terrain&&!this._opacityTimeout&&(this._opacityTimeout=setTimeout(()=>{let a=this._map.unproject(this._pos),o=40075016686e-3*Math.abs(Math.cos(this._lngLat.lat*Math.PI/180))/Math.pow(2,this._map.transform.tileZoom+8);this._element.style.opacity=a.distanceTo(this._lngLat)>o*20?"0.2":"1.0",this._opacityTimeout=null},100))},"_update");this._onMove=u(t=>{if(!this._isDragging){let i=this._clickTolerance||this._map._clickTolerance;this._isDragging=t.point.dist(this._pointerdownPos)>=i}this._isDragging&&(this._pos=t.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none",this._state==="pending"&&(this._state="active",this.fire(new z("dragstart"))),this.fire(new z("drag")))},"_onMove");this._onUp=u(()=>{this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),this._state==="active"&&this.fire(new z("dragend")),this._state="inactive"},"_onUp");this._addDragHandler=u(t=>{this._element.contains(t.originalEvent.target)&&(t.preventDefault(),this._positionDelta=t.point.sub(this._pos).add(this._offset),this._pointerdownPos=t.point,this._state="pending",this._map.on("mousemove",this._onMove),this._map.on("touchmove",this._onMove),this._map.once("mouseup",this._onUp),this._map.once("touchend",this._onUp))},"_addDragHandler");if(this._anchor=t&&t.anchor||"center",this._color=t&&t.color||"#3FB1CE",this._scale=t&&t.scale||1,this._draggable=t&&t.draggable||!1,this._clickTolerance=t&&t.clickTolerance||0,this._isDragging=!1,this._state="inactive",this._rotation=t&&t.rotation||0,this._rotationAlignment=t&&t.rotationAlignment||"auto",this._pitchAlignment=t&&t.pitchAlignment&&t.pitchAlignment!=="auto"?t.pitchAlignment:this._rotationAlignment,!t||!t.element){this._defaultMarker=!0,this._element=B.create("div"),this._element.setAttribute("aria-label","Map marker");let i=B.createNS("http://www.w3.org/2000/svg","svg"),n=41,a=27;i.setAttributeNS(null,"display","block"),i.setAttributeNS(null,"height","".concat(n,"px")),i.setAttributeNS(null,"width","".concat(a,"px")),i.setAttributeNS(null,"viewBox","0 0 ".concat(a," ").concat(n));let o=B.createNS("http://www.w3.org/2000/svg","g");o.setAttributeNS(null,"stroke","none"),o.setAttributeNS(null,"stroke-width","1"),o.setAttributeNS(null,"fill","none"),o.setAttributeNS(null,"fill-rule","evenodd");let s=B.createNS("http://www.w3.org/2000/svg","g");s.setAttributeNS(null,"fill-rule","nonzero");let l=B.createNS("http://www.w3.org/2000/svg","g");l.setAttributeNS(null,"transform","translate(3.0, 29.0)"),l.setAttributeNS(null,"fill","#000000");let c=[{rx:"10.5",ry:"5.25002273"},{rx:"10.5",ry:"5.25002273"},{rx:"9.5",ry:"4.77275007"},{rx:"8.5",ry:"4.29549936"},{rx:"7.5",ry:"3.81822308"},{rx:"6.5",ry:"3.34094679"},{rx:"5.5",ry:"2.86367051"},{rx:"4.5",ry:"2.38636864"}];for(let _ of c){let v=B.createNS("http://www.w3.org/2000/svg","ellipse");v.setAttributeNS(null,"opacity","0.04"),v.setAttributeNS(null,"cx","10.5"),v.setAttributeNS(null,"cy","5.80029008"),v.setAttributeNS(null,"rx",_.rx),v.setAttributeNS(null,"ry",_.ry),l.appendChild(v)}let p=B.createNS("http://www.w3.org/2000/svg","g");p.setAttributeNS(null,"fill",this._color);let h=B.createNS("http://www.w3.org/2000/svg","path");h.setAttributeNS(null,"d","M27,13.5 C27,19.074644 20.250001,27.000002 14.75,34.500002 C14.016665,35.500004 12.983335,35.500004 12.25,34.500002 C6.7499993,27.000002 0,19.222562 0,13.5 C0,6.0441559 6.0441559,0 13.5,0 C20.955844,0 27,6.0441559 27,13.5 Z"),p.appendChild(h);let f=B.createNS("http://www.w3.org/2000/svg","g");f.setAttributeNS(null,"opacity","0.25"),f.setAttributeNS(null,"fill","#000000");let m=B.createNS("http://www.w3.org/2000/svg","path");m.setAttributeNS(null,"d","M13.5,0 C6.0441559,0 0,6.0441559 0,13.5 C0,19.222562 6.7499993,27 12.25,34.5 C13,35.522727 14.016664,35.500004 14.75,34.5 C20.250001,27 27,19.074644 27,13.5 C27,6.0441559 20.955844,0 13.5,0 Z M13.5,1 C20.415404,1 26,6.584596 26,13.5 C26,15.898657 24.495584,19.181431 22.220703,22.738281 C19.945823,26.295132 16.705119,30.142167 13.943359,33.908203 C13.743445,34.180814 13.612715,34.322738 13.5,34.441406 C13.387285,34.322738 13.256555,34.180814 13.056641,33.908203 C10.284481,30.127985 7.4148684,26.314159 5.015625,22.773438 C2.6163816,19.232715 1,15.953538 1,13.5 C1,6.584596 6.584596,1 13.5,1 Z"),f.appendChild(m);let g=B.createNS("http://www.w3.org/2000/svg","g");g.setAttributeNS(null,"transform","translate(6.0, 7.0)"),g.setAttributeNS(null,"fill","#FFFFFF");let y=B.createNS("http://www.w3.org/2000/svg","g");y.setAttributeNS(null,"transform","translate(8.0, 8.0)");let x=B.createNS("http://www.w3.org/2000/svg","circle");x.setAttributeNS(null,"fill","#000000"),x.setAttributeNS(null,"opacity","0.25"),x.setAttributeNS(null,"cx","5.5"),x.setAttributeNS(null,"cy","5.5"),x.setAttributeNS(null,"r","5.4999962");let b=B.createNS("http://www.w3.org/2000/svg","circle");b.setAttributeNS(null,"fill","#FFFFFF"),b.setAttributeNS(null,"cx","5.5"),b.setAttributeNS(null,"cy","5.5"),b.setAttributeNS(null,"r","5.4999962"),y.appendChild(x),y.appendChild(b),s.appendChild(l),s.appendChild(p),s.appendChild(f),s.appendChild(g),s.appendChild(y),i.appendChild(s),i.setAttributeNS(null,"height","".concat(n*this._scale,"px")),i.setAttributeNS(null,"width","".concat(a*this._scale,"px")),this._element.appendChild(i),this._offset=sc.default.convert(t&&t.offset||[0,-14])}else this._element=t.element,this._offset=sc.default.convert(t&&t.offset||[0,0]);if(this._element.classList.add("maplibregl-marker"),this._element.addEventListener("dragstart",i=>{i.preventDefault()}),this._element.addEventListener("mousedown",i=>{i.preventDefault()}),oc(this._element,this._anchor,"marker"),t&&t.className)for(let i of t.className.split(" "))this._element.classList.add(i);this._popup=null}addTo(t){return this.remove(),this._map=t,t.getCanvasContainer().appendChild(this._element),t.on("move",this._update),t.on("moveend",this._update),this.setDraggable(this._draggable),this._update(),this._map.on("click",this._onMapClick),this}remove(){return this._opacityTimeout&&(clearTimeout(this._opacityTimeout),delete this._opacityTimeout),this._map&&(this._map.off("click",this._onMapClick),this._map.off("move",this._update),this._map.off("moveend",this._update),this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler),this._map.off("mouseup",this._onUp),this._map.off("touchend",this._onUp),this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),delete this._map),B.remove(this._element),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(t){return this._lngLat=re.convert(t),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this}getElement(){return this._element}setPopup(t){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),t){if(!("offset"in t.options)){let a=Math.sqrt(Math.pow(13.5,2)/2);t.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[a,(38.1-13.5+a)*-1],"bottom-right":[-a,(38.1-13.5+a)*-1],left:[13.5,(38.1-13.5)*-1],right:[-13.5,(38.1-13.5)*-1]}:this._offset}this._popup=t,this._lngLat&&this._popup.setLngLat(this._lngLat),this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress)}return this}getPopup(){return this._popup}togglePopup(){let t=this._popup;if(t)t.isOpen()?t.remove():t.addTo(this._map);else return this;return this}getOffset(){return this._offset}setOffset(t){return this._offset=sc.default.convert(t),this._update(),this}addClassName(t){this._element.classList.add(t)}removeClassName(t){this._element.classList.remove(t)}toggleClassName(t){return this._element.classList.toggle(t)}setDraggable(t){return this._draggable=!!t,this._map&&(t?(this._map.on("mousedown",this._addDragHandler),this._map.on("touchstart",this._addDragHandler)):(this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler))),this}isDraggable(){return this._draggable}setRotation(t){return this._rotation=t||0,this._update(),this}getRotation(){return this._rotation}setRotationAlignment(t){return this._rotationAlignment=t||"auto",this._update(),this}getRotationAlignment(){return this._rotationAlignment}setPitchAlignment(t){return this._pitchAlignment=t&&t!=="auto"?t:this._rotationAlignment,this._update(),this}getPitchAlignment(){return this._pitchAlignment}};u(Ly,"Marker");var bi=Ly;var sE={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0},lc=0,lo=!1,Dy=class Dy extends de{constructor(t){super();this._onSuccess=u(t=>{if(this._map){if(this._isOutOfMapMaxBounds(t)){this._setErrorState(),this.fire(new z("outofmaxbounds",t)),this._updateMarker(),this._finish();return}if(this.options.trackUserLocation)switch(this._lastKnownPosition=t,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background");break;default:throw new Error("Unexpected watchState ".concat(this._watchState))}this.options.showUserLocation&&this._watchState!=="OFF"&&this._updateMarker(t),(!this.options.trackUserLocation||this._watchState==="ACTIVE_LOCK")&&this._updateCamera(t),this.options.showUserLocation&&this._dotElement.classList.remove("maplibregl-user-location-dot-stale"),this.fire(new z("geolocate",t)),this._finish()}},"_onSuccess");this._updateCamera=u(t=>{let i=new re(t.coords.longitude,t.coords.latitude),n=t.coords.accuracy,a=this._map.getBearing(),o=R({bearing:a},this.options.fitBoundsOptions),s=lt.fromLngLat(i,n);this._map.fitBounds(s,o,{geolocateSource:!0})},"_updateCamera");this._updateMarker=u(t=>{if(t){let i=new re(t.coords.longitude,t.coords.latitude);this._accuracyCircleMarker.setLngLat(i).addTo(this._map),this._userLocationDotMarker.setLngLat(i).addTo(this._map),this._accuracy=t.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},"_updateMarker");this._onZoom=u(()=>{this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()},"_onZoom");this._onError=u(t=>{if(this._map){if(this.options.trackUserLocation)if(t.code===1){this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;let i=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=i,this._geolocateButton.setAttribute("aria-label",i),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(t.code===3&&lo)return;this._setErrorState()}this._watchState!=="OFF"&&this.options.showUserLocation&&this._dotElement.classList.add("maplibregl-user-location-dot-stale"),this.fire(new z("error",t)),this._finish()}},"_onError");this._finish=u(()=>{this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},"_finish");this._setupUI=u(t=>{if(this._map){if(this._container.addEventListener("contextmenu",i=>i.preventDefault()),this._geolocateButton=B.create("button","maplibregl-ctrl-geolocate",this._container),B.create("span","maplibregl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",t===!1){Ce("Geolocation support is not available so the GeolocateControl will be disabled.");let i=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=i,this._geolocateButton.setAttribute("aria-label",i)}else{let i=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.title=i,this._geolocateButton.setAttribute("aria-label",i)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=B.create("div","maplibregl-user-location-dot"),this._userLocationDotMarker=new bi({element:this._dotElement}),this._circleElement=B.create("div","maplibregl-user-location-accuracy-circle"),this._accuracyCircleMarker=new bi({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onZoom)),this._geolocateButton.addEventListener("click",this.trigger.bind(this)),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",i=>{let n=i.originalEvent&&i.originalEvent.type==="resize";!i.geolocateSource&&this._watchState==="ACTIVE_LOCK"&&!n&&(this._watchState="BACKGROUND",this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this.fire(new z("trackuserlocationend")))})}},"_setupUI");this.options=R({},sE,t)}onAdd(t){return this._map=t,this._container=B.create("div","maplibregl-ctrl maplibregl-ctrl-group"),Y1(this._setupUI),this._container}onRemove(){this._geolocationWatchID!==void 0&&(window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),B.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,lc=0,lo=!1}_isOutOfMapMaxBounds(t){let i=this._map.getMaxBounds(),n=t.coords;return i&&(n.longitude<i.getWest()||n.longitude>i.getEast()||n.latitude<i.getSouth()||n.latitude>i.getNorth())}_setErrorState(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"ACTIVE_ERROR":break;default:throw new Error("Unexpected watchState ".concat(this._watchState))}}_updateCircleRadius(){let t=this._map.getBounds(),i=t.getSouthEast(),n=t.getNorthEast(),a=i.distanceTo(n),o=this._map._container.clientHeight,s=Math.ceil(2*(this._accuracy/(a/o)));this._circleElement.style.width="".concat(s,"px"),this._circleElement.style.height="".concat(s,"px")}trigger(){if(!this._setup)return Ce("Geolocate control triggered before added to a map"),!1;if(this.options.trackUserLocation){switch(this._watchState){case"OFF":this._watchState="WAITING_ACTIVE",this.fire(new z("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":lc--,lo=!1,this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this.fire(new z("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new z("trackuserlocationstart"));break;default:throw new Error("Unexpected watchState ".concat(this._watchState))}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"OFF":break;default:throw new Error("Unexpected watchState ".concat(this._watchState))}if(this._watchState==="OFF"&&this._geolocationWatchID!==void 0)this._clearWatch();else if(this._geolocationWatchID===void 0){this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),lc++;let t;lc>1?(t={maximumAge:6e5,timeout:0},lo=!0):(t=this.options.positionOptions,lo=!1),this._geolocationWatchID=window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,t)}}else window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0}_clearWatch(){window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)}};u(Dy,"GeolocateControl");var uc=Dy;d();var lE={maxWidth:100,unit:"metric"},zy=class zy{constructor(e){this._onMove=u(()=>{J1(this._map,this._container,this.options)},"_onMove");this.setUnit=u(e=>{this.options.unit=e,J1(this._map,this._container,this.options)},"setUnit");this.options=R({},lE,e)}getDefaultPosition(){return"bottom-left"}onAdd(e){return this._map=e,this._container=B.create("div","maplibregl-ctrl maplibregl-ctrl-scale",e.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container}onRemove(){B.remove(this._container),this._map.off("move",this._onMove),this._map=void 0}};u(zy,"ScaleControl");var cc=zy;function J1(r,e,t){let i=t&&t.maxWidth||100,n=r._container.clientHeight/2,a=r.unproject([0,n]),o=r.unproject([i,n]),s=a.distanceTo(o);if(t&&t.unit==="imperial"){let l=3.2808*s;if(l>5280){let c=l/5280;uo(e,i,c,r._getUIString("ScaleControl.Miles"))}else uo(e,i,l,r._getUIString("ScaleControl.Feet"))}else if(t&&t.unit==="nautical"){let l=s/1852;uo(e,i,l,r._getUIString("ScaleControl.NauticalMiles"))}else s>=1e3?uo(e,i,s/1e3,r._getUIString("ScaleControl.Kilometers")):uo(e,i,s,r._getUIString("ScaleControl.Meters"))}u(J1,"updateScale");function uo(r,e,t,i){let n=cE(t),a=n/t;r.style.width="".concat(e*a,"px"),r.innerHTML="".concat(n," ").concat(i)}u(uo,"setScale");function uE(r){let e=Math.pow(10,Math.ceil(-Math.log(r)/Math.LN10));return Math.round(r*e)/e}u(uE,"getDecimalRoundNum");function cE(r){let e=Math.pow(10,"".concat(Math.floor(r)).length-1),t=r/e;return t=t>=10?10:t>=5?5:t>=3?3:t>=2?2:t>=1?1:uE(t),e*t}u(cE,"getRoundNum");d();var Fy=class Fy extends de{constructor(t={}){super();this._onFullscreenChange=u(()=>{(window.document.fullscreenElement||window.document.mozFullScreenElement||window.document.webkitFullscreenElement||window.document.msFullscreenElement)===this._container!==this._fullscreen&&this._handleFullscreenChange()},"_onFullscreenChange");this._onClickFullscreen=u(()=>{this._isFullscreen()?this._exitFullscreen():this._requestFullscreen()},"_onClickFullscreen");this._fullscreen=!1,t&&t.container&&(t.container instanceof HTMLElement?this._container=t.container:Ce("Full screen control 'container' must be a DOM element.")),"onfullscreenchange"in document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in document&&(this._fullscreenchange="MSFullscreenChange")}onAdd(t){return this._map=t,this._container||(this._container=this._map.getContainer()),this._controlContainer=B.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),this._controlContainer}onRemove(){B.remove(this._controlContainer),this._map=null,window.document.removeEventListener(this._fullscreenchange,this._onFullscreenChange)}_setupUI(){let t=this._fullscreenButton=B.create("button","maplibregl-ctrl-fullscreen",this._controlContainer);B.create("span","maplibregl-ctrl-icon",t).setAttribute("aria-hidden","true"),t.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),window.document.addEventListener(this._fullscreenchange,this._onFullscreenChange)}_updateTitle(){let t=this._getTitle();this._fullscreenButton.setAttribute("aria-label",t),this._fullscreenButton.title=t}_getTitle(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")}_isFullscreen(){return this._fullscreen}_handleFullscreenChange(){this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("maplibregl-ctrl-shrink"),this._fullscreenButton.classList.toggle("maplibregl-ctrl-fullscreen"),this._updateTitle(),this._fullscreen?(this.fire(new z("fullscreenstart")),this._map._cooperativeGestures&&(this._prevCooperativeGestures=this._map._cooperativeGestures,this._map.setCooperativeGestures())):(this.fire(new z("fullscreenend")),this._prevCooperativeGestures&&(this._map.setCooperativeGestures(this._prevCooperativeGestures),delete this._prevCooperativeGestures))}_exitFullscreen(){window.document.exitFullscreen?window.document.exitFullscreen():window.document.mozCancelFullScreen?window.document.mozCancelFullScreen():window.document.msExitFullscreen?window.document.msExitFullscreen():window.document.webkitCancelFullScreen?window.document.webkitCancelFullScreen():this._togglePseudoFullScreen()}_requestFullscreen(){this._container.requestFullscreen?this._container.requestFullscreen():this._container.mozRequestFullScreen?this._container.mozRequestFullScreen():this._container.msRequestFullscreen?this._container.msRequestFullscreen():this._container.webkitRequestFullscreen?this._container.webkitRequestFullscreen():this._togglePseudoFullScreen()}_togglePseudoFullScreen(){this._container.classList.toggle("maplibregl-pseudo-fullscreen"),this._handleFullscreenChange(),this._map.resize()}};u(Fy,"FullscreenControl");var pc=Fy;d();var By=class By{constructor(e){this._toggleTerrain=u(()=>{this._map.getTerrain()?this._map.setTerrain(null):this._map.setTerrain(this.options),this._updateTerrainIcon()},"_toggleTerrain");this._updateTerrainIcon=u(()=>{this._terrainButton.classList.remove("maplibregl-ctrl-terrain"),this._terrainButton.classList.remove("maplibregl-ctrl-terrain-enabled"),this._map.terrain?(this._terrainButton.classList.add("maplibregl-ctrl-terrain-enabled"),this._terrainButton.title=this._map._getUIString("TerrainControl.disableTerrain")):(this._terrainButton.classList.add("maplibregl-ctrl-terrain"),this._terrainButton.title=this._map._getUIString("TerrainControl.enableTerrain"))},"_updateTerrainIcon");this.options=e}onAdd(e){return this._map=e,this._container=B.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._terrainButton=B.create("button","maplibregl-ctrl-terrain",this._container),B.create("span","maplibregl-ctrl-icon",this._terrainButton).setAttribute("aria-hidden","true"),this._terrainButton.type="button",this._terrainButton.addEventListener("click",this._toggleTerrain),this._updateTerrainIcon(),this._map.on("terrain",this._updateTerrainIcon),this._container}onRemove(){B.remove(this._container),this._map.off("terrain",this._updateTerrainIcon),this._map=void 0}};u(By,"TerrainControl");var hc=By;d();var $e=ae(Pe(),1);var pE={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px"},hE=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", "),Ry=class Ry extends de{constructor(t){super();this.remove=u(()=>(this._content&&B.remove(this._content),this._container&&(B.remove(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("move",this._onClose),this._map.off("click",this._onClose),this._map.off("remove",this.remove),this._map.off("mousemove",this._onMouseMove),this._map.off("mouseup",this._onMouseUp),this._map.off("drag",this._onDrag),delete this._map),this.fire(new z("close")),this),"remove");this._onMouseUp=u(t=>{this._update(t.point)},"_onMouseUp");this._onMouseMove=u(t=>{this._update(t.point)},"_onMouseMove");this._onDrag=u(t=>{this._update(t.point)},"_onDrag");this._update=u(t=>{let i=this._lngLat||this._trackPointer;if(!this._map||!i||!this._content)return;if(!this._container){if(this._container=B.create("div","maplibregl-popup",this._map.getContainer()),this._tip=B.create("div","maplibregl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className)for(let l of this.options.className.split(" "))this._container.classList.add(l);this._trackPointer&&this._container.classList.add("maplibregl-popup-track-pointer")}if(this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._map.transform.renderWorldCopies&&!this._trackPointer&&(this._lngLat=ac(this._lngLat,this._pos,this._map.transform)),this._trackPointer&&!t)return;let n=this._pos=this._trackPointer&&t?t:this._map.project(this._lngLat),a=this.options.anchor,o=Q1(this.options.offset);if(!a){let l=this._container.offsetWidth,c=this._container.offsetHeight,p;n.y+o.bottom.y<c?p=["top"]:n.y>this._map.transform.height-c?p=["bottom"]:p=[],n.x<l/2?p.push("left"):n.x>this._map.transform.width-l/2&&p.push("right"),p.length===0?a="bottom":a=p.join("-")}let s=n.add(o[a]).round();B.setTransform(this._container,"".concat(so[a]," translate(").concat(s.x,"px,").concat(s.y,"px)")),oc(this._container,a,"popup")},"_update");this._onClose=u(()=>{this.remove()},"_onClose");this.options=R(Object.create(pE),t)}addTo(t){return this._map&&this.remove(),this._map=t,this.options.closeOnClick&&this._map.on("click",this._onClose),this.options.closeOnMove&&this._map.on("move",this._onClose),this._map.on("remove",this.remove),this._update(),this._focusFirstElement(),this._trackPointer?(this._map.on("mousemove",this._onMouseMove),this._map.on("mouseup",this._onMouseUp),this._container&&this._container.classList.add("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")):this._map.on("move",this._update),this.fire(new z("open")),this}isOpen(){return!!this._map}getLngLat(){return this._lngLat}setLngLat(t){return this._lngLat=re.convert(t),this._pos=null,this._trackPointer=!1,this._update(),this._map&&(this._map.on("move",this._update),this._map.off("mousemove",this._onMouseMove),this._container&&this._container.classList.remove("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.remove("maplibregl-track-pointer")),this}trackPointer(){return this._trackPointer=!0,this._pos=null,this._update(),this._map&&(this._map.off("move",this._update),this._map.on("mousemove",this._onMouseMove),this._map.on("drag",this._onDrag),this._container&&this._container.classList.add("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")),this}getElement(){return this._container}setText(t){return this.setDOMContent(document.createTextNode(t))}setHTML(t){let i=document.createDocumentFragment(),n=document.createElement("body"),a;for(n.innerHTML=t;a=n.firstChild,!!a;)i.appendChild(a);return this.setDOMContent(i)}getMaxWidth(){var t;return(t=this._container)==null?void 0:t.style.maxWidth}setMaxWidth(t){return this.options.maxWidth=t,this._update(),this}setDOMContent(t){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=B.create("div","maplibregl-popup-content",this._container);return this._content.appendChild(t),this._createCloseButton(),this._update(),this._focusFirstElement(),this}addClassName(t){this._container&&this._container.classList.add(t)}removeClassName(t){this._container&&this._container.classList.remove(t)}setOffset(t){return this.options.offset=t,this._update(),this}toggleClassName(t){if(this._container)return this._container.classList.toggle(t)}_createCloseButton(){this.options.closeButton&&(this._closeButton=B.create("button","maplibregl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.setAttribute("aria-label","Close popup"),this._closeButton.innerHTML="×",this._closeButton.addEventListener("click",this._onClose))}_focusFirstElement(){if(!this.options.focusAfterOpen||!this._container)return;let t=this._container.querySelector(hE);t&&t.focus()}};u(Ry,"Popup");var fc=Ry;function Q1(r){if(r)if(typeof r=="number"){let e=Math.round(Math.sqrt(.5*Math.pow(r,2)));return{center:new $e.default(0,0),top:new $e.default(0,r),"top-left":new $e.default(e,e),"top-right":new $e.default(-e,e),bottom:new $e.default(0,-r),"bottom-left":new $e.default(e,-e),"bottom-right":new $e.default(-e,-e),left:new $e.default(r,0),right:new $e.default(-r,0)}}else if(r instanceof $e.default||Array.isArray(r)){let e=$e.default.convert(r);return{center:e,top:e,"top-left":e,"top-right":e,bottom:e,"bottom-left":e,"bottom-right":e,left:e,right:e}}else return{center:$e.default.convert(r.center||[0,0]),top:$e.default.convert(r.top||[0,0]),"top-left":$e.default.convert(r["top-left"]||[0,0]),"top-right":$e.default.convert(r["top-right"]||[0,0]),bottom:$e.default.convert(r.bottom||[0,0]),"bottom-left":$e.default.convert(r["bottom-left"]||[0,0]),"bottom-right":$e.default.convert(r["bottom-right"]||[0,0]),left:$e.default.convert(r.left||[0,0]),right:$e.default.convert(r.right||[0,0])};else return Q1(new $e.default(0,0))}u(Q1,"normalizeOffset");var tw=ae(Pe(),1);d();var ew={extend(r,...e){return R(r,...e)},run(r){r()},logToElement(r,e=!1,t="log"){let i=window.document.getElementById(t);i&&(e&&(i.innerHTML=""),i.innerHTML+="<br>".concat(r))}};var fE=po.version,Se=class Se{static get version(){return fE}static get workerCount(){return Fr.workerCount}static set workerCount(e){Fr.workerCount=e}static get maxParallelImageRequests(){return it.MAX_PARALLEL_IMAGE_REQUESTS}static set maxParallelImageRequests(e){it.MAX_PARALLEL_IMAGE_REQUESTS=e}static get workerUrl(){return it.WORKER_URL}static set workerUrl(e){console.log("setting worker url",e),it.WORKER_URL=e}static addProtocol(e,t){it.REGISTERED_PROTOCOLS[e]=t}static removeProtocol(e){delete it.REGISTERED_PROTOCOLS[e]}};u(Se,"MapLibreGL"),Se.Map=ic,Se.NavigationControl=nc,Se.GeolocateControl=uc,Se.AttributionControl=_n,Se.LogoControl=vn,Se.ScaleControl=cc,Se.FullscreenControl=pc,Se.TerrainControl=hc,Se.Popup=fc,Se.Marker=bi,Se.Style=Br,Se.LngLat=re,Se.LngLatBounds=lt,Se.Point=tw.default,Se.MercatorCoordinate=ze,Se.Evented=de,Se.AJAXError=hr,Se.config=it,Se.CanvasSource=fn,Se.GeoJSONSource=pn,Se.ImageSource=At,Se.RasterDEMTileSource=cn,Se.RasterTileSource=Dr,Se.VectorTileSource=sn,Se.VideoSource=hn,Se.setRTLTextPlugin=dx,Se.getRTLTextPluginStatus=Kn,Se.prewarm=tv,Se.clearPrewarmedResources=rv;var mc=Se;ew.extend(mc,{isSafari:qr,getPerformanceMetrics:Rr.getPerformanceMetrics});var mre=mc;export{mre as default};
|