@mappedin/mappedin-js 6.0.1-beta.43 → 6.0.1-beta.45
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 +74 -0
- package/THIRD_PARTY_LICENSES.txt +4194 -989
- package/lib/esm/{GLTFExporter-6UJSTWST.js → GLTFExporter-33O74ZRA.js} +1 -1
- package/lib/esm/{GLTFLoader-VHKTUT76.js → GLTFLoader-TFEUICFY.js} +1 -1
- package/lib/esm/{browser-JUQDIV75.js → browser-IE62BVYL.js} +1 -1
- package/lib/esm/{chunk-NCE64JTI.js → chunk-7QYC6UYU.js} +1 -1
- package/lib/esm/chunk-AGPZKMLJ.js +1 -0
- package/lib/esm/chunk-HTXG2WUL.js +1 -0
- package/lib/esm/{chunk-MEAXYDH5.js → chunk-L5IJY45Y.js} +1 -1
- package/lib/esm/{chunk-4O5ABVXW.js → chunk-N5U7Y27D.js} +1 -1
- package/lib/esm/{chunk-6XEFZ77W.js → chunk-O57EU3PO.js} +1 -1
- package/lib/esm/index.css +1 -1
- package/lib/esm/index.d.ts +1967 -732
- package/lib/esm/index.js +1 -1
- package/lib/esm/{inspector-WHX467BE.js → inspector-CC3UZQDZ.js} +1 -1
- package/lib/esm/inspector-GOK26VAV.css +1 -0
- package/lib/esm/internal-7A3UJNAV.css +1 -0
- package/lib/esm/{internal-CKIQLSVC.js → internal-MEGLEQC5.js} +1 -1
- package/lib/esm/{outdoor-context-v4-7JNIM35B.js → outdoor-context-v4-5DHMHSDP.js} +1 -1
- package/lib/esm/text3d-3PC3DCSJ.js +1 -0
- package/lib/esm/workers/collision-worker.csp.js +1 -0
- package/lib/esm/workers/maplibre-worker.csp.js +1 -0
- package/lib/index.css +1 -1
- package/package.json +2 -2
- package/lib/esm/chunk-7MMSKILE.js +0 -1
- package/lib/esm/chunk-G2WDUYHG.js +0 -1
- package/lib/esm/inspector-D2RCHDOY.css +0 -1
- package/lib/esm/internal-55777EMI.css +0 -1
- package/lib/esm/text3d-Q7FFP3YS.css +0 -1
- package/lib/esm/text3d-TIW6FORE.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(()=>{var Od=Object.create;var Ji=Object.defineProperty;var Nd=Object.getOwnPropertyDescriptor;var Ud=Object.getOwnPropertyNames;var $d=Object.getPrototypeOf,Gd=Object.prototype.hasOwnProperty;var u=(t,e)=>Ji(t,"name",{value:e,configurable:!0});var qd=(t,e)=>()=>(t&&(e=t(t=0)),e);var Te=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),ef=(t,e)=>{for(var r in e)Ji(t,r,{get:e[r],enumerable:!0})},jd=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Ud(e))!Gd.call(t,i)&&i!==r&&Ji(t,i,{get:()=>e[i],enumerable:!(n=Nd(e,i))||n.enumerable});return t};var X=(t,e,r)=>(r=t!=null?Od($d(t)):{},jd(e||!t||!t.__esModule?Ji(r,"default",{value:t,enumerable:!0}):r,t));var x=qd(()=>{});var xe=Te((EP,tf)=>{"use strict";x();tf.exports=fr;function fr(t,e){this.x=t,this.y=e}u(fr,"Point");fr.prototype={clone:u(function(){return new fr(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")};fr.convert=function(t){return t instanceof fr?t:Array.isArray(t)?new fr(t[0],t[1]):t}});var of=Te((DP,nf)=>{"use strict";x();nf.exports=rf;function rf(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(rf,"UnitBezier");rf.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 jy=Te((y2,Wu)=>{x();function Cb(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(Cb,"murmurhash3_32_gc");typeof Wu<"u"&&(Wu.exports=Cb)});var Jy=Te((d2,Hu)=>{x();function kb(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(kb,"murmurhash2_32_gc");typeof Hu!==void 0&&(Hu.exports=kb)});var Xu=Te((b2,ga)=>{x();var Zy=jy(),Mb=Jy();ga.exports=Zy;ga.exports.murmur3=Zy;ga.exports.murmur2=Mb});var _c=Te((rI,Ac)=>{"use strict";x();Ac.exports=La;Ac.exports.default=La;function La(t,e,r){r=r||2;var n=e&&e.length,i=n?e[0]*r:t.length,o=Lm(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=dv(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 ci(o,a,r,s,l,m,0),a}u(La,"earcut");function Lm(t,e,r,n,i){var o,a;if(i===wc(t,e,r,n)>0)for(o=e;o<r;o+=n)a=Fm(o,t[o],t[o+1],a);else for(o=r-n;o>=e;o-=n)a=Fm(o,t[o],t[o+1],a);return a&&Da(a,a.next)&&(fi(a),a=a.next),a}u(Lm,"linkedList");function or(t,e){if(!t)return t;e||(e=t);var r=t,n;do if(n=!1,!r.steiner&&(Da(r,r.next)||le(r.prev,r,r.next)===0)){if(fi(r),r=e=r.prev,r===r.next)break;n=!0}else r=r.next;while(n||r!==e);return e}u(or,"filterPoints");function ci(t,e,r,n,i,o,a){if(t){!a&&o&&Pv(t,n,i,o);for(var s=t,l,c;t.prev!==t.next;){if(l=t.prev,c=t.next,o?yv(t,n,i,o):fv(t)){e.push(l.i/r|0),e.push(t.i/r|0),e.push(c.i/r|0),fi(t),t=c.next,s=c.next;continue}if(t=c,t===s){a?a===1?(t=mv(or(t),e,r),ci(t,e,r,n,i,o,2)):a===2&&hv(t,e,r,n,i,o):ci(or(t),e,r,n,i,o,1);break}}}}u(ci,"earcutLinked");function fv(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&&Vr(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(fv,"isEar");function yv(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=Pc(m,h,e,r,n),P=Pc(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&&Vr(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&&Vr(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&&Vr(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&&Vr(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(yv,"isEarHashed");function mv(t,e,r){var n=t;do{var i=n.prev,o=n.next.next;!Da(i,o)&&Dm(i,n,n.next,o)&&pi(i,o)&&pi(o,i)&&(e.push(i.i/r|0),e.push(n.i/r|0),e.push(o.i/r|0),fi(n),fi(n.next),n=t=o),n=n.next}while(n!==t);return or(n)}u(mv,"cureLocalIntersections");function hv(t,e,r,n,i,o){var a=t;do{for(var s=a.next.next;s!==a.prev;){if(a.i!==s.i&&Av(a,s)){var l=Vm(a,s);a=or(a,a.next),l=or(l,l.next),ci(a,e,r,n,i,o,0),ci(l,e,r,n,i,o,0);return}s=s.next}a=a.next}while(a!==t)}u(hv,"splitEarcut");function dv(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=Lm(t,s,l,n,!1),c===c.next&&(c.steiner=!0),i.push(wv(c));for(i.sort(gv),o=0;o<i.length;o++)r=xv(i[o],r);return r}u(dv,"eliminateHoles");function gv(t,e){return t.x-e.x}u(gv,"compareX");function xv(t,e){var r=bv(t,e);if(!r)return e;var n=Vm(r,t);return or(n,n.next),or(r,r.next)}u(xv,"eliminateHole");function bv(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&&Vr(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),pi(r,t)&&(y<f||y===f&&(r.x>a.x||r.x===a.x&&vv(a,r)))&&(a=r,f=y)),r=r.next;while(r!==l);return a}u(bv,"findHoleBridge");function vv(t,e){return le(t.prev,t,e.prev)<0&&le(e.next,t,t.next)<0}u(vv,"sectorContainsSector");function Pv(t,e,r,n){var i=t;do i.z===0&&(i.z=Pc(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,Sv(i)}u(Pv,"indexCurve");function Sv(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(Sv,"sortLinked");function Pc(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(Pc,"zOrder");function wv(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(wv,"getLeftmost");function Vr(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(Vr,"pointInTriangle");function Av(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!_v(t,e)&&(pi(t,e)&&pi(e,t)&&Iv(t,e)&&(le(t.prev,t,e.prev)||le(t,e.prev,e))||Da(t,e)&&le(t.prev,t,t.next)>0&&le(e.prev,e,e.next)>0)}u(Av,"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 Da(t,e){return t.x===e.x&&t.y===e.y}u(Da,"equals");function Dm(t,e,r,n){var i=Fa(le(t,e,r)),o=Fa(le(t,e,n)),a=Fa(le(r,n,t)),s=Fa(le(r,n,e));return!!(i!==o&&a!==s||i===0&&Ea(t,r,e)||o===0&&Ea(t,n,e)||a===0&&Ea(r,t,n)||s===0&&Ea(r,e,n))}u(Dm,"intersects");function Ea(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(Ea,"onSegment");function Fa(t){return t>0?1:t<0?-1:0}u(Fa,"sign");function _v(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&&Dm(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}u(_v,"intersectsPolygon");function pi(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(pi,"locallyInside");function Iv(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(Iv,"middleInside");function Vm(t,e){var r=new Sc(t.i,t.x,t.y),n=new Sc(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(Vm,"splitPolygon");function Fm(t,e,r,n){var i=new Sc(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(Fm,"insertNode");function fi(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(fi,"removeNode");function Sc(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(Sc,"Node");La.deviation=function(t,e,r,n){var i=e&&e.length,o=i?e[0]*r:t.length,a=Math.abs(wc(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(wc(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 wc(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(wc,"signedArea");La.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 kc=Te((eT,Gm)=>{"use strict";x();var Lv=xe();Gm.exports=Or;function Or(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(Dv,this,e)}u(Or,"VectorTileFeature");function Dv(t,e,r){t==1?e.id=r.readVarint():t==2?Vv(r,e):t==3?e.type=r.readVarint():t==4&&(e._geometry=r.pos)}u(Dv,"readFeature");function Vv(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(Vv,"readTag");Or.types=["Unknown","Point","LineString","Polygon"];Or.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 Lv(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};Or.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]};Or.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=Or.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=Bv(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 Bv(t){var e=t.length;if(e<=1)return[t];for(var r=[],n,i,o=0;o<e;o++){var a=zv(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(Bv,"classifyRings");function zv(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(zv,"signedArea")});var Mc=Te((nT,jm)=>{"use strict";x();var Rv=kc();jm.exports=qm;function qm(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(Ov,this,e),this.length=this._features.length}u(qm,"VectorTileLayer");function Ov(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(Nv(r))}u(Ov,"readLayer");function Nv(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(Nv,"readValueMessage");qm.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 Rv(this._pbf,e,this.extent,this._keys,this._values)}});var Zm=Te((aT,Jm)=>{"use strict";x();var Uv=Mc();Jm.exports=$v;function $v(t,e){this.layers=t.readFields(Gv,{},e)}u($v,"VectorTile");function Gv(t,e,r){if(t===3){var n=new Uv(r,r.readVarint()+r.pos);n.length&&(e[n.name]=n)}}u(Gv,"readTile")});var Et=Te((uT,Ba)=>{x();Ba.exports.VectorTile=Zm();Ba.exports.VectorTileFeature=kc();Ba.exports.VectorTileLayer=Mc()});var mh=Te(Nc=>{x();Nc.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)};Nc.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 di=Te((hk,bh)=>{"use strict";x();bh.exports=H;var Ua=mh();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 Uc=65536*65536,hh=1/Uc,l1=12,xh=typeof TextDecoder>"u"?null:new TextDecoder("utf8");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=$a(this.buf,this.pos);return this.pos+=4,t},"readFixed32"),readSFixed32:u(function(){var t=gh(this.buf,this.pos);return this.pos+=4,t},"readSFixed32"),readFixed64:u(function(){var t=$a(this.buf,this.pos)+$a(this.buf,this.pos+4)*Uc;return this.pos+=8,t},"readFixed64"),readSFixed64:u(function(){var t=$a(this.buf,this.pos)+gh(this.buf,this.pos+4)*Uc;return this.pos+=8,t},"readSFixed64"),readFloat:u(function(){var t=Ua.read(this.buf,this.pos,!0,23,4);return this.pos+=4,t},"readFloat"),readDouble:u(function(){var t=Ua.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,u1(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>=l1&&xh?w1(this.buf,e,t):S1(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=mt(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=mt(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=mt(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=mt(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=mt(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=mt(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=mt(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=mt(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=mt(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),$r(this.buf,t,this.pos),this.pos+=4},"writeFixed32"),writeSFixed32:u(function(t){this.realloc(4),$r(this.buf,t,this.pos),this.pos+=4},"writeSFixed32"),writeFixed64:u(function(t){this.realloc(8),$r(this.buf,t&-1,this.pos),$r(this.buf,Math.floor(t*hh),this.pos+4),this.pos+=8},"writeFixed64"),writeSFixed64:u(function(t){this.realloc(8),$r(this.buf,t&-1,this.pos),$r(this.buf,Math.floor(t*hh),this.pos+4),this.pos+=8},"writeSFixed64"),writeVarint:u(function(t){if(t=+t||0,t>268435455||t<0){c1(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=A1(this.buf,t,this.pos);var r=this.pos-e;r>=128&&dh(e,r,this),this.pos=e-1,this.writeVarint(r),this.pos+=r},"writeString"),writeFloat:u(function(t){this.realloc(4),Ua.write(this.buf,t,this.pos,!0,23,4),this.pos+=4},"writeFloat"),writeDouble:u(function(t){this.realloc(8),Ua.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&&dh(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,y1,e)},"writePackedVarint"),writePackedSVarint:u(function(t,e){e.length&&this.writeMessage(t,m1,e)},"writePackedSVarint"),writePackedBoolean:u(function(t,e){e.length&&this.writeMessage(t,g1,e)},"writePackedBoolean"),writePackedFloat:u(function(t,e){e.length&&this.writeMessage(t,h1,e)},"writePackedFloat"),writePackedDouble:u(function(t,e){e.length&&this.writeMessage(t,d1,e)},"writePackedDouble"),writePackedFixed32:u(function(t,e){e.length&&this.writeMessage(t,x1,e)},"writePackedFixed32"),writePackedSFixed32:u(function(t,e){e.length&&this.writeMessage(t,b1,e)},"writePackedSFixed32"),writePackedFixed64:u(function(t,e){e.length&&this.writeMessage(t,v1,e)},"writePackedFixed64"),writePackedSFixed64:u(function(t,e){e.length&&this.writeMessage(t,P1,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 u1(t,e,r){var n=r.buf,i,o;if(o=n[r.pos++],i=(o&112)>>4,o<128||(o=n[r.pos++],i|=(o&127)<<3,o<128)||(o=n[r.pos++],i|=(o&127)<<10,o<128)||(o=n[r.pos++],i|=(o&127)<<17,o<128)||(o=n[r.pos++],i|=(o&127)<<24,o<128)||(o=n[r.pos++],i|=(o&1)<<31,o<128))return Ur(t,i,e);throw new Error("Expected varint not more than 10 bytes")}u(u1,"readVarintRemainder");function mt(t){return t.type===H.Bytes?t.readVarint()+t.pos:t.pos+1}u(mt,"readPackedEnd");function Ur(t,e,r){return r?e*4294967296+(t>>>0):(e>>>0)*4294967296+(t>>>0)}u(Ur,"toNum");function c1(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),p1(r,n,e),f1(n,e)}u(c1,"writeBigVarint");function p1(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(p1,"writeBigVarintLow");function f1(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(f1,"writeBigVarintHigh");function dh(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(dh,"makeRoomForExtraLength");function y1(t,e){for(var r=0;r<t.length;r++)e.writeVarint(t[r])}u(y1,"writePackedVarint");function m1(t,e){for(var r=0;r<t.length;r++)e.writeSVarint(t[r])}u(m1,"writePackedSVarint");function h1(t,e){for(var r=0;r<t.length;r++)e.writeFloat(t[r])}u(h1,"writePackedFloat");function d1(t,e){for(var r=0;r<t.length;r++)e.writeDouble(t[r])}u(d1,"writePackedDouble");function g1(t,e){for(var r=0;r<t.length;r++)e.writeBoolean(t[r])}u(g1,"writePackedBoolean");function x1(t,e){for(var r=0;r<t.length;r++)e.writeFixed32(t[r])}u(x1,"writePackedFixed32");function b1(t,e){for(var r=0;r<t.length;r++)e.writeSFixed32(t[r])}u(b1,"writePackedSFixed32");function v1(t,e){for(var r=0;r<t.length;r++)e.writeFixed64(t[r])}u(v1,"writePackedFixed64");function P1(t,e){for(var r=0;r<t.length;r++)e.writeSFixed64(t[r])}u(P1,"writePackedSFixed64");function $a(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+t[e+3]*16777216}u($a,"readUInt32");function $r(t,e,r){t[r]=e,t[r+1]=e>>>8,t[r+2]=e>>>16,t[r+3]=e>>>24}u($r,"writeInt32");function gh(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}u(gh,"readInt32");function S1(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(S1,"readUtf8");function w1(t,e,r){return xh.decode(t.subarray(e,r))}u(w1,"readUtf8TextDecoder");function A1(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(A1,"writeUtf8")});var md=Te(($L,yd)=>{x();yd.exports=ys;function ys(t,e){var r=t&&t.type,n;if(r==="FeatureCollection")for(n=0;n<t.features.length;n++)ys(t.features[n],e);else if(r==="GeometryCollection")for(n=0;n<t.geometries.length;n++)ys(t.geometries[n],e);else if(r==="Feature")ys(t.geometry,e);else if(r==="Polygon")pd(t.coordinates,e);else if(r==="MultiPolygon")for(n=0;n<t.coordinates.length;n++)pd(t.coordinates[n],e);return t}u(ys,"rewind");function pd(t,e){if(t.length!==0){fd(t[0],e);for(var r=1;r<t.length;r++)fd(t[r],!e)}}u(pd,"rewindRings");function fd(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(fd,"rewindRing")});var xd=Te((HL,gd)=>{"use strict";x();var aP=xe(),sP=Et().VectorTileFeature;gd.exports=dd;function dd(t,e){this.options=e||{},this.features=t,this.length=t.length}u(dd,"GeoJSONWrapper");dd.prototype.feature=function(t){return new hs(this.features[t],this.options.extent)};function hs(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(hs,"FeatureWrapper");hs.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 aP(r[i][0],r[i][1]));this.geometry.push(n)}return this.geometry};hs.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]};hs.prototype.toGeoJSON=sP.prototype.toGeoJSON});var Pd=Te((YL,Bi)=>{x();var lP=di(),vd=xd();Bi.exports=Ep;Bi.exports.fromVectorTileJs=Ep;Bi.exports.fromGeojsonVt=uP;Bi.exports.GeoJSONWrapper=vd;function Ep(t){var e=new lP;return cP(t,e),e.finish()}u(Ep,"fromVectorTileJs");function uP(t,e){e=e||{};var r={};for(var n in t)r[n]=new vd(t[n].features,e),r[n].name=n,r[n].version=e.version,r[n].extent=e.extent;return Ep({layers:r})}u(uP,"fromGeojsonVt");function cP(t,e){for(var r in t.layers)e.writeMessage(3,pP,t.layers[r])}u(cP,"writeTile");function pP(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,fP,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,hP,o[r])}u(pP,"writeLayer");function fP(t,e){var r=t.feature;r.id!==void 0&&e.writeVarintField(1,r.id),e.writeMessage(2,yP,t),e.writeVarintField(3,r.type),e.writeMessage(4,mP,r)}u(fP,"writeFeature");function yP(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(yP,"writeProperties");function Mp(t,e){return(e<<3)+(t&7)}u(Mp,"command");function bd(t){return t<<1^t>>31}u(bd,"zigzag");function mP(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(Mp(1,c));for(var p=n===3?l.length-1:l.length,f=0;f<p;f++){f===1&&n!==1&&e.writeVarint(Mp(2,p-1));var y=l[f].x-i,m=l[f].y-o;e.writeVarint(bd(y)),e.writeVarint(bd(m)),i+=y,o+=m}n===3&&e.writeVarint(Mp(7,1))}}u(mP,"writeGeometry");function hP(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(hP,"writeValue")});x();x();x();var Jd=X(xe(),1),uf=X(of(),1);x();x();var ks;function af(){return ks==null&&(ks=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")&&typeof createImageBitmap=="function"),ks}u(af,"offscreenCanvasSupported");var Zi;function sf(){if(Zi==null&&(Zi=!1,af())){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(".concat(o,",").concat(o+1,",").concat(o+2,")"),r.fillRect(i%5,Math.floor(i/5),1,1)}let n=r.getImageData(0,0,5,5).data;for(let i=0;i<5*5*4;i++)if(i%4!==3&&n[i]!==i){Zi=!0;break}}}return Zi||!1}u(sf,"isOffscreenCanvasDistorted");function cf(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(cf,"easeCubicInOut");function Zd(t,e,r,n){let i=new uf.default(t,e,r,n);return function(o){return i.solve(o)}}u(Zd,"bezier");var jP=Zd(.25,.1,.25,1);function lt(t,e,r){return Math.min(r,Math.max(e,t))}u(lt,"clamp");function pf(t,e,r){let n=r-e,i=((t-e)%n+n)%n+e;return i===e?r:i}u(pf,"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 ff(t){return Math.log(t)/Math.LN2%1===0}u(ff,"isPowerOfTwo");function en(t,e,r){let n={};for(let i in t)n[i]=e.call(r||this,t[i],i,t);return n}u(en,"mapObject");function yf(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(yf,"filterObject");function st(t){return Array.isArray(t)?t.map(st):typeof t=="object"&&t?en(t,st):t}u(st,"clone");function mf(t,e){for(let r=0;r<t.length;r++)if(e.indexOf(t[r])>=0)return!0;return!1}u(mf,"arraysIntersect");var lf={};function he(t){lf[t]||(typeof console<"u"&&console.warn(t),lf[t]=!0)}u(he,"warnOnce");function ut(t,e,r){return(r.y-t.y)*(e.x-t.x)>(e.y-t.y)*(r.x-t.x)}u(ut,"isCounterClockwise");function hf(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(hf,"calculateSignedArea");function ct(t){return typeof WorkerGlobalScope<"u"&&typeof t<"u"&&t instanceof WorkerGlobalScope}u(ct,"isWorker");function tn(t){return typeof ImageBitmap<"u"&&t instanceof ImageBitmap}u(tn,"isImageBitmap");function Wd(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(Wd,"computeVideoFrameParameters");async function Hd(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==null?void 0:o.format;if(!a||!(a.startsWith("BGR")||a.startsWith("RGB")))throw new Error("Unrecognized format ".concat(a));let s=a.startsWith("BGR"),l=new Uint8ClampedArray(n*i*4);if(await o.copyTo(l,Wd(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(Hd,"readImageUsingVideoFrame");var Yr,Qr;function Xd(t,e,r,n,i){let o=t.width,a=t.height;(!Yr||!Qr)&&(Yr=new OffscreenCanvas(o,a),Qr=Yr.getContext("2d",{willReadFrequently:!0})),Yr.width=o,Yr.height=a,Qr.drawImage(t,0,0,o,a);let s=Qr.getImageData(e,r,n,i);return Qr.clearRect(0,0,o,a),s.data}u(Xd,"readImageDataUsingOffscreenCanvas");async function df(t,e,r,n,i){if(sf())try{return await Hd(t,e,r,n,i)}catch{}return Xd(t,e,r,n,i)}u(df,"getImageData");function gf(t,e,r,n){return t.addEventListener(e,r,n),{unsubscribe:u(()=>{t.removeEventListener(e,r,n)},"unsubscribe")}}u(gf,"subscribe");x();x();var Wi=class Wi{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 Wi(e.buffer)}};u(Wi,"TransferableGridIndex");var Rt=Wi;x();var Kd=8,Yd={version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},light:{type:"light"},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"}},Qd={"*":{type:"source"}},eg=["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],tg={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:"*"}},rg={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:"*"}},ng={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:"*"}},ig={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"}},og={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"}}},ag={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"}}},sg={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"}},lg=["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],ug={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},cg={"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"}},pg={"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"}},fg={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},yg={"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"}},mg={"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"}},hg={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},dg={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},gg={type:"array",value:"*"},xg={type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{}}},bg={type:"enum",values:{Point:{},LineString:{},Polygon:{}}},vg={type:"array",minimum:0,maximum:24,value:["number","color"],length:2},Pg={type:"array",value:"*",minimum:1},Sg={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}},wg={"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}},Ag={source:{type:"string",required:!0},exaggeration:{type:"number",minimum:0,default:1}},_g={type:{type:"enum",default:"mercator",values:{mercator:{},globe:{}}}},Ig=["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],Tg={"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"}},Cg={"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"}},kg={"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"}},Mg={"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"}},Eg={"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"}},Fg={"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"}},Lg={"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"}},Dg={"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"}},Vg={duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},Bg={"*":{type:"string"}},_={$version:Kd,$root:Yd,sources:Qd,source:eg,source_vector:tg,source_raster:rg,source_raster_dem:ng,source_geojson:ig,source_video:og,source_image:ag,layer:sg,layout:lg,layout_background:ug,layout_fill:cg,layout_circle:pg,layout_heatmap:fg,"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:yg,layout_symbol:mg,layout_raster:hg,layout_hillshade:dg,filter:gg,filter_operator:xg,geometry_type:bg,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:vg,expression:Pg,light:Sg,sky:wg,terrain:Ag,projection:_g,paint:Ig,paint_fill:Tg,"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:Cg,paint_circle:kg,paint_heatmap:Mg,paint_symbol:Eg,paint_raster:Fg,paint_hillshade:Lg,paint_background:Dg,transition:Vg,"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:Bg},zg=["type","source","source-layer","minzoom","maxzoom","filter","layout"];var pl=class pl{constructor(e,r,n,i){this.message=(e?"".concat(e,": "):"")+n,i&&(this.identifier=i),r!=null&&r.__line__&&(this.line=r.__line__)}};u(pl,"ValidationError");var L=pl;function Pr(t,...e){for(let r of e)for(let n in r)t[n]=r[n];return t}u(Pr,"extendBy");var fl=class fl extends Error{constructor(e,r){super(r),this.message=r,this.key=e}};u(fl,"ExpressionParsingError");var Ne=fl,yo=class yo{constructor(e,r=[]){this.parent=e,this.bindings={};for(let[n,i]of r)this.bindings[n]=i}concat(e){return new yo(this,e)}get(e){if(this.bindings[e])return this.bindings[e];if(this.parent)return this.parent.get(e);throw new Error("".concat(e," not found in scope."))}has(e){return this.bindings[e]?!0:this.parent?this.parent.has(e):!1}};u(yo,"Scope");var Rs=yo,Ar={kind:"null"},B={kind:"number"},J={kind:"string"},q={kind:"boolean"},$e={kind:"color"},br={kind:"object"},j={kind:"value"},Rg={kind:"error"},Lo={kind:"collator"},_r={kind:"formatted"},Do={kind:"padding"},In={kind:"resolvedImage"},Vo={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<".concat(e,", ").concat(t.N,">"):t.itemType.kind==="value"?"array":"array<".concat(e,">")}else return t.kind}u(ie,"toString$1");var Og=[Ar,B,J,q,$e,_r,br,De(j),Do,In,Vo];function yn(t,e){if(e.kind==="error")return null;if(t.kind==="array"){if(e.kind==="array"&&(e.N===0&&e.itemType.kind==="value"||!yn(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 Og)if(!yn(r,e))return null}}return"Expected ".concat(ie(t)," but found ").concat(ie(e)," instead.")}u(yn,"checkSubtype");function tl(t,e){return e.some(r=>r.kind===t.kind)}u(tl,"isValidType");function mn(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(mn,"isValidNativeType");function rn(t,e){return t.kind==="array"&&e.kind==="array"?t.itemType.kind===e.itemType.kind&&typeof t.N=="number":t.kind===e.kind}u(rn,"verifyType");var Rf=.96422,Of=1,Nf=.82521,Uf=4/29,vr=6/29,$f=3*vr*vr,Ng=vr*vr*vr,Ug=Math.PI/180,$g=180/Math.PI;function Gf(t){return t=t%360,t<0&&(t+=360),t}u(Gf,"constrainAngle");function qf([t,e,r,n]){t=Ms(t),e=Ms(e),r=Ms(r);let i,o,a=Es((.2225045*t+.7168786*e+.0606169*r)/Of);t===e&&e===r?i=o=a:(i=Es((.4360747*t+.3850649*e+.1430804*r)/Rf),o=Es((.0139322*t+.0971045*e+.7141733*r)/Nf));let s=116*a-16;return[s<0?0:s,500*(i-a),200*(a-o),n]}u(qf,"rgbToLab");function Ms(t){return t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}u(Ms,"rgb2xyz");function Es(t){return t>Ng?Math.pow(t,1/3):t/$f+Uf}u(Es,"xyz2lab");function jf([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=Of*Ls(i),o=Rf*Ls(o),a=Nf*Ls(a),[Fs(3.1338561*o-1.6168667*i-.4906146*a),Fs(-.9787684*o+1.9161415*i+.033454*a),Fs(.0719453*o-.2289914*i+1.4052427*a),n]}u(jf,"labToRgb");function Fs(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(Fs,"xyz2rgb");function Ls(t){return t>vr?t*t*t:$f*(t-Uf)}u(Ls,"lab2xyz");function Gg(t){let[e,r,n,i]=qf(t),o=Math.sqrt(r*r+n*n);return[Math.round(o*1e4)?Gf(Math.atan2(n,r)*$g):NaN,o,e,i]}u(Gg,"rgbToHcl");function qg([t,e,r,n]){return t=isNaN(t)?0:t*Ug,jf([r,Math.cos(t)*e,Math.sin(t)*e,n])}u(qg,"hclToRgb");function jg([t,e,r,n]){t=Gf(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(jg,"hslToRgb");function Jg(t){if(t=t.toLowerCase().trim(),t==="transparent")return[0,0,0,0];let e=Zg[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[Hi(t.slice(a,a+=o)),Hi(t.slice(a,a+=o)),Hi(t.slice(a,a+=o)),Hi(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=[yr(+s/S,0,1),yr(+p/S,0,1),yr(+m/S,0,1),g?xf(+g,b):1];if(bf(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,yr(+s,0,100),yr(+c,0,100),f?xf(+f,y):1];if(bf(h))return jg(h)}}}u(Jg,"parseCssColor");function Hi(t){return parseInt(t.padEnd(2,t),16)/255}u(Hi,"parseHex");function xf(t,e){return yr(e?t/100:t,0,1)}u(xf,"parseAlpha");function yr(t,e,r){return Math.min(Math.max(e,t),r)}u(yr,"clamp");function bf(t){return!t.some(Number.isNaN)}u(bf,"validateNumbers");var Zg={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]},sn=class sn{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 sn)return e;if(typeof e!="string")return;let r=Jg(e);if(r)return new sn(...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",Gg(this.rgb))}get lab(){return this.overwriteGetter("lab",qf(this.rgb))}overwriteGetter(e,r){return Object.defineProperty(this,e,{value:r}),r}toString(){let[e,r,n,i]=this.rgb;return"rgba(".concat([e,r,n].map(o=>Math.round(o*255)).join(","),",").concat(i,")")}};u(sn,"Color");var K=sn;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 yl=class yl{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}};u(yl,"Collator");var hn=yl,ml=class ml{constructor(e,r,n,i,o){this.text=e,this.image=r,this.scale=n,this.fontStack=i,this.textColor=o}};u(ml,"FormattedSection");var dn=ml,hr=class hr{constructor(e){this.sections=e}static fromString(e){return new hr([new dn(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 hr?e:hr.fromString(e)}toString(){return this.sections.length===0?"":this.sections.map(e=>e.text).join("")}};u(hr,"Formatted");var Ve=hr,dr=class dr{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof dr)return e;if(typeof e=="number")return new dr([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 dr(e)}}toString(){return JSON.stringify(this.values)}};u(dr,"Padding");var Ke=dr,Wg=new Set(["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"]),ln=class ln{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof ln)return e;if(!(!Array.isArray(e)||e.length<1||e.length%2!==0)){for(let r=0;r<e.length;r+=2){let n=e[r],i=e[r+1];if(typeof n!="string"||!Wg.has(n)||!Array.isArray(i)||i.length!==2||typeof i[0]!="number"||typeof i[1]!="number")return}return new ln(e)}}toString(){return JSON.stringify(this.values)}};u(ln,"VariableAnchorOffsetCollection");var qe=ln,mo=class mo{constructor(e){this.name=e.name,this.available=e.available}toString(){return this.name}static fromString(e){return e?new mo({name:e,available:!1}):null}};u(mo,"ResolvedImage");var Me=mo;function Jf(t,e,r,n){if(!(typeof t=="number"&&t>=0&&t<=255&&typeof e=="number"&&e>=0&&e<=255&&typeof r=="number"&&r>=0&&r<=255)){let i=typeof n=="number"?[t,e,r,n]:[t,e,r];return"Invalid rgba value [".concat(i.join(", "),"]: 'r', 'g', and 'b' must be between 0 and 255.")}return typeof n>"u"||typeof n=="number"&&n>=0&&n<=1?null:"Invalid rgba value [".concat([t,e,r,n].join(", "),"]: 'a' must be between 0 and 1.")}u(Jf,"validateRGBA");function gn(t){if(t===null||typeof t=="string"||typeof t=="boolean"||typeof t=="number"||t instanceof K||t instanceof hn||t instanceof Ve||t instanceof Ke||t instanceof qe||t instanceof Me)return!0;if(Array.isArray(t)){for(let e of t)if(!gn(e))return!1;return!0}else if(typeof t=="object"){for(let e in t)if(!gn(t[e]))return!1;return!0}else return!1}u(gn,"isValue");function fe(t){if(t===null)return Ar;if(typeof t=="string")return J;if(typeof t=="boolean")return q;if(typeof t=="number")return B;if(t instanceof K)return $e;if(t instanceof hn)return Lo;if(t instanceof Ve)return _r;if(t instanceof Ke)return Do;if(t instanceof qe)return Vo;if(t instanceof Me)return In;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 br}u(fe,"typeOf");function on(t){let e=typeof t;return t===null?"":e==="string"||e==="number"||e==="boolean"?String(t):t instanceof K||t instanceof Ve||t instanceof Ke||t instanceof qe||t instanceof Me?t.toString():JSON.stringify(t)}u(on,"toString");var ho=class ho{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 ".concat(e.length-1," instead."));if(!gn(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 ho(i,n)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}};u(ho,"Literal");var xt=ho,hl=class hl{constructor(e){this.name="ExpressionEvaluationError",this.message=e}toJSON(){return this.message}};u(hl,"RuntimeError");var se=hl,Xi={string:J,number:B,boolean:q,object:br},go=class go{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 Xi)||c==="object")return r.error('The item type argument of "array" must be one of string, number, boolean',1);s=Xi[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(!Xi[o])throw new Error("Types doesn't contain name = ".concat(o));i=Xi[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 go(i,a)}evaluate(e){for(let r=0;r<this.args.length;r++){let n=this.args[r].evaluate(e);if(yn(this.type,fe(n))){if(r===this.args.length-1)throw new se("Expected value to be of type ".concat(ie(this.type),", but found ").concat(ie(fe(n))," instead."))}else return n}throw new Error}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}};u(go,"Assertion");var He=go,vf={"to-boolean":q,"to-color":$e,"to-number":B,"to-string":J},xo=class xo{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(!vf[n])throw new Error("Can't parse ".concat(n," as it is not part of the known types"));if((n==="to-boolean"||n==="to-string")&&e.length!==2)return r.error("Expected one argument.");let i=vf[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 xo(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 rbga value ".concat(JSON.stringify(r),": expected an array containing either three or four numeric values."):n=Jf(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 '".concat(typeof r=="string"?r:JSON.stringify(r),"'"))}case"padding":{let r;for(let n of this.args){r=n.evaluate(e);let i=Ke.parse(r);if(i)return i}throw new se("Could not parse padding from value '".concat(typeof r=="string"?r:JSON.stringify(r),"'"))}case"variableAnchorOffsetCollection":{let r;for(let n of this.args){r=n.evaluate(e);let i=qe.parse(r);if(i)return i}throw new se("Could not parse variableAnchorOffsetCollection from value '".concat(typeof r=="string"?r:JSON.stringify(r),"'"))}case"number":{let r=null;for(let n of this.args){if(r=n.evaluate(e),r===null)return 0;let i=Number(r);if(!isNaN(i))return i}throw new se("Could not convert ".concat(JSON.stringify(r)," to number."))}case"formatted":return Ve.fromString(on(this.args[0].evaluate(e)));case"resolvedImage":return Me.fromString(on(this.args[0].evaluate(e)));default:return on(this.args[0].evaluate(e))}}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}};u(xo,"Coercion");var gt=xo,Hg=["Unknown","Point","LineString","Polygon"],dl=class dl{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"?Hg[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}};u(dl,"EvaluationContext");var eo=dl,bo=class bo{constructor(e,r,n=[],i,o=new Rs,a=[]){this.registry=e,this.path=n,this.key=n.map(s=>"[".concat(s,"]")).join(""),this.scope=o,this.errors=a,this.expectedType=i,this._isConstant=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 He(o,[i]):a==="coerce"?new gt(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 ".concat(typeof i,' instead. If you wanted a literal array, use ["literal", [...]].'),0),null;let o=this.registry[i];if(o){let a=o.parse(e,this);if(!a)return null;if(this.expectedType){let s=this.expectedType,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 xt)&&a.type.kind!=="resolvedImage"&&this._isConstant(a)){let s=new eo;try{a=new xt(a.type,a.evaluate(s))}catch(l){return this.error(l.message),null}}return a}return this.error('Unknown expression "'.concat(i,'". If you wanted a literal array, use ["literal", [...]].'),0)}else return typeof e>"u"?this.error("'undefined' value invalid. Use null instead."):typeof e=="object"?this.error('Bare objects invalid. Use ["literal", {...}] instead.'):this.error("Expected an array, but found ".concat(typeof e," instead."))}concat(e,r,n){let i=typeof e=="number"?this.path.concat(e):this.path,o=n?this.scope.concat(n):this.scope;return new bo(this.registry,this._isConstant,i,r||null,o,this.errors)}error(e,...r){let n="".concat(this.key).concat(r.map(i=>"[".concat(i,"]")).join(""));this.errors.push(new Ne(n,e))}checkSubtype(e,r){let n=yn(e,r);return n&&this.error(n),n}};u(bo,"ParsingContext");var to=bo,vo=class vo{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 ".concat(e.length-1," instead."));let n=[];for(let o=1;o<e.length-1;o+=2){let a=e[o];if(typeof a!="string")return r.error("Expected string, but found ".concat(typeof a," instead."),o);if(/[^a-zA-Z0-9_]/.test(a))return r.error("Variable names must contain only alphanumeric characters or '_'.",o);let s=r.parse(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 vo(n,i):null}outputDefined(){return this.result.outputDefined()}};u(vo,"Let");var ro=vo,Po=class Po{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 Po(n,r.scope.get(n)):r.error('Unknown variable "'.concat(n,'". Make sure "').concat(n,'" has been bound in an enclosing "let" expression before using it.'),1)}evaluate(e){return this.boundExpression.evaluate(e)}eachChild(){}outputDefined(){return!1}};u(Po,"Var");var no=Po,So=class So{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 ".concat(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 So(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: ".concat(r," < 0."));if(r>=n.length)throw new se("Array index out of bounds: ".concat(r," > ").concat(n.length-1,"."));if(r!==Math.floor(r))throw new se("Array index must be an integer, but found ".concat(r," instead."));return n[r]}eachChild(e){e(this.index),e(this.input)}outputDefined(){return!1}};u(So,"At");var Os=So,wo=class wo{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 ".concat(e.length-1," instead."));let n=r.parse(e[1],1,j),i=r.parse(e[2],2,j);return!n||!i?null:tl(n.type,[q,J,B,Ar,j])?new wo(n,i):r.error("Expected first argument to be of type boolean, string, number or null, but found ".concat(ie(n.type)," instead"))}evaluate(e){let r=this.needle.evaluate(e),n=this.haystack.evaluate(e);if(!n)return!1;if(!mn(r,["boolean","string","number","null"]))throw new se("Expected first argument to be of type boolean, string, number or null, but found ".concat(ie(fe(r))," instead."));if(!mn(n,["string","array"]))throw new se("Expected second argument to be of type array or string, but found ".concat(ie(fe(n))," instead."));return n.indexOf(r)>=0}eachChild(e){e(this.needle),e(this.haystack)}outputDefined(){return!0}};u(wo,"In");var Ns=wo,un=class un{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 ".concat(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(!tl(n.type,[q,J,B,Ar,j]))return r.error("Expected first argument to be of type boolean, string, number or null, but found ".concat(ie(n.type)," instead"));if(e.length===4){let o=r.parse(e[3],3,B);return o?new un(n,i,o):null}else return new un(n,i)}evaluate(e){let r=this.needle.evaluate(e),n=this.haystack.evaluate(e);if(!mn(r,["boolean","string","number","null"]))throw new se("Expected first argument to be of type boolean, string, number or null, but found ".concat(ie(fe(r))," instead."));if(!mn(n,["string","array"]))throw new se("Expected second argument to be of type array or string, but found ".concat(ie(fe(n))," instead."));if(this.fromIndex){let i=this.fromIndex.evaluate(e);return n.indexOf(r,i)}return n.indexOf(r)}eachChild(e){e(this.needle),e(this.haystack),this.fromIndex&&e(this.fromIndex)}outputDefined(){return!1}};u(un,"IndexOf");var Us=un,Ao=class Ao{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 ".concat(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 ".concat(Number.MAX_SAFE_INTEGER,"."));if(typeof h=="number"&&Math.floor(h)!==h)return y.error("Numeric branch labels must be integer values.");if(!n)n=fe(h);else if(y.checkSubtype(n,fe(h)))return null;if(typeof o[String(h)]<"u")return y.error("Branch labels must be unique.");o[String(h)]=a.length}let m=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 Ao(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()}};u(Ao,"Match");var $s=Ao,_o=class _o{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 ".concat(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 _o(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()}};u(_o,"Case");var Gs=_o,cn=class cn{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 ".concat(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(!tl(n.type,[De(j),J,j]))return r.error("Expected first argument to be of type array or string, but found ".concat(ie(n.type)," instead"));if(e.length===4){let o=r.parse(e[3],3,B);return o?new cn(n.type,n,i,o):null}else return new cn(n.type,n,i)}evaluate(e){let r=this.input.evaluate(e),n=this.beginIndex.evaluate(e);if(!mn(r,["string","array"]))throw new se("Expected first argument to be of type array or string, but found ".concat(ie(fe(r))," instead."));if(this.endIndex){let i=this.endIndex.evaluate(e);return r.slice(n,i)}return r.slice(n)}eachChild(e){e(this.input),e(this.beginIndex),this.endIndex&&e(this.endIndex)}outputDefined(){return!1}};u(cn,"Slice");var qs=cn;function Bo(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(Bo,"findStopLessThanOrEqualTo");var Io=class Io{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 ".concat(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 Io(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=Bo(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())}};u(Io,"Step");var Sr=Io;function Xg(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}u(Xg,"getDefaultExportFromCjs");var Kg=Zf;function Zf(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(Zf,"UnitBezier");Zf.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 Yg=Xg(Kg);function Qg(t){return t==="rgb"||t==="hcl"||t==="lab"}u(Qg,"isSupportedInterpolationColorSpace");function $t(t,e,r){return t+r*(e-t)}u($t,"number");function ex(t,e,r,n="rgb"){switch(n){case"rgb":{let[i,o,a,s]=io(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]=qg([y,m!=null?m:$t(o,c,r),$t(a,p,r),$t(s,f,r)]);return new K(h,d,g,b,!1)}case"lab":{let[i,o,a,s]=jf(io(t.lab,e.lab,r));return new K(i,o,a,s,!1)}}}u(ex,"color");function io(t,e,r){return t.map((n,i)=>$t(n,e[i],r))}u(io,"array");function tx(t,e,r){return new Ke(io(t.values,e.values,r))}u(tx,"padding");function rx(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: ".concat(t.toString(),", to: ").concat(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[".concat(a,"]: ").concat(n[a],", to[").concat(a,"]: ").concat(i[a]));o.push(n[a]);let[s,l]=n[a+1],[c,p]=i[a+1];o.push([$t(s,c,r),$t(l,p,r)])}return new qe(o)}u(rx,"variableAnchorOffsetCollection");var Ge={number:$t,color:ex,array:io,padding:tx,variableAnchorOffsetCollection:rx},pn=class pn{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=Ds(r,e.base,n,i);else if(e.name==="linear")o=Ds(r,1,n,i);else if(e.name==="cubic-bezier"){let a=e.controlPoints;o=new Yg(a[0],a[1],a[2],a[3]).solve(Ds(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 ".concat(String(i[0])),1,0);if(e.length-1<4)return r.error("Expected at least 4 arguments, but found only ".concat(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=$e: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!rn(l,B)&&!rn(l,$e)&&!rn(l,Do)&&!rn(l,Vo)&&!rn(l,De(B))?r.error("Type ".concat(ie(l)," is not interpolatable.")):new pn(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=Bo(r,i),s=r[a],l=r[a+1],c=pn.interpolationFactor(this.interpolation,i,s,l),p=n[a].evaluate(e),f=n[a+1].evaluate(e);switch(this.operator){case"interpolate":return Ge[this.type.kind](p,f,c);case"interpolate-hcl":return Ge.color(p,f,c,"hcl");case"interpolate-lab":return Ge.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())}};u(pn,"Interpolate");var Xe=pn;function Ds(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(Ds,"exponentialInterpolation");var fn=class fn{constructor(e,r){this.type=e,this.args=r}static parse(e,r){if(e.length<2)return r.error("Expectected at least one argument.");let n=null,i=r.expectedType;i&&i.kind!=="value"&&(n=i);let o=[];for(let s of 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=>yn(i,s.type))?new fn(j,o):new fn(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())}};u(fn,"Coalesce");var oo=fn;function Pf(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(Pf,"isComparableType");function nx(t,e,r){return e===r}u(nx,"eq");function ix(t,e,r){return e!==r}u(ix,"neq");function ox(t,e,r){return e<r}u(ox,"lt");function ax(t,e,r){return e>r}u(ax,"gt");function sx(t,e,r){return e<=r}u(sx,"lteq");function lx(t,e,r){return e>=r}u(lx,"gteq");function Wf(t,e,r,n){return n.compare(e,r)===0}u(Wf,"eqCollate");function ux(t,e,r,n){return!Wf(t,e,r,n)}u(ux,"neqCollate");function cx(t,e,r,n){return n.compare(e,r)<0}u(cx,"ltCollate");function px(t,e,r,n){return n.compare(e,r)>0}u(px,"gtCollate");function fx(t,e,r,n){return n.compare(e,r)<=0}u(fx,"lteqCollate");function yx(t,e,r,n){return n.compare(e,r)>=0}u(yx,"gteqCollate");function Ir(t,e,r){var i;let n=t!=="=="&&t!=="!=";return i=class{constructor(a,s,l){this.type=q,this.lhs=a,this.rhs=s,this.collator=l,this.hasUntypedArgument=a.type.kind==="value"||s.type.kind==="value"}static parse(a,s){if(a.length!==3&&a.length!==4)return s.error("Expected two or three arguments.");let l=a[0],c=s.parse(a[1],1,j);if(!c)return null;if(!Pf(l,c.type))return s.concat(1).error('"'.concat(l,"\" comparisons are not supported for type '").concat(ie(c.type),"'."));let p=s.parse(a[2],2,j);if(!p)return null;if(!Pf(l,p.type))return s.concat(2).error('"'.concat(l,"\" comparisons are not supported for type '").concat(ie(p.type),"'."));if(c.type.kind!==p.type.kind&&c.type.kind!=="value"&&p.type.kind!=="value")return s.error("Cannot compare types '".concat(ie(c.type),"' and '").concat(ie(p.type),"'."));n&&(c.type.kind==="value"&&p.type.kind!=="value"?c=new He(p.type,[c]):c.type.kind!=="value"&&p.type.kind==="value"&&(p=new He(c.type,[p])));let f=null;if(a.length===4){if(c.type.kind!=="string"&&p.type.kind!=="string"&&c.type.kind!=="value"&&p.type.kind!=="value")return s.error("Cannot use collator to compare non-string types.");if(f=s.parse(a[3],3,Lo),!f)return null}return new i(c,p,f)}evaluate(a){let s=this.lhs.evaluate(a),l=this.rhs.evaluate(a);if(n&&this.hasUntypedArgument){let c=fe(s),p=fe(l);if(c.kind!==p.kind||!(c.kind==="string"||c.kind==="number"))throw new se('Expected arguments for "'.concat(t,'" to be (string, string) or (number, number), but found (').concat(c.kind,", ").concat(p.kind,") instead."))}if(this.collator&&!n&&this.hasUntypedArgument){let c=fe(s),p=fe(l);if(c.kind!=="string"||p.kind!=="string")return e(a,s,l)}return this.collator?r(a,s,l,this.collator.evaluate(a)):e(a,s,l)}eachChild(a){a(this.lhs),a(this.rhs),this.collator&&a(this.collator)}outputDefined(){return!0}},u(i,"Comparison"),i}u(Ir,"makeComparison");var mx=Ir("==",nx,Wf),hx=Ir("!=",ix,ux),dx=Ir("<",ox,cx),gx=Ir(">",ax,px),xx=Ir("<=",sx,fx),bx=Ir(">=",lx,yx),To=class To{constructor(e,r,n){this.type=Lo,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 To(i,o,a)}evaluate(e){return new hn(this.caseSensitive.evaluate(e),this.diacriticSensitive.evaluate(e),this.locale?this.locale.evaluate(e):null)}eachChild(e){e(this.caseSensitive),e(this.diacriticSensitive),this.locale&&e(this.locale)}outputDefined(){return!1}};u(To,"CollatorExpression");var ao=To,Co=class Co{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 Co(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}};u(Co,"NumberFormat");var js=Co,ko=class ko{constructor(e){this.type=_r,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,$e),!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 ko(i)}evaluate(e){let r=u(n=>{let i=n.content.evaluate(e);return fe(i)===In?new dn("",i,null,null,null):new dn(on(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}};u(ko,"FormatExpression");var xn=ko,Mo=class Mo{constructor(e){this.type=In,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 Mo(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}};u(Mo,"ImageExpression");var Js=Mo,Eo=class Eo{constructor(e){this.type=B,this.input=e}static parse(e,r){if(e.length!==2)return r.error("Expected 1 argument, but found ".concat(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 ".concat(ie(n.type)," instead.")):new Eo(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 ".concat(ie(fe(r))," instead."))}eachChild(e){e(this.input)}outputDefined(){return!1}};u(Eo,"Length");var Zs=Eo,et=8192;function vx(t,e){let r=Px(t[0]),n=wx(t[1]),i=Math.pow(2,e.z);return[Math.round(r*i*et),Math.round(n*i*et)]}u(vx,"getTileCoordinates");function rl(t,e){let r=Math.pow(2,e.z),n=(t[0]/et+e.x)/r,i=(t[1]/et+e.y)/r;return[Sx(n),Ax(i)]}u(rl,"getLngLatFromTileCoord");function Px(t){return(180+t)/360}u(Px,"mercatorXfromLng");function Sx(t){return t*360-180}u(Sx,"lngFromMercatorXfromLng");function wx(t){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))/360}u(wx,"mercatorYfromLat");function Ax(t){return 360/Math.PI*Math.atan(Math.exp((180-t*360)*Math.PI/180))-90}u(Ax,"latFromMercatorY");function Tn(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(Tn,"updateBBox");function bn(t,e){return!(t[0]<=e[0]||t[2]>=e[2]||t[1]<=e[1]||t[3]>=e[3])}u(bn,"boxWithinBox");function _x(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(_x,"rayIntersect");function Ix(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(Ix,"pointOnBoundary");function zo(t,e,r,n){let i=[e[0]-t[0],e[1]-t[1]],o=[n[0]-r[0],n[1]-r[1]];return Mx(o,i)===0?!1:!!(Sf(t,e,r,n)&&Sf(r,n,t,e))}u(zo,"segmentIntersectSegment");function Tx(t,e,r){for(let n of r)for(let i=0;i<n.length-1;++i)if(zo(t,e,n[i],n[i+1]))return!0;return!1}u(Tx,"lineIntersectPolygon");function Tr(t,e,r=!1){let n=!1;for(let i of e)for(let o=0;o<i.length-1;o++){if(Ix(t,i[o],i[o+1]))return r;_x(t,i[o],i[o+1])&&(n=!n)}return n}u(Tr,"pointWithinPolygon");function Cx(t,e){for(let r of e)if(Tr(t,r))return!0;return!1}u(Cx,"pointWithinPolygons");function Hf(t,e){for(let r of t)if(!Tr(r,e))return!1;for(let r=0;r<t.length-1;++r)if(Tx(t[r],t[r+1],e))return!1;return!0}u(Hf,"lineStringWithinPolygon");function kx(t,e){for(let r of e)if(Hf(t,r))return!0;return!1}u(kx,"lineStringWithinPolygons");function Mx(t,e){return t[0]*e[1]-t[1]*e[0]}u(Mx,"perp");function Sf(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(Sf,"twoSided");function nl(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=vx(t[i][a],r);Tn(e,s),o.push(s)}n.push(o)}return n}u(nl,"getTilePolygon");function Xf(t,e,r){let n=[];for(let i=0;i<t.length;i++){let o=nl(t[i],e,r);n.push(o)}return n}u(Xf,"getTilePolygons");function Kf(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}Tn(e,t)}u(Kf,"updatePoint");function Ex(t){t[0]=t[1]=1/0,t[2]=t[3]=-1/0}u(Ex,"resetBBox");function wf(t,e,r,n){let i=Math.pow(2,n.z)*et,o=[n.x*et,n.y*et],a=[];for(let s of t)for(let l of s){let c=[l.x+o[0],l.y+o[1]];Kf(c,e,r,i),a.push(c)}return a}u(wf,"getTilePoints");function Af(t,e,r,n){let i=Math.pow(2,n.z)*et,o=[n.x*et,n.y*et],a=[];for(let s of t){let l=[];for(let c of s){let p=[c.x+o[0],c.y+o[1]];Tn(e,p),l.push(p)}a.push(l)}if(e[2]-e[0]<=i/2){Ex(e);for(let s of a)for(let l of s)Kf(l,e,r,i)}return a}u(Af,"getTileLines");function Fx(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=nl(e.coordinates,n,i),a=wf(t.geometry(),r,n,i);if(!bn(r,n))return!1;for(let s of a)if(!Tr(s,o))return!1}if(e.type==="MultiPolygon"){let o=Xf(e.coordinates,n,i),a=wf(t.geometry(),r,n,i);if(!bn(r,n))return!1;for(let s of a)if(!Cx(s,o))return!1}return!0}u(Fx,"pointsWithinPolygons");function Lx(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=nl(e.coordinates,n,i),a=Af(t.geometry(),r,n,i);if(!bn(r,n))return!1;for(let s of a)if(!Hf(s,o))return!1}if(e.type==="MultiPolygon"){let o=Xf(e.coordinates,n,i),a=Af(t.geometry(),r,n,i);if(!bn(r,n))return!1;for(let s of a)if(!kx(s,o))return!1}return!0}u(Lx,"linesWithinPolygons");var gr=class gr{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 ".concat(e.length-1," instead."));if(gn(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 gr(n,o)}}else if(n.type==="Feature"){let i=n.geometry.type;if(i==="Polygon"||i==="MultiPolygon")return new gr(n,n.geometry)}else if(n.type==="Polygon"||n.type==="MultiPolygon")return new gr(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 Fx(e,this.geometries);if(e.geometryType()==="LineString")return Lx(e,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}};u(gr,"Within");var vn=gr,gl=class gl{constructor(e=[],r=Dx){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}};u(gl,"TinyQueue");var so=gl;function Dx(t,e){return t<e?-1:t>e?1:0}u(Dx,"defaultCompare$1");function Vx(t,e,r,n,i){Yf(t,e,r,n||t.length-1,i||Bx)}u(Vx,"quickselect");function Yf(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));Yf(t,e,p,f,i)}var y=t[e],m=r,h=n;for(nn(t,r,e),i(t[n],y)>0&&nn(t,r,n);m<h;){for(nn(t,m,h),m++,h--;i(t[m],y)<0;)m++;for(;i(t[h],y)>0;)h--}i(t[r],y)===0?nn(t,r,h):(h++,nn(t,h,n)),h<=e&&(r=h+1),e<=h&&(n=h-1)}}u(Yf,"quickselectStep");function nn(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}u(nn,"swap");function Bx(t,e){return t<e?-1:t>e?1:0}u(Bx,"defaultCompare");function zx(t,e){if(t.length<=1)return[t];let n=[],i,o;for(let a of t){let s=Ox(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||(Vx(n[a],e,1,n[a].length-1,Rx),n[a]=n[a].slice(0,e));return n}u(zx,"classifyRings");function Rx(t,e){return e.area-t.area}u(Rx,"compareAreas");function Ox(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(Ox,"calculateSignedArea");var Nx=6378.137,_f=1/298.257223563,If=_f*(2-_f),Tf=Math.PI/180,xl=class xl{constructor(e){let r=Tf*Nx*1e3,n=Math.cos(e*Tf),i=1/(1-If*(1-n*n)),o=Math.sqrt(i);this.kx=r*o*n,this.ky=r*o*i*(1-If)}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}};u(xl,"CheapRuler");var Pn=xl,Ws=100,Hs=50;function Qf(t,e){return e[0]-t[0]}u(Qf,"compareDistPair");function lo(t){return t[1]-t[0]+1}u(lo,"getRangeSize");function pt(t,e){return t[1]>=t[0]&&t[1]<e}u(pt,"isRangeSafe");function Xs(t,e){if(t[0]>t[1])return[null,null];let r=lo(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(Xs,"splitRange");function Ks(t,e){if(!pt(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)Tn(r,t[n]);return r}u(Ks,"getBBox");function Ys(t){let e=[1/0,1/0,-1/0,-1/0];for(let r of t)for(let n of r)Tn(e,n);return e}u(Ys,"getPolygonBBox");function Cf(t){return t[0]!==-1/0&&t[1]!==-1/0&&t[2]!==1/0&&t[3]!==1/0}u(Cf,"isValidBBox");function il(t,e,r){if(!Cf(t)||!Cf(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(il,"bboxToBBoxDistance");function Ut(t,e,r){let n=r.pointOnLine(e,t);return r.distance(t,n.point)}u(Ut,"pointToLineDistance");function ol(t,e,r,n,i){let o=Math.min(Ut(t,[r,n],i),Ut(e,[r,n],i)),a=Math.min(Ut(r,[t,e],i),Ut(n,[t,e],i));return Math.min(o,a)}u(ol,"segmentToSegmentDistance");function Ux(t,e,r,n,i){if(!(pt(e,t.length)&&pt(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(zo(l,c,f,y))return 0;a=Math.min(a,ol(l,c,f,y,i))}}return a}u(Ux,"lineToLineDistance");function $x(t,e,r,n,i){if(!(pt(e,t.length)&&pt(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($x,"pointsToPointsDistance");function Gx(t,e,r){if(Tr(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,Ut(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(Gx,"pointToPolygonDistance");function qx(t,e,r,n){if(!pt(e,t.length))return NaN;for(let o=e[0];o<=e[1];++o)if(Tr(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(zo(a,s,y,m))return 0;i=Math.min(i,ol(a,s,y,m,n))}}return i}u(qx,"lineToPolygonDistance");function kf(t,e){for(let r of t)for(let n of r)if(Tr(n,e,!0))return!0;return!1}u(kf,"polygonIntersect");function jx(t,e,r,n=1/0){let i=Ys(t),o=Ys(e);if(n!==1/0&&il(i,o,r)>=n)return n;if(bn(i,o)){if(kf(t,e))return 0}else if(kf(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(zo(f,y,b,P))return 0;a=Math.min(a,ol(f,y,b,P,r))}}return a}u(jx,"polygonToPolygonDistance");function Mf(t,e,r,n,i,o){if(!o)return;let a=il(Ks(n,o),i,r);a<e&&t.push([a,o,[0,0]])}u(Mf,"updateQueue");function Ki(t,e,r,n,i,o,a){if(!o||!a)return;let s=il(Ks(n,o),Ks(i,a),r);s<e&&t.push([s,o,a])}u(Ki,"updateQueueTwoSets");function uo(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 so([[0,[0,t.length-1],[0,0]]],Qf),s=Ys(r);for(;a.length>0;){let l=a.pop();if(l[0]>=o)continue;let c=l[1],p=e?Hs:Ws;if(lo(c)<=p){if(!pt(c,t.length))return NaN;if(e){let f=qx(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=Gx(t[f],r,n);if(o=Math.min(o,y),o===0)return 0}}else{let f=Xs(c,e);Mf(a,o,n,t,s,f[0]),Mf(a,o,n,t,s,f[1])}}return o}u(uo,"pointsToPolygonDistance");function co(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 so([[0,[0,t.length-1],[0,r.length-1]]],Qf);for(;s.length>0;){let l=s.pop();if(l[0]>=a)continue;let c=l[1],p=l[2],f=e?Hs:Ws,y=n?Hs:Ws;if(lo(c)<=f&&lo(p)<=y){if(!pt(c,t.length)&&pt(p,r.length))return NaN;let m;if(e&&n)m=Ux(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=Ut(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=Ut(t[d],h,i),a=Math.min(a,m),a===0)return a}else m=$x(t,c,r,p,i),a=Math.min(a,m)}else{let m=Xs(c,e),h=Xs(p,n);Ki(s,a,i,t,r,m[0],h[0]),Ki(s,a,i,t,r,m[0],h[1]),Ki(s,a,i,t,r,m[1],h[0]),Ki(s,a,i,t,r,m[1],h[1])}}return a}u(co,"pointSetToPointSetDistance");function Jx(t,e){let r=t.geometry(),n=r.flat().map(a=>rl([a.x,a.y],t.canonical));if(r.length===0)return NaN;let i=new Pn(n[0][1]),o=1/0;for(let a of e){switch(a.type){case"Point":o=Math.min(o,co(n,!1,[a.coordinates],!1,i,o));break;case"LineString":o=Math.min(o,co(n,!1,a.coordinates,!0,i,o));break;case"Polygon":o=Math.min(o,uo(n,!1,a.coordinates,i,o));break}if(o===0)return o}return o}u(Jx,"pointToGeometryDistance");function Zx(t,e){let r=t.geometry(),n=r.flat().map(a=>rl([a.x,a.y],t.canonical));if(r.length===0)return NaN;let i=new Pn(n[0][1]),o=1/0;for(let a of e){switch(a.type){case"Point":o=Math.min(o,co(n,!0,[a.coordinates],!1,i,o));break;case"LineString":o=Math.min(o,co(n,!0,a.coordinates,!0,i,o));break;case"Polygon":o=Math.min(o,uo(n,!0,a.coordinates,i,o));break}if(o===0)return o}return o}u(Zx,"lineStringToGeometryDistance");function Wx(t,e){let r=t.geometry();if(r.length===0||r[0].length===0)return NaN;let n=zx(r,0).map(a=>a.map(s=>s.map(l=>rl([l.x,l.y],t.canonical)))),i=new Pn(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,uo([a.coordinates],!1,s,i,o));break;case"LineString":o=Math.min(o,uo(a.coordinates,!0,s,i,o));break;case"Polygon":o=Math.min(o,jx(s,a.coordinates,i,o));break}if(o===0)return o}return o}u(Wx,"polygonToGeometryDistance");function Vs(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(Vs,"toSimpleGeometry");var xr=class xr{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 ".concat(e.length-1," instead."));if(gn(e[1])){let n=e[1];if(n.type==="FeatureCollection")return new xr(n,n.features.map(i=>Vs(i.geometry)).flat());if(n.type==="Feature")return new xr(n,Vs(n.geometry));if("type"in n&&"coordinates"in n)return new xr(n,Vs(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 Jx(e,this.geometries);if(e.geometryType()==="LineString")return Zx(e,this.geometries);if(e.geometryType()==="Polygon")return Wx(e,this.geometries)}return NaN}eachChild(){}outputDefined(){return!0}};u(xr,"Distance");var Sn=xr,Jt={"==":mx,"!=":hx,">":gx,"<":dx,">=":bx,"<=":xx,array:He,at:Os,boolean:He,case:Gs,coalesce:oo,collator:ao,format:xn,image:Js,in:Ns,"index-of":Us,interpolate:Xe,"interpolate-hcl":Xe,"interpolate-lab":Xe,length:Zs,let:ro,literal:xt,match:$s,number:He,"number-format":js,object:He,slice:qs,step:Sr,string:He,"to-boolean":gt,"to-color":gt,"to-number":gt,"to-string":gt,var:no,within:vn,distance:Sn},Nt=class Nt{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=Nt.definitions[n];if(!i)return r.error('Unknown expression "'.concat(n,'". If you wanted a literal array, use ["literal", [...]].'),0);let o=Array.isArray(i)?i[0]:i.type,a=Array.isArray(i)?[[i[1],i[2]]]:i.overloads,s=a.filter(([c])=>!Array.isArray(c)||c.length===e.length-1),l=null;for(let[c,p]of s){l=new to(r.registry,po,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 ".concat(c.length," arguments, but found ").concat(f.length," instead."));continue}for(let m=0;m<f.length;m++){let h=Array.isArray(c)?c[m]:c.type,d=f[m];l.concat(m+1).checkSubtype(h,d.type)}if(l.errors.length===0)return new Nt(n,o,p,f)}}if(s.length===1)r.errors.push(...l.errors);else{let p=(s.length?s:a).map(([y])=>Xx(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 ".concat(p,", but found (").concat(f.join(", "),") instead."))}return null}static register(e,r){Nt.definitions=r;for(let n in r)e[n]=Nt}};u(Nt,"CompoundExpression");var tt=Nt;function Ef(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=Jf(e,r,n,o);if(a)throw new se(a);return new K(e/255,r/255,n/255,o,!1)}u(Ef,"rgba");function Ff(t,e){return t in e}u(Ff,"has");function Bs(t,e){let r=e[t];return typeof r>"u"?null:r}u(Bs,"get");function Hx(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(Hx,"binarySearch");function Ot(t){return{type:t}}u(Ot,"varargs");tt.register(Jt,{error:[Rg,[J],(t,[e])=>{throw new se(e.evaluate(t))}],typeof:[J,[j],(t,[e])=>ie(fe(e.evaluate(t)))],"to-rgba":[De(B,4),[$e],(t,[e])=>{let[r,n,i,o]=e.evaluate(t).rgb;return[r*255,n*255,i*255,o]}],rgb:[$e,[B,B,B],Ef],rgba:[$e,[B,B,B,B],Ef],has:{type:q,overloads:[[[J],(t,[e])=>Ff(e.evaluate(t),t.properties())],[[J,br],(t,[e,r])=>Ff(e.evaluate(t),r.evaluate(t))]]},get:{type:j,overloads:[[[J],(t,[e])=>Bs(e.evaluate(t),t.properties())],[[J,br],(t,[e,r])=>Bs(e.evaluate(t),r.evaluate(t))]]},"feature-state":[j,[J],(t,[e])=>Bs(e.evaluate(t),t.featureState||{})],properties:[br,[],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,Ot(B),(t,e)=>{let r=0;for(let n of e)r+=n.evaluate(t);return r}],"*":[B,Ot(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,Ot(B),(t,e)=>Math.min(...e.map(r=>r.evaluate(t)))],max:[B,Ot(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])=>Hx(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)],[Ot(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)],[Ot(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,Ot(j),(t,e)=>e.map(r=>on(r.evaluate(t))).join("")],"resolved-locale":[J,[Lo],(t,[e])=>e.evaluate(t).resolvedLocale()]});function Xx(t){return Array.isArray(t)?"(".concat(t.map(ie).join(", "),")"):"(".concat(ie(t.type),"...)")}u(Xx,"stringifySignature");function po(t){if(t instanceof no)return po(t.boundExpression);if(t instanceof tt&&t.name==="error")return!1;if(t instanceof ao)return!1;if(t instanceof vn)return!1;if(t instanceof Sn)return!1;let e=t instanceof gt||t instanceof He,r=!0;return t.eachChild(n=>{e?r=r&&po(n):r=r&&n instanceof xt}),r?Ro(t)&&Oo(t,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"]):!1}u(po,"isExpressionConstant");function Ro(t){if(t instanceof tt){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 vn||t instanceof Sn)return!1;let e=!0;return t.eachChild(r=>{e&&!Ro(r)&&(e=!1)}),e}u(Ro,"isFeatureConstant");function wn(t){if(t instanceof tt&&t.name==="feature-state")return!1;let e=!0;return t.eachChild(r=>{e&&!wn(r)&&(e=!1)}),e}u(wn,"isStateConstant");function Oo(t,e){if(t instanceof tt&&e.indexOf(t.name)>=0)return!1;let r=!0;return t.eachChild(n=>{r&&!Oo(n,e)&&(r=!1)}),r}u(Oo,"isGlobalPropertyConstant");function Qs(t){return{result:"success",value:t}}u(Qs,"success");function mr(t){return{result:"error",value:t}}u(mr,"error");function bt(t){return t["property-type"]==="data-driven"||t["property-type"]==="cross-faded-data-driven"}u(bt,"supportsPropertyExpression");function ey(t){return!!t.expression&&t.expression.parameters.indexOf("zoom")>-1}u(ey,"supportsZoomExpression");function al(t){return!!t.expression&&t.expression.interpolated}u(al,"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 No(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}u(No,"isFunction$1");function Kx(t){return t}u(Kx,"identityFunction");function ty(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||(al(e)?"exponential":"interval");if(r||e.type==="padding"){let p=r?K.parse:Ke.parse;t=Pr({},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&&!Qg(t.colorSpace))throw new Error('Unknown color space: "'.concat(t.colorSpace,'"'));let s,l,c;if(a==="exponential")s=Lf;else if(a==="interval")s=Qx;else if(a==="categorical"){s=Yx,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=eb;else throw new Error('Unknown function type "'.concat(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,ty(p[h],e)]);let m={name:"linear"};return{kind:"composite",interpolationType:m,interpolationFactor:Xe.interpolationFactor.bind(void 0,m),zoomStops:y.map(h=>h[0]),evaluate({zoom:h},d){return Lf({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:Xe.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?Cn(t.default,e.default):s(t,e,y,l,c)}}}u(ty,"createFunction");function Cn(t,e,r){if(t!==void 0)return t;if(e!==void 0)return e;if(r!==void 0)return r}u(Cn,"coalesce$1");function Yx(t,e,r,n,i){let o=typeof r===i?n[r]:void 0;return Cn(o,t.default,e.default)}u(Yx,"evaluateCategoricalFunction");function Qx(t,e,r){if(W(r)!=="number")return Cn(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=Bo(t.stops.map(o=>o[0]),r);return t.stops[i][1]}u(Qx,"evaluateIntervalFunction");function Lf(t,e,r){let n=t.base!==void 0?t.base:1;if(W(r)!=="number")return Cn(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=Bo(t.stops.map(p=>p[0]),r),a=tb(r,n,t.stops[o][0],t.stops[o+1][0]),s=t.stops[o][1],l=t.stops[o+1][1],c=Ge[e.type]||Kx;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(Lf,"evaluateExponentialFunction");function eb(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=Ke.parse(r);break;default:W(r)!==e.type&&(e.type!=="enum"||!e.values[r])&&(r=void 0)}return Cn(r,t.default,e.default)}u(eb,"evaluateIdentityFunction");function tb(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(tb,"interpolationFactor");var bl=class bl{constructor(e,r){this.expression=e,this._warningHistory={},this._evaluator=new eo,this._defaultValue=r?nb(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 ".concat(Object.keys(this._enumValues).map(l=>JSON.stringify(l)).join(", "),", but found ").concat(JSON.stringify(s)," instead."));return s}catch(s){return this._warningHistory[s.message]||(this._warningHistory[s.message]=!0,typeof console<"u"&&console.warn(s.message)),this._defaultValue}}};u(bl,"StyleExpression");var Gt=bl;function Zt(t){return Array.isArray(t)&&t.length>0&&typeof t[0]=="string"&&t[0]in Jt}u(Zt,"isExpression");function Wt(t,e){let r=new to(Jt,po,[],e?rb(e):void 0),n=r.parse(t,void 0,void 0,void 0,e&&e.type==="string"?{typeAnnotation:"coerce"}:void 0);return n?Qs(new Gt(n,e)):mr(r.errors)}u(Wt,"createExpression");var vl=class vl{constructor(e,r){this.kind=e,this._styleExpression=r,this.isStateDependent=e!=="constant"&&!wn(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)}};u(vl,"ZoomConstantExpression");var vt=vl,Pl=class Pl{constructor(e,r,n,i){this.kind=e,this.zoomStops=n,this._styleExpression=r,this.isStateDependent=e!=="camera"&&!wn(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?Xe.interpolationFactor(this.interpolationType,e,r,n):0}};u(Pl,"ZoomDependentExpression");var Pt=Pl;function ry(t,e){let r=Wt(t,e);if(r.result==="error")return r;let n=r.value.expression,i=Ro(n);if(!i&&!bt(e))return mr([new Ne("","data expressions not supported")]);let o=Oo(n,["zoom"]);if(!o&&!ey(e))return mr([new Ne("","zoom expressions not supported")]);let a=Qi(n);if(!a&&!o)return mr([new Ne("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]);if(a instanceof Ne)return mr([a]);if(a instanceof Xe&&!al(e))return mr([new Ne("",'"interpolate" expressions cannot be used with this property')]);if(!a)return Qs(i?new vt("constant",r.value):new vt("source",r.value));let s=a instanceof Xe?a.interpolation:void 0;return Qs(i?new Pt("camera",r.value,a.labels,s):new Pt("composite",r.value,a.labels,s))}u(ry,"createPropertyExpression");var Fo=class Fo{constructor(e,r){this._parameters=e,this._specification=r,Pr(this,ty(this._parameters,this._specification))}static deserialize(e){return new Fo(e._parameters,e._specification)}static serialize(e){return{_parameters:e._parameters,_specification:e._specification}}};u(Fo,"StylePropertyFunction");var An=Fo;function ny(t,e){if(No(t))return new An(t,e);if(Zt(t)){let r=ry(t,e);if(r.result==="error")throw new Error(r.value.map(n=>"".concat(n.key,": ").concat(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=Ke.parse(t):e.type==="variableAnchorOffsetCollection"&&Array.isArray(t)&&(r=qe.parse(t)),{kind:"constant",evaluate:u(()=>r,"evaluate")}}}u(ny,"normalizePropertyExpression");function Qi(t){let e=null;if(t instanceof ro)e=Qi(t.result);else if(t instanceof oo){for(let r of t.args)if(e=Qi(r),e)break}else(t instanceof Sr||t instanceof Xe)&&t.input instanceof tt&&t.input.name==="zoom"&&(e=t);return e instanceof Ne||t.eachChild(r=>{let n=Qi(r);n instanceof Ne?e=n:!e&&n?e=new Ne("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):e&&n&&e!==n&&(e=new Ne("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),e}u(Qi,"findZoomCurve");function rb(t){let e={color:$e,string:J,number:B,enum:J,boolean:q,formatted:_r,padding:Do,resolvedImage:In,variableAnchorOffsetCollection:Vo};return t.type==="array"?De(e[t.value]||j,t.length):e[t.type]}u(rb,"getExpectedType");function nb(t){return t.type==="color"&&No(t.default)?new K(0,0,0,0):t.type==="color"?K.parse(t.default)||null:t.type==="padding"?Ke.parse(t.default)||null:t.type==="variableAnchorOffsetCollection"?qe.parse(t.default)||null:t.default===void 0?null:t.default}u(nb,"getDefaultValue");function sl(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(!sl(e)&&typeof e!="boolean")return!1;return!0;default:return!0}}u(sl,"isExpressionFilter");var ib={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function kn(t){if(t==null)return{filter:u(()=>!0,"filter"),needGeometry:!1};sl(t)||(t=fo(t));let e=Wt(t,ib);if(e.result==="error")throw new Error(e.value.map(r=>"".concat(r.key,": ").concat(r.message)).join(", "));{let r=iy(t);return{filter:u((n,i,o)=>e.value.evaluate(n,i,{},o),"filter"),needGeometry:r}}}u(kn,"createFilter");function ob(t,e){return t<e?-1:t>e?1:0}u(ob,"compare");function iy(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(iy(t[e]))return!0;return!1}u(iy,"geometryNeeded");function fo(t){if(!t)return!0;let e=t[0];return t.length<=1?e!=="any":e==="=="?zs(t[1],t[2],"=="):e==="!="?Yi(zs(t[1],t[2],"==")):e==="<"||e===">"||e==="<="||e===">="?zs(t[1],t[2],e):e==="any"?ab(t.slice(1)):e==="all"?["all"].concat(t.slice(1).map(fo)):e==="none"?["all"].concat(t.slice(1).map(fo).map(Yi)):e==="in"?Df(t[1],t.slice(2)):e==="!in"?Yi(Df(t[1],t.slice(2))):e==="has"?Vf(t[1]):e==="!has"?Yi(Vf(t[1])):!0}u(fo,"convertFilter$1");function zs(t,e,r){switch(t){case"$type":return["filter-type-".concat(r),e];case"$id":return["filter-id-".concat(r),e];default:return["filter-".concat(r),t,e]}}u(zs,"convertComparisonOp$1");function ab(t){return["any"].concat(t.map(fo))}u(ab,"convertDisjunctionOp");function Df(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(ob)]]:["filter-in-small",t,["literal",e]]}}u(Df,"convertInOp$1");function Vf(t){switch(t){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",t]}}u(Vf,"convertHasOp$1");function Yi(t){return["!",t]}u(Yi,"convertNegation");function el(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+="".concat(el(o),",");return"".concat(i,"]")}let r=Object.keys(t).sort(),n="{";for(let i=0;i<r.length;i++)n+="".concat(JSON.stringify(r[i]),":").concat(el(t[r[i]]),",");return"".concat(n,"}")}u(el,"stringify$1");function sb(t){let e="";for(let r of zg)e+="/".concat(el(t[r]));return e}u(sb,"getKey");function oy(t,e){let r={};for(let i=0;i<t.length;i++){let o=e&&e[t[i].id]||sb(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(oy,"groupByLayout");function ay(t){let e=t.key,r=t.value;return r?[new L(e,r,"constants have been deprecated as of v8")]:[]}u(ay,"validateConstants");function ue(t){return t instanceof Number||t instanceof String||t instanceof Boolean?t.valueOf():t}u(ue,"unbundle");function qt(t){if(Array.isArray(t))return t.map(qt);if(t instanceof Object&&!(t instanceof Number||t instanceof String||t instanceof Boolean)){let e={};for(let r in t)e[r]=qt(t[r]);return e}return ue(t)}u(qt,"deepUnbundle");function Ue(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, ".concat(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 "'.concat(p,'"')));continue}l=l.concat(m({key:(e&&"".concat(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 "'.concat(p,'"')));return l}u(Ue,"validateObject");function ll(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, ".concat(W(e)," found"))];if(r.length&&e.length!==r.length)return[new L(a,e,"array length ".concat(r.length," expected, length ").concat(e.length," found"))];if(r["min-length"]&&e.length<r["min-length"])return[new L(a,e,"array length at least ".concat(r["min-length"]," expected, length ").concat(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:"".concat(a,"[").concat(p,"]")}));return c}u(ll,"validateArray");function ul(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, ".concat(i," found"))]:"minimum"in n&&r<n.minimum?[new L(e,r,"".concat(r," is less than the minimum value ").concat(n.minimum))]:"maximum"in n&&r>n.maximum?[new L(e,r,"".concat(r," is greater than the maximum value ").concat(n.maximum))]:[]}u(ul,"validateNumber");function sy(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=Ue({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&&!al(t.valueSpec)&&p.push(new L(t.key,t.value,"exponential functions not supported")),t.styleSpec.$version>=8&&(l&&!bt(t.valueSpec)?p.push(new L(t.key,t.value,"property functions not supported")):s&&!ey(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(ll({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, ".concat(W(b)," found"))];if(b.length!==2)return[new L(P,b,"array length 2 expected, length ".concat(b.length," found"))];if(c){if(W(b[0])!=="object")return[new L(P,b,"object expected, ".concat(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(Ue({key:"".concat(P,"[0]"),value:b[0],valueSpec:{zoom:{}},validateSpec:d.validateSpec,style:d.style,styleSpec:d.styleSpec,objectElementValidators:{zoom:ul,value:m}}))}else g=g.concat(m({key:"".concat(P,"[0]"),value:b[0],valueSpec:{},validateSpec:d.validateSpec,style:d.style,styleSpec:d.styleSpec},b));return Zt(qt(b[1]))?g.concat([new L("".concat(P,"[1]"),b[1],"expressions are not allowed in function stops.")]):g.concat(d.validateSpec({key:"".concat(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,"".concat(b," stop domain type must match previous stop domain type ").concat(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, ".concat(b," found");return bt(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 ".concat(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(sy,"validateFunction");function wr(t){let e=(t.expressionContext==="property"?ry:Wt)(qt(t.value),t.valueSpec);if(e.result==="error")return e.value.map(n=>new L("".concat(t.key).concat(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 "'.concat(t.propertyKey,'". Output values must be contained as literals within the expression.'))];if(t.expressionContext==="property"&&t.propertyType==="layout"&&!wn(r))return[new L(t.key,t.value,'"feature-state" data expressions are not supported with layout properties.')];if(t.expressionContext==="filter"&&!wn(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(!Oo(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"&&!Ro(r))return[new L(t.key,t.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}u(wr,"validateExpression");function lb(t){let e=t.value,r=t.key,n=W(e);return n!=="boolean"?[new L(r,e,"boolean expected, ".concat(n," found"))]:[]}u(lb,"validateBoolean");function ub(t){let e=t.key,r=t.value,n=W(r);return n!=="string"?[new L(e,r,"color expected, ".concat(n," found"))]:K.parse(String(r))?[]:[new L(e,r,'color expected, "'.concat(r,'" found'))]}u(ub,"validateColor");function _n(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 [".concat(n.values.join(", "),"], ").concat(JSON.stringify(r)," found"))):Object.keys(n.values).indexOf(ue(r))===-1&&i.push(new L(e,r,"expected one of [".concat(Object.keys(n.values).join(", "),"], ").concat(JSON.stringify(r)," found"))),i}u(_n,"validateEnum");function cl(t){return sl(qt(t.value))?wr(Pr({},t,{expressionContext:"filter",valueSpec:{value:"boolean"}})):ly(t)}u(cl,"validateFilter");function ly(t){let e=t.value,r=t.key;if(W(e)!=="array")return[new L(r,e,"array expected, ".concat(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(_n({key:"".concat(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 "'.concat(e[0],'"')));case"==":case"!=":e.length!==3&&o.push(new L(r,e,'filter array for operator "'.concat(e[0],'" must have 3 elements')));case"in":case"!in":e.length>=2&&(i=W(e[1]),i!=="string"&&o.push(new L("".concat(r,"[1]"),e[1],"string expected, ".concat(i," found"))));for(let a=2;a<e.length;a++)i=W(e[a]),ue(e[1])==="$type"?o=o.concat(_n({key:"".concat(r,"[").concat(a,"]"),value:e[a],valueSpec:n.geometry_type,style:t.style,styleSpec:t.styleSpec})):i!=="string"&&i!=="number"&&i!=="boolean"&&o.push(new L("".concat(r,"[").concat(a,"]"),e[a],"string, number, or boolean expected, ".concat(i," found")));break;case"any":case"all":case"none":for(let a=1;a<e.length;a++)o=o.concat(ly({key:"".concat(r,"[").concat(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 "'.concat(e[0],'" operator must have 2 elements'))):i!=="string"&&o.push(new L("".concat(r,"[1]"),e[1],"string expected, ".concat(i," found")));break}return o}u(ly,"validateNonExpressionFilter");function uy(t,e){let r=t.key,n=t.validateSpec,i=t.style,o=t.styleSpec,a=t.value,s=t.objectKey,l=o["".concat(e,"_").concat(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 "'.concat(s,'"'))];let f;if(W(a)==="string"&&bt(p)&&!p.tokens&&(f=/^{([^}]+)}$/.exec(a)))return[new L(r,a,'"'.concat(s,'" does not support interpolation syntax\n')+'Use an identity property function instead: `{ "type": "identity", "property": '.concat(JSON.stringify(f[1])," }`."))];let y=[];return 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"&&No(qt(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(uy,"validateProperty");function cy(t){return uy(t,"paint")}u(cy,"validatePaintProperty");function py(t){return uy(t,"layout")}u(py,"validateLayoutProperty");function fy(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 "'.concat(r.id,'", previously used at line ').concat(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],'"'.concat(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 "'.concat(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 "'.concat(r.id,'" requires a raster source'))):c!=="raster-dem"&&a==="hillshade"?e.push(new L(n,r.source,'layer "'.concat(r.id,'" requires a raster-dem source'))):c==="raster"&&a!=="raster"?e.push(new L(n,r.source,'layer "'.concat(r.id,'" requires a vector source'))):c==="vector"&&!r["source-layer"]?e.push(new L(n,r,'layer "'.concat(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 "'.concat(r.id,'" specifies a line-gradient, which requires a GeoJSON source with `lineMetrics` enabled.'))):e.push(new L(n,r.source,'source "'.concat(r.source,'" not found')))}return e=e.concat(Ue({key:n,value:r,valueSpec:o.layer,style:t.style,styleSpec:t.styleSpec,validateSpec:t.validateSpec,objectElementValidators:{"*"(){return[]},type(){return t.validateSpec({key:"".concat(n,".type"),value:r.type,valueSpec:o.layer.type,style:t.style,styleSpec:t.styleSpec,validateSpec:t.validateSpec,object:r,objectKey:"type"})},filter:cl,layout(l){return Ue({layer:r,key:l.key,value:l.value,style:l.style,styleSpec:l.styleSpec,validateSpec:l.validateSpec,objectElementValidators:{"*"(c){return py(Pr({layerType:a},c))}}})},paint(l){return Ue({layer:r,key:l.key,value:l.value,style:l.style,styleSpec:l.styleSpec,validateSpec:l.validateSpec,objectElementValidators:{"*"(c){return cy(Pr({layerType:a},c))}}})}}})),e}u(fy,"validateLayer");function jt(t){let e=t.value,r=t.key,n=W(e);return n!=="string"?[new L(r,e,"string expected, ".concat(n," found"))]:[]}u(jt,"validateString");function cb(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, ".concat(l," found"))),s;let p=ue(n.encoding)==="custom",f=["redFactor","greenFactor","blueFactor","baseShift"],y=t.value.encoding?'"'.concat(t.value.encoding,'"'):"Default";for(let m in n)!p&&f.includes(m)?s.push(new L(m,n[m],'In "'.concat(r,'": "').concat(m,'" is only valid when "encoding" is set to "custom". ').concat(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 "'.concat(m,'"')));return s}u(cb,"validateRasterDEMSource");var Bf={promoteId:pb};function yy(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=Ue({key:r,value:e,valueSpec:n["source_".concat(a.replace("-","_"))],style:t.style,styleSpec:n,objectElementValidators:Bf,validateSpec:o}),s;case"raster-dem":return s=cb({sourceName:r,value:e,style:t.style,styleSpec:n,validateSpec:o}),s;case"geojson":if(s=Ue({key:r,value:e,valueSpec:n.source_geojson,style:i,styleSpec:n,validateSpec:o,objectElementValidators:Bf}),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(...wr({key:"".concat(r,".").concat(l,".map"),value:p,validateSpec:o,expressionContext:"cluster-map"})),s.push(...wr({key:"".concat(r,".").concat(l,".reduce"),value:f,validateSpec:o,expressionContext:"cluster-reduce"}))}return s;case"video":return Ue({key:r,value:e,valueSpec:n.source_video,style:i,validateSpec:o,styleSpec:n});case"image":return Ue({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 _n({key:"".concat(r,".type"),value:e.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:i,validateSpec:o,styleSpec:n})}}u(yy,"validateSource");function pb({key:t,value:e}){if(W(e)==="string")return jt({key:t,value:e});{let r=[];for(let n in e)r.push(...jt({key:"".concat(t,".").concat(n),value:e[n]}));return r}}u(pb,"validatePromoteId");function my(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, ".concat(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 "'.concat(s,'"'))])}return o}u(my,"validateLight");function hy(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, ".concat(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 "'.concat(s,'"'))]);return a}u(hy,"validateSky");function dy(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, ".concat(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 "'.concat(s,'"'))]);return o}u(dy,"validateTerrain");function fb(t){return jt(t).length===0?[]:wr(t)}u(fb,"validateFormatted");function yb(t){return jt(t).length===0?[]:wr(t)}u(yb,"validateImage");function mb(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; ".concat(r.length," values found"))];let i={type:"number"},o=[];for(let a=0;a<r.length;a++)o=o.concat(t.validateSpec({key:"".concat(e,"[").concat(a,"]"),value:r[a],validateSpec:t.validateSpec,valueSpec:i}));return o}else return ul({key:e,value:r,valueSpec:{}})}u(mb,"validatePadding");function hb(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(_n({key:"".concat(e,"[").concat(a,"]"),value:r[a],valueSpec:i.layout_symbol["text-anchor"]})),o=o.concat(ll({key:"".concat(e,"[").concat(a+1,"]"),value:r[a+1],valueSpec:{length:2,value:"number"},validateSpec:t.validateSpec,style:t.style,styleSpec:i}));return o}u(hb,"validateVariableAnchorOffsetCollection");function gy(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 ".concat(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 ".concat(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(Ue({key:"".concat(n,"[").concat(a,"]"),value:r[a],valueSpec:s,validateSpec:t.validateSpec}))}return e}else return jt({key:n,value:r})}u(gy,"validateSprite");function db(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, ".concat(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 "'.concat(s,'"'))]);return a}u(db,"validateProjection");var zf={"*"(){return[]},array:ll,boolean:lb,number:ul,color:ub,constants:ay,enum:_n,filter:cl,function:sy,layer:fy,object:Ue,source:yy,light:my,sky:hy,terrain:dy,projection:db,string:jt,formatted:fb,resolvedImage:yb,padding:mb,variableAnchorOffsetCollection:hb,sprite:gy};function an(t){let e=t.value,r=t.valueSpec,n=t.styleSpec;return t.validateSpec=an,r.expression&&No(ue(e))?sy(t):r.expression&&Zt(qt(e))?wr(t):r.type&&zf[r.type]?zf[r.type](t):Ue(Pr({},t,{valueSpec:r.type?n[r.type]:r}))}u(an,"validate");function xy(t){let e=t.value,r=t.key,n=jt(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(xy,"validateGlyphsUrl");function je(t,e=_){let r=[];return r=r.concat(an({key:"",value:t,valueSpec:e.$root,styleSpec:e,style:t,validateSpec:an,objectElementValidators:{glyphs:xy,"*"(){return[]}}})),t.constants&&(r=r.concat(ay({key:"constants",value:t.constants,style:t,styleSpec:e,validateSpec:an}))),by(r)}u(je,"validateStyleMin");je.source=nt(rt(yy));je.sprite=nt(rt(gy));je.glyphs=nt(rt(xy));je.light=nt(rt(my));je.sky=nt(rt(hy));je.terrain=nt(rt(dy));je.layer=nt(rt(fy));je.filter=nt(rt(cl));je.paintProperty=nt(rt(cy));je.layoutProperty=nt(rt(py));function rt(t){return function(e){return t({...e,validateSpec:an})}}u(rt,"injectValidateSpec");function by(t){return[].concat(t).sort((e,r)=>e.line-r.line)}u(by,"sortErrors");function nt(t){return function(...e){return by(t.apply(this,e))}}u(nt,"wrapCleanErrors");x();x();var vy="AbortError";function Py(t){return t.message===vy}u(Py,"isAbortError");function Sl(){return new Error(vy)}u(Sl,"createAbortError");x();x();var Uo={MAX_PARALLEL_IMAGE_REQUESTS:16,MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:8,MAX_TILE_CACHE_ZOOM_LEVELS:5,REGISTERED_PROTOCOLS:{},WORKER_URL:""};function Sy(t){return Uo.REGISTERED_PROTOCOLS[t.substring(0,t.indexOf("://"))]}u(Sy,"getProtocol");function wy(t,e){Uo.REGISTERED_PROTOCOLS[t]=e}u(wy,"addProtocol");function Ay(t){delete Uo.REGISTERED_PROTOCOLS[t]}u(Ay,"removeProtocol");x();var _y="global-dispatcher",wl=class wl extends Error{constructor(e,r,n,i){super("AJAXError: ".concat(r," (").concat(e,"): ").concat(n)),this.status=e,this.statusText=r,this.url=n,this.body=i}};u(wl,"AJAXError");var Cr=wl,Ty=u(()=>ct(self)?self.worker&&self.worker.referrer:(window.location.protocol==="blob:"?window.parent:window).location.href,"getReferrer"),gb=u(t=>/^file:/.test(t)||/^file:/.test(Ty())&&!/^\w+:/.test(t),"isFileURL");async function xb(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:Ty(),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 Cr(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 Sl();return{data:o,cacheControl:n.headers.get("Cache-Control"),expires:n.headers.get("Expires")}}u(xb,"makeFetchRequest");function bb(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 Cr(i.status,i.statusText,t.url,o))}},e.signal.addEventListener("abort",()=>{i.abort(),n(Sl())}),i.send(t.body)})}u(bb,"makeXMLHttpRequest");var Cy=u(function(t,e){if(/:\/\//.test(t.url)&&!/^https?:|^file:/.test(t.url)){let r=Sy(t.url);if(r)return r(t,e);if(ct(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:t,targetMapId:_y},e)}if(!gb(t.url)){if(fetch&&Request&&AbortController&&Object.prototype.hasOwnProperty.call(Request.prototype,"signal"))return xb(t,e);if(ct(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:t,mustQueue:!0,targetMapId:_y},e)}return bb(t,e)},"makeRequest"),ky=u((t,e)=>Cy(Ae(t,{type:"json"}),e),"getJSON"),My=u((t,e)=>Cy(Ae(t,{type:"arrayBuffer"}),e),"getArrayBuffer");var St={};function E(t,e,r={}){if(St[t])throw new Error("".concat(t," is already registered."));Object.defineProperty(e,"_classRegistryKey",{value:t,writeable:!1}),St[t]={klass:e,omit:r.omit||[],shallow:r.shallow||[]}}u(E,"register");E("Object",Object);E("TransferableGridIndex",Rt);E("Color",K);E("Error",Error);E("AJAXError",Cr);E("ResolvedImage",Me);E("StylePropertyFunction",An);E("StyleExpression",Gt,{omit:["_evaluator"]});E("ZoomDependentExpression",Pt);E("ZoomConstantExpression",vt);E("CompoundExpression",tt,{omit:["_evaluate"]});for(let t in Jt)Jt[t]._classRegistryKey||E("Expression_".concat(t),Jt[t]);function Ey(t){return t&&typeof ArrayBuffer<"u"&&(t instanceof ArrayBuffer||t.constructor&&t.constructor.name==="ArrayBuffer")}u(Ey,"isArrayBuffer");function kr(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(Ey(t)||tn(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(kr(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 ".concat(r.name));if(!St[n])throw new Error("".concat(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)||St[n].omit.indexOf(o)>=0)continue;let a=t[o];i[o]=St[n].shallow.indexOf(o)>=0?a:kr(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 ".concat(typeof t))}u(kr,"serialize");function Mr(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||Ey(t)||tn(t)||ArrayBuffer.isView(t)||t instanceof ImageData)return t;if(Array.isArray(t))return t.map(Mr);if(typeof t=="object"){let e=t.$name||"Object";if(!St[e])throw new Error("can't deserialize unregistered class ".concat(e));let{klass:r}=St[e];if(!r)throw new Error("can't deserialize unregistered class ".concat(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]=St[e].shallow.indexOf(i)>=0?o:Mr(o)}return n}throw new Error("can't deserialize object of type ".concat(typeof t))}u(Mr,"deserialize");x();var Al=class Al{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=()=>{}}};u(Al,"ThrottledInvoker");var $o=Al;var _l=class _l{constructor(e,r){this.target=e,this.mapId=r,this.resolveRejects={},this.tasks={},this.taskQueue=[],this.abortControllers={},this.messageHandlers={},this.invoker=new $o(()=>this.process()),this.subscription=gf(this.target,"message",n=>this.receive(n),!1),this.globalScope=ct(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:kr(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(ct(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(Mr(r.error)):o.resolve(Mr(r.data));return}if(!this.messageHandlers[r.type]){this.completeTask(e,new Error("Could not find a registered handler for ".concat(r.type,", map ID: ").concat(this.mapId,", available handlers: ").concat(Object.keys(this.messageHandlers).join(", "))));return}let n=Mr(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?kr(r):null,data:kr(n,i)};this.target.postMessage(o,{transfer:i})}remove(){this.invoker.remove(),this.subscription.unsubscribe()}};u(_l,"Actor");var Go=_l;x();x();x();x();x();x();function Fy(t,e,r){r[t]&&r[t].indexOf(e)!==-1||(r[t]=r[t]||[],r[t].push(e))}u(Fy,"_addEventListener");function Il(t,e,r){if(r&&r[t]){let n=r[t].indexOf(e);n!==-1&&r[t].splice(n,1)}}u(Il,"_removeEventListener");var Tl=class Tl{constructor(e,r={}){Ae(this,r),this.type=e}};u(Tl,"Event");var qo=Tl,Cl=class Cl extends qo{constructor(e,r={}){super("error",Ae({error:e},r))}};u(Cl,"ErrorEvent");var Mn=Cl,kl=class kl{on(e,r){return this._listeners=this._listeners||{},Fy(e,r,this._listeners),this}off(e,r){return Il(e,r,this._listeners),Il(e,r,this._oneTimeListeners),this}once(e,r){return r?(this._oneTimeListeners=this._oneTimeListeners||{},Fy(e,r,this._oneTimeListeners),this):new Promise(n=>this.once(e,n))}fire(e,r){typeof e=="string"&&(e=new qo(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)Il(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 Mn&&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}};u(kl,"Evented");var jo=kl;var wt=je,qS=wt.source,jS=wt.light,JS=wt.terrain,ZS=wt.filter,Ly=wt.paintProperty,Dy=wt.layoutProperty;function Vy(t,e){let r=!1;if(e&&e.length)for(let n of e)t.fire(new Mn(new Error(n.message))),r=!0;return r}u(Vy,"emitValidationErrors");x();x();x();var Ml=class Ml{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)}};u(Ml,"ZoomHistory");var Jo=Ml;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 En(t){for(let e of t)if(Zo(e.charCodeAt(0)))return!0;return!1}u(En,"allowsVerticalWritingMode");function By(t){for(let e of t)if(!vb(e.charCodeAt(0)))return!1;return!0}u(By,"allowsLetterSpacing");function vb(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(vb,"charAllowsLetterSpacing");function zy(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(zy,"charAllowsIdeographicBreaking");function Zo(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(Zo,"charHasUprightVerticalOrientation");function Pb(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(Pb,"charHasNeutralVerticalOrientation");function El(t){return!(Zo(t)||Pb(t))}u(El,"charHasRotatedVerticalOrientation");function Ry(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(Ry,"charInComplexShapingScript");function Oy(t){return t>=1424&&t<=2303||z["Arabic Presentation Forms-A"](t)||z["Arabic Presentation Forms-B"](t)}u(Oy,"charInRTLScript");function Sb(t,e){return!(!e&&Oy(t)||t>=2304&&t<=3583||t>=3840&&t<=4255||z.Khmer(t))}u(Sb,"charInSupportedScript");function Ny(t){for(let e of t)if(Oy(e.charCodeAt(0)))return!0;return!1}u(Ny,"stringContainsRTLText");function Uy(t,e){for(let r of t)if(!Sb(r.charCodeAt(0),e))return!1;return!0}u(Uy,"isStringInSupportedScript");x();var Ll=class Ll{constructor(){this.applyArabicShaping=null;this.processBidirectionalText=null;this.processStyledBidirectionalText=null;this.pluginStatus="unavailable";this.pluginURL=null}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}};u(Ll,"RTLWorkerPlugin");var Fl=Ll,de=new Fl;var Dl=class Dl{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 Jo,this.transition={})}isSupportedScript(e){return Uy(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}}};u(Dl,"EvaluationParameters");var Z=Dl;var Vl=class Vl{constructor(e,r){this.property=e,this.value=r,this.expression=ny(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)}};u(Vl,"PropertyValue");var Er=Vl,Bl=class Bl{constructor(e){this.property=e,this.value=new Er(e,void 0)}transitioned(e,r){return new Ho(this.property,this.value,r,Ae({},e.transition,this.transition),e.now)}untransitioned(){return new Ho(this.property,this.value,null,{},0)}};u(Bl,"TransitionablePropertyValue");var Fn=Bl,zl=class zl{constructor(e){this._properties=e,this._values=Object.create(e.defaultTransitionablePropertyValues)}getValue(e){return st(this._values[e].value.value)}setValue(e,r){Object.prototype.hasOwnProperty.call(this._values,e)||(this._values[e]=new Fn(this._values[e].property)),this._values[e].value=new Er(this._values[e].property,r===null?void 0:st(r))}getTransition(e){return st(this._values[e].transition)}setTransition(e,r){Object.prototype.hasOwnProperty.call(this._values,e)||(this._values[e]=new Fn(this._values[e].property)),this._values[e].transition=st(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["".concat(r,"-transition")]=i)}return e}transitioned(e,r){let n=new Xo(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 Xo(this._properties);for(let r of Object.keys(this._values))e._values[r]=this._values[r].untransitioned();return e}};u(zl,"Transitionable");var Wo=zl,Rl=class Rl{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,cf(s))}}else return o}};u(Rl,"TransitioningPropertyValue");var Ho=Rl,Ol=class Ol{constructor(e){this._properties=e,this._values=Object.create(e.defaultTransitioningPropertyValues)}possiblyEvaluate(e,r,n){let i=new At(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}};u(Ol,"Transitioning");var Xo=Ol,Nl=class Nl{constructor(e){this._properties=e,this._values=Object.create(e.defaultPropertyValues)}hasValue(e){return this._values[e].value!==void 0}getValue(e){return st(this._values[e].value)}setValue(e,r){this._values[e]=new Er(this._values[e].property,r===null?void 0:st(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 At(this._properties);for(let o of Object.keys(this._values))i._values[o]=this._values[o].possiblyEvaluate(e,r,n);return i}};u(Nl,"Layout");var Ko=Nl,Ul=class Ul{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)}};u(Ul,"PossiblyEvaluatedPropertyValue");var _e=Ul,$l=class $l{constructor(e){this._properties=e,this._values=Object.create(e.defaultPossiblyEvaluatedValues)}get(e){return this._values[e]}};u($l,"PossiblyEvaluated");var At=$l,Gl=class Gl{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=Ge[i];return o?o(e,r,n):e}};u(Gl,"DataConstantProperty");var O=Gl,ql=class ql{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=Ge[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)}};u(ql,"DataDrivenProperty");var U=ql,jl=class jl extends U{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}};u(jl,"CrossFadedDataDrivenProperty");var ft=jl,Jl=class Jl{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}};u(Jl,"CrossFadedProperty");var Ht=Jl,Zl=class Zl{constructor(e){this.specification=e}possiblyEvaluate(e,r,n,i){return!!e.expression.evaluate(r,null,{},n,i)}interpolate(){return!1}};u(Zl,"ColorRampProperty");var Xt=Zl,Wl=class Wl{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 Er(n,void 0),o=this.defaultTransitionablePropertyValues[r]=new Fn(n);this.defaultTransitioningPropertyValues[r]=o.untransitioned(),this.defaultPossiblyEvaluatedValues[r]=i.possiblyEvaluate({})}}};u(Wl,"Properties");var oe=Wl;E("DataDrivenProperty",U);E("DataConstantProperty",O);E("CrossFadedDataDrivenProperty",ft);E("CrossFadedProperty",Ht);E("ColorRampProperty",Xt);var Yo="-transition",Hl=class Hl extends jo{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 Ko(r.layout)),r.paint)){this._transitionablePaint=new Wo(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 At(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.".concat(this.id,".layout.").concat(e);if(this._validate(Dy,i,e,r,n))return}if(e==="visibility"){this.visibility=r;return}this._unevaluatedLayout.setValue(e,r)}getPaintProperty(e){return e.endsWith(Yo)?this._transitionablePaint.getTransition(e.slice(0,-Yo.length)):this._transitionablePaint.getValue(e)}setPaintProperty(e,r,n={}){if(r!=null){let i="layers.".concat(this.id,".paint.").concat(e);if(this._validate(Ly,i,e,r,n))return!1}if(e.endsWith(Yo))return this._transitionablePaint.setTransition(e.slice(0,-Yo.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),yf(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:Vy(this,e.call(wt,{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)||!bt(r.property.specification))&&(r.value.kind==="source"||r.value.kind==="composite")&&r.value.isStateDependent)return!0}return!1}};u(Hl,"StyleLayer");var ce=Hl;x();x();x();var wb={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array},Xl=class Xl{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}};u(Xl,"Struct");var _t=Xl,Ab=128,_b=5,Kl=class Kl{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*_b),Ab),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")}};u(Kl,"StructArray");var ne=Kl;function te(t,e=1){let r=0,n=0,i=t.map(a=>{let s=Ib(a.type),l=r=$y(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=$y(r,Math.max(n,e));return{members:i,size:o,alignment:e}}u(te,"createLayout");function Ib(t){return wb[t].BYTES_PER_ELEMENT}u(Ib,"sizeOf");function $y(t,e){return Math.ceil(t/e)*e}u($y,"align");var Gy=X(xe(),1);var Yl=class Yl extends ne{_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}};u(Yl,"StructArrayLayout2i4");var Kt=Yl;Kt.prototype.bytesPerElement=4;E("StructArrayLayout2i4",Kt);var Ql=class Ql extends ne{_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}};u(Ql,"StructArrayLayout3i6");var Ln=Ql;Ln.prototype.bytesPerElement=6;E("StructArrayLayout3i6",Ln);var eu=class eu extends ne{_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}};u(eu,"StructArrayLayout4i8");var Qo=eu;Qo.prototype.bytesPerElement=8;E("StructArrayLayout4i8",Qo);var tu=class tu extends ne{_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}};u(tu,"StructArrayLayout2i4i12");var Dn=tu;Dn.prototype.bytesPerElement=12;E("StructArrayLayout2i4i12",Dn);var ru=class ru extends ne{_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}};u(ru,"StructArrayLayout2i4ub8");var Vn=ru;Vn.prototype.bytesPerElement=8;E("StructArrayLayout2i4ub8",Vn);var nu=class nu extends ne{_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}};u(nu,"StructArrayLayout2f8");var It=nu;It.prototype.bytesPerElement=8;E("StructArrayLayout2f8",It);var iu=class iu extends ne{_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}};u(iu,"StructArrayLayout10ui20");var Bn=iu;Bn.prototype.bytesPerElement=20;E("StructArrayLayout10ui20",Bn);var ou=class ou extends ne{_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}};u(ou,"StructArrayLayout4i4ui4i24");var zn=ou;zn.prototype.bytesPerElement=24;E("StructArrayLayout4i4ui4i24",zn);var au=class au extends ne{_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}};u(au,"StructArrayLayout3f12");var Rn=au;Rn.prototype.bytesPerElement=12;E("StructArrayLayout3f12",Rn);var su=class su extends ne{_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}};u(su,"StructArrayLayout1ul4");var On=su;On.prototype.bytesPerElement=4;E("StructArrayLayout1ul4",On);var lu=class lu extends ne{_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}};u(lu,"StructArrayLayout6i1ul2ui20");var Nn=lu;Nn.prototype.bytesPerElement=20;E("StructArrayLayout6i1ul2ui20",Nn);var uu=class uu extends ne{_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}};u(uu,"StructArrayLayout2i2i2i12");var Un=uu;Un.prototype.bytesPerElement=12;E("StructArrayLayout2i2i2i12",Un);var cu=class cu extends ne{_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}};u(cu,"StructArrayLayout2f1f2i16");var ea=cu;ea.prototype.bytesPerElement=16;E("StructArrayLayout2f1f2i16",ea);var pu=class pu extends ne{_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}};u(pu,"StructArrayLayout2ub2f12");var $n=pu;$n.prototype.bytesPerElement=12;E("StructArrayLayout2ub2f12",$n);var fu=class fu extends ne{_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}};u(fu,"StructArrayLayout3ui6");var Gn=fu;Gn.prototype.bytesPerElement=6;E("StructArrayLayout3ui6",Gn);var yu=class yu extends ne{_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}};u(yu,"StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48");var qn=yu;qn.prototype.bytesPerElement=48;E("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",qn);var mu=class mu extends ne{_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}};u(mu,"StructArrayLayout8i15ui1ul2f2ui64");var jn=mu;jn.prototype.bytesPerElement=64;E("StructArrayLayout8i15ui1ul2f2ui64",jn);var hu=class hu extends ne{_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}};u(hu,"StructArrayLayout1f4");var Yt=hu;Yt.prototype.bytesPerElement=4;E("StructArrayLayout1f4",Yt);var du=class du extends ne{_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}};u(du,"StructArrayLayout1ui2f12");var Jn=du;Jn.prototype.bytesPerElement=12;E("StructArrayLayout1ui2f12",Jn);var gu=class gu extends ne{_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}};u(gu,"StructArrayLayout1ul2ui8");var Zn=gu;Zn.prototype.bytesPerElement=8;E("StructArrayLayout1ul2ui8",Zn);var xu=class xu extends ne{_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}};u(xu,"StructArrayLayout2ui4");var Wn=xu;Wn.prototype.bytesPerElement=4;E("StructArrayLayout2ui4",Wn);var bu=class bu extends ne{_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}};u(bu,"StructArrayLayout1ui2");var ta=bu;ta.prototype.bytesPerElement=2;E("StructArrayLayout1ui2",ta);var vu=class vu extends ne{_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}};u(vu,"StructArrayLayout4f16");var Fr=vu;Fr.prototype.bytesPerElement=16;E("StructArrayLayout4f16",Fr);var Pu=class Pu extends _t{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 Gy.default(this.anchorPointX,this.anchorPointY)}};u(Pu,"CollisionBoxStruct");var ra=Pu;ra.prototype.size=20;var Su=class Su extends Nn{get(e){return new ra(this,e)}};u(Su,"CollisionBoxArray");var Hn=Su;E("CollisionBoxArray",Hn);var wu=class wu extends _t{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]}};u(wu,"PlacedSymbolStruct");var na=wu;na.prototype.size=48;var Au=class Au extends qn{get(e){return new na(this,e)}};u(Au,"PlacedSymbolArray");var Xn=Au;E("PlacedSymbolArray",Xn);var _u=class _u extends _t{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]}};u(_u,"SymbolInstanceStruct");var ia=_u;ia.prototype.size=64;var Iu=class Iu extends jn{get(e){return new ia(this,e)}};u(Iu,"SymbolInstanceArray");var Kn=Iu;E("SymbolInstanceArray",Kn);var Tu=class Tu extends Yt{getoffsetX(e){return this.float32[e*1+0]}};u(Tu,"GlyphOffsetArray");var Yn=Tu;E("GlyphOffsetArray",Yn);var Cu=class Cu extends Ln{getx(e){return this.int16[e*3+0]}gety(e){return this.int16[e*3+1]}gettileUnitDistanceFromAnchor(e){return this.int16[e*3+2]}};u(Cu,"SymbolLineVertexArray");var Qn=Cu;E("SymbolLineVertexArray",Qn);var ku=class ku extends _t{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]}};u(ku,"TextAnchorOffsetStruct");var oa=ku;oa.prototype.size=12;var Mu=class Mu extends Jn{get(e){return new oa(this,e)}};u(Mu,"TextAnchorOffsetArray");var ei=Mu;E("TextAnchorOffsetArray",ei);var Eu=class Eu extends _t{get featureIndex(){return this._structArray.uint32[this._pos4+0]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+2]}get bucketIndex(){return this._structArray.uint16[this._pos2+3]}};u(Eu,"FeatureIndexStruct");var aa=Eu;aa.prototype.size=8;var Fu=class Fu extends Zn{get(e){return new aa(this,e)}};u(Fu,"FeatureIndexArray");var ti=Fu;E("FeatureIndexArray",ti);var Lu=class Lu extends Kt{};u(Lu,"PosArray");var sa=Lu;var Du=class Du extends Kt{};u(Du,"CircleLayoutArray");var la=Du,Vu=class Vu extends Kt{};u(Vu,"FillLayoutArray");var ua=Vu,Bu=class Bu extends Dn{};u(Bu,"FillExtrusionLayoutArray");var ca=Bu;var zu=class zu extends Vn{};u(zu,"LineLayoutArray");var pa=zu,Ru=class Ru extends It{};u(Ru,"LineExtLayoutArray");var fa=Ru,Ou=class Ou extends Bn{};u(Ou,"PatternLayoutArray");var yt=Ou,Nu=class Nu extends zn{};u(Nu,"SymbolLayoutArray");var ya=Nu,Uu=class Uu extends Rn{};u(Uu,"SymbolDynamicLayoutArray");var ma=Uu,$u=class $u extends On{};u($u,"SymbolOpacityArray");var ha=$u,Gu=class Gu extends Un{};u(Gu,"CollisionBoxLayoutArray");var ri=Gu;var qu=class qu extends $n{};u(qu,"CollisionVertexArray");var da=qu;var ju=class ju extends Gn{};u(ju,"TriangleIndexArray");var Be=ju,Ju=class Ju extends Wn{};u(Ju,"LineIndexArray");var Tt=Ju;x();var Tb=te([{name:"a_pos",components:2,type:"Int16"}],4);var{members:qy,size:Kw,alignment:Yw}=Tb;x();var Qt=class Qt{constructor(e=[]){this.segments=e}prepareSegment(e,r,n,i){let o=this.segments[this.segments.length-1];return e>Qt.MAX_VERTEX_ARRAY_LENGTH&&he("Max vertices per segment is ".concat(Qt.MAX_VERTEX_ARRAY_LENGTH,": bucket requested ").concat(e)),(!o||o.vertexLength+e>Qt.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 Qt([{vertexOffset:e,primitiveOffset:r,vertexLength:n,primitiveLength:i,vaos:{},sortKey:0}])}};u(Qt,"SegmentVector");var ge=Qt;ge.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1;E("SegmentVector",ge);x();x();function Zu(t,e){return t=lt(Math.floor(t),0,255),e=lt(Math.floor(e),0,255),256*t+e}u(Zu,"packUint8ToFloat");x();var ni=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 Hy=X(Xu(),1);var ba=class ba{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(e,r,n,i){this.ids.push(Wy(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=Wy(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 Ku(n,i,0,n.length-1),r&&r.push(n.buffer,i.buffer),{ids:n,positions:i}}static deserialize(e){let r=new ba;return r.ids=e.ids,r.positions=e.positions,r.indexed=!0,r}};u(ba,"FeaturePositionMap");var ii=ba;function Wy(t){let e=+t;return!isNaN(e)&&e<=Number.MAX_SAFE_INTEGER?e:(0,Hy.default)(String(t))}u(Wy,"getNumericId");function Ku(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;xa(t,o,a),xa(e,3*o,3*a),xa(e,3*o+1,3*a+1),xa(e,3*o+2,3*a+2)}a-r<n-a?(Ku(t,e,r,a),r=a+1):(Ku(t,e,a+1,n),n=a)}}u(Ku,"sort");function xa(t,e,r){let n=t[e];t[e]=t[r],t[r]=n}u(xa,"swap");E("FeaturePositionMap",ii);x();var Yu=class Yu{constructor(e,r){this.gl=e.gl,this.location=r}};u(Yu,"Uniform");var oi=Yu;var Qu=class Qu extends oi{constructor(e,r){super(e,r),this.current=0}set(e){this.current!==e&&(this.current=e,this.gl.uniform1f(this.location,e))}};u(Qu,"Uniform1f");var Lr=Qu;var ec=class ec extends oi{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]))}};u(ec,"Uniform4f");var va=ec,tc=class tc extends oi{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))}};u(tc,"UniformColor");var Pa=tc,I2=new Float32Array(16);function rc(t){return[Zu(255*t.r,255*t.g),Zu(255*t.b,255*t.a)]}u(rc,"packColor");var nc=class nc{constructor(e,r,n){this.value=e,this.uniformNames=r.map(i=>"u_".concat(i)),this.type=n}setUniform(e,r,n){e.set(n.constantOr(this.value))}getBinding(e,r,n){return this.type==="color"?new Pa(e,r):new Lr(e,r)}};u(nc,"ConstantBinder");var er=nc,ic=class ic{constructor(e,r){this.uniformNames=r.map(n=>"u_".concat(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 va(e,r):new Lr(e,r)}};u(ic,"CrossFadedConstantBinder");var Ct=ic,oc=class oc{constructor(e,r,n,i){this.expression=e,this.type=n,this.maxValue=0,this.paintVertexAttributes=r.map(o=>({name:"a_".concat(o),type:"Float32",components:n==="color"?2:1,offset:0})),this.paintVertexArray=new i}populatePaintArray(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=rc(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()}};u(oc,"SourceExpressionBinder");var Ye=oc,ac=class ac{constructor(e,r,n,i,o,a){this.expression=e,this.uniformNames=r.map(s=>"u_".concat(s,"_t")),this.type=n,this.useIntegerZoom=i,this.zoom=o,this.maxValue=0,this.paintVertexAttributes=r.map(s=>({name:"a_".concat(s),type:"Float32",components:n==="color"?4:2,offset:0})),this.paintVertexArray=new a}populatePaintArray(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=rc(n),a=rc(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=lt(this.expression.interpolationFactor(n,this.zoom,this.zoom+1),0,1);e.set(i)}getBinding(e,r,n){return new Lr(e,r)}};u(ac,"CompositeExpressionBinder");var ze=ac,sc=class sc{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,ni.members,this.expression.isStateDependent),this.zoomOutPaintVertexBuffer=e.createVertexBuffer(this.zoomOutPaintVertexArray,ni.members,this.expression.isStateDependent))}destroy(){this.zoomOutPaintVertexBuffer&&this.zoomOutPaintVertexBuffer.destroy(),this.zoomInPaintVertexBuffer&&this.zoomInPaintVertexBuffer.destroy()}};u(sc,"CrossFadedCompositeBinder");var it=sc,lc=class lc{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)||!bt(a.property.specification))continue;let s=Eb(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 Ct(l.value,s):new er(l.value,s,c),i.push("/u_".concat(o));else if(l.kind==="source"||y){let m=Xy(o,c,"source");this.binders[o]=y?new it(l,c,p,r,m,e.id):new Ye(l,s,c,m),i.push("/a_".concat(o))}else{let m=Xy(o,c,"composite");this.binders[o]=new ze(l,s,c,p,r,m),i.push("/z_".concat(o))}}this.cacheKey=i.sort().join("")}getMaxValue(e){let r=this.binders[e];return r instanceof Ye||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 Ye||s instanceof ze||s instanceof it)&&s.populatePaintArray(e,r,n,i,o)}}setConstantPatternPositions(e,r){for(let n in this.binders){let i=this.binders[n];i instanceof Ct&&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 Ye||y instanceof ze||y instanceof it)&&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 er||n instanceof Ct)&&e.push(...n.uniformNames.map(i=>"#define HAS_UNIFORM_".concat(i)))}return e}getBinderAttributes(){let e=[];for(let r in this.binders){let n=this.binders[r];if(n instanceof Ye||n instanceof ze)for(let i=0;i<n.paintVertexAttributes.length;i++)e.push(n.paintVertexAttributes[i].name);else if(n instanceof it)for(let i=0;i<ni.members.length;i++)e.push(ni.members[i].name)}return e}getBinderUniforms(){let e=[];for(let r in this.binders){let n=this.binders[r];if(n instanceof er||n instanceof Ct||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 er||o instanceof Ct||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 it){let i=e.fromScale===2?n.zoomInPaintVertexBuffer:n.zoomOutPaintVertexBuffer;i&&this._buffers.push(i)}else(n instanceof Ye||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 Ye||n instanceof ze||n instanceof it)&&n.upload(e)}this.updatePaintBuffers()}destroy(){for(let e in this.binders){let r=this.binders[e];(r instanceof Ye||r instanceof ze||r instanceof it)&&r.destroy()}}};u(lc,"ProgramConfiguration");var Sa=lc,uc=class uc{constructor(e,r,n=()=>!0){this.programConfigurations={};for(let i of e)this.programConfigurations[i.id]=new Sa(i,r,n);this.needsUpload=!1,this._featureMap=new ii,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()}};u(uc,"ProgramConfigurationSet");var Ee=uc;function Eb(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("".concat(e,"-"),"").replace(/-/g,"_")]}u(Eb,"paintAttributeNames");function Fb(t){return{"line-pattern":{source:yt,composite:yt},"fill-pattern":{source:yt,composite:yt},"fill-extrusion-pattern":{source:yt,composite:yt}}[t]}u(Fb,"getLayoutException");function Xy(t,e,r){let n={color:{source:It,composite:Fr},number:{source:Yt,composite:It}},i=Fb(t);return i&&i[r]||n[e][r]}u(Xy,"layoutType");E("ConstantBinder",er);E("CrossFadedConstantBinder",Ct);E("SourceExpressionBinder",Ye);E("CrossFadedCompositeBinder",it);E("CompositeExpressionBinder",ze);E("ProgramConfiguration",Sa,{omit:["_buffers"]});E("ProgramConfigurationSet",Ee);x();x();x();var Lb=15,cc=Math.pow(2,Lb-1)-1,Ky=-cc-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=lt(s,Ky,cc),a.y=lt(l,Ky,cc),(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 wa(t,e,r,n,i){t.emplaceBack(e*2+(n+1)/2,r*2+(i+1)/2)}u(wa,"addCircleVertex");var pc=class pc{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 la,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,qy),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;wa(this.layoutVertexArray,s,l,-1,-1),wa(this.layoutVertexArray,s,l,1,-1),wa(this.layoutVertexArray,s,l,1,1),wa(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)}};u(pc,"CircleBucket");var tr=pc;E("CircleBucket",tr,{omit:["layers"]});x();var ai=X(xe(),1);function Qy(t,e){for(let r=0;r<t.length;r++)if(Dr(e,t[r]))return!0;for(let r=0;r<e.length;r++)if(Dr(t,e[r]))return!0;return!!yc(t,e)}u(Qy,"polygonIntersectsPolygon");function em(t,e,r){return!!(Dr(t,e)||fc(e,t,r))}u(em,"polygonIntersectsBufferedPoint");function Aa(t,e){if(t.length===1)return Yy(e,t[0]);for(let r=0;r<e.length;r++){let n=e[r];for(let i=0;i<n.length;i++)if(Dr(t,n[i]))return!0}for(let r=0;r<t.length;r++)if(Yy(e,t[r]))return!0;for(let r=0;r<e.length;r++)if(yc(t,e[r]))return!0;return!1}u(Aa,"polygonIntersectsMultiPolygon");function tm(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(Dr(t,i[o]))return!0}if(Db(t,i,r))return!0}return!1}u(tm,"polygonIntersectsBufferedMultiLine");function Db(t,e,r){if(t.length>1){if(yc(t,e))return!0;for(let n=0;n<e.length;n++)if(fc(e[n],t,r))return!0}for(let n=0;n<t.length;n++)if(fc(t[n],e,r))return!0;return!1}u(Db,"lineIntersectsBufferedLine");function yc(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(Vb(n,i,a,s))return!0}}return!1}u(yc,"lineIntersectsLine");function Vb(t,e,r,n){return ut(t,r,n)!==ut(e,r,n)&&ut(t,e,r)!==ut(t,e,n)}u(Vb,"lineSegmentIntersectsLineSegment");function fc(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(mc(t,o,a)<n)return!0}return!1}u(fc,"pointIntersectsBufferedLine");function mc(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(mc,"distToSegmentSquared");function Yy(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(Yy,"multiPolygonContainsPoint");function Dr(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(Dr,"polygonContainsPoint");function rm(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 ai.default(e,r),new ai.default(e,i),new ai.default(n,i),new ai.default(n,r)];if(t.length>2){for(let a of o)if(Dr(t,a))return!0}for(let a=0;a<t.length-1;a++){let s=t[a],l=t[a+1];if(Bb(s,l,o))return!0}return!1}u(rm,"polygonIntersectsBox");function Bb(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=ut(t,e,r[0]);return o!==ut(t,e,r[1])||o!==ut(t,e,r[2])||o!==ut(t,e,r[3])}u(Bb,"edgeIntersectsBox");x();var _a=X(xe(),1);function rr(t,e,r){let n=e.paint.get(t).value;return n.kind==="constant"?n.value:r.programConfigurations.get(e.id).getMaxValue(t)}u(rr,"getMaximumPaintValue");function kt(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}u(kt,"translateDistance");function Mt(t,e,r,n,i){if(!e[0]&&!e[1])return t;let o=_a.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(Mt,"translate");function nm(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 _a.default(0,0):l.sub(s)._unit()._perp(),f=a===i.length-1?new _a.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(nm,"offsetLine");x();var im,zb=u(()=>im=im||new oe({"circle-sort-key":new U(_.layout_circle["circle-sort-key"])}),"getLayout"),om,Rb=u(()=>om=om||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"),am={get paint(){return Rb()},get layout(){return zb()}};x();x();var re=1e-6,Ze=typeof Float32Array<"u"?Float32Array:Array,si=Math.random;var BA=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 li={};ef(li,{add:()=>S0,adjoint:()=>Jb,clone:()=>Nb,copy:()=>Ub,create:()=>Ob,determinant:()=>Zb,equals:()=>I0,exactEquals:()=>_0,frob:()=>P0,fromQuat:()=>p0,fromQuat2:()=>a0,fromRotation:()=>r0,fromRotationTranslation:()=>cm,fromRotationTranslationScale:()=>u0,fromRotationTranslationScaleOrigin:()=>c0,fromScaling:()=>t0,fromTranslation:()=>e0,fromValues:()=>$b,fromXRotation:()=>n0,fromYRotation:()=>i0,fromZRotation:()=>o0,frustum:()=>f0,getRotation:()=>l0,getScaling:()=>pm,getTranslation:()=>s0,identity:()=>lm,invert:()=>jb,lookAt:()=>x0,mul:()=>T0,multiply:()=>um,multiplyScalar:()=>w0,multiplyScalarAndAdd:()=>A0,ortho:()=>d0,orthoNO:()=>ym,orthoZO:()=>g0,perspective:()=>y0,perspectiveFromFieldOfView:()=>h0,perspectiveNO:()=>fm,perspectiveZO:()=>m0,rotate:()=>Xb,rotateX:()=>Kb,rotateY:()=>Yb,rotateZ:()=>Qb,scale:()=>Hb,set:()=>Gb,str:()=>v0,sub:()=>C0,subtract:()=>mm,targetTo:()=>b0,translate:()=>Wb,transpose:()=>qb});x();function Ob(){var t=new Ze(16);return Ze!=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(Ob,"create");function Nb(t){var e=new Ze(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(Nb,"clone");function Ub(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(Ub,"copy");function $b(t,e,r,n,i,o,a,s,l,c,p,f,y,m,h,d){var g=new Ze(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($b,"fromValues");function Gb(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(Gb,"set");function lm(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(lm,"identity");function qb(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(qb,"transpose");function jb(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(jb,"invert");function Jb(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(Jb,"adjoint");function Zb(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(Zb,"determinant");function um(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(um,"multiply");function Wb(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(Wb,"translate");function Hb(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(Hb,"scale");function Xb(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(Xb,"rotate");function Kb(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(Kb,"rotateX");function Yb(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(Yb,"rotateY");function Qb(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(Qb,"rotateZ");function e0(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(e0,"fromTranslation");function t0(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(t0,"fromScaling");function r0(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(r0,"fromRotation");function n0(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(n0,"fromXRotation");function i0(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(i0,"fromYRotation");function o0(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(o0,"fromZRotation");function cm(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(cm,"fromRotationTranslation");function a0(t,e){var r=new Ze(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),cm(t,e,r),t}u(a0,"fromQuat2");function s0(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t}u(s0,"getTranslation");function pm(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(pm,"getScaling");function l0(t,e){var r=new Ze(3);pm(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(l0,"getRotation");function u0(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(u0,"fromRotationTranslationScale");function c0(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(c0,"fromRotationTranslationScaleOrigin");function p0(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(p0,"fromQuat");function f0(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(f0,"frustum");function fm(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(fm,"perspectiveNO");var y0=fm;function m0(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(m0,"perspectiveZO");function h0(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(h0,"perspectiveFromFieldOfView");function ym(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(ym,"orthoNO");var d0=ym;function g0(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(g0,"orthoZO");function x0(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?lm(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(x0,"lookAt");function b0(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(b0,"targetTo");function v0(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(v0,"str");function P0(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(P0,"frob");function S0(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(S0,"add");function mm(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(mm,"subtract");function w0(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(w0,"multiplyScalar");function A0(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(A0,"multiplyScalarAndAdd");function _0(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(_0,"exactEquals");function I0(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(I0,"equals");var T0=um,C0=mm;var nr={};ef(nr,{add:()=>L0,ceil:()=>D0,clone:()=>k0,copy:()=>E0,create:()=>hm,cross:()=>j0,dist:()=>nv,distance:()=>bm,div:()=>rv,divide:()=>xm,dot:()=>q0,equals:()=>Q0,exactEquals:()=>Y0,floor:()=>V0,forEach:()=>sv,fromValues:()=>M0,inverse:()=>$0,len:()=>ov,length:()=>Pm,lerp:()=>J0,max:()=>z0,min:()=>B0,mul:()=>tv,multiply:()=>gm,negate:()=>U0,normalize:()=>G0,random:()=>Z0,round:()=>R0,scale:()=>O0,scaleAndAdd:()=>N0,set:()=>F0,sqrDist:()=>iv,sqrLen:()=>av,squaredDistance:()=>vm,squaredLength:()=>Sm,str:()=>K0,sub:()=>ev,subtract:()=>dm,transformMat4:()=>W0,transformQuat:()=>H0,zero:()=>X0});x();function hm(){var t=new Ze(4);return Ze!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}u(hm,"create");function k0(t){var e=new Ze(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}u(k0,"clone");function M0(t,e,r,n){var i=new Ze(4);return i[0]=t,i[1]=e,i[2]=r,i[3]=n,i}u(M0,"fromValues");function E0(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}u(E0,"copy");function F0(t,e,r,n,i){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t}u(F0,"set");function L0(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(L0,"add");function dm(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(dm,"subtract");function gm(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(gm,"multiply");function xm(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(xm,"divide");function D0(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(D0,"ceil");function V0(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(V0,"floor");function B0(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(B0,"min");function z0(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(z0,"max");function R0(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(R0,"round");function O0(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(O0,"scale");function N0(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(N0,"scaleAndAdd");function bm(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(bm,"distance");function vm(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(vm,"squaredDistance");function Pm(t){var e=t[0],r=t[1],n=t[2],i=t[3];return Math.hypot(e,r,n,i)}u(Pm,"length");function Sm(t){var e=t[0],r=t[1],n=t[2],i=t[3];return e*e+r*r+n*n+i*i}u(Sm,"squaredLength");function U0(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t}u(U0,"negate");function $0(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($0,"inverse");function G0(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(G0,"normalize");function q0(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]}u(q0,"dot");function j0(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(j0,"cross");function J0(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(J0,"lerp");function Z0(t,e){e=e||1;var r,n,i,o,a,s;do r=si()*2-1,n=si()*2-1,a=r*r+n*n;while(a>=1);do i=si()*2-1,o=si()*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(Z0,"random");function W0(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(W0,"transformMat4");function H0(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(H0,"transformQuat");function X0(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t}u(X0,"zero");function K0(t){return"vec4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"}u(K0,"str");function Y0(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]}u(Y0,"exactEquals");function Q0(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(Q0,"equals");var ev=dm,tv=gm,rv=xm,nv=bm,iv=vm,ov=Pm,av=Sm,sv=function(){var t=hm();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 wm=X(xe(),1);var hc=class hc extends ce{constructor(e){super(e,am)}createBucket(e){return new tr(e)}queryRadius(e){let r=e;return rr("circle-radius",this,r)+rr("circle-stroke-width",this,r)+kt(this.paint.get("circle-translate"))}queryIntersectsFeature(e,r,n,i,o,a,s,l){let c=Mt(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:lv(c,l),d=m?y*s:y;for(let g of i)for(let b of g){let P=m?b:Am(b,l),v=d,S=nr.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]),em(h,P,v))return!0}return!1}};u(hc,"CircleStyleLayer");var Ia=hc;function Am(t,e){let r=nr.transformMat4([],[t.x,t.y,0,1],e);return new wm.default(r[0]/r[3],r[1]/r[3])}u(Am,"projectPoint");function lv(t,e){return t.map(r=>Am(r,e))}u(lv,"projectQueryGeometry");x();x();var dc=class dc extends tr{};u(dc,"HeatmapBucket");var ui=dc;E("HeatmapBucket",ui,{omit:["layers"]});x();var _m,uv=u(()=>_m=_m||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 Xt(_.paint_heatmap["heatmap-color"]),"heatmap-opacity":new O(_.paint_heatmap["heatmap-opacity"])}),"getPaint"),Im={get paint(){return uv()}};x();x();function gc(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: ".concat(i.length," but got: ").concat(e*r*n));return t.width=e,t.height=r,t.data=i,t}u(gc,"createImage");function Tm(t,{width:e,height:r},n){if(e===t.width&&r===t.height)return;let i=gc({},{width:e,height:r},n);xc(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(Tm,"resizeImage");function xc(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(xc,"copyImage");var Ta=class Ta{constructor(e,r){gc(this,e,1,r)}resize(e){Tm(this,e,1)}clone(){return new Ta({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(e,r,n,i,o){xc(e,r,n,i,o,1)}};u(Ta,"AlphaImage");var ir=Ta,Ca=class Ca{constructor(e,r){gc(this,e,4,r)}resize(e){Tm(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 Ca({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(e,r,n,i,o){xc(e,r,n,i,o,4)}};u(Ca,"RGBAImage");var be=Ca;E("AlphaImage",ir);E("RGBAImage",be);function Cm(t){let e={},r=t.resolution||256,n=t.clips?t.clips.length:1,i=t.image||new be({width:r,height:n});if(!ff(r))throw new Error("width is not a power of 2 - ".concat(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(Cm,"renderColorRamp");var bc=class bc extends ce{createBucket(e){return new ui(e)}constructor(e){super(e,Im),this._updateColorRamp()}_handleSpecialPaintPropertyUpdate(e){e==="heatmap-color"&&this._updateColorRamp()}_updateColorRamp(){let e=this._transitionablePaint._values["heatmap-color"].value.expression;this.colorRamp=Cm({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"}};u(bc,"HeatmapStyleLayer");var ka=bc;x();x();var km,cv=u(()=>km=km||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"),Mm={get paint(){return cv()}};var vc=class vc extends ce{constructor(e){super(e,Mm)}hasOffscreenPass(){return this.paint.get("hillshade-exaggeration")!==0&&this.visibility!=="none"}};u(vc,"HillshadeStyleLayer");var Ma=vc;x();x();x();var pv=te([{name:"a_pos",components:2,type:"Int16"}],4);var{members:Em,size:Y_,alignment:Q_}=pv;var zm=X(_c(),1);x();x();function Ic(t,e,r,n,i){Bm(t,e,r||0,n||t.length-1,i||Tv)}u(Ic,"quickselect");function Bm(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));Bm(t,e,p,f,i)}var y=t[e],m=r,h=n;for(yi(t,r,e),i(t[n],y)>0&&yi(t,r,n);m<h;){for(yi(t,m,h),m++,h--;i(t[m],y)<0;)m++;for(;i(t[h],y)>0;)h--}i(t[r],y)===0?yi(t,r,h):(h++,yi(t,h,n)),h<=e&&(r=h+1),e<=h&&(n=h-1)}}u(Bm,"quickselectStep");function yi(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}u(yi,"swap");function Tv(t,e){return t<e?-1:t>e?1:0}u(Tv,"defaultCompare");function Br(t,e){let r=t.length;if(r<=1)return[t];let n=[],i,o;for(let a=0;a<r;a++){let s=hf(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||(Ic(n[a],e,1,n[a].length-1,Cv),n[a]=n[a].slice(0,e));return n}u(Br,"classifyRings");function Cv(t,e){return e.area-t.area}u(Cv,"compareAreas");x();function zr(t,e,r){let n=r.patternDependencies,i=!1;for(let o of e){let a=o.paint.get("".concat(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(zr,"hasPattern");function Rr(t,e,r,n,i){let o=i.patternDependencies;for(let a of e){let l=a.paint.get("".concat(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(Rr,"addPatternDependencies");var kv=500,Tc=class Tc{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 ua,this.indexArray=new Be,this.indexArray2=new Tt,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=zr("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=Rr("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,Em),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 Br(r,kv)){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,zm.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)}};u(Tc,"FillBucket");var ar=Tc;E("FillBucket",ar,{omit:["layers","patternFeatures"]});x();var Rm,Mv=u(()=>Rm=Rm||new oe({"fill-sort-key":new U(_.layout_fill["fill-sort-key"])}),"getLayout"),Om,Ev=u(()=>Om=Om||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 ft(_.paint_fill["fill-pattern"])}),"getPaint"),Nm={get paint(){return Ev()},get layout(){return Mv()}};var Cc=class Cc extends ce{constructor(e){super(e,Nm)}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 ar(e)}queryRadius(){return kt(this.paint.get("fill-translate"))}queryIntersectsFeature(e,r,n,i,o,a,s){let l=Mt(e,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),a.angle,s);return Aa(l,i)}isTileClipped(){return!0}};u(Cc,"FillStyleLayer");var Va=Cc;x();x();x();var Fv=te([{name:"a_pos",components:2,type:"Int16"},{name:"a_normal_ed",components:4,type:"Int16"}],4),Um=te([{name:"a_centroid",components:2,type:"Int16"}],4);var{members:$m,size:XI,alignment:KI}=Fv;var Wm=X(_c(),1),Hm=X(Et(),1);var qv=Hm.default.VectorTileFeature.types,jv=500,Ec=Math.pow(2,13);function mi(t,e,r,n,i,o,a,s){t.emplaceBack(e,r,Math.floor(n*Ec)*2+a,i*Ec*2,o*Ec*2,Math.round(s))}u(mi,"addVertex");var Fc=class Fc{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 ca,this.centroidVertexArray=new sa,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=zr("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(Rr("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,$m),this.centroidVertexBuffer=e.createVertexBuffer(this.centroidVertexArray,Um.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 Br(r,jv)){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||Zv(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(!Jv(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),mi(this.layoutVertexArray,b.x,b.y,v.x,v.y,0,0,d),mi(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,mi(this.layoutVertexArray,P.x,P.y,v.x,v.y,0,0,d),mi(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)),qv[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];mi(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,Wm.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)}};u(Fc,"FillExtrusionBucket");var sr=Fc;E("FillExtrusionBucket",sr,{omit:["layers","features"]});function Jv(t,e){return t.x===e.x&&(t.x<0||t.x>8192)||t.y===e.y&&(t.y<0||t.y>8192)}u(Jv,"isBoundaryEdge");function Zv(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(Zv,"isEntirelyOutside");x();var Xm,Wv=u(()=>Xm=Xm||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 ft(_["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"),Km={get paint(){return Wv()}};var za=X(xe(),1);var Lc=class Lc extends ce{constructor(e){super(e,Km)}createBucket(e){return new sr(e)}queryRadius(){return kt(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}queryIntersectsFeature(e,r,n,i,o,a,s,l){let c=Mt(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=Kv(c,l,a,0),m=Xv(i,f,p,l),h=m[0],d=m[1];return Hv(h,d,y)}};u(Lc,"FillExtrusionStyleLayer");var Ra=Lc;function hi(t,e){return t.x*e.x+t.y*e.y}u(hi,"dot");function Ym(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=hi(s,s),f=hi(s,l),y=hi(l,l),m=hi(c,s),h=hi(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(Ym,"getIntersectionDistance");function Hv(t,e,r){let n=1/0;Aa(r,e)&&(n=Ym(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];Qy(r,y)&&(n=Math.min(n,Ym(r,y)))}}return n===1/0?!1:n}u(Hv,"checkIntersection");function Xv(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 za.default(V/k,D/k);$.z=C/k,d.push($);let G=new za.default(F/N,R/N);G.z=T/N,g.push(G)}i.push(d),o.push(g)}return[i,o]}u(Xv,"projectExtrusion");function Kv(t,e,r,n){let i=[];for(let o of t){let a=[o.x,o.y,n,1];nr.transformMat4(a,a,e),i.push(new za.default(a[0]/a[3],a[1]/a[3]))}return i}u(Kv,"projectQueryGeometry");x();x();x();var Yv=te([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}],4),{members:Qm,size:ZT,alignment:WT}=Yv;x();var Qv=te([{name:"a_uv_x",components:1,type:"Float32"},{name:"a_split_index",components:1,type:"Float32"}]),{members:eh,size:YT,alignment:QT}=Qv;var nh=X(Et(),1);var e1=nh.default.VectorTileFeature.types,th=63,t1=Math.cos(75/2*(Math.PI/180)),r1=15,n1=20,i1=15,ih=1/2,rh=Math.pow(2,i1-1)/ih,Dc=class Dc{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 pa,this.layoutVertexArray2=new fa,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=zr("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=Rr("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,eh)),this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Qm),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=e1[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?r1*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<t1&&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/n1);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>rh/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*(rh-1):this.scaledDistance)*ih;if(this.layoutVertexArray.emplaceBack((e<<1)+(o?1:0),(r<<1)+(a?1:0),Math.round(th*n)+128,Math.round(th*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()}};u(Dc,"LineBucket");var lr=Dc;E("LineBucket",lr,{omit:["layers","patternFeatures"]});x();var oh,o1=u(()=>oh=oh||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"),ah,a1=u(()=>ah=ah||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 Ht(_.paint_line["line-dasharray"]),"line-pattern":new ft(_.paint_line["line-pattern"]),"line-gradient":new Xt(_.paint_line["line-gradient"])}),"getPaint"),Vc={get paint(){return a1()},get layout(){return o1()}};var zc=class zc extends U{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)}};u(zc,"LineFloorwidthProperty");var Bc=zc,Oa,Rc=class Rc extends ce{constructor(e){super(e,Vc),this.gradientVersion=0,Oa||(Oa=new Bc(Vc.paint.properties["line-width"].specification),Oa.useIntegerZoom=!0)}_handleSpecialPaintPropertyUpdate(e){if(e==="line-gradient"){let r=this.gradientExpression();Zt(r)?this.stepInterpolant=r._styleExpression.expression instanceof Sr: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"]=Oa.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,e)}createBucket(e){return new lr(e)}queryRadius(e){let r=e,n=sh(rr("line-width",this,r),rr("line-gap-width",this,r)),i=rr("line-offset",this,r);return n/2+Math.abs(i)+kt(this.paint.get("line-translate"))}queryIntersectsFeature(e,r,n,i,o,a,s){let l=Mt(e,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),a.angle,s),c=s/2*sh(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=nm(i,p*s)),tm(l,i,c)}isTileClipped(){return!0}};u(Rc,"LineStyleLayer");var Na=Rc;function sh(t,e){return e>0?e+2*t:t}u(sh,"getLineWidth");x();x();x();var lh=te([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),uh=te([{name:"a_projected_pos",components:3,type:"Float32"}],4),GC=te([{name:"a_fade_opacity",components:1,type:"Uint32"}],4),ch=te([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}]),qC=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"}]),Oc=te([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),jC=te([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4),JC=te([{name:"triangle",components:3,type:"Uint16"}]),ZC=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"}]),WC=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"}]),HC=te([{type:"Float32",name:"offsetX"}]),XC=te([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]),KC=te([{type:"Uint16",name:"textAnchor"},{type:"Float32",components:2,name:"textOffset"}]);var wi=X(xe(),1);x();function s1(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(s1,"transformTextInternal");function ph(t,e,r){return t.sections.forEach(n=>{n.text=s1(n.text,e,r)}),t}u(ph,"transformText");x();function fh(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"".concat(c,":").concat(y.x,":").concat(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(fh,"mergeLines");x();x();var Nr={"!":"\uFE15","#":"\uFF03",$:"\uFF04","%":"\uFF05","&":"\uFF06","(":"\uFE35",")":"\uFE36","*":"\uFF0A","+":"\uFF0B",",":"\uFE10","-":"\uFE32",".":"\u30FB","/":"\uFF0F",":":"\uFE13",";":"\uFE14","<":"\uFE3F","=":"\uFF1D",">":"\uFE40","?":"\uFE16","@":"\uFF20","[":"\uFE47","\\":"\uFF3C","]":"\uFE48","^":"\uFF3E",_:"\uFE33","`":"\uFF40","{":"\uFE37","|":"\u2015","}":"\uFE38","~":"\uFF5E","\xA2":"\uFFE0","\xA3":"\uFFE1","\xA5":"\uFFE5","\xA6":"\uFFE4","\xAC":"\uFFE2","\xAF":"\uFFE3","\u2013":"\uFE32","\u2014":"\uFE31","\u2018":"\uFE43","\u2019":"\uFE44","\u201C":"\uFE41","\u201D":"\uFE42","\u2026":"\uFE19","\u2027":"\u30FB","\u20A9":"\uFFE6","\u3001":"\uFE11","\u3002":"\uFE12","\u3008":"\uFE3F","\u3009":"\uFE40","\u300A":"\uFE3D","\u300B":"\uFE3E","\u300C":"\uFE41","\u300D":"\uFE42","\u300E":"\uFE43","\u300F":"\uFE44","\u3010":"\uFE3B","\u3011":"\uFE3C","\u3014":"\uFE39","\u3015":"\uFE3A","\u3016":"\uFE17","\u3017":"\uFE18","\uFF01":"\uFE15","\uFF08":"\uFE35","\uFF09":"\uFE36","\uFF0C":"\uFE10","\uFF0D":"\uFE32","\uFF0E":"\u30FB","\uFF1A":"\uFE13","\uFF1B":"\uFE14","\uFF1C":"\uFE3F","\uFF1E":"\uFE40","\uFF1F":"\uFE16","\uFF3B":"\uFE47","\uFF3D":"\uFE48","\uFF3F":"\uFE33","\uFF5B":"\uFE37","\uFF5C":"\u2015","\uFF5D":"\uFE38","\uFF5F":"\uFE35","\uFF60":"\uFE36","\uFF61":"\uFE12","\uFF62":"\uFE41","\uFF63":"\uFE42"};function yh(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||!El(n)||Nr[t[r+1]])&&(!i||!El(i)||Nr[t[r-1]])&&Nr[t[r]]?e+=Nr[t[r]]:e+=t[r]}return e}u(yh,"verticalizePunctuation");x();var ae=24;x();var _1=X(di(),1);var I1=3;var Ga=I1;x();x();function gi(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(gi,"potpack");var ve=1;var $c=class $c{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]}};u($c,"ImagePosition");var qa=$c,Gc=class Gc{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}=gi(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 qa(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})}};u(Gc,"ImageAtlas");var xi=Gc;E("ImagePosition",qa);E("ImageAtlas",xi);var Za=(i=>(i[i.none=0]="none",i[i.horizontal=1]="horizontal",i[i.vertical=2]="vertical",i[i.horizontalOnly=3]="horizontalOnly",i))(Za||{}),Gr=-17;function T1(t){for(let e of t)if(e.positionedGlyphs.length!==0)return!1;return!0}u(T1,"isEmpty");var vh=57344,Ph=63743,vi=class vi{constructor(){this.scale=1,this.fontStack="",this.imageName=null}static forText(e,r){let n=new vi;return n.scale=e||1,n.fontStack=r,n}static forImage(e){let r=new vi;return r.imageName=e,r}};u(vi,"SectionOptions");var ja=vi,Pi=class Pi{constructor(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null}static fromFeature(e,r){let n=new Pi;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=yh(this.text)}trim(){let e=0;for(let n=0;n<this.text.length&&Ja[this.text.charCodeAt(n)];n++)e++;let r=this.text.length;for(let n=this.text.length-1;n>=0&&n>=e&&Ja[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 Pi;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(ja.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 ".concat(Ph-vh+2));return}this.text+=String.fromCharCode(n),this.sections.push(ja.forImage(r)),this.sectionIndex.push(this.sections.length-1)}getNextImageSectionCharCode(){return this.imageSectionID?this.imageSectionID>=Ph?null:++this.imageSectionID:(this.imageSectionID=vh,this.imageSectionID)}};u(Pi,"TaggedString");var bi=Pi;function C1(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(C1,"breakLines");function Si(t,e,r,n,i,o,a,s,l,c,p,f,y,m,h,d){let g=bi.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(),qc(g,c,o,e,n,m,h));for(let M of I){let V=new bi;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,qc(g,c,o,e,n,m,h));for(let M of I){let V=new bi;V.text=M[0],V.sectionIndex=M[1],V.sections=g.sections,b.push(V)}}else b=C1(g,qc(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 F1(w,e,r,n,b,a,s,l,f,c,y,d),T1(S)?!1:w}u(Si,"shapeText");var Ja={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},k1={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 Ah(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(Ah,"getGlyphAdvance");function M1(t,e,r,n,i,o){let a=0;for(let l=0;l<t.length();l++){let c=t.getSection(l);a+=Ah(t.getCharCode(l),c,n,i,e,o)}let s=Math.max(1,Math.ceil(a/r));return a/s}u(M1,"determineAverageLineWidth");function Sh(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(Sh,"calculateBadness");function E1(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(E1,"calculatePenalty");function wh(t,e,r,n,i,o){let a=null,s=Sh(e,r,i,o);for(let l of n){let c=e-l.x,p=Sh(c,r,i,o)+l.badness;p<=s&&(a=l,s=p)}return{index:t,x:e,priorBreak:a,badness:s}}u(wh,"evaluateBreak");function _h(t){return t?_h(t.priorBreak).concat(t.index):[]}u(_h,"leastBadBreaks");function qc(t,e,r,n,i,o,a){if(o!=="point")return[];if(!t)return[];let s=[],l=M1(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(Ja[m]||(p+=Ah(m,y,n,i,e,a)),f<t.length()-1){let h=zy(m);(k1[m]||h||y.imageName)&&s.push(wh(f+1,p,l,s,E1(m,t.getCharCode(f+1),h&&c),!1))}}return _h(wh(t.length(),p,l,s,0,!0))}u(qc,"determineLineBreaks");function Ih(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(Ih,"getAnchorAlignment");function F1(t,e,r,n,i,o,a,s,l,c,p,f){let y=0,m=Gr,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&&!Zo(N)||p&&(Ja[N]||Ry(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:-Ga,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),L1(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-Gr,{horizontalAlign:v,verticalAlign:S}=Ih(a);D1(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(F1,"shapeLines");function L1(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(L1,"justifyLine");function D1(t,e,r,n,i,o,a,s,l){let c=(e-r)*i,p=0;o!==a?p=-s*n-Gr:p=(-n*l+.5)*a;for(let f of t)for(let y of f.positionedGlyphs)y.x+=c,y.y+=p}u(D1,"align");function Th(t,e,r){let{horizontalAlign:n,verticalAlign:i}=Ih(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(Th,"shapeIcon");function jc(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(jc,"fitIconToText");var Ch=X(Et(),1);x();var qr=255,Ft=128,ot=qr*Ft;function Jc(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(Jc,"getSizeData");x();function Zc(t,e,r){let n="never",i=t.get(e);return i?n=i:t.get(r)&&(n="always"),n}u(Zc,"getOverlapMode");var V1=Ch.default.VectorTileFeature.types,B1=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function Wa(t,e,r,n,i,o,a,s,l,c,p,f,y){let m=s?Math.min(ot,Math.round(s[0])):0,h=s?Math.min(ot,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(Wa,"addVertex");function kh(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(kh,"addDynamicAttributes");function z1(t){for(let e of t.sections)if(Ny(e.text))return!0;return!1}u(z1,"containsRTLText");var Wc=class Wc{constructor(e){this.layoutVertexArray=new ya,this.indexArray=new Be,this.programConfigurations=e,this.segments=new ge,this.dynamicLayoutVertexArray=new ma,this.opacityVertexArray=new ha,this.hasVisibleVertices=!1,this.placedSymbolArray=new Xn}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,lh.members),this.indexBuffer=e.createIndexBuffer(this.indexArray,r),this.dynamicLayoutVertexBuffer=e.createVertexBuffer(this.dynamicLayoutVertexArray,uh.members,!0),this.opacityVertexBuffer=e.createVertexBuffer(this.opacityVertexArray,B1,!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())}};u(Wc,"SymbolBuffers");var Ai=Wc;E("SymbolBuffers",Ai);var Hc=class Hc{constructor(e,r,n){this.layoutVertexArray=new e,this.layoutAttributes=r,this.indexArray=new n,this.segments=new ge,this.collisionVertexArray=new da}upload(e){this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=e.createVertexBuffer(this.collisionVertexArray,ch.members,!0)}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy())}};u(Hc,"CollisionBuffers");var _i=Hc;E("CollisionBuffers",_i);var Xc=class Xc{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=li.identity([]),this.placementViewportMatrix=li.identity([]);let n=this.layers[0]._unevaluatedLayout._values;this.textSizeData=Jc(this.zoom,n["text-size"]),this.iconSizeData=Jc(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=Zc(i,"text-overlap","text-allow-overlap")!=="never"||Zc(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=>Za[l])),this.stateDependentLayerIds=this.layers.filter(l=>l.isStateDependent()).map(l=>l.id),this.sourceID=e.sourceID}createArrays(){this.text=new Ai(new Ee(this.layers,this.zoom,e=>/^text/.test(e))),this.icon=new Ai(new Ee(this.layers,this.zoom,e=>/^icon/.test(e))),this.glyphOffsetArray=new Yn,this.lineVertexArray=new Qn,this.symbolInstances=new Kn,this.textAnchorOffsets=new ei}calculateGlyphDependencies(e,r,n,i,o){for(let a=0;a<e.length;a++)if(r[e.charCodeAt(a)]=!0,(n||i)&&o){let s=Nr[e.charAt(a)];s&&(r[s.charCodeAt(0)]=!0)}}populate(e,r,n){let i=this.layers[0],o=i.layout,a=o.get("text-font"),s=o.get("text-field"),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||z1(k);(!F||de.getRTLTextPluginStatus()==="unavailable"||F&&de.isParsed())&&(I=ph(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:V1[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=En(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=fh(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];Wa(h,l.x,l.y,w.x,ee+w.y,D.x,D.y,n,N,C.x,C.y,F,R),Wa(h,l.x,l.y,I.x,ee+I.y,D.x+D.w,D.y,n,N,k.x,C.y,F,R),Wa(h,l.x,l.y,M.x,ee+M.y,D.x,D.y+D.h,n,N,C.x,k.y,F,R),Wa(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),kh(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 wi.default(e,r)),this._addCollisionDebugVertex(p,f,a,y,m,new wi.default(n,r)),this._addCollisionDebugVertex(p,f,a,y,m,new wi.default(n,i)),this._addCollisionDebugVertex(p,f,a,y,m,new wi.default(e,i)),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 _i(ri,Oc.members,Tt),this.iconCollisionBox=new _i(ri,Oc.members,Tt);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)}}};u(Xc,"SymbolBucket");var Qe=Xc;E("SymbolBucket",Qe,{omit:["layers","collisionBoxArray","features","compareText"]});Qe.MAX_GLYPHS=65535;Qe.addDynamicAttributes=kh;x();function Mh(t,e){return e.replace(/{([^{}]+)}/g,(r,n)=>t&&n in t?String(t[n]):"")}u(Mh,"resolveTokens");x();var Eh,R1=u(()=>Eh=Eh||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"),Fh,O1=u(()=>Fh=Fh||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:$e,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"),Ha={get paint(){return O1()},get layout(){return R1()}};x();var Kc=class Kc{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:Ar,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}};u(Kc,"FormatSectionOverride");var Ii=Kc;E("FormatSectionOverride",Ii,{omit:["defaultValue"]});var Ti=class Ti extends ce{constructor(e){super(e,Ha)}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()&&!Zt(a.value)&&o?Mh(r.properties,o):o}createBucket(e){return new Qe(e)}queryRadius(){return 0}queryIntersectsFeature(){throw new Error("Should take a different path in FeatureIndex")}_setPaintOverrides(){for(let e of Ha.paint.overridableProperties){if(!Ti.hasPaintOverride(this.layout,e))continue;let r=this.paint.get(e),n=new Ii(r),i=new Gt(n,r.property.specification),o=null;r.value.kind==="constant"||r.value.kind==="source"?o=new vt("source",i):o=new Pt("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:Ti.hasPaintOverride(this.layout,e)}static hasPaintOverride(e,r){let n=e.get("text-field"),i=Ha.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 xt&&fe(c.value)===_r){let p=c.value;a(p.sections)}else c instanceof xn?a(c.sections):c.eachChild(s)},"checkExpression"),l=n.value;l._styleExpression&&s(l._styleExpression.expression)}return o}};u(Ti,"SymbolStyleLayer");var Xa=Ti;function Lh(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(Lh,"getIconPadding");x();x();var Dh,N1=u(()=>Dh=Dh||new oe({"background-color":new O(_.paint_background["background-color"]),"background-pattern":new Ht(_.paint_background["background-pattern"]),"background-opacity":new O(_.paint_background["background-opacity"])}),"getPaint"),Vh={get paint(){return N1()}};var Yc=class Yc extends ce{constructor(e){super(e,Vh)}};u(Yc,"BackgroundStyleLayer");var Ka=Yc;x();x();var Bh,U1=u(()=>Bh=Bh||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"),zh={get paint(){return U1()}};var Qc=class Qc extends ce{constructor(e){super(e,zh)}};u(Qc,"RasterStyleLayer");var Ya=Qc;x();var ep=class ep 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}is3D(){return this.implementation.renderingMode==="3d"}hasOffscreenPass(){return this.implementation.prerender!==void 0}recalculate(){}updateTransitions(){}hasTransition(){return!1}serialize(){throw new Error("Custom layers cannot be serialized")}};u(ep,"CustomStyleLayer");var Qa=ep;function Rh(t){if(t.type==="custom")return new Qa(t);switch(t.type){case"background":return new Ka(t);case"circle":return new Ia(t);case"fill":return new Va(t);case"fill-extrusion":return new Ra(t);case"heatmap":return new ka(t);case"hillshade":return new Ma(t);case"line":return new Na(t);case"raster":return new Ya(t);case"symbol":return new Xa(t)}}u(Rh,"createStyleLayer");var tp=class tp{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]=Rh(i);o._featureFilter=kn(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=oy(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)}}};u(tp,"StyleLayerIndex");var es=tp;x();var ud=X(Et(),1),cd=X(di(),1);x();x();x();var rp=class rp{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=".concat(e," can't be >= this._numberToString.length ").concat(this._numberToString.length));return this._numberToString[e]}};u(rp,"DictionaryCoder");var jr=rp;var Uh=X(Et(),1),$h=X(di(),1);x();var np=class np{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}};u(np,"GeoJSONFeature");var ts=np;var ip=class ip{constructor(e,r){this.tileID=e,this.x=e.canonical.x,this.y=e.canonical.y,this.z=e.canonical.z,this.grid=new Rt(8192,16,0),this.grid3D=new Rt(8192,16,0),this.featureIndexArray=new ti,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 Uh.default.VectorTile(new $h.default(this.rawTileData)).layers,this.sourceLayerCoder=new jr(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=kn(o.filter),l=e.queryGeometry,c=e.queryPadding*a,p=Nh(l),f=this.grid.query(p.minX-c,p.minY-c,p.maxX+c,p.maxY+c),y=Nh(e.cameraQueryGeometry),m=this.grid3D.query(y.minX-c,y.minY-c,y.maxX+c,y.maxY+c,(g,b,P,v)=>rm(e.cameraQueryGeometry,g-c,b-c,P+c,v+c));for(let g of m)f.push(g);f.sort($1);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&&!mf(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=Oh(w.paint,v.paint,d,S,s),w.layout=Oh(w.layout,v.layout,d,S,s);let I=!f||f(d,v,S);if(!I)continue;let M=new ts(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=kn(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}};u(ip,"FeatureIndex");var Ci=ip;E("FeatureIndex",Ci,{omit:["rawTileData","sourceLayerCoder"]});function Oh(t,e,r,n,i){return en(t,(o,a)=>{let s=e instanceof At?e.get(a):null;return s&&s.evaluate?s.evaluate(r,n,i):s})}u(Oh,"evaluateProperties");function Nh(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(Nh,"getBounds");function $1(t,e){return e-t}u($1,"topDownFeatureComparator");x();x();var Gh=X(xe(),1);var rs=class rs extends Gh.default{constructor(e,r,n,i){super(e,r),this.angle=n,i!==void 0&&(this.segment=i)}clone(){return new rs(this.x,this.y,this.angle,this.segment)}};u(rs,"Anchor");var at=rs;E("Anchor",at);x();x();function op(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(op,"checkMaxAngle");function qh(t){let e=0;for(let r=0;r<t.length-1;r++)e+=t[r].dist(t[r+1]);return e}u(qh,"getLineLength");function jh(t,e,r){return t?3/5*e*r:0}u(jh,"getAngleWindowSize");function Jh(t,e){return Math.max(t?t.right-t.left:0,e?e.right-e.left:0)}u(Jh,"getShapedLabelLength");function Zh(t,e,r,n,i,o){let a=jh(r,i,o),s=Jh(r,n)*o,l=0,c=qh(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=Ge.number(f.x,y.x,h),g=Ge.number(f.y,y.y,h),b=new at(d,g,y.angleTo(f),p);return b._round(),!a||op(t,b,s,a,e)?b:void 0}l+=m}}u(Zh,"getCenterAnchor");function Wh(t,e,r,n,i,o,a,s,l){let c=jh(n,o,a),p=Jh(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 Hh(t,h,e,c,r,f,y,!1,l)}u(Wh,"getAnchors");function Hh(t,e,r,n,i,o,a,s,l){let c=o/2,p=qh(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=Ge.number(d.x,g.x,v),w=Ge.number(d.y,g.y,v);if(S>=0&&S<l&&w>=0&&w<l&&y-c>=0&&y+c<=p){let I=new at(S,w,P,h);I._round(),(!n||op(t,I,o,n,i))&&m.push(I)}}f+=b}return!s&&!m.length&&!a&&(m=Hh(t,f/2,r,n,i,o,a,!0,l)),m}u(Hh,"resample");x();var ht=X(xe(),1);function Xh(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 ht.default(e,p.y+(f.y-p.y)*((e-p.x)/(f.x-p.x)))._round():f.x<e&&(f=new ht.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 ht.default(p.x+(f.x-p.x)*((r-p.y)/(f.y-p.y)),r)._round():f.y<r&&(f=new ht.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 ht.default(n,p.y+(f.y-p.y)*((n-p.x)/(f.x-p.x)))._round():f.x>=n&&(f=new ht.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 ht.default(p.x+(f.x-p.x)*((i-p.y)/(f.y-p.y)),i)._round():f.y>=i&&(f=new ht.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(Xh,"clipLine");x();var Ie=X(xe(),1);var Jr=ve;function ap(t,e,r,n){let i=[],o=t.image,a=o.pixelRatio,s=o.paddedRect.w-2*Jr,l=o.paddedRect.h-2*Jr,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=ns(f,0,k[0]),S=ns(y,0,k[1]),v=ns(f,k[0],k[2]),w=ns(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=is(k.stretch-P,v,c,t.left),$=os(k.fixed-I,M,k.stretch,h),G=is(F.stretch-S,w,p,t.top),ee=os(F.fixed-V,D,F.stretch,d),Pe=is(R.stretch-P,v,c,t.left),Q=os(R.fixed-I,M,R.stretch,h),pe=is(T.stretch-S,w,p,t.top),ye=os(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),Gi=new Ie.default(N,pe),As=new Ie.default($/a,ee/a),_s=new Ie.default(Q/a,ye/a),Xr=e*Math.PI/180;if(Xr){let ke=Math.sin(Xr),we=Math.cos(Xr),Oe=[we,-ke,ke,we];me._matMult(Oe),Ce._matMult(Oe),Gi._matMult(Oe),Se._matMult(Oe)}let qi=k.stretch+k.fixed,Le=R.stretch+R.fixed,Bt=F.stretch+F.fixed,ji=T.stretch+T.fixed,Is={x:o.paddedRect.x+Jr+qi,y:o.paddedRect.y+Jr+Bt,w:Le-qi,h:ji-Bt},Ts=M/a/c,Cs=D/a/p;return{tl:me,tr:Ce,bl:Gi,br:Se,tex:Is,writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:As,pixelOffsetBR:_s,minFontScaleX:Ts,minFontScaleY:Cs,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=Kh(f,g,h),F=Kh(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(ap,"getIconQuads");function ns(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(ns,"sumWithinRange");function Kh(t,e,r){let n=[{fixed:-Jr,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+Jr,stretch:r}),n}u(Kh,"stretchZonesToCuts");function is(t,e,r,n){return t/e*r+n}u(is,"getEmOffset");function os(t,e,r,n){return t-e*r/n}u(os,"getPxOffset");function Yh(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=Ga+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-Gr),pe=-Math.PI/2,ye=ae/2-v,me=f.imageName?ye:0,Ce=new Ie.default(5-Gr-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(Yh,"getGlyphQuads");x();var ki=X(xe(),1);var sp=class sp{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 ki.default(m,f),b=new ki.default(h,f),P=new ki.default(m,y),v=new ki.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}};u(sp,"CollisionFeature");var ur=sp;x();x();var lp=class lp{constructor(e=[],r=G1){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}};u(lp,"TinyQueue");var Mi=lp;function G1(t,e){return t<e?-1:t>e?1:0}u(G1,"defaultCompare");var up=X(xe(),1);function Qh(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 Mi([],q1);if(p===0)return new up.default(n,i);for(let d=n;d<o;d+=p)for(let g=i;g<a;g+=p)y.push(new Zr(d+f,g+f,f,t));let m=J1(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 Zr(d.p.x-f,d.p.y-f,f,t)),y.push(new Zr(d.p.x+f,d.p.y-f,f,t)),y.push(new Zr(d.p.x-f,d.p.y+f,f,t)),y.push(new Zr(d.p.x+f,d.p.y+f,f,t)),h+=4)}return r&&(console.log("num probes: ".concat(h)),console.log("best distance: ".concat(m.d))),m.p}u(Qh,"findPoleOfInaccessibility");function q1(t,e){return e.max-t.max}u(q1,"compareMax");function Zr(t,e,r,n){this.p=new up.default(t,e),this.h=r,this.d=j1(this.p,n),this.max=this.d+this.h*Math.SQRT2}u(Zr,"Cell");function j1(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,mc(t,c,p))}}return(r?1:-1)*Math.sqrt(n)}u(j1,"pointToPolygonDist");function J1(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 Zr(r/e,n/e,0,t)}u(J1,"getCentroidCell");var yp=X(Xu(),1);x();var cp=(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))(cp||{}),Lt=7,as=Number.POSITIVE_INFINITY;function pp(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-Lt;break;case"bottom-right":case"bottom-left":s=-l+Lt;break;case"bottom":s=-o+Lt;break;case"top":s=o-Lt;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-Lt;break;case"bottom-right":case"bottom-left":case"bottom":l=-a+Lt;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]!==as?n(t,e[0],e[1]):r(t,e[0])}u(pp,"evaluateVariableOffset");function fp(t,e,r){var a;let n=t.layout,i=(a=n.get("text-variable-anchor-offset"))==null?void 0:a.evaluate(e,{},r);if(i){let s=i.values,l=[];for(let c=0;c<s.length;c+=2){let p=l[c]=s[c],f=s[c+1].map(y=>y*ae);p.startsWith("top")?f[1]-=Lt:p.startsWith("bottom")&&(f[1]+=Lt),l[c+1]=f}return new qe(l)}let o=n.get("text-variable-anchor");if(o){let s;t._unevaluatedLayout.getValue("text-radial-offset")!==void 0?s=[n.get("text-radial-offset").evaluate(e,{},r)*ae,as]:s=n.get("text-offset").evaluate(e,{},r).map(p=>p*ae);let c=[];for(let p of o)c.push(p,pp(p,s));return new qe(c)}return null}u(fp,"getTextVariableAnchorOffset");function rd(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=By(w)?I:0,V=n.get("text-anchor").evaluate(p,{},t.canonical),D=fp(r,p,t.canonical);if(!D){let T=n.get("text-radial-offset").evaluate(p,{},t.canonical);T?b=pp(V,[T*ae,as]):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&&En(w)&&(d.vertical=Si(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(ed(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=Si(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=ed(V));let T=Si(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(),En(w)&&s&&l&&(d.vertical=Si(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=Th(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=nd(d.horizontal)||d.vertical;t.bucket.iconsInText=S?S.iconsInText:!1,(S||P)&&Z1(t.bucket,p,d,P,t.imageMap,o,m,h,b,v,t.canonical)}t.showCollisionBoxes&&t.bucket.generateCollisionDebugBuffers()}u(rd,"performSymbolLayout");function ed(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(ed,"getAnchorJustification");function Z1(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=nd(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=Lh(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=jc(n,r.vertical,F,y.get("icon-text-fit-padding"),m,g)),h&&(n=jc(n,h,F,y.get("icon-text-fit-padding"),m,g)));let T=u((N,$)=>{$.x<0||$.x>=8192||$.y<0||$.y>=8192||H1(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 Xh(e.geometry,0,0,8192,8192)){let $=Wh(N,S,M,r.vertical||h,n,d,P,t.overscaling,8192);for(let G of $){let ee=h;(!ee||!X1(t,ee.text,k,G))&&T(N,G)}}else if(C==="line-center"){for(let N of e.geometry)if(N.length>1){let $=Zh(N,M,r.vertical||h,n,d,P);$&&T(N,$)}}else if(e.type==="Polygon")for(let N of Br(e.geometry,0)){let $=Qh(N,16);T(N[0],new at($.x,$.y,0))}else if(e.type==="LineString")for(let N of e.geometry)T(N,new at(N[0].x,N[0].y,0));else if(e.type==="Point")for(let N of e.geometry)for(let $ of N)T([$],new at($.x,$.y,0))}u(Z1,"addFeature");function W1(t,e){let r=t.length,n=e==null?void 0:e.values;if((n==null?void 0:n.length)>0)for(let i=0;i<n.length;i+=2){let o=cp[n[i]],a=n[i+1];t.emplaceBack(o,a[0],a[1])}return[r,t.length]}u(W1,"addTextVariableAnchorOffsets");function td(t,e,r,n,i,o,a,s,l,c,p,f,y,m,h){let d=Yh(e,r,s,i,o,a,n,t.allowVerticalPlacement),g=t.textSizeData,b=null;g.kind==="source"?(b=[Ft*i.layout.get("text-size").evaluate(a,{})],b[0]>ot&&he("".concat(t.layerIds[0],': Value for "text-size" is >= ').concat(qr,'. Reduce your "text-size".'))):g.kind==="composite"&&(b=[Ft*m.compositeTextSizes[0].evaluate(a,{},h),Ft*m.compositeTextSizes[1].evaluate(a,{},h)],(b[0]>ot||b[1]>ot)&&he("".concat(t.layerIds[0],': Value for "text-size" is >= ').concat(qr,'. 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(td,"addTextVertices");function nd(t){for(let e in t)return t[e];return null}u(nd,"getDefaultHorizontalShaping");function H1(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,yp.default)("");if(t.allowVerticalPlacement&&n.vertical){let we=s.layout.get("text-rotate").evaluate(S,{},M)+90,Oe=n.vertical;F=new ur(l,e,c,p,f,Oe,y,m,h,we),a&&(R=new ur(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",Oe=ap(i,ke,I,we),Kr=a?ap(a,ke,I,we):void 0;k=new ur(l,e,c,p,f,i,g,b,!1,ke),T=Oe.length*4;let Qp=t.iconSizeData,zt=null;Qp.kind==="source"?(zt=[Ft*s.layout.get("icon-size").evaluate(S,{})],zt[0]>ot&&he("".concat(t.layerIds[0],': Value for "icon-size" is >= ').concat(qr,'. Reduce your "icon-size".'))):Qp.kind==="composite"&&(zt=[Ft*w.compositeIconSizes[0].evaluate(S,{},M),Ft*w.compositeIconSizes[1].evaluate(S,{},M)],(zt[0]>ot||zt[1]>ot)&&he("".concat(t.layerIds[0],': Value for "icon-size" is >= ').concat(qr,'. Reduce your "icon-size".'))),t.addSymbols(t.icon,Oe,zt,v,P,S,0,e,D.lineStartIndex,D.lineLength,-1,M),ee=t.icon.placedSymbolArray.length-1,Kr&&(N=Kr.length*4,t.addSymbols(t.icon,Kr,zt,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,yp.default)(we.text);let Kr=s.layout.get("text-rotate").evaluate(S,{},M);C=new ur(l,e,c,p,f,we,y,m,h,Kr)}let Oe=we.positionedLines.length===1;if($+=td(t,e,we,o,s,h,S,d,D,n.vertical?1:3,Oe?ye:[ke],Q,ee,w,M),Oe)break}n.vertical&&(G+=td(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,Gi=F?F.boxEndIndex:t.collisionBoxArray.length,As=k?k.boxStartIndex:t.collisionBoxArray.length,_s=k?k.boxEndIndex:t.collisionBoxArray.length,Xr=R?R.boxStartIndex:t.collisionBoxArray.length,qi=R?R.boxEndIndex:t.collisionBoxArray.length,Le=-1,Bt=u((ke,we)=>ke&&ke.circleDiameter?Math.max(ke.circleDiameter,we):we,"getCollisionCircleHeight");Le=Bt(C,Le),Le=Bt(F,Le),Le=Bt(k,Le),Le=Bt(R,Le);let ji=Le>-1?1:0;ji&&(Le*=V/ae),t.glyphOffsetArray.length>=Qe.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 Is=fp(s,S,M),[Ts,Cs]=W1(t.textAnchorOffsets,Is);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,Gi,As,_s,Xr,qi,c,$,G,T,N,ji,0,y,Le,Ts,Cs)}u(H1,"addSymbol");function X1(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(X1,"anchorIsTooClose");x();var ss=1,mp=class mp{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*ss,h:f.bitmap.height+2*ss};n.push(y),c[p]={rect:y,metrics:f.metrics}}}let{w:i,h:o}=gi(n),a=new ir({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;ir.copy(p.bitmap,a,{x:0,y:0},{x:f.x+ss,y:f.y+ss},p.bitmap)}}this.image=a,this.positions=r}};u(mp,"GlyphAtlas");var Ei=mp;E("GlyphAtlas",Ei);x();x();function od(t,e,r){e=Math.pow(2,r)-e-1;var n=id(t*256,e*256,r),i=id((t+1)*256,(e+1)*256,r);return n[0]+","+n[1]+","+i[0]+","+i[1]}u(od,"getTileBBox");function id(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(id,"getMercCoords");var ld=X(xe(),1);x();x();var hp=63710088e-1,cr=class cr{constructor(e,r){if(isNaN(e)||isNaN(r))throw new Error("Invalid LngLat object: (".concat(e,", ").concat(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 cr(pf(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return"LngLat(".concat(this.lng,", ").concat(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 hp*Math.acos(Math.min(o,1))}static convert(e){if(e instanceof cr)return e;if(Array.isArray(e)&&(e.length===2||e.length===3))return new cr(Number(e[0]),Number(e[1]));if(!Array.isArray(e)&&typeof e=="object"&&e!==null)return new cr(Number("lng"in e?e.lng:e.lon),Number(e.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: <lng>, lat: <lat>}, an object {lon: <lng>, lat: <lat>}, or an array of [<lng>, <lat>]")}};u(cr,"LngLat");var Fi=cr;var ad=2*Math.PI*hp;function sd(t){return ad*Math.cos(t*Math.PI/180)}u(sd,"circumferenceAtLatitude");function K1(t){return(180+t)/360}u(K1,"mercatorXfromLng");function Y1(t){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))/360}u(Y1,"mercatorYfromLat");function Q1(t,e){return t/sd(e)}u(Q1,"mercatorZfromAltitude");function eP(t){return t*360-180}u(eP,"lngFromMercatorX");function dp(t){let e=180-t*360;return 360/Math.PI*Math.atan(Math.exp(e*Math.PI/180))-90}u(dp,"latFromMercatorY");function tP(t,e){return t*sd(dp(e))}u(tP,"altitudeFromMercatorZ");function rP(t){return 1/Math.cos(t*Math.PI/180)}u(rP,"mercatorScale");var us=class us{constructor(e,r,n=0){this.x=+e,this.y=+r,this.z=+n}static fromLngLat(e,r=0){let n=Fi.convert(e);return new us(K1(n.lng),Y1(n.lat),Q1(r,n.lat))}toLngLat(){return new Fi(eP(this.x),dp(this.y))}toAltitude(){return tP(this.z,this.y)}meterInMercatorCoordinateUnits(){return 1/ad*rP(dp(this.y))}};u(us,"MercatorCoordinate");var ls=us;var xp=class xp{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=".concat(r,", y=").concat(n,", z=").concat(e," outside of bounds. 0<=x<").concat(Math.pow(2,e),", 0<=y<").concat(Math.pow(2,e)," 0<=z<=25 "));this.z=e,this.x=r,this.y=n,this.key=Li(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=od(this.x,this.y,this.z),o=nP(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 ld.default((e.x*r-this.x)*8192,(e.y*r-this.y)*8192)}toString(){return"".concat(this.z,"/").concat(this.x,"/").concat(this.y)}};u(xp,"CanonicalTileID");var cs=xp,bp=class bp{constructor(e,r){this.wrap=e,this.canonical=r,this.key=Li(e,r.z,r.z,r.x,r.y)}};u(bp,"UnwrappedTileID");var gp=bp,Re=class Re{constructor(e,r,n,i,o){if(e<n)throw new Error("overscaledZ should be >= z; overscaledZ = ".concat(e,"; z = ").concat(n));this.overscaledZ=e,this.wrap=r,this.canonical=new cs(n,+i,+o),this.key=Li(r,e,n,i,o)}clone(){return new Re(this.overscaledZ,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)}equals(e){return this.overscaledZ===e.overscaledZ&&this.wrap===e.wrap&&this.canonical.equals(e.canonical)}scaledTo(e){if(e>this.overscaledZ)throw new Error("targetZ > this.overscaledZ; targetZ = ".concat(e,"; overscaledZ = ").concat(this.overscaledZ));let r=this.canonical.z-e;return e>this.canonical.z?new Re(e,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new Re(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 = ".concat(e,"; overscaledZ = ").concat(this.overscaledZ));let n=this.canonical.z-e;return e>this.canonical.z?Li(this.wrap*+r,e,this.canonical.z,this.canonical.x,this.canonical.y):Li(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 Re(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 Re(r,this.wrap,r,n,i),new Re(r,this.wrap,r,n+1,i),new Re(r,this.wrap,r,n,i+1),new Re(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 Re(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)}unwrapTo(e){return new Re(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 gp(this.wrap,this.canonical)}toString(){return"".concat(this.overscaledZ,"/").concat(this.canonical.x,"/").concat(this.canonical.y)}getTilePoint(e){return this.canonical.getTilePoint(new ls(e.x-this.wrap,e.y))}};u(Re,"OverscaledTileID");var Di=Re;function Li(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(Li,"calculateKey");function nP(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(nP,"getQuadkey");E("CanonicalTileID",cs);E("OverscaledTileID",Di,{omit:["posMatrix"]});var Pp=class Pp{constructor(e){this.tileID=new Di(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 Hn;let o=new jr(Object.keys(e.layers).sort()),a=new Ci(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 "'.concat(this.source,'" layer "').concat(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 = ".concat(C.source," does not equal this.source = ").concat(this.source)),C.minzoom&&this.zoom<Math.floor(C.minzoom)||C.maxzoom&&this.zoom>=C.maxzoom||C.visibility==="none")continue;vp(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=en(l.glyphDependencies,w=>Object.keys(w).map(Number));this.inFlightDependencies.forEach(w=>w==null?void 0: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 Ei(g),S=new xi(b,P);for(let w in s){let I=s[w];I instanceof Qe?(vp(I.layers,this.zoom,n),rd({bucket:I,glyphMap:g,glyphPositions:v.positions,imageMap:b,imagePositions:S.iconPositions,showCollisionBoxes:this.showCollisionBoxes,canonical:this.tileID.canonical})):I.hasPattern&&(I instanceof lr||I instanceof ar||I instanceof sr)&&(vp(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}}};u(Pp,"WorkerTile");var ps=Pp;function vp(t,e,r){let n=new Z(e);for(let i of t)i.recalculate(n,r)}u(vp,"recalculateLayers");x();var iP=60,xL=1e3/iP;var Sp=class Sp{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}};u(Sp,"RequestPerformance");var Wr=Sp;var wp=class wp{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 My(e.request,r);try{return{vectorTile:new ud.default.VectorTile(new cd.default(n.data)),rawData:n.data,cacheControl:n.cacheControl,expires:n.expires}}catch(i){let o=new Uint8Array(n.data),a=o[0]===31&&o[1]===139,s="Unable to parse the tile at ".concat(e.request.url,", ");throw a?s+="please make sure the data is not gzipped and that you have configured the relevant header in the server":s+="got error: ".concat(i.messge),new Error(s)}}async loadTile(e){let r=e.uid,n=e&&e.request&&e.request.collectResourceTiming?new Wr(e.request):!1,i=new ps(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]}};u(wp,"VectorTileWorkerSource");var Hr=wp;x();x();var Ap=class Ap{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('"'.concat(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)]}};u(Ap,"DEMData");var Vi=Ap;E("DEMData",Vi);var _p=class _p{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=tn(i)?new be({width:c,height:p},await df(i,-1,-1,c,p)):i,y=new Vi(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]}};u(_p,"RasterDEMTileWorkerSource");var fs=_p;x();var zd=X(md(),1);x();var Ip=X(xe(),1),hd=X(Et(),1);var oP=hd.default.VectorTileFeature.prototype.toGeoJSON,Cp=class Cp{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 Ip.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 Ip.default(i[0],i[1]));e.push(n)}return e}}toGeoJSON(e,r,n){return oP.call(this,e,r,n)}};u(Cp,"FeatureWrapper");var Tp=Cp,kp=class kp{constructor(e){this.layers={_geojsonTileLayer:this},this.name="_geojsonTileLayer",this.extent=8192,this.length=e.length,this._features=e}feature(e){return new Tp(this._features[e])}};u(kp,"GeoJSONWrapper");var ms=kp;var Rd=X(Pd(),1);x();x();var Sd=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],Fp=1,zi=8,ds=class ds{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!==Fp)throw new Error("Got v".concat(i," data when expected v").concat(Fp,"."));let o=Sd[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 ds(s,a,o,e)}constructor(e,r=64,n=Float64Array,i){if(isNaN(e)||e<0)throw new Error("Unpexpected numItems value: ".concat(e,"."));this.numItems=+e,this.nodeSize=Math.min(Math.max(+r,2),65535),this.ArrayType=n,this.IndexArrayType=e<65536?Uint16Array:Uint32Array;let o=Sd.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: ".concat(n,"."));i&&i instanceof ArrayBuffer?(this.data=i,this.ids=new this.IndexArrayType(this.data,zi,e),this.coords=new this.ArrayType(this.data,zi+s+l,e*2),this._pos=e*2,this._finished=!0):(this.data=new ArrayBuffer(zi+a+s+l),this.ids=new this.IndexArrayType(this.data,zi,e),this.coords=new this.ArrayType(this.data,zi+s+l,e*2),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,(Fp<<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 ".concat(e," items when expected ").concat(this.numItems,"."));return Dp(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++)wd(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];wd(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}};u(ds,"KDBush");var Oi=ds;function Dp(t,e,r,n,i,o){if(i-n<=r)return;let a=n+i>>1;Ad(t,e,a,n,i,o),Dp(t,e,r,n,a-1,1-o),Dp(t,e,r,a+1,i,1-o)}u(Dp,"sort");function Ad(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));Ad(t,e,r,h,d,o)}let a=e[2*r+o],s=n,l=i;for(Ri(t,e,n,r),e[2*i+o]>a&&Ri(t,e,n,i);s<l;){for(Ri(t,e,s,l),s++,l--;e[2*s+o]<a;)s++;for(;e[2*l+o]>a;)l--}e[2*n+o]===a?Ri(t,e,n,l):(l++,Ri(t,e,l,i)),l<=r&&(n=l+1),r<=l&&(i=l-1)}}u(Ad,"select");function Ri(t,e,r,n){Lp(t,r,n),Lp(e,2*r,2*n),Lp(e,2*r+1,2*n+1)}u(Ri,"swapItem");function Lp(t,e,r){let n=t[e];t[e]=t[r],t[r]=n}u(Lp,"swap");function wd(t,e,r,n){let i=t-r,o=e-n;return i*i+o*o}u(wd,"sqDist");var dP={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:u(t=>t,"map")},_d=Math.fround||(t=>e=>(t[0]=+e,t[0]))(new Float32Array(1)),pr=2,Vt=3,Vp=4,Dt=5,Td=6,Bp=class Bp{constructor(e){this.options=Object.assign(Object.create(dP),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 ".concat(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=_d(gs(p)),m=_d(xs(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(gs(n),xs(a),gs(o),xs(i)),c=s.data,p=[];for(let f of l){let y=this.stride*f;p.push(c[y+Dt]>1?Id(c,y,this.clusterProps):this.points[c[y+Vt]])}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+Vp]===e&&f.push(a[m+Dt]>1?Id(a,m,this.clusterProps):this.points[a[m+Vt]])}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 Oi(e.length/this.stride|0,this.options.nodeSize,Float32Array);for(let n=0;n<e.length;n+=this.stride)r.add(e[n],e[n+1]);return r.finish(),r.data=e,r}_addTileFeatures(e,r,n,i,o,a){for(let s of e){let l=s*this.stride,c=r[l+Dt]>1,p,f,y;if(c)p=Cd(r,l,this.clusterProps),f=r[l],y=r[l+1];else{let d=this.points[r[l+Vt]];p=d.properties;let[g,b]=d.geometry.coordinates;f=gs(g),y=xs(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+Vt]:h=this.points[r[l+Vt]].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+pr]<=r)continue;l[f+pr]=r;let y=l[f],m=l[f+1],h=e.within(l[f],l[f+1],s),d=l[f+Dt],g=d;for(let b of h){let P=b*p;l[P+pr]>r&&(g+=l[P+Dt])}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+pr]<=r)continue;l[M+pr]=r;let V=l[M+Dt];b+=l[M]*V,P+=l[M+1]*V,l[M+Vp]=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+Vp]=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+pr]<=r)){l[P+pr]=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+Dt]>1){let a=this.clusterProps[e[r+Td]];return n?Object.assign({},a):a}let i=this.points[e[r+Vt]].properties,o=this.options.map(i);return n&&o===i?Object.assign({},o):o}};u(Bp,"Supercluster");var Ni=Bp;function Id(t,e,r){return{type:"Feature",id:t[e+Vt],properties:Cd(t,e,r),geometry:{type:"Point",coordinates:[gP(t[e]),xP(t[e+1])]}}}u(Id,"getClusterJSON");function Cd(t,e,r){let n=t[e+Dt],i=n>=1e4?"".concat(Math.round(n/1e3),"k"):n>=1e3?"".concat(Math.round(n/100)/10,"k"):n,o=t[e+Td],a=o===-1?{}:Object.assign({},r[o]);return Object.assign(a,{cluster:!0,cluster_id:t[e+Vt],point_count:n,point_count_abbreviated:i})}u(Cd,"getClusterProperties");function gs(t){return t/360+.5}u(gs,"lngX");function xs(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(xs,"latY");function gP(t){return(t-.5)*360}u(gP,"xLng");function xP(t){let e=(180-t*360)*Math.PI/180;return 360*Math.atan(Math.exp(e))/Math.PI-90}u(xP,"yLat");x();x();x();function Ui(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=bP(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&&Ui(t,e,s,n),t[s+2]=i,r-s>3&&Ui(t,s,r,n))}u(Ui,"simplify");function bP(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(bP,"getSqSegDist");x();function dt(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 vP(i),i}u(dt,"createFeature");function vP(t){var e=t.geometry,r=t.type;if(r==="Point"||r==="MultiPoint"||r==="LineString")zp(t,e);else if(r==="Polygon"||r==="MultiLineString")for(var n=0;n<e.length;n++)zp(t,e[n]);else if(r==="MultiPolygon")for(n=0;n<e.length;n++)for(var i=0;i<e[n].length;i++)zp(t,e[n][i])}u(vP,"calcBBox");function zp(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(zp,"calcLineBBox");function Np(t,e){var r=[];if(t.type==="FeatureCollection")for(var n=0;n<t.features.length;n++)bs(r,t.features[n],e,n);else t.type==="Feature"?bs(r,t,e):bs(r,{geometry:t},e);return r}u(Np,"convert");function bs(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")kd(i,s);else if(o==="MultiPoint")for(var c=0;c<i.length;c++)kd(i[c],s);else if(o==="LineString")Op(i,s,a,!1);else if(o==="MultiLineString")if(r.lineMetrics){for(c=0;c<i.length;c++)s=[],Op(i[c],s,a,!1),t.push(dt(l,"LineString",s,e.properties));return}else Rp(i,s,a,!1);else if(o==="Polygon")Rp(i,s,a,!0);else if(o==="MultiPolygon")for(c=0;c<i.length;c++){var p=[];Rp(i[c],p,a,!0),s.push(p)}else if(o==="GeometryCollection"){for(c=0;c<e.geometry.geometries.length;c++)bs(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(dt(l,o,s,e.properties))}}u(bs,"convertFeature");function kd(t,e){e.push(Md(t[0])),e.push(Ed(t[1])),e.push(0)}u(kd,"convertPoint");function Op(t,e,r,n){for(var i,o,a=0,s=0;s<t.length;s++){var l=Md(t[s][0]),c=Ed(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,Ui(e,0,p,r),e[p+2]=1,e.size=Math.abs(a),e.start=0,e.end=e.size}u(Op,"convertLine");function Rp(t,e,r,n){for(var i=0;i<t.length;i++){var o=[];Op(t[i],o,r,n),e.push(o)}}u(Rp,"convertLines");function Md(t){return t/360+.5}u(Md,"projectX");function Ed(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(Ed,"projectY");x();function We(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")PP(f,d,r,n,i);else if(y==="LineString")Ld(f,d,r,n,i,!1,s.lineMetrics);else if(y==="MultiLineString")Up(f,d,r,n,i,!1);else if(y==="Polygon")Up(f,d,r,n,i,!0);else if(y==="MultiPolygon")for(var g=0;g<f.length;g++){var b=[];Up(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(dt(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(dt(p.id,y,d,p.tags))}}return l.length?l:null}u(We,"clip");function PP(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(PP,"clipPoints");function Ld(t,e,r,n,i,o,a){for(var s=Fd(t),l=i===0?SP:wP,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)):$p(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=Fd(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&&$p(s,m,h,d),w=s.length-3,o&&w>=3&&(s[w]!==s[0]||s[w+1]!==s[1])&&$p(s,s[0],s[1],s[2]),s.length&&e.push(s)}u(Ld,"clipLine");function Fd(t){var e=[];return e.size=t.size,e.start=t.start,e.end=t.end,e}u(Fd,"newSlice");function Up(t,e,r,n,i,o){for(var a=0;a<t.length;a++)Ld(t[a],e,r,n,i,o,!1)}u(Up,"clipLines");function $p(t,e,r,n){t.push(e),t.push(r),t.push(n)}u($p,"addPoint");function SP(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(SP,"intersectX");function wP(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(wP,"intersectY");x();function qp(t,e){var r=e.buffer/e.extent,n=t,i=We(t,1,-1-r,r,0,-1,2,e),o=We(t,1,1-r,2+r,0,-1,2,e);return(i||o)&&(n=We(t,1,-r,1+r,0,-1,2,e)||[],i&&(n=Dd(i,1).concat(n)),o&&(n=n.concat(Dd(o,-1)))),n}u(qp,"wrap");function Dd(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=Gp(i.geometry,e);else if(o==="MultiLineString"||o==="Polygon"){a=[];for(var s=0;s<i.geometry.length;s++)a.push(Gp(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(Gp(i.geometry[s][c],e));a.push(l)}r.push(dt(i.id,o,a,i.tags))}return r}u(Dd,"shiftFeatureCoords");function Gp(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(Gp,"shiftCoords");x();function vs(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(Vd(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(Vd(c[a][s],c[a][s+1],e,r,n,i));l.geometry.push(f)}}return t.transformed=!0,t}u(vs,"transformTile");function Vd(t,e,r,n,i,o){return[Math.round(r*(t*n-i)),Math.round(r*(e*n-o))]}u(Vd,"transformPoint");x();function Jp(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++,AP(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(Jp,"createTile");function AP(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")jp(a,i,t,r,!1,!1);else if(o==="MultiLineString"||o==="Polygon")for(s=0;s<i.length;s++)jp(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++)jp(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(AP,"addFeature");function jp(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&&_P(s,o),t.push(s)}u(jp,"addLine");function _P(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(_P,"rewind");function Wp(t,e){return new Ps(t,e)}u(Wp,"geojsonvt");function Ps(t,e){e=this.options=IP(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=Np(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=qp(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(Ps,"GeoJSONVT");Ps.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0};Ps.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=Zp(e,r,n),y=this.tiles[f];if(!y&&(c>1&&console.time("creation"),y=this.tiles[f]=Jp(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=We(t,p,r-d,r+b,0,y.minX,y.maxX,l),V=We(t,p,r+g,r+P,0,y.minX,y.maxX,l),t=null,M&&(v=We(M,p,n-d,n+b,1,y.minY,y.maxY,l),S=We(M,p,n+g,n+P,1,y.minY,y.maxY,l),M=null),V&&(w=We(V,p,n-d,n+b,1,y.minY,y.maxY,l),I=We(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)}}};Ps.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=Zp(t,e,r);if(this.tiles[s])return vs(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[Zp(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]?vs(this.tiles[s],i):null)};function Zp(t,e,r){return((1<<t)*r+e)*32+t}u(Zp,"toID");function IP(t,e){for(var r in e)t[r]=e[r];return t}u(IP,"extend");x();function $i(t,e){return e?t.properties[e]:t.id}u($i,"getFeatureId");function Hp(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(Hp,"isUpdateableGeoJSON");function Xp(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(Xp,"toUpdateable");function Bd(t,e,r){var n,i,o,a;if(e.removeAll&&t.clear(),e.remove)for(let s of e.remove)t.delete(s);if(e.add)for(let s of e.add){let l=$i(s,r);l!=null&&t.set(l,s)}if(e.update)for(let s of e.update){let l=t.get(s.id);if(l==null)continue;let c=s.newGeometry||s.removeAllProperties,p=!s.removeAllProperties&&(((n=s.removeProperties)==null?void 0:n.length)>0||((i=s.addOrUpdateProperties)==null?void 0:i.length)>0);if((c||p)&&(l={...l},t.set(s.id,l),p&&(l.properties={...l.properties})),s.newGeometry&&(l.geometry=s.newGeometry),s.removeAllProperties)l.properties={};else if(((o=s.removeProperties)==null?void 0:o.length)>0)for(let f of s.removeProperties)Object.prototype.hasOwnProperty.call(l.properties,f)&&delete l.properties[f];if(((a=s.addOrUpdateProperties)==null?void 0:a.length)>0)for(let{key:f,value:y}of s.addOrUpdateProperties)l.properties[f]=y}}u(Bd,"applySourceDiff");var Kp=class Kp extends Hr{constructor(){super(...arguments);this._dataUpdateable=new Map}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 ms(o.features),s=(0,Rd.default)(a);return(s.byteOffset!==0||s.byteLength!==s.buffer.byteLength)&&(s=new Uint8Array(s)),{vectorTile:a,rawData:s.buffer}}async loadData(r){var i;(i=this._pendingRequest)==null||i.abort();let n=r&&r.request&&r.request.collectResourceTiming?new Wr(r.request):!1;this._pendingRequest=new AbortController;try{let o=await this.loadGeoJSON(r,this._pendingRequest);if(delete this._pendingRequest,typeof o!="object")throw new Error("Input data given to '".concat(r.source,"' is not a valid GeoJSON object."));if((0,zd.default)(o,!0),r.filter){let s=Wt(r.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if(s.result==="error")throw new Error(s.value.map(c=>"".concat(c.key,": ").concat(c.message)).join(", "));o={type:"FeatureCollection",features:o.features.filter(c=>s.value.evaluate({zoom:0},c))}}this._geoJSONIndex=r.cluster?new Ni(TP(r)).load(o.features):Wp(o,r.geojsonVtOptions),this.loaded={};let a={};if(n){let s=n.finish();s&&(a.resourceTiming={},a.resourceTiming[r.source]=JSON.parse(JSON.stringify(s)))}return a}catch(o){if(delete this._pendingRequest,Py(o))return{abandoned:!0};throw o}}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 ky(r.request,n);return this._dataUpdateable=Hp(o.data,i)?Xp(o.data,i):void 0,o.data}if(typeof r.data=="string")try{let o=JSON.parse(r.data);return this._dataUpdateable=Hp(o,i)?Xp(o,i):void 0,o}catch{throw new Error("Input data given to '".concat(r.source,"' is not a valid GeoJSON object."))}if(!r.dataDiff)throw new Error("Input data given to '".concat(r.source,"' is not a valid GeoJSON object."));if(!this._dataUpdateable)throw new Error("Cannot update existing geojson data in ".concat(r.source));return Bd(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)}};u(Kp,"GeoJSONWorkerSource");var Ss=Kp;function TP({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=Wt(c),f=Wt(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(TP,"getSuperclusterOptions");var Yp=class Yp{constructor(e){this.self=e,this.actor=new Go(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 "'.concat(r,'" already registered.'));this.externalWorkerSourceTypes[r]=n},this.self.addProtocol=wy,this.self.removeProtocol=Ay,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 ".concat(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 es),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 Hr(i,this._getLayerIndex(e),this._getAvailableImages(e));break;case"geojson":this.workerSources[e][r][n]=new Ss(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 fs),this.demWorkerSources[e][r]}};u(Yp,"Worker");var ws=Yp;ct(self)&&(self.worker=new ws(self));})();
|