@mappedin/mappedin-js 6.1.2 → 6.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/THIRD_PARTY_LICENSES.txt +19 -17
- package/lib/esm/GLTFExporter-ZVF3Y5DX.js +1 -0
- package/lib/esm/{GLTFLoader-TLLNLQ5Y.js → GLTFLoader-3QTALUTA.js} +1 -2
- package/lib/esm/chunk-2DEFE4C2.js +1 -0
- package/lib/esm/chunk-5W2UDR4H.js +1 -0
- package/lib/esm/chunk-66DYOCZO.js +1 -0
- package/lib/esm/chunk-Q56Y72HB.js +1 -0
- package/lib/esm/{chunk-MLCPE7I2.js → chunk-YB4VFXKF.js} +1 -2
- package/lib/esm/index.css +1 -2
- package/lib/esm/index.d.ts +180 -54
- package/lib/esm/index.js +1 -2
- package/lib/esm/inspector-B32KFAD4.js +1 -0
- package/lib/esm/inspector-Z5ATF4CD.css +1 -0
- package/lib/esm/internal-OFWBS2NI.css +1 -0
- package/lib/esm/internal-RK6SZERV.js +1 -0
- package/lib/esm/{roboto-regular-R5KXKW73.js → roboto-regular-ERMR6E6W.js} +1 -2
- package/lib/esm/text3d-DIUCQLOC.js +1 -0
- package/lib/esm/{text3d-AXM5ZHCS.css → text3d-M57DIX3E.css} +0 -1
- package/lib/esm/workers/collision-worker.csp.js +1 -23
- package/lib/esm/workers/maplibre-worker.csp.js +1 -2
- package/lib/index.css +1 -2
- package/package.json +6 -4
- package/lib/esm/GLTFExporter-O4OUZTHE.js +0 -2
- package/lib/esm/GLTFExporter-O4OUZTHE.js.map +0 -7
- package/lib/esm/GLTFLoader-TLLNLQ5Y.js.map +0 -7
- package/lib/esm/chunk-3PM6GKGK.js +0 -2048
- package/lib/esm/chunk-3PM6GKGK.js.map +0 -7
- package/lib/esm/chunk-3U5JJXJA.js +0 -3820
- package/lib/esm/chunk-3U5JJXJA.js.map +0 -7
- package/lib/esm/chunk-MLCPE7I2.js.map +0 -7
- package/lib/esm/chunk-ROCNZJLL.js +0 -2
- package/lib/esm/chunk-ROCNZJLL.js.map +0 -7
- package/lib/esm/chunk-UOCWYBVK.js +0 -938
- package/lib/esm/chunk-UOCWYBVK.js.map +0 -7
- package/lib/esm/index.css.map +0 -7
- package/lib/esm/index.js.map +0 -7
- package/lib/esm/inspector-2XETNHYZ.css +0 -2
- package/lib/esm/inspector-2XETNHYZ.css.map +0 -7
- package/lib/esm/inspector-66PSYVJU.js +0 -483
- package/lib/esm/inspector-66PSYVJU.js.map +0 -7
- package/lib/esm/internal-R5XTRV7Q.css +0 -2
- package/lib/esm/internal-R5XTRV7Q.css.map +0 -7
- package/lib/esm/internal-WJZVXVL6.js +0 -2
- package/lib/esm/internal-WJZVXVL6.js.map +0 -7
- package/lib/esm/roboto-regular-R5KXKW73.js.map +0 -7
- package/lib/esm/text3d-AXM5ZHCS.css.map +0 -7
- package/lib/esm/text3d-EZBY7L7A.js +0 -253
- package/lib/esm/text3d-EZBY7L7A.js.map +0 -7
- package/lib/index-rn.js +0 -4306
|
@@ -1,2 +1 @@
|
|
|
1
|
-
(()=>{var jy=Object.create;var Hi=Object.defineProperty;var qy=Object.getOwnPropertyDescriptor;var Wy=Object.getOwnPropertyNames;var Xy=Object.getPrototypeOf,Hy=Object.prototype.hasOwnProperty;var l=(t,e)=>Hi(t,"name",{value:e,configurable:!0});var Zy=(t,e)=>()=>(t&&(e=t(t=0)),e);var we=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Jy=(t,e)=>{for(var r in e)Hi(t,r,{get:e[r],enumerable:!0})},Yy=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Wy(e))!Hy.call(t,i)&&i!==r&&Hi(t,i,{get:()=>e[i],enumerable:!(n=qy(e,i))||n.enumerable});return t};var ee=(t,e,r)=>(r=t!=null?jy(Xy(t)):{},Yy(e||!t||!t.__esModule?Hi(r,"default",{value:t,enumerable:!0}):r,t));var g=Zy(()=>{});var de=we((d0,lu)=>{"use strict";g();lu.exports=br;function br(t,e){this.x=t,this.y=e}l(br,"Point");br.prototype={clone:l(function(){return new br(this.x,this.y)},"clone"),add:l(function(t){return this.clone()._add(t)},"add"),sub:l(function(t){return this.clone()._sub(t)},"sub"),multByPoint:l(function(t){return this.clone()._multByPoint(t)},"multByPoint"),divByPoint:l(function(t){return this.clone()._divByPoint(t)},"divByPoint"),mult:l(function(t){return this.clone()._mult(t)},"mult"),div:l(function(t){return this.clone()._div(t)},"div"),rotate:l(function(t){return this.clone()._rotate(t)},"rotate"),rotateAround:l(function(t,e){return this.clone()._rotateAround(t,e)},"rotateAround"),matMult:l(function(t){return this.clone()._matMult(t)},"matMult"),unit:l(function(){return this.clone()._unit()},"unit"),perp:l(function(){return this.clone()._perp()},"perp"),round:l(function(){return this.clone()._round()},"round"),mag:l(function(){return Math.sqrt(this.x*this.x+this.y*this.y)},"mag"),equals:l(function(t){return this.x===t.x&&this.y===t.y},"equals"),dist:l(function(t){return Math.sqrt(this.distSqr(t))},"dist"),distSqr:l(function(t){var e=t.x-this.x,r=t.y-this.y;return e*e+r*r},"distSqr"),angle:l(function(){return Math.atan2(this.y,this.x)},"angle"),angleTo:l(function(t){return Math.atan2(this.y-t.y,this.x-t.x)},"angleTo"),angleWith:l(function(t){return this.angleWithSep(t.x,t.y)},"angleWith"),angleWithSep:l(function(t,e){return Math.atan2(this.x*e-this.y*t,this.x*t+this.y*e)},"angleWithSep"),_matMult:l(function(t){var e=t[0]*this.x+t[1]*this.y,r=t[2]*this.x+t[3]*this.y;return this.x=e,this.y=r,this},"_matMult"),_add:l(function(t){return this.x+=t.x,this.y+=t.y,this},"_add"),_sub:l(function(t){return this.x-=t.x,this.y-=t.y,this},"_sub"),_mult:l(function(t){return this.x*=t,this.y*=t,this},"_mult"),_div:l(function(t){return this.x/=t,this.y/=t,this},"_div"),_multByPoint:l(function(t){return this.x*=t.x,this.y*=t.y,this},"_multByPoint"),_divByPoint:l(function(t){return this.x/=t.x,this.y/=t.y,this},"_divByPoint"),_unit:l(function(){return this._div(this.mag()),this},"_unit"),_perp:l(function(){var t=this.y;return this.y=this.x,this.x=-t,this},"_perp"),_rotate:l(function(t){var e=Math.cos(t),r=Math.sin(t),n=e*this.x-r*this.y,i=r*this.x+e*this.y;return this.x=n,this.y=i,this},"_rotate"),_rotateAround:l(function(t,e){var r=Math.cos(t),n=Math.sin(t),i=e.x+r*(this.x-e.x)-n*(this.y-e.y),o=e.y+n*(this.x-e.x)+r*(this.y-e.y);return this.x=i,this.y=o,this},"_rotateAround"),_round:l(function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},"_round")};br.convert=function(t){return t instanceof br?t:Array.isArray(t)?new br(t[0],t[1]):t}});var pu=we((x0,cu)=>{"use strict";g();cu.exports=uu;function uu(t,e,r,n){this.cx=3*t,this.bx=3*(r-t)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*e,this.by=3*(n-e)-this.cy,this.ay=1-this.cy-this.by,this.p1x=t,this.p1y=e,this.p2x=r,this.p2y=n}l(uu,"UnitBezier");uu.prototype={sampleCurveX:l(function(t){return((this.ax*t+this.bx)*t+this.cx)*t},"sampleCurveX"),sampleCurveY:l(function(t){return((this.ay*t+this.by)*t+this.cy)*t},"sampleCurveY"),sampleCurveDerivativeX:l(function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},"sampleCurveDerivativeX"),solveCurveX:l(function(t,e){if(e===void 0&&(e=1e-6),t<0)return 0;if(t>1)return 1;for(var r=t,n=0;n<8;n++){var i=this.sampleCurveX(r)-t;if(Math.abs(i)<e)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=t,n=0;n<20&&(i=this.sampleCurveX(r),!(Math.abs(i-t)<e));n++)t>i?a=r:s=r,r=(s-a)*.5+a;return r},"solveCurveX"),solve:l(function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))},"solve")}});var sp=we((e1,rl)=>{g();function _g(t,e){var r,n,i,o,a,s,u,c,p,f;for(r=t.length&3,n=t.length-r,i=e,a=3432918353,u=461845907,f=0;f<n;)p=t.charCodeAt(f)&255|(t.charCodeAt(++f)&255)<<8|(t.charCodeAt(++f)&255)<<16|(t.charCodeAt(++f)&255)<<24,++f,p=(p&65535)*a+(((p>>>16)*a&65535)<<16)&4294967295,p=p<<15|p>>>17,p=(p&65535)*u+(((p>>>16)*u&65535)<<16)&4294967295,i^=p,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(p=0,r){case 3:p^=(t.charCodeAt(f+2)&255)<<16;case 2:p^=(t.charCodeAt(f+1)&255)<<8;case 1:p^=t.charCodeAt(f)&255,p=(p&65535)*a+(((p>>>16)*a&65535)<<16)&4294967295,p=p<<15|p>>>17,p=(p&65535)*u+(((p>>>16)*u&65535)<<16)&4294967295,i^=p}return i^=t.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}l(_g,"murmurhash3_32_gc");typeof rl<"u"&&(rl.exports=_g)});var lp=we((n1,nl)=>{g();function Ig(t,e){for(var r=t.length,n=e^r,i=0,o;r>=4;)o=t.charCodeAt(i)&255|(t.charCodeAt(++i)&255)<<8|(t.charCodeAt(++i)&255)<<16|(t.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^=(t.charCodeAt(i+2)&255)<<16;case 2:n^=(t.charCodeAt(i+1)&255)<<8;case 1:n^=t.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}l(Ig,"murmurhash2_32_gc");typeof nl!==void 0&&(nl.exports=Ig)});var il=we((a1,oa)=>{g();var up=sp(),Tg=lp();oa.exports=up;oa.exports.murmur3=up;oa.exports.murmur2=Tg});var bl=we((o_,Wp)=>{"use strict";g();var yb=de();Wp.exports=Gr;function Gr(t,e,r,n,i){this.properties={},this.extent=r,this.type=0,this._pbf=t,this._geometry=-1,this._keys=n,this._values=i,t.readFields(mb,this,e)}l(Gr,"VectorTileFeature");function mb(t,e,r){t==1?e.id=r.readVarint():t==2?hb(r,e):t==3?e.type=r.readVarint():t==4&&(e._geometry=r.pos)}l(mb,"readFeature");function hb(t,e){for(var r=t.readVarint()+t.pos;t.pos<r;){var n=e._keys[t.readVarint()],i=e._values[t.readVarint()];e.properties[n]=i}}l(hb,"readTag");Gr.types=["Unknown","Point","LineString","Polygon"];Gr.prototype.loadGeometry=function(){var t=this._pbf;t.pos=this._geometry;for(var e=t.readVarint()+t.pos,r=1,n=0,i=0,o=0,a=[],s;t.pos<e;){if(n<=0){var u=t.readVarint();r=u&7,n=u>>3}if(n--,r===1||r===2)i+=t.readSVarint(),o+=t.readSVarint(),r===1&&(s&&a.push(s),s=[]),s.push(new yb(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};Gr.prototype.bbox=function(){var t=this._pbf;t.pos=this._geometry;for(var e=t.readVarint()+t.pos,r=1,n=0,i=0,o=0,a=1/0,s=-1/0,u=1/0,c=-1/0;t.pos<e;){if(n<=0){var p=t.readVarint();r=p&7,n=p>>3}if(n--,r===1||r===2)i+=t.readSVarint(),o+=t.readSVarint(),i<a&&(a=i),i>s&&(s=i),o<u&&(u=o),o>c&&(c=o);else if(r!==7)throw new Error("unknown command "+r)}return[a,u,s,c]};Gr.prototype.toGeoJSON=function(t,e,r){var n=this.extent*Math.pow(2,r),i=this.extent*t,o=this.extent*e,a=this.loadGeometry(),s=Gr.types[this.type],u,c;function p(m){for(var h=0;h<m.length;h++){var d=m[h],x=180-(d.y+o)*360/n;m[h]=[(d.x+i)*360/n-180,360/Math.PI*Math.atan(Math.exp(x*Math.PI/180))-90]}}switch(l(p,"project"),this.type){case 1:var f=[];for(u=0;u<a.length;u++)f[u]=a[u][0];a=f,p(a);break;case 2:for(u=0;u<a.length;u++)p(a[u]);break;case 3:for(a=db(a),u=0;u<a.length;u++)for(c=0;c<a[u].length;c++)p(a[u][c]);break}a.length===1?a=a[0]:s="Multi"+s;var y={type:"Feature",geometry:{type:s,coordinates:a},properties:this.properties};return"id"in this&&(y.id=this.id),y};function db(t){var e=t.length;if(e<=1)return[t];for(var r=[],n,i,o=0;o<e;o++){var a=gb(t[o]);a!==0&&(i===void 0&&(i=a<0),i===a<0?(n&&r.push(n),n=[t[o]]):n.push(t[o]))}return n&&r.push(n),r}l(db,"classifyRings");function gb(t){for(var e=0,r=0,n=t.length,i=n-1,o,a;r<n;i=r++)o=t[r],a=t[i],e+=(a.x-o.x)*(o.y+a.y);return e}l(gb,"signedArea")});var xl=we((l_,Hp)=>{"use strict";g();var bb=bl();Hp.exports=Xp;function Xp(t,e){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=t,this._keys=[],this._values=[],this._features=[],t.readFields(xb,this,e),this.length=this._features.length}l(Xp,"VectorTileLayer");function xb(t,e,r){t===15?e.version=r.readVarint():t===1?e.name=r.readString():t===5?e.extent=r.readVarint():t===2?e._features.push(r.pos):t===3?e._keys.push(r.readString()):t===4&&e._values.push(vb(r))}l(xb,"readLayer");function vb(t){for(var e=null,r=t.readVarint()+t.pos;t.pos<r;){var n=t.readVarint()>>3;e=n===1?t.readString():n===2?t.readFloat():n===3?t.readDouble():n===4?t.readVarint64():n===5?t.readVarint():n===6?t.readSVarint():n===7?t.readBoolean():null}return e}l(vb,"readValueMessage");Xp.prototype.feature=function(t){if(t<0||t>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[t];var e=this._pbf.readVarint()+this._pbf.pos;return new bb(this._pbf,e,this.extent,this._keys,this._values)}});var Jp=we((p_,Zp)=>{"use strict";g();var Pb=xl();Zp.exports=Sb;function Sb(t,e){this.layers=t.readFields(wb,{},e)}l(Sb,"VectorTile");function wb(t,e,r){if(t===3){var n=new Pb(r,r.readVarint()+r.pos);n.length&&(e[n.name]=n)}}l(wb,"readTile")});var Gt=we((m_,Sa)=>{g();Sa.exports.VectorTile=Jp();Sa.exports.VectorTileFeature=bl();Sa.exports.VectorTileLayer=xl()});var bf=we(Al=>{g();Al.read=function(t,e,r,n,i){var o,a,s=i*8-n-1,u=(1<<s)-1,c=u>>1,p=-7,f=r?i-1:0,y=r?-1:1,m=t[e+f];for(f+=y,o=m&(1<<-p)-1,m>>=-p,p+=s;p>0;o=o*256+t[e+f],f+=y,p-=8);for(a=o&(1<<-p)-1,o>>=-p,p+=n;p>0;a=a*256+t[e+f],f+=y,p-=8);if(o===0)o=1-c;else{if(o===u)return a?NaN:(m?-1:1)*(1/0);a=a+Math.pow(2,n),o=o-c}return(m?-1:1)*a*Math.pow(2,o-n)};Al.write=function(t,e,r,n,i,o){var a,s,u,c=o*8-i-1,p=(1<<c)-1,f=p>>1,y=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,m=n?0:o-1,h=n?1:-1,d=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,a=p):(a=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-a))<1&&(a--,u*=2),a+f>=1?e+=y/u:e+=y*Math.pow(2,1-f),e*u>=2&&(a++,u/=2),a+f>=p?(s=0,a=p):a+f>=1?(s=(e*u-1)*Math.pow(2,i),a=a+f):(s=e*Math.pow(2,f-1)*Math.pow(2,i),a=0));i>=8;t[r+m]=s&255,m+=h,s/=256,i-=8);for(a=a<<i|s,c+=i;c>0;t[r+m]=a&255,m+=h,a/=256,c-=8);t[r+m-h]|=d*128}});var gi=we((hI,wf)=>{"use strict";g();wf.exports=Q;var Ta=bf();function Q(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}l(Q,"Pbf");Q.Varint=0;Q.Fixed64=1;Q.Bytes=2;Q.Fixed32=5;var _l=65536*65536,xf=1/_l,Ub=12,Sf=typeof TextDecoder>"u"?null:new TextDecoder("utf-8");Q.prototype={destroy:l(function(){this.buf=null},"destroy"),readFields:l(function(t,e,r){for(r=r||this.length;this.pos<r;){var n=this.readVarint(),i=n>>3,o=this.pos;this.type=n&7,t(i,e,this),this.pos===o&&this.skip(n)}return e},"readFields"),readMessage:l(function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},"readMessage"),readFixed32:l(function(){var t=Ca(this.buf,this.pos);return this.pos+=4,t},"readFixed32"),readSFixed32:l(function(){var t=Pf(this.buf,this.pos);return this.pos+=4,t},"readSFixed32"),readFixed64:l(function(){var t=Ca(this.buf,this.pos)+Ca(this.buf,this.pos+4)*_l;return this.pos+=8,t},"readFixed64"),readSFixed64:l(function(){var t=Ca(this.buf,this.pos)+Pf(this.buf,this.pos+4)*_l;return this.pos+=8,t},"readSFixed64"),readFloat:l(function(){var t=Ta.read(this.buf,this.pos,!0,23,4);return this.pos+=4,t},"readFloat"),readDouble:l(function(){var t=Ta.read(this.buf,this.pos,!0,52,8);return this.pos+=8,t},"readDouble"),readVarint:l(function(t){var e=this.buf,r,n;return n=e[this.pos++],r=n&127,n<128||(n=e[this.pos++],r|=(n&127)<<7,n<128)||(n=e[this.pos++],r|=(n&127)<<14,n<128)||(n=e[this.pos++],r|=(n&127)<<21,n<128)?r:(n=e[this.pos],r|=(n&15)<<28,$b(r,t,this))},"readVarint"),readVarint64:l(function(){return this.readVarint(!0)},"readVarint64"),readSVarint:l(function(){var t=this.readVarint();return t%2===1?(t+1)/-2:t/2},"readSVarint"),readBoolean:l(function(){return!!this.readVarint()},"readBoolean"),readString:l(function(){var t=this.readVarint()+this.pos,e=this.pos;return this.pos=t,t-e>=Ub&&Sf?nx(this.buf,e,t):rx(this.buf,e,t)},"readString"),readBytes:l(function(){var t=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,t);return this.pos=t,e},"readBytes"),readPackedVarint:l(function(t,e){if(this.type!==Q.Bytes)return t.push(this.readVarint(e));var r=gt(this);for(t=t||[];this.pos<r;)t.push(this.readVarint(e));return t},"readPackedVarint"),readPackedSVarint:l(function(t){if(this.type!==Q.Bytes)return t.push(this.readSVarint());var e=gt(this);for(t=t||[];this.pos<e;)t.push(this.readSVarint());return t},"readPackedSVarint"),readPackedBoolean:l(function(t){if(this.type!==Q.Bytes)return t.push(this.readBoolean());var e=gt(this);for(t=t||[];this.pos<e;)t.push(this.readBoolean());return t},"readPackedBoolean"),readPackedFloat:l(function(t){if(this.type!==Q.Bytes)return t.push(this.readFloat());var e=gt(this);for(t=t||[];this.pos<e;)t.push(this.readFloat());return t},"readPackedFloat"),readPackedDouble:l(function(t){if(this.type!==Q.Bytes)return t.push(this.readDouble());var e=gt(this);for(t=t||[];this.pos<e;)t.push(this.readDouble());return t},"readPackedDouble"),readPackedFixed32:l(function(t){if(this.type!==Q.Bytes)return t.push(this.readFixed32());var e=gt(this);for(t=t||[];this.pos<e;)t.push(this.readFixed32());return t},"readPackedFixed32"),readPackedSFixed32:l(function(t){if(this.type!==Q.Bytes)return t.push(this.readSFixed32());var e=gt(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed32());return t},"readPackedSFixed32"),readPackedFixed64:l(function(t){if(this.type!==Q.Bytes)return t.push(this.readFixed64());var e=gt(this);for(t=t||[];this.pos<e;)t.push(this.readFixed64());return t},"readPackedFixed64"),readPackedSFixed64:l(function(t){if(this.type!==Q.Bytes)return t.push(this.readSFixed64());var e=gt(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed64());return t},"readPackedSFixed64"),skip:l(function(t){var e=t&7;if(e===Q.Varint)for(;this.buf[this.pos++]>127;);else if(e===Q.Bytes)this.pos=this.readVarint()+this.pos;else if(e===Q.Fixed32)this.pos+=4;else if(e===Q.Fixed64)this.pos+=8;else throw new Error("Unimplemented type: "+e)},"skip"),writeTag:l(function(t,e){this.writeVarint(t<<3|e)},"writeTag"),realloc:l(function(t){for(var e=this.length||16;e<this.pos+t;)e*=2;if(e!==this.length){var r=new Uint8Array(e);r.set(this.buf),this.buf=r,this.length=e}},"realloc"),finish:l(function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},"finish"),writeFixed32:l(function(t){this.realloc(4),$r(this.buf,t,this.pos),this.pos+=4},"writeFixed32"),writeSFixed32:l(function(t){this.realloc(4),$r(this.buf,t,this.pos),this.pos+=4},"writeSFixed32"),writeFixed64:l(function(t){this.realloc(8),$r(this.buf,t&-1,this.pos),$r(this.buf,Math.floor(t*xf),this.pos+4),this.pos+=8},"writeFixed64"),writeSFixed64:l(function(t){this.realloc(8),$r(this.buf,t&-1,this.pos),$r(this.buf,Math.floor(t*xf),this.pos+4),this.pos+=8},"writeSFixed64"),writeVarint:l(function(t){if(t=+t||0,t>268435455||t<0){jb(t,this);return}this.realloc(4),this.buf[this.pos++]=t&127|(t>127?128:0),!(t<=127)&&(this.buf[this.pos++]=(t>>>=7)&127|(t>127?128:0),!(t<=127)&&(this.buf[this.pos++]=(t>>>=7)&127|(t>127?128:0),!(t<=127)&&(this.buf[this.pos++]=t>>>7&127)))},"writeVarint"),writeSVarint:l(function(t){this.writeVarint(t<0?-t*2-1:t*2)},"writeSVarint"),writeBoolean:l(function(t){this.writeVarint(!!t)},"writeBoolean"),writeString:l(function(t){t=String(t),this.realloc(t.length*4),this.pos++;var e=this.pos;this.pos=ix(this.buf,t,this.pos);var r=this.pos-e;r>=128&&vf(e,r,this),this.pos=e-1,this.writeVarint(r),this.pos+=r},"writeString"),writeFloat:l(function(t){this.realloc(4),Ta.write(this.buf,t,this.pos,!0,23,4),this.pos+=4},"writeFloat"),writeDouble:l(function(t){this.realloc(8),Ta.write(this.buf,t,this.pos,!0,52,8),this.pos+=8},"writeDouble"),writeBytes:l(function(t){var e=t.length;this.writeVarint(e),this.realloc(e);for(var r=0;r<e;r++)this.buf[this.pos++]=t[r]},"writeBytes"),writeRawMessage:l(function(t,e){this.pos++;var r=this.pos;t(e,this);var n=this.pos-r;n>=128&&vf(r,n,this),this.pos=r-1,this.writeVarint(n),this.pos+=n},"writeRawMessage"),writeMessage:l(function(t,e,r){this.writeTag(t,Q.Bytes),this.writeRawMessage(e,r)},"writeMessage"),writePackedVarint:l(function(t,e){e.length&&this.writeMessage(t,Xb,e)},"writePackedVarint"),writePackedSVarint:l(function(t,e){e.length&&this.writeMessage(t,Hb,e)},"writePackedSVarint"),writePackedBoolean:l(function(t,e){e.length&&this.writeMessage(t,Yb,e)},"writePackedBoolean"),writePackedFloat:l(function(t,e){e.length&&this.writeMessage(t,Zb,e)},"writePackedFloat"),writePackedDouble:l(function(t,e){e.length&&this.writeMessage(t,Jb,e)},"writePackedDouble"),writePackedFixed32:l(function(t,e){e.length&&this.writeMessage(t,Kb,e)},"writePackedFixed32"),writePackedSFixed32:l(function(t,e){e.length&&this.writeMessage(t,Qb,e)},"writePackedSFixed32"),writePackedFixed64:l(function(t,e){e.length&&this.writeMessage(t,ex,e)},"writePackedFixed64"),writePackedSFixed64:l(function(t,e){e.length&&this.writeMessage(t,tx,e)},"writePackedSFixed64"),writeBytesField:l(function(t,e){this.writeTag(t,Q.Bytes),this.writeBytes(e)},"writeBytesField"),writeFixed32Field:l(function(t,e){this.writeTag(t,Q.Fixed32),this.writeFixed32(e)},"writeFixed32Field"),writeSFixed32Field:l(function(t,e){this.writeTag(t,Q.Fixed32),this.writeSFixed32(e)},"writeSFixed32Field"),writeFixed64Field:l(function(t,e){this.writeTag(t,Q.Fixed64),this.writeFixed64(e)},"writeFixed64Field"),writeSFixed64Field:l(function(t,e){this.writeTag(t,Q.Fixed64),this.writeSFixed64(e)},"writeSFixed64Field"),writeVarintField:l(function(t,e){this.writeTag(t,Q.Varint),this.writeVarint(e)},"writeVarintField"),writeSVarintField:l(function(t,e){this.writeTag(t,Q.Varint),this.writeSVarint(e)},"writeSVarintField"),writeStringField:l(function(t,e){this.writeTag(t,Q.Bytes),this.writeString(e)},"writeStringField"),writeFloatField:l(function(t,e){this.writeTag(t,Q.Fixed32),this.writeFloat(e)},"writeFloatField"),writeDoubleField:l(function(t,e){this.writeTag(t,Q.Fixed64),this.writeDouble(e)},"writeDoubleField"),writeBooleanField:l(function(t,e){this.writeVarintField(t,!!e)},"writeBooleanField")};function $b(t,e,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 Ur(t,i,e);throw new Error("Expected varint not more than 10 bytes")}l($b,"readVarintRemainder");function gt(t){return t.type===Q.Bytes?t.readVarint()+t.pos:t.pos+1}l(gt,"readPackedEnd");function Ur(t,e,r){return r?e*4294967296+(t>>>0):(e>>>0)*4294967296+(t>>>0)}l(Ur,"toNum");function jb(t,e){var r,n;if(t>=0?(r=t%4294967296|0,n=t/4294967296|0):(r=~(-t%4294967296),n=~(-t/4294967296),r^4294967295?r=r+1|0:(r=0,n=n+1|0)),t>=18446744073709552e3||t<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");e.realloc(10),qb(r,n,e),Wb(n,e)}l(jb,"writeBigVarint");function qb(t,e,r){r.buf[r.pos++]=t&127|128,t>>>=7,r.buf[r.pos++]=t&127|128,t>>>=7,r.buf[r.pos++]=t&127|128,t>>>=7,r.buf[r.pos++]=t&127|128,t>>>=7,r.buf[r.pos]=t&127}l(qb,"writeBigVarintLow");function Wb(t,e){var r=(t&7)<<4;e.buf[e.pos++]|=r|((t>>>=3)?128:0),t&&(e.buf[e.pos++]=t&127|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=t&127|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=t&127|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=t&127|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=t&127)))))}l(Wb,"writeBigVarintHigh");function vf(t,e,r){var n=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(Math.LN2*7));r.realloc(n);for(var i=r.pos-1;i>=t;i--)r.buf[i+n]=r.buf[i]}l(vf,"makeRoomForExtraLength");function Xb(t,e){for(var r=0;r<t.length;r++)e.writeVarint(t[r])}l(Xb,"writePackedVarint");function Hb(t,e){for(var r=0;r<t.length;r++)e.writeSVarint(t[r])}l(Hb,"writePackedSVarint");function Zb(t,e){for(var r=0;r<t.length;r++)e.writeFloat(t[r])}l(Zb,"writePackedFloat");function Jb(t,e){for(var r=0;r<t.length;r++)e.writeDouble(t[r])}l(Jb,"writePackedDouble");function Yb(t,e){for(var r=0;r<t.length;r++)e.writeBoolean(t[r])}l(Yb,"writePackedBoolean");function Kb(t,e){for(var r=0;r<t.length;r++)e.writeFixed32(t[r])}l(Kb,"writePackedFixed32");function Qb(t,e){for(var r=0;r<t.length;r++)e.writeSFixed32(t[r])}l(Qb,"writePackedSFixed32");function ex(t,e){for(var r=0;r<t.length;r++)e.writeFixed64(t[r])}l(ex,"writePackedFixed64");function tx(t,e){for(var r=0;r<t.length;r++)e.writeSFixed64(t[r])}l(tx,"writePackedSFixed64");function Ca(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+t[e+3]*16777216}l(Ca,"readUInt32");function $r(t,e,r){t[r]=e,t[r+1]=e>>>8,t[r+2]=e>>>16,t[r+3]=e>>>24}l($r,"writeInt32");function Pf(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}l(Pf,"readInt32");function rx(t,e,r){for(var n="",i=e;i<r;){var o=t[i],a=null,s=o>239?4:o>223?3:o>191?2:1;if(i+s>r)break;var u,c,p;s===1?o<128&&(a=o):s===2?(u=t[i+1],(u&192)===128&&(a=(o&31)<<6|u&63,a<=127&&(a=null))):s===3?(u=t[i+1],c=t[i+2],(u&192)===128&&(c&192)===128&&(a=(o&15)<<12|(u&63)<<6|c&63,(a<=2047||a>=55296&&a<=57343)&&(a=null))):s===4&&(u=t[i+1],c=t[i+2],p=t[i+3],(u&192)===128&&(c&192)===128&&(p&192)===128&&(a=(o&15)<<18|(u&63)<<12|(c&63)<<6|p&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}l(rx,"readUtf8");function nx(t,e,r){return Sf.decode(t.subarray(e,r))}l(nx,"readUtf8TextDecoder");function ix(t,e,r){for(var n=0,i,o;n<e.length;n++){if(i=e.charCodeAt(n),i>55295&&i<57344)if(o)if(i<56320){t[r++]=239,t[r++]=191,t[r++]=189,o=i;continue}else i=o-55296<<10|i-56320|65536,o=null;else{i>56319||n+1===e.length?(t[r++]=239,t[r++]=191,t[r++]=189):o=i;continue}else o&&(t[r++]=239,t[r++]=191,t[r++]=189,o=null);i<128?t[r++]=i:(i<2048?t[r++]=i>>6|192:(i<65536?t[r++]=i>>12|224:(t[r++]=i>>18|240,t[r++]=i>>12&63|128),t[r++]=i>>6&63|128),t[r++]=i&63|128)}return r}l(ix,"writeUtf8")});var xy=we((NE,by)=>{g();by.exports=Ya;function Ya(t,e){var r=t&&t.type,n;if(r==="FeatureCollection")for(n=0;n<t.features.length;n++)Ya(t.features[n],e);else if(r==="GeometryCollection")for(n=0;n<t.geometries.length;n++)Ya(t.geometries[n],e);else if(r==="Feature")Ya(t.geometry,e);else if(r==="Polygon")dy(t.coordinates,e);else if(r==="MultiPolygon")for(n=0;n<t.coordinates.length;n++)dy(t.coordinates[n],e);return t}l(Ya,"rewind");function dy(t,e){if(t.length!==0){gy(t[0],e);for(var r=1;r<t.length;r++)gy(t[r],!e)}}l(dy,"rewindRings");function gy(t,e){for(var r=0,n=0,i=0,o=t.length,a=o-1;i<o;a=i++){var s=(t[i][0]-t[a][0])*(t[a][1]+t[i][1]),u=r+s;n+=Math.abs(r)>=Math.abs(s)?r-u+s:s-u+r,r=u}r+n>=0!=!!e&&t.reverse()}l(gy,"rewindRing")});var wy=we((HE,Sy)=>{"use strict";g();var qx=de(),Wx=Gt().VectorTileFeature;Sy.exports=Py;function Py(t,e){this.options=e||{},this.features=t,this.length=t.length}l(Py,"GeoJSONWrapper");Py.prototype.feature=function(t){return new Qa(this.features[t],this.options.extent)};function Qa(t,e){this.id=typeof t.id=="number"?t.id:void 0,this.type=t.type,this.rawGeometry=t.type===1?[t.geometry]:t.geometry,this.properties=t.tags,this.extent=e||4096}l(Qa,"FeatureWrapper");Qa.prototype.loadGeometry=function(){var t=this.rawGeometry;this.geometry=[];for(var e=0;e<t.length;e++){for(var r=t[e],n=[],i=0;i<r.length;i++)n.push(new qx(r[i][0],r[i][1]));this.geometry.push(n)}return this.geometry};Qa.prototype.bbox=function(){this.geometry||this.loadGeometry();for(var t=this.geometry,e=1/0,r=-1/0,n=1/0,i=-1/0,o=0;o<t.length;o++)for(var a=t[o],s=0;s<a.length;s++){var u=a[s];e=Math.min(e,u.x),r=Math.max(r,u.x),n=Math.min(n,u.y),i=Math.max(i,u.y)}return[e,n,r,i]};Qa.prototype.toGeoJSON=Wx.prototype.toGeoJSON});var Iy=we((YE,Vi)=>{g();var Xx=gi(),_y=wy();Vi.exports=jl;Vi.exports.fromVectorTileJs=jl;Vi.exports.fromGeojsonVt=Hx;Vi.exports.GeoJSONWrapper=_y;function jl(t){var e=new Xx;return Zx(t,e),e.finish()}l(jl,"fromVectorTileJs");function Hx(t,e){e=e||{};var r={};for(var n in t)r[n]=new _y(t[n].features,e),r[n].name=n,r[n].version=e.version,r[n].extent=e.extent;return jl({layers:r})}l(Hx,"fromGeojsonVt");function Zx(t,e){for(var r in t.layers)e.writeMessage(3,Jx,t.layers[r])}l(Zx,"writeTile");function Jx(t,e){e.writeVarintField(15,t.version||1),e.writeStringField(1,t.name||""),e.writeVarintField(5,t.extent||4096);var r,n={keys:[],values:[],keycache:{},valuecache:{}};for(r=0;r<t.length;r++)n.feature=t.feature(r),e.writeMessage(2,Yx,n);var i=n.keys;for(r=0;r<i.length;r++)e.writeStringField(3,i[r]);var o=n.values;for(r=0;r<o.length;r++)e.writeMessage(4,e0,o[r])}l(Jx,"writeLayer");function Yx(t,e){var r=t.feature;r.id!==void 0&&e.writeVarintField(1,r.id),e.writeMessage(2,Kx,t),e.writeVarintField(3,r.type),e.writeMessage(4,Qx,r)}l(Yx,"writeFeature");function Kx(t,e){var r=t.feature,n=t.keys,i=t.values,o=t.keycache,a=t.valuecache;for(var s in r.properties){var u=r.properties[s],c=o[s];if(u!==null){typeof c>"u"&&(n.push(s),c=n.length-1,o[s]=c),e.writeVarint(c);var p=typeof u;p!=="string"&&p!=="boolean"&&p!=="number"&&(u=JSON.stringify(u));var f=p+":"+u,y=a[f];typeof y>"u"&&(i.push(u),y=i.length-1,a[f]=y),e.writeVarint(y)}}}l(Kx,"writeProperties");function $l(t,e){return(e<<3)+(t&7)}l($l,"command");function Ay(t){return t<<1^t>>31}l(Ay,"zigzag");function Qx(t,e){for(var r=t.loadGeometry(),n=t.type,i=0,o=0,a=r.length,s=0;s<a;s++){var u=r[s],c=1;n===1&&(c=u.length),e.writeVarint($l(1,c));for(var p=n===3?u.length-1:u.length,f=0;f<p;f++){f===1&&n!==1&&e.writeVarint($l(2,p-1));var y=u[f].x-i,m=u[f].y-o;e.writeVarint(Ay(y)),e.writeVarint(Ay(m)),i+=y,o+=m}n===3&&e.writeVarint($l(7,1))}}l(Qx,"writeGeometry");function e0(t,e){var r=typeof t;r==="string"?e.writeStringField(1,t):r==="boolean"?e.writeBooleanField(7,t):r==="number"&&(t%1!==0?e.writeDoubleField(3,t):t<0?e.writeSVarintField(6,t):e.writeVarintField(5,t))}l(e0,"writeValue")});g();g();g();var Mm=ee(de(),1),wu=ee(pu(),1);g();g();var cs;function fu(){return cs==null&&(cs=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")&&typeof createImageBitmap=="function"),cs}l(fu,"offscreenCanvasSupported");var Zi;function yu(){if(Zi==null&&(Zi=!1,fu())){let r=new OffscreenCanvas(5,5).getContext("2d",{willReadFrequently:!0});if(r){for(let i=0;i<5*5;i++){let o=i*4;r.fillStyle=`rgb(${o},${o+1},${o+2})`,r.fillRect(i%5,Math.floor(i/5),1,1)}let n=r.getImageData(0,0,5,5).data;for(let i=0;i<5*5*4;i++)if(i%4!==3&&n[i]!==i){Zi=!0;break}}}return Zi||!1}l(yu,"isOffscreenCanvasDistorted");g();g();var Qr=1e-6,en=typeof Float32Array<"u"?Float32Array:Array,tn=Math.random;var k0=Math.PI/180;Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)});var Ji={};Jy(Ji,{add:()=>nm,ceil:()=>im,clone:()=>Qy,copy:()=>tm,create:()=>mu,cross:()=>hm,dist:()=>Tm,distance:()=>bu,div:()=>Im,divide:()=>gu,dot:()=>mm,equals:()=>wm,exactEquals:()=>Sm,floor:()=>om,forEach:()=>Em,fromValues:()=>em,inverse:()=>fm,len:()=>km,length:()=>vu,lerp:()=>dm,max:()=>sm,min:()=>am,mul:()=>_m,multiply:()=>du,negate:()=>pm,normalize:()=>ym,random:()=>gm,round:()=>lm,scale:()=>um,scaleAndAdd:()=>cm,set:()=>rm,sqrDist:()=>Cm,sqrLen:()=>Fm,squaredDistance:()=>xu,squaredLength:()=>Pu,str:()=>Pm,sub:()=>Am,subtract:()=>hu,transformMat4:()=>bm,transformQuat:()=>xm,zero:()=>vm});g();function mu(){var t=new en(4);return en!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}l(mu,"create");function Qy(t){var e=new en(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}l(Qy,"clone");function em(t,e,r,n){var i=new en(4);return i[0]=t,i[1]=e,i[2]=r,i[3]=n,i}l(em,"fromValues");function tm(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}l(tm,"copy");function rm(t,e,r,n,i){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t}l(rm,"set");function nm(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t}l(nm,"add");function hu(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t}l(hu,"subtract");function du(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t[2]=e[2]*r[2],t[3]=e[3]*r[3],t}l(du,"multiply");function gu(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t[2]=e[2]/r[2],t[3]=e[3]/r[3],t}l(gu,"divide");function im(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2]),t[3]=Math.ceil(e[3]),t}l(im,"ceil");function om(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2]),t[3]=Math.floor(e[3]),t}l(om,"floor");function am(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t[2]=Math.min(e[2],r[2]),t[3]=Math.min(e[3],r[3]),t}l(am,"min");function sm(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t[2]=Math.max(e[2],r[2]),t[3]=Math.max(e[3],r[3]),t}l(sm,"max");function lm(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t[2]=Math.round(e[2]),t[3]=Math.round(e[3]),t}l(lm,"round");function um(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t}l(um,"scale");function cm(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t}l(cm,"scaleAndAdd");function bu(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2],o=e[3]-t[3];return Math.hypot(r,n,i,o)}l(bu,"distance");function xu(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2],o=e[3]-t[3];return r*r+n*n+i*i+o*o}l(xu,"squaredDistance");function vu(t){var e=t[0],r=t[1],n=t[2],i=t[3];return Math.hypot(e,r,n,i)}l(vu,"length");function Pu(t){var e=t[0],r=t[1],n=t[2],i=t[3];return e*e+r*r+n*n+i*i}l(Pu,"squaredLength");function pm(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t}l(pm,"negate");function fm(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t[3]=1/e[3],t}l(fm,"inverse");function ym(t,e){var r=e[0],n=e[1],i=e[2],o=e[3],a=r*r+n*n+i*i+o*o;return a>0&&(a=1/Math.sqrt(a)),t[0]=r*a,t[1]=n*a,t[2]=i*a,t[3]=o*a,t}l(ym,"normalize");function mm(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]}l(mm,"dot");function hm(t,e,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],u=r[1]*n[3]-r[3]*n[1],c=r[2]*n[3]-r[3]*n[2],p=e[0],f=e[1],y=e[2],m=e[3];return t[0]=f*c-y*u+m*s,t[1]=-(p*c)+y*a-m*o,t[2]=p*u-f*a+m*i,t[3]=-(p*s)+f*o-y*i,t}l(hm,"cross");function dm(t,e,r,n){var i=e[0],o=e[1],a=e[2],s=e[3];return t[0]=i+n*(r[0]-i),t[1]=o+n*(r[1]-o),t[2]=a+n*(r[2]-a),t[3]=s+n*(r[3]-s),t}l(dm,"lerp");function gm(t,e){e=e||1;var r,n,i,o,a,s;do r=tn()*2-1,n=tn()*2-1,a=r*r+n*n;while(a>=1);do i=tn()*2-1,o=tn()*2-1,s=i*i+o*o;while(s>=1);var u=Math.sqrt((1-a)/s);return t[0]=e*r,t[1]=e*n,t[2]=e*i*u,t[3]=e*o*u,t}l(gm,"random");function bm(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3];return t[0]=r[0]*n+r[4]*i+r[8]*o+r[12]*a,t[1]=r[1]*n+r[5]*i+r[9]*o+r[13]*a,t[2]=r[2]*n+r[6]*i+r[10]*o+r[14]*a,t[3]=r[3]*n+r[7]*i+r[11]*o+r[15]*a,t}l(bm,"transformMat4");function xm(t,e,r){var n=e[0],i=e[1],o=e[2],a=r[0],s=r[1],u=r[2],c=r[3],p=c*n+s*o-u*i,f=c*i+u*n-a*o,y=c*o+a*i-s*n,m=-a*n-s*i-u*o;return t[0]=p*c+m*-a+f*-u-y*-s,t[1]=f*c+m*-s+y*-a-p*-u,t[2]=y*c+m*-u+p*-s-f*-a,t[3]=e[3],t}l(xm,"transformQuat");function vm(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t}l(vm,"zero");function Pm(t){return"vec4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"}l(Pm,"str");function Sm(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]}l(Sm,"exactEquals");function wm(t,e){var r=t[0],n=t[1],i=t[2],o=t[3],a=e[0],s=e[1],u=e[2],c=e[3];return Math.abs(r-a)<=Qr*Math.max(1,Math.abs(r),Math.abs(a))&&Math.abs(n-s)<=Qr*Math.max(1,Math.abs(n),Math.abs(s))&&Math.abs(i-u)<=Qr*Math.max(1,Math.abs(i),Math.abs(u))&&Math.abs(o-c)<=Qr*Math.max(1,Math.abs(o),Math.abs(c))}l(wm,"equals");var Am=hu,_m=du,Im=gu,Tm=bu,Cm=xu,km=vu,Fm=Pu,Em=function(){var t=mu();return function(e,r,n,i,o,a){var s,u;for(r||(r=4),n||(n=0),i?u=Math.min(i*r+n,e.length):u=e.length,s=n;s<u;s+=r)t[0]=e[s],t[1]=e[s+1],t[2]=e[s+2],t[3]=e[s+3],o(t,t,a),e[s]=t[0],e[s+1]=t[1],e[s+2]=t[2],e[s+3]=t[3];return e}}();g();g();function Au(t){if(t<=0)return 0;if(t>=1)return 1;let e=t*t,r=e*t;return 4*(t<.5?r:3*(t-e)+r-.75)}l(Au,"easeCubicInOut");function Lm(t,e,r,n){let i=new wu.default(t,e,r,n);return o=>i.solve(o)}l(Lm,"bezier");var q0=Lm(.25,.1,.25,1);function st(t,e,r){return Math.min(r,Math.max(e,t))}l(st,"clamp");function _u(t,e,r){let n=r-e,i=((t-e)%n+n)%n+e;return i===e?r:i}l(_u,"wrap");function xe(t,...e){for(let r of e)for(let n in r)t[n]=r[n];return t}l(xe,"extend");function Iu(t){return Math.log(t)/Math.LN2%1===0}l(Iu,"isPowerOfTwo");function on(t,e,r){let n={};for(let i in t)n[i]=e.call(r||this,t[i],i,t);return n}l(on,"mapObject");function Tu(t,e,r){let n={};for(let i in t)e.call(r||this,t[i],i,t)&&(n[i]=t[i]);return n}l(Tu,"filterObject");function at(t){return Array.isArray(t)?t.map(at):typeof t=="object"&&t?on(t,at):t}l(at,"clone");var Su={};function ye(t){Su[t]||(typeof console<"u"&&console.warn(t),Su[t]=!0)}l(ye,"warnOnce");function lt(t,e,r){return(r.y-t.y)*(e.x-t.x)>(e.y-t.y)*(r.x-t.x)}l(lt,"isCounterClockwise");function ut(t){return typeof WorkerGlobalScope<"u"&&typeof t<"u"&&t instanceof WorkerGlobalScope}l(ut,"isWorker");function wt(t){return typeof ImageBitmap<"u"&&t instanceof ImageBitmap}l(wt,"isImageBitmap");function Dm(t,e,r,n,i){let o=Math.max(-e,0)*4,u=(Math.max(0,r)-r)*n*4+o,c=n*4,p=Math.max(0,e),f=Math.max(0,r),y=Math.min(t.width,e+n),m=Math.min(t.height,r+i);return{rect:{x:p,y:f,width:y-p,height:m-f},layout:[{offset:u,stride:c}]}}l(Dm,"computeVideoFrameParameters");async function Bm(t,e,r,n,i){if(typeof VideoFrame>"u")throw new Error("VideoFrame not supported");let o=new VideoFrame(t,{timestamp:0});try{let a=o?.format;if(!a||!(a.startsWith("BGR")||a.startsWith("RGB")))throw new Error(`Unrecognized format ${a}`);let s=a.startsWith("BGR"),u=new Uint8ClampedArray(n*i*4);if(await o.copyTo(u,Dm(t,e,r,n,i)),s)for(let c=0;c<u.length;c+=4){let p=u[c];u[c]=u[c+2],u[c+2]=p}return u}finally{o.close()}}l(Bm,"readImageUsingVideoFrame");var rn,nn;function Vm(t,e,r,n,i){let o=t.width,a=t.height;(!rn||!nn)&&(rn=new OffscreenCanvas(o,a),nn=rn.getContext("2d",{willReadFrequently:!0})),rn.width=o,rn.height=a,nn.drawImage(t,0,0,o,a);let s=nn.getImageData(e,r,n,i);return nn.clearRect(0,0,o,a),s.data}l(Vm,"readImageDataUsingOffscreenCanvas");async function Cu(t,e,r,n,i){if(yu())try{return await Bm(t,e,r,n,i)}catch{}return Vm(t,e,r,n,i)}l(Cu,"getImageData");function ps(t,e,r,n){return t.addEventListener(e,r,n),{unsubscribe:l(()=>{t.removeEventListener(e,r,n)},"unsubscribe")}}l(ps,"subscribe");function fs(t){return t*Math.PI/180}l(fs,"degreesToRadians");var Yi=25,Ki=0;g();g();var Wt=class t{static{l(this,"TransferableGridIndex")}constructor(e,r,n){let i=this.cells=[];if(e instanceof ArrayBuffer){this.arrayBuffer=e;let a=new Int32Array(this.arrayBuffer);e=a[0],r=a[1],n=a[2],this.d=r+2*n;for(let c=0;c<this.d*this.d;c++){let p=a[3+c],f=a[3+c+1];i.push(p===f?null:a.subarray(p,f))}let s=a[3+i.length],u=a[3+i.length+1];this.keys=a.subarray(s,u),this.bboxes=a.subarray(u),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=e,this.padding=n,this.scale=r/e,this.uid=0;let o=n/r*e;this.min=-o,this.max=e+o}insert(e,r,n,i,o){this._forEachCell(r,n,i,o,this._insertCell,this.uid++,void 0,void 0),this.keys.push(e),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(e,r,n,i,o,a){this.cells[o].push(a)}query(e,r,n,i,o){let a=this.min,s=this.max;if(e<=a&&r<=a&&s<=n&&s<=i&&!o)return Array.prototype.slice.call(this.keys);{let u=[],c={};return this._forEachCell(e,r,n,i,this._queryCell,u,c,o),u}}_queryCell(e,r,n,i,o,a,s,u){let c=this.cells[o];if(c!==null){let p=this.keys,f=this.bboxes;for(let y=0;y<c.length;y++){let m=c[y];if(s[m]===void 0){let h=m*4;(u?u(f[h+0],f[h+1],f[h+2],f[h+3]):e<=f[h+2]&&r<=f[h+3]&&n>=f[h+0]&&i>=f[h+1])?(s[m]=!0,a.push(p[m])):s[m]=!1}}}}_forEachCell(e,r,n,i,o,a,s,u){let c=this._convertToCellCoord(e),p=this._convertToCellCoord(r),f=this._convertToCellCoord(n),y=this._convertToCellCoord(i);for(let m=c;m<=f;m++)for(let h=p;h<=y;h++){let d=this.d*h+m;if(!(u&&!u(this._convertFromCellCoord(m),this._convertFromCellCoord(h),this._convertFromCellCoord(m+1),this._convertFromCellCoord(h+1)))&&o.call(this,e,r,n,i,d,a,s,u))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,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<e.length;a++){let s=e[a];i[3+a]=o,i.set(s,o),o+=s.length}return i[3+e.length]=o,i.set(this.keys,o),o+=this.keys.length,i[3+e.length+1]=o,i.set(this.bboxes,o),o+=this.bboxes.length,i.buffer}static serialize(e,r){let n=e.toArrayBuffer();return r&&r.push(n),{buffer:n}}static deserialize(e){return new t(e.buffer)}};g();var Rm=8,zm={version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},centerAltitude:{type:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},roll:{type:"number",default:0,units:"degrees"},state:{type:"state",default:{}},light:{type:"light"},sky:{type:"sky"},projection:{type:"projection"},terrain:{type:"terrain"},sources:{required:!0,type:"sources"},sprite:{type:"sprite"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},Om={"*":{type:"source"}},Gm=["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],Nm={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:"*"}},Um={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:"*"}},$m={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:{},custom:{}},default:"mapbox"},redFactor:{type:"number",default:1},blueFactor:{type:"number",default:1},greenFactor:{type:"number",default:1},baseShift:{type:"number",default:0},volatile:{type:"boolean",default:!1},"*":{type:"*"}},jm={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"}},qm={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"}}},Wm={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"}}},Xm={id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},"color-relief":{},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"}},Hm=["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_color-relief","layout_background"],Zm={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},Jm={"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"}},Ym={"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"}},Km={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},Qm={"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"}},eh={"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"}},th={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},rh={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},nh={type:"array",value:"*"},ih={type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{}}},oh={type:"enum",values:{Point:{},LineString:{},Polygon:{}}},ah={type:"array",minimum:0,maximum:24,value:["number","color"],length:2},sh={type:"array",value:"*",minimum:1},lh={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}},uh={"sky-color":{type:"color","property-type":"data-constant",default:"#88C6FC",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-ground-blend":{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-fog-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"sky-horizon-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"atmosphere-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},ch={source:{type:"string",required:!0},exaggeration:{type:"number",minimum:0,default:1}},ph={type:{type:"projectionDefinition",default:"mercator","property-type":"data-constant",transition:!1,expression:{interpolated:!0,parameters:["zoom"]}}},fh=["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_color-relief","paint_background"],yh={"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"}},mh={"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"}},hh={"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"}},dh={"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"}},gh={"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"}},bh={"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"}},xh={"hillshade-illumination-direction":{type:"numberArray",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-altitude":{type:"numberArray",default:45,minimum:0,maximum:90,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:"colorArray",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"colorArray",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"},"hillshade-method":{type:"enum",values:{standard:{},basic:{},combined:{},igor:{},multidirectional:{}},default:"standard",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},vh={"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"}},Ph={duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},Sh={"*":{type:"string"}},A={$version:Rm,$root:zm,sources:Om,source:Gm,source_vector:Nm,source_raster:Um,source_raster_dem:$m,source_geojson:jm,source_video:qm,source_image:Wm,layer:Xm,layout:Hm,layout_background:Zm,layout_fill:Jm,layout_circle:Ym,layout_heatmap:Km,"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:Qm,layout_symbol:eh,layout_raster:th,layout_hillshade:rh,"layout_color-relief":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},filter:nh,filter_operator:ih,geometry_type:oh,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:ah,expression:sh,light:lh,sky:uh,terrain:ch,projection:ph,paint:fh,paint_fill:yh,"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:mh,paint_circle:hh,paint_heatmap:dh,paint_symbol:gh,paint_raster:bh,paint_hillshade:xh,"paint_color-relief":{"color-relief-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"color-relief-color":{type:"color",transition:!1,expression:{interpolated:!0,parameters:["elevation"]},"property-type":"color-ramp"}},paint_background:vh,transition:Ph,"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:Sh},wh=["type","source","source-layer","minzoom","maxzoom","filter","layout"];var E=class{static{l(this,"ValidationError")}constructor(e,r,n,i){this.message=(e?`${e}: `:"")+n,i&&(this.identifier=i),r!=null&&r.__line__&&(this.line=r.__line__)}};function Sr(t,...e){for(let r of e)for(let n in r)t[n]=r[n];return t}l(Sr,"extendBy");var Oe=class extends Error{static{l(this,"ExpressionParsingError")}constructor(e,r){super(r),this.message=r,this.key=e}},Ss=class t{static{l(this,"Scope")}constructor(e,r=[]){this.parent=e,this.bindings={};for(let[n,i]of r)this.bindings[n]=i}concat(e){return new t(this,e)}get(e){if(this.bindings[e])return this.bindings[e];if(this.parent)return this.parent.get(e);throw new Error(`${e} not found in scope.`)}has(e){return this.bindings[e]?!0:this.parent?this.parent.has(e):!1}},Ir={kind:"null"},M={kind:"number"},W={kind:"string"},q={kind:"boolean"},Ne={kind:"color"},bo={kind:"projectionDefinition"},Zt={kind:"object"},j={kind:"value"},Ah={kind:"error"},xo={kind:"collator"},Tr={kind:"formatted"},vo={kind:"padding"},un={kind:"colorArray"},Po={kind:"numberArray"},wn={kind:"resolvedImage"},So={kind:"variableAnchorOffsetCollection"};function Ee(t,e){return{kind:"array",itemType:t,N:e}}l(Ee,"array");function se(t){if(t.kind==="array"){let e=se(t.itemType);return typeof t.N=="number"?`array<${e}, ${t.N}>`:t.itemType.kind==="value"?"array":`array<${e}>`}else return t.kind}l(se,"typeToString");var _h=[Ir,M,W,q,Ne,bo,Tr,Zt,Ee(j),vo,Po,un,wn,So];function cn(t,e){if(e.kind==="error")return null;if(t.kind==="array"){if(e.kind==="array"&&(e.N===0&&e.itemType.kind==="value"||!cn(t.itemType,e.itemType))&&(typeof t.N!="number"||t.N===e.N))return null}else{if(t.kind===e.kind)return null;if(t.kind==="value"){for(let r of _h)if(!cn(r,e))return null}}return`Expected ${se(t)} but found ${se(e)} instead.`}l(cn,"checkSubtype");function Gs(t,e){return e.some(r=>r.kind===t.kind)}l(Gs,"isValidType");function Jt(t,e){return e.some(r=>r==="null"?t===null:r==="array"?Array.isArray(t):r==="object"?t&&!Array.isArray(t)&&typeof t=="object":r===typeof t)}l(Jt,"isValidNativeType");function At(t,e){return t.kind==="array"&&e.kind==="array"?t.itemType.kind===e.itemType.kind&&typeof t.N=="number":t.kind===e.kind}l(At,"verifyType");var Zu=.96422,Ju=1,Yu=.82521,Ku=4/29,Pr=6/29,Qu=3*Pr*Pr,Ih=Pr*Pr*Pr,Th=Math.PI/180,Ch=180/Math.PI;function ec(t){return t=t%360,t<0&&(t+=360),t}l(ec,"constrainAngle");function tc([t,e,r,n]){t=ys(t),e=ys(e),r=ys(r);let i,o,a=ms((.2225045*t+.7168786*e+.0606169*r)/Ju);t===e&&e===r?i=o=a:(i=ms((.4360747*t+.3850649*e+.1430804*r)/Zu),o=ms((.0139322*t+.0971045*e+.7141733*r)/Yu));let s=116*a-16;return[s<0?0:s,500*(i-a),200*(a-o),n]}l(tc,"rgbToLab");function ys(t){return t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}l(ys,"rgb2xyz");function ms(t){return t>Ih?Math.pow(t,1/3):t/Qu+Ku}l(ms,"xyz2lab");function rc([t,e,r,n]){let i=(t+16)/116,o=isNaN(e)?i:i+e/500,a=isNaN(r)?i:i-r/200;return i=Ju*ds(i),o=Zu*ds(o),a=Yu*ds(a),[hs(3.1338561*o-1.6168667*i-.4906146*a),hs(-.9787684*o+1.9161415*i+.033454*a),hs(.0719453*o-.2289914*i+1.4052427*a),n]}l(rc,"labToRgb");function hs(t){return t=t<=.00304?12.92*t:1.055*Math.pow(t,1/2.4)-.055,t<0?0:t>1?1:t}l(hs,"xyz2rgb");function ds(t){return t>Pr?t*t*t:Qu*(t-Ku)}l(ds,"lab2xyz");function kh(t){let[e,r,n,i]=tc(t),o=Math.sqrt(r*r+n*n);return[Math.round(o*1e4)?ec(Math.atan2(n,r)*Ch):NaN,o,e,i]}l(kh,"rgbToHcl");function Fh([t,e,r,n]){return t=isNaN(t)?0:t*Th,rc([r,Math.cos(t)*e,Math.sin(t)*e,n])}l(Fh,"hclToRgb");function Eh([t,e,r,n]){t=ec(t),e/=100,r/=100;function i(o){let a=(o+t/30)%12,s=e*Math.min(r,1-r);return r-s*Math.max(-1,Math.min(a-3,9-a,1))}return l(i,"f"),[i(0),i(8),i(4),n]}l(Eh,"hslToRgb");var Mh=Object.hasOwn||l(function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},"hasOwnProperty");function sn(t,e){return Mh(t,e)?t[e]:void 0}l(sn,"getOwn");function Lh(t){if(t=t.toLowerCase().trim(),t==="transparent")return[0,0,0,0];let e=sn(Dh,t);if(e){let[i,o,a]=e;return[i/255,o/255,a/255,1]}if(t.startsWith("#")&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(t)){let o=t.length<6?1:2,a=1;return[Qi(t.slice(a,a+=o)),Qi(t.slice(a,a+=o)),Qi(t.slice(a,a+=o)),Qi(t.slice(a,a+o)||"ff")]}if(t.startsWith("rgb")){let i=/^rgba?\(\s*([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/,o=t.match(i);if(o){let[a,s,u,c,p,f,y,m,h,d,x,b]=o,P=[c||" ",y||" ",d].join("");if(P===" "||P===" /"||P===",,"||P===",,,"){let v=[u,f,h].join(""),S=v==="%%%"?100:v===""?255:0;if(S){let _=[xr(+s/S,0,1),xr(+p/S,0,1),xr(+m/S,0,1),x?ku(+x,b):1];if(Fu(_))return _}}return}}let r=/^hsla?\(\s*([\de.+-]+)(?:deg)?(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/,n=t.match(r);if(n){let[i,o,a,s,u,c,p,f,y]=n,m=[a||" ",u||" ",p].join("");if(m===" "||m===" /"||m===",,"||m===",,,"){let h=[+o,xr(+s,0,100),xr(+c,0,100),f?ku(+f,y):1];if(Fu(h))return Eh(h)}}}l(Lh,"parseCssColor");function Qi(t){return parseInt(t.padEnd(2,t),16)/255}l(Qi,"parseHex");function ku(t,e){return xr(e?t/100:t,0,1)}l(ku,"parseAlpha");function xr(t,e,r){return Math.min(Math.max(e,t),r)}l(xr,"clamp");function Fu(t){return!t.some(Number.isNaN)}l(Fu,"validateNumbers");var Dh={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]};function It(t,e,r){return t+r*(e-t)}l(It,"interpolateNumber");function wr(t,e,r){return t.map((n,i)=>It(n,e[i],r))}l(wr,"interpolateArray");function Bh(t){return t==="rgb"||t==="hcl"||t==="lab"}l(Bh,"isSupportedInterpolationColorSpace");var Y=class t{static{l(this,"Color")}constructor(e,r,n,i=1,o=!0){this.r=e,this.g=r,this.b=n,this.a=i,o||(this.r*=i,this.g*=i,this.b*=i,i||this.overwriteGetter("rgb",[e,r,n,i]))}static parse(e){if(e instanceof t)return e;if(typeof e!="string")return;let r=Lh(e);if(r)return new t(...r,!1)}get rgb(){let{r:e,g:r,b:n,a:i}=this,o=i||1/0;return this.overwriteGetter("rgb",[e/o,r/o,n/o,i])}get hcl(){return this.overwriteGetter("hcl",kh(this.rgb))}get lab(){return this.overwriteGetter("lab",tc(this.rgb))}overwriteGetter(e,r){return Object.defineProperty(this,e,{value:r}),r}toString(){let[e,r,n,i]=this.rgb;return`rgba(${[e,r,n].map(o=>Math.round(o*255)).join(",")},${i})`}static interpolate(e,r,n,i="rgb"){switch(i){case"rgb":{let[o,a,s,u]=wr(e.rgb,r.rgb,n);return new t(o,a,s,u,!1)}case"hcl":{let[o,a,s,u]=e.hcl,[c,p,f,y]=r.hcl,m,h;if(!isNaN(o)&&!isNaN(c)){let v=c-o;c>o&&v>180?v-=360:c<o&&o-c>180&&(v+=360),m=o+n*v}else isNaN(o)?isNaN(c)?m=NaN:(m=c,(s===1||s===0)&&(h=p)):(m=o,(f===1||f===0)&&(h=a));let[d,x,b,P]=Fh([m,h??It(a,p,n),It(s,f,n),It(u,y,n)]);return new t(d,x,b,P,!1)}case"lab":{let[o,a,s,u]=rc(wr(e.lab,r.lab,n));return new t(o,a,s,u,!1)}}}};Y.black=new Y(0,0,0,1);Y.white=new Y(1,1,1,1);Y.transparent=new Y(0,0,0,0);Y.red=new Y(1,0,0,1);var pn=class{static{l(this,"Collator")}constructor(e,r,n){e?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(e,r){return this.collator.compare(e,r)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}},Vh=["bottom","center","top"],fn=class{static{l(this,"FormattedSection")}constructor(e,r,n,i,o,a){this.text=e,this.image=r,this.scale=n,this.fontStack=i,this.textColor=o,this.verticalAlign=a}},Le=class t{static{l(this,"Formatted")}constructor(e){this.sections=e}static fromString(e){return new t([new fn(e,null,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 t?e:t.fromString(e)}toString(){return this.sections.length===0?"":this.sections.map(e=>e.text).join("")}},Ue=class t{static{l(this,"Padding")}constructor(e){this.values=e.slice()}static parse(e){if(e instanceof t)return e;if(typeof e=="number")return new t([e,e,e,e]);if(Array.isArray(e)&&!(e.length<1||e.length>4)){for(let r of e)if(typeof r!="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 t(e)}}toString(){return JSON.stringify(this.values)}static interpolate(e,r,n){return new t(wr(e.values,r.values,n))}},$e=class t{static{l(this,"NumberArray")}constructor(e){this.values=e.slice()}static parse(e){if(e instanceof t)return e;if(typeof e=="number")return new t([e]);if(Array.isArray(e)){for(let r of e)if(typeof r!="number")return;return new t(e)}}toString(){return JSON.stringify(this.values)}static interpolate(e,r,n){return new t(wr(e.values,r.values,n))}},Ae=class t{static{l(this,"ColorArray")}constructor(e){this.values=e.slice()}static parse(e){if(e instanceof t)return e;if(typeof e=="string"){let n=Y.parse(e);return n?new t([n]):void 0}if(!Array.isArray(e))return;let r=[];for(let n of e){if(typeof n!="string")return;let i=Y.parse(n);if(!i)return;r.push(i)}return new t(r)}toString(){return JSON.stringify(this.values)}static interpolate(e,r,n,i="rgb"){let o=[];if(e.values.length!=r.values.length)throw new Error(`colorArray: Arrays have mismatched length (${e.values.length} vs. ${r.values.length}), cannot interpolate.`);for(let a=0;a<e.values.length;a++)o.push(Y.interpolate(e.values[a],r.values[a],n,i));return new t(o)}},ae=class extends Error{static{l(this,"RuntimeError")}constructor(e){super(e),this.name="RuntimeError"}toJSON(){return this.message}},Rh=new Set(["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"]),De=class t{static{l(this,"VariableAnchorOffsetCollection")}constructor(e){this.values=e.slice()}static parse(e){if(e instanceof t)return e;if(!(!Array.isArray(e)||e.length<1||e.length%2!==0)){for(let r=0;r<e.length;r+=2){let n=e[r],i=e[r+1];if(typeof n!="string"||!Rh.has(n)||!Array.isArray(i)||i.length!==2||typeof i[0]!="number"||typeof i[1]!="number")return}return new t(e)}}toString(){return JSON.stringify(this.values)}static interpolate(e,r,n){let i=e.values,o=r.values;if(i.length!==o.length)throw new ae(`Cannot interpolate values of different length. from: ${e.toString()}, to: ${r.toString()}`);let a=[];for(let s=0;s<i.length;s+=2){if(i[s]!==o[s])throw new ae(`Cannot interpolate values containing mismatched anchors. from[${s}]: ${i[s]}, to[${s}]: ${o[s]}`);a.push(i[s]);let[u,c]=i[s+1],[p,f]=o[s+1];a.push([It(u,p,n),It(c,f,n)])}return new t(a)}},_e=class t{static{l(this,"ResolvedImage")}constructor(e){this.name=e.name,this.available=e.available}toString(){return this.name}static fromString(e){return e?new t({name:e,available:!1}):null}},Tt=class t{static{l(this,"ProjectionDefinition")}constructor(e,r,n){this.from=e,this.to=r,this.transition=n}static interpolate(e,r,n){return new t(e,r,n)}static parse(e){if(e instanceof t)return e;if(Array.isArray(e)&&e.length===3&&typeof e[0]=="string"&&typeof e[1]=="string"&&typeof e[2]=="number")return new t(e[0],e[1],e[2]);if(typeof e=="object"&&typeof e.from=="string"&&typeof e.to=="string"&&typeof e.transition=="number")return new t(e.from,e.to,e.transition);if(typeof e=="string")return new t(e,e,1)}};function nc(t,e,r,n){return typeof t=="number"&&t>=0&&t<=255&&typeof e=="number"&&e>=0&&e<=255&&typeof r=="number"&&r>=0&&r<=255?typeof n>"u"||typeof n=="number"&&n>=0&&n<=1?null:`Invalid rgba value [${[t,e,r,n].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${(typeof n=="number"?[t,e,r,n]:[t,e,r]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}l(nc,"validateRGBA");function yn(t){if(t===null||typeof t=="string"||typeof t=="boolean"||typeof t=="number"||t instanceof Tt||t instanceof Y||t instanceof pn||t instanceof Le||t instanceof Ue||t instanceof $e||t instanceof Ae||t instanceof De||t instanceof _e)return!0;if(Array.isArray(t)){for(let e of t)if(!yn(e))return!1;return!0}else if(typeof t=="object"){for(let e in t)if(!yn(t[e]))return!1;return!0}else return!1}l(yn,"isValue");function fe(t){if(t===null)return Ir;if(typeof t=="string")return W;if(typeof t=="boolean")return q;if(typeof t=="number")return M;if(t instanceof Y)return Ne;if(t instanceof Tt)return bo;if(t instanceof pn)return xo;if(t instanceof Le)return Tr;if(t instanceof Ue)return vo;if(t instanceof $e)return Po;if(t instanceof Ae)return un;if(t instanceof De)return So;if(t instanceof _e)return wn;if(Array.isArray(t)){let e=t.length,r;for(let n of t){let i=fe(n);if(!r)r=i;else{if(r===i)continue;r=j;break}}return Ee(r||j,e)}else return Zt}l(fe,"typeOf");function ln(t){let e=typeof t;return t===null?"":e==="string"||e==="number"||e==="boolean"?String(t):t instanceof Y||t instanceof Tt||t instanceof Le||t instanceof Ue||t instanceof $e||t instanceof Ae||t instanceof De||t instanceof _e?t.toString():JSON.stringify(t)}l(ln,"valueToString");var Ct=class t{static{l(this,"Literal")}constructor(e,r){this.type=e,this.value=r}static parse(e,r){if(e.length!==2)return r.error(`'literal' expression requires exactly one argument, but found ${e.length-1} instead.`);if(!yn(e[1]))return r.error("invalid value");let n=e[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 t(i,n)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}},eo={string:W,number:M,boolean:q,object:Zt},We=class t{static{l(this,"Assertion")}constructor(e,r){this.type=e,this.args=r}static parse(e,r){if(e.length<2)return r.error("Expected at least one argument.");let n=1,i,o=e[0];if(o==="array"){let s;if(e.length>2){let c=e[1];if(typeof c!="string"||!(c in eo)||c==="object")return r.error('The item type argument of "array" must be one of string, number, boolean',1);s=eo[c],n++}else s=j;let u;if(e.length>3){if(e[2]!==null&&(typeof e[2]!="number"||e[2]<0||e[2]!==Math.floor(e[2])))return r.error('The length argument to "array" must be a positive integer literal',2);u=e[2],n++}i=Ee(s,u)}else{if(!eo[o])throw new Error(`Types doesn't contain name = ${o}`);i=eo[o]}let a=[];for(;n<e.length;n++){let s=r.parse(e[n],n,j);if(!s)return null;a.push(s)}return new t(i,a)}evaluate(e){for(let r=0;r<this.args.length;r++){let n=this.args[r].evaluate(e);if(cn(this.type,fe(n))){if(r===this.args.length-1)throw new ae(`Expected value to be of type ${se(this.type)}, but found ${se(fe(n))} instead.`)}else return n}throw new Error}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}},Eu={"to-boolean":q,"to-color":Ne,"to-number":M,"to-string":W},_t=class t{static{l(this,"Coercion")}constructor(e,r){this.type=e,this.args=r}static parse(e,r){if(e.length<2)return r.error("Expected at least one argument.");let n=e[0];if(!Eu[n])throw new Error(`Can't parse ${n} as it is not part of the known types`);if((n==="to-boolean"||n==="to-string")&&e.length!==2)return r.error("Expected one argument.");let i=Eu[n],o=[];for(let a=1;a<e.length;a++){let s=r.parse(e[a],a,j);if(!s)return null;o.push(s)}return new t(i,o)}evaluate(e){switch(this.type.kind){case"boolean":return!!this.args[0].evaluate(e);case"color":{let r,n;for(let i of this.args){if(r=i.evaluate(e),n=null,r instanceof Y)return r;if(typeof r=="string"){let o=e.parseColor(r);if(o)return o}else if(Array.isArray(r)&&(r.length<3||r.length>4?n=`Invalid rgba value ${JSON.stringify(r)}: expected an array containing either three or four numeric values.`:n=nc(r[0],r[1],r[2],r[3]),!n))return new Y(r[0]/255,r[1]/255,r[2]/255,r[3])}throw new ae(n||`Could not parse color from value '${typeof r=="string"?r:JSON.stringify(r)}'`)}case"padding":{let r;for(let n of this.args){r=n.evaluate(e);let i=Ue.parse(r);if(i)return i}throw new ae(`Could not parse padding from value '${typeof r=="string"?r:JSON.stringify(r)}'`)}case"numberArray":{let r;for(let n of this.args){r=n.evaluate(e);let i=$e.parse(r);if(i)return i}throw new ae(`Could not parse numberArray from value '${typeof r=="string"?r:JSON.stringify(r)}'`)}case"colorArray":{let r;for(let n of this.args){r=n.evaluate(e);let i=Ae.parse(r);if(i)return i}throw new ae(`Could not parse colorArray from value '${typeof r=="string"?r:JSON.stringify(r)}'`)}case"variableAnchorOffsetCollection":{let r;for(let n of this.args){r=n.evaluate(e);let i=De.parse(r);if(i)return i}throw new ae(`Could not parse variableAnchorOffsetCollection from value '${typeof r=="string"?r:JSON.stringify(r)}'`)}case"number":{let r=null;for(let n of this.args){if(r=n.evaluate(e),r===null)return 0;let i=Number(r);if(!isNaN(i))return i}throw new ae(`Could not convert ${JSON.stringify(r)} to number.`)}case"formatted":return Le.fromString(ln(this.args[0].evaluate(e)));case"resolvedImage":return _e.fromString(ln(this.args[0].evaluate(e)));case"projectionDefinition":return this.args[0].evaluate(e);default:return ln(this.args[0].evaluate(e))}}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}},zh=["Unknown","Point","LineString","Polygon"],io=class{static{l(this,"EvaluationContext")}constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache=new Map,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"?zh[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 r=this._parseColorCache.get(e);return r||(r=Y.parse(e),this._parseColorCache.set(e,r)),r}},oo=class t{static{l(this,"ParsingContext")}constructor(e,r,n=[],i,o=new Ss,a=[]){this.registry=e,this.path=n,this.key=n.map(s=>`[${s}]`).join(""),this.scope=o,this.errors=a,this.expectedType=i,this._isConstant=r}parse(e,r,n,i,o={}){return r?this.concat(r,n,i)._parse(e,o):this._parse(e,o)}_parse(e,r){(e===null||typeof e=="string"||typeof e=="boolean"||typeof e=="number")&&(e=["literal",e]);function n(i,o,a){return a==="assert"?new We(o,[i]):a==="coerce"?new _t(o,[i]):i}if(l(n,"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 i=e[0];if(typeof i!="string")return this.error(`Expression name must be a string, but found ${typeof i} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;let o=this.registry[i];if(o){let a=o.parse(e,this);if(!a)return null;if(this.expectedType){let s=this.expectedType,u=a.type;if((s.kind==="string"||s.kind==="number"||s.kind==="boolean"||s.kind==="object"||s.kind==="array")&&u.kind==="value")a=n(a,s,r.typeAnnotation||"assert");else if(s.kind==="projectionDefinition"&&["string","array"].includes(u.kind)||["color","formatted","resolvedImage"].includes(s.kind)&&["value","string"].includes(u.kind)||["padding","numberArray"].includes(s.kind)&&["value","number","array"].includes(u.kind)||s.kind==="colorArray"&&["value","string","array"].includes(u.kind)||s.kind==="variableAnchorOffsetCollection"&&["value","array"].includes(u.kind))a=n(a,s,r.typeAnnotation||"coerce");else if(this.checkSubtype(s,u))return null}if(!(a instanceof Ct)&&a.type.kind!=="resolvedImage"&&this._isConstant(a)){let s=new io;try{a=new Ct(a.type,a.evaluate(s))}catch(u){return this.error(u.message),null}}return a}return this.error(`Unknown expression "${i}". 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 ${typeof e} instead.`)}concat(e,r,n){let i=typeof e=="number"?this.path.concat(e):this.path,o=n?this.scope.concat(n):this.scope;return new t(this.registry,this._isConstant,i,r||null,o,this.errors)}error(e,...r){let n=`${this.key}${r.map(i=>`[${i}]`).join("")}`;this.errors.push(new Oe(n,e))}checkSubtype(e,r){let n=cn(e,r);return n&&this.error(n),n}},ao=class t{static{l(this,"Let")}constructor(e,r){this.type=r.type,this.bindings=[].concat(e),this.result=r}evaluate(e){return this.result.evaluate(e)}eachChild(e){for(let r of this.bindings)e(r[1]);e(this.result)}static parse(e,r){if(e.length<4)return r.error(`Expected at least 3 arguments, but found ${e.length-1} instead.`);let n=[];for(let o=1;o<e.length-1;o+=2){let a=e[o];if(typeof a!="string")return r.error(`Expected string, but found ${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(e[o+1],o+1);if(!s)return null;n.push([a,s])}let i=r.parse(e[e.length-1],e.length-1,r.expectedType,n);return i?new t(n,i):null}outputDefined(){return this.result.outputDefined()}},so=class t{static{l(this,"Var")}constructor(e,r){this.type=r.type,this.name=e,this.boundExpression=r}static parse(e,r){if(e.length!==2||typeof e[1]!="string")return r.error("'var' expression requires exactly one string literal argument.");let n=e[1];return r.scope.has(n)?new t(n,r.scope.get(n)):r.error(`Unknown variable "${n}". Make sure "${n}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(e){return this.boundExpression.evaluate(e)}eachChild(){}outputDefined(){return!1}},ws=class t{static{l(this,"At")}constructor(e,r,n){this.type=e,this.index=r,this.input=n}static parse(e,r){if(e.length!==3)return r.error(`Expected 2 arguments, but found ${e.length-1} instead.`);let n=r.parse(e[1],1,M),i=r.parse(e[2],2,Ee(r.expectedType||j));if(!n||!i)return null;let o=i.type;return new t(o.itemType,n,i)}evaluate(e){let r=this.index.evaluate(e),n=this.input.evaluate(e);if(r<0)throw new ae(`Array index out of bounds: ${r} < 0.`);if(r>=n.length)throw new ae(`Array index out of bounds: ${r} > ${n.length-1}.`);if(r!==Math.floor(r))throw new ae(`Array index must be an integer, but found ${r} instead.`);return n[r]}eachChild(e){e(this.index),e(this.input)}outputDefined(){return!1}},As=class t{static{l(this,"In")}constructor(e,r){this.type=q,this.needle=e,this.haystack=r}static parse(e,r){if(e.length!==3)return r.error(`Expected 2 arguments, but found ${e.length-1} instead.`);let n=r.parse(e[1],1,j),i=r.parse(e[2],2,j);return!n||!i?null:Gs(n.type,[q,W,M,Ir,j])?new t(n,i):r.error(`Expected first argument to be of type boolean, string, number or null, but found ${se(n.type)} instead`)}evaluate(e){let r=this.needle.evaluate(e),n=this.haystack.evaluate(e);if(!n)return!1;if(!Jt(r,["boolean","string","number","null"]))throw new ae(`Expected first argument to be of type boolean, string, number or null, but found ${se(fe(r))} instead.`);if(!Jt(n,["string","array"]))throw new ae(`Expected second argument to be of type array or string, but found ${se(fe(n))} instead.`);return n.indexOf(r)>=0}eachChild(e){e(this.needle),e(this.haystack)}outputDefined(){return!0}},_s=class t{static{l(this,"IndexOf")}constructor(e,r,n){this.type=M,this.needle=e,this.haystack=r,this.fromIndex=n}static parse(e,r){if(e.length<=2||e.length>=5)return r.error(`Expected 3 or 4 arguments, but found ${e.length-1} instead.`);let n=r.parse(e[1],1,j),i=r.parse(e[2],2,j);if(!n||!i)return null;if(!Gs(n.type,[q,W,M,Ir,j]))return r.error(`Expected first argument to be of type boolean, string, number or null, but found ${se(n.type)} instead`);if(e.length===4){let o=r.parse(e[3],3,M);return o?new t(n,i,o):null}else return new t(n,i)}evaluate(e){let r=this.needle.evaluate(e),n=this.haystack.evaluate(e);if(!Jt(r,["boolean","string","number","null"]))throw new ae(`Expected first argument to be of type boolean, string, number or null, but found ${se(fe(r))} instead.`);let i;if(this.fromIndex&&(i=this.fromIndex.evaluate(e)),Jt(n,["string"])){let o=n.indexOf(r,i);return o===-1?-1:[...n.slice(0,o)].length}else{if(Jt(n,["array"]))return n.indexOf(r,i);throw new ae(`Expected second argument to be of type array or string, but found ${se(fe(n))} instead.`)}}eachChild(e){e(this.needle),e(this.haystack),this.fromIndex&&e(this.fromIndex)}outputDefined(){return!1}},Is=class t{static{l(this,"Match")}constructor(e,r,n,i,o,a){this.inputType=e,this.type=r,this.input=n,this.cases=i,this.outputs=o,this.otherwise=a}static parse(e,r){if(e.length<5)return r.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if(e.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 c=2;c<e.length-1;c+=2){let p=e[c],f=e[c+1];Array.isArray(p)||(p=[p]);let y=r.concat(c);if(p.length===0)return y.error("Expected at least one branch label.");for(let h of p){if(typeof h!="number"&&typeof h!="string")return y.error("Branch labels must be numbers or strings.");if(typeof h=="number"&&Math.abs(h)>Number.MAX_SAFE_INTEGER)return y.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if(typeof h=="number"&&Math.floor(h)!==h)return y.error("Numeric branch labels must be integer values.");if(!n)n=fe(h);else if(y.checkSubtype(n,fe(h)))return null;if(typeof o[String(h)]<"u")return y.error("Branch labels must be unique.");o[String(h)]=a.length}let m=r.parse(f,c,i);if(!m)return null;i=i||m.type,a.push(m)}let s=r.parse(e[1],1,j);if(!s)return null;let u=r.parse(e[e.length-1],e.length-1,i);return!u||s.type.kind!=="value"&&r.concat(1).checkSubtype(n,s.type)?null:new t(n,i,s,o,a,u)}evaluate(e){let r=this.input.evaluate(e);return(fe(r)===this.inputType&&this.outputs[this.cases[r]]||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()}},Ts=class t{static{l(this,"Case")}constructor(e,r,n){this.type=e,this.branches=r,this.otherwise=n}static parse(e,r){if(e.length<4)return r.error(`Expected at least 3 arguments, but found only ${e.length-1}.`);if(e.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<e.length-1;a+=2){let s=r.parse(e[a],a,q);if(!s)return null;let u=r.parse(e[a+1],a+1,n);if(!u)return null;i.push([s,u]),n=n||u.type}let o=r.parse(e[e.length-1],e.length-1,n);if(!o)return null;if(!n)throw new Error("Can't infer output type");return new t(n,i,o)}evaluate(e){for(let[r,n]of this.branches)if(r.evaluate(e))return n.evaluate(e);return this.otherwise.evaluate(e)}eachChild(e){for(let[r,n]of this.branches)e(r),e(n);e(this.otherwise)}outputDefined(){return this.branches.every(([e,r])=>r.outputDefined())&&this.otherwise.outputDefined()}},Cs=class t{static{l(this,"Slice")}constructor(e,r,n,i){this.type=e,this.input=r,this.beginIndex=n,this.endIndex=i}static parse(e,r){if(e.length<=2||e.length>=5)return r.error(`Expected 3 or 4 arguments, but found ${e.length-1} instead.`);let n=r.parse(e[1],1,j),i=r.parse(e[2],2,M);if(!n||!i)return null;if(!Gs(n.type,[Ee(j),W,j]))return r.error(`Expected first argument to be of type array or string, but found ${se(n.type)} instead`);if(e.length===4){let o=r.parse(e[3],3,M);return o?new t(n.type,n,i,o):null}else return new t(n.type,n,i)}evaluate(e){let r=this.input.evaluate(e),n=this.beginIndex.evaluate(e),i;if(this.endIndex&&(i=this.endIndex.evaluate(e)),Jt(r,["string"]))return[...r].slice(n,i).join("");if(Jt(r,["array"]))return r.slice(n,i);throw new ae(`Expected first argument to be of type array or string, but found ${se(fe(r))} instead.`)}eachChild(e){e(this.input),e(this.beginIndex),this.endIndex&&e(this.endIndex)}outputDefined(){return!1}};function wo(t,e){let r=t.length-1,n=0,i=r,o=0,a,s;for(;n<=i;)if(o=Math.floor((n+i)/2),a=t[o],s=t[o+1],a<=e){if(o===r||e<s)return o;n=o+1}else if(a>e)i=o-1;else throw new ae("Input is not a number.");return 0}l(wo,"findStopLessThanOrEqualTo");var Ar=class t{static{l(this,"Step")}constructor(e,r,n){this.type=e,this.input=r,this.labels=[],this.outputs=[];for(let[i,o]of n)this.labels.push(i),this.outputs.push(o)}static parse(e,r){if(e.length-1<4)return r.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!==0)return r.error("Expected an even number of arguments.");let n=r.parse(e[1],1,M);if(!n)return null;let i=[],o=null;r.expectedType&&r.expectedType.kind!=="value"&&(o=r.expectedType);for(let a=1;a<e.length;a+=2){let s=a===1?-1/0:e[a],u=e[a+1],c=a,p=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.',c);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.',c);let f=r.parse(u,p,o);if(!f)return null;o=o||f.type,i.push([s,f])}return new t(o,n,i)}evaluate(e){let r=this.labels,n=this.outputs;if(r.length===1)return n[0].evaluate(e);let i=this.input.evaluate(e);if(i<=r[0])return n[0].evaluate(e);let o=r.length;if(i>=r[o-1])return n[o-1].evaluate(e);let a=wo(r,i);return n[a].evaluate(e)}eachChild(e){e(this.input);for(let r of this.outputs)e(r)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}};function Oh(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}l(Oh,"getDefaultExportFromCjs");var gs,Mu;function Gh(){if(Mu)return gs;Mu=1,gs=t;function t(e,r,n,i){this.cx=3*e,this.bx=3*(n-e)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*r,this.by=3*(i-r)-this.cy,this.ay=1-this.cy-this.by,this.p1x=e,this.p1y=r,this.p2x=n,this.p2y=i}return l(t,"UnitBezier"),t.prototype={sampleCurveX:l(function(e){return((this.ax*e+this.bx)*e+this.cx)*e},"sampleCurveX"),sampleCurveY:l(function(e){return((this.ay*e+this.by)*e+this.cy)*e},"sampleCurveY"),sampleCurveDerivativeX:l(function(e){return(3*this.ax*e+2*this.bx)*e+this.cx},"sampleCurveDerivativeX"),solveCurveX:l(function(e,r){if(r===void 0&&(r=1e-6),e<0)return 0;if(e>1)return 1;for(var n=e,i=0;i<8;i++){var o=this.sampleCurveX(n)-e;if(Math.abs(o)<r)return n;var a=this.sampleCurveDerivativeX(n);if(Math.abs(a)<1e-6)break;n=n-o/a}var s=0,u=1;for(n=e,i=0;i<20&&(o=this.sampleCurveX(n),!(Math.abs(o-e)<r));i++)e>o?s=n:u=n,n=(u-s)*.5+s;return n},"solveCurveX"),solve:l(function(e,r){return this.sampleCurveY(this.solveCurveX(e,r))},"solve")},gs}l(Gh,"requireUnitbezier");var Nh=Gh(),Uh=Oh(Nh),Me=class t{static{l(this,"Interpolate")}constructor(e,r,n,i,o){this.type=e,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(e,r,n,i){let o=0;if(e.name==="exponential")o=bs(r,e.base,n,i);else if(e.name==="linear")o=bs(r,1,n,i);else if(e.name==="cubic-bezier"){let a=e.controlPoints;o=new Uh(a[0],a[1],a[2],a[3]).solve(bs(r,1,n,i))}return o}static parse(e,r){let[n,i,o,...a]=e;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 c=i[1];if(typeof c!="number")return r.error("Exponential interpolation requires a numeric base.",1,1);i={name:"exponential",base:c}}else if(i[0]==="cubic-bezier"){let c=i.slice(1);if(c.length!==4||c.some(p=>typeof p!="number"||p<0||p>1))return r.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);i={name:"cubic-bezier",controlPoints:c}}else return r.error(`Unknown interpolation type ${String(i[0])}`,1,0);if(e.length-1<4)return r.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!==0)return r.error("Expected an even number of arguments.");if(o=r.parse(o,2,M),!o)return null;let s=[],u=null;(n==="interpolate-hcl"||n==="interpolate-lab")&&r.expectedType!=un?u=Ne:r.expectedType&&r.expectedType.kind!=="value"&&(u=r.expectedType);for(let c=0;c<a.length;c+=2){let p=a[c],f=a[c+1],y=c+3,m=c+4;if(typeof p!="number")return r.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',y);if(s.length&&s[s.length-1][0]>=p)return r.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',y);let h=r.parse(f,m,u);if(!h)return null;u=u||h.type,s.push([p,h])}return!At(u,M)&&!At(u,bo)&&!At(u,Ne)&&!At(u,vo)&&!At(u,Po)&&!At(u,un)&&!At(u,So)&&!At(u,Ee(M))?r.error(`Type ${se(u)} is not interpolatable.`):new t(u,n,i,o,s)}evaluate(e){let r=this.labels,n=this.outputs;if(r.length===1)return n[0].evaluate(e);let i=this.input.evaluate(e);if(i<=r[0])return n[0].evaluate(e);let o=r.length;if(i>=r[o-1])return n[o-1].evaluate(e);let a=wo(r,i),s=r[a],u=r[a+1],c=t.interpolationFactor(this.interpolation,i,s,u),p=n[a].evaluate(e),f=n[a+1].evaluate(e);switch(this.operator){case"interpolate":switch(this.type.kind){case"number":return It(p,f,c);case"color":return Y.interpolate(p,f,c);case"padding":return Ue.interpolate(p,f,c);case"colorArray":return Ae.interpolate(p,f,c);case"numberArray":return $e.interpolate(p,f,c);case"variableAnchorOffsetCollection":return De.interpolate(p,f,c);case"array":return wr(p,f,c);case"projectionDefinition":return Tt.interpolate(p,f,c)}case"interpolate-hcl":switch(this.type.kind){case"color":return Y.interpolate(p,f,c,"hcl");case"colorArray":return Ae.interpolate(p,f,c,"hcl")}case"interpolate-lab":switch(this.type.kind){case"color":return Y.interpolate(p,f,c,"lab");case"colorArray":return Ae.interpolate(p,f,c,"lab")}}}eachChild(e){e(this.input);for(let r of this.outputs)e(r)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}};function bs(t,e,r,n){let i=n-r,o=t-r;return i===0?0:e===1?o/i:(Math.pow(e,o)-1)/(Math.pow(e,i)-1)}l(bs,"exponentialInterpolation");var pt={color:Y.interpolate,number:It,padding:Ue.interpolate,numberArray:$e.interpolate,colorArray:Ae.interpolate,variableAnchorOffsetCollection:De.interpolate,array:wr},lo=class t{static{l(this,"Coalesce")}constructor(e,r){this.type=e,this.args=r}static parse(e,r){if(e.length<2)return r.error("Expected at least one argument.");let n=null,i=r.expectedType;i&&i.kind!=="value"&&(n=i);let o=[];for(let s of e.slice(1)){let u=r.parse(s,1+o.length,n,void 0,{typeAnnotation:"omit"});if(!u)return null;n=n||u.type,o.push(u)}if(!n)throw new Error("No output type");return i&&o.some(s=>cn(i,s.type))?new t(j,o):new t(n,o)}evaluate(e){let r=null,n=0,i;for(let o of this.args)if(n++,r=o.evaluate(e),r&&r instanceof _e&&!r.available&&(i||(i=r.name),r=null,n===this.args.length&&(r=i)),r!==null)break;return r}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}};function Lu(t,e){return t==="=="||t==="!="?e.kind==="boolean"||e.kind==="string"||e.kind==="number"||e.kind==="null"||e.kind==="value":e.kind==="string"||e.kind==="number"||e.kind==="value"}l(Lu,"isComparableType");function $h(t,e,r){return e===r}l($h,"eq");function jh(t,e,r){return e!==r}l(jh,"neq");function qh(t,e,r){return e<r}l(qh,"lt");function Wh(t,e,r){return e>r}l(Wh,"gt");function Xh(t,e,r){return e<=r}l(Xh,"lteq");function Hh(t,e,r){return e>=r}l(Hh,"gteq");function ic(t,e,r,n){return n.compare(e,r)===0}l(ic,"eqCollate");function Zh(t,e,r,n){return!ic(t,e,r,n)}l(Zh,"neqCollate");function Jh(t,e,r,n){return n.compare(e,r)<0}l(Jh,"ltCollate");function Yh(t,e,r,n){return n.compare(e,r)>0}l(Yh,"gtCollate");function Kh(t,e,r,n){return n.compare(e,r)<=0}l(Kh,"lteqCollate");function Qh(t,e,r,n){return n.compare(e,r)>=0}l(Qh,"gteqCollate");function Cr(t,e,r){let n=t!=="=="&&t!=="!=";return class oc{static{l(this,"Comparison")}constructor(o,a,s){this.type=q,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],u=a.parse(o[1],1,j);if(!u)return null;if(!Lu(s,u.type))return a.concat(1).error(`"${s}" comparisons are not supported for type '${se(u.type)}'.`);let c=a.parse(o[2],2,j);if(!c)return null;if(!Lu(s,c.type))return a.concat(2).error(`"${s}" comparisons are not supported for type '${se(c.type)}'.`);if(u.type.kind!==c.type.kind&&u.type.kind!=="value"&&c.type.kind!=="value")return a.error(`Cannot compare types '${se(u.type)}' and '${se(c.type)}'.`);n&&(u.type.kind==="value"&&c.type.kind!=="value"?u=new We(c.type,[u]):u.type.kind!=="value"&&c.type.kind==="value"&&(c=new We(u.type,[c])));let p=null;if(o.length===4){if(u.type.kind!=="string"&&c.type.kind!=="string"&&u.type.kind!=="value"&&c.type.kind!=="value")return a.error("Cannot use collator to compare non-string types.");if(p=a.parse(o[3],3,xo),!p)return null}return new oc(u,c,p)}evaluate(o){let a=this.lhs.evaluate(o),s=this.rhs.evaluate(o);if(n&&this.hasUntypedArgument){let u=fe(a),c=fe(s);if(u.kind!==c.kind||!(u.kind==="string"||u.kind==="number"))throw new ae(`Expected arguments for "${t}" to be (string, string) or (number, number), but found (${u.kind}, ${c.kind}) instead.`)}if(this.collator&&!n&&this.hasUntypedArgument){let u=fe(a),c=fe(s);if(u.kind!=="string"||c.kind!=="string")return e(o,a,s)}return this.collator?r(o,a,s,this.collator.evaluate(o)):e(o,a,s)}eachChild(o){o(this.lhs),o(this.rhs),this.collator&&o(this.collator)}outputDefined(){return!0}}}l(Cr,"makeComparison");var ed=Cr("==",$h,ic),td=Cr("!=",jh,Zh),rd=Cr("<",qh,Jh),nd=Cr(">",Wh,Yh),id=Cr("<=",Xh,Kh),od=Cr(">=",Hh,Qh),uo=class t{static{l(this,"CollatorExpression")}constructor(e,r,n){this.type=xo,this.locale=n,this.caseSensitive=e,this.diacriticSensitive=r}static parse(e,r){if(e.length!==2)return r.error("Expected one argument.");let n=e[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,q);if(!i)return null;let o=r.parse(n["diacritic-sensitive"]===void 0?!1:n["diacritic-sensitive"],1,q);if(!o)return null;let a=null;return n.locale&&(a=r.parse(n.locale,1,W),!a)?null:new t(i,o,a)}evaluate(e){return new pn(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}},ks=class t{static{l(this,"NumberFormat")}constructor(e,r,n,i,o){this.type=W,this.number=e,this.locale=r,this.currency=n,this.minFractionDigits=i,this.maxFractionDigits=o}static parse(e,r){if(e.length!==3)return r.error("Expected two arguments.");let n=r.parse(e[1],1,M);if(!n)return null;let i=e[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,W),!o))return null;let a=null;if(i.currency&&(a=r.parse(i.currency,1,W),!a))return null;let s=null;if(i["min-fraction-digits"]&&(s=r.parse(i["min-fraction-digits"],1,M),!s))return null;let u=null;return i["max-fraction-digits"]&&(u=r.parse(i["max-fraction-digits"],1,M),!u)?null:new t(n,o,a,s,u)}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}},mn=class t{static{l(this,"FormatExpression")}constructor(e){this.type=Tr,this.sections=e}static parse(e,r){if(e.length<2)return r.error("Expected at least one argument.");let n=e[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<=e.length-1;++a){let s=e[a];if(o&&typeof s=="object"&&!Array.isArray(s)){o=!1;let u=null;if(s["font-scale"]&&(u=r.parse(s["font-scale"],1,M),!u))return null;let c=null;if(s["text-font"]&&(c=r.parse(s["text-font"],1,Ee(W)),!c))return null;let p=null;if(s["text-color"]&&(p=r.parse(s["text-color"],1,Ne),!p))return null;let f=null;if(s["vertical-align"]){if(typeof s["vertical-align"]=="string"&&!Vh.includes(s["vertical-align"]))return r.error(`'vertical-align' must be one of: 'bottom', 'center', 'top' but found '${s["vertical-align"]}' instead.`);if(f=r.parse(s["vertical-align"],1,W),!f)return null}let y=i[i.length-1];y.scale=u,y.font=c,y.textColor=p,y.verticalAlign=f}else{let u=r.parse(e[a],1,j);if(!u)return null;let c=u.type.kind;if(c!=="string"&&c!=="value"&&c!=="null"&&c!=="resolvedImage")return r.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");o=!0,i.push({content:u,scale:null,font:null,textColor:null,verticalAlign:null})}}return new t(i)}evaluate(e){let r=l(n=>{let i=n.content.evaluate(e);return fe(i)===wn?new fn("",i,null,null,null,n.verticalAlign?n.verticalAlign.evaluate(e):null):new fn(ln(i),null,n.scale?n.scale.evaluate(e):null,n.font?n.font.evaluate(e).join(","):null,n.textColor?n.textColor.evaluate(e):null,n.verticalAlign?n.verticalAlign.evaluate(e):null)},"evaluateSection");return new Le(this.sections.map(r))}eachChild(e){for(let r of this.sections)e(r.content),r.scale&&e(r.scale),r.font&&e(r.font),r.textColor&&e(r.textColor),r.verticalAlign&&e(r.verticalAlign)}outputDefined(){return!1}},Fs=class t{static{l(this,"ImageExpression")}constructor(e){this.type=wn,this.input=e}static parse(e,r){if(e.length!==2)return r.error("Expected two arguments.");let n=r.parse(e[1],1,W);return n?new t(n):r.error("No image name provided.")}evaluate(e){let r=this.input.evaluate(e),n=_e.fromString(r);return n&&e.availableImages&&(n.available=e.availableImages.indexOf(r)>-1),n}eachChild(e){e(this.input)}outputDefined(){return!1}},Es=class t{static{l(this,"Length")}constructor(e){this.type=M,this.input=e}static parse(e,r){if(e.length!==2)return r.error(`Expected 1 argument, but found ${e.length-1} instead.`);let n=r.parse(e[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 ${se(n.type)} instead.`):new t(n):null}evaluate(e){let r=this.input.evaluate(e);if(typeof r=="string")return[...r].length;if(Array.isArray(r))return r.length;throw new ae(`Expected value to be of type string or array, but found ${se(fe(r))} instead.`)}eachChild(e){e(this.input)}outputDefined(){return!1}},Ye=8192;function ad(t,e){let r=sd(t[0]),n=ud(t[1]),i=Math.pow(2,e.z);return[Math.round(r*i*Ye),Math.round(n*i*Ye)]}l(ad,"getTileCoordinates");function Ns(t,e){let r=Math.pow(2,e.z),n=(t[0]/Ye+e.x)/r,i=(t[1]/Ye+e.y)/r;return[ld(n),cd(i)]}l(Ns,"getLngLatFromTileCoord");function sd(t){return(180+t)/360}l(sd,"mercatorXfromLng");function ld(t){return t*360-180}l(ld,"lngFromMercatorXfromLng");function ud(t){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))/360}l(ud,"mercatorYfromLat");function cd(t){return 360/Math.PI*Math.atan(Math.exp((180-t*360)*Math.PI/180))-90}l(cd,"latFromMercatorY");function An(t,e){t[0]=Math.min(t[0],e[0]),t[1]=Math.min(t[1],e[1]),t[2]=Math.max(t[2],e[0]),t[3]=Math.max(t[3],e[1])}l(An,"updateBBox");function hn(t,e){return!(t[0]<=e[0]||t[2]>=e[2]||t[1]<=e[1]||t[3]>=e[3])}l(hn,"boxWithinBox");function pd(t,e,r){return e[1]>t[1]!=r[1]>t[1]&&t[0]<(r[0]-e[0])*(t[1]-e[1])/(r[1]-e[1])+e[0]}l(pd,"rayIntersect");function fd(t,e,r){let n=t[0]-e[0],i=t[1]-e[1],o=t[0]-r[0],a=t[1]-r[1];return n*a-o*i===0&&n*o<=0&&i*a<=0}l(fd,"pointOnBoundary");function Ao(t,e,r,n){let i=[e[0]-t[0],e[1]-t[1]],o=[n[0]-r[0],n[1]-r[1]];return dd(o,i)===0?!1:!!(Du(t,e,r,n)&&Du(r,n,t,e))}l(Ao,"segmentIntersectSegment");function yd(t,e,r){for(let n of r)for(let i=0;i<n.length-1;++i)if(Ao(t,e,n[i],n[i+1]))return!0;return!1}l(yd,"lineIntersectPolygon");function kr(t,e,r=!1){let n=!1;for(let i of e)for(let o=0;o<i.length-1;o++){if(fd(t,i[o],i[o+1]))return r;pd(t,i[o],i[o+1])&&(n=!n)}return n}l(kr,"pointWithinPolygon");function md(t,e){for(let r of e)if(kr(t,r))return!0;return!1}l(md,"pointWithinPolygons");function ac(t,e){for(let r of t)if(!kr(r,e))return!1;for(let r=0;r<t.length-1;++r)if(yd(t[r],t[r+1],e))return!1;return!0}l(ac,"lineStringWithinPolygon");function hd(t,e){for(let r of e)if(ac(t,r))return!0;return!1}l(hd,"lineStringWithinPolygons");function dd(t,e){return t[0]*e[1]-t[1]*e[0]}l(dd,"perp");function Du(t,e,r,n){let i=t[0]-r[0],o=t[1]-r[1],a=e[0]-r[0],s=e[1]-r[1],u=n[0]-r[0],c=n[1]-r[1],p=i*c-u*o,f=a*c-u*s;return p>0&&f<0||p<0&&f>0}l(Du,"twoSided");function Us(t,e,r){let n=[];for(let i=0;i<t.length;i++){let o=[];for(let a=0;a<t[i].length;a++){let s=ad(t[i][a],r);An(e,s),o.push(s)}n.push(o)}return n}l(Us,"getTilePolygon");function sc(t,e,r){let n=[];for(let i=0;i<t.length;i++){let o=Us(t[i],e,r);n.push(o)}return n}l(sc,"getTilePolygons");function lc(t,e,r,n){if(t[0]<r[0]||t[0]>r[2]){let i=n*.5,o=t[0]-r[0]>i?-n:r[0]-t[0]>i?n:0;o===0&&(o=t[0]-r[2]>i?-n:r[2]-t[0]>i?n:0),t[0]+=o}An(e,t)}l(lc,"updatePoint");function gd(t){t[0]=t[1]=1/0,t[2]=t[3]=-1/0}l(gd,"resetBBox");function Bu(t,e,r,n){let i=Math.pow(2,n.z)*Ye,o=[n.x*Ye,n.y*Ye],a=[];for(let s of t)for(let u of s){let c=[u.x+o[0],u.y+o[1]];lc(c,e,r,i),a.push(c)}return a}l(Bu,"getTilePoints");function Vu(t,e,r,n){let i=Math.pow(2,n.z)*Ye,o=[n.x*Ye,n.y*Ye],a=[];for(let s of t){let u=[];for(let c of s){let p=[c.x+o[0],c.y+o[1]];An(e,p),u.push(p)}a.push(u)}if(e[2]-e[0]<=i/2){gd(e);for(let s of a)for(let u of s)lc(u,e,r,i)}return a}l(Vu,"getTileLines");function bd(t,e){let r=[1/0,1/0,-1/0,-1/0],n=[1/0,1/0,-1/0,-1/0],i=t.canonicalID();if(e.type==="Polygon"){let o=Us(e.coordinates,n,i),a=Bu(t.geometry(),r,n,i);if(!hn(r,n))return!1;for(let s of a)if(!kr(s,o))return!1}if(e.type==="MultiPolygon"){let o=sc(e.coordinates,n,i),a=Bu(t.geometry(),r,n,i);if(!hn(r,n))return!1;for(let s of a)if(!md(s,o))return!1}return!0}l(bd,"pointsWithinPolygons");function xd(t,e){let r=[1/0,1/0,-1/0,-1/0],n=[1/0,1/0,-1/0,-1/0],i=t.canonicalID();if(e.type==="Polygon"){let o=Us(e.coordinates,n,i),a=Vu(t.geometry(),r,n,i);if(!hn(r,n))return!1;for(let s of a)if(!ac(s,o))return!1}if(e.type==="MultiPolygon"){let o=sc(e.coordinates,n,i),a=Vu(t.geometry(),r,n,i);if(!hn(r,n))return!1;for(let s of a)if(!hd(s,o))return!1}return!0}l(xd,"linesWithinPolygons");var dn=class t{static{l(this,"Within")}constructor(e,r){this.type=q,this.geojson=e,this.geometries=r}static parse(e,r){if(e.length!==2)return r.error(`'within' expression requires exactly one argument, but found ${e.length-1} instead.`);if(yn(e[1])){let n=e[1];if(n.type==="FeatureCollection"){let i=[];for(let o of n.features){let{type:a,coordinates:s}=o.geometry;a==="Polygon"&&i.push(s),a==="MultiPolygon"&&i.push(...s)}if(i.length){let o={type:"MultiPolygon",coordinates:i};return new t(n,o)}}else if(n.type==="Feature"){let i=n.geometry.type;if(i==="Polygon"||i==="MultiPolygon")return new t(n,n.geometry)}else if(n.type==="Polygon"||n.type==="MultiPolygon")return new t(n,n)}return r.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 bd(e,this.geometries);if(e.geometryType()==="LineString")return xd(e,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}},co=class{static{l(this,"TinyQueue")}constructor(e=[],r=(n,i)=>n<i?-1:n>i?1:0){if(this.data=e,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(e){this.data.push(e),this._up(this.length++)}pop(){if(this.length===0)return;let e=this.data[0],r=this.data.pop();return--this.length>0&&(this.data[0]=r,this._down(0)),e}peek(){return this.data[0]}_up(e){let{data:r,compare:n}=this,i=r[e];for(;e>0;){let o=e-1>>1,a=r[o];if(n(i,a)>=0)break;r[e]=a,e=o}r[e]=i}_down(e){let{data:r,compare:n}=this,i=this.length>>1,o=r[e];for(;e<i;){let a=(e<<1)+1,s=a+1;if(s<this.length&&n(r[s],r[a])<0&&(a=s),n(r[a],o)>=0)break;r[e]=r[a],e=a}r[e]=o}};function uc(t,e,r=0,n=t.length-1,i=vd){for(;n>r;){if(n-r>600){let u=n-r+1,c=e-r+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(r,Math.floor(e-c*f/u+y)),h=Math.min(n,Math.floor(e+(u-c)*f/u+y));uc(t,e,m,h,i)}let o=t[e],a=r,s=n;for(an(t,r,e),i(t[n],o)>0&&an(t,r,n);a<s;){for(an(t,a,s),a++,s--;i(t[a],o)<0;)a++;for(;i(t[s],o)>0;)s--}i(t[r],o)===0?an(t,r,s):(s++,an(t,s,n)),s<=e&&(r=s+1),e<=s&&(n=s-1)}}l(uc,"quickselect");function an(t,e,r){let n=t[e];t[e]=t[r],t[r]=n}l(an,"swap");function vd(t,e){return t<e?-1:t>e?1:0}l(vd,"defaultCompare");function er(t,e){if(t.length<=1)return[t];let n=[],i,o;for(let a of t){let s=Sd(a);s!==0&&(a.area=Math.abs(s),o===void 0&&(o=s<0),o===s<0?(i&&n.push(i),i=[a]):i.push(a))}if(i&&n.push(i),e>1)for(let a=0;a<n.length;a++)n[a].length<=e||(uc(n[a],e,1,n[a].length-1,Pd),n[a]=n[a].slice(0,e));return n}l(er,"classifyRings");function Pd(t,e){return e.area-t.area}l(Pd,"compareAreas");function Sd(t){let e=0;for(let r=0,n=t.length,i=n-1,o,a;r<n;i=r++)o=t[r],a=t[i],e+=(a.x-o.x)*(o.y+a.y);return e}l(Sd,"calculateSignedArea");var wd=6378.137,Ru=1/298.257223563,zu=Ru*(2-Ru),Ou=Math.PI/180,gn=class{static{l(this,"CheapRuler")}constructor(e){let r=Ou*wd*1e3,n=Math.cos(e*Ou),i=1/(1-zu*(1-n*n)),o=Math.sqrt(i);this.kx=r*o*n,this.ky=r*o*i*(1-zu)}distance(e,r){let n=this.wrap(e[0]-r[0])*this.kx,i=(e[1]-r[1])*this.ky;return Math.sqrt(n*n+i*i)}pointOnLine(e,r){let n=1/0,i,o,a,s;for(let u=0;u<e.length-1;u++){let c=e[u][0],p=e[u][1],f=this.wrap(e[u+1][0]-c)*this.kx,y=(e[u+1][1]-p)*this.ky,m=0;(f!==0||y!==0)&&(m=(this.wrap(r[0]-c)*this.kx*f+(r[1]-p)*this.ky*y)/(f*f+y*y),m>1?(c=e[u+1][0],p=e[u+1][1]):m>0&&(c+=f/this.kx*m,p+=y/this.ky*m)),f=this.wrap(r[0]-c)*this.kx,y=(r[1]-p)*this.ky;let h=f*f+y*y;h<n&&(n=h,i=c,o=p,a=u,s=m)}return{point:[i,o],index:a,t:Math.max(0,Math.min(1,s))}}wrap(e){for(;e<-180;)e+=360;for(;e>180;)e-=360;return e}},Ms=100,Ls=50;function cc(t,e){return e[0]-t[0]}l(cc,"compareDistPair");function po(t){return t[1]-t[0]+1}l(po,"getRangeSize");function ct(t,e){return t[1]>=t[0]&&t[1]<e}l(ct,"isRangeSafe");function Ds(t,e){if(t[0]>t[1])return[null,null];let r=po(t);if(e){if(r===2)return[t,null];let i=Math.floor(r/2);return[[t[0],t[0]+i],[t[0]+i,t[1]]]}if(r===1)return[t,null];let n=Math.floor(r/2)-1;return[[t[0],t[0]+n],[t[0]+n+1,t[1]]]}l(Ds,"splitRange");function Bs(t,e){if(!ct(e,t.length))return[1/0,1/0,-1/0,-1/0];let r=[1/0,1/0,-1/0,-1/0];for(let n=e[0];n<=e[1];++n)An(r,t[n]);return r}l(Bs,"getBBox");function Vs(t){let e=[1/0,1/0,-1/0,-1/0];for(let r of t)for(let n of r)An(e,n);return e}l(Vs,"getPolygonBBox");function Gu(t){return t[0]!==-1/0&&t[1]!==-1/0&&t[2]!==1/0&&t[3]!==1/0}l(Gu,"isValidBBox");function $s(t,e,r){if(!Gu(t)||!Gu(e))return NaN;let n=0,i=0;return t[2]<e[0]&&(n=e[0]-t[2]),t[0]>e[2]&&(n=t[0]-e[2]),t[1]>e[3]&&(i=t[1]-e[3]),t[3]<e[1]&&(i=e[1]-t[3]),r.distance([0,0],[n,i])}l($s,"bboxToBBoxDistance");function Ht(t,e,r){let n=r.pointOnLine(e,t);return r.distance(t,n.point)}l(Ht,"pointToLineDistance");function js(t,e,r,n,i){let o=Math.min(Ht(t,[r,n],i),Ht(e,[r,n],i)),a=Math.min(Ht(r,[t,e],i),Ht(n,[t,e],i));return Math.min(o,a)}l(js,"segmentToSegmentDistance");function Ad(t,e,r,n,i){if(!(ct(e,t.length)&&ct(n,r.length)))return 1/0;let a=1/0;for(let s=e[0];s<e[1];++s){let u=t[s],c=t[s+1];for(let p=n[0];p<n[1];++p){let f=r[p],y=r[p+1];if(Ao(u,c,f,y))return 0;a=Math.min(a,js(u,c,f,y,i))}}return a}l(Ad,"lineToLineDistance");function _d(t,e,r,n,i){if(!(ct(e,t.length)&&ct(n,r.length)))return NaN;let a=1/0;for(let s=e[0];s<=e[1];++s)for(let u=n[0];u<=n[1];++u)if(a=Math.min(a,i.distance(t[s],r[u])),a===0)return a;return a}l(_d,"pointsToPointsDistance");function Id(t,e,r){if(kr(t,e,!0))return 0;let n=1/0;for(let i of e){let o=i[0],a=i[i.length-1];if(o!==a&&(n=Math.min(n,Ht(t,[a,o],r)),n===0))return n;let s=r.pointOnLine(i,t);if(n=Math.min(n,r.distance(t,s.point)),n===0)return n}return n}l(Id,"pointToPolygonDistance");function Td(t,e,r,n){if(!ct(e,t.length))return NaN;for(let o=e[0];o<=e[1];++o)if(kr(t[o],r,!0))return 0;let i=1/0;for(let o=e[0];o<e[1];++o){let a=t[o],s=t[o+1];for(let u of r)for(let c=0,p=u.length,f=p-1;c<p;f=c++){let y=u[f],m=u[c];if(Ao(a,s,y,m))return 0;i=Math.min(i,js(a,s,y,m,n))}}return i}l(Td,"lineToPolygonDistance");function Nu(t,e){for(let r of t)for(let n of r)if(kr(n,e,!0))return!0;return!1}l(Nu,"polygonIntersect");function Cd(t,e,r,n=1/0){let i=Vs(t),o=Vs(e);if(n!==1/0&&$s(i,o,r)>=n)return n;if(hn(i,o)){if(Nu(t,e))return 0}else if(Nu(e,t))return 0;let a=1/0;for(let s of t)for(let u=0,c=s.length,p=c-1;u<c;p=u++){let f=s[p],y=s[u];for(let m of e)for(let h=0,d=m.length,x=d-1;h<d;x=h++){let b=m[x],P=m[h];if(Ao(f,y,b,P))return 0;a=Math.min(a,js(f,y,b,P,r))}}return a}l(Cd,"polygonToPolygonDistance");function Uu(t,e,r,n,i,o){if(!o)return;let a=$s(Bs(n,o),i,r);a<e&&t.push([a,o,[0,0]])}l(Uu,"updateQueue");function to(t,e,r,n,i,o,a){if(!o||!a)return;let s=$s(Bs(n,o),Bs(i,a),r);s<e&&t.push([s,o,a])}l(to,"updateQueueTwoSets");function fo(t,e,r,n,i=1/0){let o=Math.min(n.distance(t[0],r[0][0]),i);if(o===0)return o;let a=new co([[0,[0,t.length-1],[0,0]]],cc),s=Vs(r);for(;a.length>0;){let u=a.pop();if(u[0]>=o)continue;let c=u[1],p=e?Ls:Ms;if(po(c)<=p){if(!ct(c,t.length))return NaN;if(e){let f=Td(t,c,r,n);if(isNaN(f)||f===0)return f;o=Math.min(o,f)}else for(let f=c[0];f<=c[1];++f){let y=Id(t[f],r,n);if(o=Math.min(o,y),o===0)return 0}}else{let f=Ds(c,e);Uu(a,o,n,t,s,f[0]),Uu(a,o,n,t,s,f[1])}}return o}l(fo,"pointsToPolygonDistance");function yo(t,e,r,n,i,o=1/0){let a=Math.min(o,i.distance(t[0],r[0]));if(a===0)return a;let s=new co([[0,[0,t.length-1],[0,r.length-1]]],cc);for(;s.length>0;){let u=s.pop();if(u[0]>=a)continue;let c=u[1],p=u[2],f=e?Ls:Ms,y=n?Ls:Ms;if(po(c)<=f&&po(p)<=y){if(!ct(c,t.length)&&ct(p,r.length))return NaN;let m;if(e&&n)m=Ad(t,c,r,p,i),a=Math.min(a,m);else if(e&&!n){let h=t.slice(c[0],c[1]+1);for(let d=p[0];d<=p[1];++d)if(m=Ht(r[d],h,i),a=Math.min(a,m),a===0)return a}else if(!e&&n){let h=r.slice(p[0],p[1]+1);for(let d=c[0];d<=c[1];++d)if(m=Ht(t[d],h,i),a=Math.min(a,m),a===0)return a}else m=_d(t,c,r,p,i),a=Math.min(a,m)}else{let m=Ds(c,e),h=Ds(p,n);to(s,a,i,t,r,m[0],h[0]),to(s,a,i,t,r,m[0],h[1]),to(s,a,i,t,r,m[1],h[0]),to(s,a,i,t,r,m[1],h[1])}}return a}l(yo,"pointSetToPointSetDistance");function kd(t,e){let r=t.geometry(),n=r.flat().map(a=>Ns([a.x,a.y],t.canonical));if(r.length===0)return NaN;let i=new gn(n[0][1]),o=1/0;for(let a of e){switch(a.type){case"Point":o=Math.min(o,yo(n,!1,[a.coordinates],!1,i,o));break;case"LineString":o=Math.min(o,yo(n,!1,a.coordinates,!0,i,o));break;case"Polygon":o=Math.min(o,fo(n,!1,a.coordinates,i,o));break}if(o===0)return o}return o}l(kd,"pointToGeometryDistance");function Fd(t,e){let r=t.geometry(),n=r.flat().map(a=>Ns([a.x,a.y],t.canonical));if(r.length===0)return NaN;let i=new gn(n[0][1]),o=1/0;for(let a of e){switch(a.type){case"Point":o=Math.min(o,yo(n,!0,[a.coordinates],!1,i,o));break;case"LineString":o=Math.min(o,yo(n,!0,a.coordinates,!0,i,o));break;case"Polygon":o=Math.min(o,fo(n,!0,a.coordinates,i,o));break}if(o===0)return o}return o}l(Fd,"lineStringToGeometryDistance");function Ed(t,e){let r=t.geometry();if(r.length===0||r[0].length===0)return NaN;let n=er(r,0).map(a=>a.map(s=>s.map(u=>Ns([u.x,u.y],t.canonical)))),i=new gn(n[0][0][0][1]),o=1/0;for(let a of e)for(let s of n){switch(a.type){case"Point":o=Math.min(o,fo([a.coordinates],!1,s,i,o));break;case"LineString":o=Math.min(o,fo(a.coordinates,!0,s,i,o));break;case"Polygon":o=Math.min(o,Cd(s,a.coordinates,i,o));break}if(o===0)return o}return o}l(Ed,"polygonToGeometryDistance");function xs(t){return t.type==="MultiPolygon"?t.coordinates.map(e=>({type:"Polygon",coordinates:e})):t.type==="MultiLineString"?t.coordinates.map(e=>({type:"LineString",coordinates:e})):t.type==="MultiPoint"?t.coordinates.map(e=>({type:"Point",coordinates:e})):[t]}l(xs,"toSimpleGeometry");var bn=class t{static{l(this,"Distance")}constructor(e,r){this.type=M,this.geojson=e,this.geometries=r}static parse(e,r){if(e.length!==2)return r.error(`'distance' expression requires exactly one argument, but found ${e.length-1} instead.`);if(yn(e[1])){let n=e[1];if(n.type==="FeatureCollection")return new t(n,n.features.map(i=>xs(i.geometry)).flat());if(n.type==="Feature")return new t(n,xs(n.geometry));if("type"in n&&"coordinates"in n)return new t(n,xs(n))}return r.error("'distance' expression requires valid geojson object that contains polygon geometry type.")}evaluate(e){if(e.geometry()!=null&&e.canonicalID()!=null){if(e.geometryType()==="Point")return kd(e,this.geometries);if(e.geometryType()==="LineString")return Fd(e,this.geometries);if(e.geometryType()==="Polygon")return Ed(e,this.geometries)}return NaN}eachChild(){}outputDefined(){return!0}},xn=class t{static{l(this,"GlobalState")}constructor(e){this.type=j,this.key=e}static parse(e,r){if(e.length!==2)return r.error(`Expected 1 argument, but found ${e.length-1} instead.`);let n=e[1];return n==null?r.error("Global state property must be defined."):typeof n!="string"?r.error(`Global state property must be string, but found ${typeof e[1]} instead.`):new t(n)}evaluate(e){var r;let n=(r=e.globals)===null||r===void 0?void 0:r.globalState;return!n||Object.keys(n).length===0?null:sn(n,this.key)}eachChild(){}outputDefined(){return!1}},tr={"==":ed,"!=":td,">":nd,"<":rd,">=":od,"<=":id,array:We,at:ws,boolean:We,case:Ts,coalesce:lo,collator:uo,format:mn,image:Fs,in:As,"index-of":_s,interpolate:Me,"interpolate-hcl":Me,"interpolate-lab":Me,length:Es,let:ao,literal:Ct,match:Is,number:We,"number-format":ks,object:We,slice:Cs,step:Ar,string:We,"to-boolean":_t,"to-color":_t,"to-number":_t,"to-string":_t,var:so,within:dn,distance:bn,"global-state":xn},Ke=class t{static{l(this,"CompoundExpression")}constructor(e,r,n,i){this.name=e,this.type=r,this._evaluate=n,this.args=i}evaluate(e){return this._evaluate(e,this.args)}eachChild(e){this.args.forEach(e)}outputDefined(){return!1}static parse(e,r){let n=e[0],i=t.definitions[n];if(!i)return r.error(`Unknown expression "${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(([c])=>!Array.isArray(c)||c.length===e.length-1),u=null;for(let[c,p]of s){u=new oo(r.registry,mo,r.path,null,r.scope);let f=[],y=!1;for(let m=1;m<e.length;m++){let h=e[m],d=Array.isArray(c)?c[m-1]:c.type,x=u.parse(h,1+f.length,d);if(!x){y=!0;break}f.push(x)}if(!y){if(Array.isArray(c)&&c.length!==f.length){u.error(`Expected ${c.length} arguments, but found ${f.length} instead.`);continue}for(let m=0;m<f.length;m++){let h=Array.isArray(c)?c[m]:c.type,d=f[m];u.concat(m+1).checkSubtype(h,d.type)}if(u.errors.length===0)return new t(n,o,p,f)}}if(s.length===1)r.errors.push(...u.errors);else{let p=(s.length?s:a).map(([y])=>Ld(y)).join(" | "),f=[];for(let y=1;y<e.length;y++){let m=r.parse(e[y],1+f.length);if(!m)return null;f.push(se(m.type))}r.error(`Expected arguments of type ${p}, but found (${f.join(", ")}) instead.`)}return null}static register(e,r){t.definitions=r;for(let n in r)e[n]=t}};function $u(t,[e,r,n,i]){e=e.evaluate(t),r=r.evaluate(t),n=n.evaluate(t);let o=i?i.evaluate(t):1,a=nc(e,r,n,o);if(a)throw new ae(a);return new Y(e/255,r/255,n/255,o,!1)}l($u,"rgba");function ju(t,e){return t in e}l(ju,"has");function vs(t,e){let r=e[t];return typeof r>"u"?null:r}l(vs,"get");function Md(t,e,r,n){for(;r<=n;){let i=r+n>>1;if(e[i]===t)return!0;e[i]>t?n=i-1:r=i+1}return!1}l(Md,"binarySearch");function Xt(t){return{type:t}}l(Xt,"varargs");Ke.register(tr,{error:[Ah,[W],(t,[e])=>{throw new ae(e.evaluate(t))}],typeof:[W,[j],(t,[e])=>se(fe(e.evaluate(t)))],"to-rgba":[Ee(M,4),[Ne],(t,[e])=>{let[r,n,i,o]=e.evaluate(t).rgb;return[r*255,n*255,i*255,o]}],rgb:[Ne,[M,M,M],$u],rgba:[Ne,[M,M,M,M],$u],has:{type:q,overloads:[[[W],(t,[e])=>ju(e.evaluate(t),t.properties())],[[W,Zt],(t,[e,r])=>ju(e.evaluate(t),r.evaluate(t))]]},get:{type:j,overloads:[[[W],(t,[e])=>vs(e.evaluate(t),t.properties())],[[W,Zt],(t,[e,r])=>vs(e.evaluate(t),r.evaluate(t))]]},"feature-state":[j,[W],(t,[e])=>vs(e.evaluate(t),t.featureState||{})],properties:[Zt,[],t=>t.properties()],"geometry-type":[W,[],t=>t.geometryType()],id:[j,[],t=>t.id()],zoom:[M,[],t=>t.globals.zoom],"heatmap-density":[M,[],t=>t.globals.heatmapDensity||0],elevation:[M,[],t=>t.globals.elevation||0],"line-progress":[M,[],t=>t.globals.lineProgress||0],accumulated:[j,[],t=>t.globals.accumulated===void 0?null:t.globals.accumulated],"+":[M,Xt(M),(t,e)=>{let r=0;for(let n of e)r+=n.evaluate(t);return r}],"*":[M,Xt(M),(t,e)=>{let r=1;for(let n of e)r*=n.evaluate(t);return r}],"-":{type:M,overloads:[[[M,M],(t,[e,r])=>e.evaluate(t)-r.evaluate(t)],[[M],(t,[e])=>-e.evaluate(t)]]},"/":[M,[M,M],(t,[e,r])=>e.evaluate(t)/r.evaluate(t)],"%":[M,[M,M],(t,[e,r])=>e.evaluate(t)%r.evaluate(t)],ln2:[M,[],()=>Math.LN2],pi:[M,[],()=>Math.PI],e:[M,[],()=>Math.E],"^":[M,[M,M],(t,[e,r])=>Math.pow(e.evaluate(t),r.evaluate(t))],sqrt:[M,[M],(t,[e])=>Math.sqrt(e.evaluate(t))],log10:[M,[M],(t,[e])=>Math.log(e.evaluate(t))/Math.LN10],ln:[M,[M],(t,[e])=>Math.log(e.evaluate(t))],log2:[M,[M],(t,[e])=>Math.log(e.evaluate(t))/Math.LN2],sin:[M,[M],(t,[e])=>Math.sin(e.evaluate(t))],cos:[M,[M],(t,[e])=>Math.cos(e.evaluate(t))],tan:[M,[M],(t,[e])=>Math.tan(e.evaluate(t))],asin:[M,[M],(t,[e])=>Math.asin(e.evaluate(t))],acos:[M,[M],(t,[e])=>Math.acos(e.evaluate(t))],atan:[M,[M],(t,[e])=>Math.atan(e.evaluate(t))],min:[M,Xt(M),(t,e)=>Math.min(...e.map(r=>r.evaluate(t)))],max:[M,Xt(M),(t,e)=>Math.max(...e.map(r=>r.evaluate(t)))],abs:[M,[M],(t,[e])=>Math.abs(e.evaluate(t))],round:[M,[M],(t,[e])=>{let r=e.evaluate(t);return r<0?-Math.round(-r):Math.round(r)}],floor:[M,[M],(t,[e])=>Math.floor(e.evaluate(t))],ceil:[M,[M],(t,[e])=>Math.ceil(e.evaluate(t))],"filter-==":[q,[W,j],(t,[e,r])=>t.properties()[e.value]===r.value],"filter-id-==":[q,[j],(t,[e])=>t.id()===e.value],"filter-type-==":[q,[W],(t,[e])=>t.geometryType()===e.value],"filter-<":[q,[W,j],(t,[e,r])=>{let n=t.properties()[e.value],i=r.value;return typeof n==typeof i&&n<i}],"filter-id-<":[q,[j],(t,[e])=>{let r=t.id(),n=e.value;return typeof r==typeof n&&r<n}],"filter->":[q,[W,j],(t,[e,r])=>{let n=t.properties()[e.value],i=r.value;return typeof n==typeof i&&n>i}],"filter-id->":[q,[j],(t,[e])=>{let r=t.id(),n=e.value;return typeof r==typeof n&&r>n}],"filter-<=":[q,[W,j],(t,[e,r])=>{let n=t.properties()[e.value],i=r.value;return typeof n==typeof i&&n<=i}],"filter-id-<=":[q,[j],(t,[e])=>{let r=t.id(),n=e.value;return typeof r==typeof n&&r<=n}],"filter->=":[q,[W,j],(t,[e,r])=>{let n=t.properties()[e.value],i=r.value;return typeof n==typeof i&&n>=i}],"filter-id->=":[q,[j],(t,[e])=>{let r=t.id(),n=e.value;return typeof r==typeof n&&r>=n}],"filter-has":[q,[j],(t,[e])=>e.value in t.properties()],"filter-has-id":[q,[],t=>t.id()!==null&&t.id()!==void 0],"filter-type-in":[q,[Ee(W)],(t,[e])=>e.value.indexOf(t.geometryType())>=0],"filter-id-in":[q,[Ee(j)],(t,[e])=>e.value.indexOf(t.id())>=0],"filter-in-small":[q,[W,Ee(j)],(t,[e,r])=>r.value.indexOf(t.properties()[e.value])>=0],"filter-in-large":[q,[W,Ee(j)],(t,[e,r])=>Md(t.properties()[e.value],r.value,0,r.value.length-1)],all:{type:q,overloads:[[[q,q],(t,[e,r])=>e.evaluate(t)&&r.evaluate(t)],[Xt(q),(t,e)=>{for(let r of e)if(!r.evaluate(t))return!1;return!0}]]},any:{type:q,overloads:[[[q,q],(t,[e,r])=>e.evaluate(t)||r.evaluate(t)],[Xt(q),(t,e)=>{for(let r of e)if(r.evaluate(t))return!0;return!1}]]},"!":[q,[q],(t,[e])=>!e.evaluate(t)],"is-supported-script":[q,[W],(t,[e])=>{let r=t.globals&&t.globals.isSupportedScript;return r?r(e.evaluate(t)):!0}],upcase:[W,[W],(t,[e])=>e.evaluate(t).toUpperCase()],downcase:[W,[W],(t,[e])=>e.evaluate(t).toLowerCase()],concat:[W,Xt(j),(t,e)=>e.map(r=>ln(r.evaluate(t))).join("")],"resolved-locale":[W,[xo],(t,[e])=>e.evaluate(t).resolvedLocale()]});function Ld(t){return Array.isArray(t)?`(${t.map(se).join(", ")})`:`(${se(t.type)}...)`}l(Ld,"stringifySignature");function mo(t){if(t instanceof so)return mo(t.boundExpression);if(t instanceof Ke&&t.name==="error")return!1;if(t instanceof uo)return!1;if(t instanceof dn)return!1;if(t instanceof bn)return!1;if(t instanceof xn)return!1;let e=t instanceof _t||t instanceof We,r=!0;return t.eachChild(n=>{e?r=r&&mo(n):r=r&&n instanceof Ct}),r?_o(t)&&Io(t,["zoom","heatmap-density","elevation","line-progress","accumulated","is-supported-script"]):!1}l(mo,"isExpressionConstant");function _o(t){if(t instanceof Ke){if(t.name==="get"&&t.args.length===1)return!1;if(t.name==="feature-state")return!1;if(t.name==="has"&&t.args.length===1)return!1;if(t.name==="properties"||t.name==="geometry-type"||t.name==="id")return!1;if(/^filter-/.test(t.name))return!1}if(t instanceof dn||t instanceof bn)return!1;let e=!0;return t.eachChild(r=>{e&&!_o(r)&&(e=!1)}),e}l(_o,"isFeatureConstant");function vn(t){if(t instanceof Ke&&t.name==="feature-state")return!1;let e=!0;return t.eachChild(r=>{e&&!vn(r)&&(e=!1)}),e}l(vn,"isStateConstant");function Io(t,e){if(t instanceof Ke&&e.indexOf(t.name)>=0)return!1;let r=!0;return t.eachChild(n=>{r&&!Io(n,e)&&(r=!1)}),r}l(Io,"isGlobalPropertyConstant");function Rs(t){return{result:"success",value:t}}l(Rs,"success");function vr(t){return{result:"error",value:t}}l(vr,"error");function kt(t){return t["property-type"]==="data-driven"||t["property-type"]==="cross-faded-data-driven"}l(kt,"supportsPropertyExpression");function pc(t){return!!t.expression&&t.expression.parameters.indexOf("zoom")>-1}l(pc,"supportsZoomExpression");function qs(t){return!!t.expression&&t.expression.interpolated}l(qs,"supportsInterpolation");function X(t){return t instanceof Number?"number":t instanceof String?"string":t instanceof Boolean?"boolean":Array.isArray(t)?"array":t===null?"null":typeof t}l(X,"getType");function To(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)&&fe(t)===Zt}l(To,"isFunction$1");function Dd(t){return t}l(Dd,"identityFunction");function Bd(t){switch(t.type){case"color":return Y.parse;case"padding":return Ue.parse;case"numberArray":return $e.parse;case"colorArray":return Ae.parse;default:return null}}l(Bd,"getParseFunction");function Vd(t){switch(t){case"exponential":return yc;case"interval":return zd;case"categorical":return Rd;case"identity":return Od;default:throw new Error(`Unknown function type "${t}"`)}}l(Vd,"getInnerFunction");function fc(t,e){let r=t.stops&&typeof t.stops[0][0]=="object",n=r||t.property!==void 0,i=r||!n,o=t.type||(qs(e)?"exponential":"interval"),a=Bd(e);if(a&&(t=Sr({},t),t.stops&&(t.stops=t.stops.map(p=>[p[0],a(p[1])])),t.default?t.default=a(t.default):t.default=a(e.default)),t.colorSpace&&!Bh(t.colorSpace))throw new Error(`Unknown color space: "${t.colorSpace}"`);let s=Vd(o),u,c;if(o==="categorical"){u=Object.create(null);for(let p of t.stops)u[p[0]]=p[1];c=typeof t.stops[0][0]}if(r){let p={},f=[];for(let h=0;h<t.stops.length;h++){let d=t.stops[h],x=d[0].zoom;p[x]===void 0&&(p[x]={zoom:x,type:t.type,property:t.property,default:t.default,stops:[]},f.push(x)),p[x].stops.push([d[0].value,d[1]])}let y=[];for(let h of f)y.push([p[h].zoom,fc(p[h],e)]);let m={name:"linear"};return{kind:"composite",interpolationType:m,interpolationFactor:Me.interpolationFactor.bind(void 0,m),zoomStops:y.map(h=>h[0]),evaluate({zoom:h},d){return yc({stops:y,base:t.base},e,h).evaluate(h,d)}}}else if(i){let p=o==="exponential"?{name:"exponential",base:t.base!==void 0?t.base:1}:null;return{kind:"camera",interpolationType:p,interpolationFactor:Me.interpolationFactor.bind(void 0,p),zoomStops:t.stops.map(f=>f[0]),evaluate:l(({zoom:f})=>s(t,e,f,u,c),"evaluate")}}else return{kind:"source",evaluate(p,f){let y=f&&f.properties?f.properties[t.property]:void 0;return y===void 0?_n(t.default,e.default):s(t,e,y,u,c)}}}l(fc,"createFunction");function _n(t,e,r){if(t!==void 0)return t;if(e!==void 0)return e;if(r!==void 0)return r}l(_n,"coalesce$1");function Rd(t,e,r,n,i){let o=typeof r===i?n[r]:void 0;return _n(o,t.default,e.default)}l(Rd,"evaluateCategoricalFunction");function zd(t,e,r){if(X(r)!=="number")return _n(t.default,e.default);let n=t.stops.length;if(n===1||r<=t.stops[0][0])return t.stops[0][1];if(r>=t.stops[n-1][0])return t.stops[n-1][1];let i=wo(t.stops.map(o=>o[0]),r);return t.stops[i][1]}l(zd,"evaluateIntervalFunction");function yc(t,e,r){let n=t.base!==void 0?t.base:1;if(X(r)!=="number")return _n(t.default,e.default);let i=t.stops.length;if(i===1||r<=t.stops[0][0])return t.stops[0][1];if(r>=t.stops[i-1][0])return t.stops[i-1][1];let o=wo(t.stops.map(p=>p[0]),r),a=Gd(r,n,t.stops[o][0],t.stops[o+1][0]),s=t.stops[o][1],u=t.stops[o+1][1],c=pt[e.type]||Dd;return typeof s.evaluate=="function"?{evaluate(...p){let f=s.evaluate.apply(void 0,p),y=u.evaluate.apply(void 0,p);if(!(f===void 0||y===void 0))return c(f,y,a,t.colorSpace)}}:c(s,u,a,t.colorSpace)}l(yc,"evaluateExponentialFunction");function Od(t,e,r){switch(e.type){case"color":r=Y.parse(r);break;case"formatted":r=Le.fromString(r.toString());break;case"resolvedImage":r=_e.fromString(r.toString());break;case"padding":r=Ue.parse(r);break;case"colorArray":r=Ae.parse(r);break;case"numberArray":r=$e.parse(r);break;default:X(r)!==e.type&&(e.type!=="enum"||!e.values[r])&&(r=void 0)}return _n(r,t.default,e.default)}l(Od,"evaluateIdentityFunction");function Gd(t,e,r,n){let i=n-r,o=t-r;return i===0?0:e===1?o/i:(Math.pow(e,o)-1)/(Math.pow(e,i)-1)}l(Gd,"interpolationFactor");var Yt=class{static{l(this,"StyleExpression")}constructor(e,r){this.expression=e,this._warningHistory={},this._evaluator=new io,this._defaultValue=r?Ud(r):null,this._enumValues=r&&r.type==="enum"?r.values:null}evaluateWithoutErrorHandling(e,r,n,i,o,a){return this._evaluator.globals=e,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(e,r,n,i,o,a){this._evaluator.globals=e,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 ae(`Expected value to be one of ${Object.keys(this._enumValues).map(u=>JSON.stringify(u)).join(", ")}, but found ${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 In(t){return Array.isArray(t)&&t.length>0&&typeof t[0]=="string"&&t[0]in tr}l(In,"isExpression");function rr(t,e){let r=new oo(tr,mo,[],e?Nd(e):void 0),n=r.parse(t,void 0,void 0,void 0,e&&e.type==="string"?{typeAnnotation:"coerce"}:void 0);return n?Rs(new Yt(n,e)):vr(r.errors)}l(rr,"createExpression");var Qe=class{static{l(this,"ZoomConstantExpression")}constructor(e,r){this.kind=e,this._styleExpression=r,this.isStateDependent=e!=="constant"&&!vn(r.expression),this.globalStateRefs=Co(r.expression)}evaluateWithoutErrorHandling(e,r,n,i,o,a){return this._styleExpression.evaluateWithoutErrorHandling(e,r,n,i,o,a)}evaluate(e,r,n,i,o,a){return this._styleExpression.evaluate(e,r,n,i,o,a)}},Ft=class{static{l(this,"ZoomDependentExpression")}constructor(e,r,n,i){this.kind=e,this.zoomStops=n,this._styleExpression=r,this.isStateDependent=e!=="camera"&&!vn(r.expression),this.globalStateRefs=Co(r.expression),this.interpolationType=i}evaluateWithoutErrorHandling(e,r,n,i,o,a){return this._styleExpression.evaluateWithoutErrorHandling(e,r,n,i,o,a)}evaluate(e,r,n,i,o,a){return this._styleExpression.evaluate(e,r,n,i,o,a)}interpolationFactor(e,r,n){return this.interpolationType?Me.interpolationFactor(this.interpolationType,e,r,n):0}};function mc(t){return t._styleExpression!==void 0}l(mc,"isZoomExpression");function hc(t,e){let r=rr(t,e);if(r.result==="error")return r;let n=r.value.expression,i=_o(n);if(!i&&!kt(e))return vr([new Oe("","data expressions not supported")]);let o=Io(n,["zoom"]);if(!o&&!pc(e))return vr([new Oe("","zoom expressions not supported")]);let a=no(n);if(!a&&!o)return vr([new Oe("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]);if(a instanceof Oe)return vr([a]);if(a instanceof Me&&!qs(e))return vr([new Oe("",'"interpolate" expressions cannot be used with this property')]);if(!a)return Rs(i?new Qe("constant",r.value):new Qe("source",r.value));let s=a instanceof Me?a.interpolation:void 0;return Rs(i?new Ft("camera",r.value,a.labels,s):new Ft("composite",r.value,a.labels,s))}l(hc,"createPropertyExpression");var Pn=class t{static{l(this,"StylePropertyFunction")}constructor(e,r){this._parameters=e,this._specification=r,Sr(this,fc(this._parameters,this._specification))}static deserialize(e){return new t(e._parameters,e._specification)}static serialize(e){return{_parameters:e._parameters,_specification:e._specification}}};function dc(t,e){if(To(t))return new Pn(t,e);if(In(t)){let r=hc(t,e);if(r.result==="error")throw new Error(r.value.map(n=>`${n.key}: ${n.message}`).join(", "));return r.value}else{let r=t;return e.type==="color"&&typeof t=="string"?r=Y.parse(t):e.type==="padding"&&(typeof t=="number"||Array.isArray(t))?r=Ue.parse(t):e.type==="numberArray"&&(typeof t=="number"||Array.isArray(t))?r=$e.parse(t):e.type==="colorArray"&&(typeof t=="string"||Array.isArray(t))?r=Ae.parse(t):e.type==="variableAnchorOffsetCollection"&&Array.isArray(t)?r=De.parse(t):e.type==="projectionDefinition"&&typeof t=="string"&&(r=Tt.parse(t)),{globalStateRefs:new Set,kind:"constant",evaluate:l(()=>r,"evaluate")}}}l(dc,"normalizePropertyExpression");function no(t){let e=null;if(t instanceof ao)e=no(t.result);else if(t instanceof lo){for(let r of t.args)if(e=no(r),e)break}else(t instanceof Ar||t instanceof Me)&&t.input instanceof Ke&&t.input.name==="zoom"&&(e=t);return e instanceof Oe||t.eachChild(r=>{let n=no(r);n instanceof Oe?e=n:!e&&n?e=new Oe("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):e&&n&&e!==n&&(e=new Oe("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),e}l(no,"findZoomCurve");function Co(t,e=new Set){return t instanceof xn&&e.add(t.key),t.eachChild(r=>{Co(r,e)}),e}l(Co,"findGlobalStateRefs");function Nd(t){let e={color:Ne,string:W,number:M,enum:W,boolean:q,formatted:Tr,padding:vo,numberArray:Po,colorArray:un,projectionDefinition:bo,resolvedImage:wn,variableAnchorOffsetCollection:So};return t.type==="array"?Ee(e[t.value]||j,t.length):e[t.type]}l(Nd,"getExpectedType");function Ud(t){if(t.type==="color"&&To(t.default))return new Y(0,0,0,0);switch(t.type){case"color":return Y.parse(t.default)||null;case"padding":return Ue.parse(t.default)||null;case"numberArray":return $e.parse(t.default)||null;case"colorArray":return Ae.parse(t.default)||null;case"variableAnchorOffsetCollection":return De.parse(t.default)||null;case"projectionDefinition":return Tt.parse(t.default)||null;default:return t.default===void 0?null:t.default}}l(Ud,"getDefaultValue");function Ws(t){if(t===!0||t===!1)return!0;if(!Array.isArray(t)||t.length===0)return!1;switch(t[0]){case"has":return t.length>=2&&t[1]!=="$id"&&t[1]!=="$type";case"in":return t.length>=3&&(typeof t[1]!="string"||Array.isArray(t[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return t.length!==3||Array.isArray(t[1])||Array.isArray(t[2]);case"any":case"all":for(let e of t.slice(1))if(!Ws(e)&&typeof e!="boolean")return!1;return!0;default:return!0}}l(Ws,"isExpressionFilter");var $d={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function Et(t){if(t==null)return{filter:l(()=>!0,"filter"),needGeometry:!1,getGlobalStateRefs:l(()=>new Set,"getGlobalStateRefs")};Ws(t)||(t=ho(t));let e=rr(t,$d);if(e.result==="error")throw new Error(e.value.map(r=>`${r.key}: ${r.message}`).join(", "));{let r=gc(t);return{filter:l((n,i,o)=>e.value.evaluate(n,i,{},o),"filter"),needGeometry:r,getGlobalStateRefs:l(()=>Co(e.value.expression),"getGlobalStateRefs")}}}l(Et,"featureFilter");function jd(t,e){return t<e?-1:t>e?1:0}l(jd,"compare");function gc(t){if(!Array.isArray(t))return!1;if(t[0]==="within"||t[0]==="distance")return!0;for(let e=1;e<t.length;e++)if(gc(t[e]))return!0;return!1}l(gc,"geometryNeeded");function ho(t){if(!t)return!0;let e=t[0];return t.length<=1?e!=="any":e==="=="?Ps(t[1],t[2],"=="):e==="!="?ro(Ps(t[1],t[2],"==")):e==="<"||e===">"||e==="<="||e===">="?Ps(t[1],t[2],e):e==="any"?qd(t.slice(1)):e==="all"?["all"].concat(t.slice(1).map(ho)):e==="none"?["all"].concat(t.slice(1).map(ho).map(ro)):e==="in"?qu(t[1],t.slice(2)):e==="!in"?ro(qu(t[1],t.slice(2))):e==="has"?Wu(t[1]):e==="!has"?ro(Wu(t[1])):!0}l(ho,"convertFilter$1");function Ps(t,e,r){switch(t){case"$type":return[`filter-type-${r}`,e];case"$id":return[`filter-id-${r}`,e];default:return[`filter-${r}`,t,e]}}l(Ps,"convertComparisonOp$1");function qd(t){return["any"].concat(t.map(ho))}l(qd,"convertDisjunctionOp");function qu(t,e){if(e.length===0)return!1;switch(t){case"$type":return["filter-type-in",["literal",e]];case"$id":return["filter-id-in",["literal",e]];default:return e.length>200&&!e.some(r=>typeof r!=typeof e[0])?["filter-in-large",t,["literal",e.sort(jd)]]:["filter-in-small",t,["literal",e]]}}l(qu,"convertInOp$1");function Wu(t){switch(t){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",t]}}l(Wu,"convertHasOp$1");function ro(t){return["!",t]}l(ro,"convertNegation");function zs(t){let e=typeof t;if(e==="number"||e==="boolean"||e==="string"||t===void 0||t===null)return JSON.stringify(t);if(Array.isArray(t)){let i="[";for(let o of t)i+=`${zs(o)},`;return`${i}]`}let r=Object.keys(t).sort(),n="{";for(let i=0;i<r.length;i++)n+=`${JSON.stringify(r[i])}:${zs(t[r[i]])},`;return`${n}}`}l(zs,"stringify$1");function Wd(t){let e="";for(let r of wh)e+=`/${zs(t[r])}`;return e}l(Wd,"getKey");function bc(t,e){let r={};for(let i=0;i<t.length;i++){let o=e&&e[t[i].id]||Wd(t[i]);e&&(e[t[i].id]=o);let a=r[o];a||(a=r[o]=[]),a.push(t[i])}let n=[];for(let i in r)n.push(r[i]);return n}l(bc,"groupByLayout");function xc(t){let e=t.key,r=t.value;return r?[new E(e,r,"constants have been deprecated as of v8")]:[]}l(xc,"validateConstants");function pe(t){return t instanceof Number||t instanceof String||t instanceof Boolean?t.valueOf():t}l(pe,"unbundle");function Kt(t){if(Array.isArray(t))return t.map(Kt);if(t instanceof Object&&!(t instanceof Number||t instanceof String||t instanceof Boolean)){let e={};for(let r in t)e[r]=Kt(t[r]);return e}return pe(t)}l(Kt,"deepUnbundle");function Ge(t){let e=t.key,r=t.value,n=t.valueSpec||{},i=t.objectElementValidators||{},o=t.style,a=t.styleSpec,s=t.validateSpec,u=[],c=X(r);if(c!=="object")return[new E(e,r,`object expected, ${c} found`)];for(let p in r){let f=p.split(".")[0],y=sn(n,f)||n["*"],m;if(sn(i,f))m=i[f];else if(sn(n,f))m=s;else if(i["*"])m=i["*"];else if(n["*"])m=s;else{u.push(new E(e,r[p],`unknown property "${p}"`));continue}u=u.concat(m({key:(e&&`${e}.`)+p,value:r[p],valueSpec:y,style:o,styleSpec:a,object:r,objectKey:p,validateSpec:s},r))}for(let p in n)i[p]||n[p].required&&n[p].default===void 0&&r[p]===void 0&&u.push(new E(e,r,`missing required property "${p}"`));return u}l(Ge,"validateObject");function Xs(t){let e=t.value,r=t.valueSpec,n=t.validateSpec,i=t.style,o=t.styleSpec,a=t.key,s=t.arrayElementValidator||n;if(X(e)!=="array")return[new E(a,e,`array expected, ${X(e)} found`)];if(r.length&&e.length!==r.length)return[new E(a,e,`array length ${r.length} expected, length ${e.length} found`)];if(r["min-length"]&&e.length<r["min-length"])return[new E(a,e,`array length at least ${r["min-length"]} expected, length ${e.length} found`)];let u={type:r.value,values:r.values};o.$version<7&&(u.function=r.function),X(r.value)==="object"&&(u=r.value);let c=[];for(let p=0;p<e.length;p++)c=c.concat(s({array:e,arrayIndex:p,value:e[p],valueSpec:u,validateSpec:t.validateSpec,style:i,styleSpec:o,key:`${a}[${p}]`}));return c}l(Xs,"validateArray");function ko(t){let e=t.key,r=t.value,n=t.valueSpec,i=X(r);return i==="number"&&r!==r&&(i="NaN"),i!=="number"?[new E(e,r,`number expected, ${i} found`)]:"minimum"in n&&r<n.minimum?[new E(e,r,`${r} is less than the minimum value ${n.minimum}`)]:"maximum"in n&&r>n.maximum?[new E(e,r,`${r} is greater than the maximum value ${n.maximum}`)]:[]}l(ko,"validateNumber");function vc(t){let e=t.valueSpec,r=pe(t.value.type),n,i={},o,a,s=r!=="categorical"&&t.value.property===void 0,u=!s,c=X(t.value.stops)==="array"&&X(t.value.stops[0])==="array"&&X(t.value.stops[0][0])==="object",p=Ge({key:t.key,value:t.value,valueSpec:t.styleSpec.function,validateSpec:t.validateSpec,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{stops:f,default:h}});return r==="identity"&&s&&p.push(new E(t.key,t.value,'missing required property "property"')),r!=="identity"&&!t.value.stops&&p.push(new E(t.key,t.value,'missing required property "stops"')),r==="exponential"&&t.valueSpec.expression&&!qs(t.valueSpec)&&p.push(new E(t.key,t.value,"exponential functions not supported")),t.styleSpec.$version>=8&&(u&&!kt(t.valueSpec)?p.push(new E(t.key,t.value,"property functions not supported")):s&&!pc(t.valueSpec)&&p.push(new E(t.key,t.value,"zoom functions not supported"))),(r==="categorical"||c)&&t.value.property===void 0&&p.push(new E(t.key,t.value,'"property" property is required')),p;function f(d){if(r==="identity")return[new E(d.key,d.value,'identity function may not have a "stops" property')];let x=[],b=d.value;return x=x.concat(Xs({key:d.key,value:b,valueSpec:d.valueSpec,validateSpec:d.validateSpec,style:d.style,styleSpec:d.styleSpec,arrayElementValidator:y})),X(b)==="array"&&b.length===0&&x.push(new E(d.key,b,"array must have at least one stop")),x}l(f,"validateFunctionStops");function y(d){let x=[],b=d.value,P=d.key;if(X(b)!=="array")return[new E(P,b,`array expected, ${X(b)} found`)];if(b.length!==2)return[new E(P,b,`array length 2 expected, length ${b.length} found`)];if(c){if(X(b[0])!=="object")return[new E(P,b,`object expected, ${X(b[0])} found`)];if(b[0].zoom===void 0)return[new E(P,b,"object stop key must have zoom")];if(b[0].value===void 0)return[new E(P,b,"object stop key must have value")];if(a&&a>pe(b[0].zoom))return[new E(P,b[0].zoom,"stop zoom values must appear in ascending order")];pe(b[0].zoom)!==a&&(a=pe(b[0].zoom),o=void 0,i={}),x=x.concat(Ge({key:`${P}[0]`,value:b[0],valueSpec:{zoom:{}},validateSpec:d.validateSpec,style:d.style,styleSpec:d.styleSpec,objectElementValidators:{zoom:ko,value:m}}))}else x=x.concat(m({key:`${P}[0]`,value:b[0],validateSpec:d.validateSpec,style:d.style,styleSpec:d.styleSpec},b));return In(Kt(b[1]))?x.concat([new E(`${P}[1]`,b[1],"expressions are not allowed in function stops.")]):x.concat(d.validateSpec({key:`${P}[1]`,value:b[1],valueSpec:e,validateSpec:d.validateSpec,style:d.style,styleSpec:d.styleSpec}))}l(y,"validateFunctionStop");function m(d,x){let b=X(d.value),P=pe(d.value),v=d.value!==null?d.value:x;if(!n)n=b;else if(b!==n)return[new E(d.key,v,`${b} stop domain type must match previous stop domain type ${n}`)];if(b!=="number"&&b!=="string"&&b!=="boolean")return[new E(d.key,v,"stop domain value must be a number, string, or boolean")];if(b!=="number"&&r!=="categorical"){let S=`number expected, ${b} found`;return kt(e)&&r===void 0&&(S+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new E(d.key,v,S)]}return r==="categorical"&&b==="number"&&(!isFinite(P)||Math.floor(P)!==P)?[new E(d.key,v,`integer expected, found ${P}`)]:r!=="categorical"&&b==="number"&&o!==void 0&&P<o?[new E(d.key,v,"stop domain values must appear in ascending order")]:(o=P,r==="categorical"&&P in i?[new E(d.key,v,"stop domain values must be unique")]:(i[P]=!0,[]))}l(m,"validateStopDomainValue");function h(d){return d.validateSpec({key:d.key,value:d.value,valueSpec:e,validateSpec:d.validateSpec,style:d.style,styleSpec:d.styleSpec})}l(h,"validateFunctionDefault")}l(vc,"validateFunction");function _r(t){let e=(t.expressionContext==="property"?hc:rr)(Kt(t.value),t.valueSpec);if(e.result==="error")return e.value.map(n=>new E(`${t.key}${n.key}`,t.value,n.message));let r=e.value.expression||e.value._styleExpression.expression;if(t.expressionContext==="property"&&t.propertyKey==="text-font"&&!r.outputDefined())return[new E(t.key,t.value,`Invalid data expression for "${t.propertyKey}". Output values must be contained as literals within the expression.`)];if(t.expressionContext==="property"&&t.propertyType==="layout"&&!vn(r))return[new E(t.key,t.value,'"feature-state" data expressions are not supported with layout properties.')];if(t.expressionContext==="filter"&&!vn(r))return[new E(t.key,t.value,'"feature-state" data expressions are not supported with filters.')];if(t.expressionContext&&t.expressionContext.indexOf("cluster")===0){if(!Io(r,["zoom","feature-state"]))return[new E(t.key,t.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(t.expressionContext==="cluster-initial"&&!_o(r))return[new E(t.key,t.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}l(_r,"validateExpression");function Xd(t){let e=t.value,r=t.key,n=X(e);return n!=="boolean"?[new E(r,e,`boolean expected, ${n} found`)]:[]}l(Xd,"validateBoolean");function Os(t){let e=t.key,r=t.value,n=X(r);return n!=="string"?[new E(e,r,`color expected, ${n} found`)]:Y.parse(String(r))?[]:[new E(e,r,`color expected, "${r}" found`)]}l(Os,"validateColor");function Sn(t){let e=t.key,r=t.value,n=t.valueSpec,i=[];return Array.isArray(n.values)?n.values.indexOf(pe(r))===-1&&i.push(new E(e,r,`expected one of [${n.values.join(", ")}], ${JSON.stringify(r)} found`)):Object.keys(n.values).indexOf(pe(r))===-1&&i.push(new E(e,r,`expected one of [${Object.keys(n.values).join(", ")}], ${JSON.stringify(r)} found`)),i}l(Sn,"validateEnum");function Hs(t){return Ws(Kt(t.value))?_r(Sr({},t,{expressionContext:"filter",valueSpec:{value:"boolean"}})):Pc(t)}l(Hs,"validateFilter");function Pc(t){let e=t.value,r=t.key;if(X(e)!=="array")return[new E(r,e,`array expected, ${X(e)} found`)];let n=t.styleSpec,i,o=[];if(e.length<1)return[new E(r,e,"filter array must have at least 1 element")];switch(o=o.concat(Sn({key:`${r}[0]`,value:e[0],valueSpec:n.filter_operator,style:t.style,styleSpec:t.styleSpec})),pe(e[0])){case"<":case"<=":case">":case">=":e.length>=2&&pe(e[1])==="$type"&&o.push(new E(r,e,`"$type" cannot be use with operator "${e[0]}"`));case"==":case"!=":e.length!==3&&o.push(new E(r,e,`filter array for operator "${e[0]}" must have 3 elements`));case"in":case"!in":e.length>=2&&(i=X(e[1]),i!=="string"&&o.push(new E(`${r}[1]`,e[1],`string expected, ${i} found`)));for(let a=2;a<e.length;a++)i=X(e[a]),pe(e[1])==="$type"?o=o.concat(Sn({key:`${r}[${a}]`,value:e[a],valueSpec:n.geometry_type,style:t.style,styleSpec:t.styleSpec})):i!=="string"&&i!=="number"&&i!=="boolean"&&o.push(new E(`${r}[${a}]`,e[a],`string, number, or boolean expected, ${i} found`));break;case"any":case"all":case"none":for(let a=1;a<e.length;a++)o=o.concat(Pc({key:`${r}[${a}]`,value:e[a],style:t.style,styleSpec:t.styleSpec}));break;case"has":case"!has":i=X(e[1]),e.length!==2?o.push(new E(r,e,`filter array for "${e[0]}" operator must have 2 elements`)):i!=="string"&&o.push(new E(`${r}[1]`,e[1],`string expected, ${i} found`));break}return o}l(Pc,"validateNonExpressionFilter");function Sc(t,e){let r=t.key,n=t.validateSpec,i=t.style,o=t.styleSpec,a=t.value,s=t.objectKey,u=o[`${e}_${t.layerType}`];if(!u)return[];let c=s.match(/^(.*)-transition$/);if(e==="paint"&&c&&u[c[1]]&&u[c[1]].transition)return n({key:r,value:a,valueSpec:o.transition,style:i,styleSpec:o});let p=t.valueSpec||u[s];if(!p)return[new E(r,a,`unknown property "${s}"`)];let f;if(X(a)==="string"&&kt(p)&&!p.tokens&&(f=/^{([^}]+)}$/.exec(a)))return[new E(r,a,`"${s}" does not support interpolation syntax
|
|
2
|
-
Use an identity property function instead: \`{ "type": "identity", "property": ${JSON.stringify(f[1])} }\`.`)];let y=[];return t.layerType==="symbol"&&(s==="text-field"&&i&&!i.glyphs&&y.push(new E(r,a,'use of "text-field" requires a style "glyphs" property')),s==="text-font"&&To(Kt(a))&&pe(a.type)==="identity"&&y.push(new E(r,a,'"text-font" does not support identity functions'))),y.concat(n({key:t.key,value:a,valueSpec:p,style:i,styleSpec:o,expressionContext:"property",propertyType:e,propertyKey:s}))}l(Sc,"validateProperty");function wc(t){return Sc(t,"paint")}l(wc,"validatePaintProperty");function Ac(t){return Sc(t,"layout")}l(Ac,"validateLayoutProperty");function _c(t){let e=[],r=t.value,n=t.key,i=t.style,o=t.styleSpec;if(X(r)!=="object")return[new E(n,r,`object expected, ${X(r)} found`)];!r.type&&!r.ref&&e.push(new E(n,r,'either "type" or "ref" is required'));let a=pe(r.type),s=pe(r.ref);if(r.id){let u=pe(r.id);for(let c=0;c<t.arrayIndex;c++){let p=i.layers[c];pe(p.id)===u&&e.push(new E(n,r.id,`duplicate layer id "${r.id}", previously used at line ${p.id.__line__}`))}}if("ref"in r){["type","source","source-layer","filter","layout"].forEach(c=>{c in r&&e.push(new E(n,r[c],`"${c}" is prohibited for ref layers`))});let u;i.layers.forEach(c=>{pe(c.id)===s&&(u=c)}),u?u.ref?e.push(new E(n,r.ref,"ref cannot reference another ref layer")):a=pe(u.type):e.push(new E(n,r.ref,`ref layer "${s}" not found`))}else if(a!=="background")if(!r.source)e.push(new E(n,r,'missing required property "source"'));else{let u=i.sources&&i.sources[r.source],c=u&&pe(u.type);u?c==="vector"&&a==="raster"?e.push(new E(n,r.source,`layer "${r.id}" requires a raster source`)):c!=="raster-dem"&&a==="hillshade"?e.push(new E(n,r.source,`layer "${r.id}" requires a raster-dem source`)):c!=="raster-dem"&&a==="color-relief"?e.push(new E(n,r.source,`layer "${r.id}" requires a raster-dem source`)):c==="raster"&&a!=="raster"?e.push(new E(n,r.source,`layer "${r.id}" requires a vector source`)):c==="vector"&&!r["source-layer"]?e.push(new E(n,r,`layer "${r.id}" must specify a "source-layer"`)):c==="raster-dem"&&a!=="hillshade"&&a!=="color-relief"?e.push(new E(n,r.source,"raster-dem source can only be used with layer type 'hillshade' or 'color-relief'.")):a==="line"&&r.paint&&r.paint["line-gradient"]&&(c!=="geojson"||!u.lineMetrics)&&e.push(new E(n,r,`layer "${r.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):e.push(new E(n,r.source,`source "${r.source}" not found`))}return e=e.concat(Ge({key:n,value:r,valueSpec:o.layer,style:t.style,styleSpec:t.styleSpec,validateSpec:t.validateSpec,objectElementValidators:{"*"(){return[]},type(){return t.validateSpec({key:`${n}.type`,value:r.type,valueSpec:o.layer.type,style:t.style,styleSpec:t.styleSpec,validateSpec:t.validateSpec,object:r,objectKey:"type"})},filter:Hs,layout(u){return Ge({layer:r,key:u.key,value:u.value,style:u.style,styleSpec:u.styleSpec,validateSpec:u.validateSpec,objectElementValidators:{"*"(c){return Ac(Sr({layerType:a},c))}}})},paint(u){return Ge({layer:r,key:u.key,value:u.value,style:u.style,styleSpec:u.styleSpec,validateSpec:u.validateSpec,objectElementValidators:{"*"(c){return wc(Sr({layerType:a},c))}}})}}})),e}l(_c,"validateLayer");function Qt(t){let e=t.value,r=t.key,n=X(e);return n!=="string"?[new E(r,e,`string expected, ${n} found`)]:[]}l(Qt,"validateString");function Hd(t){var e;let r=(e=t.sourceName)!==null&&e!==void 0?e:"",n=t.value,i=t.styleSpec,o=i.source_raster_dem,a=t.style,s=[],u=X(n);if(n===void 0)return s;if(u!=="object")return s.push(new E("source_raster_dem",n,`object expected, ${u} found`)),s;let p=pe(n.encoding)==="custom",f=["redFactor","greenFactor","blueFactor","baseShift"],y=t.value.encoding?`"${t.value.encoding}"`:"Default";for(let m in n)!p&&f.includes(m)?s.push(new E(m,n[m],`In "${r}": "${m}" is only valid when "encoding" is set to "custom". ${y} encoding found`)):o[m]?s=s.concat(t.validateSpec({key:m,value:n[m],valueSpec:o[m],validateSpec:t.validateSpec,style:a,styleSpec:i})):s.push(new E(m,n[m],`unknown property "${m}"`));return s}l(Hd,"validateRasterDEMSource");var Xu={promoteId:Zd};function Ic(t){let e=t.value,r=t.key,n=t.styleSpec,i=t.style,o=t.validateSpec;if(!e.type)return[new E(r,e,'"type" is required')];let a=pe(e.type),s;switch(a){case"vector":case"raster":return s=Ge({key:r,value:e,valueSpec:n[`source_${a.replace("-","_")}`],style:t.style,styleSpec:n,objectElementValidators:Xu,validateSpec:o}),s;case"raster-dem":return s=Hd({sourceName:r,value:e,style:t.style,styleSpec:n,validateSpec:o}),s;case"geojson":if(s=Ge({key:r,value:e,valueSpec:n.source_geojson,style:i,styleSpec:n,validateSpec:o,objectElementValidators:Xu}),e.cluster)for(let u in e.clusterProperties){let[c,p]=e.clusterProperties[u],f=typeof c=="string"?[c,["accumulated"],["get",u]]:c;s.push(..._r({key:`${r}.${u}.map`,value:p,expressionContext:"cluster-map"})),s.push(..._r({key:`${r}.${u}.reduce`,value:f,expressionContext:"cluster-reduce"}))}return s;case"video":return Ge({key:r,value:e,valueSpec:n.source_video,style:i,validateSpec:o,styleSpec:n});case"image":return Ge({key:r,value:e,valueSpec:n.source_image,style:i,validateSpec:o,styleSpec:n});case"canvas":return[new E(r,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return Sn({key:`${r}.type`,value:e.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]}})}}l(Ic,"validateSource");function Zd({key:t,value:e}){if(X(e)==="string")return Qt({key:t,value:e});{let r=[];for(let n in e)r.push(...Qt({key:`${t}.${n}`,value:e[n]}));return r}}l(Zd,"validatePromoteId");function Tc(t){let e=t.value,r=t.styleSpec,n=r.light,i=t.style,o=[],a=X(e);if(e===void 0)return o;if(a!=="object")return o=o.concat([new E("light",e,`object expected, ${a} found`)]),o;for(let s in e){let u=s.match(/^(.*)-transition$/);u&&n[u[1]]&&n[u[1]].transition?o=o.concat(t.validateSpec({key:s,value:e[s],valueSpec:r.transition,validateSpec:t.validateSpec,style:i,styleSpec:r})):n[s]?o=o.concat(t.validateSpec({key:s,value:e[s],valueSpec:n[s],validateSpec:t.validateSpec,style:i,styleSpec:r})):o=o.concat([new E(s,e[s],`unknown property "${s}"`)])}return o}l(Tc,"validateLight");function Cc(t){let e=t.value,r=t.styleSpec,n=r.sky,i=t.style,o=X(e);if(e===void 0)return[];if(o!=="object")return[new E("sky",e,`object expected, ${o} found`)];let a=[];for(let s in e)n[s]?a=a.concat(t.validateSpec({key:s,value:e[s],valueSpec:n[s],style:i,styleSpec:r})):a=a.concat([new E(s,e[s],`unknown property "${s}"`)]);return a}l(Cc,"validateSky");function kc(t){let e=t.value,r=t.styleSpec,n=r.terrain,i=t.style,o=[],a=X(e);if(e===void 0)return o;if(a!=="object")return o=o.concat([new E("terrain",e,`object expected, ${a} found`)]),o;for(let s in e)n[s]?o=o.concat(t.validateSpec({key:s,value:e[s],valueSpec:n[s],validateSpec:t.validateSpec,style:i,styleSpec:r})):o=o.concat([new E(s,e[s],`unknown property "${s}"`)]);return o}l(kc,"validateTerrain");function Jd(t){return Qt(t).length===0?[]:_r(t)}l(Jd,"validateFormatted");function Yd(t){return Qt(t).length===0?[]:_r(t)}l(Yd,"validateImage");function Kd(t){let e=t.key,r=t.value;if(X(r)==="array"){if(r.length<1||r.length>4)return[new E(e,r,`padding requires 1 to 4 values; ${r.length} values found`)];let i={type:"number"},o=[];for(let a=0;a<r.length;a++)o=o.concat(t.validateSpec({key:`${e}[${a}]`,value:r[a],validateSpec:t.validateSpec,valueSpec:i}));return o}else return ko({key:e,value:r,valueSpec:{}})}l(Kd,"validatePadding");function Qd(t){let e=t.key,r=t.value;if(X(r)==="array"){let i={type:"number"};if(r.length<1)return[new E(e,r,"array length at least 1 expected, length 0 found")];let o=[];for(let a=0;a<r.length;a++)o=o.concat(t.validateSpec({key:`${e}[${a}]`,value:r[a],validateSpec:t.validateSpec,valueSpec:i}));return o}else return ko({key:e,value:r,valueSpec:{}})}l(Qd,"validateNumberArray");function eg(t){let e=t.key,r=t.value;if(X(r)==="array"){if(r.length<1)return[new E(e,r,"array length at least 1 expected, length 0 found")];let i=[];for(let o=0;o<r.length;o++)i=i.concat(Os({key:`${e}[${o}]`,value:r[o]}));return i}else return Os({key:e,value:r})}l(eg,"validateColorArray");function tg(t){let e=t.key,r=t.value,n=X(r),i=t.styleSpec;if(n!=="array"||r.length<1||r.length%2!==0)return[new E(e,r,"variableAnchorOffsetCollection requires a non-empty array of even length")];let o=[];for(let a=0;a<r.length;a+=2)o=o.concat(Sn({key:`${e}[${a}]`,value:r[a],valueSpec:i.layout_symbol["text-anchor"]})),o=o.concat(Xs({key:`${e}[${a+1}]`,value:r[a+1],valueSpec:{length:2,value:"number"},validateSpec:t.validateSpec,style:t.style,styleSpec:i}));return o}l(tg,"validateVariableAnchorOffsetCollection");function Fc(t){let e=[],r=t.value,n=t.key;if(Array.isArray(r)){let i=[],o=[];for(let a in r){r[a].id&&i.includes(r[a].id)&&e.push(new E(n,r,`all the sprites' ids must be unique, but ${r[a].id} is duplicated`)),i.push(r[a].id),r[a].url&&o.includes(r[a].url)&&e.push(new E(n,r,`all the sprites' URLs must be unique, but ${r[a].url} is duplicated`)),o.push(r[a].url);let s={id:{type:"string",required:!0},url:{type:"string",required:!0}};e=e.concat(Ge({key:`${n}[${a}]`,value:r[a],valueSpec:s,validateSpec:t.validateSpec}))}return e}else return Qt({key:n,value:r})}l(Fc,"validateSprite");function rg(t){let e=t.value,r=t.styleSpec,n=r.projection,i=t.style,o=X(e);if(e===void 0)return[];if(o!=="object")return[new E("projection",e,`object expected, ${o} found`)];let a=[];for(let s in e)n[s]?a=a.concat(t.validateSpec({key:s,value:e[s],valueSpec:n[s],style:i,styleSpec:r})):a=a.concat([new E(s,e[s],`unknown property "${s}"`)]);return a}l(rg,"validateProjection");function ng(t){let e=t.key,r=t.value;r=r instanceof String?r.valueOf():r;let n=X(r);return n==="array"&&!og(r)&&!ig(r)?[new E(e,r,`projection expected, invalid array ${JSON.stringify(r)} found`)]:["array","string"].includes(n)?[]:[new E(e,r,`projection expected, invalid type "${n}" found`)]}l(ng,"validateProjectionDefinition");function ig(t){return!!["interpolate","step","literal"].includes(t[0])}l(ig,"isPropertyValueSpecification");function og(t){return Array.isArray(t)&&t.length===3&&typeof t[0]=="string"&&typeof t[1]=="string"&&typeof t[2]=="number"}l(og,"isProjectionDefinitionValue");function ag(t){return!!t&&t.constructor===Object}l(ag,"isObjectLiteral");function Ec(t){return ag(t.value)?[]:[new E(t.key,t.value,`object expected, ${X(t.value)} found`)]}l(Ec,"validateState");var Hu={"*"(){return[]},array:Xs,boolean:Xd,number:ko,color:Os,constants:xc,enum:Sn,filter:Hs,function:vc,layer:_c,object:Ge,source:Ic,light:Tc,sky:Cc,terrain:kc,projection:rg,projectionDefinition:ng,string:Qt,formatted:Jd,resolvedImage:Yd,padding:Kd,numberArray:Qd,colorArray:eg,variableAnchorOffsetCollection:tg,sprite:Fc,state:Ec};function go(t){let e=t.value,r=t.valueSpec,n=t.styleSpec;return t.validateSpec=go,r.expression&&To(pe(e))?vc(t):r.expression&&In(Kt(e))?_r(t):r.type&&Hu[r.type]?Hu[r.type](t):Ge(Sr({},t,{valueSpec:r.type?n[r.type]:r}))}l(go,"validate");function Mc(t){let e=t.value,r=t.key,n=Qt(t);return n.length||(e.indexOf("{fontstack}")===-1&&n.push(new E(r,e,'"glyphs" url must include a "{fontstack}" token')),e.indexOf("{range}")===-1&&n.push(new E(r,e,'"glyphs" url must include a "{range}" token'))),n}l(Mc,"validateGlyphsUrl");function Be(t,e=A){let r=[];return r=r.concat(go({key:"",value:t,valueSpec:e.$root,styleSpec:e,style:t,validateSpec:go,objectElementValidators:{glyphs:Mc,"*"(){return[]}}})),t.constants&&(r=r.concat(xc({key:"constants",value:t.constants}))),Lc(r)}l(Be,"validateStyleMin");Be.source=He(Xe(Ic));Be.sprite=He(Xe(Fc));Be.glyphs=He(Xe(Mc));Be.light=He(Xe(Tc));Be.sky=He(Xe(Cc));Be.terrain=He(Xe(kc));Be.state=He(Xe(Ec));Be.layer=He(Xe(_c));Be.filter=He(Xe(Hs));Be.paintProperty=He(Xe(wc));Be.layoutProperty=He(Xe(Ac));function Xe(t){return function(e){return t({...e,validateSpec:go})}}l(Xe,"injectValidateSpec");function Lc(t){return[].concat(t).sort((e,r)=>e.line-r.line)}l(Lc,"sortErrors");function He(t){return function(...e){return Lc(t.apply(this,e))}}l(He,"wrapCleanErrors");g();g();var Dc="AbortError";function Bc(t){return t.message===Dc}l(Bc,"isAbortError");function Zs(){return new Error(Dc)}l(Zs,"createAbortError");g();g();var Fo={MAX_PARALLEL_IMAGE_REQUESTS:16,MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:8,MAX_TILE_CACHE_ZOOM_LEVELS:5,REGISTERED_PROTOCOLS:{},WORKER_URL:""};function Vc(t){return Fo.REGISTERED_PROTOCOLS[t.substring(0,t.indexOf("://"))]}l(Vc,"getProtocol");function Rc(t,e){Fo.REGISTERED_PROTOCOLS[t]=e}l(Rc,"addProtocol");function zc(t){delete Fo.REGISTERED_PROTOCOLS[t]}l(zc,"removeProtocol");g();var Oc="global-dispatcher",nr=class extends Error{static{l(this,"AJAXError")}constructor(e,r,n,i){super(`AJAXError: ${r} (${e}): ${n}`),this.status=e,this.statusText=r,this.url=n,this.body=i}},Nc=l(()=>ut(self)?self.worker&&self.worker.referrer:(window.location.protocol==="blob:"?window.parent:window).location.href,"getReferrer"),sg=l(t=>/^file:/.test(t)||/^file:/.test(Nc())&&!/^\w+:/.test(t),"isFileURL");async function lg(t,e){let r=new Request(t.url,{method:t.method||"GET",body:t.body,credentials:t.credentials,headers:t.headers,cache:t.cache,referrer:Nc(),signal:e.signal});t.type==="json"&&!r.headers.has("Accept")&&r.headers.set("Accept","application/json");let n;try{n=await fetch(r)}catch(a){throw new nr(0,a.message,t.url,new Blob)}if(!n.ok){let a=await n.blob();throw new nr(n.status,n.statusText,t.url,a)}let i;t.type==="arrayBuffer"||t.type==="image"?i=n.arrayBuffer():t.type==="json"?i=n.json():i=n.text();let o=await i;if(e.signal.aborted)throw Zs();return{data:o,cacheControl:n.headers.get("Cache-Control"),expires:n.headers.get("Expires")}}l(lg,"makeFetchRequest");function ug(t,e){return new Promise((r,n)=>{let i=new XMLHttpRequest;i.open(t.method||"GET",t.url,!0),(t.type==="arrayBuffer"||t.type==="image")&&(i.responseType="arraybuffer");for(let o in t.headers)i.setRequestHeader(o,t.headers[o]);t.type==="json"&&(i.responseType="text",t.headers?.Accept||i.setRequestHeader("Accept","application/json")),i.withCredentials=t.credentials==="include",i.onerror=()=>{n(new Error(i.statusText))},i.onload=()=>{if(!e.signal.aborted)if((i.status>=200&&i.status<300||i.status===0)&&i.response!==null){let o=i.response;if(t.type==="json")try{o=JSON.parse(i.response)}catch(a){n(a);return}r({data:o,cacheControl:i.getResponseHeader("Cache-Control"),expires:i.getResponseHeader("Expires")})}else{let o=new Blob([i.response],{type:i.getResponseHeader("Content-Type")});n(new nr(i.status,i.statusText,t.url,o))}},e.signal.addEventListener("abort",()=>{i.abort(),n(Zs())}),i.send(t.body)})}l(ug,"makeXMLHttpRequest");var Uc=l(function(t,e){if(/:\/\//.test(t.url)&&!/^https?:|^file:/.test(t.url)){let r=Vc(t.url);if(r)return r(t,e);if(ut(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:t,targetMapId:Oc},e)}if(!sg(t.url)){if(fetch&&Request&&AbortController&&Object.prototype.hasOwnProperty.call(Request.prototype,"signal"))return lg(t,e);if(ut(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:t,mustQueue:!0,targetMapId:Oc},e)}return ug(t,e)},"makeRequest"),$c=l((t,e)=>Uc(xe(t,{type:"json"}),e),"getJSON"),jc=l((t,e)=>Uc(xe(t,{type:"arrayBuffer"}),e),"getArrayBuffer");var ft={};function k(t,e,r={}){if(ft[t])throw new Error(`${t} is already registered.`);Object.defineProperty(e,"_classRegistryKey",{value:t,writeable:!1}),ft[t]={klass:e,omit:r.omit||[],shallow:r.shallow||[]}}l(k,"register");k("Object",Object);k("Set",Set);k("TransferableGridIndex",Wt);k("Color",Y);k("Error",Error);k("AJAXError",nr);k("ResolvedImage",_e);k("StylePropertyFunction",Pn);k("StyleExpression",Yt,{omit:["_evaluator"]});k("ZoomDependentExpression",Ft);k("ZoomConstantExpression",Qe);k("CompoundExpression",Ke,{omit:["_evaluate"]});for(let t in tr)tr[t]._classRegistryKey||k(`Expression_${t}`,tr[t]);function qc(t){return t&&typeof ArrayBuffer<"u"&&(t instanceof ArrayBuffer||t.constructor&&t.constructor.name==="ArrayBuffer")}l(qc,"isArrayBuffer");function Js(t){let e=t.constructor;return t.$name||e._classRegistryKey}l(Js,"getClassRegistryKey");function cg(t){if(t===null||typeof t!="object")return!1;let e=Js(t);return!!(e&&e!=="Object")}l(cg,"isRegistered");function Wc(t){return!cg(t)&&(t==null||typeof t=="boolean"||typeof t=="number"||typeof t=="string"||t instanceof Boolean||t instanceof Number||t instanceof String||t instanceof Date||t instanceof RegExp||t instanceof Blob||t instanceof Error||qc(t)||wt(t)||ArrayBuffer.isView(t)||t instanceof ImageData)}l(Wc,"isSerializeHandledByBuiltin");function Fr(t,e){if(Wc(t)){if((qc(t)||wt(t))&&e&&e.push(t),ArrayBuffer.isView(t)){let o=t;e&&e.push(o.buffer)}return t instanceof ImageData&&e&&e.push(t.data.buffer),t}if(Array.isArray(t)){let o=[];for(let a of t)o.push(Fr(a,e));return o}if(typeof t!="object")throw new Error(`can't serialize object of type ${typeof t}`);let r=Js(t);if(!r)throw new Error(`can't serialize object of unregistered class ${t.constructor.name}`);if(!ft[r])throw new Error(`${r} is not registered.`);let{klass:n}=ft[r],i=n.serialize?n.serialize(t,e):{};if(n.serialize){if(e&&i===e[e.length-1])throw new Error("statically serialized object won't survive transfer of $name property")}else{for(let o in t){if(!t.hasOwnProperty(o)||ft[r].omit.indexOf(o)>=0)continue;let a=t[o];i[o]=ft[r].shallow.indexOf(o)>=0?a:Fr(a,e)}t instanceof Error&&(i.message=t.message)}if(i.$name)throw new Error("$name property is reserved for worker serialization logic.");return r!=="Object"&&(i.$name=r),i}l(Fr,"serialize");function Er(t){if(Wc(t))return t;if(Array.isArray(t))return t.map(Er);if(typeof t!="object")throw new Error(`can't deserialize object of type ${typeof t}`);let e=Js(t)||"Object";if(!ft[e])throw new Error(`can't deserialize unregistered class ${e}`);let{klass:r}=ft[e];if(!r)throw new Error(`can't deserialize unregistered class ${e}`);if(r.deserialize)return r.deserialize(t);let n=Object.create(r.prototype);for(let i of Object.keys(t)){if(i==="$name")continue;let o=t[i];n[i]=ft[e].shallow.indexOf(i)>=0?o:Er(o)}return n}l(Er,"deserialize");g();var Eo=class{static{l(this,"ThrottledInvoker")}constructor(e){this._methodToThrottle=e,this._triggered=!1,typeof MessageChannel<"u"&&(this._channel=new MessageChannel,this._channel.port2.onmessage=()=>{this._triggered=!1,this._methodToThrottle()})}trigger(){this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout(()=>{this._triggered=!1,this._methodToThrottle()},0))}remove(){delete this._channel,this._methodToThrottle=()=>{}}};var pg={once:!0},Mo=class{static{l(this,"Actor")}constructor(e,r){this.target=e,this.mapId=r,this.resolveRejects={},this.tasks={},this.taskQueue=[],this.abortControllers={},this.messageHandlers={},this.invoker=new Eo(()=>this.process()),this.subscription=ps(this.target,"message",n=>this.receive(n),!1),this.globalScope=ut(self)?e:window}registerMessageHandler(e,r){this.messageHandlers[e]=r}sendAsync(e,r){return new Promise((n,i)=>{let o=Math.round(Math.random()*1e18).toString(36).substring(0,10),a=r?ps(r.signal,"abort",()=>{a?.unsubscribe(),delete this.resolveRejects[o];let c={id:o,type:"<cancel>",origin:location.origin,targetMapId:e.targetMapId,sourceMapId:this.mapId};this.target.postMessage(c)},pg):null;this.resolveRejects[o]={resolve:l(c=>{a?.unsubscribe(),n(c)},"resolve"),reject:l(c=>{a?.unsubscribe(),i(c)},"reject")};let s=[],u={...e,id:o,sourceMapId:this.mapId,origin:location.origin,data:Fr(e.data,s)};this.target.postMessage(u,{transfer:s})})}receive(e){let r=e.data,n=r.id;if(!(r.origin!=="file://"&&location.origin!=="file://"&&r.origin!=="resource://android"&&location.origin!=="resource://android"&&r.origin!==location.origin)&&!(r.targetMapId&&this.mapId!==r.targetMapId)){if(r.type==="<cancel>"){delete this.tasks[n];let i=this.abortControllers[n];delete this.abortControllers[n],i&&i.abort();return}if(ut(self)||r.mustQueue){this.tasks[n]=r,this.taskQueue.push(n),this.invoker.trigger();return}this.processTask(n,r)}}process(){if(this.taskQueue.length===0)return;let e=this.taskQueue.shift(),r=this.tasks[e];delete this.tasks[e],this.taskQueue.length>0&&this.invoker.trigger(),r&&this.processTask(e,r)}async processTask(e,r){if(r.type==="<response>"){let o=this.resolveRejects[e];if(delete this.resolveRejects[e],!o)return;r.error?o.reject(Er(r.error)):o.resolve(Er(r.data));return}if(!this.messageHandlers[r.type]){this.completeTask(e,new Error(`Could not find a registered handler for ${r.type}, map ID: ${this.mapId}, available handlers: ${Object.keys(this.messageHandlers).join(", ")}`));return}let n=Er(r.data),i=new AbortController;this.abortControllers[e]=i;try{let o=await this.messageHandlers[r.type](r.sourceMapId,n,i);this.completeTask(e,null,o)}catch(o){this.completeTask(e,o)}}completeTask(e,r,n){let i=[];delete this.abortControllers[e];let o={id:e,type:"<response>",sourceMapId:this.mapId,origin:location.origin,error:r?Fr(r):null,data:Fr(n,i)};this.target.postMessage(o,{transfer:i})}remove(){this.invoker.remove(),this.subscription.unsubscribe()}};g();g();g();g();g();g();function Xc(t,e,r){r[t]&&r[t].indexOf(e)!==-1||(r[t]=r[t]||[],r[t].push(e))}l(Xc,"_addEventListener");function Ys(t,e,r){if(r&&r[t]){let n=r[t].indexOf(e);n!==-1&&r[t].splice(n,1)}}l(Ys,"_removeEventListener");var Lo=class{static{l(this,"Event")}constructor(e,r={}){xe(this,r),this.type=e}},Tn=class extends Lo{static{l(this,"ErrorEvent")}constructor(e,r={}){super("error",xe({error:e},r))}},Do=class{static{l(this,"Evented")}on(e,r){return this._listeners=this._listeners||{},Xc(e,r,this._listeners),{unsubscribe:l(()=>{this.off(e,r)},"unsubscribe")}}off(e,r){return Ys(e,r,this._listeners),Ys(e,r,this._oneTimeListeners),this}once(e,r){return r?(this._oneTimeListeners=this._oneTimeListeners||{},Xc(e,r,this._oneTimeListeners),this):new Promise(n=>this.once(e,n))}fire(e,r){typeof e=="string"&&(e=new Lo(e,r||{}));let n=e.type;if(this.listens(n)){e.target=this;let i=this._listeners&&this._listeners[n]?this._listeners[n].slice():[];for(let s of i)s.call(this,e);let o=this._oneTimeListeners&&this._oneTimeListeners[n]?this._oneTimeListeners[n].slice():[];for(let s of o)Ys(n,s,this._oneTimeListeners),s.call(this,e);let a=this._eventedParent;a&&(xe(e,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),a.fire(e))}else e instanceof Tn&&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,r){return this._eventedParent=e,this._eventedParentData=r,this}};var yt=Be,Nv=yt.source,Uv=yt.light,$v=yt.sky,jv=yt.terrain,qv=yt.filter,Hc=yt.paintProperty,Zc=yt.layoutProperty;function Jc(t,e){let r=!1;if(e&&e.length)for(let n of e)t.fire(new Tn(new Error(n.message))),r=!0;return r}l(Jc,"emitValidationErrors");g();g();g();var Cn=class{static{l(this,"ZoomHistory")}constructor(){this.first=!0}update(e,r){let n=Math.floor(e);return this.first?(this.first=!1,this.lastIntegerZoom=n,this.lastIntegerZoomTime=0,this.lastZoom=e,this.lastFloorZoom=n,!0):(this.lastFloorZoom>n?(this.lastIntegerZoom=n+1,this.lastIntegerZoomTime=r):this.lastFloorZoom<n&&(this.lastIntegerZoom=n,this.lastIntegerZoomTime=r),e!==this.lastZoom?(this.lastZoom=e,this.lastFloorZoom=n,!0):!1)}};g();g();var H={"Latin-1 Supplement":l(t=>t>=128&&t<=255,"Latin-1 Supplement"),"Hangul Jamo":l(t=>t>=4352&&t<=4607,"Hangul Jamo"),Khmer:l(t=>t>=6016&&t<=6143,"Khmer"),"General Punctuation":l(t=>t>=8192&&t<=8303,"General Punctuation"),"Letterlike Symbols":l(t=>t>=8448&&t<=8527,"Letterlike Symbols"),"Number Forms":l(t=>t>=8528&&t<=8591,"Number Forms"),"Miscellaneous Technical":l(t=>t>=8960&&t<=9215,"Miscellaneous Technical"),"Control Pictures":l(t=>t>=9216&&t<=9279,"Control Pictures"),"Optical Character Recognition":l(t=>t>=9280&&t<=9311,"Optical Character Recognition"),"Enclosed Alphanumerics":l(t=>t>=9312&&t<=9471,"Enclosed Alphanumerics"),"Geometric Shapes":l(t=>t>=9632&&t<=9727,"Geometric Shapes"),"Miscellaneous Symbols":l(t=>t>=9728&&t<=9983,"Miscellaneous Symbols"),"Miscellaneous Symbols and Arrows":l(t=>t>=11008&&t<=11263,"Miscellaneous Symbols and Arrows"),"Ideographic Description Characters":l(t=>t>=12272&&t<=12287,"Ideographic Description Characters"),"CJK Symbols and Punctuation":l(t=>t>=12288&&t<=12351,"CJK Symbols and Punctuation"),Hiragana:l(t=>t>=12352&&t<=12447,"Hiragana"),Katakana:l(t=>t>=12448&&t<=12543,"Katakana"),Kanbun:l(t=>t>=12688&&t<=12703,"Kanbun"),"CJK Strokes":l(t=>t>=12736&&t<=12783,"CJK Strokes"),"Enclosed CJK Letters and Months":l(t=>t>=12800&&t<=13055,"Enclosed CJK Letters and Months"),"CJK Compatibility":l(t=>t>=13056&&t<=13311,"CJK Compatibility"),"Yijing Hexagram Symbols":l(t=>t>=19904&&t<=19967,"Yijing Hexagram Symbols"),"CJK Unified Ideographs":l(t=>t>=19968&&t<=40959,"CJK Unified Ideographs"),"Hangul Syllables":l(t=>t>=44032&&t<=55215,"Hangul Syllables"),"Private Use Area":l(t=>t>=57344&&t<=63743,"Private Use Area"),"Vertical Forms":l(t=>t>=65040&&t<=65055,"Vertical Forms"),"CJK Compatibility Forms":l(t=>t>=65072&&t<=65103,"CJK Compatibility Forms"),"Small Form Variants":l(t=>t>=65104&&t<=65135,"Small Form Variants"),"Halfwidth and Fullwidth Forms":l(t=>t>=65280&&t<=65519,"Halfwidth and Fullwidth Forms")};function kn(t){for(let e of t)if(Bo(e.charCodeAt(0)))return!0;return!1}l(kn,"allowsVerticalWritingMode");function Yc(t){for(let e of t)if(!mg(e.charCodeAt(0)))return!1;return!0}l(Yc,"allowsLetterSpacing");function Ks(t){let e=t.map(r=>{try{return new RegExp(`\\p{sc=${r}}`,"u").source}catch{return null}}).filter(r=>r);return new RegExp(e.join("|"),"u")}l(Ks,"sanitizedRegExpFromScriptCodes");var fg=["Arab","Dupl","Mong","Ougr","Syrc"],yg=Ks(fg);function mg(t){return!yg.test(String.fromCodePoint(t))}l(mg,"charAllowsLetterSpacing");var hg=["Bopo","Hani","Hira","Kana","Kits","Nshu","Tang","Yiii"],Kc=Ks(hg);function Qc(t){return t<11904?!1:H["CJK Compatibility Forms"](t)||H["CJK Compatibility"](t)||H["CJK Strokes"](t)||H["CJK Symbols and Punctuation"](t)||H["Enclosed CJK Letters and Months"](t)||H["Halfwidth and Fullwidth Forms"](t)||H["Ideographic Description Characters"](t)||H["Vertical Forms"](t)?!0:Kc.test(String.fromCodePoint(t))}l(Qc,"charAllowsIdeographicBreaking");function Bo(t){return t===746||t===747?!0:t<4352?!1:!!(H["CJK Compatibility Forms"](t)&&!(t>=65097&&t<=65103)||H["CJK Compatibility"](t)||H["CJK Strokes"](t)||H["CJK Symbols and Punctuation"](t)&&!(t>=12296&&t<=12305)&&!(t>=12308&&t<=12319)&&t!==12336||H["Enclosed CJK Letters and Months"](t)||H["Ideographic Description Characters"](t)||H.Kanbun(t)||H.Katakana(t)&&t!==12540||H["Halfwidth and Fullwidth Forms"](t)&&t!==65288&&t!==65289&&t!==65293&&!(t>=65306&&t<=65310)&&t!==65339&&t!==65341&&t!==65343&&!(t>=65371&&t<=65503)&&t!==65507&&!(t>=65512&&t<=65519)||H["Small Form Variants"](t)&&!(t>=65112&&t<=65118)&&!(t>=65123&&t<=65126)||H["Vertical Forms"](t)||H["Yijing Hexagram Symbols"](t)||new RegExp("\\p{sc=Cans}","u").test(String.fromCodePoint(t))||new RegExp("\\p{sc=Hang}","u").test(String.fromCodePoint(t))||Kc.test(String.fromCodePoint(t)))}l(Bo,"charHasUprightVerticalOrientation");function dg(t){return!!(H["Latin-1 Supplement"](t)&&(t===167||t===169||t===174||t===177||t===188||t===189||t===190||t===215||t===247)||H["General Punctuation"](t)&&(t===8214||t===8224||t===8225||t===8240||t===8241||t===8251||t===8252||t===8258||t===8263||t===8264||t===8265||t===8273)||H["Letterlike Symbols"](t)||H["Number Forms"](t)||H["Miscellaneous Technical"](t)&&(t>=8960&&t<=8967||t>=8972&&t<=8991||t>=8996&&t<=9e3||t===9003||t>=9085&&t<=9114||t>=9150&&t<=9165||t===9167||t>=9169&&t<=9179||t>=9186&&t<=9215)||H["Control Pictures"](t)&&t!==9251||H["Optical Character Recognition"](t)||H["Enclosed Alphanumerics"](t)||H["Geometric Shapes"](t)||H["Miscellaneous Symbols"](t)&&!(t>=9754&&t<=9759)||H["Miscellaneous Symbols and Arrows"](t)&&(t>=11026&&t<=11055||t>=11088&&t<=11097||t>=11192&&t<=11243)||H["CJK Symbols and Punctuation"](t)||H.Katakana(t)||H["Private Use Area"](t)||H["CJK Compatibility Forms"](t)||H["Small Form Variants"](t)||H["Halfwidth and Fullwidth Forms"](t)||t===8734||t===8756||t===8757||t>=9984&&t<=10087||t>=10102&&t<=10131||t===65532||t===65533)}l(dg,"charHasNeutralVerticalOrientation");function Qs(t){return!(Bo(t)||dg(t))}l(Qs,"charHasRotatedVerticalOrientation");function ep(t){return new RegExp("\\p{sc=Arab}","u").test(String.fromCodePoint(t))}l(ep,"charInComplexShapingScript");var gg=["Adlm","Arab","Armi","Avst","Chrs","Cprt","Egyp","Elym","Gara","Hatr","Hebr","Hung","Khar","Lydi","Mand","Mani","Mend","Merc","Mero","Narb","Nbat","Nkoo","Orkh","Palm","Phli","Phlp","Phnx","Prti","Rohg","Samr","Sarb","Sogo","Syrc","Thaa","Todr","Yezi"],bg=Ks(gg);function tp(t){return bg.test(String.fromCodePoint(t))}l(tp,"charInRTLScript");function xg(t,e){return!(!e&&tp(t)||t>=2304&&t<=3583||t>=3840&&t<=4255||H.Khmer(t))}l(xg,"charInSupportedScript");function rp(t){for(let e of t)if(tp(e.charCodeAt(0)))return!0;return!1}l(rp,"stringContainsRTLText");function np(t,e){for(let r of t)if(!xg(r.charCodeAt(0),e))return!1;return!0}l(np,"isStringInSupportedScript");g();var el=class{constructor(){this.TIMEOUT=5e3;this.applyArabicShaping=null;this.processBidirectionalText=null;this.processStyledBidirectionalText=null;this.pluginStatus="unavailable";this.pluginURL=null;this.loadScriptResolve=l(()=>{},"loadScriptResolve")}static{l(this,"RTLWorkerPlugin")}setState(e){this.pluginStatus=e.pluginStatus,this.pluginURL=e.pluginURL}getState(){return{pluginStatus:this.pluginStatus,pluginURL:this.pluginURL}}setMethods(e){if(Ie.isParsed())throw new Error("RTL text plugin already registered.");this.applyArabicShaping=e.applyArabicShaping,this.processBidirectionalText=e.processBidirectionalText,this.processStyledBidirectionalText=e.processStyledBidirectionalText,this.loadScriptResolve()}isParsed(){return this.applyArabicShaping!=null&&this.processBidirectionalText!=null&&this.processStyledBidirectionalText!=null}getRTLTextPluginStatus(){return this.pluginStatus}async syncState(e,r){if(this.isParsed())return this.getState();if(e.pluginStatus!=="loading")return this.setState(e),e;let n=e.pluginURL,i=new Promise(s=>{this.loadScriptResolve=s});r(n);let o=new Promise(s=>setTimeout(()=>s(),this.TIMEOUT));if(await Promise.race([i,o]),this.isParsed()){let s={pluginStatus:"loaded",pluginURL:n};return this.setState(s),s}throw this.setState({pluginStatus:"error",pluginURL:""}),new Error(`RTL Text Plugin failed to import scripts from ${n}`)}},Ie=new el;var Z=class{static{l(this,"EvaluationParameters")}constructor(e,r){this.zoom=e,r?(this.now=r.now||0,this.fadeDuration=r.fadeDuration||0,this.zoomHistory=r.zoomHistory||new Cn,this.transition=r.transition||{},this.globalState=r.globalState||{}):(this.now=0,this.fadeDuration=0,this.zoomHistory=new Cn,this.transition={},this.globalState={})}isSupportedScript(e){return np(e,Ie.getRTLTextPluginStatus()==="loaded")}crossFadingFactor(){return this.fadeDuration===0?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)}getCrossfadeParameters(){let e=this.zoom,r=e-Math.floor(e),n=this.crossFadingFactor();return e>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:r+(1-r)*n}:{fromScale:.5,toScale:1,t:1-(1-n)*r}}};var Mr=class{static{l(this,"PropertyValue")}constructor(e,r){this.property=e,this.value=r,this.expression=dc(r===void 0?e.specification.default:r,e.specification)}isDataDriven(){return this.expression.kind==="source"||this.expression.kind==="composite"}getGlobalStateRefs(){return this.expression.globalStateRefs||new Set}possiblyEvaluate(e,r,n){return this.property.possiblyEvaluate(this,e,r,n)}},Fn=class{static{l(this,"TransitionablePropertyValue")}constructor(e){this.property=e,this.value=new Mr(e,void 0)}transitioned(e,r){return new Ro(this.property,this.value,r,xe({},e.transition,this.transition),e.now)}untransitioned(){return new Ro(this.property,this.value,null,{},0)}},Vo=class{static{l(this,"Transitionable")}constructor(e){this._properties=e,this._values=Object.create(e.defaultTransitionablePropertyValues)}getValue(e){return at(this._values[e].value.value)}setValue(e,r){Object.prototype.hasOwnProperty.call(this._values,e)||(this._values[e]=new Fn(this._values[e].property)),this._values[e].value=new Mr(this._values[e].property,r===null?void 0:at(r))}getTransition(e){return at(this._values[e].transition)}setTransition(e,r){Object.prototype.hasOwnProperty.call(this._values,e)||(this._values[e]=new Fn(this._values[e].property)),this._values[e].transition=at(r)||void 0}serialize(){let e={};for(let r of Object.keys(this._values)){let n=this.getValue(r);n!==void 0&&(e[r]=n);let i=this.getTransition(r);i!==void 0&&(e[`${r}-transition`]=i)}return e}transitioned(e,r){let n=new zo(this._properties);for(let i of Object.keys(this._values))n._values[i]=this._values[i].transitioned(e,r._values[i]);return n}untransitioned(){let e=new zo(this._properties);for(let r of Object.keys(this._values))e._values[r]=this._values[r].untransitioned();return e}},Ro=class{static{l(this,"TransitioningPropertyValue")}constructor(e,r,n,i,o){this.property=e,this.value=r,this.begin=o+i.delay||0,this.end=this.begin+i.duration||0,e.specification.transition&&(i.delay||i.duration)&&(this.prior=n)}possiblyEvaluate(e,r,n){let i=e.now||0,o=this.value.possiblyEvaluate(e,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(e,r,n);{let s=(i-this.begin)/(this.end-this.begin);return this.property.interpolate(a.possiblyEvaluate(e,r,n),o,Au(s))}}else return o}},zo=class{static{l(this,"Transitioning")}constructor(e){this._properties=e,this._values=Object.create(e.defaultTransitioningPropertyValues)}possiblyEvaluate(e,r,n){let i=new Mt(this._properties);for(let o of Object.keys(this._values))i._values[o]=this._values[o].possiblyEvaluate(e,r,n);return i}hasTransition(){for(let e of Object.keys(this._values))if(this._values[e].prior)return!0;return!1}},Oo=class{static{l(this,"Layout")}constructor(e){this._properties=e,this._values=Object.create(e.defaultPropertyValues)}hasValue(e){return this._values[e].value!==void 0}getValue(e){return at(this._values[e].value)}setValue(e,r){this._values[e]=new Mr(this._values[e].property,r===null?void 0:at(r))}serialize(){let e={};for(let r of Object.keys(this._values)){let n=this.getValue(r);n!==void 0&&(e[r]=n)}return e}possiblyEvaluate(e,r,n){let i=new Mt(this._properties);for(let o of Object.keys(this._values))i._values[o]=this._values[o].possiblyEvaluate(e,r,n);return i}},ve=class{static{l(this,"PossiblyEvaluatedPropertyValue")}constructor(e,r,n){this.property=e,this.value=r,this.parameters=n}isConstant(){return this.value.kind==="constant"}constantOr(e){return this.value.kind==="constant"?this.value.value:e}evaluate(e,r,n,i){return this.property.evaluate(this.value,this.parameters,e,r,n,i)}},Mt=class{static{l(this,"PossiblyEvaluated")}constructor(e){this._properties=e,this._values=Object.create(e.defaultPossiblyEvaluatedValues)}get(e){return this._values[e]}},L=class{static{l(this,"DataConstantProperty")}constructor(e){this.specification=e}possiblyEvaluate(e,r){if(e.isDataDriven())throw new Error("Value should not be data driven");return e.expression.evaluate(r)}interpolate(e,r,n){let i=this.specification.type,o=pt[i];return o?o(e,r,n):e}},V=class{static{l(this,"DataDrivenProperty")}constructor(e,r){this.specification=e,this.overrides=r}possiblyEvaluate(e,r,n,i){return e.expression.kind==="constant"||e.expression.kind==="camera"?new ve(this,{kind:"constant",value:e.expression.evaluate(r,null,{},n,i)},r):new ve(this,e.expression,r)}interpolate(e,r,n){if(e.value.kind!=="constant"||r.value.kind!=="constant")return e;if(e.value.value===void 0||r.value.value===void 0)return new ve(this,{kind:"constant",value:void 0},e.parameters);let i=this.specification.type,o=pt[i];if(o){let a=o(e.value.value,r.value.value,n);return new ve(this,{kind:"constant",value:a},e.parameters)}else return e}evaluate(e,r,n,i,o,a){return e.kind==="constant"?e.value:e.evaluate(r,n,i,o,a)}},mt=class extends V{static{l(this,"CrossFadedDataDrivenProperty")}possiblyEvaluate(e,r,n,i){if(e.value===void 0)return new ve(this,{kind:"constant",value:void 0},r);if(e.expression.kind==="constant"){let o=e.expression.evaluate(r,null,{},n,i),s=e.property.specification.type==="resolvedImage"&&typeof o!="string"?o.name:o,u=this._calculate(s,s,s,r);return new ve(this,{kind:"constant",value:u},r)}else if(e.expression.kind==="camera"){let o=this._calculate(e.expression.evaluate({zoom:r.zoom-1}),e.expression.evaluate({zoom:r.zoom}),e.expression.evaluate({zoom:r.zoom+1}),r);return new ve(this,{kind:"constant",value:o},r)}else return new ve(this,e.expression,r)}evaluate(e,r,n,i,o,a){if(e.kind==="source"){let s=e.evaluate(r,n,i,o,a);return this._calculate(s,s,s,r)}else return e.kind==="composite"?this._calculate(e.evaluate({zoom:Math.floor(r.zoom)-1},n,i),e.evaluate({zoom:Math.floor(r.zoom)},n,i),e.evaluate({zoom:Math.floor(r.zoom)+1},n,i),r):e.value}_calculate(e,r,n,i){return i.zoom>i.zoomHistory.lastIntegerZoom?{from:e,to:r}:{from:n,to:r}}interpolate(e){return e}},ir=class{static{l(this,"CrossFadedProperty")}constructor(e){this.specification=e}possiblyEvaluate(e,r,n,i){if(e.value!==void 0)if(e.expression.kind==="constant"){let o=e.expression.evaluate(r,null,{},n,i);return this._calculate(o,o,o,r)}else return this._calculate(e.expression.evaluate(new Z(Math.floor(r.zoom-1),r)),e.expression.evaluate(new Z(Math.floor(r.zoom),r)),e.expression.evaluate(new Z(Math.floor(r.zoom+1),r)),r)}_calculate(e,r,n,i){return i.zoom>i.zoomHistory.lastIntegerZoom?{from:e,to:r}:{from:n,to:r}}interpolate(e){return e}},ht=class{static{l(this,"ColorRampProperty")}constructor(e){this.specification=e}possiblyEvaluate(e,r,n,i){return!!e.expression.evaluate(r,null,{},n,i)}interpolate(){return!1}},ne=class{static{l(this,"Properties")}constructor(e){this.properties=e,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(let r in e){let n=e[r];n.specification.overridable&&this.overridableProperties.push(r);let i=this.defaultPropertyValues[r]=new Mr(n,void 0),o=this.defaultTransitionablePropertyValues[r]=new Fn(n);this.defaultTransitioningPropertyValues[r]=o.untransitioned(),this.defaultPossiblyEvaluatedValues[r]=i.possiblyEvaluate({})}}};k("DataDrivenProperty",V);k("DataConstantProperty",L);k("CrossFadedDataDrivenProperty",mt);k("CrossFadedProperty",ir);k("ColorRampProperty",ht);var Go="-transition",le=class extends Do{static{l(this,"StyleLayer")}constructor(e,r){if(super(),this.id=e.id,this.type=e.type,this._featureFilter={filter:l(()=>!0,"filter"),needGeometry:!1,getGlobalStateRefs:l(()=>new Set,"getGlobalStateRefs")},e.type!=="custom"&&(e=e,this.metadata=e.metadata,this.minzoom=e.minzoom,this.maxzoom=e.maxzoom,e.type!=="background"&&(this.source=e.source,this.sourceLayer=e["source-layer"],this.filter=e.filter,this._featureFilter=Et(e.filter)),r.layout&&(this._unevaluatedLayout=new Oo(r.layout)),r.paint)){this._transitionablePaint=new Vo(r.paint);for(let n in e.paint)this.setPaintProperty(n,e.paint[n],{validate:!1});for(let n in e.layout)this.setLayoutProperty(n,e.layout[n],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new Mt(r.paint)}}setFilter(e){this.filter=e,this._featureFilter=Et(e)}getCrossfadeParameters(){return this._crossfadeParameters}getLayoutProperty(e){return e==="visibility"?this.visibility:this._unevaluatedLayout.getValue(e)}getLayoutAffectingGlobalStateRefs(){let e=new Set;if(this._unevaluatedLayout)for(let r in this._unevaluatedLayout._values){let n=this._unevaluatedLayout._values[r];for(let i of n.getGlobalStateRefs())e.add(i)}for(let r of this._featureFilter.getGlobalStateRefs())e.add(r);return e}setLayoutProperty(e,r,n={}){if(r!=null){let i=`layers.${this.id}.layout.${e}`;if(this._validate(Zc,i,e,r,n))return}if(e==="visibility"){this.visibility=r;return}this._unevaluatedLayout.setValue(e,r)}getPaintProperty(e){return e.endsWith(Go)?this._transitionablePaint.getTransition(e.slice(0,-Go.length)):this._transitionablePaint.getValue(e)}setPaintProperty(e,r,n={}){if(r!=null){let i=`layers.${this.id}.paint.${e}`;if(this._validate(Hc,i,e,r,n))return!1}if(e.endsWith(Go))return this._transitionablePaint.setTransition(e.slice(0,-Go.length),r||void 0),!1;{let i=this._transitionablePaint._values[e],o=i.property.specification["property-type"]==="cross-faded-data-driven",a=i.value.isDataDriven(),s=i.value;this._transitionablePaint.setValue(e,r),this._handleSpecialPaintPropertyUpdate(e);let u=this._transitionablePaint._values[e].value;return u.isDataDriven()||a||o||this._handleOverridablePaintPropertyUpdate(e,s,u)}}_handleSpecialPaintPropertyUpdate(e){}_handleOverridablePaintPropertyUpdate(e,r,n){return!1}isHidden(e){return this.minzoom&&e<this.minzoom||this.maxzoom&&e>=this.maxzoom?!0:this.visibility==="none"}updateTransitions(e){this._transitioningPaint=this._transitionablePaint.transitioned(e,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculate(e,r){e.getCrossfadeParameters&&(this._crossfadeParameters=e.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(e,void 0,r)),this.paint=this._transitioningPaint.possiblyEvaluate(e,void 0,r)}serialize(){let e={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&&(e.layout=e.layout||{},e.layout.visibility=this.visibility),Tu(e,(r,n)=>r!==void 0&&!(n==="layout"&&!Object.keys(r).length)&&!(n==="paint"&&!Object.keys(r).length))}_validate(e,r,n,i,o={}){return o&&o.validate===!1?!1:Jc(this,e.call(yt,{key:r,layerType:this.type,objectKey:n,value:i,styleSpec:A,style:{glyphs:!0,sprite:!0}}))}is3D(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(let e in this.paint._values){let r=this.paint.get(e);if(!(!(r instanceof ve)||!kt(r.property.specification))&&(r.value.kind==="source"||r.value.kind==="composite")&&r.value.isStateDependent)return!0}return!1}};g();g();g();var vg={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array},Lt=class{static{l(this,"Struct")}constructor(e,r){this._structArray=e,this._pos1=r*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}},Pg=128,Sg=5,ie=class{static{l(this,"StructArray")}constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(e,r){return e._trim(),r&&(e.isTransferred=!0,r.push(e.arrayBuffer)),{length:e.length,arrayBuffer:e.arrayBuffer}}static deserialize(e){let r=Object.create(this.prototype);return r.arrayBuffer=e.arrayBuffer,r.length=e.length,r.capacity=e.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(e){this.reserve(e),this.length=e}reserve(e){if(e>this.capacity){this.capacity=Math.max(e,Math.floor(this.capacity*Sg),Pg),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 re(t,e=1){let r=0,n=0,i=t.map(a=>{let s=wg(a.type),u=r=ip(r,Math.max(e,s)),c=a.components||1;return n=Math.max(n,s),r+=s*c,{name:a.name,type:a.type,components:c,offset:u}}),o=ip(r,Math.max(n,e));return{members:i,size:o,alignment:e}}l(re,"createLayout");function wg(t){return vg[t].BYTES_PER_ELEMENT}l(wg,"sizeOf");function ip(t,e){return Math.ceil(t/e)*e}l(ip,"align");var op=ee(de(),1);var or=class extends ie{static{l(this,"StructArrayLayout2i4")}_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r){let n=this.length;return this.resize(n+1),this.emplace(n,e,r)}emplace(e,r,n){let i=e*2;return this.int16[i+0]=r,this.int16[i+1]=n,e}};or.prototype.bytesPerElement=4;k("StructArrayLayout2i4",or);var En=class extends ie{static{l(this,"StructArrayLayout3i6")}_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,n){let i=this.length;return this.resize(i+1),this.emplace(i,e,r,n)}emplace(e,r,n,i){let o=e*3;return this.int16[o+0]=r,this.int16[o+1]=n,this.int16[o+2]=i,e}};En.prototype.bytesPerElement=6;k("StructArrayLayout3i6",En);var No=class extends ie{static{l(this,"StructArrayLayout4i8")}_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,n,i){let o=this.length;return this.resize(o+1),this.emplace(o,e,r,n,i)}emplace(e,r,n,i,o){let a=e*4;return this.int16[a+0]=r,this.int16[a+1]=n,this.int16[a+2]=i,this.int16[a+3]=o,e}};No.prototype.bytesPerElement=8;k("StructArrayLayout4i8",No);var Mn=class extends ie{static{l(this,"StructArrayLayout2i4i12")}_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,n,i,o,a){let s=this.length;return this.resize(s+1),this.emplace(s,e,r,n,i,o,a)}emplace(e,r,n,i,o,a,s){let u=e*6;return this.int16[u+0]=r,this.int16[u+1]=n,this.int16[u+2]=i,this.int16[u+3]=o,this.int16[u+4]=a,this.int16[u+5]=s,e}};Mn.prototype.bytesPerElement=12;k("StructArrayLayout2i4i12",Mn);var Ln=class extends ie{static{l(this,"StructArrayLayout2i4ub8")}_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,n,i,o,a){let s=this.length;return this.resize(s+1),this.emplace(s,e,r,n,i,o,a)}emplace(e,r,n,i,o,a,s){let u=e*4,c=e*8;return this.int16[u+0]=r,this.int16[u+1]=n,this.uint8[c+4]=i,this.uint8[c+5]=o,this.uint8[c+6]=a,this.uint8[c+7]=s,e}};Ln.prototype.bytesPerElement=8;k("StructArrayLayout2i4ub8",Ln);var Dt=class extends ie{static{l(this,"StructArrayLayout2f8")}_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r){let n=this.length;return this.resize(n+1),this.emplace(n,e,r)}emplace(e,r,n){let i=e*2;return this.float32[i+0]=r,this.float32[i+1]=n,e}};Dt.prototype.bytesPerElement=8;k("StructArrayLayout2f8",Dt);var Dn=class extends ie{static{l(this,"StructArrayLayout10ui20")}_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r,n,i,o,a,s,u,c,p){let f=this.length;return this.resize(f+1),this.emplace(f,e,r,n,i,o,a,s,u,c,p)}emplace(e,r,n,i,o,a,s,u,c,p,f){let y=e*10;return this.uint16[y+0]=r,this.uint16[y+1]=n,this.uint16[y+2]=i,this.uint16[y+3]=o,this.uint16[y+4]=a,this.uint16[y+5]=s,this.uint16[y+6]=u,this.uint16[y+7]=c,this.uint16[y+8]=p,this.uint16[y+9]=f,e}};Dn.prototype.bytesPerElement=20;k("StructArrayLayout10ui20",Dn);var Bn=class extends ie{static{l(this,"StructArrayLayout4i4ui4i24")}_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r,n,i,o,a,s,u,c,p,f,y){let m=this.length;return this.resize(m+1),this.emplace(m,e,r,n,i,o,a,s,u,c,p,f,y)}emplace(e,r,n,i,o,a,s,u,c,p,f,y,m){let h=e*12;return this.int16[h+0]=r,this.int16[h+1]=n,this.int16[h+2]=i,this.int16[h+3]=o,this.uint16[h+4]=a,this.uint16[h+5]=s,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,e}};Bn.prototype.bytesPerElement=24;k("StructArrayLayout4i4ui4i24",Bn);var Vn=class extends ie{static{l(this,"StructArrayLayout3f12")}_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r,n){let i=this.length;return this.resize(i+1),this.emplace(i,e,r,n)}emplace(e,r,n,i){let o=e*3;return this.float32[o+0]=r,this.float32[o+1]=n,this.float32[o+2]=i,e}};Vn.prototype.bytesPerElement=12;k("StructArrayLayout3f12",Vn);var Rn=class extends ie{static{l(this,"StructArrayLayout1ul4")}_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(e){let r=this.length;return this.resize(r+1),this.emplace(r,e)}emplace(e,r){let n=e*1;return this.uint32[n+0]=r,e}};Rn.prototype.bytesPerElement=4;k("StructArrayLayout1ul4",Rn);var zn=class extends ie{static{l(this,"StructArrayLayout6i1ul2ui20")}_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(e,r,n,i,o,a,s,u,c){let p=this.length;return this.resize(p+1),this.emplace(p,e,r,n,i,o,a,s,u,c)}emplace(e,r,n,i,o,a,s,u,c,p){let f=e*10,y=e*5;return this.int16[f+0]=r,this.int16[f+1]=n,this.int16[f+2]=i,this.int16[f+3]=o,this.int16[f+4]=a,this.int16[f+5]=s,this.uint32[y+3]=u,this.uint16[f+8]=c,this.uint16[f+9]=p,e}};zn.prototype.bytesPerElement=20;k("StructArrayLayout6i1ul2ui20",zn);var On=class extends ie{static{l(this,"StructArrayLayout2i2i2i12")}_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,n,i,o,a){let s=this.length;return this.resize(s+1),this.emplace(s,e,r,n,i,o,a)}emplace(e,r,n,i,o,a,s){let u=e*6;return this.int16[u+0]=r,this.int16[u+1]=n,this.int16[u+2]=i,this.int16[u+3]=o,this.int16[u+4]=a,this.int16[u+5]=s,e}};On.prototype.bytesPerElement=12;k("StructArrayLayout2i2i2i12",On);var Uo=class extends ie{static{l(this,"StructArrayLayout2f1f2i16")}_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,n,i,o){let a=this.length;return this.resize(a+1),this.emplace(a,e,r,n,i,o)}emplace(e,r,n,i,o,a){let s=e*4,u=e*8;return this.float32[s+0]=r,this.float32[s+1]=n,this.float32[s+2]=i,this.int16[u+6]=o,this.int16[u+7]=a,e}};Uo.prototype.bytesPerElement=16;k("StructArrayLayout2f1f2i16",Uo);var Gn=class extends ie{static{l(this,"StructArrayLayout2ub2f2i16")}_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,n,i,o,a){let s=this.length;return this.resize(s+1),this.emplace(s,e,r,n,i,o,a)}emplace(e,r,n,i,o,a,s){let u=e*16,c=e*4,p=e*8;return this.uint8[u+0]=r,this.uint8[u+1]=n,this.float32[c+1]=i,this.float32[c+2]=o,this.int16[p+6]=a,this.int16[p+7]=s,e}};Gn.prototype.bytesPerElement=16;k("StructArrayLayout2ub2f2i16",Gn);var Nn=class extends ie{static{l(this,"StructArrayLayout3ui6")}_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r,n){let i=this.length;return this.resize(i+1),this.emplace(i,e,r,n)}emplace(e,r,n,i){let o=e*3;return this.uint16[o+0]=r,this.uint16[o+1]=n,this.uint16[o+2]=i,e}};Nn.prototype.bytesPerElement=6;k("StructArrayLayout3ui6",Nn);var Un=class extends ie{static{l(this,"StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48")}_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(e,r,n,i,o,a,s,u,c,p,f,y,m,h,d,x,b){let P=this.length;return this.resize(P+1),this.emplace(P,e,r,n,i,o,a,s,u,c,p,f,y,m,h,d,x,b)}emplace(e,r,n,i,o,a,s,u,c,p,f,y,m,h,d,x,b,P){let v=e*24,S=e*12,_=e*48;return this.int16[v+0]=r,this.int16[v+1]=n,this.uint16[v+2]=i,this.uint16[v+3]=o,this.uint32[S+2]=a,this.uint32[S+3]=s,this.uint32[S+4]=u,this.uint16[v+10]=c,this.uint16[v+11]=p,this.uint16[v+12]=f,this.float32[S+7]=y,this.float32[S+8]=m,this.uint8[_+36]=h,this.uint8[_+37]=d,this.uint8[_+38]=x,this.uint32[S+10]=b,this.int16[v+22]=P,e}};Un.prototype.bytesPerElement=48;k("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",Un);var $n=class extends ie{static{l(this,"StructArrayLayout8i15ui1ul2f2ui64")}_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(e,r,n,i,o,a,s,u,c,p,f,y,m,h,d,x,b,P,v,S,_,T,I,F,D,R,z,N){let B=this.length;return this.resize(B+1),this.emplace(B,e,r,n,i,o,a,s,u,c,p,f,y,m,h,d,x,b,P,v,S,_,T,I,F,D,R,z,N)}emplace(e,r,n,i,o,a,s,u,c,p,f,y,m,h,d,x,b,P,v,S,_,T,I,F,D,R,z,N,B){let C=e*32,O=e*16;return this.int16[C+0]=r,this.int16[C+1]=n,this.int16[C+2]=i,this.int16[C+3]=o,this.int16[C+4]=a,this.int16[C+5]=s,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]=x,this.uint16[C+15]=b,this.uint16[C+16]=P,this.uint16[C+17]=v,this.uint16[C+18]=S,this.uint16[C+19]=_,this.uint16[C+20]=T,this.uint16[C+21]=I,this.uint16[C+22]=F,this.uint32[O+12]=D,this.float32[O+13]=R,this.float32[O+14]=z,this.uint16[C+30]=N,this.uint16[C+31]=B,e}};$n.prototype.bytesPerElement=64;k("StructArrayLayout8i15ui1ul2f2ui64",$n);var ar=class extends ie{static{l(this,"StructArrayLayout1f4")}_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e){let r=this.length;return this.resize(r+1),this.emplace(r,e)}emplace(e,r){let n=e*1;return this.float32[n+0]=r,e}};ar.prototype.bytesPerElement=4;k("StructArrayLayout1f4",ar);var jn=class extends ie{static{l(this,"StructArrayLayout1ui2f12")}_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r,n){let i=this.length;return this.resize(i+1),this.emplace(i,e,r,n)}emplace(e,r,n,i){let o=e*6,a=e*3;return this.uint16[o+0]=r,this.float32[a+1]=n,this.float32[a+2]=i,e}};jn.prototype.bytesPerElement=12;k("StructArrayLayout1ui2f12",jn);var qn=class extends ie{static{l(this,"StructArrayLayout1ul2ui8")}_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r,n){let i=this.length;return this.resize(i+1),this.emplace(i,e,r,n)}emplace(e,r,n,i){let o=e*2,a=e*4;return this.uint32[o+0]=r,this.uint16[a+2]=n,this.uint16[a+3]=i,e}};qn.prototype.bytesPerElement=8;k("StructArrayLayout1ul2ui8",qn);var Wn=class extends ie{static{l(this,"StructArrayLayout2ui4")}_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r){let n=this.length;return this.resize(n+1),this.emplace(n,e,r)}emplace(e,r,n){let i=e*2;return this.uint16[i+0]=r,this.uint16[i+1]=n,e}};Wn.prototype.bytesPerElement=4;k("StructArrayLayout2ui4",Wn);var $o=class extends ie{static{l(this,"StructArrayLayout1ui2")}_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e){let r=this.length;return this.resize(r+1),this.emplace(r,e)}emplace(e,r){let n=e*1;return this.uint16[n+0]=r,e}};$o.prototype.bytesPerElement=2;k("StructArrayLayout1ui2",$o);var Lr=class extends ie{static{l(this,"StructArrayLayout4f16")}_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r,n,i){let o=this.length;return this.resize(o+1),this.emplace(o,e,r,n,i)}emplace(e,r,n,i,o){let a=e*4;return this.float32[a+0]=r,this.float32[a+1]=n,this.float32[a+2]=i,this.float32[a+3]=o,e}};Lr.prototype.bytesPerElement=16;k("StructArrayLayout4f16",Lr);var jo=class extends Lt{static{l(this,"CollisionBoxStruct")}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 op.default(this.anchorPointX,this.anchorPointY)}};jo.prototype.size=20;var Xn=class extends zn{static{l(this,"CollisionBoxArray")}get(e){return new jo(this,e)}};k("CollisionBoxArray",Xn);var qo=class extends Lt{static{l(this,"PlacedSymbolStruct")}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(e){this._structArray.uint8[this._pos1+37]=e}get hidden(){return this._structArray.uint8[this._pos1+38]}set hidden(e){this._structArray.uint8[this._pos1+38]=e}get crossTileID(){return this._structArray.uint32[this._pos4+10]}set crossTileID(e){this._structArray.uint32[this._pos4+10]=e}get associatedIconIndex(){return this._structArray.int16[this._pos2+22]}};qo.prototype.size=48;var Hn=class extends Un{static{l(this,"PlacedSymbolArray")}get(e){return new qo(this,e)}};k("PlacedSymbolArray",Hn);var Wo=class extends Lt{static{l(this,"SymbolInstanceStruct")}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(e){this._structArray.uint32[this._pos4+12]=e}get textBoxScale(){return this._structArray.float32[this._pos4+13]}get collisionCircleDiameter(){return this._structArray.float32[this._pos4+14]}get textAnchorOffsetStartIndex(){return this._structArray.uint16[this._pos2+30]}get textAnchorOffsetEndIndex(){return this._structArray.uint16[this._pos2+31]}};Wo.prototype.size=64;var Zn=class extends $n{static{l(this,"SymbolInstanceArray")}get(e){return new Wo(this,e)}};k("SymbolInstanceArray",Zn);var Jn=class extends ar{static{l(this,"GlyphOffsetArray")}getoffsetX(e){return this.float32[e*1+0]}};k("GlyphOffsetArray",Jn);var Yn=class extends En{static{l(this,"SymbolLineVertexArray")}getx(e){return this.int16[e*3+0]}gety(e){return this.int16[e*3+1]}gettileUnitDistanceFromAnchor(e){return this.int16[e*3+2]}};k("SymbolLineVertexArray",Yn);var Xo=class extends Lt{static{l(this,"TextAnchorOffsetStruct")}get textAnchor(){return this._structArray.uint16[this._pos2+0]}get textOffset0(){return this._structArray.float32[this._pos4+1]}get textOffset1(){return this._structArray.float32[this._pos4+2]}};Xo.prototype.size=12;var Kn=class extends jn{static{l(this,"TextAnchorOffsetArray")}get(e){return new Xo(this,e)}};k("TextAnchorOffsetArray",Kn);var Ho=class extends Lt{static{l(this,"FeatureIndexStruct")}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]}};Ho.prototype.size=8;var Qn=class extends qn{static{l(this,"FeatureIndexArray")}get(e){return new Ho(this,e)}};k("FeatureIndexArray",Qn);var Zo=class extends or{static{l(this,"PosArray")}};var Jo=class extends or{static{l(this,"CircleLayoutArray")}},Yo=class extends or{static{l(this,"FillLayoutArray")}},Ko=class extends Mn{static{l(this,"FillExtrusionLayoutArray")}};var Qo=class extends Ln{static{l(this,"LineLayoutArray")}},ea=class extends Dt{static{l(this,"LineExtLayoutArray")}},dt=class extends Dn{static{l(this,"PatternLayoutArray")}},ta=class extends Bn{static{l(this,"SymbolLayoutArray")}},ra=class extends Vn{static{l(this,"SymbolDynamicLayoutArray")}},na=class extends Rn{static{l(this,"SymbolOpacityArray")}},ei=class extends On{static{l(this,"CollisionBoxLayoutArray")}};var ia=class extends Gn{static{l(this,"CollisionVertexArray")}};var Ve=class extends Nn{static{l(this,"TriangleIndexArray")}},Bt=class extends Wn{static{l(this,"LineIndexArray")}};g();var Ag=re([{name:"a_pos",components:2,type:"Int16"}],4);var{members:ap,size:zP,alignment:OP}=Ag;g();var me=class t{constructor(e=[]){this._forceNewSegmentOnNextPrepare=!1;this.segments=e}static{l(this,"SegmentVector")}prepareSegment(e,r,n,i){let o=this.segments[this.segments.length-1];return e>t.MAX_VERTEX_ARRAY_LENGTH&&ye(`Max vertices per segment is ${t.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${e}. Consider using the \`fillLargeMeshArrays\` function if you require meshes with more than ${t.MAX_VERTEX_ARRAY_LENGTH} vertices.`),this._forceNewSegmentOnNextPrepare||!o||o.vertexLength+e>t.MAX_VERTEX_ARRAY_LENGTH||o.sortKey!==i?this.createNewSegment(r,n,i):o}createNewSegment(e,r,n){let i={vertexOffset:e.length,primitiveOffset:r.length,vertexLength:0,primitiveLength:0,vaos:{}};return n!==void 0&&(i.sortKey=n),this._forceNewSegmentOnNextPrepare=!1,this.segments.push(i),i}getOrCreateLatestSegment(e,r,n){return this.prepareSegment(0,e,r,n)}forceNewSegmentOnNextPrepare(){this._forceNewSegmentOnNextPrepare=!0}get(){return this.segments}destroy(){for(let e of this.segments)for(let r in e.vaos)e.vaos[r].destroy()}static simpleSegment(e,r,n,i){return new t([{vertexOffset:e,primitiveOffset:r,vertexLength:n,primitiveLength:i,vaos:{},sortKey:0}])}};me.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1;k("SegmentVector",me);g();g();function tl(t,e){return t=st(Math.floor(t),0,255),e=st(Math.floor(e),0,255),256*t+e}l(tl,"packUint8ToFloat");g();var ti=re([{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"}]);g();var pp=ee(il(),1);var ri=class t{static{l(this,"FeaturePositionMap")}constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(e,r,n,i){this.ids.push(cp(e)),this.positions.push(r,n,i)}getPositions(e){if(!this.indexed)throw new Error("Trying to get index, but feature positions are not indexed");let r=cp(e),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],u=this.positions[3*n+2];o.push({index:a,start:s,end:u}),n++}return o}static serialize(e,r){let n=new Float64Array(e.ids),i=new Uint32Array(e.positions);return ol(n,i,0,n.length-1),r&&r.push(n.buffer,i.buffer),{ids:n,positions:i}}static deserialize(e){let r=new t;return r.ids=e.ids,r.positions=e.positions,r.indexed=!0,r}};function cp(t){let e=+t;return!isNaN(e)&&e<=Number.MAX_SAFE_INTEGER?e:(0,pp.default)(String(t))}l(cp,"getNumericId");function ol(t,e,r,n){for(;r<n;){let i=t[r+n>>1],o=r-1,a=n+1;for(;;){do o++;while(t[o]<i);do a--;while(t[a]>i);if(o>=a)break;aa(t,o,a),aa(e,3*o,3*a),aa(e,3*o+1,3*a+1),aa(e,3*o+2,3*a+2)}a-r<n-a?(ol(t,e,r,a),r=a+1):(ol(t,e,a+1,n),n=a)}}l(ol,"sort");function aa(t,e,r){let n=t[e];t[e]=t[r],t[r]=n}l(aa,"swap");k("FeaturePositionMap",ri);g();var ni=class{static{l(this,"Uniform")}constructor(e,r){this.gl=e.gl,this.location=r}};var Dr=class extends ni{static{l(this,"Uniform1f")}constructor(e,r){super(e,r),this.current=0}set(e){this.current!==e&&(this.current=e,this.gl.uniform1f(this.location,e))}};var sa=class extends ni{static{l(this,"Uniform4f")}constructor(e,r){super(e,r),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]))}},la=class extends ni{static{l(this,"UniformColor")}constructor(e,r){super(e,r),this.current=Y.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))}};var y1=new Float32Array(16);function al(t){return[tl(255*t.r,255*t.g),tl(255*t.b,255*t.a)]}l(al,"packColor");var sr=class{static{l(this,"ConstantBinder")}constructor(e,r,n){this.value=e,this.uniformNames=r.map(i=>`u_${i}`),this.type=n}setUniform(e,r,n){e.set(n.constantOr(this.value))}getBinding(e,r,n){return this.type==="color"?new la(e,r):new Dr(e,r)}},Vt=class{static{l(this,"CrossFadedConstantBinder")}constructor(e,r){this.uniformNames=r.map(n=>`u_${n}`),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1}setConstantPatternPositions(e,r){this.pixelRatioFrom=r.pixelRatio,this.pixelRatioTo=e.pixelRatio,this.patternFrom=r.tlbr,this.patternTo=e.tlbr}setUniform(e,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&&e.set(o)}getBinding(e,r,n){return n.substr(0,9)==="u_pattern"?new sa(e,r):new Dr(e,r)}},Ze=class{static{l(this,"SourceExpressionBinder")}constructor(e,r,n,i){this.expression=e,this.type=n,this.maxValue=0,this.paintVertexAttributes=r.map(o=>({name:`a_${o}`,type:"Float32",components:n==="color"?2:1,offset:0})),this.paintVertexArray=new i}populatePaintArray(e,r,n,i,o){let a=this.paintVertexArray.length,s=this.expression.evaluate(new Z(0),r,{},i,[],o);this.paintVertexArray.resize(e),this._setPaintValue(a,e,s)}updatePaintArray(e,r,n,i){let o=this.expression.evaluate({zoom:0},n,i);this._setPaintValue(e,r,o)}_setPaintValue(e,r,n){if(this.type==="color"){let i=al(n);for(let o=e;o<r;o++)this.paintVertexArray.emplace(o,i[0],i[1])}else{for(let i=e;i<r;i++)this.paintVertexArray.emplace(i,n);this.maxValue=Math.max(this.maxValue,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()}},Re=class{static{l(this,"CompositeExpressionBinder")}constructor(e,r,n,i,o,a){this.expression=e,this.uniformNames=r.map(s=>`u_${s}_t`),this.type=n,this.useIntegerZoom=i,this.zoom=o,this.maxValue=0,this.paintVertexAttributes=r.map(s=>({name:`a_${s}`,type:"Float32",components:n==="color"?4:2,offset:0})),this.paintVertexArray=new a}populatePaintArray(e,r,n,i,o){let a=this.expression.evaluate(new Z(this.zoom),r,{},i,[],o),s=this.expression.evaluate(new Z(this.zoom+1),r,{},i,[],o),u=this.paintVertexArray.length;this.paintVertexArray.resize(e),this._setPaintValue(u,e,a,s)}updatePaintArray(e,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(e,r,o,a)}_setPaintValue(e,r,n,i){if(this.type==="color"){let o=al(n),a=al(i);for(let s=e;s<r;s++)this.paintVertexArray.emplace(s,o[0],o[1],a[0],a[1])}else{for(let o=e;o<r;o++)this.paintVertexArray.emplace(o,n,i);this.maxValue=Math.max(this.maxValue,Math.abs(n),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()}setUniform(e,r){let n=this.useIntegerZoom?Math.floor(r.zoom):r.zoom,i=st(this.expression.interpolationFactor(n,this.zoom,this.zoom+1),0,1);e.set(i)}getBinding(e,r,n){return new Dr(e,r)}},et=class{static{l(this,"CrossFadedCompositeBinder")}constructor(e,r,n,i,o,a){this.expression=e,this.type=r,this.useIntegerZoom=n,this.zoom=i,this.layerId=a,this.zoomInPaintVertexArray=new o,this.zoomOutPaintVertexArray=new o}populatePaintArray(e,r,n){let i=this.zoomInPaintVertexArray.length;this.zoomInPaintVertexArray.resize(e),this.zoomOutPaintVertexArray.resize(e),this._setPaintValues(i,e,r.patterns&&r.patterns[this.layerId],n)}updatePaintArray(e,r,n,i,o){this._setPaintValues(e,r,n.patterns&&n.patterns[this.layerId],o)}_setPaintValues(e,r,n,i){if(!i||!n)return;let{min:o,mid:a,max:s}=n,u=i[o],c=i[a],p=i[s];if(!(!u||!c||!p))for(let f=e;f<r;f++)this.zoomInPaintVertexArray.emplace(f,c.tl[0],c.tl[1],c.br[0],c.br[1],u.tl[0],u.tl[1],u.br[0],u.br[1],c.pixelRatio,u.pixelRatio),this.zoomOutPaintVertexArray.emplace(f,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,ti.members,this.expression.isStateDependent),this.zoomOutPaintVertexBuffer=e.createVertexBuffer(this.zoomOutPaintVertexArray,ti.members,this.expression.isStateDependent))}destroy(){this.zoomOutPaintVertexBuffer&&this.zoomOutPaintVertexBuffer.destroy(),this.zoomInPaintVertexBuffer&&this.zoomInPaintVertexBuffer.destroy()}},ua=class{static{l(this,"ProgramConfiguration")}constructor(e,r,n){this.binders={},this._buffers=[];let i=[];for(let o in e.paint._values){if(!n(o))continue;let a=e.paint.get(o);if(!(a instanceof ve)||!kt(a.property.specification))continue;let s=Cg(o,e.type),u=a.value,c=a.property.specification.type,p=a.property.useIntegerZoom,f=a.property.specification["property-type"],y=f==="cross-faded"||f==="cross-faded-data-driven";if(u.kind==="constant")this.binders[o]=y?new Vt(u.value,s):new sr(u.value,s,c),i.push(`/u_${o}`);else if(u.kind==="source"||y){let m=fp(o,c,"source");this.binders[o]=y?new et(u,c,p,r,m,e.id):new Ze(u,s,c,m),i.push(`/a_${o}`)}else{let m=fp(o,c,"composite");this.binders[o]=new Re(u,s,c,p,r,m),i.push(`/z_${o}`)}}this.cacheKey=i.sort().join("")}getMaxValue(e){let r=this.binders[e];return r instanceof Ze||r instanceof Re?r.maxValue:0}populatePaintArrays(e,r,n,i,o){for(let a in this.binders){let s=this.binders[a];(s instanceof Ze||s instanceof Re||s instanceof et)&&s.populatePaintArray(e,r,n,i,o)}}setConstantPatternPositions(e,r){for(let n in this.binders){let i=this.binders[n];i instanceof Vt&&i.setConstantPatternPositions(e,r)}}updatePaintArrays(e,r,n,i,o){let a=!1;for(let s in e){let u=r.getPositions(s);for(let c of u){let p=n.feature(c.index);for(let f in this.binders){let y=this.binders[f];if((y instanceof Ze||y instanceof Re||y instanceof et)&&y.expression.isStateDependent===!0){let m=i.paint.get(f);y.expression=m.value,y.updatePaintArray(c.start,c.end,p,e[s],o),a=!0}}}}return a}defines(){let e=[];for(let r in this.binders){let n=this.binders[r];(n instanceof sr||n instanceof Vt)&&e.push(...n.uniformNames.map(i=>`#define HAS_UNIFORM_${i}`))}return e}getBinderAttributes(){let e=[];for(let r in this.binders){let n=this.binders[r];if(n instanceof Ze||n instanceof Re)for(let i=0;i<n.paintVertexAttributes.length;i++)e.push(n.paintVertexAttributes[i].name);else if(n instanceof et)for(let i=0;i<ti.members.length;i++)e.push(ti.members[i].name)}return e}getBinderUniforms(){let e=[];for(let r in this.binders){let n=this.binders[r];if(n instanceof sr||n instanceof Vt||n instanceof Re)for(let i of n.uniformNames)e.push(i)}return e}getPaintVertexBuffers(){return this._buffers}getUniforms(e,r){let n=[];for(let i in this.binders){let o=this.binders[i];if(o instanceof sr||o instanceof Vt||o instanceof Re){for(let a of o.uniformNames)if(r[a]){let s=o.getBinding(e,r[a],a);n.push({name:a,property:i,binding:s})}}}return n}setUniforms(e,r,n,i){for(let{name:o,property:a,binding:s}of r)this.binders[a].setUniform(s,i,n.get(a),o)}updatePaintBuffers(e){this._buffers=[];for(let r in this.binders){let n=this.binders[r];if(e&&n instanceof et){let i=e.fromScale===2?n.zoomInPaintVertexBuffer:n.zoomOutPaintVertexBuffer;i&&this._buffers.push(i)}else(n instanceof Ze||n instanceof Re)&&n.paintVertexBuffer&&this._buffers.push(n.paintVertexBuffer)}}upload(e){for(let r in this.binders){let n=this.binders[r];(n instanceof Ze||n instanceof Re||n instanceof et)&&n.upload(e)}this.updatePaintBuffers()}destroy(){for(let e in this.binders){let r=this.binders[e];(r instanceof Ze||r instanceof Re||r instanceof et)&&r.destroy()}}},Te=class{static{l(this,"ProgramConfigurationSet")}constructor(e,r,n=()=>!0){this.programConfigurations={};for(let i of e)this.programConfigurations[i.id]=new ua(i,r,n);this.needsUpload=!1,this._featureMap=new ri,this._bufferOffset=0}populatePaintArrays(e,r,n,i,o,a){for(let s in this.programConfigurations)this.programConfigurations[s].populatePaintArrays(e,r,i,o,a);r.id!==void 0&&this._featureMap.add(r.id,n,this._bufferOffset,e),this._bufferOffset=e,this.needsUpload=!0}updatePaintArrays(e,r,n,i){for(let o of n)this.needsUpload=this.programConfigurations[o.id].updatePaintArrays(e,this._featureMap,r,o,i)||this.needsUpload}get(e){return this.programConfigurations[e]}upload(e){if(this.needsUpload){for(let r in this.programConfigurations)this.programConfigurations[r].upload(e);this.needsUpload=!1}}destroy(){for(let e in this.programConfigurations)this.programConfigurations[e].destroy()}};function Cg(t,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"]}[t]||[t.replace(`${e}-`,"").replace(/-/g,"_")]}l(Cg,"paintAttributeNames");function kg(t){return{"line-pattern":{source:dt,composite:dt},"fill-pattern":{source:dt,composite:dt},"fill-extrusion-pattern":{source:dt,composite:dt}}[t]}l(kg,"getLayoutException");function fp(t,e,r){let n={color:{source:Dt,composite:Lr},number:{source:ar,composite:Dt}},i=kg(t);return i&&i[r]||n[e][r]}l(fp,"layoutType");k("ConstantBinder",sr);k("CrossFadedConstantBinder",Vt);k("SourceExpressionBinder",Ze);k("CrossFadedCompositeBinder",et);k("CompositeExpressionBinder",Re);k("ProgramConfiguration",ua,{omit:["_buffers"]});k("ProgramConfigurationSet",Te);g();g();var Fg=15,sl=Math.pow(2,Fg-1)-1,yp=-sl-1;function Ce(t){let e=8192/t.extent,r=t.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*e),u=Math.round(a.y*e);a.x=st(s,yp,sl),a.y=st(u,yp,sl),(s<a.x||s>a.x+1||u<a.y||u>a.y+1)&&ye("Geometry exceeds allowed extent, reduce your vector tile buffer size")}}return r}l(Ce,"loadGeometry");g();function je(t,e){return{type:t.type,id:t.id,properties:t.properties,geometry:e?Ce(t):[]}}l(je,"toEvaluationFeature");var mp=-32768;function Eg(t,e,r,n,i){t.emplaceBack(mp+e*8+n,mp+r*8+i)}l(Eg,"addCircleVertex");var lr=class{static{l(this,"CircleBucket")}constructor(e){this.zoom=e.zoom,this.globalState=e.globalState,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(r=>r.id),this.index=e.index,this.hasPattern=!1,this.layoutVertexArray=new Jo,this.indexArray=new Ve,this.segments=new me,this.programConfigurations=new Te(e.layers,e.zoom),this.stateDependentLayerIds=this.layers.filter(r=>r.isStateDependent()).map(r=>r.id)}populate(e,r,n){let i=this.layers[0],o=[],a=null,s=!1,u=i.type==="heatmap";if(i.type==="circle"){let p=i;a=p.layout.get("circle-sort-key"),s=!a.isConstant(),u=u||p.paint.get("circle-pitch-alignment")==="map"}let c=u?r.subdivisionGranularity.circle:1;for(let{feature:p,id:f,index:y,sourceLayerIndex:m}of e){let h=this.layers[0]._featureFilter.needGeometry,d=je(p,h);if(!this.layers[0]._featureFilter.filter(new Z(this.zoom,{globalState:this.globalState}),d,n))continue;let x=s?a.evaluate(d,{},n):void 0,b={id:f,properties:p.properties,type:p.type,sourceLayerIndex:m,index:y,geometry:h?d.geometry:Ce(p),patterns:{},sortKey:x};o.push(b)}s&&o.sort((p,f)=>p.sortKey-f.sortKey);for(let p of o){let{geometry:f,index:y,sourceLayerIndex:m}=p,h=e[y].feature;this.addFeature(p,f,y,n,c),r.featureIndex.insert(h,f,y,m,this.index)}}update(e,r,n){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,r,this.stateDependentLayers,n)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,ap),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,r,n,i,o=1){let a;switch(o){case 1:a=[0,7];break;case 3:a=[0,2,5,7];break;case 5:a=[0,1,3,4,6,7];break;case 7:a=[0,1,2,3,4,5,6,7];break;default:throw new Error(`Invalid circle bucket granularity: ${o}; valid values are 1, 3, 5, 7.`)}let s=a.length;for(let u of r)for(let c of u){let p=c.x,f=c.y;if(p<0||p>=8192||f<0||f>=8192)continue;let y=this.segments.prepareSegment(s*s,this.layoutVertexArray,this.indexArray,e.sortKey),m=y.vertexLength;for(let h=0;h<s;h++)for(let d=0;d<s;d++)Eg(this.layoutVertexArray,p,f,a[d],a[h]);for(let h=0;h<s-1;h++)for(let d=0;d<s-1;d++){let x=m+h*s+d,b=m+(h+1)*s+d;this.indexArray.emplaceBack(x,b+1,x+1),this.indexArray.emplaceBack(x,b,b+1)}y.vertexLength+=s*s,y.primitiveLength+=(s-1)*(s-1)*2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,n,{},i)}};k("CircleBucket",lr,{omit:["layers"]});g();var ii=ee(de(),1);function dp(t,e){for(let r=0;r<t.length;r++)if(Br(e,t[r]))return!0;for(let r=0;r<e.length;r++)if(Br(t,e[r]))return!0;return!!ul(t,e)}l(dp,"polygonIntersectsPolygon");function gp(t,e,r){return!!(Br(t,e)||ll(e,t,r))}l(gp,"polygonIntersectsBufferedPoint");function ca(t,e){if(t.length===1)return hp(e,t[0]);for(let r=0;r<e.length;r++){let n=e[r];for(let i=0;i<n.length;i++)if(Br(t,n[i]))return!0}for(let r=0;r<t.length;r++)if(hp(e,t[r]))return!0;for(let r=0;r<e.length;r++)if(ul(t,e[r]))return!0;return!1}l(ca,"polygonIntersectsMultiPolygon");function bp(t,e,r){for(let n=0;n<e.length;n++){let i=e[n];if(t.length>=3){for(let o=0;o<i.length;o++)if(Br(t,i[o]))return!0}if(Mg(t,i,r))return!0}return!1}l(bp,"polygonIntersectsBufferedMultiLine");function Mg(t,e,r){if(t.length>1){if(ul(t,e))return!0;for(let n=0;n<e.length;n++)if(ll(e[n],t,r))return!0}for(let n=0;n<t.length;n++)if(ll(t[n],e,r))return!0;return!1}l(Mg,"lineIntersectsBufferedLine");function ul(t,e){if(t.length===0||e.length===0)return!1;for(let r=0;r<t.length-1;r++){let n=t[r],i=t[r+1];for(let o=0;o<e.length-1;o++){let a=e[o],s=e[o+1];if(Lg(n,i,a,s))return!0}}return!1}l(ul,"lineIntersectsLine");function Lg(t,e,r,n){return lt(t,r,n)!==lt(e,r,n)&<(t,e,r)!==lt(t,e,n)}l(Lg,"lineSegmentIntersectsLineSegment");function ll(t,e,r){let n=r*r;if(e.length===1)return t.distSqr(e[0])<n;for(let i=1;i<e.length;i++){let o=e[i-1],a=e[i];if(cl(t,o,a)<n)return!0}return!1}l(ll,"pointIntersectsBufferedLine");function cl(t,e,r){let n=e.distSqr(r);if(n===0)return t.distSqr(e);let i=((t.x-e.x)*(r.x-e.x)+(t.y-e.y)*(r.y-e.y))/n;return i<0?t.distSqr(e):i>1?t.distSqr(r):t.distSqr(r.sub(e)._mult(i)._add(e))}l(cl,"distToSegmentSquared");function hp(t,e){let r=!1,n,i,o;for(let a=0;a<t.length;a++){n=t[a];for(let s=0,u=n.length-1;s<n.length;u=s++)i=n[s],o=n[u],i.y>e.y!=o.y>e.y&&e.x<(o.x-i.x)*(e.y-i.y)/(o.y-i.y)+i.x&&(r=!r)}return r}l(hp,"multiPolygonContainsPoint");function Br(t,e){let r=!1;for(let n=0,i=t.length-1;n<t.length;i=n++){let o=t[n],a=t[i];o.y>e.y!=a.y>e.y&&e.x<(a.x-o.x)*(e.y-o.y)/(a.y-o.y)+o.x&&(r=!r)}return r}l(Br,"polygonContainsPoint");function xp(t,e,r,n,i){for(let a of t)if(e<=a.x&&r<=a.y&&n>=a.x&&i>=a.y)return!0;let o=[new ii.default(e,r),new ii.default(e,i),new ii.default(n,i),new ii.default(n,r)];if(t.length>2){for(let a of o)if(Br(t,a))return!0}for(let a=0;a<t.length-1;a++){let s=t[a],u=t[a+1];if(Dg(s,u,o))return!0}return!1}l(xp,"polygonIntersectsBox");function Dg(t,e,r){let n=r[0],i=r[2];if(t.x<n.x&&e.x<n.x||t.x>i.x&&e.x>i.x||t.y<n.y&&e.y<n.y||t.y>i.y&&e.y>i.y)return!1;let o=lt(t,e,r[0]);return o!==lt(t,e,r[1])||o!==lt(t,e,r[2])||o!==lt(t,e,r[3])}l(Dg,"edgeIntersectsBox");g();var pa=ee(de(),1);function ur(t,e,r){let n=e.paint.get(t).value;return n.kind==="constant"?n.value:r.programConfigurations.get(e.id).getMaxValue(t)}l(ur,"getMaximumPaintValue");function Rt(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}l(Rt,"translateDistance");function zt(t,e,r,n,i){if(!e[0]&&!e[1])return t;let o=pa.default.convert(e)._mult(i);r==="viewport"&&o._rotate(-n);let a=[];for(let s=0;s<t.length;s++){let u=t[s];a.push(u.sub(o))}return a}l(zt,"translate");function vp(t,e){let r=[];for(let n=0;n<t.length;n++){let i=t[n],o=[];for(let a=0;a<i.length;a++){let s=i[a-1],u=i[a],c=i[a+1],p=a===0?new pa.default(0,0):u.sub(s)._unit()._perp(),f=a===i.length-1?new pa.default(0,0):c.sub(u)._unit()._perp(),y=p._add(f)._unit(),m=y.x*f.x+y.y*f.y;m!==0&&y._mult(1/m),o.push(y._mult(e)._add(u))}r.push(o)}return r}l(vp,"offsetLine");g();var Pp,Bg=l(()=>Pp=Pp||new ne({"circle-sort-key":new V(A.layout_circle["circle-sort-key"])}),"getLayout"),Sp,Vg=l(()=>Sp=Sp||new ne({"circle-radius":new V(A.paint_circle["circle-radius"]),"circle-color":new V(A.paint_circle["circle-color"]),"circle-blur":new V(A.paint_circle["circle-blur"]),"circle-opacity":new V(A.paint_circle["circle-opacity"]),"circle-translate":new L(A.paint_circle["circle-translate"]),"circle-translate-anchor":new L(A.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new L(A.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new L(A.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new V(A.paint_circle["circle-stroke-width"]),"circle-stroke-color":new V(A.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new V(A.paint_circle["circle-stroke-opacity"])}),"getPaint"),wp={get paint(){return Vg()},get layout(){return Bg()}};var Ap=ee(de(),1);var fa=class extends le{static{l(this,"CircleStyleLayer")}constructor(e){super(e,wp)}createBucket(e){return new lr(e)}queryRadius(e){let r=e;return ur("circle-radius",this,r)+ur("circle-stroke-width",this,r)+Rt(this.paint.get("circle-translate"))}queryIntersectsFeature({queryGeometry:e,feature:r,featureState:n,geometry:i,transform:o,pixelsToTileUnits:a,unwrappedTileID:s,getElevation:u}){let c=zt(e,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),-o.bearingInRadians,a),p=this.paint.get("circle-radius").evaluate(r,n),f=this.paint.get("circle-stroke-width").evaluate(r,n),y=p+f,m=this.paint.get("circle-pitch-alignment")==="map",h=m?c:Rg(c,o,s,u),d=m?y*a:y;for(let x of i)for(let b of x){let P=m?b:_p(b,o,s,u),v=d,S=o.projectTileCoordinates(b.x,b.y,s,u).signedDistanceFromCamera;if(this.paint.get("circle-pitch-scale")==="viewport"&&this.paint.get("circle-pitch-alignment")==="map"?v*=S/o.cameraToCenterDistance:this.paint.get("circle-pitch-scale")==="map"&&this.paint.get("circle-pitch-alignment")==="viewport"&&(v*=o.cameraToCenterDistance/S),gp(h,P,v))return!0}return!1}};function _p(t,e,r,n){let i=e.projectTileCoordinates(t.x,t.y,r,n).point;return new Ap.default((i.x*.5+.5)*e.width,(-i.y*.5+.5)*e.height)}l(_p,"projectPoint");function Rg(t,e,r,n){return t.map(i=>_p(i,e,r,n))}l(Rg,"projectQueryGeometry");g();g();var oi=class extends lr{static{l(this,"HeatmapBucket")}};k("HeatmapBucket",oi,{omit:["layers"]});g();var Ip,zg=l(()=>Ip=Ip||new ne({"heatmap-radius":new V(A.paint_heatmap["heatmap-radius"]),"heatmap-weight":new V(A.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new L(A.paint_heatmap["heatmap-intensity"]),"heatmap-color":new ht(A.paint_heatmap["heatmap-color"]),"heatmap-opacity":new L(A.paint_heatmap["heatmap-opacity"])}),"getPaint"),Tp={get paint(){return zg()}};g();g();function pl(t,{width:e,height:r},n,i){if(!i)i=new Uint8Array(e*r*n);else if(i instanceof Uint8ClampedArray)i=new Uint8Array(i.buffer);else if(i.length!==e*r*n)throw new RangeError(`mismatched image size. expected: ${i.length} but got: ${e*r*n}`);return t.width=e,t.height=r,t.data=i,t}l(pl,"createImage");function Cp(t,{width:e,height:r},n){if(e===t.width&&r===t.height)return;let i=pl({},{width:e,height:r},n);fl(t,i,{x:0,y:0},{x:0,y:0},{width:Math.min(t.width,e),height:Math.min(t.height,r)},n),t.width=e,t.height=r,t.data=i.data}l(Cp,"resizeImage");function fl(t,e,r,n,i,o){if(i.width===0||i.height===0)return e;if(i.width>t.width||i.height>t.height||r.x>t.width-i.width||r.y>t.height-i.height)throw new RangeError("out of range source coordinates for image copy");if(i.width>e.width||i.height>e.height||n.x>e.width-i.width||n.y>e.height-i.height)throw new RangeError("out of range destination coordinates for image copy");let a=t.data,s=e.data;if(a===s)throw new Error("srcData equals dstData, so image is already copied");for(let u=0;u<i.height;u++){let c=((r.y+u)*t.width+r.x)*o,p=((n.y+u)*e.width+n.x)*o;for(let f=0;f<i.width*o;f++)s[p+f]=a[c+f]}return e}l(fl,"copyImage");var cr=class t{static{l(this,"AlphaImage")}constructor(e,r){pl(this,e,1,r)}resize(e){Cp(this,e,1)}clone(){return new t({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(e,r,n,i,o){fl(e,r,n,i,o,1)}},he=class t{static{l(this,"RGBAImage")}constructor(e,r){pl(this,e,4,r)}resize(e){Cp(this,e,4)}replace(e,r){r?this.data.set(e):e instanceof Uint8ClampedArray?this.data=new Uint8Array(e.buffer):this.data=e}clone(){return new t({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(e,r,n,i,o){fl(e,r,n,i,o,4)}setPixel(e,r,n){let i=(e*this.width+r)*4;this.data[i+0]=Math.round(n.r*255/n.a),this.data[i+1]=Math.round(n.g*255/n.a),this.data[i+2]=Math.round(n.b*255/n.a),this.data[i+3]=Math.round(n.a*255)}};k("AlphaImage",cr);k("RGBAImage",he);function kp(t){let e={},r=t.resolution||256,n=t.clips?t.clips.length:1,i=t.image||new he({width:r,height:n});if(!Iu(r))throw new Error(`width is not a power of 2 - ${r}`);let o=l((a,s,u)=>{e[t.evaluationKey]=u;let c=t.expression.evaluate(e);i.setPixel(a/4/r,s/4,c)},"renderPixel");if(t.clips)for(let a=0,s=0;a<n;++a,s+=r*4)for(let u=0,c=0;u<r;u++,c+=4){let p=u/(r-1),{start:f,end:y}=t.clips[a],m=f*(1-p)+y*p;o(s,c,m)}else for(let a=0,s=0;a<r;a++,s+=4){let u=a/(r-1);o(0,s,u)}return i}l(kp,"renderColorRamp");var Fp="big-fb";var ya=class extends le{static{l(this,"HeatmapStyleLayer")}createBucket(e){return new oi(e)}constructor(e){super(e,Tp),this.heatmapFbos=new Map,this._updateColorRamp()}_handleSpecialPaintPropertyUpdate(e){e==="heatmap-color"&&this._updateColorRamp()}_updateColorRamp(){let e=this._transitionablePaint._values["heatmap-color"].value.expression;this.colorRamp=kp({expression:e,evaluationKey:"heatmapDensity",image:this.colorRamp}),this.colorRampTexture=null}resize(){this.heatmapFbos.has(Fp)&&this.heatmapFbos.delete(Fp)}queryRadius(){return 0}queryIntersectsFeature(){return!1}hasOffscreenPass(){return this.paint.get("heatmap-opacity")!==0&&this.visibility!=="none"}};g();g();var Ep,Og=l(()=>Ep=Ep||new ne({"hillshade-illumination-direction":new L(A.paint_hillshade["hillshade-illumination-direction"]),"hillshade-illumination-altitude":new L(A.paint_hillshade["hillshade-illumination-altitude"]),"hillshade-illumination-anchor":new L(A.paint_hillshade["hillshade-illumination-anchor"]),"hillshade-exaggeration":new L(A.paint_hillshade["hillshade-exaggeration"]),"hillshade-shadow-color":new L(A.paint_hillshade["hillshade-shadow-color"]),"hillshade-highlight-color":new L(A.paint_hillshade["hillshade-highlight-color"]),"hillshade-accent-color":new L(A.paint_hillshade["hillshade-accent-color"]),"hillshade-method":new L(A.paint_hillshade["hillshade-method"])}),"getPaint"),Mp={get paint(){return Og()}};var ma=class extends le{static{l(this,"HillshadeStyleLayer")}constructor(e){super(e,Mp),this.recalculate({zoom:0,zoomHistory:{}},void 0)}getIlluminationProperties(){let e=this.paint.get("hillshade-illumination-direction").values,r=this.paint.get("hillshade-illumination-altitude").values,n=this.paint.get("hillshade-highlight-color").values,i=this.paint.get("hillshade-shadow-color").values,o=Math.max(e.length,r.length,n.length,i.length);e=e.concat(Array(o-e.length).fill(e.at(-1))),r=r.concat(Array(o-r.length).fill(r.at(-1))),n=n.concat(Array(o-n.length).fill(n.at(-1))),i=i.concat(Array(o-i.length).fill(i.at(-1)));let a=r.map(fs);return{directionRadians:e.map(fs),altitudeRadians:a,shadowColor:i,highlightColor:n}}hasOffscreenPass(){return this.paint.get("hillshade-exaggeration")!==0&&this.visibility!=="none"}};g();g();var Lp,Gg=l(()=>Lp=Lp||new ne({"color-relief-opacity":new L(A["paint_color-relief"]["color-relief-opacity"]),"color-relief-color":new ht(A["paint_color-relief"]["color-relief-color"])}),"getPaint"),Dp={get paint(){return Gg()}};g();var ai=class{static{l(this,"Texture")}constructor(e,r,n,i){this.context=e,this.format=n,this.texture=e.gl.createTexture(),this.update(r,i)}update(e,r,n){let{width:i,height:o}=e,a=(!this.size||this.size[0]!==i||this.size[1]!==o)&&!n,{context:s}=this,{gl:u}=s;if(this.useMipmap=!!(r&&r.useMipmap),u.bindTexture(u.TEXTURE_2D,this.texture),s.pixelStoreUnpackFlipY.set(!1),s.pixelStoreUnpack.set(1),s.pixelStoreUnpackPremultiplyAlpha.set(this.format===u.RGBA&&(!r||r.premultiply!==!1)),a)this.size=[i,o],e instanceof HTMLImageElement||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement||e instanceof ImageData||wt(e)?u.texImage2D(u.TEXTURE_2D,0,this.format,this.format,u.UNSIGNED_BYTE,e):u.texImage2D(u.TEXTURE_2D,0,this.format,i,o,0,this.format,u.UNSIGNED_BYTE,e.data);else{let{x:c,y:p}=n||{x:0,y:0};e instanceof HTMLImageElement||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement||e instanceof ImageData||wt(e)?u.texSubImage2D(u.TEXTURE_2D,0,c,p,u.RGBA,u.UNSIGNED_BYTE,e):u.texSubImage2D(u.TEXTURE_2D,0,c,p,i,o,u.RGBA,u.UNSIGNED_BYTE,e.data)}this.useMipmap&&this.isSizePowerOfTwo()&&u.generateMipmap(u.TEXTURE_2D),s.pixelStoreUnpackFlipY.setDefault(),s.pixelStoreUnpack.setDefault(),s.pixelStoreUnpackPremultiplyAlpha.setDefault()}bind(e,r,n){let{context:i}=this,{gl:o}=i;o.bindTexture(o.TEXTURE_2D,this.texture),n===o.LINEAR_MIPMAP_NEAREST&&!this.isSizePowerOfTwo()&&(n=o.LINEAR),e!==this.filter&&(o.texParameteri(o.TEXTURE_2D,o.TEXTURE_MAG_FILTER,e),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_MIN_FILTER,n||e),this.filter=e),r!==this.wrap&&(o.texParameteri(o.TEXTURE_2D,o.TEXTURE_WRAP_S,r),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_WRAP_T,r),this.wrap=r)}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}};g();var si=class{static{l(this,"DEMData")}constructor(e,r,n,i=1,o=1,a=1,s=0){if(this.uid=e,r.height!==r.width)throw new RangeError("DEM tiles must be square");if(n&&!["mapbox","terrarium","custom"].includes(n)){ye(`"${n}" is not a valid encoding type. Valid types include "mapbox", "terrarium" and "custom".`);return}this.stride=r.height;let u=this.dim=r.height-2;switch(this.data=new Uint32Array(r.data.buffer),n){case"terrarium":this.redFactor=256,this.greenFactor=1,this.blueFactor=1/256,this.baseShift=32768;break;case"custom":this.redFactor=i,this.greenFactor=o,this.blueFactor=a,this.baseShift=s;break;case"mapbox":default:this.redFactor=6553.6,this.greenFactor=25.6,this.blueFactor=.1,this.baseShift=1e4;break}for(let c=0;c<u;c++)this.data[this._idx(-1,c)]=this.data[this._idx(0,c)],this.data[this._idx(u,c)]=this.data[this._idx(u-1,c)],this.data[this._idx(c,-1)]=this.data[this._idx(c,0)],this.data[this._idx(c,u)]=this.data[this._idx(c,u-1)];this.data[this._idx(-1,-1)]=this.data[this._idx(0,0)],this.data[this._idx(u,-1)]=this.data[this._idx(u-1,0)],this.data[this._idx(-1,u)]=this.data[this._idx(0,u-1)],this.data[this._idx(u,u)]=this.data[this._idx(u-1,u-1)],this.min=Number.MAX_SAFE_INTEGER,this.max=Number.MIN_SAFE_INTEGER;for(let c=0;c<u;c++)for(let p=0;p<u;p++){let f=this.get(c,p);f>this.max&&(this.max=f),f<this.min&&(this.min=f)}}get(e,r){let n=new Uint8Array(this.data.buffer),i=this._idx(e,r)*4;return this.unpack(n[i],n[i+1],n[i+2])}getUnpackVector(){return[this.redFactor,this.greenFactor,this.blueFactor,this.baseShift]}_idx(e,r){if(e<-1||e>=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+(e+1)}unpack(e,r,n){return e*this.redFactor+r*this.greenFactor+n*this.blueFactor-this.baseShift}pack(e){return yl(e,this.getUnpackVector())}getPixels(){return new he({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))}backfillBorder(e,r,n){if(this.dim!==e.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 u=-r*this.dim,c=-n*this.dim;for(let p=a;p<s;p++)for(let f=i;f<o;f++)this.data[this._idx(f,p)]=e.data[this._idx(f+u,p+c)]}};function yl(t,e){let r=e[0],n=e[1],i=e[2],o=e[3],a=Math.min(r,n,i),s=Math.round((t+o)/a);return{r:Math.floor(s*a/r)%256,g:Math.floor(s*a/n)%256,b:Math.floor(s*a/i)%256}}l(yl,"packDEMData");k("DEMData",si);var ha=class extends le{static{l(this,"ColorReliefStyleLayer")}constructor(e){super(e,Dp)}_createColorRamp(e){let r={elevationStops:[],colorStops:[]},n=this._transitionablePaint._values["color-relief-color"].value.expression;if(n instanceof Qe&&n._styleExpression.expression instanceof Me){this.colorRampExpression=n;let a=n._styleExpression.expression;r.elevationStops=a.labels,r.colorStops=[];for(let s of r.elevationStops)r.colorStops.push(a.evaluate({globals:{elevation:s}}))}if(r.elevationStops.length<1&&(r.elevationStops=[0],r.colorStops=[Y.transparent]),r.elevationStops.length<2&&(r.elevationStops.push(r.elevationStops[0]+1),r.colorStops.push(r.colorStops[0])),r.elevationStops.length<=e)return r;let i={elevationStops:[],colorStops:[]},o=(r.elevationStops.length-1)/(e-1);for(let a=0;a<r.elevationStops.length-.5;a+=o)i.elevationStops.push(r.elevationStops[Math.round(a)]),i.colorStops.push(r.colorStops[Math.round(a)]);return ye(`Too many colors in specification of ${this.id} color-relief layer, may not render properly.`),i}_colorRampChanged(){return this.colorRampExpression!=this._transitionablePaint._values["color-relief-color"].value.expression}getColorRampTextures(e,r,n){if(this.colorRampTextures&&!this._colorRampChanged())return this.colorRampTextures;let i=this._createColorRamp(r),o=new he({width:i.colorStops.length,height:1}),a=new he({width:i.colorStops.length,height:1});for(let s=0;s<i.elevationStops.length;s++){let u=yl(i.elevationStops[s],n);a.setPixel(0,s,new Y(u.r/255,u.g/255,u.b/255,1)),o.setPixel(0,s,i.colorStops[s])}return this.colorRampTextures={elevationTexture:new ai(e,a,e.gl.RGBA),colorTexture:new ai(e,o,e.gl.RGBA)},this.colorRampTextures}hasOffscreenPass(){return this.visibility!=="none"&&!!this.colorRampTextures}};g();g();g();var Ng=re([{name:"a_pos",components:2,type:"Int16"}],4);var{members:Bp,size:Yw,alignment:Kw}=Ng;g();function Vr(t,e,r){let n=r.patternDependencies,i=!1;for(let o of e){let a=o.paint.get(`${t}-pattern`);a.isConstant()||(i=!0);let s=a.constantOr(null);s&&(i=!0,n[s.to]=!0,n[s.from]=!0)}return i}l(Vr,"hasPattern");function Rr(t,e,r,n,i){let o=i.patternDependencies;for(let a of e){let u=a.paint.get(`${t}-pattern`).value;if(u.kind!=="constant"){let c=u.evaluate({zoom:n-1},r,{},i.availableImages),p=u.evaluate({zoom:n},r,{},i.availableImages),f=u.evaluate({zoom:n+1},r,{},i.availableImages);c=c&&c.name?c.name:c,p=p&&p.name?p.name:p,f=f&&f.name?f.name:f,o[c]=!0,o[p]=!0,o[f]=!0,r.patterns[a.id]={min:c,mid:p,max:f}}}return r}l(Rr,"addPatternDependencies");g();var yi=ee(de(),1);g();function dl(t,e,r=2){let n=e&&e.length,i=n?e[0]*r:t.length,o=Rp(t,0,i,r,!0),a=[];if(!o||o.next===o.prev)return a;let s,u,c;if(n&&(o=Wg(t,e,o,r)),t.length>80*r){s=1/0,u=1/0;let p=-1/0,f=-1/0;for(let y=r;y<i;y+=r){let m=t[y],h=t[y+1];m<s&&(s=m),h<u&&(u=h),m>p&&(p=m),h>f&&(f=h)}c=Math.max(p-s,f-u),c=c!==0?32767/c:0}return ui(o,a,r,s,u,c,0),a}l(dl,"earcut");function Rp(t,e,r,n,i){let o;if(i===nb(t,e,r,n)>0)for(let a=e;a<r;a+=n)o=Vp(a/n|0,t[a],t[a+1],o);else for(let a=r-n;a>=e;a-=n)o=Vp(a/n|0,t[a],t[a+1],o);return o&&zr(o,o.next)&&(pi(o),o=o.next),o}l(Rp,"linkedList");function pr(t,e){if(!t)return t;e||(e=t);let r=t,n;do if(n=!1,!r.steiner&&(zr(r,r.next)||ce(r.prev,r,r.next)===0)){if(pi(r),r=e=r.prev,r===r.next)break;n=!0}else r=r.next;while(n||r!==e);return e}l(pr,"filterPoints");function ui(t,e,r,n,i,o,a){if(!t)return;!a&&o&&Yg(t,n,i,o);let s=t;for(;t.prev!==t.next;){let u=t.prev,c=t.next;if(o?$g(t,n,i,o):Ug(t)){e.push(u.i,t.i,c.i),pi(t),t=c.next,s=c.next;continue}if(t=c,t===s){a?a===1?(t=jg(pr(t),e),ui(t,e,r,n,i,o,2)):a===2&&qg(t,e,r,n,i,o):ui(pr(t),e,r,n,i,o,1);break}}}l(ui,"earcutLinked");function Ug(t){let e=t.prev,r=t,n=t.next;if(ce(e,r,n)>=0)return!1;let i=e.x,o=r.x,a=n.x,s=e.y,u=r.y,c=n.y,p=Math.min(i,o,a),f=Math.min(s,u,c),y=Math.max(i,o,a),m=Math.max(s,u,c),h=n.next;for(;h!==e;){if(h.x>=p&&h.x<=y&&h.y>=f&&h.y<=m&&li(i,s,o,u,a,c,h.x,h.y)&&ce(h.prev,h,h.next)>=0)return!1;h=h.next}return!0}l(Ug,"isEar");function $g(t,e,r,n){let i=t.prev,o=t,a=t.next;if(ce(i,o,a)>=0)return!1;let s=i.x,u=o.x,c=a.x,p=i.y,f=o.y,y=a.y,m=Math.min(s,u,c),h=Math.min(p,f,y),d=Math.max(s,u,c),x=Math.max(p,f,y),b=ml(m,h,e,r,n),P=ml(d,x,e,r,n),v=t.prevZ,S=t.nextZ;for(;v&&v.z>=b&&S&&S.z<=P;){if(v.x>=m&&v.x<=d&&v.y>=h&&v.y<=x&&v!==i&&v!==a&&li(s,p,u,f,c,y,v.x,v.y)&&ce(v.prev,v,v.next)>=0||(v=v.prevZ,S.x>=m&&S.x<=d&&S.y>=h&&S.y<=x&&S!==i&&S!==a&&li(s,p,u,f,c,y,S.x,S.y)&&ce(S.prev,S,S.next)>=0))return!1;S=S.nextZ}for(;v&&v.z>=b;){if(v.x>=m&&v.x<=d&&v.y>=h&&v.y<=x&&v!==i&&v!==a&&li(s,p,u,f,c,y,v.x,v.y)&&ce(v.prev,v,v.next)>=0)return!1;v=v.prevZ}for(;S&&S.z<=P;){if(S.x>=m&&S.x<=d&&S.y>=h&&S.y<=x&&S!==i&&S!==a&&li(s,p,u,f,c,y,S.x,S.y)&&ce(S.prev,S,S.next)>=0)return!1;S=S.nextZ}return!0}l($g,"isEarHashed");function jg(t,e){let r=t;do{let n=r.prev,i=r.next.next;!zr(n,i)&&Op(n,r,r.next,i)&&ci(n,i)&&ci(i,n)&&(e.push(n.i,r.i,i.i),pi(r),pi(r.next),r=t=i),r=r.next}while(r!==t);return pr(r)}l(jg,"cureLocalIntersections");function qg(t,e,r,n,i,o){let a=t;do{let s=a.next.next;for(;s!==a.prev;){if(a.i!==s.i&&eb(a,s)){let u=Gp(a,s);a=pr(a,a.next),u=pr(u,u.next),ui(a,e,r,n,i,o,0),ui(u,e,r,n,i,o,0);return}s=s.next}a=a.next}while(a!==t)}l(qg,"splitEarcut");function Wg(t,e,r,n){let i=[];for(let o=0,a=e.length;o<a;o++){let s=e[o]*n,u=o<a-1?e[o+1]*n:t.length,c=Rp(t,s,u,n,!1);c===c.next&&(c.steiner=!0),i.push(Qg(c))}i.sort(Xg);for(let o=0;o<i.length;o++)r=Hg(i[o],r);return r}l(Wg,"eliminateHoles");function Xg(t,e){let r=t.x-e.x;if(r===0&&(r=t.y-e.y,r===0)){let n=(t.next.y-t.y)/(t.next.x-t.x),i=(e.next.y-e.y)/(e.next.x-e.x);r=n-i}return r}l(Xg,"compareXYSlope");function Hg(t,e){let r=Zg(t,e);if(!r)return e;let n=Gp(r,t);return pr(n,n.next),pr(r,r.next)}l(Hg,"eliminateHole");function Zg(t,e){let r=e,n=t.x,i=t.y,o=-1/0,a;if(zr(t,r))return r;do{if(zr(t,r.next))return r.next;if(i<=r.y&&i>=r.next.y&&r.next.y!==r.y){let f=r.x+(i-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(f<=n&&f>o&&(o=f,a=r.x<r.next.x?r:r.next,f===n))return a}r=r.next}while(r!==e);if(!a)return null;let s=a,u=a.x,c=a.y,p=1/0;r=a;do{if(n>=r.x&&r.x>=u&&n!==r.x&&zp(i<c?n:o,i,u,c,i<c?o:n,i,r.x,r.y)){let f=Math.abs(i-r.y)/(n-r.x);ci(r,t)&&(f<p||f===p&&(r.x>a.x||r.x===a.x&&Jg(a,r)))&&(a=r,p=f)}r=r.next}while(r!==s);return a}l(Zg,"findHoleBridge");function Jg(t,e){return ce(t.prev,t,e.prev)<0&&ce(e.next,t,t.next)<0}l(Jg,"sectorContainsSector");function Yg(t,e,r,n){let i=t;do i.z===0&&(i.z=ml(i.x,i.y,e,r,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next;while(i!==t);i.prevZ.nextZ=null,i.prevZ=null,Kg(i)}l(Yg,"indexCurve");function Kg(t){let e,r=1;do{let n=t,i;t=null;let o=null;for(e=0;n;){e++;let a=n,s=0;for(let c=0;c<r&&(s++,a=a.nextZ,!!a);c++);let u=r;for(;s>0||u>0&&a;)s!==0&&(u===0||!a||n.z<=a.z)?(i=n,n=n.nextZ,s--):(i=a,a=a.nextZ,u--),o?o.nextZ=i:t=i,i.prevZ=o,o=i;n=a}o.nextZ=null,r*=2}while(e>1);return t}l(Kg,"sortLinked");function ml(t,e,r,n,i){return t=(t-r)*i|0,e=(e-n)*i|0,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,t|e<<1}l(ml,"zOrder");function Qg(t){let e=t,r=t;do(e.x<r.x||e.x===r.x&&e.y<r.y)&&(r=e),e=e.next;while(e!==t);return r}l(Qg,"getLeftmost");function zp(t,e,r,n,i,o,a,s){return(i-a)*(e-s)>=(t-a)*(o-s)&&(t-a)*(n-s)>=(r-a)*(e-s)&&(r-a)*(o-s)>=(i-a)*(n-s)}l(zp,"pointInTriangle");function li(t,e,r,n,i,o,a,s){return!(t===a&&e===s)&&zp(t,e,r,n,i,o,a,s)}l(li,"pointInTriangleExceptFirst");function eb(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!tb(t,e)&&(ci(t,e)&&ci(e,t)&&rb(t,e)&&(ce(t.prev,t,e.prev)||ce(t,e.prev,e))||zr(t,e)&&ce(t.prev,t,t.next)>0&&ce(e.prev,e,e.next)>0)}l(eb,"isValidDiagonal");function ce(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}l(ce,"area");function zr(t,e){return t.x===e.x&&t.y===e.y}l(zr,"equals");function Op(t,e,r,n){let i=ga(ce(t,e,r)),o=ga(ce(t,e,n)),a=ga(ce(r,n,t)),s=ga(ce(r,n,e));return!!(i!==o&&a!==s||i===0&&da(t,r,e)||o===0&&da(t,n,e)||a===0&&da(r,t,n)||s===0&&da(r,e,n))}l(Op,"intersects");function da(t,e,r){return e.x<=Math.max(t.x,r.x)&&e.x>=Math.min(t.x,r.x)&&e.y<=Math.max(t.y,r.y)&&e.y>=Math.min(t.y,r.y)}l(da,"onSegment");function ga(t){return t>0?1:t<0?-1:0}l(ga,"sign");function tb(t,e){let r=t;do{if(r.i!==t.i&&r.next.i!==t.i&&r.i!==e.i&&r.next.i!==e.i&&Op(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}l(tb,"intersectsPolygon");function ci(t,e){return ce(t.prev,t,t.next)<0?ce(t,e,t.next)>=0&&ce(t,t.prev,e)>=0:ce(t,e,t.prev)<0||ce(t,t.next,e)<0}l(ci,"locallyInside");function rb(t,e){let r=t,n=!1,i=(t.x+e.x)/2,o=(t.y+e.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!==t);return n}l(rb,"middleInside");function Gp(t,e){let r=hl(t.i,t.x,t.y),n=hl(e.i,e.x,e.y),i=t.next,o=e.prev;return t.next=e,e.prev=t,r.next=i,i.prev=r,n.next=r,r.prev=n,o.next=n,n.prev=o,n}l(Gp,"splitPolygon");function Vp(t,e,r,n){let i=hl(t,e,r);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}l(Vp,"insertNode");function pi(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}l(pi,"removeNode");function hl(t,e,r){return{i:t,x:e,y:r,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}l(hl,"createNode");function nb(t,e,r,n){let i=0;for(let o=e,a=r-n;o<r;o+=n)i+=(t[a]-t[o])*(t[o+1]+t[a+1]),a=o;return i}l(nb,"signedArea");g();var Ot=class{static{l(this,"SubdivisionGranularityExpression")}constructor(e,r){if(r>e)throw new Error("Min granularity must not be greater than base granularity.");this._baseZoomGranularity=e,this._minGranularity=r}getGranularityForZoomLevel(e){let r=1<<e;return Math.max(Math.floor(this._baseZoomGranularity/r),this._minGranularity,1)}},ba=class t{static{l(this,"SubdivisionGranularitySetting")}constructor(e){this.fill=e.fill,this.line=e.line,this.tile=e.tile,this.stencil=e.stencil,this.circle=e.circle}static{this.noSubdivision=new t({fill:new Ot(0,0),line:new Ot(0,0),tile:new Ot(0,0),stencil:new Ot(0,0),circle:1})}};k("SubdivisionGranularityExpression",Ot);k("SubdivisionGranularitySetting",ba);var Or=-32768,fi=32767,gl=class{constructor(e,r){this._vertexBuffer=[];this._vertexDictionary=new Map;this._used=!1;this._granularity=e,this._granularityCellSize=8192/e,this._canonical=r}static{l(this,"Subdivider")}_getKey(e,r){return e=e+32768,r=r+32768,e<<16|r<<0}_vertexToIndex(e,r){if(e<-32768||r<-32768||e>32767||r>32767)throw new Error("Vertex coordinates are out of signed 16 bit integer range.");let n=Math.round(e)|0,i=Math.round(r)|0,o=this._getKey(n,i);if(this._vertexDictionary.has(o))return this._vertexDictionary.get(o);let a=this._vertexBuffer.length/2;return this._vertexDictionary.set(o,a),this._vertexBuffer.push(n,i),a}_subdivideTrianglesScanline(e){if(this._granularity<2)return ob(this._vertexBuffer,e);let r=[],n=e.length;for(let i=0;i<n;i+=3){let o=[e[i+0],e[i+1],e[i+2]],a=[this._vertexBuffer[e[i+0]*2+0],this._vertexBuffer[e[i+0]*2+1],this._vertexBuffer[e[i+1]*2+0],this._vertexBuffer[e[i+1]*2+1],this._vertexBuffer[e[i+2]*2+0],this._vertexBuffer[e[i+2]*2+1]],s=1/0,u=1/0,c=-1/0,p=-1/0;for(let d=0;d<3;d++){let x=a[d*2],b=a[d*2+1];s=Math.min(s,x),c=Math.max(c,x),u=Math.min(u,b),p=Math.max(p,b)}if(s===c||u===p)continue;let f=Math.floor(s/this._granularityCellSize),y=Math.ceil(c/this._granularityCellSize),m=Math.floor(u/this._granularityCellSize),h=Math.ceil(p/this._granularityCellSize);if(f===y&&m===h){r.push(...o);continue}for(let d=m;d<h;d++){let x=this._scanlineGenerateVertexRingForCellRow(d,a,o);ab(this._vertexBuffer,x,r)}}return r}_scanlineGenerateVertexRingForCellRow(e,r,n){let i=e*this._granularityCellSize,o=i+this._granularityCellSize,a=[];for(let s=0;s<3;s++){let u=r[s*2],c=r[s*2+1],p=r[(s+1)*2%6],f=r[((s+1)*2+1)%6],y=r[(s+2)*2%6],m=r[((s+2)*2+1)%6],h=p-u,d=f-c,x=h===0,b=d===0,P=(i-c)/d,v=(o-c)/d,S=Math.min(P,v),_=Math.max(P,v);if(!b&&(S>=1||_<=0)||b&&(c<i||c>o)){f>=i&&f<=o&&a.push(n[(s+1)%3]);continue}if(!b&&S>0){let F=u+h*S,D=c+d*S;a.push(this._vertexToIndex(F,D))}let T=u+h*Math.max(S,0),I=u+h*Math.min(_,1);if(x||this._generateIntraEdgeVertices(a,u,c,p,f,T,I),!b&&_<1){let F=u+h*_,D=c+d*_;a.push(this._vertexToIndex(F,D))}(b||f>=i&&f<=o)&&a.push(n[(s+1)%3]),!b&&(f<=i||f>=o)&&this._generateInterEdgeVertices(a,u,c,p,f,y,m,I,i,o)}return a}_generateIntraEdgeVertices(e,r,n,i,o,a,s){let u=i-r,c=o-n,p=c===0,f=p?Math.min(r,i):Math.min(a,s),y=p?Math.max(r,i):Math.max(a,s),m=Math.floor(f/this._granularityCellSize)+1,h=Math.ceil(y/this._granularityCellSize)-1;if(p?r<i:a<s)for(let x=m;x<=h;x++){let b=x*this._granularityCellSize,P=n+c*(b-r)/u;e.push(this._vertexToIndex(b,P))}else for(let x=h;x>=m;x--){let b=x*this._granularityCellSize,P=n+c*(b-r)/u;e.push(this._vertexToIndex(b,P))}}_generateInterEdgeVertices(e,r,n,i,o,a,s,u,c,p){let f=o-n,y=a-i,m=s-o,h=(c-o)/m,d=(p-o)/m,x=Math.min(h,d),b=Math.max(h,d),P=i+y*x,v=Math.floor(Math.min(P,u)/this._granularityCellSize)+1,S=Math.ceil(Math.max(P,u)/this._granularityCellSize)-1,_=u<P,T=m===0;if(T&&(s===c||s===p))return;if(T||x>=1||b<=0){let F=r-a,D=n-s,R=(c-s)/D,z=(p-s)/D,N=Math.min(R,z),B=a+F*N;v=Math.floor(Math.min(B,u)/this._granularityCellSize)+1,S=Math.ceil(Math.max(B,u)/this._granularityCellSize)-1,_=u<B}let I=f>0?p:c;if(_)for(let F=v;F<=S;F++){let D=F*this._granularityCellSize;e.push(this._vertexToIndex(D,I))}else for(let F=S;F>=v;F--){let D=F*this._granularityCellSize;e.push(this._vertexToIndex(D,I))}}_generateOutline(e){let r=[];for(let n of e){let i=tt(n,this._granularity,!0),o=this._pointArrayToIndices(i),a=[];for(let s=1;s<o.length;s++)a.push(o[s-1]),a.push(o[s]);r.push(a)}return r}_handlePoles(e){let r=!1,n=!1;this._canonical&&(this._canonical.y===0&&(r=!0),this._canonical.y===(1<<this._canonical.z)-1&&(n=!0)),(r||n)&&this._fillPoles(e,r,n)}_ensureNoPoleVertices(){let e=this._vertexBuffer;for(let r=0;r<e.length;r+=2){let n=e[r+1];n===Or&&(e[r+1]=Or+1),n===fi&&(e[r+1]=fi-1)}}_generatePoleQuad(e,r,n,i,o,a){i>o!=(a===Or)?(e.push(r),e.push(n),e.push(this._vertexToIndex(i,a)),e.push(n),e.push(this._vertexToIndex(o,a)),e.push(this._vertexToIndex(i,a))):(e.push(n),e.push(r),e.push(this._vertexToIndex(i,a)),e.push(this._vertexToIndex(o,a)),e.push(n),e.push(this._vertexToIndex(i,a)))}_fillPoles(e,r,n){let i=this._vertexBuffer,o=0,a=8192,s=e.length;for(let u=2;u<s;u+=3){let c=e[u-2],p=e[u-1],f=e[u],y=i[c*2],m=i[c*2+1],h=i[p*2],d=i[p*2+1],x=i[f*2],b=i[f*2+1];r&&(m===o&&d===o&&this._generatePoleQuad(e,c,p,y,h,Or),d===o&&b===o&&this._generatePoleQuad(e,p,f,h,x,Or),b===o&&m===o&&this._generatePoleQuad(e,f,c,x,y,Or)),n&&(m===a&&d===a&&this._generatePoleQuad(e,c,p,y,h,fi),d===a&&b===a&&this._generatePoleQuad(e,p,f,h,x,fi),b===a&&m===a&&this._generatePoleQuad(e,f,c,x,y,fi))}}_initializeVertices(e){for(let r=0;r<e.length;r+=2)this._vertexToIndex(e[r],e[r+1])}subdividePolygonInternal(e,r){if(this._used)throw new Error("Subdivision: multiple use not allowed.");this._used=!0;let{flattened:n,holeIndices:i}=ib(e);this._initializeVertices(n);let o;try{let s=dl(n,i),u=this._convertIndices(n,s);o=this._subdivideTrianglesScanline(u)}catch(s){console.error(s)}let a=[];return r&&(a=this._generateOutline(e)),this._ensureNoPoleVertices(),this._handlePoles(o),{verticesFlattened:this._vertexBuffer,indicesTriangles:o,indicesLineList:a}}_convertIndices(e,r){let n=[];for(let i=0;i<r.length;i++){let o=e[r[i]*2],a=e[r[i]*2+1];n.push(this._vertexToIndex(o,a))}return n}_pointArrayToIndices(e){let r=[];for(let n=0;n<e.length;n++){let i=e[n];r.push(this._vertexToIndex(i.x,i.y))}return r}};function xa(t,e,r,n=!0){return new gl(r,e).subdividePolygonInternal(t,n)}l(xa,"subdividePolygon");function tt(t,e,r=!1){if(!t||t.length<1)return[];if(t.length<2)return[];let n=t[0],i=t[t.length-1],o=r&&(n.x!==i.x||n.y!==i.y);if(e<2)return o?[...t,t[0]]:[...t];let a=Math.floor(8192/e),s=[];s.push(new yi.default(t[0].x,t[0].y));let u=t.length,c=o?u:u-1;for(let p=0;p<c;p++){let f=t[p],y=p<u-1?t[p+1]:t[0],m=f.x,h=f.y,d=y.x,x=y.y,b=m!==d,P=h!==x;if(!b&&!P)continue;let v=d-m,S=x-h,_=Math.abs(v),T=Math.abs(S),I=m,F=h;for(;;){let R=v>0?(Math.floor(I/a)+1)*a:(Math.ceil(I/a)-1)*a,z=S>0?(Math.floor(F/a)+1)*a:(Math.ceil(F/a)-1)*a,N=Math.abs(I-R),B=Math.abs(F-z),C=Math.abs(I-d),O=Math.abs(F-x),$=b?N/_:Number.POSITIVE_INFINITY,U=P?B/T:Number.POSITIVE_INFINITY;if((C<=N||!b)&&(O<=B||!P))break;if($<U&&b||!P){I=R,F=F+S*$;let G=new yi.default(I,Math.round(F));(s[s.length-1].x!==G.x||s[s.length-1].y!==G.y)&&s.push(G)}else{I=I+v*U,F=z;let G=new yi.default(Math.round(I),F);(s[s.length-1].x!==G.x||s[s.length-1].y!==G.y)&&s.push(G)}}let D=new yi.default(d,x);(s[s.length-1].x!==D.x||s[s.length-1].y!==D.y)&&s.push(D)}return s}l(tt,"subdivideVertexLine");function ib(t){let e=[],r=[];for(let n of t)if(n.length!==0){n!==t[0]&&e.push(r.length/2);for(let i=0;i<n.length;i++)r.push(n[i].x),r.push(n[i].y)}return{flattened:r,holeIndices:e}}l(ib,"flatten");function ob(t,e){let r=[];for(let n=0;n<e.length;n+=3){let i=e[n],o=e[n+1],a=e[n+2],s=t[i*2],u=t[i*2+1],c=t[o*2],p=t[o*2+1],f=t[a*2],y=t[a*2+1],m=c-s,h=p-u,d=f-s,x=y-u;m*x-h*d>0?(r.push(i),r.push(a),r.push(o)):(r.push(i),r.push(o),r.push(a))}return r}l(ob,"fixWindingOrder");function ab(t,e,r){if(e.length===0)throw new Error("Subdivision vertex ring is empty.");let n=0,i=t[e[0]*2];for(let u=1;u<e.length;u++){let c=t[e[u]*2];c<i&&(i=c,n=u)}let o=e.length,a=n,s=(a+1)%o;for(;;){let u=a-1>=0?a-1:o-1,c=(s+1)%o,p=t[e[u]*2],f=t[e[u]*2+1],y=t[e[c]*2],m=t[e[c]*2+1],h=t[e[a]*2],d=t[e[a]*2+1],x=t[e[s]*2],b=t[e[s]*2+1],P=!1;if(p<y)P=!0;else if(p>y)P=!1;else{let v=x-h,_=b-d,T=-v,I=d<b?1:-1,F=((p-h)*_+(f-d)*T)*I,D=((y-h)*_+(m-d)*T)*I;F>D&&(P=!0)}if(P){let v=e[u],S=e[a],_=e[s];v!==S&&v!==_&&S!==_&&r.push(_,S,v),a--,a<0&&(a=o-1)}else{let v=e[c],S=e[a],_=e[s];v!==S&&v!==_&&S!==_&&r.push(_,S,v),s++,s>=o&&(s=0)}if(u===c)break}}l(ab,"scanlineTriangulateVertexRing");g();function va(t,e,r,n,i,o,a,s,u){let c=i.length/2,p=a&&s&&u;if(c<me.MAX_VERTEX_ARRAY_LENGTH){let f=e.prepareSegment(c,r,n),y=f.vertexLength;for(let d=0;d<o.length;d+=3)n.emplaceBack(y+o[d],y+o[d+1],y+o[d+2]);f.vertexLength+=c,f.primitiveLength+=o.length/3;let m,h;p&&(h=a.prepareSegment(c,r,s),m=h.vertexLength,h.vertexLength+=c);for(let d=0;d<i.length;d+=2)t(i[d],i[d+1]);if(p)for(let d=0;d<u.length;d++){let x=u[d];for(let b=1;b<x.length;b+=2)s.emplaceBack(m+x[b-1],m+x[b]);h.primitiveLength+=x.length/2}}else sb(e,r,n,i,o,t),p&&lb(a,r,s,i,u,t),e.forceNewSegmentOnNextPrepare(),a?.forceNewSegmentOnNextPrepare()}l(va,"fillLargeMeshArrays");function mi(t,e,r,n,i,o,a){if(o){let s=n.count;return r(e[i*2],e[i*2+1]),t[i]=n.count,n.count++,a.vertexLength++,s}else return t[i]}l(mi,"copyOrReuseVertex");function sb(t,e,r,n,i,o){let a=[];for(let f=0;f<n.length/2;f++)a.push(-1);let s={count:0},u=0,c=t.getOrCreateLatestSegment(e,r),p=c.vertexLength;for(let f=2;f<i.length;f+=3){let y=i[f-2],m=i[f-1],h=i[f],d=a[y]<u,x=a[m]<u,b=a[h]<u,P=(d?1:0)+(x?1:0)+(b?1:0);c.vertexLength+P>me.MAX_VERTEX_ARRAY_LENGTH&&(c=t.createNewSegment(e,r),u=s.count,d=!0,x=!0,b=!0,p=0);let v=mi(a,n,o,s,y,d,c),S=mi(a,n,o,s,m,x,c),_=mi(a,n,o,s,h,b,c);r.emplaceBack(p+v-u,p+S-u,p+_-u),c.primitiveLength++}}l(sb,"fillSegmentsTriangles");function lb(t,e,r,n,i,o){let a=[];for(let f=0;f<n.length/2;f++)a.push(-1);let s={count:0},u=0,c=t.getOrCreateLatestSegment(e,r),p=c.vertexLength;for(let f=0;f<i.length;f++){let y=i[f];for(let m=1;m<i[f].length;m+=2){let h=y[m-1],d=y[m],x=a[h]<u,b=a[d]<u,P=(x?1:0)+(b?1:0);c.vertexLength+P>me.MAX_VERTEX_ARRAY_LENGTH&&(c=t.createNewSegment(e,r),u=s.count,x=!0,b=!0,p=0);let v=mi(a,n,o,s,h,x,c),S=mi(a,n,o,s,d,b,c);r.emplaceBack(p+v-u,p+S-u),c.primitiveLength++}}}l(lb,"fillSegmentsLines");var ub=500,fr=class{static{l(this,"FillBucket")}constructor(e){this.zoom=e.zoom,this.globalState=e.globalState,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(r=>r.id),this.index=e.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new Yo,this.indexArray=new Ve,this.indexArray2=new Bt,this.programConfigurations=new Te(e.layers,e.zoom),this.segments=new me,this.segments2=new me,this.stateDependentLayerIds=this.layers.filter(r=>r.isStateDependent()).map(r=>r.id)}populate(e,r,n){this.hasPattern=Vr("fill",this.layers,r);let i=this.layers[0].layout.get("fill-sort-key"),o=!i.isConstant(),a=[];for(let{feature:s,id:u,index:c,sourceLayerIndex:p}of e){let f=this.layers[0]._featureFilter.needGeometry,y=je(s,f);if(!this.layers[0]._featureFilter.filter(new Z(this.zoom,{globalState:this.globalState}),y,n))continue;let m=o?i.evaluate(y,{},n,r.availableImages):void 0,h={id:u,properties:s.properties,type:s.type,sourceLayerIndex:p,index:c,geometry:f?y.geometry:Ce(s),patterns:{},sortKey:m};a.push(h)}o&&a.sort((s,u)=>s.sortKey-u.sortKey);for(let s of a){let{geometry:u,index:c,sourceLayerIndex:p}=s;if(this.hasPattern){let y=Rr("fill",this.layers,s,this.zoom,r);this.patternFeatures.push(y)}else this.addFeature(s,u,c,n,{},r.subdivisionGranularity);let f=e[c].feature;r.featureIndex.insert(f,u,c,p,this.index)}}update(e,r,n){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,r,this.stateDependentLayers,n)}addFeatures(e,r,n){for(let i of this.patternFeatures)this.addFeature(i,i.geometry,i.index,r,n,e.subdivisionGranularity)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Bp),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,r,n,i,o,a){for(let s of er(r,ub)){let u=xa(s,i,a.fill.getGranularityForZoomLevel(i.z)),c=this.layoutVertexArray;va((p,f)=>{c.emplaceBack(p,f)},this.segments,this.layoutVertexArray,this.indexArray,u.verticesFlattened,u.indicesTriangles,this.segments2,this.indexArray2,u.indicesLineList)}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,n,o,i)}};k("FillBucket",fr,{omit:["layers","patternFeatures"]});g();var Np,cb=l(()=>Np=Np||new ne({"fill-sort-key":new V(A.layout_fill["fill-sort-key"])}),"getLayout"),Up,pb=l(()=>Up=Up||new ne({"fill-antialias":new L(A.paint_fill["fill-antialias"]),"fill-opacity":new V(A.paint_fill["fill-opacity"]),"fill-color":new V(A.paint_fill["fill-color"]),"fill-outline-color":new V(A.paint_fill["fill-outline-color"]),"fill-translate":new L(A.paint_fill["fill-translate"]),"fill-translate-anchor":new L(A.paint_fill["fill-translate-anchor"]),"fill-pattern":new mt(A.paint_fill["fill-pattern"])}),"getPaint"),$p={get paint(){return pb()},get layout(){return cb()}};var Pa=class extends le{static{l(this,"FillStyleLayer")}constructor(e){super(e,$p)}recalculate(e,r){super.recalculate(e,r);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(e){return new fr(e)}queryRadius(){return Rt(this.paint.get("fill-translate"))}queryIntersectsFeature({queryGeometry:e,geometry:r,transform:n,pixelsToTileUnits:i}){let o=zt(e,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),-n.bearingInRadians,i);return ca(o,r)}isTileClipped(){return!0}};g();g();g();var fb=re([{name:"a_pos",components:2,type:"Int16"},{name:"a_normal_ed",components:4,type:"Int16"}],4),jp=re([{name:"a_centroid",components:2,type:"Int16"}],4);var{members:qp,size:t_,alignment:r_}=fb;var Kp=ee(Gt(),1);var Ab=Kp.default.VectorTileFeature.types,_b=500,vl=Math.pow(2,13);function hi(t,e,r,n,i,o,a,s){t.emplaceBack(e,r,Math.floor(n*vl)*2+a,i*vl*2,o*vl*2,Math.round(s))}l(hi,"addVertex");var yr=class{static{l(this,"FillExtrusionBucket")}constructor(e){this.zoom=e.zoom,this.globalState=e.globalState,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(r=>r.id),this.index=e.index,this.hasPattern=!1,this.layoutVertexArray=new Ko,this.centroidVertexArray=new Zo,this.indexArray=new Ve,this.programConfigurations=new Te(e.layers,e.zoom),this.segments=new me,this.stateDependentLayerIds=this.layers.filter(r=>r.isStateDependent()).map(r=>r.id)}populate(e,r,n){this.features=[],this.hasPattern=Vr("fill-extrusion",this.layers,r);for(let{feature:i,id:o,index:a,sourceLayerIndex:s}of e){let u=this.layers[0]._featureFilter.needGeometry,c=je(i,u);if(!this.layers[0]._featureFilter.filter(new Z(this.zoom,{globalState:this.globalState}),c,n))continue;let p={id:o,sourceLayerIndex:s,index:a,geometry:u?c.geometry:Ce(i),properties:i.properties,type:i.type,patterns:{}};this.hasPattern?this.features.push(Rr("fill-extrusion",this.layers,p,this.zoom,r)):this.addFeature(p,p.geometry,a,n,{},r.subdivisionGranularity),r.featureIndex.insert(i,p.geometry,a,s,this.index,!0)}}addFeatures(e,r,n){for(let i of this.features){let{geometry:o}=i;this.addFeature(i,o,i.index,r,n,e.subdivisionGranularity)}}update(e,r,n){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,r,this.stateDependentLayers,n)}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,qp),this.centroidVertexBuffer=e.createVertexBuffer(this.centroidVertexArray,jp.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,r,n,i,o,a){for(let s of er(r,_b)){let u={x:0,y:0,sampleCount:0},c=this.layoutVertexArray.length;this.processPolygon(u,i,e,s,a);let p=this.layoutVertexArray.length-c,f=Math.floor(u.x/u.sampleCount),y=Math.floor(u.y/u.sampleCount);for(let m=0;m<p;m++)this.centroidVertexArray.emplaceBack(f,y)}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,n,o,i)}processPolygon(e,r,n,i,o){if(i.length<1||Yp(i[0]))return;for(let f of i)f.length!==0&&Ib(e,f);let a={segment:this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray)},s=o.fill.getGranularityForZoomLevel(r.z),u=Ab[n.type]==="Polygon";for(let f of i){if(f.length===0||Yp(f))continue;let y=tt(f,s,u);this._generateSideFaces(y,a)}if(!u)return;let c=xa(i,r,s,!1),p=this.layoutVertexArray;va((f,y)=>{hi(p,f,y,0,0,1,1,0)},this.segments,this.layoutVertexArray,this.indexArray,c.verticesFlattened,c.indicesTriangles)}_generateSideFaces(e,r){let n=0;for(let i=1;i<e.length;i++){let o=e[i],a=e[i-1];if(Tb(o,a))continue;r.segment.vertexLength+4>me.MAX_VERTEX_ARRAY_LENGTH&&(r.segment=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));let s=o.sub(a)._perp()._unit(),u=a.dist(o);n+u>32768&&(n=0),hi(this.layoutVertexArray,o.x,o.y,s.x,s.y,0,0,n),hi(this.layoutVertexArray,o.x,o.y,s.x,s.y,0,1,n),n+=u,hi(this.layoutVertexArray,a.x,a.y,s.x,s.y,0,0,n),hi(this.layoutVertexArray,a.x,a.y,s.x,s.y,0,1,n);let c=r.segment.vertexLength;this.indexArray.emplaceBack(c,c+2,c+1),this.indexArray.emplaceBack(c+1,c+2,c+3),r.segment.vertexLength+=4,r.segment.primitiveLength+=2}}};function Ib(t,e){for(let r=0;r<e.length;r++){let n=e[r];r===e.length-1&&e[0].x===n.x&&e[0].y===n.y||(t.x+=n.x,t.y+=n.y,t.sampleCount++)}}l(Ib,"accumulatePointsToCentroid");k("FillExtrusionBucket",yr,{omit:["layers","features"]});function Tb(t,e){return t.x===e.x&&(t.x<0||t.x>8192)||t.y===e.y&&(t.y<0||t.y>8192)}l(Tb,"isBoundaryEdge");function Yp(t){return t.every(e=>e.x<0)||t.every(e=>e.x>8192)||t.every(e=>e.y<0)||t.every(e=>e.y>8192)}l(Yp,"isEntirelyOutside");g();var Qp,Cb=l(()=>Qp=Qp||new ne({"fill-extrusion-opacity":new L(A["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new V(A["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new L(A["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new L(A["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new mt(A["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new V(A["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new V(A["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new L(A["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])}),"getPaint"),ef={get paint(){return Cb()}};var wa=ee(de(),1);var Aa=class extends le{static{l(this,"FillExtrusionStyleLayer")}constructor(e){super(e,ef)}createBucket(e){return new yr(e)}queryRadius(){return Rt(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}queryIntersectsFeature({queryGeometry:e,feature:r,featureState:n,geometry:i,transform:o,pixelsToTileUnits:a,pixelPosMatrix:s}){let u=zt(e,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),-o.bearingInRadians,a),c=this.paint.get("fill-extrusion-height").evaluate(r,n),p=this.paint.get("fill-extrusion-base").evaluate(r,n),f=Eb(u,s,0),y=Fb(i,p,c,s),m=y[0],h=y[1];return kb(m,h,f)}};function di(t,e){return t.x*e.x+t.y*e.y}l(di,"dot");function tf(t,e){if(t.length===1){let r=0,n=e[r++],i;for(;!i||n.equals(i);)if(i=e[r++],!i)return 1/0;for(;r<e.length;r++){let o=e[r],a=t[0],s=i.sub(n),u=o.sub(n),c=a.sub(n),p=di(s,s),f=di(s,u),y=di(u,u),m=di(c,s),h=di(c,u),d=p*y-f*f,x=(y*m-f*h)/d,b=(p*h-f*m)/d,P=1-x-b,v=n.z*P+i.z*x+o.z*b;if(isFinite(v))return v}return 1/0}else{let r=1/0;for(let n of e)r=Math.min(r,n.z);return r}}l(tf,"getIntersectionDistance");function kb(t,e,r){let n=1/0;ca(r,e)&&(n=tf(r,e[0]));for(let i=0;i<e.length;i++){let o=e[i],a=t[i];for(let s=0;s<o.length-1;s++){let u=o[s],c=o[s+1],p=a[s],f=a[s+1],y=[u,c,f,p,u];dp(r,y)&&(n=Math.min(n,tf(r,y)))}}return n===1/0?!1:n}l(kb,"checkIntersection");function Fb(t,e,r,n){let i=[],o=[],a=n[8]*e,s=n[9]*e,u=n[10]*e,c=n[11]*e,p=n[8]*r,f=n[9]*r,y=n[10]*r,m=n[11]*r;for(let h of t){let d=[],x=[];for(let b of h){let P=b.x,v=b.y,S=n[0]*P+n[4]*v+n[12],_=n[1]*P+n[5]*v+n[13],T=n[2]*P+n[6]*v+n[14],I=n[3]*P+n[7]*v+n[15],F=S+a,D=_+s,R=T+u,z=I+c,N=S+p,B=_+f,C=T+y,O=I+m,$=new wa.default(F/z,D/z);$.z=R/z,d.push($);let U=new wa.default(N/O,B/O);U.z=C/O,x.push(U)}i.push(d),o.push(x)}return[i,o]}l(Fb,"projectExtrusion");function Eb(t,e,r){let n=[];for(let i of t){let o=[i.x,i.y,r,1];Ji.transformMat4(o,o,e),n.push(new wa.default(o[0]/o[3],o[1]/o[3]))}return n}l(Eb,"projectQueryGeometry");g();g();g();var Mb=re([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}],4),{members:rf,size:K_,alignment:Q_}=Mb;g();var Lb=re([{name:"a_uv_x",components:1,type:"Float32"},{name:"a_split_index",components:1,type:"Float32"}]),{members:nf,size:n2,alignment:i2}=Lb;var sf=ee(Gt(),1);var Db=sf.default.VectorTileFeature.types,of=63,Bb=Math.cos(75/2*(Math.PI/180)),Vb=15,Rb=20,zb=15,lf=1/2,af=Math.pow(2,zb-1)/lf,mr=class{static{l(this,"LineBucket")}constructor(e){this.zoom=e.zoom,this.globalState=e.globalState,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(r=>r.id),this.index=e.index,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach(r=>{this.gradients[r.id]={}}),this.layoutVertexArray=new Qo,this.layoutVertexArray2=new ea,this.indexArray=new Ve,this.programConfigurations=new Te(e.layers,e.zoom),this.segments=new me,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter(r=>r.isStateDependent()).map(r=>r.id)}populate(e,r,n){this.hasPattern=Vr("line",this.layers,r);let i=this.layers[0].layout.get("line-sort-key"),o=!i.isConstant(),a=[];for(let{feature:s,id:u,index:c,sourceLayerIndex:p}of e){let f=this.layers[0]._featureFilter.needGeometry,y=je(s,f);if(!this.layers[0]._featureFilter.filter(new Z(this.zoom,{globalState:this.globalState}),y,n))continue;let m=o?i.evaluate(y,{},n):void 0,h={id:u,properties:s.properties,type:s.type,sourceLayerIndex:p,index:c,geometry:f?y.geometry:Ce(s),patterns:{},sortKey:m};a.push(h)}o&&a.sort((s,u)=>s.sortKey-u.sortKey);for(let s of a){let{geometry:u,index:c,sourceLayerIndex:p}=s;if(this.hasPattern){let y=Rr("line",this.layers,s,this.zoom,r);this.patternFeatures.push(y)}else this.addFeature(s,u,c,n,{},r.subdivisionGranularity);let f=e[c].feature;r.featureIndex.insert(f,u,c,p,this.index)}}update(e,r,n){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,r,this.stateDependentLayers,n)}addFeatures(e,r,n){for(let i of this.patternFeatures)this.addFeature(i,i.geometry,i.index,r,n,e.subdivisionGranularity)}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,nf)),this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,rf),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 r=+e.properties.mapbox_clip_start,n=+e.properties.mapbox_clip_end;return{start:r,end:n}}}addFeature(e,r,n,i,o,a){let s=this.layers[0].layout,u=s.get("line-join").evaluate(e,{}),c=s.get("line-cap"),p=s.get("line-miter-limit"),f=s.get("line-round-limit");this.lineClips=this.lineFeatureClips(e);for(let y of r)this.addLine(y,e,u,c,p,f,i,a);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,n,o,i)}addLine(e,r,n,i,o,a,s,u){this.distance=0,this.scaledDistance=0,this.totalDistance=0;let c=s?u.line.getGranularityForZoomLevel(s.z):1;if(e=tt(e,c),this.lineClips){this.lineClipsArray.push(this.lineClips);for(let S=0;S<e.length-1;S++)this.totalDistance+=e[S].dist(e[S+1]);this.updateScaledDistance(),this.maxLineLength=Math.max(this.maxLineLength,this.totalDistance)}let p=Db[r.type]==="Polygon",f=e.length;for(;f>=2&&e[f-1].equals(e[f-2]);)f--;let y=0;for(;y<f-1&&e[y].equals(e[y+1]);)y++;if(f<(p?3:2))return;n==="bevel"&&(o=1.05);let m=this.overscaling<=16?Vb*8192/(512*this.overscaling):0,h=this.segments.prepareSegment(f*10,this.layoutVertexArray,this.indexArray),d,x,b,P,v;this.e1=this.e2=-1,p&&(d=e[f-2],v=e[y].sub(d)._unit()._perp());for(let S=y;S<f;S++){if(b=S===f-1?p?e[y+1]:void 0:e[S+1],b&&e[S].equals(b))continue;v&&(P=v),d&&(x=d),d=e[S],v=b?b.sub(d)._unit()._perp():P,P=P||v;let _=P.add(v);(_.x!==0||_.y!==0)&&_._unit();let T=P.x*v.x+P.y*v.y,I=_.x*v.x+_.y*v.y,F=I!==0?1/I:1/0,D=2*Math.sqrt(2-2*I),R=I<Bb&&x&&b,z=P.x*v.y-P.y*v.x>0;if(R&&S>y){let C=d.dist(x);if(C>2*m){let O=d.sub(d.sub(x)._mult(m/C)._round());this.updateDistance(x,O),this.addCurrentVertex(O,P,0,0,h),x=O}}let N=x&&b,B=N?n:p?"butt":i;if(N&&B==="round"&&(F<a?B="miter":F<=2&&(B="fakeround")),B==="miter"&&F>o&&(B="bevel"),B==="bevel"&&(F>2&&(B="flipbevel"),F<o&&(B="miter")),x&&this.updateDistance(x,d),B==="miter")_._mult(F),this.addCurrentVertex(d,_,0,0,h);else if(B==="flipbevel"){if(F>100)_=v.mult(-1);else{let C=F*P.add(v).mag()/P.sub(v).mag();_._perp()._mult(C*(z?-1:1))}this.addCurrentVertex(d,_,0,0,h),this.addCurrentVertex(d,_.mult(-1),0,0,h)}else if(B==="bevel"||B==="fakeround"){let C=-Math.sqrt(F*F-1),O=z?C:0,$=z?0:C;if(x&&this.addCurrentVertex(d,P,O,$,h),B==="fakeround"){let U=Math.round(D*180/Math.PI/Rb);for(let G=1;G<U;G++){let te=G/U;if(te!==.5){let oe=te-.5,ge=1.0904+T*(-3.2452+T*(3.55645-T*1.43519)),qt=.848013+T*(-1.06021+T*.215638);te=te+te*oe*(te-1)*(ge*oe*oe+qt)}let J=v.sub(P)._mult(te)._add(P)._unit()._mult(z?-1:1);this.addHalfVertex(d,J.x,J.y,!1,z,0,h)}}b&&this.addCurrentVertex(d,v,-O,-$,h)}else if(B==="butt")this.addCurrentVertex(d,_,0,0,h);else if(B==="square"){let C=x?1:-1;this.addCurrentVertex(d,_,C,C,h)}else B==="round"&&(x&&(this.addCurrentVertex(d,P,0,0,h),this.addCurrentVertex(d,P,1,1,h,!0)),b&&(this.addCurrentVertex(d,v,-1,-1,h,!0),this.addCurrentVertex(d,v,0,0,h)));if(R&&S<f-1){let C=d.dist(b);if(C>2*m){let O=d.add(b.sub(d)._mult(m/C)._round());this.updateDistance(d,O),this.addCurrentVertex(O,v,0,0,h),d=O}}}}addCurrentVertex(e,r,n,i,o,a=!1){let s=r.x+r.y*n,u=r.y-r.x*n,c=-r.x+r.y*i,p=-r.y-r.x*i;this.addHalfVertex(e,s,u,a,!1,n,o),this.addHalfVertex(e,c,p,a,!0,-i,o),this.distance>af/2&&this.totalDistance===0&&(this.distance=0,this.updateScaledDistance(),this.addCurrentVertex(e,r,n,i,o,a))}addHalfVertex({x:e,y:r},n,i,o,a,s,u){let p=(this.lineClips?this.scaledDistance*(af-1):this.scaledDistance)*lf;if(this.layoutVertexArray.emplaceBack((e<<1)+(o?1:0),(r<<1)+(a?1:0),Math.round(of*n)+128,Math.round(of*i)+128,(s===0?0:s<0?-1:1)+1|(p&63)<<2,p>>6),this.lineClips){let y=this.scaledDistance-this.lineClips.start,m=this.lineClips.end-this.lineClips.start,h=y/m;this.layoutVertexArray2.emplaceBack(h,this.lineClipsArray.length)}let f=u.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,f,this.e2),u.primitiveLength++),a?this.e2=f:this.e1=f}updateScaledDistance(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance}updateDistance(e,r){this.distance+=e.dist(r),this.updateScaledDistance()}};k("LineBucket",mr,{omit:["layers","patternFeatures"]});g();var uf,Ob=l(()=>uf=uf||new ne({"line-cap":new L(A.layout_line["line-cap"]),"line-join":new V(A.layout_line["line-join"]),"line-miter-limit":new L(A.layout_line["line-miter-limit"]),"line-round-limit":new L(A.layout_line["line-round-limit"]),"line-sort-key":new V(A.layout_line["line-sort-key"])}),"getLayout"),cf,Gb=l(()=>cf=cf||new ne({"line-opacity":new V(A.paint_line["line-opacity"]),"line-color":new V(A.paint_line["line-color"]),"line-translate":new L(A.paint_line["line-translate"]),"line-translate-anchor":new L(A.paint_line["line-translate-anchor"]),"line-width":new V(A.paint_line["line-width"]),"line-gap-width":new V(A.paint_line["line-gap-width"]),"line-offset":new V(A.paint_line["line-offset"]),"line-blur":new V(A.paint_line["line-blur"]),"line-dasharray":new ir(A.paint_line["line-dasharray"]),"line-pattern":new mt(A.paint_line["line-pattern"]),"line-gradient":new ht(A.paint_line["line-gradient"])}),"getPaint"),Pl={get paint(){return Gb()},get layout(){return Ob()}};var Sl=class extends V{static{l(this,"LineFloorwidthProperty")}possiblyEvaluate(e,r){return r=new Z(Math.floor(r.zoom),{now:r.now,fadeDuration:r.fadeDuration,zoomHistory:r.zoomHistory,transition:r.transition}),super.possiblyEvaluate(e,r)}evaluate(e,r,n,i){return r=xe({},r,{zoom:Math.floor(r.zoom)}),super.evaluate(e,r,n,i)}},_a;var Ia=class extends le{static{l(this,"LineStyleLayer")}constructor(e){super(e,Pl),this.gradientVersion=0,_a||(_a=new Sl(Pl.paint.properties["line-width"].specification),_a.useIntegerZoom=!0)}_handleSpecialPaintPropertyUpdate(e){if(e==="line-gradient"){let r=this.gradientExpression();mc(r)?this.stepInterpolant=r._styleExpression.expression instanceof Ar:this.stepInterpolant=!1,this.gradientVersion=(this.gradientVersion+1)%Number.MAX_SAFE_INTEGER}}gradientExpression(){return this._transitionablePaint._values["line-gradient"].value.expression}recalculate(e,r){super.recalculate(e,r),this.paint._values["line-floorwidth"]=_a.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,e)}createBucket(e){return new mr(e)}queryRadius(e){let r=e,n=pf(ur("line-width",this,r),ur("line-gap-width",this,r)),i=ur("line-offset",this,r);return n/2+Math.abs(i)+Rt(this.paint.get("line-translate"))}queryIntersectsFeature({queryGeometry:e,feature:r,featureState:n,geometry:i,transform:o,pixelsToTileUnits:a}){let s=zt(e,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),-o.bearingInRadians,a),u=a/2*pf(this.paint.get("line-width").evaluate(r,n),this.paint.get("line-gap-width").evaluate(r,n)),c=this.paint.get("line-offset").evaluate(r,n);return c&&(i=vp(i,c*a)),bp(s,i,u)}isTileClipped(){return!0}};function pf(t,e){return e>0?e+2*t:t}l(pf,"getLineWidth");g();g();g();var ff=re([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),yf=re([{name:"a_projected_pos",components:3,type:"Float32"}],4),$2=re([{name:"a_fade_opacity",components:1,type:"Uint32"}],4),mf=re([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"},{name:"a_box_real",components:2,type:"Int16"}]),j2=re([{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"}]),wl=re([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),q2=re([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4),W2=re([{name:"triangle",components:3,type:"Uint16"}]),X2=re([{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"}]),H2=re([{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",name:"collisionCircleDiameter"},{type:"Uint16",name:"textAnchorOffsetStartIndex"},{type:"Uint16",name:"textAnchorOffsetEndIndex"}]),Z2=re([{type:"Float32",name:"offsetX"}]),J2=re([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]),Y2=re([{type:"Uint16",name:"textAnchor"},{type:"Float32",components:2,name:"textOffset"}]);var wi=ee(de(),1);g();function Nb(t,e,r){let n=e.layout.get("text-transform").evaluate(r,{});return n==="uppercase"?t=t.toLocaleUpperCase():n==="lowercase"&&(t=t.toLocaleLowerCase()),Ie.applyArabicShaping&&(t=Ie.applyArabicShaping(t)),t}l(Nb,"transformTextInternal");function hf(t,e,r){return t.sections.forEach(n=>{n.text=Nb(n.text,e,r)}),t}l(hf,"transformText");g();function df(t){let e={},r={},n=[],i=0;function o(c){n.push(t[c]),i++}l(o,"add");function a(c,p,f){let y=r[c];return delete r[c],r[p]=y,n[y].geometry[0].pop(),n[y].geometry[0]=n[y].geometry[0].concat(f[0]),y}l(a,"mergeFromRight");function s(c,p,f){let y=e[p];return delete e[p],e[c]=y,n[y].geometry[0].shift(),n[y].geometry[0]=f[0].concat(n[y].geometry[0]),y}l(s,"mergeFromLeft");function u(c,p,f){let y=f?p[0][p[0].length-1]:p[0][0];return`${c}:${y.x}:${y.y}`}l(u,"getKey");for(let c=0;c<t.length;c++){let p=t[c],f=p.geometry,y=p.text?p.text.toString():null;if(!y){o(c);continue}let m=u(y,f),h=u(y,f,!0);if(m in r&&h in e&&r[m]!==e[h]){let d=s(m,h,f),x=a(m,h,n[d].geometry);delete e[m],delete r[h],r[u(y,n[x].geometry,!0)]=x,n[d].geometry=null}else m in r?a(m,h,f):h in e?s(m,h,f):(o(c),e[m]=i-1,r[h]=i-1)}return n.filter(c=>c.geometry)}l(df,"mergeLines");g();g();var Nr={"!":"\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 gf(t){let e="";for(let r=0;r<t.length;r++){let n=t.charCodeAt(r+1)||null,i=t.charCodeAt(r-1)||null;(!n||!Qs(n)||Nr[t[r+1]])&&(!i||!Qs(i)||Nr[t[r-1]])&&Nr[t[r]]?e+=Nr[t[r]]:e+=t[r]}return e}l(gf,"verticalizePunctuation");g();var ue=24;g();var ox=ee(gi(),1);var ax=3;var ka=ax;g();g();g();function bi(t){let e=0,r=0;for(let s of t)e+=s.w*s.h,r=Math.max(r,s.w);t.sort((s,u)=>u.h-s.h);let i=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(e/.95)),r),h:1/0}],o=0,a=0;for(let s of t)for(let u=i.length-1;u>=0;u--){let c=i[u];if(!(s.w>c.w||s.h>c.h)){if(s.x=c.x,s.y=c.y,a=Math.max(a,s.y+s.h),o=Math.max(o,s.x+s.w),s.w===c.w&&s.h===c.h){let p=i.pop();u<i.length&&(i[u]=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):(i.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:o,h:a,fill:e/(o*a)||0}}l(bi,"potpack");var be=1;var Fa=class{static{l(this,"ImagePosition")}constructor(e,{pixelRatio:r,version:n,stretchX:i,stretchY:o,content:a,textFitWidth:s,textFitHeight:u}){this.paddedRect=e,this.pixelRatio=r,this.stretchX=i,this.stretchY=o,this.content=a,this.version=n,this.textFitWidth=s,this.textFitHeight=u}get tl(){return[this.paddedRect.x+be,this.paddedRect.y+be]}get br(){return[this.paddedRect.x+this.paddedRect.w-be,this.paddedRect.y+this.paddedRect.h-be]}get tlbr(){return this.tl.concat(this.br)}get displaySize(){return[(this.paddedRect.w-be*2)/this.pixelRatio,(this.paddedRect.h-be*2)/this.pixelRatio]}},xi=class{static{l(this,"ImageAtlas")}constructor(e,r){let n={},i={};this.haveRenderCallbacks=[];let o=[];this.addImages(e,n,o),this.addImages(r,i,o);let{w:a,h:s}=bi(o),u=new he({width:a||1,height:s||1});for(let c in e){let p=e[c],f=n[c].paddedRect;he.copy(p.data,u,{x:0,y:0},{x:f.x+be,y:f.y+be},p.data)}for(let c in r){let p=r[c],f=i[c].paddedRect,y=f.x+be,m=f.y+be,h=p.data.width,d=p.data.height;he.copy(p.data,u,{x:0,y:0},{x:y,y:m},p.data),he.copy(p.data,u,{x:0,y:d-1},{x:y,y:m-1},{width:h,height:1}),he.copy(p.data,u,{x:0,y:0},{x:y,y:m+d},{width:h,height:1}),he.copy(p.data,u,{x:h-1,y:0},{x:y-1,y:m},{width:1,height:d}),he.copy(p.data,u,{x:0,y:0},{x:y+h,y:m},{width:1,height:d})}this.image=u,this.iconPositions=n,this.patternPositions=i}addImages(e,r,n){for(let i in e){let o=e[i],a={x:0,y:0,w:o.data.width+2*be,h:o.data.height+2*be};n.push(a),r[i]=new Fa(a,o),o.hasRenderCallback&&this.haveRenderCallbacks.push(i)}}patchUpdatedImages(e,r){e.dispatchRenderCallbacks(this.haveRenderCallbacks);for(let n in e.updatedImages)this.patchUpdatedImage(this.iconPositions[n],e.getImage(n),r),this.patchUpdatedImage(this.patternPositions[n],e.getImage(n),r)}patchUpdatedImage(e,r,n){if(!e||!r||e.version===r.version)return;e.version=r.version;let[i,o]=e.tl;n.update(r.data,void 0,{x:i,y:o})}};k("ImagePosition",Fa);k("ImageAtlas",xi);var La=(i=>(i[i.none=0]="none",i[i.horizontal=1]="horizontal",i[i.vertical=2]="vertical",i[i.horizontalOnly=3]="horizontalOnly",i))(La||{}),Pi=-17;function sx(t){for(let e of t)if(e.positionedGlyphs.length!==0)return!1;return!0}l(sx,"isEmpty");var Af=57344,_f=63743,Ea=class t{static{l(this,"SectionOptions")}constructor(){this.scale=1,this.fontStack="",this.imageName=null,this.verticalAlign="bottom"}static forText(e,r,n){let i=new t;return i.scale=e||1,i.fontStack=r,i.verticalAlign=n||"bottom",i}static forImage(e,r){let n=new t;return n.imageName=e,n.verticalAlign=r||"bottom",n}},vi=class t{static{l(this,"TaggedString")}constructor(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null}static fromFeature(e,r){let n=new t;for(let i=0;i<e.sections.length;i++){let o=e.sections[i];o.image?n.addImageSection(o):n.addTextSection(o,r)}return n}length(){return this.text.length}getSection(e){return this.sections[this.sectionIndex[e]]}getSectionIndex(e){return this.sectionIndex[e]}getCharCode(e){return this.text.charCodeAt(e)}verticalizePunctuation(){this.text=gf(this.text)}trim(){let e=0;for(let n=0;n<this.text.length&&Ma[this.text.charCodeAt(n)];n++)e++;let r=this.text.length;for(let n=this.text.length-1;n>=0&&n>=e&&Ma[this.text.charCodeAt(n)];n--)r--;this.text=this.text.substring(e,r),this.sectionIndex=this.sectionIndex.slice(e,r)}substring(e,r){let n=new t;return n.text=this.text.substring(e,r),n.sectionIndex=this.sectionIndex.slice(e,r),n.sections=this.sections,n}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce((e,r)=>Math.max(e,this.sections[r].scale),0)}getMaxImageSize(e){let r=0,n=0;for(let i=0;i<this.length();i++){let o=this.getSection(i);if(o.imageName){let a=e[o.imageName];if(!a)continue;let s=a.displaySize;r=Math.max(r,s[0]),n=Math.max(n,s[1])}}return{maxImageWidth:r,maxImageHeight:n}}addTextSection(e,r){this.text+=e.text,this.sections.push(Ea.forText(e.scale,e.fontStack||r,e.verticalAlign));let n=this.sections.length-1;for(let i=0;i<e.text.length;++i)this.sectionIndex.push(n)}addImageSection(e){let r=e.image?e.image.name:"";if(r.length===0){ye("Can't add FormattedSection with an empty image.");return}let n=this.getNextImageSectionCharCode();if(!n){ye(`Reached maximum number of images ${_f-Af+2}`);return}this.text+=String.fromCharCode(n),this.sections.push(Ea.forImage(r,e.verticalAlign)),this.sectionIndex.push(this.sections.length-1)}getNextImageSectionCharCode(){return this.imageSectionID?this.imageSectionID>=_f?null:++this.imageSectionID:(this.imageSectionID=Af,this.imageSectionID)}};function lx(t,e){let r=[],n=t.text,i=0;for(let o of e)r.push(t.substring(i,o)),i=o;return i<n.length&&r.push(t.substring(i,n.length)),r}l(lx,"breakLines");function Si(t,e,r,n,i,o,a,s,u,c,p,f,y,m,h){let d=vi.fromFeature(t,i);f===2&&d.verticalizePunctuation();let x,{processBidirectionalText:b,processStyledBidirectionalText:P}=Ie;if(b&&d.sections.length===1){x=[];let _=b(d.toString(),Il(d,c,o,e,n,m));for(let T of _){let I=new vi;I.text=T,I.sections=d.sections;for(let F=0;F<T.length;F++)I.sectionIndex.push(0);x.push(I)}}else if(P){x=[];let _=P(d.text,d.sectionIndex,Il(d,c,o,e,n,m));for(let T of _){let I=new vi;I.text=T[0],I.sectionIndex=T[1],I.sections=d.sections,x.push(I)}}else x=lx(d,Il(d,c,o,e,n,m));let v=[],S={positionedLines:v,text:d.toString(),top:p[1],bottom:p[1],left:p[0],right:p[0],writingMode:f,iconsInText:!1,verticalizable:!1};return dx(S,e,r,n,x,a,s,u,f,c,y,h),sx(v)?!1:S}l(Si,"shapeText");var Ma={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},ux={10:!0,32:!0,38:!0,41:!0,43:!0,45:!0,47:!0,173:!0,183:!0,8203:!0,8208:!0,8211:!0,8231:!0},cx={40:!0};function Cf(t,e,r,n,i,o){if(e.imageName){let a=n[e.imageName];return a?a.displaySize[0]*e.scale*ue/o+i:0}else{let a=r[e.fontStack],s=a&&a[t];return s?s.metrics.advance*e.scale+i:0}}l(Cf,"getGlyphAdvance");function px(t,e,r,n,i,o){let a=0;for(let u=0;u<t.length();u++){let c=t.getSection(u);a+=Cf(t.getCharCode(u),c,n,i,e,o)}let s=Math.max(1,Math.ceil(a/r));return a/s}l(px,"determineAverageLineWidth");function If(t,e,r,n){let i=Math.pow(t-e,2);return n?t<e?i/2:i*2:i+Math.abs(r)*r}l(If,"calculateBadness");function fx(t,e,r){let n=0;return t===10&&(n-=1e4),r&&(n+=150),(t===40||t===65288)&&(n+=50),(e===41||e===65289)&&(n+=50),n}l(fx,"calculatePenalty");function Tf(t,e,r,n,i,o){let a=null,s=If(e,r,i,o);for(let u of n){let c=e-u.x,p=If(c,r,i,o)+u.badness;p<=s&&(a=u,s=p)}return{index:t,x:e,priorBreak:a,badness:s}}l(Tf,"evaluateBreak");function kf(t){return t?kf(t.priorBreak).concat(t.index):[]}l(kf,"leastBadBreaks");function Il(t,e,r,n,i,o){if(!t)return[];let a=[],s=px(t,e,r,n,i,o),u=t.text.indexOf("\u200B")>=0,c=0;for(let p=0;p<t.length();p++){let f=t.getSection(p),y=t.getCharCode(p);if(Ma[y]||(c+=Cf(y,f,n,i,e,o)),p<t.length()-1){let m=Qc(y);(ux[y]||m||f.imageName||p!==t.length()-2&&cx[t.getCharCode(p+1)])&&a.push(Tf(p+1,c,s,a,fx(y,t.getCharCode(p+1),m&&u),!1))}}return kf(Tf(t.length(),c,s,a,0,!0))}l(Il,"determineLineBreaks");function Ff(t){let e=.5,r=.5;switch(t){case"right":case"top-right":case"bottom-right":e=1;break;case"left":case"top-left":case"bottom-left":e=0;break}switch(t){case"bottom":case"bottom-right":case"bottom-left":r=1;break;case"top":case"top-right":case"top-left":r=0;break}return{horizontalAlign:e,verticalAlign:r}}l(Ff,"getAnchorAlignment");function yx(t,e,r){let n=e.getMaxScale()*ue,{maxImageWidth:i,maxImageHeight:o}=e.getMaxImageSize(t),a=Math.max(n,o*r);return{verticalLineContentWidth:Math.max(n,i*r),horizontalLineContentHeight:a}}l(yx,"calculateLineContentSize");function Ef(t){switch(t){case"top":return 0;case"center":return .5;default:return 1}}l(Ef,"getVerticalAlignFactor");function mx(t,e,r,n){if(t&&t.rect)return t;let i=e[r.fontStack],o=i&&i[n];return o?{rect:null,metrics:o.metrics}:null}l(mx,"getRectAndMetrics");function hx(t,e,r){return!(t===1||!e&&!Bo(r)||e&&(Ma[r]||ep(r)))}l(hx,"isLineVertical");function dx(t,e,r,n,i,o,a,s,u,c,p,f){let y=0,m=0,h=0,d=0,x=s==="right"?1:s==="left"?0:.5,b=ue/f,P=0;for(let _ of i){_.trim();let T=_.getMaxScale(),I={positionedGlyphs:[],lineOffset:0};t.positionedLines[P]=I;let F=I.positionedGlyphs,D=0;if(!_.length()){m+=o,++P;continue}let R=yx(n,_,b);for(let B=0;B<_.length();B++){let C=_.getSection(B),O=_.getSectionIndex(B),$=_.getCharCode(B),U=hx(u,p,$),G;if(C.imageName){if(t.iconsInText=!0,C.scale=C.scale*b,G=bx(C,U,T,R,n),!G)continue;D=Math.max(D,G.imageOffset)}else if(G=gx(C,$,U,R,e,r),!G)continue;let{rect:te,metrics:J,baselineOffset:oe}=G;if(F.push({glyph:$,imageName:C.imageName,x:y,y:m+oe+Pi,vertical:U,scale:C.scale,fontStack:C.fontStack,sectionIndex:O,metrics:J,rect:te}),!U)y+=J.advance*C.scale+c;else{t.verticalizable=!0;let ge=C.imageName?J.advance:ue;y+=ge*C.scale+c}}if(F.length!==0){let B=y-c;h=Math.max(B,h),xx(F,0,F.length-1,x)}y=0;let z=(T-1)*ue;I.lineOffset=Math.max(D,z);let N=o*T+D;m+=N,d=Math.max(N,d),++P}let{horizontalAlign:v,verticalAlign:S}=Ff(a);vx(t.positionedLines,x,v,S,h,d,o,m,i.length),t.top+=-S*m,t.bottom=t.top+m,t.left+=-v*h,t.right=t.left+h}l(dx,"shapeLines");function gx(t,e,r,n,i,o){let a=o[t.fontStack],s=a&&a[e],u=mx(s,i,t,e);if(u===null)return null;let c;if(r)c=n.verticalLineContentWidth-t.scale*ue;else{let p=Ef(t.verticalAlign);c=(n.horizontalLineContentHeight-t.scale*ue)*p}return{rect:u.rect,metrics:u.metrics,baselineOffset:c}}l(gx,"shapeTextSection");function bx(t,e,r,n,i){let o=i[t.imageName];if(!o)return null;let a=o.paddedRect,s=o.displaySize,u={width:s[0],height:s[1],left:be,top:-ka,advance:e?s[1]:s[0]},c;if(e)c=n.verticalLineContentWidth-s[1]*t.scale;else{let f=Ef(t.verticalAlign);c=(n.horizontalLineContentHeight-s[1]*t.scale)*f}let p=(e?s[0]:s[1])*t.scale-ue*r;return{rect:a,metrics:u,baselineOffset:c,imageOffset:p}}l(bx,"shapeImageSection");function xx(t,e,r,n){if(n===0)return;let i=t[r],o=i.metrics.advance*i.scale,a=(t[r].x+o)*n;for(let s=e;s<=r;s++)t[s].x-=a}l(xx,"justifyLine");function vx(t,e,r,n,i,o,a,s,u){let c=(e-r)*i,p=0;o!==a?p=-s*n-Pi:p=-n*u*a+.5*a;for(let f of t)for(let y of f.positionedGlyphs)y.x+=c,y.y+=p}l(vx,"align");function Mf(t,e,r){let{horizontalAlign:n,verticalAlign:i}=Ff(r),o=e[0],a=e[1],s=o-t.displaySize[0]*n,u=s+t.displaySize[0],c=a-t.displaySize[1]*i,p=c+t.displaySize[1];return{image:t,top:c,bottom:p,left:s,right:u}}l(Mf,"shapeIcon");function Da(t){let e=t.left,r=t.top,n=t.right-e,i=t.bottom-r,o=t.image.content[2]-t.image.content[0],a=t.image.content[3]-t.image.content[1],s=t.image.textFitWidth??"stretchOrShrink",u=t.image.textFitHeight??"stretchOrShrink",c=o/a;if(u==="proportional"){if(s==="stretchOnly"&&n/i<c||s==="proportional"){let p=Math.ceil(i*c);e*=p/n,n=p}}else if(s==="proportional"&&u==="stretchOnly"&&c!==0&&n/i>c){let p=Math.ceil(n/c);r*=p/i,i=p}return{x1:e,y1:r,x2:e+n,y2:r+i}}l(Da,"applyTextFit");function Tl(t,e,r,n,i,o){let a=t.image,s;if(a.content){let x=a.content,b=a.pixelRatio||1;s=[x[0]/b,x[1]/b,a.displaySize[0]-x[2]/b,a.displaySize[1]-x[3]/b]}let u=e.left*o,c=e.right*o,p,f,y,m;r==="width"||r==="both"?(m=i[0]+u-n[3],f=i[0]+c+n[1]):(m=i[0]+(u+c-a.displaySize[0])/2,f=m+a.displaySize[0]);let h=e.top*o,d=e.bottom*o;return r==="height"||r==="both"?(p=i[1]+h-n[0],y=i[1]+d+n[2]):(p=i[1]+(h+d-a.displaySize[1])/2,y=p+a.displaySize[1]),{image:a,top:p,right:f,bottom:y,left:m,collisionPadding:s}}l(Tl,"fitIconToText");var Lf=ee(Gt(),1);g();var jr=255,Nt=128,rt=jr*Nt;function Cl(t,e){let{expression:r}=e;if(r.kind==="constant")return{kind:"constant",layoutSize:r.evaluate(new Z(t+1))};if(r.kind==="source")return{kind:"source"};{let{zoomStops:n,interpolationType:i}=r,o=0;for(;o<n.length&&n[o]<=t;)o++;o=Math.max(0,o-1);let a=o;for(;a<n.length&&n[a]<t+1;)a++;a=Math.min(n.length-1,a);let s=n[o],u=n[a];if(r.kind==="composite")return{kind:"composite",minZoom:s,maxZoom:u,interpolationType:i};let c=r.evaluate(new Z(s)),p=r.evaluate(new Z(u));return{kind:"camera",minZoom:s,maxZoom:u,minSize:c,maxSize:p,interpolationType:i}}}l(Cl,"getSizeData");g();function kl(t,e,r){let n="never",i=t.get(e);return i?n=i:t.get(r)&&(n="always"),n}l(kl,"getOverlapMode");var Px=Lf.default.VectorTileFeature.types,Sx=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function Ba(t,e,r,n,i,o,a,s,u,c,p,f,y){let m=s?Math.min(rt,Math.round(s[0])):0,h=s?Math.min(rt,Math.round(s[1])):0;t.emplaceBack(e,r,Math.round(n*32),Math.round(i*32),o,a,(m<<1)+(u?1:0),h,c*16,p*16,f*256,y*256)}l(Ba,"addVertex");function Df(t,e,r){t.emplaceBack(e.x,e.y,r),t.emplaceBack(e.x,e.y,r),t.emplaceBack(e.x,e.y,r),t.emplaceBack(e.x,e.y,r)}l(Df,"addDynamicAttributes");function wx(t){for(let e of t.sections)if(rp(e.text))return!0;return!1}l(wx,"containsRTLText");var Ai=class{static{l(this,"SymbolBuffers")}constructor(e){this.layoutVertexArray=new ta,this.indexArray=new Ve,this.programConfigurations=e,this.segments=new me,this.dynamicLayoutVertexArray=new ra,this.opacityVertexArray=new na,this.hasVisibleVertices=!1,this.placedSymbolArray=new Hn}isEmpty(){return this.layoutVertexArray.length===0&&this.indexArray.length===0&&this.dynamicLayoutVertexArray.length===0&&this.opacityVertexArray.length===0}upload(e,r,n,i){this.isEmpty()||(n&&(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,ff.members),this.indexBuffer=e.createIndexBuffer(this.indexArray,r),this.dynamicLayoutVertexBuffer=e.createVertexBuffer(this.dynamicLayoutVertexArray,yf.members,!0),this.opacityVertexBuffer=e.createVertexBuffer(this.opacityVertexArray,Sx,!0),this.opacityVertexBuffer.itemSize=1),(n||i)&&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())}};k("SymbolBuffers",Ai);var _i=class{static{l(this,"CollisionBuffers")}constructor(e,r,n){this.layoutVertexArray=new e,this.layoutAttributes=r,this.indexArray=new n,this.segments=new me,this.collisionVertexArray=new ia}upload(e){this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=e.createVertexBuffer(this.collisionVertexArray,mf.members,!0)}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy())}};k("CollisionBuffers",_i);var Je=class{static{l(this,"SymbolBucket")}constructor(e){this.collisionBoxArray=e.collisionBoxArray,this.zoom=e.zoom,this.globalState=e.globalState,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(u=>u.id),this.index=e.index,this.pixelRatio=e.pixelRatio,this.sourceLayerIndex=e.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.sortKeyRanges=[],this.collisionCircleArray=[];let n=this.layers[0]._unevaluatedLayout._values;this.textSizeData=Cl(this.zoom,n["text-size"]),this.iconSizeData=Cl(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=kl(i,"text-overlap","text-allow-overlap")!=="never"||kl(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(u=>La[u])),this.stateDependentLayerIds=this.layers.filter(u=>u.isStateDependent()).map(u=>u.id),this.sourceID=e.sourceID}createArrays(){this.text=new Ai(new Te(this.layers,this.zoom,e=>/^text/.test(e))),this.icon=new Ai(new Te(this.layers,this.zoom,e=>/^icon/.test(e))),this.glyphOffsetArray=new Jn,this.lineVertexArray=new Yn,this.symbolInstances=new Zn,this.textAnchorOffsets=new Kn}calculateGlyphDependencies(e,r,n,i,o){for(let a=0;a<e.length;a++)if(r[e.charCodeAt(a)]=!0,(n||i)&&o){let s=Nr[e.charAt(a)];s&&(r[s.charCodeAt(0)]=!0)}}populate(e,r,n){let i=this.layers[0],o=i.layout,a=o.get("text-font"),s=o.get("text-field"),u=o.get("icon-image"),c=(s.value.kind!=="constant"||s.value.value instanceof Le&&!s.value.value.isEmpty()||s.value.value.toString().length>0)&&(a.value.kind!=="constant"||a.value.value.length>0),p=u.value.kind!=="constant"||!!u.value.value||Object.keys(u.parameters).length>0,f=o.get("symbol-sort-key");if(this.features=[],!c&&!p)return;let y=r.iconDependencies,m=r.glyphDependencies,h=r.availableImages,d=new Z(this.zoom,{globalState:this.globalState});for(let{feature:x,id:b,index:P,sourceLayerIndex:v}of e){let S=i._featureFilter.needGeometry,_=je(x,S);if(!i._featureFilter.filter(d,_,n))continue;S||(_.geometry=Ce(x));let T;if(c){let R=i.getValueAndResolveTokens("text-field",_,n,h),z=Le.factory(R),N=this.hasRTLText=this.hasRTLText||wx(z);(!N||Ie.getRTLTextPluginStatus()==="unavailable"||N&&Ie.isParsed())&&(T=hf(z,i,_))}let I;if(p){let R=i.getValueAndResolveTokens("icon-image",_,n,h);R instanceof _e?I=R:I=_e.fromString(R)}if(!T&&!I)continue;let F=this.sortFeaturesByKey?f.evaluate(_,{},n):void 0,D={id:b,text:T,icon:I,index:P,sourceLayerIndex:v,geometry:_.geometry,properties:x.properties,type:Px[x.type],sortKey:F};if(this.features.push(D),I&&(y[I.name]=!0),T){let R=a.evaluate(_,{},n).join(","),z=o.get("text-rotation-alignment")!=="viewport"&&o.get("symbol-placement")!=="point";this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(2)>=0;for(let N of T.sections)if(N.image)y[N.image.name]=!0;else{let B=kn(T.toString()),C=N.fontStack||R,O=m[C]=m[C]||{};this.calculateGlyphDependencies(N.text,O,z,this.allowVerticalPlacement,B)}}}o.get("symbol-placement")==="line"&&(this.features=df(this.features)),this.sortFeaturesByKey&&this.features.sort((x,b)=>x.sortKey-b.sortKey)}update(e,r,n){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(e,r,this.layers,n),this.icon.programConfigurations.updatePaintArrays(e,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(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,r){let n=this.lineVertexArray.length;if(e.segment!==void 0){let i=e.dist(r[e.segment+1]),o=e.dist(r[e.segment]),a={};for(let s=e.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=e.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 u=a[s];this.lineVertexArray.emplaceBack(u.x,u.y,u.tileUnitDistanceFromAnchor)}}return{lineStartIndex:n,lineLength:this.lineVertexArray.length-n}}addSymbols(e,r,n,i,o,a,s,u,c,p,f,y){let m=e.indexArray,h=e.layoutVertexArray,d=e.segments.prepareSegment(4*r.length,h,m,this.canOverlap?a.sortKey:void 0),x=this.glyphOffsetArray.length,b=d.vertexLength,P=this.allowVerticalPlacement&&s===2?Math.PI/2:0,v=a.text&&a.text.sections;for(let S=0;S<r.length;S++){let{tl:_,tr:T,bl:I,br:F,tex:D,pixelOffsetTL:R,pixelOffsetBR:z,minFontScaleX:N,minFontScaleY:B,glyphOffset:C,isSDF:O,sectionIndex:$}=r[S],U=d.vertexLength,G=C[1];Ba(h,u.x,u.y,_.x,G+_.y,D.x,D.y,n,O,R.x,R.y,N,B),Ba(h,u.x,u.y,T.x,G+T.y,D.x+D.w,D.y,n,O,z.x,R.y,N,B),Ba(h,u.x,u.y,I.x,G+I.y,D.x,D.y+D.h,n,O,R.x,z.y,N,B),Ba(h,u.x,u.y,F.x,G+F.y,D.x+D.w,D.y+D.h,n,O,z.x,z.y,N,B),Df(e.dynamicLayoutVertexArray,u,P),m.emplaceBack(U,U+2,U+1),m.emplaceBack(U+1,U+2,U+3),d.vertexLength+=4,d.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(C[0]),(S===r.length-1||$!==r[S+1].sectionIndex)&&e.programConfigurations.populatePaintArrays(h.length,a,a.index,{},y,v&&v[$])}e.placedSymbolArray.emplaceBack(u.x,u.y,x,this.glyphOffsetArray.length-x,b,c,p,u.segment,n?n[0]:0,n?n[1]:0,i[0],i[1],s,0,!1,0,f)}_addCollisionDebugVertex(e,r,n,i,o,a){return r.emplaceBack(0,0),e.emplaceBack(n.x,n.y,i,o,Math.round(a.x),Math.round(a.y))}addCollisionDebugVertices(e,r,n,i,o,a,s){let u=o.segments.prepareSegment(4,o.layoutVertexArray,o.indexArray),c=u.vertexLength,p=o.layoutVertexArray,f=o.collisionVertexArray,y=s.anchorX,m=s.anchorY;this._addCollisionDebugVertex(p,f,a,y,m,new wi.default(e,r)),this._addCollisionDebugVertex(p,f,a,y,m,new wi.default(n,r)),this._addCollisionDebugVertex(p,f,a,y,m,new wi.default(n,i)),this._addCollisionDebugVertex(p,f,a,y,m,new wi.default(e,i)),u.vertexLength+=4;let h=o.indexArray;h.emplaceBack(c,c+1),h.emplaceBack(c+1,c+2),h.emplaceBack(c+2,c+3),h.emplaceBack(c+3,c),u.primitiveLength+=4}addDebugCollisionBoxes(e,r,n,i){for(let o=e;o<r;o++){let a=this.collisionBoxArray.get(o),s=a.x1,u=a.y1,c=a.x2,p=a.y2;this.addCollisionDebugVertices(s,u,c,p,i?this.textCollisionBox:this.iconCollisionBox,a.anchorPoint,n)}}generateCollisionDebugBuffers(){this.hasDebugData()&&this.destroyDebugData(),this.textCollisionBox=new _i(ei,wl.members,Bt),this.iconCollisionBox=new _i(ei,wl.members,Bt);for(let e=0;e<this.symbolInstances.length;e++){let r=this.symbolInstances.get(e);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(e,r,n,i,o,a,s,u,c){let p={};for(let f=r;f<n;f++){let y=e.get(f);p.textBox={x1:y.x1,y1:y.y1,x2:y.x2,y2:y.y2,anchorPointX:y.anchorPointX,anchorPointY:y.anchorPointY},p.textFeatureIndex=y.featureIndex;break}for(let f=i;f<o;f++){let y=e.get(f);p.verticalTextBox={x1:y.x1,y1:y.y1,x2:y.x2,y2:y.y2,anchorPointX:y.anchorPointX,anchorPointY:y.anchorPointY},p.verticalTextFeatureIndex=y.featureIndex;break}for(let f=a;f<s;f++){let y=e.get(f);p.iconBox={x1:y.x1,y1:y.y1,x2:y.x2,y2:y.y2,anchorPointX:y.anchorPointX,anchorPointY:y.anchorPointY},p.iconFeatureIndex=y.featureIndex;break}for(let f=u;f<c;f++){let y=e.get(f);p.verticalIconBox={x1:y.x1,y1:y.y1,x2:y.x2,y2:y.y2,anchorPointX:y.anchorPointX,anchorPointY:y.anchorPointY},p.verticalIconFeatureIndex=y.featureIndex;break}return p}deserializeCollisionBoxes(e){this.collisionArrays=[];for(let r=0;r<this.symbolInstances.length;r++){let n=this.symbolInstances.get(r);this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(e,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(e,r){let n=e.placedSymbolArray.get(r),i=n.vertexStartIndex+n.numGlyphs*4;for(let o=n.vertexStartIndex;o<i;o+=4)e.indexArray.emplaceBack(o,o+2,o+1),e.indexArray.emplaceBack(o+1,o+2,o+3)}getSortedSymbolIndexes(e){if(this.sortedAngle===e&&this.symbolInstanceIndexes!==void 0)return this.symbolInstanceIndexes;let r=Math.sin(e),n=Math.cos(e),i=[],o=[],a=[];for(let s=0;s<this.symbolInstances.length;++s){a.push(s);let u=this.symbolInstances.get(s);i.push(Math.round(r*u.anchorX+n*u.anchorY)|0),o.push(u.featureIndex)}return a.sort((s,u)=>i[s]-i[u]||o[u]-o[s]),a}addToSortKeyRanges(e,r){let n=this.sortKeyRanges[this.sortKeyRanges.length-1];n&&n.sortKey===r?n.symbolInstanceEnd=e+1:this.sortKeyRanges.push({sortKey:r,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 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",Je,{omit:["layers","collisionBoxArray","features","compareText"]});Je.MAX_GLYPHS=65535;Je.addDynamicAttributes=Df;g();function Bf(t,e){return e.replace(/{([^{}]+)}/g,(r,n)=>t&&n in t?String(t[n]):"")}l(Bf,"resolveTokens");g();var Vf,Ax=l(()=>Vf=Vf||new ne({"symbol-placement":new L(A.layout_symbol["symbol-placement"]),"symbol-spacing":new L(A.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new L(A.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new V(A.layout_symbol["symbol-sort-key"]),"symbol-z-order":new L(A.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new L(A.layout_symbol["icon-allow-overlap"]),"icon-overlap":new L(A.layout_symbol["icon-overlap"]),"icon-ignore-placement":new L(A.layout_symbol["icon-ignore-placement"]),"icon-optional":new L(A.layout_symbol["icon-optional"]),"icon-rotation-alignment":new L(A.layout_symbol["icon-rotation-alignment"]),"icon-size":new V(A.layout_symbol["icon-size"]),"icon-text-fit":new L(A.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new L(A.layout_symbol["icon-text-fit-padding"]),"icon-image":new V(A.layout_symbol["icon-image"]),"icon-rotate":new V(A.layout_symbol["icon-rotate"]),"icon-padding":new V(A.layout_symbol["icon-padding"]),"icon-keep-upright":new L(A.layout_symbol["icon-keep-upright"]),"icon-offset":new V(A.layout_symbol["icon-offset"]),"icon-anchor":new V(A.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new L(A.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new L(A.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new L(A.layout_symbol["text-rotation-alignment"]),"text-field":new V(A.layout_symbol["text-field"]),"text-font":new V(A.layout_symbol["text-font"]),"text-size":new V(A.layout_symbol["text-size"]),"text-max-width":new V(A.layout_symbol["text-max-width"]),"text-line-height":new L(A.layout_symbol["text-line-height"]),"text-letter-spacing":new V(A.layout_symbol["text-letter-spacing"]),"text-justify":new V(A.layout_symbol["text-justify"]),"text-radial-offset":new V(A.layout_symbol["text-radial-offset"]),"text-variable-anchor":new L(A.layout_symbol["text-variable-anchor"]),"text-variable-anchor-offset":new V(A.layout_symbol["text-variable-anchor-offset"]),"text-anchor":new V(A.layout_symbol["text-anchor"]),"text-max-angle":new L(A.layout_symbol["text-max-angle"]),"text-writing-mode":new L(A.layout_symbol["text-writing-mode"]),"text-rotate":new V(A.layout_symbol["text-rotate"]),"text-padding":new L(A.layout_symbol["text-padding"]),"text-keep-upright":new L(A.layout_symbol["text-keep-upright"]),"text-transform":new V(A.layout_symbol["text-transform"]),"text-offset":new V(A.layout_symbol["text-offset"]),"text-allow-overlap":new L(A.layout_symbol["text-allow-overlap"]),"text-overlap":new L(A.layout_symbol["text-overlap"]),"text-ignore-placement":new L(A.layout_symbol["text-ignore-placement"]),"text-optional":new L(A.layout_symbol["text-optional"])}),"getLayout"),Rf,_x=l(()=>Rf=Rf||new ne({"icon-opacity":new V(A.paint_symbol["icon-opacity"]),"icon-color":new V(A.paint_symbol["icon-color"]),"icon-halo-color":new V(A.paint_symbol["icon-halo-color"]),"icon-halo-width":new V(A.paint_symbol["icon-halo-width"]),"icon-halo-blur":new V(A.paint_symbol["icon-halo-blur"]),"icon-translate":new L(A.paint_symbol["icon-translate"]),"icon-translate-anchor":new L(A.paint_symbol["icon-translate-anchor"]),"text-opacity":new V(A.paint_symbol["text-opacity"]),"text-color":new V(A.paint_symbol["text-color"],{runtimeType:Ne,getOverride:l(t=>t.textColor,"getOverride"),hasOverride:l(t=>!!t.textColor,"hasOverride")}),"text-halo-color":new V(A.paint_symbol["text-halo-color"]),"text-halo-width":new V(A.paint_symbol["text-halo-width"]),"text-halo-blur":new V(A.paint_symbol["text-halo-blur"]),"text-translate":new L(A.paint_symbol["text-translate"]),"text-translate-anchor":new L(A.paint_symbol["text-translate-anchor"])}),"getPaint"),Va={get paint(){return _x()},get layout(){return Ax()}};g();var Ii=class{static{l(this,"FormatSectionOverride")}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:Ir,this.defaultValue=e}evaluate(e){if(e.formattedSection){let r=this.defaultValue.property.overrides;if(r&&r.hasOverride(e.formattedSection))return r.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 r=this.defaultValue.value;e(r._styleExpression.expression)}}outputDefined(){return!1}serialize(){return null}};k("FormatSectionOverride",Ii,{omit:["defaultValue"]});var Ra=class t extends le{static{l(this,"SymbolStyleLayer")}constructor(e){super(e,Va)}recalculate(e,r){if(super.recalculate(e,r),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 i=[];for(let o of n)i.indexOf(o)<0&&i.push(o);this.layout._values["text-writing-mode"]=i}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()}getValueAndResolveTokens(e,r,n,i){let o=this.layout.get(e).evaluate(r,{},n,i),a=this._unevaluatedLayout._values[e];return!a.isDataDriven()&&!In(a.value)&&o?Bf(r.properties,o):o}createBucket(e){return new Je(e)}queryRadius(){return 0}queryIntersectsFeature(){throw new Error("Should take a different path in FeatureIndex")}_setPaintOverrides(){for(let e of Va.paint.overridableProperties){if(!t.hasPaintOverride(this.layout,e))continue;let r=this.paint.get(e),n=new Ii(r),i=new Yt(n,r.property.specification),o=null;r.value.kind==="constant"||r.value.kind==="source"?o=new Qe("source",i):o=new Ft("composite",i,r.value.zoomStops),this.paint._values[e]=new ve(r.property,o,r.parameters)}}_handleOverridablePaintPropertyUpdate(e,r,n){return!this.layout||r.isDataDriven()||n.isDataDriven()?!1:t.hasPaintOverride(this.layout,e)}static hasPaintOverride(e,r){let n=e.get("text-field"),i=Va.paint.properties[r],o=!1,a=l(s=>{for(let u of s)if(i.overrides&&i.overrides.hasOverride(u)){o=!0;return}},"checkSections");if(n.value.kind==="constant"&&n.value.value instanceof Le)a(n.value.value.sections);else if(n.value.kind==="source"){let s=l(c=>{if(!o)if(c instanceof Ct&&fe(c.value)===Tr){let p=c.value;a(p.sections)}else c instanceof mn?a(c.sections):c.eachChild(s)},"checkExpression"),u=n.value;u._styleExpression&&s(u._styleExpression.expression)}return o}};function zf(t,e,r,n=1){let i=t.get("icon-padding").evaluate(e,{},r),o=i&&i.values;return[o[0]*n,o[1]*n,o[2]*n,o[3]*n]}l(zf,"getIconPadding");g();g();var Of,Ix=l(()=>Of=Of||new ne({"background-color":new L(A.paint_background["background-color"]),"background-pattern":new ir(A.paint_background["background-pattern"]),"background-opacity":new L(A.paint_background["background-opacity"])}),"getPaint"),Gf={get paint(){return Ix()}};var za=class extends le{static{l(this,"BackgroundStyleLayer")}constructor(e){super(e,Gf)}};g();g();var Nf,Tx=l(()=>Nf=Nf||new ne({"raster-opacity":new L(A.paint_raster["raster-opacity"]),"raster-hue-rotate":new L(A.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new L(A.paint_raster["raster-brightness-min"]),"raster-brightness-max":new L(A.paint_raster["raster-brightness-max"]),"raster-saturation":new L(A.paint_raster["raster-saturation"]),"raster-contrast":new L(A.paint_raster["raster-contrast"]),"raster-resampling":new L(A.paint_raster["raster-resampling"]),"raster-fade-duration":new L(A.paint_raster["raster-fade-duration"])}),"getPaint"),Uf={get paint(){return Tx()}};var Oa=class extends le{static{l(this,"RasterStyleLayer")}constructor(e){super(e,Uf)}};g();var Ga=class extends le{constructor(r){super(r,{});this.onAdd=l(r=>{this.implementation.onAdd&&this.implementation.onAdd(r,r.painter.context.gl)},"onAdd");this.onRemove=l(r=>{this.implementation.onRemove&&this.implementation.onRemove(r,r.painter.context.gl)},"onRemove");this.implementation=r}static{l(this,"CustomStyleLayer")}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 $f(t){if(t.type==="custom")return new Ga(t);switch(t.type){case"background":return new za(t);case"circle":return new fa(t);case"color-relief":return new ha(t);case"fill":return new Pa(t);case"fill-extrusion":return new Aa(t);case"heatmap":return new ya(t);case"hillshade":return new ma(t);case"line":return new Ia(t);case"raster":return new Oa(t);case"symbol":return new Ra(t)}}l($f,"createStyleLayer");var Na=class{static{l(this,"StyleLayerIndex")}constructor(e){this.keyCache={},e&&this.replace(e)}replace(e){this._layerConfigs={},this._layers={},this.update(e,[])}update(e,r){for(let i of e){this._layerConfigs[i.id]=i;let o=this._layers[i.id]=$f(i);o._featureFilter=Et(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=bc(Object.values(this._layerConfigs),this.keyCache);for(let i of n){let o=i.map(f=>this._layers[f.id]),a=o[0];if(a.visibility==="none")continue;let s=a.source||"",u=this.familiesBySource[s];u||(u=this.familiesBySource[s]={});let c=a.sourceLayer||"_geojsonTileLayer",p=u[c];p||(p=u[c]=[]),p.push(o)}}};g();var my=ee(Gt(),1),hy=ee(gi(),1);g();g();g();var qr=class{static{l(this,"DictionaryCoder")}constructor(e){this._stringToNumber={},this._numberToString=[];for(let r=0;r<e.length;r++){let n=e[r];this._stringToNumber[n]=r,this._numberToString[r]=n}}encode(e){return this._stringToNumber[e]}decode(e){if(e>=this._numberToString.length)throw new Error(`Out of bounds. Index requested n=${e} can't be >= this._numberToString.length ${this._numberToString.length}`);return this._numberToString[e]}};var qf=ee(Gt(),1),Wf=ee(gi(),1);g();var Ua=class{static{l(this,"GeoJSONFeature")}constructor(e,r,n,i,o){this.type="Feature",this._vectorTileFeature=e,e._z=r,e._x=n,e._y=i,this.properties=e.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(e){this._geometry=e}toJSON(){let e={geometry:this.geometry};for(let r in this)r==="_geometry"||r==="_vectorTileFeature"||(e[r]=this[r]);return e}};g();var Ti=ee(de(),1);var hr=class t{constructor(){this.minX=1/0;this.maxX=-1/0;this.minY=1/0;this.maxY=-1/0}static{l(this,"Bounds")}extend(e){return this.minX=Math.min(this.minX,e.x),this.minY=Math.min(this.minY,e.y),this.maxX=Math.max(this.maxX,e.x),this.maxY=Math.max(this.maxY,e.y),this}expandBy(e){return this.minX-=e,this.minY-=e,this.maxX+=e,this.maxY+=e,(this.minX>this.maxX||this.minY>this.maxY)&&(this.minX=1/0,this.maxX=-1/0,this.minY=1/0,this.maxY=-1/0),this}shrinkBy(e){return this.expandBy(-e)}map(e){let r=new t;return r.extend(e(new Ti.default(this.minX,this.minY))),r.extend(e(new Ti.default(this.maxX,this.minY))),r.extend(e(new Ti.default(this.minX,this.maxY))),r.extend(e(new Ti.default(this.maxX,this.maxY))),r}static fromPoints(e){let r=new t;for(let n of e)r.extend(n);return r}contains(e){return e.x>=this.minX&&e.x<=this.maxX&&e.y>=this.minY&&e.y<=this.maxY}empty(){return this.minX>this.maxX}width(){return this.maxX-this.minX}height(){return this.maxY-this.minY}covers(e){return!this.empty()&&!e.empty()&&e.minX>=this.minX&&e.maxX<=this.maxX&&e.minY>=this.minY&&e.maxY<=this.maxY}intersects(e){return!this.empty()&&!e.empty()&&e.minX<=this.maxX&&e.maxX>=this.minX&&e.minY<=this.maxY&&e.maxY>=this.minY}};var Ci=class{static{l(this,"FeatureIndex")}constructor(e,r){this.tileID=e,this.x=e.canonical.x,this.y=e.canonical.y,this.z=e.canonical.z,this.grid=new Wt(8192,16,0),this.grid3D=new Wt(8192,16,0),this.featureIndexArray=new Qn,this.promoteId=r}insert(e,r,n,i,o,a){let s=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(n,i,o);let u=a?this.grid3D:this.grid;for(let c=0;c<r.length;c++){let p=r[c],f=[1/0,1/0,-1/0,-1/0];for(let y=0;y<p.length;y++){let m=p[y];f[0]=Math.min(f[0],m.x),f[1]=Math.min(f[1],m.y),f[2]=Math.max(f[2],m.x),f[3]=Math.max(f[3],m.y)}f[0]<8192&&f[1]<8192&&f[2]>=0&&f[3]>=0&&u.insert(s,f[0],f[1],f[2],f[3])}}loadVTLayers(){return this.vtLayers||(this.vtLayers=new qf.default.VectorTile(new Wf.default(this.rawTileData)).layers,this.sourceLayerCoder=new qr(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers}query(e,r,n,i){this.loadVTLayers();let o=e.params,a=8192/e.tileSize/e.scale,s=Et(o.filter),u=e.queryGeometry,c=e.queryPadding*a,p=hr.fromPoints(u),f=this.grid.query(p.minX-c,p.minY-c,p.maxX+c,p.maxY+c),y=hr.fromPoints(e.cameraQueryGeometry).expandBy(c),m=this.grid3D.query(y.minX,y.minY,y.maxX,y.maxY,(x,b,P,v)=>xp(e.cameraQueryGeometry,x-c,b-c,P+c,v+c));for(let x of m)f.push(x);f.sort(Cx);let h={},d;for(let x=0;x<f.length;x++){let b=f[x];if(b===d)continue;d=b;let P=this.featureIndexArray.get(b),v=null;this.loadMatchingFeature(h,P.bucketIndex,P.sourceLayerIndex,P.featureIndex,s,o.layers,o.availableImages,r,n,i,(S,_,T)=>(v||(v=Ce(S)),_.queryIntersectsFeature({queryGeometry:u,feature:S,featureState:T,geometry:v,zoom:this.z,transform:e.transform,pixelsToTileUnits:a,pixelPosMatrix:e.pixelPosMatrix,unwrappedTileID:this.tileID.toUnwrapped(),getElevation:e.getElevation})))}return h}loadMatchingFeature(e,r,n,i,o,a,s,u,c,p,f){let y=this.bucketLayerIDs[r];if(a&&!y.some(b=>a.has(b)))return;let m=this.sourceLayerCoder.decode(n),d=this.vtLayers[m].feature(i);if(o.needGeometry){let b=je(d,!0);if(!o.filter(new Z(this.tileID.overscaledZ),b,this.tileID.canonical))return}else if(!o.filter(new Z(this.tileID.overscaledZ),d))return;let x=this.getId(d,m);for(let b=0;b<y.length;b++){let P=y[b];if(a&&!a.has(P))continue;let v=u[P];if(!v)continue;let S={};x&&p&&(S=p.getState(v.sourceLayer||"_geojsonTileLayer",x));let _=xe({},c[P]);_.paint=jf(_.paint,v.paint,d,S,s),_.layout=jf(_.layout,v.layout,d,S,s);let T=!f||f(d,v,S);if(!T)continue;let I=new Ua(d,this.z,this.x,this.y,x);I.layer=_;let F=e[P];F===void 0&&(F=e[P]=[]),F.push({featureIndex:i,feature:I,intersectionZ:T})}}lookupSymbolFeatures(e,r,n,i,o,a,s,u){let c={};this.loadVTLayers();let p=Et(o);for(let f of e)this.loadMatchingFeature(c,n,i,f,p,a,s,u,r);return c}hasLayer(e){for(let r of this.bucketLayerIDs)for(let n of r)if(e===n)return!0;return!1}getId(e,r){let n=e.id;if(this.promoteId){let i=typeof this.promoteId=="string"?this.promoteId:this.promoteId[r];n=e.properties[i],typeof n=="boolean"&&(n=Number(n)),n===void 0&&e.properties?.cluster&&this.promoteId&&(n=Number(e.properties.cluster_id))}return n}};k("FeatureIndex",Ci,{omit:["rawTileData","sourceLayerCoder"]});function jf(t,e,r,n,i){return on(t,(o,a)=>{let s=e instanceof Mt?e.get(a):null;return s&&s.evaluate?s.evaluate(r,n,i):s})}l(jf,"evaluateProperties");function Cx(t,e){return e-t}l(Cx,"topDownFeatureComparator");g();g();var Xf=ee(de(),1);var nt=class t extends Xf.default{static{l(this,"Anchor")}constructor(e,r,n,i){super(e,r),this.angle=n,i!==void 0&&(this.segment=i)}clone(){return new t(this.x,this.y,this.angle,this.segment)}};k("Anchor",nt);g();g();function Fl(t,e,r,n,i){if(e.segment===void 0||r===0)return!0;let o=e,a=e.segment+1,s=0;for(;s>-r/2;){if(a--,a<0)return!1;s-=t[a].dist(o),o=t[a]}s+=t[a].dist(t[a+1]),a++;let u=[],c=0;for(;s<r/2;){let p=t[a-1],f=t[a],y=t[a+1];if(!y)return!1;let m=p.angleTo(f)-f.angleTo(y);for(m=Math.abs((m+3*Math.PI)%(Math.PI*2)-Math.PI),u.push({distance:s,angleDelta:m}),c+=m;s-u[0].distance>n;)c-=u.shift().angleDelta;if(c>i)return!1;a++,s+=f.dist(y)}return!0}l(Fl,"checkMaxAngle");function Hf(t){let e=0;for(let r=0;r<t.length-1;r++)e+=t[r].dist(t[r+1]);return e}l(Hf,"getLineLength");function Zf(t,e,r){return t?3/5*e*r:0}l(Zf,"getAngleWindowSize");function Jf(t,e){return Math.max(t?t.right-t.left:0,e?e.right-e.left:0)}l(Jf,"getShapedLabelLength");function Yf(t,e,r,n,i,o){let a=Zf(r,i,o),s=Jf(r,n)*o,u=0,c=Hf(t)/2;for(let p=0;p<t.length-1;p++){let f=t[p],y=t[p+1],m=f.dist(y);if(u+m>c){let h=(c-u)/m,d=pt.number(f.x,y.x,h),x=pt.number(f.y,y.y,h),b=new nt(d,x,y.angleTo(f),p);return b._round(),!a||Fl(t,b,s,a,e)?b:void 0}u+=m}}l(Yf,"getCenterAnchor");function Kf(t,e,r,n,i,o,a,s,u){let c=Zf(n,o,a),p=Jf(n,i),f=p*a,y=t[0].x===0||t[0].x===u||t[0].y===0||t[0].y===u;e-f<e/4&&(e=f+e/4);let m=o*2,h=y?e/2*s%e:(p/2+m)*a*s%e;return Qf(t,h,e,c,r,f,y,!1,u)}l(Kf,"getAnchors");function Qf(t,e,r,n,i,o,a,s,u){let c=o/2,p=Hf(t),f=0,y=e-r,m=[];for(let h=0;h<t.length-1;h++){let d=t[h],x=t[h+1],b=d.dist(x),P=x.angleTo(d);for(;y+r<f+b;){y+=r;let v=(y-f)/b,S=pt.number(d.x,x.x,v),_=pt.number(d.y,x.y,v);if(S>=0&&S<u&&_>=0&&_<u&&y-c>=0&&y+c<=p){let T=new nt(S,_,P,h);T._round(),(!n||Fl(t,T,o,n,i))&&m.push(T)}}f+=b}return!s&&!m.length&&!a&&(m=Qf(t,f/2,r,n,i,o,a,!0,u)),m}l(Qf,"resample");g();var bt=ee(de(),1);function ey(t,e,r,n,i){let o=[];for(let a=0;a<t.length;a++){let s=t[a],u;for(let c=0;c<s.length-1;c++){let p=s[c],f=s[c+1];p.x<e&&f.x<e||(p.x<e?p=new bt.default(e,p.y+(f.y-p.y)*((e-p.x)/(f.x-p.x)))._round():f.x<e&&(f=new bt.default(e,p.y+(f.y-p.y)*((e-p.x)/(f.x-p.x)))._round()),!(p.y<r&&f.y<r)&&(p.y<r?p=new bt.default(p.x+(f.x-p.x)*((r-p.y)/(f.y-p.y)),r)._round():f.y<r&&(f=new bt.default(p.x+(f.x-p.x)*((r-p.y)/(f.y-p.y)),r)._round()),!(p.x>=n&&f.x>=n)&&(p.x>=n?p=new bt.default(n,p.y+(f.y-p.y)*((n-p.x)/(f.x-p.x)))._round():f.x>=n&&(f=new bt.default(n,p.y+(f.y-p.y)*((n-p.x)/(f.x-p.x)))._round()),!(p.y>=i&&f.y>=i)&&(p.y>=i?p=new bt.default(p.x+(f.x-p.x)*((i-p.y)/(f.y-p.y)),i)._round():f.y>=i&&(f=new bt.default(p.x+(f.x-p.x)*((i-p.y)/(f.y-p.y)),i)._round()),(!u||!p.equals(u[u.length-1]))&&(u=[p],o.push(u)),u.push(f)))))}}return o}l(ey,"clipLine");g();var Pe=ee(de(),1);var Wr=be;function El(t,e,r,n){let i=[],o=t.image,a=o.pixelRatio,s=o.paddedRect.w-2*Wr,u=o.paddedRect.h-2*Wr,c={x1:t.left,y1:t.top,x2:t.right,y2:t.bottom},p=o.stretchX||[[0,s]],f=o.stretchY||[[0,u]],y=l((C,O)=>C+O[1]-O[0],"reduceRanges"),m=p.reduce(y,0),h=f.reduce(y,0),d=s-m,x=u-h,b=0,P=m,v=0,S=h,_=0,T=d,I=0,F=x;if(o.content&&n){let C=o.content,O=C[2]-C[0],$=C[3]-C[1];(o.textFitWidth||o.textFitHeight)&&(c=Da(t)),b=$a(p,0,C[0]),v=$a(f,0,C[1]),P=$a(p,C[0],C[2]),S=$a(f,C[1],C[3]),_=C[0]-b,I=C[1]-v,T=O-P,F=$-S}let D=c.x1,R=c.y1,z=c.x2-D,N=c.y2-R,B=l((C,O,$,U)=>{let G=ja(C.stretch-b,P,z,D),te=qa(C.fixed-_,T,C.stretch,m),J=ja(O.stretch-v,S,N,R),oe=qa(O.fixed-I,F,O.stretch,h),ge=ja($.stretch-b,P,z,D),qt=qa($.fixed-_,T,$.stretch,m),it=ja(U.stretch-v,S,N,R),vt=qa(U.fixed-I,F,U.stretch,h),$i=new Pe.default(G,J),ji=new Pe.default(ge,J),qi=new Pe.default(ge,it),Wi=new Pe.default(G,it),ss=new Pe.default(te/a,oe/a),ke=new Pe.default(qt/a,vt/a),Pt=e*Math.PI/180;if(Pt){let St=Math.sin(Pt),Kr=Math.cos(Pt),ze=[Kr,-St,St,Kr];$i._matMult(ze),ji._matMult(ze),Wi._matMult(ze),qi._matMult(ze)}let Yr=C.stretch+C.fixed,ls=$.stretch+$.fixed,Xi=O.stretch+O.fixed,us=U.stretch+U.fixed,Fe={x:o.paddedRect.x+Wr+Yr,y:o.paddedRect.y+Wr+Xi,w:ls-Yr,h:us-Xi},Se=T/a/z,ot=F/a/N;return{tl:$i,tr:ji,bl:Wi,br:qi,tex:Fe,writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:ss,pixelOffsetBR:ke,minFontScaleX:Se,minFontScaleY:ot,isSDF:r}},"makeBox");if(!n||!o.stretchX&&!o.stretchY)i.push(B({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:s+1},{fixed:0,stretch:u+1}));else{let C=ty(p,d,m),O=ty(f,x,h);for(let $=0;$<C.length-1;$++){let U=C[$],G=C[$+1];for(let te=0;te<O.length-1;te++){let J=O[te],oe=O[te+1];i.push(B(U,J,G,oe))}}}return i}l(El,"getIconQuads");function $a(t,e,r){let n=0;for(let i of t)n+=Math.max(e,Math.min(r,i[1]))-Math.max(e,Math.min(r,i[0]));return n}l($a,"sumWithinRange");function ty(t,e,r){let n=[{fixed:-Wr,stretch:0}];for(let[i,o]of t){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:e+Wr,stretch:r}),n}l(ty,"stretchZonesToCuts");function ja(t,e,r,n){return t/e*r+n}l(ja,"getEmOffset");function qa(t,e,r,n){return t-e*r/n}l(qa,"getPxOffset");function ry(t,e,r,n,i,o,a,s){let u=n.layout.get("text-rotate").evaluate(o,{})*Math.PI/180,c=[];for(let p of e.positionedLines)for(let f of p.positionedGlyphs){if(!f.rect)continue;let y=f.rect||{},h=ka+1,d=!0,x=1,b=0,P=(i||s)&&f.vertical,v=f.metrics.advance*f.scale/2;if(s&&e.verticalizable){let J=(f.scale-1)*ue,oe=(ue-f.metrics.width*f.scale)/2;b=p.lineOffset/2-(f.imageName?-oe:J)}if(f.imageName){let J=a[f.imageName];d=J.sdf,x=J.pixelRatio,h=be/x}let S=i?[f.x+v,f.y]:[0,0],_=i?[0,0]:[f.x+v+r[0],f.y+r[1]-b],T=[0,0];P&&(T=_,_=[0,0]);let I=f.metrics.isDoubleResolution?2:1,F=(f.metrics.left-h)*f.scale-v+_[0],D=(-f.metrics.top-h)*f.scale+_[1],R=F+y.w/I*f.scale/x,z=D+y.h/I*f.scale/x,N=new Pe.default(F,D),B=new Pe.default(R,D),C=new Pe.default(F,z),O=new Pe.default(R,z);if(P){let J=new Pe.default(-v,v-Pi),oe=-Math.PI/2,ge=ue/2-v,qt=f.imageName?ge:0,it=new Pe.default(5-Pi-ge,-qt),vt=new Pe.default(...T);N._rotateAround(oe,J)._add(it)._add(vt),B._rotateAround(oe,J)._add(it)._add(vt),C._rotateAround(oe,J)._add(it)._add(vt),O._rotateAround(oe,J)._add(it)._add(vt)}if(u){let J=Math.sin(u),oe=Math.cos(u),ge=[oe,-J,J,oe];N._matMult(ge),B._matMult(ge),C._matMult(ge),O._matMult(ge)}let $=new Pe.default(0,0),U=new Pe.default(0,0);c.push({tl:N,tr:B,bl:C,br:O,tex:y,writingMode:e.writingMode,glyphOffset:S,sectionIndex:f.sectionIndex,isSDF:d,pixelOffsetTL:$,pixelOffsetBR:U,minFontScaleX:0,minFontScaleY:0})}return c}l(ry,"getGlyphQuads");g();var ki=ee(de(),1);var dr=class{static{l(this,"CollisionFeature")}constructor(e,r,n,i,o,a,s,u,c,p){if(this.boxStartIndex=e.length,c){let f=a.top,y=a.bottom,m=a.collisionPadding;m&&(f-=m[1],y+=m[3]);let h=y-f;h>0&&(h=Math.max(10,h),this.circleDiameter=h)}else{let f=a.image?.content&&(a.image.textFitWidth||a.image.textFitHeight)?Da(a):{x1:a.left,y1:a.top,x2:a.right,y2:a.bottom};f.y1=f.y1*s-u[0],f.y2=f.y2*s+u[2],f.x1=f.x1*s-u[3],f.x2=f.x2*s+u[1];let y=a.collisionPadding;if(y&&(f.x1-=y[0]*s,f.y1-=y[1]*s,f.x2+=y[2]*s,f.y2+=y[3]*s),p){let m=new ki.default(f.x1,f.y1),h=new ki.default(f.x2,f.y1),d=new ki.default(f.x1,f.y2),x=new ki.default(f.x2,f.y2),b=p*Math.PI/180;m._rotate(b),h._rotate(b),d._rotate(b),x._rotate(b),f.x1=Math.min(m.x,h.x,d.x,x.x),f.x2=Math.max(m.x,h.x,d.x,x.x),f.y1=Math.min(m.y,h.y,d.y,x.y),f.y2=Math.max(m.y,h.y,d.y,x.y)}e.emplaceBack(r.x,r.y,f.x1,f.y1,f.x2,f.y2,n,i,o)}this.boxEndIndex=e.length}};g();g();var Fi=class{static{l(this,"TinyQueue")}constructor(e=[],r=(n,i)=>n<i?-1:n>i?1:0){if(this.data=e,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(e){this.data.push(e),this._up(this.length++)}pop(){if(this.length===0)return;let e=this.data[0],r=this.data.pop();return--this.length>0&&(this.data[0]=r,this._down(0)),e}peek(){return this.data[0]}_up(e){let{data:r,compare:n}=this,i=r[e];for(;e>0;){let o=e-1>>1,a=r[o];if(n(i,a)>=0)break;r[e]=a,e=o}r[e]=i}_down(e){let{data:r,compare:n}=this,i=this.length>>1,o=r[e];for(;e<i;){let a=(e<<1)+1,s=a+1;if(s<this.length&&n(r[s],r[a])<0&&(a=s),n(r[a],o)>=0)break;r[e]=r[a],e=a}r[e]=o}};var Ml=ee(de(),1);function ny(t,e=1,r=!1){let n=hr.fromPoints(t[0]),i=Math.min(n.width(),n.height()),o=i/2,a=new Fi([],kx),{minX:s,minY:u,maxX:c,maxY:p}=n;if(i===0)return new Ml.default(s,u);for(let m=s;m<c;m+=i)for(let h=u;h<p;h+=i)a.push(new Xr(m+o,h+o,o,t));let f=Ex(t),y=a.length;for(;a.length;){let m=a.pop();(m.d>f.d||!f.d)&&(f=m,r&&console.log("found best %d after %d probes",Math.round(1e4*m.d)/1e4,y)),!(m.max-f.d<=e)&&(o=m.h/2,a.push(new Xr(m.p.x-o,m.p.y-o,o,t)),a.push(new Xr(m.p.x+o,m.p.y-o,o,t)),a.push(new Xr(m.p.x-o,m.p.y+o,o,t)),a.push(new Xr(m.p.x+o,m.p.y+o,o,t)),y+=4)}return r&&(console.log(`num probes: ${y}`),console.log(`best distance: ${f.d}`)),f.p}l(ny,"findPoleOfInaccessibility");function kx(t,e){return e.max-t.max}l(kx,"compareMax");function Xr(t,e,r,n){this.p=new Ml.default(t,e),this.h=r,this.d=Fx(this.p,n),this.max=this.d+this.h*Math.SQRT2}l(Xr,"Cell");function Fx(t,e){let r=!1,n=1/0;for(let i=0;i<e.length;i++){let o=e[i];for(let a=0,s=o.length,u=s-1;a<s;u=a++){let c=o[a],p=o[u];c.y>t.y!=p.y>t.y&&t.x<(p.x-c.x)*(t.y-c.y)/(p.y-c.y)+c.x&&(r=!r),n=Math.min(n,cl(t,c,p))}}return(r?1:-1)*Math.sqrt(n)}l(Fx,"pointToPolygonDist");function Ex(t){let e=0,r=0,n=0,i=t[0];for(let o=0,a=i.length,s=a-1;o<a;s=o++){let u=i[o],c=i[s],p=u.x*c.y-c.x*u.y;r+=(u.x+c.x)*p,n+=(u.y+c.y)*p,e+=p*3}return new Xr(r/e,n/e,0,t)}l(Ex,"getCentroidCell");var Vl=ee(il(),1);g();var Ll=(o=>(o[o.center=1]="center",o[o.left=2]="left",o[o.right=3]="right",o[o.top=4]="top",o[o.bottom=5]="bottom",o[o["top-left"]=6]="top-left",o[o["top-right"]=7]="top-right",o[o["bottom-left"]=8]="bottom-left",o[o["bottom-right"]=9]="bottom-right",o))(Ll||{}),Ut=7,Wa=Number.POSITIVE_INFINITY;function Dl(t,e){function r(i,o){let a=0,s=0;o<0&&(o=0);let u=o/Math.SQRT2;switch(i){case"top-right":case"top-left":s=u-Ut;break;case"bottom-right":case"bottom-left":s=-u+Ut;break;case"bottom":s=-o+Ut;break;case"top":s=o-Ut;break}switch(i){case"top-right":case"bottom-right":a=-u;break;case"top-left":case"bottom-left":a=u;break;case"left":a=o;break;case"right":a=-o;break}return[a,s]}l(r,"fromRadialOffset");function n(i,o,a){let s=0,u=0;switch(o=Math.abs(o),a=Math.abs(a),i){case"top-right":case"top-left":case"top":u=a-Ut;break;case"bottom-right":case"bottom-left":case"bottom":u=-a+Ut;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,u]}return l(n,"fromTextOffset"),e[1]!==Wa?n(t,e[0],e[1]):r(t,e[0])}l(Dl,"evaluateVariableOffset");function Bl(t,e,r){let n=t.layout,i=n.get("text-variable-anchor-offset")?.evaluate(e,{},r);if(i){let a=i.values,s=[];for(let u=0;u<a.length;u+=2){let c=s[u]=a[u],p=a[u+1].map(f=>f*ue);c.startsWith("top")?p[1]-=Ut:c.startsWith("bottom")&&(p[1]+=Ut),s[u+1]=p}return new De(s)}let o=n.get("text-variable-anchor");if(o){let a;t._unevaluatedLayout.getValue("text-radial-offset")!==void 0?a=[n.get("text-radial-offset").evaluate(e,{},r)*ue,Wa]:a=n.get("text-offset").evaluate(e,{},r).map(c=>c*ue);let u=[];for(let c of o)u.push(c,Dl(c,a));return new De(u)}return null}l(Bl,"getTextVariableAnchorOffset");function ay(t){t.bucket.createArrays();let e=512*t.bucket.overscaling;t.bucket.tilePixelRatio=8192/e,t.bucket.compareText={},t.bucket.iconsNeedLinear=!1;let r=t.bucket.layers[0],n=r.layout,i=r._unevaluatedLayout._values,o={layoutIconSize:i["icon-size"].possiblyEvaluate(new Z(t.bucket.zoom+1),t.canonical),layoutTextSize:i["text-size"].possiblyEvaluate(new Z(t.bucket.zoom+1),t.canonical),textMaxSize:i["text-size"].possiblyEvaluate(new Z(18))};if(t.bucket.textSizeData.kind==="composite"){let{minZoom:p,maxZoom:f}=t.bucket.textSizeData;o.compositeTextSizes=[i["text-size"].possiblyEvaluate(new Z(p),t.canonical),i["text-size"].possiblyEvaluate(new Z(f),t.canonical)]}if(t.bucket.iconSizeData.kind==="composite"){let{minZoom:p,maxZoom:f}=t.bucket.iconSizeData;o.compositeIconSizes=[i["icon-size"].possiblyEvaluate(new Z(p),t.canonical),i["icon-size"].possiblyEvaluate(new Z(f),t.canonical)]}let a=n.get("text-line-height")*ue,s=n.get("text-rotation-alignment")!=="viewport"&&n.get("symbol-placement")!=="point",u=n.get("text-keep-upright"),c=n.get("text-size");for(let p of t.bucket.features){let f=n.get("text-font").evaluate(p,{},t.canonical).join(","),y=c.evaluate(p,{},t.canonical),m=o.layoutTextSize.evaluate(p,{},t.canonical),h=o.layoutIconSize.evaluate(p,{},t.canonical),d={horizontal:{},vertical:void 0},x=p.text,b=[0,0];if(x){let _=x.toString(),T=n.get("text-letter-spacing").evaluate(p,{},t.canonical)*ue,I=Yc(_)?T:0,F=n.get("text-anchor").evaluate(p,{},t.canonical),D=Bl(r,p,t.canonical);if(!D){let C=n.get("text-radial-offset").evaluate(p,{},t.canonical);C?b=Dl(F,[C*ue,Wa]):b=n.get("text-offset").evaluate(p,{},t.canonical).map(O=>O*ue)}let R=s?"center":n.get("text-justify").evaluate(p,{},t.canonical),N=n.get("symbol-placement")==="point"?n.get("text-max-width").evaluate(p,{},t.canonical)*ue:1/0,B=l(()=>{t.bucket.allowVerticalPlacement&&kn(_)&&(d.vertical=Si(x,t.glyphMap,t.glyphPositions,t.imagePositions,f,N,a,F,"left",I,b,2,!0,m,y))},"addVerticalShapingForPointLabelIfNeeded");if(!s&&D){let C=new Set;if(R==="auto")for(let $=0;$<D.values.length;$+=2)C.add(iy(D.values[$]));else C.add(R);let O=!1;for(let $ of C)if(!d.horizontal[$])if(O)d.horizontal[$]=d.horizontal[0];else{let U=Si(x,t.glyphMap,t.glyphPositions,t.imagePositions,f,N,a,"center",$,I,b,1,!1,m,y);U&&(d.horizontal[$]=U,O=U.positionedLines.length===1)}B()}else{R==="auto"&&(R=iy(F));let C=Si(x,t.glyphMap,t.glyphPositions,t.imagePositions,f,N,a,F,R,I,b,1,!1,m,y);C&&(d.horizontal[R]=C),B(),kn(_)&&s&&u&&(d.vertical=Si(x,t.glyphMap,t.glyphPositions,t.imagePositions,f,N,a,F,R,I,b,2,!1,m,y))}}let P,v=!1;if(p.icon&&p.icon.name){let _=t.imageMap[p.icon.name];_&&(P=Mf(t.imagePositions[p.icon.name],n.get("icon-offset").evaluate(p,{},t.canonical),n.get("icon-anchor").evaluate(p,{},t.canonical)),v=!!_.sdf,t.bucket.sdfIcons===void 0?t.bucket.sdfIcons=v:t.bucket.sdfIcons!==v&&ye("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),(_.pixelRatio!==t.bucket.pixelRatio||n.get("icon-rotate").constantOr(1)!==0)&&(t.bucket.iconsNeedLinear=!0))}let S=sy(d.horizontal)||d.vertical;t.bucket.iconsInText=S?S.iconsInText:!1,(S||P)&&Mx(t.bucket,p,d,P,t.imageMap,o,m,h,b,v,t.canonical,t.subdivisionGranularity)}t.showCollisionBoxes&&t.bucket.generateCollisionDebugBuffers()}l(ay,"performSymbolLayout");function iy(t){switch(t){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}l(iy,"getAnchorJustification");function Mx(t,e,r,n,i,o,a,s,u,c,p,f){let y=o.textMaxSize.evaluate(e,{});y===void 0&&(y=a);let m=t.layers[0].layout,h=m.get("icon-offset").evaluate(e,{},p),d=sy(r.horizontal),x=24,b=a/x,P=t.tilePixelRatio*b,v=t.tilePixelRatio*y/x,S=t.tilePixelRatio*s,_=t.tilePixelRatio*m.get("symbol-spacing"),T=m.get("text-padding")*t.tilePixelRatio,I=zf(m,e,p,t.tilePixelRatio),F=m.get("text-max-angle")/180*Math.PI,D=m.get("text-rotation-alignment")!=="viewport"&&m.get("symbol-placement")!=="point",R=m.get("icon-rotation-alignment")==="map"&&m.get("symbol-placement")!=="point",z=m.get("symbol-placement"),N=_/2,B=m.get("icon-text-fit"),C;n&&B!=="none"&&(t.allowVerticalPlacement&&r.vertical&&(C=Tl(n,r.vertical,B,m.get("icon-text-fit-padding"),h,b)),d&&(n=Tl(n,d,B,m.get("icon-text-fit-padding"),h,b)));let O=p?f.line.getGranularityForZoomLevel(p.z):1,$=l((U,G)=>{G.x<0||G.x>=8192||G.y<0||G.y>=8192||Dx(t,G,U,r,n,i,C,t.layers[0],t.collisionBoxArray,e.index,e.sourceLayerIndex,t.index,P,[T,T,T,T],D,u,S,I,R,h,e,o,c,p,a)},"addSymbolAtAnchor");if(z==="line")for(let U of ey(e.geometry,0,0,8192,8192)){let G=tt(U,O),te=Kf(G,_,F,r.vertical||d,n,x,v,t.overscaling,8192);for(let J of te){let oe=d;(!oe||!Bx(t,oe.text,N,J))&&$(G,J)}}else if(z==="line-center"){for(let U of e.geometry)if(U.length>1){let G=tt(U,O),te=Yf(G,F,r.vertical||d,n,x,v);te&&$(G,te)}}else if(e.type==="Polygon")for(let U of er(e.geometry,0)){let G=ny(U,16),te=tt(U[0],O,!0);$(te,new nt(G.x,G.y,0))}else if(e.type==="LineString")for(let U of e.geometry){let G=tt(U,O);$(G,new nt(G[0].x,G[0].y,0))}else if(e.type==="Point")for(let U of e.geometry)for(let G of U)$([G],new nt(G.x,G.y,0))}l(Mx,"addFeature");function Lx(t,e){let r=t.length,n=e?.values;if(n?.length>0)for(let i=0;i<n.length;i+=2){let o=Ll[n[i]],a=n[i+1];t.emplaceBack(o,a[0],a[1])}return[r,t.length]}l(Lx,"addTextVariableAnchorOffsets");function oy(t,e,r,n,i,o,a,s,u,c,p,f,y,m,h){let d=ry(e,r,s,i,o,a,n,t.allowVerticalPlacement),x=t.textSizeData,b=null;x.kind==="source"?(b=[Nt*i.layout.get("text-size").evaluate(a,{})],b[0]>rt&&ye(`${t.layerIds[0]}: Value for "text-size" is >= ${jr}. Reduce your "text-size".`)):x.kind==="composite"&&(b=[Nt*m.compositeTextSizes[0].evaluate(a,{},h),Nt*m.compositeTextSizes[1].evaluate(a,{},h)],(b[0]>rt||b[1]>rt)&&ye(`${t.layerIds[0]}: Value for "text-size" is >= ${jr}. Reduce your "text-size".`)),t.addSymbols(t.text,d,b,s,o,a,c,e,u.lineStartIndex,u.lineLength,y,h);for(let P of p)f[P]=t.text.placedSymbolArray.length-1;return d.length*4}l(oy,"addTextVertices");function sy(t){for(let e in t)return t[e];return null}l(sy,"getDefaultHorizontalShaping");function Dx(t,e,r,n,i,o,a,s,u,c,p,f,y,m,h,d,x,b,P,v,S,_,T,I,F){let D=t.addToLineVertexArray(e,r),R,z,N,B,C=0,O=0,$=0,U=0,G=-1,te=-1,J={},oe=(0,Vl.default)("");if(t.allowVerticalPlacement&&n.vertical){let Se=s.layout.get("text-rotate").evaluate(S,{},I)+90,ot=n.vertical;N=new dr(u,e,c,p,f,ot,y,m,h,Se),a&&(B=new dr(u,e,c,p,f,a,x,b,h,Se))}if(i){let Fe=s.layout.get("icon-rotate").evaluate(S,{}),Se=s.layout.get("icon-text-fit")!=="none",ot=El(i,Fe,T,Se),St=a?El(a,Fe,T,Se):void 0;z=new dr(u,e,c,p,f,i,x,b,!1,Fe),C=ot.length*4;let Kr=t.iconSizeData,ze=null;Kr.kind==="source"?(ze=[Nt*s.layout.get("icon-size").evaluate(S,{})],ze[0]>rt&&ye(`${t.layerIds[0]}: Value for "icon-size" is >= ${jr}. Reduce your "icon-size".`)):Kr.kind==="composite"&&(ze=[Nt*_.compositeIconSizes[0].evaluate(S,{},I),Nt*_.compositeIconSizes[1].evaluate(S,{},I)],(ze[0]>rt||ze[1]>rt)&&ye(`${t.layerIds[0]}: Value for "icon-size" is >= ${jr}. Reduce your "icon-size".`)),t.addSymbols(t.icon,ot,ze,v,P,S,0,e,D.lineStartIndex,D.lineLength,-1,I),G=t.icon.placedSymbolArray.length-1,St&&(O=St.length*4,t.addSymbols(t.icon,St,ze,v,P,S,2,e,D.lineStartIndex,D.lineLength,-1,I),te=t.icon.placedSymbolArray.length-1)}let ge=Object.keys(n.horizontal);for(let Fe of ge){let Se=n.horizontal[Fe];if(!R){oe=(0,Vl.default)(Se.text);let St=s.layout.get("text-rotate").evaluate(S,{},I);R=new dr(u,e,c,p,f,Se,y,m,h,St)}let ot=Se.positionedLines.length===1;if($+=oy(t,e,Se,o,s,h,S,d,D,n.vertical?1:3,ot?ge:[Fe],J,G,_,I),ot)break}n.vertical&&(U+=oy(t,e,n.vertical,o,s,h,S,d,D,2,["vertical"],J,te,_,I));let qt=R?R.boxStartIndex:t.collisionBoxArray.length,it=R?R.boxEndIndex:t.collisionBoxArray.length,vt=N?N.boxStartIndex:t.collisionBoxArray.length,$i=N?N.boxEndIndex:t.collisionBoxArray.length,ji=z?z.boxStartIndex:t.collisionBoxArray.length,qi=z?z.boxEndIndex:t.collisionBoxArray.length,Wi=B?B.boxStartIndex:t.collisionBoxArray.length,ss=B?B.boxEndIndex:t.collisionBoxArray.length,ke=-1,Pt=l((Fe,Se)=>Fe&&Fe.circleDiameter?Math.max(Fe.circleDiameter,Se):Se,"getCollisionCircleHeight");ke=Pt(R,ke),ke=Pt(N,ke),ke=Pt(z,ke),ke=Pt(B,ke);let Yr=ke>-1?1:0;Yr&&(ke*=F/ue),t.glyphOffsetArray.length>=Je.MAX_GLYPHS&&ye("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),S.sortKey!==void 0&&t.addToSortKeyRanges(t.symbolInstances.length,S.sortKey);let ls=Bl(s,S,I),[Xi,us]=Lx(t.textAnchorOffsets,ls);t.symbolInstances.emplaceBack(e.x,e.y,J.right>=0?J.right:-1,J.center>=0?J.center:-1,J.left>=0?J.left:-1,J.vertical||-1,G,te,oe,qt,it,vt,$i,ji,qi,Wi,ss,c,$,U,C,O,Yr,0,y,ke,Xi,us)}l(Dx,"addSymbol");function Bx(t,e,r,n){let i=t.compareText;if(!(e in i))i[e]=[];else{let o=i[e];for(let a=o.length-1;a>=0;a--)if(n.dist(o[a])<r)return!0}return i[e].push(n),!1}l(Bx,"anchorIsTooClose");g();var Xa=1,Ei=class{static{l(this,"GlyphAtlas")}constructor(e){let r={},n=[];for(let s in e){let u=e[s],c=r[s]={};for(let p in u){let f=u[+p];if(!f||f.bitmap.width===0||f.bitmap.height===0)continue;let y={x:0,y:0,w:f.bitmap.width+2*Xa,h:f.bitmap.height+2*Xa};n.push(y),c[p]={rect:y,metrics:f.metrics}}}let{w:i,h:o}=bi(n),a=new cr({width:i||1,height:o||1});for(let s in e){let u=e[s];for(let c in u){let p=u[+c];if(!p||p.bitmap.width===0||p.bitmap.height===0)continue;let f=r[s][c].rect;cr.copy(p.bitmap,a,{x:0,y:0},{x:f.x+Xa,y:f.y+Xa},p.bitmap)}}this.image=a,this.positions=r}};k("GlyphAtlas",Ei);g();g();function uy(t,e,r){e=Math.pow(2,r)-e-1;var n=ly(t*256,e*256,r),i=ly((t+1)*256,(e+1)*256,r);return n[0]+","+n[1]+","+i[0]+","+i[1]}l(uy,"getTileBBox");function ly(t,e,r){var n=2*Math.PI*6378137/256/Math.pow(2,r),i=t*n-2*Math.PI*6378137/2,o=e*n-2*Math.PI*6378137/2;return[i,o]}l(ly,"getMercCoords");var yy=ee(de(),1);g();g();var Rl=63710088e-1,Mi=class t{static{l(this,"LngLat")}constructor(e,r){if(isNaN(e)||isNaN(r))throw new Error(`Invalid LngLat object: (${e}, ${r})`);if(this.lng=+e,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 t(_u(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(e){let r=Math.PI/180,n=this.lat*r,i=e.lat*r,o=Math.sin(n)*Math.sin(i)+Math.cos(n)*Math.cos(i)*Math.cos((e.lng-this.lng)*r);return Rl*Math.acos(Math.min(o,1))}static convert(e){if(e instanceof t)return e;if(Array.isArray(e)&&(e.length===2||e.length===3))return new t(Number(e[0]),Number(e[1]));if(!Array.isArray(e)&&typeof e=="object"&&e!==null)return new t(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>]")}};var cy=2*Math.PI*Rl;function py(t){return cy*Math.cos(t*Math.PI/180)}l(py,"circumferenceAtLatitude");function Vx(t){return(180+t)/360}l(Vx,"mercatorXfromLng");function Rx(t){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))/360}l(Rx,"mercatorYfromLat");function zx(t,e){return t/py(e)}l(zx,"mercatorZfromAltitude");function Ox(t){return t*360-180}l(Ox,"lngFromMercatorX");function zl(t){let e=180-t*360;return 360/Math.PI*Math.atan(Math.exp(e*Math.PI/180))-90}l(zl,"latFromMercatorY");function Gx(t,e){return t*py(zl(e))}l(Gx,"altitudeFromMercatorZ");function Nx(t){return 1/Math.cos(t*Math.PI/180)}l(Nx,"mercatorScale");var Li=class t{static{l(this,"MercatorCoordinate")}constructor(e,r,n=0){this.x=+e,this.y=+r,this.z=+n}static fromLngLat(e,r=0){let n=Mi.convert(e);return new t(Vx(n.lng),Rx(n.lat),zx(r,n.lat))}toLngLat(){return new Mi(Ox(this.x),zl(this.y))}toAltitude(){return Gx(this.z,this.y)}meterInMercatorCoordinateUnits(){return 1/cy*Nx(zl(this.y))}};g();function fy(t,e,r){return!(t<Ki||t>Yi||r<0||r>=Math.pow(2,t)||e<0||e>=Math.pow(2,t))}l(fy,"isInBoundsForTileZoomXY");var Ha=class{static{l(this,"CanonicalTileID")}constructor(e,r,n){if(!fy(e,r,n))throw new Error(`x=${r}, y=${n}, z=${e} outside of bounds. 0<=x<${Math.pow(2,e)}, 0<=y<${Math.pow(2,e)} ${Ki}<=z<=${Yi} `);this.z=e,this.x=r,this.y=n,this.key=Di(0,e,e,r,n)}equals(e){return this.z===e.z&&this.x===e.x&&this.y===e.y}url(e,r,n){let i=uy(this.x,this.y,this.z),o=Ux(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(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(e){let r=this.z-e.z;return r>0&&e.x===this.x>>r&&e.y===this.y>>r}getTilePoint(e){let r=Math.pow(2,this.z);return new yy.default((e.x*r-this.x)*8192,(e.y*r-this.y)*8192)}toString(){return`${this.z}/${this.x}/${this.y}`}},Ol=class{static{l(this,"UnwrappedTileID")}constructor(e,r){this.wrap=e,this.canonical=r,this.key=Di(e,r.z,r.z,r.x,r.y)}},Bi=class t{constructor(e,r,n,i,o){this.terrainRttPosMatrix32f=null;if(e<n)throw new Error(`overscaledZ should be >= z; overscaledZ = ${e}; z = ${n}`);this.overscaledZ=e,this.wrap=r,this.canonical=new Ha(n,+i,+o),this.key=Di(r,e,n,i,o)}static{l(this,"OverscaledTileID")}clone(){return new t(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 = ${e}; overscaledZ = ${this.overscaledZ}`);let r=this.canonical.z-e;return e>this.canonical.z?new t(e,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new t(e,this.wrap,e,this.canonical.x>>r,this.canonical.y>>r)}calculateScaledKey(e,r){if(e>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${e}; overscaledZ = ${this.overscaledZ}`);let n=this.canonical.z-e;return e>this.canonical.z?Di(this.wrap*+r,e,this.canonical.z,this.canonical.x,this.canonical.y):Di(this.wrap*+r,e,e,this.canonical.x>>n,this.canonical.y>>n)}isChildOf(e){if(e.wrap!==this.wrap)return!1;let r=this.canonical.z-e.canonical.z;return e.overscaledZ===0||e.overscaledZ<this.overscaledZ&&e.canonical.x===this.canonical.x>>r&&e.canonical.y===this.canonical.y>>r}children(e){if(this.overscaledZ>=e)return[new t(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 t(r,this.wrap,r,n,i),new t(r,this.wrap,r,n+1,i),new t(r,this.wrap,r,n,i+1),new t(r,this.wrap,r,n+1,i+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 t(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)}unwrapTo(e){return new t(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 Ol(this.wrap,this.canonical)}toString(){return`${this.overscaledZ}/${this.canonical.x}/${this.canonical.y}`}getTilePoint(e){return this.canonical.getTilePoint(new Li(e.x-this.wrap,e.y))}};function Di(t,e,r,n,i){t*=2,t<0&&(t=t*-1-1);let o=1<<r;return(o*o*t+o*i+n).toString(36)+r.toString(36)+e.toString(36)}l(Di,"calculateTileKey");function Ux(t,e,r){let n="",i;for(let o=t;o>0;o--)i=1<<o-1,n+=(e&i?1:0)+(r&i?2:0);return n}l(Ux,"getQuadkey");k("CanonicalTileID",Ha);k("OverscaledTileID",Bi,{omit:["terrainRttPosMatrix32f"]});var Za=class{static{l(this,"WorkerTile")}constructor(e){this.tileID=new Bi(e.tileID.overscaledZ,e.tileID.wrap,e.tileID.canonical.z,e.tileID.canonical.x,e.tileID.canonical.y),this.uid=e.uid,this.zoom=e.zoom,this.pixelRatio=e.pixelRatio,this.tileSize=e.tileSize,this.source=e.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=e.showCollisionBoxes,this.collectResourceTiming=!!e.collectResourceTiming,this.returnDependencies=!!e.returnDependencies,this.promoteId=e.promoteId,this.inFlightDependencies=[],this.globalState=e.globalState}async parse(e,r,n,i,o){this.status="parsing",this.data=e,this.collisionBoxArray=new Xn;let a=new qr(Object.keys(e.layers).sort()),s=new Ci(this.tileID,this.promoteId);s.bucketLayerIDs=[];let u={},c={featureIndex:s,iconDependencies:{},patternDependencies:{},glyphDependencies:{},availableImages:n,subdivisionGranularity:o},p=r.familiesBySource[this.source];for(let T in p){let I=e.layers[T];if(!I)continue;I.version===1&&ye(`Vector tile source "${this.source}" layer "${T}" does not use vector tile spec v2 and therefore may have some rendering errors.`);let F=a.encode(T),D=[];for(let R=0;R<I.length;R++){let z=I.feature(R),N=s.getId(z,T);D.push({feature:z,id:N,index:R,sourceLayerIndex:F})}for(let R of p[T]){let z=R[0];if(z.source!==this.source&&ye(`layer.source = ${z.source} does not equal this.source = ${this.source}`),z.minzoom&&this.zoom<Math.floor(z.minzoom)||z.maxzoom&&this.zoom>=z.maxzoom||z.visibility==="none")continue;Gl(R,this.zoom,n),(u[z.id]=z.createBucket({index:s.bucketLayerIDs.length,layers:R,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:F,sourceID:this.source,globalState:this.globalState})).populate(D,c,this.tileID.canonical),s.bucketLayerIDs.push(R.map(B=>B.id))}}let f=on(c.glyphDependencies,T=>Object.keys(T).map(Number));this.inFlightDependencies.forEach(T=>T?.abort()),this.inFlightDependencies=[];let y=Promise.resolve({});if(Object.keys(f).length){let T=new AbortController;this.inFlightDependencies.push(T),y=i.sendAsync({type:"GG",data:{stacks:f,source:this.source,tileID:this.tileID,type:"glyphs"}},T)}let m=Object.keys(c.iconDependencies),h=Promise.resolve({});if(m.length){let T=new AbortController;this.inFlightDependencies.push(T),h=i.sendAsync({type:"GI",data:{icons:m,source:this.source,tileID:this.tileID,type:"icons"}},T)}let d=Object.keys(c.patternDependencies),x=Promise.resolve({});if(d.length){let T=new AbortController;this.inFlightDependencies.push(T),x=i.sendAsync({type:"GI",data:{icons:d,source:this.source,tileID:this.tileID,type:"patterns"}},T)}let[b,P,v]=await Promise.all([y,h,x]),S=new Ei(b),_=new xi(P,v);for(let T in u){let I=u[T];I instanceof Je?(Gl(I.layers,this.zoom,n),ay({bucket:I,glyphMap:b,glyphPositions:S.positions,imageMap:P,imagePositions:_.iconPositions,showCollisionBoxes:this.showCollisionBoxes,canonical:this.tileID.canonical,subdivisionGranularity:c.subdivisionGranularity})):I.hasPattern&&(I instanceof mr||I instanceof fr||I instanceof yr)&&(Gl(I.layers,this.zoom,n),I.addFeatures(c,this.tileID.canonical,_.patternPositions))}return this.status="done",{buckets:Object.values(u).filter(T=>!T.isEmpty()),featureIndex:s,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:S.image,imageAtlas:_,glyphMap:this.returnDependencies?b:null,iconMap:this.returnDependencies?P:null,glyphPositions:this.returnDependencies?S.positions:null}}};function Gl(t,e,r){let n=new Z(e);for(let i of t)i.recalculate(n,r)}l(Gl,"recalculateLayers");g();var $x=60,AE=1e3/$x;var Hr=class{static{l(this,"RequestPerformance")}constructor(e){this._marks={start:[e.url,"start"].join("#"),end:[e.url,"end"].join("#"),measure:e.url.toString()},performance.mark(this._marks.start)}finish(){performance.mark(this._marks.end);let e=performance.getEntriesByName(this._marks.measure);return e.length===0&&(performance.measure(this._marks.measure,this._marks.start,this._marks.end),e=performance.getEntriesByName(this._marks.measure),performance.clearMarks(this._marks.start),performance.clearMarks(this._marks.end),performance.clearMeasures(this._marks.measure)),e}};var Zr=class{static{l(this,"VectorTileWorkerSource")}constructor(e,r,n){this.actor=e,this.layerIndex=r,this.availableImages=n,this.fetching={},this.loading={},this.loaded={}}async loadVectorTile(e,r){let n=await jc(e.request,r);try{return{vectorTile:new my.default.VectorTile(new hy.default(n.data)),rawData:n.data,cacheControl:n.cacheControl,expires:n.expires}}catch(i){let o=new Uint8Array(n.data),a=o[0]===31&&o[1]===139,s=`Unable to parse the tile at ${e.request.url}, `;throw a?s+="please make sure the data is not gzipped and that you have configured the relevant header in the server":s+=`got error: ${i.message}`,new Error(s)}}async loadTile(e){let r=e.uid,n=e&&e.request&&e.request.collectResourceTiming?new Hr(e.request):!1,i=new Za(e);this.loading[r]=i;let o=new AbortController;i.abort=o;try{let a=await this.loadVectorTile(e,o);if(delete this.loading[r],!a)return null;let s=a.rawData,u={};a.expires&&(u.expires=a.expires),a.cacheControl&&(u.cacheControl=a.cacheControl);let c={};if(n){let f=n.finish();f&&(c.resourceTiming=JSON.parse(JSON.stringify(f)))}i.vectorTile=a.vectorTile;let p=i.parse(a.vectorTile,this.layerIndex,this.availableImages,this.actor,e.subdivisionGranularity);this.loaded[r]=i,this.fetching[r]={rawTileData:s,cacheControl:u,resourceTiming:c};try{let f=await p;return xe({rawTileData:s.slice(0)},f,u,c)}finally{delete this.fetching[r]}}catch(a){throw delete this.loading[r],i.status="done",this.loaded[r]=i,a}}async reloadTile(e){let r=e.uid;if(!this.loaded||!this.loaded[r])throw new Error("Should not be trying to reload a tile that was never loaded or has been removed");let n=this.loaded[r];if(n.showCollisionBoxes=e.showCollisionBoxes,n.globalState=e.globalState,n.status==="parsing"){let i=await n.parse(n.vectorTile,this.layerIndex,this.availableImages,this.actor,e.subdivisionGranularity),o;if(this.fetching[r]){let{rawTileData:a,cacheControl:s,resourceTiming:u}=this.fetching[r];delete this.fetching[r],o=xe({rawTileData:a.slice(0)},i,s,u)}else o=i;return o}if(n.status==="done"&&n.vectorTile)return n.parse(n.vectorTile,this.layerIndex,this.availableImages,this.actor,e.subdivisionGranularity)}async abortTile(e){let r=this.loading,n=e.uid;r&&r[n]&&r[n].abort&&(r[n].abort.abort(),delete r[n])}async removeTile(e){this.loaded&&this.loaded[e.uid]&&delete this.loaded[e.uid]}};g();var Ja=class{static{l(this,"RasterDEMTileWorkerSource")}constructor(){this.loaded={}}async loadTile(e){let{uid:r,encoding:n,rawImageData:i,redFactor:o,greenFactor:a,blueFactor:s,baseShift:u}=e,c=i.width+2,p=i.height+2,f=wt(i)?new he({width:c,height:p},await Cu(i,-1,-1,c,p)):i,y=new si(r,f,n,o,a,s,u);return this.loaded=this.loaded||{},this.loaded[r]=y,y}removeTile(e){let r=this.loaded,n=e.uid;r&&r[n]&&delete r[n]}};g();var Uy=ee(xy(),1);g();var Nl=ee(de(),1),vy=ee(Gt(),1);var jx=vy.default.VectorTileFeature.prototype.toGeoJSON,Ul=class{static{l(this,"FeatureWrapper")}constructor(e){this._feature=e,this.extent=8192,this.type=e.type,this.properties=e.tags,"id"in e&&!isNaN(e.id)&&(this.id=parseInt(e.id,10))}loadGeometry(){if(this._feature.type===1){let e=[];for(let r of this._feature.geometry)e.push([new Nl.default(r[0],r[1])]);return e}else{let e=[];for(let r of this._feature.geometry){let n=[];for(let i of r)n.push(new Nl.default(i[0],i[1]));e.push(n)}return e}}toGeoJSON(e,r,n){return jx.call(this,e,r,n)}},Ka=class{static{l(this,"GeoJSONWrapper")}constructor(e){this.layers={_geojsonTileLayer:this},this.name="_geojsonTileLayer",this.extent=8192,this.length=e.length,this._features=e}feature(e){return new Ul(this._features[e])}};var $y=ee(Iy(),1);g();g();var Ty=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],ql=1,Ri=8,Oi=class t{static{l(this,"KDBush")}static from(e){if(!(e instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");let[r,n]=new Uint8Array(e,0,2);if(r!==219)throw new Error("Data does not appear to be in a KDBush format.");let i=n>>4;if(i!==ql)throw new Error(`Got v${i} data when expected v${ql}.`);let o=Ty[n&15];if(!o)throw new Error("Unrecognized array type.");let[a]=new Uint16Array(e,2,1),[s]=new Uint32Array(e,4,1);return new t(s,a,o,e)}constructor(e,r=64,n=Float64Array,i){if(isNaN(e)||e<0)throw new Error(`Unpexpected numItems value: ${e}.`);this.numItems=+e,this.nodeSize=Math.min(Math.max(+r,2),65535),this.ArrayType=n,this.IndexArrayType=e<65536?Uint16Array:Uint32Array;let o=Ty.indexOf(this.ArrayType),a=e*2*this.ArrayType.BYTES_PER_ELEMENT,s=e*this.IndexArrayType.BYTES_PER_ELEMENT,u=(8-s%8)%8;if(o<0)throw new Error(`Unexpected typed array class: ${n}.`);i&&i instanceof ArrayBuffer?(this.data=i,this.ids=new this.IndexArrayType(this.data,Ri,e),this.coords=new this.ArrayType(this.data,Ri+s+u,e*2),this._pos=e*2,this._finished=!0):(this.data=new ArrayBuffer(Ri+a+s+u),this.ids=new this.IndexArrayType(this.data,Ri,e),this.coords=new this.ArrayType(this.data,Ri+s+u,e*2),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,(ql<<4)+o]),new Uint16Array(this.data,2,1)[0]=r,new Uint32Array(this.data,4,1)[0]=e)}add(e,r){let n=this._pos>>1;return this.ids[n]=n,this.coords[this._pos++]=e,this.coords[this._pos++]=r,n}finish(){let e=this._pos>>1;if(e!==this.numItems)throw new Error(`Added ${e} items when expected ${this.numItems}.`);return Xl(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(e,r,n,i){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");let{ids:o,coords:a,nodeSize:s}=this,u=[0,o.length-1,0],c=[];for(;u.length;){let p=u.pop()||0,f=u.pop()||0,y=u.pop()||0;if(f-y<=s){for(let x=y;x<=f;x++){let b=a[2*x],P=a[2*x+1];b>=e&&b<=n&&P>=r&&P<=i&&c.push(o[x])}continue}let m=y+f>>1,h=a[2*m],d=a[2*m+1];h>=e&&h<=n&&d>=r&&d<=i&&c.push(o[m]),(p===0?e<=h:r<=d)&&(u.push(y),u.push(m-1),u.push(1-p)),(p===0?n>=h:i>=d)&&(u.push(m+1),u.push(f),u.push(1-p))}return c}within(e,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],u=[],c=n*n;for(;s.length;){let p=s.pop()||0,f=s.pop()||0,y=s.pop()||0;if(f-y<=a){for(let x=y;x<=f;x++)Cy(o[2*x],o[2*x+1],e,r)<=c&&u.push(i[x]);continue}let m=y+f>>1,h=o[2*m],d=o[2*m+1];Cy(h,d,e,r)<=c&&u.push(i[m]),(p===0?e-n<=h:r-n<=d)&&(s.push(y),s.push(m-1),s.push(1-p)),(p===0?e+n>=h:r+n>=d)&&(s.push(m+1),s.push(f),s.push(1-p))}return u}};function Xl(t,e,r,n,i,o){if(i-n<=r)return;let a=n+i>>1;ky(t,e,a,n,i,o),Xl(t,e,r,n,a-1,1-o),Xl(t,e,r,a+1,i,1-o)}l(Xl,"sort");function ky(t,e,r,n,i,o){for(;i>n;){if(i-n>600){let c=i-n+1,p=r-n+1,f=Math.log(c),y=.5*Math.exp(2*f/3),m=.5*Math.sqrt(f*y*(c-y)/c)*(p-c/2<0?-1:1),h=Math.max(n,Math.floor(r-p*y/c+m)),d=Math.min(i,Math.floor(r+(c-p)*y/c+m));ky(t,e,r,h,d,o)}let a=e[2*r+o],s=n,u=i;for(zi(t,e,n,r),e[2*i+o]>a&&zi(t,e,n,i);s<u;){for(zi(t,e,s,u),s++,u--;e[2*s+o]<a;)s++;for(;e[2*u+o]>a;)u--}e[2*n+o]===a?zi(t,e,n,u):(u++,zi(t,e,u,i)),u<=r&&(n=u+1),r<=u&&(i=u-1)}}l(ky,"select");function zi(t,e,r,n){Wl(t,r,n),Wl(e,2*r,2*n),Wl(e,2*r+1,2*n+1)}l(zi,"swapItem");function Wl(t,e,r){let n=t[e];t[e]=t[r],t[r]=n}l(Wl,"swap");function Cy(t,e,r,n){let i=t-r,o=e-n;return i*i+o*o}l(Cy,"sqDist");var t0={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:l(t=>t,"map")},Fy=Math.fround||(t=>e=>(t[0]=+e,t[0]))(new Float32Array(1)),gr=2,jt=3,Hl=4,$t=5,My=6,Gi=class{static{l(this,"Supercluster")}constructor(e){this.options=Object.assign(Object.create(t0),e),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(e){let{log:r,minZoom:n,maxZoom:i}=this.options;r&&console.time("total time");let o=`prepare ${e.length} points`;r&&console.time(o),this.points=e;let a=[];for(let u=0;u<e.length;u++){let c=e[u];if(!c.geometry)continue;let[p,f]=c.geometry.coordinates,y=Fy(es(p)),m=Fy(ts(f));a.push(y,m,1/0,u,-1,1),this.options.reduce&&a.push(0)}let s=this.trees[i+1]=this._createTree(a);r&&console.timeEnd(o);for(let u=i;u>=n;u--){let c=+Date.now();s=this.trees[u]=this._createTree(this._cluster(s,u)),r&&console.log("z%d: %d clusters in %dms",u,s.numItems,+Date.now()-c)}return r&&console.timeEnd("total time"),this}getClusters(e,r){let n=((e[0]+180)%360+360)%360-180,i=Math.max(-90,Math.min(90,e[1])),o=e[2]===180?180:((e[2]+180)%360+360)%360-180,a=Math.max(-90,Math.min(90,e[3]));if(e[2]-e[0]>=360)n=-180,o=180;else if(n>o){let f=this.getClusters([n,i,180,a],r),y=this.getClusters([-180,i,o,a],r);return f.concat(y)}let s=this.trees[this._limitZoom(r)],u=s.range(es(n),ts(a),es(o),ts(i)),c=s.data,p=[];for(let f of u){let y=this.stride*f;p.push(c[y+$t]>1?Ey(c,y,this.clusterProps):this.points[c[y+jt]])}return p}getChildren(e){let r=this._getOriginId(e),n=this._getOriginZoom(e),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)),u=a[r*this.stride],c=a[r*this.stride+1],p=o.within(u,c,s),f=[];for(let y of p){let m=y*this.stride;a[m+Hl]===e&&f.push(a[m+$t]>1?Ey(a,m,this.clusterProps):this.points[a[m+jt]])}if(f.length===0)throw new Error(i);return f}getLeaves(e,r,n){r=r||10,n=n||0;let i=[];return this._appendLeaves(i,e,r,n,0),i}getTile(e,r,n){let i=this.trees[this._limitZoom(e)],o=Math.pow(2,e),{extent:a,radius:s}=this.options,u=s/a,c=(n-u)/o,p=(n+1+u)/o,f={features:[]};return this._addTileFeatures(i.range((r-u)/o,c,(r+1+u)/o,p),i.data,r,n,o,f),r===0&&this._addTileFeatures(i.range(1-u/o,c,1,p),i.data,o,n,o,f),r===o-1&&this._addTileFeatures(i.range(0,c,u/o,p),i.data,-1,n,o,f),f.features.length?f:null}getClusterExpansionZoom(e){let r=this._getOriginZoom(e)-1;for(;r<=this.options.maxZoom;){let n=this.getChildren(e);if(r++,n.length!==1)break;e=n[0].properties.cluster_id}return r}_appendLeaves(e,r,n,i,o){let a=this.getChildren(r);for(let s of a){let u=s.properties;if(u&&u.cluster?o+u.point_count<=i?o+=u.point_count:o=this._appendLeaves(e,u.cluster_id,n,i,o):o<i?o++:e.push(s),e.length===n)break}return o}_createTree(e){let r=new Oi(e.length/this.stride|0,this.options.nodeSize,Float32Array);for(let n=0;n<e.length;n+=this.stride)r.add(e[n],e[n+1]);return r.finish(),r.data=e,r}_addTileFeatures(e,r,n,i,o,a){for(let s of e){let u=s*this.stride,c=r[u+$t]>1,p,f,y;if(c)p=Ly(r,u,this.clusterProps),f=r[u],y=r[u+1];else{let d=this.points[r[u+jt]];p=d.properties;let[x,b]=d.geometry.coordinates;f=es(x),y=ts(b)}let m={type:1,geometry:[[Math.round(this.options.extent*(f*o-n)),Math.round(this.options.extent*(y*o-i))]],tags:p},h;c||this.options.generateId?h=r[u+jt]:h=this.points[r[u+jt]].id,h!==void 0&&(m.id=h),a.features.push(m)}}_limitZoom(e){return Math.max(this.options.minZoom,Math.min(Math.floor(+e),this.options.maxZoom+1))}_cluster(e,r){let{radius:n,extent:i,reduce:o,minPoints:a}=this.options,s=n/(i*Math.pow(2,r)),u=e.data,c=[],p=this.stride;for(let f=0;f<u.length;f+=p){if(u[f+gr]<=r)continue;u[f+gr]=r;let y=u[f],m=u[f+1],h=e.within(u[f],u[f+1],s),d=u[f+$t],x=d;for(let b of h){let P=b*p;u[P+gr]>r&&(x+=u[P+$t])}if(x>d&&x>=a){let b=y*d,P=m*d,v,S=-1,_=((f/p|0)<<5)+(r+1)+this.points.length;for(let T of h){let I=T*p;if(u[I+gr]<=r)continue;u[I+gr]=r;let F=u[I+$t];b+=u[I]*F,P+=u[I+1]*F,u[I+Hl]=_,o&&(v||(v=this._map(u,f,!0),S=this.clusterProps.length,this.clusterProps.push(v)),o(v,this._map(u,I)))}u[f+Hl]=_,c.push(b/x,P/x,1/0,_,-1,x),o&&c.push(S)}else{for(let b=0;b<p;b++)c.push(u[f+b]);if(x>1)for(let b of h){let P=b*p;if(!(u[P+gr]<=r)){u[P+gr]=r;for(let v=0;v<p;v++)c.push(u[P+v])}}}}return c}_getOriginId(e){return e-this.points.length>>5}_getOriginZoom(e){return(e-this.points.length)%32}_map(e,r,n){if(e[r+$t]>1){let a=this.clusterProps[e[r+My]];return n?Object.assign({},a):a}let i=this.points[e[r+jt]].properties,o=this.options.map(i);return n&&o===i?Object.assign({},o):o}};function Ey(t,e,r){return{type:"Feature",id:t[e+jt],properties:Ly(t,e,r),geometry:{type:"Point",coordinates:[r0(t[e]),n0(t[e+1])]}}}l(Ey,"getClusterJSON");function Ly(t,e,r){let n=t[e+$t],i=n>=1e4?`${Math.round(n/1e3)}k`:n>=1e3?`${Math.round(n/100)/10}k`:n,o=t[e+My],a=o===-1?{}:Object.assign({},r[o]);return Object.assign(a,{cluster:!0,cluster_id:t[e+jt],point_count:n,point_count_abbreviated:i})}l(Ly,"getClusterProperties");function es(t){return t/360+.5}l(es,"lngX");function ts(t){let e=Math.sin(t*Math.PI/180),r=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return r<0?0:r>1?1:r}l(ts,"latY");function r0(t){return(t-.5)*360}l(r0,"xLng");function n0(t){let e=(180-t*360)*Math.PI/180;return 360*Math.atan(Math.exp(e))/Math.PI-90}l(n0,"yLat");g();g();g();function Ni(t,e,r,n){let i=n,o=e+(r-e>>1),a=r-e,s,u=t[e],c=t[e+1],p=t[r],f=t[r+1];for(let y=e+3;y<r;y+=3){let m=i0(t[y],t[y+1],u,c,p,f);if(m>i)s=y,i=m;else if(m===i){let h=Math.abs(y-o);h<a&&(s=y,a=h)}}i>n&&(s-e>3&&Ni(t,e,s,n),t[s+2]=i,r-s>3&&Ni(t,s,r,n))}l(Ni,"simplify");function i0(t,e,r,n,i,o){let a=i-r,s=o-n;if(a!==0||s!==0){let u=((t-r)*a+(e-n)*s)/(a*a+s*s);u>1?(r=i,n=o):u>0&&(r+=a*u,n+=s*u)}return a=t-r,s=e-n,a*a+s*s}l(i0,"getSqSegDist");g();function xt(t,e,r,n){let i={id:t??null,type:e,geometry:r,tags:n,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};if(e==="Point"||e==="MultiPoint"||e==="LineString")rs(i,r);else if(e==="Polygon")rs(i,r[0]);else if(e==="MultiLineString")for(let o of r)rs(i,o);else if(e==="MultiPolygon")for(let o of r)rs(i,o[0]);return i}l(xt,"createFeature");function rs(t,e){for(let r=0;r<e.length;r+=3)t.minX=Math.min(t.minX,e[r]),t.minY=Math.min(t.minY,e[r+1]),t.maxX=Math.max(t.maxX,e[r]),t.maxY=Math.max(t.maxY,e[r+1])}l(rs,"calcLineBBox");function Yl(t,e){let r=[];if(t.type==="FeatureCollection")for(let n=0;n<t.features.length;n++)ns(r,t.features[n],e,n);else t.type==="Feature"?ns(r,t,e):ns(r,{geometry:t},e);return r}l(Yl,"convert");function ns(t,e,r,n){if(!e.geometry)return;let i=e.geometry.coordinates;if(i&&i.length===0)return;let o=e.geometry.type,a=Math.pow(r.tolerance/((1<<r.maxZoom)*r.extent),2),s=[],u=e.id;if(r.promoteId?u=e.properties[r.promoteId]:r.generateId&&(u=n||0),o==="Point")Dy(i,s);else if(o==="MultiPoint")for(let c of i)Dy(c,s);else if(o==="LineString")Jl(i,s,a,!1);else if(o==="MultiLineString")if(r.lineMetrics){for(let c of i)s=[],Jl(c,s,a,!1),t.push(xt(u,"LineString",s,e.properties));return}else Zl(i,s,a,!1);else if(o==="Polygon")Zl(i,s,a,!0);else if(o==="MultiPolygon")for(let c of i){let p=[];Zl(c,p,a,!0),s.push(p)}else if(o==="GeometryCollection"){for(let c of e.geometry.geometries)ns(t,{id:u,geometry:c,properties:e.properties},r,n);return}else throw new Error("Input data is not a valid GeoJSON object.");t.push(xt(u,o,s,e.properties))}l(ns,"convertFeature");function Dy(t,e){e.push(By(t[0]),Vy(t[1]),0)}l(Dy,"convertPoint");function Jl(t,e,r,n){let i,o,a=0;for(let u=0;u<t.length;u++){let c=By(t[u][0]),p=Vy(t[u][1]);e.push(c,p,0),u>0&&(n?a+=(i*p-c*o)/2:a+=Math.sqrt(Math.pow(c-i,2)+Math.pow(p-o,2))),i=c,o=p}let s=e.length-3;e[2]=1,Ni(e,0,s,r),e[s+2]=1,e.size=Math.abs(a),e.start=0,e.end=e.size}l(Jl,"convertLine");function Zl(t,e,r,n){for(let i=0;i<t.length;i++){let o=[];Jl(t[i],o,r,n),e.push(o)}}l(Zl,"convertLines");function By(t){return t/360+.5}l(By,"projectX");function Vy(t){let e=Math.sin(t*Math.PI/180),r=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return r<0?0:r>1?1:r}l(Vy,"projectY");g();function qe(t,e,r,n,i,o,a,s){if(r/=e,n/=e,o>=r&&a<n)return t;if(a<r||o>=n)return null;let u=[];for(let c of t){let 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){u.push(c);continue}else if(m<r||y>=n)continue;let h=[];if(f==="Point"||f==="MultiPoint")o0(p,h,r,n,i);else if(f==="LineString")zy(p,h,r,n,i,!1,s.lineMetrics);else if(f==="MultiLineString")Kl(p,h,r,n,i,!1);else if(f==="Polygon")Kl(p,h,r,n,i,!0);else if(f==="MultiPolygon")for(let d of p){let x=[];Kl(d,x,r,n,i,!0),x.length&&h.push(x)}if(h.length){if(s.lineMetrics&&f==="LineString"){for(let d of h)u.push(xt(c.id,f,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"),u.push(xt(c.id,f,h,c.tags))}}return u.length?u:null}l(qe,"clip");function o0(t,e,r,n,i){for(let o=0;o<t.length;o+=3){let a=t[o+i];a>=r&&a<=n&&Jr(e,t[o],t[o+1],t[o+2])}}l(o0,"clipPoints");function zy(t,e,r,n,i,o,a){let s=Ry(t),u=i===0?a0:s0,c=t.start,p,f;for(let b=0;b<t.length-3;b+=3){let P=t[b],v=t[b+1],S=t[b+2],_=t[b+3],T=t[b+4],I=i===0?P:v,F=i===0?_:T,D=!1;a&&(p=Math.sqrt(Math.pow(P-_,2)+Math.pow(v-T,2))),I<r?F>r&&(f=u(s,P,v,_,T,r),a&&(s.start=c+p*f)):I>n?F<n&&(f=u(s,P,v,_,T,n),a&&(s.start=c+p*f)):Jr(s,P,v,S),F<r&&I>=r&&(f=u(s,P,v,_,T,r),D=!0),F>n&&I<=n&&(f=u(s,P,v,_,T,n),D=!0),!o&&D&&(a&&(s.end=c+p*f),e.push(s),s=Ry(t)),a&&(c+=p)}let y=t.length-3,m=t[y],h=t[y+1],d=t[y+2],x=i===0?m:h;x>=r&&x<=n&&Jr(s,m,h,d),y=s.length-3,o&&y>=3&&(s[y]!==s[0]||s[y+1]!==s[1])&&Jr(s,s[0],s[1],s[2]),s.length&&e.push(s)}l(zy,"clipLine");function Ry(t){let e=[];return e.size=t.size,e.start=t.start,e.end=t.end,e}l(Ry,"newSlice");function Kl(t,e,r,n,i,o){for(let a of t)zy(a,e,r,n,i,o,!1)}l(Kl,"clipLines");function Jr(t,e,r,n){t.push(e,r,n)}l(Jr,"addPoint");function a0(t,e,r,n,i,o){let a=(o-e)/(n-e);return Jr(t,o,r+(i-r)*a,1),a}l(a0,"intersectX");function s0(t,e,r,n,i,o){let a=(o-r)/(i-r);return Jr(t,e+(n-e)*a,o,1),a}l(s0,"intersectY");g();function eu(t,e){let r=e.buffer/e.extent,n=t,i=qe(t,1,-1-r,r,0,-1,2,e),o=qe(t,1,1-r,2+r,0,-1,2,e);return(i||o)&&(n=qe(t,1,-r,1+r,0,-1,2,e)||[],i&&(n=Oy(i,1).concat(n)),o&&(n=n.concat(Oy(o,-1)))),n}l(eu,"wrap");function Oy(t,e){let r=[];for(let n=0;n<t.length;n++){let i=t[n],o=i.type,a;if(o==="Point"||o==="MultiPoint"||o==="LineString")a=Ql(i.geometry,e);else if(o==="MultiLineString"||o==="Polygon"){a=[];for(let s of i.geometry)a.push(Ql(s,e))}else if(o==="MultiPolygon"){a=[];for(let s of i.geometry){let u=[];for(let c of s)u.push(Ql(c,e));a.push(u)}}r.push(xt(i.id,o,a,i.tags))}return r}l(Oy,"shiftFeatureCoords");function Ql(t,e){let r=[];r.size=t.size,t.start!==void 0&&(r.start=t.start,r.end=t.end);for(let n=0;n<t.length;n+=3)r.push(t[n]+e,t[n+1],t[n+2]);return r}l(Ql,"shiftCoords");g();function is(t,e){if(t.transformed)return t;let r=1<<t.z,n=t.x,i=t.y;for(let o of t.features){let a=o.geometry,s=o.type;if(o.geometry=[],s===1)for(let u=0;u<a.length;u+=2)o.geometry.push(Gy(a[u],a[u+1],e,r,n,i));else for(let u=0;u<a.length;u++){let c=[];for(let p=0;p<a[u].length;p+=2)c.push(Gy(a[u][p],a[u][p+1],e,r,n,i));o.geometry.push(c)}}return t.transformed=!0,t}l(is,"transformTile");function Gy(t,e,r,n,i,o){return[Math.round(r*(t*n-i)),Math.round(r*(e*n-o))]}l(Gy,"transformPoint");g();function ru(t,e,r,n,i){let o=e===i.maxZoom?0:i.tolerance/((1<<e)*i.extent),a={features:[],numPoints:0,numSimplified:0,numFeatures:t.length,source:null,x:r,y:n,z:e,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0};for(let s of t)l0(a,s,o,i);return a}l(ru,"createTile");function l0(t,e,r,n){let i=e.geometry,o=e.type,a=[];if(t.minX=Math.min(t.minX,e.minX),t.minY=Math.min(t.minY,e.minY),t.maxX=Math.max(t.maxX,e.maxX),t.maxY=Math.max(t.maxY,e.maxY),o==="Point"||o==="MultiPoint")for(let s=0;s<i.length;s+=3)a.push(i[s],i[s+1]),t.numPoints++,t.numSimplified++;else if(o==="LineString")tu(a,i,t,r,!1,!1);else if(o==="MultiLineString"||o==="Polygon")for(let s=0;s<i.length;s++)tu(a,i[s],t,r,o==="Polygon",s===0);else if(o==="MultiPolygon")for(let s=0;s<i.length;s++){let u=i[s];for(let c=0;c<u.length;c++)tu(a,u[c],t,r,!0,c===0)}if(a.length){let s=e.tags||null;if(o==="LineString"&&n.lineMetrics){s={};for(let c in e.tags)s[c]=e.tags[c];s.mapbox_clip_start=i.start/i.size,s.mapbox_clip_end=i.end/i.size}let u={geometry:a,type:o==="Polygon"||o==="MultiPolygon"?3:o==="LineString"||o==="MultiLineString"?2:1,tags:s};e.id!==null&&(u.id=e.id),t.features.push(u)}}l(l0,"addFeature");function tu(t,e,r,n,i,o){let a=n*n;if(n>0&&e.size<(i?a:n)){r.numPoints+=e.length/3;return}let s=[];for(let u=0;u<e.length;u+=3)(n===0||e[u+2]>a)&&(r.numSimplified++,s.push(e[u],e[u+1])),r.numPoints++;i&&u0(s,o),t.push(s)}l(tu,"addLine");function u0(t,e){let r=0;for(let n=0,i=t.length,o=i-2;n<i;o=n,n+=2)r+=(t[n]-t[o])*(t[n+1]+t[o+1]);if(r>0===e)for(let n=0,i=t.length;n<i/2;n+=2){let o=t[n],a=t[n+1];t[n]=t[i-2-n],t[n+1]=t[i-1-n],t[i-2-n]=o,t[i-1-n]=a}}l(u0,"rewind");var c0={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},iu=class{static{l(this,"GeoJSONVT")}constructor(e,r){r=this.options=p0(Object.create(c0),r);let n=r.debug;if(n&&console.time("preprocess data"),r.maxZoom<0||r.maxZoom>24)throw new Error("maxZoom should be in the 0-24 range");if(r.promoteId&&r.generateId)throw new Error("promoteId and generateId cannot be used together.");let i=Yl(e,r);this.tiles={},this.tileCoords=[],n&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",r.indexMaxZoom,r.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),i=eu(i,r),i.length&&this.splitTile(i,0,0,0),n&&(i.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)))}splitTile(e,r,n,i,o,a,s){let u=[e,r,n,i],c=this.options,p=c.debug;for(;u.length;){i=u.pop(),n=u.pop(),r=u.pop(),e=u.pop();let f=1<<r,y=nu(r,n,i),m=this.tiles[y];if(!m&&(p>1&&console.time("creation"),m=this.tiles[y]=ru(e,r,n,i,c),this.tileCoords.push({z:r,x:n,y:i}),p)){p>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",r,n,i,m.numFeatures,m.numPoints,m.numSimplified),console.timeEnd("creation"));let F=`z${r}`;this.stats[F]=(this.stats[F]||0)+1,this.total++}if(m.source=e,o==null){if(r===c.indexMaxZoom||m.numPoints<=c.indexMaxPoints)continue}else{if(r===c.maxZoom||r===o)continue;if(o!=null){let F=o-r;if(n!==a>>F||i!==s>>F)continue}}if(m.source=null,e.length===0)continue;p>1&&console.time("clipping");let h=.5*c.buffer/c.extent,d=.5-h,x=.5+h,b=1+h,P=null,v=null,S=null,_=null,T=qe(e,f,n-h,n+x,0,m.minX,m.maxX,c),I=qe(e,f,n+d,n+b,0,m.minX,m.maxX,c);e=null,T&&(P=qe(T,f,i-h,i+x,1,m.minY,m.maxY,c),v=qe(T,f,i+d,i+b,1,m.minY,m.maxY,c),T=null),I&&(S=qe(I,f,i-h,i+x,1,m.minY,m.maxY,c),_=qe(I,f,i+d,i+b,1,m.minY,m.maxY,c),I=null),p>1&&console.timeEnd("clipping"),u.push(P||[],r+1,n*2,i*2),u.push(v||[],r+1,n*2,i*2+1),u.push(S||[],r+1,n*2+1,i*2),u.push(_||[],r+1,n*2+1,i*2+1)}}getTile(e,r,n){e=+e,r=+r,n=+n;let i=this.options,{extent:o,debug:a}=i;if(e<0||e>24)return null;let s=1<<e;r=r+s&s-1;let u=nu(e,r,n);if(this.tiles[u])return is(this.tiles[u],o);a>1&&console.log("drilling down to z%d-%d-%d",e,r,n);let c=e,p=r,f=n,y;for(;!y&&c>0;)c--,p=p>>1,f=f>>1,y=this.tiles[nu(c,p,f)];return!y||!y.source?null:(a>1&&(console.log("found parent tile z%d-%d-%d",c,p,f),console.time("drilling down")),this.splitTile(y.source,c,p,f,e,r,n),a>1&&console.timeEnd("drilling down"),this.tiles[u]?is(this.tiles[u],o):null)}};function nu(t,e,r){return((1<<t)*r+e)*32+t}l(nu,"toID");function p0(t,e){for(let r in e)t[r]=e[r];return t}l(p0,"extend");function ou(t,e){return new iu(t,e)}l(ou,"geojsonvt");g();function Ui(t,e){return e?t.properties[e]:t.id}l(Ui,"getFeatureId");function au(t,e){if(t==null)return!0;if(t.type==="Feature")return Ui(t,e)!=null;if(t.type==="FeatureCollection"){let r=new Set;for(let n of t.features){let i=Ui(n,e);if(i==null||r.has(i))return!1;r.add(i)}return!0}return!1}l(au,"isUpdateableGeoJSON");function su(t,e){let r=new Map;if(t!=null)if(t.type==="Feature")r.set(Ui(t,e),t);else for(let n of t.features)r.set(Ui(n,e),n);return r}l(su,"toUpdateable");function Ny(t,e,r){if(e.removeAll&&t.clear(),e.remove)for(let n of e.remove)t.delete(n);if(e.add)for(let n of e.add){let i=Ui(n,r);i!=null&&t.set(i,n)}if(e.update)for(let n of e.update){let i=t.get(n.id);if(i==null)continue;let o=n.newGeometry||n.removeAllProperties,a=!n.removeAllProperties&&(n.removeProperties?.length>0||n.addOrUpdateProperties?.length>0);if((o||a)&&(i={...i},t.set(n.id,i),a&&(i.properties={...i.properties})),n.newGeometry&&(i.geometry=n.newGeometry),n.removeAllProperties)i.properties={};else if(n.removeProperties?.length>0)for(let s of n.removeProperties)Object.prototype.hasOwnProperty.call(i.properties,s)&&delete i.properties[s];if(n.addOrUpdateProperties?.length>0)for(let{key:s,value:u}of n.addOrUpdateProperties)i.properties[s]=u}}l(Ny,"applySourceDiff");var os=class extends Zr{constructor(){super(...arguments);this._dataUpdateable=new Map}static{l(this,"GeoJSONWorkerSource")}async loadVectorTile(r,n){let i=r.tileID.canonical;if(!this._geoJSONIndex)throw new Error("Unable to parse the data into a cluster or geojson");let o=this._geoJSONIndex.getTile(i.z,i.x,i.y);if(!o)return null;let a=new Ka(o.features),s=(0,$y.default)(a);return(s.byteOffset!==0||s.byteLength!==s.buffer.byteLength)&&(s=new Uint8Array(s)),{vectorTile:a,rawData:s.buffer}}async loadData(r){this._pendingRequest?.abort();let n=r&&r.request&&r.request.collectResourceTiming?new Hr(r.request):!1;this._pendingRequest=new AbortController;try{this._pendingData=this.loadAndProcessGeoJSON(r,this._pendingRequest),this._geoJSONIndex=r.cluster?new Gi(f0(r)).load((await this._pendingData).features):ou(await this._pendingData,r.geojsonVtOptions),this.loaded={};let i={};if(n){let o=n.finish();o&&(i.resourceTiming={},i.resourceTiming[r.source]=JSON.parse(JSON.stringify(o)))}return i}catch(i){if(delete this._pendingRequest,Bc(i))return{abandoned:!0};throw i}}async getData(){return this._pendingData}reloadTile(r){let n=this.loaded,i=r.uid;return n&&n[i]?super.reloadTile(r):this.loadTile(r)}async loadAndProcessGeoJSON(r,n){let i=await this.loadGeoJSON(r,n);if(delete this._pendingRequest,typeof i!="object")throw new Error(`Input data given to '${r.source}' is not a valid GeoJSON object.`);if((0,Uy.default)(i,!0),r.filter){let o=rr(r.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if(o.result==="error")throw new Error(o.value.map(s=>`${s.key}: ${s.message}`).join(", "));i={type:"FeatureCollection",features:i.features.filter(s=>o.value.evaluate({zoom:0},s))}}return i}async loadGeoJSON(r,n){let{promoteId:i}=r;if(r.request){let o=await $c(r.request,n);return this._dataUpdateable=au(o.data,i)?su(o.data,i):void 0,o.data}if(typeof r.data=="string")try{let o=JSON.parse(r.data);return this._dataUpdateable=au(o,i)?su(o,i):void 0,o}catch{throw new Error(`Input data given to '${r.source}' is not a valid GeoJSON object.`)}if(!r.dataDiff)throw new Error(`Input data given to '${r.source}' is not a valid GeoJSON object.`);if(!this._dataUpdateable)throw new Error(`Cannot update existing geojson data in ${r.source}`);return Ny(this._dataUpdateable,r.dataDiff,i),{type:"FeatureCollection",features:Array.from(this._dataUpdateable.values())}}async removeSource(r){this._pendingRequest&&this._pendingRequest.abort()}getClusterExpansionZoom(r){return this._geoJSONIndex.getClusterExpansionZoom(r.clusterId)}getClusterChildren(r){return this._geoJSONIndex.getChildren(r.clusterId)}getClusterLeaves(r){return this._geoJSONIndex.getLeaves(r.clusterId,r.limit,r.offset)}};function f0({superclusterOptions:t,clusterProperties:e}){if(!e||!t)return t;let r={},n={},i={accumulated:null,zoom:0},o={properties:null},a=Object.keys(e);for(let s of a){let[u,c]=e[s],p=rr(c),f=rr(typeof u=="string"?[u,["accumulated"],["get",s]]:u);r[s]=p.value,n[s]=f.value}return t.map=s=>{o.properties=s;let u={};for(let c of a)u[c]=r[c].evaluate(i,o);return u},t.reduce=(s,u)=>{o.properties=u;for(let c of a)i.accumulated=s[c],s[c]=n[c].evaluate(i,o)},t}l(f0,"getSuperclusterOptions");var as=class{static{l(this,"Worker")}constructor(e){this.self=e,this.actor=new Mo(e),this.layerIndexes={},this.availableImages={},this.workerSources={},this.demWorkerSources={},this.externalWorkerSourceTypes={},this.self.registerWorkerSource=(r,n)=>{if(this.externalWorkerSourceTypes[r])throw new Error(`Worker source with name "${r}" already registered.`);this.externalWorkerSourceTypes[r]=n},this.self.addProtocol=Rc,this.self.removeProtocol=zc,this.self.registerRTLTextPlugin=r=>{Ie.setMethods(r)},this.actor.registerMessageHandler("LDT",(r,n)=>this._getDEMWorkerSource(r,n.source).loadTile(n)),this.actor.registerMessageHandler("RDT",async(r,n)=>{this._getDEMWorkerSource(r,n.source).removeTile(n)}),this.actor.registerMessageHandler("GCEZ",async(r,n)=>this._getWorkerSource(r,n.type,n.source).getClusterExpansionZoom(n)),this.actor.registerMessageHandler("GCC",async(r,n)=>this._getWorkerSource(r,n.type,n.source).getClusterChildren(n)),this.actor.registerMessageHandler("GCL",async(r,n)=>this._getWorkerSource(r,n.type,n.source).getClusterLeaves(n)),this.actor.registerMessageHandler("LD",(r,n)=>this._getWorkerSource(r,n.type,n.source).loadData(n)),this.actor.registerMessageHandler("GD",(r,n)=>this._getWorkerSource(r,n.type,n.source).getData()),this.actor.registerMessageHandler("LT",(r,n)=>this._getWorkerSource(r,n.type,n.source).loadTile(n)),this.actor.registerMessageHandler("RT",(r,n)=>this._getWorkerSource(r,n.type,n.source).reloadTile(n)),this.actor.registerMessageHandler("AT",(r,n)=>this._getWorkerSource(r,n.type,n.source).abortTile(n)),this.actor.registerMessageHandler("RMT",(r,n)=>this._getWorkerSource(r,n.type,n.source).removeTile(n)),this.actor.registerMessageHandler("RS",async(r,n)=>{if(!this.workerSources[r]||!this.workerSources[r][n.type]||!this.workerSources[r][n.type][n.source])return;let i=this.workerSources[r][n.type][n.source];delete this.workerSources[r][n.type][n.source],i.removeSource!==void 0&&i.removeSource(n)}),this.actor.registerMessageHandler("RM",async r=>{delete this.layerIndexes[r],delete this.availableImages[r],delete this.workerSources[r],delete this.demWorkerSources[r]}),this.actor.registerMessageHandler("SR",async(r,n)=>{this.referrer=n}),this.actor.registerMessageHandler("SRPS",(r,n)=>this._syncRTLPluginState(r,n)),this.actor.registerMessageHandler("IS",async(r,n)=>{this.self.importScripts(n)}),this.actor.registerMessageHandler("SI",(r,n)=>this._setImages(r,n)),this.actor.registerMessageHandler("UL",async(r,n)=>{this._getLayerIndex(r).update(n.layers,n.removedIds)}),this.actor.registerMessageHandler("SL",async(r,n)=>{this._getLayerIndex(r).replace(n)})}async _setImages(e,r){this.availableImages[e]=r;for(let n in this.workerSources[e]){let i=this.workerSources[e][n];for(let o in i)i[o].availableImages=r}}async _syncRTLPluginState(e,r){return await Ie.syncState(r,this.self.importScripts)}_getAvailableImages(e){let r=this.availableImages[e];return r||(r=[]),r}_getLayerIndex(e){let r=this.layerIndexes[e];return r||(r=this.layerIndexes[e]=new Na),r}_getWorkerSource(e,r,n){if(this.workerSources[e]||(this.workerSources[e]={}),this.workerSources[e][r]||(this.workerSources[e][r]={}),!this.workerSources[e][r][n]){let i={sendAsync:l((o,a)=>(o.targetMapId=e,this.actor.sendAsync(o,a)),"sendAsync")};switch(r){case"vector":this.workerSources[e][r][n]=new Zr(i,this._getLayerIndex(e),this._getAvailableImages(e));break;case"geojson":this.workerSources[e][r][n]=new os(i,this._getLayerIndex(e),this._getAvailableImages(e));break;default:this.workerSources[e][r][n]=new this.externalWorkerSourceTypes[r](i,this._getLayerIndex(e),this._getAvailableImages(e));break}}return this.workerSources[e][r][n]}_getDEMWorkerSource(e,r){return this.demWorkerSources[e]||(this.demWorkerSources[e]={}),this.demWorkerSources[e][r]||(this.demWorkerSources[e][r]=new Ja),this.demWorkerSources[e][r]}};ut(self)&&(self.worker=new as(self));})();
|
|
1
|
+
(()=>{var wg=Object.create;var mn=Object.defineProperty,Ag=Object.defineProperties,_g=Object.getOwnPropertyDescriptor,Ig=Object.getOwnPropertyDescriptors,Tg=Object.getOwnPropertyNames,Gf=Object.getOwnPropertySymbols,Cg=Object.getPrototypeOf,Uf=Object.prototype.hasOwnProperty,kg=Object.prototype.propertyIsEnumerable;var Nf=(r,e,t)=>e in r?mn(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,Jt=(r,e)=>{for(var t in e||(e={}))Uf.call(e,t)&&Nf(r,t,e[t]);if(Gf)for(var t of Gf(e))kg.call(e,t)&&Nf(r,t,e[t]);return r},xo=(r,e)=>Ag(r,Ig(e)),l=(r,e)=>mn(r,"name",{value:e,configurable:!0});var Fg=(r,e)=>()=>(r&&(e=r(r=0)),e);var we=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),Eg=(r,e)=>{for(var t in e)mn(r,t,{get:e[t],enumerable:!0})},Mg=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Tg(e))!Uf.call(r,i)&&i!==t&&mn(r,i,{get:()=>e[i],enumerable:!(n=_g(e,i))||n.enumerable});return r};var ee=(r,e,t)=>(t=r!=null?wg(Cg(r)):{},Mg(e||!r||!r.__esModule?mn(t,"default",{value:r,enumerable:!0}):t,r));var g=Fg(()=>{});var de=we((YP,$f)=>{"use strict";g();$f.exports=Cr;function Cr(r,e){this.x=r,this.y=e}l(Cr,"Point");Cr.prototype={clone:l(function(){return new Cr(this.x,this.y)},"clone"),add:l(function(r){return this.clone()._add(r)},"add"),sub:l(function(r){return this.clone()._sub(r)},"sub"),multByPoint:l(function(r){return this.clone()._multByPoint(r)},"multByPoint"),divByPoint:l(function(r){return this.clone()._divByPoint(r)},"divByPoint"),mult:l(function(r){return this.clone()._mult(r)},"mult"),div:l(function(r){return this.clone()._div(r)},"div"),rotate:l(function(r){return this.clone()._rotate(r)},"rotate"),rotateAround:l(function(r,e){return this.clone()._rotateAround(r,e)},"rotateAround"),matMult:l(function(r){return this.clone()._matMult(r)},"matMult"),unit:l(function(){return this.clone()._unit()},"unit"),perp:l(function(){return this.clone()._perp()},"perp"),round:l(function(){return this.clone()._round()},"round"),mag:l(function(){return Math.sqrt(this.x*this.x+this.y*this.y)},"mag"),equals:l(function(r){return this.x===r.x&&this.y===r.y},"equals"),dist:l(function(r){return Math.sqrt(this.distSqr(r))},"dist"),distSqr:l(function(r){var e=r.x-this.x,t=r.y-this.y;return e*e+t*t},"distSqr"),angle:l(function(){return Math.atan2(this.y,this.x)},"angle"),angleTo:l(function(r){return Math.atan2(this.y-r.y,this.x-r.x)},"angleTo"),angleWith:l(function(r){return this.angleWithSep(r.x,r.y)},"angleWith"),angleWithSep:l(function(r,e){return Math.atan2(this.x*e-this.y*r,this.x*r+this.y*e)},"angleWithSep"),_matMult:l(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},"_matMult"),_add:l(function(r){return this.x+=r.x,this.y+=r.y,this},"_add"),_sub:l(function(r){return this.x-=r.x,this.y-=r.y,this},"_sub"),_mult:l(function(r){return this.x*=r,this.y*=r,this},"_mult"),_div:l(function(r){return this.x/=r,this.y/=r,this},"_div"),_multByPoint:l(function(r){return this.x*=r.x,this.y*=r.y,this},"_multByPoint"),_divByPoint:l(function(r){return this.x/=r.x,this.y/=r.y,this},"_divByPoint"),_unit:l(function(){return this._div(this.mag()),this},"_unit"),_perp:l(function(){var r=this.y;return this.y=this.x,this.x=-r,this},"_perp"),_rotate:l(function(r){var e=Math.cos(r),t=Math.sin(r),n=e*this.x-t*this.y,i=t*this.x+e*this.y;return this.x=n,this.y=i,this},"_rotate"),_rotateAround:l(function(r,e){var t=Math.cos(r),n=Math.sin(r),i=e.x+t*(this.x-e.x)-n*(this.y-e.y),o=e.y+n*(this.x-e.x)+t*(this.y-e.y);return this.x=i,this.y=o,this},"_rotateAround"),_round:l(function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},"_round")};Cr.convert=function(r){return r instanceof Cr?r:Array.isArray(r)?new Cr(r[0],r[1]):r}});var Wf=we((eS,qf)=>{"use strict";g();qf.exports=jf;function jf(r,e,t,n){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*(n-e)-this.cy,this.ay=1-this.cy-this.by,this.p1x=r,this.p1y=e,this.p2x=t,this.p2y=n}l(jf,"UnitBezier");jf.prototype={sampleCurveX:l(function(r){return((this.ax*r+this.bx)*r+this.cx)*r},"sampleCurveX"),sampleCurveY:l(function(r){return((this.ay*r+this.by)*r+this.cy)*r},"sampleCurveY"),sampleCurveDerivativeX:l(function(r){return(3*this.ax*r+2*this.bx)*r+this.cx},"sampleCurveDerivativeX"),solveCurveX:l(function(r,e){if(e===void 0&&(e=1e-6),r<0)return 0;if(r>1)return 1;for(var t=r,n=0;n<8;n++){var i=this.sampleCurveX(t)-r;if(Math.abs(i)<e)return t;var o=this.sampleCurveDerivativeX(t);if(Math.abs(o)<1e-6)break;t=t-i/o}var a=0,s=1;for(t=r,n=0;n<20&&(i=this.sampleCurveX(t),!(Math.abs(i-r)<e));n++)r>i?a=t:s=t,t=(s-a)*.5+a;return t},"solveCurveX"),solve:l(function(r,e){return this.sampleCurveY(this.solveCurveX(r,e))},"solve")}});var Nm=we((VA,Ec)=>{g();function av(r,e){var t,n,i,o,a,s,u,c,p,f;for(t=r.length&3,n=r.length-t,i=e,a=3432918353,u=461845907,f=0;f<n;)p=r.charCodeAt(f)&255|(r.charCodeAt(++f)&255)<<8|(r.charCodeAt(++f)&255)<<16|(r.charCodeAt(++f)&255)<<24,++f,p=(p&65535)*a+(((p>>>16)*a&65535)<<16)&4294967295,p=p<<15|p>>>17,p=(p&65535)*u+(((p>>>16)*u&65535)<<16)&4294967295,i^=p,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(p=0,t){case 3:p^=(r.charCodeAt(f+2)&255)<<16;case 2:p^=(r.charCodeAt(f+1)&255)<<8;case 1:p^=r.charCodeAt(f)&255,p=(p&65535)*a+(((p>>>16)*a&65535)<<16)&4294967295,p=p<<15|p>>>17,p=(p&65535)*u+(((p>>>16)*u&65535)<<16)&4294967295,i^=p}return i^=r.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}l(av,"murmurhash3_32_gc");typeof Ec<"u"&&(Ec.exports=av)});var Um=we((zA,Mc)=>{g();function sv(r,e){for(var t=r.length,n=e^t,i=0,o;t>=4;)o=r.charCodeAt(i)&255|(r.charCodeAt(++i)&255)<<8|(r.charCodeAt(++i)&255)<<16|(r.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,t-=4,++i;switch(t){case 3:n^=(r.charCodeAt(i+2)&255)<<16;case 2:n^=(r.charCodeAt(i+1)&255)<<8;case 1:n^=r.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}l(sv,"murmurhash2_32_gc");typeof Mc!==void 0&&(Mc.exports=sv)});var Lc=we((NA,Ja)=>{g();var $m=Nm(),lv=Um();Ja.exports=$m;Ja.exports.murmur3=$m;Ja.exports.murmur2=lv});var dp=we((GT,Ih)=>{"use strict";g();var Hv=de();Ih.exports=en;function en(r,e,t,n,i){this.properties={},this.extent=t,this.type=0,this._pbf=r,this._geometry=-1,this._keys=n,this._values=i,r.readFields(Zv,this,e)}l(en,"VectorTileFeature");function Zv(r,e,t){r==1?e.id=t.readVarint():r==2?Jv(t,e):r==3?e.type=t.readVarint():r==4&&(e._geometry=t.pos)}l(Zv,"readFeature");function Jv(r,e){for(var t=r.readVarint()+r.pos;r.pos<t;){var n=e._keys[r.readVarint()],i=e._values[r.readVarint()];e.properties[n]=i}}l(Jv,"readTag");en.types=["Unknown","Point","LineString","Polygon"];en.prototype.loadGeometry=function(){var r=this._pbf;r.pos=this._geometry;for(var e=r.readVarint()+r.pos,t=1,n=0,i=0,o=0,a=[],s;r.pos<e;){if(n<=0){var u=r.readVarint();t=u&7,n=u>>3}if(n--,t===1||t===2)i+=r.readSVarint(),o+=r.readSVarint(),t===1&&(s&&a.push(s),s=[]),s.push(new Hv(i,o));else if(t===7)s&&s.push(s[0].clone());else throw new Error("unknown command "+t)}return s&&a.push(s),a};en.prototype.bbox=function(){var r=this._pbf;r.pos=this._geometry;for(var e=r.readVarint()+r.pos,t=1,n=0,i=0,o=0,a=1/0,s=-1/0,u=1/0,c=-1/0;r.pos<e;){if(n<=0){var p=r.readVarint();t=p&7,n=p>>3}if(n--,t===1||t===2)i+=r.readSVarint(),o+=r.readSVarint(),i<a&&(a=i),i>s&&(s=i),o<u&&(u=o),o>c&&(c=o);else if(t!==7)throw new Error("unknown command "+t)}return[a,u,s,c]};en.prototype.toGeoJSON=function(r,e,t){var n=this.extent*Math.pow(2,t),i=this.extent*r,o=this.extent*e,a=this.loadGeometry(),s=en.types[this.type],u,c;function p(m){for(var h=0;h<m.length;h++){var d=m[h],x=180-(d.y+o)*360/n;m[h]=[(d.x+i)*360/n-180,360/Math.PI*Math.atan(Math.exp(x*Math.PI/180))-90]}}switch(l(p,"project"),this.type){case 1:var f=[];for(u=0;u<a.length;u++)f[u]=a[u][0];a=f,p(a);break;case 2:for(u=0;u<a.length;u++)p(a[u]);break;case 3:for(a=Yv(a),u=0;u<a.length;u++)for(c=0;c<a[u].length;c++)p(a[u][c]);break}a.length===1?a=a[0]:s="Multi"+s;var y={type:"Feature",geometry:{type:s,coordinates:a},properties:this.properties};return"id"in this&&(y.id=this.id),y};function Yv(r){var e=r.length;if(e<=1)return[r];for(var t=[],n,i,o=0;o<e;o++){var a=Kv(r[o]);a!==0&&(i===void 0&&(i=a<0),i===a<0?(n&&t.push(n),n=[r[o]]):n.push(r[o]))}return n&&t.push(n),t}l(Yv,"classifyRings");function Kv(r){for(var e=0,t=0,n=r.length,i=n-1,o,a;t<n;i=t++)o=r[t],a=r[i],e+=(a.x-o.x)*(o.y+a.y);return e}l(Kv,"signedArea")});var gp=we(($T,Ch)=>{"use strict";g();var Qv=dp();Ch.exports=Th;function Th(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(e1,this,e),this.length=this._features.length}l(Th,"VectorTileLayer");function e1(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(t1(t))}l(e1,"readLayer");function t1(r){for(var e=null,t=r.readVarint()+r.pos;r.pos<t;){var n=r.readVarint()>>3;e=n===1?r.readString():n===2?r.readFloat():n===3?r.readDouble():n===4?r.readVarint64():n===5?r.readVarint():n===6?r.readSVarint():n===7?r.readBoolean():null}return e}l(t1,"readValueMessage");Th.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 Qv(this._pbf,e,this.extent,this._keys,this._values)}});var Fh=we((WT,kh)=>{"use strict";g();var r1=gp();kh.exports=n1;function n1(r,e){this.layers=r.readFields(i1,{},e)}l(n1,"VectorTile");function i1(r,e,t){if(r===3){var n=new r1(t,t.readVarint()+t.pos);n.length&&(e[n.name]=n)}}l(i1,"readTile")});var jt=we((ZT,ds)=>{g();ds.exports.VectorTile=Fh();ds.exports.VectorTileFeature=dp();ds.exports.VectorTileLayer=gp()});var Yh=we(Tp=>{g();Tp.read=function(r,e,t,n,i){var o,a,s=i*8-n-1,u=(1<<s)-1,c=u>>1,p=-7,f=t?i-1:0,y=t?-1:1,m=r[e+f];for(f+=y,o=m&(1<<-p)-1,m>>=-p,p+=s;p>0;o=o*256+r[e+f],f+=y,p-=8);for(a=o&(1<<-p)-1,o>>=-p,p+=n;p>0;a=a*256+r[e+f],f+=y,p-=8);if(o===0)o=1-c;else{if(o===u)return a?NaN:(m?-1:1)*(1/0);a=a+Math.pow(2,n),o=o-c}return(m?-1:1)*a*Math.pow(2,o-n)};Tp.write=function(r,e,t,n,i,o){var a,s,u,c=o*8-i-1,p=(1<<c)-1,f=p>>1,y=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,m=n?0:o-1,h=n?1:-1,d=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,a=p):(a=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-a))<1&&(a--,u*=2),a+f>=1?e+=y/u:e+=y*Math.pow(2,1-f),e*u>=2&&(a++,u/=2),a+f>=p?(s=0,a=p):a+f>=1?(s=(e*u-1)*Math.pow(2,i),a=a+f):(s=e*Math.pow(2,f-1)*Math.pow(2,i),a=0));i>=8;r[t+m]=s&255,m+=h,s/=256,i-=8);for(a=a<<i|s,c+=i;c>0;r[t+m]=a&255,m+=h,a/=256,c-=8);r[t+m-h]|=d*128}});var Ri=we((Jk,rd)=>{"use strict";g();rd.exports=Q;var Ps=Yh();function Q(r){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(r)?r:new Uint8Array(r||0),this.pos=0,this.type=0,this.length=this.buf.length}l(Q,"Pbf");Q.Varint=0;Q.Fixed64=1;Q.Bytes=2;Q.Fixed32=5;var Cp=65536*65536,Kh=1/Cp,w1=12,td=typeof TextDecoder>"u"?null:new TextDecoder("utf-8");Q.prototype={destroy:l(function(){this.buf=null},"destroy"),readFields:l(function(r,e,t){for(t=t||this.length;this.pos<t;){var n=this.readVarint(),i=n>>3,o=this.pos;this.type=n&7,r(i,e,this),this.pos===o&&this.skip(n)}return e},"readFields"),readMessage:l(function(r,e){return this.readFields(r,e,this.readVarint()+this.pos)},"readMessage"),readFixed32:l(function(){var r=Ss(this.buf,this.pos);return this.pos+=4,r},"readFixed32"),readSFixed32:l(function(){var r=ed(this.buf,this.pos);return this.pos+=4,r},"readSFixed32"),readFixed64:l(function(){var r=Ss(this.buf,this.pos)+Ss(this.buf,this.pos+4)*Cp;return this.pos+=8,r},"readFixed64"),readSFixed64:l(function(){var r=Ss(this.buf,this.pos)+ed(this.buf,this.pos+4)*Cp;return this.pos+=8,r},"readSFixed64"),readFloat:l(function(){var r=Ps.read(this.buf,this.pos,!0,23,4);return this.pos+=4,r},"readFloat"),readDouble:l(function(){var r=Ps.read(this.buf,this.pos,!0,52,8);return this.pos+=8,r},"readDouble"),readVarint:l(function(r){var e=this.buf,t,n;return n=e[this.pos++],t=n&127,n<128||(n=e[this.pos++],t|=(n&127)<<7,n<128)||(n=e[this.pos++],t|=(n&127)<<14,n<128)||(n=e[this.pos++],t|=(n&127)<<21,n<128)?t:(n=e[this.pos],t|=(n&15)<<28,A1(t,r,this))},"readVarint"),readVarint64:l(function(){return this.readVarint(!0)},"readVarint64"),readSVarint:l(function(){var r=this.readVarint();return r%2===1?(r+1)/-2:r/2},"readSVarint"),readBoolean:l(function(){return!!this.readVarint()},"readBoolean"),readString:l(function(){var r=this.readVarint()+this.pos,e=this.pos;return this.pos=r,r-e>=w1&&td?z1(this.buf,e,r):R1(this.buf,e,r)},"readString"),readBytes:l(function(){var r=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,r);return this.pos=r,e},"readBytes"),readPackedVarint:l(function(r,e){if(this.type!==Q.Bytes)return r.push(this.readVarint(e));var t=bt(this);for(r=r||[];this.pos<t;)r.push(this.readVarint(e));return r},"readPackedVarint"),readPackedSVarint:l(function(r){if(this.type!==Q.Bytes)return r.push(this.readSVarint());var e=bt(this);for(r=r||[];this.pos<e;)r.push(this.readSVarint());return r},"readPackedSVarint"),readPackedBoolean:l(function(r){if(this.type!==Q.Bytes)return r.push(this.readBoolean());var e=bt(this);for(r=r||[];this.pos<e;)r.push(this.readBoolean());return r},"readPackedBoolean"),readPackedFloat:l(function(r){if(this.type!==Q.Bytes)return r.push(this.readFloat());var e=bt(this);for(r=r||[];this.pos<e;)r.push(this.readFloat());return r},"readPackedFloat"),readPackedDouble:l(function(r){if(this.type!==Q.Bytes)return r.push(this.readDouble());var e=bt(this);for(r=r||[];this.pos<e;)r.push(this.readDouble());return r},"readPackedDouble"),readPackedFixed32:l(function(r){if(this.type!==Q.Bytes)return r.push(this.readFixed32());var e=bt(this);for(r=r||[];this.pos<e;)r.push(this.readFixed32());return r},"readPackedFixed32"),readPackedSFixed32:l(function(r){if(this.type!==Q.Bytes)return r.push(this.readSFixed32());var e=bt(this);for(r=r||[];this.pos<e;)r.push(this.readSFixed32());return r},"readPackedSFixed32"),readPackedFixed64:l(function(r){if(this.type!==Q.Bytes)return r.push(this.readFixed64());var e=bt(this);for(r=r||[];this.pos<e;)r.push(this.readFixed64());return r},"readPackedFixed64"),readPackedSFixed64:l(function(r){if(this.type!==Q.Bytes)return r.push(this.readSFixed64());var e=bt(this);for(r=r||[];this.pos<e;)r.push(this.readSFixed64());return r},"readPackedSFixed64"),skip:l(function(r){var e=r&7;if(e===Q.Varint)for(;this.buf[this.pos++]>127;);else if(e===Q.Bytes)this.pos=this.readVarint()+this.pos;else if(e===Q.Fixed32)this.pos+=4;else if(e===Q.Fixed64)this.pos+=8;else throw new Error("Unimplemented type: "+e)},"skip"),writeTag:l(function(r,e){this.writeVarint(r<<3|e)},"writeTag"),realloc:l(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}},"realloc"),finish:l(function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},"finish"),writeFixed32:l(function(r){this.realloc(4),nn(this.buf,r,this.pos),this.pos+=4},"writeFixed32"),writeSFixed32:l(function(r){this.realloc(4),nn(this.buf,r,this.pos),this.pos+=4},"writeSFixed32"),writeFixed64:l(function(r){this.realloc(8),nn(this.buf,r&-1,this.pos),nn(this.buf,Math.floor(r*Kh),this.pos+4),this.pos+=8},"writeFixed64"),writeSFixed64:l(function(r){this.realloc(8),nn(this.buf,r&-1,this.pos),nn(this.buf,Math.floor(r*Kh),this.pos+4),this.pos+=8},"writeSFixed64"),writeVarint:l(function(r){if(r=+r||0,r>268435455||r<0){_1(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)))},"writeVarint"),writeSVarint:l(function(r){this.writeVarint(r<0?-r*2-1:r*2)},"writeSVarint"),writeBoolean:l(function(r){this.writeVarint(!!r)},"writeBoolean"),writeString:l(function(r){r=String(r),this.realloc(r.length*4),this.pos++;var e=this.pos;this.pos=O1(this.buf,r,this.pos);var t=this.pos-e;t>=128&&Qh(e,t,this),this.pos=e-1,this.writeVarint(t),this.pos+=t},"writeString"),writeFloat:l(function(r){this.realloc(4),Ps.write(this.buf,r,this.pos,!0,23,4),this.pos+=4},"writeFloat"),writeDouble:l(function(r){this.realloc(8),Ps.write(this.buf,r,this.pos,!0,52,8),this.pos+=8},"writeDouble"),writeBytes:l(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]},"writeBytes"),writeRawMessage:l(function(r,e){this.pos++;var t=this.pos;r(e,this);var n=this.pos-t;n>=128&&Qh(t,n,this),this.pos=t-1,this.writeVarint(n),this.pos+=n},"writeRawMessage"),writeMessage:l(function(r,e,t){this.writeTag(r,Q.Bytes),this.writeRawMessage(e,t)},"writeMessage"),writePackedVarint:l(function(r,e){e.length&&this.writeMessage(r,C1,e)},"writePackedVarint"),writePackedSVarint:l(function(r,e){e.length&&this.writeMessage(r,k1,e)},"writePackedSVarint"),writePackedBoolean:l(function(r,e){e.length&&this.writeMessage(r,M1,e)},"writePackedBoolean"),writePackedFloat:l(function(r,e){e.length&&this.writeMessage(r,F1,e)},"writePackedFloat"),writePackedDouble:l(function(r,e){e.length&&this.writeMessage(r,E1,e)},"writePackedDouble"),writePackedFixed32:l(function(r,e){e.length&&this.writeMessage(r,L1,e)},"writePackedFixed32"),writePackedSFixed32:l(function(r,e){e.length&&this.writeMessage(r,D1,e)},"writePackedSFixed32"),writePackedFixed64:l(function(r,e){e.length&&this.writeMessage(r,V1,e)},"writePackedFixed64"),writePackedSFixed64:l(function(r,e){e.length&&this.writeMessage(r,B1,e)},"writePackedSFixed64"),writeBytesField:l(function(r,e){this.writeTag(r,Q.Bytes),this.writeBytes(e)},"writeBytesField"),writeFixed32Field:l(function(r,e){this.writeTag(r,Q.Fixed32),this.writeFixed32(e)},"writeFixed32Field"),writeSFixed32Field:l(function(r,e){this.writeTag(r,Q.Fixed32),this.writeSFixed32(e)},"writeSFixed32Field"),writeFixed64Field:l(function(r,e){this.writeTag(r,Q.Fixed64),this.writeFixed64(e)},"writeFixed64Field"),writeSFixed64Field:l(function(r,e){this.writeTag(r,Q.Fixed64),this.writeSFixed64(e)},"writeSFixed64Field"),writeVarintField:l(function(r,e){this.writeTag(r,Q.Varint),this.writeVarint(e)},"writeVarintField"),writeSVarintField:l(function(r,e){this.writeTag(r,Q.Varint),this.writeSVarint(e)},"writeSVarintField"),writeStringField:l(function(r,e){this.writeTag(r,Q.Bytes),this.writeString(e)},"writeStringField"),writeFloatField:l(function(r,e){this.writeTag(r,Q.Fixed32),this.writeFloat(e)},"writeFloatField"),writeDoubleField:l(function(r,e){this.writeTag(r,Q.Fixed64),this.writeDouble(e)},"writeDoubleField"),writeBooleanField:l(function(r,e){this.writeVarintField(r,!!e)},"writeBooleanField")};function A1(r,e,t){var n=t.buf,i,o;if(o=n[t.pos++],i=(o&112)>>4,o<128||(o=n[t.pos++],i|=(o&127)<<3,o<128)||(o=n[t.pos++],i|=(o&127)<<10,o<128)||(o=n[t.pos++],i|=(o&127)<<17,o<128)||(o=n[t.pos++],i|=(o&127)<<24,o<128)||(o=n[t.pos++],i|=(o&1)<<31,o<128))return rn(r,i,e);throw new Error("Expected varint not more than 10 bytes")}l(A1,"readVarintRemainder");function bt(r){return r.type===Q.Bytes?r.readVarint()+r.pos:r.pos+1}l(bt,"readPackedEnd");function rn(r,e,t){return t?e*4294967296+(r>>>0):(e>>>0)*4294967296+(r>>>0)}l(rn,"toNum");function _1(r,e){var t,n;if(r>=0?(t=r%4294967296|0,n=r/4294967296|0):(t=~(-r%4294967296),n=~(-r/4294967296),t^4294967295?t=t+1|0:(t=0,n=n+1|0)),r>=18446744073709552e3||r<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");e.realloc(10),I1(t,n,e),T1(n,e)}l(_1,"writeBigVarint");function I1(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}l(I1,"writeBigVarintLow");function T1(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)))))}l(T1,"writeBigVarintHigh");function Qh(r,e,t){var n=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(Math.LN2*7));t.realloc(n);for(var i=t.pos-1;i>=r;i--)t.buf[i+n]=t.buf[i]}l(Qh,"makeRoomForExtraLength");function C1(r,e){for(var t=0;t<r.length;t++)e.writeVarint(r[t])}l(C1,"writePackedVarint");function k1(r,e){for(var t=0;t<r.length;t++)e.writeSVarint(r[t])}l(k1,"writePackedSVarint");function F1(r,e){for(var t=0;t<r.length;t++)e.writeFloat(r[t])}l(F1,"writePackedFloat");function E1(r,e){for(var t=0;t<r.length;t++)e.writeDouble(r[t])}l(E1,"writePackedDouble");function M1(r,e){for(var t=0;t<r.length;t++)e.writeBoolean(r[t])}l(M1,"writePackedBoolean");function L1(r,e){for(var t=0;t<r.length;t++)e.writeFixed32(r[t])}l(L1,"writePackedFixed32");function D1(r,e){for(var t=0;t<r.length;t++)e.writeSFixed32(r[t])}l(D1,"writePackedSFixed32");function V1(r,e){for(var t=0;t<r.length;t++)e.writeFixed64(r[t])}l(V1,"writePackedFixed64");function B1(r,e){for(var t=0;t<r.length;t++)e.writeSFixed64(r[t])}l(B1,"writePackedSFixed64");function Ss(r,e){return(r[e]|r[e+1]<<8|r[e+2]<<16)+r[e+3]*16777216}l(Ss,"readUInt32");function nn(r,e,t){r[t]=e,r[t+1]=e>>>8,r[t+2]=e>>>16,r[t+3]=e>>>24}l(nn,"writeInt32");function ed(r,e){return(r[e]|r[e+1]<<8|r[e+2]<<16)+(r[e+3]<<24)}l(ed,"readInt32");function R1(r,e,t){for(var n="",i=e;i<t;){var o=r[i],a=null,s=o>239?4:o>223?3:o>191?2:1;if(i+s>t)break;var u,c,p;s===1?o<128&&(a=o):s===2?(u=r[i+1],(u&192)===128&&(a=(o&31)<<6|u&63,a<=127&&(a=null))):s===3?(u=r[i+1],c=r[i+2],(u&192)===128&&(c&192)===128&&(a=(o&15)<<12|(u&63)<<6|c&63,(a<=2047||a>=55296&&a<=57343)&&(a=null))):s===4&&(u=r[i+1],c=r[i+2],p=r[i+3],(u&192)===128&&(c&192)===128&&(p&192)===128&&(a=(o&15)<<18|(u&63)<<12|(c&63)<<6|p&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}l(R1,"readUtf8");function z1(r,e,t){return td.decode(r.subarray(e,t))}l(z1,"readUtf8TextDecoder");function O1(r,e,t){for(var n=0,i,o;n<e.length;n++){if(i=e.charCodeAt(n),i>55295&&i<57344)if(o)if(i<56320){r[t++]=239,r[t++]=191,r[t++]=189,o=i;continue}else i=o-55296<<10|i-56320|65536,o=null;else{i>56319||n+1===e.length?(r[t++]=239,r[t++]=191,r[t++]=189):o=i;continue}else o&&(r[t++]=239,r[t++]=191,r[t++]=189,o=null);i<128?r[t++]=i:(i<2048?r[t++]=i>>6|192:(i<65536?r[t++]=i>>12|224:(r[t++]=i>>18|240,r[t++]=i>>12&63|128),r[t++]=i>>6&63|128),r[t++]=i&63|128)}return t}l(O1,"writeUtf8")});var Kd=we((SV,Yd)=>{g();Yd.exports=Xs;function Xs(r,e){var t=r&&r.type,n;if(t==="FeatureCollection")for(n=0;n<r.features.length;n++)Xs(r.features[n],e);else if(t==="GeometryCollection")for(n=0;n<r.geometries.length;n++)Xs(r.geometries[n],e);else if(t==="Feature")Xs(r.geometry,e);else if(t==="Polygon")Zd(r.coordinates,e);else if(t==="MultiPolygon")for(n=0;n<r.coordinates.length;n++)Zd(r.coordinates[n],e);return r}l(Xs,"rewind");function Zd(r,e){if(r.length!==0){Jd(r[0],e);for(var t=1;t<r.length;t++)Jd(r[t],!e)}}l(Zd,"rewindRings");function Jd(r,e){for(var t=0,n=0,i=0,o=r.length,a=o-1;i<o;a=i++){var s=(r[i][0]-r[a][0])*(r[a][1]+r[i][1]),u=t+s;n+=Math.abs(t)>=Math.abs(s)?t-u+s:s-u+t,t=u}t+n>=0!=!!e&&r.reverse()}l(Jd,"rewindRing")});var rg=we((kV,tg)=>{"use strict";g();var IP=de(),TP=jt().VectorTileFeature;tg.exports=eg;function eg(r,e){this.options=e||{},this.features=r,this.length=r.length}l(eg,"GeoJSONWrapper");eg.prototype.feature=function(r){return new Zs(this.features[r],this.options.extent)};function Zs(r,e){this.id=typeof r.id=="number"?r.id:void 0,this.type=r.type,this.rawGeometry=r.type===1?[r.geometry]:r.geometry,this.properties=r.tags,this.extent=e||4096}l(Zs,"FeatureWrapper");Zs.prototype.loadGeometry=function(){var r=this.rawGeometry;this.geometry=[];for(var e=0;e<r.length;e++){for(var t=r[e],n=[],i=0;i<t.length;i++)n.push(new IP(t[i][0],t[i][1]));this.geometry.push(n)}return this.geometry};Zs.prototype.bbox=function(){this.geometry||this.loadGeometry();for(var r=this.geometry,e=1/0,t=-1/0,n=1/0,i=-1/0,o=0;o<r.length;o++)for(var a=r[o],s=0;s<a.length;s++){var u=a[s];e=Math.min(e,u.x),t=Math.max(t,u.x),n=Math.min(n,u.y),i=Math.max(i,u.y)}return[e,n,t,i]};Zs.prototype.toGeoJSON=TP.prototype.toGeoJSON});var og=we((MV,ao)=>{g();var CP=Ri(),ig=rg();ao.exports=bf;ao.exports.fromVectorTileJs=bf;ao.exports.fromGeojsonVt=kP;ao.exports.GeoJSONWrapper=ig;function bf(r){var e=new CP;return FP(r,e),e.finish()}l(bf,"fromVectorTileJs");function kP(r,e){e=e||{};var t={};for(var n in r)t[n]=new ig(r[n].features,e),t[n].name=n,t[n].version=e.version,t[n].extent=e.extent;return bf({layers:t})}l(kP,"fromGeojsonVt");function FP(r,e){for(var t in r.layers)e.writeMessage(3,EP,r.layers[t])}l(FP,"writeTile");function EP(r,e){e.writeVarintField(15,r.version||1),e.writeStringField(1,r.name||""),e.writeVarintField(5,r.extent||4096);var t,n={keys:[],values:[],keycache:{},valuecache:{}};for(t=0;t<r.length;t++)n.feature=r.feature(t),e.writeMessage(2,MP,n);var i=n.keys;for(t=0;t<i.length;t++)e.writeStringField(3,i[t]);var o=n.values;for(t=0;t<o.length;t++)e.writeMessage(4,VP,o[t])}l(EP,"writeLayer");function MP(r,e){var t=r.feature;t.id!==void 0&&e.writeVarintField(1,t.id),e.writeMessage(2,LP,r),e.writeVarintField(3,t.type),e.writeMessage(4,DP,t)}l(MP,"writeFeature");function LP(r,e){var t=r.feature,n=r.keys,i=r.values,o=r.keycache,a=r.valuecache;for(var s in t.properties){var u=t.properties[s],c=o[s];if(u!==null){typeof c>"u"&&(n.push(s),c=n.length-1,o[s]=c),e.writeVarint(c);var p=typeof u;p!=="string"&&p!=="boolean"&&p!=="number"&&(u=JSON.stringify(u));var f=p+":"+u,y=a[f];typeof y>"u"&&(i.push(u),y=i.length-1,a[f]=y),e.writeVarint(y)}}}l(LP,"writeProperties");function gf(r,e){return(e<<3)+(r&7)}l(gf,"command");function ng(r){return r<<1^r>>31}l(ng,"zigzag");function DP(r,e){for(var t=r.loadGeometry(),n=r.type,i=0,o=0,a=t.length,s=0;s<a;s++){var u=t[s],c=1;n===1&&(c=u.length),e.writeVarint(gf(1,c));for(var p=n===3?u.length-1:u.length,f=0;f<p;f++){f===1&&n!==1&&e.writeVarint(gf(2,p-1));var y=u[f].x-i,m=u[f].y-o;e.writeVarint(ng(y)),e.writeVarint(ng(m)),i+=y,o+=m}n===3&&e.writeVarint(gf(7,1))}}l(DP,"writeGeometry");function VP(r,e){var t=typeof r;t==="string"?e.writeStringField(1,r):t==="boolean"?e.writeBooleanField(7,r):t==="number"&&(r%1!==0?e.writeDoubleField(3,r):r<0?e.writeSVarintField(6,r):e.writeVarintField(5,r))}l(VP,"writeValue")});g();g();g();var yb=ee(de(),1),iy=ee(Wf(),1);g();g();var sl;function Xf(){return sl==null&&(sl=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")&&typeof createImageBitmap=="function"),sl}l(Xf,"offscreenCanvasSupported");var vo;function Hf(){if(vo==null&&(vo=!1,Xf())){let t=new OffscreenCanvas(5,5).getContext("2d",{willReadFrequently:!0});if(t){for(let i=0;i<5*5;i++){let o=i*4;t.fillStyle="rgb(".concat(o,",").concat(o+1,",").concat(o+2,")"),t.fillRect(i%5,Math.floor(i/5),1,1)}let n=t.getImageData(0,0,5,5).data;for(let i=0;i<5*5*4;i++)if(i%4!==3&&n[i]!==i){vo=!0;break}}}return vo||!1}l(Hf,"isOffscreenCanvasDistorted");g();g();var hn=1e-6,dn=typeof Float32Array<"u"?Float32Array:Array,gn=Math.random;var cS=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 Po={};Eg(Po,{add:()=>zg,ceil:()=>Og,clone:()=>Dg,copy:()=>Bg,create:()=>Zf,cross:()=>Jg,dist:()=>lb,distance:()=>Qf,div:()=>sb,divide:()=>Kf,dot:()=>Zg,equals:()=>ib,exactEquals:()=>nb,floor:()=>Gg,forEach:()=>fb,fromValues:()=>Vg,inverse:()=>Xg,len:()=>cb,length:()=>ty,lerp:()=>Yg,max:()=>Ug,min:()=>Ng,mul:()=>ab,multiply:()=>Yf,negate:()=>Wg,normalize:()=>Hg,random:()=>Kg,round:()=>$g,scale:()=>jg,scaleAndAdd:()=>qg,set:()=>Rg,sqrDist:()=>ub,sqrLen:()=>pb,squaredDistance:()=>ey,squaredLength:()=>ry,str:()=>rb,sub:()=>ob,subtract:()=>Jf,transformMat4:()=>Qg,transformQuat:()=>eb,zero:()=>tb});g();function Zf(){var r=new dn(4);return dn!=Float32Array&&(r[0]=0,r[1]=0,r[2]=0,r[3]=0),r}l(Zf,"create");function Dg(r){var e=new dn(4);return e[0]=r[0],e[1]=r[1],e[2]=r[2],e[3]=r[3],e}l(Dg,"clone");function Vg(r,e,t,n){var i=new dn(4);return i[0]=r,i[1]=e,i[2]=t,i[3]=n,i}l(Vg,"fromValues");function Bg(r,e){return r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r}l(Bg,"copy");function Rg(r,e,t,n,i){return r[0]=e,r[1]=t,r[2]=n,r[3]=i,r}l(Rg,"set");function zg(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}l(zg,"add");function Jf(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}l(Jf,"subtract");function Yf(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}l(Yf,"multiply");function Kf(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}l(Kf,"divide");function Og(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}l(Og,"ceil");function Gg(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}l(Gg,"floor");function Ng(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}l(Ng,"min");function Ug(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}l(Ug,"max");function $g(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}l($g,"round");function jg(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}l(jg,"scale");function qg(r,e,t,n){return r[0]=e[0]+t[0]*n,r[1]=e[1]+t[1]*n,r[2]=e[2]+t[2]*n,r[3]=e[3]+t[3]*n,r}l(qg,"scaleAndAdd");function Qf(r,e){var t=e[0]-r[0],n=e[1]-r[1],i=e[2]-r[2],o=e[3]-r[3];return Math.hypot(t,n,i,o)}l(Qf,"distance");function ey(r,e){var t=e[0]-r[0],n=e[1]-r[1],i=e[2]-r[2],o=e[3]-r[3];return t*t+n*n+i*i+o*o}l(ey,"squaredDistance");function ty(r){var e=r[0],t=r[1],n=r[2],i=r[3];return Math.hypot(e,t,n,i)}l(ty,"length");function ry(r){var e=r[0],t=r[1],n=r[2],i=r[3];return e*e+t*t+n*n+i*i}l(ry,"squaredLength");function Wg(r,e){return r[0]=-e[0],r[1]=-e[1],r[2]=-e[2],r[3]=-e[3],r}l(Wg,"negate");function Xg(r,e){return r[0]=1/e[0],r[1]=1/e[1],r[2]=1/e[2],r[3]=1/e[3],r}l(Xg,"inverse");function Hg(r,e){var t=e[0],n=e[1],i=e[2],o=e[3],a=t*t+n*n+i*i+o*o;return a>0&&(a=1/Math.sqrt(a)),r[0]=t*a,r[1]=n*a,r[2]=i*a,r[3]=o*a,r}l(Hg,"normalize");function Zg(r,e){return r[0]*e[0]+r[1]*e[1]+r[2]*e[2]+r[3]*e[3]}l(Zg,"dot");function Jg(r,e,t,n){var i=t[0]*n[1]-t[1]*n[0],o=t[0]*n[2]-t[2]*n[0],a=t[0]*n[3]-t[3]*n[0],s=t[1]*n[2]-t[2]*n[1],u=t[1]*n[3]-t[3]*n[1],c=t[2]*n[3]-t[3]*n[2],p=e[0],f=e[1],y=e[2],m=e[3];return r[0]=f*c-y*u+m*s,r[1]=-(p*c)+y*a-m*o,r[2]=p*u-f*a+m*i,r[3]=-(p*s)+f*o-y*i,r}l(Jg,"cross");function Yg(r,e,t,n){var i=e[0],o=e[1],a=e[2],s=e[3];return r[0]=i+n*(t[0]-i),r[1]=o+n*(t[1]-o),r[2]=a+n*(t[2]-a),r[3]=s+n*(t[3]-s),r}l(Yg,"lerp");function Kg(r,e){e=e||1;var t,n,i,o,a,s;do t=gn()*2-1,n=gn()*2-1,a=t*t+n*n;while(a>=1);do i=gn()*2-1,o=gn()*2-1,s=i*i+o*o;while(s>=1);var u=Math.sqrt((1-a)/s);return r[0]=e*t,r[1]=e*n,r[2]=e*i*u,r[3]=e*o*u,r}l(Kg,"random");function Qg(r,e,t){var n=e[0],i=e[1],o=e[2],a=e[3];return r[0]=t[0]*n+t[4]*i+t[8]*o+t[12]*a,r[1]=t[1]*n+t[5]*i+t[9]*o+t[13]*a,r[2]=t[2]*n+t[6]*i+t[10]*o+t[14]*a,r[3]=t[3]*n+t[7]*i+t[11]*o+t[15]*a,r}l(Qg,"transformMat4");function eb(r,e,t){var n=e[0],i=e[1],o=e[2],a=t[0],s=t[1],u=t[2],c=t[3],p=c*n+s*o-u*i,f=c*i+u*n-a*o,y=c*o+a*i-s*n,m=-a*n-s*i-u*o;return r[0]=p*c+m*-a+f*-u-y*-s,r[1]=f*c+m*-s+y*-a-p*-u,r[2]=y*c+m*-u+p*-s-f*-a,r[3]=e[3],r}l(eb,"transformQuat");function tb(r){return r[0]=0,r[1]=0,r[2]=0,r[3]=0,r}l(tb,"zero");function rb(r){return"vec4("+r[0]+", "+r[1]+", "+r[2]+", "+r[3]+")"}l(rb,"str");function nb(r,e){return r[0]===e[0]&&r[1]===e[1]&&r[2]===e[2]&&r[3]===e[3]}l(nb,"exactEquals");function ib(r,e){var t=r[0],n=r[1],i=r[2],o=r[3],a=e[0],s=e[1],u=e[2],c=e[3];return Math.abs(t-a)<=hn*Math.max(1,Math.abs(t),Math.abs(a))&&Math.abs(n-s)<=hn*Math.max(1,Math.abs(n),Math.abs(s))&&Math.abs(i-u)<=hn*Math.max(1,Math.abs(i),Math.abs(u))&&Math.abs(o-c)<=hn*Math.max(1,Math.abs(o),Math.abs(c))}l(ib,"equals");var ob=Jf,ab=Yf,sb=Kf,lb=Qf,ub=ey,cb=ty,pb=ry,fb=function(){var r=Zf();return function(e,t,n,i,o,a){var s,u;for(t||(t=4),n||(n=0),i?u=Math.min(i*t+n,e.length):u=e.length,s=n;s<u;s+=t)r[0]=e[s],r[1]=e[s+1],r[2]=e[s+2],r[3]=e[s+3],o(r,r,a),e[s]=r[0],e[s+1]=r[1],e[s+2]=r[2],e[s+3]=r[3];return e}}();g();g();function oy(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)}l(oy,"easeCubicInOut");function mb(r,e,t,n){let i=new iy.default(r,e,t,n);return o=>i.solve(o)}l(mb,"bezier");var IS=mb(.25,.1,.25,1);function lt(r,e,t){return Math.min(t,Math.max(e,r))}l(lt,"clamp");function ay(r,e,t){let n=t-e,i=((r-e)%n+n)%n+e;return i===e?t:i}l(ay,"wrap");function xe(r,...e){for(let t of e)for(let n in t)r[n]=t[n];return r}l(xe,"extend");function sy(r){return Math.log(r)/Math.LN2%1===0}l(sy,"isPowerOfTwo");function vn(r,e,t){let n={};for(let i in r)n[i]=e.call(t||this,r[i],i,r);return n}l(vn,"mapObject");function ly(r,e,t){let n={};for(let i in r)e.call(t||this,r[i],i,r)&&(n[i]=r[i]);return n}l(ly,"filterObject");function st(r){return Array.isArray(r)?r.map(st):typeof r=="object"&&r?vn(r,st):r}l(st,"clone");var ny={};function ye(r){ny[r]||(typeof console<"u"&&console.warn(r),ny[r]=!0)}l(ye,"warnOnce");function ut(r,e,t){return(t.y-r.y)*(e.x-r.x)>(e.y-r.y)*(t.x-r.x)}l(ut,"isCounterClockwise");function ct(r){return typeof WorkerGlobalScope<"u"&&typeof r<"u"&&r instanceof WorkerGlobalScope}l(ct,"isWorker");function At(r){return typeof ImageBitmap<"u"&&r instanceof ImageBitmap}l(At,"isImageBitmap");function hb(r,e,t,n,i){let o=Math.max(-e,0)*4,u=(Math.max(0,t)-t)*n*4+o,c=n*4,p=Math.max(0,e),f=Math.max(0,t),y=Math.min(r.width,e+n),m=Math.min(r.height,t+i);return{rect:{x:p,y:f,width:y-p,height:m-f},layout:[{offset:u,stride:c}]}}l(hb,"computeVideoFrameParameters");async function db(r,e,t,n,i){if(typeof VideoFrame>"u")throw new Error("VideoFrame not supported");let o=new VideoFrame(r,{timestamp:0});try{let a=o==null?void 0:o.format;if(!a||!(a.startsWith("BGR")||a.startsWith("RGB")))throw new Error("Unrecognized format ".concat(a));let s=a.startsWith("BGR"),u=new Uint8ClampedArray(n*i*4);if(await o.copyTo(u,hb(r,e,t,n,i)),s)for(let c=0;c<u.length;c+=4){let p=u[c];u[c]=u[c+2],u[c+2]=p}return u}finally{o.close()}}l(db,"readImageUsingVideoFrame");var bn,xn;function gb(r,e,t,n,i){let o=r.width,a=r.height;(!bn||!xn)&&(bn=new OffscreenCanvas(o,a),xn=bn.getContext("2d",{willReadFrequently:!0})),bn.width=o,bn.height=a,xn.drawImage(r,0,0,o,a);let s=xn.getImageData(e,t,n,i);return xn.clearRect(0,0,o,a),s.data}l(gb,"readImageDataUsingOffscreenCanvas");async function uy(r,e,t,n,i){if(Hf())try{return await db(r,e,t,n,i)}catch(o){}return gb(r,e,t,n,i)}l(uy,"getImageData");function ll(r,e,t,n){return r.addEventListener(e,t,n),{unsubscribe:l(()=>{r.removeEventListener(e,t,n)},"unsubscribe")}}l(ll,"subscribe");function ul(r){return r*Math.PI/180}l(ul,"degreesToRadians");var So=25,wo=0;g();g();var Ao=class Ao{constructor(e,t,n){let i=this.cells=[];if(e instanceof ArrayBuffer){this.arrayBuffer=e;let a=new Int32Array(this.arrayBuffer);e=a[0],t=a[1],n=a[2],this.d=t+2*n;for(let c=0;c<this.d*this.d;c++){let p=a[3+c],f=a[3+c+1];i.push(p===f?null:a.subarray(p,f))}let s=a[3+i.length],u=a[3+i.length+1];this.keys=a.subarray(s,u),this.bboxes=a.subarray(u),this.insert=this._insertReadonly}else{this.d=t+2*n;for(let a=0;a<this.d*this.d;a++)i.push([]);this.keys=[],this.bboxes=[]}this.n=t,this.extent=e,this.padding=n,this.scale=t/e,this.uid=0;let o=n/t*e;this.min=-o,this.max=e+o}insert(e,t,n,i,o){this._forEachCell(t,n,i,o,this._insertCell,this.uid++,void 0,void 0),this.keys.push(e),this.bboxes.push(t),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(e,t,n,i,o,a){this.cells[o].push(a)}query(e,t,n,i,o){let a=this.min,s=this.max;if(e<=a&&t<=a&&s<=n&&s<=i&&!o)return Array.prototype.slice.call(this.keys);{let u=[],c={};return this._forEachCell(e,t,n,i,this._queryCell,u,c,o),u}}_queryCell(e,t,n,i,o,a,s,u){let c=this.cells[o];if(c!==null){let p=this.keys,f=this.bboxes;for(let y=0;y<c.length;y++){let m=c[y];if(s[m]===void 0){let h=m*4;(u?u(f[h+0],f[h+1],f[h+2],f[h+3]):e<=f[h+2]&&t<=f[h+3]&&n>=f[h+0]&&i>=f[h+1])?(s[m]=!0,a.push(p[m])):s[m]=!1}}}}_forEachCell(e,t,n,i,o,a,s,u){let c=this._convertToCellCoord(e),p=this._convertToCellCoord(t),f=this._convertToCellCoord(n),y=this._convertToCellCoord(i);for(let m=c;m<=f;m++)for(let h=p;h<=y;h++){let d=this.d*h+m;if(!(u&&!u(this._convertFromCellCoord(m),this._convertFromCellCoord(h),this._convertFromCellCoord(m+1),this._convertFromCellCoord(h+1)))&&o.call(this,e,t,n,i,d,a,s,u))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,n=0;for(let a=0;a<this.cells.length;a++)n+=this.cells[a].length;let i=new Int32Array(t+n+this.keys.length+this.bboxes.length);i[0]=this.extent,i[1]=this.n,i[2]=this.padding;let o=t;for(let a=0;a<e.length;a++){let s=e[a];i[3+a]=o,i.set(s,o),o+=s.length}return i[3+e.length]=o,i.set(this.keys,o),o+=this.keys.length,i[3+e.length+1]=o,i.set(this.bboxes,o),o+=this.bboxes.length,i.buffer}static serialize(e,t){let n=e.toArrayBuffer();return t&&t.push(n),{buffer:n}}static deserialize(e){return new Ao(e.buffer)}};l(Ao,"TransferableGridIndex");var Yt=Ao;g();var bb=8,xb={version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},centerAltitude:{type:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},roll:{type:"number",default:0,units:"degrees"},state:{type:"state",default:{}},light:{type:"light"},sky:{type:"sky"},projection:{type:"projection"},terrain:{type:"terrain"},sources:{required:!0,type:"sources"},sprite:{type:"sprite"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},vb={"*":{type:"source"}},Pb=["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],Sb={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:"*"}},wb={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:"*"}},Ab={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:{},custom:{}},default:"mapbox"},redFactor:{type:"number",default:1},blueFactor:{type:"number",default:1},greenFactor:{type:"number",default:1},baseShift:{type:"number",default:0},volatile:{type:"boolean",default:!1},"*":{type:"*"}},_b={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"}},Ib={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"}}},Tb={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"}}},Cb={id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},"color-relief":{},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"}},kb=["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_color-relief","layout_background"],Fb={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},Eb={"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"}},Mb={"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"}},Lb={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},Db={"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"}},Vb={"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"}},Bb={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},Rb={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},zb={type:"array",value:"*"},Ob={type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{}}},Gb={type:"enum",values:{Point:{},LineString:{},Polygon:{}}},Nb={type:"array",minimum:0,maximum:24,value:["number","color"],length:2},Ub={type:"array",value:"*",minimum:1},$b={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}},jb={"sky-color":{type:"color","property-type":"data-constant",default:"#88C6FC",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-ground-blend":{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-fog-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"sky-horizon-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"atmosphere-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},qb={source:{type:"string",required:!0},exaggeration:{type:"number",minimum:0,default:1}},Wb={type:{type:"projectionDefinition",default:"mercator","property-type":"data-constant",transition:!1,expression:{interpolated:!0,parameters:["zoom"]}}},Xb=["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_color-relief","paint_background"],Hb={"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"}},Zb={"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"}},Jb={"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"}},Yb={"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"}},Kb={"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"}},Qb={"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"}},ex={"hillshade-illumination-direction":{type:"numberArray",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-altitude":{type:"numberArray",default:45,minimum:0,maximum:90,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:"colorArray",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"colorArray",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"},"hillshade-method":{type:"enum",values:{standard:{},basic:{},combined:{},igor:{},multidirectional:{}},default:"standard",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},tx={"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"}},rx={duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},nx={"*":{type:"string"}},A={$version:bb,$root:xb,sources:vb,source:Pb,source_vector:Sb,source_raster:wb,source_raster_dem:Ab,source_geojson:_b,source_video:Ib,source_image:Tb,layer:Cb,layout:kb,layout_background:Fb,layout_fill:Eb,layout_circle:Mb,layout_heatmap:Lb,"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:Db,layout_symbol:Vb,layout_raster:Bb,layout_hillshade:Rb,"layout_color-relief":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},filter:zb,filter_operator:Ob,geometry_type:Gb,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:Nb,expression:Ub,light:$b,sky:jb,terrain:qb,projection:Wb,paint:Xb,paint_fill:Hb,"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:Zb,paint_circle:Jb,paint_heatmap:Yb,paint_symbol:Kb,paint_raster:Qb,paint_hillshade:ex,"paint_color-relief":{"color-relief-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"color-relief-color":{type:"color",transition:!1,expression:{interpolated:!0,parameters:["elevation"]},"property-type":"color-ramp"}},paint_background:tx,transition:rx,"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:nx},ix=["type","source","source-layer","minzoom","maxzoom","filter","layout"];var Wl=class Wl{constructor(e,t,n,i){this.message=(e?"".concat(e,": "):"")+n,i&&(this.identifier=i),t!=null&&t.__line__&&(this.line=t.__line__)}};l(Wl,"ValidationError");var E=Wl;function Br(r,...e){for(let t of e)for(let n in t)r[n]=t[n];return r}l(Br,"extendBy");var Xl=class Xl extends Error{constructor(e,t){super(t),this.message=t,this.key=e}};l(Xl,"ExpressionParsingError");var Ge=Xl,$o=class $o{constructor(e,t=[]){this.parent=e,this.bindings={};for(let[n,i]of t)this.bindings[n]=i}concat(e){return new $o(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}};l($o,"Scope");var xl=$o,Gr={kind:"null"},M={kind:"number"},W={kind:"string"},q={kind:"boolean"},Ue={kind:"color"},ua={kind:"projectionDefinition"},ir={kind:"object"},j={kind:"value"},ox={kind:"error"},ca={kind:"collator"},Nr={kind:"formatted"},pa={kind:"padding"},Cn={kind:"colorArray"},fa={kind:"numberArray"},Un={kind:"resolvedImage"},ya={kind:"variableAnchorOffsetCollection"};function Ee(r,e){return{kind:"array",itemType:r,N:e}}l(Ee,"array");function se(r){if(r.kind==="array"){let e=se(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}l(se,"typeToString");var ax=[Gr,M,W,q,Ue,ua,Nr,ir,Ee(j),pa,fa,Cn,Un,ya];function kn(r,e){if(e.kind==="error")return null;if(r.kind==="array"){if(e.kind==="array"&&(e.N===0&&e.itemType.kind==="value"||!kn(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 ax)if(!kn(t,e))return null}}return"Expected ".concat(se(r)," but found ").concat(se(e)," instead.")}l(kn,"checkSubtype");function Rl(r,e){return e.some(t=>t.kind===r.kind)}l(Rl,"isValidType");function or(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)}l(or,"isValidNativeType");function _t(r,e){return r.kind==="array"&&e.kind==="array"?r.itemType.kind===e.itemType.kind&&typeof r.N=="number":r.kind===e.kind}l(_t,"verifyType");var Fy=.96422,Ey=1,My=.82521,Ly=4/29,Vr=6/29,Dy=3*Vr*Vr,sx=Vr*Vr*Vr,lx=Math.PI/180,ux=180/Math.PI;function Vy(r){return r=r%360,r<0&&(r+=360),r}l(Vy,"constrainAngle");function By([r,e,t,n]){r=cl(r),e=cl(e),t=cl(t);let i,o,a=pl((.2225045*r+.7168786*e+.0606169*t)/Ey);r===e&&e===t?i=o=a:(i=pl((.4360747*r+.3850649*e+.1430804*t)/Fy),o=pl((.0139322*r+.0971045*e+.7141733*t)/My));let s=116*a-16;return[s<0?0:s,500*(i-a),200*(a-o),n]}l(By,"rgbToLab");function cl(r){return r<=.04045?r/12.92:Math.pow((r+.055)/1.055,2.4)}l(cl,"rgb2xyz");function pl(r){return r>sx?Math.pow(r,1/3):r/Dy+Ly}l(pl,"xyz2lab");function Ry([r,e,t,n]){let i=(r+16)/116,o=isNaN(e)?i:i+e/500,a=isNaN(t)?i:i-t/200;return i=Ey*yl(i),o=Fy*yl(o),a=My*yl(a),[fl(3.1338561*o-1.6168667*i-.4906146*a),fl(-.9787684*o+1.9161415*i+.033454*a),fl(.0719453*o-.2289914*i+1.4052427*a),n]}l(Ry,"labToRgb");function fl(r){return r=r<=.00304?12.92*r:1.055*Math.pow(r,1/2.4)-.055,r<0?0:r>1?1:r}l(fl,"xyz2rgb");function yl(r){return r>Vr?r*r*r:Dy*(r-Ly)}l(yl,"lab2xyz");function cx(r){let[e,t,n,i]=By(r),o=Math.sqrt(t*t+n*n);return[Math.round(o*1e4)?Vy(Math.atan2(n,t)*ux):NaN,o,e,i]}l(cx,"rgbToHcl");function px([r,e,t,n]){return r=isNaN(r)?0:r*lx,Ry([t,Math.cos(r)*e,Math.sin(r)*e,n])}l(px,"hclToRgb");function fx([r,e,t,n]){r=Vy(r),e/=100,t/=100;function i(o){let a=(o+r/30)%12,s=e*Math.min(t,1-t);return t-s*Math.max(-1,Math.min(a-3,9-a,1))}return l(i,"f"),[i(0),i(8),i(4),n]}l(fx,"hslToRgb");var yx=Object.hasOwn||l(function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},"hasOwnProperty");function Sn(r,e){return yx(r,e)?r[e]:void 0}l(Sn,"getOwn");function mx(r){if(r=r.toLowerCase().trim(),r==="transparent")return[0,0,0,0];let e=Sn(hx,r);if(e){let[i,o,a]=e;return[i/255,o/255,a/255,1]}if(r.startsWith("#")&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(r)){let o=r.length<6?1:2,a=1;return[_o(r.slice(a,a+=o)),_o(r.slice(a,a+=o)),_o(r.slice(a,a+=o)),_o(r.slice(a,a+o)||"ff")]}if(r.startsWith("rgb")){let i=/^rgba?\(\s*([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/,o=r.match(i);if(o){let[a,s,u,c,p,f,y,m,h,d,x,b]=o,P=[c||" ",y||" ",d].join("");if(P===" "||P===" /"||P===",,"||P===",,,"){let v=[u,f,h].join(""),S=v==="%%%"?100:v===""?255:0;if(S){let _=[kr(+s/S,0,1),kr(+p/S,0,1),kr(+m/S,0,1),x?cy(+x,b):1];if(py(_))return _}}return}}let t=/^hsla?\(\s*([\de.+-]+)(?:deg)?(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/,n=r.match(t);if(n){let[i,o,a,s,u,c,p,f,y]=n,m=[a||" ",u||" ",p].join("");if(m===" "||m===" /"||m===",,"||m===",,,"){let h=[+o,kr(+s,0,100),kr(+c,0,100),f?cy(+f,y):1];if(py(h))return fx(h)}}}l(mx,"parseCssColor");function _o(r){return parseInt(r.padEnd(2,r),16)/255}l(_o,"parseHex");function cy(r,e){return kr(e?r/100:r,0,1)}l(cy,"parseAlpha");function kr(r,e,t){return Math.min(Math.max(e,r),t)}l(kr,"clamp");function py(r){return!r.some(Number.isNaN)}l(py,"validateNumbers");var hx={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]};function kt(r,e,t){return r+t*(e-r)}l(kt,"interpolateNumber");function Rr(r,e,t){return r.map((n,i)=>kt(n,e[i],t))}l(Rr,"interpolateArray");function dx(r){return r==="rgb"||r==="hcl"||r==="lab"}l(dx,"isSupportedInterpolationColorSpace");var It=class It{constructor(e,t,n,i=1,o=!0){this.r=e,this.g=t,this.b=n,this.a=i,o||(this.r*=i,this.g*=i,this.b*=i,i||this.overwriteGetter("rgb",[e,t,n,i]))}static parse(e){if(e instanceof It)return e;if(typeof e!="string")return;let t=mx(e);if(t)return new It(...t,!1)}get rgb(){let{r:e,g:t,b:n,a:i}=this,o=i||1/0;return this.overwriteGetter("rgb",[e/o,t/o,n/o,i])}get hcl(){return this.overwriteGetter("hcl",cx(this.rgb))}get lab(){return this.overwriteGetter("lab",By(this.rgb))}overwriteGetter(e,t){return Object.defineProperty(this,e,{value:t}),t}toString(){let[e,t,n,i]=this.rgb;return"rgba(".concat([e,t,n].map(o=>Math.round(o*255)).join(","),",").concat(i,")")}static interpolate(e,t,n,i="rgb"){switch(i){case"rgb":{let[o,a,s,u]=Rr(e.rgb,t.rgb,n);return new It(o,a,s,u,!1)}case"hcl":{let[o,a,s,u]=e.hcl,[c,p,f,y]=t.hcl,m,h;if(!isNaN(o)&&!isNaN(c)){let v=c-o;c>o&&v>180?v-=360:c<o&&o-c>180&&(v+=360),m=o+n*v}else isNaN(o)?isNaN(c)?m=NaN:(m=c,(s===1||s===0)&&(h=p)):(m=o,(f===1||f===0)&&(h=a));let[d,x,b,P]=px([m,h!=null?h:kt(a,p,n),kt(s,f,n),kt(u,y,n)]);return new It(d,x,b,P,!1)}case"lab":{let[o,a,s,u]=Ry(Rr(e.lab,t.lab,n));return new It(o,a,s,u,!1)}}}};l(It,"Color");var Y=It;Y.black=new Y(0,0,0,1);Y.white=new Y(1,1,1,1);Y.transparent=new Y(0,0,0,0);Y.red=new Y(1,0,0,1);var Hl=class Hl{constructor(e,t,n){e?this.sensitivity=t?"variant":"case":this.sensitivity=t?"accent":"base",this.locale=n,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}};l(Hl,"Collator");var Fn=Hl,gx=["bottom","center","top"],Zl=class Zl{constructor(e,t,n,i,o,a){this.text=e,this.image=t,this.scale=n,this.fontStack=i,this.textColor=o,this.verticalAlign=a}};l(Zl,"FormattedSection");var En=Zl,Er=class Er{constructor(e){this.sections=e}static fromString(e){return new Er([new En(e,null,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 Er?e:Er.fromString(e)}toString(){return this.sections.length===0?"":this.sections.map(e=>e.text).join("")}};l(Er,"Formatted");var Le=Er,Qt=class Qt{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof Qt)return e;if(typeof e=="number")return new Qt([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 Qt(e)}}toString(){return JSON.stringify(this.values)}static interpolate(e,t,n){return new Qt(Rr(e.values,t.values,n))}};l(Qt,"Padding");var $e=Qt,er=class er{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof er)return e;if(typeof e=="number")return new er([e]);if(Array.isArray(e)){for(let t of e)if(typeof t!="number")return;return new er(e)}}toString(){return JSON.stringify(this.values)}static interpolate(e,t,n){return new er(Rr(e.values,t.values,n))}};l(er,"NumberArray");var je=er,tr=class tr{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof tr)return e;if(typeof e=="string"){let n=Y.parse(e);return n?new tr([n]):void 0}if(!Array.isArray(e))return;let t=[];for(let n of e){if(typeof n!="string")return;let i=Y.parse(n);if(!i)return;t.push(i)}return new tr(t)}toString(){return JSON.stringify(this.values)}static interpolate(e,t,n,i="rgb"){let o=[];if(e.values.length!=t.values.length)throw new Error("colorArray: Arrays have mismatched length (".concat(e.values.length," vs. ").concat(t.values.length,"), cannot interpolate."));for(let a=0;a<e.values.length;a++)o.push(Y.interpolate(e.values[a],t.values[a],n,i));return new tr(o)}};l(tr,"ColorArray");var Ae=tr,Jl=class Jl extends Error{constructor(e){super(e),this.name="RuntimeError"}toJSON(){return this.message}};l(Jl,"RuntimeError");var ae=Jl,bx=new Set(["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"]),Mr=class Mr{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof Mr)return e;if(!(!Array.isArray(e)||e.length<1||e.length%2!==0)){for(let t=0;t<e.length;t+=2){let n=e[t],i=e[t+1];if(typeof n!="string"||!bx.has(n)||!Array.isArray(i)||i.length!==2||typeof i[0]!="number"||typeof i[1]!="number")return}return new Mr(e)}}toString(){return JSON.stringify(this.values)}static interpolate(e,t,n){let i=e.values,o=t.values;if(i.length!==o.length)throw new ae("Cannot interpolate values of different length. from: ".concat(e.toString(),", to: ").concat(t.toString()));let a=[];for(let s=0;s<i.length;s+=2){if(i[s]!==o[s])throw new ae("Cannot interpolate values containing mismatched anchors. from[".concat(s,"]: ").concat(i[s],", to[").concat(s,"]: ").concat(o[s]));a.push(i[s]);let[u,c]=i[s+1],[p,f]=o[s+1];a.push([kt(u,p,n),kt(c,f,n)])}return new Mr(a)}};l(Mr,"VariableAnchorOffsetCollection");var De=Mr,jo=class jo{constructor(e){this.name=e.name,this.available=e.available}toString(){return this.name}static fromString(e){return e?new jo({name:e,available:!1}):null}};l(jo,"ResolvedImage");var _e=jo,Tt=class Tt{constructor(e,t,n){this.from=e,this.to=t,this.transition=n}static interpolate(e,t,n){return new Tt(e,t,n)}static parse(e){if(e instanceof Tt)return e;if(Array.isArray(e)&&e.length===3&&typeof e[0]=="string"&&typeof e[1]=="string"&&typeof e[2]=="number")return new Tt(e[0],e[1],e[2]);if(typeof e=="object"&&typeof e.from=="string"&&typeof e.to=="string"&&typeof e.transition=="number")return new Tt(e.from,e.to,e.transition);if(typeof e=="string")return new Tt(e,e,1)}};l(Tt,"ProjectionDefinition");var Ft=Tt;function zy(r,e,t,n){if(!(typeof r=="number"&&r>=0&&r<=255&&typeof e=="number"&&e>=0&&e<=255&&typeof t=="number"&&t>=0&&t<=255)){let i=typeof n=="number"?[r,e,t,n]:[r,e,t];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([r,e,t,n].join(", "),"]: 'a' must be between 0 and 1.")}l(zy,"validateRGBA");function Mn(r){if(r===null||typeof r=="string"||typeof r=="boolean"||typeof r=="number"||r instanceof Ft||r instanceof Y||r instanceof Fn||r instanceof Le||r instanceof $e||r instanceof je||r instanceof Ae||r instanceof De||r instanceof _e)return!0;if(Array.isArray(r)){for(let e of r)if(!Mn(e))return!1;return!0}else if(typeof r=="object"){for(let e in r)if(!Mn(r[e]))return!1;return!0}else return!1}l(Mn,"isValue");function fe(r){if(r===null)return Gr;if(typeof r=="string")return W;if(typeof r=="boolean")return q;if(typeof r=="number")return M;if(r instanceof Y)return Ue;if(r instanceof Ft)return ua;if(r instanceof Fn)return ca;if(r instanceof Le)return Nr;if(r instanceof $e)return pa;if(r instanceof je)return fa;if(r instanceof Ae)return Cn;if(r instanceof De)return ya;if(r instanceof _e)return Un;if(Array.isArray(r)){let e=r.length,t;for(let n of r){let i=fe(n);if(!t)t=i;else{if(t===i)continue;t=j;break}}return Ee(t||j,e)}else return ir}l(fe,"typeOf");function wn(r){let e=typeof r;return r===null?"":e==="string"||e==="number"||e==="boolean"?String(r):r instanceof Y||r instanceof Ft||r instanceof Le||r instanceof $e||r instanceof je||r instanceof Ae||r instanceof De||r instanceof _e?r.toString():JSON.stringify(r)}l(wn,"valueToString");var qo=class qo{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(!Mn(e[1]))return t.error("invalid value");let n=e[1],i=fe(n),o=t.expectedType;return i.kind==="array"&&i.N===0&&o&&o.kind==="array"&&(typeof o.N!="number"||o.N===0)&&(i=o),new qo(i,n)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}};l(qo,"Literal");var Et=qo,Io={string:W,number:M,boolean:q,object:ir},Wo=class Wo{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 n=1,i,o=e[0];if(o==="array"){let s;if(e.length>2){let c=e[1];if(typeof c!="string"||!(c in Io)||c==="object")return t.error('The item type argument of "array" must be one of string, number, boolean',1);s=Io[c],n++}else s=j;let u;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);u=e[2],n++}i=Ee(s,u)}else{if(!Io[o])throw new Error("Types doesn't contain name = ".concat(o));i=Io[o]}let a=[];for(;n<e.length;n++){let s=t.parse(e[n],n,j);if(!s)return null;a.push(s)}return new Wo(i,a)}evaluate(e){for(let t=0;t<this.args.length;t++){let n=this.args[t].evaluate(e);if(kn(this.type,fe(n))){if(t===this.args.length-1)throw new ae("Expected value to be of type ".concat(se(this.type),", but found ").concat(se(fe(n))," instead."))}else return n}throw new Error}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}};l(Wo,"Assertion");var Xe=Wo,fy={"to-boolean":q,"to-color":Ue,"to-number":M,"to-string":W},Xo=class Xo{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 n=e[0];if(!fy[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")&&e.length!==2)return t.error("Expected one argument.");let i=fy[n],o=[];for(let a=1;a<e.length;a++){let s=t.parse(e[a],a,j);if(!s)return null;o.push(s)}return new Xo(i,o)}evaluate(e){switch(this.type.kind){case"boolean":return!!this.args[0].evaluate(e);case"color":{let t,n;for(let i of this.args){if(t=i.evaluate(e),n=null,t instanceof Y)return t;if(typeof t=="string"){let o=e.parseColor(t);if(o)return o}else if(Array.isArray(t)&&(t.length<3||t.length>4?n="Invalid rgba value ".concat(JSON.stringify(t),": expected an array containing either three or four numeric values."):n=zy(t[0],t[1],t[2],t[3]),!n))return new Y(t[0]/255,t[1]/255,t[2]/255,t[3])}throw new ae(n||"Could not parse color from value '".concat(typeof t=="string"?t:JSON.stringify(t),"'"))}case"padding":{let t;for(let n of this.args){t=n.evaluate(e);let i=$e.parse(t);if(i)return i}throw new ae("Could not parse padding from value '".concat(typeof t=="string"?t:JSON.stringify(t),"'"))}case"numberArray":{let t;for(let n of this.args){t=n.evaluate(e);let i=je.parse(t);if(i)return i}throw new ae("Could not parse numberArray from value '".concat(typeof t=="string"?t:JSON.stringify(t),"'"))}case"colorArray":{let t;for(let n of this.args){t=n.evaluate(e);let i=Ae.parse(t);if(i)return i}throw new ae("Could not parse colorArray from value '".concat(typeof t=="string"?t:JSON.stringify(t),"'"))}case"variableAnchorOffsetCollection":{let t;for(let n of this.args){t=n.evaluate(e);let i=De.parse(t);if(i)return i}throw new ae("Could not parse variableAnchorOffsetCollection from value '".concat(typeof t=="string"?t:JSON.stringify(t),"'"))}case"number":{let t=null;for(let n of this.args){if(t=n.evaluate(e),t===null)return 0;let i=Number(t);if(!isNaN(i))return i}throw new ae("Could not convert ".concat(JSON.stringify(t)," to number."))}case"formatted":return Le.fromString(wn(this.args[0].evaluate(e)));case"resolvedImage":return _e.fromString(wn(this.args[0].evaluate(e)));case"projectionDefinition":return this.args[0].evaluate(e);default:return wn(this.args[0].evaluate(e))}}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}};l(Xo,"Coercion");var Ct=Xo,xx=["Unknown","Point","LineString","Polygon"],Yl=class Yl{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache=new Map,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"?xx[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.get(e);return t||(t=Y.parse(e),this._parseColorCache.set(e,t)),t}};l(Yl,"EvaluationContext");var Fo=Yl,Ho=class Ho{constructor(e,t,n=[],i,o=new xl,a=[]){this.registry=e,this.path=n,this.key=n.map(s=>"[".concat(s,"]")).join(""),this.scope=o,this.errors=a,this.expectedType=i,this._isConstant=t}parse(e,t,n,i,o={}){return t?this.concat(t,n,i)._parse(e,o):this._parse(e,o)}_parse(e,t){(e===null||typeof e=="string"||typeof e=="boolean"||typeof e=="number")&&(e=["literal",e]);function n(i,o,a){return a==="assert"?new Xe(o,[i]):a==="coerce"?new Ct(o,[i]):i}if(l(n,"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 i=e[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(e,this);if(!a)return null;if(this.expectedType){let s=this.expectedType,u=a.type;if((s.kind==="string"||s.kind==="number"||s.kind==="boolean"||s.kind==="object"||s.kind==="array")&&u.kind==="value")a=n(a,s,t.typeAnnotation||"assert");else if(s.kind==="projectionDefinition"&&["string","array"].includes(u.kind)||["color","formatted","resolvedImage"].includes(s.kind)&&["value","string"].includes(u.kind)||["padding","numberArray"].includes(s.kind)&&["value","number","array"].includes(u.kind)||s.kind==="colorArray"&&["value","string","array"].includes(u.kind)||s.kind==="variableAnchorOffsetCollection"&&["value","array"].includes(u.kind))a=n(a,s,t.typeAnnotation||"coerce");else if(this.checkSubtype(s,u))return null}if(!(a instanceof Et)&&a.type.kind!=="resolvedImage"&&this._isConstant(a)){let s=new Fo;try{a=new Et(a.type,a.evaluate(s))}catch(u){return this.error(u.message),null}}return a}return this.error('Unknown expression "'.concat(i,'". 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,n){let i=typeof e=="number"?this.path.concat(e):this.path,o=n?this.scope.concat(n):this.scope;return new Ho(this.registry,this._isConstant,i,t||null,o,this.errors)}error(e,...t){let n="".concat(this.key).concat(t.map(i=>"[".concat(i,"]")).join(""));this.errors.push(new Ge(n,e))}checkSubtype(e,t){let n=kn(e,t);return n&&this.error(n),n}};l(Ho,"ParsingContext");var Eo=Ho,Zo=class Zo{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 n=[];for(let o=1;o<e.length-1;o+=2){let a=e[o];if(typeof a!="string")return t.error("Expected string, but found ".concat(typeof a," instead."),o);if(/[^a-zA-Z0-9_]/.test(a))return t.error("Variable names must contain only alphanumeric characters or '_'.",o);let s=t.parse(e[o+1],o+1);if(!s)return null;n.push([a,s])}let i=t.parse(e[e.length-1],e.length-1,t.expectedType,n);return i?new Zo(n,i):null}outputDefined(){return this.result.outputDefined()}};l(Zo,"Let");var Mo=Zo,Jo=class Jo{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 n=e[1];return t.scope.has(n)?new Jo(n,t.scope.get(n)):t.error('Unknown variable "'.concat(n,'". Make sure "').concat(n,'" has been bound in an enclosing "let" expression before using it.'),1)}evaluate(e){return this.boundExpression.evaluate(e)}eachChild(){}outputDefined(){return!1}};l(Jo,"Var");var Lo=Jo,Yo=class Yo{constructor(e,t,n){this.type=e,this.index=t,this.input=n}static parse(e,t){if(e.length!==3)return t.error("Expected 2 arguments, but found ".concat(e.length-1," instead."));let n=t.parse(e[1],1,M),i=t.parse(e[2],2,Ee(t.expectedType||j));if(!n||!i)return null;let o=i.type;return new Yo(o.itemType,n,i)}evaluate(e){let t=this.index.evaluate(e),n=this.input.evaluate(e);if(t<0)throw new ae("Array index out of bounds: ".concat(t," < 0."));if(t>=n.length)throw new ae("Array index out of bounds: ".concat(t," > ").concat(n.length-1,"."));if(t!==Math.floor(t))throw new ae("Array index must be an integer, but found ".concat(t," instead."));return n[t]}eachChild(e){e(this.index),e(this.input)}outputDefined(){return!1}};l(Yo,"At");var vl=Yo,Ko=class Ko{constructor(e,t){this.type=q,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 n=t.parse(e[1],1,j),i=t.parse(e[2],2,j);return!n||!i?null:Rl(n.type,[q,W,M,Gr,j])?new Ko(n,i):t.error("Expected first argument to be of type boolean, string, number or null, but found ".concat(se(n.type)," instead"))}evaluate(e){let t=this.needle.evaluate(e),n=this.haystack.evaluate(e);if(!n)return!1;if(!or(t,["boolean","string","number","null"]))throw new ae("Expected first argument to be of type boolean, string, number or null, but found ".concat(se(fe(t))," instead."));if(!or(n,["string","array"]))throw new ae("Expected second argument to be of type array or string, but found ".concat(se(fe(n))," instead."));return n.indexOf(t)>=0}eachChild(e){e(this.needle),e(this.haystack)}outputDefined(){return!0}};l(Ko,"In");var Pl=Ko,An=class An{constructor(e,t,n){this.type=M,this.needle=e,this.haystack=t,this.fromIndex=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 n=t.parse(e[1],1,j),i=t.parse(e[2],2,j);if(!n||!i)return null;if(!Rl(n.type,[q,W,M,Gr,j]))return t.error("Expected first argument to be of type boolean, string, number or null, but found ".concat(se(n.type)," instead"));if(e.length===4){let o=t.parse(e[3],3,M);return o?new An(n,i,o):null}else return new An(n,i)}evaluate(e){let t=this.needle.evaluate(e),n=this.haystack.evaluate(e);if(!or(t,["boolean","string","number","null"]))throw new ae("Expected first argument to be of type boolean, string, number or null, but found ".concat(se(fe(t))," instead."));let i;if(this.fromIndex&&(i=this.fromIndex.evaluate(e)),or(n,["string"])){let o=n.indexOf(t,i);return o===-1?-1:[...n.slice(0,o)].length}else{if(or(n,["array"]))return n.indexOf(t,i);throw new ae("Expected second argument to be of type array or string, but found ".concat(se(fe(n))," instead."))}}eachChild(e){e(this.needle),e(this.haystack),this.fromIndex&&e(this.fromIndex)}outputDefined(){return!1}};l(An,"IndexOf");var Sl=An,Qo=class Qo{constructor(e,t,n,i,o,a){this.inputType=e,this.type=t,this.input=n,this.cases=i,this.outputs=o,this.otherwise=a}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 n,i;t.expectedType&&t.expectedType.kind!=="value"&&(i=t.expectedType);let o={},a=[];for(let c=2;c<e.length-1;c+=2){let p=e[c],f=e[c+1];Array.isArray(p)||(p=[p]);let y=t.concat(c);if(p.length===0)return y.error("Expected at least one branch label.");for(let h of p){if(typeof h!="number"&&typeof h!="string")return y.error("Branch labels must be numbers or strings.");if(typeof h=="number"&&Math.abs(h)>Number.MAX_SAFE_INTEGER)return y.error("Branch labels must be integers no larger than ".concat(Number.MAX_SAFE_INTEGER,"."));if(typeof h=="number"&&Math.floor(h)!==h)return y.error("Numeric branch labels must be integer values.");if(!n)n=fe(h);else if(y.checkSubtype(n,fe(h)))return null;if(typeof o[String(h)]<"u")return y.error("Branch labels must be unique.");o[String(h)]=a.length}let m=t.parse(f,c,i);if(!m)return null;i=i||m.type,a.push(m)}let s=t.parse(e[1],1,j);if(!s)return null;let u=t.parse(e[e.length-1],e.length-1,i);return!u||s.type.kind!=="value"&&t.concat(1).checkSubtype(n,s.type)?null:new Qo(n,i,s,o,a,u)}evaluate(e){let t=this.input.evaluate(e);return(fe(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()}};l(Qo,"Match");var wl=Qo,ea=class ea{constructor(e,t,n){this.type=e,this.branches=t,this.otherwise=n}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 n;t.expectedType&&t.expectedType.kind!=="value"&&(n=t.expectedType);let i=[];for(let a=1;a<e.length-1;a+=2){let s=t.parse(e[a],a,q);if(!s)return null;let u=t.parse(e[a+1],a+1,n);if(!u)return null;i.push([s,u]),n=n||u.type}let o=t.parse(e[e.length-1],e.length-1,n);if(!o)return null;if(!n)throw new Error("Can't infer output type");return new ea(n,i,o)}evaluate(e){for(let[t,n]of this.branches)if(t.evaluate(e))return n.evaluate(e);return this.otherwise.evaluate(e)}eachChild(e){for(let[t,n]of this.branches)e(t),e(n);e(this.otherwise)}outputDefined(){return this.branches.every(([e,t])=>t.outputDefined())&&this.otherwise.outputDefined()}};l(ea,"Case");var Al=ea,_n=class _n{constructor(e,t,n,i){this.type=e,this.input=t,this.beginIndex=n,this.endIndex=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 n=t.parse(e[1],1,j),i=t.parse(e[2],2,M);if(!n||!i)return null;if(!Rl(n.type,[Ee(j),W,j]))return t.error("Expected first argument to be of type array or string, but found ".concat(se(n.type)," instead"));if(e.length===4){let o=t.parse(e[3],3,M);return o?new _n(n.type,n,i,o):null}else return new _n(n.type,n,i)}evaluate(e){let t=this.input.evaluate(e),n=this.beginIndex.evaluate(e),i;if(this.endIndex&&(i=this.endIndex.evaluate(e)),or(t,["string"]))return[...t].slice(n,i).join("");if(or(t,["array"]))return t.slice(n,i);throw new ae("Expected first argument to be of type array or string, but found ".concat(se(fe(t))," instead."))}eachChild(e){e(this.input),e(this.beginIndex),this.endIndex&&e(this.endIndex)}outputDefined(){return!1}};l(_n,"Slice");var _l=_n;function ma(r,e){let t=r.length-1,n=0,i=t,o=0,a,s;for(;n<=i;)if(o=Math.floor((n+i)/2),a=r[o],s=r[o+1],a<=e){if(o===t||e<s)return o;n=o+1}else if(a>e)i=o-1;else throw new ae("Input is not a number.");return 0}l(ma,"findStopLessThanOrEqualTo");var ta=class ta{constructor(e,t,n){this.type=e,this.input=t,this.labels=[],this.outputs=[];for(let[i,o]of n)this.labels.push(i),this.outputs.push(o)}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 n=t.parse(e[1],1,M);if(!n)return null;let i=[],o=null;t.expectedType&&t.expectedType.kind!=="value"&&(o=t.expectedType);for(let a=1;a<e.length;a+=2){let s=a===1?-1/0:e[a],u=e[a+1],c=a,p=a+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(i.length&&i[i.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 f=t.parse(u,p,o);if(!f)return null;o=o||f.type,i.push([s,f])}return new ta(o,n,i)}evaluate(e){let t=this.labels,n=this.outputs;if(t.length===1)return n[0].evaluate(e);let i=this.input.evaluate(e);if(i<=t[0])return n[0].evaluate(e);let o=t.length;if(i>=t[o-1])return n[o-1].evaluate(e);let a=ma(t,i);return n[a].evaluate(e)}eachChild(e){e(this.input);for(let t of this.outputs)e(t)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}};l(ta,"Step");var zr=ta;function vx(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}l(vx,"getDefaultExportFromCjs");var ml,yy;function Px(){if(yy)return ml;yy=1,ml=r;function r(e,t,n,i){this.cx=3*e,this.bx=3*(n-e)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*t,this.by=3*(i-t)-this.cy,this.ay=1-this.cy-this.by,this.p1x=e,this.p1y=t,this.p2x=n,this.p2y=i}return l(r,"UnitBezier"),r.prototype={sampleCurveX:l(function(e){return((this.ax*e+this.bx)*e+this.cx)*e},"sampleCurveX"),sampleCurveY:l(function(e){return((this.ay*e+this.by)*e+this.cy)*e},"sampleCurveY"),sampleCurveDerivativeX:l(function(e){return(3*this.ax*e+2*this.bx)*e+this.cx},"sampleCurveDerivativeX"),solveCurveX:l(function(e,t){if(t===void 0&&(t=1e-6),e<0)return 0;if(e>1)return 1;for(var n=e,i=0;i<8;i++){var o=this.sampleCurveX(n)-e;if(Math.abs(o)<t)return n;var a=this.sampleCurveDerivativeX(n);if(Math.abs(a)<1e-6)break;n=n-o/a}var s=0,u=1;for(n=e,i=0;i<20&&(o=this.sampleCurveX(n),!(Math.abs(o-e)<t));i++)e>o?s=n:u=n,n=(u-s)*.5+s;return n},"solveCurveX"),solve:l(function(e,t){return this.sampleCurveY(this.solveCurveX(e,t))},"solve")},ml}l(Px,"requireUnitbezier");var Sx=Px(),wx=vx(Sx),In=class In{constructor(e,t,n,i,o){this.type=e,this.operator=t,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(e,t,n,i){let o=0;if(e.name==="exponential")o=hl(t,e.base,n,i);else if(e.name==="linear")o=hl(t,1,n,i);else if(e.name==="cubic-bezier"){let a=e.controlPoints;o=new wx(a[0],a[1],a[2],a[3]).solve(hl(t,1,n,i))}return o}static parse(e,t){let[n,i,o,...a]=e;if(!Array.isArray(i)||i.length===0)return t.error("Expected an interpolation type expression.",1);if(i[0]==="linear")i={name:"linear"};else if(i[0]==="exponential"){let c=i[1];if(typeof c!="number")return t.error("Exponential interpolation requires a numeric base.",1,1);i={name:"exponential",base:c}}else if(i[0]==="cubic-bezier"){let c=i.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);i={name:"cubic-bezier",controlPoints:c}}else return t.error("Unknown interpolation type ".concat(String(i[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(o=t.parse(o,2,M),!o)return null;let s=[],u=null;(n==="interpolate-hcl"||n==="interpolate-lab")&&t.expectedType!=Cn?u=Ue:t.expectedType&&t.expectedType.kind!=="value"&&(u=t.expectedType);for(let c=0;c<a.length;c+=2){let p=a[c],f=a[c+1],y=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.',y);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.',y);let h=t.parse(f,m,u);if(!h)return null;u=u||h.type,s.push([p,h])}return!_t(u,M)&&!_t(u,ua)&&!_t(u,Ue)&&!_t(u,pa)&&!_t(u,fa)&&!_t(u,Cn)&&!_t(u,ya)&&!_t(u,Ee(M))?t.error("Type ".concat(se(u)," is not interpolatable.")):new In(u,n,i,o,s)}evaluate(e){let t=this.labels,n=this.outputs;if(t.length===1)return n[0].evaluate(e);let i=this.input.evaluate(e);if(i<=t[0])return n[0].evaluate(e);let o=t.length;if(i>=t[o-1])return n[o-1].evaluate(e);let a=ma(t,i),s=t[a],u=t[a+1],c=In.interpolationFactor(this.interpolation,i,s,u),p=n[a].evaluate(e),f=n[a+1].evaluate(e);switch(this.operator){case"interpolate":switch(this.type.kind){case"number":return kt(p,f,c);case"color":return Y.interpolate(p,f,c);case"padding":return $e.interpolate(p,f,c);case"colorArray":return Ae.interpolate(p,f,c);case"numberArray":return je.interpolate(p,f,c);case"variableAnchorOffsetCollection":return De.interpolate(p,f,c);case"array":return Rr(p,f,c);case"projectionDefinition":return Ft.interpolate(p,f,c)}case"interpolate-hcl":switch(this.type.kind){case"color":return Y.interpolate(p,f,c,"hcl");case"colorArray":return Ae.interpolate(p,f,c,"hcl")}case"interpolate-lab":switch(this.type.kind){case"color":return Y.interpolate(p,f,c,"lab");case"colorArray":return Ae.interpolate(p,f,c,"lab")}}}eachChild(e){e(this.input);for(let t of this.outputs)e(t)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}};l(In,"Interpolate");var Me=In;function hl(r,e,t,n){let i=n-t,o=r-t;return i===0?0:e===1?o/i:(Math.pow(e,o)-1)/(Math.pow(e,i)-1)}l(hl,"exponentialInterpolation");var ft={color:Y.interpolate,number:kt,padding:$e.interpolate,numberArray:je.interpolate,colorArray:Ae.interpolate,variableAnchorOffsetCollection:De.interpolate,array:Rr},Tn=class Tn{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 n=null,i=t.expectedType;i&&i.kind!=="value"&&(n=i);let o=[];for(let s of e.slice(1)){let u=t.parse(s,1+o.length,n,void 0,{typeAnnotation:"omit"});if(!u)return null;n=n||u.type,o.push(u)}if(!n)throw new Error("No output type");return i&&o.some(s=>kn(i,s.type))?new Tn(j,o):new Tn(n,o)}evaluate(e){let t=null,n=0,i;for(let o of this.args)if(n++,t=o.evaluate(e),t&&t instanceof _e&&!t.available&&(i||(i=t.name),t=null,n===this.args.length&&(t=i)),t!==null)break;return t}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}};l(Tn,"Coalesce");var Do=Tn;function my(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"}l(my,"isComparableType");function Ax(r,e,t){return e===t}l(Ax,"eq");function _x(r,e,t){return e!==t}l(_x,"neq");function Ix(r,e,t){return e<t}l(Ix,"lt");function Tx(r,e,t){return e>t}l(Tx,"gt");function Cx(r,e,t){return e<=t}l(Cx,"lteq");function kx(r,e,t){return e>=t}l(kx,"gteq");function Oy(r,e,t,n){return n.compare(e,t)===0}l(Oy,"eqCollate");function Fx(r,e,t,n){return!Oy(r,e,t,n)}l(Fx,"neqCollate");function Ex(r,e,t,n){return n.compare(e,t)<0}l(Ex,"ltCollate");function Mx(r,e,t,n){return n.compare(e,t)>0}l(Mx,"gtCollate");function Lx(r,e,t,n){return n.compare(e,t)<=0}l(Lx,"lteqCollate");function Dx(r,e,t,n){return n.compare(e,t)>=0}l(Dx,"gteqCollate");function Ur(r,e,t){var i;let n=r!=="=="&&r!=="!=";return i=class{constructor(a,s,u){this.type=q,this.lhs=a,this.rhs=s,this.collator=u,this.hasUntypedArgument=a.type.kind==="value"||s.type.kind==="value"}static parse(a,s){if(a.length!==3&&a.length!==4)return s.error("Expected two or three arguments.");let u=a[0],c=s.parse(a[1],1,j);if(!c)return null;if(!my(u,c.type))return s.concat(1).error('"'.concat(u,"\" comparisons are not supported for type '").concat(se(c.type),"'."));let p=s.parse(a[2],2,j);if(!p)return null;if(!my(u,p.type))return s.concat(2).error('"'.concat(u,"\" comparisons are not supported for type '").concat(se(p.type),"'."));if(c.type.kind!==p.type.kind&&c.type.kind!=="value"&&p.type.kind!=="value")return s.error("Cannot compare types '".concat(se(c.type),"' and '").concat(se(p.type),"'."));n&&(c.type.kind==="value"&&p.type.kind!=="value"?c=new Xe(p.type,[c]):c.type.kind!=="value"&&p.type.kind==="value"&&(p=new Xe(c.type,[p])));let f=null;if(a.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(f=s.parse(a[3],3,ca),!f)return null}return new i(c,p,f)}evaluate(a){let s=this.lhs.evaluate(a),u=this.rhs.evaluate(a);if(n&&this.hasUntypedArgument){let c=fe(s),p=fe(u);if(c.kind!==p.kind||!(c.kind==="string"||c.kind==="number"))throw new ae('Expected arguments for "'.concat(r,'" to be (string, string) or (number, number), but found (').concat(c.kind,", ").concat(p.kind,") instead."))}if(this.collator&&!n&&this.hasUntypedArgument){let c=fe(s),p=fe(u);if(c.kind!=="string"||p.kind!=="string")return e(a,s,u)}return this.collator?t(a,s,u,this.collator.evaluate(a)):e(a,s,u)}eachChild(a){a(this.lhs),a(this.rhs),this.collator&&a(this.collator)}outputDefined(){return!0}},l(i,"Comparison"),i}l(Ur,"makeComparison");var Vx=Ur("==",Ax,Oy),Bx=Ur("!=",_x,Fx),Rx=Ur("<",Ix,Ex),zx=Ur(">",Tx,Mx),Ox=Ur("<=",Cx,Lx),Gx=Ur(">=",kx,Dx),ra=class ra{constructor(e,t,n){this.type=ca,this.locale=n,this.caseSensitive=e,this.diacriticSensitive=t}static parse(e,t){if(e.length!==2)return t.error("Expected one argument.");let n=e[1];if(typeof n!="object"||Array.isArray(n))return t.error("Collator options argument must be an object.");let i=t.parse(n["case-sensitive"]===void 0?!1:n["case-sensitive"],1,q);if(!i)return null;let o=t.parse(n["diacritic-sensitive"]===void 0?!1:n["diacritic-sensitive"],1,q);if(!o)return null;let a=null;return n.locale&&(a=t.parse(n.locale,1,W),!a)?null:new ra(i,o,a)}evaluate(e){return new Fn(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}};l(ra,"CollatorExpression");var Vo=ra,na=class na{constructor(e,t,n,i,o){this.type=W,this.number=e,this.locale=t,this.currency=n,this.minFractionDigits=i,this.maxFractionDigits=o}static parse(e,t){if(e.length!==3)return t.error("Expected two arguments.");let n=t.parse(e[1],1,M);if(!n)return null;let i=e[2];if(typeof i!="object"||Array.isArray(i))return t.error("NumberFormat options argument must be an object.");let o=null;if(i.locale&&(o=t.parse(i.locale,1,W),!o))return null;let a=null;if(i.currency&&(a=t.parse(i.currency,1,W),!a))return null;let s=null;if(i["min-fraction-digits"]&&(s=t.parse(i["min-fraction-digits"],1,M),!s))return null;let u=null;return i["max-fraction-digits"]&&(u=t.parse(i["max-fraction-digits"],1,M),!u)?null:new na(n,o,a,s,u)}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}};l(na,"NumberFormat");var Il=na,ia=class ia{constructor(e){this.type=Nr,this.sections=e}static parse(e,t){if(e.length<2)return t.error("Expected at least one argument.");let n=e[1];if(!Array.isArray(n)&&typeof n=="object")return t.error("First argument must be an image or text section.");let i=[],o=!1;for(let a=1;a<=e.length-1;++a){let s=e[a];if(o&&typeof s=="object"&&!Array.isArray(s)){o=!1;let u=null;if(s["font-scale"]&&(u=t.parse(s["font-scale"],1,M),!u))return null;let c=null;if(s["text-font"]&&(c=t.parse(s["text-font"],1,Ee(W)),!c))return null;let p=null;if(s["text-color"]&&(p=t.parse(s["text-color"],1,Ue),!p))return null;let f=null;if(s["vertical-align"]){if(typeof s["vertical-align"]=="string"&&!gx.includes(s["vertical-align"]))return t.error("'vertical-align' must be one of: 'bottom', 'center', 'top' but found '".concat(s["vertical-align"],"' instead."));if(f=t.parse(s["vertical-align"],1,W),!f)return null}let y=i[i.length-1];y.scale=u,y.font=c,y.textColor=p,y.verticalAlign=f}else{let u=t.parse(e[a],1,j);if(!u)return null;let c=u.type.kind;if(c!=="string"&&c!=="value"&&c!=="null"&&c!=="resolvedImage")return t.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");o=!0,i.push({content:u,scale:null,font:null,textColor:null,verticalAlign:null})}}return new ia(i)}evaluate(e){let t=l(n=>{let i=n.content.evaluate(e);return fe(i)===Un?new En("",i,null,null,null,n.verticalAlign?n.verticalAlign.evaluate(e):null):new En(wn(i),null,n.scale?n.scale.evaluate(e):null,n.font?n.font.evaluate(e).join(","):null,n.textColor?n.textColor.evaluate(e):null,n.verticalAlign?n.verticalAlign.evaluate(e):null)},"evaluateSection");return new Le(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),t.verticalAlign&&e(t.verticalAlign)}outputDefined(){return!1}};l(ia,"FormatExpression");var Ln=ia,oa=class oa{constructor(e){this.type=Un,this.input=e}static parse(e,t){if(e.length!==2)return t.error("Expected two arguments.");let n=t.parse(e[1],1,W);return n?new oa(n):t.error("No image name provided.")}evaluate(e){let t=this.input.evaluate(e),n=_e.fromString(t);return n&&e.availableImages&&(n.available=e.availableImages.indexOf(t)>-1),n}eachChild(e){e(this.input)}outputDefined(){return!1}};l(oa,"ImageExpression");var Tl=oa,aa=class aa{constructor(e){this.type=M,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 n=t.parse(e[1],1);return n?n.type.kind!=="array"&&n.type.kind!=="string"&&n.type.kind!=="value"?t.error("Expected argument of type string or array, but found ".concat(se(n.type)," instead.")):new aa(n):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 ae("Expected value to be of type string or array, but found ".concat(se(fe(t))," instead."))}eachChild(e){e(this.input)}outputDefined(){return!1}};l(aa,"Length");var Cl=aa,Ke=8192;function Nx(r,e){let t=Ux(r[0]),n=jx(r[1]),i=Math.pow(2,e.z);return[Math.round(t*i*Ke),Math.round(n*i*Ke)]}l(Nx,"getTileCoordinates");function zl(r,e){let t=Math.pow(2,e.z),n=(r[0]/Ke+e.x)/t,i=(r[1]/Ke+e.y)/t;return[$x(n),qx(i)]}l(zl,"getLngLatFromTileCoord");function Ux(r){return(180+r)/360}l(Ux,"mercatorXfromLng");function $x(r){return r*360-180}l($x,"lngFromMercatorXfromLng");function jx(r){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+r*Math.PI/360)))/360}l(jx,"mercatorYfromLat");function qx(r){return 360/Math.PI*Math.atan(Math.exp((180-r*360)*Math.PI/180))-90}l(qx,"latFromMercatorY");function $n(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])}l($n,"updateBBox");function Dn(r,e){return!(r[0]<=e[0]||r[2]>=e[2]||r[1]<=e[1]||r[3]>=e[3])}l(Dn,"boxWithinBox");function Wx(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]}l(Wx,"rayIntersect");function Xx(r,e,t){let n=r[0]-e[0],i=r[1]-e[1],o=r[0]-t[0],a=r[1]-t[1];return n*a-o*i===0&&n*o<=0&&i*a<=0}l(Xx,"pointOnBoundary");function ha(r,e,t,n){let i=[e[0]-r[0],e[1]-r[1]],o=[n[0]-t[0],n[1]-t[1]];return Yx(o,i)===0?!1:!!(hy(r,e,t,n)&&hy(t,n,r,e))}l(ha,"segmentIntersectSegment");function Hx(r,e,t){for(let n of t)for(let i=0;i<n.length-1;++i)if(ha(r,e,n[i],n[i+1]))return!0;return!1}l(Hx,"lineIntersectPolygon");function $r(r,e,t=!1){let n=!1;for(let i of e)for(let o=0;o<i.length-1;o++){if(Xx(r,i[o],i[o+1]))return t;Wx(r,i[o],i[o+1])&&(n=!n)}return n}l($r,"pointWithinPolygon");function Zx(r,e){for(let t of e)if($r(r,t))return!0;return!1}l(Zx,"pointWithinPolygons");function Gy(r,e){for(let t of r)if(!$r(t,e))return!1;for(let t=0;t<r.length-1;++t)if(Hx(r[t],r[t+1],e))return!1;return!0}l(Gy,"lineStringWithinPolygon");function Jx(r,e){for(let t of e)if(Gy(r,t))return!0;return!1}l(Jx,"lineStringWithinPolygons");function Yx(r,e){return r[0]*e[1]-r[1]*e[0]}l(Yx,"perp");function hy(r,e,t,n){let i=r[0]-t[0],o=r[1]-t[1],a=e[0]-t[0],s=e[1]-t[1],u=n[0]-t[0],c=n[1]-t[1],p=i*c-u*o,f=a*c-u*s;return p>0&&f<0||p<0&&f>0}l(hy,"twoSided");function Ol(r,e,t){let n=[];for(let i=0;i<r.length;i++){let o=[];for(let a=0;a<r[i].length;a++){let s=Nx(r[i][a],t);$n(e,s),o.push(s)}n.push(o)}return n}l(Ol,"getTilePolygon");function Ny(r,e,t){let n=[];for(let i=0;i<r.length;i++){let o=Ol(r[i],e,t);n.push(o)}return n}l(Ny,"getTilePolygons");function Uy(r,e,t,n){if(r[0]<t[0]||r[0]>t[2]){let i=n*.5,o=r[0]-t[0]>i?-n:t[0]-r[0]>i?n:0;o===0&&(o=r[0]-t[2]>i?-n:t[2]-r[0]>i?n:0),r[0]+=o}$n(e,r)}l(Uy,"updatePoint");function Kx(r){r[0]=r[1]=1/0,r[2]=r[3]=-1/0}l(Kx,"resetBBox");function dy(r,e,t,n){let i=Math.pow(2,n.z)*Ke,o=[n.x*Ke,n.y*Ke],a=[];for(let s of r)for(let u of s){let c=[u.x+o[0],u.y+o[1]];Uy(c,e,t,i),a.push(c)}return a}l(dy,"getTilePoints");function gy(r,e,t,n){let i=Math.pow(2,n.z)*Ke,o=[n.x*Ke,n.y*Ke],a=[];for(let s of r){let u=[];for(let c of s){let p=[c.x+o[0],c.y+o[1]];$n(e,p),u.push(p)}a.push(u)}if(e[2]-e[0]<=i/2){Kx(e);for(let s of a)for(let u of s)Uy(u,e,t,i)}return a}l(gy,"getTileLines");function Qx(r,e){let t=[1/0,1/0,-1/0,-1/0],n=[1/0,1/0,-1/0,-1/0],i=r.canonicalID();if(e.type==="Polygon"){let o=Ol(e.coordinates,n,i),a=dy(r.geometry(),t,n,i);if(!Dn(t,n))return!1;for(let s of a)if(!$r(s,o))return!1}if(e.type==="MultiPolygon"){let o=Ny(e.coordinates,n,i),a=dy(r.geometry(),t,n,i);if(!Dn(t,n))return!1;for(let s of a)if(!Zx(s,o))return!1}return!0}l(Qx,"pointsWithinPolygons");function e0(r,e){let t=[1/0,1/0,-1/0,-1/0],n=[1/0,1/0,-1/0,-1/0],i=r.canonicalID();if(e.type==="Polygon"){let o=Ol(e.coordinates,n,i),a=gy(r.geometry(),t,n,i);if(!Dn(t,n))return!1;for(let s of a)if(!Gy(s,o))return!1}if(e.type==="MultiPolygon"){let o=Ny(e.coordinates,n,i),a=gy(r.geometry(),t,n,i);if(!Dn(t,n))return!1;for(let s of a)if(!Jx(s,o))return!1}return!0}l(e0,"linesWithinPolygons");var Lr=class Lr{constructor(e,t){this.type=q,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(Mn(e[1])){let n=e[1];if(n.type==="FeatureCollection"){let i=[];for(let o of n.features){let{type:a,coordinates:s}=o.geometry;a==="Polygon"&&i.push(s),a==="MultiPolygon"&&i.push(...s)}if(i.length){let o={type:"MultiPolygon",coordinates:i};return new Lr(n,o)}}else if(n.type==="Feature"){let i=n.geometry.type;if(i==="Polygon"||i==="MultiPolygon")return new Lr(n,n.geometry)}else if(n.type==="Polygon"||n.type==="MultiPolygon")return new Lr(n,n)}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 Qx(e,this.geometries);if(e.geometryType()==="LineString")return e0(e,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}};l(Lr,"Within");var Vn=Lr,Kl=class Kl{constructor(e=[],t=(n,i)=>n<i?-1:n>i?1:0){if(this.data=e,this.length=this.data.length,this.compare=t,this.length>0)for(let n=(this.length>>1)-1;n>=0;n--)this._down(n)}push(e){this.data.push(e),this._up(this.length++)}pop(){if(this.length===0)return;let e=this.data[0],t=this.data.pop();return--this.length>0&&(this.data[0]=t,this._down(0)),e}peek(){return this.data[0]}_up(e){let{data:t,compare:n}=this,i=t[e];for(;e>0;){let o=e-1>>1,a=t[o];if(n(i,a)>=0)break;t[e]=a,e=o}t[e]=i}_down(e){let{data:t,compare:n}=this,i=this.length>>1,o=t[e];for(;e<i;){let a=(e<<1)+1,s=a+1;if(s<this.length&&n(t[s],t[a])<0&&(a=s),n(t[a],o)>=0)break;t[e]=t[a],e=a}t[e]=o}};l(Kl,"TinyQueue");var Bo=Kl;function $y(r,e,t=0,n=r.length-1,i=t0){for(;n>t;){if(n-t>600){let u=n-t+1,c=e-t+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(t,Math.floor(e-c*f/u+y)),h=Math.min(n,Math.floor(e+(u-c)*f/u+y));$y(r,e,m,h,i)}let o=r[e],a=t,s=n;for(Pn(r,t,e),i(r[n],o)>0&&Pn(r,t,n);a<s;){for(Pn(r,a,s),a++,s--;i(r[a],o)<0;)a++;for(;i(r[s],o)>0;)s--}i(r[t],o)===0?Pn(r,t,s):(s++,Pn(r,s,n)),s<=e&&(t=s+1),e<=s&&(n=s-1)}}l($y,"quickselect");function Pn(r,e,t){let n=r[e];r[e]=r[t],r[t]=n}l(Pn,"swap");function t0(r,e){return r<e?-1:r>e?1:0}l(t0,"defaultCompare");function ur(r,e){if(r.length<=1)return[r];let n=[],i,o;for(let a of r){let s=n0(a);s!==0&&(a.area=Math.abs(s),o===void 0&&(o=s<0),o===s<0?(i&&n.push(i),i=[a]):i.push(a))}if(i&&n.push(i),e>1)for(let a=0;a<n.length;a++)n[a].length<=e||($y(n[a],e,1,n[a].length-1,r0),n[a]=n[a].slice(0,e));return n}l(ur,"classifyRings");function r0(r,e){return e.area-r.area}l(r0,"compareAreas");function n0(r){let e=0;for(let t=0,n=r.length,i=n-1,o,a;t<n;i=t++)o=r[t],a=r[i],e+=(a.x-o.x)*(o.y+a.y);return e}l(n0,"calculateSignedArea");var i0=6378.137,by=1/298.257223563,xy=by*(2-by),vy=Math.PI/180,Ql=class Ql{constructor(e){let t=vy*i0*1e3,n=Math.cos(e*vy),i=1/(1-xy*(1-n*n)),o=Math.sqrt(i);this.kx=t*o*n,this.ky=t*o*i*(1-xy)}distance(e,t){let n=this.wrap(e[0]-t[0])*this.kx,i=(e[1]-t[1])*this.ky;return Math.sqrt(n*n+i*i)}pointOnLine(e,t){let n=1/0,i,o,a,s;for(let u=0;u<e.length-1;u++){let c=e[u][0],p=e[u][1],f=this.wrap(e[u+1][0]-c)*this.kx,y=(e[u+1][1]-p)*this.ky,m=0;(f!==0||y!==0)&&(m=(this.wrap(t[0]-c)*this.kx*f+(t[1]-p)*this.ky*y)/(f*f+y*y),m>1?(c=e[u+1][0],p=e[u+1][1]):m>0&&(c+=f/this.kx*m,p+=y/this.ky*m)),f=this.wrap(t[0]-c)*this.kx,y=(t[1]-p)*this.ky;let h=f*f+y*y;h<n&&(n=h,i=c,o=p,a=u,s=m)}return{point:[i,o],index:a,t:Math.max(0,Math.min(1,s))}}wrap(e){for(;e<-180;)e+=360;for(;e>180;)e-=360;return e}};l(Ql,"CheapRuler");var Bn=Ql,kl=100,Fl=50;function jy(r,e){return e[0]-r[0]}l(jy,"compareDistPair");function Ro(r){return r[1]-r[0]+1}l(Ro,"getRangeSize");function pt(r,e){return r[1]>=r[0]&&r[1]<e}l(pt,"isRangeSafe");function El(r,e){if(r[0]>r[1])return[null,null];let t=Ro(r);if(e){if(t===2)return[r,null];let i=Math.floor(t/2);return[[r[0],r[0]+i],[r[0]+i,r[1]]]}if(t===1)return[r,null];let n=Math.floor(t/2)-1;return[[r[0],r[0]+n],[r[0]+n+1,r[1]]]}l(El,"splitRange");function Ml(r,e){if(!pt(e,r.length))return[1/0,1/0,-1/0,-1/0];let t=[1/0,1/0,-1/0,-1/0];for(let n=e[0];n<=e[1];++n)$n(t,r[n]);return t}l(Ml,"getBBox");function Ll(r){let e=[1/0,1/0,-1/0,-1/0];for(let t of r)for(let n of t)$n(e,n);return e}l(Ll,"getPolygonBBox");function Py(r){return r[0]!==-1/0&&r[1]!==-1/0&&r[2]!==1/0&&r[3]!==1/0}l(Py,"isValidBBox");function Gl(r,e,t){if(!Py(r)||!Py(e))return NaN;let n=0,i=0;return r[2]<e[0]&&(n=e[0]-r[2]),r[0]>e[2]&&(n=r[0]-e[2]),r[1]>e[3]&&(i=r[1]-e[3]),r[3]<e[1]&&(i=e[1]-r[3]),t.distance([0,0],[n,i])}l(Gl,"bboxToBBoxDistance");function nr(r,e,t){let n=t.pointOnLine(e,r);return t.distance(r,n.point)}l(nr,"pointToLineDistance");function Nl(r,e,t,n,i){let o=Math.min(nr(r,[t,n],i),nr(e,[t,n],i)),a=Math.min(nr(t,[r,e],i),nr(n,[r,e],i));return Math.min(o,a)}l(Nl,"segmentToSegmentDistance");function o0(r,e,t,n,i){if(!(pt(e,r.length)&&pt(n,t.length)))return 1/0;let a=1/0;for(let s=e[0];s<e[1];++s){let u=r[s],c=r[s+1];for(let p=n[0];p<n[1];++p){let f=t[p],y=t[p+1];if(ha(u,c,f,y))return 0;a=Math.min(a,Nl(u,c,f,y,i))}}return a}l(o0,"lineToLineDistance");function a0(r,e,t,n,i){if(!(pt(e,r.length)&&pt(n,t.length)))return NaN;let a=1/0;for(let s=e[0];s<=e[1];++s)for(let u=n[0];u<=n[1];++u)if(a=Math.min(a,i.distance(r[s],t[u])),a===0)return a;return a}l(a0,"pointsToPointsDistance");function s0(r,e,t){if($r(r,e,!0))return 0;let n=1/0;for(let i of e){let o=i[0],a=i[i.length-1];if(o!==a&&(n=Math.min(n,nr(r,[a,o],t)),n===0))return n;let s=t.pointOnLine(i,r);if(n=Math.min(n,t.distance(r,s.point)),n===0)return n}return n}l(s0,"pointToPolygonDistance");function l0(r,e,t,n){if(!pt(e,r.length))return NaN;for(let o=e[0];o<=e[1];++o)if($r(r[o],t,!0))return 0;let i=1/0;for(let o=e[0];o<e[1];++o){let a=r[o],s=r[o+1];for(let u of t)for(let c=0,p=u.length,f=p-1;c<p;f=c++){let y=u[f],m=u[c];if(ha(a,s,y,m))return 0;i=Math.min(i,Nl(a,s,y,m,n))}}return i}l(l0,"lineToPolygonDistance");function Sy(r,e){for(let t of r)for(let n of t)if($r(n,e,!0))return!0;return!1}l(Sy,"polygonIntersect");function u0(r,e,t,n=1/0){let i=Ll(r),o=Ll(e);if(n!==1/0&&Gl(i,o,t)>=n)return n;if(Dn(i,o)){if(Sy(r,e))return 0}else if(Sy(e,r))return 0;let a=1/0;for(let s of r)for(let u=0,c=s.length,p=c-1;u<c;p=u++){let f=s[p],y=s[u];for(let m of e)for(let h=0,d=m.length,x=d-1;h<d;x=h++){let b=m[x],P=m[h];if(ha(f,y,b,P))return 0;a=Math.min(a,Nl(f,y,b,P,t))}}return a}l(u0,"polygonToPolygonDistance");function wy(r,e,t,n,i,o){if(!o)return;let a=Gl(Ml(n,o),i,t);a<e&&r.push([a,o,[0,0]])}l(wy,"updateQueue");function To(r,e,t,n,i,o,a){if(!o||!a)return;let s=Gl(Ml(n,o),Ml(i,a),t);s<e&&r.push([s,o,a])}l(To,"updateQueueTwoSets");function zo(r,e,t,n,i=1/0){let o=Math.min(n.distance(r[0],t[0][0]),i);if(o===0)return o;let a=new Bo([[0,[0,r.length-1],[0,0]]],jy),s=Ll(t);for(;a.length>0;){let u=a.pop();if(u[0]>=o)continue;let c=u[1],p=e?Fl:kl;if(Ro(c)<=p){if(!pt(c,r.length))return NaN;if(e){let f=l0(r,c,t,n);if(isNaN(f)||f===0)return f;o=Math.min(o,f)}else for(let f=c[0];f<=c[1];++f){let y=s0(r[f],t,n);if(o=Math.min(o,y),o===0)return 0}}else{let f=El(c,e);wy(a,o,n,r,s,f[0]),wy(a,o,n,r,s,f[1])}}return o}l(zo,"pointsToPolygonDistance");function Oo(r,e,t,n,i,o=1/0){let a=Math.min(o,i.distance(r[0],t[0]));if(a===0)return a;let s=new Bo([[0,[0,r.length-1],[0,t.length-1]]],jy);for(;s.length>0;){let u=s.pop();if(u[0]>=a)continue;let c=u[1],p=u[2],f=e?Fl:kl,y=n?Fl:kl;if(Ro(c)<=f&&Ro(p)<=y){if(!pt(c,r.length)&&pt(p,t.length))return NaN;let m;if(e&&n)m=o0(r,c,t,p,i),a=Math.min(a,m);else if(e&&!n){let h=r.slice(c[0],c[1]+1);for(let d=p[0];d<=p[1];++d)if(m=nr(t[d],h,i),a=Math.min(a,m),a===0)return a}else if(!e&&n){let h=t.slice(p[0],p[1]+1);for(let d=c[0];d<=c[1];++d)if(m=nr(r[d],h,i),a=Math.min(a,m),a===0)return a}else m=a0(r,c,t,p,i),a=Math.min(a,m)}else{let m=El(c,e),h=El(p,n);To(s,a,i,r,t,m[0],h[0]),To(s,a,i,r,t,m[0],h[1]),To(s,a,i,r,t,m[1],h[0]),To(s,a,i,r,t,m[1],h[1])}}return a}l(Oo,"pointSetToPointSetDistance");function c0(r,e){let t=r.geometry(),n=t.flat().map(a=>zl([a.x,a.y],r.canonical));if(t.length===0)return NaN;let i=new Bn(n[0][1]),o=1/0;for(let a of e){switch(a.type){case"Point":o=Math.min(o,Oo(n,!1,[a.coordinates],!1,i,o));break;case"LineString":o=Math.min(o,Oo(n,!1,a.coordinates,!0,i,o));break;case"Polygon":o=Math.min(o,zo(n,!1,a.coordinates,i,o));break}if(o===0)return o}return o}l(c0,"pointToGeometryDistance");function p0(r,e){let t=r.geometry(),n=t.flat().map(a=>zl([a.x,a.y],r.canonical));if(t.length===0)return NaN;let i=new Bn(n[0][1]),o=1/0;for(let a of e){switch(a.type){case"Point":o=Math.min(o,Oo(n,!0,[a.coordinates],!1,i,o));break;case"LineString":o=Math.min(o,Oo(n,!0,a.coordinates,!0,i,o));break;case"Polygon":o=Math.min(o,zo(n,!0,a.coordinates,i,o));break}if(o===0)return o}return o}l(p0,"lineStringToGeometryDistance");function f0(r,e){let t=r.geometry();if(t.length===0||t[0].length===0)return NaN;let n=ur(t,0).map(a=>a.map(s=>s.map(u=>zl([u.x,u.y],r.canonical)))),i=new Bn(n[0][0][0][1]),o=1/0;for(let a of e)for(let s of n){switch(a.type){case"Point":o=Math.min(o,zo([a.coordinates],!1,s,i,o));break;case"LineString":o=Math.min(o,zo(a.coordinates,!0,s,i,o));break;case"Polygon":o=Math.min(o,u0(s,a.coordinates,i,o));break}if(o===0)return o}return o}l(f0,"polygonToGeometryDistance");function dl(r){return r.type==="MultiPolygon"?r.coordinates.map(e=>({type:"Polygon",coordinates:e})):r.type==="MultiLineString"?r.coordinates.map(e=>({type:"LineString",coordinates:e})):r.type==="MultiPoint"?r.coordinates.map(e=>({type:"Point",coordinates:e})):[r]}l(dl,"toSimpleGeometry");var Dr=class Dr{constructor(e,t){this.type=M,this.geojson=e,this.geometries=t}static parse(e,t){if(e.length!==2)return t.error("'distance' expression requires exactly one argument, but found ".concat(e.length-1," instead."));if(Mn(e[1])){let n=e[1];if(n.type==="FeatureCollection")return new Dr(n,n.features.map(i=>dl(i.geometry)).flat());if(n.type==="Feature")return new Dr(n,dl(n.geometry));if("type"in n&&"coordinates"in n)return new Dr(n,dl(n))}return t.error("'distance' expression requires valid geojson object that contains polygon geometry type.")}evaluate(e){if(e.geometry()!=null&&e.canonicalID()!=null){if(e.geometryType()==="Point")return c0(e,this.geometries);if(e.geometryType()==="LineString")return p0(e,this.geometries);if(e.geometryType()==="Polygon")return f0(e,this.geometries)}return NaN}eachChild(){}outputDefined(){return!0}};l(Dr,"Distance");var Rn=Dr,sa=class sa{constructor(e){this.type=j,this.key=e}static parse(e,t){if(e.length!==2)return t.error("Expected 1 argument, but found ".concat(e.length-1," instead."));let n=e[1];return n==null?t.error("Global state property must be defined."):typeof n!="string"?t.error("Global state property must be string, but found ".concat(typeof e[1]," instead.")):new sa(n)}evaluate(e){var t;let n=(t=e.globals)===null||t===void 0?void 0:t.globalState;return!n||Object.keys(n).length===0?null:Sn(n,this.key)}eachChild(){}outputDefined(){return!1}};l(sa,"GlobalState");var zn=sa,cr={"==":Vx,"!=":Bx,">":zx,"<":Rx,">=":Gx,"<=":Ox,array:Xe,at:vl,boolean:Xe,case:Al,coalesce:Do,collator:Vo,format:Ln,image:Tl,in:Pl,"index-of":Sl,interpolate:Me,"interpolate-hcl":Me,"interpolate-lab":Me,length:Cl,let:Mo,literal:Et,match:wl,number:Xe,"number-format":Il,object:Xe,slice:_l,step:zr,string:Xe,"to-boolean":Ct,"to-color":Ct,"to-number":Ct,"to-string":Ct,var:Lo,within:Vn,distance:Rn,"global-state":zn},rr=class rr{constructor(e,t,n,i){this.name=e,this.type=t,this._evaluate=n,this.args=i}evaluate(e){return this._evaluate(e,this.args)}eachChild(e){this.args.forEach(e)}outputDefined(){return!1}static parse(e,t){let n=e[0],i=rr.definitions[n];if(!i)return t.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(([c])=>!Array.isArray(c)||c.length===e.length-1),u=null;for(let[c,p]of s){u=new Eo(t.registry,Go,t.path,null,t.scope);let f=[],y=!1;for(let m=1;m<e.length;m++){let h=e[m],d=Array.isArray(c)?c[m-1]:c.type,x=u.parse(h,1+f.length,d);if(!x){y=!0;break}f.push(x)}if(!y){if(Array.isArray(c)&&c.length!==f.length){u.error("Expected ".concat(c.length," arguments, but found ").concat(f.length," instead."));continue}for(let m=0;m<f.length;m++){let h=Array.isArray(c)?c[m]:c.type,d=f[m];u.concat(m+1).checkSubtype(h,d.type)}if(u.errors.length===0)return new rr(n,o,p,f)}}if(s.length===1)t.errors.push(...u.errors);else{let p=(s.length?s:a).map(([y])=>m0(y)).join(" | "),f=[];for(let y=1;y<e.length;y++){let m=t.parse(e[y],1+f.length);if(!m)return null;f.push(se(m.type))}t.error("Expected arguments of type ".concat(p,", but found (").concat(f.join(", "),") instead."))}return null}static register(e,t){rr.definitions=t;for(let n in t)e[n]=rr}};l(rr,"CompoundExpression");var Qe=rr;function Ay(r,[e,t,n,i]){e=e.evaluate(r),t=t.evaluate(r),n=n.evaluate(r);let o=i?i.evaluate(r):1,a=zy(e,t,n,o);if(a)throw new ae(a);return new Y(e/255,t/255,n/255,o,!1)}l(Ay,"rgba");function _y(r,e){return r in e}l(_y,"has");function gl(r,e){let t=e[r];return typeof t>"u"?null:t}l(gl,"get");function y0(r,e,t,n){for(;t<=n;){let i=t+n>>1;if(e[i]===r)return!0;e[i]>r?n=i-1:t=i+1}return!1}l(y0,"binarySearch");function Kt(r){return{type:r}}l(Kt,"varargs");Qe.register(cr,{error:[ox,[W],(r,[e])=>{throw new ae(e.evaluate(r))}],typeof:[W,[j],(r,[e])=>se(fe(e.evaluate(r)))],"to-rgba":[Ee(M,4),[Ue],(r,[e])=>{let[t,n,i,o]=e.evaluate(r).rgb;return[t*255,n*255,i*255,o]}],rgb:[Ue,[M,M,M],Ay],rgba:[Ue,[M,M,M,M],Ay],has:{type:q,overloads:[[[W],(r,[e])=>_y(e.evaluate(r),r.properties())],[[W,ir],(r,[e,t])=>_y(e.evaluate(r),t.evaluate(r))]]},get:{type:j,overloads:[[[W],(r,[e])=>gl(e.evaluate(r),r.properties())],[[W,ir],(r,[e,t])=>gl(e.evaluate(r),t.evaluate(r))]]},"feature-state":[j,[W],(r,[e])=>gl(e.evaluate(r),r.featureState||{})],properties:[ir,[],r=>r.properties()],"geometry-type":[W,[],r=>r.geometryType()],id:[j,[],r=>r.id()],zoom:[M,[],r=>r.globals.zoom],"heatmap-density":[M,[],r=>r.globals.heatmapDensity||0],elevation:[M,[],r=>r.globals.elevation||0],"line-progress":[M,[],r=>r.globals.lineProgress||0],accumulated:[j,[],r=>r.globals.accumulated===void 0?null:r.globals.accumulated],"+":[M,Kt(M),(r,e)=>{let t=0;for(let n of e)t+=n.evaluate(r);return t}],"*":[M,Kt(M),(r,e)=>{let t=1;for(let n of e)t*=n.evaluate(r);return t}],"-":{type:M,overloads:[[[M,M],(r,[e,t])=>e.evaluate(r)-t.evaluate(r)],[[M],(r,[e])=>-e.evaluate(r)]]},"/":[M,[M,M],(r,[e,t])=>e.evaluate(r)/t.evaluate(r)],"%":[M,[M,M],(r,[e,t])=>e.evaluate(r)%t.evaluate(r)],ln2:[M,[],()=>Math.LN2],pi:[M,[],()=>Math.PI],e:[M,[],()=>Math.E],"^":[M,[M,M],(r,[e,t])=>Math.pow(e.evaluate(r),t.evaluate(r))],sqrt:[M,[M],(r,[e])=>Math.sqrt(e.evaluate(r))],log10:[M,[M],(r,[e])=>Math.log(e.evaluate(r))/Math.LN10],ln:[M,[M],(r,[e])=>Math.log(e.evaluate(r))],log2:[M,[M],(r,[e])=>Math.log(e.evaluate(r))/Math.LN2],sin:[M,[M],(r,[e])=>Math.sin(e.evaluate(r))],cos:[M,[M],(r,[e])=>Math.cos(e.evaluate(r))],tan:[M,[M],(r,[e])=>Math.tan(e.evaluate(r))],asin:[M,[M],(r,[e])=>Math.asin(e.evaluate(r))],acos:[M,[M],(r,[e])=>Math.acos(e.evaluate(r))],atan:[M,[M],(r,[e])=>Math.atan(e.evaluate(r))],min:[M,Kt(M),(r,e)=>Math.min(...e.map(t=>t.evaluate(r)))],max:[M,Kt(M),(r,e)=>Math.max(...e.map(t=>t.evaluate(r)))],abs:[M,[M],(r,[e])=>Math.abs(e.evaluate(r))],round:[M,[M],(r,[e])=>{let t=e.evaluate(r);return t<0?-Math.round(-t):Math.round(t)}],floor:[M,[M],(r,[e])=>Math.floor(e.evaluate(r))],ceil:[M,[M],(r,[e])=>Math.ceil(e.evaluate(r))],"filter-==":[q,[W,j],(r,[e,t])=>r.properties()[e.value]===t.value],"filter-id-==":[q,[j],(r,[e])=>r.id()===e.value],"filter-type-==":[q,[W],(r,[e])=>r.geometryType()===e.value],"filter-<":[q,[W,j],(r,[e,t])=>{let n=r.properties()[e.value],i=t.value;return typeof n==typeof i&&n<i}],"filter-id-<":[q,[j],(r,[e])=>{let t=r.id(),n=e.value;return typeof t==typeof n&&t<n}],"filter->":[q,[W,j],(r,[e,t])=>{let n=r.properties()[e.value],i=t.value;return typeof n==typeof i&&n>i}],"filter-id->":[q,[j],(r,[e])=>{let t=r.id(),n=e.value;return typeof t==typeof n&&t>n}],"filter-<=":[q,[W,j],(r,[e,t])=>{let n=r.properties()[e.value],i=t.value;return typeof n==typeof i&&n<=i}],"filter-id-<=":[q,[j],(r,[e])=>{let t=r.id(),n=e.value;return typeof t==typeof n&&t<=n}],"filter->=":[q,[W,j],(r,[e,t])=>{let n=r.properties()[e.value],i=t.value;return typeof n==typeof i&&n>=i}],"filter-id->=":[q,[j],(r,[e])=>{let t=r.id(),n=e.value;return typeof t==typeof n&&t>=n}],"filter-has":[q,[j],(r,[e])=>e.value in r.properties()],"filter-has-id":[q,[],r=>r.id()!==null&&r.id()!==void 0],"filter-type-in":[q,[Ee(W)],(r,[e])=>e.value.indexOf(r.geometryType())>=0],"filter-id-in":[q,[Ee(j)],(r,[e])=>e.value.indexOf(r.id())>=0],"filter-in-small":[q,[W,Ee(j)],(r,[e,t])=>t.value.indexOf(r.properties()[e.value])>=0],"filter-in-large":[q,[W,Ee(j)],(r,[e,t])=>y0(r.properties()[e.value],t.value,0,t.value.length-1)],all:{type:q,overloads:[[[q,q],(r,[e,t])=>e.evaluate(r)&&t.evaluate(r)],[Kt(q),(r,e)=>{for(let t of e)if(!t.evaluate(r))return!1;return!0}]]},any:{type:q,overloads:[[[q,q],(r,[e,t])=>e.evaluate(r)||t.evaluate(r)],[Kt(q),(r,e)=>{for(let t of e)if(t.evaluate(r))return!0;return!1}]]},"!":[q,[q],(r,[e])=>!e.evaluate(r)],"is-supported-script":[q,[W],(r,[e])=>{let t=r.globals&&r.globals.isSupportedScript;return t?t(e.evaluate(r)):!0}],upcase:[W,[W],(r,[e])=>e.evaluate(r).toUpperCase()],downcase:[W,[W],(r,[e])=>e.evaluate(r).toLowerCase()],concat:[W,Kt(j),(r,e)=>e.map(t=>wn(t.evaluate(r))).join("")],"resolved-locale":[W,[ca],(r,[e])=>e.evaluate(r).resolvedLocale()]});function m0(r){return Array.isArray(r)?"(".concat(r.map(se).join(", "),")"):"(".concat(se(r.type),"...)")}l(m0,"stringifySignature");function Go(r){if(r instanceof Lo)return Go(r.boundExpression);if(r instanceof Qe&&r.name==="error")return!1;if(r instanceof Vo)return!1;if(r instanceof Vn)return!1;if(r instanceof Rn)return!1;if(r instanceof zn)return!1;let e=r instanceof Ct||r instanceof Xe,t=!0;return r.eachChild(n=>{e?t=t&&Go(n):t=t&&n instanceof Et}),t?da(r)&&ga(r,["zoom","heatmap-density","elevation","line-progress","accumulated","is-supported-script"]):!1}l(Go,"isExpressionConstant");function da(r){if(r instanceof Qe){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 Vn||r instanceof Rn)return!1;let e=!0;return r.eachChild(t=>{e&&!da(t)&&(e=!1)}),e}l(da,"isFeatureConstant");function On(r){if(r instanceof Qe&&r.name==="feature-state")return!1;let e=!0;return r.eachChild(t=>{e&&!On(t)&&(e=!1)}),e}l(On,"isStateConstant");function ga(r,e){if(r instanceof Qe&&e.indexOf(r.name)>=0)return!1;let t=!0;return r.eachChild(n=>{t&&!ga(n,e)&&(t=!1)}),t}l(ga,"isGlobalPropertyConstant");function Dl(r){return{result:"success",value:r}}l(Dl,"success");function Fr(r){return{result:"error",value:r}}l(Fr,"error");function Mt(r){return r["property-type"]==="data-driven"||r["property-type"]==="cross-faded-data-driven"}l(Mt,"supportsPropertyExpression");function qy(r){return!!r.expression&&r.expression.parameters.indexOf("zoom")>-1}l(qy,"supportsZoomExpression");function Ul(r){return!!r.expression&&r.expression.interpolated}l(Ul,"supportsInterpolation");function X(r){return r instanceof Number?"number":r instanceof String?"string":r instanceof Boolean?"boolean":Array.isArray(r)?"array":r===null?"null":typeof r}l(X,"getType");function ba(r){return typeof r=="object"&&r!==null&&!Array.isArray(r)&&fe(r)===ir}l(ba,"isFunction$1");function h0(r){return r}l(h0,"identityFunction");function d0(r){switch(r.type){case"color":return Y.parse;case"padding":return $e.parse;case"numberArray":return je.parse;case"colorArray":return Ae.parse;default:return null}}l(d0,"getParseFunction");function g0(r){switch(r){case"exponential":return Xy;case"interval":return x0;case"categorical":return b0;case"identity":return v0;default:throw new Error('Unknown function type "'.concat(r,'"'))}}l(g0,"getInnerFunction");function Wy(r,e){let t=r.stops&&typeof r.stops[0][0]=="object",n=t||r.property!==void 0,i=t||!n,o=r.type||(Ul(e)?"exponential":"interval"),a=d0(e);if(a&&(r=Br({},r),r.stops&&(r.stops=r.stops.map(p=>[p[0],a(p[1])])),r.default?r.default=a(r.default):r.default=a(e.default)),r.colorSpace&&!dx(r.colorSpace))throw new Error('Unknown color space: "'.concat(r.colorSpace,'"'));let s=g0(o),u,c;if(o==="categorical"){u=Object.create(null);for(let p of r.stops)u[p[0]]=p[1];c=typeof r.stops[0][0]}if(t){let p={},f=[];for(let h=0;h<r.stops.length;h++){let d=r.stops[h],x=d[0].zoom;p[x]===void 0&&(p[x]={zoom:x,type:r.type,property:r.property,default:r.default,stops:[]},f.push(x)),p[x].stops.push([d[0].value,d[1]])}let y=[];for(let h of f)y.push([p[h].zoom,Wy(p[h],e)]);let m={name:"linear"};return{kind:"composite",interpolationType:m,interpolationFactor:Me.interpolationFactor.bind(void 0,m),zoomStops:y.map(h=>h[0]),evaluate({zoom:h},d){return Xy({stops:y,base:r.base},e,h).evaluate(h,d)}}}else if(i){let p=o==="exponential"?{name:"exponential",base:r.base!==void 0?r.base:1}:null;return{kind:"camera",interpolationType:p,interpolationFactor:Me.interpolationFactor.bind(void 0,p),zoomStops:r.stops.map(f=>f[0]),evaluate:l(({zoom:f})=>s(r,e,f,u,c),"evaluate")}}else return{kind:"source",evaluate(p,f){let y=f&&f.properties?f.properties[r.property]:void 0;return y===void 0?jn(r.default,e.default):s(r,e,y,u,c)}}}l(Wy,"createFunction");function jn(r,e,t){if(r!==void 0)return r;if(e!==void 0)return e;if(t!==void 0)return t}l(jn,"coalesce$1");function b0(r,e,t,n,i){let o=typeof t===i?n[t]:void 0;return jn(o,r.default,e.default)}l(b0,"evaluateCategoricalFunction");function x0(r,e,t){if(X(t)!=="number")return jn(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 i=ma(r.stops.map(o=>o[0]),t);return r.stops[i][1]}l(x0,"evaluateIntervalFunction");function Xy(r,e,t){let n=r.base!==void 0?r.base:1;if(X(t)!=="number")return jn(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 o=ma(r.stops.map(p=>p[0]),t),a=P0(t,n,r.stops[o][0],r.stops[o+1][0]),s=r.stops[o][1],u=r.stops[o+1][1],c=ft[e.type]||h0;return typeof s.evaluate=="function"?{evaluate(...p){let f=s.evaluate.apply(void 0,p),y=u.evaluate.apply(void 0,p);if(!(f===void 0||y===void 0))return c(f,y,a,r.colorSpace)}}:c(s,u,a,r.colorSpace)}l(Xy,"evaluateExponentialFunction");function v0(r,e,t){switch(e.type){case"color":t=Y.parse(t);break;case"formatted":t=Le.fromString(t.toString());break;case"resolvedImage":t=_e.fromString(t.toString());break;case"padding":t=$e.parse(t);break;case"colorArray":t=Ae.parse(t);break;case"numberArray":t=je.parse(t);break;default:X(t)!==e.type&&(e.type!=="enum"||!e.values[t])&&(t=void 0)}return jn(t,r.default,e.default)}l(v0,"evaluateIdentityFunction");function P0(r,e,t,n){let i=n-t,o=r-t;return i===0?0:e===1?o/i:(Math.pow(e,o)-1)/(Math.pow(e,i)-1)}l(P0,"interpolationFactor");var eu=class eu{constructor(e,t){this.expression=e,this._warningHistory={},this._evaluator=new Fo,this._defaultValue=t?w0(t):null,this._enumValues=t&&t.type==="enum"?t.values:null}evaluateWithoutErrorHandling(e,t,n,i,o,a){return this._evaluator.globals=e,this._evaluator.feature=t,this._evaluator.featureState=n,this._evaluator.canonical=i,this._evaluator.availableImages=o||null,this._evaluator.formattedSection=a,this.expression.evaluate(this._evaluator)}evaluate(e,t,n,i,o,a){this._evaluator.globals=e,this._evaluator.feature=t||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 ae("Expected value to be one of ".concat(Object.keys(this._enumValues).map(u=>JSON.stringify(u)).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}}};l(eu,"StyleExpression");var ar=eu;function qn(r){return Array.isArray(r)&&r.length>0&&typeof r[0]=="string"&&r[0]in cr}l(qn,"isExpression");function pr(r,e){let t=new Eo(cr,Go,[],e?S0(e):void 0),n=t.parse(r,void 0,void 0,void 0,e&&e.type==="string"?{typeAnnotation:"coerce"}:void 0);return n?Dl(new ar(n,e)):Fr(t.errors)}l(pr,"createExpression");var tu=class tu{constructor(e,t){this.kind=e,this._styleExpression=t,this.isStateDependent=e!=="constant"&&!On(t.expression),this.globalStateRefs=xa(t.expression)}evaluateWithoutErrorHandling(e,t,n,i,o,a){return this._styleExpression.evaluateWithoutErrorHandling(e,t,n,i,o,a)}evaluate(e,t,n,i,o,a){return this._styleExpression.evaluate(e,t,n,i,o,a)}};l(tu,"ZoomConstantExpression");var et=tu,ru=class ru{constructor(e,t,n,i){this.kind=e,this.zoomStops=n,this._styleExpression=t,this.isStateDependent=e!=="camera"&&!On(t.expression),this.globalStateRefs=xa(t.expression),this.interpolationType=i}evaluateWithoutErrorHandling(e,t,n,i,o,a){return this._styleExpression.evaluateWithoutErrorHandling(e,t,n,i,o,a)}evaluate(e,t,n,i,o,a){return this._styleExpression.evaluate(e,t,n,i,o,a)}interpolationFactor(e,t,n){return this.interpolationType?Me.interpolationFactor(this.interpolationType,e,t,n):0}};l(ru,"ZoomDependentExpression");var Lt=ru;function Hy(r){return r._styleExpression!==void 0}l(Hy,"isZoomExpression");function Zy(r,e){let t=pr(r,e);if(t.result==="error")return t;let n=t.value.expression,i=da(n);if(!i&&!Mt(e))return Fr([new Ge("","data expressions not supported")]);let o=ga(n,["zoom"]);if(!o&&!qy(e))return Fr([new Ge("","zoom expressions not supported")]);let a=ko(n);if(!a&&!o)return Fr([new Ge("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]);if(a instanceof Ge)return Fr([a]);if(a instanceof Me&&!Ul(e))return Fr([new Ge("",'"interpolate" expressions cannot be used with this property')]);if(!a)return Dl(i?new et("constant",t.value):new et("source",t.value));let s=a instanceof Me?a.interpolation:void 0;return Dl(i?new Lt("camera",t.value,a.labels,s):new Lt("composite",t.value,a.labels,s))}l(Zy,"createPropertyExpression");var la=class la{constructor(e,t){this._parameters=e,this._specification=t,Br(this,Wy(this._parameters,this._specification))}static deserialize(e){return new la(e._parameters,e._specification)}static serialize(e){return{_parameters:e._parameters,_specification:e._specification}}};l(la,"StylePropertyFunction");var Gn=la;function Jy(r,e){if(ba(r))return new Gn(r,e);if(qn(r)){let t=Zy(r,e);if(t.result==="error")throw new Error(t.value.map(n=>"".concat(n.key,": ").concat(n.message)).join(", "));return t.value}else{let t=r;return e.type==="color"&&typeof r=="string"?t=Y.parse(r):e.type==="padding"&&(typeof r=="number"||Array.isArray(r))?t=$e.parse(r):e.type==="numberArray"&&(typeof r=="number"||Array.isArray(r))?t=je.parse(r):e.type==="colorArray"&&(typeof r=="string"||Array.isArray(r))?t=Ae.parse(r):e.type==="variableAnchorOffsetCollection"&&Array.isArray(r)?t=De.parse(r):e.type==="projectionDefinition"&&typeof r=="string"&&(t=Ft.parse(r)),{globalStateRefs:new Set,kind:"constant",evaluate:l(()=>t,"evaluate")}}}l(Jy,"normalizePropertyExpression");function ko(r){let e=null;if(r instanceof Mo)e=ko(r.result);else if(r instanceof Do){for(let t of r.args)if(e=ko(t),e)break}else(r instanceof zr||r instanceof Me)&&r.input instanceof Qe&&r.input.name==="zoom"&&(e=r);return e instanceof Ge||r.eachChild(t=>{let n=ko(t);n instanceof Ge?e=n:!e&&n?e=new Ge("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):e&&n&&e!==n&&(e=new Ge("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),e}l(ko,"findZoomCurve");function xa(r,e=new Set){return r instanceof zn&&e.add(r.key),r.eachChild(t=>{xa(t,e)}),e}l(xa,"findGlobalStateRefs");function S0(r){let e={color:Ue,string:W,number:M,enum:W,boolean:q,formatted:Nr,padding:pa,numberArray:fa,colorArray:Cn,projectionDefinition:ua,resolvedImage:Un,variableAnchorOffsetCollection:ya};return r.type==="array"?Ee(e[r.value]||j,r.length):e[r.type]}l(S0,"getExpectedType");function w0(r){if(r.type==="color"&&ba(r.default))return new Y(0,0,0,0);switch(r.type){case"color":return Y.parse(r.default)||null;case"padding":return $e.parse(r.default)||null;case"numberArray":return je.parse(r.default)||null;case"colorArray":return Ae.parse(r.default)||null;case"variableAnchorOffsetCollection":return De.parse(r.default)||null;case"projectionDefinition":return Ft.parse(r.default)||null;default:return r.default===void 0?null:r.default}}l(w0,"getDefaultValue");function $l(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(!$l(e)&&typeof e!="boolean")return!1;return!0;default:return!0}}l($l,"isExpressionFilter");var A0={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function Dt(r){if(r==null)return{filter:l(()=>!0,"filter"),needGeometry:!1,getGlobalStateRefs:l(()=>new Set,"getGlobalStateRefs")};$l(r)||(r=No(r));let e=pr(r,A0);if(e.result==="error")throw new Error(e.value.map(t=>"".concat(t.key,": ").concat(t.message)).join(", "));{let t=Yy(r);return{filter:l((n,i,o)=>e.value.evaluate(n,i,{},o),"filter"),needGeometry:t,getGlobalStateRefs:l(()=>xa(e.value.expression),"getGlobalStateRefs")}}}l(Dt,"featureFilter");function _0(r,e){return r<e?-1:r>e?1:0}l(_0,"compare");function Yy(r){if(!Array.isArray(r))return!1;if(r[0]==="within"||r[0]==="distance")return!0;for(let e=1;e<r.length;e++)if(Yy(r[e]))return!0;return!1}l(Yy,"geometryNeeded");function No(r){if(!r)return!0;let e=r[0];return r.length<=1?e!=="any":e==="=="?bl(r[1],r[2],"=="):e==="!="?Co(bl(r[1],r[2],"==")):e==="<"||e===">"||e==="<="||e===">="?bl(r[1],r[2],e):e==="any"?I0(r.slice(1)):e==="all"?["all"].concat(r.slice(1).map(No)):e==="none"?["all"].concat(r.slice(1).map(No).map(Co)):e==="in"?Iy(r[1],r.slice(2)):e==="!in"?Co(Iy(r[1],r.slice(2))):e==="has"?Ty(r[1]):e==="!has"?Co(Ty(r[1])):!0}l(No,"convertFilter$1");function bl(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]}}l(bl,"convertComparisonOp$1");function I0(r){return["any"].concat(r.map(No))}l(I0,"convertDisjunctionOp");function Iy(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(_0)]]:["filter-in-small",r,["literal",e]]}}l(Iy,"convertInOp$1");function Ty(r){switch(r){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",r]}}l(Ty,"convertHasOp$1");function Co(r){return["!",r]}l(Co,"convertNegation");function Vl(r){let e=typeof r;if(e==="number"||e==="boolean"||e==="string"||r===void 0||r===null)return JSON.stringify(r);if(Array.isArray(r)){let i="[";for(let o of r)i+="".concat(Vl(o),",");return"".concat(i,"]")}let t=Object.keys(r).sort(),n="{";for(let i=0;i<t.length;i++)n+="".concat(JSON.stringify(t[i]),":").concat(Vl(r[t[i]]),",");return"".concat(n,"}")}l(Vl,"stringify$1");function T0(r){let e="";for(let t of ix)e+="/".concat(Vl(r[t]));return e}l(T0,"getKey");function Ky(r,e){let t={};for(let i=0;i<r.length;i++){let o=e&&e[r[i].id]||T0(r[i]);e&&(e[r[i].id]=o);let a=t[o];a||(a=t[o]=[]),a.push(r[i])}let n=[];for(let i in t)n.push(t[i]);return n}l(Ky,"groupByLayout");function Qy(r){let e=r.key,t=r.value;return t?[new E(e,t,"constants have been deprecated as of v8")]:[]}l(Qy,"validateConstants");function pe(r){return r instanceof Number||r instanceof String||r instanceof Boolean?r.valueOf():r}l(pe,"unbundle");function sr(r){if(Array.isArray(r))return r.map(sr);if(r instanceof Object&&!(r instanceof Number||r instanceof String||r instanceof Boolean)){let e={};for(let t in r)e[t]=sr(r[t]);return e}return pe(r)}l(sr,"deepUnbundle");function Ne(r){let e=r.key,t=r.value,n=r.valueSpec||{},i=r.objectElementValidators||{},o=r.style,a=r.styleSpec,s=r.validateSpec,u=[],c=X(t);if(c!=="object")return[new E(e,t,"object expected, ".concat(c," found"))];for(let p in t){let f=p.split(".")[0],y=Sn(n,f)||n["*"],m;if(Sn(i,f))m=i[f];else if(Sn(n,f))m=s;else if(i["*"])m=i["*"];else if(n["*"])m=s;else{u.push(new E(e,t[p],'unknown property "'.concat(p,'"')));continue}u=u.concat(m({key:(e&&"".concat(e,"."))+p,value:t[p],valueSpec:y,style:o,styleSpec:a,object:t,objectKey:p,validateSpec:s},t))}for(let p in n)i[p]||n[p].required&&n[p].default===void 0&&t[p]===void 0&&u.push(new E(e,t,'missing required property "'.concat(p,'"')));return u}l(Ne,"validateObject");function jl(r){let e=r.value,t=r.valueSpec,n=r.validateSpec,i=r.style,o=r.styleSpec,a=r.key,s=r.arrayElementValidator||n;if(X(e)!=="array")return[new E(a,e,"array expected, ".concat(X(e)," found"))];if(t.length&&e.length!==t.length)return[new E(a,e,"array length ".concat(t.length," expected, length ").concat(e.length," found"))];if(t["min-length"]&&e.length<t["min-length"])return[new E(a,e,"array length at least ".concat(t["min-length"]," expected, length ").concat(e.length," found"))];let u={type:t.value,values:t.values};o.$version<7&&(u.function=t.function),X(t.value)==="object"&&(u=t.value);let c=[];for(let p=0;p<e.length;p++)c=c.concat(s({array:e,arrayIndex:p,value:e[p],valueSpec:u,validateSpec:r.validateSpec,style:i,styleSpec:o,key:"".concat(a,"[").concat(p,"]")}));return c}l(jl,"validateArray");function va(r){let e=r.key,t=r.value,n=r.valueSpec,i=X(t);return i==="number"&&t!==t&&(i="NaN"),i!=="number"?[new E(e,t,"number expected, ".concat(i," found"))]:"minimum"in n&&t<n.minimum?[new E(e,t,"".concat(t," is less than the minimum value ").concat(n.minimum))]:"maximum"in n&&t>n.maximum?[new E(e,t,"".concat(t," is greater than the maximum value ").concat(n.maximum))]:[]}l(va,"validateNumber");function em(r){let e=r.valueSpec,t=pe(r.value.type),n,i={},o,a,s=t!=="categorical"&&r.value.property===void 0,u=!s,c=X(r.value.stops)==="array"&&X(r.value.stops[0])==="array"&&X(r.value.stops[0][0])==="object",p=Ne({key:r.key,value:r.value,valueSpec:r.styleSpec.function,validateSpec:r.validateSpec,style:r.style,styleSpec:r.styleSpec,objectElementValidators:{stops:f,default:h}});return t==="identity"&&s&&p.push(new E(r.key,r.value,'missing required property "property"')),t!=="identity"&&!r.value.stops&&p.push(new E(r.key,r.value,'missing required property "stops"')),t==="exponential"&&r.valueSpec.expression&&!Ul(r.valueSpec)&&p.push(new E(r.key,r.value,"exponential functions not supported")),r.styleSpec.$version>=8&&(u&&!Mt(r.valueSpec)?p.push(new E(r.key,r.value,"property functions not supported")):s&&!qy(r.valueSpec)&&p.push(new E(r.key,r.value,"zoom functions not supported"))),(t==="categorical"||c)&&r.value.property===void 0&&p.push(new E(r.key,r.value,'"property" property is required')),p;function f(d){if(t==="identity")return[new E(d.key,d.value,'identity function may not have a "stops" property')];let x=[],b=d.value;return x=x.concat(jl({key:d.key,value:b,valueSpec:d.valueSpec,validateSpec:d.validateSpec,style:d.style,styleSpec:d.styleSpec,arrayElementValidator:y})),X(b)==="array"&&b.length===0&&x.push(new E(d.key,b,"array must have at least one stop")),x}l(f,"validateFunctionStops");function y(d){let x=[],b=d.value,P=d.key;if(X(b)!=="array")return[new E(P,b,"array expected, ".concat(X(b)," found"))];if(b.length!==2)return[new E(P,b,"array length 2 expected, length ".concat(b.length," found"))];if(c){if(X(b[0])!=="object")return[new E(P,b,"object expected, ".concat(X(b[0])," found"))];if(b[0].zoom===void 0)return[new E(P,b,"object stop key must have zoom")];if(b[0].value===void 0)return[new E(P,b,"object stop key must have value")];if(a&&a>pe(b[0].zoom))return[new E(P,b[0].zoom,"stop zoom values must appear in ascending order")];pe(b[0].zoom)!==a&&(a=pe(b[0].zoom),o=void 0,i={}),x=x.concat(Ne({key:"".concat(P,"[0]"),value:b[0],valueSpec:{zoom:{}},validateSpec:d.validateSpec,style:d.style,styleSpec:d.styleSpec,objectElementValidators:{zoom:va,value:m}}))}else x=x.concat(m({key:"".concat(P,"[0]"),value:b[0],validateSpec:d.validateSpec,style:d.style,styleSpec:d.styleSpec},b));return qn(sr(b[1]))?x.concat([new E("".concat(P,"[1]"),b[1],"expressions are not allowed in function stops.")]):x.concat(d.validateSpec({key:"".concat(P,"[1]"),value:b[1],valueSpec:e,validateSpec:d.validateSpec,style:d.style,styleSpec:d.styleSpec}))}l(y,"validateFunctionStop");function m(d,x){let b=X(d.value),P=pe(d.value),v=d.value!==null?d.value:x;if(!n)n=b;else if(b!==n)return[new E(d.key,v,"".concat(b," stop domain type must match previous stop domain type ").concat(n))];if(b!=="number"&&b!=="string"&&b!=="boolean")return[new E(d.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 Mt(e)&&t===void 0&&(S+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new E(d.key,v,S)]}return t==="categorical"&&b==="number"&&(!isFinite(P)||Math.floor(P)!==P)?[new E(d.key,v,"integer expected, found ".concat(P))]:t!=="categorical"&&b==="number"&&o!==void 0&&P<o?[new E(d.key,v,"stop domain values must appear in ascending order")]:(o=P,t==="categorical"&&P in i?[new E(d.key,v,"stop domain values must be unique")]:(i[P]=!0,[]))}l(m,"validateStopDomainValue");function h(d){return d.validateSpec({key:d.key,value:d.value,valueSpec:e,validateSpec:d.validateSpec,style:d.style,styleSpec:d.styleSpec})}l(h,"validateFunctionDefault")}l(em,"validateFunction");function Or(r){let e=(r.expressionContext==="property"?Zy:pr)(sr(r.value),r.valueSpec);if(e.result==="error")return e.value.map(n=>new E("".concat(r.key).concat(n.key),r.value,n.message));let t=e.value.expression||e.value._styleExpression.expression;if(r.expressionContext==="property"&&r.propertyKey==="text-font"&&!t.outputDefined())return[new E(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"&&!On(t))return[new E(r.key,r.value,'"feature-state" data expressions are not supported with layout properties.')];if(r.expressionContext==="filter"&&!On(t))return[new E(r.key,r.value,'"feature-state" data expressions are not supported with filters.')];if(r.expressionContext&&r.expressionContext.indexOf("cluster")===0){if(!ga(t,["zoom","feature-state"]))return[new E(r.key,r.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(r.expressionContext==="cluster-initial"&&!da(t))return[new E(r.key,r.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}l(Or,"validateExpression");function C0(r){let e=r.value,t=r.key,n=X(e);return n!=="boolean"?[new E(t,e,"boolean expected, ".concat(n," found"))]:[]}l(C0,"validateBoolean");function Bl(r){let e=r.key,t=r.value,n=X(t);return n!=="string"?[new E(e,t,"color expected, ".concat(n," found"))]:Y.parse(String(t))?[]:[new E(e,t,'color expected, "'.concat(t,'" found'))]}l(Bl,"validateColor");function Nn(r){let e=r.key,t=r.value,n=r.valueSpec,i=[];return Array.isArray(n.values)?n.values.indexOf(pe(t))===-1&&i.push(new E(e,t,"expected one of [".concat(n.values.join(", "),"], ").concat(JSON.stringify(t)," found"))):Object.keys(n.values).indexOf(pe(t))===-1&&i.push(new E(e,t,"expected one of [".concat(Object.keys(n.values).join(", "),"], ").concat(JSON.stringify(t)," found"))),i}l(Nn,"validateEnum");function ql(r){return $l(sr(r.value))?Or(Br({},r,{expressionContext:"filter",valueSpec:{value:"boolean"}})):tm(r)}l(ql,"validateFilter");function tm(r){let e=r.value,t=r.key;if(X(e)!=="array")return[new E(t,e,"array expected, ".concat(X(e)," found"))];let n=r.styleSpec,i,o=[];if(e.length<1)return[new E(t,e,"filter array must have at least 1 element")];switch(o=o.concat(Nn({key:"".concat(t,"[0]"),value:e[0],valueSpec:n.filter_operator,style:r.style,styleSpec:r.styleSpec})),pe(e[0])){case"<":case"<=":case">":case">=":e.length>=2&&pe(e[1])==="$type"&&o.push(new E(t,e,'"$type" cannot be use with operator "'.concat(e[0],'"')));case"==":case"!=":e.length!==3&&o.push(new E(t,e,'filter array for operator "'.concat(e[0],'" must have 3 elements')));case"in":case"!in":e.length>=2&&(i=X(e[1]),i!=="string"&&o.push(new E("".concat(t,"[1]"),e[1],"string expected, ".concat(i," found"))));for(let a=2;a<e.length;a++)i=X(e[a]),pe(e[1])==="$type"?o=o.concat(Nn({key:"".concat(t,"[").concat(a,"]"),value:e[a],valueSpec:n.geometry_type,style:r.style,styleSpec:r.styleSpec})):i!=="string"&&i!=="number"&&i!=="boolean"&&o.push(new E("".concat(t,"[").concat(a,"]"),e[a],"string, number, or boolean expected, ".concat(i," found")));break;case"any":case"all":case"none":for(let a=1;a<e.length;a++)o=o.concat(tm({key:"".concat(t,"[").concat(a,"]"),value:e[a],style:r.style,styleSpec:r.styleSpec}));break;case"has":case"!has":i=X(e[1]),e.length!==2?o.push(new E(t,e,'filter array for "'.concat(e[0],'" operator must have 2 elements'))):i!=="string"&&o.push(new E("".concat(t,"[1]"),e[1],"string expected, ".concat(i," found")));break}return o}l(tm,"validateNonExpressionFilter");function rm(r,e){let t=r.key,n=r.validateSpec,i=r.style,o=r.styleSpec,a=r.value,s=r.objectKey,u=o["".concat(e,"_").concat(r.layerType)];if(!u)return[];let c=s.match(/^(.*)-transition$/);if(e==="paint"&&c&&u[c[1]]&&u[c[1]].transition)return n({key:t,value:a,valueSpec:o.transition,style:i,styleSpec:o});let p=r.valueSpec||u[s];if(!p)return[new E(t,a,'unknown property "'.concat(s,'"'))];let f;if(X(a)==="string"&&Mt(p)&&!p.tokens&&(f=/^{([^}]+)}$/.exec(a)))return[new E(t,a,'"'.concat(s,'" does not support interpolation syntax\n')+'Use an identity property function instead: `{ "type": "identity", "property": '.concat(JSON.stringify(f[1])," }`."))];let y=[];return r.layerType==="symbol"&&(s==="text-field"&&i&&!i.glyphs&&y.push(new E(t,a,'use of "text-field" requires a style "glyphs" property')),s==="text-font"&&ba(sr(a))&&pe(a.type)==="identity"&&y.push(new E(t,a,'"text-font" does not support identity functions'))),y.concat(n({key:r.key,value:a,valueSpec:p,style:i,styleSpec:o,expressionContext:"property",propertyType:e,propertyKey:s}))}l(rm,"validateProperty");function nm(r){return rm(r,"paint")}l(nm,"validatePaintProperty");function im(r){return rm(r,"layout")}l(im,"validateLayoutProperty");function om(r){let e=[],t=r.value,n=r.key,i=r.style,o=r.styleSpec;if(X(t)!=="object")return[new E(n,t,"object expected, ".concat(X(t)," found"))];!t.type&&!t.ref&&e.push(new E(n,t,'either "type" or "ref" is required'));let a=pe(t.type),s=pe(t.ref);if(t.id){let u=pe(t.id);for(let c=0;c<r.arrayIndex;c++){let p=i.layers[c];pe(p.id)===u&&e.push(new E(n,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 E(n,t[c],'"'.concat(c,'" is prohibited for ref layers')))});let u;i.layers.forEach(c=>{pe(c.id)===s&&(u=c)}),u?u.ref?e.push(new E(n,t.ref,"ref cannot reference another ref layer")):a=pe(u.type):e.push(new E(n,t.ref,'ref layer "'.concat(s,'" not found')))}else if(a!=="background")if(!t.source)e.push(new E(n,t,'missing required property "source"'));else{let u=i.sources&&i.sources[t.source],c=u&&pe(u.type);u?c==="vector"&&a==="raster"?e.push(new E(n,t.source,'layer "'.concat(t.id,'" requires a raster source'))):c!=="raster-dem"&&a==="hillshade"?e.push(new E(n,t.source,'layer "'.concat(t.id,'" requires a raster-dem source'))):c!=="raster-dem"&&a==="color-relief"?e.push(new E(n,t.source,'layer "'.concat(t.id,'" requires a raster-dem source'))):c==="raster"&&a!=="raster"?e.push(new E(n,t.source,'layer "'.concat(t.id,'" requires a vector source'))):c==="vector"&&!t["source-layer"]?e.push(new E(n,t,'layer "'.concat(t.id,'" must specify a "source-layer"'))):c==="raster-dem"&&a!=="hillshade"&&a!=="color-relief"?e.push(new E(n,t.source,"raster-dem source can only be used with layer type 'hillshade' or 'color-relief'.")):a==="line"&&t.paint&&t.paint["line-gradient"]&&(c!=="geojson"||!u.lineMetrics)&&e.push(new E(n,t,'layer "'.concat(t.id,'" specifies a line-gradient, which requires a GeoJSON source with `lineMetrics` enabled.'))):e.push(new E(n,t.source,'source "'.concat(t.source,'" not found')))}return e=e.concat(Ne({key:n,value:t,valueSpec:o.layer,style:r.style,styleSpec:r.styleSpec,validateSpec:r.validateSpec,objectElementValidators:{"*"(){return[]},type(){return r.validateSpec({key:"".concat(n,".type"),value:t.type,valueSpec:o.layer.type,style:r.style,styleSpec:r.styleSpec,validateSpec:r.validateSpec,object:t,objectKey:"type"})},filter:ql,layout(u){return Ne({layer:t,key:u.key,value:u.value,style:u.style,styleSpec:u.styleSpec,validateSpec:u.validateSpec,objectElementValidators:{"*"(c){return im(Br({layerType:a},c))}}})},paint(u){return Ne({layer:t,key:u.key,value:u.value,style:u.style,styleSpec:u.styleSpec,validateSpec:u.validateSpec,objectElementValidators:{"*"(c){return nm(Br({layerType:a},c))}}})}}})),e}l(om,"validateLayer");function lr(r){let e=r.value,t=r.key,n=X(e);return n!=="string"?[new E(t,e,"string expected, ".concat(n," found"))]:[]}l(lr,"validateString");function k0(r){var e;let t=(e=r.sourceName)!==null&&e!==void 0?e:"",n=r.value,i=r.styleSpec,o=i.source_raster_dem,a=r.style,s=[],u=X(n);if(n===void 0)return s;if(u!=="object")return s.push(new E("source_raster_dem",n,"object expected, ".concat(u," found"))),s;let p=pe(n.encoding)==="custom",f=["redFactor","greenFactor","blueFactor","baseShift"],y=r.value.encoding?'"'.concat(r.value.encoding,'"'):"Default";for(let m in n)!p&&f.includes(m)?s.push(new E(m,n[m],'In "'.concat(t,'": "').concat(m,'" is only valid when "encoding" is set to "custom". ').concat(y," encoding found"))):o[m]?s=s.concat(r.validateSpec({key:m,value:n[m],valueSpec:o[m],validateSpec:r.validateSpec,style:a,styleSpec:i})):s.push(new E(m,n[m],'unknown property "'.concat(m,'"')));return s}l(k0,"validateRasterDEMSource");var Cy={promoteId:F0};function am(r){let e=r.value,t=r.key,n=r.styleSpec,i=r.style,o=r.validateSpec;if(!e.type)return[new E(t,e,'"type" is required')];let a=pe(e.type),s;switch(a){case"vector":case"raster":return s=Ne({key:t,value:e,valueSpec:n["source_".concat(a.replace("-","_"))],style:r.style,styleSpec:n,objectElementValidators:Cy,validateSpec:o}),s;case"raster-dem":return s=k0({sourceName:t,value:e,style:r.style,styleSpec:n,validateSpec:o}),s;case"geojson":if(s=Ne({key:t,value:e,valueSpec:n.source_geojson,style:i,styleSpec:n,validateSpec:o,objectElementValidators:Cy}),e.cluster)for(let u in e.clusterProperties){let[c,p]=e.clusterProperties[u],f=typeof c=="string"?[c,["accumulated"],["get",u]]:c;s.push(...Or({key:"".concat(t,".").concat(u,".map"),value:p,expressionContext:"cluster-map"})),s.push(...Or({key:"".concat(t,".").concat(u,".reduce"),value:f,expressionContext:"cluster-reduce"}))}return s;case"video":return Ne({key:t,value:e,valueSpec:n.source_video,style:i,validateSpec:o,styleSpec:n});case"image":return Ne({key:t,value:e,valueSpec:n.source_image,style:i,validateSpec:o,styleSpec:n});case"canvas":return[new E(t,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return Nn({key:"".concat(t,".type"),value:e.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]}})}}l(am,"validateSource");function F0({key:r,value:e}){if(X(e)==="string")return lr({key:r,value:e});{let t=[];for(let n in e)t.push(...lr({key:"".concat(r,".").concat(n),value:e[n]}));return t}}l(F0,"validatePromoteId");function sm(r){let e=r.value,t=r.styleSpec,n=t.light,i=r.style,o=[],a=X(e);if(e===void 0)return o;if(a!=="object")return o=o.concat([new E("light",e,"object expected, ".concat(a," found"))]),o;for(let s in e){let u=s.match(/^(.*)-transition$/);u&&n[u[1]]&&n[u[1]].transition?o=o.concat(r.validateSpec({key:s,value:e[s],valueSpec:t.transition,validateSpec:r.validateSpec,style:i,styleSpec:t})):n[s]?o=o.concat(r.validateSpec({key:s,value:e[s],valueSpec:n[s],validateSpec:r.validateSpec,style:i,styleSpec:t})):o=o.concat([new E(s,e[s],'unknown property "'.concat(s,'"'))])}return o}l(sm,"validateLight");function lm(r){let e=r.value,t=r.styleSpec,n=t.sky,i=r.style,o=X(e);if(e===void 0)return[];if(o!=="object")return[new E("sky",e,"object expected, ".concat(o," found"))];let a=[];for(let s in e)n[s]?a=a.concat(r.validateSpec({key:s,value:e[s],valueSpec:n[s],style:i,styleSpec:t})):a=a.concat([new E(s,e[s],'unknown property "'.concat(s,'"'))]);return a}l(lm,"validateSky");function um(r){let e=r.value,t=r.styleSpec,n=t.terrain,i=r.style,o=[],a=X(e);if(e===void 0)return o;if(a!=="object")return o=o.concat([new E("terrain",e,"object expected, ".concat(a," found"))]),o;for(let s in e)n[s]?o=o.concat(r.validateSpec({key:s,value:e[s],valueSpec:n[s],validateSpec:r.validateSpec,style:i,styleSpec:t})):o=o.concat([new E(s,e[s],'unknown property "'.concat(s,'"'))]);return o}l(um,"validateTerrain");function E0(r){return lr(r).length===0?[]:Or(r)}l(E0,"validateFormatted");function M0(r){return lr(r).length===0?[]:Or(r)}l(M0,"validateImage");function L0(r){let e=r.key,t=r.value;if(X(t)==="array"){if(t.length<1||t.length>4)return[new E(e,t,"padding requires 1 to 4 values; ".concat(t.length," values found"))];let i={type:"number"},o=[];for(let a=0;a<t.length;a++)o=o.concat(r.validateSpec({key:"".concat(e,"[").concat(a,"]"),value:t[a],validateSpec:r.validateSpec,valueSpec:i}));return o}else return va({key:e,value:t,valueSpec:{}})}l(L0,"validatePadding");function D0(r){let e=r.key,t=r.value;if(X(t)==="array"){let i={type:"number"};if(t.length<1)return[new E(e,t,"array length at least 1 expected, length 0 found")];let o=[];for(let a=0;a<t.length;a++)o=o.concat(r.validateSpec({key:"".concat(e,"[").concat(a,"]"),value:t[a],validateSpec:r.validateSpec,valueSpec:i}));return o}else return va({key:e,value:t,valueSpec:{}})}l(D0,"validateNumberArray");function V0(r){let e=r.key,t=r.value;if(X(t)==="array"){if(t.length<1)return[new E(e,t,"array length at least 1 expected, length 0 found")];let i=[];for(let o=0;o<t.length;o++)i=i.concat(Bl({key:"".concat(e,"[").concat(o,"]"),value:t[o]}));return i}else return Bl({key:e,value:t})}l(V0,"validateColorArray");function B0(r){let e=r.key,t=r.value,n=X(t),i=r.styleSpec;if(n!=="array"||t.length<1||t.length%2!==0)return[new E(e,t,"variableAnchorOffsetCollection requires a non-empty array of even length")];let o=[];for(let a=0;a<t.length;a+=2)o=o.concat(Nn({key:"".concat(e,"[").concat(a,"]"),value:t[a],valueSpec:i.layout_symbol["text-anchor"]})),o=o.concat(jl({key:"".concat(e,"[").concat(a+1,"]"),value:t[a+1],valueSpec:{length:2,value:"number"},validateSpec:r.validateSpec,style:r.style,styleSpec:i}));return o}l(B0,"validateVariableAnchorOffsetCollection");function cm(r){let e=[],t=r.value,n=r.key;if(Array.isArray(t)){let i=[],o=[];for(let a in t){t[a].id&&i.includes(t[a].id)&&e.push(new E(n,t,"all the sprites' ids must be unique, but ".concat(t[a].id," is duplicated"))),i.push(t[a].id),t[a].url&&o.includes(t[a].url)&&e.push(new E(n,t,"all the sprites' URLs must be unique, but ".concat(t[a].url," is duplicated"))),o.push(t[a].url);let s={id:{type:"string",required:!0},url:{type:"string",required:!0}};e=e.concat(Ne({key:"".concat(n,"[").concat(a,"]"),value:t[a],valueSpec:s,validateSpec:r.validateSpec}))}return e}else return lr({key:n,value:t})}l(cm,"validateSprite");function R0(r){let e=r.value,t=r.styleSpec,n=t.projection,i=r.style,o=X(e);if(e===void 0)return[];if(o!=="object")return[new E("projection",e,"object expected, ".concat(o," found"))];let a=[];for(let s in e)n[s]?a=a.concat(r.validateSpec({key:s,value:e[s],valueSpec:n[s],style:i,styleSpec:t})):a=a.concat([new E(s,e[s],'unknown property "'.concat(s,'"'))]);return a}l(R0,"validateProjection");function z0(r){let e=r.key,t=r.value;t=t instanceof String?t.valueOf():t;let n=X(t);return n==="array"&&!G0(t)&&!O0(t)?[new E(e,t,"projection expected, invalid array ".concat(JSON.stringify(t)," found"))]:["array","string"].includes(n)?[]:[new E(e,t,'projection expected, invalid type "'.concat(n,'" found'))]}l(z0,"validateProjectionDefinition");function O0(r){return!!["interpolate","step","literal"].includes(r[0])}l(O0,"isPropertyValueSpecification");function G0(r){return Array.isArray(r)&&r.length===3&&typeof r[0]=="string"&&typeof r[1]=="string"&&typeof r[2]=="number"}l(G0,"isProjectionDefinitionValue");function N0(r){return!!r&&r.constructor===Object}l(N0,"isObjectLiteral");function pm(r){return N0(r.value)?[]:[new E(r.key,r.value,"object expected, ".concat(X(r.value)," found"))]}l(pm,"validateState");var ky={"*"(){return[]},array:jl,boolean:C0,number:va,color:Bl,constants:Qy,enum:Nn,filter:ql,function:em,layer:om,object:Ne,source:am,light:sm,sky:lm,terrain:um,projection:R0,projectionDefinition:z0,string:lr,formatted:E0,resolvedImage:M0,padding:L0,numberArray:D0,colorArray:V0,variableAnchorOffsetCollection:B0,sprite:cm,state:pm};function Uo(r){let e=r.value,t=r.valueSpec,n=r.styleSpec;return r.validateSpec=Uo,t.expression&&ba(pe(e))?em(r):t.expression&&qn(sr(e))?Or(r):t.type&&ky[t.type]?ky[t.type](r):Ne(Br({},r,{valueSpec:t.type?n[t.type]:t}))}l(Uo,"validate");function fm(r){let e=r.value,t=r.key,n=lr(r);return n.length||(e.indexOf("{fontstack}")===-1&&n.push(new E(t,e,'"glyphs" url must include a "{fontstack}" token')),e.indexOf("{range}")===-1&&n.push(new E(t,e,'"glyphs" url must include a "{range}" token'))),n}l(fm,"validateGlyphsUrl");function Ve(r,e=A){let t=[];return t=t.concat(Uo({key:"",value:r,valueSpec:e.$root,styleSpec:e,style:r,validateSpec:Uo,objectElementValidators:{glyphs:fm,"*"(){return[]}}})),r.constants&&(t=t.concat(Qy({key:"constants",value:r.constants}))),ym(t)}l(Ve,"validateStyleMin");Ve.source=Ze(He(am));Ve.sprite=Ze(He(cm));Ve.glyphs=Ze(He(fm));Ve.light=Ze(He(sm));Ve.sky=Ze(He(lm));Ve.terrain=Ze(He(um));Ve.state=Ze(He(pm));Ve.layer=Ze(He(om));Ve.filter=Ze(He(ql));Ve.paintProperty=Ze(He(nm));Ve.layoutProperty=Ze(He(im));function He(r){return function(e){return r(xo(Jt({},e),{validateSpec:Uo}))}}l(He,"injectValidateSpec");function ym(r){return[].concat(r).sort((e,t)=>e.line-t.line)}l(ym,"sortErrors");function Ze(r){return function(...e){return ym(r.apply(this,e))}}l(Ze,"wrapCleanErrors");g();g();var mm="AbortError";function hm(r){return r.message===mm}l(hm,"isAbortError");function nu(){return new Error(mm)}l(nu,"createAbortError");g();g();var Pa={MAX_PARALLEL_IMAGE_REQUESTS:16,MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:8,MAX_TILE_CACHE_ZOOM_LEVELS:5,REGISTERED_PROTOCOLS:{},WORKER_URL:""};function dm(r){return Pa.REGISTERED_PROTOCOLS[r.substring(0,r.indexOf("://"))]}l(dm,"getProtocol");function gm(r,e){Pa.REGISTERED_PROTOCOLS[r]=e}l(gm,"addProtocol");function bm(r){delete Pa.REGISTERED_PROTOCOLS[r]}l(bm,"removeProtocol");g();var xm="global-dispatcher",iu=class iu extends Error{constructor(e,t,n,i){super("AJAXError: ".concat(t," (").concat(e,"): ").concat(n)),this.status=e,this.statusText=t,this.url=n,this.body=i}};l(iu,"AJAXError");var fr=iu,Pm=l(()=>ct(self)?self.worker&&self.worker.referrer:(window.location.protocol==="blob:"?window.parent:window).location.href,"getReferrer"),U0=l(r=>/^file:/.test(r)||/^file:/.test(Pm())&&!/^\w+:/.test(r),"isFileURL");async function $0(r,e){let t=new Request(r.url,{method:r.method||"GET",body:r.body,credentials:r.credentials,headers:r.headers,cache:r.cache,referrer:Pm(),signal:e.signal});r.type==="json"&&!t.headers.has("Accept")&&t.headers.set("Accept","application/json");let n;try{n=await fetch(t)}catch(a){throw new fr(0,a.message,r.url,new Blob)}if(!n.ok){let a=await n.blob();throw new fr(n.status,n.statusText,r.url,a)}let i;r.type==="arrayBuffer"||r.type==="image"?i=n.arrayBuffer():r.type==="json"?i=n.json():i=n.text();let o=await i;if(e.signal.aborted)throw nu();return{data:o,cacheControl:n.headers.get("Cache-Control"),expires:n.headers.get("Expires")}}l($0,"makeFetchRequest");function j0(r,e){return new Promise((t,n)=>{var o;let i=new XMLHttpRequest;i.open(r.method||"GET",r.url,!0),(r.type==="arrayBuffer"||r.type==="image")&&(i.responseType="arraybuffer");for(let a in r.headers)i.setRequestHeader(a,r.headers[a]);r.type==="json"&&(i.responseType="text",(o=r.headers)!=null&&o.Accept||i.setRequestHeader("Accept","application/json")),i.withCredentials=r.credentials==="include",i.onerror=()=>{n(new Error(i.statusText))},i.onload=()=>{if(!e.signal.aborted)if((i.status>=200&&i.status<300||i.status===0)&&i.response!==null){let a=i.response;if(r.type==="json")try{a=JSON.parse(i.response)}catch(s){n(s);return}t({data:a,cacheControl:i.getResponseHeader("Cache-Control"),expires:i.getResponseHeader("Expires")})}else{let a=new Blob([i.response],{type:i.getResponseHeader("Content-Type")});n(new fr(i.status,i.statusText,r.url,a))}},e.signal.addEventListener("abort",()=>{i.abort(),n(nu())}),i.send(r.body)})}l(j0,"makeXMLHttpRequest");var Sm=l(function(r,e){if(/:\/\//.test(r.url)&&!/^https?:|^file:/.test(r.url)){let t=dm(r.url);if(t)return t(r,e);if(ct(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:r,targetMapId:xm},e)}if(!U0(r.url)){if(fetch&&Request&&AbortController&&Object.prototype.hasOwnProperty.call(Request.prototype,"signal"))return $0(r,e);if(ct(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:r,mustQueue:!0,targetMapId:xm},e)}return j0(r,e)},"makeRequest"),wm=l((r,e)=>Sm(xe(r,{type:"json"}),e),"getJSON"),Am=l((r,e)=>Sm(xe(r,{type:"arrayBuffer"}),e),"getArrayBuffer");var yt={};function k(r,e,t={}){if(yt[r])throw new Error("".concat(r," is already registered."));Object.defineProperty(e,"_classRegistryKey",{value:r,writeable:!1}),yt[r]={klass:e,omit:t.omit||[],shallow:t.shallow||[]}}l(k,"register");k("Object",Object);k("Set",Set);k("TransferableGridIndex",Yt);k("Color",Y);k("Error",Error);k("AJAXError",fr);k("ResolvedImage",_e);k("StylePropertyFunction",Gn);k("StyleExpression",ar,{omit:["_evaluator"]});k("ZoomDependentExpression",Lt);k("ZoomConstantExpression",et);k("CompoundExpression",Qe,{omit:["_evaluate"]});for(let r in cr)cr[r]._classRegistryKey||k("Expression_".concat(r),cr[r]);function _m(r){return r&&typeof ArrayBuffer<"u"&&(r instanceof ArrayBuffer||r.constructor&&r.constructor.name==="ArrayBuffer")}l(_m,"isArrayBuffer");function ou(r){let e=r.constructor;return r.$name||e._classRegistryKey}l(ou,"getClassRegistryKey");function q0(r){if(r===null||typeof r!="object")return!1;let e=ou(r);return!!(e&&e!=="Object")}l(q0,"isRegistered");function Im(r){return!q0(r)&&(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||r instanceof Error||_m(r)||At(r)||ArrayBuffer.isView(r)||r instanceof ImageData)}l(Im,"isSerializeHandledByBuiltin");function jr(r,e){if(Im(r)){if((_m(r)||At(r))&&e&&e.push(r),ArrayBuffer.isView(r)){let o=r;e&&e.push(o.buffer)}return r instanceof ImageData&&e&&e.push(r.data.buffer),r}if(Array.isArray(r)){let o=[];for(let a of r)o.push(jr(a,e));return o}if(typeof r!="object")throw new Error("can't serialize object of type ".concat(typeof r));let t=ou(r);if(!t)throw new Error("can't serialize object of unregistered class ".concat(r.constructor.name));if(!yt[t])throw new Error("".concat(t," is not registered."));let{klass:n}=yt[t],i=n.serialize?n.serialize(r,e):{};if(n.serialize){if(e&&i===e[e.length-1])throw new Error("statically serialized object won't survive transfer of $name property")}else{for(let o in r){if(!r.hasOwnProperty(o)||yt[t].omit.indexOf(o)>=0)continue;let a=r[o];i[o]=yt[t].shallow.indexOf(o)>=0?a:jr(a,e)}r instanceof Error&&(i.message=r.message)}if(i.$name)throw new Error("$name property is reserved for worker serialization logic.");return t!=="Object"&&(i.$name=t),i}l(jr,"serialize");function qr(r){if(Im(r))return r;if(Array.isArray(r))return r.map(qr);if(typeof r!="object")throw new Error("can't deserialize object of type ".concat(typeof r));let e=ou(r)||"Object";if(!yt[e])throw new Error("can't deserialize unregistered class ".concat(e));let{klass:t}=yt[e];if(!t)throw new Error("can't deserialize unregistered class ".concat(e));if(t.deserialize)return t.deserialize(r);let n=Object.create(t.prototype);for(let i of Object.keys(r)){if(i==="$name")continue;let o=r[i];n[i]=yt[e].shallow.indexOf(i)>=0?o:qr(o)}return n}l(qr,"deserialize");g();var au=class au{constructor(e){this._methodToThrottle=e,this._triggered=!1,typeof MessageChannel<"u"&&(this._channel=new MessageChannel,this._channel.port2.onmessage=()=>{this._triggered=!1,this._methodToThrottle()})}trigger(){this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout(()=>{this._triggered=!1,this._methodToThrottle()},0))}remove(){delete this._channel,this._methodToThrottle=()=>{}}};l(au,"ThrottledInvoker");var Sa=au;var W0={once:!0},su=class su{constructor(e,t){this.target=e,this.mapId=t,this.resolveRejects={},this.tasks={},this.taskQueue=[],this.abortControllers={},this.messageHandlers={},this.invoker=new Sa(()=>this.process()),this.subscription=ll(this.target,"message",n=>this.receive(n),!1),this.globalScope=ct(self)?e:window}registerMessageHandler(e,t){this.messageHandlers[e]=t}sendAsync(e,t){return new Promise((n,i)=>{let o=Math.round(Math.random()*1e18).toString(36).substring(0,10),a=t?ll(t.signal,"abort",()=>{a==null||a.unsubscribe(),delete this.resolveRejects[o];let c={id:o,type:"<cancel>",origin:location.origin,targetMapId:e.targetMapId,sourceMapId:this.mapId};this.target.postMessage(c)},W0):null;this.resolveRejects[o]={resolve:l(c=>{a==null||a.unsubscribe(),n(c)},"resolve"),reject:l(c=>{a==null||a.unsubscribe(),i(c)},"reject")};let s=[],u=xo(Jt({},e),{id:o,sourceMapId:this.mapId,origin:location.origin,data:jr(e.data,s)});this.target.postMessage(u,{transfer:s})})}receive(e){let t=e.data,n=t.id;if(!(t.origin!=="file://"&&location.origin!=="file://"&&t.origin!=="resource://android"&&location.origin!=="resource://android"&&t.origin!==location.origin)&&!(t.targetMapId&&this.mapId!==t.targetMapId)){if(t.type==="<cancel>"){delete this.tasks[n];let i=this.abortControllers[n];delete this.abortControllers[n],i&&i.abort();return}if(ct(self)||t.mustQueue){this.tasks[n]=t,this.taskQueue.push(n),this.invoker.trigger();return}this.processTask(n,t)}}process(){if(this.taskQueue.length===0)return;let e=this.taskQueue.shift(),t=this.tasks[e];delete this.tasks[e],this.taskQueue.length>0&&this.invoker.trigger(),t&&this.processTask(e,t)}async processTask(e,t){if(t.type==="<response>"){let o=this.resolveRejects[e];if(delete this.resolveRejects[e],!o)return;t.error?o.reject(qr(t.error)):o.resolve(qr(t.data));return}if(!this.messageHandlers[t.type]){this.completeTask(e,new Error("Could not find a registered handler for ".concat(t.type,", map ID: ").concat(this.mapId,", available handlers: ").concat(Object.keys(this.messageHandlers).join(", "))));return}let n=qr(t.data),i=new AbortController;this.abortControllers[e]=i;try{let o=await this.messageHandlers[t.type](t.sourceMapId,n,i);this.completeTask(e,null,o)}catch(o){this.completeTask(e,o)}}completeTask(e,t,n){let i=[];delete this.abortControllers[e];let o={id:e,type:"<response>",sourceMapId:this.mapId,origin:location.origin,error:t?jr(t):null,data:jr(n,i)};this.target.postMessage(o,{transfer:i})}remove(){this.invoker.remove(),this.subscription.unsubscribe()}};l(su,"Actor");var wa=su;g();g();g();g();g();g();function Tm(r,e,t){t[r]&&t[r].indexOf(e)!==-1||(t[r]=t[r]||[],t[r].push(e))}l(Tm,"_addEventListener");function lu(r,e,t){if(t&&t[r]){let n=t[r].indexOf(e);n!==-1&&t[r].splice(n,1)}}l(lu,"_removeEventListener");var uu=class uu{constructor(e,t={}){xe(this,t),this.type=e}};l(uu,"Event");var Aa=uu,cu=class cu extends Aa{constructor(e,t={}){super("error",xe({error:e},t))}};l(cu,"ErrorEvent");var Wn=cu,pu=class pu{on(e,t){return this._listeners=this._listeners||{},Tm(e,t,this._listeners),{unsubscribe:l(()=>{this.off(e,t)},"unsubscribe")}}off(e,t){return lu(e,t,this._listeners),lu(e,t,this._oneTimeListeners),this}once(e,t){return t?(this._oneTimeListeners=this._oneTimeListeners||{},Tm(e,t,this._oneTimeListeners),this):new Promise(n=>this.once(e,n))}fire(e,t){typeof e=="string"&&(e=new Aa(e,t||{}));let n=e.type;if(this.listens(n)){e.target=this;let i=this._listeners&&this._listeners[n]?this._listeners[n].slice():[];for(let s of i)s.call(this,e);let o=this._oneTimeListeners&&this._oneTimeListeners[n]?this._oneTimeListeners[n].slice():[];for(let s of o)lu(n,s,this._oneTimeListeners),s.call(this,e);let a=this._eventedParent;a&&(xe(e,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),a.fire(e))}else e instanceof Wn&&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}};l(pu,"Evented");var _a=pu;var mt=Ve,Sw=mt.source,ww=mt.light,Aw=mt.sky,_w=mt.terrain,Iw=mt.filter,Cm=mt.paintProperty,km=mt.layoutProperty;function Fm(r,e){let t=!1;if(e&&e.length)for(let n of e)r.fire(new Wn(new Error(n.message))),t=!0;return t}l(Fm,"emitValidationErrors");g();g();g();var fu=class fu{constructor(){this.first=!0}update(e,t){let n=Math.floor(e);return this.first?(this.first=!1,this.lastIntegerZoom=n,this.lastIntegerZoomTime=0,this.lastZoom=e,this.lastFloorZoom=n,!0):(this.lastFloorZoom>n?(this.lastIntegerZoom=n+1,this.lastIntegerZoomTime=t):this.lastFloorZoom<n&&(this.lastIntegerZoom=n,this.lastIntegerZoomTime=t),e!==this.lastZoom?(this.lastZoom=e,this.lastFloorZoom=n,!0):!1)}};l(fu,"ZoomHistory");var Xn=fu;g();g();var H={"Latin-1 Supplement":l(r=>r>=128&&r<=255,"Latin-1 Supplement"),"Hangul Jamo":l(r=>r>=4352&&r<=4607,"Hangul Jamo"),Khmer:l(r=>r>=6016&&r<=6143,"Khmer"),"General Punctuation":l(r=>r>=8192&&r<=8303,"General Punctuation"),"Letterlike Symbols":l(r=>r>=8448&&r<=8527,"Letterlike Symbols"),"Number Forms":l(r=>r>=8528&&r<=8591,"Number Forms"),"Miscellaneous Technical":l(r=>r>=8960&&r<=9215,"Miscellaneous Technical"),"Control Pictures":l(r=>r>=9216&&r<=9279,"Control Pictures"),"Optical Character Recognition":l(r=>r>=9280&&r<=9311,"Optical Character Recognition"),"Enclosed Alphanumerics":l(r=>r>=9312&&r<=9471,"Enclosed Alphanumerics"),"Geometric Shapes":l(r=>r>=9632&&r<=9727,"Geometric Shapes"),"Miscellaneous Symbols":l(r=>r>=9728&&r<=9983,"Miscellaneous Symbols"),"Miscellaneous Symbols and Arrows":l(r=>r>=11008&&r<=11263,"Miscellaneous Symbols and Arrows"),"Ideographic Description Characters":l(r=>r>=12272&&r<=12287,"Ideographic Description Characters"),"CJK Symbols and Punctuation":l(r=>r>=12288&&r<=12351,"CJK Symbols and Punctuation"),Hiragana:l(r=>r>=12352&&r<=12447,"Hiragana"),Katakana:l(r=>r>=12448&&r<=12543,"Katakana"),Kanbun:l(r=>r>=12688&&r<=12703,"Kanbun"),"CJK Strokes":l(r=>r>=12736&&r<=12783,"CJK Strokes"),"Enclosed CJK Letters and Months":l(r=>r>=12800&&r<=13055,"Enclosed CJK Letters and Months"),"CJK Compatibility":l(r=>r>=13056&&r<=13311,"CJK Compatibility"),"Yijing Hexagram Symbols":l(r=>r>=19904&&r<=19967,"Yijing Hexagram Symbols"),"CJK Unified Ideographs":l(r=>r>=19968&&r<=40959,"CJK Unified Ideographs"),"Hangul Syllables":l(r=>r>=44032&&r<=55215,"Hangul Syllables"),"Private Use Area":l(r=>r>=57344&&r<=63743,"Private Use Area"),"Vertical Forms":l(r=>r>=65040&&r<=65055,"Vertical Forms"),"CJK Compatibility Forms":l(r=>r>=65072&&r<=65103,"CJK Compatibility Forms"),"Small Form Variants":l(r=>r>=65104&&r<=65135,"Small Form Variants"),"Halfwidth and Fullwidth Forms":l(r=>r>=65280&&r<=65519,"Halfwidth and Fullwidth Forms")};function Hn(r){for(let e of r)if(Ia(e.charCodeAt(0)))return!0;return!1}l(Hn,"allowsVerticalWritingMode");function Em(r){for(let e of r)if(!Z0(e.charCodeAt(0)))return!1;return!0}l(Em,"allowsLetterSpacing");function yu(r){let e=r.map(t=>{try{return new RegExp("\\p{sc=".concat(t,"}"),"u").source}catch(n){return null}}).filter(t=>t);return new RegExp(e.join("|"),"u")}l(yu,"sanitizedRegExpFromScriptCodes");var X0=["Arab","Dupl","Mong","Ougr","Syrc"],H0=yu(X0);function Z0(r){return!H0.test(String.fromCodePoint(r))}l(Z0,"charAllowsLetterSpacing");var J0=["Bopo","Hani","Hira","Kana","Kits","Nshu","Tang","Yiii"],Mm=yu(J0);function Lm(r){return r<11904?!1:H["CJK Compatibility Forms"](r)||H["CJK Compatibility"](r)||H["CJK Strokes"](r)||H["CJK Symbols and Punctuation"](r)||H["Enclosed CJK Letters and Months"](r)||H["Halfwidth and Fullwidth Forms"](r)||H["Ideographic Description Characters"](r)||H["Vertical Forms"](r)?!0:Mm.test(String.fromCodePoint(r))}l(Lm,"charAllowsIdeographicBreaking");function Ia(r){return r===746||r===747?!0:r<4352?!1:!!(H["CJK Compatibility Forms"](r)&&!(r>=65097&&r<=65103)||H["CJK Compatibility"](r)||H["CJK Strokes"](r)||H["CJK Symbols and Punctuation"](r)&&!(r>=12296&&r<=12305)&&!(r>=12308&&r<=12319)&&r!==12336||H["Enclosed CJK Letters and Months"](r)||H["Ideographic Description Characters"](r)||H.Kanbun(r)||H.Katakana(r)&&r!==12540||H["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)||H["Small Form Variants"](r)&&!(r>=65112&&r<=65118)&&!(r>=65123&&r<=65126)||H["Vertical Forms"](r)||H["Yijing Hexagram Symbols"](r)||new RegExp("\\p{sc=Cans}","u").test(String.fromCodePoint(r))||new RegExp("\\p{sc=Hang}","u").test(String.fromCodePoint(r))||Mm.test(String.fromCodePoint(r)))}l(Ia,"charHasUprightVerticalOrientation");function Y0(r){return!!(H["Latin-1 Supplement"](r)&&(r===167||r===169||r===174||r===177||r===188||r===189||r===190||r===215||r===247)||H["General Punctuation"](r)&&(r===8214||r===8224||r===8225||r===8240||r===8241||r===8251||r===8252||r===8258||r===8263||r===8264||r===8265||r===8273)||H["Letterlike Symbols"](r)||H["Number Forms"](r)||H["Miscellaneous Technical"](r)&&(r>=8960&&r<=8967||r>=8972&&r<=8991||r>=8996&&r<=9e3||r===9003||r>=9085&&r<=9114||r>=9150&&r<=9165||r===9167||r>=9169&&r<=9179||r>=9186&&r<=9215)||H["Control Pictures"](r)&&r!==9251||H["Optical Character Recognition"](r)||H["Enclosed Alphanumerics"](r)||H["Geometric Shapes"](r)||H["Miscellaneous Symbols"](r)&&!(r>=9754&&r<=9759)||H["Miscellaneous Symbols and Arrows"](r)&&(r>=11026&&r<=11055||r>=11088&&r<=11097||r>=11192&&r<=11243)||H["CJK Symbols and Punctuation"](r)||H.Katakana(r)||H["Private Use Area"](r)||H["CJK Compatibility Forms"](r)||H["Small Form Variants"](r)||H["Halfwidth and Fullwidth Forms"](r)||r===8734||r===8756||r===8757||r>=9984&&r<=10087||r>=10102&&r<=10131||r===65532||r===65533)}l(Y0,"charHasNeutralVerticalOrientation");function mu(r){return!(Ia(r)||Y0(r))}l(mu,"charHasRotatedVerticalOrientation");function Dm(r){return new RegExp("\\p{sc=Arab}","u").test(String.fromCodePoint(r))}l(Dm,"charInComplexShapingScript");var K0=["Adlm","Arab","Armi","Avst","Chrs","Cprt","Egyp","Elym","Gara","Hatr","Hebr","Hung","Khar","Lydi","Mand","Mani","Mend","Merc","Mero","Narb","Nbat","Nkoo","Orkh","Palm","Phli","Phlp","Phnx","Prti","Rohg","Samr","Sarb","Sogo","Syrc","Thaa","Todr","Yezi"],Q0=yu(K0);function Vm(r){return Q0.test(String.fromCodePoint(r))}l(Vm,"charInRTLScript");function ev(r,e){return!(!e&&Vm(r)||r>=2304&&r<=3583||r>=3840&&r<=4255||H.Khmer(r))}l(ev,"charInSupportedScript");function Bm(r){for(let e of r)if(Vm(e.charCodeAt(0)))return!0;return!1}l(Bm,"stringContainsRTLText");function Rm(r,e){for(let t of r)if(!ev(t.charCodeAt(0),e))return!1;return!0}l(Rm,"isStringInSupportedScript");g();var du=class du{constructor(){this.TIMEOUT=5e3;this.applyArabicShaping=null;this.processBidirectionalText=null;this.processStyledBidirectionalText=null;this.pluginStatus="unavailable";this.pluginURL=null;this.loadScriptResolve=l(()=>{},"loadScriptResolve")}setState(e){this.pluginStatus=e.pluginStatus,this.pluginURL=e.pluginURL}getState(){return{pluginStatus:this.pluginStatus,pluginURL:this.pluginURL}}setMethods(e){if(Ie.isParsed())throw new Error("RTL text plugin already registered.");this.applyArabicShaping=e.applyArabicShaping,this.processBidirectionalText=e.processBidirectionalText,this.processStyledBidirectionalText=e.processStyledBidirectionalText,this.loadScriptResolve()}isParsed(){return this.applyArabicShaping!=null&&this.processBidirectionalText!=null&&this.processStyledBidirectionalText!=null}getRTLTextPluginStatus(){return this.pluginStatus}async syncState(e,t){if(this.isParsed())return this.getState();if(e.pluginStatus!=="loading")return this.setState(e),e;let n=e.pluginURL,i=new Promise(s=>{this.loadScriptResolve=s});t(n);let o=new Promise(s=>setTimeout(()=>s(),this.TIMEOUT));if(await Promise.race([i,o]),this.isParsed()){let s={pluginStatus:"loaded",pluginURL:n};return this.setState(s),s}throw this.setState({pluginStatus:"error",pluginURL:""}),new Error("RTL Text Plugin failed to import scripts from ".concat(n))}};l(du,"RTLWorkerPlugin");var hu=du,Ie=new hu;var gu=class gu{constructor(e,t){this.zoom=e,t?(this.now=t.now||0,this.fadeDuration=t.fadeDuration||0,this.zoomHistory=t.zoomHistory||new Xn,this.transition=t.transition||{},this.globalState=t.globalState||{}):(this.now=0,this.fadeDuration=0,this.zoomHistory=new Xn,this.transition={},this.globalState={})}isSupportedScript(e){return Rm(e,Ie.getRTLTextPluginStatus()==="loaded")}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),n=this.crossFadingFactor();return e>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:t+(1-t)*n}:{fromScale:.5,toScale:1,t:1-(1-n)*t}}};l(gu,"EvaluationParameters");var Z=gu;var bu=class bu{constructor(e,t){this.property=e,this.value=t,this.expression=Jy(t===void 0?e.specification.default:t,e.specification)}isDataDriven(){return this.expression.kind==="source"||this.expression.kind==="composite"}getGlobalStateRefs(){return this.expression.globalStateRefs||new Set}possiblyEvaluate(e,t,n){return this.property.possiblyEvaluate(this,e,t,n)}};l(bu,"PropertyValue");var Wr=bu,xu=class xu{constructor(e){this.property=e,this.value=new Wr(e,void 0)}transitioned(e,t){return new Ca(this.property,this.value,t,xe({},e.transition,this.transition),e.now)}untransitioned(){return new Ca(this.property,this.value,null,{},0)}};l(xu,"TransitionablePropertyValue");var Zn=xu,vu=class vu{constructor(e){this._properties=e,this._values=Object.create(e.defaultTransitionablePropertyValues)}getValue(e){return st(this._values[e].value.value)}setValue(e,t){Object.prototype.hasOwnProperty.call(this._values,e)||(this._values[e]=new Zn(this._values[e].property)),this._values[e].value=new Wr(this._values[e].property,t===null?void 0:st(t))}getTransition(e){return st(this._values[e].transition)}setTransition(e,t){Object.prototype.hasOwnProperty.call(this._values,e)||(this._values[e]=new Zn(this._values[e].property)),this._values[e].transition=st(t)||void 0}serialize(){let e={};for(let t of Object.keys(this._values)){let n=this.getValue(t);n!==void 0&&(e[t]=n);let i=this.getTransition(t);i!==void 0&&(e["".concat(t,"-transition")]=i)}return e}transitioned(e,t){let n=new ka(this._properties);for(let i of Object.keys(this._values))n._values[i]=this._values[i].transitioned(e,t._values[i]);return n}untransitioned(){let e=new ka(this._properties);for(let t of Object.keys(this._values))e._values[t]=this._values[t].untransitioned();return e}};l(vu,"Transitionable");var Ta=vu,Pu=class Pu{constructor(e,t,n,i,o){this.property=e,this.value=t,this.begin=o+i.delay||0,this.end=this.begin+i.duration||0,e.specification.transition&&(i.delay||i.duration)&&(this.prior=n)}possiblyEvaluate(e,t,n){let i=e.now||0,o=this.value.possiblyEvaluate(e,t,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(e,t,n);{let s=(i-this.begin)/(this.end-this.begin);return this.property.interpolate(a.possiblyEvaluate(e,t,n),o,oy(s))}}else return o}};l(Pu,"TransitioningPropertyValue");var Ca=Pu,Su=class Su{constructor(e){this._properties=e,this._values=Object.create(e.defaultTransitioningPropertyValues)}possiblyEvaluate(e,t,n){let i=new Vt(this._properties);for(let o of Object.keys(this._values))i._values[o]=this._values[o].possiblyEvaluate(e,t,n);return i}hasTransition(){for(let e of Object.keys(this._values))if(this._values[e].prior)return!0;return!1}};l(Su,"Transitioning");var ka=Su,wu=class wu{constructor(e){this._properties=e,this._values=Object.create(e.defaultPropertyValues)}hasValue(e){return this._values[e].value!==void 0}getValue(e){return st(this._values[e].value)}setValue(e,t){this._values[e]=new Wr(this._values[e].property,t===null?void 0:st(t))}serialize(){let e={};for(let t of Object.keys(this._values)){let n=this.getValue(t);n!==void 0&&(e[t]=n)}return e}possiblyEvaluate(e,t,n){let i=new Vt(this._properties);for(let o of Object.keys(this._values))i._values[o]=this._values[o].possiblyEvaluate(e,t,n);return i}};l(wu,"Layout");var Fa=wu,Au=class Au{constructor(e,t,n){this.property=e,this.value=t,this.parameters=n}isConstant(){return this.value.kind==="constant"}constantOr(e){return this.value.kind==="constant"?this.value.value:e}evaluate(e,t,n,i){return this.property.evaluate(this.value,this.parameters,e,t,n,i)}};l(Au,"PossiblyEvaluatedPropertyValue");var ve=Au,_u=class _u{constructor(e){this._properties=e,this._values=Object.create(e.defaultPossiblyEvaluatedValues)}get(e){return this._values[e]}};l(_u,"PossiblyEvaluated");var Vt=_u,Iu=class Iu{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,n){let i=this.specification.type,o=ft[i];return o?o(e,t,n):e}};l(Iu,"DataConstantProperty");var L=Iu,Tu=class Tu{constructor(e,t){this.specification=e,this.overrides=t}possiblyEvaluate(e,t,n,i){return e.expression.kind==="constant"||e.expression.kind==="camera"?new ve(this,{kind:"constant",value:e.expression.evaluate(t,null,{},n,i)},t):new ve(this,e.expression,t)}interpolate(e,t,n){if(e.value.kind!=="constant"||t.value.kind!=="constant")return e;if(e.value.value===void 0||t.value.value===void 0)return new ve(this,{kind:"constant",value:void 0},e.parameters);let i=this.specification.type,o=ft[i];if(o){let a=o(e.value.value,t.value.value,n);return new ve(this,{kind:"constant",value:a},e.parameters)}else return e}evaluate(e,t,n,i,o,a){return e.kind==="constant"?e.value:e.evaluate(t,n,i,o,a)}};l(Tu,"DataDrivenProperty");var B=Tu,Cu=class Cu extends B{possiblyEvaluate(e,t,n,i){if(e.value===void 0)return new ve(this,{kind:"constant",value:void 0},t);if(e.expression.kind==="constant"){let o=e.expression.evaluate(t,null,{},n,i),s=e.property.specification.type==="resolvedImage"&&typeof o!="string"?o.name:o,u=this._calculate(s,s,s,t);return new ve(this,{kind:"constant",value:u},t)}else if(e.expression.kind==="camera"){let o=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 ve(this,{kind:"constant",value:o},t)}else return new ve(this,e.expression,t)}evaluate(e,t,n,i,o,a){if(e.kind==="source"){let s=e.evaluate(t,n,i,o,a);return this._calculate(s,s,s,t)}else return e.kind==="composite"?this._calculate(e.evaluate({zoom:Math.floor(t.zoom)-1},n,i),e.evaluate({zoom:Math.floor(t.zoom)},n,i),e.evaluate({zoom:Math.floor(t.zoom)+1},n,i),t):e.value}_calculate(e,t,n,i){return i.zoom>i.zoomHistory.lastIntegerZoom?{from:e,to:t}:{from:n,to:t}}interpolate(e){return e}};l(Cu,"CrossFadedDataDrivenProperty");var ht=Cu,ku=class ku{constructor(e){this.specification=e}possiblyEvaluate(e,t,n,i){if(e.value!==void 0)if(e.expression.kind==="constant"){let o=e.expression.evaluate(t,null,{},n,i);return this._calculate(o,o,o,t)}else return this._calculate(e.expression.evaluate(new Z(Math.floor(t.zoom-1),t)),e.expression.evaluate(new Z(Math.floor(t.zoom),t)),e.expression.evaluate(new Z(Math.floor(t.zoom+1),t)),t)}_calculate(e,t,n,i){return i.zoom>i.zoomHistory.lastIntegerZoom?{from:e,to:t}:{from:n,to:t}}interpolate(e){return e}};l(ku,"CrossFadedProperty");var yr=ku,Fu=class Fu{constructor(e){this.specification=e}possiblyEvaluate(e,t,n,i){return!!e.expression.evaluate(t,null,{},n,i)}interpolate(){return!1}};l(Fu,"ColorRampProperty");var dt=Fu,Eu=class Eu{constructor(e){this.properties=e,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(let t in e){let n=e[t];n.specification.overridable&&this.overridableProperties.push(t);let i=this.defaultPropertyValues[t]=new Wr(n,void 0),o=this.defaultTransitionablePropertyValues[t]=new Zn(n);this.defaultTransitioningPropertyValues[t]=o.untransitioned(),this.defaultPossiblyEvaluatedValues[t]=i.possiblyEvaluate({})}}};l(Eu,"Properties");var ne=Eu;k("DataDrivenProperty",B);k("DataConstantProperty",L);k("CrossFadedDataDrivenProperty",ht);k("CrossFadedProperty",yr);k("ColorRampProperty",dt);var Ea="-transition",Mu=class Mu extends _a{constructor(e,t){if(super(),this.id=e.id,this.type=e.type,this._featureFilter={filter:l(()=>!0,"filter"),needGeometry:!1,getGlobalStateRefs:l(()=>new Set,"getGlobalStateRefs")},e.type!=="custom"&&(e=e,this.metadata=e.metadata,this.minzoom=e.minzoom,this.maxzoom=e.maxzoom,e.type!=="background"&&(this.source=e.source,this.sourceLayer=e["source-layer"],this.filter=e.filter,this._featureFilter=Dt(e.filter)),t.layout&&(this._unevaluatedLayout=new Fa(t.layout)),t.paint)){this._transitionablePaint=new Ta(t.paint);for(let n in e.paint)this.setPaintProperty(n,e.paint[n],{validate:!1});for(let n in e.layout)this.setLayoutProperty(n,e.layout[n],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new Vt(t.paint)}}setFilter(e){this.filter=e,this._featureFilter=Dt(e)}getCrossfadeParameters(){return this._crossfadeParameters}getLayoutProperty(e){return e==="visibility"?this.visibility:this._unevaluatedLayout.getValue(e)}getLayoutAffectingGlobalStateRefs(){let e=new Set;if(this._unevaluatedLayout)for(let t in this._unevaluatedLayout._values){let n=this._unevaluatedLayout._values[t];for(let i of n.getGlobalStateRefs())e.add(i)}for(let t of this._featureFilter.getGlobalStateRefs())e.add(t);return e}setLayoutProperty(e,t,n={}){if(t!=null){let i="layers.".concat(this.id,".layout.").concat(e);if(this._validate(km,i,e,t,n))return}if(e==="visibility"){this.visibility=t;return}this._unevaluatedLayout.setValue(e,t)}getPaintProperty(e){return e.endsWith(Ea)?this._transitionablePaint.getTransition(e.slice(0,-Ea.length)):this._transitionablePaint.getValue(e)}setPaintProperty(e,t,n={}){if(t!=null){let i="layers.".concat(this.id,".paint.").concat(e);if(this._validate(Cm,i,e,t,n))return!1}if(e.endsWith(Ea))return this._transitionablePaint.setTransition(e.slice(0,-Ea.length),t||void 0),!1;{let i=this._transitionablePaint._values[e],o=i.property.specification["property-type"]==="cross-faded-data-driven",a=i.value.isDataDriven(),s=i.value;this._transitionablePaint.setValue(e,t),this._handleSpecialPaintPropertyUpdate(e);let u=this._transitionablePaint._values[e].value;return u.isDataDriven()||a||o||this._handleOverridablePaintPropertyUpdate(e,s,u)}}_handleSpecialPaintPropertyUpdate(e){}_handleOverridablePaintPropertyUpdate(e,t,n){return!1}isHidden(e){return this.minzoom&&e<this.minzoom||this.maxzoom&&e>=this.maxzoom?!0:this.visibility==="none"}updateTransitions(e){this._transitioningPaint=this._transitionablePaint.transitioned(e,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculate(e,t){e.getCrossfadeParameters&&(this._crossfadeParameters=e.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(e,void 0,t)),this.paint=this._transitioningPaint.possiblyEvaluate(e,void 0,t)}serialize(){let e={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&&(e.layout=e.layout||{},e.layout.visibility=this.visibility),ly(e,(t,n)=>t!==void 0&&!(n==="layout"&&!Object.keys(t).length)&&!(n==="paint"&&!Object.keys(t).length))}_validate(e,t,n,i,o={}){return o&&o.validate===!1?!1:Fm(this,e.call(mt,{key:t,layerType:this.type,objectKey:n,value:i,styleSpec:A,style:{glyphs:!0,sprite:!0}}))}is3D(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(let e in this.paint._values){let t=this.paint.get(e);if(!(!(t instanceof ve)||!Mt(t.property.specification))&&(t.value.kind==="source"||t.value.kind==="composite")&&t.value.isStateDependent)return!0}return!1}};l(Mu,"StyleLayer");var le=Mu;g();g();g();var tv={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array},Lu=class Lu{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}};l(Lu,"Struct");var Bt=Lu,rv=128,nv=5,Du=class Du{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*nv),rv),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")}};l(Du,"StructArray");var ie=Du;function re(r,e=1){let t=0,n=0,i=r.map(a=>{let s=iv(a.type),u=t=zm(t,Math.max(e,s)),c=a.components||1;return n=Math.max(n,s),t+=s*c,{name:a.name,type:a.type,components:c,offset:u}}),o=zm(t,Math.max(n,e));return{members:i,size:o,alignment:e}}l(re,"createLayout");function iv(r){return tv[r].BYTES_PER_ELEMENT}l(iv,"sizeOf");function zm(r,e){return Math.ceil(r/e)*e}l(zm,"align");var Om=ee(de(),1);var Vu=class Vu extends ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t){let n=this.length;return this.resize(n+1),this.emplace(n,e,t)}emplace(e,t,n){let i=e*2;return this.int16[i+0]=t,this.int16[i+1]=n,e}};l(Vu,"StructArrayLayout2i4");var mr=Vu;mr.prototype.bytesPerElement=4;k("StructArrayLayout2i4",mr);var Bu=class Bu extends ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,n){let i=this.length;return this.resize(i+1),this.emplace(i,e,t,n)}emplace(e,t,n,i){let o=e*3;return this.int16[o+0]=t,this.int16[o+1]=n,this.int16[o+2]=i,e}};l(Bu,"StructArrayLayout3i6");var Jn=Bu;Jn.prototype.bytesPerElement=6;k("StructArrayLayout3i6",Jn);var Ru=class Ru extends ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,n,i){let o=this.length;return this.resize(o+1),this.emplace(o,e,t,n,i)}emplace(e,t,n,i,o){let a=e*4;return this.int16[a+0]=t,this.int16[a+1]=n,this.int16[a+2]=i,this.int16[a+3]=o,e}};l(Ru,"StructArrayLayout4i8");var Ma=Ru;Ma.prototype.bytesPerElement=8;k("StructArrayLayout4i8",Ma);var zu=class zu extends ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,n,i,o,a){let s=this.length;return this.resize(s+1),this.emplace(s,e,t,n,i,o,a)}emplace(e,t,n,i,o,a,s){let u=e*6;return this.int16[u+0]=t,this.int16[u+1]=n,this.int16[u+2]=i,this.int16[u+3]=o,this.int16[u+4]=a,this.int16[u+5]=s,e}};l(zu,"StructArrayLayout2i4i12");var Yn=zu;Yn.prototype.bytesPerElement=12;k("StructArrayLayout2i4i12",Yn);var Ou=class Ou extends ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,n,i,o,a){let s=this.length;return this.resize(s+1),this.emplace(s,e,t,n,i,o,a)}emplace(e,t,n,i,o,a,s){let u=e*4,c=e*8;return this.int16[u+0]=t,this.int16[u+1]=n,this.uint8[c+4]=i,this.uint8[c+5]=o,this.uint8[c+6]=a,this.uint8[c+7]=s,e}};l(Ou,"StructArrayLayout2i4ub8");var Kn=Ou;Kn.prototype.bytesPerElement=8;k("StructArrayLayout2i4ub8",Kn);var Gu=class Gu extends ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t){let n=this.length;return this.resize(n+1),this.emplace(n,e,t)}emplace(e,t,n){let i=e*2;return this.float32[i+0]=t,this.float32[i+1]=n,e}};l(Gu,"StructArrayLayout2f8");var Rt=Gu;Rt.prototype.bytesPerElement=8;k("StructArrayLayout2f8",Rt);var Nu=class Nu extends ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t,n,i,o,a,s,u,c,p){let f=this.length;return this.resize(f+1),this.emplace(f,e,t,n,i,o,a,s,u,c,p)}emplace(e,t,n,i,o,a,s,u,c,p,f){let y=e*10;return this.uint16[y+0]=t,this.uint16[y+1]=n,this.uint16[y+2]=i,this.uint16[y+3]=o,this.uint16[y+4]=a,this.uint16[y+5]=s,this.uint16[y+6]=u,this.uint16[y+7]=c,this.uint16[y+8]=p,this.uint16[y+9]=f,e}};l(Nu,"StructArrayLayout10ui20");var Qn=Nu;Qn.prototype.bytesPerElement=20;k("StructArrayLayout10ui20",Qn);var Uu=class Uu extends ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t,n,i,o,a,s,u,c,p,f,y){let m=this.length;return this.resize(m+1),this.emplace(m,e,t,n,i,o,a,s,u,c,p,f,y)}emplace(e,t,n,i,o,a,s,u,c,p,f,y,m){let h=e*12;return this.int16[h+0]=t,this.int16[h+1]=n,this.int16[h+2]=i,this.int16[h+3]=o,this.uint16[h+4]=a,this.uint16[h+5]=s,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,e}};l(Uu,"StructArrayLayout4i4ui4i24");var ei=Uu;ei.prototype.bytesPerElement=24;k("StructArrayLayout4i4ui4i24",ei);var $u=class $u extends ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,n){let i=this.length;return this.resize(i+1),this.emplace(i,e,t,n)}emplace(e,t,n,i){let o=e*3;return this.float32[o+0]=t,this.float32[o+1]=n,this.float32[o+2]=i,e}};l($u,"StructArrayLayout3f12");var ti=$u;ti.prototype.bytesPerElement=12;k("StructArrayLayout3f12",ti);var ju=class ju extends ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(e){let t=this.length;return this.resize(t+1),this.emplace(t,e)}emplace(e,t){let n=e*1;return this.uint32[n+0]=t,e}};l(ju,"StructArrayLayout1ul4");var ri=ju;ri.prototype.bytesPerElement=4;k("StructArrayLayout1ul4",ri);var qu=class qu extends ie{_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(e,t,n,i,o,a,s,u,c){let p=this.length;return this.resize(p+1),this.emplace(p,e,t,n,i,o,a,s,u,c)}emplace(e,t,n,i,o,a,s,u,c,p){let f=e*10,y=e*5;return this.int16[f+0]=t,this.int16[f+1]=n,this.int16[f+2]=i,this.int16[f+3]=o,this.int16[f+4]=a,this.int16[f+5]=s,this.uint32[y+3]=u,this.uint16[f+8]=c,this.uint16[f+9]=p,e}};l(qu,"StructArrayLayout6i1ul2ui20");var ni=qu;ni.prototype.bytesPerElement=20;k("StructArrayLayout6i1ul2ui20",ni);var Wu=class Wu extends ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,n,i,o,a){let s=this.length;return this.resize(s+1),this.emplace(s,e,t,n,i,o,a)}emplace(e,t,n,i,o,a,s){let u=e*6;return this.int16[u+0]=t,this.int16[u+1]=n,this.int16[u+2]=i,this.int16[u+3]=o,this.int16[u+4]=a,this.int16[u+5]=s,e}};l(Wu,"StructArrayLayout2i2i2i12");var ii=Wu;ii.prototype.bytesPerElement=12;k("StructArrayLayout2i2i2i12",ii);var Xu=class Xu extends ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,n,i,o){let a=this.length;return this.resize(a+1),this.emplace(a,e,t,n,i,o)}emplace(e,t,n,i,o,a){let s=e*4,u=e*8;return this.float32[s+0]=t,this.float32[s+1]=n,this.float32[s+2]=i,this.int16[u+6]=o,this.int16[u+7]=a,e}};l(Xu,"StructArrayLayout2f1f2i16");var La=Xu;La.prototype.bytesPerElement=16;k("StructArrayLayout2f1f2i16",La);var Hu=class Hu extends ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,n,i,o,a){let s=this.length;return this.resize(s+1),this.emplace(s,e,t,n,i,o,a)}emplace(e,t,n,i,o,a,s){let u=e*16,c=e*4,p=e*8;return this.uint8[u+0]=t,this.uint8[u+1]=n,this.float32[c+1]=i,this.float32[c+2]=o,this.int16[p+6]=a,this.int16[p+7]=s,e}};l(Hu,"StructArrayLayout2ub2f2i16");var oi=Hu;oi.prototype.bytesPerElement=16;k("StructArrayLayout2ub2f2i16",oi);var Zu=class Zu extends ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t,n){let i=this.length;return this.resize(i+1),this.emplace(i,e,t,n)}emplace(e,t,n,i){let o=e*3;return this.uint16[o+0]=t,this.uint16[o+1]=n,this.uint16[o+2]=i,e}};l(Zu,"StructArrayLayout3ui6");var ai=Zu;ai.prototype.bytesPerElement=6;k("StructArrayLayout3ui6",ai);var Ju=class Ju extends ie{_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(e,t,n,i,o,a,s,u,c,p,f,y,m,h,d,x,b){let P=this.length;return this.resize(P+1),this.emplace(P,e,t,n,i,o,a,s,u,c,p,f,y,m,h,d,x,b)}emplace(e,t,n,i,o,a,s,u,c,p,f,y,m,h,d,x,b,P){let v=e*24,S=e*12,_=e*48;return this.int16[v+0]=t,this.int16[v+1]=n,this.uint16[v+2]=i,this.uint16[v+3]=o,this.uint32[S+2]=a,this.uint32[S+3]=s,this.uint32[S+4]=u,this.uint16[v+10]=c,this.uint16[v+11]=p,this.uint16[v+12]=f,this.float32[S+7]=y,this.float32[S+8]=m,this.uint8[_+36]=h,this.uint8[_+37]=d,this.uint8[_+38]=x,this.uint32[S+10]=b,this.int16[v+22]=P,e}};l(Ju,"StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48");var si=Ju;si.prototype.bytesPerElement=48;k("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",si);var Yu=class Yu extends ie{_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(e,t,n,i,o,a,s,u,c,p,f,y,m,h,d,x,b,P,v,S,_,T,I,F,D,R,z,N){let V=this.length;return this.resize(V+1),this.emplace(V,e,t,n,i,o,a,s,u,c,p,f,y,m,h,d,x,b,P,v,S,_,T,I,F,D,R,z,N)}emplace(e,t,n,i,o,a,s,u,c,p,f,y,m,h,d,x,b,P,v,S,_,T,I,F,D,R,z,N,V){let C=e*32,O=e*16;return this.int16[C+0]=t,this.int16[C+1]=n,this.int16[C+2]=i,this.int16[C+3]=o,this.int16[C+4]=a,this.int16[C+5]=s,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]=x,this.uint16[C+15]=b,this.uint16[C+16]=P,this.uint16[C+17]=v,this.uint16[C+18]=S,this.uint16[C+19]=_,this.uint16[C+20]=T,this.uint16[C+21]=I,this.uint16[C+22]=F,this.uint32[O+12]=D,this.float32[O+13]=R,this.float32[O+14]=z,this.uint16[C+30]=N,this.uint16[C+31]=V,e}};l(Yu,"StructArrayLayout8i15ui1ul2f2ui64");var li=Yu;li.prototype.bytesPerElement=64;k("StructArrayLayout8i15ui1ul2f2ui64",li);var Ku=class Ku extends ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e){let t=this.length;return this.resize(t+1),this.emplace(t,e)}emplace(e,t){let n=e*1;return this.float32[n+0]=t,e}};l(Ku,"StructArrayLayout1f4");var hr=Ku;hr.prototype.bytesPerElement=4;k("StructArrayLayout1f4",hr);var Qu=class Qu extends ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,n){let i=this.length;return this.resize(i+1),this.emplace(i,e,t,n)}emplace(e,t,n,i){let o=e*6,a=e*3;return this.uint16[o+0]=t,this.float32[a+1]=n,this.float32[a+2]=i,e}};l(Qu,"StructArrayLayout1ui2f12");var ui=Qu;ui.prototype.bytesPerElement=12;k("StructArrayLayout1ui2f12",ui);var ec=class ec extends ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t,n){let i=this.length;return this.resize(i+1),this.emplace(i,e,t,n)}emplace(e,t,n,i){let o=e*2,a=e*4;return this.uint32[o+0]=t,this.uint16[a+2]=n,this.uint16[a+3]=i,e}};l(ec,"StructArrayLayout1ul2ui8");var ci=ec;ci.prototype.bytesPerElement=8;k("StructArrayLayout1ul2ui8",ci);var tc=class tc extends ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t){let n=this.length;return this.resize(n+1),this.emplace(n,e,t)}emplace(e,t,n){let i=e*2;return this.uint16[i+0]=t,this.uint16[i+1]=n,e}};l(tc,"StructArrayLayout2ui4");var pi=tc;pi.prototype.bytesPerElement=4;k("StructArrayLayout2ui4",pi);var rc=class rc extends ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e){let t=this.length;return this.resize(t+1),this.emplace(t,e)}emplace(e,t){let n=e*1;return this.uint16[n+0]=t,e}};l(rc,"StructArrayLayout1ui2");var Da=rc;Da.prototype.bytesPerElement=2;k("StructArrayLayout1ui2",Da);var nc=class nc extends ie{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,n,i){let o=this.length;return this.resize(o+1),this.emplace(o,e,t,n,i)}emplace(e,t,n,i,o){let a=e*4;return this.float32[a+0]=t,this.float32[a+1]=n,this.float32[a+2]=i,this.float32[a+3]=o,e}};l(nc,"StructArrayLayout4f16");var Xr=nc;Xr.prototype.bytesPerElement=16;k("StructArrayLayout4f16",Xr);var ic=class ic extends Bt{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 Om.default(this.anchorPointX,this.anchorPointY)}};l(ic,"CollisionBoxStruct");var Va=ic;Va.prototype.size=20;var oc=class oc extends ni{get(e){return new Va(this,e)}};l(oc,"CollisionBoxArray");var fi=oc;k("CollisionBoxArray",fi);var ac=class ac extends Bt{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(e){this._structArray.uint8[this._pos1+37]=e}get hidden(){return this._structArray.uint8[this._pos1+38]}set hidden(e){this._structArray.uint8[this._pos1+38]=e}get crossTileID(){return this._structArray.uint32[this._pos4+10]}set crossTileID(e){this._structArray.uint32[this._pos4+10]=e}get associatedIconIndex(){return this._structArray.int16[this._pos2+22]}};l(ac,"PlacedSymbolStruct");var Ba=ac;Ba.prototype.size=48;var sc=class sc extends si{get(e){return new Ba(this,e)}};l(sc,"PlacedSymbolArray");var yi=sc;k("PlacedSymbolArray",yi);var lc=class lc extends Bt{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(e){this._structArray.uint32[this._pos4+12]=e}get textBoxScale(){return this._structArray.float32[this._pos4+13]}get collisionCircleDiameter(){return this._structArray.float32[this._pos4+14]}get textAnchorOffsetStartIndex(){return this._structArray.uint16[this._pos2+30]}get textAnchorOffsetEndIndex(){return this._structArray.uint16[this._pos2+31]}};l(lc,"SymbolInstanceStruct");var Ra=lc;Ra.prototype.size=64;var uc=class uc extends li{get(e){return new Ra(this,e)}};l(uc,"SymbolInstanceArray");var mi=uc;k("SymbolInstanceArray",mi);var cc=class cc extends hr{getoffsetX(e){return this.float32[e*1+0]}};l(cc,"GlyphOffsetArray");var hi=cc;k("GlyphOffsetArray",hi);var pc=class pc extends Jn{getx(e){return this.int16[e*3+0]}gety(e){return this.int16[e*3+1]}gettileUnitDistanceFromAnchor(e){return this.int16[e*3+2]}};l(pc,"SymbolLineVertexArray");var di=pc;k("SymbolLineVertexArray",di);var fc=class fc extends Bt{get textAnchor(){return this._structArray.uint16[this._pos2+0]}get textOffset0(){return this._structArray.float32[this._pos4+1]}get textOffset1(){return this._structArray.float32[this._pos4+2]}};l(fc,"TextAnchorOffsetStruct");var za=fc;za.prototype.size=12;var yc=class yc extends ui{get(e){return new za(this,e)}};l(yc,"TextAnchorOffsetArray");var gi=yc;k("TextAnchorOffsetArray",gi);var mc=class mc extends Bt{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]}};l(mc,"FeatureIndexStruct");var Oa=mc;Oa.prototype.size=8;var hc=class hc extends ci{get(e){return new Oa(this,e)}};l(hc,"FeatureIndexArray");var bi=hc;k("FeatureIndexArray",bi);var dc=class dc extends mr{};l(dc,"PosArray");var Ga=dc;var gc=class gc extends mr{};l(gc,"CircleLayoutArray");var Na=gc,bc=class bc extends mr{};l(bc,"FillLayoutArray");var Ua=bc,xc=class xc extends Yn{};l(xc,"FillExtrusionLayoutArray");var $a=xc;var vc=class vc extends Kn{};l(vc,"LineLayoutArray");var ja=vc,Pc=class Pc extends Rt{};l(Pc,"LineExtLayoutArray");var qa=Pc,Sc=class Sc extends Qn{};l(Sc,"PatternLayoutArray");var gt=Sc,wc=class wc extends ei{};l(wc,"SymbolLayoutArray");var Wa=wc,Ac=class Ac extends ti{};l(Ac,"SymbolDynamicLayoutArray");var Xa=Ac,_c=class _c extends ri{};l(_c,"SymbolOpacityArray");var Ha=_c,Ic=class Ic extends ii{};l(Ic,"CollisionBoxLayoutArray");var xi=Ic;var Tc=class Tc extends oi{};l(Tc,"CollisionVertexArray");var Za=Tc;var Cc=class Cc extends ai{};l(Cc,"TriangleIndexArray");var Be=Cc,kc=class kc extends pi{};l(kc,"LineIndexArray");var zt=kc;g();var ov=re([{name:"a_pos",components:2,type:"Int16"}],4);var{members:Gm,size:xA,alignment:vA}=ov;g();var Ot=class Ot{constructor(e=[]){this._forceNewSegmentOnNextPrepare=!1;this.segments=e}prepareSegment(e,t,n,i){let o=this.segments[this.segments.length-1];return e>Ot.MAX_VERTEX_ARRAY_LENGTH&&ye("Max vertices per segment is ".concat(Ot.MAX_VERTEX_ARRAY_LENGTH,": bucket requested ").concat(e,". Consider using the `fillLargeMeshArrays` function if you require meshes with more than ").concat(Ot.MAX_VERTEX_ARRAY_LENGTH," vertices.")),this._forceNewSegmentOnNextPrepare||!o||o.vertexLength+e>Ot.MAX_VERTEX_ARRAY_LENGTH||o.sortKey!==i?this.createNewSegment(t,n,i):o}createNewSegment(e,t,n){let i={vertexOffset:e.length,primitiveOffset:t.length,vertexLength:0,primitiveLength:0,vaos:{}};return n!==void 0&&(i.sortKey=n),this._forceNewSegmentOnNextPrepare=!1,this.segments.push(i),i}getOrCreateLatestSegment(e,t,n){return this.prepareSegment(0,e,t,n)}forceNewSegmentOnNextPrepare(){this._forceNewSegmentOnNextPrepare=!0}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,n,i){return new Ot([{vertexOffset:e,primitiveOffset:t,vertexLength:n,primitiveLength:i,vaos:{},sortKey:0}])}};l(Ot,"SegmentVector");var me=Ot;me.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1;k("SegmentVector",me);g();g();function Fc(r,e){return r=lt(Math.floor(r),0,255),e=lt(Math.floor(e),0,255),256*r+e}l(Fc,"packUint8ToFloat");g();var vi=re([{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"}]);g();var qm=ee(Lc(),1);var Ka=class Ka{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(e,t,n,i){this.ids.push(jm(e)),this.positions.push(t,n,i)}getPositions(e){if(!this.indexed)throw new Error("Trying to get index, but feature positions are not indexed");let t=jm(e),n=0,i=this.ids.length-1;for(;n<i;){let a=n+i>>1;this.ids[a]>=t?i=a:n=a+1}let o=[];for(;this.ids[n]===t;){let a=this.positions[3*n],s=this.positions[3*n+1],u=this.positions[3*n+2];o.push({index:a,start:s,end:u}),n++}return o}static serialize(e,t){let n=new Float64Array(e.ids),i=new Uint32Array(e.positions);return Dc(n,i,0,n.length-1),t&&t.push(n.buffer,i.buffer),{ids:n,positions:i}}static deserialize(e){let t=new Ka;return t.ids=e.ids,t.positions=e.positions,t.indexed=!0,t}};l(Ka,"FeaturePositionMap");var Pi=Ka;function jm(r){let e=+r;return!isNaN(e)&&e<=Number.MAX_SAFE_INTEGER?e:(0,qm.default)(String(r))}l(jm,"getNumericId");function Dc(r,e,t,n){for(;t<n;){let i=r[t+n>>1],o=t-1,a=n+1;for(;;){do o++;while(r[o]<i);do a--;while(r[a]>i);if(o>=a)break;Ya(r,o,a),Ya(e,3*o,3*a),Ya(e,3*o+1,3*a+1),Ya(e,3*o+2,3*a+2)}a-t<n-a?(Dc(r,e,t,a),t=a+1):(Dc(r,e,a+1,n),n=a)}}l(Dc,"sort");function Ya(r,e,t){let n=r[e];r[e]=r[t],r[t]=n}l(Ya,"swap");k("FeaturePositionMap",Pi);g();var Vc=class Vc{constructor(e,t){this.gl=e.gl,this.location=t}};l(Vc,"Uniform");var Si=Vc;var Bc=class Bc extends Si{constructor(e,t){super(e,t),this.current=0}set(e){this.current!==e&&(this.current=e,this.gl.uniform1f(this.location,e))}};l(Bc,"Uniform1f");var Hr=Bc;var Rc=class Rc extends Si{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]))}};l(Rc,"Uniform4f");var Qa=Rc,zc=class zc extends Si{constructor(e,t){super(e,t),this.current=Y.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))}};l(zc,"UniformColor");var es=zc;var HA=new Float32Array(16);function Oc(r){return[Fc(255*r.r,255*r.g),Fc(255*r.b,255*r.a)]}l(Oc,"packColor");var Gc=class Gc{constructor(e,t,n){this.value=e,this.uniformNames=t.map(i=>"u_".concat(i)),this.type=n}setUniform(e,t,n){e.set(n.constantOr(this.value))}getBinding(e,t,n){return this.type==="color"?new es(e,t):new Hr(e,t)}};l(Gc,"ConstantBinder");var dr=Gc,Nc=class Nc{constructor(e,t){this.uniformNames=t.map(n=>"u_".concat(n)),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,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&&e.set(o)}getBinding(e,t,n){return n.substr(0,9)==="u_pattern"?new Qa(e,t):new Hr(e,t)}};l(Nc,"CrossFadedConstantBinder");var Gt=Nc,Uc=class Uc{constructor(e,t,n,i){this.expression=e,this.type=n,this.maxValue=0,this.paintVertexAttributes=t.map(o=>({name:"a_".concat(o),type:"Float32",components:n==="color"?2:1,offset:0})),this.paintVertexArray=new i}populatePaintArray(e,t,n,i,o){let a=this.paintVertexArray.length,s=this.expression.evaluate(new Z(0),t,{},i,[],o);this.paintVertexArray.resize(e),this._setPaintValue(a,e,s)}updatePaintArray(e,t,n,i){let o=this.expression.evaluate({zoom:0},n,i);this._setPaintValue(e,t,o)}_setPaintValue(e,t,n){if(this.type==="color"){let i=Oc(n);for(let o=e;o<t;o++)this.paintVertexArray.emplace(o,i[0],i[1])}else{for(let i=e;i<t;i++)this.paintVertexArray.emplace(i,n);this.maxValue=Math.max(this.maxValue,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()}};l(Uc,"SourceExpressionBinder");var Je=Uc,$c=class $c{constructor(e,t,n,i,o,a){this.expression=e,this.uniformNames=t.map(s=>"u_".concat(s,"_t")),this.type=n,this.useIntegerZoom=i,this.zoom=o,this.maxValue=0,this.paintVertexAttributes=t.map(s=>({name:"a_".concat(s),type:"Float32",components:n==="color"?4:2,offset:0})),this.paintVertexArray=new a}populatePaintArray(e,t,n,i,o){let a=this.expression.evaluate(new Z(this.zoom),t,{},i,[],o),s=this.expression.evaluate(new Z(this.zoom+1),t,{},i,[],o),u=this.paintVertexArray.length;this.paintVertexArray.resize(e),this._setPaintValue(u,e,a,s)}updatePaintArray(e,t,n,i){let o=this.expression.evaluate({zoom:this.zoom},n,i),a=this.expression.evaluate({zoom:this.zoom+1},n,i);this._setPaintValue(e,t,o,a)}_setPaintValue(e,t,n,i){if(this.type==="color"){let o=Oc(n),a=Oc(i);for(let s=e;s<t;s++)this.paintVertexArray.emplace(s,o[0],o[1],a[0],a[1])}else{for(let o=e;o<t;o++)this.paintVertexArray.emplace(o,n,i);this.maxValue=Math.max(this.maxValue,Math.abs(n),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()}setUniform(e,t){let n=this.useIntegerZoom?Math.floor(t.zoom):t.zoom,i=lt(this.expression.interpolationFactor(n,this.zoom,this.zoom+1),0,1);e.set(i)}getBinding(e,t,n){return new Hr(e,t)}};l($c,"CompositeExpressionBinder");var Re=$c,jc=class jc{constructor(e,t,n,i,o,a){this.expression=e,this.type=t,this.useIntegerZoom=n,this.zoom=i,this.layerId=a,this.zoomInPaintVertexArray=new o,this.zoomOutPaintVertexArray=new o}populatePaintArray(e,t,n){let i=this.zoomInPaintVertexArray.length;this.zoomInPaintVertexArray.resize(e),this.zoomOutPaintVertexArray.resize(e),this._setPaintValues(i,e,t.patterns&&t.patterns[this.layerId],n)}updatePaintArray(e,t,n,i,o){this._setPaintValues(e,t,n.patterns&&n.patterns[this.layerId],o)}_setPaintValues(e,t,n,i){if(!i||!n)return;let{min:o,mid:a,max:s}=n,u=i[o],c=i[a],p=i[s];if(!(!u||!c||!p))for(let f=e;f<t;f++)this.zoomInPaintVertexArray.emplace(f,c.tl[0],c.tl[1],c.br[0],c.br[1],u.tl[0],u.tl[1],u.br[0],u.br[1],c.pixelRatio,u.pixelRatio),this.zoomOutPaintVertexArray.emplace(f,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,vi.members,this.expression.isStateDependent),this.zoomOutPaintVertexBuffer=e.createVertexBuffer(this.zoomOutPaintVertexArray,vi.members,this.expression.isStateDependent))}destroy(){this.zoomOutPaintVertexBuffer&&this.zoomOutPaintVertexBuffer.destroy(),this.zoomInPaintVertexBuffer&&this.zoomInPaintVertexBuffer.destroy()}};l(jc,"CrossFadedCompositeBinder");var tt=jc,qc=class qc{constructor(e,t,n){this.binders={},this._buffers=[];let i=[];for(let o in e.paint._values){if(!n(o))continue;let a=e.paint.get(o);if(!(a instanceof ve)||!Mt(a.property.specification))continue;let s=uv(o,e.type),u=a.value,c=a.property.specification.type,p=a.property.useIntegerZoom,f=a.property.specification["property-type"],y=f==="cross-faded"||f==="cross-faded-data-driven";if(u.kind==="constant")this.binders[o]=y?new Gt(u.value,s):new dr(u.value,s,c),i.push("/u_".concat(o));else if(u.kind==="source"||y){let m=Wm(o,c,"source");this.binders[o]=y?new tt(u,c,p,t,m,e.id):new Je(u,s,c,m),i.push("/a_".concat(o))}else{let m=Wm(o,c,"composite");this.binders[o]=new Re(u,s,c,p,t,m),i.push("/z_".concat(o))}}this.cacheKey=i.sort().join("")}getMaxValue(e){let t=this.binders[e];return t instanceof Je||t instanceof Re?t.maxValue:0}populatePaintArrays(e,t,n,i,o){for(let a in this.binders){let s=this.binders[a];(s instanceof Je||s instanceof Re||s instanceof tt)&&s.populatePaintArray(e,t,n,i,o)}}setConstantPatternPositions(e,t){for(let n in this.binders){let i=this.binders[n];i instanceof Gt&&i.setConstantPatternPositions(e,t)}}updatePaintArrays(e,t,n,i,o){let a=!1;for(let s in e){let u=t.getPositions(s);for(let c of u){let p=n.feature(c.index);for(let f in this.binders){let y=this.binders[f];if((y instanceof Je||y instanceof Re||y instanceof tt)&&y.expression.isStateDependent===!0){let m=i.paint.get(f);y.expression=m.value,y.updatePaintArray(c.start,c.end,p,e[s],o),a=!0}}}}return a}defines(){let e=[];for(let t in this.binders){let n=this.binders[t];(n instanceof dr||n instanceof Gt)&&e.push(...n.uniformNames.map(i=>"#define HAS_UNIFORM_".concat(i)))}return e}getBinderAttributes(){let e=[];for(let t in this.binders){let n=this.binders[t];if(n instanceof Je||n instanceof Re)for(let i=0;i<n.paintVertexAttributes.length;i++)e.push(n.paintVertexAttributes[i].name);else if(n instanceof tt)for(let i=0;i<vi.members.length;i++)e.push(vi.members[i].name)}return e}getBinderUniforms(){let e=[];for(let t in this.binders){let n=this.binders[t];if(n instanceof dr||n instanceof Gt||n instanceof Re)for(let i of n.uniformNames)e.push(i)}return e}getPaintVertexBuffers(){return this._buffers}getUniforms(e,t){let n=[];for(let i in this.binders){let o=this.binders[i];if(o instanceof dr||o instanceof Gt||o instanceof Re){for(let a of o.uniformNames)if(t[a]){let s=o.getBinding(e,t[a],a);n.push({name:a,property:i,binding:s})}}}return n}setUniforms(e,t,n,i){for(let{name:o,property:a,binding:s}of t)this.binders[a].setUniform(s,i,n.get(a),o)}updatePaintBuffers(e){this._buffers=[];for(let t in this.binders){let n=this.binders[t];if(e&&n instanceof tt){let i=e.fromScale===2?n.zoomInPaintVertexBuffer:n.zoomOutPaintVertexBuffer;i&&this._buffers.push(i)}else(n instanceof Je||n instanceof Re)&&n.paintVertexBuffer&&this._buffers.push(n.paintVertexBuffer)}}upload(e){for(let t in this.binders){let n=this.binders[t];(n instanceof Je||n instanceof Re||n instanceof tt)&&n.upload(e)}this.updatePaintBuffers()}destroy(){for(let e in this.binders){let t=this.binders[e];(t instanceof Je||t instanceof Re||t instanceof tt)&&t.destroy()}}};l(qc,"ProgramConfiguration");var ts=qc,Wc=class Wc{constructor(e,t,n=()=>!0){this.programConfigurations={};for(let i of e)this.programConfigurations[i.id]=new ts(i,t,n);this.needsUpload=!1,this._featureMap=new Pi,this._bufferOffset=0}populatePaintArrays(e,t,n,i,o,a){for(let s in this.programConfigurations)this.programConfigurations[s].populatePaintArrays(e,t,i,o,a);t.id!==void 0&&this._featureMap.add(t.id,n,this._bufferOffset,e),this._bufferOffset=e,this.needsUpload=!0}updatePaintArrays(e,t,n,i){for(let o of n)this.needsUpload=this.programConfigurations[o.id].updatePaintArrays(e,this._featureMap,t,o,i)||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()}};l(Wc,"ProgramConfigurationSet");var Te=Wc;function uv(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,"_")]}l(uv,"paintAttributeNames");function cv(r){return{"line-pattern":{source:gt,composite:gt},"fill-pattern":{source:gt,composite:gt},"fill-extrusion-pattern":{source:gt,composite:gt}}[r]}l(cv,"getLayoutException");function Wm(r,e,t){let n={color:{source:Rt,composite:Xr},number:{source:hr,composite:Rt}},i=cv(r);return i&&i[t]||n[e][t]}l(Wm,"layoutType");k("ConstantBinder",dr);k("CrossFadedConstantBinder",Gt);k("SourceExpressionBinder",Je);k("CrossFadedCompositeBinder",tt);k("CompositeExpressionBinder",Re);k("ProgramConfiguration",ts,{omit:["_buffers"]});k("ProgramConfigurationSet",Te);g();g();var pv=15,Xc=Math.pow(2,pv-1)-1,Xm=-Xc-1;function Ce(r){let e=8192/r.extent,t=r.loadGeometry();for(let n=0;n<t.length;n++){let i=t[n];for(let o=0;o<i.length;o++){let a=i[o],s=Math.round(a.x*e),u=Math.round(a.y*e);a.x=lt(s,Xm,Xc),a.y=lt(u,Xm,Xc),(s<a.x||s>a.x+1||u<a.y||u>a.y+1)&&ye("Geometry exceeds allowed extent, reduce your vector tile buffer size")}}return t}l(Ce,"loadGeometry");g();function qe(r,e){return{type:r.type,id:r.id,properties:r.properties,geometry:e?Ce(r):[]}}l(qe,"toEvaluationFeature");var Hm=-32768;function fv(r,e,t,n,i){r.emplaceBack(Hm+e*8+n,Hm+t*8+i)}l(fv,"addCircleVertex");var Hc=class Hc{constructor(e){this.zoom=e.zoom,this.globalState=e.globalState,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 Na,this.indexArray=new Be,this.segments=new me,this.programConfigurations=new Te(e.layers,e.zoom),this.stateDependentLayerIds=this.layers.filter(t=>t.isStateDependent()).map(t=>t.id)}populate(e,t,n){let i=this.layers[0],o=[],a=null,s=!1,u=i.type==="heatmap";if(i.type==="circle"){let p=i;a=p.layout.get("circle-sort-key"),s=!a.isConstant(),u=u||p.paint.get("circle-pitch-alignment")==="map"}let c=u?t.subdivisionGranularity.circle:1;for(let{feature:p,id:f,index:y,sourceLayerIndex:m}of e){let h=this.layers[0]._featureFilter.needGeometry,d=qe(p,h);if(!this.layers[0]._featureFilter.filter(new Z(this.zoom,{globalState:this.globalState}),d,n))continue;let x=s?a.evaluate(d,{},n):void 0,b={id:f,properties:p.properties,type:p.type,sourceLayerIndex:m,index:y,geometry:h?d.geometry:Ce(p),patterns:{},sortKey:x};o.push(b)}s&&o.sort((p,f)=>p.sortKey-f.sortKey);for(let p of o){let{geometry:f,index:y,sourceLayerIndex:m}=p,h=e[y].feature;this.addFeature(p,f,y,n,c),t.featureIndex.insert(h,f,y,m,this.index)}}update(e,t,n){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,t,this.stateDependentLayers,n)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Gm),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,n,i,o=1){let a;switch(o){case 1:a=[0,7];break;case 3:a=[0,2,5,7];break;case 5:a=[0,1,3,4,6,7];break;case 7:a=[0,1,2,3,4,5,6,7];break;default:throw new Error("Invalid circle bucket granularity: ".concat(o,"; valid values are 1, 3, 5, 7."))}let s=a.length;for(let u of t)for(let c of u){let p=c.x,f=c.y;if(p<0||p>=8192||f<0||f>=8192)continue;let y=this.segments.prepareSegment(s*s,this.layoutVertexArray,this.indexArray,e.sortKey),m=y.vertexLength;for(let h=0;h<s;h++)for(let d=0;d<s;d++)fv(this.layoutVertexArray,p,f,a[d],a[h]);for(let h=0;h<s-1;h++)for(let d=0;d<s-1;d++){let x=m+h*s+d,b=m+(h+1)*s+d;this.indexArray.emplaceBack(x,b+1,x+1),this.indexArray.emplaceBack(x,b,b+1)}y.vertexLength+=s*s,y.primitiveLength+=(s-1)*(s-1)*2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,n,{},i)}};l(Hc,"CircleBucket");var gr=Hc;k("CircleBucket",gr,{omit:["layers"]});g();var wi=ee(de(),1);function Jm(r,e){for(let t=0;t<r.length;t++)if(Zr(e,r[t]))return!0;for(let t=0;t<e.length;t++)if(Zr(r,e[t]))return!0;return!!Jc(r,e)}l(Jm,"polygonIntersectsPolygon");function Ym(r,e,t){return!!(Zr(r,e)||Zc(e,r,t))}l(Ym,"polygonIntersectsBufferedPoint");function rs(r,e){if(r.length===1)return Zm(e,r[0]);for(let t=0;t<e.length;t++){let n=e[t];for(let i=0;i<n.length;i++)if(Zr(r,n[i]))return!0}for(let t=0;t<r.length;t++)if(Zm(e,r[t]))return!0;for(let t=0;t<e.length;t++)if(Jc(r,e[t]))return!0;return!1}l(rs,"polygonIntersectsMultiPolygon");function Km(r,e,t){for(let n=0;n<e.length;n++){let i=e[n];if(r.length>=3){for(let o=0;o<i.length;o++)if(Zr(r,i[o]))return!0}if(yv(r,i,t))return!0}return!1}l(Km,"polygonIntersectsBufferedMultiLine");function yv(r,e,t){if(r.length>1){if(Jc(r,e))return!0;for(let n=0;n<e.length;n++)if(Zc(e[n],r,t))return!0}for(let n=0;n<r.length;n++)if(Zc(r[n],e,t))return!0;return!1}l(yv,"lineIntersectsBufferedLine");function Jc(r,e){if(r.length===0||e.length===0)return!1;for(let t=0;t<r.length-1;t++){let n=r[t],i=r[t+1];for(let o=0;o<e.length-1;o++){let a=e[o],s=e[o+1];if(mv(n,i,a,s))return!0}}return!1}l(Jc,"lineIntersectsLine");function mv(r,e,t,n){return ut(r,t,n)!==ut(e,t,n)&&ut(r,e,t)!==ut(r,e,n)}l(mv,"lineSegmentIntersectsLineSegment");function Zc(r,e,t){let n=t*t;if(e.length===1)return r.distSqr(e[0])<n;for(let i=1;i<e.length;i++){let o=e[i-1],a=e[i];if(Yc(r,o,a)<n)return!0}return!1}l(Zc,"pointIntersectsBufferedLine");function Yc(r,e,t){let n=e.distSqr(t);if(n===0)return r.distSqr(e);let i=((r.x-e.x)*(t.x-e.x)+(r.y-e.y)*(t.y-e.y))/n;return i<0?r.distSqr(e):i>1?r.distSqr(t):r.distSqr(t.sub(e)._mult(i)._add(e))}l(Yc,"distToSegmentSquared");function Zm(r,e){let t=!1,n,i,o;for(let a=0;a<r.length;a++){n=r[a];for(let s=0,u=n.length-1;s<n.length;u=s++)i=n[s],o=n[u],i.y>e.y!=o.y>e.y&&e.x<(o.x-i.x)*(e.y-i.y)/(o.y-i.y)+i.x&&(t=!t)}return t}l(Zm,"multiPolygonContainsPoint");function Zr(r,e){let t=!1;for(let n=0,i=r.length-1;n<r.length;i=n++){let o=r[n],a=r[i];o.y>e.y!=a.y>e.y&&e.x<(a.x-o.x)*(e.y-o.y)/(a.y-o.y)+o.x&&(t=!t)}return t}l(Zr,"polygonContainsPoint");function Qm(r,e,t,n,i){for(let a of r)if(e<=a.x&&t<=a.y&&n>=a.x&&i>=a.y)return!0;let o=[new wi.default(e,t),new wi.default(e,i),new wi.default(n,i),new wi.default(n,t)];if(r.length>2){for(let a of o)if(Zr(r,a))return!0}for(let a=0;a<r.length-1;a++){let s=r[a],u=r[a+1];if(hv(s,u,o))return!0}return!1}l(Qm,"polygonIntersectsBox");function hv(r,e,t){let n=t[0],i=t[2];if(r.x<n.x&&e.x<n.x||r.x>i.x&&e.x>i.x||r.y<n.y&&e.y<n.y||r.y>i.y&&e.y>i.y)return!1;let o=ut(r,e,t[0]);return o!==ut(r,e,t[1])||o!==ut(r,e,t[2])||o!==ut(r,e,t[3])}l(hv,"edgeIntersectsBox");g();var ns=ee(de(),1);function br(r,e,t){let n=e.paint.get(r).value;return n.kind==="constant"?n.value:t.programConfigurations.get(e.id).getMaxValue(r)}l(br,"getMaximumPaintValue");function Nt(r){return Math.sqrt(r[0]*r[0]+r[1]*r[1])}l(Nt,"translateDistance");function Ut(r,e,t,n,i){if(!e[0]&&!e[1])return r;let o=ns.default.convert(e)._mult(i);t==="viewport"&&o._rotate(-n);let a=[];for(let s=0;s<r.length;s++){let u=r[s];a.push(u.sub(o))}return a}l(Ut,"translate");function eh(r,e){let t=[];for(let n=0;n<r.length;n++){let i=r[n],o=[];for(let a=0;a<i.length;a++){let s=i[a-1],u=i[a],c=i[a+1],p=a===0?new ns.default(0,0):u.sub(s)._unit()._perp(),f=a===i.length-1?new ns.default(0,0):c.sub(u)._unit()._perp(),y=p._add(f)._unit(),m=y.x*f.x+y.y*f.y;m!==0&&y._mult(1/m),o.push(y._mult(e)._add(u))}t.push(o)}return t}l(eh,"offsetLine");g();var th,dv=l(()=>th=th||new ne({"circle-sort-key":new B(A.layout_circle["circle-sort-key"])}),"getLayout"),rh,gv=l(()=>rh=rh||new ne({"circle-radius":new B(A.paint_circle["circle-radius"]),"circle-color":new B(A.paint_circle["circle-color"]),"circle-blur":new B(A.paint_circle["circle-blur"]),"circle-opacity":new B(A.paint_circle["circle-opacity"]),"circle-translate":new L(A.paint_circle["circle-translate"]),"circle-translate-anchor":new L(A.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new L(A.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new L(A.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new B(A.paint_circle["circle-stroke-width"]),"circle-stroke-color":new B(A.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new B(A.paint_circle["circle-stroke-opacity"])}),"getPaint"),nh={get paint(){return gv()},get layout(){return dv()}};var ih=ee(de(),1);var Kc=class Kc extends le{constructor(e){super(e,nh)}createBucket(e){return new gr(e)}queryRadius(e){let t=e;return br("circle-radius",this,t)+br("circle-stroke-width",this,t)+Nt(this.paint.get("circle-translate"))}queryIntersectsFeature({queryGeometry:e,feature:t,featureState:n,geometry:i,transform:o,pixelsToTileUnits:a,unwrappedTileID:s,getElevation:u}){let c=Ut(e,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),-o.bearingInRadians,a),p=this.paint.get("circle-radius").evaluate(t,n),f=this.paint.get("circle-stroke-width").evaluate(t,n),y=p+f,m=this.paint.get("circle-pitch-alignment")==="map",h=m?c:bv(c,o,s,u),d=m?y*a:y;for(let x of i)for(let b of x){let P=m?b:oh(b,o,s,u),v=d,S=o.projectTileCoordinates(b.x,b.y,s,u).signedDistanceFromCamera;if(this.paint.get("circle-pitch-scale")==="viewport"&&this.paint.get("circle-pitch-alignment")==="map"?v*=S/o.cameraToCenterDistance:this.paint.get("circle-pitch-scale")==="map"&&this.paint.get("circle-pitch-alignment")==="viewport"&&(v*=o.cameraToCenterDistance/S),Ym(h,P,v))return!0}return!1}};l(Kc,"CircleStyleLayer");var is=Kc;function oh(r,e,t,n){let i=e.projectTileCoordinates(r.x,r.y,t,n).point;return new ih.default((i.x*.5+.5)*e.width,(-i.y*.5+.5)*e.height)}l(oh,"projectPoint");function bv(r,e,t,n){return r.map(i=>oh(i,e,t,n))}l(bv,"projectQueryGeometry");g();g();var Qc=class Qc extends gr{};l(Qc,"HeatmapBucket");var Ai=Qc;k("HeatmapBucket",Ai,{omit:["layers"]});g();var ah,xv=l(()=>ah=ah||new ne({"heatmap-radius":new B(A.paint_heatmap["heatmap-radius"]),"heatmap-weight":new B(A.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new L(A.paint_heatmap["heatmap-intensity"]),"heatmap-color":new dt(A.paint_heatmap["heatmap-color"]),"heatmap-opacity":new L(A.paint_heatmap["heatmap-opacity"])}),"getPaint"),sh={get paint(){return xv()}};g();g();function ep(r,{width:e,height:t},n,i){if(!i)i=new Uint8Array(e*t*n);else if(i instanceof Uint8ClampedArray)i=new Uint8Array(i.buffer);else if(i.length!==e*t*n)throw new RangeError("mismatched image size. expected: ".concat(i.length," but got: ").concat(e*t*n));return r.width=e,r.height=t,r.data=i,r}l(ep,"createImage");function lh(r,{width:e,height:t},n){if(e===r.width&&t===r.height)return;let i=ep({},{width:e,height:t},n);tp(r,i,{x:0,y:0},{x:0,y:0},{width:Math.min(r.width,e),height:Math.min(r.height,t)},n),r.width=e,r.height=t,r.data=i.data}l(lh,"resizeImage");function tp(r,e,t,n,i,o){if(i.width===0||i.height===0)return e;if(i.width>r.width||i.height>r.height||t.x>r.width-i.width||t.y>r.height-i.height)throw new RangeError("out of range source coordinates for image copy");if(i.width>e.width||i.height>e.height||n.x>e.width-i.width||n.y>e.height-i.height)throw new RangeError("out of range destination coordinates for image copy");let a=r.data,s=e.data;if(a===s)throw new Error("srcData equals dstData, so image is already copied");for(let u=0;u<i.height;u++){let c=((t.y+u)*r.width+t.x)*o,p=((n.y+u)*e.width+n.x)*o;for(let f=0;f<i.width*o;f++)s[p+f]=a[c+f]}return e}l(tp,"copyImage");var os=class os{constructor(e,t){ep(this,e,1,t)}resize(e){lh(this,e,1)}clone(){return new os({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(e,t,n,i,o){tp(e,t,n,i,o,1)}};l(os,"AlphaImage");var xr=os,as=class as{constructor(e,t){ep(this,e,4,t)}resize(e){lh(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 as({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(e,t,n,i,o){tp(e,t,n,i,o,4)}setPixel(e,t,n){let i=(e*this.width+t)*4;this.data[i+0]=Math.round(n.r*255/n.a),this.data[i+1]=Math.round(n.g*255/n.a),this.data[i+2]=Math.round(n.b*255/n.a),this.data[i+3]=Math.round(n.a*255)}};l(as,"RGBAImage");var he=as;k("AlphaImage",xr);k("RGBAImage",he);function uh(r){let e={},t=r.resolution||256,n=r.clips?r.clips.length:1,i=r.image||new he({width:t,height:n});if(!sy(t))throw new Error("width is not a power of 2 - ".concat(t));let o=l((a,s,u)=>{e[r.evaluationKey]=u;let c=r.expression.evaluate(e);i.setPixel(a/4/t,s/4,c)},"renderPixel");if(r.clips)for(let a=0,s=0;a<n;++a,s+=t*4)for(let u=0,c=0;u<t;u++,c+=4){let p=u/(t-1),{start:f,end:y}=r.clips[a],m=f*(1-p)+y*p;o(s,c,m)}else for(let a=0,s=0;a<t;a++,s+=4){let u=a/(t-1);o(0,s,u)}return i}l(uh,"renderColorRamp");var ch="big-fb";var rp=class rp extends le{createBucket(e){return new Ai(e)}constructor(e){super(e,sh),this.heatmapFbos=new Map,this._updateColorRamp()}_handleSpecialPaintPropertyUpdate(e){e==="heatmap-color"&&this._updateColorRamp()}_updateColorRamp(){let e=this._transitionablePaint._values["heatmap-color"].value.expression;this.colorRamp=uh({expression:e,evaluationKey:"heatmapDensity",image:this.colorRamp}),this.colorRampTexture=null}resize(){this.heatmapFbos.has(ch)&&this.heatmapFbos.delete(ch)}queryRadius(){return 0}queryIntersectsFeature(){return!1}hasOffscreenPass(){return this.paint.get("heatmap-opacity")!==0&&this.visibility!=="none"}};l(rp,"HeatmapStyleLayer");var ss=rp;g();g();var ph,vv=l(()=>ph=ph||new ne({"hillshade-illumination-direction":new L(A.paint_hillshade["hillshade-illumination-direction"]),"hillshade-illumination-altitude":new L(A.paint_hillshade["hillshade-illumination-altitude"]),"hillshade-illumination-anchor":new L(A.paint_hillshade["hillshade-illumination-anchor"]),"hillshade-exaggeration":new L(A.paint_hillshade["hillshade-exaggeration"]),"hillshade-shadow-color":new L(A.paint_hillshade["hillshade-shadow-color"]),"hillshade-highlight-color":new L(A.paint_hillshade["hillshade-highlight-color"]),"hillshade-accent-color":new L(A.paint_hillshade["hillshade-accent-color"]),"hillshade-method":new L(A.paint_hillshade["hillshade-method"])}),"getPaint"),fh={get paint(){return vv()}};var np=class np extends le{constructor(e){super(e,fh),this.recalculate({zoom:0,zoomHistory:{}},void 0)}getIlluminationProperties(){let e=this.paint.get("hillshade-illumination-direction").values,t=this.paint.get("hillshade-illumination-altitude").values,n=this.paint.get("hillshade-highlight-color").values,i=this.paint.get("hillshade-shadow-color").values,o=Math.max(e.length,t.length,n.length,i.length);e=e.concat(Array(o-e.length).fill(e.at(-1))),t=t.concat(Array(o-t.length).fill(t.at(-1))),n=n.concat(Array(o-n.length).fill(n.at(-1))),i=i.concat(Array(o-i.length).fill(i.at(-1)));let a=t.map(ul);return{directionRadians:e.map(ul),altitudeRadians:a,shadowColor:i,highlightColor:n}}hasOffscreenPass(){return this.paint.get("hillshade-exaggeration")!==0&&this.visibility!=="none"}};l(np,"HillshadeStyleLayer");var ls=np;g();g();var yh,Pv=l(()=>yh=yh||new ne({"color-relief-opacity":new L(A["paint_color-relief"]["color-relief-opacity"]),"color-relief-color":new dt(A["paint_color-relief"]["color-relief-color"])}),"getPaint"),mh={get paint(){return Pv()}};g();var ip=class ip{constructor(e,t,n,i){this.context=e,this.format=n,this.texture=e.gl.createTexture(),this.update(t,i)}update(e,t,n){let{width:i,height:o}=e,a=(!this.size||this.size[0]!==i||this.size[1]!==o)&&!n,{context:s}=this,{gl:u}=s;if(this.useMipmap=!!(t&&t.useMipmap),u.bindTexture(u.TEXTURE_2D,this.texture),s.pixelStoreUnpackFlipY.set(!1),s.pixelStoreUnpack.set(1),s.pixelStoreUnpackPremultiplyAlpha.set(this.format===u.RGBA&&(!t||t.premultiply!==!1)),a)this.size=[i,o],e instanceof HTMLImageElement||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement||e instanceof ImageData||At(e)?u.texImage2D(u.TEXTURE_2D,0,this.format,this.format,u.UNSIGNED_BYTE,e):u.texImage2D(u.TEXTURE_2D,0,this.format,i,o,0,this.format,u.UNSIGNED_BYTE,e.data);else{let{x:c,y:p}=n||{x:0,y:0};e instanceof HTMLImageElement||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement||e instanceof ImageData||At(e)?u.texSubImage2D(u.TEXTURE_2D,0,c,p,u.RGBA,u.UNSIGNED_BYTE,e):u.texSubImage2D(u.TEXTURE_2D,0,c,p,i,o,u.RGBA,u.UNSIGNED_BYTE,e.data)}this.useMipmap&&this.isSizePowerOfTwo()&&u.generateMipmap(u.TEXTURE_2D),s.pixelStoreUnpackFlipY.setDefault(),s.pixelStoreUnpack.setDefault(),s.pixelStoreUnpackPremultiplyAlpha.setDefault()}bind(e,t,n){let{context:i}=this,{gl:o}=i;o.bindTexture(o.TEXTURE_2D,this.texture),n===o.LINEAR_MIPMAP_NEAREST&&!this.isSizePowerOfTwo()&&(n=o.LINEAR),e!==this.filter&&(o.texParameteri(o.TEXTURE_2D,o.TEXTURE_MAG_FILTER,e),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_MIN_FILTER,n||e),this.filter=e),t!==this.wrap&&(o.texParameteri(o.TEXTURE_2D,o.TEXTURE_WRAP_S,t),o.texParameteri(o.TEXTURE_2D,o.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}};l(ip,"Texture");var _i=ip;g();var ap=class ap{constructor(e,t,n,i=1,o=1,a=1,s=0){if(this.uid=e,t.height!==t.width)throw new RangeError("DEM tiles must be square");if(n&&!["mapbox","terrarium","custom"].includes(n)){ye('"'.concat(n,'" is not a valid encoding type. Valid types include "mapbox", "terrarium" and "custom".'));return}this.stride=t.height;let u=this.dim=t.height-2;switch(this.data=new Uint32Array(t.data.buffer),n){case"terrarium":this.redFactor=256,this.greenFactor=1,this.blueFactor=1/256,this.baseShift=32768;break;case"custom":this.redFactor=i,this.greenFactor=o,this.blueFactor=a,this.baseShift=s;break;case"mapbox":default:this.redFactor=6553.6,this.greenFactor=25.6,this.blueFactor=.1,this.baseShift=1e4;break}for(let c=0;c<u;c++)this.data[this._idx(-1,c)]=this.data[this._idx(0,c)],this.data[this._idx(u,c)]=this.data[this._idx(u-1,c)],this.data[this._idx(c,-1)]=this.data[this._idx(c,0)],this.data[this._idx(c,u)]=this.data[this._idx(c,u-1)];this.data[this._idx(-1,-1)]=this.data[this._idx(0,0)],this.data[this._idx(u,-1)]=this.data[this._idx(u-1,0)],this.data[this._idx(-1,u)]=this.data[this._idx(0,u-1)],this.data[this._idx(u,u)]=this.data[this._idx(u-1,u-1)],this.min=Number.MAX_SAFE_INTEGER,this.max=Number.MIN_SAFE_INTEGER;for(let c=0;c<u;c++)for(let p=0;p<u;p++){let f=this.get(c,p);f>this.max&&(this.max=f),f<this.min&&(this.min=f)}}get(e,t){let n=new Uint8Array(this.data.buffer),i=this._idx(e,t)*4;return this.unpack(n[i],n[i+1],n[i+2])}getUnpackVector(){return[this.redFactor,this.greenFactor,this.blueFactor,this.baseShift]}_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)}unpack(e,t,n){return e*this.redFactor+t*this.greenFactor+n*this.blueFactor-this.baseShift}pack(e){return op(e,this.getUnpackVector())}getPixels(){return new he({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))}backfillBorder(e,t,n){if(this.dim!==e.dim)throw new Error("dem dimension mismatch");let i=t*this.dim,o=t*this.dim+this.dim,a=n*this.dim,s=n*this.dim+this.dim;switch(t){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 u=-t*this.dim,c=-n*this.dim;for(let p=a;p<s;p++)for(let f=i;f<o;f++)this.data[this._idx(f,p)]=e.data[this._idx(f+u,p+c)]}};l(ap,"DEMData");var Ii=ap;function op(r,e){let t=e[0],n=e[1],i=e[2],o=e[3],a=Math.min(t,n,i),s=Math.round((r+o)/a);return{r:Math.floor(s*a/t)%256,g:Math.floor(s*a/n)%256,b:Math.floor(s*a/i)%256}}l(op,"packDEMData");k("DEMData",Ii);var sp=class sp extends le{constructor(e){super(e,mh)}_createColorRamp(e){let t={elevationStops:[],colorStops:[]},n=this._transitionablePaint._values["color-relief-color"].value.expression;if(n instanceof et&&n._styleExpression.expression instanceof Me){this.colorRampExpression=n;let a=n._styleExpression.expression;t.elevationStops=a.labels,t.colorStops=[];for(let s of t.elevationStops)t.colorStops.push(a.evaluate({globals:{elevation:s}}))}if(t.elevationStops.length<1&&(t.elevationStops=[0],t.colorStops=[Y.transparent]),t.elevationStops.length<2&&(t.elevationStops.push(t.elevationStops[0]+1),t.colorStops.push(t.colorStops[0])),t.elevationStops.length<=e)return t;let i={elevationStops:[],colorStops:[]},o=(t.elevationStops.length-1)/(e-1);for(let a=0;a<t.elevationStops.length-.5;a+=o)i.elevationStops.push(t.elevationStops[Math.round(a)]),i.colorStops.push(t.colorStops[Math.round(a)]);return ye("Too many colors in specification of ".concat(this.id," color-relief layer, may not render properly.")),i}_colorRampChanged(){return this.colorRampExpression!=this._transitionablePaint._values["color-relief-color"].value.expression}getColorRampTextures(e,t,n){if(this.colorRampTextures&&!this._colorRampChanged())return this.colorRampTextures;let i=this._createColorRamp(t),o=new he({width:i.colorStops.length,height:1}),a=new he({width:i.colorStops.length,height:1});for(let s=0;s<i.elevationStops.length;s++){let u=op(i.elevationStops[s],n);a.setPixel(0,s,new Y(u.r/255,u.g/255,u.b/255,1)),o.setPixel(0,s,i.colorStops[s])}return this.colorRampTextures={elevationTexture:new _i(e,a,e.gl.RGBA),colorTexture:new _i(e,o,e.gl.RGBA)},this.colorRampTextures}hasOffscreenPass(){return this.visibility!=="none"&&!!this.colorRampTextures}};l(sp,"ColorReliefStyleLayer");var us=sp;g();g();g();var Sv=re([{name:"a_pos",components:2,type:"Int16"}],4);var{members:hh,size:MI,alignment:LI}=Sv;g();function Jr(r,e,t){let n=t.patternDependencies,i=!1;for(let o of e){let a=o.paint.get("".concat(r,"-pattern"));a.isConstant()||(i=!0);let s=a.constantOr(null);s&&(i=!0,n[s.to]=!0,n[s.from]=!0)}return i}l(Jr,"hasPattern");function Yr(r,e,t,n,i){let o=i.patternDependencies;for(let a of e){let u=a.paint.get("".concat(r,"-pattern")).value;if(u.kind!=="constant"){let c=u.evaluate({zoom:n-1},t,{},i.availableImages),p=u.evaluate({zoom:n},t,{},i.availableImages),f=u.evaluate({zoom:n+1},t,{},i.availableImages);c=c&&c.name?c.name:c,p=p&&p.name?p.name:p,f=f&&f.name?f.name:f,o[c]=!0,o[p]=!0,o[f]=!0,t.patterns[a.id]={min:c,mid:p,max:f}}}return t}l(Yr,"addPatternDependencies");g();var Li=ee(de(),1);g();function cp(r,e,t=2){let n=e&&e.length,i=n?e[0]*t:r.length,o=gh(r,0,i,t,!0),a=[];if(!o||o.next===o.prev)return a;let s,u,c;if(n&&(o=Tv(r,e,o,t)),r.length>80*t){s=1/0,u=1/0;let p=-1/0,f=-1/0;for(let y=t;y<i;y+=t){let m=r[y],h=r[y+1];m<s&&(s=m),h<u&&(u=h),m>p&&(p=m),h>f&&(f=h)}c=Math.max(p-s,f-u),c=c!==0?32767/c:0}return Ci(o,a,t,s,u,c,0),a}l(cp,"earcut");function gh(r,e,t,n,i){let o;if(i===zv(r,e,t,n)>0)for(let a=e;a<t;a+=n)o=dh(a/n|0,r[a],r[a+1],o);else for(let a=t-n;a>=e;a-=n)o=dh(a/n|0,r[a],r[a+1],o);return o&&Kr(o,o.next)&&(Fi(o),o=o.next),o}l(gh,"linkedList");function vr(r,e){if(!r)return r;e||(e=r);let t=r,n;do if(n=!1,!t.steiner&&(Kr(t,t.next)||ce(t.prev,t,t.next)===0)){if(Fi(t),t=e=t.prev,t===t.next)break;n=!0}else t=t.next;while(n||t!==e);return e}l(vr,"filterPoints");function Ci(r,e,t,n,i,o,a){if(!r)return;!a&&o&&Mv(r,n,i,o);let s=r;for(;r.prev!==r.next;){let u=r.prev,c=r.next;if(o?Av(r,n,i,o):wv(r)){e.push(u.i,r.i,c.i),Fi(r),r=c.next,s=c.next;continue}if(r=c,r===s){a?a===1?(r=_v(vr(r),e),Ci(r,e,t,n,i,o,2)):a===2&&Iv(r,e,t,n,i,o):Ci(vr(r),e,t,n,i,o,1);break}}}l(Ci,"earcutLinked");function wv(r){let e=r.prev,t=r,n=r.next;if(ce(e,t,n)>=0)return!1;let i=e.x,o=t.x,a=n.x,s=e.y,u=t.y,c=n.y,p=Math.min(i,o,a),f=Math.min(s,u,c),y=Math.max(i,o,a),m=Math.max(s,u,c),h=n.next;for(;h!==e;){if(h.x>=p&&h.x<=y&&h.y>=f&&h.y<=m&&Ti(i,s,o,u,a,c,h.x,h.y)&&ce(h.prev,h,h.next)>=0)return!1;h=h.next}return!0}l(wv,"isEar");function Av(r,e,t,n){let i=r.prev,o=r,a=r.next;if(ce(i,o,a)>=0)return!1;let s=i.x,u=o.x,c=a.x,p=i.y,f=o.y,y=a.y,m=Math.min(s,u,c),h=Math.min(p,f,y),d=Math.max(s,u,c),x=Math.max(p,f,y),b=lp(m,h,e,t,n),P=lp(d,x,e,t,n),v=r.prevZ,S=r.nextZ;for(;v&&v.z>=b&&S&&S.z<=P;){if(v.x>=m&&v.x<=d&&v.y>=h&&v.y<=x&&v!==i&&v!==a&&Ti(s,p,u,f,c,y,v.x,v.y)&&ce(v.prev,v,v.next)>=0||(v=v.prevZ,S.x>=m&&S.x<=d&&S.y>=h&&S.y<=x&&S!==i&&S!==a&&Ti(s,p,u,f,c,y,S.x,S.y)&&ce(S.prev,S,S.next)>=0))return!1;S=S.nextZ}for(;v&&v.z>=b;){if(v.x>=m&&v.x<=d&&v.y>=h&&v.y<=x&&v!==i&&v!==a&&Ti(s,p,u,f,c,y,v.x,v.y)&&ce(v.prev,v,v.next)>=0)return!1;v=v.prevZ}for(;S&&S.z<=P;){if(S.x>=m&&S.x<=d&&S.y>=h&&S.y<=x&&S!==i&&S!==a&&Ti(s,p,u,f,c,y,S.x,S.y)&&ce(S.prev,S,S.next)>=0)return!1;S=S.nextZ}return!0}l(Av,"isEarHashed");function _v(r,e){let t=r;do{let n=t.prev,i=t.next.next;!Kr(n,i)&&xh(n,t,t.next,i)&&ki(n,i)&&ki(i,n)&&(e.push(n.i,t.i,i.i),Fi(t),Fi(t.next),t=r=i),t=t.next}while(t!==r);return vr(t)}l(_v,"cureLocalIntersections");function Iv(r,e,t,n,i,o){let a=r;do{let s=a.next.next;for(;s!==a.prev;){if(a.i!==s.i&&Vv(a,s)){let u=vh(a,s);a=vr(a,a.next),u=vr(u,u.next),Ci(a,e,t,n,i,o,0),Ci(u,e,t,n,i,o,0);return}s=s.next}a=a.next}while(a!==r)}l(Iv,"splitEarcut");function Tv(r,e,t,n){let i=[];for(let o=0,a=e.length;o<a;o++){let s=e[o]*n,u=o<a-1?e[o+1]*n:r.length,c=gh(r,s,u,n,!1);c===c.next&&(c.steiner=!0),i.push(Dv(c))}i.sort(Cv);for(let o=0;o<i.length;o++)t=kv(i[o],t);return t}l(Tv,"eliminateHoles");function Cv(r,e){let t=r.x-e.x;if(t===0&&(t=r.y-e.y,t===0)){let n=(r.next.y-r.y)/(r.next.x-r.x),i=(e.next.y-e.y)/(e.next.x-e.x);t=n-i}return t}l(Cv,"compareXYSlope");function kv(r,e){let t=Fv(r,e);if(!t)return e;let n=vh(t,r);return vr(n,n.next),vr(t,t.next)}l(kv,"eliminateHole");function Fv(r,e){let t=e,n=r.x,i=r.y,o=-1/0,a;if(Kr(r,t))return t;do{if(Kr(r,t.next))return t.next;if(i<=t.y&&i>=t.next.y&&t.next.y!==t.y){let f=t.x+(i-t.y)*(t.next.x-t.x)/(t.next.y-t.y);if(f<=n&&f>o&&(o=f,a=t.x<t.next.x?t:t.next,f===n))return a}t=t.next}while(t!==e);if(!a)return null;let s=a,u=a.x,c=a.y,p=1/0;t=a;do{if(n>=t.x&&t.x>=u&&n!==t.x&&bh(i<c?n:o,i,u,c,i<c?o:n,i,t.x,t.y)){let f=Math.abs(i-t.y)/(n-t.x);ki(t,r)&&(f<p||f===p&&(t.x>a.x||t.x===a.x&&Ev(a,t)))&&(a=t,p=f)}t=t.next}while(t!==s);return a}l(Fv,"findHoleBridge");function Ev(r,e){return ce(r.prev,r,e.prev)<0&&ce(e.next,r,r.next)<0}l(Ev,"sectorContainsSector");function Mv(r,e,t,n){let i=r;do i.z===0&&(i.z=lp(i.x,i.y,e,t,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next;while(i!==r);i.prevZ.nextZ=null,i.prevZ=null,Lv(i)}l(Mv,"indexCurve");function Lv(r){let e,t=1;do{let n=r,i;r=null;let o=null;for(e=0;n;){e++;let a=n,s=0;for(let c=0;c<t&&(s++,a=a.nextZ,!!a);c++);let u=t;for(;s>0||u>0&&a;)s!==0&&(u===0||!a||n.z<=a.z)?(i=n,n=n.nextZ,s--):(i=a,a=a.nextZ,u--),o?o.nextZ=i:r=i,i.prevZ=o,o=i;n=a}o.nextZ=null,t*=2}while(e>1);return r}l(Lv,"sortLinked");function lp(r,e,t,n,i){return r=(r-t)*i|0,e=(e-n)*i|0,r=(r|r<<8)&16711935,r=(r|r<<4)&252645135,r=(r|r<<2)&858993459,r=(r|r<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,r|e<<1}l(lp,"zOrder");function Dv(r){let e=r,t=r;do(e.x<t.x||e.x===t.x&&e.y<t.y)&&(t=e),e=e.next;while(e!==r);return t}l(Dv,"getLeftmost");function bh(r,e,t,n,i,o,a,s){return(i-a)*(e-s)>=(r-a)*(o-s)&&(r-a)*(n-s)>=(t-a)*(e-s)&&(t-a)*(o-s)>=(i-a)*(n-s)}l(bh,"pointInTriangle");function Ti(r,e,t,n,i,o,a,s){return!(r===a&&e===s)&&bh(r,e,t,n,i,o,a,s)}l(Ti,"pointInTriangleExceptFirst");function Vv(r,e){return r.next.i!==e.i&&r.prev.i!==e.i&&!Bv(r,e)&&(ki(r,e)&&ki(e,r)&&Rv(r,e)&&(ce(r.prev,r,e.prev)||ce(r,e.prev,e))||Kr(r,e)&&ce(r.prev,r,r.next)>0&&ce(e.prev,e,e.next)>0)}l(Vv,"isValidDiagonal");function ce(r,e,t){return(e.y-r.y)*(t.x-e.x)-(e.x-r.x)*(t.y-e.y)}l(ce,"area");function Kr(r,e){return r.x===e.x&&r.y===e.y}l(Kr,"equals");function xh(r,e,t,n){let i=ps(ce(r,e,t)),o=ps(ce(r,e,n)),a=ps(ce(t,n,r)),s=ps(ce(t,n,e));return!!(i!==o&&a!==s||i===0&&cs(r,t,e)||o===0&&cs(r,n,e)||a===0&&cs(t,r,n)||s===0&&cs(t,e,n))}l(xh,"intersects");function cs(r,e,t){return e.x<=Math.max(r.x,t.x)&&e.x>=Math.min(r.x,t.x)&&e.y<=Math.max(r.y,t.y)&&e.y>=Math.min(r.y,t.y)}l(cs,"onSegment");function ps(r){return r>0?1:r<0?-1:0}l(ps,"sign");function Bv(r,e){let t=r;do{if(t.i!==r.i&&t.next.i!==r.i&&t.i!==e.i&&t.next.i!==e.i&&xh(t,t.next,r,e))return!0;t=t.next}while(t!==r);return!1}l(Bv,"intersectsPolygon");function ki(r,e){return ce(r.prev,r,r.next)<0?ce(r,e,r.next)>=0&&ce(r,r.prev,e)>=0:ce(r,e,r.prev)<0||ce(r,r.next,e)<0}l(ki,"locallyInside");function Rv(r,e){let t=r,n=!1,i=(r.x+e.x)/2,o=(r.y+e.y)/2;do t.y>o!=t.next.y>o&&t.next.y!==t.y&&i<(t.next.x-t.x)*(o-t.y)/(t.next.y-t.y)+t.x&&(n=!n),t=t.next;while(t!==r);return n}l(Rv,"middleInside");function vh(r,e){let t=up(r.i,r.x,r.y),n=up(e.i,e.x,e.y),i=r.next,o=e.prev;return r.next=e,e.prev=r,t.next=i,i.prev=t,n.next=t,t.prev=n,o.next=n,n.prev=o,n}l(vh,"splitPolygon");function dh(r,e,t,n){let i=up(r,e,t);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}l(dh,"insertNode");function Fi(r){r.next.prev=r.prev,r.prev.next=r.next,r.prevZ&&(r.prevZ.nextZ=r.nextZ),r.nextZ&&(r.nextZ.prevZ=r.prevZ)}l(Fi,"removeNode");function up(r,e,t){return{i:r,x:e,y:t,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}l(up,"createNode");function zv(r,e,t,n){let i=0;for(let o=e,a=t-n;o<t;o+=n)i+=(r[a]-r[o])*(r[o+1]+r[a+1]),a=o;return i}l(zv,"signedArea");g();var pp=class pp{constructor(e,t){if(t>e)throw new Error("Min granularity must not be greater than base granularity.");this._baseZoomGranularity=e,this._minGranularity=t}getGranularityForZoomLevel(e){let t=1<<e;return Math.max(Math.floor(this._baseZoomGranularity/t),this._minGranularity,1)}};l(pp,"SubdivisionGranularityExpression");var $t=pp,Ei=class Ei{constructor(e){this.fill=e.fill,this.line=e.line,this.tile=e.tile,this.stencil=e.stencil,this.circle=e.circle}};l(Ei,"SubdivisionGranularitySetting"),Ei.noSubdivision=new Ei({fill:new $t(0,0),line:new $t(0,0),tile:new $t(0,0),stencil:new $t(0,0),circle:1});var fs=Ei;k("SubdivisionGranularityExpression",$t);k("SubdivisionGranularitySetting",fs);var Qr=-32768,Mi=32767,yp=class yp{constructor(e,t){this._vertexBuffer=[];this._vertexDictionary=new Map;this._used=!1;this._granularity=e,this._granularityCellSize=8192/e,this._canonical=t}_getKey(e,t){return e=e+32768,t=t+32768,e<<16|t<<0}_vertexToIndex(e,t){if(e<-32768||t<-32768||e>32767||t>32767)throw new Error("Vertex coordinates are out of signed 16 bit integer range.");let n=Math.round(e)|0,i=Math.round(t)|0,o=this._getKey(n,i);if(this._vertexDictionary.has(o))return this._vertexDictionary.get(o);let a=this._vertexBuffer.length/2;return this._vertexDictionary.set(o,a),this._vertexBuffer.push(n,i),a}_subdivideTrianglesScanline(e){if(this._granularity<2)return Gv(this._vertexBuffer,e);let t=[],n=e.length;for(let i=0;i<n;i+=3){let o=[e[i+0],e[i+1],e[i+2]],a=[this._vertexBuffer[e[i+0]*2+0],this._vertexBuffer[e[i+0]*2+1],this._vertexBuffer[e[i+1]*2+0],this._vertexBuffer[e[i+1]*2+1],this._vertexBuffer[e[i+2]*2+0],this._vertexBuffer[e[i+2]*2+1]],s=1/0,u=1/0,c=-1/0,p=-1/0;for(let d=0;d<3;d++){let x=a[d*2],b=a[d*2+1];s=Math.min(s,x),c=Math.max(c,x),u=Math.min(u,b),p=Math.max(p,b)}if(s===c||u===p)continue;let f=Math.floor(s/this._granularityCellSize),y=Math.ceil(c/this._granularityCellSize),m=Math.floor(u/this._granularityCellSize),h=Math.ceil(p/this._granularityCellSize);if(f===y&&m===h){t.push(...o);continue}for(let d=m;d<h;d++){let x=this._scanlineGenerateVertexRingForCellRow(d,a,o);Nv(this._vertexBuffer,x,t)}}return t}_scanlineGenerateVertexRingForCellRow(e,t,n){let i=e*this._granularityCellSize,o=i+this._granularityCellSize,a=[];for(let s=0;s<3;s++){let u=t[s*2],c=t[s*2+1],p=t[(s+1)*2%6],f=t[((s+1)*2+1)%6],y=t[(s+2)*2%6],m=t[((s+2)*2+1)%6],h=p-u,d=f-c,x=h===0,b=d===0,P=(i-c)/d,v=(o-c)/d,S=Math.min(P,v),_=Math.max(P,v);if(!b&&(S>=1||_<=0)||b&&(c<i||c>o)){f>=i&&f<=o&&a.push(n[(s+1)%3]);continue}if(!b&&S>0){let F=u+h*S,D=c+d*S;a.push(this._vertexToIndex(F,D))}let T=u+h*Math.max(S,0),I=u+h*Math.min(_,1);if(x||this._generateIntraEdgeVertices(a,u,c,p,f,T,I),!b&&_<1){let F=u+h*_,D=c+d*_;a.push(this._vertexToIndex(F,D))}(b||f>=i&&f<=o)&&a.push(n[(s+1)%3]),!b&&(f<=i||f>=o)&&this._generateInterEdgeVertices(a,u,c,p,f,y,m,I,i,o)}return a}_generateIntraEdgeVertices(e,t,n,i,o,a,s){let u=i-t,c=o-n,p=c===0,f=p?Math.min(t,i):Math.min(a,s),y=p?Math.max(t,i):Math.max(a,s),m=Math.floor(f/this._granularityCellSize)+1,h=Math.ceil(y/this._granularityCellSize)-1;if(p?t<i:a<s)for(let x=m;x<=h;x++){let b=x*this._granularityCellSize,P=n+c*(b-t)/u;e.push(this._vertexToIndex(b,P))}else for(let x=h;x>=m;x--){let b=x*this._granularityCellSize,P=n+c*(b-t)/u;e.push(this._vertexToIndex(b,P))}}_generateInterEdgeVertices(e,t,n,i,o,a,s,u,c,p){let f=o-n,y=a-i,m=s-o,h=(c-o)/m,d=(p-o)/m,x=Math.min(h,d),b=Math.max(h,d),P=i+y*x,v=Math.floor(Math.min(P,u)/this._granularityCellSize)+1,S=Math.ceil(Math.max(P,u)/this._granularityCellSize)-1,_=u<P,T=m===0;if(T&&(s===c||s===p))return;if(T||x>=1||b<=0){let F=t-a,D=n-s,R=(c-s)/D,z=(p-s)/D,N=Math.min(R,z),V=a+F*N;v=Math.floor(Math.min(V,u)/this._granularityCellSize)+1,S=Math.ceil(Math.max(V,u)/this._granularityCellSize)-1,_=u<V}let I=f>0?p:c;if(_)for(let F=v;F<=S;F++){let D=F*this._granularityCellSize;e.push(this._vertexToIndex(D,I))}else for(let F=S;F>=v;F--){let D=F*this._granularityCellSize;e.push(this._vertexToIndex(D,I))}}_generateOutline(e){let t=[];for(let n of e){let i=rt(n,this._granularity,!0),o=this._pointArrayToIndices(i),a=[];for(let s=1;s<o.length;s++)a.push(o[s-1]),a.push(o[s]);t.push(a)}return t}_handlePoles(e){let t=!1,n=!1;this._canonical&&(this._canonical.y===0&&(t=!0),this._canonical.y===(1<<this._canonical.z)-1&&(n=!0)),(t||n)&&this._fillPoles(e,t,n)}_ensureNoPoleVertices(){let e=this._vertexBuffer;for(let t=0;t<e.length;t+=2){let n=e[t+1];n===Qr&&(e[t+1]=Qr+1),n===Mi&&(e[t+1]=Mi-1)}}_generatePoleQuad(e,t,n,i,o,a){i>o!=(a===Qr)?(e.push(t),e.push(n),e.push(this._vertexToIndex(i,a)),e.push(n),e.push(this._vertexToIndex(o,a)),e.push(this._vertexToIndex(i,a))):(e.push(n),e.push(t),e.push(this._vertexToIndex(i,a)),e.push(this._vertexToIndex(o,a)),e.push(n),e.push(this._vertexToIndex(i,a)))}_fillPoles(e,t,n){let i=this._vertexBuffer,o=0,a=8192,s=e.length;for(let u=2;u<s;u+=3){let c=e[u-2],p=e[u-1],f=e[u],y=i[c*2],m=i[c*2+1],h=i[p*2],d=i[p*2+1],x=i[f*2],b=i[f*2+1];t&&(m===o&&d===o&&this._generatePoleQuad(e,c,p,y,h,Qr),d===o&&b===o&&this._generatePoleQuad(e,p,f,h,x,Qr),b===o&&m===o&&this._generatePoleQuad(e,f,c,x,y,Qr)),n&&(m===a&&d===a&&this._generatePoleQuad(e,c,p,y,h,Mi),d===a&&b===a&&this._generatePoleQuad(e,p,f,h,x,Mi),b===a&&m===a&&this._generatePoleQuad(e,f,c,x,y,Mi))}}_initializeVertices(e){for(let t=0;t<e.length;t+=2)this._vertexToIndex(e[t],e[t+1])}subdividePolygonInternal(e,t){if(this._used)throw new Error("Subdivision: multiple use not allowed.");this._used=!0;let{flattened:n,holeIndices:i}=Ov(e);this._initializeVertices(n);let o;try{let s=cp(n,i),u=this._convertIndices(n,s);o=this._subdivideTrianglesScanline(u)}catch(s){console.error(s)}let a=[];return t&&(a=this._generateOutline(e)),this._ensureNoPoleVertices(),this._handlePoles(o),{verticesFlattened:this._vertexBuffer,indicesTriangles:o,indicesLineList:a}}_convertIndices(e,t){let n=[];for(let i=0;i<t.length;i++){let o=e[t[i]*2],a=e[t[i]*2+1];n.push(this._vertexToIndex(o,a))}return n}_pointArrayToIndices(e){let t=[];for(let n=0;n<e.length;n++){let i=e[n];t.push(this._vertexToIndex(i.x,i.y))}return t}};l(yp,"Subdivider");var fp=yp;function ys(r,e,t,n=!0){return new fp(t,e).subdividePolygonInternal(r,n)}l(ys,"subdividePolygon");function rt(r,e,t=!1){if(!r||r.length<1)return[];if(r.length<2)return[];let n=r[0],i=r[r.length-1],o=t&&(n.x!==i.x||n.y!==i.y);if(e<2)return o?[...r,r[0]]:[...r];let a=Math.floor(8192/e),s=[];s.push(new Li.default(r[0].x,r[0].y));let u=r.length,c=o?u:u-1;for(let p=0;p<c;p++){let f=r[p],y=p<u-1?r[p+1]:r[0],m=f.x,h=f.y,d=y.x,x=y.y,b=m!==d,P=h!==x;if(!b&&!P)continue;let v=d-m,S=x-h,_=Math.abs(v),T=Math.abs(S),I=m,F=h;for(;;){let R=v>0?(Math.floor(I/a)+1)*a:(Math.ceil(I/a)-1)*a,z=S>0?(Math.floor(F/a)+1)*a:(Math.ceil(F/a)-1)*a,N=Math.abs(I-R),V=Math.abs(F-z),C=Math.abs(I-d),O=Math.abs(F-x),$=b?N/_:Number.POSITIVE_INFINITY,U=P?V/T:Number.POSITIVE_INFINITY;if((C<=N||!b)&&(O<=V||!P))break;if($<U&&b||!P){I=R,F=F+S*$;let G=new Li.default(I,Math.round(F));(s[s.length-1].x!==G.x||s[s.length-1].y!==G.y)&&s.push(G)}else{I=I+v*U,F=z;let G=new Li.default(Math.round(I),F);(s[s.length-1].x!==G.x||s[s.length-1].y!==G.y)&&s.push(G)}}let D=new Li.default(d,x);(s[s.length-1].x!==D.x||s[s.length-1].y!==D.y)&&s.push(D)}return s}l(rt,"subdivideVertexLine");function Ov(r){let e=[],t=[];for(let n of r)if(n.length!==0){n!==r[0]&&e.push(t.length/2);for(let i=0;i<n.length;i++)t.push(n[i].x),t.push(n[i].y)}return{flattened:t,holeIndices:e}}l(Ov,"flatten");function Gv(r,e){let t=[];for(let n=0;n<e.length;n+=3){let i=e[n],o=e[n+1],a=e[n+2],s=r[i*2],u=r[i*2+1],c=r[o*2],p=r[o*2+1],f=r[a*2],y=r[a*2+1],m=c-s,h=p-u,d=f-s,x=y-u;m*x-h*d>0?(t.push(i),t.push(a),t.push(o)):(t.push(i),t.push(o),t.push(a))}return t}l(Gv,"fixWindingOrder");function Nv(r,e,t){if(e.length===0)throw new Error("Subdivision vertex ring is empty.");let n=0,i=r[e[0]*2];for(let u=1;u<e.length;u++){let c=r[e[u]*2];c<i&&(i=c,n=u)}let o=e.length,a=n,s=(a+1)%o;for(;;){let u=a-1>=0?a-1:o-1,c=(s+1)%o,p=r[e[u]*2],f=r[e[u]*2+1],y=r[e[c]*2],m=r[e[c]*2+1],h=r[e[a]*2],d=r[e[a]*2+1],x=r[e[s]*2],b=r[e[s]*2+1],P=!1;if(p<y)P=!0;else if(p>y)P=!1;else{let v=x-h,_=b-d,T=-v,I=d<b?1:-1,F=((p-h)*_+(f-d)*T)*I,D=((y-h)*_+(m-d)*T)*I;F>D&&(P=!0)}if(P){let v=e[u],S=e[a],_=e[s];v!==S&&v!==_&&S!==_&&t.push(_,S,v),a--,a<0&&(a=o-1)}else{let v=e[c],S=e[a],_=e[s];v!==S&&v!==_&&S!==_&&t.push(_,S,v),s++,s>=o&&(s=0)}if(u===c)break}}l(Nv,"scanlineTriangulateVertexRing");g();function ms(r,e,t,n,i,o,a,s,u){let c=i.length/2,p=a&&s&&u;if(c<me.MAX_VERTEX_ARRAY_LENGTH){let f=e.prepareSegment(c,t,n),y=f.vertexLength;for(let d=0;d<o.length;d+=3)n.emplaceBack(y+o[d],y+o[d+1],y+o[d+2]);f.vertexLength+=c,f.primitiveLength+=o.length/3;let m,h;p&&(h=a.prepareSegment(c,t,s),m=h.vertexLength,h.vertexLength+=c);for(let d=0;d<i.length;d+=2)r(i[d],i[d+1]);if(p)for(let d=0;d<u.length;d++){let x=u[d];for(let b=1;b<x.length;b+=2)s.emplaceBack(m+x[b-1],m+x[b]);h.primitiveLength+=x.length/2}}else Uv(e,t,n,i,o,r),p&&$v(a,t,s,i,u,r),e.forceNewSegmentOnNextPrepare(),a==null||a.forceNewSegmentOnNextPrepare()}l(ms,"fillLargeMeshArrays");function Di(r,e,t,n,i,o,a){if(o){let s=n.count;return t(e[i*2],e[i*2+1]),r[i]=n.count,n.count++,a.vertexLength++,s}else return r[i]}l(Di,"copyOrReuseVertex");function Uv(r,e,t,n,i,o){let a=[];for(let f=0;f<n.length/2;f++)a.push(-1);let s={count:0},u=0,c=r.getOrCreateLatestSegment(e,t),p=c.vertexLength;for(let f=2;f<i.length;f+=3){let y=i[f-2],m=i[f-1],h=i[f],d=a[y]<u,x=a[m]<u,b=a[h]<u,P=(d?1:0)+(x?1:0)+(b?1:0);c.vertexLength+P>me.MAX_VERTEX_ARRAY_LENGTH&&(c=r.createNewSegment(e,t),u=s.count,d=!0,x=!0,b=!0,p=0);let v=Di(a,n,o,s,y,d,c),S=Di(a,n,o,s,m,x,c),_=Di(a,n,o,s,h,b,c);t.emplaceBack(p+v-u,p+S-u,p+_-u),c.primitiveLength++}}l(Uv,"fillSegmentsTriangles");function $v(r,e,t,n,i,o){let a=[];for(let f=0;f<n.length/2;f++)a.push(-1);let s={count:0},u=0,c=r.getOrCreateLatestSegment(e,t),p=c.vertexLength;for(let f=0;f<i.length;f++){let y=i[f];for(let m=1;m<i[f].length;m+=2){let h=y[m-1],d=y[m],x=a[h]<u,b=a[d]<u,P=(x?1:0)+(b?1:0);c.vertexLength+P>me.MAX_VERTEX_ARRAY_LENGTH&&(c=r.createNewSegment(e,t),u=s.count,x=!0,b=!0,p=0);let v=Di(a,n,o,s,h,x,c),S=Di(a,n,o,s,d,b,c);t.emplaceBack(p+v-u,p+S-u),c.primitiveLength++}}}l($v,"fillSegmentsLines");var jv=500,mp=class mp{constructor(e){this.zoom=e.zoom,this.globalState=e.globalState,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 Ua,this.indexArray=new Be,this.indexArray2=new zt,this.programConfigurations=new Te(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,n){this.hasPattern=Jr("fill",this.layers,t);let i=this.layers[0].layout.get("fill-sort-key"),o=!i.isConstant(),a=[];for(let{feature:s,id:u,index:c,sourceLayerIndex:p}of e){let f=this.layers[0]._featureFilter.needGeometry,y=qe(s,f);if(!this.layers[0]._featureFilter.filter(new Z(this.zoom,{globalState:this.globalState}),y,n))continue;let m=o?i.evaluate(y,{},n,t.availableImages):void 0,h={id:u,properties:s.properties,type:s.type,sourceLayerIndex:p,index:c,geometry:f?y.geometry:Ce(s),patterns:{},sortKey:m};a.push(h)}o&&a.sort((s,u)=>s.sortKey-u.sortKey);for(let s of a){let{geometry:u,index:c,sourceLayerIndex:p}=s;if(this.hasPattern){let y=Yr("fill",this.layers,s,this.zoom,t);this.patternFeatures.push(y)}else this.addFeature(s,u,c,n,{},t.subdivisionGranularity);let f=e[c].feature;t.featureIndex.insert(f,u,c,p,this.index)}}update(e,t,n){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,t,this.stateDependentLayers,n)}addFeatures(e,t,n){for(let i of this.patternFeatures)this.addFeature(i,i.geometry,i.index,t,n,e.subdivisionGranularity)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,hh),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,n,i,o,a){for(let s of ur(t,jv)){let u=ys(s,i,a.fill.getGranularityForZoomLevel(i.z)),c=this.layoutVertexArray;ms((p,f)=>{c.emplaceBack(p,f)},this.segments,this.layoutVertexArray,this.indexArray,u.verticesFlattened,u.indicesTriangles,this.segments2,this.indexArray2,u.indicesLineList)}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,n,o,i)}};l(mp,"FillBucket");var Pr=mp;k("FillBucket",Pr,{omit:["layers","patternFeatures"]});g();var Ph,qv=l(()=>Ph=Ph||new ne({"fill-sort-key":new B(A.layout_fill["fill-sort-key"])}),"getLayout"),Sh,Wv=l(()=>Sh=Sh||new ne({"fill-antialias":new L(A.paint_fill["fill-antialias"]),"fill-opacity":new B(A.paint_fill["fill-opacity"]),"fill-color":new B(A.paint_fill["fill-color"]),"fill-outline-color":new B(A.paint_fill["fill-outline-color"]),"fill-translate":new L(A.paint_fill["fill-translate"]),"fill-translate-anchor":new L(A.paint_fill["fill-translate-anchor"]),"fill-pattern":new ht(A.paint_fill["fill-pattern"])}),"getPaint"),wh={get paint(){return Wv()},get layout(){return qv()}};var hp=class hp extends le{constructor(e){super(e,wh)}recalculate(e,t){super.recalculate(e,t);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(e){return new Pr(e)}queryRadius(){return Nt(this.paint.get("fill-translate"))}queryIntersectsFeature({queryGeometry:e,geometry:t,transform:n,pixelsToTileUnits:i}){let o=Ut(e,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),-n.bearingInRadians,i);return rs(o,t)}isTileClipped(){return!0}};l(hp,"FillStyleLayer");var hs=hp;g();g();g();var Xv=re([{name:"a_pos",components:2,type:"Int16"},{name:"a_normal_ed",components:4,type:"Int16"}],4),Ah=re([{name:"a_centroid",components:2,type:"Int16"}],4);var{members:_h,size:BT,alignment:RT}=Xv;var Mh=ee(jt(),1);var o1=Mh.default.VectorTileFeature.types,a1=500,bp=Math.pow(2,13);function Vi(r,e,t,n,i,o,a,s){r.emplaceBack(e,t,Math.floor(n*bp)*2+a,i*bp*2,o*bp*2,Math.round(s))}l(Vi,"addVertex");var xp=class xp{constructor(e){this.zoom=e.zoom,this.globalState=e.globalState,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 $a,this.centroidVertexArray=new Ga,this.indexArray=new Be,this.programConfigurations=new Te(e.layers,e.zoom),this.segments=new me,this.stateDependentLayerIds=this.layers.filter(t=>t.isStateDependent()).map(t=>t.id)}populate(e,t,n){this.features=[],this.hasPattern=Jr("fill-extrusion",this.layers,t);for(let{feature:i,id:o,index:a,sourceLayerIndex:s}of e){let u=this.layers[0]._featureFilter.needGeometry,c=qe(i,u);if(!this.layers[0]._featureFilter.filter(new Z(this.zoom,{globalState:this.globalState}),c,n))continue;let p={id:o,sourceLayerIndex:s,index:a,geometry:u?c.geometry:Ce(i),properties:i.properties,type:i.type,patterns:{}};this.hasPattern?this.features.push(Yr("fill-extrusion",this.layers,p,this.zoom,t)):this.addFeature(p,p.geometry,a,n,{},t.subdivisionGranularity),t.featureIndex.insert(i,p.geometry,a,s,this.index,!0)}}addFeatures(e,t,n){for(let i of this.features){let{geometry:o}=i;this.addFeature(i,o,i.index,t,n,e.subdivisionGranularity)}}update(e,t,n){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,t,this.stateDependentLayers,n)}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,_h),this.centroidVertexBuffer=e.createVertexBuffer(this.centroidVertexArray,Ah.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,n,i,o,a){for(let s of ur(t,a1)){let u={x:0,y:0,sampleCount:0},c=this.layoutVertexArray.length;this.processPolygon(u,i,e,s,a);let p=this.layoutVertexArray.length-c,f=Math.floor(u.x/u.sampleCount),y=Math.floor(u.y/u.sampleCount);for(let m=0;m<p;m++)this.centroidVertexArray.emplaceBack(f,y)}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,n,o,i)}processPolygon(e,t,n,i,o){if(i.length<1||Eh(i[0]))return;for(let f of i)f.length!==0&&s1(e,f);let a={segment:this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray)},s=o.fill.getGranularityForZoomLevel(t.z),u=o1[n.type]==="Polygon";for(let f of i){if(f.length===0||Eh(f))continue;let y=rt(f,s,u);this._generateSideFaces(y,a)}if(!u)return;let c=ys(i,t,s,!1),p=this.layoutVertexArray;ms((f,y)=>{Vi(p,f,y,0,0,1,1,0)},this.segments,this.layoutVertexArray,this.indexArray,c.verticesFlattened,c.indicesTriangles)}_generateSideFaces(e,t){let n=0;for(let i=1;i<e.length;i++){let o=e[i],a=e[i-1];if(l1(o,a))continue;t.segment.vertexLength+4>me.MAX_VERTEX_ARRAY_LENGTH&&(t.segment=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));let s=o.sub(a)._perp()._unit(),u=a.dist(o);n+u>32768&&(n=0),Vi(this.layoutVertexArray,o.x,o.y,s.x,s.y,0,0,n),Vi(this.layoutVertexArray,o.x,o.y,s.x,s.y,0,1,n),n+=u,Vi(this.layoutVertexArray,a.x,a.y,s.x,s.y,0,0,n),Vi(this.layoutVertexArray,a.x,a.y,s.x,s.y,0,1,n);let c=t.segment.vertexLength;this.indexArray.emplaceBack(c,c+2,c+1),this.indexArray.emplaceBack(c+1,c+2,c+3),t.segment.vertexLength+=4,t.segment.primitiveLength+=2}}};l(xp,"FillExtrusionBucket");var Sr=xp;function s1(r,e){for(let t=0;t<e.length;t++){let n=e[t];t===e.length-1&&e[0].x===n.x&&e[0].y===n.y||(r.x+=n.x,r.y+=n.y,r.sampleCount++)}}l(s1,"accumulatePointsToCentroid");k("FillExtrusionBucket",Sr,{omit:["layers","features"]});function l1(r,e){return r.x===e.x&&(r.x<0||r.x>8192)||r.y===e.y&&(r.y<0||r.y>8192)}l(l1,"isBoundaryEdge");function Eh(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)}l(Eh,"isEntirelyOutside");g();var Lh,u1=l(()=>Lh=Lh||new ne({"fill-extrusion-opacity":new L(A["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new B(A["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new L(A["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new L(A["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new ht(A["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new B(A["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new B(A["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new L(A["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])}),"getPaint"),Dh={get paint(){return u1()}};var gs=ee(de(),1);var vp=class vp extends le{constructor(e){super(e,Dh)}createBucket(e){return new Sr(e)}queryRadius(){return Nt(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}queryIntersectsFeature({queryGeometry:e,feature:t,featureState:n,geometry:i,transform:o,pixelsToTileUnits:a,pixelPosMatrix:s}){let u=Ut(e,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),-o.bearingInRadians,a),c=this.paint.get("fill-extrusion-height").evaluate(t,n),p=this.paint.get("fill-extrusion-base").evaluate(t,n),f=f1(u,s,0),y=p1(i,p,c,s),m=y[0],h=y[1];return c1(m,h,f)}};l(vp,"FillExtrusionStyleLayer");var bs=vp;function Bi(r,e){return r.x*e.x+r.y*e.y}l(Bi,"dot");function Vh(r,e){if(r.length===1){let t=0,n=e[t++],i;for(;!i||n.equals(i);)if(i=e[t++],!i)return 1/0;for(;t<e.length;t++){let o=e[t],a=r[0],s=i.sub(n),u=o.sub(n),c=a.sub(n),p=Bi(s,s),f=Bi(s,u),y=Bi(u,u),m=Bi(c,s),h=Bi(c,u),d=p*y-f*f,x=(y*m-f*h)/d,b=(p*h-f*m)/d,P=1-x-b,v=n.z*P+i.z*x+o.z*b;if(isFinite(v))return v}return 1/0}else{let t=1/0;for(let n of e)t=Math.min(t,n.z);return t}}l(Vh,"getIntersectionDistance");function c1(r,e,t){let n=1/0;rs(t,e)&&(n=Vh(t,e[0]));for(let i=0;i<e.length;i++){let o=e[i],a=r[i];for(let s=0;s<o.length-1;s++){let u=o[s],c=o[s+1],p=a[s],f=a[s+1],y=[u,c,f,p,u];Jm(t,y)&&(n=Math.min(n,Vh(t,y)))}}return n===1/0?!1:n}l(c1,"checkIntersection");function p1(r,e,t,n){let i=[],o=[],a=n[8]*e,s=n[9]*e,u=n[10]*e,c=n[11]*e,p=n[8]*t,f=n[9]*t,y=n[10]*t,m=n[11]*t;for(let h of r){let d=[],x=[];for(let b of h){let P=b.x,v=b.y,S=n[0]*P+n[4]*v+n[12],_=n[1]*P+n[5]*v+n[13],T=n[2]*P+n[6]*v+n[14],I=n[3]*P+n[7]*v+n[15],F=S+a,D=_+s,R=T+u,z=I+c,N=S+p,V=_+f,C=T+y,O=I+m,$=new gs.default(F/z,D/z);$.z=R/z,d.push($);let U=new gs.default(N/O,V/O);U.z=C/O,x.push(U)}i.push(d),o.push(x)}return[i,o]}l(p1,"projectExtrusion");function f1(r,e,t){let n=[];for(let i of r){let o=[i.x,i.y,t,1];Po.transformMat4(o,o,e),n.push(new gs.default(o[0]/o[3],o[1]/o[3]))}return n}l(f1,"projectQueryGeometry");g();g();g();var y1=re([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}],4),{members:Bh,size:LC,alignment:DC}=y1;g();var m1=re([{name:"a_uv_x",components:1,type:"Float32"},{name:"a_split_index",components:1,type:"Float32"}]),{members:Rh,size:zC,alignment:OC}=m1;var Gh=ee(jt(),1);var h1=Gh.default.VectorTileFeature.types,zh=63,d1=Math.cos(75/2*(Math.PI/180)),g1=15,b1=20,x1=15,Nh=1/2,Oh=Math.pow(2,x1-1)/Nh,Pp=class Pp{constructor(e){this.zoom=e.zoom,this.globalState=e.globalState,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 ja,this.layoutVertexArray2=new qa,this.indexArray=new Be,this.programConfigurations=new Te(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,n){this.hasPattern=Jr("line",this.layers,t);let i=this.layers[0].layout.get("line-sort-key"),o=!i.isConstant(),a=[];for(let{feature:s,id:u,index:c,sourceLayerIndex:p}of e){let f=this.layers[0]._featureFilter.needGeometry,y=qe(s,f);if(!this.layers[0]._featureFilter.filter(new Z(this.zoom,{globalState:this.globalState}),y,n))continue;let m=o?i.evaluate(y,{},n):void 0,h={id:u,properties:s.properties,type:s.type,sourceLayerIndex:p,index:c,geometry:f?y.geometry:Ce(s),patterns:{},sortKey:m};a.push(h)}o&&a.sort((s,u)=>s.sortKey-u.sortKey);for(let s of a){let{geometry:u,index:c,sourceLayerIndex:p}=s;if(this.hasPattern){let y=Yr("line",this.layers,s,this.zoom,t);this.patternFeatures.push(y)}else this.addFeature(s,u,c,n,{},t.subdivisionGranularity);let f=e[c].feature;t.featureIndex.insert(f,u,c,p,this.index)}}update(e,t,n){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,t,this.stateDependentLayers,n)}addFeatures(e,t,n){for(let i of this.patternFeatures)this.addFeature(i,i.geometry,i.index,t,n,e.subdivisionGranularity)}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,Rh)),this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Bh),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,n=+e.properties.mapbox_clip_end;return{start:t,end:n}}}addFeature(e,t,n,i,o,a){let s=this.layers[0].layout,u=s.get("line-join").evaluate(e,{}),c=s.get("line-cap"),p=s.get("line-miter-limit"),f=s.get("line-round-limit");this.lineClips=this.lineFeatureClips(e);for(let y of t)this.addLine(y,e,u,c,p,f,i,a);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,n,o,i)}addLine(e,t,n,i,o,a,s,u){this.distance=0,this.scaledDistance=0,this.totalDistance=0;let c=s?u.line.getGranularityForZoomLevel(s.z):1;if(e=rt(e,c),this.lineClips){this.lineClipsArray.push(this.lineClips);for(let S=0;S<e.length-1;S++)this.totalDistance+=e[S].dist(e[S+1]);this.updateScaledDistance(),this.maxLineLength=Math.max(this.maxLineLength,this.totalDistance)}let p=h1[t.type]==="Polygon",f=e.length;for(;f>=2&&e[f-1].equals(e[f-2]);)f--;let y=0;for(;y<f-1&&e[y].equals(e[y+1]);)y++;if(f<(p?3:2))return;n==="bevel"&&(o=1.05);let m=this.overscaling<=16?g1*8192/(512*this.overscaling):0,h=this.segments.prepareSegment(f*10,this.layoutVertexArray,this.indexArray),d,x,b,P,v;this.e1=this.e2=-1,p&&(d=e[f-2],v=e[y].sub(d)._unit()._perp());for(let S=y;S<f;S++){if(b=S===f-1?p?e[y+1]:void 0:e[S+1],b&&e[S].equals(b))continue;v&&(P=v),d&&(x=d),d=e[S],v=b?b.sub(d)._unit()._perp():P,P=P||v;let _=P.add(v);(_.x!==0||_.y!==0)&&_._unit();let T=P.x*v.x+P.y*v.y,I=_.x*v.x+_.y*v.y,F=I!==0?1/I:1/0,D=2*Math.sqrt(2-2*I),R=I<d1&&x&&b,z=P.x*v.y-P.y*v.x>0;if(R&&S>y){let C=d.dist(x);if(C>2*m){let O=d.sub(d.sub(x)._mult(m/C)._round());this.updateDistance(x,O),this.addCurrentVertex(O,P,0,0,h),x=O}}let N=x&&b,V=N?n:p?"butt":i;if(N&&V==="round"&&(F<a?V="miter":F<=2&&(V="fakeround")),V==="miter"&&F>o&&(V="bevel"),V==="bevel"&&(F>2&&(V="flipbevel"),F<o&&(V="miter")),x&&this.updateDistance(x,d),V==="miter")_._mult(F),this.addCurrentVertex(d,_,0,0,h);else if(V==="flipbevel"){if(F>100)_=v.mult(-1);else{let C=F*P.add(v).mag()/P.sub(v).mag();_._perp()._mult(C*(z?-1:1))}this.addCurrentVertex(d,_,0,0,h),this.addCurrentVertex(d,_.mult(-1),0,0,h)}else if(V==="bevel"||V==="fakeround"){let C=-Math.sqrt(F*F-1),O=z?C:0,$=z?0:C;if(x&&this.addCurrentVertex(d,P,O,$,h),V==="fakeround"){let U=Math.round(D*180/Math.PI/b1);for(let G=1;G<U;G++){let te=G/U;if(te!==.5){let oe=te-.5,ge=1.0904+T*(-3.2452+T*(3.55645-T*1.43519)),Zt=.848013+T*(-1.06021+T*.215638);te=te+te*oe*(te-1)*(ge*oe*oe+Zt)}let J=v.sub(P)._mult(te)._add(P)._unit()._mult(z?-1:1);this.addHalfVertex(d,J.x,J.y,!1,z,0,h)}}b&&this.addCurrentVertex(d,v,-O,-$,h)}else if(V==="butt")this.addCurrentVertex(d,_,0,0,h);else if(V==="square"){let C=x?1:-1;this.addCurrentVertex(d,_,C,C,h)}else V==="round"&&(x&&(this.addCurrentVertex(d,P,0,0,h),this.addCurrentVertex(d,P,1,1,h,!0)),b&&(this.addCurrentVertex(d,v,-1,-1,h,!0),this.addCurrentVertex(d,v,0,0,h)));if(R&&S<f-1){let C=d.dist(b);if(C>2*m){let O=d.add(b.sub(d)._mult(m/C)._round());this.updateDistance(d,O),this.addCurrentVertex(O,v,0,0,h),d=O}}}}addCurrentVertex(e,t,n,i,o,a=!1){let s=t.x+t.y*n,u=t.y-t.x*n,c=-t.x+t.y*i,p=-t.y-t.x*i;this.addHalfVertex(e,s,u,a,!1,n,o),this.addHalfVertex(e,c,p,a,!0,-i,o),this.distance>Oh/2&&this.totalDistance===0&&(this.distance=0,this.updateScaledDistance(),this.addCurrentVertex(e,t,n,i,o,a))}addHalfVertex({x:e,y:t},n,i,o,a,s,u){let p=(this.lineClips?this.scaledDistance*(Oh-1):this.scaledDistance)*Nh;if(this.layoutVertexArray.emplaceBack((e<<1)+(o?1:0),(t<<1)+(a?1:0),Math.round(zh*n)+128,Math.round(zh*i)+128,(s===0?0:s<0?-1:1)+1|(p&63)<<2,p>>6),this.lineClips){let y=this.scaledDistance-this.lineClips.start,m=this.lineClips.end-this.lineClips.start,h=y/m;this.layoutVertexArray2.emplaceBack(h,this.lineClipsArray.length)}let f=u.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,f,this.e2),u.primitiveLength++),a?this.e2=f:this.e1=f}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()}};l(Pp,"LineBucket");var wr=Pp;k("LineBucket",wr,{omit:["layers","patternFeatures"]});g();var Uh,v1=l(()=>Uh=Uh||new ne({"line-cap":new L(A.layout_line["line-cap"]),"line-join":new B(A.layout_line["line-join"]),"line-miter-limit":new L(A.layout_line["line-miter-limit"]),"line-round-limit":new L(A.layout_line["line-round-limit"]),"line-sort-key":new B(A.layout_line["line-sort-key"])}),"getLayout"),$h,P1=l(()=>$h=$h||new ne({"line-opacity":new B(A.paint_line["line-opacity"]),"line-color":new B(A.paint_line["line-color"]),"line-translate":new L(A.paint_line["line-translate"]),"line-translate-anchor":new L(A.paint_line["line-translate-anchor"]),"line-width":new B(A.paint_line["line-width"]),"line-gap-width":new B(A.paint_line["line-gap-width"]),"line-offset":new B(A.paint_line["line-offset"]),"line-blur":new B(A.paint_line["line-blur"]),"line-dasharray":new yr(A.paint_line["line-dasharray"]),"line-pattern":new ht(A.paint_line["line-pattern"]),"line-gradient":new dt(A.paint_line["line-gradient"])}),"getPaint"),Sp={get paint(){return P1()},get layout(){return v1()}};var Ap=class Ap extends B{possiblyEvaluate(e,t){return t=new Z(Math.floor(t.zoom),{now:t.now,fadeDuration:t.fadeDuration,zoomHistory:t.zoomHistory,transition:t.transition}),super.possiblyEvaluate(e,t)}evaluate(e,t,n,i){return t=xe({},t,{zoom:Math.floor(t.zoom)}),super.evaluate(e,t,n,i)}};l(Ap,"LineFloorwidthProperty");var wp=Ap,xs;var _p=class _p extends le{constructor(e){super(e,Sp),this.gradientVersion=0,xs||(xs=new wp(Sp.paint.properties["line-width"].specification),xs.useIntegerZoom=!0)}_handleSpecialPaintPropertyUpdate(e){if(e==="line-gradient"){let t=this.gradientExpression();Hy(t)?this.stepInterpolant=t._styleExpression.expression instanceof zr:this.stepInterpolant=!1,this.gradientVersion=(this.gradientVersion+1)%Number.MAX_SAFE_INTEGER}}gradientExpression(){return this._transitionablePaint._values["line-gradient"].value.expression}recalculate(e,t){super.recalculate(e,t),this.paint._values["line-floorwidth"]=xs.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,e)}createBucket(e){return new wr(e)}queryRadius(e){let t=e,n=jh(br("line-width",this,t),br("line-gap-width",this,t)),i=br("line-offset",this,t);return n/2+Math.abs(i)+Nt(this.paint.get("line-translate"))}queryIntersectsFeature({queryGeometry:e,feature:t,featureState:n,geometry:i,transform:o,pixelsToTileUnits:a}){let s=Ut(e,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),-o.bearingInRadians,a),u=a/2*jh(this.paint.get("line-width").evaluate(t,n),this.paint.get("line-gap-width").evaluate(t,n)),c=this.paint.get("line-offset").evaluate(t,n);return c&&(i=eh(i,c*a)),Km(s,i,u)}isTileClipped(){return!0}};l(_p,"LineStyleLayer");var vs=_p;function jh(r,e){return e>0?e+2*r:r}l(jh,"getLineWidth");g();g();g();var qh=re([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),Wh=re([{name:"a_projected_pos",components:3,type:"Float32"}],4),Ak=re([{name:"a_fade_opacity",components:1,type:"Uint32"}],4),Xh=re([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"},{name:"a_box_real",components:2,type:"Int16"}]),_k=re([{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"}]),Ip=re([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),Ik=re([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4),Tk=re([{name:"triangle",components:3,type:"Uint16"}]),Ck=re([{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"}]),kk=re([{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",name:"collisionCircleDiameter"},{type:"Uint16",name:"textAnchorOffsetStartIndex"},{type:"Uint16",name:"textAnchorOffsetEndIndex"}]),Fk=re([{type:"Float32",name:"offsetX"}]),Ek=re([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]),Mk=re([{type:"Uint16",name:"textAnchor"},{type:"Float32",components:2,name:"textOffset"}]);var qi=ee(de(),1);g();function S1(r,e,t){let n=e.layout.get("text-transform").evaluate(t,{});return n==="uppercase"?r=r.toLocaleUpperCase():n==="lowercase"&&(r=r.toLocaleLowerCase()),Ie.applyArabicShaping&&(r=Ie.applyArabicShaping(r)),r}l(S1,"transformTextInternal");function Hh(r,e,t){return r.sections.forEach(n=>{n.text=S1(n.text,e,t)}),r}l(Hh,"transformText");g();function Zh(r){let e={},t={},n=[],i=0;function o(c){n.push(r[c]),i++}l(o,"add");function a(c,p,f){let y=t[c];return delete t[c],t[p]=y,n[y].geometry[0].pop(),n[y].geometry[0]=n[y].geometry[0].concat(f[0]),y}l(a,"mergeFromRight");function s(c,p,f){let y=e[p];return delete e[p],e[c]=y,n[y].geometry[0].shift(),n[y].geometry[0]=f[0].concat(n[y].geometry[0]),y}l(s,"mergeFromLeft");function u(c,p,f){let y=f?p[0][p[0].length-1]:p[0][0];return"".concat(c,":").concat(y.x,":").concat(y.y)}l(u,"getKey");for(let c=0;c<r.length;c++){let p=r[c],f=p.geometry,y=p.text?p.text.toString():null;if(!y){o(c);continue}let m=u(y,f),h=u(y,f,!0);if(m in t&&h in e&&t[m]!==e[h]){let d=s(m,h,f),x=a(m,h,n[d].geometry);delete e[m],delete t[h],t[u(y,n[x].geometry,!0)]=x,n[d].geometry=null}else m in t?a(m,h,f):h in e?s(m,h,f):(o(c),e[m]=i-1,t[h]=i-1)}return n.filter(c=>c.geometry)}l(Zh,"mergeLines");g();g();var tn={"!":"\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 Jh(r){let e="";for(let t=0;t<r.length;t++){let n=r.charCodeAt(t+1)||null,i=r.charCodeAt(t-1)||null;(!n||!mu(n)||tn[r[t+1]])&&(!i||!mu(i)||tn[r[t-1]])&&tn[r[t]]?e+=tn[r[t]]:e+=r[t]}return e}l(Jh,"verticalizePunctuation");g();var ue=24;g();var G1=ee(Ri(),1);var N1=3;var ws=N1;g();g();g();function zi(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,u)=>u.h-s.h);let i=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(e/.95)),t),h:1/0}],o=0,a=0;for(let s of r)for(let u=i.length-1;u>=0;u--){let c=i[u];if(!(s.w>c.w||s.h>c.h)){if(s.x=c.x,s.y=c.y,a=Math.max(a,s.y+s.h),o=Math.max(o,s.x+s.w),s.w===c.w&&s.h===c.h){let p=i.pop();u<i.length&&(i[u]=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):(i.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:o,h:a,fill:e/(o*a)||0}}l(zi,"potpack");var be=1;var kp=class kp{constructor(e,{pixelRatio:t,version:n,stretchX:i,stretchY:o,content:a,textFitWidth:s,textFitHeight:u}){this.paddedRect=e,this.pixelRatio=t,this.stretchX=i,this.stretchY=o,this.content=a,this.version=n,this.textFitWidth=s,this.textFitHeight=u}get tl(){return[this.paddedRect.x+be,this.paddedRect.y+be]}get br(){return[this.paddedRect.x+this.paddedRect.w-be,this.paddedRect.y+this.paddedRect.h-be]}get tlbr(){return this.tl.concat(this.br)}get displaySize(){return[(this.paddedRect.w-be*2)/this.pixelRatio,(this.paddedRect.h-be*2)/this.pixelRatio]}};l(kp,"ImagePosition");var As=kp,Fp=class Fp{constructor(e,t){let n={},i={};this.haveRenderCallbacks=[];let o=[];this.addImages(e,n,o),this.addImages(t,i,o);let{w:a,h:s}=zi(o),u=new he({width:a||1,height:s||1});for(let c in e){let p=e[c],f=n[c].paddedRect;he.copy(p.data,u,{x:0,y:0},{x:f.x+be,y:f.y+be},p.data)}for(let c in t){let p=t[c],f=i[c].paddedRect,y=f.x+be,m=f.y+be,h=p.data.width,d=p.data.height;he.copy(p.data,u,{x:0,y:0},{x:y,y:m},p.data),he.copy(p.data,u,{x:0,y:d-1},{x:y,y:m-1},{width:h,height:1}),he.copy(p.data,u,{x:0,y:0},{x:y,y:m+d},{width:h,height:1}),he.copy(p.data,u,{x:h-1,y:0},{x:y-1,y:m},{width:1,height:d}),he.copy(p.data,u,{x:0,y:0},{x:y+h,y:m},{width:1,height:d})}this.image=u,this.iconPositions=n,this.patternPositions=i}addImages(e,t,n){for(let i in e){let o=e[i],a={x:0,y:0,w:o.data.width+2*be,h:o.data.height+2*be};n.push(a),t[i]=new As(a,o),o.hasRenderCallback&&this.haveRenderCallbacks.push(i)}}patchUpdatedImages(e,t){e.dispatchRenderCallbacks(this.haveRenderCallbacks);for(let n in e.updatedImages)this.patchUpdatedImage(this.iconPositions[n],e.getImage(n),t),this.patchUpdatedImage(this.patternPositions[n],e.getImage(n),t)}patchUpdatedImage(e,t,n){if(!e||!t||e.version===t.version)return;e.version=t.version;let[i,o]=e.tl;n.update(t.data,void 0,{x:i,y:o})}};l(Fp,"ImageAtlas");var Oi=Fp;k("ImagePosition",As);k("ImageAtlas",Oi);var Ts=(i=>(i[i.none=0]="none",i[i.horizontal=1]="horizontal",i[i.vertical=2]="vertical",i[i.horizontalOnly=3]="horizontalOnly",i))(Ts||{}),$i=-17;function U1(r){for(let e of r)if(e.positionedGlyphs.length!==0)return!1;return!0}l(U1,"isEmpty");var nd=57344,id=63743,Ni=class Ni{constructor(){this.scale=1,this.fontStack="",this.imageName=null,this.verticalAlign="bottom"}static forText(e,t,n){let i=new Ni;return i.scale=e||1,i.fontStack=t,i.verticalAlign=n||"bottom",i}static forImage(e,t){let n=new Ni;return n.imageName=e,n.verticalAlign=t||"bottom",n}};l(Ni,"SectionOptions");var _s=Ni,Ui=class Ui{constructor(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null}static fromFeature(e,t){let n=new Ui;for(let i=0;i<e.sections.length;i++){let o=e.sections[i];o.image?n.addImageSection(o):n.addTextSection(o,t)}return n}length(){return this.text.length}getSection(e){return this.sections[this.sectionIndex[e]]}getSectionIndex(e){return this.sectionIndex[e]}getCharCode(e){return this.text.charCodeAt(e)}verticalizePunctuation(){this.text=Jh(this.text)}trim(){let e=0;for(let n=0;n<this.text.length&&Is[this.text.charCodeAt(n)];n++)e++;let t=this.text.length;for(let n=this.text.length-1;n>=0&&n>=e&&Is[this.text.charCodeAt(n)];n--)t--;this.text=this.text.substring(e,t),this.sectionIndex=this.sectionIndex.slice(e,t)}substring(e,t){let n=new Ui;return n.text=this.text.substring(e,t),n.sectionIndex=this.sectionIndex.slice(e,t),n.sections=this.sections,n}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce((e,t)=>Math.max(e,this.sections[t].scale),0)}getMaxImageSize(e){let t=0,n=0;for(let i=0;i<this.length();i++){let o=this.getSection(i);if(o.imageName){let a=e[o.imageName];if(!a)continue;let s=a.displaySize;t=Math.max(t,s[0]),n=Math.max(n,s[1])}}return{maxImageWidth:t,maxImageHeight:n}}addTextSection(e,t){this.text+=e.text,this.sections.push(_s.forText(e.scale,e.fontStack||t,e.verticalAlign));let n=this.sections.length-1;for(let i=0;i<e.text.length;++i)this.sectionIndex.push(n)}addImageSection(e){let t=e.image?e.image.name:"";if(t.length===0){ye("Can't add FormattedSection with an empty image.");return}let n=this.getNextImageSectionCharCode();if(!n){ye("Reached maximum number of images ".concat(id-nd+2));return}this.text+=String.fromCharCode(n),this.sections.push(_s.forImage(t,e.verticalAlign)),this.sectionIndex.push(this.sections.length-1)}getNextImageSectionCharCode(){return this.imageSectionID?this.imageSectionID>=id?null:++this.imageSectionID:(this.imageSectionID=nd,this.imageSectionID)}};l(Ui,"TaggedString");var Gi=Ui;function $1(r,e){let t=[],n=r.text,i=0;for(let o of e)t.push(r.substring(i,o)),i=o;return i<n.length&&t.push(r.substring(i,n.length)),t}l($1,"breakLines");function ji(r,e,t,n,i,o,a,s,u,c,p,f,y,m,h){let d=Gi.fromFeature(r,i);f===2&&d.verticalizePunctuation();let x,{processBidirectionalText:b,processStyledBidirectionalText:P}=Ie;if(b&&d.sections.length===1){x=[];let _=b(d.toString(),Ep(d,c,o,e,n,m));for(let T of _){let I=new Gi;I.text=T,I.sections=d.sections;for(let F=0;F<T.length;F++)I.sectionIndex.push(0);x.push(I)}}else if(P){x=[];let _=P(d.text,d.sectionIndex,Ep(d,c,o,e,n,m));for(let T of _){let I=new Gi;I.text=T[0],I.sectionIndex=T[1],I.sections=d.sections,x.push(I)}}else x=$1(d,Ep(d,c,o,e,n,m));let v=[],S={positionedLines:v,text:d.toString(),top:p[1],bottom:p[1],left:p[0],right:p[0],writingMode:f,iconsInText:!1,verticalizable:!1};return Y1(S,e,t,n,x,a,s,u,f,c,y,h),U1(v)?!1:S}l(ji,"shapeText");var Is={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},j1={10:!0,32:!0,38:!0,41:!0,43:!0,45:!0,47:!0,173:!0,183:!0,8203:!0,8208:!0,8211:!0,8231:!0},q1={40:!0};function sd(r,e,t,n,i,o){if(e.imageName){let a=n[e.imageName];return a?a.displaySize[0]*e.scale*ue/o+i:0}else{let a=t[e.fontStack],s=a&&a[r];return s?s.metrics.advance*e.scale+i:0}}l(sd,"getGlyphAdvance");function W1(r,e,t,n,i,o){let a=0;for(let u=0;u<r.length();u++){let c=r.getSection(u);a+=sd(r.getCharCode(u),c,n,i,e,o)}let s=Math.max(1,Math.ceil(a/t));return a/s}l(W1,"determineAverageLineWidth");function od(r,e,t,n){let i=Math.pow(r-e,2);return n?r<e?i/2:i*2:i+Math.abs(t)*t}l(od,"calculateBadness");function X1(r,e,t){let n=0;return r===10&&(n-=1e4),t&&(n+=150),(r===40||r===65288)&&(n+=50),(e===41||e===65289)&&(n+=50),n}l(X1,"calculatePenalty");function ad(r,e,t,n,i,o){let a=null,s=od(e,t,i,o);for(let u of n){let c=e-u.x,p=od(c,t,i,o)+u.badness;p<=s&&(a=u,s=p)}return{index:r,x:e,priorBreak:a,badness:s}}l(ad,"evaluateBreak");function ld(r){return r?ld(r.priorBreak).concat(r.index):[]}l(ld,"leastBadBreaks");function Ep(r,e,t,n,i,o){if(!r)return[];let a=[],s=W1(r,e,t,n,i,o),u=r.text.indexOf("\u200B")>=0,c=0;for(let p=0;p<r.length();p++){let f=r.getSection(p),y=r.getCharCode(p);if(Is[y]||(c+=sd(y,f,n,i,e,o)),p<r.length()-1){let m=Lm(y);(j1[y]||m||f.imageName||p!==r.length()-2&&q1[r.getCharCode(p+1)])&&a.push(ad(p+1,c,s,a,X1(y,r.getCharCode(p+1),m&&u),!1))}}return ld(ad(r.length(),c,s,a,0,!0))}l(Ep,"determineLineBreaks");function ud(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}}l(ud,"getAnchorAlignment");function H1(r,e,t){let n=e.getMaxScale()*ue,{maxImageWidth:i,maxImageHeight:o}=e.getMaxImageSize(r),a=Math.max(n,o*t);return{verticalLineContentWidth:Math.max(n,i*t),horizontalLineContentHeight:a}}l(H1,"calculateLineContentSize");function cd(r){switch(r){case"top":return 0;case"center":return .5;default:return 1}}l(cd,"getVerticalAlignFactor");function Z1(r,e,t,n){if(r&&r.rect)return r;let i=e[t.fontStack],o=i&&i[n];return o?{rect:null,metrics:o.metrics}:null}l(Z1,"getRectAndMetrics");function J1(r,e,t){return!(r===1||!e&&!Ia(t)||e&&(Is[t]||Dm(t)))}l(J1,"isLineVertical");function Y1(r,e,t,n,i,o,a,s,u,c,p,f){let y=0,m=0,h=0,d=0,x=s==="right"?1:s==="left"?0:.5,b=ue/f,P=0;for(let _ of i){_.trim();let T=_.getMaxScale(),I={positionedGlyphs:[],lineOffset:0};r.positionedLines[P]=I;let F=I.positionedGlyphs,D=0;if(!_.length()){m+=o,++P;continue}let R=H1(n,_,b);for(let V=0;V<_.length();V++){let C=_.getSection(V),O=_.getSectionIndex(V),$=_.getCharCode(V),U=J1(u,p,$),G;if(C.imageName){if(r.iconsInText=!0,C.scale=C.scale*b,G=Q1(C,U,T,R,n),!G)continue;D=Math.max(D,G.imageOffset)}else if(G=K1(C,$,U,R,e,t),!G)continue;let{rect:te,metrics:J,baselineOffset:oe}=G;if(F.push({glyph:$,imageName:C.imageName,x:y,y:m+oe+$i,vertical:U,scale:C.scale,fontStack:C.fontStack,sectionIndex:O,metrics:J,rect:te}),!U)y+=J.advance*C.scale+c;else{r.verticalizable=!0;let ge=C.imageName?J.advance:ue;y+=ge*C.scale+c}}if(F.length!==0){let V=y-c;h=Math.max(V,h),eP(F,0,F.length-1,x)}y=0;let z=(T-1)*ue;I.lineOffset=Math.max(D,z);let N=o*T+D;m+=N,d=Math.max(N,d),++P}let{horizontalAlign:v,verticalAlign:S}=ud(a);tP(r.positionedLines,x,v,S,h,d,o,m,i.length),r.top+=-S*m,r.bottom=r.top+m,r.left+=-v*h,r.right=r.left+h}l(Y1,"shapeLines");function K1(r,e,t,n,i,o){let a=o[r.fontStack],s=a&&a[e],u=Z1(s,i,r,e);if(u===null)return null;let c;if(t)c=n.verticalLineContentWidth-r.scale*ue;else{let p=cd(r.verticalAlign);c=(n.horizontalLineContentHeight-r.scale*ue)*p}return{rect:u.rect,metrics:u.metrics,baselineOffset:c}}l(K1,"shapeTextSection");function Q1(r,e,t,n,i){let o=i[r.imageName];if(!o)return null;let a=o.paddedRect,s=o.displaySize,u={width:s[0],height:s[1],left:be,top:-ws,advance:e?s[1]:s[0]},c;if(e)c=n.verticalLineContentWidth-s[1]*r.scale;else{let f=cd(r.verticalAlign);c=(n.horizontalLineContentHeight-s[1]*r.scale)*f}let p=(e?s[0]:s[1])*r.scale-ue*t;return{rect:a,metrics:u,baselineOffset:c,imageOffset:p}}l(Q1,"shapeImageSection");function eP(r,e,t,n){if(n===0)return;let i=r[t],o=i.metrics.advance*i.scale,a=(r[t].x+o)*n;for(let s=e;s<=t;s++)r[s].x-=a}l(eP,"justifyLine");function tP(r,e,t,n,i,o,a,s,u){let c=(e-t)*i,p=0;o!==a?p=-s*n-$i:p=-n*u*a+.5*a;for(let f of r)for(let y of f.positionedGlyphs)y.x+=c,y.y+=p}l(tP,"align");function pd(r,e,t){let{horizontalAlign:n,verticalAlign:i}=ud(t),o=e[0],a=e[1],s=o-r.displaySize[0]*n,u=s+r.displaySize[0],c=a-r.displaySize[1]*i,p=c+r.displaySize[1];return{image:r,top:c,bottom:p,left:s,right:u}}l(pd,"shapeIcon");function Cs(r){var p,f;let e=r.left,t=r.top,n=r.right-e,i=r.bottom-t,o=r.image.content[2]-r.image.content[0],a=r.image.content[3]-r.image.content[1],s=(p=r.image.textFitWidth)!=null?p:"stretchOrShrink",u=(f=r.image.textFitHeight)!=null?f:"stretchOrShrink",c=o/a;if(u==="proportional"){if(s==="stretchOnly"&&n/i<c||s==="proportional"){let y=Math.ceil(i*c);e*=y/n,n=y}}else if(s==="proportional"&&u==="stretchOnly"&&c!==0&&n/i>c){let y=Math.ceil(n/c);t*=y/i,i=y}return{x1:e,y1:t,x2:e+n,y2:t+i}}l(Cs,"applyTextFit");function Mp(r,e,t,n,i,o){let a=r.image,s;if(a.content){let x=a.content,b=a.pixelRatio||1;s=[x[0]/b,x[1]/b,a.displaySize[0]-x[2]/b,a.displaySize[1]-x[3]/b]}let u=e.left*o,c=e.right*o,p,f,y,m;t==="width"||t==="both"?(m=i[0]+u-n[3],f=i[0]+c+n[1]):(m=i[0]+(u+c-a.displaySize[0])/2,f=m+a.displaySize[0]);let h=e.top*o,d=e.bottom*o;return t==="height"||t==="both"?(p=i[1]+h-n[0],y=i[1]+d+n[2]):(p=i[1]+(h+d-a.displaySize[1])/2,y=p+a.displaySize[1]),{image:a,top:p,right:f,bottom:y,left:m,collisionPadding:s}}l(Mp,"fitIconToText");var fd=ee(jt(),1);g();var on=255,qt=128,nt=on*qt;function Lp(r,e){let{expression:t}=e;if(t.kind==="constant")return{kind:"constant",layoutSize:t.evaluate(new Z(r+1))};if(t.kind==="source")return{kind:"source"};{let{zoomStops:n,interpolationType:i}=t,o=0;for(;o<n.length&&n[o]<=r;)o++;o=Math.max(0,o-1);let a=o;for(;a<n.length&&n[a]<r+1;)a++;a=Math.min(n.length-1,a);let s=n[o],u=n[a];if(t.kind==="composite")return{kind:"composite",minZoom:s,maxZoom:u,interpolationType:i};let c=t.evaluate(new Z(s)),p=t.evaluate(new Z(u));return{kind:"camera",minZoom:s,maxZoom:u,minSize:c,maxSize:p,interpolationType:i}}}l(Lp,"getSizeData");g();function Dp(r,e,t){let n="never",i=r.get(e);return i?n=i:r.get(t)&&(n="always"),n}l(Dp,"getOverlapMode");var rP=fd.default.VectorTileFeature.types,nP=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function ks(r,e,t,n,i,o,a,s,u,c,p,f,y){let m=s?Math.min(nt,Math.round(s[0])):0,h=s?Math.min(nt,Math.round(s[1])):0;r.emplaceBack(e,t,Math.round(n*32),Math.round(i*32),o,a,(m<<1)+(u?1:0),h,c*16,p*16,f*256,y*256)}l(ks,"addVertex");function yd(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)}l(yd,"addDynamicAttributes");function iP(r){for(let e of r.sections)if(Bm(e.text))return!0;return!1}l(iP,"containsRTLText");var Vp=class Vp{constructor(e){this.layoutVertexArray=new Wa,this.indexArray=new Be,this.programConfigurations=e,this.segments=new me,this.dynamicLayoutVertexArray=new Xa,this.opacityVertexArray=new Ha,this.hasVisibleVertices=!1,this.placedSymbolArray=new yi}isEmpty(){return this.layoutVertexArray.length===0&&this.indexArray.length===0&&this.dynamicLayoutVertexArray.length===0&&this.opacityVertexArray.length===0}upload(e,t,n,i){this.isEmpty()||(n&&(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,qh.members),this.indexBuffer=e.createIndexBuffer(this.indexArray,t),this.dynamicLayoutVertexBuffer=e.createVertexBuffer(this.dynamicLayoutVertexArray,Wh.members,!0),this.opacityVertexBuffer=e.createVertexBuffer(this.opacityVertexArray,nP,!0),this.opacityVertexBuffer.itemSize=1),(n||i)&&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())}};l(Vp,"SymbolBuffers");var Wi=Vp;k("SymbolBuffers",Wi);var Bp=class Bp{constructor(e,t,n){this.layoutVertexArray=new e,this.layoutAttributes=t,this.indexArray=new n,this.segments=new me,this.collisionVertexArray=new Za}upload(e){this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=e.createVertexBuffer(this.collisionVertexArray,Xh.members,!0)}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy())}};l(Bp,"CollisionBuffers");var Xi=Bp;k("CollisionBuffers",Xi);var Rp=class Rp{constructor(e){this.collisionBoxArray=e.collisionBoxArray,this.zoom=e.zoom,this.globalState=e.globalState,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(u=>u.id),this.index=e.index,this.pixelRatio=e.pixelRatio,this.sourceLayerIndex=e.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.sortKeyRanges=[],this.collisionCircleArray=[];let n=this.layers[0]._unevaluatedLayout._values;this.textSizeData=Lp(this.zoom,n["text-size"]),this.iconSizeData=Lp(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=Dp(i,"text-overlap","text-allow-overlap")!=="never"||Dp(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(u=>Ts[u])),this.stateDependentLayerIds=this.layers.filter(u=>u.isStateDependent()).map(u=>u.id),this.sourceID=e.sourceID}createArrays(){this.text=new Wi(new Te(this.layers,this.zoom,e=>/^text/.test(e))),this.icon=new Wi(new Te(this.layers,this.zoom,e=>/^icon/.test(e))),this.glyphOffsetArray=new hi,this.lineVertexArray=new di,this.symbolInstances=new mi,this.textAnchorOffsets=new gi}calculateGlyphDependencies(e,t,n,i,o){for(let a=0;a<e.length;a++)if(t[e.charCodeAt(a)]=!0,(n||i)&&o){let s=tn[e.charAt(a)];s&&(t[s.charCodeAt(0)]=!0)}}populate(e,t,n){let i=this.layers[0],o=i.layout,a=o.get("text-font"),s=o.get("text-field"),u=o.get("icon-image"),c=(s.value.kind!=="constant"||s.value.value instanceof Le&&!s.value.value.isEmpty()||s.value.value.toString().length>0)&&(a.value.kind!=="constant"||a.value.value.length>0),p=u.value.kind!=="constant"||!!u.value.value||Object.keys(u.parameters).length>0,f=o.get("symbol-sort-key");if(this.features=[],!c&&!p)return;let y=t.iconDependencies,m=t.glyphDependencies,h=t.availableImages,d=new Z(this.zoom,{globalState:this.globalState});for(let{feature:x,id:b,index:P,sourceLayerIndex:v}of e){let S=i._featureFilter.needGeometry,_=qe(x,S);if(!i._featureFilter.filter(d,_,n))continue;S||(_.geometry=Ce(x));let T;if(c){let R=i.getValueAndResolveTokens("text-field",_,n,h),z=Le.factory(R),N=this.hasRTLText=this.hasRTLText||iP(z);(!N||Ie.getRTLTextPluginStatus()==="unavailable"||N&&Ie.isParsed())&&(T=Hh(z,i,_))}let I;if(p){let R=i.getValueAndResolveTokens("icon-image",_,n,h);R instanceof _e?I=R:I=_e.fromString(R)}if(!T&&!I)continue;let F=this.sortFeaturesByKey?f.evaluate(_,{},n):void 0,D={id:b,text:T,icon:I,index:P,sourceLayerIndex:v,geometry:_.geometry,properties:x.properties,type:rP[x.type],sortKey:F};if(this.features.push(D),I&&(y[I.name]=!0),T){let R=a.evaluate(_,{},n).join(","),z=o.get("text-rotation-alignment")!=="viewport"&&o.get("symbol-placement")!=="point";this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(2)>=0;for(let N of T.sections)if(N.image)y[N.image.name]=!0;else{let V=Hn(T.toString()),C=N.fontStack||R,O=m[C]=m[C]||{};this.calculateGlyphDependencies(N.text,O,z,this.allowVerticalPlacement,V)}}}o.get("symbol-placement")==="line"&&(this.features=Zh(this.features)),this.sortFeaturesByKey&&this.features.sort((x,b)=>x.sortKey-b.sortKey)}update(e,t,n){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(e,t,this.layers,n),this.icon.programConfigurations.updatePaintArrays(e,t,this.layers,n))}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 n=this.lineVertexArray.length;if(e.segment!==void 0){let i=e.dist(t[e.segment+1]),o=e.dist(t[e.segment]),a={};for(let s=e.segment+1;s<t.length;s++)a[s]={x:t[s].x,y:t[s].y,tileUnitDistanceFromAnchor:i},s<t.length-1&&(i+=t[s+1].dist(t[s]));for(let s=e.segment||0;s>=0;s--)a[s]={x:t[s].x,y:t[s].y,tileUnitDistanceFromAnchor:o},s>0&&(o+=t[s-1].dist(t[s]));for(let s=0;s<t.length;s++){let u=a[s];this.lineVertexArray.emplaceBack(u.x,u.y,u.tileUnitDistanceFromAnchor)}}return{lineStartIndex:n,lineLength:this.lineVertexArray.length-n}}addSymbols(e,t,n,i,o,a,s,u,c,p,f,y){let m=e.indexArray,h=e.layoutVertexArray,d=e.segments.prepareSegment(4*t.length,h,m,this.canOverlap?a.sortKey:void 0),x=this.glyphOffsetArray.length,b=d.vertexLength,P=this.allowVerticalPlacement&&s===2?Math.PI/2:0,v=a.text&&a.text.sections;for(let S=0;S<t.length;S++){let{tl:_,tr:T,bl:I,br:F,tex:D,pixelOffsetTL:R,pixelOffsetBR:z,minFontScaleX:N,minFontScaleY:V,glyphOffset:C,isSDF:O,sectionIndex:$}=t[S],U=d.vertexLength,G=C[1];ks(h,u.x,u.y,_.x,G+_.y,D.x,D.y,n,O,R.x,R.y,N,V),ks(h,u.x,u.y,T.x,G+T.y,D.x+D.w,D.y,n,O,z.x,R.y,N,V),ks(h,u.x,u.y,I.x,G+I.y,D.x,D.y+D.h,n,O,R.x,z.y,N,V),ks(h,u.x,u.y,F.x,G+F.y,D.x+D.w,D.y+D.h,n,O,z.x,z.y,N,V),yd(e.dynamicLayoutVertexArray,u,P),m.emplaceBack(U,U+2,U+1),m.emplaceBack(U+1,U+2,U+3),d.vertexLength+=4,d.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(C[0]),(S===t.length-1||$!==t[S+1].sectionIndex)&&e.programConfigurations.populatePaintArrays(h.length,a,a.index,{},y,v&&v[$])}e.placedSymbolArray.emplaceBack(u.x,u.y,x,this.glyphOffsetArray.length-x,b,c,p,u.segment,n?n[0]:0,n?n[1]:0,i[0],i[1],s,0,!1,0,f)}_addCollisionDebugVertex(e,t,n,i,o,a){return t.emplaceBack(0,0),e.emplaceBack(n.x,n.y,i,o,Math.round(a.x),Math.round(a.y))}addCollisionDebugVertices(e,t,n,i,o,a,s){let u=o.segments.prepareSegment(4,o.layoutVertexArray,o.indexArray),c=u.vertexLength,p=o.layoutVertexArray,f=o.collisionVertexArray,y=s.anchorX,m=s.anchorY;this._addCollisionDebugVertex(p,f,a,y,m,new qi.default(e,t)),this._addCollisionDebugVertex(p,f,a,y,m,new qi.default(n,t)),this._addCollisionDebugVertex(p,f,a,y,m,new qi.default(n,i)),this._addCollisionDebugVertex(p,f,a,y,m,new qi.default(e,i)),u.vertexLength+=4;let h=o.indexArray;h.emplaceBack(c,c+1),h.emplaceBack(c+1,c+2),h.emplaceBack(c+2,c+3),h.emplaceBack(c+3,c),u.primitiveLength+=4}addDebugCollisionBoxes(e,t,n,i){for(let o=e;o<t;o++){let a=this.collisionBoxArray.get(o),s=a.x1,u=a.y1,c=a.x2,p=a.y2;this.addCollisionDebugVertices(s,u,c,p,i?this.textCollisionBox:this.iconCollisionBox,a.anchorPoint,n)}}generateCollisionDebugBuffers(){this.hasDebugData()&&this.destroyDebugData(),this.textCollisionBox=new Xi(xi,Ip.members,zt),this.iconCollisionBox=new Xi(xi,Ip.members,zt);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,n,i,o,a,s,u,c){let p={};for(let f=t;f<n;f++){let y=e.get(f);p.textBox={x1:y.x1,y1:y.y1,x2:y.x2,y2:y.y2,anchorPointX:y.anchorPointX,anchorPointY:y.anchorPointY},p.textFeatureIndex=y.featureIndex;break}for(let f=i;f<o;f++){let y=e.get(f);p.verticalTextBox={x1:y.x1,y1:y.y1,x2:y.x2,y2:y.y2,anchorPointX:y.anchorPointX,anchorPointY:y.anchorPointY},p.verticalTextFeatureIndex=y.featureIndex;break}for(let f=a;f<s;f++){let y=e.get(f);p.iconBox={x1:y.x1,y1:y.y1,x2:y.x2,y2:y.y2,anchorPointX:y.anchorPointX,anchorPointY:y.anchorPointY},p.iconFeatureIndex=y.featureIndex;break}for(let f=u;f<c;f++){let y=e.get(f);p.verticalIconBox={x1:y.x1,y1:y.y1,x2:y.x2,y2:y.y2,anchorPointX:y.anchorPointX,anchorPointY:y.anchorPointY},p.verticalIconFeatureIndex=y.featureIndex;break}return p}deserializeCollisionBoxes(e){this.collisionArrays=[];for(let t=0;t<this.symbolInstances.length;t++){let n=this.symbolInstances.get(t);this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(e,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(e,t){let n=e.placedSymbolArray.get(t),i=n.vertexStartIndex+n.numGlyphs*4;for(let o=n.vertexStartIndex;o<i;o+=4)e.indexArray.emplaceBack(o,o+2,o+1),e.indexArray.emplaceBack(o+1,o+2,o+3)}getSortedSymbolIndexes(e){if(this.sortedAngle===e&&this.symbolInstanceIndexes!==void 0)return this.symbolInstanceIndexes;let t=Math.sin(e),n=Math.cos(e),i=[],o=[],a=[];for(let s=0;s<this.symbolInstances.length;++s){a.push(s);let u=this.symbolInstances.get(s);i.push(Math.round(t*u.anchorX+n*u.anchorY)|0),o.push(u.featureIndex)}return a.sort((s,u)=>i[s]-i[u]||o[u]-o[s]),a}addToSortKeyRanges(e,t){let n=this.sortKeyRanges[this.sortKeyRanges.length-1];n&&n.sortKey===t?n.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 n=this.symbolInstances.get(t);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)}}};l(Rp,"SymbolBucket");var Ye=Rp;k("SymbolBucket",Ye,{omit:["layers","collisionBoxArray","features","compareText"]});Ye.MAX_GLYPHS=65535;Ye.addDynamicAttributes=yd;g();function md(r,e){return e.replace(/{([^{}]+)}/g,(t,n)=>r&&n in r?String(r[n]):"")}l(md,"resolveTokens");g();var hd,oP=l(()=>hd=hd||new ne({"symbol-placement":new L(A.layout_symbol["symbol-placement"]),"symbol-spacing":new L(A.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new L(A.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new B(A.layout_symbol["symbol-sort-key"]),"symbol-z-order":new L(A.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new L(A.layout_symbol["icon-allow-overlap"]),"icon-overlap":new L(A.layout_symbol["icon-overlap"]),"icon-ignore-placement":new L(A.layout_symbol["icon-ignore-placement"]),"icon-optional":new L(A.layout_symbol["icon-optional"]),"icon-rotation-alignment":new L(A.layout_symbol["icon-rotation-alignment"]),"icon-size":new B(A.layout_symbol["icon-size"]),"icon-text-fit":new L(A.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new L(A.layout_symbol["icon-text-fit-padding"]),"icon-image":new B(A.layout_symbol["icon-image"]),"icon-rotate":new B(A.layout_symbol["icon-rotate"]),"icon-padding":new B(A.layout_symbol["icon-padding"]),"icon-keep-upright":new L(A.layout_symbol["icon-keep-upright"]),"icon-offset":new B(A.layout_symbol["icon-offset"]),"icon-anchor":new B(A.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new L(A.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new L(A.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new L(A.layout_symbol["text-rotation-alignment"]),"text-field":new B(A.layout_symbol["text-field"]),"text-font":new B(A.layout_symbol["text-font"]),"text-size":new B(A.layout_symbol["text-size"]),"text-max-width":new B(A.layout_symbol["text-max-width"]),"text-line-height":new L(A.layout_symbol["text-line-height"]),"text-letter-spacing":new B(A.layout_symbol["text-letter-spacing"]),"text-justify":new B(A.layout_symbol["text-justify"]),"text-radial-offset":new B(A.layout_symbol["text-radial-offset"]),"text-variable-anchor":new L(A.layout_symbol["text-variable-anchor"]),"text-variable-anchor-offset":new B(A.layout_symbol["text-variable-anchor-offset"]),"text-anchor":new B(A.layout_symbol["text-anchor"]),"text-max-angle":new L(A.layout_symbol["text-max-angle"]),"text-writing-mode":new L(A.layout_symbol["text-writing-mode"]),"text-rotate":new B(A.layout_symbol["text-rotate"]),"text-padding":new L(A.layout_symbol["text-padding"]),"text-keep-upright":new L(A.layout_symbol["text-keep-upright"]),"text-transform":new B(A.layout_symbol["text-transform"]),"text-offset":new B(A.layout_symbol["text-offset"]),"text-allow-overlap":new L(A.layout_symbol["text-allow-overlap"]),"text-overlap":new L(A.layout_symbol["text-overlap"]),"text-ignore-placement":new L(A.layout_symbol["text-ignore-placement"]),"text-optional":new L(A.layout_symbol["text-optional"])}),"getLayout"),dd,aP=l(()=>dd=dd||new ne({"icon-opacity":new B(A.paint_symbol["icon-opacity"]),"icon-color":new B(A.paint_symbol["icon-color"]),"icon-halo-color":new B(A.paint_symbol["icon-halo-color"]),"icon-halo-width":new B(A.paint_symbol["icon-halo-width"]),"icon-halo-blur":new B(A.paint_symbol["icon-halo-blur"]),"icon-translate":new L(A.paint_symbol["icon-translate"]),"icon-translate-anchor":new L(A.paint_symbol["icon-translate-anchor"]),"text-opacity":new B(A.paint_symbol["text-opacity"]),"text-color":new B(A.paint_symbol["text-color"],{runtimeType:Ue,getOverride:l(r=>r.textColor,"getOverride"),hasOverride:l(r=>!!r.textColor,"hasOverride")}),"text-halo-color":new B(A.paint_symbol["text-halo-color"]),"text-halo-width":new B(A.paint_symbol["text-halo-width"]),"text-halo-blur":new B(A.paint_symbol["text-halo-blur"]),"text-translate":new L(A.paint_symbol["text-translate"]),"text-translate-anchor":new L(A.paint_symbol["text-translate-anchor"])}),"getPaint"),Fs={get paint(){return aP()},get layout(){return oP()}};g();var zp=class zp{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:Gr,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}};l(zp,"FormatSectionOverride");var Hi=zp;k("FormatSectionOverride",Hi,{omit:["defaultValue"]});var Zi=class Zi extends le{constructor(e){super(e,Fs)}recalculate(e,t){if(super.recalculate(e,t),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 i=[];for(let o of n)i.indexOf(o)<0&&i.push(o);this.layout._values["text-writing-mode"]=i}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()}getValueAndResolveTokens(e,t,n,i){let o=this.layout.get(e).evaluate(t,{},n,i),a=this._unevaluatedLayout._values[e];return!a.isDataDriven()&&!qn(a.value)&&o?md(t.properties,o):o}createBucket(e){return new Ye(e)}queryRadius(){return 0}queryIntersectsFeature(){throw new Error("Should take a different path in FeatureIndex")}_setPaintOverrides(){for(let e of Fs.paint.overridableProperties){if(!Zi.hasPaintOverride(this.layout,e))continue;let t=this.paint.get(e),n=new Hi(t),i=new ar(n,t.property.specification),o=null;t.value.kind==="constant"||t.value.kind==="source"?o=new et("source",i):o=new Lt("composite",i,t.value.zoomStops),this.paint._values[e]=new ve(t.property,o,t.parameters)}}_handleOverridablePaintPropertyUpdate(e,t,n){return!this.layout||t.isDataDriven()||n.isDataDriven()?!1:Zi.hasPaintOverride(this.layout,e)}static hasPaintOverride(e,t){let n=e.get("text-field"),i=Fs.paint.properties[t],o=!1,a=l(s=>{for(let u of s)if(i.overrides&&i.overrides.hasOverride(u)){o=!0;return}},"checkSections");if(n.value.kind==="constant"&&n.value.value instanceof Le)a(n.value.value.sections);else if(n.value.kind==="source"){let s=l(c=>{if(!o)if(c instanceof Et&&fe(c.value)===Nr){let p=c.value;a(p.sections)}else c instanceof Ln?a(c.sections):c.eachChild(s)},"checkExpression"),u=n.value;u._styleExpression&&s(u._styleExpression.expression)}return o}};l(Zi,"SymbolStyleLayer");var Es=Zi;function gd(r,e,t,n=1){let i=r.get("icon-padding").evaluate(e,{},t),o=i&&i.values;return[o[0]*n,o[1]*n,o[2]*n,o[3]*n]}l(gd,"getIconPadding");g();g();var bd,sP=l(()=>bd=bd||new ne({"background-color":new L(A.paint_background["background-color"]),"background-pattern":new yr(A.paint_background["background-pattern"]),"background-opacity":new L(A.paint_background["background-opacity"])}),"getPaint"),xd={get paint(){return sP()}};var Op=class Op extends le{constructor(e){super(e,xd)}};l(Op,"BackgroundStyleLayer");var Ms=Op;g();g();var vd,lP=l(()=>vd=vd||new ne({"raster-opacity":new L(A.paint_raster["raster-opacity"]),"raster-hue-rotate":new L(A.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new L(A.paint_raster["raster-brightness-min"]),"raster-brightness-max":new L(A.paint_raster["raster-brightness-max"]),"raster-saturation":new L(A.paint_raster["raster-saturation"]),"raster-contrast":new L(A.paint_raster["raster-contrast"]),"raster-resampling":new L(A.paint_raster["raster-resampling"]),"raster-fade-duration":new L(A.paint_raster["raster-fade-duration"])}),"getPaint"),Pd={get paint(){return lP()}};var Gp=class Gp extends le{constructor(e){super(e,Pd)}};l(Gp,"RasterStyleLayer");var Ls=Gp;g();var Np=class Np extends le{constructor(t){super(t,{});this.onAdd=l(t=>{this.implementation.onAdd&&this.implementation.onAdd(t,t.painter.context.gl)},"onAdd");this.onRemove=l(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")}};l(Np,"CustomStyleLayer");var Ds=Np;function Sd(r){if(r.type==="custom")return new Ds(r);switch(r.type){case"background":return new Ms(r);case"circle":return new is(r);case"color-relief":return new us(r);case"fill":return new hs(r);case"fill-extrusion":return new bs(r);case"heatmap":return new ss(r);case"hillshade":return new ls(r);case"line":return new vs(r);case"raster":return new Ls(r);case"symbol":return new Es(r)}}l(Sd,"createStyleLayer");var Up=class Up{constructor(e){this.keyCache={},e&&this.replace(e)}replace(e){this._layerConfigs={},this._layers={},this.update(e,[])}update(e,t){for(let i of e){this._layerConfigs[i.id]=i;let o=this._layers[i.id]=Sd(i);o._featureFilter=Dt(o.filter),this.keyCache[i.id]&&delete this.keyCache[i.id]}for(let i of t)delete this.keyCache[i],delete this._layerConfigs[i],delete this._layers[i];this.familiesBySource={};let n=Ky(Object.values(this._layerConfigs),this.keyCache);for(let i of n){let o=i.map(f=>this._layers[f.id]),a=o[0];if(a.visibility==="none")continue;let s=a.source||"",u=this.familiesBySource[s];u||(u=this.familiesBySource[s]={});let c=a.sourceLayer||"_geojsonTileLayer",p=u[c];p||(p=u[c]=[]),p.push(o)}}};l(Up,"StyleLayerIndex");var Vs=Up;g();var Xd=ee(jt(),1),Hd=ee(Ri(),1);g();g();g();var $p=class $p{constructor(e){this._stringToNumber={},this._numberToString=[];for(let t=0;t<e.length;t++){let n=e[t];this._stringToNumber[n]=t,this._numberToString[t]=n}}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]}};l($p,"DictionaryCoder");var an=$p;var Ad=ee(jt(),1),_d=ee(Ri(),1);g();var jp=class jp{constructor(e,t,n,i,o){this.type="Feature",this._vectorTileFeature=e,e._z=t,e._x=n,e._y=i,this.properties=e.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(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}};l(jp,"GeoJSONFeature");var Bs=jp;g();var Ji=ee(de(),1);var Yi=class Yi{constructor(){this.minX=1/0;this.maxX=-1/0;this.minY=1/0;this.maxY=-1/0}extend(e){return this.minX=Math.min(this.minX,e.x),this.minY=Math.min(this.minY,e.y),this.maxX=Math.max(this.maxX,e.x),this.maxY=Math.max(this.maxY,e.y),this}expandBy(e){return this.minX-=e,this.minY-=e,this.maxX+=e,this.maxY+=e,(this.minX>this.maxX||this.minY>this.maxY)&&(this.minX=1/0,this.maxX=-1/0,this.minY=1/0,this.maxY=-1/0),this}shrinkBy(e){return this.expandBy(-e)}map(e){let t=new Yi;return t.extend(e(new Ji.default(this.minX,this.minY))),t.extend(e(new Ji.default(this.maxX,this.minY))),t.extend(e(new Ji.default(this.minX,this.maxY))),t.extend(e(new Ji.default(this.maxX,this.maxY))),t}static fromPoints(e){let t=new Yi;for(let n of e)t.extend(n);return t}contains(e){return e.x>=this.minX&&e.x<=this.maxX&&e.y>=this.minY&&e.y<=this.maxY}empty(){return this.minX>this.maxX}width(){return this.maxX-this.minX}height(){return this.maxY-this.minY}covers(e){return!this.empty()&&!e.empty()&&e.minX>=this.minX&&e.maxX<=this.maxX&&e.minY>=this.minY&&e.maxY<=this.maxY}intersects(e){return!this.empty()&&!e.empty()&&e.minX<=this.maxX&&e.maxX>=this.minX&&e.minY<=this.maxY&&e.maxY>=this.minY}};l(Yi,"Bounds");var Ar=Yi;var qp=class qp{constructor(e,t){this.tileID=e,this.x=e.canonical.x,this.y=e.canonical.y,this.z=e.canonical.z,this.grid=new Yt(8192,16,0),this.grid3D=new Yt(8192,16,0),this.featureIndexArray=new bi,this.promoteId=t}insert(e,t,n,i,o,a){let s=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(n,i,o);let u=a?this.grid3D:this.grid;for(let c=0;c<t.length;c++){let p=t[c],f=[1/0,1/0,-1/0,-1/0];for(let y=0;y<p.length;y++){let m=p[y];f[0]=Math.min(f[0],m.x),f[1]=Math.min(f[1],m.y),f[2]=Math.max(f[2],m.x),f[3]=Math.max(f[3],m.y)}f[0]<8192&&f[1]<8192&&f[2]>=0&&f[3]>=0&&u.insert(s,f[0],f[1],f[2],f[3])}}loadVTLayers(){return this.vtLayers||(this.vtLayers=new Ad.default.VectorTile(new _d.default(this.rawTileData)).layers,this.sourceLayerCoder=new an(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers}query(e,t,n,i){this.loadVTLayers();let o=e.params,a=8192/e.tileSize/e.scale,s=Dt(o.filter),u=e.queryGeometry,c=e.queryPadding*a,p=Ar.fromPoints(u),f=this.grid.query(p.minX-c,p.minY-c,p.maxX+c,p.maxY+c),y=Ar.fromPoints(e.cameraQueryGeometry).expandBy(c),m=this.grid3D.query(y.minX,y.minY,y.maxX,y.maxY,(x,b,P,v)=>Qm(e.cameraQueryGeometry,x-c,b-c,P+c,v+c));for(let x of m)f.push(x);f.sort(uP);let h={},d;for(let x=0;x<f.length;x++){let b=f[x];if(b===d)continue;d=b;let P=this.featureIndexArray.get(b),v=null;this.loadMatchingFeature(h,P.bucketIndex,P.sourceLayerIndex,P.featureIndex,s,o.layers,o.availableImages,t,n,i,(S,_,T)=>(v||(v=Ce(S)),_.queryIntersectsFeature({queryGeometry:u,feature:S,featureState:T,geometry:v,zoom:this.z,transform:e.transform,pixelsToTileUnits:a,pixelPosMatrix:e.pixelPosMatrix,unwrappedTileID:this.tileID.toUnwrapped(),getElevation:e.getElevation})))}return h}loadMatchingFeature(e,t,n,i,o,a,s,u,c,p,f){let y=this.bucketLayerIDs[t];if(a&&!y.some(b=>a.has(b)))return;let m=this.sourceLayerCoder.decode(n),d=this.vtLayers[m].feature(i);if(o.needGeometry){let b=qe(d,!0);if(!o.filter(new Z(this.tileID.overscaledZ),b,this.tileID.canonical))return}else if(!o.filter(new Z(this.tileID.overscaledZ),d))return;let x=this.getId(d,m);for(let b=0;b<y.length;b++){let P=y[b];if(a&&!a.has(P))continue;let v=u[P];if(!v)continue;let S={};x&&p&&(S=p.getState(v.sourceLayer||"_geojsonTileLayer",x));let _=xe({},c[P]);_.paint=wd(_.paint,v.paint,d,S,s),_.layout=wd(_.layout,v.layout,d,S,s);let T=!f||f(d,v,S);if(!T)continue;let I=new Bs(d,this.z,this.x,this.y,x);I.layer=_;let F=e[P];F===void 0&&(F=e[P]=[]),F.push({featureIndex:i,feature:I,intersectionZ:T})}}lookupSymbolFeatures(e,t,n,i,o,a,s,u){let c={};this.loadVTLayers();let p=Dt(o);for(let f of e)this.loadMatchingFeature(c,n,i,f,p,a,s,u,t);return c}hasLayer(e){for(let t of this.bucketLayerIDs)for(let n of t)if(e===n)return!0;return!1}getId(e,t){var i;let n=e.id;if(this.promoteId){let o=typeof this.promoteId=="string"?this.promoteId:this.promoteId[t];n=e.properties[o],typeof n=="boolean"&&(n=Number(n)),n===void 0&&((i=e.properties)!=null&&i.cluster)&&this.promoteId&&(n=Number(e.properties.cluster_id))}return n}};l(qp,"FeatureIndex");var Ki=qp;k("FeatureIndex",Ki,{omit:["rawTileData","sourceLayerCoder"]});function wd(r,e,t,n,i){return vn(r,(o,a)=>{let s=e instanceof Vt?e.get(a):null;return s&&s.evaluate?s.evaluate(t,n,i):s})}l(wd,"evaluateProperties");function uP(r,e){return e-r}l(uP,"topDownFeatureComparator");g();g();var Id=ee(de(),1);var Rs=class Rs extends Id.default{constructor(e,t,n,i){super(e,t),this.angle=n,i!==void 0&&(this.segment=i)}clone(){return new Rs(this.x,this.y,this.angle,this.segment)}};l(Rs,"Anchor");var it=Rs;k("Anchor",it);g();g();function Wp(r,e,t,n,i){if(e.segment===void 0||t===0)return!0;let o=e,a=e.segment+1,s=0;for(;s>-t/2;){if(a--,a<0)return!1;s-=r[a].dist(o),o=r[a]}s+=r[a].dist(r[a+1]),a++;let u=[],c=0;for(;s<t/2;){let p=r[a-1],f=r[a],y=r[a+1];if(!y)return!1;let m=p.angleTo(f)-f.angleTo(y);for(m=Math.abs((m+3*Math.PI)%(Math.PI*2)-Math.PI),u.push({distance:s,angleDelta:m}),c+=m;s-u[0].distance>n;)c-=u.shift().angleDelta;if(c>i)return!1;a++,s+=f.dist(y)}return!0}l(Wp,"checkMaxAngle");function Td(r){let e=0;for(let t=0;t<r.length-1;t++)e+=r[t].dist(r[t+1]);return e}l(Td,"getLineLength");function Cd(r,e,t){return r?3/5*e*t:0}l(Cd,"getAngleWindowSize");function kd(r,e){return Math.max(r?r.right-r.left:0,e?e.right-e.left:0)}l(kd,"getShapedLabelLength");function Fd(r,e,t,n,i,o){let a=Cd(t,i,o),s=kd(t,n)*o,u=0,c=Td(r)/2;for(let p=0;p<r.length-1;p++){let f=r[p],y=r[p+1],m=f.dist(y);if(u+m>c){let h=(c-u)/m,d=ft.number(f.x,y.x,h),x=ft.number(f.y,y.y,h),b=new it(d,x,y.angleTo(f),p);return b._round(),!a||Wp(r,b,s,a,e)?b:void 0}u+=m}}l(Fd,"getCenterAnchor");function Ed(r,e,t,n,i,o,a,s,u){let c=Cd(n,o,a),p=kd(n,i),f=p*a,y=r[0].x===0||r[0].x===u||r[0].y===0||r[0].y===u;e-f<e/4&&(e=f+e/4);let m=o*2,h=y?e/2*s%e:(p/2+m)*a*s%e;return Md(r,h,e,c,t,f,y,!1,u)}l(Ed,"getAnchors");function Md(r,e,t,n,i,o,a,s,u){let c=o/2,p=Td(r),f=0,y=e-t,m=[];for(let h=0;h<r.length-1;h++){let d=r[h],x=r[h+1],b=d.dist(x),P=x.angleTo(d);for(;y+t<f+b;){y+=t;let v=(y-f)/b,S=ft.number(d.x,x.x,v),_=ft.number(d.y,x.y,v);if(S>=0&&S<u&&_>=0&&_<u&&y-c>=0&&y+c<=p){let T=new it(S,_,P,h);T._round(),(!n||Wp(r,T,o,n,i))&&m.push(T)}}f+=b}return!s&&!m.length&&!a&&(m=Md(r,f/2,t,n,i,o,a,!0,u)),m}l(Md,"resample");g();var xt=ee(de(),1);function Ld(r,e,t,n,i){let o=[];for(let a=0;a<r.length;a++){let s=r[a],u;for(let c=0;c<s.length-1;c++){let p=s[c],f=s[c+1];p.x<e&&f.x<e||(p.x<e?p=new xt.default(e,p.y+(f.y-p.y)*((e-p.x)/(f.x-p.x)))._round():f.x<e&&(f=new xt.default(e,p.y+(f.y-p.y)*((e-p.x)/(f.x-p.x)))._round()),!(p.y<t&&f.y<t)&&(p.y<t?p=new xt.default(p.x+(f.x-p.x)*((t-p.y)/(f.y-p.y)),t)._round():f.y<t&&(f=new xt.default(p.x+(f.x-p.x)*((t-p.y)/(f.y-p.y)),t)._round()),!(p.x>=n&&f.x>=n)&&(p.x>=n?p=new xt.default(n,p.y+(f.y-p.y)*((n-p.x)/(f.x-p.x)))._round():f.x>=n&&(f=new xt.default(n,p.y+(f.y-p.y)*((n-p.x)/(f.x-p.x)))._round()),!(p.y>=i&&f.y>=i)&&(p.y>=i?p=new xt.default(p.x+(f.x-p.x)*((i-p.y)/(f.y-p.y)),i)._round():f.y>=i&&(f=new xt.default(p.x+(f.x-p.x)*((i-p.y)/(f.y-p.y)),i)._round()),(!u||!p.equals(u[u.length-1]))&&(u=[p],o.push(u)),u.push(f)))))}}return o}l(Ld,"clipLine");g();var Pe=ee(de(),1);var sn=be;function Xp(r,e,t,n){let i=[],o=r.image,a=o.pixelRatio,s=o.paddedRect.w-2*sn,u=o.paddedRect.h-2*sn,c={x1:r.left,y1:r.top,x2:r.right,y2:r.bottom},p=o.stretchX||[[0,s]],f=o.stretchY||[[0,u]],y=l((C,O)=>C+O[1]-O[0],"reduceRanges"),m=p.reduce(y,0),h=f.reduce(y,0),d=s-m,x=u-h,b=0,P=m,v=0,S=h,_=0,T=d,I=0,F=x;if(o.content&&n){let C=o.content,O=C[2]-C[0],$=C[3]-C[1];(o.textFitWidth||o.textFitHeight)&&(c=Cs(r)),b=zs(p,0,C[0]),v=zs(f,0,C[1]),P=zs(p,C[0],C[2]),S=zs(f,C[1],C[3]),_=C[0]-b,I=C[1]-v,T=O-P,F=$-S}let D=c.x1,R=c.y1,z=c.x2-D,N=c.y2-R,V=l((C,O,$,U)=>{let G=Os(C.stretch-b,P,z,D),te=Gs(C.fixed-_,T,C.stretch,m),J=Os(O.stretch-v,S,N,R),oe=Gs(O.fixed-I,F,O.stretch,h),ge=Os($.stretch-b,P,z,D),Zt=Gs($.fixed-_,T,$.stretch,m),ot=Os(U.stretch-v,S,N,R),Pt=Gs(U.fixed-I,F,U.stretch,h),yo=new Pe.default(G,J),mo=new Pe.default(ge,J),ho=new Pe.default(ge,ot),go=new Pe.default(G,ot),il=new Pe.default(te/a,oe/a),ke=new Pe.default(Zt/a,Pt/a),St=e*Math.PI/180;if(St){let wt=Math.sin(St),yn=Math.cos(St),Oe=[yn,-wt,wt,yn];yo._matMult(Oe),mo._matMult(Oe),go._matMult(Oe),ho._matMult(Oe)}let fn=C.stretch+C.fixed,ol=$.stretch+$.fixed,bo=O.stretch+O.fixed,al=U.stretch+U.fixed,Fe={x:o.paddedRect.x+sn+fn,y:o.paddedRect.y+sn+bo,w:ol-fn,h:al-bo},Se=T/a/z,at=F/a/N;return{tl:yo,tr:mo,bl:go,br:ho,tex:Fe,writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:il,pixelOffsetBR:ke,minFontScaleX:Se,minFontScaleY:at,isSDF:t}},"makeBox");if(!n||!o.stretchX&&!o.stretchY)i.push(V({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:s+1},{fixed:0,stretch:u+1}));else{let C=Dd(p,d,m),O=Dd(f,x,h);for(let $=0;$<C.length-1;$++){let U=C[$],G=C[$+1];for(let te=0;te<O.length-1;te++){let J=O[te],oe=O[te+1];i.push(V(U,J,G,oe))}}}return i}l(Xp,"getIconQuads");function zs(r,e,t){let n=0;for(let i of r)n+=Math.max(e,Math.min(t,i[1]))-Math.max(e,Math.min(t,i[0]));return n}l(zs,"sumWithinRange");function Dd(r,e,t){let n=[{fixed:-sn,stretch:0}];for(let[i,o]of r){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:e+sn,stretch:t}),n}l(Dd,"stretchZonesToCuts");function Os(r,e,t,n){return r/e*t+n}l(Os,"getEmOffset");function Gs(r,e,t,n){return r-e*t/n}l(Gs,"getPxOffset");function Vd(r,e,t,n,i,o,a,s){let u=n.layout.get("text-rotate").evaluate(o,{})*Math.PI/180,c=[];for(let p of e.positionedLines)for(let f of p.positionedGlyphs){if(!f.rect)continue;let y=f.rect||{},h=ws+1,d=!0,x=1,b=0,P=(i||s)&&f.vertical,v=f.metrics.advance*f.scale/2;if(s&&e.verticalizable){let J=(f.scale-1)*ue,oe=(ue-f.metrics.width*f.scale)/2;b=p.lineOffset/2-(f.imageName?-oe:J)}if(f.imageName){let J=a[f.imageName];d=J.sdf,x=J.pixelRatio,h=be/x}let S=i?[f.x+v,f.y]:[0,0],_=i?[0,0]:[f.x+v+t[0],f.y+t[1]-b],T=[0,0];P&&(T=_,_=[0,0]);let I=f.metrics.isDoubleResolution?2:1,F=(f.metrics.left-h)*f.scale-v+_[0],D=(-f.metrics.top-h)*f.scale+_[1],R=F+y.w/I*f.scale/x,z=D+y.h/I*f.scale/x,N=new Pe.default(F,D),V=new Pe.default(R,D),C=new Pe.default(F,z),O=new Pe.default(R,z);if(P){let J=new Pe.default(-v,v-$i),oe=-Math.PI/2,ge=ue/2-v,Zt=f.imageName?ge:0,ot=new Pe.default(5-$i-ge,-Zt),Pt=new Pe.default(...T);N._rotateAround(oe,J)._add(ot)._add(Pt),V._rotateAround(oe,J)._add(ot)._add(Pt),C._rotateAround(oe,J)._add(ot)._add(Pt),O._rotateAround(oe,J)._add(ot)._add(Pt)}if(u){let J=Math.sin(u),oe=Math.cos(u),ge=[oe,-J,J,oe];N._matMult(ge),V._matMult(ge),C._matMult(ge),O._matMult(ge)}let $=new Pe.default(0,0),U=new Pe.default(0,0);c.push({tl:N,tr:V,bl:C,br:O,tex:y,writingMode:e.writingMode,glyphOffset:S,sectionIndex:f.sectionIndex,isSDF:d,pixelOffsetTL:$,pixelOffsetBR:U,minFontScaleX:0,minFontScaleY:0})}return c}l(Vd,"getGlyphQuads");g();var Qi=ee(de(),1);var Hp=class Hp{constructor(e,t,n,i,o,a,s,u,c,p){var f;if(this.boxStartIndex=e.length,c){let y=a.top,m=a.bottom,h=a.collisionPadding;h&&(y-=h[1],m+=h[3]);let d=m-y;d>0&&(d=Math.max(10,d),this.circleDiameter=d)}else{let y=(f=a.image)!=null&&f.content&&(a.image.textFitWidth||a.image.textFitHeight)?Cs(a):{x1:a.left,y1:a.top,x2:a.right,y2:a.bottom};y.y1=y.y1*s-u[0],y.y2=y.y2*s+u[2],y.x1=y.x1*s-u[3],y.x2=y.x2*s+u[1];let m=a.collisionPadding;if(m&&(y.x1-=m[0]*s,y.y1-=m[1]*s,y.x2+=m[2]*s,y.y2+=m[3]*s),p){let h=new Qi.default(y.x1,y.y1),d=new Qi.default(y.x2,y.y1),x=new Qi.default(y.x1,y.y2),b=new Qi.default(y.x2,y.y2),P=p*Math.PI/180;h._rotate(P),d._rotate(P),x._rotate(P),b._rotate(P),y.x1=Math.min(h.x,d.x,x.x,b.x),y.x2=Math.max(h.x,d.x,x.x,b.x),y.y1=Math.min(h.y,d.y,x.y,b.y),y.y2=Math.max(h.y,d.y,x.y,b.y)}e.emplaceBack(t.x,t.y,y.x1,y.y1,y.x2,y.y2,n,i,o)}this.boxEndIndex=e.length}};l(Hp,"CollisionFeature");var _r=Hp;g();g();var Zp=class Zp{constructor(e=[],t=(n,i)=>n<i?-1:n>i?1:0){if(this.data=e,this.length=this.data.length,this.compare=t,this.length>0)for(let n=(this.length>>1)-1;n>=0;n--)this._down(n)}push(e){this.data.push(e),this._up(this.length++)}pop(){if(this.length===0)return;let e=this.data[0],t=this.data.pop();return--this.length>0&&(this.data[0]=t,this._down(0)),e}peek(){return this.data[0]}_up(e){let{data:t,compare:n}=this,i=t[e];for(;e>0;){let o=e-1>>1,a=t[o];if(n(i,a)>=0)break;t[e]=a,e=o}t[e]=i}_down(e){let{data:t,compare:n}=this,i=this.length>>1,o=t[e];for(;e<i;){let a=(e<<1)+1,s=a+1;if(s<this.length&&n(t[s],t[a])<0&&(a=s),n(t[a],o)>=0)break;t[e]=t[a],e=a}t[e]=o}};l(Zp,"TinyQueue");var eo=Zp;var Jp=ee(de(),1);function Bd(r,e=1,t=!1){let n=Ar.fromPoints(r[0]),i=Math.min(n.width(),n.height()),o=i/2,a=new eo([],cP),{minX:s,minY:u,maxX:c,maxY:p}=n;if(i===0)return new Jp.default(s,u);for(let m=s;m<c;m+=i)for(let h=u;h<p;h+=i)a.push(new ln(m+o,h+o,o,r));let f=fP(r),y=a.length;for(;a.length;){let m=a.pop();(m.d>f.d||!f.d)&&(f=m,t&&console.log("found best %d after %d probes",Math.round(1e4*m.d)/1e4,y)),!(m.max-f.d<=e)&&(o=m.h/2,a.push(new ln(m.p.x-o,m.p.y-o,o,r)),a.push(new ln(m.p.x+o,m.p.y-o,o,r)),a.push(new ln(m.p.x-o,m.p.y+o,o,r)),a.push(new ln(m.p.x+o,m.p.y+o,o,r)),y+=4)}return t&&(console.log("num probes: ".concat(y)),console.log("best distance: ".concat(f.d))),f.p}l(Bd,"findPoleOfInaccessibility");function cP(r,e){return e.max-r.max}l(cP,"compareMax");function ln(r,e,t,n){this.p=new Jp.default(r,e),this.h=t,this.d=pP(this.p,n),this.max=this.d+this.h*Math.SQRT2}l(ln,"Cell");function pP(r,e){let t=!1,n=1/0;for(let i=0;i<e.length;i++){let o=e[i];for(let a=0,s=o.length,u=s-1;a<s;u=a++){let c=o[a],p=o[u];c.y>r.y!=p.y>r.y&&r.x<(p.x-c.x)*(r.y-c.y)/(p.y-c.y)+c.x&&(t=!t),n=Math.min(n,Yc(r,c,p))}}return(t?1:-1)*Math.sqrt(n)}l(pP,"pointToPolygonDist");function fP(r){let e=0,t=0,n=0,i=r[0];for(let o=0,a=i.length,s=a-1;o<a;s=o++){let u=i[o],c=i[s],p=u.x*c.y-c.x*u.y;t+=(u.x+c.x)*p,n+=(u.y+c.y)*p,e+=p*3}return new ln(t/e,n/e,0,r)}l(fP,"getCentroidCell");var ef=ee(Lc(),1);g();var Yp=(o=>(o[o.center=1]="center",o[o.left=2]="left",o[o.right=3]="right",o[o.top=4]="top",o[o.bottom=5]="bottom",o[o["top-left"]=6]="top-left",o[o["top-right"]=7]="top-right",o[o["bottom-left"]=8]="bottom-left",o[o["bottom-right"]=9]="bottom-right",o))(Yp||{}),Wt=7,Ns=Number.POSITIVE_INFINITY;function Kp(r,e){function t(i,o){let a=0,s=0;o<0&&(o=0);let u=o/Math.SQRT2;switch(i){case"top-right":case"top-left":s=u-Wt;break;case"bottom-right":case"bottom-left":s=-u+Wt;break;case"bottom":s=-o+Wt;break;case"top":s=o-Wt;break}switch(i){case"top-right":case"bottom-right":a=-u;break;case"top-left":case"bottom-left":a=u;break;case"left":a=o;break;case"right":a=-o;break}return[a,s]}l(t,"fromRadialOffset");function n(i,o,a){let s=0,u=0;switch(o=Math.abs(o),a=Math.abs(a),i){case"top-right":case"top-left":case"top":u=a-Wt;break;case"bottom-right":case"bottom-left":case"bottom":u=-a+Wt;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,u]}return l(n,"fromTextOffset"),e[1]!==Ns?n(r,e[0],e[1]):t(r,e[0])}l(Kp,"evaluateVariableOffset");function Qp(r,e,t){var a;let n=r.layout,i=(a=n.get("text-variable-anchor-offset"))==null?void 0:a.evaluate(e,{},t);if(i){let s=i.values,u=[];for(let c=0;c<s.length;c+=2){let p=u[c]=s[c],f=s[c+1].map(y=>y*ue);p.startsWith("top")?f[1]-=Wt:p.startsWith("bottom")&&(f[1]+=Wt),u[c+1]=f}return new De(u)}let o=n.get("text-variable-anchor");if(o){let s;r._unevaluatedLayout.getValue("text-radial-offset")!==void 0?s=[n.get("text-radial-offset").evaluate(e,{},t)*ue,Ns]:s=n.get("text-offset").evaluate(e,{},t).map(p=>p*ue);let c=[];for(let p of o)c.push(p,Kp(p,s));return new De(c)}return null}l(Qp,"getTextVariableAnchorOffset");function Od(r){r.bucket.createArrays();let e=512*r.bucket.overscaling;r.bucket.tilePixelRatio=8192/e,r.bucket.compareText={},r.bucket.iconsNeedLinear=!1;let t=r.bucket.layers[0],n=t.layout,i=t._unevaluatedLayout._values,o={layoutIconSize:i["icon-size"].possiblyEvaluate(new Z(r.bucket.zoom+1),r.canonical),layoutTextSize:i["text-size"].possiblyEvaluate(new Z(r.bucket.zoom+1),r.canonical),textMaxSize:i["text-size"].possiblyEvaluate(new Z(18))};if(r.bucket.textSizeData.kind==="composite"){let{minZoom:p,maxZoom:f}=r.bucket.textSizeData;o.compositeTextSizes=[i["text-size"].possiblyEvaluate(new Z(p),r.canonical),i["text-size"].possiblyEvaluate(new Z(f),r.canonical)]}if(r.bucket.iconSizeData.kind==="composite"){let{minZoom:p,maxZoom:f}=r.bucket.iconSizeData;o.compositeIconSizes=[i["icon-size"].possiblyEvaluate(new Z(p),r.canonical),i["icon-size"].possiblyEvaluate(new Z(f),r.canonical)]}let a=n.get("text-line-height")*ue,s=n.get("text-rotation-alignment")!=="viewport"&&n.get("symbol-placement")!=="point",u=n.get("text-keep-upright"),c=n.get("text-size");for(let p of r.bucket.features){let f=n.get("text-font").evaluate(p,{},r.canonical).join(","),y=c.evaluate(p,{},r.canonical),m=o.layoutTextSize.evaluate(p,{},r.canonical),h=o.layoutIconSize.evaluate(p,{},r.canonical),d={horizontal:{},vertical:void 0},x=p.text,b=[0,0];if(x){let _=x.toString(),T=n.get("text-letter-spacing").evaluate(p,{},r.canonical)*ue,I=Em(_)?T:0,F=n.get("text-anchor").evaluate(p,{},r.canonical),D=Qp(t,p,r.canonical);if(!D){let C=n.get("text-radial-offset").evaluate(p,{},r.canonical);C?b=Kp(F,[C*ue,Ns]):b=n.get("text-offset").evaluate(p,{},r.canonical).map(O=>O*ue)}let R=s?"center":n.get("text-justify").evaluate(p,{},r.canonical),N=n.get("symbol-placement")==="point"?n.get("text-max-width").evaluate(p,{},r.canonical)*ue:1/0,V=l(()=>{r.bucket.allowVerticalPlacement&&Hn(_)&&(d.vertical=ji(x,r.glyphMap,r.glyphPositions,r.imagePositions,f,N,a,F,"left",I,b,2,!0,m,y))},"addVerticalShapingForPointLabelIfNeeded");if(!s&&D){let C=new Set;if(R==="auto")for(let $=0;$<D.values.length;$+=2)C.add(Rd(D.values[$]));else C.add(R);let O=!1;for(let $ of C)if(!d.horizontal[$])if(O)d.horizontal[$]=d.horizontal[0];else{let U=ji(x,r.glyphMap,r.glyphPositions,r.imagePositions,f,N,a,"center",$,I,b,1,!1,m,y);U&&(d.horizontal[$]=U,O=U.positionedLines.length===1)}V()}else{R==="auto"&&(R=Rd(F));let C=ji(x,r.glyphMap,r.glyphPositions,r.imagePositions,f,N,a,F,R,I,b,1,!1,m,y);C&&(d.horizontal[R]=C),V(),Hn(_)&&s&&u&&(d.vertical=ji(x,r.glyphMap,r.glyphPositions,r.imagePositions,f,N,a,F,R,I,b,2,!1,m,y))}}let P,v=!1;if(p.icon&&p.icon.name){let _=r.imageMap[p.icon.name];_&&(P=pd(r.imagePositions[p.icon.name],n.get("icon-offset").evaluate(p,{},r.canonical),n.get("icon-anchor").evaluate(p,{},r.canonical)),v=!!_.sdf,r.bucket.sdfIcons===void 0?r.bucket.sdfIcons=v:r.bucket.sdfIcons!==v&&ye("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),(_.pixelRatio!==r.bucket.pixelRatio||n.get("icon-rotate").constantOr(1)!==0)&&(r.bucket.iconsNeedLinear=!0))}let S=Gd(d.horizontal)||d.vertical;r.bucket.iconsInText=S?S.iconsInText:!1,(S||P)&&yP(r.bucket,p,d,P,r.imageMap,o,m,h,b,v,r.canonical,r.subdivisionGranularity)}r.showCollisionBoxes&&r.bucket.generateCollisionDebugBuffers()}l(Od,"performSymbolLayout");function Rd(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"}l(Rd,"getAnchorJustification");function yP(r,e,t,n,i,o,a,s,u,c,p,f){let y=o.textMaxSize.evaluate(e,{});y===void 0&&(y=a);let m=r.layers[0].layout,h=m.get("icon-offset").evaluate(e,{},p),d=Gd(t.horizontal),x=24,b=a/x,P=r.tilePixelRatio*b,v=r.tilePixelRatio*y/x,S=r.tilePixelRatio*s,_=r.tilePixelRatio*m.get("symbol-spacing"),T=m.get("text-padding")*r.tilePixelRatio,I=gd(m,e,p,r.tilePixelRatio),F=m.get("text-max-angle")/180*Math.PI,D=m.get("text-rotation-alignment")!=="viewport"&&m.get("symbol-placement")!=="point",R=m.get("icon-rotation-alignment")==="map"&&m.get("symbol-placement")!=="point",z=m.get("symbol-placement"),N=_/2,V=m.get("icon-text-fit"),C;n&&V!=="none"&&(r.allowVerticalPlacement&&t.vertical&&(C=Mp(n,t.vertical,V,m.get("icon-text-fit-padding"),h,b)),d&&(n=Mp(n,d,V,m.get("icon-text-fit-padding"),h,b)));let O=p?f.line.getGranularityForZoomLevel(p.z):1,$=l((U,G)=>{G.x<0||G.x>=8192||G.y<0||G.y>=8192||hP(r,G,U,t,n,i,C,r.layers[0],r.collisionBoxArray,e.index,e.sourceLayerIndex,r.index,P,[T,T,T,T],D,u,S,I,R,h,e,o,c,p,a)},"addSymbolAtAnchor");if(z==="line")for(let U of Ld(e.geometry,0,0,8192,8192)){let G=rt(U,O),te=Ed(G,_,F,t.vertical||d,n,x,v,r.overscaling,8192);for(let J of te){let oe=d;(!oe||!dP(r,oe.text,N,J))&&$(G,J)}}else if(z==="line-center"){for(let U of e.geometry)if(U.length>1){let G=rt(U,O),te=Fd(G,F,t.vertical||d,n,x,v);te&&$(G,te)}}else if(e.type==="Polygon")for(let U of ur(e.geometry,0)){let G=Bd(U,16),te=rt(U[0],O,!0);$(te,new it(G.x,G.y,0))}else if(e.type==="LineString")for(let U of e.geometry){let G=rt(U,O);$(G,new it(G[0].x,G[0].y,0))}else if(e.type==="Point")for(let U of e.geometry)for(let G of U)$([G],new it(G.x,G.y,0))}l(yP,"addFeature");function mP(r,e){let t=r.length,n=e==null?void 0:e.values;if((n==null?void 0:n.length)>0)for(let i=0;i<n.length;i+=2){let o=Yp[n[i]],a=n[i+1];r.emplaceBack(o,a[0],a[1])}return[t,r.length]}l(mP,"addTextVariableAnchorOffsets");function zd(r,e,t,n,i,o,a,s,u,c,p,f,y,m,h){let d=Vd(e,t,s,i,o,a,n,r.allowVerticalPlacement),x=r.textSizeData,b=null;x.kind==="source"?(b=[qt*i.layout.get("text-size").evaluate(a,{})],b[0]>nt&&ye("".concat(r.layerIds[0],': Value for "text-size" is >= ').concat(on,'. Reduce your "text-size".'))):x.kind==="composite"&&(b=[qt*m.compositeTextSizes[0].evaluate(a,{},h),qt*m.compositeTextSizes[1].evaluate(a,{},h)],(b[0]>nt||b[1]>nt)&&ye("".concat(r.layerIds[0],': Value for "text-size" is >= ').concat(on,'. Reduce your "text-size".'))),r.addSymbols(r.text,d,b,s,o,a,c,e,u.lineStartIndex,u.lineLength,y,h);for(let P of p)f[P]=r.text.placedSymbolArray.length-1;return d.length*4}l(zd,"addTextVertices");function Gd(r){for(let e in r)return r[e];return null}l(Gd,"getDefaultHorizontalShaping");function hP(r,e,t,n,i,o,a,s,u,c,p,f,y,m,h,d,x,b,P,v,S,_,T,I,F){let D=r.addToLineVertexArray(e,t),R,z,N,V,C=0,O=0,$=0,U=0,G=-1,te=-1,J={},oe=(0,ef.default)("");if(r.allowVerticalPlacement&&n.vertical){let Se=s.layout.get("text-rotate").evaluate(S,{},I)+90,at=n.vertical;N=new _r(u,e,c,p,f,at,y,m,h,Se),a&&(V=new _r(u,e,c,p,f,a,x,b,h,Se))}if(i){let Fe=s.layout.get("icon-rotate").evaluate(S,{}),Se=s.layout.get("icon-text-fit")!=="none",at=Xp(i,Fe,T,Se),wt=a?Xp(a,Fe,T,Se):void 0;z=new _r(u,e,c,p,f,i,x,b,!1,Fe),C=at.length*4;let yn=r.iconSizeData,Oe=null;yn.kind==="source"?(Oe=[qt*s.layout.get("icon-size").evaluate(S,{})],Oe[0]>nt&&ye("".concat(r.layerIds[0],': Value for "icon-size" is >= ').concat(on,'. Reduce your "icon-size".'))):yn.kind==="composite"&&(Oe=[qt*_.compositeIconSizes[0].evaluate(S,{},I),qt*_.compositeIconSizes[1].evaluate(S,{},I)],(Oe[0]>nt||Oe[1]>nt)&&ye("".concat(r.layerIds[0],': Value for "icon-size" is >= ').concat(on,'. Reduce your "icon-size".'))),r.addSymbols(r.icon,at,Oe,v,P,S,0,e,D.lineStartIndex,D.lineLength,-1,I),G=r.icon.placedSymbolArray.length-1,wt&&(O=wt.length*4,r.addSymbols(r.icon,wt,Oe,v,P,S,2,e,D.lineStartIndex,D.lineLength,-1,I),te=r.icon.placedSymbolArray.length-1)}let ge=Object.keys(n.horizontal);for(let Fe of ge){let Se=n.horizontal[Fe];if(!R){oe=(0,ef.default)(Se.text);let wt=s.layout.get("text-rotate").evaluate(S,{},I);R=new _r(u,e,c,p,f,Se,y,m,h,wt)}let at=Se.positionedLines.length===1;if($+=zd(r,e,Se,o,s,h,S,d,D,n.vertical?1:3,at?ge:[Fe],J,G,_,I),at)break}n.vertical&&(U+=zd(r,e,n.vertical,o,s,h,S,d,D,2,["vertical"],J,te,_,I));let Zt=R?R.boxStartIndex:r.collisionBoxArray.length,ot=R?R.boxEndIndex:r.collisionBoxArray.length,Pt=N?N.boxStartIndex:r.collisionBoxArray.length,yo=N?N.boxEndIndex:r.collisionBoxArray.length,mo=z?z.boxStartIndex:r.collisionBoxArray.length,ho=z?z.boxEndIndex:r.collisionBoxArray.length,go=V?V.boxStartIndex:r.collisionBoxArray.length,il=V?V.boxEndIndex:r.collisionBoxArray.length,ke=-1,St=l((Fe,Se)=>Fe&&Fe.circleDiameter?Math.max(Fe.circleDiameter,Se):Se,"getCollisionCircleHeight");ke=St(R,ke),ke=St(N,ke),ke=St(z,ke),ke=St(V,ke);let fn=ke>-1?1:0;fn&&(ke*=F/ue),r.glyphOffsetArray.length>=Ye.MAX_GLYPHS&&ye("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),S.sortKey!==void 0&&r.addToSortKeyRanges(r.symbolInstances.length,S.sortKey);let ol=Qp(s,S,I),[bo,al]=mP(r.textAnchorOffsets,ol);r.symbolInstances.emplaceBack(e.x,e.y,J.right>=0?J.right:-1,J.center>=0?J.center:-1,J.left>=0?J.left:-1,J.vertical||-1,G,te,oe,Zt,ot,Pt,yo,mo,ho,go,il,c,$,U,C,O,fn,0,y,ke,bo,al)}l(hP,"addSymbol");function dP(r,e,t,n){let i=r.compareText;if(!(e in i))i[e]=[];else{let o=i[e];for(let a=o.length-1;a>=0;a--)if(n.dist(o[a])<t)return!0}return i[e].push(n),!1}l(dP,"anchorIsTooClose");g();var Us=1,tf=class tf{constructor(e){let t={},n=[];for(let s in e){let u=e[s],c=t[s]={};for(let p in u){let f=u[+p];if(!f||f.bitmap.width===0||f.bitmap.height===0)continue;let y={x:0,y:0,w:f.bitmap.width+2*Us,h:f.bitmap.height+2*Us};n.push(y),c[p]={rect:y,metrics:f.metrics}}}let{w:i,h:o}=zi(n),a=new xr({width:i||1,height:o||1});for(let s in e){let u=e[s];for(let c in u){let p=u[+c];if(!p||p.bitmap.width===0||p.bitmap.height===0)continue;let f=t[s][c].rect;xr.copy(p.bitmap,a,{x:0,y:0},{x:f.x+Us,y:f.y+Us},p.bitmap)}}this.image=a,this.positions=t}};l(tf,"GlyphAtlas");var to=tf;k("GlyphAtlas",to);g();g();function Ud(r,e,t){e=Math.pow(2,t)-e-1;var n=Nd(r*256,e*256,t),i=Nd((r+1)*256,(e+1)*256,t);return n[0]+","+n[1]+","+i[0]+","+i[1]}l(Ud,"getTileBBox");function Nd(r,e,t){var n=2*Math.PI*6378137/256/Math.pow(2,t),i=r*n-2*Math.PI*6378137/2,o=e*n-2*Math.PI*6378137/2;return[i,o]}l(Nd,"getMercCoords");var Wd=ee(de(),1);g();g();var rf=63710088e-1,Ir=class Ir{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 Ir(ay(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,n=this.lat*t,i=e.lat*t,o=Math.sin(n)*Math.sin(i)+Math.cos(n)*Math.cos(i)*Math.cos((e.lng-this.lng)*t);return rf*Math.acos(Math.min(o,1))}static convert(e){if(e instanceof Ir)return e;if(Array.isArray(e)&&(e.length===2||e.length===3))return new Ir(Number(e[0]),Number(e[1]));if(!Array.isArray(e)&&typeof e=="object"&&e!==null)return new Ir(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>]")}};l(Ir,"LngLat");var ro=Ir;var $d=2*Math.PI*rf;function jd(r){return $d*Math.cos(r*Math.PI/180)}l(jd,"circumferenceAtLatitude");function gP(r){return(180+r)/360}l(gP,"mercatorXfromLng");function bP(r){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+r*Math.PI/360)))/360}l(bP,"mercatorYfromLat");function xP(r,e){return r/jd(e)}l(xP,"mercatorZfromAltitude");function vP(r){return r*360-180}l(vP,"lngFromMercatorX");function nf(r){let e=180-r*360;return 360/Math.PI*Math.atan(Math.exp(e*Math.PI/180))-90}l(nf,"latFromMercatorY");function PP(r,e){return r*jd(nf(e))}l(PP,"altitudeFromMercatorZ");function SP(r){return 1/Math.cos(r*Math.PI/180)}l(SP,"mercatorScale");var $s=class $s{constructor(e,t,n=0){this.x=+e,this.y=+t,this.z=+n}static fromLngLat(e,t=0){let n=ro.convert(e);return new $s(gP(n.lng),bP(n.lat),xP(t,n.lat))}toLngLat(){return new ro(vP(this.x),nf(this.y))}toAltitude(){return PP(this.z,this.y)}meterInMercatorCoordinateUnits(){return 1/$d*SP(nf(this.y))}};l($s,"MercatorCoordinate");var no=$s;g();function qd(r,e,t){return!(r<wo||r>So||t<0||t>=Math.pow(2,r)||e<0||e>=Math.pow(2,r))}l(qd,"isInBoundsForTileZoomXY");var af=class af{constructor(e,t,n){if(!qd(e,t,n))throw new Error("x=".concat(t,", y=").concat(n,", z=").concat(e," outside of bounds. 0<=x<").concat(Math.pow(2,e),", 0<=y<").concat(Math.pow(2,e)," ").concat(wo,"<=z<=").concat(So," "));this.z=e,this.x=t,this.y=n,this.key=io(0,e,e,t,n)}equals(e){return this.z===e.z&&this.x===e.x&&this.y===e.y}url(e,t,n){let i=Ud(this.x,this.y,this.z),o=wP(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(n==="tms"?Math.pow(2,this.z)-this.y-1:this.y)).replace(/{ratio}/g,t>1?"@2x":"").replace(/{quadkey}/g,o).replace(/{bbox-epsg-3857}/g,i)}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 Wd.default((e.x*t-this.x)*8192,(e.y*t-this.y)*8192)}toString(){return"".concat(this.z,"/").concat(this.x,"/").concat(this.y)}};l(af,"CanonicalTileID");var js=af,sf=class sf{constructor(e,t){this.wrap=e,this.canonical=t,this.key=io(e,t.z,t.z,t.x,t.y)}};l(sf,"UnwrappedTileID");var of=sf,ze=class ze{constructor(e,t,n,i,o){this.terrainRttPosMatrix32f=null;if(e<n)throw new Error("overscaledZ should be >= z; overscaledZ = ".concat(e,"; z = ").concat(n));this.overscaledZ=e,this.wrap=t,this.canonical=new js(n,+i,+o),this.key=io(t,e,n,i,o)}clone(){return new ze(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 ze(e,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new ze(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 n=this.canonical.z-e;return e>this.canonical.z?io(this.wrap*+t,e,this.canonical.z,this.canonical.x,this.canonical.y):io(this.wrap*+t,e,e,this.canonical.x>>n,this.canonical.y>>n)}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 ze(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];let t=this.canonical.z+1,n=this.canonical.x*2,i=this.canonical.y*2;return[new ze(t,this.wrap,t,n,i),new ze(t,this.wrap,t,n+1,i),new ze(t,this.wrap,t,n,i+1),new ze(t,this.wrap,t,n+1,i+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 ze(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)}unwrapTo(e){return new ze(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 of(this.wrap,this.canonical)}toString(){return"".concat(this.overscaledZ,"/").concat(this.canonical.x,"/").concat(this.canonical.y)}getTilePoint(e){return this.canonical.getTilePoint(new no(e.x-this.wrap,e.y))}};l(ze,"OverscaledTileID");var oo=ze;function io(r,e,t,n,i){r*=2,r<0&&(r=r*-1-1);let o=1<<t;return(o*o*r+o*i+n).toString(36)+t.toString(36)+e.toString(36)}l(io,"calculateTileKey");function wP(r,e,t){let n="",i;for(let o=r;o>0;o--)i=1<<o-1,n+=(e&i?1:0)+(t&i?2:0);return n}l(wP,"getQuadkey");k("CanonicalTileID",js);k("OverscaledTileID",oo,{omit:["terrainRttPosMatrix32f"]});var uf=class uf{constructor(e){this.tileID=new oo(e.tileID.overscaledZ,e.tileID.wrap,e.tileID.canonical.z,e.tileID.canonical.x,e.tileID.canonical.y),this.uid=e.uid,this.zoom=e.zoom,this.pixelRatio=e.pixelRatio,this.tileSize=e.tileSize,this.source=e.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=e.showCollisionBoxes,this.collectResourceTiming=!!e.collectResourceTiming,this.returnDependencies=!!e.returnDependencies,this.promoteId=e.promoteId,this.inFlightDependencies=[],this.globalState=e.globalState}async parse(e,t,n,i,o){this.status="parsing",this.data=e,this.collisionBoxArray=new fi;let a=new an(Object.keys(e.layers).sort()),s=new Ki(this.tileID,this.promoteId);s.bucketLayerIDs=[];let u={},c={featureIndex:s,iconDependencies:{},patternDependencies:{},glyphDependencies:{},availableImages:n,subdivisionGranularity:o},p=t.familiesBySource[this.source];for(let T in p){let I=e.layers[T];if(!I)continue;I.version===1&&ye('Vector tile source "'.concat(this.source,'" layer "').concat(T,'" ')+"does not use vector tile spec v2 and therefore may have some rendering errors.");let F=a.encode(T),D=[];for(let R=0;R<I.length;R++){let z=I.feature(R),N=s.getId(z,T);D.push({feature:z,id:N,index:R,sourceLayerIndex:F})}for(let R of p[T]){let z=R[0];if(z.source!==this.source&&ye("layer.source = ".concat(z.source," does not equal this.source = ").concat(this.source)),z.minzoom&&this.zoom<Math.floor(z.minzoom)||z.maxzoom&&this.zoom>=z.maxzoom||z.visibility==="none")continue;lf(R,this.zoom,n),(u[z.id]=z.createBucket({index:s.bucketLayerIDs.length,layers:R,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:F,sourceID:this.source,globalState:this.globalState})).populate(D,c,this.tileID.canonical),s.bucketLayerIDs.push(R.map(V=>V.id))}}let f=vn(c.glyphDependencies,T=>Object.keys(T).map(Number));this.inFlightDependencies.forEach(T=>T==null?void 0:T.abort()),this.inFlightDependencies=[];let y=Promise.resolve({});if(Object.keys(f).length){let T=new AbortController;this.inFlightDependencies.push(T),y=i.sendAsync({type:"GG",data:{stacks:f,source:this.source,tileID:this.tileID,type:"glyphs"}},T)}let m=Object.keys(c.iconDependencies),h=Promise.resolve({});if(m.length){let T=new AbortController;this.inFlightDependencies.push(T),h=i.sendAsync({type:"GI",data:{icons:m,source:this.source,tileID:this.tileID,type:"icons"}},T)}let d=Object.keys(c.patternDependencies),x=Promise.resolve({});if(d.length){let T=new AbortController;this.inFlightDependencies.push(T),x=i.sendAsync({type:"GI",data:{icons:d,source:this.source,tileID:this.tileID,type:"patterns"}},T)}let[b,P,v]=await Promise.all([y,h,x]),S=new to(b),_=new Oi(P,v);for(let T in u){let I=u[T];I instanceof Ye?(lf(I.layers,this.zoom,n),Od({bucket:I,glyphMap:b,glyphPositions:S.positions,imageMap:P,imagePositions:_.iconPositions,showCollisionBoxes:this.showCollisionBoxes,canonical:this.tileID.canonical,subdivisionGranularity:c.subdivisionGranularity})):I.hasPattern&&(I instanceof wr||I instanceof Pr||I instanceof Sr)&&(lf(I.layers,this.zoom,n),I.addFeatures(c,this.tileID.canonical,_.patternPositions))}return this.status="done",{buckets:Object.values(u).filter(T=>!T.isEmpty()),featureIndex:s,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:S.image,imageAtlas:_,glyphMap:this.returnDependencies?b:null,iconMap:this.returnDependencies?P:null,glyphPositions:this.returnDependencies?S.positions:null}}};l(uf,"WorkerTile");var qs=uf;function lf(r,e,t){let n=new Z(e);for(let i of r)i.recalculate(n,t)}l(lf,"recalculateLayers");g();var AP=60,oV=1e3/AP;var cf=class cf{constructor(e){this._marks={start:[e.url,"start"].join("#"),end:[e.url,"end"].join("#"),measure:e.url.toString()},performance.mark(this._marks.start)}finish(){performance.mark(this._marks.end);let e=performance.getEntriesByName(this._marks.measure);return e.length===0&&(performance.measure(this._marks.measure,this._marks.start,this._marks.end),e=performance.getEntriesByName(this._marks.measure),performance.clearMarks(this._marks.start),performance.clearMarks(this._marks.end),performance.clearMeasures(this._marks.measure)),e}};l(cf,"RequestPerformance");var un=cf;var pf=class pf{constructor(e,t,n){this.actor=e,this.layerIndex=t,this.availableImages=n,this.fetching={},this.loading={},this.loaded={}}async loadVectorTile(e,t){let n=await Am(e.request,t);try{return{vectorTile:new Xd.default.VectorTile(new Hd.default(n.data)),rawData:n.data,cacheControl:n.cacheControl,expires:n.expires}}catch(i){let o=new Uint8Array(n.data),a=o[0]===31&&o[1]===139,s="Unable to parse the tile at ".concat(e.request.url,", ");throw a?s+="please make sure the data is not gzipped and that you have configured the relevant header in the server":s+="got error: ".concat(i.message),new Error(s)}}async loadTile(e){let t=e.uid,n=e&&e.request&&e.request.collectResourceTiming?new un(e.request):!1,i=new qs(e);this.loading[t]=i;let o=new AbortController;i.abort=o;try{let a=await this.loadVectorTile(e,o);if(delete this.loading[t],!a)return null;let s=a.rawData,u={};a.expires&&(u.expires=a.expires),a.cacheControl&&(u.cacheControl=a.cacheControl);let c={};if(n){let f=n.finish();f&&(c.resourceTiming=JSON.parse(JSON.stringify(f)))}i.vectorTile=a.vectorTile;let p=i.parse(a.vectorTile,this.layerIndex,this.availableImages,this.actor,e.subdivisionGranularity);this.loaded[t]=i,this.fetching[t]={rawTileData:s,cacheControl:u,resourceTiming:c};try{let f=await p;return xe({rawTileData:s.slice(0)},f,u,c)}finally{delete this.fetching[t]}}catch(a){throw delete this.loading[t],i.status="done",this.loaded[t]=i,a}}async reloadTile(e){let t=e.uid;if(!this.loaded||!this.loaded[t])throw new Error("Should not be trying to reload a tile that was never loaded or has been removed");let n=this.loaded[t];if(n.showCollisionBoxes=e.showCollisionBoxes,n.globalState=e.globalState,n.status==="parsing"){let i=await n.parse(n.vectorTile,this.layerIndex,this.availableImages,this.actor,e.subdivisionGranularity),o;if(this.fetching[t]){let{rawTileData:a,cacheControl:s,resourceTiming:u}=this.fetching[t];delete this.fetching[t],o=xe({rawTileData:a.slice(0)},i,s,u)}else o=i;return o}if(n.status==="done"&&n.vectorTile)return n.parse(n.vectorTile,this.layerIndex,this.availableImages,this.actor,e.subdivisionGranularity)}async abortTile(e){let t=this.loading,n=e.uid;t&&t[n]&&t[n].abort&&(t[n].abort.abort(),delete t[n])}async removeTile(e){this.loaded&&this.loaded[e.uid]&&delete this.loaded[e.uid]}};l(pf,"VectorTileWorkerSource");var cn=pf;g();var ff=class ff{constructor(){this.loaded={}}async loadTile(e){let{uid:t,encoding:n,rawImageData:i,redFactor:o,greenFactor:a,blueFactor:s,baseShift:u}=e,c=i.width+2,p=i.height+2,f=At(i)?new he({width:c,height:p},await uy(i,-1,-1,c,p)):i,y=new Ii(t,f,n,o,a,s,u);return this.loaded=this.loaded||{},this.loaded[t]=y,y}removeTile(e){let t=this.loaded,n=e.uid;t&&t[n]&&delete t[n]}};l(ff,"RasterDEMTileWorkerSource");var Ws=ff;g();var Pg=ee(Kd(),1);g();var yf=ee(de(),1),Qd=ee(jt(),1);var _P=Qd.default.VectorTileFeature.prototype.toGeoJSON,hf=class hf{constructor(e){this._feature=e,this.extent=8192,this.type=e.type,this.properties=e.tags,"id"in e&&!isNaN(e.id)&&(this.id=parseInt(e.id,10))}loadGeometry(){if(this._feature.type===1){let e=[];for(let t of this._feature.geometry)e.push([new yf.default(t[0],t[1])]);return e}else{let e=[];for(let t of this._feature.geometry){let n=[];for(let i of t)n.push(new yf.default(i[0],i[1]));e.push(n)}return e}}toGeoJSON(e,t,n){return _P.call(this,e,t,n)}};l(hf,"FeatureWrapper");var mf=hf,df=class df{constructor(e){this.layers={_geojsonTileLayer:this},this.name="_geojsonTileLayer",this.extent=8192,this.length=e.length,this._features=e}feature(e){return new mf(this._features[e])}};l(df,"GeoJSONWrapper");var Hs=df;var Sg=ee(og(),1);g();g();var ag=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],xf=1,so=8,Js=class Js{static from(e){if(!(e instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");let[t,n]=new Uint8Array(e,0,2);if(t!==219)throw new Error("Data does not appear to be in a KDBush format.");let i=n>>4;if(i!==xf)throw new Error("Got v".concat(i," data when expected v").concat(xf,"."));let o=ag[n&15];if(!o)throw new Error("Unrecognized array type.");let[a]=new Uint16Array(e,2,1),[s]=new Uint32Array(e,4,1);return new Js(s,a,o,e)}constructor(e,t=64,n=Float64Array,i){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=n,this.IndexArrayType=e<65536?Uint16Array:Uint32Array;let o=ag.indexOf(this.ArrayType),a=e*2*this.ArrayType.BYTES_PER_ELEMENT,s=e*this.IndexArrayType.BYTES_PER_ELEMENT,u=(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,so,e),this.coords=new this.ArrayType(this.data,so+s+u,e*2),this._pos=e*2,this._finished=!0):(this.data=new ArrayBuffer(so+a+s+u),this.ids=new this.IndexArrayType(this.data,so,e),this.coords=new this.ArrayType(this.data,so+s+u,e*2),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,(xf<<4)+o]),new Uint16Array(this.data,2,1)[0]=t,new Uint32Array(this.data,4,1)[0]=e)}add(e,t){let n=this._pos>>1;return this.ids[n]=n,this.coords[this._pos++]=e,this.coords[this._pos++]=t,n}finish(){let e=this._pos>>1;if(e!==this.numItems)throw new Error("Added ".concat(e," items when expected ").concat(this.numItems,"."));return Pf(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(e,t,n,i){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");let{ids:o,coords:a,nodeSize:s}=this,u=[0,o.length-1,0],c=[];for(;u.length;){let p=u.pop()||0,f=u.pop()||0,y=u.pop()||0;if(f-y<=s){for(let x=y;x<=f;x++){let b=a[2*x],P=a[2*x+1];b>=e&&b<=n&&P>=t&&P<=i&&c.push(o[x])}continue}let m=y+f>>1,h=a[2*m],d=a[2*m+1];h>=e&&h<=n&&d>=t&&d<=i&&c.push(o[m]),(p===0?e<=h:t<=d)&&(u.push(y),u.push(m-1),u.push(1-p)),(p===0?n>=h:i>=d)&&(u.push(m+1),u.push(f),u.push(1-p))}return c}within(e,t,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],u=[],c=n*n;for(;s.length;){let p=s.pop()||0,f=s.pop()||0,y=s.pop()||0;if(f-y<=a){for(let x=y;x<=f;x++)sg(o[2*x],o[2*x+1],e,t)<=c&&u.push(i[x]);continue}let m=y+f>>1,h=o[2*m],d=o[2*m+1];sg(h,d,e,t)<=c&&u.push(i[m]),(p===0?e-n<=h:t-n<=d)&&(s.push(y),s.push(m-1),s.push(1-p)),(p===0?e+n>=h:t+n>=d)&&(s.push(m+1),s.push(f),s.push(1-p))}return u}};l(Js,"KDBush");var uo=Js;function Pf(r,e,t,n,i,o){if(i-n<=t)return;let a=n+i>>1;lg(r,e,a,n,i,o),Pf(r,e,t,n,a-1,1-o),Pf(r,e,t,a+1,i,1-o)}l(Pf,"sort");function lg(r,e,t,n,i,o){for(;i>n;){if(i-n>600){let c=i-n+1,p=t-n+1,f=Math.log(c),y=.5*Math.exp(2*f/3),m=.5*Math.sqrt(f*y*(c-y)/c)*(p-c/2<0?-1:1),h=Math.max(n,Math.floor(t-p*y/c+m)),d=Math.min(i,Math.floor(t+(c-p)*y/c+m));lg(r,e,t,h,d,o)}let a=e[2*t+o],s=n,u=i;for(lo(r,e,n,t),e[2*i+o]>a&&lo(r,e,n,i);s<u;){for(lo(r,e,s,u),s++,u--;e[2*s+o]<a;)s++;for(;e[2*u+o]>a;)u--}e[2*n+o]===a?lo(r,e,n,u):(u++,lo(r,e,u,i)),u<=t&&(n=u+1),t<=u&&(i=u-1)}}l(lg,"select");function lo(r,e,t,n){vf(r,t,n),vf(e,2*t,2*n),vf(e,2*t+1,2*n+1)}l(lo,"swapItem");function vf(r,e,t){let n=r[e];r[e]=r[t],r[t]=n}l(vf,"swap");function sg(r,e,t,n){let i=r-t,o=e-n;return i*i+o*o}l(sg,"sqDist");var BP={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:l(r=>r,"map")},ug=Math.fround||(r=>e=>(r[0]=+e,r[0]))(new Float32Array(1)),Tr=2,Ht=3,Sf=4,Xt=5,pg=6,wf=class wf{constructor(e){this.options=Object.assign(Object.create(BP),e),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(e){let{log:t,minZoom:n,maxZoom:i}=this.options;t&&console.time("total time");let o="prepare ".concat(e.length," points");t&&console.time(o),this.points=e;let a=[];for(let u=0;u<e.length;u++){let c=e[u];if(!c.geometry)continue;let[p,f]=c.geometry.coordinates,y=ug(Ys(p)),m=ug(Ks(f));a.push(y,m,1/0,u,-1,1),this.options.reduce&&a.push(0)}let s=this.trees[i+1]=this._createTree(a);t&&console.timeEnd(o);for(let u=i;u>=n;u--){let c=+Date.now();s=this.trees[u]=this._createTree(this._cluster(s,u)),t&&console.log("z%d: %d clusters in %dms",u,s.numItems,+Date.now()-c)}return t&&console.timeEnd("total time"),this}getClusters(e,t){let n=((e[0]+180)%360+360)%360-180,i=Math.max(-90,Math.min(90,e[1])),o=e[2]===180?180:((e[2]+180)%360+360)%360-180,a=Math.max(-90,Math.min(90,e[3]));if(e[2]-e[0]>=360)n=-180,o=180;else if(n>o){let f=this.getClusters([n,i,180,a],t),y=this.getClusters([-180,i,o,a],t);return f.concat(y)}let s=this.trees[this._limitZoom(t)],u=s.range(Ys(n),Ks(a),Ys(o),Ks(i)),c=s.data,p=[];for(let f of u){let y=this.stride*f;p.push(c[y+Xt]>1?cg(c,y,this.clusterProps):this.points[c[y+Ht]])}return p}getChildren(e){let t=this._getOriginId(e),n=this._getOriginZoom(e),i="No cluster with the specified id.",o=this.trees[n];if(!o)throw new Error(i);let a=o.data;if(t*this.stride>=a.length)throw new Error(i);let s=this.options.radius/(this.options.extent*Math.pow(2,n-1)),u=a[t*this.stride],c=a[t*this.stride+1],p=o.within(u,c,s),f=[];for(let y of p){let m=y*this.stride;a[m+Sf]===e&&f.push(a[m+Xt]>1?cg(a,m,this.clusterProps):this.points[a[m+Ht]])}if(f.length===0)throw new Error(i);return f}getLeaves(e,t,n){t=t||10,n=n||0;let i=[];return this._appendLeaves(i,e,t,n,0),i}getTile(e,t,n){let i=this.trees[this._limitZoom(e)],o=Math.pow(2,e),{extent:a,radius:s}=this.options,u=s/a,c=(n-u)/o,p=(n+1+u)/o,f={features:[]};return this._addTileFeatures(i.range((t-u)/o,c,(t+1+u)/o,p),i.data,t,n,o,f),t===0&&this._addTileFeatures(i.range(1-u/o,c,1,p),i.data,o,n,o,f),t===o-1&&this._addTileFeatures(i.range(0,c,u/o,p),i.data,-1,n,o,f),f.features.length?f:null}getClusterExpansionZoom(e){let t=this._getOriginZoom(e)-1;for(;t<=this.options.maxZoom;){let n=this.getChildren(e);if(t++,n.length!==1)break;e=n[0].properties.cluster_id}return t}_appendLeaves(e,t,n,i,o){let a=this.getChildren(t);for(let s of a){let u=s.properties;if(u&&u.cluster?o+u.point_count<=i?o+=u.point_count:o=this._appendLeaves(e,u.cluster_id,n,i,o):o<i?o++:e.push(s),e.length===n)break}return o}_createTree(e){let t=new uo(e.length/this.stride|0,this.options.nodeSize,Float32Array);for(let n=0;n<e.length;n+=this.stride)t.add(e[n],e[n+1]);return t.finish(),t.data=e,t}_addTileFeatures(e,t,n,i,o,a){for(let s of e){let u=s*this.stride,c=t[u+Xt]>1,p,f,y;if(c)p=fg(t,u,this.clusterProps),f=t[u],y=t[u+1];else{let d=this.points[t[u+Ht]];p=d.properties;let[x,b]=d.geometry.coordinates;f=Ys(x),y=Ks(b)}let m={type:1,geometry:[[Math.round(this.options.extent*(f*o-n)),Math.round(this.options.extent*(y*o-i))]],tags:p},h;c||this.options.generateId?h=t[u+Ht]:h=this.points[t[u+Ht]].id,h!==void 0&&(m.id=h),a.features.push(m)}}_limitZoom(e){return Math.max(this.options.minZoom,Math.min(Math.floor(+e),this.options.maxZoom+1))}_cluster(e,t){let{radius:n,extent:i,reduce:o,minPoints:a}=this.options,s=n/(i*Math.pow(2,t)),u=e.data,c=[],p=this.stride;for(let f=0;f<u.length;f+=p){if(u[f+Tr]<=t)continue;u[f+Tr]=t;let y=u[f],m=u[f+1],h=e.within(u[f],u[f+1],s),d=u[f+Xt],x=d;for(let b of h){let P=b*p;u[P+Tr]>t&&(x+=u[P+Xt])}if(x>d&&x>=a){let b=y*d,P=m*d,v,S=-1,_=((f/p|0)<<5)+(t+1)+this.points.length;for(let T of h){let I=T*p;if(u[I+Tr]<=t)continue;u[I+Tr]=t;let F=u[I+Xt];b+=u[I]*F,P+=u[I+1]*F,u[I+Sf]=_,o&&(v||(v=this._map(u,f,!0),S=this.clusterProps.length,this.clusterProps.push(v)),o(v,this._map(u,I)))}u[f+Sf]=_,c.push(b/x,P/x,1/0,_,-1,x),o&&c.push(S)}else{for(let b=0;b<p;b++)c.push(u[f+b]);if(x>1)for(let b of h){let P=b*p;if(!(u[P+Tr]<=t)){u[P+Tr]=t;for(let v=0;v<p;v++)c.push(u[P+v])}}}}return c}_getOriginId(e){return e-this.points.length>>5}_getOriginZoom(e){return(e-this.points.length)%32}_map(e,t,n){if(e[t+Xt]>1){let a=this.clusterProps[e[t+pg]];return n?Object.assign({},a):a}let i=this.points[e[t+Ht]].properties,o=this.options.map(i);return n&&o===i?Object.assign({},o):o}};l(wf,"Supercluster");var co=wf;function cg(r,e,t){return{type:"Feature",id:r[e+Ht],properties:fg(r,e,t),geometry:{type:"Point",coordinates:[RP(r[e]),zP(r[e+1])]}}}l(cg,"getClusterJSON");function fg(r,e,t){let n=r[e+Xt],i=n>=1e4?"".concat(Math.round(n/1e3),"k"):n>=1e3?"".concat(Math.round(n/100)/10,"k"):n,o=r[e+pg],a=o===-1?{}:Object.assign({},t[o]);return Object.assign(a,{cluster:!0,cluster_id:r[e+Ht],point_count:n,point_count_abbreviated:i})}l(fg,"getClusterProperties");function Ys(r){return r/360+.5}l(Ys,"lngX");function Ks(r){let e=Math.sin(r*Math.PI/180),t=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return t<0?0:t>1?1:t}l(Ks,"latY");function RP(r){return(r-.5)*360}l(RP,"xLng");function zP(r){let e=(180-r*360)*Math.PI/180;return 360*Math.atan(Math.exp(e))/Math.PI-90}l(zP,"yLat");g();g();g();function po(r,e,t,n){let i=n,o=e+(t-e>>1),a=t-e,s,u=r[e],c=r[e+1],p=r[t],f=r[t+1];for(let y=e+3;y<t;y+=3){let m=OP(r[y],r[y+1],u,c,p,f);if(m>i)s=y,i=m;else if(m===i){let h=Math.abs(y-o);h<a&&(s=y,a=h)}}i>n&&(s-e>3&&po(r,e,s,n),r[s+2]=i,t-s>3&&po(r,s,t,n))}l(po,"simplify");function OP(r,e,t,n,i,o){let a=i-t,s=o-n;if(a!==0||s!==0){let u=((r-t)*a+(e-n)*s)/(a*a+s*s);u>1?(t=i,n=o):u>0&&(t+=a*u,n+=s*u)}return a=r-t,s=e-n,a*a+s*s}l(OP,"getSqSegDist");g();function vt(r,e,t,n){let i={id:r==null?null:r,type:e,geometry:t,tags:n,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};if(e==="Point"||e==="MultiPoint"||e==="LineString")Qs(i,t);else if(e==="Polygon")Qs(i,t[0]);else if(e==="MultiLineString")for(let o of t)Qs(i,o);else if(e==="MultiPolygon")for(let o of t)Qs(i,o[0]);return i}l(vt,"createFeature");function Qs(r,e){for(let t=0;t<e.length;t+=3)r.minX=Math.min(r.minX,e[t]),r.minY=Math.min(r.minY,e[t+1]),r.maxX=Math.max(r.maxX,e[t]),r.maxY=Math.max(r.maxY,e[t+1])}l(Qs,"calcLineBBox");function If(r,e){let t=[];if(r.type==="FeatureCollection")for(let n=0;n<r.features.length;n++)el(t,r.features[n],e,n);else r.type==="Feature"?el(t,r,e):el(t,{geometry:r},e);return t}l(If,"convert");function el(r,e,t,n){if(!e.geometry)return;let i=e.geometry.coordinates;if(i&&i.length===0)return;let o=e.geometry.type,a=Math.pow(t.tolerance/((1<<t.maxZoom)*t.extent),2),s=[],u=e.id;if(t.promoteId?u=e.properties[t.promoteId]:t.generateId&&(u=n||0),o==="Point")yg(i,s);else if(o==="MultiPoint")for(let c of i)yg(c,s);else if(o==="LineString")_f(i,s,a,!1);else if(o==="MultiLineString")if(t.lineMetrics){for(let c of i)s=[],_f(c,s,a,!1),r.push(vt(u,"LineString",s,e.properties));return}else Af(i,s,a,!1);else if(o==="Polygon")Af(i,s,a,!0);else if(o==="MultiPolygon")for(let c of i){let p=[];Af(c,p,a,!0),s.push(p)}else if(o==="GeometryCollection"){for(let c of e.geometry.geometries)el(r,{id:u,geometry:c,properties:e.properties},t,n);return}else throw new Error("Input data is not a valid GeoJSON object.");r.push(vt(u,o,s,e.properties))}l(el,"convertFeature");function yg(r,e){e.push(mg(r[0]),hg(r[1]),0)}l(yg,"convertPoint");function _f(r,e,t,n){let i,o,a=0;for(let u=0;u<r.length;u++){let c=mg(r[u][0]),p=hg(r[u][1]);e.push(c,p,0),u>0&&(n?a+=(i*p-c*o)/2:a+=Math.sqrt(Math.pow(c-i,2)+Math.pow(p-o,2))),i=c,o=p}let s=e.length-3;e[2]=1,po(e,0,s,t),e[s+2]=1,e.size=Math.abs(a),e.start=0,e.end=e.size}l(_f,"convertLine");function Af(r,e,t,n){for(let i=0;i<r.length;i++){let o=[];_f(r[i],o,t,n),e.push(o)}}l(Af,"convertLines");function mg(r){return r/360+.5}l(mg,"projectX");function hg(r){let e=Math.sin(r*Math.PI/180),t=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return t<0?0:t>1?1:t}l(hg,"projectY");g();function We(r,e,t,n,i,o,a,s){if(t/=e,n/=e,o>=t&&a<n)return r;if(a<t||o>=n)return null;let u=[];for(let c of r){let p=c.geometry,f=c.type,y=i===0?c.minX:c.minY,m=i===0?c.maxX:c.maxY;if(y>=t&&m<n){u.push(c);continue}else if(m<t||y>=n)continue;let h=[];if(f==="Point"||f==="MultiPoint")GP(p,h,t,n,i);else if(f==="LineString")gg(p,h,t,n,i,!1,s.lineMetrics);else if(f==="MultiLineString")Tf(p,h,t,n,i,!1);else if(f==="Polygon")Tf(p,h,t,n,i,!0);else if(f==="MultiPolygon")for(let d of p){let x=[];Tf(d,x,t,n,i,!0),x.length&&h.push(x)}if(h.length){if(s.lineMetrics&&f==="LineString"){for(let d of h)u.push(vt(c.id,f,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"),u.push(vt(c.id,f,h,c.tags))}}return u.length?u:null}l(We,"clip");function GP(r,e,t,n,i){for(let o=0;o<r.length;o+=3){let a=r[o+i];a>=t&&a<=n&&pn(e,r[o],r[o+1],r[o+2])}}l(GP,"clipPoints");function gg(r,e,t,n,i,o,a){let s=dg(r),u=i===0?NP:UP,c=r.start,p,f;for(let b=0;b<r.length-3;b+=3){let P=r[b],v=r[b+1],S=r[b+2],_=r[b+3],T=r[b+4],I=i===0?P:v,F=i===0?_:T,D=!1;a&&(p=Math.sqrt(Math.pow(P-_,2)+Math.pow(v-T,2))),I<t?F>t&&(f=u(s,P,v,_,T,t),a&&(s.start=c+p*f)):I>n?F<n&&(f=u(s,P,v,_,T,n),a&&(s.start=c+p*f)):pn(s,P,v,S),F<t&&I>=t&&(f=u(s,P,v,_,T,t),D=!0),F>n&&I<=n&&(f=u(s,P,v,_,T,n),D=!0),!o&&D&&(a&&(s.end=c+p*f),e.push(s),s=dg(r)),a&&(c+=p)}let y=r.length-3,m=r[y],h=r[y+1],d=r[y+2],x=i===0?m:h;x>=t&&x<=n&&pn(s,m,h,d),y=s.length-3,o&&y>=3&&(s[y]!==s[0]||s[y+1]!==s[1])&&pn(s,s[0],s[1],s[2]),s.length&&e.push(s)}l(gg,"clipLine");function dg(r){let e=[];return e.size=r.size,e.start=r.start,e.end=r.end,e}l(dg,"newSlice");function Tf(r,e,t,n,i,o){for(let a of r)gg(a,e,t,n,i,o,!1)}l(Tf,"clipLines");function pn(r,e,t,n){r.push(e,t,n)}l(pn,"addPoint");function NP(r,e,t,n,i,o){let a=(o-e)/(n-e);return pn(r,o,t+(i-t)*a,1),a}l(NP,"intersectX");function UP(r,e,t,n,i,o){let a=(o-t)/(i-t);return pn(r,e+(n-e)*a,o,1),a}l(UP,"intersectY");g();function kf(r,e){let t=e.buffer/e.extent,n=r,i=We(r,1,-1-t,t,0,-1,2,e),o=We(r,1,1-t,2+t,0,-1,2,e);return(i||o)&&(n=We(r,1,-t,1+t,0,-1,2,e)||[],i&&(n=bg(i,1).concat(n)),o&&(n=n.concat(bg(o,-1)))),n}l(kf,"wrap");function bg(r,e){let t=[];for(let n=0;n<r.length;n++){let i=r[n],o=i.type,a;if(o==="Point"||o==="MultiPoint"||o==="LineString")a=Cf(i.geometry,e);else if(o==="MultiLineString"||o==="Polygon"){a=[];for(let s of i.geometry)a.push(Cf(s,e))}else if(o==="MultiPolygon"){a=[];for(let s of i.geometry){let u=[];for(let c of s)u.push(Cf(c,e));a.push(u)}}t.push(vt(i.id,o,a,i.tags))}return t}l(bg,"shiftFeatureCoords");function Cf(r,e){let t=[];t.size=r.size,r.start!==void 0&&(t.start=r.start,t.end=r.end);for(let n=0;n<r.length;n+=3)t.push(r[n]+e,r[n+1],r[n+2]);return t}l(Cf,"shiftCoords");g();function tl(r,e){if(r.transformed)return r;let t=1<<r.z,n=r.x,i=r.y;for(let o of r.features){let a=o.geometry,s=o.type;if(o.geometry=[],s===1)for(let u=0;u<a.length;u+=2)o.geometry.push(xg(a[u],a[u+1],e,t,n,i));else for(let u=0;u<a.length;u++){let c=[];for(let p=0;p<a[u].length;p+=2)c.push(xg(a[u][p],a[u][p+1],e,t,n,i));o.geometry.push(c)}}return r.transformed=!0,r}l(tl,"transformTile");function xg(r,e,t,n,i,o){return[Math.round(t*(r*n-i)),Math.round(t*(e*n-o))]}l(xg,"transformPoint");g();function Ef(r,e,t,n,i){let o=e===i.maxZoom?0:i.tolerance/((1<<e)*i.extent),a={features:[],numPoints:0,numSimplified:0,numFeatures:r.length,source:null,x:t,y:n,z:e,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0};for(let s of r)$P(a,s,o,i);return a}l(Ef,"createTile");function $P(r,e,t,n){let i=e.geometry,o=e.type,a=[];if(r.minX=Math.min(r.minX,e.minX),r.minY=Math.min(r.minY,e.minY),r.maxX=Math.max(r.maxX,e.maxX),r.maxY=Math.max(r.maxY,e.maxY),o==="Point"||o==="MultiPoint")for(let s=0;s<i.length;s+=3)a.push(i[s],i[s+1]),r.numPoints++,r.numSimplified++;else if(o==="LineString")Ff(a,i,r,t,!1,!1);else if(o==="MultiLineString"||o==="Polygon")for(let s=0;s<i.length;s++)Ff(a,i[s],r,t,o==="Polygon",s===0);else if(o==="MultiPolygon")for(let s=0;s<i.length;s++){let u=i[s];for(let c=0;c<u.length;c++)Ff(a,u[c],r,t,!0,c===0)}if(a.length){let s=e.tags||null;if(o==="LineString"&&n.lineMetrics){s={};for(let c in e.tags)s[c]=e.tags[c];s.mapbox_clip_start=i.start/i.size,s.mapbox_clip_end=i.end/i.size}let u={geometry:a,type:o==="Polygon"||o==="MultiPolygon"?3:o==="LineString"||o==="MultiLineString"?2:1,tags:s};e.id!==null&&(u.id=e.id),r.features.push(u)}}l($P,"addFeature");function Ff(r,e,t,n,i,o){let a=n*n;if(n>0&&e.size<(i?a:n)){t.numPoints+=e.length/3;return}let s=[];for(let u=0;u<e.length;u+=3)(n===0||e[u+2]>a)&&(t.numSimplified++,s.push(e[u],e[u+1])),t.numPoints++;i&&jP(s,o),r.push(s)}l(Ff,"addLine");function jP(r,e){let t=0;for(let n=0,i=r.length,o=i-2;n<i;o=n,n+=2)t+=(r[n]-r[o])*(r[n+1]+r[o+1]);if(t>0===e)for(let n=0,i=r.length;n<i/2;n+=2){let o=r[n],a=r[n+1];r[n]=r[i-2-n],r[n+1]=r[i-1-n],r[i-2-n]=o,r[i-1-n]=a}}l(jP,"rewind");var qP={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},Vf=class Vf{constructor(e,t){t=this.options=WP(Object.create(qP),t);let n=t.debug;if(n&&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.");let i=If(e,t);this.tiles={},this.tileCoords=[],n&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",t.indexMaxZoom,t.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),i=kf(i,t),i.length&&this.splitTile(i,0,0,0),n&&(i.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)))}splitTile(e,t,n,i,o,a,s){let u=[e,t,n,i],c=this.options,p=c.debug;for(;u.length;){i=u.pop(),n=u.pop(),t=u.pop(),e=u.pop();let f=1<<t,y=Mf(t,n,i),m=this.tiles[y];if(!m&&(p>1&&console.time("creation"),m=this.tiles[y]=Ef(e,t,n,i,c),this.tileCoords.push({z:t,x:n,y:i}),p)){p>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",t,n,i,m.numFeatures,m.numPoints,m.numSimplified),console.timeEnd("creation"));let F="z".concat(t);this.stats[F]=(this.stats[F]||0)+1,this.total++}if(m.source=e,o==null){if(t===c.indexMaxZoom||m.numPoints<=c.indexMaxPoints)continue}else{if(t===c.maxZoom||t===o)continue;if(o!=null){let F=o-t;if(n!==a>>F||i!==s>>F)continue}}if(m.source=null,e.length===0)continue;p>1&&console.time("clipping");let h=.5*c.buffer/c.extent,d=.5-h,x=.5+h,b=1+h,P=null,v=null,S=null,_=null,T=We(e,f,n-h,n+x,0,m.minX,m.maxX,c),I=We(e,f,n+d,n+b,0,m.minX,m.maxX,c);e=null,T&&(P=We(T,f,i-h,i+x,1,m.minY,m.maxY,c),v=We(T,f,i+d,i+b,1,m.minY,m.maxY,c),T=null),I&&(S=We(I,f,i-h,i+x,1,m.minY,m.maxY,c),_=We(I,f,i+d,i+b,1,m.minY,m.maxY,c),I=null),p>1&&console.timeEnd("clipping"),u.push(P||[],t+1,n*2,i*2),u.push(v||[],t+1,n*2,i*2+1),u.push(S||[],t+1,n*2+1,i*2),u.push(_||[],t+1,n*2+1,i*2+1)}}getTile(e,t,n){e=+e,t=+t,n=+n;let i=this.options,{extent:o,debug:a}=i;if(e<0||e>24)return null;let s=1<<e;t=t+s&s-1;let u=Mf(e,t,n);if(this.tiles[u])return tl(this.tiles[u],o);a>1&&console.log("drilling down to z%d-%d-%d",e,t,n);let c=e,p=t,f=n,y;for(;!y&&c>0;)c--,p=p>>1,f=f>>1,y=this.tiles[Mf(c,p,f)];return!y||!y.source?null:(a>1&&(console.log("found parent tile z%d-%d-%d",c,p,f),console.time("drilling down")),this.splitTile(y.source,c,p,f,e,t,n),a>1&&console.timeEnd("drilling down"),this.tiles[u]?tl(this.tiles[u],o):null)}};l(Vf,"GeoJSONVT");var Lf=Vf;function Mf(r,e,t){return((1<<r)*t+e)*32+r}l(Mf,"toID");function WP(r,e){for(let t in e)r[t]=e[t];return r}l(WP,"extend");function Df(r,e){return new Lf(r,e)}l(Df,"geojsonvt");g();function fo(r,e){return e?r.properties[e]:r.id}l(fo,"getFeatureId");function Bf(r,e){if(r==null)return!0;if(r.type==="Feature")return fo(r,e)!=null;if(r.type==="FeatureCollection"){let t=new Set;for(let n of r.features){let i=fo(n,e);if(i==null||t.has(i))return!1;t.add(i)}return!0}return!1}l(Bf,"isUpdateableGeoJSON");function Rf(r,e){let t=new Map;if(r!=null)if(r.type==="Feature")t.set(fo(r,e),r);else for(let n of r.features)t.set(fo(n,e),n);return t}l(Rf,"toUpdateable");function vg(r,e,t){var n,i,o,a;if(e.removeAll&&r.clear(),e.remove)for(let s of e.remove)r.delete(s);if(e.add)for(let s of e.add){let u=fo(s,t);u!=null&&r.set(u,s)}if(e.update)for(let s of e.update){let u=r.get(s.id);if(u==null)continue;let c=s.newGeometry||s.removeAllProperties,p=!s.removeAllProperties&&(((n=s.removeProperties)==null?void 0:n.length)>0||((i=s.addOrUpdateProperties)==null?void 0:i.length)>0);if((c||p)&&(u=Jt({},u),r.set(s.id,u),p&&(u.properties=Jt({},u.properties))),s.newGeometry&&(u.geometry=s.newGeometry),s.removeAllProperties)u.properties={};else if(((o=s.removeProperties)==null?void 0:o.length)>0)for(let f of s.removeProperties)Object.prototype.hasOwnProperty.call(u.properties,f)&&delete u.properties[f];if(((a=s.addOrUpdateProperties)==null?void 0:a.length)>0)for(let{key:f,value:y}of s.addOrUpdateProperties)u.properties[f]=y}}l(vg,"applySourceDiff");var zf=class zf extends cn{constructor(){super(...arguments);this._dataUpdateable=new Map}async loadVectorTile(t,n){let i=t.tileID.canonical;if(!this._geoJSONIndex)throw new Error("Unable to parse the data into a cluster or geojson");let o=this._geoJSONIndex.getTile(i.z,i.x,i.y);if(!o)return null;let a=new Hs(o.features),s=(0,Sg.default)(a);return(s.byteOffset!==0||s.byteLength!==s.buffer.byteLength)&&(s=new Uint8Array(s)),{vectorTile:a,rawData:s.buffer}}async loadData(t){var i;(i=this._pendingRequest)==null||i.abort();let n=t&&t.request&&t.request.collectResourceTiming?new un(t.request):!1;this._pendingRequest=new AbortController;try{this._pendingData=this.loadAndProcessGeoJSON(t,this._pendingRequest),this._geoJSONIndex=t.cluster?new co(XP(t)).load((await this._pendingData).features):Df(await this._pendingData,t.geojsonVtOptions),this.loaded={};let o={};if(n){let a=n.finish();a&&(o.resourceTiming={},o.resourceTiming[t.source]=JSON.parse(JSON.stringify(a)))}return o}catch(o){if(delete this._pendingRequest,hm(o))return{abandoned:!0};throw o}}async getData(){return this._pendingData}reloadTile(t){let n=this.loaded,i=t.uid;return n&&n[i]?super.reloadTile(t):this.loadTile(t)}async loadAndProcessGeoJSON(t,n){let i=await this.loadGeoJSON(t,n);if(delete this._pendingRequest,typeof i!="object")throw new Error("Input data given to '".concat(t.source,"' is not a valid GeoJSON object."));if((0,Pg.default)(i,!0),t.filter){let o=pr(t.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if(o.result==="error")throw new Error(o.value.map(s=>"".concat(s.key,": ").concat(s.message)).join(", "));i={type:"FeatureCollection",features:i.features.filter(s=>o.value.evaluate({zoom:0},s))}}return i}async loadGeoJSON(t,n){let{promoteId:i}=t;if(t.request){let o=await wm(t.request,n);return this._dataUpdateable=Bf(o.data,i)?Rf(o.data,i):void 0,o.data}if(typeof t.data=="string")try{let o=JSON.parse(t.data);return this._dataUpdateable=Bf(o,i)?Rf(o,i):void 0,o}catch(o){throw new Error("Input data given to '".concat(t.source,"' is not a valid GeoJSON object."))}if(!t.dataDiff)throw new Error("Input data given to '".concat(t.source,"' is not a valid GeoJSON object."));if(!this._dataUpdateable)throw new Error("Cannot update existing geojson data in ".concat(t.source));return vg(this._dataUpdateable,t.dataDiff,i),{type:"FeatureCollection",features:Array.from(this._dataUpdateable.values())}}async removeSource(t){this._pendingRequest&&this._pendingRequest.abort()}getClusterExpansionZoom(t){return this._geoJSONIndex.getClusterExpansionZoom(t.clusterId)}getClusterChildren(t){return this._geoJSONIndex.getChildren(t.clusterId)}getClusterLeaves(t){return this._geoJSONIndex.getLeaves(t.clusterId,t.limit,t.offset)}};l(zf,"GeoJSONWorkerSource");var rl=zf;function XP({superclusterOptions:r,clusterProperties:e}){if(!e||!r)return r;let t={},n={},i={accumulated:null,zoom:0},o={properties:null},a=Object.keys(e);for(let s of a){let[u,c]=e[s],p=pr(c),f=pr(typeof u=="string"?[u,["accumulated"],["get",s]]:u);t[s]=p.value,n[s]=f.value}return r.map=s=>{o.properties=s;let u={};for(let c of a)u[c]=t[c].evaluate(i,o);return u},r.reduce=(s,u)=>{o.properties=u;for(let c of a)i.accumulated=s[c],s[c]=n[c].evaluate(i,o)},r}l(XP,"getSuperclusterOptions");var Of=class Of{constructor(e){this.self=e,this.actor=new wa(e),this.layerIndexes={},this.availableImages={},this.workerSources={},this.demWorkerSources={},this.externalWorkerSourceTypes={},this.self.registerWorkerSource=(t,n)=>{if(this.externalWorkerSourceTypes[t])throw new Error('Worker source with name "'.concat(t,'" already registered.'));this.externalWorkerSourceTypes[t]=n},this.self.addProtocol=gm,this.self.removeProtocol=bm,this.self.registerRTLTextPlugin=t=>{Ie.setMethods(t)},this.actor.registerMessageHandler("LDT",(t,n)=>this._getDEMWorkerSource(t,n.source).loadTile(n)),this.actor.registerMessageHandler("RDT",async(t,n)=>{this._getDEMWorkerSource(t,n.source).removeTile(n)}),this.actor.registerMessageHandler("GCEZ",async(t,n)=>this._getWorkerSource(t,n.type,n.source).getClusterExpansionZoom(n)),this.actor.registerMessageHandler("GCC",async(t,n)=>this._getWorkerSource(t,n.type,n.source).getClusterChildren(n)),this.actor.registerMessageHandler("GCL",async(t,n)=>this._getWorkerSource(t,n.type,n.source).getClusterLeaves(n)),this.actor.registerMessageHandler("LD",(t,n)=>this._getWorkerSource(t,n.type,n.source).loadData(n)),this.actor.registerMessageHandler("GD",(t,n)=>this._getWorkerSource(t,n.type,n.source).getData()),this.actor.registerMessageHandler("LT",(t,n)=>this._getWorkerSource(t,n.type,n.source).loadTile(n)),this.actor.registerMessageHandler("RT",(t,n)=>this._getWorkerSource(t,n.type,n.source).reloadTile(n)),this.actor.registerMessageHandler("AT",(t,n)=>this._getWorkerSource(t,n.type,n.source).abortTile(n)),this.actor.registerMessageHandler("RMT",(t,n)=>this._getWorkerSource(t,n.type,n.source).removeTile(n)),this.actor.registerMessageHandler("RS",async(t,n)=>{if(!this.workerSources[t]||!this.workerSources[t][n.type]||!this.workerSources[t][n.type][n.source])return;let i=this.workerSources[t][n.type][n.source];delete this.workerSources[t][n.type][n.source],i.removeSource!==void 0&&i.removeSource(n)}),this.actor.registerMessageHandler("RM",async t=>{delete this.layerIndexes[t],delete this.availableImages[t],delete this.workerSources[t],delete this.demWorkerSources[t]}),this.actor.registerMessageHandler("SR",async(t,n)=>{this.referrer=n}),this.actor.registerMessageHandler("SRPS",(t,n)=>this._syncRTLPluginState(t,n)),this.actor.registerMessageHandler("IS",async(t,n)=>{this.self.importScripts(n)}),this.actor.registerMessageHandler("SI",(t,n)=>this._setImages(t,n)),this.actor.registerMessageHandler("UL",async(t,n)=>{this._getLayerIndex(t).update(n.layers,n.removedIds)}),this.actor.registerMessageHandler("SL",async(t,n)=>{this._getLayerIndex(t).replace(n)})}async _setImages(e,t){this.availableImages[e]=t;for(let n in this.workerSources[e]){let i=this.workerSources[e][n];for(let o in i)i[o].availableImages=t}}async _syncRTLPluginState(e,t){return await Ie.syncState(t,this.self.importScripts)}_getAvailableImages(e){let t=this.availableImages[e];return t||(t=[]),t}_getLayerIndex(e){let t=this.layerIndexes[e];return t||(t=this.layerIndexes[e]=new Vs),t}_getWorkerSource(e,t,n){if(this.workerSources[e]||(this.workerSources[e]={}),this.workerSources[e][t]||(this.workerSources[e][t]={}),!this.workerSources[e][t][n]){let i={sendAsync:l((o,a)=>(o.targetMapId=e,this.actor.sendAsync(o,a)),"sendAsync")};switch(t){case"vector":this.workerSources[e][t][n]=new cn(i,this._getLayerIndex(e),this._getAvailableImages(e));break;case"geojson":this.workerSources[e][t][n]=new rl(i,this._getLayerIndex(e),this._getAvailableImages(e));break;default:this.workerSources[e][t][n]=new this.externalWorkerSourceTypes[t](i,this._getLayerIndex(e),this._getAvailableImages(e));break}}return this.workerSources[e][t][n]}_getDEMWorkerSource(e,t){return this.demWorkerSources[e]||(this.demWorkerSources[e]={}),this.demWorkerSources[e][t]||(this.demWorkerSources[e][t]=new Ws),this.demWorkerSources[e][t]}};l(Of,"Worker");var nl=Of;ct(self)&&(self.worker=new nl(self));})();
|