1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6578],{40591:(e,t,r)=>{let n,i,a,s,o,l,u,h,c,p,f,d,y,m,g,x,v,b,w,D;r.d(t,{$:()=>ud,$n:()=>eV,$r:()=>ec,$t:()=>aL,A:()=>hz,Ai:()=>X,Ar:()=>tv,At:()=>ok,B:()=>u1,Bn:()=>e0,Br:()=>eB,Bt:()=>s5,C:()=>h5,Ci:()=>$,Cn:()=>tq,Cr:()=>eY,Ct:()=>o6,Di:()=>Z,Dn:()=>tG,Dr:()=>tE,Dt:()=>o2,E:()=>hW,Ei:()=>H,En:()=>tU,Er:()=>tD,Et:()=>o0,F:()=>hx,Fi:()=>P,Fr:()=>e5,Ft:()=>ou,Gn:()=>e$,Gr:()=>ek,Gt:()=>sL,Hn:()=>ta,Hr:()=>eP,Ht:()=>sH,I:()=>hm,Ii:()=>M,In:()=>tS,Ir:()=>te,It:()=>oh,J:()=>ub,Jn:()=>function e(t,r){if(Array.isArray(t)){if(!Array.isArray(r)||t.length!==r.length)return!1;for(let n=0;n<t.length;n++)if(!e(t[n],r[n]))return!1;return!0}if("object"==typeof t&&t&&null!==r){if("object"!=typeof r||Object.keys(t).length!==Object.keys(r).length)return!1;for(let n in t)if(!e(t[n],r[n]))return!1;return!0}return t===r},Jr:()=>e_,Jt:()=>sQ,K:()=>uE,Kn:()=>eO,Kr:()=>eE,Kt:()=>sJ,L:()=>hg,Li:()=>B,Ln:()=>eX,Lr:()=>eL,Lt:()=>oc,M:()=>hF,Mi:()=>q,Mn:()=>tM,Mr:()=>eq,Mt:()=>oa,Ni:()=>z,Nn:()=>tP,Nr:()=>e7,Nt:()=>oo,O:()=>h$,Oi:()=>G,Or:()=>tt,Ot:()=>oW,P:()=>hv,Pi:()=>L,Pn:()=>tz,Pr:()=>to,Pt:()=>ol,Q:()=>up,Qn:()=>eZ,Qr:()=>ee,Qt:()=>aJ,R:()=>hy,Ri:()=>C,Rn:()=>tg,Rr:()=>ez,Rt:()=>op,S:()=>h8,Si:()=>W,Sn:()=>tj,Sr:()=>tw,St:()=>o9,T:()=>hJ,Ti:()=>U,Tn:()=>tY,Tr:()=>eK,Tt:()=>o5,U:()=>uq,Un:()=>eU,Ur:()=>eM,Ut:()=>s0,V:()=>uG,Vn:()=>e3,Vr:()=>eC,Vt:()=>sE,W:()=>uV,Wn:()=>eN,Wr:()=>eF,Wt:()=>sV,X:()=>ux,Xn:()=>tb,Xr:()=>eD,Xt:()=>a3,Y:()=>uv,Yn:()=>e2,Yr:()=>ew,Yt:()=>a7,Z:()=>um,Zn:()=>eW,Zr:()=>en,Zt:()=>aX,_:()=>cl,_i:()=>R,_n:()=>tH,_r:()=>eH,_t:()=>lN,a:()=>cD,ai:()=>eu,an:()=>aA,ar:()=>tA,at:()=>ul,b:()=>cn,bi:()=>J,br:()=>e4,ci:()=>eg,cn:()=>a_,cr:()=>t_,ct:()=>uo,d:()=>cy,di:()=>ev,dn:()=>r5,dr:()=>td,ei:()=>eo,en:()=>aO,er:()=>tr,et:()=>uf,f:()=>cd,fi:()=>ei,fn:()=>rG,fr:()=>tT,ft:()=>l5,g:()=>cc,gi:()=>ex,gn:()=>tQ,gr:()=>tn,gt:()=>lj,h:()=>cp,hi:()=>ed,hn:()=>t1,hr:()=>eJ,ht:()=>lq,ii:()=>el,in:()=>aD,ir:()=>eQ,it:()=>uu,ji:()=>j,jn:()=>tL,jr:()=>eG,jt:()=>os,k:()=>hP,ki:()=>Y,kn:()=>tV,kr:()=>th,kt:()=>oI,li:()=>ea,ln:()=>ij,lr:()=>ty,lt:()=>ur,m:()=>cv,mi:()=>ep,mn:()=>t0,mr:()=>tc,mt:()=>lJ,n:()=>fo,ni:()=>eb,nn:()=>aP,nr:()=>ti,nt:()=>uc,oi:()=>ey,on:()=>aE,or:()=>e1,ot:()=>ua,p:()=>cm,pi:()=>ef,pn:()=>rP,pr:()=>tC,pt:()=>l3,q:()=>ug,qn:()=>eR,qr:()=>eS,qt:()=>sR,ri:()=>et,rr:()=>tu,rt:()=>uh,s:()=>cb,si:()=>em,sn:()=>aw,st:()=>us,ti:()=>eh,tn:()=>az,tr:()=>e6,tt:()=>uy,u:()=>cf,ui:()=>es,ur:()=>tI,ut:()=>ut,v:()=>cs,vi:()=>O,vn:()=>tZ,vr:()=>e9,vt:()=>lU,w:()=>h0,wi:()=>N,wn:()=>t$,wr:()=>tx,wt:()=>o4,x:()=>ce,xi:()=>K,xn:()=>tR,xr:()=>ej,xt:()=>ln,y:()=>ca,yi:()=>V,yn:()=>tK,yr:()=>tp,yt:()=>la,zn:()=>tm,zr:()=>eT,zt:()=>od});var _,A=Object.create,E=Object.defineProperty,S=Object.getOwnPropertyDescriptor,F=Object.getOwnPropertyNames,k=Object.getPrototypeOf,T=Object.prototype.hasOwnProperty,I=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports);function C(e,t){this.x=e,this.y=t}function B(){return n??="u">typeof OffscreenCanvas&&!!new OffscreenCanvas(1,1).getContext("2d")&&"function"==typeof createImageBitmap}function M(){if(null==i&&(i=!1,B())){let e=new OffscreenCanvas(5,5).getContext("2d",{willReadFrequently:!0});if(e){for(let t=0;t<25;t++){let r=4*t;e.fillStyle=`rgb(${r},${r+1},${r+2})`,e.fillRect(t%5,Math.floor(t/5),1,1)}let t=e.getImageData(0,0,5,5).data;for(let e=0;e<100;e++)if(e%4!=3&&t[e]!==e){i=!0;break}}}return i||!1}C.prototype={clone(){return new C(this.x,this.y)},add(e){return this.clone()._add(e)},sub(e){return this.clone()._sub(e)},multByPoint(e){return this.clone()._multByPoint(e)},divByPoint(e){return this.clone()._divByPoint(e)},mult(e){return this.clone()._mult(e)},div(e){return this.clone()._div(e)},rotate(e){return this.clone()._rotate(e)},rotateAround(e,t){return this.clone()._rotateAround(e,t)},matMult(e){return this.clone()._matMult(e)},unit(){return this.clone()._unit()},perp(){return this.clone()._perp()},round(){return this.clone()._round()},mag(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals(e){return this.x===e.x&&this.y===e.y},dist(e){return Math.sqrt(this.distSqr(e))},distSqr(e){let t=e.x-this.x,r=e.y-this.y;return t*t+r*r},angle(){return Math.atan2(this.y,this.x)},angleTo(e){return Math.atan2(this.y-e.y,this.x-e.x)},angleWith(e){return this.angleWithSep(e.x,e.y)},angleWithSep(e,t){return Math.atan2(this.x*t-this.y*e,this.x*e+this.y*t)},_matMult(e){let t=e[0]*this.x+e[1]*this.y,r=e[2]*this.x+e[3]*this.y;return this.x=t,this.y=r,this},_add(e){return this.x+=e.x,this.y+=e.y,this}
vendor: 8,312 bytes, line 1
1,_sub(e){return this.x-=e.x,this.y-=e.y,this},_mult(e){return this.x*=e,this.y*=e,this},_div(e){return this.x/=e,this.y/=e,this},_multByPoint(e){return this.x*=e.x,this.y*=e.y,this},_divByPoint(e){return this.x/=e.x,this.y/=e.y,this},_unit(){return this._div(this.mag()),this},_perp(){let e=this.y;return this.y=this.x,this.x=-e,this},_rotate(e){let t=Math.cos(e),r=Math.sin(e),n=t*this.x-r*this.y,i=r*this.x+t*this.y;return this.x=n,this.y=i,this},_rotateAround(e,t){let r=Math.cos(e),n=Math.sin(e),i=t.x+r*(this.x-t.x)-n*(this.y-t.y),a=t.y+n*(this.x-t.x)+r*(this.y-t.y);return this.x=i,this.y=a,this},_round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},constructor:C},C.convert=function(e){if(e instanceof C)return e;if(Array.isArray(e))return new C(+e[0],+e[1]);if(void 0!==e.x&&void 0!==e.y)return new C(+e.x,+e.y);throw Error("Expected [x, y] or {x, y} point format")};var P="u">typeof Float32Array?Float32Array:Array;function z(){var e=new P(9);return P!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[5]=0,e[6]=0,e[7]=0),e[0]=1,e[4]=1,e[8]=1,e}function L(e,t){var r=Math.sin(t),n=Math.cos(t);return e[0]=n,e[1]=r,e[2]=0,e[3]=-r,e[4]=n,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}function V(){var e=new P(16);return P!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0),e[0]=1,e[5]=1,e[10]=1,e[15]=1,e}function R(e){var t=new P(16);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function O(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function $(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function N(e,t){var r=t[0],n=t[1],i=t[2],a=t[3],s=t[4],o=t[5],l=t[6],u=t[7],h=t[8],c=t[9],p=t[10],f=t[11],d=t[12],y=t[13],m=t[14],g=t[15],x=r*o-n*s,v=r*l-i*s,b=r*u-a*s,w=n*l-i*o,D=n*u-a*o,_=i*u-a*l,A=h*y-c*d,E=h*m-p*d,S=h*g-f*d,F=c*m-p*y,k=c*g-f*y,T=p*g-f*m,I=x*T-v*k+b*F+w*S-D*E+_*A;return I?(I=1/I,e[0]=(o*T-l*k+u*F)*I,e[1]=(i*k-n*T-a*F)*I,e[2]=(y*_-m*D+g*w)*I,e[3]=(p*D-c*_-f*w)*I,e[4]=(l*S-s*T-u*E)*I,e[5]=(r*T-i*S+a*E)*I,e[6]=(m*b-d*_-g*v)*I,e[7]=(h*_-p*b+f*v)*I,e[8]=(s*k-o*S+u*A)*I,e[9]=(n*S-r*k-a*A)*I,e[10]=(d*D-y*b+g*x)*I,e[11]=(c*b-h*D-f*x)*I,e[12]=(o*E-s*F-l*A)*I,e[13]=(r*F-n*E+i*A)*I,e[14]=(y*v-d*w-m*x)*I,e[15]=(h*w-c*v+p*x)*I,e):null}function U(e,t,r){var n=t[0],i=t[1],a=t[2],s=t[3],o=t[4],l=t[5],u=t[6],h=t[7],c=t[8],p=t[9],f=t[10],d=t[11],y=t[12],m=t[13],g=t[14],x=t[15],v=r[0],b=r[1],w=r[2],D=r[3];return e[0]=v*n+b*o+w*c+D*y,e[1]=v*i+b*l+w*p+D*m,e[2]=v*a+b*u+w*f+D*g,e[3]=v*s+b*h+w*d+D*x,v=r[4],b=r[5],w=r[6],D=r[7],e[4]=v*n+b*o+w*c+D*y,e[5]=v*i+b*l+w*p+D*m,e[6]=v*a+b*u+w*f+D*g,e[7]=v*s+b*h+w*d+D*x,v=r[8],b=r[9],w=r[10],D=r[11],e[8]=v*n+b*o+w*c+D*y,e[9]=v*i+b*l+w*p+D*m,e[10]=v*a+b*u+w*f+D*g,e[11]=v*s+b*h+w*d+D*x,v=r[12],b=r[13],w=r[14],D=r[15],e[12]=v*n+b*o+w*c+D*y,e[13]=v*i+b*l+w*p+D*m,e[14]=v*a+b*u+w*f+D*g,e[15]=v*s+b*h+w*d+D*x,e}function q(e,t,r){var n,i,a,s,o,l,u,h,c,p,f,d,y=r[0],m=r[1],g=r[2];return t===e?(e[12]=t[0]*y+t[4]*m+t[8]*g+t[12],e[13]=t[1]*y+t[5]*m+t[9]*g+t[13],e[14]=t[2]*y+t[6]*m+t[10]*g+t[14],e[15]=t[3]*y+t[7]*m+t[11]*g+t[15]):(n=t[0],i=t[1],a=t[2],s=t[3],o=t[4],l=t[5],u=t[6],h=t[7],c=t[8],p=t[9],f=t[10],d=t[11],e[0]=n,e[1]=i,e[2]=a,e[3]=s,e[4]=o,e[5]=l,e[6]=u,e[7]=h,e[8]=c,e[9]=p,e[10]=f,e[11]=d,e[12]=n*y+o*m+c*g+t[12],e[13]=i*y+l*m+p*g+t[13],e[14]=a*y+u*m+f*g+t[14],e[15]=s*y+h*m+d*g+t[15]),e}function j(e,t,r){var n=r[0],i=r[1],a=r[2];return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*i,e[5]=t[5]*i,e[6]=t[6]*i,e[7]=t[7]*i,e[8]=t[8]*a,e[9]=t[9]*a,e[10]=t[10]*a,e[11]=t[11]*a,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function G(e,t,r){var n=Math.sin(r),i=Math.cos(r),a=t[4],s=t[5],o=t[6],l=t[7],u=t[8],h=t[9],c=t[10],p=t[11];return t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=a*i+u*n,e[5]=s*i+h*n,e[6]=o*i+c*n,e[7]=l*i+p*n,e[8]=u*i-a*n,e[9]=h*i-s*n,e[10]=c*i-o*n,e[11]=p*i-l*n,e}function Y(e,t,r){var n=Math.sin(r),i=Math.cos(r),a=t[0],s=t[1],o=t[2],l=t[3],u=t[8],h=t[9],c=t[10],p=t[11];return t!==e&&(e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=a*i-u*n,e[1]=s*i-h*n,e[2]=o*i-c*n,e[3]=l*i-p*n,e[8]=a*n+u*i,e[9]=s*n+h*i,e[10]=o*n+c*i,e[11]=l*n+p*i,e}function X(e,t,r){var n=Math.sin(r),i=Math.cos(r),a=t[0],s=t[1],o=t[2],l=t[3],u=t[4],h=t[5],c=t[6],p=t[7];return t!==e&&(e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=a*i+u*n,e[1]=s*i+h*n,e[2]=o*i+c*n,e[3]=l*i+p*n,e[4]=u*i-a*n,e[5]=h*i-s*n,e[6]=c*i-o*n,e[7]=p*i-l*n,e}function W(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t[1],e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t[2],e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}var Z=function(e,t,r,n,i){var a=1/Math.tan(t/2);if(e[0]=a/r,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,null!=i&&i!==1/0){var s=1/(n-i);e[10]=(i+n)*s,e[14]=2*i*n*s}else e[10]=-1,e[14]=-2*n;return e},H=function(e,t,r,n,i,a,s){var o=1/(t-r),l=1/(n-i),u=1/(a-s);return e[0]=-2*o,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*l,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*u,e[11]=0,e[12]=(t+r)*o,e[13]=(i+n)*l,e[14]=(s+a)*u,e[15]=1,e};function K(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[11]===t[11]&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[15]===t[15]}function J(e,t){var r=e[0],n=e[1],i=e[2],a=e[3],s=e[4],o=e[5],l=e[6],u=e[7],h=e[8],c=e[9],p=e[10],f=e[11],d=e[12],y=e[13],m=e[14],g=e[15],x=t[0],v=t[1],b=t[2],w=t[3],D=t[4],_=t[5],A=t[6],E=t[7],S=t[8],F=t[9],k=t[10],T=t[11],I=t[12],C=t[13],B=t[14],M=t[15];return Math.abs(r-x)<=1e-6*Math.max(1,Math.abs(r),Math.abs(x))&&Math.abs(n-v)<=1e-6*Math.max(1,Math.abs(n),Math.abs(v))&&Math.abs(i-b)<=1e-6*Math.max(1,Math.abs(i),Math.abs(b))&&Math.abs(a-w)<=1e-6*Math.max(1,Math.abs(a),Math.abs(w))&&Math.abs(s-D)<=1e-6*Math.max(1,Math.abs(s),Math.abs(D))&&Math.abs(o-_)<=1e-6*Math.max(1,Math.abs(o),Math.abs(_))&&Math.abs(l-A)<=1e-6*Math.max(1,Math.abs(l),Math.abs(A))&&Math.abs(u-E)<=1e-6*Math.max(1,Math.abs(u),Math.abs(E))&&Math.abs(h-S)<=1e-6*Math.max(1,Math.abs(h),Math.abs(S))&&Math.abs(c-F)<=1e-6*Math.max(1,Math.abs(c),Math.abs(F))&&Math.abs(p-k)<=1e-6*Math.max(1,Math.abs(p),Math.abs(k))&&Math.abs(f-T)<=1e-6*Math.max(1,Math.abs(f),Math.abs(T))&&Math.abs(d-I)<=1e-6*Math.max(1,Math.abs(d),Math.abs(I))&&Math.abs(y-C)<=1e-6*Math.max(1,Math.abs(y),Math.abs(C))&&Math.abs(m-B)<=1e-6*Math.max(1,Math.abs(m),Math.abs(B))&&Math.abs(g-M)<=1e-6*Math.max(1,Math.abs(g),Math.abs(M))}function Q(){var e=new P(3);return P!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function ee(e){var t=new P(3);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function et(e){var t=e[0],r=e[1],n=e[2];return Math.sqrt(t*t+r*r+n*n)}function er(e,t,r){var n=new P(3);return n[0]=e,n[1]=t,n[2]=r,n}function en(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e}function ei(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e}function ea(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e}function es(e,t,r,n){return e[0]=t[0]+r[0]*n,e[1]=t[1]+r[1]*n,e[2]=t[2]+r[2]*n,e}function eo(e,t){var r=t[0]-e[0],n=t[1]-e[1],i=t[2]-e[2];return Math.sqrt(r*r+n*n+i*i)}function el(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e}function eu(e,t){var r=t[0],n=t[1],i=t[2],a=r*r+n*n+i*i;return a>0&&(a=1/Math.sqrt(a)),e[0]=t[0]*a,e[1]=t[1]*a,e[2]=t[2]*a,e}function eh(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function ec(e,t,r){var n=t[0],i=t[1],a=t[2],s=r[0],o=r[1],l=r[2];return e[0]=i*l-a*o,e[1]=a*s-n*l,e[2]=n*o-i*s,e}function ep(e,t,r){var n=t[0],i=t[1],a=t[2],s=r[3]*n+r[7]*i+r[11]*a+r[15];return s||=1,e[0]=(r[0]*n+r[4]*i+r[8]*a+r[12])/s,e[1]=(r[1]*n+r[5]*i+r[9]*a+r[13])/s,e[2]=(r[2]*n+r[6]*i+r[10]*a+r[14])/s,e}function ef(e,t,r){var n=t[0],i=t[1],a=t[2];return e[0]=n*r[0]+i*r[3]+a*r[6],e[1]=n*r[1]+i*r[4]+a*r[7],e[2]=n*r[2]+i*r[5]+a*r[8],e}function ed(e,t,r){var n=r[0],i=r[1],a=r[2],s=r[3],o=t[0],l=t[1],u=t[2],h=i*u
1-a*l,c=a*o-n*u,p=n*l-i*o;return h+=h,c+=c,p+=p,e[0]=o+s*h+i*p-a*c,e[1]=l+s*c+a*h-n*p,e[2]=u+s*p+n*c-i*h,e}function ey(e,t,r,n){var i=[],a=[];return i[0]=t[0]-r[0],i[1]=t[1]-r[1],i[2]=t[2]-r[2],a[0]=i[0],a[1]=i[1]*Math.cos(n)-i[2]*Math.sin(n),a[2]=i[1]*Math.sin(n)+i[2]*Math.cos(n),e[0]=a[0]+r[0],e[1]=a[1]+r[1],e[2]=a[2]+r[2],e}function em(e,t,r,n){var i=[],a=[];return i[0]=t[0]-r[0],i[1]=t[1]-r[1],i[2]=t[2]-r[2],a[0]=i[2]*Math.sin(n)+i[0]*Math.cos(n),a[1]=i[1],a[2]=i[2]*Math.cos(n)-i[0]*Math.sin(n),e[0]=a[0]+r[0],e[1]=a[1]+r[1],e[2]=a[2]+r[2],e}function eg(e,t,r,n){var i=[],a=[];return i[0]=t[0]-r[0],i[1]=t[1]-r[1],i[2]=t[2]-r[2],a[0]=i[0]*Math.cos(n)-i[1]*Math.sin(n),a[1]=i[0]*Math.sin(n)+i[1]*Math.cos(n),a[2]=i[2],e[0]=a[0]+r[0],e[1]=a[1]+r[1],e[2]=a[2]+r[2],e}function ex(e){return e[0]=0,e[1]=0,e[2]=0,e}var ev=ei,eb=et;function ew(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e}function eD(e,t,r){var n=t[0],i=t[1],a=t[2],s=t[3];return e[0]=r[0]*n+r[4]*i+r[8]*a+r[12]*s,e[1]=r[1]*n+r[5]*i+r[9]*a+r[13]*s,e[2]=r[2]*n+r[6]*i+r[10]*a+r[14]*s,e[3]=r[3]*n+r[7]*i+r[11]*a+r[15]*s,e}Q();var e_=function(e,t,r){return e[0]=t[0]*r[0],e[1]=t[1]*r[1],e[2]=t[2]*r[2],e[3]=t[3]*r[3],e};function eA(){var e=new P(4);return P!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e[3]=1,e}function eE(e,t,r){var n=t[0],i=t[1],a=t[2],s=t[3],o=r[0],l=r[1],u=r[2],h=r[3];return e[0]=n*h+s*o+i*u-a*l,e[1]=i*h+s*l+a*o-n*u,e[2]=a*h+s*u+n*l-i*o,e[3]=s*h-n*o-i*l-a*u,e}function eS(e,t,r,n){var i,a,s,o,l=t[0],u=t[1],h=t[2],c=t[3],p=r[0],f=r[1],d=r[2],y=r[3],m=l*p+u*f+h*d+c*y;return m<0&&(m=-m,p=-p,f=-f,d=-d,y=-y),1-m>1e-6?(a=Math.sin(i=Math.acos(m)),s=Math.sin((1-n)*i)/a,o=Math.sin(n*i)/a):(s=1-n,o=n),e[0]=s*l+o*p,e[1]=s*u+o*f,e[2]=s*h+o*d,e[3]=s*c+o*y,e}function eF(e,t,r,n){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"zyx",a=Math.PI/360;t*=a,n*=a,r*=a;var s=Math.sin(t),o=Math.cos(t),l=Math.sin(r),u=Math.cos(r),h=Math.sin(n),c=Math.cos(n);switch(i){case"xyz":e[0]=s*u*c+o*l*h,e[1]=o*l*c-s*u*h,e[2]=o*u*h+s*l*c,e[3]=o*u*c-s*l*h;break;case"xzy":e[0]=s*u*c-o*l*h,e[1]=o*l*c-s*u*h,e[2]=o*u*h+s*l*c,e[3]=o*u*c+s*l*h;break;case"yxz":e[0]=s*u*c+o*l*h,e[1]=o*l*c-s*u*h,e[2]=o*u*h-s*l*c,e[3]=o*u*c+s*l*h;break;case"yzx":e[0]=s*u*c+o*l*h,e[1]=o*l*c+s*u*h,e[2]=o*u*h-s*l*c,e[3]=o*u*c-s*l*h;break;case"zxy":e[0]=s*u*c-o*l*h,e[1]=o*l*c+s*u*h,e[2]=o*u*h+s*l*c,e[3]=o*u*c-s*l*h;break;case"zyx":e[0]=s*u*c-o*l*h,e[1]=o*l*c+s*u*h,e[2]=o*u*h-s*l*c,e[3]=o*u*c+s*l*h;break;default:throw Error("Unknown angle order "+i)}return e}!function(){var e;e=new P(4),P!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0,e[3]=0)}();var ek=function(e,t,r,n){var i=new P(4);return i[0]=e,i[1]=t,i[2]=r,i[3]=n,i};function eT(){var e=new P(2);return P!=Float32Array&&(e[0]=0,e[1]=0),e}function eI(e,t){var r=new P(2);return r[0]=e,r[1]=t,r}function eC(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e}function eB(e){var t=e[0],r=e[1];return Math.sqrt(t*t+r*r)}function eM(e){return e[0]=0,e[1]=0,e}Q(),er(1,0,0),er(0,1,0),eA(),eA(),z();var eP=function(e){var t=e[0],r=e[1];return t*t+r*r};eT();let ez=8192;function eL(e,t,r){return t*(ez/(e.tileSize*2**(r-e.tileID.overscaledZ)))}function eV(e){return e instanceof Error?e:Error("string"==typeof e?e:String(e))}function eR(){return new Float64Array(4)}function eO(){return new Float64Array(3)}function e$(){return new Float64Array(16)}function eN(){let e=new Float64Array(16);return $(e),e}function eU(){let e=new Float32Array(16);return $(e),e}function eq(e,t,r,n,i=!1){if(!r[0]&&!r[1])return[0,0];let a=i?"map"===n?-e.bearingInRadians:0:"viewport"===n?e.bearingInRadians:0;if(a){let e=Math.sin(a),t=Math.cos(a);r=[r[0]*t-r[1]*e,r[0]*e+r[1]*t]}return[i?r[0]:eL(t,r[0],e.zoom),i?r[1]:eL(t,r[1],e.zoom)]}function ej(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]}function eG(e,t,r){var n,i,a,s,o,l,u,h,c,p;let f=(i=(n=[e[0],e[1],e[2],t[0],t[1],t[2],r[0],r[1],r[2]])[0],a=n[1],s=n[2],o=n[3],l=n[4],u=n[5],h=n[6],c=n[7],i*((p=n[8])*l-u*c)+a*(-p*o+u*h)+s*(c*o-l*h));if(0===f)return null;let d=ec([],[t[0],t[1],t[2]],[r[0],r[1],r[2]]),y=ec([],[r[0],r[1],r[2]],[e[0],e[1],e[2]]),m=ec([],[e[0],e[1],e[2]],[t[0],t[1],t[2]]),g=ea([],d,-e[3]);return en(g,g,ea([],y,-t[3])),en(g,g,ea([],m,-r[3])),ea(g,g,1/f),g}function eY(e,t,r){let n=e[0]*r[0]+e[1]*r[1]+e[2]*r[2],i=t[0]*r[0]+t[1]*r[1]+t[2]*r[2];return 0===i?null:(-n-r[3])/i}function eX(e,t,r,n){let i=Math.sqrt(e*e+t*t),a=Math.sqrt(r*r+n*n);e/=i,t/=i;let s=Math.acos(e*(r/=a)+t*(n/=a));return-t*r+e*n>0?s:-s}function eW(e,t){let r=eH(e,360),n=eH(t,360),i=n-r,a=n>r?i-360:i+360;return Math.abs(i)<Math.abs(a)?i:a}function eZ(e,t){let r=eH(e,2*Math.PI),n=eH(t,2*Math.PI);return Math.min(Math.abs(r-n),Math.abs(r-n+2*Math.PI),Math.abs(r-n-2*Math.PI))}function eH(e,t){return(e%t+t)%t}
1function eK(e,t,r,n,i){return eJ(n,i,e3((e-t)/(r-t),0,1))}function eJ(e,t,r){return e*(1-r)+t*r}function eQ(e){let t=1/0,r=1/0,n=-1/0,i=-1/0;for(let a of e)t=Math.min(t,a.x),r=Math.min(r,a.y),n=Math.max(n,a.x),i=Math.max(i,a.y);return[t,r,n,i]}function e1(e){if(!e.length)return new Set;let t=Math.max(...e.map(e=>e.canonical.z)),r=1/0,n=-1/0,i=1/0,a=-1/0,s=[];for(let o of e){let{x:e,y:l,z:u}=o.canonical,h=2**(t-u),c=e*h,p=l*h;s.push({id:o,x:c,y:p}),c<r&&(r=c),c>n&&(n=c),p<i&&(i=p),p>a&&(a=p)}let o=new Set;for(let e of s)(e.x===r||e.x===n||e.y===i||e.y===a)&&o.add(e.id);return o}function e0(e,t,r,n){let i,a,s,o,l,u;return i=3*e,a=3*(r-e)-i,s=1-i-a,o=3*t,l=3*(n-t)-o,u=1-o-l,function(e,t=1e-6){if(e<=0)return 0;if(e>=1)return 1;let r=e;for(let n=0;n<8;n++){let n=((s*r+a)*r+i)*r-e;if(Math.abs(n)<t)return((u*r+l)*r+o)*r;let h=(3*s*r+2*a)*r+i;if(1e-6>Math.abs(h))break;r-=n/h}let n=0,h=1;r=e;for(let o=0;o<20;o++){let o=((s*r+a)*r+i)*r;if(Math.abs(o-e)<t)break;e>o?n=r:h=r,r=(n+h)*.5}return((u*r+l)*r+o)*r}}let e2=e0(.25,.1,.25,1);function e3(e,t,r){return Math.min(r,Math.max(t,e))}function e5(e,t,r){let n=r-t,i=((e-t)%n+n)%n+t;return i===t?r:i}function e6(e,...t){for(let r of t)for(let t in r)e[t]=r[t];return e}function e4(e,t){let r={};for(let n of t)n in e&&(r[n]=e[n]);return r}let e8=1;function e7(){return e8++}function e9(e){return e<=1?1:2**Math.ceil(Math.log(e)/Math.LN2)}function te(e){return 2**e}function tt(e){return Math.log(e)/Math.LN2}function tr(e,t,r){if(t<=0)return e;let n=1/t;return void 0===r||1e-10>Math.abs(r)?Math.round(e*n)/n:(r>0?Math.ceil(e*n-1e-9):Math.floor(e*n+1e-10))/n}function tn(e,t,r){let n={};for(let i in e)n[i]=t.call(r||this,e[i],i,e);return n}function ti(e,t,r){let n={};for(let i in e)t.call(r||this,e[i],i,e)&&(n[i]=e[i]);return n}function ta(e){return Array.isArray(e)?e.map(ta):"object"==typeof e&&e?tn(e,ta):e}let ts={};function to(e){ts[e]||("u">typeof console&&console.warn(e),ts[e]=!0)}function tl(e,t,r){return(r.y-e.y)*(t.x-e.x)>(t.y-e.y)*(r.x-e.x)}function tu(e,t,r,n){let i=t.y-e.y,a=t.x-e.x,s=n.y-r.y,o=n.x-r.x,l=s*a-o*i;if(0===l)return null;let u=(o*(e.y-r.y)-s*(e.x-r.x))/l;return new C(e.x+u*a,e.y+u*i)}function th([e,t,r]){return t+=90,[e*Math.cos(t*=Math.PI/180)*Math.sin(r*=Math.PI/180),e*Math.sin(t)*Math.sin(r),e*Math.cos(r)]}function tc(e){return"u">typeof WorkerGlobalScope&&void 0!==e&&e instanceof WorkerGlobalScope}function tp(e){let t={};if(e.replace(/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(e,r,n,i)=>{let a=n||i;return t[r]=!a||a.toLowerCase(),""}),t["max-age"]){let e=parseInt(t["max-age"],10);isNaN(e)?delete t["max-age"]:t["max-age"]=e}return t}let tf=null;function td(e){if(null==tf){let t=e.navigator?e.navigator.userAgent:null;tf=!!e.safari||!!(t&&(/\b(iPad|iPhone|iPod)\b/.test(t)||t.match("Safari")&&!t.match("Chrome")))}return tf}function ty(e){return"u">typeof ImageBitmap&&e instanceof ImageBitmap}let tm=async(e,t)=>{let r=new Blob([new Uint8Array(e)],{type:"image/png"});try{return createImageBitmap(r,t)}catch(e){throw Error(`Could not load image because of ${eV(e).message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`)}},tg=e=>new Promise((t,r)=>{let n=new Image;n.onload=()=>{t(n),URL.revokeObjectURL(n.src),n.onload=null,window.requestAnimationFrame(()=>n.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=")},n.onerror=()=>r(Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."));let i=new Blob([new Uint8Array(e)],{type:"image/png"});n.src=URL.createObjectURL(i)});async function tx(e,t,r,n,i){if(typeof VideoFrame>"u")throw Error("VideoFrame not supported");let a=new VideoFrame(e,{timestamp:0});try{let s,o,l,u=a?.format;if(!u||!(u.startsWith("BGR")||u.startsWith("RGB")))throw Error(`Unrecognized format ${u}`);let h=u.startsWith("BGR"),c=new Uint8ClampedArray(n*i*4);if(await a.copyTo(c,(s=(Math.max(0,r)-r)*n*4+4*Math.max(-t,0),o=Math.max(0,t),l=
1Math.max(0,r),{rect:{x:o,y:l,width:Math.min(e.width,t+n)-o,height:Math.min(e.height,r+i)-l},layout:[{offset:s,stride:4*n}]})),h)for(let e=0;e<c.length;e+=4){let t=c[e];c[e]=c[e+2],c[e+2]=t}return c}finally{a.close()}}function tv(e,t,r,n){return e.addEventListener(t,r,n),{unsubscribe:()=>{e.removeEventListener(t,r,n)}}}function tb(e){return e*Math.PI/180}function tw(e){return e/Math.PI*180}function tD(e,t){return e.roll==t.roll&&e.pitch==t.pitch&&e.bearing==t.bearing}function t_(e){var t,r,n,i,a,s,o,l,u,h,c,p,f,d,y,m;let g=new Float64Array(9);t=e[0],r=e[1],n=e[2],i=e[3],a=t+t,s=r+r,o=n+n,l=t*a,u=r*a,h=r*s,c=n*a,p=n*s,f=n*o,d=i*a,y=i*s,m=i*o,g[0]=1-h-f,g[3]=u-m,g[6]=c+y,g[1]=u+m,g[4]=1-l-f,g[7]=p-d,g[2]=c-y,g[5]=p+d,g[8]=1-l-h;let x=tw(-Math.asin(e3(g[2],-1,1))),v,b;return .001>Math.hypot(g[5],g[8])?(v=0,b=-tw(Math.atan2(g[3],g[4]))):(v=tw(0===g[5]&&0===g[8]?0:Math.atan2(g[5],g[8])),b=tw(0===g[1]&&0===g[0]?0:Math.atan2(g[1],g[0]))),{roll:v,pitch:x+90,bearing:b}}function tA(e,t,r){let n=eI(t.x-r.x,t.y-r.y),i=eI(e.x-r.x,e.y-r.y);return tw(Math.atan2(n[0]*i[1]-n[1]*i[0],n[0]*i[0]+n[1]*i[1]))}function tE(e,t,r){let n=new Float64Array(4);return eF(n,e,t-90,r),n}let tS=85.051129,tF={touchstart:!0,touchmove:!0,touchmoveWindow:!0,touchend:!0,touchcancel:!0},tk={dblclick:!0,click:!0,mouseover:!0,mouseout:!0,mousedown:!0,mousemove:!0,mousemoveWindow:!0,mouseup:!0,mouseupWindow:!0,contextmenu:!0,wheel:!0};function tT(e,t){return tF[t]&&"touches"in e}function tI(e,t){if(!tk[t])return!1;let r=e?.target?.ownerDocument?.defaultView||window;return e instanceof r.MouseEvent||e instanceof r.WheelEvent}function tC(e){return tF[e]||tk[e]}let tB="AbortError";var tM=class extends Error{constructor(e=tB){super(e instanceof Error?e.message:e),this.name=tB,e instanceof Error&&e.stack&&(this.stack=e.stack)}};function tP(e){return e instanceof Error&&"AbortError"===e.name}function tz(e){if(e.aborted)throw new tM(e.reason)}let tL={MAX_PARALLEL_IMAGE_REQUESTS:16,MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:8,MAX_TILE_CACHE_ZOOM_LEVELS:5,REGISTERED_PROTOCOLS:{},WORKER_URL:""};function tV(e){return tL.REGISTERED_PROTOCOLS[e.substring(0,e.indexOf("://"))]}let tR="global-dispatcher";var tO=class extends Error{constructor(e,t,r,n){super(`AJAXError: ${t} (${e}): ${r}`),this.status=e,this.statusText=t,this.url=r,this.body=n}};function t$(){if(tc(self))return self.worker?.referrer;if("blob:"===window.location.protocol)try{return window.parent.location.href}catch{}return window.location.href}async function tN(e,t){let r,n,i=new Request(e.url,{method:e.method||"GET",body:e.body,credentials:e.credentials,headers:e.headers,cache:e.cache,referrer:t$(),referrerPolicy:e.referrerPolicy,signal:t.signal});"json"!==e.type||i.headers.has("Accept")||i.headers.set("Accept","application/json");try{r=await fetch(i)}catch(t){throw tP(t)?t:new tO(0,eV(t).message,e.url,new Blob)}if(!r.ok){let t=await r.blob();throw new tO(r.status,r.statusText,e.url,t)}n="arrayBuffer"===e.type||"image"===e.type?r.arrayBuffer():"json"===e.type?r.json():r.text();let a=await n;return tz(t.signal),{data:a,cacheControl:r.headers.get("Cache-Control"),expires:r.headers.get("Expires"),etag:r.headers.get("ETag")}}let tU=async function(e,t){let r;if(e.url.includes("://")&&!/^https?:|^file:/.test(e.url)){let r=tV(e.url);if(r){let n=await r(e,t);return n.data||"arrayBuffer"!==e.type?n:e6(n,{data:new ArrayBuffer(0)})}if(tc(self)&&self.worker?.actor)return self.worker.actor.sendAsync({type:"GR",data:e,targetMapId:tR},t)}if(!((r=e.url).startsWith("file:")||t$()?.startsWith("file:")&&!/^\w+:/.test(r))){if(fetch&&Request&&AbortController&&Object.hasOwn(Request.prototype,"signal"))return tN(e,t);if(tc(self)&&self.worker?.actor)return self.worker.actor.sendAsync({type:"GR",data:e,mustQueue:!0,targetMapId:tR},t)}return new Promise((r,n)=>{let i=new XMLHttpRequest;for(let t in i.open(e.method||"GET",e.url,!0),("arrayBuffer"===e.type||"image"===e.type)&&(i.responseType="arraybuffer"),e.headers)i.setRequestHeader(t,e.headers[t]);"json"===e.type&&(i.responseType="text",e.headers?.Accept||i.setRequestHeader("Accept","application/json")),i.withCredentials="include"===e.credentials,i.onerror=()=>{n(Error(i.statusText))},i.onload=()=>
1{if(!t.signal.aborted)if((i.status>=200&&i.status<300||0===i.status)&&null!==i.response){let t=i.response;if("json"===e.type)try{t=JSON.parse(i.response)}catch(e){n(e);return}r({data:t,cacheControl:i.getResponseHeader("Cache-Control"),expires:i.getResponseHeader("Expires"),etag:i.getResponseHeader("ETag")})}else{let t=new Blob([i.response],{type:i.getResponseHeader("Content-Type")});n(new tO(i.status,i.statusText,e.url,t))}},t.signal.addEventListener("abort",()=>{i.abort(),n(new tM(t.signal.reason))}),i.send(e.body)})},tq=(e,t)=>tU(e6(e,{type:"json"}),t),tj=(e,t)=>tU(e6(e,{type:"arrayBuffer"}),t);function tG(e){if(!e||e.startsWith("data:image/"))return!0;if(e.startsWith("blob:")&&(e=e.slice(5)).startsWith("null"))return!1;if(0>=e.indexOf("://"))return!0;let t=new URL(e),r=window.location;return t.protocol===r.protocol&&t.host===r.host}let tY=e=>{let t=window.document.createElement("video");return t.muted=!0,new Promise(r=>{for(let n of(t.onloadstart=()=>{r(t)},e)){let e=window.document.createElement("source");tG(n)||(t.crossOrigin="Anonymous"),e.src=n,t.appendChild(e)}})};function tX(e,t,r){r[e]?.includes(t)||(r[e]||=[],r[e].push(t))}function tW(e,t,r){if(r?.[e]){let n=r[e].indexOf(t);-1!==n&&r[e].splice(n,1)}}var tZ=class{constructor(e,t={}){e6(this,t),this.type=e}},tH=class extends tZ{constructor(e,t={}){super("error",e6({error:e},t))}},tK=class{on(e,t){return this._listeners||={},tX(e,t,this._listeners),{unsubscribe:()=>{this.off(e,t)}}}off(e,t){return tW(e,t,this._listeners),tW(e,t,this._oneTimeListeners),this}once(e,t){return t?(this._oneTimeListeners||={},tX(e,t,this._oneTimeListeners),this):new Promise(t=>this.once(e,t))}fire(e,t){let r="string"==typeof e?new tZ(e,t||{}):e,n=r.type;if(this.listens(n)){for(let e of(r.target=this,this._listeners?.[n]?.slice()??[]))e.call(this,r);for(let e of this._oneTimeListeners?.[n]?.slice()??[])tW(n,e,this._oneTimeListeners),e.call(this,r);let e=this._eventedParent;e&&(e6(r,"function"==typeof this._eventedParentData?this._eventedParentData():this._eventedParentData),e.fire(r))}else r instanceof tH&&console.error(r.error);return this}listens(e){return!!(this._listeners?.[e]?.length||this._oneTimeListeners?.[e]?.length||this._eventedParent?.listens(e))}setEventedParent(e,t){return this._eventedParent=e,this._eventedParentData=t,this}},tJ={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number",length:2},centerAltitude:{type:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},roll:{type:"number",default:0,units:"degrees"},state:{type:"state",default:{}},light:{type:"light"},sky:{type:"sky"},projection:{type:"projection"},terrain:{type:"terrain"},sources:{required:!0,type:"sources"},sprite:{type:"sprite"},glyphs:{type:"string"},"font-faces":{type:"fontFaces"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{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},encoding:{type:"enum",values:{mvt:{},mlt:{}},default:"mvt"},"*":{type:"*"}},source_raster:{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:"*"}},source_raster_dem:{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:"*"}},source_geojson:{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:"filter"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0}
vendor: 27,105 bytes, line 1
1,clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},source_video:{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"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},"color-relief":{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_color-relief","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"},"fill-extrusion-rounded-corner-distance":{type:"number",default:0,minimum:0,units:"meters","property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"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","feature"]},"property-type":"data-driven"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_symbol:{"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","feature"]},"property-type":"data-driven"},"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"},"symbol-height-offset":{type:"number",default:0,units:"meters",requires:[{"symbol-placement":["point"]}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-height-anchor":{type:"enum",values:{ground:{},absolute:{}},default:"ground",requires:["symbol-height-offset"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},"layout_color-relief":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},filter:{type:"boolean",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},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:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"expression_name",minimum:1},light:{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}},sky:{"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}},terrain:{source:{type:"string",required:!0},exaggeration:{type:"number",minimum:0,default:1}},projection:{type:{type:"projectionDefinition",default:"mercator","property-type":"data-constant",transition:!1,expression:{interpolated:!0,parameters:["zoom"]}}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_color-relief","paint_background"],paint_fill:{"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-layer-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","global-state"]},"property-type":"data-constant"},"fill-color":{type:"color",default:"#000000",transition:!0,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"}},"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,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default: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:{"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-layer-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","global-state"]},"property-type":"data-constant"},"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","feature"]},"property-type":"cross-faded-data-driven"},"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"}},paint_circle:{"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"}},paint_heatmap:{"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"}},paint_symbol:{"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"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}
1,"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"},resampling:{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,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"}},paint_hillshade:{"hillshade-illumination-direction":{type:"numberArray",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-altitude":{type:"numberArray",default:45,minimum:0,maximum:90,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"colorArray",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"colorArray",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-method":{type:"enum",values:{standard:{},basic:{},combined:{},igor:{},multidirectional:{}},default:"standard",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},resampling:{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},"paint_color-relief":{"color-relief-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"color-relief-color":{type:"color",transition:!1,expression:{interpolated:!0,parameters:["elevation"]},"property-type":"color-ramp"},resampling:{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"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"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"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:{"*":{type:"string"}},interpolation:{type:"array",value:"interpolation_name",minimum:1},interpolation_name:{type:"enum",values:{linear:{syntax:{overloads:[{parameters:[],"output-type":"interpolation"}],parameters:[]}},exponential:{syntax:{overloads:[{parameters:["base"],"output-type":"interpolation"}],parameters:[{name:"base",type:"number literal"}]}},"cubic-bezier":{syntax:{overloads:[{parameters:["x1","y1","x2","y2"],"output-type":"interpolation"}],parameters:[{name:"x1",type:"number literal"},{name:"y1",type:"number literal"},{name:"x2",type:"number literal"},{name:"y2",type:"number literal"}]}}}}};let tQ=tJ,t1=["type","source","source-layer","minzoom","maxzoom","filter","layout"];var t0=class{constructor(e,t,r,n,i="error"){this.message=(e?`${e}: `:"")+r,n&&(this.identifier=n),this.severity=i,null!=t&&t.__line__&&(this.line=t.__line__)}};let t2={kind:"null"},t3={kind:"number"},t5={kind:"string"},t6={kind:"boolean"},t4={kind:"color"},t8={kind:"projectionDefinition"},t7={kind:"object"},t9={kind:"value"},re={kind:"collator"},rt={kind:"formatted"},rr={kind:"padding"},rn={kind:"colorArray"},ri={kind:"numberArray"},ra={kind:"resolvedImage"},rs={kind:"variableAnchorOffsetCollection"};function ro(e,t){return{kind:"array",itemType:e,N:t}}function rl(e){if("array"===e.kind){let t=rl(e.itemType);return"number"==typeof e.N?`array<${t}, ${e.N}>`:"value"===e.itemType.kind?"array":`array<${t}>`}return e.kind}let ru=[t2,t3,t5,t6,t4,t8,rt,t7,ro(t9),rr,ri,rn,ra,rs];function rh(e,t){if("error"===t.kind)return null;if("array"===e.kind){if("array"===t.kind&&(0===t.N&&"value"===t.itemType.kind||!rh(e.itemType,t.itemType))&&("number"!=typeof e.N||e.N===t.N))return null}else if(e.kind===t.kind)return null;else if("value"===e.kind){for(let e of ru)if(!rh(e,t))return null}return`Expected ${rl(e)} but found ${rl(t)} instead.`}function rc(e,t){return t.some(t=>t.kind===e.kind)}function rp(e,t){return t.some(t=>"null"===t?null===e:"array"===t?Array.isArray(e):"object"===t?e&&!Array.isArray(e)&&"object"==typeof e:t===typeof e)}function rf(e,t){return"array"===e.kind&&"array"===t.kind?e.itemType.kind===t.itemType.kind&&"number"==typeof e.N:e.kind===t.kind}let rd=4/29,ry=6/29,rm=6/29*3*(6/29),rg=Math.PI/180,rx=180/Math.PI;function rv(e){return(e%=360)<0&&(e+=360),e}function rb([e,t,r,n]){e=rw(e);let i,a,s=rD((.2225045*e+.7168786*(t=rw(t))+.0606169*(r=rw(r)))/1);
1e===t&&t===r?i=a=s:(i=rD((.4360747*e+.3850649*t+.1430804*r)/.96422),a=rD((.0139322*e+.0971045*t+.7141733*r)/.82521));let o=116*s-16;return[o<0?0:o,500*(i-s),200*(s-a),n]}function rw(e){return e<=.04045?e/12.92:((e+.055)/1.055)**2.4}function rD(e){return e>.008856451679035631?e**(1/3):e/rm+rd}function r_([e,t,r,n]){let i=(e+16)/116,a=isNaN(t)?i:i+t/500,s=isNaN(r)?i:i-r/200;return i=+rE(i),[rA(3.1338561*(a=.96422*rE(a))-1.6168667*i-.4906146*(s=.82521*rE(s))),rA(-.9787684*a+1.9161415*i+.033454*s),rA(.0719453*a-.2289914*i+1.4052427*s),n]}function rA(e){return(e=e<=.00304?12.92*e:1.055*e**(1/2.4)-.055)<0?0:e>1?1:e}function rE(e){return e>ry?e*e*e:rm*(e-rd)}let rS=Object.hasOwn||function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};function rF(e,t){return rS(e,t)?e[t]:void 0}function rk(e){return parseInt(e.padEnd(2,e),16)/255}function rT(e,t){return rI(t?e/100:e,0,1)}function rI(e,t,r){return Math.min(Math.max(t,e),r)}function rC(e){return!e.some(Number.isNaN)}let rB={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};function rM(e,t,r){return e.map((e,n)=>e+r*(t[n]-e))}var rP=class e{constructor(e,t,r,n=1,i=!0){this.r=e,this.g=t,this.b=r,this.a=n,i||(this.r*=n,this.g*=n,this.b*=n,n||this.overwriteGetter("rgb",[e,t,r,n]))}static{this.black=new e(0,0,0,1)}static{this.white=new e(1,1,1,1)}static{this.transparent=new e(0,0,0,0)}static{this.red=new e(1,0,0,1)}static parse(t){if(t instanceof e)return t;if("string"!=typeof t)return;let r=function(e){if("transparent"===(e=e.toLowerCase().trim()))return[0,0,0,0];let t=rF(rB,e);if(t){let[e,r,n]=t;return[e/255,r/255,n/255,1]}if(e.startsWith("#")&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(e)){let t=e.length<6?1:2,r=1;return[rk(e.slice(r,r+=t)),rk(e.slice(r,r+=t)),rk(e.slice(r,r+=t)),rk(e.slice(r,r+t)||"ff")]}if(e.startsWith("rgb")){let t=e.match(/^rgba?\(\s*([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(t){let[e,r,n,i,a,s,o,l,u,h,c,p]=t,f=[i||" ",o||" ",h].join("");if(" "===f||" /"===f||",,"===f||",,,"===f){let e=[n,s,u].join(""),t="%%%"===e?100:255*(""===e);if(t){let e=[rI(r/t,0,1),rI(a/t,0,1),rI(l/t,0,1),c?rT(+c,p):1];if(rC(e))return e}}return}}let r=e.match(/^hsla?\(\s*([\de.+-]+)(?:deg)?(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(r){let[e,t,n,i,a,s,o,l,u]=r,h=[n||" ",a||" ",o].join("");if(" "===h||" /"===h||",,"===h||",,,"===h){let e=[+t,rI(+i,0,100),rI(+s,0,100),l?rT(+l,u):1];if(rC(e))return function([e,t,r,n]){function i(n){let i=(n+e/30)%12,a=t*Math.min(r,1-r);return r-a*Math.max(-1,Math.min(i-3,9-i,1))}return e=rv(e),t/=100,r/=100,[i(0),i(8),i(4),n]}(e)}}}(t);if(r)return new e(...r,!1)}get rgb(){let{r:e,g:t,b:r,a:n}=this,i=n||1/0;return this.overwriteGetter("rgb",[e/i,t/i,r/i,n])}get hcl(){return this.overwriteGetter("hcl",function(e){let[t,r,n,i]=rb(e),a=Math.sqrt(r*r+n*n);return[Math.round(1e4*a)?rv(Math.atan2(n,r)*rx):NaN,a,t,i]}(this.rgb))}get lab(){return this.overwriteGetter("lab",rb(this.rgb))}overwriteGetter(e,t){return Object.defineProperty(this,e,{value:t}),t}toString(){let[e,t,r,n]=this.rgb;return`rgba(${[e,t,r].map(e=>Math.round(255*e)).join(",")},${n})`}static interpolate(t,r,n,i="rgb"){switch(i){case"rgb":{let[i,a,s,o]=rM(t.rgb,r.rgb,n);return new e(i,a,s,o,!1)}case"hcl":{let[i,a,s,o]=t.hcl,[l,u,h,c]=r.hcl,p,f;
1if(isNaN(i)||isNaN(l))isNaN(i)?isNaN(l)?p=NaN:(p=l,(1===s||0===s)&&(f=u)):(p=i,(1===h||0===h)&&(f=a));else{let e=l-i;l>i&&e>180?e-=360:l<i&&i-l>180&&(e+=360),p=i+n*e}let[d,y,m,g]=function([e,t,r,n]){return r_([r,Math.cos(e=isNaN(e)?0:e*rg)*t,Math.sin(e)*t,n])}([p,f??a+n*(u-a),s+n*(h-s),o+n*(c-o)]);return new e(d,y,m,g,!1)}case"lab":{let[i,a,s,o]=r_(rM(t.lab,r.lab,n));return new e(i,a,s,o,!1)}}}};let rz=["bottom","center","top"];var rL=class{constructor(e,t,r,n,i,a){this.text=e,this.image=t,this.scale=r,this.fontStack=n,this.textColor=i,this.verticalAlign=a}},rV=class e{constructor(e){this.sections=e}static fromString(t){return new e([new rL(t,null,null,null,null,null)])}isEmpty(){return 0===this.sections.length||!this.sections.some(e=>0!==e.text.length||e.image&&0!==e.image.name.length)}static factory(t){return t instanceof e?t:e.fromString(t)}toString(){return 0===this.sections.length?"":this.sections.map(e=>e.text).join("")}},rR=class e{constructor(e){this.values=e.slice()}static parse(t){if(t instanceof e)return t;if("number"==typeof t)return new e([t,t,t,t]);if(Array.isArray(t)&&!(t.length<1||t.length>4)){for(let e of t)if("number"!=typeof e)return;switch(t.length){case 1:t=[t[0],t[0],t[0],t[0]];break;case 2:t=[t[0],t[1],t[0],t[1]];break;case 3:t=[t[0],t[1],t[2],t[1]]}return new e(t)}}toString(){return JSON.stringify(this.values)}static interpolate(t,r,n){return new e(rM(t.values,r.values,n))}},rO=class e{constructor(e){this.values=e.slice()}static parse(t){if(t instanceof e)return t;if("number"==typeof t)return new e([t]);if(Array.isArray(t)){for(let e of t)if("number"!=typeof e)return;return new e(t)}}toString(){return JSON.stringify(this.values)}static interpolate(t,r,n){return new e(rM(t.values,r.values,n))}},r$=class e{constructor(e){this.values=e.slice()}static parse(t){if(t instanceof e)return t;if("string"==typeof t){let r=rP.parse(t);return r?new e([r]):void 0}if(!Array.isArray(t))return;let r=[];for(let e of t){if("string"!=typeof e)return;let t=rP.parse(e);if(!t)return;r.push(t)}return new e(r)}toString(){return JSON.stringify(this.values)}static interpolate(t,r,n,i="rgb"){let a=[];if(t.values.length!=r.values.length)throw Error(`colorArray: Arrays have mismatched length (${t.values.length} vs. ${r.values.length}), cannot interpolate.`);for(let e=0;e<t.values.length;e++)a.push(rP.interpolate(t.values[e],r.values[e],n,i));return new e(a)}},rN=class extends Error{constructor(e,t){super(e),this.name="RuntimeError",this.path=t}toJSON(){return this.message}};let rU=new Set(["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"]);var rq=class e{constructor(e){this.values=e.slice()}static parse(t){if(t instanceof e)return t;if(!(!Array.isArray(t)||t.length<1||t.length%2!=0)){for(let e=0;e<t.length;e+=2){let r=t[e],n=t[e+1];if("string"!=typeof r||!rU.has(r)||!Array.isArray(n)||2!==n.length||"number"!=typeof n[0]||"number"!=typeof n[1])return}return new e(t)}}toString(){return JSON.stringify(this.values)}static interpolate(t,r,n,i){let a=t.values,s=r.values;if(a.length!==s.length)throw new rN(`Cannot interpolate values of different length. from: ${t.toString()}, to: ${r.toString()}`,i);let o=[];for(let e=0;e<a.length;e+=2){if(a[e]!==s[e])throw new rN(`Cannot interpolate values containing mismatched anchors. from[${e}]: ${a[e]}, to[${e}]: ${s[e]}`,i);o.push(a[e]);let[t,r]=a[e+1],[l,u]=s[e+1];o.push([t+n*(l-t),r+n*(u-r)])}return new e(o)}},rj=class e{constructor(e){this.name=e.name,this.available=e.available}toString(){return this.name}static fromString(t){return t?new e({name:t,available:!1}):null}},rG=class e{constructor(e,t,r){this.from=e,this.to=t,this.transition=r}toString(){return this.from===this.to&&1===this.transition?this.from:JSON.stringify([this.from,this.to,this.transition])}static interpolate(t,r,n){return new e(t,r,n)}static parse(t){return t instanceof e?t:Array.isArray(t)&&3===t.length&&"string"==typeof t[0]&&"string"==typeof t[1]&&"number"==typeof t[2]?new e(t[0],t[1],t[2]):"object"==typeof t&&"string"==typeof t.from&&"string"==typeof t.to&&"number"==typeof t.transition?new e(t.from,t.to,t.transition):"string"==typeof t?new e(t,t,1):void 0}},rY=class{constructor(e,t,r){this.sensitivity=e?t?"variant":"case":t?"accent":"base",this.locale=r,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(e,t){return this.collator.compare(e,t)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}};function rX(e,t,r,n){return"number"==typeof e&&e>=0&&e<=255&&"number"==typeof t&&t>=0&&t<=255&&"number"==typeof r&&r>=0&&r<=255?void 0===n||"number"==typeof n&&n>=0&&n<=1?null:`Invalid rgba value [${[e,t,r,n].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${("number"==typeof n?[e,t,r,n]:[e,t,r]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function rW(e){if(null===e||"string"==typeof e||"boolean"==typeof e||"number"==typeof e||e instanceof rG||e instanceof rP||e instanceof rY||e instanceof rV||e instanceof rR||e instanceof rO||e instanceof r$||e instanceof rq||e instanceof rj)return!0;
1if(Array.isArray(e)){for(let t of e)if(!rW(t))return!1;return!0}if("object"==typeof e){for(let t in e)if(!rW(e[t]))return!1;return!0}return!1}function rZ(e){if(null===e)return t2;if("string"==typeof e)return t5;if("boolean"==typeof e)return t6;if("number"==typeof e)return t3;if(e instanceof rP)return t4;if(e instanceof rG)return t8;if(e instanceof rY)return re;if(e instanceof rV)return rt;if(e instanceof rR)return rr;if(e instanceof rO)return ri;if(e instanceof r$)return rn;if(e instanceof rq)return rs;if(e instanceof rj)return ra;if(Array.isArray(e)){let t=e.length,r;for(let t of e){let e=rZ(t);if(r){if(r===e)continue;r=t9;break}r=e}return ro(r||t9,t)}return t7}function rH(e){let t=typeof e;return null===e?"":"string"===t||"number"===t||"boolean"===t?String(e):e instanceof rP||e instanceof rG||e instanceof rV||e instanceof rR||e instanceof rO||e instanceof r$||e instanceof rq||e instanceof rj?e.toString():JSON.stringify(e)}var rK=class e{constructor(e,t){this.type=e,this.value=t}static parse(t,r){if(2!==t.length)return r.error(`'literal' expression requires exactly one argument, but found ${t.length-1} instead.`);if(!rW(t[1]))return r.error(`invalid value of type "${typeof t[1]}"`);let n=t[1],i=rZ(n),a=r.expectedType;return"array"===i.kind&&0===i.N&&a&&"array"===a.kind&&("number"!=typeof a.N||0===a.N)&&(i=a),new e(i,n)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}};let rJ=["Unknown","Point","LineString","Polygon"];var rQ=class{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache=new Map,this.availableImages=null,this.canonical=null}id(){return this.feature&&"id"in this.feature?this.feature.id:null}geometryType(){return this.feature?"number"==typeof this.feature.type?rJ[this.feature.type]:this.feature.type:null}geometry(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null}canonicalID(){return this.canonical}properties(){return this.feature&&this.feature.properties||{}}parseColor(e){let t=this._parseColorCache.get(e);return t||(t=rP.parse(e),this._parseColorCache.set(e,t)),t}};function r1(e,t,r){let n=e.length-1,i=0,a=n,s=0,o,l;for(;i<=a;)if(o=e[s=Math.floor((i+a)/2)],l=e[s+1],o<=t){if(s===n||t<l)return s;i=s+1}else if(o>t)a=s-1;else throw new rN("Input is not a number.",r);return 0}var r0=class e{constructor(e,t,r,n){for(let[i,a]of(this.type=e,this.input=t,this.key=n,this.labels=[],this.outputs=[],r))this.labels.push(i),this.outputs.push(a)}static parse(t,r){if(t.length-1<4)return r.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if((t.length-1)%2!=0)return r.error("Expected an even number of arguments.");let n=r.parse(t[1],1,t3);if(!n)return null;let i=[],a=null;r.expectedType&&"value"!==r.expectedType.kind&&(a=r.expectedType);for(let e=1;e<t.length;e+=2){let n=1===e?-1/0:t[e],s=t[e+1],o=e,l=e+1;if("number"!=typeof n)return r.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',o);if(i.length&&i[i.length-1][0]>=n)return r.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',o);let u=r.parse(s,l,a);if(!u)return null;a||=u.type,i.push([n,u])}return new e(a,n,i,r.key)}evaluate(e){let t=this.labels,r=this.outputs;if(1===t.length)return r[0].evaluate(e);let n=this.input.evaluate(e);if(n<=t[0])return r[0].evaluate(e);let i=t.length;return n>=t[i-1]?r[i-1].evaluate(e):r[r1(t,n,this.key)].evaluate(e)}eachChild(e){for(let t of(e(this.input),this.outputs))e(t)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}},r2=class e{constructor(e,t,r,n,i,a){for(let[s,o]of(this.type=e,this.operator=t,this.interpolation=r,this.input=n,this.key=a,this.labels=[],this.outputs=[],i))this.labels.push(s),this.outputs.push(o)}static interpolationFactor(e,t,r,n){let i=0;if("exponential"===e.name)i=r3(t,e.base,r,n);else if("linear"===e.name)i=r3(t,1,r,n);else if("cubic-bezier"===e.name){var a,s,o,l;let u,h,c,p,f,d,y=e.controlPoints;i=(a=y[0],s=y[1],o=y[2],l=y[3],u=3*a,h=3*(o-a)-u,c=1-u-h,p=3*s,f=3*(l-s)-p,d=1-p-f,function(e,t=1e-6){if(e<=0)return 0;if(e>=1)return 1;let r=e;for(let n=0;n<8;n++){let n=((c*r+h)*r+u)*r-e;if(Math.abs(n)<t)return((d*r+f)*r+p)*r;let i=(3*c*r+2*h)*r+u;if(1e-6>Math.abs(i))break;r-=n/i}let n=0,i=1;r=e;for(let a=0;a<20;a++){let a=((c*r+h)*r+u)*r;if(Math.abs(a-e)<t)break;e>a?n=r:i=r,r=(n+i)*.5}return((d*r+f)*r+p)*r})(r3(t,1,r,n))}return i}static parse(t,r){let[n,i,a,...s]=t;if(!Array.isArray(i)||0===i.length)return r.error("Expected an interpolation type expression.",1);if("linear"===i[0])i={name:"linear"};else if("exponential"===i[0]){let e=i[1];if("number"!=typeof e)return r.error("Exponential interpolation requires a numeric base.",1,1);i={name:"exponential",base:e}}else{if("cubic-bezier"!==i[0])return r.error(`Unknown interpolation type ${String(i[0])}`,1,0);let e=i.slice(1);if(4!==e.length||e.some(e=>"number"!=typeof e||e<0||e>1))return r.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);i={name:"cubic-bezier",controlPoints:e}}if(t.length-1<4)return r.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if((t.length-1)%2!=0)return r.error("Expected an even number of arguments.");if(!(a=r.parse(a,2,t3)))return null;let o=[],l=null;("interpolate-hcl"===n||"interpolate-lab"===n)&&r.expectedType!=rn?l=t4:r.expectedType&&"value"!==r.expectedType.kind&&(l=r.expectedType);for(let e=0;e<s.length;e+=2){let t=s[e],n=s[e+1],i=e+3,a=e+4;if("number"!=typeof t)return r.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not c
1omputed expressions) for the input values.',i);if(o.length&&o[o.length-1][0]>=t)return r.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',i);let u=r.parse(n,a,l);if(!u)return null;l||=u.type,o.push([t,u])}return rf(l,t3)||rf(l,t8)||rf(l,t4)||rf(l,rr)||rf(l,ri)||rf(l,rn)||rf(l,rs)||rf(l,ro(t3))?new e(l,n,i,a,o,r.key):r.error(`Type ${rl(l)} is not interpolatable.`)}evaluate(t){let r=this.labels,n=this.outputs;if(1===r.length)return n[0].evaluate(t);let i=this.input.evaluate(t);if(i<=r[0])return n[0].evaluate(t);let a=r.length;if(i>=r[a-1])return n[a-1].evaluate(t);let s=r1(r,i,this.key),o=r[s],l=r[s+1],u=e.interpolationFactor(this.interpolation,i,o,l),h=n[s].evaluate(t),c=n[s+1].evaluate(t);switch(this.operator){case"interpolate":switch(this.type.kind){case"number":return h+u*(c-h);case"color":return rP.interpolate(h,c,u);case"padding":return rR.interpolate(h,c,u);case"colorArray":return r$.interpolate(h,c,u);case"numberArray":return rO.interpolate(h,c,u);case"variableAnchorOffsetCollection":return rq.interpolate(h,c,u,this.key);case"array":return rM(h,c,u);case"projectionDefinition":return rG.interpolate(h,c,u)}case"interpolate-hcl":switch(this.type.kind){case"color":return rP.interpolate(h,c,u,"hcl");case"colorArray":return r$.interpolate(h,c,u,"hcl")}case"interpolate-lab":switch(this.type.kind){case"color":return rP.interpolate(h,c,u,"lab");case"colorArray":return r$.interpolate(h,c,u,"lab")}}}eachChild(e){for(let t of(e(this.input),this.outputs))e(t)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}};function r3(e,t,r,n){let i=n-r,a=e-r;return 0===i?0:1===t?a/i:(t**a-1)/(t**i-1)}let r5={color:rP.interpolate,number:function(e,t,r){return e+r*(t-e)},padding:rR.interpolate,numberArray:rO.interpolate,colorArray:r$.interpolate,variableAnchorOffsetCollection:rq.interpolate,array:rM};var r6=class e{constructor(e){this.type=rt,this.sections=e}static parse(t,r){if(t.length<2)return r.error("Expected at least one argument.");let n=t[1];if(!Array.isArray(n)&&"object"==typeof n)return r.error("First argument must be an image or text section.");let i=[],a=!1;for(let e=1;e<=t.length-1;++e){let n=t[e];if(a&&"object"==typeof n&&!Array.isArray(n)){a=!1;let e=null;if(n["font-scale"]&&!(e=r.parse(n["font-scale"],1,t3)))return null;let t=null;if(n["text-font"]&&!(t=r.parse(n["text-font"],1,ro(t5))))return null;let s=null;if(n["text-color"]&&!(s=r.parse(n["text-color"],1,t4)))return null;let o=null;if(n["vertical-align"]){if("string"==typeof n["vertical-align"]&&!rz.includes(n["vertical-align"]))return r.error(`'vertical-align' must be one of: 'bottom', 'center', 'top' but found '${n["vertical-align"]}' instead.`);if(!(o=r.parse(n["vertical-align"],1,t5)))return null}let l=i[i.length-1];l.scale=e,l.font=t,l.textColor=s,l.verticalAlign=o}else{let n=r.parse(t[e],1,t9);if(!n)return null;let s=n.type.kind;if("string"!==s&&"value"!==s&&"null"!==s&&"resolvedImage"!==s)return r.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");a=!0,i.push({content:n,scale:null,font:null,textColor:null,verticalAlign:null})}}return new e(i)}evaluate(e){return new rV(this.sections.map(t=>{let r=t.content.evaluate(e);return rZ(r)===ra?new rL("",r,null,null,null,t.verticalAlign?t.verticalAlign.evaluate(e):null):new rL(rH(r),null,t.scale?t.scale.evaluate(e):null,t.font?t.font.evaluate(e).join(","):null,t.textColor?t.textColor.evaluate(e):null,t.verticalAlign?t.verticalAlign.evaluate(e):null)}))}eachChild(e){for(let t of this.sections)e(t.content),t.scale&&e(t.scale),t.font&&e(t.font),t.textColor&&e(t.textColor),t.verticalAlign&&e(t.verticalAlign)}outputDefined(){return!1}};function r4(e,t,r){let n=e[t];e[t]=e[r],e[r]=n}function r8(e,t){if(e.length<=1)return[e];let r=[],n,i;for(let t of e){let e=function(e){let t=0;for(let r=0,n=e.length,i=n-1,a,s;r<n;i=r++)a=e[r],t+=((s=e[i]).x-a.x)*(a.y+s.y);return t}(t);0!==e&&(t.area=Math.abs(e),void 0===i&&(i=e<0),i===e<0?(n&&r.push(n),n=[t]):n.push(t))}if(n&&r.push(n),t>1)for(let e=0;e<r.length;e++)r[e].length<=t||(function e(t,r,n=0,i=t.length-1,a=function(e,t){return e<t?-1:+(e>t)}){for(;i>n;){if(i-n>600){let s=i-n+1,o=r-n+1,l=Math.log(s),u=.5*Math.exp(2*l/3),h=.5*Math.sqrt(l*u*(s-u)/s)*(o-s/2<0?-1:1);e(t,r,Math.max(n,Math.floor(r-o*u/s+h)),Math.min(i,Math.floor(r+(s-o)*u/s+h)),a)}let s=t[r],o=n,l=i;for(r4(t,n,r),a(t[i],s)>0&&r4(t,n,i);o<l;){for(r4(t,o,l),o++,l--;0>a(t[o],s);)o++;for(;a(t[l],s)>0;)l--}0===a(t[n],s)?r4(t,n,l):r4(t,++l,i),l<=r&&(n=l+1),r<=l&&(i=l-1)}}(r[e],t,1,r[e].length-1,r7),r[e]=r[e].slice(0,t));return r}function r7(e,t){return t.area-e.area}let r9={string:t5,number:t3,boolean:t6,object:t7};var ne=class e{constructor(e,t,r){this.type=e,this.args=t,this.key=r}static parse(t,r){if(t.length<2)return r.error("Expected at least one argument.");let n=1,i,a=t[0];if("array"===a){let e,a;if(t.length>2){let i=t[1];if("string"!=typeof i||!(i in r9)||"object"===i)return r.error('The item type argument of "array" must be one of string, number, boolean',1);e=r9[i],n++}else e=t9;if(t.length>3){if(null!==t[2]&&("number"!=typeof t[2]||t[2]<0||t[2]!==Math.floor(t[2])))return r.error('The length argument to "array" must be a positive integer literal',2);a=t[2],n++}
1i=ro(e,a)}else{if(!r9[a])throw Error(`Types doesn't contain name = ${a}`);i=r9[a]}let s=[];for(;n<t.length;n++){let e=r.parse(t[n],n,t9);if(!e)return null;s.push(e)}return new e(i,s,r.key)}evaluate(e){for(let t=0;t<this.args.length;t++){let r=this.args[t].evaluate(e);if(!rh(this.type,rZ(r)))return r;if(t===this.args.length-1)throw new rN(`Expected value to be of type ${rl(this.type)}, but found ${rl(rZ(r))} instead.`,this.key)}throw Error()}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}};let nt={"to-boolean":t6,"to-color":t4,"to-number":t3,"to-string":t5};var nr=class e{constructor(e,t,r){this.type=e,this.args=t,this.key=r}static parse(t,r){if(t.length<2)return r.error("Expected at least one argument.");let n=t[0];if(!nt[n])throw Error(`Can't parse ${n} as it is not part of the known types`);if(("to-boolean"===n||"to-string"===n)&&2!==t.length)return r.error("Expected one argument.");let i=nt[n],a=[];for(let e=1;e<t.length;e++){let n=r.parse(t[e],e,t9);if(!n)return null;a.push(n)}return new e(i,a,r.key)}evaluate(e){switch(this.type.kind){case"boolean":return!!this.args[0].evaluate(e);case"color":{let t,r;for(let n of this.args){if(t=n.evaluate(e),r=null,t instanceof rP)return t;if("string"==typeof t){let r=e.parseColor(t);if(r)return r}else if(Array.isArray(t)&&!(r=t.length<3||t.length>4?`Invalid rgba value ${JSON.stringify(t)}: expected an array containing either three or four numeric values.`:rX(t[0],t[1],t[2],t[3])))return new rP(t[0]/255,t[1]/255,t[2]/255,t[3])}throw new rN(r||`Could not parse color from value '${"string"==typeof t?t:JSON.stringify(t)}'`,this.key)}case"padding":{let t;for(let r of this.args){t=r.evaluate(e);let n=rR.parse(t);if(n)return n}throw new rN(`Could not parse padding from value '${"string"==typeof t?t:JSON.stringify(t)}'`,this.key)}case"numberArray":{let t;for(let r of this.args){t=r.evaluate(e);let n=rO.parse(t);if(n)return n}throw new rN(`Could not parse numberArray from value '${"string"==typeof t?t:JSON.stringify(t)}'`,this.key)}case"colorArray":{let t;for(let r of this.args){t=r.evaluate(e);let n=r$.parse(t);if(n)return n}throw new rN(`Could not parse colorArray from value '${"string"==typeof t?t:JSON.stringify(t)}'`,this.key)}case"variableAnchorOffsetCollection":{let t;for(let r of this.args){t=r.evaluate(e);let n=rq.parse(t);if(n)return n}throw new rN(`Could not parse variableAnchorOffsetCollection from value '${"string"==typeof t?t:JSON.stringify(t)}'`,this.key)}case"number":{let t=null;for(let r of this.args){if(null===(t=r.evaluate(e)))return 0;let n=Number(t);if(!isNaN(n))return n}throw new rN(`Could not convert ${JSON.stringify(t)} to number.`,this.key)}case"formatted":return rV.fromString(rH(this.args[0].evaluate(e)));case"resolvedImage":return rj.fromString(rH(this.args[0].evaluate(e)));case"projectionDefinition":{let t=this.args[0].evaluate(e);if(rG.parse(t))return t;throw new rN(`Could not parse projectionDefinition from value '${"string"==typeof t?t:JSON.stringify(t)}'`,this.key)}default:return rH(this.args[0].evaluate(e))}}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}},nn=class e{constructor(e,t){this.type=t.type,this.bindings=[].concat(e),this.result=t}evaluate(e){return this.result.evaluate(e)}eachChild(e){for(let t of this.bindings)e(t[1]);e(this.result)}static parse(t,r){if(t.length<4)return r.error(`Expected at least 3 arguments, but found ${t.length-1} instead.`);let n=[];for(let e=1;e<t.length-1;e+=2){let i=t[e];if("string"!=typeof i)return r.error(`Expected string, but found ${typeof i} instead.`,e);if(/[^a-zA-Z0-9_]/.test(i))return r.error("Variable names must contain only alphanumeric characters or '_'.",e);let a=r.parse(t[e+1],e+1);if(!a)return null;n.push([i,a])}let i=r.parse(t[t.length-1],t.length-1,r.expectedType,n);return i?new e(n,i):null}outputDefined(){return this.result.outputDefined()}},ni=class e{constructor(e,t){this.type=t.type,this.name=e,this.boundExpression=t}static parse(t,r){if(2!==t.length||"string"!=typeof t[1])return r.error("'var' expression requires exactly one string literal argument.");let n=t[1];return r.scope.has(n)?new e(n,r.scope.get(n)):r.error(`Unknown variable "${n}". Make sure "${n}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(e){return this.boundExpression.evaluate(e)}eachChild(){}outputDefined(){return!1}},na=class e{constructor(e,t,r,n){this.type=e,this.index=t,this.input=r,this.key=n}static parse(t,r){if(3!==t.length)return r.error(`Expected 2 arguments, but found ${t.length-1} instead.`);let n=r.parse(t[1],1,t3),i=r.parse(t[2],2,ro(r.expectedType||t9));return n&&i?new e(i.type.itemType,n,i,r.key):null}evaluate(e){let t=this.index.evaluate(e),r=this.input.evaluate(e);if(t<0)throw new rN(`Array index out of bounds: ${t} < 0.`,this.key);if(t>=r.length)throw new rN(`Array index out of bounds: ${t} > ${r.length-1}.`,this.key);if(t!==Math.floor(t))throw new rN(`Array index must be an integer, but found ${t} instead.`,this.key);return r[t]}eachChild(e){e(this.index),e(this.input)}outputDefined(){return!1}},ns=class e{constructor(e,t,r){this.needle=e,this.haystack=t,this.key=r,this.type=t6}static parse(t,r){if(3!==t.length)return r.error(`Expected 2 arguments, but found ${t.length-1} instead.`);let n=r.parse(t[1],1,t9),i=r.parse(t[2],2,t9);return n&&i?rc(n.type,[t6,t5,t3,t2,t9])?new e(n,i,r.key):r.error(`Expected first argument to be of type boolean, string, number or null, but found ${rl(n.type)} instead`):null}evaluate(e){let t=this.needle.evaluate(e),r=this.haystack.evaluate(e);if(!r)return!1;if(!rp(t,["boolean","string","number","null"]))throw new rN(`Expected first argument to be of type boolean, string, number or null, but found ${rl(rZ(t))} instead.`,this.key);if(!rp(r,["string","array"]))throw new rN(`Expected second argument to be of type array or string, but found ${rl(rZ(r))} instead.`,this.key);return r.indexOf(t)>=0}eachChild(e){e(this.needle),e(this.haystack)}outputDefined(){return!0}},no=class e{constructor(e,t,r,n){this.needle=e,this.haystack=t,this.key=r,this.fromIndex=n,this.type=t3}static parse(t,r){if(t.length<=2||t.length>=5)return r.error(`Expected 2 or 3 arguments, but found ${t.length-1} instead.`);let n=r.parse(t[1],1,t9),i=r.parse(t[2],2,t9);if(!n||!i)return null;
1if(!rc(n.type,[t6,t5,t3,t2,t9]))return r.error(`Expected first argument to be of type boolean, string, number or null, but found ${rl(n.type)} instead`);if(4===t.length){let a=r.parse(t[3],3,t3);return a?new e(n,i,r.key,a):null}return new e(n,i,r.key)}evaluate(e){let t,r=this.needle.evaluate(e),n=this.haystack.evaluate(e);if(!rp(r,["boolean","string","number","null"]))throw new rN(`Expected first argument to be of type boolean, string, number or null, but found ${rl(rZ(r))} instead.`,this.key);if(this.fromIndex&&(t=this.fromIndex.evaluate(e)),rp(n,["string"])){let e=n.indexOf(r,t);return -1===e?-1:[...n.slice(0,e)].length}if(rp(n,["array"]))return n.indexOf(r,t);throw new rN(`Expected second argument to be of type array or string, but found ${rl(rZ(n))} instead.`,this.key)}eachChild(e){e(this.needle),e(this.haystack),this.fromIndex&&e(this.fromIndex)}outputDefined(){return!1}},nl=class e{constructor(e,t,r,n,i,a){this.inputType=e,this.type=t,this.input=r,this.cases=n,this.outputs=i,this.otherwise=a}static parse(t,r){let n,i;if(t.length<5)return r.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if(t.length%2!=1)return r.error("Expected an even number of arguments.");r.expectedType&&"value"!==r.expectedType.kind&&(i=r.expectedType);let a={},s=[];for(let e=2;e<t.length-1;e+=2){let o=t[e],l=t[e+1];Array.isArray(o)||(o=[o]);let u=r.concat(e);if(0===o.length)return u.error("Expected at least one branch label.");for(let e of o){if("number"!=typeof e&&"string"!=typeof e)return u.error("Branch labels must be numbers or strings.");if("number"==typeof e&&Math.abs(e)>0x20000000000000-1)return u.error(`Branch labels must be integers no larger than ${0x20000000000000-1}.`);if("number"==typeof e&&Math.floor(e)!==e)return u.error("Numeric branch labels must be integer values.");if(n){if(u.checkSubtype(n,rZ(e)))return null}else n=rZ(e);if(void 0!==a[String(e)])return u.error("Branch labels must be unique.");a[String(e)]=s.length}let h=r.parse(l,e,i);if(!h)return null;i||=h.type,s.push(h)}let o=r.parse(t[1],1,t9);if(!o)return null;let l=r.parse(t[t.length-1],t.length-1,i);return!l||"value"!==o.type.kind&&r.concat(1).checkSubtype(n,o.type)?null:new e(n,i,o,a,s,l)}evaluate(e){let t=this.input.evaluate(e);return(rZ(t)===this.inputType&&this.outputs[this.cases[t]]||this.otherwise).evaluate(e)}eachChild(e){e(this.input),this.outputs.forEach(e),e(this.otherwise)}outputDefined(){return this.outputs.every(e=>e.outputDefined())&&this.otherwise.outputDefined()}},nu=class e{constructor(e,t,r){this.type=e,this.branches=t,this.otherwise=r}static parse(t,r){let n;if(t.length<4)return r.error(`Expected at least 3 arguments, but found only ${t.length-1}.`);if(t.length%2!=0)return r.error("Expected an odd number of arguments.");r.expectedType&&"value"!==r.expectedType.kind&&(n=r.expectedType);let i=[];for(let e=1;e<t.length-1;e+=2){let a=r.parse(t[e],e,t6);if(!a)return null;let s=r.parse(t[e+1],e+1,n);if(!s)return null;i.push([a,s]),n||=s.type}let a=r.parse(t[t.length-1],t.length-1,n);if(!a)return null;if(!n)throw Error("Can't infer output type");return new e(n,i,a)}evaluate(e){for(let[t,r]of this.branches)if(t.evaluate(e))return r.evaluate(e);return this.otherwise.evaluate(e)}eachChild(e){for(let[t,r]of this.branches)e(t),e(r);e(this.otherwise)}outputDefined(){return this.branches.every(([e,t])=>t.outputDefined())&&this.otherwise.outputDefined()}},nh=class e{constructor(e,t,r,n,i){this.type=e,this.input=t,this.beginIndex=r,this.key=n,this.endIndex=i}static parse(t,r){if(t.length<=2||t.length>=5)return r.error(`Expected 2 or 3 arguments, but found ${t.length-1} instead.`);let n=r.parse(t[1],1,t9),i=r.parse(t[2],2,t3);if(!n||!i)return null;if(!rc(n.type,[ro(t9),t5,t9]))return r.error(`Expected first argument to be of type array or string, but found ${rl(n.type)} instead`);if(4===t.length){let a=r.parse(t[3],3,t3);return a?new e(n.type,n,i,r.key,a):null}return new e(n.type,n,i,r.key)}evaluate(e){let t=this.input.evaluate(e),r=this.beginIndex.evaluate(e),n;if(this.endIndex&&(n=this.endIndex.evaluate(e)),rp(t,["string"]))return[...t].slice(r,n).join("");if(rp(t,["array"]))return t.slice(r,n);throw new rN(`Expected first argument to be of type array or string, but found ${rl(rZ(t))} instead.`,this.key)}eachChild(e){e(this.input),e(this.beginIndex),this.endIndex&&e(this.endIndex)}outputDefined(){return!1}},nc=class e{constructor(e,t){this.type=e,this.args=t}static parse(t,r){if(t.length<2)return r.error("Expected at least one argument.");let n=null,i=r.expectedType;i&&"value"!==i.kind&&(n=i);let a=[];for(let e of t.slice(1)){let t=r.parse(e,1+a.length,n,void 0,{typeAnnotation:"omit"});if(!t)return null;n||=t.type,a.push(t)}if(!n)throw Error("No output type");return i&&a.some(e=>rh(i,e.type))?new e(t9,a):new e(n,a)}evaluate(e){let t=null,r=0,n;
1for(let i of this.args)if(r++,(t=i.evaluate(e))&&t instanceof rj&&!t.available&&(n||=t.name,t=null,r===this.args.length&&(t=n)),null!==t)break;return t}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}};function np(e,t){return"=="===e||"!="===e?"boolean"===t.kind||"string"===t.kind||"number"===t.kind||"null"===t.kind||"value"===t.kind:"string"===t.kind||"number"===t.kind||"value"===t.kind}function nf(e,t,r,n){return 0===n.compare(t,r)}function nd(e,t,r){let n="=="!==e&&"!="!==e;return class i{constructor(e,t,r,n){this.lhs=e,this.rhs=t,this.key=r,this.collator=n,this.type=t6,this.hasUntypedArgument="value"===e.type.kind||"value"===t.type.kind}static parse(e,t){if(3!==e.length&&4!==e.length)return t.error("Expected two or three arguments.");let r=e[0],a=t.parse(e[1],1,t9);if(!a)return null;if(!np(r,a.type))return t.concat(1).error(`"${r}" comparisons are not supported for type '${rl(a.type)}'.`);let s=t.parse(e[2],2,t9);if(!s)return null;if(!np(r,s.type))return t.concat(2).error(`"${r}" comparisons are not supported for type '${rl(s.type)}'.`);if(a.type.kind!==s.type.kind&&"value"!==a.type.kind&&"value"!==s.type.kind)return t.error(`Cannot compare types '${rl(a.type)}' and '${rl(s.type)}'.`);n&&("value"===a.type.kind&&"value"!==s.type.kind?a=new ne(s.type,[a],t.key):"value"!==a.type.kind&&"value"===s.type.kind&&(s=new ne(a.type,[s],t.key)));let o=null;if(4===e.length){if("string"!==a.type.kind&&"string"!==s.type.kind&&"value"!==a.type.kind&&"value"!==s.type.kind)return t.error("Cannot use collator to compare non-string types.");if(!(o=t.parse(e[3],3,re)))return null}return new i(a,s,t.key,o)}evaluate(i){let a=this.lhs.evaluate(i),s=this.rhs.evaluate(i);if(n&&this.hasUntypedArgument){let t=rZ(a),r=rZ(s);if(t.kind!==r.kind||"string"!==t.kind&&"number"!==t.kind)throw new rN(`Expected arguments for "${e}" to be (string, string) or (number, number), but found (${t.kind}, ${r.kind}) instead.`,this.key)}if(this.collator&&!n&&this.hasUntypedArgument){let e=rZ(a),r=rZ(s);if("string"!==e.kind||"string"!==r.kind)return t(i,a,s)}return this.collator?r(i,a,s,this.collator.evaluate(i)):t(i,a,s)}eachChild(e){e(this.lhs),e(this.rhs),this.collator&&e(this.collator)}outputDefined(){return!0}}}let ny=nd("==",function(e,t,r){return t===r},nf),nm=nd("!=",function(e,t,r){return t!==r},function(e,t,r,n){return!nf(e,t,r,n)}),ng=nd("<",function(e,t,r){return t<r},function(e,t,r,n){return 0>n.compare(t,r)}),nx=nd(">",function(e,t,r){return t>r},function(e,t,r,n){return n.compare(t,r)>0}),nv=nd("<=",function(e,t,r){return t<=r},function(e,t,r,n){return 0>=n.compare(t,r)}),nb=nd(">=",function(e,t,r){return t>=r},function(e,t,r,n){return n.compare(t,r)>=0});var nw=class e{constructor(e,t,r){this.type=re,this.locale=r,this.caseSensitive=e,this.diacriticSensitive=t}static parse(t,r){if(2!==t.length)return r.error("Expected one argument.");let n=t[1];if("object"!=typeof n||Array.isArray(n))return r.error("Collator options argument must be an object.");let i=r.parse(void 0!==n["case-sensitive"]&&n["case-sensitive"],1,t6);if(!i)return null;let a=r.parse(void 0!==n["diacritic-sensitive"]&&n["diacritic-sensitive"],1,t6);if(!a)return null;let s=null;return!n.locale||(s=r.parse(n.locale,1,t5))?new e(i,a,s):null}evaluate(e){return new rY(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}},nD=class e{constructor(e,t,r,n,i,a){this.type=t5,this.number=e,this.locale=t,this.currency=r,this.unit=n,this.minFractionDigits=i,this.maxFractionDigits=a}static parse(t,r){if(3!==t.length)return r.error("Expected two arguments.");let n=r.parse(t[1],1,t3);if(!n)return null;let i=t[2];if("object"!=typeof i||Array.isArray(i))return r.error("NumberFormat options argument must be an object.");let a=null;if(i.locale&&!(a=r.parse(i.locale,1,t5)))return null;let s=null;if(i.currency&&!(s=r.parse(i.currency,1,t5)))return null;let o=null;if(i.unit&&!(o=r.parse(i.unit,1,t5)))return null;if(s&&o)return r.error("NumberFormat options `currency` and `unit` are mutually exclusive");let l=null;if(i["min-fraction-digits"]&&!(l=r.parse(i["min-fraction-digits"],1,t3)))return null;let u=null;return!i["max-fraction-digits"]||(u=r.parse(i["max-fraction-digits"],1,t3))?new e(n,a,s,o,l,u):null}evaluate(e){return new Intl.NumberFormat(this.locale?this.locale.evaluate(e):[],{style:this.currency?"currency":this.unit?"unit":"decimal",currency:this.currency?this.currency.evaluate(e):void 0,unit:this.unit?this.unit.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.unit&&e(this.unit),this.minFractionDigits&&e(this.minFractionDigits),this.maxFractionDigits&&e(this.maxFractionDigits)}outputDefined(){return!1}},n_=class e{constructor(e){this.type=ra,this.input=e}static parse(t,r){if(2!==t.length)return r.error("Expected two arguments.");let n=r.parse(t[1],1,t5);return n?new e(n):r.error("No image name provided.")}evaluate(e){let t=this.input.evaluate(e),r=rj.fromString(t);return r&&e.availableImages&&(r.available=e.availableImages.indexOf(t)>-1),r}eachChild(e){e(this.input)}outputDefined(){return!1}},nA=class e{constructor(e,t){this.input=e,this.key=t,this.type=t3}static parse(t,r){if(2!==t.length)return r.error(`Expected 1 argument, but found ${t.length-1} instead.`);let n=r.parse(t[1],1);return n?"array"!==n.type.kind&&"string"!==n.type.kind&&"value"!==n.type.kind?r.error(`Expected argument of type string or array, but found ${rl(n.type)} instead.`):new e(n,r.key):null}evaluate(e){let t=this.input.evaluate(e);if("string"==typeof t)return[...t].length;if(Array.isArray(t))return t.length;throw new rN(`Expected value to be of type string or array, but found ${rl(rZ(t))} instead.`,this.key)}eachChild(e){e(this.input)}outputDefined(){return!1}};function nE(e,t){let r=2**t.z;return[360*((e[0]/8192+t.x)/r)-180,360/Math.PI*Math.atan(Math.exp((180-360*((e[1]/8192+t.y)/r))*Math.PI/180)
1)-90]}function nS(e,t){e[0]=Math.min(e[0],t[0]),e[1]=Math.min(e[1],t[1]),e[2]=Math.max(e[2],t[0]),e[3]=Math.max(e[3],t[1])}function nF(e,t){return!(e[0]<=t[0]||e[2]>=t[2]||e[1]<=t[1]||e[3]>=t[3])}function nk(e,t,r,n){var i,a;let s=[t[0]-e[0],t[1]-e[1]];return 0!=(i=[n[0]-r[0],n[1]-r[1]],i[0]*(a=s)[1]-i[1]*a[0])&&!!(nC(e,t,r,n)&&nC(r,n,e,t))}function nT(e,t,r=!1){let n=!1;for(let s of t)for(let t=0;t<s.length-1;t++){var i,a;if(function(e,t,r){let n=e[0]-t[0],i=e[1]-t[1],a=e[0]-r[0],s=e[1]-r[1];return n*s-a*i==0&&n*a<=0&&i*s<=0}(e,s[t],s[t+1]))return r;i=s[t],a=s[t+1],i[1]>e[1]!=a[1]>e[1]&&e[0]<(a[0]-i[0])*(e[1]-i[1])/(a[1]-i[1])+i[0]&&(n=!n)}return n}function nI(e,t){for(let r of e)if(!nT(r,t))return!1;for(let r=0;r<e.length-1;++r)if(function(e,t,r){for(let n of r)for(let r=0;r<n.length-1;++r)if(nk(e,t,n[r],n[r+1]))return!0;return!1}(e[r],e[r+1],t))return!1;return!0}function nC(e,t,r,n){let i=e[0]-r[0],a=e[1]-r[1],s=t[0]-r[0],o=t[1]-r[1],l=n[0]-r[0],u=n[1]-r[1],h=i*u-l*a,c=s*u-l*o;return h>0&&c<0||h<0&&c>0}function nB(e,t,r){let n=[];for(let i=0;i<e.length;i++){let a=[];for(let n=0;n<e[i].length;n++){let s=function(e,t){let r=(180+e[0])/360,n=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+e[1]*Math.PI/360)))/360,i=2**t.z;return[Math.round(r*i*8192),Math.round(n*i*8192)]}(e[i][n],r);nS(t,s),a.push(s)}n.push(a)}return n}function nM(e,t,r){let n=[];for(let i=0;i<e.length;i++){let a=nB(e[i],t,r);n.push(a)}return n}function nP(e,t,r,n){if(e[0]<r[0]||e[0]>r[2]){let t=.5*n,i=e[0]-r[0]>t?-n:r[0]-e[0]>t?n:0;0===i&&(i=e[0]-r[2]>t?-n:r[2]-e[0]>t?n:0),e[0]+=i}nS(t,e)}function nz(e,t,r,n){let i=2**n.z*8192,a=[8192*n.x,8192*n.y],s=[];for(let n of e)for(let e of n){let n=[e.x+a[0],e.y+a[1]];nP(n,t,r,i),s.push(n)}return s}function nL(e,t,r,n){let i=2**n.z*8192,a=[8192*n.x,8192*n.y],s=[];for(let r of e){let e=[];for(let n of r){let r=[n.x+a[0],n.y+a[1]];nS(t,r),e.push(r)}s.push(e)}if(t[2]-t[0]<=i/2){for(let e of(t[0]=t[1]=1/0,t[2]=t[3]=-1/0,s))for(let n of e)nP(n,t,r,i)}return s}var nV=class e{constructor(e,t){this.type=t6,this.geojson=e,this.geometries=t}static parse(t,r){if(2!==t.length)return r.error(`'within' expression requires exactly one argument, but found ${t.length-1} instead.`);if(rW(t[1])){let r=t[1];if("FeatureCollection"===r.type){let t=[];for(let e of r.features){let{type:r,coordinates:n}=e.geometry;"Polygon"===r&&t.push(n),"MultiPolygon"===r&&t.push(...n)}if(t.length)return new e(r,{type:"MultiPolygon",coordinates:t})}else if("Feature"===r.type){let t=r.geometry.type;if("Polygon"===t||"MultiPolygon"===t)return new e(r,r.geometry)}else if("Polygon"===r.type||"MultiPolygon"===r.type)return new e(r,r)}return r.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(e){if(null!=e.geometry()&&null!=e.canonicalID()){if("Point"===e.geometryType())return function(e,t){let r=[1/0,1/0,-1/0,-1/0],n=[1/0,1/0,-1/0,-1/0],i=e.canonicalID();if("Polygon"===t.type){let a=nB(t.coordinates,n,i),s=nz(e.geometry(),r,n,i);if(!nF(r,n))return!1;for(let e of s)if(!nT(e,a))return!1}if("MultiPolygon"===t.type){let a=nM(t.coordinates,n,i),s=nz(e.geometry(),r,n,i);if(!nF(r,n))return!1;for(let e of s)if(!function(e,t){for(let r of t)if(nT(e,r))return!0;return!1}(e,a))return!1}return!0}(e,this.geometries);if("LineString"===e.geometryType())return function(e,t){let r=[1/0,1/0,-1/0,-1/0],n=[1/0,1/0,-1/0,-1/0],i=e.canonicalID();if("Polygon"===t.type){let a=nB(t.coordinates,n,i),s=nL(e.geometry(),r,n,i);if(!nF(r,n))return!1;for(let e of s)if(!nI(e,a))return!1}if("MultiPolygon"===t.type){let a=nM(t.coordinates,n,i),s=nL(e.geometry(),r,n,i);if(!nF(r,n))return!1;for(let e of s)if(!function(e,t){for(let r of t)if(nI(e,r))return!0;return!1}(e,a))return!1}return!0}(e,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}},nR=class{constructor(e=[],t=(e,t)=>e<t?-1:+(e>t)){if(this.data=e,this.length=this.data.length,this.compare=t,this.length>0)for(let e=(this.length>>1)-1;e>=0;e--)this._down(e)}push(e){this.data.push(e),this._up(this.length++)}pop(){if(0===this.length)return;let e=this.data[0],t=this.data.pop();return--this.length>0&&(this.data[0]=t,this._down(0)),e}peek(){return this.data[0]}_up(e){let{data:t,compare:r}=this,n=t[e];for(;e>0;){let i=e-1>>1,a=t[i];if(r(n,a)>=0)break;t[e]=a,e=i}t[e]=n}_down(e){let{data:t,compare:r}=this,n=this.length>>1,i=t[e];for(;e<n;){let n=(e<<1)+1,a=n+1;if(a<this.length&&0>r(t[a],t[n])&&(n=a),r(t[n],i)>=0)break;t[e]=t[n],e=n}t[e]=i}};let nO=Math.PI/180;var n$=class{constructor(e){let t=6378.137*nO*1e3,r=Math.cos(e*nO),n=1/(1-.0066943799901413165*(1-r*r)),i=Math.sqrt(n);this.kx=t*i*r,this.ky=t*i*n*.9933056200098587}distance(e,t){let r=this.wrap(e[0]-t[0])*this.kx,n=(e[1]-t[1])*this.ky;return Math.sqrt(r*r+n*n)}pointOnLine(e,t){let r=1/0,n,i,a,s;for(let o=0;o<e.length-1;o++){let l=e[o][0],u=e[o][1],h=this.wrap(e[o+1][0]-l)*this.kx,c=(e[o+1][1]-u)*this.ky,p=0;
1(0!==h||0!==c)&&((p=(this.wrap(t[0]-l)*this.kx*h+(t[1]-u)*this.ky*c)/(h*h+c*c))>1?(l=e[o+1][0],u=e[o+1][1]):p>0&&(l+=h/this.kx*p,u+=c/this.ky*p));let f=(h=this.wrap(t[0]-l)*this.kx)*h+(c=(t[1]-u)*this.ky)*c;f<r&&(r=f,n=l,i=u,a=o,s=p)}return{point:[n,i],index:a,t:Math.max(0,Math.min(1,s))}}wrap(e){for(;e<-180;)e+=360;for(;e>180;)e-=360;return e}};function nN(e,t){return t[0]-e[0]}function nU(e){return e[1]-e[0]+1}function nq(e,t){return e[1]>=e[0]&&e[1]<t}function nj(e,t){if(e[0]>e[1])return[null,null];let r=nU(e);if(t){if(2===r)return[e,null];let t=Math.floor(r/2);return[[e[0],e[0]+t],[e[0]+t,e[1]]]}if(1===r)return[e,null];let n=Math.floor(r/2)-1;return[[e[0],e[0]+n],[e[0]+n+1,e[1]]]}function nG(e,t){if(!nq(t,e.length))return[1/0,1/0,-1/0,-1/0];let r=[1/0,1/0,-1/0,-1/0];for(let n=t[0];n<=t[1];++n)nS(r,e[n]);return r}function nY(e){let t=[1/0,1/0,-1/0,-1/0];for(let r of e)for(let e of r)nS(t,e);return t}function nX(e){return e[0]!==-1/0&&e[1]!==-1/0&&e[2]!==1/0&&e[3]!==1/0}function nW(e,t,r){if(!nX(e)||!nX(t))return NaN;let n=0,i=0;return e[2]<t[0]&&(n=t[0]-e[2]),e[0]>t[2]&&(n=e[0]-t[2]),e[1]>t[3]&&(i=e[1]-t[3]),e[3]<t[1]&&(i=t[1]-e[3]),r.distance([0,0],[n,i])}function nZ(e,t,r){let n=r.pointOnLine(t,e);return r.distance(e,n.point)}function nH(e,t,r,n,i){return Math.min(Math.min(nZ(e,[r,n],i),nZ(t,[r,n],i)),Math.min(nZ(r,[e,t],i),nZ(n,[e,t],i)))}function nK(e,t){for(let r of e)for(let e of r)if(nT(e,t,!0))return!0;return!1}function nJ(e,t,r,n,i,a){if(!a)return;let s=nW(nG(n,a),i,r);s<t&&e.push([s,a,[0,0]])}function nQ(e,t,r,n,i,a,s){if(!a||!s)return;let o=nW(nG(n,a),nG(i,s),r);o<t&&e.push([o,a,s])}function n1(e,t,r,n,i=1/0){let a=Math.min(n.distance(e[0],r[0][0]),i);if(0===a)return a;let s=new nR([[0,[0,e.length-1],[0,0]]],nN),o=nY(r);for(;s.length>0;){let i=s.pop();if(i[0]>=a)continue;let l=i[1],u=t?50:100;if(nU(l)<=u){if(!nq(l,e.length))return NaN;if(t){let t=function(e,t,r,n){if(!nq(t,e.length))return NaN;for(let n=t[0];n<=t[1];++n)if(nT(e[n],r,!0))return 0;let i=1/0;for(let a=t[0];a<t[1];++a){let t=e[a],s=e[a+1];for(let e of r)for(let r=0,a=e.length,o=a-1;r<a;o=r++){let a=e[o],l=e[r];if(nk(t,s,a,l))return 0;i=Math.min(i,nH(t,s,a,l,n))}}return i}(e,l,r,n);if(isNaN(t)||0===t)return t;a=Math.min(a,t)}else for(let t=l[0];t<=l[1];++t)if(0===(a=Math.min(a,function(e,t,r){if(nT(e,t,!0))return 0;let n=1/0;for(let i of t){let t=i[0],a=i[i.length-1];if(t!==a&&0===(n=Math.min(n,nZ(e,[a,t],r))))break;let s=r.pointOnLine(i,e);if(0===(n=Math.min(n,r.distance(e,s.point))))break}return n}(e[t],r,n))))return 0}else{let r=nj(l,t);nJ(s,a,n,e,o,r[0]),nJ(s,a,n,e,o,r[1])}}return a}function n0(e,t,r,n,i,a=1/0){let s=Math.min(a,i.distance(e[0],r[0]));if(0===s)return s;let o=new nR([[0,[0,e.length-1],[0,r.length-1]]],nN);for(;o.length>0;){let a=o.pop();if(a[0]>=s)continue;let l=a[1],u=a[2],h=t?50:100,c=n?50:100;if(nU(l)<=h&&nU(u)<=c){if(!nq(l,e.length)&&nq(u,r.length))return NaN;if(t&&n)s=Math.min(s,function(e,t,r,n,i){if(!(nq(t,e.length)&&nq(n,r.length)))return 1/0;let a=1/0;for(let s=t[0];s<t[1];++s){let t=e[s],o=e[s+1];for(let e=n[0];e<n[1];++e){let n=r[e],s=r[e+1];if(nk(t,o,n,s))return 0;a=Math.min(a,nH(t,o,n,s,i))}}return a}(e,l,r,u,i));else if(t&&!n){let t=e.slice(l[0],l[1]+1);for(let e=u[0];e<=u[1];++e)if(0===(s=Math.min(s,nZ(r[e],t,i))))return s}else if(!t&&n){let t=r.slice(u[0],u[1]+1);for(let r=l[0];r<=l[1];++r)if(0===(s=Math.min(s,nZ(e[r],t,i))))return s}else s=Math.min(s,function(e,t,r,n,i){if(!(nq(t,e.length)&&nq(n,r.length)))return NaN;let a=1/0;for(let s=t[0];s<=t[1];++s)for(let t=n[0];t<=n[1];++t)if(0===(a=Math.min(a,i.distance(e[s],r[t]))))return a;return a}(e,l,r,u,i))}else{let a=nj(l,t),h=nj(u,n);nQ(o,s,i,e,r,a[0],h[0]),nQ(o,s,i,e,r,a[0],h[1]),nQ(o,s,i,e,r,a[1],h[0]),nQ(o,s,i,e,r,a[1],h[1])}}return s}function n2(e){return"MultiPolygon"===e.type?e.coordinates.map(e=>({type:"Polygon",coordinates:e})):"MultiLineString"===e.type?e.coordinates.map(e=>({type:"LineString",coordinates:e})):"MultiPoint"===e.type?e.coordinates.map(e=>({type:"Point",coordinates:e})):[e]}var n3=class e{constructor(e,t){this.type=t3,this.geojson=e,this.geometries=t}static parse(t,r){if(2!==t.length)return r.error(`'distance' expression requires exactly one argument, but found ${t.length-1} instead.`);
1if(rW(t[1])){let r=t[1];if("FeatureCollection"===r.type)return new e(r,r.features.map(e=>n2(e.geometry)).flat());if("Feature"===r.type)return new e(r,n2(r.geometry));if("type"in r&&"coordinates"in r)return new e(r,n2(r))}return r.error("'distance' expression requires valid geojson object that contains polygon geometry type.")}evaluate(e){if(null!=e.geometry()&&null!=e.canonicalID()){if("Point"===e.geometryType())return function(e,t){let r=e.geometry(),n=r.flat().map(t=>nE([t.x,t.y],e.canonical));if(0===r.length)return NaN;let i=new n$(n[0][1]),a=1/0;for(let e of t){switch(e.type){case"Point":a=Math.min(a,n0(n,!1,[e.coordinates],!1,i,a));break;case"LineString":a=Math.min(a,n0(n,!1,e.coordinates,!0,i,a));break;case"Polygon":a=Math.min(a,n1(n,!1,e.coordinates,i,a))}if(0===a)break}return a}(e,this.geometries);if("LineString"===e.geometryType())return function(e,t){let r=e.geometry(),n=r.flat().map(t=>nE([t.x,t.y],e.canonical));if(0===r.length)return NaN;let i=new n$(n[0][1]),a=1/0;for(let e of t){switch(e.type){case"Point":a=Math.min(a,n0(n,!0,[e.coordinates],!1,i,a));break;case"LineString":a=Math.min(a,n0(n,!0,e.coordinates,!0,i,a));break;case"Polygon":a=Math.min(a,n1(n,!0,e.coordinates,i,a))}if(0===a)break}return a}(e,this.geometries);if("Polygon"===e.geometryType())return function(e,t){let r=e.geometry();if(0===r.length||0===r[0].length)return NaN;let n=r8(r,0).map(t=>t.map(t=>t.map(t=>nE([t.x,t.y],e.canonical)))),i=new n$(n[0][0][0][1]),a=1/0;for(let e of t)for(let t of n){switch(e.type){case"Point":a=Math.min(a,n1([e.coordinates],!1,t,i,a));break;case"LineString":a=Math.min(a,n1(e.coordinates,!0,t,i,a));break;case"Polygon":a=Math.min(a,function(e,t,r,n=1/0){let i=nY(e),a=nY(t);if(n!==1/0&&nW(i,a,r)>=n)return n;if(nF(i,a)){if(nK(e,t))return 0}else if(nK(t,e))return 0;let s=1/0;for(let n of e)for(let e=0,i=n.length,a=i-1;e<i;a=e++){let i=n[a],o=n[e];for(let e of t)for(let t=0,n=e.length,a=n-1;t<n;a=t++){let n=e[a],l=e[t];if(nk(i,o,n,l))return 0;s=Math.min(s,nH(i,o,n,l,r))}}return s}(t,e.coordinates,i,a))}if(0===a)return a}return a}(e,this.geometries)}return NaN}eachChild(){}outputDefined(){return!0}},n5=class e{constructor(e){let t=null;for(let r of e)if(t){if(t===r.type)continue;t=t9;break}else t=r.type;this.type=ro(t??t9,e.length),this.arr=e}static parse(t,r){if(2!==t.length)return r.error(`'semiliteral' expression requires exactly one argument, but found ${t.length-1} instead.`);if(!rW(t[1]))return r.error(`invalid value of type "${typeof t[1]}"`);let n=t[1],i=rZ(n);return"array"===i.kind?new e(n.map(e=>r.parse(e,null,t9))):new rK(i,n)}evaluate(e){return this.arr.map(t=>t.evaluate(e))}eachChild(e){this.arr.forEach(e)}outputDefined(){return this.arr.every(e=>e.outputDefined())}},n6=class e{constructor(e){this.key=e,this.type=t9}static parse(t,r){if(2!==t.length)return r.error(`Expected 1 argument, but found ${t.length-1} instead.`);let n=t[1];return null==n?r.error("Global state property must be defined."):"string"==typeof n?new e(n):r.error(`Global state property must be string, but found ${typeof t[1]} instead.`)}evaluate(e){let t=e.globals?.globalState;return t&&0!==Object.keys(t).length?rF(t,this.key)??null:null}eachChild(){}outputDefined(){return!1}};let n4={"==":ny,"!=":nm,">":nx,"<":ng,">=":nb,"<=":nv,array:ne,at:na,boolean:ne,case:nu,coalesce:nc,collator:nw,format:r6,image:n_,in:ns,"index-of":no,interpolate:r2,"interpolate-hcl":r2,"interpolate-lab":r2,length:nA,let:nn,literal:rK,match:nl,number:ne,"number-format":nD,object:ne,semiliteral:n5,slice:nh,step:r0,string:ne,"to-boolean":nr,"to-color":nr,"to-number":nr,"to-string":nr,var:ni,within:nV,distance:n3,"global-state":n6};var n8=class extends Error{constructor(e,t){super(t),this.message=t,this.key=e}},n7=class e{constructor(e,t=[]){for(let[r,n]of(this.parent=e,this.bindings={},t))this.bindings[r]=n}concat(t){return new e(this,t)}get(e){if(this.bindings[e])return this.bindings[e];if(this.parent)return this.parent.get(e);throw Error(`${e} not found in scope.`)}has(e){return!!this.bindings[e]||!!this.parent&&this.parent.has(e)}},n9=class e{constructor(e,t,r=[],n,i=new n7,a=[]){this.registry=e,this.path=r,this.key=r.map(e=>`[${e}]`).join(""),this.scope=i,this.errors=a,this.expectedType=n,this._isConstant=t}parse(e,t,r,n,i={}){return t?this.concat(t,r,n)._parse(e,i):this._parse(e,i)}_parse(e,t){(null===e||"string"==typeof e||"boolean"==typeof e||"number"==typeof e)&&(e=["literal",e]);let r=this.key;
1function n(e,t,n){return"assert"===n?new ne(t,[e],r):"coerce"===n?new nr(t,[e],r):e}if(Array.isArray(e)){if(0===e.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');let r=e[0];if("string"!=typeof r)return this.error(`Expression name must be a string, but found ${typeof r} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;let i=this.registry[r];if(i){let r=i.parse(e,this);if(!r)return null;if(this.expectedType){let e=this.expectedType,i=r.type;if(("string"===e.kind||"number"===e.kind||"boolean"===e.kind||"object"===e.kind||"array"===e.kind)&&"value"===i.kind)r=n(r,e,t.typeAnnotation||"assert");else if("projectionDefinition"===e.kind&&["string","array","value"].includes(i.kind)||["color","formatted","resolvedImage"].includes(e.kind)&&["value","string"].includes(i.kind)||["padding","numberArray"].includes(e.kind)&&["value","number","array"].includes(i.kind)||"colorArray"===e.kind&&["value","string","array"].includes(i.kind)||"variableAnchorOffsetCollection"===e.kind&&["value","array"].includes(i.kind))r=n(r,e,t.typeAnnotation||"coerce");else if(this.checkSubtype(e,i))return null}if(!(r instanceof rK)&&"resolvedImage"!==r.type.kind&&this._isConstant(r)){let e=new rQ;try{r=new rK(r.type,r.evaluate(e))}catch(e){return this.error(e.message),null}}return r}return this.error(`Unknown expression "${r}". If you wanted a literal array, use ["literal", [...]].`,0)}return void 0===e?this.error("'undefined' value invalid. Use null instead."):"object"==typeof e?this.error('Bare objects invalid. Use ["literal", {...}] instead.'):this.error(`Expected an array, but found ${typeof e} instead.`)}concat(t,r,n){let i="number"==typeof t?this.path.concat(t):this.path,a=n?this.scope.concat(n):this.scope;return new e(this.registry,this._isConstant,i,r||null,a,this.errors)}error(e,...t){let r=`${this.key}${t.map(e=>`[${e}]`).join("")}`;this.errors.push(new n8(r,e))}checkSubtype(e,t){let r=rh(e,t);return r&&this.error(r),r}},ie=class e{constructor(e,t,r,n,i){this.name=e,this.type=t,this._evaluate=r,this.args=n,this.key=i}evaluate(e){return this._evaluate(e,this.args,this.key)}eachChild(e){this.args.forEach(e)}outputDefined(){return!1}static parse(t,r){let n=t[0],i=e.definitions[n];if(!i)return r.error(`Unknown expression "${n}". If you wanted a literal array, use ["literal", [...]].`,0);let a=Array.isArray(i)?i[0]:i.type,s=Array.isArray(i)?[[i[1],i[2]]]:i.overloads,o=s.filter(([e])=>!Array.isArray(e)||e.length===t.length-1),l=null;for(let[i,s]of o){l=new n9(r.registry,is,r.path,null,r.scope);let o=[],u=!1;for(let e=1;e<t.length;e++){let r=t[e],n=Array.isArray(i)?i[e-1]:i.type,a=l.parse(r,1+o.length,n);if(!a){u=!0;break}o.push(a)}if(!u){if(Array.isArray(i)&&i.length!==o.length){l.error(`Expected ${i.length} arguments, but found ${o.length} instead.`);continue}for(let e=0;e<o.length;e++){let t=Array.isArray(i)?i[e]:i.type,r=o[e];l.concat(e+1).checkSubtype(t,r.type)}if(0===l.errors.length)return new e(n,a,s,o,r.key)}}if(1===o.length)r.errors.push(...l.errors);else{let e=(o.length?o:s).map(([e])=>{var t;return Array.isArray(t=e)?`(${t.map(rl).join(", ")})`:`(${rl(t.type)}...)`}).join(" | "),n=[];for(let e=1;e<t.length;e++){let i=r.parse(t[e],1+n.length);if(!i)return null;n.push(rl(i.type))}r.error(`Expected arguments of type ${e}, but found (${n.join(", ")}) instead.`)}return null}static register(t,r){for(let n in e.definitions=r,r)t[n]=e}};function it(e,[t,r,n,i],a){t=t.evaluate(e),r=r.evaluate(e),n=n.evaluate(e);let s=i?i.evaluate(e):1,o=rX(t,r,n,s);if(o)throw new rN(o,a);return new rP(t/255,r/255,n/255,s,!1)}function ir(e,t){return e in t&&void 0!==t[e]}function ii(e,t){let r=t[e];return void 0===r?null:r}function ia(e){return{type:e}}function is(e){if(e instanceof ni)return is(e.boundExpression);if(e instanceof ie&&"error"===e.name||e instanceof nw||e instanceof nV||e instanceof n3||e instanceof n6)return!1;let t=e instanceof nr||e instanceof ne,r=!0;return e.eachChild(e=>{r&&=t?is(e):e instanceof rK}),!!r&&io(e)&&iu(e,["zoom","heatmap-density","elevation","line-progress","accumulated","is-supported-script"])}function io(e){if(e instanceof ie&&("get"===e.name&&1===e.args.length||"feature-state"===e.name||"has"===e.name&&1===e.args.length||"properties"===e.name||"geometry-type"===e.name||"id"===e.name||/^filter-/.test(e.name))||e instanceof nV||e instanceof n3)return!1;let t=!0;return e.eachChild(e=>{t&&!io(e)&&(t=!1)}),t}function il(e){if(e instanceof ie&&"feature-state"===e.name)return!1;let t=!0;return e.eachChild(e=>{t&&!il(e)&&(t=!1)}),t}function iu(e,t){if(e instanceof ie&&t.indexOf(e.name)>=0)return!1;let r=!0;return e.eachChild(e=>{r&&!iu(e,t)&&(r=!1)}),r}function ih(e){return"data-driven"===e["property-type"]||"cross-faded-data-driven"===e["property-type"]}function ic(e){return!!e.expression&&e.expression.parameters.indexOf("zoom")>-1}function ip(e){return!!e.expression&&e.expression.interpolated}ie.register(n4,{error:[{kind:"error"},[t5],(e,[t],r)=>{throw new rN(t.evaluate(e),r)}],typeof:[t5,[t9],(e,[t])=>rl(rZ(t.evaluate(e)))],"to-rgba":[ro(t3,4),[t4],(e,[t])=>{let[r,n,i,a]=t.evaluate(e).rgb;return[255*r,255*n,255*i,a]}],rgb:[t4,[t3,t3,t3],it],rgba:[t4,[t3,t3,t3,t3],it],has:{type:t6,overloads:[[[t5],(e,[t])=>ir(t.evaluate(e),e.properties())],[[t5,t7],(e,[t,r])=>ir(t.evaluate(e),r.evaluate(e))]]},get:{type:t9,overloads:[[[t5],(e,[t])=>ii(t.evaluate(e),e.properties())],[[t5,t7],(e,[t,r])=>ii(t.evaluate(e),r.evaluate(e))]]},"feature-state":[t9,[t5],(e,[t])=>ii(t.evaluate(e),e.featureState||{})],properties:[t7,[],e=>e.properties()],"geometry-type":[t5,[],e=>e.geometryType()],id:[t9,[],e=>e.id()],zoom:[t3,[],e=>e.globals.zoom],"heatmap-density":[t3,[],e=>e.globals.heatmapDensity||0],elevation:[t3,[],e=>e.globals.elevation||0],"line-progress":[t3,[],e=>e.globals.lineProgress||0],accumulated:[t9,[],e=>void 0===e.globals.accumulated?null:e.globals.accumulated],"+":[t3,ia(t3),(e,t)=>{let r=0;for(let n of t)r+=n.evaluate(e);return r}],"*":[t3,ia(t3),(e,t)=>{let r=1;for(let n of t)r*=n.evaluate(e);return r}],"-":{type:t3,overloads:[[[t3,t3],(e,[t,r])=>t.evaluate(e)-r.evaluate(e)],[[t3],(e,[t])=>-t.evaluate(e)]]},"/":[t3,[t3,t3],(e,[t,r])=>t.evaluate(e)/r.evaluate(e)],"%":[t3,[t3,t3],(e,[t,r])=>t.evaluate(e)%r.evaluate(e)],ln2:[t3,[],()=>Math.LN2],pi:[t3,[],()=>Math.PI],e:[t3,[],()=>Math.E],"^":[t3,[t3,t3],(e,[t,r])=>t.evaluate(e)**r.evaluate(e)],sqrt:[t3,[t3],(e,[t])=>Math.sqrt(t.evaluate(e))],log10:[t3,[t3],(e,[t])=>Math.log(t.evaluate(e))/Math.LN10],ln:[t3,[t3],(e,[t])=>Math.log(t.evaluate(e))],log2:[t3,[t3],(e,[t])=>Math.log(t.evaluate(e))/Math.LN2],sin:[t3,[t3],(e,[t])=>Math.sin(t.evaluate(e))],cos:[t3,[t3],(e,[t])=>Math.cos(t.evaluate(e))],tan:[t3,[t3],(e,[t])=>Math.tan(t.evaluate(e))],asin:[t3,[t3],(e,[t])=>Math.asin(t.evaluate(e))],acos:[t3,[t3],(e,[t])=>Math.acos(t.evaluate(e))],atan:[t3,[t3],(e,[t])=>Math.atan(t.evaluate(e))],min:[t3,ia(t3),(e,t)=>Math.min(...t.map(t=>t.evaluate(e)))],max:[t3,ia(t3),(e,t)=>Math.max(...t.map(t=>t.evaluate(e)))],abs:[t3,[t3],(e,[t])=>Math.abs(t.evaluate(e))],round:[t3,[t3],(e,[t])=>{let r=t.evaluate(e);return r<0?-Math.round(-r):Math.round(r)}],floor:[t3,[t3],(e,[t])=>Math.floor(t.evaluate(e))],ceil:[t3,[t3],(e,[t])=>Math.ceil(t.evaluate(e))],"filter-==":[t6,[t5,t9],(e,[t,r])=>e.properties()[t.value]===r.value],"filter-id-==":[t6,[t9],(e,[t])=>e.id()===t.value],"filter-type-==":[t6,[t5],(e,[t])=>e.geometryType()===t.value],"filter-<":[t6,[t5,t9],(e,[t,r])=>{let n=e.properties()[t.value],i=r.value;return typeof n==typeof i&&n<i}],"filter-id-<":[t6,[t9],(e,[t])=>{let r=e.id(),n=t.value;return typeof r==typeof n&&r<n}],"filter->":[t6,[t5,t9],(e,[t,r])=>{let n=e.properties()[t.value],i=r.value;return typeof n==typeof i&&n>i}],"filter-id->":[t6,[t9],(e,[t])=>{let r=e.id(),n=t.value;return typeof r==typeof n&&r>n}],"filter-<=":[t6,[t5,t9],(e,[t,r])=>{let n=e.properties()[t.value],i=r.value;return typeof n==typeof i&&n<=i}],"filter-id-<=":[t6,[t9],(e,[t])=>{let r=e.id(),n=t.value;return typeof r==typeof n&&r<=n}],"filter->=":[t6,[t5,t9],(e,[t,r])=>{let n=e.properties()[t.value],i=r.value;return typeof n==typeof i&&n>=i}],"filter-id->=":[t6,[t9],(e,[t])=>{let r=e.id(),n=t.value;return typeof r==typeof n&&r>=n}],"filter-has":[t6,[t9],(e,[t])=>{let r=t.value,n=e.properties();return r in n&&void 0!==n[r]}],"filter-has-id":[t6,[],e=>null!==e.id()&&void 0!==e.id()],"filter-type-in":[t6,[ro(t5)],(e,[t])=>t.value.indexOf(e.geometryType())>=0],"filter-id-in":[t6,[ro(t9)],(e,[t])=>t.value.indexOf(e.id())>=0],"filter-in-small":[t6,[t5,ro(t9)],(e,[t,r])=>r.value.indexOf(e.properties()[t.value])>=0],"filter-in-large":[t6,[t5,ro(t9)],(e,[t,r])=>(function(e,t,r,n){for(;r<=n;){let i=r+n>>1;if(t[i]===e)return!0;t[i]>e?n=i-1:r=i+1}return!1})(e.properties()[t.value],r.value,0,r.value.length-1)],all:{type:t6,overloads:[[[t6,t6],(e,[t,r])=>t.evaluate(e)&&r.evaluate(e)],[ia(t6),(e,t)=>{for(let r of t)if(!r.evaluate(e))return!1;return!0}]]},any:{type:t6,overloads:[[[t6,t6],(e,[t,r])=>t.evaluate(e)||r.evaluate(e)],[ia(t6),(e,t)=>{for(let r of t)if(r.evaluate(e))return!0;return!1}]]},"!":[t6,[t6],(e,[t])=>!t.evaluate(e)],"is-supported-script":[t6,[t5],(e,[t])=>{let r=e.globals&&e.globals.isSupportedScript;return!r||r(t.evaluate(e))}],upcase:[t5,[t5],(e,[t])=>t.evaluate(e).toUpperCase()],downcase:[t5,[t5],(e,[t])=>t.evaluate(e).toLowerCase()],concat:[t5,ia(t9),(e,t)=>t.map(t=>rH(t.evaluate(e))).join("")],split:[ro(t5),[t5,t5],(e,[t,r])=>t.evaluate(e).split(r.evaluate(e))],join:[t5,[ro(t5),t5],(e,[t,r])=>t.evaluate(e).join(r.evaluate(e))],"resolved-locale":[t5,[re],(e,[t])=>t.evaluate(e).resolvedLocale()]});let id=/^(.*)-transition$/;function iy(e,...t){for(let r of t)for(let t in r)e[t]=r[t];return e}function im(e){return e instanceof Number?"number":e instanceof String?"string":e instanceof Boolean?"boolean":Array.isArray(e)?"array":null===e?"null":typeof e}function ig(e){return"object"==typeof e&&!!e&&!Array.isArray(e)&&rZ(e)===t7}function ix(e){return e}function iv(e,t,r){return void 0!==e?e:void 0!==t?t:void 0!==r?r:void 0}function ib(e,t,r,n,i){return iv(typeof r===i?n[r]:void 0,e.default,t.default)}function iw(e,t,r){if("number"!==im(r))return iv(e.default,t.default);let n=e.stops.length;if(1===n||r<=e.stops[0][0])return e.stops[0][1];if(r>=e.stops[n-1][0])return e.stops[n-1][1];let i=r1(e.stops.map(e=>e[0]),r,"");return e.stops[i][1]}function iD(e,t,r){var n,i,a;let s,o,l=void 0===e.base?1:e.base;if("number"!==im(r))return iv(e.default,t.default);let u=e.stops.length;if(1===u||r<=e.stops[0][0])return e.stops[0][1];if(r>=e.stops[u-1][0])return e.stops[u-1][1];let h=r1(e.stops.map(e=>
1e[0]),r,""),c=(n=r,i=l,a=e.stops[h][0],s=e.stops[h+1][0]-a,o=n-a,0===s?0:1===i?o/s:(i**o-1)/(i**s-1)),p=e.stops[h][1],f=e.stops[h+1][1],d=r5[t.type]||ix;return"function"==typeof p.evaluate?{evaluate(...t){let r=p.evaluate.apply(void 0,t),n=f.evaluate.apply(void 0,t);if(void 0!==r&&void 0!==n)return d(r,n,c,e.colorSpace)}}:d(p,f,c,e.colorSpace)}function i_(e,t,r){switch(t.type){case"color":r=rP.parse(r);break;case"formatted":r=rV.fromString(r.toString());break;case"resolvedImage":r=rj.fromString(r.toString());break;case"padding":r=rR.parse(r);break;case"colorArray":r=r$.parse(r);break;case"numberArray":r=rO.parse(r);break;default:im(r)===t.type||"enum"===t.type&&t.values[r]||(r=void 0)}return iv(r,e.default,t.default)}function iA(e){return{result:"success",value:e}}function iE(e){return{result:"error",value:e}}var iS=class{constructor(e,t,r,n){this.expression=e,this._warningHistory={},this._evaluator=new rQ,this._defaultValue=r?iL(r):null,this._enumValues=r&&"enum"===r.type?r.values:null,this._globalState=n,this._rootKey=t}evaluateWithoutErrorHandling(e,t,r,n,i,a){return this._globalState&&(e=iV(e,this._globalState)),this._evaluator.globals=e,this._evaluator.feature=t,this._evaluator.featureState=r,this._evaluator.canonical=n,this._evaluator.availableImages=i||null,this._evaluator.formattedSection=a,this.expression.evaluate(this._evaluator)}evaluate(e,t,r,n,i,a){this._globalState&&(e=iV(e,this._globalState)),this._evaluator.globals=e,this._evaluator.feature=t||null,this._evaluator.featureState=r||null,this._evaluator.canonical=n,this._evaluator.availableImages=i||null,this._evaluator.formattedSection=a||null;try{let e=this.expression.evaluate(this._evaluator);if(null==e||"number"==typeof e&&e!=e)return this._defaultValue;if(this._enumValues&&!(e in this._enumValues))throw new rN(`Expected value to be one of ${Object.keys(this._enumValues).map(e=>JSON.stringify(e)).join(", ")}, but found ${JSON.stringify(e)} instead.`,"");return e}catch(r){let e=r instanceof rN?r.path:"",t=`${e}|${r.message}`;return this._warningHistory[t]||(this._warningHistory[t]=!0,"u">typeof console&&console.warn(iF(this._rootKey,e,r.message,this._defaultValue))),this._defaultValue}}};function iF(e,t,r,n){return`${e}${t}: ${r}${null==n?"":` Falling back to ${String(n)}.`}`}function ik(e){if(!e)throw Error('rootKey must identify the location of the expression in the style JSON, e.g. "layers[3].paint.line-width".')}function iT(e){return Array.isArray(e)&&e.length>0&&"string"==typeof e[0]&&e[0]in n4}function iI(e,t,r,n){var i;let a;ik(t);let s=new n9(n4,is,[],r?(i=r,a={color:t4,string:t5,number:t3,enum:t5,boolean:t6,formatted:rt,padding:rr,numberArray:ri,colorArray:rn,projectionDefinition:t8,resolvedImage:ra,variableAnchorOffsetCollection:rs},"array"===i.type?ro(a[i.value]||t9,i.length):a[i.type]):void 0),o=s.parse(e,void 0,void 0,void 0,r&&"string"===r.type?{typeAnnotation:"coerce"}:void 0);return o?iA(new iS(o,t,r,n)):iE(s.errors)}var iC=class{constructor(e,t,r){this.kind=e,this._styleExpression=t,this.isStateDependent="constant"!==e&&!il(t.expression),this.globalStateRefs=iz(t.expression),this._globalState=r}evaluateWithoutErrorHandling(e,t,r,n,i,a){return this._globalState&&(e=iV(e,this._globalState)),this._styleExpression.evaluateWithoutErrorHandling(e,t,r,n,i,a)}evaluate(e,t,r,n,i,a){return this._globalState&&(e=iV(e,this._globalState)),this._styleExpression.evaluate(e,t,r,n,i,a)}},iB=class{constructor(e,t,r,n,i){this.kind=e,this.zoomStops=r,this._styleExpression=t,this.isStateDependent="camera"!==e&&!il(t.expression),this.globalStateRefs=iz(t.expression),this.interpolationType=n,this._globalState=i}evaluateWithoutErrorHandling(e,t,r,n,i,a){return this._globalState&&(e=iV(e,this._globalState)),this._styleExpression.evaluateWithoutErrorHandling(e,t,r,n,i,a)}evaluate(e,t,r,n,i,a){return this._globalState&&(e=iV(e,this._globalState)),this._styleExpression.evaluate(e,t,r,n,i,a)}interpolationFactor(e,t,r){return this.interpolationType?r2.interpolationFactor(this.interpolationType,e,t,r):0}};function iM(e,t,r,n){let i=iI(e,t,r,n);if("error"===i.result)return i;let a=i.value.expression,s=io(a);if(!s&&!ih(r))return iE([new n8("","data expressions not supported")]);let o=iu(a,["zoom"]);if(!o&&!ic(r))return iE([new n8("","zoom expressions not supported")]);let l=function e(t){let r=null;if(t instanceof nn)r=e(t.result);else if(t instanceof nc){for(let n of t.args)if(r=e(n))break}else(t instanceof r0||t instanceof r2)&&t.input instanceof ie&&"zoom"===t.input.name&&(r=t);return r instanceof n8||t.eachChild(t=>{let n=e(t);n instanceof n8?r=n:!r&&n?r=new n8("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):r&&n&&r!==n&&(r=new n8("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),r}(a);if(!l&&!o)return iE([new n8("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]);if(l instanceof n8)return iE([l]);if(l instanceof r2&&!ip(r))return iE([new n8("",'"interpolate" expressions cannot be used with this property')]);if(!l)return iA(s?new iC("constant",i.value,n):new iC("source",i.value,n));let u=l instanceof r2?l.interpolation:void 0;return iA(s?new iB("camera",i.value,l.labels,u,n):new iB("composite",i.value,l.labels,u,n))}var iP=class e{constructor(e,t,r){this.isStateDependent=!1,this.globalStateRefs=new Set,this._globalState=null,ik(t),this._parameters=e,this._specification=r,this._rootKey=t,this._defaultValue=iL(r),this._warningHistory={};let n=function e(t,r){var n;let i=t.stops&&"object"==typeof t.stops[0][0],a=i||void 0!==t.property,s=t.type||(ip(r)?"exponential":"interval"),o=function(e){switch(e.type){case"color":return rP.parse;case"padding":return rR.parse;case"numberArray":return rO.parse;case"colorArray":return r$.parse;default:return null}}(r);if(o&&((t=iy({},t)).stops&&(t.stops=t.stops.map(e=>[e[0],o(e[1])])),t.default?t.default=o(t.default):t.default=o(r.default)),t.colorSpace&&"rgb"!==(n=t.colorSpace)&&"hcl"!==n&&"lab"!==n)throw Error(`Unknown color space: "${t.colorSpace}"`);let l=function(e){switch(e){case"exponential":return iD;case"interval":return iw;case"categorical":return ib;case"identity":return i_;default:throw Error(`Unknown function type "${e}"`)}}(s),u,h;if("categorical"===s){for(let e of(u=Object.create(null),t.stops))u[e[0]]=e[1];h=typeof t.stops[0][0]}if(i){let n={},i=[];for(let e=0;e<t.stops.length;e++){let r=t.stops[e],a=r[0].zoom;void 0===n[a]&&(n[a]={zoom:a,type:t.type,property:t.property,default:t.default,stops:[]},i.push(a)),n[a].stops.push([r[0].value,r[1]])}let a=[];for(let t of i)a.push([n[t].zoom,e(n[t],r)]);let s={name:"linear"};return{kind:"composite",interpolationType:s,interpolationFactor:r2.interpolationFactor.bind(void 0,s),zoomStops:a.map(e=>e[0]),evaluate:({zoom:e},n)=>iD({stops:a,base:t.base},r,e).evaluate(e,n)}}if(i||!a){let e="exponential"===s?{name:"exponential",base:void 0===t.base?1:t.base}:null;return{kind:"camera",interpolationType:e,interpolationFactor:r2.interpolationFactor.bind(void 0,e),zoomStops:t.stops.map(e=>e[0]),evaluate:({zoom:e})=>l(t,r,e,u,h)}}return{kind:"source",evaluate(e,n){let i=n&&n.properties?n.properties[t.property]:void 0;return void 0===i?iv(t.default,r.default):l(t,r,i,u,h)}}}(this._parameters,this._specification);this.kind=n.kind,this.interpolationFactor=n.interpolationFactor,this.zoomStops=n.zoomStops,this.interpolationType=n.interpolationType,this._innerEvaluate=n.evaluate}evaluate(e,t){try{return this._innerEvaluate(e,t)}catch(r){let e=r instanceof Error?r.message:String(r),t=`|${e}`;return this._warningHistory[t]||(this._warningHistory[t]=!0,"u">typeof console&&console.warn(iF(this._rootKey,"",e,this._defaultValue))),this._defaultValue}}static deserialize(t){return new e(t._parameters,t._rootKey,t._specification)}static serialize(e){return{_parameters:e._parameters,_specification:e._specification,_rootKey:e._rootKey}}};
1function iz(e,t=new Set){return e instanceof n6&&t.add(e.key),e.eachChild(e=>{iz(e,t)}),t}function iL(e){if("color"===e.type&&ig(e.default))return new rP(0,0,0,0);switch(e.type){case"color":return rP.parse(e.default)||null;case"padding":return rR.parse(e.default)||null;case"numberArray":return rO.parse(e.default)||null;case"colorArray":return r$.parse(e.default)||null;case"variableAnchorOffsetCollection":return rq.parse(e.default)||null;case"projectionDefinition":return rG.parse(e.default)||null;default:return void 0===e.default?null:e.default}}function iV(e,t){let{zoom:r,heatmapDensity:n,elevation:i,lineProgress:a,isSupportedScript:s,accumulated:o}=e??{};return{zoom:r,heatmapDensity:n,elevation:i,lineProgress:a,isSupportedScript:s,accumulated:o,globalState:t}}function iR(e){return"legacy"!==function e(t){if("boolean"==typeof t)return"neutral";if(!Array.isArray(t)||0===t.length)return"legacy";switch(t[0]){case"has":return t.length<2||"$id"===t[1]||"$type"===t[1]?"legacy":2===t.length?"neutral":"expression";case"in":return t.length>=3&&("string"!=typeof t[1]||Array.isArray(t[2]))?"expression":"legacy";case"!in":case"!has":case"none":return"legacy";case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==t.length||Array.isArray(t[1])||Array.isArray(t[2])?"expression":"legacy";case"any":case"all":var r=t.slice(1);let n=!1;for(let t of r){let r=e(t);if("expression"===r)return"expression";"legacy"===r&&(n=!0)}return n?"legacy":"neutral";default:return"expression"}}(e)}function iO(e){return"$type"===e?["geometry-type"]:"$id"===e?["id"]:["get",e]}function i$(e){if(("<"===e[0]||"<="===e[0]||">"===e[0]||">="===e[0])&&"$type"===e[1])return`"$type" cannot be use with operator "${e[0]}"`;let t=function(e){switch(e[0]){case"==":case"!=":case"<":case"<=":case">":case">=":return 3!==e.length||"string"!=typeof e[1]?null:[e[0],iO(e[1]),e[2]];case"in":case"!in":{if(e.length<2||"string"!=typeof e[1])return null;let t=["in",iO(e[1]),["literal",e.slice(2)]];return"!in"===e[0]?["!",t]:t}case"has":case"!has":{if(2!==e.length||"string"!=typeof e[1]||"$type"===e[1]||"$id"===e[1])return null;let t=["has",e[1]];return"!has"===e[0]?["!",t]:t}default:return null}}(e);return t?`Mixing deprecated filter syntax with expression syntax is not supported. Replace ${JSON.stringify(e)} with ${JSON.stringify(t)}.`:`Mixing deprecated filter syntax with expression syntax is not supported. Convert ${JSON.stringify(e)} to expression syntax.`}function iN(e,t,r){let n=r[e];return Array.isArray(n)?iR(n)?iU(n,t.concat(e)):{path:t.concat(e),legacyFilter:n}:null}function iU(e,t=[]){if(!Array.isArray(e)||e.length<1)return null;switch(e[0]){case"all":case"any":case"none":for(let r=1;r<e.length;r++){let n=iN(r,t,e);if(n)return n}break;case"!":{let r=iN(1,t,e);if(r)return r;break}case"case":for(let r=1;r<e.length-1;r+=2){let n=iN(r,t,e);if(n)return n}}return null}let iq={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function ij(e,t,r){if(null==e)return{filter:()=>!0,needGeometry:!1,getGlobalStateRefs:()=>new Set};iR(e)?function(e,t){let r=iU(e);if(!r||typeof console>"u")return;let n=r.path.map(e=>`[${e}]`).join("");console.warn(`${t}${n}: ${i$(r.legacyFilter)}`)}(e,t):e=function e(t){if(!t)return!0;let r=t[0];return t.length<=1?"any"!==r:"=="===r?iY(t[1],t[2],"=="):"!="===r?iZ(iY(t[1],t[2],"==")):"<"===r||">"===r||"<="===r||">="===r?iY(t[1],t[2],r):"any"===r?["any"].concat(t.slice(1).map(e)):"all"===r?["all"].concat(t.slice(1).map(e)):"none"===r?["all"].concat(t.slice(1).map(e).map(iZ)):"in"===r?iX(t[1],t.slice(2)):"!in"===r?iZ(iX(t[1],t.slice(2))):"has"===r?iW(t[1]):"!has"!==r||iZ(iW(t[1]))}(e);let n=iI(e,t,iq,r);if("error"===n.result)throw Error(n.value.map(e=>`${e.key}: ${e.message}`).join(", "));return{filter:(e,t,r)=>n.value.evaluate(e,t,{},r),needGeometry:function e(t){if(!Array.isArray(t))return!1;if("within"===t[0]||"distance"===t[0])return!0;for(let r=1;r<t.length;r++)if(e(t[r]))return!0;return!1}(e),getGlobalStateRefs:()=>iz(n.value.expression)}}function iG(e,t){return e<t?-1:+(e>t)}function iY(e,t,r){switch(e){case"$type":return[`filter-type-${r}`,t];case"$id":return[`filter-id-${r}`,t];default:return[`filter-${r}`,e,t]}}function iX(e,t){if(0===t.length)return!1;switch(e){case"$type":return["filter-type-in",["literal",t]];case"$id":return["filter-id-in",["literal",t]];default:return t.length>200&&!t.some(e=>typeof e!=typeof t[0])?["filter-in-large",e,["literal",t.sort(iG)]]:["filter-in-small",e,["literal",t]]}}function iW(e){switch(e){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",e]}}function iZ(e){return["!",e]}function iH(e){let t=e.key,r=e.value;return r?[new t0(t,r,"constants have been deprecated as of v8")]:[]}function iK(e){return e instanceof Number||e instanceof String||e instanceof Boolean?e.valueOf():e}function iJ(e){if(Array.isArray(e))return e.map(iJ);if(e instanceof Object&&!(e instanceof Number||e instanceof String||e instanceof Boolean)){let t={};for(let r in e)t[r]=iJ(e[r]);return t}return iK(e)}function iQ(e){let t=e.key,r=e.value,n=e.valueSpec||{},i=e.objectElementValidators||{},a=e.style,s=e.styleSpec,o=e.validateSpec,l=[],u=im(r);if("object"!==u)return[new t0(t,r,`object expected, ${u}
1 found`)];for(let e in r){let u=e.split(".")[0],h=rF(n,u)||n["*"],c;if(rF(i,u))c=i[u];else if(rF(n,u)){if(void 0===r[e])continue;c=o}else if(i["*"])c=i["*"];else if(n["*"])c=o;else{l.push(new t0(t,r[e],`unknown property "${e}"`));continue}l=l.concat(c({key:(t&&`${t}.`)+e,value:r[e],valueSpec:h,style:a,styleSpec:s,object:r,objectKey:e,validateSpec:o},r))}for(let e in n)i[e]||n[e].required&&void 0===n[e].default&&void 0===r[e]&&l.push(new t0(t,r,`missing required property "${e}"`));return l}function i1(e){let t=e.value,r=e.valueSpec,n=e.validateSpec,i=e.style,a=e.styleSpec,s=e.key,o=e.arrayElementValidator||n;if("array"!==im(t))return[new t0(s,t,`array expected, ${im(t)} found`)];if(r.length&&t.length!==r.length)return[new t0(s,t,`array length ${r.length} expected, length ${t.length} found`)];let l={type:r.value,values:r.values};a.$version<7&&(l.function=r.function),"object"===im(r.value)&&(l=r.value);let u=[];for(let r=0;r<t.length;r++)u=u.concat(o({array:t,arrayIndex:r,value:t[r],valueSpec:l,validateSpec:e.validateSpec,style:i,styleSpec:a,key:`${s}[${r}]`}));return u}function i0(e){let t=e.key,r=e.value,n=e.valueSpec,i=im(r);return"number"===i&&r!=r&&(i="NaN"),"number"===i?"minimum"in n&&r<n.minimum?[new t0(t,r,`${r} is less than the minimum value ${n.minimum}`)]:"maximum"in n&&r>n.maximum?[new t0(t,r,`${r} is greater than the maximum value ${n.maximum}`)]:[]:[new t0(t,r,`number expected, ${i} found`)]}function i2(e){let t=e.valueSpec,r=iK(e.value.type),n,i={},a,s,o="categorical"!==r&&void 0===e.value.property,l="array"===im(e.value.stops)&&"array"===im(e.value.stops[0])&&"object"===im(e.value.stops[0][0]),u=iQ({key:e.key,value:e.value,valueSpec:e.styleSpec.function,validateSpec:e.validateSpec,style:e.style,styleSpec:e.styleSpec,objectElementValidators:{stops:function(e){if("identity"===r)return[new t0(e.key,e.value,'identity function may not have a "stops" property')];let t=[],n=e.value;return t=t.concat(i1({key:e.key,value:n,valueSpec:e.valueSpec,validateSpec:e.validateSpec,style:e.style,styleSpec:e.styleSpec,arrayElementValidator:h})),"array"===im(n)&&0===n.length&&t.push(new t0(e.key,n,"array must have at least one stop")),t},default:function(e){return e.validateSpec({key:e.key,value:e.value,valueSpec:t,validateSpec:e.validateSpec,style:e.style,styleSpec:e.styleSpec})}}});return"identity"===r&&o&&u.push(new t0(e.key,e.value,'missing required property "property"')),"identity"===r||e.value.stops||u.push(new t0(e.key,e.value,'missing required property "stops"')),"exponential"===r&&e.valueSpec.expression&&!ip(e.valueSpec)&&u.push(new t0(e.key,e.value,"exponential functions not supported")),e.styleSpec.$version>=8&&(o||ih(e.valueSpec)?o&&!ic(e.valueSpec)&&u.push(new t0(e.key,e.value,"zoom functions not supported")):u.push(new t0(e.key,e.value,"property functions not supported"))),("categorical"===r||l)&&void 0===e.value.property&&u.push(new t0(e.key,e.value,'"property" property is required')),u;function h(e){let r=[],n=e.value,o=e.key;if("array"!==im(n))return[new t0(o,n,`array expected, ${im(n)} found`)];if(2!==n.length)return[new t0(o,n,`array length 2 expected, length ${n.length} found`)];if(l){if("object"!==im(n[0]))return[new t0(o,n,`object expected, ${im(n[0])} found`)];if(void 0===n[0].zoom)return[new t0(o,n,"object stop key must have zoom")];if(void 0===n[0].value)return[new t0(o,n,"object stop key must have value")];if(s&&s>iK(n[0].zoom))return[new t0(o,n[0].zoom,"stop zoom values must appear in ascending order")];iK(n[0].zoom)!==s&&(s=iK(n[0].zoom),a=void 0,i={}),r=r.concat(iQ({key:`${o}[0]`,value:n[0],valueSpec:{zoom:{}},validateSpec:e.validateSpec,style:e.style,styleSpec:e.styleSpec,objectElementValidators:{zoom:i0,value:c}}))}else r=r.concat(c({key:`${o}[0]`,value:n[0],valueSpec:{},validateSpec:e.validateSpec,style:e.style,styleSpec:e.styleSpec},n));return iT(iJ(n[1]))?r.concat([new t0(`${o}[1]`,n[1],"expressions are not allowed in function stops.")]):r.concat(e.validateSpec({key:`${o}[1]`,value:n[1],valueSpec:t,validateSpec:e.validateSpec,style:e.style,styleSpec:e.styleSpec}))}function c(e,s){let o=im(e.value),l=iK(e.value),u=null===e.value?s:e.value;if(n){if(o!==n)return[new t0(e.key,u,`${o} stop domain type must match previous stop domain type ${n}`)]}else n=o;if("number"!==o&&"string"!==o&&"boolean"!==o)return[new t0(e.key,u,"stop domain value must be a number, string, or boolean")];if("number"!==o&&"categorical"!==r){let n=`number expected, ${o} found`;return ih(t)&&void 0===r&&(n+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new t0(e.key,u,n)]}return"categorical"!==r||"number"!==o||isFinite(l)&&Math.floor(l)===l?"categorical"!==r&&"number"===o&&void 0!==a&&l<a?[new t0(e.key,u,"stop domain values must appear in ascending order")]:(a=l,"categorical"===r&&l in i?[new t0(e.key,u,"stop domain values must be unique")]:(i[l]=!0,[])):[new t0(e.key,u,`integer expected, found ${l}`)]}}
1function i3(e){let t=("property"===e.expressionContext?iM:iI)(iJ(e.value),e.key,e.valueSpec);if("error"===t.result)return t.value.map(t=>new t0(`${e.key}${t.key}`,e.value,t.message));let r=t.value.expression||t.value._styleExpression.expression;if("property"===e.expressionContext&&"text-font"===e.propertyKey&&!r.outputDefined())return[new t0(e.key,e.value,`Invalid data expression for "${e.propertyKey}". Output values must be contained as literals within the expression.`)];if("property"===e.expressionContext&&"layout"===e.propertyType&&!il(r))return[new t0(e.key,e.value,'"feature-state" data expressions are not supported with layout properties.')];if("filter"===e.expressionContext&&!il(r))return[new t0(e.key,e.value,'"feature-state" data expressions are not supported with filters.')];if(e.expressionContext&&0===e.expressionContext.indexOf("cluster")){if(!iu(r,["zoom","feature-state"]))return[new t0(e.key,e.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if("cluster-initial"===e.expressionContext&&!io(r))return[new t0(e.key,e.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function i5(e){let t=e.key,r=e.value,n=im(r);return"string"===n?rP.parse(String(r))?[]:[new t0(t,r,`color expected, "${r}" found`)]:[new t0(t,r,`color expected, ${n} found`)]}function i6(e){let t=e.key,r=e.value,n=e.valueSpec,i=[];return Array.isArray(n.values)?-1===n.values.indexOf(iK(r))&&i.push(new t0(t,r,`expected one of [${n.values.join(", ")}], ${JSON.stringify(r)} found`)):-1===Object.keys(n.values).indexOf(iK(r))&&i.push(new t0(t,r,`expected one of [${Object.keys(n.values).join(", ")}], ${JSON.stringify(r)} found`)),i}function i4(e){let t,r=iJ(e.value);return iR(r)?[...(t=iU(r))?[new t0(`${e.key}${t.path.map(e=>`[${e}]`).join("")}`,function(e,t){let r=e;for(let e of t)r=r[e];return r}(e.value,t.path),i$(t.legacyFilter),null,"warning")]:[],...i3(iy({},e,{expressionContext:"filter",valueSpec:{value:"boolean"}}))]:function e(t){let r=t.value,n=t.key;if("array"!==im(r))return[new t0(n,r,`array expected, ${im(r)} found`)];let i=t.styleSpec,a,s=[];if(r.length<1)return[new t0(n,r,"filter array must have at least 1 element")];switch(s=s.concat(i6({key:`${n}[0]`,value:r[0],valueSpec:i.filter_operator,style:t.style,styleSpec:t.styleSpec})),iK(r[0])){case"<":case"<=":case">":case">=":r.length>=2&&"$type"===iK(r[1])&&s.push(new t0(n,r,`"$type" cannot be use with operator "${r[0]}"`));case"==":case"!=":3!==r.length&&s.push(new t0(n,r,`filter array for operator "${r[0]}" must have 3 elements`));case"in":case"!in":r.length>=2&&"string"!==(a=im(r[1]))&&s.push(new t0(`${n}[1]`,r[1],`string expected, ${a} found`));for(let e=2;e<r.length;e++)a=im(r[e]),"$type"===iK(r[1])?s=s.concat(i6({key:`${n}[${e}]`,value:r[e],valueSpec:i.geometry_type,style:t.style,styleSpec:t.styleSpec})):"string"!==a&&"number"!==a&&"boolean"!==a&&s.push(new t0(`${n}[${e}]`,r[e],`string, number, or boolean expected, ${a} found`));break;case"any":case"all":case"none":for(let i=1;i<r.length;i++)s=s.concat(e({key:`${n}[${i}]`,value:r[i],style:t.style,styleSpec:t.styleSpec}));break;case"has":case"!has":a=im(r[1]),2===r.length?"string"!==a&&s.push(new t0(`${n}[1]`,r[1],`string expected, ${a} found`)):s.push(new t0(n,r,`filter array for "${r[0]}" operator must have 2 elements`))}return s}(e)}function i8(e,t){let r,n=e.key,i=e.validateSpec,a=e.style,s=e.styleSpec,o=e.value,l=e.objectKey,u=s[`${t}_${e.layerType}`];if(!u)return[];let h=l.match(id);if("paint"===t&&h&&u[h[1]]&&u[h[1]].transition)return i({key:n,value:o,valueSpec:s.transition,style:a,styleSpec:s});let c=e.valueSpec||u[l];if(!c)return[new t0(n,o,`unknown property "${l}"`)];if("string"===im(o)&&ih(c)&&!c.tokens&&(r=/^{([^}]+)}$/.exec(o)))return[new t0(n,o,`"${l}" does not support interpolation syntax 2Use an identity property function instead: \`{ "type": "identity", "property": ${JSON.stringify(r[1])} }\`.`)];let p=[];return"symbol"===e.layerType&&"text-font"===l&&ig(iJ(o))&&"identity"===iK(o.type)&&p.push(new t0(n,o,'"text-font" does not support identity functions')),p.concat(i({key:e.key,value:o,valueSpec:c,style:a,styleSpec:s,expressionContext:"property",propertyType:t,propertyKey:l}))}function i7(e){return i8(e,"paint")}function i9(e){return i8(e,"layout")}function ae(e){let t=[],r=e.value,n=e.key,i=e.style,a=e.styleSpec;if("object"!==im(r))return[new t0(n,r,`object expected, ${im(r)} found`)];r.type||r.ref||t.push(new t0(n,r,'either "type" or "ref" is required'));let s=iK(r.type),o=iK(r.ref);if(r.id){let a=iK(r.id);for(let s=0;s<e.arrayIndex;s++){let e=i.layers[s];iK(e.id)===a&&t.push(new t0(n,r.id,`duplicate layer id "${r.id}", previously used at line ${e.id.__line__}`))}}if("ref"in r){let e;
2["type","source","source-layer","filter","layout"].forEach(e=>{e in r&&t.push(new t0(n,r[e],`"${e}" is prohibited for ref layers`))}),i.layers.forEach(t=>{iK(t.id)===o&&(e=t)}),e?e.ref?t.push(new t0(n,r.ref,"ref cannot reference another ref layer")):s=iK(e.type):t.push(new t0(n,r.ref,`ref layer "${o}" not found`))}else if("background"!==s)if(r.source){let e=i.sources&&i.sources[r.source],a=e&&iK(e.type);e?"vector"===a&&"raster"===s?t.push(new t0(n,r.source,`layer "${r.id}" requires a raster source`)):"raster-dem"!==a&&"hillshade"===s||"raster-dem"!==a&&"color-relief"===s?t.push(new t0(n,r.source,`layer "${r.id}" requires a raster-dem source`)):"raster"===a&&"raster"!==s?t.push(new t0(n,r.source,`layer "${r.id}" requires a vector source`)):"vector"!==a||r["source-layer"]?"raster-dem"===a&&"hillshade"!==s&&"color-relief"!==s?t.push(new t0(n,r.source,"raster-dem source can only be used with layer type 'hillshade' or 'color-relief'.")):"line"===s&&r.paint&&r.paint["line-gradient"]&&("geojson"!==a||!e.lineMetrics)&&t.push(new t0(n,r,`layer "${r.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):t.push(new t0(n,r,`layer "${r.id}" must specify a "source-layer"`)):t.push(new t0(n,r.source,`source "${r.source}" not found`))}else t.push(new t0(n,r,'missing required property "source"'));return"raster"===s&&r.paint?.resampling&&r.paint?.["raster-resampling"]&&t.push(new t0(n,r.paint,`layer "${r.id}" redundantly specifies "resampling" and "raster-resampling" paint properties, but only one is allowed. It is advised to use "resampling".`)),t=t.concat(iQ({key:n,value:r,valueSpec:a.layer,style:e.style,styleSpec:e.styleSpec,validateSpec:e.validateSpec,objectElementValidators:{"*":()=>[],type:()=>e.validateSpec({key:`${n}.type`,value:r.type,valueSpec:a.layer.type,style:e.style,styleSpec:e.styleSpec,validateSpec:e.validateSpec,object:r,objectKey:"type"}),filter:i4,layout:e=>iQ({layer:r,key:e.key,value:e.value,style:e.style,styleSpec:e.styleSpec,validateSpec:e.validateSpec,objectElementValidators:{"*":e=>i9(iy({layerType:s},e))}}),paint:e=>iQ({layer:r,key:e.key,value:e.value,style:e.style,styleSpec:e.styleSpec,validateSpec:e.validateSpec,objectElementValidators:{"*":e=>i7(iy({layerType:s},e))}})}}))}function at(e){let t=e.value,r=e.key,n=im(t);return"string"===n?[]:[new t0(r,t,`string expected, ${n} found`)]}let ar={promoteId:function({key:e,value:t}){if("string"===im(t))return at({key:e,value:t});{let r=[];for(let n in t)r.push(...at({key:`${e}.${n}`,value:t[n]}));return r}}};function an(e){let t=e.value,r=e.key,n=e.styleSpec,i=e.style,a=e.validateSpec;if(!t.type)return[new t0(r,t,'"type" is required')];let s=iK(t.type),o;switch(s){case"vector":case"raster":return iQ({key:r,value:t,valueSpec:n[`source_${s.replace("-","_")}`],style:e.style,styleSpec:n,objectElementValidators:ar,validateSpec:a});case"raster-dem":return function(e){let t=e.sourceName??"",r=e.value,n=e.styleSpec,i=n.source_raster_dem,a=e.style,s=[],o=im(r);if(void 0===r)return s;if("object"!==o)return s.push(new t0("source_raster_dem",r,`object expected, ${o} found`)),s;let l="custom"===iK(r.encoding),u=["redFactor","greenFactor","blueFactor","baseShift"],h=e.value.encoding?`"${e.value.encoding}"`:"Default";for(let o in r)!l&&u.includes(o)?s.push(new t0(o,r[o],`In "${t}": "${o}" is only valid when "encoding" is set to "custom". ${h} encoding found`)):i[o]?s=s.concat(e.validateSpec({key:o,value:r[o],valueSpec:i[o],validateSpec:e.validateSpec,style:a,styleSpec:n})):s.push(new t0(o,r[o],`unknown property "${o}"`));return s}({sourceName:r,value:t,style:e.style,styleSpec:n,validateSpec:a});case"geojson":if(o=iQ({key:r,value:t,valueSpec:n.source_geojson,style:i,styleSpec:n,validateSpec:a,objectElementValidators:ar}),t.cluster)for(let e in t.clusterProperties){let[n,i]=t.clusterProperties[e],s="string"==typeof n?[n,["accumulated"],["get",e]]:n;o.push(...i3({key:`${r}.${e}.map`,value:i,validateSpec:a,expressionContext:"cluster-map"})),o.push(...i3({key:`${r}.${e}.reduce`,value:s,validateSpec:a,expressionContext:"cluster-reduce"}))}return o;case"video":return iQ({key:r,value:t,valueSpec:n.source_video,style:i,validateSpec:a,styleSpec:n});case"image":return iQ({key:r,value:t,valueSpec:n.source_image,style:i,validateSpec:a,styleSpec:n});case"canvas":return[new t0(r,null,"Please use runtime APIs to add canvas sources, rather than
2including them in stylesheets.","source.canvas")];default:return i6({key:`${r}.type`,value:t.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:i,validateSpec:a,styleSpec:n})}}function ai(e){let t=e.value,r=e.styleSpec,n=r.light,i=e.style,a=[],s=im(t);if(void 0===t)return a;if("object"!==s)return a.concat([new t0("light",t,`object expected, ${s} found`)]);for(let s in t){let o=s.match(id);a=o&&n[o[1]]&&n[o[1]].transition?a.concat(e.validateSpec({key:s,value:t[s],valueSpec:r.transition,validateSpec:e.validateSpec,style:i,styleSpec:r})):n[s]?a.concat(e.validateSpec({key:s,value:t[s],valueSpec:n[s],validateSpec:e.validateSpec,style:i,styleSpec:r})):a.concat([new t0(s,t[s],`unknown property "${s}"`)])}return a}function aa(e){let t=e.value,r=e.styleSpec,n=r.sky,i=e.style,a=im(t);if(void 0===t)return[];if("object"!==a)return[new t0("sky",t,`object expected, ${a} found`)];let s=[];for(let a in t){let o=a.match(id);s=o&&n[o[1]]&&n[o[1]].transition?s.concat(e.validateSpec({key:a,value:t[a],valueSpec:r.transition,style:i,styleSpec:r})):n[a]?s.concat(e.validateSpec({key:a,value:t[a],valueSpec:n[a],style:i,styleSpec:r})):s.concat([new t0(a,t[a],`unknown property "${a}"`)])}return s}function as(e){let t=e.value,r=e.styleSpec,n=r.terrain,i=e.style,a=[],s=im(t);if(void 0===t)return a;
2if("object"!==s)return a.concat([new t0("terrain",t,`object expected, ${s} found`)]);for(let s in t)a=n[s]?a.concat(e.validateSpec({key:s,value:t[s],valueSpec:n[s],validateSpec:e.validateSpec,style:i,styleSpec:r})):a.concat([new t0(s,t[s],`unknown property "${s}"`)]);return a}function ao(e){let t=[],r=e.value,n=e.key;if(Array.isArray(r)){let i=[],a=[];for(let s in r)r[s].id&&i.includes(r[s].id)&&t.push(new t0(n,r,`all the sprites' ids must be unique, but ${r[s].id} is duplicated`)),i.push(r[s].id),r[s].url&&a.includes(r[s].url)&&t.push(new t0(n,r,`all the sprites' URLs must be unique, but ${r[s].url} is duplicated`)),a.push(r[s].url),t=t.concat(iQ({key:`${n}[${s}]`,value:r[s],valueSpec:{id:{type:"string",required:!0},url:{type:"string",required:!0}},validateSpec:e.validateSpec}));return t}return at({key:n,value:r})}function al(e){return!!e&&e.constructor===Object}function au(e){return al(e.value)?[]:[new t0(e.key,e.value,`object expected, ${im(e.value)} found`)]}let ah=/^u\+(?:([0-9a-f]{1,6})(?:-([0-9a-f]{1,6}))?|([0-9a-f]{0,5}\?{1,6}))$/i;function ac(e){let t=e.key??"font-faces",r=e.value,n=e.validateSpec,i=e.styleSpec??tJ,a=e.style;if(!al(r))return[new t0(t,r,`object expected, ${im(r)} found`)];let s=[];for(let e in r){let o=r[e],l=im(o);if("string"===l)s.push(...at({key:`${t}.${e}`,value:o}));else if("array"===l){let r={url:{type:"string",required:!0},"unicode-range":{type:"array",value:"string"}};for(let[l,u]of o.entries()){let o=`${t}.${e}[${l}]`;s.push(...iQ({key:o,value:u,valueSpec:r,styleSpec:i,style:a,validateSpec:n}));let h=al(u)?u["unicode-range"]:void 0;if("array"===im(h))for(let[e,t]of h.entries())s.push(...function(e,t){if("string"!==im(t))return[];let r=`${t}`,n=()=>[new t0(e,t,'invalid unicode range, expected a value such as "U+26", "U+0-10FFFF" or "U+4??"')],i=r.match(ah);if(!i)return n();let[,a,s,o]=i;if(void 0!==o)return o.length>6?n():[];let l=parseInt(a,16),u=void 0===s?l:parseInt(s,16);return l>1114111||u>1114111?[new t0(e,t,"unicode range is out of bounds, the maximum code point is U+10FFFF")]:l>u?[new t0(e,t,`unicode range start must not be greater than its end, but ${r} is`)]:[]}(`${o}.unicode-range[${e}]`,t))}}else s.push(new t0(`${t}.${e}`,o,`string or array expected, ${l} found`))}return s}let ap={"*":()=>[],array:i1,boolean:function(e){let t=e.value,r=e.key,n=im(t);return"boolean"===n?[]:[new t0(r,t,`boolean expected, ${n} found`)]},number:i0,color:i5,constants:iH,enum:i6,filter:i4,function:i2,layer:ae,object:iQ,source:an,light:ai,sky:aa,terrain:as,projection:function(e){let t=e.value,r=e.styleSpec,n=r.projection,i=e.style,a=im(t);if(void 0===t)return[];if("object"!==a)return[new t0("projection",t,`object expected, ${a} found`)];let s=[];for(let a in t)s=n[a]?s.concat(e.validateSpec({key:a,value:t[a],valueSpec:n[a],style:i,styleSpec:r})):s.concat([new t0(a,t[a],`unknown property "${a}"`)]);return s},projectionDefinition:function(e){var t;let r=e.key,n=e.value,i=im(n=n instanceof String?n.valueOf():n);return"array"!==i||Array.isArray(t=n)&&3===t.length&&"string"==typeof t[0]&&"string"==typeof t[1]&&"number"==typeof t[2]||["interpolate","step","literal"].includes(n[0])?["array","string"].includes(i)?[]:[new t0(r,n,`projection expected, invalid type "${i}" found`)]:[new t0(r,n,`projection expected, invalid array ${JSON.stringify(n)} found`)]},string:at,formatted:function(e){return 0===at(e).length?[]:i3(e)},resolvedImage:function(e){return 0===at(e).length?[]:i3(e)},padding:function(e){let t=e.key,r=e.value;if("array"===im(r)){if(r.length<1||r.length>4)return[new t0(t,r,`padding requires 1 to 4 values; ${r.length} values found`)];let n={type:"number"},i=[];for(let a=0;a<r.length;a++)i=i.concat(e.validateSpec({key:`${t}[${a}]`,value:r[a],validateSpec:e.validateSpec,valueSpec:n}));return i}return i0({key:t,value:r,valueSpec:{}})},numberArray:function(e){let t=e.key,r=e.value;if("array"===im(r)){let n={type:"number"};if(r.length<1)return[new t0(t,r,"array length at least 1 expected, length 0 found")];let i=[];for(let a=0;a<r.length;a++)i=i.concat(e.validateSpec({key:`${t}[${a}]`,value:r[a],validateSpec:e.validateSpec,valueSpec:n}));return i}return i0({key:t,value:r,valueSpec:{}}
2)},colorArray:function(e){let t=e.key,r=e.value;if("array"===im(r)){if(r.length<1)return[new t0(t,r,"array length at least 1 expected, length 0 found")];let e=[];for(let n=0;n<r.length;n++)e=e.concat(i5({key:`${t}[${n}]`,value:r[n],valueSpec:{}}));return e}return i5({key:t,value:r,valueSpec:{}})},variableAnchorOffsetCollection:function(e){let t=e.key,r=e.value,n=im(r),i=e.styleSpec;if("array"!==n||r.length<1||r.length%2!=0)return[new t0(t,r,"variableAnchorOffsetCollection requires a non-empty array of even length")];let a=[];for(let n=0;n<r.length;n+=2)a=(a=a.concat(i6({key:`${t}[${n}]`,value:r[n],valueSpec:i.layout_symbol["text-anchor"]}))).concat(i1({key:`${t}[${n+1}]`,value:r[n+1],valueSpec:{length:2,value:"number"},validateSpec:e.validateSpec,style:e.style,styleSpec:i}));return a},sprite:ao,state:au,fontFaces:ac};function af(e){let t=e.value,r=e.valueSpec,n=e.styleSpec;return e.validateSpec=af,r.expression&&ig(iK(t))?i2(e):r.expression&&iT(iJ(t))?i3(e):r.type&&ap[r.type]?ap[r.type](e):iQ(iy({},e,{valueSpec:r.type?n[r.type]:r}))}function ad(e){let t=e.value,r=e.key,n=at(e);return n.length||(-1===t.indexOf("{fontstack}")&&n.push(new t0(r,t,'"glyphs" url must include a "{fontstack}" token')),-1===t.indexOf("{range}")&&n.push(new t0(r,t,'"glyphs" url must include a "{range}" token'))),n}function ay(e,t=tQ){let r=[];return r=r.concat(af({key:"",value:e,valueSpec:t.$root,styleSpec:t,style:e,validateSpec:af,objectElementValidators:{glyphs:ad,"*":()=>[]}})),e.constants&&(r=r.concat(iH({key:"constants",value:e.constants,style:e,styleSpec:t,validateSpec:af}))),ag(r)}function am(e){return function(t){return e(Object.assign({},t,{validateSpec:af}))}}function ag(e){return[].concat(e).sort((e,t)=>e.line-t.line)}function ax(e){return function(...t){return ag(e.apply(this,t))}}ay.source=ax(am(an)),ay.sprite=ax(am(ao)),ay.glyphs=ax(am(ad)),ay.fontFaces=ax(am(ac)),ay.light=ax(am(ai)),ay.sky=ax(am(aa)),ay.terrain=ax(am(as)),ay.state=ax(am(au)),ay.layer=ax(am(ae)),ay.filter=ax(am(i4)),ay.paintProperty=ax(am(i7)),ay.layoutProperty=ax(am(i9));let av={type:"enum","property-type":"data-constant",expression:{interpolated:!1,parameters:["global-state"]},values:{visible:{},none:{}},transition:!1,default:"visible"};var ab=class{constructor(e,t,r){this._rootKey=t,this._globalState=r,this.setValue(e)}evaluate(){return this._literalValue??this._compiledValue.evaluate({})}setValue(e){if(null==e||"visible"===e||"none"===e){this._literalValue="none"===e?"none":"visible",this._compiledValue=void 0,this._globalStateRefs=new Set;return}let t=iI(e,this._rootKey,av,this._globalState);if("error"===t.result)throw this._literalValue="visible",this._compiledValue=void 0,Error(t.value.map(e=>`${e.key}: ${e.message}`).join(", "));this._literalValue=void 0,this._compiledValue=t.value,this._globalStateRefs=iz(t.value.expression)}getGlobalStateRefs(){return this._globalStateRefs}};let aw=ay,aD=new Set(Object.keys(tQ).filter(e=>e.startsWith("source_")).map(e=>e.slice(7).replaceAll("_","-")));function a_(e,t){let r=Object.entries(t.sources??{}).filter(([,e])=>!aD.has(e.type)).map(([e])=>`sources.${e}`);return aA(e,aw(t).filter(({message:e})=>!r.some(t=>e.startsWith(`${t}:`)||e.startsWith(`${t}.`))))}function aA(e,t){let r=!1;for(let n of t){if("warning"===n.severity){to(n.message);continue}e.fire(new tH(Error(n.message))),r=!0}return r}function aE(e,t,r,n){return n?.validate!==!1&&aA(e,t({styleSpec:tQ,...r}))}var aS=class e{constructor(e,t,r){let n=this.cells=[];if(e instanceof ArrayBuffer){this.arrayBuffer=e;let i=new Int32Array(this.arrayBuffer);e=i[0],t=i[1],r=i[2],this.d=t+2*r;for(let e=0;e<this.d*this.d;e++){let t=i[3+e],r=i[3+e+1];n.push(t===r?null:i.subarray(t,r))}let a=i[3+n.length],s=i[3+n.length+1];this.keys=i.subarray(a,s),this.bboxes=i.subarray(s),this.insert=this._insertReadonly}else{this.d=t+2*r;for(let e=0;e<this.d*this.d;e++)n.push([]);this.keys=[],this.bboxes=[]}this.n=t,this.extent=e,this.padding=r,this.scale=t/e,this.uid=0;let i=r/t*e;this.min=-i,this.max=e+i}insert(e,t,r,n,i){this._forEachCell(t,r,n,i,this._insertCell,this.uid++,void 0,void 0),this.keys.push(e),this.bboxes.push(t),this.bboxes.push(r),this.bboxes.push(n),this.bboxes.push(i)}_insertReadonly(){throw Error("Cannot insert into a GridIndex created from an ArrayBuffer.")}_insertCell(e,t,r,n,i,a){this.cells[i].push(a)}query(e,t,r,n,i){let a=this.min,s=this.max;if(e<=a&&t<=a&&s<=r&&s<=n&&!i)return[...this.keys];{let a=[];
2return this._forEachCell(e,t,r,n,this._queryCell,a,{},i),a}}_queryCell(e,t,r,n,i,a,s,o){let l=this.cells[i];if(null!==l){let i=this.keys,u=this.bboxes;for(let h of l)if(void 0===s[h]){let l=4*h;(o?o(u[l+0],u[l+1],u[l+2],u[l+3]):e<=u[l+2]&&t<=u[l+3]&&r>=u[l+0]&&n>=u[l+1])?(s[h]=!0,a.push(i[h])):s[h]=!1}}}_forEachCell(e,t,r,n,i,a,s,o){let l=this._convertToCellCoord(e),u=this._convertToCellCoord(t),h=this._convertToCellCoord(r),c=this._convertToCellCoord(n);for(let p=l;p<=h;p++)for(let l=u;l<=c;l++){let u=this.d*l+p;if((!o||o(this._convertFromCellCoord(p),this._convertFromCellCoord(l),this._convertFromCellCoord(p+1),this._convertFromCellCoord(l+1)))&&i.call(this,e,t,r,n,u,a,s,o))return}}_convertFromCellCoord(e){return(e-this.padding)/this.scale}_convertToCellCoord(e){return Math.max(0,Math.min(this.d-1,Math.floor(e*this.scale)+this.padding))}toArrayBuffer(){if(this.arrayBuffer)return this.arrayBuffer;let e=this.cells,t=3+this.cells.length+1+1,r=0;for(let e of this.cells)r+=e.length;let n=new Int32Array(t+r+this.keys.length+this.bboxes.length);n[0]=this.extent,n[1]=this.n,n[2]=this.padding;let i=t;for(let t=0;t<e.length;t++){let r=e[t];n[3+t]=i,n.set(r,i),i+=r.length}return n[3+e.length]=i,n.set(this.keys,i),i+=this.keys.length,n[3+e.length+1]=i,n.set(this.bboxes,i),i+=this.bboxes.length,n.buffer}static serialize(e,t){let r=e.toArrayBuffer();return t&&t.push(r),{buffer:r}}static deserialize(t){return new e(t.buffer)}};let aF={};function ak(e,t,r={}){if(aF[e])throw Error(`${e} is already registered.`);Object.defineProperty(t,"_classRegistryKey",{value:e,writeable:!1}),aF[e]={klass:t,omit:r.omit||[],shallow:r.shallow||[]}}for(let e in ak("Object",Object),ak("Set",Set),ak("TransferableGridIndex",aS),ak("Color",rP),ak("Error",Error),ak("AJAXError",tO),ak("ResolvedImage",rj),ak("StylePropertyFunction",iP),ak("StyleExpression",iS,{omit:["_evaluator"]}),ak("ZoomDependentExpression",iB),ak("ZoomConstantExpression",iC),ak("CompoundExpression",ie,{omit:["_evaluate"]}),n4)n4[e]._classRegistryKey||ak(`Expression_${e}`,n4[e]);function aT(e){return e&&"u">typeof ArrayBuffer&&(e instanceof ArrayBuffer||e.constructor?.name==="ArrayBuffer")}function aI(e){let t=e.constructor;return e.$name||t._classRegistryKey}function aC(e){return!function(e){if("object"!=typeof e||!e)return!1;let t=aI(e);return t&&"Object"!==t}(e)&&(null==e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||e instanceof Boolean||e instanceof Number||e instanceof String||e instanceof Date||e instanceof RegExp||e instanceof Blob||e instanceof Error||aT(e)||ty(e)||ArrayBuffer.isView(e)||e instanceof ImageData)}function aB(e,t){if(aC(e))return(aT(e)||ty(e))&&t&&t.push(e),ArrayBuffer.isView(e)&&t&&t.push(e.buffer),e instanceof ImageData&&t&&t.push(e.data.buffer),e;if(Array.isArray(e)){let r=[];for(let n of e)r.push(aB(n,t));return r}if("object"!=typeof e)throw Error(`can't serialize object of type ${typeof e}`);let r=aI(e);if(!r)throw Error(`can't serialize object of unregistered class ${e.constructor.name}`);if(!aF[r])throw Error(`${r} is not registered.`);let{klass:n}=aF[r],i=n.serialize?n.serialize(e,t):{};if(n.serialize){if(i===t?.[t.length-1])throw Error("statically serialized object won't survive transfer of $name property")}else{for(let n in e){if(!e.hasOwnProperty(n)||aF[r].omit.includes(n))continue;let a=e[n];void 0!==a&&(i[n]=aF[r].shallow.includes(n)?a:aB(a,t))}e instanceof Error&&(i.message=e.message)}if(i.$name)throw Error("$name property is reserved for worker serialization logic.");return"Object"!==r&&(i.$name=r),i}function aM(e){if(aC(e))return e;if(Array.isArray(e))return e.map(aM);if("object"!=typeof e)throw Error(`can't deserialize object of type ${typeof e}`);let t=aI(e)||"Object";if(!aF[t])throw Error(`can't deserialize unregistered class ${t}`);let{klass:r}=aF[t];if(!r)throw Error(`can't deserialize unregistered class ${t}`);if(r.deserialize)return r.deserialize(e);let n=Object.create(r.prototype);for(let r of Object.keys(e)){if("$name"===r)continue;let i=e[r];n[r]=aF[t].shallow.includes(r)?i:aM(i)}return n}var aP=class{constructor(){this.first=!0}update(e,t){let r=Math.floor(e);return this.first?(this.first=!1,this.lastIntegerZoom=r,this.lastIntegerZoomTime=0,this.lastZoom=e,this.lastFloorZoom=r,!0):(this.lastFloorZoom>r?(this.lastIntegerZoom=r+1,this.lastIntegerZoomTime=t):this.lastFloorZoom<r&&(this.lastIntegerZoom=r,this.lastIntegerZoomTime=t),e!==this.lastZoom&&(this.lastZoom=e,this.lastFloorZoom=r,!0))}},az=class{constructor(e,t){this.zoom=e,t?(this.now=t.now||0,this.fadeDuration=t.fadeDuration||0,this.zoomHistory=t.zoomHistory||new aP,this.transition=t.transition||{}):(this.now=0,this.fadeDuration=0,this.zoomHistory=new aP,this.transition={})}crossFadingFactor(){return 0===this.fadeDuration?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)}getCrossfadeParameters(){let e=this.zoom,t=e-Math.floor(e),r=this.crossFadingFactor();return e>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:t+(1-t)*r}:{fromScale:.5,toScale:1,t:1-(1-r)*t}}};let aL="-transition";var aV=class{constructor(e,t,r,n){this.property=e,this.value=t,this.expression=function(e,t,r,n){if(ig(e))return new iP(e,t,r);if(iT(e)){let i=iM(e,t,r,n);if("error"===i.result)throw Error(i.value.map(e=>`${e.key}: ${e.message}`).join(", "));return i.value}{let t=e;return"color"===r.type&&"string"==typeof e?t=rP.parse(e):"padding"===r.type&&("number"==typeof e||Array.isArray(e))?t=rR.parse(e):"numberArray"===r.type&&("number"==typeof e||Array.isArray(e))?t=rO.parse(e):"colorArray"===r.type&&("string"==typeof e||Array.isArray(e))?t=r$.parse(e):"variableAnchorOffsetCollection"===r.type&&Array.isArray(e)?t=rq.parse(e):"projectionDefinition"===r.type&&"string"==typeof e&&(t=rG.parse(e)),{globalStateRefs:new Set,_globalState:null,kind:"constant",evaluate:()=>t}}}(void 0===t?e.specification.default:t,r,e.specification,n)}isDataDriven(){return"source"===this.expression.kind||"composite"===this.expression.kind}getGlobalStateRefs(){return this.expression.globalStateRefs||new Set}
2possiblyEvaluate(e,t,r){return this.property.possiblyEvaluate(this,e,t,r)}},aR=class{constructor(e,t,r){this.property=e,this.value=new aV(e,void 0,t,r)}transitioned(e,t){return new a$(this.property,this.value,t,e6({},e.transition,this.transition),e.now)}untransitioned(){return new a$(this.property,this.value,null,{},0)}},aO=class{constructor(e,t,r){this._properties=e,this._values=Object.create(e.defaultTransitionablePropertyValues),this._globalState=r,this._rootKey=t}_propertyRootKey(e){return`${this._rootKey}.${String(e)}`}hasProperty(e){return e in this._properties.defaultTransitionablePropertyValues}getValue(e){return ta(this._values[e].value.value)}setValue(e,t){Object.hasOwn(this._values,e)||(this._values[e]=new aR(this._values[e].property,this._propertyRootKey(e),this._globalState)),this._values[e].value=new aV(this._values[e].property,null===t?void 0:ta(t),this._propertyRootKey(e),this._globalState)}getTransition(e){return ta(this._values[e].transition)}setTransition(e,t){Object.hasOwn(this._values,e)||(this._values[e]=new aR(this._values[e].property,this._propertyRootKey(e),this._globalState)),this._values[e].transition=ta(t)||void 0}serialize(){let e={};for(let t of Object.keys(this._values)){let r=this.getValue(t);void 0!==r&&(e[t]=r);let n=this.getTransition(t);void 0!==n&&(e[`${t}${aL}`]=n)}return e}transitioned(e,t){let r=new aN(this._properties);for(let n of Object.keys(this._values))r._values[n]=this._values[n].transitioned(e,t._values[n]);return r}untransitioned(){let e=new aN(this._properties);for(let t of Object.keys(this._values))e._values[t]=this._values[t].untransitioned();return e}},a$=class{constructor(e,t,r,n,i){this.property=e,this.value=t,this.begin=i+n.delay||0,this.end=this.begin+n.duration||0,e.specification.transition&&(n.delay||n.duration)&&(this.prior=r)}possiblyEvaluate(e,t,r){let n=e.now||0,i=this.value.possiblyEvaluate(e,t,r),a=this.prior;if(!a)return i;if(n>this.end||this.value.isDataDriven())return this.prior=null,i;if(n<this.begin)return a.possiblyEvaluate(e,t,r);{let s=(n-this.begin)/(this.end-this.begin);return this.property.interpolate(a.possiblyEvaluate(e,t,r),i,function(e){if(e<=0)return 0;if(e>=1)return 1;let t=e*e,r=t*e;return 4*(e<.5?r:3*(e-t)+r-.75)}(s))}}},aN=class{constructor(e){this._properties=e,this._values=Object.create(e.defaultTransitioningPropertyValues)}possiblyEvaluate(e,t,r){let n=new aj(this._properties);for(let i of Object.keys(this._values))n._values[i]=this._values[i].possiblyEvaluate(e,t,r);return n}hasTransition(){for(let e of Object.keys(this._values))if(this._values[e].prior)return!0;return!1}},aU=class{constructor(e,t,r){this._properties=e,this._values=Object.create(e.defaultPropertyValues),this._globalState=r,this._rootKey=t}_propertyRootKey(e){return`${this._rootKey}.${String(e)}`}hasValue(e){return void 0!==this._values[e].value}hasProperty(e){return e in this._properties.defaultPropertyValues}getValue(e){return ta(this._values[e].value)}setValue(e,t){this._values[e]=new aV(this._values[e].property,null===t?void 0:ta(t),this._propertyRootKey(e),this._globalState)}serialize(){let e={};for(let t of Object.keys(this._values)){let r=this.getValue(t);void 0!==r&&(e[t]=r)}return e}possiblyEvaluate(e,t,r){let n=new aj(this._properties);for(let i of Object.keys(this._values))n._values[i]=this._values[i].possiblyEvaluate(e,t,r);return n}},aq=class{constructor(e,t,r){this.property=e,this.value=t,this.parameters=r}isConstant(){return"constant"===this.value.kind}constantOr(e){return"constant"===this.value.kind?this.value.value:e}evaluate(e,t,r,n){return this.property.evaluate(this.value,this.parameters,e,t,r,n)}},aj=class{constructor(e){this._properties=e,this._values=Object.create(e.defaultPossiblyEvaluatedValues)}get(e){return this._values[e]}};function aG(e){if(Array.isArray(e))return e.length;let t=e?.values;return Array.isArray(t)?t.length:void 0}function aY(e,t){let r=aG(e),n=aG(t);return void 0!==r&&void 0!==n&&r!==n}var aX=class{constructor(e,t){this.specification=e,this.name=t}possiblyEvaluate(e,t){if(e.isDataDriven())throw Error("Value should not be data driven");return e.expression.evaluate(t)}interpolate(e,t,r){if(aY(e,t))return to(`Property "${this.name}" is trying to interpolate arrays of different lengths. Rendering may 'jump'.`),t;let n=r5[this.specification.type];return n?n(e,t,r):e}},aW=class{constructor(e,t,r){this.specification=e,this.name=t,this.overrides=r}possiblyEvaluate(e,t,r,n){return"constant"===e.expression.kind||"camera"===e.expression.kind?new aq(this,{kind:"constant",value:e.expression.evaluate(t,null,{},r,n)},t):new aq(this,e.expression,t)}interpolate(e,t,r){if("constant"!==e.value.kind||"constant"!==t.value.kind)return e;if(void 0===e.value.value||void 0===t.value.value)return new aq(this,{kind:"constant",value:void 0},e.parameters);if(aY(e.value.value,t.value.value))return to(`Property "${this.name}" is trying to interpolate arrays of different lengths. Rendering may 'jump'.`),t;let n=r5[this.specification.type];return n?new aq(this,{kind:"constant",value:n(e.value.value,t.value.value,r)},e.parameters):e}evaluate(e,t,r,n,i,a){return"constant"===e.kind?e.value:e.evaluate(t,r,n,i,a)}},aZ=class extends aW{possiblyEvaluate(e,t,r,n){if(void 0===e.value)return new aq(this,{kind:"constant",value:void 0},t);
2if("constant"===e.expression.kind){let i=e.expression.evaluate(t,null,{},r,n),a="resolvedImage"===e.property.specification.type&&"string"!=typeof i?i.name:i;return new aq(this,{kind:"constant",value:this._calculate(a,a,a,t)},t)}return"camera"===e.expression.kind?new aq(this,{kind:"constant",value:this._calculate(e.expression.evaluate({zoom:t.zoom-1}),e.expression.evaluate({zoom:t.zoom}),e.expression.evaluate({zoom:t.zoom+1}),t)},t):new aq(this,e.expression,t)}evaluate(e,t,r,n,i,a){if("source"===e.kind){let s=e.evaluate(t,r,n,i,a);return this._calculate(s,s,s,t)}return"composite"===e.kind?this._calculate(e.evaluate({zoom:Math.floor(t.zoom)-1},r,n),e.evaluate({zoom:Math.floor(t.zoom)},r,n),e.evaluate({zoom:Math.floor(t.zoom)+1},r,n),t):e.value}_calculate(e,t,r,n){return n.zoom>n.zoomHistory.lastIntegerZoom?{from:e,to:t}:{from:r,to:t}}interpolate(e){return e}},aH=class{constructor(e,t){this.specification=e,this.name=t}possiblyEvaluate(e,t,r,n){if(void 0!==e.value){if("constant"===e.expression.kind){let i=e.expression.evaluate(t,null,{},r,n);return this._calculate(i,i,i,t)}return this._calculate(e.expression.evaluate(new az(Math.floor(t.zoom-1),t)),e.expression.evaluate(new az(Math.floor(t.zoom),t)),e.expression.evaluate(new az(Math.floor(t.zoom+1),t)),t)}}_calculate(e,t,r,n){return n.zoom>n.zoomHistory.lastIntegerZoom?{from:e,to:t}:{from:r,to:t}}interpolate(e){return e}},aK=class{constructor(e,t){this.specification=e,this.name=t}possiblyEvaluate(e,t,r,n){return!!e.expression.evaluate(t,null,{},r,n)}interpolate(){return!1}},aJ=class{constructor(e){for(let t in this.properties=e,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[],e){let r=e[t];r.specification.overridable&&this.overridableProperties.push(t);let n=this.defaultPropertyValues[t]=new aV(r,void 0,r.name,void 0),i=this.defaultTransitionablePropertyValues[t]=new aR(r,r.name,void 0);this.defaultTransitioningPropertyValues[t]=i.untransitioned(),this.defaultPossiblyEvaluatedValues[t]=n.possiblyEvaluate({})}}};ak("DataDrivenProperty",aW),ak("DataConstantProperty",aX),ak("CrossFadedDataDrivenProperty",aZ),ak("CrossFadedProperty",aH),ak("ColorRampProperty",aK);let aQ=" is a PAINT property not a LAYOUT property. Use get/setPaintProperty instead?",a1=" is a LAYOUT property not a PAINT property. Use get/setLayoutProperty instead?";var a0=class extends tK{constructor(e,t,r){var n;if(super(),this.id=e.id,this.type=e.type,this._globalState=r,this._featureFilter={filter:()=>!0,needGeometry:!1,getGlobalStateRefs:()=>new Set},this._visibilityExpression=(n=this.visibility,new ab(n,`layers[${this.id}].layout.visibility`,r)),"custom"!==e.type&&(this.metadata=e.metadata,this.minzoom=e.minzoom,this.maxzoom=e.maxzoom,"background"!==e.type&&(this.source=e.source,this.sourceLayer=e["source-layer"],this.filter=e.filter,this._featureFilter=ij(e.filter,`layers[${this.id}].filter`,r)),t.layout&&(this._unevaluatedLayout=new aU(t.layout,`layers[${this.id}].layout`,r)),t.paint)){for(let n in this._transitionablePaint=new aO(t.paint,`layers[${this.id}].paint`,r),e.paint)this.setPaintProperty(n,e.paint[n],{validate:!1});for(let t in e.layout)this.setLayoutProperty(t,e.layout[t],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new aj(t.paint)}}setFilter(e){this.filter=e,this._featureFilter=ij(e,`layers[${this.id}].filter`,this._globalState)}getCrossfadeParameters(){return this._crossfadeParameters}getLayoutProperty(e){if("visibility"===e)return this.visibility;if(this._transitionablePaint?.hasProperty(e))throw Error(e+aQ);if(!this._unevaluatedLayout)throw Error(`Cannot get layout property "${e}" on layer type "${this.type}" which has no layout properties.`);return this._unevaluatedLayout.getValue(e)}getLayoutAffectingGlobalStateRefs(){let e=new Set;for(let t of this._visibilityExpression.getGlobalStateRefs())e.add(t);if(this._unevaluatedLayout)for(let t in this._unevaluatedLayout._values)for(let r of this._unevaluatedLayout._values[t].getGlobalStateRefs())e.add(r);for(let t of this._featureFilter.getGlobalStateRefs())e.add(t);return e}getPaintAffectingGlobalStateRefs(){let e=new globalThis.Map;if(this._transitionablePaint)for(let t in this._transitionablePaint._values){let r=this._transitionablePaint._values[t].value;for(let n of r.getGlobalStateRefs()){let i=e.get(n)??[];i.push({name:t,value:r.value}),e.set(n,i)}}return e}getVisibilityAffectingGlobalStateRefs(){return this._visibilityExpression.getGlobalStateRefs()}setLayoutProperty(e,t,r={}){if("visibility"===e){this.visibility=t,this._visibilityExpression.setValue(t),this.recalculateVisibility();return}if(this._transitionablePaint?.hasProperty(e))return void this.fire(new tH(Error(e+aQ)));
2null!=t&&this._validate(aw.layoutProperty,`layers.${this.id}.layout.${e}`,e,t,r)||this._unevaluatedLayout.setValue(e,t)}getPaintProperty(e){if(e.endsWith("-transition")){let t=e.slice(0,-11);if("visibility"===t||this._unevaluatedLayout?.hasProperty(t))throw Error(e+a1);return this._transitionablePaint.getTransition(t)}if("visibility"===e||this._unevaluatedLayout?.hasProperty(e))throw Error(e+a1);return this._transitionablePaint.getValue(e)}setPaintProperty(e,t,r={}){if("visibility"===e||this._unevaluatedLayout?.hasProperty(e))return this.fire(new tH(Error(e+a1))),!1;if(null!=t&&this._validate(aw.paintProperty,`layers.${this.id}.paint.${e}`,e,t,r))return!1;if(e.endsWith("-transition"))return this._transitionablePaint.setTransition(e.slice(0,-11),t||void 0),!1;{let r=this._transitionablePaint._values[e],n="cross-faded-data-driven"===r.property.specification["property-type"],i=r.value.isDataDriven(),a=r.value;this._transitionablePaint.setValue(e,t),this._handleSpecialPaintPropertyUpdate(e);let s=this._transitionablePaint._values[e].value;return s.isDataDriven()||i||n||this._handleOverridablePaintPropertyUpdate(e,a,s)}}_handleSpecialPaintPropertyUpdate(e){}_handleOverridablePaintPropertyUpdate(e,t,r){return!1}isHidden(e=this.minzoom,t=!1){return!!(this.minzoom&&e<(t?Math.floor(this.minzoom):this.minzoom))||!!this.maxzoom&&e>=this.maxzoom||"none"===this._evaluatedVisibility}updateTransitions(e){this._transitioningPaint=this._transitionablePaint.transitioned(e,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculateVisibility(){this._evaluatedVisibility=this._visibilityExpression.evaluate()}recalculate(e,t){e.getCrossfadeParameters&&(this._crossfadeParameters=e.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(e,void 0,t)),this.paint=this._transitioningPaint.possiblyEvaluate(e,void 0,t)}
2serialize(){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?.serialize(),paint:this._transitionablePaint?.serialize()};return this.visibility&&(e.layout||={},e.layout.visibility=this.visibility),ti(e,(e,t)=>void 0!==e&&!("layout"===t&&!Object.keys(e).length)&&!("paint"===t&&!Object.keys(e).length))}_validate(e,t,r,n,i={}){return aE(this,e,{key:t,layerType:this.type,objectKey:r,value:n},i)}is3D(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(let e in this.paint._values){let t=this.paint.get(e);if(t instanceof aq&&ih(t.property.specification)&&("source"===t.value.kind||"composite"===t.value.kind)&&t.value.isStateDependent)return!0}return!1}},a2={get paint(){return a||=new aJ({"raster-opacity":new aX(tQ.paint_raster["raster-opacity"],"raster-opacity"),"raster-hue-rotate":new aX(tQ.paint_raster["raster-hue-rotate"],"raster-hue-rotate"),"raster-brightness-min":new aX(tQ.paint_raster["raster-brightness-min"],"raster-brightness-min"),"raster-brightness-max":new aX(tQ.paint_raster["raster-brightness-max"],"raster-brightness-max"),"raster-saturation":new aX(tQ.paint_raster["raster-saturation"],"raster-saturation"),"raster-contrast":new aX(tQ.paint_raster["raster-contrast"],"raster-contrast"),resampling:new aX(tQ.paint_raster.resampling,"resampling"),"raster-resampling":new aX(tQ.paint_raster["raster-resampling"],"raster-resampling"),"raster-fade-duration":new aX(tQ.paint_raster["raster-fade-duration"],"raster-fade-duration")})}};let a3=e=>"raster"===e.type;var a5=class extends a0{constructor(e,t){super(e,a2,t)}};let a6={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array};var a4=class{constructor(e,t){this._structArray=e,this._pos1=t*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}},a8=class{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(e,t){return e._trim(),t&&(e.isTransferred=!0,t.push(e.arrayBuffer)),{length:e.length,arrayBuffer:e.arrayBuffer}}static deserialize(e){let t=Object.create(this.prototype);return t.arrayBuffer=e.arrayBuffer,t.length=e.length,t.capacity=e.arrayBuffer.byteLength/t.bytesPerElement,t._refreshViews(),t}_trim(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())}clear(){this.length=0}resize(e){this.reserve(e),this.length=e}reserve(e){if(e>this.capacity){this.capacity=Math.max(e,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);let t=this.uint8;this._refreshViews(),t&&this.uint8.set(t)}}_refreshViews(){throw Error("_refreshViews() must be implemented by each concrete StructArray layout")}freeBufferAfterUpload(){this.arrayBuffer=new ArrayBuffer(0),this._refreshViews()}};function a7(e,t=1){let r=0,n=0;return{members:e.map(e=>{let i=a6[e.type].BYTES_PER_ELEMENT,a=r=a9(r,Math.max(t,i)),s=e.components||1;return n=Math.max(n,i),r+=i*s,{name:e.name,type:e.type,components:s,offset:a}}),size:a9(r,Math.max(n,t)),alignment:t}}function a9(e,t){return Math.ceil(e/t)*t}var se=class extends a8{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t){let r=this.length;return this.resize(r+1),this.emplace(r,e,t)}emplace(e,t,r){let n=2*e;return this.int16[n+0]=t,this.int16[n+1]=r,e}};se.prototype.bytesPerElement=4,ak("StructArrayLayout2i4",se);var st=class extends a8{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,r){let n=this.length;return this.resize(n+1),this.emplace(n,e,t,r)}emplace(e,t,r,n){let i=3*e;return this.int16[i+0]=t,this.int16[i+1]=r,this.int16[i+2]=n,e}};st.prototype.bytesPerElement=6,ak("StructArrayLayout3i6",st);var sr=class extends a8{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,r,n){let i=this.length;return this.resize(i+1),this.emplace(i,e,t,r,n)}emplace(e,t,r,n,i){let a=4*e;return this.int16[a+0]=t,this.int16[a+1]=r,this.int16[a+2]=n,this.int16[a+3]=i,e}};sr.prototype.bytesPerElement=8,ak("StructArrayLayout4i8",sr);var sn=class extends a8{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,r,n,i,a){let s=this.length;return this.resize(s+1),this.emplace(s,e,t,r,n,i,a)}emplace(e,t,r,n,i,a,s){let o=6*e;return this.int16[o+0]=t,this.int16[o+1]=r,this.int16[o+2]=n,this.int16[o+3]=i,this.int16[o+4]=a,this.int16[o+5]=s,e}};sn.prototype.bytesPerElement=12,ak("StructArrayLayout2i4i12",sn);var si=class extends a8{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,r,n,i,a){let s=this.length;return this.resize(s+1),this.emplace(s,e,t,r,n,i,a)}emplace(e,t,r,n,i,a,s){let o=4*e,l=8*e;return this.int16[o+0]=t,this.int16[o+1]=r,this.uint8[l+4]=n,this.uint8[l+5]=i,this.uint8[l+6]=a,this.uint8[l+7]=s,e}};si.prototype.bytesPerElement=8,ak("StructArrayLayout2i4ub8",si);var sa=class extends a8{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t){let r=this.length;return this.resize(r+1),this.emplace(r,e,t)}emplace(e,t,r){let n=2*e;return this.float32[n+0]=t,this.float32[n+1]=r,e}};
2sa.prototype.bytesPerElement=8,ak("StructArrayLayout2f8",sa);var ss=class extends a8{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t,r,n,i,a,s,o,l,u){let h=this.length;return this.resize(h+1),this.emplace(h,e,t,r,n,i,a,s,o,l,u)}emplace(e,t,r,n,i,a,s,o,l,u,h){let c=10*e;return this.uint16[c+0]=t,this.uint16[c+1]=r,this.uint16[c+2]=n,this.uint16[c+3]=i,this.uint16[c+4]=a,this.uint16[c+5]=s,this.uint16[c+6]=o,this.uint16[c+7]=l,this.uint16[c+8]=u,this.uint16[c+9]=h,e}};ss.prototype.bytesPerElement=20,ak("StructArrayLayout10ui20",ss);var so=class extends a8{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t,r,n,i,a,s,o){let l=this.length;return this.resize(l+1),this.emplace(l,e,t,r,n,i,a,s,o)}emplace(e,t,r,n,i,a,s,o,l){let u=8*e;return this.uint16[u+0]=t,this.uint16[u+1]=r,this.uint16[u+2]=n,this.uint16[u+3]=i,this.uint16[u+4]=a,this.uint16[u+5]=s,this.uint16[u+6]=o,this.uint16[u+7]=l,e}};so.prototype.bytesPerElement=16,ak("StructArrayLayout8ui16",so);var sl=class extends a8{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,r,n,i,a,s,o,l,u,h,c,p){let f=this.length;return this.resize(f+1),this.emplace(f,e,t,r,n,i,a,s,o,l,u,h,c,p)}emplace(e,t,r,n,i,a,s,o,l,u,h,c,p,f){let d=14*e;return this.int16[d+0]=t,this.int16[d+1]=r,this.int16[d+2]=n,this.int16[d+3]=i,this.uint16[d+4]=a,this.uint16[d+5]=s,this.uint16[d+6]=o,this.uint16[d+7]=l,this.int16[d+8]=u,this.int16[d+9]=h,this.int16[d+10]=c,this.int16[d+11]=p,this.float32[7*e+6]=f,e}};sl.prototype.bytesPerElement=28,ak("StructArrayLayout4i4ui4i1f28",sl);var su=class extends a8{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,r){let n=this.length;return this.resize(n+1),this.emplace(n,e,t,r)}emplace(e,t,r,n){let i=3*e;return this.float32[i+0]=t,this.float32[i+1]=r,this.float32[i+2]=n,e}};su.prototype.bytesPerElement=12,ak("StructArrayLayout3f12",su);var sh=class extends a8{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(e){let t=this.length;return this.resize(t+1),this.emplace(t,e)}emplace(e,t){return this.uint32[+e+0]=t,e}};sh.prototype.bytesPerElement=4,ak("StructArrayLayout1ul4",sh);var sc=class extends a8{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t,r,n,i,a,s,o,l){let u=this.length;return this.resize(u+1),this.emplace(u,e,t,r,n,i,a,s,o,l)}emplace(e,t,r,n,i,a,s,o,l,u){let h=10*e;return this.int16[h+0]=t,this.int16[h+1]=r,this.int16[h+2]=n,this.int16[h+3]=i,this.int16[h+4]=a,this.int16[h+5]=s,this.uint32[5*e+3]=o,this.uint16[h+8]=l,this.uint16[h+9]=u,e}};sc.prototype.bytesPerElement=20,ak("StructArrayLayout6i1ul2ui20",sc);var sp=class extends a8{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,r,n,i,a){let s=this.length;return this.resize(s+1),this.emplace(s,e,t,r,n,i,a)}emplace(e,t,r,n,i,a,s){let o=6*e;return this.int16[o+0]=t,this.int16[o+1]=r,this.int16[o+2]=n,this.int16[o+3]=i,this.int16[o+4]=a,this.int16[o+5]=s,e}};sp.prototype.bytesPerElement=12,ak("StructArrayLayout2i2i2i12",sp);var sf=class extends a8{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,r,n,i){let a=this.length;return this.resize(a+1),this.emplace(a,e,t,r,n,i)}emplace(e,t,r,n,i,a){let s=4*e,o=8*e;return this.float32[s+0]=t,this.float32[s+1]=r,this.float32[s+2]=n,this.int16[o+6]=i,this.int16[o+7]=a,e}};sf.prototype.bytesPerElement=16,ak("StructArrayLayout2f1f2i16",sf);var sd=class extends a8{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,r,n,i,a){let s=this.length;return this.resize(s+1),this.emplace(s,e,t,r,n,i,a)}emplace(e,t,r,n,i,a,s){let o=16*e,l=4*e,u=8*e;return this.uint8[o+0]=t,this.uint8[o+1]=r,this.float32[l+1]=n,this.float32[l+2]=i,this.int16[u+6]=a,this.int16[u+7]=s,e}};sd.prototype.bytesPerElement=16,ak("StructArrayLayout2ub2f2i16",sd);var sy=class extends a8{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t,r){let n=this.length;return this.resize(n+1),this.emplace(n,e,t,r)}emplace(e,t,r,n){let i=3*e;return this.uint16[i+0]=t,this.uint16[i+1]=r,this.uint16[i+2]=n,e}};sy.prototype.bytesPerElement=6,ak("StructArrayLayout3ui6",sy);var sm=class extends a8{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,r,n,i,a,s,o,l,u,h,c,p,f,d,y,m,g){let x=this.length;return this.resize(x+1),this.emplace(x,e,t,r,n,i,a,s,o,l,u,h,c,p,f,d,y,m,g)}emplace(e,t,r,n,i,a,s,o,l,u,h,c,p,f,d,y,m,g,x){let v=26*e,b=13*e,w=52*e;return this.int16[v+0]=t,this.int16[v+1]=r,this.uint16[v+2]=n,this.uint16[v+3]=i,this.uint32[b+2]=a,this.uint32[b+3]=s,this.uint32[b+4]=o,this.uint16[v+10]=l,this.uint16[v+11]=u,this.uint16[v+12]=h,this.float32[b+7]=c,this.float32[b+8]=p,this.uint8[w+36]=f,this.uint8[w+37]=d,this.uint8[w+38]=y,this.uint32[b+10]=m,this.int16[v+22]=g,this.float32[b+12]=x,e}};sm.prototype.bytesPerElement=52,ak("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i1f52",sm);var sg=class extends a8{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,r,n,i,a,s,o,l,u,h,c,p,f,d,y,m,g,x,v,b,w,D,_,A,E,S,F,k){let T=this.length;return this.resize(T+1),this.emplace(T,e,t,r,n,i,a,s,o,l,u,h,c,p,f,d,y,m,g,x,v,b,w,D,_,A,E,S,F,k)}emplace(e,t,r,n,i,a,s,o,l,u,h,c,p,f,d,y,m,g,x,v,b,w,D,_,A,E,S,F,k,T){let I=34*e,C=17*e;return this.int16[I+0]=t,this.int16[I+1]=r,this.int16[I+2]=n,this.int16[I+3]=i,this.int16[I+4]=a,this.int16[I+5]=s,this.int16[I+6]=o,this.int16[I+7]=l,this.uint16[I+8]=u,this.uint16[I+9]=h,this.uint16[I+10]=c,this.uint16[I+11]=p,this.uint16[I+12]=f,this.uint16[I+13]=d,this.uint16[I+14]=y,this.uint16[I+15]=m,this.uint16[I+16]=g,this.uint16[I+17]=x,this.uint16[I+18]=v,this.uint16[I+19]=b,this.uint16[I+20]=w,this.uint16[I+21]=D,this.uint16[I+22]=_,this.uint32[C+12]=A,this.float32[C+13]=E,this.float32[C+14]=S,this.uint16[I+30]=F,this.uint16[I+31]=k,this.float32[C+16]=T,e}};sg.prototype.bytesPerElement=68,ak("StructArrayLayout8i15ui1ul2f2ui1f68",sg);var sx=class extends a8{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e){let t=this.length;return this.resize(t+1),this.emplace(t,e)}emplace(e,t){return this.float32[+e+0]=t,e}};sx.prototype.bytesPerElement=4,ak("StructArrayLayout1f4",sx);var sv=class extends a8{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,r){let n=this.length;return this.resize(n+1),this.emplace(n,e,t,r)}emplace(e,t,r,n){let i=3*e;return this.uint16[6*e+0]=t,this.float32[i+1]=r,this.float32[i+2]=n,e}};sv.prototype.bytesPerElement=12,ak("StructArrayLayout1ui2f12",sv);var sb=class extends a8{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t,r){let n=this.length;return this.resize(n+1),this.emplace(n,e,t,r)}emplace(e,t,r,n){let i=4*e;return this.uint32[2*e+0]=t,this.uint16[i+2]=r,this.uint16[i+3]=n,e}};sb.prototype.bytesPerElement=8,ak("StructArrayLayout1ul2ui8",sb);var sw=class extends a8{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t){let r=this.length;return this.resize(r+1),this.emplace(r,e,t)}emplace(e,t,r){let n=2*e;return this.uint16[n+0]=t,this.uint16[n+1]=r,e}};sw.prototype.bytesPerElement=4,ak("StructArrayLayout2ui4",sw);var sD=class extends a8{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e){let t=this.length;return this.resize(t+1),this.emplace(t,e)}emplace(e,t){return this.uint16[+e+0]=t,e}};sD.prototype.bytesPerElement=2,ak("StructArrayLayout1ui2",sD);var s_=class extends a8{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,r,n){let i=this.length;return this.resize(i+1),this.emplace(i,e,t,r,n)}emplace(e,t,r,n,i){let a=4*e;return this.float32[a+0]=t,this.float32[a+1]=r,this.float32[a+2]=n,this.float32[a+3]=i,e}};s_.prototype.bytesPerElement=16,ak("StructArrayLayout4f16",s_);var sA=class extends a4{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]}
2get anchorPoint(){return new C(this.anchorPointX,this.anchorPointY)}};sA.prototype.size=20;var sE=class extends sc{get(e){return new sA(this,e)}};ak("CollisionBoxArray",sE);var sS=class extends a4{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]}get heightOffset(){return this._structArray.float32[this._pos4+12]}};sS.prototype.size=52;var sF=class extends sm{get(e){return new sS(this,e)}};ak("PlacedSymbolArray",sF);var sk=class extends a4{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]}get heightOffset(){return this._structArray.float32[this._pos4+16]}};sk.prototype.size=68;var sT=class extends sg{get(e){return new sk(this,e)}};ak("SymbolInstanceArray",sT);var sI=class extends sx{getoffsetX(e){return this.float32[+e+0]}};ak("GlyphOffsetArray",sI);var sC=class extends st{getx(e){return this.int16[3*e+0]}gety(e){return this.int16[3*e+1]}gettileUnitDistanceFromAnchor(e){return this.int16[3*e+2]}};ak("SymbolLineVertexArray",sC);var sB=class extends a4{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]}};sB.prototype.size=12;var sM=class extends sv{get(e){return new sB(this,e)}};ak("TextAnchorOffsetArray",sM);var sP=class extends a4{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]}};sP.prototype.size=8;var sz=class extends sb{get(e){return new sP(this,e)}};ak("FeatureIndexArray",sz);var sL=class extends se{},sV=class extends st{},sR=class extends sr{},sO=class extends se{},s$=class extends se{},sN=class extends sn{},sU=class extends si{},sq=class extends sa{},sj=class extends ss{},sG=class extends so{},sY=class extends sl{},sX=class extends su{},sW=class extends sh{},sZ=class extends sp{},sH=class extends sf{},sK=class extends sd{},sJ=class extends sy{},sQ=class extends sy{},s1=class extends sw{},s0=class extends sD{};let s2=a7([{name:"a_pos",components:2,type:"Int16"}],4),s3=s2.members;s2.size,s2.alignment;var s5=class e{constructor(e=[]){this._forceNewSegmentOnNextPrepare=!1,this.segments=e}prepareSegment(t,r,n,i){let a=this.segments[this.segments.length-1];return t>e.MAX_VERTEX_ARRAY_LENGTH&&to(`Max vertices per segment is ${e.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${t}. Consider using the \`fillLargeMeshArrays\` function if you require meshes with more than ${e.MAX_VERTEX_ARRAY_LENGTH} vertices.`),this._forceNewSegmentOnNextPrepare||!a||a.vertexLength+t>e.MAX_VERTEX_ARRAY_LENGTH||a.sortKey!==i?this.createNewSegment(r,n,i):a}createNewSegment(e,t,r){let n={vertexOffset:e.length,primitiveOffset:t.length,vertexLength:0,primitiveLength:0,vaos:{}};return void 0!==r&&(n.sortKey=r),this._forceNewSegmentOnNextPrepare=!1,this.segments.push(n),n}getOrCreateLatestSegment(e,t,r){return this.prepareSegment(0,e,t,r)}forceNewSegmentOnNextPrepare(){this._forceNewSegmentOnNextPrepare=!0}get(){return this.segments}destroy(){for(let e of this.segments)for(let t in e.vaos)e.vaos[t].destroy()}static simpleSegment(t,r,n,i){return new e([{vertexOffset:t,primitiveOffset:r,vertexLength:n,primitiveLength:i,vaos:{},sortKey:0}])}};function s6(e,t){return 256*(e=e3(Math.floor(e),0,255))+(t=e3(Math.floor(t),0,255))}s5.MAX_VERTEX_ARRAY_LENGTH=65535,ak("SegmentVector",s5);let s4=a7([{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"}]),s8=a7([{name:"a_dasharray_from",components:4,type:"Uint16"},{name:"a_dasharray_to",components:4,type:"Uint16"}]);var s7=I((e,t)=>{void 0!==t&&(t.exports=function(e,t){for(var r,n,i=3&e.length,a=e.length-i,s=t,o=0;o<a;)n=255&e.charCodeAt(o)|(255&e.charCodeAt(++o))<<8|(255&e.charCodeAt(++o))<<16|(255&e.charCodeAt(++o))<<24,++o,s^=n=(65535&(n=(n=(65535&n)*0xcc9e2d51+(((n>>>16)*0xcc9e2d51&65535)<<16)|0)<<15|n>>>17))*0x1b873593+(((n>>>16)*0x1b873593&65535)<<16)|0,s=(65535&(r=(65535&(s=s<<13|s>>>19))*5+(((s>>>16)*5&65535)<<16)|0))+27492+(((r>>>16)+58964&65535)<<16);switch(n=0,i){case 3:n^=(255&e.charCodeAt(o+2))<<16;case 2:n^=(255&e.charCodeAt(o+1))<<8;case 1:n^=255&e.charCodeAt(o),s^=n=(65535&(n=(n=(65535&n)*0xcc9e2d51+(((n>>>16)*0xcc9e2d51&65535)<<16)|0)<<15|n>>>17))*0x1b873593+(((n>>>16)*0x1b873593&65535)<<16)|0}return s^=e.length,s^=s>>>16,s=(65535&s)*0x85ebca6b+(((s>>>16)*0x85ebca6b&65535)<<16)|0,s^=s>>>13,s=(65535&s)*0xc2b2ae35+(((s>>>16)*0xc2b2ae35&65535)<<16)|0,(s^=s>>>16)>>>0})}),s9=I((e,t)=>{t.exports=function(e,t){for(var r,n=e.length,i=t^n,a=0;n>=4;)r=(65535&(r=255&e.charCodeAt(a)|(255&e.charCodeAt(++a))<<8|(255&e.charCodeAt(++a))<<16|(255&e.charCodeAt(++a))<<24))*0x5bd1e995+(((r>>>16)*0x5bd1e995&65535)<<16),r^=r>>
2>24,i=(65535&i)*0x5bd1e995+(((i>>>16)*0x5bd1e995&65535)<<16)^(r=(65535&r)*0x5bd1e995+(((r>>>16)*0x5bd1e995&65535)<<16)),n-=4,++a;switch(n){case 3:i^=(255&e.charCodeAt(a+2))<<16;case 2:i^=(255&e.charCodeAt(a+1))<<8;case 1:i^=255&e.charCodeAt(a),i=(65535&i)*0x5bd1e995+(((i>>>16)*0x5bd1e995&65535)<<16)}return i^=i>>>13,i=(65535&i)*0x5bd1e995+(((i>>>16)*0x5bd1e995&65535)<<16),(i^=i>>>15)>>>0}}),oe=((e,t,r)=>(r=null==e?{}:A(k(e)),((e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(var i,a=F(t),s=0,o=a.length;s<o;s++)i=a[s],T.call(e,i)||i===r||E(e,i,{get:(e=>t[e]).bind(null,i),enumerable:!(n=S(t,i))||n.enumerable});return e})(!t&&e&&e.__esModule&&T.call(e,"default")?r:E(r,"default",{value:e,enumerable:!0}),e)))(I((e,t)=>{var r=s7(),n=s9();t.exports=r,t.exports.murmur3=r,t.exports.murmur2=n})(),1),ot=class e{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(e,t,r,n){this.ids.push(or(e)),this.positions.push(t,r,n)}getPositions(e){if(!this.indexed)throw Error("Trying to get index, but feature positions are not indexed");let t=or(e),r=0,n=this.ids.length-1;for(;r<n;){let e=r+n>>1;this.ids[e]>=t?n=e:r=e+1}let i=[];for(;this.ids[r]===t;){let e=this.positions[3*r],t=this.positions[3*r+1],n=this.positions[3*r+2];i.push({index:e,start:t,end:n}),r++}return i}static serialize(e,t){let r=new Float64Array(e.ids),n=new Uint32Array(e.positions);return function e(t,r,n,i){for(;n<i;){let a=t[n+i>>1],s=n-1,o=i+1;for(;;){do s++;while(t[s]<a);do o--;while(t[o]>a);if(s>=o)break;on(t,s,o),on(r,3*s,3*o),on(r,3*s+1,3*o+1),on(r,3*s+2,3*o+2)}o-n<i-o?(e(t,r,n,o),n=o+1):(e(t,r,o+1,i),i=o)}}(r,n,0,r.length-1),t&&t.push(r.buffer,n.buffer),{ids:r,positions:n}}static deserialize(t){let r=new e;return r.ids=t.ids,r.positions=t.positions,r.indexed=!0,r}};function or(e){let t=+e;return!isNaN(t)&&t<=0x20000000000000-1?t:(0,oe.default)(String(e))}function on(e,t,r){let n=e[t];e[t]=e[r],e[r]=n}ak("FeaturePositionMap",ot);var oi=class{constructor(e,t){this.gl=e.gl,this.location=t}},oa=class extends oi{constructor(e,t){super(e,t),this.current=0}set(e){this.current!==e&&(this.current=e,this.gl.uniform1i(this.location,e))}},os=class extends oi{constructor(e,t){super(e,t),this.current=0}set(e){this.current!==e&&(this.current=e,this.gl.uniform1f(this.location,e))}},oo=class extends oi{constructor(e,t){super(e,t),this.current=[0,0]}set(e){(e[0]!==this.current[0]||e[1]!==this.current[1])&&(this.current=e,this.gl.uniform2f(this.location,e[0],e[1]))}},ol=class extends oi{constructor(e,t){super(e,t),this.current=[0,0,0]}set(e){(e[0]!==this.current[0]||e[1]!==this.current[1]||e[2]!==this.current[2])&&(this.current=e,this.gl.uniform3f(this.location,e[0],e[1],e[2]))}},ou=class extends oi{constructor(e,t){super(e,t),this.current=[0,0,0,0]}set(e){(e[0]!==this.current[0]||e[1]!==this.current[1]||e[2]!==this.current[2]||e[3]!==this.current[3])&&(this.current=e,this.gl.uniform4f(this.location,e[0],e[1],e[2],e[3]))}},oh=class extends oi{constructor(e,t){super(e,t),this.current=rP.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))}},oc=class extends oi{constructor(e,t){super(e,t),this.current=[]}set(e){if(e!=this.current){this.current=e;let t=new Float32Array(4*e.length);for(let r=0;r<e.length;r++)t[4*r]=e[r].r,t[4*r+1]=e[r].g,t[4*r+2]=e[r].b,t[4*r+3]=e[r].a;this.gl.uniform4fv(this.location,t)}}},op=class extends oi{constructor(e,t){super(e,t),this.current=[]}set(e){if(e!=this.current){this.current=e;let t=new Float32Array(e);this.gl.uniform1fv(this.location,t)}}};let of=new Float32Array(16);var od=class extends oi{constructor(e,t){super(e,t),this.current=of}set(e){if(e[12]!==this.current[12]||e[0]!==this.current[0]){this.current=e,this.gl.uniformMatrix4fv(this.location,!1,e);return}for(let t=1;t<16;t++)if(e[t]!==this.current[t]){this.current=e,this.gl.uniformMatrix4fv(this.location,!1,e);break}}};function oy(e){return[s6(255*e.r,255*e.g),s6(255*e.b,255*e.a)]}var om=class{constructor(e,t,r){this.value=e,this.uniformNames=t.map(e=>`u_${e}`),this.type=r}setUniform(e,t,r){e.set(r.constantOr(this.value))}getBinding(e,t,r){return"color"===this.type?new oh(e,t):new os(e,t)}},og=class{constructor(e,t){this.uniformNames=t.map(e=>`u_${e}`),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1}setConstantPatternPositions(e,t){this.pixelRatioFrom=t.pixelRatio,this.pixelRatioTo=e.pixelRatio,this.patternFrom=t.tlbr,this.patternTo=e.tlbr}setConstantDashPositions(e,t){this.dashTo=[0,e.y,e.height,e.width],this.dashFrom=[0,t.y,t.height,t.width]}setUniform(e,t,r,n){let i=null;"u_pattern_to"===n?i=this.patternTo:"u_pattern_from"===n?i=this.patternFrom:"u_dasharray_to"===n?i=this.dashTo:"u_dasharray_from"===n?i=this.dashFrom:"u_pixel_ratio_to"===n?i=this.pixelRatioTo:"u_pixel_ratio_from"===n&&(i=this.pixelRatioFrom),null!==i&&e.set(i)}getBinding(e,t,r){return r.startsWith("u_pattern")||r.startsWith("u_dasharray_")?new ou(e,t):new os(e,t)}},ox=class{constructor(e,t,r,n){this.expression=e,this.type=r,this.maxValue=0,this.paintVertexAttributes=t.map(e=>({name:`a_${e}`,type:"Float32",components:"color"===r?2:1,offset:0})),this.paintVertexArray=new n}populatePaintArray(e,t,r){let n=this.paintVertexArray.length,i=this.expression.evaluate(new az(0,r),t,{},r.canonical,[],r.formattedSection);this.paintVertexArray.resize(e),this._setPaintValue(n,e,i)}updatePaintArray(e,t,r,n,i){let a=this.expression.evaluate(new az(0,i),r,n);this._setPaintValue(e,t,a)}_setPaintValue(e,t,r){if("color"===this.type){let n=oy(r);for(let r=e;r<t;r++)this.paintVertexArray.emplace(r,n[0],n[1])}else{for(let n=e;n<t;n++)this.paintVertexArray.emplace(n,r);this.maxValue=Math.max(this.maxValue,Math.abs(r))}}upload(e){this.paintVertexArray?.arrayBuffer.byteLength&&(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()}},ov=class{constructor(e,t,r,n,i,a){this.expression=e,this.uniformNames=t.map(e=>`u_${e}_t`),this.type=r,this.useIntegerZoom=n,this.zoom=i,this.maxValue=0,this.paintVertexAttributes=t.map(e=>({name:`a_${e}`,type:"Float32",components:"color"===r?4:2,offset:0})),this.paintVertexArray=new a}populatePaintArray(e,t,r){let n=this.expression.evaluate(new az(this.zoom,r),t,{},r.canonical,[],r.formattedSection),i=this.expression.evaluate(new az(this.zoom+1,r),t,{},r.canonical,[],r.formattedSection),a=this.paintVertexArray.length;this.paintVertexArray.resize(e),this._setPaintValue(a,e,n,i)}updatePaintArray(e,t,r,n,i){let a=this.expression.evaluate(new az(this.zoom,i),r,n),s=this.expression.evaluate(new az(this.zoom+1,i),r,n);this._setPaintValue(e,t,a,s)}_setPaintValue(e,t,r,n){if("color"===this.type){let i=oy(r),a=oy(n);for(let r=e;r<t;r++)this.paintVertexArray.emplace(r,i[0],i[1],a[0],a[1])}else{for(let i=e;i<t;i++)this.paintVertexArray.emplace(i,r,n);this.maxValue=Math.max(this.maxValue,Math.abs(r),Math.abs(n))}}upload(e){this.paintVertexArray?.arrayBuffer.byteLength&&(this.paintVertexBuffer?.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=e.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}setUniform(e,t){let r=this.useIntegerZoom?Math.floor(t.zoom):t.zoom,n=e3(this.expression.interpolationFactor(r,this.zoom,this.zoom+1),0,1);e.set(n)}getBinding(e,t,r){return new os(e,t)}},ob=class{constructor(e,t,r,n,i,a){this.expression=e,this.type=t,this.useIntegerZoom=r,this.zoom=n,this.layerId=a,this.zoomInPaintVertexArray=new i,this.zoomOutPaintVertexArray=new i}populatePaintArray(e,t,r){let n=this.zoomInPaintVertexArray.length;this.zoomInPaintVertexArray.resize(e),this.zoomOutPaintVertexArray.resize(e),this._setPaintValues(n,e,this.getPositionIds(t),r)}updatePaintArray(e,t,r,n,i){this._setPaintValues(e,t,this.getPositionIds(r),i)}_setPaintValues(e,t,r,n){let i=this.getPositions(n);if(!i||!r)return;let a=i[r.min],s=i[r.mid],o=i[r.max];if(a&&s&&o)for(let r=e;r<t;r++)this.emplace(this.zoomInPaintVertexArray,r,a,s),this.emplace(this.zoomOutPaintVertexArray,r,o,s)}upload(e){if(this.zoomInPaintVertexArray?.arrayBuffer.byteLength&&this.zoomOutPaintVertexArray?.arrayBuffer.byteLength){let t=this.getVertexAttributes();this.zoomInPaintVertexBuffer=e.createVertexBuffer(this.zoomInPaintVertexArray,t,this.expression.isStateDependent),this.zoomOutPaintVertexBuffer=e.createVertexBuffer(this.zoomOutPaintVertexArray,t,this.expression.isStateDependent)}}destroy(){this.zoomOutPaintVertexBuffer&&this.zoomOutPaintVertexBuffer.destroy(),this.zoomInPaintVertexBuffer&&this.zoomInPaintVertexBuffer.destroy()}},ow=class extends ob{getPositions(e){return e.imagePositions}getPositionIds(e){return e.patterns?.[this.layerId]}getVertexAttributes(){return s4.members}emplace(e,t,r,n){e.emplace(t,r.tlbr[0],r.tlbr[1],r.tlbr[2],r.tlbr[3],n.tlbr[0],n.tlbr[1],n.tlbr[2],n.tlbr[3],r.pixelRatio,n.pixelRatio)}},oD=class extends ob{getPositions(e){return e.dashPositions}getPositionIds(e){return e.dashes?.[this.layerId]}getVertexAttributes(){return s8.members}emplace(e,t,r,n){e.emplace(t,0,r.y,r.height,r.width,0,n.y,n.height,n.width)}},o_=class{constructor(e,t,r){this.binders={},this._buffers=[];let n=[];for(let i in e.paint._values){if(!r(i))continue;let a=e.paint.get(i);if(!(a instanceof aq)||!ih(a.property.specification))continue;let s=function(e,t){return({"text-opacity":["opacity"],"icon-opacity":["opacity"],"text-color":["fill_color"],"icon-color":["fill_color"],"text-halo-color":["halo_color"],"icon-halo-color":["halo_color"],"text-halo-blur":["halo_blur"],"icon-halo-blur":["halo_blur"],"text-halo-width":["halo_width"],"icon-halo-width":["halo_width"],"line-gap-width":["ga
2pwidth"],"line-dasharray":["dasharray_to","dasharray_from"],"line-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-extrusion-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"]})[e]||[e.replace(`${t}-`,"").replace(/-/g,"_")]}(i,e.type),o=a.value,l=a.property.specification.type,u=a.property.useIntegerZoom,h=a.property.specification["property-type"],c="cross-faded"===h||"cross-faded-data-driven"===h;if("constant"===o.kind)this.binders[i]=c?new og(o.value,s):new om(o.value,s,l),n.push(`/u_${i}`);else if("source"===o.kind||c){let r=oE(i,l,"source");this.binders[i]=c?"line-dasharray"===i?new oD(o,l,u,t,r,e.id):new ow(o,l,u,t,r,e.id):new ox(o,s,l,r),n.push(`/a_${i}`)}else{let e=oE(i,l,"composite");this.binders[i]=new ov(o,s,l,u,t,e),n.push(`/z_${i}`)}}this.cacheKey=n.sort().join("")}getMaxValue(e){let t=this.binders[e];return t instanceof ox||t instanceof ov?t.maxValue:0}populatePaintArrays(e,t,r){for(let n in this.binders){let i=this.binders[n];(i instanceof ox||i instanceof ov||i instanceof ob)&&i.populatePaintArray(e,t,r)}}setConstantPatternPositions(e,t){for(let r in this.binders){let n=this.binders[r];n instanceof og&&n.setConstantPatternPositions(e,t)}}setConstantDashPositions(e,t){for(let r in this.binders){let n=this.binders[r];n instanceof og&&n.setConstantDashPositions(e,t)}}updatePaintArrays(e,t,r,n,i){let a=!1;for(let s of e)for(let e of t.getPositions(s.id)){let t=r.feature(e.index);for(let r in this.binders){let o=this.binders[r];(o instanceof ox||o instanceof ov||o instanceof ob)&&!0===o.expression.isStateDependent&&(o.expression=n.paint.get(r).value,o.updatePaintArray(e.start,e.end,t,s.state,i),a=!0)}}return a}defines(){let e=[];for(let t in this.binders){let r=this.binders[t];(r instanceof om||r instanceof og)&&e.push(...r.uniformNames.map(e=>`#define HAS_UNIFORM_${e}`))}return e}getBinderAttributes(){let e=[];for(let t in this.binders){let r=this.binders[t];if(r instanceof ox||r instanceof ov)for(let t of r.paintVertexAttributes)e.push(t.name);else if(r instanceof ob)for(let t of r.getVertexAttributes())e.push(t.name)}return e}getBinderUniforms(){let e=[];for(let t in this.binders){let r=this.binders[t];if(r instanceof om||r instanceof og||r instanceof ov)for(let t of r.uniformNames)e.push(t)}return e}getPaintVertexBuffers(){return this._buffers}getUniforms(e,t){let r=[];for(let n in this.binders){let i=this.binders[n];if(i instanceof om||i instanceof og||i instanceof ov){for(let a of i.uniformNames)if(t[a]){let s=i.getBinding(e,t[a],a);
2r.push({name:a,property:n,binding:s})}}}return r}setUniforms(e,t,r,n){for(let{name:e,property:i,binding:a}of t)this.binders[i].setUniform(a,n,r.get(i),e)}updatePaintBuffers(e){for(let t in this._buffers=[],this.binders){let r=this.binders[t];if(e&&r instanceof ob){let t=2===e.fromScale?r.zoomInPaintVertexBuffer:r.zoomOutPaintVertexBuffer;t&&this._buffers.push(t)}else(r instanceof ox||r instanceof ov)&&r.paintVertexBuffer&&this._buffers.push(r.paintVertexBuffer)}}upload(e){for(let t in this.binders){let r=this.binders[t];(r instanceof ox||r instanceof ov||r instanceof ob)&&r.upload(e)}this.updatePaintBuffers()}destroy(){for(let e in this.binders){let t=this.binders[e];(t instanceof ox||t instanceof ov||t instanceof ob)&&t.destroy()}}},oA=class{constructor(e,t,r=()=>!0){for(let n of(this.programConfigurations={},e))this.programConfigurations[n.id]=new o_(n,t,r);this.needsUpload=!1,this._featureMap=new ot,this._bufferOffset=0}populatePaintArrays(e,t,r,n){for(let r in this.programConfigurations)this.programConfigurations[r].populatePaintArrays(e,t,n);void 0!==t.id&&this._featureMap.add(t.id,r,this._bufferOffset,e),this._bufferOffset=e,this.needsUpload=!0}updatePaintArrays(e,t,r,n){for(let i of r)this.needsUpload=this.programConfigurations[i.id].updatePaintArrays(e,this._featureMap,t,i,n)||this.needsUpload}get(e){return this.programConfigurations[e]}upload(e){if(this.needsUpload){for(let t in this.programConfigurations)this.programConfigurations[t].upload(e);this.needsUpload=!1}}destroy(){for(let e in this.programConfigurations)this.programConfigurations[e].destroy()}};function oE(e,t,r){return({"line-pattern":{source:sj,composite:sj},"fill-pattern":{source:sj,composite:sj},"fill-extrusion-pattern":{source:sj,composite:sj},"line-dasharray":{source:sG,composite:sG}})[e]?.[r]||({color:{source:sa,composite:s_},number:{source:sx,composite:sa}})[t][r]}ak("ConstantBinder",om),ak("CrossFadedConstantBinder",og),ak("SourceExpressionBinder",ox),ak("CrossFadedPatternBinder",ow),ak("CrossFadedDasharrayBinder",oD),ak("CompositeExpressionBinder",ov),ak("ProgramConfiguration",o_,{omit:["_buffers"]}),ak("ProgramConfigurationSet",oA);let oS=-16383-1;function oF(e){let t=ez/e.extent,r=e.loadGeometry();for(let e of r)for(let r of e){let e=Math.round(r.x*t),n=Math.round(r.y*t);r.x=e3(e,oS,16383),r.y=e3(n,oS,16383),(e<r.x||e>r.x+1||n<r.y||n>r.y+1)&&to("Geometry exceeds allowed extent, reduce your vector tile buffer size")}return r}function ok(e,t){return{type:e.type,id:e.id,properties:e.properties,geometry:t?oF(e):[]}}var oT=class{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(e=>e.id),this.index=e.index,this.hasDependencies=!1,this.layoutVertexArray=new sO,this.indexArray=new sQ,this.segments=new s5,this.programConfigurations=new oA(e.layers,e.zoom),this.stateDependentLayerIds=this.layers.filter(e=>e.isStateDependent()).map(e=>e.id)}populate(e,t,r){let n=this.layers[0],i=[],a=null,s=!1,o="heatmap"===n.type;"circle"===n.type&&(s=!(a=n.layout.get("circle-sort-key")).isConstant(),o||="map"===n.paint.get("circle-pitch-alignment"));let l=o?t.subdivisionGranularity.circle:1,u=new az(this.zoom),h=this.layers[0]._featureFilter.needGeometry;for(let{feature:t,id:n,index:o,sourceLayerIndex:l}of e){let e=ok(t,h);if(!this.layers[0]._featureFilter.filter(u,e,r))continue;let c=s?a.evaluate(e,{},r):void 0,p={id:n,properties:t.properties,type:t.type,sourceLayerIndex:l,index:o,geometry:h?e.geometry:oF(t),patterns:{},sortKey:c};i.push(p)}for(let n of(s&&i.sort((e,t)=>
2e.sortKey-t.sortKey),i)){let{geometry:i,index:a,sourceLayerIndex:s}=n,o=e[a].feature;this.addFeature(n,i,a,r,l),t.featureIndex.insert(o,i,a,s,this.index)}}update(e,t,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,t,this.stateDependentLayers,{imagePositions:r})}addFeatures(e){}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,s3),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(e,t,r,n,i=1){let a;switch(i){case 1:a=[0,7];break;case 3:a=[0,2,5,7];break;case 5:a=[0,1,3,4,6,7];break;case 7:a=[0,1,2,3,4,5,6,7];break;default:throw Error(`Invalid circle bucket granularity: ${i}; valid values are 1, 3, 5, 7.`)}let s=a.length;for(let r of t)for(let t of r){let r=t.x,n=t.y;if(r<0||r>=8192||n<0||n>=8192)continue;let i=this.segments.prepareSegment(s*s,this.layoutVertexArray,this.indexArray,e.sortKey),h=i.vertexLength;for(let e=0;e<s;e++)for(let t=0;t<s;t++){var o,l,u;o=this.layoutVertexArray,l=a[t],u=a[e],o.emplaceBack(-32768+8*r+l,-32768+8*n+u)}for(let e=0;e<s-1;e++)for(let t=0;t<s-1;t++){let r=h+e*s+t,n=h+(e+1)*s+t;this.indexArray.emplaceBack(r,n+1,r+1),this.indexArray.emplaceBack(r,n,n+1)}i.vertexLength+=s*s,i.primitiveLength+=(s-1)*(s-1)*2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,r,{imagePositions:{},canonical:n})}};function oI(e,t){for(let r of e)if(oV(t,r))return!0;for(let r of t)if(oV(e,r))return!0;return oM(e,t)}function oC(e,t,r){return!!oV(e,t)||oP(t,e,r)}function oB(e,t){if(1===e.length)return oL(t,e[0]);for(let r of t)for(let t of r)if(oV(e,t))return!0;for(let r of e)if(oL(t,r))return!0;for(let r of t)if(oM(e,r))return!0;return!1}function oM(e,t){if(0===e.length||0===t.length)return!1;for(let s=0;s<e.length-1;s++){let o=e[s],l=e[s+1];for(let e=0;e<t.length-1;e++){var r,n,i,a;if(r=o,n=l,i=t[e],tl(r,i,a=t[e+1])!==tl(n,i,a)&&tl(r,n,i)!==tl(r,n,a))return!0}}return!1}function oP(e,t,r){let n=r*r;if(1===t.length)return e.distSqr(t[0])<n;for(let r=1;r<t.length;r++)if(oz(e,t[r-1],t[r])<n)return!0;return!1}function oz(e,t,r){let n=t.distSqr(r);if(0===n)return e.distSqr(t);let i=((e.x-t.x)*(r.x-t.x)+(e.y-t.y)*(r.y-t.y))/n;return i<0?e.distSqr(t):i>1?e.distSqr(r):e.distSqr(r.sub(t)._mult(i)._add(t))}function oL(e,t){let r=!1,n,i;for(let a of e)for(let e=0,s=a.length-1;e<a.length;s=e++)n=a[e],i=a[s],n.y>t.y!=i.y>t.y&&t.x<(i.x-n.x)*(t.y-n.y)/(i.y-n.y)+n.x&&(r=!r);return r}function oV(e,t){let r=!1;for(let n=0,i=e.length-1;n<e.length;i=n++){let a=e[n],s=e[i];a.y>t.y!=s.y>t.y&&t.x<(s.x-a.x)*(t.y-a.y)/(s.y-a.y)+a.x&&(r=!r)}return r}function oR(e,t,r){let n=t.paint.get(e).value;return"constant"===n.kind?n.value:r.programConfigurations.get(t.id).getMaxValue(e)}function oO(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1])}function o$(e,t,r,n,i){if(!t[0]&&!t[1])return e;let a=C.convert(t)._mult(i);"viewport"===r&&a._rotate(-n);let s=[];for(let t of e)s.push(t.sub(a));return s}function oN({queryGeometry:e,size:t},r){return oC(e,r,t)}function oU({queryGeometry:e,size:t,transform:r,unwrappedTileID:n,getElevation:i},a){return oC(e,a,t*(r.projectTileCoordinates(a.x,a.y,n,i?.(a.x,a.y)).signedDistanceFromCamera/r.cameraToCenterDistance))}function oq({queryGeometry:e,size:t,transform:r,unwrappedTileID:n,getElevation:i},a){let s=r.projectTileCoordinates(a.x,a.y,n,i?.(a.x,a.y)).signedDistanceFromCamera,o=t*(r.cameraToCenterDistance/s);return oC(e,oY(a,r,n,i),o)}function oj({queryGeometry:e,size:t,transform:r,unwrappedTileID:n,getElevation:i},a){return oC(e,oY(a,r,n,i),t)}function oG({queryGeometry:e,size:t,transform:r,unwrappedTileID:n,getElevation:i,pitchAlignment:a="map",pitchScale:s="map"},o){let l="map"===a?"map"===s?oN:oU:"map"===s?oq:oj,u={queryGeometry:e,size:t,transform:r,unwrappedTileID:n,getElevation:i};for(let e of o)for(let t of e)if(l(u,t))return!0;return!1}function oY(e,t,r,n){let i=t.projectTileCoordinates(e.x,e.y,r,n?.(e.x,e.y)).point;return new C((.5*i.x+.5)*t.width,(-(.5*i.y)+.5)*t.height)}ak("CircleBucket",oT,{omit:["layers"]});var oX={get paint(){return o||=new aJ({"circle-radius":new aW(tQ.paint_circle["circle-radius"],"cir
2cle-radius"),"circle-color":new aW(tQ.paint_circle["circle-color"],"circle-color"),"circle-blur":new aW(tQ.paint_circle["circle-blur"],"circle-blur"),"circle-opacity":new aW(tQ.paint_circle["circle-opacity"],"circle-opacity"),"circle-translate":new aX(tQ.paint_circle["circle-translate"],"circle-translate"),"circle-translate-anchor":new aX(tQ.paint_circle["circle-translate-anchor"],"circle-translate-anchor"),"circle-pitch-scale":new aX(tQ.paint_circle["circle-pitch-scale"],"circle-pitch-scale"),"circle-pitch-alignment":new aX(tQ.paint_circle["circle-pitch-alignment"],"circle-pitch-alignment"),"circle-stroke-width":new aW(tQ.paint_circle["circle-stroke-width"],"circle-stroke-width"),"circle-stroke-color":new aW(tQ.paint_circle["circle-stroke-color"],"circle-stroke-color"),"circle-stroke-opacity":new aW(tQ.paint_circle["circle-stroke-opacity"],"circle-stroke-opacity")})},get layout(){return s||=new aJ({"circle-sort-key":new aW(tQ.layout_circle["circle-sort-key"],"circle-sort-key")})}};let oW=e=>"circle"===e.type;var oZ=class extends a0{constructor(e,t){super(e,oX,t)}createBucket(e){return new oT(e)}queryRadius(e){return oR("circle-radius",this,e)+oR("circle-stroke-width",this,e)+oO(this.paint.get("circle-translate"))}queryIntersectsFeature({queryGeometry:e,feature:t,featureState:r,geometry:n,transform:i,pixelsToTileUnits:a,unwrappedTileID:s,getElevation:o}){let l=o$(e,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),-i.bearingInRadians,a),u=this.paint.get("circle-radius").evaluate(t,r)+this.paint.get("circle-stroke-width").evaluate(t,r),h=this.paint.get("circle-pitch-scale"),c=this.paint.get("circle-pitch-alignment"),p,f;return"map"===c?(p=l,f=u*a):(p=l.map(e=>oY(e,i,s,o)),f=u),oG({queryGeometry:p,size:f,transform:i,unwrappedTileID:s,getElevation:o,pitchAlignment:c,pitchScale:h},n)}},oH=class extends oT{};ak("HeatmapBucket",oH,{omit:["layers"]});var oK={get paint(){return l||=new aJ({"heatmap-radius":new aW(tQ.paint_heatmap["heatmap-radius"],"heatmap-radius"),"heatmap-weight":new aW(tQ.paint_heatmap["heatmap-weight"],"heatmap-weight"),"heatmap-intensity":new aX(tQ.paint_heatmap["heatmap-intensity"],"heatmap-intensity"),"heatmap-color":new aK(tQ.paint_heatmap["heatmap-color"],"heatmap-color"),"heatmap-opacity":new aX(tQ.paint_heatmap["heatmap-opacity"],"heatmap-opacity")})}};function oJ(e,{width:t,height:r},n,i){if(i){if(i instanceof Uint8ClampedArray)i=new Uint8Array(i.buffer);else if(i.length!==t*r*n)throw RangeError(`mismatched image size. expected: ${i.length} but got: ${t*r*n}`)}else i=new Uint8Array(t*r*n);return e.width=t,e.height=r,e.data=i,e}function oQ(e,{width:t,height:r},n){if(t===e.width&&r===e.height)return;let i=oJ({},{width:t,height:r},n);o1(e,i,{x:0,y:0},{x:0,y:0},{width:Math.min(e.width,t),height:Math.min(e.height,r)},n),e.width=t,e.height=r,e.data=i.data}function o1(e,t,r,n,i,a){if(0===i.width||0===i.height)return t;if(i.width>e.width||i.height>e.height||r.x>e.width-i.width||r.y>e.height-i.height)throw RangeError("out of range source coordinates for image copy");if(i.width>t.width||i.height>t.height||n.x>t.width-i.width||n.y>t.height-i.height)throw RangeError("out of range destination coordinates for image copy");let s=e.data,o=t.data;if(s===o)throw Error("srcData equals dstData, so image is already copied");for(let l=0;l<i.height;l++){let u=((r.y+l)*e.width+r.x)*a,h=((n.y+l)*t.width+n.x)*a;for(let e=0;e<i.width*a;e++)o[h+e]=s[u+e]}return t}var o0=class e{constructor(e,t){oJ(this,e,1,t)}resize(e){oQ(this,e,1)}clone(){return new e({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(e,t,r,n,i){o1(e,t,r,n,i,1)}},o2=class e{constructor(e,t){oJ(this,e,4,t)}resize(e){oQ(this,e,4)}replace(e,t){t?this.data.set(e):this.data=e instanceof Uint8ClampedArray?new Uint8Array(e.buffer):e}clone(){return new e({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(e,t,r,n,i){o1(e,t,r,n,i,4)}setPixel(e,t,r){let n=(e*this.width+t)*4;this.data[n+0]=Math.round(255*r.r/r.a),this.data[n+1]=Math.round(255*r.g/r.a),this.data[n+2]=Math.round(255*r.b/r.a),this.data[n+3]=Math.round(255*r.a)}};function o3(e){let t=new Uint8Array(e.length);for(let r=0;r<e.length;r+=4){let n=e[r+3];t[r+0]=Math.round(e[r+0]*n/255),t[r+1]=Math.round(e[r+1]*n/255),t[r+2]=Math.round(e[r+2]*n/255),t[r+3]=n}return t}function o5(e){let t={},r=e.resolution||256,n=e.clips?e.clips.length:1,i=e.image||new o2({width:r,height:n});if(Math.log(r)/Math.LN2%1!=0)throw Error(`width is not a power of 2 - ${r}`);let a=(n,a,s)=>{t[e.evaluationKey]=s;let o=e.expression.evaluate(t);i.setPixel(n/4/r,a/4,o)};if(e.clips)for(let t=0,i=0;t<n;++t,i+=4*r)for(let n=0,s=0;n<r;n++,s+=4){let o=n/(r-1),{start:l,end:u}=e.clips[t];a(i,s,l*(1-o)+u*o)}else for(let e=0,t=0;e<r;e++,t+=4)a(0,t,e/(r-1));return i}ak("AlphaImage",o0),ak("RGBAImage",o2);let o6="big-fb",o4=e=>"heatmap"===e.type;var o8=class extends a0{createBucket(e){return new oH(e)}constructor(e,t){super(e,oK,t),this.heatmapFbos=new Map,this._updateColorRamp()}_handleSpecialPaintPropertyUpdate(e){"heatmap-color"===e&&this._updateColorRamp()}_updateColorRamp(){let e=this._transitionablePaint._values["heatmap-color"].value.expression;this.colorRamp=o5({expression:e,evaluationKey:"heatmapDensity",image:this.colorRamp}),this.colorRampTexture=null}resize(){this.heatmapFbos.has("big-fb")&&this.heatmapFbos.delete(o6)}queryRadius(e){return oR("heatmap-radius",this,e)}queryIntersectsFeature({queryGeometry:e,feature:t,featureState:r,geometry:n,transform:i,pixelsToTileUnits:a,unwrappedTileID:s,getElevation:o}){return oG({queryGeometry:e,size:this.paint.get("heatmap-radius").evaluate(t,r)*a,transform:i,unwrappedTileID:s,getElevation:o},n)}hasOffscreenPass(){return 0!==this.paint.get("heatmap-opacity")&&!this.isHidden()}},o7={get paint(){return u||=new aJ({"hillshade-illumination-direction":new aX(tQ.paint_hillshade["hillshade-illumination-direction"],"hillshade-illumination-direction"),"hillshade-illumination-altitude":new aX(tQ.paint_hillshade["hillshade-illumination-altitude"],"hillshade-illumination-altitude"),"hillshade-illumination-anchor":new aX(tQ.paint_hillshade["hillshade-illumination-anchor"],"hillshade-illumination-anchor"),"hillshade-exaggeration":new aX(tQ.paint_hillshade["hillshade-exaggeration"],"hillshade-exaggeration"),"hillshade-shadow-color":new aX(tQ.paint_hillshade["hillshade-shadow-color"],"hillshade-shadow-color"),"hillshade-highlight-color":new aX(tQ.paint_hillshade["hillshade-highlight-color"],"hillshade-highlight-color"),"hillshade-accent-color":new aX(tQ.paint_hillshade["hillshade-accent-color"],"hillshade-accent-color"),"hillshade-method":new aX(tQ.paint_hillshade["hillshade-method"],"hillshade-method"),resampling:new aX(tQ.paint_hillshade.resampling,"resampling")})}};let o9=e=>"hillshade"===e.type;var le=class extends a0{constructor(e,t){super(e,o7,t),this.recalculate({zoom:0,zoomHistory:{}},void 0)}getIlluminationProperties(){let e=this.paint.get("hillshade-illumination-direction").values,t=this.paint.get("hillshade-illumination-altitude").values,r=this.paint.get("hillshade-highlight-color").values,n=this.paint.get("hillshade-shadow-color").values,i=Math.max(e.length,t.length,r.length,n.length);e=e.concat(Array(i-e.length).fill(e.at(-1))),t=t.concat(Array(i-t.length).fill(t.at(-1))),r=r.concat(Array(i-r.length).fill(r.at(-1))),n=n.concat(Array(i-n.length).fill(n.at(-1)));let a=t.map(tb);return{directionRadians:e.map(tb),altitudeRadians:a,shadowColor:n,highlightColor:r}}hasOffscreenPass(){return 0!==this.paint.get("hillshade-exaggeration")&&!this.isHidden()}},lt={get paint(){return h||=new aJ({"color-relief-opacity":new aX(tQ["paint_color-relief"]["color-relief-opacity"],"color-relief-opacity"),"color-relief-color":new aK(tQ["paint_color-relief"]["color-relief-color"],"color-relief-color"),resampling:new aX(tQ["paint_color-relief"].resampling,"resampling")})}};function lr(e){return"data"in e}var ln=class{constructor(e,t,r,n){this.context=e,this.format=r,this.texture=e.gl.createTexture(),this._ownedHandle=this.texture,this.update(t,n)}update(e,t,r){let{width:n,height:i}=e,a=(this.size?.[0]!==n||this.size[1]!==i)&&!r,{context:s}=this,{gl:o}=s;this.useMipmap=!!t?.useMipmap,a&&this.size&&this.format===o.RGBA&&(o.deleteTexture(this.texture),this.texture=o.createTexture(),this._ownedHandle=this.texture,this.magFilter=void 0,this.minFilter=void 0,this.wrap=void 0),o.bindTexture(o.TEXTURE_2D,this.texture),s.pixelStoreUnpackFlipY.set(!1),s.pixelStoreUnpack.set(1);let l=this.format===o.RGBA&&t?.premultiply!==!1;if(a)if(this.size=[n,i],this.format===o.RGBA&&n>0&&i>0){let t=this.useMipmap?Math.floor(Math.log2(Math.max(n,i)))+1:1;if(o.texStorage2D(o.TEXTURE_2D,t,o.RGBA8,n,i),lr(e)){s.pixelStoreUnpackPremultiplyAlpha.set(!1);let{data:t}=e;l&&t&&(t=o3(t)),t&&o.texSubImage2D(o.TEXTURE_2D,0,0,0,n,i,o.RGBA,o.UNSIGNED_BYTE,t)}else s.pixelStoreUnpackPremultiplyAlpha.set(l),o.texSubImage2D(o.TEXTURE_2D,0,0,0,o.RGBA,o.UNSIGNED_BYTE,e)}else lr(e)?(s.pixelStoreUnpackPremultiplyAlpha.set(!1),this._uploadRawData(e,l,n,i,o)):(s.pixelStoreUnpackPremultiplyAlpha.set(l),this._uploadDomImage(e,o));else{let{x:t,y:a}=r||{x:0,y:0};lr(e)?(s.pixelStoreUnpackPremultiplyAlpha.set(!1),this._updateRawData(e,l,t,a,n,i,o)):(s.pixelStoreUnpackPremultiplyAlpha.set(l),this._updateDomImage(e,t,a,o))}this.useMipmap&&!(lr(e)&&null===e.data)&&o.generateMipmap(o.TEXTURE_2D),s.pixelStoreUnpackFlipY.setDefault(),s.pixelStoreUnpack.setDefault(),s.pixelStoreUnpackPremultiplyAlpha.setDefault()}_uploadDomImage(e,t){t.texImage2D(t.TEXTURE_2D,0,this.format,this.format,t.UNSIGNED_BYTE,e)}_uploadRawData(e,t,r,n,i){let{data:a}=e;t&&a&&(a=o3(a)),i.texImage2D(i.TEXTURE_2D,0,this.format,r,n,0,this.format,i.UNSIGNED_BYTE,a)}_updateDomImage(e,t,r,n){n.texSubImage2D(n.TEXTURE_2D,0,t,r,n.RGBA,n.UNSIGNED_BYTE,e)}_updateRawData(e,t,r,n,i,a,s){let{data:o}=e;t&&o&&(o=o3(o)),s.texSubImage2D(s.TEXTURE_2D,0,r,n,i,a,s.RGBA,s.UNSIGNED_BYTE,o)}
2bind(e,t,r){let{context:n}=this,{gl:i}=n;this.texture!==this._ownedHandle&&(this.texture=this._ownedHandle),i.bindTexture(i.TEXTURE_2D,this.texture),r!==i.LINEAR_MIPMAP_NEAREST&&r!==i.LINEAR_MIPMAP_LINEAR||this.useMipmap||(r=i.LINEAR);let a=r||e;e!==this.magFilter&&(i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MAG_FILTER,e),this.magFilter=e),a!==this.minFilter&&(i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,a),this.minFilter=a),t!==this.wrap&&(i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_S,t),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_T,t),this.wrap=t)}generateMipmap(){if(!this.useMipmap)return;let{gl:e}=this.context;e.bindTexture(e.TEXTURE_2D,this.texture),e.generateMipmap(e.TEXTURE_2D)}destroy(){let{gl:e}=this.context;e.deleteTexture(this.texture),this.texture=null,this._ownedHandle=null}};function li(e,t){let r=t[0],n=t[1],i=t[2],a=t[3],s=Math.min(r,n,i),o=Math.round((e+a)/s);return{r:Math.floor(o*s/r)%256,g:Math.floor(o*s/n)%256,b:Math.floor(o*s/i)%256}}ak("DEMData",class e{static{this.byteViewCache=new WeakMap}constructor(t,r,n,i=1,a=1,s=1,o=0){if(this.uid=t,r.height!==r.width)throw RangeError("DEM tiles must be square");if(n&&!["mapbox","terrarium","custom"].includes(n))return void to(`"${n}" is not a valid encoding type. Valid types include "mapbox", "terrarium" and "custom".`);this.stride=r.height;let l=this.dim=r.height-4;switch(this.data=new Uint32Array(r.data.buffer),e.byteViewCache.set(this,new Uint8Array(this.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=a,this.blueFactor=s,this.baseShift=o;break;default:this.redFactor=6553.6,this.greenFactor=25.6,this.blueFactor=.1,this.baseShift=1e4}for(let e=-2;e<l+2;e++){let t=this._idx(0,Math.max(0,Math.min(l-1,e)));(e<0||e>=l)&&this.data.copyWithin(this._idx(0,e),t,t+l),this.data.fill(this.data[t],this._idx(-2,e),this._idx(0,e)),this.data.fill(this.data[t+l-1],this._idx(l,e),this._idx(l+1,e)+1)}let u=this._getByteView();this.min=0x20000000000000-1,this.max=-(0x20000000000000-1);for(let e=0;e<l;e++)for(let t=0;t<l;t++){let r=4*this._idx(e,t),n=this._unpackAtIndex(u,r);n>this.max&&(this.max=n),n<this.min&&(this.min=n)}}get(e,t){let r=this._getByteView(),n=4*this._idx(e,t);return this._unpackAtIndex(r,n)}sampleBilinear(e,t){let r=Math.floor(e),n=Math.floor(t);if(r<-1||r>=this.dim||n<-1||n>=this.dim)throw RangeError(`Out of range source coordinates for DEM data. x: ${e}, y: ${t}, dim: ${this.dim}`);let i=this._getByteView(),a=((n+2)*this.stride+r+2)*4,s=4*this.stride,o=e-r,l=t-n;return this._unpackAtIndex(i,a)*(1-o)*(1-l)+this._unpackAtIndex(i,a+4)*o*(1-l)+this._unpackAtIndex(i,a+s)*(1-o)*l+this._unpackAtIndex(i,a+s+4)*o*l}getUnpackVector(){return[this.redFactor,this.greenFactor,this.blueFactor,this.baseShift]}_idx(e,t){if(e<-2||e>=this.dim+2||t<-2||t>=this.dim+2)throw RangeError(`Out of range source coordinates for DEM data. x: ${e}, y: ${t}, dim: ${this.dim}`);return(t+2)*this.stride+(e+2)}unpack(e,t,r){return e*this.redFactor+t*this.greenFactor+r*this.blueFactor-this.baseShift}pack(e){return li(e,this.getUnpackVector())}getPixels(){return new o2({width:this.stride,height:this.stride},this._getByteView())}backfillBorder(e,t,r){if(this.dim!==e.dim)throw Error("dem dimension mismatch");let n=t*this.dim,i=t*this.dim+this.dim,a=r*this.dim,s=r*this.dim+this.dim;switch(t){case -1:n=i-2;break;case 1:i=n+2}switch(r){case -1:a=s-2;break;case 1:s=a+2}let o=-t*this.dim,l=-r*this.dim;for(let t=a;t<s;t++)for(let r=n;r<i;r++)this.data[this._idx(r,t)]=e.data[this._idx(r+o,t+l)]}_getByteView(){let t=e.byteViewCache.get(this);return t?.buffer!==this.data.buffer&&(t=new Uint8Array(this.data.buffer),e.byteViewCache.set(this,t)),t}_unpackAtIndex(e,t){return this.unpack(e[t],e[t+1],e[t+2])}});let la=e=>"color-relief"===e.type;var ls=class extends a0{constructor(e,t){super(e,lt,t)}_createColorRamp(e){let t={elevationStops:[],colorStops:[]},r=this._transitionablePaint._values["color-relief-color"].value.expression;if(r instanceof iC&&r._styleExpression.expression instanceof r2){this.colorRampExpression=r;let e=r._styleExpression.expression;for(let r of(t.elevationStops=e.labels,t.colorStops=[],t.elevationStops))t.colorStops.push(e.evaluate({globals:{elevation:r}}))}if(t.elevationStops.length<1&&(t.elevationStops=[0],t.colorStops=[rP.transparent]),t.elevationStops.length<2&&(t.elevationStops.push(t.elevationStops[0]+1),t.colorStops.push(t.colorStops[0])),t.elevationStops.length<=e)return t;let n={elevationStops:[],colorStops:[]},i=(t.elevationStops.length-1)/(e-1);for(let e=0;e<t.elevationStops.length-.5;e+=i)n.elevationStops.push(t.elevationStops[Math.round(e)]),n.colorStops.push(t.colorStops[Math.round(e)]);return to(`Too many colors in specification of ${this.id}
2 color-relief layer, may not render properly. Max possible colors: ${e}, provided: ${t.elevationStops.length}`),n}_colorRampChanged(){return this.colorRampExpression!=this._transitionablePaint._values["color-relief-color"].value.expression}getColorRampTextures(e,t,r){if(this.colorRampTextures&&!this._colorRampChanged())return this.colorRampTextures;let n=this._createColorRamp(t),i=new o2({width:n.colorStops.length,height:1}),a=new o2({width:n.colorStops.length,height:1});for(let e=0;e<n.elevationStops.length;e++){let t=li(n.elevationStops[e],r);a.setPixel(0,e,new rP(t.r/255,t.g/255,t.b/255,1)),i.setPixel(0,e,n.colorStops[e])}return this.colorRampTextures={elevationTexture:new ln(e,a,e.gl.RGBA),colorTexture:new ln(e,i,e.gl.RGBA)},this.colorRampTextures}hasOffscreenPass(){return!this.isHidden()&&!!this.colorRampTextures}};let lo=a7([{name:"a_pos",components:2,type:"Int16"}],4),ll=lo.members;function lu(e,t,r){let n=r.patternDependencies,i=!1;for(let r of t){let t=r.paint.get(`${e}-pattern`);t.isConstant()||(i=!0);let a=t.constantOr(null);a&&(i=!0,n[a.to]=!0,n[a.from]=!0)}return i}function lh(e,t,r,n,i){let{zoom:a}=n,s=i.patternDependencies;for(let n of t){let t=n.paint.get(`${e}-pattern`).value;if("constant"!==t.kind){let e=t.evaluate({zoom:a-1},r,{},i.availableImages),o=t.evaluate({zoom:a},r,{},i.availableImages),l=t.evaluate({zoom:a+1},r,{},i.availableImages);e=e?.name?e.name:e,o=o?.name?o.name:o,l=l?.name?l.name:l,s[e]=!0,s[o]=!0,s[l]=!0,r.patterns[n.id]={min:e,mid:o,max:l}}}return r}lo.size,lo.alignment;let lc=new Set,lp=!1;function lf(e,t,r,n,i){let a=null;if(i===function(e,t,r,n){let i=0;for(let a=t,s=r-n;a<r;a+=n)i+=(e[s]-e[a])*(e[a+1]+e[s+1]),s=a;return i}(e,t,r,n)>0)for(let i=t;i<r;i+=n)a=lR(i/n|0,e[i],e[i+1],a);else for(let i=r-n;i>=t;i-=n)a=lR(i/n|0,e[i],e[i+1],a);return a&&lM(a,a.next)&&(lO(a),a=a.next),a}function ld(e,t=e){let r=t===e,n=e,i;do i=!1,n!==n.next&&(0===lc.size||!lc.has(n))&&(lM(n,n.next)||0===lB(n.prev,n,n.next))?((r||n===t)&&(t=n.prev),lp=!0,lO(n),n=n.prev,i=!0):(r||n!==t)&&(n=n.next,i=!r);while(i||n!==t);return t}let ly=!1;function lm(e,t){return e.x-t.x||e.y-t.y||(e.next.y-e.y)/(e.next.x-e.x)-(t.next.y-t.y)/(t.next.x-t.x)}let lg=new Float64Array,lx=0,lv=[],lb=[];function lw(e,t){let r=e;do{let e=lx++;lv[e]=r;let n=1/0,i=1/0,a=-1/0,s=-1/0,o=0;do{let t=r.next;r.z=e,r.x<n&&(n=r.x),r.x>a&&(a=r.x),r.y<i&&(i=r.y),r.y>s&&(s=r.y),t.x<n&&(n=t.x),t.x>a&&(a=t.x),t.y<i&&(i=t.y),t.y>s&&(s=t.y),r=t}while(++o<16&&r!==t);lb[e]=r;let l=4*e;lg[l]=n,lg[l+1]=i,lg[l+2]=a,lg[l+3]=s}while(r!==t)}function lD(e){let t=lb[e];for(;t.prev.next!==t;)t=t.next;return lb[e]=t,t}function l_(e){let t=lv[e];for(;t.prev.next!==t;)t=t.next;return lv[e]=t,t}let lA=[],lE=[],lS=new Uint32Array,lF=new Uint32Array,lk=new Uint32Array(256);function lT(e,t,r,n,i,a){lk.fill(0);for(let t=0;t<e;t++)lk[r[t]>>>a&255]++;let s=0;for(let e=0;e<256;e++){let t=lk[e];lk[e]=s,s+=t}for(let s=0;s<e;s++){let e=r[s],o=lk[e>>>a&255]++;n[o]=t[s],i[o]=e}}function lI(e,t,r,n,i){return(e=((e=((e=((e=((e=(e-r)*i|0)|e<<8)&0xff00ff)|e<<4)&0xf0f0f0f)|e<<2)&0x33333333)|e<<1)&0x55555555)|(t=((t=((t=((t=((t=(t-n)*i|0)|t<<8)&0xff00ff)|t<<4)&0xf0f0f0f)|t<<2)&0x33333333)|t<<1)&0x55555555)<<1}function lC(e,t,r,n,i,a,s,o){return(i-s)*(t-o)>=(e-s)*(a-o)&&(e-s)*(n-o)>=(r-s)*(t-o)&&(r-s)*(a-o)>=(i-s)*(n-o)}function lB(e,t,r){return(t.y-e.y)*(r.x-t.x)-(t.x-e.x)*(r.y-t.y)}function lM(e,t){return e.x===t.x&&e.y===t.y}function lP(e,t,r,n,i=!0){let a=lB(e,t,r),s=lB(e,t,n),o=lB(r,n,e),l=lB(r,n,t);return(a>0&&s<0||a<0&&s>0)&&(o>0&&l<0||o<0&&l>0)||!!i&&!!(0===a&&lz(e,r,t)||0===s&&lz(e,n,t)||0===o&&lz(r,e,n)||0===l&&lz(r,t,n))}function lz(e,t,r){return t.x<=Math.max(e.x,r.x)&&t.x>=Math.min(e.x,r.x)&&t.y<=Math.max(e.y,r.y)&&t.y>=Math.min(e.y,r.y)}function lL(e,t){return 0>lB(e.prev,e,e.next)?lB(e,t,e.next)>=0&&lB(e,e.prev,t)>=0:0>lB(e,t,e.prev)||0>lB(e,e.next,t)}function lV(e,t){let r=l$(e.i,e.x,e.y),n=l$(t.i,t.x,t.y),i=e.next,a=t.prev;return e.next=t,t.prev=e,r.next=i,i.prev=r,n.next=r,r.prev=n,a.next=n,n.prev=a,n}function lR(e,t,r,n){let i=l$(e,t,r);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function lO(e){var t,r;let n;e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ),ly&&(t=e.prev,r=e.next,n=4*t.z,r.x<lg[n]&&(lg[n]=r.x),r.y<lg[n+1]&&(lg[n+1]=r.y),r.x>lg[n+2]&&(lg[n+2]=r.x),r.y>lg[n+3]&&(lg[n+3]=r.y))}function l$(e,t,r){return{i:e,x:t,y:r,prev:null,next:null,z:0,prevZ:null,nextZ:null}}var lN=class{constructor(e,t){if(t>e)throw Error("Min granularity must not be greater than base granularity.");this._baseZoomGranularity=e,this._minGranularity=t}getGranularityForZoomLevel(e){return Math.max(Math.floor(this._baseZoomGranularity/(1<<e)),this._minGranularity,1)}},lU=class e{constructor(e){this.fill=e.fill,this.line=e.line,this.tile=e.tile,this.stencil=e.stencil,this.circle=e.circle}static{this.noSubdivision=new e({fill:new lN(0,0),line:new lN(0,0),tile:new lN(0,0),stencil:new lN(0,0),circle:1})}};ak("SubdivisionGranularityExpression",lN),ak("SubdivisionGranularitySetting",lU);let lq=-32768,lj=32767;var lG=class{constructor(e,t){this._vertexBuffer=[],this._vertexDictionary=new Map,this._used=!1,this._granularity=e,this._granularityCellSize=ez/e,this._canonical=t}_getKey(e,t){return e+=32768,0|(t+=32768)|e<<16}_vertexToIndex(e,t){if(e<-32768||t<-32768||e>32767||t>32767)throw Error("Vertex coordinates are out of signed 16 bit integer range.");let r=0|Math.round(e),n=0|Math.round(t),i=this._getKey(r,n);if(this._vertexDictionary.has(i))return this._vertexDictionary.get(i);let a=this._vertexBuffer.length/2;return this._vertexDictionary.set(i,a),this._vertexBuffer.push(r,n),a}_subdivideTrianglesScanline(e){if(this._granularity<2)return function(e,t){let r=[];for(let n=0;n<t.length;n+=3){let i=t[n],a=t[n+1],s=t[n+2],o=e[2*i],l=e[2*i+1],u=e[2*a],h=e[2*a+1],c=e[2*s],p=e[2*s+1],f=h-l;(u-o)*(p-l)-f*(c-o)>0?(r.push(i),r.push(s),r.push(a)):(r.push(i),r.push(a),r.push(s))}return r}(this._vertexBuffer,e);let t=[],r=e.length;for(let n=0;n<r;n+=3){let r=[e[n+0],e[n+1],e[n+2]],i=[this._vertexBuffer[2*e[n+0]+0],this._vertexBuffer[2*e[n+0]+1],this._vertexBuffer[2*e[n+1]+0],this._vertexBuffer[2*e[n+1]+1],this._vertexBuffer[2*e[n+2]+0],this._vertexBuffer[2*e[n+2]+1]],a=1/0,s=1/0,o=-1/0,l=-1/0;for(let e=0;e<3;e++){let t=i[2*e],r=i[2*e+1];a=Math.min(a,t),o=Math.max(o,t),s=Math.min(s,r),l=Math.max(l,r)}if(a===o||s===l)continue;let u=Math.floor(a/this._granularityCellSize),h=Math.ceil(o/this._granularityCellSize),c=Math.floor(s/this._granularityCellSize),p=Math.ceil(l/this._granularityCellSize);if(u===h&&c===p){t.push(...r);continue}for(let e=c;e<p;e++){let n=this._scanlineGenerateVertexRingForCellRow(e,i,r);!function(e,t,r){if(0===t.length)throw Error("Subdivision vertex ring is empty.");let n=0,i=e[2*t[0]];for(let r=1;r<t.length;r++){let a=e[2*t[r]];a<i&&(i=a,n=r)}let a=t.length,s=n,o=(s+1)%a;for(;;){let n=s-1>=0?s-1:a-1,i=(o+1)%a,l=e[2*t[n]],u=e[2*t[n]+1],h=e[2*t[i]],c=e[2*t[i]+1],p=e[2*t[s]],f=e[2*t[s]+1],d=e[2*t[o]],y=e[2*t[o]+1],m=!1;if(l<h)m=!0;else if(l>h)m=!1;else{let e=y-f,t=-(d-p),r=f<y?1:-1;((l-p)*e+(u-f)*t)*r>((h-p)*e+(c-f)*t)*r&&(m=!0)}if(m){let e=t[n],i=t[s],l=t[o];e!==i&&e!==l&&i!==l&&r.push(l,i,e),--s<0&&(s=a-1)}else{let e=t[i],n=t[s],l=t[o];e!==n&&e!==l&&n!==l&&r.push(l,n,e),++o>=a&&(o=0)}if(n===i)break}}(this._vertexBuffer,n,t)}}return t}_scanlineGenerateVertexRingForCellRow(e,t,r){let n=e*this._granularityCellSize,i=n+this._granularityCellSize,a=[];for(let e=0;e<3;e++){let s=t[2*e],o=t[2*e+1],l=t[(e+1)*2%6],u=t[((e+1)*2+1)%6],h=t[(e+2)*2%6],c=t[((e+2)*2+1)%6],p=l-s,f=u-o,d=0===p,y=0===f,m=(n-o)/f,g=(i-o)/f,x=Math.min(m,g),v=Math.max(m,g);if(!y&&(x>=1||v<=0)||y&&(o<n||o>i)){u>=n&&u<=i&&a.push(r[(e+1)%3]);continue}if(!y&&x>0){let e=s+p*x,t=o+f*x;a.push(this._vertexToIndex(e,t))}let b=s+p*Math.max(x,0),w=s+p*Math.min(v,1);if(d||this._generateIntraEdgeVertices(a,s,o,l,u,b,w),!y&&v<1){let e=s+p*v,t=o+f*v;a.push(this._vertexToIndex(e,t))}(y||u>=n&&u<=i)&&a.push(r[(e+1)%3]),!y&&(u<=n||u>=i)&&this._generateInterEdgeVertices(a,s,o,l,u,h,c,w,n,i)}return a}_generateIntraEdgeVertices(e,t,r,n,i,a,s){let o=n-t,l=i-r,u=0===l,h=u?Math.min(t,n):Math.min(a,s),c=u?Math.max(t,n):Math.max(a,s),p=Math.floor(h/this._granularityCellSize)+1,f=Math.ceil(c/this._granularityCellSize)-1;
2if(u?t<n:a<s)for(let n=p;n<=f;n++){let i=n*this._granularityCellSize,a=r+l*(i-t)/o;e.push(this._vertexToIndex(i,a))}else for(let n=f;n>=p;n--){let i=n*this._granularityCellSize,a=r+l*(i-t)/o;e.push(this._vertexToIndex(i,a))}}_generateInterEdgeVertices(e,t,r,n,i,a,s,o,l,u){let h=s-i,c=(l-i)/h,p=(u-i)/h,f=Math.min(c,p),d=Math.max(c,p),y=n+(a-n)*f,m=Math.floor(Math.min(y,o)/this._granularityCellSize)+1,g=Math.ceil(Math.max(y,o)/this._granularityCellSize)-1,x=o<y,v=0===h;if(v&&(s===l||s===u))return;if(v||f>=1||d<=0){let e=r-s,n=a+(t-a)*Math.min((l-s)/e,(u-s)/e);m=Math.floor(Math.min(n,o)/this._granularityCellSize)+1,g=Math.ceil(Math.max(n,o)/this._granularityCellSize)-1,x=o<n}let b=i-r>0?u:l;if(x)for(let t=m;t<=g;t++){let r=t*this._granularityCellSize;e.push(this._vertexToIndex(r,b))}else for(let t=g;t>=m;t--){let r=t*this._granularityCellSize;e.push(this._vertexToIndex(r,b))}}_generateOutline(e){let t=[];for(let r of e){let e=lX(r,this._granularity,!0),n=this._pointArrayToIndices(e),i=[];for(let e=1;e<n.length;e++)i.push(n[e-1]),i.push(n[e]);t.push(i)}return t}_handlePoles(e){let t=!1,r=!1;this._canonical&&(0===this._canonical.y&&(t=!0),this._canonical.y===(1<<this._canonical.z)-1&&(r=!0)),(t||r)&&this._fillPoles(e,t,r)}_ensureNoPoleVertices(){let e=this._vertexBuffer;for(let t=0;t<e.length;t+=2){let r=e[t+1];-32768===r&&(e[t+1]=-32767),32767===r&&(e[t+1]=32766)}}_generatePoleQuad(e,t,r,n,i,a){n>i==(-32768===a)?(e.push(r),e.push(t),e.push(this._vertexToIndex(n,a)),e.push(this._vertexToIndex(i,a)),e.push(r)):(e.push(t),e.push(r),e.push(this._vertexToIndex(n,a)),e.push(r),e.push(this._vertexToIndex(i,a))),e.push(this._vertexToIndex(n,a))}_fillPoles(e,t,r){let n=this._vertexBuffer,i=e.length;for(let a=2;a<i;a+=3){let i=e[a-2],s=e[a-1],o=e[a],l=n[2*i],u=n[2*i+1],h=n[2*s],c=n[2*s+1],p=n[2*o],f=n[2*o+1];t&&(0===u&&0===c&&this._generatePoleQuad(e,i,s,l,h,lq),0===c&&0===f&&this._generatePoleQuad(e,s,o,h,p,lq),0===f&&0===u&&this._generatePoleQuad(e,o,i,p,l,lq)),r&&(u===ez&&c===ez&&this._generatePoleQuad(e,i,s,l,h,lj),c===ez&&f===ez&&this._generatePoleQuad(e,s,o,h,p,lj),f===ez&&u===ez&&this._generatePoleQuad(e,o,i,p,l,lj))}}_initializeVertices(e){for(let t=0;t<e.length;t+=2)this._vertexToIndex(e[t],e[t+1])}subdividePolygonInternal(e,t){let r;if(this._used)throw Error("Subdivision: multiple use not allowed.");this._used=!0;let{flattened:n,holeIndices:i}=function(e){let t=[],r=[];for(let n of e)if(0!==n.length)for(let i of(n!==e[0]&&t.push(r.length/2),n))r.push(i.x),r.push(i.y);return{flattened:r,holeIndices:t}}(e);this._initializeVertices(n);try{let e=function(e,t,r=2){let n=t&&t.length,i=n?t[0]*r:e.length;lc.size&&lc.clear();let a=lf(e,0,i,r,!0),s=[];if(!a||a.next===a.prev)return s;let o=0,l=0,u=0;if(n&&(a=function(e,t,r,n){var i,a;let s,o=[];for(let r=0,i=t.length;r<i;r++){let a=lf(e,t[r]*n,r<i-1?t[r+1]*n:e.length,n,!1);a===a.next&&lc.add(a),o.push(function(e){let t=e,r=e;do(t.x<r.x||t.x===r.x&&t.y<r.y)&&(r=t),t=t.next;while(t!==e);return r}(a))}o.sort(lm),i=e.length/n,a=t.length,s=Math.ceil((i+2*a)/16)+a+2,lg.length<4*s&&(lg=new Float64Array(4*s)),lx=0,lw(r,r),ly=!0;for(let e=0;e<o.length;e++)r=function(e,t){let r=function(e,t){let r=t,n=e.x,i=e.y,a=-1/0,s;if(lM(e,r))return r;for(let t=0,o=0;t<lx;t++,o+=4){if(i<lg[o+1]||i>lg[o+3]||lg[o]>n||lg[o+2]<=a)continue;let l=lD(t);r=l_(t);do{if(r.prev.next===r){if(lM(e,r.next))return r.next;if(i<=r.y&&i>=r.next.y&&r.next.y!==r.y){let e=r.x+(i-r.y)*(r.next.x-r.x)/(r.next.y-r.y
2);if(e<=n&&e>a&&(a=e,s=r.x<r.next.x?r:r.next,e===n))return s}}r=r.next}while(r!==l)}if(!s)return null;let o=s.x,l=s.y,u=Math.min(i,l),h=Math.max(i,l),c=1/0;for(let t=0,d=0;t<lx;t++,d+=4){if(lg[d+2]<o||lg[d]>n||lg[d+3]<u||lg[d+1]>h)continue;let y=lD(t);r=l_(t);do{if(r.prev.next===r&&n>=r.x&&r.x>=o&&n!==r.x&&lC(i<l?n:a,i,o,l,i<l?a:n,i,r.x,r.y)){var p,f;let t=Math.abs(i-r.y)/(n-r.x);(lL(r,e)||r.y===i&&r.next.y===i&&r.next.x>n)&&(t<c||t===c&&(r.x>s.x||r.x===s.x&&(p=s,f=r,0>lB(p.prev,p,f.prev)&&0>lB(f.next,p,p.next))))&&(s=r,c=t)}r=r.next}while(r!==y)}return s}(e,t);if(!r)return t;let n=lV(r,e);return lw(r,n.next.next),ld(n,n.next),ld(r,r.next)}(o[e],r);return ly=!1,ld(r)}(e,t,a,r)),e.length>80*r){o=e[0],l=e[1];let t=o,n=l;for(let a=r;a<i;a+=r){let r=e[a],i=e[a+1];r<o&&(o=r),i<l&&(l=i),r>t&&(t=r),i>n&&(n=i)}u=0===(u=Math.max(t-o,n-l))?0:32767/u}return function e(t,r,n,i,a){a&&function(e,t,r,n){let i=e,a=0;do i.z=lI(i.x,i.y,t,r,n),lA[a++]=i,i=i.next;while(i!==e);!function(e){if(e<=32){for(let t=1;t<e;t++){let e=lA[t],r=e.z,n=t-1;for(;n>=0&&lA[n].z>r;)lA[n+1]=lA[n],n--;lA[n+1]=e}return}lS.length<e&&(lS=new Uint32Array(e),lF=new Uint32Array(e),lE=Array(e));for(let t=0;t<e;t++)lS[t]=lA[t].z;lT(e,lA,lS,lE,lF,0),lT(e,lE,lF,lA,lS,8),lT(e,lA,lS,lE,lF,16),lT(e,lE,lF,lA,lS,24)}(a);let s=null;for(let e=0;e<a;e++){let t=lA[e];t.prevZ=s,s&&(s.nextZ=t),s=t}s.nextZ=null}(t,n,i,a);let s=t,o=!1;for(;t.prev!==t.next;){let l=t.prev,u=t.next;if(0>lB(l,t,u)&&(a?function(e,t,r,n){let i=e.prev,a=e.next,s=i.x,o=e.x,l=a.x,u=i.y,h=e.y,c=a.y,p=Math.min(s,o,l),f=Math.min(u,h,c),d=Math.max(s,o,l),y=Math.max(u,h,c),m=lI(p,f,t,r,n),g=lI(d,y,t,r,n),x=e.prevZ;for(;x&&x.z>=m;){if(x.x>=p&&x.x<=d&&x.y>=f&&x.y<=y&&x!==a&&(s!==x.x||u!==x.y)&&lC(s,u,o,h,l,c,x.x,x.y)&&lB(x.prev,x,x.next)>=0)return!1;x=x.prevZ}let v=e.nextZ;for(;v&&v.z<=g;){if(v.x>=p&&v.x<=d&&v.y>=f&&v.y<=y&&v!==a&&(s!==v.x||u!==v.y)&&lC(s,u,o,h,l,c,v.x,v.y)&&lB(v.prev,v,v.next)>=0)return!1;v=v.nextZ}return!0}(t,n,i,a):function(e){let t=e.prev,r=e.next,n=t.x,i=e.x,a=r.x,s=t.y,o=e.y,l=r.y,u=Math.min(n,i,a),h=Math.min(s,o,l),c=Math.max(n,i,a),p=Math.max(s,o,l),f=r.next;for(;f!==t;){if(f.x>=u&&f.x<=c&&f.y>=h&&f.y<=p&&(n!==f.x||s!==f.y)&&lC(n,s,i,o,a,l,f.x,f.y)&&lB(f.prev,f,f.next)>=0)return!1;f=f.next}return!0}(t))){r.push(l.i,t.i,u.i),lO(t),t=u,s=u;continue}if((t=u)===s){if(lp=!1,t=ld(t),lp){s=t;continue}if(!o){s=t=function(e,t){let r=e,n=!1;do{let i=r.prev,a=r.next.next;lP(i,r,r.next,a,!1)&&lL(i,a)&&lL(a,i)&&(t.push(i.i,r.i,a.i),lO(r),lO(r.next),r=e=a,n=!0),r=r.next}while(r!==e);return n?ld(r):r}(t,r),o=!0;continue}!function(t,r,n,i,a){let s=t;do{let t=s.next.next;for(;t!==s.prev;){if(s.i!==t.i&&function(e,t){let r=lM(e,t)&&lB(e.prev,e,e.next)>0&&lB(t.prev,t,t.next)>0;return e.next.i!==t.i&&(r||lL(e,t)&&lL(t,e)&&(0!==lB(e.prev,e,t.prev)||0!==lB(e,t.prev,t)))&&!function(e,t){let r=Math.min(e.x,t.x),n=Math.max(e.x,t.x),i=Math.min(e.y,t.y),a=Math.max(e.y,t.y),s=e;do{let o=s.next;if(s.x>n&&o.x>n||s.x<r&&o.x<r||s.y>a&&o.y>a||s.y<i&&o.y<i){s=o;continue}if(s.i!==e.i&&o.i!==e.i&&s.i!==t.i&&o.i!==t.i&&lP(s,o,e,t))return!0;s=o}while(s!==e);return!1}(e,t)&&(r||function(e,t){let r=e,n=!1,i=(e.x+t.x)/2,a=(e.y+t.y)/2;do{let e=r.next;r.y>a!=e.y>a&&i<(e.x-r.x)*(a-r.y)/(e.y-r.y)+r.x&&(n=!n),r=e}while(r!==e);return n}(e,t))}(s,t)){let o=lV(s,t);s=ld(s,s.next),o=ld(o,o.next),e(s,r,n,i,a),e(o,r,n,i,a);return}t=t.next}s=s.next}while(s!==t)}(t,r,n,i,a);break}}}(a,s,o,l,u),s}(n,i),t=this._convertIndices(n,e);r=this._subdivideTrianglesScanline(t)}catch(e){console.error(e)}let a=[];return t&&(a=this._generateOutline(e)),this._ensureNoPoleVertices(),this._handlePoles(r),this._granularity>=2&&this._canonical?.z===0&&(r=this._removeTrianglesOutsideTileX(r),a=a.map(e=>this._removeLinesOutsideTileX(e))),{verticesFlattened:this._vertexBuffer,indicesTriangles:r,indicesLineList:a}}_vertexOutsideTileX(e){let t=this._vertexBuffer[2*e];return t<0||t>8192}_removeTrianglesOutsideTileX(e){let t=[];for(let r=0;r<e.length;r+=3)this._vertexOutsideTileX(e[r])||this._vertexOutsideTileX(e[r+1])||this._vertexOutsideTileX(e[r+2])||t.push(e[r],e[r+1],e[r+2]);return t}_removeLinesOutsideTileX(e){let t=[];for(let r=0;r<e.length;r+=2)this._vertexOutsideTileX(e[r])||this._vertexOutsideTileX(e[r+1])||t.pu
2sh(e[r],e[r+1]);return t}_convertIndices(e,t){let r=[];for(let n of t){let t=e[2*n],i=e[2*n+1];r.push(this._vertexToIndex(t,i))}return r}_pointArrayToIndices(e){let t=[];for(let r of e)t.push(this._vertexToIndex(r.x,r.y));return t}};function lY(e,t,r,n=!0){return new lG(r,t).subdividePolygonInternal(e,n)}function lX(e,t,r=!1){if(!e||e.length<1||e.length<2)return[];let n=e[0],i=e[e.length-1],a=r&&(n.x!==i.x||n.y!==i.y);if(t<2)return a?[...e,e[0]]:[...e];let s=Math.floor(ez/t),o=[];o.push(new C(e[0].x,e[0].y));let l=e.length,u=a?l:l-1;for(let t=0;t<u;t++){let r=e[t],n=t<l-1?e[t+1]:e[0],i=r.x,a=r.y,u=n.x,h=n.y,c=i!==u,p=a!==h;if(!c&&!p)continue;let f=u-i,d=h-a,y=Math.abs(f),m=Math.abs(d),g=i,x=a;for(;;){let e=f>0?(Math.floor(g/s)+1)*s:(Math.ceil(g/s)-1)*s,t=d>0?(Math.floor(x/s)+1)*s:(Math.ceil(x/s)-1)*s,r=Math.abs(g-e),n=Math.abs(x-t),i=Math.abs(x-h),a=c?r/y:1/0,l=p?n/m:1/0;if((Math.abs(g-u)<=r||!c)&&(i<=n||!p))break;if(a<l&&c||!p){let t=new C(g=e,Math.round(x+=d*a));(o[o.length-1].x!==t.x||o[o.length-1].y!==t.y)&&o.push(t)}else{let e=new C(Math.round(g+=f*l),x=t);(o[o.length-1].x!==e.x||o[o.length-1].y!==e.y)&&o.push(e)}}let v=new C(u,h);(o[o.length-1].x!==v.x||o[o.length-1].y!==v.y)&&o.push(v)}return o}function lW(e,t,r,n,i,a,s,o,l){let u=i.length/2,h=s&&o&&l;if(u<s5.MAX_VERTEX_ARRAY_LENGTH){let c,p,f=t.prepareSegment(u,r,n),d=f.vertexLength;for(let e=0;e<a.length;e+=3)n.emplaceBack(d+a[e],d+a[e+1],d+a[e+2]);f.vertexLength+=u,f.primitiveLength+=a.length/3,h&&(c=(p=s.prepareSegment(u,r,o)).vertexLength,p.vertexLength+=u);for(let t=0;t<i.length;t+=2)e(i[t],i[t+1]);if(h)for(let e of l){for(let t=1;t<e.length;t+=2)o.emplaceBack(c+e[t-1],c+e[t]);p.primitiveLength+=e.length/2}}else(function(e,t,r,n,i,a){let s=[];for(let e=0;e<n.length/2;e++)s.push(-1);let o={count:0},l=0,u=e.getOrCreateLatestSegment(t,r),h=u.vertexLength;for(let c=2;c<i.length;c+=3){let p=i[c-2],f=i[c-1],d=i[c],y=s[p]<l,m=s[f]<l,g=s[d]<l,x=+!!y+ +!!m+ +!!g;u.vertexLength+x>s5.MAX_VERTEX_ARRAY_LENGTH&&(u=e.createNewSegment(t,r),l=o.count,y=!0,m=!0,g=!0,h=0);let v=lZ(s,n,a,o,p,y,u),b=lZ(s,n,a,o,f,m,u),w=lZ(s,n,a,o,d,g,u);r.emplaceBack(h+v-l,h+b-l,h+w-l),u.primitiveLength++}})(t,r,n,i,a,e),h&&function(e,t,r,n,i,a){let s=[];for(let e=0;e<n.length/2;e++)s.push(-1);let o={count:0},l=0,u=e.getOrCreateLatestSegment(t,r),h=u.vertexLength;for(let c of i)for(let i=1;i<c.length;i+=2){let p=c[i-1],f=c[i],d=s[p]<l,y=s[f]<l,m=+!!d+ +!!y;u.vertexLength+m>s5.MAX_VERTEX_ARRAY_LENGTH&&(u=e.createNewSegment(t,r),l=o.count,d=!0,y=!0,h=0);let g=lZ(s,n,a,o,p,d,u),x=lZ(s,n,a,o,f,y,u);r.emplaceBack(h+g-l,h+x-l),u.primitiveLength++}}(s,r,o,i,l,e),t.forceNewSegmentOnNextPrepare(),s?.forceNewSegmentOnNextPrepare()}function lZ(e,t,r,n,i,a,s){if(a){let a=n.count;return r(t[2*i],t[2*i+1]),e[i]=n.count,n.count++,s.vertexLength++,a}return e[i]}var lH=class{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(e=>e.id),this.index=e.index,this.hasDependencies=!1,this.sdfPatterns={},this.patternFeatures=[],this.layoutVertexArray=new s$,this.indexArray=new sQ,this.indexArray2=new s1,this.programConfigurations=new oA(e.layers,e.zoom),this.segments=new s5,this.segments2=new s5,this.stateDependentLayerIds=this.layers.filter(e=>e.isStateDependent()).map(e=>e.id)}populate(e,t,r){this.hasDependencies=lu("fill",this.layers,t);let n=this.layers[0].layout.get("fill-sort-key"),i=!n.isConstant(),a=[],s=new az(this.zoom),o=this.layers[0]._featureFilter.needGeometry;for(let{feature:l,id:u,index:h,sourceLayerIndex:c}of e){let e=ok(l,o);if(!this.layers[0]._featureFilter.filter(s,e,r))continue;let p=i?n.evaluate(e,{},r,t.availableImages):void 0,f={id:u,properties:l.properties,type:l.type,sourceLayerIndex:c,index:h,geometry:o?e.geometry:oF(l),patterns:{},sortKey:p};a.push(f)}for(let n of(i&&a.sort((e,t)=>
2e.sortKey-t.sortKey),a)){let{geometry:i,index:a,sourceLayerIndex:s}=n;if(this.hasDependencies){let e=lh("fill",this.layers,n,{zoom:this.zoom},t);this.patternFeatures.push(e)}else this.addFeature(n,i,a,r,{},t.subdivisionGranularity);let o=e[a].feature;t.featureIndex.insert(o,i,a,s,this.index)}}update(e,t,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,t,this.stateDependentLayers,{imagePositions:r})}addFeatures({options:e,canonical:t,patternPositions:r,patternMap:n}){for(let i of(this.detectSdfPatterns(n),this.patternFeatures))this.addFeature(i,i.geometry,i.index,t,r,e.subdivisionGranularity)}detectSdfPatterns(e){for(let t of this.patternFeatures)for(let r in t.patterns){let n=t.patterns[r];this.recordSdfPattern(r,e[n.min]),this.recordSdfPattern(r,e[n.mid]),this.recordSdfPattern(r,e[n.max])}for(let t of this.layers){let r=t.paint.get("fill-pattern").constantOr(null);r&&(this.recordSdfPattern(t.id,e[r.from.toString()]),this.recordSdfPattern(t.id,e[r.to.toString()]))}}recordSdfPattern(e,t){if(!t)return;let r=!0===t.sdf,n=this.sdfPatterns[e];void 0===n?this.sdfPatterns[e]=r:n!==r&&to(`Style sheet warning: Cannot mix SDF and non-SDF fill patterns in layer "${e}"`)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,ll),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.indexBuffer2=e.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())}addFeature(e,t,r,n,i,a){for(let e of r8(t,500)){let t=lY(e,n,a.fill.getGranularityForZoomLevel(n.z)),r=this.layoutVertexArray;lW((e,t)=>{r.emplaceBack(e,t)},this.segments,this.layoutVertexArray,this.indexArray,t.verticesFlattened,t.indicesTriangles,this.segments2,this.indexArray2,t.indicesLineList)}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,r,{imagePositions:i,canonical:n})}};ak("FillBucket",lH,{omit:["layers","patternFeatures"]});var lK={get paint(){return p||=new aJ({"fill-antialias":new aX(tQ.paint_fill["fill-antialias"],"fill-antialias"),"fill-opacity":new aW(tQ.paint_fill["fill-opacity"],"fill-opacity"),"fill-layer-opacity":new aX(tQ.paint_fill["fill-layer-opacity"],"fill-layer-opacity"),"fill-color":new aW(tQ.paint_fill["fill-color"],"fill-color"),"fill-outline-color":new aW(tQ.paint_fill["fill-outline-color"],"fill-outline-color"),"fill-translate":new aX(tQ.paint_fill["fill-translate"],"fill-translate"),"fill-translate-anchor":new aX(tQ.paint_fill["fill-translate-anchor"],"fill-translate-anchor"),"fill-pattern":new aZ(tQ.paint_fill["fill-pattern"],"fill-pattern")})},get layout(){return c||=new aJ({"fill-sort-key":new aW(tQ.layout_fill["fill-sort-key"],"fill-sort-key")})}};let lJ=e=>"fill"===e.type;var lQ=class extends a0{constructor(e,t){super(e,lK,t)}recalculate(e,t){super.recalculate(e,t);let r=this.paint._values["fill-outline-color"];"constant"===r.value.kind&&void 0===r.value.value&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])}createBucket(e){return new lH(e)}queryRadius(){return oO(this.paint.get("fill-translate"))}queryIntersectsFeature({queryGeometry:e,geometry:t,transform:r,pixelsToTileUnits:n}){return oB(o$(e,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),-r.bearingInRadians,n),t)}isTileClipped(){return!0}};let l1=a7([{name:"a_pos",components:2,type:"Int16"},{name:"a_normal_ed",components:4,type:"Int16"}],4),l0=a7([{name:"a_centroid",components:2,type:"Int16"}],4),l2=l1.members;l1.size,l1.alignment;var l3=class e{constructor(){this.minX=1/0,this.maxX=-1/0,this.minY=1/0,this.maxY=-1/0}extend(e){return this.minX=Math.min(this.minX,e.x),this.minY=Math.min(this.minY,e.y),this.maxX=Math.max(this.maxX,e.x),this.maxY=Math.max(this.maxY,e.y),this}expandBy(e){return this.minX-=e,this.minY-=e,this.maxX+=e,this.maxY+=e,(this.minX>this.maxX||this.minY>this.maxY)&&(this.minX=1/0,this.maxX=-1/0,this.minY=1/0,this.maxY=-1/0),this}shrinkBy(e){return this.expandBy(-e)}map(t){let r=new e;return r.extend(t(new C(this.minX,this.minY))),r.extend(t(new C(this.maxX,this.minY))),r.extend(t(new C(this.minX,this.maxY))),r.extend(t(new C(this.maxX,this.maxY))),r}static fromPoints(t){let r=new e;for(let e of t)r.extend(e);return r}contains(e){return e.x>=this.minX&&e.x<=this.maxX&&e.y>=this.minY&&e.y<=this.maxY}empty(){return this.minX>this.maxX}width(){return this.maxX-this.minX}height(){return this.maxY-this.minY}covers(e){return!this.empty()&&!e.empty()&&e.minX>=this.minX&&e.maxX<=this.maxX&&e.minY>=this.minY&&e.maxY<=this.maxY}intersects(e){return!this.empty()&&!e.empty()&&e.minX<=this.maxX&&e.maxX>=this.minX&&e.minY<=this.maxY&&e.maxY>=this.minY}};let l5=l3.fromPoints([new C(0,0),new C(ez,ez)]);function l6(e,t){return e.x===t.x&&(e.x<0||e.x>8192)||e.y===t.y&&(e.y<0||e.y>8192)}function l4(e){return e.every(e=>e.x<0)||e.every(e=>e.x>8192)||e.every(e=>e.y<0)||e.every(e=>e.y>8192)}var l8=class{constructor(e,t,r,n,i){for(this.properties=Object.create(null),this.extent=r,this.type=0,this.id=void 0,this._pbf=e,this._geometry=-1,this._keys=n,this._values=i;e.pos<t;){let t=e.readVarint();if(8===t)this.id=e.readVarint();else if(18===t){let t=e.readVarint()+e.pos;for(;e.pos<t;){let t=n[e.readVarint()],r=i[e.readVarint()];this.properties[t]=r}}else 24===t?this.type=e.readVarint():(34===t&&(this._geometry=e.pos),e.skip(t))}}loadGeometry(){if(this._geometry<0)throw Error("feature has no geometry");let e=this._pbf;e.pos=this._geometry;let t=e.readVarint()+e.pos,r=[],n,i=1,a=0,s=0,o=0;for(;e.pos<t;){if(a<=0){let t=e.readVarint();if(i=7&t,0==(a=t>>3))continue}if(a--,1===i)s+=e.readSVarint(),o+=e.readSVarint(),n&&r.push(n),n=[new C(s,o)];else if(2===i)s+=e.readSVarint(),o+=e.readSVarint(),n&&n.push(new C(s,o));else if(7===i)n&&n.push(n[0].clone());else throw Error(`unknown command ${i}`)}return n&&r.push(n),r}bbox(){if(this._geometry<0)throw Error("feature has no geometry");let e=this._pbf;e.pos=this._geometry;let t=e.readVarint()+e.pos,r=1,n=0,i=0,a=0,s=1/0,o=-1/0,l=1/0,u=-1/0;for(;e.pos<t;){if(n<=0){let t=e.readVarint();if(r=7&t,0==(n=t>>3))continue}if(n--,1===r||2===r)i+=e.readSVarint(),a+=e.readSVarint(),i<s&&(s=i),i>o&&(o=i),a<l&&(l=a),a>u&&(u=a);else if(7!==r)throw Error(`unknown command ${r}`)}return[s,l,o,u]}toGeoJSON(e,t,r){let n,i=this.extent*2**r,a=this.extent*e,s=this.extent*t,o=this.loadGeometry();function l(e){return[(e.x+a)*360/i-180,360/Math.PI*Math.atan(Math.exp((1-(e.y+s)*2/i)*Math.PI))-90]}function u(e){return e.map(l)}if(1===this.type){let e=[];
2for(let t of o)e.push(t[0]);let t=u(e);n=1===e.length?{type:"Point",coordinates:t[0]}:{type:"MultiPoint",coordinates:t}}else if(2===this.type){let e=o.map(u);n=1===e.length?{type:"LineString",coordinates:e[0]}:{type:"MultiLineString",coordinates:e}}else if(3===this.type){let e=l7(o),t=[];for(let r of e)t.push(r.map(u));n=1===t.length?{type:"Polygon",coordinates:t[0]}:{type:"MultiPolygon",coordinates:t}}else throw Error("unknown feature type");let h={type:"Feature",geometry:n,properties:this.properties};return null!=this.id&&(h.id=this.id),h}};function l7(e){let t=e.length;if(t<=1)return[e];let r=[],n,i;for(let a=0;a<t;a++){let t=function(e){let t=0;for(let r=0,n=e.length,i=n-1,a,s;r<n;i=r++)a=e[r],t+=((s=e[i]).x-a.x)*(a.y+s.y);return t}(e[a]);0!==t&&(void 0===i&&(i=t<0),i===t<0?(n&&r.push(n),n=[e[a]]):n&&n.push(e[a]))}return n&&r.push(n),r}l8.types=["Unknown","Point","LineString","Polygon"];var l9=class{constructor(e,t){for(this.version=1,this.name="",this.extent=4096,this.length=0,this._pbf=e,this._keys=[],this._values=[],this._features=[],void 0===t&&(t=e.length);e.pos<t;){let t=e.readVarint();10===t?this.name=e.readString():18===t?(this._features.push(e.pos),e.skip(t)):26===t?this._keys.push(e.readString()):34===t?this._values.push(function(e){let t=null,r=e.readVarint()+e.pos;for(;e.pos<r;){let r=e.readVarint();t=10===r?e.readString():21===r?e.readFloat():25===r?e.readDouble():32===r?e.readVarint(!0):40===r?e.readVarint():48===r?e.readSVarint():56===r?e.readBoolean():(e.skip(r),null)}if(null==t)throw Error("unknown feature value");return t}(e)):40===t?this.extent=e.readVarint():120===t?this.version=e.readVarint():e.skip(t)}this.length=this._features.length}feature(e){if(e<0||e>=this._features.length)throw Error("feature index out of bounds");this._pbf.pos=this._features[e];let t=this._pbf.readVarint()+this._pbf.pos;return new l8(this._pbf,t,this.extent,this._keys,this._values)}},ue=class{constructor(e,t=e.length){let r=Object.create(null);for(;e.pos<t;){let t=e.readVarint();if(26===t){let t=new l9(e,e.readVarint()+e.pos);t.length&&(r[t.name]=t)}else e.skip(t)}this.layers=r}};let ut=6371008.8;var ur=class e{constructor(e,t){if(isNaN(e)||isNaN(t))throw Error(`Invalid LngLat object: (${e}, ${t})`);if(this.lng=+e,this.lat=+t,this.lat>90||this.lat<-90)throw Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new e(e5(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(e){let t=Math.PI/180,r=this.lat*t,n=e.lat*t;return ut*Math.acos(Math.min(Math.sin(r)*Math.sin(n)+Math.cos(r)*Math.cos(n)*Math.cos((e.lng-this.lng)*t),1))}static convert(t){if(t instanceof e)return t;if(Array.isArray(t)&&(2===t.length||3===t.length))return new e(Number(t[0]),Number(t[1]));if(!Array.isArray(t)&&"object"==typeof t&&t)return new e(Number("lng"in t?t.lng:t.lon),Number(t.lat));throw 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>]")}};let un=2*Math.PI*ut;function ui(e){return un*Math.cos(e*Math.PI/180)}function ua(e){return(180+e)/360}function us(e){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+e*Math.PI/360)))/360}function uo(e,t){return e/ui(t)}function ul(e){return 360*e-180}function uu(e){return 360/Math.PI*Math.atan(Math.exp((180-360*e)*Math.PI/180))-90}function uh(e,t){return e*ui(uu(t))}var uc=class e{constructor(e,t,r=0){this.x=+e,this.y=+t,this.z=+r}static fromLngLat(t,r=0){let n=ur.convert(t);return new e(ua(n.lng),us(n.lat),r/ui(n.lat))}toLngLat(){return new ur(ul(this.x),uu(this.y))}toAltitude(){return uh(this.z,this.y)}meterInMercatorCoordinateUnits(){return 1/un*(1/Math.cos(uu(this.y)*Math.PI/180))}};let up=89.25;function uf(e,t,r){let n=1/(1<<r.z);return new uc(e/ez*n+r.x*n,t/ez*n+r.y*n)}function ud(e,t){let r=e3(t.lat,-85.051129,tS);return new C(ua(t.lng)*e,us(r)*e)}function uy(e,t){return new uc(t.x/e,t.y/e).toLngLat()}function um(e){return e.cameraToCenterDistance*Math.min(.85*Math.tan(tb(90-e.pitch)),Math.tan(tb(up-e.pitch)))}function ug(e,t){let r=e.canonical,n=t/te(r.z),i=r.x+2**r.z*e.wrap,a=new Float64Array(16);return $(a),q(a,a,[i*n,r.y*n,0]),j(a,a,[n/ez,n/ez,1]),a}function ux(e,t,r,n,i){let a=uc.fromLngLat(e,t),s=i*(1/ui(e.lat)),{x:o,y:l,z:u}=ub(r,n);return new uc(a.x+-(s*o),a.y+-(s*l),a.z+s*u)}function uv(e){let t=1/ui(e.center.lat)*e.worldSize;return ux(e.center,e.elevation,e.pitch,e.bearing,e.cameraToCenterDistance/t)}function ub(e,t){let r=tb(e),n=tb(t),i=Math.cos(-r),a=Math.sin(r);return{x:a*Math.sin(n),y:-a*Math.cos(n),z:i}}function uw(e,t,r){var n,i;let a;if(t<=0||!e||0===e.length)return e;let s=(n=t,a=uf(ez/2,ez/2,i=r).toLngLat(),n*uc.fromLngLat(a).meterInMercatorCoordinateUnits()*((1<<i.z)*ez));return e.map(e=>(function(e,t){if(!e||e.length<3)return e;let r=e[0].x===e[e.length-1].x&&e[0].y===e[e.length-1].y,n=r?e.length-1:e.length;if(n<3)return e;let i=[];for(let r=0;r<n;r++){let a=e[(r-1+n)%n],s=e[r],o=e[(r+1)%n];if(l6(a,s)||l6(s,o)){i.push(s.clone());continue}
2!function(e,t,r,n,i){let a=t.sub(r),s=n.sub(r),o=a.mag(),l=s.mag();if(o<1e-6||l<1e-6)return e.push(r.clone());a._div(o),s._div(l);let u=a.x*s.x+a.y*s.y;if(Math.abs(u)>Math.cos(5*Math.PI/180))return e.push(r.clone());let h=Math.min(i,.2*o,.2*l),c=r.add(a.mult(h)),p=r.add(s.mult(h)),f=Math.sqrt((1+u)/2),d=r.add(a.add(s)._unit()._mult(h/f)),y=c.sub(d).angleWith(p.sub(d)),m=Math.max(2,Math.ceil(Math.abs(y)/(Math.PI/6)-1e-6));for(let t=0;t<=m;t++)e.push(c.rotateAround(t/m*y,d))}(i,a,s,o,t)}let a=function(e){let t=[];for(let r of e){let e=r.round(),n=t[t.length-1];(n?.x!==e.x||n?.y!==e.y)&&t.push(e)}for(;t.length>1&&t[0].x===t[t.length-1].x&&t[0].y===t[t.length-1].y;)t.pop();return t}(i);return a.length<3?e:(r&&a.push(a[0].clone()),a)})(e,s))}function uD(e,t,r,n,i,a,s,o){e.emplaceBack(t,r,2*Math.floor(8192*n)+s,8192*i*2,8192*a*2,Math.round(o))}var u_=class{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(e=>e.id),this.index=e.index,this.hasDependencies=!1,this.layoutVertexArray=new sN,this.centroidVertexArray=new sL,this.indexArray=new sQ,this.programConfigurations=new oA(e.layers,e.zoom),this.segments=new s5,this.stateDependentLayerIds=this.layers.filter(e=>e.isStateDependent()).map(e=>e.id)}populate(e,t,r){this.features=[],this.hasDependencies=lu("fill-extrusion",this.layers,t);let n=new az(this.zoom),i=this.layers[0],a=i.layout.get("fill-extrusion-rounded-corner-distance"),s=i._featureFilter.needGeometry;for(let{feature:o,id:l,index:u,sourceLayerIndex:h}of e){let e=ok(o,s);if(!i._featureFilter.filter(n,e,r))continue;let c=s?e.geometry:oF(o),p={id:l,sourceLayerIndex:h,index:u,geometry:a>0?uw(c,a,r):c,properties:o.properties,type:o.type,patterns:{}};this.hasDependencies?this.features.push(lh("fill-extrusion",this.layers,p,{zoom:this.zoom},t)):this.addFeature(p,p.geometry,u,r,{},t.subdivisionGranularity),t.featureIndex.insert(o,p.geometry,u,h,this.index,!0)}}addFeatures({options:e,canonical:t,patternPositions:r}){for(let n of this.features){let{geometry:i}=n;this.addFeature(n,i,n.index,t,r,e.subdivisionGranularity)}}update(e,t,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,t,this.stateDependentLayers,{imagePositions:r})}isEmpty(){return 0===this.layoutVertexArray.length&&0===this.centroidVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,l2),this.centroidVertexBuffer=e.createVertexBuffer(this.centroidVertexArray,l0.members,!0),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.centroidVertexBuffer.destroy())}addFeature(e,t,r,n,i,a){let s=this.layers[0],o=s.layout?s.layout.get("fill-extrusion-rounded-corner-distance"):0;for(let r of r8(o>0?uw(t,o,n):t,500)){let t={x:0,y:0,sampleCount:0},i=this.layoutVertexArray.length;this.processPolygon(t,n,e,r,a);let s=this.layoutVertexArray.length-i,o=Math.floor(t.x/t.sampleCount),l=Math.floor(t.y/t.sampleCount);for(let e=0;e<s;e++)this.centroidVertexArray.emplaceBack(o,l)}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,r,{imagePositions:i,canonical:n})}processPolygon(e,t,r,n,i){if(n.length<1||l4(n[0]))return;for(let t of n)0!==t.length&&function(e,t){for(let r=0;r<t.length;r++){let n=t[r];(r!==t.length-1||t[0].x!==n.x||t[0].y!==n.y)&&(e.x+=n.x,e.y+=n.y,e.sampleCount++)}}(e,t);let a={segment:this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray)},s=i.fill.getGranularityForZoomLevel(t.z),o="Polygon"===l8.types[r.type];for(let e of n){if(0===e.length||l4(e))continue;let t=lX(e,s,o);this._generateSideFaces(t,a)}if(!o)return;let l=lY(n,t,s,!1),u=this.layoutVertexArray;lW((e,t)=>{uD(u,e,t,0,0,1,1,0)},this.segments,this.layoutVertexArray,this.indexArray,l.verticesFlattened,l.indicesTriangles)}_generateSideFaces(e,t){let r=0;for(let n=1;n<e.length;n++){let i=e[n],a=e[n-1];if(l6(i,a))continue;t.segment.vertexLength+4>s5.MAX_VERTEX_ARRAY_LENGTH&&(t.segment=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));let s=i.sub(a)._perp()._unit(),o=a.dist(i);r+o>32768&&(r=0),uD(this.layoutVertexArray,i.x,i.y,s.x,s.y,0,0,r),uD(this.layoutVertexArray,i.x,i.y,s.x,s.y,0,1,r),r+=o,uD(this.layoutVertexArray,a.x,a.y,s.x,s.y,0,0,r),uD(this.layoutVertexArray,a.x,a.y,s.x,s.y,0,1,r);let l=t.segment.vertexLength;this.indexArray.emplaceBack(l,l+2,l+1),this.indexArray.emplaceBack(l+1,l+2,l+3),t.segment.vertexLength+=4,t.segment.primitiveLength+=2}}};ak("FillExtrusionBucket",u_,{omit:["layers","features"]});var uA={get paint(){return d||=new aJ({"fill-extrusion-opacity":new aX(tQ["paint_fill-extrusion"]["fill-extrusion-opacity"],"fill-extrusion-opacity"),"fill-extrusion-color":new aW(tQ["paint_fill-extrusion"]["fill-extrusion-color"],"fill-extrusion-color"),"fill-extrusion-translate":new aX(tQ["paint_fill-extrusion"]["fill-extrusion-translate"],"fill-extrusion-translate"),"fill-extrusion-translate-anchor":new aX(tQ["paint_fill-extrusion"]["fill-extrusion-translate-anchor"],"fill-extrusion-translate-anchor"),"fill-extrusion-pattern":new aZ(tQ["paint_fill-extrusion"]["fill-extrusion-pattern"],"fill-extrusion-pattern"),"fill-extrusion-height":new aW(tQ["paint_fill-extrusion"]["fill-extrusion-height"],"fill-extrusion-height"),"fill-extrusion-base":new aW(tQ["paint_fill-extrusion"]["fill-extrusion-base"],"fill-extrusion-base"),"fill-extrusion-vertical-gradient":new aX(tQ["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"],"fill-extrusion-vertical-gradient")})},get layout(){return f||=new aJ({"fill-extrusion-rounded-corner-distance":new aX(tQ["layout_fill-extrusion"]["fill-extrusion-rounded-corner-distance"],"fill-extrusion-rounded-corner-distance")})}};let uE=e=>"fill-extrusion"===e.type;var uS=class extends a0{constructor(e,t){super(e,uA,t)}createBucket(e){return new u_(e)}queryRadius(){return oO(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}queryIntersectsFeature({queryGeometry:e,feature:t,featureState:r,geometry:n,transform:i,pixelsToTileUnits:a,pixelPosMatrix:s}){let o=o$(e,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),-i.bearingInRadians,a),l=this.paint.get("fill-extrusion-height").evaluate(t,r),u=this.paint.get("fill-extrusion-base").evaluate(t,r),h=function(e,t,r){let n=[];for(let r of e){let e=[r.x,r.y,0,1];eD(e,e,t),n.push(new C(e[0]/e[3],e[1]/e[3]))}return n}(o,s,0),c=function(e,t,r,n){let i=[],a=[],s=n[8]*t,o=n[9]*t,l=n[10]*t,u=n[11]*t,h=n[8]*r,c=n[9]*r,p=n[10]*r,f=n[11]*r;for(let t of e){let e=[],r=[];for(let i of t){let t=i.x,a=i.y,d=n[0]*t+n[4]*a+n[12],y=n[1]*t+n[5]*a+n[13],m=n[2]*t+n[6]*a+n[14],g=n[3]*t+n[7]*a+n[15],x=d+s,v=y+o,b=m+l,w=g+u,D=d+h,_=y+c,A=m+p,E=g+f,S=new C(x/w,v/w);S.z=b/w,e.push(S);let F=new C(D/E,_/E);F.z=A/E,r.push(F)}i.push(e),a.push(r)}return[i,a]}(n,u,l,s);return function(e,t,r){let n=1/0;oB(r,t)&&(n=uk(r,t[0]));for(let i=0;i<t.length;i++){let a=t[i],s=e[i];for(let e=0;e<a.length-1;e++){let t=a[e],i=a[e+1],o=s[e],l=[t,i,s[e+1],o,t];oI(r,l)&&(n=Math.min(n,uk(r,l)))}}return n!==1/0&&n}(c[0],c[1],h)}};function uF(e,t){return e.x*t.x+e.y*t.y}function uk(e,t){if(1===e.length){let r=0,n=t[r++],i;for(;!i||n.equals(i);)if(!(i=t[r++]))return 1/0;for(;r<t.length;r++){let a=t[r],s=e[0],o=i.sub(n),l=a.sub(n),u=s.sub(n),h=uF(o,o),c=uF(o,l),p=uF(l,l),f=uF(u,o),d=uF(u,l),y=h*p-c*c,m=(p*f-c*d)/y,g=(h*d-c*f)/y,x=1-m-g,v=n.z*x+i.z*m+a.z*g;if(isFinite(v))return v}return 1/0}{let e=1/0;for(let r of t)e=Math.min(e,r.z);return e}}Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,new Uint32Array(96);let uT=a7([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}],4),uI=uT.members;uT.size,uT.alignment;let uC=a7([{name:"a_uv_x",components:1,type:"Float32"},{name:"a_split_index",components:1,type:"Float32"}]),uB=uC.members;uC.size,uC.alignment;let uM=Math.cos(Math.PI/180*37.5);var uP=class{constructor(e){for(let t of(this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(e=>e.id),this.index=e.index,this.hasDependencies=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers))this.gradients[t.id]={};this.layoutVertexArray=new sU,this.layoutVertexArray2=new sq,this.indexArray=new sQ,this.programConfigurations=new oA(e.layers,e.zoom),this.segments=new s5,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter(e=>e.isStateDependent()).map(e=>e.id)}populate(e,t,r){this.hasDependencies=lu("line",this.layers,t)||this.hasLineDasharray(this.layers);let n=this.layers[0].layout.get("line-sort-key"),i=!n.isConstant(),a=[],s=new az(this.zoom),o=this.layers[0]._featureFilter.needGeometry;for(let{feature:t,id:l,index:u,sourceLayerIndex:h}of e){let e=ok(t,o);if(!this.layers[0]._featureFilter.filter(s,e,r))continue;let c=i?n.evaluate(e,{},r):void 0,p={id:l,properties:t.properties,type:t.type,sourceLayerIndex:h,index:u,geometry:o?e.geometry:oF(t),patterns:{},dashes:{},sortKey:c};a.push(p)}for(let n of(i&&a.sort((e,t)=>
2e.sortKey-t.sortKey),a)){let{geometry:i,index:a,sourceLayerIndex:s}=n;this.hasDependencies?(lu("line",this.layers,t)?lh("line",this.layers,n,{zoom:this.zoom},t):this.hasLineDasharray(this.layers)&&this.addLineDashDependencies(this.layers,n,this.zoom,t),this.patternFeatures.push(n)):this.addFeature(n,i,a,r,{},{},t.subdivisionGranularity);let o=e[a].feature;t.featureIndex.insert(o,i,a,s,this.index)}}update(e,t,r,n){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,t,this.stateDependentLayers,{imagePositions:r,dashPositions:n})}addFeatures({options:e,canonical:t,patternPositions:r,dashPositions:n}){for(let i of this.patternFeatures)this.addFeature(i,i.geometry,i.index,t,r,n,e.subdivisionGranularity)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(0!==this.layoutVertexArray2.length&&(this.layoutVertexBuffer2=e.createVertexBuffer(this.layoutVertexArray2,uB)),this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,uI),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.hasOwn(e.properties,"geojsonvt_clip_start")&&Object.hasOwn(e.properties,"geojsonvt_clip_end"))return{start:+e.properties.geojsonvt_clip_start,end:+e.properties.geojsonvt_clip_end}}addFeature(e,t,r,n,i,a,s){let o=this.layers[0].layout,l=o.get("line-join").evaluate(e,{}),u=o.get("line-cap").evaluate(e,{}),h=o.get("line-miter-limit").evaluate(e,{}),c=o.get("line-round-limit").evaluate(e,{});for(let r of(this.lineClips=this.lineFeatureClips(e),t))this.addLine(r,e,l,u,h,c,n,s);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,r,{imagePositions:i,dashPositions:a,canonical:n})}addLine(e,t,r,n,i,a,s,o){this.distance=0,this.scaledDistance=0,this.totalDistance=0;let l=s?o.line.getGranularityForZoomLevel(s.z):1;if(e=lX(e,l),this.lineClips){this.lineClipsArray.push(this.lineClips);for(let t=0;t<e.length-1;t++)this.totalDistance+=e[t].dist(e[t+1]);this.updateScaledDistance(),this.maxLineLength=Math.max(this.maxLineLength,this.totalDistance)}let u="Polygon"===l8.types[t.type],h=e.length;for(;h>=2&&e[h-1].equals(e[h-2]);)h--;let c=0;for(;c<h-1&&e[c].equals(e[c+1]);)c++;if(h-c<(u?3:2))return;"bevel"===r&&(i=1.05);let p=this.overscaling<=16?15*ez/(512*this.overscaling):0,f=this.segments.prepareSegment(10*h,this.layoutVertexArray,this.indexArray),d,y,m,g,x;this.e1=this.e2=-1,u&&(d=e[h-2],x=e[c].sub(d)._unit()._perp());for(let t=c;t<h;t++){if((m=t===h-1?u?e[c+1]:void 0:e[t+1])&&e[t].equals(m))continue;x&&(g=x),d&&(y=d),d=e[t],x=m?m.sub(d)._unit()._perp():g;let s=(g||=x).add(x);(0!==s.x||0!==s.y)&&s._unit();let o=g.x*x.x+g.y*x.y,l=s.x*x.x+s.y*x.y,v=0===l?1/0:1/l,b=2*Math.sqrt(2-2*l),w=l<uM&&y&&m,D=g.x*x.y-g.y*x.x>0;if(w&&t>c){let e=d.dist(y);if(e>2*p){let t=d.sub(d.sub(y)._mult(p/e)._round());this.updateDistance(y,t),this.addCurrentVertex(t,g,0,0,f),y=t}}let _=y&&m,A=_?r:u?"butt":n;if(_&&"round"===A&&(v<a?A="miter":v<=2&&(A="fakeround")),"miter"===A&&v>i&&(A="bevel"),"bevel"===A&&(v>2&&(A="flipbevel"),v<i&&(A="miter")),y&&this.updateDistance(y,d),"miter"===A)s._mult(v),this.addCurrentVertex(d,s,0,0,f);else if("flipbevel"===A){if(v>100)s=x.mult(-1);else{let e=v*g.add(x).mag()/g.sub(x).mag();s._perp()._mult(e*(D?-1:1))}this.addCurrentVertex(d,s,0,0,f),this.addCurrentVertex(d,s.mult(-1),0,0,f)}else if("bevel"===A||"fakeround"===A){let e=-Math.sqrt(v*v-1),t=D?e:0,r=D?0:e;if(y&&this.addCurrentVertex(d,g,t,r,f),"fakeround"===A){let e=Math.round(180*b/Math.PI/20);for(let t=1;t<e;t++){let r=t/e;
2if(.5!==r){let e=r-.5,t=1.0904+o*(-3.2452+o*(3.55645-1.43519*o)),n=.848013+o*(-1.06021+.215638*o);r+=r*e*(r-1)*(t*e*e+n)}let n=x.sub(g)._mult(r)._add(g)._unit()._mult(D?-1:1);this.addHalfVertex(d,n.x,n.y,!1,D,0,f)}}m&&this.addCurrentVertex(d,x,-t,-r,f)}else if("butt"===A)this.addCurrentVertex(d,s,0,0,f);else if("square"===A){let e=y?1:-1;this.addCurrentVertex(d,s,e,e,f)}else"round"===A&&(y&&(this.addCurrentVertex(d,g,0,0,f),this.addCurrentVertex(d,g,1,1,f,!0)),m&&(this.addCurrentVertex(d,x,-1,-1,f,!0),this.addCurrentVertex(d,x,0,0,f)));if(w&&t<h-1){let e=d.dist(m);if(e>2*p){let t=d.add(m.sub(d)._mult(p/e)._round());this.updateDistance(d,t),this.addCurrentVertex(t,x,0,0,f),d=t}}}}addCurrentVertex(e,t,r,n,i,a=!1){let s=t.x+t.y*r,o=t.y-t.x*r,l=-t.x+t.y*n,u=-t.y-t.x*n;this.addHalfVertex(e,s,o,a,!1,r,i),this.addHalfVertex(e,l,u,a,!0,-n,i),this.distance>16384&&0===this.totalDistance&&(this.distance=0,this.updateScaledDistance(),this.addCurrentVertex(e,t,r,n,i,a))}addHalfVertex({x:e,y:t},r,n,i,a,s,o){let l=(this.lineClips?32767*this.scaledDistance:this.scaledDistance)*.5;if(this.layoutVertexArray.emplaceBack((e<<1)+ +!!i,(t<<1)+ +!!a,Math.round(63*r)+128,Math.round(63*n)+128,(0===s?0:s<0?-1:1)+1|(63&l)<<2,l>>6),this.lineClips){let e=(this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start);this.layoutVertexArray2.emplaceBack(e,this.lineClipsArray.length)}let u=o.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,u,this.e2),o.primitiveLength++),a?this.e2=u:this.e1=u}updateScaledDistance(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance}updateDistance(e,t){this.distance+=e.dist(t),this.updateScaledDistance()}hasLineDasharray(e){for(let t of e){let e=t.paint.get("line-dasharray");if(e&&!e.isConstant())return!0}return!1}addLineDashDependencies(e,t,r,n){for(let i of e){let e=i.paint.get("line-dasharray");if(!e||"constant"===e.value.kind)continue;let a="round"===i.layout.get("line-cap").evaluate(t,{}),s={dasharray:e.value.evaluate({zoom:r-1},t,{}),round:a},o={dasharray:e.value.evaluate({zoom:r},t,{}),round:a},l={dasharray:e.value.evaluate({zoom:r+1},t,{}),round:a},u=`${s.dasharray.join(",")},${s.round}`,h=`${o.dasharray.join(",")},${o.round}`,c=`${l.dasharray.join(",")},${l.round}`;n.dashDependencies[u]=s,n.dashDependencies[h]=o,n.dashDependencies[c]=l,t.dashes[i.id]={min:u,mid:h,max:c}}}};ak("LineBucket",uP,{omit:["layers","patternFeatures"]});var uz={get paint(){return m||=new aJ({"line-opacity":new aW(tQ.paint_line["line-opacity"],"line-opacity"),"line-layer-opacity":new aX(tQ.paint_line["line-layer-opacity"],"line-layer-opacity"),"line-color":new aW(tQ.paint_line["line-color"],"line-color"),"line-translate":new aX(tQ.paint_line["line-translate"],"line-translate"),"line-translate-anchor":new aX(tQ.paint_line["line-translate-anchor"],"line-translate-anchor"),"line-width":new aW(tQ.paint_line["line-width"],"line-width"),"line-gap-width":new aW(tQ.paint_line["line-gap-width"],"line-gap-width"),"line-offset":new aW(tQ.paint_line["line-offset"],"line-offset"),"line-blur":new aW(tQ.paint_line["line-blur"],"line-blur"),"line-dasharray":new aZ(tQ.paint_line["line-dasharray"],"line-dasharray"),"line-pattern":new aZ(tQ.paint_line["line-pattern"],"line-pattern"),"line-gradient":new aK(tQ.paint_line["line-gradient"],"line-gradient")})},get layout(){return y||=new aJ({"line-cap":new aW(tQ.layout_line["line-cap"],"line-cap"),"line-join":new aW(tQ.layout_line["line-join"],"line-join"),"line-miter-limit":new aW(tQ.layout_line["line-miter-limit"],"line-miter-limit"),"line-round-limit":new aW(tQ.layout_line["line-round-limit"],"line-round-limit"),"line-sort-key":new aW(tQ.layout_line["line-sort-key"],"line-sort-key")})}},uL=class extends aW{possiblyEvaluate(e,t){return t=new az(Math.floor(t.zoom),{now:t.now,fadeDuration:t.fadeDuration,zoomHistory:t.zoomHistory,transition:t.transition}),super.possiblyEvaluate(e,t)}evaluate(e,t,r,n){return t=e6({},t,{zoom:Math.floor(t.zoom)}),super.evaluate(e,t,r,n)}};let uV=e=>"line"===e.type;var uR=class extends a0{constructor(e,t){super(e,uz,t),this.gradientVersion=0,g||((g=new uL(uz.paint.properties["line-width"].specification,"line-floorwidth")).useIntegerZoom=!0)}_handleSpecialPaintPropertyUpdate(e){if("line-gradient"===e){let e=this.gradientExpression();this.stepInterpolant=void 0!==e._styleExpression&&e._styleExpression.expression instanceof r0,this.gradientVersion=(this.gradientVersion+1)%(0x20000000000000-1)}}gradientExpression(){return this._transitionablePaint._values["line-gradient"].value.expression}recalculate(e,t){super.recalculate(e,t),this.paint._values["line-floorwidth"]=g.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,e)}createBucket(e){return new uP(e)}queryRadius(e){var t,r;return t=oR("line-width",this,e),((r=oR("line-gap-width",this,e))>0?r+2*t:t)/2+Math.abs(oR("line-offset",this,e))+oO(this.paint.get("line-translate"))}queryIntersectsFeature({queryGeometry:e,feature:t,featureState:r,geometry:n,transform:i,pixelsToTileUnits:a}){var s,o;let l=o$(e,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),-i.bearingInRadians,a),u=a/2*(s=this.paint.get("line-width").evaluate(t,r),(o=this.paint.get("line-gap-width").evaluate(t,r))>0?o+2*s:s),h=this.paint.get("line-offset").evaluate(t,r);return h&&(n=function(e,t){let r=[];for(let n of e){let e=function(e){let t=[];for(let r=0;r<e.length;r++){let n=e[r],i=t.at(-1);
2(0===r||i&&!n.equals(i))&&t.push(n)}return t}(n),i=[];for(let r=0;r<e.length;r++){let n=e[r],a=e[r-1],s=e[r+1],o=0===r?new C(0,0):n.sub(a)._unit()._perp(),l=r===e.length-1?new C(0,0):s.sub(n)._unit()._perp(),u=o._add(l)._unit(),h=u.x*l.x+u.y*l.y;0!==h&&u._mult(1/h),i.push(u._mult(t)._add(n))}r.push(i)}return r}(n,h*a)),function(e,t,r){for(let n of t){if(e.length>=3){for(let t of n)if(oV(e,t))return!0}if(function(e,t,r){if(e.length>1){if(oM(e,t))return!0;for(let n of t)if(oP(n,e,r))return!0}for(let n of e)if(oP(n,t,r))return!0;return!1}(e,n,r))return!0}return!1}(l,n,u)}isTileClipped(){return!0}};let uO=a7([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"},{name:"a_height_offset",components:1,type:"Float32"}],4),u$=a7([{name:"a_projected_pos",components:3,type:"Float32"}],4);a7([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);let uN=a7([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"},{name:"a_box_real",components:2,type:"Int16"}]);a7([{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"}]);let uU=a7([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),uq=a7([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);a7([{name:"triangle",components:3,type:"Uint16"}]),a7([{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"},{type:"Float32",name:"heightOffset"}]),a7([{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"},{type:"Float32",name:"heightOffset"}]),a7([{type:"Float32",name:"offsetX"}]),a7([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]),a7([{type:"Uint16",name:"textAnchor"},{type:"Float32",components:2,name:"textOffset"}]);let uj=new class{constructor(){this.TIMEOUT=5e3,this.applyArabicShaping=null,this.processBidirectionalText=null,this.processStyledBidirectionalText=null,this.pluginStatus="unavailable",this.pluginURL=null,this.loadScriptResolve=()=>{}}setState(e){this.pluginStatus=e.pluginStatus,this.pluginURL=e.pluginURL}getState(){return{pluginStatus:this.pluginStatus,pluginURL:this.pluginURL}}setMethods(e){if(uj.isParsed())throw Error("RTL text plugin already registered.");this.applyArabicShaping=e.applyArabicShaping,this.processBidirectionalText=e.processBidirectionalText,this.processStyledBidirectionalText=e.processStyledBidirectionalText,this.loadScriptResolve()}isParsed(){return null!=this.applyArabicShaping&&null!=this.processBidirectionalText&&null!=this.processStyledBidirectionalText}getRTLTextPluginStatus(){return this.pluginStatus}
2async syncState(e,t){if(this.isParsed())return this.getState();if("loading"!==e.pluginStatus)return this.setState(e),e;let r=e.pluginURL,n=new Promise(e=>{this.loadScriptResolve=e}),i=new Promise(e=>setTimeout(()=>e(),this.TIMEOUT));if(await t(r),await Promise.race([n,i]),this.isParsed()){let e={pluginStatus:"loaded",pluginURL:r};return this.setState(e),e}throw this.setState({pluginStatus:"error",pluginURL:""}),Error(`RTL Text Plugin failed to import scripts from ${r}`)}};function uG(e){return/[\u02EA\u02EB\u1100-\u11FF\u2E80-\u2FDF\u3000-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u4DBF\u4E00-\uA48C\uA490-\uA4C6\uA960-\uA97C\uAC00-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFE10-\uFE1F\uFE30-\uFE4F\uFF00-\uFFEF]|\uD81B[\uDFE0-\uDFFF]|[\uD81C-\uD822\uD840-\uD868\uD86A-\uD86D\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD88C][\uDC00-\uDFFF]|\uD823[\uDC00-\uDCD5\uDCFF-\uDD1E\uDD80-\uDDF2]|\uD82B[\uDFF0-\uDFFF]|\uD82C[\uDC00-\uDEFB]|\uD83C[\uDE00-\uDEFF]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEAD\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0\uDFF0-\uDFFF]|\uD87B[\uDC00-\uDE5D]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD88D[\uDC00-\uDC79]/gim.test(String.fromCodePoint(e))}function uY(e){return/[\u02EA\u02EB\u1100-\u11FF\u1401-\u167F\u18B0-\u18FF\u2065\u20DD-\u20E0\u20E2-\u20E4\u2B97\u2BF0-\u2BFF\u2E50\u2E51\u2E80-\u3007\u3012\u3013\u3020-\u302F\u3031-\u30FB\u30FD-\uA4CF\uA960-\uA97F\uAC00-\uD7FF\uF900-\uFAFF\uFE10-\uFE1F\uFE30-\uFE48\uFE50-\uFE57\uFE5F-\uFE62\uFE67-\uFE6F\uFF00-\uFF07\uFF0A-\uFF0C\uFF0E-\uFF19\uFF1F-\uFF3A\uFF3C\uFF3E\uFF40-\uFF5A\uFFE0-\uFFE2\uFFE4-\uFFE7\uFFF0-\uFFF8]|\uD802[\uDD80-\uDD9F]|\uD805[\uDD80-\uDDFF]|\uD806[\uDE00-\uDEBF]|[\uD80C-\uD810\uD81C-\uD822\uD83C\uD83D\uD840-\uD87E\uD880-\uD8BE][\uDC00-\uDFFF]|\uD811[\uDC00-\uDE7F]|\uD81B[\uDFE0-\uDFFF]|\uD823[\uDC00-\uDDFF]|\uD82B[\uDFF0-\uDFFF]|\uD82C[\uDC00-\uDEFF]|\uD833[\uDEC0-\uDFCF]|\uD834[\uDC00-\uDDFF\uDEE0-\uDF7F]|\uD836[\uDC00-\uDEAF]|\uD83E[\uDD00-\uDEFF]|[\uD87F\uD8BF][\uDC00-\uDFFD]/gim.test(String.fromCodePoint(e))}function uX(e){return/[\u0E01-\u0E3A\u0E40-\u0E4E\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECE\u0EDC-\u0EDF\u0F00-\u0F47\u0F49-\u0F6C\u0F71-\u0F97\u0F99-\u0FBC\u0FBE-\u0FCC\u0FCE-\u0FD4\u0FD9\u0FDA\u1000-\u103F\u1050-\u108F\u109A-\u109F\u1780-\u17D3\u17D7\u17DC\u17DD\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19DE\u19DF\u1A20-\u1A5E\u1A60-\u1A7C\u1AA0-\u1AAD\u1B00-\u1B4C\u1B4E-\u1B7F\uA980-\uA9CD\uA9D0-\uA9D9\uA9DE-\uA9EF\uA9FA-\uA9FE\uAA60-\uAAC2\uAADB-\uAADF]|\uD805[\uDF00-\uDF1A\uDF1D-\uDF2B\uDF3A\uDF3B\uDF3F-\uDF46]/gim.test(String.fromCodePoint(e))}let uW={1569:[65152,0,0,0],1570:[65153,65154,0,0],1571:[65155,65156,0,0],1572:[65157,65158,0,0],1573:[65159,65160,0,0],1574:[65161,65162,65163,65164],1575:[65165,65166,0,0],1576:[65167,65168,65169,65170],1577:[65171,65172,0,0],1578:[65173,65174,65175,65176],1579:[65177,65178,65179,65180],1580:[65181,65182,65183,65184],1581:[65185,65186,65187,65188],1582:[65189,65190,65191,65192],1583:[65193,65194,0,0],1584:[65195,65196,0,0],1585:[65197,65198,0,0],1586:[65199,65200,0,0],1587:[65201,65202,65203,65204],1588:[65205,65206,65207,65208],1589:[65209,65210,65211,65212],1590:[65213,65214,65215,65216],1591:[65217,65218,65219,65220],1592:[65221,65222,65223,65224],1593:[65225,65226,65227,65228],1594:[65229,65230,65231,65232],1601:[65233,65234,65235,65236],1602:[65237,65238,65239,65240],1603:[65241,65242,65243,65244],1604:[65245,65246,65247,65248],1605:[65249,65250,65251,65252],1606:[65253,65254,65255,65256],1607:[65257,65258,65259,65260],1608:[65261,65262,0,0],1609:[65263,65264,64488,64489],1610:[65265,65266,65267,65268],1611:[65136,0,0,65137],1612:[65138,0,0,0],1613:[65140,0,0,0],1614:[65142,0,0,65143],1615:[65144,0,0,65145],1616:[65146,0,0,65147],1617:[65148,0,0,65149],1618:[65150,0,0,65151],1649:[64336,64337,0,0],1655:[64477,0,0,0],1657:[64358,64359,64360,64361],1658:[64350,64351,64352,64353],1659:[64338,64339,64340,64341],1662:[64342,64343,64344,64345],1663:[64354,64355,64356,64357],1664:[64346,64347,64348,64349],1667:[64374,64375,64376,6437
27],1668:[64370,64371,64372,64373],1670:[64378,64379,64380,64381],1671:[64382,64383,64384,64385],1672:[64392,64393,0,0],1676:[64388,64389,0,0],1677:[64386,64387,0,0],1678:[64390,64391,0,0],1681:[64396,64397,0,0],1688:[64394,64395,0,0],1700:[64362,64363,64364,64365],1702:[64366,64367,64368,64369],1705:[64398,64399,64400,64401],1709:[64467,64468,64469,64470],1711:[64402,64403,64404,64405],1713:[64410,64411,64412,64413],1715:[64406,64407,64408,64409],1722:[64414,64415,0,0],1723:[64416,64417,64418,64419],1726:[64426,64427,64428,64429],1728:[64420,64421,0,0],1729:[64422,64423,64424,64425],1733:[64480,64481,0,0],1734:[64473,64474,0,0],1735:[64471,64472,0,0],1736:[64475,64476,0,0],1737:[64482,64483,0,0],1739:[64478,64479,0,0],1740:[64508,64509,64510,64511],1744:[64484,64485,64486,64487],1746:[64430,64431,0,0],1747:[64432,64433,0,0]},uZ={ÙØ¢:[65269,65270],ÙØ£:[65271,65272],ÙØ¥:[65273,65274],ÙØ§:[65275,65276]},uH=/[\u0600-\u06ff\u0750-\u077f\u0870-\u089f\u08a0-\u08ff\ufb50-\ufdff\ufe70-\ufeff]/,uK=new Map;for(let[e,t]of Object.entries({C:"18g,1;g2,3;4nb,1",D:"17k,1;5,1;1,1;1,5;4,d;1,7;1,2;z,2;8,g;i,12;1,2;9,1;1,1;1,2;14,3;2,1;28,9;3,f;2,4;1,1;2,3;2,6;7a,1;2,5;1,1;g,a;5,2;2,6;1,f",R:"17m,4;1,1;1,1;5,4;l,1;14,3;1,3;g,i;12,1;2,9;1,1;1,1;2,2;1,1;o,2;2x,3;f,2;4,1;1,2;3,2;6u,j;b,1;r,3;1,1;2,2;6,1",T:"174,b;1,1;1a,l;g,1;2t,7;2,6;2,2;1,4;bt,9;16,o;1,t;1clb,1"}))!function(e,t,r){let n=0;for(let i of e.split(";")){let[e,a]=i.split(",").map(e=>parseInt(e,36)),s=n+e;for(let e=s;e<s+a;e++)r.set(e,t);n=s+a}}(t,e,uK);let uJ="u">typeof Intl&&"Segmenter"in Intl;function uQ(e){var t;if(!uJ||!/[\r\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0600-\u0605\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DD\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u070F\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0890\u0891\u0897-\u089F\u08CA-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CF3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D57\u0D62\u0D63\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E33-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB3-\u0EBC\u0EC8-\u0ECE\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1037\u1039-\u103E\u1056-\u1059\u105E-\u1060\u1071-\u1074\u1082\u1084-\u1086\u108D\u109D\u1100-\u11FF\u135D-\u135F\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u180F\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60\u1A62\u1A65-\u1A7C\u1A7F\u1AB0-\u1ADD\u1AE0-\u1AEB\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u200C\u200D\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA960-\uA97C\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFF9E\uFF9F]|\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD803[\uDD24-\uDD27\uDD69-\uDD6D\uDEAB\uDEAC\uDEFA-\uDEFF\uDF46-\uDF50\uDF82-\uDF85]|\uD804[\uDC00-\uDC02\uDC38-\uDC46\uDC70\uDC73\uDC74\uDC7F-\uDC82\uDCB0-\uDCBA\uDCBD\uDCC2\uDCCD\uDD00-\uDD02\uDD27-\uDD34\uDD45\uDD46\uDD73\uDD80-\uDD82\uDDB3-\uDDC0\uDDC2\uDDC3\uDDC9-\uDDCC\uDDCE\uDDCF\uDE2C-\uDE37\uDE3E\uDE41\uDEDF-\uDEEA\uDF00-\uDF03\uDF3B\uDF3C\uDF3E-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF57\uDF62\uDF63\uDF66-\uDF6C\uDF70-\uDF74\uDFB8-\uDFC0\uDFC2\uDFC5\uDFC7-\uDFCA\uDFCC-\uDFD2\uDFE1\uDFE2]|\uD805[\uDC35-\uDC46\uDC5E\uDCB0-\uDCC3\uDDAF-\uDDB5\uDDB8-\uDDC0\uDDDC\uDDDD\uDE30-\uDE4
20\uDEAB-\uDEB7\uDF1D-\uDF1F\uDF22-\uDF2B]|\uD806[\uDC2C-\uDC3A\uDD30-\uDD35\uDD37\uDD38\uDD3B-\uDD43\uDDD1-\uDDD7\uDDDA-\uDDE0\uDDE4\uDE01-\uDE0A\uDE33-\uDE39\uDE3B-\uDE3E\uDE47\uDE51-\uDE5B\uDE84-\uDE99\uDF60-\uDF67]|\uD807[\uDC2F-\uDC36\uDC38-\uDC3F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD31-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD8A-\uDD8E\uDD90\uDD91\uDD93-\uDD97\uDEF3-\uDEF6\uDF00-\uDF03\uDF34-\uDF3A\uDF3E-\uDF42\uDF5A]|\uD80D[\uDC40\uDC47-\uDC55]|\uD818[\uDD1E-\uDD2F]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDD63\uDD67-\uDD6A\uDF4F\uDF51-\uDF87\uDF8F-\uDF92\uDFE4\uDFF0\uDFF1]|\uD82F[\uDC9D\uDC9E]|\uD833[\uDF00-\uDF2D\uDF30-\uDF46]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A\uDC8F\uDD30-\uDD36\uDEAE\uDEEC-\uDEEF]|\uD839[\uDCEC-\uDCEF\uDDEE\uDDEF\uDEE3\uDEE6\uDEEE\uDEEF\uDEF5]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD4A]|\uD83C[\uDDE6-\uDDFF\uDFFB-\uDFFF]|\uDB40[\uDC20-\uDC7F\uDD00-\uDDEF]/.test(e))return[...e];x??=new Intl.Segmenter(void 0,{granularity:"grapheme"});let r=[];for(let{segment:n}of x.segment(e)){let e=r.length-1;e>=0&&(t=r[e],/(?:[\u1039\u17D2\u1A60\u1BAB\u200D\uAAF6]|\uD802\uDE3F|\uD804[\uDD33\uDFD0]|\uD806[\uDD3E\uDE47\uDE99]|\uD807[\uDD45\uDD97\uDF42])$/.test(t)||/^\p{gc=Mc}/u.test(n))?r[e]+=n:r.push(n)}return r}function u1(e){let t=e.codePointAt(0);return e.length>(t>65535?2:1)}function u0(e){return/\s/u.test(String.fromCodePoint(e))}function u2(e){for(let t of e)if(uY(t.codePointAt(0)))return!0;return!1}function u3(e){return!(uY(e)||/[\xA7\xA9\xAE\xB1\xBC-\xBE\xD7\xF7\u2016\u2020\u2021\u2030\u2031\u203B\u203C\u2042\u2047-\u2049\u2051\u2100-\u218F\u221E\u2234\u2235\u2300-\u2307\u230C-\u231F\u2324-\u2328\u232B\u237D-\u239A\u23BE-\u23CD\u23CF\u23D1-\u23DB\u23E2-\u2422\u2424-\u24FF\u25A0-\u2619\u2620-\u2767\u2776-\u2793\u2B12-\u2B2F\u2B50-\u2B59\u2BB8-\u2BEB\u3000-\u303F\u30A0-\u30FF\uE000-\uF8FF\uFE30-\uFE6F\uFF00-\uFFEF\uFFFC\uFFFD]|[\uDB80-\uDBFF][\uDC00-\uDFFF]/gim.test(String.fromCodePoint(e)))}function u5(e){return/\p{sc=Arab}/u.test(String.fromCodePoint(e))}function u6(e){return/[\u0591-\u05C7\u05D0-\u05EA\u05EF-\u05F4\u0600-\u0604\u0606-\u060B\u060D-\u061A\u061C-\u061E\u0620-\u063F\u0641-\u064A\u0656-\u066F\u0671-\u06DC\u06DE-\u070D\u070F-\u074A\u074D-\u07B1\u07C0-\u07FA\u07FD-\u082D\u0830-\u083E\u0840-\u085B\u085E\u0860-\u086A\u0870-\u0891\u0897-\u08E1\u08E3-\u08FF\uFB1D-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFD3D\uFD40-\uFDCF\uFDF0-\uFDFF\uFE70-\uFE74\uFE76-\uFEFC]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC57-\uDC9E\uDCA7-\uDCAF\uDCE0-\uDCF2\uDCF4\uDCF5\uDCFB-\uDD1B\uDD1F-\uDD39\uDD3F-\uDD59\uDD80-\uDDB7\uDDBC-\uDDCF\uDDD2-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE38-\uDE3A\uDE3F-\uDE48\uDE50-\uDE58\uDE60-\uDE9F\uDEC0-\uDEE6\uDEEB-\uDEF6\uDF00-\uDF35\uDF39-\uDF55\uDF58-\uDF72\uDF78-\uDF91\uDF99-\uDF9C\uDFA9-\uDFAF]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDCFA-\uDD27\uDD30-\uDD39\uDD40-\uDD65\uDD69-\uDD85\uDD8E\uDD8F\uDE60-\uDE7E\uDE80-\uDEA9\uDEAB-\uDEAD\uDEB0\uDEB1\uDEC2-\uDEC7\uDED0-\uDED8\uDEFA-\uDF27\uDF30-\uDF59\uDF70-\uDF89\uDFB0-\uDFCB\uDFE0-\uDFF6]|\uD83A[\uDC00-\uDCC4\uDCC7-\uDCD6\uDD00-\uDD4B\uDD50-\uDD59\uDD5E\uDD5F]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB\uDEF0\uDEF1]/gim.test(String.fromCodePoint(e))}function u4(e){for(let t of e)if(u6(t.codePointAt(0)))return!0;return!1}let u8={"!":`ï¸`,"#":`ï¼`,$:`ï¼`,"%":`ï¼
`,"&":`ï¼`,"(":`︵`,")":`︶`,"*":`ï¼`,"+":`ï¼`,",":`ï¸`,"-":`︲`,".":`ã»`,"/":`ï¼`,":":`ï¸`,";":`ï¸`,"<":`︿`,"=":`ï¼`,">":`ï¹`,"?":`ï¸`,"@":`ï¼ `,"[":`ï¹`,"\\":`ï¼¼`,"]":`ï¹`,"^":`ï¼¾`,_:`︳`,"`":`ï½`,"{":`︷`,"|":`â`,"}":`︸`,"~":`ï½`,"\xa2":`ï¿ `,"\xa3":`ï¿¡`,"\xa5":`ï¿¥`,"\xa6":`¦`,"\xac":`ï¿¢`,"\xaf":`ï¿£`,"â":`︲`,"â":`︱`,"â":`ï¹`,"â":`ï¹`,"â":`ï¹`,"â":`ï¹`,"â¦":`ï¸`,"â¯":`ï¸`,"â§":`ã»`,"â©":`₩`,"ã":`ï¸`,"ã":`ï¸`,"ã":`︿`,"ã":`ï¹`,"ã":`︽`,"ã":`︾`,"ã":`ï¹`,"ã":`ï¹`,"ã":`ï¹`,"ã":`ï¹`,"ã":`︻`,"ã":`︼`,"ã":`︹`,"ã":`︺`,"ã":`ï¸`,"ã":`ï¸`,"ï¼":`ï¸`,"ï¼":`︵`,"ï¼":`︶`,"ï¼":`ï¸`,"ï¼":`︲`,"ï¼":`ã»`,"ï¼":`ï¸`,"ï¼":`ï¸`,"ï¼":`︿`,"ï¼":`ï¹`,"ï¼":`ï¸`,"ï¼»":`ï¹`,"ï¼½":`ï¹`,"_":`︳`,"ï½":`︷`,"ï½":`â`,"ï½":`︸`,"ï½":`︵`,"ï½ ":`︶`,"。":`ï¸`,"ï½¢":`ï¹`,"ï½£":`ï¹`},u7={10:!0,13:!0,32:!0,38:!0,41:!0,43:!0,45:!0,47:!0,173:!0,183:!0,8203:!0,8208:!0,8211:!0,8231:!0},u9={40:!0};function he(e,t,r,n,i,a){if("fontStack"in t){let n=r[t.fontStack],a=n?.[e];if(a)return a.metrics.advance*t.scale+i;let s=0;for(let r of e){let e=n?.[r];e&&(s+=e.metrics.advance*t.scale+i)}return s}{let e=n[t.imageName];return e?e.displaySize[0]*t.scale*24/a+i:0}}function ht(e,t,r,n){let i=(e-t)**2;return n?e<t?i/2:2*i:i+Math.abs(r)*r}function hr(e){return/^\s+$/u.test(e)}function hn(e,t,r,n,i,a){let s=null,o=ht(t,r,i,a);for(let e of n){let n=ht(t-e.x,r,i,a)+e.badness;n<=o&&(s=e,o=n)}return{index:e,x:t,priorBreak:s,badness:o}}var hi=class e{constructor(e="",t=[],r=[]){this.text=e,this.sections=t,this.sectionIndex=r,this.imageSectionID=null,this._graphemes=null}graphemes(){return this._graphemes??=uQ(this.text),this._graphemes}static fromFeature(t,r){let n=new e;for(let e of t.sections)e.image?n.addImageSection(e):n.addTextSection(e,r);return n}length(){return this.graphemes().length}getSection(e){return this.sections[this.sectionIndex[e]]}getSectionIndex(e){return this.sectionIndex[e]}verticalizePunctuation(){this.text=function(e){let t="",r={premature:!0,value:void 0},n=e[Symbol.iterator](),i=n.next(),a=e[Symbol.iterator]();a.next();let s=a.next();for(;!i.done;)(s.done||!u3(s.value.codePointAt(0))||u8[s.value])&&(r.premature||!u3(r.value.codePointAt(0))||u8[r.value])&&u8[i.value]?t+=u8[i.value]:t+=i.value,r={value:i.value,premature:!1},i=n.next(),s=a.next();return t}(this.text),this._graphemes=null}hasZeroWidthSpaces(){return this.text.includes(`â`)}trim(){let e=this.graphemes(),t=0;for(;t<e.length&&hr(e[t]);)t++;let r=e.length;for(;r>t&&hr(e[r-1]);)r--;this.text=e.slice(t,r).join(""),this.sectionIndex=this.sectionIndex.slice(t,r),this._graphemes=null}substring(t,r){let n=this.graphemes().slice(t,r).join(""),i=this.sectionIndex.slice(t,r);return new e(n,this.sections,i)}toCodeUnitIndex(e){return this.graphemes().slice(0,e).join("").length}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce((e,t)=>
2Math.max(e,this.sections[t].scale),0)}getMaxImageSize(e){let t=0,r=0;for(let n=0;n<this.length();n++){let i=this.getSection(n);if("imageName"in i){let n=e[i.imageName];if(!n)continue;let a=n.displaySize;t=Math.max(t,a[0]),r=Math.max(r,a[1])}}return{maxImageWidth:t,maxImageHeight:r}}_appendSection(e,t){let r=this.graphemes(),n=r.length>0?r[r.length-1]:"",i=uQ(n+e);this.text+=e,this._graphemes=r.slice(0,n?-1:void 0).concat(i);let a=i.length-!!n;for(let e=0;e<a;e++)this.sectionIndex.push(t)}addTextSection(e,t){this.sections.push({scale:e.scale||1,verticalAlign:e.verticalAlign||"bottom",fontStack:e.fontStack||t}),this._appendSection(e.text,this.sections.length-1)}addImageSection(e){let t=e.image?e.image.name:"";if(0===t.length)return void to("Can't add FormattedSection with an empty image.");let r=this.getNextImageSectionCharCode();if(!r)return void to("Reached maximum number of images 6401");this.sections.push({scale:1,verticalAlign:e.verticalAlign||"bottom",imageName:t}),this._appendSection(String.fromCharCode(r),this.sections.length-1)}getNextImageSectionCharCode(){return this.imageSectionID?this.imageSectionID>=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}determineLineBreaks(e,t,r,n,i){let a=[],s=this.determineAverageLineWidth(e,t,r,n,i),o=this.hasZeroWidthSpaces(),l=this.graphemes(),u=null,h=0,c=0;for(let t=0;t<l.length;t++){let p=l[t];if(t>0){let e=l[t-1].codePointAt(0),r=p.codePointAt(0),n=/[\u02EA\u02EB\u2E80-\u2FDF\u2FF0-\u303F\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FD-\u30FF\u3105-\u312F\u31A0-\u4DBF\u4E00-\uA48C\uA490-\uA4C6\uF900-\uFA6D\uFA70-\uFAD9\uFE10-\uFE1F\uFE30-\uFE4F\uFF00-\uFFEF]|\uD81B[\uDFE0-\uDFFF]|[\uD81C-\uD822\uD840-\uD868\uD86A-\uD86D\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD88C][\uDC00-\uDFFF]|\uD823[\uDC00-\uDCD5\uDCFF-\uDD1E\uDD80-\uDDF2]|\uD82B[\uDFF0-\uDFFF]|\uD82C[\uDC00-\uDEFB]|\uD83C[\uDE00-\uDEFF]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEAD\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0\uDFF0-\uDFFF]|\uD87B[\uDC00-\uDE5D]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD88D[\uDC00-\uDC79]/gim.test(String.fromCodePoint(e)),i=uX(e)&&uX(r);(u7[e]||n||"imageName"in this.getSection(t-1)||void 0!==l[t+1]&&u9[r]||i&&(u??=function(e){let t=new Set;if(uJ){for(let{index:r}of(v??=new Intl.Segmenter(void 0,{granularity:"word"})).segment(e))t.add(r);return t}let r=0;for(let n of e.split(/\b|(?=\p{Ideo})/u))t.add(r),r+=n.length;return t}(this.text)).has(c))&&a.push(hn(t,h,s,a,function(e,t,r){let n=0;return(10===e||13===e)&&(n-=1e4),r&&(n+=150),(40===e||65288===e)&&(n+=50),(41===t||65289===t)&&(n+=50),n}(e,r,n&&o),!1))}u0(p.codePointAt(0))||(h+=he(p,this.getSection(t),r,n,e,i)),c+=p.length}return function e(t){return t?e(t.priorBreak).concat(t.index):[]}(hn(this.length(),h,s,a,0,!0))}determineAverageLineWidth(e,t,r,n,i){let a=0,s=0;for(let t of this.graphemes())a+=he(t,this.getSection(s),r,n,e,i),s++;let o=Math.max(1,Math.ceil(a/t));return a/o}};let ha=function(e){var t,r,n,i,a={R:"13k,1a,2,3,3,2+1j,ch+16,a+1,5+2,2+n,5,a,4,6+16,4+3,h+1b,4mo,179q,2+9,2+11,2i9+7y,2+68,4,3+4,5+13,4+3,2+4k,3+29,8+cf,1t+7z,w+17,3+3m,1t+3z,16o1+5r,8+30,8+mc,29+1r,29+4v,75+73",EN:"1c+9,3d+1,6,187+9,513,4+5,7+9,sf+j,175h+9,qw+q,161f+1d,4xt+a,25i+9",ES:"17,2,6dp+1,f+1,av,16vr,mx+1,4o,2",ET:"z+2,3h+3,b+1,ym,3e+1,2o,p4+1,8,6u,7c,g6,1wc,1n9+4,30+1b,2n,6d,qhx+1,h0m,a+1,49+2,63+1,4+1,6bb+3,12jj",AN:"16o+5,2j+9,2+1,35,ed,1ff2+9,87+u",CS:"18,2+1,b,2u,12k,55v,l,17v0,2,3,53,2+1,b",B:"a,3,f+2,2v,690",S:"9,2,k",WS:"c,k,4f4,1vk+a,u,1j,335",ON:"x+1,4+4,h+5,r+5,r+3,z,5+3,2+1,2+1,5,2+2,3+4,o,w,ci+1,8+d,3+d,6+8,2+g,39+1,9,6+1,2,33,b8,3+1,3c+1,7+1,5r,b,7h+3,sa+5,2,3i+6,jg+3,ur+9,2v,ij+1,9g+9,7+a,8m,4+1,49+x,14u,2+2,c+2,e+2,e+2,e+1,i+n,e+e,2+p,u+2,e+2,36+1,2+3,2+1,b,2+2,6+5,2,2,2,h+1,5+4,6+3,3+f,16+2,5+3l,3+81,1y+p,2+40,q+a,m+13,2r+ch,2+9e,75+hf,3+v,2+2w,6e+5,f+6,75+2a,1a+p,2+2g,d+5x,r+b,6+3,4+o,g,6+1,6+2,2k+1,4,2j,5h+z,1m+1,1e+f,t+2,1f+e,d+3,4o+3,2s+1,w,535+1r,h3l+1i,93+2,2s,b+1,3l+x,2v,4g+3,21+3,kz+1,g5v+1,5a,j+9,n+v,2,3,2+8,2+1,3+2,2,3,46+1,4+4,h+5,r+5,r+a,3h+2,4+6,b+4,78,1r+24,4+c,4,1hb,ey+6,103+j,16j+c,1ux+7,5+g,fsh,jdq+1t,4,57+2e,p1,1m,1m,1m,1m,4kt+1,7j+17,5+2r,d+e,3+e,2+e,2+10,m+4,w,1n+5,1q,4z+5,4b+rb,9+c,4+c,4+37,d+2g,8+b,l+b,5+1j,9+9,7+13,9+t,3+1,27+3c,2+29,2+3q,d+d,3+4,4+2,6+6,a+o,8+6,a+2,e+6,16+42,2+1i",BN:"0+8,6+d,2s+5,2+p,e,4m9,1kt+2,2b+5,5+5,17q9+v,7k,6p+8,6+1,
2119d+3,440+7,96s+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+75,6p+2rz,1ben+1,1ekf+1,1ekf+1",NSM:"lc+33,7o+6,7c+18,2,2+1,2+1,2,21+a,1d+k,h,2u+6,3+5,3+1,2+3,10,v+q,2k+a,1n+8,a,p+3,2+8,2+2,2+4,18+2,3c+e,2+v,1k,2,5+7,5,4+6,b+1,u,1n,5+3,9,l+1,r,3+1,1m,5+1,5+1,3+2,4,v+1,4,c+1,1m,5+4,2+1,5,l+1,n+5,2,1n,3,2+3,9,8+1,c+1,v,1q,d,1f,4,1m+2,6+2,2+3,8+1,c+1,u,1n,g+1,l+1,t+1,1m+1,5+3,9,l+1,u,21,8+2,2,2j,3+6,d+7,2r,3+8,c+5,23+1,s,2,2,1k+d,2+4,2+1,6+a,2+z,a,2v+3,2+5,2+1,3+1,q+1,5+2,h+3,e,3+1,7,g,jk+2,qb+2,u+2,u+1,v+1,1t+1,2+6,9,3+a,a,1a+2,3c+1,z,3b+2,5+1,a,7+2,64+1,3,1n,2+6,2,2,3+7,7+9,3,1d+g,1s+3,1d,2+4,2,6,15+8,d+1,x+3,3+1,2+2,1l,2+1,4,2+2,1n+7,3+1,49+2,2+c,2+6,5,7,4+1,5j+1l,2+4,k1+w,2db+2,3y,2p+v,ff+3,30+1,n9x+3,2+9,x+1,29+1,7l,4,5,q+1,6,48+1,r+h,e,13+7,q+a,1b+2,1d,3+3,3+1,14,1w+5,3+1,3+1,d,9,1c,1g,2+2,3+1,6+1,2,17+1,9,6n,3,5,fn5,ki+f,h+f,r2,6b,46+4,1af+2,2+1,6+3,15+2,5,4m+1,fy+3,as+1,4a+a,4x,1j+e,1l+2,1e+3,3+1,1y+2,11+4,2+7,1r,d+1,1h+8,b+3,3,2o+2,3,2+1,7,4h,4+7,m+1,1m+1,4,12+6,4+4,5g+7,3+2,2,o,2d+5,2,5+1,2+1,6n+3,7+1,2+1,s+1,2e+7,3,2+1,2z,2,3+5,2,2u+2,3+3,2+4,78+8,2+1,75+1,2,5,41+3,3+1,5,x+5,3+1,15+5,3+3,9,a+5,3+2,1b+c,2+1,bb+6,2+5,2d+l,3+6,2+1,2+1,3f+5,4,2+1,2+6,2,21+1,4,2,9o+1,f0c+4,1o+6,t5,1s+3,2a,f5l+1,43t+2,i+7,3+6,v+3,45+2,1j0+1i,5+1d,9,f,n+4,2+e,11t+6,2+g,3+6,2+1,2+4,7a+6,c6+3,15t+6,32+6,gzhy+6n",AL:"16w,3,2,e+1b,z+2,2+2s,g+1,8+1,b+m,2+t,s+2i,c+e,4h+f,1d+1e,1bwe+dp,3+3z,x+c,2+1,35+3y,2rm+z,5+7,b+5,dt+l,c+u,17nl+27,1t+27,4x+6n,3+d",LRO:"6ct",RLO:"6cu",LRE:"6cq",RLE:"6cr",PDF:"6cs",LRI:"6ee",RLI:"6ef",FSI:"6eg",PDI:"6eh"},s={},o={};s.L=1,o[1]="L",Object.keys(a).forEach(function(e,t){s[e]=1<<t+1,o[s[e]]=e}),Object.freeze(s);var l=s.LRI|s.RLI|s.FSI,u=s.L|s.R|s.AL,h=s.B|s.S|s.WS|s.ON|s.FSI|s.LRI|s.RLI|s.PDI,c=s.BN|s.RLE|s.LRE|s.RLO|s.LRO|s.PDF,p=s.S|s.WS|s.B|l|s.PDI|c,f=null;function d(e){return function(){if(!f){f=new Map;var e=0;for(var t in a)if(a.hasOwnProperty(t))for(var r=a[t],n="",i=void 0,o=!1,l=0,u=0;u<=r.length+1;u+=1){var h=r[u];if(","!==h&&u!==r.length)"+"===h?(o=!0,l=e=l+parseInt(n,36),n=""):n+=h;else{o?i=e+parseInt(n,36):(l=e=l+parseInt(n,36),i=e),o=!1,n="",l=i;for(var c=e;c<i+1;c+=1)f.set(c,s[t])}}}}(),f.get(e.codePointAt(0))||s.L}function y(e,t){var r,n=0,i=new Map,a=t&&new Map;return e.split(",").forEach(function e(s){if(-1!==s.indexOf("+"))for(var o=+s;o--;)e(r);else{r=s;var l=s.split(">"),u=l[0],h=l[1];u=String.fromCodePoint(n+=parseInt(u,36)),h=String.fromCodePoint(n+=parseInt(h,36)),i.set(u,h),t&&a.set(h,u)}}),{map:i,reverseMap:a}}function m(){if(!t){var e=y("14>1,1e>2,u>2,2wt>1,1>1,1ge>1,1wp>1,1j>1,f>1,hm>1,1>1,u>1,u6>1,1>1,+5,28>1,w>1,1>1,+3,b8>1,1>1,+3,1>3,-1>-1,3>1,1>1,+2,1s>1,1>1,x>1,th>1,1>1,+2,db>1,1>1,+3,3>1,1>1,+2,14qm>1,1>1,+1,4q>1,1e>2,u>2,2>1,+1",!0),i=e.map,a=e.reverseMap;t=i,r=a,n=y("6f1>-6dx,6dy>-6dx,6ec>-6ed,6ee>-6ed,6ww>2jj,-2ji>2jj,14r4>-1e7l,1e7m>-1e7l,1e7m>-1e5c,1e5d>-1e5b,1e5c>-14qx,14qy>-14qx,14vn>-1ecg,1ech>-1ecg,1edu>-1ecg,1eci>-1ecg,1eda>-1ecg,1eci>-1ecg,1eci>-168q,168r>-168q,168s>-14ye,14yf>-14ye",!1).map}}function g(e){return m(),t.get(e)||null}function x(e){return m(),r.get(e)||null}function v(e){return m(),n.get(e)||null}var b=s.L,w=s.R,D=s.EN,_=s.ES,A=s.ET,E=s.AN,S=s.CS,F=s.B,k=s.S,T=s.ON,I=s.BN,C=s.NSM,B=s.AL,M=s.LRO,P=s.RLO,z=s.LRE,L=s.RLE,V=s.PDF,R=s.LRI,O=s.RLI,$=s.FSI,N=s.PDI;function U(e){return function(){if(!i){var e=y("14>1,j>2,t>2,u>2,1a>g,2v3>
21,1>1,1ge>1,1wd>1,b>1,1j>1,f>1,ai>3,-2>3,+1,8>1k0,-1jq>1y7,-1y6>1hf,-1he>1h6,-1h5>1ha,-1h8>1qi,-1pu>1,6>3u,-3s>7,6>1,1>1,f>1,1>1,+2,3>1,1>1,+13,4>1,1>1,6>1eo,-1ee>1,3>1mg,-1me>1mk,-1mj>1mi,-1mg>1mi,-1md>1,1>1,+2,1>10k,-103>1,1>1,4>1,5>1,1>1,+10,3>1,1>8,-7>8,+1,-6>7,+1,a>1,1>1,u>1,u6>1,1>1,+5,26>1,1>1,2>1,2>2,8>1,7>1,4>1,1>1,+5,b8>1,1>1,+3,1>3,-2>1,2>1,1>1,+2,c>1,3>1,1>1,+2,h>1,3>1,a>1,1>1,2>1,3>1,1>1,d>1,f>1,3>1,1a>1,1>1,6>1,7>1,13>1,k>1,1>1,+19,4>1,1>1,+2,2>1,1>1,+18,m>1,a>1,1>1,lk>1,1>1,4>1,2>1,f>1,3>1,1>1,+3,db>1,1>1,+3,3>1,1>1,+2,14qm>1,1>1,+1,6>1,4j>1,j>2,t>2,u>2,2>1,+1",!0),t=e.map;e.reverseMap.forEach(function(e,r){t.set(r,e)}),i=t}}(),i.get(e)||null}function q(e,t,r,n){var i=e.length;r=Math.max(0,null==r?0:+r),n=Math.min(i-1,null==n?i-1:+n);var a=[];return t.paragraphs.forEach(function(i){var s=Math.max(r,i.start),o=Math.min(n,i.end);if(s<o){for(var l=t.levels.slice(s,o+1),u=o;u>=s&&d(e[u])&p;u--)l[u]=i.level;for(var h=i.level,c=1/0,f=0;f<l.length;f++){var y=l[f];y>h&&(h=y),y<c&&(c=1|y)}for(var m=h;m>=c;m--)for(var g=0;g<l.length;g++)if(l[g]>=m){for(var x=g;g+1<l.length&&l[g+1]>=m;)g++;g>x&&a.push([x+s,g+s])}}}),a}function j(e,t,r,n){for(var i=q(e,t,r,n),a=[],s=0;s<e.length;s++)a[s]=s;return i.forEach(function(e){for(var t=e[0],r=e[1],n=a.slice(t,r+1),i=n.length;i--;)a[r-i]=n[i]}),a}return e.closingToOpeningBracket=x,e.getBidiCharType=d,e.getBidiCharTypeName=function(e){return o[d(e)]},e.getCanonicalBracket=v,e.getEmbeddingLevels=function(e,t){for(var r=new Uint32Array(e.length),n=0;n<e.length;n++)r[n]=d(e[n]);var i=new Map;function a(e,t){var n=r[e];r[e]=t,i.set(n,i.get(n)-1),n&h&&i.set(h,i.get(h)-1),i.set(t,(i.get(t)||0)+1),t&h&&i.set(h,(i.get(h)||0)+1)}for(var s=new Uint8Array(e.length),o=new Map,f=[],y=null,m=0;m<e.length;m++)y||f.push(y={start:m,end:e.length-1,level:"rtl"===t?1:"ltr"===t?0:tI(m,!1)}),r[m]&F&&(y.end=m,y=null);for(var U=L|z|P|M|l|N|V|F,q=function(e){return e+(1&e?1:2)},j=function(e){return e+(1&e?2:1)},G=0;G<f.length;G++){var Y=[{_level:(y=f[G]).level,_override:0,_isolate:0}],X=void 0,W=0,Z=0,H=0;i.clear();for(var K=y.start;K<=y.end;K++){var J=r[K];if(X=Y[Y.length-1],i.set(J,(i.get(J)||0)+1),J&h&&i.set(h,(i.get(h)||0)+1),J&U)if(J&(L|z)){s[K]=X._level;var Q=(J===L?j:q)(X._level);!(Q<=125)||W||Z?W||Z++:Y.push({_level:Q,_override:0,_isolate:0})}else if(J&(P|M)){s[K]=X._level;var ee=(J===P?j:q)(X._level);!(ee<=125)||W||Z?W||Z++:Y.push({_level:ee,_override:J&P?w:b,_isolate:0})}else if(J&l){J&$&&(J=1===tI(K+1,!0)?O:R),s[K]=X._level,X._override&&a(K,X._override);var et=(J===O?j:q)(X._level);et<=125&&0===W&&0===Z?(H++,Y.push({_level:et,_override:0,_isolate:1,_isolInitIndex:K})):W++}else if(J&N){if(W>0)W--;else if(H>0){for(Z=0;!Y[Y.length-1]._isolate;)Y.pop();var er=Y[Y.length-1]._isolInitIndex;null!=er&&(o.set(er,K),o.set(K,er)),Y.pop(),H--}X=Y[Y.length-1],s[K]=X._level,X._override&&a(K,X._override)}else J&V?(0===W&&(Z>0?Z--:!X._isolate&&Y.length>1&&(Y.pop(),X=Y[Y.length-1])),s[K]=X._level):J&F&&(s[K]=y.level);else s[K]=X._level,X._override&&J!==I&&a(K,X._override)}for(var en=[],ei=null,ea=y.start;ea<=y.end;ea++){var es=r[ea];if(!(es&c)){var eo=s[ea],el=es&l,eu=es===N;ei&&eo===ei._level?(ei._end=ea,ei._endsWithIsolInit=el):en.push(ei={_start:ea,_end:ea,_level:eo,_startsWithPDI:eu,_endsWithIsolInit:el})}}for(var eh=[],ec=0;ec<en.length;ec++){var ep=en[ec];if(!ep._startsWithPDI||ep._startsWithPDI&&!o.has(ep._start)){for(var ef=[ei=ep],ed=void 0;ei&&ei._endsWithIsolInit&&null!=(ed=o.get(ei._end));)for(var ey=ec+1;ey<en.length;ey++)if(en[ey]._start===ed){ef.push(ei=en[ey]);break}for(var em=[],eg=0;eg<ef.length;eg++)for(var ex=ef[eg],ev=ex._start;ev<=ex._end;ev++)em.push(ev);for(var eb=s[em[0]],ew=y.level,eD=em[0]-1;eD>=0;eD--)if(!(r[eD]&c)){ew=s[eD];break}var e_=em[em.length-1],eA=s[e_],eE=y.level;if(!(r[e_]&l)){for(var eS=e_+1;eS<=y.end;eS++)if(!(r[eS]&c)){eE=s[eS];break}}eh.push({_seqIndices:em,_sosType:Math.max(ew,eb)%2?w:b,_eosType:Math.max(eE,eA)%2?w:b})}}for(var eF=0;eF<eh.length;eF++){var ek=eh[eF],eT=ek._seqIndices,eI=ek._sosType,eC=ek._eosType,eB=1&s[eT[0]]?w:b;if(i.get(C))for(var eM=0;eM<eT.length;eM++){var eP=eT[eM];if(r[eP]&C){for(var ez=eI,eL=eM-1;eL>=0;eL--)if(!(r[eT[eL]]&c)){ez=r[eT[eL]];break}a(eP,ez&(l|N)?T:ez)}}if(i.get(D))for(var eV=0;eV<eT.length;eV++){var eR=eT[eV];if(r[eR]&D)for(var eO=eV-1;eO>=-1;eO--){var e$=-1===eO?eI:r[eT[eO]];if(e$&u){e$===B&&a(eR,E);break}}}if(i.get(B))for(var eN=0;eN<eT.length;eN++){var eU=eT[eN];r[eU]&B&&a(eU,w)}if(i.get(_)||i.get(S))for(var eq=1;eq<eT.length-1;eq++){var ej=eT[eq];
2if(r[ej]&(_|S)){for(var eG=0,eY=0,eX=eq-1;eX>=0&&(eG=r[eT[eX]])&c;eX--);for(var eW=eq+1;eW<eT.length&&(eY=r[eT[eW]])&c;eW++);eG===eY&&(r[ej]===_?eG===D:eG&(D|E))&&a(ej,eG)}}if(i.get(D)){for(var eZ=0;eZ<eT.length;eZ++)if(r[eT[eZ]]&D){for(var eH=eZ-1;eH>=0&&r[eT[eH]]&(A|c);eH--)a(eT[eH],D);for(eZ++;eZ<eT.length&&r[eT[eZ]]&(A|c|D);eZ++)r[eT[eZ]]!==D&&a(eT[eZ],D)}}if(i.get(A)||i.get(_)||i.get(S))for(var eK=0;eK<eT.length;eK++){var eJ=eT[eK];if(r[eJ]&(A|_|S)){a(eJ,T);for(var eQ=eK-1;eQ>=0&&r[eT[eQ]]&c;eQ--)a(eT[eQ],T);for(var e1=eK+1;e1<eT.length&&r[eT[e1]]&c;e1++)a(eT[e1],T)}}if(i.get(D))for(var e0=0,e2=eI;e0<eT.length;e0++){var e3=eT[e0],e5=r[e3];e5&D?e2===b&&a(e3,b):e5&u&&(e2=e5)}if(i.get(h)){for(var e6=w|D|E,e4=e6|b,e8=[],e7=[],e9=0;e9<eT.length;e9++)if(r[eT[e9]]&h){var te=e[eT[e9]],tt=void 0;if(null!==g(te))if(e7.length<63)e7.push({char:te,seqIndex:e9});else break;else if(null!==(tt=x(te)))for(var tr=e7.length-1;tr>=0;tr--){var tn=e7[tr].char;if(tn===tt||tn===x(v(te))||g(v(tn))===te){e8.push([e7[tr].seqIndex,e9]),e7.length=tr;break}}}e8.sort(function(e,t){return e[0]-t[0]});for(var ti=0;ti<e8.length;ti++){for(var ta=e8[ti],ts=ta[0],to=ta[1],tl=!1,tu=0,th=ts+1;th<to;th++){var tc=eT[th];if(r[tc]&e4){tl=!0;var tp=r[tc]&e6?w:b;if(tp===eB){tu=tp;break}}}if(tl&&!tu){tu=eI;for(var tf=ts-1;tf>=0;tf--){var td=eT[tf];if(r[td]&e4){var ty=r[td]&e6?w:b;tu=ty===eB?eB:ty;break}}}if(tu){if(r[eT[ts]]=r[eT[to]]=tu,tu!==eB){for(var tm=ts+1;tm<eT.length;tm++)if(!(r[eT[tm]]&c)){d(e[eT[tm]])&C&&(r[eT[tm]]=tu);break}}if(tu!==eB){for(var tg=to+1;tg<eT.length;tg++)if(!(r[eT[tg]]&c)){d(e[eT[tg]])&C&&(r[eT[tg]]=tu);break}}}}for(var tx=0;tx<eT.length;tx++)if(r[eT[tx]]&h){for(var tv=tx,tb=tx,tw=eI,tD=tx-1;tD>=0;tD--)if(r[eT[tD]]&c)tv=tD;else{tw=r[eT[tD]]&e6?w:b;break}for(var t_=eC,tA=tx+1;tA<eT.length;tA++)if(r[eT[tA]]&(h|c))tb=tA;else{t_=r[eT[tA]]&e6?w:b;break}for(var tE=tv;tE<=tb;tE++)r[eT[tE]]=tw===t_?tw:eB;tx=tb}}}for(var tS=y.start;tS<=y.end;tS++){var tF=s[tS],tk=r[tS];if(1&tF?tk&(b|D|E)&&s[tS]++:tk&w?s[tS]++:tk&(E|D)&&(s[tS]+=2),tk&c&&(s[tS]=0===tS?y.level:s[tS-1]),tS===y.end||d(e[tS])&(k|F))for(var tT=tS;tT>=0&&d(e[tT])&p;tT--)s[tT]=y.level}}return{levels:s,paragraphs:f};function tI(t,n){for(var i=t;i<e.length;i++){var a=r[i];if(a&(w|B))return 1;if(a&(F|b)||n&&a===N)break;if(a&l){var s=function(t){for(var n=1,i=t+1;i<e.length;i++){var a=r[i];if(a&F)break;if(a&N){if(0==--n)return i}else a&l&&n++}return -1}(i);i=-1===s?e.length:s}}return 0}},e.getMirroredCharacter=U,e.getMirroredCharactersMap=function(e,t,r,n){var i=e.length;r=Math.max(0,null==r?0:+r),n=Math.min(i-1,null==n?i-1:+n);for(var a=new Map,s=r;s<=n;s++)if(1&t[s]){var o=U(e[s]);null!==o&&a.set(s,o)}return a},e.getReorderSegments=q,e.getReorderedIndices=j,e.getReorderedString=function(e,t,r,n){var i=j(e,t,r,n),a=[].concat(e);return i.forEach(function(r,n){a[n]=(1&t.levels[r]?U(e[r]):null)||e[r]}),a.join("")},e.openingToClosingBracket=g,Object.defineProperty(e,"__esModule",{value:!0}),e}({}),hs=/[\u061c\u200e\u200f\u202a-\u202e\u2066-\u2069]/,ho=new Set(["WS","FSI","LRI","RLI","PDI"]),hl=new Set(["S","B"]);function hu(e,t){let{levels:r,paragraphs:n}=ha.getEmbeddingLevels(e);return(function(e,t){let r=[...new Set([0,...t.filter(t=>t>0&&t<e.length),e.length])].sort((e,t)=>e-t),n=[];for(let e=0;e+1<r.length;e++)n.push([r[e],r[e+1]]);return n})(e,t.concat(n.map(e=>e.start))).map(([t,i])=>(function(e,t,r,n,i){let a=function(e,t,r,n){let i=[],a=r;for(let s of uQ(e.slice(r,n)))i.push({index:a,text:s,level:t[a]}),a+=s.length;return i}(e,t,n,i),s=!0;for(let e=a.length-1;e>=0;e--){let t=ha.getBidiCharTypeName(a[e].text[0]);hl.has(t)?(a[e].level=r,s=!0):s&&ho.has(t)?a[e].level=r:s=!1}let o="",l=[];for(let e of function(e,t){let r=t,n=1/0;for(let{level:t}of e)t>r&&(r=t),(1|t)<n&&(n=1|t);let i=e.slice();for(let e=r;e>=n;e--)for(let t=0;t<i.length;t++){if(i[t].level<e)continue;let r=t;for(;r+1<i.length&&i[r+1].level>=e;)r++;for(let e=t,n=r;e<n;e++,n--)[i[e],i[n]]=[i[n],i[e]];t=r}return i}(a,r)){if(hs.test(e.text))continue;let t=e.level%2==0?e.text:ha.getMirroredCharacter(e.text)??e.text;o+=t,l.push(...Array(t.length).fill(e.index))}return{text:o,sourceIndices:l}})(e,r,n.find(e=>t>=e.start&&t<=e.end)?.level??0,t,i))}let hh=typeof TextDecoder>"u"?null:new TextDecoder("utf-8");var hc=class{constructor(e){this.buf=ArrayBuffer.isView(e)?e:new Uint8Array(e),this.dataView=new DataView(this.buf.buffer,this.buf.byteOffset,this.buf.byteLength),this.pos=0,this.type=0,this._valueStart=-1,this.length=this.buf.length}readFields(e,t,r=this.length){let n;for(;n=this.nextField(r);)e(n,t,this);return t}readMessage(e,t){return this.readFields(e,t,this.readVarint()+this.pos)}readFixed32(){let e=this.dataView.getUint32(this.pos,!0);return this.pos+=4,e}readSFixed32(){let e=this.dataView.getInt32(this.pos,!0);return this.pos+=4,e}readFixed64(){let e=this.dataView.getUint32(this.pos,!0)+0x100000000*this.dataView.getUint32(this.pos+4,!0);return this.pos+=8,e}readSFixed64(){let e=this.dataView.getUint32(this.pos,!0)+0x100000000*this.dataView.getInt32(this.pos+4,!0);return this.pos+=8,e}readFloat(){let e=this.dataView.getFloat32(this.pos,!0);return this.pos+=4,e}readDouble(){let e=this.dataView.getFloat64(this.pos,!0);return this.pos+=8,e}readVarint(e){let t=this.buf,r=t[this.pos++];if(r<128)return r;let n=127&r,i;return n|=(127&(i=t[this.pos++]))<<7,i<128||(n|=(127&(i=t[this.pos++]))<<14,i<128)||(n|=(127&(i=t[this.pos++]))<<21,i<128)?n:function(e,t,r){let n=r.buf,i,a;if(i=(112&(a=n[r.pos++]))>>4,a<128||(i|=(127&(a=n[r.pos++]))<<3,a<128)||(i|=(127&(a=n[r.pos++]))<<10,a<128)||(i|=(127&(a=n[r.pos++]))<<17,a<128)||(i|=(127&(a=n[r.pos++]))<<24,a<128)||(i|=(1&(a=n[r.pos++]))<<31,a<128)){var s,o;return s=e,o=i,t?0x100000000*o+(s>>>0):(o>>>0)*0x100000000+(s>>>0)}throw Error("Expected varint not more than 10 bytes")}(n|=(15&(i=t[this.pos]))<<28,e,this)}readSVarint(){let e=this.readVarint();return e%2==1?-((e+1)/2):e/2}readBoolean(){return!!this.readVarint()}readString(){let e=this.readVarint()+this.pos,t=this.pos;return this.pos=e,e-t>=12&&hh?hh.decode(this.buf.subarray(t,e)):function(e,t,r){let n="",i=t;
2for(;i<r;){let t,a,s,o=e[i],l=null,u=o>239?4:o>223?3:o>191?2:1;if(i+u>r)break;1===u?o<128&&(l=o):2===u?(192&(t=e[i+1]))==128&&(l=(31&o)<<6|63&t)<=127&&(l=null):3===u?(t=e[i+1],a=e[i+2],(192&t)==128&&(192&a)==128&&((l=(15&o)<<12|(63&t)<<6|63&a)<=2047||l>=55296&&l<=57343)&&(l=null)):4===u&&(t=e[i+1],a=e[i+2],s=e[i+3],(192&t)==128&&(192&a)==128&&(192&s)==128&&((l=(15&o)<<18|(63&t)<<12|(63&a)<<6|63&s)<=65535||l>=1114112)&&(l=null)),null===l?(l=65533,u=1):l>65535&&(l-=65536,n+=String.fromCharCode(l>>>10&1023|55296),l=56320|1023&l),n+=String.fromCharCode(l),i+=u}return n}(this.buf,t,e)}readBytes(){let e=this.readVarint()+this.pos,t=this.buf.subarray(this.pos,e);return this.pos=e,t}readPackedVarint(e=[],t){let r=this.readPackedEnd();for(;this.pos<r;)e.push(this.readVarint(t));return e}readPackedSVarint(e=[]){let t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readSVarint());return e}readPackedBoolean(e=[]){let t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readBoolean());return e}readPackedFloat(e=[]){let t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readFloat());return e}readPackedDouble(e=[]){let t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readDouble());return e}readPackedFixed32(e=[]){let t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readFixed32());return e}readPackedSFixed32(e=[]){let t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readSFixed32());return e}readPackedFixed64(e=[]){let t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readFixed64());return e}readPackedSFixed64(e=[]){let t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readSFixed64());return e}readPackedEnd(){return 2===this.type?this.readVarint()+this.pos:this.pos+1}nextField(e=this.length){if(this.pos===this._valueStart&&this.skip(this.type),this.pos>=e)return 0;let t=this.readVarint();return this.type=7&t,this._valueStart=this.pos,t>>>3}skip(e){let t=7&e;if(0===t)for(;this.buf[this.pos++]>127;);else if(2===t)this.pos=this.readVarint()+this.pos;else if(5===t)this.pos+=4;else if(1===t)this.pos+=8;else throw Error(`Unimplemented type: ${t}`)}};function hp(e,t,r){1===e&&r.readMessage(hf,t)}function hf(e,t,r){if(3===e){let{id:e,bitmap:n,width:i,height:a,left:s,top:o,advance:l}=r.readMessage(hd,{});t.push({id:e,bitmap:new o0({width:i+6,height:a+6},n),metrics:{width:i,height:a,left:s,top:o,advance:l}})}}function hd(e,t,r){1===e?t.id=r.readVarint():2===e?t.bitmap=r.readBytes():3===e?t.width=r.readVarint():4===e?t.height=r.readVarint():5===e?t.left=r.readSVarint():6===e?t.top=r.readSVarint():7===e&&(t.advance=r.readVarint())}function hy(e){return new hc(e).readFields(hp,[])}function hm(e){return"function"==typeof e?.renderWithWebGL}function hg(e){let{userImage:t}=e;return!!t?.render&&!!t.render()&&(hm(t.data)||e.data.replace(new Uint8Array(t.data.buffer)),!0)}function hx(e){let t=0,r=0;for(let n of e)t+=n.w*n.h,r=Math.max(r,n.w);e.sort((e,t)=>t.h-e.h);let n=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(t/.95)),r),h:1/0}],i=0,a=0;for(let t of e)for(let e=n.length-1;e>=0;e--){let r=n[e];if(!(t.w>r.w||t.h>r.h)){if(t.x=r.x,t.y=r.y,a=Math.max(a,t.y+t.h),i=Math.max(i,t.x+t.w),t.w===r.w&&t.h===r.h){let t=n.pop();t&&e<n.length&&(n[e]=t)}else t.h===r.h?(r.x+=t.w,r.w-=t.w):(t.w===r.w||n.push({x:r.x+t.w,y:r.y,w:r.w-t.w,h:t.h}),r.y+=t.h,r.h-=t.h);break}}return{w:i,h:a,fill:t/(i*a)||0}}var hv=class{constructor(e,{pixelRatio:t,version:r,isWebGLImage:n=!1,stretchX:i,stretchY:a,content:s,textFitWidth:o,textFitHeight:l}){this.paddedRect=e,this.pixelRatio=t,this.stretchX=i,this.stretchY=a,this.content=s,this.version=r,this.needsFirstWebGLRender=n,this.textFitWidth=o,this.textFitHeight=l}get tl(){return[this.paddedRect.x+1,this.paddedRect.y+1]}get br(){return[this.paddedRect.x+this.paddedRect.w-1,this.paddedRect.y+this.paddedRect.h-1]}get tlbr(){return this.tl.concat(this.br)}get displaySize(){return[(this.paddedRect.w-2)/this.pixelRatio,(this.paddedRect.h-2)/this.pixelRatio]}},hb=class{constructor(e,t){let r={},n={};this.haveRenderCallbacks=[],this.patchedUpdateVersion=-1;let i=[];this.addImages(e,r,i),this.addImages(t,n,i);let{w:a,h:s}=hx(i),o=new o2({width:a||1,height:s||1});for(let t in e){let n=e[t];
2if(n.isWebGLImage)continue;let i=r[t].paddedRect;o2.copy(n.data,o,{x:0,y:0},{x:i.x+1,y:i.y+1},n.data)}for(let e in t){let r=t[e],i=n[e].paddedRect,a=i.x+1,s=i.y+1,l=r.data.width,u=r.data.height;o2.copy(r.data,o,{x:0,y:0},{x:a,y:s},r.data),o2.copy(r.data,o,{x:0,y:u-1},{x:a,y:s-1},{width:l,height:1}),o2.copy(r.data,o,{x:0,y:0},{x:a,y:s+u},{width:l,height:1}),o2.copy(r.data,o,{x:l-1,y:0},{x:a-1,y:s},{width:1,height:u}),o2.copy(r.data,o,{x:0,y:0},{x:a+l,y:s},{width:1,height:u})}this.image=o,this.iconPositions=r,this.patternPositions=n}addImages(e,t,r){for(let n in e){let i=e[n],a={x:0,y:0,w:i.data.width+2,h:i.data.height+2};r.push(a),t[n]=new hv(a,i),i.hasRenderCallback&&this.haveRenderCallbacks.push(n)}}patchUpdatedImages(e,t){if(e.dispatchRenderCallbacks(this.haveRenderCallbacks),this.patchedUpdateVersion!==e.updateVersion){for(let r in this.patchedUpdateVersion=e.updateVersion,this.iconPositions)this.patchUpdatedImage(this.iconPositions[r],e.getImage(r),t);for(let r in this.patternPositions)this.patchUpdatedImage(this.patternPositions[r],e.getImage(r),t)}}patchUpdatedImage(e,t,r){if(!e||!t||!e.needsFirstWebGLRender&&e.version===t.version)return;e.needsFirstWebGLRender=!1,e.version=t.version;let[n,i]=e.tl,a=t.userImage?.data;if(!hm(a))return void r.update(t.data,void 0,{x:n,y:i});let{width:s,height:o}=t.data;r.context.setCustomLayerDefaults(),a.renderWithWebGL({gl:r.context.gl,texture:r.texture,x:n,y:i,width:s,height:o}),r.context.setDirty()}};ak("ImagePosition",hv),ak("ImageAtlas",hb);var hw=function(e){return e[e.none=0]="none",e[e.horizontal=1]="horizontal",e[e.vertical=2]="vertical",e[e.horizontalOnly=3]="horizontalOnly",e}(hw||{});let hD=/^\p{gc=M}$/u;function h_(e,t,r){let n=new hi(e.join(""),t,[]),i=0;for(let e of n.graphemes())n.sectionIndex.push(r[i]??0),i+=[...e].length;return n}function hA(e){let t=[],r=0;for(let n of e)t.push(r),r+=n.length;return t}function hE(e,t,r){let n=[...e],i=hA(n),a=function(e){let t=[],r=0;for(;r<e.length;){if(!hD.test(e[r])){t.push(r),r++;continue}let n=r;for(;n<e.length&&hD.test(e[n]);)n++;let i=e[n];if(void 0!==i&&u6(i.codePointAt(0))){t.push(n);for(let e=n-1;e>=r;e--)t.push(e);r=n+1}else{for(let e=r;e<n;e++)t.push(e);r=n}}return t}(n);return h_(a.map(e=>n[e]),t,a.map(e=>r[i[e]]??0))}function hS(e,t,r,n,i,a,s,o,l,u,h,c,p,f,d){let y=hi.fromFeature(e,i);2===c&&y.verticalizePunctuation();let m=y.determineLineBreaks(u,a,t,n,f),g=u4(y.text)?function(e,t){var r;let n=t.map(t=>e.toCodeUnitIndex(t)),i=uj.isParsed()?uj:null;if(1===e.sections.length)return i?i.processBidirectionalText(e.toString(),n).map(t=>hE(t,e.sections,[...t].map(()=>0))):hu(e.toString(),n).map(e=>e.text).map(t=>h_([...t],e.sections,[...t].map(()=>0)));let a=function(e){let t=[],r=0;for(let n of e.graphemes())t.push(...Array(n.length).fill(e.sectionIndex[r])),r++;return t}(e);return i?i.processStyledBidirectionalText(e.text,a,n).map(([t,r])=>hE(t,e.sections,r)):(r=e.text,hu(r,n).map(e=>[e.text,e.sourceIndices.map(e=>a[e]??0)])).map(([t,r])=>{let n=[...t];return h_(n,e.sections,hA(n).map(e=>r[e]??0))})}(y,m):function(e,t){let r=[],n=0;for(let i of t)r.push(e.substring(n,i)),n=i;return n<e.length()&&r.push(e.substring(n,e.length())),r}(y,m),x=[],v={positionedLines:x,text:y.toString(),top:h[1],bottom:h[1],left:h[0],right:h[0],writingMode:c,iconsInText:!1,verticalizable:!1};return function(e,t,r,n,i,a,s,o,l,u,h,c){let p=0,f=0,d=0,y=0,m="right"===o?1:.5*("left"!==o),g=24/c,x=0;for(let s of i){s.trim();let i=s.getMaxScale(),o={positionedGlyphs:[],lineOffset:0};e.positionedLines[x]=o;let c=o.positionedGlyphs,v=0;if(!s.length()){f+=a,++x;continue}let b=function(e,t,r){let n=24*t.getMaxScale(),{maxImageWidth:i,maxImageHeight:a}=t.getMaxImageSize(e),s=Math.max(n,a*r);return{verticalLineContentWidth:Math.max(n,i*r),horizontalLineContentHeight:s}}(n,s,g),w=2!==l||h?null:function(e){let t=e.graphemes().slice(),r=t.map(e=>e.codePointAt(0)),n=r.map(uY),i=t=>!n[t]&&!u0(r[t])&&!("imageName"in e.getSection(t));for(let e=0;e<r.length;e++){if(!i(e))continue;let t=e;for(;t+1<r.length&&i(t+1);)t++;if(function(e){let t=e.some(hT)&&e.every(e=>hT(e)||/[\p{P}\p{S}]/u.test(String.fromCodePoint(e))),r=e.length<=3&&e.every(e=>hI(e)||hT(e));return t||r}(r.slice(e,t+1)))for(let i=e;i<=t;i++){var a;n[i]=(hT(a=r[i])||hI(a))&&!u5(a)}e=t}return function(e,t){let r=!1;for(let n=0;n<e.length;n++){if(t[n])continue;let i=u8[e[n]];i&&(0===n||t[n-1])&&(n===e.length-1||t[n+1])&&(e[n]=i,t[n]=!0,r=!0)}return r}(t,n)&&(e.text=t.join(""),e._graphemes=null),n}(s),D=s.graphemes();for(let a=0;a<D.length;
2a++){let o=s.getSection(a),d=D[a],y=d.codePointAt(0),m=w?w[a]:!(1===l||!h&&!uY(y)||h&&(u0(y)||u5(y)));for(let l of"fontStack"in o&&u1(d)&&!t[o.fontStack]?.[d]?[...d]:[d]){let h={glyph:l.codePointAt(0),grapheme:l,imageName:null,x:p,y:f+-17,vertical:m,scale:1,fontStack:"",sectionIndex:s.getSectionIndex(a),metrics:null,rect:null},d;if("fontStack"in o){if(!(d=function(e,t,r,n,i,a){let s,o=function(e,t,r,n){if(e?.rect)return e;let i=t[r.fontStack]?.[n];return i?{rect:null,metrics:i.metrics}:null}(a[e.fontStack]?.[t],i,e,t);if(null===o)return null;if(r)s=n.verticalLineContentWidth-24*e.scale;else{let t=hk(e.verticalAlign);s=(n.horizontalLineContentHeight-24*e.scale)*t}return{rect:o.rect,metrics:o.metrics,baselineOffset:s}}(o,l,m,b,t,r)))continue;h.fontStack=o.fontStack}else{if(e.iconsInText=!0,o.scale*=g,!(d=function(e,t,r,n,i){let a=i[e.imageName];if(!a)return null;let s=a.paddedRect,o=a.displaySize,l={width:o[0],height:o[1],left:1,top:-3,advance:t?o[1]:o[0]},u;if(t)u=n.verticalLineContentWidth-o[1]*e.scale;else{let t=hk(e.verticalAlign);u=(n.horizontalLineContentHeight-o[1]*e.scale)*t}return{rect:s,metrics:l,baselineOffset:u,imageOffset:(t?o[0]:o[1])*e.scale-24*r}}(o,m,i,b,n)))continue;v=Math.max(v,d.imageOffset),h.imageName=o.imageName}let{rect:y,metrics:x,baselineOffset:w}=d;(h.y+=w,h.scale=o.scale,h.metrics=x,h.rect=y,c.push(h),m)?(e.verticalizable=!0,p+=("imageName"in o?x.advance:24)*o.scale+u):p+=x.advance*o.scale+u}}0!==c.length&&(d=Math.max(p-u,d),function(e,t,r,n){if(0===n)return;let i=e[r],a=i.metrics.advance*i.scale,s=(e[r].x+a)*n;for(let t=0;t<=r;t++)e[t].x-=s}(c,0,c.length-1,m)),p=0,o.lineOffset=Math.max(v,(i-1)*24);let _=a*i+v;f+=_,y=Math.max(_,y),++x}let{horizontalAlign:v,verticalAlign:b}=hF(s);(function(e,t,r,n,i,a,s,o,l){let u=(t-r)*i,h=0;for(let t of(h=a===s?-n*l*s+.5*s:-o*n- -17,e))for(let e of t.positionedGlyphs)e.x+=u,e.y+=h})(e.positionedLines,m,v,b,d,y,a,f,i.length),e.top+=-b*f,e.bottom=e.top+f,e.left+=-v*d,e.right=e.left+d}(v,t,r,n,g,s,o,l,c,u,p,d),!function(e){for(let t of e)if(0!==t.positionedGlyphs.length)return!1;return!0}(x)&&v}function hF(e){let t=.5,r=.5;switch(e){case"right":case"top-right":case"bottom-right":t=1;break;case"left":case"top-left":case"bottom-left":t=0}switch(e){case"bottom":case"bottom-right":case"bottom-left":r=1;break;case"top":case"top-right":case"top-left":r=0}return{horizontalAlign:t,verticalAlign:r}}function hk(e){switch(e){case"top":return 0;case"center":return .5;default:return 1}}function hT(e){return/\p{Nd}/u.test(String.fromCodePoint(e))}function hI(e){return/\p{Lu}/u.test(String.fromCodePoint(e))}function hC(e){let t=e.left,r=e.top,n=e.right-t,i=e.bottom-r,a=e.image.content[2]-e.image.content[0],s=e.image.content[3]-e.image.content[1],o=e.image.textFitWidth??"stretchOrShrink",l=e.image.textFitHeight??"stretchOrShrink",u=a/s;if("proportional"===l){if("stretchOnly"===o&&n/i<u||"proportional"===o){let e=Math.ceil(i*u);t*=e/n,n=e}}else if("proportional"===o&&"stretchOnly"===l&&0!==u&&n/i>u){let e=Math.ceil(n/u);r*=e/i,i=e}return{x1:t,y1:r,x2:t+n,y2:r+i}}function hB(e,t,r,n,i,a){let s=e.image,o;if(s.content){let e=s.content,t=s.pixelRatio||1;o=[e[0]/t,e[1]/t,s.displaySize[0]-e[2]/t,s.displaySize[1]-e[3]/t]}let l=t.left*a,u=t.right*a,h,c,p,f;"width"===r||"both"===r?(f=i[0]+l-n[3],c=i[0]+u+n[1]):c=(f=i[0]+(l+u-s.displaySize[0])/2)+s.displaySize[0];let d=t.top*a,y=t.bottom*a;return"height"===r||"both"===r?(h=i[1]+d-n[0],p=i[1]+y+n[2]):p=(h=i[1]+(d+y-s.displaySize[1])/2)+s.displaySize[1],{image:s,top:h,right:c,bottom:p,left:f,collisionPadding:o}}function hM(e,t){let{expression:r}=t;if("constant"===r.kind)return{kind:"constant",layoutSize:r.evaluate(new az(e+1))};if("source"===r.kind)return{kind:"source"};if("composite"===r.kind){let{minZoom:t,maxZoom:n}=function(e,t){let r=0;for(;r<e.length&&e[r]<=t;)r++;let n=r=Math.max(0,r-1);for(;n<e.length&&e[n]<t+1;)n++;return n=Math.min(e.length-1,n),{minZoom:e[r],maxZoom:e[n]}}(r.zoomStops,e);return{kind:"composite",minZoom:t,maxZoom:n,interpolationType:r.interpolationType}}{var n;let t=(n=r).zoomStops.map(e=>n.evaluate(new az(e===-1/0?n.zoomStops[1]-1:e))),i=r.evaluate(new az(e+1));return{kind:"camera",zoomStops:r.zoomStops,sizes:t,layoutSize:i,interpolationType:r.interpolationType}}}function hP(e,{uSize:t,uSizeT:r},{lowerSize:n,upperSize:i}){return"source"===e.kind?n/128:"composite"===e.kind?r5.number(n/128,i/128,r):t}function hz(e,t){let r=0,n=0;return"constant"===e.kind?n=e.layoutSize:"camera"===e.kind?n=function({zoomStops:e,sizes:t,layoutSize:r,interpolationType:n},i){let a=e.length-1;for(;a>0&&e[a]>i;)a--;let s=Math.min(a+1,e.length-1),o=n?e3(r2.interpolationFactor(n,i,e[a],e[s]),0,1):0;return Math.min(r5.number(t[a],t[s],o),r)}(e,t):"composite"===e.kind&&(r=function({interpolationType:e,minZoom:t,maxZoom:r},n){return e?e3(r2.interpolationFactor(e,n,t,r),0,1):0}(e,t)),{uSizeT:r,uSize:n}}var hL=class e extends C{constructor(e,t,r,n){super(e,t),this.angle=r,void 0!==n&&(this.segment=n)}clone(){return new e(this.x,this.y,this.angle,this.segment)}};function hV(e,t,r,n,i){if(void 0===t.segment||0===r)return!0;let a=t,s=t.segment+1,o=0;for(;o>-r/2;){if(--s<0)return!1;o-=e[s].dist(a),a=e[s]}o+=e[s].dist(e[s+1]),s++;let l=[],u=0;for(;o<r/2;
2){let t=e[s-1],r=e[s],a=e[s+1];if(!a)return!1;let h=t.angleTo(r)-r.angleTo(a);for(h=Math.abs((h+3*Math.PI)%(2*Math.PI)-Math.PI),l.push({distance:o,angleDelta:h}),u+=h;o-l[0].distance>n;)u-=l.shift().angleDelta;if(u>i)return!1;s++,o+=r.dist(a)}return!0}function hR(e){let t=0;for(let r=0;r<e.length-1;r++)t+=e[r].dist(e[r+1]);return t}function hO(e,t){return Math.max(e?e.right-e.left:0,t?t.right-t.left:0)}function h$(e,t,r,n,i){let a=[];for(let s of e){let e;for(let o=0;o<s.length-1;o++){let l=s[o],u=s[o+1];l.x<t&&u.x<t||(l.x<t?l=new C(t,l.y+(u.y-l.y)*((t-l.x)/(u.x-l.x)))._round():u.x<t&&(u=new C(t,l.y+(u.y-l.y)*((t-l.x)/(u.x-l.x)))._round()),!(l.y<r&&u.y<r)&&(l.y<r?l=new C(l.x+(u.x-l.x)*((r-l.y)/(u.y-l.y)),r)._round():u.y<r&&(u=new C(l.x+(u.x-l.x)*((r-l.y)/(u.y-l.y)),r)._round()),!(l.x>=n&&u.x>=n)&&(l.x>=n?l=new C(n,l.y+(u.y-l.y)*((n-l.x)/(u.x-l.x)))._round():u.x>=n&&(u=new C(n,l.y+(u.y-l.y)*((n-l.x)/(u.x-l.x)))._round()),l.y>=i&&u.y>=i||(l.y>=i?l=new C(l.x+(u.x-l.x)*((i-l.y)/(u.y-l.y)),i)._round():u.y>=i&&(u=new C(l.x+(u.x-l.x)*((i-l.y)/(u.y-l.y)),i)._round()),e&&l.equals(e[e.length-1])||(e=[l],a.push(e)),e.push(u)))))}}return a}function hN(e,t,r,n){let i=[],a=e.image,s=a.pixelRatio,o=a.paddedRect.w-2,l=a.paddedRect.h-2,u={x1:e.left,y1:e.top,x2:e.right,y2:e.bottom},h=a.stretchX||[[0,o]],c=a.stretchY||[[0,l]],p=(e,t)=>e+t[1]-t[0],f=h.reduce(p,0),d=c.reduce(p,0),y=o-f,m=l-d,g=0,x=f,v=0,b=d,w=0,D=y,_=0,A=m;if(a.content&&n){let t=a.content,r=t[2]-t[0],n=t[3]-t[1];(a.textFitWidth||a.textFitHeight)&&(u=hC(e)),g=hU(h,0,t[0]),v=hU(c,0,t[1]),x=hU(h,t[0],t[2]),b=hU(c,t[1],t[3]),w=t[0]-g,_=t[1]-v,D=r-x,A=n-b}let E=u.x1,S=u.y1,F=u.x2-E,k=u.y2-S,T=(e,n,i,o)=>{var l,u,h,c,p,y,m,T,I,B,M,P,z,L,V,R;let O=(l=e.stretch-g,l/x*F+E),$=(u=e.fixed-w,h=D,c=e.stretch,u-h*c/f),N=(p=n.stretch-v,p/b*k+S),U=(y=n.fixed-_,m=A,T=n.stretch,y-m*T/d),q=(I=i.stretch-g,I/x*F+E),j=(B=i.fixed-w,M=D,P=i.stretch,B-M*P/f),G=(z=o.stretch-v,z/b*k+S),Y=(L=o.fixed-_,V=A,R=o.stretch,L-V*R/d),X=new C(O,N),W=new C(q,N),Z=new C(q,G),H=new C(O,G),K=new C($/s,U/s),J=new C(j/s,Y/s),Q=t*Math.PI/180;if(Q){let e=Math.sin(Q),t=Math.cos(Q),r=[t,-e,e,t];X._matMult(r),W._matMult(r),H._matMult(r),Z._matMult(r)}let ee=e.stretch+e.fixed,et=i.stretch+i.fixed,er=n.stretch+n.fixed,en=o.stretch+o.fixed;return{tl:X,tr:W,bl:H,br:Z,tex:{x:a.paddedRect.x+1+ee,y:a.paddedRect.y+1+er,w:et-ee,h:en-er},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:K,pixelOffsetBR:J,minFontScaleX:D/s/F,minFontScaleY:A/s/k,isSDF:r}};if(n&&(a.stretchX||a.stretchY)){let e=hq(h,y,f),t=hq(c,m,d);for(let r=0;r<e.length-1;r++){let n=e[r],a=e[r+1];for(let e=0;e<t.length-1;e++){let r=t[e],s=t[e+1];i.push(T(n,r,a,s))}}}else i.push(T({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:o+1},{fixed:0,stretch:l+1}));return i}function hU(e,t,r){let n=0;for(let i of e)n+=Math.max(t,Math.min(r,i[1]))-Math.max(t,Math.min(r,i[0]));return n}function hq(e,t,r){let n=[{fixed:-1,stretch:0}];for(let[t,r]of e){let e=n[n.length-1];n.push({fixed:t-e.stretch,stretch:e.stretch}),n.push({fixed:t-e.stretch,stretch:e.stretch+(r-t)})}return n.push({fixed:t+1,stretch:r}),n}ak("Anchor",hL);var hj=class{constructor(e,t,r,n,i,a,s,o,l,u){if(this.boxStartIndex=e.length,l){let e=a.top,t=a.bottom,r=a.collisionPadding;r&&(e-=r[1],t+=r[3]);let n=t-e;n>0&&(n=Math.max(10,n),this.circleDiameter=n)}else{let l=a.image?.content&&(a.image.textFitWidth||a.image.textFitHeight)?hC(a):{x1:a.left,y1:a.top,x2:a.right,y2:a.bottom};l.y1=l.y1*s-o[0],l.y2=l.y2*s+o[2],l.x1=l.x1*s-o[3],l.x2=l.x2*s+o[1];let h=a.collisionPadding;if(h&&(l.x1-=h[0]*s,l.y1-=h[1]*s,l.x2+=h[2]*s,l.y2+=h[3]*s),u){let e=new C(l.x1,l.y1),t=new C(l.x2,l.y1),r=new C(l.x1,l.y2),n=new C(l.x2,l.y2),i=u*Math.PI/180;e._rotate(i),t._rotate(i),r._rotate(i),n._rotate(i),l.x1=Math.min(e.x,t.x,r.x,n.x),l.x2=Math.max(e.x,t.x,r.x,n.x),l.y1=Math.min(e.y,t.y,r.y,n.y),l.y2=Math.max(e.y,t.y,r.y,n.y)}e.emplaceBack(t.x,t.y,l.x1,l.y1,l.x2,l.y2,r,n,i)}this.boxEndIndex=e.length}},hG=class{constructor(e=[],t=(e,t)=>e<t?-1:+(e>t)){if(this.data=e,this.length=this.data.length,this.compare=t,this.length>0)for(let e=(this.length>>1)-1;e>=0;e--)this._down(e)}push(e){this.data.push(e),this._up(this.length++)}pop(){if(0===this.length)return;let e=this.data[0],t=this.data.pop();return--this.length>0&&(this.data[0]=t,this._down(0)),e}peek(){return this.data[0]}_up(e){let{data:t,compare:r}=this,n=t[e];for(;e>0;){let i=e-1>>1,a=t[i];if(r(n,a)>=0)break;t[e]=a,e=i}t[e]=n}_down(e){let{data:t,compare:r}=this,n=this.length>>1,i=t[e];for(;e<n;){let n=(e<<1)+1,a=n+1;if(a<this.length&&0>r(t[a],t[n])&&(n=a),r(t[n],i)>=0)break;t[e]=t[n],e=n}t[e]=i}};function hY(e,t){return t.max-e.max}var hX=class{constructor(e,t,r,n){this.p=new C(e,t),this.h=r,this.d=function(e,t){let r=!1,n=1/0;for(let i of t)for(let t=0,a=i.length,s=a-1;t<a;s=t++){let a=i[t],o=i[s];a.y>e.y!=o.y>e.y&&e.x<(o.x-a.x)*(e.y-a.y)/(o.y-a.y)+a.x&&(r=!r),n=Math.min(n,oz(e,a,o))}return(r?1:-1)*Math.sqrt(n)}(this.p,n),this.max=this.d+this.h*Math.SQRT2}};let hW=function(e){return e[e.center=1]="center",e[e.left=2]="left",e[e.right=3]="right",e[e.top=4]="top",e[e.bottom=5]="bottom",e[e["top-left"]=6]="top-left",e[e["top-right"]=7]="top-right",e[e["bottom-left"]=8]="bottom-left",e[e["bottom-right"]=9]="bottom-right",e}({}),hZ=1/0;function hH(e,t){return t[1]===hZ?function(e,t){let r=0,n=0;t<0&&(t=0);let i=t/Math.SQRT2;switch(e){case"top-right":case"top-left":n=i-7;break;case"bottom-right":case"bottom-left":n=-i+7;break;case"bottom":n=-t+7;break;case"top":n=t-7}switch(e){case"top-right":case"bottom-right":r=-i;break;case"top-left":case"bottom-left":r=i;break;case"left":r=t;break;case"right":r=-t}return[r,n]}(e,t[0]):function(e,t,r){let n=0,i=0;switch(t=Math.abs(t),r=Math.abs(r),e){case"top-right":case"top-left":case"top":i=r-7;break;case"bottom-right":case"bottom-left":case"bottom":i=-r+7}switch(e){case"top-right":case"bottom-right":case"right":n=-t;break;case"top-left":case"bottom-left":case"left":n=t}return[n,i]}(e,t[0],t[1])}function hK(e,t,r){let n=e.layout,i=n.get("text-variable-anchor-offset")?.evaluate(t,{},r);if(i){let e=i.values,t=[];for(let r=0;r<e.length;r+=2){let n=t[r]=e[r],i=e[r+1].map(e=>24*e);n.startsWith("top")?i[1]-=7:n.startsWith("bottom")&&(i[1]+=7),t[r+1]=i}return new rq(t)}let a=n.get("text-variable-anchor");if(a){let i;i=void 0===e._unevaluatedLayout.getValue("text-radial-offset")?n.get("text-offset").evaluate(t,{},r).map(e=>24*e):[24*n.get("text-radial-offset").evaluate(t,{},r),hZ];let s=[];for(let e of a)s.push(e,hH(e,i));return new rq(s)}return null}function hJ(e){switch(e){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function hQ(e,t,r,n,i,a,s,o,l,u,h,c,p,f,d,y){let m=function(e,t,r,n,i,a,s,o){let l=n.layout.get("text-rotate").evaluate(a,{})*Math.PI/180,u=[];for(let e of t.positionedLines)for(let n of e.positionedGlyphs){if(!n.rect)continue;let a=n.rect||{},h=4,c=!0,p=1,f=0,d=(i||o)&&n.vertical,y=n.metrics.advance*n.scale/2;if(o&&t.verticalizable){let t=(n.scale-1)*24,r=(24-n.metrics.width*n.scale)/2;f=e.lineOffset/2-(n.imageName?-r:t)}if(n.imageName){let e=s[n.imageName];c=e.sdf,h=1/(p=e.pixelRatio)}let m=i?[n.x+y,n.y]:[0,0],g=i?[0,0]:[n.x+y+r[0],n.y+r[1]-f],x=[0,0];d&&(x=g,g=[0,0]);let v=n.metrics.isDoubleResolution?2:1,b=(n.metrics.left-h)*n.scale-y+g[0],w=(-n.metrics.top-h)*n.scale+g[1],D=b+a.w/v*n.scale/p,_=w+a.h/v*n.scale/p,A=new C(b,w),E=new C(D,w),S=new C(b,_),F=new C(D,_);if(d){let e=new C(-y,y- -17),t=-Math.PI/2,r=12-y,i=n.imageName?r:0,a=new C(22-r,-i),s=new C(...x);
2A._rotateAround(t,e)._add(a)._add(s),E._rotateAround(t,e)._add(a)._add(s),S._rotateAround(t,e)._add(a)._add(s),F._rotateAround(t,e)._add(a)._add(s)}if(l){let e=Math.sin(l),t=Math.cos(l),r=[t,-e,e,t];A._matMult(r),E._matMult(r),S._matMult(r),F._matMult(r)}let k=new C(0,0),T=new C(0,0);u.push({tl:A,tr:E,bl:S,br:F,tex:a,writingMode:t.writingMode,glyphOffset:m,sectionIndex:n.sectionIndex,isSDF:c,pixelOffsetTL:k,pixelOffsetBR:T,minFontScaleX:0,minFontScaleY:0})}return u}(0,r,o,i,a,s,n,e.allowVerticalPlacement),g=e.textSizeData,x=null;for(let r of("source"===g.kind?(x=[128*i.layout.get("text-size").evaluate(s,{})])[0]>32640&&to(`${e.layerIds[0]}: Value for "text-size" is >= 255. Reduce your "text-size".`):"composite"===g.kind&&((x=[128*d.compositeTextSizes[0].evaluate(s,{},y),128*d.compositeTextSizes[1].evaluate(s,{},y)])[0]>32640||x[1]>32640)&&to(`${e.layerIds[0]}: Value for "text-size" is >= 255. Reduce your "text-size".`),e.addSymbols(e.text,m,x,o,a,s,h,t,u.lineStartIndex,u.lineLength,f,y,l),c))p[r]=e.text.placedSymbolArray.length-1;return 4*m.length}function h1(e){for(let t in e)return e[t];return null}function h0(e,t,r){let n="never",i=e.get(t);return i?n=i:e.get(r)&&(n="always"),n}let h2=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function h3(e,t,r,n,i,a,s,o,l,u,h,c,p,f){let d=o?Math.min(32640,Math.round(o[0])):0,y=o?Math.min(32640,Math.round(o[1])):0;e.emplaceBack(t,r,Math.round(32*n),Math.round(32*i),a,s,(d<<1)+ +!!l,y,16*u,16*h,256*c,256*p,f)}function h5(e,t,r){e.emplaceBack(t.x,t.y,r),e.emplaceBack(t.x,t.y,r),e.emplaceBack(t.x,t.y,r),e.emplaceBack(t.x,t.y,r)}var h6=class{constructor(e){this.layoutVertexArray=new sY,this.indexArray=new sQ,this.programConfigurations=e,this.segments=new s5,this.dynamicLayoutVertexArray=new sX,this.opacityVertexArray=new sW,this.hasVisibleVertices=!1,this.placedSymbolArray=new sF}isEmpty(){return 0===this.layoutVertexArray.length&&0===this.indexArray.length&&0===this.dynamicLayoutVertexArray.length&&0===this.opacityVertexArray.length}upload(e,t,r,n){this.isEmpty()||(r&&(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,uO.members),this.indexBuffer=e.createIndexBuffer(this.indexArray,t),this.dynamicLayoutVertexBuffer=e.createVertexBuffer(this.dynamicLayoutVertexArray,u$.members,!0),this.opacityVertexBuffer=e.createVertexBuffer(this.opacityVertexArray,h2,!0),this.opacityVertexBuffer.itemSize=1),(r||n)&&this.programConfigurations.upload(e))}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy())}};ak("SymbolBuffers",h6);var h4=class{constructor(e,t,r){this.layoutVertexArray=new e,this.layoutAttributes=t,this.indexArray=new r,this.segments=new s5,this.collisionVertexArray=new sK}upload(e){this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=e.createVertexBuffer(this.collisionVertexArray,uN.members,!0)}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy())}};ak("CollisionBuffers",h4);var h8=class{constructor(e){this.collisionBoxArray=e.collisionBoxArray,this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(e=>e.id),this.index=e.index,this.pixelRatio=e.pixelRatio,this.sourceLayerIndex=e.sourceLayerIndex,this.hasDependencies=!0,this.hasRTLText=!1,this.maxHeightOffset=0,this.sortKeyRanges=[],this.collisionCircleArray=[],this.maxGlyphs=65535;let t=this.layers[0]._unevaluatedLayout._values;this.textSizeData=hM(this.zoom,t["text-size"]),this.iconSizeData=hM(this.zoom,t["icon-size"]);let r=this.layers[0].layout,n=r.get("symbol-sort-key"),i=r.get("symbol-z-order");this.canOverlap="never"!==h0(r,"text-overlap","text-allow-overlap")||"never"!==h0(r,"icon-overlap","icon-allow-overlap")||r.get("text-ignore-placement")||r.get("icon-ignore-placement"),this.sortFeaturesByKey="viewport-y"!==i&&!n.isConstant();let a="viewport-y"===i||"auto"===i&&!this.sortFeaturesByKey;this.sortFeaturesByY=a&&this.canOverlap,"point"===r.get("symbol-placement")&&(this.writingModes=r.get("text-writing-mode").map(e=>hw[e])),this.stateDependentLayerIds=this.layers.filter(e=>e.isStateDependent()).map(e=>e.id),this.sourceID=e.sourceID}createArrays(){this.text=new h6(new oA(this.layers,this.zoom,e=>e.startsWith("text"))),this.icon=new h6(new oA(this.layers,this.zoom,e=>e.startsWith("icon"))),this.glyphOffsetArray=new sI,this.lineVertexArray=new sC,this.symbolInstances=new sT,this.textAnchorOffsets=new sM}calculateGlyphDependencies(e,t,r,n,i){let a=(n||this.allowVerticalPlacement)&&i,s=hi.fromFeature(e,r),o=s.graphemes();for(let e=0;e<o.length;e++){let r=s.getSection(e);if("imageName"in r)continue;let n=t[r.fontStack]||={},i=o[e];for(let e of(u1(i)&&(n[i]=!0),i)){if(n[e]=!0,!a)continue;let t=u8[e];t&&(n[t]=!0)}}}populate(e,t,r){let n=this.layers[0],i=n.layout,a=i.get("text-font"),s=i.get("text-field"),o=i.get("icon-image"),l=("constant"!==s.value.kind||s.value.value instanceof rV&&!s.value.value.isEmpty()||s.value.value.toString().length>0)&&("constant"!==a.value.kind||a.value.value.length>0),u="constant"!==o.value.kind||!!o.value.value||Object.keys(o.parameters).length>0,h=i.get("symbol-sort-key");if(this.features=[],!l&&!u)return;let c=t.iconDependencies,p=t.glyphDependencies,f=t.availableImages,d=new az(this.zoom);for(let{feature:t,id:s,index:o,sourceLayerIndex:y}of e){let e,m,g=n._featureFilter.needGeometry,x=ok(t,g);if(!n._featureFilter.filter(d,x,r))continue;if(g||(x.geometry=oF(t)),l){let t=n.getValueAndResolveTokens("text-field",x,r,f),i=rV.factory(t);this.hasRTLText||=function(e){for(let t of e.sections)if(u4(t.text))return!0;return!1}(i),e=function(e,t,r){for(let n of e.sections)n.text=function(e,t,r){let n=t.layout.get("text-transform").evaluate(r,{});return"uppercase"===n?e=e.toLocaleUpperCase():"lowercase"===n&&(e=e.toLocaleLowerCase()),(uj.applyArabicShaping??function(e){if(!uH.test(e))return e;let t=[...e].map(e=>{let t=e.codePointAt(0);return{codePoint:t,type:uK.get(t)??"U",form:null}});return function(e){let t=e.filter(e=>"T"!==e.type);for(let e=0;e<t.length;e++){var r,n,i;let a=t[e],s=e>0&&("D"===(r=t[e-1].type)||"L"===r||"C"===r),o=e+1<t.length&&("D"===(n=t[e+1].type)||"R"===n||"C"===n);i=a.type,a.form="D"===i?s&&o?3:s?1:2*!!o:"R"===i?+!!s:"L"===i?2*!!o:null}}(t),function(e){let t=!1;for(let r of e)"T"===r.type?r.form=3*!!t:t=2===r.form||3===r.form}(t),(function(e){let t=[];for(let r=0;r<e.length;r++){let n=e[r];if(1604!==n.codePoint){t.push(n);continue}let i=r+1;for(;i<e.length&&"T"===e[i].type;)i++;let a=e[i],s=a&&uZ[String.fromCodePoint(1604,a.codePoint)];if(!s){t.push(n);continue}let o=3===n.form||1===n.form;t.push({codePoint:s[+!!o],type:"R",form:0}),t.push(...e.slice(r+1,i)),r=i}return t})(t).map(e=>String.fromCodePoint(function(e){if(null===e.form)return e.codePoint;let t=uW[e.codePoint];return t&&(t[e.form]||t[0])||e.codePoint}(e))).join("")})(e)}(n.text,t,r);return e}(i,n,x)}if(u){let e=n.getValueAndResolveTokens("icon-image",x,r,f);m=e instanceof rj?e:rj.fromString(e)}if(!e&&!m)continue;let v=this.sortFeaturesByKey?h.evaluate(x,{},r):void 0,b={id:s,text:e,icon:m,index:o,sourceLayerIndex:y,geometry:x.geometry,properties:t.properties,type:l8.types[t.type],sortKey:v};if(this.features.push(b),m&&(c[m.name]=!0),e){let t=a.evaluate(x,{},r).join(","),n="viewport"!==i.get("text-rotation-alignment")&&"point"!==i.get("symbol-placement");this.allowVerticalPlacement=this.writingModes?.includes(2);let s=u2(e.toString());for(let r of(this.calculateGlyphDependencies(e,p,t,n,s),e.sections))r.image&&(c[r.image.name]=!0)}}"line"===i.get("symbol-placement")&&(this.features=function(e){let t={},r={},n=[],i=0;function a(t){n.push(e[t]),i++}function s(e,t,i){let a=r[e];return delete r[e],r[t]=a,n[a].geometry[0].pop(),n[a].geometry[0]=n[a].geometry[0].concat(i[0]),a}function o(e,r,i){let a=t[r];return delete t[r],t[e]=a,n[a].geometry[0].shift(),n[a].geometry[0]=i[0].concat(n[a].geometry[0]),a}function l(e,t,r){let n=r?t[0][t[0].length-1]:t[0][0];return`${e}:${n.x}:${n.y}`}for(let u=0;u<e.length;
2u++){let h=e[u],c=h.geometry,p=h.text?h.text.toString():null;if(!p){a(u);continue}let f=l(p,c),d=l(p,c,!0);if(f in r&&d in t&&r[f]!==t[d]){let e=o(f,d,c),i=s(f,d,n[e].geometry);delete t[f],delete r[d],r[l(p,n[i].geometry,!0)]=i,n[e].geometry=null}else f in r?s(f,d,c):d in t?o(f,d,c):(a(u),t[f]=i-1,r[d]=i-1)}return n.filter(e=>e.geometry)}(this.features)),this.sortFeaturesByKey&&this.features.sort((e,t)=>e.sortKey-t.sortKey)}update(e,t,r){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(e,t,this.layers,{imagePositions:r}),this.icon.programConfigurations.updatePaintArrays(e,t,this.layers,{imagePositions:r}))}addFeatures({options:e,canonical:t,glyphMap:r,glyphPositions:n,iconMap:i,iconPositions:a,showCollisionBoxes:s}){!function(e){e.bucket.createArrays();let t=512*e.bucket.overscaling;e.bucket.tilePixelRatio=ez/t,e.bucket.compareText={},e.bucket.iconsNeedLinear=!1;let r=e.bucket.layers[0],n=r.layout,i=r._unevaluatedLayout._values,a={layoutIconSize:i["icon-size"].possiblyEvaluate(new az(e.bucket.zoom+1),e.canonical),layoutTextSize:i["text-size"].possiblyEvaluate(new az(e.bucket.zoom+1),e.canonical),textMaxSize:i["text-size"].possiblyEvaluate(new az(18))};if("composite"===e.bucket.textSizeData.kind){let{minZoom:t,maxZoom:r}=e.bucket.textSizeData;a.compositeTextSizes=[i["text-size"].possiblyEvaluate(new az(t),e.canonical),i["text-size"].possiblyEvaluate(new az(r),e.canonical)]}if("composite"===e.bucket.iconSizeData.kind){let{minZoom:t,maxZoom:r}=e.bucket.iconSizeData;a.compositeIconSizes=[i["icon-size"].possiblyEvaluate(new az(t),e.canonical),i["icon-size"].possiblyEvaluate(new az(r),e.canonical)]}let s=24*n.get("text-line-height"),o="viewport"!==n.get("text-rotation-alignment")&&"point"!==n.get("symbol-placement"),l=n.get("text-keep-upright"),u=n.get("text-size");for(let t of e.bucket.features){let i=n.get("text-font").evaluate(t,{},e.canonical).join(","),h=u.evaluate(t,{},e.canonical),c=a.layoutTextSize.evaluate(t,{},e.canonical),p=a.layoutIconSize.evaluate(t,{},e.canonical),f={horizontal:{},vertical:void 0},d=t.text,y=[0,0];if(d){let a=d.toString(),u=24*n.get("text-letter-spacing").evaluate(t,{},e.canonical),p=!function(e){for(let t of e)if(!function(e){return!/[\u0600-\u0604\u0606-\u060B\u060D-\u061A\u061C-\u061E\u0620-\u063F\u0641-\u064A\u0656-\u066F\u0671-\u06DC\u06DE-\u070D\u070F-\u074A\u074D-\u077F\u07C0-\u07FA\u07FD-\u07FF\u0840-\u085B\u085E\u0860-\u086A\u0870-\u0891\u0897-\u08E1\u08E3-\u08FF\u1800\u1801\u1804\u1806-\u1819\u1820-\u1878\u1880-\u18AA\uA840-\uA877\uFB50-\uFD3D\uFD40-\uFDCF\uFDF0-\uFDFF\uFE70-\uFE74\uFE76-\uFEFC]|\uD802[\uDEC0-\uDEE6\uDEEB-\uDEF6\uDF80-\uDF91\uDF99-\uDF9C\uDFA9-\uDFAF]|\uD803[\uDD00-\uDD27\uDD30-\uDD39\uDE60-\uDE7E\uDEC2-\uDEC7\uDED0-\uDED8\uDEFA-\uDEFF\uDF30-\uDF59\uDF70-\uDF89\uDFB0-\uDFCB]|\uD805[\uDE60-\uDE6C]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9C-\uDC9F]|\uD83A[\uDD00-\uDD4B\uDD50-\uDD59\uDD5E\uDD5F]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB\uDEF0\uDEF1]/gim.test(String.fromCodePoint(e))}(t.codePointAt(0)))return!1;return!0}(a)?0:u,m=n.get("text-anchor").evaluate(t,{},e.canonical),g=hK(r,t,e.canonical);if(!g){let r=n.get("text-radial-offset").evaluate(t,{},e.canonical);y=r?hH(m,[24*r,hZ]):n.get("text-offset").evaluate(t,{},e.canonical).map(e=>24*e)}let x=o?"center":n.get("text-justify").evaluate(t,{},e.canonical),v="point"===n.get("symbol-placement")?24*n.get("text-max-width").evaluate(t,{},e.canonical):1/0,b=()=>{e.bucket.allowVerticalPlacement&&u2(a)&&(f.vertical=hS(d,e.glyphMap,e.glyphPositions,e.imagePositions,i,v,s,m,"left",p,y,2,!0,c,h))};if(!o&&g){let t=new Set;if("auto"===x)for(let e=0;e<g.values.length;e+=2)t.add(hJ(g.values[e]));else t.add(x);let r=!1;for(let n of t)if(!f.horizontal[n])if(r)f.horizontal[n]=f.horizontal[0];else{let t=hS(d,e.glyphMap,e.glyphPositions,e.imagePositions,i,v,s,"center",n,p,y,1,!1,c,h);t&&(f.horizontal[n]=t,r=1===t.positionedLines.length)}b()}else{"auto"===x&&(x=hJ(m));let t=hS(d,e.glyphMap,e.glyphPositions,e.imagePositions,i,v,s,m,x,p,y,1,!1,c,h);t&&(f.horizontal[x]=t),b(),u2(a)&&o&&l&&(f.vertical=hS(d,e.glyphMap,e.glyphPositions,e.imagePositions,i,v,s,m,x,p,y,2,!1,c,h))}}let m,g=!1;if(t.icon?.name){let r=e.imageMap[t.icon.name];r&&(m=function(e,t,r){let{horizontalAlign:n,verticalAlign:i}=hF(r),a=t[0],s=t[1],o=a-e.displaySize[0]*n,l=o+e.displaySize[0],u=s-e.displaySize[1]*i;return{image:e,top:u,bottom:u+e.displaySize[1],left:o,right:l}}(e.imagePositions[t.icon.name],n.get("icon-offset").evaluate(t,{},e.canonical),n.get("icon-anchor").evaluate(t,{},e.canonical)),g=!!r.sdf,void 0===e.bucket.sdfIcons?e.bucket.sdfIcons=g:e.bucket.sdfIcons!==g&&to("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),r.pixelRatio===e.bucket.pixelRatio?0!==n.get("icon-rotate").constantOr(1)&&(e.bucket.iconsNeedLinear=!0):e.bucket.iconsNeedLinear=!0)}let x=h1(f.horizontal)||f.vertical;e.bucket.iconsInText||=!!x&&x.iconsInText,(x||m)&&function(e,t,r,n,i,a,s,o,l,u,h,c){let p=a.textMaxSize.evaluate(t,{});void 0===p&&(p=s);let f=e.layers[0].layout,d=f.get("icon-offset").evaluate(t,{},h),y=h1(r.horizontal),m=s/24,g=e.tilePixelRatio*m,x=e.tilePixelRatio*p/24,v=e.tilePixelRatio*o,b=e.tilePixelRatio*f.get("symbol-spacing"),w=f.get("text-padding")*e.tilePixelRatio,D=function(e,t,r,n=1){let i=e.get("icon-padding").evaluate(t,{},r)?.values;return[i[0]*n,i[1]*n,i[2]*n,i[3]*n]}(f,t,h,e.tilePixelRatio),_=f.get("text-max-angle")/180*Math.PI,A="viewport"!==f.get("text-rotation-alignment")&&"point"!==f.get("symbol-placement"),E="map"===f.get("icon-rotation-alignment").constantOr("viewport")&&"point"!==f.get("symbol-placement"),S=f.get("symbol-placement"),F=b/2,k=f.get("icon-text-fit"),T;n&&"none"!==k&&(e.allowVerticalPlacement&&r.vertical&&(T=hB(n,r.vertical,k,f.get("icon-text-fit-padding"),d,m)),y&&(n=hB(n,y,k,f.get("icon-text-fit-padding"),d,m)));let I=h?c.line.getGranularityForZoomLevel(h.z):1,B=(o,c)=>
2{c.x<0||c.x>=8192||c.y<0||c.y>=8192||function(e,t,r,n,i,a,s,o,l,u,h,c,p,f,d,y,m,g,x,v,b,w,D,_,A){let E=e.addToLineVertexArray(t,r),S=o.layout.get("symbol-height-offset").evaluate(b,{},_);S>e.maxHeightOffset&&(e.maxHeightOffset=S);let F,k,T,I,C=0,B=0,M=0,P=0,z=-1,L=-1,V={},R=(0,oe.default)("");if(e.allowVerticalPlacement&&n.vertical){let e=o.layout.get("text-rotate").evaluate(b,{},_)+90;T=new hj(l,t,u,h,c,n.vertical,p,f,d,e),s&&(I=new hj(l,t,u,h,c,s,m,g,d,e))}if(i){let r=o.layout.get("icon-rotate").evaluate(b,{}),n="none"!==o.layout.get("icon-text-fit"),a=hN(i,r,D,n),p=s?hN(s,r,D,n):void 0;k=new hj(l,t,u,h,c,i,m,g,!1,r),C=4*a.length;let f=e.iconSizeData,d=null;"source"===f.kind?(d=[128*o.layout.get("icon-size").evaluate(b,{})])[0]>32640&&to(`${e.layerIds[0]}: Value for "icon-size" is >= 255. Reduce your "icon-size".`):"composite"===f.kind&&((d=[128*w.compositeIconSizes[0].evaluate(b,{},_),128*w.compositeIconSizes[1].evaluate(b,{},_)])[0]>32640||d[1]>32640)&&to(`${e.layerIds[0]}: Value for "icon-size" is >= 255. Reduce your "icon-size".`),e.addSymbols(e.icon,a,d,v,x,b,0,t,E.lineStartIndex,E.lineLength,-1,_,S),z=e.icon.placedSymbolArray.length-1,p&&(B=4*p.length,e.addSymbols(e.icon,p,d,v,x,b,2,t,E.lineStartIndex,E.lineLength,-1,_,S),L=e.icon.placedSymbolArray.length-1)}let O=Object.keys(n.horizontal);for(let r of O){let i=n.horizontal[r];F||=(R=(0,oe.default)(i.text),new hj(l,t,u,h,c,i,p,f,d,o.layout.get("text-rotate").evaluate(b,{},_)));let s=1===i.positionedLines.length;if(M+=hQ(e,t,i,a,o,d,b,y,S,E,n.vertical?1:3,s?O:[r],V,z,w,_),s)break}n.vertical&&(P+=hQ(e,t,n.vertical,a,o,d,b,y,S,E,2,["vertical"],V,L,w,_));let $=F?F.boxStartIndex:e.collisionBoxArray.length,N=F?F.boxEndIndex:e.collisionBoxArray.length,U=T?T.boxStartIndex:e.collisionBoxArray.length,q=T?T.boxEndIndex:e.collisionBoxArray.length,j=k?k.boxStartIndex:e.collisionBoxArray.length,G=k?k.boxEndIndex:e.collisionBoxArray.length,Y=I?I.boxStartIndex:e.collisionBoxArray.length,X=I?I.boxEndIndex:e.collisionBoxArray.length,W=-1,Z=(e,t)=>e?.circleDiameter?Math.max(e.circleDiameter,t):t;W=Z(F,-1),W=Z(T,W),W=Z(k,W);let H=+((W=Z(I,W))>-1);H&&(W*=A/24),e.glyphOffsetArray.length>=e.maxGlyphs&&to("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),void 0!==b.sortKey&&e.addToSortKeyRanges(e.symbolInstances.length,b.sortKey);let K=hK(o,b,_),[J,Q]=function(e,t){let r=e.length,n=t?.values;if(n?.length>0)for(let t=0;t<n.length;t+=2){let r=hW[n[t]],i=n[t+1];e.emplaceBack(r,i[0],i[1])}return[r,e.length]}(e.textAnchorOffsets,K);e.symbolInstances.emplaceBack(t.x,t.y,V.right>=0?V.right:-1,V.center>=0?V.center:-1,V.left>=0?V.left:-1,V.vertical||-1,z,L,R,$,N,U,q,j,G,Y,X,u,M,P,C,B,H,0,p,W,J,Q,S)}(e,c,o,r,n,i,T,e.layers[0],e.collisionBoxArray,t.index,t.sourceLayerIndex,e.index,g,[w,w,w,w],A,l,v,D,E,d,t,a,u,h,s)};if("line"===S)for(let i of h$(t.geometry,0,0,ez,ez)){let t=lX(i,I);for(let i of function(e,t,r,n,i,a,s,o,l){let u=n?.6*24*s:0,h=hO(n,i),c=h*s,p=0===e[0].x||e[0].x===l||0===e[0].y||e[0].y===l;t-c<t/4&&(t=c+t/4);let f=48;return function e(t,r,n,i,a,s,o,l,u){let h=s/2,c=hR(t),p=0,f=r-n,d=[];for(let e=0;e<t.length-1;e++){let r=t[e],o=t[e+1],l=r.dist(o),y=o.angleTo(r);for(;f+n<p+l;){let m=((f+=n)-p)/l,g=r5.number(r.x,o.x,m),x=r5.number(r.y,o.y,m);if(g>=0&&g<u&&x>=0&&x<u&&f-h>=0&&f+h<=c){let r=new hL(g,x,y,e);r._round(),(!i||hV(t,r,s,i,a))&&d.push(r)}}p+=l}return l||d.length||o||(d=e(t,p/2,n,i,a,s,o,!0,u)),d}(e,p?t/2*o%t:(h/2+f)*s*o%t,t,u,r,c,p,!1,l)}(t,b,_,r.vertical||y,n,24,x,e.overscaling,ez))y&&function(e,t,r,n){let i=e.compareText;if(t in i){let e=i[t];for(let t=e.length-1;t>=0;t--)if(n.dist(e[t])<r)return!0}else i[t]=[];return i[t].push(n),!1}(e,y.text,F,i)||B(t,i)}else if("line-center"===S){for(let e of t.geometry)if(e.length>1){let t=lX(e,I),i=function(e,t,r,n,i,a){let s=r?.6*24*a:0,o=hO(r,n)*a,l=0,u=hR(e)/2;for(let r=0;r<e.length-1;r++){let n=e[r],i=e[r+1],a=n.dist(i);if(l+a>u){let h=(u-l)/a,c=new hL(r5.number(n.x,i.x,h),r5.number(n.y,i.y,h),i.angleTo(n),r);return c._round(),!s||hV(e,c,o,s,t)?c:void 0}l+=a}}(t,_,r.vertical||y,n,0,x);i&&B(t,i)}}else if("Polygon"===t.type)for(let e of r8(t.geometry,0)){let t=function(e,t=1){let r=l3.fromPoints(e[0]),n=Math.min(r.width(),r.height()),i=n/2,a=new hG([],hY),{minX:s,minY:o,maxX:l,maxY:u}=r;if(0===n)return new C(s,o);for(let t=s;t<l;t+=n)for(let r=o;r<u;r+=n)a.push(new hX(t+i,r+i,i,e));let h=function(e){let t=0,r=0,n=0,i=e[0];for(let e=0,a=i.length,s=a-1;e<a;s=e++){let a=i[e],o=i[s],l=a.x*o.y-o.x*a.y;r+=(a.x+o.x)*l,n+=(a.y+o.y)*l,t+=3*l}return new hX(r/t,n/t,0,e)}(e),c=h;for(;a.length;){let r=a.pop();(r.d>c.d||!c.d)&&(c=r),r.max-c.d<=t||(i=r.h/2,a.push(new hX(r.p.x-i,r.p.y-i,i,e)),a.push(new hX(r.p.x+i,r.p.y-i,i,e)),a.push(new hX(r.p.x-i,r.p.y+i,i,e)),a.push(new hX(r.p.x+i,r.p.y+i,i,e)))}return h.d>0&&c.d-h.d<=t?h.p:c.p}(e,16);B(lX(e[0],I,!0),new hL(t.x,t.y,0))}else if("LineString"===t.type)for(let e of t.geometry){let t=lX(e,I);B(t,new hL(t[0].x,t[0].y,0))}else if("Point"===t.type)for(let e of t.geometry)for(let t of e)B([t],new hL(t.x,t.y,0))}(e.bucket,t,f,m,e.imageMap,a,c,p,y,g,e.canonical,e.subdivisionGranularity)}e.showCollisionBoxes&&e.bucket.generateCollisionDebugBuffers()}({bucket:this,glyphMap:r,glyphPositions:n,imageMap:i,imagePositions:a,showCollisionBoxes:s,canonical:t,subdivisionGranularity:e.subdivisionGranularity})}isEmpty(){return 0===this.symbolInstances.length}uploadPending(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload}upload(e){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(e),this.iconCollisionBox.upload(e)),this.text.upload(e,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(e,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0}destroyDebugData(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()}destroy(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()}addToLineVertexArray(e,t){let r=this.lineVertexArray.length;if(void 0!==e.segment){let r=e.dist(t[e.segment+1]),n=e.dist(t[e.segment]),i={};for(let n=e.segment+1;n<t.length;n++)i[n]={x:t[n].x,y:t[n].y,tileUnitDistanceFromAnchor:r},n<t.length-1&&(r+=t[n+1].dist(t[n]));for(let r=e.segment||0;r>=0;r--)i[r]={x:t[r].x,y:t[r].y,tileUnitDistanceFromAnchor:n},r>0&&(n+=t[r-1].dist(t[r]));for(let e=0;e<t.length;e++){let t=i[e];this.lineVertexArray.emplaceBack(t.x,t.y,t.tileUnitDistanceFromAnchor)}}return{lineStartIndex:r,lineLength:this.lineVertexArray.length-r}}addSymbols(e,t,r,n,i,a,s,o,l,u,h,c,p){let f=e.indexArray,d=e.layoutVertexArray,y=e.segments.prepareSegment(4*t.length,d,f,this.canOverlap?a.sortKey:void 0),m=this.glyphOffsetArray.length,g=y.vertexLength,x=this.allowVerticalPlacement&&2===s?Math.PI/2:0,v=a.text&&a.text.sections;for(let n=0;n<t.length;n++){let{tl:i,tr:s,bl:l,br:u,tex:h,pixelOffsetTL:m,pixelOffsetBR:g,minFontScaleX:b,minFontScaleY:w,glyphOffset:D,isSDF:_,sectionIndex:A}=t[n],E=y.vertexLength,S=D[1];h3(d,o.x,o.y,i.x,S+i.y,h.x,h.y,r,_,m.x,m.y,b,w,p),h3(d,o.x,o.y,s.x,S+s.y,h.x+h.w,h.y,r,_,g.x,m.y,b,w,p),h3(d,o.x,o.y,l.x,S+l.y,h.x,h.y+h.h,r,_,m.x,g.y,b,w,p),h3(d,o.x,o.y,u.x,S+u.y,h.x+h.w,h.y+h.h,r,_,g.x,g.y,b,w,p),h5(e.dynamicLayoutVertexArray,o,x),f.emplaceBack(E,E+2,E+1),f.emplaceBack(E+1,E+2,E+3),y.vertexLength+=4,y.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(D[0]),(n===t.length-1||A!==t[n+1].sectionIndex)&&e.programConfigurations.populatePaintArrays(d.length,a,a.index,{imagePositions:{},canonical:c,formattedSection:v?.[A]})}e.placedSymbolArray.emplaceBack(o.x,o.y,m,this.glyphOffsetArray.length-m,g,l,u,o.segment,r?r[0]:0,r?r[1]:0,n[0],n[1],s,0,!1,0,h,p)}_addCollisionDebugVertex(e,t,r,n,i,a){return t.emplaceBack(0,0),e.emplaceBack(r.x,r.y,n,i,Math.round(a.x),Math.round(a.y))}addCollisionDebugVertices(e,t,r,n,i,a,s){let o=i.segments.prepareSegment(4,i.layoutVertexArray,i.indexArray),l=o.vertexLength,u=i.layoutVertexArray,h=i.collisionVertexArray,c=s.anchorX,p=s.anchorY;this._addCollisionDebugVertex(u,h,a,c,p,new C(e,t)),this._addCollisionDebugVertex(u,h,a,c,p,new C(r,t)),this._addCollisionDebugVertex(u,h,a,c,p,new C(r,n)),this._addCollisionDebugVertex(u,h,a,c,p,new C(e,n)),o.vertexLength+=4;let f=i.indexArray;f.emplaceBack(l,l+1),f.emplaceBack(l+1,l+2),f.emplaceBack(l+2,l+3),f.emplaceBack(l+3,l),o.primitiveLength+=4}addDebugCollisionBoxes(e,t,r,n){for(let i=e;i<t;i++){let e=this.collisionBoxArray.get(i),t=e.x1,a=e.y1,s=e.x2,o=e.y2;this.addCollisionDebugVertices(t,a,s,o,n?this.textCollisionBox:this.iconCollisionBox,e.anchorPoint,r)}}generateCollisionDebugBuffers(){this.hasDebugData()&&this.destroyDebugData(),this.textCollisionBox=new h4
2(sZ,uU.members,s1),this.iconCollisionBox=new h4(sZ,uU.members,s1);for(let e=0;e<this.symbolInstances.length;e++){let t=this.symbolInstances.get(e);this.addDebugCollisionBoxes(t.textBoxStartIndex,t.textBoxEndIndex,t,!0),this.addDebugCollisionBoxes(t.verticalTextBoxStartIndex,t.verticalTextBoxEndIndex,t,!0),this.addDebugCollisionBoxes(t.iconBoxStartIndex,t.iconBoxEndIndex,t,!1),this.addDebugCollisionBoxes(t.verticalIconBoxStartIndex,t.verticalIconBoxEndIndex,t,!1)}}_deserializeCollisionBoxesForSymbol(e,t,r,n,i,a,s,o,l){let u={};for(let n=t;n<r;n++){let t=e.get(n);u.textBox={x1:t.x1,y1:t.y1,x2:t.x2,y2:t.y2,anchorPointX:t.anchorPointX,anchorPointY:t.anchorPointY},u.textFeatureIndex=t.featureIndex;break}for(let t=n;t<i;t++){let r=e.get(t);u.verticalTextBox={x1:r.x1,y1:r.y1,x2:r.x2,y2:r.y2,anchorPointX:r.anchorPointX,anchorPointY:r.anchorPointY},u.verticalTextFeatureIndex=r.featureIndex;break}for(let t=a;t<s;t++){let r=e.get(t);u.iconBox={x1:r.x1,y1:r.y1,x2:r.x2,y2:r.y2,anchorPointX:r.anchorPointX,anchorPointY:r.anchorPointY},u.iconFeatureIndex=r.featureIndex;break}for(let t=o;t<l;t++){let r=e.get(t);u.verticalIconBox={x1:r.x1,y1:r.y1,x2:r.x2,y2:r.y2,anchorPointX:r.anchorPointX,anchorPointY:r.anchorPointY},u.verticalIconFeatureIndex=r.featureIndex;break}return u}deserializeCollisionBoxes(e){this.collisionArrays=[];for(let t=0;t<this.symbolInstances.length;t++){let r=this.symbolInstances.get(t);this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(e,r.textBoxStartIndex,r.textBoxEndIndex,r.verticalTextBoxStartIndex,r.verticalTextBoxEndIndex,r.iconBoxStartIndex,r.iconBoxEndIndex,r.verticalIconBoxStartIndex,r.verticalIconBoxEndIndex))}}hasTextData(){return this.text.segments.get().length>0}hasIconData(){return this.icon.segments.get().length>0}hasDebugData(){return this.textCollisionBox&&this.iconCollisionBox}hasTextCollisionBoxData(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0}hasIconCollisionBoxData(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0}addIndicesForPlacedSymbol(e,t){let r=e.placedSymbolArray.get(t),n=r.vertexStartIndex+4*r.numGlyphs;for(let t=r.vertexStartIndex;t<n;t+=4)e.indexArray.emplaceBack(t,t+2,t+1),e.indexArray.emplaceBack(t+1,t+2,t+3)}getSortedSymbolIndexes(e){if(this.sortedAngle===e&&void 0!==this.symbolInstanceIndexes)return this.symbolInstanceIndexes;let t=Math.sin(e),r=Math.cos(e),n=[],i=[],a=[];for(let e=0;e<this.symbolInstances.length;++e){a.push(e);let s=this.symbolInstances.get(e);n.push(0|Math.round(t*s.anchorX+r*s.anchorY)),i.push(s.featureIndex)}return a.sort((e,t)=>n[e]-n[t]||i[t]-i[e]),a}addToSortKeyRanges(e,t){let r=this.sortKeyRanges[this.sortKeyRanges.length-1];r?.sortKey===t?r.symbolInstanceEnd=e+1:this.sortKeyRanges.push({sortKey:t,symbolInstanceStart:e,symbolInstanceEnd:e+1})}sortFeatures(e){if(this.sortFeaturesByY&&this.sortedAngle!==e&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){for(let t of(this.symbolInstanceIndexes=this.getSortedSymbolIndexes(e),this.sortedAngle=e,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[],this.symbolInstanceIndexes)){let e=this.symbolInstances.get(t);this.featureSortOrder.push(e.featureIndex);let r=[e.rightJustifiedTextSymbolIndex,e.centerJustifiedTextSymbolIndex,e.leftJustifiedTextSymbolIndex];for(let e=0;e<r.length;e++){let t=r[e];t>=0&&r.indexOf(t)===e&&this.addIndicesForPlacedSymbol(this.text,t)}e.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,e.verticalPlacedTextSymbolIndex),e.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,e.placedIconSymbolIndex),e.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,e.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}};ak("SymbolBucket",h8,{omit:["layers","collisionBoxArray","features","compareText"]});var h7={get paint(){return w||=new aJ({"icon-opacity":new aW(tQ.paint_symbol["icon-opacity"],"icon-opacity"),"icon-color":new aW(tQ.paint_symbol["icon-color"],"icon-color"),"icon-halo-color":new aW(tQ.paint_symbol["icon-halo-color"],"icon-halo-color"),"icon-halo-width":new aW(tQ.paint_symbol["icon-halo-width"],"icon-halo-width"),"icon-halo-blur":new aW(tQ.paint_symbol["icon-halo-blur"],"icon-halo-blur"),"icon-translate":new aX(tQ.paint_symbol["icon-translate"],"icon-translate"),"icon-translate-anchor":new aX(tQ.paint_symbol["icon-translate-anchor"],"icon-translate-anchor"),"text-opacity":new aW(tQ.paint_symbol["text-opacity"],"text-opacity"),"text-color":new aW(tQ.paint_symbol["text-color"],"text-color",{runtimeType:t4,getOverride:e=>e.textColor,hasOverride:e=>!!e.textColor}),"text-halo-color":new aW(tQ.paint_symbol["text-halo-color"],"text-halo-color"),"text-halo-width":new aW(tQ.paint_symbol["text-halo-width"],"text-halo-width"),"text-halo-blur":new aW(tQ.paint_symbol["text-halo-blur"],"text-halo-blur"),"text-translate":new aX(tQ.paint_symbol["text-translate"],"text-translate"),"text-translate-anchor":new aX(tQ.paint_symbol["text-translate-anchor"],"text-translate-anchor")})},get layout(){return b||=new aJ({"symbol-placement":new aX(tQ.layout_symbol["symbol-placement"],"symbol-placement"),"symbol-spacing":new aX(tQ.layout_symbol["symbol-spacing"],"symbol-spacing"),"symbol-avoid-edges":new aX(tQ.layout_symbol["symbol-avoid-edges"],"symbol-avoid-edges"),"symbol-sort-key":new aW(tQ.layout_symbol["symbol-sort-key"],"symbol-sort-key"),"symbol-z-order":new aX(tQ.layout_symbol["symbol-z-order"],"symbol-z-order"),"icon-allow-overlap":new aX(tQ.layout_symbol["icon-allow-overlap"],"icon-allow-overlap"),"icon-overlap":new aX(tQ.layout_symbol["icon-overlap"],"icon-overlap"),"icon-ignore-placement":new aX(tQ.layout_symbol["icon-ignore-placement"],"icon-ignore-placement"),"icon-optional":new aX(tQ.layout_symbol["icon-optional"],"icon-optional"),"icon-rotation-alignment":new aW(tQ.layout_symbol["icon-rotation-alignment"],"icon-rotation-alignment"),"icon-size":new aW(tQ.layout_symbol["icon-size"],"icon-size"),"icon-text-fit":new aX(tQ.layout_symbol["icon-text-fit"],"icon-text-fit"),"icon-text-fit-padding":new aX(tQ.layout_symbol["icon-text-fit-padding"],"icon-text-fit-padding"),"icon-image":new aW(tQ.layout_symbol["icon-image"],"icon-image"),"icon-rotate":new aW(tQ.layout_symbol["icon-rotate"],"icon-rotate"),"icon-padding":new aW(tQ.layout_symbol["icon-padding"],"icon-padding"),"icon-keep-upright":new aX(tQ.layout_symbol["icon-keep-upright"],"icon-keep-upright"),"icon-offset":new aW(tQ.layout_symbol["icon-offset"],"icon-offset"),"icon-anchor":new aW(tQ.layout_symbol["icon-anchor"],"icon-anchor"),"icon-pitch-alignment":new aX(tQ.layout_symbol["icon-pitch-alignment"],"icon-pitch-alignment"),"text-pitch-alignment":new aX(tQ.layout_symbol["text-pitch-alignment"],"text-pitch-alignment"),"text-rotation-alignment":new aX(tQ.layout_symbol["text-rotation-alignment"],"text-rotation-alignment"),"text-field":new aW(tQ.layout_symbol["text-field"],"text-field"),"text-font":new aW(tQ.layout_symbol["text-font"],"text-font"),"text-size":new aW(tQ.layout_symbol["text-size"],"text-size"),"text-max-width":new aW(tQ.layout_symbol["text-max-width"],"text-max-width"),"text-line-height":new aX(tQ.layout_symbol["text-line-height"],"text-line-height"),"text-letter-spacing":new aW(tQ.layout_symbol["text-letter-spacing"],"text-letter-spacing"),"text-justify":new aW(tQ.layout_symbol["text-justify"],"text-justify"),"text-radial-offset":new aW(tQ.layout_symbol["text-radial-offset"],"text-radial-offset"),"text-variable-anchor":new aX(tQ.layout_symbol["text-variable-anchor"],"text-variable-anchor"),"text-variable-anchor-offset":new aW(tQ.layout_symbol["text-variable-anchor-offset"],"text-variable-anchor-offset"),"text-anchor":new aW(tQ.layout_symbol["text-anchor"],"text-anchor"),"text-max-angle":new aX(tQ.layout_symbol["text-max-angle"],"text-max-angle"),"text-writing-mode":new aX(tQ.layout_symbol["text-writing-mode"],"text-writing-mode"),"text-rotate":new aW(tQ.layout_symbol["text-rotate"],"text-rotate"),"text-padding":new aX(tQ.layout_symbol["text-padding"],"text-padding"),"text-keep-upright":new aX(tQ.layout_symbol["text-keep-upright"],"text-keep-upright"),"text-transform":new aW(tQ.layout_symbol["text-transform"],"text-transform"),"text-offset":new aW(tQ.layout_symbol["text-offset"],"text-offset"),"text-allow-overlap":new aX(tQ.layout_symbol["text-allow-overlap"],"text-allow-overlap"),"text-overlap":new aX(tQ.layout_symbol["text-overlap"],"text-overlap"),"text-ignore-placement":new aX(tQ.layout_symbol["text-ignore-placement"],"text-ignore-placement"),"text-optional":new aX(tQ.layout_symbol["text-optional"],"text-optional"),"symbol-height-offset":new aW(tQ.layout_symbol["symbol-height-offset"],"symbol-height-offset"),"symbol-height-anchor":new aX(tQ.layout_symbol["symbol-height-anchor"],"symbol-height-anchor")})}},h9=class{constructor(e){if(void 0===e.property.overrides)throw Error("overrides must be provided to instantiate FormatSectionOverride class");this.type=e.property.overrides?e.property.overrides.runtimeType:t2,this.defaultValue=e}evaluate(e){if(e.formattedSection){let t=this.defaultValue.property.overrides;if(t?.hasOverride(e.formattedSection))return t.getOverride(e.formattedSection)}return e.feature&&e.featureState?this.defaultValue.evaluate(e.feature,e.featureState):this.defaultValue.property.specification.default}eachChild(e){this.defaultValue.isConstant()||e(this.defaultValue.value._styleExpression.expression)}outputDefined(){return!1}serialize(){return null}};ak("FormatSectionOverride",h9,{omit:["defaultValue"]});let ce=e=>"symbol"===e.type;var ct=class e extends a0{constructor(e,t){super(e,h7,t)}recalculate(e,t){super.recalculate(e,t);let r=this.layout.get("icon-rotation-alignment");
2if(("constant"!==r.value.kind||"auto"===r.value.value)&&(this.layout._values["icon-rotation-alignment"]=new aq(r.property,{kind:"constant",value:"point"===this.layout.get("symbol-placement")?"viewport":"map"},r.parameters)),"auto"===this.layout.get("text-rotation-alignment")&&("point"===this.layout.get("symbol-placement")?this.layout._values["text-rotation-alignment"]="viewport":this.layout._values["text-rotation-alignment"]="map"),"auto"===this.layout.get("text-pitch-alignment")&&(this.layout._values["text-pitch-alignment"]="map"===this.layout.get("text-rotation-alignment")?"map":"viewport"),"auto"===this.layout.get("icon-pitch-alignment")&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment").constantOr("viewport")),"point"===this.layout.get("symbol-placement")){let e=this.layout.get("text-writing-mode");if(e){let t=[];for(let r of e)t.includes(r)||t.push(r);this.layout._values["text-writing-mode"]=t}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()}getValueAndResolveTokens(e,t,r,n){var i;let a=this.layout.get(e).evaluate(t,{},r,n),s=this._unevaluatedLayout._values[e];return s.isDataDriven()||iT(s.value)||!a?a:(i=t.properties,a.replace(/{([^{}]+)}/g,(e,t)=>i&&t in i?String(i[t]):""))}createBucket(e){return new h8(e)}queryRadius(){return 0}queryIntersectsFeature(){throw Error("Should take a different path in FeatureIndex")}_setPaintOverrides(){for(let t of h7.paint.overridableProperties){if(!e.hasPaintOverride(this.layout,t))continue;let r=this.paint.get(t),n=new iS(new h9(r),`layers[${this.id}].paint.${r.property.name}`,r.property.specification),i=null;i="constant"===r.value.kind||"source"===r.value.kind?new iC("source",n):new iB("composite",n,r.value.zoomStops),this.paint._values[t]=new aq(r.property,i,r.parameters)}}_handleOverridablePaintPropertyUpdate(t,r,n){return!(!this.layout||r.isDataDriven()||n.isDataDriven())&&e.hasPaintOverride(this.layout,t)}static hasPaintOverride(e,t){let r=e.get("text-field"),n=h7.paint.properties[t],i=!1,a=e=>{for(let t of e)if(n.overrides?.hasOverride(t)){i=!0;return}};if("constant"===r.value.kind&&r.value.value instanceof rV)a(r.value.value.sections);else if("source"===r.value.kind||"composite"===r.value.kind){let e=t=>{i||(t instanceof rK&&rZ(t.value)===rt?a(t.value.sections):t instanceof r6?a(t.sections):t.eachChild(e))},t=r.value;t._styleExpression&&e(t._styleExpression.expression)}return i}},cr={get paint(){return D||=new aJ({"background-color":new aX(tQ.paint_background["background-color"],"background-color"),"background-pattern":new aH(tQ.paint_background["background-pattern"],"background-pattern"),"background-opacity":new aX(tQ.paint_background["background-opacity"],"background-opacity")})}};let cn=e=>"background"===e.type;var ci=class extends a0{constructor(e,t){super(e,cr,t)}};function ca(e){let t=[],r=e.id;return void 0===r&&t.push(new t0(`layers.${r}`,null,'missing required property "id"')),void 0===e.render&&t.push(new t0(`layers.${r}`,null,'missing required method "render"')),e.renderingMode&&"2d"!==e.renderingMode&&"3d"!==e.renderingMode&&t.push(new t0(`layers.${r}`,null,'property "renderingMode" must be either "2d" or "3d"')),t}let cs=e=>"custom"===e.type;var co=class extends a0{constructor(e,t){super(e,{},t),this.onAdd=e=>{this.implementation.onAdd&&this.implementation.onAdd(e,e.painter.context.gl)},this.onRemove=e=>{this.implementation.onRemove&&this.implementation.onRemove(e,e.painter.context.gl)},this.implementation=e}is3D(){return"3d"===this.implementation.renderingMode}hasOffscreenPass(){return void 0!==this.implementation.prerender}recalculate(){}updateTransitions(){}hasTransition(){return!1}serialize(){throw Error("Custom layers cannot be serialized")}};function cl(e,t){if("custom"===e.type)return new co(e,t);switch(e.type){case"background":return new ci(e,t);case"circle":return new oZ(e,t);case"color-relief":return new ls(e,t);case"fill":return new lQ(e,t);case"fill-extrusion":return new uS(e,t);case"heatmap":return new o8(e,t);case"hillshade":return new le(e,t);case"line":return new uR(e,t);case"raster":return new a5(e,t);case"symbol":return new ct(e,t)}}var cu=class{constructor(e){this._methodToThrottle=e,this._triggered=!1,this._channel=new MessageChannel,this._channel.port2.onmessage=()=>{this._triggered=!1,this._methodToThrottle()}}trigger(){this._triggered||(this._triggered=!0,this._channel?.port1.postMessage(!0))}remove(){delete this._channel,this._methodToThrottle=()=>{}}};let ch={once:!0};var cc=class{constructor(e,t){this.target=e,this.mapId=t,this.resolveRejects={},this.tasks={},this.taskQueue=[],this.abortControllers={},this.messageHandlers={},this.invoker=new cu(()=>this.process()),this.subscription=tv(this.target,"message",e=>this.receive(e),!1),this.globalScope=tc(self)?e:window}registerMessageHandler(e,t){this.messageHandlers[e]=t}unregisterMessageHandler(e){delete this.messageHandlers[e]}sendAsync(e,t){return new Promise((r,n)=>{let i=Math.round(1e18*Math.random()).toString(36).substring(0,10),a=t?tv(t.signal,"abort",()=>{a?.unsubscribe(),delete this.resolveRejects[i];let r={id:i,type:"<cancel>",origin:location.origin,targetMapId:e.targetMapId,sourceMapId:this.mapId};this.target.postMessage(r),n(new tM(t.signal.reason))},ch):null;this.resolveRejects[i]={resolve:e=>{a?.unsubscribe(),r(e)},reject:e=>{a?.unsubscribe(),n(e)}};let s=[],o={...e,id:i,sourceMapId:this.mapId,origin:location.origin,data:aB(e.data,s)};this.target.postMessage(o,{transfer:s})})}receive(e){let t=e.data,r=t.id,n=["file://","resource://android","null"],i=[t.origin,location.origin],a=t.origin===location.origin,s=i.some(e=>n.includes(e));if((a||s)&&!(t.targetMapId&&this.mapId!==t.targetMapId)){if("<cancel>"===t.type){delete this.tasks[r];let e=this.abortControllers[r];delete this.abortControllers[r],e&&e.abort();return}if(tc(self)||t.mustQueue){this.tasks[r]=t,this.taskQueue.push(r),this.invoker.trigger();return}this.processTask(r,t)}}process(){if(0===this.taskQueue.length)return;let e=this.taskQueue.shift(),t=this.tasks[e];delete this.tasks[e],this.taskQueue.length>0&&this.invoker.trigger(),t&&this.processTask(e,t)}async processTask(e,t){if("<response>"===t.type){let r=this.resolveRejects[e];if(delete this.resolveRejects[e],!r)return;t.error?r.reject(eV(aM(t.error))):r.resolve(aM(t.data));return}if(!this.messageHandlers[t.type])return void this.completeTask(e,null,null);let r=aM(t.data),n=new AbortController;this.abortControllers[e]=n;try{let i=await this.messageHandlers[t.type](t.sourceMapId,r,n);this.completeTask(e,null,i)}catch(t){this.completeTask(e,eV(t))}}completeTask(e,t,r){let n=[];delete this.abortControllers[e];let i={id:e,type:"<response>",sourceMapId:this.mapId,origin:location.origin,error:t?aB(t):null,data:aB(r,n)};this.target.postMessage(i,{transfer:n})}remove(){this.invoker.remove(),this.subscription.unsubscribe()}};function cp(e,t){let{x:r,y:n}=uc.fromLngLat(t);return!(e<0||e>25||n<0||n>=1||r<0||r>=1)}var cf=class{constructor(e,t,r){if(!function(e,t,r){return!(e<0||e>25||r<0||r>=2**e||t<0||t>=2**e)}(e,t,r))throw Error(`x=${t}, y=${r}, z=${e} outside of bounds. 0<=x<${2**e}, 0<=y<${2**e} 0<=z<=25 `);this.z=e,this.x=t,this.y=r,this.key=cm(0,e,e,t,r)}equals(e){return this.z===e.z&&this.x===e.x&&this.y===e.y}url(e,t,r){var n,i,a;let s,o,l=(n=this.x,i=this.y,a=this.z,s=cx(256*n,256*(i=2**a-i-1),a),o=cx((n+1)*256,(i+1)*256,a),`${s[0]},${s[1]},${o[0]},${o[1]}`),u=function(e,t,r){let n="";for(let i=e;i>0;i--){let e=1<<i-1;n+=(t&e?1:0)+(r&e?2:0)}return n}(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}
2/g,String("tms"===r?2**this.z-this.y-1:this.y)).replace(/{ratio}/g,t>1?"@2x":"").replace(/{quadkey}/g,u).replace(/{bbox-epsg-3857}/g,l)}isChildOf(e){let t=this.z-e.z;return t>0&&e.x===this.x>>t&&e.y===this.y>>t}getTilePoint(e){let t=2**this.z;return new C((e.x*t-this.x)*ez,(e.y*t-this.y)*ez)}toString(){return`${this.z}/${this.x}/${this.y}`}},cd=class{constructor(e,t){this.wrap=e,this.canonical=t,this.key=cm(e,t.z,t.z,t.x,t.y)}},cy=class e{constructor(e,t,r,n,i){if(this.terrainRttPosMatrix32f=null,e<r)throw Error(`overscaledZ should be >= z; overscaledZ = ${e}; z = ${r}`);this.overscaledZ=e,this.wrap=t,this.canonical=new cf(r,+n,+i),this.key=cm(t,e,r,n,i)}clone(){return new e(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(t){if(t>this.overscaledZ)throw Error(`targetZ > this.overscaledZ; targetZ = ${t}; overscaledZ = ${this.overscaledZ}`);let r=this.canonical.z-t;return t>this.canonical.z?new e(t,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new e(t,this.wrap,t,this.canonical.x>>r,this.canonical.y>>r)}isOverscaled(){return this.overscaledZ>this.canonical.z}calculateScaledKey(e,t){if(e>this.overscaledZ)throw Error(`targetZ > this.overscaledZ; targetZ = ${e}; overscaledZ = ${this.overscaledZ}`);let r=this.canonical.z-e;return e>this.canonical.z?cm(this.wrap*t,e,this.canonical.z,this.canonical.x,this.canonical.y):cm(this.wrap*t,e,e,this.canonical.x>>r,this.canonical.y>>r)}isChildOf(e){if(e.wrap!==this.wrap||this.overscaledZ-e.overscaledZ<=0)return!1;if(0===e.overscaledZ)return this.overscaledZ>0;let t=this.canonical.z-e.canonical.z;return!(t<0)&&e.canonical.x===this.canonical.x>>t&&e.canonical.y===this.canonical.y>>t}children(t){if(this.overscaledZ>=t)return[new e(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];let r=this.canonical.z+1,n=2*this.canonical.x,i=2*this.canonical.y;return[new e(r,this.wrap,r,n,i),new e(r,this.wrap,r,n+1,i),new e(r,this.wrap,r,n,i+1),new e(r,this.wrap,r,n+1,i+1)]}isLessThan(e){return this.wrap<e.wrap||!(this.wrap>e.wrap)&&(this.overscaledZ<e.overscaledZ||!(this.overscaledZ>e.overscaledZ)&&(this.canonical.x<e.canonical.x||!(this.canonical.x>e.canonical.x)&&this.canonical.y<e.canonical.y))}wrapped(){return new e(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)}unwrapTo(t){return new e(this.overscaledZ,t,this.canonical.z,this.canonical.x,this.canonical.y)}overscaleFactor(){return 2**(this.overscaledZ-this.canonical.z)}toUnwrapped(){return new cd(this.wrap,this.canonical)}toString(){return`${this.overscaledZ}/${this.canonical.x}/${this.canonical.y}`}getTilePoint(e){return this.canonical.getTilePoint(new uc(e.x-this.wrap,e.y))}normalizeCoordinates(t,r,n=ez){if(t>=0&&t<n&&r>=0&&r<n)return{tileID:this,x:t,y:r};let i=Math.floor(t/n),a=Math.floor(r/n),s=this.canonical.z,o=1<<s,l=this.canonical.y+a;if(l<0||l>=o)return null;let u=this.canonical.x+i,h=this.wrap;return u<0?(h-=Math.ceil(-u/o),u=(u%o+o)%o):u>=o&&(h+=Math.floor(u/o),u%=o),{tileID:new e(this.overscaledZ,h,s,u,l),x:t-i*n,y:r-a*n}}};function cm(e,t,r,n,i){(e*=2)<0&&(e=-1*e-1);let a=1<<r;return(a*a*e+a*i+n).toString(36)+r.toString(36)+t.toString(36)}let cg=6378137*Math.PI;function cx(e,t,r){let n=2*cg/256/2**r;return[e*n-cg,t*n-cg]}function cv(e,t){let r=Math.abs(2*e.wrap)-(e.wrap<0),n=Math.abs(2*t.wrap)-(t.wrap<0);return e.overscaledZ-t.overscaledZ||n-r||t.canonical.y-e.canonical.y||t.canonical.x-e.canonical.x}ak("CanonicalTileID",cf),ak("OverscaledTileID",cy,{omit:["terrainRttPosMatrix32f"]});let cb="_geojsonTileLayer";var cw=class{constructor(e){this._stringToNumber={},this._numberToString=[];for(let t=0;t<e.length;t++){let r=e[t];this._stringToNumber[r]=t,this._numberToString[t]=r}}encode(e){return this._stringToNumber[e]}decode(e){if(e>=this._numberToString.length)throw Error(`Out of bounds. Index requested n=${e} can't be >= this._numberToString.length ${this._numberToString.length}`);return this._numberToString[e]}},cD=class{constructor(e,t,r,n,i){for(let i in this.type="Feature",this._vectorTileFeature=e,this._x=r,this._y=n,this._z=t,e.properties)"string"==typeof e.properties[i]&&e.properties[i].startsWith("__$json__:")&&(e.properties[i]=JSON.parse(e.properties[i].slice(10)));this.properties=e.properties,this.id=i}projectPoint(e,t,r,n){return[(e.x+t)*360/n-180,360/Math.PI*Math.atan(Math.exp((1-(e.y+r)*2/n)*Math.PI))-90]}projectLine(e,t,r,n){return e.map(e=>this.projectPoint(e,t,r,n))}get geometry(){if(this._geometry)return this._geometry;let e=this._vectorTileFeature,t=e.extent*2**this._z,r=e.extent*this._x,n=e.extent*this._y,i=e.loadGeometry();switch(e.type){case 1:{let e=[];for(let t of i)e.push(t[0]);let a=this.projectLine(e,r,n,t);this._geometry=1===e.length?{type:"Point",coordinates:a[0]}:{type:"MultiPoint",coordinates:a};break}case 2:{let e=i.map(e=>this.projectLine(e,r,n,t));this._geometry=1===e.length?{type:"LineString",coordinates:e[0]}:{type:"MultiLineString",coordinates:e};break}case 3:{let e=l7(i),a=[];for(let i of e)a.push(i.map(e=>this.projectLine(e,r,n,t)));this._geometry=1===a.length?{type:"Polygon",coordinates:a[0]}:{type:"MultiPolygon",coordinates:a};break}default:throw Error(`unknown feature type: ${e.type}`)}return this._geometry}set geometry(e){this._geometry=e}toJSON(){let e={geometry:this.geometry};for(let t in this)"_geometry"!==t&&"_vectorTileFeature"!==t&&"_x"!==t&&"_y"!==t&&"_z"!==t&&(e[t]=this[t]);return e}},c_=class{constructor(e,t,r){this._name=e,this.dataBuffer=t,"number"==typeof r?this._size=r:(this.nullabilityBuffer=r,this._size=r.size())}getValue(e){return this.nullabilityBuffer&&!this.nullabilityBuffer.get(e)?null:this.getValueFromBuffer(e)}has(e){return this.nullabilityBuffer?.get(e)||!this.nullabilityBuffer}get name(){return this._name}get size(){return this._size}},cA=class extends c_{},cE=class extends cA{getValueFromBuffer(e){return this.dataBuffer[e]}},cS=class extends cA{getValueFromBuffer(e){return this.dataBuffer[e]}},cF=class extends c_{constructor(e,t,r,n){super(e,t,n),this.delta=r}},ck=class extends cF{constructor(e,t,r,n,i){super(e,i?Int32Array.of(t):Uint32Array.of(t),r,n)}getValueFromBuffer(e){return this.dataBuffer[0]+e*this.delta}},cT=class extends c_{constructor(e,t,r,n){super(e,n?Int32Array.of(t):Uint32Array.of(t),r)}getValueFromBuffer(e){return this.dataBuffer[0]}},cI=class{constructor(e,t,r,n,i=4096){if(this._name=e,this._geometryVector=t,this._idVector=r,this._propertyVectors=n,this._extent=i,0===e.length)throw Error("Missing layer name")}get name(){return this._name}get idVector(){return this._idVector}get geometryVector(){return this._geometryVector}get propertyVectors(){return this._propertyVectors??[]}
2getPropertyVector(e){return this.propertyVectorsMap||=new Map(this.propertyVectors.map(e=>[e.name,e])),this.propertyVectorsMap.get(e)}get numFeatures(){return this.geometryVector.numGeometries}get extent(){return this._extent}getFeatures(){let e=[],t=this.geometryVector.getGeometries();for(let r=0;r<this.numFeatures;r++){let n;if(this.idVector){let e=this.idVector.getValue(r);null!==e&&(n=this.containsMaxSafeIntegerValues(this.idVector)?Number(e):e)}let i={coordinates:t[r],type:this.geometryVector.geometryType(r)},a={};for(let e of this.propertyVectors){if(!e)continue;let t=e.name,n=e.getValue(r);null!==n&&(a[t]=n)}e.push({id:n,geometry:i,properties:a})}return e}containsMaxSafeIntegerValues(e){return e instanceof cE||e instanceof cT||e instanceof ck||e instanceof cS}};let cC={FEATURE:0},cB={BOOLEAN:0,INT_8:1,UINT_8:2,INT_32:3,UINT_32:4,INT_64:5,UINT_64:6,FLOAT:7,DOUBLE:8,STRING:9},cM={GEOMETRY:0,STRUCT:1,MAP:2},cP={ID:0};var cz,cL=class{constructor(e){this.value=e}get(){return this.value}set(e){this.value=e}increment(){return this.value++}add(e){this.value+=e}};!function(e){e.NONE="NONE",e.DELTA="DELTA",e.COMPONENTWISE_DELTA="COMPONENTWISE_DELTA",e.RLE="RLE",e.MORTON="MORTON"}(cz||={}),function(e){e.NONE="NONE",e.FAST_PFOR="FAST_PFOR",e.VARINT="VARINT"}(pq||={});let cV=new Uint32Array(33);cV[0]=0;for(let e=1;e<=32;e++)cV[e]=32===e?0xffffffff:0xffffffff>>>32-e;let cR=function(e){var t;if(!Number.isFinite(65536))return 65536;let r=(t=Math.floor(e))-t%256;return 0===r?256:r}(65536),cO=3*cR/256+cR|0;function c$(){let e=new Uint8Array(cO);return{dataToBePacked:Array(33),dataPointers:new Int32Array(33),byteContainer:e,byteContainerI32:new Int32Array(e.buffer,e.byteOffset,e.byteLength>>>2),exceptionSizes:new Int32Array(33)}}function cN(e,t,r){let n=new Uint32Array(r),i=0,a=t.get();for(let t=0;t<n.length;t++){let t=e[a++],r=127&t;if(t<128||(r|=(127&(t=e[a++]))<<7,t<128)||(r|=(127&(t=e[a++]))<<14,t<128)||(r|=(127&(t=e[a++]))<<21,t<128)){n[i++]=r;continue}r|=(15&(t=e[a++]))<<28,n[i++]=r}return t.set(a),n}function cU(e,t,r){let n=new BigUint64Array(r);for(let r=0;r<n.length;r++)n[r]=function(e,t){let r=0n,n=0,i=t.get();for(;i<e.length;){let t=e[i++];if(r|=BigInt(127&t)<<BigInt(n),!(128&t))break;if((n+=7)>=64)throw Error("Varint too long")}return t.set(i),r}(e,t);return n}function cq(e){return e>>>1^-(1&e)}function cj(e){return e>>1n^-(1n&e)}function cG(e){return e%2==1?-((e+1)/2):e/2}function cY(e,t,r){if(void 0===r){r=0;for(let n=0;n<t;n++)r+=e[n]}let n=new Uint32Array(r),i=0;for(let r=0;r<t;r++){let a=e[r],s=e[r+t];n.fill(s,i,i+a),i+=a}return n}function cX(e,t,r){if(void 0===r){r=0;for(let n=0;n<t;n++)r+=Number(e[n])}let n=new BigUint64Array(r),i=0;for(let r=0;r<t;r++){let a=Number(e[r]),s=e[r+t];n.fill(s,i,i+a),i+=a}return n}function cW(e,t,r){let n=new Float64Array(r),i=0;for(let r=0;r<t;r++){let a=e[r],s=e[r+t];n.fill(s,i,i+a),i+=a}return n}function cZ(e){let t=new Int32Array(e.length);t[0]=cq(e[0]);let r=e.length/4*4,n=1;if(r>=4)for(;n<r-4;n+=4){let r=e[n],i=e[n+1],a=e[n+2],s=e[n+3];t[n]=cq(r)+t[n-1],t[n+1]=cq(i)+t[n],t[n+2]=cq(a)+t[n+1],t[n+3]=cq(s)+t[n+2]}for(;n!==e.length;++n)t[n]=cq(e[n])+t[n-1];return t}function cH(e){let t=new BigInt64Array(e.length);t[0]=cj(e[0]);let r=e.length/4*4,n=1;if(r>=4)for(;n<r-4;n+=4){let r=e[n],i=e[n+1],a=e[n+2],s=e[n+3];t[n]=cj(r)+t[n-1],t[n+1]=cj(i)+t[n],t[n+2]=cj(a)+t[n+1],t[n+3]=cj(s)+t[n+2]}for(;n!==t.length;++n)t[n]=cj(e[n])+t[n-1];return t}function cK(e){let t=e.length/4*4,r=1;if(t>=4)for(let n=e[0];r<t-4;r+=4)n=e[r]+=n,n=e[r+1]+=n,n=e[r+2]+=n,n=e[r+3]+=n;for(;r!==e.length;)e[r]+=e[r-1],++r}function cJ(e,t,r,n){if(e.length<2)return new Int32Array(e);let i=new Int32Array(e.length),a=cq(e[0]),s=cq(e[1]);i[0]=cQ(Math.round(a*t),r,n),i[1]=cQ(Math.round(s*t),r,n);let o=e.length/16,l=2;if(o>=4)for(;l<o-4;l+=4){let o=e[l],u=e[l+1],h=cq(o)+a,c=cq(u)+s;i[l]=cQ(Math.round(h*t),r,n),i[l+1]=cQ(Math.round(c*t),r,n);let p=e[l+2],f=e[l+3];a=cq(p)+h,s=cq(f)+c,i[l+2]=cQ(Math.round(a*t),r,n),i[l+3]=cQ(Math.round(s*t),r,n)}for(;l!==e.length;l+=2)a+=cq(e[l]),s+=cq(e[l+1]),i[l]=cQ(Math.round(a*t),r,n),i[l+1]=cQ(Math.round(s*t),r,n);return i}function cQ(e,t,r){return Math.min(r,Math.max(t,e))}function c1(e){let t=new Uint32Array(e.length);t[0]=cq(e[0])>>>0;for(let r=1;r<e.length;r++)t[r]=t[r-1]+cq(e[r])>>>0;return t}function c0(e){let t=new BigUint64Array(e.length);t[0]=BigInt.asUintN(64,cj(e[0]));for(let r=1;r<e.length;r++)t[r]=BigInt.asUintN(64,t[r-1]+cj(e[r]));return t}!function(e){e.PRESENT="PRESENT",e.DATA="DATA",e.OFFSET="OFFSET",e.LENGTH="LENGTH"}(pj||={}),function(e){e.NONE="NONE",e.SINGLE="SINGLE",e.SHARED="SHARED",e.VERTEX="VERTEX",e.MORTON="MORTON",e.FSST="FSST"}(pG||={}),function(e){e.VERTEX="VERTEX",e.INDEX="INDEX",e.STRING="STRING",e.KEY="KEY"}(pY||={}),function(e){e.VAR_BINARY="VAR_BINARY",e.GEOMETRIES="GEOMETRIES",e.PARTS="PARTS",e.RINGS="RINGS",e.TRIANGLES="TRIANGLES",e.SYMBOL="SYMBOL",e.DICTIONARY="DICTIONARY"}(pX||={});let c2=[pj.PRESENT,pj.DATA,pj.OFFSET,pj.LENGTH],c3=[cz.NONE,cz.DELTA,cz.COMPONENTWISE_DELTA,cz.RLE,cz.MORTON],c5=[pq.
2NONE,pq.FAST_PFOR,pq.VARINT],c6=[pG.NONE,pG.SINGLE,pG.SHARED,pG.VERTEX,pG.MORTON,pG.FSST],c4=[pY.VERTEX,pY.INDEX,pY.STRING,pY.KEY],c8=[pX.VAR_BINARY,pX.GEOMETRIES,pX.PARTS,pX.RINGS,pX.TRIANGLES,pX.SYMBOL,pX.DICTIONARY];function c7(e,t){var r,n;let i,a,s=function(e,t){let r=e[t.get()],n=c2[r>>4],i={};switch(n){case pj.DATA:i={dictionaryType:c6[15&r]};break;case pj.OFFSET:i={offsetType:c4[15&r]};break;case pj.LENGTH:i={lengthType:c8[15&r]}}t.increment();let a=e[t.get()],s=c3[a>>5],o=c3[a>>2&7],l=c5[3&a];t.increment();let u=cN(e,t,2),h=u[0];return{physicalStreamType:n,logicalStreamType:i,logicalLevelTechnique1:s,logicalLevelTechnique2:o,physicalLevelTechnique:l,numValues:h,byteLength:u[1],decompressedCount:h}}(e,t);return s.logicalLevelTechnique1===cz.MORTON?(r=s,i=cN(e,t,2),{physicalStreamType:r.physicalStreamType,logicalStreamType:r.logicalStreamType,logicalLevelTechnique1:r.logicalLevelTechnique1,logicalLevelTechnique2:r.logicalLevelTechnique2,physicalLevelTechnique:r.physicalLevelTechnique,numValues:r.numValues,byteLength:r.byteLength,decompressedCount:r.decompressedCount,numBits:i[0],coordinateShift:i[1]}):(cz.RLE===s.logicalLevelTechnique1||cz.RLE===s.logicalLevelTechnique2)&&pq.NONE!==s.physicalLevelTechnique?(n=s,a=cN(e,t,2),{physicalStreamType:n.physicalStreamType,logicalStreamType:n.logicalStreamType,logicalLevelTechnique1:n.logicalLevelTechnique1,logicalLevelTechnique2:n.logicalLevelTechnique2,physicalLevelTechnique:n.physicalLevelTechnique,numValues:n.numValues,byteLength:n.byteLength,decompressedCount:a[1],runs:a[0],numRleValues:a[1]}):s}!function(e){e[e.FLAT=0]="FLAT",e[e.CONST=1]="CONST",e[e.SEQUENCE=2]="SEQUENCE",e[e.DICTIONARY=3]="DICTIONARY",e[e.FSST_DICTIONARY=4]="FSST_DICTIONARY"}(pW||={});var c9=class{constructor(e,t){this.values=e,this._size=t}get(e){let t=Math.floor(e/8);return(this.values[t]>>e%8&1)==1}set(e,t){let r=Math.floor(e/8);this.values[r]=this.values[r]|!!t<<e%8}getInt(e){let t=Math.floor(e/8);return this.values[t]>>e%8&1}size(){return this._size}getBuffer(){return this.values}};function pe(e,t,r){if(!t)return e;let n=t.size(),i=new e.constructor(n),a=0;for(let s=0;s<n;s++)i[s]=t.get(s)?e[a++]:r;return i}function pt(e,t,r){for(let n=0;n<e;n++){let e=c7(t,r);r.add(e.byteLength)}}function pr(e,t,r,n,i){let a=function(e,t,r,n){let i=new Uint8Array(t),a=0,s=n.get()+r;for(;a<t&&!(n.get()>=s);){let r=e[n.increment()];if(r<=127){let s=r+3,o=e[n.increment()],l=Math.min(a+s,t);i.fill(o,a,l),a=l}else{let s=256-r;for(let r=0;r<s&&a<t;r++)i[a++]=e[n.increment()]}}return n.set(s),i}(e,Math.ceil(t/8),r,n);return i?function(e,t,r){if(!r)return e;let n=r.size(),i=new c9(e,t),a=new c9(new Uint8Array(Math.ceil(n/8)),n),s=0;for(let e=0;e<n;e++){let t=!!r.get(e)&&i.get(s++);a.set(e,t)}return a.getBuffer()}(a,t,i):a}function pn(e,t,r,n){let i=t.get(),a=i+r*Float32Array.BYTES_PER_ELEMENT,s=new Float32Array(new Uint8Array(e.subarray(i,a)).buffer);return t.set(a),n?pe(s,n,0):s}function pi(e,t,r,n){let i=t.get(),a=i+r*Float64Array.BYTES_PER_ELEMENT,s=new Float64Array(new Uint8Array(e.subarray(i,a)).buffer);return t.set(a),n?pe(s,n,0):s}let pa=new TextDecoder;function ps(e,t,r){return r-t>=12?pa.decode(e.subarray(t,r)):function(e,t,r){let n="",i=t;for(;i<r;){let t,a,s,o=e[i],l=null,u=o>239?4:o>223?3:o>191?2:1;if(i+u>r)break;1===u?o<128&&(l=o):2===u?(192&(t=e[i+1]))==128&&(l=(31&o)<<6|63&t)<=127&&(l=null):3===u?(t=e[i+1],a=e[i+2],(192&t)==128&&(192&a)==128&&((l=(15&o)<<12|(63&t)<<6|63&a)<=2047||l>=55296&&l<=57343)&&(l=null)):4===u&&(t=e[i+1],a=e[i+2],s=e[i+3],(192&t)==128&&(192&a)==128&&(192&s)==128&&((l=(15&o)<<18|(63&t)<<12|(63&a)<<6|63&s)<=65535||l>=1114112)&&(l=null)),null===l?(l=65533,u=1):l>65535&&(l-=65536,n+=String.fromCharCode(l>>>10&1023|55296),l=56320|1023&l),n+=String.fromCharCode(l),i+=u}return n}(e,t,r)}function po(e,t,r,n,i){let a;var s=ph(e,t,r),o=r,l=n,u=i;switch(o.logicalLevelTechnique1){case cz.DELTA:if(o.logicalLevelTechnique2===cz.RLE){if(!u)return function(e,t,r){let n=new Int32Array(r),i=0,a=0;for(let r=0;r<t;r++){let s=e[r],o=cq(e[r+t]);for(let e=0;e<s;e++)a+=o,n[i++]=a}return n}(s,o.runs,o.numRleValues);a=cZ(s=cY(s,o.runs,o.numRleValues))}else a=cZ(s);break;case cz.RLE:a=function(e,t,r){if(void 0===r){r=0;for(let n=0;n<t;n++)r+=e[n]}let n=new Int32Array(r),i=0;for(let r=0;r<t;r++){let a=e[r],s=e[r+t];s=cq(s),n.fill(s,i,i+a),i+=a}return n}(s,o.runs,o.numRleValues);break;case cz.MORTON:cK(s),a=new Int32Array(s);break;case cz.COMPONENTWISE_DELTA:if(l&&!u)return cJ(s,l.scale,l.min,l.max);a=function(e){if(e.length<2)return new Int32Array(e);let t=new Int32Array(e.length);t[0]=cq(e[0]),t[1]=cq(e[1]);let r=e.length/4*4,n=2;if(r>=4)for(;n<r-4;n+=4){let r=e[n],i=e[n+1],a=e[n+2],s=e[n+3];t[n]=cq(r)+t[n-2],t[n+1]=cq(i)+t[n-1],t[n+2]=cq(a)+t[n],t[n+3]=cq(s)+t[n+1]}for(;n!==e.length;n+=2)t[n]=cq(e[n])+t[n-2],t[n+1]=cq(e[n+1])+t[n-1];return t}(s);break;case cz.NONE:a=function(e){let t=new Int32Array(e.length);for(let r=0;r<e.length;r++)t[r]=cq(e[r]);return t}(s);break;default:throw Error(`The specified Logical level technique is not supported: ${o.logicalLevelTechnique1}`)}return u?pe(a,u,0):a}function pl(e,t,r,n,i){return function(e,t,r,n){let i;switch(t.logicalLevelTechnique1){case cz.DELTA:i=t.logicalLevelTechnique2===cz.RLE?c1(cY(e,t.runs,t.numRleValues)):c1(e);break;case cz.RLE:i=cY(e,t.runs,t.numRleValues);break;case cz.MORTON:cK(e),i=e;break;case cz.COMPONENTWISE_DELTA:var a;i=r&&!n?(a=r.scale,new Uint32Array(cJ(e,a,r.min,r.max))):function(e){if(e.length<2)return new Uint32Array(e);let t=new Uint32Array(e.length);t[0]=cq(e[0])>>>0,t[1]=cq(e[1])>>>0;for(let r=2;r<e.length;r+=2)t[r]=t[r-2]+cq(e[r])>>>0,t[r+1]=t[r-1]+cq(e[r+1])>>>0;return t}(e);break;case cz.NONE:i=e;break;default:throw Error(`The specified Logical level technique is not supported: ${t.logicalLevelTechnique1}`)}return n?pe(i,n,0):i}(ph(e,t,r),r,n,i)}function pu(e,t,r){return function(e,t){if(t.logicalLevelTechnique1===cz.DELTA&&t.logicalLevelTechnique2===cz.NONE){let t=new Int32Array(e.length+1);t[0]=0,t[1]=cq(e[0]);let r=t[1];for(let n=2;n!==t.length;++n)r+=cq(e[n-1]),t[n]=t[n-1]+r;return new Uint32Array(t)}if(t.logicalLevelTechnique1===cz.RLE&&t.logicalLevelTechnique2===cz.NONE)return function(e,t,r){let n=new Uint32Array(r+1);n[0]=0;let i=1,a=n[0];for(let r=0;r<t;r++){let s=e[r],o=e[r+t];for(let e=i;e<i+s;e++)n[e]=o+a,a=n[e];i+=s}return n}(e,t.runs,t.numRleValues);if(t.logicalLevelTechnique1===cz.NONE&&t.logicalLevelTechnique2===cz.NONE){let r=0;for(let t=0;t<e.length;t++)e[t]+=r,r=e[t];let n=new Uint32Array(t.numValues+1);return n[0]=0,n.set(e,1),n}if(t.logicalLevelTechnique1===cz.DELTA&&t.logicalLevelTechnique2===cz.RLE){let r=function(e,t,r){let n=new Int32Array(r+1);n[0]=0;let i=1,a=n[0];for(let r=0;r<t;r++){let s=e[r],o=e[r+t];o=cq(o);for(let e=i;e<i+s;e++)n[e]=o+a,a=n[e];i+=s}return n}(e,t.runs,t.numRleValues);return cK(r),new Uint32Array(r)}throw Error("Only delta encoding is supported for transforming length to offset streams yet.")}(ph(e,t,r),r)}function ph(e,t,r){let n=r.physicalLevelTechnique;switch(n){case pq.FAST_PFOR:var i,a;return i=r.numValues,function(e,t,r,n,i){let a=n.get();
2if(3&r)throw Error(`FastPFOR: invalid encodedByteLength=${r} at offset=${a} (encodedBytes.length=${e.length}; expected a multiple of 4 bytes for an int32 big-endian word stream)`);let s=r>>>2,o=function(e,t){if(t<=e.encodedWords.length)return e.encodedWords;let r=new Uint32Array(Math.max(16,2*t));return e.encodedWords=r,r}(i,s);!function(e,t,r,n){if(t<0||r<0||t+r>e.length)throw RangeError(`decodeBigEndianInt32sInto: out of bounds (offset=${t}, byteLength=${r}, bytes.length=${e.length})`);let i=Math.floor(r/4),a=r%4!=0,s=a?i+1:i;if(n.length<s)throw RangeError(`decodeBigEndianInt32sInto: out.length=${n.length} < ${s}`);if(i>0){let r=e.byteOffset+t;if(3&r)for(let r=0;r<i;r++){let i=t+4*r;n[r]=e[i]<<24|e[i+1]<<16|e[i+2]<<8|e[i+3]}else{let t=new Uint32Array(e.buffer,r,i);for(let e=0;e<i;e++)n[e]=0|function(e){let t=e>>>0;return((255&t)<<24|(65280&t)<<8|t>>>8&65280|t>>>24&255)>>>0}(t[e])}}if(a){let a=t+4*i,s=r-4*i,o=0;for(let t=0;t<s;t++)o|=e[a+t]<<24-8*t;n[i]=0|o}}(e,a,r,o);let l=function(e,t,r){let n=0,i=0,a=new Uint32Array(t),s=r??c$();if(e.length>0){let t=0|e[n];if(n=n+1|0,255&t)throw Error(`FastPFOR decode: invalid alignedLength=${t} (expected multiple of 256)`);if(i+t>a.length)throw Error(`FastPFOR decode: output buffer too small (outPos=${i}, alignedLength=${t}, out.length=${a.length})`);n=function(e,t,r,n,i,a){let s=n+(i-i%256),o=n,l=r;for(;o!==s;){let r=Math.min(cR,s-o);l=function(e,t,r,n,i,a){let s=0|r,o=0|e[s];if(o<=0||s+o>e.length-1)throw Error(`FastPFOR decode: invalid whereMeta=${o} at pageStart=${s} (expected > 0 and pageStart+whereMeta < encoded.length=${e.length})`);let l=s+o|0,u=e[l]>>>0,h=u+3>>>2,c=l+1,p=c+h;if(p>=e.length)throw Error(`FastPFOR decode: invalid byteSize=${u} (metaInts=${h}, pageStart=${s}, packedEnd=${l}, byteContainerStart=${c}) causes bitmapPos=${p} out of bounds (encoded.length=${e.length})`);let f=function(e,t,r,n){n.byteContainer.length<r&&(n.byteContainer=new Uint8Array(2*r),n.byteContainerI32=void 0);let i=n.byteContainer,a=r>>>2;if(3&i.byteOffset)for(let r=0;r<a;r=r+1|0){let n=0|e[t+r|0],a=r<<2;i[a]=255&n,i[a+1|0]=n>>>8&255,i[a+2|0]=n>>>16&255,i[a+3|0]=n>>>24&255}else{let r=n.byteContainerI32;(!r||r.buffer!==i.buffer||r.byteOffset!==i.byteOffset||r.length<a)&&(r=n.byteContainerI32=new Int32Array(i.buffer,i.byteOffset,i.byteLength>>>2)),r.set(e.subarray(t,t+a))}let s=3&r;if(s>0){let r=0|e[t+a|0],n=a<<2;for(let e=0;e<s;e=e+1|0)i[n+e|0]=r>>>(e<<3)&255}return i}(e,c,u,a),d=function(e,t,r){let n=0|e[t++],i=r.dataToBePacked;for(let a=2;a<=32;a=a+1|0){if(!(n>>>a-1&1))continue;if(t>=e.length)throw Error(`FastPFOR decode: truncated exception stream header (bitWidth=${a}, streamWordIndex=${t}, needWords=1, availableWords=${e.length-t}, encodedWords=${e.length})`);let s=e[t++]>>>0,o=function(e){var t;return(t=e+31)-t%32}(s),l=s*a+31>>>5;if(t+l>e.length)throw Error(`FastPFOR decode: truncated exception stream (bitWidth=${a}, size=${s}, streamWordIndex=${t}, needWords=${l}, availableWords=${e.length-t}, encodedWords=${e.length})`);let u=i[a];(!u||u.length<o)&&(u=i[a]=new Uint32Array(o));let h=0;for(;h<s;h=h+32|0)(function(e,t,r,n,i){switch(i){case 2:let a,s,o;a=n,s=e[t]>>>0,o=e[t+1]>>>0,r[a++]=s>>>0&3,r[a++]=s>>>2&3,r[a++]=s>>>4&3,r[a++]=s>>>6&3,r[a++]=s>>>8&3,r[a++]=s>>>10&3,r[a++]=s>>>12&3,r[a++]=s>>>14&3,r[a++]=s>>>16&3,r[a++]=s>>>18&3,r[a++]=s>>>20&3,r[a++]=s>>>22&3,r[a++]=s>>>24&3,r[a++]=s>>>26&3,r[a++]=s>>>28&3,r[a++]=s>>>30&3,r[a++]=o>>>0&3,r[a++]=o>>>2&3,r[a++]=o>>>4&3,r[a++]=o>>>6&3,r[a++]=o>>>8&3,r[a++]=o>>>10&3,r[a++]=o>>>12&3,r[a++]=o>>>14&3,r[a++]=o>>>16&3,r[a++]=o>>>18&3,r[a++]=o>>>20&3,r[a++]=o>>>22&3,r[a++]=o>>>24&3,r[a++]=o>>>26&3,r[a++]=o>>>28&3,r[a]=o>>>30&3;return;case 3:let l,u,h,c;l=n,u=e[t]>>>0,h=e[t+1]>>>0,c=e[t+2]>>>0,r[l++]=u>>>0&7,r[l++]=u>>>3&7,r[l++]=u>>>6&7,r[l++]=u>>>9&7,r[l++]=u>>>12&7,r[l++]=u>>>15&7,r[l++]=u>>>18&7,r[l++]=u>>>21&7,r[l++]=u>>>24&7,r[l++]=u>>>27&7,r[l++]=(u>>>30|(1&h)<<2)&7,r[l++]=h>>>1&7,r[l++]=h>>>4&7,r[l++]=h>>>7&7,r[l++]=h>>>10&7,r[l++]=h>>>13&7,r[l++]=h>>>16&7,r[l++]=h>>>19&7,r[l++]=h>>>22&7,r[l++]=h>>>25&7,r[l++]=h>>>28&7,r[l++]=(h>>>31|(3&c)<<1)&7,r[l++]=c>>>2&7,r[l++]=c>>>5&7,r[l++]=c>>>8&7,r[l++]=c>>>11&7,r[l++]=c>>>14&7,r[l++]=c>>>17&7,r[l++]=c>>>20&7,r[l++]=c>>>23&7,r[l++]=c>>>26&7,r[l]=c>>>29&7;return;case 4:let p,f,d,y,m;p=n,f=e[t]>>>0,d=e[t+1]>>>0,y=e[t+2]>>>0,m=e[t+3]>>>0,r[p++]=f>>>0&15,r[p++]=f>>>4&15,r[p++]=f>>>8&15,r[p++]=f>>>12&15,r[p++]=f>>>16&15,r[p++]=f>>>20&15,r[p++]=f>>>24&15,r[p++]=f>>>28&15,r[p++]=d>>>0&15,r[p++]=d>>>4&15,r[p++]=d>>>8&15,r[p++]=d>>>12&15,r[p++]=d>>>16&15,r[p++]=d>>>20&15,r[p++]=d>>>24&15,r[p++]=d>>>28&15,r[p++]=y>>>0&15,r[p++]=y>>>4&15,r[p++]=y>>>8&15,r[p++]=y>>>12&15,r[p++]=y>>>16&15,r[p++]=y>>>20&15,r[p++]=y>>>24&15,r[p++]=y>>>28&15,r[p++]=m>>>0&15,r[p++]=m>>>4&15,r[p++]=m>>>8&15,r[p++]=m>>>12&15,r[p++]=m>>>16&15,r[p++]=m>>>20&15,r[p++]=m>>>
224&15,r[p]=m>>>28&15;return;case 5:let g,x,v,b,w,D;g=n,x=e[t]>>>0,v=e[t+1]>>>0,b=e[t+2]>>>0,w=e[t+3]>>>0,D=e[t+4]>>>0,r[g++]=x>>>0&31,r[g++]=x>>>5&31,r[g++]=x>>>10&31,r[g++]=x>>>15&31,r[g++]=x>>>20&31,r[g++]=x>>>25&31,r[g++]=(x>>>30|(7&v)<<2)&31,r[g++]=v>>>3&31,r[g++]=v>>>8&31,r[g++]=v>>>13&31,r[g++]=v>>>18&31,r[g++]=v>>>23&31,r[g++]=(v>>>28|(1&b)<<4)&31,r[g++]=b>>>1&31,r[g++]=b>>>6&31,r[g++]=b>>>11&31,r[g++]=b>>>16&31,r[g++]=b>>>21&31,r[g++]=b>>>26&31,r[g++]=(b>>>31|(15&w)<<1)&31,r[g++]=w>>>4&31,r[g++]=w>>>9&31,r[g++]=w>>>14&31,r[g++]=w>>>19&31,r[g++]=w>>>24&31,r[g++]=(w>>>29|(3&D)<<3)&31,r[g++]=D>>>2&31,r[g++]=D>>>7&31,r[g++]=D>>>12&31,r[g++]=D>>>17&31,r[g++]=D>>>22&31,r[g]=D>>>27&31;return;case 6:let _,A,E,S,F,k,T;_=n,A=e[t]>>>0,E=e[t+1]>>>0,S=e[t+2]>>>0,F=e[t+3]>>>0,k=e[t+4]>>>0,T=e[t+5]>>>0,r[_++]=A>>>0&63,r[_++]=A>>>6&63,r[_++]=A>>>12&63,r[_++]=A>>>18&63,r[_++]=A>>>24&63,r[_++]=(A>>>30|(15&E)<<2)&63,r[_++]=E>>>4&63,r[_++]=E>>>10&63,r[_++]=E>>>16&63,r[_++]=E>>>22&63,r[_++]=(E>>>28|(3&S)<<4)&63,r[_++]=S>>>2&63,r[_++]=S>>>8&63,r[_++]=S>>>14&63,r[_++]=S>>>20&63,r[_++]=S>>>26&63,r[_++]=F>>>0&63,r[_++]=F>>>6&63,r[_++]=F>>>12&63,r[_++]=F>>>18&63,r[_++]=F>>>24&63,r[_++]=(F>>>30|(15&k)<<2)&63,r[_++]=k>>>4&63,r[_++]=k>>>10&63,r[_++]=k>>>16&63,r[_++]=k>>>22&63,r[_++]=(k>>>28|(3&T)<<4)&63,r[_++]=T>>>2&63,r[_++]=T>>>8&63,r[_++]=T>>>14&63,r[_++]=T>>>20&63,r[_]=T>>>26&63;return;case 7:let I,C,B,M,P,z,L,V;I=n,C=e[t]>>>0,B=e[t+1]>>>0,M=e[t+2]>>>0,P=e[t+3]>>>0,z=e[t+4]>>>0,L=e[t+5]>>>0,V=e[t+6]>>>0,r[I++]=C>>>0&127,r[I++]=C>>>7&127,r[I++]=C>>>14&127,r[I++]=C>>>21&127,r[I++]=(C>>>28|(7&B)<<4)&127,r[I++]=B>>>3&127,r[I++]=B>>>10&127,r[I++]=B>>>17&127,r[I++]=B>>>24&127,r[I++]=(B>>>31|(63&M)<<1)&127,r[I++]=M>>>6&127,r[I++]=M>>>13&127,r[I++]=M>>>20&127,r[I++]=(M>>>27|(3&P)<<5)&127,r[I++]=P>>>2&127,r[I++]=P>>>9&127,r[I++]=P>>>16&127,r[I++]=P>>>23&127,r[I++]=(P>>>30|(31&z)<<2)&127,r[I++]=z>>>5&127,r[I++]=z>>>12&127,r[I++]=z>>>19&127,r[I++]=(z>>>26|(1&L)<<6)&127,r[I++]=L>>>1&127,r[I++]=L>>>8&127,r[I++]=L>>>15&127,r[I++]=L>>>22&127,r[I++]=(L>>>29|(15&V)<<3)&127,r[I++]=V>>>4&127,r[I++]=V>>>11&127,r[I++]=V>>>18&127,r[I]=V>>>25&127;return;case 8:let R,O,$,N,U,q,j,G,Y;R=n,O=e[t]>>>0,$=e[t+1]>>>0,N=e[t+2]>>>0,U=e[t+3]>>>0,q=e[t+4]>>>0,j=e[t+5]>>>0,G=e[t+6]>>>0,Y=e[t+7]>>>0,r[R++]=O>>>0&255,r[R++]=O>>>8&255,r[R++]=O>>>16&255,r[R++]=O>>>24&255,r[R++]=$>>>0&255,r[R++]=$>>>8&255,r[R++]=$>>>16&255,r[R++]=$>>>24&255,r[R++]=N>>>0&255,r[R++]=N>>>8&255,r[R++]=N>>>16&255,r[R++]=N>>>24&255,r[R++]=U>>>0&255,r[R++]=U>>>8&255,r[R++]=U>>>16&255,r[R++]=U>>>24&255,r[R++]=q>>>0&255,r[R++]=q>>>8&255,r[R++]=q>>>16&255,r[R++]=q>>>24&255,r[R++]=j>>>0&255,r[R++]=j>>>8&255,r[R++]=j>>>16&255,r[R++]=j>>>24&255,r[R++]=G>>>0&255,r[R++]=G>>>8&255,r[R++]=G>>>16&255,r[R++]=G>>>24&255,r[R++]=Y>>>0&255,r[R++]=Y>>>8&255,r[R++]=Y>>>16&255,r[R]=Y>>>24&255;return;case 9:let X,W,Z,H,K,J,Q,ee,et,er;X=n,W=e[t]>>>0,Z=e[t+1]>>>0,H=e[t+2]>>>0,K=e[t+3]>>>0,J=e[t+4]>>>0,Q=e[t+5]>>>0,ee=e[t+6]>>>0,et=e[t+7]>>>0,er=e[t+8]>>>0,r[X++]=W>>>0&511,r[X++]=W>>>9&511,r[X++]=W>>>18&511,r[X++]=(W>>>27|(15&Z)<<5)&511,r[X++]=Z>>>4&511,r[X++]=Z>>>13&511,r[X++]=Z>>>22&511,r[X++]=(Z>>>31|(255&H)<<1)&511,r[X++]=H>>>8&511,r[X++]=H>>>17&511,r[X++]=(H>>>26|(7&K)<<6)&511,r[X++]=K>>>3&511,r[X++]=K>>>12&511,r[X++]=K>>>21&511,r[X++]=(K>>>30|(127&J)<<2)&511,r[X++]=J>>>7&511,r[X++]=J>>>16&511,r[X++]=(J>>>25|(3&Q)<<7)&511,r[X++]=Q>>>2&511,r[X++]=Q>>>11&511,r[X++]=Q>>>20&511,r[X++]=(Q>>>29|(63&ee)<<3)&511,r[X++]=ee>>>6&511,r[X++]=ee>>>15&511,r[X++]=(ee>>>24|(1&et)<<8)&511,r[X++]=et>>>1&511,r[X++]=et>>>10&511,r[X++]=et>>>19&511,r[X++]=(et>>>28|(31&er)<<4)&511,r[X++]=er>>>5&511,r[X++]=er>>>14&511,r[X]=er>>>23&511;return;case 10:let en,ei,ea,es,eo,el,eu,eh,ec,ep,ef;en=n,ei=e[t]>>>0,ea=e[t+1]>>>0,es=e[t+2]>>>0,eo=e[t+3]>>>0,el=e[t+4]>>>0,eu=e[t+5]>>>0,eh=e[t+6]>>>0,ec=e[t+7]>>>0,ep=e[t+8]>>>0,ef=e[t+9]>>>0,r[en++]=ei>>>0&1023,r[en++]=ei>>>10&1023,r[en++]=ei>>>20&1023,r[en++]=(ei>>>30|(255&ea)<<2)&1023,r[en++]=ea>>>8&1023,r[en++]=ea>>>18&1023,r[en++]=(ea>>>28|(63&es)<<4)&1023,r[en++]=es>>>6&1023,r[en++]=es>>>16&1023,r[en++]=(es>>>26|(15&eo)<<6)&1023,r[en++]=eo>>>4&1023,r[en++]=eo>>>14&1023,r[en++]=(eo>
2>>24|(3&el)<<8)&1023,r[en++]=el>>>2&1023,r[en++]=el>>>12&1023,r[en++]=el>>>22&1023,r[en++]=eu>>>0&1023,r[en++]=eu>>>10&1023,r[en++]=eu>>>20&1023,r[en++]=(eu>>>30|(255&eh)<<2)&1023,r[en++]=eh>>>8&1023,r[en++]=eh>>>18&1023,r[en++]=(eh>>>28|(63&ec)<<4)&1023,r[en++]=ec>>>6&1023,r[en++]=ec>>>16&1023,r[en++]=(ec>>>26|(15&ep)<<6)&1023,r[en++]=ep>>>4&1023,r[en++]=ep>>>14&1023,r[en++]=(ep>>>24|(3&ef)<<8)&1023,r[en++]=ef>>>2&1023,r[en++]=ef>>>12&1023,r[en]=ef>>>22&1023;return;case 11:let ed,ey,em,eg,ex,ev,eb,ew,eD,e_,eA,eE;ed=n,ey=e[t]>>>0,em=e[t+1]>>>0,eg=e[t+2]>>>0,ex=e[t+3]>>>0,ev=e[t+4]>>>0,eb=e[t+5]>>>0,ew=e[t+6]>>>0,eD=e[t+7]>>>0,e_=e[t+8]>>>0,eA=e[t+9]>>>0,eE=e[t+10]>>>0,r[ed++]=ey>>>0&2047,r[ed++]=ey>>>11&2047,r[ed++]=(ey>>>22|(1&em)<<10)&2047,r[ed++]=em>>>1&2047,r[ed++]=em>>>12&2047,r[ed++]=(em>>>23|(3&eg)<<9)&2047,r[ed++]=eg>>>2&2047,r[ed++]=eg>>>13&2047,r[ed++]=(eg>>>24|(7&ex)<<8)&2047,r[ed++]=ex>>>3&2047,r[ed++]=ex>>>14&2047,r[ed++]=(ex>>>25|(15&ev)<<7)&2047,r[ed++]=ev>>>4&2047,r[ed++]=ev>>>15&2047,r[ed++]=(ev>>>26|(31&eb)<<6)&2047,r[ed++]=eb>>>5&2047,r[ed++]=eb>>>16&2047,r[ed++]=(eb>>>27|(63&ew)<<5)&2047,r[ed++]=ew>>>6&2047,r[ed++]=ew>>>17&2047,r[ed++]=(ew>>>28|(127&eD)<<4)&2047,r[ed++]=eD>>>7&2047,r[ed++]=eD>>>18&2047,r[ed++]=(eD>>>29|(255&e_)<<3)&2047,r[ed++]=e_>>>8&2047,r[ed++]=e_>>>19&2047,r[ed++]=(e_>>>30|(511&eA)<<2)&2047,r[ed++]=eA>>>9&2047,r[ed++]=eA>>>20&2047,r[ed++]=(eA>>>31|(1023&eE)<<1)&2047,r[ed++]=eE>>>10&2047,r[ed]=eE>>>21&2047;return;case 12:let eS,eF,ek,eT,eI,eC,eB,eM,eP,ez,eL,eV,eR;eS=n,eF=e[t]>>>0,ek=e[t+1]>>>0,eT=e[t+2]>>>0,eI=e[t+3]>>>0,eC=e[t+4]>>>0,eB=e[t+5]>>>0,eM=e[t+6]>>>0,eP=e[t+7]>>>0,ez=e[t+8]>>>0,eL=e[t+9]>>>0,eV=e[t+10]>>>0,eR=e[t+11]>>>0,r[eS++]=eF>>>0&4095,r[eS++]=eF>>>12&4095,r[eS++]=(eF>>>24|(15&ek)<<8)&4095,r[eS++]=ek>>>4&4095,r[eS++]=ek>>>16&4095,r[eS++]=(ek>>>28|(255&eT)<<4)&4095,r[eS++]=eT>>>8&4095,r[eS++]=eT>>>20&4095,r[eS++]=eI>>>0&4095,r[eS++]=eI>>>12&4095,r[eS++]=(eI>>>24|(15&eC)<<8)&4095,r[eS++]=eC>>>4&4095,r[eS++]=eC>>>16&4095,r[eS++]=(eC>>>28|(255&eB)<<4)&4095,r[eS++]=eB>>>8&4095,r[eS++]=eB>>>20&4095,r[eS++]=eM>>>0&4095,r[eS++]=eM>>>12&4095,r[eS++]=(eM>>>24|(15&eP)<<8)&4095,r[eS++]=eP>>>4&4095,r[eS++]=eP>>>16&4095,r[eS++]=(eP>>>28|(255&ez)<<4)&4095,r[eS++]=ez>>>8&4095,r[eS++]=ez>>>20&4095,r[eS++]=eL>>>0&4095,r[eS++]=eL>>>12&4095,r[eS++]=(eL>>>24|(15&eV)<<8)&4095,r[eS++]=eV>>>4&4095,r[eS++]=eV>>>16&4095,r[eS++]=(eV>>>28|(255&eR)<<4)&4095,r[eS++]=eR>>>8&4095,r[eS]=eR>>>20&4095;return;case 16:let eO,e$,eN,eU,eq,ej,eG,eY,eX,eW,eZ,eH,eK,eJ,eQ,e1,e0;eO=n,e$=e[t]>>>0,eN=e[t+1]>>>0,eU=e[t+2]>>>0,eq=e[t+3]>>>0,ej=e[t+4]>>>0,eG=e[t+5]>>>0,eY=e[t+6]>>>0,eX=e[t+7]>>>0,eW=e[t+8]>>>0,eZ=e[t+9]>>>0,eH=e[t+10]>>>0,eK=e[t+11]>>>0,eJ=e[t+12]>>>0,eQ=e[t+13]>>>0,e1=e[t+14]>>>0,e0=e[t+15]>>>0,r[eO++]=e$>>>0&65535,r[eO++]=e$>>>16&65535,r[eO++]=eN>>>0&65535,r[eO++]=eN>>>16&65535,r[eO++]=eU>>>0&65535,r[eO++]=eU>>>16&65535,r[eO++]=eq>>>0&65535,r[eO++]=eq>>>16&65535,r[eO++]=ej>>>0&65535,r[eO++]=ej>>>16&65535,r[eO++]=eG>>>0&65535,r[eO++]=eG>>>16&65535,r[eO++]=eY>>>0&65535,r[eO++]=eY>>>16&65535,r[eO++]=eX>>>0&65535,r[eO++]=eX>>>16&65535,r[eO++]=eW>>>0&65535,r[eO++]=eW>>>16&65535,r[eO++]=eZ>>>0&65535,r[eO++]=eZ>>>16&65535,r[eO++]=eH>>>0&65535,r[eO++]=eH>>>16&65535,r[eO++]=eK>>>0&65535,r[eO++]=eK>>>16&65535,r[eO++]=eJ>>>0&65535,r[eO++]=eJ>>>16&65535,r[eO++]=eQ>>>0&65535,r[eO++]=eQ>>>16&65535,r[eO++]=e1>>>0&65535,r[eO++]=e1>>>16&65535,r[eO++]=e0>>>0&65535,r[eO]=e0>>>16&65535;return;case 32:for(let i=0;i<32;i=i+1|0)r[n+i|0]=0|e[t+i|0];return}let e2=cV[i]>>>0,e3=t,e5=0,e6=e[e3]>>>0;for(let t=0;t<32;t++)if(e5+i<=32){let a=e6>>>e5&e2;r[n+t]=0|a,32===(e5+=i)&&(e5=0,e3++,31!==t&&(e6=e[e3]>>>0))}else{let a=32-e5,s=(e6>>>e5|((e6=e[++e3]>>>0)&cV[i-a]>>>0)<<a)&e2;r[n+t]=0|s,e5=i-a}})(e,t,u,h,a),t=t+a|0;t=t-((h-s|0)*a>>>5)|0,r.exceptionSizes[a]=s}return t}(e,p,a);return a.dataPointers.fill(0),function(e,t,r,n,i,a,s,o,l,u){let h=0|r,c=0;for(let t=0;t<s;t=t+1|0){let r=function(e,t,r,n){if(r+2>t)throw Error(`FastPFOR decode: byteContainer underflow at block=${n} (need 2 bytes for [bitWidth, exceptionCount], bytePos=${r}, byteSize=${t})`);let i=e[r++],a=e[r++];if(i>32)throw Error(`FastPFOR decode: invalid bitWidth=${i} at block=${n} (expected 0..32). This likely indicates corrupted or truncated input.`);return{bitWidth:i,exceptionCount:a,bytePosIn:r}}(o,l,c,t);c=r.bytePosIn;let n=r.bitWidth,s=r.exceptionCount,p=a+256*t|0;switch(n){case 0:i.fill(0,p,p+256);break;case 32:for(let t=0;t<256;t=t+1|0)i[p+t|0]=0|e[h+t|0];h=h+256|0;break;default:h=function(e,t,r,n,i){switch(i){case 1:let a=n,s=t;for(let t=0;t<8;t++){let t=e[s++]>>>0;r[a++]=t>>
2>0&1,r[a++]=t>>>1&1,r[a++]=t>>>2&1,r[a++]=t>>>3&1,r[a++]=t>>>4&1,r[a++]=t>>>5&1,r[a++]=t>>>6&1,r[a++]=t>>>7&1,r[a++]=t>>>8&1,r[a++]=t>>>9&1,r[a++]=t>>>10&1,r[a++]=t>>>11&1,r[a++]=t>>>12&1,r[a++]=t>>>13&1,r[a++]=t>>>14&1,r[a++]=t>>>15&1,r[a++]=t>>>16&1,r[a++]=t>>>17&1,r[a++]=t>>>18&1,r[a++]=t>>>19&1,r[a++]=t>>>20&1,r[a++]=t>>>21&1,r[a++]=t>>>22&1,r[a++]=t>>>23&1,r[a++]=t>>>24&1,r[a++]=t>>>25&1,r[a++]=t>>>26&1,r[a++]=t>>>27&1,r[a++]=t>>>28&1,r[a++]=t>>>29&1,r[a++]=t>>>30&1,r[a++]=t>>>31&1}break;case 2:!function(e,t,r,n){let i=n,a=t;for(let t=0;t<8;t++){let t=e[a++]>>>0,n=e[a++]>>>0;r[i++]=t>>>0&3,r[i++]=t>>>2&3,r[i++]=t>>>4&3,r[i++]=t>>>6&3,r[i++]=t>>>8&3,r[i++]=t>>>10&3,r[i++]=t>>>12&3,r[i++]=t>>>14&3,r[i++]=t>>>16&3,r[i++]=t>>>18&3,r[i++]=t>>>20&3,r[i++]=t>>>22&3,r[i++]=t>>>24&3,r[i++]=t>>>26&3,r[i++]=t>>>28&3,r[i++]=t>>>30&3,r[i++]=n>>>0&3,r[i++]=n>>>2&3,r[i++]=n>>>4&3,r[i++]=n>>>6&3,r[i++]=n>>>8&3,r[i++]=n>>>10&3,r[i++]=n>>>12&3,r[i++]=n>>>14&3,r[i++]=n>>>16&3,r[i++]=n>>>18&3,r[i++]=n>>>20&3,r[i++]=n>>>22&3,r[i++]=n>>>24&3,r[i++]=n>>>26&3,r[i++]=n>>>28&3,r[i++]=n>>>30&3}}(e,t,r,n);break;case 3:!function(e,t,r,n){let i=n,a=t;for(let t=0;t<8;t++){let t=e[a++]>>>0,n=e[a++]>>>0,s=e[a++]>>>0;r[i++]=t>>>0&7,r[i++]=t>>>3&7,r[i++]=t>>>6&7,r[i++]=t>>>9&7,r[i++]=t>>>12&7,r[i++]=t>>>15&7,r[i++]=t>>>18&7,r[i++]=t>>>21&7,r[i++]=t>>>24&7,r[i++]=t>>>27&7,r[i++]=(t>>>30|(1&n)<<2)&7,r[i++]=n>>>1&7,r[i++]=n>>>4&7,r[i++]=n>>>7&7,r[i++]=n>>>10&7,r[i++]=n>>>13&7,r[i++]=n>>>16&7,r[i++]=n>>>19&7,r[i++]=n>>>22&7,r[i++]=n>>>25&7,r[i++]=n>>>28&7,r[i++]=(n>>>31|(3&s)<<1)&7,r[i++]=s>>>2&7,r[i++]=s>>>5&7,r[i++]=s>>>8&7,r[i++]=s>>>11&7,r[i++]=s>>>14&7,r[i++]=s>>>17&7,r[i++]=s>>>20&7,r[i++]=s>>>23&7,r[i++]=s>>>26&7,r[i++]=s>>>29&7}}(e,t,r,n);break;case 4:!function(e,t,r,n){let i=n,a=t;for(let t=0;t<8;t++){let t=e[a++]>>>0,n=e[a++]>>>0,s=e[a++]>>>0,o=e[a++]>>>0;r[i++]=t>>>0&15,r[i++]=t>>>4&15,r[i++]=t>>>8&15,r[i++]=t>>>12&15,r[i++]=t>>>16&15,r[i++]=t>>>20&15,r[i++]=t>>>24&15,r[i++]=t>>>28&15,r[i++]=n>>>0&15,r[i++]=n>>>4&15,r[i++]=n>>>8&15,r[i++]=n>>>12&15,r[i++]=n>>>16&15,r[i++]=n>>>20&15,r[i++]=n>>>24&15,r[i++]=n>>>28&15,r[i++]=s>>>0&15,r[i++]=s>>>4&15,r[i++]=s>>>8&15,r[i++]=s>>>12&15,r[i++]=s>>>16&15,r[i++]=s>>>20&15,r[i++]=s>>>24&15,r[i++]=s>>>28&15,r[i++]=o>>>0&15,r[i++]=o>>>4&15,r[i++]=o>>>8&15,r[i++]=o>>>12&15,r[i++]=o>>>16&15,r[i++]=o>>>20&15,r[i++]=o>>>24&15,r[i++]=o>>>28&15}}(e,t,r,n);break;case 5:!function(e,t,r,n){let i=n,a=t;for(let t=0;t<8;t++){let t=e[a++]>>>0,n=e[a++]>>>0,s=e[a++]>>>0,o=e[a++]>>>0,l=e[a++]>>>0;r[i++]=t>>>0&31,r[i++]=t>>>5&31,r[i++]=t>>>10&31,r[i++]=t>>>15&31,r[i++]=t>>>20&31,r[i++]=t>>>25&31,r[i++]=(t>>>30|(7&n)<<2)&31,r[i++]=n>>>3&31,r[i++]=n>>>8&31,r[i++]=n>>>13&31,r[i++]=n>>>18&31,r[i++]=n>>>23&31,r[i++]=(n>>>28|(1&s)<<4)&31,r[i++]=s>>>1&31,r[i++]=s>>>6&31,r[i++]=s>>>11&31,r[i++]=s>>>16&31,r[i++]=s>>>21&31,r[i++]=s>>>26&31,r[i++]=(s>>>31|(15&o)<<1)&31,r[i++]=o>>>4&31,r[i++]=o>>>9&31,r[i++]=o>>>14&31,r[i++]=o>>>19&31,r[i++]=o>>>24&31,r[i++]=(o>>>29|(3&l)<<3)&31,r[i++]=l>>>2&31,r[i++]=l>>>7&31,r[i++]=l>>>12&31,r[i++]=l>>>17&31,r[i++]=l>>>22&31,r[i++]=l>>>27&31}}(e,t,r,n);break;case 6:!function(e,t,r,n){let i=n,a=t;for(let t=0;t<8;t++){let t=e[a++]>>>0,n=e[a++]>>>0,s=e[a++]>>>0,o=e[a++]>>>0,l=e[a++]>>>0,u=e[a++]>>>0;r[i++]=t>>>0&63,r[i++]=t>>>6&63,r[i++]=t>>>12&63,r[i++]=t>>>18&63,r[i++]=t>>>24&63,r[i++]=(t>>>30|(15&n)<<2)&63,r[i++]=n>>>4&63,r[i++]=n>>>10&63,r[i++]=n>>>16&63,r[i++]=n>>>22&63,r[i++]=(n>>>28|(3&s)<<4)&63,r[i++]=s>>>2&63,r[i++]=s>>>8&63,r[i++]=s>>>14&63,r[i++]=s>>>20&63,r[i++]=s>>>26&63,r[i++]=o>>>0&63,r[i++]=o>>>6&63,r[i++]=o>>>12&63,r[i++]=o>>>18&63,r[i++]=o>>>24&63,r[i++]=(o>>>30|(15&l)<<2)&63,r[i++]=l>>>4&63,r[i++]=l>>>10&63,r[i++]=l>>>16&63,r[i++]=l>>>22&63,r[i++]=(l>>>28|(3&u)<<4)&63,r[i++]=u>>>2&63,r[i++]=u>>>8&63,r[i++]=u>>>14&63,r[i++]=u>>>20&63,r[i++]=u>>>26&63}}(e,t,r,n);break;case 7:!function(e,t,r,n){let i=n,a=t;for(let t=0;t<8;t++){let t=e[a++]>>>0,n=e[a++]>>>0,s=e[a++]>>>0,o=e[a++]>>>0,l=e[a++]>>>0,u=e[a++]>>>0,h=e[a++]>>>0;r[i++]=t>>>0&127,r[i++]=t>>>7&127,r[i++]=t>>>14&127,r[i++]=t>>>21&127,r[i++]=(t>>>28|(7&n)<<4)&127,r[i++]=n>>>3&127,r[i++]=n>>>10&127,r[i++]=n>>>17&127,r[i++]=n>>>24&127,r[i++]=(n>>>31|(63&s)<<1)&127,r[i++]=s>>>6&127,r[i++]=s>>>13&127,r[i++]=s>>>20&127,r[i++]=(s>>>27|(3&o)<<5)&127,r[i++]=o>>>2&127,r[i++]=o>>>9&127,r[i++]=o>>>16&127,r[i++]=o>>>23&127,r[i++]=(o>>>30|(31&l)<<2)&127,r[i++]=l>>>5&127,r[i++]=l>>>12&127,r[i++]=l>>>19&127,r[i++]=(l>>>26|(1&u)<<6)&127,r[i++]=u>>>1&127,r[i++]=u>>>8&127,r[i++]=u>>>15&127,r[i++]=u>>>22&127,r[i++]=(u>>>29|(15&h)<<3)&127,r[i++]=h>>>4&127,r[i++]=h>>>11&127,r[i++]=h>>>18&127,r[i++]=h>>>25&127}}(e,t,r,n);break;case 8:!function(e,t,r,n){let i=n,a=t;for(let t=0;t<8;t++){let t=e[a++]>>>0,n=e[a++]>>>0,s=e[a++]>>>0,o=e[a++]>>>0,l=e[a++]>>>0,u=e[a++]>>>0,h=e[a++]>>>0,c=e[a++]>>>0;r[i++]=t>>>0&255,r[i++]=t>>>8&255,r[i++]=t>>>16&255,r[i++]=t>>>24&255,r[i++]=n>>>0&255,r[i++]=n>>>8&255,r[i++]=n>>>16&255,r[i++]=n>>>24&255,r[i++]=s>>>0&255,r[i++]=s>>>8&255,r[i++]=s>>>16&255,r[i++]=s>>>24&255,r[i++]=o>>>0&255,r[i++]=o>>>8&255,r[i++]=o>>>16&255,r[i++]=o>>>24&255,r[i++]=l>>>0&255,r[i++]=l>>>8&255,r[i++]=l>>>16&255,r[i++]=l>>>24&255,r[i++]=u>>>0&255,r[i++]=u>>>8&255,r[i++]=u>>>16&255,r[i++]=u>>>24&255,r[i++]=h>>>0&255,r[i++]=h>>>8&255,r[i++]=h>>>16&255,r[i++]=h>>>24&255,r[i++]=c>>>0&255,r[i++]=c>>>8&255,r[i++]=c>>>16&255,r[i++]=c>>>24&255}}(e,t,r,n);break;case 16:let o=n,l=t;for(let t=0;t<128;t++){let t=e[l++]>>>0;r[o++]=65535&t,r[o++]=t>>
2>16&65535}break;default:!function(e,t,r,n,i){let a=cV[i]>>>0,s=t,o=0,l=e[s]>>>0,u=n;for(let t=0;t<8;t++){for(let t=0;t<32;t++)if(o+i<=32){let n=l>>>o&a;r[u+t]=0|n,32===(o+=i)&&(o=0,s++,31!==t&&(l=e[s]>>>0))}else{let n=32-o,h=l>>>o;l=e[++s]>>>0;let c=i-n,p=(h|(l&-1>>>32-c>>>0)<<n)&a;r[u+t]=0|p,o=c}u+=32,o=0,t<7&&(l=e[s]>>>0)}}(e,t,r,n,i)}return t+(i<<3)|0}(e,h,i,p,n)}s>0&&(c=function(e,t,r,n,i,a,s,o,l){let{maxBits:u,exceptionBitWidth:h,bytePosIn:c}=function(e,t,r,n,i,a){if(r+1>t)throw Error(`FastPFOR decode: exception header underflow at block=${a} (need 1 byte for maxBits, bytePos=${r}, byteSize=${t})`);let s=e[r++];if(s<n||s>32)throw Error(`FastPFOR decode: invalid maxBits=${s} at block=${a} (bitWidth=${n}, expected ${n}..32)`);let o=s-n|0;if(o<1||o>32)throw Error(`FastPFOR decode: invalid exceptionBitWidth=${o} at block=${a} (bitWidth=${n}, maxBits=${s})`);if(r+i>t)throw Error(`FastPFOR decode: exception positions underflow at block=${a} (need=${i}, have=${t-r})`);return{maxBits:s,exceptionBitWidth:o,bytePosIn:r}}(i,a,s,r,n,l);if(s=c,1===h){let a=1<<r;for(let r=0;r<n;r=r+1|0){let r=i[s++];e[r+t|0]|=a}return s}let p=o.dataToBePacked[h];if(!p)throw Error(`FastPFOR decode: missing exception stream for exceptionBitWidth=${h} (bitWidth=${r}, maxBits=${u}) at block ${l}`);let f=o.dataPointers,d=0|f[h],y=0|o.exceptionSizes[h];if(d+n>y)throw Error(`FastPFOR decode: exception stream overflow for exceptionBitWidth=${h} (ptr=${d}, need ${n}, size=${y}) at block ${l}`);for(let a=0;a<n;a=a+1|0){let n=i[s++],a=0|p[d++];e[n+t|0]|=a<<r}return f[h]=d,s}(i,p,n,s,o,l,c,u,t))}if(h!==n)throw Error(`FastPFOR decode: packed region mismatch (pageStart=${t}, packedStart=${r}, consumedPackedEnd=${h}, expectedPackedEnd=${n}, packedWords=${n-r}, encoded.length=${e.length})`)}(e,s,s+1|0,l,t,0|n,i/256|0,f,u,a),d}(e,t,l,o,r,a),o=o+r|0}return l}(e,a,n,i,t,s),i=i+t|0}let o=e.length-n|0,l=t-i|0;return function(e,t,r,n,i,a){if(0===a)return;let s=0,o=t,l=t+r,u=i,h=i+a,c=0,p=0;for(;o<l&&u<h;){let t=e[o]>>>s&255;if(s+=8,o+=s>>>5,s&=31,c|=(127&t)<<p,128&t)n[u++]=0|c,c=0,p=0;else if((p+=7)>28)throw Error(`FastPFOR VByte: unterminated value (expected MSB=1 terminator within 5 bytes; shift=${p}, partial=${c}, decoded=${u-i}/${a}, inPos=${o}, inEnd=${l})`)}if(u!==h)throw Error(`FastPFOR VByte: truncated stream (decoded=${u-i}, expected=${a}, consumedWords=${o-t}/${r}, vbyteStart=${t}, vbyteEnd=${l})`)}(e,n,o,a,i,l),a}(o.subarray(0,s),t,i.decoderWorkspace);return n.add(r),l}(e,i,a=r.byteLength,t,function(e=16){if(e<0)throw RangeError(`initialEncodedWordCapacity must be >= 0, got ${e}`);return{encodedWords:new Uint32Array(Math.max(16,0|e)),decoderWorkspace:c$()}}(a>>>2));case pq.VARINT:return cN(e,t,r.numValues);case pq.NONE:return function(e,t,r){let n=t.get(),i=r*Uint32Array.BYTES_PER_ELEMENT,a=new DataView(e.buffer,e.byteOffset,e.byteLength),s=new Uint32Array(r);for(let e=0;e<r;e++)s[e]=a.getUint32(n+e*Uint32Array.BYTES_PER_ELEMENT,!0);return t.add(i),s}(e,t,r.numValues);default:throw Error(`Specified physicalLevelTechnique ${n} is not supported (yet).`)}}function pc(e,t,r){let n=r.physicalLevelTechnique;switch(n){case pq.VARINT:return cU(e,t,r.numValues);case pq.NONE:return function(e,t,r){let n=t.get(),i=r*BigUint64Array.BYTES_PER_ELEMENT,a=new DataView(e.buffer,e.byteOffset,e.byteLength),s=new BigUint64Array(r);for(let e=0;e<r;e++)s[e]=a.getBigUint64(n+e*BigUint64Array.BYTES_PER_ELEMENT,!0);return t.add(i),s}(e,t,r.numValues);default:throw Error(`Specified physicalLevelTechnique ${n} is not supported (yet).`)}}function pp(e,t,r){let n=ph(e,t,r);return 1===n.length?r.logicalLevelTechnique1===cz.DELTA?cq(n[0]):n[0]:n[1]}function pf(e,t,r){var n=ph(e,t,r);if(2===n.length){let e=cq(n[1]);return[e,e]}return[cq(n[2]),cq(n[3])]}function pd(e,t,r){var n=cU(e,t,r.numValues);if(2===n.length){let e=cj(n[1]);return[e,e]}return[cj(n[2]),cj(n[3])]}function py(e,t,r,n){return px(pc(e,t,r),r,n)}function pm(e,t,r){let n=pc(e,t,r);return 1===n.length?r.logicalLevelTechnique1===cz.DELTA?cj(n[0]):n[0]:n[1]}function pg(e,t,r){let n;switch(t.logicalLevelTechnique1){case cz.DELTA:if(t.logicalLevelTechnique2===cz.RLE){if(!r)return function(e,t,r){let n=new BigInt64Array(r),i=0,a=0n;for(let r=0;r<t;r++){let s=Number(e[r]),o=cj(e[r+t]);for(let e=0;e<s;e++)a+=o,n[i++]=a}return n}(e,t.runs,t.numRleValues);n=cH(e=cX(e,t.runs,t.numRleValues))}else n=cH(e);break;case cz.RLE:n=function(e,t,r){if(void 0===r){r=0;for(let n=0;n<t;n++)r+=Number(e[n])}let n=new BigInt64Array(r),i=0;for(let r=0;r<t;r++){let a=Number(e[r]),s=e[r+t];s=cj(s),n.fill(s,i,i+a),i+=a}return n}(e,t.runs,t.numRleValues);break;case cz.NONE:n=function(e){let t=new BigInt64Array(e.length);for(let r=0;r<e.length;r++)t[r]=cj(e[r]);return t}(e);break;default:throw Error(`The specified Logical level technique is not supported: ${t.logicalLevelTechnique1}`)}return r?pe(n,r,0n):n}function px(e,t,r){let n;switch(t.logicalLevelTechnique1){case cz.DELTA:n=t.logicalLevelTechnique2===cz.RLE?c0(cX(e,t.runs,t.numRleValues)):c0(e);break;case cz.RLE:n=cX(e,t.runs,t.numRleValues);break;case cz.NONE:n=e;break;default:throw Error(`The specified Logical level technique is not supported: ${t.logicalLevelTechnique1}`)}return r?pe(n,r,0n):n}function pv(e,t,r,n,i="int32"){let a=e.logicalLevelTechnique1;if(a===cz.RLE)return 1===e.runs?pW.CONST:pW.FLAT;if(a!==cz.DELTA||e.logicalLevelTechnique2!==cz.RLE)return 1===e.numValues?pW.CONST:pW.FLAT;let s=t instanceof c9?t.size():t;if(e.numRleValues!==s)return pW.FLAT;if(1===e.runs)return pW.SEQUENCE;
2if(2!==e.runs)return 1===e.numValues?pW.CONST:pW.FLAT;let o=n.get();if(e.physicalLevelTechnique===pq.VARINT)return!function(e,t,r){let n=new cL(t.get());if("int64"===r){let t=cU(e,n,4);return 2n===t[2]&&2n===t[3]}let i=cN(e,n,4);return 2===i[2]&&2===i[3]}(r,n,i)?1===e.numValues?pW.CONST:pW.FLAT:pW.SEQUENCE;let l=n.get(),u=new Int32Array(r.buffer,r.byteOffset+l,4);return n.set(o),2===u[2]&&2===u[3]?pW.SEQUENCE:1===e.numValues?pW.CONST:pW.FLAT}var pb=class extends cA{getValueFromBuffer(e){return this.dataBuffer[e]}},pw=class extends cF{constructor(e,t,r,n,i){super(e,i?BigInt64Array.of(t):BigUint64Array.of(t),r,n)}getValueFromBuffer(e){return this.dataBuffer[0]+BigInt(e)*this.delta}};function pD(e,t,r){return{x:p_(e,t)-r,y:p_(e>>1,t)-r}}function p_(e,t){let r=0;for(let n=0;n<t;n++)r|=(e&1<<2*n)>>n;return r}function pA(e,t,r,n,i,a,s){return e===pK.MORTON?function(e,t,r,n,i,a){let s=Array(i?n+1:n);for(let i=0;i<n;i++){let n=pD(e[t[r+i]],a.numBits,a.coordinateShift);s[i]=new C(n.x,n.y)}return i&&(s[s.length-1]=s[0]),s}(t,r,n,i,a,s):function(e,t,r,n,i){let a=Array(i?n+1:n);for(let i=0;i<2*n;i+=2){let n=2*t[r+i/2],s=e[n],o=e[n+1];a[i/2]=new C(s,o)}return i&&(a[a.length-1]=a[0]),a}(t,r,n,i,a)}function pE(e,t,r,n){let i=Array(n?r+1:r);for(let n=0;n<2*r;n+=2){let r=e[t+n],a=e[t+n+1];i[n/2]=new C(r,a)}return n&&(i[i.length-1]=i[0]),i}!function(e){e[e.POINT=0]="POINT",e[e.LINESTRING=1]="LINESTRING",e[e.POLYGON=2]="POLYGON",e[e.MULTIPOINT=3]="MULTIPOINT",e[e.MULTILINESTRING=4]="MULTILINESTRING",e[e.MULTIPOLYGON=5]="MULTIPOLYGON"}(pZ||={}),function(e){e[e.POINT=0]="POINT",e[e.LINESTRING=1]="LINESTRING",e[e.POLYGON=2]="POLYGON"}(pH||={}),function(e){e[e.MORTON=0]="MORTON",e[e.VEC_2=1]="VEC_2",e[e.VEC_3=2]="VEC_3"}(pK||={});var pS=class{constructor(e,t,r,n,i){this._vertexBufferType=e,this._topologyVector=t,this._vertexOffsets=r,this._vertexBuffer=n,this._mortonSettings=i}get vertexBufferType(){return this._vertexBufferType}get topologyVector(){return this._topologyVector}get vertexOffsets(){return this._vertexOffsets}get vertexBuffer(){return this._vertexBuffer}getSimpleEncodedVertex(e){let t=this.vertexOffsets?2*this.vertexOffsets[e]:2*e;return[this.vertexBuffer[t],this.vertexBuffer[t+1]]}getVertex(e){if(this.vertexOffsets&&this.mortonSettings){let t=this.vertexOffsets[e],r=pD(this.vertexBuffer[t],this.mortonSettings.numBits,this.mortonSettings.coordinateShift);return[r.x,r.y]}let t=this.vertexOffsets?2*this.vertexOffsets[e]:2*e;return[this.vertexBuffer[t],this.vertexBuffer[t+1]]}getGeometries(){return function(e){let t=Array(e.numGeometries),r=1,n=1,i=1,a=0,s=0,o=0,l=e.mortonSettings,u=e.topologyVector,h=u.geometryOffsets,c=u.partOffsets,p=u.ringOffsets,f=e.vertexOffsets,d=!f||0===f.length,y=e.containsPolygonGeometry(),m=e.vertexBuffer;for(let u=0;u<e.numGeometries;u++){let g=e.geometryType(u);switch(g){case pZ.POINT:{let u,y;if(d)u=m[s++],y=m[s++];else if(e.vertexBufferType===pK.MORTON){let e=pD(m[f[o++]],l.numBits,l.coordinateShift);u=e.x,y=e.y}else{let e=2*f[o++];u=m[e],y=m[e+1]}t[a++]=[[new C(u,y)]],h&&i++,c&&r++,p&&n++}break;case pZ.MULTIPOINT:{let u,c=h[i]-h[i-1];if(i++,d){u=Array(c);for(let e=0;e<c;e++){let t=m[s++],r=m[s++];u[e]=new C(t,r)}}else u=pA(e.vertexBufferType,m,f,o,c,!1,l),o+=c;t[a++]=u.map(e=>[e]),r+=c,n+=c}break;case pZ.LINESTRING:{let u,g;y?(u=p[n]-p[n-1],n++):u=c[r]-c[r-1],r++,d?(g=pE(m,s,u,!1),s+=2*u):(g=pA(e.vertexBufferType,m,f,o,u,!1,l),o+=u),t[a++]=[g],h&&i++}break;case pZ.POLYGON:{let u=c[r]-c[r-1];r++;let y=Array(u-1),g,x=p[n]-p[n-1];if(n++,d){g=pE(m,s,x,!0),s+=2*x;for(let e=0;e<y.length;e++)x=p[n]-p[n-1],n++,y[e]=pE(m,s,x,!0),s+=2*x}else{g=pA(e.vertexBufferType,m,f,o,x,!0,l),o+=x;for(let t=0;t<y.length;t++)x=p[n]-p[n-1],n++,y[t]=pA(e.vertexBufferType,m,f,o,x,!0,l),o+=x}t[a++]=[g].concat(y),h&&i++}break;case pZ.MULTILINESTRING:{let u=h[i]-h[i-1];i++;let g=Array(u);for(let t=0;t<u;t++){let i;if(y?(i=p[n]-p[n-1],n++):i=c[r]-c[r-1],r++,d)g[t]=pE(m,s,i,!1),s+=2*i;else{let r=pA(e.vertexBufferType,m,f,o,i,!1,l);g[t]=r,o+=i}}t[a++]=g}break;case pZ.MULTIPOLYGON:{let u=h[i]-h[i-1];i++;let y=Array(u);for(let t=0;t<u;t++){let i=c[r]-c[r-1];r++;let a,u=Array(i-1),h=p[n]-p[n-1];n++,d?(a=pE(m,s,h,!0),s+=2*h):(a=pA(e.vertexBufferType,m,f,o,h,!0,l),o+=h);for(let t=0;t<u.length;t++){let r=p[n]-p[n-1];n++,d?(u[t]=pE(m,s,r,!0),s+=2*r):(u[t]=pA(e.vertexBufferType,m,f,o,r,!0,l),o+=r)}y[t]=[a].concat(u)}t[a++]=y.flat()}break;default:throw Error(`The specified geometry type (${g}) is currently not supported.`)}}return t}(this)}get mortonSettings(){return this._mortonSettings}},pF=class extends pS{constructor(e,t,r,n,i,a,s){super(r,n,i,a,s),this._numGeometries=e,this._geometryType=t}geometryType(e){return this._geometryType}get numGeometries(){return this._numGeometries}containsPolygonGeometry(){return this._geometryType===pZ.POLYGON||this._geometryType===pZ.MULTIPOLYGON}containsSingleGeometryType(){return!0}};function pk(e,t,r,n){return new pT(pK.VEC_2,e,t,r,n)}var pT=class extends pS{constructor(e,t,r,n,i,a){super(e,r,n,i,a),this._geometryTypes=t}geometryType(e){return this._geometryTypes[e]}get numGeometries(){return this._geometryTypes.length}containsPolygonGeometry(){for(let e=0;e<this.numGeometries;e++)if(this.geometryType(e)===pZ.POLYGON||this.geometryType(e)===pZ.MULTIPOLYGON)return!0;return!1}containsSingleGeometryType(){return!1}},pI=class{constructor(e,t,r,n){this._triangleOffsets=e,this._indexBuffer=t,this._vertexBuffer=r,this._topologyVector=n}get triangleOffsets(){return this._triangleOffsets}get indexBuffer(){return this._indexBuffer}get vertexBuffer(){return this._vertexBuffer}get topologyVector(){return this._topologyVector}getGeometries(){if(!this._topologyVector)throw Error("Cannot convert GpuVector to coordinates without topology information");let e=new Uint32Array(this.numGeometries);for(let t=0;t<this.numGeometries;t++)e[t]=this.geometryType(t);return pk(e,this._topologyVector,void 0,this._vertexBuffer).getGeometries()}[Symbol.iterator](){return null}},pC=class extends pI{constructor(e,t,r,n,i,a){super(r,n,i,a),this._numGeometries=e,this._geometryType=t}geometryType(e){return this._geometryType}get numGeometries(){return this._numGeometries}containsSingleGeometryType(){return!0}},pB=class extends pI{constructor(e,t,r,n,i){super(t,r,n,i),this._geometryTypes=e}geometryType(e){return this._geometryTypes[e]}get numGeometries(){return this._geometryTypes.length}containsSingleGeometryType(){return!1}};function pM(e,t,r){let n=new Uint32Array(e.length+1),i=0;
2n[0]=i;let a=0;for(let s=0;s<e.length;s++)i=n[s+1]=i+(e[s]>r?t[a++]:1);return n}function pP(e,t,r,n){let i=new Uint32Array(t[t.length-1]+1),a=0;i[0]=a;let s=1,o=0;for(let l=0;l<e.length;l++){let u=e[l],h=t[l+1]-t[l];if(5===u||2===u||n&&(4===u||1===u))for(let e=0;e<h;e++)a=i[s++]=a+r[o++];else for(let e=0;e<h;e++)i[s++]=++a}return i}var pz=class extends c_{constructor(e,t,r){super(e,t.getBuffer(),r),this.dataVector=t}getValueFromBuffer(e){return this.dataVector.get(e)}},pL=class extends cA{getValueFromBuffer(e){return this.dataBuffer[e]}},pV=class extends c_{constructor(e,t,r,n){super(e,n?BigInt64Array.of(t):BigUint64Array.of(t),r)}getValueFromBuffer(e){return this.dataBuffer[0]}},pR=class extends c_{constructor(e,t,r,n){super(e,r,n),this.offsetBuffer=t}},pO=class extends pR{constructor(e,t,r,n){super(e,t,r,n??t.length-1)}getValueFromBuffer(e){let t=this.offsetBuffer[e],r=this.offsetBuffer[e+1];return ps(this.dataBuffer,t,r)}},p$=class extends pR{constructor(e,t,r,n,i){super(e,r,n,i??t.length),this.indexBuffer=t,this.indexBuffer=t}getValueFromBuffer(e){let t=this.indexBuffer[e],r=this.offsetBuffer[t],n=this.offsetBuffer[t+1];return ps(this.dataBuffer,r,n)}},pN=class extends pR{constructor(e,t,r,n,i,a,s,o){super(e,r,n,s??t.length),this.indexBuffer=t,this.symbolOffsetBuffer=i,this.symbolTableBuffer=a,this.sharedDictionaryCache=o}getValueFromBuffer(e){this.decodedDictionary??(this.decodedDictionary=this.sharedDictionaryCache?.decodedDictionary,this.decodedDictionary??(this.decodedDictionary=this.decodeDictionary(),this.sharedDictionaryCache&&(this.sharedDictionaryCache.decodedDictionary=this.decodedDictionary)));let t=this.indexBuffer[e],r=this.offsetBuffer[t],n=this.offsetBuffer[t+1];return ps(this.decodedDictionary,r,n)}decodeDictionary(){return this.symbolLengthBuffer??=this.offsetToLengthBuffer(this.symbolOffsetBuffer),function(e,t,r){let n=new Uint32Array(t.length);for(let e=1;e<t.length;e++)n[e]=n[e-1]+t[e-1];let i=new Uint8Array(function(e,t){let r=0;for(let n=0;n<t.length;n++){let i=t[n];255===i?(r++,n++):r+=e[i]}return r}(t,r)),a=0;for(let s=0;s<r.length;s++){let o=r[s];if(255===o)s++,i[a++]=r[s];else{let r=t[o],s=n[o];for(;r-- >0;)i[a++]=e[s++]}}return i}(this.symbolTableBuffer,this.symbolLengthBuffer,this.dataBuffer)}offsetToLengthBuffer(e){let t=new Uint32Array(e.length-1),r=e[0];for(let n=1;n<e.length;n++){let i=e[n];t[n-1]=i-r,r=i}return t}};function pU(e,t,r,n,i){let a,s,o,l,u,h=i,c,p;for(let e=0;e<n;e++){let e=c7(t,r);switch(e.physicalStreamType){case pj.PRESENT:{let n=new c9(pr(t,e.numValues,e.byteLength,r),e.numValues);h=i??n;break}case pj.OFFSET:s=pl(t,r,e,void 0,h);break;case pj.LENGTH:{let n=pu(t,r,e);pX.DICTIONARY===e.logicalStreamType.lengthType?a=n:pX.SYMBOL===e.logicalStreamType.lengthType?l=n:c=n;break}case pj.DATA:{let n=t.subarray(r.get(),r.get()+e.byteLength);r.add(e.byteLength);let i=e.logicalStreamType.dictionaryType;pG.FSST===i?u=n:pG.SINGLE===i||pG.SHARED===i?o=n:pG.NONE===i&&(p=n)}}}return function(e,t,r,n,i,a,s){if(t){if(!r||!n||!i||!a)throw Error(`Incomplete FSST dictionary string column "${e}"`);return new pN(e,r,n,i,a,t,s)}}(e,u,s,a,o,l,h)??function(e,t,r,n,i){if(t){if(!r||!n)throw Error(`Incomplete dictionary string column "${e}"`);return i?new p$(e,r,n,t,i):new p$(e,r,n,t)}}(e,o,s,a,h)??function(e,t,r,n,i){if(t&&r){if(n)return i?new p$(e,n,t,r,i):new p$(e,n,t,r);if(i&&i.size()!==t.length-1){let n=new Uint32Array(i.size()),a=0;for(let e=0;e<i.size();e++)i.get(e)?n[e]=a++:n[e]=0;return new p$(e,n,t,r,i)}
2return i?new pO(e,t,r,i):new pO(e,t,r)}}(e,c,p,s,h)}var pq,pj,pG,pY,pX,pW,pZ,pH,pK,pJ,pQ=class extends c_{constructor(e,t,r){super(e,new Uint8Array,r??t.length),this.values=t}getValueFromBuffer(e){return this.values[e]}};function p1(e,t,r,n){let i=Object.create(null),a=t;for(;a<r;){let t=p3(e[a++],n);if("string"!=typeof t)throw Error(`Map key dictionary index does not resolve to a string: ${t}`);let s=p0(e,a,r,n);i[t]=s.value,a=s.nextIndex}return{value:i,nextIndex:a}}function p0(e,t,r,n){if(t>=r)throw Error("Unexpected end of map value stream");let i=e[t];if(i===_.FALSE)return{value:!1,nextIndex:t+1};if(i===_.TRUE)return{value:!0,nextIndex:t+1};if(i===_.START_MAP){let i=p2(e,t,r);return{value:p1(e,t+2,i,n).value,nextIndex:i}}if(i===_.START_LIST){let i=p2(e,t,r),a=[],s=t+2;for(;s<i;){let t=p0(e,s,i,n);a.push(t.value),s=t.nextIndex}return{value:a,nextIndex:i}}return{value:p3(i,n),nextIndex:t+1}}function p2(e,t,r){if(t+1>=r)throw Error("Missing length for nested map/list payload");let n=e[t+1];if(n<2)throw Error(`Invalid nested payload length: ${n}`);let i=t+n;if(i>r)throw Error("Nested payload exceeds containing payload bounds");return i}function p3(e,t){let r=e-_.COUNT;if(r<0||r>=t.length)throw Error(`Scalar dictionary index out of range: ${e}`);return t[r]}function p5(e,t){for(let r of t)e.push(r)}function p6(e){return e instanceof c9}!function(e){e[e.STRING=1]="STRING",e[e.INT32=2]="INT32",e[e.UINT32=4]="UINT32",e[e.INT64=8]="INT64",e[e.UINT64=16]="UINT64",e[e.FLOAT=32]="FLOAT",e[e.DOUBLE=64]="DOUBLE",e[e.PRESENCE=128]="PRESENCE"}(pJ||={}),function(e){e[e.FALSE=0]="FALSE",e[e.TRUE=1]="TRUE",e[e.START_MAP=2]="START_MAP",e[e.START_LIST=3]="START_LIST",e[e.COUNT=4]="COUNT"}(_||={});let p4={ID:0,ID_NULLABLE:1,ID_LONG:2,GEOMETRY:4,SCALAR_BASE:10,STRUCT:30,MAP:31};function p8(e){switch(e){case p4.ID:case p4.ID|p4.ID_NULLABLE:case p4.ID|p4.ID_LONG:case p4.ID|p4.ID_LONG|p4.ID_NULLABLE:return{nullable:(e&p4.ID_NULLABLE)!=0,columnScope:cC.FEATURE,type:"scalarType",scalarType:{longID:(e&p4.ID_LONG)!=0,type:"logicalType",logicalType:cP.ID}};case p4.GEOMETRY:return{nullable:!1,columnScope:cC.FEATURE,type:"complexType",complexType:{type:"physicalType",physicalType:cM.GEOMETRY,children:[]}};case p4.STRUCT:return{nullable:!1,columnScope:cC.FEATURE,type:"complexType",complexType:{type:"physicalType",physicalType:cM.STRUCT,children:[]}};case p4.MAP:return{nullable:!0,columnScope:cC.FEATURE,type:"complexType",complexType:{type:"physicalType",physicalType:cM.MAP,children:[]}};default:let t;var r=e;switch(r){case 10:case 11:t=cB.BOOLEAN;break;case 12:case 13:t=cB.INT_8;break;case 14:case 15:t=cB.UINT_8;break;case 16:case 17:t=cB.INT_32;break;case 18:case 19:t=cB.UINT_32;break;case 20:case 21:t=cB.INT_64;break;case 22:case 23:t=cB.UINT_64;break;case 24:case 25:t=cB.FLOAT;break;case 26:case 27:t=cB.DOUBLE;break;case 28:case 29:t=cB.STRING;break;default:return null}return{nullable:!!(1&r),columnScope:cC.FEATURE,type:"scalarType",scalarType:{longID:!1,type:"physicalType",physicalType:t}}}}function p7(e){return e===p4.STRUCT||e===p4.MAP}let p9=new TextDecoder,fe="0-3(ID), 4(GEOMETRY), 10-29(scalars), 30(STRUCT), 31(MAP)";function ft(e,t){let r=cN(e,t,1)[0];if(0===r)return"";let n=t.get(),i=e.subarray(n,n+r);return t.add(r),p9.decode(i)}var fr=class{constructor(e,t){switch(this._featureData=e,this.properties=this._featureData.properties||{},this._featureData.geometry?.type){case pZ.POINT:case pZ.MULTIPOINT:this.type=1;break;case pZ.LINESTRING:case pZ.MULTILINESTRING:this.type=2;break;case pZ.POLYGON:case pZ.MULTIPOLYGON:this.type=3;break;default:this.type=0}this.extent=t,this.id=Number(this._featureData.id)}loadGeometry(){let e=[];for(let t of this._featureData.geometry.coordinates){let r=[];for(let e of t)r.push(new C(e.x,e.y));e.push(r)}return e}},fn=class{constructor(e){this.features=[],this.featureTable=e,this.name=e.name,this.extent=e.extent,this.version=2,this.features=e.getFeatures(),this.length=this.features.length}feature(e){return new fr(this.features[e],this.extent)}},fi=class{constructor(e){this.layers={};let t=function(e,t,r=!0){let n=new cL(0),i=[];for(;n.get()<e.length;){let t=cN(e,n,1)[0]>>>0,o=n.get()+t;if(o>e.length)throw Error(`Block overruns tile: ${o} > ${e.length}`);let l=cN(e,n,1)[0]>>>0;if(1!==l&&2!==l){n.set(o);continue}let[u,h]=function(e,t){let r={};r.featureTables=[];let n={};if(n.name=ft(e,t),0===n.name.length)throw Error("Missing layer name");let i=cN(e,t,1)[0]>>>0,a=cN(e,t,1)[0]>>>0;n.columns=Array(a);for(let r=0;r<a;r++)n.columns[r]=function(e,t){let r,n=cN(e,t,1)[0]>>>0,i=p8(n);
2if(!i)throw Error(`Unsupported column type code ${n}. Supported: ${fe}`);if(n>=p4.SCALAR_BASE)r=ft(e,t);else if(n<p4.GEOMETRY)r="id";else if(n===p4.GEOMETRY)r="geometry";else throw Error(`Unsupported column type code ${n}. Supported: ${fe}`);let a={...i,name:r};if("complexType"===a.type&&p7(n)){let r=cN(e,t,1)[0]>>>0,n=a.complexType;n.children=Array(r);for(let i=0;i<r;i++)n.children[i]=function e(t,r){let n,i,a=cN(t,r,1)[0]>>>0,s=a>=p4.SCALAR_BASE?p8(a):null;if(!s)throw Error(`Unsupported field type code ${a}. Supported: 10-29(scalars), 30(STRUCT), 31(MAP)`);let o={...s,name:ft(t,r)};if("complexType"===o.type&&p7(a)){let n=o.complexType,i=cN(t,r,1)[0]>>>0;n.children=Array(i);for(let a=0;a<i;a++)n.children[a]=e(t,r)}return n=o.name,i=o.nullable,"scalarType"===o.type?{type:"scalarField",scalarField:o.scalarType,name:n,nullable:i}:{type:"complexField",complexField:o.complexType,name:n,nullable:i}}(e,t)}return a}(e,t);return r.featureTables.push(n),[r,i]}(e,n),c=u.featureTables[0],p=null,f=null,d=[],y=0;for(let t of c.columns){var a,s;let i=t.name;if("scalarType"===t.type&&t.scalarType?.type==="logicalType"&&t.scalarType.logicalType===cP.ID){let a=null;if(t.nullable){let t=c7(e,n),r=n.get(),i=pr(e,t.numValues,t.byteLength,n);n.set(r+t.byteLength),a=new c9(i,t.numValues)}let s=c7(e,n);y=a?a.size():s.decompressedCount,p=function(e,t,r,n,i,a,s=!1){let o=t.scalarType?.longID?cB.UINT_64:cB.UINT_32,l="number"==typeof a?void 0:a,u=pv(i,a,e,r,o===cB.UINT_64?"int64":"int32");if(o===cB.UINT_32)switch(u){case pW.FLAT:return new cE(n,pl(e,r,i,void 0,l),a);case pW.SEQUENCE:{let t=pf(e,r,i);return new ck(n,t[0],t[1],i.numRleValues,!1)}case pW.CONST:return new cT(n,pp(e,r,i),a,!1)}switch(u){case pW.FLAT:let h;return s?new cS(n,(h=function(e,t,r,n){if(r.physicalLevelTechnique===pq.VARINT)return function(e,t,r){switch(t.logicalLevelTechnique1){case cz.DELTA:return t.logicalLevelTechnique2===cz.RLE&&(e=cW(e,t.runs,t.numRleValues)),function(e){e[0]=cG(e[0]);let t=e.length/4*4,r=1;if(t>=4)for(;r<t-4;r+=4){let t=e[r],n=e[r+1],i=e[r+2],a=e[r+3];e[r]=cG(t)+e[r-1],e[r+1]=cG(n)+e[r],e[r+2]=cG(i)+e[r+1],e[r+3]=cG(a)+e[r+2]}for(;r!==e.length;++r)e[r]=cG(e[r])+e[r-1]}(e),e;case cz.RLE:var n,i;return n=e,i=t,r?function(e,t,r){let n=new Float64Array(r),i=0;for(let r=0;r<t;r++){let a=e[r],s=e[r+t];s=cG(s),n.fill(s,i,i+a),i+=a}return n}(n,i.runs,i.numRleValues):cW(n,i.runs,i.numRleValues);case cz.NONE:return r&&function(e){for(let t=0;t<e.length;t++)e[t]=cG(e[t])}(e),e;default:throw Error(`The specified Logical level technique is not supported: ${t.logicalLevelTechnique1}`)}}(function(e,t,r){let n=new Float64Array(r);for(let i=0;i<r;i++)n[i]=function(e,t){let r,n;return n=e[t.get()],t.increment(),r=127&n,n<128||(n=e[t.get()],t.increment(),r|=(127&n)<<7,n<128)||(n=e[t.get()],t.increment(),r|=(127&n)<<14,n<128)||(n=e[t.get()],t.increment(),r|=(127&n)<<21,n<128)?r:function(e,t,r){let n,i;if(i=t[r.get()],r.increment(),n=(112&i)>>4,i<128||(i=t[r.get()],r.increment(),n|=(127&i)<<3,i<128)||(i=t[r.get()],r.increment(),n|=(127&i)<<10,i<128)||(i=t[r.get()],r.increment(),n|=(127&i)<<17,i<128)||(i=t[r.get()],r.increment(),n|=(127&i)<<24,i<128)||(i=t[r.get()],r.increment(),n|=(1&i)<<31,i<128))return 0x100000000*n+(e>>>0);throw Error("Expected varint not more than 10 bytes")}(r|=(15&(n=e[t.get()]))<<28,e,t)}(e,t);return n}(e,t,r.numValues),r,n);let i=pc(e,t,r),a=n?pg(i,r):px(i,r);return Float64Array.from(a,Number)}(e,r,i,!1),l?pe(h,l,0):h),a):new pb(n,py(e,r,i,l),a);case pW.SEQUENCE:{let t=pd(e,r,i);return new pw(n,t[0],t[1],i.numRleValues,!1)}case pW.CONST:return new pV(n,pm(e,r,i),a,!1)}throw Error("Vector type not supported for id column.")}(e,t,n,i,s,a??y,r)}else if("complexType"===t.type&&t.complexType?.type==="physicalType"&&t.complexType.physicalType===cM.GEOMETRY){let t=cN(e,n,1)[0];if(0===y){let t=n.get();y=c7(e,n).decompressedCount,n.set(t)}f=function(e,t,r,n,i){var a,s,o,l,u,h,c,p,f,d,y;let m,g,x,v=c7(e,r),b,w,D,_;if(pv(v,n,e,r)===pW.CONST){let p=pp(e,r,v),f,d,y,m;for(let n=0;n<t-1;n++){let t=c7(e,r);switch(t.physicalStreamType){case pj.LENGTH:switch(t.logicalStreamType.lengthType){case pX.GEOMETRIES:f=pu(e,r,t);break;case pX.PARTS:d=pu(e,r,t);break;case pX.RINGS:y=pu(e,r,t);break;case pX.TRIANGLES:m=pu(e,r,t)}break;case pj.OFFSET:switch(t.logicalStreamType.offsetType){case pY.VERTEX:b=pl(e,r,t);break;case pY.INDEX:_=pl(e,r,t)}break;case pj.DATA:pG.VERTEX===t.logicalStreamType.dictionaryType?w=po(e,r,t,i):(D={numBits:t.numBits,coordinateShift:t.coordinateShift},w=pl(e,r,t,i))}}return _?void 0!==f||void 0!==d?new pC(n,p,m,_,w,{geometryOffsets:f,partOffsets:d,ringOffsets:y}):new pC(n,p,m,_,w,void 0):void 0===D?(a={geometryOffsets:f,partOffsets:d,ringOffsets:y},s=b,o=w,new pF(n,p,pK.VEC_2,a,s,o)):(l={geometryOffsets:f,partOffsets:d,ringOffsets:y},u=b,h=w,c=D,new pF(n,p,pK.MORTON,l,u,h,c))}let A=pl(e,r,v),E,S,F,k;for(let n=0;n<t-1;n++){let t=c7(e,r);switch(t.physicalStreamType){case pj.LENGTH:switch(t.logicalStreamType.lengthType){case pX.GEOMETRIES:E=pl(e,r,t);break;case pX.PARTS:S=pl(e,r,t);break;case pX.RINGS:F=pl(e,r,t);break;case pX.TRIANGLES:k=pu(e,r,t)}break;case pj.OFFSET:switch(t.logicalStreamType.offsetType){case pY.VERTEX:b=pl(e,r,t);break;case pY.INDEX:_=pl(e,r,t)}break;case pj.DATA:pG.VERTEX===t.logicalStreamType.dictionaryType?w=po(e,r,t,i):(D={numBits:t.numBits,coordinateShift:t.coordinateShift},w=pl(e,r,t,i))}}return E?(m=pM(A,E,2),S&&F?(g=pP(A,m,S,!1),x=function(e,t,r,n){let i=new Uint32Array(r[r.length-1]+1),a=0;i[0]=a;let s=1,o=1,l=0;for(let u=0;u<e.length;u++){let h=e[u],c=t[u+1]-t[u];
2if(0!==h&&3!==h)for(let e=0;e<c;e++){let e=r[s]-r[s-1];s++;for(let t=0;t<e;t++)a=i[o++]=a+n[l++]}else for(let e=0;e<c;e++)i[o++]=++a,s++}return i}(A,m,g,F)):S&&(g=function(e,t,r){let n=new Uint32Array(t[t.length-1]+1),i=0;n[0]=i;let a=1,s=0;for(let o=0;o<e.length;o++){let l=e[o],u=t[o+1]-t[o];if(4===l||1===l)for(let e=0;e<u;e++)i=n[a++]=i+r[s++];else for(let e=0;e<u;e++)n[a++]=++i}return n}(A,m,S))):S&&F?(g=pM(A,S,1),x=pP(A,g,F,!0)):S&&(g=pM(A,S,0)),_&&!g?new pB(A,k,_,w,void 0):_?new pB(A,k,_,w,{geometryOffsets:m,partOffsets:g,ringOffsets:x}):void 0===D?pk(A,{geometryOffsets:m,partOffsets:g,ringOffsets:x},b,w):(p={geometryOffsets:m,partOffsets:g,ringOffsets:x},f=b,d=w,y=D,new pT(pK.MORTON,A,p,f,d,y))}(e,t,n,y,void 0)}else{let r=!function(e){if("scalarType"===e.type){let t=e.scalarType;if("physicalType"===t.type)switch(t.physicalType){case cB.BOOLEAN:case cB.INT_8:case cB.UINT_8:case cB.INT_32:case cB.UINT_32:case cB.INT_64:case cB.UINT_64:case cB.FLOAT:case cB.DOUBLE:return!1;case cB.STRING:return!0;default:return!1}if("logicalType"===t.type)return!1}else if("complexType"===e.type){let t=e.complexType;if("physicalType"===t.type)switch(t.physicalType){case cM.GEOMETRY:case cM.STRUCT:case cM.MAP:return!0;default:return!1}}return console.warn("Unexpected column type in hasStreamCount",e),!1}(t)?1:cN(e,n,1)[0];if(0===r)continue;let i=(a=y,s=void 0,"scalarType"===t.type?s&&!s.has(t.name)?(pt(r,e,n),null):function(e,t,r,n,i,a){let s;if(0===e)return null;if(a.nullable){let e=c7(t,r),n=e.numValues,i=r.get(),a=pr(t,n,e.byteLength,r);r.set(i+e.byteLength),s=new c9(a,e.numValues)}let o=s??n;switch(i.physicalType){case cB.UINT_32:case cB.INT_32:return function(e,t,r,n,i){let a=c7(e,t),s=pv(a,i,e,t),o=n.physicalType===cB.INT_32;if(s===pW.FLAT){let n=p6(i)?i:void 0,s=o?po(e,t,a,void 0,n):pl(e,t,a,void 0,n);return new cE(r.name,s,i)}if(s===pW.SEQUENCE){let n=pf(e,t,a);return new ck(r.name,n[0],n[1],a.numRleValues,o)}let l=o?function(e,t,r){let n=ph(e,t,r);return 1===n.length?cq(n[0]):cq(n[1])}(e,t,a):pp(e,t,a);return new cT(r.name,l,i,o)}(t,r,a,i,o);case cB.STRING:{let n=a.nullable?e-1:e;return pU(a.name,t,r,n,s)??null}case cB.BOOLEAN:return function(e,t,r,n,i){let a=c7(e,t),s=a.numValues,o=t.get(),l=p6(i)?i:void 0,u=pr(e,s,a.byteLength,t,l);t.set(o+a.byteLength);let h=new c9(u,s);return new pz(r.name,h,i)}(t,r,a,0,o);case cB.UINT_64:case cB.INT_64:return function(e,t,r,n,i){let a=c7(e,t),s=pv(a,n,e,t,"int64"),o=i.physicalType===cB.INT_64;if(s===pW.FLAT){let i=p6(n)?n:void 0,s=o?pg(pc(e,t,a),a,i):py(e,t,a,i);return new pb(r.name,s,n)}if(s===pW.SEQUENCE){let n=pd(e,t,a);return new pw(r.name,n[0],n[1],a.numRleValues,o)}let l=o?function(e,t,r){let n=pc(e,t,r);return 1===n.length?cj(n[0]):cj(n[1])}(e,t,a):pm(e,t,a);return new pV(r.name,l,n,o)}(t,r,a,o,i);case cB.FLOAT:return function(e,t,r,n){let i=c7(e,t),a=p6(n)?n:void 0,s=pn(e,t,i.numValues,a);return new pL(r.name,s,n)}(t,r,a,o);case cB.DOUBLE:return function(e,t,r,n){let i=c7(e,t),a=p6(n)?n:void 0,s=pi(e,t,i.numValues,a);return new cS(r.name,s,n)}(t,r,a,o);default:throw Error(`The specified data type for the field is currently not supported: ${i}`)}}(r,e,n,a,t.scalarType,t):t.complexType?.physicalType===cM.MAP?function(e,t,r,n){let i=function(e){let t="complexType"===e.type?e.complexType.children:void 0;return t&&0!==t.length?t.map(t=>e.name+(t.name??"")):[e.name]}(r);if(0===n)return i.map(e=>new pQ(e,[]));let a=function(e,t,r){let n=e[t.get()];t.add(1);let i=pl(e,t,c7(e,t)),a=r-1,s=[];n&pJ.STRING&&(a-=function(e,t,r){let n=e[t.get()];t.add(1);let i=pU("",e,t,n);if(i)for(let e=0;e<i.size;e++)r.push(i.getValue(e));return n}(e,t,s)),a-=function(e,t,r,n){var i;let a=0;return r&pJ.INT32?(p5(n,po(e,t,c7(e,t))),a++):r&pJ.INT64&&(p5(n,pg(pc(e,t,i=c7(e,t)),i,void 0)),a++),r&pJ.UINT32?(p5(n,pl(e,t,c7(e,t))),a++):r&pJ.UINT64&&(p5(n,py(e,t,c7(e,t))),a++),a}(e,t,n,s),a-=function(e,t,r,n){let i=0;return r&pJ.FLOAT&&(p5(n,pn(e,t,c7(e,t).numValues)),i++),r&pJ.DOUBLE&&(p5(n,pi(e,t,c7(e,t).numValues)),i++),i}(e,t,n,s);let o,l=0;if(n&pJ.PRESENCE){let r=function(e,t){let r=c7(e,t);if(r.physicalStreamType!==pj.PRESENT)throw Error(`Expected PRESENT stream for map column but found: ${r.physicalStreamType}`);let n=r.numValues,i=t.get(),a=new c9(pr(e,n,r.byteLength,t),n);return t.set(i+r.byteLength),{value:a,count:n}}(e,t);o=r.value,l=r.count,a--}let u=new Uint32Array;
2if(a>0&&(u=pl(e,t,c7(e,t)),a--),0!==a)throw Error(`Unexpected number of remaining streams while decoding map column: ${a}`);return{lengthStream:i,dictionary:s,presentStream:o,presentCount:l,flattenedValues:u}}(e,t,n),s=(a.presentStream?a.presentCount:a.lengthStream.length)/i.length,o=[],l=0,u=0;for(let e=0;e<i.length;e++){let t=function(e,t,r,n,i){let{lengthStream:a,flattenedValues:s,presentStream:o,dictionary:l}=e,u=t*r,h=r,c;if(o){c=new c9(new Uint8Array(Math.ceil(r/8)),r),h=0;for(let e=0;e<r;e++)o.get(u+e)&&(c.set(e,!0),h++)}let p=n+h;if(p>a.length)throw Error("Merged map counts underflow while decoding child streams");let f=Array(r),d=n,y=i;for(let e=0;e<r;e++){var m,g,x,v;if(o&&!o.get(u+e)){f[e]=null;continue}let t=y+a[d++];if(t>s.length)throw Error("Map value stream underflow while decoding feature payload");let r=(m=s,g=y,x=t,v=l,x-g==1||m[g]===_.START_LIST?p0(m,g,x,v):p1(m,g,x,v));f[e]=r.value,y=r.nextIndex}let b=0;for(let e=n;e<p;e++)b+=a[e];let w=i+b;if(y!==w)throw Error("Unused flattened map values remain after decode");return{value:f,nullabilityBuffer:c,countsEnd:p,valuesEnd:w}}(a,e,s,l,u);o.push(new pQ(i[e],t.value,t.nullabilityBuffer)),l=t.countsEnd,u=t.valuesEnd}return o}(e,n,t,r):0===r?null:function(e,t,r,n){let i,a,s,o,l=!1;for(;!l;){let r=c7(e,t);switch(r.physicalStreamType){case pj.LENGTH:pX.DICTIONARY===r.logicalStreamType.lengthType?i=pu(e,t,r):s=pu(e,t,r);break;case pj.DATA:pG.SINGLE===r.logicalStreamType.dictionaryType||pG.SHARED===r.logicalStreamType.dictionaryType?(a=e.subarray(t.get(),t.get()+r.byteLength),l=!0):o=e.subarray(t.get(),t.get()+r.byteLength),t.add(r.byteLength)}}if("complexType"!==r.type)throw Error(`Shared dictionary column ${r.name} must be a complex (struct) column.`);if(!i||!a)throw Error(`Incomplete shared dictionary for column "${r.name}"`);let u=r.complexType.children,h=[],c=o?{}:void 0,p=0;for(let l of u){let u,f=cN(e,t,1)[0];if(0===f)continue;let d=l.name?`${r.name}${l.name}`:r.name;if(n&&!n.has(d)){pt(f,e,t);continue}if("scalarField"!==l.type||l.scalarField.physicalType!==cB.STRING)throw Error("Currently only scalar string fields are implemented for a struct.");if(f>1&&!l.nullable||1===f&&l.nullable)throw Error(`The number of streams for the child field ${l.name} does not match its nullability. nullibilty: ${l.nullable}, numStreams: ${f}`);if(l.nullable){let r=c7(e,t);u=new c9(pr(e,r.numValues,r.byteLength,t),r.numValues)}let y=pl(e,t,c7(e,t),void 0,u);if(o){if(!s)throw Error(`Incomplete shared FSST dictionary for column "${d}"`);h[p++]=new pN(d,y,i,a,s,o,u,c)}else h[p++]=new p$(d,y,i,a,u)}return h}(e,n,t,s));if(i)if(Array.isArray(i))for(let e of i)d.push(e);else d.push(i)}}let m=new cI(c.name,f,p,d,h);i.push(m),n.set(o)}return i}(new Uint8Array(e));this.layers=t.reduce((e,t)=>({...e,[t.name]:new fn(t)}),{})}};function fa(e,t,r,n,i){return tn(e,(e,a)=>{let s=t instanceof aj?t.get(a):null;return"object"==typeof s&&s&&"evaluate"in s?s.evaluate(r,n,void 0,i):s})}function fs(e,t){return t-e}ak("FeatureIndex",class{constructor(e,t){this.tileID=e,this.x=e.canonical.x,this.y=e.canonical.y,this.z=e.canonical.z,this.grid=new aS(ez,16,0),this.grid3D=new aS(ez,16,0),this.featureIndexArray=new sz,this.promoteId=t}insert(e,t,r,n,i,a){let s=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(r,n,i);let o=a?this.grid3D:this.grid;for(let e of t){let t=[1/0,1/0,-1/0,-1/0];for(let r of e)t[0]=Math.min(t[0],r.x),t[1]=Math.min(t[1],r.y),t[2]=Math.max(t[2],r.x),t[3]=Math.max(t[3],r.y);t[0]<8192&&t[1]<8192&&t[2]>=0&&t[3]>=0&&o.insert(s,t[0],t[1],t[2],t[3])}}loadVTLayers(){return this.vtLayers||("mlt"===this.encoding?this.vtLayers=new fi(this.rawTileData).layers:this.vtLayers=new ue(new hc(this.rawTileData)).layers,this.sourceLayerCoder=new cw(this.vtLayers?Object.keys(this.vtLayers).sort():[cb])),this.vtLayers}query(e,t,r,n){this.loadVTLayers();let i=e.params,a=ez/e.tileSize/e.scale,s=ij(i.filter,"queryRenderedFeatures filter",i.globalState),o=e.queryGeometry,l=e.queryPadding*a,u=l3.fromPoints(o),h=this.grid.query(u.minX-l,u.minY-l,u.maxX+l,u.maxY+l),c=l3.fromPoints(e.cameraQueryGeometry).expandBy(l);for(let t of this.grid3D.query(c.minX,c.minY,c.maxX,c.maxY,(t,r,n,i)=>(function(e,t,r,n,i){for(let a of e)if(t<=a.x&&r<=a.y&&n>=a.x&&i>=a.y)return!0;let a=[new C(t,r),new C(t,i),new C(n,i),new C(n,r)];if(e.length>2){for(let t of a)if(oV(e,t))return!0}for(let t=0;t<e.length-1;t++)if(function(e,t,r){let n=r[0],i=r[2];if(e.x<n.x&&t.x<n.x||e.x>i.x&&t.x>i.x||e.y<n.y&&t.y<n.y||e.y>i.y&&t.y>i.y)return!1;let a=tl(e,t,r[0]);return a!==tl(e,t,r[1])||a!==tl(e,t,r[2])||a!==tl(e,t,r[3])}(e[t],e[t+1],a))return!0;return!1})(e.cameraQueryGeometry,t-l,r-l,n+l,i+l)))h.push(t);h.sort(fs);let p={},f;for(let l of h){if(l===f)continue;f=l;let u=this.featureIndexArray.get(l),h=null;
2this.loadMatchingFeature(p,u.bucketIndex,u.sourceLayerIndex,u.featureIndex,s,i.layers,i.availableImages,t,r,n,(t,r,n)=>(h||=oF(t),r.queryIntersectsFeature({queryGeometry:o,feature:t,featureState:n,geometry:h,zoom:this.z,transform:e.transform,pixelsToTileUnits:a,pixelPosMatrix:e.pixelPosMatrix,unwrappedTileID:this.tileID.toUnwrapped(),getElevation:e.getElevation})))}return p}loadMatchingFeature(e,t,r,n,i,a,s,o,l,u,h){let c=this.bucketLayerIDs[t];if(a&&!c.some(e=>a.has(e)))return;let p=this.sourceLayerCoder.decode(r),f=this.vtLayers[p].feature(n);if(i.needGeometry){let e=ok(f,!0);if(!i.filter(new az(this.tileID.overscaledZ),e,this.tileID.canonical))return}else if(!i.filter(new az(this.tileID.overscaledZ),f))return;let d=this.getId(f,p);for(let t of c){if(a&&!a.has(t))continue;let r=o[t];if(!r)continue;let i={};d&&u&&(i=u.getState(r.sourceLayer||"_geojsonTileLayer",d));let c=e6({},l[t]);c.paint=fa(c.paint,r.paint,f,i,s),c.layout=fa(c.layout,r.layout,f,i,s);let p=!h||h(f,r,i);if(!p)continue;let y=new cD(f,this.z,this.x,this.y,d);y.layer=c;let m=e[t];void 0===m&&(m=e[t]=[]),m.push({featureIndex:n,feature:y,intersectionZ:p})}}lookupSymbolFeatures(e,t,r,n,i,a,s,o){let l={};this.loadVTLayers();let u=ij(i.filterSpec,"queryRenderedFeatures symbol filter",i.globalState);for(let i of e)this.loadMatchingFeature(l,r,n,i,u,a,s,o,t);return l}hasLayer(e){for(let t of this.bucketLayerIDs)for(let r of t)if(e===r)return!0;return!1}getId(e,t){let r=e.id;if(this.promoteId){let n="string"==typeof this.promoteId?this.promoteId:this.promoteId[t];"boolean"==typeof(r=e.properties[n])&&(r=Number(r)),void 0===r&&e.properties?.cluster&&this.promoteId&&(r=Number(e.properties.cluster_id))}return r}},{omit:["rawTileData","sourceLayerCoder"]});var fo=class{constructor(e,t){this.max=e,this.onRemove=t,this.reset()}reset(){for(let e in this.data)for(let t of this.data[e])t.timeout&&clearTimeout(t.timeout),this.onRemove(t.value);return this.data={},this.order=[],this}add(e,t,r){let n=e.wrapped().key;void 0===this.data[n]&&(this.data[n]=[]);let i={value:t,timeout:void 0};if(void 0!==r&&(i.timeout=setTimeout(()=>{this.remove(e,i)},r)),this.data[n].push(i),this.order.push(n),this.order.length>this.max){let e=this._getAndRemoveByKey(this.order[0]);e&&this.onRemove(e)}return this}has(e){return e.wrapped().key in this.data}getAndRemove(e){return this.has(e)?this._getAndRemoveByKey(e.wrapped().key):null}_getAndRemoveByKey(e){let t=this.data[e].shift();return t.timeout&&clearTimeout(t.timeout),0===this.data[e].length&&delete this.data[e],this.order.splice(this.order.indexOf(e),1),t.value}getByKey(e){let t=this.data[e];return t?t[0].value:null}get(e){return this.has(e)?this.data[e.wrapped().key][0].value:null}remove(e,t){if(!this.has(e))return this;let r=e.wrapped().key,n=void 0===t?0:this.data[r].indexOf(t),i=this.data[r][n];return this.data[r].splice(n,1),i.timeout&&clearTimeout(i.timeout),0===this.data[r].length&&delete this.data[r],this.onRemove(i.value),this.order.splice(this.order.indexOf(r),1),this}setMaxSize(e){for(this.max=e;this.order.length>this.max;){let e=this._getAndRemoveByKey(this.order[0]);e&&this.onRemove(e)}return this}filter(e){let t=[];for(let r in this.data)for(let n of this.data[r])e(n.value)||t.push(n);for(let e of t)this.remove(e.value.tileID,e)}}}}]); 3//# sourceMappingURL=0e45d658-1c9a35b40083e5a9.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.