@mappedin/mappedin-js 6.0.1-beta.5 → 6.0.1-beta.50
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +80 -6
- package/THIRD_PARTY_LICENSES.txt +9297 -21275
- package/lib/esm/GLTFExporter-NSCWM6JS.js +2 -0
- package/lib/esm/GLTFExporter-NSCWM6JS.js.map +7 -0
- package/lib/esm/GLTFLoader-P7OIN6GY.js +2 -0
- package/lib/esm/GLTFLoader-P7OIN6GY.js.map +7 -0
- package/lib/esm/browser-6V77MKQS.js +2 -0
- package/lib/esm/browser-6V77MKQS.js.map +7 -0
- package/lib/esm/chunk-3JJZGEB7.js +2229 -0
- package/lib/esm/chunk-3JJZGEB7.js.map +7 -0
- package/lib/esm/chunk-AHC6OWNT.js +2 -0
- package/lib/esm/chunk-AHC6OWNT.js.map +7 -0
- package/lib/esm/chunk-DSSOZXRM.js +2 -0
- package/lib/esm/chunk-DSSOZXRM.js.map +7 -0
- package/lib/esm/chunk-I5GOIM6Y.js +578 -0
- package/lib/esm/chunk-I5GOIM6Y.js.map +7 -0
- package/lib/esm/chunk-JEQGUEFF.js +2 -0
- package/lib/esm/chunk-JEQGUEFF.js.map +7 -0
- package/lib/esm/chunk-SPVBFPOK.js +3820 -0
- package/lib/esm/chunk-SPVBFPOK.js.map +7 -0
- package/lib/esm/chunk-YDKOKGLT.js +2 -0
- package/lib/esm/chunk-YDKOKGLT.js.map +7 -0
- package/lib/esm/fonts/roboto-regular.ttf +0 -0
- package/lib/esm/index.css +2 -1
- package/lib/esm/index.css.map +7 -0
- package/lib/esm/index.d.ts +11858 -4851
- package/lib/esm/index.js +2 -1
- package/lib/esm/index.js.map +7 -0
- package/lib/esm/inspector-GKTULNKY.js +483 -0
- package/lib/esm/inspector-GKTULNKY.js.map +7 -0
- package/lib/esm/inspector-S63NMDZZ.css +2 -0
- package/lib/esm/inspector-S63NMDZZ.css.map +7 -0
- package/lib/esm/internal-CE37LADZ.js +2 -0
- package/lib/esm/internal-CE37LADZ.js.map +7 -0
- package/lib/esm/internal-WH523TQS.css +2 -0
- package/lib/esm/internal-WH523TQS.css.map +7 -0
- package/lib/esm/outdoor-context-v4-OHJPVR4U.js +2 -0
- package/lib/esm/outdoor-context-v4-OHJPVR4U.js.map +7 -0
- package/lib/esm/roboto-regular-25PMWR2T.js +2 -0
- package/lib/esm/roboto-regular-25PMWR2T.js.map +7 -0
- package/lib/esm/text3d-QUUOTI5N.js +253 -0
- package/lib/esm/text3d-QUUOTI5N.js.map +7 -0
- package/lib/esm/workers/collision-worker.csp.js +1 -0
- package/lib/esm/workers/maplibre-worker.csp.js +2 -0
- package/lib/index-rn.js +649 -0
- package/lib/index.css +2 -1
- package/package.json +17 -14
- package/lib/esm/GLTFExporter-7Y4D6ZCC.js +0 -1
- package/lib/esm/GLTFLoader-ZJM7FISZ.js +0 -1
- package/lib/esm/browser-B7ZG64S7.js +0 -1
- package/lib/esm/chunk-FO75RVA4.js +0 -1
- package/lib/esm/chunk-OPKWNXJZ.js +0 -1
- package/lib/esm/chunk-TQW6Y4JF.js +0 -1
- package/lib/esm/chunk-WIRGVYAE.js +0 -1
- package/lib/esm/chunk-WJRLWIOO.js +0 -1
- package/lib/esm/inspector-L7HL2664.js +0 -1
- package/lib/esm/inspector-OZDC5DPH.css +0 -1
- package/lib/esm/outdoor-context-v4-R6AN2YQ4.js +0 -1
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
(()=>{var wy=Object.create;var ki=Object.defineProperty;var Ay=Object.getOwnPropertyDescriptor;var _y=Object.getOwnPropertyNames;var Iy=Object.getPrototypeOf,Ty=Object.prototype.hasOwnProperty;var u=(t,e)=>ki(t,"name",{value:e,configurable:!0});var Cy=(t,e)=>()=>(t&&(e=t(t=0)),e);var Te=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),zl=(t,e)=>{for(var r in e)ki(t,r,{get:e[r],enumerable:!0})},ky=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of _y(e))!Ty.call(t,i)&&i!==r&&ki(t,i,{get:()=>e[i],enumerable:!(n=Ay(e,i))||n.enumerable});return t};var X=(t,e,r)=>(r=t!=null?wy(Iy(t)):{},ky(e||!t||!t.__esModule?ki(r,"default",{value:t,enumerable:!0}):r,t));var x=Cy(()=>{});var xe=Te((h0,Rl)=>{"use strict";x();Rl.exports=ur;function ur(t,e){this.x=t,this.y=e}u(ur,"Point");ur.prototype={clone:u(function(){return new ur(this.x,this.y)},"clone"),add:u(function(t){return this.clone()._add(t)},"add"),sub:u(function(t){return this.clone()._sub(t)},"sub"),multByPoint:u(function(t){return this.clone()._multByPoint(t)},"multByPoint"),divByPoint:u(function(t){return this.clone()._divByPoint(t)},"divByPoint"),mult:u(function(t){return this.clone()._mult(t)},"mult"),div:u(function(t){return this.clone()._div(t)},"div"),rotate:u(function(t){return this.clone()._rotate(t)},"rotate"),rotateAround:u(function(t,e){return this.clone()._rotateAround(t,e)},"rotateAround"),matMult:u(function(t){return this.clone()._matMult(t)},"matMult"),unit:u(function(){return this.clone()._unit()},"unit"),perp:u(function(){return this.clone()._perp()},"perp"),round:u(function(){return this.clone()._round()},"round"),mag:u(function(){return Math.sqrt(this.x*this.x+this.y*this.y)},"mag"),equals:u(function(t){return this.x===t.x&&this.y===t.y},"equals"),dist:u(function(t){return Math.sqrt(this.distSqr(t))},"dist"),distSqr:u(function(t){var e=t.x-this.x,r=t.y-this.y;return e*e+r*r},"distSqr"),angle:u(function(){return Math.atan2(this.y,this.x)},"angle"),angleTo:u(function(t){return Math.atan2(this.y-t.y,this.x-t.x)},"angleTo"),angleWith:u(function(t){return this.angleWithSep(t.x,t.y)},"angleWith"),angleWithSep:u(function(t,e){return Math.atan2(this.x*e-this.y*t,this.x*t+this.y*e)},"angleWithSep"),_matMult:u(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:u(function(t){return this.x+=t.x,this.y+=t.y,this},"_add"),_sub:u(function(t){return this.x-=t.x,this.y-=t.y,this},"_sub"),_mult:u(function(t){return this.x*=t,this.y*=t,this},"_mult"),_div:u(function(t){return this.x/=t,this.y/=t,this},"_div"),_multByPoint:u(function(t){return this.x*=t.x,this.y*=t.y,this},"_multByPoint"),_divByPoint:u(function(t){return this.x/=t.x,this.y/=t.y,this},"_divByPoint"),_unit:u(function(){return this._div(this.mag()),this},"_unit"),_perp:u(function(){var t=this.y;return this.y=this.x,this.x=-t,this},"_perp"),_rotate:u(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:u(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:u(function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},"_round")};ur.convert=function(t){return t instanceof ur?t:Array.isArray(t)?new ur(t[0],t[1]):t}});var Ul=Te((x0,Nl)=>{"use strict";x();Nl.exports=Ol;function Ol(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}u(Ol,"UnitBezier");Ol.prototype={sampleCurveX:u(function(t){return((this.ax*t+this.bx)*t+this.cx)*t},"sampleCurveX"),sampleCurveY:u(function(t){return((this.ay*t+this.by)*t+this.cy)*t},"sampleCurveY"),sampleCurveDerivativeX:u(function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},"sampleCurveDerivativeX"),solveCurveX:u(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:u(function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))},"solve")}});var Cc=Te((K1,Cs)=>{x();function fd(t,e){var r,n,i,o,a,s,l,c,p,f;for(r=t.length&3,n=t.length-r,i=e,a=3432918353,l=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)*l+(((p>>>16)*l&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)*l+(((p>>>16)*l&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}u(fd,"murmurhash3_32_gc");typeof Cs<"u"&&(Cs.exports=fd)});var kc=Te((eP,ks)=>{x();function yd(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}u(yd,"murmurhash2_32_gc");typeof ks!==void 0&&(ks.exports=yd)});var Ms=Te((nP,Do)=>{x();var Mc=Cc(),md=kc();Do.exports=Mc;Do.exports.murmur3=Mc;Do.exports.murmur2=md});var Gs=Te((Nw,$s)=>{"use strict";x();$s.exports=Zo;$s.exports.default=Zo;function Zo(t,e,r){r=r||2;var n=e&&e.length,i=n?e[0]*r:t.length,o=dp(t,0,i,r,!0),a=[];if(!o||o.next===o.prev)return a;var s,l,c,p,f,y,m;if(n&&(o=ex(t,e,o,r)),t.length>80*r){s=c=t[0],l=p=t[1];for(var h=r;h<i;h+=r)f=t[h],y=t[h+1],f<s&&(s=f),y<l&&(l=y),f>c&&(c=f),y>p&&(p=y);m=Math.max(c-s,p-l),m=m!==0?32767/m:0}return Xn(o,a,r,s,l,m,0),a}u(Zo,"earcut");function dp(t,e,r,n,i){var o,a;if(i===Us(t,e,r,n)>0)for(o=e;o<r;o+=n)a=hp(o,t[o],t[o+1],a);else for(o=r-n;o>=e;o-=n)a=hp(o,t[o],t[o+1],a);return a&&Wo(a,a.next)&&(Yn(a),a=a.next),a}u(dp,"linkedList");function nr(t,e){if(!t)return t;e||(e=t);var r=t,n;do if(n=!1,!r.steiner&&(Wo(r,r.next)||le(r.prev,r,r.next)===0)){if(Yn(r),r=e=r.prev,r===r.next)break;n=!0}else r=r.next;while(n||r!==e);return e}u(nr,"filterPoints");function Xn(t,e,r,n,i,o,a){if(t){!a&&o&&ox(t,n,i,o);for(var s=t,l,c;t.prev!==t.next;){if(l=t.prev,c=t.next,o?Kg(t,n,i,o):Xg(t)){e.push(l.i/r|0),e.push(t.i/r|0),e.push(c.i/r|0),Yn(t),t=c.next,s=c.next;continue}if(t=c,t===s){a?a===1?(t=Yg(nr(t),e,r),Xn(t,e,r,n,i,o,2)):a===2&&Qg(t,e,r,n,i,o):Xn(nr(t),e,r,n,i,o,1);break}}}}u(Xn,"earcutLinked");function Xg(t){var e=t.prev,r=t,n=t.next;if(le(e,r,n)>=0)return!1;for(var i=e.x,o=r.x,a=n.x,s=e.y,l=r.y,c=n.y,p=i<o?i<a?i:a:o<a?o:a,f=s<l?s<c?s:c:l<c?l:c,y=i>o?i>a?i:a:o>a?o:a,m=s>l?s>c?s:c:l>c?l:c,h=n.next;h!==e;){if(h.x>=p&&h.x<=y&&h.y>=f&&h.y<=m&&Cr(i,s,o,l,a,c,h.x,h.y)&&le(h.prev,h,h.next)>=0)return!1;h=h.next}return!0}u(Xg,"isEar");function Kg(t,e,r,n){var i=t.prev,o=t,a=t.next;if(le(i,o,a)>=0)return!1;for(var s=i.x,l=o.x,c=a.x,p=i.y,f=o.y,y=a.y,m=s<l?s<c?s:c:l<c?l:c,h=p<f?p<y?p:y:f<y?f:y,d=s>l?s>c?s:c:l>c?l:c,g=p>f?p>y?p:y:f>y?f:y,b=Os(m,h,e,r,n),P=Os(d,g,e,r,n),v=t.prevZ,S=t.nextZ;v&&v.z>=b&&S&&S.z<=P;){if(v.x>=m&&v.x<=d&&v.y>=h&&v.y<=g&&v!==i&&v!==a&&Cr(s,p,l,f,c,y,v.x,v.y)&&le(v.prev,v,v.next)>=0||(v=v.prevZ,S.x>=m&&S.x<=d&&S.y>=h&&S.y<=g&&S!==i&&S!==a&&Cr(s,p,l,f,c,y,S.x,S.y)&&le(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<=g&&v!==i&&v!==a&&Cr(s,p,l,f,c,y,v.x,v.y)&&le(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<=g&&S!==i&&S!==a&&Cr(s,p,l,f,c,y,S.x,S.y)&&le(S.prev,S,S.next)>=0)return!1;S=S.nextZ}return!0}u(Kg,"isEarHashed");function Yg(t,e,r){var n=t;do{var i=n.prev,o=n.next.next;!Wo(i,o)&&gp(i,n,n.next,o)&&Kn(i,o)&&Kn(o,i)&&(e.push(i.i/r|0),e.push(n.i/r|0),e.push(o.i/r|0),Yn(n),Yn(n.next),n=t=o),n=n.next}while(n!==t);return nr(n)}u(Yg,"cureLocalIntersections");function Qg(t,e,r,n,i,o){var a=t;do{for(var s=a.next.next;s!==a.prev;){if(a.i!==s.i&&lx(a,s)){var l=xp(a,s);a=nr(a,a.next),l=nr(l,l.next),Xn(a,e,r,n,i,o,0),Xn(l,e,r,n,i,o,0);return}s=s.next}a=a.next}while(a!==t)}u(Qg,"splitEarcut");function ex(t,e,r,n){var i=[],o,a,s,l,c;for(o=0,a=e.length;o<a;o++)s=e[o]*n,l=o<a-1?e[o+1]*n:t.length,c=dp(t,s,l,n,!1),c===c.next&&(c.steiner=!0),i.push(sx(c));for(i.sort(tx),o=0;o<i.length;o++)r=rx(i[o],r);return r}u(ex,"eliminateHoles");function tx(t,e){return t.x-e.x}u(tx,"compareX");function rx(t,e){var r=nx(t,e);if(!r)return e;var n=xp(r,t);return nr(n,n.next),nr(r,r.next)}u(rx,"eliminateHole");function nx(t,e){var r=e,n=t.x,i=t.y,o=-1/0,a;do{if(i<=r.y&&i>=r.next.y&&r.next.y!==r.y){var s=r.x+(i-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(s<=n&&s>o&&(o=s,a=r.x<r.next.x?r:r.next,s===n))return a}r=r.next}while(r!==e);if(!a)return null;var l=a,c=a.x,p=a.y,f=1/0,y;r=a;do n>=r.x&&r.x>=c&&n!==r.x&&Cr(i<p?n:o,i,c,p,i<p?o:n,i,r.x,r.y)&&(y=Math.abs(i-r.y)/(n-r.x),Kn(r,t)&&(y<f||y===f&&(r.x>a.x||r.x===a.x&&ix(a,r)))&&(a=r,f=y)),r=r.next;while(r!==l);return a}u(nx,"findHoleBridge");function ix(t,e){return le(t.prev,t,e.prev)<0&&le(e.next,t,t.next)<0}u(ix,"sectorContainsSector");function ox(t,e,r,n){var i=t;do i.z===0&&(i.z=Os(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,ax(i)}u(ox,"indexCurve");function ax(t){var e,r,n,i,o,a,s,l,c=1;do{for(r=t,t=null,o=null,a=0;r;){for(a++,n=r,s=0,e=0;e<c&&(s++,n=n.nextZ,!!n);e++);for(l=c;s>0||l>0&&n;)s!==0&&(l===0||!n||r.z<=n.z)?(i=r,r=r.nextZ,s--):(i=n,n=n.nextZ,l--),o?o.nextZ=i:t=i,i.prevZ=o,o=i;r=n}o.nextZ=null,c*=2}while(a>1);return t}u(ax,"sortLinked");function Os(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}u(Os,"zOrder");function sx(t){var 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}u(sx,"getLeftmost");function Cr(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)}u(Cr,"pointInTriangle");function lx(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!ux(t,e)&&(Kn(t,e)&&Kn(e,t)&&cx(t,e)&&(le(t.prev,t,e.prev)||le(t,e.prev,e))||Wo(t,e)&&le(t.prev,t,t.next)>0&&le(e.prev,e,e.next)>0)}u(lx,"isValidDiagonal");function le(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}u(le,"area");function Wo(t,e){return t.x===e.x&&t.y===e.y}u(Wo,"equals");function gp(t,e,r,n){var i=Jo(le(t,e,r)),o=Jo(le(t,e,n)),a=Jo(le(r,n,t)),s=Jo(le(r,n,e));return!!(i!==o&&a!==s||i===0&&jo(t,r,e)||o===0&&jo(t,n,e)||a===0&&jo(r,t,n)||s===0&&jo(r,e,n))}u(gp,"intersects");function jo(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)}u(jo,"onSegment");function Jo(t){return t>0?1:t<0?-1:0}u(Jo,"sign");function ux(t,e){var r=t;do{if(r.i!==t.i&&r.next.i!==t.i&&r.i!==e.i&&r.next.i!==e.i&&gp(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}u(ux,"intersectsPolygon");function Kn(t,e){return le(t.prev,t,t.next)<0?le(t,e,t.next)>=0&&le(t,t.prev,e)>=0:le(t,e,t.prev)<0||le(t,t.next,e)<0}u(Kn,"locallyInside");function cx(t,e){var 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}u(cx,"middleInside");function xp(t,e){var r=new Ns(t.i,t.x,t.y),n=new Ns(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}u(xp,"splitPolygon");function hp(t,e,r,n){var i=new Ns(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}u(hp,"insertNode");function Yn(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)}u(Yn,"removeNode");function Ns(t,e,r){this.i=t,this.x=e,this.y=r,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}u(Ns,"Node");Zo.deviation=function(t,e,r,n){var i=e&&e.length,o=i?e[0]*r:t.length,a=Math.abs(Us(t,0,o,r));if(i)for(var s=0,l=e.length;s<l;s++){var c=e[s]*r,p=s<l-1?e[s+1]*r:t.length;a-=Math.abs(Us(t,c,p,r))}var f=0;for(s=0;s<n.length;s+=3){var y=n[s]*r,m=n[s+1]*r,h=n[s+2]*r;f+=Math.abs((t[y]-t[h])*(t[m+1]-t[y+1])-(t[y]-t[m])*(t[h+1]-t[y+1]))}return a===0&&f===0?0:Math.abs((f-a)/a)};function Us(t,e,r,n){for(var i=0,o=e,a=r-n;o<r;o+=n)i+=(t[a]-t[o])*(t[o+1]+t[a+1]),a=o;return i}u(Us,"signedArea");Zo.flatten=function(t){for(var e=t[0][0].length,r={vertices:[],holes:[],dimensions:e},n=0,i=0;i<t.length;i++){for(var o=0;o<t[i].length;o++)for(var a=0;a<e;a++)r.vertices.push(t[i][o][a]);i>0&&(n+=t[i-1].length,r.holes.push(n))}return r}});var js=Te((R2,Ip)=>{"use strict";x();var gx=xe();Ip.exports=Fr;function Fr(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(xx,this,e)}u(Fr,"VectorTileFeature");function xx(t,e,r){t==1?e.id=r.readVarint():t==2?bx(r,e):t==3?e.type=r.readVarint():t==4&&(e._geometry=r.pos)}u(xx,"readFeature");function bx(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}}u(bx,"readTag");Fr.types=["Unknown","Point","LineString","Polygon"];Fr.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 l=t.readVarint();r=l&7,n=l>>3}if(n--,r===1||r===2)i+=t.readSVarint(),o+=t.readSVarint(),r===1&&(s&&a.push(s),s=[]),s.push(new gx(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};Fr.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,l=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<l&&(l=o),o>c&&(c=o);else if(r!==7)throw new Error("unknown command "+r)}return[a,l,s,c]};Fr.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=Fr.types[this.type],l,c;function p(m){for(var h=0;h<m.length;h++){var d=m[h],g=180-(d.y+o)*360/n;m[h]=[(d.x+i)*360/n-180,360/Math.PI*Math.atan(Math.exp(g*Math.PI/180))-90]}}switch(u(p,"project"),this.type){case 1:var f=[];for(l=0;l<a.length;l++)f[l]=a[l][0];a=f,p(a);break;case 2:for(l=0;l<a.length;l++)p(a[l]);break;case 3:for(a=vx(a),l=0;l<a.length;l++)for(c=0;c<a[l].length;c++)p(a[l][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 vx(t){var e=t.length;if(e<=1)return[t];for(var r=[],n,i,o=0;o<e;o++){var a=Px(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}u(vx,"classifyRings");function Px(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}u(Px,"signedArea")});var Js=Te((U2,Cp)=>{"use strict";x();var Sx=js();Cp.exports=Tp;function Tp(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(wx,this,e),this.length=this._features.length}u(Tp,"VectorTileLayer");function wx(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(Ax(r))}u(wx,"readLayer");function Ax(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}u(Ax,"readValueMessage");Tp.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 Sx(this._pbf,e,this.extent,this._keys,this._values)}});var Mp=Te((q2,kp)=>{"use strict";x();var _x=Js();kp.exports=Ix;function Ix(t,e){this.layers=t.readFields(Tx,{},e)}u(Ix,"VectorTile");function Tx(t,e,r){if(t===3){var n=new _x(r,r.readVarint()+r.pos);n.length&&(e[n.name]=n)}}u(Tx,"readTile")});var Mt=Te((Z2,Xo)=>{x();Xo.exports.VectorTile=Mp();Xo.exports.VectorTileFeature=js();Xo.exports.VectorTileLayer=Js()});var Kp=Te(Ks=>{x();Ks.read=function(t,e,r,n,i){var o,a,s=i*8-n-1,l=(1<<s)-1,c=l>>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===l)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)};Ks.write=function(t,e,r,n,i,o){var a,s,l,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*(l=Math.pow(2,-a))<1&&(a--,l*=2),a+f>=1?e+=y/l:e+=y*Math.pow(2,1-f),e*l>=2&&(a++,l/=2),a+f>=p?(s=0,a=p):a+f>=1?(s=(e*l-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 ri=Te((Q_,rf)=>{"use strict";x();rf.exports=H;var ta=Kp();function H(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}u(H,"Pbf");H.Varint=0;H.Fixed64=1;H.Bytes=2;H.Fixed32=5;var Ys=65536*65536,Yp=1/Ys,Jx=12,tf=typeof TextDecoder>"u"?null:new TextDecoder("utf-8");H.prototype={destroy:u(function(){this.buf=null},"destroy"),readFields:u(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:u(function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},"readMessage"),readFixed32:u(function(){var t=ra(this.buf,this.pos);return this.pos+=4,t},"readFixed32"),readSFixed32:u(function(){var t=ef(this.buf,this.pos);return this.pos+=4,t},"readSFixed32"),readFixed64:u(function(){var t=ra(this.buf,this.pos)+ra(this.buf,this.pos+4)*Ys;return this.pos+=8,t},"readFixed64"),readSFixed64:u(function(){var t=ra(this.buf,this.pos)+ef(this.buf,this.pos+4)*Ys;return this.pos+=8,t},"readSFixed64"),readFloat:u(function(){var t=ta.read(this.buf,this.pos,!0,23,4);return this.pos+=4,t},"readFloat"),readDouble:u(function(){var t=ta.read(this.buf,this.pos,!0,52,8);return this.pos+=8,t},"readDouble"),readVarint:u(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,Zx(r,t,this))},"readVarint"),readVarint64:u(function(){return this.readVarint(!0)},"readVarint64"),readSVarint:u(function(){var t=this.readVarint();return t%2===1?(t+1)/-2:t/2},"readSVarint"),readBoolean:u(function(){return!!this.readVarint()},"readBoolean"),readString:u(function(){var t=this.readVarint()+this.pos,e=this.pos;return this.pos=t,t-e>=Jx&&tf?sb(this.buf,e,t):ab(this.buf,e,t)},"readString"),readBytes:u(function(){var t=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,t);return this.pos=t,e},"readBytes"),readPackedVarint:u(function(t,e){if(this.type!==H.Bytes)return t.push(this.readVarint(e));var r=yt(this);for(t=t||[];this.pos<r;)t.push(this.readVarint(e));return t},"readPackedVarint"),readPackedSVarint:u(function(t){if(this.type!==H.Bytes)return t.push(this.readSVarint());var e=yt(this);for(t=t||[];this.pos<e;)t.push(this.readSVarint());return t},"readPackedSVarint"),readPackedBoolean:u(function(t){if(this.type!==H.Bytes)return t.push(this.readBoolean());var e=yt(this);for(t=t||[];this.pos<e;)t.push(this.readBoolean());return t},"readPackedBoolean"),readPackedFloat:u(function(t){if(this.type!==H.Bytes)return t.push(this.readFloat());var e=yt(this);for(t=t||[];this.pos<e;)t.push(this.readFloat());return t},"readPackedFloat"),readPackedDouble:u(function(t){if(this.type!==H.Bytes)return t.push(this.readDouble());var e=yt(this);for(t=t||[];this.pos<e;)t.push(this.readDouble());return t},"readPackedDouble"),readPackedFixed32:u(function(t){if(this.type!==H.Bytes)return t.push(this.readFixed32());var e=yt(this);for(t=t||[];this.pos<e;)t.push(this.readFixed32());return t},"readPackedFixed32"),readPackedSFixed32:u(function(t){if(this.type!==H.Bytes)return t.push(this.readSFixed32());var e=yt(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed32());return t},"readPackedSFixed32"),readPackedFixed64:u(function(t){if(this.type!==H.Bytes)return t.push(this.readFixed64());var e=yt(this);for(t=t||[];this.pos<e;)t.push(this.readFixed64());return t},"readPackedFixed64"),readPackedSFixed64:u(function(t){if(this.type!==H.Bytes)return t.push(this.readSFixed64());var e=yt(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed64());return t},"readPackedSFixed64"),skip:u(function(t){var e=t&7;if(e===H.Varint)for(;this.buf[this.pos++]>127;);else if(e===H.Bytes)this.pos=this.readVarint()+this.pos;else if(e===H.Fixed32)this.pos+=4;else if(e===H.Fixed64)this.pos+=8;else throw new Error("Unimplemented type: "+e)},"skip"),writeTag:u(function(t,e){this.writeVarint(t<<3|e)},"writeTag"),realloc:u(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:u(function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},"finish"),writeFixed32:u(function(t){this.realloc(4),Vr(this.buf,t,this.pos),this.pos+=4},"writeFixed32"),writeSFixed32:u(function(t){this.realloc(4),Vr(this.buf,t,this.pos),this.pos+=4},"writeSFixed32"),writeFixed64:u(function(t){this.realloc(8),Vr(this.buf,t&-1,this.pos),Vr(this.buf,Math.floor(t*Yp),this.pos+4),this.pos+=8},"writeFixed64"),writeSFixed64:u(function(t){this.realloc(8),Vr(this.buf,t&-1,this.pos),Vr(this.buf,Math.floor(t*Yp),this.pos+4),this.pos+=8},"writeSFixed64"),writeVarint:u(function(t){if(t=+t||0,t>268435455||t<0){Wx(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:u(function(t){this.writeVarint(t<0?-t*2-1:t*2)},"writeSVarint"),writeBoolean:u(function(t){this.writeVarint(!!t)},"writeBoolean"),writeString:u(function(t){t=String(t),this.realloc(t.length*4),this.pos++;var e=this.pos;this.pos=lb(this.buf,t,this.pos);var r=this.pos-e;r>=128&&Qp(e,r,this),this.pos=e-1,this.writeVarint(r),this.pos+=r},"writeString"),writeFloat:u(function(t){this.realloc(4),ta.write(this.buf,t,this.pos,!0,23,4),this.pos+=4},"writeFloat"),writeDouble:u(function(t){this.realloc(8),ta.write(this.buf,t,this.pos,!0,52,8),this.pos+=8},"writeDouble"),writeBytes:u(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:u(function(t,e){this.pos++;var r=this.pos;t(e,this);var n=this.pos-r;n>=128&&Qp(r,n,this),this.pos=r-1,this.writeVarint(n),this.pos+=n},"writeRawMessage"),writeMessage:u(function(t,e,r){this.writeTag(t,H.Bytes),this.writeRawMessage(e,r)},"writeMessage"),writePackedVarint:u(function(t,e){e.length&&this.writeMessage(t,Kx,e)},"writePackedVarint"),writePackedSVarint:u(function(t,e){e.length&&this.writeMessage(t,Yx,e)},"writePackedSVarint"),writePackedBoolean:u(function(t,e){e.length&&this.writeMessage(t,tb,e)},"writePackedBoolean"),writePackedFloat:u(function(t,e){e.length&&this.writeMessage(t,Qx,e)},"writePackedFloat"),writePackedDouble:u(function(t,e){e.length&&this.writeMessage(t,eb,e)},"writePackedDouble"),writePackedFixed32:u(function(t,e){e.length&&this.writeMessage(t,rb,e)},"writePackedFixed32"),writePackedSFixed32:u(function(t,e){e.length&&this.writeMessage(t,nb,e)},"writePackedSFixed32"),writePackedFixed64:u(function(t,e){e.length&&this.writeMessage(t,ib,e)},"writePackedFixed64"),writePackedSFixed64:u(function(t,e){e.length&&this.writeMessage(t,ob,e)},"writePackedSFixed64"),writeBytesField:u(function(t,e){this.writeTag(t,H.Bytes),this.writeBytes(e)},"writeBytesField"),writeFixed32Field:u(function(t,e){this.writeTag(t,H.Fixed32),this.writeFixed32(e)},"writeFixed32Field"),writeSFixed32Field:u(function(t,e){this.writeTag(t,H.Fixed32),this.writeSFixed32(e)},"writeSFixed32Field"),writeFixed64Field:u(function(t,e){this.writeTag(t,H.Fixed64),this.writeFixed64(e)},"writeFixed64Field"),writeSFixed64Field:u(function(t,e){this.writeTag(t,H.Fixed64),this.writeSFixed64(e)},"writeSFixed64Field"),writeVarintField:u(function(t,e){this.writeTag(t,H.Varint),this.writeVarint(e)},"writeVarintField"),writeSVarintField:u(function(t,e){this.writeTag(t,H.Varint),this.writeSVarint(e)},"writeSVarintField"),writeStringField:u(function(t,e){this.writeTag(t,H.Bytes),this.writeString(e)},"writeStringField"),writeFloatField:u(function(t,e){this.writeTag(t,H.Fixed32),this.writeFloat(e)},"writeFloatField"),writeDoubleField:u(function(t,e){this.writeTag(t,H.Fixed64),this.writeDouble(e)},"writeDoubleField"),writeBooleanField:u(function(t,e){this.writeVarintField(t,!!e)},"writeBooleanField")};function Zx(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 Dr(t,i,e);throw new Error("Expected varint not more than 10 bytes")}u(Zx,"readVarintRemainder");function yt(t){return t.type===H.Bytes?t.readVarint()+t.pos:t.pos+1}u(yt,"readPackedEnd");function Dr(t,e,r){return r?e*4294967296+(t>>>0):(e>>>0)*4294967296+(t>>>0)}u(Dr,"toNum");function Wx(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),Hx(r,n,e),Xx(n,e)}u(Wx,"writeBigVarint");function Hx(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}u(Hx,"writeBigVarintLow");function Xx(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)))))}u(Xx,"writeBigVarintHigh");function Qp(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]}u(Qp,"makeRoomForExtraLength");function Kx(t,e){for(var r=0;r<t.length;r++)e.writeVarint(t[r])}u(Kx,"writePackedVarint");function Yx(t,e){for(var r=0;r<t.length;r++)e.writeSVarint(t[r])}u(Yx,"writePackedSVarint");function Qx(t,e){for(var r=0;r<t.length;r++)e.writeFloat(t[r])}u(Qx,"writePackedFloat");function eb(t,e){for(var r=0;r<t.length;r++)e.writeDouble(t[r])}u(eb,"writePackedDouble");function tb(t,e){for(var r=0;r<t.length;r++)e.writeBoolean(t[r])}u(tb,"writePackedBoolean");function rb(t,e){for(var r=0;r<t.length;r++)e.writeFixed32(t[r])}u(rb,"writePackedFixed32");function nb(t,e){for(var r=0;r<t.length;r++)e.writeSFixed32(t[r])}u(nb,"writePackedSFixed32");function ib(t,e){for(var r=0;r<t.length;r++)e.writeFixed64(t[r])}u(ib,"writePackedFixed64");function ob(t,e){for(var r=0;r<t.length;r++)e.writeSFixed64(t[r])}u(ob,"writePackedSFixed64");function ra(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+t[e+3]*16777216}u(ra,"readUInt32");function Vr(t,e,r){t[r]=e,t[r+1]=e>>>8,t[r+2]=e>>>16,t[r+3]=e>>>24}u(Vr,"writeInt32");function ef(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}u(ef,"readInt32");function ab(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 l,c,p;s===1?o<128&&(a=o):s===2?(l=t[i+1],(l&192)===128&&(a=(o&31)<<6|l&63,a<=127&&(a=null))):s===3?(l=t[i+1],c=t[i+2],(l&192)===128&&(c&192)===128&&(a=(o&15)<<12|(l&63)<<6|c&63,(a<=2047||a>=55296&&a<=57343)&&(a=null))):s===4&&(l=t[i+1],c=t[i+2],p=t[i+3],(l&192)===128&&(c&192)===128&&(p&192)===128&&(a=(o&15)<<18|(l&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}u(ab,"readUtf8");function sb(t,e,r){return tf.decode(t.subarray(e,r))}u(sb,"readUtf8TextDecoder");function lb(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}u(lb,"writeUtf8")});var Yf=Te((IE,Kf)=>{x();Kf.exports=_a;function _a(t,e){var r=t&&t.type,n;if(r==="FeatureCollection")for(n=0;n<t.features.length;n++)_a(t.features[n],e);else if(r==="GeometryCollection")for(n=0;n<t.geometries.length;n++)_a(t.geometries[n],e);else if(r==="Feature")_a(t.geometry,e);else if(r==="Polygon")Hf(t.coordinates,e);else if(r==="MultiPolygon")for(n=0;n<t.coordinates.length;n++)Hf(t.coordinates[n],e);return t}u(_a,"rewind");function Hf(t,e){if(t.length!==0){Xf(t[0],e);for(var r=1;r<t.length;r++)Xf(t[r],!e)}}u(Hf,"rewindRings");function Xf(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]),l=r+s;n+=Math.abs(r)>=Math.abs(s)?r-l+s:s-l+r,r=l}r+n>=0!=!!e&&t.reverse()}u(Xf,"rewindRing")});var ry=Te((LE,ty)=>{"use strict";x();var qb=xe(),jb=Mt().VectorTileFeature;ty.exports=ey;function ey(t,e){this.options=e||{},this.features=t,this.length=t.length}u(ey,"GeoJSONWrapper");ey.prototype.feature=function(t){return new Ta(this.features[t],this.options.extent)};function Ta(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}u(Ta,"FeatureWrapper");Ta.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 qb(r[i][0],r[i][1]));this.geometry.push(n)}return this.geometry};Ta.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 l=a[s];e=Math.min(e,l.x),r=Math.max(r,l.x),n=Math.min(n,l.y),i=Math.max(i,l.y)}return[e,n,r,i]};Ta.prototype.toGeoJSON=jb.prototype.toGeoJSON});var oy=Te((BE,bi)=>{x();var Jb=ri(),iy=ry();bi.exports=gl;bi.exports.fromVectorTileJs=gl;bi.exports.fromGeojsonVt=Zb;bi.exports.GeoJSONWrapper=iy;function gl(t){var e=new Jb;return Wb(t,e),e.finish()}u(gl,"fromVectorTileJs");function Zb(t,e){e=e||{};var r={};for(var n in t)r[n]=new iy(t[n].features,e),r[n].name=n,r[n].version=e.version,r[n].extent=e.extent;return gl({layers:r})}u(Zb,"fromGeojsonVt");function Wb(t,e){for(var r in t.layers)e.writeMessage(3,Hb,t.layers[r])}u(Wb,"writeTile");function Hb(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,Xb,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,Qb,o[r])}u(Hb,"writeLayer");function Xb(t,e){var r=t.feature;r.id!==void 0&&e.writeVarintField(1,r.id),e.writeMessage(2,Kb,t),e.writeVarintField(3,r.type),e.writeMessage(4,Yb,r)}u(Xb,"writeFeature");function Kb(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 l=r.properties[s],c=o[s];if(l!==null){typeof c>"u"&&(n.push(s),c=n.length-1,o[s]=c),e.writeVarint(c);var p=typeof l;p!=="string"&&p!=="boolean"&&p!=="number"&&(l=JSON.stringify(l));var f=p+":"+l,y=a[f];typeof y>"u"&&(i.push(l),y=i.length-1,a[f]=y),e.writeVarint(y)}}}u(Kb,"writeProperties");function dl(t,e){return(e<<3)+(t&7)}u(dl,"command");function ny(t){return t<<1^t>>31}u(ny,"zigzag");function Yb(t,e){for(var r=t.loadGeometry(),n=t.type,i=0,o=0,a=r.length,s=0;s<a;s++){var l=r[s],c=1;n===1&&(c=l.length),e.writeVarint(dl(1,c));for(var p=n===3?l.length-1:l.length,f=0;f<p;f++){f===1&&n!==1&&e.writeVarint(dl(2,p-1));var y=l[f].x-i,m=l[f].y-o;e.writeVarint(ny(y)),e.writeVarint(ny(m)),i+=y,o+=m}n===3&&e.writeVarint(dl(7,1))}}u(Yb,"writeGeometry");function Qb(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))}u(Qb,"writeValue")});x();x();x();var My=X(xe(),1),jl=X(Ul(),1);x();x();var Na;function $l(){return Na==null&&(Na=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")&&typeof createImageBitmap=="function"),Na}u($l,"offscreenCanvasSupported");var Mi;function Gl(){if(Mi==null&&(Mi=!1,$l())){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){Mi=!0;break}}}return Mi||!1}u(Gl,"isOffscreenCanvasDistorted");function Jl(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)}u(Jl,"easeCubicInOut");function Ey(t,e,r,n){let i=new jl.default(t,e,r,n);return function(o){return i.solve(o)}}u(Ey,"bezier");var k0=Ey(.25,.1,.25,1);function st(t,e,r){return Math.min(r,Math.max(e,t))}u(st,"clamp");function Zl(t,e,r){let n=r-e,i=((t-e)%n+n)%n+e;return i===e?r:i}u(Zl,"wrap");function Ae(t,...e){for(let r of e)for(let n in r)t[n]=r[n];return t}u(Ae,"extend");function Wl(t){return Math.log(t)/Math.LN2%1===0}u(Wl,"isPowerOfTwo");function Zr(t,e,r){let n={};for(let i in t)n[i]=e.call(r||this,t[i],i,t);return n}u(Zr,"mapObject");function Hl(t,e,r){let n={};for(let i in t)e.call(r||this,t[i],i,t)&&(n[i]=t[i]);return n}u(Hl,"filterObject");function at(t){return Array.isArray(t)?t.map(at):typeof t=="object"&&t?Zr(t,at):t}u(at,"clone");function Xl(t,e){for(let r=0;r<t.length;r++)if(e.indexOf(t[r])>=0)return!0;return!1}u(Xl,"arraysIntersect");var ql={};function he(t){ql[t]||(typeof console<"u"&&console.warn(t),ql[t]=!0)}u(he,"warnOnce");function lt(t,e,r){return(r.y-t.y)*(e.x-t.x)>(e.y-t.y)*(r.x-t.x)}u(lt,"isCounterClockwise");function Kl(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}u(Kl,"calculateSignedArea");function ut(t){return typeof WorkerGlobalScope<"u"&&typeof t<"u"&&t instanceof WorkerGlobalScope}u(ut,"isWorker");function Wr(t){return typeof ImageBitmap<"u"&&t instanceof ImageBitmap}u(Wr,"isImageBitmap");function Fy(t,e,r,n,i){let o=Math.max(-e,0)*4,l=(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:l,stride:c}]}}u(Fy,"computeVideoFrameParameters");async function Ly(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"),l=new Uint8ClampedArray(n*i*4);if(await o.copyTo(l,Fy(t,e,r,n,i)),s)for(let c=0;c<l.length;c+=4){let p=l[c];l[c]=l[c+2],l[c+2]=p}return l}finally{o.close()}}u(Ly,"readImageUsingVideoFrame");var jr,Jr;function Dy(t,e,r,n,i){let o=t.width,a=t.height;(!jr||!Jr)&&(jr=new OffscreenCanvas(o,a),Jr=jr.getContext("2d",{willReadFrequently:!0})),jr.width=o,jr.height=a,Jr.drawImage(t,0,0,o,a);let s=Jr.getImageData(e,r,n,i);return Jr.clearRect(0,0,o,a),s.data}u(Dy,"readImageDataUsingOffscreenCanvas");async function Yl(t,e,r,n,i){if(Gl())try{return await Ly(t,e,r,n,i)}catch{}return Dy(t,e,r,n,i)}u(Yl,"getImageData");function Ql(t,e,r,n){return t.addEventListener(e,r,n),{unsubscribe:u(()=>{t.removeEventListener(e,r,n)},"unsubscribe")}}u(Ql,"subscribe");x();x();var zt=class t{static{u(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],l=a[3+i.length+1];this.keys=a.subarray(s,l),this.bboxes=a.subarray(l),this.insert=this._insertReadonly}else{this.d=r+2*n;for(let a=0;a<this.d*this.d;a++)i.push([]);this.keys=[],this.bboxes=[]}this.n=r,this.extent=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 l=[],c={};return this._forEachCell(e,r,n,i,this._queryCell,l,c,o),l}}_queryCell(e,r,n,i,o,a,s,l){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;(l?l(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,l){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(!(l&&!l(this._convertFromCellCoord(m),this._convertFromCellCoord(h),this._convertFromCellCoord(m+1),this._convertFromCellCoord(h+1)))&&o.call(this,e,r,n,i,d,a,s,l))return}}_convertFromCellCoord(e){return(e-this.padding)/this.scale}_convertToCellCoord(e){return Math.max(0,Math.min(this.d-1,Math.floor(e*this.scale)+this.padding))}toArrayBuffer(){if(this.arrayBuffer)return this.arrayBuffer;let e=this.cells,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)}};x();var Vy=8,By={version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},roll:{type:"number",default:0,units:"degrees"},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"}},zy={"*":{type:"source"}},Ry=["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],Oy={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:"*"}},Ny={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:"*"}},Uy={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:"*"}},$y={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"}},Gy={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"}}},qy={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"}}},jy={id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},Jy=["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],Zy={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},Wy={"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"}},Hy={"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"}},Xy={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},Ky={"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"}},Yy={"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"}},Qy={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},em={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},tm={type:"array",value:"*"},rm={type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{}}},nm={type:"enum",values:{Point:{},LineString:{},Polygon:{}}},im={type:"array",minimum:0,maximum:24,value:["number","color"],length:2},om={type:"array",value:"*",minimum:1},am={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}},sm={"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}},lm={source:{type:"string",required:!0},exaggeration:{type:"number",minimum:0,default:1}},um={type:{type:"enum",default:"mercator",values:{mercator:{},globe:{}}}},cm=["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],pm={"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"}},fm={"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"}},ym={"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"}},mm={"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"}},hm={"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"}},dm={"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"}},gm={"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},xm={"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"}},bm={duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},vm={"*":{type:"string"}},_={$version:Vy,$root:By,sources:zy,source:Ry,source_vector:Oy,source_raster:Ny,source_raster_dem:Uy,source_geojson:$y,source_video:Gy,source_image:qy,layer:jy,layout:Jy,layout_background:Zy,layout_fill:Wy,layout_circle:Hy,layout_heatmap:Xy,"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:Ky,layout_symbol:Yy,layout_raster:Qy,layout_hillshade:em,filter:tm,filter_operator:rm,geometry_type:nm,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:im,expression:om,light:am,sky:sm,terrain:lm,projection:um,paint:cm,paint_fill:pm,"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:fm,paint_circle:ym,paint_heatmap:mm,paint_symbol:hm,paint_raster:dm,paint_hillshade:gm,paint_background:xm,transition:bm,"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:vm},Pm=["type","source","source-layer","minzoom","maxzoom","filter","layout"];var L=class{static{u(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 mr(t,...e){for(let r of e)for(let n in r)t[n]=r[n];return t}u(mr,"extendBy");var Oe=class extends Error{static{u(this,"ExpressionParsingError")}constructor(e,r){super(r),this.message=r,this.key=e}},Xa=class t{static{u(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}},gr={kind:"null"},B={kind:"number"},J={kind:"string"},q={kind:"boolean"},Ue={kind:"color"},fr={kind:"object"},j={kind:"value"},Sm={kind:"error"},Hi={kind:"collator"},xr={kind:"formatted"},Xi={kind:"padding"},fn={kind:"resolvedImage"},Ki={kind:"variableAnchorOffsetCollection"};function De(t,e){return{kind:"array",itemType:t,N:e}}u(De,"array$1");function ie(t){if(t.kind==="array"){let e=ie(t.itemType);return typeof t.N=="number"?`array<${e}, ${t.N}>`:t.itemType.kind==="value"?"array":`array<${e}>`}else return t.kind}u(ie,"toString$1");var wm=[gr,B,J,q,Ue,xr,fr,De(j),Xi,fn,Ki];function Qr(t,e){if(e.kind==="error")return null;if(t.kind==="array"){if(e.kind==="array"&&(e.N===0&&e.itemType.kind==="value"||!Qr(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 wm)if(!Qr(r,e))return null}}return`Expected ${ie(t)} but found ${ie(e)} instead.`}u(Qr,"checkSubtype");function ys(t,e){return e.some(r=>r.kind===t.kind)}u(ys,"isValidType");function Nt(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)}u(Nt,"isValidNativeType");function Hr(t,e){return t.kind==="array"&&e.kind==="array"?t.itemType.kind===e.itemType.kind&&typeof t.N=="number":t.kind===e.kind}u(Hr,"verifyType");var Pu=.96422,Su=1,wu=.82521,Au=4/29,yr=6/29,_u=3*yr*yr,Am=yr*yr*yr,_m=Math.PI/180,Im=180/Math.PI;function Iu(t){return t=t%360,t<0&&(t+=360),t}u(Iu,"constrainAngle");function Tu([t,e,r,n]){t=Ua(t),e=Ua(e),r=Ua(r);let i,o,a=$a((.2225045*t+.7168786*e+.0606169*r)/Su);t===e&&e===r?i=o=a:(i=$a((.4360747*t+.3850649*e+.1430804*r)/Pu),o=$a((.0139322*t+.0971045*e+.7141733*r)/wu));let s=116*a-16;return[s<0?0:s,500*(i-a),200*(a-o),n]}u(Tu,"rgbToLab");function Ua(t){return t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}u(Ua,"rgb2xyz");function $a(t){return t>Am?Math.pow(t,1/3):t/_u+Au}u($a,"xyz2lab");function Cu([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=Su*qa(i),o=Pu*qa(o),a=wu*qa(a),[Ga(3.1338561*o-1.6168667*i-.4906146*a),Ga(-.9787684*o+1.9161415*i+.033454*a),Ga(.0719453*o-.2289914*i+1.4052427*a),n]}u(Cu,"labToRgb");function Ga(t){return t=t<=.00304?12.92*t:1.055*Math.pow(t,1/2.4)-.055,t<0?0:t>1?1:t}u(Ga,"xyz2rgb");function qa(t){return t>yr?t*t*t:_u*(t-Au)}u(qa,"lab2xyz");function Tm(t){let[e,r,n,i]=Tu(t),o=Math.sqrt(r*r+n*n);return[Math.round(o*1e4)?Iu(Math.atan2(n,r)*Im):NaN,o,e,i]}u(Tm,"rgbToHcl");function Cm([t,e,r,n]){return t=isNaN(t)?0:t*_m,Cu([r,Math.cos(t)*e,Math.sin(t)*e,n])}u(Cm,"hclToRgb");function km([t,e,r,n]){t=Iu(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 u(i,"f"),[i(0),i(8),i(4),n]}u(km,"hslToRgb");function Mm(t){if(t=t.toLowerCase().trim(),t==="transparent")return[0,0,0,0];let e=Em[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[Ei(t.slice(a,a+=o)),Ei(t.slice(a,a+=o)),Ei(t.slice(a,a+=o)),Ei(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,l,c,p,f,y,m,h,d,g,b]=o,P=[c||" ",y||" ",d].join("");if(P===" "||P===" /"||P===",,"||P===",,,"){let v=[l,f,h].join(""),S=v==="%%%"?100:v===""?255:0;if(S){let w=[cr(+s/S,0,1),cr(+p/S,0,1),cr(+m/S,0,1),g?eu(+g,b):1];if(tu(w))return w}}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,l,c,p,f,y]=n,m=[a||" ",l||" ",p].join("");if(m===" "||m===" /"||m===",,"||m===",,,"){let h=[+o,cr(+s,0,100),cr(+c,0,100),f?eu(+f,y):1];if(tu(h))return km(h)}}}u(Mm,"parseCssColor");function Ei(t){return parseInt(t.padEnd(2,t),16)/255}u(Ei,"parseHex");function eu(t,e){return cr(e?t/100:t,0,1)}u(eu,"parseAlpha");function cr(t,e,r){return Math.min(Math.max(e,t),r)}u(cr,"clamp");function tu(t){return!t.some(Number.isNaN)}u(tu,"validateNumbers");var Em={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]},K=class t{static{u(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=Mm(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",Tm(this.rgb))}get lab(){return this.overwriteGetter("lab",Tu(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})`}};K.black=new K(0,0,0,1);K.white=new K(1,1,1,1);K.transparent=new K(0,0,0,0);K.red=new K(1,0,0,1);var en=class{static{u(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}},tn=class{static{u(this,"FormattedSection")}constructor(e,r,n,i,o){this.text=e,this.image=r,this.scale=n,this.fontStack=i,this.textColor=o}},Ve=class t{static{u(this,"Formatted")}constructor(e){this.sections=e}static fromString(e){return new t([new tn(e,null,null,null,null)])}isEmpty(){return this.sections.length===0?!0:!this.sections.some(e=>e.text.length!==0||e.image&&e.image.name.length!==0)}static factory(e){return e instanceof t?e:t.fromString(e)}toString(){return this.sections.length===0?"":this.sections.map(e=>e.text).join("")}},Xe=class t{static{u(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)}},Fm=new Set(["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"]),Ge=class t{static{u(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"||!Fm.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)}},Me=class t{static{u(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}};function ku(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.`}u(ku,"validateRGBA");function rn(t){if(t===null||typeof t=="string"||typeof t=="boolean"||typeof t=="number"||t instanceof K||t instanceof en||t instanceof Ve||t instanceof Xe||t instanceof Ge||t instanceof Me)return!0;if(Array.isArray(t)){for(let e of t)if(!rn(e))return!1;return!0}else if(typeof t=="object"){for(let e in t)if(!rn(t[e]))return!1;return!0}else return!1}u(rn,"isValue");function fe(t){if(t===null)return gr;if(typeof t=="string")return J;if(typeof t=="boolean")return q;if(typeof t=="number")return B;if(t instanceof K)return Ue;if(t instanceof en)return Hi;if(t instanceof Ve)return xr;if(t instanceof Xe)return Xi;if(t instanceof Ge)return Ki;if(t instanceof Me)return fn;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 De(r||j,e)}else return fr}u(fe,"typeOf");function Kr(t){let e=typeof t;return t===null?"":e==="string"||e==="number"||e==="boolean"?String(t):t instanceof K||t instanceof Ve||t instanceof Xe||t instanceof Ge||t instanceof Me?t.toString():JSON.stringify(t)}u(Kr,"toString");var gt=class t{static{u(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(!rn(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}},se=class{static{u(this,"RuntimeError")}constructor(e){this.name="ExpressionEvaluationError",this.message=e}toJSON(){return this.message}},Fi={string:J,number:B,boolean:q,object:fr},We=class t{static{u(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 Fi)||c==="object")return r.error('The item type argument of "array" must be one of string, number, boolean',1);s=Fi[c],n++}else s=j;let l;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);l=e[2],n++}i=De(s,l)}else{if(!Fi[o])throw new Error(`Types doesn't contain name = ${o}`);i=Fi[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(Qr(this.type,fe(n))){if(r===this.args.length-1)throw new se(`Expected value to be of type ${ie(this.type)}, but found ${ie(fe(n))} instead.`)}else return n}throw new Error}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}},ru={"to-boolean":q,"to-color":Ue,"to-number":B,"to-string":J},dt=class t{static{u(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(!ru[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=ru[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 K)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=ku(r[0],r[1],r[2],r[3]),!n))return new K(r[0]/255,r[1]/255,r[2]/255,r[3])}throw new se(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=Xe.parse(r);if(i)return i}throw new se(`Could not parse padding 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=Ge.parse(r);if(i)return i}throw new se(`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 se(`Could not convert ${JSON.stringify(r)} to number.`)}case"formatted":return Ve.fromString(Kr(this.args[0].evaluate(e)));case"resolvedImage":return Me.fromString(Kr(this.args[0].evaluate(e)));default:return Kr(this.args[0].evaluate(e))}}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}},Lm=["Unknown","Point","LineString","Polygon"],Bi=class{static{u(this,"EvaluationContext")}constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null}id(){return this.feature&&"id"in this.feature?this.feature.id:null}geometryType(){return this.feature?typeof this.feature.type=="number"?Lm[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[e];return r||(r=this._parseColorCache[e]=K.parse(e)),r}},zi=class t{static{u(this,"ParsingContext")}constructor(e,r,n=[],i,o=new Xa,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 dt(o,[i]):i}if(u(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,l=a.type;if((s.kind==="string"||s.kind==="number"||s.kind==="boolean"||s.kind==="object"||s.kind==="array")&&l.kind==="value")a=n(a,s,r.typeAnnotation||"assert");else if((s.kind==="color"||s.kind==="formatted"||s.kind==="resolvedImage")&&(l.kind==="value"||l.kind==="string"))a=n(a,s,r.typeAnnotation||"coerce");else if(s.kind==="padding"&&(l.kind==="value"||l.kind==="number"||l.kind==="array"))a=n(a,s,r.typeAnnotation||"coerce");else if(s.kind==="variableAnchorOffsetCollection"&&(l.kind==="value"||l.kind==="array"))a=n(a,s,r.typeAnnotation||"coerce");else if(this.checkSubtype(s,l))return null}if(!(a instanceof gt)&&a.type.kind!=="resolvedImage"&&this._isConstant(a)){let s=new Bi;try{a=new gt(a.type,a.evaluate(s))}catch(l){return this.error(l.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=Qr(e,r);return n&&this.error(n),n}},Ri=class t{static{u(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()}},Oi=class t{static{u(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}},Ka=class t{static{u(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,B),i=r.parse(e[2],2,De(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 se(`Array index out of bounds: ${r} < 0.`);if(r>=n.length)throw new se(`Array index out of bounds: ${r} > ${n.length-1}.`);if(r!==Math.floor(r))throw new se(`Array index must be an integer, but found ${r} instead.`);return n[r]}eachChild(e){e(this.index),e(this.input)}outputDefined(){return!1}},Ya=class t{static{u(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:ys(n.type,[q,J,B,gr,j])?new t(n,i):r.error(`Expected first argument to be of type boolean, string, number or null, but found ${ie(n.type)} instead`)}evaluate(e){let r=this.needle.evaluate(e),n=this.haystack.evaluate(e);if(!n)return!1;if(!Nt(r,["boolean","string","number","null"]))throw new se(`Expected first argument to be of type boolean, string, number or null, but found ${ie(fe(r))} instead.`);if(!Nt(n,["string","array"]))throw new se(`Expected second argument to be of type array or string, but found ${ie(fe(n))} instead.`);return n.indexOf(r)>=0}eachChild(e){e(this.needle),e(this.haystack)}outputDefined(){return!0}},Qa=class t{static{u(this,"IndexOf")}constructor(e,r,n){this.type=B,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(!ys(n.type,[q,J,B,gr,j]))return r.error(`Expected first argument to be of type boolean, string, number or null, but found ${ie(n.type)} instead`);if(e.length===4){let o=r.parse(e[3],3,B);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(!Nt(r,["boolean","string","number","null"]))throw new se(`Expected first argument to be of type boolean, string, number or null, but found ${ie(fe(r))} instead.`);let i;if(this.fromIndex&&(i=this.fromIndex.evaluate(e)),Nt(n,["string"])){let o=n.indexOf(r,i);return o===-1?-1:[...n.slice(0,o)].length}else{if(Nt(n,["array"]))return n.indexOf(r,i);throw new se(`Expected second argument to be of type array or string, but found ${ie(fe(n))} instead.`)}}eachChild(e){e(this.needle),e(this.haystack),this.fromIndex&&e(this.fromIndex)}outputDefined(){return!1}},es=class t{static{u(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 l=r.parse(e[e.length-1],e.length-1,i);return!l||s.type.kind!=="value"&&r.concat(1).checkSubtype(n,s.type)?null:new t(n,i,s,o,a,l)}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{u(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 l=r.parse(e[a+1],a+1,n);if(!l)return null;i.push([s,l]),n=n||l.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()}},rs=class t{static{u(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,B);if(!n||!i)return null;if(!ys(n.type,[De(j),J,j]))return r.error(`Expected first argument to be of type array or string, but found ${ie(n.type)} instead`);if(e.length===4){let o=r.parse(e[3],3,B);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)),Nt(r,["string"]))return[...r].slice(n,i).join("");if(Nt(r,["array"]))return r.slice(n,i);throw new se(`Expected first argument to be of type array or string, but found ${ie(fe(r))} instead.`)}eachChild(e){e(this.input),e(this.beginIndex),this.endIndex&&e(this.endIndex)}outputDefined(){return!1}};function Yi(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 se("Input is not a number.");return 0}u(Yi,"findStopLessThanOrEqualTo");var hr=class t{static{u(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,B);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],l=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(l,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=Yi(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 Dm(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}u(Dm,"getDefaultExportFromCjs");var ja,nu;function Vm(){if(nu)return ja;nu=1,ja=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 u(t,"UnitBezier"),t.prototype={sampleCurveX:u(function(e){return((this.ax*e+this.bx)*e+this.cx)*e},"sampleCurveX"),sampleCurveY:u(function(e){return((this.ay*e+this.by)*e+this.cy)*e},"sampleCurveY"),sampleCurveDerivativeX:u(function(e){return(3*this.ax*e+2*this.bx)*e+this.cx},"sampleCurveDerivativeX"),solveCurveX:u(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,l=1;for(n=e,i=0;i<20&&(o=this.sampleCurveX(n),!(Math.abs(o-e)<r));i++)e>o?s=n:l=n,n=(l-s)*.5+s;return n},"solveCurveX"),solve:u(function(e,r){return this.sampleCurveY(this.solveCurveX(e,r))},"solve")},ja}u(Vm,"requireUnitbezier");var Bm=Vm(),zm=Dm(Bm);function Rm(t){return t==="rgb"||t==="hcl"||t==="lab"}u(Rm,"isSupportedInterpolationColorSpace");function Ut(t,e,r){return t+r*(e-t)}u(Ut,"number");function Om(t,e,r,n="rgb"){switch(n){case"rgb":{let[i,o,a,s]=Ni(t.rgb,e.rgb,r);return new K(i,o,a,s,!1)}case"hcl":{let[i,o,a,s]=t.hcl,[l,c,p,f]=e.hcl,y,m;if(!isNaN(i)&&!isNaN(l)){let P=l-i;l>i&&P>180?P-=360:l<i&&i-l>180&&(P+=360),y=i+r*P}else isNaN(i)?isNaN(l)?y=NaN:(y=l,(a===1||a===0)&&(m=c)):(y=i,(p===1||p===0)&&(m=o));let[h,d,g,b]=Cm([y,m??Ut(o,c,r),Ut(a,p,r),Ut(s,f,r)]);return new K(h,d,g,b,!1)}case"lab":{let[i,o,a,s]=Cu(Ni(t.lab,e.lab,r));return new K(i,o,a,s,!1)}}}u(Om,"color");function Ni(t,e,r){return t.map((n,i)=>Ut(n,e[i],r))}u(Ni,"array");function Nm(t,e,r){return new Xe(Ni(t.values,e.values,r))}u(Nm,"padding");function Um(t,e,r){let n=t.values,i=e.values;if(n.length!==i.length)throw new se(`Cannot interpolate values of different length. from: ${t.toString()}, to: ${e.toString()}`);let o=[];for(let a=0;a<n.length;a+=2){if(n[a]!==i[a])throw new se(`Cannot interpolate values containing mismatched anchors. from[${a}]: ${n[a]}, to[${a}]: ${i[a]}`);o.push(n[a]);let[s,l]=n[a+1],[c,p]=i[a+1];o.push([Ut(s,c,r),Ut(l,p,r)])}return new Ge(o)}u(Um,"variableAnchorOffsetCollection");var $e={number:Ut,color:Om,array:Ni,padding:Nm,variableAnchorOffsetCollection:Um},He=class t{static{u(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=Ja(r,e.base,n,i);else if(e.name==="linear")o=Ja(r,1,n,i);else if(e.name==="cubic-bezier"){let a=e.controlPoints;o=new zm(a[0],a[1],a[2],a[3]).solve(Ja(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,B),!o)return null;let s=[],l=null;n==="interpolate-hcl"||n==="interpolate-lab"?l=Ue:r.expectedType&&r.expectedType.kind!=="value"&&(l=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,l);if(!h)return null;l=l||h.type,s.push([p,h])}return!Hr(l,B)&&!Hr(l,Ue)&&!Hr(l,Xi)&&!Hr(l,Ki)&&!Hr(l,De(B))?r.error(`Type ${ie(l)} is not interpolatable.`):new t(l,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=Yi(r,i),s=r[a],l=r[a+1],c=t.interpolationFactor(this.interpolation,i,s,l),p=n[a].evaluate(e),f=n[a+1].evaluate(e);switch(this.operator){case"interpolate":return $e[this.type.kind](p,f,c);case"interpolate-hcl":return $e.color(p,f,c,"hcl");case"interpolate-lab":return $e.color(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 Ja(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)}u(Ja,"exponentialInterpolation");var Ui=class t{static{u(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 l=r.parse(s,1+o.length,n,void 0,{typeAnnotation:"omit"});if(!l)return null;n=n||l.type,o.push(l)}if(!n)throw new Error("No output type");return i&&o.some(s=>Qr(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 Me&&!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 iu(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"}u(iu,"isComparableType");function $m(t,e,r){return e===r}u($m,"eq");function Gm(t,e,r){return e!==r}u(Gm,"neq");function qm(t,e,r){return e<r}u(qm,"lt");function jm(t,e,r){return e>r}u(jm,"gt");function Jm(t,e,r){return e<=r}u(Jm,"lteq");function Zm(t,e,r){return e>=r}u(Zm,"gteq");function Mu(t,e,r,n){return n.compare(e,r)===0}u(Mu,"eqCollate");function Wm(t,e,r,n){return!Mu(t,e,r,n)}u(Wm,"neqCollate");function Hm(t,e,r,n){return n.compare(e,r)<0}u(Hm,"ltCollate");function Xm(t,e,r,n){return n.compare(e,r)>0}u(Xm,"gtCollate");function Km(t,e,r,n){return n.compare(e,r)<=0}u(Km,"lteqCollate");function Ym(t,e,r,n){return n.compare(e,r)>=0}u(Ym,"gteqCollate");function br(t,e,r){let n=t!=="=="&&t!=="!=";return class Eu{static{u(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],l=a.parse(o[1],1,j);if(!l)return null;if(!iu(s,l.type))return a.concat(1).error(`"${s}" comparisons are not supported for type '${ie(l.type)}'.`);let c=a.parse(o[2],2,j);if(!c)return null;if(!iu(s,c.type))return a.concat(2).error(`"${s}" comparisons are not supported for type '${ie(c.type)}'.`);if(l.type.kind!==c.type.kind&&l.type.kind!=="value"&&c.type.kind!=="value")return a.error(`Cannot compare types '${ie(l.type)}' and '${ie(c.type)}'.`);n&&(l.type.kind==="value"&&c.type.kind!=="value"?l=new We(c.type,[l]):l.type.kind!=="value"&&c.type.kind==="value"&&(c=new We(l.type,[c])));let p=null;if(o.length===4){if(l.type.kind!=="string"&&c.type.kind!=="string"&&l.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,Hi),!p)return null}return new Eu(l,c,p)}evaluate(o){let a=this.lhs.evaluate(o),s=this.rhs.evaluate(o);if(n&&this.hasUntypedArgument){let l=fe(a),c=fe(s);if(l.kind!==c.kind||!(l.kind==="string"||l.kind==="number"))throw new se(`Expected arguments for "${t}" to be (string, string) or (number, number), but found (${l.kind}, ${c.kind}) instead.`)}if(this.collator&&!n&&this.hasUntypedArgument){let l=fe(a),c=fe(s);if(l.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}}}u(br,"makeComparison");var Qm=br("==",$m,Mu),eh=br("!=",Gm,Wm),th=br("<",qm,Hm),rh=br(">",jm,Xm),nh=br("<=",Jm,Km),ih=br(">=",Zm,Ym),$i=class t{static{u(this,"CollatorExpression")}constructor(e,r,n){this.type=Hi,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,J),!a)?null:new t(i,o,a)}evaluate(e){return new en(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}},ns=class t{static{u(this,"NumberFormat")}constructor(e,r,n,i,o){this.type=J,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,B);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,J),!o))return null;let a=null;if(i.currency&&(a=r.parse(i.currency,1,J),!a))return null;let s=null;if(i["min-fraction-digits"]&&(s=r.parse(i["min-fraction-digits"],1,B),!s))return null;let l=null;return i["max-fraction-digits"]&&(l=r.parse(i["max-fraction-digits"],1,B),!l)?null:new t(n,o,a,s,l)}evaluate(e){return new Intl.NumberFormat(this.locale?this.locale.evaluate(e):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(e):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(e):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(e):void 0}).format(this.number.evaluate(e))}eachChild(e){e(this.number),this.locale&&e(this.locale),this.currency&&e(this.currency),this.minFractionDigits&&e(this.minFractionDigits),this.maxFractionDigits&&e(this.maxFractionDigits)}outputDefined(){return!1}},nn=class t{static{u(this,"FormatExpression")}constructor(e){this.type=xr,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 l=null;if(s["font-scale"]&&(l=r.parse(s["font-scale"],1,B),!l))return null;let c=null;if(s["text-font"]&&(c=r.parse(s["text-font"],1,De(J)),!c))return null;let p=null;if(s["text-color"]&&(p=r.parse(s["text-color"],1,Ue),!p))return null;let f=i[i.length-1];f.scale=l,f.font=c,f.textColor=p}else{let l=r.parse(e[a],1,j);if(!l)return null;let c=l.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:l,scale:null,font:null,textColor:null})}}return new t(i)}evaluate(e){let r=u(n=>{let i=n.content.evaluate(e);return fe(i)===fn?new tn("",i,null,null,null):new tn(Kr(i),null,n.scale?n.scale.evaluate(e):null,n.font?n.font.evaluate(e).join(","):null,n.textColor?n.textColor.evaluate(e):null)},"evaluateSection");return new Ve(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)}outputDefined(){return!1}},is=class t{static{u(this,"ImageExpression")}constructor(e){this.type=fn,this.input=e}static parse(e,r){if(e.length!==2)return r.error("Expected two arguments.");let n=r.parse(e[1],1,J);return n?new t(n):r.error("No image name provided.")}evaluate(e){let r=this.input.evaluate(e),n=Me.fromString(r);return n&&e.availableImages&&(n.available=e.availableImages.indexOf(r)>-1),n}eachChild(e){e(this.input)}outputDefined(){return!1}},os=class t{static{u(this,"Length")}constructor(e){this.type=B,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 ${ie(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 se(`Expected value to be of type string or array, but found ${ie(fe(r))} instead.`)}eachChild(e){e(this.input)}outputDefined(){return!1}},Qe=8192;function oh(t,e){let r=ah(t[0]),n=lh(t[1]),i=Math.pow(2,e.z);return[Math.round(r*i*Qe),Math.round(n*i*Qe)]}u(oh,"getTileCoordinates");function ms(t,e){let r=Math.pow(2,e.z),n=(t[0]/Qe+e.x)/r,i=(t[1]/Qe+e.y)/r;return[sh(n),uh(i)]}u(ms,"getLngLatFromTileCoord");function ah(t){return(180+t)/360}u(ah,"mercatorXfromLng");function sh(t){return t*360-180}u(sh,"lngFromMercatorXfromLng");function lh(t){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))/360}u(lh,"mercatorYfromLat");function uh(t){return 360/Math.PI*Math.atan(Math.exp((180-t*360)*Math.PI/180))-90}u(uh,"latFromMercatorY");function yn(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])}u(yn,"updateBBox");function on(t,e){return!(t[0]<=e[0]||t[2]>=e[2]||t[1]<=e[1]||t[3]>=e[3])}u(on,"boxWithinBox");function ch(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]}u(ch,"rayIntersect");function ph(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}u(ph,"pointOnBoundary");function Qi(t,e,r,n){let i=[e[0]-t[0],e[1]-t[1]],o=[n[0]-r[0],n[1]-r[1]];return hh(o,i)===0?!1:!!(ou(t,e,r,n)&&ou(r,n,t,e))}u(Qi,"segmentIntersectSegment");function fh(t,e,r){for(let n of r)for(let i=0;i<n.length-1;++i)if(Qi(t,e,n[i],n[i+1]))return!0;return!1}u(fh,"lineIntersectPolygon");function vr(t,e,r=!1){let n=!1;for(let i of e)for(let o=0;o<i.length-1;o++){if(ph(t,i[o],i[o+1]))return r;ch(t,i[o],i[o+1])&&(n=!n)}return n}u(vr,"pointWithinPolygon");function yh(t,e){for(let r of e)if(vr(t,r))return!0;return!1}u(yh,"pointWithinPolygons");function Fu(t,e){for(let r of t)if(!vr(r,e))return!1;for(let r=0;r<t.length-1;++r)if(fh(t[r],t[r+1],e))return!1;return!0}u(Fu,"lineStringWithinPolygon");function mh(t,e){for(let r of e)if(Fu(t,r))return!0;return!1}u(mh,"lineStringWithinPolygons");function hh(t,e){return t[0]*e[1]-t[1]*e[0]}u(hh,"perp");function ou(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],l=n[0]-r[0],c=n[1]-r[1],p=i*c-l*o,f=a*c-l*s;return p>0&&f<0||p<0&&f>0}u(ou,"twoSided");function hs(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=oh(t[i][a],r);yn(e,s),o.push(s)}n.push(o)}return n}u(hs,"getTilePolygon");function Lu(t,e,r){let n=[];for(let i=0;i<t.length;i++){let o=hs(t[i],e,r);n.push(o)}return n}u(Lu,"getTilePolygons");function Du(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}yn(e,t)}u(Du,"updatePoint");function dh(t){t[0]=t[1]=1/0,t[2]=t[3]=-1/0}u(dh,"resetBBox");function au(t,e,r,n){let i=Math.pow(2,n.z)*Qe,o=[n.x*Qe,n.y*Qe],a=[];for(let s of t)for(let l of s){let c=[l.x+o[0],l.y+o[1]];Du(c,e,r,i),a.push(c)}return a}u(au,"getTilePoints");function su(t,e,r,n){let i=Math.pow(2,n.z)*Qe,o=[n.x*Qe,n.y*Qe],a=[];for(let s of t){let l=[];for(let c of s){let p=[c.x+o[0],c.y+o[1]];yn(e,p),l.push(p)}a.push(l)}if(e[2]-e[0]<=i/2){dh(e);for(let s of a)for(let l of s)Du(l,e,r,i)}return a}u(su,"getTileLines");function gh(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=hs(e.coordinates,n,i),a=au(t.geometry(),r,n,i);if(!on(r,n))return!1;for(let s of a)if(!vr(s,o))return!1}if(e.type==="MultiPolygon"){let o=Lu(e.coordinates,n,i),a=au(t.geometry(),r,n,i);if(!on(r,n))return!1;for(let s of a)if(!yh(s,o))return!1}return!0}u(gh,"pointsWithinPolygons");function xh(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=hs(e.coordinates,n,i),a=su(t.geometry(),r,n,i);if(!on(r,n))return!1;for(let s of a)if(!Fu(s,o))return!1}if(e.type==="MultiPolygon"){let o=Lu(e.coordinates,n,i),a=su(t.geometry(),r,n,i);if(!on(r,n))return!1;for(let s of a)if(!mh(s,o))return!1}return!0}u(xh,"linesWithinPolygons");var an=class t{static{u(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(rn(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 gh(e,this.geometries);if(e.geometryType()==="LineString")return xh(e,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}},Gi=class{static{u(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 bh(t,e,r,n,i){Vu(t,e,r,n||t.length-1,i||vh)}u(bh,"quickselect");function Vu(t,e,r,n,i){for(;n>r;){if(n-r>600){var o=n-r+1,a=e-r+1,s=Math.log(o),l=.5*Math.exp(2*s/3),c=.5*Math.sqrt(s*l*(o-l)/o)*(a-o/2<0?-1:1),p=Math.max(r,Math.floor(e-a*l/o+c)),f=Math.min(n,Math.floor(e+(o-a)*l/o+c));Vu(t,e,p,f,i)}var y=t[e],m=r,h=n;for(Xr(t,r,e),i(t[n],y)>0&&Xr(t,r,n);m<h;){for(Xr(t,m,h),m++,h--;i(t[m],y)<0;)m++;for(;i(t[h],y)>0;)h--}i(t[r],y)===0?Xr(t,r,h):(h++,Xr(t,h,n)),h<=e&&(r=h+1),e<=h&&(n=h-1)}}u(Vu,"quickselectStep");function Xr(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}u(Xr,"swap");function vh(t,e){return t<e?-1:t>e?1:0}u(vh,"defaultCompare");function Ph(t,e){if(t.length<=1)return[t];let n=[],i,o;for(let a of t){let s=wh(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||(bh(n[a],e,1,n[a].length-1,Sh),n[a]=n[a].slice(0,e));return n}u(Ph,"classifyRings");function Sh(t,e){return e.area-t.area}u(Sh,"compareAreas");function wh(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}u(wh,"calculateSignedArea");var Ah=6378.137,lu=1/298.257223563,uu=lu*(2-lu),cu=Math.PI/180,sn=class{static{u(this,"CheapRuler")}constructor(e){let r=cu*Ah*1e3,n=Math.cos(e*cu),i=1/(1-uu*(1-n*n)),o=Math.sqrt(i);this.kx=r*o*n,this.ky=r*o*i*(1-uu)}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 l=0;l<e.length-1;l++){let c=e[l][0],p=e[l][1],f=this.wrap(e[l+1][0]-c)*this.kx,y=(e[l+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[l+1][0],p=e[l+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=l,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}},as=100,ss=50;function Bu(t,e){return e[0]-t[0]}u(Bu,"compareDistPair");function qi(t){return t[1]-t[0]+1}u(qi,"getRangeSize");function ct(t,e){return t[1]>=t[0]&&t[1]<e}u(ct,"isRangeSafe");function ls(t,e){if(t[0]>t[1])return[null,null];let r=qi(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]]]}u(ls,"splitRange");function us(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)yn(r,t[n]);return r}u(us,"getBBox");function cs(t){let e=[1/0,1/0,-1/0,-1/0];for(let r of t)for(let n of r)yn(e,n);return e}u(cs,"getPolygonBBox");function pu(t){return t[0]!==-1/0&&t[1]!==-1/0&&t[2]!==1/0&&t[3]!==1/0}u(pu,"isValidBBox");function ds(t,e,r){if(!pu(t)||!pu(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])}u(ds,"bboxToBBoxDistance");function Ot(t,e,r){let n=r.pointOnLine(e,t);return r.distance(t,n.point)}u(Ot,"pointToLineDistance");function gs(t,e,r,n,i){let o=Math.min(Ot(t,[r,n],i),Ot(e,[r,n],i)),a=Math.min(Ot(r,[t,e],i),Ot(n,[t,e],i));return Math.min(o,a)}u(gs,"segmentToSegmentDistance");function _h(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 l=t[s],c=t[s+1];for(let p=n[0];p<n[1];++p){let f=r[p],y=r[p+1];if(Qi(l,c,f,y))return 0;a=Math.min(a,gs(l,c,f,y,i))}}return a}u(_h,"lineToLineDistance");function Ih(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 l=n[0];l<=n[1];++l)if(a=Math.min(a,i.distance(t[s],r[l])),a===0)return a;return a}u(Ih,"pointsToPointsDistance");function Th(t,e,r){if(vr(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,Ot(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}u(Th,"pointToPolygonDistance");function Ch(t,e,r,n){if(!ct(e,t.length))return NaN;for(let o=e[0];o<=e[1];++o)if(vr(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 l of r)for(let c=0,p=l.length,f=p-1;c<p;f=c++){let y=l[f],m=l[c];if(Qi(a,s,y,m))return 0;i=Math.min(i,gs(a,s,y,m,n))}}return i}u(Ch,"lineToPolygonDistance");function fu(t,e){for(let r of t)for(let n of r)if(vr(n,e,!0))return!0;return!1}u(fu,"polygonIntersect");function kh(t,e,r,n=1/0){let i=cs(t),o=cs(e);if(n!==1/0&&ds(i,o,r)>=n)return n;if(on(i,o)){if(fu(t,e))return 0}else if(fu(e,t))return 0;let a=1/0;for(let s of t)for(let l=0,c=s.length,p=c-1;l<c;p=l++){let f=s[p],y=s[l];for(let m of e)for(let h=0,d=m.length,g=d-1;h<d;g=h++){let b=m[g],P=m[h];if(Qi(f,y,b,P))return 0;a=Math.min(a,gs(f,y,b,P,r))}}return a}u(kh,"polygonToPolygonDistance");function yu(t,e,r,n,i,o){if(!o)return;let a=ds(us(n,o),i,r);a<e&&t.push([a,o,[0,0]])}u(yu,"updateQueue");function Li(t,e,r,n,i,o,a){if(!o||!a)return;let s=ds(us(n,o),us(i,a),r);s<e&&t.push([s,o,a])}u(Li,"updateQueueTwoSets");function ji(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 Gi([[0,[0,t.length-1],[0,0]]],Bu),s=cs(r);for(;a.length>0;){let l=a.pop();if(l[0]>=o)continue;let c=l[1],p=e?ss:as;if(qi(c)<=p){if(!ct(c,t.length))return NaN;if(e){let f=Ch(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=Th(t[f],r,n);if(o=Math.min(o,y),o===0)return 0}}else{let f=ls(c,e);yu(a,o,n,t,s,f[0]),yu(a,o,n,t,s,f[1])}}return o}u(ji,"pointsToPolygonDistance");function Ji(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 Gi([[0,[0,t.length-1],[0,r.length-1]]],Bu);for(;s.length>0;){let l=s.pop();if(l[0]>=a)continue;let c=l[1],p=l[2],f=e?ss:as,y=n?ss:as;if(qi(c)<=f&&qi(p)<=y){if(!ct(c,t.length)&&ct(p,r.length))return NaN;let m;if(e&&n)m=_h(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=Ot(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=Ot(t[d],h,i),a=Math.min(a,m),a===0)return a}else m=Ih(t,c,r,p,i),a=Math.min(a,m)}else{let m=ls(c,e),h=ls(p,n);Li(s,a,i,t,r,m[0],h[0]),Li(s,a,i,t,r,m[0],h[1]),Li(s,a,i,t,r,m[1],h[0]),Li(s,a,i,t,r,m[1],h[1])}}return a}u(Ji,"pointSetToPointSetDistance");function Mh(t,e){let r=t.geometry(),n=r.flat().map(a=>ms([a.x,a.y],t.canonical));if(r.length===0)return NaN;let i=new sn(n[0][1]),o=1/0;for(let a of e){switch(a.type){case"Point":o=Math.min(o,Ji(n,!1,[a.coordinates],!1,i,o));break;case"LineString":o=Math.min(o,Ji(n,!1,a.coordinates,!0,i,o));break;case"Polygon":o=Math.min(o,ji(n,!1,a.coordinates,i,o));break}if(o===0)return o}return o}u(Mh,"pointToGeometryDistance");function Eh(t,e){let r=t.geometry(),n=r.flat().map(a=>ms([a.x,a.y],t.canonical));if(r.length===0)return NaN;let i=new sn(n[0][1]),o=1/0;for(let a of e){switch(a.type){case"Point":o=Math.min(o,Ji(n,!0,[a.coordinates],!1,i,o));break;case"LineString":o=Math.min(o,Ji(n,!0,a.coordinates,!0,i,o));break;case"Polygon":o=Math.min(o,ji(n,!0,a.coordinates,i,o));break}if(o===0)return o}return o}u(Eh,"lineStringToGeometryDistance");function Fh(t,e){let r=t.geometry();if(r.length===0||r[0].length===0)return NaN;let n=Ph(r,0).map(a=>a.map(s=>s.map(l=>ms([l.x,l.y],t.canonical)))),i=new sn(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,ji([a.coordinates],!1,s,i,o));break;case"LineString":o=Math.min(o,ji(a.coordinates,!0,s,i,o));break;case"Polygon":o=Math.min(o,kh(s,a.coordinates,i,o));break}if(o===0)return o}return o}u(Fh,"polygonToGeometryDistance");function Za(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]}u(Za,"toSimpleGeometry");var ln=class t{static{u(this,"Distance")}constructor(e,r){this.type=B,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(rn(e[1])){let n=e[1];if(n.type==="FeatureCollection")return new t(n,n.features.map(i=>Za(i.geometry)).flat());if(n.type==="Feature")return new t(n,Za(n.geometry));if("type"in n&&"coordinates"in n)return new t(n,Za(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 Mh(e,this.geometries);if(e.geometryType()==="LineString")return Eh(e,this.geometries);if(e.geometryType()==="Polygon")return Fh(e,this.geometries)}return NaN}eachChild(){}outputDefined(){return!0}},jt={"==":Qm,"!=":eh,">":rh,"<":th,">=":ih,"<=":nh,array:We,at:Ka,boolean:We,case:ts,coalesce:Ui,collator:$i,format:nn,image:is,in:Ya,"index-of":Qa,interpolate:He,"interpolate-hcl":He,"interpolate-lab":He,length:os,let:Ri,literal:gt,match:es,number:We,"number-format":ns,object:We,slice:rs,step:hr,string:We,"to-boolean":dt,"to-color":dt,"to-number":dt,"to-string":dt,var:Oi,within:an,distance:ln},et=class t{static{u(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),l=null;for(let[c,p]of s){l=new zi(r.registry,Zi,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,g=l.parse(h,1+f.length,d);if(!g){y=!0;break}f.push(g)}if(!y){if(Array.isArray(c)&&c.length!==f.length){l.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];l.concat(m+1).checkSubtype(h,d.type)}if(l.errors.length===0)return new t(n,o,p,f)}}if(s.length===1)r.errors.push(...l.errors);else{let p=(s.length?s:a).map(([y])=>Dh(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(ie(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 mu(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=ku(e,r,n,o);if(a)throw new se(a);return new K(e/255,r/255,n/255,o,!1)}u(mu,"rgba");function hu(t,e){return t in e}u(hu,"has");function Wa(t,e){let r=e[t];return typeof r>"u"?null:r}u(Wa,"get");function Lh(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}u(Lh,"binarySearch");function Rt(t){return{type:t}}u(Rt,"varargs");et.register(jt,{error:[Sm,[J],(t,[e])=>{throw new se(e.evaluate(t))}],typeof:[J,[j],(t,[e])=>ie(fe(e.evaluate(t)))],"to-rgba":[De(B,4),[Ue],(t,[e])=>{let[r,n,i,o]=e.evaluate(t).rgb;return[r*255,n*255,i*255,o]}],rgb:[Ue,[B,B,B],mu],rgba:[Ue,[B,B,B,B],mu],has:{type:q,overloads:[[[J],(t,[e])=>hu(e.evaluate(t),t.properties())],[[J,fr],(t,[e,r])=>hu(e.evaluate(t),r.evaluate(t))]]},get:{type:j,overloads:[[[J],(t,[e])=>Wa(e.evaluate(t),t.properties())],[[J,fr],(t,[e,r])=>Wa(e.evaluate(t),r.evaluate(t))]]},"feature-state":[j,[J],(t,[e])=>Wa(e.evaluate(t),t.featureState||{})],properties:[fr,[],t=>t.properties()],"geometry-type":[J,[],t=>t.geometryType()],id:[j,[],t=>t.id()],zoom:[B,[],t=>t.globals.zoom],"heatmap-density":[B,[],t=>t.globals.heatmapDensity||0],"line-progress":[B,[],t=>t.globals.lineProgress||0],accumulated:[j,[],t=>t.globals.accumulated===void 0?null:t.globals.accumulated],"+":[B,Rt(B),(t,e)=>{let r=0;for(let n of e)r+=n.evaluate(t);return r}],"*":[B,Rt(B),(t,e)=>{let r=1;for(let n of e)r*=n.evaluate(t);return r}],"-":{type:B,overloads:[[[B,B],(t,[e,r])=>e.evaluate(t)-r.evaluate(t)],[[B],(t,[e])=>-e.evaluate(t)]]},"/":[B,[B,B],(t,[e,r])=>e.evaluate(t)/r.evaluate(t)],"%":[B,[B,B],(t,[e,r])=>e.evaluate(t)%r.evaluate(t)],ln2:[B,[],()=>Math.LN2],pi:[B,[],()=>Math.PI],e:[B,[],()=>Math.E],"^":[B,[B,B],(t,[e,r])=>Math.pow(e.evaluate(t),r.evaluate(t))],sqrt:[B,[B],(t,[e])=>Math.sqrt(e.evaluate(t))],log10:[B,[B],(t,[e])=>Math.log(e.evaluate(t))/Math.LN10],ln:[B,[B],(t,[e])=>Math.log(e.evaluate(t))],log2:[B,[B],(t,[e])=>Math.log(e.evaluate(t))/Math.LN2],sin:[B,[B],(t,[e])=>Math.sin(e.evaluate(t))],cos:[B,[B],(t,[e])=>Math.cos(e.evaluate(t))],tan:[B,[B],(t,[e])=>Math.tan(e.evaluate(t))],asin:[B,[B],(t,[e])=>Math.asin(e.evaluate(t))],acos:[B,[B],(t,[e])=>Math.acos(e.evaluate(t))],atan:[B,[B],(t,[e])=>Math.atan(e.evaluate(t))],min:[B,Rt(B),(t,e)=>Math.min(...e.map(r=>r.evaluate(t)))],max:[B,Rt(B),(t,e)=>Math.max(...e.map(r=>r.evaluate(t)))],abs:[B,[B],(t,[e])=>Math.abs(e.evaluate(t))],round:[B,[B],(t,[e])=>{let r=e.evaluate(t);return r<0?-Math.round(-r):Math.round(r)}],floor:[B,[B],(t,[e])=>Math.floor(e.evaluate(t))],ceil:[B,[B],(t,[e])=>Math.ceil(e.evaluate(t))],"filter-==":[q,[J,j],(t,[e,r])=>t.properties()[e.value]===r.value],"filter-id-==":[q,[j],(t,[e])=>t.id()===e.value],"filter-type-==":[q,[J],(t,[e])=>t.geometryType()===e.value],"filter-<":[q,[J,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,[J,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,[J,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,[J,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,[De(J)],(t,[e])=>e.value.indexOf(t.geometryType())>=0],"filter-id-in":[q,[De(j)],(t,[e])=>e.value.indexOf(t.id())>=0],"filter-in-small":[q,[J,De(j)],(t,[e,r])=>r.value.indexOf(t.properties()[e.value])>=0],"filter-in-large":[q,[J,De(j)],(t,[e,r])=>Lh(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)],[Rt(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)],[Rt(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,[J],(t,[e])=>{let r=t.globals&&t.globals.isSupportedScript;return r?r(e.evaluate(t)):!0}],upcase:[J,[J],(t,[e])=>e.evaluate(t).toUpperCase()],downcase:[J,[J],(t,[e])=>e.evaluate(t).toLowerCase()],concat:[J,Rt(j),(t,e)=>e.map(r=>Kr(r.evaluate(t))).join("")],"resolved-locale":[J,[Hi],(t,[e])=>e.evaluate(t).resolvedLocale()]});function Dh(t){return Array.isArray(t)?`(${t.map(ie).join(", ")})`:`(${ie(t.type)}...)`}u(Dh,"stringifySignature");function Zi(t){if(t instanceof Oi)return Zi(t.boundExpression);if(t instanceof et&&t.name==="error")return!1;if(t instanceof $i)return!1;if(t instanceof an)return!1;if(t instanceof ln)return!1;let e=t instanceof dt||t instanceof We,r=!0;return t.eachChild(n=>{e?r=r&&Zi(n):r=r&&n instanceof gt}),r?eo(t)&&to(t,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"]):!1}u(Zi,"isExpressionConstant");function eo(t){if(t instanceof et){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 an||t instanceof ln)return!1;let e=!0;return t.eachChild(r=>{e&&!eo(r)&&(e=!1)}),e}u(eo,"isFeatureConstant");function un(t){if(t instanceof et&&t.name==="feature-state")return!1;let e=!0;return t.eachChild(r=>{e&&!un(r)&&(e=!1)}),e}u(un,"isStateConstant");function to(t,e){if(t instanceof et&&e.indexOf(t.name)>=0)return!1;let r=!0;return t.eachChild(n=>{r&&!to(n,e)&&(r=!1)}),r}u(to,"isGlobalPropertyConstant");function ps(t){return{result:"success",value:t}}u(ps,"success");function pr(t){return{result:"error",value:t}}u(pr,"error");function xt(t){return t["property-type"]==="data-driven"||t["property-type"]==="cross-faded-data-driven"}u(xt,"supportsPropertyExpression");function zu(t){return!!t.expression&&t.expression.parameters.indexOf("zoom")>-1}u(zu,"supportsZoomExpression");function xs(t){return!!t.expression&&t.expression.interpolated}u(xs,"supportsInterpolation");function W(t){return t instanceof Number?"number":t instanceof String?"string":t instanceof Boolean?"boolean":Array.isArray(t)?"array":t===null?"null":typeof t}u(W,"getType");function ro(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}u(ro,"isFunction$1");function Vh(t){return t}u(Vh,"identityFunction");function Ru(t,e){let r=e.type==="color",n=t.stops&&typeof t.stops[0][0]=="object",i=n||t.property!==void 0,o=n||!i,a=t.type||(xs(e)?"exponential":"interval");if(r||e.type==="padding"){let p=r?K.parse:Xe.parse;t=mr({},t),t.stops&&(t.stops=t.stops.map(f=>[f[0],p(f[1])])),t.default?t.default=p(t.default):t.default=p(e.default)}if(t.colorSpace&&!Rm(t.colorSpace))throw new Error(`Unknown color space: "${t.colorSpace}"`);let s,l,c;if(a==="exponential")s=du;else if(a==="interval")s=zh;else if(a==="categorical"){s=Bh,l=Object.create(null);for(let p of t.stops)l[p[0]]=p[1];c=typeof t.stops[0][0]}else if(a==="identity")s=Rh;else throw new Error(`Unknown function type "${a}"`);if(n){let p={},f=[];for(let h=0;h<t.stops.length;h++){let d=t.stops[h],g=d[0].zoom;p[g]===void 0&&(p[g]={zoom:g,type:t.type,property:t.property,default:t.default,stops:[]},f.push(g)),p[g].stops.push([d[0].value,d[1]])}let y=[];for(let h of f)y.push([p[h].zoom,Ru(p[h],e)]);let m={name:"linear"};return{kind:"composite",interpolationType:m,interpolationFactor:He.interpolationFactor.bind(void 0,m),zoomStops:y.map(h=>h[0]),evaluate({zoom:h},d){return du({stops:y,base:t.base},e,h).evaluate(h,d)}}}else if(o){let p=a==="exponential"?{name:"exponential",base:t.base!==void 0?t.base:1}:null;return{kind:"camera",interpolationType:p,interpolationFactor:He.interpolationFactor.bind(void 0,p),zoomStops:t.stops.map(f=>f[0]),evaluate:u(({zoom:f})=>s(t,e,f,l,c),"evaluate")}}else return{kind:"source",evaluate(p,f){let y=f&&f.properties?f.properties[t.property]:void 0;return y===void 0?mn(t.default,e.default):s(t,e,y,l,c)}}}u(Ru,"createFunction");function mn(t,e,r){if(t!==void 0)return t;if(e!==void 0)return e;if(r!==void 0)return r}u(mn,"coalesce$1");function Bh(t,e,r,n,i){let o=typeof r===i?n[r]:void 0;return mn(o,t.default,e.default)}u(Bh,"evaluateCategoricalFunction");function zh(t,e,r){if(W(r)!=="number")return mn(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=Yi(t.stops.map(o=>o[0]),r);return t.stops[i][1]}u(zh,"evaluateIntervalFunction");function du(t,e,r){let n=t.base!==void 0?t.base:1;if(W(r)!=="number")return mn(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=Yi(t.stops.map(p=>p[0]),r),a=Oh(r,n,t.stops[o][0],t.stops[o+1][0]),s=t.stops[o][1],l=t.stops[o+1][1],c=$e[e.type]||Vh;return typeof s.evaluate=="function"?{evaluate(...p){let f=s.evaluate.apply(void 0,p),y=l.evaluate.apply(void 0,p);if(!(f===void 0||y===void 0))return c(f,y,a,t.colorSpace)}}:c(s,l,a,t.colorSpace)}u(du,"evaluateExponentialFunction");function Rh(t,e,r){switch(e.type){case"color":r=K.parse(r);break;case"formatted":r=Ve.fromString(r.toString());break;case"resolvedImage":r=Me.fromString(r.toString());break;case"padding":r=Xe.parse(r);break;default:W(r)!==e.type&&(e.type!=="enum"||!e.values[r])&&(r=void 0)}return mn(r,t.default,e.default)}u(Rh,"evaluateIdentityFunction");function Oh(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)}u(Oh,"interpolationFactor");var $t=class{static{u(this,"StyleExpression")}constructor(e,r){this.expression=e,this._warningHistory={},this._evaluator=new Bi,this._defaultValue=r?Uh(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 se(`Expected value to be one of ${Object.keys(this._enumValues).map(l=>JSON.stringify(l)).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 Jt(t){return Array.isArray(t)&&t.length>0&&typeof t[0]=="string"&&t[0]in jt}u(Jt,"isExpression");function Zt(t,e){let r=new zi(jt,Zi,[],e?Nh(e):void 0),n=r.parse(t,void 0,void 0,void 0,e&&e.type==="string"?{typeAnnotation:"coerce"}:void 0);return n?ps(new $t(n,e)):pr(r.errors)}u(Zt,"createExpression");var bt=class{static{u(this,"ZoomConstantExpression")}constructor(e,r){this.kind=e,this._styleExpression=r,this.isStateDependent=e!=="constant"&&!un(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)}},vt=class{static{u(this,"ZoomDependentExpression")}constructor(e,r,n,i){this.kind=e,this.zoomStops=n,this._styleExpression=r,this.isStateDependent=e!=="camera"&&!un(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?He.interpolationFactor(this.interpolationType,e,r,n):0}};function Ou(t,e){let r=Zt(t,e);if(r.result==="error")return r;let n=r.value.expression,i=eo(n);if(!i&&!xt(e))return pr([new Oe("","data expressions not supported")]);let o=to(n,["zoom"]);if(!o&&!zu(e))return pr([new Oe("","zoom expressions not supported")]);let a=Vi(n);if(!a&&!o)return pr([new Oe("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]);if(a instanceof Oe)return pr([a]);if(a instanceof He&&!xs(e))return pr([new Oe("",'"interpolate" expressions cannot be used with this property')]);if(!a)return ps(i?new bt("constant",r.value):new bt("source",r.value));let s=a instanceof He?a.interpolation:void 0;return ps(i?new vt("camera",r.value,a.labels,s):new vt("composite",r.value,a.labels,s))}u(Ou,"createPropertyExpression");var cn=class t{static{u(this,"StylePropertyFunction")}constructor(e,r){this._parameters=e,this._specification=r,mr(this,Ru(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 Nu(t,e){if(ro(t))return new cn(t,e);if(Jt(t)){let r=Ou(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=K.parse(t):e.type==="padding"&&(typeof t=="number"||Array.isArray(t))?r=Xe.parse(t):e.type==="variableAnchorOffsetCollection"&&Array.isArray(t)&&(r=Ge.parse(t)),{kind:"constant",evaluate:u(()=>r,"evaluate")}}}u(Nu,"normalizePropertyExpression");function Vi(t){let e=null;if(t instanceof Ri)e=Vi(t.result);else if(t instanceof Ui){for(let r of t.args)if(e=Vi(r),e)break}else(t instanceof hr||t instanceof He)&&t.input instanceof et&&t.input.name==="zoom"&&(e=t);return e instanceof Oe||t.eachChild(r=>{let n=Vi(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}u(Vi,"findZoomCurve");function Nh(t){let e={color:Ue,string:J,number:B,enum:J,boolean:q,formatted:xr,padding:Xi,resolvedImage:fn,variableAnchorOffsetCollection:Ki};return t.type==="array"?De(e[t.value]||j,t.length):e[t.type]}u(Nh,"getExpectedType");function Uh(t){return t.type==="color"&&ro(t.default)?new K(0,0,0,0):t.type==="color"?K.parse(t.default)||null:t.type==="padding"?Xe.parse(t.default)||null:t.type==="variableAnchorOffsetCollection"?Ge.parse(t.default)||null:t.default===void 0?null:t.default}u(Uh,"getDefaultValue");function bs(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(!bs(e)&&typeof e!="boolean")return!1;return!0;default:return!0}}u(bs,"isExpressionFilter");var $h={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function hn(t){if(t==null)return{filter:u(()=>!0,"filter"),needGeometry:!1};bs(t)||(t=Wi(t));let e=Zt(t,$h);if(e.result==="error")throw new Error(e.value.map(r=>`${r.key}: ${r.message}`).join(", "));{let r=Uu(t);return{filter:u((n,i,o)=>e.value.evaluate(n,i,{},o),"filter"),needGeometry:r}}}u(hn,"createFilter");function Gh(t,e){return t<e?-1:t>e?1:0}u(Gh,"compare");function Uu(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(Uu(t[e]))return!0;return!1}u(Uu,"geometryNeeded");function Wi(t){if(!t)return!0;let e=t[0];return t.length<=1?e!=="any":e==="=="?Ha(t[1],t[2],"=="):e==="!="?Di(Ha(t[1],t[2],"==")):e==="<"||e===">"||e==="<="||e===">="?Ha(t[1],t[2],e):e==="any"?qh(t.slice(1)):e==="all"?["all"].concat(t.slice(1).map(Wi)):e==="none"?["all"].concat(t.slice(1).map(Wi).map(Di)):e==="in"?gu(t[1],t.slice(2)):e==="!in"?Di(gu(t[1],t.slice(2))):e==="has"?xu(t[1]):e==="!has"?Di(xu(t[1])):!0}u(Wi,"convertFilter$1");function Ha(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]}}u(Ha,"convertComparisonOp$1");function qh(t){return["any"].concat(t.map(Wi))}u(qh,"convertDisjunctionOp");function gu(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(Gh)]]:["filter-in-small",t,["literal",e]]}}u(gu,"convertInOp$1");function xu(t){switch(t){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",t]}}u(xu,"convertHasOp$1");function Di(t){return["!",t]}u(Di,"convertNegation");function fs(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+=`${fs(o)},`;return`${i}]`}let r=Object.keys(t).sort(),n="{";for(let i=0;i<r.length;i++)n+=`${JSON.stringify(r[i])}:${fs(t[r[i]])},`;return`${n}}`}u(fs,"stringify$1");function jh(t){let e="";for(let r of Pm)e+=`/${fs(t[r])}`;return e}u(jh,"getKey");function $u(t,e){let r={};for(let i=0;i<t.length;i++){let o=e&&e[t[i].id]||jh(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}u($u,"groupByLayout");function Gu(t){let e=t.key,r=t.value;return r?[new L(e,r,"constants have been deprecated as of v8")]:[]}u(Gu,"validateConstants");function ue(t){return t instanceof Number||t instanceof String||t instanceof Boolean?t.valueOf():t}u(ue,"unbundle");function Gt(t){if(Array.isArray(t))return t.map(Gt);if(t instanceof Object&&!(t instanceof Number||t instanceof String||t instanceof Boolean)){let e={};for(let r in t)e[r]=Gt(t[r]);return e}return ue(t)}u(Gt,"deepUnbundle");function Ne(t){let e=t.key,r=t.value,n=t.valueSpec||{},i=t.objectElementValidators||{},o=t.style,a=t.styleSpec,s=t.validateSpec,l=[],c=W(r);if(c!=="object")return[new L(e,r,`object expected, ${c} found`)];for(let p in r){let f=p.split(".")[0],y=n[f]||n["*"],m;if(i[f])m=i[f];else if(n[f])m=s;else if(i["*"])m=i["*"];else if(n["*"])m=s;else{l.push(new L(e,r[p],`unknown property "${p}"`));continue}l=l.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&&l.push(new L(e,r,`missing required property "${p}"`));return l}u(Ne,"validateObject");function vs(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(W(e)!=="array")return[new L(a,e,`array expected, ${W(e)} found`)];if(r.length&&e.length!==r.length)return[new L(a,e,`array length ${r.length} expected, length ${e.length} found`)];if(r["min-length"]&&e.length<r["min-length"])return[new L(a,e,`array length at least ${r["min-length"]} expected, length ${e.length} found`)];let l={type:r.value,values:r.values};o.$version<7&&(l.function=r.function),W(r.value)==="object"&&(l=r.value);let c=[];for(let p=0;p<e.length;p++)c=c.concat(s({array:e,arrayIndex:p,value:e[p],valueSpec:l,validateSpec:t.validateSpec,style:i,styleSpec:o,key:`${a}[${p}]`}));return c}u(vs,"validateArray");function Ps(t){let e=t.key,r=t.value,n=t.valueSpec,i=W(r);return i==="number"&&r!==r&&(i="NaN"),i!=="number"?[new L(e,r,`number expected, ${i} found`)]:"minimum"in n&&r<n.minimum?[new L(e,r,`${r} is less than the minimum value ${n.minimum}`)]:"maximum"in n&&r>n.maximum?[new L(e,r,`${r} is greater than the maximum value ${n.maximum}`)]:[]}u(Ps,"validateNumber");function qu(t){let e=t.valueSpec,r=ue(t.value.type),n,i={},o,a,s=r!=="categorical"&&t.value.property===void 0,l=!s,c=W(t.value.stops)==="array"&&W(t.value.stops[0])==="array"&&W(t.value.stops[0][0])==="object",p=Ne({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 L(t.key,t.value,'missing required property "property"')),r!=="identity"&&!t.value.stops&&p.push(new L(t.key,t.value,'missing required property "stops"')),r==="exponential"&&t.valueSpec.expression&&!xs(t.valueSpec)&&p.push(new L(t.key,t.value,"exponential functions not supported")),t.styleSpec.$version>=8&&(l&&!xt(t.valueSpec)?p.push(new L(t.key,t.value,"property functions not supported")):s&&!zu(t.valueSpec)&&p.push(new L(t.key,t.value,"zoom functions not supported"))),(r==="categorical"||c)&&t.value.property===void 0&&p.push(new L(t.key,t.value,'"property" property is required')),p;function f(d){if(r==="identity")return[new L(d.key,d.value,'identity function may not have a "stops" property')];let g=[],b=d.value;return g=g.concat(vs({key:d.key,value:b,valueSpec:d.valueSpec,validateSpec:d.validateSpec,style:d.style,styleSpec:d.styleSpec,arrayElementValidator:y})),W(b)==="array"&&b.length===0&&g.push(new L(d.key,b,"array must have at least one stop")),g}u(f,"validateFunctionStops");function y(d){let g=[],b=d.value,P=d.key;if(W(b)!=="array")return[new L(P,b,`array expected, ${W(b)} found`)];if(b.length!==2)return[new L(P,b,`array length 2 expected, length ${b.length} found`)];if(c){if(W(b[0])!=="object")return[new L(P,b,`object expected, ${W(b[0])} found`)];if(b[0].zoom===void 0)return[new L(P,b,"object stop key must have zoom")];if(b[0].value===void 0)return[new L(P,b,"object stop key must have value")];if(a&&a>ue(b[0].zoom))return[new L(P,b[0].zoom,"stop zoom values must appear in ascending order")];ue(b[0].zoom)!==a&&(a=ue(b[0].zoom),o=void 0,i={}),g=g.concat(Ne({key:`${P}[0]`,value:b[0],valueSpec:{zoom:{}},validateSpec:d.validateSpec,style:d.style,styleSpec:d.styleSpec,objectElementValidators:{zoom:Ps,value:m}}))}else g=g.concat(m({key:`${P}[0]`,value:b[0],valueSpec:{},validateSpec:d.validateSpec,style:d.style,styleSpec:d.styleSpec},b));return Jt(Gt(b[1]))?g.concat([new L(`${P}[1]`,b[1],"expressions are not allowed in function stops.")]):g.concat(d.validateSpec({key:`${P}[1]`,value:b[1],valueSpec:e,validateSpec:d.validateSpec,style:d.style,styleSpec:d.styleSpec}))}u(y,"validateFunctionStop");function m(d,g){let b=W(d.value),P=ue(d.value),v=d.value!==null?d.value:g;if(!n)n=b;else if(b!==n)return[new L(d.key,v,`${b} stop domain type must match previous stop domain type ${n}`)];if(b!=="number"&&b!=="string"&&b!=="boolean")return[new L(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 xt(e)&&r===void 0&&(S+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new L(d.key,v,S)]}return r==="categorical"&&b==="number"&&(!isFinite(P)||Math.floor(P)!==P)?[new L(d.key,v,`integer expected, found ${P}`)]:r!=="categorical"&&b==="number"&&o!==void 0&&P<o?[new L(d.key,v,"stop domain values must appear in ascending order")]:(o=P,r==="categorical"&&P in i?[new L(d.key,v,"stop domain values must be unique")]:(i[P]=!0,[]))}u(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})}u(h,"validateFunctionDefault")}u(qu,"validateFunction");function dr(t){let e=(t.expressionContext==="property"?Ou:Zt)(Gt(t.value),t.valueSpec);if(e.result==="error")return e.value.map(n=>new L(`${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 L(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"&&!un(r))return[new L(t.key,t.value,'"feature-state" data expressions are not supported with layout properties.')];if(t.expressionContext==="filter"&&!un(r))return[new L(t.key,t.value,'"feature-state" data expressions are not supported with filters.')];if(t.expressionContext&&t.expressionContext.indexOf("cluster")===0){if(!to(r,["zoom","feature-state"]))return[new L(t.key,t.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(t.expressionContext==="cluster-initial"&&!eo(r))return[new L(t.key,t.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}u(dr,"validateExpression");function Jh(t){let e=t.value,r=t.key,n=W(e);return n!=="boolean"?[new L(r,e,`boolean expected, ${n} found`)]:[]}u(Jh,"validateBoolean");function Zh(t){let e=t.key,r=t.value,n=W(r);return n!=="string"?[new L(e,r,`color expected, ${n} found`)]:K.parse(String(r))?[]:[new L(e,r,`color expected, "${r}" found`)]}u(Zh,"validateColor");function pn(t){let e=t.key,r=t.value,n=t.valueSpec,i=[];return Array.isArray(n.values)?n.values.indexOf(ue(r))===-1&&i.push(new L(e,r,`expected one of [${n.values.join(", ")}], ${JSON.stringify(r)} found`)):Object.keys(n.values).indexOf(ue(r))===-1&&i.push(new L(e,r,`expected one of [${Object.keys(n.values).join(", ")}], ${JSON.stringify(r)} found`)),i}u(pn,"validateEnum");function Ss(t){return bs(Gt(t.value))?dr(mr({},t,{expressionContext:"filter",valueSpec:{value:"boolean"}})):ju(t)}u(Ss,"validateFilter");function ju(t){let e=t.value,r=t.key;if(W(e)!=="array")return[new L(r,e,`array expected, ${W(e)} found`)];let n=t.styleSpec,i,o=[];if(e.length<1)return[new L(r,e,"filter array must have at least 1 element")];switch(o=o.concat(pn({key:`${r}[0]`,value:e[0],valueSpec:n.filter_operator,style:t.style,styleSpec:t.styleSpec})),ue(e[0])){case"<":case"<=":case">":case">=":e.length>=2&&ue(e[1])==="$type"&&o.push(new L(r,e,`"$type" cannot be use with operator "${e[0]}"`));case"==":case"!=":e.length!==3&&o.push(new L(r,e,`filter array for operator "${e[0]}" must have 3 elements`));case"in":case"!in":e.length>=2&&(i=W(e[1]),i!=="string"&&o.push(new L(`${r}[1]`,e[1],`string expected, ${i} found`)));for(let a=2;a<e.length;a++)i=W(e[a]),ue(e[1])==="$type"?o=o.concat(pn({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 L(`${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(ju({key:`${r}[${a}]`,value:e[a],style:t.style,styleSpec:t.styleSpec}));break;case"has":case"!has":i=W(e[1]),e.length!==2?o.push(new L(r,e,`filter array for "${e[0]}" operator must have 2 elements`)):i!=="string"&&o.push(new L(`${r}[1]`,e[1],`string expected, ${i} found`));break}return o}u(ju,"validateNonExpressionFilter");function Ju(t,e){let r=t.key,n=t.validateSpec,i=t.style,o=t.styleSpec,a=t.value,s=t.objectKey,l=o[`${e}_${t.layerType}`];if(!l)return[];let c=s.match(/^(.*)-transition$/);if(e==="paint"&&c&&l[c[1]]&&l[c[1]].transition)return n({key:r,value:a,valueSpec:o.transition,style:i,styleSpec:o});let p=t.valueSpec||l[s];if(!p)return[new L(r,a,`unknown property "${s}"`)];let f;if(W(a)==="string"&&xt(p)&&!p.tokens&&(f=/^{([^}]+)}$/.exec(a)))return[new L(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 L(r,a,'use of "text-field" requires a style "glyphs" property')),s==="text-font"&&ro(Gt(a))&&ue(a.type)==="identity"&&y.push(new L(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}))}u(Ju,"validateProperty");function Zu(t){return Ju(t,"paint")}u(Zu,"validatePaintProperty");function Wu(t){return Ju(t,"layout")}u(Wu,"validateLayoutProperty");function Hu(t){let e=[],r=t.value,n=t.key,i=t.style,o=t.styleSpec;!r.type&&!r.ref&&e.push(new L(n,r,'either "type" or "ref" is required'));let a=ue(r.type),s=ue(r.ref);if(r.id){let l=ue(r.id);for(let c=0;c<t.arrayIndex;c++){let p=i.layers[c];ue(p.id)===l&&e.push(new L(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 L(n,r[c],`"${c}" is prohibited for ref layers`))});let l;i.layers.forEach(c=>{ue(c.id)===s&&(l=c)}),l?l.ref?e.push(new L(n,r.ref,"ref cannot reference another ref layer")):a=ue(l.type):e.push(new L(n,r.ref,`ref layer "${s}" not found`))}else if(a!=="background")if(!r.source)e.push(new L(n,r,'missing required property "source"'));else{let l=i.sources&&i.sources[r.source],c=l&&ue(l.type);l?c==="vector"&&a==="raster"?e.push(new L(n,r.source,`layer "${r.id}" requires a raster source`)):c!=="raster-dem"&&a==="hillshade"?e.push(new L(n,r.source,`layer "${r.id}" requires a raster-dem source`)):c==="raster"&&a!=="raster"?e.push(new L(n,r.source,`layer "${r.id}" requires a vector source`)):c==="vector"&&!r["source-layer"]?e.push(new L(n,r,`layer "${r.id}" must specify a "source-layer"`)):c==="raster-dem"&&a!=="hillshade"?e.push(new L(n,r.source,"raster-dem source can only be used with layer type 'hillshade'.")):a==="line"&&r.paint&&r.paint["line-gradient"]&&(c!=="geojson"||!l.lineMetrics)&&e.push(new L(n,r,`layer "${r.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):e.push(new L(n,r.source,`source "${r.source}" not found`))}return e=e.concat(Ne({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:Ss,layout(l){return Ne({layer:r,key:l.key,value:l.value,style:l.style,styleSpec:l.styleSpec,validateSpec:l.validateSpec,objectElementValidators:{"*"(c){return Wu(mr({layerType:a},c))}}})},paint(l){return Ne({layer:r,key:l.key,value:l.value,style:l.style,styleSpec:l.styleSpec,validateSpec:l.validateSpec,objectElementValidators:{"*"(c){return Zu(mr({layerType:a},c))}}})}}})),e}u(Hu,"validateLayer");function qt(t){let e=t.value,r=t.key,n=W(e);return n!=="string"?[new L(r,e,`string expected, ${n} found`)]:[]}u(qt,"validateString");function Wh(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=[],l=W(n);if(n===void 0)return s;if(l!=="object")return s.push(new L("source_raster_dem",n,`object expected, ${l} found`)),s;let p=ue(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 L(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 L(m,n[m],`unknown property "${m}"`));return s}u(Wh,"validateRasterDEMSource");var bu={promoteId:Hh};function Xu(t){let e=t.value,r=t.key,n=t.styleSpec,i=t.style,o=t.validateSpec;if(!e.type)return[new L(r,e,'"type" is required')];let a=ue(e.type),s;switch(a){case"vector":case"raster":return s=Ne({key:r,value:e,valueSpec:n[`source_${a.replace("-","_")}`],style:t.style,styleSpec:n,objectElementValidators:bu,validateSpec:o}),s;case"raster-dem":return s=Wh({sourceName:r,value:e,style:t.style,styleSpec:n,validateSpec:o}),s;case"geojson":if(s=Ne({key:r,value:e,valueSpec:n.source_geojson,style:i,styleSpec:n,validateSpec:o,objectElementValidators:bu}),e.cluster)for(let l in e.clusterProperties){let[c,p]=e.clusterProperties[l],f=typeof c=="string"?[c,["accumulated"],["get",l]]:c;s.push(...dr({key:`${r}.${l}.map`,value:p,validateSpec:o,expressionContext:"cluster-map"})),s.push(...dr({key:`${r}.${l}.reduce`,value:f,validateSpec:o,expressionContext:"cluster-reduce"}))}return s;case"video":return Ne({key:r,value:e,valueSpec:n.source_video,style:i,validateSpec:o,styleSpec:n});case"image":return Ne({key:r,value:e,valueSpec:n.source_image,style:i,validateSpec:o,styleSpec:n});case"canvas":return[new L(r,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return pn({key:`${r}.type`,value:e.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:i,validateSpec:o,styleSpec:n})}}u(Xu,"validateSource");function Hh({key:t,value:e}){if(W(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}}u(Hh,"validatePromoteId");function Ku(t){let e=t.value,r=t.styleSpec,n=r.light,i=t.style,o=[],a=W(e);if(e===void 0)return o;if(a!=="object")return o=o.concat([new L("light",e,`object expected, ${a} found`)]),o;for(let s in e){let l=s.match(/^(.*)-transition$/);l&&n[l[1]]&&n[l[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 L(s,e[s],`unknown property "${s}"`)])}return o}u(Ku,"validateLight");function Yu(t){let e=t.value,r=t.styleSpec,n=r.sky,i=t.style,o=W(e);if(e===void 0)return[];if(o!=="object")return[new L("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 L(s,e[s],`unknown property "${s}"`)]);return a}u(Yu,"validateSky");function Qu(t){let e=t.value,r=t.styleSpec,n=r.terrain,i=t.style,o=[],a=W(e);if(e===void 0)return o;if(a!=="object")return o=o.concat([new L("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 L(s,e[s],`unknown property "${s}"`)]);return o}u(Qu,"validateTerrain");function Xh(t){return qt(t).length===0?[]:dr(t)}u(Xh,"validateFormatted");function Kh(t){return qt(t).length===0?[]:dr(t)}u(Kh,"validateImage");function Yh(t){let e=t.key,r=t.value;if(W(r)==="array"){if(r.length<1||r.length>4)return[new L(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 Ps({key:e,value:r,valueSpec:{}})}u(Yh,"validatePadding");function Qh(t){let e=t.key,r=t.value,n=W(r),i=t.styleSpec;if(n!=="array"||r.length<1||r.length%2!==0)return[new L(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(pn({key:`${e}[${a}]`,value:r[a],valueSpec:i.layout_symbol["text-anchor"]})),o=o.concat(vs({key:`${e}[${a+1}]`,value:r[a+1],valueSpec:{length:2,value:"number"},validateSpec:t.validateSpec,style:t.style,styleSpec:i}));return o}u(Qh,"validateVariableAnchorOffsetCollection");function ec(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 L(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 L(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(Ne({key:`${n}[${a}]`,value:r[a],valueSpec:s,validateSpec:t.validateSpec}))}return e}else return qt({key:n,value:r})}u(ec,"validateSprite");function ed(t){let e=t.value,r=t.styleSpec,n=r.projection,i=t.style,o=W(e);if(e===void 0)return[];if(o!=="object")return[new L("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 L(s,e[s],`unknown property "${s}"`)]);return a}u(ed,"validateProjection");var vu={"*"(){return[]},array:vs,boolean:Jh,number:Ps,color:Zh,constants:Gu,enum:pn,filter:Ss,function:qu,layer:Hu,object:Ne,source:Xu,light:Ku,sky:Yu,terrain:Qu,projection:ed,string:qt,formatted:Xh,resolvedImage:Kh,padding:Yh,variableAnchorOffsetCollection:Qh,sprite:ec};function Yr(t){let e=t.value,r=t.valueSpec,n=t.styleSpec;return t.validateSpec=Yr,r.expression&&ro(ue(e))?qu(t):r.expression&&Jt(Gt(e))?dr(t):r.type&&vu[r.type]?vu[r.type](t):Ne(mr({},t,{valueSpec:r.type?n[r.type]:r}))}u(Yr,"validate");function tc(t){let e=t.value,r=t.key,n=qt(t);return n.length||(e.indexOf("{fontstack}")===-1&&n.push(new L(r,e,'"glyphs" url must include a "{fontstack}" token')),e.indexOf("{range}")===-1&&n.push(new L(r,e,'"glyphs" url must include a "{range}" token'))),n}u(tc,"validateGlyphsUrl");function qe(t,e=_){let r=[];return r=r.concat(Yr({key:"",value:t,valueSpec:e.$root,styleSpec:e,style:t,validateSpec:Yr,objectElementValidators:{glyphs:tc,"*"(){return[]}}})),t.constants&&(r=r.concat(Gu({key:"constants",value:t.constants,style:t,styleSpec:e,validateSpec:Yr}))),rc(r)}u(qe,"validateStyleMin");qe.source=rt(tt(Xu));qe.sprite=rt(tt(ec));qe.glyphs=rt(tt(tc));qe.light=rt(tt(Ku));qe.sky=rt(tt(Yu));qe.terrain=rt(tt(Qu));qe.layer=rt(tt(Hu));qe.filter=rt(tt(Ss));qe.paintProperty=rt(tt(Zu));qe.layoutProperty=rt(tt(Wu));function tt(t){return function(e){return t({...e,validateSpec:Yr})}}u(tt,"injectValidateSpec");function rc(t){return[].concat(t).sort((e,r)=>e.line-r.line)}u(rc,"sortErrors");function rt(t){return function(...e){return rc(t.apply(this,e))}}u(rt,"wrapCleanErrors");x();x();var nc="AbortError";function ic(t){return t.message===nc}u(ic,"isAbortError");function ws(){return new Error(nc)}u(ws,"createAbortError");x();x();var no={MAX_PARALLEL_IMAGE_REQUESTS:16,MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:8,MAX_TILE_CACHE_ZOOM_LEVELS:5,REGISTERED_PROTOCOLS:{},WORKER_URL:""};function oc(t){return no.REGISTERED_PROTOCOLS[t.substring(0,t.indexOf("://"))]}u(oc,"getProtocol");function ac(t,e){no.REGISTERED_PROTOCOLS[t]=e}u(ac,"addProtocol");function sc(t){delete no.REGISTERED_PROTOCOLS[t]}u(sc,"removeProtocol");x();var lc="global-dispatcher",Pr=class extends Error{static{u(this,"AJAXError")}constructor(e,r,n,i){super(`AJAXError: ${r} (${e}): ${n}`),this.status=e,this.statusText=r,this.url=n,this.body=i}},cc=u(()=>ut(self)?self.worker&&self.worker.referrer:(window.location.protocol==="blob:"?window.parent:window).location.href,"getReferrer"),td=u(t=>/^file:/.test(t)||/^file:/.test(cc())&&!/^\w+:/.test(t),"isFileURL");async function rd(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:cc(),signal:e.signal});t.type==="json"&&r.headers.set("Accept","application/json");let n=await fetch(r);if(!n.ok){let a=await n.blob();throw new Pr(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 ws();return{data:o,cacheControl:n.headers.get("Cache-Control"),expires:n.headers.get("Expires")}}u(rd,"makeFetchRequest");function nd(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",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 Pr(i.status,i.statusText,t.url,o))}},e.signal.addEventListener("abort",()=>{i.abort(),n(ws())}),i.send(t.body)})}u(nd,"makeXMLHttpRequest");var pc=u(function(t,e){if(/:\/\//.test(t.url)&&!/^https?:|^file:/.test(t.url)){let r=oc(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:lc},e)}if(!td(t.url)){if(fetch&&Request&&AbortController&&Object.prototype.hasOwnProperty.call(Request.prototype,"signal"))return rd(t,e);if(ut(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:t,mustQueue:!0,targetMapId:lc},e)}return nd(t,e)},"makeRequest"),fc=u((t,e)=>pc(Ae(t,{type:"json"}),e),"getJSON"),yc=u((t,e)=>pc(Ae(t,{type:"arrayBuffer"}),e),"getArrayBuffer");var Pt={};function E(t,e,r={}){if(Pt[t])throw new Error(`${t} is already registered.`);Object.defineProperty(e,"_classRegistryKey",{value:t,writeable:!1}),Pt[t]={klass:e,omit:r.omit||[],shallow:r.shallow||[]}}u(E,"register");E("Object",Object);E("TransferableGridIndex",zt);E("Color",K);E("Error",Error);E("AJAXError",Pr);E("ResolvedImage",Me);E("StylePropertyFunction",cn);E("StyleExpression",$t,{omit:["_evaluator"]});E("ZoomDependentExpression",vt);E("ZoomConstantExpression",bt);E("CompoundExpression",et,{omit:["_evaluate"]});for(let t in jt)jt[t]._classRegistryKey||E(`Expression_${t}`,jt[t]);function mc(t){return t&&typeof ArrayBuffer<"u"&&(t instanceof ArrayBuffer||t.constructor&&t.constructor.name==="ArrayBuffer")}u(mc,"isArrayBuffer");function Sr(t,e){if(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)return t;if(mc(t)||Wr(t))return e&&e.push(t),t;if(ArrayBuffer.isView(t)){let r=t;return e&&e.push(r.buffer),r}if(t instanceof ImageData)return e&&e.push(t.data.buffer),t;if(Array.isArray(t)){let r=[];for(let n of t)r.push(Sr(n,e));return r}if(typeof t=="object"){let r=t.constructor,n=r._classRegistryKey;if(!n)throw new Error(`can't serialize object of unregistered class ${r.name}`);if(!Pt[n])throw new Error(`${n} is not registered.`);let i=r.serialize?r.serialize(t,e):{};if(r.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)||Pt[n].omit.indexOf(o)>=0)continue;let a=t[o];i[o]=Pt[n].shallow.indexOf(o)>=0?a:Sr(a,e)}t instanceof Error&&(i.message=t.message)}if(i.$name)throw new Error("$name property is reserved for worker serialization logic.");return n!=="Object"&&(i.$name=n),i}throw new Error(`can't serialize object of type ${typeof t}`)}u(Sr,"serialize");function wr(t){if(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||mc(t)||Wr(t)||ArrayBuffer.isView(t)||t instanceof ImageData)return t;if(Array.isArray(t))return t.map(wr);if(typeof t=="object"){let e=t.$name||"Object";if(!Pt[e])throw new Error(`can't deserialize unregistered class ${e}`);let{klass:r}=Pt[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]=Pt[e].shallow.indexOf(i)>=0?o:wr(o)}return n}throw new Error(`can't deserialize object of type ${typeof t}`)}u(wr,"deserialize");x();var io=class{static{u(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 oo=class{static{u(this,"Actor")}constructor(e,r){this.target=e,this.mapId=r,this.resolveRejects={},this.tasks={},this.taskQueue=[],this.abortControllers={},this.messageHandlers={},this.invoker=new io(()=>this.process()),this.subscription=Ql(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);this.resolveRejects[o]={resolve:n,reject:i},r&&r.signal.addEventListener("abort",()=>{delete this.resolveRejects[o];let l={id:o,type:"<cancel>",origin:location.origin,targetMapId:e.targetMapId,sourceMapId:this.mapId};this.target.postMessage(l)},{once:!0});let a=[],s={...e,id:o,sourceMapId:this.mapId,origin:location.origin,data:Sr(e.data,a)};this.target.postMessage(s,{transfer:a})})}receive(e){let r=e.data,n=r.id;if(!(r.origin!=="file://"&&location.origin!=="file://"&&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(wr(r.error)):o.resolve(wr(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=wr(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?Sr(r):null,data:Sr(n,i)};this.target.postMessage(o,{transfer:i})}remove(){this.invoker.remove(),this.subscription.unsubscribe()}};x();x();x();x();x();x();function hc(t,e,r){r[t]&&r[t].indexOf(e)!==-1||(r[t]=r[t]||[],r[t].push(e))}u(hc,"_addEventListener");function As(t,e,r){if(r&&r[t]){let n=r[t].indexOf(e);n!==-1&&r[t].splice(n,1)}}u(As,"_removeEventListener");var ao=class{static{u(this,"Event")}constructor(e,r={}){Ae(this,r),this.type=e}},dn=class extends ao{static{u(this,"ErrorEvent")}constructor(e,r={}){super("error",Ae({error:e},r))}},so=class{static{u(this,"Evented")}on(e,r){return this._listeners=this._listeners||{},hc(e,r,this._listeners),this}off(e,r){return As(e,r,this._listeners),As(e,r,this._oneTimeListeners),this}once(e,r){return r?(this._oneTimeListeners=this._oneTimeListeners||{},hc(e,r,this._oneTimeListeners),this):new Promise(n=>this.once(e,n))}fire(e,r){typeof e=="string"&&(e=new ao(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)As(n,s,this._oneTimeListeners),s.call(this,e);let a=this._eventedParent;a&&(Ae(e,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),a.fire(e))}else e instanceof dn&&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 St=qe,Cv=St.source,kv=St.light,Mv=St.terrain,Ev=St.filter,dc=St.paintProperty,gc=St.layoutProperty;function xc(t,e){let r=!1;if(e&&e.length)for(let n of e)t.fire(new dn(new Error(n.message))),r=!0;return r}u(xc,"emitValidationErrors");x();x();x();var lo=class{static{u(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)}};x();x();var z={"Latin-1 Supplement":u(t=>t>=128&&t<=255,"Latin-1 Supplement"),Arabic:u(t=>t>=1536&&t<=1791,"Arabic"),"Arabic Supplement":u(t=>t>=1872&&t<=1919,"Arabic Supplement"),"Arabic Extended-A":u(t=>t>=2208&&t<=2303,"Arabic Extended-A"),"Hangul Jamo":u(t=>t>=4352&&t<=4607,"Hangul Jamo"),"Unified Canadian Aboriginal Syllabics":u(t=>t>=5120&&t<=5759,"Unified Canadian Aboriginal Syllabics"),Khmer:u(t=>t>=6016&&t<=6143,"Khmer"),"Unified Canadian Aboriginal Syllabics Extended":u(t=>t>=6320&&t<=6399,"Unified Canadian Aboriginal Syllabics Extended"),"General Punctuation":u(t=>t>=8192&&t<=8303,"General Punctuation"),"Letterlike Symbols":u(t=>t>=8448&&t<=8527,"Letterlike Symbols"),"Number Forms":u(t=>t>=8528&&t<=8591,"Number Forms"),"Miscellaneous Technical":u(t=>t>=8960&&t<=9215,"Miscellaneous Technical"),"Control Pictures":u(t=>t>=9216&&t<=9279,"Control Pictures"),"Optical Character Recognition":u(t=>t>=9280&&t<=9311,"Optical Character Recognition"),"Enclosed Alphanumerics":u(t=>t>=9312&&t<=9471,"Enclosed Alphanumerics"),"Geometric Shapes":u(t=>t>=9632&&t<=9727,"Geometric Shapes"),"Miscellaneous Symbols":u(t=>t>=9728&&t<=9983,"Miscellaneous Symbols"),"Miscellaneous Symbols and Arrows":u(t=>t>=11008&&t<=11263,"Miscellaneous Symbols and Arrows"),"CJK Radicals Supplement":u(t=>t>=11904&&t<=12031,"CJK Radicals Supplement"),"Kangxi Radicals":u(t=>t>=12032&&t<=12255,"Kangxi Radicals"),"Ideographic Description Characters":u(t=>t>=12272&&t<=12287,"Ideographic Description Characters"),"CJK Symbols and Punctuation":u(t=>t>=12288&&t<=12351,"CJK Symbols and Punctuation"),Hiragana:u(t=>t>=12352&&t<=12447,"Hiragana"),Katakana:u(t=>t>=12448&&t<=12543,"Katakana"),Bopomofo:u(t=>t>=12544&&t<=12591,"Bopomofo"),"Hangul Compatibility Jamo":u(t=>t>=12592&&t<=12687,"Hangul Compatibility Jamo"),Kanbun:u(t=>t>=12688&&t<=12703,"Kanbun"),"Bopomofo Extended":u(t=>t>=12704&&t<=12735,"Bopomofo Extended"),"CJK Strokes":u(t=>t>=12736&&t<=12783,"CJK Strokes"),"Katakana Phonetic Extensions":u(t=>t>=12784&&t<=12799,"Katakana Phonetic Extensions"),"Enclosed CJK Letters and Months":u(t=>t>=12800&&t<=13055,"Enclosed CJK Letters and Months"),"CJK Compatibility":u(t=>t>=13056&&t<=13311,"CJK Compatibility"),"CJK Unified Ideographs Extension A":u(t=>t>=13312&&t<=19903,"CJK Unified Ideographs Extension A"),"Yijing Hexagram Symbols":u(t=>t>=19904&&t<=19967,"Yijing Hexagram Symbols"),"CJK Unified Ideographs":u(t=>t>=19968&&t<=40959,"CJK Unified Ideographs"),"Yi Syllables":u(t=>t>=40960&&t<=42127,"Yi Syllables"),"Yi Radicals":u(t=>t>=42128&&t<=42191,"Yi Radicals"),"Hangul Jamo Extended-A":u(t=>t>=43360&&t<=43391,"Hangul Jamo Extended-A"),"Hangul Syllables":u(t=>t>=44032&&t<=55215,"Hangul Syllables"),"Hangul Jamo Extended-B":u(t=>t>=55216&&t<=55295,"Hangul Jamo Extended-B"),"Private Use Area":u(t=>t>=57344&&t<=63743,"Private Use Area"),"CJK Compatibility Ideographs":u(t=>t>=63744&&t<=64255,"CJK Compatibility Ideographs"),"Arabic Presentation Forms-A":u(t=>t>=64336&&t<=65023,"Arabic Presentation Forms-A"),"Vertical Forms":u(t=>t>=65040&&t<=65055,"Vertical Forms"),"CJK Compatibility Forms":u(t=>t>=65072&&t<=65103,"CJK Compatibility Forms"),"Small Form Variants":u(t=>t>=65104&&t<=65135,"Small Form Variants"),"Arabic Presentation Forms-B":u(t=>t>=65136&&t<=65279,"Arabic Presentation Forms-B"),"Halfwidth and Fullwidth Forms":u(t=>t>=65280&&t<=65519,"Halfwidth and Fullwidth Forms")};function gn(t){for(let e of t)if(uo(e.charCodeAt(0)))return!0;return!1}u(gn,"allowsVerticalWritingMode");function bc(t){for(let e of t)if(!id(e.charCodeAt(0)))return!1;return!0}u(bc,"allowsLetterSpacing");function id(t){return!(z.Arabic(t)||z["Arabic Supplement"](t)||z["Arabic Extended-A"](t)||z["Arabic Presentation Forms-A"](t)||z["Arabic Presentation Forms-B"](t))}u(id,"charAllowsLetterSpacing");function vc(t){return t<11904?!1:!!(z["Bopomofo Extended"](t)||z.Bopomofo(t)||z["CJK Compatibility Forms"](t)||z["CJK Compatibility Ideographs"](t)||z["CJK Compatibility"](t)||z["CJK Radicals Supplement"](t)||z["CJK Strokes"](t)||z["CJK Symbols and Punctuation"](t)||z["CJK Unified Ideographs Extension A"](t)||z["CJK Unified Ideographs"](t)||z["Enclosed CJK Letters and Months"](t)||z["Halfwidth and Fullwidth Forms"](t)||z.Hiragana(t)||z["Ideographic Description Characters"](t)||z["Kangxi Radicals"](t)||z["Katakana Phonetic Extensions"](t)||z.Katakana(t)||z["Vertical Forms"](t)||z["Yi Radicals"](t)||z["Yi Syllables"](t))}u(vc,"charAllowsIdeographicBreaking");function uo(t){return t===746||t===747?!0:t<4352?!1:!!(z["Bopomofo Extended"](t)||z.Bopomofo(t)||z["CJK Compatibility Forms"](t)&&!(t>=65097&&t<=65103)||z["CJK Compatibility Ideographs"](t)||z["CJK Compatibility"](t)||z["CJK Radicals Supplement"](t)||z["CJK Strokes"](t)||z["CJK Symbols and Punctuation"](t)&&!(t>=12296&&t<=12305)&&!(t>=12308&&t<=12319)&&t!==12336||z["CJK Unified Ideographs Extension A"](t)||z["CJK Unified Ideographs"](t)||z["Enclosed CJK Letters and Months"](t)||z["Hangul Compatibility Jamo"](t)||z["Hangul Jamo Extended-A"](t)||z["Hangul Jamo Extended-B"](t)||z["Hangul Jamo"](t)||z["Hangul Syllables"](t)||z.Hiragana(t)||z["Ideographic Description Characters"](t)||z.Kanbun(t)||z["Kangxi Radicals"](t)||z["Katakana Phonetic Extensions"](t)||z.Katakana(t)&&t!==12540||z["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)||z["Small Form Variants"](t)&&!(t>=65112&&t<=65118)&&!(t>=65123&&t<=65126)||z["Unified Canadian Aboriginal Syllabics"](t)||z["Unified Canadian Aboriginal Syllabics Extended"](t)||z["Vertical Forms"](t)||z["Yijing Hexagram Symbols"](t)||z["Yi Syllables"](t)||z["Yi Radicals"](t))}u(uo,"charHasUprightVerticalOrientation");function od(t){return!!(z["Latin-1 Supplement"](t)&&(t===167||t===169||t===174||t===177||t===188||t===189||t===190||t===215||t===247)||z["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)||z["Letterlike Symbols"](t)||z["Number Forms"](t)||z["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)||z["Control Pictures"](t)&&t!==9251||z["Optical Character Recognition"](t)||z["Enclosed Alphanumerics"](t)||z["Geometric Shapes"](t)||z["Miscellaneous Symbols"](t)&&!(t>=9754&&t<=9759)||z["Miscellaneous Symbols and Arrows"](t)&&(t>=11026&&t<=11055||t>=11088&&t<=11097||t>=11192&&t<=11243)||z["CJK Symbols and Punctuation"](t)||z.Katakana(t)||z["Private Use Area"](t)||z["CJK Compatibility Forms"](t)||z["Small Form Variants"](t)||z["Halfwidth and Fullwidth Forms"](t)||t===8734||t===8756||t===8757||t>=9984&&t<=10087||t>=10102&&t<=10131||t===65532||t===65533)}u(od,"charHasNeutralVerticalOrientation");function _s(t){return!(uo(t)||od(t))}u(_s,"charHasRotatedVerticalOrientation");function Pc(t){return z.Arabic(t)||z["Arabic Supplement"](t)||z["Arabic Extended-A"](t)||z["Arabic Presentation Forms-A"](t)||z["Arabic Presentation Forms-B"](t)}u(Pc,"charInComplexShapingScript");function Sc(t){return t>=1424&&t<=2303||z["Arabic Presentation Forms-A"](t)||z["Arabic Presentation Forms-B"](t)}u(Sc,"charInRTLScript");function ad(t,e){return!(!e&&Sc(t)||t>=2304&&t<=3583||t>=3840&&t<=4255||z.Khmer(t))}u(ad,"charInSupportedScript");function wc(t){for(let e of t)if(Sc(e.charCodeAt(0)))return!0;return!1}u(wc,"stringContainsRTLText");function Ac(t,e){for(let r of t)if(!ad(r.charCodeAt(0),e))return!1;return!0}u(Ac,"isStringInSupportedScript");x();var Is=class{constructor(){this.applyArabicShaping=null;this.processBidirectionalText=null;this.processStyledBidirectionalText=null;this.pluginStatus="unavailable";this.pluginURL=null}static{u(this,"RTLWorkerPlugin")}setState(e){this.pluginStatus=e.pluginStatus,this.pluginURL=e.pluginURL}getState(){return{pluginStatus:this.pluginStatus,pluginURL:this.pluginURL}}setMethods(e){this.applyArabicShaping=e.applyArabicShaping,this.processBidirectionalText=e.processBidirectionalText,this.processStyledBidirectionalText=e.processStyledBidirectionalText}isParsed(){return this.applyArabicShaping!=null&&this.processBidirectionalText!=null&&this.processStyledBidirectionalText!=null}getPluginURL(){return this.pluginURL}getRTLTextPluginStatus(){return this.pluginStatus}},de=new Is;var Z=class{static{u(this,"EvaluationParameters")}constructor(e,r){this.zoom=e,r?(this.now=r.now,this.fadeDuration=r.fadeDuration,this.zoomHistory=r.zoomHistory,this.transition=r.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new lo,this.transition={})}isSupportedScript(e){return Ac(e,de.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 Ar=class{static{u(this,"PropertyValue")}constructor(e,r){this.property=e,this.value=r,this.expression=Nu(r===void 0?e.specification.default:r,e.specification)}isDataDriven(){return this.expression.kind==="source"||this.expression.kind==="composite"}possiblyEvaluate(e,r,n){return this.property.possiblyEvaluate(this,e,r,n)}},xn=class{static{u(this,"TransitionablePropertyValue")}constructor(e){this.property=e,this.value=new Ar(e,void 0)}transitioned(e,r){return new po(this.property,this.value,r,Ae({},e.transition,this.transition),e.now)}untransitioned(){return new po(this.property,this.value,null,{},0)}},co=class{static{u(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 xn(this._values[e].property)),this._values[e].value=new Ar(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 xn(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 fo(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 fo(this._properties);for(let r of Object.keys(this._values))e._values[r]=this._values[r].untransitioned();return e}},po=class{static{u(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,Jl(s))}}else return o}},fo=class{static{u(this,"Transitioning")}constructor(e){this._properties=e,this._values=Object.create(e.defaultTransitioningPropertyValues)}possiblyEvaluate(e,r,n){let i=new wt(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}},yo=class{static{u(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 Ar(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 wt(this._properties);for(let o of Object.keys(this._values))i._values[o]=this._values[o].possiblyEvaluate(e,r,n);return i}},_e=class{static{u(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)}},wt=class{static{u(this,"PossiblyEvaluated")}constructor(e){this._properties=e,this._values=Object.create(e.defaultPossiblyEvaluatedValues)}get(e){return this._values[e]}},O=class{static{u(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=$e[i];return o?o(e,r,n):e}},U=class{static{u(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 _e(this,{kind:"constant",value:e.expression.evaluate(r,null,{},n,i)},r):new _e(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 _e(this,{kind:"constant",value:void 0},e.parameters);let i=this.specification.type,o=$e[i];if(o){let a=o(e.value.value,r.value.value,n);return new _e(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)}},pt=class extends U{static{u(this,"CrossFadedDataDrivenProperty")}possiblyEvaluate(e,r,n,i){if(e.value===void 0)return new _e(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,l=this._calculate(s,s,s,r);return new _e(this,{kind:"constant",value:l},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 _e(this,{kind:"constant",value:o},r)}else return new _e(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}},Wt=class{static{u(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{u(this,"ColorRampProperty")}constructor(e){this.specification=e}possiblyEvaluate(e,r,n,i){return!!e.expression.evaluate(r,null,{},n,i)}interpolate(){return!1}},oe=class{static{u(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 Ar(n,void 0),o=this.defaultTransitionablePropertyValues[r]=new xn(n);this.defaultTransitioningPropertyValues[r]=o.untransitioned(),this.defaultPossiblyEvaluatedValues[r]=i.possiblyEvaluate({})}}};E("DataDrivenProperty",U);E("DataConstantProperty",O);E("CrossFadedDataDrivenProperty",pt);E("CrossFadedProperty",Wt);E("ColorRampProperty",Ht);var mo="-transition",ce=class extends so{static{u(this,"StyleLayer")}constructor(e,r){if(super(),this.id=e.id,this.type=e.type,this._featureFilter={filter:u(()=>!0,"filter"),needGeometry:!1},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),r.layout&&(this._unevaluatedLayout=new yo(r.layout)),r.paint)){this._transitionablePaint=new co(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 wt(r.paint)}}getCrossfadeParameters(){return this._crossfadeParameters}getLayoutProperty(e){return e==="visibility"?this.visibility:this._unevaluatedLayout.getValue(e)}setLayoutProperty(e,r,n={}){if(r!=null){let i=`layers.${this.id}.layout.${e}`;if(this._validate(gc,i,e,r,n))return}if(e==="visibility"){this.visibility=r;return}this._unevaluatedLayout.setValue(e,r)}getPaintProperty(e){return e.endsWith(mo)?this._transitionablePaint.getTransition(e.slice(0,-mo.length)):this._transitionablePaint.getValue(e)}setPaintProperty(e,r,n={}){if(r!=null){let i=`layers.${this.id}.paint.${e}`;if(this._validate(dc,i,e,r,n))return!1}if(e.endsWith(mo))return this._transitionablePaint.setTransition(e.slice(0,-mo.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 l=this._transitionablePaint._values[e].value;return l.isDataDriven()||a||o||this._handleOverridablePaintPropertyUpdate(e,s,l)}}_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),Hl(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:xc(this,e.call(St,{key:r,layerType:this.type,objectKey:n,value:i,styleSpec:_,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 _e)||!xt(r.property.specification))&&(r.value.kind==="source"||r.value.kind==="composite")&&r.value.isStateDependent)return!0}return!1}};x();x();x();var sd={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array},At=class{static{u(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}},ld=128,ud=5,ne=class{static{u(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*ud),ld),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 te(t,e=1){let r=0,n=0,i=t.map(a=>{let s=cd(a.type),l=r=_c(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:l}}),o=_c(r,Math.max(n,e));return{members:i,size:o,alignment:e}}u(te,"createLayout");function cd(t){return sd[t].BYTES_PER_ELEMENT}u(cd,"sizeOf");function _c(t,e){return Math.ceil(t/e)*e}u(_c,"align");var Ic=X(xe(),1);var Xt=class extends ne{static{u(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}};Xt.prototype.bytesPerElement=4;E("StructArrayLayout2i4",Xt);var bn=class extends ne{static{u(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}};bn.prototype.bytesPerElement=6;E("StructArrayLayout3i6",bn);var ho=class extends ne{static{u(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}};ho.prototype.bytesPerElement=8;E("StructArrayLayout4i8",ho);var vn=class extends ne{static{u(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 l=e*6;return this.int16[l+0]=r,this.int16[l+1]=n,this.int16[l+2]=i,this.int16[l+3]=o,this.int16[l+4]=a,this.int16[l+5]=s,e}};vn.prototype.bytesPerElement=12;E("StructArrayLayout2i4i12",vn);var Pn=class extends ne{static{u(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 l=e*4,c=e*8;return this.int16[l+0]=r,this.int16[l+1]=n,this.uint8[c+4]=i,this.uint8[c+5]=o,this.uint8[c+6]=a,this.uint8[c+7]=s,e}};Pn.prototype.bytesPerElement=8;E("StructArrayLayout2i4ub8",Pn);var _t=class extends ne{static{u(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}};_t.prototype.bytesPerElement=8;E("StructArrayLayout2f8",_t);var Sn=class extends ne{static{u(this,"StructArrayLayout10ui20")}_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r,n,i,o,a,s,l,c,p){let f=this.length;return this.resize(f+1),this.emplace(f,e,r,n,i,o,a,s,l,c,p)}emplace(e,r,n,i,o,a,s,l,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]=l,this.uint16[y+7]=c,this.uint16[y+8]=p,this.uint16[y+9]=f,e}};Sn.prototype.bytesPerElement=20;E("StructArrayLayout10ui20",Sn);var wn=class extends ne{static{u(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,l,c,p,f,y){let m=this.length;return this.resize(m+1),this.emplace(m,e,r,n,i,o,a,s,l,c,p,f,y)}emplace(e,r,n,i,o,a,s,l,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]=l,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}};wn.prototype.bytesPerElement=24;E("StructArrayLayout4i4ui4i24",wn);var An=class extends ne{static{u(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}};An.prototype.bytesPerElement=12;E("StructArrayLayout3f12",An);var _n=class extends ne{static{u(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}};_n.prototype.bytesPerElement=4;E("StructArrayLayout1ul4",_n);var In=class extends ne{static{u(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,l,c){let p=this.length;return this.resize(p+1),this.emplace(p,e,r,n,i,o,a,s,l,c)}emplace(e,r,n,i,o,a,s,l,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]=l,this.uint16[f+8]=c,this.uint16[f+9]=p,e}};In.prototype.bytesPerElement=20;E("StructArrayLayout6i1ul2ui20",In);var Tn=class extends ne{static{u(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 l=e*6;return this.int16[l+0]=r,this.int16[l+1]=n,this.int16[l+2]=i,this.int16[l+3]=o,this.int16[l+4]=a,this.int16[l+5]=s,e}};Tn.prototype.bytesPerElement=12;E("StructArrayLayout2i2i2i12",Tn);var go=class extends ne{static{u(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,l=e*8;return this.float32[s+0]=r,this.float32[s+1]=n,this.float32[s+2]=i,this.int16[l+6]=o,this.int16[l+7]=a,e}};go.prototype.bytesPerElement=16;E("StructArrayLayout2f1f2i16",go);var Cn=class extends ne{static{u(this,"StructArrayLayout2ub2f12")}_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*12,s=e*3;return this.uint8[a+0]=r,this.uint8[a+1]=n,this.float32[s+1]=i,this.float32[s+2]=o,e}};Cn.prototype.bytesPerElement=12;E("StructArrayLayout2ub2f12",Cn);var kn=class extends ne{static{u(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}};kn.prototype.bytesPerElement=6;E("StructArrayLayout3ui6",kn);var Mn=class extends ne{static{u(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,l,c,p,f,y,m,h,d,g,b){let P=this.length;return this.resize(P+1),this.emplace(P,e,r,n,i,o,a,s,l,c,p,f,y,m,h,d,g,b)}emplace(e,r,n,i,o,a,s,l,c,p,f,y,m,h,d,g,b,P){let v=e*24,S=e*12,w=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]=l,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[w+36]=h,this.uint8[w+37]=d,this.uint8[w+38]=g,this.uint32[S+10]=b,this.int16[v+22]=P,e}};Mn.prototype.bytesPerElement=48;E("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",Mn);var En=class extends ne{static{u(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,l,c,p,f,y,m,h,d,g,b,P,v,S,w,I,M,V,D,C,k,F){let R=this.length;return this.resize(R+1),this.emplace(R,e,r,n,i,o,a,s,l,c,p,f,y,m,h,d,g,b,P,v,S,w,I,M,V,D,C,k,F)}emplace(e,r,n,i,o,a,s,l,c,p,f,y,m,h,d,g,b,P,v,S,w,I,M,V,D,C,k,F,R){let T=e*32,N=e*16;return this.int16[T+0]=r,this.int16[T+1]=n,this.int16[T+2]=i,this.int16[T+3]=o,this.int16[T+4]=a,this.int16[T+5]=s,this.int16[T+6]=l,this.int16[T+7]=c,this.uint16[T+8]=p,this.uint16[T+9]=f,this.uint16[T+10]=y,this.uint16[T+11]=m,this.uint16[T+12]=h,this.uint16[T+13]=d,this.uint16[T+14]=g,this.uint16[T+15]=b,this.uint16[T+16]=P,this.uint16[T+17]=v,this.uint16[T+18]=S,this.uint16[T+19]=w,this.uint16[T+20]=I,this.uint16[T+21]=M,this.uint16[T+22]=V,this.uint32[N+12]=D,this.float32[N+13]=C,this.float32[N+14]=k,this.uint16[T+30]=F,this.uint16[T+31]=R,e}};En.prototype.bytesPerElement=64;E("StructArrayLayout8i15ui1ul2f2ui64",En);var Kt=class extends ne{static{u(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}};Kt.prototype.bytesPerElement=4;E("StructArrayLayout1f4",Kt);var Fn=class extends ne{static{u(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}};Fn.prototype.bytesPerElement=12;E("StructArrayLayout1ui2f12",Fn);var Ln=class extends ne{static{u(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}};Ln.prototype.bytesPerElement=8;E("StructArrayLayout1ul2ui8",Ln);var Dn=class extends ne{static{u(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}};Dn.prototype.bytesPerElement=4;E("StructArrayLayout2ui4",Dn);var xo=class extends ne{static{u(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}};xo.prototype.bytesPerElement=2;E("StructArrayLayout1ui2",xo);var _r=class extends ne{static{u(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}};_r.prototype.bytesPerElement=16;E("StructArrayLayout4f16",_r);var bo=class extends At{static{u(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 Ic.default(this.anchorPointX,this.anchorPointY)}};bo.prototype.size=20;var Vn=class extends In{static{u(this,"CollisionBoxArray")}get(e){return new bo(this,e)}};E("CollisionBoxArray",Vn);var vo=class extends At{static{u(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]}};vo.prototype.size=48;var Bn=class extends Mn{static{u(this,"PlacedSymbolArray")}get(e){return new vo(this,e)}};E("PlacedSymbolArray",Bn);var Po=class extends At{static{u(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]}};Po.prototype.size=64;var zn=class extends En{static{u(this,"SymbolInstanceArray")}get(e){return new Po(this,e)}};E("SymbolInstanceArray",zn);var Rn=class extends Kt{static{u(this,"GlyphOffsetArray")}getoffsetX(e){return this.float32[e*1+0]}};E("GlyphOffsetArray",Rn);var On=class extends bn{static{u(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]}};E("SymbolLineVertexArray",On);var So=class extends At{static{u(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]}};So.prototype.size=12;var Nn=class extends Fn{static{u(this,"TextAnchorOffsetArray")}get(e){return new So(this,e)}};E("TextAnchorOffsetArray",Nn);var wo=class extends At{static{u(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]}};wo.prototype.size=8;var Un=class extends Ln{static{u(this,"FeatureIndexArray")}get(e){return new wo(this,e)}};E("FeatureIndexArray",Un);var Ao=class extends Xt{static{u(this,"PosArray")}};var _o=class extends Xt{static{u(this,"CircleLayoutArray")}},Io=class extends Xt{static{u(this,"FillLayoutArray")}},To=class extends vn{static{u(this,"FillExtrusionLayoutArray")}};var Co=class extends Pn{static{u(this,"LineLayoutArray")}},ko=class extends _t{static{u(this,"LineExtLayoutArray")}},ft=class extends Sn{static{u(this,"PatternLayoutArray")}},Mo=class extends wn{static{u(this,"SymbolLayoutArray")}},Eo=class extends An{static{u(this,"SymbolDynamicLayoutArray")}},Fo=class extends _n{static{u(this,"SymbolOpacityArray")}},$n=class extends Tn{static{u(this,"CollisionBoxLayoutArray")}};var Lo=class extends Cn{static{u(this,"CollisionVertexArray")}};var Be=class extends kn{static{u(this,"TriangleIndexArray")}},It=class extends Dn{static{u(this,"LineIndexArray")}};x();var pd=te([{name:"a_pos",components:2,type:"Int16"}],4);var{members:Tc,size:V1,alignment:B1}=pd;x();var ge=class t{static{u(this,"SegmentVector")}constructor(e=[]){this.segments=e}prepareSegment(e,r,n,i){let o=this.segments[this.segments.length-1];return e>t.MAX_VERTEX_ARRAY_LENGTH&&he(`Max vertices per segment is ${t.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${e}`),(!o||o.vertexLength+e>t.MAX_VERTEX_ARRAY_LENGTH||o.sortKey!==i)&&(o={vertexOffset:r.length,primitiveOffset:n.length,vertexLength:0,primitiveLength:0},i!==void 0&&(o.sortKey=i),this.segments.push(o)),o}get(){return this.segments}destroy(){for(let 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}])}};ge.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1;E("SegmentVector",ge);x();x();function Ts(t,e){return t=st(Math.floor(t),0,255),e=st(Math.floor(e),0,255),256*t+e}u(Ts,"packUint8ToFloat");x();var Gn=te([{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"}]);x();var Fc=X(Ms(),1);var qn=class t{static{u(this,"FeaturePositionMap")}constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(e,r,n,i){this.ids.push(Ec(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=Ec(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],l=this.positions[3*n+2];o.push({index:a,start:s,end:l}),n++}return o}static serialize(e,r){let n=new Float64Array(e.ids),i=new Uint32Array(e.positions);return Es(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 Ec(t){let e=+t;return!isNaN(e)&&e<=Number.MAX_SAFE_INTEGER?e:(0,Fc.default)(String(t))}u(Ec,"getNumericId");function Es(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;Vo(t,o,a),Vo(e,3*o,3*a),Vo(e,3*o+1,3*a+1),Vo(e,3*o+2,3*a+2)}a-r<n-a?(Es(t,e,r,a),r=a+1):(Es(t,e,a+1,n),n=a)}}u(Es,"sort");function Vo(t,e,r){let n=t[e];t[e]=t[r],t[r]=n}u(Vo,"swap");E("FeaturePositionMap",qn);x();var jn=class{static{u(this,"Uniform")}constructor(e,r){this.gl=e.gl,this.location=r}};var Ir=class extends jn{static{u(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 Bo=class extends jn{static{u(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]))}},zo=class extends jn{static{u(this,"UniformColor")}constructor(e,r){super(e,r),this.current=K.transparent}set(e){(e.r!==this.current.r||e.g!==this.current.g||e.b!==this.current.b||e.a!==this.current.a)&&(this.current=e,this.gl.uniform4f(this.location,e.r,e.g,e.b,e.a))}},cP=new Float32Array(16);function Fs(t){return[Ts(255*t.r,255*t.g),Ts(255*t.b,255*t.a)]}u(Fs,"packColor");var Yt=class{static{u(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 zo(e,r):new Ir(e,r)}},Tt=class{static{u(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 Bo(e,r):new Ir(e,r)}},Ke=class{static{u(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=Fs(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()}},ze=class{static{u(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),l=this.paintVertexArray.length;this.paintVertexArray.resize(e),this._setPaintValue(l,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=Fs(n),a=Fs(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 Ir(e,r)}},nt=class{static{u(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,l=i[o],c=i[a],p=i[s];if(!(!l||!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],l.tl[0],l.tl[1],l.br[0],l.br[1],c.pixelRatio,l.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,Gn.members,this.expression.isStateDependent),this.zoomOutPaintVertexBuffer=e.createVertexBuffer(this.zoomOutPaintVertexArray,Gn.members,this.expression.isStateDependent))}destroy(){this.zoomOutPaintVertexBuffer&&this.zoomOutPaintVertexBuffer.destroy(),this.zoomInPaintVertexBuffer&&this.zoomInPaintVertexBuffer.destroy()}},Ro=class{static{u(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 _e)||!xt(a.property.specification))continue;let s=hd(o,e.type),l=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(l.kind==="constant")this.binders[o]=y?new Tt(l.value,s):new Yt(l.value,s,c),i.push(`/u_${o}`);else if(l.kind==="source"||y){let m=Lc(o,c,"source");this.binders[o]=y?new nt(l,c,p,r,m,e.id):new Ke(l,s,c,m),i.push(`/a_${o}`)}else{let m=Lc(o,c,"composite");this.binders[o]=new ze(l,s,c,p,r,m),i.push(`/z_${o}`)}}this.cacheKey=i.sort().join("")}getMaxValue(e){let r=this.binders[e];return r instanceof Ke||r instanceof ze?r.maxValue:0}populatePaintArrays(e,r,n,i,o){for(let a in this.binders){let s=this.binders[a];(s instanceof Ke||s instanceof ze||s instanceof nt)&&s.populatePaintArray(e,r,n,i,o)}}setConstantPatternPositions(e,r){for(let n in this.binders){let i=this.binders[n];i instanceof Tt&&i.setConstantPatternPositions(e,r)}}updatePaintArrays(e,r,n,i,o){let a=!1;for(let s in e){let l=r.getPositions(s);for(let c of l){let p=n.feature(c.index);for(let f in this.binders){let y=this.binders[f];if((y instanceof Ke||y instanceof ze||y instanceof nt)&&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 Yt||n instanceof Tt)&&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 Ke||n instanceof ze)for(let i=0;i<n.paintVertexAttributes.length;i++)e.push(n.paintVertexAttributes[i].name);else if(n instanceof nt)for(let i=0;i<Gn.members.length;i++)e.push(Gn.members[i].name)}return e}getBinderUniforms(){let e=[];for(let r in this.binders){let n=this.binders[r];if(n instanceof Yt||n instanceof Tt||n instanceof ze)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 Yt||o instanceof Tt||o instanceof ze){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 nt){let i=e.fromScale===2?n.zoomInPaintVertexBuffer:n.zoomOutPaintVertexBuffer;i&&this._buffers.push(i)}else(n instanceof Ke||n instanceof ze)&&n.paintVertexBuffer&&this._buffers.push(n.paintVertexBuffer)}}upload(e){for(let r in this.binders){let n=this.binders[r];(n instanceof Ke||n instanceof ze||n instanceof nt)&&n.upload(e)}this.updatePaintBuffers()}destroy(){for(let e in this.binders){let r=this.binders[e];(r instanceof Ke||r instanceof ze||r instanceof nt)&&r.destroy()}}},Ee=class{static{u(this,"ProgramConfigurationSet")}constructor(e,r,n=()=>!0){this.programConfigurations={};for(let i of e)this.programConfigurations[i.id]=new Ro(i,r,n);this.needsUpload=!1,this._featureMap=new qn,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 hd(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,"_")]}u(hd,"paintAttributeNames");function dd(t){return{"line-pattern":{source:ft,composite:ft},"fill-pattern":{source:ft,composite:ft},"fill-extrusion-pattern":{source:ft,composite:ft}}[t]}u(dd,"getLayoutException");function Lc(t,e,r){let n={color:{source:_t,composite:_r},number:{source:Kt,composite:_t}},i=dd(t);return i&&i[r]||n[e][r]}u(Lc,"layoutType");E("ConstantBinder",Yt);E("CrossFadedConstantBinder",Tt);E("SourceExpressionBinder",Ke);E("CrossFadedCompositeBinder",nt);E("CompositeExpressionBinder",ze);E("ProgramConfiguration",Ro,{omit:["_buffers"]});E("ProgramConfigurationSet",Ee);x();x();x();var gd=15,Ls=Math.pow(2,gd-1)-1,Dc=-Ls-1;function Fe(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),l=Math.round(a.y*e);a.x=st(s,Dc,Ls),a.y=st(l,Dc,Ls),(s<a.x||s>a.x+1||l<a.y||l>a.y+1)&&he("Geometry exceeds allowed extent, reduce your vector tile buffer size")}}return r}u(Fe,"loadGeometry");x();function je(t,e){return{type:t.type,id:t.id,properties:t.properties,geometry:e?Fe(t):[]}}u(je,"toEvaluationFeature");function Oo(t,e,r,n,i){t.emplaceBack(e*2+(n+1)/2,r*2+(i+1)/2)}u(Oo,"addCircleVertex");var Qt=class{static{u(this,"CircleBucket")}constructor(e){this.zoom=e.zoom,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 _o,this.indexArray=new Be,this.segments=new ge,this.programConfigurations=new Ee(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;i.type==="circle"&&(a=i.layout.get("circle-sort-key"),s=!a.isConstant());for(let{feature:l,id:c,index:p,sourceLayerIndex:f}of e){let y=this.layers[0]._featureFilter.needGeometry,m=je(l,y);if(!this.layers[0]._featureFilter.filter(new Z(this.zoom),m,n))continue;let h=s?a.evaluate(m,{},n):void 0,d={id:c,properties:l.properties,type:l.type,sourceLayerIndex:f,index:p,geometry:y?m.geometry:Fe(l),patterns:{},sortKey:h};o.push(d)}s&&o.sort((l,c)=>l.sortKey-c.sortKey);for(let l of o){let{geometry:c,index:p,sourceLayerIndex:f}=l,y=e[p].feature;this.addFeature(l,c,p,n),r.featureIndex.insert(y,c,p,f,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,Tc),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){for(let o of r)for(let a of o){let s=a.x,l=a.y;if(s<0||s>=8192||l<0||l>=8192)continue;let c=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,e.sortKey),p=c.vertexLength;Oo(this.layoutVertexArray,s,l,-1,-1),Oo(this.layoutVertexArray,s,l,1,-1),Oo(this.layoutVertexArray,s,l,1,1),Oo(this.layoutVertexArray,s,l,-1,1),this.indexArray.emplaceBack(p,p+1,p+2),this.indexArray.emplaceBack(p,p+3,p+2),c.vertexLength+=4,c.primitiveLength+=2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,n,{},i)}};E("CircleBucket",Qt,{omit:["layers"]});x();var Jn=X(xe(),1);function Bc(t,e){for(let r=0;r<t.length;r++)if(Tr(e,t[r]))return!0;for(let r=0;r<e.length;r++)if(Tr(t,e[r]))return!0;return!!Vs(t,e)}u(Bc,"polygonIntersectsPolygon");function zc(t,e,r){return!!(Tr(t,e)||Ds(e,t,r))}u(zc,"polygonIntersectsBufferedPoint");function No(t,e){if(t.length===1)return Vc(e,t[0]);for(let r=0;r<e.length;r++){let n=e[r];for(let i=0;i<n.length;i++)if(Tr(t,n[i]))return!0}for(let r=0;r<t.length;r++)if(Vc(e,t[r]))return!0;for(let r=0;r<e.length;r++)if(Vs(t,e[r]))return!0;return!1}u(No,"polygonIntersectsMultiPolygon");function Rc(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(Tr(t,i[o]))return!0}if(xd(t,i,r))return!0}return!1}u(Rc,"polygonIntersectsBufferedMultiLine");function xd(t,e,r){if(t.length>1){if(Vs(t,e))return!0;for(let n=0;n<e.length;n++)if(Ds(e[n],t,r))return!0}for(let n=0;n<t.length;n++)if(Ds(t[n],e,r))return!0;return!1}u(xd,"lineIntersectsBufferedLine");function Vs(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(bd(n,i,a,s))return!0}}return!1}u(Vs,"lineIntersectsLine");function bd(t,e,r,n){return lt(t,r,n)!==lt(e,r,n)&<(t,e,r)!==lt(t,e,n)}u(bd,"lineSegmentIntersectsLineSegment");function Ds(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(Bs(t,o,a)<n)return!0}return!1}u(Ds,"pointIntersectsBufferedLine");function Bs(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))}u(Bs,"distToSegmentSquared");function Vc(t,e){let r=!1,n,i,o;for(let a=0;a<t.length;a++){n=t[a];for(let s=0,l=n.length-1;s<n.length;l=s++)i=n[s],o=n[l],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}u(Vc,"multiPolygonContainsPoint");function Tr(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}u(Tr,"polygonContainsPoint");function Oc(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 Jn.default(e,r),new Jn.default(e,i),new Jn.default(n,i),new Jn.default(n,r)];if(t.length>2){for(let a of o)if(Tr(t,a))return!0}for(let a=0;a<t.length-1;a++){let s=t[a],l=t[a+1];if(vd(s,l,o))return!0}return!1}u(Oc,"polygonIntersectsBox");function vd(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])}u(vd,"edgeIntersectsBox");x();var Uo=X(xe(),1);function er(t,e,r){let n=e.paint.get(t).value;return n.kind==="constant"?n.value:r.programConfigurations.get(e.id).getMaxValue(t)}u(er,"getMaximumPaintValue");function Ct(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}u(Ct,"translateDistance");function kt(t,e,r,n,i){if(!e[0]&&!e[1])return t;let o=Uo.default.convert(e)._mult(i);r==="viewport"&&o._rotate(-n);let a=[];for(let s=0;s<t.length;s++){let l=t[s];a.push(l.sub(o))}return a}u(kt,"translate");function Nc(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],l=i[a],c=i[a+1],p=a===0?new Uo.default(0,0):l.sub(s)._unit()._perp(),f=a===i.length-1?new Uo.default(0,0):c.sub(l)._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(l))}r.push(o)}return r}u(Nc,"offsetLine");x();var Uc,Pd=u(()=>Uc=Uc||new oe({"circle-sort-key":new U(_.layout_circle["circle-sort-key"])}),"getLayout"),$c,Sd=u(()=>$c=$c||new oe({"circle-radius":new U(_.paint_circle["circle-radius"]),"circle-color":new U(_.paint_circle["circle-color"]),"circle-blur":new U(_.paint_circle["circle-blur"]),"circle-opacity":new U(_.paint_circle["circle-opacity"]),"circle-translate":new O(_.paint_circle["circle-translate"]),"circle-translate-anchor":new O(_.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new O(_.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new O(_.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new U(_.paint_circle["circle-stroke-width"]),"circle-stroke-color":new U(_.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new U(_.paint_circle["circle-stroke-opacity"])}),"getPaint"),Gc={get paint(){return Sd()},get layout(){return Pd()}};x();x();var re=1e-6,Je=typeof Float32Array<"u"?Float32Array:Array,Zn=Math.random;var vS=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 Wn={};zl(Wn,{add:()=>ag,adjoint:()=>Md,clone:()=>Ad,copy:()=>_d,create:()=>wd,determinant:()=>Ed,equals:()=>cg,exactEquals:()=>ug,frob:()=>og,fromQuat:()=>Hd,fromQuat2:()=>qd,fromRotation:()=>Nd,fromRotationTranslation:()=>Zc,fromRotationTranslationScale:()=>Zd,fromRotationTranslationScaleOrigin:()=>Wd,fromScaling:()=>Od,fromTranslation:()=>Rd,fromValues:()=>Id,fromXRotation:()=>Ud,fromYRotation:()=>$d,fromZRotation:()=>Gd,frustum:()=>Xd,getRotation:()=>Jd,getScaling:()=>Wc,getTranslation:()=>jd,identity:()=>jc,invert:()=>kd,lookAt:()=>rg,mul:()=>pg,multiply:()=>Jc,multiplyScalar:()=>sg,multiplyScalarAndAdd:()=>lg,ortho:()=>eg,orthoNO:()=>Xc,orthoZO:()=>tg,perspective:()=>Kd,perspectiveFromFieldOfView:()=>Qd,perspectiveNO:()=>Hc,perspectiveZO:()=>Yd,rotate:()=>Dd,rotateX:()=>Vd,rotateY:()=>Bd,rotateZ:()=>zd,scale:()=>Ld,set:()=>Td,str:()=>ig,sub:()=>fg,subtract:()=>Kc,targetTo:()=>ng,translate:()=>Fd,transpose:()=>Cd});x();function wd(){var t=new Je(16);return Je!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t}u(wd,"create");function Ad(t){var e=new Je(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}u(Ad,"clone");function _d(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}u(_d,"copy");function Id(t,e,r,n,i,o,a,s,l,c,p,f,y,m,h,d){var g=new Je(16);return g[0]=t,g[1]=e,g[2]=r,g[3]=n,g[4]=i,g[5]=o,g[6]=a,g[7]=s,g[8]=l,g[9]=c,g[10]=p,g[11]=f,g[12]=y,g[13]=m,g[14]=h,g[15]=d,g}u(Id,"fromValues");function Td(t,e,r,n,i,o,a,s,l,c,p,f,y,m,h,d,g){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t[4]=o,t[5]=a,t[6]=s,t[7]=l,t[8]=c,t[9]=p,t[10]=f,t[11]=y,t[12]=m,t[13]=h,t[14]=d,t[15]=g,t}u(Td,"set");function jc(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}u(jc,"identity");function Cd(t,e){if(t===e){var r=e[1],n=e[2],i=e[3],o=e[6],a=e[7],s=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=r,t[6]=e[9],t[7]=e[13],t[8]=n,t[9]=o,t[11]=e[14],t[12]=i,t[13]=a,t[14]=s}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t}u(Cd,"transpose");function kd(t,e){var r=e[0],n=e[1],i=e[2],o=e[3],a=e[4],s=e[5],l=e[6],c=e[7],p=e[8],f=e[9],y=e[10],m=e[11],h=e[12],d=e[13],g=e[14],b=e[15],P=r*s-n*a,v=r*l-i*a,S=r*c-o*a,w=n*l-i*s,I=n*c-o*s,M=i*c-o*l,V=p*d-f*h,D=p*g-y*h,C=p*b-m*h,k=f*g-y*d,F=f*b-m*d,R=y*b-m*g,T=P*R-v*F+S*k+w*C-I*D+M*V;return T?(T=1/T,t[0]=(s*R-l*F+c*k)*T,t[1]=(i*F-n*R-o*k)*T,t[2]=(d*M-g*I+b*w)*T,t[3]=(y*I-f*M-m*w)*T,t[4]=(l*C-a*R-c*D)*T,t[5]=(r*R-i*C+o*D)*T,t[6]=(g*S-h*M-b*v)*T,t[7]=(p*M-y*S+m*v)*T,t[8]=(a*F-s*C+c*V)*T,t[9]=(n*C-r*F-o*V)*T,t[10]=(h*I-d*S+b*P)*T,t[11]=(f*S-p*I-m*P)*T,t[12]=(s*D-a*k-l*V)*T,t[13]=(r*k-n*D+i*V)*T,t[14]=(d*v-h*w-g*P)*T,t[15]=(p*w-f*v+y*P)*T,t):null}u(kd,"invert");function Md(t,e){var r=e[0],n=e[1],i=e[2],o=e[3],a=e[4],s=e[5],l=e[6],c=e[7],p=e[8],f=e[9],y=e[10],m=e[11],h=e[12],d=e[13],g=e[14],b=e[15];return t[0]=s*(y*b-m*g)-f*(l*b-c*g)+d*(l*m-c*y),t[1]=-(n*(y*b-m*g)-f*(i*b-o*g)+d*(i*m-o*y)),t[2]=n*(l*b-c*g)-s*(i*b-o*g)+d*(i*c-o*l),t[3]=-(n*(l*m-c*y)-s*(i*m-o*y)+f*(i*c-o*l)),t[4]=-(a*(y*b-m*g)-p*(l*b-c*g)+h*(l*m-c*y)),t[5]=r*(y*b-m*g)-p*(i*b-o*g)+h*(i*m-o*y),t[6]=-(r*(l*b-c*g)-a*(i*b-o*g)+h*(i*c-o*l)),t[7]=r*(l*m-c*y)-a*(i*m-o*y)+p*(i*c-o*l),t[8]=a*(f*b-m*d)-p*(s*b-c*d)+h*(s*m-c*f),t[9]=-(r*(f*b-m*d)-p*(n*b-o*d)+h*(n*m-o*f)),t[10]=r*(s*b-c*d)-a*(n*b-o*d)+h*(n*c-o*s),t[11]=-(r*(s*m-c*f)-a*(n*m-o*f)+p*(n*c-o*s)),t[12]=-(a*(f*g-y*d)-p*(s*g-l*d)+h*(s*y-l*f)),t[13]=r*(f*g-y*d)-p*(n*g-i*d)+h*(n*y-i*f),t[14]=-(r*(s*g-l*d)-a*(n*g-i*d)+h*(n*l-i*s)),t[15]=r*(s*y-l*f)-a*(n*y-i*f)+p*(n*l-i*s),t}u(Md,"adjoint");function Ed(t){var e=t[0],r=t[1],n=t[2],i=t[3],o=t[4],a=t[5],s=t[6],l=t[7],c=t[8],p=t[9],f=t[10],y=t[11],m=t[12],h=t[13],d=t[14],g=t[15],b=e*a-r*o,P=e*s-n*o,v=e*l-i*o,S=r*s-n*a,w=r*l-i*a,I=n*l-i*s,M=c*h-p*m,V=c*d-f*m,D=c*g-y*m,C=p*d-f*h,k=p*g-y*h,F=f*g-y*d;return b*F-P*k+v*C+S*D-w*V+I*M}u(Ed,"determinant");function Jc(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3],s=e[4],l=e[5],c=e[6],p=e[7],f=e[8],y=e[9],m=e[10],h=e[11],d=e[12],g=e[13],b=e[14],P=e[15],v=r[0],S=r[1],w=r[2],I=r[3];return t[0]=v*n+S*s+w*f+I*d,t[1]=v*i+S*l+w*y+I*g,t[2]=v*o+S*c+w*m+I*b,t[3]=v*a+S*p+w*h+I*P,v=r[4],S=r[5],w=r[6],I=r[7],t[4]=v*n+S*s+w*f+I*d,t[5]=v*i+S*l+w*y+I*g,t[6]=v*o+S*c+w*m+I*b,t[7]=v*a+S*p+w*h+I*P,v=r[8],S=r[9],w=r[10],I=r[11],t[8]=v*n+S*s+w*f+I*d,t[9]=v*i+S*l+w*y+I*g,t[10]=v*o+S*c+w*m+I*b,t[11]=v*a+S*p+w*h+I*P,v=r[12],S=r[13],w=r[14],I=r[15],t[12]=v*n+S*s+w*f+I*d,t[13]=v*i+S*l+w*y+I*g,t[14]=v*o+S*c+w*m+I*b,t[15]=v*a+S*p+w*h+I*P,t}u(Jc,"multiply");function Fd(t,e,r){var n=r[0],i=r[1],o=r[2],a,s,l,c,p,f,y,m,h,d,g,b;return e===t?(t[12]=e[0]*n+e[4]*i+e[8]*o+e[12],t[13]=e[1]*n+e[5]*i+e[9]*o+e[13],t[14]=e[2]*n+e[6]*i+e[10]*o+e[14],t[15]=e[3]*n+e[7]*i+e[11]*o+e[15]):(a=e[0],s=e[1],l=e[2],c=e[3],p=e[4],f=e[5],y=e[6],m=e[7],h=e[8],d=e[9],g=e[10],b=e[11],t[0]=a,t[1]=s,t[2]=l,t[3]=c,t[4]=p,t[5]=f,t[6]=y,t[7]=m,t[8]=h,t[9]=d,t[10]=g,t[11]=b,t[12]=a*n+p*i+h*o+e[12],t[13]=s*n+f*i+d*o+e[13],t[14]=l*n+y*i+g*o+e[14],t[15]=c*n+m*i+b*o+e[15]),t}u(Fd,"translate");function Ld(t,e,r){var n=r[0],i=r[1],o=r[2];return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*o,t[9]=e[9]*o,t[10]=e[10]*o,t[11]=e[11]*o,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}u(Ld,"scale");function Dd(t,e,r,n){var i=n[0],o=n[1],a=n[2],s=Math.hypot(i,o,a),l,c,p,f,y,m,h,d,g,b,P,v,S,w,I,M,V,D,C,k,F,R,T,N;return s<re?null:(s=1/s,i*=s,o*=s,a*=s,l=Math.sin(r),c=Math.cos(r),p=1-c,f=e[0],y=e[1],m=e[2],h=e[3],d=e[4],g=e[5],b=e[6],P=e[7],v=e[8],S=e[9],w=e[10],I=e[11],M=i*i*p+c,V=o*i*p+a*l,D=a*i*p-o*l,C=i*o*p-a*l,k=o*o*p+c,F=a*o*p+i*l,R=i*a*p+o*l,T=o*a*p-i*l,N=a*a*p+c,t[0]=f*M+d*V+v*D,t[1]=y*M+g*V+S*D,t[2]=m*M+b*V+w*D,t[3]=h*M+P*V+I*D,t[4]=f*C+d*k+v*F,t[5]=y*C+g*k+S*F,t[6]=m*C+b*k+w*F,t[7]=h*C+P*k+I*F,t[8]=f*R+d*T+v*N,t[9]=y*R+g*T+S*N,t[10]=m*R+b*T+w*N,t[11]=h*R+P*T+I*N,e!==t&&(t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t)}u(Dd,"rotate");function Vd(t,e,r){var n=Math.sin(r),i=Math.cos(r),o=e[4],a=e[5],s=e[6],l=e[7],c=e[8],p=e[9],f=e[10],y=e[11];return e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=o*i+c*n,t[5]=a*i+p*n,t[6]=s*i+f*n,t[7]=l*i+y*n,t[8]=c*i-o*n,t[9]=p*i-a*n,t[10]=f*i-s*n,t[11]=y*i-l*n,t}u(Vd,"rotateX");function Bd(t,e,r){var n=Math.sin(r),i=Math.cos(r),o=e[0],a=e[1],s=e[2],l=e[3],c=e[8],p=e[9],f=e[10],y=e[11];return e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=o*i-c*n,t[1]=a*i-p*n,t[2]=s*i-f*n,t[3]=l*i-y*n,t[8]=o*n+c*i,t[9]=a*n+p*i,t[10]=s*n+f*i,t[11]=l*n+y*i,t}u(Bd,"rotateY");function zd(t,e,r){var n=Math.sin(r),i=Math.cos(r),o=e[0],a=e[1],s=e[2],l=e[3],c=e[4],p=e[5],f=e[6],y=e[7];return e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=o*i+c*n,t[1]=a*i+p*n,t[2]=s*i+f*n,t[3]=l*i+y*n,t[4]=c*i-o*n,t[5]=p*i-a*n,t[6]=f*i-s*n,t[7]=y*i-l*n,t}u(zd,"rotateZ");function Rd(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=e[0],t[13]=e[1],t[14]=e[2],t[15]=1,t}u(Rd,"fromTranslation");function Od(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e[1],t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e[2],t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}u(Od,"fromScaling");function Nd(t,e,r){var n=r[0],i=r[1],o=r[2],a=Math.hypot(n,i,o),s,l,c;return a<re?null:(a=1/a,n*=a,i*=a,o*=a,s=Math.sin(e),l=Math.cos(e),c=1-l,t[0]=n*n*c+l,t[1]=i*n*c+o*s,t[2]=o*n*c-i*s,t[3]=0,t[4]=n*i*c-o*s,t[5]=i*i*c+l,t[6]=o*i*c+n*s,t[7]=0,t[8]=n*o*c+i*s,t[9]=i*o*c-n*s,t[10]=o*o*c+l,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t)}u(Nd,"fromRotation");function Ud(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=n,t[6]=r,t[7]=0,t[8]=0,t[9]=-r,t[10]=n,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}u(Ud,"fromXRotation");function $d(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=0,t[2]=-r,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=r,t[9]=0,t[10]=n,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}u($d,"fromYRotation");function Gd(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=r,t[2]=0,t[3]=0,t[4]=-r,t[5]=n,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}u(Gd,"fromZRotation");function Zc(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3],s=n+n,l=i+i,c=o+o,p=n*s,f=n*l,y=n*c,m=i*l,h=i*c,d=o*c,g=a*s,b=a*l,P=a*c;return t[0]=1-(m+d),t[1]=f+P,t[2]=y-b,t[3]=0,t[4]=f-P,t[5]=1-(p+d),t[6]=h+g,t[7]=0,t[8]=y+b,t[9]=h-g,t[10]=1-(p+m),t[11]=0,t[12]=r[0],t[13]=r[1],t[14]=r[2],t[15]=1,t}u(Zc,"fromRotationTranslation");function qd(t,e){var r=new Je(3),n=-e[0],i=-e[1],o=-e[2],a=e[3],s=e[4],l=e[5],c=e[6],p=e[7],f=n*n+i*i+o*o+a*a;return f>0?(r[0]=(s*a+p*n+l*o-c*i)*2/f,r[1]=(l*a+p*i+c*n-s*o)*2/f,r[2]=(c*a+p*o+s*i-l*n)*2/f):(r[0]=(s*a+p*n+l*o-c*i)*2,r[1]=(l*a+p*i+c*n-s*o)*2,r[2]=(c*a+p*o+s*i-l*n)*2),Zc(t,e,r),t}u(qd,"fromQuat2");function jd(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t}u(jd,"getTranslation");function Wc(t,e){var r=e[0],n=e[1],i=e[2],o=e[4],a=e[5],s=e[6],l=e[8],c=e[9],p=e[10];return t[0]=Math.hypot(r,n,i),t[1]=Math.hypot(o,a,s),t[2]=Math.hypot(l,c,p),t}u(Wc,"getScaling");function Jd(t,e){var r=new Je(3);Wc(r,e);var n=1/r[0],i=1/r[1],o=1/r[2],a=e[0]*n,s=e[1]*i,l=e[2]*o,c=e[4]*n,p=e[5]*i,f=e[6]*o,y=e[8]*n,m=e[9]*i,h=e[10]*o,d=a+p+h,g=0;return d>0?(g=Math.sqrt(d+1)*2,t[3]=.25*g,t[0]=(f-m)/g,t[1]=(y-l)/g,t[2]=(s-c)/g):a>p&&a>h?(g=Math.sqrt(1+a-p-h)*2,t[3]=(f-m)/g,t[0]=.25*g,t[1]=(s+c)/g,t[2]=(y+l)/g):p>h?(g=Math.sqrt(1+p-a-h)*2,t[3]=(y-l)/g,t[0]=(s+c)/g,t[1]=.25*g,t[2]=(f+m)/g):(g=Math.sqrt(1+h-a-p)*2,t[3]=(s-c)/g,t[0]=(y+l)/g,t[1]=(f+m)/g,t[2]=.25*g),t}u(Jd,"getRotation");function Zd(t,e,r,n){var i=e[0],o=e[1],a=e[2],s=e[3],l=i+i,c=o+o,p=a+a,f=i*l,y=i*c,m=i*p,h=o*c,d=o*p,g=a*p,b=s*l,P=s*c,v=s*p,S=n[0],w=n[1],I=n[2];return t[0]=(1-(h+g))*S,t[1]=(y+v)*S,t[2]=(m-P)*S,t[3]=0,t[4]=(y-v)*w,t[5]=(1-(f+g))*w,t[6]=(d+b)*w,t[7]=0,t[8]=(m+P)*I,t[9]=(d-b)*I,t[10]=(1-(f+h))*I,t[11]=0,t[12]=r[0],t[13]=r[1],t[14]=r[2],t[15]=1,t}u(Zd,"fromRotationTranslationScale");function Wd(t,e,r,n,i){var o=e[0],a=e[1],s=e[2],l=e[3],c=o+o,p=a+a,f=s+s,y=o*c,m=o*p,h=o*f,d=a*p,g=a*f,b=s*f,P=l*c,v=l*p,S=l*f,w=n[0],I=n[1],M=n[2],V=i[0],D=i[1],C=i[2],k=(1-(d+b))*w,F=(m+S)*w,R=(h-v)*w,T=(m-S)*I,N=(1-(y+b))*I,$=(g+P)*I,G=(h+v)*M,ee=(g-P)*M,Pe=(1-(y+d))*M;return t[0]=k,t[1]=F,t[2]=R,t[3]=0,t[4]=T,t[5]=N,t[6]=$,t[7]=0,t[8]=G,t[9]=ee,t[10]=Pe,t[11]=0,t[12]=r[0]+V-(k*V+T*D+G*C),t[13]=r[1]+D-(F*V+N*D+ee*C),t[14]=r[2]+C-(R*V+$*D+Pe*C),t[15]=1,t}u(Wd,"fromRotationTranslationScaleOrigin");function Hd(t,e){var r=e[0],n=e[1],i=e[2],o=e[3],a=r+r,s=n+n,l=i+i,c=r*a,p=n*a,f=n*s,y=i*a,m=i*s,h=i*l,d=o*a,g=o*s,b=o*l;return t[0]=1-f-h,t[1]=p+b,t[2]=y-g,t[3]=0,t[4]=p-b,t[5]=1-c-h,t[6]=m+d,t[7]=0,t[8]=y+g,t[9]=m-d,t[10]=1-c-f,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}u(Hd,"fromQuat");function Xd(t,e,r,n,i,o,a){var s=1/(r-e),l=1/(i-n),c=1/(o-a);return t[0]=o*2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=o*2*l,t[6]=0,t[7]=0,t[8]=(r+e)*s,t[9]=(i+n)*l,t[10]=(a+o)*c,t[11]=-1,t[12]=0,t[13]=0,t[14]=a*o*2*c,t[15]=0,t}u(Xd,"frustum");function Hc(t,e,r,n,i){var o=1/Math.tan(e/2),a;return t[0]=o/r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=o,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,i!=null&&i!==1/0?(a=1/(n-i),t[10]=(i+n)*a,t[14]=2*i*n*a):(t[10]=-1,t[14]=-2*n),t}u(Hc,"perspectiveNO");var Kd=Hc;function Yd(t,e,r,n,i){var o=1/Math.tan(e/2),a;return t[0]=o/r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=o,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,i!=null&&i!==1/0?(a=1/(n-i),t[10]=i*a,t[14]=i*n*a):(t[10]=-1,t[14]=-n),t}u(Yd,"perspectiveZO");function Qd(t,e,r,n){var i=Math.tan(e.upDegrees*Math.PI/180),o=Math.tan(e.downDegrees*Math.PI/180),a=Math.tan(e.leftDegrees*Math.PI/180),s=Math.tan(e.rightDegrees*Math.PI/180),l=2/(a+s),c=2/(i+o);return t[0]=l,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=c,t[6]=0,t[7]=0,t[8]=-((a-s)*l*.5),t[9]=(i-o)*c*.5,t[10]=n/(r-n),t[11]=-1,t[12]=0,t[13]=0,t[14]=n*r/(r-n),t[15]=0,t}u(Qd,"perspectiveFromFieldOfView");function Xc(t,e,r,n,i,o,a){var s=1/(e-r),l=1/(n-i),c=1/(o-a);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*l,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*c,t[11]=0,t[12]=(e+r)*s,t[13]=(i+n)*l,t[14]=(a+o)*c,t[15]=1,t}u(Xc,"orthoNO");var eg=Xc;function tg(t,e,r,n,i,o,a){var s=1/(e-r),l=1/(n-i),c=1/(o-a);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*l,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=c,t[11]=0,t[12]=(e+r)*s,t[13]=(i+n)*l,t[14]=o*c,t[15]=1,t}u(tg,"orthoZO");function rg(t,e,r,n){var i,o,a,s,l,c,p,f,y,m,h=e[0],d=e[1],g=e[2],b=n[0],P=n[1],v=n[2],S=r[0],w=r[1],I=r[2];return Math.abs(h-S)<re&&Math.abs(d-w)<re&&Math.abs(g-I)<re?jc(t):(p=h-S,f=d-w,y=g-I,m=1/Math.hypot(p,f,y),p*=m,f*=m,y*=m,i=P*y-v*f,o=v*p-b*y,a=b*f-P*p,m=Math.hypot(i,o,a),m?(m=1/m,i*=m,o*=m,a*=m):(i=0,o=0,a=0),s=f*a-y*o,l=y*i-p*a,c=p*o-f*i,m=Math.hypot(s,l,c),m?(m=1/m,s*=m,l*=m,c*=m):(s=0,l=0,c=0),t[0]=i,t[1]=s,t[2]=p,t[3]=0,t[4]=o,t[5]=l,t[6]=f,t[7]=0,t[8]=a,t[9]=c,t[10]=y,t[11]=0,t[12]=-(i*h+o*d+a*g),t[13]=-(s*h+l*d+c*g),t[14]=-(p*h+f*d+y*g),t[15]=1,t)}u(rg,"lookAt");function ng(t,e,r,n){var i=e[0],o=e[1],a=e[2],s=n[0],l=n[1],c=n[2],p=i-r[0],f=o-r[1],y=a-r[2],m=p*p+f*f+y*y;m>0&&(m=1/Math.sqrt(m),p*=m,f*=m,y*=m);var h=l*y-c*f,d=c*p-s*y,g=s*f-l*p;return m=h*h+d*d+g*g,m>0&&(m=1/Math.sqrt(m),h*=m,d*=m,g*=m),t[0]=h,t[1]=d,t[2]=g,t[3]=0,t[4]=f*g-y*d,t[5]=y*h-p*g,t[6]=p*d-f*h,t[7]=0,t[8]=p,t[9]=f,t[10]=y,t[11]=0,t[12]=i,t[13]=o,t[14]=a,t[15]=1,t}u(ng,"targetTo");function ig(t){return"mat4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+", "+t[9]+", "+t[10]+", "+t[11]+", "+t[12]+", "+t[13]+", "+t[14]+", "+t[15]+")"}u(ig,"str");function og(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])}u(og,"frob");function ag(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[4]=e[4]+r[4],t[5]=e[5]+r[5],t[6]=e[6]+r[6],t[7]=e[7]+r[7],t[8]=e[8]+r[8],t[9]=e[9]+r[9],t[10]=e[10]+r[10],t[11]=e[11]+r[11],t[12]=e[12]+r[12],t[13]=e[13]+r[13],t[14]=e[14]+r[14],t[15]=e[15]+r[15],t}u(ag,"add");function Kc(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[4]=e[4]-r[4],t[5]=e[5]-r[5],t[6]=e[6]-r[6],t[7]=e[7]-r[7],t[8]=e[8]-r[8],t[9]=e[9]-r[9],t[10]=e[10]-r[10],t[11]=e[11]-r[11],t[12]=e[12]-r[12],t[13]=e[13]-r[13],t[14]=e[14]-r[14],t[15]=e[15]-r[15],t}u(Kc,"subtract");function sg(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[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7]*r,t[8]=e[8]*r,t[9]=e[9]*r,t[10]=e[10]*r,t[11]=e[11]*r,t[12]=e[12]*r,t[13]=e[13]*r,t[14]=e[14]*r,t[15]=e[15]*r,t}u(sg,"multiplyScalar");function lg(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[4]=e[4]+r[4]*n,t[5]=e[5]+r[5]*n,t[6]=e[6]+r[6]*n,t[7]=e[7]+r[7]*n,t[8]=e[8]+r[8]*n,t[9]=e[9]+r[9]*n,t[10]=e[10]+r[10]*n,t[11]=e[11]+r[11]*n,t[12]=e[12]+r[12]*n,t[13]=e[13]+r[13]*n,t[14]=e[14]+r[14]*n,t[15]=e[15]+r[15]*n,t}u(lg,"multiplyScalarAndAdd");function ug(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]&&t[9]===e[9]&&t[10]===e[10]&&t[11]===e[11]&&t[12]===e[12]&&t[13]===e[13]&&t[14]===e[14]&&t[15]===e[15]}u(ug,"exactEquals");function cg(t,e){var r=t[0],n=t[1],i=t[2],o=t[3],a=t[4],s=t[5],l=t[6],c=t[7],p=t[8],f=t[9],y=t[10],m=t[11],h=t[12],d=t[13],g=t[14],b=t[15],P=e[0],v=e[1],S=e[2],w=e[3],I=e[4],M=e[5],V=e[6],D=e[7],C=e[8],k=e[9],F=e[10],R=e[11],T=e[12],N=e[13],$=e[14],G=e[15];return Math.abs(r-P)<=re*Math.max(1,Math.abs(r),Math.abs(P))&&Math.abs(n-v)<=re*Math.max(1,Math.abs(n),Math.abs(v))&&Math.abs(i-S)<=re*Math.max(1,Math.abs(i),Math.abs(S))&&Math.abs(o-w)<=re*Math.max(1,Math.abs(o),Math.abs(w))&&Math.abs(a-I)<=re*Math.max(1,Math.abs(a),Math.abs(I))&&Math.abs(s-M)<=re*Math.max(1,Math.abs(s),Math.abs(M))&&Math.abs(l-V)<=re*Math.max(1,Math.abs(l),Math.abs(V))&&Math.abs(c-D)<=re*Math.max(1,Math.abs(c),Math.abs(D))&&Math.abs(p-C)<=re*Math.max(1,Math.abs(p),Math.abs(C))&&Math.abs(f-k)<=re*Math.max(1,Math.abs(f),Math.abs(k))&&Math.abs(y-F)<=re*Math.max(1,Math.abs(y),Math.abs(F))&&Math.abs(m-R)<=re*Math.max(1,Math.abs(m),Math.abs(R))&&Math.abs(h-T)<=re*Math.max(1,Math.abs(h),Math.abs(T))&&Math.abs(d-N)<=re*Math.max(1,Math.abs(d),Math.abs(N))&&Math.abs(g-$)<=re*Math.max(1,Math.abs(g),Math.abs($))&&Math.abs(b-G)<=re*Math.max(1,Math.abs(b),Math.abs(G))}u(cg,"equals");var pg=Jc,fg=Kc;var tr={};zl(tr,{add:()=>gg,ceil:()=>xg,clone:()=>yg,copy:()=>hg,create:()=>Yc,cross:()=>kg,dist:()=>Ug,distance:()=>rp,div:()=>Ng,divide:()=>tp,dot:()=>Cg,equals:()=>zg,exactEquals:()=>Bg,floor:()=>bg,forEach:()=>jg,fromValues:()=>mg,inverse:()=>Ig,len:()=>Gg,length:()=>ip,lerp:()=>Mg,max:()=>Pg,min:()=>vg,mul:()=>Og,multiply:()=>ep,negate:()=>_g,normalize:()=>Tg,random:()=>Eg,round:()=>Sg,scale:()=>wg,scaleAndAdd:()=>Ag,set:()=>dg,sqrDist:()=>$g,sqrLen:()=>qg,squaredDistance:()=>np,squaredLength:()=>op,str:()=>Vg,sub:()=>Rg,subtract:()=>Qc,transformMat4:()=>Fg,transformQuat:()=>Lg,zero:()=>Dg});x();function Yc(){var t=new Je(4);return Je!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}u(Yc,"create");function yg(t){var e=new Je(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}u(yg,"clone");function mg(t,e,r,n){var i=new Je(4);return i[0]=t,i[1]=e,i[2]=r,i[3]=n,i}u(mg,"fromValues");function hg(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}u(hg,"copy");function dg(t,e,r,n,i){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t}u(dg,"set");function gg(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}u(gg,"add");function Qc(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}u(Qc,"subtract");function ep(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}u(ep,"multiply");function tp(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}u(tp,"divide");function xg(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}u(xg,"ceil");function bg(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}u(bg,"floor");function vg(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}u(vg,"min");function Pg(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}u(Pg,"max");function Sg(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}u(Sg,"round");function wg(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}u(wg,"scale");function Ag(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}u(Ag,"scaleAndAdd");function rp(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)}u(rp,"distance");function np(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}u(np,"squaredDistance");function ip(t){var e=t[0],r=t[1],n=t[2],i=t[3];return Math.hypot(e,r,n,i)}u(ip,"length");function op(t){var e=t[0],r=t[1],n=t[2],i=t[3];return e*e+r*r+n*n+i*i}u(op,"squaredLength");function _g(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t}u(_g,"negate");function Ig(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t[3]=1/e[3],t}u(Ig,"inverse");function Tg(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}u(Tg,"normalize");function Cg(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]}u(Cg,"dot");function kg(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],l=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*l+m*s,t[1]=-(p*c)+y*a-m*o,t[2]=p*l-f*a+m*i,t[3]=-(p*s)+f*o-y*i,t}u(kg,"cross");function Mg(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}u(Mg,"lerp");function Eg(t,e){e=e||1;var r,n,i,o,a,s;do r=Zn()*2-1,n=Zn()*2-1,a=r*r+n*n;while(a>=1);do i=Zn()*2-1,o=Zn()*2-1,s=i*i+o*o;while(s>=1);var l=Math.sqrt((1-a)/s);return t[0]=e*r,t[1]=e*n,t[2]=e*i*l,t[3]=e*o*l,t}u(Eg,"random");function Fg(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}u(Fg,"transformMat4");function Lg(t,e,r){var n=e[0],i=e[1],o=e[2],a=r[0],s=r[1],l=r[2],c=r[3],p=c*n+s*o-l*i,f=c*i+l*n-a*o,y=c*o+a*i-s*n,m=-a*n-s*i-l*o;return t[0]=p*c+m*-a+f*-l-y*-s,t[1]=f*c+m*-s+y*-a-p*-l,t[2]=y*c+m*-l+p*-s-f*-a,t[3]=e[3],t}u(Lg,"transformQuat");function Dg(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t}u(Dg,"zero");function Vg(t){return"vec4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"}u(Vg,"str");function Bg(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]}u(Bg,"exactEquals");function zg(t,e){var r=t[0],n=t[1],i=t[2],o=t[3],a=e[0],s=e[1],l=e[2],c=e[3];return Math.abs(r-a)<=re*Math.max(1,Math.abs(r),Math.abs(a))&&Math.abs(n-s)<=re*Math.max(1,Math.abs(n),Math.abs(s))&&Math.abs(i-l)<=re*Math.max(1,Math.abs(i),Math.abs(l))&&Math.abs(o-c)<=re*Math.max(1,Math.abs(o),Math.abs(c))}u(zg,"equals");var Rg=Qc,Og=ep,Ng=tp,Ug=rp,$g=np,Gg=ip,qg=op,jg=function(){var t=Yc();return function(e,r,n,i,o,a){var s,l;for(r||(r=4),n||(n=0),i?l=Math.min(i*r+n,e.length):l=e.length,s=n;s<l;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}}();var ap=X(xe(),1);var $o=class extends ce{static{u(this,"CircleStyleLayer")}constructor(e){super(e,Gc)}createBucket(e){return new Qt(e)}queryRadius(e){let r=e;return er("circle-radius",this,r)+er("circle-stroke-width",this,r)+Ct(this.paint.get("circle-translate"))}queryIntersectsFeature(e,r,n,i,o,a,s,l){let c=kt(e,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),a.angle,s),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:Jg(c,l),d=m?y*s:y;for(let g of i)for(let b of g){let P=m?b:sp(b,l),v=d,S=tr.transformMat4([],[b.x,b.y,0,1],l);if(this.paint.get("circle-pitch-scale")==="viewport"&&this.paint.get("circle-pitch-alignment")==="map"?v*=S[3]/a.cameraToCenterDistance:this.paint.get("circle-pitch-scale")==="map"&&this.paint.get("circle-pitch-alignment")==="viewport"&&(v*=a.cameraToCenterDistance/S[3]),zc(h,P,v))return!0}return!1}};function sp(t,e){let r=tr.transformMat4([],[t.x,t.y,0,1],e);return new ap.default(r[0]/r[3],r[1]/r[3])}u(sp,"projectPoint");function Jg(t,e){return t.map(r=>sp(r,e))}u(Jg,"projectQueryGeometry");x();x();var Hn=class extends Qt{static{u(this,"HeatmapBucket")}};E("HeatmapBucket",Hn,{omit:["layers"]});x();var lp,Zg=u(()=>lp=lp||new oe({"heatmap-radius":new U(_.paint_heatmap["heatmap-radius"]),"heatmap-weight":new U(_.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new O(_.paint_heatmap["heatmap-intensity"]),"heatmap-color":new Ht(_.paint_heatmap["heatmap-color"]),"heatmap-opacity":new O(_.paint_heatmap["heatmap-opacity"])}),"getPaint"),up={get paint(){return Zg()}};x();x();function zs(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}u(zs,"createImage");function cp(t,{width:e,height:r},n){if(e===t.width&&r===t.height)return;let i=zs({},{width:e,height:r},n);Rs(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}u(cp,"resizeImage");function Rs(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 l=0;l<i.height;l++){let c=((r.y+l)*t.width+r.x)*o,p=((n.y+l)*e.width+n.x)*o;for(let f=0;f<i.width*o;f++)s[p+f]=a[c+f]}return e}u(Rs,"copyImage");var rr=class t{static{u(this,"AlphaImage")}constructor(e,r){zs(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){Rs(e,r,n,i,o,1)}},be=class t{static{u(this,"RGBAImage")}constructor(e,r){zs(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){Rs(e,r,n,i,o,4)}};E("AlphaImage",rr);E("RGBAImage",be);function pp(t){let e={},r=t.resolution||256,n=t.clips?t.clips.length:1,i=t.image||new be({width:r,height:n});if(!Wl(r))throw new Error(`width is not a power of 2 - ${r}`);let o=u((a,s,l)=>{e[t.evaluationKey]=l;let c=t.expression.evaluate(e);i.data[a+s+0]=Math.floor(c.r*255/c.a),i.data[a+s+1]=Math.floor(c.g*255/c.a),i.data[a+s+2]=Math.floor(c.b*255/c.a),i.data[a+s+3]=Math.floor(c.a*255)},"renderPixel");if(t.clips)for(let a=0,s=0;a<n;++a,s+=r*4)for(let l=0,c=0;l<r;l++,c+=4){let p=l/(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 l=a/(r-1);o(0,s,l)}return i}u(pp,"renderColorRamp");var Go=class extends ce{static{u(this,"HeatmapStyleLayer")}createBucket(e){return new Hn(e)}constructor(e){super(e,up),this._updateColorRamp()}_handleSpecialPaintPropertyUpdate(e){e==="heatmap-color"&&this._updateColorRamp()}_updateColorRamp(){let e=this._transitionablePaint._values["heatmap-color"].value.expression;this.colorRamp=pp({expression:e,evaluationKey:"heatmapDensity",image:this.colorRamp}),this.colorRampTexture=null}resize(){this.heatmapFbo&&(this.heatmapFbo.destroy(),this.heatmapFbo=null)}queryRadius(){return 0}queryIntersectsFeature(){return!1}hasOffscreenPass(){return this.paint.get("heatmap-opacity")!==0&&this.visibility!=="none"}};x();x();var fp,Wg=u(()=>fp=fp||new oe({"hillshade-illumination-direction":new O(_.paint_hillshade["hillshade-illumination-direction"]),"hillshade-illumination-anchor":new O(_.paint_hillshade["hillshade-illumination-anchor"]),"hillshade-exaggeration":new O(_.paint_hillshade["hillshade-exaggeration"]),"hillshade-shadow-color":new O(_.paint_hillshade["hillshade-shadow-color"]),"hillshade-highlight-color":new O(_.paint_hillshade["hillshade-highlight-color"]),"hillshade-accent-color":new O(_.paint_hillshade["hillshade-accent-color"])}),"getPaint"),yp={get paint(){return Wg()}};var qo=class extends ce{static{u(this,"HillshadeStyleLayer")}constructor(e){super(e,yp)}hasOffscreenPass(){return this.paint.get("hillshade-exaggeration")!==0&&this.visibility!=="none"}};x();x();x();var Hg=te([{name:"a_pos",components:2,type:"Int16"}],4);var{members:mp,size:Bw,alignment:zw}=Hg;var vp=X(Gs(),1);x();x();function qs(t,e,r,n,i){bp(t,e,r||0,n||t.length-1,i||px)}u(qs,"quickselect");function bp(t,e,r,n,i){for(;n>r;){if(n-r>600){var o=n-r+1,a=e-r+1,s=Math.log(o),l=.5*Math.exp(2*s/3),c=.5*Math.sqrt(s*l*(o-l)/o)*(a-o/2<0?-1:1),p=Math.max(r,Math.floor(e-a*l/o+c)),f=Math.min(n,Math.floor(e+(o-a)*l/o+c));bp(t,e,p,f,i)}var y=t[e],m=r,h=n;for(Qn(t,r,e),i(t[n],y)>0&&Qn(t,r,n);m<h;){for(Qn(t,m,h),m++,h--;i(t[m],y)<0;)m++;for(;i(t[h],y)>0;)h--}i(t[r],y)===0?Qn(t,r,h):(h++,Qn(t,h,n)),h<=e&&(r=h+1),e<=h&&(n=h-1)}}u(bp,"quickselectStep");function Qn(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}u(Qn,"swap");function px(t,e){return t<e?-1:t>e?1:0}u(px,"defaultCompare");function kr(t,e){let r=t.length;if(r<=1)return[t];let n=[],i,o;for(let a=0;a<r;a++){let s=Kl(t[a]);s!==0&&(t[a].area=Math.abs(s),o===void 0&&(o=s<0),o===s<0?(i&&n.push(i),i=[t[a]]):i.push(t[a]))}if(i&&n.push(i),e>1)for(let a=0;a<n.length;a++)n[a].length<=e||(qs(n[a],e,1,n[a].length-1,fx),n[a]=n[a].slice(0,e));return n}u(kr,"classifyRings");function fx(t,e){return e.area-t.area}u(fx,"compareAreas");x();function Mr(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}u(Mr,"hasPattern");function Er(t,e,r,n,i){let o=i.patternDependencies;for(let a of e){let l=a.paint.get(`${t}-pattern`).value;if(l.kind!=="constant"){let c=l.evaluate({zoom:n-1},r,{},i.availableImages),p=l.evaluate({zoom:n},r,{},i.availableImages),f=l.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}u(Er,"addPatternDependencies");var yx=500,ir=class{static{u(this,"FillBucket")}constructor(e){this.zoom=e.zoom,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 Io,this.indexArray=new Be,this.indexArray2=new It,this.programConfigurations=new Ee(e.layers,e.zoom),this.segments=new ge,this.segments2=new ge,this.stateDependentLayerIds=this.layers.filter(r=>r.isStateDependent()).map(r=>r.id)}populate(e,r,n){this.hasPattern=Mr("fill",this.layers,r);let i=this.layers[0].layout.get("fill-sort-key"),o=!i.isConstant(),a=[];for(let{feature:s,id:l,index: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),y,n))continue;let m=o?i.evaluate(y,{},n,r.availableImages):void 0,h={id:l,properties:s.properties,type:s.type,sourceLayerIndex:p,index:c,geometry:f?y.geometry:Fe(s),patterns:{},sortKey:m};a.push(h)}o&&a.sort((s,l)=>s.sortKey-l.sortKey);for(let s of a){let{geometry:l,index:c,sourceLayerIndex:p}=s;if(this.hasPattern){let y=Er("fill",this.layers,s,this.zoom,r);this.patternFeatures.push(y)}else this.addFeature(s,l,c,n,{});let f=e[c].feature;r.featureIndex.insert(f,l,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)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,mp),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){for(let a of kr(r,yx)){let s=0;for(let m of a)s+=m.length;let l=this.segments.prepareSegment(s,this.layoutVertexArray,this.indexArray),c=l.vertexLength,p=[],f=[];for(let m of a){if(m.length===0)continue;m!==a[0]&&f.push(p.length/2);let h=this.segments2.prepareSegment(m.length,this.layoutVertexArray,this.indexArray2),d=h.vertexLength;this.layoutVertexArray.emplaceBack(m[0].x,m[0].y),this.indexArray2.emplaceBack(d+m.length-1,d),p.push(m[0].x),p.push(m[0].y);for(let g=1;g<m.length;g++)this.layoutVertexArray.emplaceBack(m[g].x,m[g].y),this.indexArray2.emplaceBack(d+g-1,d+g),p.push(m[g].x),p.push(m[g].y);h.vertexLength+=m.length,h.primitiveLength+=m.length}let y=(0,vp.default)(p,f);for(let m=0;m<y.length;m+=3)this.indexArray.emplaceBack(c+y[m],c+y[m+1],c+y[m+2]);l.vertexLength+=s,l.primitiveLength+=y.length/3}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,n,o,i)}};E("FillBucket",ir,{omit:["layers","patternFeatures"]});x();var Pp,mx=u(()=>Pp=Pp||new oe({"fill-sort-key":new U(_.layout_fill["fill-sort-key"])}),"getLayout"),Sp,hx=u(()=>Sp=Sp||new oe({"fill-antialias":new O(_.paint_fill["fill-antialias"]),"fill-opacity":new U(_.paint_fill["fill-opacity"]),"fill-color":new U(_.paint_fill["fill-color"]),"fill-outline-color":new U(_.paint_fill["fill-outline-color"]),"fill-translate":new O(_.paint_fill["fill-translate"]),"fill-translate-anchor":new O(_.paint_fill["fill-translate-anchor"]),"fill-pattern":new pt(_.paint_fill["fill-pattern"])}),"getPaint"),wp={get paint(){return hx()},get layout(){return mx()}};var Ho=class extends ce{static{u(this,"FillStyleLayer")}constructor(e){super(e,wp)}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 ir(e)}queryRadius(){return Ct(this.paint.get("fill-translate"))}queryIntersectsFeature(e,r,n,i,o,a,s){let l=kt(e,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),a.angle,s);return No(l,i)}isTileClipped(){return!0}};x();x();x();var dx=te([{name:"a_pos",components:2,type:"Int16"},{name:"a_normal_ed",components:4,type:"Int16"}],4),Ap=te([{name:"a_centroid",components:2,type:"Int16"}],4);var{members:_p,size:D2,alignment:V2}=dx;var Ep=X(Gs(),1),Fp=X(Mt(),1);var Cx=Fp.default.VectorTileFeature.types,kx=500,Zs=Math.pow(2,13);function ei(t,e,r,n,i,o,a,s){t.emplaceBack(e,r,Math.floor(n*Zs)*2+a,i*Zs*2,o*Zs*2,Math.round(s))}u(ei,"addVertex");var or=class{static{u(this,"FillExtrusionBucket")}constructor(e){this.zoom=e.zoom,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 To,this.centroidVertexArray=new Ao,this.indexArray=new Be,this.programConfigurations=new Ee(e.layers,e.zoom),this.segments=new ge,this.stateDependentLayerIds=this.layers.filter(r=>r.isStateDependent()).map(r=>r.id)}populate(e,r,n){this.features=[],this.hasPattern=Mr("fill-extrusion",this.layers,r);for(let{feature:i,id:o,index:a,sourceLayerIndex:s}of e){let l=this.layers[0]._featureFilter.needGeometry,c=je(i,l);if(!this.layers[0]._featureFilter.filter(new Z(this.zoom),c,n))continue;let p={id:o,sourceLayerIndex:s,index:a,geometry:l?c.geometry:Fe(i),properties:i.properties,type:i.type,patterns:{}};this.hasPattern?this.features.push(Er("fill-extrusion",this.layers,p,this.zoom,r)):this.addFeature(p,p.geometry,a,n,{}),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)}}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,_p),this.centroidVertexBuffer=e.createVertexBuffer(this.centroidVertexArray,Ap.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){let a={x:0,y:0,vertexCount:0};for(let s of kr(r,kx)){let l=0;for(let h of s)l+=h.length;let c=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray);for(let h of s){if(h.length===0||Ex(h))continue;let d=0;for(let g=0;g<h.length;g++){let b=h[g];if(g>=1){let P=h[g-1];if(!Mx(b,P)){c.vertexLength+4>ge.MAX_VERTEX_ARRAY_LENGTH&&(c=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));let v=b.sub(P)._perp()._unit(),S=P.dist(b);d+S>32768&&(d=0),ei(this.layoutVertexArray,b.x,b.y,v.x,v.y,0,0,d),ei(this.layoutVertexArray,b.x,b.y,v.x,v.y,0,1,d),a.x+=2*b.x,a.y+=2*b.y,a.vertexCount+=2,d+=S,ei(this.layoutVertexArray,P.x,P.y,v.x,v.y,0,0,d),ei(this.layoutVertexArray,P.x,P.y,v.x,v.y,0,1,d),a.x+=2*P.x,a.y+=2*P.y,a.vertexCount+=2;let w=c.vertexLength;this.indexArray.emplaceBack(w,w+2,w+1),this.indexArray.emplaceBack(w+1,w+2,w+3),c.vertexLength+=4,c.primitiveLength+=2}}}}if(c.vertexLength+l>ge.MAX_VERTEX_ARRAY_LENGTH&&(c=this.segments.prepareSegment(l,this.layoutVertexArray,this.indexArray)),Cx[e.type]!=="Polygon")continue;let p=[],f=[],y=c.vertexLength;for(let h of s)if(h.length!==0){h!==s[0]&&f.push(p.length/2);for(let d=0;d<h.length;d++){let g=h[d];ei(this.layoutVertexArray,g.x,g.y,0,0,1,1,0),a.x+=g.x,a.y+=g.y,a.vertexCount+=1,p.push(g.x),p.push(g.y)}}let m=(0,Ep.default)(p,f);for(let h=0;h<m.length;h+=3)this.indexArray.emplaceBack(y+m[h],y+m[h+2],y+m[h+1]);c.primitiveLength+=m.length/3,c.vertexLength+=l}for(let s=0;s<a.vertexCount;s++)this.centroidVertexArray.emplaceBack(Math.floor(a.x/a.vertexCount),Math.floor(a.y/a.vertexCount));this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,n,o,i)}};E("FillExtrusionBucket",or,{omit:["layers","features"]});function Mx(t,e){return t.x===e.x&&(t.x<0||t.x>8192)||t.y===e.y&&(t.y<0||t.y>8192)}u(Mx,"isBoundaryEdge");function Ex(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)}u(Ex,"isEntirelyOutside");x();var Lp,Fx=u(()=>Lp=Lp||new oe({"fill-extrusion-opacity":new O(_["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new U(_["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new O(_["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new O(_["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new pt(_["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new U(_["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new U(_["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new O(_["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])}),"getPaint"),Dp={get paint(){return Fx()}};var Ko=X(xe(),1);var Yo=class extends ce{static{u(this,"FillExtrusionStyleLayer")}constructor(e){super(e,Dp)}createBucket(e){return new or(e)}queryRadius(){return Ct(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}queryIntersectsFeature(e,r,n,i,o,a,s,l){let c=kt(e,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),a.angle,s),p=this.paint.get("fill-extrusion-height").evaluate(r,n),f=this.paint.get("fill-extrusion-base").evaluate(r,n),y=Vx(c,l,a,0),m=Dx(i,f,p,l),h=m[0],d=m[1];return Lx(h,d,y)}};function ti(t,e){return t.x*e.x+t.y*e.y}u(ti,"dot");function Vp(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),l=o.sub(n),c=a.sub(n),p=ti(s,s),f=ti(s,l),y=ti(l,l),m=ti(c,s),h=ti(c,l),d=p*y-f*f,g=(y*m-f*h)/d,b=(p*h-f*m)/d,P=1-g-b,v=n.z*P+i.z*g+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}}u(Vp,"getIntersectionDistance");function Lx(t,e,r){let n=1/0;No(r,e)&&(n=Vp(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 l=o[s],c=o[s+1],p=a[s],f=a[s+1],y=[l,c,f,p,l];Bc(r,y)&&(n=Math.min(n,Vp(r,y)))}}return n===1/0?!1:n}u(Lx,"checkIntersection");function Dx(t,e,r,n){let i=[],o=[],a=n[8]*e,s=n[9]*e,l=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=[],g=[];for(let b of h){let P=b.x,v=b.y,S=n[0]*P+n[4]*v+n[12],w=n[1]*P+n[5]*v+n[13],I=n[2]*P+n[6]*v+n[14],M=n[3]*P+n[7]*v+n[15],V=S+a,D=w+s,C=I+l,k=M+c,F=S+p,R=w+f,T=I+y,N=M+m,$=new Ko.default(V/k,D/k);$.z=C/k,d.push($);let G=new Ko.default(F/N,R/N);G.z=T/N,g.push(G)}i.push(d),o.push(g)}return[i,o]}u(Dx,"projectExtrusion");function Vx(t,e,r,n){let i=[];for(let o of t){let a=[o.x,o.y,n,1];tr.transformMat4(a,a,e),i.push(new Ko.default(a[0]/a[3],a[1]/a[3]))}return i}u(Vx,"projectQueryGeometry");x();x();x();var Bx=te([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}],4),{members:Bp,size:EA,alignment:FA}=Bx;x();var zx=te([{name:"a_uv_x",components:1,type:"Float32"},{name:"a_split_index",components:1,type:"Float32"}]),{members:zp,size:BA,alignment:zA}=zx;var Np=X(Mt(),1);var Rx=Np.default.VectorTileFeature.types,Rp=63,Ox=Math.cos(75/2*(Math.PI/180)),Nx=15,Ux=20,$x=15,Up=1/2,Op=Math.pow(2,$x-1)/Up,ar=class{static{u(this,"LineBucket")}constructor(e){this.zoom=e.zoom,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 Co,this.layoutVertexArray2=new ko,this.indexArray=new Be,this.programConfigurations=new Ee(e.layers,e.zoom),this.segments=new ge,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter(r=>r.isStateDependent()).map(r=>r.id)}populate(e,r,n){this.hasPattern=Mr("line",this.layers,r);let i=this.layers[0].layout.get("line-sort-key"),o=!i.isConstant(),a=[];for(let{feature:s,id:l,index: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),y,n))continue;let m=o?i.evaluate(y,{},n):void 0,h={id:l,properties:s.properties,type:s.type,sourceLayerIndex:p,index:c,geometry:f?y.geometry:Fe(s),patterns:{},sortKey:m};a.push(h)}o&&a.sort((s,l)=>s.sortKey-l.sortKey);for(let s of a){let{geometry:l,index:c,sourceLayerIndex:p}=s;if(this.hasPattern){let y=Er("line",this.layers,s,this.zoom,r);this.patternFeatures.push(y)}else this.addFeature(s,l,c,n,{});let f=e[c].feature;r.featureIndex.insert(f,l,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)}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,zp)),this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Bp),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){let a=this.layers[0].layout,s=a.get("line-join").evaluate(e,{}),l=a.get("line-cap"),c=a.get("line-miter-limit"),p=a.get("line-round-limit");this.lineClips=this.lineFeatureClips(e);for(let f of r)this.addLine(f,e,s,l,c,p);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,n,o,i)}addLine(e,r,n,i,o,a){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(let b=0;b<e.length-1;b++)this.totalDistance+=e[b].dist(e[b+1]);this.updateScaledDistance(),this.maxLineLength=Math.max(this.maxLineLength,this.totalDistance)}let s=Rx[r.type]==="Polygon",l=e.length;for(;l>=2&&e[l-1].equals(e[l-2]);)l--;let c=0;for(;c<l-1&&e[c].equals(e[c+1]);)c++;if(l<(s?3:2))return;n==="bevel"&&(o=1.05);let p=this.overscaling<=16?Nx*8192/(512*this.overscaling):0,f=this.segments.prepareSegment(l*10,this.layoutVertexArray,this.indexArray),y,m,h,d,g;this.e1=this.e2=-1,s&&(y=e[l-2],g=e[c].sub(y)._unit()._perp());for(let b=c;b<l;b++){if(h=b===l-1?s?e[c+1]:void 0:e[b+1],h&&e[b].equals(h))continue;g&&(d=g),y&&(m=y),y=e[b],g=h?h.sub(y)._unit()._perp():d,d=d||g;let P=d.add(g);(P.x!==0||P.y!==0)&&P._unit();let v=d.x*g.x+d.y*g.y,S=P.x*g.x+P.y*g.y,w=S!==0?1/S:1/0,I=2*Math.sqrt(2-2*S),M=S<Ox&&m&&h,V=d.x*g.y-d.y*g.x>0;if(M&&b>c){let k=y.dist(m);if(k>2*p){let F=y.sub(y.sub(m)._mult(p/k)._round());this.updateDistance(m,F),this.addCurrentVertex(F,d,0,0,f),m=F}}let D=m&&h,C=D?n:s?"butt":i;if(D&&C==="round"&&(w<a?C="miter":w<=2&&(C="fakeround")),C==="miter"&&w>o&&(C="bevel"),C==="bevel"&&(w>2&&(C="flipbevel"),w<o&&(C="miter")),m&&this.updateDistance(m,y),C==="miter")P._mult(w),this.addCurrentVertex(y,P,0,0,f);else if(C==="flipbevel"){if(w>100)P=g.mult(-1);else{let k=w*d.add(g).mag()/d.sub(g).mag();P._perp()._mult(k*(V?-1:1))}this.addCurrentVertex(y,P,0,0,f),this.addCurrentVertex(y,P.mult(-1),0,0,f)}else if(C==="bevel"||C==="fakeround"){let k=-Math.sqrt(w*w-1),F=V?k:0,R=V?0:k;if(m&&this.addCurrentVertex(y,d,F,R,f),C==="fakeround"){let T=Math.round(I*180/Math.PI/Ux);for(let N=1;N<T;N++){let $=N/T;if($!==.5){let ee=$-.5,Pe=1.0904+v*(-3.2452+v*(3.55645-v*1.43519)),Q=.848013+v*(-1.06021+v*.215638);$=$+$*ee*($-1)*(Pe*ee*ee+Q)}let G=g.sub(d)._mult($)._add(d)._unit()._mult(V?-1:1);this.addHalfVertex(y,G.x,G.y,!1,V,0,f)}}h&&this.addCurrentVertex(y,g,-F,-R,f)}else if(C==="butt")this.addCurrentVertex(y,P,0,0,f);else if(C==="square"){let k=m?1:-1;this.addCurrentVertex(y,P,k,k,f)}else C==="round"&&(m&&(this.addCurrentVertex(y,d,0,0,f),this.addCurrentVertex(y,d,1,1,f,!0)),h&&(this.addCurrentVertex(y,g,-1,-1,f,!0),this.addCurrentVertex(y,g,0,0,f)));if(M&&b<l-1){let k=y.dist(h);if(k>2*p){let F=y.add(h.sub(y)._mult(p/k)._round());this.updateDistance(y,F),this.addCurrentVertex(F,g,0,0,f),y=F}}}}addCurrentVertex(e,r,n,i,o,a=!1){let s=r.x+r.y*n,l=r.y-r.x*n,c=-r.x+r.y*i,p=-r.y-r.x*i;this.addHalfVertex(e,s,l,a,!1,n,o),this.addHalfVertex(e,c,p,a,!0,-i,o),this.distance>Op/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,l){let p=(this.lineClips?this.scaledDistance*(Op-1):this.scaledDistance)*Up;if(this.layoutVertexArray.emplaceBack((e<<1)+(o?1:0),(r<<1)+(a?1:0),Math.round(Rp*n)+128,Math.round(Rp*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=l.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,f),l.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()}};E("LineBucket",ar,{omit:["layers","patternFeatures"]});x();var $p,Gx=u(()=>$p=$p||new oe({"line-cap":new O(_.layout_line["line-cap"]),"line-join":new U(_.layout_line["line-join"]),"line-miter-limit":new O(_.layout_line["line-miter-limit"]),"line-round-limit":new O(_.layout_line["line-round-limit"]),"line-sort-key":new U(_.layout_line["line-sort-key"])}),"getLayout"),Gp,qx=u(()=>Gp=Gp||new oe({"line-opacity":new U(_.paint_line["line-opacity"]),"line-color":new U(_.paint_line["line-color"]),"line-translate":new O(_.paint_line["line-translate"]),"line-translate-anchor":new O(_.paint_line["line-translate-anchor"]),"line-width":new U(_.paint_line["line-width"]),"line-gap-width":new U(_.paint_line["line-gap-width"]),"line-offset":new U(_.paint_line["line-offset"]),"line-blur":new U(_.paint_line["line-blur"]),"line-dasharray":new Wt(_.paint_line["line-dasharray"]),"line-pattern":new pt(_.paint_line["line-pattern"]),"line-gradient":new Ht(_.paint_line["line-gradient"])}),"getPaint"),Ws={get paint(){return qx()},get layout(){return Gx()}};var Hs=class extends U{static{u(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=Ae({},r,{zoom:Math.floor(r.zoom)}),super.evaluate(e,r,n,i)}},Qo,ea=class extends ce{static{u(this,"LineStyleLayer")}constructor(e){super(e,Ws),this.gradientVersion=0,Qo||(Qo=new Hs(Ws.paint.properties["line-width"].specification),Qo.useIntegerZoom=!0)}_handleSpecialPaintPropertyUpdate(e){if(e==="line-gradient"){let r=this.gradientExpression();Jt(r)?this.stepInterpolant=r._styleExpression.expression instanceof hr: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"]=Qo.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,e)}createBucket(e){return new ar(e)}queryRadius(e){let r=e,n=qp(er("line-width",this,r),er("line-gap-width",this,r)),i=er("line-offset",this,r);return n/2+Math.abs(i)+Ct(this.paint.get("line-translate"))}queryIntersectsFeature(e,r,n,i,o,a,s){let l=kt(e,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),a.angle,s),c=s/2*qp(this.paint.get("line-width").evaluate(r,n),this.paint.get("line-gap-width").evaluate(r,n)),p=this.paint.get("line-offset").evaluate(r,n);return p&&(i=Nc(i,p*s)),Rc(l,i,c)}isTileClipped(){return!0}};function qp(t,e){return e>0?e+2*t:t}u(qp,"getLineWidth");x();x();x();var jp=te([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),Jp=te([{name:"a_projected_pos",components:3,type:"Float32"}],4),T_=te([{name:"a_fade_opacity",components:1,type:"Uint32"}],4),Zp=te([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}]),C_=te([{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"}]),Xs=te([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),k_=te([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4),M_=te([{name:"triangle",components:3,type:"Uint16"}]),E_=te([{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"}]),F_=te([{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"}]),L_=te([{type:"Float32",name:"offsetX"}]),D_=te([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]),V_=te([{type:"Uint16",name:"textAnchor"},{type:"Float32",components:2,name:"textOffset"}]);var si=X(xe(),1);x();function jx(t,e,r){let n=e.layout.get("text-transform").evaluate(r,{});return n==="uppercase"?t=t.toLocaleUpperCase():n==="lowercase"&&(t=t.toLocaleLowerCase()),de.applyArabicShaping&&(t=de.applyArabicShaping(t)),t}u(jx,"transformTextInternal");function Wp(t,e,r){return t.sections.forEach(n=>{n.text=jx(n.text,e,r)}),t}u(Wp,"transformText");x();function Hp(t){let e={},r={},n=[],i=0;function o(c){n.push(t[c]),i++}u(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}u(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}u(s,"mergeFromLeft");function l(c,p,f){let y=f?p[0][p[0].length-1]:p[0][0];return`${c}:${y.x}:${y.y}`}u(l,"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=l(y,f),h=l(y,f,!0);if(m in r&&h in e&&r[m]!==e[h]){let d=s(m,h,f),g=a(m,h,n[d].geometry);delete e[m],delete r[h],r[l(y,n[g].geometry,!0)]=g,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)}u(Hp,"mergeLines");x();x();var Lr={"!":"\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 Xp(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||!_s(n)||Lr[t[r+1]])&&(!i||!_s(i)||Lr[t[r-1]])&&Lr[t[r]]?e+=Lr[t[r]]:e+=t[r]}return e}u(Xp,"verticalizePunctuation");x();var ae=24;x();var ub=X(ri(),1);var cb=3;var na=cb;x();x();function ni(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,l)=>l.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 l=i.length-1;l>=0;l--){let c=i[l];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();l<i.length&&(i[l]=p)}else s.h===c.h?(c.x+=s.w,c.w-=s.w):s.w===c.w?(c.y+=s.h,c.h-=s.h):(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}}u(ni,"potpack");var ve=1;var ia=class{static{u(this,"ImagePosition")}constructor(e,{pixelRatio:r,version:n,stretchX:i,stretchY:o,content:a}){this.paddedRect=e,this.pixelRatio=r,this.stretchX=i,this.stretchY=o,this.content=a,this.version=n}get tl(){return[this.paddedRect.x+ve,this.paddedRect.y+ve]}get br(){return[this.paddedRect.x+this.paddedRect.w-ve,this.paddedRect.y+this.paddedRect.h-ve]}get tlbr(){return this.tl.concat(this.br)}get displaySize(){return[(this.paddedRect.w-ve*2)/this.pixelRatio,(this.paddedRect.h-ve*2)/this.pixelRatio]}},ii=class{static{u(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}=ni(o),l=new be({width:a||1,height:s||1});for(let c in e){let p=e[c],f=n[c].paddedRect;be.copy(p.data,l,{x:0,y:0},{x:f.x+ve,y:f.y+ve},p.data)}for(let c in r){let p=r[c],f=i[c].paddedRect,y=f.x+ve,m=f.y+ve,h=p.data.width,d=p.data.height;be.copy(p.data,l,{x:0,y:0},{x:y,y:m},p.data),be.copy(p.data,l,{x:0,y:d-1},{x:y,y:m-1},{width:h,height:1}),be.copy(p.data,l,{x:0,y:0},{x:y,y:m+d},{width:h,height:1}),be.copy(p.data,l,{x:h-1,y:0},{x:y-1,y:m},{width:1,height:d}),be.copy(p.data,l,{x:0,y:0},{x:y+h,y:m},{width:1,height:d})}this.image=l,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*ve,h:o.data.height+2*ve};n.push(a),r[i]=new ia(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})}};E("ImagePosition",ia);E("ImageAtlas",ii);var sa=(i=>(i[i.none=0]="none",i[i.horizontal=1]="horizontal",i[i.vertical=2]="vertical",i[i.horizontalOnly=3]="horizontalOnly",i))(sa||{}),Br=-17;function pb(t){for(let e of t)if(e.positionedGlyphs.length!==0)return!1;return!0}u(pb,"isEmpty");var nf=57344,of=63743,oa=class t{static{u(this,"SectionOptions")}constructor(){this.scale=1,this.fontStack="",this.imageName=null}static forText(e,r){let n=new t;return n.scale=e||1,n.fontStack=r,n}static forImage(e){let r=new t;return r.imageName=e,r}},oi=class t{static{u(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=Xp(this.text)}trim(){let e=0;for(let n=0;n<this.text.length&&aa[this.text.charCodeAt(n)];n++)e++;let r=this.text.length;for(let n=this.text.length-1;n>=0&&n>=e&&aa[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)}addTextSection(e,r){this.text+=e.text,this.sections.push(oa.forText(e.scale,e.fontStack||r));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){he("Can't add FormattedSection with an empty image.");return}let n=this.getNextImageSectionCharCode();if(!n){he(`Reached maximum number of images ${of-nf+2}`);return}this.text+=String.fromCharCode(n),this.sections.push(oa.forImage(r)),this.sectionIndex.push(this.sections.length-1)}getNextImageSectionCharCode(){return this.imageSectionID?this.imageSectionID>=of?null:++this.imageSectionID:(this.imageSectionID=nf,this.imageSectionID)}};function fb(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}u(fb,"breakLines");function ai(t,e,r,n,i,o,a,s,l,c,p,f,y,m,h,d){let g=oi.fromFeature(t,i);f===2&&g.verticalizePunctuation();let b,{processBidirectionalText:P,processStyledBidirectionalText:v}=de;if(P&&g.sections.length===1){b=[];let I=P(g.toString(),Qs(g,c,o,e,n,m,h));for(let M of I){let V=new oi;V.text=M,V.sections=g.sections;for(let D=0;D<M.length;D++)V.sectionIndex.push(0);b.push(V)}}else if(v){b=[];let I=v(g.text,g.sectionIndex,Qs(g,c,o,e,n,m,h));for(let M of I){let V=new oi;V.text=M[0],V.sectionIndex=M[1],V.sections=g.sections,b.push(V)}}else b=fb(g,Qs(g,c,o,e,n,m,h));let S=[],w={positionedLines:S,text:g.toString(),top:p[1],bottom:p[1],left:p[0],right:p[0],writingMode:f,iconsInText:!1,verticalizable:!1};return db(w,e,r,n,b,a,s,l,f,c,y,d),pb(S)?!1:w}u(ai,"shapeText");var aa={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},yb={10:!0,32:!0,38:!0,40:!0,41:!0,43:!0,45:!0,47:!0,173:!0,183:!0,8203:!0,8208:!0,8211:!0,8231:!0};function lf(t,e,r,n,i,o){if(e.imageName){let a=n[e.imageName];return a?a.displaySize[0]*e.scale*ae/o+i:0}else{let a=r[e.fontStack],s=a&&a[t];return s?s.metrics.advance*e.scale+i:0}}u(lf,"getGlyphAdvance");function mb(t,e,r,n,i,o){let a=0;for(let l=0;l<t.length();l++){let c=t.getSection(l);a+=lf(t.getCharCode(l),c,n,i,e,o)}let s=Math.max(1,Math.ceil(a/r));return a/s}u(mb,"determineAverageLineWidth");function af(t,e,r,n){let i=Math.pow(t-e,2);return n?t<e?i/2:i*2:i+Math.abs(r)*r}u(af,"calculateBadness");function hb(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}u(hb,"calculatePenalty");function sf(t,e,r,n,i,o){let a=null,s=af(e,r,i,o);for(let l of n){let c=e-l.x,p=af(c,r,i,o)+l.badness;p<=s&&(a=l,s=p)}return{index:t,x:e,priorBreak:a,badness:s}}u(sf,"evaluateBreak");function uf(t){return t?uf(t.priorBreak).concat(t.index):[]}u(uf,"leastBadBreaks");function Qs(t,e,r,n,i,o,a){if(o!=="point")return[];if(!t)return[];let s=[],l=mb(t,e,r,n,i,a),c=t.text.indexOf("\u200B")>=0,p=0;for(let f=0;f<t.length();f++){let y=t.getSection(f),m=t.getCharCode(f);if(aa[m]||(p+=lf(m,y,n,i,e,a)),f<t.length()-1){let h=vc(m);(yb[m]||h||y.imageName)&&s.push(sf(f+1,p,l,s,hb(m,t.getCharCode(f+1),h&&c),!1))}}return uf(sf(t.length(),p,l,s,0,!0))}u(Qs,"determineLineBreaks");function cf(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}}u(cf,"getAnchorAlignment");function db(t,e,r,n,i,o,a,s,l,c,p,f){let y=0,m=Br,h=0,d=0,g=s==="right"?1:s==="left"?0:.5,b=0;for(let w of i){w.trim();let I=w.getMaxScale(),M=(I-1)*ae,V={positionedGlyphs:[],lineOffset:0};t.positionedLines[b]=V;let D=V.positionedGlyphs,C=0;if(!w.length()){m+=o,++b;continue}for(let F=0;F<w.length();F++){let R=w.getSection(F),T=w.getSectionIndex(F),N=w.getCharCode(F),$=0,G=null,ee=null,Pe=null,Q=ae,pe=!(l===1||!p&&!uo(N)||p&&(aa[N]||Pc(N)));if(R.imageName){let ye=n[R.imageName];if(!ye)continue;Pe=R.imageName,t.iconsInText=t.iconsInText||!0,ee=ye.paddedRect;let me=ye.displaySize;R.scale=R.scale*ae/f,G={width:me[0],height:me[1],left:ve,top:-na,advance:pe?me[1]:me[0]};let Ce=ae-me[1]*R.scale;$=M+Ce,Q=G.advance;let Se=pe?me[0]*R.scale-ae*I:me[1]*R.scale-ae*I;Se>0&&Se>C&&(C=Se)}else{let ye=r[R.fontStack],me=ye&&ye[N];if(me&&me.rect)ee=me.rect,G=me.metrics;else{let Ce=e[R.fontStack],Se=Ce&&Ce[N];if(!Se)continue;G=Se.metrics}$=(I-R.scale)*ae}pe?(t.verticalizable=!0,D.push({glyph:N,imageName:Pe,x:y,y:m+$,vertical:pe,scale:R.scale,fontStack:R.fontStack,sectionIndex:T,metrics:G,rect:ee}),y+=Q*R.scale+c):(D.push({glyph:N,imageName:Pe,x:y,y:m+$,vertical:pe,scale:R.scale,fontStack:R.fontStack,sectionIndex:T,metrics:G,rect:ee}),y+=G.advance*R.scale+c)}if(D.length!==0){let F=y-c;h=Math.max(F,h),gb(D,0,D.length-1,g,C)}y=0;let k=o*I+C;V.lineOffset=Math.max(C,M),m+=k,d=Math.max(k,d),++b}let P=m-Br,{horizontalAlign:v,verticalAlign:S}=cf(a);xb(t.positionedLines,g,v,S,h,d,o,P,i.length),t.top+=-S*P,t.bottom=t.top+P,t.left+=-v*h,t.right=t.left+h}u(db,"shapeLines");function gb(t,e,r,n,i){if(!n&&!i)return;let o=t[r],a=o.metrics.advance*o.scale,s=(t[r].x+a)*n;for(let l=e;l<=r;l++)t[l].x-=s,t[l].y+=i}u(gb,"justifyLine");function xb(t,e,r,n,i,o,a,s,l){let c=(e-r)*i,p=0;o!==a?p=-s*n-Br:p=(-n*l+.5)*a;for(let f of t)for(let y of f.positionedGlyphs)y.x+=c,y.y+=p}u(xb,"align");function pf(t,e,r){let{horizontalAlign:n,verticalAlign:i}=cf(r),o=e[0],a=e[1],s=o-t.displaySize[0]*n,l=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:l}}u(pf,"shapeIcon");function el(t,e,r,n,i,o){let a=t.image,s;if(a.content){let g=a.content,b=a.pixelRatio||1;s=[g[0]/b,g[1]/b,a.displaySize[0]-g[2]/b,a.displaySize[1]-g[3]/b]}let l=e.left*o,c=e.right*o,p,f,y,m;r==="width"||r==="both"?(m=i[0]+l-n[3],f=i[0]+c+n[1]):(m=i[0]+(l+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}}u(el,"fitIconToText");var ff=X(Mt(),1);x();var zr=255,Et=128,it=zr*Et;function tl(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],l=n[a];if(r.kind==="composite")return{kind:"composite",minZoom:s,maxZoom:l,interpolationType:i};let c=r.evaluate(new Z(s)),p=r.evaluate(new Z(l));return{kind:"camera",minZoom:s,maxZoom:l,minSize:c,maxSize:p,interpolationType:i}}}u(tl,"getSizeData");x();function rl(t,e,r){let n="never",i=t.get(e);return i?n=i:t.get(r)&&(n="always"),n}u(rl,"getOverlapMode");var bb=ff.default.VectorTileFeature.types,vb=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function la(t,e,r,n,i,o,a,s,l,c,p,f,y){let m=s?Math.min(it,Math.round(s[0])):0,h=s?Math.min(it,Math.round(s[1])):0;t.emplaceBack(e,r,Math.round(n*32),Math.round(i*32),o,a,(m<<1)+(l?1:0),h,c*16,p*16,f*256,y*256)}u(la,"addVertex");function yf(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)}u(yf,"addDynamicAttributes");function Pb(t){for(let e of t.sections)if(wc(e.text))return!0;return!1}u(Pb,"containsRTLText");var li=class{static{u(this,"SymbolBuffers")}constructor(e){this.layoutVertexArray=new Mo,this.indexArray=new Be,this.programConfigurations=e,this.segments=new ge,this.dynamicLayoutVertexArray=new Eo,this.opacityVertexArray=new Fo,this.hasVisibleVertices=!1,this.placedSymbolArray=new Bn}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,jp.members),this.indexBuffer=e.createIndexBuffer(this.indexArray,r),this.dynamicLayoutVertexBuffer=e.createVertexBuffer(this.dynamicLayoutVertexArray,Jp.members,!0),this.opacityVertexBuffer=e.createVertexBuffer(this.opacityVertexArray,vb,!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())}};E("SymbolBuffers",li);var ui=class{static{u(this,"CollisionBuffers")}constructor(e,r,n){this.layoutVertexArray=new e,this.layoutAttributes=r,this.indexArray=new n,this.segments=new ge,this.collisionVertexArray=new Lo}upload(e){this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=e.createVertexBuffer(this.collisionVertexArray,Zp.members,!0)}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy())}};E("CollisionBuffers",ui);var Ye=class{static{u(this,"SymbolBucket")}constructor(e){this.collisionBoxArray=e.collisionBoxArray,this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(l=>l.id),this.index=e.index,this.pixelRatio=e.pixelRatio,this.sourceLayerIndex=e.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=Wn.identity([]),this.placementViewportMatrix=Wn.identity([]);let n=this.layers[0]._unevaluatedLayout._values;this.textSizeData=tl(this.zoom,n["text-size"]),this.iconSizeData=tl(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=rl(i,"text-overlap","text-allow-overlap")!=="never"||rl(i,"icon-overlap","icon-allow-overlap")!=="never"||i.get("text-ignore-placement")||i.get("icon-ignore-placement"),this.sortFeaturesByKey=a!=="viewport-y"&&!o.isConstant();let s=a==="viewport-y"||a==="auto"&&!this.sortFeaturesByKey;this.sortFeaturesByY=s&&this.canOverlap,i.get("symbol-placement")==="point"&&(this.writingModes=i.get("text-writing-mode").map(l=>sa[l])),this.stateDependentLayerIds=this.layers.filter(l=>l.isStateDependent()).map(l=>l.id),this.sourceID=e.sourceID}createArrays(){this.text=new li(new Ee(this.layers,this.zoom,e=>/^text/.test(e))),this.icon=new li(new Ee(this.layers,this.zoom,e=>/^icon/.test(e))),this.glyphOffsetArray=new Rn,this.lineVertexArray=new On,this.symbolInstances=new zn,this.textAnchorOffsets=new Nn}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=Lr[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"),l=o.get("icon-image"),c=(s.value.kind!=="constant"||s.value.value instanceof Ve&&!s.value.value.isEmpty()||s.value.value.toString().length>0)&&(a.value.kind!=="constant"||a.value.value.length>0),p=l.value.kind!=="constant"||!!l.value.value||Object.keys(l.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);for(let{feature:g,id:b,index:P,sourceLayerIndex:v}of e){let S=i._featureFilter.needGeometry,w=je(g,S);if(!i._featureFilter.filter(d,w,n))continue;S||(w.geometry=Fe(g));let I;if(c){let C=i.getValueAndResolveTokens("text-field",w,n,h),k=Ve.factory(C),F=this.hasRTLText=this.hasRTLText||Pb(k);(!F||de.getRTLTextPluginStatus()==="unavailable"||F&&de.isParsed())&&(I=Wp(k,i,w))}let M;if(p){let C=i.getValueAndResolveTokens("icon-image",w,n,h);C instanceof Me?M=C:M=Me.fromString(C)}if(!I&&!M)continue;let V=this.sortFeaturesByKey?f.evaluate(w,{},n):void 0,D={id:b,text:I,icon:M,index:P,sourceLayerIndex:v,geometry:w.geometry,properties:g.properties,type:bb[g.type],sortKey:V};if(this.features.push(D),M&&(y[M.name]=!0),I){let C=a.evaluate(w,{},n).join(","),k=o.get("text-rotation-alignment")!=="viewport"&&o.get("symbol-placement")!=="point";this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(2)>=0;for(let F of I.sections)if(F.image)y[F.image.name]=!0;else{let R=gn(I.toString()),T=F.fontStack||C,N=m[T]=m[T]||{};this.calculateGlyphDependencies(F.text,N,k,this.allowVerticalPlacement,R)}}}o.get("symbol-placement")==="line"&&(this.features=Hp(this.features)),this.sortFeaturesByKey&&this.features.sort((g,b)=>g.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 l=a[s];this.lineVertexArray.emplaceBack(l.x,l.y,l.tileUnitDistanceFromAnchor)}}return{lineStartIndex:n,lineLength:this.lineVertexArray.length-n}}addSymbols(e,r,n,i,o,a,s,l,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),g=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:w,tr:I,bl:M,br:V,tex:D,pixelOffsetTL:C,pixelOffsetBR:k,minFontScaleX:F,minFontScaleY:R,glyphOffset:T,isSDF:N,sectionIndex:$}=r[S],G=d.vertexLength,ee=T[1];la(h,l.x,l.y,w.x,ee+w.y,D.x,D.y,n,N,C.x,C.y,F,R),la(h,l.x,l.y,I.x,ee+I.y,D.x+D.w,D.y,n,N,k.x,C.y,F,R),la(h,l.x,l.y,M.x,ee+M.y,D.x,D.y+D.h,n,N,C.x,k.y,F,R),la(h,l.x,l.y,V.x,ee+V.y,D.x+D.w,D.y+D.h,n,N,k.x,k.y,F,R),yf(e.dynamicLayoutVertexArray,l,P),m.emplaceBack(G,G+1,G+2),m.emplaceBack(G+1,G+2,G+3),d.vertexLength+=4,d.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(T[0]),(S===r.length-1||$!==r[S+1].sectionIndex)&&e.programConfigurations.populatePaintArrays(h.length,a,a.index,{},y,v&&v[$])}e.placedSymbolArray.emplaceBack(l.x,l.y,g,this.glyphOffsetArray.length-g,b,c,p,l.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 l=o.segments.prepareSegment(4,o.layoutVertexArray,o.indexArray),c=l.vertexLength,p=o.layoutVertexArray,f=o.collisionVertexArray,y=s.anchorX,m=s.anchorY;this._addCollisionDebugVertex(p,f,a,y,m,new si.default(e,r)),this._addCollisionDebugVertex(p,f,a,y,m,new si.default(n,r)),this._addCollisionDebugVertex(p,f,a,y,m,new si.default(n,i)),this._addCollisionDebugVertex(p,f,a,y,m,new si.default(e,i)),l.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),l.primitiveLength+=4}addDebugCollisionBoxes(e,r,n,i){for(let o=e;o<r;o++){let a=this.collisionBoxArray.get(o),s=a.x1,l=a.y1,c=a.x2,p=a.y2;this.addCollisionDebugVertices(s,l,c,p,i?this.textCollisionBox:this.iconCollisionBox,a.anchorPoint,n)}}generateCollisionDebugBuffers(){this.hasDebugData()&&this.destroyDebugData(),this.textCollisionBox=new ui($n,Xs.members,It),this.iconCollisionBox=new ui($n,Xs.members,It);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,l,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=l;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+1,o+2),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 l=this.symbolInstances.get(s);i.push(Math.round(r*l.anchorX+n*l.anchorY)|0),o.push(l.featureIndex)}return a.sort((s,l)=>i[s]-i[l]||o[l]-o[s]),a}addToSortKeyRanges(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)}}};E("SymbolBucket",Ye,{omit:["layers","collisionBoxArray","features","compareText"]});Ye.MAX_GLYPHS=65535;Ye.addDynamicAttributes=yf;x();function mf(t,e){return e.replace(/{([^{}]+)}/g,(r,n)=>t&&n in t?String(t[n]):"")}u(mf,"resolveTokens");x();var hf,Sb=u(()=>hf=hf||new oe({"symbol-placement":new O(_.layout_symbol["symbol-placement"]),"symbol-spacing":new O(_.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new O(_.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new U(_.layout_symbol["symbol-sort-key"]),"symbol-z-order":new O(_.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new O(_.layout_symbol["icon-allow-overlap"]),"icon-overlap":new O(_.layout_symbol["icon-overlap"]),"icon-ignore-placement":new O(_.layout_symbol["icon-ignore-placement"]),"icon-optional":new O(_.layout_symbol["icon-optional"]),"icon-rotation-alignment":new O(_.layout_symbol["icon-rotation-alignment"]),"icon-size":new U(_.layout_symbol["icon-size"]),"icon-text-fit":new O(_.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new O(_.layout_symbol["icon-text-fit-padding"]),"icon-image":new U(_.layout_symbol["icon-image"]),"icon-rotate":new U(_.layout_symbol["icon-rotate"]),"icon-padding":new U(_.layout_symbol["icon-padding"]),"icon-keep-upright":new O(_.layout_symbol["icon-keep-upright"]),"icon-offset":new U(_.layout_symbol["icon-offset"]),"icon-anchor":new U(_.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new O(_.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new O(_.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new O(_.layout_symbol["text-rotation-alignment"]),"text-field":new U(_.layout_symbol["text-field"]),"text-font":new U(_.layout_symbol["text-font"]),"text-size":new U(_.layout_symbol["text-size"]),"text-max-width":new U(_.layout_symbol["text-max-width"]),"text-line-height":new O(_.layout_symbol["text-line-height"]),"text-letter-spacing":new U(_.layout_symbol["text-letter-spacing"]),"text-justify":new U(_.layout_symbol["text-justify"]),"text-radial-offset":new U(_.layout_symbol["text-radial-offset"]),"text-variable-anchor":new O(_.layout_symbol["text-variable-anchor"]),"text-variable-anchor-offset":new U(_.layout_symbol["text-variable-anchor-offset"]),"text-anchor":new U(_.layout_symbol["text-anchor"]),"text-max-angle":new O(_.layout_symbol["text-max-angle"]),"text-writing-mode":new O(_.layout_symbol["text-writing-mode"]),"text-rotate":new U(_.layout_symbol["text-rotate"]),"text-padding":new O(_.layout_symbol["text-padding"]),"text-keep-upright":new O(_.layout_symbol["text-keep-upright"]),"text-transform":new U(_.layout_symbol["text-transform"]),"text-offset":new U(_.layout_symbol["text-offset"]),"text-allow-overlap":new O(_.layout_symbol["text-allow-overlap"]),"text-overlap":new O(_.layout_symbol["text-overlap"]),"text-ignore-placement":new O(_.layout_symbol["text-ignore-placement"]),"text-optional":new O(_.layout_symbol["text-optional"])}),"getLayout"),df,wb=u(()=>df=df||new oe({"icon-opacity":new U(_.paint_symbol["icon-opacity"]),"icon-color":new U(_.paint_symbol["icon-color"]),"icon-halo-color":new U(_.paint_symbol["icon-halo-color"]),"icon-halo-width":new U(_.paint_symbol["icon-halo-width"]),"icon-halo-blur":new U(_.paint_symbol["icon-halo-blur"]),"icon-translate":new O(_.paint_symbol["icon-translate"]),"icon-translate-anchor":new O(_.paint_symbol["icon-translate-anchor"]),"text-opacity":new U(_.paint_symbol["text-opacity"]),"text-color":new U(_.paint_symbol["text-color"],{runtimeType:Ue,getOverride:u(t=>t.textColor,"getOverride"),hasOverride:u(t=>!!t.textColor,"hasOverride")}),"text-halo-color":new U(_.paint_symbol["text-halo-color"]),"text-halo-width":new U(_.paint_symbol["text-halo-width"]),"text-halo-blur":new U(_.paint_symbol["text-halo-blur"]),"text-translate":new O(_.paint_symbol["text-translate"]),"text-translate-anchor":new O(_.paint_symbol["text-translate-anchor"])}),"getPaint"),ua={get paint(){return wb()},get layout(){return Sb()}};x();var ci=class{static{u(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:gr,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}};E("FormatSectionOverride",ci,{omit:["defaultValue"]});var ca=class t extends ce{static{u(this,"SymbolStyleLayer")}constructor(e){super(e,ua)}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()&&!Jt(a.value)&&o?mf(r.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 ua.paint.overridableProperties){if(!t.hasPaintOverride(this.layout,e))continue;let r=this.paint.get(e),n=new ci(r),i=new $t(n,r.property.specification),o=null;r.value.kind==="constant"||r.value.kind==="source"?o=new bt("source",i):o=new vt("composite",i,r.value.zoomStops),this.paint._values[e]=new _e(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=ua.paint.properties[r],o=!1,a=u(s=>{for(let l of s)if(i.overrides&&i.overrides.hasOverride(l)){o=!0;return}},"checkSections");if(n.value.kind==="constant"&&n.value.value instanceof Ve)a(n.value.value.sections);else if(n.value.kind==="source"){let s=u(c=>{if(!o)if(c instanceof gt&&fe(c.value)===xr){let p=c.value;a(p.sections)}else c instanceof nn?a(c.sections):c.eachChild(s)},"checkExpression"),l=n.value;l._styleExpression&&s(l._styleExpression.expression)}return o}};function gf(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]}u(gf,"getIconPadding");x();x();var xf,Ab=u(()=>xf=xf||new oe({"background-color":new O(_.paint_background["background-color"]),"background-pattern":new Wt(_.paint_background["background-pattern"]),"background-opacity":new O(_.paint_background["background-opacity"])}),"getPaint"),bf={get paint(){return Ab()}};var pa=class extends ce{static{u(this,"BackgroundStyleLayer")}constructor(e){super(e,bf)}};x();x();var vf,_b=u(()=>vf=vf||new oe({"raster-opacity":new O(_.paint_raster["raster-opacity"]),"raster-hue-rotate":new O(_.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new O(_.paint_raster["raster-brightness-min"]),"raster-brightness-max":new O(_.paint_raster["raster-brightness-max"]),"raster-saturation":new O(_.paint_raster["raster-saturation"]),"raster-contrast":new O(_.paint_raster["raster-contrast"]),"raster-resampling":new O(_.paint_raster["raster-resampling"]),"raster-fade-duration":new O(_.paint_raster["raster-fade-duration"])}),"getPaint"),Pf={get paint(){return _b()}};var fa=class extends ce{static{u(this,"RasterStyleLayer")}constructor(e){super(e,Pf)}};x();var ya=class extends ce{constructor(r){super(r,{});this.onAdd=u(r=>{this.implementation.onAdd&&this.implementation.onAdd(r,r.painter.context.gl)},"onAdd");this.onRemove=u(r=>{this.implementation.onRemove&&this.implementation.onRemove(r,r.painter.context.gl)},"onRemove");this.implementation=r}static{u(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 Sf(t){if(t.type==="custom")return new ya(t);switch(t.type){case"background":return new pa(t);case"circle":return new $o(t);case"fill":return new Ho(t);case"fill-extrusion":return new Yo(t);case"heatmap":return new Go(t);case"hillshade":return new qo(t);case"line":return new ea(t);case"raster":return new fa(t);case"symbol":return new ca(t)}}u(Sf,"createStyleLayer");var ma=class{static{u(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]=Sf(i);o._featureFilter=hn(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=$u(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||"",l=this.familiesBySource[s];l||(l=this.familiesBySource[s]={});let c=a.sourceLayer||"_geojsonTileLayer",p=l[c];p||(p=l[c]=[]),p.push(o)}}};x();var Zf=X(Mt(),1),Wf=X(ri(),1);x();x();x();var Rr=class{static{u(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 _f=X(Mt(),1),If=X(ri(),1);x();var ha=class{static{u(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}};var pi=class{static{u(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 zt(8192,16,0),this.grid3D=new zt(8192,16,0),this.featureIndexArray=new Un,this.promoteId=r}insert(e,r,n,i,o,a){let s=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(n,i,o);let l=a?this.grid3D:this.grid;for(let 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&&l.insert(s,f[0],f[1],f[2],f[3])}}loadVTLayers(){return this.vtLayers||(this.vtLayers=new _f.default.VectorTile(new If.default(this.rawTileData)).layers,this.sourceLayerCoder=new Rr(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=hn(o.filter),l=e.queryGeometry,c=e.queryPadding*a,p=Af(l),f=this.grid.query(p.minX-c,p.minY-c,p.maxX+c,p.maxY+c),y=Af(e.cameraQueryGeometry),m=this.grid3D.query(y.minX-c,y.minY-c,y.maxX+c,y.maxY+c,(g,b,P,v)=>Oc(e.cameraQueryGeometry,g-c,b-c,P+c,v+c));for(let g of m)f.push(g);f.sort(Ib);let h={},d;for(let g=0;g<f.length;g++){let b=f[g];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,w,I)=>(v||(v=Fe(S)),w.queryIntersectsFeature(l,S,I,v,this.z,e.transform,a,e.pixelPosMatrix)))}return h}loadMatchingFeature(e,r,n,i,o,a,s,l,c,p,f){let y=this.bucketLayerIDs[r];if(a&&!Xl(a,y))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 g=this.getId(d,m);for(let b=0;b<y.length;b++){let P=y[b];if(a&&a.indexOf(P)<0)continue;let v=l[P];if(!v)continue;let S={};g&&p&&(S=p.getState(v.sourceLayer||"_geojsonTileLayer",g));let w=Ae({},c[P]);w.paint=wf(w.paint,v.paint,d,S,s),w.layout=wf(w.layout,v.layout,d,S,s);let I=!f||f(d,v,S);if(!I)continue;let M=new ha(d,this.z,this.x,this.y,g);M.layer=w;let V=e[P];V===void 0&&(V=e[P]=[]),V.push({featureIndex:i,feature:M,intersectionZ:I})}}lookupSymbolFeatures(e,r,n,i,o,a,s,l){let c={};this.loadVTLayers();let p=hn(o);for(let f of e)this.loadMatchingFeature(c,n,i,f,p,a,s,l,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))}return n}};E("FeatureIndex",pi,{omit:["rawTileData","sourceLayerCoder"]});function wf(t,e,r,n,i){return Zr(t,(o,a)=>{let s=e instanceof wt?e.get(a):null;return s&&s.evaluate?s.evaluate(r,n,i):s})}u(wf,"evaluateProperties");function Af(t){let e=1/0,r=1/0,n=-1/0,i=-1/0;for(let o of t)e=Math.min(e,o.x),r=Math.min(r,o.y),n=Math.max(n,o.x),i=Math.max(i,o.y);return{minX:e,minY:r,maxX:n,maxY:i}}u(Af,"getBounds");function Ib(t,e){return e-t}u(Ib,"topDownFeatureComparator");x();x();var Tf=X(xe(),1);var ot=class t extends Tf.default{static{u(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)}};E("Anchor",ot);x();x();function nl(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 l=[],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),l.push({distance:s,angleDelta:m}),c+=m;s-l[0].distance>n;)c-=l.shift().angleDelta;if(c>i)return!1;a++,s+=f.dist(y)}return!0}u(nl,"checkMaxAngle");function Cf(t){let e=0;for(let r=0;r<t.length-1;r++)e+=t[r].dist(t[r+1]);return e}u(Cf,"getLineLength");function kf(t,e,r){return t?3/5*e*r:0}u(kf,"getAngleWindowSize");function Mf(t,e){return Math.max(t?t.right-t.left:0,e?e.right-e.left:0)}u(Mf,"getShapedLabelLength");function Ef(t,e,r,n,i,o){let a=kf(r,i,o),s=Mf(r,n)*o,l=0,c=Cf(t)/2;for(let p=0;p<t.length-1;p++){let f=t[p],y=t[p+1],m=f.dist(y);if(l+m>c){let h=(c-l)/m,d=$e.number(f.x,y.x,h),g=$e.number(f.y,y.y,h),b=new ot(d,g,y.angleTo(f),p);return b._round(),!a||nl(t,b,s,a,e)?b:void 0}l+=m}}u(Ef,"getCenterAnchor");function Ff(t,e,r,n,i,o,a,s,l){let c=kf(n,o,a),p=Mf(n,i),f=p*a,y=t[0].x===0||t[0].x===l||t[0].y===0||t[0].y===l;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 Lf(t,h,e,c,r,f,y,!1,l)}u(Ff,"getAnchors");function Lf(t,e,r,n,i,o,a,s,l){let c=o/2,p=Cf(t),f=0,y=e-r,m=[];for(let h=0;h<t.length-1;h++){let d=t[h],g=t[h+1],b=d.dist(g),P=g.angleTo(d);for(;y+r<f+b;){y+=r;let v=(y-f)/b,S=$e.number(d.x,g.x,v),w=$e.number(d.y,g.y,v);if(S>=0&&S<l&&w>=0&&w<l&&y-c>=0&&y+c<=p){let I=new ot(S,w,P,h);I._round(),(!n||nl(t,I,o,n,i))&&m.push(I)}}f+=b}return!s&&!m.length&&!a&&(m=Lf(t,f/2,r,n,i,o,a,!0,l)),m}u(Lf,"resample");x();var mt=X(xe(),1);function Df(t,e,r,n,i){let o=[];for(let a=0;a<t.length;a++){let s=t[a],l;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 mt.default(e,p.y+(f.y-p.y)*((e-p.x)/(f.x-p.x)))._round():f.x<e&&(f=new mt.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 mt.default(p.x+(f.x-p.x)*((r-p.y)/(f.y-p.y)),r)._round():f.y<r&&(f=new mt.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 mt.default(n,p.y+(f.y-p.y)*((n-p.x)/(f.x-p.x)))._round():f.x>=n&&(f=new mt.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 mt.default(p.x+(f.x-p.x)*((i-p.y)/(f.y-p.y)),i)._round():f.y>=i&&(f=new mt.default(p.x+(f.x-p.x)*((i-p.y)/(f.y-p.y)),i)._round()),(!l||!p.equals(l[l.length-1]))&&(l=[p],o.push(l)),l.push(f)))))}}return o}u(Df,"clipLine");x();var Ie=X(xe(),1);var Or=ve;function il(t,e,r,n){let i=[],o=t.image,a=o.pixelRatio,s=o.paddedRect.w-2*Or,l=o.paddedRect.h-2*Or,c=t.right-t.left,p=t.bottom-t.top,f=o.stretchX||[[0,s]],y=o.stretchY||[[0,l]],m=u((k,F)=>k+F[1]-F[0],"reduceRanges"),h=f.reduce(m,0),d=y.reduce(m,0),g=s-h,b=l-d,P=0,v=h,S=0,w=d,I=0,M=g,V=0,D=b;if(o.content&&n){let k=o.content;P=da(f,0,k[0]),S=da(y,0,k[1]),v=da(f,k[0],k[2]),w=da(y,k[1],k[3]),I=k[0]-P,V=k[1]-S,M=k[2]-k[0]-v,D=k[3]-k[1]-w}let C=u((k,F,R,T)=>{let N=ga(k.stretch-P,v,c,t.left),$=xa(k.fixed-I,M,k.stretch,h),G=ga(F.stretch-S,w,p,t.top),ee=xa(F.fixed-V,D,F.stretch,d),Pe=ga(R.stretch-P,v,c,t.left),Q=xa(R.fixed-I,M,R.stretch,h),pe=ga(T.stretch-S,w,p,t.top),ye=xa(T.fixed-V,D,T.stretch,d),me=new Ie.default(N,G),Ce=new Ie.default(Pe,G),Se=new Ie.default(Pe,pe),Ii=new Ie.default(N,pe),Va=new Ie.default($/a,ee/a),Ba=new Ie.default(Q/a,ye/a),Gr=e*Math.PI/180;if(Gr){let ke=Math.sin(Gr),we=Math.cos(Gr),Re=[we,-ke,ke,we];me._matMult(Re),Ce._matMult(Re),Ii._matMult(Re),Se._matMult(Re)}let Ti=k.stretch+k.fixed,Le=R.stretch+R.fixed,Vt=F.stretch+F.fixed,Ci=T.stretch+T.fixed,za={x:o.paddedRect.x+Or+Ti,y:o.paddedRect.y+Or+Vt,w:Le-Ti,h:Ci-Vt},Ra=M/a/c,Oa=D/a/p;return{tl:me,tr:Ce,bl:Ii,br:Se,tex:za,writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:Va,pixelOffsetBR:Ba,minFontScaleX:Ra,minFontScaleY:Oa,isSDF:r}},"makeBox");if(!n||!o.stretchX&&!o.stretchY)i.push(C({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:s+1},{fixed:0,stretch:l+1}));else{let k=Vf(f,g,h),F=Vf(y,b,d);for(let R=0;R<k.length-1;R++){let T=k[R],N=k[R+1];for(let $=0;$<F.length-1;$++){let G=F[$],ee=F[$+1];i.push(C(T,G,N,ee))}}}return i}u(il,"getIconQuads");function da(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}u(da,"sumWithinRange");function Vf(t,e,r){let n=[{fixed:-Or,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+Or,stretch:r}),n}u(Vf,"stretchZonesToCuts");function ga(t,e,r,n){return t/e*r+n}u(ga,"getEmOffset");function xa(t,e,r,n){return t-e*r/n}u(xa,"getPxOffset");function Bf(t,e,r,n,i,o,a,s){let l=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=na+1,d=!0,g=1,b=0,P=(i||s)&&f.vertical,v=f.metrics.advance*f.scale/2;if(s&&e.verticalizable){let Q=(f.scale-1)*ae,pe=(ae-f.metrics.width*f.scale)/2;b=p.lineOffset/2-(f.imageName?-pe:Q)}if(f.imageName){let Q=a[f.imageName];d=Q.sdf,g=Q.pixelRatio,h=ve/g}let S=i?[f.x+v,f.y]:[0,0],w=i?[0,0]:[f.x+v+r[0],f.y+r[1]-b],I=[0,0];P&&(I=w,w=[0,0]);let M=f.metrics.isDoubleResolution?2:1,V=(f.metrics.left-h)*f.scale-v+w[0],D=(-f.metrics.top-h)*f.scale+w[1],C=V+y.w/M*f.scale/g,k=D+y.h/M*f.scale/g,F=new Ie.default(V,D),R=new Ie.default(C,D),T=new Ie.default(V,k),N=new Ie.default(C,k);if(P){let Q=new Ie.default(-v,v-Br),pe=-Math.PI/2,ye=ae/2-v,me=f.imageName?ye:0,Ce=new Ie.default(5-Br-ye,-me),Se=new Ie.default(...I);F._rotateAround(pe,Q)._add(Ce)._add(Se),R._rotateAround(pe,Q)._add(Ce)._add(Se),T._rotateAround(pe,Q)._add(Ce)._add(Se),N._rotateAround(pe,Q)._add(Ce)._add(Se)}if(l){let Q=Math.sin(l),pe=Math.cos(l),ye=[pe,-Q,Q,pe];F._matMult(ye),R._matMult(ye),T._matMult(ye),N._matMult(ye)}let $=new Ie.default(0,0),G=new Ie.default(0,0);c.push({tl:F,tr:R,bl:T,br:N,tex:y,writingMode:e.writingMode,glyphOffset:S,sectionIndex:f.sectionIndex,isSDF:d,pixelOffsetTL:$,pixelOffsetBR:G,minFontScaleX:0,minFontScaleY:0})}return c}u(Bf,"getGlyphQuads");x();var fi=X(xe(),1);var sr=class{static{u(this,"CollisionFeature")}constructor(e,r,n,i,o,a,s,l,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.top*s-l[0],y=a.bottom*s+l[2],m=a.left*s-l[3],h=a.right*s+l[1],d=a.collisionPadding;if(d&&(m-=d[0]*s,f-=d[1]*s,h+=d[2]*s,y+=d[3]*s),p){let g=new fi.default(m,f),b=new fi.default(h,f),P=new fi.default(m,y),v=new fi.default(h,y),S=p*Math.PI/180;g._rotate(S),b._rotate(S),P._rotate(S),v._rotate(S),m=Math.min(g.x,b.x,P.x,v.x),h=Math.max(g.x,b.x,P.x,v.x),f=Math.min(g.y,b.y,P.y,v.y),y=Math.max(g.y,b.y,P.y,v.y)}e.emplaceBack(r.x,r.y,m,f,h,y,n,i,o)}this.boxEndIndex=e.length}};x();x();var yi=class{static{u(this,"TinyQueue")}constructor(e=[],r=Tb){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.length++,this._up(this.length-1)}pop(){if(this.length===0)return;let e=this.data[0],r=this.data.pop();return this.length--,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=r[a],l=a+1;if(l<this.length&&n(r[l],s)<0&&(a=l,s=r[l]),n(s,o)>=0)break;r[e]=s,e=a}r[e]=o}};function Tb(t,e){return t<e?-1:t>e?1:0}u(Tb,"defaultCompare");var ol=X(xe(),1);function zf(t,e=1,r=!1){let n=1/0,i=1/0,o=-1/0,a=-1/0,s=t[0];for(let d=0;d<s.length;d++){let g=s[d];(!d||g.x<n)&&(n=g.x),(!d||g.y<i)&&(i=g.y),(!d||g.x>o)&&(o=g.x),(!d||g.y>a)&&(a=g.y)}let l=o-n,c=a-i,p=Math.min(l,c),f=p/2,y=new yi([],Cb);if(p===0)return new ol.default(n,i);for(let d=n;d<o;d+=p)for(let g=i;g<a;g+=p)y.push(new Nr(d+f,g+f,f,t));let m=Mb(t),h=y.length;for(;y.length;){let d=y.pop();(d.d>m.d||!m.d)&&(m=d,r&&console.log("found best %d after %d probes",Math.round(1e4*d.d)/1e4,h)),!(d.max-m.d<=e)&&(f=d.h/2,y.push(new Nr(d.p.x-f,d.p.y-f,f,t)),y.push(new Nr(d.p.x+f,d.p.y-f,f,t)),y.push(new Nr(d.p.x-f,d.p.y+f,f,t)),y.push(new Nr(d.p.x+f,d.p.y+f,f,t)),h+=4)}return r&&(console.log(`num probes: ${h}`),console.log(`best distance: ${m.d}`)),m.p}u(zf,"findPoleOfInaccessibility");function Cb(t,e){return e.max-t.max}u(Cb,"compareMax");function Nr(t,e,r,n){this.p=new ol.default(t,e),this.h=r,this.d=kb(this.p,n),this.max=this.d+this.h*Math.SQRT2}u(Nr,"Cell");function kb(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,l=s-1;a<s;l=a++){let c=o[a],p=o[l];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,Bs(t,c,p))}}return(r?1:-1)*Math.sqrt(n)}u(kb,"pointToPolygonDist");function Mb(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 l=i[o],c=i[s],p=l.x*c.y-c.x*l.y;r+=(l.x+c.x)*p,n+=(l.y+c.y)*p,e+=p*3}return new Nr(r/e,n/e,0,t)}u(Mb,"getCentroidCell");var ul=X(Ms(),1);x();var al=(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))(al||{}),Ft=7,ba=Number.POSITIVE_INFINITY;function sl(t,e){function r(i,o){let a=0,s=0;o<0&&(o=0);let l=o/Math.SQRT2;switch(i){case"top-right":case"top-left":s=l-Ft;break;case"bottom-right":case"bottom-left":s=-l+Ft;break;case"bottom":s=-o+Ft;break;case"top":s=o-Ft;break}switch(i){case"top-right":case"bottom-right":a=-l;break;case"top-left":case"bottom-left":a=l;break;case"left":a=o;break;case"right":a=-o;break}return[a,s]}u(r,"fromRadialOffset");function n(i,o,a){let s=0,l=0;switch(o=Math.abs(o),a=Math.abs(a),i){case"top-right":case"top-left":case"top":l=a-Ft;break;case"bottom-right":case"bottom-left":case"bottom":l=-a+Ft;break}switch(i){case"top-right":case"bottom-right":case"right":s=-o;break;case"top-left":case"bottom-left":case"left":s=o;break}return[s,l]}return u(n,"fromTextOffset"),e[1]!==ba?n(t,e[0],e[1]):r(t,e[0])}u(sl,"evaluateVariableOffset");function ll(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 l=0;l<a.length;l+=2){let c=s[l]=a[l],p=a[l+1].map(f=>f*ae);c.startsWith("top")?p[1]-=Ft:c.startsWith("bottom")&&(p[1]+=Ft),s[l+1]=p}return new Ge(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)*ae,ba]:a=n.get("text-offset").evaluate(e,{},r).map(c=>c*ae);let l=[];for(let c of o)l.push(c,sl(c,a));return new Ge(l)}return null}u(ll,"getTextVariableAnchorOffset");function Nf(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")*ae,s=n.get("text-rotation-alignment")!=="viewport"&&n.get("symbol-placement")!=="point",l=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},g=p.text,b=[0,0];if(g){let w=g.toString(),I=n.get("text-letter-spacing").evaluate(p,{},t.canonical)*ae,M=bc(w)?I:0,V=n.get("text-anchor").evaluate(p,{},t.canonical),D=ll(r,p,t.canonical);if(!D){let T=n.get("text-radial-offset").evaluate(p,{},t.canonical);T?b=sl(V,[T*ae,ba]):b=n.get("text-offset").evaluate(p,{},t.canonical).map(N=>N*ae)}let C=s?"center":n.get("text-justify").evaluate(p,{},t.canonical),k=n.get("symbol-placement"),F=k==="point"?n.get("text-max-width").evaluate(p,{},t.canonical)*ae:0,R=u(()=>{t.bucket.allowVerticalPlacement&&gn(w)&&(d.vertical=ai(g,t.glyphMap,t.glyphPositions,t.imagePositions,f,F,a,V,"left",M,b,2,!0,k,m,y))},"addVerticalShapingForPointLabelIfNeeded");if(!s&&D){let T=new Set;if(C==="auto")for(let $=0;$<D.values.length;$+=2)T.add(Rf(D.values[$]));else T.add(C);let N=!1;for(let $ of T)if(!d.horizontal[$])if(N)d.horizontal[$]=d.horizontal[0];else{let G=ai(g,t.glyphMap,t.glyphPositions,t.imagePositions,f,F,a,"center",$,M,b,1,!1,k,m,y);G&&(d.horizontal[$]=G,N=G.positionedLines.length===1)}R()}else{C==="auto"&&(C=Rf(V));let T=ai(g,t.glyphMap,t.glyphPositions,t.imagePositions,f,F,a,V,C,M,b,1,!1,k,m,y);T&&(d.horizontal[C]=T),R(),gn(w)&&s&&l&&(d.vertical=ai(g,t.glyphMap,t.glyphPositions,t.imagePositions,f,F,a,V,C,M,b,2,!1,k,m,y))}}let P,v=!1;if(p.icon&&p.icon.name){let w=t.imageMap[p.icon.name];w&&(P=pf(t.imagePositions[p.icon.name],n.get("icon-offset").evaluate(p,{},t.canonical),n.get("icon-anchor").evaluate(p,{},t.canonical)),v=!!w.sdf,t.bucket.sdfIcons===void 0?t.bucket.sdfIcons=v:t.bucket.sdfIcons!==v&&he("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),(w.pixelRatio!==t.bucket.pixelRatio||n.get("icon-rotate").constantOr(1)!==0)&&(t.bucket.iconsNeedLinear=!0))}let S=Uf(d.horizontal)||d.vertical;t.bucket.iconsInText=S?S.iconsInText:!1,(S||P)&&Eb(t.bucket,p,d,P,t.imageMap,o,m,h,b,v,t.canonical)}t.showCollisionBoxes&&t.bucket.generateCollisionDebugBuffers()}u(Nf,"performSymbolLayout");function Rf(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"}u(Rf,"getAnchorJustification");function Eb(t,e,r,n,i,o,a,s,l,c,p){let f=o.textMaxSize.evaluate(e,{});f===void 0&&(f=a);let y=t.layers[0].layout,m=y.get("icon-offset").evaluate(e,{},p),h=Uf(r.horizontal),d=24,g=a/d,b=t.tilePixelRatio*g,P=t.tilePixelRatio*f/d,v=t.tilePixelRatio*s,S=t.tilePixelRatio*y.get("symbol-spacing"),w=y.get("text-padding")*t.tilePixelRatio,I=gf(y,e,p,t.tilePixelRatio),M=y.get("text-max-angle")/180*Math.PI,V=y.get("text-rotation-alignment")!=="viewport"&&y.get("symbol-placement")!=="point",D=y.get("icon-rotation-alignment")==="map"&&y.get("symbol-placement")!=="point",C=y.get("symbol-placement"),k=S/2,F=y.get("icon-text-fit"),R;n&&F!=="none"&&(t.allowVerticalPlacement&&r.vertical&&(R=el(n,r.vertical,F,y.get("icon-text-fit-padding"),m,g)),h&&(n=el(n,h,F,y.get("icon-text-fit-padding"),m,g)));let T=u((N,$)=>{$.x<0||$.x>=8192||$.y<0||$.y>=8192||Lb(t,$,N,r,n,i,R,t.layers[0],t.collisionBoxArray,e.index,e.sourceLayerIndex,t.index,b,[w,w,w,w],V,l,v,I,D,m,e,o,c,p,a)},"addSymbolAtAnchor");if(C==="line")for(let N of Df(e.geometry,0,0,8192,8192)){let $=Ff(N,S,M,r.vertical||h,n,d,P,t.overscaling,8192);for(let G of $){let ee=h;(!ee||!Db(t,ee.text,k,G))&&T(N,G)}}else if(C==="line-center"){for(let N of e.geometry)if(N.length>1){let $=Ef(N,M,r.vertical||h,n,d,P);$&&T(N,$)}}else if(e.type==="Polygon")for(let N of kr(e.geometry,0)){let $=zf(N,16);T(N[0],new ot($.x,$.y,0))}else if(e.type==="LineString")for(let N of e.geometry)T(N,new ot(N[0].x,N[0].y,0));else if(e.type==="Point")for(let N of e.geometry)for(let $ of N)T([$],new ot($.x,$.y,0))}u(Eb,"addFeature");function Fb(t,e){let r=t.length,n=e?.values;if(n?.length>0)for(let i=0;i<n.length;i+=2){let o=al[n[i]],a=n[i+1];t.emplaceBack(o,a[0],a[1])}return[r,t.length]}u(Fb,"addTextVariableAnchorOffsets");function Of(t,e,r,n,i,o,a,s,l,c,p,f,y,m,h){let d=Bf(e,r,s,i,o,a,n,t.allowVerticalPlacement),g=t.textSizeData,b=null;g.kind==="source"?(b=[Et*i.layout.get("text-size").evaluate(a,{})],b[0]>it&&he(`${t.layerIds[0]}: Value for "text-size" is >= ${zr}. Reduce your "text-size".`)):g.kind==="composite"&&(b=[Et*m.compositeTextSizes[0].evaluate(a,{},h),Et*m.compositeTextSizes[1].evaluate(a,{},h)],(b[0]>it||b[1]>it)&&he(`${t.layerIds[0]}: Value for "text-size" is >= ${zr}. Reduce your "text-size".`)),t.addSymbols(t.text,d,b,s,o,a,c,e,l.lineStartIndex,l.lineLength,y,h);for(let P of p)f[P]=t.text.placedSymbolArray.length-1;return d.length*4}u(Of,"addTextVertices");function Uf(t){for(let e in t)return t[e];return null}u(Uf,"getDefaultHorizontalShaping");function Lb(t,e,r,n,i,o,a,s,l,c,p,f,y,m,h,d,g,b,P,v,S,w,I,M,V){let D=t.addToLineVertexArray(e,r),C,k,F,R,T=0,N=0,$=0,G=0,ee=-1,Pe=-1,Q={},pe=(0,ul.default)("");if(t.allowVerticalPlacement&&n.vertical){let we=s.layout.get("text-rotate").evaluate(S,{},M)+90,Re=n.vertical;F=new sr(l,e,c,p,f,Re,y,m,h,we),a&&(R=new sr(l,e,c,p,f,a,g,b,h,we))}if(i){let ke=s.layout.get("icon-rotate").evaluate(S,{}),we=s.layout.get("icon-text-fit")!=="none",Re=il(i,ke,I,we),qr=a?il(a,ke,I,we):void 0;k=new sr(l,e,c,p,f,i,g,b,!1,ke),T=Re.length*4;let Bl=t.iconSizeData,Bt=null;Bl.kind==="source"?(Bt=[Et*s.layout.get("icon-size").evaluate(S,{})],Bt[0]>it&&he(`${t.layerIds[0]}: Value for "icon-size" is >= ${zr}. Reduce your "icon-size".`)):Bl.kind==="composite"&&(Bt=[Et*w.compositeIconSizes[0].evaluate(S,{},M),Et*w.compositeIconSizes[1].evaluate(S,{},M)],(Bt[0]>it||Bt[1]>it)&&he(`${t.layerIds[0]}: Value for "icon-size" is >= ${zr}. Reduce your "icon-size".`)),t.addSymbols(t.icon,Re,Bt,v,P,S,0,e,D.lineStartIndex,D.lineLength,-1,M),ee=t.icon.placedSymbolArray.length-1,qr&&(N=qr.length*4,t.addSymbols(t.icon,qr,Bt,v,P,S,2,e,D.lineStartIndex,D.lineLength,-1,M),Pe=t.icon.placedSymbolArray.length-1)}let ye=Object.keys(n.horizontal);for(let ke of ye){let we=n.horizontal[ke];if(!C){pe=(0,ul.default)(we.text);let qr=s.layout.get("text-rotate").evaluate(S,{},M);C=new sr(l,e,c,p,f,we,y,m,h,qr)}let Re=we.positionedLines.length===1;if($+=Of(t,e,we,o,s,h,S,d,D,n.vertical?1:3,Re?ye:[ke],Q,ee,w,M),Re)break}n.vertical&&(G+=Of(t,e,n.vertical,o,s,h,S,d,D,2,["vertical"],Q,Pe,w,M));let me=C?C.boxStartIndex:t.collisionBoxArray.length,Ce=C?C.boxEndIndex:t.collisionBoxArray.length,Se=F?F.boxStartIndex:t.collisionBoxArray.length,Ii=F?F.boxEndIndex:t.collisionBoxArray.length,Va=k?k.boxStartIndex:t.collisionBoxArray.length,Ba=k?k.boxEndIndex:t.collisionBoxArray.length,Gr=R?R.boxStartIndex:t.collisionBoxArray.length,Ti=R?R.boxEndIndex:t.collisionBoxArray.length,Le=-1,Vt=u((ke,we)=>ke&&ke.circleDiameter?Math.max(ke.circleDiameter,we):we,"getCollisionCircleHeight");Le=Vt(C,Le),Le=Vt(F,Le),Le=Vt(k,Le),Le=Vt(R,Le);let Ci=Le>-1?1:0;Ci&&(Le*=V/ae),t.glyphOffsetArray.length>=Ye.MAX_GLYPHS&&he("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 za=ll(s,S,M),[Ra,Oa]=Fb(t.textAnchorOffsets,za);t.symbolInstances.emplaceBack(e.x,e.y,Q.right>=0?Q.right:-1,Q.center>=0?Q.center:-1,Q.left>=0?Q.left:-1,Q.vertical||-1,ee,Pe,pe,me,Ce,Se,Ii,Va,Ba,Gr,Ti,c,$,G,T,N,Ci,0,y,Le,Ra,Oa)}u(Lb,"addSymbol");function Db(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}u(Db,"anchorIsTooClose");x();var va=1,mi=class{static{u(this,"GlyphAtlas")}constructor(e){let r={},n=[];for(let s in e){let l=e[s],c=r[s]={};for(let p in l){let f=l[+p];if(!f||f.bitmap.width===0||f.bitmap.height===0)continue;let y={x:0,y:0,w:f.bitmap.width+2*va,h:f.bitmap.height+2*va};n.push(y),c[p]={rect:y,metrics:f.metrics}}}let{w:i,h:o}=ni(n),a=new rr({width:i||1,height:o||1});for(let s in e){let l=e[s];for(let c in l){let p=l[+c];if(!p||p.bitmap.width===0||p.bitmap.height===0)continue;let f=r[s][c].rect;rr.copy(p.bitmap,a,{x:0,y:0},{x:f.x+va,y:f.y+va},p.bitmap)}}this.image=a,this.positions=r}};E("GlyphAtlas",mi);x();x();function Gf(t,e,r){e=Math.pow(2,r)-e-1;var n=$f(t*256,e*256,r),i=$f((t+1)*256,(e+1)*256,r);return n[0]+","+n[1]+","+i[0]+","+i[1]}u(Gf,"getTileBBox");function $f(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]}u($f,"getMercCoords");var Jf=X(xe(),1);x();x();var cl=63710088e-1,hi=class t{static{u(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(Zl(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 cl*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 qf=2*Math.PI*cl;function jf(t){return qf*Math.cos(t*Math.PI/180)}u(jf,"circumferenceAtLatitude");function Vb(t){return(180+t)/360}u(Vb,"mercatorXfromLng");function Bb(t){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))/360}u(Bb,"mercatorYfromLat");function zb(t,e){return t/jf(e)}u(zb,"mercatorZfromAltitude");function Rb(t){return t*360-180}u(Rb,"lngFromMercatorX");function pl(t){let e=180-t*360;return 360/Math.PI*Math.atan(Math.exp(e*Math.PI/180))-90}u(pl,"latFromMercatorY");function Ob(t,e){return t*jf(pl(e))}u(Ob,"altitudeFromMercatorZ");function Nb(t){return 1/Math.cos(t*Math.PI/180)}u(Nb,"mercatorScale");var Pa=class t{static{u(this,"MercatorCoordinate")}constructor(e,r,n=0){this.x=+e,this.y=+r,this.z=+n}static fromLngLat(e,r=0){let n=hi.convert(e);return new t(Vb(n.lng),Bb(n.lat),zb(r,n.lat))}toLngLat(){return new hi(Rb(this.x),pl(this.y))}toAltitude(){return Ob(this.z,this.y)}meterInMercatorCoordinateUnits(){return 1/qf*Nb(pl(this.y))}};var Sa=class{static{u(this,"CanonicalTileID")}constructor(e,r,n){if(e<0||e>25||n<0||n>=Math.pow(2,e)||r<0||r>=Math.pow(2,e))throw new Error(`x=${r}, y=${n}, z=${e} outside of bounds. 0<=x<${Math.pow(2,e)}, 0<=y<${Math.pow(2,e)} 0<=z<=25 `);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=Gf(this.x,this.y,this.z),o=Ub(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 Jf.default((e.x*r-this.x)*8192,(e.y*r-this.y)*8192)}toString(){return`${this.z}/${this.x}/${this.y}`}},fl=class{static{u(this,"UnwrappedTileID")}constructor(e,r){this.wrap=e,this.canonical=r,this.key=di(e,r.z,r.z,r.x,r.y)}},gi=class t{static{u(this,"OverscaledTileID")}constructor(e,r,n,i,o){if(e<n)throw new Error(`overscaledZ should be >= z; overscaledZ = ${e}; z = ${n}`);this.overscaledZ=e,this.wrap=r,this.canonical=new Sa(n,+i,+o),this.key=di(r,e,n,i,o)}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 fl(this.wrap,this.canonical)}toString(){return`${this.overscaledZ}/${this.canonical.x}/${this.canonical.y}`}getTilePoint(e){return this.canonical.getTilePoint(new Pa(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)}u(di,"calculateKey");function Ub(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}u(Ub,"getQuadkey");E("CanonicalTileID",Sa);E("OverscaledTileID",gi,{omit:["posMatrix"]});var wa=class{static{u(this,"WorkerTile")}constructor(e){this.tileID=new gi(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=[]}async parse(e,r,n,i){this.status="parsing",this.data=e,this.collisionBoxArray=new Vn;let o=new Rr(Object.keys(e.layers).sort()),a=new pi(this.tileID,this.promoteId);a.bucketLayerIDs=[];let s={},l={featureIndex:a,iconDependencies:{},patternDependencies:{},glyphDependencies:{},availableImages:n},c=r.familiesBySource[this.source];for(let w in c){let I=e.layers[w];if(!I)continue;I.version===1&&he(`Vector tile source "${this.source}" layer "${w}" does not use vector tile spec v2 and therefore may have some rendering errors.`);let M=o.encode(w),V=[];for(let D=0;D<I.length;D++){let C=I.feature(D),k=a.getId(C,w);V.push({feature:C,id:k,index:D,sourceLayerIndex:M})}for(let D of c[w]){let C=D[0];if(C.source!==this.source&&he(`layer.source = ${C.source} does not equal this.source = ${this.source}`),C.minzoom&&this.zoom<Math.floor(C.minzoom)||C.maxzoom&&this.zoom>=C.maxzoom||C.visibility==="none")continue;yl(D,this.zoom,n),(s[C.id]=C.createBucket({index:a.bucketLayerIDs.length,layers:D,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:M,sourceID:this.source})).populate(V,l,this.tileID.canonical),a.bucketLayerIDs.push(D.map(F=>F.id))}}let p=Zr(l.glyphDependencies,w=>Object.keys(w).map(Number));this.inFlightDependencies.forEach(w=>w?.abort()),this.inFlightDependencies=[];let f=Promise.resolve({});if(Object.keys(p).length){let w=new AbortController;this.inFlightDependencies.push(w),f=i.sendAsync({type:"GG",data:{stacks:p,source:this.source,tileID:this.tileID,type:"glyphs"}},w)}let y=Object.keys(l.iconDependencies),m=Promise.resolve({});if(y.length){let w=new AbortController;this.inFlightDependencies.push(w),m=i.sendAsync({type:"GI",data:{icons:y,source:this.source,tileID:this.tileID,type:"icons"}},w)}let h=Object.keys(l.patternDependencies),d=Promise.resolve({});if(h.length){let w=new AbortController;this.inFlightDependencies.push(w),d=i.sendAsync({type:"GI",data:{icons:h,source:this.source,tileID:this.tileID,type:"patterns"}},w)}let[g,b,P]=await Promise.all([f,m,d]),v=new mi(g),S=new ii(b,P);for(let w in s){let I=s[w];I instanceof Ye?(yl(I.layers,this.zoom,n),Nf({bucket:I,glyphMap:g,glyphPositions:v.positions,imageMap:b,imagePositions:S.iconPositions,showCollisionBoxes:this.showCollisionBoxes,canonical:this.tileID.canonical})):I.hasPattern&&(I instanceof ar||I instanceof ir||I instanceof or)&&(yl(I.layers,this.zoom,n),I.addFeatures(l,this.tileID.canonical,S.patternPositions))}return this.status="done",{buckets:Object.values(s).filter(w=>!w.isEmpty()),featureIndex:a,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:v.image,imageAtlas:S,glyphMap:this.returnDependencies?g:null,iconMap:this.returnDependencies?b:null,glyphPositions:this.returnDependencies?v.positions:null}}};function yl(t,e,r){let n=new Z(e);for(let i of t)i.recalculate(n,r)}u(yl,"recalculateLayers");x();var $b=60,rE=1e3/$b;var Ur=class{static{u(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 $r=class{static{u(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 yc(e.request,r);try{return{vectorTile:new Zf.default.VectorTile(new Wf.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.messge}`,new Error(s)}}async loadTile(e){let r=e.uid,n=e&&e.request&&e.request.collectResourceTiming?new Ur(e.request):!1,i=new wa(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,l={};a.expires&&(l.expires=a.expires),a.cacheControl&&(l.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);this.loaded[r]=i,this.fetching[r]={rawTileData:s,cacheControl:l,resourceTiming:c};try{let f=await p;return Ae({rawTileData:s.slice(0)},f,l,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.status==="parsing"){let i=await n.parse(n.vectorTile,this.layerIndex,this.availableImages,this.actor),o;if(this.fetching[r]){let{rawTileData:a,cacheControl:s,resourceTiming:l}=this.fetching[r];delete this.fetching[r],o=Ae({rawTileData:a.slice(0)},i,s,l)}else o=i;return o}if(n.status==="done"&&n.vectorTile)return n.parse(n.vectorTile,this.layerIndex,this.availableImages,this.actor)}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]}};x();x();var xi=class{static{u(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)){he(`"${n}" is not a valid encoding type. Valid types include "mapbox", "terrarium" and "custom".`);return}this.stride=r.height;let l=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<l;c++)this.data[this._idx(-1,c)]=this.data[this._idx(0,c)],this.data[this._idx(l,c)]=this.data[this._idx(l-1,c)],this.data[this._idx(c,-1)]=this.data[this._idx(c,0)],this.data[this._idx(c,l)]=this.data[this._idx(c,l-1)];this.data[this._idx(-1,-1)]=this.data[this._idx(0,0)],this.data[this._idx(l,-1)]=this.data[this._idx(l-1,0)],this.data[this._idx(-1,l)]=this.data[this._idx(0,l-1)],this.data[this._idx(l,l)]=this.data[this._idx(l-1,l-1)],this.min=Number.MAX_SAFE_INTEGER,this.max=Number.MIN_SAFE_INTEGER;for(let c=0;c<l;c++)for(let p=0;p<l;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}getPixels(){return new be({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 l=-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+l,p+c)]}};E("DEMData",xi);var Aa=class{static{u(this,"RasterDEMTileWorkerSource")}constructor(){this.loaded={}}async loadTile(e){let{uid:r,encoding:n,rawImageData:i,redFactor:o,greenFactor:a,blueFactor:s,baseShift:l}=e,c=i.width+2,p=i.height+2,f=Wr(i)?new be({width:c,height:p},await Yl(i,-1,-1,c,p)):i,y=new xi(r,f,n,o,a,s,l);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]}};x();var Py=X(Yf(),1);x();var ml=X(xe(),1),Qf=X(Mt(),1);var Gb=Qf.default.VectorTileFeature.prototype.toGeoJSON,hl=class{static{u(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 ml.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 ml.default(i[0],i[1]));e.push(n)}return e}}toGeoJSON(e,r,n){return Gb.call(this,e,r,n)}},Ia=class{static{u(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 hl(this._features[e])}};var Sy=X(oy(),1);x();x();var ay=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],xl=1,vi=8,Si=class t{static{u(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!==xl)throw new Error(`Got v${i} data when expected v${xl}.`);let o=ay[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=ay.indexOf(this.ArrayType),a=e*2*this.ArrayType.BYTES_PER_ELEMENT,s=e*this.IndexArrayType.BYTES_PER_ELEMENT,l=(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,vi,e),this.coords=new this.ArrayType(this.data,vi+s+l,e*2),this._pos=e*2,this._finished=!0):(this.data=new ArrayBuffer(vi+a+s+l),this.ids=new this.IndexArrayType(this.data,vi,e),this.coords=new this.ArrayType(this.data,vi+s+l,e*2),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,(xl<<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 vl(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,l=[0,o.length-1,0],c=[];for(;l.length;){let p=l.pop()||0,f=l.pop()||0,y=l.pop()||0;if(f-y<=s){for(let g=y;g<=f;g++){let b=a[2*g],P=a[2*g+1];b>=e&&b<=n&&P>=r&&P<=i&&c.push(o[g])}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)&&(l.push(y),l.push(m-1),l.push(1-p)),(p===0?n>=h:i>=d)&&(l.push(m+1),l.push(f),l.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],l=[],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 g=y;g<=f;g++)sy(o[2*g],o[2*g+1],e,r)<=c&&l.push(i[g]);continue}let m=y+f>>1,h=o[2*m],d=o[2*m+1];sy(h,d,e,r)<=c&&l.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 l}};function vl(t,e,r,n,i,o){if(i-n<=r)return;let a=n+i>>1;ly(t,e,a,n,i,o),vl(t,e,r,n,a-1,1-o),vl(t,e,r,a+1,i,1-o)}u(vl,"sort");function ly(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));ly(t,e,r,h,d,o)}let a=e[2*r+o],s=n,l=i;for(Pi(t,e,n,r),e[2*i+o]>a&&Pi(t,e,n,i);s<l;){for(Pi(t,e,s,l),s++,l--;e[2*s+o]<a;)s++;for(;e[2*l+o]>a;)l--}e[2*n+o]===a?Pi(t,e,n,l):(l++,Pi(t,e,l,i)),l<=r&&(n=l+1),r<=l&&(i=l-1)}}u(ly,"select");function Pi(t,e,r,n){bl(t,r,n),bl(e,2*r,2*n),bl(e,2*r+1,2*n+1)}u(Pi,"swapItem");function bl(t,e,r){let n=t[e];t[e]=t[r],t[r]=n}u(bl,"swap");function sy(t,e,r,n){let i=t-r,o=e-n;return i*i+o*o}u(sy,"sqDist");var e0={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:u(t=>t,"map")},uy=Math.fround||(t=>e=>(t[0]=+e,t[0]))(new Float32Array(1)),lr=2,Dt=3,Pl=4,Lt=5,py=6,wi=class{static{u(this,"Supercluster")}constructor(e){this.options=Object.assign(Object.create(e0),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 l=0;l<e.length;l++){let c=e[l];if(!c.geometry)continue;let[p,f]=c.geometry.coordinates,y=uy(Ca(p)),m=uy(ka(f));a.push(y,m,1/0,l,-1,1),this.options.reduce&&a.push(0)}let s=this.trees[i+1]=this._createTree(a);r&&console.timeEnd(o);for(let l=i;l>=n;l--){let c=+Date.now();s=this.trees[l]=this._createTree(this._cluster(s,l)),r&&console.log("z%d: %d clusters in %dms",l,s.numItems,+Date.now()-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)],l=s.range(Ca(n),ka(a),Ca(o),ka(i)),c=s.data,p=[];for(let f of l){let y=this.stride*f;p.push(c[y+Lt]>1?cy(c,y,this.clusterProps):this.points[c[y+Dt]])}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)),l=a[r*this.stride],c=a[r*this.stride+1],p=o.within(l,c,s),f=[];for(let y of p){let m=y*this.stride;a[m+Pl]===e&&f.push(a[m+Lt]>1?cy(a,m,this.clusterProps):this.points[a[m+Dt]])}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,l=s/a,c=(n-l)/o,p=(n+1+l)/o,f={features:[]};return this._addTileFeatures(i.range((r-l)/o,c,(r+1+l)/o,p),i.data,r,n,o,f),r===0&&this._addTileFeatures(i.range(1-l/o,c,1,p),i.data,o,n,o,f),r===o-1&&this._addTileFeatures(i.range(0,c,l/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 l=s.properties;if(l&&l.cluster?o+l.point_count<=i?o+=l.point_count:o=this._appendLeaves(e,l.cluster_id,n,i,o):o<i?o++:e.push(s),e.length===n)break}return o}_createTree(e){let r=new Si(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 l=s*this.stride,c=r[l+Lt]>1,p,f,y;if(c)p=fy(r,l,this.clusterProps),f=r[l],y=r[l+1];else{let d=this.points[r[l+Dt]];p=d.properties;let[g,b]=d.geometry.coordinates;f=Ca(g),y=ka(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[l+Dt]:h=this.points[r[l+Dt]].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)),l=e.data,c=[],p=this.stride;for(let f=0;f<l.length;f+=p){if(l[f+lr]<=r)continue;l[f+lr]=r;let y=l[f],m=l[f+1],h=e.within(l[f],l[f+1],s),d=l[f+Lt],g=d;for(let b of h){let P=b*p;l[P+lr]>r&&(g+=l[P+Lt])}if(g>d&&g>=a){let b=y*d,P=m*d,v,S=-1,w=((f/p|0)<<5)+(r+1)+this.points.length;for(let I of h){let M=I*p;if(l[M+lr]<=r)continue;l[M+lr]=r;let V=l[M+Lt];b+=l[M]*V,P+=l[M+1]*V,l[M+Pl]=w,o&&(v||(v=this._map(l,f,!0),S=this.clusterProps.length,this.clusterProps.push(v)),o(v,this._map(l,M)))}l[f+Pl]=w,c.push(b/g,P/g,1/0,w,-1,g),o&&c.push(S)}else{for(let b=0;b<p;b++)c.push(l[f+b]);if(g>1)for(let b of h){let P=b*p;if(!(l[P+lr]<=r)){l[P+lr]=r;for(let v=0;v<p;v++)c.push(l[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+Lt]>1){let a=this.clusterProps[e[r+py]];return n?Object.assign({},a):a}let i=this.points[e[r+Dt]].properties,o=this.options.map(i);return n&&o===i?Object.assign({},o):o}};function cy(t,e,r){return{type:"Feature",id:t[e+Dt],properties:fy(t,e,r),geometry:{type:"Point",coordinates:[t0(t[e]),r0(t[e+1])]}}}u(cy,"getClusterJSON");function fy(t,e,r){let n=t[e+Lt],i=n>=1e4?`${Math.round(n/1e3)}k`:n>=1e3?`${Math.round(n/100)/10}k`:n,o=t[e+py],a=o===-1?{}:Object.assign({},r[o]);return Object.assign(a,{cluster:!0,cluster_id:t[e+Dt],point_count:n,point_count_abbreviated:i})}u(fy,"getClusterProperties");function Ca(t){return t/360+.5}u(Ca,"lngX");function ka(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}u(ka,"latY");function t0(t){return(t-.5)*360}u(t0,"xLng");function r0(t){let e=(180-t*360)*Math.PI/180;return 360*Math.atan(Math.exp(e))/Math.PI-90}u(r0,"yLat");x();x();x();function Ai(t,e,r,n){for(var i=n,o=r-e>>1,a=r-e,s,l=t[e],c=t[e+1],p=t[r],f=t[r+1],y=e+3;y<r;y+=3){var m=n0(t[y],t[y+1],l,c,p,f);if(m>i)s=y,i=m;else if(m===i){var h=Math.abs(y-o);h<a&&(s=y,a=h)}}i>n&&(s-e>3&&Ai(t,e,s,n),t[s+2]=i,r-s>3&&Ai(t,s,r,n))}u(Ai,"simplify");function n0(t,e,r,n,i,o){var a=i-r,s=o-n;if(a!==0||s!==0){var l=((t-r)*a+(e-n)*s)/(a*a+s*s);l>1?(r=i,n=o):l>0&&(r+=a*l,n+=s*l)}return a=t-r,s=e-n,a*a+s*s}u(n0,"getSqSegDist");x();function ht(t,e,r,n){var i={id:typeof t>"u"?null:t,type:e,geometry:r,tags:n,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return i0(i),i}u(ht,"createFeature");function i0(t){var e=t.geometry,r=t.type;if(r==="Point"||r==="MultiPoint"||r==="LineString")Sl(t,e);else if(r==="Polygon"||r==="MultiLineString")for(var n=0;n<e.length;n++)Sl(t,e[n]);else if(r==="MultiPolygon")for(n=0;n<e.length;n++)for(var i=0;i<e[n].length;i++)Sl(t,e[n][i])}u(i0,"calcBBox");function Sl(t,e){for(var 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])}u(Sl,"calcLineBBox");function _l(t,e){var r=[];if(t.type==="FeatureCollection")for(var n=0;n<t.features.length;n++)Ma(r,t.features[n],e,n);else t.type==="Feature"?Ma(r,t,e):Ma(r,{geometry:t},e);return r}u(_l,"convert");function Ma(t,e,r,n){if(e.geometry){var i=e.geometry.coordinates,o=e.geometry.type,a=Math.pow(r.tolerance/((1<<r.maxZoom)*r.extent),2),s=[],l=e.id;if(r.promoteId?l=e.properties[r.promoteId]:r.generateId&&(l=n||0),o==="Point")yy(i,s);else if(o==="MultiPoint")for(var c=0;c<i.length;c++)yy(i[c],s);else if(o==="LineString")Al(i,s,a,!1);else if(o==="MultiLineString")if(r.lineMetrics){for(c=0;c<i.length;c++)s=[],Al(i[c],s,a,!1),t.push(ht(l,"LineString",s,e.properties));return}else wl(i,s,a,!1);else if(o==="Polygon")wl(i,s,a,!0);else if(o==="MultiPolygon")for(c=0;c<i.length;c++){var p=[];wl(i[c],p,a,!0),s.push(p)}else if(o==="GeometryCollection"){for(c=0;c<e.geometry.geometries.length;c++)Ma(t,{id:l,geometry:e.geometry.geometries[c],properties:e.properties},r,n);return}else throw new Error("Input data is not a valid GeoJSON object.");t.push(ht(l,o,s,e.properties))}}u(Ma,"convertFeature");function yy(t,e){e.push(my(t[0])),e.push(hy(t[1])),e.push(0)}u(yy,"convertPoint");function Al(t,e,r,n){for(var i,o,a=0,s=0;s<t.length;s++){var l=my(t[s][0]),c=hy(t[s][1]);e.push(l),e.push(c),e.push(0),s>0&&(n?a+=(i*c-l*o)/2:a+=Math.sqrt(Math.pow(l-i,2)+Math.pow(c-o,2))),i=l,o=c}var p=e.length-3;e[2]=1,Ai(e,0,p,r),e[p+2]=1,e.size=Math.abs(a),e.start=0,e.end=e.size}u(Al,"convertLine");function wl(t,e,r,n){for(var i=0;i<t.length;i++){var o=[];Al(t[i],o,r,n),e.push(o)}}u(wl,"convertLines");function my(t){return t/360+.5}u(my,"projectX");function hy(t){var 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}u(hy,"projectY");x();function Ze(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;for(var l=[],c=0;c<t.length;c++){var p=t[c],f=p.geometry,y=p.type,m=i===0?p.minX:p.minY,h=i===0?p.maxX:p.maxY;if(m>=r&&h<n){l.push(p);continue}else if(h<r||m>=n)continue;var d=[];if(y==="Point"||y==="MultiPoint")o0(f,d,r,n,i);else if(y==="LineString")gy(f,d,r,n,i,!1,s.lineMetrics);else if(y==="MultiLineString")Il(f,d,r,n,i,!1);else if(y==="Polygon")Il(f,d,r,n,i,!0);else if(y==="MultiPolygon")for(var g=0;g<f.length;g++){var b=[];Il(f[g],b,r,n,i,!0),b.length&&d.push(b)}if(d.length){if(s.lineMetrics&&y==="LineString"){for(g=0;g<d.length;g++)l.push(ht(p.id,y,d[g],p.tags));continue}(y==="LineString"||y==="MultiLineString")&&(d.length===1?(y="LineString",d=d[0]):y="MultiLineString"),(y==="Point"||y==="MultiPoint")&&(y=d.length===3?"Point":"MultiPoint"),l.push(ht(p.id,y,d,p.tags))}}return l.length?l:null}u(Ze,"clip");function o0(t,e,r,n,i){for(var o=0;o<t.length;o+=3){var a=t[o+i];a>=r&&a<=n&&(e.push(t[o]),e.push(t[o+1]),e.push(t[o+2]))}}u(o0,"clipPoints");function gy(t,e,r,n,i,o,a){for(var s=dy(t),l=i===0?a0:s0,c=t.start,p,f,y=0;y<t.length-3;y+=3){var m=t[y],h=t[y+1],d=t[y+2],g=t[y+3],b=t[y+4],P=i===0?m:h,v=i===0?g:b,S=!1;a&&(p=Math.sqrt(Math.pow(m-g,2)+Math.pow(h-b,2))),P<r?v>r&&(f=l(s,m,h,g,b,r),a&&(s.start=c+p*f)):P>n?v<n&&(f=l(s,m,h,g,b,n),a&&(s.start=c+p*f)):Tl(s,m,h,d),v<r&&P>=r&&(f=l(s,m,h,g,b,r),S=!0),v>n&&P<=n&&(f=l(s,m,h,g,b,n),S=!0),!o&&S&&(a&&(s.end=c+p*f),e.push(s),s=dy(t)),a&&(c+=p)}var w=t.length-3;m=t[w],h=t[w+1],d=t[w+2],P=i===0?m:h,P>=r&&P<=n&&Tl(s,m,h,d),w=s.length-3,o&&w>=3&&(s[w]!==s[0]||s[w+1]!==s[1])&&Tl(s,s[0],s[1],s[2]),s.length&&e.push(s)}u(gy,"clipLine");function dy(t){var e=[];return e.size=t.size,e.start=t.start,e.end=t.end,e}u(dy,"newSlice");function Il(t,e,r,n,i,o){for(var a=0;a<t.length;a++)gy(t[a],e,r,n,i,o,!1)}u(Il,"clipLines");function Tl(t,e,r,n){t.push(e),t.push(r),t.push(n)}u(Tl,"addPoint");function a0(t,e,r,n,i,o){var a=(o-e)/(n-e);return t.push(o),t.push(r+(i-r)*a),t.push(1),a}u(a0,"intersectX");function s0(t,e,r,n,i,o){var a=(o-r)/(i-r);return t.push(e+(n-e)*a),t.push(o),t.push(1),a}u(s0,"intersectY");x();function kl(t,e){var r=e.buffer/e.extent,n=t,i=Ze(t,1,-1-r,r,0,-1,2,e),o=Ze(t,1,1-r,2+r,0,-1,2,e);return(i||o)&&(n=Ze(t,1,-r,1+r,0,-1,2,e)||[],i&&(n=xy(i,1).concat(n)),o&&(n=n.concat(xy(o,-1)))),n}u(kl,"wrap");function xy(t,e){for(var r=[],n=0;n<t.length;n++){var i=t[n],o=i.type,a;if(o==="Point"||o==="MultiPoint"||o==="LineString")a=Cl(i.geometry,e);else if(o==="MultiLineString"||o==="Polygon"){a=[];for(var s=0;s<i.geometry.length;s++)a.push(Cl(i.geometry[s],e))}else if(o==="MultiPolygon")for(a=[],s=0;s<i.geometry.length;s++){for(var l=[],c=0;c<i.geometry[s].length;c++)l.push(Cl(i.geometry[s][c],e));a.push(l)}r.push(ht(i.id,o,a,i.tags))}return r}u(xy,"shiftFeatureCoords");function Cl(t,e){var r=[];r.size=t.size,t.start!==void 0&&(r.start=t.start,r.end=t.end);for(var n=0;n<t.length;n+=3)r.push(t[n]+e,t[n+1],t[n+2]);return r}u(Cl,"shiftCoords");x();function Ea(t,e){if(t.transformed)return t;var r=1<<t.z,n=t.x,i=t.y,o,a,s;for(o=0;o<t.features.length;o++){var l=t.features[o],c=l.geometry,p=l.type;if(l.geometry=[],p===1)for(a=0;a<c.length;a+=2)l.geometry.push(by(c[a],c[a+1],e,r,n,i));else for(a=0;a<c.length;a++){var f=[];for(s=0;s<c[a].length;s+=2)f.push(by(c[a][s],c[a][s+1],e,r,n,i));l.geometry.push(f)}}return t.transformed=!0,t}u(Ea,"transformTile");function by(t,e,r,n,i,o){return[Math.round(r*(t*n-i)),Math.round(r*(e*n-o))]}u(by,"transformPoint");x();function El(t,e,r,n,i){for(var o=e===i.maxZoom?0:i.tolerance/((1<<e)*i.extent),a={features:[],numPoints:0,numSimplified:0,numFeatures:0,source:null,x:r,y:n,z:e,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0},s=0;s<t.length;s++){a.numFeatures++,l0(a,t[s],o,i);var l=t[s].minX,c=t[s].minY,p=t[s].maxX,f=t[s].maxY;l<a.minX&&(a.minX=l),c<a.minY&&(a.minY=c),p>a.maxX&&(a.maxX=p),f>a.maxY&&(a.maxY=f)}return a}u(El,"createTile");function l0(t,e,r,n){var i=e.geometry,o=e.type,a=[];if(o==="Point"||o==="MultiPoint")for(var s=0;s<i.length;s+=3)a.push(i[s]),a.push(i[s+1]),t.numPoints++,t.numSimplified++;else if(o==="LineString")Ml(a,i,t,r,!1,!1);else if(o==="MultiLineString"||o==="Polygon")for(s=0;s<i.length;s++)Ml(a,i[s],t,r,o==="Polygon",s===0);else if(o==="MultiPolygon")for(var l=0;l<i.length;l++){var c=i[l];for(s=0;s<c.length;s++)Ml(a,c[s],t,r,!0,s===0)}if(a.length){var p=e.tags||null;if(o==="LineString"&&n.lineMetrics){p={};for(var f in e.tags)p[f]=e.tags[f];p.mapbox_clip_start=i.start/i.size,p.mapbox_clip_end=i.end/i.size}var y={geometry:a,type:o==="Polygon"||o==="MultiPolygon"?3:o==="LineString"||o==="MultiLineString"?2:1,tags:p};e.id!==null&&(y.id=e.id),t.features.push(y)}}u(l0,"addFeature");function Ml(t,e,r,n,i,o){var a=n*n;if(n>0&&e.size<(i?a:n)){r.numPoints+=e.length/3;return}for(var s=[],l=0;l<e.length;l+=3)(n===0||e[l+2]>a)&&(r.numSimplified++,s.push(e[l]),s.push(e[l+1])),r.numPoints++;i&&u0(s,o),t.push(s)}u(Ml,"addLine");function u0(t,e){for(var r=0,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(n=0,i=t.length;n<i/2;n+=2){var a=t[n],s=t[n+1];t[n]=t[i-2-n],t[n+1]=t[i-1-n],t[i-2-n]=a,t[i-1-n]=s}}u(u0,"rewind");function Ll(t,e){return new Fa(t,e)}u(Ll,"geojsonvt");function Fa(t,e){e=this.options=c0(Object.create(this.options),e);var r=e.debug;if(r&&console.time("preprocess data"),e.maxZoom<0||e.maxZoom>24)throw new Error("maxZoom should be in the 0-24 range");if(e.promoteId&&e.generateId)throw new Error("promoteId and generateId cannot be used together.");var n=_l(t,e);this.tiles={},this.tileCoords=[],r&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",e.indexMaxZoom,e.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),n=kl(n,e),n.length&&this.splitTile(n,0,0,0),r&&(n.length&&console.log("features: %d, points: %d",this.tiles[0].numFeatures,this.tiles[0].numPoints),console.timeEnd("generate tiles"),console.log("tiles generated:",this.total,JSON.stringify(this.stats)))}u(Fa,"GeoJSONVT");Fa.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0};Fa.prototype.splitTile=function(t,e,r,n,i,o,a){for(var s=[t,e,r,n],l=this.options,c=l.debug;s.length;){n=s.pop(),r=s.pop(),e=s.pop(),t=s.pop();var p=1<<e,f=Fl(e,r,n),y=this.tiles[f];if(!y&&(c>1&&console.time("creation"),y=this.tiles[f]=El(t,e,r,n,l),this.tileCoords.push({z:e,x:r,y:n}),c)){c>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",e,r,n,y.numFeatures,y.numPoints,y.numSimplified),console.timeEnd("creation"));var m="z"+e;this.stats[m]=(this.stats[m]||0)+1,this.total++}if(y.source=t,i){if(e===l.maxZoom||e===i)continue;var h=1<<i-e;if(r!==Math.floor(o/h)||n!==Math.floor(a/h))continue}else if(e===l.indexMaxZoom||y.numPoints<=l.indexMaxPoints)continue;if(y.source=null,t.length!==0){c>1&&console.time("clipping");var d=.5*l.buffer/l.extent,g=.5-d,b=.5+d,P=1+d,v,S,w,I,M,V;v=S=w=I=null,M=Ze(t,p,r-d,r+b,0,y.minX,y.maxX,l),V=Ze(t,p,r+g,r+P,0,y.minX,y.maxX,l),t=null,M&&(v=Ze(M,p,n-d,n+b,1,y.minY,y.maxY,l),S=Ze(M,p,n+g,n+P,1,y.minY,y.maxY,l),M=null),V&&(w=Ze(V,p,n-d,n+b,1,y.minY,y.maxY,l),I=Ze(V,p,n+g,n+P,1,y.minY,y.maxY,l),V=null),c>1&&console.timeEnd("clipping"),s.push(v||[],e+1,r*2,n*2),s.push(S||[],e+1,r*2,n*2+1),s.push(w||[],e+1,r*2+1,n*2),s.push(I||[],e+1,r*2+1,n*2+1)}}};Fa.prototype.getTile=function(t,e,r){var n=this.options,i=n.extent,o=n.debug;if(t<0||t>24)return null;var a=1<<t;e=(e%a+a)%a;var s=Fl(t,e,r);if(this.tiles[s])return Ea(this.tiles[s],i);o>1&&console.log("drilling down to z%d-%d-%d",t,e,r);for(var l=t,c=e,p=r,f;!f&&l>0;)l--,c=Math.floor(c/2),p=Math.floor(p/2),f=this.tiles[Fl(l,c,p)];return!f||!f.source?null:(o>1&&console.log("found parent tile z%d-%d-%d",l,c,p),o>1&&console.time("drilling down"),this.splitTile(f.source,l,c,p,t,e,r),o>1&&console.timeEnd("drilling down"),this.tiles[s]?Ea(this.tiles[s],i):null)};function Fl(t,e,r){return((1<<t)*r+e)*32+t}u(Fl,"toID");function c0(t,e){for(var r in e)t[r]=e[r];return t}u(c0,"extend");x();function _i(t,e){return e?t.properties[e]:t.id}u(_i,"getFeatureId");function Dl(t,e){if(t==null)return!0;if(t.type==="Feature")return _i(t,e)!=null;if(t.type==="FeatureCollection"){let r=new Set;for(let n of t.features){let i=_i(n,e);if(i==null||r.has(i))return!1;r.add(i)}return!0}return!1}u(Dl,"isUpdateableGeoJSON");function Vl(t,e){let r=new Map;if(t!=null)if(t.type==="Feature")r.set(_i(t,e),t);else for(let n of t.features)r.set(_i(n,e),n);return r}u(Vl,"toUpdateable");function vy(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=_i(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:l}of n.addOrUpdateProperties)i.properties[s]=l}}u(vy,"applySourceDiff");var La=class extends $r{constructor(){super(...arguments);this._dataUpdateable=new Map}static{u(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 Ia(o.features),s=(0,Sy.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 Ur(r.request):!1;this._pendingRequest=new AbortController;try{let i=await this.loadGeoJSON(r,this._pendingRequest);if(delete this._pendingRequest,typeof i!="object")throw new Error(`Input data given to '${r.source}' is not a valid GeoJSON object.`);if((0,Py.default)(i,!0),r.filter){let a=Zt(r.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if(a.result==="error")throw new Error(a.value.map(l=>`${l.key}: ${l.message}`).join(", "));i={type:"FeatureCollection",features:i.features.filter(l=>a.value.evaluate({zoom:0},l))}}this._geoJSONIndex=r.cluster?new wi(p0(r)).load(i.features):Ll(i,r.geojsonVtOptions),this.loaded={};let o={};if(n){let a=n.finish();a&&(o.resourceTiming={},o.resourceTiming[r.source]=JSON.parse(JSON.stringify(a)))}return o}catch(i){if(delete this._pendingRequest,ic(i))return{abandoned:!0};throw i}}reloadTile(r){let n=this.loaded,i=r.uid;return n&&n[i]?super.reloadTile(r):this.loadTile(r)}async loadGeoJSON(r,n){let{promoteId:i}=r;if(r.request){let o=await fc(r.request,n);return this._dataUpdateable=Dl(o.data,i)?Vl(o.data,i):void 0,o.data}if(typeof r.data=="string")try{let o=JSON.parse(r.data);return this._dataUpdateable=Dl(o,i)?Vl(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 vy(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 p0({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[l,c]=e[s],p=Zt(c),f=Zt(typeof l=="string"?[l,["accumulated"],["get",s]]:l);r[s]=p.value,n[s]=f.value}return t.map=s=>{o.properties=s;let l={};for(let c of a)l[c]=r[c].evaluate(i,o);return l},t.reduce=(s,l)=>{o.properties=l;for(let c of a)i.accumulated=s[c],s[c]=n[c].evaluate(i,o)},t}u(p0,"getSuperclusterOptions");var Da=class{static{u(this,"Worker")}constructor(e){this.self=e,this.actor=new oo(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=ac,this.self.removeProtocol=sc,this.self.registerRTLTextPlugin=r=>{if(de.isParsed())throw new Error("RTL text plugin already registered.");de.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("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){if(de.isParsed())return de.getState();if(r.pluginStatus!=="loading")return de.setState(r),r;let n=r.pluginURL;if(this.self.importScripts(n),de.isParsed()){let o={pluginStatus:"loaded",pluginURL:n};return de.setState(o),o}throw de.setState({pluginStatus:"error",pluginURL:""}),new Error(`RTL Text Plugin failed to import scripts from ${n}`)}_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 ma),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:u((o,a)=>(o.targetMapId=e,this.actor.sendAsync(o,a)),"sendAsync")};switch(r){case"vector":this.workerSources[e][r][n]=new $r(i,this._getLayerIndex(e),this._getAvailableImages(e));break;case"geojson":this.workerSources[e][r][n]=new La(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 Aa),this.demWorkerSources[e][r]}};ut(self)&&(self.worker=new Da(self));})();
|